From 029bf038708559c0393d7ad3f7307fe2902cbef3 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Tue, 2 Nov 2021 13:41:55 -0700 Subject: [PATCH 001/948] Changed PassBuilder's job dependencies to be OrderOnce. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using a normal job dependency was overkill. As a result, modifying a shader would trigger a pass to rebuild, and that would cause the entire render pipeline to reinitialize. This causes a lot of unnecessary churn that made debugging shader hot reloads difficult. When a builder depends on knowing the UUID of another asset, it does need to have a job dependency on that asset. But when the builder doesn’t actually consume any data from inside the asset, and it just needs the ID, it is best to use JobDependencyType::OrderOnce to simply make sure the AP knows about the asset. Also, the call to GetSourceInfoBySourcePath was an unnecessary check because the AP does not require the file to exist at the time a dependency is reported. GetSourceInfoBySourcePath will only succeed after the AP has scanned the requested source file. We can’t just assume that a false result indicates the file does not exist, it just isn’t known yet. There are a couple additional use cases to be aware of (from @antonmic)... 1. Passes are critical assets, and some passes depend on shaders, so those shaders need to be processed, that's one reason for the dependency (otherwise you can start the engine, load all critical passes, try to load the shader, shader isn't ready, and bad things happen) 2. If a shader is deleted/removed, the pass should try to rebuild and fail. This was a recent issue that I fixed, you could have some odd condition where you delete a shader, but the pass that references that shader doesn't update or throw any errors because it doesn't rebuild, so the user is unaware that they need to change the .pass file and bad things happen OrderOnce is sufficient for both these cases. #1 is related to first time processing which exactly the time when OrderOnce would be applied. I tested #2 as well; deleting a .shader file with OrderOnce dependency did trigger the .pass file to rebuild and fail. Testing: Ran an ASV pass test with both an exiting cache and after deleting the local cache. Started the Editor with a clean cache and didn't encounter any startup issues. Was able to successfully load a level the first time. Deleted SkyBox.shader and saw SkyBox.pass fail in the AP. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../Source/RPI.Builders/Pass/PassBuilder.cpp | 33 +++++++------------ 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Builders/Pass/PassBuilder.cpp b/Gems/Atom/RPI/Code/Source/RPI.Builders/Pass/PassBuilder.cpp index 6a0b10633e..e2d4bd629a 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Builders/Pass/PassBuilder.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Builders/Pass/PassBuilder.cpp @@ -53,7 +53,7 @@ namespace AZ { AssetBuilderSDK::AssetBuilderDesc builder; builder.m_name = PassBuilderJobKey; - builder.m_version = 14; // making .pass files emit product dependencies for the shaders they reference so they are picked up by the asset bundler + builder.m_version = 15; // Changed dependency type to OrderOnce builder.m_busId = azrtti_typeid(); builder.m_createJobFunction = AZStd::bind(&PassBuilder::CreateJobs, this, AZStd::placeholders::_1, AZStd::placeholders::_2); builder.m_processJobFunction = AZStd::bind(&PassBuilder::ProcessJob, this, AZStd::placeholders::_1, AZStd::placeholders::_2); @@ -97,27 +97,16 @@ namespace AZ // Helper function to get a file reference and create a corresponding job dependency bool AddDependency(FindPassReferenceAssetParams& params, AssetBuilderSDK::JobDescriptor* job) { - AZStd::string_view& file = params.dependencySourceFile; - AZ::Data::AssetInfo sourceInfo; - AZStd::string watchFolder; - bool fileFound = false; - AzToolsFramework::AssetSystemRequestBus::BroadcastResult(fileFound, &AzToolsFramework::AssetSystem::AssetSystemRequest::GetSourceInfoBySourcePath, file.data(), sourceInfo, watchFolder); - - if (fileFound) - { - AssetBuilderSDK::JobDependency jobDependency; - jobDependency.m_jobKey = params.jobKey; - jobDependency.m_type = AssetBuilderSDK::JobDependencyType::Order; - jobDependency.m_sourceFile.m_sourceFileDependencyPath = file; - job->m_jobDependencyList.push_back(jobDependency); - AZ_TracePrintf(PassBuilderName, "Creating job dependency on file [%s] \n", file.data()); - return true; - } - else - { - AZ_Error(PassBuilderName, false, "Could not find referenced file [%s]", file.data()); - return false; - } + // We use an OrderOnce job dependency to ensure that the Asset Processor knows about the + // referenced asset, so we can make an AssetId for it later in ProcessJob. OrderOnce is + // enough because we don't need to read any data from the asset, we just needs its ID. + AssetBuilderSDK::JobDependency jobDependency; + jobDependency.m_jobKey = params.jobKey; + jobDependency.m_type = AssetBuilderSDK::JobDependencyType::OrderOnce; + jobDependency.m_sourceFile.m_sourceFileDependencyPath = params.dependencySourceFile; + job->m_jobDependencyList.push_back(jobDependency); + AZ_TracePrintf(PassBuilderName, "Creating job dependency on file [%.*s] \n", AZ_STRING_ARG(params.dependencySourceFile)); + return true; } bool SetJobKeyForExtension(const AZStd::string& filePath, FindPassReferenceAssetParams& params) From 1909d43dcc424c84452a7f8e70f350a0eec996e0 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 23 Nov 2021 17:57:45 -0800 Subject: [PATCH 002/948] initial version ported from an old implementation Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Tests/Memory/AllocatorBenchmarks.cpp | 483 ++++++++++++++++++ .../Memory/AllocatorBenchmarks_Linux.cpp | 31 ++ .../Platform/Linux/platform_linux_files.cmake | 1 + .../Tests/Memory/AllocatorBenchmarks_Mac.cpp | 30 ++ .../Platform/Mac/platform_mac_files.cmake | 1 + .../Memory/AllocatorBenchmarks_Windows.cpp | 74 +++ .../Windows/platform_windows_files.cmake | 1 + .../AzCore/Tests/azcoretests_files.cmake | 1 + 8 files changed, 622 insertions(+) create mode 100644 Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp create mode 100644 Code/Framework/AzCore/Tests/Platform/Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp create mode 100644 Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp create mode 100644 Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp new file mode 100644 index 0000000000..2bac12fe83 --- /dev/null +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -0,0 +1,483 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#if defined(HAVE_BENCHMARK) + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +namespace Benchmark +{ + namespace Platform + { + size_t GetProcessMemoryUsageBytes(); + size_t GetMemorySize(void* memory); + } + + static AZ::Debug::DrillerManager* s_drillerManager = nullptr; + + template + class TestAllocator : public TAllocator + { + public: + TestAllocator() + : TAllocator() + { + } + + static void SetUp() + { + AZ::AllocatorInstance::Create(); + + s_drillerManager = AZ::Debug::DrillerManager::Create(); + s_drillerManager->Register(aznew AZ::Debug::MemoryDriller); + } + + static void TearDown() + { + AZ::Debug::DrillerManager::Destroy(s_drillerManager); + s_drillerManager = nullptr; + + AZ::AllocatorInstance::Destroy(); + } + + typename TAllocator::pointer_type Allocate( + typename TAllocator::size_type byteSize, + typename TAllocator::size_type alignment, + int = 0, + const char* = nullptr, + const char* = nullptr, + int = 0, + unsigned int = 0) override + { + return AZ::AllocatorInstance::Get().Allocate(byteSize, alignment); + } + + void DeAllocate( + typename TAllocator::pointer_type ptr, + typename TAllocator::size_type byteSize = 0, + typename TAllocator::size_type = 0) override + { + AZ::AllocatorInstance::Get().DeAllocate(ptr, byteSize); + } + + typename TAllocator::pointer_type ReAllocate( + typename TAllocator::pointer_type ptr, + typename TAllocator::size_type newSize, + typename TAllocator::size_type newAlignment) override + { + return AZ::AllocatorInstance::Get().ReAllocate(ptr, newSize, newAlignment); + } + + typename TAllocator::size_type Resize(typename TAllocator::pointer_type ptr, typename TAllocator::size_type newSize) override + { + return AZ::AllocatorInstance::Get().Resize(ptr, newSize); + } + + void GarbageCollect() override + { + AZ::AllocatorInstance::Get().GarbageCollect(); + } + + typename TAllocator::size_type NumAllocatedBytes() const override + { + return AZ::AllocatorInstance::Get().NumAllocatedBytes() + + AZ::AllocatorInstance::Get().GetUnAllocatedMemory(); + } + }; +} + +namespace AZ +{ + AZ_TYPE_INFO_TEMPLATE(Benchmark::TestAllocator, "{ACE2D6E5-4EB8-4DD2-AE95-6BDFD0476801}", AZ_TYPE_INFO_CLASS); +} + +namespace Benchmark +{ + class TestRawMallocAllocator {}; + + template <> + class TestAllocator + : public TestRawMallocAllocator + { + public: + struct Descriptor {}; + + TestAllocator() + {} + + static void SetUp() + { + s_numAllocatedBytes = 0; + } + + static void TearDown() + {} + + void* Allocate( + size_t byteSize, + size_t alignment, + int = 0, + const char* = nullptr, + const char* = nullptr, + int = 0, + unsigned int = 0) + { + s_numAllocatedBytes += byteSize; + if (alignment) + { + return AZ_OS_MALLOC(byteSize, alignment); + } + else + { + return AZ_OS_MALLOC(byteSize, 1); + } + } + + static void DeAllocate(void* ptr, size_t = 0) + { + s_numAllocatedBytes -= Platform::GetMemorySize(ptr); + AZ_OS_FREE(ptr); + } + + static void* ReAllocate(void* ptr, size_t newSize, size_t newAlignment) + { + s_numAllocatedBytes -= Platform::GetMemorySize(ptr); + AZ_OS_FREE(ptr); + + s_numAllocatedBytes += newSize; + if (newAlignment) + { + return AZ_OS_MALLOC(newSize, newAlignment); + } + else + { + return AZ_OS_MALLOC(newSize, 1); + } + } + + static size_t Resize(void* ptr, size_t newSize) + { + AZ_UNUSED(ptr); + AZ_UNUSED(newSize); + + return 0; + } + + static void GarbageCollect() + {} + + static size_t NumAllocatedBytes() + { + return s_numAllocatedBytes; + } + + private: + static size_t s_numAllocatedBytes; + }; + + size_t TestAllocator::s_numAllocatedBytes = 0; + + // Here we require to implement this to be able to configure a name for the allocator, otherswise the AllocatorManager crashes when trying to configure the overrides + class TestMallocSchemaAllocator : public AZ::SimpleSchemaAllocator + { + public: + AZ_TYPE_INFO(TestMallocSchemaAllocator, "{3E68224F-E676-402C-8276-CE4B49C05E89}"); + + TestMallocSchemaAllocator() + : AZ::SimpleSchemaAllocator("TestMallocSchemaAllocator", "") + {} + }; + + class TestHeapSchemaAllocator : public AZ::SimpleSchemaAllocator + { + public: + AZ_TYPE_INFO(TestHeapSchemaAllocator, "{456E6C30-AA84-488F-BE47-5C1E6AF636B7}"); + + TestHeapSchemaAllocator() + : AZ::SimpleSchemaAllocator("TestHeapSchemaAllocator", "") + {} + }; + + class TestHphaSchemaAllocator : public AZ::SimpleSchemaAllocator + { + public: + AZ_TYPE_INFO(TestHphaSchemaAllocator, "{6563AB4B-A68E-4499-8C98-D61D640D1F7F}"); + + TestHphaSchemaAllocator() + : AZ::SimpleSchemaAllocator("TestHphaSchemaAllocator", "") + {} + }; + + class TestSystemAllocator : public AZ::SystemAllocator + { + public: + AZ_TYPE_INFO(TestSystemAllocator, "{360D4DAA-D65D-4D5C-A6FA-1A4C5261C35C}"); + + TestSystemAllocator() + : AZ::SystemAllocator() + {} + }; +} + +namespace AZ +{ + AZ_TYPE_INFO_SPECIALIZE(Benchmark::TestAllocator, "{1065B446-4873-4B3E-9CB1-069E148D4DF6}"); + AZ_TYPE_INFO_SPECIALIZE(Benchmark::TestAllocator, "{92CFDF86-02EE-4247-9809-884EE9F7BA18}"); + AZ_TYPE_INFO_SPECIALIZE(Benchmark::TestAllocator, "{67DA01DF-9232-493A-B11C-6952FEDEB2A9}"); + AZ_TYPE_INFO_SPECIALIZE(Benchmark::TestAllocator, "{47384CB4-6729-43A9-B0CE-402E3A7AEFB2}"); + AZ_TYPE_INFO_SPECIALIZE(Benchmark::TestAllocator, "{096423BC-DC36-48D2-8E89-8F1D600F488A}"); +} + +namespace Benchmark +{ + // Allocated bytes reported by the allocator / actually requested bytes + static const char* s_counterAllocatorMemoryRatio = "Allocator_MemoryRatio"; + + // Allocated bytes reported by the process / actually requested bytes + static const char* s_counterProcessMemoryRatio = "Process_MemoryRatio"; + + enum AllocationSize + { + SMALL, + BIG, + MIXED, + COUNT + }; + + static const size_t s_kiloByte = 1024; + static const size_t s_megaByte = s_kiloByte * s_kiloByte; + using AllocationSizeArray = AZStd::array; + static const AZStd::array s_allocationSizes = { + /* SMALL */ AllocationSizeArray{ 2, 16, 20, 59, 100, 128, 160, 250, 300, 512 }, + /* BIG */ AllocationSizeArray{ 513, s_kiloByte, 2 * s_kiloByte, 4 * s_kiloByte, 10 * s_kiloByte, 64 * s_kiloByte, 128 * s_kiloByte, 200 * s_kiloByte, s_megaByte, 2 * s_megaByte }, + /* MIXED */ AllocationSizeArray{ 2, s_kiloByte, 59, 4 * s_kiloByte, 128, 200 * s_kiloByte, 250, s_megaByte, 512, 2 * s_megaByte } + }; + + template + class AllocatorBenchmarkFixture + : public ::benchmark::Fixture + { + protected: + using TestAllocatorType = TestAllocator; + + virtual void internalSetUp(const ::benchmark::State&) + { + TestAllocatorType::SetUp(); + } + + virtual void internalTearDown(const ::benchmark::State&) + { + TestAllocatorType::TearDown(); + } + + public: + void SetUp(const ::benchmark::State& state) override + { + internalSetUp(state); + } + void SetUp(::benchmark::State& state) override + { + internalSetUp(state); + } + + void TearDown(const ::benchmark::State& state) override + { + internalTearDown(state); + } + void TearDown(::benchmark::State& state) override + { + internalTearDown(state); + } + }; + + template + class AllocationBenchmarkFixture + : public AllocatorBenchmarkFixture + { + using TestAllocatorType = AllocatorBenchmarkFixture::TestAllocatorType; + + void internalSetUp(const ::benchmark::State& state) override + { + AllocatorBenchmarkFixture::SetUp(state); + + m_allocations.resize(state.range_x(), nullptr); + } + + void internalTearDown(const ::benchmark::State& state) override + { + m_allocations.clear(); + m_allocations.shrink_to_fit(); + + AllocatorBenchmarkFixture::TearDown(state); + } + + public: + void Benchmark(benchmark::State& state) + { + TestAllocatorType allocatorType; + + for (auto _ : state) + { + const size_t processMemoryBaseline = Platform::GetProcessMemoryUsageBytes(); + + const size_t numberOfAllocations = m_allocations.size(); + for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) + { + state.PauseTiming(); + const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; + const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; + + state.ResumeTiming(); + m_allocations[allocationIndex] = allocatorType.Allocate(allocationSize, 0); + } + + state.PauseTiming(); + state.counters[s_counterAllocatorMemoryRatio] = + benchmark::Counter(static_cast(allocatorType.NumAllocatedBytes()), benchmark::Counter::kDefaults); + state.counters[s_counterProcessMemoryRatio] = benchmark::Counter( + static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), + benchmark::Counter::kDefaults); + + for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) + { + const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; + const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; + allocatorType.DeAllocate(m_allocations[allocationIndex], allocationSize); + m_allocations[allocationIndex] = nullptr; + } + allocatorType.GarbageCollect(); + + state.SetItemsProcessed(numberOfAllocations); + state.ResumeTiming(); + } + } + + private: + AZStd::vector m_allocations; + }; + + template + class DeAllocationBenchmarkFixture + : public AllocatorBenchmarkFixture + { + using TestAllocatorType = AllocatorBenchmarkFixture::TestAllocatorType; + + void internalSetUp(const ::benchmark::State& state) override + { + AllocatorBenchmarkFixture::SetUp(state); + + m_allocations.resize(state.range_x(), nullptr); + } + + void internalTearDown(const ::benchmark::State& state) override + { + m_allocations.clear(); + m_allocations.shrink_to_fit(); + + AllocatorBenchmarkFixture::TearDown(state); + } + public: + void Benchmark(benchmark::State& state) + { + TestAllocatorType allocatorType; + + for (auto _ : state) + { + state.PauseTiming(); + const size_t processMemoryBaseline = Platform::GetProcessMemoryUsageBytes(); + + const size_t numberOfAllocations = m_allocations.size(); + for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) + { + const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; + const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; + m_allocations[allocationIndex] = allocatorType.Allocate(allocationSize, 0); + } + + for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) + { + const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; + const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; + state.ResumeTiming(); + allocatorType.DeAllocate(m_allocations[allocationIndex], allocationSize); + state.PauseTiming(); + m_allocations[allocationIndex] = nullptr; + } + + state.counters[s_counterAllocatorMemoryRatio] = + benchmark::Counter(static_cast(allocatorType.NumAllocatedBytes()), benchmark::Counter::kDefaults); + state.counters[s_counterProcessMemoryRatio] = benchmark::Counter( + static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), + benchmark::Counter::kDefaults); + + state.SetItemsProcessed(numberOfAllocations); + + allocatorType.GarbageCollect(); + + state.ResumeTiming(); + } + } + + private: + AZStd::vector m_allocations; + }; + + static void RunRanges(benchmark::internal::Benchmark* b) + { + for (int i = 0; i < 6; ++i) + { + b->Arg((1 << i) * 1000); + } + } + +#define BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME, ...) \ + BENCHMARK_TEMPLATE_DEFINE_F(FIXTURE, TESTNAME, __VA_ARGS__)(benchmark::State& state) { Benchmark(state); } \ + BENCHMARK_REGISTER_F(FIXTURE, TESTNAME) + +#define BM_REGISTER_SIZE_FIXTURES(FIXTURE, TESTNAME, ALLOCATORTYPE) \ + BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_SMALL, ALLOCATORTYPE, SMALL)->Apply(RunRanges); \ + BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_BIG, ALLOCATORTYPE, BIG)->Apply(RunRanges); \ + BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_MIXED, ALLOCATORTYPE, MIXED)->Apply(RunRanges); + +#define BM_REGISTER_ALLOCATOR(TESTNAME, ALLOCATORTYPE) \ + namespace TESTNAME \ + { \ + BM_REGISTER_SIZE_FIXTURES(AllocationBenchmarkFixture, TESTNAME, ALLOCATORTYPE) \ + BM_REGISTER_SIZE_FIXTURES(DeAllocationBenchmarkFixture, TESTNAME, ALLOCATORTYPE) \ + } + + BM_REGISTER_ALLOCATOR(RawMallocAllocator, TestRawMallocAllocator); + BM_REGISTER_ALLOCATOR(MallocSchemaAllocator, TestMallocSchemaAllocator); + BM_REGISTER_ALLOCATOR(HeapSchemaAllocator, TestHeapSchemaAllocator); + BM_REGISTER_ALLOCATOR(HphaSchemaAllocator, TestHphaSchemaAllocator); + BM_REGISTER_ALLOCATOR(SystemAllocator, TestSystemAllocator); + + //BM_REGISTER_SCHEMA(BestFitExternalMapSchema); // Requires to implement AZ::IAllocatorAllocate + //BM_REGISTER_SCHEMA(PoolSchema); // Requires special alignment requests while allocating + +#undef BM_REGISTER_ALLOCATOR +#undef BM_REGISTER_SIZE_FIXTURES +#undef BM_REGISTER_TEMPLATE + +} // Benchmark + +#endif // HAVE_BENCHMARK diff --git a/Code/Framework/AzCore/Tests/Platform/Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp b/Code/Framework/AzCore/Tests/Platform/Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp new file mode 100644 index 0000000000..49ecefda49 --- /dev/null +++ b/Code/Framework/AzCore/Tests/Platform/Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp @@ -0,0 +1,31 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include + +#include +#include + +namespace Benchmark +{ + namespace Platform + { + size_t GetProcessMemoryUsageBytes() + { + struct rusage rusage; + getrusage(RUSAGE_SELF, &rusage); + return rusage.ru_maxrss * 1024L; + } + + size_t GetMemorySize(void* memory) + { + return memory ? _aligned_msize(memory, 1, 0) : 0; + } + } +} diff --git a/Code/Framework/AzCore/Tests/Platform/Linux/platform_linux_files.cmake b/Code/Framework/AzCore/Tests/Platform/Linux/platform_linux_files.cmake index 844b621e05..953dbb7791 100644 --- a/Code/Framework/AzCore/Tests/Platform/Linux/platform_linux_files.cmake +++ b/Code/Framework/AzCore/Tests/Platform/Linux/platform_linux_files.cmake @@ -9,4 +9,5 @@ set(FILES Tests/UtilsTests_Linux.cpp ../Common/UnixLike/Tests/UtilsTests_UnixLike.cpp + Tests/Memory/AllocatorBenchmarks_Linux.cpp ) diff --git a/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp b/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp new file mode 100644 index 0000000000..374d9f81f7 --- /dev/null +++ b/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp @@ -0,0 +1,30 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include + +#include + +namespace Benchmark +{ + namespace Platform + { + size_t GetProcessMemoryUsageBytes() + { + struct rusage rusage; + getrusage(RUSAGE_SELF, &rusage); + return rusage.ru_maxrss; + } + + size_t GetMemorySize(void* memory) + { + return memory ? _aligned_msize(memory, 1, 0) : 0; + } + } +} diff --git a/Code/Framework/AzCore/Tests/Platform/Mac/platform_mac_files.cmake b/Code/Framework/AzCore/Tests/Platform/Mac/platform_mac_files.cmake index 93d2daf2b8..14e39d47f4 100644 --- a/Code/Framework/AzCore/Tests/Platform/Mac/platform_mac_files.cmake +++ b/Code/Framework/AzCore/Tests/Platform/Mac/platform_mac_files.cmake @@ -9,4 +9,5 @@ set(FILES ../Common/Apple/Tests/UtilsTests_Apple.cpp ../Common/UnixLike/Tests/UtilsTests_UnixLike.cpp + Tests/Memory/AllocatorBenchmarks_Mac.cpp ) diff --git a/Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp b/Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp new file mode 100644 index 0000000000..9f4efd7a2c --- /dev/null +++ b/Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp @@ -0,0 +1,74 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include + +#include +#include + +namespace Benchmark +{ + namespace Platform + { + size_t GetProcessMemoryUsageBytes() + { + EmptyWorkingSet(GetCurrentProcess()); + + //PROCESS_MEMORY_COUNTERS_EX pmc; + //GetProcessMemoryInfo(GetCurrentProcess(), (PPROCESS_MEMORY_COUNTERS)&pmc, sizeof(pmc)); + //return pmc.PrivateUsage; + //return pmc.WorkingSetSize; + + //size_t memoryUsage = 0; + //HANDLE defaultProcessHeap = GetProcessHeap(); + //PROCESS_HEAP_ENTRY heapEntry; + //if (HeapLock(defaultProcessHeap) == FALSE) + //{ + // AZ_Error("Benchmark", false, "Could not lock process' heap, error: %d", GetLastError()); + // return memoryUsage; + //} + + //heapEntry.lpData = NULL; + //while (HeapWalk(defaultProcessHeap, &heapEntry) != FALSE) + //{ + // memoryUsage += heapEntry.cbData; + //} + + //DWORD lastError = GetLastError(); + //if (lastError != ERROR_NO_MORE_ITEMS) + //{ + // AZ_Error("Benchmark", false, "HeapWalk failed with LastError %d", lastError); + //} + + //if (HeapUnlock(defaultProcessHeap) == FALSE) + //{ + // AZ_Error("Benchmark", false, "Failed to unlock heap with LastError %d", GetLastError()); + //} + + //return memoryUsage; + + size_t memoryUsage = 0; + + MEMORY_BASIC_INFORMATION mbi = { 0 }; + unsigned char* pEndRegion = NULL; + while (sizeof(mbi) == VirtualQuery(pEndRegion, &mbi, sizeof(mbi))) { + pEndRegion += mbi.RegionSize; + if ((mbi.AllocationProtect & PAGE_READWRITE) && (mbi.State & MEM_COMMIT)) { + memoryUsage += mbi.RegionSize; + } + } + return memoryUsage; + } + + size_t GetMemorySize(void* memory) + { + return memory ? _aligned_msize(memory, 1, 0) : 0; + } + } +} diff --git a/Code/Framework/AzCore/Tests/Platform/Windows/platform_windows_files.cmake b/Code/Framework/AzCore/Tests/Platform/Windows/platform_windows_files.cmake index 0a96dad34e..97b12b28e6 100644 --- a/Code/Framework/AzCore/Tests/Platform/Windows/platform_windows_files.cmake +++ b/Code/Framework/AzCore/Tests/Platform/Windows/platform_windows_files.cmake @@ -9,6 +9,7 @@ set(FILES ../Common/WinAPI/Tests/UtilsTests_WinAPI.cpp Tests/IO/Streamer/StorageDriveTests_Windows.cpp + Tests/Memory/AllocatorBenchmarks_Windows.cpp Tests/Memory/OverrunDetectionAllocator_Windows.cpp Tests/Serialization_Windows.cpp ) diff --git a/Code/Framework/AzCore/Tests/azcoretests_files.cmake b/Code/Framework/AzCore/Tests/azcoretests_files.cmake index d39595c45e..6762e07d0a 100644 --- a/Code/Framework/AzCore/Tests/azcoretests_files.cmake +++ b/Code/Framework/AzCore/Tests/azcoretests_files.cmake @@ -170,6 +170,7 @@ set(FILES Math/Vector3Tests.cpp Math/Vector4PerformanceTests.cpp Math/Vector4Tests.cpp + Memory/AllocatorBenchmarks.cpp Memory/AllocatorManager.cpp Memory/HphaSchema.cpp Memory/HphaSchemaErrorDetection.cpp From 35c1751694ce245b2a033c195a83a094140ec1a0 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 23 Nov 2021 18:31:00 -0800 Subject: [PATCH 003/948] simplification of code Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Tests/Memory/AllocatorBenchmarks.cpp | 183 +++++++++--------- 1 file changed, 92 insertions(+), 91 deletions(-) diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp index 2bac12fe83..af87584fc6 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -34,15 +34,15 @@ namespace Benchmark static AZ::Debug::DrillerManager* s_drillerManager = nullptr; + /// + /// Test allocator wrapper that redirects the calls to the passed TAllocator by using AZ::AllocatorInstance. + /// It also creates/destroys the TAllocator type and connects the driller (to reflect what happens at runtime) + /// + /// Allocator type to wrap template - class TestAllocator : public TAllocator + class TestAllocatorWrapper { public: - TestAllocator() - : TAllocator() - { - } - static void SetUp() { AZ::AllocatorInstance::Create(); @@ -59,89 +59,81 @@ namespace Benchmark AZ::AllocatorInstance::Destroy(); } - typename TAllocator::pointer_type Allocate( - typename TAllocator::size_type byteSize, - typename TAllocator::size_type alignment, - int = 0, - const char* = nullptr, - const char* = nullptr, - int = 0, - unsigned int = 0) override + static void* Allocate(size_t byteSize, size_t alignment) { return AZ::AllocatorInstance::Get().Allocate(byteSize, alignment); } - void DeAllocate( - typename TAllocator::pointer_type ptr, - typename TAllocator::size_type byteSize = 0, - typename TAllocator::size_type = 0) override + static void DeAllocate(void* ptr, size_t byteSize = 0) { AZ::AllocatorInstance::Get().DeAllocate(ptr, byteSize); } - typename TAllocator::pointer_type ReAllocate( - typename TAllocator::pointer_type ptr, - typename TAllocator::size_type newSize, - typename TAllocator::size_type newAlignment) override + static void* ReAllocate(void* ptr, size_t newSize, size_t newAlignment) { return AZ::AllocatorInstance::Get().ReAllocate(ptr, newSize, newAlignment); } - typename TAllocator::size_type Resize(typename TAllocator::pointer_type ptr, typename TAllocator::size_type newSize) override + static size_t Resize(void* ptr, size_t newSize) { return AZ::AllocatorInstance::Get().Resize(ptr, newSize); } - void GarbageCollect() override + static void GarbageCollect() { AZ::AllocatorInstance::Get().GarbageCollect(); } - typename TAllocator::size_type NumAllocatedBytes() const override + static size_t NumAllocatedBytes() { return AZ::AllocatorInstance::Get().NumAllocatedBytes() + AZ::AllocatorInstance::Get().GetUnAllocatedMemory(); } }; -} -namespace AZ -{ - AZ_TYPE_INFO_TEMPLATE(Benchmark::TestAllocator, "{ACE2D6E5-4EB8-4DD2-AE95-6BDFD0476801}", AZ_TYPE_INFO_CLASS); -} - -namespace Benchmark -{ - class TestRawMallocAllocator {}; - - template <> - class TestAllocator - : public TestRawMallocAllocator + /// + /// Basic allocator used as a baseline. This allocator is the most basic allocation possible with the OS (AZ_OS_MALLOC). + /// MallocSchema cannot be used here because it has extra logic that we don't want to use as a baseline. + /// + class TestRawMallocAllocator + : public AZ::AllocatorBase + , public AZ::IAllocatorAllocate { public: + AZ_TYPE_INFO(TestMallocSchemaAllocator, "{08EB400A-D723-46C6-808E-D0844C8DE206}"); + struct Descriptor {}; - TestAllocator() - {} + TestRawMallocAllocator() + : AllocatorBase(this, "TestRawMallocAllocator", "") + { + m_numAllocatedBytes = 0; + } - static void SetUp() + bool Create(const Descriptor&) { - s_numAllocatedBytes = 0; + m_numAllocatedBytes = 0; + return true; } - static void TearDown() - {} + // IAllocator + void Destroy() override + { + m_numAllocatedBytes = 0; + } + AZ::AllocatorDebugConfig GetDebugConfig() override + { + return AZ::AllocatorDebugConfig(); + } + AZ::IAllocatorAllocate* GetSchema() override + { + return nullptr; + } - void* Allocate( - size_t byteSize, - size_t alignment, - int = 0, - const char* = nullptr, - const char* = nullptr, - int = 0, - unsigned int = 0) + // IAllocatorAllocate + void* Allocate(size_t byteSize, size_t alignment, int = 0, const char* = 0, const char* = 0, int = 0, unsigned int = 0) override { - s_numAllocatedBytes += byteSize; + m_numAllocatedBytes += byteSize; if (alignment) { return AZ_OS_MALLOC(byteSize, alignment); @@ -152,18 +144,18 @@ namespace Benchmark } } - static void DeAllocate(void* ptr, size_t = 0) + void DeAllocate(void* ptr, size_t = 0, size_type = 0) override { - s_numAllocatedBytes -= Platform::GetMemorySize(ptr); + m_numAllocatedBytes -= Platform::GetMemorySize(ptr); AZ_OS_FREE(ptr); } - static void* ReAllocate(void* ptr, size_t newSize, size_t newAlignment) + void* ReAllocate(void* ptr, size_t newSize, size_t newAlignment) override { - s_numAllocatedBytes -= Platform::GetMemorySize(ptr); + m_numAllocatedBytes -= Platform::GetMemorySize(ptr); AZ_OS_FREE(ptr); - s_numAllocatedBytes += newSize; + m_numAllocatedBytes += newSize; if (newAlignment) { return AZ_OS_MALLOC(newSize, newAlignment); @@ -174,7 +166,7 @@ namespace Benchmark } } - static size_t Resize(void* ptr, size_t newSize) + size_t Resize(void* ptr, size_t newSize) override { AZ_UNUSED(ptr); AZ_UNUSED(newSize); @@ -182,20 +174,45 @@ namespace Benchmark return 0; } - static void GarbageCollect() - {} + size_t AllocationSize(void* ptr) override + { + return Platform::GetMemorySize(ptr); + } - static size_t NumAllocatedBytes() + void GarbageCollect() override {} + + size_t NumAllocatedBytes() const override + { + return m_numAllocatedBytes; + } + + size_t Capacity() const override + { + return AZ_CORE_MAX_ALLOCATOR_SIZE; // unused + } + + size_t GetMaxAllocationSize() const override + { + return AZ_CORE_MAX_ALLOCATOR_SIZE; // unused + } + + size_t GetMaxContiguousAllocationSize() const override + { + return AZ_CORE_MAX_ALLOCATOR_SIZE; // unused + } + size_t GetUnAllocatedMemory(bool = false) const override { - return s_numAllocatedBytes; + return 0; // unused + } + IAllocatorAllocate* GetSubAllocator() override + { + return nullptr; // unused } private: - static size_t s_numAllocatedBytes; + size_t m_numAllocatedBytes; }; - size_t TestAllocator::s_numAllocatedBytes = 0; - // Here we require to implement this to be able to configure a name for the allocator, otherswise the AllocatorManager crashes when trying to configure the overrides class TestMallocSchemaAllocator : public AZ::SimpleSchemaAllocator { @@ -236,19 +253,7 @@ namespace Benchmark : AZ::SystemAllocator() {} }; -} -namespace AZ -{ - AZ_TYPE_INFO_SPECIALIZE(Benchmark::TestAllocator, "{1065B446-4873-4B3E-9CB1-069E148D4DF6}"); - AZ_TYPE_INFO_SPECIALIZE(Benchmark::TestAllocator, "{92CFDF86-02EE-4247-9809-884EE9F7BA18}"); - AZ_TYPE_INFO_SPECIALIZE(Benchmark::TestAllocator, "{67DA01DF-9232-493A-B11C-6952FEDEB2A9}"); - AZ_TYPE_INFO_SPECIALIZE(Benchmark::TestAllocator, "{47384CB4-6729-43A9-B0CE-402E3A7AEFB2}"); - AZ_TYPE_INFO_SPECIALIZE(Benchmark::TestAllocator, "{096423BC-DC36-48D2-8E89-8F1D600F488A}"); -} - -namespace Benchmark -{ // Allocated bytes reported by the allocator / actually requested bytes static const char* s_counterAllocatorMemoryRatio = "Allocator_MemoryRatio"; @@ -277,7 +282,7 @@ namespace Benchmark : public ::benchmark::Fixture { protected: - using TestAllocatorType = TestAllocator; + using TestAllocatorType = TestAllocatorWrapper; virtual void internalSetUp(const ::benchmark::State&) { @@ -333,8 +338,6 @@ namespace Benchmark public: void Benchmark(benchmark::State& state) { - TestAllocatorType allocatorType; - for (auto _ : state) { const size_t processMemoryBaseline = Platform::GetProcessMemoryUsageBytes(); @@ -347,12 +350,12 @@ namespace Benchmark const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; state.ResumeTiming(); - m_allocations[allocationIndex] = allocatorType.Allocate(allocationSize, 0); + m_allocations[allocationIndex] = TestAllocatorType::Allocate(allocationSize, 0); } state.PauseTiming(); state.counters[s_counterAllocatorMemoryRatio] = - benchmark::Counter(static_cast(allocatorType.NumAllocatedBytes()), benchmark::Counter::kDefaults); + benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); state.counters[s_counterProcessMemoryRatio] = benchmark::Counter( static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), benchmark::Counter::kDefaults); @@ -361,10 +364,10 @@ namespace Benchmark { const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; - allocatorType.DeAllocate(m_allocations[allocationIndex], allocationSize); + TestAllocatorType::DeAllocate(m_allocations[allocationIndex], allocationSize); m_allocations[allocationIndex] = nullptr; } - allocatorType.GarbageCollect(); + TestAllocatorType::GarbageCollect(); state.SetItemsProcessed(numberOfAllocations); state.ResumeTiming(); @@ -398,8 +401,6 @@ namespace Benchmark public: void Benchmark(benchmark::State& state) { - TestAllocatorType allocatorType; - for (auto _ : state) { state.PauseTiming(); @@ -410,7 +411,7 @@ namespace Benchmark { const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; - m_allocations[allocationIndex] = allocatorType.Allocate(allocationSize, 0); + m_allocations[allocationIndex] = TestAllocatorType::Allocate(allocationSize, 0); } for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) @@ -418,20 +419,20 @@ namespace Benchmark const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; state.ResumeTiming(); - allocatorType.DeAllocate(m_allocations[allocationIndex], allocationSize); + TestAllocatorType::DeAllocate(m_allocations[allocationIndex], allocationSize); state.PauseTiming(); m_allocations[allocationIndex] = nullptr; } state.counters[s_counterAllocatorMemoryRatio] = - benchmark::Counter(static_cast(allocatorType.NumAllocatedBytes()), benchmark::Counter::kDefaults); + benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); state.counters[s_counterProcessMemoryRatio] = benchmark::Counter( static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), benchmark::Counter::kDefaults); state.SetItemsProcessed(numberOfAllocations); - allocatorType.GarbageCollect(); + TestAllocatorType::GarbageCollect(); state.ResumeTiming(); } From 3273b7621d10dc98d54864ef41b59284161f5c0d Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 23 Nov 2021 18:37:24 -0800 Subject: [PATCH 004/948] Fixes a recursive loop Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp index af87584fc6..f27c92dfb2 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -322,7 +322,7 @@ namespace Benchmark void internalSetUp(const ::benchmark::State& state) override { - AllocatorBenchmarkFixture::SetUp(state); + AllocatorBenchmarkFixture::internalSetUp(state); m_allocations.resize(state.range_x(), nullptr); } @@ -332,7 +332,7 @@ namespace Benchmark m_allocations.clear(); m_allocations.shrink_to_fit(); - AllocatorBenchmarkFixture::TearDown(state); + AllocatorBenchmarkFixture::internalTearDown(state); } public: @@ -386,7 +386,7 @@ namespace Benchmark void internalSetUp(const ::benchmark::State& state) override { - AllocatorBenchmarkFixture::SetUp(state); + AllocatorBenchmarkFixture::internalSetUp(state); m_allocations.resize(state.range_x(), nullptr); } @@ -396,7 +396,7 @@ namespace Benchmark m_allocations.clear(); m_allocations.shrink_to_fit(); - AllocatorBenchmarkFixture::TearDown(state); + AllocatorBenchmarkFixture::internalTearDown(state); } public: void Benchmark(benchmark::State& state) From 160235e86f940a63dd7a06ccb12af39622a0eff8 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 29 Nov 2021 09:03:14 -0800 Subject: [PATCH 005/948] Removing commented code of different options for getting memory usage of a process Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Memory/AllocatorBenchmarks_Windows.cpp | 34 ------------------- 1 file changed, 34 deletions(-) diff --git a/Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp b/Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp index 9f4efd7a2c..c8532687e8 100644 --- a/Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp +++ b/Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp @@ -20,41 +20,7 @@ namespace Benchmark { EmptyWorkingSet(GetCurrentProcess()); - //PROCESS_MEMORY_COUNTERS_EX pmc; - //GetProcessMemoryInfo(GetCurrentProcess(), (PPROCESS_MEMORY_COUNTERS)&pmc, sizeof(pmc)); - //return pmc.PrivateUsage; - //return pmc.WorkingSetSize; - - //size_t memoryUsage = 0; - //HANDLE defaultProcessHeap = GetProcessHeap(); - //PROCESS_HEAP_ENTRY heapEntry; - //if (HeapLock(defaultProcessHeap) == FALSE) - //{ - // AZ_Error("Benchmark", false, "Could not lock process' heap, error: %d", GetLastError()); - // return memoryUsage; - //} - - //heapEntry.lpData = NULL; - //while (HeapWalk(defaultProcessHeap, &heapEntry) != FALSE) - //{ - // memoryUsage += heapEntry.cbData; - //} - - //DWORD lastError = GetLastError(); - //if (lastError != ERROR_NO_MORE_ITEMS) - //{ - // AZ_Error("Benchmark", false, "HeapWalk failed with LastError %d", lastError); - //} - - //if (HeapUnlock(defaultProcessHeap) == FALSE) - //{ - // AZ_Error("Benchmark", false, "Failed to unlock heap with LastError %d", GetLastError()); - //} - - //return memoryUsage; - size_t memoryUsage = 0; - MEMORY_BASIC_INFORMATION mbi = { 0 }; unsigned char* pEndRegion = NULL; while (sizeof(mbi) == VirtualQuery(pEndRegion, &mbi, sizeof(mbi))) { From febaebc386225a091dc785e72d6bd99a2b3de196 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 30 Nov 2021 13:51:08 -0800 Subject: [PATCH 006/948] PR comment (NULL->nullptr) Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp b/Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp index c8532687e8..e9571a7e5b 100644 --- a/Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp +++ b/Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp @@ -22,7 +22,7 @@ namespace Benchmark size_t memoryUsage = 0; MEMORY_BASIC_INFORMATION mbi = { 0 }; - unsigned char* pEndRegion = NULL; + unsigned char* pEndRegion = nullptr; while (sizeof(mbi) == VirtualQuery(pEndRegion, &mbi, sizeof(mbi))) { pEndRegion += mbi.RegionSize; if ((mbi.AllocationProtect & PAGE_READWRITE) && (mbi.State & MEM_COMMIT)) { From 215cb9b52ffd0ee1f40325421f93d977754ed2ff Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 30 Nov 2021 16:06:26 -0800 Subject: [PATCH 007/948] Adds mulit-threaded tests Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Tests/Memory/AllocatorBenchmarks.cpp | 82 +++++++++++-------- 1 file changed, 50 insertions(+), 32 deletions(-) diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp index f27c92dfb2..7cd7e7ce0a 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -284,14 +284,34 @@ namespace Benchmark protected: using TestAllocatorType = TestAllocatorWrapper; - virtual void internalSetUp(const ::benchmark::State&) + virtual void internalSetUp(const ::benchmark::State& state) { - TestAllocatorType::SetUp(); + if (state.thread_index == 0) // Only setup in the first thread + { + TestAllocatorType::SetUp(); + + m_allocations.resize(state.threads); + for (auto& perThreadAllocations : m_allocations) + { + perThreadAllocations.resize(state.range_x(), nullptr); + } + } } - virtual void internalTearDown(const ::benchmark::State&) + virtual void internalTearDown(const ::benchmark::State& state) { - TestAllocatorType::TearDown(); + if (state.thread_index == 0) // Only setup in the first thread + { + m_allocations.clear(); + m_allocations.shrink_to_fit(); + + TestAllocatorType::TearDown(); + } + } + + AZStd::vector& GetPerThreadAllocations(size_t threadIndex) + { + return m_allocations[threadIndex]; } public: @@ -312,26 +332,25 @@ namespace Benchmark { internalTearDown(state); } + + private: + AZStd::vector> m_allocations; }; template class AllocationBenchmarkFixture : public AllocatorBenchmarkFixture { - using TestAllocatorType = AllocatorBenchmarkFixture::TestAllocatorType; + using base = AllocatorBenchmarkFixture; + using TestAllocatorType = base::TestAllocatorType; void internalSetUp(const ::benchmark::State& state) override { AllocatorBenchmarkFixture::internalSetUp(state); - - m_allocations.resize(state.range_x(), nullptr); } void internalTearDown(const ::benchmark::State& state) override { - m_allocations.clear(); - m_allocations.shrink_to_fit(); - AllocatorBenchmarkFixture::internalTearDown(state); } @@ -340,17 +359,19 @@ namespace Benchmark { for (auto _ : state) { + state.PauseTiming(); const size_t processMemoryBaseline = Platform::GetProcessMemoryUsageBytes(); - const size_t numberOfAllocations = m_allocations.size(); + AZStd::vector& perThreadAllocations = base::GetPerThreadAllocations(state.thread_index); + const size_t numberOfAllocations = perThreadAllocations.size(); for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) { - state.PauseTiming(); const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; state.ResumeTiming(); - m_allocations[allocationIndex] = TestAllocatorType::Allocate(allocationSize, 0); + perThreadAllocations[allocationIndex] = TestAllocatorType::Allocate(allocationSize, 0); + state.PauseTiming(); } state.PauseTiming(); @@ -364,8 +385,8 @@ namespace Benchmark { const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; - TestAllocatorType::DeAllocate(m_allocations[allocationIndex], allocationSize); - m_allocations[allocationIndex] = nullptr; + TestAllocatorType::DeAllocate(perThreadAllocations[allocationIndex], allocationSize); + perThreadAllocations[allocationIndex] = nullptr; } TestAllocatorType::GarbageCollect(); @@ -373,29 +394,22 @@ namespace Benchmark state.ResumeTiming(); } } - - private: - AZStd::vector m_allocations; }; template class DeAllocationBenchmarkFixture : public AllocatorBenchmarkFixture { - using TestAllocatorType = AllocatorBenchmarkFixture::TestAllocatorType; + using base = AllocatorBenchmarkFixture; + using TestAllocatorType = base::TestAllocatorType; void internalSetUp(const ::benchmark::State& state) override { AllocatorBenchmarkFixture::internalSetUp(state); - - m_allocations.resize(state.range_x(), nullptr); } void internalTearDown(const ::benchmark::State& state) override { - m_allocations.clear(); - m_allocations.shrink_to_fit(); - AllocatorBenchmarkFixture::internalTearDown(state); } public: @@ -404,14 +418,15 @@ namespace Benchmark for (auto _ : state) { state.PauseTiming(); + AZStd::vector& perThreadAllocations = base::GetPerThreadAllocations(state.thread_index); const size_t processMemoryBaseline = Platform::GetProcessMemoryUsageBytes(); - const size_t numberOfAllocations = m_allocations.size(); + const size_t numberOfAllocations = perThreadAllocations.size(); for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) { const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; - m_allocations[allocationIndex] = TestAllocatorType::Allocate(allocationSize, 0); + perThreadAllocations[allocationIndex] = TestAllocatorType::Allocate(allocationSize, 0); } for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) @@ -419,9 +434,9 @@ namespace Benchmark const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; state.ResumeTiming(); - TestAllocatorType::DeAllocate(m_allocations[allocationIndex], allocationSize); + TestAllocatorType::DeAllocate(perThreadAllocations[allocationIndex], allocationSize); state.PauseTiming(); - m_allocations[allocationIndex] = nullptr; + perThreadAllocations[allocationIndex] = nullptr; } state.counters[s_counterAllocatorMemoryRatio] = @@ -437,9 +452,6 @@ namespace Benchmark state.ResumeTiming(); } } - - private: - AZStd::vector m_allocations; }; static void RunRanges(benchmark::internal::Benchmark* b) @@ -450,14 +462,20 @@ namespace Benchmark } } + // Test under and over-subscription of threads vs the amount of CPUs available + static const unsigned int MaxThreadRange = 2 * AZStd::thread::hardware_concurrency(); + #define BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME, ...) \ BENCHMARK_TEMPLATE_DEFINE_F(FIXTURE, TESTNAME, __VA_ARGS__)(benchmark::State& state) { Benchmark(state); } \ BENCHMARK_REGISTER_F(FIXTURE, TESTNAME) + // We test small/big/mixed allocations in single-threaded environments. For multi-threaded environments, we test mixed since + // the multi threaded fixture will run multiple passes (1, 2, 4, ... until 2*hardware_concurrency) #define BM_REGISTER_SIZE_FIXTURES(FIXTURE, TESTNAME, ALLOCATORTYPE) \ BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_SMALL, ALLOCATORTYPE, SMALL)->Apply(RunRanges); \ BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_BIG, ALLOCATORTYPE, BIG)->Apply(RunRanges); \ - BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_MIXED, ALLOCATORTYPE, MIXED)->Apply(RunRanges); + BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_MIXED, ALLOCATORTYPE, MIXED)->Apply(RunRanges); \ + BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_MIXED_THREADED, ALLOCATORTYPE, MIXED)->ThreadRange(1, MaxThreadRange)->Apply(RunRanges); #define BM_REGISTER_ALLOCATOR(TESTNAME, ALLOCATORTYPE) \ namespace TESTNAME \ From f062b563c89e88b1facf32c6660bdca6cfac9057 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 30 Nov 2021 17:30:55 -0800 Subject: [PATCH 008/948] Improving runtime and making the whole duration manageable Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Tests/Memory/AllocatorBenchmarks.cpp | 44 +++++++--- .../AzCore/Tests/Memory/HphaSchema.cpp | 88 ------------------- 2 files changed, 31 insertions(+), 101 deletions(-) diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp index 7cd7e7ce0a..c1fdd4ca32 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -364,21 +364,27 @@ namespace Benchmark AZStd::vector& perThreadAllocations = base::GetPerThreadAllocations(state.thread_index); const size_t numberOfAllocations = perThreadAllocations.size(); + size_t totalAllocationSize = 0; for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) { const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; + totalAllocationSize += allocationSize; state.ResumeTiming(); perThreadAllocations[allocationIndex] = TestAllocatorType::Allocate(allocationSize, 0); state.PauseTiming(); } - state.PauseTiming(); - state.counters[s_counterAllocatorMemoryRatio] = - benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); + // In allocation cases, s_counterAllocatorMemoryRatio is measuring how much over-allocation our allocators + // are doing to keep track of the memory and because of fragmentation/under-use of blocks. A ratio over 1 means + // that we are using more memory than requested. Ideally we would approximate to a ratio of 1. + state.counters[s_counterAllocatorMemoryRatio] = benchmark::Counter( + static_cast(TestAllocatorType::NumAllocatedBytes()) / static_cast(totalAllocationSize), + benchmark::Counter::kDefaults); + // s_counterProcessMemoryRatio is measuring the same ratio but using the OS to measure the used process memory state.counters[s_counterProcessMemoryRatio] = benchmark::Counter( - static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), + static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline) / static_cast(totalAllocationSize), benchmark::Counter::kDefaults); for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) @@ -391,7 +397,6 @@ namespace Benchmark TestAllocatorType::GarbageCollect(); state.SetItemsProcessed(numberOfAllocations); - state.ResumeTiming(); } } }; @@ -422,10 +427,12 @@ namespace Benchmark const size_t processMemoryBaseline = Platform::GetProcessMemoryUsageBytes(); const size_t numberOfAllocations = perThreadAllocations.size(); + size_t totalAllocationSize = 0; for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) { const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; + totalAllocationSize += allocationSize; perThreadAllocations[allocationIndex] = TestAllocatorType::Allocate(allocationSize, 0); } @@ -439,29 +446,40 @@ namespace Benchmark perThreadAllocations[allocationIndex] = nullptr; } - state.counters[s_counterAllocatorMemoryRatio] = - benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); + // In deallocation cases, s_counterAllocatorMemoryRatio is measuring how much "left-over" memory our allocators + // have after deallocations happen. This is memory that is not returned to the operative system. A ratio of 1 means + // that no memory was returned to the OS. A ratio over 1 means that we are holding more memory than requested. A ratio + // lower than 1 means that we have returned some memory. + state.counters[s_counterAllocatorMemoryRatio] = benchmark::Counter( + static_cast(TestAllocatorType::NumAllocatedBytes()) / static_cast(totalAllocationSize), + benchmark::Counter::kDefaults); + // s_counterProcessMemoryRatio is measuring the same ratio but using the OS to measure the used process memory state.counters[s_counterProcessMemoryRatio] = benchmark::Counter( - static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), + static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline) / static_cast(totalAllocationSize), benchmark::Counter::kDefaults); state.SetItemsProcessed(numberOfAllocations); TestAllocatorType::GarbageCollect(); - - state.ResumeTiming(); } } }; + // For non-threaded ranges, run 100, 400, 1600 amounts static void RunRanges(benchmark::internal::Benchmark* b) { - for (int i = 0; i < 6; ++i) + for (int i = 0; i < 6; i += 2) { - b->Arg((1 << i) * 1000); + b->Arg((1 << i) * 100); } } + // For threaded ranges, run just 200, multi-threaded will already multiply by thread + static void ThreadedRunRanges(benchmark::internal::Benchmark* b) + { + b->Arg(100); + } + // Test under and over-subscription of threads vs the amount of CPUs available static const unsigned int MaxThreadRange = 2 * AZStd::thread::hardware_concurrency(); @@ -475,7 +493,7 @@ namespace Benchmark BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_SMALL, ALLOCATORTYPE, SMALL)->Apply(RunRanges); \ BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_BIG, ALLOCATORTYPE, BIG)->Apply(RunRanges); \ BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_MIXED, ALLOCATORTYPE, MIXED)->Apply(RunRanges); \ - BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_MIXED_THREADED, ALLOCATORTYPE, MIXED)->ThreadRange(1, MaxThreadRange)->Apply(RunRanges); + BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_MIXED_THREADED, ALLOCATORTYPE, MIXED)->ThreadRange(2, MaxThreadRange)->Apply(ThreadedRunRanges); #define BM_REGISTER_ALLOCATOR(TESTNAME, ALLOCATORTYPE) \ namespace TESTNAME \ diff --git a/Code/Framework/AzCore/Tests/Memory/HphaSchema.cpp b/Code/Framework/AzCore/Tests/Memory/HphaSchema.cpp index 85dd79931d..08b84416e6 100644 --- a/Code/Framework/AzCore/Tests/Memory/HphaSchema.cpp +++ b/Code/Framework/AzCore/Tests/Memory/HphaSchema.cpp @@ -10,10 +10,6 @@ #include #include -#if defined(HAVE_BENCHMARK) -#include -#endif // HAVE_BENCHMARK - class HphaSchema_TestAllocator : public AZ::SimpleSchemaAllocator { @@ -112,87 +108,3 @@ namespace UnitTest HphaSchemaTestFixture, ::testing::ValuesIn(s_mixedInstancesParameters)); } - - -#if defined(HAVE_BENCHMARK) -namespace Benchmark -{ - class HphaSchemaBenchmarkFixture - : public ::benchmark::Fixture - { - void internalSetUp() - { - AZ::AllocatorInstance::Create(); - } - - void internalTearDown() - { - AZ::AllocatorInstance::Destroy(); - } - - public: - void SetUp(const benchmark::State&) override - { - internalSetUp(); - } - void SetUp(benchmark::State&) override - { - internalSetUp(); - } - void TearDown(const benchmark::State&) override - { - internalTearDown(); - } - void TearDown(benchmark::State&) override - { - internalTearDown(); - } - - static void BM_Allocations(benchmark::State& state, const AllocationSizeArray& allocationArray) - { - AZStd::vector allocations; - while (state.KeepRunning()) - { - state.PauseTiming(); - const size_t allocationIndex = allocations.size(); - const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; - - state.ResumeTiming(); - void* allocation = AZ::AllocatorInstance::Get().Allocate(allocationSize, 0); - - state.PauseTiming(); - allocations.emplace_back(allocation); - - state.ResumeTiming(); - } - - const size_t numberOfAllocations = allocations.size(); - state.SetItemsProcessed(numberOfAllocations); - - for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) - { - AZ::AllocatorInstance::Get().DeAllocate(allocations[allocationIndex], allocationArray[allocationIndex % allocationArray.size()]); - } - AZ::AllocatorInstance::Get().GarbageCollect(); - } - }; - - // Small allocations, these are allocations that are going to end up in buckets in the HphaSchema - BENCHMARK_F(HphaSchemaBenchmarkFixture, SmallAllocations)(benchmark::State& state) - { - BM_Allocations(state, s_smallAllocationSizes); - } - - BENCHMARK_F(HphaSchemaBenchmarkFixture, BigAllocations)(benchmark::State& state) - { - BM_Allocations(state, s_bigAllocationSizes); - } - - BENCHMARK_F(HphaSchemaBenchmarkFixture, MixedAllocations)(benchmark::State& state) - { - BM_Allocations(state, s_mixedAllocationSizes); - } - - -} // Benchmark -#endif // HAVE_BENCHMARK From 0f5cb54a38d32abacc29f1bc23d58d6032384bb6 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 30 Nov 2021 18:11:08 -0800 Subject: [PATCH 009/948] Fixes Linux build Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzCore/Tests/Memory/AllocatorBenchmarks.cpp | 10 +++------- .../Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp | 4 ++-- .../Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp | 5 +++-- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp index c1fdd4ca32..dfaefd4c0f 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -248,10 +248,6 @@ namespace Benchmark { public: AZ_TYPE_INFO(TestSystemAllocator, "{360D4DAA-D65D-4D5C-A6FA-1A4C5261C35C}"); - - TestSystemAllocator() - : AZ::SystemAllocator() - {} }; // Allocated bytes reported by the allocator / actually requested bytes @@ -293,7 +289,7 @@ namespace Benchmark m_allocations.resize(state.threads); for (auto& perThreadAllocations : m_allocations) { - perThreadAllocations.resize(state.range_x(), nullptr); + perThreadAllocations.resize(state.range(0), nullptr); } } } @@ -342,7 +338,7 @@ namespace Benchmark : public AllocatorBenchmarkFixture { using base = AllocatorBenchmarkFixture; - using TestAllocatorType = base::TestAllocatorType; + using TestAllocatorType = typename base::TestAllocatorType; void internalSetUp(const ::benchmark::State& state) override { @@ -406,7 +402,7 @@ namespace Benchmark : public AllocatorBenchmarkFixture { using base = AllocatorBenchmarkFixture; - using TestAllocatorType = base::TestAllocatorType; + using TestAllocatorType = typename base::TestAllocatorType; void internalSetUp(const ::benchmark::State& state) override { diff --git a/Code/Framework/AzCore/Tests/Platform/Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp b/Code/Framework/AzCore/Tests/Platform/Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp index 49ecefda49..636d5519d8 100644 --- a/Code/Framework/AzCore/Tests/Platform/Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp +++ b/Code/Framework/AzCore/Tests/Platform/Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp @@ -10,7 +10,7 @@ #include #include -#include +#include namespace Benchmark { @@ -25,7 +25,7 @@ namespace Benchmark size_t GetMemorySize(void* memory) { - return memory ? _aligned_msize(memory, 1, 0) : 0; + return memory ? malloc_usable_size(memory) : 0; } } } diff --git a/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp b/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp index 374d9f81f7..303b7efbb4 100644 --- a/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp +++ b/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp @@ -9,7 +9,8 @@ #include #include -#include +#include +#include namespace Benchmark { @@ -24,7 +25,7 @@ namespace Benchmark size_t GetMemorySize(void* memory) { - return memory ? _aligned_msize(memory, 1, 0) : 0; + return memory ? malloc_usable_size(memory) : 0; } } } From fbd2d60fc1cfc91a49331b304abb797524ae0270 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 30 Nov 2021 18:15:22 -0800 Subject: [PATCH 010/948] Fixes for mac Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp b/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp index 303b7efbb4..932252985a 100644 --- a/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp +++ b/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include namespace Benchmark @@ -25,7 +25,7 @@ namespace Benchmark size_t GetMemorySize(void* memory) { - return memory ? malloc_usable_size(memory) : 0; + return memory ? malloc_size(memory) : 0; } } } From 72f338a6897ff952ae0bfc564fc19fae072fbb1c Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 2 Dec 2021 11:55:36 -0800 Subject: [PATCH 011/948] Fixes for HeapSchema to get a default block if none is passed Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Framework/AzCore/AzCore/Memory/HeapSchema.cpp | 12 +----------- Code/Framework/AzCore/AzCore/Memory/HeapSchema.h | 14 ++++---------- 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Memory/HeapSchema.cpp b/Code/Framework/AzCore/AzCore/Memory/HeapSchema.cpp index aceafa1b28..1f0fc59a97 100644 --- a/Code/Framework/AzCore/AzCore/Memory/HeapSchema.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/HeapSchema.cpp @@ -115,6 +115,7 @@ namespace AZ m_ownMemoryBlock[i] = false; } + AZ_Assert(m_desc.m_numMemoryBlocks > 0, "At least one memory block is required"); for (int i = 0; i < m_desc.m_numMemoryBlocks; ++i) { if (m_desc.m_memoryBlocks[i] == nullptr) // Allocate memory block if requested! @@ -131,17 +132,6 @@ namespace AZ m_capacity += m_desc.m_memoryBlocksByteSize[i]; } - - if (m_desc.m_numMemoryBlocks == 0) - { - // Create default memory space if we can to serve for default allocations - m_memSpaces[0] = AZDLMalloc::create_mspace(0, m_desc.m_isMultithreadAlloc); - if (m_memSpaces[0]) - { - AZDLMalloc::mspace_az_set_expandable(m_memSpaces[0], true); - m_capacity = Platform::GetHeapCapacity(); - } - } } HeapSchema::~HeapSchema() diff --git a/Code/Framework/AzCore/AzCore/Memory/HeapSchema.h b/Code/Framework/AzCore/AzCore/Memory/HeapSchema.h index f72ae31057..3a7716a127 100644 --- a/Code/Framework/AzCore/AzCore/Memory/HeapSchema.h +++ b/Code/Framework/AzCore/AzCore/Memory/HeapSchema.h @@ -32,17 +32,11 @@ namespace AZ */ struct Descriptor { - Descriptor() - : m_numMemoryBlocks(0) - , m_isMultithreadAlloc(true) - {} - - static const int m_memoryBlockAlignment = 64 * 1024; static const int m_maxNumBlocks = 5; - int m_numMemoryBlocks; ///< Number of memory blocks to use. - void* m_memoryBlocks[m_maxNumBlocks]; ///< Pointers to provided memory blocks or NULL if you want the system to allocate them for you with the System Allocator. - size_t m_memoryBlocksByteSize[m_maxNumBlocks]; ///< Sizes of different memory blocks, if m_memoryBlock is 0 the block will be allocated for you with the System Allocator. - bool m_isMultithreadAlloc; ///< Set to true to enable multi threading safe allocation. + int m_numMemoryBlocks = 1; ///< Number of memory blocks to use. + void* m_memoryBlocks[m_maxNumBlocks] = {}; ///< Pointers to provided memory blocks or NULL if you want the system to allocate them for you with the System Allocator. + size_t m_memoryBlocksByteSize[m_maxNumBlocks] = {4 * 1024}; ///< Sizes of different memory blocks, if m_memoryBlock is 0 the block will be allocated for you with the System Allocator. + bool m_isMultithreadAlloc = true; ///< Set to true to enable multi threading safe allocation. }; HeapSchema(const Descriptor& desc); From c00d7ff6585c3e1240241c8d7af9dbc556f16a06 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Fri, 3 Dec 2021 00:56:40 -0800 Subject: [PATCH 012/948] Small formatting fix to jinja for autocomponent's behavior context Signed-off-by: Gene Walters --- .../AutoGen/AutoComponent_Source.jinja | 86 +++++++++---------- 1 file changed, 42 insertions(+), 44 deletions(-) diff --git a/Gems/Multiplayer/Code/Include/Multiplayer/AutoGen/AutoComponent_Source.jinja b/Gems/Multiplayer/Code/Include/Multiplayer/AutoGen/AutoComponent_Source.jinja index d0b77159f8..01bed7d52d 100644 --- a/Gems/Multiplayer/Code/Include/Multiplayer/AutoGen/AutoComponent_Source.jinja +++ b/Gems/Multiplayer/Code/Include/Multiplayer/AutoGen/AutoComponent_Source.jinja @@ -309,11 +309,11 @@ void {{ ClassName }}::Set{{ UpperFirst(Property.attrib['Name']) }}(const {{ Prop {# #} -{% macro PrintRpcParameters(printPrefix, paramDefines) %} -{% if paramDefines|count > 0 %} +{% macro PrintRpcParameters(printPrefix, paramDefines) -%} +{% if paramDefines|count > 0 -%} {{ printPrefix }}{{ ', '.join(paramDefines) }} -{% endif %} -{% endmacro %} +{%- endif %} +{%- endmacro -%} {# #} @@ -366,47 +366,45 @@ void {{ ClassName }}::{{ UpperFirst(Property.attrib['Name']) }}({{ PrintRpcParam {% set paramTypes = [] %} {% set paramDefines = [] %} {{ AutoComponentMacros.ParseRpcParams(Property, paramNames, paramTypes, paramDefines) }} - ->Method("{{ UpperFirst(Property.attrib['Name']) }}", []({{ ClassName }}* self{{ PrintRpcParameters(', ', paramDefines) }}) { -{% if (InvokeFrom == 'Server') %} - self->{{ UpperFirst(Property.attrib['Name']) }}({{ ', '.join(paramNames) }}); -{% elif (InvokeFrom == 'Authority') or (InvokeFrom == 'Autonomous') %} - if (self->m_controller) - { - self->m_controller->{{ UpperFirst(Property.attrib['Name']) }}({{ ', '.join(paramNames) }}); - } - else - { - AZ_Warning("Network RPC", false, "{{ ClassName }} {{ UpperFirst(Property.attrib['Name']) }} method failed. Entity '%s' (id: %s) {{ ClassName }} is missing the network controller. This remote-procedure can only be invoked from {{InvokeFrom}} network entities, because this entity doesn't have a controller, it must not be a {{InvokeFrom}} entity. Please check your network context before attempting to call {{ UpperFirst(Property.attrib['Name']) }}.", self->GetEntity()->GetName().c_str(), self->GetEntityId().ToString().c_str()) - } -{% endif %} - }) + ->Method("{{ UpperFirst(Property.attrib['Name']) }}", []({{ ClassName }}* self{{ PrintRpcParameters(', ', paramDefines) }}){ +{% if (InvokeFrom == 'Server') %} + self->{{ UpperFirst(Property.attrib['Name']) }}({{ ', '.join(paramNames) }}); +{% elif (InvokeFrom == 'Authority') or (InvokeFrom == 'Autonomous') %} + if (self->m_controller) + { + self->m_controller->{{ UpperFirst(Property.attrib['Name']) }}({{ ', '.join(paramNames) }}); + } + else + { + AZ_Warning("Network RPC", false, "{{ ClassName }} {{ UpperFirst(Property.attrib['Name']) }} method failed. Entity '%s' (id: %s) {{ ClassName }} is missing the network controller. This remote-procedure can only be invoked from {{InvokeFrom}} network entities, because this entity doesn't have a controller, it must not be a {{InvokeFrom}} entity. Please check your network context before attempting to call {{ UpperFirst(Property.attrib['Name']) }}.", self->GetEntity()->GetName().c_str(), self->GetEntityId().ToString().c_str()) + } +{% endif %} + }) ->Method("{{ UpperFirst(Property.attrib['Name']) }}ByEntityId", [](AZ::EntityId id{{ PrintRpcParameters(', ', paramDefines) }}) { - - AZ::Entity* entity = AZ::Interface::Get()->FindEntity(id); - if (!entity) - { - AZ_Warning("Network RPC", false, "{{ ClassName }} {{ UpperFirst(Property.attrib['Name']) }}ByEntityId failed. The entity with id %s doesn't exist, please provide a valid entity id.", id.ToString().c_str()) - return; - } - - {{ ClassName }}* networkComponent = entity->FindComponent<{{ ClassName }}>(); - if (!networkComponent) - { - AZ_Warning("Network RPC", false, "{{ ClassName }} {{ UpperFirst(Property.attrib['Name']) }}ByEntityId failed. Entity '%s' (id: %s) is missing {{ ClassName }}, be sure to add {{ ClassName }} to this entity.", entity->GetName().c_str(), id.ToString().c_str()) - return; - } -{% if (InvokeFrom == 'Server') %} - networkComponent->{{ UpperFirst(Property.attrib['Name']) }}({{ ', '.join(paramNames) }}); -{% elif (InvokeFrom == 'Authority') or (InvokeFrom == 'Autonomous') %} - {{ ClassName }}Controller* controller = static_cast<{{ ClassName }}Controller*>(networkComponent->GetController()); - if (!controller) - { - AZ_Warning("Network RPC", false, "{{ ClassName }} {{ UpperFirst(Property.attrib['Name']) }}ByEntityId method failed. Entity '%s' (id: %s) {{ ClassName }} is missing the network controller. This RemoteProcedure can only be invoked from {{InvokeFrom}} network entities, because this entity doesn't have a controller, it must not be a {{InvokeFrom}} entity. Please check your network context before attempting to call {{ UpperFirst(Property.attrib['Name']) }}.", entity->GetName().c_str(), id.ToString().c_str()) - return; - } - controller->{{ UpperFirst(Property.attrib['Name']) }}({{ ', '.join(paramNames) }}); -{% endif %} - }, { { { "Source", "The Source containing the {{ ClassName }}Controller" }{% for paramName in paramNames %}, {"{{ paramName }}"}{% endfor %}}}) + AZ::Entity* entity = AZ::Interface::Get()->FindEntity(id); + if (!entity) + { + AZ_Warning("Network RPC", false, "{{ ClassName }} {{ UpperFirst(Property.attrib['Name']) }}ByEntityId failed. The entity with id %s doesn't exist, please provide a valid entity id.", id.ToString().c_str()) + return; + } + {{ ClassName }}* networkComponent = entity->FindComponent<{{ ClassName }}>(); + if (!networkComponent) + { + AZ_Warning("Network RPC", false, "{{ ClassName }} {{ UpperFirst(Property.attrib['Name']) }}ByEntityId failed. Entity '%s' (id: %s) is missing {{ ClassName }}, be sure to add {{ ClassName }} to this entity.", entity->GetName().c_str(), id.ToString().c_str()) + return; + } +{% if (InvokeFrom == 'Server') %} + networkComponent->{{ UpperFirst(Property.attrib['Name']) }}({{ ', '.join(paramNames) }}); +{% elif (InvokeFrom == 'Authority') or (InvokeFrom == 'Autonomous') %} + {{ ClassName }}Controller* controller = static_cast<{{ ClassName }}Controller*>(networkComponent->GetController()); + if (!controller) + { + AZ_Warning("Network RPC", false, "{{ ClassName }} {{ UpperFirst(Property.attrib['Name']) }}ByEntityId method failed. Entity '%s' (id: %s) {{ ClassName }} is missing the network controller. This RemoteProcedure can only be invoked from {{InvokeFrom}} network entities, because this entity doesn't have a controller, it must not be a {{InvokeFrom}} entity. Please check your network context before attempting to call {{ UpperFirst(Property.attrib['Name']) }}.", entity->GetName().c_str(), id.ToString().c_str()) + return; + } + controller->{{ UpperFirst(Property.attrib['Name']) }}({{ ', '.join(paramNames) }}); +{% endif %} + }, { { { "Source", "The Source containing the {{ ClassName }}Controller" }{% for paramName in paramNames %}, {"{{ paramName }}"}{% endfor %}}}) ->Attribute(AZ::Script::Attributes::ToolTip, "{{Property.attrib['Description']}}") {% endif %} {% endcall %} From 308a2e4ce3771326832828c7379d3d0c6922552a Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Fri, 3 Dec 2021 15:29:55 -0800 Subject: [PATCH 013/948] Add RPC script for Authority->Autonomous message; the authority is telling each player their player id (in the order than they joined) Signed-off-by: Gene Walters --- ...tworkTestPlayerComponent.AutoComponent.xml | 4 +- .../AutoComponent_RPC.prefab | 627 ++++++ .../AutoComponent_RPC.scriptcanvas | 1958 +++++++++++++++++ .../GlobalGameData.scriptcanvas | 662 ++++++ .../GlobalGameData.scriptevents | 106 + .../AutoComponent_RPC/Player.prefab | 195 ++ .../Multiplayer/AutoComponent_RPC/tags.txt | 12 + 7 files changed, 3562 insertions(+), 2 deletions(-) create mode 100644 AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.prefab create mode 100644 AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.scriptcanvas create mode 100644 AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/GlobalGameData.scriptcanvas create mode 100644 AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/GlobalGameData.scriptevents create mode 100644 AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/Player.prefab create mode 100644 AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/tags.txt diff --git a/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml b/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml index 46d6191835..07004c4f1e 100644 --- a/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml +++ b/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml @@ -19,8 +19,8 @@ - - + + diff --git a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.prefab b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.prefab new file mode 100644 index 0000000000..a9bec3251a --- /dev/null +++ b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.prefab @@ -0,0 +1,627 @@ +{ + "ContainerEntity": { + "Id": "Entity_[1146574390643]", + "Name": "Level", + "Components": { + "Component_[10641544592923449938]": { + "$type": "EditorInspectorComponent", + "Id": 10641544592923449938 + }, + "Component_[12039882709170782873]": { + "$type": "EditorOnlyEntityComponent", + "Id": 12039882709170782873 + }, + "Component_[12265484671603697631]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12265484671603697631 + }, + "Component_[14126657869720434043]": { + "$type": "EditorEntitySortComponent", + "Id": 14126657869720434043, + "Child Entity Order": [ + "Entity_[1176639161715]", + "Entity_[12685882829720]" + ] + }, + "Component_[15230859088967841193]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 15230859088967841193, + "Parent Entity": "" + }, + "Component_[16239496886950819870]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 16239496886950819870 + }, + "Component_[5688118765544765547]": { + "$type": "EditorEntityIconComponent", + "Id": 5688118765544765547 + }, + "Component_[6545738857812235305]": { + "$type": "SelectionComponent", + "Id": 6545738857812235305 + }, + "Component_[7247035804068349658]": { + "$type": "EditorPrefabComponent", + "Id": 7247035804068349658 + }, + "Component_[9307224322037797205]": { + "$type": "EditorLockComponent", + "Id": 9307224322037797205 + }, + "Component_[9562516168917670048]": { + "$type": "EditorVisibilityComponent", + "Id": 9562516168917670048 + } + } + }, + "Entities": { + "Entity_[1155164325235]": { + "Id": "Entity_[1155164325235]", + "Name": "Sun", + "Components": { + "Component_[10440557478882592717]": { + "$type": "SelectionComponent", + "Id": 10440557478882592717 + }, + "Component_[13620450453324765907]": { + "$type": "EditorLockComponent", + "Id": 13620450453324765907 + }, + "Component_[2134313378593666258]": { + "$type": "EditorInspectorComponent", + "Id": 2134313378593666258 + }, + "Component_[234010807770404186]": { + "$type": "EditorVisibilityComponent", + "Id": 234010807770404186 + }, + "Component_[2970359110423865725]": { + "$type": "EditorEntityIconComponent", + "Id": 2970359110423865725 + }, + "Component_[3722854130373041803]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3722854130373041803 + }, + "Component_[5992533738676323195]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5992533738676323195 + }, + "Component_[7378860763541895402]": { + "$type": "AZ::Render::EditorDirectionalLightComponent", + "Id": 7378860763541895402, + "Controller": { + "Configuration": { + "Intensity": 1.0, + "CameraEntityId": "", + "ShadowFilterMethod": 1 + } + } + }, + "Component_[7892834440890947578]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 7892834440890947578, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + 0.0, + 0.0, + 13.487043380737305 + ], + "Rotate": [ + -76.13099670410156, + -0.847000002861023, + -15.8100004196167 + ] + } + }, + "Component_[8599729549570828259]": { + "$type": "EditorEntitySortComponent", + "Id": 8599729549570828259 + }, + "Component_[952797371922080273]": { + "$type": "EditorPendingCompositionComponent", + "Id": 952797371922080273 + } + } + }, + "Entity_[1159459292531]": { + "Id": "Entity_[1159459292531]", + "Name": "Ground", + "Components": { + "Component_[11701138785793981042]": { + "$type": "SelectionComponent", + "Id": 11701138785793981042 + }, + "Component_[12260880513256986252]": { + "$type": "EditorEntityIconComponent", + "Id": 12260880513256986252 + }, + "Component_[13711420870643673468]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13711420870643673468 + }, + "Component_[138002849734991713]": { + "$type": "EditorOnlyEntityComponent", + "Id": 138002849734991713 + }, + "Component_[16578565737331764849]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 16578565737331764849, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[16919232076966545697]": { + "$type": "EditorInspectorComponent", + "Id": 16919232076966545697 + }, + "Component_[5182430712893438093]": { + "$type": "EditorMaterialComponent", + "Id": 5182430712893438093 + }, + "Component_[5675108321710651991]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 5675108321710651991, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{0CD745C0-6AA8-569A-A68A-73A3270986C4}", + "subId": 277889906 + }, + "assetHint": "objects/groudplane/groundplane_512x512m.azmodel" + } + } + } + }, + "Component_[5681893399601237518]": { + "$type": "EditorEntitySortComponent", + "Id": 5681893399601237518 + }, + "Component_[592692962543397545]": { + "$type": "EditorPendingCompositionComponent", + "Id": 592692962543397545 + }, + "Component_[7090012899106946164]": { + "$type": "EditorLockComponent", + "Id": 7090012899106946164 + }, + "Component_[9410832619875640998]": { + "$type": "EditorVisibilityComponent", + "Id": 9410832619875640998 + } + } + }, + "Entity_[1163754259827]": { + "Id": "Entity_[1163754259827]", + "Name": "Camera", + "Components": { + "Component_[11895140916889160460]": { + "$type": "EditorEntityIconComponent", + "Id": 11895140916889160460 + }, + "Component_[16880285896855930892]": { + "$type": "{CA11DA46-29FF-4083-B5F6-E02C3A8C3A3D} EditorCameraComponent", + "Id": 16880285896855930892, + "Controller": { + "Configuration": { + "Field of View": 55.0, + "EditorEntityId": 15661114386016447348 + } + } + }, + "Component_[17187464423780271193]": { + "$type": "EditorLockComponent", + "Id": 17187464423780271193 + }, + "Component_[17495696818315413311]": { + "$type": "EditorEntitySortComponent", + "Id": 17495696818315413311 + }, + "Component_[18086214374043522055]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 18086214374043522055, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + -2.3000001907348633, + -3.9368600845336914, + 1.0 + ], + "Rotate": [ + -2.050307512283325, + 1.9552897214889526, + -43.623355865478516 + ] + } + }, + "Component_[18387556550380114975]": { + "$type": "SelectionComponent", + "Id": 18387556550380114975 + }, + "Component_[2654521436129313160]": { + "$type": "EditorVisibilityComponent", + "Id": 2654521436129313160 + }, + "Component_[5265045084611556958]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5265045084611556958 + }, + "Component_[7169798125182238623]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7169798125182238623 + }, + "Component_[7255796294953281766]": { + "$type": "GenericComponentWrapper", + "Id": 7255796294953281766, + "m_template": { + "$type": "FlyCameraInputComponent" + } + }, + "Component_[8866210352157164042]": { + "$type": "EditorInspectorComponent", + "Id": 8866210352157164042 + }, + "Component_[9129253381063760879]": { + "$type": "EditorOnlyEntityComponent", + "Id": 9129253381063760879 + } + } + }, + "Entity_[1168049227123]": { + "Id": "Entity_[1168049227123]", + "Name": "Grid", + "Components": { + "Component_[11443347433215807130]": { + "$type": "EditorEntityIconComponent", + "Id": 11443347433215807130 + }, + "Component_[11779275529534764488]": { + "$type": "SelectionComponent", + "Id": 11779275529534764488 + }, + "Component_[14249419413039427459]": { + "$type": "EditorInspectorComponent", + "Id": 14249419413039427459 + }, + "Component_[15448581635946161318]": { + "$type": "AZ::Render::EditorGridComponent", + "Id": 15448581635946161318, + "Controller": { + "Configuration": { + "primarySpacing": 4.0, + "primaryColor": [ + 0.501960813999176, + 0.501960813999176, + 0.501960813999176 + ], + "secondarySpacing": 0.5, + "secondaryColor": [ + 0.250980406999588, + 0.250980406999588, + 0.250980406999588 + ] + } + } + }, + "Component_[1843303322527297409]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1843303322527297409 + }, + "Component_[380249072065273654]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 380249072065273654, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[7476660583684339787]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7476660583684339787 + }, + "Component_[7557626501215118375]": { + "$type": "EditorEntitySortComponent", + "Id": 7557626501215118375 + }, + "Component_[7984048488947365511]": { + "$type": "EditorVisibilityComponent", + "Id": 7984048488947365511 + }, + "Component_[8118181039276487398]": { + "$type": "EditorOnlyEntityComponent", + "Id": 8118181039276487398 + }, + "Component_[9189909764215270515]": { + "$type": "EditorLockComponent", + "Id": 9189909764215270515 + } + } + }, + "Entity_[1172344194419]": { + "Id": "Entity_[1172344194419]", + "Name": "Shader Ball", + "Components": { + "Component_[10789351944715265527]": { + "$type": "EditorOnlyEntityComponent", + "Id": 10789351944715265527 + }, + "Component_[12037033284781049225]": { + "$type": "EditorEntitySortComponent", + "Id": 12037033284781049225 + }, + "Component_[13759153306105970079]": { + "$type": "EditorPendingCompositionComponent", + "Id": 13759153306105970079 + }, + "Component_[14135560884830586279]": { + "$type": "EditorInspectorComponent", + "Id": 14135560884830586279 + }, + "Component_[16247165675903986673]": { + "$type": "EditorVisibilityComponent", + "Id": 16247165675903986673 + }, + "Component_[18082433625958885247]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 18082433625958885247 + }, + "Component_[6472623349872972660]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6472623349872972660, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Rotate": [ + 0.0, + 0.10000000149011612, + 180.0 + ] + } + }, + "Component_[6495255223970673916]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 6495255223970673916, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{FD340C30-755C-5911-92A3-19A3F7A77931}", + "subId": 281415304 + }, + "assetHint": "objects/shaderball/shaderball_default_1m.azmodel" + } + } + } + }, + "Component_[8056625192494070973]": { + "$type": "SelectionComponent", + "Id": 8056625192494070973 + }, + "Component_[8550141614185782969]": { + "$type": "EditorEntityIconComponent", + "Id": 8550141614185782969 + }, + "Component_[9439770997198325425]": { + "$type": "EditorLockComponent", + "Id": 9439770997198325425 + } + } + }, + "Entity_[1176639161715]": { + "Id": "Entity_[1176639161715]", + "Name": "Atom Default Environment", + "Components": { + "Component_[10757302973393310045]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 10757302973393310045, + "Parent Entity": "Entity_[1146574390643]" + }, + "Component_[14505817420424255464]": { + "$type": "EditorInspectorComponent", + "Id": 14505817420424255464, + "ComponentOrderEntryArray": [ + { + "ComponentId": 10757302973393310045 + } + ] + }, + "Component_[14988041764659020032]": { + "$type": "EditorLockComponent", + "Id": 14988041764659020032 + }, + "Component_[15808690248755038124]": { + "$type": "SelectionComponent", + "Id": 15808690248755038124 + }, + "Component_[15900837685796817138]": { + "$type": "EditorVisibilityComponent", + "Id": 15900837685796817138 + }, + "Component_[3298767348226484884]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3298767348226484884 + }, + "Component_[4076975109609220594]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4076975109609220594 + }, + "Component_[5679760548946028854]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5679760548946028854 + }, + "Component_[5855590796136709437]": { + "$type": "EditorEntitySortComponent", + "Id": 5855590796136709437, + "Child Entity Order": [ + "Entity_[1155164325235]", + "Entity_[1180934129011]", + "Entity_[1172344194419]", + "Entity_[1168049227123]", + "Entity_[1163754259827]", + "Entity_[1159459292531]" + ] + }, + "Component_[9277695270015777859]": { + "$type": "EditorEntityIconComponent", + "Id": 9277695270015777859 + } + } + }, + "Entity_[1180934129011]": { + "Id": "Entity_[1180934129011]", + "Name": "Global Sky", + "Components": { + "Component_[11231930600558681245]": { + "$type": "AZ::Render::EditorHDRiSkyboxComponent", + "Id": 11231930600558681245, + "Controller": { + "Configuration": { + "CubemapAsset": { + "assetId": { + "guid": "{215E47FD-D181-5832-B1AB-91673ABF6399}", + "subId": 1000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_skyboxcm.exr.streamingimage" + } + } + } + }, + "Component_[11980494120202836095]": { + "$type": "SelectionComponent", + "Id": 11980494120202836095 + }, + "Component_[1428633914413949476]": { + "$type": "EditorLockComponent", + "Id": 1428633914413949476 + }, + "Component_[14936200426671614999]": { + "$type": "AZ::Render::EditorImageBasedLightComponent", + "Id": 14936200426671614999, + "Controller": { + "Configuration": { + "diffuseImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 3000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_ibldiffuse.exr.streamingimage" + }, + "specularImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 2000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_iblspecular.exr.streamingimage" + } + } + } + }, + "Component_[14994774102579326069]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 14994774102579326069 + }, + "Component_[15417479889044493340]": { + "$type": "EditorPendingCompositionComponent", + "Id": 15417479889044493340 + }, + "Component_[15826613364991382688]": { + "$type": "EditorEntitySortComponent", + "Id": 15826613364991382688 + }, + "Component_[1665003113283562343]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1665003113283562343 + }, + "Component_[3704934735944502280]": { + "$type": "EditorEntityIconComponent", + "Id": 3704934735944502280 + }, + "Component_[5698542331457326479]": { + "$type": "EditorVisibilityComponent", + "Id": 5698542331457326479 + }, + "Component_[6644513399057217122]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6644513399057217122, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[931091830724002070]": { + "$type": "EditorInspectorComponent", + "Id": 931091830724002070 + } + } + }, + "Entity_[12685882829720]": { + "Id": "Entity_[12685882829720]", + "Name": "GlobalGameData", + "Components": { + "Component_[11240656689650225106]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 11240656689650225106 + }, + "Component_[13863201640354873385]": { + "$type": "EditorPendingCompositionComponent", + "Id": 13863201640354873385 + }, + "Component_[14671754037021562789]": { + "$type": "EditorInspectorComponent", + "Id": 14671754037021562789 + }, + "Component_[14750978061505735417]": { + "$type": "EditorScriptCanvasComponent", + "Id": 14750978061505735417, + "m_name": "GlobalGameData", + "m_assetHolder": { + "m_asset": { + "assetId": { + "guid": "{B16589A0-EA01-56BC-8141-91A3967FB95F}" + }, + "assetHint": "levels/multiplayer/autocomponent_rpc/globalgamedata.scriptcanvas" + } + }, + "runtimeDataIsValid": true, + "runtimeDataOverrides": { + "source": { + "assetId": { + "guid": "{B16589A0-EA01-56BC-8141-91A3967FB95F}" + }, + "assetHint": "levels/multiplayer/autocomponent_rpc/globalgamedata.scriptcanvas" + } + } + }, + "Component_[16436925042043744033]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 16436925042043744033, + "Parent Entity": "Entity_[1146574390643]", + "Transform Data": { + "Translate": [ + 0.0, + 0.10000038146972656, + 4.005393981933594 + ] + } + }, + "Component_[16974524495698916088]": { + "$type": "EditorOnlyEntityComponent", + "Id": 16974524495698916088 + }, + "Component_[2753700837834389204]": { + "$type": "EditorLockComponent", + "Id": 2753700837834389204 + }, + "Component_[3766473509503096065]": { + "$type": "SelectionComponent", + "Id": 3766473509503096065 + }, + "Component_[4025955184206569130]": { + "$type": "EditorEntitySortComponent", + "Id": 4025955184206569130 + }, + "Component_[7909743395732791573]": { + "$type": "EditorVisibilityComponent", + "Id": 7909743395732791573 + }, + "Component_[9550161640684119498]": { + "$type": "EditorEntityIconComponent", + "Id": 9550161640684119498 + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.scriptcanvas b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.scriptcanvas new file mode 100644 index 0000000000..474266e7a0 --- /dev/null +++ b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.scriptcanvas @@ -0,0 +1,1958 @@ +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "ScriptCanvasData", + "ClassData": { + "m_scriptCanvas": { + "Id": { + "id": 45584036346395 + }, + "Name": "AutoComponent_RPC", + "Components": { + "Component_[6790521910463264404]": { + "$type": "EditorGraphVariableManagerComponent", + "Id": 6790521910463264404, + "m_variableData": { + "m_nameVariableMap": [ + { + "Key": { + "m_id": "{71675BCB-6546-4B79-9D5E-912982945852}" + }, + "Value": { + "Datum": { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0 + }, + "VariableId": { + "m_id": "{71675BCB-6546-4B79-9D5E-912982945852}" + }, + "VariableName": "PlayerNumber" + } + } + ] + } + }, + "Component_[9755768666831861951]": { + "$type": "{4D755CA9-AB92-462C-B24F-0B3376F19967} Graph", + "Id": 9755768666831861951, + "m_graphData": { + "m_nodes": [ + { + "Id": { + "id": 45592626280987 + }, + "Name": "SC-EventNode(AuthorityToAutonomous_PlayerNumber Notify Event)", + "Components": { + "Component_[10688723972761024546]": { + "$type": "AzEventHandler", + "Id": 10688723972761024546, + "Slots": [ + { + "id": { + "m_id": "{46E6B649-CAA4-4318-960D-5E4854E21BB2}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "ConnectionLimitContract", + "limit": 1 + }, + { + "$type": "RestrictedNodeContract", + "m_nodeId": { + "id": 45605511182875 + } + } + ], + "slotName": "Connect", + "toolTip": "Connect the AZ Event to this AZ Event Handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{221AFED2-BD9E-4CFF-8EC7-75ABA019134D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Disconnect", + "toolTip": "Disconnect current AZ Event from this AZ Event Handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{D139A8D2-F57B-4EBF-B7F8-1D65C2D97C25}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "On Connected", + "toolTip": "Signaled when a connection has taken place.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{3F47A140-182E-4B32-AE14-467555A6640A}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "On Disconnected", + "toolTip": "Signaled when this event handler is disconnected.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{586BE222-2DEA-4E08-968F-07CA4EB96C54}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnEvent", + "toolTip": "Triggered when the AZ Event invokes Signal() function.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "player_number", + "DisplayDataType": { + "m_type": 3 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{8C7E88EA-8FEE-45D0-9A2E-78BC4A18F508}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "ConnectionLimitContract", + "limit": 1 + }, + { + "$type": "RestrictedNodeContract", + "m_nodeId": { + "id": 45605511182875 + } + } + ], + "slotName": "AuthorityToAutonomous_PlayerNumber Notify Event", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 4, + "m_azType": "{DB613438-34F0-5B2E-A413-77424F4254CD}" + }, + "isNullPointer": true, + "label": "AuthorityToAutonomous_PlayerNumber Notify Event" + } + ], + "m_azEventEntry": { + "m_eventName": "AuthorityToAutonomous_PlayerNumber Notify Event", + "m_parameterSlotIds": [ + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + } + ], + "m_parameterNames": [ + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + } + ], + "m_eventSlotId": { + "m_id": "{8C7E88EA-8FEE-45D0-9A2E-78BC4A18F508}" + } + } + } + } + }, + { + "Id": { + "id": 45609806150171 + }, + "Name": "SC-Node(IsNetEntityRoleAuthority)", + "Components": { + "Component_[11076422520044215441]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 11076422520044215441, + "Slots": [ + { + "id": { + "m_id": "{4EAB8D16-C0B4-44E1-885D-8E6754CD1A55}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "EntityId: 0", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{B6C4BE5E-CDE4-4EC7-98D0-A019CD80041C}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{1071F455-D5A0-4C7A-AF91-648A0F197885}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{BA87B4ED-9A52-4A0D-8920-CD0ED4E839EA}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Is Role Authority", + "DisplayDataType": { + "m_type": 0 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 1 + }, + "isNullPointer": false, + "$type": "EntityId", + "value": { + "id": 2901262558 + }, + "label": "EntityId: 0" + } + ], + "methodType": 2, + "methodName": "IsNetEntityRoleAuthority", + "className": "NetBindComponent", + "resultSlotIDs": [ + {} + ], + "inputSlots": [ + { + "m_id": "{4EAB8D16-C0B4-44E1-885D-8E6754CD1A55}" + } + ], + "prettyClassName": "NetBindComponent" + } + } + }, + { + "Id": { + "id": 45588331313691 + }, + "Name": "SC-Node(Print)", + "Components": { + "Component_[15185116749844245504]": { + "$type": "Print", + "Id": 15185116749844245504, + "Slots": [ + { + "id": { + "m_id": "{F3ED8C08-D751-492A-A39A-7B7734727A5A}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{D4FA5CCA-34FB-412B-826E-BC7050E684A6}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Value", + "toolTip": "Value which replaces instances of {Value} in the resulting string.", + "DisplayDataType": { + "m_type": 3 + }, + "DisplayGroup": { + "Value": 1015031923 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1, + "IsReference": true, + "VariableReference": { + "m_id": "{71675BCB-6546-4B79-9D5E-912982945852}" + } + }, + { + "id": { + "m_id": "{5A4FB037-120E-4BF8-A170-D827E5DC161B}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0, + "label": "Value" + } + ], + "m_format": "AutoComponent_RPC: Sending client PlayerNumber {Value}\n", + "m_arrayBindingMap": [ + { + "Key": 1, + "Value": { + "m_id": "{D4FA5CCA-34FB-412B-826E-BC7050E684A6}" + } + } + ], + "m_unresolvedString": [ + "AutoComponent_RPC: Sending client PlayerNumber ", + {}, + "\n" + ], + "m_formatSlotMap": { + "Value": { + "m_id": "{D4FA5CCA-34FB-412B-826E-BC7050E684A6}" + } + } + } + } + }, + { + "Id": { + "id": 45605511182875 + }, + "Name": "SC-Node(GetAuthorityToAutonomous_PlayerNumberEventByEntityId)", + "Components": { + "Component_[1841271567102345236]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 1841271567102345236, + "Slots": [ + { + "id": { + "m_id": "{B556F66D-84DB-4118-8AFE-B3D88D6D75CA}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "EntityId: 0", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{211BD78B-E01E-44F8-B44E-2FD988047BE9}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{1A6BCB27-F99F-4B6B-89CC-F2BE2A698331}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{7262E6CD-BADF-4DD0-8FCE-3A02C3F31CC8}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Event", + "DisplayDataType": { + "m_type": 4, + "m_azType": "{DB613438-34F0-5B2E-A413-77424F4254CD}" + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 1 + }, + "isNullPointer": false, + "$type": "EntityId", + "value": { + "id": 2901262558 + }, + "label": "EntityId: 0" + } + ], + "methodType": 2, + "methodName": "GetAuthorityToAutonomous_PlayerNumberEventByEntityId", + "className": "NetworkTestPlayerComponent", + "resultSlotIDs": [ + {} + ], + "inputSlots": [ + { + "m_id": "{B556F66D-84DB-4118-8AFE-B3D88D6D75CA}" + } + ], + "prettyClassName": "NetworkTestPlayerComponent" + } + } + }, + { + "Id": { + "id": 45618396084763 + }, + "Name": "SendScriptEvent", + "Components": { + "Component_[5751772243856660980]": { + "$type": "SendScriptEvent", + "Id": 5751772243856660980, + "Slots": [ + { + "id": { + "m_id": "{2FF1A0A1-59C6-4DCF-AE1D-296BD5964D4E}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Fires the specified ScriptEvent when signaled", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{F2955681-A901-432D-99A3-53818F46CDE7}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "toolTip": "Trigged after the ScriptEvent has been signaled and returns", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "m_version": 1, + "m_scriptEventAssetId": { + "guid": "{FE1B1992-8220-5DD3-A60A-AEC85EB91C54}" + }, + "m_asset": { + "assetId": { + "guid": "{FE1B1992-8220-5DD3-A60A-AEC85EB91C54}" + }, + "assetHint": "levels/multiplayer/autocomponent_rpc/globalgamedata.scriptevents" + }, + "m_busId": { + "Value": 1375178404 + }, + "m_eventId": { + "Value": 2930121176 + } + } + } + }, + { + "Id": { + "id": 45631280986651 + }, + "Name": "SendScriptEvent", + "Components": { + "Component_[6456267108920901297]": { + "$type": "SendScriptEvent", + "Id": 6456267108920901297, + "Slots": [ + { + "id": { + "m_id": "{23DBACD8-7784-4E18-A51C-258B25DF4C19}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Fires the specified ScriptEvent when signaled", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{19C850D7-7F1E-4D41-AFD9-5A4FA03D54F0}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "toolTip": "Trigged after the ScriptEvent has been signaled and returns", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{B6CA4982-245A-45F1-8AA6-3295F49DC071}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Number", + "DisplayDataType": { + "m_type": 3 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1, + "IsReference": true, + "VariableReference": { + "m_id": "{71675BCB-6546-4B79-9D5E-912982945852}" + } + } + ], + "m_version": 1, + "m_eventSlotMapping": { + "{C7E99974-D1C0-4108-B731-120AF000060C}": { + "m_id": "{B6CA4982-245A-45F1-8AA6-3295F49DC071}" + } + }, + "m_scriptEventAssetId": { + "guid": "{FE1B1992-8220-5DD3-A60A-AEC85EB91C54}" + }, + "m_asset": { + "assetId": { + "guid": "{FE1B1992-8220-5DD3-A60A-AEC85EB91C54}" + }, + "assetHint": "levels/multiplayer/autocomponent_rpc/globalgamedata.scriptevents" + }, + "m_busId": { + "Value": 1375178404 + }, + "m_eventId": { + "Value": 242067946 + } + } + } + }, + { + "Id": { + "id": 45601216215579 + }, + "Name": "SC-Node(Print)", + "Components": { + "Component_[6838720237293185886]": { + "$type": "Print", + "Id": 6838720237293185886, + "Slots": [ + { + "id": { + "m_id": "{D206E5BC-3746-4A18-80C7-DBD335FD05FE}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{BA146872-FBFF-4662-A569-8F1B4C8774AC}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Value", + "toolTip": "Value which replaces instances of {Value} in the resulting string.", + "DisplayDataType": { + "m_type": 3 + }, + "DisplayGroup": { + "Value": 1015031923 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{A4555039-973F-43F6-BC9D-CCC0C9B34252}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0, + "label": "Value" + } + ], + "m_format": "AutoComponent_RPC: I'm Player #{Value}\n", + "m_arrayBindingMap": [ + { + "Key": 1, + "Value": { + "m_id": "{BA146872-FBFF-4662-A569-8F1B4C8774AC}" + } + } + ], + "m_unresolvedString": [ + "AutoComponent_RPC: I'm Player #", + {}, + "\n" + ], + "m_formatSlotMap": { + "Value": { + "m_id": "{BA146872-FBFF-4662-A569-8F1B4C8774AC}" + } + } + } + } + }, + { + "Id": { + "id": 45626986019355 + }, + "Name": "SC-Node(TimeDelayNodeableNode)", + "Components": { + "Component_[8216689437045635826]": { + "$type": "TimeDelayNodeableNode", + "Id": 8216689437045635826, + "Slots": [ + { + "id": { + "m_id": "{D2337DC6-F126-4254-B296-2DE6BA03993F}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Start", + "DisplayGroup": { + "Value": 2675529103 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{5809EA65-214B-43A9-8674-B89E9ADF1AE6}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Delay", + "toolTip": "The amount of time to delay before the Done is signalled.", + "DisplayGroup": { + "Value": 2675529103 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{AC3B9B74-5A7A-4AC9-89AA-B255879D6F63}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "On Start", + "DisplayGroup": { + "Value": 2675529103 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{25568B15-5372-4C2D-8280-2B433251EACA}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Done", + "toolTip": "Signaled after waiting for the specified amount of times.", + "DisplayGroup": { + "Value": 271442091 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 1.0, + "label": "Delay" + } + ], + "nodeable": { + "m_timeUnits": 2 + }, + "slotExecutionMap": { + "ins": [ + { + "_slotId": { + "m_id": "{D2337DC6-F126-4254-B296-2DE6BA03993F}" + }, + "_inputs": [ + { + "_slotId": { + "m_id": "{5809EA65-214B-43A9-8674-B89E9ADF1AE6}" + } + } + ], + "_outs": [ + { + "_slotId": { + "m_id": "{AC3B9B74-5A7A-4AC9-89AA-B255879D6F63}" + }, + "_name": "On Start", + "_interfaceSourceId": "{C071AF8D-5D00-0000-E074-ECBC15020000}" + } + ], + "_interfaceSourceId": "{C3B60A69-2ADF-0000-4062-ABA615020000}" + } + ], + "latents": [ + { + "_slotId": { + "m_id": "{25568B15-5372-4C2D-8280-2B433251EACA}" + }, + "_name": "Done", + "_interfaceSourceId": "{C3B60A69-2ADF-0000-4062-ABA615020000}" + } + ] + } + } + } + }, + { + "Id": { + "id": 45596921248283 + }, + "Name": "SC-Node(AuthorityToAutonomous_PlayerNumberByEntityId)", + "Components": { + "Component_[8243210565080727934]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 8243210565080727934, + "Slots": [ + { + "id": { + "m_id": "{D8767DB8-4BD8-4907-A3A4-BE0AE4F1A774}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Source", + "toolTip": "The Source containing the NetworkTestPlayerComponentController", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{2B948544-DD45-4DE1-A9FC-7AFBE1CAB202}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "player_number", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1, + "IsReference": true, + "VariableReference": { + "m_id": "{71675BCB-6546-4B79-9D5E-912982945852}" + } + }, + { + "id": { + "m_id": "{1FDB4A9A-D46A-49E8-B734-475230EB7C06}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{964EAD23-8DF5-47A9-BF07-1E5C7CD0CC6C}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 1 + }, + "isNullPointer": false, + "$type": "EntityId", + "value": { + "id": 2901262558 + }, + "label": "Source" + }, + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0, + "label": "player_number" + } + ], + "methodType": 2, + "methodName": "AuthorityToAutonomous_PlayerNumberByEntityId", + "className": "NetworkTestPlayerComponent", + "resultSlotIDs": [ + {} + ], + "inputSlots": [ + { + "m_id": "{D8767DB8-4BD8-4907-A3A4-BE0AE4F1A774}" + }, + { + "m_id": "{2B948544-DD45-4DE1-A9FC-7AFBE1CAB202}" + } + ], + "prettyClassName": "NetworkTestPlayerComponent" + } + } + }, + { + "Id": { + "id": 45622691052059 + }, + "Name": "SC-Node(Start)", + "Components": { + "Component_[8447409406288787781]": { + "$type": "Start", + "Id": 8447409406288787781, + "Slots": [ + { + "id": { + "m_id": "{A8EA9EF2-A3A6-46B5-8D43-08EF6B6B5B32}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "toolTip": "Signaled when the entity that owns this graph is fully activated.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ] + } + } + }, + { + "Id": { + "id": 45614101117467 + }, + "Name": "SC-Node(Gate)", + "Components": { + "Component_[8679383768392231909]": { + "$type": "Gate", + "Id": 8679383768392231909, + "Slots": [ + { + "id": { + "m_id": "{3E89B67B-1EF2-4DAB-8028-59A97527F3DF}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Condition", + "toolTip": "If true the node will signal the Output and proceed execution", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{8AE7F430-C4A9-444E-B42A-BDDFE96C387A}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{78C92586-C0E1-449F-8EB2-B1CE3BFC8AE7}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "True", + "toolTip": "Signaled if the condition provided evaluates to true.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{47D87C86-2D61-46D3-A0FC-138F84FD352B}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "False", + "toolTip": "Signaled if the condition provided evaluates to false.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 0 + }, + "isNullPointer": false, + "$type": "bool", + "value": false, + "label": "Condition" + } + ] + } + } + } + ], + "m_connections": [ + { + "Id": { + "id": 45635575953947 + }, + "Name": "srcEndpoint=(IsNetEntityRoleAuthority: Out), destEndpoint=(If: In)", + "Components": { + "Component_[3645153988172561571]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 3645153988172561571, + "sourceEndpoint": { + "nodeId": { + "id": 45609806150171 + }, + "slotId": { + "m_id": "{1071F455-D5A0-4C7A-AF91-648A0F197885}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 45614101117467 + }, + "slotId": { + "m_id": "{8AE7F430-C4A9-444E-B42A-BDDFE96C387A}" + } + } + } + } + }, + { + "Id": { + "id": 45639870921243 + }, + "Name": "srcEndpoint=(IsNetEntityRoleAuthority: Is Role Authority), destEndpoint=(If: Condition)", + "Components": { + "Component_[17942926291787646743]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 17942926291787646743, + "sourceEndpoint": { + "nodeId": { + "id": 45609806150171 + }, + "slotId": { + "m_id": "{BA87B4ED-9A52-4A0D-8920-CD0ED4E839EA}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 45614101117467 + }, + "slotId": { + "m_id": "{3E89B67B-1EF2-4DAB-8028-59A97527F3DF}" + } + } + } + } + }, + { + "Id": { + "id": 45644165888539 + }, + "Name": "srcEndpoint=(If: True), destEndpoint=(Send Script Event: In)", + "Components": { + "Component_[3298020356088639785]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 3298020356088639785, + "sourceEndpoint": { + "nodeId": { + "id": 45614101117467 + }, + "slotId": { + "m_id": "{78C92586-C0E1-449F-8EB2-B1CE3BFC8AE7}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 45618396084763 + }, + "slotId": { + "m_id": "{2FF1A0A1-59C6-4DCF-AE1D-296BD5964D4E}" + } + } + } + } + }, + { + "Id": { + "id": 45648460855835 + }, + "Name": "srcEndpoint=(Send Script Event: Out), destEndpoint=(Send Script Event: In)", + "Components": { + "Component_[5482500452520221078]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 5482500452520221078, + "sourceEndpoint": { + "nodeId": { + "id": 45618396084763 + }, + "slotId": { + "m_id": "{F2955681-A901-432D-99A3-53818F46CDE7}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 45631280986651 + }, + "slotId": { + "m_id": "{23DBACD8-7784-4E18-A51C-258B25DF4C19}" + } + } + } + } + }, + { + "Id": { + "id": 45652755823131 + }, + "Name": "srcEndpoint=(Send Script Event: Out), destEndpoint=(AuthorityToAutonomous_PlayerNumberByEntityId: In)", + "Components": { + "Component_[16156808606878296902]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 16156808606878296902, + "sourceEndpoint": { + "nodeId": { + "id": 45631280986651 + }, + "slotId": { + "m_id": "{19C850D7-7F1E-4D41-AFD9-5A4FA03D54F0}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 45596921248283 + }, + "slotId": { + "m_id": "{1FDB4A9A-D46A-49E8-B734-475230EB7C06}" + } + } + } + } + }, + { + "Id": { + "id": 45657050790427 + }, + "Name": "srcEndpoint=(AuthorityToAutonomous_PlayerNumberByEntityId: Out), destEndpoint=(Print: In)", + "Components": { + "Component_[17367899649716276273]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 17367899649716276273, + "sourceEndpoint": { + "nodeId": { + "id": 45596921248283 + }, + "slotId": { + "m_id": "{964EAD23-8DF5-47A9-BF07-1E5C7CD0CC6C}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 45588331313691 + }, + "slotId": { + "m_id": "{F3ED8C08-D751-492A-A39A-7B7734727A5A}" + } + } + } + } + }, + { + "Id": { + "id": 45661345757723 + }, + "Name": "srcEndpoint=(On Graph Start: Out), destEndpoint=(TimeDelay: Start)", + "Components": { + "Component_[13463448697016307967]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 13463448697016307967, + "sourceEndpoint": { + "nodeId": { + "id": 45622691052059 + }, + "slotId": { + "m_id": "{A8EA9EF2-A3A6-46B5-8D43-08EF6B6B5B32}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 45626986019355 + }, + "slotId": { + "m_id": "{D2337DC6-F126-4254-B296-2DE6BA03993F}" + } + } + } + } + }, + { + "Id": { + "id": 45665640725019 + }, + "Name": "srcEndpoint=(GetAuthorityToAutonomous_PlayerNumberEventByEntityId: Event), destEndpoint=(AuthorityToAutonomous_PlayerNumber Notify Event: AuthorityToAutonomous_PlayerNumber Notify Event)", + "Components": { + "Component_[9477060643694737434]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 9477060643694737434, + "sourceEndpoint": { + "nodeId": { + "id": 45605511182875 + }, + "slotId": { + "m_id": "{7262E6CD-BADF-4DD0-8FCE-3A02C3F31CC8}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 45592626280987 + }, + "slotId": { + "m_id": "{8C7E88EA-8FEE-45D0-9A2E-78BC4A18F508}" + } + } + } + } + }, + { + "Id": { + "id": 45669935692315 + }, + "Name": "srcEndpoint=(GetAuthorityToAutonomous_PlayerNumberEventByEntityId: Out), destEndpoint=(AuthorityToAutonomous_PlayerNumber Notify Event: Connect)", + "Components": { + "Component_[16543380658701699472]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 16543380658701699472, + "sourceEndpoint": { + "nodeId": { + "id": 45605511182875 + }, + "slotId": { + "m_id": "{1A6BCB27-F99F-4B6B-89CC-F2BE2A698331}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 45592626280987 + }, + "slotId": { + "m_id": "{46E6B649-CAA4-4318-960D-5E4854E21BB2}" + } + } + } + } + }, + { + "Id": { + "id": 45674230659611 + }, + "Name": "srcEndpoint=(AuthorityToAutonomous_PlayerNumber Notify Event: player_number), destEndpoint=(Print: Value)", + "Components": { + "Component_[864863482692400383]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 864863482692400383, + "sourceEndpoint": { + "nodeId": { + "id": 45592626280987 + }, + "slotId": { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 45601216215579 + }, + "slotId": { + "m_id": "{BA146872-FBFF-4662-A569-8F1B4C8774AC}" + } + } + } + } + }, + { + "Id": { + "id": 45678525626907 + }, + "Name": "srcEndpoint=(AuthorityToAutonomous_PlayerNumber Notify Event: OnEvent), destEndpoint=(Print: In)", + "Components": { + "Component_[2451057837093425972]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 2451057837093425972, + "sourceEndpoint": { + "nodeId": { + "id": 45592626280987 + }, + "slotId": { + "m_id": "{586BE222-2DEA-4E08-968F-07CA4EB96C54}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 45601216215579 + }, + "slotId": { + "m_id": "{D206E5BC-3746-4A18-80C7-DBD335FD05FE}" + } + } + } + } + }, + { + "Id": { + "id": 45682820594203 + }, + "Name": "srcEndpoint=(On Graph Start: Out), destEndpoint=(GetAuthorityToAutonomous_PlayerNumberEventByEntityId: In)", + "Components": { + "Component_[12180981889720748145]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 12180981889720748145, + "sourceEndpoint": { + "nodeId": { + "id": 45622691052059 + }, + "slotId": { + "m_id": "{A8EA9EF2-A3A6-46B5-8D43-08EF6B6B5B32}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 45605511182875 + }, + "slotId": { + "m_id": "{211BD78B-E01E-44F8-B44E-2FD988047BE9}" + } + } + } + } + }, + { + "Id": { + "id": 45687115561499 + }, + "Name": "srcEndpoint=(TimeDelay: Done), destEndpoint=(IsNetEntityRoleAuthority: In)", + "Components": { + "Component_[5772191552099194657]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 5772191552099194657, + "sourceEndpoint": { + "nodeId": { + "id": 45626986019355 + }, + "slotId": { + "m_id": "{25568B15-5372-4C2D-8280-2B433251EACA}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 45609806150171 + }, + "slotId": { + "m_id": "{B6C4BE5E-CDE4-4EC7-98D0-A019CD80041C}" + } + } + } + } + } + ], + "m_scriptEventAssets": [ + [ + { + "id": 45631280986651 + }, + {} + ], + [ + { + "id": 45618396084763 + }, + {} + ] + ] + }, + "m_assetType": "{3E2AC8CD-713F-453E-967F-29517F331784}", + "versionData": { + "_grammarVersion": 1, + "_runtimeVersion": 1, + "_fileVersion": 1 + }, + "m_variableCounter": 1, + "GraphCanvasData": [ + { + "Key": { + "id": 45584036346395 + }, + "Value": { + "ComponentData": { + "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { + "$type": "SceneComponentSaveData", + "ViewParams": { + "Scale": 0.9670775714052148, + "AnchorX": 180.9575653076172, + "AnchorY": 127.18731689453125 + } + } + } + } + }, + { + "Key": { + "id": 45588331313691 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "StringNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 2280.0, + 260.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{B91C0E41-E6B5-46DE-885F-6BC6CFB2E813}" + } + } + } + }, + { + "Key": { + "id": 45592626280987 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "HandlerNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 980.0, + 620.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".azeventhandler" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{F112D217-FAC8-4577-B67A-DFDF47842F7D}" + } + } + } + }, + { + "Key": { + "id": 45596921248283 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 1840.0, + 260.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{59FFF3C1-2D7B-47EA-AE35-ED15DCB95CC8}" + } + } + } + }, + { + "Key": { + "id": 45601216215579 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "StringNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 1160.0, + 620.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{74ED5AE1-A269-46D4-B968-FEDF513C9CF1}" + } + } + } + }, + { + "Key": { + "id": 45605511182875 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 380.0, + 620.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{BBBE60FC-0215-4A5A-BEBE-4FC869E5EECE}" + } + } + } + }, + { + "Key": { + "id": 45609806150171 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 500.0, + 260.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{348E780E-3A4E-47C7-ACF5-C7B2CB387517}" + } + } + } + }, + { + "Key": { + "id": 45614101117467 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "LogicNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 940.0, + 260.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{53C8DAF1-FFF3-4AF8-A7FB-BC0B4E492B37}" + } + } + } + }, + { + "Key": { + "id": 45618396084763 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 1240.0, + 260.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{13BD3C1C-EDBB-419E-8465-495935414A1A}" + } + } + } + }, + { + "Key": { + "id": 45622691052059 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "TimeNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 40.0, + 280.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{B4CB62D9-9965-42E2-81FF-BDADDBD14CBE}" + } + } + } + }, + { + "Key": { + "id": 45626986019355 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "TimeNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 200.0, + 260.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{5DF902FE-B0C4-4563-B2BA-17996B24E211}" + } + } + } + }, + { + "Key": { + "id": 45631280986651 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 1540.0, + 260.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{FD844BFD-72DA-44BA-B92A-AFDB58263B91}" + } + } + } + } + ], + "StatisticsHelper": { + "InstanceCounter": [ + { + "Key": 4199610336680704683, + "Value": 1 + }, + { + "Key": 4847610523576971761, + "Value": 1 + }, + { + "Key": 6462358712820489356, + "Value": 1 + }, + { + "Key": 7760188923571293852, + "Value": 1 + }, + { + "Key": 8065262779685207188, + "Value": 1 + }, + { + "Key": 8452971738487658154, + "Value": 1 + }, + { + "Key": 10684225535275896474, + "Value": 2 + }, + { + "Key": 12248403816200817622, + "Value": 1 + }, + { + "Key": 12248403882232298424, + "Value": 1 + }, + { + "Key": 16232169425081397848, + "Value": 1 + } + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/GlobalGameData.scriptcanvas b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/GlobalGameData.scriptcanvas new file mode 100644 index 0000000000..3ba5cc6b7d --- /dev/null +++ b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/GlobalGameData.scriptcanvas @@ -0,0 +1,662 @@ +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "ScriptCanvasData", + "ClassData": { + "m_scriptCanvas": { + "Id": { + "id": 17732469402520 + }, + "Name": "Untitled-1", + "Components": { + "Component_[16492301523567686923]": { + "$type": "{4D755CA9-AB92-462C-B24F-0B3376F19967} Graph", + "Id": 16492301523567686923, + "m_graphData": { + "m_nodes": [ + { + "Id": { + "id": 17741059337112 + }, + "Name": "SC-Node(OperatorAdd)", + "Components": { + "Component_[11612963594766700030]": { + "$type": "OperatorAdd", + "Id": 11612963594766700030, + "Slots": [ + { + "id": { + "m_id": "{B7529112-C29F-45F0-811C-DB8EE18EB8B8}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{49618851-F6B2-4B90-BFDF-ADBAAA84BBA4}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{4612C904-82DF-4B48-8485-4C878AF9A4D1}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "MathOperatorContract", + "NativeTypes": [ + { + "m_type": 3 + }, + { + "m_type": 6 + }, + { + "m_type": 8 + }, + { + "m_type": 9 + }, + { + "m_type": 10 + }, + { + "m_type": 11 + }, + { + "m_type": 12 + }, + { + "m_type": 14 + }, + { + "m_type": 15 + } + ] + } + ], + "slotName": "Number", + "toolTip": "An operand to use in performing the specified Operation", + "DisplayDataType": { + "m_type": 3 + }, + "DisplayGroup": { + "Value": 1114760223 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DynamicGroup": { + "Value": 1114760223 + }, + "DataType": 1, + "IsReference": true, + "VariableReference": { + "m_id": "{8451E795-6A0E-44CE-81FD-AEF0EE5B0400}" + } + }, + { + "id": { + "m_id": "{610B3BFB-9043-47A0-9694-5F14A1947E36}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "MathOperatorContract", + "NativeTypes": [ + { + "m_type": 3 + }, + { + "m_type": 6 + }, + { + "m_type": 8 + }, + { + "m_type": 9 + }, + { + "m_type": 10 + }, + { + "m_type": 11 + }, + { + "m_type": 12 + }, + { + "m_type": 14 + }, + { + "m_type": 15 + } + ] + } + ], + "slotName": "Number", + "toolTip": "An operand to use in performing the specified Operation", + "DisplayDataType": { + "m_type": 3 + }, + "DisplayGroup": { + "Value": 1114760223 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DynamicGroup": { + "Value": 1114760223 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{36FFF1AB-C208-47CB-8271-436C85E0AE42}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "MathOperatorContract", + "NativeTypes": [ + { + "m_type": 3 + }, + { + "m_type": 6 + }, + { + "m_type": 8 + }, + { + "m_type": 9 + }, + { + "m_type": 10 + }, + { + "m_type": 11 + }, + { + "m_type": 12 + }, + { + "m_type": 14 + }, + { + "m_type": 15 + } + ] + } + ], + "slotName": "Result", + "toolTip": "The result of the specified operation", + "DisplayDataType": { + "m_type": 3 + }, + "DisplayGroup": { + "Value": 1114760223 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DynamicGroup": { + "Value": 1114760223 + }, + "DataType": 1, + "IsReference": true, + "VariableReference": { + "m_id": "{8451E795-6A0E-44CE-81FD-AEF0EE5B0400}" + } + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0, + "label": "Number" + }, + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 1.0, + "label": "Number" + } + ] + } + } + }, + { + "Id": { + "id": 17736764369816 + }, + "Name": "ReceiveScriptEvent", + "Components": { + "Component_[16408183651077237195]": { + "$type": "ReceiveScriptEvent", + "Id": 16408183651077237195, + "Slots": [ + { + "id": { + "m_id": "{8DC10581-B8DF-473C-9C75-996111DBF560}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Connect", + "toolTip": "Connect this event handler to the specified entity.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{E60D1951-E56D-41F8-84C5-AD0BA803DD51}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Disconnect", + "toolTip": "Disconnect this event handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{1BCE6CAC-B1C0-43FA-B4F5-E9A34D5064E5}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnConnected", + "toolTip": "Signaled when a connection has taken place.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{FEB42E9A-D562-4BBD-90AB-32255124BFE8}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnDisconnected", + "toolTip": "Signaled when this event handler is disconnected.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{C9EF936B-8C74-42B4-8793-67FC7FD3BCBC}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnFailure", + "toolTip": "Signaled when it is not possible to connect this handler.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{76985C7A-761A-4CEF-9F55-6DD2B136317A}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:NewPlayerScriptActive", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{5CD8E1E9-6192-4B7D-9C2C-6C18BE99CF44}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Number", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1, + "IsReference": true, + "VariableReference": { + "m_id": "{8451E795-6A0E-44CE-81FD-AEF0EE5B0400}" + } + }, + { + "id": { + "m_id": "{9FDB71AA-0F19-406D-82CA-508A2CA10F95}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "ExecutionSlot:GetNumberOfActivePlayers", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0, + "label": "Number" + } + ], + "m_version": 1, + "m_eventMap": [ + { + "Key": { + "Value": 242067946 + }, + "Value": { + "m_scriptEventAssetId": { + "guid": "{FE1B1992-8220-5DD3-A60A-AEC85EB91C54}" + }, + "m_eventName": "GetNumberOfActivePlayers", + "m_eventSlotId": { + "m_id": "{9FDB71AA-0F19-406D-82CA-508A2CA10F95}" + }, + "m_resultSlotId": { + "m_id": "{5CD8E1E9-6192-4B7D-9C2C-6C18BE99CF44}" + } + } + }, + { + "Key": { + "Value": 2930121176 + }, + "Value": { + "m_scriptEventAssetId": { + "guid": "{FE1B1992-8220-5DD3-A60A-AEC85EB91C54}" + }, + "m_eventName": "NewPlayerScriptActive", + "m_eventSlotId": { + "m_id": "{76985C7A-761A-4CEF-9F55-6DD2B136317A}" + } + } + } + ], + "m_eventSlotMapping": { + "{155BF981-AD70-4D29-81A6-1517FAE59FB1}": { + "m_id": "{5CD8E1E9-6192-4B7D-9C2C-6C18BE99CF44}" + }, + "{65D394D3-F90D-4F10-94BF-F5E1581CF2CF}": { + "m_id": "{76985C7A-761A-4CEF-9F55-6DD2B136317A}" + }, + "{67784749-9B41-429C-9C97-3D296182EB67}": { + "m_id": "{9FDB71AA-0F19-406D-82CA-508A2CA10F95}" + } + }, + "m_scriptEventAssetId": { + "guid": "{FE1B1992-8220-5DD3-A60A-AEC85EB91C54}" + }, + "m_asset": { + "assetId": { + "guid": "{FE1B1992-8220-5DD3-A60A-AEC85EB91C54}" + }, + "assetHint": "levels/multiplayer/autocomponent_rpc/globalgamedata.scriptevents" + } + } + } + } + ], + "m_connections": [ + { + "Id": { + "id": 17745354304408 + }, + "Name": "srcEndpoint=(Receive Script Event: ExecutionSlot:NewPlayerScriptActive), destEndpoint=(Add (+): In)", + "Components": { + "Component_[8782209668839578826]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 8782209668839578826, + "sourceEndpoint": { + "nodeId": { + "id": 17736764369816 + }, + "slotId": { + "m_id": "{76985C7A-761A-4CEF-9F55-6DD2B136317A}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 17741059337112 + }, + "slotId": { + "m_id": "{B7529112-C29F-45F0-811C-DB8EE18EB8B8}" + } + } + } + } + } + ], + "m_scriptEventAssets": [ + [ + { + "id": 17736764369816 + }, + {} + ] + ] + }, + "m_assetType": "{3E2AC8CD-713F-453E-967F-29517F331784}", + "versionData": { + "_grammarVersion": 1, + "_runtimeVersion": 1, + "_fileVersion": 1 + }, + "m_variableCounter": 1, + "GraphCanvasData": [ + { + "Key": { + "id": 17732469402520 + }, + "Value": { + "ComponentData": { + "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { + "$type": "SceneComponentSaveData" + } + } + } + }, + { + "Key": { + "id": 17736764369816 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + -360.0, + -60.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{C419A1CF-CBA8-416B-BF6C-4B574C3E59E3}" + }, + "{D8BBE799-7E4D-495A-B69A-1E3940670891}": { + "$type": "ScriptEventReceiverHandlerNodeDescriptorSaveData", + "EventNames": [ + [ + { + "Value": 242067946 + }, + "GetNumberOfActivePlayers" + ], + [ + { + "Value": 2930121176 + }, + "NewPlayerScriptActive" + ] + ] + } + } + } + }, + { + "Key": { + "id": 17741059337112 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MathNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 120.0, + 100.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{0D0751AD-8164-4196-9C09-8CDB9AAA296F}" + } + } + } + } + ], + "StatisticsHelper": { + "InstanceCounter": [ + { + "Key": 1244476766431948410, + "Value": 1 + }, + { + "Key": 1678857390775488101, + "Value": 1 + }, + { + "Key": 1678857392390856307, + "Value": 1 + } + ] + } + }, + "Component_[16498171485036643402]": { + "$type": "EditorGraphVariableManagerComponent", + "Id": 16498171485036643402, + "m_variableData": { + "m_nameVariableMap": [ + { + "Key": { + "m_id": "{8451E795-6A0E-44CE-81FD-AEF0EE5B0400}" + }, + "Value": { + "Datum": { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0 + }, + "VariableId": { + "m_id": "{8451E795-6A0E-44CE-81FD-AEF0EE5B0400}" + }, + "VariableName": "ActivePlayerCount" + } + } + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/GlobalGameData.scriptevents b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/GlobalGameData.scriptevents new file mode 100644 index 0000000000..059713e14b --- /dev/null +++ b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/GlobalGameData.scriptevents @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/Player.prefab b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/Player.prefab new file mode 100644 index 0000000000..2653809dda --- /dev/null +++ b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/Player.prefab @@ -0,0 +1,195 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "Player", + "Components": { + "Component_[10603663676997462041]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 10603663676997462041 + }, + "Component_[11066377844757909329]": { + "$type": "EditorPrefabComponent", + "Id": 11066377844757909329 + }, + "Component_[11664640320098005944]": { + "$type": "EditorEntityIconComponent", + "Id": 11664640320098005944 + }, + "Component_[12551690377468870725]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 12551690377468870725, + "Parent Entity": "" + }, + "Component_[16402163080075698011]": { + "$type": "EditorOnlyEntityComponent", + "Id": 16402163080075698011 + }, + "Component_[3491366785918494447]": { + "$type": "EditorLockComponent", + "Id": 3491366785918494447 + }, + "Component_[4830373679514129871]": { + "$type": "EditorVisibilityComponent", + "Id": 4830373679514129871 + }, + "Component_[5144323498211834874]": { + "$type": "SelectionComponent", + "Id": 5144323498211834874 + }, + "Component_[5267607163086533733]": { + "$type": "EditorInspectorComponent", + "Id": 5267607163086533733 + }, + "Component_[6678300504118618849]": { + "$type": "EditorPendingCompositionComponent", + "Id": 6678300504118618849 + }, + "Component_[8384628950786300469]": { + "$type": "EditorEntitySortComponent", + "Id": 8384628950786300469, + "Child Entity Order": [ + "Entity_[10070247746456]" + ] + } + } + }, + "Entities": { + "Entity_[10070247746456]": { + "Id": "Entity_[10070247746456]", + "Name": "Player", + "Components": { + "Component_[1059478843478789313]": { + "$type": "EditorInspectorComponent", + "Id": 1059478843478789313, + "ComponentOrderEntryArray": [ + { + "ComponentId": 9878555871810913249 + }, + { + "ComponentId": 11481641385923146202, + "SortIndex": 1 + }, + { + "ComponentId": 11440172471478606933, + "SortIndex": 2 + }, + { + "ComponentId": 17461691807054668218, + "SortIndex": 3 + }, + { + "ComponentId": 15530420875454157766, + "SortIndex": 4 + }, + { + "ComponentId": 10596595655489113153, + "SortIndex": 5 + } + ] + }, + "Component_[10596595655489113153]": { + "$type": "EditorScriptCanvasComponent", + "Id": 10596595655489113153, + "m_name": "AutoComponent_RPC", + "m_assetHolder": { + "m_asset": { + "assetId": { + "guid": "{5ED120C4-07DC-56F1-80A7-37BFC98FD74E}" + }, + "assetHint": "levels/multiplayer/autocomponent_rpc/autocomponent_rpc.scriptcanvas" + } + }, + "runtimeDataIsValid": true, + "runtimeDataOverrides": { + "source": { + "assetId": { + "guid": "{5ED120C4-07DC-56F1-80A7-37BFC98FD74E}" + }, + "assetHint": "levels/multiplayer/autocomponent_rpc/autocomponent_rpc.scriptcanvas" + } + } + }, + "Component_[11440172471478606933]": { + "$type": "GenericComponentWrapper", + "Id": 11440172471478606933, + "m_template": { + "$type": "Multiplayer::NetworkTransformComponent" + } + }, + "Component_[11481641385923146202]": { + "$type": "GenericComponentWrapper", + "Id": 11481641385923146202, + "m_template": { + "$type": "NetBindComponent" + } + }, + "Component_[13110996849704981748]": { + "$type": "EditorVisibilityComponent", + "Id": 13110996849704981748 + }, + "Component_[1472895075383059499]": { + "$type": "EditorLockComponent", + "Id": 1472895075383059499 + }, + "Component_[1526920553231193509]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1526920553231193509 + }, + "Component_[15530420875454157766]": { + "$type": "GenericComponentWrapper", + "Id": 15530420875454157766, + "m_template": { + "$type": "Multiplayer::LocalPredictionPlayerInputComponent" + } + }, + "Component_[1699895912837266792]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1699895912837266792 + }, + "Component_[17461691807054668218]": { + "$type": "GenericComponentWrapper", + "Id": 17461691807054668218, + "m_template": { + "$type": "AutomatedTesting::NetworkTestPlayerComponent" + } + }, + "Component_[3622545398462507871]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3622545398462507871 + }, + "Component_[5778259918231688598]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 5778259918231688598, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{F322592F-43BC-50E7-903C-CC231846093F}", + "subId": 276443623 + }, + "assetHint": "objects/_primitives/_cylinder_1x1.azmodel" + } + } + } + }, + "Component_[7004633483882343256]": { + "$type": "SelectionComponent", + "Id": 7004633483882343256 + }, + "Component_[8469628382507693850]": { + "$type": "EditorEntitySortComponent", + "Id": 8469628382507693850 + }, + "Component_[9407892837096707905]": { + "$type": "EditorEntityIconComponent", + "Id": 9407892837096707905 + }, + "Component_[9878555871810913249]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 9878555871810913249, + "Parent Entity": "ContainerEntity" + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/tags.txt b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/tags.txt new file mode 100644 index 0000000000..0d6c1880e7 --- /dev/null +++ b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/tags.txt @@ -0,0 +1,12 @@ +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 From f6c318715198b77ae7ee5f198a53a087b968c8b1 Mon Sep 17 00:00:00 2001 From: sphrose <82213493+sphrose@users.noreply.github.com> Date: Mon, 6 Dec 2021 09:54:00 +0000 Subject: [PATCH 014/948] LYN-7056 SurfaceDataConstants should be revised to have no terrain references Signed-off-by: sphrose <82213493+sphrose@users.noreply.github.com> --- Gems/SurfaceData/Code/CMakeLists.txt | 3 +++ .../SurfaceData/SurfaceDataConstants.h | 13 +--------- .../EditorSurfaceDataSystemComponent.cpp | 1 - .../Editor/EditorSurfaceDataSystemComponent.h | 11 ++++++++- .../Code/Tests/SurfaceDataTest.cpp | 2 +- .../Include/Terrain/TerrainDataConstants.h | 24 +++++++++++++++++++ .../TerrainSurfaceDataSystemComponent.cpp | 8 +++---- Gems/Terrain/Code/terrain_files.cmake | 1 + 8 files changed, 44 insertions(+), 19 deletions(-) create mode 100644 Gems/Terrain/Code/Include/Terrain/TerrainDataConstants.h diff --git a/Gems/SurfaceData/Code/CMakeLists.txt b/Gems/SurfaceData/Code/CMakeLists.txt index 54363d265e..c35da595d6 100644 --- a/Gems/SurfaceData/Code/CMakeLists.txt +++ b/Gems/SurfaceData/Code/CMakeLists.txt @@ -70,6 +70,7 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) AZ::AzToolsFramework Gem::SurfaceData.Static Gem::LmbrCentral.Editor + Gem::Terrain RUNTIME_DEPENDENCIES Gem::LmbrCentral.Editor ) @@ -97,9 +98,11 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) BUILD_DEPENDENCIES PRIVATE AZ::AzTest + AZ::AzToolsFramework Legacy::CryCommon Gem::SurfaceData.Static Gem::LmbrCentral + Gem::Terrain ) ly_add_googletest( NAME Gem::SurfaceData.Tests diff --git a/Gems/SurfaceData/Code/Include/SurfaceData/SurfaceDataConstants.h b/Gems/SurfaceData/Code/Include/SurfaceData/SurfaceDataConstants.h index 3f4a1bb605..2a8f618ac8 100644 --- a/Gems/SurfaceData/Code/Include/SurfaceData/SurfaceDataConstants.h +++ b/Gems/SurfaceData/Code/Include/SurfaceData/SurfaceDataConstants.h @@ -9,25 +9,14 @@ #pragma once #include -#include +#include namespace SurfaceData { namespace Constants { static const char* s_unassignedTagName = AzFramework::SurfaceData::Constants::s_unassignedTagName; - static const char* s_terrainHoleTagName = "terrainHole"; - static const char* s_terrainTagName = "terrain"; static const AZ::Crc32 s_unassignedTagCrc = AZ::Crc32(s_unassignedTagName); - static const AZ::Crc32 s_terrainHoleTagCrc = AZ::Crc32(s_terrainHoleTagName); - static const AZ::Crc32 s_terrainTagCrc = AZ::Crc32(s_terrainTagName); - - static const char* s_allTagNames[] = - { - s_unassignedTagName, - s_terrainHoleTagName, - s_terrainTagName, - }; } } diff --git a/Gems/SurfaceData/Code/Source/Editor/EditorSurfaceDataSystemComponent.cpp b/Gems/SurfaceData/Code/Source/Editor/EditorSurfaceDataSystemComponent.cpp index a5bf51d0fe..0285ab5ca4 100644 --- a/Gems/SurfaceData/Code/Source/Editor/EditorSurfaceDataSystemComponent.cpp +++ b/Gems/SurfaceData/Code/Source/Editor/EditorSurfaceDataSystemComponent.cpp @@ -12,7 +12,6 @@ #include #include - namespace SurfaceData { namespace Details diff --git a/Gems/SurfaceData/Code/Source/Editor/EditorSurfaceDataSystemComponent.h b/Gems/SurfaceData/Code/Source/Editor/EditorSurfaceDataSystemComponent.h index 603cffc56d..68f7ea7291 100644 --- a/Gems/SurfaceData/Code/Source/Editor/EditorSurfaceDataSystemComponent.h +++ b/Gems/SurfaceData/Code/Source/Editor/EditorSurfaceDataSystemComponent.h @@ -14,6 +14,7 @@ #include #include #include +#include namespace AZ::Data { @@ -22,6 +23,15 @@ namespace AZ::Data namespace SurfaceData { + namespace Constants + { + static const char* s_allTagNames[] = { + Constants::s_unassignedTagName, + Terrain::Constants::s_terrainHoleTagName, + Terrain::Constants::s_terrainTagName, + }; + } //namespace Constants + class EditorSurfaceDataSystemConfig : public AZ::ComponentConfig { @@ -47,7 +57,6 @@ namespace SurfaceData static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required); private: - void LoadAsset(const AZ::Data::AssetId& assetId); void AddAsset(AZ::Data::Asset& asset); diff --git a/Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp b/Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp index d5384161ad..23c0a1d4c6 100644 --- a/Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp +++ b/Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp @@ -23,8 +23,8 @@ #include #include #include -#include #include +#include struct MockGlobalEnvironment { diff --git a/Gems/Terrain/Code/Include/Terrain/TerrainDataConstants.h b/Gems/Terrain/Code/Include/Terrain/TerrainDataConstants.h new file mode 100644 index 0000000000..e125e41ccf --- /dev/null +++ b/Gems/Terrain/Code/Include/Terrain/TerrainDataConstants.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * 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 Terrain +{ + namespace Constants + { + static const char* s_terrainHoleTagName = "terrainHole"; + static const char* s_terrainTagName = "terrain"; + + static const AZ::Crc32 s_terrainHoleTagCrc = AZ::Crc32(s_terrainHoleTagName); + static const AZ::Crc32 s_terrainTagCrc = AZ::Crc32(s_terrainTagName); + } +} diff --git a/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp b/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp index 65e8600d62..8c75aafa65 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp +++ b/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp @@ -7,6 +7,7 @@ */ #include +#include #include #include #include @@ -162,8 +163,7 @@ namespace Terrain point.m_normal = terrainSurfacePoint.m_normal; // Always add a "terrain" or "terrainHole" tag. - const AZ::Crc32 terrainTag = - isHole ? SurfaceData::Constants::s_terrainHoleTagCrc : SurfaceData::Constants::s_terrainTagCrc; + const AZ::Crc32 terrainTag = isHole ? Constants::s_terrainHoleTagCrc : Constants::s_terrainTagCrc; SurfaceData::AddMaxValueForMasks(point.m_masks, terrainTag, 1.0f); // Add all of the surface tags that the terrain has at this point. @@ -189,8 +189,8 @@ namespace Terrain SurfaceData::SurfaceTagVector TerrainSurfaceDataSystemComponent::GetSurfaceTags() const { SurfaceData::SurfaceTagVector tags; - tags.push_back(SurfaceData::Constants::s_terrainHoleTagCrc); - tags.push_back(SurfaceData::Constants::s_terrainTagCrc); + tags.push_back(Constants::s_terrainHoleTagCrc); + tags.push_back(Constants::s_terrainTagCrc); return tags; } diff --git a/Gems/Terrain/Code/terrain_files.cmake b/Gems/Terrain/Code/terrain_files.cmake index 893477e10d..9e6e68d140 100644 --- a/Gems/Terrain/Code/terrain_files.cmake +++ b/Gems/Terrain/Code/terrain_files.cmake @@ -8,6 +8,7 @@ set(FILES Include/Terrain/Ebuses/TerrainAreaSurfaceRequestBus.h + Include/Terrain/TerrainDataConstants.h Source/Components/TerrainHeightGradientListComponent.cpp Source/Components/TerrainHeightGradientListComponent.h Source/Components/TerrainLayerSpawnerComponent.cpp From 58872581c5fe794c81db20711eb1b9ce30fd544a Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Mon, 6 Dec 2021 08:52:54 -0800 Subject: [PATCH 015/948] Wip.RPC testing Authority->Client and Server->Authory. Ran into a blocker so checking in now to save work Signed-off-by: Gene Walters --- ...tworkTestPlayerComponent.AutoComponent.xml | 6 +- .../AutoComponent_RPC.prefab | 125 ++++++++- .../AutoComponent_RPC.scriptcanvas | 252 ++++++++++-------- 3 files changed, 270 insertions(+), 113 deletions(-) diff --git a/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml b/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml index 07004c4f1e..9037db43ee 100644 --- a/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml +++ b/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml @@ -29,10 +29,10 @@ - + - - + + diff --git a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.prefab b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.prefab index a9bec3251a..74dbcd993f 100644 --- a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.prefab +++ b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.prefab @@ -20,7 +20,9 @@ "Id": 14126657869720434043, "Child Entity Order": [ "Entity_[1176639161715]", - "Entity_[12685882829720]" + "Entity_[12685882829720]", + "Entity_[31145534614197]", + "Entity_[31145534614197]" ] }, "Component_[15230859088967841193]": { @@ -205,7 +207,7 @@ "Controller": { "Configuration": { "Field of View": 55.0, - "EditorEntityId": 15661114386016447348 + "EditorEntityId": 11050384689878106598 } } }, @@ -622,6 +624,125 @@ "Id": 9550161640684119498 } } + }, + "Entity_[31145534614197]": { + "Id": "Entity_[31145534614197]", + "Name": "NetLevelEntity", + "Components": { + "Component_[12132849363414901338]": { + "$type": "EditorEntityIconComponent", + "Id": 12132849363414901338 + }, + "Component_[12302672911455629152]": { + "$type": "SelectionComponent", + "Id": 12302672911455629152 + }, + "Component_[14169903623243423134]": { + "$type": "EditorVisibilityComponent", + "Id": 14169903623243423134 + }, + "Component_[14300469789192169678]": { + "$type": "GenericComponentWrapper", + "Id": 14300469789192169678, + "m_template": { + "$type": "AutomatedTesting::NetworkTestPlayerComponent" + } + }, + "Component_[14607413934411389854]": { + "$type": "EditorInspectorComponent", + "Id": 14607413934411389854 + }, + "Component_[15494977028055234270]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 15494977028055234270 + }, + "Component_[16325088972532345964]": { + "$type": "EditorLockComponent", + "Id": 16325088972532345964 + }, + "Component_[1639017114849961416]": { + "$type": "GenericComponentWrapper", + "Id": 1639017114849961416, + "m_template": { + "$type": "Multiplayer::LocalPredictionPlayerInputComponent" + } + }, + "Component_[1986030426392465743]": { + "$type": "EditorEntitySortComponent", + "Id": 1986030426392465743 + }, + "Component_[4591476848838823508]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 4591476848838823508, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{80FA8BAF-4A5B-5937-9679-2E592E841A3A}", + "subId": 275306041 + }, + "assetHint": "assets/physics/collider_pxmeshautoassigned/spherebot/r0-b_body.azmodel" + } + } + } + }, + "Component_[7256163899440301540]": { + "$type": "EditorScriptCanvasComponent", + "Id": 7256163899440301540, + "m_name": "AutoComponent_RPC_NetLevelEntity", + "m_assetHolder": { + "m_asset": { + "assetId": { + "guid": "{1D517006-AC01-5ECA-AE66-0E007871F0CD}" + }, + "assetHint": "levels/multiplayer/autocomponent_rpc/autocomponent_rpc_netlevelentity.scriptcanvas" + } + }, + "runtimeDataIsValid": true, + "runtimeDataOverrides": { + "source": { + "assetId": { + "guid": "{1D517006-AC01-5ECA-AE66-0E007871F0CD}" + }, + "assetHint": "levels/multiplayer/autocomponent_rpc/autocomponent_rpc_netlevelentity.scriptcanvas" + } + } + }, + "Component_[731336627222243355]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 731336627222243355, + "Parent Entity": "Entity_[1146574390643]", + "Transform Data": { + "Translate": [ + 2.561863899230957, + -1.038161277770996, + 0.1487259864807129 + ] + } + }, + "Component_[8012379125499217348]": { + "$type": "EditorPendingCompositionComponent", + "Id": 8012379125499217348 + }, + "Component_[8122568562140740597]": { + "$type": "GenericComponentWrapper", + "Id": 8122568562140740597, + "m_template": { + "$type": "Multiplayer::NetworkTransformComponent" + } + }, + "Component_[8805228647591404845]": { + "$type": "GenericComponentWrapper", + "Id": 8805228647591404845, + "m_template": { + "$type": "NetBindComponent" + } + }, + "Component_[9880860858035405475]": { + "$type": "EditorOnlyEntityComponent", + "Id": 9880860858035405475 + } + } } } } \ No newline at end of file diff --git a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.scriptcanvas b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.scriptcanvas index 474266e7a0..54bb46e379 100644 --- a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.scriptcanvas +++ b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.scriptcanvas @@ -5,7 +5,7 @@ "ClassData": { "m_scriptCanvas": { "Id": { - "id": 45584036346395 + "id": 49433505360565 }, "Name": "AutoComponent_RPC", "Components": { @@ -43,7 +43,7 @@ "m_nodes": [ { "Id": { - "id": 45592626280987 + "id": 49442095295157 }, "Name": "SC-EventNode(AuthorityToAutonomous_PlayerNumber Notify Event)", "Components": { @@ -66,7 +66,7 @@ { "$type": "RestrictedNodeContract", "m_nodeId": { - "id": 45605511182875 + "id": 49472160066229 } } ], @@ -176,7 +176,7 @@ { "$type": "RestrictedNodeContract", "m_nodeId": { - "id": 45605511182875 + "id": 49472160066229 } } ], @@ -201,6 +201,24 @@ "m_azEventEntry": { "m_eventName": "AuthorityToAutonomous_PlayerNumber Notify Event", "m_parameterSlotIds": [ + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, { "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" }, @@ -209,6 +227,24 @@ } ], "m_parameterNames": [ + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, { "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" }, @@ -225,7 +261,7 @@ }, { "Id": { - "id": 45609806150171 + "id": 49467865098933 }, "Name": "SC-Node(IsNetEntityRoleAuthority)", "Components": { @@ -309,7 +345,7 @@ "value": { "id": 2901262558 }, - "label": "EntityId: 0" + "label": "Entity Id" } ], "methodType": 2, @@ -329,7 +365,7 @@ }, { "Id": { - "id": 45588331313691 + "id": 49446390262453 }, "Name": "SC-Node(Print)", "Components": { @@ -432,7 +468,7 @@ }, { "Id": { - "id": 45605511182875 + "id": 49472160066229 }, "Name": "SC-Node(GetAuthorityToAutonomous_PlayerNumberEventByEntityId)", "Components": { @@ -537,7 +573,7 @@ }, { "Id": { - "id": 45618396084763 + "id": 49476455033525 }, "Name": "SendScriptEvent", "Components": { @@ -599,7 +635,7 @@ }, { "Id": { - "id": 45631280986651 + "id": 49437800327861 }, "Name": "SendScriptEvent", "Components": { @@ -689,7 +725,7 @@ }, { "Id": { - "id": 45601216215579 + "id": 49454980197045 }, "Name": "SC-Node(Print)", "Components": { @@ -788,7 +824,7 @@ }, { "Id": { - "id": 45626986019355 + "id": 49459275164341 }, "Name": "SC-Node(TimeDelayNodeableNode)", "Components": { @@ -927,7 +963,7 @@ }, { "Id": { - "id": 45596921248283 + "id": 49480750000821 }, "Name": "SC-Node(AuthorityToAutonomous_PlayerNumberByEntityId)", "Components": { @@ -1045,7 +1081,7 @@ }, { "Id": { - "id": 45622691052059 + "id": 49450685229749 }, "Name": "SC-Node(Start)", "Components": { @@ -1075,7 +1111,7 @@ }, { "Id": { - "id": 45614101117467 + "id": 49463570131637 }, "Name": "SC-Node(Gate)", "Components": { @@ -1167,7 +1203,7 @@ "m_connections": [ { "Id": { - "id": 45635575953947 + "id": 49485044968117 }, "Name": "srcEndpoint=(IsNetEntityRoleAuthority: Out), destEndpoint=(If: In)", "Components": { @@ -1176,7 +1212,7 @@ "Id": 3645153988172561571, "sourceEndpoint": { "nodeId": { - "id": 45609806150171 + "id": 49467865098933 }, "slotId": { "m_id": "{1071F455-D5A0-4C7A-AF91-648A0F197885}" @@ -1184,7 +1220,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 45614101117467 + "id": 49463570131637 }, "slotId": { "m_id": "{8AE7F430-C4A9-444E-B42A-BDDFE96C387A}" @@ -1195,7 +1231,7 @@ }, { "Id": { - "id": 45639870921243 + "id": 49489339935413 }, "Name": "srcEndpoint=(IsNetEntityRoleAuthority: Is Role Authority), destEndpoint=(If: Condition)", "Components": { @@ -1204,7 +1240,7 @@ "Id": 17942926291787646743, "sourceEndpoint": { "nodeId": { - "id": 45609806150171 + "id": 49467865098933 }, "slotId": { "m_id": "{BA87B4ED-9A52-4A0D-8920-CD0ED4E839EA}" @@ -1212,7 +1248,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 45614101117467 + "id": 49463570131637 }, "slotId": { "m_id": "{3E89B67B-1EF2-4DAB-8028-59A97527F3DF}" @@ -1223,7 +1259,7 @@ }, { "Id": { - "id": 45644165888539 + "id": 49493634902709 }, "Name": "srcEndpoint=(If: True), destEndpoint=(Send Script Event: In)", "Components": { @@ -1232,7 +1268,7 @@ "Id": 3298020356088639785, "sourceEndpoint": { "nodeId": { - "id": 45614101117467 + "id": 49463570131637 }, "slotId": { "m_id": "{78C92586-C0E1-449F-8EB2-B1CE3BFC8AE7}" @@ -1240,7 +1276,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 45618396084763 + "id": 49476455033525 }, "slotId": { "m_id": "{2FF1A0A1-59C6-4DCF-AE1D-296BD5964D4E}" @@ -1251,7 +1287,7 @@ }, { "Id": { - "id": 45648460855835 + "id": 49497929870005 }, "Name": "srcEndpoint=(Send Script Event: Out), destEndpoint=(Send Script Event: In)", "Components": { @@ -1260,7 +1296,7 @@ "Id": 5482500452520221078, "sourceEndpoint": { "nodeId": { - "id": 45618396084763 + "id": 49476455033525 }, "slotId": { "m_id": "{F2955681-A901-432D-99A3-53818F46CDE7}" @@ -1268,7 +1304,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 45631280986651 + "id": 49437800327861 }, "slotId": { "m_id": "{23DBACD8-7784-4E18-A51C-258B25DF4C19}" @@ -1279,7 +1315,7 @@ }, { "Id": { - "id": 45652755823131 + "id": 49502224837301 }, "Name": "srcEndpoint=(Send Script Event: Out), destEndpoint=(AuthorityToAutonomous_PlayerNumberByEntityId: In)", "Components": { @@ -1288,7 +1324,7 @@ "Id": 16156808606878296902, "sourceEndpoint": { "nodeId": { - "id": 45631280986651 + "id": 49437800327861 }, "slotId": { "m_id": "{19C850D7-7F1E-4D41-AFD9-5A4FA03D54F0}" @@ -1296,7 +1332,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 45596921248283 + "id": 49480750000821 }, "slotId": { "m_id": "{1FDB4A9A-D46A-49E8-B734-475230EB7C06}" @@ -1307,7 +1343,7 @@ }, { "Id": { - "id": 45657050790427 + "id": 49506519804597 }, "Name": "srcEndpoint=(AuthorityToAutonomous_PlayerNumberByEntityId: Out), destEndpoint=(Print: In)", "Components": { @@ -1316,7 +1352,7 @@ "Id": 17367899649716276273, "sourceEndpoint": { "nodeId": { - "id": 45596921248283 + "id": 49480750000821 }, "slotId": { "m_id": "{964EAD23-8DF5-47A9-BF07-1E5C7CD0CC6C}" @@ -1324,7 +1360,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 45588331313691 + "id": 49446390262453 }, "slotId": { "m_id": "{F3ED8C08-D751-492A-A39A-7B7734727A5A}" @@ -1335,7 +1371,7 @@ }, { "Id": { - "id": 45661345757723 + "id": 49510814771893 }, "Name": "srcEndpoint=(On Graph Start: Out), destEndpoint=(TimeDelay: Start)", "Components": { @@ -1344,7 +1380,7 @@ "Id": 13463448697016307967, "sourceEndpoint": { "nodeId": { - "id": 45622691052059 + "id": 49450685229749 }, "slotId": { "m_id": "{A8EA9EF2-A3A6-46B5-8D43-08EF6B6B5B32}" @@ -1352,7 +1388,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 45626986019355 + "id": 49459275164341 }, "slotId": { "m_id": "{D2337DC6-F126-4254-B296-2DE6BA03993F}" @@ -1363,7 +1399,7 @@ }, { "Id": { - "id": 45665640725019 + "id": 49515109739189 }, "Name": "srcEndpoint=(GetAuthorityToAutonomous_PlayerNumberEventByEntityId: Event), destEndpoint=(AuthorityToAutonomous_PlayerNumber Notify Event: AuthorityToAutonomous_PlayerNumber Notify Event)", "Components": { @@ -1372,7 +1408,7 @@ "Id": 9477060643694737434, "sourceEndpoint": { "nodeId": { - "id": 45605511182875 + "id": 49472160066229 }, "slotId": { "m_id": "{7262E6CD-BADF-4DD0-8FCE-3A02C3F31CC8}" @@ -1380,7 +1416,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 45592626280987 + "id": 49442095295157 }, "slotId": { "m_id": "{8C7E88EA-8FEE-45D0-9A2E-78BC4A18F508}" @@ -1391,7 +1427,7 @@ }, { "Id": { - "id": 45669935692315 + "id": 49519404706485 }, "Name": "srcEndpoint=(GetAuthorityToAutonomous_PlayerNumberEventByEntityId: Out), destEndpoint=(AuthorityToAutonomous_PlayerNumber Notify Event: Connect)", "Components": { @@ -1400,7 +1436,7 @@ "Id": 16543380658701699472, "sourceEndpoint": { "nodeId": { - "id": 45605511182875 + "id": 49472160066229 }, "slotId": { "m_id": "{1A6BCB27-F99F-4B6B-89CC-F2BE2A698331}" @@ -1408,7 +1444,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 45592626280987 + "id": 49442095295157 }, "slotId": { "m_id": "{46E6B649-CAA4-4318-960D-5E4854E21BB2}" @@ -1419,7 +1455,7 @@ }, { "Id": { - "id": 45674230659611 + "id": 49523699673781 }, "Name": "srcEndpoint=(AuthorityToAutonomous_PlayerNumber Notify Event: player_number), destEndpoint=(Print: Value)", "Components": { @@ -1428,7 +1464,7 @@ "Id": 864863482692400383, "sourceEndpoint": { "nodeId": { - "id": 45592626280987 + "id": 49442095295157 }, "slotId": { "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" @@ -1436,7 +1472,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 45601216215579 + "id": 49454980197045 }, "slotId": { "m_id": "{BA146872-FBFF-4662-A569-8F1B4C8774AC}" @@ -1447,7 +1483,7 @@ }, { "Id": { - "id": 45678525626907 + "id": 49527994641077 }, "Name": "srcEndpoint=(AuthorityToAutonomous_PlayerNumber Notify Event: OnEvent), destEndpoint=(Print: In)", "Components": { @@ -1456,7 +1492,7 @@ "Id": 2451057837093425972, "sourceEndpoint": { "nodeId": { - "id": 45592626280987 + "id": 49442095295157 }, "slotId": { "m_id": "{586BE222-2DEA-4E08-968F-07CA4EB96C54}" @@ -1464,7 +1500,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 45601216215579 + "id": 49454980197045 }, "slotId": { "m_id": "{D206E5BC-3746-4A18-80C7-DBD335FD05FE}" @@ -1475,7 +1511,7 @@ }, { "Id": { - "id": 45682820594203 + "id": 49532289608373 }, "Name": "srcEndpoint=(On Graph Start: Out), destEndpoint=(GetAuthorityToAutonomous_PlayerNumberEventByEntityId: In)", "Components": { @@ -1484,7 +1520,7 @@ "Id": 12180981889720748145, "sourceEndpoint": { "nodeId": { - "id": 45622691052059 + "id": 49450685229749 }, "slotId": { "m_id": "{A8EA9EF2-A3A6-46B5-8D43-08EF6B6B5B32}" @@ -1492,7 +1528,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 45605511182875 + "id": 49472160066229 }, "slotId": { "m_id": "{211BD78B-E01E-44F8-B44E-2FD988047BE9}" @@ -1503,7 +1539,7 @@ }, { "Id": { - "id": 45687115561499 + "id": 49536584575669 }, "Name": "srcEndpoint=(TimeDelay: Done), destEndpoint=(IsNetEntityRoleAuthority: In)", "Components": { @@ -1512,7 +1548,7 @@ "Id": 5772191552099194657, "sourceEndpoint": { "nodeId": { - "id": 45626986019355 + "id": 49459275164341 }, "slotId": { "m_id": "{25568B15-5372-4C2D-8280-2B433251EACA}" @@ -1520,7 +1556,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 45609806150171 + "id": 49467865098933 }, "slotId": { "m_id": "{B6C4BE5E-CDE4-4EC7-98D0-A019CD80041C}" @@ -1533,13 +1569,13 @@ "m_scriptEventAssets": [ [ { - "id": 45631280986651 + "id": 49437800327861 }, {} ], [ { - "id": 45618396084763 + "id": 49476455033525 }, {} ] @@ -1555,16 +1591,16 @@ "GraphCanvasData": [ { "Key": { - "id": 45584036346395 + "id": 49433505360565 }, "Value": { "ComponentData": { "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { "$type": "SceneComponentSaveData", "ViewParams": { - "Scale": 0.9670775714052148, - "AnchorX": 180.9575653076172, - "AnchorY": 127.18731689453125 + "Scale": 0.8220159356944325, + "AnchorX": 72.99128723144531, + "AnchorY": 74.20780944824219 } } } @@ -1572,7 +1608,7 @@ }, { "Key": { - "id": 45588331313691 + "id": 49437800327861 }, "Value": { "ComponentData": { @@ -1581,28 +1617,29 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "StringNodeTitlePalette" + "PaletteOverride": "MethodNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 2280.0, + 1540.0, 260.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData" + "$type": "StylingComponentSaveData", + "SubStyle": ".method" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{B91C0E41-E6B5-46DE-885F-6BC6CFB2E813}" + "PersistentId": "{FD844BFD-72DA-44BA-B92A-AFDB58263B91}" } } } }, { "Key": { - "id": 45592626280987 + "id": 49442095295157 }, "Value": { "ComponentData": { @@ -1616,7 +1653,7 @@ "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 980.0, + 820.0, 620.0 ] }, @@ -1633,7 +1670,7 @@ }, { "Key": { - "id": 45596921248283 + "id": 49446390262453 }, "Value": { "ComponentData": { @@ -1642,29 +1679,28 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "MethodNodeTitlePalette" + "PaletteOverride": "StringNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 1840.0, + 2280.0, 260.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData", - "SubStyle": ".method" + "$type": "StylingComponentSaveData" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{59FFF3C1-2D7B-47EA-AE35-ED15DCB95CC8}" + "PersistentId": "{B91C0E41-E6B5-46DE-885F-6BC6CFB2E813}" } } } }, { "Key": { - "id": 45601216215579 + "id": 49450685229749 }, "Value": { "ComponentData": { @@ -1673,13 +1709,13 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "StringNodeTitlePalette" + "PaletteOverride": "TimeNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 1160.0, - 620.0 + 40.0, + 280.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { @@ -1687,14 +1723,14 @@ }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{74ED5AE1-A269-46D4-B968-FEDF513C9CF1}" + "PersistentId": "{B4CB62D9-9965-42E2-81FF-BDADDBD14CBE}" } } } }, { "Key": { - "id": 45605511182875 + "id": 49454980197045 }, "Value": { "ComponentData": { @@ -1703,29 +1739,28 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "MethodNodeTitlePalette" + "PaletteOverride": "StringNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 380.0, + 1400.0, 620.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData", - "SubStyle": ".method" + "$type": "StylingComponentSaveData" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{BBBE60FC-0215-4A5A-BEBE-4FC869E5EECE}" + "PersistentId": "{74ED5AE1-A269-46D4-B968-FEDF513C9CF1}" } } } }, { "Key": { - "id": 45609806150171 + "id": 49459275164341 }, "Value": { "ComponentData": { @@ -1734,29 +1769,28 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "MethodNodeTitlePalette" + "PaletteOverride": "TimeNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 500.0, + 200.0, 260.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData", - "SubStyle": ".method" + "$type": "StylingComponentSaveData" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{348E780E-3A4E-47C7-ACF5-C7B2CB387517}" + "PersistentId": "{5DF902FE-B0C4-4563-B2BA-17996B24E211}" } } } }, { "Key": { - "id": 45614101117467 + "id": 49463570131637 }, "Value": { "ComponentData": { @@ -1786,7 +1820,7 @@ }, { "Key": { - "id": 45618396084763 + "id": 49467865098933 }, "Value": { "ComponentData": { @@ -1800,7 +1834,7 @@ "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 1240.0, + 500.0, 260.0 ] }, @@ -1810,14 +1844,14 @@ }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{13BD3C1C-EDBB-419E-8465-495935414A1A}" + "PersistentId": "{348E780E-3A4E-47C7-ACF5-C7B2CB387517}" } } } }, { "Key": { - "id": 45622691052059 + "id": 49472160066229 }, "Value": { "ComponentData": { @@ -1826,28 +1860,29 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "TimeNodeTitlePalette" + "PaletteOverride": "MethodNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 40.0, - 280.0 + 380.0, + 620.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData" + "$type": "StylingComponentSaveData", + "SubStyle": ".method" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{B4CB62D9-9965-42E2-81FF-BDADDBD14CBE}" + "PersistentId": "{BBBE60FC-0215-4A5A-BEBE-4FC869E5EECE}" } } } }, { "Key": { - "id": 45626986019355 + "id": 49476455033525 }, "Value": { "ComponentData": { @@ -1856,28 +1891,29 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "TimeNodeTitlePalette" + "PaletteOverride": "MethodNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 200.0, + 1240.0, 260.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData" + "$type": "StylingComponentSaveData", + "SubStyle": ".method" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{5DF902FE-B0C4-4563-B2BA-17996B24E211}" + "PersistentId": "{13BD3C1C-EDBB-419E-8465-495935414A1A}" } } } }, { "Key": { - "id": 45631280986651 + "id": 49480750000821 }, "Value": { "ComponentData": { @@ -1891,7 +1927,7 @@ "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 1540.0, + 1840.0, 260.0 ] }, @@ -1901,7 +1937,7 @@ }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{FD844BFD-72DA-44BA-B92A-AFDB58263B91}" + "PersistentId": "{59FFF3C1-2D7B-47EA-AE35-ED15DCB95CC8}" } } } From cf9aab991104d0b59697b4826d25024add70f752 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 6 Dec 2021 18:34:52 -0800 Subject: [PATCH 016/948] Adds recording functionality (disabled) and a benchmark that can run recordings Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzCore/AzCore/Memory/AllocatorBase.cpp | 81 +++++ .../Tests/Memory/AllocatorBenchmarks.cpp | 338 ++++++++++++------ 2 files changed, 306 insertions(+), 113 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp index e450f12bcf..40ddff0fc3 100644 --- a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp @@ -12,6 +12,49 @@ using namespace AZ; +#define RECORDING_ENABLED 0 + +#if RECORDING_ENABLED + +struct AllocatorOperation +{ + enum OperationType : unsigned int + { + ALLOCATE, + DEALLOCATE, + REALLOCATE, + RESIZE + }; + OperationType m_operationType : 2; + size_t m_size : 46; + size_t m_alignment : 16; + void* m_ptr; + void* m_newptr; // required for resize +}; +static constexpr size_t s_allocationOperationCount = 5 * 1024; +static AZStd::array s_operations = {}; +static uint64_t s_operationCounter = 0; +static AZStd::mutex s_operationsMutex; + +AllocatorOperation& GetNextAllocatorOperation() +{ + AZStd::scoped_lock lock(s_operationsMutex); + if (s_operationCounter == s_allocationOperationCount) + { + FILE* file = nullptr; + fopen_s(&file, "memoryrecordings.bin", "ab"); + if (file) + { + fwrite(&s_operations, sizeof(AllocatorOperation), s_allocationOperationCount, file); + fclose(file); + } + s_operationCounter = 0; + } + return s_operations[s_operationCounter++]; +} + +#endif + AllocatorBase::AllocatorBase(IAllocatorAllocate* allocationSource, const char* name, const char* desc) : IAllocator(allocationSource), m_name(name), @@ -136,6 +179,16 @@ void AllocatorBase::ProfileAllocation(void* ptr, size_t byteSize, size_t alignme EBUS_EVENT(AZ::Debug::MemoryDrillerBus, RegisterAllocation, this, ptr, byteSize, alignment, name, fileName, lineNum, suppressStackRecord); #endif } + +#if RECORDING_ENABLED + { + AllocatorOperation& op = GetNextAllocatorOperation(); + op.m_operationType = AllocatorOperation::ALLOCATE; + op.m_size = byteSize; + op.m_alignment = alignment; + op.m_ptr = ptr; + } +#endif } void AllocatorBase::ProfileDeallocation(void* ptr, size_t byteSize, size_t alignment, Debug::AllocationInfo* info) @@ -148,6 +201,15 @@ void AllocatorBase::ProfileDeallocation(void* ptr, size_t byteSize, size_t align EBUS_EVENT(AZ::Debug::MemoryDrillerBus, UnregisterAllocation, this, ptr, byteSize, alignment, info); #endif } +#if RECORDING_ENABLED + { + AllocatorOperation& op = GetNextAllocatorOperation(); + op.m_operationType = AllocatorOperation::DEALLOCATE; + op.m_size = byteSize; + op.m_alignment = alignment; + op.m_ptr = ptr; + } +#endif } void AllocatorBase::ProfileReallocationBegin(void* ptr, size_t newSize) @@ -174,6 +236,16 @@ void AllocatorBase::ProfileReallocationEnd(void* ptr, void* newPtr, size_t newSi EBUS_EVENT(AZ::Debug::MemoryDrillerBus, ReallocateAllocation, this, ptr, newPtr, newSize, newAlignment); #endif } +#if RECORDING_ENABLED + { + AllocatorOperation& op = GetNextAllocatorOperation(); + op.m_operationType = AllocatorOperation::REALLOCATE; + op.m_size = newSize; + op.m_alignment = newAlignment; + op.m_ptr = ptr; + op.m_newptr = newPtr; + } +#endif } void AllocatorBase::ProfileReallocation(void* ptr, void* newPtr, size_t newSize, size_t newAlignment) @@ -187,6 +259,15 @@ void AllocatorBase::ProfileResize(void* ptr, size_t newSize) { EBUS_EVENT(AZ::Debug::MemoryDrillerBus, ResizeAllocation, this, ptr, newSize); } +#if RECORDING_ENABLED + { + AllocatorOperation& op = GetNextAllocatorOperation(); + op.m_operationType = AllocatorOperation::RESIZE; + op.m_size = newSize; + op.m_alignment = 0; + op.m_ptr = ptr; + } +#endif } bool AllocatorBase::OnOutOfMemory(size_t byteSize, size_t alignment, int flags, const char* name, const char* fileName, int lineNum) diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp index dfaefd4c0f..76c3316009 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -32,7 +32,7 @@ namespace Benchmark size_t GetMemorySize(void* memory); } - static AZ::Debug::DrillerManager* s_drillerManager = nullptr; + //static AZ::Debug::DrillerManager* s_drillerManager = nullptr; /// /// Test allocator wrapper that redirects the calls to the passed TAllocator by using AZ::AllocatorInstance. @@ -47,14 +47,14 @@ namespace Benchmark { AZ::AllocatorInstance::Create(); - s_drillerManager = AZ::Debug::DrillerManager::Create(); - s_drillerManager->Register(aznew AZ::Debug::MemoryDriller); + /*s_drillerManager = AZ::Debug::DrillerManager::Create(); + s_drillerManager->Register(aznew AZ::Debug::MemoryDriller);*/ } static void TearDown() { - AZ::Debug::DrillerManager::Destroy(s_drillerManager); - s_drillerManager = nullptr; + /*AZ::Debug::DrillerManager::Destroy(s_drillerManager); + s_drillerManager = nullptr;*/ AZ::AllocatorInstance::Destroy(); } @@ -89,51 +89,41 @@ namespace Benchmark return AZ::AllocatorInstance::Get().NumAllocatedBytes() + AZ::AllocatorInstance::Get().GetUnAllocatedMemory(); } + + static size_t GetSize(void* ptr) + { + return AZ::AllocatorInstance::Get().AllocationSize(ptr); + } }; /// /// Basic allocator used as a baseline. This allocator is the most basic allocation possible with the OS (AZ_OS_MALLOC). /// MallocSchema cannot be used here because it has extra logic that we don't want to use as a baseline. /// - class TestRawMallocAllocator - : public AZ::AllocatorBase - , public AZ::IAllocatorAllocate + class TestRawMallocAllocator {}; + + template<> + class TestAllocatorWrapper { public: - AZ_TYPE_INFO(TestMallocSchemaAllocator, "{08EB400A-D723-46C6-808E-D0844C8DE206}"); - - struct Descriptor {}; - - TestRawMallocAllocator() - : AllocatorBase(this, "TestRawMallocAllocator", "") + TestAllocatorWrapper() { - m_numAllocatedBytes = 0; + s_numAllocatedBytes = 0; } - bool Create(const Descriptor&) + static void SetUp() { - m_numAllocatedBytes = 0; - return true; + s_numAllocatedBytes = 0; } - // IAllocator - void Destroy() override - { - m_numAllocatedBytes = 0; - } - AZ::AllocatorDebugConfig GetDebugConfig() override - { - return AZ::AllocatorDebugConfig(); - } - AZ::IAllocatorAllocate* GetSchema() override + static void TearDown() { - return nullptr; } // IAllocatorAllocate - void* Allocate(size_t byteSize, size_t alignment, int = 0, const char* = 0, const char* = 0, int = 0, unsigned int = 0) override + static void* Allocate(size_t byteSize, size_t alignment) { - m_numAllocatedBytes += byteSize; + s_numAllocatedBytes += byteSize; if (alignment) { return AZ_OS_MALLOC(byteSize, alignment); @@ -144,18 +134,18 @@ namespace Benchmark } } - void DeAllocate(void* ptr, size_t = 0, size_type = 0) override + static void DeAllocate(void* ptr, size_t = 0) { - m_numAllocatedBytes -= Platform::GetMemorySize(ptr); + s_numAllocatedBytes -= Platform::GetMemorySize(ptr); AZ_OS_FREE(ptr); } - void* ReAllocate(void* ptr, size_t newSize, size_t newAlignment) override + static void* ReAllocate(void* ptr, size_t newSize, size_t newAlignment) { - m_numAllocatedBytes -= Platform::GetMemorySize(ptr); + s_numAllocatedBytes -= Platform::GetMemorySize(ptr); AZ_OS_FREE(ptr); - m_numAllocatedBytes += newSize; + s_numAllocatedBytes += newSize; if (newAlignment) { return AZ_OS_MALLOC(newSize, newAlignment); @@ -166,7 +156,7 @@ namespace Benchmark } } - size_t Resize(void* ptr, size_t newSize) override + static size_t Resize(void* ptr, size_t newSize) { AZ_UNUSED(ptr); AZ_UNUSED(newSize); @@ -174,45 +164,24 @@ namespace Benchmark return 0; } - size_t AllocationSize(void* ptr) override - { - return Platform::GetMemorySize(ptr); - } - - void GarbageCollect() override {} - - size_t NumAllocatedBytes() const override - { - return m_numAllocatedBytes; - } - - size_t Capacity() const override - { - return AZ_CORE_MAX_ALLOCATOR_SIZE; // unused - } + static void GarbageCollect() {} - size_t GetMaxAllocationSize() const override + static size_t NumAllocatedBytes() { - return AZ_CORE_MAX_ALLOCATOR_SIZE; // unused + return s_numAllocatedBytes; } - size_t GetMaxContiguousAllocationSize() const override - { - return AZ_CORE_MAX_ALLOCATOR_SIZE; // unused - } - size_t GetUnAllocatedMemory(bool = false) const override - { - return 0; // unused - } - IAllocatorAllocate* GetSubAllocator() override + static size_t GetSize(void* ptr) { - return nullptr; // unused + return Platform::GetMemorySize(ptr); } private: - size_t m_numAllocatedBytes; + static size_t s_numAllocatedBytes; }; + size_t TestAllocatorWrapper::s_numAllocatedBytes = 0; + // Here we require to implement this to be able to configure a name for the allocator, otherswise the AllocatorManager crashes when trying to configure the overrides class TestMallocSchemaAllocator : public AZ::SimpleSchemaAllocator { @@ -250,11 +219,14 @@ namespace Benchmark AZ_TYPE_INFO(TestSystemAllocator, "{360D4DAA-D65D-4D5C-A6FA-1A4C5261C35C}"); }; - // Allocated bytes reported by the allocator / actually requested bytes - static const char* s_counterAllocatorMemoryRatio = "Allocator_MemoryRatio"; + // Allocated bytes reported by the allocator + static const char* s_counterAllocatorMemory = "Allocator_Memory"; + + // Allocated bytes reported by the process + static const char* s_counterProcessMemory = "Process_Memory"; - // Allocated bytes reported by the process / actually requested bytes - static const char* s_counterProcessMemoryRatio = "Process_MemoryRatio"; + // Allocated bytes as counted by the benchmark + static const char* s_counterBenchmarkMemory = "Benchmark_Memory"; enum AllocationSize { @@ -340,16 +312,6 @@ namespace Benchmark using base = AllocatorBenchmarkFixture; using TestAllocatorType = typename base::TestAllocatorType; - void internalSetUp(const ::benchmark::State& state) override - { - AllocatorBenchmarkFixture::internalSetUp(state); - } - - void internalTearDown(const ::benchmark::State& state) override - { - AllocatorBenchmarkFixture::internalTearDown(state); - } - public: void Benchmark(benchmark::State& state) { @@ -372,16 +334,9 @@ namespace Benchmark state.PauseTiming(); } - // In allocation cases, s_counterAllocatorMemoryRatio is measuring how much over-allocation our allocators - // are doing to keep track of the memory and because of fragmentation/under-use of blocks. A ratio over 1 means - // that we are using more memory than requested. Ideally we would approximate to a ratio of 1. - state.counters[s_counterAllocatorMemoryRatio] = benchmark::Counter( - static_cast(TestAllocatorType::NumAllocatedBytes()) / static_cast(totalAllocationSize), - benchmark::Counter::kDefaults); - // s_counterProcessMemoryRatio is measuring the same ratio but using the OS to measure the used process memory - state.counters[s_counterProcessMemoryRatio] = benchmark::Counter( - static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline) / static_cast(totalAllocationSize), - benchmark::Counter::kDefaults); + state.counters[s_counterAllocatorMemory] = benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); + state.counters[s_counterProcessMemory] = benchmark::Counter(static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), benchmark::Counter::kDefaults); + state.counters[s_counterBenchmarkMemory] = benchmark::Counter(static_cast(totalAllocationSize), benchmark::Counter::kDefaults); for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) { @@ -404,15 +359,6 @@ namespace Benchmark using base = AllocatorBenchmarkFixture; using TestAllocatorType = typename base::TestAllocatorType; - void internalSetUp(const ::benchmark::State& state) override - { - AllocatorBenchmarkFixture::internalSetUp(state); - } - - void internalTearDown(const ::benchmark::State& state) override - { - AllocatorBenchmarkFixture::internalTearDown(state); - } public: void Benchmark(benchmark::State& state) { @@ -442,17 +388,9 @@ namespace Benchmark perThreadAllocations[allocationIndex] = nullptr; } - // In deallocation cases, s_counterAllocatorMemoryRatio is measuring how much "left-over" memory our allocators - // have after deallocations happen. This is memory that is not returned to the operative system. A ratio of 1 means - // that no memory was returned to the OS. A ratio over 1 means that we are holding more memory than requested. A ratio - // lower than 1 means that we have returned some memory. - state.counters[s_counterAllocatorMemoryRatio] = benchmark::Counter( - static_cast(TestAllocatorType::NumAllocatedBytes()) / static_cast(totalAllocationSize), - benchmark::Counter::kDefaults); - // s_counterProcessMemoryRatio is measuring the same ratio but using the OS to measure the used process memory - state.counters[s_counterProcessMemoryRatio] = benchmark::Counter( - static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline) / static_cast(totalAllocationSize), - benchmark::Counter::kDefaults); + state.counters[s_counterAllocatorMemory] = benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); + state.counters[s_counterProcessMemory] = benchmark::Counter(static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), benchmark::Counter::kDefaults); + state.counters[s_counterBenchmarkMemory] = benchmark::Counter(static_cast(totalAllocationSize), benchmark::Counter::kDefaults); state.SetItemsProcessed(numberOfAllocations); @@ -460,6 +398,175 @@ namespace Benchmark } } }; + + template + class RecordedAllocationBenchmarkFixture : public AllocatorBenchmarkFixture + { + using base = AllocatorBenchmarkFixture; + using TestAllocatorType = typename base::TestAllocatorType; + + struct AllocatorOperation + { + enum OperationType : unsigned int + { + ALLOCATE, + DEALLOCATE, + REALLOCATE, + RESIZE + }; + OperationType m_operationType : 2; + size_t m_size : 46; + size_t m_alignment : 16; + void* m_ptr; + void* m_newptr; // required for resize + }; + + public: + void Benchmark(benchmark::State& state) + { + for (auto _ : state) + { + state.PauseTiming(); + + AZStd::unordered_map pointerRemapping; + AZStd::unordered_map allocationSize; + constexpr size_t allocationOperationCount = 5 * 1024; + AZStd::array m_operations = {}; + + FILE* file = nullptr; + fopen_s(&file, "memoryrecordings.bin", "rb"); + if (!file) + { + return; + } + size_t elementsRead = fread(&m_operations, sizeof(AllocatorOperation), allocationOperationCount, file); + size_t totalElementsRead = elementsRead; + const size_t processMemoryBaseline = Platform::GetProcessMemoryUsageBytes(); + size_t totalAllocationSize = 0; + + while (elementsRead > 0) + { + for (size_t operationIndex = 0; operationIndex < elementsRead; ++operationIndex) + { + const AllocatorOperation& operation = m_operations[operationIndex]; + switch (operation.m_operationType) + { + case AllocatorOperation::ALLOCATE: + { + if (operation.m_ptr) + { + const auto it = pointerRemapping.emplace(operation.m_ptr, nullptr); + if (it.second) // otherwise already allocated + { + state.ResumeTiming(); + void* ptr = TestAllocatorType::Allocate(operation.m_size, operation.m_alignment); + state.PauseTiming(); + totalAllocationSize += operation.m_size; + it.first->second = ptr; + allocationSize[ptr] = operation.m_size; + } + else + { + //AZ_Warning("RecordedAllocationBenchmarkFixture", false, "Allocation on %p was already made", operation.m_ptr); + } + } + break; + } + case AllocatorOperation::DEALLOCATE: + { + if (operation.m_ptr) // some deallocate(nullptr) are recorded + { + const auto ptrIt = pointerRemapping.find(operation.m_ptr); + if (ptrIt != pointerRemapping.end()) + { + totalAllocationSize -= allocationSize[ptrIt->second]; + state.ResumeTiming(); + TestAllocatorType::DeAllocate(ptrIt->second, /*operation.m_size*/ 0); // size is not correct after a resize, a 0 size deals with it + state.PauseTiming(); + pointerRemapping.erase(ptrIt); + } + } + else + { + // Just to account of the call of deallocate(nullptr); + // totalAllocationSize -= 0; // No real deallocation happened + state.ResumeTiming(); + TestAllocatorType::DeAllocate(operation.m_ptr, /*operation.m_size*/ 0); + state.PauseTiming(); + } + break; + } + case AllocatorOperation::REALLOCATE: + { + void* ptr = nullptr; + if (operation.m_ptr) + { + AZ_Assert(operation.m_newptr, "Need to consider other cases?"); + const auto ptrIt = pointerRemapping.find(operation.m_ptr); + AZ_Assert(ptrIt != pointerRemapping.end(), "Missing allocation for reallocation"); // In case the recording didnt catch something + ptr = ptrIt->second; + pointerRemapping.erase(ptrIt); + } + AZ_Assert(operation.m_newptr != nullptr, "Reallocation failed in the game"); + const auto it = pointerRemapping.emplace(operation.m_newptr, nullptr); + if (it.second) + { + totalAllocationSize -= allocationSize[ptr]; + state.ResumeTiming(); + void* newPtr = TestAllocatorType::ReAllocate(ptr, operation.m_size, operation.m_alignment); + state.PauseTiming(); + totalAllocationSize += operation.m_size; + it.first->second = newPtr; + allocationSize[newPtr] = operation.m_size; + } + else + { + totalAllocationSize -= allocationSize[ptr]; + state.ResumeTiming(); + TestAllocatorType::DeAllocate(ptr); + state.PauseTiming(); + } + break; + } + case AllocatorOperation::RESIZE: + { + const auto ptrIt = pointerRemapping.find(operation.m_ptr); + AZ_Assert(ptrIt != pointerRemapping.end(), "Missing allocation for resize"); // In case the recording didnt catch something + totalAllocationSize -= allocationSize[ptrIt->second]; + state.ResumeTiming(); + TestAllocatorType::Resize(ptrIt->second, operation.m_size); + state.PauseTiming(); + totalAllocationSize += operation.m_size; + if (operation.m_size == 0) + { + pointerRemapping.erase(ptrIt); + } + break; + } + } + } + + elementsRead = fread(&m_operations, sizeof(AllocatorOperation), allocationOperationCount, file); + totalElementsRead += elementsRead; + } + fclose(file); + + state.counters[s_counterAllocatorMemory] = benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); + state.counters[s_counterProcessMemory] = benchmark::Counter(static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), benchmark::Counter::kDefaults); + state.counters[s_counterBenchmarkMemory] = benchmark::Counter(static_cast(totalAllocationSize), benchmark::Counter::kDefaults); + + state.SetItemsProcessed(totalElementsRead); + + // Deallocate the remainder (since we stopped the recording middle-game)(there are leaks as well) + for (const auto& pointerMapping : pointerRemapping) + { + TestAllocatorType::DeAllocate(pointerMapping.second); + } + pointerRemapping.clear(); + TestAllocatorType::GarbageCollect(); + } + } + }; // For non-threaded ranges, run 100, 400, 1600 amounts static void RunRanges(benchmark::internal::Benchmark* b) @@ -469,6 +576,10 @@ namespace Benchmark b->Arg((1 << i) * 100); } } + static void RecordedRunRanges(benchmark::internal::Benchmark* b) + { + b->Arg(1); + } // For threaded ranges, run just 200, multi-threaded will already multiply by thread static void ThreadedRunRanges(benchmark::internal::Benchmark* b) @@ -494,16 +605,17 @@ namespace Benchmark #define BM_REGISTER_ALLOCATOR(TESTNAME, ALLOCATORTYPE) \ namespace TESTNAME \ { \ - BM_REGISTER_SIZE_FIXTURES(AllocationBenchmarkFixture, TESTNAME, ALLOCATORTYPE) \ - BM_REGISTER_SIZE_FIXTURES(DeAllocationBenchmarkFixture, TESTNAME, ALLOCATORTYPE) \ + BM_REGISTER_SIZE_FIXTURES(AllocationBenchmarkFixture, TESTNAME, ALLOCATORTYPE); \ + BM_REGISTER_SIZE_FIXTURES(DeAllocationBenchmarkFixture, TESTNAME, ALLOCATORTYPE); \ + BM_REGISTER_TEMPLATE(RecordedAllocationBenchmarkFixture, TESTNAME, ALLOCATORTYPE)->Apply(RecordedRunRanges); \ } BM_REGISTER_ALLOCATOR(RawMallocAllocator, TestRawMallocAllocator); BM_REGISTER_ALLOCATOR(MallocSchemaAllocator, TestMallocSchemaAllocator); - BM_REGISTER_ALLOCATOR(HeapSchemaAllocator, TestHeapSchemaAllocator); BM_REGISTER_ALLOCATOR(HphaSchemaAllocator, TestHphaSchemaAllocator); BM_REGISTER_ALLOCATOR(SystemAllocator, TestSystemAllocator); + //BM_REGISTER_ALLOCATOR(HeapSchemaAllocator, TestHeapSchemaAllocator); // Requires to pre-allocate blocks and cannot work as a general-purpose allocator //BM_REGISTER_SCHEMA(BestFitExternalMapSchema); // Requires to implement AZ::IAllocatorAllocate //BM_REGISTER_SCHEMA(PoolSchema); // Requires special alignment requests while allocating From 4b07665496f060459020f3f6c250807f26d0a80f Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 6 Dec 2021 18:35:39 -0800 Subject: [PATCH 017/948] Removes Heap allocator from being possible to use as a SystemAllocator since it doesnt allow dynamic allocating (only works with pre-allocated blocks) Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzCore/AzCore/Memory/SystemAllocator.cpp | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp b/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp index 8c84338fd0..9ce681ef2d 100644 --- a/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp @@ -19,7 +19,6 @@ #define AZCORE_SYSTEM_ALLOCATOR_HPHA 1 #define AZCORE_SYSTEM_ALLOCATOR_MALLOC 2 -#define AZCORE_SYSTEM_ALLOCATOR_HEAP 3 #if !defined(AZCORE_SYSTEM_ALLOCATOR) // define the default @@ -30,8 +29,6 @@ #include #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC #include -#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP - #include #else #error "Invalid allocator selected for SystemAllocator" #endif @@ -46,8 +43,6 @@ static bool g_isSystemSchemaUsed = false; static AZStd::aligned_storage::value>::type g_systemSchema; #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC static AZStd::aligned_storage::value>::type g_systemSchema; -#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP - static AZStd::aligned_storage::value>::type g_systemSchema; #endif ////////////////////////////////////////////////////////////////////////// @@ -121,11 +116,6 @@ SystemAllocator::Create(const Descriptor& desc) heapDesc.m_systemChunkSize = desc.m_heap.m_systemChunkSize; #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC MallocSchema::Descriptor heapDesc; -#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP - HeapSchema::Descriptor heapDesc; - memcpy(heapDesc.m_memoryBlocks, desc.m_heap.m_memoryBlocks, sizeof(heapDesc.m_memoryBlocks)); - memcpy(heapDesc.m_memoryBlocksByteSize, desc.m_heap.m_memoryBlocksByteSize, sizeof(heapDesc.m_memoryBlocksByteSize)); - heapDesc.m_numMemoryBlocks = desc.m_heap.m_numMemoryBlocks; #endif if (&AllocatorInstance::Get() == this) // if we are the system allocator { @@ -135,8 +125,6 @@ SystemAllocator::Create(const Descriptor& desc) m_allocator = new(&g_systemSchema)HphaSchema(heapDesc); #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC m_allocator = new(&g_systemSchema)MallocSchema(heapDesc); -#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP - m_allocator = new(&g_systemSchema)HeapSchema(heapDesc); #endif g_isSystemSchemaUsed = true; isReady = true; @@ -150,8 +138,6 @@ SystemAllocator::Create(const Descriptor& desc) m_allocator = azcreate(HphaSchema, (heapDesc), SystemAllocator); #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC m_allocator = azcreate(MallocSchema, (heapDesc), SystemAllocator); -#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP - m_allocator = azcreate(HeapSchema, (heapDesc), SystemAllocator); #endif if (m_allocator == nullptr) { @@ -188,8 +174,6 @@ SystemAllocator::Destroy() static_cast(m_allocator)->~HphaSchema(); #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC static_cast(m_allocator)->~MallocSchema(); -#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP - static_cast(m_allocator)->~HeapSchema(); #endif g_isSystemSchemaUsed = false; } From b0be54fa16a6257dd0b14f3e5df5fc9dc7b5e675 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Tue, 7 Dec 2021 14:46:58 -0800 Subject: [PATCH 018/948] Small script changes. WiP Signed-off-by: Gene Walters --- .../AutoComponent_RPC.prefab | 29 +- .../AutoComponent_RPC.scriptcanvas | 954 +++++++++++++++--- 2 files changed, 852 insertions(+), 131 deletions(-) diff --git a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.prefab b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.prefab index 74dbcd993f..758cb4fca8 100644 --- a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.prefab +++ b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.prefab @@ -21,7 +21,6 @@ "Child Entity Order": [ "Entity_[1176639161715]", "Entity_[12685882829720]", - "Entity_[31145534614197]", "Entity_[31145534614197]" ] }, @@ -641,17 +640,17 @@ "$type": "EditorVisibilityComponent", "Id": 14169903623243423134 }, - "Component_[14300469789192169678]": { - "$type": "GenericComponentWrapper", - "Id": 14300469789192169678, - "m_template": { - "$type": "AutomatedTesting::NetworkTestPlayerComponent" - } - }, "Component_[14607413934411389854]": { "$type": "EditorInspectorComponent", "Id": 14607413934411389854 }, + "Component_[15396284312416541768]": { + "$type": "GenericComponentWrapper", + "Id": 15396284312416541768, + "m_template": { + "$type": "Multiplayer::LocalPredictionPlayerInputComponent" + } + }, "Component_[15494977028055234270]": { "$type": "EditorDisabledCompositionComponent", "Id": 15494977028055234270 @@ -660,13 +659,6 @@ "$type": "EditorLockComponent", "Id": 16325088972532345964 }, - "Component_[1639017114849961416]": { - "$type": "GenericComponentWrapper", - "Id": 1639017114849961416, - "m_template": { - "$type": "Multiplayer::LocalPredictionPlayerInputComponent" - } - }, "Component_[1986030426392465743]": { "$type": "EditorEntitySortComponent", "Id": 1986030426392465743 @@ -738,6 +730,13 @@ "$type": "NetBindComponent" } }, + "Component_[9816897251206708579]": { + "$type": "GenericComponentWrapper", + "Id": 9816897251206708579, + "m_template": { + "$type": "AutomatedTesting::NetworkTestPlayerComponent" + } + }, "Component_[9880860858035405475]": { "$type": "EditorOnlyEntityComponent", "Id": 9880860858035405475 diff --git a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.scriptcanvas b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.scriptcanvas index 54bb46e379..72cc980550 100644 --- a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.scriptcanvas +++ b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.scriptcanvas @@ -5,7 +5,7 @@ "ClassData": { "m_scriptCanvas": { "Id": { - "id": 49433505360565 + "id": 8702689999760 }, "Name": "AutoComponent_RPC", "Components": { @@ -43,7 +43,7 @@ "m_nodes": [ { "Id": { - "id": 49442095295157 + "id": 8706984967056 }, "Name": "SC-EventNode(AuthorityToAutonomous_PlayerNumber Notify Event)", "Components": { @@ -66,7 +66,7 @@ { "$type": "RestrictedNodeContract", "m_nodeId": { - "id": 49472160066229 + "id": 8719869868944 } } ], @@ -176,7 +176,7 @@ { "$type": "RestrictedNodeContract", "m_nodeId": { - "id": 49472160066229 + "id": 8719869868944 } } ], @@ -201,6 +201,366 @@ "m_azEventEntry": { "m_eventName": "AuthorityToAutonomous_PlayerNumber Notify Event", "m_parameterSlotIds": [ + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, { "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" }, @@ -227,6 +587,366 @@ } ], "m_parameterNames": [ + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, { "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" }, @@ -261,7 +981,7 @@ }, { "Id": { - "id": 49467865098933 + "id": 8724164836240 }, "Name": "SC-Node(IsNetEntityRoleAuthority)", "Components": { @@ -365,7 +1085,7 @@ }, { "Id": { - "id": 49446390262453 + "id": 8737049738128 }, "Name": "SC-Node(Print)", "Components": { @@ -445,6 +1165,7 @@ } ], "m_format": "AutoComponent_RPC: Sending client PlayerNumber {Value}\n", + "m_numericPrecision": 0, "m_arrayBindingMap": [ { "Key": 1, @@ -468,7 +1189,7 @@ }, { "Id": { - "id": 49472160066229 + "id": 8719869868944 }, "Name": "SC-Node(GetAuthorityToAutonomous_PlayerNumberEventByEntityId)", "Components": { @@ -573,7 +1294,7 @@ }, { "Id": { - "id": 49476455033525 + "id": 8711279934352 }, "Name": "SendScriptEvent", "Components": { @@ -635,7 +1356,7 @@ }, { "Id": { - "id": 49437800327861 + "id": 8749934640016 }, "Name": "SendScriptEvent", "Components": { @@ -725,7 +1446,7 @@ }, { "Id": { - "id": 49454980197045 + "id": 8732754770832 }, "Name": "SC-Node(Print)", "Components": { @@ -801,6 +1522,7 @@ } ], "m_format": "AutoComponent_RPC: I'm Player #{Value}\n", + "m_numericPrecision": 0, "m_arrayBindingMap": [ { "Key": 1, @@ -824,7 +1546,7 @@ }, { "Id": { - "id": 49459275164341 + "id": 8715574901648 }, "Name": "SC-Node(TimeDelayNodeableNode)", "Components": { @@ -963,7 +1685,7 @@ }, { "Id": { - "id": 49480750000821 + "id": 8741344705424 }, "Name": "SC-Node(AuthorityToAutonomous_PlayerNumberByEntityId)", "Components": { @@ -1081,7 +1803,7 @@ }, { "Id": { - "id": 49450685229749 + "id": 8745639672720 }, "Name": "SC-Node(Start)", "Components": { @@ -1111,7 +1833,7 @@ }, { "Id": { - "id": 49463570131637 + "id": 8728459803536 }, "Name": "SC-Node(Gate)", "Components": { @@ -1203,7 +1925,7 @@ "m_connections": [ { "Id": { - "id": 49485044968117 + "id": 8754229607312 }, "Name": "srcEndpoint=(IsNetEntityRoleAuthority: Out), destEndpoint=(If: In)", "Components": { @@ -1212,7 +1934,7 @@ "Id": 3645153988172561571, "sourceEndpoint": { "nodeId": { - "id": 49467865098933 + "id": 8724164836240 }, "slotId": { "m_id": "{1071F455-D5A0-4C7A-AF91-648A0F197885}" @@ -1220,7 +1942,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 49463570131637 + "id": 8728459803536 }, "slotId": { "m_id": "{8AE7F430-C4A9-444E-B42A-BDDFE96C387A}" @@ -1231,7 +1953,7 @@ }, { "Id": { - "id": 49489339935413 + "id": 8758524574608 }, "Name": "srcEndpoint=(IsNetEntityRoleAuthority: Is Role Authority), destEndpoint=(If: Condition)", "Components": { @@ -1240,7 +1962,7 @@ "Id": 17942926291787646743, "sourceEndpoint": { "nodeId": { - "id": 49467865098933 + "id": 8724164836240 }, "slotId": { "m_id": "{BA87B4ED-9A52-4A0D-8920-CD0ED4E839EA}" @@ -1248,7 +1970,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 49463570131637 + "id": 8728459803536 }, "slotId": { "m_id": "{3E89B67B-1EF2-4DAB-8028-59A97527F3DF}" @@ -1259,7 +1981,7 @@ }, { "Id": { - "id": 49493634902709 + "id": 8762819541904 }, "Name": "srcEndpoint=(If: True), destEndpoint=(Send Script Event: In)", "Components": { @@ -1268,7 +1990,7 @@ "Id": 3298020356088639785, "sourceEndpoint": { "nodeId": { - "id": 49463570131637 + "id": 8728459803536 }, "slotId": { "m_id": "{78C92586-C0E1-449F-8EB2-B1CE3BFC8AE7}" @@ -1276,7 +1998,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 49476455033525 + "id": 8711279934352 }, "slotId": { "m_id": "{2FF1A0A1-59C6-4DCF-AE1D-296BD5964D4E}" @@ -1287,7 +2009,7 @@ }, { "Id": { - "id": 49497929870005 + "id": 8767114509200 }, "Name": "srcEndpoint=(Send Script Event: Out), destEndpoint=(Send Script Event: In)", "Components": { @@ -1296,7 +2018,7 @@ "Id": 5482500452520221078, "sourceEndpoint": { "nodeId": { - "id": 49476455033525 + "id": 8711279934352 }, "slotId": { "m_id": "{F2955681-A901-432D-99A3-53818F46CDE7}" @@ -1304,7 +2026,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 49437800327861 + "id": 8749934640016 }, "slotId": { "m_id": "{23DBACD8-7784-4E18-A51C-258B25DF4C19}" @@ -1315,7 +2037,7 @@ }, { "Id": { - "id": 49502224837301 + "id": 8771409476496 }, "Name": "srcEndpoint=(Send Script Event: Out), destEndpoint=(AuthorityToAutonomous_PlayerNumberByEntityId: In)", "Components": { @@ -1324,7 +2046,7 @@ "Id": 16156808606878296902, "sourceEndpoint": { "nodeId": { - "id": 49437800327861 + "id": 8749934640016 }, "slotId": { "m_id": "{19C850D7-7F1E-4D41-AFD9-5A4FA03D54F0}" @@ -1332,7 +2054,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 49480750000821 + "id": 8741344705424 }, "slotId": { "m_id": "{1FDB4A9A-D46A-49E8-B734-475230EB7C06}" @@ -1343,7 +2065,7 @@ }, { "Id": { - "id": 49506519804597 + "id": 8775704443792 }, "Name": "srcEndpoint=(AuthorityToAutonomous_PlayerNumberByEntityId: Out), destEndpoint=(Print: In)", "Components": { @@ -1352,7 +2074,7 @@ "Id": 17367899649716276273, "sourceEndpoint": { "nodeId": { - "id": 49480750000821 + "id": 8741344705424 }, "slotId": { "m_id": "{964EAD23-8DF5-47A9-BF07-1E5C7CD0CC6C}" @@ -1360,7 +2082,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 49446390262453 + "id": 8737049738128 }, "slotId": { "m_id": "{F3ED8C08-D751-492A-A39A-7B7734727A5A}" @@ -1371,7 +2093,7 @@ }, { "Id": { - "id": 49510814771893 + "id": 8779999411088 }, "Name": "srcEndpoint=(On Graph Start: Out), destEndpoint=(TimeDelay: Start)", "Components": { @@ -1380,7 +2102,7 @@ "Id": 13463448697016307967, "sourceEndpoint": { "nodeId": { - "id": 49450685229749 + "id": 8745639672720 }, "slotId": { "m_id": "{A8EA9EF2-A3A6-46B5-8D43-08EF6B6B5B32}" @@ -1388,7 +2110,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 49459275164341 + "id": 8715574901648 }, "slotId": { "m_id": "{D2337DC6-F126-4254-B296-2DE6BA03993F}" @@ -1399,7 +2121,7 @@ }, { "Id": { - "id": 49515109739189 + "id": 8784294378384 }, "Name": "srcEndpoint=(GetAuthorityToAutonomous_PlayerNumberEventByEntityId: Event), destEndpoint=(AuthorityToAutonomous_PlayerNumber Notify Event: AuthorityToAutonomous_PlayerNumber Notify Event)", "Components": { @@ -1408,7 +2130,7 @@ "Id": 9477060643694737434, "sourceEndpoint": { "nodeId": { - "id": 49472160066229 + "id": 8719869868944 }, "slotId": { "m_id": "{7262E6CD-BADF-4DD0-8FCE-3A02C3F31CC8}" @@ -1416,7 +2138,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 49442095295157 + "id": 8706984967056 }, "slotId": { "m_id": "{8C7E88EA-8FEE-45D0-9A2E-78BC4A18F508}" @@ -1427,7 +2149,7 @@ }, { "Id": { - "id": 49519404706485 + "id": 8788589345680 }, "Name": "srcEndpoint=(GetAuthorityToAutonomous_PlayerNumberEventByEntityId: Out), destEndpoint=(AuthorityToAutonomous_PlayerNumber Notify Event: Connect)", "Components": { @@ -1436,7 +2158,7 @@ "Id": 16543380658701699472, "sourceEndpoint": { "nodeId": { - "id": 49472160066229 + "id": 8719869868944 }, "slotId": { "m_id": "{1A6BCB27-F99F-4B6B-89CC-F2BE2A698331}" @@ -1444,7 +2166,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 49442095295157 + "id": 8706984967056 }, "slotId": { "m_id": "{46E6B649-CAA4-4318-960D-5E4854E21BB2}" @@ -1455,7 +2177,7 @@ }, { "Id": { - "id": 49523699673781 + "id": 8792884312976 }, "Name": "srcEndpoint=(AuthorityToAutonomous_PlayerNumber Notify Event: player_number), destEndpoint=(Print: Value)", "Components": { @@ -1464,7 +2186,7 @@ "Id": 864863482692400383, "sourceEndpoint": { "nodeId": { - "id": 49442095295157 + "id": 8706984967056 }, "slotId": { "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" @@ -1472,7 +2194,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 49454980197045 + "id": 8732754770832 }, "slotId": { "m_id": "{BA146872-FBFF-4662-A569-8F1B4C8774AC}" @@ -1483,7 +2205,7 @@ }, { "Id": { - "id": 49527994641077 + "id": 8797179280272 }, "Name": "srcEndpoint=(AuthorityToAutonomous_PlayerNumber Notify Event: OnEvent), destEndpoint=(Print: In)", "Components": { @@ -1492,7 +2214,7 @@ "Id": 2451057837093425972, "sourceEndpoint": { "nodeId": { - "id": 49442095295157 + "id": 8706984967056 }, "slotId": { "m_id": "{586BE222-2DEA-4E08-968F-07CA4EB96C54}" @@ -1500,7 +2222,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 49454980197045 + "id": 8732754770832 }, "slotId": { "m_id": "{D206E5BC-3746-4A18-80C7-DBD335FD05FE}" @@ -1511,7 +2233,7 @@ }, { "Id": { - "id": 49532289608373 + "id": 8801474247568 }, "Name": "srcEndpoint=(On Graph Start: Out), destEndpoint=(GetAuthorityToAutonomous_PlayerNumberEventByEntityId: In)", "Components": { @@ -1520,7 +2242,7 @@ "Id": 12180981889720748145, "sourceEndpoint": { "nodeId": { - "id": 49450685229749 + "id": 8745639672720 }, "slotId": { "m_id": "{A8EA9EF2-A3A6-46B5-8D43-08EF6B6B5B32}" @@ -1528,7 +2250,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 49472160066229 + "id": 8719869868944 }, "slotId": { "m_id": "{211BD78B-E01E-44F8-B44E-2FD988047BE9}" @@ -1539,7 +2261,7 @@ }, { "Id": { - "id": 49536584575669 + "id": 8805769214864 }, "Name": "srcEndpoint=(TimeDelay: Done), destEndpoint=(IsNetEntityRoleAuthority: In)", "Components": { @@ -1548,7 +2270,7 @@ "Id": 5772191552099194657, "sourceEndpoint": { "nodeId": { - "id": 49459275164341 + "id": 8715574901648 }, "slotId": { "m_id": "{25568B15-5372-4C2D-8280-2B433251EACA}" @@ -1556,7 +2278,7 @@ }, "targetEndpoint": { "nodeId": { - "id": 49467865098933 + "id": 8724164836240 }, "slotId": { "m_id": "{B6C4BE5E-CDE4-4EC7-98D0-A019CD80041C}" @@ -1569,13 +2291,13 @@ "m_scriptEventAssets": [ [ { - "id": 49437800327861 + "id": 8749934640016 }, {} ], [ { - "id": 49476455033525 + "id": 8711279934352 }, {} ] @@ -1591,16 +2313,16 @@ "GraphCanvasData": [ { "Key": { - "id": 49433505360565 + "id": 8702689999760 }, "Value": { "ComponentData": { "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { "$type": "SceneComponentSaveData", "ViewParams": { - "Scale": 0.8220159356944325, - "AnchorX": 72.99128723144531, - "AnchorY": 74.20780944824219 + "Scale": 0.9240486637125038, + "AnchorX": 1429.578369140625, + "AnchorY": -71.42481231689453 } } } @@ -1608,7 +2330,7 @@ }, { "Key": { - "id": 49437800327861 + "id": 8706984967056 }, "Value": { "ComponentData": { @@ -1617,29 +2339,29 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "MethodNodeTitlePalette" + "PaletteOverride": "HandlerNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 1540.0, - 260.0 + 820.0, + 620.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { "$type": "StylingComponentSaveData", - "SubStyle": ".method" + "SubStyle": ".azeventhandler" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{FD844BFD-72DA-44BA-B92A-AFDB58263B91}" + "PersistentId": "{F112D217-FAC8-4577-B67A-DFDF47842F7D}" } } } }, { "Key": { - "id": 49442095295157 + "id": 8711279934352 }, "Value": { "ComponentData": { @@ -1648,29 +2370,29 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "HandlerNodeTitlePalette" + "PaletteOverride": "MethodNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 820.0, - 620.0 + 1240.0, + 260.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { "$type": "StylingComponentSaveData", - "SubStyle": ".azeventhandler" + "SubStyle": ".method" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{F112D217-FAC8-4577-B67A-DFDF47842F7D}" + "PersistentId": "{13BD3C1C-EDBB-419E-8465-495935414A1A}" } } } }, { "Key": { - "id": 49446390262453 + "id": 8715574901648 }, "Value": { "ComponentData": { @@ -1679,12 +2401,12 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "StringNodeTitlePalette" + "PaletteOverride": "TimeNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 2280.0, + 200.0, 260.0 ] }, @@ -1693,14 +2415,14 @@ }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{B91C0E41-E6B5-46DE-885F-6BC6CFB2E813}" + "PersistentId": "{5DF902FE-B0C4-4563-B2BA-17996B24E211}" } } } }, { "Key": { - "id": 49450685229749 + "id": 8719869868944 }, "Value": { "ComponentData": { @@ -1709,28 +2431,29 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "TimeNodeTitlePalette" + "PaletteOverride": "MethodNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 40.0, - 280.0 + 380.0, + 620.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData" + "$type": "StylingComponentSaveData", + "SubStyle": ".method" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{B4CB62D9-9965-42E2-81FF-BDADDBD14CBE}" + "PersistentId": "{BBBE60FC-0215-4A5A-BEBE-4FC869E5EECE}" } } } }, { "Key": { - "id": 49454980197045 + "id": 8724164836240 }, "Value": { "ComponentData": { @@ -1739,28 +2462,29 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "StringNodeTitlePalette" + "PaletteOverride": "MethodNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 1400.0, - 620.0 + 500.0, + 260.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData" + "$type": "StylingComponentSaveData", + "SubStyle": ".method" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{74ED5AE1-A269-46D4-B968-FEDF513C9CF1}" + "PersistentId": "{348E780E-3A4E-47C7-ACF5-C7B2CB387517}" } } } }, { "Key": { - "id": 49459275164341 + "id": 8728459803536 }, "Value": { "ComponentData": { @@ -1769,12 +2493,12 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "TimeNodeTitlePalette" + "PaletteOverride": "LogicNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 200.0, + 940.0, 260.0 ] }, @@ -1783,14 +2507,14 @@ }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{5DF902FE-B0C4-4563-B2BA-17996B24E211}" + "PersistentId": "{53C8DAF1-FFF3-4AF8-A7FB-BC0B4E492B37}" } } } }, { "Key": { - "id": 49463570131637 + "id": 8732754770832 }, "Value": { "ComponentData": { @@ -1799,13 +2523,13 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "LogicNodeTitlePalette" + "PaletteOverride": "StringNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 940.0, - 260.0 + 1440.0, + 620.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { @@ -1813,14 +2537,14 @@ }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{53C8DAF1-FFF3-4AF8-A7FB-BC0B4E492B37}" + "PersistentId": "{74ED5AE1-A269-46D4-B968-FEDF513C9CF1}" } } } }, { "Key": { - "id": 49467865098933 + "id": 8737049738128 }, "Value": { "ComponentData": { @@ -1829,29 +2553,28 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "MethodNodeTitlePalette" + "PaletteOverride": "StringNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 500.0, + 2280.0, 260.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData", - "SubStyle": ".method" + "$type": "StylingComponentSaveData" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{348E780E-3A4E-47C7-ACF5-C7B2CB387517}" + "PersistentId": "{B91C0E41-E6B5-46DE-885F-6BC6CFB2E813}" } } } }, { "Key": { - "id": 49472160066229 + "id": 8741344705424 }, "Value": { "ComponentData": { @@ -1865,8 +2588,8 @@ "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 380.0, - 620.0 + 1840.0, + 260.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { @@ -1875,14 +2598,14 @@ }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{BBBE60FC-0215-4A5A-BEBE-4FC869E5EECE}" + "PersistentId": "{59FFF3C1-2D7B-47EA-AE35-ED15DCB95CC8}" } } } }, { "Key": { - "id": 49476455033525 + "id": 8745639672720 }, "Value": { "ComponentData": { @@ -1891,29 +2614,28 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "MethodNodeTitlePalette" + "PaletteOverride": "TimeNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 1240.0, - 260.0 + 40.0, + 280.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData", - "SubStyle": ".method" + "$type": "StylingComponentSaveData" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{13BD3C1C-EDBB-419E-8465-495935414A1A}" + "PersistentId": "{B4CB62D9-9965-42E2-81FF-BDADDBD14CBE}" } } } }, { "Key": { - "id": 49480750000821 + "id": 8749934640016 }, "Value": { "ComponentData": { @@ -1927,7 +2649,7 @@ "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 1840.0, + 1540.0, 260.0 ] }, @@ -1937,7 +2659,7 @@ }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{59FFF3C1-2D7B-47EA-AE35-ED15DCB95CC8}" + "PersistentId": "{FD844BFD-72DA-44BA-B92A-AFDB58263B91}" } } } From f96a466212c1acc526e2a1e41e6849fe854e3a1d Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 7 Dec 2021 17:58:49 -0800 Subject: [PATCH 019/948] WIP trying to use SystemAllocator instead of raw reads Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzCore/AzCore/Memory/AllocatorBase.cpp | 189 ++++++++++++------ Code/Framework/AzCore/CMakeLists.txt | 5 + .../Memory/AllocatorBenchmarkRecordings.bin | 3 + .../Tests/Memory/AllocatorBenchmarks.cpp | 141 ++++--------- 4 files changed, 177 insertions(+), 161 deletions(-) create mode 100644 Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarkRecordings.bin diff --git a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp index 7bba1b1d20..32ccd43f9a 100644 --- a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp @@ -11,47 +11,142 @@ using namespace AZ; -#define RECORDING_ENABLED 0 +#define RECORDING_ENABLED 1 #if RECORDING_ENABLED -struct AllocatorOperation +#include +#include +#include +#include + +namespace { - enum OperationType : unsigned int + class DebugAllocator { - ALLOCATE, - DEALLOCATE, - REALLOCATE, - RESIZE + public: + typedef void* pointer_type; + typedef AZStd::size_t size_type; + typedef AZStd::ptrdiff_t difference_type; + typedef AZStd::false_type allow_memory_leaks; ///< Regular allocators should not leak. + + AZ_FORCE_INLINE pointer_type allocate(size_t byteSize, size_t alignment, int = 0) + { + return AZ_OS_MALLOC(byteSize, alignment); + } + AZ_FORCE_INLINE size_type resize(pointer_type, size_type) + { + return 0; + } + AZ_FORCE_INLINE void deallocate(pointer_type ptr, size_type, size_type) + { + AZ_OS_FREE(ptr); + } }; - OperationType m_operationType : 2; - size_t m_size : 46; - size_t m_alignment : 16; - void* m_ptr; - void* m_newptr; // required for resize -}; -static constexpr size_t s_allocationOperationCount = 5 * 1024; -static AZStd::array s_operations = {}; -static uint64_t s_operationCounter = 0; -static AZStd::mutex s_operationsMutex; - -AllocatorOperation& GetNextAllocatorOperation() -{ - AZStd::scoped_lock lock(s_operationsMutex); - if (s_operationCounter == s_allocationOperationCount) + + struct AllocatorOperation + { + enum OperationType : unsigned int + { + ALLOCATE, + DEALLOCATE + }; + OperationType m_type: 1; + unsigned int m_size : 28; // Can represent up to 256Mb requests + unsigned int m_alignment : 7; // Can represent up to 128 alignment + unsigned int m_recordId : 28; // Can represent up to 256M simultaneous requests, we reuse ids + }; + static AZStd::mutex s_operationsMutex = {}; + + static constexpr size_t s_maxNumberOfAllocationsToRecord = 16384; + static size_t s_numberOfAllocationsRecorded = 0; + static constexpr size_t s_allocationOperationCount = 5 * 1024; + static AZStd::array s_operations = {}; + static uint64_t s_operationCounter = 0; + + static unsigned int s_nextRecordId = 1; + using AllocatorOperationByAddress = AZStd::map, DebugAllocator>; + static AllocatorOperationByAddress s_allocatorOperationByAddress; + using AvailableRecordIds = AZStd::vector; + AvailableRecordIds s_availableRecordIds; + + void RecordAllocatorOperation(AllocatorOperation::OperationType type, void* ptr, size_t size = 0, size_t alignment = 0) { - FILE* file = nullptr; - fopen_s(&file, "memoryrecordings.bin", "ab"); - if (file) + AZStd::scoped_lock lock(s_operationsMutex); + if (s_operationCounter == s_allocationOperationCount) + { + AZ::IO::SystemFile file; + file.Open("memoryrecordings.bin", AZ::IO::SystemFile::OpenMode::SF_OPEN_APPEND); + if (file.IsOpen()) + { + file.Write(&s_operations, sizeof(AllocatorOperation) * s_allocationOperationCount); + file.Close(); + } + s_operationCounter = 0; + } + AllocatorOperation& operation = s_operations[s_operationCounter++]; + operation.m_type = type; + if (type == AllocatorOperation::OperationType::ALLOCATE) + { + if (s_numberOfAllocationsRecorded > s_maxNumberOfAllocationsToRecord) + { + // reached limit of allocations, dont record anymore + --s_operationCounter; + return; + } + ++s_numberOfAllocationsRecorded; + operation.m_size = size; + operation.m_alignment = alignment; + unsigned int recordId = 0; + if (!s_availableRecordIds.empty()) + { + recordId = s_availableRecordIds.back(); + s_availableRecordIds.pop_back(); + } + else + { + recordId = s_nextRecordId; + ++s_nextRecordId; + } + operation.m_recordId = recordId; + auto it = s_allocatorOperationByAddress.emplace(ptr, operation); + if (!it.second) + { + // double alloc or resize, leave the current record and return the id + operation = it.first->second; + s_availableRecordIds.emplace_back(recordId); + } + } + else { - fwrite(&s_operations, sizeof(AllocatorOperation), s_allocationOperationCount, file); - fclose(file); + if (ptr == nullptr) + { + // common scenario, just record the operation + operation.m_size = 0; + operation.m_alignment = 0; + operation.m_recordId = 0; // recordId = 0 will flag this case + } + else + { + auto it = s_allocatorOperationByAddress.find(ptr); + if (it != s_allocatorOperationByAddress.end()) + { + operation.m_size = it->second.m_size; + operation.m_alignment = it->second.m_alignment; + operation.m_recordId = it->second.m_recordId; + s_availableRecordIds.push_back(it->second.m_recordId); + s_allocatorOperationByAddress.erase(it); + } + else + { + // just dont record this operation + --s_operationCounter; + } + } } - s_operationCounter = 0; + } - return s_operations[s_operationCounter++]; } - #endif AllocatorBase::AllocatorBase(IAllocatorAllocate* allocationSource, const char* name, const char* desc) : @@ -188,13 +283,7 @@ void AllocatorBase::ProfileAllocation(void* ptr, size_t byteSize, size_t alignme } #if RECORDING_ENABLED - { - AllocatorOperation& op = GetNextAllocatorOperation(); - op.m_operationType = AllocatorOperation::ALLOCATE; - op.m_size = byteSize; - op.m_alignment = alignment; - op.m_ptr = ptr; - } + RecordAllocatorOperation(AllocatorOperation::ALLOCATE, ptr, byteSize, alignment); #endif } @@ -209,13 +298,7 @@ void AllocatorBase::ProfileDeallocation(void* ptr, size_t byteSize, size_t align } } #if RECORDING_ENABLED - { - AllocatorOperation& op = GetNextAllocatorOperation(); - op.m_operationType = AllocatorOperation::DEALLOCATE; - op.m_size = byteSize; - op.m_alignment = alignment; - op.m_ptr = ptr; - } + RecordAllocatorOperation(AllocatorOperation::DEALLOCATE, ptr, byteSize, alignment); #endif } @@ -232,14 +315,8 @@ void AllocatorBase::ProfileReallocationEnd(void* ptr, void* newPtr, size_t newSi ProfileAllocation(newPtr, newSize, newAlignment, info.m_name, info.m_fileName, info.m_lineNum, 0); } #if RECORDING_ENABLED - { - AllocatorOperation& op = GetNextAllocatorOperation(); - op.m_operationType = AllocatorOperation::REALLOCATE; - op.m_size = newSize; - op.m_alignment = newAlignment; - op.m_ptr = ptr; - op.m_newptr = newPtr; - } + RecordAllocatorOperation(AllocatorOperation::DEALLOCATE, ptr); + RecordAllocatorOperation(AllocatorOperation::ALLOCATE, newPtr, newSize, newAlignment); #endif } @@ -259,13 +336,7 @@ void AllocatorBase::ProfileResize(void* ptr, size_t newSize) } } #if RECORDING_ENABLED - { - AllocatorOperation& op = GetNextAllocatorOperation(); - op.m_operationType = AllocatorOperation::RESIZE; - op.m_size = newSize; - op.m_alignment = 0; - op.m_ptr = ptr; - } + RecordAllocatorOperation(AllocatorOperation::ALLOCATE, ptr, newSize); #endif } diff --git a/Code/Framework/AzCore/CMakeLists.txt b/Code/Framework/AzCore/CMakeLists.txt index 96ed838ccc..838142f0df 100644 --- a/Code/Framework/AzCore/CMakeLists.txt +++ b/Code/Framework/AzCore/CMakeLists.txt @@ -146,6 +146,11 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) PROPERTY COMPILE_DEFINITIONS VALUES AZCORETEST_DLL_NAME=\"$\" ) + ly_add_target_files( + TARGETS AzCore.Tests + FILES ${CMAKE_CURRENT_SOURCE_DIR}/Tests/Memory/AllocatorBenchmarkRecordings.bin + OUTPUT_SUBDIRECTORY Tests/AzCore/Memory + ) endif() diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarkRecordings.bin b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarkRecordings.bin new file mode 100644 index 0000000000..2b587a2304 --- /dev/null +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarkRecordings.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d0f148441ce120b303896618cec364b5afb6f8b911b4785ec6358cfe8467cf7a +size 368640 diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp index 76c3316009..f5a728018c 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -9,9 +9,8 @@ #if defined(HAVE_BENCHMARK) #include +#include #include -#include -#include #include #include #include @@ -21,6 +20,7 @@ #include #include #include +#include #include @@ -32,11 +32,9 @@ namespace Benchmark size_t GetMemorySize(void* memory); } - //static AZ::Debug::DrillerManager* s_drillerManager = nullptr; - /// /// Test allocator wrapper that redirects the calls to the passed TAllocator by using AZ::AllocatorInstance. - /// It also creates/destroys the TAllocator type and connects the driller (to reflect what happens at runtime) + /// It also creates/destroys the TAllocator type (to reflect what happens at runtime) /// /// Allocator type to wrap template @@ -46,16 +44,10 @@ namespace Benchmark static void SetUp() { AZ::AllocatorInstance::Create(); - - /*s_drillerManager = AZ::Debug::DrillerManager::Create(); - s_drillerManager->Register(aznew AZ::Debug::MemoryDriller);*/ } static void TearDown() { - /*AZ::Debug::DrillerManager::Destroy(s_drillerManager); - s_drillerManager = nullptr;*/ - AZ::AllocatorInstance::Destroy(); } @@ -410,15 +402,12 @@ namespace Benchmark enum OperationType : unsigned int { ALLOCATE, - DEALLOCATE, - REALLOCATE, - RESIZE + DEALLOCATE }; - OperationType m_operationType : 2; - size_t m_size : 46; - size_t m_alignment : 16; - void* m_ptr; - void* m_newptr; // required for resize + OperationType m_type : 1; + unsigned int m_size : 28; // Can represent up to 256Mb requests + unsigned int m_alignment : 7; // Can represent up to 128 alignment + unsigned int m_recordId : 28; // Can represent up to 256M simultaneous requests, we reuse ids }; public: @@ -428,18 +417,18 @@ namespace Benchmark { state.PauseTiming(); - AZStd::unordered_map pointerRemapping; - AZStd::unordered_map allocationSize; + AZStd::unordered_map pointerRemapping; constexpr size_t allocationOperationCount = 5 * 1024; AZStd::array m_operations = {}; - FILE* file = nullptr; - fopen_s(&file, "memoryrecordings.bin", "rb"); - if (!file) + AZ::IO::SystemFile file; + AZ::IO::FixedMaxPathString filePath = AZ::Utils::GetExecutableDirectory(); + filePath += "/Tests/AzCore/Memory/AllocatorBenchmarkRecordings.bin"; + if (!file.Open(filePath.c_str(), AZ::IO::SystemFile::OpenMode::SF_OPEN_READ_ONLY)) { return; } - size_t elementsRead = fread(&m_operations, sizeof(AllocatorOperation), allocationOperationCount, file); + size_t elementsRead = file.Read(sizeof(AllocatorOperation) * allocationOperationCount, &m_operations); size_t totalElementsRead = elementsRead; const size_t processMemoryBaseline = Platform::GetProcessMemoryUsageBytes(); size_t totalAllocationSize = 0; @@ -449,107 +438,54 @@ namespace Benchmark for (size_t operationIndex = 0; operationIndex < elementsRead; ++operationIndex) { const AllocatorOperation& operation = m_operations[operationIndex]; - switch (operation.m_operationType) + if (operation.m_type == AllocatorOperation::ALLOCATE) { - case AllocatorOperation::ALLOCATE: - { - if (operation.m_ptr) + const auto it = pointerRemapping.emplace(operation.m_recordId, nullptr); + if (it.second) // otherwise already allocated { - const auto it = pointerRemapping.emplace(operation.m_ptr, nullptr); - if (it.second) // otherwise already allocated - { - state.ResumeTiming(); - void* ptr = TestAllocatorType::Allocate(operation.m_size, operation.m_alignment); - state.PauseTiming(); - totalAllocationSize += operation.m_size; - it.first->second = ptr; - allocationSize[ptr] = operation.m_size; - } - else - { - //AZ_Warning("RecordedAllocationBenchmarkFixture", false, "Allocation on %p was already made", operation.m_ptr); - } + state.ResumeTiming(); + void* ptr = TestAllocatorType::Allocate(operation.m_size, operation.m_alignment); + state.PauseTiming(); + totalAllocationSize += operation.m_size; + it.first->second = ptr; + } + else + { + // Doing a resize, dont account for this memory change, this operation is rare and we dont have + // the size of the previous allocation + state.ResumeTiming(); + TestAllocatorType::Resize(it.first->second, operation.m_size); + state.PauseTiming(); } - break; } - case AllocatorOperation::DEALLOCATE: + else // AllocatorOperation::DEALLOCATE: { - if (operation.m_ptr) // some deallocate(nullptr) are recorded + if (operation.m_recordId) { - const auto ptrIt = pointerRemapping.find(operation.m_ptr); + const auto ptrIt = pointerRemapping.find(operation.m_recordId); if (ptrIt != pointerRemapping.end()) { - totalAllocationSize -= allocationSize[ptrIt->second]; + totalAllocationSize -= operation.m_size; state.ResumeTiming(); TestAllocatorType::DeAllocate(ptrIt->second, /*operation.m_size*/ 0); // size is not correct after a resize, a 0 size deals with it state.PauseTiming(); pointerRemapping.erase(ptrIt); } } - else + else // deallocate(nullptr) are recorded { // Just to account of the call of deallocate(nullptr); - // totalAllocationSize -= 0; // No real deallocation happened state.ResumeTiming(); - TestAllocatorType::DeAllocate(operation.m_ptr, /*operation.m_size*/ 0); + TestAllocatorType::DeAllocate(nullptr, /*operation.m_size*/ 0); state.PauseTiming(); } - break; - } - case AllocatorOperation::REALLOCATE: - { - void* ptr = nullptr; - if (operation.m_ptr) - { - AZ_Assert(operation.m_newptr, "Need to consider other cases?"); - const auto ptrIt = pointerRemapping.find(operation.m_ptr); - AZ_Assert(ptrIt != pointerRemapping.end(), "Missing allocation for reallocation"); // In case the recording didnt catch something - ptr = ptrIt->second; - pointerRemapping.erase(ptrIt); - } - AZ_Assert(operation.m_newptr != nullptr, "Reallocation failed in the game"); - const auto it = pointerRemapping.emplace(operation.m_newptr, nullptr); - if (it.second) - { - totalAllocationSize -= allocationSize[ptr]; - state.ResumeTiming(); - void* newPtr = TestAllocatorType::ReAllocate(ptr, operation.m_size, operation.m_alignment); - state.PauseTiming(); - totalAllocationSize += operation.m_size; - it.first->second = newPtr; - allocationSize[newPtr] = operation.m_size; - } - else - { - totalAllocationSize -= allocationSize[ptr]; - state.ResumeTiming(); - TestAllocatorType::DeAllocate(ptr); - state.PauseTiming(); - } - break; - } - case AllocatorOperation::RESIZE: - { - const auto ptrIt = pointerRemapping.find(operation.m_ptr); - AZ_Assert(ptrIt != pointerRemapping.end(), "Missing allocation for resize"); // In case the recording didnt catch something - totalAllocationSize -= allocationSize[ptrIt->second]; - state.ResumeTiming(); - TestAllocatorType::Resize(ptrIt->second, operation.m_size); - state.PauseTiming(); - totalAllocationSize += operation.m_size; - if (operation.m_size == 0) - { - pointerRemapping.erase(ptrIt); - } - break; - } } } - elementsRead = fread(&m_operations, sizeof(AllocatorOperation), allocationOperationCount, file); + elementsRead = file.Read(sizeof(AllocatorOperation) * allocationOperationCount, &m_operations); totalElementsRead += elementsRead; } - fclose(file); + file.Close(); state.counters[s_counterAllocatorMemory] = benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); state.counters[s_counterProcessMemory] = benchmark::Counter(static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), benchmark::Counter::kDefaults); @@ -579,6 +515,7 @@ namespace Benchmark static void RecordedRunRanges(benchmark::internal::Benchmark* b) { b->Arg(1); + b->Iterations(100); } // For threaded ranges, run just 200, multi-threaded will already multiply by thread From 80a216e079dac034d958d32f0e221858947f9f87 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Wed, 8 Dec 2021 00:21:02 -0800 Subject: [PATCH 020/948] Adding RPC test. Update editor-servers to flush stdout Signed-off-by: Gene Walters --- .../Multiplayer/TestSuite_Sandbox.py | 3 + .../tests/Multiplayer_AutoComponent_RPC.py | 91 + ...oComponent_RPC_NetLevelEntity.scriptcanvas | 1702 +++++++++++++++++ .../Editor/MultiplayerEditorConnection.cpp | 4 +- .../Editor/MultiplayerEditorConnection.h | 1 + 5 files changed, 1800 insertions(+), 1 deletion(-) create mode 100644 AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py create mode 100644 AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC_NetLevelEntity.scriptcanvas diff --git a/AutomatedTesting/Gem/PythonTests/Multiplayer/TestSuite_Sandbox.py b/AutomatedTesting/Gem/PythonTests/Multiplayer/TestSuite_Sandbox.py index 8f50d4d36d..8c5f33993d 100644 --- a/AutomatedTesting/Gem/PythonTests/Multiplayer/TestSuite_Sandbox.py +++ b/AutomatedTesting/Gem/PythonTests/Multiplayer/TestSuite_Sandbox.py @@ -32,3 +32,6 @@ class TestAutomation(TestAutomationBase): from .tests import Multiplayer_AutoComponent_NetworkInput as test_module self._run_prefab_test(request, workspace, editor, test_module) + def test_Multiplayer_AutoComponent_RPC(self, request, workspace, editor, launcher_platform): + from .tests import Multiplayer_AutoComponent_RPC as test_module + self._run_prefab_test(request, workspace, editor, test_module) diff --git a/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py b/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py new file mode 100644 index 0000000000..3f971e4abf --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py @@ -0,0 +1,91 @@ +""" +Copyright (c) Contributors to the Open 3D Engine Project. +For complete copyright and license terms please see the LICENSE at the root of this distribution. + +SPDX-License-Identifier: Apache-2.0 OR MIT +""" + + +# Test Case Title : Check that the four network RPCs can be sent and received + + +# fmt: off +class Tests(): + enter_game_mode = ("Entered game mode", "Failed to enter game mode") + exit_game_mode = ("Exited game mode", "Couldn't exit game mode") + find_network_player = ("Found network player", "Couldn't find network player") + found_lines = ("Expected log lines were found", "Expected log lines were not found") + found_unexpected_lines = ("Unexpected log lines were not found", "Unexpected log lines were found") +# fmt: on + + +def Multiplayer_AutoComponent_RPC(): + r""" + Summary: + Runs a test to make sure that network input can be sent from the autonomous player, received by the authority, and processed + + Level Description: + - Dynamic + 1. Although the level is empty, when the server and editor connect the server will spawn and replicate the player network prefab. + a. The player network prefab has a NetworkTestPlayerComponent.AutoComponent and a script canvas attached which will listen for the CreateInput and ProcessInput events. + Print logs occur upon triggering the CreateInput and ProcessInput events along with their values; we are testing to make sure the expected events are values are recieved. + - Static + 1. This is an empty level. All the logic occurs on the Player.network.spawnable (see the above Dynamic description) + + + Expected Outcome: + We should see editor logs stating that network input has been created and processed. + However, if the script receives unexpected values for the Process event we will see print logs for bad data as well. + + :return: + """ + import azlmbr.legacy.general as general + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import Tracer + + from editor_python_test_tools.utils import TestHelper as helper + from ly_remote_console.remote_console_commands import RemoteConsole as RemoteConsole + + + # looks for an expected line in a list of tracers lines + # lines: the tracer list of lines to search. options are section_tracer.warnings, section_tracer.errors, section_tracer.asserts, section_tracer.prints + # return: true if the line is found, otherwise false + def find_expected_line(expected_line, lines): + found_lines = [printInfo.message.strip() for printInfo in lines] + return expected_line in found_lines + + def wait_for_critical_expected_line(expected_line, lines, time_out): + helper.wait_for_condition(lambda : find_expected_line(expected_line, lines), time_out) + Report.critical_result(("Found expected line: " + expected_line, "Failed to find expected line: " + expected_line), find_expected_line(expected_line, lines)) + + level_name = "AutoComponent_RPC" + player_prefab_name = "Player" + player_prefab_path = f"levels/multiplayer/{level_name}/{player_prefab_name}.network.spawnable" + + helper.init_idle() + + # 1) Open Level + helper.open_level("Multiplayer", level_name) + + with Tracer() as section_tracer: + # 2) Enter game mode + helper.multiplayer_enter_game_mode(Tests.enter_game_mode, player_prefab_path.lower()) + + # 3) Make sure the network player was spawned + player_id = general.find_game_entity(player_prefab_name) + Report.critical_result(Tests.find_network_player, player_id.IsValid()) + + # 4) Check the editor logs for expected and unexpected log output + EXPECTEDLINE_WAIT_TIME_SECONDS = 1.0 + wait_for_critical_expected_line('Script: AutoComponent_RPC: Sending client PlayerNumber 1', section_tracer.prints, EXPECTEDLINE_WAIT_TIME_SECONDS) + wait_for_critical_expected_line("AutoComponent_RPC: I'm Player #1", section_tracer.prints, EXPECTEDLINE_WAIT_TIME_SECONDS) + + + # Exit game mode + helper.exit_game_mode(Tests.exit_game_mode) + + + +if __name__ == "__main__": + from editor_python_test_tools.utils import Report + Report.start_test(Multiplayer_AutoComponent_RPC) diff --git a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC_NetLevelEntity.scriptcanvas b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC_NetLevelEntity.scriptcanvas new file mode 100644 index 0000000000..aa5244a7cd --- /dev/null +++ b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC_NetLevelEntity.scriptcanvas @@ -0,0 +1,1702 @@ +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "ScriptCanvasData", + "ClassData": { + "m_scriptCanvas": { + "Id": { + "id": 56982432064952 + }, + "Name": "AutoComponent_RPC_NetLevelEntity", + "Components": { + "Component_[2936040539888065977]": { + "$type": "{4D755CA9-AB92-462C-B24F-0B3376F19967} Graph", + "Id": 2936040539888065977, + "m_graphData": { + "m_nodes": [ + { + "Id": { + "id": 56986727032248 + }, + "Name": "SC-Node(RepeaterNodeableNode)", + "Components": { + "Component_[11069913642528675281]": { + "$type": "RepeaterNodeableNode", + "Id": 11069913642528675281, + "Slots": [ + { + "id": { + "m_id": "{07267CBA-B377-4B57-8A04-E322F8BFC07F}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Start", + "DisplayGroup": { + "Value": 2675529103 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{A9CCCCF4-BC3E-44B8-B2BB-2EEFBF475F82}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Repetitions", + "toolTip": "How many times to repeat.", + "DisplayGroup": { + "Value": 2675529103 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{E490B225-8A15-4CA1-9F25-6D8F9F8E398F}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Interval", + "toolTip": "The Interval between repetitions. If zero, all repititions execute immediately, before On Start", + "DisplayGroup": { + "Value": 2675529103 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{92077333-D7F5-4E54-80FD-0363876B5510}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "On Start", + "DisplayGroup": { + "Value": 2675529103 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{91CF89F3-906C-4860-B84E-9BD7D6842CA8}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Complete", + "toolTip": "Signaled upon node exit", + "DisplayGroup": { + "Value": 1114099747 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{C1CCBA7B-A13B-4FCE-99ED-8FD1A8F72869}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Action", + "toolTip": "Signaled every repetition", + "DisplayGroup": { + "Value": 1204587666 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 10.0, + "label": "Repetitions" + }, + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 1.0, + "label": "Interval" + } + ], + "nodeable": { + "m_timeUnits": 2 + }, + "slotExecutionMap": { + "ins": [ + { + "_slotId": { + "m_id": "{07267CBA-B377-4B57-8A04-E322F8BFC07F}" + }, + "_inputs": [ + { + "_slotId": { + "m_id": "{A9CCCCF4-BC3E-44B8-B2BB-2EEFBF475F82}" + } + }, + { + "_slotId": { + "m_id": "{E490B225-8A15-4CA1-9F25-6D8F9F8E398F}" + } + } + ], + "_outs": [ + { + "_slotId": { + "m_id": "{92077333-D7F5-4E54-80FD-0363876B5510}" + }, + "_name": "On Start", + "_interfaceSourceId": "{60330D5B-FB7F-0000-8039-14DD7C020000}" + } + ], + "_interfaceSourceId": "{E1D0AF7E-837B-0000-0033-BA267C020000}" + } + ], + "latents": [ + { + "_slotId": { + "m_id": "{91CF89F3-906C-4860-B84E-9BD7D6842CA8}" + }, + "_name": "Complete", + "_interfaceSourceId": "{E1D0AF7E-837B-0000-0033-BA267C020000}" + }, + { + "_slotId": { + "m_id": "{C1CCBA7B-A13B-4FCE-99ED-8FD1A8F72869}" + }, + "_name": "Action", + "_interfaceSourceId": "{E1D0AF7E-837B-0000-0033-BA267C020000}" + } + ] + } + } + } + }, + { + "Id": { + "id": 57021086770616 + }, + "Name": "SC-Node(GetAuthorityToClientNoParams_PlaySomeSuperficialFxEventByEntityId)", + "Components": { + "Component_[1410603071340071190]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 1410603071340071190, + "Slots": [ + { + "id": { + "m_id": "{406DA66F-95FA-406B-8A5B-F2C5E292EC21}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "EntityId: 0", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{5CDED810-9455-424A-9A1D-40B9366D1F94}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{2FC162C0-D717-4053-9842-39DAD3E8EA86}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{C18E637D-BFD1-42C8-A30D-C2B52D157142}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Event<>", + "DisplayDataType": { + "m_type": 4, + "m_azType": "{F429F985-AF00-529B-8449-16E56694E5F9}" + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 1 + }, + "isNullPointer": false, + "$type": "EntityId", + "value": { + "id": 2901262558 + }, + "label": "EntityId: 0" + } + ], + "methodType": 2, + "methodName": "GetAuthorityToClientNoParams_PlaySomeSuperficialFxEventByEntityId", + "className": "NetworkTestPlayerComponent", + "resultSlotIDs": [ + {} + ], + "inputSlots": [ + { + "m_id": "{406DA66F-95FA-406B-8A5B-F2C5E292EC21}" + } + ], + "prettyClassName": "NetworkTestPlayerComponent" + } + } + }, + { + "Id": { + "id": 57003906901432 + }, + "Name": "SC-Node(DrawTextOnEntity)", + "Components": { + "Component_[14125366736968050670]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 14125366736968050670, + "Slots": [ + { + "id": { + "m_id": "{6BD7BF07-D1B6-4CC2-A861-C4334AA3A025}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "EntityId: 0", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{AB0304C4-CD52-4351-A009-CD959CDA6E2B}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "String: 1", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{EB877F87-C03A-4692-ABBB-2317E98E8C6F}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Color: 2", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{E2D11762-F47C-4341-806A-DBB4FBAEC235}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Number: 3", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{1673B8A0-D4EC-4CC7-8F80-0419BB5560EB}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{5F720C70-EA4F-4883-B5BE-4278E75370E8}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 1 + }, + "isNullPointer": false, + "$type": "EntityId", + "value": { + "id": 2901262558 + }, + "label": "Entity Id" + }, + { + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "AutoComponent_RPC_NetLevelEntity: I'm a client playing some superficial fx", + "label": "Color" + }, + { + "scriptCanvasType": { + "m_type": 12 + }, + "isNullPointer": false, + "$type": "Color", + "value": [ + 1.0, + 0.0, + 0.0, + 1.0 + ], + "label": "Color: 2" + }, + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 2.0, + "label": "Number: 3" + } + ], + "methodType": 0, + "methodName": "DrawTextOnEntity", + "className": "DebugDrawRequestBus", + "resultSlotIDs": [ + {} + ], + "inputSlots": [ + { + "m_id": "{6BD7BF07-D1B6-4CC2-A861-C4334AA3A025}" + }, + { + "m_id": "{AB0304C4-CD52-4351-A009-CD959CDA6E2B}" + }, + { + "m_id": "{EB877F87-C03A-4692-ABBB-2317E98E8C6F}" + }, + { + "m_id": "{E2D11762-F47C-4341-806A-DBB4FBAEC235}" + } + ], + "prettyClassName": "DebugDrawRequestBus" + } + } + }, + { + "Id": { + "id": 56999611934136 + }, + "Name": "SC-Node(Print)", + "Components": { + "Component_[15472692142045278273]": { + "$type": "Print", + "Id": 15472692142045278273, + "Slots": [ + { + "id": { + "m_id": "{2F11CF04-DC4B-4881-8D74-AB0E51B4A278}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{6CE4DAB2-4D8E-461E-B9B2-34338EBBAD97}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "m_format": "AutoComponent_RPC_NetLevelEntity: Authority sending RPC to play some superficial fx.\n", + "m_unresolvedString": [ + "AutoComponent_RPC_NetLevelEntity: Authority sending RPC to play some superficial fx.\n" + ] + } + } + }, + { + "Id": { + "id": 56995316966840 + }, + "Name": "SC-Node(Print)", + "Components": { + "Component_[15717135232290736332]": { + "$type": "Print", + "Id": 15717135232290736332, + "Slots": [ + { + "id": { + "m_id": "{7CAD6E31-6218-4326-8FFB-0523F545E250}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{C38BB068-BF1B-4734-BFFA-10B258870349}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "m_format": "AutoComponent_RPC_NetLevelEntity: I'm a client playing some superficial fx.\n", + "m_unresolvedString": [ + "AutoComponent_RPC_NetLevelEntity: I'm a client playing some superficial fx.\n" + ] + } + } + }, + { + "Id": { + "id": 56991021999544 + }, + "Name": "SC-Node(Print)", + "Components": { + "Component_[15785913678997669879]": { + "$type": "Print", + "Id": 15785913678997669879, + "Slots": [ + { + "id": { + "m_id": "{8E1B9705-148A-42E4-831E-D7B2877358E3}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{E9B979F9-D682-4B58-8E88-6102387FE70B}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "m_format": "AutoComponent_RPC_NetLevelEntity Activated!\n", + "m_unresolvedString": [ + "AutoComponent_RPC_NetLevelEntity Activated!\n" + ] + } + } + }, + { + "Id": { + "id": 57016791803320 + }, + "Name": "SC-EventNode(AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event)", + "Components": { + "Component_[17598011665473695286]": { + "$type": "AzEventHandler", + "Id": 17598011665473695286, + "Slots": [ + { + "id": { + "m_id": "{6F8A1DAB-76A6-445F-B532-6B71CD5DB48F}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "ConnectionLimitContract", + "limit": 1 + }, + { + "$type": "RestrictedNodeContract", + "m_nodeId": { + "id": 57021086770616 + } + } + ], + "slotName": "Connect", + "toolTip": "Connect the AZ Event to this AZ Event Handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{D986DF89-49E8-4CFF-907E-7A46BC118208}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Disconnect", + "toolTip": "Disconnect current AZ Event from this AZ Event Handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{277D7B39-E1B0-4700-946B-FFA024EEDF89}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "On Connected", + "toolTip": "Signaled when a connection has taken place.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{7673B52D-3BEC-4BFF-B29A-D027400B16B1}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "On Disconnected", + "toolTip": "Signaled when this event handler is disconnected.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{A53312FA-7FAB-4C8C-A105-478C634ECD33}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnEvent", + "toolTip": "Triggered when the AZ Event invokes Signal() function.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{F5D0C2B0-F557-4D94-B747-6F3EF01AF54B}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "ConnectionLimitContract", + "limit": 1 + }, + { + "$type": "RestrictedNodeContract", + "m_nodeId": { + "id": 57021086770616 + } + } + ], + "slotName": "AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 4, + "m_azType": "{F429F985-AF00-529B-8449-16E56694E5F9}" + }, + "isNullPointer": true, + "label": "AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event" + } + ], + "m_azEventEntry": { + "m_eventName": "AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event", + "m_eventSlotId": { + "m_id": "{F5D0C2B0-F557-4D94-B747-6F3EF01AF54B}" + } + } + } + } + }, + { + "Id": { + "id": 57025381737912 + }, + "Name": "SC-Node(Start)", + "Components": { + "Component_[1888047318201703857]": { + "$type": "Start", + "Id": 1888047318201703857, + "Slots": [ + { + "id": { + "m_id": "{28664064-2483-465A-9BB1-4E1890048CDF}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "toolTip": "Signaled when the entity that owns this graph is fully activated.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ] + } + } + }, + { + "Id": { + "id": 57008201868728 + }, + "Name": "SC-Node(AuthorityToClientNoParams_PlaySomeSuperficialFxByEntityId)", + "Components": { + "Component_[5156950796673122600]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 5156950796673122600, + "Slots": [ + { + "id": { + "m_id": "{AF45BF64-D202-411F-9CE1-A7139ABC6E65}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Source", + "toolTip": "The Source containing the NetworkTestPlayerComponentController", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{A6449574-6CD4-4986-ABED-2E10136D1B2C}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{F8CE0394-770E-4F0D-B908-3E01D0E04AE1}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 1 + }, + "isNullPointer": false, + "$type": "EntityId", + "value": { + "id": 2901262558 + }, + "label": "Source" + } + ], + "methodType": 2, + "methodName": "AuthorityToClientNoParams_PlaySomeSuperficialFxByEntityId", + "className": "NetworkTestPlayerComponent", + "resultSlotIDs": [ + {} + ], + "inputSlots": [ + { + "m_id": "{AF45BF64-D202-411F-9CE1-A7139ABC6E65}" + } + ], + "prettyClassName": "NetworkTestPlayerComponent" + } + } + }, + { + "Id": { + "id": 57012496836024 + }, + "Name": "SC-Node(TimeDelayNodeableNode)", + "Components": { + "Component_[8951348653904382148]": { + "$type": "TimeDelayNodeableNode", + "Id": 8951348653904382148, + "Slots": [ + { + "id": { + "m_id": "{EA0DF0AE-2FF7-4670-8D99-7CF863038E68}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Start", + "DisplayGroup": { + "Value": 2675529103 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{9C6D8500-B49B-4407-B2EB-40B1CD4CE762}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Delay", + "toolTip": "The amount of time to delay before the Done is signalled.", + "DisplayGroup": { + "Value": 2675529103 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{FE2A3D2F-7AC2-431D-B80C-C363DB475919}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "On Start", + "DisplayGroup": { + "Value": 2675529103 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{158B30BE-BD39-40AE-A8A8-F0E5694F0180}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Done", + "toolTip": "Signaled after waiting for the specified amount of times.", + "DisplayGroup": { + "Value": 271442091 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 1.0, + "label": "Delay" + } + ], + "nodeable": { + "m_timeUnits": 2 + }, + "slotExecutionMap": { + "ins": [ + { + "_slotId": { + "m_id": "{EA0DF0AE-2FF7-4670-8D99-7CF863038E68}" + }, + "_inputs": [ + { + "_slotId": { + "m_id": "{9C6D8500-B49B-4407-B2EB-40B1CD4CE762}" + } + } + ], + "_outs": [ + { + "_slotId": { + "m_id": "{FE2A3D2F-7AC2-431D-B80C-C363DB475919}" + }, + "_name": "On Start", + "_interfaceSourceId": "{4C400000-7C02-0000-B86E-0FACE0000000}" + } + ], + "_interfaceSourceId": "{24000000-0000-0000-0000-F421FC7F0000}" + } + ], + "latents": [ + { + "_slotId": { + "m_id": "{158B30BE-BD39-40AE-A8A8-F0E5694F0180}" + }, + "_name": "Done", + "_interfaceSourceId": "{24000000-0000-0000-0000-F421FC7F0000}" + } + ] + } + } + } + } + ], + "m_connections": [ + { + "Id": { + "id": 57029676705208 + }, + "Name": "srcEndpoint=(On Graph Start: Out), destEndpoint=(TimeDelay: Start)", + "Components": { + "Component_[5204535376548158590]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 5204535376548158590, + "sourceEndpoint": { + "nodeId": { + "id": 57025381737912 + }, + "slotId": { + "m_id": "{28664064-2483-465A-9BB1-4E1890048CDF}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 57012496836024 + }, + "slotId": { + "m_id": "{EA0DF0AE-2FF7-4670-8D99-7CF863038E68}" + } + } + } + } + }, + { + "Id": { + "id": 57033971672504 + }, + "Name": "srcEndpoint=(GetAuthorityToClientNoParams_PlaySomeSuperficialFxEventByEntityId: Event<>), destEndpoint=(AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event: AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event)", + "Components": { + "Component_[9588403027578693736]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 9588403027578693736, + "sourceEndpoint": { + "nodeId": { + "id": 57021086770616 + }, + "slotId": { + "m_id": "{C18E637D-BFD1-42C8-A30D-C2B52D157142}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 57016791803320 + }, + "slotId": { + "m_id": "{F5D0C2B0-F557-4D94-B747-6F3EF01AF54B}" + } + } + } + } + }, + { + "Id": { + "id": 57038266639800 + }, + "Name": "srcEndpoint=(GetAuthorityToClientNoParams_PlaySomeSuperficialFxEventByEntityId: Out), destEndpoint=(AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event: Connect)", + "Components": { + "Component_[1452138089363094396]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 1452138089363094396, + "sourceEndpoint": { + "nodeId": { + "id": 57021086770616 + }, + "slotId": { + "m_id": "{2FC162C0-D717-4053-9842-39DAD3E8EA86}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 57016791803320 + }, + "slotId": { + "m_id": "{6F8A1DAB-76A6-445F-B532-6B71CD5DB48F}" + } + } + } + } + }, + { + "Id": { + "id": 57042561607096 + }, + "Name": "srcEndpoint=(On Graph Start: Out), destEndpoint=(GetAuthorityToClientNoParams_PlaySomeSuperficialFxEventByEntityId: In)", + "Components": { + "Component_[17563947682404363417]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 17563947682404363417, + "sourceEndpoint": { + "nodeId": { + "id": 57025381737912 + }, + "slotId": { + "m_id": "{28664064-2483-465A-9BB1-4E1890048CDF}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 57021086770616 + }, + "slotId": { + "m_id": "{5CDED810-9455-424A-9A1D-40B9366D1F94}" + } + } + } + } + }, + { + "Id": { + "id": 57046856574392 + }, + "Name": "srcEndpoint=(AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event: OnEvent), destEndpoint=(Print: In)", + "Components": { + "Component_[12226462283795741406]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 12226462283795741406, + "sourceEndpoint": { + "nodeId": { + "id": 57016791803320 + }, + "slotId": { + "m_id": "{A53312FA-7FAB-4C8C-A105-478C634ECD33}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 56995316966840 + }, + "slotId": { + "m_id": "{7CAD6E31-6218-4326-8FFB-0523F545E250}" + } + } + } + } + }, + { + "Id": { + "id": 57051151541688 + }, + "Name": "srcEndpoint=(AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event: OnEvent), destEndpoint=(DrawTextOnEntity: In)", + "Components": { + "Component_[7209285242155620531]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 7209285242155620531, + "sourceEndpoint": { + "nodeId": { + "id": 57016791803320 + }, + "slotId": { + "m_id": "{A53312FA-7FAB-4C8C-A105-478C634ECD33}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 57003906901432 + }, + "slotId": { + "m_id": "{1673B8A0-D4EC-4CC7-8F80-0419BB5560EB}" + } + } + } + } + }, + { + "Id": { + "id": 57055446508984 + }, + "Name": "srcEndpoint=(TimeDelay: Done), destEndpoint=(Repeater: Start)", + "Components": { + "Component_[6292481678297438578]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 6292481678297438578, + "sourceEndpoint": { + "nodeId": { + "id": 57012496836024 + }, + "slotId": { + "m_id": "{158B30BE-BD39-40AE-A8A8-F0E5694F0180}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 56986727032248 + }, + "slotId": { + "m_id": "{07267CBA-B377-4B57-8A04-E322F8BFC07F}" + } + } + } + } + }, + { + "Id": { + "id": 57059741476280 + }, + "Name": "srcEndpoint=(Repeater: Action), destEndpoint=(AuthorityToClientNoParams_PlaySomeSuperficialFxByEntityId: In)", + "Components": { + "Component_[8833903103579494596]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 8833903103579494596, + "sourceEndpoint": { + "nodeId": { + "id": 56986727032248 + }, + "slotId": { + "m_id": "{C1CCBA7B-A13B-4FCE-99ED-8FD1A8F72869}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 57008201868728 + }, + "slotId": { + "m_id": "{A6449574-6CD4-4986-ABED-2E10136D1B2C}" + } + } + } + } + }, + { + "Id": { + "id": 57064036443576 + }, + "Name": "srcEndpoint=(AuthorityToClientNoParams_PlaySomeSuperficialFxByEntityId: Out), destEndpoint=(Print: In)", + "Components": { + "Component_[8297971328953001309]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 8297971328953001309, + "sourceEndpoint": { + "nodeId": { + "id": 57008201868728 + }, + "slotId": { + "m_id": "{F8CE0394-770E-4F0D-B908-3E01D0E04AE1}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 56999611934136 + }, + "slotId": { + "m_id": "{2F11CF04-DC4B-4881-8D74-AB0E51B4A278}" + } + } + } + } + }, + { + "Id": { + "id": 57068331410872 + }, + "Name": "srcEndpoint=(On Graph Start: Out), destEndpoint=(Print: In)", + "Components": { + "Component_[11504712829988319988]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 11504712829988319988, + "sourceEndpoint": { + "nodeId": { + "id": 57025381737912 + }, + "slotId": { + "m_id": "{28664064-2483-465A-9BB1-4E1890048CDF}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 56991021999544 + }, + "slotId": { + "m_id": "{8E1B9705-148A-42E4-831E-D7B2877358E3}" + } + } + } + } + } + ] + }, + "m_assetType": "{3E2AC8CD-713F-453E-967F-29517F331784}", + "versionData": { + "_grammarVersion": 1, + "_runtimeVersion": 1, + "_fileVersion": 1 + }, + "GraphCanvasData": [ + { + "Key": { + "id": 56982432064952 + }, + "Value": { + "ComponentData": { + "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { + "$type": "SceneComponentSaveData", + "ViewParams": { + "Scale": 1.0440124999999998, + "AnchorX": 173.36956787109375, + "AnchorY": -153.25486755371094 + } + } + } + } + }, + { + "Key": { + "id": 56986727032248 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "DefaultNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 80.0, + -60.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{41B7477C-D5B9-49AC-AFA3-AAAE2A6ED7C5}" + } + } + } + }, + { + "Key": { + "id": 56991021999544 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "StringNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + -240.0, + -300.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{0CF0846C-1D21-4B33-8723-1538FD4FD04A}" + } + } + } + }, + { + "Key": { + "id": 56995316966840 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "StringNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 800.0, + 260.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{0D04EBA6-E1E7-4DF7-BAA9-CC87F4689CD2}" + } + } + } + }, + { + "Key": { + "id": 56999611934136 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "StringNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 960.0, + -40.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{A4FDCB87-B021-48B9-ABCB-AECA986B33D6}" + } + } + } + }, + { + "Key": { + "id": 57003906901432 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 800.0, + 460.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{82D0ED1B-98D3-4AEF-B1DA-2F27CACD3A4D}" + } + } + } + }, + { + "Key": { + "id": 57008201868728 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 380.0, + -40.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{FD25E23C-E976-4F9A-8C16-80B125D80485}" + } + } + } + }, + { + "Key": { + "id": 57012496836024 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "DefaultNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + -220.0, + -40.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{D3F081D7-40C1-4C31-B298-B18C6AFDFD25}" + } + } + } + }, + { + "Key": { + "id": 57016791803320 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "HandlerNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 220.0, + 260.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".azeventhandler" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{58CEEB80-152A-4B8E-8698-8B8EE5F31A41}" + } + } + } + }, + { + "Key": { + "id": 57021086770616 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + -220.0, + 260.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{30443D97-4B57-482D-BA92-005DB39A9FA7}" + } + } + } + }, + { + "Key": { + "id": 57025381737912 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "TimeNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + -380.0, + -20.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{675C7E90-B89E-4347-A3C6-B8D12B6EA698}" + } + } + } + } + ], + "StatisticsHelper": { + "InstanceCounter": [ + { + "Key": 4199610336680704683, + "Value": 1 + }, + { + "Key": 4847610523576971761, + "Value": 1 + }, + { + "Key": 6462358712820489356, + "Value": 1 + }, + { + "Key": 10684225535275896474, + "Value": 3 + }, + { + "Key": 11941188735314642437, + "Value": 1 + }, + { + "Key": 11983076003173356132, + "Value": 1 + }, + { + "Key": 13774516226790665785, + "Value": 1 + }, + { + "Key": 17705307213431043531, + "Value": 1 + } + ] + } + }, + "Component_[630514155173445772]": { + "$type": "EditorGraphVariableManagerComponent", + "Id": 630514155173445772 + } + } + } + } +} \ No newline at end of file diff --git a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp index 66b14579fa..11615137ca 100644 --- a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp +++ b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp @@ -41,6 +41,9 @@ namespace Multiplayer // Automated testing listens for these logs if (editorsv_isDedicated) { + // Server logs piped to the editor. Change the buffering policy to ensure every write to stdout is flushed. + setvbuf(stdout, NULL, _IONBF, 0); + // If the settings registry is not available at this point, // then something catastrophic has happened in the application startup. // That should have been caught and messaged out earlier in startup. @@ -235,5 +238,4 @@ namespace Multiplayer { return MultiplayerEditorPackets::DispatchPacket(connection, packetHeader, serializer, *this); } - } diff --git a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.h b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.h index 0c892c847f..721c7e0a0f 100644 --- a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.h +++ b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.h @@ -12,6 +12,7 @@ #include #include #include +#include namespace AzNetworking { From 363007363a35154d04d8cc25896f378205cb1bb1 Mon Sep 17 00:00:00 2001 From: Tobias Alexander Franke Date: Fri, 29 Oct 2021 15:28:51 +0800 Subject: [PATCH 021/948] In the entity outliner search box, the matching results are not expanded and displayed Signed-off-by: T.J. McGrath-Daly --- .../AzToolsFramework/UI/Outliner/EntityOutlinerWidget.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.cpp index d6e9cac754..f3902023b7 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.cpp @@ -1088,6 +1088,8 @@ namespace AzToolsFramework m_listModel->SearchStringChanged(filterString); m_proxyModel->UpdateFilter(); + + m_gui->m_objectTree->expandAll(); } void EntityOutlinerWidget::OnFilterChanged(const AzQtComponents::SearchTypeFilterList& activeTypeFilters) From 8b1e14cc7e18ddfe3e7c408b4f0970513b8f3fe5 Mon Sep 17 00:00:00 2001 From: Andre Mitchell Date: Wed, 8 Dec 2021 08:19:10 -0500 Subject: [PATCH 022/948] Prevent some slice-related commands from being enabled when the slice editor is not. Fixes o3de/o3de#6198 Fixes an additional menu option that was visible (Resave all slices) Signed-off-by: Andre Mitchell --- Code/Editor/Core/LevelEditorMenuHandler.cpp | 6 +++--- Code/Editor/CryEdit.cpp | 4 +++- Code/Editor/MainWindow.cpp | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Code/Editor/Core/LevelEditorMenuHandler.cpp b/Code/Editor/Core/LevelEditorMenuHandler.cpp index 70aff10f87..6be2456d2a 100644 --- a/Code/Editor/Core/LevelEditorMenuHandler.cpp +++ b/Code/Editor/Core/LevelEditorMenuHandler.cpp @@ -374,7 +374,6 @@ QMenu* LevelEditorMenuHandler::CreateFileMenu() { DisableActionWhileLevelChanges(fileOpenSlice, e); })); -#endif // Save Selected Slice auto saveSelectedSlice = fileMenu.AddAction(ID_FILE_SAVE_SELECTED_SLICE); @@ -391,7 +390,7 @@ QMenu* LevelEditorMenuHandler::CreateFileMenu() { HideActionWhileEntitiesDeselected(saveSliceToRoot, e); })); - +#endif // Open Recent m_mostRecentLevelsMenu = fileMenu.AddMenu(tr("Open Recent")); connect(m_mostRecentLevelsMenu, &QMenu::aboutToShow, this, &LevelEditorMenuHandler::UpdateMRUFiles); @@ -439,9 +438,10 @@ QMenu* LevelEditorMenuHandler::CreateFileMenu() // Show Log File fileMenu.AddAction(ID_FILE_EDITLOGFILE); +#ifdef ENABLE_SLICE_EDITOR fileMenu.AddSeparator(); - fileMenu.AddAction(ID_FILE_RESAVESLICES); +#endif fileMenu.AddSeparator(); diff --git a/Code/Editor/CryEdit.cpp b/Code/Editor/CryEdit.cpp index d5f2305dfb..4e9eb6bada 100644 --- a/Code/Editor/CryEdit.cpp +++ b/Code/Editor/CryEdit.cpp @@ -380,13 +380,13 @@ void CCryEditApp::RegisterActionHandlers() ON_COMMAND(ID_IMPORT_ASSET, OnOpenAssetImporter) ON_COMMAND(ID_EDIT_LEVELDATA, OnEditLevelData) ON_COMMAND(ID_FILE_EDITLOGFILE, OnFileEditLogFile) - ON_COMMAND(ID_FILE_RESAVESLICES, OnFileResaveSlices) ON_COMMAND(ID_FILE_EDITEDITORINI, OnFileEditEditorini) ON_COMMAND(ID_PREFERENCES, OnPreferences) ON_COMMAND(ID_REDO, OnRedo) ON_COMMAND(ID_TOOLBAR_WIDGET_REDO, OnRedo) ON_COMMAND(ID_FILE_OPEN_LEVEL, OnOpenLevel) #ifdef ENABLE_SLICE_EDITOR + ON_COMMAND(ID_FILE_RESAVESLICES, OnFileResaveSlices) ON_COMMAND(ID_FILE_NEW_SLICE, OnCreateSlice) ON_COMMAND(ID_FILE_OPEN_SLICE, OnOpenSlice) #endif @@ -2636,6 +2636,7 @@ void CCryEditApp::OnFileEditLogFile() CFileUtil::EditTextFile(CLogFile::GetLogFileName(), 0, IFileUtil::FILE_TYPE_SCRIPT); } +#ifdef ENABLE_SLICE_EDITOR void CCryEditApp::OnFileResaveSlices() { AZStd::vector sliceAssetInfos; @@ -2766,6 +2767,7 @@ void CCryEditApp::OnFileResaveSlices() } } +#endif ////////////////////////////////////////////////////////////////////////// void CCryEditApp::OnFileEditEditorini() diff --git a/Code/Editor/MainWindow.cpp b/Code/Editor/MainWindow.cpp index 38e433c3a3..2e9bb723ac 100644 --- a/Code/Editor/MainWindow.cpp +++ b/Code/Editor/MainWindow.cpp @@ -642,11 +642,11 @@ void MainWindow::InitActions() .SetStatusTip(tr("Create a new slice")); am->AddAction(ID_FILE_OPEN_SLICE, tr("Open Slice...")) .SetStatusTip(tr("Open an existing slice")); -#endif am->AddAction(ID_FILE_SAVE_SELECTED_SLICE, tr("Save selected slice")).SetShortcut(tr("Alt+S")) .SetStatusTip(tr("Save the selected slice to the first level root")); am->AddAction(ID_FILE_SAVE_SLICE_TO_ROOT, tr("Save Slice to root")).SetShortcut(tr("Ctrl+Alt+S")) .SetStatusTip(tr("Save the selected slice to the top level root")); +#endif am->AddAction(ID_FILE_SAVE_LEVEL, tr("&Save")) .SetShortcut(tr("Ctrl+S")) .SetReserved() @@ -676,7 +676,9 @@ void MainWindow::InitActions() .RegisterUpdateCallback(cryEdit, &CCryEditApp::OnUpdateSelected); am->AddAction(ID_FILE_EXPORTOCCLUSIONMESH, tr("Export Occlusion Mesh")); am->AddAction(ID_FILE_EDITLOGFILE, tr("Show Log File")); +#ifdef ENABLE_SLICE_EDITOR am->AddAction(ID_FILE_RESAVESLICES, tr("Resave All Slices")); +#endif am->AddAction(ID_FILE_PROJECT_MANAGER_SETTINGS, tr("Edit Project Settings...")); am->AddAction(ID_FILE_PROJECT_MANAGER_NEW, tr("New Project...")); am->AddAction(ID_FILE_PROJECT_MANAGER_OPEN, tr("Open Project...")); From b5e61356b13fd3b4868a05a807c93740d94e9d79 Mon Sep 17 00:00:00 2001 From: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> Date: Wed, 8 Dec 2021 14:30:45 -0500 Subject: [PATCH 023/948] Compile time fixes for AZ_PROFILE macros Signed-off-by: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> --- Gems/Atom/RHI/Code/Include/Atom/RHI/MemorySubAllocator.h | 1 + Gems/Atom/RHI/DX12/Code/Source/RHI/MemoryView.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/MemorySubAllocator.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/MemorySubAllocator.h index 23caed3031..d96c34aa68 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/MemorySubAllocator.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/MemorySubAllocator.h @@ -7,6 +7,7 @@ */ #pragma once +#include #include #include #include diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/MemoryView.cpp b/Gems/Atom/RHI/DX12/Code/Source/RHI/MemoryView.cpp index 4b8604fa51..a80bdad21e 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/MemoryView.cpp +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/MemoryView.cpp @@ -5,9 +5,11 @@ * SPDX-License-Identifier: Apache-2.0 OR MIT * */ + #include #include +#include #include #include From d39ae32f2d6e8e4177a662ad448ca15c9384c75f Mon Sep 17 00:00:00 2001 From: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> Date: Wed, 8 Dec 2021 14:32:20 -0500 Subject: [PATCH 024/948] Cleanup Signed-off-by: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com> --- Gems/Atom/RHI/DX12/Code/Source/RHI/MemoryView.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/MemoryView.cpp b/Gems/Atom/RHI/DX12/Code/Source/RHI/MemoryView.cpp index a80bdad21e..8121f6a1ab 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/MemoryView.cpp +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/MemoryView.cpp @@ -5,7 +5,6 @@ * SPDX-License-Identifier: Apache-2.0 OR MIT * */ - #include #include From 7f9ba0d0b62fa2a6211dbaea1900fbdd177b17f6 Mon Sep 17 00:00:00 2001 From: nwidmaie Date: Wed, 8 Dec 2021 12:43:38 -0800 Subject: [PATCH 025/948] Converting PbrMaterialChart to prefab, and moving to AutomatedTesting project Signed-off-by: nwidmaie --- .../PbrMaterialChart/PbrMaterialChart.prefab | 5361 +++++++++++++++++ .../PbrMaterialChart/materials/basic.material | 32 + .../materials/basic_m00_r00.material | 13 + .../materials/basic_m00_r01.material | 13 + .../materials/basic_m00_r02.material | 13 + .../materials/basic_m00_r03.material | 13 + .../materials/basic_m00_r04.material | 13 + .../materials/basic_m00_r05.material | 13 + .../materials/basic_m00_r06.material | 13 + .../materials/basic_m00_r07.material | 13 + .../materials/basic_m00_r08.material | 13 + .../materials/basic_m00_r09.material | 13 + .../materials/basic_m00_r10.material | 13 + .../materials/basic_m10_r00.material | 13 + .../materials/basic_m10_r01.material | 13 + .../materials/basic_m10_r02.material | 13 + .../materials/basic_m10_r03.material | 13 + .../materials/basic_m10_r04.material | 13 + .../materials/basic_m10_r05.material | 13 + .../materials/basic_m10_r06.material | 13 + .../materials/basic_m10_r07.material | 13 + .../materials/basic_m10_r08.material | 13 + .../materials/basic_m10_r09.material | 13 + .../materials/basic_m10_r10.material | 13 + .../Levels/PbrMaterialChart/tags.txt | 12 + AutomatedTesting/Objects/sphere.fbx | 3 + 26 files changed, 5694 insertions(+) create mode 100644 AutomatedTesting/Levels/PbrMaterialChart/PbrMaterialChart.prefab create mode 100644 AutomatedTesting/Levels/PbrMaterialChart/materials/basic.material create mode 100644 AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r00.material create mode 100644 AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r01.material create mode 100644 AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r02.material create mode 100644 AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r03.material create mode 100644 AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r04.material create mode 100644 AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r05.material create mode 100644 AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r06.material create mode 100644 AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r07.material create mode 100644 AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r08.material create mode 100644 AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r09.material create mode 100644 AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r10.material create mode 100644 AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r00.material create mode 100644 AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r01.material create mode 100644 AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r02.material create mode 100644 AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r03.material create mode 100644 AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r04.material create mode 100644 AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r05.material create mode 100644 AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r06.material create mode 100644 AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r07.material create mode 100644 AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r08.material create mode 100644 AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r09.material create mode 100644 AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r10.material create mode 100644 AutomatedTesting/Levels/PbrMaterialChart/tags.txt create mode 100644 AutomatedTesting/Objects/sphere.fbx diff --git a/AutomatedTesting/Levels/PbrMaterialChart/PbrMaterialChart.prefab b/AutomatedTesting/Levels/PbrMaterialChart/PbrMaterialChart.prefab new file mode 100644 index 0000000000..faa93597de --- /dev/null +++ b/AutomatedTesting/Levels/PbrMaterialChart/PbrMaterialChart.prefab @@ -0,0 +1,5361 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "PbrMaterialChart", + "Components": { + "Component_[10182366347512475253]": { + "$type": "EditorPrefabComponent", + "Id": 10182366347512475253 + }, + "Component_[12917798267488243668]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12917798267488243668 + }, + "Component_[3261249813163778338]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3261249813163778338 + }, + "Component_[3837204912784440039]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 3837204912784440039 + }, + "Component_[4272963378099646759]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 4272963378099646759, + "Parent Entity": "" + }, + "Component_[4848458548047175816]": { + "$type": "EditorVisibilityComponent", + "Id": 4848458548047175816 + }, + "Component_[5787060997243919943]": { + "$type": "EditorInspectorComponent", + "Id": 5787060997243919943 + }, + "Component_[7804170251266531779]": { + "$type": "EditorLockComponent", + "Id": 7804170251266531779 + }, + "Component_[7874177159288365422]": { + "$type": "EditorEntitySortComponent", + "Id": 7874177159288365422 + }, + "Component_[8018146290632383969]": { + "$type": "EditorEntityIconComponent", + "Id": 8018146290632383969 + }, + "Component_[8452360690590857075]": { + "$type": "SelectionComponent", + "Id": 8452360690590857075 + } + } + }, + "Entities": { + "Entity_[1579029125278]": { + "Id": "Entity_[1579029125278]", + "Name": "PointLights", + "Components": { + "Component_[12510478104502833762]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 12510478104502833762 + }, + "Component_[13423580362045259926]": { + "$type": "EditorOnlyEntityComponent", + "Id": 13423580362045259926 + }, + "Component_[13763004328692227859]": { + "$type": "EditorEntityIconComponent", + "Id": 13763004328692227859 + }, + "Component_[2520589158620366474]": { + "$type": "EditorInspectorComponent", + "Id": 2520589158620366474, + "ComponentOrderEntryArray": [ + { + "ComponentId": 534931914642899990 + } + ] + }, + "Component_[534931914642899990]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 534931914642899990, + "Parent Entity": "Entity_[311518247264]", + "Transform Data": { + "Translate": [ + -0.02220340073108673, + 0.013456299901008606, + -0.00310519989579916 + ] + } + }, + "Component_[5737862213737495371]": { + "$type": "EditorEntitySortComponent", + "Id": 5737862213737495371, + "Child Entity Order": [ + "Entity_[1656338536606]", + "Entity_[1660633503902]", + "Entity_[1664928471198]", + "Entity_[1669223438494]", + "Entity_[1673518405790]", + "Entity_[1677813373086]", + "Entity_[1686403307678]", + "Entity_[1690698274974]", + "Entity_[1694993242270]", + "Entity_[1699288209566]", + "Entity_[1703583176862]", + "Entity_[1707878144158]", + "Entity_[1712173111454]", + "Entity_[1716468078750]", + "Entity_[464906102212]", + "Entity_[494970873284]", + "Entity_[460611134916]", + "Entity_[490675905988]", + "Entity_[456316167620]", + "Entity_[486380938692]", + "Entity_[452021200324]", + "Entity_[482085971396]", + "Entity_[447726233028]", + "Entity_[477791004100]", + "Entity_[443431265732]", + "Entity_[473496036804]", + "Entity_[439136298436]", + "Entity_[469201069508]" + ] + }, + "Component_[5835050117930709038]": { + "$type": "EditorLockComponent", + "Id": 5835050117930709038 + }, + "Component_[6088690331735476148]": { + "$type": "EditorVisibilityComponent", + "Id": 6088690331735476148 + }, + "Component_[749445421357843144]": { + "$type": "EditorPendingCompositionComponent", + "Id": 749445421357843144 + }, + "Component_[7514335123333124112]": { + "$type": "SelectionComponent", + "Id": 7514335123333124112 + } + } + }, + "Entity_[1656338536606]": { + "Id": "Entity_[1656338536606]", + "Name": "Light", + "Components": { + "Component_[12284008075844705430]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 12284008075844705430, + "Parent Entity": "Entity_[1579029125278]", + "Transform Data": { + "Translate": [ + 7.999998569488525, + 0.0, + 6.0 + ] + } + }, + "Component_[13457184847449496840]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13457184847449496840 + }, + "Component_[14431842353830635996]": { + "$type": "EditorLockComponent", + "Id": 14431842353830635996 + }, + "Component_[1473579476469110229]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1473579476469110229 + }, + "Component_[17008596888127953988]": { + "$type": "EditorEntitySortComponent", + "Id": 17008596888127953988 + }, + "Component_[17246196475221723560]": { + "$type": "EditorInspectorComponent", + "Id": 17246196475221723560, + "ComponentOrderEntryArray": [ + { + "ComponentId": 12284008075844705430 + }, + { + "ComponentId": 7864910209001174169, + "SortIndex": 1 + } + ] + }, + "Component_[18388752482036682870]": { + "$type": "EditorOnlyEntityComponent", + "Id": 18388752482036682870 + }, + "Component_[3917765902796274739]": { + "$type": "EditorEntityIconComponent", + "Id": 3917765902796274739 + }, + "Component_[4143676462074671972]": { + "$type": "AZ::Render::EditorAreaLightComponent", + "Id": 4143676462074671972, + "Controller": { + "Configuration": { + "LightType": 1, + "IntensityMode": 1, + "Intensity": 50.0, + "AttenuationRadius": 79.26654815673828 + } + } + }, + "Component_[4863305662794796025]": { + "$type": "EditorVisibilityComponent", + "Id": 4863305662794796025 + }, + "Component_[5730069629780503964]": { + "$type": "EditorSphereShapeComponent", + "Id": 5730069629780503964, + "ShapeColor": [ + 1.0, + 1.0, + 1.0, + 1.0 + ], + "SphereShape": { + "Configuration": { + "Radius": 0.05000000074505806 + } + } + }, + "Component_[5902189275159544426]": { + "$type": "SelectionComponent", + "Id": 5902189275159544426 + } + } + }, + "Entity_[1660633503902]": { + "Id": "Entity_[1660633503902]", + "Name": "Light", + "Components": { + "Component_[12284008075844705430]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 12284008075844705430, + "Parent Entity": "Entity_[1579029125278]", + "Transform Data": { + "Translate": [ + 7.999998569488525, + 12.0, + 6.0 + ] + } + }, + "Component_[12938187889472820644]": { + "$type": "EditorSphereShapeComponent", + "Id": 12938187889472820644, + "ShapeColor": [ + 1.0, + 1.0, + 1.0, + 1.0 + ], + "SphereShape": { + "Configuration": { + "Radius": 0.05000000074505806 + } + } + }, + "Component_[13457184847449496840]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13457184847449496840 + }, + "Component_[14431842353830635996]": { + "$type": "EditorLockComponent", + "Id": 14431842353830635996 + }, + "Component_[1473579476469110229]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1473579476469110229 + }, + "Component_[17008596888127953988]": { + "$type": "EditorEntitySortComponent", + "Id": 17008596888127953988 + }, + "Component_[17246196475221723560]": { + "$type": "EditorInspectorComponent", + "Id": 17246196475221723560, + "ComponentOrderEntryArray": [ + { + "ComponentId": 12284008075844705430 + }, + { + "ComponentId": 7864910209001174169, + "SortIndex": 1 + } + ] + }, + "Component_[18388752482036682870]": { + "$type": "EditorOnlyEntityComponent", + "Id": 18388752482036682870 + }, + "Component_[3917765902796274739]": { + "$type": "EditorEntityIconComponent", + "Id": 3917765902796274739 + }, + "Component_[4143676462074671972]": { + "$type": "AZ::Render::EditorAreaLightComponent", + "Id": 4143676462074671972, + "Controller": { + "Configuration": { + "LightType": 1, + "IntensityMode": 1, + "Intensity": 50.0, + "AttenuationRadius": 79.26654815673828 + } + } + }, + "Component_[4863305662794796025]": { + "$type": "EditorVisibilityComponent", + "Id": 4863305662794796025 + }, + "Component_[5902189275159544426]": { + "$type": "SelectionComponent", + "Id": 5902189275159544426 + } + } + }, + "Entity_[1664928471198]": { + "Id": "Entity_[1664928471198]", + "Name": "Light", + "Components": { + "Component_[12284008075844705430]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 12284008075844705430, + "Parent Entity": "Entity_[1579029125278]", + "Transform Data": { + "Translate": [ + 7.999998569488525, + -10.0, + 6.0 + ] + } + }, + "Component_[13457184847449496840]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13457184847449496840 + }, + "Component_[14431842353830635996]": { + "$type": "EditorLockComponent", + "Id": 14431842353830635996 + }, + "Component_[1473579476469110229]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1473579476469110229 + }, + "Component_[15916755507523201463]": { + "$type": "EditorSphereShapeComponent", + "Id": 15916755507523201463, + "ShapeColor": [ + 1.0, + 1.0, + 1.0, + 1.0 + ], + "SphereShape": { + "Configuration": { + "Radius": 0.05000000074505806 + } + } + }, + "Component_[17008596888127953988]": { + "$type": "EditorEntitySortComponent", + "Id": 17008596888127953988 + }, + "Component_[17246196475221723560]": { + "$type": "EditorInspectorComponent", + "Id": 17246196475221723560, + "ComponentOrderEntryArray": [ + { + "ComponentId": 12284008075844705430 + }, + { + "ComponentId": 7864910209001174169, + "SortIndex": 1 + } + ] + }, + "Component_[18388752482036682870]": { + "$type": "EditorOnlyEntityComponent", + "Id": 18388752482036682870 + }, + "Component_[3917765902796274739]": { + "$type": "EditorEntityIconComponent", + "Id": 3917765902796274739 + }, + "Component_[4143676462074671972]": { + "$type": "AZ::Render::EditorAreaLightComponent", + "Id": 4143676462074671972, + "Controller": { + "Configuration": { + "LightType": 1, + "IntensityMode": 1, + "Intensity": 50.0, + "AttenuationRadius": 79.26654815673828 + } + } + }, + "Component_[4863305662794796025]": { + "$type": "EditorVisibilityComponent", + "Id": 4863305662794796025 + }, + "Component_[5902189275159544426]": { + "$type": "SelectionComponent", + "Id": 5902189275159544426 + } + } + }, + "Entity_[1669223438494]": { + "Id": "Entity_[1669223438494]", + "Name": "Light", + "Components": { + "Component_[11441320324927657842]": { + "$type": "EditorSphereShapeComponent", + "Id": 11441320324927657842, + "ShapeColor": [ + 1.0, + 1.0, + 1.0, + 1.0 + ], + "SphereShape": { + "Configuration": { + "Radius": 0.05000000074505806 + } + } + }, + "Component_[12284008075844705430]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 12284008075844705430, + "Parent Entity": "Entity_[1579029125278]", + "Transform Data": { + "Translate": [ + 7.999998092651367, + 0.0, + -6.0 + ] + } + }, + "Component_[13457184847449496840]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13457184847449496840 + }, + "Component_[14431842353830635996]": { + "$type": "EditorLockComponent", + "Id": 14431842353830635996 + }, + "Component_[1473579476469110229]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1473579476469110229 + }, + "Component_[17008596888127953988]": { + "$type": "EditorEntitySortComponent", + "Id": 17008596888127953988 + }, + "Component_[17246196475221723560]": { + "$type": "EditorInspectorComponent", + "Id": 17246196475221723560, + "ComponentOrderEntryArray": [ + { + "ComponentId": 12284008075844705430 + }, + { + "ComponentId": 7864910209001174169, + "SortIndex": 1 + } + ] + }, + "Component_[18388752482036682870]": { + "$type": "EditorOnlyEntityComponent", + "Id": 18388752482036682870 + }, + "Component_[3917765902796274739]": { + "$type": "EditorEntityIconComponent", + "Id": 3917765902796274739 + }, + "Component_[4143676462074671972]": { + "$type": "AZ::Render::EditorAreaLightComponent", + "Id": 4143676462074671972, + "Controller": { + "Configuration": { + "LightType": 1, + "IntensityMode": 1, + "Intensity": 50.0, + "AttenuationRadius": 79.26654815673828 + } + } + }, + "Component_[4863305662794796025]": { + "$type": "EditorVisibilityComponent", + "Id": 4863305662794796025 + }, + "Component_[5902189275159544426]": { + "$type": "SelectionComponent", + "Id": 5902189275159544426 + } + } + }, + "Entity_[1673518405790]": { + "Id": "Entity_[1673518405790]", + "Name": "Light", + "Components": { + "Component_[12284008075844705430]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 12284008075844705430, + "Parent Entity": "Entity_[1579029125278]", + "Transform Data": { + "Translate": [ + 7.999998092651367, + 12.0, + -6.0 + ] + } + }, + "Component_[13457184847449496840]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13457184847449496840 + }, + "Component_[14431842353830635996]": { + "$type": "EditorLockComponent", + "Id": 14431842353830635996 + }, + "Component_[1473579476469110229]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1473579476469110229 + }, + "Component_[17008596888127953988]": { + "$type": "EditorEntitySortComponent", + "Id": 17008596888127953988 + }, + "Component_[17246196475221723560]": { + "$type": "EditorInspectorComponent", + "Id": 17246196475221723560, + "ComponentOrderEntryArray": [ + { + "ComponentId": 12284008075844705430 + }, + { + "ComponentId": 7864910209001174169, + "SortIndex": 1 + } + ] + }, + "Component_[18388752482036682870]": { + "$type": "EditorOnlyEntityComponent", + "Id": 18388752482036682870 + }, + "Component_[3917765902796274739]": { + "$type": "EditorEntityIconComponent", + "Id": 3917765902796274739 + }, + "Component_[4143676462074671972]": { + "$type": "AZ::Render::EditorAreaLightComponent", + "Id": 4143676462074671972, + "Controller": { + "Configuration": { + "LightType": 1, + "IntensityMode": 1, + "Intensity": 50.0, + "AttenuationRadius": 79.26654815673828 + } + } + }, + "Component_[4863305662794796025]": { + "$type": "EditorVisibilityComponent", + "Id": 4863305662794796025 + }, + "Component_[5078442133583813661]": { + "$type": "EditorSphereShapeComponent", + "Id": 5078442133583813661, + "ShapeColor": [ + 1.0, + 1.0, + 1.0, + 1.0 + ], + "SphereShape": { + "Configuration": { + "Radius": 0.05000000074505806 + } + } + }, + "Component_[5902189275159544426]": { + "$type": "SelectionComponent", + "Id": 5902189275159544426 + } + } + }, + "Entity_[1677813373086]": { + "Id": "Entity_[1677813373086]", + "Name": "Light", + "Components": { + "Component_[12284008075844705430]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 12284008075844705430, + "Parent Entity": "Entity_[1579029125278]", + "Transform Data": { + "Translate": [ + 7.999998092651367, + -10.0, + -6.0 + ] + } + }, + "Component_[13457184847449496840]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13457184847449496840 + }, + "Component_[14431842353830635996]": { + "$type": "EditorLockComponent", + "Id": 14431842353830635996 + }, + "Component_[1473579476469110229]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1473579476469110229 + }, + "Component_[17008596888127953988]": { + "$type": "EditorEntitySortComponent", + "Id": 17008596888127953988 + }, + "Component_[17246196475221723560]": { + "$type": "EditorInspectorComponent", + "Id": 17246196475221723560, + "ComponentOrderEntryArray": [ + { + "ComponentId": 12284008075844705430 + }, + { + "ComponentId": 7864910209001174169, + "SortIndex": 1 + } + ] + }, + "Component_[18388752482036682870]": { + "$type": "EditorOnlyEntityComponent", + "Id": 18388752482036682870 + }, + "Component_[3917765902796274739]": { + "$type": "EditorEntityIconComponent", + "Id": 3917765902796274739 + }, + "Component_[4143676462074671972]": { + "$type": "AZ::Render::EditorAreaLightComponent", + "Id": 4143676462074671972, + "Controller": { + "Configuration": { + "LightType": 1, + "IntensityMode": 1, + "Intensity": 50.0, + "AttenuationRadius": 79.26654815673828 + } + } + }, + "Component_[4863305662794796025]": { + "$type": "EditorVisibilityComponent", + "Id": 4863305662794796025 + }, + "Component_[5902189275159544426]": { + "$type": "SelectionComponent", + "Id": 5902189275159544426 + }, + "Component_[9989753495273560981]": { + "$type": "EditorSphereShapeComponent", + "Id": 9989753495273560981, + "ShapeColor": [ + 1.0, + 1.0, + 1.0, + 1.0 + ], + "SphereShape": { + "Configuration": { + "Radius": 0.05000000074505806 + } + } + } + } + }, + "Entity_[1686403307678]": { + "Id": "Entity_[1686403307678]", + "Name": "Light", + "Components": { + "Component_[12284008075844705430]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 12284008075844705430, + "Parent Entity": "Entity_[1579029125278]", + "Transform Data": { + "Translate": [ + 7.999998569488525, + -5.0, + 6.0 + ] + } + }, + "Component_[13457184847449496840]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13457184847449496840 + }, + "Component_[14431842353830635996]": { + "$type": "EditorLockComponent", + "Id": 14431842353830635996 + }, + "Component_[1473579476469110229]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1473579476469110229 + }, + "Component_[16566594251448483688]": { + "$type": "EditorSphereShapeComponent", + "Id": 16566594251448483688, + "ShapeColor": [ + 1.0, + 1.0, + 1.0, + 1.0 + ], + "SphereShape": { + "Configuration": { + "Radius": 0.05000000074505806 + } + } + }, + "Component_[17008596888127953988]": { + "$type": "EditorEntitySortComponent", + "Id": 17008596888127953988 + }, + "Component_[17246196475221723560]": { + "$type": "EditorInspectorComponent", + "Id": 17246196475221723560, + "ComponentOrderEntryArray": [ + { + "ComponentId": 12284008075844705430 + }, + { + "ComponentId": 7864910209001174169, + "SortIndex": 1 + } + ] + }, + "Component_[18388752482036682870]": { + "$type": "EditorOnlyEntityComponent", + "Id": 18388752482036682870 + }, + "Component_[3917765902796274739]": { + "$type": "EditorEntityIconComponent", + "Id": 3917765902796274739 + }, + "Component_[4143676462074671972]": { + "$type": "AZ::Render::EditorAreaLightComponent", + "Id": 4143676462074671972, + "Controller": { + "Configuration": { + "LightType": 1, + "IntensityMode": 1, + "Intensity": 50.0, + "AttenuationRadius": 79.26654815673828 + } + } + }, + "Component_[4863305662794796025]": { + "$type": "EditorVisibilityComponent", + "Id": 4863305662794796025 + }, + "Component_[5902189275159544426]": { + "$type": "SelectionComponent", + "Id": 5902189275159544426 + } + } + }, + "Entity_[1690698274974]": { + "Id": "Entity_[1690698274974]", + "Name": "Light", + "Components": { + "Component_[12284008075844705430]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 12284008075844705430, + "Parent Entity": "Entity_[1579029125278]", + "Transform Data": { + "Translate": [ + 7.999998092651367, + -5.0, + -6.0 + ] + } + }, + "Component_[13457184847449496840]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13457184847449496840 + }, + "Component_[14431842353830635996]": { + "$type": "EditorLockComponent", + "Id": 14431842353830635996 + }, + "Component_[1473579476469110229]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1473579476469110229 + }, + "Component_[17008596888127953988]": { + "$type": "EditorEntitySortComponent", + "Id": 17008596888127953988 + }, + "Component_[17246196475221723560]": { + "$type": "EditorInspectorComponent", + "Id": 17246196475221723560, + "ComponentOrderEntryArray": [ + { + "ComponentId": 12284008075844705430 + }, + { + "ComponentId": 7864910209001174169, + "SortIndex": 1 + } + ] + }, + "Component_[18388752482036682870]": { + "$type": "EditorOnlyEntityComponent", + "Id": 18388752482036682870 + }, + "Component_[3917765902796274739]": { + "$type": "EditorEntityIconComponent", + "Id": 3917765902796274739 + }, + "Component_[4143676462074671972]": { + "$type": "AZ::Render::EditorAreaLightComponent", + "Id": 4143676462074671972, + "Controller": { + "Configuration": { + "LightType": 1, + "IntensityMode": 1, + "Intensity": 50.0, + "AttenuationRadius": 79.26654815673828 + } + } + }, + "Component_[4863305662794796025]": { + "$type": "EditorVisibilityComponent", + "Id": 4863305662794796025 + }, + "Component_[5902189275159544426]": { + "$type": "SelectionComponent", + "Id": 5902189275159544426 + }, + "Component_[7725312483818004226]": { + "$type": "EditorSphereShapeComponent", + "Id": 7725312483818004226, + "ShapeColor": [ + 1.0, + 1.0, + 1.0, + 1.0 + ], + "SphereShape": { + "Configuration": { + "Radius": 0.05000000074505806 + } + } + } + } + }, + "Entity_[1694993242270]": { + "Id": "Entity_[1694993242270]", + "Name": "Light", + "Components": { + "Component_[11871171122135615232]": { + "$type": "EditorSphereShapeComponent", + "Id": 11871171122135615232, + "ShapeColor": [ + 1.0, + 1.0, + 1.0, + 1.0 + ], + "SphereShape": { + "Configuration": { + "Radius": 0.05000000074505806 + } + } + }, + "Component_[12284008075844705430]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 12284008075844705430, + "Parent Entity": "Entity_[1579029125278]", + "Transform Data": { + "Translate": [ + 7.999998569488525, + 5.0, + 6.0 + ] + } + }, + "Component_[13457184847449496840]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13457184847449496840 + }, + "Component_[14431842353830635996]": { + "$type": "EditorLockComponent", + "Id": 14431842353830635996 + }, + "Component_[1473579476469110229]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1473579476469110229 + }, + "Component_[17008596888127953988]": { + "$type": "EditorEntitySortComponent", + "Id": 17008596888127953988 + }, + "Component_[17246196475221723560]": { + "$type": "EditorInspectorComponent", + "Id": 17246196475221723560, + "ComponentOrderEntryArray": [ + { + "ComponentId": 12284008075844705430 + }, + { + "ComponentId": 7864910209001174169, + "SortIndex": 1 + } + ] + }, + "Component_[18388752482036682870]": { + "$type": "EditorOnlyEntityComponent", + "Id": 18388752482036682870 + }, + "Component_[3917765902796274739]": { + "$type": "EditorEntityIconComponent", + "Id": 3917765902796274739 + }, + "Component_[4143676462074671972]": { + "$type": "AZ::Render::EditorAreaLightComponent", + "Id": 4143676462074671972, + "Controller": { + "Configuration": { + "LightType": 1, + "IntensityMode": 1, + "Intensity": 50.0, + "AttenuationRadius": 79.26654815673828 + } + } + }, + "Component_[4863305662794796025]": { + "$type": "EditorVisibilityComponent", + "Id": 4863305662794796025 + }, + "Component_[5902189275159544426]": { + "$type": "SelectionComponent", + "Id": 5902189275159544426 + } + } + }, + "Entity_[1699288209566]": { + "Id": "Entity_[1699288209566]", + "Name": "Light", + "Components": { + "Component_[12284008075844705430]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 12284008075844705430, + "Parent Entity": "Entity_[1579029125278]", + "Transform Data": { + "Translate": [ + 7.999998092651367, + 5.0, + -6.0 + ] + } + }, + "Component_[13457184847449496840]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13457184847449496840 + }, + "Component_[14431842353830635996]": { + "$type": "EditorLockComponent", + "Id": 14431842353830635996 + }, + "Component_[1473579476469110229]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1473579476469110229 + }, + "Component_[17008596888127953988]": { + "$type": "EditorEntitySortComponent", + "Id": 17008596888127953988 + }, + "Component_[17246196475221723560]": { + "$type": "EditorInspectorComponent", + "Id": 17246196475221723560, + "ComponentOrderEntryArray": [ + { + "ComponentId": 12284008075844705430 + }, + { + "ComponentId": 7864910209001174169, + "SortIndex": 1 + } + ] + }, + "Component_[18388752482036682870]": { + "$type": "EditorOnlyEntityComponent", + "Id": 18388752482036682870 + }, + "Component_[3917765902796274739]": { + "$type": "EditorEntityIconComponent", + "Id": 3917765902796274739 + }, + "Component_[4143676462074671972]": { + "$type": "AZ::Render::EditorAreaLightComponent", + "Id": 4143676462074671972, + "Controller": { + "Configuration": { + "LightType": 1, + "IntensityMode": 1, + "Intensity": 50.0, + "AttenuationRadius": 79.26654815673828 + } + } + }, + "Component_[4863305662794796025]": { + "$type": "EditorVisibilityComponent", + "Id": 4863305662794796025 + }, + "Component_[5902189275159544426]": { + "$type": "SelectionComponent", + "Id": 5902189275159544426 + }, + "Component_[946758060659896190]": { + "$type": "EditorSphereShapeComponent", + "Id": 946758060659896190, + "ShapeColor": [ + 1.0, + 1.0, + 1.0, + 1.0 + ], + "SphereShape": { + "Configuration": { + "Radius": 0.05000000074505806 + } + } + } + } + }, + "Entity_[1703583176862]": { + "Id": "Entity_[1703583176862]", + "Name": "Light", + "Components": { + "Component_[12284008075844705430]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 12284008075844705430, + "Parent Entity": "Entity_[1579029125278]", + "Transform Data": { + "Translate": [ + 7.999998092651367, + -15.0, + -6.0 + ] + } + }, + "Component_[13457184847449496840]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13457184847449496840 + }, + "Component_[14431842353830635996]": { + "$type": "EditorLockComponent", + "Id": 14431842353830635996 + }, + "Component_[1473579476469110229]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1473579476469110229 + }, + "Component_[17008596888127953988]": { + "$type": "EditorEntitySortComponent", + "Id": 17008596888127953988 + }, + "Component_[17246196475221723560]": { + "$type": "EditorInspectorComponent", + "Id": 17246196475221723560, + "ComponentOrderEntryArray": [ + { + "ComponentId": 12284008075844705430 + }, + { + "ComponentId": 7864910209001174169, + "SortIndex": 1 + } + ] + }, + "Component_[18375465984866315036]": { + "$type": "EditorSphereShapeComponent", + "Id": 18375465984866315036, + "ShapeColor": [ + 1.0, + 1.0, + 1.0, + 1.0 + ], + "SphereShape": { + "Configuration": { + "Radius": 0.05000000074505806 + } + } + }, + "Component_[18388752482036682870]": { + "$type": "EditorOnlyEntityComponent", + "Id": 18388752482036682870 + }, + "Component_[3917765902796274739]": { + "$type": "EditorEntityIconComponent", + "Id": 3917765902796274739 + }, + "Component_[4143676462074671972]": { + "$type": "AZ::Render::EditorAreaLightComponent", + "Id": 4143676462074671972, + "Controller": { + "Configuration": { + "LightType": 1, + "IntensityMode": 1, + "Intensity": 50.0, + "AttenuationRadius": 79.26654815673828 + } + } + }, + "Component_[4863305662794796025]": { + "$type": "EditorVisibilityComponent", + "Id": 4863305662794796025 + }, + "Component_[5902189275159544426]": { + "$type": "SelectionComponent", + "Id": 5902189275159544426 + } + } + }, + "Entity_[1707878144158]": { + "Id": "Entity_[1707878144158]", + "Name": "Light", + "Components": { + "Component_[10544885903241229342]": { + "$type": "EditorSphereShapeComponent", + "Id": 10544885903241229342, + "ShapeColor": [ + 1.0, + 1.0, + 1.0, + 1.0 + ], + "SphereShape": { + "Configuration": { + "Radius": 0.05000000074505806 + } + } + }, + "Component_[12284008075844705430]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 12284008075844705430, + "Parent Entity": "Entity_[1579029125278]", + "Transform Data": { + "Translate": [ + 7.999998569488525, + -15.0, + 6.0 + ] + } + }, + "Component_[13457184847449496840]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13457184847449496840 + }, + "Component_[14431842353830635996]": { + "$type": "EditorLockComponent", + "Id": 14431842353830635996 + }, + "Component_[1473579476469110229]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1473579476469110229 + }, + "Component_[17008596888127953988]": { + "$type": "EditorEntitySortComponent", + "Id": 17008596888127953988 + }, + "Component_[17246196475221723560]": { + "$type": "EditorInspectorComponent", + "Id": 17246196475221723560, + "ComponentOrderEntryArray": [ + { + "ComponentId": 12284008075844705430 + }, + { + "ComponentId": 7864910209001174169, + "SortIndex": 1 + } + ] + }, + "Component_[18388752482036682870]": { + "$type": "EditorOnlyEntityComponent", + "Id": 18388752482036682870 + }, + "Component_[3917765902796274739]": { + "$type": "EditorEntityIconComponent", + "Id": 3917765902796274739 + }, + "Component_[4143676462074671972]": { + "$type": "AZ::Render::EditorAreaLightComponent", + "Id": 4143676462074671972, + "Controller": { + "Configuration": { + "LightType": 1, + "IntensityMode": 1, + "Intensity": 50.0, + "AttenuationRadius": 79.26654815673828 + } + } + }, + "Component_[4863305662794796025]": { + "$type": "EditorVisibilityComponent", + "Id": 4863305662794796025 + }, + "Component_[5902189275159544426]": { + "$type": "SelectionComponent", + "Id": 5902189275159544426 + } + } + }, + "Entity_[1712173111454]": { + "Id": "Entity_[1712173111454]", + "Name": "Light", + "Components": { + "Component_[12284008075844705430]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 12284008075844705430, + "Parent Entity": "Entity_[1579029125278]", + "Transform Data": { + "Translate": [ + 7.999998569488525, + 15.0, + 6.0 + ] + } + }, + "Component_[13457184847449496840]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13457184847449496840 + }, + "Component_[14431842353830635996]": { + "$type": "EditorLockComponent", + "Id": 14431842353830635996 + }, + "Component_[1473579476469110229]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1473579476469110229 + }, + "Component_[17008596888127953988]": { + "$type": "EditorEntitySortComponent", + "Id": 17008596888127953988 + }, + "Component_[17246196475221723560]": { + "$type": "EditorInspectorComponent", + "Id": 17246196475221723560, + "ComponentOrderEntryArray": [ + { + "ComponentId": 12284008075844705430 + }, + { + "ComponentId": 7864910209001174169, + "SortIndex": 1 + } + ] + }, + "Component_[18388752482036682870]": { + "$type": "EditorOnlyEntityComponent", + "Id": 18388752482036682870 + }, + "Component_[2820371548226138928]": { + "$type": "EditorSphereShapeComponent", + "Id": 2820371548226138928, + "ShapeColor": [ + 1.0, + 1.0, + 1.0, + 1.0 + ], + "SphereShape": { + "Configuration": { + "Radius": 0.05000000074505806 + } + } + }, + "Component_[3917765902796274739]": { + "$type": "EditorEntityIconComponent", + "Id": 3917765902796274739 + }, + "Component_[4143676462074671972]": { + "$type": "AZ::Render::EditorAreaLightComponent", + "Id": 4143676462074671972, + "Controller": { + "Configuration": { + "LightType": 1, + "IntensityMode": 1, + "Intensity": 50.0, + "AttenuationRadius": 79.26654815673828 + } + } + }, + "Component_[4863305662794796025]": { + "$type": "EditorVisibilityComponent", + "Id": 4863305662794796025 + }, + "Component_[5902189275159544426]": { + "$type": "SelectionComponent", + "Id": 5902189275159544426 + } + } + }, + "Entity_[1716468078750]": { + "Id": "Entity_[1716468078750]", + "Name": "Light", + "Components": { + "Component_[12284008075844705430]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 12284008075844705430, + "Parent Entity": "Entity_[1579029125278]", + "Transform Data": { + "Translate": [ + 7.999998092651367, + 15.0, + -6.0 + ] + } + }, + "Component_[13457184847449496840]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13457184847449496840 + }, + "Component_[14431842353830635996]": { + "$type": "EditorLockComponent", + "Id": 14431842353830635996 + }, + "Component_[1473579476469110229]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1473579476469110229 + }, + "Component_[17008596888127953988]": { + "$type": "EditorEntitySortComponent", + "Id": 17008596888127953988 + }, + "Component_[17202118748985219545]": { + "$type": "EditorSphereShapeComponent", + "Id": 17202118748985219545, + "ShapeColor": [ + 1.0, + 1.0, + 1.0, + 1.0 + ], + "SphereShape": { + "Configuration": { + "Radius": 0.05000000074505806 + } + } + }, + "Component_[17246196475221723560]": { + "$type": "EditorInspectorComponent", + "Id": 17246196475221723560, + "ComponentOrderEntryArray": [ + { + "ComponentId": 12284008075844705430 + }, + { + "ComponentId": 7864910209001174169, + "SortIndex": 1 + } + ] + }, + "Component_[18388752482036682870]": { + "$type": "EditorOnlyEntityComponent", + "Id": 18388752482036682870 + }, + "Component_[3917765902796274739]": { + "$type": "EditorEntityIconComponent", + "Id": 3917765902796274739 + }, + "Component_[4143676462074671972]": { + "$type": "AZ::Render::EditorAreaLightComponent", + "Id": 4143676462074671972, + "Controller": { + "Configuration": { + "LightType": 1, + "IntensityMode": 1, + "Intensity": 50.0, + "AttenuationRadius": 79.26654815673828 + } + } + }, + "Component_[4863305662794796025]": { + "$type": "EditorVisibilityComponent", + "Id": 4863305662794796025 + }, + "Component_[5902189275159544426]": { + "$type": "SelectionComponent", + "Id": 5902189275159544426 + } + } + }, + "Entity_[220034968733]": { + "Id": "Entity_[220034968733]", + "Name": "Ball00", + "Components": { + "Component_[11750162722213114821]": { + "$type": "SelectionComponent", + "Id": 11750162722213114821 + }, + "Component_[12608893098077724053]": { + "$type": "EditorEntitySortComponent", + "Id": 12608893098077724053 + }, + "Component_[13797422028724928908]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 13797422028724928908, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{61D16161-9F39-5A29-B927-ADF58E7E573B}", + "subId": 284780167 + }, + "assetHint": "objects/sphere.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[1492865274047869171]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1492865274047869171 + }, + "Component_[15252998008739701164]": { + "$type": "EditorVisibilityComponent", + "Id": 15252998008739701164 + }, + "Component_[15365333384879292339]": { + "$type": "EditorInspectorComponent", + "Id": 15365333384879292339, + "ComponentOrderEntryArray": [ + { + "ComponentId": 5985506260224649992 + }, + { + "ComponentId": 13797422028724928908, + "SortIndex": 1 + }, + { + "ComponentId": 5200514760734239788, + "SortIndex": 2 + } + ] + }, + "Component_[18296307565715962470]": { + "$type": "EditorPendingCompositionComponent", + "Id": 18296307565715962470 + }, + "Component_[1940145586700385602]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1940145586700385602 + }, + "Component_[4820397163316962417]": { + "$type": "EditorEntityIconComponent", + "Id": 4820397163316962417 + }, + "Component_[5200514760734239788]": { + "$type": "EditorMaterialComponent", + "Id": 5200514760734239788, + "Controller": { + "Configuration": { + "materials": { + "{}": { + "MaterialAsset": { + "assetId": { + "guid": "{1FD47684-2E9E-5525-BBCA-251795F9033C}" + }, + "assetHint": "levels/pbrmaterialchart/materials/basic_m00_r00.azmaterial" + } + } + } + } + }, + "materialSlotsByLodEnabled": true + }, + "Component_[5985506260224649992]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 5985506260224649992, + "Parent Entity": "Entity_[267279608989]" + }, + "Component_[7650403257628455609]": { + "$type": "EditorLockComponent", + "Id": 7650403257628455609 + } + } + }, + "Entity_[224329936029]": { + "Id": "Entity_[224329936029]", + "Name": "Ball01", + "Components": { + "Component_[11750162722213114821]": { + "$type": "SelectionComponent", + "Id": 11750162722213114821 + }, + "Component_[12608893098077724053]": { + "$type": "EditorEntitySortComponent", + "Id": 12608893098077724053 + }, + "Component_[13797422028724928908]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 13797422028724928908, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{61D16161-9F39-5A29-B927-ADF58E7E573B}", + "subId": 284780167 + }, + "assetHint": "objects/sphere.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[1492865274047869171]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1492865274047869171 + }, + "Component_[15252998008739701164]": { + "$type": "EditorVisibilityComponent", + "Id": 15252998008739701164 + }, + "Component_[15365333384879292339]": { + "$type": "EditorInspectorComponent", + "Id": 15365333384879292339, + "ComponentOrderEntryArray": [ + { + "ComponentId": 5985506260224649992 + }, + { + "ComponentId": 13797422028724928908, + "SortIndex": 1 + }, + { + "ComponentId": 5200514760734239788, + "SortIndex": 2 + } + ] + }, + "Component_[18296307565715962470]": { + "$type": "EditorPendingCompositionComponent", + "Id": 18296307565715962470 + }, + "Component_[1940145586700385602]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1940145586700385602 + }, + "Component_[4820397163316962417]": { + "$type": "EditorEntityIconComponent", + "Id": 4820397163316962417 + }, + "Component_[5200514760734239788]": { + "$type": "EditorMaterialComponent", + "Id": 5200514760734239788, + "Controller": { + "Configuration": { + "materials": { + "{}": { + "MaterialAsset": { + "assetId": { + "guid": "{B5660D78-818E-5273-AF3D-EC8189E2E6CB}" + }, + "assetHint": "levels/pbrmaterialchart/materials/basic_m00_r01.azmaterial" + } + } + } + } + }, + "materialSlotsByLodEnabled": true + }, + "Component_[5985506260224649992]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 5985506260224649992, + "Parent Entity": "Entity_[267279608989]", + "Transform Data": { + "Translate": [ + 1.9999995231628418, + 0.0, + 0.0 + ] + } + }, + "Component_[7650403257628455609]": { + "$type": "EditorLockComponent", + "Id": 7650403257628455609 + } + } + }, + "Entity_[224935554679]": { + "Id": "Entity_[224935554679]", + "Name": "Readme", + "Components": { + "Component_[10181355386221924165]": { + "$type": "EditorEntitySortComponent", + "Id": 10181355386221924165 + }, + "Component_[13072143045335196472]": { + "$type": "EditorVisibilityComponent", + "Id": 13072143045335196472 + }, + "Component_[16296166970503880418]": { + "$type": "EditorLockComponent", + "Id": 16296166970503880418 + }, + "Component_[18321120872779505013]": { + "$type": "SelectionComponent", + "Id": 18321120872779505013 + }, + "Component_[1837311764425750149]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1837311764425750149 + }, + "Component_[1974029438267401978]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1974029438267401978 + }, + "Component_[6189137928773010292]": { + "$type": "EditorCommentComponent", + "Id": 6189137928773010292, + "Configuration": "This level shows StandardPBR materials on a metallic/roughness grid. We only use metallic=0 and metallic=1 for now because we don't have material scripting yet and we don't have 121 separate material files." + }, + "Component_[6233037103326923418]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6233037103326923418, + "Parent Entity": "Entity_[311518247264]", + "Transform Data": { + "Translate": [ + 1014.3161010742188, + 1031.1007080078125, + -12.083206176757813 + ] + } + }, + "Component_[8021470524138221046]": { + "$type": "EditorOnlyEntityComponent", + "Id": 8021470524138221046 + }, + "Component_[869896445061711038]": { + "$type": "EditorInspectorComponent", + "Id": 869896445061711038, + "ComponentOrderEntryArray": [ + { + "ComponentId": 6233037103326923418 + }, + { + "ComponentId": 6189137928773010292, + "SortIndex": 1 + } + ] + }, + "Component_[8844687677689032541]": { + "$type": "EditorEntityIconComponent", + "Id": 8844687677689032541 + } + } + }, + "Entity_[227116497304]": { + "Id": "Entity_[227116497304]", + "Name": "IBL", + "Components": { + "Component_[10348929778265892995]": { + "$type": "EditorEntityIconComponent", + "Id": 10348929778265892995 + }, + "Component_[10541730177588140472]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 10541730177588140472, + "Parent Entity": "Entity_[311518247264]", + "Transform Data": { + "Translate": [ + -3.0222034454345703, + 6.013456344604492, + -51.00310516357422 + ] + } + }, + "Component_[11641917065646729270]": { + "$type": "SelectionComponent", + "Id": 11641917065646729270 + }, + "Component_[11941991254095032209]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 11941991254095032209 + }, + "Component_[16341934394936873930]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16341934394936873930 + }, + "Component_[17356140692640757864]": { + "$type": "AZ::Render::EditorImageBasedLightComponent", + "Id": 17356140692640757864, + "Controller": { + "Configuration": { + "diffuseImageAsset": { + "assetId": { + "guid": "{AA144B9D-68F6-5191-9DD1-211B8D72802C}", + "subId": 3000 + }, + "assetHint": "materialeditor/lightingpresets/konzerthaus_latlong_iblskyboxcm_ibldiffuse.exr.streamingimage" + }, + "specularImageAsset": { + "assetId": { + "guid": "{AA144B9D-68F6-5191-9DD1-211B8D72802C}", + "subId": 2000 + }, + "assetHint": "materialeditor/lightingpresets/konzerthaus_latlong_iblskyboxcm_iblspecular.exr.streamingimage" + } + } + } + }, + "Component_[1774390999207442542]": { + "$type": "EditorEntitySortComponent", + "Id": 1774390999207442542 + }, + "Component_[18079152973233625329]": { + "$type": "EditorLockComponent", + "Id": 18079152973233625329 + }, + "Component_[5784619194218092681]": { + "$type": "EditorVisibilityComponent", + "Id": 5784619194218092681 + }, + "Component_[948613077222456118]": { + "$type": "EditorOnlyEntityComponent", + "Id": 948613077222456118 + }, + "Component_[9509912405166426602]": { + "$type": "EditorInspectorComponent", + "Id": 9509912405166426602, + "ComponentOrderEntryArray": [ + { + "ComponentId": 10541730177588140472 + }, + { + "ComponentId": 17356140692640757864, + "SortIndex": 1 + } + ] + } + } + }, + "Entity_[228624903325]": { + "Id": "Entity_[228624903325]", + "Name": "Ball02", + "Components": { + "Component_[11750162722213114821]": { + "$type": "SelectionComponent", + "Id": 11750162722213114821 + }, + "Component_[12608893098077724053]": { + "$type": "EditorEntitySortComponent", + "Id": 12608893098077724053 + }, + "Component_[13797422028724928908]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 13797422028724928908, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{61D16161-9F39-5A29-B927-ADF58E7E573B}", + "subId": 284780167 + }, + "assetHint": "objects/sphere.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[1492865274047869171]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1492865274047869171 + }, + "Component_[15252998008739701164]": { + "$type": "EditorVisibilityComponent", + "Id": 15252998008739701164 + }, + "Component_[15365333384879292339]": { + "$type": "EditorInspectorComponent", + "Id": 15365333384879292339, + "ComponentOrderEntryArray": [ + { + "ComponentId": 5985506260224649992 + }, + { + "ComponentId": 13797422028724928908, + "SortIndex": 1 + }, + { + "ComponentId": 5200514760734239788, + "SortIndex": 2 + } + ] + }, + "Component_[18296307565715962470]": { + "$type": "EditorPendingCompositionComponent", + "Id": 18296307565715962470 + }, + "Component_[1940145586700385602]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1940145586700385602 + }, + "Component_[4820397163316962417]": { + "$type": "EditorEntityIconComponent", + "Id": 4820397163316962417 + }, + "Component_[5200514760734239788]": { + "$type": "EditorMaterialComponent", + "Id": 5200514760734239788, + "Controller": { + "Configuration": { + "materials": { + "{}": { + "MaterialAsset": { + "assetId": { + "guid": "{512443BD-9511-5F13-A84A-3ED5DB9E9B5A}" + }, + "assetHint": "levels/pbrmaterialchart/materials/basic_m00_r02.azmaterial" + } + } + } + } + }, + "materialSlotsByLodEnabled": true + }, + "Component_[5985506260224649992]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 5985506260224649992, + "Parent Entity": "Entity_[267279608989]", + "Transform Data": { + "Translate": [ + 3.9999992847442627, + 0.0, + 0.0 + ] + } + }, + "Component_[7650403257628455609]": { + "$type": "EditorLockComponent", + "Id": 7650403257628455609 + } + } + }, + "Entity_[232919870621]": { + "Id": "Entity_[232919870621]", + "Name": "Ball03", + "Components": { + "Component_[11750162722213114821]": { + "$type": "SelectionComponent", + "Id": 11750162722213114821 + }, + "Component_[12608893098077724053]": { + "$type": "EditorEntitySortComponent", + "Id": 12608893098077724053 + }, + "Component_[13797422028724928908]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 13797422028724928908, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{61D16161-9F39-5A29-B927-ADF58E7E573B}", + "subId": 284780167 + }, + "assetHint": "objects/sphere.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[1492865274047869171]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1492865274047869171 + }, + "Component_[15252998008739701164]": { + "$type": "EditorVisibilityComponent", + "Id": 15252998008739701164 + }, + "Component_[15365333384879292339]": { + "$type": "EditorInspectorComponent", + "Id": 15365333384879292339, + "ComponentOrderEntryArray": [ + { + "ComponentId": 5985506260224649992 + }, + { + "ComponentId": 13797422028724928908, + "SortIndex": 1 + }, + { + "ComponentId": 5200514760734239788, + "SortIndex": 2 + } + ] + }, + "Component_[18296307565715962470]": { + "$type": "EditorPendingCompositionComponent", + "Id": 18296307565715962470 + }, + "Component_[1940145586700385602]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1940145586700385602 + }, + "Component_[4820397163316962417]": { + "$type": "EditorEntityIconComponent", + "Id": 4820397163316962417 + }, + "Component_[5200514760734239788]": { + "$type": "EditorMaterialComponent", + "Id": 5200514760734239788, + "Controller": { + "Configuration": { + "materials": { + "{}": { + "MaterialAsset": { + "assetId": { + "guid": "{E28A5CC5-4B8B-5B90-877A-3D92C75DC75A}" + }, + "assetHint": "levels/pbrmaterialchart/materials/basic_m00_r03.azmaterial" + } + } + } + } + }, + "materialSlotsByLodEnabled": true + }, + "Component_[5985506260224649992]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 5985506260224649992, + "Parent Entity": "Entity_[267279608989]", + "Transform Data": { + "Translate": [ + 5.999998569488525, + 0.0, + 0.0 + ] + } + }, + "Component_[7650403257628455609]": { + "$type": "EditorLockComponent", + "Id": 7650403257628455609 + } + } + }, + "Entity_[237214837917]": { + "Id": "Entity_[237214837917]", + "Name": "Ball04", + "Components": { + "Component_[11750162722213114821]": { + "$type": "SelectionComponent", + "Id": 11750162722213114821 + }, + "Component_[12608893098077724053]": { + "$type": "EditorEntitySortComponent", + "Id": 12608893098077724053 + }, + "Component_[13797422028724928908]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 13797422028724928908, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{61D16161-9F39-5A29-B927-ADF58E7E573B}", + "subId": 284780167 + }, + "assetHint": "objects/sphere.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[1492865274047869171]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1492865274047869171 + }, + "Component_[15252998008739701164]": { + "$type": "EditorVisibilityComponent", + "Id": 15252998008739701164 + }, + "Component_[15365333384879292339]": { + "$type": "EditorInspectorComponent", + "Id": 15365333384879292339, + "ComponentOrderEntryArray": [ + { + "ComponentId": 5985506260224649992 + }, + { + "ComponentId": 13797422028724928908, + "SortIndex": 1 + }, + { + "ComponentId": 5200514760734239788, + "SortIndex": 2 + } + ] + }, + "Component_[18296307565715962470]": { + "$type": "EditorPendingCompositionComponent", + "Id": 18296307565715962470 + }, + "Component_[1940145586700385602]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1940145586700385602 + }, + "Component_[4820397163316962417]": { + "$type": "EditorEntityIconComponent", + "Id": 4820397163316962417 + }, + "Component_[5200514760734239788]": { + "$type": "EditorMaterialComponent", + "Id": 5200514760734239788, + "Controller": { + "Configuration": { + "materials": { + "{}": { + "MaterialAsset": { + "assetId": { + "guid": "{1495BCCF-3F96-5D0B-8176-228DB22CEC82}" + }, + "assetHint": "levels/pbrmaterialchart/materials/basic_m00_r04.azmaterial" + } + } + } + } + }, + "materialSlotsByLodEnabled": true + }, + "Component_[5985506260224649992]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 5985506260224649992, + "Parent Entity": "Entity_[267279608989]", + "Transform Data": { + "Translate": [ + 7.999998092651367, + 0.0, + 0.0 + ] + } + }, + "Component_[7650403257628455609]": { + "$type": "EditorLockComponent", + "Id": 7650403257628455609 + } + } + }, + "Entity_[241509805213]": { + "Id": "Entity_[241509805213]", + "Name": "Ball05", + "Components": { + "Component_[11750162722213114821]": { + "$type": "SelectionComponent", + "Id": 11750162722213114821 + }, + "Component_[12608893098077724053]": { + "$type": "EditorEntitySortComponent", + "Id": 12608893098077724053 + }, + "Component_[13797422028724928908]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 13797422028724928908, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{61D16161-9F39-5A29-B927-ADF58E7E573B}", + "subId": 284780167 + }, + "assetHint": "objects/sphere.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[1492865274047869171]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1492865274047869171 + }, + "Component_[15252998008739701164]": { + "$type": "EditorVisibilityComponent", + "Id": 15252998008739701164 + }, + "Component_[15365333384879292339]": { + "$type": "EditorInspectorComponent", + "Id": 15365333384879292339, + "ComponentOrderEntryArray": [ + { + "ComponentId": 5985506260224649992 + }, + { + "ComponentId": 13797422028724928908, + "SortIndex": 1 + }, + { + "ComponentId": 5200514760734239788, + "SortIndex": 2 + } + ] + }, + "Component_[18296307565715962470]": { + "$type": "EditorPendingCompositionComponent", + "Id": 18296307565715962470 + }, + "Component_[1940145586700385602]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1940145586700385602 + }, + "Component_[4820397163316962417]": { + "$type": "EditorEntityIconComponent", + "Id": 4820397163316962417 + }, + "Component_[5200514760734239788]": { + "$type": "EditorMaterialComponent", + "Id": 5200514760734239788, + "Controller": { + "Configuration": { + "materials": { + "{}": { + "MaterialAsset": { + "assetId": { + "guid": "{40494612-0ABF-55B5-9C56-E968763FCFDE}" + }, + "assetHint": "levels/pbrmaterialchart/materials/basic_m00_r05.azmaterial" + } + } + } + } + }, + "materialSlotsByLodEnabled": true + }, + "Component_[5985506260224649992]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 5985506260224649992, + "Parent Entity": "Entity_[267279608989]", + "Transform Data": { + "Translate": [ + 9.999998092651367, + 0.0, + 0.0 + ] + } + }, + "Component_[7650403257628455609]": { + "$type": "EditorLockComponent", + "Id": 7650403257628455609 + } + } + }, + "Entity_[245804772509]": { + "Id": "Entity_[245804772509]", + "Name": "Ball06", + "Components": { + "Component_[11750162722213114821]": { + "$type": "SelectionComponent", + "Id": 11750162722213114821 + }, + "Component_[12608893098077724053]": { + "$type": "EditorEntitySortComponent", + "Id": 12608893098077724053 + }, + "Component_[13797422028724928908]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 13797422028724928908, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{61D16161-9F39-5A29-B927-ADF58E7E573B}", + "subId": 284780167 + }, + "assetHint": "objects/sphere.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[1492865274047869171]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1492865274047869171 + }, + "Component_[15252998008739701164]": { + "$type": "EditorVisibilityComponent", + "Id": 15252998008739701164 + }, + "Component_[15365333384879292339]": { + "$type": "EditorInspectorComponent", + "Id": 15365333384879292339, + "ComponentOrderEntryArray": [ + { + "ComponentId": 5985506260224649992 + }, + { + "ComponentId": 13797422028724928908, + "SortIndex": 1 + }, + { + "ComponentId": 5200514760734239788, + "SortIndex": 2 + } + ] + }, + "Component_[18296307565715962470]": { + "$type": "EditorPendingCompositionComponent", + "Id": 18296307565715962470 + }, + "Component_[1940145586700385602]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1940145586700385602 + }, + "Component_[4820397163316962417]": { + "$type": "EditorEntityIconComponent", + "Id": 4820397163316962417 + }, + "Component_[5200514760734239788]": { + "$type": "EditorMaterialComponent", + "Id": 5200514760734239788, + "Controller": { + "Configuration": { + "materials": { + "{}": { + "MaterialAsset": { + "assetId": { + "guid": "{76CF9D4A-009F-5494-83AB-6E3D4D1B4A36}" + }, + "assetHint": "levels/pbrmaterialchart/materials/basic_m00_r06.azmaterial" + } + } + } + } + }, + "materialSlotsByLodEnabled": true + }, + "Component_[5985506260224649992]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 5985506260224649992, + "Parent Entity": "Entity_[267279608989]", + "Transform Data": { + "Translate": [ + 11.999998092651367, + 0.0, + 0.0 + ] + } + }, + "Component_[7650403257628455609]": { + "$type": "EditorLockComponent", + "Id": 7650403257628455609 + } + } + }, + "Entity_[250099739805]": { + "Id": "Entity_[250099739805]", + "Name": "Ball07", + "Components": { + "Component_[11750162722213114821]": { + "$type": "SelectionComponent", + "Id": 11750162722213114821 + }, + "Component_[12608893098077724053]": { + "$type": "EditorEntitySortComponent", + "Id": 12608893098077724053 + }, + "Component_[13797422028724928908]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 13797422028724928908, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{61D16161-9F39-5A29-B927-ADF58E7E573B}", + "subId": 284780167 + }, + "assetHint": "objects/sphere.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[1492865274047869171]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1492865274047869171 + }, + "Component_[15252998008739701164]": { + "$type": "EditorVisibilityComponent", + "Id": 15252998008739701164 + }, + "Component_[15365333384879292339]": { + "$type": "EditorInspectorComponent", + "Id": 15365333384879292339, + "ComponentOrderEntryArray": [ + { + "ComponentId": 5985506260224649992 + }, + { + "ComponentId": 13797422028724928908, + "SortIndex": 1 + }, + { + "ComponentId": 5200514760734239788, + "SortIndex": 2 + } + ] + }, + "Component_[18296307565715962470]": { + "$type": "EditorPendingCompositionComponent", + "Id": 18296307565715962470 + }, + "Component_[1940145586700385602]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1940145586700385602 + }, + "Component_[4820397163316962417]": { + "$type": "EditorEntityIconComponent", + "Id": 4820397163316962417 + }, + "Component_[5200514760734239788]": { + "$type": "EditorMaterialComponent", + "Id": 5200514760734239788, + "Controller": { + "Configuration": { + "materials": { + "{}": { + "MaterialAsset": { + "assetId": { + "guid": "{8431B792-E6CC-51DD-B82E-F3E4A12FCB4A}" + }, + "assetHint": "levels/pbrmaterialchart/materials/basic_m00_r07.azmaterial" + } + } + } + } + }, + "materialSlotsByLodEnabled": true + }, + "Component_[5985506260224649992]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 5985506260224649992, + "Parent Entity": "Entity_[267279608989]", + "Transform Data": { + "Translate": [ + 13.99999713897705, + 0.0, + 0.0 + ] + } + }, + "Component_[7650403257628455609]": { + "$type": "EditorLockComponent", + "Id": 7650403257628455609 + } + } + }, + "Entity_[254394707101]": { + "Id": "Entity_[254394707101]", + "Name": "Ball08", + "Components": { + "Component_[11750162722213114821]": { + "$type": "SelectionComponent", + "Id": 11750162722213114821 + }, + "Component_[12608893098077724053]": { + "$type": "EditorEntitySortComponent", + "Id": 12608893098077724053 + }, + "Component_[13797422028724928908]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 13797422028724928908, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{61D16161-9F39-5A29-B927-ADF58E7E573B}", + "subId": 284780167 + }, + "assetHint": "objects/sphere.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[1492865274047869171]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1492865274047869171 + }, + "Component_[15252998008739701164]": { + "$type": "EditorVisibilityComponent", + "Id": 15252998008739701164 + }, + "Component_[15365333384879292339]": { + "$type": "EditorInspectorComponent", + "Id": 15365333384879292339, + "ComponentOrderEntryArray": [ + { + "ComponentId": 5985506260224649992 + }, + { + "ComponentId": 13797422028724928908, + "SortIndex": 1 + }, + { + "ComponentId": 5200514760734239788, + "SortIndex": 2 + } + ] + }, + "Component_[18296307565715962470]": { + "$type": "EditorPendingCompositionComponent", + "Id": 18296307565715962470 + }, + "Component_[1940145586700385602]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1940145586700385602 + }, + "Component_[4820397163316962417]": { + "$type": "EditorEntityIconComponent", + "Id": 4820397163316962417 + }, + "Component_[5200514760734239788]": { + "$type": "EditorMaterialComponent", + "Id": 5200514760734239788, + "Controller": { + "Configuration": { + "materials": { + "{}": { + "MaterialAsset": { + "assetId": { + "guid": "{4B1F29FF-7971-5524-AA1B-0DC2392A33C4}" + }, + "assetHint": "levels/pbrmaterialchart/materials/basic_m00_r08.azmaterial" + } + } + } + } + }, + "materialSlotsByLodEnabled": true + }, + "Component_[5985506260224649992]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 5985506260224649992, + "Parent Entity": "Entity_[267279608989]", + "Transform Data": { + "Translate": [ + 15.99999713897705, + 0.0, + 0.0 + ] + } + }, + "Component_[7650403257628455609]": { + "$type": "EditorLockComponent", + "Id": 7650403257628455609 + } + } + }, + "Entity_[258689674397]": { + "Id": "Entity_[258689674397]", + "Name": "Ball09", + "Components": { + "Component_[11750162722213114821]": { + "$type": "SelectionComponent", + "Id": 11750162722213114821 + }, + "Component_[12608893098077724053]": { + "$type": "EditorEntitySortComponent", + "Id": 12608893098077724053 + }, + "Component_[13797422028724928908]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 13797422028724928908, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{61D16161-9F39-5A29-B927-ADF58E7E573B}", + "subId": 284780167 + }, + "assetHint": "objects/sphere.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[1492865274047869171]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1492865274047869171 + }, + "Component_[15252998008739701164]": { + "$type": "EditorVisibilityComponent", + "Id": 15252998008739701164 + }, + "Component_[15365333384879292339]": { + "$type": "EditorInspectorComponent", + "Id": 15365333384879292339, + "ComponentOrderEntryArray": [ + { + "ComponentId": 5985506260224649992 + }, + { + "ComponentId": 13797422028724928908, + "SortIndex": 1 + }, + { + "ComponentId": 5200514760734239788, + "SortIndex": 2 + } + ] + }, + "Component_[18296307565715962470]": { + "$type": "EditorPendingCompositionComponent", + "Id": 18296307565715962470 + }, + "Component_[1940145586700385602]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1940145586700385602 + }, + "Component_[4820397163316962417]": { + "$type": "EditorEntityIconComponent", + "Id": 4820397163316962417 + }, + "Component_[5200514760734239788]": { + "$type": "EditorMaterialComponent", + "Id": 5200514760734239788, + "Controller": { + "Configuration": { + "materials": { + "{}": { + "MaterialAsset": { + "assetId": { + "guid": "{785BE6DE-C0EB-5B47-9438-4F9ECFC34A96}" + }, + "assetHint": "levels/pbrmaterialchart/materials/basic_m00_r09.azmaterial" + } + } + } + } + }, + "materialSlotsByLodEnabled": true + }, + "Component_[5985506260224649992]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 5985506260224649992, + "Parent Entity": "Entity_[267279608989]", + "Transform Data": { + "Translate": [ + 17.999996185302734, + 0.0, + 0.0 + ] + } + }, + "Component_[7650403257628455609]": { + "$type": "EditorLockComponent", + "Id": 7650403257628455609 + } + } + }, + "Entity_[262984641693]": { + "Id": "Entity_[262984641693]", + "Name": "Ball10", + "Components": { + "Component_[11750162722213114821]": { + "$type": "SelectionComponent", + "Id": 11750162722213114821 + }, + "Component_[12608893098077724053]": { + "$type": "EditorEntitySortComponent", + "Id": 12608893098077724053 + }, + "Component_[13797422028724928908]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 13797422028724928908, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{61D16161-9F39-5A29-B927-ADF58E7E573B}", + "subId": 284780167 + }, + "assetHint": "objects/sphere.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[1492865274047869171]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1492865274047869171 + }, + "Component_[15252998008739701164]": { + "$type": "EditorVisibilityComponent", + "Id": 15252998008739701164 + }, + "Component_[15365333384879292339]": { + "$type": "EditorInspectorComponent", + "Id": 15365333384879292339, + "ComponentOrderEntryArray": [ + { + "ComponentId": 5985506260224649992 + }, + { + "ComponentId": 13797422028724928908, + "SortIndex": 1 + }, + { + "ComponentId": 5200514760734239788, + "SortIndex": 2 + } + ] + }, + "Component_[18296307565715962470]": { + "$type": "EditorPendingCompositionComponent", + "Id": 18296307565715962470 + }, + "Component_[1940145586700385602]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1940145586700385602 + }, + "Component_[4820397163316962417]": { + "$type": "EditorEntityIconComponent", + "Id": 4820397163316962417 + }, + "Component_[5200514760734239788]": { + "$type": "EditorMaterialComponent", + "Id": 5200514760734239788, + "Controller": { + "Configuration": { + "materials": { + "{}": { + "MaterialAsset": { + "assetId": { + "guid": "{C40DE9AE-6756-57E7-B3B4-FB0542B5CD0F}" + }, + "assetHint": "levels/pbrmaterialchart/materials/basic_m00_r10.azmaterial" + } + } + } + } + }, + "materialSlotsByLodEnabled": true + }, + "Component_[5985506260224649992]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 5985506260224649992, + "Parent Entity": "Entity_[267279608989]", + "Transform Data": { + "Translate": [ + 19.999996185302734, + 0.0, + 0.0 + ] + } + }, + "Component_[7650403257628455609]": { + "$type": "EditorLockComponent", + "Id": 7650403257628455609 + } + } + }, + "Entity_[267279608989]": { + "Id": "Entity_[267279608989]", + "Name": "Row", + "Components": { + "Component_[10431128421533587390]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 10431128421533587390 + }, + "Component_[12384319735386528488]": { + "$type": "EditorInspectorComponent", + "Id": 12384319735386528488, + "ComponentOrderEntryArray": [ + { + "ComponentId": 2138630967603263484 + } + ] + }, + "Component_[12698663999690413529]": { + "$type": "EditorVisibilityComponent", + "Id": 12698663999690413529 + }, + "Component_[13267882596040987058]": { + "$type": "EditorOnlyEntityComponent", + "Id": 13267882596040987058 + }, + "Component_[15031093406648363268]": { + "$type": "EditorLockComponent", + "Id": 15031093406648363268 + }, + "Component_[15177069797419761403]": { + "$type": "EditorEntitySortComponent", + "Id": 15177069797419761403, + "Child Entity Order": [ + "Entity_[220034968733]", + "Entity_[224329936029]", + "Entity_[228624903325]", + "Entity_[232919870621]", + "Entity_[237214837917]", + "Entity_[241509805213]", + "Entity_[245804772509]", + "Entity_[250099739805]", + "Entity_[254394707101]", + "Entity_[258689674397]", + "Entity_[262984641693]" + ] + }, + "Component_[17955329409582714617]": { + "$type": "SelectionComponent", + "Id": 17955329409582714617 + }, + "Component_[2138630967603263484]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 2138630967603263484, + "Parent Entity": "Entity_[311518247264]", + "Transform Data": { + "Translate": [ + -0.02220340073108673, + -9.986543655395508, + -1.0031051635742188 + ], + "Rotate": [ + 0.0, + 0.0, + 90.00000762939453 + ] + } + }, + "Component_[3786501212457578744]": { + "$type": "EditorEntityIconComponent", + "Id": 3786501212457578744 + }, + "Component_[6440613696530771175]": { + "$type": "EditorPendingCompositionComponent", + "Id": 6440613696530771175 + } + } + }, + "Entity_[271574576285]": { + "Id": "Entity_[271574576285]", + "Name": "Row", + "Components": { + "Component_[10431128421533587390]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 10431128421533587390 + }, + "Component_[12384319735386528488]": { + "$type": "EditorInspectorComponent", + "Id": 12384319735386528488, + "ComponentOrderEntryArray": [ + { + "ComponentId": 2138630967603263484 + } + ] + }, + "Component_[12698663999690413529]": { + "$type": "EditorVisibilityComponent", + "Id": 12698663999690413529 + }, + "Component_[13267882596040987058]": { + "$type": "EditorOnlyEntityComponent", + "Id": 13267882596040987058 + }, + "Component_[15031093406648363268]": { + "$type": "EditorLockComponent", + "Id": 15031093406648363268 + }, + "Component_[15177069797419761403]": { + "$type": "EditorEntitySortComponent", + "Id": 15177069797419761403, + "Child Entity Order": [ + "Entity_[293049412765]", + "Entity_[301639347357]", + "Entity_[310229281949]", + "Entity_[318819216541]", + "Entity_[275869543581]", + "Entity_[280164510877]", + "Entity_[284459478173]", + "Entity_[288754445469]", + "Entity_[297344380061]", + "Entity_[305934314653]", + "Entity_[314524249245]" + ] + }, + "Component_[17955329409582714617]": { + "$type": "SelectionComponent", + "Id": 17955329409582714617 + }, + "Component_[2138630967603263484]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 2138630967603263484, + "Parent Entity": "Entity_[311518247264]", + "Transform Data": { + "Translate": [ + -0.02220340073108673, + -9.986543655395508, + 0.9968947768211365 + ], + "Rotate": [ + 0.0, + 0.0, + 90.00000762939453 + ] + } + }, + "Component_[3786501212457578744]": { + "$type": "EditorEntityIconComponent", + "Id": 3786501212457578744 + }, + "Component_[6440613696530771175]": { + "$type": "EditorPendingCompositionComponent", + "Id": 6440613696530771175 + } + } + }, + "Entity_[275869543581]": { + "Id": "Entity_[275869543581]", + "Name": "Ball04", + "Components": { + "Component_[11750162722213114821]": { + "$type": "SelectionComponent", + "Id": 11750162722213114821 + }, + "Component_[12608893098077724053]": { + "$type": "EditorEntitySortComponent", + "Id": 12608893098077724053 + }, + "Component_[13797422028724928908]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 13797422028724928908, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{61D16161-9F39-5A29-B927-ADF58E7E573B}", + "subId": 284780167 + }, + "assetHint": "objects/sphere.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[1492865274047869171]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1492865274047869171 + }, + "Component_[15252998008739701164]": { + "$type": "EditorVisibilityComponent", + "Id": 15252998008739701164 + }, + "Component_[15365333384879292339]": { + "$type": "EditorInspectorComponent", + "Id": 15365333384879292339, + "ComponentOrderEntryArray": [ + { + "ComponentId": 5985506260224649992 + }, + { + "ComponentId": 13797422028724928908, + "SortIndex": 1 + }, + { + "ComponentId": 5200514760734239788, + "SortIndex": 2 + } + ] + }, + "Component_[18296307565715962470]": { + "$type": "EditorPendingCompositionComponent", + "Id": 18296307565715962470 + }, + "Component_[1940145586700385602]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1940145586700385602 + }, + "Component_[4820397163316962417]": { + "$type": "EditorEntityIconComponent", + "Id": 4820397163316962417 + }, + "Component_[5200514760734239788]": { + "$type": "EditorMaterialComponent", + "Id": 5200514760734239788, + "Controller": { + "Configuration": { + "materials": { + "{}": { + "MaterialAsset": { + "assetId": { + "guid": "{251C4C29-4ECD-5763-AF4F-20675EAC048B}" + }, + "assetHint": "levels/pbrmaterialchart/materials/basic_m10_r04.azmaterial" + } + } + } + } + }, + "materialSlotsByLodEnabled": true + }, + "Component_[5985506260224649992]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 5985506260224649992, + "Parent Entity": "Entity_[271574576285]", + "Transform Data": { + "Translate": [ + 7.999998092651367, + 0.0, + 0.0 + ] + } + }, + "Component_[7650403257628455609]": { + "$type": "EditorLockComponent", + "Id": 7650403257628455609 + } + } + }, + "Entity_[280164510877]": { + "Id": "Entity_[280164510877]", + "Name": "Ball05", + "Components": { + "Component_[11750162722213114821]": { + "$type": "SelectionComponent", + "Id": 11750162722213114821 + }, + "Component_[12608893098077724053]": { + "$type": "EditorEntitySortComponent", + "Id": 12608893098077724053 + }, + "Component_[13797422028724928908]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 13797422028724928908, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{61D16161-9F39-5A29-B927-ADF58E7E573B}", + "subId": 284780167 + }, + "assetHint": "objects/sphere.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[1492865274047869171]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1492865274047869171 + }, + "Component_[15252998008739701164]": { + "$type": "EditorVisibilityComponent", + "Id": 15252998008739701164 + }, + "Component_[15365333384879292339]": { + "$type": "EditorInspectorComponent", + "Id": 15365333384879292339, + "ComponentOrderEntryArray": [ + { + "ComponentId": 5985506260224649992 + }, + { + "ComponentId": 13797422028724928908, + "SortIndex": 1 + }, + { + "ComponentId": 5200514760734239788, + "SortIndex": 2 + } + ] + }, + "Component_[18296307565715962470]": { + "$type": "EditorPendingCompositionComponent", + "Id": 18296307565715962470 + }, + "Component_[1940145586700385602]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1940145586700385602 + }, + "Component_[4820397163316962417]": { + "$type": "EditorEntityIconComponent", + "Id": 4820397163316962417 + }, + "Component_[5200514760734239788]": { + "$type": "EditorMaterialComponent", + "Id": 5200514760734239788, + "Controller": { + "Configuration": { + "materials": { + "{}": { + "MaterialAsset": { + "assetId": { + "guid": "{02D082C4-5032-57CC-A081-BC4D8518BCF0}" + }, + "assetHint": "levels/pbrmaterialchart/materials/basic_m10_r05.azmaterial" + } + } + } + } + }, + "materialSlotsByLodEnabled": true + }, + "Component_[5985506260224649992]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 5985506260224649992, + "Parent Entity": "Entity_[271574576285]", + "Transform Data": { + "Translate": [ + 9.999998092651367, + 0.0, + 0.0 + ] + } + }, + "Component_[7650403257628455609]": { + "$type": "EditorLockComponent", + "Id": 7650403257628455609 + } + } + }, + "Entity_[284459478173]": { + "Id": "Entity_[284459478173]", + "Name": "Ball06", + "Components": { + "Component_[11750162722213114821]": { + "$type": "SelectionComponent", + "Id": 11750162722213114821 + }, + "Component_[12608893098077724053]": { + "$type": "EditorEntitySortComponent", + "Id": 12608893098077724053 + }, + "Component_[13797422028724928908]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 13797422028724928908, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{61D16161-9F39-5A29-B927-ADF58E7E573B}", + "subId": 284780167 + }, + "assetHint": "objects/sphere.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[1492865274047869171]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1492865274047869171 + }, + "Component_[15252998008739701164]": { + "$type": "EditorVisibilityComponent", + "Id": 15252998008739701164 + }, + "Component_[15365333384879292339]": { + "$type": "EditorInspectorComponent", + "Id": 15365333384879292339, + "ComponentOrderEntryArray": [ + { + "ComponentId": 5985506260224649992 + }, + { + "ComponentId": 13797422028724928908, + "SortIndex": 1 + }, + { + "ComponentId": 5200514760734239788, + "SortIndex": 2 + } + ] + }, + "Component_[18296307565715962470]": { + "$type": "EditorPendingCompositionComponent", + "Id": 18296307565715962470 + }, + "Component_[1940145586700385602]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1940145586700385602 + }, + "Component_[4820397163316962417]": { + "$type": "EditorEntityIconComponent", + "Id": 4820397163316962417 + }, + "Component_[5200514760734239788]": { + "$type": "EditorMaterialComponent", + "Id": 5200514760734239788, + "Controller": { + "Configuration": { + "materials": { + "{}": { + "MaterialAsset": { + "assetId": { + "guid": "{FA9D8842-95B2-5371-8352-CBEEEAABE676}" + }, + "assetHint": "levels/pbrmaterialchart/materials/basic_m10_r06.azmaterial" + } + } + } + } + }, + "materialSlotsByLodEnabled": true + }, + "Component_[5985506260224649992]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 5985506260224649992, + "Parent Entity": "Entity_[271574576285]", + "Transform Data": { + "Translate": [ + 11.999998092651367, + 0.0, + 0.0 + ] + } + }, + "Component_[7650403257628455609]": { + "$type": "EditorLockComponent", + "Id": 7650403257628455609 + } + } + }, + "Entity_[288754445469]": { + "Id": "Entity_[288754445469]", + "Name": "Ball07", + "Components": { + "Component_[11750162722213114821]": { + "$type": "SelectionComponent", + "Id": 11750162722213114821 + }, + "Component_[12608893098077724053]": { + "$type": "EditorEntitySortComponent", + "Id": 12608893098077724053 + }, + "Component_[13797422028724928908]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 13797422028724928908, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{61D16161-9F39-5A29-B927-ADF58E7E573B}", + "subId": 284780167 + }, + "assetHint": "objects/sphere.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[1492865274047869171]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1492865274047869171 + }, + "Component_[15252998008739701164]": { + "$type": "EditorVisibilityComponent", + "Id": 15252998008739701164 + }, + "Component_[15365333384879292339]": { + "$type": "EditorInspectorComponent", + "Id": 15365333384879292339, + "ComponentOrderEntryArray": [ + { + "ComponentId": 5985506260224649992 + }, + { + "ComponentId": 13797422028724928908, + "SortIndex": 1 + }, + { + "ComponentId": 5200514760734239788, + "SortIndex": 2 + } + ] + }, + "Component_[18296307565715962470]": { + "$type": "EditorPendingCompositionComponent", + "Id": 18296307565715962470 + }, + "Component_[1940145586700385602]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1940145586700385602 + }, + "Component_[4820397163316962417]": { + "$type": "EditorEntityIconComponent", + "Id": 4820397163316962417 + }, + "Component_[5200514760734239788]": { + "$type": "EditorMaterialComponent", + "Id": 5200514760734239788, + "Controller": { + "Configuration": { + "materials": { + "{}": { + "MaterialAsset": { + "assetId": { + "guid": "{522A9626-FF4C-561A-A44A-64B68F7274D2}" + }, + "assetHint": "levels/pbrmaterialchart/materials/basic_m10_r07.azmaterial" + } + } + } + } + }, + "materialSlotsByLodEnabled": true + }, + "Component_[5985506260224649992]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 5985506260224649992, + "Parent Entity": "Entity_[271574576285]", + "Transform Data": { + "Translate": [ + 13.99999713897705, + 0.0, + 0.0 + ] + } + }, + "Component_[7650403257628455609]": { + "$type": "EditorLockComponent", + "Id": 7650403257628455609 + } + } + }, + "Entity_[293049412765]": { + "Id": "Entity_[293049412765]", + "Name": "Ball00", + "Components": { + "Component_[11750162722213114821]": { + "$type": "SelectionComponent", + "Id": 11750162722213114821 + }, + "Component_[12608893098077724053]": { + "$type": "EditorEntitySortComponent", + "Id": 12608893098077724053 + }, + "Component_[13797422028724928908]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 13797422028724928908, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{61D16161-9F39-5A29-B927-ADF58E7E573B}", + "subId": 284780167 + }, + "assetHint": "objects/sphere.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[1492865274047869171]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1492865274047869171 + }, + "Component_[15252998008739701164]": { + "$type": "EditorVisibilityComponent", + "Id": 15252998008739701164 + }, + "Component_[15365333384879292339]": { + "$type": "EditorInspectorComponent", + "Id": 15365333384879292339, + "ComponentOrderEntryArray": [ + { + "ComponentId": 5985506260224649992 + }, + { + "ComponentId": 13797422028724928908, + "SortIndex": 1 + }, + { + "ComponentId": 5200514760734239788, + "SortIndex": 2 + } + ] + }, + "Component_[18296307565715962470]": { + "$type": "EditorPendingCompositionComponent", + "Id": 18296307565715962470 + }, + "Component_[1940145586700385602]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1940145586700385602 + }, + "Component_[4820397163316962417]": { + "$type": "EditorEntityIconComponent", + "Id": 4820397163316962417 + }, + "Component_[5200514760734239788]": { + "$type": "EditorMaterialComponent", + "Id": 5200514760734239788, + "Controller": { + "Configuration": { + "materials": { + "{}": { + "MaterialAsset": { + "assetId": { + "guid": "{06DDFD66-D7F5-5D55-8972-6D61276E88F6}" + }, + "assetHint": "levels/pbrmaterialchart/materials/basic_m10_r00.azmaterial" + } + } + } + } + }, + "materialSlotsByLodEnabled": true + }, + "Component_[5985506260224649992]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 5985506260224649992, + "Parent Entity": "Entity_[271574576285]" + }, + "Component_[7650403257628455609]": { + "$type": "EditorLockComponent", + "Id": 7650403257628455609 + } + } + }, + "Entity_[297344380061]": { + "Id": "Entity_[297344380061]", + "Name": "Ball08", + "Components": { + "Component_[11750162722213114821]": { + "$type": "SelectionComponent", + "Id": 11750162722213114821 + }, + "Component_[12608893098077724053]": { + "$type": "EditorEntitySortComponent", + "Id": 12608893098077724053 + }, + "Component_[13797422028724928908]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 13797422028724928908, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{61D16161-9F39-5A29-B927-ADF58E7E573B}", + "subId": 284780167 + }, + "assetHint": "objects/sphere.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[1492865274047869171]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1492865274047869171 + }, + "Component_[15252998008739701164]": { + "$type": "EditorVisibilityComponent", + "Id": 15252998008739701164 + }, + "Component_[15365333384879292339]": { + "$type": "EditorInspectorComponent", + "Id": 15365333384879292339, + "ComponentOrderEntryArray": [ + { + "ComponentId": 5985506260224649992 + }, + { + "ComponentId": 13797422028724928908, + "SortIndex": 1 + }, + { + "ComponentId": 5200514760734239788, + "SortIndex": 2 + } + ] + }, + "Component_[18296307565715962470]": { + "$type": "EditorPendingCompositionComponent", + "Id": 18296307565715962470 + }, + "Component_[1940145586700385602]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1940145586700385602 + }, + "Component_[4820397163316962417]": { + "$type": "EditorEntityIconComponent", + "Id": 4820397163316962417 + }, + "Component_[5200514760734239788]": { + "$type": "EditorMaterialComponent", + "Id": 5200514760734239788, + "Controller": { + "Configuration": { + "materials": { + "{}": { + "MaterialAsset": { + "assetId": { + "guid": "{060EF1B7-1029-5227-B03B-1415C74E9D65}" + }, + "assetHint": "levels/pbrmaterialchart/materials/basic_m10_r08.azmaterial" + } + } + } + } + }, + "materialSlotsByLodEnabled": true + }, + "Component_[5985506260224649992]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 5985506260224649992, + "Parent Entity": "Entity_[271574576285]", + "Transform Data": { + "Translate": [ + 15.99999713897705, + 0.0, + 0.0 + ] + } + }, + "Component_[7650403257628455609]": { + "$type": "EditorLockComponent", + "Id": 7650403257628455609 + } + } + }, + "Entity_[301639347357]": { + "Id": "Entity_[301639347357]", + "Name": "Ball01", + "Components": { + "Component_[11750162722213114821]": { + "$type": "SelectionComponent", + "Id": 11750162722213114821 + }, + "Component_[12608893098077724053]": { + "$type": "EditorEntitySortComponent", + "Id": 12608893098077724053 + }, + "Component_[13797422028724928908]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 13797422028724928908, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{61D16161-9F39-5A29-B927-ADF58E7E573B}", + "subId": 284780167 + }, + "assetHint": "objects/sphere.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[1492865274047869171]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1492865274047869171 + }, + "Component_[15252998008739701164]": { + "$type": "EditorVisibilityComponent", + "Id": 15252998008739701164 + }, + "Component_[15365333384879292339]": { + "$type": "EditorInspectorComponent", + "Id": 15365333384879292339, + "ComponentOrderEntryArray": [ + { + "ComponentId": 5985506260224649992 + }, + { + "ComponentId": 13797422028724928908, + "SortIndex": 1 + }, + { + "ComponentId": 5200514760734239788, + "SortIndex": 2 + } + ] + }, + "Component_[18296307565715962470]": { + "$type": "EditorPendingCompositionComponent", + "Id": 18296307565715962470 + }, + "Component_[1940145586700385602]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1940145586700385602 + }, + "Component_[4820397163316962417]": { + "$type": "EditorEntityIconComponent", + "Id": 4820397163316962417 + }, + "Component_[5200514760734239788]": { + "$type": "EditorMaterialComponent", + "Id": 5200514760734239788, + "Controller": { + "Configuration": { + "materials": { + "{}": { + "MaterialAsset": { + "assetId": { + "guid": "{7B7BC6F8-150A-518F-816E-2F7DBE786461}" + }, + "assetHint": "levels/pbrmaterialchart/materials/basic_m10_r01.azmaterial" + } + } + } + } + }, + "materialSlotsByLodEnabled": true + }, + "Component_[5985506260224649992]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 5985506260224649992, + "Parent Entity": "Entity_[271574576285]", + "Transform Data": { + "Translate": [ + 1.9999995231628418, + 0.0, + 0.0 + ] + } + }, + "Component_[7650403257628455609]": { + "$type": "EditorLockComponent", + "Id": 7650403257628455609 + } + } + }, + "Entity_[305934314653]": { + "Id": "Entity_[305934314653]", + "Name": "Ball09", + "Components": { + "Component_[11750162722213114821]": { + "$type": "SelectionComponent", + "Id": 11750162722213114821 + }, + "Component_[12608893098077724053]": { + "$type": "EditorEntitySortComponent", + "Id": 12608893098077724053 + }, + "Component_[13797422028724928908]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 13797422028724928908, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{61D16161-9F39-5A29-B927-ADF58E7E573B}", + "subId": 284780167 + }, + "assetHint": "objects/sphere.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[1492865274047869171]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1492865274047869171 + }, + "Component_[15252998008739701164]": { + "$type": "EditorVisibilityComponent", + "Id": 15252998008739701164 + }, + "Component_[15365333384879292339]": { + "$type": "EditorInspectorComponent", + "Id": 15365333384879292339, + "ComponentOrderEntryArray": [ + { + "ComponentId": 5985506260224649992 + }, + { + "ComponentId": 13797422028724928908, + "SortIndex": 1 + }, + { + "ComponentId": 5200514760734239788, + "SortIndex": 2 + } + ] + }, + "Component_[18296307565715962470]": { + "$type": "EditorPendingCompositionComponent", + "Id": 18296307565715962470 + }, + "Component_[1940145586700385602]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1940145586700385602 + }, + "Component_[4820397163316962417]": { + "$type": "EditorEntityIconComponent", + "Id": 4820397163316962417 + }, + "Component_[5200514760734239788]": { + "$type": "EditorMaterialComponent", + "Id": 5200514760734239788, + "Controller": { + "Configuration": { + "materials": { + "{}": { + "MaterialAsset": { + "assetId": { + "guid": "{270881B6-21E9-509D-A6CD-1046674FB0BE}" + }, + "assetHint": "levels/pbrmaterialchart/materials/basic_m10_r09.azmaterial" + } + } + } + } + }, + "materialSlotsByLodEnabled": true + }, + "Component_[5985506260224649992]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 5985506260224649992, + "Parent Entity": "Entity_[271574576285]", + "Transform Data": { + "Translate": [ + 17.999996185302734, + 0.0, + 0.0 + ] + } + }, + "Component_[7650403257628455609]": { + "$type": "EditorLockComponent", + "Id": 7650403257628455609 + } + } + }, + "Entity_[310229281949]": { + "Id": "Entity_[310229281949]", + "Name": "Ball02", + "Components": { + "Component_[11750162722213114821]": { + "$type": "SelectionComponent", + "Id": 11750162722213114821 + }, + "Component_[12608893098077724053]": { + "$type": "EditorEntitySortComponent", + "Id": 12608893098077724053 + }, + "Component_[13797422028724928908]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 13797422028724928908, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{61D16161-9F39-5A29-B927-ADF58E7E573B}", + "subId": 284780167 + }, + "assetHint": "objects/sphere.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[1492865274047869171]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1492865274047869171 + }, + "Component_[15252998008739701164]": { + "$type": "EditorVisibilityComponent", + "Id": 15252998008739701164 + }, + "Component_[15365333384879292339]": { + "$type": "EditorInspectorComponent", + "Id": 15365333384879292339, + "ComponentOrderEntryArray": [ + { + "ComponentId": 5985506260224649992 + }, + { + "ComponentId": 13797422028724928908, + "SortIndex": 1 + }, + { + "ComponentId": 5200514760734239788, + "SortIndex": 2 + } + ] + }, + "Component_[18296307565715962470]": { + "$type": "EditorPendingCompositionComponent", + "Id": 18296307565715962470 + }, + "Component_[1940145586700385602]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1940145586700385602 + }, + "Component_[4820397163316962417]": { + "$type": "EditorEntityIconComponent", + "Id": 4820397163316962417 + }, + "Component_[5200514760734239788]": { + "$type": "EditorMaterialComponent", + "Id": 5200514760734239788, + "Controller": { + "Configuration": { + "materials": { + "{}": { + "MaterialAsset": { + "assetId": { + "guid": "{C0538953-C56E-5C1A-BBE2-E6BE04764C20}" + }, + "assetHint": "levels/pbrmaterialchart/materials/basic_m10_r02.azmaterial" + } + } + } + } + }, + "materialSlotsByLodEnabled": true + }, + "Component_[5985506260224649992]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 5985506260224649992, + "Parent Entity": "Entity_[271574576285]", + "Transform Data": { + "Translate": [ + 3.9999992847442627, + 0.0, + 0.0 + ] + } + }, + "Component_[7650403257628455609]": { + "$type": "EditorLockComponent", + "Id": 7650403257628455609 + } + } + }, + "Entity_[311518247264]": { + "Id": "Entity_[311518247264]", + "Name": "PbrMaterialChart_Assets", + "Components": { + "Component_[10482364804718329021]": { + "$type": "EditorPendingCompositionComponent", + "Id": 10482364804718329021 + }, + "Component_[10942888141582930027]": { + "$type": "EditorLockComponent", + "Id": 10942888141582930027 + }, + "Component_[13540203629041536166]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 13540203629041536166, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Rotate": [ + 0.0, + 0.0, + -90.0 + ] + } + }, + "Component_[13907911826554124970]": { + "$type": "EditorEntityIconComponent", + "Id": 13907911826554124970 + }, + "Component_[14302898759905097452]": { + "$type": "EditorEntitySortComponent", + "Id": 14302898759905097452, + "Child Entity Order": [ + "Entity_[224935554679]", + "Entity_[323114183837]", + "Entity_[267279608989]", + "Entity_[271574576285]", + "Entity_[227116497304]", + "Entity_[1579029125278]" + ] + }, + "Component_[6734926751345496430]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6734926751345496430 + }, + "Component_[7859927512474268451]": { + "$type": "EditorInspectorComponent", + "Id": 7859927512474268451, + "ComponentOrderEntryArray": [ + { + "ComponentId": 13540203629041536166 + } + ] + }, + "Component_[8550690899908144218]": { + "$type": "SelectionComponent", + "Id": 8550690899908144218 + }, + "Component_[9251711315131563801]": { + "$type": "EditorVisibilityComponent", + "Id": 9251711315131563801 + }, + "Component_[9755014032434689168]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 9755014032434689168 + } + } + }, + "Entity_[314524249245]": { + "Id": "Entity_[314524249245]", + "Name": "Ball10", + "Components": { + "Component_[11750162722213114821]": { + "$type": "SelectionComponent", + "Id": 11750162722213114821 + }, + "Component_[12608893098077724053]": { + "$type": "EditorEntitySortComponent", + "Id": 12608893098077724053 + }, + "Component_[13797422028724928908]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 13797422028724928908, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{61D16161-9F39-5A29-B927-ADF58E7E573B}", + "subId": 284780167 + }, + "assetHint": "objects/sphere.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[1492865274047869171]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1492865274047869171 + }, + "Component_[15252998008739701164]": { + "$type": "EditorVisibilityComponent", + "Id": 15252998008739701164 + }, + "Component_[15365333384879292339]": { + "$type": "EditorInspectorComponent", + "Id": 15365333384879292339, + "ComponentOrderEntryArray": [ + { + "ComponentId": 5985506260224649992 + }, + { + "ComponentId": 13797422028724928908, + "SortIndex": 1 + }, + { + "ComponentId": 5200514760734239788, + "SortIndex": 2 + } + ] + }, + "Component_[18296307565715962470]": { + "$type": "EditorPendingCompositionComponent", + "Id": 18296307565715962470 + }, + "Component_[1940145586700385602]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1940145586700385602 + }, + "Component_[4820397163316962417]": { + "$type": "EditorEntityIconComponent", + "Id": 4820397163316962417 + }, + "Component_[5200514760734239788]": { + "$type": "EditorMaterialComponent", + "Id": 5200514760734239788, + "Controller": { + "Configuration": { + "materials": { + "{}": { + "MaterialAsset": { + "assetId": { + "guid": "{5EA26E09-E3D6-5181-8E7A-F2E98A24247C}" + }, + "assetHint": "levels/pbrmaterialchart/materials/basic_m10_r10.azmaterial" + } + } + } + } + }, + "materialSlotsByLodEnabled": true + }, + "Component_[5985506260224649992]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 5985506260224649992, + "Parent Entity": "Entity_[271574576285]", + "Transform Data": { + "Translate": [ + 19.999996185302734, + 0.0, + 0.0 + ] + } + }, + "Component_[7650403257628455609]": { + "$type": "EditorLockComponent", + "Id": 7650403257628455609 + } + } + }, + "Entity_[318819216541]": { + "Id": "Entity_[318819216541]", + "Name": "Ball03", + "Components": { + "Component_[11750162722213114821]": { + "$type": "SelectionComponent", + "Id": 11750162722213114821 + }, + "Component_[12608893098077724053]": { + "$type": "EditorEntitySortComponent", + "Id": 12608893098077724053 + }, + "Component_[13797422028724928908]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 13797422028724928908, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{61D16161-9F39-5A29-B927-ADF58E7E573B}", + "subId": 284780167 + }, + "assetHint": "objects/sphere.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[1492865274047869171]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1492865274047869171 + }, + "Component_[15252998008739701164]": { + "$type": "EditorVisibilityComponent", + "Id": 15252998008739701164 + }, + "Component_[15365333384879292339]": { + "$type": "EditorInspectorComponent", + "Id": 15365333384879292339, + "ComponentOrderEntryArray": [ + { + "ComponentId": 5985506260224649992 + }, + { + "ComponentId": 13797422028724928908, + "SortIndex": 1 + }, + { + "ComponentId": 5200514760734239788, + "SortIndex": 2 + } + ] + }, + "Component_[18296307565715962470]": { + "$type": "EditorPendingCompositionComponent", + "Id": 18296307565715962470 + }, + "Component_[1940145586700385602]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1940145586700385602 + }, + "Component_[4820397163316962417]": { + "$type": "EditorEntityIconComponent", + "Id": 4820397163316962417 + }, + "Component_[5200514760734239788]": { + "$type": "EditorMaterialComponent", + "Id": 5200514760734239788, + "Controller": { + "Configuration": { + "materials": { + "{}": { + "MaterialAsset": { + "assetId": { + "guid": "{E1A5D708-7A49-5CCA-81C3-4CB337C47703}" + }, + "assetHint": "levels/pbrmaterialchart/materials/basic_m10_r03.azmaterial" + } + } + } + } + }, + "materialSlotsByLodEnabled": true + }, + "Component_[5985506260224649992]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 5985506260224649992, + "Parent Entity": "Entity_[271574576285]", + "Transform Data": { + "Translate": [ + 5.999998569488525, + 0.0, + 0.0 + ] + } + }, + "Component_[7650403257628455609]": { + "$type": "EditorLockComponent", + "Id": 7650403257628455609 + } + } + }, + "Entity_[323114183837]": { + "Id": "Entity_[323114183837]", + "Name": "Camera1", + "Components": { + "Component_[10006292826835803540]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 10006292826835803540 + }, + "Component_[10455519191869797]": { + "$type": "EditorVisibilityComponent", + "Id": 10455519191869797 + }, + "Component_[11437375554946967375]": { + "$type": "EditorEntitySortComponent", + "Id": 11437375554946967375 + }, + "Component_[12353408053920436955]": { + "$type": "SelectionComponent", + "Id": 12353408053920436955 + }, + "Component_[13096751172875321905]": { + "$type": "EditorEntityIconComponent", + "Id": 13096751172875321905 + }, + "Component_[14346079281461734018]": { + "$type": "EditorLockComponent", + "Id": 14346079281461734018 + }, + "Component_[14601767610059792758]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14601767610059792758 + }, + "Component_[1752468310352442380]": { + "$type": "GenericComponentWrapper", + "Id": 1752468310352442380, + "m_template": { + "$type": "FlyCameraInputComponent" + } + }, + "Component_[18443771986481731838]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 18443771986481731838, + "Parent Entity": "Entity_[311518247264]", + "Transform Data": { + "Translate": [ + 49.97779846191406, + 0.013456299901008606, + -0.00310519989579916 + ], + "Rotate": [ + 0.0, + 0.0, + 90.00000762939453 + ], + "Scale": [ + 1.0, + 1.0, + 0.9999998807907104 + ] + } + }, + "Component_[646706054417436776]": { + "$type": "{CA11DA46-29FF-4083-B5F6-E02C3A8C3A3D} EditorCameraComponent", + "Id": 646706054417436776, + "Controller": { + "Configuration": { + "EditorEntityId": 323114183837 + } + } + }, + "Component_[8037556047509300929]": { + "$type": "EditorOnlyEntityComponent", + "Id": 8037556047509300929 + }, + "Component_[9357115853003317593]": { + "$type": "EditorInspectorComponent", + "Id": 9357115853003317593, + "ComponentOrderEntryArray": [ + { + "ComponentId": 18443771986481731838 + }, + { + "ComponentId": 646706054417436776, + "SortIndex": 1 + }, + { + "ComponentId": 1752468310352442380, + "SortIndex": 2 + } + ] + } + } + }, + "Entity_[439136298436]": { + "Id": "Entity_[439136298436]", + "Name": "Light", + "Components": { + "Component_[11029917022661117076]": { + "$type": "EditorSphereShapeComponent", + "Id": 11029917022661117076, + "ShapeColor": [ + 1.0, + 1.0, + 1.0, + 1.0 + ], + "SphereShape": { + "Configuration": { + "Radius": 0.05000000074505806 + } + } + }, + "Component_[12284008075844705430]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 12284008075844705430, + "Parent Entity": "Entity_[1579029125278]", + "Transform Data": { + "Translate": [ + -7.999996662139893, + 15.0, + 6.0 + ] + } + }, + "Component_[13457184847449496840]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13457184847449496840 + }, + "Component_[14431842353830635996]": { + "$type": "EditorLockComponent", + "Id": 14431842353830635996 + }, + "Component_[1473579476469110229]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1473579476469110229 + }, + "Component_[17008596888127953988]": { + "$type": "EditorEntitySortComponent", + "Id": 17008596888127953988 + }, + "Component_[17246196475221723560]": { + "$type": "EditorInspectorComponent", + "Id": 17246196475221723560, + "ComponentOrderEntryArray": [ + { + "ComponentId": 12284008075844705430 + }, + { + "ComponentId": 7864910209001174169, + "SortIndex": 1 + } + ] + }, + "Component_[18388752482036682870]": { + "$type": "EditorOnlyEntityComponent", + "Id": 18388752482036682870 + }, + "Component_[3917765902796274739]": { + "$type": "EditorEntityIconComponent", + "Id": 3917765902796274739 + }, + "Component_[4143676462074671972]": { + "$type": "AZ::Render::EditorAreaLightComponent", + "Id": 4143676462074671972, + "Controller": { + "Configuration": { + "LightType": 1, + "IntensityMode": 1, + "Intensity": 50.0, + "AttenuationRadius": 79.26654815673828 + } + } + }, + "Component_[4863305662794796025]": { + "$type": "EditorVisibilityComponent", + "Id": 4863305662794796025 + }, + "Component_[5902189275159544426]": { + "$type": "SelectionComponent", + "Id": 5902189275159544426 + } + } + }, + "Entity_[443431265732]": { + "Id": "Entity_[443431265732]", + "Name": "Light", + "Components": { + "Component_[12284008075844705430]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 12284008075844705430, + "Parent Entity": "Entity_[1579029125278]", + "Transform Data": { + "Translate": [ + -7.999996662139893, + -10.0, + -6.0 + ] + } + }, + "Component_[13457184847449496840]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13457184847449496840 + }, + "Component_[14431842353830635996]": { + "$type": "EditorLockComponent", + "Id": 14431842353830635996 + }, + "Component_[1473579476469110229]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1473579476469110229 + }, + "Component_[17008596888127953988]": { + "$type": "EditorEntitySortComponent", + "Id": 17008596888127953988 + }, + "Component_[17246196475221723560]": { + "$type": "EditorInspectorComponent", + "Id": 17246196475221723560, + "ComponentOrderEntryArray": [ + { + "ComponentId": 12284008075844705430 + }, + { + "ComponentId": 7864910209001174169, + "SortIndex": 1 + } + ] + }, + "Component_[18059889152590511471]": { + "$type": "EditorSphereShapeComponent", + "Id": 18059889152590511471, + "ShapeColor": [ + 1.0, + 1.0, + 1.0, + 1.0 + ], + "SphereShape": { + "Configuration": { + "Radius": 0.05000000074505806 + } + } + }, + "Component_[18388752482036682870]": { + "$type": "EditorOnlyEntityComponent", + "Id": 18388752482036682870 + }, + "Component_[3917765902796274739]": { + "$type": "EditorEntityIconComponent", + "Id": 3917765902796274739 + }, + "Component_[4143676462074671972]": { + "$type": "AZ::Render::EditorAreaLightComponent", + "Id": 4143676462074671972, + "Controller": { + "Configuration": { + "LightType": 1, + "IntensityMode": 1, + "Intensity": 50.0, + "AttenuationRadius": 79.26654815673828 + } + } + }, + "Component_[4863305662794796025]": { + "$type": "EditorVisibilityComponent", + "Id": 4863305662794796025 + }, + "Component_[5902189275159544426]": { + "$type": "SelectionComponent", + "Id": 5902189275159544426 + } + } + }, + "Entity_[447726233028]": { + "Id": "Entity_[447726233028]", + "Name": "Light", + "Components": { + "Component_[12284008075844705430]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 12284008075844705430, + "Parent Entity": "Entity_[1579029125278]", + "Transform Data": { + "Translate": [ + -7.999996662139893, + -15.0, + 6.0 + ] + } + }, + "Component_[13457184847449496840]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13457184847449496840 + }, + "Component_[14431842353830635996]": { + "$type": "EditorLockComponent", + "Id": 14431842353830635996 + }, + "Component_[1473579476469110229]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1473579476469110229 + }, + "Component_[17008596888127953988]": { + "$type": "EditorEntitySortComponent", + "Id": 17008596888127953988 + }, + "Component_[17246196475221723560]": { + "$type": "EditorInspectorComponent", + "Id": 17246196475221723560, + "ComponentOrderEntryArray": [ + { + "ComponentId": 12284008075844705430 + }, + { + "ComponentId": 7864910209001174169, + "SortIndex": 1 + } + ] + }, + "Component_[18388752482036682870]": { + "$type": "EditorOnlyEntityComponent", + "Id": 18388752482036682870 + }, + "Component_[3116905989016577951]": { + "$type": "EditorSphereShapeComponent", + "Id": 3116905989016577951, + "ShapeColor": [ + 1.0, + 1.0, + 1.0, + 1.0 + ], + "SphereShape": { + "Configuration": { + "Radius": 0.05000000074505806 + } + } + }, + "Component_[3917765902796274739]": { + "$type": "EditorEntityIconComponent", + "Id": 3917765902796274739 + }, + "Component_[4143676462074671972]": { + "$type": "AZ::Render::EditorAreaLightComponent", + "Id": 4143676462074671972, + "Controller": { + "Configuration": { + "LightType": 1, + "IntensityMode": 1, + "Intensity": 50.0, + "AttenuationRadius": 79.26654815673828 + } + } + }, + "Component_[4863305662794796025]": { + "$type": "EditorVisibilityComponent", + "Id": 4863305662794796025 + }, + "Component_[5902189275159544426]": { + "$type": "SelectionComponent", + "Id": 5902189275159544426 + } + } + }, + "Entity_[452021200324]": { + "Id": "Entity_[452021200324]", + "Name": "Light", + "Components": { + "Component_[11880996669921269387]": { + "$type": "EditorSphereShapeComponent", + "Id": 11880996669921269387, + "ShapeColor": [ + 1.0, + 1.0, + 1.0, + 1.0 + ], + "SphereShape": { + "Configuration": { + "Radius": 0.05000000074505806 + } + } + }, + "Component_[12284008075844705430]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 12284008075844705430, + "Parent Entity": "Entity_[1579029125278]", + "Transform Data": { + "Translate": [ + -7.999996662139893, + 12.0, + -6.0 + ] + } + }, + "Component_[13457184847449496840]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13457184847449496840 + }, + "Component_[14431842353830635996]": { + "$type": "EditorLockComponent", + "Id": 14431842353830635996 + }, + "Component_[1473579476469110229]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1473579476469110229 + }, + "Component_[17008596888127953988]": { + "$type": "EditorEntitySortComponent", + "Id": 17008596888127953988 + }, + "Component_[17246196475221723560]": { + "$type": "EditorInspectorComponent", + "Id": 17246196475221723560, + "ComponentOrderEntryArray": [ + { + "ComponentId": 12284008075844705430 + }, + { + "ComponentId": 7864910209001174169, + "SortIndex": 1 + } + ] + }, + "Component_[18388752482036682870]": { + "$type": "EditorOnlyEntityComponent", + "Id": 18388752482036682870 + }, + "Component_[3917765902796274739]": { + "$type": "EditorEntityIconComponent", + "Id": 3917765902796274739 + }, + "Component_[4143676462074671972]": { + "$type": "AZ::Render::EditorAreaLightComponent", + "Id": 4143676462074671972, + "Controller": { + "Configuration": { + "LightType": 1, + "IntensityMode": 1, + "Intensity": 50.0, + "AttenuationRadius": 79.26654815673828 + } + } + }, + "Component_[4863305662794796025]": { + "$type": "EditorVisibilityComponent", + "Id": 4863305662794796025 + }, + "Component_[5902189275159544426]": { + "$type": "SelectionComponent", + "Id": 5902189275159544426 + } + } + }, + "Entity_[456316167620]": { + "Id": "Entity_[456316167620]", + "Name": "Light", + "Components": { + "Component_[12284008075844705430]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 12284008075844705430, + "Parent Entity": "Entity_[1579029125278]", + "Transform Data": { + "Translate": [ + -7.999996662139893, + -15.0, + -6.0 + ] + } + }, + "Component_[13457184847449496840]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13457184847449496840 + }, + "Component_[14431842353830635996]": { + "$type": "EditorLockComponent", + "Id": 14431842353830635996 + }, + "Component_[1473579476469110229]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1473579476469110229 + }, + "Component_[15861630875009954708]": { + "$type": "EditorSphereShapeComponent", + "Id": 15861630875009954708, + "ShapeColor": [ + 1.0, + 1.0, + 1.0, + 1.0 + ], + "SphereShape": { + "Configuration": { + "Radius": 0.05000000074505806 + } + } + }, + "Component_[17008596888127953988]": { + "$type": "EditorEntitySortComponent", + "Id": 17008596888127953988 + }, + "Component_[17246196475221723560]": { + "$type": "EditorInspectorComponent", + "Id": 17246196475221723560, + "ComponentOrderEntryArray": [ + { + "ComponentId": 12284008075844705430 + }, + { + "ComponentId": 7864910209001174169, + "SortIndex": 1 + } + ] + }, + "Component_[18388752482036682870]": { + "$type": "EditorOnlyEntityComponent", + "Id": 18388752482036682870 + }, + "Component_[3917765902796274739]": { + "$type": "EditorEntityIconComponent", + "Id": 3917765902796274739 + }, + "Component_[4143676462074671972]": { + "$type": "AZ::Render::EditorAreaLightComponent", + "Id": 4143676462074671972, + "Controller": { + "Configuration": { + "LightType": 1, + "IntensityMode": 1, + "Intensity": 50.0, + "AttenuationRadius": 79.26654815673828 + } + } + }, + "Component_[4863305662794796025]": { + "$type": "EditorVisibilityComponent", + "Id": 4863305662794796025 + }, + "Component_[5902189275159544426]": { + "$type": "SelectionComponent", + "Id": 5902189275159544426 + } + } + }, + "Entity_[460611134916]": { + "Id": "Entity_[460611134916]", + "Name": "Light", + "Components": { + "Component_[12284008075844705430]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 12284008075844705430, + "Parent Entity": "Entity_[1579029125278]", + "Transform Data": { + "Translate": [ + -7.999996662139893, + 0.0, + -6.0 + ] + } + }, + "Component_[13457184847449496840]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13457184847449496840 + }, + "Component_[14431842353830635996]": { + "$type": "EditorLockComponent", + "Id": 14431842353830635996 + }, + "Component_[1473579476469110229]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1473579476469110229 + }, + "Component_[17008596888127953988]": { + "$type": "EditorEntitySortComponent", + "Id": 17008596888127953988 + }, + "Component_[17246196475221723560]": { + "$type": "EditorInspectorComponent", + "Id": 17246196475221723560, + "ComponentOrderEntryArray": [ + { + "ComponentId": 12284008075844705430 + }, + { + "ComponentId": 7864910209001174169, + "SortIndex": 1 + } + ] + }, + "Component_[18388752482036682870]": { + "$type": "EditorOnlyEntityComponent", + "Id": 18388752482036682870 + }, + "Component_[2667740107500775267]": { + "$type": "EditorSphereShapeComponent", + "Id": 2667740107500775267, + "ShapeColor": [ + 1.0, + 1.0, + 1.0, + 1.0 + ], + "SphereShape": { + "Configuration": { + "Radius": 0.05000000074505806 + } + } + }, + "Component_[3917765902796274739]": { + "$type": "EditorEntityIconComponent", + "Id": 3917765902796274739 + }, + "Component_[4143676462074671972]": { + "$type": "AZ::Render::EditorAreaLightComponent", + "Id": 4143676462074671972, + "Controller": { + "Configuration": { + "LightType": 1, + "IntensityMode": 1, + "Intensity": 50.0, + "AttenuationRadius": 79.26654815673828 + } + } + }, + "Component_[4863305662794796025]": { + "$type": "EditorVisibilityComponent", + "Id": 4863305662794796025 + }, + "Component_[5902189275159544426]": { + "$type": "SelectionComponent", + "Id": 5902189275159544426 + } + } + }, + "Entity_[464906102212]": { + "Id": "Entity_[464906102212]", + "Name": "Light", + "Components": { + "Component_[12284008075844705430]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 12284008075844705430, + "Parent Entity": "Entity_[1579029125278]", + "Transform Data": { + "Translate": [ + -7.999996662139893, + 5.0, + -6.0 + ] + } + }, + "Component_[13457184847449496840]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13457184847449496840 + }, + "Component_[14431842353830635996]": { + "$type": "EditorLockComponent", + "Id": 14431842353830635996 + }, + "Component_[1473579476469110229]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1473579476469110229 + }, + "Component_[17008596888127953988]": { + "$type": "EditorEntitySortComponent", + "Id": 17008596888127953988 + }, + "Component_[17246196475221723560]": { + "$type": "EditorInspectorComponent", + "Id": 17246196475221723560, + "ComponentOrderEntryArray": [ + { + "ComponentId": 12284008075844705430 + }, + { + "ComponentId": 7864910209001174169, + "SortIndex": 1 + } + ] + }, + "Component_[18388752482036682870]": { + "$type": "EditorOnlyEntityComponent", + "Id": 18388752482036682870 + }, + "Component_[3917765902796274739]": { + "$type": "EditorEntityIconComponent", + "Id": 3917765902796274739 + }, + "Component_[4143676462074671972]": { + "$type": "AZ::Render::EditorAreaLightComponent", + "Id": 4143676462074671972, + "Controller": { + "Configuration": { + "LightType": 1, + "IntensityMode": 1, + "Intensity": 50.0, + "AttenuationRadius": 79.26654815673828 + } + } + }, + "Component_[4863305662794796025]": { + "$type": "EditorVisibilityComponent", + "Id": 4863305662794796025 + }, + "Component_[5902189275159544426]": { + "$type": "SelectionComponent", + "Id": 5902189275159544426 + }, + "Component_[9077284412210882947]": { + "$type": "EditorSphereShapeComponent", + "Id": 9077284412210882947, + "ShapeColor": [ + 1.0, + 1.0, + 1.0, + 1.0 + ], + "SphereShape": { + "Configuration": { + "Radius": 0.05000000074505806 + } + } + } + } + }, + "Entity_[469201069508]": { + "Id": "Entity_[469201069508]", + "Name": "Light", + "Components": { + "Component_[12284008075844705430]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 12284008075844705430, + "Parent Entity": "Entity_[1579029125278]", + "Transform Data": { + "Translate": [ + -7.999996662139893, + -10.0, + 6.0 + ] + } + }, + "Component_[13457184847449496840]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13457184847449496840 + }, + "Component_[14431842353830635996]": { + "$type": "EditorLockComponent", + "Id": 14431842353830635996 + }, + "Component_[1473579476469110229]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1473579476469110229 + }, + "Component_[17008596888127953988]": { + "$type": "EditorEntitySortComponent", + "Id": 17008596888127953988 + }, + "Component_[17246196475221723560]": { + "$type": "EditorInspectorComponent", + "Id": 17246196475221723560, + "ComponentOrderEntryArray": [ + { + "ComponentId": 12284008075844705430 + }, + { + "ComponentId": 7864910209001174169, + "SortIndex": 1 + } + ] + }, + "Component_[18388752482036682870]": { + "$type": "EditorOnlyEntityComponent", + "Id": 18388752482036682870 + }, + "Component_[2210433037075578051]": { + "$type": "EditorSphereShapeComponent", + "Id": 2210433037075578051, + "ShapeColor": [ + 1.0, + 1.0, + 1.0, + 1.0 + ], + "SphereShape": { + "Configuration": { + "Radius": 0.05000000074505806 + } + } + }, + "Component_[3917765902796274739]": { + "$type": "EditorEntityIconComponent", + "Id": 3917765902796274739 + }, + "Component_[4143676462074671972]": { + "$type": "AZ::Render::EditorAreaLightComponent", + "Id": 4143676462074671972, + "Controller": { + "Configuration": { + "LightType": 1, + "IntensityMode": 1, + "Intensity": 50.0, + "AttenuationRadius": 79.26654815673828 + } + } + }, + "Component_[4863305662794796025]": { + "$type": "EditorVisibilityComponent", + "Id": 4863305662794796025 + }, + "Component_[5902189275159544426]": { + "$type": "SelectionComponent", + "Id": 5902189275159544426 + } + } + }, + "Entity_[473496036804]": { + "Id": "Entity_[473496036804]", + "Name": "Light", + "Components": { + "Component_[12284008075844705430]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 12284008075844705430, + "Parent Entity": "Entity_[1579029125278]", + "Transform Data": { + "Translate": [ + -7.999996662139893, + 5.0, + 6.0 + ] + } + }, + "Component_[12980894623939584115]": { + "$type": "EditorSphereShapeComponent", + "Id": 12980894623939584115, + "ShapeColor": [ + 1.0, + 1.0, + 1.0, + 1.0 + ], + "SphereShape": { + "Configuration": { + "Radius": 0.05000000074505806 + } + } + }, + "Component_[13457184847449496840]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13457184847449496840 + }, + "Component_[14431842353830635996]": { + "$type": "EditorLockComponent", + "Id": 14431842353830635996 + }, + "Component_[1473579476469110229]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1473579476469110229 + }, + "Component_[17008596888127953988]": { + "$type": "EditorEntitySortComponent", + "Id": 17008596888127953988 + }, + "Component_[17246196475221723560]": { + "$type": "EditorInspectorComponent", + "Id": 17246196475221723560, + "ComponentOrderEntryArray": [ + { + "ComponentId": 12284008075844705430 + }, + { + "ComponentId": 7864910209001174169, + "SortIndex": 1 + } + ] + }, + "Component_[18388752482036682870]": { + "$type": "EditorOnlyEntityComponent", + "Id": 18388752482036682870 + }, + "Component_[3917765902796274739]": { + "$type": "EditorEntityIconComponent", + "Id": 3917765902796274739 + }, + "Component_[4143676462074671972]": { + "$type": "AZ::Render::EditorAreaLightComponent", + "Id": 4143676462074671972, + "Controller": { + "Configuration": { + "LightType": 1, + "IntensityMode": 1, + "Intensity": 50.0, + "AttenuationRadius": 79.26654815673828 + } + } + }, + "Component_[4863305662794796025]": { + "$type": "EditorVisibilityComponent", + "Id": 4863305662794796025 + }, + "Component_[5902189275159544426]": { + "$type": "SelectionComponent", + "Id": 5902189275159544426 + } + } + }, + "Entity_[477791004100]": { + "Id": "Entity_[477791004100]", + "Name": "Light", + "Components": { + "Component_[12284008075844705430]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 12284008075844705430, + "Parent Entity": "Entity_[1579029125278]", + "Transform Data": { + "Translate": [ + -7.999996662139893, + 12.0, + 6.0 + ] + } + }, + "Component_[13457184847449496840]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13457184847449496840 + }, + "Component_[14431842353830635996]": { + "$type": "EditorLockComponent", + "Id": 14431842353830635996 + }, + "Component_[1473579476469110229]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1473579476469110229 + }, + "Component_[17008596888127953988]": { + "$type": "EditorEntitySortComponent", + "Id": 17008596888127953988 + }, + "Component_[17246196475221723560]": { + "$type": "EditorInspectorComponent", + "Id": 17246196475221723560, + "ComponentOrderEntryArray": [ + { + "ComponentId": 12284008075844705430 + }, + { + "ComponentId": 7864910209001174169, + "SortIndex": 1 + } + ] + }, + "Component_[18236955021241851736]": { + "$type": "EditorSphereShapeComponent", + "Id": 18236955021241851736, + "ShapeColor": [ + 1.0, + 1.0, + 1.0, + 1.0 + ], + "SphereShape": { + "Configuration": { + "Radius": 0.05000000074505806 + } + } + }, + "Component_[18388752482036682870]": { + "$type": "EditorOnlyEntityComponent", + "Id": 18388752482036682870 + }, + "Component_[3917765902796274739]": { + "$type": "EditorEntityIconComponent", + "Id": 3917765902796274739 + }, + "Component_[4143676462074671972]": { + "$type": "AZ::Render::EditorAreaLightComponent", + "Id": 4143676462074671972, + "Controller": { + "Configuration": { + "LightType": 1, + "IntensityMode": 1, + "Intensity": 50.0, + "AttenuationRadius": 79.26654815673828 + } + } + }, + "Component_[4863305662794796025]": { + "$type": "EditorVisibilityComponent", + "Id": 4863305662794796025 + }, + "Component_[5902189275159544426]": { + "$type": "SelectionComponent", + "Id": 5902189275159544426 + } + } + }, + "Entity_[482085971396]": { + "Id": "Entity_[482085971396]", + "Name": "Light", + "Components": { + "Component_[12284008075844705430]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 12284008075844705430, + "Parent Entity": "Entity_[1579029125278]", + "Transform Data": { + "Translate": [ + -7.999996662139893, + -5.0, + -6.0 + ] + } + }, + "Component_[13457184847449496840]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13457184847449496840 + }, + "Component_[14431842353830635996]": { + "$type": "EditorLockComponent", + "Id": 14431842353830635996 + }, + "Component_[1473579476469110229]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1473579476469110229 + }, + "Component_[17008596888127953988]": { + "$type": "EditorEntitySortComponent", + "Id": 17008596888127953988 + }, + "Component_[17246196475221723560]": { + "$type": "EditorInspectorComponent", + "Id": 17246196475221723560, + "ComponentOrderEntryArray": [ + { + "ComponentId": 12284008075844705430 + }, + { + "ComponentId": 7864910209001174169, + "SortIndex": 1 + } + ] + }, + "Component_[18388752482036682870]": { + "$type": "EditorOnlyEntityComponent", + "Id": 18388752482036682870 + }, + "Component_[3917765902796274739]": { + "$type": "EditorEntityIconComponent", + "Id": 3917765902796274739 + }, + "Component_[4143676462074671972]": { + "$type": "AZ::Render::EditorAreaLightComponent", + "Id": 4143676462074671972, + "Controller": { + "Configuration": { + "LightType": 1, + "IntensityMode": 1, + "Intensity": 50.0, + "AttenuationRadius": 79.26654815673828 + } + } + }, + "Component_[4863305662794796025]": { + "$type": "EditorVisibilityComponent", + "Id": 4863305662794796025 + }, + "Component_[5902189275159544426]": { + "$type": "SelectionComponent", + "Id": 5902189275159544426 + }, + "Component_[868225960524074909]": { + "$type": "EditorSphereShapeComponent", + "Id": 868225960524074909, + "ShapeColor": [ + 1.0, + 1.0, + 1.0, + 1.0 + ], + "SphereShape": { + "Configuration": { + "Radius": 0.05000000074505806 + } + } + } + } + }, + "Entity_[486380938692]": { + "Id": "Entity_[486380938692]", + "Name": "Light", + "Components": { + "Component_[12284008075844705430]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 12284008075844705430, + "Parent Entity": "Entity_[1579029125278]", + "Transform Data": { + "Translate": [ + -7.999996662139893, + 0.0, + 6.0 + ] + } + }, + "Component_[13457184847449496840]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13457184847449496840 + }, + "Component_[14431842353830635996]": { + "$type": "EditorLockComponent", + "Id": 14431842353830635996 + }, + "Component_[1473579476469110229]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1473579476469110229 + }, + "Component_[17008596888127953988]": { + "$type": "EditorEntitySortComponent", + "Id": 17008596888127953988 + }, + "Component_[17246196475221723560]": { + "$type": "EditorInspectorComponent", + "Id": 17246196475221723560, + "ComponentOrderEntryArray": [ + { + "ComponentId": 12284008075844705430 + }, + { + "ComponentId": 7864910209001174169, + "SortIndex": 1 + } + ] + }, + "Component_[18388752482036682870]": { + "$type": "EditorOnlyEntityComponent", + "Id": 18388752482036682870 + }, + "Component_[232169833717435589]": { + "$type": "EditorSphereShapeComponent", + "Id": 232169833717435589, + "ShapeColor": [ + 1.0, + 1.0, + 1.0, + 1.0 + ], + "SphereShape": { + "Configuration": { + "Radius": 0.05000000074505806 + } + } + }, + "Component_[3917765902796274739]": { + "$type": "EditorEntityIconComponent", + "Id": 3917765902796274739 + }, + "Component_[4143676462074671972]": { + "$type": "AZ::Render::EditorAreaLightComponent", + "Id": 4143676462074671972, + "Controller": { + "Configuration": { + "LightType": 1, + "IntensityMode": 1, + "Intensity": 50.0, + "AttenuationRadius": 79.26654815673828 + } + } + }, + "Component_[4863305662794796025]": { + "$type": "EditorVisibilityComponent", + "Id": 4863305662794796025 + }, + "Component_[5902189275159544426]": { + "$type": "SelectionComponent", + "Id": 5902189275159544426 + } + } + }, + "Entity_[490675905988]": { + "Id": "Entity_[490675905988]", + "Name": "Light", + "Components": { + "Component_[12284008075844705430]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 12284008075844705430, + "Parent Entity": "Entity_[1579029125278]", + "Transform Data": { + "Translate": [ + -7.999996662139893, + -5.0, + 6.0 + ] + } + }, + "Component_[13457184847449496840]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13457184847449496840 + }, + "Component_[14431842353830635996]": { + "$type": "EditorLockComponent", + "Id": 14431842353830635996 + }, + "Component_[1473579476469110229]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1473579476469110229 + }, + "Component_[17008596888127953988]": { + "$type": "EditorEntitySortComponent", + "Id": 17008596888127953988 + }, + "Component_[17246196475221723560]": { + "$type": "EditorInspectorComponent", + "Id": 17246196475221723560, + "ComponentOrderEntryArray": [ + { + "ComponentId": 12284008075844705430 + }, + { + "ComponentId": 7864910209001174169, + "SortIndex": 1 + } + ] + }, + "Component_[18055528880793132775]": { + "$type": "EditorSphereShapeComponent", + "Id": 18055528880793132775, + "ShapeColor": [ + 1.0, + 1.0, + 1.0, + 1.0 + ], + "SphereShape": { + "Configuration": { + "Radius": 0.05000000074505806 + } + } + }, + "Component_[18388752482036682870]": { + "$type": "EditorOnlyEntityComponent", + "Id": 18388752482036682870 + }, + "Component_[3917765902796274739]": { + "$type": "EditorEntityIconComponent", + "Id": 3917765902796274739 + }, + "Component_[4143676462074671972]": { + "$type": "AZ::Render::EditorAreaLightComponent", + "Id": 4143676462074671972, + "Controller": { + "Configuration": { + "LightType": 1, + "IntensityMode": 1, + "Intensity": 50.0, + "AttenuationRadius": 79.26654815673828 + } + } + }, + "Component_[4863305662794796025]": { + "$type": "EditorVisibilityComponent", + "Id": 4863305662794796025 + }, + "Component_[5902189275159544426]": { + "$type": "SelectionComponent", + "Id": 5902189275159544426 + } + } + }, + "Entity_[494970873284]": { + "Id": "Entity_[494970873284]", + "Name": "Light", + "Components": { + "Component_[12284008075844705430]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 12284008075844705430, + "Parent Entity": "Entity_[1579029125278]", + "Transform Data": { + "Translate": [ + -7.999996662139893, + 15.0, + -6.0 + ] + } + }, + "Component_[13457184847449496840]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13457184847449496840 + }, + "Component_[14431842353830635996]": { + "$type": "EditorLockComponent", + "Id": 14431842353830635996 + }, + "Component_[1473579476469110229]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1473579476469110229 + }, + "Component_[17008596888127953988]": { + "$type": "EditorEntitySortComponent", + "Id": 17008596888127953988 + }, + "Component_[17246196475221723560]": { + "$type": "EditorInspectorComponent", + "Id": 17246196475221723560, + "ComponentOrderEntryArray": [ + { + "ComponentId": 12284008075844705430 + }, + { + "ComponentId": 7864910209001174169, + "SortIndex": 1 + } + ] + }, + "Component_[18388752482036682870]": { + "$type": "EditorOnlyEntityComponent", + "Id": 18388752482036682870 + }, + "Component_[3917765902796274739]": { + "$type": "EditorEntityIconComponent", + "Id": 3917765902796274739 + }, + "Component_[4143676462074671972]": { + "$type": "AZ::Render::EditorAreaLightComponent", + "Id": 4143676462074671972, + "Controller": { + "Configuration": { + "LightType": 1, + "IntensityMode": 1, + "Intensity": 50.0, + "AttenuationRadius": 79.26654815673828 + } + } + }, + "Component_[4863305662794796025]": { + "$type": "EditorVisibilityComponent", + "Id": 4863305662794796025 + }, + "Component_[565296772593396698]": { + "$type": "EditorSphereShapeComponent", + "Id": 565296772593396698, + "ShapeColor": [ + 1.0, + 1.0, + 1.0, + 1.0 + ], + "SphereShape": { + "Configuration": { + "Radius": 0.05000000074505806 + } + } + }, + "Component_[5902189275159544426]": { + "$type": "SelectionComponent", + "Id": 5902189275159544426 + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic.material new file mode 100644 index 0000000000..32ac8dfd10 --- /dev/null +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic.material @@ -0,0 +1,32 @@ +{ + "materialType": "Materials/Types/StandardPBR.materialtype", + "propertyLayoutVersion": 1, + "properties": { + "baseColor": { + "color": [ 1.0, 1.0, 1.0 ], + "factor": 0.75, + "useTexture": false, + "textureMap": "" + }, + "metallic": { + "factor": 0.0, + "useTexture": false, + "textureMap": "" + }, + "roughness": { + "factor": 0.0, + "useTexture": false, + "textureMap": "" + }, + "specularF0": { + "factor": 0.5, + "useTexture": false, + "textureMap": "" + }, + "normal": { + "factor": 1.0, + "useTexture": false, + "textureMap": "" + } + } +} diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r00.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r00.material new file mode 100644 index 0000000000..dcadcb9bfe --- /dev/null +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r00.material @@ -0,0 +1,13 @@ +{ + "parentMaterial": "./basic.material", + "materialType": "materials/Types/StandardPBR.materialtype", + "propertyLayoutVersion": 1, + "properties": { + "metallic": { + "factor": 0.0 + }, + "roughness": { + "factor": 0.0 + } + } +} diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r01.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r01.material new file mode 100644 index 0000000000..0c2b3e62b3 --- /dev/null +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r01.material @@ -0,0 +1,13 @@ +{ + "parentMaterial": "./basic.material", + "materialType": "materials/Types/StandardPBR.materialtype", + "propertyLayoutVersion": 1, + "properties": { + "metallic": { + "factor": 0.0 + }, + "roughness": { + "factor": 0.1 + } + } +} diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r02.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r02.material new file mode 100644 index 0000000000..8d29890384 --- /dev/null +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r02.material @@ -0,0 +1,13 @@ +{ + "parentMaterial": "./basic.material", + "materialType": "materials/Types/StandardPBR.materialtype", + "propertyLayoutVersion": 1, + "properties": { + "metallic": { + "factor": 0.0 + }, + "roughness": { + "factor": 0.2 + } + } +} diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r03.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r03.material new file mode 100644 index 0000000000..bb9557241b --- /dev/null +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r03.material @@ -0,0 +1,13 @@ +{ + "parentMaterial": "./basic.material", + "materialType": "materials/Types/StandardPBR.materialtype", + "propertyLayoutVersion": 1, + "properties": { + "metallic": { + "factor": 0.0 + }, + "roughness": { + "factor": 0.3 + } + } +} diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r04.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r04.material new file mode 100644 index 0000000000..e14e2899fa --- /dev/null +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r04.material @@ -0,0 +1,13 @@ +{ + "parentMaterial": "./basic.material", + "materialType": "materials/Types/StandardPBR.materialtype", + "propertyLayoutVersion": 1, + "properties": { + "metallic": { + "factor": 0.0 + }, + "roughness": { + "factor": 0.4 + } + } +} diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r05.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r05.material new file mode 100644 index 0000000000..344ce084e5 --- /dev/null +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r05.material @@ -0,0 +1,13 @@ +{ + "parentMaterial": "./basic.material", + "materialType": "materials/Types/StandardPBR.materialtype", + "propertyLayoutVersion": 1, + "properties": { + "metallic": { + "factor": 0.0 + }, + "roughness": { + "factor": 0.5 + } + } +} diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r06.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r06.material new file mode 100644 index 0000000000..0f8195653f --- /dev/null +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r06.material @@ -0,0 +1,13 @@ +{ + "parentMaterial": "./basic.material", + "materialType": "materials/Types/StandardPBR.materialtype", + "propertyLayoutVersion": 1, + "properties": { + "metallic": { + "factor": 0.0 + }, + "roughness": { + "factor": 0.6 + } + } +} diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r07.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r07.material new file mode 100644 index 0000000000..d5d95ff285 --- /dev/null +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r07.material @@ -0,0 +1,13 @@ +{ + "parentMaterial": "./basic.material", + "materialType": "materials/Types/StandardPBR.materialtype", + "propertyLayoutVersion": 1, + "properties": { + "metallic": { + "factor": 0.0 + }, + "roughness": { + "factor": 0.7 + } + } +} diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r08.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r08.material new file mode 100644 index 0000000000..801b138831 --- /dev/null +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r08.material @@ -0,0 +1,13 @@ +{ + "parentMaterial": "./basic.material", + "materialType": "materials/Types/StandardPBR.materialtype", + "propertyLayoutVersion": 1, + "properties": { + "metallic": { + "factor": 0.0 + }, + "roughness": { + "factor": 0.8 + } + } +} diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r09.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r09.material new file mode 100644 index 0000000000..0710a320cb --- /dev/null +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r09.material @@ -0,0 +1,13 @@ +{ + "parentMaterial": "./basic.material", + "materialType": "materials/Types/StandardPBR.materialtype", + "propertyLayoutVersion": 1, + "properties": { + "metallic": { + "factor": 0.0 + }, + "roughness": { + "factor": 0.9 + } + } +} diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r10.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r10.material new file mode 100644 index 0000000000..d1cc781c61 --- /dev/null +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r10.material @@ -0,0 +1,13 @@ +{ + "parentMaterial": "./basic.material", + "materialType": "materials/Types/StandardPBR.materialtype", + "propertyLayoutVersion": 1, + "properties": { + "metallic": { + "factor": 0.0 + }, + "roughness": { + "factor": 1.0 + } + } +} diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r00.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r00.material new file mode 100644 index 0000000000..945cd1e9eb --- /dev/null +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r00.material @@ -0,0 +1,13 @@ +{ + "parentMaterial": "./basic.material", + "materialType": "materials/Types/StandardPBR.materialtype", + "propertyLayoutVersion": 1, + "properties": { + "metallic": { + "factor": 1.0 + }, + "roughness": { + "factor": 0.0 + } + } +} diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r01.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r01.material new file mode 100644 index 0000000000..85f6008782 --- /dev/null +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r01.material @@ -0,0 +1,13 @@ +{ + "parentMaterial": "./basic.material", + "materialType": "materials/Types/StandardPBR.materialtype", + "propertyLayoutVersion": 1, + "properties": { + "metallic": { + "factor": 1.0 + }, + "roughness": { + "factor": 0.1 + } + } +} diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r02.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r02.material new file mode 100644 index 0000000000..5abedc34e2 --- /dev/null +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r02.material @@ -0,0 +1,13 @@ +{ + "parentMaterial": "./basic.material", + "materialType": "materials/Types/StandardPBR.materialtype", + "propertyLayoutVersion": 1, + "properties": { + "metallic": { + "factor": 1.0 + }, + "roughness": { + "factor": 0.2 + } + } +} diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r03.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r03.material new file mode 100644 index 0000000000..50b37a647d --- /dev/null +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r03.material @@ -0,0 +1,13 @@ +{ + "parentMaterial": "./basic.material", + "materialType": "materials/Types/StandardPBR.materialtype", + "propertyLayoutVersion": 1, + "properties": { + "metallic": { + "factor": 1.0 + }, + "roughness": { + "factor": 0.3 + } + } +} diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r04.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r04.material new file mode 100644 index 0000000000..ad74ddf08b --- /dev/null +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r04.material @@ -0,0 +1,13 @@ +{ + "parentMaterial": "./basic.material", + "materialType": "materials/Types/StandardPBR.materialtype", + "propertyLayoutVersion": 1, + "properties": { + "metallic": { + "factor": 1.0 + }, + "roughness": { + "factor": 0.4 + } + } +} diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r05.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r05.material new file mode 100644 index 0000000000..f7f3260b97 --- /dev/null +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r05.material @@ -0,0 +1,13 @@ +{ + "parentMaterial": "./basic.material", + "materialType": "materials/Types/StandardPBR.materialtype", + "propertyLayoutVersion": 1, + "properties": { + "metallic": { + "factor": 1.0 + }, + "roughness": { + "factor": 0.5 + } + } +} diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r06.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r06.material new file mode 100644 index 0000000000..fc982f9c22 --- /dev/null +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r06.material @@ -0,0 +1,13 @@ +{ + "parentMaterial": "./basic.material", + "materialType": "materials/Types/StandardPBR.materialtype", + "propertyLayoutVersion": 1, + "properties": { + "metallic": { + "factor": 1.0 + }, + "roughness": { + "factor": 0.6 + } + } +} diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r07.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r07.material new file mode 100644 index 0000000000..c4526dfd2c --- /dev/null +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r07.material @@ -0,0 +1,13 @@ +{ + "parentMaterial": "./basic.material", + "materialType": "materials/Types/StandardPBR.materialtype", + "propertyLayoutVersion": 1, + "properties": { + "metallic": { + "factor": 1.0 + }, + "roughness": { + "factor": 0.7 + } + } +} diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r08.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r08.material new file mode 100644 index 0000000000..f756a36ded --- /dev/null +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r08.material @@ -0,0 +1,13 @@ +{ + "parentMaterial": "./basic.material", + "materialType": "materials/Types/StandardPBR.materialtype", + "propertyLayoutVersion": 1, + "properties": { + "metallic": { + "factor": 1.0 + }, + "roughness": { + "factor": 0.8 + } + } +} diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r09.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r09.material new file mode 100644 index 0000000000..a853979d6d --- /dev/null +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r09.material @@ -0,0 +1,13 @@ +{ + "parentMaterial": "./basic.material", + "materialType": "materials/Types/StandardPBR.materialtype", + "propertyLayoutVersion": 1, + "properties": { + "metallic": { + "factor": 1.0 + }, + "roughness": { + "factor": 0.9 + } + } +} diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r10.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r10.material new file mode 100644 index 0000000000..e4528d45fd --- /dev/null +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r10.material @@ -0,0 +1,13 @@ +{ + "parentMaterial": "./basic.material", + "materialType": "materials/Types/StandardPBR.materialtype", + "propertyLayoutVersion": 1, + "properties": { + "metallic": { + "factor": 1.0 + }, + "roughness": { + "factor": 1.0 + } + } +} diff --git a/AutomatedTesting/Levels/PbrMaterialChart/tags.txt b/AutomatedTesting/Levels/PbrMaterialChart/tags.txt new file mode 100644 index 0000000000..0d6c1880e7 --- /dev/null +++ b/AutomatedTesting/Levels/PbrMaterialChart/tags.txt @@ -0,0 +1,12 @@ +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 diff --git a/AutomatedTesting/Objects/sphere.fbx b/AutomatedTesting/Objects/sphere.fbx new file mode 100644 index 0000000000..5c8f550c8c --- /dev/null +++ b/AutomatedTesting/Objects/sphere.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a476e99b55cf2a76fef6775c5a57dad29f8ffcb942c625bab04c89051a72a560 +size 62626 From 0d66278ef7c466e6457fc8f5cb99ac020022becd Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 8 Dec 2021 13:44:15 -0800 Subject: [PATCH 026/948] Makes the recorded benchmark more stable Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzCore/AzCore/Memory/AllocatorBase.cpp | 23 ++- .../Memory/AllocatorBenchmarkRecordings.bin | 4 +- .../Tests/Memory/AllocatorBenchmarks.cpp | 180 +++++++++++------- 3 files changed, 132 insertions(+), 75 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp index 32ccd43f9a..48994c4eef 100644 --- a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp @@ -11,7 +11,7 @@ using namespace AZ; -#define RECORDING_ENABLED 1 +#define RECORDING_ENABLED 0 #if RECORDING_ENABLED @@ -44,18 +44,22 @@ namespace } }; - struct AllocatorOperation + #pragma pack(push, 1) + struct alignas(1) AllocatorOperation { - enum OperationType : unsigned int + enum OperationType : size_t { ALLOCATE, DEALLOCATE }; OperationType m_type: 1; - unsigned int m_size : 28; // Can represent up to 256Mb requests - unsigned int m_alignment : 7; // Can represent up to 128 alignment - unsigned int m_recordId : 28; // Can represent up to 256M simultaneous requests, we reuse ids + size_t m_size : 28; // Can represent up to 256Mb requests + size_t m_alignment : 7; // Can represent up to 128 alignment + size_t m_recordId : 28; // Can represent up to 256M simultaneous requests, we reuse ids }; + #pragma pack(pop) + static_assert(sizeof(AllocatorOperation) == 8); + static AZStd::mutex s_operationsMutex = {}; static constexpr size_t s_maxNumberOfAllocationsToRecord = 16384; @@ -76,7 +80,12 @@ namespace if (s_operationCounter == s_allocationOperationCount) { AZ::IO::SystemFile file; - file.Open("memoryrecordings.bin", AZ::IO::SystemFile::OpenMode::SF_OPEN_APPEND); + int mode = AZ::IO::SystemFile::OpenMode::SF_OPEN_APPEND | AZ::IO::SystemFile::OpenMode::SF_OPEN_WRITE_ONLY; + if (!file.Exists("memoryrecordings.bin")) + { + mode |= AZ::IO::SystemFile::OpenMode::SF_OPEN_CREATE; + } + file.Open("memoryrecordings.bin", mode); if (file.IsOpen()) { file.Write(&s_operations, sizeof(AllocatorOperation) * s_allocationOperationCount); diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarkRecordings.bin b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarkRecordings.bin index 2b587a2304..ec5de82e83 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarkRecordings.bin +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarkRecordings.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d0f148441ce120b303896618cec364b5afb6f8b911b4785ec6358cfe8467cf7a -size 368640 +oid sha256:281ba03e79ecba90b313a0b17bdba87c57d76b504b6e38d579b5eabd995902cc +size 245760 diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp index f5a728018c..aa1c7f21ab 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -390,115 +390,159 @@ namespace Benchmark } } }; - + template - class RecordedAllocationBenchmarkFixture : public AllocatorBenchmarkFixture + class RecordedAllocationBenchmarkFixture : public ::benchmark::Fixture { - using base = AllocatorBenchmarkFixture; - using TestAllocatorType = typename base::TestAllocatorType; + using TestAllocatorType = TestAllocatorWrapper; + + virtual void internalSetUp() + { + TestAllocatorType::SetUp(); + } + + void internalTearDown() + { + TestAllocatorType::TearDown(); + } - struct AllocatorOperation + #pragma pack(push, 1) + struct alignas(1) AllocatorOperation { - enum OperationType : unsigned int + enum OperationType : size_t { ALLOCATE, DEALLOCATE }; OperationType m_type : 1; - unsigned int m_size : 28; // Can represent up to 256Mb requests - unsigned int m_alignment : 7; // Can represent up to 128 alignment - unsigned int m_recordId : 28; // Can represent up to 256M simultaneous requests, we reuse ids + size_t m_size : 28; // Can represent up to 256Mb requests + size_t m_alignment : 7; // Can represent up to 128 alignment + size_t m_recordId : 28; // Can represent up to 256M simultaneous requests, we reuse ids }; + #pragma pack(pop) + static_assert(sizeof(AllocatorOperation) == 8); public: + void SetUp(const ::benchmark::State&) override + { + internalSetUp(); + } + void SetUp(::benchmark::State&) override + { + internalSetUp(); + } + + void TearDown(const ::benchmark::State&) override + { + internalTearDown(); + } + void TearDown(::benchmark::State&) override + { + internalTearDown(); + } + void Benchmark(benchmark::State& state) { for (auto _ : state) { state.PauseTiming(); - AZStd::unordered_map pointerRemapping; + AZStd::unordered_map pointerRemapping; constexpr size_t allocationOperationCount = 5 * 1024; AZStd::array m_operations = {}; + [[maybe_unused]] const size_t operationSize = sizeof(AllocatorOperation); - AZ::IO::SystemFile file; - AZ::IO::FixedMaxPathString filePath = AZ::Utils::GetExecutableDirectory(); - filePath += "/Tests/AzCore/Memory/AllocatorBenchmarkRecordings.bin"; - if (!file.Open(filePath.c_str(), AZ::IO::SystemFile::OpenMode::SF_OPEN_READ_ONLY)) - { - return; - } - size_t elementsRead = file.Read(sizeof(AllocatorOperation) * allocationOperationCount, &m_operations); - size_t totalElementsRead = elementsRead; const size_t processMemoryBaseline = Platform::GetProcessMemoryUsageBytes(); size_t totalAllocationSize = 0; + size_t itemsProcessed = 0; - while (elementsRead > 0) + for (size_t i = 0; i < 100; ++i) // replay the recording, this way we can keep a smaller recording { - for (size_t operationIndex = 0; operationIndex < elementsRead; ++operationIndex) + AZ::IO::SystemFile file; + AZ::IO::FixedMaxPathString filePath = AZ::Utils::GetExecutableDirectory(); + filePath += "/Tests/AzCore/Memory/AllocatorBenchmarkRecordings.bin"; + if (!file.Open(filePath.c_str(), AZ::IO::SystemFile::OpenMode::SF_OPEN_READ_ONLY)) { - const AllocatorOperation& operation = m_operations[operationIndex]; - if (operation.m_type == AllocatorOperation::ALLOCATE) - { - const auto it = pointerRemapping.emplace(operation.m_recordId, nullptr); - if (it.second) // otherwise already allocated - { - state.ResumeTiming(); - void* ptr = TestAllocatorType::Allocate(operation.m_size, operation.m_alignment); - state.PauseTiming(); - totalAllocationSize += operation.m_size; - it.first->second = ptr; - } - else - { - // Doing a resize, dont account for this memory change, this operation is rare and we dont have - // the size of the previous allocation - state.ResumeTiming(); - TestAllocatorType::Resize(it.first->second, operation.m_size); - state.PauseTiming(); - } - } - else // AllocatorOperation::DEALLOCATE: + return; + } + size_t elementsRead = + file.Read(sizeof(AllocatorOperation) * allocationOperationCount, &m_operations) / sizeof(AllocatorOperation); + itemsProcessed += elementsRead; + + while (elementsRead > 0) + { + for (size_t operationIndex = 0; operationIndex < elementsRead; ++operationIndex) { - if (operation.m_recordId) + const AllocatorOperation& operation = m_operations[operationIndex]; + if (operation.m_type == AllocatorOperation::ALLOCATE) { - const auto ptrIt = pointerRemapping.find(operation.m_recordId); - if (ptrIt != pointerRemapping.end()) + const auto it = pointerRemapping.emplace(operation.m_recordId, nullptr); + if (it.second) // otherwise already allocated + { + state.ResumeTiming(); + void* ptr = TestAllocatorType::Allocate(operation.m_size, operation.m_alignment); + state.PauseTiming(); + totalAllocationSize += operation.m_size; + it.first->second = ptr; + } + else { - totalAllocationSize -= operation.m_size; + // Doing a resize, dont account for this memory change, this operation is rare and we dont have + // the size of the previous allocation state.ResumeTiming(); - TestAllocatorType::DeAllocate(ptrIt->second, /*operation.m_size*/ 0); // size is not correct after a resize, a 0 size deals with it + TestAllocatorType::Resize(it.first->second, operation.m_size); state.PauseTiming(); - pointerRemapping.erase(ptrIt); } } - else // deallocate(nullptr) are recorded + else // AllocatorOperation::DEALLOCATE: { - // Just to account of the call of deallocate(nullptr); - state.ResumeTiming(); - TestAllocatorType::DeAllocate(nullptr, /*operation.m_size*/ 0); - state.PauseTiming(); + if (operation.m_recordId) + { + const auto ptrIt = pointerRemapping.find(operation.m_recordId); + if (ptrIt != pointerRemapping.end()) + { + totalAllocationSize -= operation.m_size; + state.ResumeTiming(); + TestAllocatorType::DeAllocate( + ptrIt->second, + /*operation.m_size*/ 0); // size is not correct after a resize, a 0 size deals with it + state.PauseTiming(); + pointerRemapping.erase(ptrIt); + } + } + else // deallocate(nullptr) are recorded + { + // Just to account of the call of deallocate(nullptr); + state.ResumeTiming(); + TestAllocatorType::DeAllocate(nullptr, /*operation.m_size*/ 0); + state.PauseTiming(); + } } } + + elementsRead = + file.Read(sizeof(AllocatorOperation) * allocationOperationCount, &m_operations) / sizeof(AllocatorOperation); + itemsProcessed += elementsRead; } + file.Close(); - elementsRead = file.Read(sizeof(AllocatorOperation) * allocationOperationCount, &m_operations); - totalElementsRead += elementsRead; + // Deallocate the remainder (since we stopped the recording middle-game)(there are leaks as well) + for (const auto& pointerMapping : pointerRemapping) + { + state.ResumeTiming(); + TestAllocatorType::DeAllocate(pointerMapping.second); + state.PauseTiming(); + } + itemsProcessed += pointerRemapping.size(); + pointerRemapping.clear(); } - file.Close(); state.counters[s_counterAllocatorMemory] = benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); state.counters[s_counterProcessMemory] = benchmark::Counter(static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), benchmark::Counter::kDefaults); state.counters[s_counterBenchmarkMemory] = benchmark::Counter(static_cast(totalAllocationSize), benchmark::Counter::kDefaults); - state.SetItemsProcessed(totalElementsRead); + state.SetItemsProcessed(itemsProcessed); - // Deallocate the remainder (since we stopped the recording middle-game)(there are leaks as well) - for (const auto& pointerMapping : pointerRemapping) - { - TestAllocatorType::DeAllocate(pointerMapping.second); - } - pointerRemapping.clear(); TestAllocatorType::GarbageCollect(); } } @@ -514,8 +558,7 @@ namespace Benchmark } static void RecordedRunRanges(benchmark::internal::Benchmark* b) { - b->Arg(1); - b->Iterations(100); + b->Iterations(1); } // For threaded ranges, run just 200, multi-threaded will already multiply by thread @@ -547,6 +590,11 @@ namespace Benchmark BM_REGISTER_TEMPLATE(RecordedAllocationBenchmarkFixture, TESTNAME, ALLOCATORTYPE)->Apply(RecordedRunRanges); \ } + /// Warm up benchmark used to prepare the OS for allocations. Most OS keep allocations for a process somehow + /// reserved. So the first allocations run always get a bigger impact in a process. This warm up allocator runs + /// all the benchmarks and is just used for the the next allocators to report more consistent results. + BM_REGISTER_ALLOCATOR(WarmUpAllocator, TestRawMallocAllocator); + BM_REGISTER_ALLOCATOR(RawMallocAllocator, TestRawMallocAllocator); BM_REGISTER_ALLOCATOR(MallocSchemaAllocator, TestMallocSchemaAllocator); BM_REGISTER_ALLOCATOR(HphaSchemaAllocator, TestHphaSchemaAllocator); From f36255b22ad0115c2cd86b184ff9f8518419857e Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Wed, 8 Dec 2021 13:57:24 -0800 Subject: [PATCH 027/948] Initial value implementation Signed-off-by: Nicholas Van Sickle --- .../AzCore/AzCore/DOM/DomDocument.cpp | 0 .../Framework/AzCore/AzCore/DOM/DomDocument.h | 0 Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 747 ++++++++++++++++++ Code/Framework/AzCore/AzCore/DOM/DomValue.h | 289 +++++++ .../AzCore/AzCore/azcore_files.cmake | 4 + 5 files changed, 1040 insertions(+) create mode 100644 Code/Framework/AzCore/AzCore/DOM/DomDocument.cpp create mode 100644 Code/Framework/AzCore/AzCore/DOM/DomDocument.h create mode 100644 Code/Framework/AzCore/AzCore/DOM/DomValue.cpp create mode 100644 Code/Framework/AzCore/AzCore/DOM/DomValue.h diff --git a/Code/Framework/AzCore/AzCore/DOM/DomDocument.cpp b/Code/Framework/AzCore/AzCore/DOM/DomDocument.cpp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Code/Framework/AzCore/AzCore/DOM/DomDocument.h b/Code/Framework/AzCore/AzCore/DOM/DomDocument.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp new file mode 100644 index 0000000000..ad6e648620 --- /dev/null +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -0,0 +1,747 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * 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::Dom +{ + template + AZStd::shared_ptr& CheckCopyOnWrite(AZStd::shared_ptr& refCountedPointer) + { + if (refCountedPointer.use_count() > 1) + { + AZStd::shared_ptr newPointer = AZStd::make_shared(); + *newPointer = *refCountedPointer; + refCountedPointer = AZStd::move(newPointer); + } + return refCountedPointer; + } + + AZ::Name Node::GetName() const + { + return m_name; + } + + void Node::SetName(AZ::Name name) + { + m_name = name; + } + + ObjectPtr Node::GetMutableProperties() + { + CheckCopyOnWrite(m_object); + return m_object; + } + + ConstObjectPtr Node::GetProperties() const + { + return m_object; + } + + ArrayPtr Node::GetMutableChildren() + { + CheckCopyOnWrite(m_array); + return m_array; + } + + ConstArrayPtr Node::GetChildren() const + { + return m_array; + } + + bool Node::operator==(const Node& rhs) const + { + return m_name == rhs.m_name && m_array == rhs.m_array && m_object == rhs.m_object; + } + + Value::Value() + { + } + + Value::Value(const Value& value) + : m_value(value.m_value) + { + } + + Value::Value(Value&& value) noexcept + : m_value(value.m_value) + { + } + + Value::Value(AZStd::string_view string, bool copy) + { + if (copy) + { + CopyFromString(string); + } + else + { + SetString(string); + } + } + + Value::Value(AZStd::any* value) + : m_value(value) + { + } + + Value Value::FromOpaqueValue(AZStd::any& value) + { + return Value(&value); + } + + Value::Value(int64_t value) + : m_value(value) + { + } + + Value::Value(uint64_t value) + : m_value(value) + { + } + + Value::Value(double value) + : m_value(value) + { + } + + Value::Value(bool value) + : m_value(value) + { + } + + Value& Value::operator=(const Value& other) + { + m_value = other.m_value; + return *this; + } + + Value& Value::operator=(Value&& other) noexcept + { + m_value = other.m_value; + return *this; + } + + bool Value::operator==(const Value& rhs) const + { + if (IsString() && rhs.IsString()) + { + return GetString() == rhs.GetString(); + } + else if (IsNumber() && rhs.IsNumber()) + { + if (IsInt()) + { + return GetInt() == rhs.GetInt(); + } + else if (IsUint()) + { + return GetUint() == rhs.GetUint(); + } + else + { + return GetDouble() == rhs.GetDouble(); + } + } + else + { + return m_value == rhs.m_value; + } + } + + bool Value::operator!=(const Value& rhs) const + { + return !operator==(rhs); + } + + void Value::Swap(Value& other) noexcept + { + AZStd::swap(m_value, other.m_value); + } + + Type Dom::Value::GetType() const + { + switch (m_value.index()) + { + case 0: // AZStd::monostate + return Type::NullType; + case 1: // int64_t + case 2: // uint64_t + case 3: // double + return Type::NumberType; + case 4: // bool + return AZStd::get(m_value) ? Type::TrueType : Type::FalseType; + case 5: // AZStd::string_view + case 6: // AZStd::shared_ptr + return Type::StringType; + case 7: // ObjectPtr + return Type::ObjectType; + case 8: // ArrayPtr + return Type::ArrayType; + case 9: // Node + return Type::NodeType; + case 10: // AZStd::any* + return Type::OpaqueType; + } + AZ_Assert(false, "AZ::Dom::Value::GetType: m_value has an unexpected type"); + return Type::NullType; + } + + bool Value::IsNull() const + { + return GetType() == Type::NullType; + } + + bool Value::IsFalse() const + { + return GetType() == Type::FalseType; + } + + bool Value::IsTrue() const + { + return GetType() == Type::TrueType; + } + + bool Value::IsBool() const + { + return AZStd::holds_alternative(m_value); + } + + bool Value::IsNode() const + { + return GetType() == Type::NodeType; + } + + bool Value::IsObject() const + { + return GetType() == Type::ObjectType; + } + + bool Value::IsArray() const + { + return GetType() == Type::ArrayType; + } + + bool Value::IsOpaqueValue() const + { + return GetType() == Type::OpaqueType; + } + + bool Value::IsNumber() const + { + return GetType() == Type::NumberType; + } + + bool Value::IsInt() const + { + return AZStd::holds_alternative(m_value); + } + + bool Value::IsUint() const + { + return AZStd::holds_alternative(m_value); + } + + bool Value::IsDouble() const + { + return AZStd::holds_alternative(m_value); + } + + bool Value::IsString() const + { + return GetType() == Type::StringType; + } + + Value& Value::SetObject() + { + m_value = AZStd::make_shared(); + return *this; + } + + const Object::ContainerType& Value::GetObjectInternal() const + { + const Type type = GetType(); + AZ_Assert( + type == Type::ObjectType || type == Type::NodeType, "AZ::Dom::Value: attempted to retrieve an object from a non-object value"); + if (type == Type::ObjectType) + { + return AZStd::get(m_value)->m_values; + } + else + { + return AZStd::get(m_value).GetProperties()->m_values; + } + } + + Object::ContainerType& Value::GetObjectInternal() + { + const Type type = GetType(); + AZ_Assert( + type == Type::ObjectType || type == Type::NodeType, "AZ::Dom::Value: attempted to retrieve an object from a non-object value"); + if (type == Type::ObjectType) + { + return CheckCopyOnWrite(AZStd::get(m_value))->m_values; + } + else + { + return AZStd::get(m_value).GetMutableProperties()->m_values; + } + } + + const Array::ContainerType& Value::GetArrayInternal() const + { + const Type type = GetType(); + AZ_Assert( + type == Type::ArrayType || type == Type::NodeType, "AZ::Dom::Value: attempted to retrieve an array from a non-array value"); + if (type == Type::ObjectType) + { + return AZStd::get(m_value)->m_values; + } + else + { + return AZStd::get(m_value).GetChildren()->m_values; + } + } + + Array::ContainerType& Value::GetArrayInternal() + { + const Type type = GetType(); + AZ_Assert( + type == Type::ArrayType || type == Type::NodeType, "AZ::Dom::Value: attempted to retrieve an array from a non-array value"); + if (type == Type::ObjectType) + { + return CheckCopyOnWrite(AZStd::get(m_value))->m_values; + } + else + { + return AZStd::get(m_value).GetMutableChildren()->m_values; + } + } + + size_t Value::MemberCount() const + { + return GetObjectInternal().size(); + } + + size_t Value::MemberCapacity() const + { + return GetObjectInternal().size(); + } + + bool Value::ObjectEmpty() const + { + return GetObjectInternal().empty(); + } + + Value& Value::operator[](KeyType name) + { + return FindMember(name)->second; + } + + const Value& Value::operator[](KeyType name) const + { + return FindMember(name)->second; + } + + Value& Value::operator[](AZStd::string_view name) + { + return operator[](AZ::Name(name)); + } + + const Value& Value::operator[](AZStd::string_view name) const + { + return operator[](AZ::Name(name)); + } + + Object::ConstIterator Value::MemberBegin() const + { + return GetObjectInternal().begin(); + } + + Object::ConstIterator Value::MemberEnd() const + { + return GetObjectInternal().end(); + } + + Object::Iterator Value::MemberBegin() + { + return GetObjectInternal().begin(); + } + + Object::Iterator Value::MemberEnd() + { + return GetObjectInternal().end(); + } + + Object::ConstIterator Value::FindMember(KeyType name) const + { + const Object::ContainerType& object = GetObjectInternal(); + return AZStd::find_if( + object.begin(), object.end(), + [&name](const Object::EntryType& entry) + { + return entry.first == name; + }); + } + + Object::ConstIterator Value::FindMember(AZStd::string_view name) const + { + return FindMember(AZ::Name(name)); + } + + Object::Iterator Value::FindMember(KeyType name) + { + Object::ContainerType& object = GetObjectInternal(); + return AZStd::find_if( + object.begin(), object.end(), + [&name](const Object::EntryType& entry) + { + return entry.first == name; + }); + } + + Object::Iterator Value::FindMember(AZStd::string_view name) + { + return FindMember(AZ::Name(name)); + } + + Value& Value::MemberReserve(size_t newCapacity) + { + GetObjectInternal().reserve(newCapacity); + return *this; + } + + bool Value::HasMember(KeyType name) const + { + return FindMember(name) != GetObjectInternal().end(); + } + + bool Value::HasMember(AZStd::string_view name) const + { + return HasMember(AZ::Name(name)); + } + + Value& Value::AddMember(KeyType name, const Value& value) + { + Object::ContainerType& object = GetObjectInternal(); + if (auto memberIt = FindMember(name); memberIt != object.end()) + { + memberIt->second = value; + } + else + { + object.emplace_back(name, value); + } + return *this; + } + + Value& Value::AddMember(AZStd::string_view name, const Value& value) + { + return AddMember(AZ::Name(name), value); + } + + Value& Value::AddMember(AZ::Name name, Value&& value) + { + Object::ContainerType& object = GetObjectInternal(); + if (auto memberIt = FindMember(name); memberIt != object.end()) + { + memberIt->second = value; + } + else + { + object.emplace_back(name, value); + } + return *this; + } + + Value& Value::AddMember(AZStd::string_view name, Value&& value) + { + return AddMember(AZ::Name(name), value); + } + + void Value::RemoveAllMembers() + { + GetObjectInternal().clear(); + } + + void Value::RemoveMember(KeyType name) + { + Object::ContainerType& object = GetObjectInternal(); + object.erase(AZStd::remove_if( + object.begin(), object.end(), + [&name](const Object::EntryType& entry) + { + return entry.first == name; + })); + } + + void Value::RemoveMember(AZStd::string_view name) + { + RemoveMember(AZ::Name(name)); + } + + Object::Iterator Value::RemoveMember(Object::Iterator pos) + { + Object::ContainerType& object = GetObjectInternal(); + Object::Iterator nextIndex = object.end(); + auto lastEntry = object.end() - 1; + if (pos != lastEntry) + { + AZStd::swap(*pos, *lastEntry); + nextIndex = pos; + } + object.resize(object.size() - 1); + return nextIndex; + } + + Object::Iterator Value::EraseMember(Object::ConstIterator pos) + { + return GetObjectInternal().erase(pos); + } + + Object::Iterator Value::EraseMember(Object::ConstIterator first, Object::ConstIterator last) + { + return GetObjectInternal().erase(first, last); + } + + Object::Iterator Value::EraseMember(KeyType name) + { + return GetObjectInternal().erase(FindMember(name)); + } + + Object::Iterator Value::EraseMember(AZStd::string_view name) + { + return EraseMember(AZ::Name(name)); + } + + Object::ContainerType& Value::GetObject() + { + return GetObjectInternal(); + } + + const Object::ContainerType& Value::GetObject() const + { + return GetObjectInternal(); + } + + Value& Value::SetArray() + { + m_value = AZStd::make_shared(); + return *this; + } + + size_t Value::Size() const + { + return GetArrayInternal().size(); + } + + size_t Value::Capacity() const + { + return GetArrayInternal().capacity(); + } + + bool Value::Empty() const + { + return GetArrayInternal().empty(); + } + + void Value::Clear() + { + GetArrayInternal().clear(); + } + + Value& Value::operator[](size_t index) + { + return GetArrayInternal()[index]; + } + + const Value& Value::operator[](size_t index) const + { + return GetArrayInternal()[index]; + } + + Array::ConstIterator Value::Begin() const + { + return GetArrayInternal().begin(); + } + + Array::ConstIterator Value::End() const + { + return GetArrayInternal().end(); + } + + Array::Iterator Value::Begin() + { + return GetArrayInternal().begin(); + } + + Array::Iterator Value::End() + { + return GetArrayInternal().end(); + } + + Value& Value::Reserve(size_t newCapacity) + { + GetArrayInternal().reserve(newCapacity); + return *this; + } + + Value& Value::PushBack(Value value) + { + GetArrayInternal().push_back(AZStd::move(value)); + return *this; + } + + Value& Value::PopBack() + { + GetArrayInternal().pop_back(); + return *this; + } + + Array::Iterator Value::Erase(Array::ConstIterator pos) + { + return GetArrayInternal().erase(pos); + } + + Array::Iterator Value::Erase(Array::ConstIterator first, Array::ConstIterator last) + { + return GetArrayInternal().erase(first, last); + } + + Array::ContainerType& Value::GetArray() + { + return GetArrayInternal(); + } + + const Array::ContainerType& Value::GetArray() const + { + return GetArrayInternal(); + } + + int64_t Value::GetInt() const + { + switch (m_value.index()) + { + case 1: // int64_t + return AZStd::get(m_value); + case 2: // uint64_t + return aznumeric_cast(AZStd::get(m_value)); + case 3: // double + return aznumeric_cast(AZStd::get(m_value)); + } + AZ_Assert(false, "AZ::Dom::Value: Called GetInt on a non-numeric type"); + return {}; + } + + void Value::SetInt(int64_t value) + { + m_value = value; + } + + uint64_t Value::GetUint() const + { + switch (m_value.index()) + { + case 1: // int64_t + return aznumeric_cast(AZStd::get(m_value)); + case 2: // uint64_t + return AZStd::get(m_value); + case 3: // double + return aznumeric_cast(AZStd::get(m_value)); + } + AZ_Assert(false, "AZ::Dom::Value: Called GetInt on a non-numeric type"); + return {}; + } + + void Value::SetUint(uint64_t value) + { + m_value = value; + } + + bool Value::GetBool() const + { + if (IsBool()) + { + return AZStd::get(m_value); + } + AZ_Assert(false, "AZ::Dom::Value: Called GetBool on a non-bool type"); + return {}; + } + + void Value::SetBool(bool value) + { + m_value = value; + } + + double Value::GetDouble() const + { + switch (m_value.index()) + { + case 1: // int64_t + return aznumeric_cast(AZStd::get(m_value)); + case 2: // uint64_t + return aznumeric_cast(AZStd::get(m_value)); + case 3: // double + return AZStd::get(m_value); + } + AZ_Assert(false, "AZ::Dom::Value: Called GetInt on a non-numeric type"); + return {}; + } + + void Value::SetDouble(double value) + { + m_value = value; + } + + AZStd::string_view Value::GetString() const + { + switch (m_value.index()) + { + case 5: // AZStd::string_view + return AZStd::get(m_value); + case 6: // AZStd::shared_ptr + return *AZStd::get>(m_value); + } + AZ_Assert(false, "AZ::Dom::Value: Called GetString on a non-string type"); + return {}; + } + + size_t Value::GetStringLength() const + { + return GetString().size(); + } + + void Value::SetString(AZStd::string_view value) + { + m_value = value; + } + + void Value::CopyFromString(AZStd::string_view value) + { + m_value = AZStd::make_shared(value); + } + + AZStd::any& Value::GetOpaqueValue() const + { + return *AZStd::get(m_value); + } + + void Value::SetOpaqueValue(AZStd::any& value) + { + m_value = &value; + } + + void Value::SetNull() + { + m_value = AZStd::monostate(); + } +} // namespace AZ::Dom diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h new file mode 100644 index 0000000000..f73dbb2549 --- /dev/null +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -0,0 +1,289 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include + +#include +#include +#include +#include +#include + +namespace AZ::Dom +{ + using KeyType = AZ::Name; + + enum class Type + { + NullType = 0, + FalseType = 1, + TrueType = 2, + ObjectType = 3, + ArrayType = 4, + StringType = 5, + NumberType = 6, + NodeType = 7, + OpaqueType = 8, + }; + + class Value; + + class Array + { + public: + using ContainerType = AZStd::vector; + using Iterator = ContainerType::iterator; + using ConstIterator = ContainerType::const_iterator; + + private: + ContainerType m_values; + + friend class Value; + }; + + using ArrayPtr = AZStd::shared_ptr; + using ConstArrayPtr = AZStd::shared_ptr; + + class Object + { + public: + using EntryType = AZStd::pair; + using ContainerType = AZStd::vector; + using Iterator = ContainerType::iterator; + using ConstIterator = ContainerType::const_iterator; + + private: + ContainerType m_values; + + friend class Value; + }; + + using ObjectPtr = AZStd::shared_ptr; + using ConstObjectPtr = AZStd::shared_ptr; + + class Node + { + public: + AZ::Name GetName() const; + void SetName(AZ::Name name); + + ObjectPtr GetMutableProperties(); + ConstObjectPtr GetProperties() const; + + ArrayPtr GetMutableChildren(); + ConstArrayPtr GetChildren() const; + + bool operator==(const Node& rhs) const; + + private: + AZ::Name m_name; + ArrayPtr m_array; + ObjectPtr m_object; + + friend class Value; + }; + + class Value + { + public: + // Constructors... + Value(); + Value(const Value&); + Value(Value&&) noexcept; + Value(AZStd::string_view string, bool copy); + + explicit Value(int64_t value); + explicit Value(uint64_t value); + explicit Value(double value); + explicit Value(bool value); + + static Value FromOpaqueValue(AZStd::any& value); + + // Equality / comparison / swap... + Value& operator=(const Value&); + Value& operator=(Value&&) noexcept; + + bool operator==(const Value& rhs) const; + bool operator!=(const Value& rhs) const; + + void Swap(Value& other) noexcept; + + // Type info... + Type GetType() const; + bool IsNull() const; + bool IsFalse() const; + bool IsTrue() const; + bool IsBool() const; + bool IsNode() const; + bool IsObject() const; + bool IsArray() const; + bool IsOpaqueValue() const; + bool IsNumber() const; + bool IsInt() const; + bool IsUint() const; + bool IsDouble() const; + bool IsString() const; + + // Object API (also used by Node)... + Value& SetObject(); + size_t MemberCount() const; + size_t MemberCapacity() const; + bool ObjectEmpty() const; + + Value& operator[](KeyType name); + const Value& operator[](KeyType name) const; + Value& operator[](AZStd::string_view name); + const Value& operator[](AZStd::string_view name) const; + + Object::ConstIterator MemberBegin() const; + Object::ConstIterator MemberEnd() const; + Object::Iterator MemberBegin(); + Object::Iterator MemberEnd(); + + Object::ConstIterator FindMember(KeyType name) const; + Object::ConstIterator FindMember(AZStd::string_view name) const; + Object::Iterator FindMember(KeyType name); + Object::Iterator FindMember(AZStd::string_view name); + + Value& MemberReserve(size_t newCapacity); + bool HasMember(KeyType name) const; + bool HasMember(AZStd::string_view name) const; + + Value& AddMember(KeyType name, const Value& value); + Value& AddMember(AZStd::string_view name, const Value& value); + Value& AddMember(KeyType name, Value&& value); + Value& AddMember(AZStd::string_view name, Value&& value); + + void RemoveAllMembers(); + void RemoveMember(KeyType name); + void RemoveMember(AZStd::string_view name); + Object::Iterator RemoveMember(Object::Iterator pos); + Object::Iterator EraseMember(Object::ConstIterator pos); + Object::Iterator EraseMember(Object::ConstIterator first, Object::ConstIterator last); + Object::Iterator EraseMember(KeyType name); + Object::Iterator EraseMember(AZStd::string_view name); + + Object::ContainerType& GetObject(); + const Object::ContainerType& GetObject() const; + + // Array API (also used by Node)... + Value& SetArray(); + + size_t Size() const; + size_t Capacity() const; + bool Empty() const; + void Clear(); + + Value& operator[](size_t index); + const Value& operator[](size_t index) const; + + Array::ConstIterator Begin() const; + Array::ConstIterator End() const; + Array::Iterator Begin(); + Array::Iterator End(); + + Value& Reserve(size_t newCapacity); + Value& PushBack(Value value); + Value& PopBack(); + + Array::Iterator Erase(Array::ConstIterator pos); + Array::Iterator Erase(Array::ConstIterator first, Array::ConstIterator last); + + Array::ContainerType& GetArray(); + const Array::ContainerType& GetArray() const; + + // Node API (supports both object + array API, plus a dedicated NodeName)... + // bool CanConvertToNodeFromObject() const; + // Value& ConvertToNodeFromObject(); + // Value& ConvertToObjectFromNode(); + + void SetNode(AZ::Name name); + void SetNode(AZStd::string_view name); + + AZ::Name GetNodeName() const; + void SetNodeName(AZ::Name name); + void SetNodeName(AZStd::string_view name); + //! Convenience method, sets the first non-node element of a Node. + void SetNodeValue(Value value); + //! Convenience method, gets the first non-node element of a Node. + Value GetNodeValue() const; + + // int API... + int64_t GetInt() const; + void SetInt(int64_t); + + // uint API... + uint64_t GetUint() const; + void SetUint(uint64_t); + + // bool API... + bool GetBool() const; + void SetBool(bool); + + // double API... + double GetDouble() const; + void SetDouble(double); + + // string API... + AZStd::string_view GetString() const; + size_t GetStringLength() const; + void SetString(AZStd::string_view); + void CopyFromString(AZStd::string_view); + + // opaque type API... + AZStd::any& GetOpaqueValue() const; + //! This sets this Value to represent a value of an type that the DOM has + //! no formal knowledge of. Where possible, it should be preferred to + //! serialize an opaque type into a DOM value instead, as serializers + //! and other systems will have no means of dealing with fully arbitrary + //! values. + void SetOpaqueValue(AZStd::any&); + + // null API... + void SetNull(); + + private: + const Object::ContainerType& GetObjectInternal() const; + Object::ContainerType& GetObjectInternal(); + const Array::ContainerType& GetArrayInternal() const; + Array::ContainerType& GetArrayInternal(); + + explicit Value(AZStd::any* opaqueValue); + + // If using the the copy on write model, anything stored internally as a shared_ptr will + // detach and copy when doing a mutating operation if use_count() > 1. + + // This internal storage will not have a 1:1 mapping to the public Type, as there may be + // multiple storage options (e.g. strings being stored as non-owning string_view or + // owning shared_ptr) + using ValueType = AZStd::variant< + // NullType + AZStd::monostate, + // NumberType + int64_t, + uint64_t, + double, + // FalseType & TrueType + bool, + // StringType + AZStd::string_view, + AZStd::shared_ptr, + // ObjectType + ObjectPtr, + // ArrayType + ArrayPtr, + // NodeType + Node, + // OpaqueType + AZStd::any*>; + + ValueType m_value; + }; +} // namespace AZ::Dom diff --git a/Code/Framework/AzCore/AzCore/azcore_files.cmake b/Code/Framework/AzCore/AzCore/azcore_files.cmake index ef6c7434cc..fa9f94505f 100644 --- a/Code/Framework/AzCore/AzCore/azcore_files.cmake +++ b/Code/Framework/AzCore/AzCore/azcore_files.cmake @@ -127,8 +127,12 @@ set(FILES Debug/TraceReflection.h DOM/DomBackend.cpp DOM/DomBackend.h + DOM/DomDocument.cpp + DOM/DomDocument.h DOM/DomUtils.cpp DOM/DomUtils.h + DOM/DomValue.cpp + DOM/DomValue.h DOM/DomVisitor.cpp DOM/DomVisitor.h DOM/Backends/JSON/JsonBackend.h From b96be71c619000a580e964ff51d84c14aa4c2c0f Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 8 Dec 2021 19:55:55 -0800 Subject: [PATCH 028/948] More stability changes, improvement on type usage within the benchmark, cleanup of unstable stats Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Tests/Memory/AllocatorBenchmarks.cpp | 93 +++++++------------ 1 file changed, 35 insertions(+), 58 deletions(-) diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp index aa1c7f21ab..5cf5176308 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include @@ -92,10 +92,10 @@ namespace Benchmark /// Basic allocator used as a baseline. This allocator is the most basic allocation possible with the OS (AZ_OS_MALLOC). /// MallocSchema cannot be used here because it has extra logic that we don't want to use as a baseline. /// - class TestRawMallocAllocator {}; + class RawMallocAllocator {}; template<> - class TestAllocatorWrapper + class TestAllocatorWrapper { public: TestAllocatorWrapper() @@ -113,17 +113,11 @@ namespace Benchmark } // IAllocatorAllocate - static void* Allocate(size_t byteSize, size_t alignment) + static void* Allocate(size_t byteSize, size_t) { s_numAllocatedBytes += byteSize; - if (alignment) - { - return AZ_OS_MALLOC(byteSize, alignment); - } - else - { - return AZ_OS_MALLOC(byteSize, 1); - } + // Don't pass an alignment since we wont be able to get the memory size without also passing the alignment + return AZ_OS_MALLOC(byteSize, 1); } static void DeAllocate(void* ptr, size_t = 0) @@ -132,20 +126,13 @@ namespace Benchmark AZ_OS_FREE(ptr); } - static void* ReAllocate(void* ptr, size_t newSize, size_t newAlignment) + static void* ReAllocate(void* ptr, size_t newSize, size_t) { s_numAllocatedBytes -= Platform::GetMemorySize(ptr); AZ_OS_FREE(ptr); s_numAllocatedBytes += newSize; - if (newAlignment) - { - return AZ_OS_MALLOC(newSize, newAlignment); - } - else - { - return AZ_OS_MALLOC(newSize, 1); - } + return AZ_OS_MALLOC(newSize, 1); } static size_t Resize(void* ptr, size_t newSize) @@ -172,51 +159,47 @@ namespace Benchmark static size_t s_numAllocatedBytes; }; - size_t TestAllocatorWrapper::s_numAllocatedBytes = 0; - - // Here we require to implement this to be able to configure a name for the allocator, otherswise the AllocatorManager crashes when trying to configure the overrides - class TestMallocSchemaAllocator : public AZ::SimpleSchemaAllocator - { - public: - AZ_TYPE_INFO(TestMallocSchemaAllocator, "{3E68224F-E676-402C-8276-CE4B49C05E89}"); - - TestMallocSchemaAllocator() - : AZ::SimpleSchemaAllocator("TestMallocSchemaAllocator", "") - {} - }; + size_t TestAllocatorWrapper::s_numAllocatedBytes = 0; - class TestHeapSchemaAllocator : public AZ::SimpleSchemaAllocator + // Some allocator are not fully declared, those we simply setup from the schema + class MallocSchemaAllocator : public AZ::SimpleSchemaAllocator { public: - AZ_TYPE_INFO(TestHeapSchemaAllocator, "{456E6C30-AA84-488F-BE47-5C1E6AF636B7}"); + AZ_TYPE_INFO(MallocSchemaAllocator, "{3E68224F-E676-402C-8276-CE4B49C05E89}"); - TestHeapSchemaAllocator() - : AZ::SimpleSchemaAllocator("TestHeapSchemaAllocator", "") + MallocSchemaAllocator() + : AZ::SimpleSchemaAllocator("MallocSchemaAllocator", "") {} }; - class TestHphaSchemaAllocator : public AZ::SimpleSchemaAllocator + // We use both this HphaSchemaAllocator and the SystemAllocator configured with Hpha because the SystemAllocator + // has extra things + class HphaSchemaAllocator : public AZ::SimpleSchemaAllocator { public: - AZ_TYPE_INFO(TestHphaSchemaAllocator, "{6563AB4B-A68E-4499-8C98-D61D640D1F7F}"); + AZ_TYPE_INFO(HphaSchemaAllocator, "{6563AB4B-A68E-4499-8C98-D61D640D1F7F}"); - TestHphaSchemaAllocator() + HphaSchemaAllocator() : AZ::SimpleSchemaAllocator("TestHphaSchemaAllocator", "") {} }; + // For the SystemAllocator we inherit so we have a different stack. The SystemAllocator is used globally so we dont want + // to get that data affecting the benchmark class TestSystemAllocator : public AZ::SystemAllocator { public: AZ_TYPE_INFO(TestSystemAllocator, "{360D4DAA-D65D-4D5C-A6FA-1A4C5261C35C}"); + + TestSystemAllocator() + : AZ::SystemAllocator() + { + } }; // Allocated bytes reported by the allocator static const char* s_counterAllocatorMemory = "Allocator_Memory"; - // Allocated bytes reported by the process - static const char* s_counterProcessMemory = "Process_Memory"; - // Allocated bytes as counted by the benchmark static const char* s_counterBenchmarkMemory = "Benchmark_Memory"; @@ -310,8 +293,7 @@ namespace Benchmark for (auto _ : state) { state.PauseTiming(); - const size_t processMemoryBaseline = Platform::GetProcessMemoryUsageBytes(); - + AZStd::vector& perThreadAllocations = base::GetPerThreadAllocations(state.thread_index); const size_t numberOfAllocations = perThreadAllocations.size(); size_t totalAllocationSize = 0; @@ -327,7 +309,6 @@ namespace Benchmark } state.counters[s_counterAllocatorMemory] = benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); - state.counters[s_counterProcessMemory] = benchmark::Counter(static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), benchmark::Counter::kDefaults); state.counters[s_counterBenchmarkMemory] = benchmark::Counter(static_cast(totalAllocationSize), benchmark::Counter::kDefaults); for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) @@ -358,7 +339,6 @@ namespace Benchmark { state.PauseTiming(); AZStd::vector& perThreadAllocations = base::GetPerThreadAllocations(state.thread_index); - const size_t processMemoryBaseline = Platform::GetProcessMemoryUsageBytes(); const size_t numberOfAllocations = perThreadAllocations.size(); size_t totalAllocationSize = 0; @@ -381,7 +361,6 @@ namespace Benchmark } state.counters[s_counterAllocatorMemory] = benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); - state.counters[s_counterProcessMemory] = benchmark::Counter(static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), benchmark::Counter::kDefaults); state.counters[s_counterBenchmarkMemory] = benchmark::Counter(static_cast(totalAllocationSize), benchmark::Counter::kDefaults); state.SetItemsProcessed(numberOfAllocations); @@ -452,11 +431,10 @@ namespace Benchmark AZStd::array m_operations = {}; [[maybe_unused]] const size_t operationSize = sizeof(AllocatorOperation); - const size_t processMemoryBaseline = Platform::GetProcessMemoryUsageBytes(); size_t totalAllocationSize = 0; size_t itemsProcessed = 0; - for (size_t i = 0; i < 100; ++i) // replay the recording, this way we can keep a smaller recording + for (size_t i = 0; i < 100; ++i) // play the recording multiple times to get a good stable sample, this way we can keep a smaller recording { AZ::IO::SystemFile file; AZ::IO::FixedMaxPathString filePath = AZ::Utils::GetExecutableDirectory(); @@ -538,7 +516,6 @@ namespace Benchmark } state.counters[s_counterAllocatorMemory] = benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); - state.counters[s_counterProcessMemory] = benchmark::Counter(static_cast(Platform::GetProcessMemoryUsageBytes() - processMemoryBaseline), benchmark::Counter::kDefaults); state.counters[s_counterBenchmarkMemory] = benchmark::Counter(static_cast(totalAllocationSize), benchmark::Counter::kDefaults); state.SetItemsProcessed(itemsProcessed); @@ -583,7 +560,7 @@ namespace Benchmark BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_MIXED_THREADED, ALLOCATORTYPE, MIXED)->ThreadRange(2, MaxThreadRange)->Apply(ThreadedRunRanges); #define BM_REGISTER_ALLOCATOR(TESTNAME, ALLOCATORTYPE) \ - namespace TESTNAME \ + namespace BM_##TESTNAME \ { \ BM_REGISTER_SIZE_FIXTURES(AllocationBenchmarkFixture, TESTNAME, ALLOCATORTYPE); \ BM_REGISTER_SIZE_FIXTURES(DeAllocationBenchmarkFixture, TESTNAME, ALLOCATORTYPE); \ @@ -593,15 +570,15 @@ namespace Benchmark /// Warm up benchmark used to prepare the OS for allocations. Most OS keep allocations for a process somehow /// reserved. So the first allocations run always get a bigger impact in a process. This warm up allocator runs /// all the benchmarks and is just used for the the next allocators to report more consistent results. - BM_REGISTER_ALLOCATOR(WarmUpAllocator, TestRawMallocAllocator); + BM_REGISTER_ALLOCATOR(WarmUpAllocator, RawMallocAllocator); - BM_REGISTER_ALLOCATOR(RawMallocAllocator, TestRawMallocAllocator); - BM_REGISTER_ALLOCATOR(MallocSchemaAllocator, TestMallocSchemaAllocator); - BM_REGISTER_ALLOCATOR(HphaSchemaAllocator, TestHphaSchemaAllocator); + BM_REGISTER_ALLOCATOR(RawMallocAllocator, RawMallocAllocator); + BM_REGISTER_ALLOCATOR(MallocSchemaAllocator, MallocSchemaAllocator); + BM_REGISTER_ALLOCATOR(HphaSchemaAllocator, HphaSchemaAllocator); BM_REGISTER_ALLOCATOR(SystemAllocator, TestSystemAllocator); - + + //BM_REGISTER_ALLOCATOR(BestFitExternalMapAllocator, BestFitExternalMapAllocator); // Requires to pre-allocate blocks and cannot work as a general-purpose allocator //BM_REGISTER_ALLOCATOR(HeapSchemaAllocator, TestHeapSchemaAllocator); // Requires to pre-allocate blocks and cannot work as a general-purpose allocator - //BM_REGISTER_SCHEMA(BestFitExternalMapSchema); // Requires to implement AZ::IAllocatorAllocate //BM_REGISTER_SCHEMA(PoolSchema); // Requires special alignment requests while allocating #undef BM_REGISTER_ALLOCATOR From fada7ace232457b578730be5870df61fb9c7cfa6 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Wed, 8 Dec 2021 22:22:18 -0800 Subject: [PATCH 029/948] Add visitor support to Value Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp | 2 +- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 306 ++++++++++++++++++ Code/Framework/AzCore/AzCore/DOM/DomValue.h | 49 ++- 3 files changed, 355 insertions(+), 2 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp b/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp index 9751b9cecc..2e78661518 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp @@ -21,4 +21,4 @@ namespace AZ::Dom::Utils { return backend.ReadFromBufferInPlace(string.data(), string.size(), visitor); } -} +} // namespace AZ::Dom::Utils diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index ad6e648620..032e5795da 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -744,4 +744,310 @@ namespace AZ::Dom { m_value = AZStd::monostate(); } + + Visitor::Result Value::Accept(Visitor& visitor, bool copyStrings) const + { + Visitor::Result result = AZ::Success(); + + AZStd::visit( + [&](auto&& arg) + { + using Alternative = AZStd::decay_t; + + if constexpr (AZStd::is_same_v) + { + result = visitor.Null(); + } + else if constexpr (AZStd::is_same_v) + { + result = visitor.Int64(arg); + } + else if constexpr (AZStd::is_same_v) + { + result = visitor.Uint64(arg); + } + else if constexpr (AZStd::is_same_v) + { + result = visitor.Double(arg); + } + else if constexpr (AZStd::is_same_v) + { + result = visitor.String(arg, copyStrings ? Lifetime::Temporary : Lifetime::Persistent); + } + else if constexpr (AZStd::is_same_v>) + { + result = visitor.String(*arg, copyStrings ? Lifetime::Temporary : Lifetime::Persistent); + } + else if constexpr (AZStd::is_same_v) + { + result = visitor.StartObject(); + if (result.IsSuccess()) + { + const Object::ContainerType& object = GetObjectInternal(); + for (const Object::EntryType& entry : object) + { + result = entry.second.Accept(visitor, copyStrings); + if (!result.IsSuccess()) + { + return; + } + } + result = visitor.EndObject(object.size()); + } + } + else if constexpr (AZStd::is_same_v) + { + result = visitor.StartArray(); + if (result.IsSuccess()) + { + const Array::ContainerType& arrayContainer = GetArrayInternal(); + for (const Value& entry : arrayContainer) + { + result = entry.Accept(visitor, copyStrings); + if (!result.IsSuccess()) + { + return; + } + } + result = visitor.EndArray(arrayContainer.size()); + } + } + else if constexpr (AZStd::is_same_v) + { + const Node& node = AZStd::get(m_value); + result = visitor.StartNode(node.GetName()); + if (result.IsSuccess()) + { + const Object::ContainerType& object = GetObjectInternal(); + for (const Object::EntryType& entry : object) + { + result = entry.second.Accept(visitor, copyStrings); + if (!result.IsSuccess()) + { + return; + } + } + + const Array::ContainerType& arrayContainer = GetArrayInternal(); + for (const Value& entry : arrayContainer) + { + result = entry.Accept(visitor, copyStrings); + if (!result.IsSuccess()) + { + return; + } + } + + result = visitor.EndNode(object.size(), arrayContainer.size()); + } + } + else if constexpr (AZStd::is_same_v) + { + result = visitor.OpaqueValue(*arg); + } + }, + m_value); + return result; + } + + ValueWriter::ValueWriter(Value& outputValue) + : m_result(outputValue) + { + } + + VisitorFlags ValueWriter::GetVisitorFlags() const + { + return VisitorFlags::SupportsRawKeys | VisitorFlags::SupportsArrays | VisitorFlags::SupportsObjects | VisitorFlags::SupportsNodes; + } + + ValueWriter::ValueInfo::ValueInfo(Value& container) + : m_container(container) + { + } + + Visitor::Result ValueWriter::Null() + { + CurrentValue().SetNull(); + return FinishWrite(); + } + + Visitor::Result ValueWriter::Bool(bool value) + { + CurrentValue().SetBool(value); + return FinishWrite(); + } + + Visitor::Result ValueWriter::Int64(AZ::s64 value) + { + CurrentValue().SetInt(value); + return FinishWrite(); + } + + Visitor::Result ValueWriter::Uint64(AZ::u64 value) + { + CurrentValue().SetUint(value); + return FinishWrite(); + } + + Visitor::Result ValueWriter::Double(double value) + { + CurrentValue().SetDouble(value); + return FinishWrite(); + } + + Visitor::Result ValueWriter::String(AZStd::string_view value, Lifetime lifetime) + { + if (lifetime == Lifetime::Persistent) + { + CurrentValue().SetString(value); + } + else + { + CurrentValue().CopyFromString(value); + } + return FinishWrite(); + } + + Visitor::Result ValueWriter::StartObject() + { + CurrentValue().SetObject(); + + m_entryStack.emplace(CurrentValue()); + return VisitorSuccess(); + } + + Visitor::Result ValueWriter::EndContainer(Type containerType, AZ::u64 attributeCount, AZ::u64 elementCount) + { + const char* endMethodName; + switch (containerType) + { + case Type::ObjectType: + endMethodName = "EndObject"; + break; + case Type::ArrayType: + endMethodName = "EndArray"; + break; + case Type::NodeType: + endMethodName = "EndNode"; + break; + default: + AZ_Assert(false, "Invalid container type specified"); + return VisitorFailure(VisitorErrorCode::InternalError, "AZ::Dom::ValueWriter: EndContainer called with invalid container type"); + } + + if (m_entryStack.empty()) + { + return VisitorFailure( + VisitorErrorCode::InternalError, + AZStd::string::format("AZ::Dom::ValueWriter: %s called without a matching call", endMethodName)); + } + + const ValueInfo& topEntry = m_entryStack.top(); + if (topEntry.m_container.GetType() != containerType) + { + return VisitorFailure( + VisitorErrorCode::InternalError, + AZStd::string::format("AZ::Dom::ValueWriter: %s called from within a different container type", endMethodName)); + } + + if (topEntry.m_attributeCount != attributeCount) + { + return VisitorFailure( + VisitorErrorCode::InternalError, + AZStd::string::format( + "AZ::Dom::ValueWriter: %s expected %llu attributes but received %llu attributes instead", endMethodName, attributeCount, + topEntry.m_attributeCount)); + } + + if (topEntry.m_elementCount != elementCount) + { + return VisitorFailure( + VisitorErrorCode::InternalError, + AZStd::string::format( + "AZ::Dom::ValueWriter: %s expected %llu elements but received %llu elements instead", endMethodName, elementCount, + topEntry.m_elementCount)); + } + + m_entryStack.pop(); + return FinishWrite(); + } + + Visitor::Result ValueWriter::EndObject(AZ::u64 attributeCount) + { + return EndContainer(Type::ObjectType, attributeCount, 0); + } + + Visitor::Result ValueWriter::Key(AZ::Name key) + { + AZ_Assert(!m_entryStack.empty(), "Attempmted to push a key with no object"); + AZ_Assert(!m_entryStack.top().m_container.IsArray(), "Attempted to push a key to an array"); + m_entryStack.top().m_key = key; + return VisitorSuccess(); + } + + Visitor::Result ValueWriter::RawKey(AZStd::string_view key, [[maybe_unused]] Lifetime lifetime) + { + return Key(AZ::Name(key)); + } + + Visitor::Result ValueWriter::StartArray() + { + CurrentValue().SetArray(); + + m_entryStack.emplace(CurrentValue()); + return VisitorSuccess(); + } + + Visitor::Result ValueWriter::EndArray(AZ::u64 elementCount) + { + return EndContainer(Type::ArrayType, 0, elementCount); + } + + Visitor::Result ValueWriter::StartNode(AZ::Name name) + { + CurrentValue().SetNode(name); + + m_entryStack.emplace(CurrentValue()); + return VisitorSuccess(); + } + + Visitor::Result ValueWriter::EndNode(AZ::u64 attributeCount, AZ::u64 elementCount) + { + return EndContainer(Type::NodeType, attributeCount, elementCount); + } + + Visitor::Result ValueWriter::FinishWrite() + { + if (m_entryStack.empty()) + { + return VisitorSuccess(); + } + + Value value; + m_entryStack.top().m_value.Swap(value); + ValueInfo& newEntry = m_entryStack.top(); + + if (!newEntry.m_key.IsEmpty()) + { + newEntry.m_container.AddMember(newEntry.m_key, AZStd::move(value)); + newEntry.m_key = AZ::Name(); + ++newEntry.m_attributeCount; + } + else + { + newEntry.m_container.PushBack(AZStd::move(value)); + ++newEntry.m_elementCount; + } + + return VisitorSuccess(); + } + + Value& ValueWriter::CurrentValue() + { + if (m_entryStack.empty()) + { + return m_result; + } + return m_entryStack.top().m_value; + } } // namespace AZ::Dom diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index f73dbb2549..439971a5a0 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -14,6 +14,7 @@ #include #include #include +#include #include namespace AZ::Dom @@ -249,6 +250,9 @@ namespace AZ::Dom // null API... void SetNull(); + // Visitor API + Visitor::Result Accept(Visitor& visitor, bool copyStrings) const; + private: const Object::ContainerType& GetObjectInternal() const; Object::ContainerType& GetObjectInternal(); @@ -286,4 +290,47 @@ namespace AZ::Dom ValueType m_value; }; -} // namespace AZ::Dom + + class ValueWriter : public Visitor + { + public: + ValueWriter(Value& outputValue); + + VisitorFlags GetVisitorFlags() const override; + Result Null() override; + Result Bool(bool value) override; + Result Int64(AZ::s64 value) override; + Result Uint64(AZ::u64 value) override; + Result Double(double value) override; + + Result String(AZStd::string_view value, Lifetime lifetime) override; + Result StartObject() override; + Result EndObject(AZ::u64 attributeCount) override; + Result Key(AZ::Name key) override; + Result RawKey(AZStd::string_view key, Lifetime lifetime) override; + Result StartArray() override; + Result EndArray(AZ::u64 elementCount) override; + Result StartNode(AZ::Name name) override; + Result RawStartNode(AZStd::string_view name, Lifetime lifetime) override; + Result EndNode(AZ::u64 attributeCount, AZ::u64 elementCount) override; + + private: + Result FinishWrite(); + Value& CurrentValue(); + Visitor::Result EndContainer(Type containerType, AZ::u64 attributeCount, AZ::u64 elementCount); + + struct ValueInfo + { + ValueInfo(Value& container); + + KeyType m_key; + Value m_value; + Value& m_container; + AZ::u64 m_attributeCount = 0; + AZ::u64 m_elementCount = 0; + }; + + Value& m_result; + AZStd::stack m_entryStack; + }; + } // namespace AZ::Dom From 8b4527c64bca858bb72f2e9e1faf126e6d5b4a5e Mon Sep 17 00:00:00 2001 From: Tobias Alexander Franke Date: Thu, 2 Sep 2021 19:10:38 +0800 Subject: [PATCH 030/948] Fix: illegal exe name and version no. when opening Project Settings Tool Signed-off-by: T.J. McGrath-Daly --- AutomatedTesting/project.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AutomatedTesting/project.json b/AutomatedTesting/project.json index 5ee4ee68f8..5759f860c4 100644 --- a/AutomatedTesting/project.json +++ b/AutomatedTesting/project.json @@ -7,7 +7,7 @@ "android_settings": { "package_name": "com.lumberyard.yourgame", "version_number": 1, - "version_name": "1.0.0.0", + "version_name": "1.0.0", "orientation": "landscape" }, "engine": "o3de" From ce0c62268a106cb278335d1e38ac5979f8e028bc Mon Sep 17 00:00:00 2001 From: Tobias Alexander Franke Date: Fri, 15 Oct 2021 14:26:37 +0800 Subject: [PATCH 031/948] Parameters of the Simple LOD distance component still take effect after Enable anim graph is disabled. Signed-off-by: T.J. McGrath-Daly --- .../Code/Source/Integration/Components/SimpleLODComponent.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Gems/EMotionFX/Code/Source/Integration/Components/SimpleLODComponent.cpp b/Gems/EMotionFX/Code/Source/Integration/Components/SimpleLODComponent.cpp index fdc6426e4c..ec94a9a15d 100644 --- a/Gems/EMotionFX/Code/Source/Integration/Components/SimpleLODComponent.cpp +++ b/Gems/EMotionFX/Code/Source/Integration/Components/SimpleLODComponent.cpp @@ -232,6 +232,10 @@ namespace EMotionFX const float updateRateInSeconds = animGraphSampleRate > 0.0f ? 1.0f / animGraphSampleRate : 0.0f; actorInstance->SetMotionSamplingRate(updateRateInSeconds); } + else if (actorInstance->GetMotionSamplingRate() != 0) + { + actorInstance->SetMotionSamplingRate(0); + } // Disable the automatic mesh LOD level adjustment based on screen space in case a simple LOD component is present. // The simple LOD component overrides the mesh LOD level and syncs the skeleton with the mesh LOD level. From bbbe28208d96b0ad9b02c1d8548b86220be11a46 Mon Sep 17 00:00:00 2001 From: "T.J. McGrath-Daly" Date: Tue, 16 Nov 2021 14:24:03 +0800 Subject: [PATCH 032/948] Limit the max number to 1 when adding white box component or white box collider component. Signed-off-by: T.J. McGrath-Daly --- .../Code/Source/Components/EditorWhiteBoxColliderComponent.cpp | 1 + Gems/WhiteBox/Code/Source/EditorWhiteBoxComponent.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/Gems/WhiteBox/Code/Source/Components/EditorWhiteBoxColliderComponent.cpp b/Gems/WhiteBox/Code/Source/Components/EditorWhiteBoxColliderComponent.cpp index c245f60fed..17d374fab1 100644 --- a/Gems/WhiteBox/Code/Source/Components/EditorWhiteBoxColliderComponent.cpp +++ b/Gems/WhiteBox/Code/Source/Components/EditorWhiteBoxColliderComponent.cpp @@ -73,6 +73,7 @@ namespace WhiteBox void EditorWhiteBoxColliderComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible) { incompatible.push_back(AZ_CRC_CE("NonUniformScaleService")); + incompatible.push_back(AZ_CRC_CE("WhiteBoxColliderService")); } void EditorWhiteBoxColliderComponent::Activate() diff --git a/Gems/WhiteBox/Code/Source/EditorWhiteBoxComponent.cpp b/Gems/WhiteBox/Code/Source/EditorWhiteBoxComponent.cpp index 5c6fa73bb2..0da92b4a27 100644 --- a/Gems/WhiteBox/Code/Source/EditorWhiteBoxComponent.cpp +++ b/Gems/WhiteBox/Code/Source/EditorWhiteBoxComponent.cpp @@ -265,6 +265,7 @@ namespace WhiteBox { incompatible.push_back(AZ_CRC_CE("NonUniformScaleService")); incompatible.push_back(AZ_CRC_CE("MeshService")); + incompatible.push_back(AZ_CRC_CE("WhiteBoxService")); } EditorWhiteBoxComponent::EditorWhiteBoxComponent() = default; From 7276ad0dbfdb06914a8966a9b0a1c4d37075ada1 Mon Sep 17 00:00:00 2001 From: "T.J. McGrath-Daly" Date: Thu, 18 Nov 2021 15:11:26 +0800 Subject: [PATCH 033/948] The Groups and Ungroups shortcut keys in Script Canvas Editor do not take effect Signed-off-by: T.J. McGrath-Daly --- Code/Editor/EditorPanelUtils.cpp | 4 ++-- .../Widgets/AssetEditorToolbar/AssetEditorToolbar.ui | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Code/Editor/EditorPanelUtils.cpp b/Code/Editor/EditorPanelUtils.cpp index a270de5978..1a3c9bcb4a 100644 --- a/Code/Editor/EditorPanelUtils.cpp +++ b/Code/Editor/EditorPanelUtils.cpp @@ -319,8 +319,8 @@ public: keys.push_back(QPair("Edit Menu.Duplicate", "Ctrl+D")); keys.push_back(QPair("Edit Menu.Undo", "Ctrl+Z")); keys.push_back(QPair("Edit Menu.Redo", "Ctrl+Shift+Z")); - keys.push_back(QPair("Edit Menu.Group", "Ctrl+G")); - keys.push_back(QPair("Edit Menu.Ungroup", "Ctrl+Shift+G")); + keys.push_back(QPair("Edit Menu.Group", "Ctrl+Alt+O")); + keys.push_back(QPair("Edit Menu.Ungroup", "Ctrl+Alt+P")); keys.push_back(QPair("Edit Menu.Rename", "Ctrl+R")); keys.push_back(QPair("Edit Menu.Reset", "")); keys.push_back(QPair("Edit Menu.Edit Hotkeys", "")); diff --git a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/AssetEditorToolbar/AssetEditorToolbar.ui b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/AssetEditorToolbar/AssetEditorToolbar.ui index 688b3724e4..cf7a8e31d1 100644 --- a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/AssetEditorToolbar/AssetEditorToolbar.ui +++ b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/AssetEditorToolbar/AssetEditorToolbar.ui @@ -56,7 +56,7 @@ - Groups the current selection in the active graph [Ctrl+Shift+G] + Groups the current selection in the active graph [Ctrl+Alt+O] ... @@ -66,14 +66,14 @@ :/GraphCanvasEditorResources/group.svg:/GraphCanvasEditorResources/group.svg - Ctrl+Shift+G + Ctrl+Alt+O - <html><head/><body><p>Ungroups the selected element in the active graph [Ctrl+Shift+H]</p></body></html> + Ungroups the selected element in the active graph [Ctrl+Alt+P] ... @@ -83,7 +83,7 @@ :/GraphCanvasEditorResources/ungroup.svg:/GraphCanvasEditorResources/ungroup.svg - Ctrl+Shift+H + Ctrl+Alt+P From ac03b6f50b3b417f723bb4d0699d254dc3edc78d Mon Sep 17 00:00:00 2001 From: srikappa-amzn <82230713+srikappa-amzn@users.noreply.github.com> Date: Fri, 10 Dec 2021 00:55:23 +0530 Subject: [PATCH 034/948] Improve error messaging when duplicating entities before they are created (#4922) (#6279) * Improved error messaging when user tries to duplicate before entities are created Signed-off-by: srikappa-amzn <82230713+srikappa-amzn@users.noreply.github.com> --- .../Application/EditorEntityManager.cpp | 29 +++++++++++++++++-- .../Application/EditorEntityManager.h | 1 - .../Prefab/PrefabPublicHandler.cpp | 3 +- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Application/EditorEntityManager.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Application/EditorEntityManager.cpp index ce50fc7e00..6a926b89fd 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Application/EditorEntityManager.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Application/EditorEntityManager.cpp @@ -9,9 +9,27 @@ #include #include +#include namespace AzToolsFramework { + static bool AreEntitiesValidForDuplication(const EntityIdList& entityIds) + { + for (AZ::EntityId entityId : entityIds) + { + if (GetEntityById(entityId) == nullptr) + { + AZ_Error( + "Entity", false, + "Entity with id '%llu' is not found. This can happen when you try to duplicate the entity before it is created. Please " + "ensure entities are created before trying to duplicate them.", + static_cast(entityId)); + return false; + } + } + return true; + } + void EditorEntityManager::Start() { m_prefabPublicInterface = AZ::Interface::Get(); @@ -62,7 +80,11 @@ namespace AzToolsFramework EntityIdList selectedEntities; ToolsApplicationRequestBus::BroadcastResult(selectedEntities, &ToolsApplicationRequests::GetSelectedEntities); - m_prefabPublicInterface->DuplicateEntitiesInInstance(selectedEntities); + if (AreEntitiesValidForDuplication(selectedEntities)) + { + m_prefabPublicInterface->DuplicateEntitiesInInstance(selectedEntities); + } + } void EditorEntityManager::DuplicateEntityById(AZ::EntityId entityId) @@ -72,7 +94,10 @@ namespace AzToolsFramework void EditorEntityManager::DuplicateEntities(const EntityIdList& entities) { - m_prefabPublicInterface->DuplicateEntitiesInInstance(entities); + if (AreEntitiesValidForDuplication(entities)) + { + m_prefabPublicInterface->DuplicateEntitiesInInstance(entities); + } } } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Application/EditorEntityManager.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Application/EditorEntityManager.h index 5786cc3fbc..c4311de672 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Application/EditorEntityManager.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Application/EditorEntityManager.h @@ -34,5 +34,4 @@ namespace AzToolsFramework private: Prefab::PrefabPublicInterface* m_prefabPublicInterface = nullptr; }; - } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp index 26cc16f34b..a44cb320ee 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp @@ -1158,7 +1158,8 @@ namespace AzToolsFramework // Select the duplicated entities/instances auto selectionUndo = aznew SelectionCommand(duplicatedEntityAndInstanceIds, "Select Duplicated Entities/Instances"); selectionUndo->SetParent(undoBatch.GetUndoBatch()); - ToolsApplicationRequestBus::Broadcast(&ToolsApplicationRequestBus::Events::SetSelectedEntities, duplicatedEntityAndInstanceIds); + ToolsApplicationRequestBus::Broadcast( + &ToolsApplicationRequestBus::Events::SetSelectedEntities, duplicatedEntityAndInstanceIds); } return AZ::Success(AZStd::move(duplicatedEntityAndInstanceIds)); From e7c92b5658a0829885a729039356fbad1bf939bb Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Thu, 9 Dec 2021 15:25:20 -0800 Subject: [PATCH 035/948] Move ValueWriter out, add DeepCompareIsEqual Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 405 +++++++++--------- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 81 ++-- .../AzCore/AzCore/DOM/DomValueWriter.cpp | 218 ++++++++++ .../AzCore/AzCore/DOM/DomValueWriter.h | 58 +++ .../AzCore/AzCore/azcore_files.cmake | 2 + 5 files changed, 504 insertions(+), 260 deletions(-) create mode 100644 Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp create mode 100644 Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index 032e5795da..68a88ed35a 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -9,7 +9,7 @@ #pragma once #include - +#include #include namespace AZ::Dom @@ -26,6 +26,11 @@ namespace AZ::Dom return refCountedPointer; } + Node::Node(AZ::Name name) + : m_name(name) + { + } + AZ::Name Node::GetName() const { return m_name; @@ -36,31 +41,24 @@ namespace AZ::Dom m_name = name; } - ObjectPtr Node::GetMutableProperties() + Object::ContainerType& Node::GetProperties() { - CheckCopyOnWrite(m_object); - return m_object; + return m_properties; } - ConstObjectPtr Node::GetProperties() const + const Object::ContainerType& Node::GetProperties() const { - return m_object; + return m_properties; } - ArrayPtr Node::GetMutableChildren() + Array::ContainerType& Node::GetChildren() { - CheckCopyOnWrite(m_array); - return m_array; + return m_children; } - ConstArrayPtr Node::GetChildren() const + const Array::ContainerType& Node::GetChildren() const { - return m_array; - } - - bool Node::operator==(const Node& rhs) const - { - return m_name == rhs.m_name && m_array == rhs.m_array && m_object == rhs.m_object; + return m_children; } Value::Value() @@ -187,7 +185,7 @@ namespace AZ::Dom return Type::ObjectType; case 8: // ArrayPtr return Type::ArrayType; - case 9: // Node + case 9: // NodePtr return Type::NodeType; case 10: // AZStd::any* return Type::OpaqueType; @@ -267,18 +265,31 @@ namespace AZ::Dom return *this; } + const Node& Value::GetNodeInternal() const + { + AZ_Assert(GetType() == Type::NodeType, "AZ::Dom::Value: attempted to retrieve a node from a non-node value"); + return *AZStd::get(m_value); + } + + Node& Value::GetNodeInternal() + { + AZ_Assert(GetType() == Type::NodeType, "AZ::Dom::Value: attempted to retrieve a node from a non-node value"); + return *CheckCopyOnWrite(AZStd::get(m_value)); + } + const Object::ContainerType& Value::GetObjectInternal() const { const Type type = GetType(); AZ_Assert( - type == Type::ObjectType || type == Type::NodeType, "AZ::Dom::Value: attempted to retrieve an object from a non-object value"); + type == Type::ObjectType || type == Type::NodeType, + "AZ::Dom::Value: attempted to retrieve an object from a value that isn't an object or a node"); if (type == Type::ObjectType) { return AZStd::get(m_value)->m_values; } else { - return AZStd::get(m_value).GetProperties()->m_values; + return AZStd::get(m_value)->GetProperties(); } } @@ -286,14 +297,15 @@ namespace AZ::Dom { const Type type = GetType(); AZ_Assert( - type == Type::ObjectType || type == Type::NodeType, "AZ::Dom::Value: attempted to retrieve an object from a non-object value"); + type == Type::ObjectType || type == Type::NodeType, + "AZ::Dom::Value: attempted to retrieve an object from a value that isn't an object or a node"); if (type == Type::ObjectType) { return CheckCopyOnWrite(AZStd::get(m_value))->m_values; } else { - return AZStd::get(m_value).GetMutableProperties()->m_values; + return CheckCopyOnWrite(AZStd::get(m_value))->GetProperties(); } } @@ -301,14 +313,15 @@ namespace AZ::Dom { const Type type = GetType(); AZ_Assert( - type == Type::ArrayType || type == Type::NodeType, "AZ::Dom::Value: attempted to retrieve an array from a non-array value"); + type == Type::ArrayType || type == Type::NodeType, + "AZ::Dom::Value: attempted to retrieve an array from a value that isn't an array or a node"); if (type == Type::ObjectType) { return AZStd::get(m_value)->m_values; } else { - return AZStd::get(m_value).GetChildren()->m_values; + return AZStd::get(m_value)->GetChildren(); } } @@ -316,14 +329,15 @@ namespace AZ::Dom { const Type type = GetType(); AZ_Assert( - type == Type::ArrayType || type == Type::NodeType, "AZ::Dom::Value: attempted to retrieve an array from a non-array value"); + type == Type::ArrayType || type == Type::NodeType, + "AZ::Dom::Value: attempted to retrieve an array from a value that isn't an array or node"); if (type == Type::ObjectType) { return CheckCopyOnWrite(AZStd::get(m_value))->m_values; } else { - return AZStd::get(m_value).GetMutableChildren()->m_values; + return CheckCopyOnWrite(AZStd::get(m_value))->GetChildren(); } } @@ -627,6 +641,67 @@ namespace AZ::Dom return GetArrayInternal(); } + void Value::SetNode(AZ::Name name) + { + m_value = AZStd::make_shared(name); + } + + void Value::SetNode(AZStd::string_view name) + { + SetNode(AZ::Name(name)); + } + + AZ::Name Value::GetNodeName() const + { + return GetNodeInternal().GetName(); + } + + void Value::SetNodeName(AZ::Name name) + { + GetNodeInternal().SetName(name); + } + + void Value::SetNodeName(AZStd::string_view name) + { + SetNodeName(AZ::Name(name)); + } + + void Value::SetNodeValue(Value value) + { + AZ_Assert(GetType() == Type::NodeType, "AZ::Dom::Value: Attempted to set value for non-node type"); + Array::ContainerType& nodeChildren = GetArrayInternal(); + + // Set the first non-node child, if one is found + for (Value& entry : nodeChildren) + { + if (entry.GetType() != Type::NodeType) + { + entry = AZStd::move(value); + return; + } + } + + // Otherwise, append the value entry + nodeChildren.push_back(AZStd::move(value)); + } + + Value Value::GetNodeValue() const + { + AZ_Assert(GetType() == Type::NodeType, "AZ::Dom::Value: Attempted to get value for non-node type"); + const Array::ContainerType& nodeChildren = GetArrayInternal(); + + // Get the first non-node child, if one is found + for (const Value& entry : nodeChildren) + { + if (entry.GetType() != Type::NodeType) + { + return entry; + } + } + + return Value(); + } + int64_t Value::GetInt() const { switch (m_value.index()) @@ -812,9 +887,9 @@ namespace AZ::Dom result = visitor.EndArray(arrayContainer.size()); } } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { - const Node& node = AZStd::get(m_value); + const Node& node = *AZStd::get(m_value); result = visitor.StartNode(node.GetName()); if (result.IsSuccess()) { @@ -850,204 +925,124 @@ namespace AZ::Dom return result; } - ValueWriter::ValueWriter(Value& outputValue) - : m_result(outputValue) - { - } - - VisitorFlags ValueWriter::GetVisitorFlags() const - { - return VisitorFlags::SupportsRawKeys | VisitorFlags::SupportsArrays | VisitorFlags::SupportsObjects | VisitorFlags::SupportsNodes; - } - - ValueWriter::ValueInfo::ValueInfo(Value& container) - : m_container(container) - { - } - - Visitor::Result ValueWriter::Null() - { - CurrentValue().SetNull(); - return FinishWrite(); - } - - Visitor::Result ValueWriter::Bool(bool value) - { - CurrentValue().SetBool(value); - return FinishWrite(); - } - - Visitor::Result ValueWriter::Int64(AZ::s64 value) + AZStd::unique_ptr Value::GetWriteHandler() { - CurrentValue().SetInt(value); - return FinishWrite(); + return AZStd::make_unique(*this); } - Visitor::Result ValueWriter::Uint64(AZ::u64 value) + bool Value::DeepCompareIsEqual(const Value& other) const { - CurrentValue().SetUint(value); - return FinishWrite(); - } - - Visitor::Result ValueWriter::Double(double value) - { - CurrentValue().SetDouble(value); - return FinishWrite(); - } - - Visitor::Result ValueWriter::String(AZStd::string_view value, Lifetime lifetime) - { - if (lifetime == Lifetime::Persistent) - { - CurrentValue().SetString(value); - } - else - { - CurrentValue().CopyFromString(value); - } - return FinishWrite(); - } - - Visitor::Result ValueWriter::StartObject() - { - CurrentValue().SetObject(); - - m_entryStack.emplace(CurrentValue()); - return VisitorSuccess(); - } - - Visitor::Result ValueWriter::EndContainer(Type containerType, AZ::u64 attributeCount, AZ::u64 elementCount) - { - const char* endMethodName; - switch (containerType) - { - case Type::ObjectType: - endMethodName = "EndObject"; - break; - case Type::ArrayType: - endMethodName = "EndArray"; - break; - case Type::NodeType: - endMethodName = "EndNode"; - break; - default: - AZ_Assert(false, "Invalid container type specified"); - return VisitorFailure(VisitorErrorCode::InternalError, "AZ::Dom::ValueWriter: EndContainer called with invalid container type"); - } - - if (m_entryStack.empty()) - { - return VisitorFailure( - VisitorErrorCode::InternalError, - AZStd::string::format("AZ::Dom::ValueWriter: %s called without a matching call", endMethodName)); - } - - const ValueInfo& topEntry = m_entryStack.top(); - if (topEntry.m_container.GetType() != containerType) + if (m_value.index() != other.m_value.index()) { - return VisitorFailure( - VisitorErrorCode::InternalError, - AZStd::string::format("AZ::Dom::ValueWriter: %s called from within a different container type", endMethodName)); + return false; } - if (topEntry.m_attributeCount != attributeCount) - { - return VisitorFailure( - VisitorErrorCode::InternalError, - AZStd::string::format( - "AZ::Dom::ValueWriter: %s expected %llu attributes but received %llu attributes instead", endMethodName, attributeCount, - topEntry.m_attributeCount)); - } - - if (topEntry.m_elementCount != elementCount) - { - return VisitorFailure( - VisitorErrorCode::InternalError, - AZStd::string::format( - "AZ::Dom::ValueWriter: %s expected %llu elements but received %llu elements instead", endMethodName, elementCount, - topEntry.m_elementCount)); - } - - m_entryStack.pop(); - return FinishWrite(); - } + return AZStd::visit( + [&](auto&& ourValue) -> bool + { + using Alternative = AZStd::decay_t; + auto&& theirValue = AZStd::get>(other.m_value); - Visitor::Result ValueWriter::EndObject(AZ::u64 attributeCount) - { - return EndContainer(Type::ObjectType, attributeCount, 0); - } + if constexpr (AZStd::is_same_v) + { + return true; + } + else if constexpr (AZStd::is_same_v) + { + if (ourValue == theirValue) + { + return true; + } - Visitor::Result ValueWriter::Key(AZ::Name key) - { - AZ_Assert(!m_entryStack.empty(), "Attempmted to push a key with no object"); - AZ_Assert(!m_entryStack.top().m_container.IsArray(), "Attempted to push a key to an array"); - m_entryStack.top().m_key = key; - return VisitorSuccess(); - } + if (ourValue->m_values.size() != theirValue->m_values.size()) + { + return false; + } - Visitor::Result ValueWriter::RawKey(AZStd::string_view key, [[maybe_unused]] Lifetime lifetime) - { - return Key(AZ::Name(key)); - } + for (size_t i = 0; i < ourValue->m_values.size(); ++i) + { + const Object::EntryType& lhs = ourValue->m_values[i]; + const Object::EntryType& rhs = theirValue->m_values[i]; + if (lhs.first != rhs.first || !lhs.second.DeepCompareIsEqual(rhs.second)) + { + return false; + } + } - Visitor::Result ValueWriter::StartArray() - { - CurrentValue().SetArray(); + return true; + } + else if constexpr (AZStd::is_same_v) + { + if (ourValue == theirValue) + { + return true; + } - m_entryStack.emplace(CurrentValue()); - return VisitorSuccess(); - } + if (ourValue->m_values.size() != theirValue->m_values.size()) + { + return false; + } - Visitor::Result ValueWriter::EndArray(AZ::u64 elementCount) - { - return EndContainer(Type::ArrayType, 0, elementCount); - } + for (size_t i = 0; i < ourValue->m_values.size(); ++i) + { + const Value& lhs = ourValue->m_values[i]; + const Value& rhs = theirValue->m_values[i]; + if (!lhs.DeepCompareIsEqual(rhs)) + { + return false; + } + } - Visitor::Result ValueWriter::StartNode(AZ::Name name) - { - CurrentValue().SetNode(name); + return true; + } + else if constexpr (AZStd::is_same_v) + { + if (ourValue == theirValue) + { + return true; + } - m_entryStack.emplace(CurrentValue()); - return VisitorSuccess(); - } + const Node& ourNode = *ourValue; + const Node& theirNode = *theirValue; - Visitor::Result ValueWriter::EndNode(AZ::u64 attributeCount, AZ::u64 elementCount) - { - return EndContainer(Type::NodeType, attributeCount, elementCount); - } + const Object::ContainerType& ourProperties = ourNode.GetProperties(); + const Object::ContainerType& theirProperties = theirNode.GetProperties(); - Visitor::Result ValueWriter::FinishWrite() - { - if (m_entryStack.empty()) - { - return VisitorSuccess(); - } + if (ourProperties.size() != theirProperties.size()) + { + return false; + } - Value value; - m_entryStack.top().m_value.Swap(value); - ValueInfo& newEntry = m_entryStack.top(); + for (size_t i = 0; i < ourProperties.size(); ++i) + { + const Object::EntryType& lhs = ourProperties[i]; + const Object::EntryType& rhs = theirProperties[i]; + if (lhs.first != rhs.first || !lhs.second.DeepCompareIsEqual(rhs.second)) + { + return false; + } + } - if (!newEntry.m_key.IsEmpty()) - { - newEntry.m_container.AddMember(newEntry.m_key, AZStd::move(value)); - newEntry.m_key = AZ::Name(); - ++newEntry.m_attributeCount; - } - else - { - newEntry.m_container.PushBack(AZStd::move(value)); - ++newEntry.m_elementCount; - } + const Array::ContainerType& ourChildren = ourNode.GetChildren(); + const Array::ContainerType& theirChildren = theirNode.GetChildren(); - return VisitorSuccess(); - } + for (size_t i = 0; i < ourChildren.size(); ++i) + { + const Value& lhs = ourChildren[i]; + const Value& rhs = theirChildren[i]; + if (!lhs.DeepCompareIsEqual(rhs)) + { + return false; + } + } - Value& ValueWriter::CurrentValue() - { - if (m_entryStack.empty()) - { - return m_result; - } - return m_entryStack.top().m_value; + return true; + } + else + { + return ourValue == theirValue; + } + }, + m_value); } } // namespace AZ::Dom diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index 439971a5a0..a460274602 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -8,13 +8,13 @@ #pragma once +#include #include - #include +#include #include #include #include -#include #include namespace AZ::Dom @@ -72,25 +72,34 @@ namespace AZ::Dom class Node { public: + Node() = default; + Node(AZ::Name name); + Node(const Node&) = default; + Node(Node&&) = default; + + Node& operator=(const Node&) = default; + Node& operator=(Node&&) = default; + AZ::Name GetName() const; void SetName(AZ::Name name); - ObjectPtr GetMutableProperties(); - ConstObjectPtr GetProperties() const; - - ArrayPtr GetMutableChildren(); - ConstArrayPtr GetChildren() const; + Object::ContainerType& GetProperties(); + const Object::ContainerType& GetProperties() const; - bool operator==(const Node& rhs) const; + Array::ContainerType& GetChildren(); + const Array::ContainerType& GetChildren() const; private: AZ::Name m_name; - ArrayPtr m_array; - ObjectPtr m_object; + Object::ContainerType m_properties; + Array::ContainerType m_children; friend class Value; }; + using NodePtr = AZStd::shared_ptr; + using ConstNodePtr = AZStd::shared_ptr; + class Value { public: @@ -252,8 +261,13 @@ namespace AZ::Dom // Visitor API Visitor::Result Accept(Visitor& visitor, bool copyStrings) const; + AZStd::unique_ptr GetWriteHandler(); + + bool DeepCompareIsEqual(const Value& other) const; private: + const Node& GetNodeInternal() const; + Node& GetNodeInternal(); const Object::ContainerType& GetObjectInternal() const; Object::ContainerType& GetObjectInternal(); const Array::ContainerType& GetArrayInternal() const; @@ -284,53 +298,10 @@ namespace AZ::Dom // ArrayType ArrayPtr, // NodeType - Node, + NodePtr, // OpaqueType AZStd::any*>; ValueType m_value; }; - - class ValueWriter : public Visitor - { - public: - ValueWriter(Value& outputValue); - - VisitorFlags GetVisitorFlags() const override; - Result Null() override; - Result Bool(bool value) override; - Result Int64(AZ::s64 value) override; - Result Uint64(AZ::u64 value) override; - Result Double(double value) override; - - Result String(AZStd::string_view value, Lifetime lifetime) override; - Result StartObject() override; - Result EndObject(AZ::u64 attributeCount) override; - Result Key(AZ::Name key) override; - Result RawKey(AZStd::string_view key, Lifetime lifetime) override; - Result StartArray() override; - Result EndArray(AZ::u64 elementCount) override; - Result StartNode(AZ::Name name) override; - Result RawStartNode(AZStd::string_view name, Lifetime lifetime) override; - Result EndNode(AZ::u64 attributeCount, AZ::u64 elementCount) override; - - private: - Result FinishWrite(); - Value& CurrentValue(); - Visitor::Result EndContainer(Type containerType, AZ::u64 attributeCount, AZ::u64 elementCount); - - struct ValueInfo - { - ValueInfo(Value& container); - - KeyType m_key; - Value m_value; - Value& m_container; - AZ::u64 m_attributeCount = 0; - AZ::u64 m_elementCount = 0; - }; - - Value& m_result; - AZStd::stack m_entryStack; - }; - } // namespace AZ::Dom +} // namespace AZ::Dom diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp new file mode 100644 index 0000000000..71710f543b --- /dev/null +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp @@ -0,0 +1,218 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include + +namespace AZ::Dom +{ + ValueWriter::ValueWriter(Value& outputValue) + : m_result(outputValue) + { + } + + VisitorFlags ValueWriter::GetVisitorFlags() const + { + return VisitorFlags::SupportsRawKeys | VisitorFlags::SupportsArrays | VisitorFlags::SupportsObjects | VisitorFlags::SupportsNodes; + } + + ValueWriter::ValueInfo::ValueInfo(Value& container) + : m_container(container) + { + } + + Visitor::Result ValueWriter::Null() + { + CurrentValue().SetNull(); + return FinishWrite(); + } + + Visitor::Result ValueWriter::Bool(bool value) + { + CurrentValue().SetBool(value); + return FinishWrite(); + } + + Visitor::Result ValueWriter::Int64(AZ::s64 value) + { + CurrentValue().SetInt(value); + return FinishWrite(); + } + + Visitor::Result ValueWriter::Uint64(AZ::u64 value) + { + CurrentValue().SetUint(value); + return FinishWrite(); + } + + Visitor::Result ValueWriter::Double(double value) + { + CurrentValue().SetDouble(value); + return FinishWrite(); + } + + Visitor::Result ValueWriter::String(AZStd::string_view value, Lifetime lifetime) + { + if (lifetime == Lifetime::Persistent) + { + CurrentValue().SetString(value); + } + else + { + CurrentValue().CopyFromString(value); + } + return FinishWrite(); + } + + Visitor::Result ValueWriter::StartObject() + { + CurrentValue().SetObject(); + + m_entryStack.emplace(CurrentValue()); + return VisitorSuccess(); + } + + Visitor::Result ValueWriter::EndContainer(Type containerType, AZ::u64 attributeCount, AZ::u64 elementCount) + { + const char* endMethodName; + switch (containerType) + { + case Type::ObjectType: + endMethodName = "EndObject"; + break; + case Type::ArrayType: + endMethodName = "EndArray"; + break; + case Type::NodeType: + endMethodName = "EndNode"; + break; + default: + AZ_Assert(false, "Invalid container type specified"); + return VisitorFailure(VisitorErrorCode::InternalError, "AZ::Dom::ValueWriter: EndContainer called with invalid container type"); + } + + if (m_entryStack.empty()) + { + return VisitorFailure( + VisitorErrorCode::InternalError, + AZStd::string::format("AZ::Dom::ValueWriter: %s called without a matching call", endMethodName)); + } + + const ValueInfo& topEntry = m_entryStack.top(); + if (topEntry.m_container.GetType() != containerType) + { + return VisitorFailure( + VisitorErrorCode::InternalError, + AZStd::string::format("AZ::Dom::ValueWriter: %s called from within a different container type", endMethodName)); + } + + if (topEntry.m_attributeCount != attributeCount) + { + return VisitorFailure( + VisitorErrorCode::InternalError, + AZStd::string::format( + "AZ::Dom::ValueWriter: %s expected %llu attributes but received %llu attributes instead", endMethodName, attributeCount, + topEntry.m_attributeCount)); + } + + if (topEntry.m_elementCount != elementCount) + { + return VisitorFailure( + VisitorErrorCode::InternalError, + AZStd::string::format( + "AZ::Dom::ValueWriter: %s expected %llu elements but received %llu elements instead", endMethodName, elementCount, + topEntry.m_elementCount)); + } + + m_entryStack.pop(); + return FinishWrite(); + } + + Visitor::Result ValueWriter::EndObject(AZ::u64 attributeCount) + { + return EndContainer(Type::ObjectType, attributeCount, 0); + } + + Visitor::Result ValueWriter::Key(AZ::Name key) + { + AZ_Assert(!m_entryStack.empty(), "Attempmted to push a key with no object"); + AZ_Assert(!m_entryStack.top().m_container.IsArray(), "Attempted to push a key to an array"); + m_entryStack.top().m_key = key; + return VisitorSuccess(); + } + + Visitor::Result ValueWriter::RawKey(AZStd::string_view key, [[maybe_unused]] Lifetime lifetime) + { + return Key(AZ::Name(key)); + } + + Visitor::Result ValueWriter::StartArray() + { + CurrentValue().SetArray(); + + m_entryStack.emplace(CurrentValue()); + return VisitorSuccess(); + } + + Visitor::Result ValueWriter::EndArray(AZ::u64 elementCount) + { + return EndContainer(Type::ArrayType, 0, elementCount); + } + + Visitor::Result ValueWriter::StartNode(AZ::Name name) + { + CurrentValue().SetNode(name); + + m_entryStack.emplace(CurrentValue()); + return VisitorSuccess(); + } + + Visitor::Result ValueWriter::RawStartNode(AZStd::string_view name, [[maybe_unused]] Lifetime lifetime) + { + return StartNode(AZ::Name(name)); + } + + Visitor::Result ValueWriter::EndNode(AZ::u64 attributeCount, AZ::u64 elementCount) + { + return EndContainer(Type::NodeType, attributeCount, elementCount); + } + + Visitor::Result ValueWriter::FinishWrite() + { + if (m_entryStack.empty()) + { + return VisitorSuccess(); + } + + Value value; + m_entryStack.top().m_value.Swap(value); + ValueInfo& newEntry = m_entryStack.top(); + + if (!newEntry.m_key.IsEmpty()) + { + newEntry.m_container.AddMember(newEntry.m_key, AZStd::move(value)); + newEntry.m_key = AZ::Name(); + ++newEntry.m_attributeCount; + } + else + { + newEntry.m_container.PushBack(AZStd::move(value)); + ++newEntry.m_elementCount; + } + + return VisitorSuccess(); + } + + Value& ValueWriter::CurrentValue() + { + if (m_entryStack.empty()) + { + return m_result; + } + return m_entryStack.top().m_value; + } +} // namespace AZ::Dom diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h new file mode 100644 index 0000000000..fb5f4324a6 --- /dev/null +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h @@ -0,0 +1,58 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include + +namespace AZ::Dom +{ + class ValueWriter : public Visitor + { + public: + ValueWriter(Value& outputValue); + + VisitorFlags GetVisitorFlags() const override; + Result Null() override; + Result Bool(bool value) override; + Result Int64(AZ::s64 value) override; + Result Uint64(AZ::u64 value) override; + Result Double(double value) override; + + Result String(AZStd::string_view value, Lifetime lifetime) override; + Result StartObject() override; + Result EndObject(AZ::u64 attributeCount) override; + Result Key(AZ::Name key) override; + Result RawKey(AZStd::string_view key, Lifetime lifetime) override; + Result StartArray() override; + Result EndArray(AZ::u64 elementCount) override; + Result StartNode(AZ::Name name) override; + Result RawStartNode(AZStd::string_view name, Lifetime lifetime) override; + Result EndNode(AZ::u64 attributeCount, AZ::u64 elementCount) override; + + private: + Result FinishWrite(); + Value& CurrentValue(); + Visitor::Result EndContainer(Type containerType, AZ::u64 attributeCount, AZ::u64 elementCount); + + struct ValueInfo + { + ValueInfo(Value& container); + + KeyType m_key; + Value m_value; + Value& m_container; + AZ::u64 m_attributeCount = 0; + AZ::u64 m_elementCount = 0; + }; + + Value& m_result; + AZStd::stack m_entryStack; + }; +} // namespace AZ::Dom diff --git a/Code/Framework/AzCore/AzCore/azcore_files.cmake b/Code/Framework/AzCore/AzCore/azcore_files.cmake index fa9f94505f..e17fb941b8 100644 --- a/Code/Framework/AzCore/AzCore/azcore_files.cmake +++ b/Code/Framework/AzCore/AzCore/azcore_files.cmake @@ -133,6 +133,8 @@ set(FILES DOM/DomUtils.h DOM/DomValue.cpp DOM/DomValue.h + DOM/DomValueWriter.cpp + DOM/DomValueWriter.h DOM/DomVisitor.cpp DOM/DomVisitor.h DOM/Backends/JSON/JsonBackend.h From 947adc0248d9be1bac2565d1a67d081b0d1677c7 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 9 Dec 2021 17:13:09 -0800 Subject: [PATCH 036/948] Removal of OverrideShim, AP seems to be crashing Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzCore/Component/ComponentApplication.cpp | 38 +-- .../AzCore/Component/ComponentApplication.h | 8 +- .../AzCore/AzCore/Compression/Compression.h | 4 +- .../AzCore/AzCore/Compression/compression.cpp | 6 +- .../AzCore/Compression/zstd_compression.cpp | 6 +- .../AzCore/Compression/zstd_compression.h | 5 +- .../AzCore/AzCore/IO/CompressorZStd.h | 2 +- .../AzCore/AzCore/IO/IStreamerTypes.cpp | 2 +- .../AzCore/AzCore/IO/IStreamerTypes.h | 4 +- .../AzCore/AzCore/Memory/AllocatorBase.cpp | 29 +- .../AzCore/AzCore/Memory/AllocatorBase.h | 9 +- .../AzCore/AzCore/Memory/AllocatorManager.cpp | 264 +----------------- .../AzCore/AzCore/Memory/AllocatorManager.h | 21 +- .../AzCore/Memory/AllocatorOverrideShim.cpp | 227 --------------- .../AzCore/Memory/AllocatorOverrideShim.h | 102 ------- .../Memory/BestFitExternalMapAllocator.cpp | 13 +- .../Memory/BestFitExternalMapAllocator.h | 7 +- .../Memory/BestFitExternalMapSchema.cpp | 20 +- .../AzCore/Memory/BestFitExternalMapSchema.h | 25 +- .../AzCore/AzCore/Memory/HeapSchema.cpp | 1 - .../AzCore/AzCore/Memory/HeapSchema.h | 5 +- .../AzCore/AzCore/Memory/HphaSchema.cpp | 2 +- .../AzCore/AzCore/Memory/HphaSchema.h | 5 +- .../AzCore/AzCore/Memory/IAllocator.cpp | 15 +- .../AzCore/AzCore/Memory/IAllocator.h | 67 +---- .../AzCore/AzCore/Memory/MallocSchema.cpp | 31 +- .../AzCore/AzCore/Memory/MallocSchema.h | 20 +- Code/Framework/AzCore/AzCore/Memory/Memory.h | 32 +-- .../AzCore/AzCore/Memory/OSAllocator.cpp | 1 - .../AzCore/AzCore/Memory/OSAllocator.h | 8 +- .../Memory/OverrunDetectionAllocator.cpp | 11 - .../AzCore/Memory/OverrunDetectionAllocator.h | 5 +- .../AzCore/AzCore/Memory/PoolAllocator.h | 2 +- .../AzCore/AzCore/Memory/PoolSchema.cpp | 25 +- .../AzCore/AzCore/Memory/PoolSchema.h | 8 +- .../AzCore/Memory/SimpleSchemaAllocator.h | 25 +- .../AzCore/AzCore/Memory/SystemAllocator.cpp | 40 ++- .../AzCore/AzCore/Memory/SystemAllocator.h | 24 +- .../AzCore/AzCore/Script/ScriptContext.cpp | 6 +- .../AzCore/AzCore/Script/ScriptContext.h | 2 +- .../AzCore/Serialization/AZStdContainers.inl | 4 +- .../AzCore/Serialization/SerializeContext.cpp | 2 +- .../AzCore/Serialization/SerializeContext.h | 18 +- .../Serialization/std/VariantReflection.inl | 4 +- .../AzCore/AzCore/azcore_files.cmake | 2 - Code/Framework/AzCore/Tests/AZStd/Hashed.cpp | 4 +- Code/Framework/AzCore/Tests/AZStd/Ordered.cpp | 4 +- Code/Framework/AzCore/Tests/Memory.cpp | 199 +++++++------ .../Tests/Memory/AllocatorBenchmarks.cpp | 2 +- .../AzCore/Tests/Memory/AllocatorManager.cpp | 85 +----- .../AzFramework/Archive/Archive.cpp | 2 +- .../AzFramework/Archive/IArchive.h | 2 +- .../AzFramework/Archive/ZipDirCache.cpp | 6 +- .../AzFramework/Archive/ZipDirCache.h | 4 +- .../AzFramework/Archive/ZipDirList.cpp | 2 +- .../AzFramework/Archive/ZipDirList.h | 4 +- .../AzFramework/Archive/ZipDirStructures.cpp | 8 +- Code/LauncherUnified/Launcher.h | 2 +- Code/Legacy/CryCommon/CryLegacyAllocator.h | 28 +- .../RHI/Code/Include/Atom/RHI/DrawPacket.h | 4 +- .../Code/Include/Atom/RHI/DrawPacketBuilder.h | 6 +- .../RHI/Code/Source/RHI/DrawPacketBuilder.cpp | 2 +- 62 files changed, 299 insertions(+), 1222 deletions(-) delete mode 100644 Code/Framework/AzCore/AzCore/Memory/AllocatorOverrideShim.cpp delete mode 100644 Code/Framework/AzCore/AzCore/Memory/AllocatorOverrideShim.h diff --git a/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp b/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp index 693b2f1648..a760061215 100644 --- a/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp +++ b/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp @@ -152,8 +152,6 @@ namespace AZ m_reservedDebug = 0; m_recordingMode = Debug::AllocationRecords::RECORD_STACK_IF_NO_FILE_LINE; m_stackRecordLevels = 5; - m_useOverrunDetection = false; - m_useMalloc = false; } bool AppDescriptorConverter(SerializeContext& serialize, SerializeContext::DataElementNode& node) @@ -323,9 +321,6 @@ namespace AZ ->Field("blockSize", &Descriptor::m_memoryBlocksByteSize) ->Field("reservedOS", &Descriptor::m_reservedOS) ->Field("reservedDebug", &Descriptor::m_reservedDebug) - ->Field("useOverrunDetection", &Descriptor::m_useOverrunDetection) - ->Field("useMalloc", &Descriptor::m_useMalloc) - ->Field("allocatorRemappings", &Descriptor::m_allocatorRemappings) ->Field("modules", &Descriptor::m_modules) ; @@ -361,8 +356,6 @@ namespace AZ ->Attribute(Edit::Attributes::Step, &Descriptor::m_pageSize) ->DataElement(Edit::UIHandlers::SpinBox, &Descriptor::m_reservedOS, "OS reserved memory", "System memory reserved for OS (used only when 'Allocate all memory at startup' is true)") ->DataElement(Edit::UIHandlers::SpinBox, &Descriptor::m_reservedDebug, "Memory reserved for debugger", "System memory reserved for Debug allocator, like memory tracking (used only when 'Allocate all memory at startup' is true)") - ->DataElement(Edit::UIHandlers::CheckBox, &Descriptor::m_useOverrunDetection, "Use Overrun Detection", "Use the overrun detection memory manager (only available on some platforms, ignored in Release builds)") - ->DataElement(Edit::UIHandlers::CheckBox, &Descriptor::m_useMalloc, "Use Malloc", "Use malloc for memory allocations (for memory debugging only, ignored in Release builds)") ; } } @@ -879,7 +872,7 @@ namespace AZ AZ::AllocatorInstance::Create(desc); AZ::Debug::Trace::Instance().Init(); - AZ::Debug::AllocationRecords* records = AllocatorInstance::GetAllocator().GetRecords(); + AZ::Debug::AllocationRecords* records = AllocatorInstance::Get().GetRecords(); if (records) { records->SetMode(m_descriptor.m_recordingMode); @@ -891,35 +884,6 @@ namespace AZ m_isSystemAllocatorOwner = true; } - -#ifndef RELEASE - if (m_descriptor.m_useOverrunDetection) - { - OverrunDetectionSchema::Descriptor overrunDesc(false); - s_overrunDetectionSchema = Environment::CreateVariable(AzTypeInfo::Name(), overrunDesc); - OverrunDetectionSchema* schemaPtr = &s_overrunDetectionSchema.Get(); - - AZ::AllocatorManager::Instance().SetOverrideAllocatorSource(schemaPtr); - } - - if (m_descriptor.m_useMalloc) - { - AZ_Printf("Malloc", "WARNING: Malloc override is enabled. Registered allocators will use malloc instead of their normal allocation schemas."); - s_mallocSchema = Environment::CreateVariable(AzTypeInfo::Name()); - MallocSchema* schemaPtr = &s_mallocSchema.Get(); - - AZ::AllocatorManager::Instance().SetOverrideAllocatorSource(schemaPtr); - } -#endif - - AllocatorManager& allocatorManager = AZ::AllocatorManager::Instance(); - - for (const auto& remapping : m_descriptor.m_allocatorRemappings) - { - allocatorManager.AddAllocatorRemapping(remapping.m_from.c_str(), remapping.m_to.c_str()); - } - - allocatorManager.FinalizeConfiguration(); } void ComponentApplication::MergeSettingsToRegistry(SettingsRegistryInterface& registry) diff --git a/Code/Framework/AzCore/AzCore/Component/ComponentApplication.h b/Code/Framework/AzCore/AzCore/Component/ComponentApplication.h index d53b8e1a4e..a28c58ac6b 100644 --- a/Code/Framework/AzCore/AzCore/Component/ComponentApplication.h +++ b/Code/Framework/AzCore/AzCore/Component/ComponentApplication.h @@ -142,10 +142,6 @@ namespace AZ AZ::u64 m_reservedDebug; //!< Reserved memory for Debugging (allocation,etc.). Used only when m_grabAllMemory is set to true. (default: 0) Debug::AllocationRecords::Mode m_recordingMode; //!< When to record stack traces (default: AZ::Debug::AllocationRecords::RECORD_STACK_IF_NO_FILE_LINE) AZ::u64 m_stackRecordLevels; //!< If stack recording is enabled, how many stack levels to record. (default: 5) - bool m_useOverrunDetection; //!< True to use the overrun detection memory management scheme. Only available on some platforms; greatly increases memory consumption. - bool m_useMalloc; //!< True to use malloc instead of the internal memory manager. Intended for debugging purposes only. - - AllocatorRemappings m_allocatorRemappings; //!< List of remappings of allocators to perform, so that they can alias each other. ModuleDescriptorList m_modules; //!< Dynamic modules used by the application. //!< These will be loaded on startup. @@ -159,7 +155,7 @@ namespace AZ //! If set, this allocator is used to allocate the temporary bootstrap memory, as well as the main \ref SystemAllocator heap. //! If it's left nullptr (default), the \ref OSAllocator will be used. - IAllocatorAllocate* m_allocator = nullptr; + IAllocator* m_allocator = nullptr; //! Callback to create AZ::Modules for the static libraries linked by this application. //! Leave null if the application uses no static AZ::Modules. @@ -372,7 +368,7 @@ namespace AZ bool m_isOSAllocatorOwner{ false }; bool m_ownsConsole{}; void* m_fixedMemoryBlock{ nullptr }; //!< Pointer to the memory block allocator, so we can free it OnDestroy. - IAllocatorAllocate* m_osAllocator{ nullptr }; + IAllocator* m_osAllocator{ nullptr }; EntitySetType m_entities; AZ::SettingsRegistryInterface::NotifyEventHandler m_projectPathChangedHandler; diff --git a/Code/Framework/AzCore/AzCore/Compression/Compression.h b/Code/Framework/AzCore/AzCore/Compression/Compression.h index 855dcf9a6a..105fb9dbe6 100644 --- a/Code/Framework/AzCore/AzCore/Compression/Compression.h +++ b/Code/Framework/AzCore/AzCore/Compression/Compression.h @@ -15,7 +15,7 @@ struct z_stream_s; namespace AZ { class IAllocator; - class IAllocatorAllocate; + class IAllocatorSchema; /** * The most well known and used compression algorithm. It gives the best compression ratios even on level 1, @@ -90,7 +90,7 @@ namespace AZ z_stream_s* m_strDeflate; z_stream_s* m_strInflate; - IAllocatorAllocate* m_workMemoryAllocator; + IAllocatorSchema* m_workMemoryAllocator; }; } diff --git a/Code/Framework/AzCore/AzCore/Compression/compression.cpp b/Code/Framework/AzCore/AzCore/Compression/compression.cpp index 8b6f270b00..b5b775ef5e 100644 --- a/Code/Framework/AzCore/AzCore/Compression/compression.cpp +++ b/Code/Framework/AzCore/AzCore/Compression/compression.cpp @@ -26,7 +26,7 @@ ZLib::ZLib(IAllocator* workMemAllocator) : m_strDeflate(nullptr) , m_strInflate(nullptr) { - m_workMemoryAllocator = workMemAllocator ? workMemAllocator->GetAllocationSource() : nullptr; + m_workMemoryAllocator = workMemAllocator->GetSchema(); if (!m_workMemoryAllocator) { m_workMemoryAllocator = &AllocatorInstance::Get(); @@ -55,7 +55,7 @@ ZLib::~ZLib() //========================================================================= void* ZLib::AllocateMem(void* userData, unsigned int items, unsigned int size) { - IAllocatorAllocate* allocator = reinterpret_cast(userData); + IAllocator* allocator = reinterpret_cast(userData); return allocator->Allocate(items * size, 4, 0, "ZLib", __FILE__, __LINE__); } @@ -65,7 +65,7 @@ void* ZLib::AllocateMem(void* userData, unsigned int items, unsigned int size) //========================================================================= void ZLib::FreeMem(void* userData, void* address) { - IAllocatorAllocate* allocator = reinterpret_cast(userData); + IAllocator* allocator = reinterpret_cast(userData); allocator->DeAllocate(address); } diff --git a/Code/Framework/AzCore/AzCore/Compression/zstd_compression.cpp b/Code/Framework/AzCore/AzCore/Compression/zstd_compression.cpp index ecab62d123..95576a275b 100644 --- a/Code/Framework/AzCore/AzCore/Compression/zstd_compression.cpp +++ b/Code/Framework/AzCore/AzCore/Compression/zstd_compression.cpp @@ -16,7 +16,7 @@ using namespace AZ; -ZStd::ZStd(IAllocatorAllocate* workMemAllocator) +ZStd::ZStd(IAllocator* workMemAllocator) { m_workMemoryAllocator = workMemAllocator; if (!m_workMemoryAllocator) @@ -41,13 +41,13 @@ ZStd::~ZStd() void* ZStd::AllocateMem(void* userData, size_t size) { - IAllocatorAllocate* allocator = reinterpret_cast(userData); + IAllocator* allocator = reinterpret_cast(userData); return allocator->Allocate(size, 4, 0, "ZStandard", __FILE__, __LINE__); } void ZStd::FreeMem(void* userData, void* address) { - IAllocatorAllocate* allocator = reinterpret_cast(userData); + IAllocator* allocator = reinterpret_cast(userData); allocator->DeAllocate(address); } diff --git a/Code/Framework/AzCore/AzCore/Compression/zstd_compression.h b/Code/Framework/AzCore/AzCore/Compression/zstd_compression.h index 3fe6677fff..70d8c37831 100644 --- a/Code/Framework/AzCore/AzCore/Compression/zstd_compression.h +++ b/Code/Framework/AzCore/AzCore/Compression/zstd_compression.h @@ -17,12 +17,11 @@ namespace AZ { class IAllocator; - class IAllocatorAllocate; class ZStd { public: - ZStd(IAllocatorAllocate* workMemAllocator = 0); + ZStd(IAllocator* workMemAllocator = 0); ~ZStd(); enum FlushType @@ -77,7 +76,7 @@ namespace AZ ZSTD_CStream* m_streamCompression; ZSTD_DStream* m_streamDecompression; - IAllocatorAllocate* m_workMemoryAllocator; + IAllocator* m_workMemoryAllocator; ZSTD_inBuffer m_inBuffer; ZSTD_outBuffer m_outBuffer; size_t m_nextBlockSize; diff --git a/Code/Framework/AzCore/AzCore/IO/CompressorZStd.h b/Code/Framework/AzCore/AzCore/IO/CompressorZStd.h index ed6b94fffa..9503f22665 100644 --- a/Code/Framework/AzCore/AzCore/IO/CompressorZStd.h +++ b/Code/Framework/AzCore/AzCore/IO/CompressorZStd.h @@ -48,7 +48,7 @@ namespace AZ public: AZ_CLASS_ALLOCATOR(CompressorZStdData, AZ::SystemAllocator, 0); - CompressorZStdData(IAllocatorAllocate* zstdMemAllocator = 0) + CompressorZStdData(IAllocator* zstdMemAllocator = 0) { m_zstd = zstdMemAllocator; } diff --git a/Code/Framework/AzCore/AzCore/IO/IStreamerTypes.cpp b/Code/Framework/AzCore/AzCore/IO/IStreamerTypes.cpp index 4c8272cfc8..4126d7457d 100644 --- a/Code/Framework/AzCore/AzCore/IO/IStreamerTypes.cpp +++ b/Code/Framework/AzCore/AzCore/IO/IStreamerTypes.cpp @@ -21,7 +21,7 @@ namespace AZ::IO::IStreamerTypes : m_allocator(AZ::AllocatorInstance::Get()) {} - DefaultRequestMemoryAllocator::DefaultRequestMemoryAllocator(AZ::IAllocatorAllocate& allocator) + DefaultRequestMemoryAllocator::DefaultRequestMemoryAllocator(AZ::IAllocator& allocator) : m_allocator(allocator) {} diff --git a/Code/Framework/AzCore/AzCore/IO/IStreamerTypes.h b/Code/Framework/AzCore/AzCore/IO/IStreamerTypes.h index 901fc5e594..2c4dc28518 100644 --- a/Code/Framework/AzCore/AzCore/IO/IStreamerTypes.h +++ b/Code/Framework/AzCore/AzCore/IO/IStreamerTypes.h @@ -137,7 +137,7 @@ namespace AZ::IO::IStreamerTypes public: //! DefaultRequestMemoryAllocator wraps around the AZ::SystemAllocator by default. DefaultRequestMemoryAllocator(); - explicit DefaultRequestMemoryAllocator(AZ::IAllocatorAllocate& allocator); + explicit DefaultRequestMemoryAllocator(AZ::IAllocator& allocator); ~DefaultRequestMemoryAllocator() override; void LockAllocator() override; @@ -151,7 +151,7 @@ namespace AZ::IO::IStreamerTypes private: AZStd::atomic_int m_lockCounter{ 0 }; AZStd::atomic_int m_allocationCounter{ 0 }; - AZ::IAllocatorAllocate& m_allocator; + AZ::IAllocator& m_allocator; }; // The following alignment functions are put here until they're available in AzCore's math library. diff --git a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp index 48994c4eef..4da9ab384f 100644 --- a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp @@ -158,10 +158,10 @@ namespace } #endif -AllocatorBase::AllocatorBase(IAllocatorAllocate* allocationSource, const char* name, const char* desc) : - IAllocator(allocationSource), - m_name(name), - m_desc(desc) +AllocatorBase::AllocatorBase(IAllocatorSchema* allocationSchema, const char* name, const char* desc) + : IAllocator(allocationSchema) + , m_name(name) + , m_desc(desc) { } @@ -180,11 +180,6 @@ const char* AllocatorBase::GetDescription() const return m_desc; } -IAllocatorAllocate* AllocatorBase::GetSchema() -{ - return nullptr; -} - Debug::AllocationRecords* AllocatorBase::GetRecords() { return m_records; @@ -201,11 +196,6 @@ bool AllocatorBase::IsReady() const return m_isReady; } -bool AllocatorBase::CanBeOverridden() const -{ - return m_canBeOverridden; -} - void AllocatorBase::PostCreate() { if (m_registrationEnabled) @@ -266,11 +256,6 @@ bool AllocatorBase::IsProfilingActive() const return m_isProfilingActive; } -void AllocatorBase::DisableOverriding() -{ - m_canBeOverridden = false; -} - void AllocatorBase::DisableRegistration() { m_registrationEnabled = false; @@ -278,12 +263,12 @@ void AllocatorBase::DisableRegistration() void AllocatorBase::ProfileAllocation(void* ptr, size_t byteSize, size_t alignment, const char* name, const char* fileName, int lineNum, int suppressStackRecord) { + if (m_isProfilingActive) + { #if defined(AZ_HAS_VARIADIC_TEMPLATES) && defined(AZ_DEBUG_BUILD) - ++suppressStackRecord; // one more for the fact the ebus is a function + ++suppressStackRecord; // one more for the fact the ebus is a function #endif // AZ_HAS_VARIADIC_TEMPLATES - if (m_isProfilingActive) - { auto records = GetRecords(); if (records) { diff --git a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.h b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.h index 8f8a17e470..f2521087b3 100644 --- a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.h +++ b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.h @@ -22,7 +22,7 @@ namespace AZ class AllocatorBase : public IAllocator { protected: - AllocatorBase(IAllocatorAllocate* allocationSource, const char* name, const char* desc); + AllocatorBase(IAllocatorSchema* allocationSchema, const char* name, const char* desc); ~AllocatorBase(); public: @@ -32,11 +32,9 @@ namespace AZ //--------------------------------------------------------------------- const char* GetName() const override; const char* GetDescription() const override; - IAllocatorAllocate* GetSchema() override; Debug::AllocationRecords* GetRecords() final; void SetRecords(Debug::AllocationRecords* records) final; bool IsReady() const final; - bool CanBeOverridden() const final; void PostCreate() override; void PreDestroy() final; void SetLazilyCreated(bool lazy) final; @@ -68,10 +66,6 @@ namespace AZ return byteSize; } - /// Call to disallow this allocator from being overridden. - /// Only kernel-level allocators where it would be especially problematic for them to be overridden should do this. - void DisableOverriding(); - /// Call to disallow this allocator from being registered with the AllocatorManager. /// Only kernel-level allocators where it would be especially problematic for them to be registered with the AllocatorManager should do this. void DisableRegistration(); @@ -107,7 +101,6 @@ namespace AZ bool m_isLazilyCreated = false; bool m_isProfilingActive = false; bool m_isReady = false; - bool m_canBeOverridden = true; bool m_registrationEnabled = true; }; diff --git a/Code/Framework/AzCore/AzCore/Memory/AllocatorManager.cpp b/Code/Framework/AzCore/AzCore/Memory/AllocatorManager.cpp index 70ac813972..758fa222fe 100644 --- a/Code/Framework/AzCore/AzCore/Memory/AllocatorManager.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/AllocatorManager.cpp @@ -12,17 +12,12 @@ #include #include -#include #include #include #include #include -#if !defined(RELEASE) && !defined(AZCORE_MEMORY_ENABLE_OVERRIDES) -# define AZCORE_MEMORY_ENABLE_OVERRIDES -#endif - namespace AZ::Internal { struct AMStringHasher @@ -54,18 +49,6 @@ namespace AZ::Internal namespace AZ { -struct AllocatorManager::InternalData -{ - explicit InternalData(const AZStdIAllocator& alloc) - : m_allocatorMap(alloc) - , m_remappings(alloc) - , m_remappingsReverse(alloc) - {} - Internal::AllocatorNameMap m_allocatorMap; - Internal::AllocatorRemappings m_remappings; - Internal::AllocatorRemappings m_remappingsReverse; -}; - static EnvironmentVariable s_allocManager = nullptr; static AllocatorManager* s_allocManagerDebug = nullptr; // For easier viewing in crash dumps @@ -81,16 +64,6 @@ static Internal::PreEnvironmentAttachData& GetPreEnvironmentAttachData() void AllocatorManager::PreRegisterAllocator(IAllocator* allocator) { auto& data = GetPreEnvironmentAttachData(); - -#ifdef AZCORE_MEMORY_ENABLE_OVERRIDES - // All allocators must switch to an OverrideEnabledAllocationSource proxy if they are to support allocator overriding. - if (allocator->CanBeOverridden()) - { - auto shim = Internal::AllocatorOverrideShim::Create(allocator, &data.m_mallocSchema); - allocator->SetAllocationSource(shim); - } -#endif - { AZStd::lock_guard lock(data.m_mutex); AZ_Assert(data.m_unregisteredAllocatorCount < Internal::PreEnvironmentAttachData::MAX_UNREGISTERED_ALLOCATORS, "Too many allocators trying to register before environment attached!"); @@ -175,12 +148,9 @@ AllocatorManager::AllocatorManager() } ) { - m_overrideSource = nullptr; m_numAllocators = 0; m_isAllocatorLeaking = false; - m_configurationFinalized = false; m_defaultTrackingRecordMode = Debug::AllocationRecords::RECORD_NO_RECORDS; - m_data = new (m_mallocSchema->Allocate(sizeof(InternalData), AZStd::alignment_of::value, 0)) InternalData(AZStdIAllocator(m_mallocSchema.get())); } //========================================================================= @@ -210,10 +180,6 @@ AllocatorManager::RegisterAllocator(class IAllocator* alloc) alloc->SetProfilingActive(m_profilingRefcount.load() > 0); m_allocators[m_numAllocators++] = alloc; - -#ifdef AZCORE_MEMORY_ENABLE_OVERRIDES - ConfigureAllocatorOverrides(alloc); -#endif } //========================================================================= @@ -232,81 +198,12 @@ AllocatorManager::InternalDestroy() // Do not actually destroy the lazy allocator as it may have work to do during non-deterministic shutdown } - if (m_data) - { - m_data->~InternalData(); - m_mallocSchema->DeAllocate(m_data); - m_data = nullptr; - } - if (!m_isAllocatorLeaking) { AZ_Assert(m_numAllocators == 0, "There are still %d registered allocators!", m_numAllocators); } } -//========================================================================= -// ConfigureAllocatorOverrides -// [10/14/2018] -//========================================================================= -void -AllocatorManager::ConfigureAllocatorOverrides(IAllocator* alloc) -{ - auto record = m_data->m_allocatorMap.emplace(AZStd::piecewise_construct, AZStd::forward_as_tuple(alloc->GetName(), AZStdIAllocator(m_mallocSchema.get())), AZStd::forward_as_tuple(alloc)); - - // We only need to keep going if the allocator supports overrides. - if (!alloc->CanBeOverridden()) - { - return; - } - - if (!alloc->IsAllocationSourceChanged()) - { - // All allocators must switch to an OverrideEnabledAllocationSource proxy if they are to support allocator overriding. - auto overrideEnabled = Internal::AllocatorOverrideShim::Create(alloc, m_mallocSchema.get()); - alloc->SetAllocationSource(overrideEnabled); - } - - auto itr = m_data->m_remappings.find(record.first->first); - - if (itr != m_data->m_remappings.end()) - { - auto remapTo = m_data->m_allocatorMap.find(itr->second); - - if (remapTo != m_data->m_allocatorMap.end()) - { - static_cast(alloc->GetAllocationSource())->SetOverride(remapTo->second->GetOriginalAllocationSource()); - } - } - - itr = m_data->m_remappingsReverse.find(record.first->first); - - if (itr != m_data->m_remappingsReverse.end()) - { - auto remapFrom = m_data->m_allocatorMap.find(itr->second); - - if (remapFrom != m_data->m_allocatorMap.end()) - { - AZ_Assert(!m_configurationFinalized, "Allocators may only remap to allocators that have been created before configuration finalization"); - static_cast(remapFrom->second->GetAllocationSource())->SetOverride(alloc->GetOriginalAllocationSource()); - } - } - - if (m_overrideSource) - { - static_cast(alloc->GetAllocationSource())->SetOverride(m_overrideSource); - } - - if (m_configurationFinalized) - { - // We can get rid of the intermediary if configuration won't be changing any further. - // (The creation of it at the top of this function was superflous, but it made it easier to set things up going through a single code path.) - auto shim = static_cast(alloc->GetAllocationSource()); - alloc->SetAllocationSource(shim->GetOverride()); - Internal::AllocatorOverrideShim::Destroy(shim); - } -} - //========================================================================= // UnRegisterAllocator // [9/17/2009] @@ -365,7 +262,7 @@ AllocatorManager::GarbageCollect() for (int i = 0; i < m_numAllocators; ++i) { - m_allocators[i]->GetAllocationSource()->GarbageCollect(); + m_allocators[i]->GetSchema()->GarbageCollect(); } } @@ -414,94 +311,6 @@ AllocatorManager::SetTrackingMode(Debug::AllocationRecords::Mode mode) } } -//========================================================================= -// SetOverrideSchema -// [8/17/2018] -//========================================================================= -void -AllocatorManager::SetOverrideAllocatorSource(IAllocatorAllocate* source, bool overrideExistingAllocators) -{ - (void)source; - (void)overrideExistingAllocators; - -#ifdef AZCORE_MEMORY_ENABLE_OVERRIDES - AZ_Assert(!m_configurationFinalized, "You cannot set an allocator source after FinalizeConfiguration() has been called."); - m_overrideSource = source; - - if (overrideExistingAllocators) - { - AZStd::lock_guard lock(m_allocatorListMutex); - for (int i = 0; i < m_numAllocators; ++i) - { - if (m_allocators[i]->CanBeOverridden()) - { - auto shim = static_cast(m_allocators[i]->GetAllocationSource()); - shim->SetOverride(source); - } - } - } -#endif -} - -//========================================================================= -// AddAllocatorRemapping -// [8/27/2018] -//========================================================================= -void -AllocatorManager::AddAllocatorRemapping(const char* fromName, const char* toName) -{ - (void)fromName; - (void)toName; - -#ifdef AZCORE_MEMORY_ENABLE_OVERRIDES - AZ_Assert(!m_configurationFinalized, "You cannot set an allocator remapping after FinalizeConfiguration() has been called."); - m_data->m_remappings.emplace(AZStd::piecewise_construct, AZStd::forward_as_tuple(fromName, m_mallocSchema.get()), AZStd::forward_as_tuple(toName, m_mallocSchema.get())); - m_data->m_remappingsReverse.emplace(AZStd::piecewise_construct, AZStd::forward_as_tuple(toName, m_mallocSchema.get()), AZStd::forward_as_tuple(fromName, m_mallocSchema.get())); -#endif -} - -void -AllocatorManager::FinalizeConfiguration() -{ - if (m_configurationFinalized) - { - return; - } - -#ifdef AZCORE_MEMORY_ENABLE_OVERRIDES - { - AZStd::lock_guard lock(m_allocatorListMutex); - - for (int i = 0; i < m_numAllocators; ++i) - { - if (!m_allocators[i]->CanBeOverridden()) - { - continue; - } - - auto shim = static_cast(m_allocators[i]->GetAllocationSource()); - - if (!shim->IsOverridden()) - { - m_allocators[i]->ResetAllocationSource(); - Internal::AllocatorOverrideShim::Destroy(shim); - } - else if (!shim->HasOrphanedAllocations()) - { - m_allocators[i]->SetAllocationSource(shim->GetOverride()); - Internal::AllocatorOverrideShim::Destroy(shim); - } - else - { - shim->SetFinalizedConfiguration(); - } - } - } -#endif - - m_configurationFinalized = true; -} - void AllocatorManager::EnterProfilingMode() { @@ -545,27 +354,18 @@ AllocatorManager::DumpAllocators() size_t totalConsumedBytes = 0; memset(m_dumpInfo, 0, sizeof(m_dumpInfo)); - void* sourceList[m_maxNumAllocators]; AZ_Printf(TAG, "%d allocators active\n", m_numAllocators); AZ_Printf(TAG, "Index,Name,Used kb,Reserved kb,Consumed kb\n"); for (int i = 0; i < m_numAllocators; i++) { - auto allocator = m_allocators[i]; - auto source = allocator->GetAllocationSource(); + IAllocator* allocator = GetAllocator(i); const char* name = allocator->GetName(); - size_t usedBytes = source->NumAllocatedBytes(); - size_t reservedBytes = source->Capacity(); + size_t usedBytes = allocator->NumAllocatedBytes(); + size_t reservedBytes = allocator->Capacity(); size_t consumedBytes = reservedBytes; - // Very hacky and inefficient check to see if this allocator obtains its memory from another allocator - sourceList[i] = source; - if (AZStd::find(sourceList, sourceList + i, allocator->GetSchema()) != sourceList + i) - { - consumedBytes = 0; - } - totalUsedBytes += usedBytes; totalReservedBytes += reservedBytes; totalConsumedBytes += consumedBytes; @@ -585,61 +385,21 @@ void AllocatorManager::GetAllocatorStats(size_t& allocatedBytes, size_t& capacit AZStd::lock_guard lock(m_allocatorListMutex); const int allocatorCount = GetNumAllocators(); - AZStd::unordered_map existingAllocators; - AZStd::unordered_map sourcesToAllocators; // Build a mapping of original allocator sources to their allocators for (int i = 0; i < allocatorCount; ++i) { IAllocator* allocator = GetAllocator(i); - sourcesToAllocators.emplace(allocator->GetOriginalAllocationSource(), allocator); - } - - for (int i = 0; i < allocatorCount; ++i) - { - IAllocator* allocator = GetAllocator(i); - IAllocatorAllocate* source = allocator->GetAllocationSource(); - IAllocatorAllocate* originalSource = allocator->GetOriginalAllocationSource(); - IAllocatorAllocate* schema = allocator->GetSchema(); - IAllocator* alias = (source != originalSource) ? sourcesToAllocators[source] : nullptr; - - if (schema && !alias) - { - // Check to see if this allocator's source maps to another allocator - // Need to check both the schema and the allocator itself, as either one might be used as the alias depending on how it's implemented - AZStd::array checkAllocators = { { schema, allocator->GetAllocationSource() } }; - - for (IAllocatorAllocate* check : checkAllocators) - { - auto existing = existingAllocators.emplace(check, allocator); - - if (!existing.second) - { - alias = existing.first->second; - // Do not break out of the loop as we need to add to the map for all entries - } - } - } - - static const IAllocator* OS_ALLOCATOR = &AllocatorInstance::GetAllocator(); - size_t sourceAllocatedBytes = source->NumAllocatedBytes(); - size_t sourceCapacityBytes = source->Capacity(); - - if (allocator == OS_ALLOCATOR) - { - // Need to special case the OS allocator because its capacity is a made-up number. Better to just use the allocated amount, it will hopefully be small anyway. - sourceCapacityBytes = sourceAllocatedBytes; - } - + allocatedBytes += allocator->NumAllocatedBytes(); + capacityBytes += allocator->Capacity(); + if (outStats) { - outStats->emplace(outStats->end(), allocator->GetName(), alias ? alias->GetName() : allocator->GetDescription(), sourceAllocatedBytes, sourceCapacityBytes, alias != nullptr); - } - - if (!alias) - { - allocatedBytes += sourceAllocatedBytes; - capacityBytes += sourceCapacityBytes; + outStats->emplace(outStats->end(), + allocator->GetName(), + allocator->GetDescription(), + allocator->NumAllocatedBytes(), + allocator->Capacity()); } } } diff --git a/Code/Framework/AzCore/AzCore/Memory/AllocatorManager.h b/Code/Framework/AzCore/AzCore/Memory/AllocatorManager.h index 14dec68ad1..0e8be07013 100644 --- a/Code/Framework/AzCore/AzCore/Memory/AllocatorManager.h +++ b/Code/Framework/AzCore/AzCore/Memory/AllocatorManager.h @@ -84,17 +84,6 @@ namespace AZ /// Especially for great code and engines... void SetAllocatorLeaking(bool allowLeaking) { m_isAllocatorLeaking = allowLeaking; } - /// Set an override allocator - /// All allocators registered with the AllocatorManager will automatically redirect to this allocator - /// if set. - void SetOverrideAllocatorSource(IAllocatorAllocate* source, bool overrideExistingAllocators = true); - - /// Retrieve the override schema - IAllocatorAllocate* GetOverrideAllocatorSource() const { return m_overrideSource; } - - void AddAllocatorRemapping(const char* fromName, const char* toName); - void FinalizeConfiguration(); - /// Enter or exit profiling mode; calls to Enter must be matched with calls to Exit void EnterProfilingMode(); void ExitProfilingMode(); @@ -113,19 +102,17 @@ namespace AZ struct AllocatorStats { - AllocatorStats(const char* name, const char* aliasOrDescription, size_t allocatedBytes, size_t capacityBytes, bool isAlias) + AllocatorStats(const char* name, const char* aliasOrDescription, size_t allocatedBytes, size_t capacityBytes) : m_name(name) , m_aliasOrDescription(aliasOrDescription) , m_allocatedBytes(allocatedBytes) , m_capacityBytes(capacityBytes) - , m_isAlias(isAlias) {} AZStd::string m_name; AZStd::string m_aliasOrDescription; size_t m_allocatedBytes; size_t m_capacityBytes; - bool m_isAlias; }; void GetAllocatorStats(size_t& usedBytes, size_t& reservedBytes, AZStd::vector* outStats = nullptr); @@ -157,7 +144,6 @@ namespace AZ private: void InternalDestroy(); - void ConfigureAllocatorOverrides(IAllocator* alloc); void DebugBreak(void* address, const Debug::AllocationInfo& info); AZ::MallocSchema* CreateMallocSchema(); @@ -172,14 +158,9 @@ namespace AZ MemoryBreak m_memoryBreak[MaxNumMemoryBreaks]; char m_activeBreaks; AZStd::mutex m_allocatorListMutex; - IAllocatorAllocate* m_overrideSource; DumpInfo m_dumpInfo[m_maxNumAllocators]; - struct InternalData; - - InternalData* m_data; - bool m_configurationFinalized; AZStd::atomic m_profilingRefcount; AZ::Debug::AllocationRecords::Mode m_defaultTrackingRecordMode; diff --git a/Code/Framework/AzCore/AzCore/Memory/AllocatorOverrideShim.cpp b/Code/Framework/AzCore/AzCore/Memory/AllocatorOverrideShim.cpp deleted file mode 100644 index e4928e83c5..0000000000 --- a/Code/Framework/AzCore/AzCore/Memory/AllocatorOverrideShim.cpp +++ /dev/null @@ -1,227 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#include - -namespace AZ::Internal -{ - AllocatorOverrideShim* AllocatorOverrideShim::Create(IAllocator* owningAllocator, IAllocatorAllocate* shimAllocationSource) - { - void* memory = shimAllocationSource->Allocate(sizeof(AllocatorOverrideShim), AZStd::alignment_of::value, 0); - auto result = new (memory) AllocatorOverrideShim(owningAllocator, shimAllocationSource); - return result; - } - - void AllocatorOverrideShim::Destroy(AllocatorOverrideShim* source) - { - auto shimAllocationSource = source->m_shimAllocationSource; - source->~AllocatorOverrideShim(); - shimAllocationSource->DeAllocate(source); - } - - AllocatorOverrideShim::AllocatorOverrideShim(IAllocator* owningAllocator, IAllocatorAllocate* shimAllocationSource) - : m_owningAllocator(owningAllocator) - , m_source(owningAllocator->GetOriginalAllocationSource()) - , m_overridingSource(owningAllocator->GetOriginalAllocationSource()) - , m_shimAllocationSource(shimAllocationSource) - , m_records(typename AllocationSet::hasher(), typename AllocationSet::key_eq(), StdAllocationSrc(shimAllocationSource)) - { - } - - void AllocatorOverrideShim::SetOverride(IAllocatorAllocate* source) - { - m_overridingSource = source; - } - - IAllocatorAllocate* AllocatorOverrideShim::GetOverride() const - { - return m_overridingSource; - } - - bool AllocatorOverrideShim::IsOverridden() const - { - return m_source != m_overridingSource; - } - - bool AllocatorOverrideShim::HasOrphanedAllocations() const - { - return !m_records.empty(); - } - - void AllocatorOverrideShim::SetFinalizedConfiguration() - { - m_finalizedConfiguration = true; - } - - typename AllocatorOverrideShim::pointer_type AllocatorOverrideShim::Allocate(size_type byteSize, size_type alignment, int flags, const char* name, const char* fileName, int lineNum, unsigned int suppressStackRecord) - { - pointer_type ptr = m_overridingSource->Allocate(byteSize, alignment, flags, name, fileName, lineNum, suppressStackRecord); - - if (!IsOverridden()) - { - lock_type lock(m_mutex); - m_records.insert(ptr); // Record in case we need to orphan this allocation later - } - - return ptr; - } - - void AllocatorOverrideShim::DeAllocate(pointer_type ptr, size_type byteSize, size_type alignment) - { - IAllocatorAllocate* source = m_overridingSource; - bool destroy = false; - - { - lock_type lock(m_mutex); - - // Check to see if this came from a prior allocation source - if (m_records.erase(ptr) && IsOverridden()) - { - source = m_source; - - if (m_records.empty() && m_finalizedConfiguration) - { - // All orphaned records are gone; we are no longer needed - m_owningAllocator->SetAllocationSource(m_overridingSource); - destroy = true; // Must destroy outside the lock - } - } - } - - source->DeAllocate(ptr, byteSize, alignment); - - if (destroy) - { - Destroy(this); - } - } - - typename AllocatorOverrideShim::size_type AllocatorOverrideShim::Resize(pointer_type ptr, size_type newSize) - { - IAllocatorAllocate* source = m_overridingSource; - - if (IsOverridden()) - { - // Determine who owns the allocation - lock_type lock(m_mutex); - - if (m_records.count(ptr)) - { - source = m_source; - } - } - - size_t result = source->Resize(ptr, newSize); - - return result; - } - - typename AllocatorOverrideShim::pointer_type AllocatorOverrideShim::ReAllocate(pointer_type ptr, size_type newSize, size_type newAlignment) - { - pointer_type newPtr = nullptr; - bool useOverride = true; - bool destroy = false; - - if (IsOverridden()) - { - lock_type lock(m_mutex); - - if (m_records.erase(ptr)) - { - // An old allocation needs to be transferred to the new, overriding allocator. - useOverride = false; // We'll do the reallocation here - size_t oldSize = m_source->AllocationSize(ptr); - - if (newSize) - { - newPtr = m_overridingSource->Allocate(newSize, newAlignment, 0); - memcpy(newPtr, ptr, AZStd::min(newSize, oldSize)); - } - - m_source->DeAllocate(ptr, oldSize); - - if (m_records.empty() && m_finalizedConfiguration) - { - // All orphaned records are gone; we are no longer needed - m_owningAllocator->SetAllocationSource(m_overridingSource); - destroy = true; // Must destroy outside the lock - } - } - } - - if (useOverride) - { - // Default behavior, we weren't deleting an old allocation - newPtr = m_overridingSource->ReAllocate(ptr, newSize, newAlignment); - - if (!IsOverridden()) - { - // Still need to do bookkeeping if we haven't been overridden yet - lock_type lock(m_mutex); - m_records.erase(ptr); - m_records.insert(newPtr); - } - } - - if (destroy) - { - Destroy(this); - } - - return newPtr; - } - - typename AllocatorOverrideShim::size_type AllocatorOverrideShim::AllocationSize(pointer_type ptr) - { - IAllocatorAllocate* source = m_overridingSource; - - if (IsOverridden()) - { - // Determine who owns the allocation - lock_type lock(m_mutex); - - if (m_records.count(ptr)) - { - source = m_source; - } - } - - return source->AllocationSize(ptr); - } - - void AllocatorOverrideShim::GarbageCollect() - { - m_source->GarbageCollect(); - } - - typename AllocatorOverrideShim::size_type AllocatorOverrideShim::NumAllocatedBytes() const - { - return m_source->NumAllocatedBytes(); - } - - typename AllocatorOverrideShim::size_type AllocatorOverrideShim::Capacity() const - { - return m_source->Capacity(); - } - - typename AllocatorOverrideShim::size_type AllocatorOverrideShim::GetMaxAllocationSize() const - { - return m_source->GetMaxAllocationSize(); - } - - auto AllocatorOverrideShim::GetMaxContiguousAllocationSize() const -> size_type - { - return m_source->GetMaxContiguousAllocationSize(); - } - - IAllocatorAllocate* AllocatorOverrideShim::GetSubAllocator() - { - return m_source->GetSubAllocator(); - } - -} // namespace AZ::Internal diff --git a/Code/Framework/AzCore/AzCore/Memory/AllocatorOverrideShim.h b/Code/Framework/AzCore/AzCore/Memory/AllocatorOverrideShim.h deleted file mode 100644 index 3b45b9953e..0000000000 --- a/Code/Framework/AzCore/AzCore/Memory/AllocatorOverrideShim.h +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#pragma once - -#include -#include -#include - -namespace AZ -{ - class AllocatorManager; - - namespace Internal - { - /** - * A shim schema that solves the problem of overriding lazily-created allocators especially, that perform allocations before the override happens. - * - * Any allocator that *might* be overridden at some point must have this shim installed as its allocation source. This is done automatically by - * the AllocationManager; you generally do not have to interact with this shim directly at all. - * - * The shim will keep track of any allocations that occur, and if the allocator gets overridden it will ensure that prior allocations are - * deallocated with the old schema rather than the new one. - * - * There is some performance cost to this intrusion, however, in most cases it's only temporary: - * * Once the application calls FinalizeConfiguration(), any non-overridden allocators will have their shims destroyed. - * * Any overridden allocators that do not have prior allocations will have their shims destroyed. - * * Any overridden allocator will automatically destroy its shim once the last of the prior allocations has been deallocated. - * - * Note that an allocator that gets overridden but has prior allocations that it never intends to deallocate (such as file-level statics that never - * get changed) will keep its shim indefinitely. This is an unfortunate cost but only affects those allocators if they are being overridden. - */ - class AllocatorOverrideShim - : public IAllocatorAllocate - { - friend AllocatorManager; - - public: - //--------------------------------------------------------------------- - // IAllocator implementation - //--------------------------------------------------------------------- - pointer_type Allocate(size_type byteSize, size_type alignment, int flags = 0, const char* name = nullptr, const char* fileName = nullptr, int lineNum = 0, unsigned int suppressStackRecord = 0) override; - void DeAllocate(pointer_type ptr, size_type byteSize = 0, size_type alignment = 0) override; - size_type Resize(pointer_type ptr, size_type newSize) override; - pointer_type ReAllocate(pointer_type ptr, size_type newSize, size_type newAlignment) override; - size_type AllocationSize(pointer_type ptr) override; - void GarbageCollect() override; - size_type NumAllocatedBytes() const override; - size_type Capacity() const override; - size_type GetMaxAllocationSize() const override; - size_type GetMaxContiguousAllocationSize() const override; - IAllocatorAllocate* GetSubAllocator() override; - - private: - /// Creates a shim using a custom memory source - static AllocatorOverrideShim* Create(IAllocator* owningAllocator, IAllocatorAllocate* shimAllocationSource); - static void Destroy(AllocatorOverrideShim* source); - - AllocatorOverrideShim(IAllocator* owningAllocator, IAllocatorAllocate* shimAllocationSource); - - /// Overrides the shim's memory source with a different memory source. - void SetOverride(IAllocatorAllocate* source); - - /// Returns the override source. - IAllocatorAllocate* GetOverride() const; - - /// Returns true if the shim has an override source set on it. - bool IsOverridden() const; - - /// Returns true if there are orphaned allocations from before the shim had its override set. - bool HasOrphanedAllocations() const; - - /// Called by the AllocatorManager to signify that the configuration has been finalized by the application. - void SetFinalizedConfiguration(); - - private: - class StdAllocationSrc : public AZStdIAllocator - { - public: - StdAllocationSrc(IAllocatorAllocate* schema = nullptr) : AZStdIAllocator(schema) - { - } - }; - - typedef AZStd::mutex mutex_type; - typedef AZStd::lock_guard lock_type; - typedef AZStd::unordered_set, AZStd::equal_to, StdAllocationSrc> AllocationSet; - - IAllocator* m_owningAllocator; - IAllocatorAllocate* m_source; - IAllocatorAllocate* m_overridingSource; - IAllocatorAllocate* m_shimAllocationSource; - AllocationSet m_records; - mutex_type m_mutex; - bool m_finalizedConfiguration = false; - }; - } -} diff --git a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.cpp b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.cpp index 30b0b78fe5..da960ce3f3 100644 --- a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.cpp @@ -20,8 +20,7 @@ using namespace AZ; // [1/28/2011] //========================================================================= BestFitExternalMapAllocator::BestFitExternalMapAllocator() - : AllocatorBase(this, "BestFitExternalMapAllocator", "Best fit allocator with external tracking storage!") - , m_schema(nullptr) + : AllocatorBase(nullptr, "BestFitExternalMapAllocator", "Best fit allocator with external tracking storage!") {} //========================================================================= @@ -186,13 +185,3 @@ auto BestFitExternalMapAllocator::GetMaxContiguousAllocationSize() const -> size { return m_schema->GetMaxContiguousAllocationSize(); } - -//========================================================================= -// GetSubAllocator -// [1/28/2011] -//========================================================================= -IAllocatorAllocate* -BestFitExternalMapAllocator::GetSubAllocator() -{ - return m_schema->GetSubAllocator(); -} diff --git a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.h b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.h index 17425625b7..2cad404cd0 100644 --- a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.h +++ b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.h @@ -20,7 +20,6 @@ namespace AZ */ class BestFitExternalMapAllocator : public AllocatorBase - , public IAllocatorAllocate { public: AZ_TYPE_INFO(BestFitExternalMapAllocator, "{36266C8B-9A2C-4E3E-9812-3DB260868A2B}") @@ -38,7 +37,7 @@ namespace AZ static const int m_memoryBlockAlignment = 16; void* m_memoryBlock; ///< Pointer to memory to allocate from. Can be uncached. unsigned int m_memoryBlockByteSize; ///< Sizes if the memory block. - IAllocatorAllocate* m_mapAllocator; ///< Allocator for the free chunks map. If null the SystemAllocator will be used. + IAllocator* m_mapAllocator; ///< Allocator for the free chunks map. If null the SystemAllocator will be used. bool m_allocationRecords; ///< True if we want to track memory allocations, otherwise false. unsigned char m_stackRecordLevels; ///< If stack recording is enabled, how many stack levels to record. @@ -53,7 +52,7 @@ namespace AZ AllocatorDebugConfig GetDebugConfig() override; ////////////////////////////////////////////////////////////////////////// - // IAllocatorAllocate + // IAllocatorSchema pointer_type Allocate(size_type byteSize, size_type alignment, int flags = 0, const char* name = 0, const char* fileName = 0, int lineNum = 0, unsigned int suppressStackRecord = 0) override; void DeAllocate(pointer_type ptr, size_type byteSize = 0, size_type alignment = 0) override; size_type Resize(pointer_type ptr, size_type newSize) override; @@ -64,7 +63,6 @@ namespace AZ size_type Capacity() const override; size_type GetMaxAllocationSize() const override; size_type GetMaxContiguousAllocationSize() const override; - IAllocatorAllocate* GetSubAllocator() override; ////////////////////////////////////////////////////////////////////////// protected: @@ -72,7 +70,6 @@ namespace AZ BestFitExternalMapAllocator& operator=(const BestFitExternalMapAllocator&); Descriptor m_desc; - BestFitExternalMapSchema* m_schema; }; } diff --git a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.cpp b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.cpp index 715ecd221e..75356e85f3 100644 --- a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.cpp @@ -30,6 +30,7 @@ BestFitExternalMapSchema::BestFitExternalMapSchema(const Descriptor& desc) //if( m_desc.m_memoryBlock == NULL) there is no point to automate this cause we need to flag this memory special, otherwise there is no point to use this allocator at all // m_desc.m_memoryBlock = azmalloc(SystemAllocator,m_desc.m_memoryBlockByteSize,16); m_freeChunksMap.insert(AZStd::make_pair(m_desc.m_memoryBlockByteSize, reinterpret_cast(m_desc.m_memoryBlock))); + } //========================================================================= @@ -37,7 +38,7 @@ BestFitExternalMapSchema::BestFitExternalMapSchema(const Descriptor& desc) // [1/28/2011] //========================================================================= BestFitExternalMapSchema::pointer_type -BestFitExternalMapSchema::Allocate(size_type byteSize, size_type alignment, int flags) +BestFitExternalMapSchema::Allocate(size_type byteSize, size_type alignment, int flags, const char*, const char*, int, unsigned int) { (void)flags; char* address = nullptr; @@ -91,8 +92,7 @@ BestFitExternalMapSchema::Allocate(size_type byteSize, size_type alignment, int // DeAllocate // [1/28/2011] //========================================================================= -void -BestFitExternalMapSchema::DeAllocate(pointer_type ptr) +void BestFitExternalMapSchema::DeAllocate(pointer_type ptr, size_type, size_type) { if (ptr == nullptr) { @@ -122,6 +122,20 @@ BestFitExternalMapSchema::AllocationSize(pointer_type ptr) return 0; } +BestFitExternalMapSchema::size_type +BestFitExternalMapSchema::Resize(pointer_type, size_type) +{ + AZ_Assert(false, AZ_FUNCTION_SIGNATURE " unsupported"); + return 0; +} + +BestFitExternalMapSchema::pointer_type +BestFitExternalMapSchema::ReAllocate(pointer_type, size_type, size_type) +{ + AZ_Assert(false, AZ_FUNCTION_SIGNATURE " unsupported"); + return nullptr; +} + //========================================================================= // GetMaxAllocationSize // [1/28/2011] diff --git a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.h b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.h index eaab614593..63e9027dd2 100644 --- a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.h +++ b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.h @@ -21,7 +21,7 @@ namespace AZ * External map allows us to use this allocator with uncached memory, * because the tracking node is stored outside the main chunk. */ - class BestFitExternalMapSchema + class BestFitExternalMapSchema : public IAllocatorSchema { public: typedef void* pointer_type; @@ -45,26 +45,27 @@ namespace AZ static const int m_memoryBlockAlignment = 16; void* m_memoryBlock; ///< Pointer to memory to allocate from. Can be uncached. unsigned int m_memoryBlockByteSize; ///< Sizes if the memory block. - IAllocatorAllocate* m_mapAllocator; ///< Allocator for the free chunks map. If null the SystemAllocator will be used. + IAllocator* m_mapAllocator; ///< Allocator for the free chunks map. If null the SystemAllocator will be used. }; BestFitExternalMapSchema(const Descriptor& desc); - pointer_type Allocate(size_type byteSize, size_type alignment, int flags); - void DeAllocate(pointer_type ptr); - size_type AllocationSize(pointer_type ptr); + pointer_type Allocate(size_type byteSize, size_type alignment, int flags = 0, const char* name = 0, const char* fileName = 0, int lineNum = 0, unsigned int suppressStackRecord = 0) override; + void DeAllocate(pointer_type ptr, size_type byteSize = 0, size_type alignment = 0) override; + size_type Resize(pointer_type ptr, size_type newSize) override; + pointer_type ReAllocate(pointer_type ptr, size_type newSize, size_type newAlignment) override; + size_type AllocationSize(pointer_type ptr) override; - AZ_FORCE_INLINE size_type NumAllocatedBytes() const { return m_used; } - AZ_FORCE_INLINE size_type Capacity() const { return m_desc.m_memoryBlockByteSize; } - size_type GetMaxAllocationSize() const; - size_type GetMaxContiguousAllocationSize() const; - AZ_FORCE_INLINE IAllocatorAllocate* GetSubAllocator() const { return m_desc.m_mapAllocator; } + AZ_FORCE_INLINE size_type NumAllocatedBytes() const override { return m_used; } + AZ_FORCE_INLINE size_type Capacity() const override { return m_desc.m_memoryBlockByteSize; } + size_type GetMaxAllocationSize() const override; + size_type GetMaxContiguousAllocationSize() const override; /** - * Since we don't consolidate chucnks at free time (too expensive) we will do it as we need or when we can't + * Since we don't consolidate chunks at free time (too expensive) we will do it as we need or when we can't * allocate memory. This function is at least O(nlogn) where 'n' are the free chunks. */ - void GarbageCollect(); + void GarbageCollect() override; private: AZ_FORCE_INLINE size_type ChunckSize(pointer_type ptr); diff --git a/Code/Framework/AzCore/AzCore/Memory/HeapSchema.cpp b/Code/Framework/AzCore/AzCore/Memory/HeapSchema.cpp index 1f0fc59a97..98ca1f87ed 100644 --- a/Code/Framework/AzCore/AzCore/Memory/HeapSchema.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/HeapSchema.cpp @@ -107,7 +107,6 @@ namespace AZ m_used = 0; m_desc = desc; - m_subAllocator = nullptr; for (int i = 0; i < Descriptor::m_maxNumBlocks; ++i) { diff --git a/Code/Framework/AzCore/AzCore/Memory/HeapSchema.h b/Code/Framework/AzCore/AzCore/Memory/HeapSchema.h index 3a7716a127..ea4a4ebdc6 100644 --- a/Code/Framework/AzCore/AzCore/Memory/HeapSchema.h +++ b/Code/Framework/AzCore/AzCore/Memory/HeapSchema.h @@ -17,7 +17,7 @@ namespace AZ * Internally uses use dlmalloc or version of it (nedmalloc, ptmalloc3). */ class HeapSchema - : public IAllocatorAllocate + : public IAllocatorSchema { public: typedef void* pointer_type; @@ -52,7 +52,6 @@ namespace AZ size_type Capacity() const override { return m_capacity; } size_type GetMaxAllocationSize() const override; size_type GetMaxContiguousAllocationSize() const override; - IAllocatorAllocate* GetSubAllocator() override { return m_subAllocator; } void GarbageCollect() override {} private: @@ -62,7 +61,7 @@ namespace AZ Descriptor m_desc; size_type m_capacity; ///< Capacity in bytes. size_type m_used; ///< Number of bytes in use. - IAllocatorAllocate* m_subAllocator; + IAllocatorSchema* m_subAllocator; bool m_ownMemoryBlock[Descriptor::m_maxNumBlocks]; }; } diff --git a/Code/Framework/AzCore/AzCore/Memory/HphaSchema.cpp b/Code/Framework/AzCore/AzCore/Memory/HphaSchema.cpp index 6e40ccd8cd..6891eb4248 100644 --- a/Code/Framework/AzCore/AzCore/Memory/HphaSchema.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/HphaSchema.cpp @@ -1081,7 +1081,7 @@ namespace AZ { const size_t m_treePageAlignment; const size_t m_poolPageSize; bool m_isPoolAllocations; - IAllocatorAllocate* m_subAllocator; + IAllocatorSchema* m_subAllocator; #if !defined (USE_MUTEX_PER_BUCKET) mutable AZStd::mutex m_mutex; diff --git a/Code/Framework/AzCore/AzCore/Memory/HphaSchema.h b/Code/Framework/AzCore/AzCore/Memory/HphaSchema.h index 5ee0205196..27dbd321d2 100644 --- a/Code/Framework/AzCore/AzCore/Memory/HphaSchema.h +++ b/Code/Framework/AzCore/AzCore/Memory/HphaSchema.h @@ -19,7 +19,7 @@ namespace AZ * Heap allocator schema, based on Dimitar Lazarov "High Performance Heap Allocator". */ class HphaSchema - : public IAllocatorAllocate + : public IAllocatorSchema { public: /** @@ -47,7 +47,7 @@ namespace AZ unsigned int m_isPoolAllocations : 1; ///< True to allow allocations from pools, otherwise false. size_t m_fixedMemoryBlockByteSize; ///< Memory block size, if 0 we use the OS memory allocation functions. void* m_fixedMemoryBlock; ///< Can be NULL if so the we will allocate memory from the subAllocator if m_memoryBlocksByteSize is != 0. - IAllocatorAllocate* m_subAllocator; ///< Allocator that m_memoryBlocks memory was allocated from or should be allocated (if NULL). + IAllocatorSchema* m_subAllocator; ///< Allocator that m_memoryBlocks memory was allocated from or should be allocated (if NULL). size_t m_systemChunkSize; ///< Size of chunk to request from the OS when more memory is needed (defaults to m_pageSize) size_t m_capacity; ///< Max size this allocator can grow to }; @@ -68,7 +68,6 @@ namespace AZ size_type GetMaxAllocationSize() const override; size_type GetMaxContiguousAllocationSize() const override; size_type GetUnAllocatedMemory(bool isPrint = false) const override; - IAllocatorAllocate* GetSubAllocator() override { return m_desc.m_subAllocator; } /// Return unused memory to the OS (if we don't use fixed block). Don't call this unless you really need free memory, it is slow. void GarbageCollect() override; diff --git a/Code/Framework/AzCore/AzCore/Memory/IAllocator.cpp b/Code/Framework/AzCore/AzCore/Memory/IAllocator.cpp index 08c567bf84..2d561b45ef 100644 --- a/Code/Framework/AzCore/AzCore/Memory/IAllocator.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/IAllocator.cpp @@ -9,23 +9,12 @@ namespace AZ { - IAllocator::IAllocator(IAllocatorAllocate* allocationSource) - : m_allocationSource(allocationSource) - , m_originalAllocationSource(allocationSource) + IAllocator::IAllocator(IAllocatorSchema* schema) + : m_schema(schema) { } IAllocator::~IAllocator() { } - - void IAllocator::SetAllocationSource(IAllocatorAllocate* allocationSource) - { - m_allocationSource = allocationSource; - } - - void IAllocator::ResetAllocationSource() - { - m_allocationSource = m_originalAllocationSource; - } } diff --git a/Code/Framework/AzCore/AzCore/Memory/IAllocator.h b/Code/Framework/AzCore/AzCore/Memory/IAllocator.h index 532335e50b..319175f9ee 100644 --- a/Code/Framework/AzCore/AzCore/Memory/IAllocator.h +++ b/Code/Framework/AzCore/AzCore/Memory/IAllocator.h @@ -28,17 +28,16 @@ namespace AZ class AllocatorManager; /** - * Allocator alloc/free basic interface. It is separate because it can be used - * for user provided allocators overrides + * Allocator schema interface */ - class IAllocatorAllocate + class IAllocatorSchema { public: typedef void* pointer_type; typedef size_t size_type; typedef ptrdiff_t difference_type; - virtual ~IAllocatorAllocate() {} + virtual ~IAllocatorSchema() {} virtual pointer_type Allocate(size_type byteSize, size_type alignment, int flags = 0, const char* name = 0, const char* fileName = 0, int lineNum = 0, unsigned int suppressStackRecord = 0) = 0; virtual void DeAllocate(pointer_type ptr, size_type byteSize = 0, size_type alignment = 0) = 0; @@ -70,8 +69,6 @@ namespace AZ * that will be reported. */ virtual size_type GetUnAllocatedMemory(bool isPrint = false) const { (void)isPrint; return 0; } - /// Returns a pointer to a sub-allocator or NULL. - virtual IAllocatorAllocate* GetSubAllocator() = 0; }; /** @@ -100,56 +97,19 @@ namespace AZ /** * Interface class for all allocators. */ - class IAllocator + class IAllocator : public IAllocatorSchema { public: - IAllocator(IAllocatorAllocate* allocationSource); + IAllocator(IAllocatorSchema* schema = nullptr); virtual ~IAllocator(); - // @{ Every system allocator is required to provide name this is how + // Every system allocator is required to provide name this is how // it will be registered with the allocator manager. virtual const char* GetName() const = 0; virtual const char* GetDescription() const = 0; - // @} - - //--------------------------------------------------------------------- - // Code releating to the allocation source is made concrete within this - // interface as a performance optimization. - //--------------------------------------------------------------------- - - /// Returns the current allocation source, which may be used to perform memory allocations. - AZ_FORCE_INLINE IAllocatorAllocate* GetAllocationSource() const - { - return m_allocationSource; - } - - /// Returns the original allocation source. Generally only used for debugging purposes. - AZ_FORCE_INLINE IAllocatorAllocate* GetOriginalAllocationSource() const - { - return m_originalAllocationSource; - } - - /// Returns true if the allocation source has changed from its original value. - AZ_FORCE_INLINE bool IsAllocationSourceChanged() const - { - return m_allocationSource != m_originalAllocationSource; - } - - /// Sets the allocation source, effectively overriding the allocator. - /// Be very careful doing this, as existing allocations will be deallocated through the new source, - /// typically leading to unwanted effects (such as crashes). - void SetAllocationSource(IAllocatorAllocate* allocationSource); - - /// Restores the allocation source to its original value. - /// Be very careful doing this, as allocations that came from the new source will now be deallocated - /// through the original source, typically leading to unwanted effects (such as crashes). - void ResetAllocationSource(); - - //--------------------------------------------------------------------- - - /// Returns the schema, if the allocator uses one. Returns nullptr if the allocator does not use a schema. - /// This is mainly used when debugging to determine if allocators alias each other under the hood. - virtual IAllocatorAllocate* GetSchema() = 0; + + /// Returns the schema + AZ_FORCE_INLINE IAllocatorSchema* GetSchema() const { return m_schema; }; /// Returns the debug configuration for this allocator. virtual AllocatorDebugConfig GetDebugConfig() = 0; @@ -163,11 +123,6 @@ namespace AZ /// Returns true if this allocator is ready to use. virtual bool IsReady() const = 0; - /// Returns true if this allocator can be overridden with a different source. - /// Almost all allocators should return true. There are very few minor exceptions, such as the OS Allocator, that are required for direct - /// interfacing with the kernel and must never be overridden under any circumstances. - virtual bool CanBeOverridden() const = 0; - /// Returns true if the allocator was lazily created. Exposed primarily for testing systems that need to verify the state of allocators. virtual bool IsLazilyCreated() const = 0; @@ -195,9 +150,7 @@ namespace AZ virtual void Destroy() = 0; protected: - // The allocation source is made a direct member of the interface as a performance optimization. - IAllocatorAllocate * m_allocationSource; - IAllocatorAllocate* m_originalAllocationSource; + IAllocatorSchema* m_schema; template friend class AllocatorStorage::StoragePolicyBase; diff --git a/Code/Framework/AzCore/AzCore/Memory/MallocSchema.cpp b/Code/Framework/AzCore/AzCore/Memory/MallocSchema.cpp index 9aa31cd8b6..37fa277fab 100644 --- a/Code/Framework/AzCore/AzCore/Memory/MallocSchema.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/MallocSchema.cpp @@ -22,31 +22,15 @@ namespace AZ::Internal namespace AZ { + static constexpr size_t DEFAULT_ALIGNMENT = sizeof(void*) * 2; // Default malloc alignment + //--------------------------------------------------------------------- // MallocSchema methods //--------------------------------------------------------------------- - MallocSchema::MallocSchema(const Descriptor& desc) + MallocSchema::MallocSchema(const Descriptor&) : m_bytesAllocated(0) { - if (desc.m_useAZMalloc) - { - static const int DEFAULT_ALIGNMENT = sizeof(void*) * 2; // Default malloc alignment - - m_mallocFn = [](size_t byteSize) - { - return AZ_OS_MALLOC(byteSize, DEFAULT_ALIGNMENT); - }; - m_freeFn = [](void* ptr) - { - AZ_OS_FREE(ptr); - }; - } - else - { - m_mallocFn = &malloc; - m_freeFn = &free; - } } MallocSchema::~MallocSchema() @@ -84,7 +68,7 @@ namespace AZ ((alignment > sizeof(double)) ? alignment : 0); // Malloc will align to a minimum boundary for native objects, so we only pad if aligning to a large value - void* data = (*m_mallocFn)(required); + void* data = AZ_OS_MALLOC(required, DEFAULT_ALIGNMENT); void* result = PointerAlignUp(reinterpret_cast(reinterpret_cast(data) + sizeof(Internal::Header)), alignment); Internal::Header* header = PointerAlignDown( (Internal::Header*)(reinterpret_cast(result) - sizeof(Internal::Header)), AZStd::alignment_of::value); @@ -112,7 +96,7 @@ namespace AZ void* freePtr = reinterpret_cast(reinterpret_cast(ptr) - static_cast(header->offset)); m_bytesAllocated -= header->size; - (*m_freeFn)(freePtr); + AZ_OS_FREE(freePtr); } MallocSchema::pointer_type MallocSchema::ReAllocate(pointer_type ptr, size_type newSize, size_type newAlignment) @@ -166,11 +150,6 @@ namespace AZ return AZ_CORE_MAX_ALLOCATOR_SIZE; } - IAllocatorAllocate* MallocSchema::GetSubAllocator() - { - return nullptr; - } - void MallocSchema::GarbageCollect() { } diff --git a/Code/Framework/AzCore/AzCore/Memory/MallocSchema.h b/Code/Framework/AzCore/AzCore/Memory/MallocSchema.h index 7a8c4a0366..02559fdb57 100644 --- a/Code/Framework/AzCore/AzCore/Memory/MallocSchema.h +++ b/Code/Framework/AzCore/AzCore/Memory/MallocSchema.h @@ -16,7 +16,7 @@ namespace AZ * Uses malloc internally. Mainly intended for debugging using host operating system features. */ class MallocSchema - : public IAllocatorAllocate + : public IAllocatorSchema { public: AZ_TYPE_INFO("MallocSchema", "{2A21D120-A42A-484C-997C-5735DCCA5FE9}"); @@ -25,21 +25,13 @@ namespace AZ typedef size_t size_type; typedef ptrdiff_t difference_type; - struct Descriptor - { - Descriptor(bool useAZMalloc = true) - : m_useAZMalloc(useAZMalloc) - { - } - - bool m_useAZMalloc; - }; + struct Descriptor {}; MallocSchema(const Descriptor& desc = Descriptor()); virtual ~MallocSchema(); //--------------------------------------------------------------------- - // IAllocatorAllocate + // IAllocatorSchema //--------------------------------------------------------------------- pointer_type Allocate(size_type byteSize, size_type alignment, int flags, const char* name = 0, const char* fileName = 0, int lineNum = 0, unsigned int suppressStackRecord = 0) override; void DeAllocate(pointer_type ptr, size_type byteSize = 0, size_type alignment = 0) override; @@ -51,15 +43,9 @@ namespace AZ size_type Capacity() const override; size_type GetMaxAllocationSize() const override; size_type GetMaxContiguousAllocationSize() const override; - IAllocatorAllocate* GetSubAllocator() override; void GarbageCollect() override; private: - typedef void* (*MallocFn)(size_t); - typedef void (*FreeFn)(void*); - AZStd::atomic m_bytesAllocated; - MallocFn m_mallocFn; - FreeFn m_freeFn; }; } diff --git a/Code/Framework/AzCore/AzCore/Memory/Memory.h b/Code/Framework/AzCore/AzCore/Memory/Memory.h index 2e08ec1b15..2ecba6ebff 100644 --- a/Code/Framework/AzCore/AzCore/Memory/Memory.h +++ b/Code/Framework/AzCore/AzCore/Memory/Memory.h @@ -141,9 +141,9 @@ void* operator new[](std::size_t, const AZ::Internal::AllocatorDummy*); */ #define azfree(...) AZ_MACRO_SPECIALIZE(azfree_, AZ_VA_NUM_ARGS(__VA_ARGS__), (__VA_ARGS__)) -/// Returns allocation size, based on it's pointer \ref AZ::IAllocatorAllocate::AllocationSize. +/// Returns allocation size, based on it's pointer \ref AZ::IAllocatorSchema::AllocationSize. #define azallocsize(_Ptr, _Allocator) AZ::AllocatorInstance< _Allocator >::Get().AllocationSize(_Ptr) -/// Returns the new expanded size or 0 if NOT supported by the allocator \ref AZ::IAllocatorAllocate::Resize. +/// Returns the new expanded size or 0 if NOT supported by the allocator \ref AZ::IAllocatorSchema::Resize. #define azallocresize(_Ptr, _NewSize, _Allocator) AZ::AllocatorInstance< _Allocator >::Get().Resize(_Ptr, _NewSize) namespace AZ { @@ -734,12 +734,15 @@ namespace AZ public: typedef typename Allocator::Descriptor Descriptor; - AZ_FORCE_INLINE static IAllocatorAllocate& Get() + // Maintained for backwards compatibility, prefer to use Get() instead. + // Get was previously used to get the the schema, however, that bypases what the allocators are doing. + // If the schema is needed, call Get().GetSchema() + AZ_FORCE_INLINE static IAllocator& GetAllocator() { - return *GetAllocator().GetAllocationSource(); + return StoragePolicy::GetAllocator(); } - AZ_FORCE_INLINE static IAllocator& GetAllocator() + AZ_FORCE_INLINE static IAllocator& Get() { return StoragePolicy::GetAllocator(); } @@ -781,7 +784,7 @@ namespace AZ // structure of another allocator template class ChildAllocatorSchema - : public IAllocatorAllocate + : public IAllocatorSchema { public: // No descriptor is necessary, as the parent allocator is expected to already @@ -792,7 +795,7 @@ namespace AZ ChildAllocatorSchema(const Descriptor&) {} //--------------------------------------------------------------------- - // IAllocatorAllocate + // IAllocatorSchema //--------------------------------------------------------------------- pointer_type Allocate(size_type byteSize, size_type alignment, int flags = 0, const char* name = 0, const char* fileName = 0, int lineNum = 0, unsigned int suppressStackRecord = 0) override { @@ -848,11 +851,6 @@ namespace AZ { return AZ::AllocatorInstance::Get().GetUnAllocatedMemory(isPrint); } - - IAllocatorAllocate* GetSubAllocator() override - { - return AZ::AllocatorInstance::Get().GetSubAllocator(); - } }; /** @@ -873,7 +871,7 @@ namespace AZ { if (AllocatorInstance::IsReady()) { - m_name = AllocatorInstance::GetAllocator().GetName(); + m_name = AllocatorInstance::Get().GetName(); } else { @@ -932,7 +930,7 @@ namespace AZ typedef AZStd::ptrdiff_t difference_type; typedef AZStd::false_type allow_memory_leaks; ///< Regular allocators should not leak. - AZ_FORCE_INLINE AZStdIAllocator(IAllocatorAllocate* allocator, const char* name = "AZ::AZStdIAllocator") + AZ_FORCE_INLINE AZStdIAllocator(IAllocator* allocator, const char* name = "AZ::AZStdIAllocator") : m_allocator(allocator) , m_name(name) { @@ -965,7 +963,7 @@ namespace AZ AZ_FORCE_INLINE bool operator==(const AZStdIAllocator& rhs) const { return m_allocator == rhs.m_allocator; } AZ_FORCE_INLINE bool operator!=(const AZStdIAllocator& rhs) const { return m_allocator != rhs.m_allocator; } private: - IAllocatorAllocate* m_allocator; + IAllocator* m_allocator; const char* m_name; }; @@ -982,8 +980,8 @@ namespace AZ using size_type = AZStd::size_t; using difference_type = AZStd::ptrdiff_t; using allow_memory_leaks = AZStd::false_type; ///< Regular allocators should not leak. - using functor_type = IAllocatorAllocate&(*)(); ///< Function Pointer must return IAllocatorAllocate&. - ///< function pointers do not support covariant return types + using functor_type = IAllocator&(*)(); ///< Function Pointer must return IAllocator&. + ///< function pointers do not support covariant return types constexpr AZStdFunctorAllocator(functor_type allocatorFunctor, const char* name = "AZ::AZStdFunctorAllocator") : m_allocatorFunctor(allocatorFunctor) diff --git a/Code/Framework/AzCore/AzCore/Memory/OSAllocator.cpp b/Code/Framework/AzCore/AzCore/Memory/OSAllocator.cpp index 317df214d6..293cd92354 100644 --- a/Code/Framework/AzCore/AzCore/Memory/OSAllocator.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/OSAllocator.cpp @@ -19,7 +19,6 @@ namespace AZ , m_custom(nullptr) , m_numAllocatedBytes(0) { - DisableOverriding(); } //========================================================================= diff --git a/Code/Framework/AzCore/AzCore/Memory/OSAllocator.h b/Code/Framework/AzCore/AzCore/Memory/OSAllocator.h index 3a8080483b..0bdf7d9fed 100644 --- a/Code/Framework/AzCore/AzCore/Memory/OSAllocator.h +++ b/Code/Framework/AzCore/AzCore/Memory/OSAllocator.h @@ -24,7 +24,6 @@ namespace AZ */ class OSAllocator : public AllocatorBase - , public IAllocatorAllocate { public: AZ_TYPE_INFO(OSAllocator, "{9F835EE3-F23C-454E-B4E3-011E2F3C8118}") @@ -39,7 +38,7 @@ namespace AZ { Descriptor() : m_custom(0) {} - IAllocatorAllocate* m_custom; ///< You can provide our own allocation scheme. If NULL a HeapScheme will be used with the provided Descriptor. + IAllocatorSchema* m_custom; ///< You can provide our own allocation scheme. If NULL a HeapScheme will be used with the provided Descriptor. }; bool Create(const Descriptor& desc); @@ -51,7 +50,7 @@ namespace AZ AllocatorDebugConfig GetDebugConfig() override; ////////////////////////////////////////////////////////////////////////// - // IAllocatorAllocate + // IAllocatorSchema pointer_type Allocate(size_type byteSize, size_type alignment, int flags = 0, const char* name = 0, const char* fileName = 0, int lineNum = 0, unsigned int suppressStackRecord = 0) override; void DeAllocate(pointer_type ptr, size_type byteSize = 0, size_type alignment = 0) override; size_type Resize(pointer_type ptr, size_type newSize) override { return m_custom ? m_custom->Resize(ptr, newSize) : 0; } @@ -62,13 +61,12 @@ namespace AZ size_type Capacity() const override { return m_custom ? m_custom->Capacity() : AZ_CORE_MAX_ALLOCATOR_SIZE; } // custom size or unlimited size_type GetMaxAllocationSize() const override { return m_custom ? m_custom->GetMaxAllocationSize() : AZ_CORE_MAX_ALLOCATOR_SIZE; } // custom size or unlimited size_type GetMaxContiguousAllocationSize() const override { return m_custom ? m_custom->GetMaxContiguousAllocationSize() : AZ_CORE_MAX_ALLOCATOR_SIZE; } // custom size or unlimited - IAllocatorAllocate* GetSubAllocator() override { return m_custom ? m_custom : NULL; } protected: OSAllocator(const OSAllocator&); OSAllocator& operator=(const OSAllocator&); - IAllocatorAllocate* m_custom; + IAllocatorSchema* m_custom; size_type m_numAllocatedBytes; }; diff --git a/Code/Framework/AzCore/AzCore/Memory/OverrunDetectionAllocator.cpp b/Code/Framework/AzCore/AzCore/Memory/OverrunDetectionAllocator.cpp index ed5e0febc2..096fbbac95 100644 --- a/Code/Framework/AzCore/AzCore/Memory/OverrunDetectionAllocator.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/OverrunDetectionAllocator.cpp @@ -233,7 +233,6 @@ namespace AZ size_type Capacity() const; size_type GetMaxAllocationSize() const; size_type GetMaxContiguousAllocationSize() const; - IAllocatorAllocate* GetSubAllocator(); void GarbageCollect(); private: @@ -680,11 +679,6 @@ auto AZ::OverrunDetectionSchemaImpl::GetMaxContiguousAllocationSize() const -> s return 0; } -AZ::IAllocatorAllocate* AZ::OverrunDetectionSchemaImpl::GetSubAllocator() -{ - return nullptr; -} - void AZ::OverrunDetectionSchemaImpl::GarbageCollect() { } @@ -810,11 +804,6 @@ auto AZ::OverrunDetectionSchema::GetMaxContiguousAllocationSize() const -> size_ return m_impl->GetMaxContiguousAllocationSize(); } -AZ::IAllocatorAllocate* AZ::OverrunDetectionSchema::GetSubAllocator() -{ - return m_impl->GetSubAllocator(); -} - void AZ::OverrunDetectionSchema::GarbageCollect() { m_impl->GarbageCollect(); diff --git a/Code/Framework/AzCore/AzCore/Memory/OverrunDetectionAllocator.h b/Code/Framework/AzCore/AzCore/Memory/OverrunDetectionAllocator.h index 9895a5f84f..073b54160b 100644 --- a/Code/Framework/AzCore/AzCore/Memory/OverrunDetectionAllocator.h +++ b/Code/Framework/AzCore/AzCore/Memory/OverrunDetectionAllocator.h @@ -27,7 +27,7 @@ namespace AZ * the requested memory, plus the trap page). On most platforms this is 8kb (4kb * 2 pages). */ class OverrunDetectionSchema - : public IAllocatorAllocate + : public IAllocatorSchema { public: AZ_TYPE_INFO("OverrunDetectionSchema", "{0DF781AC-1615-40AE-81F7-6CA5841E2914}"); @@ -75,7 +75,7 @@ namespace AZ virtual ~OverrunDetectionSchema(); //--------------------------------------------------------------------- - // IAllocatorAllocate + // IAllocatorSchema //--------------------------------------------------------------------- pointer_type Allocate(size_type byteSize, size_type alignment, int flags, const char* name = 0, const char* fileName = 0, int lineNum = 0, unsigned int suppressStackRecord = 0) override; void DeAllocate(pointer_type ptr, size_type byteSize = 0, size_type alignment = 0) override; @@ -87,7 +87,6 @@ namespace AZ size_type Capacity() const override; size_type GetMaxAllocationSize() const override; size_type GetMaxContiguousAllocationSize() const override; - IAllocatorAllocate* GetSubAllocator() override; void GarbageCollect() override; private: diff --git a/Code/Framework/AzCore/AzCore/Memory/PoolAllocator.h b/Code/Framework/AzCore/AzCore/Memory/PoolAllocator.h index a03f7b5b92..f55c6251bf 100644 --- a/Code/Framework/AzCore/AzCore/Memory/PoolAllocator.h +++ b/Code/Framework/AzCore/AzCore/Memory/PoolAllocator.h @@ -102,7 +102,7 @@ namespace AZ } ////////////////////////////////////////////////////////////////////////// - // IAllocatorAllocate + // IAllocatorSchema pointer_type ReAllocate(pointer_type ptr, size_type newSize, size_type newAlignment) override { (void)ptr; diff --git a/Code/Framework/AzCore/AzCore/Memory/PoolSchema.cpp b/Code/Framework/AzCore/AzCore/Memory/PoolSchema.cpp index 9167864450..60f4f34f1d 100644 --- a/Code/Framework/AzCore/AzCore/Memory/PoolSchema.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/PoolSchema.cpp @@ -163,7 +163,7 @@ namespace AZ } using AllocatorType = PoolAllocation; - IAllocatorAllocate* m_pageAllocator; + IAllocatorSchema* m_pageAllocator; AllocatorType m_allocator; void* m_staticDataBlock; unsigned int m_numStaticPages; @@ -295,7 +295,7 @@ namespace AZ FreePagesType m_freePages; AZStd::vector m_threads; ///< Array with all separate thread data. Used to traverse end free elements. - IAllocatorAllocate* m_pageAllocator; + IAllocatorSchema* m_pageAllocator; void* m_staticDataBlock; size_t m_numStaticPages; size_t m_pageSize; @@ -732,17 +732,6 @@ PoolSchema::Capacity() const return m_impl->m_numStaticPages * m_impl->m_pageSize; } -//========================================================================= -// GetPageAllocator -// [11/17/2010] -//========================================================================= -IAllocatorAllocate* -PoolSchema::GetSubAllocator() -{ - return m_impl->m_pageAllocator; -} - - ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// // PollAllocator Implementation @@ -1090,16 +1079,6 @@ ThreadPoolSchema::Capacity() const return m_impl->m_numStaticPages * m_impl->m_pageSize; } -//========================================================================= -// GetPageAllocator -// [11/17/2010] -//========================================================================= -IAllocatorAllocate* -ThreadPoolSchema::GetSubAllocator() -{ - return m_impl->m_pageAllocator; -} - //========================================================================= // ThreadPoolSchemaImpl diff --git a/Code/Framework/AzCore/AzCore/Memory/PoolSchema.h b/Code/Framework/AzCore/AzCore/Memory/PoolSchema.h index cfc5e3ea07..d9faf976b3 100644 --- a/Code/Framework/AzCore/AzCore/Memory/PoolSchema.h +++ b/Code/Framework/AzCore/AzCore/Memory/PoolSchema.h @@ -22,7 +22,7 @@ namespace AZ * use ThreadPool Schema or do the sync yourself. */ class PoolSchema - : public IAllocatorAllocate + : public IAllocatorSchema { public: /** @@ -52,7 +52,7 @@ namespace AZ * this is the minimum number of pages we will have allocated at all times, otherwise the total number of pages supported. */ unsigned int m_numStaticPages; - IAllocatorAllocate* m_pageAllocator; ///< If you provide this interface we will use it for page allocations, otherwise SystemAllocator will be used. + IAllocatorSchema* m_pageAllocator; ///< If you provide this interface we will use it for page allocations, otherwise SystemAllocator will be used. }; PoolSchema(const Descriptor& desc = Descriptor()); @@ -73,7 +73,6 @@ namespace AZ size_type GetMaxContiguousAllocationSize() const override; size_type NumAllocatedBytes() const override; size_type Capacity() const override; - IAllocatorAllocate* GetSubAllocator() override; protected: PoolSchema(const PoolSchema&); @@ -90,7 +89,7 @@ namespace AZ * for each thread. So there will be some memory overhead, especially if you use fixed pool sizes. */ class ThreadPoolSchema - : public IAllocatorAllocate + : public IAllocatorSchema { public: // Functions for getting an instance of a ThreadPoolData when using thread local storage @@ -119,7 +118,6 @@ namespace AZ size_type GetMaxContiguousAllocationSize() const override; size_type NumAllocatedBytes() const override; size_type Capacity() const override; - IAllocatorAllocate* GetSubAllocator() override; protected: ThreadPoolSchema(const ThreadPoolSchema&); diff --git a/Code/Framework/AzCore/AzCore/Memory/SimpleSchemaAllocator.h b/Code/Framework/AzCore/AzCore/Memory/SimpleSchemaAllocator.h index 5fbc890203..76be66786e 100644 --- a/Code/Framework/AzCore/AzCore/Memory/SimpleSchemaAllocator.h +++ b/Code/Framework/AzCore/AzCore/Memory/SimpleSchemaAllocator.h @@ -22,17 +22,15 @@ namespace AZ template class SimpleSchemaAllocator : public AllocatorBase - , public IAllocatorAllocate { public: using Descriptor = DescriptorType; - using pointer_type = typename IAllocatorAllocate::pointer_type; - using size_type = typename IAllocatorAllocate::size_type; - using difference_type = typename IAllocatorAllocate::difference_type; + using pointer_type = typename Schema::pointer_type; + using size_type = typename Schema::size_type; + using difference_type = typename Schema::difference_type; SimpleSchemaAllocator(const char* name, const char* desc) - : AllocatorBase(this, name, desc) - , m_schema(nullptr) + : AllocatorBase(nullptr, name, desc) { } @@ -65,13 +63,8 @@ namespace AZ return AllocatorDebugConfig(); } - IAllocatorAllocate* GetSchema() override - { - return m_schema; - } - //--------------------------------------------------------------------- - // IAllocatorAllocate + // IAllocatorSchema //--------------------------------------------------------------------- pointer_type Allocate(size_type byteSize, size_type alignment, int flags = 0, const char* name = nullptr, const char* fileName = nullptr, int lineNum = 0, unsigned int suppressStackRecord = 0) override { @@ -188,14 +181,6 @@ namespace AZ { return m_schema->GetUnAllocatedMemory(isPrint); } - - IAllocatorAllocate* GetSubAllocator() override - { - return m_schema->GetSubAllocator(); - } - - protected: - IAllocatorAllocate* m_schema; private: typename AZStd::aligned_storage::value>::type m_schemaStorage; diff --git a/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp b/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp index e56f4f045d..c403df0ed6 100644 --- a/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp @@ -51,9 +51,8 @@ static bool g_isSystemSchemaUsed = false; // [9/2/2009] //========================================================================= SystemAllocator::SystemAllocator() - : AllocatorBase(this, "SystemAllocator", "Fundamental generic memory allocator") + : AllocatorBase(nullptr, "SystemAllocator", "Fundamental generic memory allocator") , m_isCustom(false) - , m_allocator(nullptr) , m_ownsOSAllocator(false) { } @@ -93,7 +92,7 @@ SystemAllocator::Create(const Descriptor& desc) if (desc.m_custom) { m_isCustom = true; - m_allocator = desc.m_custom; + m_schema = desc.m_custom; isReady = true; } else @@ -121,9 +120,9 @@ SystemAllocator::Create(const Descriptor& desc) AZ_Assert(!g_isSystemSchemaUsed, "AZ::SystemAllocator MUST be created first! It's the source of all allocations!"); #if AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HPHA - m_allocator = new(&g_systemSchema)HphaSchema(heapDesc); + m_schema = new (&g_systemSchema) HphaSchema(heapDesc); #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC - m_allocator = new(&g_systemSchema)MallocSchema(heapDesc); + m_schema = new (&g_systemSchema) MallocSchema(heapDesc); #endif g_isSystemSchemaUsed = true; isReady = true; @@ -134,11 +133,11 @@ SystemAllocator::Create(const Descriptor& desc) AZ_Assert(AllocatorInstance::IsReady(), "System allocator must be created before any other allocator! They allocate from it."); #if AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HPHA - m_allocator = azcreate(HphaSchema, (heapDesc), SystemAllocator); + m_schema = azcreate(HphaSchema, (heapDesc), SystemAllocator); #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC - m_allocator = azcreate(MallocSchema, (heapDesc), SystemAllocator); + m_schema = azcreate(MallocSchema, (heapDesc), SystemAllocator); #endif - if (m_allocator == nullptr) + if (m_schema == nullptr) { isReady = false; } @@ -167,18 +166,18 @@ SystemAllocator::Destroy() if (!m_isCustom) { - if ((void*)m_allocator == (void*)&g_systemSchema) + if ((void*)m_schema == (void*)&g_systemSchema) { #if AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HPHA - static_cast(m_allocator)->~HphaSchema(); + static_cast(m_schema)->~HphaSchema(); #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC - static_cast(m_allocator)->~MallocSchema(); + static_cast(m_schema)->~MallocSchema(); #endif g_isSystemSchemaUsed = false; } else { - azdestroy(m_allocator); + azdestroy(m_schema); } } @@ -198,11 +197,6 @@ AllocatorDebugConfig SystemAllocator::GetDebugConfig() .ExcludeFromDebugging(!m_desc.m_allocationRecords); } -IAllocatorAllocate* SystemAllocator::GetSchema() -{ - return m_allocator; -} - //========================================================================= // Allocate // [9/2/2009] @@ -218,14 +212,14 @@ SystemAllocator::Allocate(size_type byteSize, size_type alignment, int flags, co AZ_Assert((alignment & (alignment - 1)) == 0, "Alignment must be power of 2!"); byteSize = MemorySizeAdjustedUp(byteSize); - SystemAllocator::pointer_type address = m_allocator->Allocate(byteSize, alignment, flags, name, fileName, lineNum, suppressStackRecord + 1); + SystemAllocator::pointer_type address = m_schema->Allocate(byteSize, alignment, flags, name, fileName, lineNum, suppressStackRecord + 1); if (address == nullptr) { // Free all memory we can and try again! AllocatorManager::Instance().GarbageCollect(); - address = m_allocator->Allocate(byteSize, alignment, flags, name, fileName, lineNum, suppressStackRecord + 1); + address = m_schema->Allocate(byteSize, alignment, flags, name, fileName, lineNum, suppressStackRecord + 1); } if (address == nullptr) @@ -251,7 +245,7 @@ SystemAllocator::DeAllocate(pointer_type ptr, size_type byteSize, size_type alig byteSize = MemorySizeAdjustedUp(byteSize); AZ_PROFILE_MEMORY_FREE(MemoryReserved, ptr); AZ_MEMORY_PROFILE(ProfileDeallocation(ptr, byteSize, alignment, nullptr)); - m_allocator->DeAllocate(ptr, byteSize, alignment); + m_schema->DeAllocate(ptr, byteSize, alignment); } //========================================================================= @@ -265,7 +259,7 @@ SystemAllocator::ReAllocate(pointer_type ptr, size_type newSize, size_type newAl AZ_MEMORY_PROFILE(ProfileReallocationBegin(ptr, newSize)); AZ_PROFILE_MEMORY_FREE(MemoryReserved, ptr); - pointer_type newAddress = m_allocator->ReAllocate(ptr, newSize, newAlignment); + pointer_type newAddress = m_schema->ReAllocate(ptr, newSize, newAlignment); AZ_PROFILE_MEMORY_ALLOC(MemoryReserved, newAddress, newSize, "SystemAllocator realloc"); AZ_MEMORY_PROFILE(ProfileReallocationEnd(ptr, newAddress, newSize, newAlignment)); @@ -280,7 +274,7 @@ SystemAllocator::size_type SystemAllocator::Resize(pointer_type ptr, size_type newSize) { newSize = MemorySizeAdjustedUp(newSize); - size_type resizedSize = m_allocator->Resize(ptr, newSize); + size_type resizedSize = m_schema->Resize(ptr, newSize); AZ_MEMORY_PROFILE(ProfileResize(ptr, resizedSize)); @@ -294,7 +288,7 @@ SystemAllocator::Resize(pointer_type ptr, size_type newSize) SystemAllocator::size_type SystemAllocator::AllocationSize(pointer_type ptr) { - size_type allocSize = MemorySizeAdjustedDown(m_allocator->AllocationSize(ptr)); + size_type allocSize = MemorySizeAdjustedDown(m_schema->AllocationSize(ptr)); return allocSize; } diff --git a/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.h b/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.h index c02ada5843..0ea4251b8a 100644 --- a/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.h +++ b/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.h @@ -26,7 +26,6 @@ namespace AZ */ class SystemAllocator : public AllocatorBase - , public IAllocatorAllocate { public: AZ_TYPE_INFO(SystemAllocator, "{424C94D8-85CF-4E89-8CD6-AB5EC173E875}") @@ -39,7 +38,7 @@ namespace AZ * we will allocate system memory using system calls. You can * provide arenas (spaces) with pre-allocated memory, and use the * flag to specify which arena you want to allocate from. - * You are also allowed to supply IAllocatorAllocate, but if you do + * You are also allowed to supply IAllocatorSchema, but if you do * so you will need to take care of all allocations, we will not use * the default HeapSchema. * \ref HeapSchema::Descriptor @@ -51,7 +50,7 @@ namespace AZ , m_allocationRecords(true) , m_stackRecordLevels(5) {} - IAllocatorAllocate* m_custom; ///< You can provide our own allocation scheme. If NULL a HeapScheme will be used with the provided Descriptor. + IAllocatorSchema* m_custom; ///< You can provide our own allocation scheme. If NULL a HeapScheme will be used with the provided Descriptor. struct Heap { @@ -73,7 +72,7 @@ namespace AZ int m_numFixedMemoryBlocks; ///< Number of memory blocks to use. void* m_fixedMemoryBlocks[m_maxNumFixedBlocks]; ///< Pointers to provided memory blocks or NULL if you want the system to allocate them for you with the System Allocator. size_t m_fixedMemoryBlocksByteSize[m_maxNumFixedBlocks]; ///< Sizes of different memory blocks (MUST be multiple of m_pageSize), if m_memoryBlock is 0 the block will be allocated for you with the System Allocator. - IAllocatorAllocate* m_subAllocator; ///< Allocator that m_memoryBlocks memory was allocated from or should be allocated (if NULL). + IAllocatorSchema* m_subAllocator; ///< Allocator that m_memoryBlocks memory was allocated from or should be allocated (if NULL). size_t m_systemChunkSize; ///< Size of chunk to request from the OS when more memory is needed (defaults to m_pageSize) } m_heap; bool m_allocationRecords; ///< True if we want to track memory allocations, otherwise false. @@ -87,25 +86,23 @@ namespace AZ ////////////////////////////////////////////////////////////////////////// // IAllocator AllocatorDebugConfig GetDebugConfig() override; - IAllocatorAllocate* GetSchema() override; ////////////////////////////////////////////////////////////////////////// - // IAllocatorAllocate + // IAllocatorSchema pointer_type Allocate(size_type byteSize, size_type alignment, int flags = 0, const char* name = 0, const char* fileName = 0, int lineNum = 0, unsigned int suppressStackRecord = 0) override; void DeAllocate(pointer_type ptr, size_type byteSize = 0, size_type alignment = 0) override; pointer_type ReAllocate(pointer_type ptr, size_type newSize, size_type newAlignment) override; size_type Resize(pointer_type ptr, size_type newSize) override; size_type AllocationSize(pointer_type ptr) override; - void GarbageCollect() override { m_allocator->GarbageCollect(); } + void GarbageCollect() override { GetSchema()->GarbageCollect(); } - size_type NumAllocatedBytes() const override { return m_allocator->NumAllocatedBytes(); } - size_type Capacity() const override { return m_allocator->Capacity(); } + size_type NumAllocatedBytes() const override { return GetSchema()->NumAllocatedBytes(); } + size_type Capacity() const override { return GetSchema()->Capacity(); } /// Keep in mind this operation will execute GarbageCollect to make sure it returns, max allocation. This function WILL be slow. - size_type GetMaxAllocationSize() const override { return m_allocator->GetMaxAllocationSize(); } - size_type GetMaxContiguousAllocationSize() const override { return m_allocator->GetMaxContiguousAllocationSize(); } - size_type GetUnAllocatedMemory(bool isPrint = false) const override { return m_allocator->GetUnAllocatedMemory(isPrint); } - IAllocatorAllocate* GetSubAllocator() override { return m_isCustom ? m_allocator : m_allocator->GetSubAllocator(); } + size_type GetMaxAllocationSize() const override { return GetSchema()->GetMaxAllocationSize(); } + size_type GetMaxContiguousAllocationSize() const override { return GetSchema()->GetMaxContiguousAllocationSize(); } + size_type GetUnAllocatedMemory(bool isPrint = false) const override { return GetSchema()->GetUnAllocatedMemory(isPrint); } ////////////////////////////////////////////////////////////////////////// @@ -115,7 +112,6 @@ namespace AZ Descriptor m_desc; bool m_isCustom; - IAllocatorAllocate* m_allocator; bool m_ownsOSAllocator; }; } diff --git a/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp b/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp index 841387f14d..b6f42e79ec 100644 --- a/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp +++ b/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp @@ -1456,7 +1456,7 @@ using namespace AZ; static void* LuaMemoryHook(void* userData, void* ptr, size_t osize, size_t nsize) { (void)osize; - IAllocatorAllocate* allocator = reinterpret_cast(userData); + IAllocator* allocator = reinterpret_cast(userData); if (nsize == 0) { if (ptr) @@ -4274,7 +4274,7 @@ LUA_API const Node* lua_getDummyNode() AZ_CLASS_ALLOCATOR(ScriptContextImpl, AZ::SystemAllocator, 0); ////////////////////////////////////////////////////////////////////////// - ScriptContextImpl(ScriptContext* owner, IAllocatorAllocate* allocator, lua_State* nativeContext) + ScriptContextImpl(ScriptContext* owner, IAllocator* allocator, lua_State* nativeContext) : m_owner(owner) , m_context(nullptr) , m_debug(nullptr) @@ -5827,7 +5827,7 @@ LUA_API const Node* lua_getDummyNode() }; } // namespace AZ - ScriptContext::ScriptContext(ScriptContextId id, IAllocatorAllocate* allocator, lua_State* nativeContext) + ScriptContext::ScriptContext(ScriptContextId id, IAllocator* allocator, lua_State* nativeContext) { m_id = id; m_impl = aznew ScriptContextImpl(this, allocator, nativeContext); diff --git a/Code/Framework/AzCore/AzCore/Script/ScriptContext.h b/Code/Framework/AzCore/AzCore/Script/ScriptContext.h index bb63a9368d..8784bf7ca7 100644 --- a/Code/Framework/AzCore/AzCore/Script/ScriptContext.h +++ b/Code/Framework/AzCore/AzCore/Script/ScriptContext.h @@ -822,7 +822,7 @@ namespace AZ CustomFromLua m_fromLua; }; - ScriptContext(ScriptContextId id = ScriptContextIds::DefaultScriptContextId, IAllocatorAllocate* allocator = nullptr, lua_State* nativeContext = nullptr); + ScriptContext(ScriptContextId id = ScriptContextIds::DefaultScriptContextId, IAllocator* allocator = nullptr, lua_State* nativeContext = nullptr); ~ScriptContext(); /// Bind LUA context (VM) a specific behaviorContext diff --git a/Code/Framework/AzCore/AzCore/Serialization/AZStdContainers.inl b/Code/Framework/AzCore/AzCore/Serialization/AZStdContainers.inl index a633af22da..c1ecd3634a 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/AZStdContainers.inl +++ b/Code/Framework/AzCore/AzCore/Serialization/AZStdContainers.inl @@ -74,7 +74,7 @@ namespace AZ * But as the AZStdAssociativeContainer instance will not be accessed outside of the module it was * created within then this will return this .dll/.exe module allocator */ - classElement.m_attributes.set_allocator(AZStdFunctorAllocator([]() -> IAllocatorAllocate& { return GetCurrentSerializeContextModule().GetAllocator(); })); + classElement.m_attributes.set_allocator(AZStdFunctorAllocator([]() -> IAllocator& { return GetCurrentSerializeContextModule().GetAllocator(); })); // Flag the field with the EnumType attribute if we're an enumeration type aliased by RemoveEnum const bool isSpecializedEnum = AZStd::is_enum::value && !AzTypeInfo::Uuid().IsNull(); @@ -650,7 +650,7 @@ namespace AZ * But as the AZStdAssociativeContainer instance will not be accessed outside of the module it was * created within then this will return this .dll/.exe module allocator */ - m_classElement.m_attributes.set_allocator(AZStdFunctorAllocator([]() -> IAllocatorAllocate& { return GetCurrentSerializeContextModule().GetAllocator(); })); + m_classElement.m_attributes.set_allocator(AZStdFunctorAllocator([]() -> IAllocator& { return GetCurrentSerializeContextModule().GetAllocator(); })); m_classElement.m_attributes.emplace_back(AZ_CRC("KeyType", 0x15bc5303), CreateModuleAttribute(AZStd::move(uuid))); } diff --git a/Code/Framework/AzCore/AzCore/Serialization/SerializeContext.cpp b/Code/Framework/AzCore/AzCore/Serialization/SerializeContext.cpp index ff0ad571f7..227ba3dc75 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/SerializeContext.cpp +++ b/Code/Framework/AzCore/AzCore/Serialization/SerializeContext.cpp @@ -3245,7 +3245,7 @@ namespace AZ return genericClassInfoFoundIt != m_moduleLocalGenericClassInfos.end() ? genericClassInfoFoundIt->second : nullptr; } - AZ::IAllocatorAllocate& SerializeContext::PerModuleGenericClassInfo::GetAllocator() + AZ::IAllocator& SerializeContext::PerModuleGenericClassInfo::GetAllocator() { return m_moduleOSAllocator; } diff --git a/Code/Framework/AzCore/AzCore/Serialization/SerializeContext.h b/Code/Framework/AzCore/AzCore/Serialization/SerializeContext.h index bf96bcdb9a..f8daa8c328 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/SerializeContext.h +++ b/Code/Framework/AzCore/AzCore/Serialization/SerializeContext.h @@ -574,10 +574,10 @@ namespace AZ GenericClassInfo* m_genericClassInfo = nullptr; ///< Valid when the generic class is set. So you don't search for the actual type in the class register. Edit::ElementData* m_editData{}; ///< Pointer to edit data (generated by EditContext). AZStd::vector m_attributes{ - AZStdFunctorAllocator([]() -> IAllocatorAllocate& { return AZ::AllocatorInstance::Get(); }) + AZStdFunctorAllocator([]() -> IAllocator& { return AZ::AllocatorInstance::Get(); }) }; ///< Attributes attached to ClassElement. Lambda is required here as AZStdFunctorAllocator expects a function pointer - ///< that returns an IAllocatorAllocate& and the AZ::AllocatorInstance::Get returns an AZ::SystemAllocator& - /// which while it inherits from IAllocatorAllocate, does not work as function pointers do not support covariant return types + ///< that returns an IAllocator& and the AZ::AllocatorInstance::Get returns an AZ::SystemAllocator& + /// which while it inherits from IAllocator, does not work as function pointers do not support covariant return types AttributeOwnership m_attributeOwnership = AttributeOwnership::Parent; int m_flags{}; ///< }; @@ -639,12 +639,12 @@ namespace AZ DataPatchUpgradeHandler m_dataPatchUpgrader; ///< Attributes for this class type. Lambda is required here as AZStdFunctorAllocator expects a function pointer - ///< that returns an IAllocatorAllocate& and the AZ::AllocatorInstance::Get returns an AZ::SystemAllocator& - /// which while it inherits from IAllocatorAllocate, does not work as function pointers do not support covariant return types + ///< that returns an IAllocator& and the AZ::AllocatorInstance::Get returns an AZ::SystemAllocator& + /// which while it inherits from IAllocator, does not work as function pointers do not support covariant return types AZStd::vector m_attributes{AZStdFunctorAllocator(&GetSystemAllocator) }; private: - static IAllocatorAllocate& GetSystemAllocator() + static IAllocator& GetSystemAllocator() { return AZ::AllocatorInstance::Get(); } @@ -2483,7 +2483,7 @@ namespace AZ PerModuleGenericClassInfo(); ~PerModuleGenericClassInfo(); - AZ::IAllocatorAllocate& GetAllocator(); + AZ::IAllocator& GetAllocator(); void AddGenericClassInfo(AZ::GenericClassInfo* genericClassInfo); void RemoveGenericClassInfo(const AZ::TypeId& canonicalTypeId); @@ -2546,12 +2546,12 @@ namespace AZ template AttributePtr CreateModuleAttribute(T&& attrValue) { - IAllocatorAllocate& moduleAllocator = GetCurrentSerializeContextModule().GetAllocator(); + IAllocator& moduleAllocator = GetCurrentSerializeContextModule().GetAllocator(); void* rawMemory = moduleAllocator.Allocate(sizeof(ContainerType), alignof(ContainerType)); new (rawMemory) ContainerType{ AZStd::forward(attrValue) }; auto attributeDeleter = [](Attribute* attribute) { - IAllocatorAllocate& moduleAllocator = GetCurrentSerializeContextModule().GetAllocator(); + IAllocator& moduleAllocator = GetCurrentSerializeContextModule().GetAllocator(); attribute->~Attribute(); moduleAllocator.DeAllocate(attribute); }; diff --git a/Code/Framework/AzCore/AzCore/Serialization/std/VariantReflection.inl b/Code/Framework/AzCore/AzCore/Serialization/std/VariantReflection.inl index 06d4f76c80..2712baa859 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/std/VariantReflection.inl +++ b/Code/Framework/AzCore/AzCore/Serialization/std/VariantReflection.inl @@ -32,7 +32,7 @@ namespace AZ * But as the AZStdAssociativeContainer instance will not be accessed outside of the module it was * created within then this will return this .dll/.exe module allocator */ - classElement.m_attributes.set_allocator(AZStdFunctorAllocator([]() -> IAllocatorAllocate& { return GetCurrentSerializeContextModule().GetAllocator(); })); + classElement.m_attributes.set_allocator(AZStdFunctorAllocator([]() -> IAllocator& { return GetCurrentSerializeContextModule().GetAllocator(); })); } template @@ -429,7 +429,7 @@ namespace AZ // the serialize context dll module allocator has to be used to manage the lifetime of the ClassData attributes within a module // If a module which reflects a variant is unloaded, then the dll module allocator will properly unreflect the variant type from the serialize context // for this particular module - AZStdFunctorAllocator dllAllocator([]() -> IAllocatorAllocate& { return GetCurrentSerializeContextModule().GetAllocator(); }); + AZStdFunctorAllocator dllAllocator([]() -> IAllocator& { return GetCurrentSerializeContextModule().GetAllocator(); }); m_classData.m_attributes.set_allocator(AZStd::move(dllAllocator)); // Create the ObjectStreamWriteOverrideCB in the current module diff --git a/Code/Framework/AzCore/AzCore/azcore_files.cmake b/Code/Framework/AzCore/AzCore/azcore_files.cmake index e8001f7215..b8ea9d3f39 100644 --- a/Code/Framework/AzCore/AzCore/azcore_files.cmake +++ b/Code/Framework/AzCore/AzCore/azcore_files.cmake @@ -362,8 +362,6 @@ set(FILES Memory/AllocatorBase.h Memory/AllocatorManager.cpp Memory/AllocatorManager.h - Memory/AllocatorOverrideShim.cpp - Memory/AllocatorOverrideShim.h Memory/AllocatorWrapper.h Memory/AllocatorScope.h Memory/BestFitExternalMapAllocator.cpp diff --git a/Code/Framework/AzCore/Tests/AZStd/Hashed.cpp b/Code/Framework/AzCore/Tests/AZStd/Hashed.cpp index c982868c4f..dd2597334d 100644 --- a/Code/Framework/AzCore/Tests/AZStd/Hashed.cpp +++ b/Code/Framework/AzCore/Tests/AZStd/Hashed.cpp @@ -1400,7 +1400,7 @@ namespace UnitTest { using ContainerType = ContainerTemplate, AZStd::equal_to, AZ::AZStdIAllocator>; - static ContainerType Create(std::initializer_list intList, AZ::IAllocatorAllocate* allocatorInstance) + static ContainerType Create(std::initializer_list intList, AZ::IAllocator* allocatorInstance) { ContainerType allocatorSet(intList, AZStd::hash{}, AZStd::equal_to{}, AZ::AZStdIAllocator{ allocatorInstance }); return allocatorSet; @@ -1798,7 +1798,7 @@ namespace UnitTest { using ContainerType = ContainerTemplate, AZStd::equal_to, AZ::AZStdIAllocator>; - static ContainerType Create(std::initializer_list intList, AZ::IAllocatorAllocate* allocatorInstance) + static ContainerType Create(std::initializer_list intList, AZ::IAllocator* allocatorInstance) { ContainerType allocatorMap(intList, AZStd::hash{}, AZStd::equal_to{}, AZ::AZStdIAllocator{ allocatorInstance }); return allocatorMap; diff --git a/Code/Framework/AzCore/Tests/AZStd/Ordered.cpp b/Code/Framework/AzCore/Tests/AZStd/Ordered.cpp index 26838eeb63..3f3bc86ed6 100644 --- a/Code/Framework/AzCore/Tests/AZStd/Ordered.cpp +++ b/Code/Framework/AzCore/Tests/AZStd/Ordered.cpp @@ -1082,7 +1082,7 @@ namespace UnitTest { using ContainerType = ContainerTemplate, AZ::AZStdIAllocator>; - static ContainerType Create(std::initializer_list intList, AZ::IAllocatorAllocate* allocatorInstance) + static ContainerType Create(std::initializer_list intList, AZ::IAllocator* allocatorInstance) { ContainerType allocatorSet(intList, AZStd::less{}, AZ::AZStdIAllocator{ allocatorInstance }); return allocatorSet; @@ -1503,7 +1503,7 @@ namespace UnitTest { using ContainerType = ContainerTemplate, AZ::AZStdIAllocator>; - static ContainerType Create(std::initializer_list intList, AZ::IAllocatorAllocate* allocatorInstance) + static ContainerType Create(std::initializer_list intList, AZ::IAllocator* allocatorInstance) { ContainerType allocatorMap(intList, AZStd::less{}, AZ::AZStdIAllocator{ allocatorInstance }); return allocatorMap; diff --git a/Code/Framework/AzCore/Tests/Memory.cpp b/Code/Framework/AzCore/Tests/Memory.cpp index 5287167c8b..0e0103d162 100644 --- a/Code/Framework/AzCore/Tests/Memory.cpp +++ b/Code/Framework/AzCore/Tests/Memory.cpp @@ -87,7 +87,7 @@ namespace UnitTest #endif void* addresses[numAllocations] = {nullptr}; - IAllocatorAllocate& sysAlloc = AllocatorInstance::Get(); + IAllocator& sysAllocator = AllocatorInstance::Get(); ////////////////////////////////////////////////////////////////////////// // Allocate @@ -96,19 +96,19 @@ namespace UnitTest { AZStd::size_t size = AZStd::GetMax(rand() % 256, 1); // supply all debug info, so we don't need to record the stack. - addresses[i] = sysAlloc.Allocate(size, 8, 0, "Test Alloc", __FILE__, __LINE__); + addresses[i] = sysAllocator.Allocate(size, 8, 0, "Test Alloc", __FILE__, __LINE__); memset(addresses[i], 1, size); totalAllocSize += size; } ////////////////////////////////////////////////////////////////////////// - EXPECT_GE(sysAlloc.NumAllocatedBytes(), totalAllocSize); + EXPECT_GE(sysAllocator.NumAllocatedBytes(), totalAllocSize); ////////////////////////////////////////////////////////////////////////// // Deallocate for (int i = numAllocations-1; i >=0; --i) { - sysAlloc.DeAllocate(addresses[i]); + sysAllocator.DeAllocate(addresses[i]); } ////////////////////////////////////////////////////////////////////////// } @@ -122,21 +122,21 @@ namespace UnitTest { AllocatorInstance::Create(); - IAllocatorAllocate& sysAlloc = AllocatorInstance::Get(); + IAllocator& sysAllocator = AllocatorInstance::Get(); for (int i = 0; i < 100; ++i) { - address[i] = sysAlloc.Allocate(1000, 32, 0); + address[i] = sysAllocator.Allocate(1000, 32, 0); EXPECT_NE(nullptr, address[i]); EXPECT_EQ(0, ((size_t)address[i] & 31)); // check alignment - EXPECT_GE(sysAlloc.AllocationSize(address[i]), 1000); // check allocation size + EXPECT_GE(sysAllocator.AllocationSize(address[i]), 1000); // check allocation size } - EXPECT_GE(sysAlloc.NumAllocatedBytes(), 100000); // we requested 100 * 1000 so we should have at least this much allocated + EXPECT_GE(sysAllocator.NumAllocatedBytes(), 100000); // we requested 100 * 1000 so we should have at least this much allocated for (int i = 0; i < 100; ++i) { - sysAlloc.DeAllocate(address[i]); + sysAllocator.DeAllocate(address[i]); } //////////////////////////////////////////////////////////////////////// @@ -168,18 +168,17 @@ namespace UnitTest SystemAllocator::Descriptor descriptor; descriptor.m_stackRecordLevels = 20; AllocatorInstance::Create(descriptor); - IAllocator& sysAllocator = AllocatorInstance::GetAllocator(); - IAllocatorAllocate& sysAlloc = *sysAllocator.GetAllocationSource(); + IAllocator& sysAllocator = AllocatorInstance::Get(); for (int i = 0; i < 100; ++i) { - address[i] = sysAlloc.Allocate(1000, 32, 0); + address[i] = sysAllocator.Allocate(1000, 32, 0); EXPECT_NE(nullptr, address[i]); EXPECT_EQ(0, ((size_t)address[i] & 31)); // check alignment - EXPECT_GE(sysAlloc.AllocationSize(address[i]), 1000); // check allocation size + EXPECT_GE(sysAllocator.AllocationSize(address[i]), 1000); // check allocation size } - EXPECT_TRUE(sysAlloc.NumAllocatedBytes() >= 100000); // we requested 100 * 1000 so we should have at least this much allocated + EXPECT_TRUE(sysAllocator.NumAllocatedBytes() >= 100000); // we requested 100 * 1000 so we should have at least this much allocated // If tracking and recording is enabled, we can verify that the alloc info is valid #if defined(AZ_DEBUG_BUILD) @@ -192,7 +191,7 @@ namespace UnitTest const Debug::AllocationInfo& ai = iter->second; EXPECT_EQ(32, ai.m_alignment); EXPECT_EQ(1000, ai.m_byteSize); - EXPECT_EQ(nullptr, ai.m_fileName); // We did not pass fileName or lineNum to sysAlloc.Allocate() + EXPECT_EQ(nullptr, ai.m_fileName); // We did not pass fileName or lineNum to sysAllocator.Allocate() EXPECT_EQ(0, ai.m_lineNum); // -- " -- # if defined(AZ_PLATFORM_WINDOWS) // if our hardware support stack traces make sure we have them, since we did not provide fileName,lineNum @@ -229,47 +228,47 @@ namespace UnitTest // Free all memory for (int i = 0; i < 100; ++i) { - sysAlloc.DeAllocate(address[i]); + sysAllocator.DeAllocate(address[i]); } - sysAlloc.GarbageCollect(); - EXPECT_LT(sysAlloc.NumAllocatedBytes(), 1024); // We freed everything from a memspace, we should have only a very minor chunk of data + sysAllocator.GarbageCollect(); + EXPECT_LT(sysAllocator.NumAllocatedBytes(), 1024); // We freed everything from a memspace, we should have only a very minor chunk of data ////////////////////////////////////////////////////////////////////////// // realloc test address[0] = nullptr; static const unsigned int checkValue = 0x0badbabe; // create tree (non pool) allocation (we usually pool < 256 bytes) - address[0] = sysAlloc.Allocate(2048, 16); + address[0] = sysAllocator.Allocate(2048, 16); *(unsigned*)(address[0]) = checkValue; // set check value - AZ_TEST_ASSERT_CLOSE(sysAlloc.AllocationSize(address[0]), 2048, 16); - address[0] = sysAlloc.ReAllocate(address[0], 1024, 16); // test tree big -> tree small + AZ_TEST_ASSERT_CLOSE(sysAllocator.AllocationSize(address[0]), 2048, 16); + address[0] = sysAllocator.ReAllocate(address[0], 1024, 16); // test tree big -> tree small EXPECT_EQ(checkValue, *(unsigned*)address[0]); - AZ_TEST_ASSERT_CLOSE(sysAlloc.AllocationSize(address[0]), 1024, 16); - address[0] = sysAlloc.ReAllocate(address[0], 4096, 16); // test tree small -> tree big - AZ_TEST_ASSERT_CLOSE(sysAlloc.AllocationSize(address[0]), 4096, 16); + AZ_TEST_ASSERT_CLOSE(sysAllocator.AllocationSize(address[0]), 1024, 16); + address[0] = sysAllocator.ReAllocate(address[0], 4096, 16); // test tree small -> tree big + AZ_TEST_ASSERT_CLOSE(sysAllocator.AllocationSize(address[0]), 4096, 16); EXPECT_EQ(checkValue, *(unsigned*)address[0]); - address[0] = sysAlloc.ReAllocate(address[0], 128, 16); // test tree -> pool, - AZ_TEST_ASSERT_CLOSE(sysAlloc.AllocationSize(address[0]), 128, 16); + address[0] = sysAllocator.ReAllocate(address[0], 128, 16); // test tree -> pool, + AZ_TEST_ASSERT_CLOSE(sysAllocator.AllocationSize(address[0]), 128, 16); EXPECT_EQ(checkValue, *(unsigned*)address[0]); - address[0] = sysAlloc.ReAllocate(address[0], 64, 16); // pool big -> pool small - AZ_TEST_ASSERT_CLOSE(sysAlloc.AllocationSize(address[0]), 64, 16); + address[0] = sysAllocator.ReAllocate(address[0], 64, 16); // pool big -> pool small + AZ_TEST_ASSERT_CLOSE(sysAllocator.AllocationSize(address[0]), 64, 16); EXPECT_EQ(checkValue, *(unsigned*)address[0]); - address[0] = sysAlloc.ReAllocate(address[0], 64, 16); // pool sanity check - AZ_TEST_ASSERT_CLOSE(sysAlloc.AllocationSize(address[0]), 64, 16); + address[0] = sysAllocator.ReAllocate(address[0], 64, 16); // pool sanity check + AZ_TEST_ASSERT_CLOSE(sysAllocator.AllocationSize(address[0]), 64, 16); EXPECT_EQ(checkValue, *(unsigned*)address[0]); - address[0] = sysAlloc.ReAllocate(address[0], 192, 16); // pool small -> pool big - AZ_TEST_ASSERT_CLOSE(sysAlloc.AllocationSize(address[0]), 192, 16); + address[0] = sysAllocator.ReAllocate(address[0], 192, 16); // pool small -> pool big + AZ_TEST_ASSERT_CLOSE(sysAllocator.AllocationSize(address[0]), 192, 16); EXPECT_EQ(checkValue, *(unsigned*)address[0]); - address[0] = sysAlloc.ReAllocate(address[0], 2048, 16); // pool -> tree - AZ_TEST_ASSERT_CLOSE(sysAlloc.AllocationSize(address[0]), 2048, 16); + address[0] = sysAllocator.ReAllocate(address[0], 2048, 16); // pool -> tree + AZ_TEST_ASSERT_CLOSE(sysAllocator.AllocationSize(address[0]), 2048, 16); ; EXPECT_EQ(checkValue, *(unsigned*)address[0]); - address[0] = sysAlloc.ReAllocate(address[0], 2048, 16); // tree sanity check - AZ_TEST_ASSERT_CLOSE(sysAlloc.AllocationSize(address[0]), 2048, 16); + address[0] = sysAllocator.ReAllocate(address[0], 2048, 16); // tree sanity check + AZ_TEST_ASSERT_CLOSE(sysAllocator.AllocationSize(address[0]), 2048, 16); ; EXPECT_EQ(checkValue, *(unsigned*)address[0]); - sysAlloc.DeAllocate(address[0], 2048, 16); + sysAllocator.DeAllocate(address[0], 2048, 16); // TODO realloc with different alignment tests ////////////////////////////////////////////////////////////////////////// @@ -340,8 +339,7 @@ namespace UnitTest void run() { - IAllocatorAllocate& poolAlloc = AllocatorInstance::Get(); - IAllocator& poolAllocator = AllocatorInstance::GetAllocator(); + IAllocator& poolAllocator = AllocatorInstance::Get(); // 64 should be the max number of different pool sizes we can allocate. void* address[64]; ////////////////////////////////////////////////////////////////////////// @@ -352,12 +350,12 @@ namespace UnitTest int i = 0; for (int size = 8; size <= 256; ++i, size += 8) { - address[i] = poolAlloc.Allocate(size, 8); - EXPECT_GE(poolAlloc.AllocationSize(address[i]), (AZStd::size_t)size); + address[i] = poolAllocator.Allocate(size, 8); + EXPECT_GE(poolAllocator.AllocationSize(address[i]), (AZStd::size_t)size); memset(address[i], 1, size); } - EXPECT_GE(poolAlloc.NumAllocatedBytes(), 4126); + EXPECT_GE(poolAllocator.NumAllocatedBytes(), 4126); if (poolAllocator.GetRecords()) { @@ -369,11 +367,11 @@ namespace UnitTest for (i = 0; address[i] != nullptr; ++i) { - poolAlloc.DeAllocate(address[i]); + poolAllocator.DeAllocate(address[i]); } ////////////////////////////////////////////////////////////////////////// - EXPECT_EQ(0, poolAlloc.NumAllocatedBytes()); + EXPECT_EQ(0, poolAllocator.NumAllocatedBytes()); if (poolAllocator.GetRecords()) { @@ -393,13 +391,13 @@ namespace UnitTest memset(address, 0, AZ_ARRAY_SIZE(address)*sizeof(void*)); for (unsigned int j = 0; j < AZ_ARRAY_SIZE(address); ++j) { - address[j] = poolAlloc.Allocate(256, 8, 0, "Pool Alloc", "This File", 123); - EXPECT_GE(poolAlloc.AllocationSize(address[j]), 256); + address[j] = poolAllocator.Allocate(256, 8, 0, "Pool Alloc", "This File", 123); + EXPECT_GE(poolAllocator.AllocationSize(address[j]), 256); memset(address[j], 1, 256); } // AllocatorManager::Instance().ResetMemoryBreak(0); - EXPECT_GE(poolAlloc.NumAllocatedBytes(), AZ_ARRAY_SIZE(address)*256); + EXPECT_GE(poolAllocator.NumAllocatedBytes(), AZ_ARRAY_SIZE(address)*256); if (poolAllocator.GetRecords()) { @@ -411,11 +409,11 @@ namespace UnitTest for (unsigned int j = 0; j < AZ_ARRAY_SIZE(address); ++j) { - poolAlloc.DeAllocate(address[j]); + poolAllocator.DeAllocate(address[j]); } ////////////////////////////////////////////////////////////////////////// - EXPECT_EQ(0, poolAlloc.NumAllocatedBytes()); + EXPECT_EQ(0, poolAllocator.NumAllocatedBytes()); if (poolAllocator.GetRecords()) { @@ -541,14 +539,14 @@ namespace UnitTest #endif void* addresses[numAllocations] = {nullptr}; - IAllocatorAllocate& poolAlloc = AllocatorInstance::Get(); + IAllocator& poolAllocator = AllocatorInstance::Get(); ////////////////////////////////////////////////////////////////////////// // Allocate for (int i = 0; i < numAllocations; ++i) { AZStd::size_t size = AZStd::GetMax(1, ((i + 1) * 2) % 256); - addresses[i] = poolAlloc.Allocate(size, 8, 0, "Test Alloc", __FILE__, __LINE__); + addresses[i] = poolAllocator.Allocate(size, 8, 0, "Test Alloc", __FILE__, __LINE__); EXPECT_NE(addresses[i], nullptr); memset(addresses[i], 1, size); } @@ -558,7 +556,7 @@ namespace UnitTest // Deallocate for (int i = numAllocations-1; i >=0; --i) { - poolAlloc.DeAllocate(addresses[i]); + poolAllocator.DeAllocate(addresses[i]); } ////////////////////////////////////////////////////////////////////////// } @@ -568,12 +566,12 @@ namespace UnitTest */ void SharedAlloc() { - IAllocatorAllocate& poolAlloc = AllocatorInstance::Get(); + IAllocator& poolAllocator = AllocatorInstance::Get(); for (int i = 0; i < m_numSharedAlloc; ++i) { AZStd::size_t minSize = sizeof(AllocClass); AZStd::size_t size = AZStd::GetMax((AZStd::size_t)(rand() % 256), minSize); - AllocClass* ac = reinterpret_cast(poolAlloc.Allocate(size, AZStd::alignment_of::value, 0, "Shared Alloc", __FILE__, __LINE__)); + AllocClass* ac = reinterpret_cast(poolAllocator.Allocate(size, AZStd::alignment_of::value, 0, "Shared Alloc", __FILE__, __LINE__)); AZStd::lock_guard lock(m_mutex); m_sharedAlloc.push_back(*ac); } @@ -584,7 +582,7 @@ namespace UnitTest */ void SharedDeAlloc() { - IAllocatorAllocate& poolAlloc = AllocatorInstance::Get(); + IAllocator& poolAllocator = AllocatorInstance::Get(); AllocClass* ac; int isDone = 0; while (isDone!=2) @@ -594,7 +592,7 @@ namespace UnitTest { ac = &m_sharedAlloc.front(); m_sharedAlloc.pop_front(); - poolAlloc.DeAllocate(ac); + poolAllocator.DeAllocate(ac); } if (m_doneSharedAlloc) // once we know we don't add more elements, make one last check and exit. @@ -633,8 +631,7 @@ namespace UnitTest void run() { - IAllocatorAllocate& poolAlloc = AllocatorInstance::Get(); - IAllocator& poolAllocator = AllocatorInstance::GetAllocator(); + IAllocator& poolAllocator = AllocatorInstance::Get(); // 64 should be the max number of different pool sizes we can allocate. void* address[64]; ////////////////////////////////////////////////////////////////////////// @@ -645,12 +642,12 @@ namespace UnitTest int j = 0; for (int size = 8; size <= 256; ++j, size += 8) { - address[j] = poolAlloc.Allocate(size, 8); - EXPECT_GE(poolAlloc.AllocationSize(address[j]), (AZStd::size_t)size); + address[j] = poolAllocator.Allocate(size, 8); + EXPECT_GE(poolAllocator.AllocationSize(address[j]), (AZStd::size_t)size); memset(address[j], 1, size); } - EXPECT_GE(poolAlloc.NumAllocatedBytes(), 4126); + EXPECT_GE(poolAllocator.NumAllocatedBytes(), 4126); if (poolAllocator.GetRecords()) { @@ -662,11 +659,11 @@ namespace UnitTest for (int i = 0; address[i] != nullptr; ++i) { - poolAlloc.DeAllocate(address[i]); + poolAllocator.DeAllocate(address[i]); } ////////////////////////////////////////////////////////////////////////// - EXPECT_EQ(0, poolAlloc.NumAllocatedBytes()); + EXPECT_EQ(0, poolAllocator.NumAllocatedBytes()); if (poolAllocator.GetRecords()) { @@ -681,12 +678,12 @@ namespace UnitTest memset(address, 0, AZ_ARRAY_SIZE(address)*sizeof(void*)); for (unsigned int i = 0; i < AZ_ARRAY_SIZE(address); ++i) { - address[i] = poolAlloc.Allocate(256, 8); - EXPECT_GE(poolAlloc.AllocationSize(address[i]), 256); + address[i] = poolAllocator.Allocate(256, 8); + EXPECT_GE(poolAllocator.AllocationSize(address[i]), 256); memset(address[i], 1, 256); } - EXPECT_GE(poolAlloc.NumAllocatedBytes(), AZ_ARRAY_SIZE(address)*256); + EXPECT_GE(poolAllocator.NumAllocatedBytes(), AZ_ARRAY_SIZE(address)*256); if (poolAllocator.GetRecords()) { @@ -698,11 +695,11 @@ namespace UnitTest for (unsigned int i = 0; i < AZ_ARRAY_SIZE(address); ++i) { - poolAlloc.DeAllocate(address[i]); + poolAllocator.DeAllocate(address[i]); } ////////////////////////////////////////////////////////////////////////// - EXPECT_EQ(0, poolAlloc.NumAllocatedBytes()); + EXPECT_EQ(0, poolAllocator.NumAllocatedBytes()); if (poolAllocator.GetRecords()) { @@ -820,7 +817,7 @@ namespace UnitTest desc.m_memoryBlock = azmalloc(desc.m_memoryBlockByteSize, desc.m_memoryBlockAlignment); AllocatorInstance::Create(desc); - IAllocatorAllocate& bfAlloc = AllocatorInstance::Get(); + IAllocator& bfAlloc = AllocatorInstance::Get(); EXPECT_EQ( desc.m_memoryBlockByteSize, bfAlloc.Capacity() ); EXPECT_EQ( 0, bfAlloc.NumAllocatedBytes() ); @@ -882,8 +879,8 @@ namespace UnitTest void run() { - IAllocator& sysAllocator = AllocatorInstance::GetAllocator(); - IAllocator& poolAllocator = AllocatorInstance::GetAllocator(); + IAllocator& sysAllocator = AllocatorInstance::Get(); + IAllocator& poolAllocator = AllocatorInstance::Get(); void* ptr = azmalloc(16*1024, 32, SystemAllocator); EXPECT_EQ(0, ((size_t)ptr & 31)); // check alignment @@ -1010,27 +1007,27 @@ namespace UnitTest void run() { - IAllocator& sysAlloc = AllocatorInstance::GetAllocator(); - IAllocator& poolAlloc = AllocatorInstance::GetAllocator(); + IAllocator& sysAllocator = AllocatorInstance::Get(); + IAllocator& poolAllocator = AllocatorInstance::Get(); MyClass* ptr = aznew MyClass(202); /// this should allocate memory from the pool allocator EXPECT_EQ(0, ((size_t)ptr & 31)); // check alignment EXPECT_EQ(202, ptr->m_data); // check value - if (poolAlloc.GetRecords()) + if (poolAllocator.GetRecords()) { - AZStd::lock_guard lock(*poolAlloc.GetRecords()); - const Debug::AllocationRecordsType& records = poolAlloc.GetRecords()->GetMap(); + AZStd::lock_guard lock(*poolAllocator.GetRecords()); + const Debug::AllocationRecordsType& records = poolAllocator.GetRecords()->GetMap(); Debug::AllocationRecordsType::const_iterator iter = records.find(ptr); EXPECT_TRUE(iter!=records.end()); // our allocation is in the list EXPECT_STREQ(iter->second.m_name, "MyClass"); } delete ptr; - if (poolAlloc.GetRecords()) + if (poolAllocator.GetRecords()) { - AZStd::lock_guard lock(*poolAlloc.GetRecords()); - const Debug::AllocationRecordsType& records = poolAlloc.GetRecords()->GetMap(); + AZStd::lock_guard lock(*poolAllocator.GetRecords()); + const Debug::AllocationRecordsType& records = poolAllocator.GetRecords()->GetMap(); EXPECT_TRUE(records.find(ptr)==records.end()); // our allocation is NOT in the list } @@ -1038,19 +1035,19 @@ namespace UnitTest ptr = azcreate(MyClass, (101), SystemAllocator); EXPECT_EQ(0, ((size_t)ptr & 31)); // check alignment EXPECT_EQ(101, ptr->m_data); // check value - if (sysAlloc.GetRecords()) + if (sysAllocator.GetRecords()) { - AZStd::lock_guard lock(*sysAlloc.GetRecords()); - const Debug::AllocationRecordsType& records = sysAlloc.GetRecords()->GetMap(); + AZStd::lock_guard lock(*sysAllocator.GetRecords()); + const Debug::AllocationRecordsType& records = sysAllocator.GetRecords()->GetMap(); Debug::AllocationRecordsType::const_iterator iter = records.find(ptr); EXPECT_TRUE(iter!=records.end()); // our allocation is in the list EXPECT_STREQ(iter->second.m_name, "MyClass"); } azdestroy(ptr, SystemAllocator); - if (sysAlloc.GetRecords()) + if (sysAllocator.GetRecords()) { - AZStd::lock_guard lock(*sysAlloc.GetRecords()); - const Debug::AllocationRecordsType& records = sysAlloc.GetRecords()->GetMap(); + AZStd::lock_guard lock(*sysAllocator.GetRecords()); + const Debug::AllocationRecordsType& records = sysAllocator.GetRecords()->GetMap(); EXPECT_TRUE(records.find(ptr)==records.end()); // our allocation is NOT in the list } @@ -1059,19 +1056,19 @@ namespace UnitTest ptr = azcreate(MyClass, (505), SystemAllocator, "MyClassNamed"); EXPECT_EQ(0, ((size_t)ptr & 31)); // check alignment EXPECT_EQ(505, ptr->m_data); // check value - if (sysAlloc.GetRecords()) + if (sysAllocator.GetRecords()) { - AZStd::lock_guard lock(*sysAlloc.GetRecords()); - const Debug::AllocationRecordsType& records = sysAlloc.GetRecords()->GetMap(); + AZStd::lock_guard lock(*sysAllocator.GetRecords()); + const Debug::AllocationRecordsType& records = sysAllocator.GetRecords()->GetMap(); Debug::AllocationRecordsType::const_iterator iter = records.find(ptr); EXPECT_TRUE(iter!=records.end()); // our allocation is in the list EXPECT_STREQ(iter->second.m_name, "MyClassNamed"); } azdestroy(ptr); // imply SystemAllocator - if (sysAlloc.GetRecords()) + if (sysAllocator.GetRecords()) { - AZStd::lock_guard lock(*sysAlloc.GetRecords()); - const Debug::AllocationRecordsType& records = sysAlloc.GetRecords()->GetMap(); + AZStd::lock_guard lock(*sysAllocator.GetRecords()); + const Debug::AllocationRecordsType& records = sysAllocator.GetRecords()->GetMap(); EXPECT_TRUE(records.find(ptr)==records.end()); // our allocation is NOT in the list } @@ -1080,20 +1077,20 @@ namespace UnitTest EXPECT_EQ(0, ((size_t)ptr & 31)); // check alignment EXPECT_EQ(303, ptr->m_data); // check value - if (poolAlloc.GetRecords()) + if (poolAllocator.GetRecords()) { - AZStd::lock_guard lock(*poolAlloc.GetRecords()); - const Debug::AllocationRecordsType& records = poolAlloc.GetRecords()->GetMap(); + AZStd::lock_guard lock(*poolAllocator.GetRecords()); + const Debug::AllocationRecordsType& records = poolAllocator.GetRecords()->GetMap(); Debug::AllocationRecordsType::const_iterator iter = records.find(ptr); EXPECT_TRUE(iter != records.end()); // our allocation is in the list EXPECT_STREQ(iter->second.m_name, "MyClass"); } delete ptr; - if (poolAlloc.GetRecords()) + if (poolAllocator.GetRecords()) { - AZStd::lock_guard lock(*poolAlloc.GetRecords()); - const Debug::AllocationRecordsType& records = poolAlloc.GetRecords()->GetMap(); + AZStd::lock_guard lock(*poolAllocator.GetRecords()); + const Debug::AllocationRecordsType& records = poolAllocator.GetRecords()->GetMap(); EXPECT_TRUE(records.find(ptr) == records.end()); // our allocation is NOT in the list } } @@ -1140,8 +1137,8 @@ namespace UnitTest return (size_t)1 << (size_t)(MAX_ALIGNMENT_LOG2 * r); } - class DebugSysAlloc - : public AZ::IAllocatorAllocate + class DebugSysAllocSchema + : public AZ::IAllocatorSchema { pointer_type Allocate(size_type byteSize, size_type alignment, int flags, const char* name = 0, const char* fileName = 0, int lineNum = 0, unsigned int suppressStackRecord = 0) override { @@ -1176,8 +1173,6 @@ namespace UnitTest size_type GetMaxAllocationSize() const override { return 1 * 1024 * 1024 * 1024; } /// Returns max allocation size of a single contiguous allocation size_type GetMaxContiguousAllocationSize() const override { return 1 * 1024 * 1024 * 1024; } - /// Returns a pointer to a sub-allocator or NULL. - IAllocatorAllocate* GetSubAllocator() override { return NULL; } }; public: void SetUp() override @@ -2565,7 +2560,7 @@ namespace UnitTest printf("\n\t\t\t=======================\n"); printf("\t\t\tSchemas Benchmark Test!\n"); printf("\t\t\t=======================\n"); - DebugSysAlloc da; + DebugSysAllocSchema da; { HphaSchema::Descriptor hphaDesc; hphaDesc.m_fixedMemoryBlockByteSize = AZ_TRAIT_OS_HPHA_MEMORYBLOCKBYTESIZE; diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp index 5cf5176308..7870749d24 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -112,7 +112,6 @@ namespace Benchmark { } - // IAllocatorAllocate static void* Allocate(size_t byteSize, size_t) { s_numAllocatedBytes += byteSize; @@ -580,6 +579,7 @@ namespace Benchmark //BM_REGISTER_ALLOCATOR(BestFitExternalMapAllocator, BestFitExternalMapAllocator); // Requires to pre-allocate blocks and cannot work as a general-purpose allocator //BM_REGISTER_ALLOCATOR(HeapSchemaAllocator, TestHeapSchemaAllocator); // Requires to pre-allocate blocks and cannot work as a general-purpose allocator //BM_REGISTER_SCHEMA(PoolSchema); // Requires special alignment requests while allocating + // BM_REGISTER_ALLOCATOR(OSAllocator, OSAllocator); // Requires special treatment to initialize since it will be already initialized, maybe creating a different instance? #undef BM_REGISTER_ALLOCATOR #undef BM_REGISTER_SIZE_FIXTURES diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorManager.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorManager.cpp index dc8ac033c1..bc758c1544 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorManager.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorManager.cpp @@ -7,7 +7,6 @@ */ #include -#include #include #include @@ -47,9 +46,6 @@ namespace UnitTest void RunTests() { - TestAllocatorShimWithDeallocateAfter(); - TestAllocatorShimRemovedAfterFinalization(); - TestAllocatorShimUsedForRealloc(); TearDownAllocatorManagerTest(); } @@ -64,7 +60,7 @@ namespace UnitTest EXPECT_EQ(m_manager->GetNumAllocators(), 0); AllocatorInstance::Create(); EXPECT_EQ(m_manager->GetNumAllocators(), 2); // SystemAllocator creates the OSAllocator if it doesn't exist - m_systemAllocator = &AllocatorInstance::GetAllocator(); + m_systemAllocator = &AllocatorInstance::Get(); } void TearDownAllocatorManagerTest() @@ -83,85 +79,6 @@ namespace UnitTest m_systemAllocator = nullptr; } - void TestAllocatorShimWithDeallocateAfter() - { - SetUpAllocatorManagerTest(); - - // Should begin with a shim installed. If this fails, check that AZCORE_MEMORY_ENABLE_OVERRIDES is enabled in AllocatorManager.cpp. - EXPECT_NE(m_systemAllocator->GetAllocationSource(), m_systemAllocator->GetOriginalAllocationSource()); - - const int testAllocBytes = TEST_ALLOC_BYTES; - - // Allocate from the shim, which should take from the allocator's original source - void* p = m_systemAllocator->GetAllocationSource()->Allocate(testAllocBytes, 0, 0); - EXPECT_NE(p, nullptr); - EXPECT_EQ(m_systemAllocator->GetOriginalAllocationSource()->NumAllocatedBytes(), testAllocBytes); - - // Add the override schema - m_manager->SetOverrideAllocatorSource(&m_mallocSchema); - - // Allocations should go through malloc schema instead of the allocator's regular schema - void* q = m_systemAllocator->GetAllocationSource()->Allocate(testAllocBytes, 0, 0); - EXPECT_NE(q, nullptr); - EXPECT_EQ(m_mallocSchema.NumAllocatedBytes(), testAllocBytes); - EXPECT_EQ(m_systemAllocator->GetOriginalAllocationSource()->NumAllocatedBytes(), testAllocBytes); - - // Finalize configuration, no more shims should be created after this point - m_manager->FinalizeConfiguration(); - - // Deallocating the original orphaned allocation from the SystemAllocator should remove the shim - EXPECT_NE(m_systemAllocator->GetAllocationSource(), &m_mallocSchema); - m_systemAllocator->GetAllocationSource()->DeAllocate(p); - EXPECT_EQ(m_systemAllocator->GetAllocationSource(), &m_mallocSchema); - - // Clean up - m_systemAllocator->GetAllocationSource()->DeAllocate(q); - } - - void TestAllocatorShimRemovedAfterFinalization() - { - SetUpAllocatorManagerTest(); - - // Should begin with a shim installed - EXPECT_NE(m_systemAllocator->GetAllocationSource(), m_systemAllocator->GetOriginalAllocationSource()); - - // Finalizing the configuration should remove the shim if it was unused - m_manager->FinalizeConfiguration(); - EXPECT_EQ(m_systemAllocator->GetAllocationSource(), m_systemAllocator->GetOriginalAllocationSource()); - } - - void TestAllocatorShimUsedForRealloc() - { - SetUpAllocatorManagerTest(); - - // Should begin with a shim installed - EXPECT_NE(m_systemAllocator->GetAllocationSource(), m_systemAllocator->GetOriginalAllocationSource()); - - const int testAllocBytes = TEST_ALLOC_BYTES; - - // Allocate from the shim, which should take from the allocator's original source - void* p = m_systemAllocator->GetAllocationSource()->Allocate(testAllocBytes, 0, 0); - EXPECT_NE(p, nullptr); - EXPECT_EQ(m_systemAllocator->GetOriginalAllocationSource()->NumAllocatedBytes(), testAllocBytes); - - // Add the override schema and finalize - m_manager->SetOverrideAllocatorSource(&m_mallocSchema); - m_manager->FinalizeConfiguration(); - - // Shim should still be present - EXPECT_NE(m_systemAllocator->GetAllocationSource(), &m_mallocSchema); - - // Reallocation should move allocation from the old source to the new source - EXPECT_EQ(m_mallocSchema.NumAllocatedBytes(), 0); - void* q = m_systemAllocator->GetAllocationSource()->ReAllocate(p, testAllocBytes * 2, 0); - EXPECT_NE(p, q); - EXPECT_EQ(m_mallocSchema.NumAllocatedBytes(), testAllocBytes * 2); - EXPECT_EQ(m_systemAllocator->GetOriginalAllocationSource()->NumAllocatedBytes(), 0); - - // Reallocation should also have removed the shim as it was no longer necessary - EXPECT_EQ(m_systemAllocator->GetAllocationSource(), &m_mallocSchema); - } - MallocSchema m_mallocSchema; AllocatorManager* m_manager = nullptr; IAllocator* m_systemAllocator = nullptr; diff --git a/Code/Framework/AzFramework/AzFramework/Archive/Archive.cpp b/Code/Framework/AzFramework/AzFramework/Archive/Archive.cpp index 04802a8d0e..c2fba5c5a3 100644 --- a/Code/Framework/AzFramework/AzFramework/Archive/Archive.cpp +++ b/Code/Framework/AzFramework/AzFramework/Archive/Archive.cpp @@ -1975,7 +1975,7 @@ namespace AZ::IO AZ_Error("Archive", false, "OSAllocator is not ready. It cannot be used to allocate a MemoryBlock"); return {}; } - AZ::IAllocatorAllocate* allocator = &AZ::AllocatorInstance::Get(); + AZ::IAllocator* allocator = &AZ::AllocatorInstance::Get(); AZStd::intrusive_ptr memoryBlock{ new (allocator->Allocate(sizeof(AZ::IO::MemoryBlock), alignof(AZ::IO::MemoryBlock))) AZ::IO::MemoryBlock{AZ::IO::MemoryBlockDeleter{ &AZ::AllocatorInstance::Get() }} }; auto CreateFunc = [](size_t byteSize, size_t byteAlignment, const char* name) { diff --git a/Code/Framework/AzFramework/AzFramework/Archive/IArchive.h b/Code/Framework/AzFramework/AzFramework/Archive/IArchive.h index d7eaee6e24..0bbc5aaaab 100644 --- a/Code/Framework/AzFramework/AzFramework/Archive/IArchive.h +++ b/Code/Framework/AzFramework/AzFramework/Archive/IArchive.h @@ -36,7 +36,7 @@ namespace AZ::IO struct MemoryBlockDeleter { void operator()(const AZStd::intrusive_refcount* ptr) const; - AZ::IAllocatorAllocate* m_allocator{}; + AZ::IAllocator* m_allocator{}; }; struct MemoryBlock : AZStd::intrusive_refcount diff --git a/Code/Framework/AzFramework/AzFramework/Archive/ZipDirCache.cpp b/Code/Framework/AzFramework/AzFramework/Archive/ZipDirCache.cpp index 13d5b0f723..05c773f056 100644 --- a/Code/Framework/AzFramework/AzFramework/Archive/ZipDirCache.cpp +++ b/Code/Framework/AzFramework/AzFramework/Archive/ZipDirCache.cpp @@ -42,7 +42,7 @@ namespace AZ::IO::ZipDir AZ_Error("Archive", false, "OSAllocator is not ready. It cannot be used to allocate a MemoryBlock"); return {}; } - AZ::IAllocatorAllocate* allocator = &AZ::AllocatorInstance::Get(); + AZ::IAllocator* allocator = &AZ::AllocatorInstance::Get(); AZStd::intrusive_ptr memoryBlock{ new (allocator->Allocate(sizeof(AZ::IO::MemoryBlock), alignof(AZ::IO::MemoryBlock))) AZ::IO::MemoryBlock{AZ::IO::MemoryBlockDeleter{ &AZ::AllocatorInstance::Get() }} }; auto CreateFunc = [](size_t byteSize, size_t byteAlignment, const char* name) { @@ -142,14 +142,14 @@ namespace AZ::IO::ZipDir { } - Cache::Cache(AZ::IAllocatorAllocate* allocator) + Cache::Cache(AZ::IAllocator* allocator) : m_fileHandle(AZ::IO::InvalidHandle) , m_nFlags(0) , m_lCDROffset(0) , m_encryptedHeaders(ZipFile::HEADERS_NOT_ENCRYPTED) , m_allocator{ allocator } { - AZ_Assert(allocator, "IAllocatorAllocate object is required in order to allocated memory for the ZipDir Cache operations"); + AZ_Assert(allocator, "IAllocator object is required in order to allocated memory for the ZipDir Cache operations"); } void Cache::Close() diff --git a/Code/Framework/AzFramework/AzFramework/Archive/ZipDirCache.h b/Code/Framework/AzFramework/AzFramework/Archive/ZipDirCache.h index ae1e3dfa9c..c8b19ebf33 100644 --- a/Code/Framework/AzFramework/AzFramework/Archive/ZipDirCache.h +++ b/Code/Framework/AzFramework/AzFramework/Archive/ZipDirCache.h @@ -40,7 +40,7 @@ namespace AZ::IO::ZipDir inline static constexpr int compressedBlockHeaderSizeInBytes = 4; //number of bytes we need in front of the compressed block to indicate which compressor was used Cache(); - explicit Cache(AZ::IAllocatorAllocate* allocator); + explicit Cache(AZ::IAllocator* allocator); ~Cache() { @@ -133,7 +133,7 @@ namespace AZ::IO::ZipDir friend class FileEntryTransactionAdd; FileEntryTree m_treeDir; AZ::IO::HandleType m_fileHandle; - AZ::IAllocatorAllocate* m_allocator; + AZ::IAllocator* m_allocator; AZ::IO::Path m_strFilePath; // String Pool for persistently storing paths as long as they reside in the cache diff --git a/Code/Framework/AzFramework/AzFramework/Archive/ZipDirList.cpp b/Code/Framework/AzFramework/AzFramework/Archive/ZipDirList.cpp index ab9c356d7f..9ad58443a0 100644 --- a/Code/Framework/AzFramework/AzFramework/Archive/ZipDirList.cpp +++ b/Code/Framework/AzFramework/AzFramework/Archive/ZipDirList.cpp @@ -39,7 +39,7 @@ namespace AZ::IO::ZipDir { } - auto FileDataRecord::New(const FileRecord& rThat, AZ::IAllocatorAllocate* allocator) -> AZStd::intrusive_ptr + auto FileDataRecord::New(const FileRecord& rThat, AZ::IAllocator* allocator) -> AZStd::intrusive_ptr { auto fileDataRecordAlloc = reinterpret_cast(allocator->Allocate( sizeof(FileDataRecord) + rThat.pFileEntryBase->desc.lSizeCompressed, diff --git a/Code/Framework/AzFramework/AzFramework/Archive/ZipDirList.h b/Code/Framework/AzFramework/AzFramework/Archive/ZipDirList.h index 1183dbf384..2a4df44f2d 100644 --- a/Code/Framework/AzFramework/AzFramework/Archive/ZipDirList.h +++ b/Code/Framework/AzFramework/AzFramework/Archive/ZipDirList.h @@ -28,7 +28,7 @@ namespace AZ::IO::ZipDir { void operator()(const AZStd::intrusive_refcount* ptr) const; - AZ::IAllocatorAllocate* m_allocator{}; + AZ::IAllocator* m_allocator{}; }; struct FileDataRecord : public FileRecord @@ -36,7 +36,7 @@ namespace AZ::IO::ZipDir { FileDataRecord(); - static auto New(const FileRecord& rThat, AZ::IAllocatorAllocate* allocator) ->AZStd::intrusive_ptr; + static auto New(const FileRecord& rThat, AZ::IAllocator* allocator) ->AZStd::intrusive_ptr; void* GetData() {return this + 1; } }; diff --git a/Code/Framework/AzFramework/AzFramework/Archive/ZipDirStructures.cpp b/Code/Framework/AzFramework/AzFramework/Archive/ZipDirStructures.cpp index cea517decd..1ac0906c94 100644 --- a/Code/Framework/AzFramework/AzFramework/Archive/ZipDirStructures.cpp +++ b/Code/Framework/AzFramework/AzFramework/Archive/ZipDirStructures.cpp @@ -25,13 +25,13 @@ namespace AZ::IO::ZipDir::ZipDirStructuresInternal { static void* ZlibAlloc(void* userData, uint32_t item, uint32_t size) { - auto allocator = reinterpret_cast(userData); + auto allocator = reinterpret_cast(userData); return allocator->Allocate(item * size, alignof(uint8_t), 0, "ZLibAlloc"); } static void ZlibFree(void* userData, void* ptr) { - auto allocator = reinterpret_cast(userData); + auto allocator = reinterpret_cast(userData); allocator->DeAllocate(ptr); } @@ -296,7 +296,7 @@ namespace AZ::IO::ZipDir::ZipDirStructuresInternal return {}; } - AZ::IAllocatorAllocate* allocator = &AZ::AllocatorInstance::Get(); + AZ::IAllocator* allocator = &AZ::AllocatorInstance::Get(); AZStd::intrusive_ptr memoryBlock{ new (allocator->Allocate(sizeof(AZ::IO::MemoryBlock), alignof(AZ::IO::MemoryBlock))) AZ::IO::MemoryBlock{AZ::IO::MemoryBlockDeleter{ &AZ::AllocatorInstance::Get() }} }; auto CreateFunc = [](size_t byteSize, size_t byteAlignment, const char* name) { @@ -451,7 +451,7 @@ namespace AZ::IO::ZipDir if (GetDiskFreeSpaceA(drive.c_str(),nullptr, &bytesPerSector, nullptr, nullptr)) { m_nSectorSize = bytesPerSector; - AZ::IAllocatorAllocate& allocator = AZ::AllocatorInstance::Get(); + AZ::IAllocator& allocator = AZ::AllocatorInstance::Get(); if (m_pReadTarget) { allocator.DeAllocate(m_pReadTarget); diff --git a/Code/LauncherUnified/Launcher.h b/Code/LauncherUnified/Launcher.h index 7c4c09c19f..eb1cf6479e 100644 --- a/Code/LauncherUnified/Launcher.h +++ b/Code/LauncherUnified/Launcher.h @@ -62,7 +62,7 @@ namespace O3DELauncher ResourceLimitUpdater m_updateResourceLimits = nullptr; //!< callback for updating system resources, if necessary OnPostApplicationStart m_onPostAppStart = nullptr; //!< callback notifying the platform specific entry point that AzGameFramework::GameApplication::Start has been called - AZ::IAllocatorAllocate* m_allocator = nullptr; //!< Used to allocate the temporary bootstrap memory, as well as the main \ref SystemAllocator heap. If null, OSAllocator will be used + AZ::IAllocator* m_allocator = nullptr; //!< Used to allocate the temporary bootstrap memory, as well as the main \ref SystemAllocator heap. If null, OSAllocator will be used const char* m_appResourcesPath = "."; //!< Path to the device specific assets, default is equivalent to blank path in ParseEngineConfig const char* m_appWriteStoragePath = nullptr; //!< Path to writeable storage if different than assets path, used to override userPath and logPath diff --git a/Code/Legacy/CryCommon/CryLegacyAllocator.h b/Code/Legacy/CryCommon/CryLegacyAllocator.h index b0e1e29657..e96c2a9347 100644 --- a/Code/Legacy/CryCommon/CryLegacyAllocator.h +++ b/Code/Legacy/CryCommon/CryLegacyAllocator.h @@ -23,19 +23,9 @@ inline void* CryModuleMallocImpl(size_t size, const char* file, const int line) #define CryModuleFree(ptr) CryModuleFreeImpl(ptr, __FILE__, __LINE__) #define CryModuleMemalignFree(ptr) CryModuleFreeImpl(ptr, __FILE__, __LINE__) -inline void CryModuleFreeImpl(void* ptr, const char* file, const int line) +inline void CryModuleFreeImpl(void* ptr, const char*, const int) { - - AZ::IAllocator& allocator = AZ::AllocatorInstance::GetAllocator(); - - if (allocator.IsAllocationSourceChanged()) - { - allocator.GetAllocationSource()->DeAllocate(ptr); - } - else - { - static_cast(allocator).DeAllocate(ptr, file, line); - } + AZ::AllocatorInstance::Get().DeAllocate(ptr, 0, 0); } #define CryModuleMemalign(size, alignment) CryModuleMemalignImpl(size, alignment, __FILE__, __LINE__) @@ -79,17 +69,5 @@ inline void* CryModuleReallocAlignImpl(void* prev, size_t size, size_t alignment } #endif - AZ::IAllocator& allocator = AZ::AllocatorInstance::GetAllocator(); - void *ptr; - - if (allocator.IsAllocationSourceChanged()) - { - ptr = allocator.GetAllocationSource()->ReAllocate(prev, size, 0); - } - else - { - ptr = static_cast(allocator).ReAllocate(prev, size, 0, file, line); - } - - return ptr; + return AZ::AllocatorInstance::Get().ReAllocate(prev, size, 0); } diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/DrawPacket.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/DrawPacket.h index d66a3ea1bb..7995002a39 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/DrawPacket.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/DrawPacket.h @@ -13,7 +13,7 @@ namespace AZ { - class IAllocatorAllocate; + class IAllocator; namespace RHI { @@ -66,7 +66,7 @@ namespace AZ DrawPacket() = default; // The allocator used to release the memory when Release() is called. - IAllocatorAllocate* m_allocator = nullptr; + IAllocator* m_allocator = nullptr; // The bit-mask of all active filter tags. DrawListMask m_drawListMask = 0; diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/DrawPacketBuilder.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/DrawPacketBuilder.h index 021125312b..30e013d486 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/DrawPacketBuilder.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/DrawPacketBuilder.h @@ -14,7 +14,7 @@ namespace AZ { - class IAllocatorAllocate; + class IAllocator; namespace RHI { @@ -50,7 +50,7 @@ namespace AZ // NOTE: This is configurable; just used to control the amount of memory held by the builder. static const size_t DrawItemCountMax = 16; - void Begin(IAllocatorAllocate* allocator); + void Begin(IAllocator* allocator); void SetDrawArguments(const DrawArguments& drawArguments); @@ -77,7 +77,7 @@ namespace AZ private: void ClearData(); - IAllocatorAllocate* m_allocator = nullptr; + IAllocator* m_allocator = nullptr; DrawArguments m_drawArguments; DrawListMask m_drawListMask = 0; DrawFilterMask m_drawFilterMask = DrawFilterMaskDefaultValue; diff --git a/Gems/Atom/RHI/Code/Source/RHI/DrawPacketBuilder.cpp b/Gems/Atom/RHI/Code/Source/RHI/DrawPacketBuilder.cpp index ebda9732df..ec9dd1a14f 100644 --- a/Gems/Atom/RHI/Code/Source/RHI/DrawPacketBuilder.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI/DrawPacketBuilder.cpp @@ -18,7 +18,7 @@ namespace AZ { namespace RHI { - void DrawPacketBuilder::Begin(IAllocatorAllocate* allocator) + void DrawPacketBuilder::Begin(IAllocator* allocator) { m_allocator = allocator ? allocator : &AllocatorInstance::Get(); } From a2d474cc4f30c17b7354221a1c0e55dfb20c6de4 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Thu, 9 Dec 2021 17:47:01 -0800 Subject: [PATCH 037/948] Add some intial tests Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 123 +++++++++- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 28 ++- .../AzCore/AzCore/DOM/DomValueWriter.cpp | 4 +- .../AzCore/Tests/DOM/DomValueBenchmarks.cpp | 0 .../AzCore/Tests/DOM/DomValueTests.cpp | 211 ++++++++++++++++++ .../AzCore/Tests/azcoretests_files.cmake | 2 + 6 files changed, 350 insertions(+), 18 deletions(-) create mode 100644 Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp create mode 100644 Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index 68a88ed35a..2f41835a37 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -97,6 +97,16 @@ namespace AZ::Dom return Value(&value); } + Value::Value(int32_t value) + : m_value(aznumeric_cast(value)) + { + } + + Value::Value(uint32_t value) + : m_value(aznumeric_cast(value)) + { + } + Value::Value(int64_t value) : m_value(value) { @@ -107,6 +117,11 @@ namespace AZ::Dom { } + Value::Value(float value) + : m_value(aznumeric_cast(value)) + { + } + Value::Value(double value) : m_value(value) { @@ -117,6 +132,40 @@ namespace AZ::Dom { } + Value::Value(Type type) + { + switch (type) + { + case Type::NullType: + // Null is the default initialized value + break; + case Type::FalseType: + m_value = false; + break; + case Type::TrueType: + m_value = true; + break; + case Type::ObjectType: + SetObject(); + break; + case Type::ArrayType: + SetArray(); + break; + case Type::StringType: + SetString(""); + break; + case Type::NumberType: + m_value = 0.0; + break; + case Type::NodeType: + SetNode(""); + break; + case Type::OpaqueType: + AZ_Assert(false, "AZ::Dom::Value may not be constructed with an empty opaque type"); + break; + } + } + Value& Value::operator=(const Value& other) { m_value = other.m_value; @@ -139,11 +188,11 @@ namespace AZ::Dom { if (IsInt()) { - return GetInt() == rhs.GetInt(); + return GetInt64() == rhs.GetInt64(); } else if (IsUint()) { - return GetUint() == rhs.GetUint(); + return GetUint64() == rhs.GetUint64(); } else { @@ -315,7 +364,7 @@ namespace AZ::Dom AZ_Assert( type == Type::ArrayType || type == Type::NodeType, "AZ::Dom::Value: attempted to retrieve an array from a value that isn't an array or a node"); - if (type == Type::ObjectType) + if (type == Type::ArrayType) { return AZStd::get(m_value)->m_values; } @@ -331,7 +380,7 @@ namespace AZ::Dom AZ_Assert( type == Type::ArrayType || type == Type::NodeType, "AZ::Dom::Value: attempted to retrieve an array from a value that isn't an array or node"); - if (type == Type::ObjectType) + if (type == Type::ArrayType) { return CheckCopyOnWrite(AZStd::get(m_value))->m_values; } @@ -702,7 +751,7 @@ namespace AZ::Dom return Value(); } - int64_t Value::GetInt() const + int64_t Value::GetInt64() const { switch (m_value.index()) { @@ -717,12 +766,22 @@ namespace AZ::Dom return {}; } - void Value::SetInt(int64_t value) + void Value::SetInt64(int64_t value) { m_value = value; } - uint64_t Value::GetUint() const + int32_t Value::GetInt32() const + { + return aznumeric_cast(GetInt64()); + } + + void Value::SetInt32(int32_t value) + { + m_value = aznumeric_cast(value); + } + + uint64_t Value::GetUint64() const { switch (m_value.index()) { @@ -737,11 +796,21 @@ namespace AZ::Dom return {}; } - void Value::SetUint(uint64_t value) + void Value::SetUint64(uint64_t value) { m_value = value; } + uint32_t Value::GetUint32() const + { + return aznumeric_cast(GetUint64()); + } + + void Value::SetUint32(uint32_t value) + { + m_value = aznumeric_cast(value); + } + bool Value::GetBool() const { if (IsBool()) @@ -777,6 +846,16 @@ namespace AZ::Dom m_value = value; } + float Value::GetFloat() const + { + return aznumeric_cast(GetDouble()); + } + + void Value::SetFloat(float value) + { + m_value = aznumeric_cast(value); + } + AZStd::string_view Value::GetString() const { switch (m_value.index()) @@ -861,6 +940,11 @@ namespace AZ::Dom const Object::ContainerType& object = GetObjectInternal(); for (const Object::EntryType& entry : object) { + result = visitor.Key(entry.first); + if (!result.IsSuccess()) + { + return; + } result = entry.second.Accept(visitor, copyStrings); if (!result.IsSuccess()) { @@ -896,6 +980,11 @@ namespace AZ::Dom const Object::ContainerType& object = GetObjectInternal(); for (const Object::EntryType& entry : object) { + result = visitor.Key(entry.first); + if (!result.IsSuccess()) + { + return; + } result = entry.second.Accept(visitor, copyStrings); if (!result.IsSuccess()) { @@ -932,6 +1021,16 @@ namespace AZ::Dom bool Value::DeepCompareIsEqual(const Value& other) const { + if (IsString() && other.IsString()) + { + // If we both hold the same ref counted string we don't need to do a full comparison + if (AZStd::holds_alternative>(m_value) && m_value == other.m_value) + { + return true; + } + return GetString() == other.GetString(); + } + if (m_value.index() != other.m_value.index()) { return false; @@ -1045,4 +1144,12 @@ namespace AZ::Dom }, m_value); } + + Value Value::DeepCopy(bool copyStrings) const + { + Value newValue; + AZStd::unique_ptr writer = newValue.GetWriteHandler(); + Accept(*writer, copyStrings); + return newValue; + } } // namespace AZ::Dom diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index a460274602..61c3207ea4 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -109,10 +109,15 @@ namespace AZ::Dom Value(Value&&) noexcept; Value(AZStd::string_view string, bool copy); - explicit Value(int64_t value); - explicit Value(uint64_t value); - explicit Value(double value); - explicit Value(bool value); + Value(int32_t value); + Value(uint32_t value); + Value(int64_t value); + Value(uint64_t value); + Value(float value); + Value(double value); + Value(bool value); + + explicit Value(Type type); static Value FromOpaqueValue(AZStd::any& value); @@ -226,12 +231,16 @@ namespace AZ::Dom Value GetNodeValue() const; // int API... - int64_t GetInt() const; - void SetInt(int64_t); + int64_t GetInt64() const; + void SetInt64(int64_t); + int32_t GetInt32() const; + void SetInt32(int32_t); // uint API... - uint64_t GetUint() const; - void SetUint(uint64_t); + uint64_t GetUint64() const; + void SetUint64(uint64_t); + uint32_t GetUint32() const; + void SetUint32(uint32_t); // bool API... bool GetBool() const; @@ -240,6 +249,8 @@ namespace AZ::Dom // double API... double GetDouble() const; void SetDouble(double); + float GetFloat() const; + void SetFloat(float); // string API... AZStd::string_view GetString() const; @@ -264,6 +275,7 @@ namespace AZ::Dom AZStd::unique_ptr GetWriteHandler(); bool DeepCompareIsEqual(const Value& other) const; + Value DeepCopy(bool copyStrings = true) const; private: const Node& GetNodeInternal() const; diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp index 71710f543b..a760cc5b28 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp @@ -39,13 +39,13 @@ namespace AZ::Dom Visitor::Result ValueWriter::Int64(AZ::s64 value) { - CurrentValue().SetInt(value); + CurrentValue().SetInt64(value); return FinishWrite(); } Visitor::Result ValueWriter::Uint64(AZ::u64 value) { - CurrentValue().SetUint(value); + CurrentValue().SetUint64(value); return FinishWrite(); } diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp new file mode 100644 index 0000000000..02777bf6dd --- /dev/null +++ b/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp @@ -0,0 +1,211 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace AZ::Dom::Tests +{ + class DomValueTests : public UnitTest::AllocatorsFixture + { + public: + void SetUp() override + { + UnitTest::AllocatorsFixture::SetUp(); + NameDictionary::Create(); + } + + void TearDown() override + { + m_value = Value(); + + NameDictionary::Destroy(); + UnitTest::AllocatorsFixture::TearDown(); + } + + void PerformValueChecks() + { + Value shallowCopy = m_value; + EXPECT_EQ(m_value, shallowCopy); + EXPECT_TRUE(m_value.DeepCompareIsEqual(shallowCopy)); + + Value deepCopy = m_value.DeepCopy(); + EXPECT_TRUE(m_value.DeepCompareIsEqual(deepCopy)); + } + + Value m_value; + }; + + TEST_F(DomValueTests, EmptyArray) + { + m_value.SetArray(); + + EXPECT_TRUE(m_value.IsArray()); + EXPECT_EQ(m_value.Size(), 0); + + PerformValueChecks(); + } + + TEST_F(DomValueTests, SimpleArray) + { + m_value.SetArray(); + + for (int i = 0; i < 5; ++i) + { + m_value.PushBack(Value(i)); + EXPECT_EQ(m_value.Size(), i + 1); + EXPECT_EQ(m_value[i].GetInt32(), i); + } + + PerformValueChecks(); + } + + TEST_F(DomValueTests, NestedArrays) + { + m_value.SetArray(); + for (int j = 0; j < 5; ++j) + { + Value nestedArray(Type::ArrayType); + for (int i = 0; i < 5; ++i) + { + nestedArray.PushBack(Value(i)); + } + m_value.PushBack(AZStd::move(nestedArray)); + } + + EXPECT_EQ(m_value.Size(), 5); + for (int i = 0; i < 3; ++i) + { + EXPECT_EQ(m_value[i].Size(), 5); + for (int j = 0; j < 5; ++j) + { + EXPECT_EQ(m_value[i][j].GetInt32(), j); + } + } + + PerformValueChecks(); + } + + TEST_F(DomValueTests, EmptyObject) + { + m_value.SetObject(); + EXPECT_EQ(m_value.MemberCount(), 0); + + PerformValueChecks(); + } + + TEST_F(DomValueTests, SimpleObject) + { + m_value.SetObject(); + for (int i = 0; i < 5; ++i) + { + AZStd::string key = AZStd::string::format("Key%i", i); + m_value.AddMember(key, Value(i)); + EXPECT_EQ(m_value.MemberCount(), i + 1); + EXPECT_EQ(m_value[key].GetInt32(), i); + } + + PerformValueChecks(); + } + + TEST_F(DomValueTests, NestedObjects) + { + m_value.SetObject(); + for (int j = 0; j < 3; ++j) + { + Value nestedObject(Type::ObjectType); + for (int i = 0; i < 5; ++i) + { + nestedObject.AddMember(AZStd::string::format("Key%i", i), Value(i)); + } + m_value.AddMember(AZStd::string::format("Obj%i", j), AZStd::move(nestedObject)); + } + + EXPECT_EQ(m_value.MemberCount(), 3); + for (int j = 0; j < 3; ++j) + { + const Value& nestedObject = m_value[AZStd::string::format("Obj%i", j)]; + EXPECT_EQ(nestedObject.MemberCount(), 5); + for (int i = 0; i < 5; ++i) + { + EXPECT_EQ(nestedObject[AZStd::string::format("Key%i", i)].GetInt32(), i); + } + } + + PerformValueChecks(); + } + + TEST_F(DomValueTests, EmptyNode) + { + m_value.SetNode("Test"); + EXPECT_EQ(m_value.GetNodeName(), AZ::Name("Test")); + EXPECT_EQ(m_value.MemberCount(), 0); + EXPECT_EQ(m_value.Size(), 0); + + PerformValueChecks(); + } + + TEST_F(DomValueTests, SimpleNode) + { + m_value.SetNode("Test"); + + for (int i = 0; i < 10; ++i) + { + m_value.PushBack(Value(i)); + EXPECT_EQ(m_value.Size(), i + 1); + EXPECT_EQ(m_value[i].GetInt32(), i); + + if (i < 5) + { + AZ::Name key = AZ::Name(AZStd::string::format("TwoTimes%i", i)); + m_value.AddMember(key, Value(i * 2)); + EXPECT_EQ(m_value.MemberCount(), i + 1); + EXPECT_EQ(m_value[key].GetInt32(), i * 2); + } + } + + PerformValueChecks(); + } + + TEST_F(DomValueTests, NestedNodes) + { + m_value.SetNode("TopLevel"); + + const AZ::Name childNodeName("ChildNode"); + + for (int i = 0; i < 5; ++i) + { + Value childNode(Type::NodeType); + childNode.SetNodeName(childNodeName); + childNode.SetNodeValue(i); + + childNode.AddMember("foo", i); + childNode.AddMember("bar", Value("test", false)); + + m_value.PushBack(childNode); + } + + EXPECT_EQ(m_value.Size(), 5); + for (int i = 0; i < 5; ++i) + { + const Value& childNode = m_value[i]; + EXPECT_EQ(childNode.GetNodeName(), childNodeName); + EXPECT_EQ(childNode.GetNodeValue().GetInt32(), i); + EXPECT_EQ(childNode["foo"].GetInt32(), i); + EXPECT_EQ(childNode["bar"].GetString(), "test"); + } + + PerformValueChecks(); + } +} // namespace AZ::Dom::Tests diff --git a/Code/Framework/AzCore/Tests/azcoretests_files.cmake b/Code/Framework/AzCore/Tests/azcoretests_files.cmake index 0fca75e2a8..14a8bbbac0 100644 --- a/Code/Framework/AzCore/Tests/azcoretests_files.cmake +++ b/Code/Framework/AzCore/Tests/azcoretests_files.cmake @@ -215,6 +215,8 @@ set(FILES AZStd/VectorAndArray.cpp DOM/DomJsonTests.cpp DOM/DomJsonBenchmarks.cpp + DOM/DomValueTests.cpp + DOM/DomValueBenchmarks.cpp ) # Prevent the following files from being grouped in UNITY builds From 0a7e9388ad71f79b192fc8dd781856004e05e238 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Thu, 9 Dec 2021 19:23:48 -0800 Subject: [PATCH 038/948] Cleanup: Adding wait_for_critical_expected_line as a public method to utils.py and updated the RPC test to use it. Signed-off-by: Gene Walters --- .../editor_python_test_tools/utils.py | 54 +++++++++++-------- .../tests/Multiplayer_AutoComponent_RPC.py | 30 +++-------- 2 files changed, 39 insertions(+), 45 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/utils.py index 7b526033dd..92ac279627 100644 --- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/utils.py +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/utils.py @@ -101,30 +101,38 @@ class TestHelper: Report.critical_result(msgtuple_success_fail, general.is_in_game_mode()) @staticmethod - def multiplayer_enter_game_mode(msgtuple_success_fail: Tuple[str, str], sv_default_player_spawn_asset: str) -> None: + def find_expected_line(window, expected_message, print_infos): """ - :param msgtuple_success_fail: The tuple with the expected/unexpected messages for entering game mode. - :param sv_default_player_spawn_asset: The path to the network player prefab that will be automatically spawned upon entering gamemode. The engine default is "prefabs/player.network.spawnable" + Looks for an expected line in a list of tracer log lines + :param window: The log's window name. For example, logs printed via script-canvas use the "Script" window. + :param expected_message: The log message to search. + :param print_infos: A list of PrintInfos collected by Tracer to search. Example options: your_tracer.warnings, your_tracer.errors, your_tracer.asserts, or your_tracer.prints - :return: None + :return: True if the message is found, otherwise false. """ + for printInfo in print_infos: + if printInfo.window == window.strip() and printInfo.message.strip() == expected_message: + return True + return False - # looks for an expected line in a list of tracers lines - # lines: the tracer list of lines to search. options are section_tracer.warnings, section_tracer.errors, section_tracer.asserts, section_tracer.prints - # return: true if the line is found, otherwise false - def find_expected_line(expected_line, lines): - found_lines = [printInfo.message.strip() for printInfo in lines] - return expected_line in found_lines - - def wait_for_critical_expected_line(expected_line, lines, time_out): - TestHelper.wait_for_condition(lambda : find_expected_line(expected_line, lines), time_out) - Report.critical_result(("Found expected line: " + expected_line, "Failed to find expected line: " + expected_line), find_expected_line(expected_line, lines)) + @staticmethod + def wait_for_critical_expected_line(window, expected_message, print_infos, time_out): + TestHelper.wait_for_condition(lambda : TestHelper.find_expected_line(window, expected_message, print_infos), time_out) + Report.critical_result(("Found expected line: " + expected_message, "Failed to find expected line: " + expected_message), TestHelper.find_expected_line(window, expected_message, print_infos)) - def wait_for_critical_unexpected_line(unexpected_line, lines, time_out): - TestHelper.wait_for_condition(lambda : find_expected_line(unexpected_line, lines), time_out) - Report.critical_result(("Unexpected line not found: " + unexpected_line, "Unexpected line found: " + unexpected_line), not find_expected_line(unexpected_line, lines)) + @staticmethod + def wait_for_critical_unexpected_line(window, unexpected_line, print_infos, time_out): + TestHelper.wait_for_condition(lambda : TestHelper.find_expected_line(window, unexpected_line, print_infos), time_out) + Report.critical_result(("Unexpected line not found: " + unexpected_line, "Unexpected line found: " + unexpected_line), not TestHelper.find_expected_line(window, unexpected_line, print_infos)) + @staticmethod + def multiplayer_enter_game_mode(msgtuple_success_fail: Tuple[str, str], sv_default_player_spawn_asset: str) -> None: + """ + :param msgtuple_success_fail: The tuple with the expected/unexpected messages for entering game mode. + :param sv_default_player_spawn_asset: The path to the network player prefab that will be automatically spawned upon entering gamemode. The engine default is "prefabs/player.network.spawnable" + :return: None + """ Report.info("Entering game mode") if sv_default_player_spawn_asset : general.set_cvar("sv_defaultPlayerSpawnAsset", sv_default_player_spawn_asset) @@ -135,20 +143,20 @@ class TestHelper: multiplayer.PythonEditorFuncs_enter_game_mode() # make sure the server launcher binary exists - wait_for_critical_unexpected_line("LaunchEditorServer failed! The ServerLauncher binary is missing!", section_tracer.errors, 0.5) + TestHelper.wait_for_critical_unexpected_line("MultiplayerEditor", "LaunchEditorServer failed! The ServerLauncher binary is missing!", section_tracer.errors, 0.5) # make sure the server launcher is running waiter.wait_for(lambda: process_utils.process_exists("AutomatedTesting.ServerLauncher", ignore_extensions=True), timeout=5.0, exc=AssertionError("AutomatedTesting.ServerLauncher has NOT launched!"), interval=1.0) - wait_for_critical_expected_line("MultiplayerEditorConnection: Editor-server activation has found and connected to the editor.", section_tracer.prints, 15.0) + TestHelper.wait_for_critical_expected_line("EditorServer", "MultiplayerEditorConnection: Editor-server activation has found and connected to the editor.", section_tracer.prints, 15.0) - wait_for_critical_expected_line("Editor is sending the editor-server the level data packet.", section_tracer.prints, 5.0) + TestHelper.wait_for_critical_expected_line("MultiplayerEditor", "Editor is sending the editor-server the level data packet.", section_tracer.prints, 5.0) - wait_for_critical_expected_line("Logger: Editor Server completed receiving the editor's level assets, responding to Editor...", section_tracer.prints, 5.0) + TestHelper.wait_for_critical_expected_line("EditorServer", "Logger: Editor Server completed receiving the editor's level assets, responding to Editor...", section_tracer.prints, 5.0) - wait_for_critical_expected_line("Editor-server ready. Editor has successfully connected to the editor-server's network simulation.", section_tracer.prints, 5.0) + TestHelper.wait_for_critical_expected_line("MultiplayerEditorConnection", "Editor-server ready. Editor has successfully connected to the editor-server's network simulation.", section_tracer.prints, 5.0) - wait_for_critical_unexpected_line(f"MultiplayerSystemComponent: SpawnDefaultPlayerPrefab failed. Missing sv_defaultPlayerSpawnAsset at path '{sv_default_player_spawn_asset.lower()}'.", section_tracer.prints, 0.5) + TestHelper.wait_for_critical_unexpected_line("EditorServer", f"MultiplayerSystemComponent: SpawnDefaultPlayerPrefab failed. Missing sv_defaultPlayerSpawnAsset at path '{sv_default_player_spawn_asset.lower()}'.", section_tracer.prints, 0.5) TestHelper.wait_for_condition(lambda : multiplayer.PythonEditorFuncs_is_in_game_mode(), 5.0) Report.critical_result(msgtuple_success_fail, multiplayer.PythonEditorFuncs_is_in_game_mode()) diff --git a/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py b/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py index 3f971e4abf..387de66acd 100644 --- a/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py +++ b/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py @@ -14,27 +14,25 @@ class Tests(): enter_game_mode = ("Entered game mode", "Failed to enter game mode") exit_game_mode = ("Exited game mode", "Couldn't exit game mode") find_network_player = ("Found network player", "Couldn't find network player") - found_lines = ("Expected log lines were found", "Expected log lines were not found") - found_unexpected_lines = ("Unexpected log lines were not found", "Unexpected log lines were found") # fmt: on def Multiplayer_AutoComponent_RPC(): r""" Summary: - Runs a test to make sure that network input can be sent from the autonomous player, received by the authority, and processed + Runs a test to make sure that RPCs can be sent and received via script canvas Level Description: - Dynamic - 1. Although the level is empty, when the server and editor connect the server will spawn and replicate the player network prefab. - a. The player network prefab has a NetworkTestPlayerComponent.AutoComponent and a script canvas attached which will listen for the CreateInput and ProcessInput events. - Print logs occur upon triggering the CreateInput and ProcessInput events along with their values; we are testing to make sure the expected events are values are recieved. + 1. Although the level is nearly empty, when the server and editor connect the server will spawn and replicate the player network prefab. + a. The player network prefab has a NetworkTestPlayerComponent.AutoComponent and a script canvas attached which sends and receives various RPCs. + Print logs occur upon sending and receiving the RPCs; we are testing to make sure the expected events and values are received. - Static - 1. This is an empty level. All the logic occurs on the Player.network.spawnable (see the above Dynamic description) + 1. NetLevelEntity. This is a networked entity which has a script attached. Used for cross-entity communication. The net-player prefab will send this level entity Server->Authority RPCs Expected Outcome: - We should see editor logs stating that network input has been created and processed. + We should see editor logs stating that RPCs have been sent and received. However, if the script receives unexpected values for the Process event we will see print logs for bad data as well. :return: @@ -46,18 +44,6 @@ def Multiplayer_AutoComponent_RPC(): from editor_python_test_tools.utils import TestHelper as helper from ly_remote_console.remote_console_commands import RemoteConsole as RemoteConsole - - # looks for an expected line in a list of tracers lines - # lines: the tracer list of lines to search. options are section_tracer.warnings, section_tracer.errors, section_tracer.asserts, section_tracer.prints - # return: true if the line is found, otherwise false - def find_expected_line(expected_line, lines): - found_lines = [printInfo.message.strip() for printInfo in lines] - return expected_line in found_lines - - def wait_for_critical_expected_line(expected_line, lines, time_out): - helper.wait_for_condition(lambda : find_expected_line(expected_line, lines), time_out) - Report.critical_result(("Found expected line: " + expected_line, "Failed to find expected line: " + expected_line), find_expected_line(expected_line, lines)) - level_name = "AutoComponent_RPC" player_prefab_name = "Player" player_prefab_path = f"levels/multiplayer/{level_name}/{player_prefab_name}.network.spawnable" @@ -77,8 +63,8 @@ def Multiplayer_AutoComponent_RPC(): # 4) Check the editor logs for expected and unexpected log output EXPECTEDLINE_WAIT_TIME_SECONDS = 1.0 - wait_for_critical_expected_line('Script: AutoComponent_RPC: Sending client PlayerNumber 1', section_tracer.prints, EXPECTEDLINE_WAIT_TIME_SECONDS) - wait_for_critical_expected_line("AutoComponent_RPC: I'm Player #1", section_tracer.prints, EXPECTEDLINE_WAIT_TIME_SECONDS) + helper.wait_for_critical_expected_line('EditorServer', 'Script: AutoComponent_RPC: Sending client PlayerNumber 1', section_tracer.prints, EXPECTEDLINE_WAIT_TIME_SECONDS) + helper.wait_for_critical_expected_line('Script', "AutoComponent_RPC: I'm Player #1", section_tracer.prints, EXPECTEDLINE_WAIT_TIME_SECONDS) # Exit game mode From 15e0bb16939b38b578cd075e297794a72fee4eac Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Thu, 9 Dec 2021 21:37:22 -0800 Subject: [PATCH 039/948] Add tests, fix missing bool in Accept and operator[] insert Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 21 ++++- .../AzCore/Tests/DOM/DomValueTests.cpp | 87 +++++++++++++++++++ 2 files changed, 107 insertions(+), 1 deletion(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index 2f41835a37..675a6931f5 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -407,7 +407,22 @@ namespace AZ::Dom Value& Value::operator[](KeyType name) { - return FindMember(name)->second; + Object::ContainerType& object = GetObjectInternal(); + auto existingEntry = AZStd::find_if( + object.begin(), object.end(), + [&name](const Object::EntryType& entry) + { + return entry.first == name; + }); + if (existingEntry != object.end()) + { + return existingEntry->second; + } + else + { + object.emplace_back(name, Value()); + return object[object.size() - 1].second; + } } const Value& Value::operator[](KeyType name) const @@ -924,6 +939,10 @@ namespace AZ::Dom { result = visitor.Double(arg); } + else if constexpr (AZStd::is_same_v) + { + result = visitor.Bool(arg); + } else if constexpr (AZStd::is_same_v) { result = visitor.String(arg, copyStrings ? Lifetime::Temporary : Lifetime::Persistent); diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp index 02777bf6dd..75cb71248f 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp @@ -14,6 +14,7 @@ #include #include #include +#include namespace AZ::Dom::Tests { @@ -208,4 +209,90 @@ namespace AZ::Dom::Tests PerformValueChecks(); } + + TEST_F(DomValueTests, Int64) + { + m_value.SetObject(); + m_value["int64_min"] = AZStd::numeric_limits::min(); + m_value["int64_max"] = AZStd::numeric_limits::max(); + + EXPECT_EQ(m_value["int64_min"].GetType(), Type::NumberType); + EXPECT_EQ(m_value["int64_min"].GetInt64(), AZStd::numeric_limits::min()); + EXPECT_EQ(m_value["int64_max"].GetType(), Type::NumberType); + EXPECT_EQ(m_value["int64_max"].GetInt64(), AZStd::numeric_limits::max()); + + PerformValueChecks(); + } + + TEST_F(DomValueTests, Uint64) + { + m_value.SetObject(); + m_value["uint64_min"] = AZStd::numeric_limits::min(); + m_value["uint64_max"] = AZStd::numeric_limits::max(); + + EXPECT_EQ(m_value["uint64_min"].GetType(), Type::NumberType); + EXPECT_EQ(m_value["uint64_min"].GetInt64(), AZStd::numeric_limits::min()); + EXPECT_EQ(m_value["uint64_max"].GetType(), Type::NumberType); + EXPECT_EQ(m_value["uint64_max"].GetInt64(), AZStd::numeric_limits::max()); + + PerformValueChecks(); + } + + TEST_F(DomValueTests, Double) + { + m_value.SetObject(); + m_value["double_min"] = AZStd::numeric_limits::min(); + m_value["double_max"] = AZStd::numeric_limits::max(); + + EXPECT_EQ(m_value["double_min"].GetType(), Type::NumberType); + EXPECT_EQ(m_value["double_min"].GetDouble(), AZStd::numeric_limits::min()); + EXPECT_EQ(m_value["double_max"].GetType(), Type::NumberType); + EXPECT_EQ(m_value["double_max"].GetDouble(), AZStd::numeric_limits::max()); + + PerformValueChecks(); + } + + TEST_F(DomValueTests, Null) + { + m_value.SetObject(); + m_value["null_value"] = Value(Type::NullType); + + EXPECT_EQ(m_value["null_value"].GetType(), Type::NullType); + EXPECT_EQ(m_value["null_type"], Value()); + + PerformValueChecks(); + } + + TEST_F(DomValueTests, Bool) + { + m_value.SetObject(); + m_value["true_value"] = true; + m_value["false_value"] = false; + + EXPECT_EQ(m_value["true_value"].GetType(), Type::TrueType); + EXPECT_EQ(m_value["true_value"].GetBool(), true); + EXPECT_EQ(m_value["false_value"].GetType(), Type::FalseType); + EXPECT_EQ(m_value["false_value"].GetBool(), false); + + PerformValueChecks(); + } + + TEST_F(DomValueTests, String) + { + m_value.SetObject(); + AZStd::string stringToReference = "foo"; + m_value["no_copy"] = Value(stringToReference, false); + AZStd::string stringToCopy = "bar"; + m_value["copy"] = Value(stringToCopy, true); + + EXPECT_EQ(m_value["no_copy"].GetType(), Type::StringType); + EXPECT_EQ(m_value["no_copy"].GetString(), stringToReference); + EXPECT_EQ(m_value["no_copy"].GetString().data(), stringToReference.data()); + + EXPECT_EQ(m_value["copy"].GetType(), Type::StringType); + EXPECT_EQ(m_value["copy"].GetString(), stringToCopy); + EXPECT_NE(m_value["copy"].GetString().data(), stringToCopy.data()); + + PerformValueChecks(); + } } // namespace AZ::Dom::Tests From 947951b6c7473ccd45647e5e5c3938b5122718e7 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Thu, 9 Dec 2021 23:43:22 -0800 Subject: [PATCH 040/948] Add copy on write tests Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 34 ++++++-- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 14 ++- .../AzCore/Tests/DOM/DomValueTests.cpp | 86 +++++++++++++++++++ 3 files changed, 123 insertions(+), 11 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index 675a6931f5..d9398da116 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -476,7 +476,7 @@ namespace AZ::Dom return FindMember(AZ::Name(name)); } - Object::Iterator Value::FindMember(KeyType name) + Object::Iterator Value::FindMutableMember(KeyType name) { Object::ContainerType& object = GetObjectInternal(); return AZStd::find_if( @@ -487,9 +487,9 @@ namespace AZ::Dom }); } - Object::Iterator Value::FindMember(AZStd::string_view name) + Object::Iterator Value::FindMutableMember(AZStd::string_view name) { - return FindMember(AZ::Name(name)); + return FindMutableMember(AZ::Name(name)); } Value& Value::MemberReserve(size_t newCapacity) @@ -511,7 +511,7 @@ namespace AZ::Dom Value& Value::AddMember(KeyType name, const Value& value) { Object::ContainerType& object = GetObjectInternal(); - if (auto memberIt = FindMember(name); memberIt != object.end()) + if (auto memberIt = FindMutableMember(name); memberIt != object.end()) { memberIt->second = value; } @@ -530,7 +530,7 @@ namespace AZ::Dom Value& Value::AddMember(AZ::Name name, Value&& value) { Object::ContainerType& object = GetObjectInternal(); - if (auto memberIt = FindMember(name); memberIt != object.end()) + if (auto memberIt = FindMutableMember(name); memberIt != object.end()) { memberIt->second = value; } @@ -601,7 +601,7 @@ namespace AZ::Dom return EraseMember(AZ::Name(name)); } - Object::ContainerType& Value::GetObject() + Object::ContainerType& Value::GetMutableObject() { return GetObjectInternal(); } @@ -647,6 +647,16 @@ namespace AZ::Dom return GetArrayInternal()[index]; } + Value& Value::MutableAt(size_t index) + { + return operator[](index); + } + + const Value& Value::At(size_t index) const + { + return operator[](index); + } + Array::ConstIterator Value::Begin() const { return GetArrayInternal().begin(); @@ -695,7 +705,7 @@ namespace AZ::Dom return GetArrayInternal().erase(first, last); } - Array::ContainerType& Value::GetArray() + Array::ContainerType& Value::GetMutableArray() { return GetArrayInternal(); } @@ -766,6 +776,16 @@ namespace AZ::Dom return Value(); } + Node& Value::GetMutableNode() + { + return GetNodeInternal(); + } + + const Node& Value::GetNode() const + { + return GetNodeInternal(); + } + int64_t Value::GetInt64() const { switch (m_value.index()) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index 61c3207ea4..39ae5a5c37 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -162,10 +162,10 @@ namespace AZ::Dom Object::Iterator MemberBegin(); Object::Iterator MemberEnd(); + Object::Iterator FindMutableMember(KeyType name); + Object::Iterator FindMutableMember(AZStd::string_view name); Object::ConstIterator FindMember(KeyType name) const; Object::ConstIterator FindMember(AZStd::string_view name) const; - Object::Iterator FindMember(KeyType name); - Object::Iterator FindMember(AZStd::string_view name); Value& MemberReserve(size_t newCapacity); bool HasMember(KeyType name) const; @@ -185,7 +185,7 @@ namespace AZ::Dom Object::Iterator EraseMember(KeyType name); Object::Iterator EraseMember(AZStd::string_view name); - Object::ContainerType& GetObject(); + Object::ContainerType& GetMutableObject(); const Object::ContainerType& GetObject() const; // Array API (also used by Node)... @@ -199,6 +199,9 @@ namespace AZ::Dom Value& operator[](size_t index); const Value& operator[](size_t index) const; + Value& MutableAt(size_t index); + const Value& At(size_t index) const; + Array::ConstIterator Begin() const; Array::ConstIterator End() const; Array::Iterator Begin(); @@ -211,7 +214,7 @@ namespace AZ::Dom Array::Iterator Erase(Array::ConstIterator pos); Array::Iterator Erase(Array::ConstIterator first, Array::ConstIterator last); - Array::ContainerType& GetArray(); + Array::ContainerType& GetMutableArray(); const Array::ContainerType& GetArray() const; // Node API (supports both object + array API, plus a dedicated NodeName)... @@ -230,6 +233,9 @@ namespace AZ::Dom //! Convenience method, gets the first non-node element of a Node. Value GetNodeValue() const; + Node& GetMutableNode(); + const Node& GetNode() const; + // int API... int64_t GetInt64() const; void SetInt64(int64_t); diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp index 75cb71248f..84e2e16958 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp @@ -295,4 +295,90 @@ namespace AZ::Dom::Tests PerformValueChecks(); } + + TEST_F(DomValueTests, CopyOnWrite_Object) + { + Value v1(Type::ObjectType); + v1["foo"] = 5; + + Value nestedObject(Type::ObjectType); + v1["obj"] = nestedObject; + + Value v2 = v1; + EXPECT_EQ(&v1.GetObject(), &v2.GetObject()); + EXPECT_EQ(&v1.FindMember("obj")->second.GetObject(), &v2.FindMember("obj")->second.GetObject()); + + v2["foo"] = 0; + + EXPECT_NE(&v1.GetObject(), &v2.GetObject()); + EXPECT_EQ(&v1.FindMember("obj")->second.GetObject(), &v2.FindMember("obj")->second.GetObject()); + + v2["obj"]["key"] = true; + + EXPECT_NE(&v1.GetObject(), &v2.GetObject()); + EXPECT_NE(&v1.FindMember("obj")->second.GetObject(), &v2.FindMember("obj")->second.GetObject()); + + v2 = v1; + + EXPECT_EQ(&v1.GetObject(), &v2.GetObject()); + EXPECT_EQ(&v1.FindMember("obj")->second.GetObject(), &v2.FindMember("obj")->second.GetObject()); + } + + TEST_F(DomValueTests, CopyOnWrite_Array) + { + Value v1(Type::ArrayType); + v1.PushBack(1); + v1.PushBack(2); + + Value nestedArray(Type::ArrayType); + v1.PushBack(nestedArray); + Value v2 = v1; + + EXPECT_EQ(&v1.GetArray(), &v2.GetArray()); + EXPECT_EQ(&v1.At(2).GetArray(), &v2.At(2).GetArray()); + + v2[0] = 0; + + EXPECT_NE(&v1.GetArray(), &v2.GetArray()); + EXPECT_EQ(&v1.At(2).GetArray(), &v2.At(2).GetArray()); + + v2[2].PushBack(42); + + EXPECT_NE(&v1.GetArray(), &v2.GetArray()); + EXPECT_NE(&v1.At(2).GetArray(), &v2.At(2).GetArray()); + + v2 = v1; + + EXPECT_EQ(&v1.GetArray(), &v2.GetArray()); + EXPECT_EQ(&v1.At(2).GetArray(), &v2.At(2).GetArray()); + } + + TEST_F(DomValueTests, CopyOnWrite_Node) + { + Value v1; + v1.SetNode("TopLevel"); + + v1.PushBack(1); + v1.PushBack(2); + v1["obj"].SetNode("Nested"); + Value v2 = v1; + + EXPECT_EQ(&v1.GetNode(), &v2.GetNode()); + EXPECT_EQ(&v1["obj"].GetNode(), &v2["obj"].GetNode()); + + v2[0] = 0; + + EXPECT_NE(&v1.GetNode(), &v2.GetNode()); + EXPECT_EQ(&v1["obj"].GetNode(), &v2["obj"].GetNode()); + + v2["obj"].PushBack(42); + + EXPECT_NE(&v1.GetNode(), &v2.GetNode()); + EXPECT_NE(&v1["obj"].GetNode(), &v2["obj"].GetNode()); + + v2 = v1; + + EXPECT_EQ(&v1.GetNode(), &v2.GetNode()); + EXPECT_EQ(&v1["obj"].GetNode(), &v2["obj"].GetNode()); + } } // namespace AZ::Dom::Tests From 6613030fe691d87c3a870f17c448746616c44787 Mon Sep 17 00:00:00 2001 From: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com> Date: Fri, 10 Dec 2021 10:15:39 -0800 Subject: [PATCH 041/948] Fix Visual Studio requirements text and doc link (#6312) Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com> --- .../Platform/Windows/ProjectUtils_windows.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Code/Tools/ProjectManager/Platform/Windows/ProjectUtils_windows.cpp b/Code/Tools/ProjectManager/Platform/Windows/ProjectUtils_windows.cpp index 38bb867244..41a878f0ae 100644 --- a/Code/Tools/ProjectManager/Platform/Windows/ProjectUtils_windows.cpp +++ b/Code/Tools/ProjectManager/Platform/Windows/ProjectUtils_windows.cpp @@ -106,10 +106,8 @@ namespace O3DE::ProjectManager } return AZ::Failure(QObject::tr("Visual Studio 2019 version 16.9.2 or higher not found.

" - "Visual Studio 2019 is required to build this project." - " Install any edition of Visual Studio 2019" - " or update to a newer version before proceeding to the next step." - " While installing configure Visual Studio with these workloads.")); + "A compatible version of Visual Studio is required to build this project.
" + "Refer to the Visual Studio requirements for more information.")); } AZ::Outcome OpenCMakeGUI(const QString& projectPath) From 31c627defc405e850ad8d0fb0f6962d252e07950 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Thu, 14 Oct 2021 09:06:54 -0700 Subject: [PATCH 042/948] initial scriptcanvas source handle Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- Code/Framework/AzCore/AzCore/Utils/Utils.cpp | 5 +- .../Builder/ScriptCanvasBuilderWorker.cpp | 112 ++++---- .../Code/Builder/ScriptCanvasBuilderWorker.h | 5 +- .../Assets/ScriptCanvasAssetHandler.cpp | 46 +--- .../Assets/ScriptCanvasFileHandling.cpp | 129 ++++++++++ .../Editor/Assets/ScriptCanvasMemoryAsset.h | 1 - .../Code/Editor/Components/EditorGraph.cpp | 19 ++ .../Assets/ScriptCanvasAssetHandler.h | 5 - .../Assets/ScriptCanvasBaseAssetData.cpp | 14 +- .../Assets/ScriptCanvasBaseAssetData.h | 6 +- .../Assets/ScriptCanvasFileHandling.h | 35 +++ .../Assets/ScriptCanvasSourceFileHandle.cpp | 61 +++++ .../Assets/ScriptCanvasSourceFileHandle.h | 47 ++++ .../Include/ScriptCanvas/Bus/RequestBus.h | 2 +- .../ScriptCanvas/Components/EditorGraph.h | 2 + .../Code/Editor/View/Windows/MainWindow.cpp | 239 ++++++++++-------- .../Code/Editor/View/Windows/MainWindow.h | 95 ++++--- .../Asset/ScriptCanvasAssetBase.h | 3 +- .../Code/Include/ScriptCanvas/Core/Core.h | 24 ++ .../Code/Include/ScriptCanvas/Core/Graph.h | 4 +- .../Code/scriptcanvasgem_editor_files.cmake | 4 + 21 files changed, 577 insertions(+), 281 deletions(-) create mode 100644 Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp create mode 100644 Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h create mode 100644 Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.cpp create mode 100644 Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.h diff --git a/Code/Framework/AzCore/AzCore/Utils/Utils.cpp b/Code/Framework/AzCore/AzCore/Utils/Utils.cpp index 12c6473905..1623aca56b 100644 --- a/Code/Framework/AzCore/AzCore/Utils/Utils.cpp +++ b/Code/Framework/AzCore/AzCore/Utils/Utils.cpp @@ -165,13 +165,12 @@ namespace AZ::Utils } Container fileContent; - fileContent.resize(length); + fileContent.resize_no_construct(length); AZ::IO::SizeType bytesRead = file.Read(length, fileContent.data()); file.Close(); // Resize again just in case bytesRead is less than length for some reason - fileContent.resize(bytesRead); - + fileContent.resize_no_construct(bytesRead); return AZ::Success(AZStd::move(fileContent)); } diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp index f474c10532..7a7dbfff0b 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp @@ -16,9 +16,11 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -44,54 +46,73 @@ namespace ScriptCanvasBuilder AzFramework::StringFunc::Path::ConstructFull(request.m_watchFolder.data(), request.m_sourceFile.data(), fullPath, false); AzFramework::StringFunc::Path::Normalize(fullPath); - if (!m_editorAssetHandler) - { - AZ_Error(s_scriptCanvasBuilder, false, R"(CreateJobs for %s failed because the ScriptCanvas Editor Asset handler is missing.)", fullPath.data()); - } + AZ::Data::Asset asset; + const ScriptCanvasEditor::Graph* sourceGraph = nullptr; + const ScriptCanvas::GraphData* graphData = nullptr; - AZStd::shared_ptr assetDataStream = AZStd::make_shared(); + ScriptCanvasEditor::SourceHandle sourceHandle; - AZ::IO::FileIOStream stream(fullPath.c_str(), AZ::IO::OpenMode::ModeRead); - if (!AZ::IO::RetryOpenStream(stream)) + auto sourceOutcome = ScriptCanvasEditor::LoadFromFile(fullPath); + if (sourceOutcome.IsSuccess()) { - AZ_Warning(s_scriptCanvasBuilder, false, "CreateJobs for \"%s\" failed because the source file could not be opened.", fullPath.data()); - return; + sourceHandle = sourceOutcome.TakeValue(); + sourceGraph = sourceHandle.Get(); + graphData = sourceGraph->GetGraphDataConst(); } - - // Read the asset into a memory buffer, then hand ownership of the buffer to assetDataStream + +#if defined(EDITOR_ASSET_SUPPORT_ENABLED) + if (graphData == nullptr) { - AZ::IO::FileIOStream ioStream; - if (!ioStream.Open(fullPath.data(), AZ::IO::OpenMode::ModeRead)) + if (!m_editorAssetHandler) + { + AZ_Error(s_scriptCanvasBuilder, false, R"(CreateJobs for %s failed because the ScriptCanvas Editor Asset handler is missing.)", fullPath.data()); + } + + AZStd::shared_ptr assetDataStream = AZStd::make_shared(); + + AZ::IO::FileIOStream stream(fullPath.c_str(), AZ::IO::OpenMode::ModeRead); + if (!AZ::IO::RetryOpenStream(stream)) { AZ_Warning(s_scriptCanvasBuilder, false, "CreateJobs for \"%s\" failed because the source file could not be opened.", fullPath.data()); return; } - AZStd::vector fileBuffer(ioStream.GetLength()); - size_t bytesRead = ioStream.Read(fileBuffer.size(), fileBuffer.data()); - if (bytesRead != ioStream.GetLength()) + // Read the asset into a memory buffer, then hand ownership of the buffer to assetDataStream { - AZ_Warning(s_scriptCanvasBuilder, false, AZStd::string::format("File failed to read completely: %s", fullPath.data()).c_str()); - return; + AZ::IO::FileIOStream ioStream; + if (!ioStream.Open(fullPath.data(), AZ::IO::OpenMode::ModeRead)) + { + 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()) + { + AZ_Warning(s_scriptCanvasBuilder, false, AZStd::string::format("File failed to read completely: %s", fullPath.data()).c_str()); + return; + } + + assetDataStream->Open(AZStd::move(fileBuffer)); } - assetDataStream->Open(AZStd::move(fileBuffer)); - } + m_processEditorAssetDependencies.clear(); - m_processEditorAssetDependencies.clear(); + asset.Create(AZ::Data::AssetId(AZ::Uuid::CreateRandom())); + if (m_editorAssetHandler->LoadAssetDataFromStream(asset, assetDataStream, {}) != AZ::Data::AssetHandler::LoadResult::LoadComplete) + { + AZ_Warning(s_scriptCanvasBuilder, false, "CreateJobs for \"%s\" failed because the asset data could not be loaded from the file", fullPath.data()); + return; + } - AZ::Data::Asset asset; - asset.Create(AZ::Data::AssetId(AZ::Uuid::CreateRandom())); - if (m_editorAssetHandler->LoadAssetDataFromStream(asset, assetDataStream, {}) != AZ::Data::AssetHandler::LoadResult::LoadComplete) - { - AZ_Warning(s_scriptCanvasBuilder, false, "CreateJobs for \"%s\" failed because the asset data could not be loaded from the file", fullPath.data()); - return; + sourceGraph = AZ::EntityUtils::FindFirstDerivedComponent(asset.Get()->GetScriptCanvasEntity()); + graphData = sourceGraph->GetGraphDataConst(); } +#endif - auto* scriptCanvasEntity = asset.Get()->GetScriptCanvasEntity(); - auto* sourceGraph = AZ::EntityUtils::FindFirstDerivedComponent(scriptCanvasEntity); AZ_Assert(sourceGraph, "Graph component is missing from entity."); - AZ_Assert(sourceGraph->GetGraphData(), "GraphData is missing from entity"); + AZ_Assert(graphData, "GraphData is missing from entity"); struct EntityIdComparer { @@ -102,7 +123,7 @@ namespace ScriptCanvasBuilder return lhsEntityId < rhsEntityId; } }; - const AZStd::set sortedEntities(sourceGraph->GetGraphData()->m_nodes.begin(), sourceGraph->GetGraphData()->m_nodes.end()); + const AZStd::set sortedEntities(graphData->m_nodes.begin(), graphData->m_nodes.end()); size_t fingerprint = 0; for (const auto& nodeEntity : sortedEntities) @@ -155,7 +176,7 @@ namespace ScriptCanvasBuilder }; AZ_Verify(serializeContext->EnumerateInstanceConst - ( sourceGraph->GetGraphData() + ( graphData , azrtti_typeid() , assetFilter , {} @@ -168,17 +189,6 @@ namespace ScriptCanvasBuilder for (const AssetBuilderSDK::PlatformInfo& info : request.m_enabledPlatforms) { - if (info.HasTag("tools")) - { - AssetBuilderSDK::JobDescriptor copyDescriptor; - copyDescriptor.m_priority = 2; - copyDescriptor.m_critical = true; - copyDescriptor.m_jobKey = s_scriptCanvasCopyJobKey; - copyDescriptor.SetPlatformIdentifier(info.m_identifier.c_str()); - copyDescriptor.m_additionalFingerprintInfo = AZStd::string(GetFingerprintString()).append("|").append(AZStd::to_string(static_cast(fingerprint))); - response.m_createJobOutputs.push_back(copyDescriptor); - } - AssetBuilderSDK::JobDescriptor jobDescriptor; jobDescriptor.m_priority = 2; jobDescriptor.m_critical = true; @@ -299,23 +309,9 @@ namespace ScriptCanvasBuilder AzFramework::StringFunc::Path::Join(request.m_tempDirPath.c_str(), fileNameOnly.c_str(), runtimeScriptCanvasOutputPath, true, true); AzFramework::StringFunc::Path::ReplaceExtension(runtimeScriptCanvasOutputPath, ScriptCanvas::RuntimeAsset::GetFileExtension()); - if (request.m_jobDescription.m_jobKey == s_scriptCanvasCopyJobKey) - { - // ScriptCanvas Editor Asset Copy job - // The SubID is zero as this represents the main asset - AssetBuilderSDK::JobProduct jobProduct; - jobProduct.m_productFileName = fullPath; - jobProduct.m_productAssetType = azrtti_typeid(); - jobProduct.m_productSubID = 0; - jobProduct.m_dependenciesHandled = true; - jobProduct.m_dependencies.clear(); - response.m_outputProducts.push_back(AZStd::move(jobProduct)); - response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success; - } - else + if (request.m_jobDescription.m_jobKey == s_scriptCanvasProcessJobKey) { AZ::Entity* buildEntity = asset.Get()->GetScriptCanvasEntity(); - ProcessTranslationJobInput input; input.assetID = AZ::Data::AssetId(request.m_sourceFileUUID, AZ_CRC("RuntimeData", 0x163310ae)); input.request = &request; diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h index 668e1a0bcd..84c9285362 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h @@ -42,7 +42,6 @@ namespace ScriptCanvasEditor namespace ScriptCanvasBuilder { constexpr const char* s_scriptCanvasBuilder = "ScriptCanvasBuilder"; - constexpr const char* s_scriptCanvasCopyJobKey = "Script Canvas Copy Job"; constexpr const char* s_scriptCanvasProcessJobKey = "Script Canvas Process Job"; constexpr const char* s_unitTestParseErrorPrefix = "LY_SC_UnitTest"; @@ -59,6 +58,10 @@ namespace ScriptCanvasBuilder PrefabIntegration, CorrectGraphVariableVersion, ReflectEntityIdNodes, + + ForceBuildForDevTest0, + ForceBuildForDevTest1, + // add new entries above Current, }; diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHandler.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHandler.cpp index dea63ab852..bac1f770cb 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHandler.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHandler.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -93,49 +94,6 @@ namespace ScriptCanvasEditor } } - AZ::Outcome LoadScriptCanvasDataFromJson - ( ScriptCanvas::ScriptCanvasData& dataTarget - , AZStd::string_view source - , AZ::SerializeContext& serializeContext) - { - namespace JSRU = AZ::JsonSerializationUtils; - using namespace ScriptCanvas; - - AZ::JsonDeserializerSettings settings; - settings.m_serializeContext = &serializeContext; - settings.m_metadata.Create(); - - auto loadResult = JSRU::LoadObjectFromStringByType - ( &dataTarget - , azrtti_typeid() - , source - , &settings); - - if (!loadResult.IsSuccess()) - { - return loadResult; - } - - if (auto graphData = dataTarget.ModGraph()) - { - auto listeners = settings.m_metadata.Find(); - AZ_Assert(listeners, "Failed to find SerializationListeners"); - - ScriptCanvasAssetHandlerCpp::CollectNodes(graphData->GetGraphData()->m_nodes, *listeners); - - for (auto listener : *listeners) - { - listener->OnDeserialize(); - } - } - else - { - return AZ::Failure(AZStd::string("Failed to find graph data after loading source")); - } - - return AZ::Success(); - } - AZ::Data::AssetHandler::LoadResult ScriptCanvasAssetHandler::LoadAssetData ( const AZ::Data::Asset& assetTarget , AZStd::shared_ptr streamSource @@ -167,7 +125,7 @@ namespace ScriptCanvasEditor settings.m_serializeContext = m_serializeContext; settings.m_metadata.Create(); // attempt JSON deserialization... - auto jsonResult = LoadScriptCanvasDataFromJson + auto jsonResult = LoadDataFromJson ( scriptCanvasDataTarget , AZStd::string_view{ byteBuffer.begin(), byteBuffer.size() } , *m_serializeContext); diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp new file mode 100644 index 0000000000..c21f01bb88 --- /dev/null +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp @@ -0,0 +1,129 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace ScriptCanvasFileHandlingCpp +{ + using namespace ScriptCanvas; + + void CollectNodes(const GraphData::NodeContainer& container, SerializationListeners& listeners) + { + for (auto& nodeEntity : container) + { + if (nodeEntity) + { + if (auto listener = azrtti_cast(AZ::EntityUtils::FindFirstDerivedComponent(nodeEntity))) + { + listeners.push_back(listener); + } + } + } + } +} + +namespace ScriptCanvasEditor +{ + AZ::Outcome LoadDataFromJson + ( ScriptCanvas::ScriptCanvasData& dataTarget + , AZStd::string_view source + , AZ::SerializeContext& serializeContext) + { + namespace JSRU = AZ::JsonSerializationUtils; + using namespace ScriptCanvas; + + AZ::JsonDeserializerSettings settings; + settings.m_serializeContext = &serializeContext; + settings.m_metadata.Create(); + + auto loadResult = JSRU::LoadObjectFromStringByType + ( &dataTarget + , azrtti_typeid() + , source + , &settings); + + if (!loadResult.IsSuccess()) + { + return loadResult; + } + + if (auto graphData = dataTarget.ModGraph()) + { + auto listeners = settings.m_metadata.Find(); + AZ_Assert(listeners, "Failed to find SerializationListeners"); + + ScriptCanvasFileHandlingCpp::CollectNodes(graphData->GetGraphData()->m_nodes, *listeners); + + for (auto listener : *listeners) + { + listener->OnDeserialize(); + } + } + else + { + return AZ::Failure(AZStd::string("Failed to find graph data after loading source")); + } + + return AZ::Success(); + } + + AZ::Outcome LoadFromFile(AZStd::string_view path) + { + namespace JSRU = AZ::JsonSerializationUtils; + using namespace ScriptCanvas; + + auto fileStringOutcome = AZ::Utils::ReadFile(path); + if (!fileStringOutcome) + { + return AZ::Failure(fileStringOutcome.TakeError()); + } + + const auto& asString = fileStringOutcome.GetValue(); + DataPtr scriptCanvasData = Graph::Create(); + + AZ::SerializeContext* serializeContext = nullptr; + AZ::ComponentApplicationBus::BroadcastResult(serializeContext, &AZ::ComponentApplicationRequests::GetSerializeContext); + if (!serializeContext) + { + return AZ::Failure(AZStd::string("no serialize context available to properly parse source file")); + } + + // attempt JSON deserialization... + auto jsonResult = LoadDataFromJson(*scriptCanvasData, AZStd::string_view{ asString.begin(), asString.size() }, *serializeContext); + if (!jsonResult.IsSuccess()) + { + // ...try legacy xml as a failsafe + AZ::IO::ByteContainerStream byteStream(&asString); + if (!AZ::Utils::LoadObjectFromStreamInPlace + ( byteStream + , *scriptCanvasData + , serializeContext + , AZ::ObjectStream::FilterDescriptor(nullptr, AZ::ObjectStream::FILTERFLAG_IGNORE_UNKNOWN_CLASSES))) + { + return AZ::Failure(AZStd::string::format("XML and JSON load attempts failed: %s", jsonResult.GetError().c_str())); + } + } + + return AZ::Success(ScriptCanvasEditor::SourceHandle(scriptCanvasData, {}, path)); + } +} diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.h b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.h index 9665e8ec64..d7f6ae87b6 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.h +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.h @@ -172,7 +172,6 @@ namespace ScriptCanvasEditor bool IsSourceInError() const; - void OnSourceAssetFinalized(const AZStd::string& fullPath, AZ::Uuid sourceAssetId); void SavingComplete(const AZStd::string& fullPath, AZ::Uuid sourceAssetId); AZ::Data::AssetId GetSourceUuid() const { return m_sourceUuid; } diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp index 77f791483b..fc2c2ace41 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp @@ -77,6 +77,7 @@ AZ_POP_DISABLE_WARNING #include #include #include +#include #include #include #include @@ -1041,6 +1042,24 @@ namespace ScriptCanvasEditor } } + ScriptCanvas::DataPtr Graph::Create() + { + if (AZ::Entity* entity = aznew AZ::Entity("Script Canvas Graph")) + { + auto graph = entity->CreateComponent(); + graph->SetAssetType(azrtti_typeid()); + entity->CreateComponent(graph->GetScriptCanvasId()); + + if (ScriptCanvas::DataPtr data = AZStd::make_shared()) + { + data->m_scriptCanvasEntity.reset(entity); + return data; + } + } + + return nullptr; + } + bool Graph::CreateConnection(const GraphCanvas::ConnectionId& connectionId, const GraphCanvas::Endpoint& sourcePoint, const GraphCanvas::Endpoint& targetPoint) { if (!sourcePoint.IsValid() || !targetPoint.IsValid()) diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetHandler.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetHandler.h index f29d5aa9cb..a0e00b40fd 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetHandler.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetHandler.h @@ -20,11 +20,6 @@ namespace AZ namespace ScriptCanvasEditor { - AZ::Outcome LoadScriptCanvasDataFromJson - ( ScriptCanvas::ScriptCanvasData& dataTarget - , AZStd::string_view source - , AZ::SerializeContext& serializeContext); - /** * Manages editor Script Canvas graph assets. */ diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.cpp b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.cpp index 6da134ed6a..2b451b0de8 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.cpp @@ -11,13 +11,23 @@ namespace ScriptCanvas { - Graph* ScriptCanvasData::ModGraph() + const Graph* ScriptCanvasData::GetGraph() const { return AZ::EntityUtils::FindFirstDerivedComponent(m_scriptCanvasEntity.get()); } - const Graph* ScriptCanvasData::GetGraph() const + const ScriptCanvasEditor::Graph* ScriptCanvasData::GetEditorGraph() const + { + return AZ::EntityUtils::FindFirstDerivedComponent(m_scriptCanvasEntity.get()); + } + + Graph* ScriptCanvasData::ModGraph() { return AZ::EntityUtils::FindFirstDerivedComponent(m_scriptCanvasEntity.get()); } + + ScriptCanvasEditor::Graph* ScriptCanvasData::ModEditorGraph() + { + return AZ::EntityUtils::FindFirstDerivedComponent(m_scriptCanvasEntity.get()); + } } diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.h index f4b02b56b6..5340f1128a 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.h @@ -28,9 +28,13 @@ namespace ScriptCanvas AZ::Entity* GetScriptCanvasEntity() const { return m_scriptCanvasEntity.get(); } + const Graph* GetGraph() const; + + const ScriptCanvasEditor::Graph* GetEditorGraph() const; + Graph* ModGraph(); - const Graph* GetGraph() const; + ScriptCanvasEditor::Graph* ModEditorGraph(); AZStd::unique_ptr m_scriptCanvasEntity; private: diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h new file mode 100644 index 0000000000..154ff5f2b0 --- /dev/null +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include +#include +#include +#include + +namespace AZ +{ + class SerializeContext; +} + +namespace ScriptCanvas +{ + class ScriptCanvasData; +} + +namespace ScriptCanvasEditor +{ + AZ::Outcome LoadFromFile(AZStd::string_view path); + + AZ::Outcome LoadDataFromJson + ( ScriptCanvas::ScriptCanvasData& dataTarget + , AZStd::string_view source + , AZ::SerializeContext& serializeContext); + } diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.cpp b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.cpp new file mode 100644 index 0000000000..e6ed773e83 --- /dev/null +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.cpp @@ -0,0 +1,61 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include + +namespace ScriptCanvasEditor +{ + SourceHandle::SourceHandle(ScriptCanvas::DataPtr graph, const AZ::Uuid& id, AZStd::string_view path) + : m_data(graph) + , m_id(id) + , m_path(path) + {} + + void SourceHandle::Clear() + { + m_data = nullptr; + m_id = AZ::Uuid::CreateNull(); + m_path.clear(); + } + + GraphPtrConst SourceHandle::Get() const + { + return m_data ? m_data->GetEditorGraph() : nullptr; + } + + const AZ::Uuid& SourceHandle::Id() const + { + return m_id; + } + + bool SourceHandle::IsValid() const + { + return *this; + } + + GraphPtr SourceHandle::Mod() const + { + return m_data ? m_data->ModEditorGraph() : nullptr; + } + + SourceHandle::operator bool() const + { + return m_data != nullptr; + } + + bool SourceHandle::operator!() const + { + return m_data == nullptr; + } + + const AZStd::string& SourceHandle::Path() const + { + return m_path; + } +} diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.h new file mode 100644 index 0000000000..045221310a --- /dev/null +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include + +namespace ScriptCanvasEditor +{ + class SourceHandle + { + public: + AZ_TYPE_INFO(SourceHandle, "{65855A98-AE2F-427F-BFC8-69D45265E312}"); + AZ_CLASS_ALLOCATOR(SourceHandle, AZ::SystemAllocator, 0); + + SourceHandle() = default; + + SourceHandle(ScriptCanvas::DataPtr graph, const AZ::Uuid& id, AZStd::string_view path); + + void Clear(); + + GraphPtrConst Get() const; + + const AZ::Uuid& Id() const; + + bool IsValid() const; + + GraphPtr Mod() const; + + operator bool() const; + + bool operator!() const; + + const AZStd::string& Path() const; + + private: + ScriptCanvas::DataPtr m_data; + AZ::Uuid m_id = AZ::Uuid::CreateNull(); + AZStd::string m_path; + }; +} diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h index 8fa7beab2b..dedfdd8d20 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h @@ -126,7 +126,7 @@ namespace ScriptCanvasEditor virtual void DisconnectEndpoints(const AZ::EntityId& /*sceneId*/, const AZStd::vector& /*endpoints*/) {} virtual void PostUndoPoint(ScriptCanvas::ScriptCanvasId) = 0; - virtual void SignalSceneDirty(AZ::Data::AssetId) = 0; + virtual void SignalSceneDirty(SourceHandle) = 0; // Increment the value of the ignore undo point tracker virtual void PushPreventUndoStateUpdate() = 0; diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h index 9913fa838b..1d7ea0afbc 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h @@ -101,6 +101,8 @@ namespace ScriptCanvasEditor public: AZ_COMPONENT(Graph, "{4D755CA9-AB92-462C-B24F-0B3376F19967}", ScriptCanvas::Graph); + static ScriptCanvas::DataPtr Create(); + static void Reflect(AZ::ReflectContext* context); Graph(const ScriptCanvas::ScriptCanvasId& scriptCanvasId = AZ::Entity::MakeId()) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index e61b015aae..f2eeae1c3c 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -135,6 +135,7 @@ #include #include #include +#include #include @@ -235,7 +236,7 @@ namespace ScriptCanvasEditor Widget::GraphTabBar* tabBar = m_mainWindow->m_tabBar; AZStd::vector activeAssets; - AZ::Data::AssetId focusedAssetId = tabBar->FindAssetId(tabBar->currentIndex()); + ScriptCanvasEditor::SourceHandle focusedAssetId = tabBar->FindAssetId(tabBar->currentIndex()); if (m_rememberOpenCanvases) { @@ -243,13 +244,13 @@ namespace ScriptCanvasEditor for (int i = 0; i < tabBar->count(); ++i) { - AZ::Data::AssetId assetId = tabBar->FindAssetId(i); + ScriptCanvasEditor::SourceHandle assetId = tabBar->FindAssetId(i); const Tracker::ScriptCanvasFileState& fileState = m_mainWindow->GetAssetFileState(assetId); if (fileState == Tracker::ScriptCanvasFileState::MODIFIED || fileState == Tracker::ScriptCanvasFileState::UNMODIFIED) { - AZ::Data::AssetId sourceId = GetSourceAssetId(assetId); + ScriptCanvasEditor::SourceHandle sourceId = GetSourceAssetId(assetId); if (sourceId.IsValid()) { EditorSettings::EditorWorkspace::WorkspaceAssetSaveData assetSaveData; @@ -316,7 +317,7 @@ namespace ScriptCanvasEditor if (m_loadingAssets.empty()) { - m_mainWindow->OnWorkspaceRestoreEnd(AZ::Data::AssetId()); + m_mainWindow->OnWorkspaceRestoreEnd(ScriptCanvasEditor::SourceHandle()); } else { @@ -336,7 +337,7 @@ namespace ScriptCanvasEditor { if (assetSaveData.m_assetId == m_queuedAssetFocus) { - m_queuedAssetFocus = AZ::Data::AssetId(); + m_queuedAssetFocus = ScriptCanvasEditor::SourceHandle(); } SignalAssetComplete(asset.GetFileAssetId()); @@ -350,7 +351,7 @@ namespace ScriptCanvasEditor { if (assetSaveData.m_assetId == m_queuedAssetFocus) { - m_queuedAssetFocus = AZ::Data::AssetId(); + m_queuedAssetFocus = ScriptCanvasEditor::SourceHandle(); } SignalAssetComplete(assetSaveData.m_assetId); @@ -359,14 +360,14 @@ namespace ScriptCanvasEditor } else { - m_mainWindow->OnWorkspaceRestoreEnd(AZ::Data::AssetId()); + m_mainWindow->OnWorkspaceRestoreEnd(ScriptCanvasEditor::SourceHandle()); } } } void Workspace::OnAssetReady(const ScriptCanvasMemoryAsset::pointer memoryAsset) { - const AZ::Data::AssetId& fileAssetId = memoryAsset->GetFileAssetId(); + const ScriptCanvasEditor::SourceHandle& fileAssetId = memoryAsset->GetFileAssetId(); if (AssetTrackerNotificationBus::MultiHandler::BusIsConnectedId(fileAssetId)) { @@ -378,7 +379,7 @@ namespace ScriptCanvasEditor } } - void Workspace::SignalAssetComplete(const AZ::Data::AssetId& fileAssetId) + void Workspace::SignalAssetComplete(const ScriptCanvasEditor::SourceHandle& fileAssetId) { auto it = AZStd::find(m_loadingAssets.begin(), m_loadingAssets.end(), fileAssetId); if (it != m_loadingAssets.end()) @@ -394,7 +395,7 @@ namespace ScriptCanvasEditor } } - AZ::Data::AssetId Workspace::GetSourceAssetId(const AZ::Data::AssetId& memoryAssetId) const + ScriptCanvasEditor::SourceHandle Workspace::GetSourceAssetId(const ScriptCanvasEditor::SourceHandle& memoryAssetId) const { ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, memoryAssetId); @@ -404,7 +405,7 @@ namespace ScriptCanvasEditor return memoryAsset->GetFileAssetId(); } - return AZ::Data::AssetId(); + return ScriptCanvasEditor::SourceHandle(); } //////////////// @@ -655,9 +656,9 @@ namespace ScriptCanvasEditor QTimer::singleShot(0, [this]() { SetDefaultLayout(); - if (m_activeAssetId.IsValid()) + if (m_activeGraph.IsValid()) { - m_queuedFocusOverride = m_activeAssetId; + m_queuedFocusOverride = m_activeGraph; } m_workspace->Restore(); @@ -831,7 +832,7 @@ namespace ScriptCanvasEditor connect(ui->action_ViewRestoreDefaultLayout, &QAction::triggered, this, &MainWindow::OnRestoreDefaultLayout); } - void MainWindow::SignalActiveSceneChanged(AZ::Data::AssetId assetId) + void MainWindow::SignalActiveSceneChanged(ScriptCanvasEditor::SourceHandle assetId) { ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); @@ -927,7 +928,7 @@ namespace ScriptCanvasEditor for (int tabCounter = 0; tabCounter < m_tabBar->count(); ++tabCounter) { - AZ::Data::AssetId assetId = m_tabBar->FindAssetId(tabCounter); + ScriptCanvasEditor::SourceHandle assetId = m_tabBar->FindAssetId(tabCounter); auto resultIterator = m_processedClosedAssetIds.insert(assetId); if (!resultIterator.second) @@ -950,7 +951,7 @@ namespace ScriptCanvasEditor if (shouldSaveResults == UnsavedChangesOptions::SAVE) { - Callbacks::OnSave saveCB = [this](bool isSuccessful, AZ::Data::AssetPtr, AZ::Data::AssetId) + Callbacks::OnSave saveCB = [this](bool isSuccessful, AZ::Data::AssetPtr, ScriptCanvasEditor::SourceHandle) { if (isSuccessful) { @@ -992,7 +993,7 @@ namespace ScriptCanvasEditor for (auto trackedAsset : allAssets) { - const AZ::Data::AssetId& assetId = trackedAsset->GetAsset().GetId(); + const ScriptCanvasEditor::SourceHandle& assetId = trackedAsset->GetAsset().GetId(); CloseScriptCanvasAsset(assetId); } @@ -1032,7 +1033,7 @@ namespace ScriptCanvasEditor DequeuePropertyGridUpdate(); UndoRequestBus::Event(GetActiveScriptCanvasId(), &UndoRequests::Undo); - SignalSceneDirty(m_activeAssetId); + SignalSceneDirty(m_activeGraph); m_propertyGrid->ClearSelection(); GeneralEditorNotificationBus::Event(GetActiveScriptCanvasId(), &GeneralEditorNotifications::OnUndoRedoEnd); @@ -1044,7 +1045,7 @@ namespace ScriptCanvasEditor DequeuePropertyGridUpdate(); UndoRequestBus::Event(GetActiveScriptCanvasId(), &UndoRequests::Redo); - SignalSceneDirty(m_activeAssetId); + SignalSceneDirty(m_activeGraph); m_propertyGrid->ClearSelection(); GeneralEditorNotificationBus::Event(GetActiveScriptCanvasId(), &GeneralEditorNotifications::OnUndoRedoEnd); @@ -1117,14 +1118,14 @@ namespace ScriptCanvasEditor { ScopedUndoBatch scopedUndoBatch("Modify Graph Canvas Scene"); UndoRequestBus::Event(scriptCanvasId, &UndoRequests::AddGraphItemChangeUndo, "Graph Change"); - MarkAssetModified(m_activeAssetId); + MarkAssetModified(m_activeGraph); } const bool forceTimer = true; RestartAutoTimerSave(forceTimer); } - void MainWindow::SignalSceneDirty(AZ::Data::AssetId assetId) + void MainWindow::SignalSceneDirty(ScriptCanvasEditor::SourceHandle assetId) { MarkAssetModified(assetId); } @@ -1147,7 +1148,7 @@ namespace ScriptCanvasEditor m_preventUndoStateUpdateCount = 0; } - void MainWindow::MarkAssetModified(const AZ::Data::AssetId& assetId) + void MainWindow::MarkAssetModified(const ScriptCanvasEditor::SourceHandle& assetId) { if (!assetId.IsValid()) { @@ -1200,7 +1201,7 @@ namespace ScriptCanvasEditor } } - AZ::Outcome MainWindow::OpenScriptCanvasAssetId(const AZ::Data::AssetId& fileAssetId) + AZ::Outcome MainWindow::OpenScriptCanvasAssetId(const ScriptCanvasEditor::SourceHandle& fileAssetId) { if (!fileAssetId.IsValid()) { @@ -1264,7 +1265,7 @@ namespace ScriptCanvasEditor AZ::Outcome MainWindow::OpenScriptCanvasAsset(const ScriptCanvasMemoryAsset& scriptCanvasAsset, int tabIndex /*= -1*/) { - const AZ::Data::AssetId& fileAssetId = scriptCanvasAsset.GetFileAssetId(); + const ScriptCanvasEditor::SourceHandle& fileAssetId = scriptCanvasAsset.GetFileAssetId(); if (!fileAssetId.IsValid()) { return AZ::Failure(AZStd::string("Unable to open asset with invalid asset id")); @@ -1337,7 +1338,7 @@ namespace ScriptCanvasEditor return AZ::Success(outTabIndex); } - AZ::Outcome MainWindow::OpenScriptCanvasAsset(AZ::Data::AssetId scriptCanvasAssetId, int tabIndex /*= -1*/) + AZ::Outcome MainWindow::OpenScriptCanvasAsset(ScriptCanvasEditor::SourceHandle scriptCanvasAssetId, int tabIndex /*= -1*/) { ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, scriptCanvasAssetId); @@ -1353,7 +1354,7 @@ namespace ScriptCanvasEditor } } - int MainWindow::CreateAssetTab(const AZ::Data::AssetId& assetId, int tabIndex) + int MainWindow::CreateAssetTab(const ScriptCanvasEditor::SourceHandle& assetId, int tabIndex) { return m_tabBar->InsertGraphTab(tabIndex, assetId); } @@ -1378,7 +1379,7 @@ namespace ScriptCanvasEditor return AZ::Success(outTabIndex); } - void MainWindow::RemoveScriptCanvasAsset(const AZ::Data::AssetId& assetId) + void MainWindow::RemoveScriptCanvasAsset(const ScriptCanvasEditor::SourceHandle& assetId) { AssetHelpers::PrintInfo("RemoveScriptCanvasAsset : %s", AssetHelpers::AssetIdToString(assetId).c_str()); @@ -1404,13 +1405,13 @@ namespace ScriptCanvasEditor QVariant tabdata = m_tabBar->tabData(tabIndex); if (tabdata.isValid()) { - auto tabAssetId = tabdata.value(); + auto tabAssetId = tabdata.value(); SetActiveAsset(tabAssetId); } } - int MainWindow::CloseScriptCanvasAsset(const AZ::Data::AssetId& assetId) + int MainWindow::CloseScriptCanvasAsset(const ScriptCanvasEditor::SourceHandle& assetId) { int tabIndex = -1; if (IsTabOpen(assetId, tabIndex)) @@ -1431,26 +1432,26 @@ namespace ScriptCanvasEditor } } - AZ::Data::AssetId previousAssetId = m_activeAssetId; + ScriptCanvasEditor::SourceHandle previousAssetId = m_activeGraph; OnFileNew(); - bool createdNewAsset = m_activeAssetId != previousAssetId; + bool createdNewAsset = m_activeGraph != previousAssetId; if (createdNewAsset) { - m_assetCreationRequests[m_activeAssetId] = requestingEntityId; + m_assetCreationRequests[m_activeGraph] = requestingEntityId; } if (m_isRestoringWorkspace) { - m_queuedFocusOverride = m_activeAssetId; + m_queuedFocusOverride = m_activeGraph; } return createdNewAsset; } - bool MainWindow::IsScriptCanvasAssetOpen(const AZ::Data::AssetId& assetId) const + bool MainWindow::IsScriptCanvasAssetOpen(const ScriptCanvasEditor::SourceHandle& assetId) const { ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); @@ -1468,7 +1469,7 @@ namespace ScriptCanvasEditor return m_nodePaletteModel.FindNodePaletteInformation(nodeType); } - void MainWindow::GetSuggestedFullFilenameToSaveAs(const AZ::Data::AssetId& assetId, AZStd::string& filePath, AZStd::string& fileFilter) + void MainWindow::GetSuggestedFullFilenameToSaveAs(const ScriptCanvasEditor::SourceHandle& assetId, AZStd::string& filePath, AZStd::string& fileFilter) { ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); @@ -1514,6 +1515,21 @@ namespace ScriptCanvasEditor void MainWindow::OpenFile(const char* fullPath) { + AZ::Outcome outcome = LoadFromFile(fullPath); + + if (!outcome.IsSuccess()) + { + m_errorFilePath = fullPath; + AZ_Warning("ScriptCanvas", false, "Unable to open file as a ScriptCanvas graph: %s", fullPath); + } + else + { + m_errorFilePath.clear(); + m_activeGraph = outcome.TakeValue(); + return; + } + +#if defined(EDITOR_ASSET_SUPPORT_ENABLED) m_errorFilePath = fullPath; // Let's find the source file on disk @@ -1566,6 +1582,7 @@ namespace ScriptCanvasEditor { QMessageBox::warning(this, "Invalid Source Asset", QString("'%1' is not a valid asset path.").arg(fullPath), QMessageBox::Ok); } +#endif } GraphCanvas::Endpoint MainWindow::HandleProposedConnection(const GraphCanvas::GraphId&, const GraphCanvas::ConnectionId&, const GraphCanvas::Endpoint& endpoint, const GraphCanvas::NodeId& nodeId, const QPoint& screenPoint) @@ -1676,7 +1693,7 @@ namespace ScriptCanvasEditor MakeNewFile(); } - int MainWindow::InsertTabForAsset(AZStd::string_view assetPath, AZ::Data::AssetId assetId, int tabIndex) + int MainWindow::InsertTabForAsset(AZStd::string_view assetPath, ScriptCanvasEditor::SourceHandle assetId, int tabIndex) { int outTabIndex = -1; @@ -1698,7 +1715,7 @@ namespace ScriptCanvasEditor return outTabIndex; } - void MainWindow::UpdateUndoCache(AZ::Data::AssetId) + void MainWindow::UpdateUndoCache(ScriptCanvasEditor::SourceHandle) { UndoCache* undoCache = nullptr; UndoRequestBus::EventResult(undoCache, GetActiveScriptCanvasId(), &UndoRequests::GetSceneUndoCache); @@ -1712,10 +1729,10 @@ namespace ScriptCanvasEditor { int outTabIndex = -1; - AZ::Data::AssetId newAssetId; + ScriptCanvasEditor::SourceHandle newAssetId; auto onAssetCreated = [this, assetPath, tabIndex, &outTabIndex](ScriptCanvasMemoryAsset& asset) { - const AZ::Data::AssetId& assetId = asset.GetId(); + const ScriptCanvasEditor::SourceHandle& assetId = asset.GetId(); outTabIndex = InsertTabForAsset(assetPath, assetId, tabIndex); @@ -1737,15 +1754,15 @@ namespace ScriptCanvasEditor bool MainWindow::OnFileSave(const Callbacks::OnSave& saveCB) { - return SaveAssetImpl(m_activeAssetId, saveCB); + return SaveAssetImpl(m_activeGraph, saveCB); } bool MainWindow::OnFileSaveAs(const Callbacks::OnSave& saveCB) { - return SaveAssetAsImpl(m_activeAssetId, saveCB); + return SaveAssetAsImpl(m_activeGraph, saveCB); } - bool MainWindow::SaveAssetImpl(const AZ::Data::AssetId& assetId, const Callbacks::OnSave& saveCB) + bool MainWindow::SaveAssetImpl(const ScriptCanvasEditor::SourceHandle& assetId, const Callbacks::OnSave& saveCB) { if (!assetId.IsValid()) { @@ -1772,14 +1789,14 @@ namespace ScriptCanvasEditor return saveSuccessful; } - bool MainWindow::SaveAssetAsImpl(const AZ::Data::AssetId& inMemoryAssetId, const Callbacks::OnSave& saveCB) + bool MainWindow::SaveAssetAsImpl(const ScriptCanvasEditor::SourceHandle& inMemoryAssetId, const Callbacks::OnSave& saveCB) { if (!inMemoryAssetId.IsValid()) { return false; } - if (m_activeAssetId != inMemoryAssetId) + if (m_activeGraph != inMemoryAssetId) { OnChangeActiveGraphTab(inMemoryAssetId); } @@ -1858,7 +1875,7 @@ namespace ScriptCanvasEditor return false; } - void MainWindow::OnSaveCallback(bool saveSuccess, AZ::Data::AssetPtr fileAsset, AZ::Data::AssetId previousFileAssetId) + void MainWindow::OnSaveCallback(bool saveSuccess, AZ::Data::AssetPtr fileAsset, ScriptCanvasEditor::SourceHandle previousFileAssetId) { ScriptCanvasMemoryAsset::pointer memoryAsset; AZStd::string tabName = m_tabBar->tabText(m_tabBar->currentIndex()).toUtf8().data(); @@ -1871,7 +1888,7 @@ namespace ScriptCanvasEditor AZ_Assert(memoryAsset, "At this point we must have a MemoryAsset"); // Update the editor with the new information about this asset. - const AZ::Data::AssetId& fileAssetId = memoryAsset->GetFileAssetId(); + const ScriptCanvasEditor::SourceHandle& fileAssetId = memoryAsset->GetFileAssetId(); saveTabIndex = m_tabBar->FindTab(fileAssetId); @@ -1879,7 +1896,7 @@ namespace ScriptCanvasEditor if (saveTabIndex != m_tabBar->currentIndex()) { // Invalidate the file asset id so we don't delete trigger the asset flow. - m_tabBar->setTabData(saveTabIndex, QVariant::fromValue(AZ::Data::AssetId())); + m_tabBar->setTabData(saveTabIndex, QVariant::fromValue(ScriptCanvasEditor::SourceHandle())); m_tabBar->CloseTab(saveTabIndex); saveTabIndex = -1; @@ -1935,12 +1952,12 @@ namespace ScriptCanvasEditor } // Soft switch the asset id here. We'll do a double scene switch down below to actually switch the active assetid - m_activeAssetId = fileAssetId; + m_activeGraph = fileAssetId; } else { // Use the previous memory asset to find what we had setup as our display - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeAssetId); + AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeGraph); // Drop off our file modifier status for our display name when we fail to save. if (tabName.at(tabName.size() -1) == '*') @@ -1956,9 +1973,9 @@ namespace ScriptCanvasEditor else { // Something weird happens with our saving. Where we are relying on these scene changes being called. - AZ::Data::AssetId previousAssetId = m_activeAssetId; + ScriptCanvasEditor::SourceHandle previousAssetId = m_activeGraph; - OnChangeActiveGraphTab(AZ::Data::AssetId()); + OnChangeActiveGraphTab(ScriptCanvasEditor::SourceHandle()); OnChangeActiveGraphTab(previousAssetId); } @@ -1984,17 +2001,17 @@ namespace ScriptCanvasEditor UnblockCloseRequests(); } - bool MainWindow::ActivateAndSaveAsset(const AZ::Data::AssetId& unsavedAssetId, const Callbacks::OnSave& saveCB) + bool MainWindow::ActivateAndSaveAsset(const ScriptCanvasEditor::SourceHandle& unsavedAssetId, const Callbacks::OnSave& saveCB) { SetActiveAsset(unsavedAssetId); return OnFileSave(saveCB); } - void MainWindow::SaveAsset(AZ::Data::AssetId assetId, const Callbacks::OnSave& onSave) + void MainWindow::SaveAsset(ScriptCanvasEditor::SourceHandle assetId, const Callbacks::OnSave& onSave) { PrepareAssetForSave(assetId); - auto onSaveCallback = [this, onSave](bool saveSuccess, AZ::Data::AssetPtr asset, AZ::Data::AssetId previousAssetId) + auto onSaveCallback = [this, onSave](bool saveSuccess, AZ::Data::AssetPtr asset, ScriptCanvasEditor::SourceHandle previousAssetId) { OnSaveCallback(saveSuccess, asset, previousAssetId); if (onSave) @@ -2007,7 +2024,7 @@ namespace ScriptCanvasEditor UpdateSaveState(); ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeAssetId); + AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeGraph); // Disable the current view if we are saving. if (memoryAsset) @@ -2018,11 +2035,11 @@ namespace ScriptCanvasEditor BlockCloseRequests(); } - void MainWindow::SaveNewAsset(AZStd::string_view path, AZ::Data::AssetId inMemoryAssetId, const Callbacks::OnSave& onSave) + void MainWindow::SaveNewAsset(AZStd::string_view path, ScriptCanvasEditor::SourceHandle inMemoryAssetId, const Callbacks::OnSave& onSave) { PrepareAssetForSave(inMemoryAssetId); - auto onSaveCallback = [this, onSave](bool saveSuccess, AZ::Data::AssetPtr asset, AZ::Data::AssetId previousAssetId) + auto onSaveCallback = [this, onSave](bool saveSuccess, AZ::Data::AssetPtr asset, ScriptCanvasEditor::SourceHandle previousAssetId) { OnSaveCallback(saveSuccess, asset, previousAssetId); if (onSave) @@ -2052,7 +2069,7 @@ namespace ScriptCanvasEditor EBUS_EVENT_RESULT(serializeContext, AZ::ComponentApplicationBus, GetSerializeContext); AZ_Assert(serializeContext, "Failed to acquire application serialize context."); - AZ::Data::AssetId openId = ReadRecentAssetId(); + ScriptCanvasEditor::SourceHandle openId = ReadRecentAssetId(); AZStd::string assetRoot; { @@ -2456,7 +2473,7 @@ namespace ScriptCanvasEditor void MainWindow::UpdateWorkspaceStatus(const ScriptCanvasMemoryAsset& memoryAsset) { - AZ::Data::AssetId fileAssetId = memoryAsset.GetFileAssetId(); + ScriptCanvasEditor::SourceHandle fileAssetId = memoryAsset.GetFileAssetId(); size_t eraseCount = m_loadingAssets.erase(fileAssetId); @@ -2519,7 +2536,7 @@ namespace ScriptCanvasEditor { if (m_allowAutoSave) { - const Tracker::ScriptCanvasFileState& fileState = GetAssetFileState(m_activeAssetId); + const Tracker::ScriptCanvasFileState& fileState = GetAssetFileState(m_activeGraph); if (fileState != Tracker::ScriptCanvasFileState::INVALID && fileState != Tracker::ScriptCanvasFileState::NEW) { OnFileSaveCaller(); @@ -2528,7 +2545,7 @@ namespace ScriptCanvasEditor } //! GeneralRequestBus - void MainWindow::OnChangeActiveGraphTab(AZ::Data::AssetId assetId) + void MainWindow::OnChangeActiveGraphTab(ScriptCanvasEditor::SourceHandle assetId) { SetActiveAsset(assetId); } @@ -2536,14 +2553,14 @@ namespace ScriptCanvasEditor AZ::EntityId MainWindow::GetActiveGraphCanvasGraphId() const { AZ::EntityId graphId; - AssetTrackerRequestBus::BroadcastResult(graphId, &AssetTrackerRequests::GetGraphId, m_activeAssetId); + AssetTrackerRequestBus::BroadcastResult(graphId, &AssetTrackerRequests::GetGraphId, m_activeGraph); return graphId; } ScriptCanvas::ScriptCanvasId MainWindow::GetActiveScriptCanvasId() const { ScriptCanvas::ScriptCanvasId sceneId; - AssetTrackerRequestBus::BroadcastResult(sceneId, &AssetTrackerRequests::GetScriptCanvasId, m_activeAssetId); + AssetTrackerRequestBus::BroadcastResult(sceneId, &AssetTrackerRequests::GetScriptCanvasId, m_activeGraph); return sceneId; } @@ -2555,14 +2572,14 @@ namespace ScriptCanvasEditor return graphCanvasId; } - GraphCanvas::GraphId MainWindow::FindGraphCanvasGraphIdByAssetId(const AZ::Data::AssetId& assetId) const + GraphCanvas::GraphId MainWindow::FindGraphCanvasGraphIdByAssetId(const ScriptCanvasEditor::SourceHandle& assetId) const { AZ::EntityId graphId; AssetTrackerRequestBus::BroadcastResult(graphId, &AssetTrackerRequests::GetGraphId, assetId); return graphId; } - ScriptCanvas::ScriptCanvasId MainWindow::FindScriptCanvasIdByAssetId(const AZ::Data::AssetId& assetId) const + ScriptCanvas::ScriptCanvasId MainWindow::FindScriptCanvasIdByAssetId(const ScriptCanvasEditor::SourceHandle& assetId) const { ScriptCanvas::ScriptCanvasId scriptCanvasId; AssetTrackerRequestBus::BroadcastResult(scriptCanvasId, &AssetTrackerRequests::GetScriptCanvasId, assetId); @@ -2602,14 +2619,14 @@ namespace ScriptCanvasEditor return isActive; } - QVariant MainWindow::GetTabData(const AZ::Data::AssetId& assetId) + QVariant MainWindow::GetTabData(const ScriptCanvasEditor::SourceHandle& assetId) { for (int tabIndex = 0; tabIndex < m_tabBar->count(); ++tabIndex) { QVariant tabdata = m_tabBar->tabData(tabIndex); if (tabdata.isValid()) { - auto tabAssetId = tabdata.value(); + auto tabAssetId = tabdata.value(); if (tabAssetId == assetId) { return tabdata; @@ -2619,7 +2636,7 @@ namespace ScriptCanvasEditor return QVariant(); } - bool MainWindow::IsTabOpen(const AZ::Data::AssetId& fileAssetId, int& outTabIndex) const + bool MainWindow::IsTabOpen(const ScriptCanvasEditor::SourceHandle& fileAssetId, int& outTabIndex) const { int tabIndex = m_tabBar->FindTab(fileAssetId); if (-1 != tabIndex) @@ -2630,7 +2647,7 @@ namespace ScriptCanvasEditor return false; } - void MainWindow::ReconnectSceneBuses(AZ::Data::AssetId previousAssetId, AZ::Data::AssetId nextAssetId) + void MainWindow::ReconnectSceneBuses(ScriptCanvasEditor::SourceHandle previousAssetId, ScriptCanvasEditor::SourceHandle nextAssetId) { ScriptCanvasMemoryAsset::pointer previousAsset; AssetTrackerRequestBus::BroadcastResult(previousAsset, &AssetTrackerRequests::GetAsset, previousAssetId); @@ -2666,14 +2683,14 @@ namespace ScriptCanvasEditor } - void MainWindow::SetActiveAsset(const AZ::Data::AssetId& fileAssetId) + void MainWindow::SetActiveAsset(const ScriptCanvasEditor::SourceHandle& fileAssetId) { - if (m_activeAssetId == fileAssetId) + if (m_activeGraph == fileAssetId) { return; } - AssetHelpers::PrintInfo("SetActiveAsset : from: %s to %s", AssetHelpers::AssetIdToString(m_activeAssetId).c_str(), AssetHelpers::AssetIdToString(fileAssetId).c_str()); + AssetHelpers::PrintInfo("SetActiveAsset : from: %s to %s", AssetHelpers::AssetIdToString(m_activeGraph).c_str(), AssetHelpers::AssetIdToString(fileAssetId).c_str()); if (fileAssetId.IsValid()) { @@ -2688,10 +2705,10 @@ namespace ScriptCanvasEditor } } - if (m_activeAssetId.IsValid()) + if (m_activeGraph.IsValid()) { ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeAssetId); + AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeGraph); // If we are saving the asset, the Id may have changed from the in-memory to the file asset Id, in that case, // there's no need to hide the view or remove the widget @@ -2704,23 +2721,23 @@ namespace ScriptCanvasEditor if (fileAssetId.IsValid()) { - AZ::Data::AssetId previousAssetId = m_activeAssetId; + ScriptCanvasEditor::SourceHandle previousAssetId = m_activeGraph; - m_activeAssetId = fileAssetId; + m_activeGraph = fileAssetId; RefreshActiveAsset(); - ReconnectSceneBuses(previousAssetId, m_activeAssetId); + ReconnectSceneBuses(previousAssetId, m_activeGraph); } else { - AZ::Data::AssetId previousAssetId = m_activeAssetId; + ScriptCanvasEditor::SourceHandle previousAssetId = m_activeGraph; - m_activeAssetId.SetInvalid(); + m_activeGraph.SetInvalid(); m_emptyCanvas->show(); - ReconnectSceneBuses(previousAssetId, m_activeAssetId); + ReconnectSceneBuses(previousAssetId, m_activeGraph); - SignalActiveSceneChanged(AZ::Data::AssetId()); + SignalActiveSceneChanged(ScriptCanvasEditor::SourceHandle()); } UpdateUndoCache(fileAssetId); @@ -2730,12 +2747,12 @@ namespace ScriptCanvasEditor void MainWindow::RefreshActiveAsset() { - if (m_activeAssetId.IsValid()) + if (m_activeGraph.IsValid()) { - AssetHelpers::PrintInfo("RefreshActiveAsset : m_activeAssetId (%s)", AssetHelpers::AssetIdToString(m_activeAssetId).c_str()); + AssetHelpers::PrintInfo("RefreshActiveAsset : m_activeGraph (%s)", AssetHelpers::AssetIdToString(m_activeGraph).c_str()); ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeAssetId); + AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeGraph); if (memoryAsset) { @@ -2754,7 +2771,7 @@ namespace ScriptCanvasEditor AZ_Assert(view, "Asset should have a view"); if (view) { - AssetHelpers::PrintInfo("RefreshActiveAsset : m_activeAssetId (%s)", AssetHelpers::AssetIdToString(m_activeAssetId).c_str()); + AssetHelpers::PrintInfo("RefreshActiveAsset : m_activeGraph (%s)", AssetHelpers::AssetIdToString(m_activeGraph).c_str()); view->ShowScene(sceneEntityId); m_layout->addWidget(view); @@ -2763,7 +2780,7 @@ namespace ScriptCanvasEditor m_emptyCanvas->hide(); } - SignalActiveSceneChanged(m_activeAssetId); + SignalActiveSceneChanged(m_activeGraph); } } else @@ -2794,7 +2811,7 @@ namespace ScriptCanvasEditor QVariant tabdata = m_tabBar->tabData(index); if (tabdata.isValid()) { - auto fileAssetId = tabdata.value(); + auto fileAssetId = tabdata.value(); Tracker::ScriptCanvasFileState fileState; AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, fileAssetId); @@ -2821,7 +2838,7 @@ namespace ScriptCanvasEditor if (saveDialogResults == UnsavedChangesOptions::SAVE) { - auto saveCB = [this](bool isSuccessful, AZ::Data::AssetPtr asset, AZ::Data::AssetId) + auto saveCB = [this](bool isSuccessful, AZ::Data::AssetPtr asset, ScriptCanvasEditor::SourceHandle) { if (isSuccessful) { @@ -2862,7 +2879,7 @@ namespace ScriptCanvasEditor QVariant tabdata = m_tabBar->tabData(index); if (tabdata.isValid()) { - auto assetId = tabdata.value(); + auto assetId = tabdata.value(); SaveAssetImpl(assetId, nullptr); } @@ -2881,7 +2898,7 @@ namespace ScriptCanvasEditor QVariant tabdata = m_tabBar->tabData(index); if (tabdata.isValid()) { - auto assetId = tabdata.value(); + auto assetId = tabdata.value(); m_isClosingTabs = true; m_skipTabOnClose = assetId; @@ -2897,7 +2914,7 @@ namespace ScriptCanvasEditor { QClipboard* clipBoard = QGuiApplication::clipboard(); - auto assetId = tabdata.value(); + auto assetId = tabdata.value(); ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); @@ -2938,7 +2955,7 @@ namespace ScriptCanvasEditor QVariant tabdata = m_tabBar->tabData(tab); if (tabdata.isValid()) { - auto assetId = tabdata.value(); + auto assetId = tabdata.value(); if (assetId != m_skipTabOnClose) { @@ -2958,9 +2975,9 @@ namespace ScriptCanvasEditor QVariant tabdata = m_tabBar->tabData(index); if (tabdata.isValid()) { - auto tabAssetId = tabdata.value(); + auto tabAssetId = tabdata.value(); - if (tabAssetId == m_activeAssetId) + if (tabAssetId == m_activeGraph) { SetActiveAsset({}); } @@ -3164,7 +3181,7 @@ namespace ScriptCanvasEditor bool hasCopiableSelection = false; bool hasSelection = false; - if (m_activeAssetId.IsValid()) + if (m_activeGraph.IsValid()) { if (graphCanvasGraphId.IsValid()) { @@ -3552,7 +3569,7 @@ namespace ScriptCanvasEditor m_isRestoringWorkspace = true; } - void MainWindow::OnWorkspaceRestoreEnd(AZ::Data::AssetId lastFocusAsset) + void MainWindow::OnWorkspaceRestoreEnd(ScriptCanvasEditor::SourceHandle lastFocusAsset) { if (m_isRestoringWorkspace) { @@ -3568,7 +3585,7 @@ namespace ScriptCanvasEditor SetActiveAsset(lastFocusAsset); } - if (!m_activeAssetId.IsValid()) + if (!m_activeGraph.IsValid()) { if (m_tabBar->count() > 0) { @@ -3591,11 +3608,11 @@ namespace ScriptCanvasEditor void MainWindow::UpdateAssignToSelectionState() { - bool buttonEnabled = m_activeAssetId.IsValid(); + bool buttonEnabled = m_activeGraph.IsValid(); if (buttonEnabled) { - const Tracker::ScriptCanvasFileState& fileState = GetAssetFileState(m_activeAssetId); + const Tracker::ScriptCanvasFileState& fileState = GetAssetFileState(m_activeGraph); if (fileState == Tracker::ScriptCanvasFileState::INVALID || fileState == Tracker::ScriptCanvasFileState::NEW || fileState == Tracker::ScriptCanvasFileState::SOURCE_REMOVED) { buttonEnabled = false; @@ -3624,18 +3641,18 @@ namespace ScriptCanvasEditor void MainWindow::UpdateSaveState() { - bool enabled = m_activeAssetId.IsValid(); + bool enabled = m_activeGraph.IsValid(); bool isSaving = false; bool hasModifications = false; if (enabled) { - Tracker::ScriptCanvasFileState fileState = GetAssetFileState(m_activeAssetId); + Tracker::ScriptCanvasFileState fileState = GetAssetFileState(m_activeGraph); hasModifications = ( fileState == Tracker::ScriptCanvasFileState::MODIFIED || fileState == Tracker::ScriptCanvasFileState::NEW || fileState == Tracker::ScriptCanvasFileState::SOURCE_REMOVED); - AssetTrackerRequestBus::BroadcastResult(isSaving, &AssetTrackerRequests::IsSaving, m_activeAssetId); + AssetTrackerRequestBus::BroadcastResult(isSaving, &AssetTrackerRequests::IsSaving, m_activeGraph); } ui->action_Save->setEnabled(enabled && !isSaving && hasModifications); @@ -3837,14 +3854,14 @@ namespace ScriptCanvasEditor return findChild(elementName); } - AZ::EntityId MainWindow::FindEditorNodeIdByAssetNodeId(const AZ::Data::AssetId& assetId, AZ::EntityId assetNodeId) const + AZ::EntityId MainWindow::FindEditorNodeIdByAssetNodeId(const ScriptCanvasEditor::SourceHandle& assetId, AZ::EntityId assetNodeId) const { AZ::EntityId editorEntityId; AssetTrackerRequestBus::BroadcastResult(editorEntityId, &AssetTrackerRequests::GetEditorEntityIdFromSceneEntityId, assetId, assetNodeId); return editorEntityId; } - AZ::EntityId MainWindow::FindAssetNodeIdByEditorNodeId(const AZ::Data::AssetId& assetId, AZ::EntityId editorNodeId) const + AZ::EntityId MainWindow::FindAssetNodeIdByEditorNodeId(const ScriptCanvasEditor::SourceHandle& assetId, AZ::EntityId editorNodeId) const { AZ::EntityId sceneEntityId; AssetTrackerRequestBus::BroadcastResult(sceneEntityId, &AssetTrackerRequests::GetSceneEntityIdFromEditorEntityId, assetId, editorNodeId); @@ -3961,7 +3978,7 @@ namespace ScriptCanvasEditor OnFileNew(); - if (m_activeAssetId.IsValid()) + if (m_activeGraph.IsValid()) { graphId = GetActiveGraphCanvasGraphId(); } @@ -4265,10 +4282,10 @@ namespace ScriptCanvasEditor void MainWindow::PrepareActiveAssetForSave() { - PrepareAssetForSave(m_activeAssetId); + PrepareAssetForSave(m_activeGraph); } - void MainWindow::PrepareAssetForSave(const AZ::Data::AssetId& assetId) + void MainWindow::PrepareAssetForSave(const ScriptCanvasEditor::SourceHandle& assetId) { ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); @@ -4337,7 +4354,7 @@ namespace ScriptCanvasEditor void MainWindow::OnAssignToSelectedEntities() { Tracker::ScriptCanvasFileState fileState; - AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, m_activeAssetId); + AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, m_activeGraph); bool isDocumentOpen = false; AzToolsFramework::EditorRequests::Bus::BroadcastResult(isDocumentOpen, &AzToolsFramework::EditorRequests::IsLevelDocumentOpen); @@ -4398,7 +4415,7 @@ namespace ScriptCanvasEditor void MainWindow::OnAssignToEntity(const AZ::EntityId& entityId) { - Tracker::ScriptCanvasFileState fileState = GetAssetFileState(m_activeAssetId); + Tracker::ScriptCanvasFileState fileState = GetAssetFileState(m_activeGraph); if (fileState == Tracker::ScriptCanvasFileState::MODIFIED || fileState == Tracker::ScriptCanvasFileState::UNMODIFIED) @@ -4407,7 +4424,7 @@ namespace ScriptCanvasEditor } } - ScriptCanvasEditor::Tracker::ScriptCanvasFileState MainWindow::GetAssetFileState(AZ::Data::AssetId assetId) const + ScriptCanvasEditor::Tracker::ScriptCanvasFileState MainWindow::GetAssetFileState(ScriptCanvasEditor::SourceHandle assetId) const { Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::INVALID; AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, assetId); @@ -4460,7 +4477,7 @@ namespace ScriptCanvasEditor if (usableRequestBus) { ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeAssetId); + AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeGraph); if (memoryAsset) { diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h index 7672f0a199..77a85ec448 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h @@ -43,7 +43,7 @@ #include #include #include - +#include #include #include #include @@ -175,9 +175,9 @@ namespace ScriptCanvasEditor private: void OnAssetReady(const ScriptCanvasMemoryAsset::pointer asset) override; - void SignalAssetComplete(const AZ::Data::AssetId& fileAssetId); + void SignalAssetComplete(const ScriptCanvasEditor::SourceHandle& fileAssetId); - AZ::Data::AssetId GetSourceAssetId(const AZ::Data::AssetId& memoryAssetId) const; + ScriptCanvasEditor::SourceHandle GetSourceAssetId(const ScriptCanvasEditor::SourceHandle& memoryAssetId) const; bool m_rememberOpenCanvases; MainWindow* m_mainWindow; @@ -185,10 +185,10 @@ namespace ScriptCanvasEditor //! Setting focus is problematic unless it is done until after all currently loading graphs have finished loading //! This vector is used to track the list of graphs being opened to restore the workspace and as assets are fully //! ready and activated they are removed from this list. - AZStd::vector m_loadingAssets; + AZStd::vector m_loadingAssets; //! During restore we queue the asset Id to focus in order to do it last - AZ::Data::AssetId m_queuedAssetFocus; + ScriptCanvasEditor::SourceHandle m_queuedAssetFocus; }; enum class UnsavedChangesOptions; @@ -269,7 +269,7 @@ namespace ScriptCanvasEditor // Undo Handlers void PostUndoPoint(ScriptCanvas::ScriptCanvasId scriptCanvasId) override; - void SignalSceneDirty(AZ::Data::AssetId assetId) override; + void SignalSceneDirty(ScriptCanvasEditor::SourceHandle assetId) override; void PushPreventUndoStateUpdate() override; void PopPreventUndoStateUpdate() override; @@ -329,8 +329,8 @@ namespace ScriptCanvasEditor bool OnFileSaveAs(const Callbacks::OnSave& saveCB); bool OnFileSaveCaller(){return OnFileSave(nullptr);}; bool OnFileSaveAsCaller(){return OnFileSaveAs(nullptr);}; - bool SaveAssetImpl(const AZ::Data::AssetId& assetId, const Callbacks::OnSave& saveCB); - bool SaveAssetAsImpl(const AZ::Data::AssetId& assetId, const Callbacks::OnSave& saveCB); + bool SaveAssetImpl(const ScriptCanvasEditor::SourceHandle& assetId, const Callbacks::OnSave& saveCB); + bool SaveAssetAsImpl(const ScriptCanvasEditor::SourceHandle& assetId, const Callbacks::OnSave& saveCB); void OnFileOpen(); // Edit menu @@ -415,17 +415,17 @@ namespace ScriptCanvasEditor void CloseNextTab(); - bool IsTabOpen(const AZ::Data::AssetId& assetId, int& outTabIndex) const; - QVariant GetTabData(const AZ::Data::AssetId& assetId); + bool IsTabOpen(const ScriptCanvasEditor::SourceHandle& assetId, int& outTabIndex) const; + QVariant GetTabData(const ScriptCanvasEditor::SourceHandle& assetId); //! GeneralRequestBus - AZ::Outcome OpenScriptCanvasAssetId(const AZ::Data::AssetId& assetId) override; - AZ::Outcome OpenScriptCanvasAsset(AZ::Data::AssetId scriptCanvasAssetId, int tabIndex = -1) override; + AZ::Outcome OpenScriptCanvasAssetId(const ScriptCanvasEditor::SourceHandle& assetId) override; + AZ::Outcome OpenScriptCanvasAsset(ScriptCanvasEditor::SourceHandle scriptCanvasAssetId, int tabIndex = -1) override; AZ::Outcome OpenScriptCanvasAsset(const ScriptCanvasMemoryAsset& scriptCanvasAsset, int tabIndex = -1); - int CloseScriptCanvasAsset(const AZ::Data::AssetId& assetId) override; + int CloseScriptCanvasAsset(const ScriptCanvasEditor::SourceHandle& assetId) override; bool CreateScriptCanvasAssetFor(const TypeDefs::EntityComponentId& requestingEntityId) override; - bool IsScriptCanvasAssetOpen(const AZ::Data::AssetId& assetId) const override; + bool IsScriptCanvasAssetOpen(const ScriptCanvasEditor::SourceHandle& assetId) const override; const CategoryInformation* FindNodePaletteCategoryInformation(AZStd::string_view categoryPath) const override; const NodePaletteModelInformation* FindNodePaletteModelInformation(const ScriptCanvas::NodeTypeIdentifier& nodeType) const override; @@ -437,8 +437,8 @@ namespace ScriptCanvasEditor void RefreshScriptCanvasAsset(const AZ::Data::Asset& scriptCanvasAsset); //! Removes the assetId -> ScriptCanvasAsset mapping and disconnects from the asset tracker - void RemoveScriptCanvasAsset(const AZ::Data::AssetId& assetId); - void OnChangeActiveGraphTab(AZ::Data::AssetId) override; + void RemoveScriptCanvasAsset(const ScriptCanvasEditor::SourceHandle& assetId); + void OnChangeActiveGraphTab(ScriptCanvasEditor::SourceHandle) override; void CreateNewRuntimeAsset() override { OnFileNew(); } @@ -448,8 +448,8 @@ namespace ScriptCanvasEditor GraphCanvas::GraphId GetGraphCanvasGraphId(const ScriptCanvas::ScriptCanvasId& scriptCanvasId) const override; - GraphCanvas::GraphId FindGraphCanvasGraphIdByAssetId(const AZ::Data::AssetId& assetId) const override; - ScriptCanvas::ScriptCanvasId FindScriptCanvasIdByAssetId(const AZ::Data::AssetId& assetId) const override; + GraphCanvas::GraphId FindGraphCanvasGraphIdByAssetId(const ScriptCanvasEditor::SourceHandle& assetId) const override; + ScriptCanvas::ScriptCanvasId FindScriptCanvasIdByAssetId(const ScriptCanvasEditor::SourceHandle& assetId) const override; bool IsInUndoRedo(const AZ::EntityId& graphCanvasGraphId) const override; bool IsScriptCanvasInUndoRedo(const ScriptCanvas::ScriptCanvasId& scriptCanvasId) const override; @@ -517,8 +517,8 @@ namespace ScriptCanvasEditor QObject* FindElementByName(QString elementName) override; //// - AZ::EntityId FindEditorNodeIdByAssetNodeId(const AZ::Data::AssetId& assetId, AZ::EntityId assetNodeId) const override; - AZ::EntityId FindAssetNodeIdByEditorNodeId(const AZ::Data::AssetId& assetId, AZ::EntityId editorNodeId) const override; + AZ::EntityId FindEditorNodeIdByAssetNodeId(const ScriptCanvasEditor::SourceHandle& assetId, AZ::EntityId assetNodeId) const override; + AZ::EntityId FindAssetNodeIdByEditorNodeId(const ScriptCanvasEditor::SourceHandle& assetId, AZ::EntityId editorNodeId) const override; private: void DeleteNodes(const AZ::EntityId& sceneId, const AZStd::vector& nodes) override; @@ -546,26 +546,23 @@ namespace ScriptCanvasEditor //! Helper function which serializes a file to disk //! \param filename name of file to serialize the Entity //! \param asset asset to save - void GetSuggestedFullFilenameToSaveAs(const AZ::Data::AssetId& assetId, AZStd::string& filePath, AZStd::string& fileFilter); + void GetSuggestedFullFilenameToSaveAs(const ScriptCanvasEditor::SourceHandle& assetId, AZStd::string& filePath, AZStd::string& fileFilter); - void MarkAssetModified(const AZ::Data::AssetId& assetId); + void MarkAssetModified(const ScriptCanvasEditor::SourceHandle& assetId); // QMainWindow void closeEvent(QCloseEvent *event) override; UnsavedChangesOptions ShowSaveDialog(const QString& filename); - bool ActivateAndSaveAsset(const AZ::Data::AssetId& unsavedAssetId, const Callbacks::OnSave& onSave); + bool ActivateAndSaveAsset(const ScriptCanvasEditor::SourceHandle& unsavedAssetId, const Callbacks::OnSave& onSave); - void SaveNewAsset(AZStd::string_view path, AZ::Data::AssetId assetId, const Callbacks::OnSave& onSave); - void SaveAsset(AZ::Data::AssetId assetId, const Callbacks::OnSave& onSave); + void SaveNewAsset(AZStd::string_view path, ScriptCanvasEditor::SourceHandle assetId, const Callbacks::OnSave& onSave); + void SaveAsset(ScriptCanvasEditor::SourceHandle assetId, const Callbacks::OnSave& onSave); void OpenFile(const char* fullPath); void CreateMenus(); - void SignalActiveSceneChanged(const AZ::Data::AssetId assetId); - - void SaveWorkspace(bool updateAssetList = true); - void RestoreWorkspace(); + void SignalActiveSceneChanged(const ScriptCanvasEditor::SourceHandle assetId); void RunUpgradeTool(); @@ -593,7 +590,7 @@ namespace ScriptCanvasEditor void UpdateMenuState(bool enabledState); void OnWorkspaceRestoreStart(); - void OnWorkspaceRestoreEnd(AZ::Data::AssetId lastFocusAsset); + void OnWorkspaceRestoreEnd(ScriptCanvasEditor::SourceHandle lastFocusAsset); void UpdateAssignToSelectionState(); void UpdateUndoRedoState(); @@ -604,18 +601,16 @@ namespace ScriptCanvasEditor void CreateFunctionDefinitionNode(int positionOffset); - int CreateAssetTab(const AZ::Data::AssetId& assetId, int tabIndex = -1); + int CreateAssetTab(const ScriptCanvasEditor::SourceHandle& assetId, int tabIndex = -1); //! \param asset The AssetId of the ScriptCanvas Asset. - void SetActiveAsset(const AZ::Data::AssetId& assetId); + void SetActiveAsset(const ScriptCanvasEditor::SourceHandle& assetId); void RefreshActiveAsset(); - void ReconnectSceneBuses(AZ::Data::AssetId previousAssetId, AZ::Data::AssetId nextAssetId); - - void SignalBatchOperationComplete(BatchOperatorTool* batchTool); + void ReconnectSceneBuses(ScriptCanvasEditor::SourceHandle previousAssetId, ScriptCanvasEditor::SourceHandle nextAssetId); void PrepareActiveAssetForSave(); - void PrepareAssetForSave(const AZ::Data::AssetId& asssetId); + void PrepareAssetForSave(const ScriptCanvasEditor::SourceHandle& asssetId); void RestartAutoTimerSave(bool forceTimer = false); @@ -626,9 +621,9 @@ namespace ScriptCanvasEditor void AssignGraphToEntityImpl(const AZ::EntityId& entityId); //// - Tracker::ScriptCanvasFileState GetAssetFileState(AZ::Data::AssetId assetId) const; + Tracker::ScriptCanvasFileState GetAssetFileState(ScriptCanvasEditor::SourceHandle assetId) const; - AZ::Data::AssetId GetSourceAssetId(const AZ::Data::AssetId& memoryAssetId) const + ScriptCanvasEditor::SourceHandle GetSourceAssetId(const ScriptCanvasEditor::SourceHandle& memoryAssetId) const { ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, memoryAssetId); @@ -638,12 +633,12 @@ namespace ScriptCanvasEditor return memoryAsset->GetFileAssetId(); } - return AZ::Data::AssetId(); + return ScriptCanvasEditor::SourceHandle(); } - int InsertTabForAsset(AZStd::string_view assetPath, AZ::Data::AssetId assetId, int tabIndex = -1); + int InsertTabForAsset(AZStd::string_view assetPath, ScriptCanvasEditor::SourceHandle assetId, int tabIndex = -1); - void UpdateUndoCache(AZ::Data::AssetId assetId); + void UpdateUndoCache(ScriptCanvasEditor::SourceHandle assetId); bool HasSystemTickAction(SystemTickActionFlag action); @@ -741,22 +736,22 @@ namespace ScriptCanvasEditor GraphCanvas::GraphCanvasEditorEmptyDockWidget* m_emptyCanvas; // Displayed when there is no open graph QVBoxLayout* m_layout; - AZ::Data::AssetId m_activeAssetId; - + ScriptCanvasEditor::SourceHandle m_activeGraph; + bool m_loadingNewlySavedFile; AZStd::string m_newlySavedFile; AZStd::string m_errorFilePath; bool m_isClosingTabs; - AZ::Data::AssetId m_skipTabOnClose; + ScriptCanvasEditor::SourceHandle m_skipTabOnClose; bool m_enterState; bool m_ignoreSelection; AZ::s32 m_preventUndoStateUpdateCount; bool m_isRestoringWorkspace; - AZ::Data::AssetId m_queuedFocusOverride; + ScriptCanvasEditor::SourceHandle m_queuedFocusOverride; Ui::MainWindow* ui; AZStd::array, c_scriptCanvasEditorSettingsRecentFilesCountMax> m_recentActions; @@ -778,17 +773,17 @@ namespace ScriptCanvasEditor AZStd::vector m_selectedVariableIds; AZ::u32 m_systemTickActions; - AZStd::unordered_set< AZ::Data::AssetId > m_processedClosedAssetIds; + AZStd::unordered_set< ScriptCanvasEditor::SourceHandle > m_processedClosedAssetIds; - AZStd::unordered_set< AZ::Data::AssetId > m_loadingWorkspaceAssets; - AZStd::unordered_set< AZ::Data::AssetId > m_loadingAssets; + AZStd::unordered_set< ScriptCanvasEditor::SourceHandle > m_loadingWorkspaceAssets; + AZStd::unordered_set< ScriptCanvasEditor::SourceHandle > m_loadingAssets; AZStd::unordered_set< AZ::Uuid > m_variablePaletteTypes; AZStd::unordered_map< AZ::Crc32, QObject* > m_automationLookUpMap; bool m_closeCurrentGraphAfterSave; - AZStd::unordered_map< AZ::Data::AssetId, TypeDefs::EntityComponentId > m_assetCreationRequests; + AZStd::unordered_map< ScriptCanvasEditor::SourceHandle, TypeDefs::EntityComponentId > m_assetCreationRequests; ScriptCanvas::Debugger::ClientTransceiver m_clientTRX; GraphCanvas::StyleManager m_styleManager; @@ -797,6 +792,6 @@ namespace ScriptCanvasEditor //! this object manages the Save/Restore operations Workspace* m_workspace; - void OnSaveCallback(bool saveSuccess, AZ::Data::AssetPtr, AZ::Data::AssetId previousFileAssetId); + void OnSaveCallback(bool saveSuccess, AZ::Data::AssetPtr, ScriptCanvasEditor::SourceHandle previousFileAssetId); }; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/ScriptCanvasAssetBase.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/ScriptCanvasAssetBase.h index 265c35d310..1dc0b38e01 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/ScriptCanvasAssetBase.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/ScriptCanvasAssetBase.h @@ -8,16 +8,17 @@ #pragma once +#include #include #include #include - #include namespace ScriptCanvas { class ScriptCanvasAssetBase : public AZ::Data::AssetData + , public AZStd::enable_shared_from_this , ScriptCanvas::ScriptCanvasAssetBusRequestBus::Handler { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h index 0e64c19dcb..85f76280d2 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h @@ -26,6 +26,8 @@ #define OBJECT_STREAM_EDITOR_ASSET_LOADING_SUPPORT_ENABLED +#define EDITOR_ASSET_SUPPORT_ENABLED + namespace AZ { class Entity; @@ -61,6 +63,10 @@ namespace ScriptCanvas class Node; class Edge; + class Graph; + + using GraphPtr = Graph*; + using GraphPtrConst = const Graph*; using ID = AZ::EntityId; @@ -297,6 +303,24 @@ namespace ScriptCanvas void ReflectEventTypeOnDemand(const AZ::TypeId& typeId, AZStd::string_view name, AZ::IRttiHelper* rttiHelper = nullptr); } +namespace ScriptCanvas +{ + class ScriptCanvasData; + + using DataPtr = AZStd::shared_ptr; + using DataPtrConst = AZStd::shared_ptr; +} + +namespace ScriptCanvasEditor +{ + class Graph; + + using GraphPtr = Graph*; + using GraphPtrConst = const Graph*; + + class SourceHandle; +} + namespace AZStd { template<> diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.h index 46e8a103bb..786e693a04 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.h @@ -14,14 +14,12 @@ #include #include #include - #include #include #include #include #include #include - #include namespace ScriptCanvas @@ -209,7 +207,7 @@ namespace ScriptCanvas GraphVariableManagerRequests* m_variableRequests = nullptr; // Keeps a mapping of the Node EntityId -> NodeComponent. - // Saves looking up the NodeComponent everytime we need the Node. + // Saves looking up the NodeComponent every time we need the Node. AZStd::unordered_map m_nodeMapping; bool m_isObserved; diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake index 609f7cd454..49f89d8e48 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake @@ -27,7 +27,11 @@ set(FILES Editor/Assets/ScriptCanvasAsset.cpp Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetBus.h Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetTypes.h + Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h + Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.h + Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.cpp Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetHandler.h + Editor/Assets/ScriptCanvasFileHandling.cpp Editor/Assets/ScriptCanvasAssetHandler.cpp Editor/Assets/ScriptCanvasAssetHolder.h Editor/Assets/ScriptCanvasAssetHolder.cpp From c5cd8541729c63779c934a8c85bfd8008355f79a Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Mon, 18 Oct 2021 11:56:14 -0700 Subject: [PATCH 043/948] Git MainWindow.cpp to point where it compiles, and reveals the radius of changes for everything to work without assets Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Editor/Assets/ScriptCanvasAssetTracker.h | 3 + .../Assets/ScriptCanvasSourceFileHandle.cpp | 52 -- .../Assets/ScriptCanvasSourceFileHandle.h | 37 - .../ScriptCanvas/Bus/EditorScriptCanvasBus.h | 2 - .../Include/ScriptCanvas/Bus/RequestBus.h | 14 +- .../ScriptCanvas/Components/EditorGraph.h | 6 +- Gems/ScriptCanvas/Code/Editor/QtMetaTypes.h | 4 +- Gems/ScriptCanvas/Code/Editor/Settings.h | 13 +- .../Code/Editor/Utilities/RecentAssetPath.cpp | 4 +- .../Code/Editor/Utilities/RecentAssetPath.h | 4 +- .../View/Widgets/AssetGraphSceneDataBus.h | 6 +- .../Code/Editor/View/Widgets/GraphTabBar.h | 14 +- .../Code/Editor/View/Windows/MainWindow.cpp | 746 ++++++++++-------- .../Code/Editor/View/Windows/MainWindow.h | 24 +- .../Code/Include/ScriptCanvas/Core/Core.cpp | 51 ++ .../Code/Include/ScriptCanvas/Core/Core.h | 36 +- 16 files changed, 536 insertions(+), 480 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.h b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.h index 78e85651e1..b55e5c06c8 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.h +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.h @@ -22,6 +22,9 @@ namespace ScriptCanvasEditor { class ScriptCanvasMemoryAsset; + + // MOVE THIS MOSTLY TO TAB BAR, MAIN WINDOW AND THE CANVAS WIDGET + // This class tracks all things related to the assets that the Script Canvas editor // has in play. It also provides helper functionality to quickly getting asset information // from GraphCanvas diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.cpp b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.cpp index e6ed773e83..258a862a19 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.cpp @@ -7,55 +7,3 @@ */ #include -#include - -namespace ScriptCanvasEditor -{ - SourceHandle::SourceHandle(ScriptCanvas::DataPtr graph, const AZ::Uuid& id, AZStd::string_view path) - : m_data(graph) - , m_id(id) - , m_path(path) - {} - - void SourceHandle::Clear() - { - m_data = nullptr; - m_id = AZ::Uuid::CreateNull(); - m_path.clear(); - } - - GraphPtrConst SourceHandle::Get() const - { - return m_data ? m_data->GetEditorGraph() : nullptr; - } - - const AZ::Uuid& SourceHandle::Id() const - { - return m_id; - } - - bool SourceHandle::IsValid() const - { - return *this; - } - - GraphPtr SourceHandle::Mod() const - { - return m_data ? m_data->ModEditorGraph() : nullptr; - } - - SourceHandle::operator bool() const - { - return m_data != nullptr; - } - - bool SourceHandle::operator!() const - { - return m_data == nullptr; - } - - const AZStd::string& SourceHandle::Path() const - { - return m_path; - } -} diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.h index 045221310a..1d14b9b21b 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.h @@ -8,40 +8,3 @@ #pragma once -#include -#include - -namespace ScriptCanvasEditor -{ - class SourceHandle - { - public: - AZ_TYPE_INFO(SourceHandle, "{65855A98-AE2F-427F-BFC8-69D45265E312}"); - AZ_CLASS_ALLOCATOR(SourceHandle, AZ::SystemAllocator, 0); - - SourceHandle() = default; - - SourceHandle(ScriptCanvas::DataPtr graph, const AZ::Uuid& id, AZStd::string_view path); - - void Clear(); - - GraphPtrConst Get() const; - - const AZ::Uuid& Id() const; - - bool IsValid() const; - - GraphPtr Mod() const; - - operator bool() const; - - bool operator!() const; - - const AZStd::string& Path() const; - - private: - ScriptCanvas::DataPtr m_data; - AZ::Uuid m_id = AZ::Uuid::CreateNull(); - AZStd::string m_path; - }; -} diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/EditorScriptCanvasBus.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/EditorScriptCanvasBus.h index 7e7b600081..7c57d661f0 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/EditorScriptCanvasBus.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/EditorScriptCanvasBus.h @@ -121,8 +121,6 @@ namespace ScriptCanvasEditor static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; using BusIdType = ScriptCanvas::ScriptCanvasId; - virtual void SetAssetId(const AZ::Data::AssetId& assetId) = 0; - virtual void CreateGraphCanvasScene() = 0; virtual void ClearGraphCanvasScene() = 0; virtual GraphCanvas::GraphId GetGraphCanvasGraphId() const = 0; diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h index dedfdd8d20..2d9a7d6b58 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h @@ -70,16 +70,16 @@ namespace ScriptCanvasEditor //! Opens an existing graph and returns the tab index in which it was open in. //! \param File AssetId //! \return index of open tab if the asset was able to be open successfully or error message of why the open failed - virtual AZ::Outcome OpenScriptCanvasAsset(AZ::Data::AssetId scriptCanvasAssetId, int tabIndex = -1) = 0; - virtual AZ::Outcome OpenScriptCanvasAssetId(const AZ::Data::AssetId& scriptCanvasAsset) = 0; + virtual AZ::Outcome OpenScriptCanvasAsset(SourceHandle scriptCanvasAssetId, int tabIndex = -1) = 0; + virtual AZ::Outcome OpenScriptCanvasAssetId(const SourceHandle& scriptCanvasAsset) = 0; - virtual int CloseScriptCanvasAsset(const AZ::Data::AssetId&) = 0; + virtual int CloseScriptCanvasAsset(const SourceHandle&) = 0; virtual bool CreateScriptCanvasAssetFor(const TypeDefs::EntityComponentId& requestingComponent) = 0; - virtual bool IsScriptCanvasAssetOpen(const AZ::Data::AssetId& assetId) const = 0; + virtual bool IsScriptCanvasAssetOpen(const SourceHandle& assetId) const = 0; - virtual void OnChangeActiveGraphTab(AZ::Data::AssetId) {} + virtual void OnChangeActiveGraphTab(SourceHandle) {} virtual void CreateNewRuntimeAsset() = 0; @@ -103,12 +103,12 @@ namespace ScriptCanvasEditor return ScriptCanvas::ScriptCanvasId(); } - virtual GraphCanvas::GraphId FindGraphCanvasGraphIdByAssetId([[maybe_unused]] const AZ::Data::AssetId& assetId) const + virtual GraphCanvas::GraphId FindGraphCanvasGraphIdByAssetId([[maybe_unused]] const SourceHandle& assetId) const { return GraphCanvas::GraphId(); } - virtual ScriptCanvas::ScriptCanvasId FindScriptCanvasIdByAssetId([[maybe_unused]] const AZ::Data::AssetId& assetId) const + virtual ScriptCanvas::ScriptCanvasId FindScriptCanvasIdByAssetId([[maybe_unused]] const SourceHandle& assetId) const { return ScriptCanvas::ScriptCanvasId(); } diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h index 1d7ea0afbc..c0c8584cbd 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h @@ -141,7 +141,7 @@ namespace ScriptCanvasEditor //// // RuntimeBus - AZ::Data::AssetId GetAssetId() const override { return m_assetId; } + //AZ::Data::AssetId GetAssetId() const override { return m_assetId; } //// // GraphCanvas::GraphModelRequestBus @@ -224,7 +224,7 @@ namespace ScriptCanvasEditor /////////////////////////// // EditorGraphRequestBus - void SetAssetId(const AZ::Data::AssetId& assetId) override { m_assetId = assetId; } + // void SetAssetId(const AZ::Data::AssetId& assetId) override { m_assetId = assetId; } void CreateGraphCanvasScene() override; void ClearGraphCanvasScene() override; @@ -392,6 +392,6 @@ namespace ScriptCanvasEditor //! Defaults to true to signal that this graph does not have the GraphCanvas stuff intermingled bool m_saveFormatConverted = true; - AZ::Data::AssetId m_assetId; + ScriptCanvasEditor::SourceHandle m_assetId; }; } diff --git a/Gems/ScriptCanvas/Code/Editor/QtMetaTypes.h b/Gems/ScriptCanvas/Code/Editor/QtMetaTypes.h index 9058e27b03..5e413f0266 100644 --- a/Gems/ScriptCanvas/Code/Editor/QtMetaTypes.h +++ b/Gems/ScriptCanvas/Code/Editor/QtMetaTypes.h @@ -11,11 +11,13 @@ AZ_PUSH_DISABLE_WARNING(4251 4800 4244, "-Wunknown-warning-option") #include AZ_POP_DISABLE_WARNING +#include #include #include - // VariableId is a UUID typedef for now. So we don't want to double reflect the UUID. Q_DECLARE_METATYPE(AZ::Uuid); Q_DECLARE_METATYPE(AZ::Data::AssetId); Q_DECLARE_METATYPE(ScriptCanvas::Data::Type); Q_DECLARE_METATYPE(ScriptCanvas::VariableId); +Q_DECLARE_METATYPE(ScriptCanvasEditor::SourceHandle); + diff --git a/Gems/ScriptCanvas/Code/Editor/Settings.h b/Gems/ScriptCanvas/Code/Editor/Settings.h index dee55f8272..8359e2a580 100644 --- a/Gems/ScriptCanvas/Code/Editor/Settings.h +++ b/Gems/ScriptCanvas/Code/Editor/Settings.h @@ -53,11 +53,10 @@ namespace ScriptCanvasEditor AZ_RTTI(WorkspaceAssetSaveData, "{927368CA-096F-4CF1-B2E0-1B9E4A93EA57}"); WorkspaceAssetSaveData(); - WorkspaceAssetSaveData(const AZ::Data::AssetId& assetId); + WorkspaceAssetSaveData(SourceHandle assetId); virtual ~WorkspaceAssetSaveData() = default; - AZ::Data::AssetId m_assetId; - AZ::Data::AssetType m_assetType; + SourceHandle m_assetId; }; @@ -69,9 +68,9 @@ namespace ScriptCanvasEditor EditorWorkspace() = default; - void ConfigureActiveAssets(AZ::Data::AssetId focusedAssetId, const AZStd::vector< WorkspaceAssetSaveData >& activeAssetIds); + void ConfigureActiveAssets(SourceHandle focusedAsset, const AZStd::vector< WorkspaceAssetSaveData >& activeAssetIds); - AZ::Data::AssetId GetFocusedAssetId() const; + SourceHandle GetFocusedAssetId() const; AZStd::vector< WorkspaceAssetSaveData > GetActiveAssetData() const; void Init(const QByteArray& windowState, const QByteArray& windowGeometry); @@ -79,7 +78,7 @@ namespace ScriptCanvasEditor void Clear() { - m_focusedAssetId.SetInvalid(); + m_focusedAssetId.Clear(); m_activeAssetData.clear(); } @@ -91,7 +90,7 @@ namespace ScriptCanvasEditor AZStd::vector m_windowGeometry; AZStd::vector m_windowState; - AZ::Data::AssetId m_focusedAssetId; + SourceHandle m_focusedAssetId; AZStd::vector< WorkspaceAssetSaveData > m_activeAssetData; }; diff --git a/Gems/ScriptCanvas/Code/Editor/Utilities/RecentAssetPath.cpp b/Gems/ScriptCanvas/Code/Editor/Utilities/RecentAssetPath.cpp index 06bbd29250..f2da3868de 100644 --- a/Gems/ScriptCanvas/Code/Editor/Utilities/RecentAssetPath.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Utilities/RecentAssetPath.cpp @@ -15,7 +15,7 @@ namespace ScriptCanvasEditor { - AZ::Data::AssetId ReadRecentAssetId() + SourceHandle ReadRecentAssetId() { QSettings settings(QSettings::IniFormat, QSettings::UserScope, SCRIPTCANVASEDITOR_AZ_QCOREAPPLICATION_SETTINGS_ORGANIZATION_NAME); @@ -34,7 +34,7 @@ namespace ScriptCanvasEditor return assetId; } - void SetRecentAssetId(const AZ::Data::AssetId& assetId) + void SetRecentAssetId(SourceHandle assetId) { QSettings settings(QSettings::IniFormat, QSettings::UserScope, SCRIPTCANVASEDITOR_AZ_QCOREAPPLICATION_SETTINGS_ORGANIZATION_NAME); diff --git a/Gems/ScriptCanvas/Code/Editor/Utilities/RecentAssetPath.h b/Gems/ScriptCanvas/Code/Editor/Utilities/RecentAssetPath.h index 0aa4332ca4..35666d7c34 100644 --- a/Gems/ScriptCanvas/Code/Editor/Utilities/RecentAssetPath.h +++ b/Gems/ScriptCanvas/Code/Editor/Utilities/RecentAssetPath.h @@ -11,7 +11,7 @@ namespace ScriptCanvasEditor { - AZ::Data::AssetId ReadRecentAssetId(); - void SetRecentAssetId(const AZ::Data::AssetId& assetId); + SourceHandle ReadRecentAssetId(); + void SetRecentAssetId(SourceHandle assetId); void ClearRecentAssetId(); } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/AssetGraphSceneDataBus.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/AssetGraphSceneDataBus.h index cbb8ef12d6..6d2c3280ac 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/AssetGraphSceneDataBus.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/AssetGraphSceneDataBus.h @@ -11,14 +11,16 @@ #include #include #include +#include namespace ScriptCanvasEditor { + // #sc-editor-asset remove this class AssetGraphScene : public AZ::EBusTraits { public: - virtual AZ::EntityId FindEditorNodeIdByAssetNodeId(const AZ::Data::AssetId& assetId, AZ::EntityId assetNodeId) const = 0; - virtual AZ::EntityId FindAssetNodeIdByEditorNodeId(const AZ::Data::AssetId& assetId, AZ::EntityId editorNodeId) const = 0; + virtual AZ::EntityId FindEditorNodeIdByAssetNodeId(const SourceHandle& assetId, AZ::EntityId assetNodeId) const = 0; + virtual AZ::EntityId FindAssetNodeIdByEditorNodeId(const SourceHandle& assetId, AZ::EntityId editorNodeId) const = 0; }; using AssetGraphSceneBus = AZ::EBus; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h index 47a5cb8651..490c17cc29 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h @@ -45,14 +45,14 @@ namespace ScriptCanvasEditor GraphTabBar(QWidget* parent = nullptr); ~GraphTabBar() override = default; - void AddGraphTab(const AZ::Data::AssetId& assetId); - int InsertGraphTab(int tabIndex, const AZ::Data::AssetId& assetId); - bool SelectTab(const AZ::Data::AssetId& assetId); + void AddGraphTab(ScriptCanvasEditor::SourceHandle assetId); + int InsertGraphTab(int tabIndex, ScriptCanvasEditor::SourceHandle assetId); + bool SelectTab(ScriptCanvasEditor::SourceHandle assetId); - void ConfigureTab(int tabIndex, AZ::Data::AssetId fileAssetId, const AZStd::string& tabName); + void ConfigureTab(int tabIndex, ScriptCanvasEditor::SourceHandle fileAssetId, const AZStd::string& tabName); - int FindTab(const AZ::Data::AssetId& assetId) const; - AZ::Data::AssetId FindAssetId(int tabIndex); + int FindTab(ScriptCanvasEditor::SourceHandle assetId) const; + ScriptCanvasEditor::SourceHandle FindAssetId(int tabIndex); void CloseTab(int index); void CloseAllTabs(); @@ -92,7 +92,7 @@ namespace ScriptCanvasEditor // Called when the selected tab changes void currentChangedTab(int index); - void SetFileState(AZ::Data::AssetId assetId, Tracker::ScriptCanvasFileState fileState); + void SetFileState(ScriptCanvasEditor::SourceHandle, Tracker::ScriptCanvasFileState fileState); int m_signalSaveOnChangeTo = -1; }; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index f2eeae1c3c..424ef60ecc 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -257,20 +257,12 @@ namespace ScriptCanvasEditor assetSaveData.m_assetId = sourceId; ScriptCanvas::ScriptCanvasId scriptCanvasId = m_mainWindow->FindScriptCanvasIdByAssetId(assetId); - - EditorGraphRequests* editorRequests = EditorGraphRequestBus::FindFirstHandler(scriptCanvasId); - - if (editorRequests) - { - assetSaveData.m_assetType = azrtti_typeid(); - } - activeAssets.push_back(assetSaveData); } } else if (assetId == focusedAssetId) { - focusedAssetId.SetInvalid(); + focusedAssetId.Clear(); } } @@ -326,36 +318,38 @@ namespace ScriptCanvasEditor m_queuedAssetFocus = workspace->GetFocusedAssetId(); - for (const auto& assetSaveData : workspace->GetActiveAssetData()) + // #sc-asset-editor + //for (const auto& assetSaveData : workspace->GetActiveAssetData()) { - AssetTrackerNotificationBus::MultiHandler::BusConnect(assetSaveData.m_assetId); - - Callbacks::OnAssetReadyCallback onAssetReady = [this, assetSaveData](ScriptCanvasMemoryAsset& asset) - { - // If we get an error callback. Just remove it from out active lists. - if (asset.IsSourceInError()) - { - if (assetSaveData.m_assetId == m_queuedAssetFocus) - { - m_queuedAssetFocus = ScriptCanvasEditor::SourceHandle(); - } - - SignalAssetComplete(asset.GetFileAssetId()); - } - }; - - bool loadedFile = true; - AssetTrackerRequestBus::BroadcastResult(loadedFile, &AssetTrackerRequests::Load, assetSaveData.m_assetId, assetSaveData.m_assetType, onAssetReady); - - if (!loadedFile) - { - if (assetSaveData.m_assetId == m_queuedAssetFocus) - { - m_queuedAssetFocus = ScriptCanvasEditor::SourceHandle(); - } - - SignalAssetComplete(assetSaveData.m_assetId); - } + // load all the files +// AssetTrackerNotificationBus::MultiHandler::BusConnect(assetSaveData.m_assetId); +// +// Callbacks::OnAssetReadyCallback onAssetReady = [this, assetSaveData](ScriptCanvasMemoryAsset& asset) +// { +// // If we get an error callback. Just remove it from out active lists. +// if (asset.IsSourceInError()) +// { +// if (assetSaveData.m_assetId == m_queuedAssetFocus) +// { +// m_queuedAssetFocus = ScriptCanvasEditor::SourceHandle(); +// } +// +// SignalAssetComplete(asset.GetFileAssetId()); +// } +// }; +// +// bool loadedFile = true; +// AssetTrackerRequestBus::BroadcastResult(loadedFile, &AssetTrackerRequests::Load, assetSaveData.m_assetId, assetSaveData.m_assetType, onAssetReady); +// +// if (!loadedFile) +// { +// if (assetSaveData.m_assetId == m_queuedAssetFocus) +// { +// m_queuedAssetFocus = ScriptCanvasEditor::SourceHandle(); +// } +// +// SignalAssetComplete(assetSaveData.m_assetId); +// } } } else @@ -367,45 +361,38 @@ namespace ScriptCanvasEditor void Workspace::OnAssetReady(const ScriptCanvasMemoryAsset::pointer memoryAsset) { - const ScriptCanvasEditor::SourceHandle& fileAssetId = memoryAsset->GetFileAssetId(); - - if (AssetTrackerNotificationBus::MultiHandler::BusIsConnectedId(fileAssetId)) - { - AssetTrackerNotificationBus::MultiHandler::BusDisconnect(fileAssetId); - - m_mainWindow->OpenScriptCanvasAsset(*memoryAsset); - - SignalAssetComplete(fileAssetId); - } - } - - void Workspace::SignalAssetComplete(const ScriptCanvasEditor::SourceHandle& fileAssetId) - { - auto it = AZStd::find(m_loadingAssets.begin(), m_loadingAssets.end(), fileAssetId); - if (it != m_loadingAssets.end()) - { - m_loadingAssets.erase(it); - } - - //! When we are done loading all assets we can safely set the focus to the recorded asset - if (m_loadingAssets.empty()) - { - m_mainWindow->OnWorkspaceRestoreEnd(m_queuedAssetFocus); - m_queuedAssetFocus.SetInvalid(); - } + // open the file in the main window +// const ScriptCanvasEditor::SourceHandle& fileAssetId = memoryAsset->GetFileAssetId(); +// +// if (AssetTrackerNotificationBus::MultiHandler::BusIsConnectedId(fileAssetId)) +// { +// AssetTrackerNotificationBus::MultiHandler::BusDisconnect(fileAssetId); +// +// m_mainWindow->OpenScriptCanvasAsset(*memoryAsset); +// +// SignalAssetComplete(fileAssetId); +// } + } + + void Workspace::SignalAssetComplete(const ScriptCanvasEditor::SourceHandle& /*fileAssetId*/) + { + // When we are done loading all assets we can safely set the focus to the recorded asset +// auto it = AZStd::find(m_loadingAssets.begin(), m_loadingAssets.end(), fileAssetId); +// if (it != m_loadingAssets.end()) +// { +// m_loadingAssets.erase(it); +// } +// +// if (m_loadingAssets.empty()) +// { +// m_mainWindow->OnWorkspaceRestoreEnd(m_queuedAssetFocus); +// m_queuedAssetFocus.SetInvalid(); +// } } ScriptCanvasEditor::SourceHandle Workspace::GetSourceAssetId(const ScriptCanvasEditor::SourceHandle& memoryAssetId) const { - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, memoryAssetId); - - if (memoryAsset) - { - return memoryAsset->GetFileAssetId(); - } - - return ScriptCanvasEditor::SourceHandle(); + return memoryAssetId; } //////////////// @@ -834,6 +821,8 @@ namespace ScriptCanvasEditor void MainWindow::SignalActiveSceneChanged(ScriptCanvasEditor::SourceHandle assetId) { + // #sc-editor-asset + /* ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); @@ -871,7 +860,7 @@ namespace ScriptCanvasEditor } UpdateMenuState(enabled); - + */ } void MainWindow::UpdateRecentMenu() @@ -951,21 +940,22 @@ namespace ScriptCanvasEditor if (shouldSaveResults == UnsavedChangesOptions::SAVE) { - Callbacks::OnSave saveCB = [this](bool isSuccessful, AZ::Data::AssetPtr, ScriptCanvasEditor::SourceHandle) - { - if (isSuccessful) - { - // Continue closing. - qobject_cast(parent())->close(); - } - else - { - // Abort closing. - QMessageBox::critical(this, QString(), QObject::tr("Failed to save.")); - m_processedClosedAssetIds.clear(); - } - }; - ActivateAndSaveAsset(assetId, saveCB); + // #sc-editor-asset +// Callbacks::OnSave saveCB = [this](bool isSuccessful, AZ::Data::AssetPtr, ScriptCanvasEditor::SourceHandle) +// { +// if (isSuccessful) +// { +// // Continue closing. +// qobject_cast(parent())->close(); +// } +// else +// { +// // Abort closing. +// QMessageBox::critical(this, QString(), QObject::tr("Failed to save.")); +// m_processedClosedAssetIds.clear(); +// } +// }; +// ActivateAndSaveAsset(assetId, saveCB); event->ignore(); return; } @@ -987,15 +977,15 @@ namespace ScriptCanvasEditor m_workspace->Save(); // Close all files. - - AssetTrackerRequests::AssetList allAssets; - AssetTrackerRequestBus::BroadcastResult(allAssets, &AssetTrackerRequests::GetAssets); - - for (auto trackedAsset : allAssets) - { - const ScriptCanvasEditor::SourceHandle& assetId = trackedAsset->GetAsset().GetId(); - CloseScriptCanvasAsset(assetId); - } +// +// AssetTrackerRequests::AssetList allAssets; +// AssetTrackerRequestBus::BroadcastResult(allAssets, &AssetTrackerRequests::GetAssets); +// +// for (auto trackedAsset : allAssets) +// { +// const ScriptCanvasEditor::SourceHandle& assetId = trackedAsset->GetAsset().GetId(); +// CloseScriptCanvasAsset(assetId); +// } m_processedClosedAssetIds.clear(); @@ -1148,29 +1138,31 @@ namespace ScriptCanvasEditor m_preventUndoStateUpdateCount = 0; } - void MainWindow::MarkAssetModified(const ScriptCanvasEditor::SourceHandle& assetId) + void MainWindow::MarkAssetModified(const ScriptCanvasEditor::SourceHandle& /*assetId*/) { - if (!assetId.IsValid()) - { - return; - } - - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); - - if (memoryAsset) - { - const auto& memoryAssetId = memoryAsset->GetId(); - const Tracker::ScriptCanvasFileState& fileState = GetAssetFileState(memoryAssetId); - if (fileState != Tracker::ScriptCanvasFileState::NEW) - { - AssetTrackerRequestBus::Broadcast(&AssetTrackerRequests::UpdateFileState, memoryAssetId, Tracker::ScriptCanvasFileState::MODIFIED); - } - } +// #sc-editor-asset if (!assetId.IsValid()) +// { +// return; +// } +// +// ScriptCanvasMemoryAsset::pointer memoryAsset; +// AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); +// +// if (memoryAsset) +// { +// const auto& memoryAssetId = memoryAsset->GetId(); +// const Tracker::ScriptCanvasFileState& fileState = GetAssetFileState(memoryAssetId); +// if (fileState != Tracker::ScriptCanvasFileState::NEW) +// { +// AssetTrackerRequestBus::Broadcast(&AssetTrackerRequests::UpdateFileState, memoryAssetId, Tracker::ScriptCanvasFileState::MODIFIED); +// } +// } } - void MainWindow::RefreshScriptCanvasAsset(const AZ::Data::Asset& asset) + void MainWindow::RefreshScriptCanvasAsset(const AZ::Data::Asset& /*asset*/) { + // #sc-editor-asset + /* ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, asset.GetId()); @@ -1199,10 +1191,14 @@ namespace ScriptCanvasEditor GraphCanvas::SceneMemberNotificationBus::Event(graphCanvasId, &GraphCanvas::SceneMemberNotifications::OnSceneReady); } } + */ } - AZ::Outcome MainWindow::OpenScriptCanvasAssetId(const ScriptCanvasEditor::SourceHandle& fileAssetId) + AZ::Outcome MainWindow::OpenScriptCanvasAssetId(const ScriptCanvasEditor::SourceHandle& /*fileAssetId*/) { + // #sc-editor-asset + return AZ::Failure(AZStd::string("rewrite MainWindow::OpenScriptCanvasAssetId")); + /* if (!fileAssetId.IsValid()) { return AZ::Failure(AZStd::string("Unable to open asset with invalid asset id")); @@ -1261,10 +1257,14 @@ namespace ScriptCanvasEditor { return AZ::Failure(AZStd::string("Specified asset is in an error state and cannot be properly displayed.")); } + */ } - AZ::Outcome MainWindow::OpenScriptCanvasAsset(const ScriptCanvasMemoryAsset& scriptCanvasAsset, int tabIndex /*= -1*/) + AZ::Outcome MainWindow::OpenScriptCanvasAsset(const ScriptCanvasMemoryAsset& /*scriptCanvasAsset*/, int /*tabIndex*/ /*= -1*/) { + // #sc-editor-asset + return AZ::Failure(AZStd::string("rewrite MainWindow::OpenScriptCanvasAsset")); + /* const ScriptCanvasEditor::SourceHandle& fileAssetId = scriptCanvasAsset.GetFileAssetId(); if (!fileAssetId.IsValid()) { @@ -1336,10 +1336,14 @@ namespace ScriptCanvasEditor AssetTrackerNotificationBus::MultiHandler::BusConnect(fileAssetId); return AZ::Success(outTabIndex); + */ } - AZ::Outcome MainWindow::OpenScriptCanvasAsset(ScriptCanvasEditor::SourceHandle scriptCanvasAssetId, int tabIndex /*= -1*/) + AZ::Outcome MainWindow::OpenScriptCanvasAsset(ScriptCanvasEditor::SourceHandle /*scriptCanvasAssetId*/, int /*tabIndex*/ /*= -1*/) { + // #sc-editor-asset + return AZ::Failure(AZStd::string("rewrite MainWindow::OpenScriptCanvasAsset")); + /* ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, scriptCanvasAssetId); @@ -1352,15 +1356,22 @@ namespace ScriptCanvasEditor { return OpenScriptCanvasAssetId(scriptCanvasAssetId); } + */ } - int MainWindow::CreateAssetTab(const ScriptCanvasEditor::SourceHandle& assetId, int tabIndex) + int MainWindow::CreateAssetTab(const ScriptCanvasEditor::SourceHandle& /*assetId*/, int /*tabIndex*/) { - return m_tabBar->InsertGraphTab(tabIndex, assetId); + // #sc-editor-asset + return -1; + // return m_tabBar->InsertGraphTab(tabIndex, assetId); } - AZ::Outcome MainWindow::UpdateScriptCanvasAsset(const AZ::Data::Asset& scriptCanvasAsset) + AZ::Outcome MainWindow::UpdateScriptCanvasAsset(const AZ::Data::Asset& /*scriptCanvasAsset*/) { + // #sc-editor-asset + return AZ::Failure(AZStd::string("rewrite MainWindow::UpdateScriptCanvasAsset")); + + /* int outTabIndex = -1; PushPreventUndoStateUpdate(); @@ -1377,10 +1388,13 @@ namespace ScriptCanvasEditor } return AZ::Success(outTabIndex); + */ } - void MainWindow::RemoveScriptCanvasAsset(const ScriptCanvasEditor::SourceHandle& assetId) + void MainWindow::RemoveScriptCanvasAsset(const ScriptCanvasEditor::SourceHandle& /*assetId*/) { + // #sc-editor-asset move what is necessary to the widget + /* AssetHelpers::PrintInfo("RemoveScriptCanvasAsset : %s", AssetHelpers::AssetIdToString(assetId).c_str()); m_assetCreationRequests.erase(assetId); @@ -1408,7 +1422,7 @@ namespace ScriptCanvasEditor auto tabAssetId = tabdata.value(); SetActiveAsset(tabAssetId); } - + */ } int MainWindow::CloseScriptCanvasAsset(const ScriptCanvasEditor::SourceHandle& assetId) @@ -1451,12 +1465,10 @@ namespace ScriptCanvasEditor return createdNewAsset; } - bool MainWindow::IsScriptCanvasAssetOpen(const ScriptCanvasEditor::SourceHandle& assetId) const + bool MainWindow::IsScriptCanvasAssetOpen(const ScriptCanvasEditor::SourceHandle& /*assetId*/) const { - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); - - return memoryAsset != nullptr; + // #sc-editor-asset + return false; } const CategoryInformation* MainWindow::FindNodePaletteCategoryInformation(AZStd::string_view categoryPath) const @@ -1469,8 +1481,10 @@ namespace ScriptCanvasEditor return m_nodePaletteModel.FindNodePaletteInformation(nodeType); } - void MainWindow::GetSuggestedFullFilenameToSaveAs(const ScriptCanvasEditor::SourceHandle& assetId, AZStd::string& filePath, AZStd::string& fileFilter) + void MainWindow::GetSuggestedFullFilenameToSaveAs(const ScriptCanvasEditor::SourceHandle& /*assetId*/, AZStd::string& /*filePath*/, AZStd::string& /*fileFilter*/) { + // #sc-editor-asset + /* ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); @@ -1511,6 +1525,7 @@ namespace ScriptCanvasEditor AZStd::array resolvedPath; AZ::IO::FileIOBase::GetInstance()->ResolvePath(assetPath.data(), resolvedPath.data(), resolvedPath.size()); filePath = resolvedPath.data(); + */ } void MainWindow::OpenFile(const char* fullPath) @@ -1529,7 +1544,8 @@ namespace ScriptCanvasEditor return; } -#if defined(EDITOR_ASSET_SUPPORT_ENABLED) +#if defined(EDITOR_ASSET_SUPPORT_ENABLED) + /* m_errorFilePath = fullPath; // Let's find the source file on disk @@ -1576,12 +1592,13 @@ namespace ScriptCanvasEditor }; // TODO-LS the assetInfo.m_assetType is always null for some reason, I know in this case we want default assets so it's ok to hardcode it - AssetTrackerRequestBus::Broadcast(&AssetTrackerRequests::Load, assetInfo.m_assetId, /*assetInfo.m_assetType*/azrtti_typeid(), onAssetReady); + AssetTrackerRequestBus::Broadcast(&AssetTrackerRequests::Load, assetInfo.m_assetId, assetInfo.m_assetType, azrtti_typeid(), onAssetReady); } else { QMessageBox::warning(this, "Invalid Source Asset", QString("'%1' is not a valid asset path.").arg(fullPath), QMessageBox::Ok); } + */ #endif } @@ -1705,7 +1722,7 @@ namespace ScriptCanvasEditor if (!IsTabOpen(assetId, outTabIndex)) { - AZ_Assert(false, AZStd::string::format("Unable to open new Script Canvas Asset with id %s in the Script Canvas Editor", AssetHelpers::AssetIdToString(assetId).c_str()).c_str()); + AZ_Assert(false, AZStd::string::format("Unable to open new Script Canvas Asset with id %s in the Script Canvas Editor", assetId.ToString().c_str()).c_str()); return -1; } @@ -1725,31 +1742,32 @@ namespace ScriptCanvasEditor } } - AZ::Outcome MainWindow::CreateScriptCanvasAsset(AZStd::string_view assetPath, AZ::Data::AssetType assetType, int tabIndex) + AZ::Outcome MainWindow::CreateScriptCanvasAsset(AZStd::string_view /*assetPath*/, AZ::Data::AssetType /*assetType*/, int /*tabIndex*/) { - int outTabIndex = -1; - - ScriptCanvasEditor::SourceHandle newAssetId; - auto onAssetCreated = [this, assetPath, tabIndex, &outTabIndex](ScriptCanvasMemoryAsset& asset) - { - const ScriptCanvasEditor::SourceHandle& assetId = asset.GetId(); - - outTabIndex = InsertTabForAsset(assetPath, assetId, tabIndex); - - SetActiveAsset(assetId); - - UpdateScriptCanvasAsset(asset.GetAsset()); + return AZ::Failure(AZStd::string("MainWindow::CreateScriptCanvasAsset just make a new thing with the project root + untitled...")); +// int outTabIndex = -1; +// +// ScriptCanvasEditor::SourceHandle newAssetId; +// auto onAssetCreated = [this, assetPath, tabIndex, &outTabIndex](ScriptCanvasMemoryAsset& asset) +// { +// const ScriptCanvasEditor::SourceHandle& assetId = asset.GetId(); +// +// outTabIndex = InsertTabForAsset(assetPath, assetId, tabIndex); +// +// SetActiveAsset(assetId); +// +// UpdateScriptCanvasAsset(asset.GetAsset()); +// +// AZ::EntityId scriptCanvasEntityId; +// AssetTrackerRequestBus::BroadcastResult(scriptCanvasEntityId, &AssetTrackerRequests::GetScriptCanvasId, assetId); +// +// GraphCanvas::GraphId graphCanvasGraphId = GetGraphCanvasGraphId(scriptCanvasEntityId); +// GraphCanvas::AssetEditorNotificationBus::Event(ScriptCanvasEditor::AssetEditorId, &GraphCanvas::AssetEditorNotifications::OnGraphLoaded, graphCanvasGraphId); +// +// }; +// AssetTrackerRequestBus::BroadcastResult(newAssetId, &AssetTrackerRequests::Create, assetPath, assetType, onAssetCreated); - AZ::EntityId scriptCanvasEntityId; - AssetTrackerRequestBus::BroadcastResult(scriptCanvasEntityId, &AssetTrackerRequests::GetScriptCanvasId, assetId); - - GraphCanvas::GraphId graphCanvasGraphId = GetGraphCanvasGraphId(scriptCanvasEntityId); - GraphCanvas::AssetEditorNotificationBus::Event(ScriptCanvasEditor::AssetEditorId, &GraphCanvas::AssetEditorNotifications::OnGraphLoaded, graphCanvasGraphId); - - }; - AssetTrackerRequestBus::BroadcastResult(newAssetId, &AssetTrackerRequests::Create, assetPath, assetType, onAssetCreated); - - return AZ::Success(outTabIndex); + // return AZ::Success(outTabIndex); } bool MainWindow::OnFileSave(const Callbacks::OnSave& saveCB) @@ -1875,8 +1893,11 @@ namespace ScriptCanvasEditor return false; } - void MainWindow::OnSaveCallback(bool saveSuccess, AZ::Data::AssetPtr fileAsset, ScriptCanvasEditor::SourceHandle previousFileAssetId) + void MainWindow::OnSaveCallback(bool /*saveSuccess*/, AZ::Data::AssetPtr /*fileAsset*/, ScriptCanvasEditor::SourceHandle /*previousFileAssetId*/) { + // #sc-editor-asset yikes...just save the thing...move to ::SaveAsset maybe + + /* ScriptCanvasMemoryAsset::pointer memoryAsset; AZStd::string tabName = m_tabBar->tabText(m_tabBar->currentIndex()).toUtf8().data(); @@ -1999,6 +2020,7 @@ namespace ScriptCanvasEditor EnableAssetView(memoryAsset); UnblockCloseRequests(); + */ } bool MainWindow::ActivateAndSaveAsset(const ScriptCanvasEditor::SourceHandle& unsavedAssetId, const Callbacks::OnSave& saveCB) @@ -2007,8 +2029,9 @@ namespace ScriptCanvasEditor return OnFileSave(saveCB); } - void MainWindow::SaveAsset(ScriptCanvasEditor::SourceHandle assetId, const Callbacks::OnSave& onSave) + void MainWindow::SaveAsset(ScriptCanvasEditor::SourceHandle /*assetId*/, const Callbacks::OnSave& /*onSave*/) { + /* PrepareAssetForSave(assetId); auto onSaveCallback = [this, onSave](bool saveSuccess, AZ::Data::AssetPtr asset, ScriptCanvasEditor::SourceHandle previousAssetId) @@ -2033,10 +2056,12 @@ namespace ScriptCanvasEditor } BlockCloseRequests(); + */ } - void MainWindow::SaveNewAsset(AZStd::string_view path, ScriptCanvasEditor::SourceHandle inMemoryAssetId, const Callbacks::OnSave& onSave) + void MainWindow::SaveNewAsset(AZStd::string_view /*path*/, ScriptCanvasEditor::SourceHandle /*inMemoryAssetId*/, const Callbacks::OnSave& /*onSave*/) { + /* PrepareAssetForSave(inMemoryAssetId); auto onSaveCallback = [this, onSave](bool saveSuccess, AZ::Data::AssetPtr asset, ScriptCanvasEditor::SourceHandle previousAssetId) @@ -2061,6 +2086,7 @@ namespace ScriptCanvasEditor } BlockCloseRequests(); + */ } void MainWindow::OnFileOpen() @@ -2069,8 +2095,6 @@ namespace ScriptCanvasEditor EBUS_EVENT_RESULT(serializeContext, AZ::ComponentApplicationBus, GetSerializeContext); AZ_Assert(serializeContext, "Failed to acquire application serialize context."); - ScriptCanvasEditor::SourceHandle openId = ReadRecentAssetId(); - AZStd::string assetRoot; { AZStd::array assetRootChar; @@ -2078,18 +2102,7 @@ namespace ScriptCanvasEditor assetRoot = assetRootChar.data(); } - AZStd::string assetPath; - AZ::Data::AssetCatalogRequestBus::BroadcastResult(assetPath, &AZ::Data::AssetCatalogRequests::GetAssetPathById, openId); - if (!assetPath.empty()) - { - assetPath = AZStd::string::format("%s/%s", assetRoot.c_str(), assetPath.c_str()); - } - - if (!openId.IsValid() || !QFile::exists(assetPath.c_str())) - { - assetPath = AZStd::string::format("%s/scriptcanvas", assetRoot.c_str()); - } - assetPath = AZStd::string::format("%s/scriptcanvas", assetRoot.c_str()); + AZStd::string assetPath = AZStd::string::format("%s/scriptcanvas", assetRoot.c_str()); AZ::EBusAggregateResults> fileFilters; AssetRegistryRequestBus::BroadcastResult(fileFilters, &AssetRegistryRequests::GetAssetHandlerFileFilters); @@ -2471,8 +2484,10 @@ namespace ScriptCanvasEditor GraphCanvas::ViewRequestBus::Event(viewId, &GraphCanvas::ViewRequests::CenterOnEndOfChain); } - void MainWindow::UpdateWorkspaceStatus(const ScriptCanvasMemoryAsset& memoryAsset) + void MainWindow::UpdateWorkspaceStatus(const ScriptCanvasMemoryAsset& /*memoryAsset*/) { + // only occurs on file open, do it there, if necessary + /* ScriptCanvasEditor::SourceHandle fileAssetId = memoryAsset.GetFileAssetId(); size_t eraseCount = m_loadingAssets.erase(fileAssetId); @@ -2494,6 +2509,7 @@ namespace ScriptCanvasEditor } } } + */ } void MainWindow::OnCanUndoChanged(bool canUndo) @@ -2552,49 +2568,69 @@ namespace ScriptCanvasEditor AZ::EntityId MainWindow::GetActiveGraphCanvasGraphId() const { - AZ::EntityId graphId; - AssetTrackerRequestBus::BroadcastResult(graphId, &AssetTrackerRequests::GetGraphId, m_activeGraph); - return graphId; + // #sc-editor-asset + + // AZ::EntityId graphId; + // AssetTrackerRequestBus::BroadcastResult(graphId, &AssetTrackerRequests::GetGraphId, m_activeGraph); + /* + * Falls through to this, which falls through to editor graph, move to canvas widget + AZ::EntityId ScriptCanvasMemoryAsset::GetGraphId() + { + if (!m_graphId.IsValid()) + { + EditorGraphRequestBus::EventResult(m_graphId, m_scriptCanvasId, &EditorGraphRequests::GetGraphCanvasGraphId); + } + + return m_graphId; + } + */ + return AZ::EntityId{}; } ScriptCanvas::ScriptCanvasId MainWindow::GetActiveScriptCanvasId() const { - ScriptCanvas::ScriptCanvasId sceneId; - AssetTrackerRequestBus::BroadcastResult(sceneId, &AssetTrackerRequests::GetScriptCanvasId, m_activeGraph); - return sceneId; + // ScriptCanvas::ScriptCanvasId sceneId; + // AssetTrackerRequestBus::BroadcastResult(sceneId, &AssetTrackerRequests::GetScriptCanvasId, m_activeGraph); + // #sc-editor-asset + return ScriptCanvas::ScriptCanvasId{}; } - GraphCanvas::GraphId MainWindow::GetGraphCanvasGraphId(const ScriptCanvas::ScriptCanvasId& scriptCanvasId) const + GraphCanvas::GraphId MainWindow::GetGraphCanvasGraphId(const ScriptCanvas::ScriptCanvasId& /*scriptCanvasId*/) const { - AZ::EntityId graphCanvasId; - AssetTrackerRequestBus::BroadcastResult(graphCanvasId, &AssetTrackerRequests::GetGraphCanvasId, scriptCanvasId); - - return graphCanvasId; + // #sc-editor-asset + // AZ::EntityId graphCanvasId; + // AssetTrackerRequestBus::BroadcastResult(graphCanvasId, &AssetTrackerRequests::GetGraphCanvasId, scriptCanvasId); + // move to widget + return AZ::EntityId{}; } - GraphCanvas::GraphId MainWindow::FindGraphCanvasGraphIdByAssetId(const ScriptCanvasEditor::SourceHandle& assetId) const + GraphCanvas::GraphId MainWindow::FindGraphCanvasGraphIdByAssetId(const ScriptCanvasEditor::SourceHandle& /*assetId*/) const { - AZ::EntityId graphId; - AssetTrackerRequestBus::BroadcastResult(graphId, &AssetTrackerRequests::GetGraphId, assetId); - return graphId; + // #sc-editor-asset + // AZ::EntityId graphId; + // AssetTrackerRequestBus::BroadcastResult(graphId, &AssetTrackerRequests::GetGraphId, assetId); + return AZ::EntityId{}; } - ScriptCanvas::ScriptCanvasId MainWindow::FindScriptCanvasIdByAssetId(const ScriptCanvasEditor::SourceHandle& assetId) const + ScriptCanvas::ScriptCanvasId MainWindow::FindScriptCanvasIdByAssetId(const ScriptCanvasEditor::SourceHandle& /*assetId*/) const { - ScriptCanvas::ScriptCanvasId scriptCanvasId; - AssetTrackerRequestBus::BroadcastResult(scriptCanvasId, &AssetTrackerRequests::GetScriptCanvasId, assetId); - return scriptCanvasId; + // #sc-editor-asset + // ScriptCanvas::ScriptCanvasId scriptCanvasId; + // AssetTrackerRequestBus::BroadcastResult(scriptCanvasId, &AssetTrackerRequests::GetScriptCanvasId, assetId); + return ScriptCanvas::ScriptCanvasId{}; } - ScriptCanvas::ScriptCanvasId MainWindow::GetScriptCanvasId(const GraphCanvas::GraphId& graphCanvasGraphId) const + ScriptCanvas::ScriptCanvasId MainWindow::GetScriptCanvasId(const GraphCanvas::GraphId& /*graphCanvasGraphId*/) const { - ScriptCanvas::ScriptCanvasId scriptCanvasId; - AssetTrackerRequestBus::BroadcastResult(scriptCanvasId, &AssetTrackerRequests::GetScriptCanvasIdFromGraphId, graphCanvasGraphId); - return scriptCanvasId; + // #sc-editor-asset + // ScriptCanvas::ScriptCanvasId scriptCanvasId; + // AssetTrackerRequestBus::BroadcastResult(scriptCanvasId, &AssetTrackerRequests::GetScriptCanvasIdFromGraphId, graphCanvasGraphId); + return ScriptCanvas::ScriptCanvasId{}; } bool MainWindow::IsInUndoRedo(const AZ::EntityId& graphCanvasGraphId) const { + // #sc-editor-asset bool isActive = false; UndoRequestBus::EventResult(isActive, GetScriptCanvasId(graphCanvasGraphId), &UndoRequests::IsActive); return isActive; @@ -2647,8 +2683,10 @@ namespace ScriptCanvasEditor return false; } - void MainWindow::ReconnectSceneBuses(ScriptCanvasEditor::SourceHandle previousAssetId, ScriptCanvasEditor::SourceHandle nextAssetId) + void MainWindow::ReconnectSceneBuses(ScriptCanvasEditor::SourceHandle /*previousAssetId*/, ScriptCanvasEditor::SourceHandle /*nextAssetId*/) { + // #sc-editor-asset + /* ScriptCanvasMemoryAsset::pointer previousAsset; AssetTrackerRequestBus::BroadcastResult(previousAsset, &AssetTrackerRequests::GetAsset, previousAssetId); @@ -2680,17 +2718,19 @@ namespace ScriptCanvasEditor // Notify about the graph refresh GraphCanvas::AssetEditorNotificationBus::Event(ScriptCanvasEditor::AssetEditorId, &GraphCanvas::AssetEditorNotifications::OnGraphRefreshed, previousScriptCanvasSceneId, nextAssetGraphCanvasId); - + */ } - void MainWindow::SetActiveAsset(const ScriptCanvasEditor::SourceHandle& fileAssetId) + void MainWindow::SetActiveAsset(const ScriptCanvasEditor::SourceHandle& /*fileAssetId*/) { + // #sc-editor-asset + /* if (m_activeGraph == fileAssetId) { return; } - AssetHelpers::PrintInfo("SetActiveAsset : from: %s to %s", AssetHelpers::AssetIdToString(m_activeGraph).c_str(), AssetHelpers::AssetIdToString(fileAssetId).c_str()); + AssetHelpers::PrintInfo("SetActiveAsset : from: %s to %s", m_activeGraph.ToString().c_str(), fileAssetId.ToString().c_str()); if (fileAssetId.IsValid()) { @@ -2732,7 +2772,7 @@ namespace ScriptCanvasEditor { ScriptCanvasEditor::SourceHandle previousAssetId = m_activeGraph; - m_activeGraph.SetInvalid(); + m_activeGraph.Clear(); m_emptyCanvas->show(); ReconnectSceneBuses(previousAssetId, m_activeGraph); @@ -2743,13 +2783,16 @@ namespace ScriptCanvasEditor UpdateUndoCache(fileAssetId); RefreshSelection(); + */ } void MainWindow::RefreshActiveAsset() { + // #sc-editor-asset + /* if (m_activeGraph.IsValid()) { - AssetHelpers::PrintInfo("RefreshActiveAsset : m_activeGraph (%s)", AssetHelpers::AssetIdToString(m_activeGraph).c_str()); + AssetHelpers::PrintInfo("RefreshActiveAsset : m_activeGraph (%s)", m_activeGraph.ToString().c_str()); ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeGraph); @@ -2771,7 +2814,7 @@ namespace ScriptCanvasEditor AZ_Assert(view, "Asset should have a view"); if (view) { - AssetHelpers::PrintInfo("RefreshActiveAsset : m_activeGraph (%s)", AssetHelpers::AssetIdToString(m_activeGraph).c_str()); + AssetHelpers::PrintInfo("RefreshActiveAsset : m_activeGraph (%s)", m_activeGraph.ToString().c_str()); view->ShowScene(sceneEntityId); m_layout->addWidget(view); @@ -2789,36 +2832,41 @@ namespace ScriptCanvasEditor SetActiveAsset({}); } } + */ } void MainWindow::Clear() { m_tabBar->CloseAllTabs(); - - AssetTrackerRequests::AssetList assets; - AssetTrackerRequestBus::BroadcastResult(assets, &AssetTrackerRequests::GetAssets); - - for (auto asset : assets) - { - RemoveScriptCanvasAsset(asset->GetAsset().GetId()); - } + // #sc-editor-asset +// +// AssetTrackerRequests::AssetList assets; +// AssetTrackerRequestBus::BroadcastResult(assets, &AssetTrackerRequests::GetAssets); +// +// for (auto asset : assets) +// { +// RemoveScriptCanvasAsset(asset->GetAsset().GetId()); +// } SetActiveAsset({}); } void MainWindow::OnTabCloseButtonPressed(int index) { + QVariant tabdata = m_tabBar->tabData(index); if (tabdata.isValid()) { auto fileAssetId = tabdata.value(); - Tracker::ScriptCanvasFileState fileState; - AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, fileAssetId); - + Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::NEW; bool isSaving = false; - AssetTrackerRequestBus::BroadcastResult(isSaving, &AssetTrackerRequests::IsSaving, fileAssetId); + // #sc-editor-asset Get from widgets + /* + AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, fileAssetId); + AssetTrackerRequestBus::BroadcastResult(isSaving, &AssetTrackerRequests::IsSaving, fileAssetId); + */ if (isSaving) { m_closeCurrentGraphAfterSave = true; @@ -2830,42 +2878,44 @@ namespace ScriptCanvasEditor { SetActiveAsset(fileAssetId); - AZStd::string tabName; - AssetTrackerRequestBus::BroadcastResult(tabName, &AssetTrackerRequests::GetTabName, fileAssetId); + // #sc-editor-asset + AZStd::string tabName = "Get from widget"; + // AssetTrackerRequestBus::BroadcastResult(tabName, &AssetTrackerRequests::GetTabName, fileAssetId); saveDialogResults = ShowSaveDialog(tabName.c_str()); } if (saveDialogResults == UnsavedChangesOptions::SAVE) { - auto saveCB = [this](bool isSuccessful, AZ::Data::AssetPtr asset, ScriptCanvasEditor::SourceHandle) - { - if (isSuccessful) - { - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, asset->GetId()); - AZ_Assert(memoryAsset, "At this point we must have a MemoryAsset"); - - int tabIndex = -1; - if (IsTabOpen(memoryAsset->GetFileAssetId(), tabIndex)) - { - OnTabCloseRequest(tabIndex); - } - } - else - { - QMessageBox::critical(this, QString(), QObject::tr("Failed to save.")); - } - }; - - if (fileState == Tracker::ScriptCanvasFileState::NEW) - { - SaveAssetAsImpl(fileAssetId, saveCB); - } - else - { - SaveAsset(fileAssetId, saveCB); - } + // #sc-editor-asset +// auto saveCB = [this](bool isSuccessful, AZ::Data::AssetPtr asset, ScriptCanvasEditor::SourceHandle) +// { +// if (isSuccessful) +// { +// ScriptCanvasMemoryAsset::pointer memoryAsset; +// AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, asset->GetId()); +// AZ_Assert(memoryAsset, "At this point we must have a MemoryAsset"); +// +// int tabIndex = -1; +// if (IsTabOpen(memoryAsset->GetFileAssetId(), tabIndex)) +// { +// OnTabCloseRequest(tabIndex); +// } +// } +// else +// { +// QMessageBox::critical(this, QString(), QObject::tr("Failed to save.")); +// } +// }; +// +// if (fileState == Tracker::ScriptCanvasFileState::NEW) +// { +// SaveAssetAsImpl(fileAssetId, saveCB); +// } +// else +// { +// SaveAsset(fileAssetId, saveCB); +// } } else if (saveDialogResults == UnsavedChangesOptions::CONTINUE_WITHOUT_SAVING) { @@ -2888,7 +2938,7 @@ namespace ScriptCanvasEditor void MainWindow::CloseAllTabs() { m_isClosingTabs = true; - m_skipTabOnClose.SetInvalid(); + m_skipTabOnClose.Clear(); CloseNextTab(); } @@ -2906,8 +2956,10 @@ namespace ScriptCanvasEditor } } - void MainWindow::CopyPathToClipboard(int index) + void MainWindow::CopyPathToClipboard(int /*index*/) { + // #sc-editor-asset + /* QVariant tabdata = m_tabBar->tabData(index); if (tabdata.isValid()) @@ -2928,6 +2980,7 @@ namespace ScriptCanvasEditor clipBoard->setText(m_tabBar->tabText(index)); } } + */ } void MainWindow::OnActiveFileStateChanged() @@ -2944,7 +2997,7 @@ namespace ScriptCanvasEditor || (m_tabBar->count() == 1 && m_skipTabOnClose.IsValid())) { m_isClosingTabs = false; - m_skipTabOnClose.SetInvalid(); + m_skipTabOnClose.Clear(); return; } @@ -2970,8 +3023,9 @@ namespace ScriptCanvasEditor } } - void MainWindow::OnTabCloseRequest(int index) + void MainWindow::OnTabCloseRequest(int /*index*/) { + /* QVariant tabdata = m_tabBar->tabData(index); if (tabdata.isValid()) { @@ -3005,6 +3059,7 @@ namespace ScriptCanvasEditor // information AddSystemTickAction(SystemTickActionFlag::CloseNextTabAction); } + */ } void MainWindow::OnNodeAdded(const AZ::EntityId& nodeId, bool isPaste) @@ -3578,7 +3633,7 @@ namespace ScriptCanvasEditor if (m_queuedFocusOverride.IsValid()) { SetActiveAsset(m_queuedFocusOverride); - m_queuedFocusOverride.SetInvalid(); + m_queuedFocusOverride.Clear(); } else if (lastFocusAsset.IsValid()) { @@ -3641,22 +3696,23 @@ namespace ScriptCanvasEditor void MainWindow::UpdateSaveState() { - bool enabled = m_activeGraph.IsValid(); - bool isSaving = false; - bool hasModifications = false; - - if (enabled) - { - Tracker::ScriptCanvasFileState fileState = GetAssetFileState(m_activeGraph); - hasModifications = ( fileState == Tracker::ScriptCanvasFileState::MODIFIED - || fileState == Tracker::ScriptCanvasFileState::NEW - || fileState == Tracker::ScriptCanvasFileState::SOURCE_REMOVED); - - AssetTrackerRequestBus::BroadcastResult(isSaving, &AssetTrackerRequests::IsSaving, m_activeGraph); - } - - ui->action_Save->setEnabled(enabled && !isSaving && hasModifications); - ui->action_Save_As->setEnabled(enabled && !isSaving); + // #sc-editor-asset todo, consider making blocking +// bool enabled = m_activeGraph.IsValid(); +// bool isSaving = false; +// bool hasModifications = false; +// +// if (enabled) +// { +// Tracker::ScriptCanvasFileState fileState = GetAssetFileState(m_activeGraph); +// hasModifications = ( fileState == Tracker::ScriptCanvasFileState::MODIFIED +// || fileState == Tracker::ScriptCanvasFileState::NEW +// || fileState == Tracker::ScriptCanvasFileState::SOURCE_REMOVED); +// +// AssetTrackerRequestBus::BroadcastResult(isSaving, &AssetTrackerRequests::IsSaving, m_activeGraph); +// } +// +// ui->action_Save->setEnabled(enabled && !isSaving && hasModifications); +// ui->action_Save_As->setEnabled(enabled && !isSaving); } void MainWindow::CreateFunctionInput() @@ -3854,18 +3910,22 @@ namespace ScriptCanvasEditor return findChild(elementName); } - AZ::EntityId MainWindow::FindEditorNodeIdByAssetNodeId(const ScriptCanvasEditor::SourceHandle& assetId, AZ::EntityId assetNodeId) const + AZ::EntityId MainWindow::FindEditorNodeIdByAssetNodeId(const ScriptCanvasEditor::SourceHandle& /*assetId*/, AZ::EntityId /*assetNodeId*/) const { - AZ::EntityId editorEntityId; - AssetTrackerRequestBus::BroadcastResult(editorEntityId, &AssetTrackerRequests::GetEditorEntityIdFromSceneEntityId, assetId, assetNodeId); - return editorEntityId; + // #sc-editor-asset + return AZ::EntityId{}; + // AZ::EntityId editorEntityId; + // AssetTrackerRequestBus::BroadcastResult(editorEntityId, &AssetTrackerRequests::GetEditorEntityIdFromSceneEntityId, assetId, assetNodeId); + //return AZ::EntityId{};// editorEntityId; } - AZ::EntityId MainWindow::FindAssetNodeIdByEditorNodeId(const ScriptCanvasEditor::SourceHandle& assetId, AZ::EntityId editorNodeId) const + AZ::EntityId MainWindow::FindAssetNodeIdByEditorNodeId(const ScriptCanvasEditor::SourceHandle& /*assetId*/, AZ::EntityId /*editorNodeId*/) const { - AZ::EntityId sceneEntityId; - AssetTrackerRequestBus::BroadcastResult(sceneEntityId, &AssetTrackerRequests::GetSceneEntityIdFromEditorEntityId, assetId, editorNodeId); - return sceneEntityId; + // #sc-editor-asset + return AZ::EntityId{}; + // AZ::EntityId sceneEntityId; + // AssetTrackerRequestBus::BroadcastResult(sceneEntityId, &AssetTrackerRequests::GetSceneEntityIdFromEditorEntityId, assetId, editorNodeId); + // return sceneEntityId; } GraphCanvas::Endpoint MainWindow::CreateNodeForProposalWithGroup(const AZ::EntityId& connectionId, const GraphCanvas::Endpoint& endpoint, const QPointF& scenePoint, const QPoint& screenPoint, AZ::EntityId groupTarget) @@ -4285,8 +4345,9 @@ namespace ScriptCanvasEditor PrepareAssetForSave(m_activeGraph); } - void MainWindow::PrepareAssetForSave(const ScriptCanvasEditor::SourceHandle& assetId) + void MainWindow::PrepareAssetForSave(const ScriptCanvasEditor::SourceHandle& /*assetId*/) { + /* ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); @@ -4311,6 +4372,7 @@ namespace ScriptCanvasEditor graph->MarkVersion(); } } + */ } void MainWindow::RestartAutoTimerSave(bool forceTimer) @@ -4353,64 +4415,65 @@ namespace ScriptCanvasEditor void MainWindow::OnAssignToSelectedEntities() { - Tracker::ScriptCanvasFileState fileState; - AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, m_activeGraph); - - bool isDocumentOpen = false; - AzToolsFramework::EditorRequests::Bus::BroadcastResult(isDocumentOpen, &AzToolsFramework::EditorRequests::IsLevelDocumentOpen); - - if (fileState == Tracker::ScriptCanvasFileState::NEW || fileState == Tracker::ScriptCanvasFileState::SOURCE_REMOVED || !isDocumentOpen) - { - return; - } - - AzToolsFramework::EntityIdList selectedEntityIds; - AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult(selectedEntityIds, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities); - - auto selectedEntityIdIter = selectedEntityIds.begin(); - - bool isLayerAmbiguous = false; - AZ::EntityId targetLayer; - - while (selectedEntityIdIter != selectedEntityIds.end()) - { - bool isLayerEntity = false; - AzToolsFramework::Layers::EditorLayerComponentRequestBus::EventResult(isLayerEntity, (*selectedEntityIdIter), &AzToolsFramework::Layers::EditorLayerComponentRequestBus::Events::HasLayer); - - if (isLayerEntity) - { - if (targetLayer.IsValid()) - { - isLayerAmbiguous = true; - } - - targetLayer = (*selectedEntityIdIter); - - selectedEntityIdIter = selectedEntityIds.erase(selectedEntityIdIter); - } - else - { - ++selectedEntityIdIter; - } - } - - if (selectedEntityIds.empty()) - { - AZ::EntityId createdId; - AzToolsFramework::EditorRequests::Bus::BroadcastResult(createdId, &AzToolsFramework::EditorRequests::CreateNewEntity, AZ::EntityId()); - - selectedEntityIds.emplace_back(createdId); - - if (targetLayer.IsValid() && !isLayerAmbiguous) - { - AZ::TransformBus::Event(createdId, &AZ::TransformBus::Events::SetParent, targetLayer); - } - } - - for (const AZ::EntityId& entityId : selectedEntityIds) - { - AssignGraphToEntityImpl(entityId); - } + // #sc-editor-asset consider cutting +// Tracker::ScriptCanvasFileState fileState; +// AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, m_activeGraph); +// +// bool isDocumentOpen = false; +// AzToolsFramework::EditorRequests::Bus::BroadcastResult(isDocumentOpen, &AzToolsFramework::EditorRequests::IsLevelDocumentOpen); +// +// if (fileState == Tracker::ScriptCanvasFileState::NEW || fileState == Tracker::ScriptCanvasFileState::SOURCE_REMOVED || !isDocumentOpen) +// { +// return; +// } +// +// AzToolsFramework::EntityIdList selectedEntityIds; +// AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult(selectedEntityIds, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities); +// +// auto selectedEntityIdIter = selectedEntityIds.begin(); +// +// bool isLayerAmbiguous = false; +// AZ::EntityId targetLayer; +// +// while (selectedEntityIdIter != selectedEntityIds.end()) +// { +// bool isLayerEntity = false; +// AzToolsFramework::Layers::EditorLayerComponentRequestBus::EventResult(isLayerEntity, (*selectedEntityIdIter), &AzToolsFramework::Layers::EditorLayerComponentRequestBus::Events::HasLayer); +// +// if (isLayerEntity) +// { +// if (targetLayer.IsValid()) +// { +// isLayerAmbiguous = true; +// } +// +// targetLayer = (*selectedEntityIdIter); +// +// selectedEntityIdIter = selectedEntityIds.erase(selectedEntityIdIter); +// } +// else +// { +// ++selectedEntityIdIter; +// } +// } +// +// if (selectedEntityIds.empty()) +// { +// AZ::EntityId createdId; +// AzToolsFramework::EditorRequests::Bus::BroadcastResult(createdId, &AzToolsFramework::EditorRequests::CreateNewEntity, AZ::EntityId()); +// +// selectedEntityIds.emplace_back(createdId); +// +// if (targetLayer.IsValid() && !isLayerAmbiguous) +// { +// AZ::TransformBus::Event(createdId, &AZ::TransformBus::Events::SetParent, targetLayer); +// } +// } +// +// for (const AZ::EntityId& entityId : selectedEntityIds) +// { +// AssignGraphToEntityImpl(entityId); +// } } void MainWindow::OnAssignToEntity(const AZ::EntityId& entityId) @@ -4424,11 +4487,13 @@ namespace ScriptCanvasEditor } } - ScriptCanvasEditor::Tracker::ScriptCanvasFileState MainWindow::GetAssetFileState(ScriptCanvasEditor::SourceHandle assetId) const + ScriptCanvasEditor::Tracker::ScriptCanvasFileState MainWindow::GetAssetFileState(ScriptCanvasEditor::SourceHandle /*assetId*/) const { - Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::INVALID; - AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, assetId); - return fileState; + // #sc-editor-asset + return Tracker::ScriptCanvasFileState::INVALID; + // Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::INVALID; + // AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, assetId); + // return fileState; } void MainWindow::AssignGraphToEntityImpl(const AZ::EntityId& entityId) @@ -4477,7 +4542,8 @@ namespace ScriptCanvasEditor if (usableRequestBus) { ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeGraph); + // #sc-editor-asset + // AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeGraph); if (memoryAsset) { diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h index 77a85ec448..1c98769463 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h @@ -153,7 +153,7 @@ namespace ScriptCanvasEditor } }; - //! Manages the Save/Restore operations of the user's las topened and focused graphs + //! Manages the Save/Restore operations of the user's last opened and focused graphs class Workspace : AssetTrackerNotificationBus::MultiHandler { @@ -415,17 +415,17 @@ namespace ScriptCanvasEditor void CloseNextTab(); - bool IsTabOpen(const ScriptCanvasEditor::SourceHandle& assetId, int& outTabIndex) const; - QVariant GetTabData(const ScriptCanvasEditor::SourceHandle& assetId); + bool IsTabOpen(const SourceHandle& assetId, int& outTabIndex) const; + QVariant GetTabData(const SourceHandle& assetId); //! GeneralRequestBus - AZ::Outcome OpenScriptCanvasAssetId(const ScriptCanvasEditor::SourceHandle& assetId) override; - AZ::Outcome OpenScriptCanvasAsset(ScriptCanvasEditor::SourceHandle scriptCanvasAssetId, int tabIndex = -1) override; + AZ::Outcome OpenScriptCanvasAssetId(const SourceHandle& assetId) override; + AZ::Outcome OpenScriptCanvasAsset(SourceHandle scriptCanvasAssetId, int tabIndex = -1) override; AZ::Outcome OpenScriptCanvasAsset(const ScriptCanvasMemoryAsset& scriptCanvasAsset, int tabIndex = -1); - int CloseScriptCanvasAsset(const ScriptCanvasEditor::SourceHandle& assetId) override; + int CloseScriptCanvasAsset(const SourceHandle& assetId) override; bool CreateScriptCanvasAssetFor(const TypeDefs::EntityComponentId& requestingEntityId) override; - bool IsScriptCanvasAssetOpen(const ScriptCanvasEditor::SourceHandle& assetId) const override; + bool IsScriptCanvasAssetOpen(const SourceHandle& assetId) const override; const CategoryInformation* FindNodePaletteCategoryInformation(AZStd::string_view categoryPath) const override; const NodePaletteModelInformation* FindNodePaletteModelInformation(const ScriptCanvas::NodeTypeIdentifier& nodeType) const override; @@ -625,15 +625,7 @@ namespace ScriptCanvasEditor ScriptCanvasEditor::SourceHandle GetSourceAssetId(const ScriptCanvasEditor::SourceHandle& memoryAssetId) const { - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, memoryAssetId); - - if (memoryAsset) - { - return memoryAsset->GetFileAssetId(); - } - - return ScriptCanvasEditor::SourceHandle(); + return memoryAssetId; } int InsertTabForAsset(AZStd::string_view assetPath, ScriptCanvasEditor::SourceHandle assetId, int tabIndex = -1); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp index 9b2d0e4982..e598700899 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include "Core.h" #include "Attributes.h" @@ -182,5 +183,55 @@ namespace ScriptCanvas serializeContext->RegisterType(typeId, AZStd::move(classData), EventPlaceholderAnyCreator); } +} + +namespace ScriptCanvasEditor +{ + SourceHandle::SourceHandle(ScriptCanvas::DataPtr graph, const AZ::Uuid& id, AZStd::string_view path) + : m_data(graph) + , m_id(id) + , m_path(path) + {} + + void SourceHandle::Clear() + { + m_data = nullptr; + m_id = AZ::Uuid::CreateNull(); + m_path.clear(); + } + + GraphPtrConst SourceHandle::Get() const + { + return m_data ? m_data->GetEditorGraph() : nullptr; + } + + const AZ::Uuid& SourceHandle::Id() const + { + return m_id; + } + + bool SourceHandle::IsValid() const + { + return *this; + } + GraphPtr SourceHandle::Mod() const + { + return m_data ? m_data->ModEditorGraph() : nullptr; + } + + SourceHandle::operator bool() const + { + return m_data != nullptr; + } + + bool SourceHandle::operator!() const + { + return m_data == nullptr; + } + + const AZStd::string& SourceHandle::Path() const + { + return m_path; + } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h index 85f76280d2..e2b2ef5919 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h @@ -20,7 +20,7 @@ #include #include #include - +#include #include #include @@ -318,7 +318,39 @@ namespace ScriptCanvasEditor using GraphPtr = Graph*; using GraphPtrConst = const Graph*; - class SourceHandle; + class SourceHandle + { + public: + AZ_TYPE_INFO(SourceHandle, "{65855A98-AE2F-427F-BFC8-69D45265E312}"); + AZ_CLASS_ALLOCATOR(SourceHandle, AZ::SystemAllocator, 0); + + SourceHandle() = default; + + SourceHandle(ScriptCanvas::DataPtr graph, const AZ::Uuid& id, AZStd::string_view path); + + void Clear(); + + GraphPtrConst Get() const; + + const AZ::Uuid& Id() const; + + bool IsValid() const; + + GraphPtr Mod() const; + + operator bool() const; + + bool operator!() const; + + const AZStd::string& Path() const; + + AZStd::string ToString() const; + + private: + ScriptCanvas::DataPtr m_data; + AZ::Uuid m_id = AZ::Uuid::CreateNull(); + AZStd::string m_path; + }; } namespace AZStd From bc342df6b4898ae2bebc61cce7b19c2e47cecb5b Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Fri, 29 Oct 2021 16:23:20 -0700 Subject: [PATCH 044/948] initial compile of detailed path of change to regular sc files Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Asset/EditorAssetSystemComponent.cpp | 33 ++-- .../Editor/Assets/ScriptCanvasAssetHolder.cpp | 49 +++--- .../Code/Editor/Components/EditorGraph.cpp | 3 +- .../EditorScriptCanvasComponent.cpp | 11 +- .../FunctionNodeDescriptorComponent.cpp | 2 +- .../Assets/ScriptCanvasBaseAssetData.cpp | 23 --- .../Assets/ScriptCanvasBaseAssetData.h | 28 +--- .../Include/ScriptCanvas/Bus/RequestBus.h | 14 +- .../Components/EditorScriptCanvasComponent.h | 3 +- Gems/ScriptCanvas/Code/Editor/Settings.cpp | 40 ++--- Gems/ScriptCanvas/Code/Editor/Settings.h | 1 + .../Code/Editor/SystemComponent.cpp | 94 +++++------ .../Code/Editor/Utilities/RecentAssetPath.cpp | 9 +- .../Code/Editor/Utilities/RecentAssetPath.h | 1 + .../Code/Editor/View/Widgets/CanvasWidget.cpp | 7 - .../Code/Editor/View/Widgets/GraphTabBar.cpp | 151 +++++++++--------- .../LoggingPanel/LoggingWindowSession.cpp | 18 +-- .../LoggingPanel/LoggingWindowTreeItems.cpp | 98 ++++++------ .../PivotTree/PivotTreeWidget.cpp | 24 +-- .../FunctionNodePaletteTreeItemTypes.cpp | 8 +- .../ScriptCanvasStatisticsDialog.cpp | 3 +- .../UnitTestPanel/UnitTestDockWidget.cpp | 2 +- .../Code/Editor/View/Windows/MainWindow.cpp | 68 ++++---- .../Tools/UpgradeTool/UpgradeHelper.cpp | 3 +- .../Code/Include/ScriptCanvas/Core/Core.cpp | 35 ++++ .../Code/Include/ScriptCanvas/Core/Core.h | 31 ++++ 26 files changed, 390 insertions(+), 369 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp index 4df2a57c36..1c383d04bd 100644 --- a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp @@ -122,7 +122,7 @@ namespace ScriptCanvasEditor return ScriptCanvasBuilder::CreateLuaAsset(editAsset->GetScriptCanvasEntity(), editAsset->GetId(), graphPathForRawLuaFile); } - void EditorAssetSystemComponent::AddSourceFileOpeners([[maybe_unused]] const char* fullSourceFileName, const AZ::Uuid& sourceUuid, AzToolsFramework::AssetBrowser::SourceFileOpenerList& openers) + void EditorAssetSystemComponent::AddSourceFileOpeners([[maybe_unused]] const char* fullSourceFileName, [[maybe_unused]] const AZ::Uuid& sourceUuid, [[maybe_unused]] AzToolsFramework::AssetBrowser::SourceFileOpenerList& openers) { using namespace AzToolsFramework; using namespace AzToolsFramework::AssetBrowser; @@ -139,21 +139,22 @@ namespace ScriptCanvasEditor return; } // You can push back any number of "Openers" - choose a unique identifier, and icon, and then a lambda which will be activated if the user chooses to open it with your opener: - openers.push_back({ "ScriptCanvas_Editor_Asset_Edit", "Script Canvas Editor...", QIcon(), - [](const char*, const AZ::Uuid& scSourceUuid) - { - AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); - AZ::Data::AssetId sourceAssetId(scSourceUuid, 0); - - auto& assetManager = AZ::Data::AssetManager::Instance(); - AZ::Data::Asset scriptCanvasAsset = assetManager.GetAsset(sourceAssetId, azrtti_typeid(), AZ::Data::AssetLoadBehavior::Default); - AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); - GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, scriptCanvasAsset.GetId(), -1); - if (!openOutcome) - { - AZ_Warning("Script Canvas", openOutcome, "%s", openOutcome.GetError().data()); - } - } }); + // #sc_editor_asset + // openers.push_back({ "ScriptCanvas_Editor_Asset_Edit", "Script Canvas Editor...", QIcon(), +// [](const char*, const AZ::Uuid& scSourceUuid) +// { +// AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); +// AZ::Data::AssetId sourceAssetId(scSourceUuid, 0); +// +// auto& assetManager = AZ::Data::AssetManager::Instance(); +// AZ::Data::Asset scriptCanvasAsset = assetManager.GetAsset(sourceAssetId, azrtti_typeid(), AZ::Data::AssetLoadBehavior::Default); +// AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); +// GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, scriptCanvasAsset.GetId(), -1); +// if (!openOutcome) +// { +// AZ_Warning("Script Canvas", openOutcome, "%s", openOutcome.GetError().data()); +// } +// } }); } } diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHolder.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHolder.cpp index a42a9bad48..c5c08d5bbe 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHolder.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHolder.cpp @@ -82,30 +82,31 @@ namespace ScriptCanvasEditor void ScriptCanvasAssetHolder::OpenEditor() const { - AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); - - AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); - - if (m_scriptCanvasAsset.IsReady()) - { - GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, m_scriptCanvasAsset.GetId(), -1); - - if (!openOutcome) - { - AZ_Warning("Script Canvas", openOutcome, "%s", openOutcome.GetError().data()); - } - } - else if (m_ownerId.first.IsValid()) - { - AzToolsFramework::EntityIdList selectedEntityIds; - AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult(selectedEntityIds, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities); - - // Going to bypass the multiple selected entities flow for right now. - if (selectedEntityIds.size() == 1) - { - GeneralRequestBus::Broadcast(&GeneralRequests::CreateScriptCanvasAssetFor, m_ownerId); - } - } + // #sc_editor_asset +// AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); +// +// AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); +// +// if (m_scriptCanvasAsset.IsReady()) +// { +// GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, m_scriptCanvasAsset.GetId(), -1); +// +// if (!openOutcome) +// { +// AZ_Warning("Script Canvas", openOutcome, "%s", openOutcome.GetError().data()); +// } +// } +// else if (m_ownerId.first.IsValid()) +// { +// AzToolsFramework::EntityIdList selectedEntityIds; +// AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult(selectedEntityIds, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities); +// +// // Going to bypass the multiple selected entities flow for right now. +// if (selectedEntityIds.size() == 1) +// { +// GeneralRequestBus::Broadcast(&GeneralRequests::CreateScriptCanvasAssetFor, m_ownerId); +// } +// } } ScriptCanvas::ScriptCanvasId ScriptCanvasAssetHolder::GetScriptCanvasId() const diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp index fc2c2ace41..c70e4b74f3 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp @@ -1342,7 +1342,8 @@ namespace ScriptCanvasEditor void Graph::SignalDirty() { - GeneralRequestBus::Broadcast(&GeneralRequests::SignalSceneDirty, GetAssetId()); + // #sc_editor_asset + // GeneralRequestBus::Broadcast(&GeneralRequests::SignalSceneDirty, GetAssetId()); } void Graph::HighlightNodesByType(const ScriptCanvas::NodeTypeIdentifier& nodeTypeIdentifier) diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index 043e034062..d73273103c 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -247,21 +247,12 @@ namespace ScriptCanvasEditor m_scriptCanvasAssetHolder.OpenEditor(); } - void EditorScriptCanvasComponent::CloseGraph() - { - AZ::Data::AssetId assetId = m_scriptCanvasAssetHolder.GetAssetId(); - if (assetId.IsValid()) - { - GeneralRequestBus::Broadcast(&GeneralRequests::CloseScriptCanvasAsset, assetId); - } - } - void EditorScriptCanvasComponent::Init() { EditorComponentBase::Init(); AzFramework::AssetCatalogEventBus::Handler::BusConnect(); AzToolsFramework::EditorEntityContextNotificationBus::Handler::BusConnect(); - m_scriptCanvasAssetHolder.Init(GetEntityId(), GetId()); + // m_scriptCanvasAssetHolder.Init(GetEntityId(), GetId()); } //========================================================================= diff --git a/Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/FunctionNodeDescriptorComponent.cpp b/Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/FunctionNodeDescriptorComponent.cpp index db41fa70ca..f649bb9f7d 100644 --- a/Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/FunctionNodeDescriptorComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/FunctionNodeDescriptorComponent.cpp @@ -97,7 +97,7 @@ namespace ScriptCanvasEditor } AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); - GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, assetInfo.m_assetId, -1); + GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, SourceHandle( nullptr, assetInfo.m_assetId.m_guid, {} ), -1); return openOutcome.IsSuccess(); } diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.cpp b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.cpp index 2b451b0de8..efb20e3518 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.cpp @@ -7,27 +7,4 @@ */ #include -#include -namespace ScriptCanvas -{ - const Graph* ScriptCanvasData::GetGraph() const - { - return AZ::EntityUtils::FindFirstDerivedComponent(m_scriptCanvasEntity.get()); - } - - const ScriptCanvasEditor::Graph* ScriptCanvasData::GetEditorGraph() const - { - return AZ::EntityUtils::FindFirstDerivedComponent(m_scriptCanvasEntity.get()); - } - - Graph* ScriptCanvasData::ModGraph() - { - return AZ::EntityUtils::FindFirstDerivedComponent(m_scriptCanvasEntity.get()); - } - - ScriptCanvasEditor::Graph* ScriptCanvasData::ModEditorGraph() - { - return AZ::EntityUtils::FindFirstDerivedComponent(m_scriptCanvasEntity.get()); - } -} diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.h index 5340f1128a..7597da9081 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.h @@ -13,31 +13,5 @@ namespace ScriptCanvas { - class ScriptCanvasData - { - public: - - AZ_RTTI(ScriptCanvasData, "{1072E894-0C67-4091-8B64-F7DB324AD13C}"); - AZ_CLASS_ALLOCATOR(ScriptCanvasData, AZ::SystemAllocator, 0); - ScriptCanvasData() {} - virtual ~ScriptCanvasData() {} - ScriptCanvasData(ScriptCanvasData&& other); - ScriptCanvasData& operator=(ScriptCanvasData&& other); - - static void Reflect(AZ::ReflectContext* reflectContext); - - AZ::Entity* GetScriptCanvasEntity() const { return m_scriptCanvasEntity.get(); } - - const Graph* GetGraph() const; - - const ScriptCanvasEditor::Graph* GetEditorGraph() const; - - Graph* ModGraph(); - - ScriptCanvasEditor::Graph* ModEditorGraph(); - - AZStd::unique_ptr m_scriptCanvasEntity; - private: - ScriptCanvasData(const ScriptCanvasData&) = delete; - }; + } diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h index 2d9a7d6b58..8dbaf5b31a 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h @@ -8,18 +8,16 @@ #pragma once -#include -#include -#include #include -#include +#include +#include +#include #include - +#include #include - -#include #include - +#include +#include #include class QLineEdit; diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h index 5dbe718eca..87ffff8b19 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h @@ -67,8 +67,7 @@ namespace ScriptCanvasEditor //===================================================================== void OpenEditor(); - void CloseGraph(); - + void SetName(const AZStd::string& name) { m_name = name; } const AZStd::string& GetName() const; AZ::EntityId GetEditorEntityId() const { return GetEntity() ? GetEntityId() : AZ::EntityId(); } diff --git a/Gems/ScriptCanvas/Code/Editor/Settings.cpp b/Gems/ScriptCanvas/Code/Editor/Settings.cpp index 8d24a30aab..997ef4eadf 100644 --- a/Gems/ScriptCanvas/Code/Editor/Settings.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Settings.cpp @@ -92,13 +92,11 @@ namespace ScriptCanvasEditor // WorkspaceAssetSaveData EditorWorkspace::WorkspaceAssetSaveData::WorkspaceAssetSaveData() - : m_assetType(azrtti_typeid()) { } - EditorWorkspace::WorkspaceAssetSaveData::WorkspaceAssetSaveData(const AZ::Data::AssetId& assetId) + EditorWorkspace::WorkspaceAssetSaveData::WorkspaceAssetSaveData(SourceHandle assetId) : m_assetId(assetId) - , m_assetType(azrtti_typeid()) { } @@ -108,24 +106,31 @@ namespace ScriptCanvasEditor { AZStd::vector assetSaveData; AZStd::vector assetIds; - auto subElement = rootDataElementNode.FindSubElement(AZ_CRC("ActiveAssetIds", 0xe445268a)); + auto subElement = rootDataElementNode.FindSubElement(AZ_CRC_CE("ActiveAssetIds")); if (subElement) { - if (subElement->GetData(assetIds)) - { - assetSaveData.reserve(assetIds.size()); - for (const AZ::Data::AssetId& assetId : assetIds) - { - assetSaveData.emplace_back(assetId); - } - } +// #sc_editor_asset +// if (subElement->GetData(assetIds)) +// { +// assetSaveData.reserve(assetIds.size()); +// for (const AZ::Data::AssetId& assetId : assetIds) +// { +// assetSaveData.emplace_back(assetId); +// } +// } } - rootDataElementNode.RemoveElementByName(AZ_CRC("ActiveAssetIds", 0xe445268a)); + rootDataElementNode.RemoveElementByName(AZ_CRC_CE("ActiveAssetIds")); rootDataElementNode.AddElementWithData(context, "ActiveAssetData", assetSaveData); } + if (rootDataElementNode.GetVersion() < 4) + { + rootDataElementNode.RemoveElementByName(AZ_CRC_CE("ActiveAssetIds")); + rootDataElementNode.RemoveElementByName(AZ_CRC_CE("FocusedAssetId")); + } + return true; } @@ -135,13 +140,12 @@ namespace ScriptCanvasEditor if (serialize) { serialize->Class() - ->Version(1) + ->Version(2) ->Field("AssetId", &WorkspaceAssetSaveData::m_assetId) - ->Field("AssetType", &WorkspaceAssetSaveData::m_assetType) ; serialize->Class() - ->Version(3, &EditorWorkspace::VersionConverter) + ->Version(4, &EditorWorkspace::VersionConverter) ->Field("m_storedWindowState", &EditorWorkspace::m_storedWindowState) ->Field("m_windowGeometry", &EditorWorkspace::m_windowGeometry) ->Field("FocusedAssetId", &EditorWorkspace::m_focusedAssetId) @@ -150,13 +154,13 @@ namespace ScriptCanvasEditor } } - void EditorWorkspace::ConfigureActiveAssets(AZ::Data::AssetId focussedAssetId, const AZStd::vector< WorkspaceAssetSaveData >& activeAssetData) + void EditorWorkspace::ConfigureActiveAssets(SourceHandle focussedAssetId, const AZStd::vector< WorkspaceAssetSaveData >& activeAssetData) { m_focusedAssetId = focussedAssetId; m_activeAssetData = activeAssetData; } - AZ::Data::AssetId EditorWorkspace::GetFocusedAssetId() const + SourceHandle EditorWorkspace::GetFocusedAssetId() const { return m_focusedAssetId; } diff --git a/Gems/ScriptCanvas/Code/Editor/Settings.h b/Gems/ScriptCanvas/Code/Editor/Settings.h index 8359e2a580..27039d8a70 100644 --- a/Gems/ScriptCanvas/Code/Editor/Settings.h +++ b/Gems/ScriptCanvas/Code/Editor/Settings.h @@ -11,6 +11,7 @@ #include #include #include +#include // qdatastream.h(173): warning C4251: 'QDataStream::d': class 'QScopedPointer>' needs to have dll-interface to be used by clients of class 'QDataStream' // qwidget.h(858): warning C4800: 'uint': forcing value to bool 'true' or 'false' (performance warning) diff --git a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp index f901915fdb..0246071172 100644 --- a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp @@ -209,7 +209,7 @@ namespace ScriptCanvasEditor if (!entitiesWithScriptCanvas.empty()) { QMenu* scriptCanvasMenu = nullptr; - QAction* action = nullptr; + // QAction* action = nullptr; // For entities with script canvas component, create a context menu to open any existing script canvases within each selected entity. for (const AZ::EntityId& entityId : entitiesWithScriptCanvas) @@ -242,31 +242,32 @@ namespace ScriptCanvasEditor AZStd::unordered_set< AZ::Data::AssetId > usedIds; - for (const auto& assetId : assetIds.values) - { - if (!assetId.IsValid() || usedIds.count(assetId) != 0) - { - continue; - } - - entityMenu->setEnabled(true); - - usedIds.insert(assetId); - - AZStd::string rootPath; - AZ::Data::AssetInfo assetInfo = AssetHelpers::GetAssetInfo(assetId, rootPath); - - AZStd::string displayName; - AZ::StringFunc::Path::GetFileName(assetInfo.m_relativePath.c_str(), displayName); - - action = entityMenu->addAction(QString("%1").arg(QString(displayName.c_str()))); - - QObject::connect(action, &QAction::triggered, [assetId] - { - AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); - GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAsset, assetId, -1); - }); - } + //#sc_editor_asset +// for (const auto& assetId : assetIds.values) +// { +// if (!assetId.IsValid() || usedIds.count(assetId) != 0) +// { +// continue; +// } +// +// entityMenu->setEnabled(true); +// +// usedIds.insert(assetId); +// +// AZStd::string rootPath; +// AZ::Data::AssetInfo assetInfo = AssetHelpers::GetAssetInfo(assetId, rootPath); +// +// AZStd::string displayName; +// AZ::StringFunc::Path::GetFileName(assetInfo.m_relativePath.c_str(), displayName); +// +// action = entityMenu->addAction(QString("%1").arg(QString(displayName.c_str()))); +// +// QObject::connect(action, &QAction::triggered, [assetId] +// { +// AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); +// GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAsset, assetId, -1); +// }); +// } } } } @@ -301,7 +302,10 @@ namespace ScriptCanvasEditor return AzToolsFramework::AssetBrowser::SourceFileDetails(); } - void SystemComponent::AddSourceFileOpeners(const char* fullSourceFileName, [[maybe_unused]] const AZ::Uuid& sourceUUID, AzToolsFramework::AssetBrowser::SourceFileOpenerList& openers) + void SystemComponent::AddSourceFileOpeners + ( [[maybe_unused]] const char* fullSourceFileName + , [[maybe_unused]] const AZ::Uuid& sourceUUID + , [[maybe_unused]] AzToolsFramework::AssetBrowser::SourceFileOpenerList& openers) { using namespace AzToolsFramework; using namespace AzToolsFramework::AssetBrowser; @@ -312,24 +316,24 @@ namespace ScriptCanvasEditor { isScriptCanvasAsset = true; } - - if (isScriptCanvasAsset) - { - auto scriptCanvasEditorCallback = []([[maybe_unused]] const char* fullSourceFileNameInCall, const AZ::Uuid& sourceUUIDInCall) - { - AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); - const SourceAssetBrowserEntry* fullDetails = SourceAssetBrowserEntry::GetSourceByUuid(sourceUUIDInCall); - if (fullDetails) - { - AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); - - AzToolsFramework::EditorRequests::Bus::Broadcast(&AzToolsFramework::EditorRequests::OpenViewPane, "Script Canvas"); - GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, sourceUUIDInCall, -1); - } - }; - - openers.push_back({ "O3DE_ScriptCanvasEditor", "Open In Script Canvas Editor...", QIcon(), scriptCanvasEditorCallback }); - } + // #sc_editor_asset +// if (isScriptCanvasAsset) +// { +// auto scriptCanvasEditorCallback = []([[maybe_unused]] const char* fullSourceFileNameInCall, const AZ::Uuid& sourceUUIDInCall) +// { +// AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); +// const SourceAssetBrowserEntry* fullDetails = SourceAssetBrowserEntry::GetSourceByUuid(sourceUUIDInCall); +// if (fullDetails) +// { +// AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); +// +// AzToolsFramework::EditorRequests::Bus::Broadcast(&AzToolsFramework::EditorRequests::OpenViewPane, "Script Canvas"); +// GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, sourceUUIDInCall, -1); +// } +// }; +// +// openers.push_back({ "O3DE_ScriptCanvasEditor", "Open In Script Canvas Editor...", QIcon(), scriptCanvasEditorCallback }); +// } } void SystemComponent::OnUserSettingsActivated() diff --git a/Gems/ScriptCanvas/Code/Editor/Utilities/RecentAssetPath.cpp b/Gems/ScriptCanvas/Code/Editor/Utilities/RecentAssetPath.cpp index f2da3868de..5d415f5fd9 100644 --- a/Gems/ScriptCanvas/Code/Editor/Utilities/RecentAssetPath.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Utilities/RecentAssetPath.cpp @@ -26,12 +26,7 @@ namespace ScriptCanvasEditor recentOpenFileLocation = settings.value(SCRIPTCANVASEDITOR_SETTINGS_RECENT_OPEN_FILE_LOCATION_KEY).toString(); settings.endGroup(); - if (recentOpenFileLocation.isEmpty()) - { - return {}; - } - AZ::Data::AssetId assetId(recentOpenFileLocation.toUtf8().constData()); - return assetId; + return { nullptr, {}, recentOpenFileLocation.toUtf8().constData() }; } void SetRecentAssetId(SourceHandle assetId) @@ -39,7 +34,7 @@ namespace ScriptCanvasEditor QSettings settings(QSettings::IniFormat, QSettings::UserScope, SCRIPTCANVASEDITOR_AZ_QCOREAPPLICATION_SETTINGS_ORGANIZATION_NAME); - AZStd::string guidStr = assetId.m_guid.ToString(); + AZStd::string guidStr = assetId.Id().ToString(); settings.beginGroup(SCRIPTCANVASEDITOR_NAME_SHORT); settings.setValue(SCRIPTCANVASEDITOR_SETTINGS_RECENT_OPEN_FILE_LOCATION_KEY, diff --git a/Gems/ScriptCanvas/Code/Editor/Utilities/RecentAssetPath.h b/Gems/ScriptCanvas/Code/Editor/Utilities/RecentAssetPath.h index 35666d7c34..aaef02ca58 100644 --- a/Gems/ScriptCanvas/Code/Editor/Utilities/RecentAssetPath.h +++ b/Gems/ScriptCanvas/Code/Editor/Utilities/RecentAssetPath.h @@ -8,6 +8,7 @@ #pragma once #include +#include namespace ScriptCanvasEditor { diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/CanvasWidget.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/CanvasWidget.cpp index dfa39b0047..359d262d6c 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/CanvasWidget.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/CanvasWidget.cpp @@ -69,8 +69,6 @@ namespace ScriptCanvasEditor void CanvasWidget::ShowScene(const ScriptCanvas::ScriptCanvasId& scriptCanvasId) { EditorGraphRequests* editorGraphRequests = EditorGraphRequestBus::FindFirstHandler(scriptCanvasId); - - editorGraphRequests->SetAssetId(m_assetId); editorGraphRequests->CreateGraphCanvasScene(); AZ::EntityId graphCanvasSceneId = editorGraphRequests->GetGraphCanvasGraphId(); @@ -83,11 +81,6 @@ namespace ScriptCanvasEditor void CanvasWidget::SetAssetId(const AZ::Data::AssetId& assetId) { m_assetId = assetId; - - if (EditorGraphRequests* editorGraphRequests = EditorGraphRequestBus::FindFirstHandler(m_scriptCanvasId)) - { - editorGraphRequests->SetAssetId(m_assetId); - } } const GraphCanvas::ViewId& CanvasWidget::GetViewId() const diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp index f2963287c6..6db4b5bd3e 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp @@ -44,49 +44,50 @@ namespace ScriptCanvasEditor connect(this, &QTabBar::customContextMenuRequested, this, &GraphTabBar::OnContextMenu); } - void GraphTabBar::AddGraphTab(const AZ::Data::AssetId& assetId) + void GraphTabBar::AddGraphTab(ScriptCanvasEditor::SourceHandle assetId) { InsertGraphTab(count(), assetId); } - int GraphTabBar::InsertGraphTab(int tabIndex, const AZ::Data::AssetId& assetId) + int GraphTabBar::InsertGraphTab([[maybe_unused]] int tabIndex, [[maybe_unused]] ScriptCanvasEditor::SourceHandle assetId) { - if (!SelectTab(assetId)) - { - AZStd::shared_ptr memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); - - if (memoryAsset) - { - ScriptCanvas::AssetDescription assetDescription = memoryAsset->GetAsset().Get()->GetAssetDescription(); - - QIcon tabIcon = QIcon(assetDescription.GetIconPathImpl()); - int newTabIndex = qobject_cast(parent())->insertTab(tabIndex, new QWidget(), tabIcon, ""); - - CanvasWidget* canvasWidget = memoryAsset->CreateView(this); - - canvasWidget->SetDefaultBorderColor(assetDescription.GetDisplayColorImpl()); - - AZStd::string tabName; - AzFramework::StringFunc::Path::GetFileName(memoryAsset->GetAbsolutePath().c_str(), tabName); - - ConfigureTab(newTabIndex, assetId, tabName); - - // new graphs will need to use their in-memory assetid which we'll need to update - // upon saving the asset - if (!memoryAsset->GetFileAssetId().IsValid()) - { - setTabData(newTabIndex, QVariant::fromValue(memoryAsset->GetId())); - } - - return newTabIndex; - } - } + // #sc_editor_asset + // if (!SelectTab(assetId)) +// { +// AZStd::shared_ptr memoryAsset; +// AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); +// +// if (memoryAsset) +// { +// ScriptCanvas::AssetDescription assetDescription = memoryAsset->GetAsset().Get()->GetAssetDescription(); +// +// QIcon tabIcon = QIcon(assetDescription.GetIconPathImpl()); +// int newTabIndex = qobject_cast(parent())->insertTab(tabIndex, new QWidget(), tabIcon, ""); +// +// CanvasWidget* canvasWidget = memoryAsset->CreateView(this); +// +// canvasWidget->SetDefaultBorderColor(assetDescription.GetDisplayColorImpl()); +// +// AZStd::string tabName; +// AzFramework::StringFunc::Path::GetFileName(memoryAsset->GetAbsolutePath().c_str(), tabName); +// +// ConfigureTab(newTabIndex, assetId, tabName); +// +// // new graphs will need to use their in-memory assetid which we'll need to update +// // upon saving the asset +// if (!memoryAsset->GetFileAssetId().IsValid()) +// { +// setTabData(newTabIndex, QVariant::fromValue(memoryAsset->GetId())); +// } +// +// return newTabIndex; +// } +// } return -1; } - bool GraphTabBar::SelectTab(const AZ::Data::AssetId& assetId) + bool GraphTabBar::SelectTab(ScriptCanvasEditor::SourceHandle assetId) { int tabIndex = FindTab(assetId); if (-1 != tabIndex) @@ -97,7 +98,7 @@ namespace ScriptCanvasEditor return false; } - void GraphTabBar::ConfigureTab(int tabIndex, AZ::Data::AssetId fileAssetId, const AZStd::string& tabName) + void GraphTabBar::ConfigureTab(int tabIndex, ScriptCanvasEditor::SourceHandle fileAssetId, const AZStd::string& tabName) { if (fileAssetId.IsValid()) { @@ -105,29 +106,32 @@ namespace ScriptCanvasEditor if (tabDataVariant.isValid()) { - auto tabAssetId = tabDataVariant.value(); - MemoryAssetNotificationBus::MultiHandler::BusDisconnect(tabAssetId); + // #se_editor_asset + // auto tabAssetId = tabDataVariant.value(); + // MemoryAssetNotificationBus::MultiHandler::BusDisconnect(tabAssetId); } setTabData(tabIndex, QVariant::fromValue(fileAssetId)); - MemoryAssetNotificationBus::MultiHandler::BusConnect(fileAssetId); + // #se_editor_asset + // MemoryAssetNotificationBus::MultiHandler::BusConnect(fileAssetId); } + // #se_editor_asset Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::INVALID; - AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, fileAssetId); + // AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, fileAssetId); SetTabText(tabIndex, tabName.c_str(), fileState); } - int GraphTabBar::FindTab(const AZ::Data::AssetId& assetId) const + int GraphTabBar::FindTab(ScriptCanvasEditor::SourceHandle assetId) const { for (int tabIndex = 0; tabIndex < count(); ++tabIndex) { QVariant tabDataVariant = tabData(tabIndex); if (tabDataVariant.isValid()) { - auto tabAssetId = tabDataVariant.value(); + auto tabAssetId = tabDataVariant.value(); if (tabAssetId == assetId) { return tabIndex; @@ -137,16 +141,16 @@ namespace ScriptCanvasEditor return -1; } - AZ::Data::AssetId GraphTabBar::FindAssetId(int tabIndex) + ScriptCanvasEditor::SourceHandle GraphTabBar::FindAssetId(int tabIndex) { QVariant dataVariant = tabData(tabIndex); if (dataVariant.isValid()) { - auto tabAssetId = dataVariant.value(); + auto tabAssetId = dataVariant.value(); return tabAssetId; } - return AZ::Data::AssetId(); + return ScriptCanvasEditor::SourceHandle(); } void GraphTabBar::CloseTab(int index) @@ -263,19 +267,20 @@ namespace ScriptCanvasEditor AzQtComponents::TabBar::mouseReleaseEvent(event); } - void GraphTabBar::OnFileStateChanged(Tracker::ScriptCanvasFileState fileState) + void GraphTabBar::OnFileStateChanged(Tracker::ScriptCanvasFileState ) { - const AZ::Data::AssetId* fileAssetId = MemoryAssetNotificationBus::GetCurrentBusId(); - - if (fileAssetId) - { - SetFileState((*fileAssetId), fileState); - - if (FindTab((*fileAssetId)) == currentIndex()) - { - Q_EMIT OnActiveFileStateChanged(); - } - } + // #se_editor_asset + // const AZ::Data::AssetId* fileAssetId = MemoryAssetNotificationBus::GetCurrentBusId(); + +// if (fileAssetId) +// { +// SetFileState((*fileAssetId), fileState); +// +// if (FindTab((*fileAssetId)) == currentIndex()) +// { +// Q_EMIT OnActiveFileStateChanged(); +// } +// } } void GraphTabBar::SetTabText(int tabIndex, const QString& path, Tracker::ScriptCanvasFileState fileState) @@ -329,7 +334,8 @@ namespace ScriptCanvasEditor auto assetId = tabdata.value(); - ScriptCanvasEditor::GeneralRequestBus::Broadcast(&ScriptCanvasEditor::GeneralRequests::OnChangeActiveGraphTab, assetId); + // #sc_editor_asset + // ScriptCanvasEditor::GeneralRequestBus::Broadcast(&ScriptCanvasEditor::GeneralRequests::OnChangeActiveGraphTab, assetId); if (m_signalSaveOnChangeTo >= 0 && m_signalSaveOnChangeTo == index) { @@ -338,22 +344,23 @@ namespace ScriptCanvasEditor } } - void GraphTabBar::SetFileState(AZ::Data::AssetId assetId, Tracker::ScriptCanvasFileState fileState) + void GraphTabBar::SetFileState(ScriptCanvasEditor::SourceHandle, Tracker::ScriptCanvasFileState ) { - int index = FindTab(assetId); - - if (index >= 0 && index < count()) - { - QVariant tabdata = tabData(index); - if (tabdata.isValid()) - { - auto tabAssetId = tabdata.value(); - - AZStd::string tabName; - AssetTrackerRequestBus::BroadcastResult(tabName, &AssetTrackerRequests::GetTabName, tabAssetId); - SetTabText(index, tabName.c_str(), fileState); - } - } + // #se_editor_asset + // int index = FindTab(assetId); + +// if (index >= 0 && index < count()) +// { +// QVariant tabdata = tabData(index); +// if (tabdata.isValid()) +// { +// auto tabAssetId = tabdata.value(); +// +// AZStd::string tabName; +// AssetTrackerRequestBus::BroadcastResult(tabName, &AssetTrackerRequests::GetTabName, tabAssetId); +// SetTabText(index, tabName.c_str(), fileState); +// } +// } } #include diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowSession.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowSession.cpp index 5fadb0a81e..2e712cef08 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowSession.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowSession.cpp @@ -256,7 +256,7 @@ namespace ScriptCanvasEditor const AZ::Data::AssetId& assetId = executionItem->GetAssetId(); - GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAssetId, assetId); + GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAssetId, SourceHandle(nullptr, assetId.m_guid, {})); } } } @@ -270,12 +270,12 @@ namespace ScriptCanvasEditor const AZ::Data::AssetId& assetId = executionItem->GetAssetId(); bool isAssetOpen = false; - GeneralRequestBus::BroadcastResult(isAssetOpen, &GeneralRequests::IsScriptCanvasAssetOpen, assetId); + GeneralRequestBus::BroadcastResult(isAssetOpen, &GeneralRequests::IsScriptCanvasAssetOpen, SourceHandle(nullptr, assetId.m_guid, {})); - GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAssetId, assetId); + GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAssetId, SourceHandle(nullptr, assetId.m_guid, {})); AZ::EntityId graphCanvasGraphId; - GeneralRequestBus::BroadcastResult(graphCanvasGraphId, &GeneralRequests::FindGraphCanvasGraphIdByAssetId, assetId); + GeneralRequestBus::BroadcastResult(graphCanvasGraphId, &GeneralRequests::FindGraphCanvasGraphIdByAssetId, SourceHandle(nullptr, assetId.m_guid, {})); if (isAssetOpen) { @@ -348,7 +348,7 @@ namespace ScriptCanvasEditor GeneralRequestBus::BroadcastResult(activeGraphCanvasGraphId, &GeneralRequests::GetActiveGraphCanvasGraphId); AZ::EntityId graphCanvasGraphId; - GeneralRequestBus::BroadcastResult(graphCanvasGraphId, &GeneralRequests::FindGraphCanvasGraphIdByAssetId, m_assetId); + GeneralRequestBus::BroadcastResult(graphCanvasGraphId, &GeneralRequests::FindGraphCanvasGraphIdByAssetId, SourceHandle(nullptr, m_assetId.m_guid, {})); if (activeGraphCanvasGraphId == graphCanvasGraphId) { @@ -366,7 +366,7 @@ namespace ScriptCanvasEditor GraphCanvas::FocusConfig focusConfig; AZ::EntityId scriptCanvasNodeId; - AssetGraphSceneBus::BroadcastResult(scriptCanvasNodeId, &AssetGraphScene::FindEditorNodeIdByAssetNodeId, assetId, assetNodeId); + AssetGraphSceneBus::BroadcastResult(scriptCanvasNodeId, &AssetGraphScene::FindEditorNodeIdByAssetNodeId, SourceHandle(nullptr, assetId.m_guid, {}), assetNodeId); GraphCanvas::NodeId graphCanvasNodeId; SceneMemberMappingRequestBus::EventResult(graphCanvasNodeId, scriptCanvasNodeId, &SceneMemberMappingRequests::GetGraphCanvasEntityId); @@ -403,12 +403,12 @@ namespace ScriptCanvasEditor void LoggingWindowSession::HighlightElement(const AZ::Data::AssetId& assetId, const AZ::EntityId& assetNodeId) { AZ::EntityId graphCanvasGraphId; - GeneralRequestBus::BroadcastResult(graphCanvasGraphId, &GeneralRequests::FindGraphCanvasGraphIdByAssetId, assetId); + GeneralRequestBus::BroadcastResult(graphCanvasGraphId, &GeneralRequests::FindGraphCanvasGraphIdByAssetId, SourceHandle(nullptr, assetId.m_guid, {})); if (graphCanvasGraphId.IsValid()) { AZ::EntityId scriptCanvasNodeId; - AssetGraphSceneBus::BroadcastResult(scriptCanvasNodeId, &AssetGraphScene::FindEditorNodeIdByAssetNodeId, assetId, assetNodeId); + AssetGraphSceneBus::BroadcastResult(scriptCanvasNodeId, &AssetGraphScene::FindEditorNodeIdByAssetNodeId, SourceHandle(nullptr, assetId.m_guid, {}), assetNodeId); GraphCanvas::NodeId graphCanvasNodeId; SceneMemberMappingRequestBus::EventResult(graphCanvasNodeId, scriptCanvasNodeId, &SceneMemberMappingRequests::GetGraphCanvasEntityId); @@ -447,7 +447,7 @@ namespace ScriptCanvasEditor if (effectIter != m_highlightEffects.end()) { AZ::EntityId graphCanvasGraphId; - GeneralRequestBus::BroadcastResult(graphCanvasGraphId, &GeneralRequests::FindGraphCanvasGraphIdByAssetId, assetId); + GeneralRequestBus::BroadcastResult(graphCanvasGraphId, &GeneralRequests::FindGraphCanvasGraphIdByAssetId, SourceHandle(nullptr, assetId.m_guid, {})); if (graphCanvasGraphId.IsValid()) { diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.cpp index b992d3a289..732aacc993 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.cpp @@ -621,50 +621,51 @@ namespace ScriptCanvasEditor void ExecutionLogTreeItem::ScrapeGraphCanvasData() { - if (!m_graphCanvasGraphId.IsValid()) - { - GeneralRequestBus::BroadcastResult(m_graphCanvasGraphId, &GeneralRequests::FindGraphCanvasGraphIdByAssetId, GetAssetId()); - - if (!EditorGraphNotificationBus::Handler::BusIsConnected()) - { - ScriptCanvas::ScriptCanvasId scriptCanvasId; - GeneralRequestBus::BroadcastResult(scriptCanvasId, &GeneralRequests::FindScriptCanvasIdByAssetId, GetAssetId()); - - EditorGraphNotificationBus::Handler::BusConnect(scriptCanvasId); - } - } - - if (m_graphCanvasGraphId.IsValid()) - { - if (!m_graphCanvasNodeId.IsValid()) - { - AssetGraphSceneBus::BroadcastResult(m_scriptCanvasNodeId, &AssetGraphScene::FindEditorNodeIdByAssetNodeId, GetAssetId(), m_scriptCanvasAssetNodeId); - SceneMemberMappingRequestBus::EventResult(m_graphCanvasNodeId, m_scriptCanvasNodeId, &SceneMemberMappingRequests::GetGraphCanvasEntityId); - } - - if (m_graphCanvasNodeId.IsValid()) - { - const bool refreshDisplayData = false; - ResolveWrapperNode(refreshDisplayData); - - AZStd::string displayName; - GraphCanvas::NodeTitleRequestBus::EventResult(displayName, m_graphCanvasNodeId, &GraphCanvas::NodeTitleRequests::GetTitle); - - if (!displayName.empty()) - { - m_displayName = displayName.c_str(); - } - - GraphCanvas::NodeTitleRequestBus::Event(m_graphCanvasNodeId, &GraphCanvas::NodeTitleRequests::ConfigureIconConfiguration, m_paletteConfiguration); - - OnStylesLoaded(); - - PopulateInputSlotData(); - PopulateOutputSlotData(); - - SignalDataChanged(); - } - } + // #sc_editor_asset +// if (!m_graphCanvasGraphId.IsValid()) +// { +// GeneralRequestBus::BroadcastResult(m_graphCanvasGraphId, &GeneralRequests::FindGraphCanvasGraphIdByAssetId, GetAssetId()); +// +// if (!EditorGraphNotificationBus::Handler::BusIsConnected()) +// { +// ScriptCanvas::ScriptCanvasId scriptCanvasId; +// GeneralRequestBus::BroadcastResult(scriptCanvasId, &GeneralRequests::FindScriptCanvasIdByAssetId, GetAssetId()); +// +// EditorGraphNotificationBus::Handler::BusConnect(scriptCanvasId); +// } +// } +// +// if (m_graphCanvasGraphId.IsValid()) +// { +// if (!m_graphCanvasNodeId.IsValid()) +// { +// AssetGraphSceneBus::BroadcastResult(m_scriptCanvasNodeId, &AssetGraphScene::FindEditorNodeIdByAssetNodeId, GetAssetId(), m_scriptCanvasAssetNodeId); +// SceneMemberMappingRequestBus::EventResult(m_graphCanvasNodeId, m_scriptCanvasNodeId, &SceneMemberMappingRequests::GetGraphCanvasEntityId); +// } +// +// if (m_graphCanvasNodeId.IsValid()) +// { +// const bool refreshDisplayData = false; +// ResolveWrapperNode(refreshDisplayData); +// +// AZStd::string displayName; +// GraphCanvas::NodeTitleRequestBus::EventResult(displayName, m_graphCanvasNodeId, &GraphCanvas::NodeTitleRequests::GetTitle); +// +// if (!displayName.empty()) +// { +// m_displayName = displayName.c_str(); +// } +// +// GraphCanvas::NodeTitleRequestBus::Event(m_graphCanvasNodeId, &GraphCanvas::NodeTitleRequests::ConfigureIconConfiguration, m_paletteConfiguration); +// +// OnStylesLoaded(); +// +// PopulateInputSlotData(); +// PopulateOutputSlotData(); +// +// SignalDataChanged(); +// } +// } } void ExecutionLogTreeItem::PopulateInputSlotData() @@ -806,7 +807,8 @@ namespace ScriptCanvasEditor { if (!m_graphCanvasGraphId.IsValid()) { - GeneralRequestBus::BroadcastResult(m_graphCanvasGraphId, &GeneralRequests::FindGraphCanvasGraphIdByAssetId, m_graphIdentifier.m_assetId); + // #sc_editor_asset + // GeneralRequestBus::BroadcastResult(m_graphCanvasGraphId, &GeneralRequests::FindGraphCanvasGraphIdByAssetId, m_graphIdentifier.m_assetId); } ScrapeInputName(); @@ -828,7 +830,8 @@ namespace ScriptCanvasEditor if (m_graphCanvasGraphId.IsValid() && m_assetInputEndpoint.IsValid()) { AZ::EntityId scriptCanvasNodeId; - AssetGraphSceneBus::BroadcastResult(scriptCanvasNodeId, &AssetGraphScene::FindEditorNodeIdByAssetNodeId, GetAssetId(), m_assetInputEndpoint.GetNodeId()); + // #sc_editor_asset + // AssetGraphSceneBus::BroadcastResult(scriptCanvasNodeId, &AssetGraphScene::FindEditorNodeIdByAssetNodeId, GetAssetId(), m_assetInputEndpoint.GetNodeId()); GraphCanvas::NodeId graphCanvasNodeId; SceneMemberMappingRequestBus::EventResult(graphCanvasNodeId, scriptCanvasNodeId, &SceneMemberMappingRequests::GetGraphCanvasEntityId); @@ -851,7 +854,8 @@ namespace ScriptCanvasEditor if (m_graphCanvasGraphId.IsValid() && m_assetOutputEndpoint.IsValid()) { AZ::EntityId scriptCanvasNodeId; - AssetGraphSceneBus::BroadcastResult(scriptCanvasNodeId, &AssetGraphScene::FindEditorNodeIdByAssetNodeId, GetAssetId(), m_assetOutputEndpoint.GetNodeId()); + // #sc_editor_asset + // AssetGraphSceneBus::BroadcastResult(scriptCanvasNodeId, &AssetGraphScene::FindEditorNodeIdByAssetNodeId, GetAssetId(), m_assetOutputEndpoint.GetNodeId()); GraphCanvas::NodeId graphCanvasNodeId; SceneMemberMappingRequestBus::EventResult(graphCanvasNodeId, scriptCanvasNodeId, &SceneMemberMappingRequests::GetGraphCanvasEntityId); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/PivotTree/PivotTreeWidget.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/PivotTree/PivotTreeWidget.cpp index a34b42bed8..d085ebbbcf 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/PivotTree/PivotTreeWidget.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/PivotTree/PivotTreeWidget.cpp @@ -405,18 +405,18 @@ namespace ScriptCanvasEditor { sourceIndex = proxyModel->mapToSource(modelIndex); } - - PivotTreeItem* pivotTreeItem = static_cast(sourceIndex.internalPointer()); - - if (pivotTreeItem) - { - PivotTreeGraphItem* graphItem = azrtti_cast(pivotTreeItem); - - if (graphItem) - { - GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAssetId, graphItem->GetAssetId()); - } - } + // #sc_editor_asset +// PivotTreeItem* pivotTreeItem = static_cast(sourceIndex.internalPointer()); +// +// if (pivotTreeItem) +// { +// PivotTreeGraphItem* graphItem = azrtti_cast(pivotTreeItem); +// +// if (graphItem) +// { +// GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAssetId, graphItem->GetAssetId()); +// } +// } } #include diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/FunctionNodePaletteTreeItemTypes.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/FunctionNodePaletteTreeItemTypes.cpp index 50a5e8ac1a..6473dcbb40 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/FunctionNodePaletteTreeItemTypes.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/FunctionNodePaletteTreeItemTypes.cpp @@ -129,7 +129,8 @@ namespace ScriptCanvasEditor { if (row == NodePaletteTreeItem::Column::Customization) { - GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAsset, GetSourceAssetId(), -1); + // #sc_editor_asset + // GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAsset, GetSourceAssetId(), -1); } } @@ -137,8 +138,9 @@ namespace ScriptCanvasEditor { if (row != NodePaletteTreeItem::Column::Customization) { - GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAsset, GetSourceAssetId(), -1); - return true; + // #sc_editor_asset + // GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAsset, GetSourceAssetId(), -1); + // return true; } return false; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/ScriptCanvasStatisticsDialog.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/ScriptCanvasStatisticsDialog.cpp index ece93955bb..9538a5732a 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/ScriptCanvasStatisticsDialog.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/ScriptCanvasStatisticsDialog.cpp @@ -257,7 +257,8 @@ namespace ScriptCanvasEditor if (treeItem->GetAssetId().IsValid()) { - GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAssetId, treeItem->GetAssetId()); + // #sc_editor_asset + // GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAssetId, treeItem->GetAssetId()); } } } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/UnitTestPanel/UnitTestDockWidget.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/UnitTestPanel/UnitTestDockWidget.cpp index 6142729bfe..a60c59ad7e 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/UnitTestPanel/UnitTestDockWidget.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/UnitTestPanel/UnitTestDockWidget.cpp @@ -433,7 +433,7 @@ namespace ScriptCanvasEditor AZ::Data::AssetId sourceAssetId(sourceUuid, 0); AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); - GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAssetId, sourceAssetId); + GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAssetId, ScriptCanvasEditor::SourceHandle(nullptr, sourceUuid, {})); if (!openOutcome) { AZ_Warning("Script Canvas", openOutcome, "%s", openOutcome.GetError().data()); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 424ef60ecc..207b7ec077 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -821,7 +821,7 @@ namespace ScriptCanvasEditor void MainWindow::SignalActiveSceneChanged(ScriptCanvasEditor::SourceHandle assetId) { - // #sc-editor-asset + // #se_editor_asset /* ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); @@ -940,7 +940,7 @@ namespace ScriptCanvasEditor if (shouldSaveResults == UnsavedChangesOptions::SAVE) { - // #sc-editor-asset + // #se_editor_asset // Callbacks::OnSave saveCB = [this](bool isSuccessful, AZ::Data::AssetPtr, ScriptCanvasEditor::SourceHandle) // { // if (isSuccessful) @@ -1140,7 +1140,7 @@ namespace ScriptCanvasEditor void MainWindow::MarkAssetModified(const ScriptCanvasEditor::SourceHandle& /*assetId*/) { -// #sc-editor-asset if (!assetId.IsValid()) +// #se_editor_asset if (!assetId.IsValid()) // { // return; // } @@ -1161,7 +1161,7 @@ namespace ScriptCanvasEditor void MainWindow::RefreshScriptCanvasAsset(const AZ::Data::Asset& /*asset*/) { - // #sc-editor-asset + // #se_editor_asset /* ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, asset.GetId()); @@ -1196,7 +1196,7 @@ namespace ScriptCanvasEditor AZ::Outcome MainWindow::OpenScriptCanvasAssetId(const ScriptCanvasEditor::SourceHandle& /*fileAssetId*/) { - // #sc-editor-asset + // #se_editor_asset return AZ::Failure(AZStd::string("rewrite MainWindow::OpenScriptCanvasAssetId")); /* if (!fileAssetId.IsValid()) @@ -1262,7 +1262,7 @@ namespace ScriptCanvasEditor AZ::Outcome MainWindow::OpenScriptCanvasAsset(const ScriptCanvasMemoryAsset& /*scriptCanvasAsset*/, int /*tabIndex*/ /*= -1*/) { - // #sc-editor-asset + // #se_editor_asset return AZ::Failure(AZStd::string("rewrite MainWindow::OpenScriptCanvasAsset")); /* const ScriptCanvasEditor::SourceHandle& fileAssetId = scriptCanvasAsset.GetFileAssetId(); @@ -1341,7 +1341,7 @@ namespace ScriptCanvasEditor AZ::Outcome MainWindow::OpenScriptCanvasAsset(ScriptCanvasEditor::SourceHandle /*scriptCanvasAssetId*/, int /*tabIndex*/ /*= -1*/) { - // #sc-editor-asset + // #se_editor_asset return AZ::Failure(AZStd::string("rewrite MainWindow::OpenScriptCanvasAsset")); /* ScriptCanvasMemoryAsset::pointer memoryAsset; @@ -1361,14 +1361,14 @@ namespace ScriptCanvasEditor int MainWindow::CreateAssetTab(const ScriptCanvasEditor::SourceHandle& /*assetId*/, int /*tabIndex*/) { - // #sc-editor-asset + // #se_editor_asset return -1; // return m_tabBar->InsertGraphTab(tabIndex, assetId); } AZ::Outcome MainWindow::UpdateScriptCanvasAsset(const AZ::Data::Asset& /*scriptCanvasAsset*/) { - // #sc-editor-asset + // #se_editor_asset return AZ::Failure(AZStd::string("rewrite MainWindow::UpdateScriptCanvasAsset")); /* @@ -1393,7 +1393,7 @@ namespace ScriptCanvasEditor void MainWindow::RemoveScriptCanvasAsset(const ScriptCanvasEditor::SourceHandle& /*assetId*/) { - // #sc-editor-asset move what is necessary to the widget + // #se_editor_asset move what is necessary to the widget /* AssetHelpers::PrintInfo("RemoveScriptCanvasAsset : %s", AssetHelpers::AssetIdToString(assetId).c_str()); @@ -1467,7 +1467,7 @@ namespace ScriptCanvasEditor bool MainWindow::IsScriptCanvasAssetOpen(const ScriptCanvasEditor::SourceHandle& /*assetId*/) const { - // #sc-editor-asset + // #se_editor_asset return false; } @@ -1483,7 +1483,7 @@ namespace ScriptCanvasEditor void MainWindow::GetSuggestedFullFilenameToSaveAs(const ScriptCanvasEditor::SourceHandle& /*assetId*/, AZStd::string& /*filePath*/, AZStd::string& /*fileFilter*/) { - // #sc-editor-asset + // #se_editor_asset /* ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); @@ -1895,7 +1895,7 @@ namespace ScriptCanvasEditor void MainWindow::OnSaveCallback(bool /*saveSuccess*/, AZ::Data::AssetPtr /*fileAsset*/, ScriptCanvasEditor::SourceHandle /*previousFileAssetId*/) { - // #sc-editor-asset yikes...just save the thing...move to ::SaveAsset maybe + // #se_editor_asset yikes...just save the thing...move to ::SaveAsset maybe /* ScriptCanvasMemoryAsset::pointer memoryAsset; @@ -2568,7 +2568,7 @@ namespace ScriptCanvasEditor AZ::EntityId MainWindow::GetActiveGraphCanvasGraphId() const { - // #sc-editor-asset + // #se_editor_asset // AZ::EntityId graphId; // AssetTrackerRequestBus::BroadcastResult(graphId, &AssetTrackerRequests::GetGraphId, m_activeGraph); @@ -2591,13 +2591,13 @@ namespace ScriptCanvasEditor { // ScriptCanvas::ScriptCanvasId sceneId; // AssetTrackerRequestBus::BroadcastResult(sceneId, &AssetTrackerRequests::GetScriptCanvasId, m_activeGraph); - // #sc-editor-asset + // #se_editor_asset return ScriptCanvas::ScriptCanvasId{}; } GraphCanvas::GraphId MainWindow::GetGraphCanvasGraphId(const ScriptCanvas::ScriptCanvasId& /*scriptCanvasId*/) const { - // #sc-editor-asset + // #se_editor_asset // AZ::EntityId graphCanvasId; // AssetTrackerRequestBus::BroadcastResult(graphCanvasId, &AssetTrackerRequests::GetGraphCanvasId, scriptCanvasId); // move to widget @@ -2606,7 +2606,7 @@ namespace ScriptCanvasEditor GraphCanvas::GraphId MainWindow::FindGraphCanvasGraphIdByAssetId(const ScriptCanvasEditor::SourceHandle& /*assetId*/) const { - // #sc-editor-asset + // #se_editor_asset // AZ::EntityId graphId; // AssetTrackerRequestBus::BroadcastResult(graphId, &AssetTrackerRequests::GetGraphId, assetId); return AZ::EntityId{}; @@ -2614,7 +2614,7 @@ namespace ScriptCanvasEditor ScriptCanvas::ScriptCanvasId MainWindow::FindScriptCanvasIdByAssetId(const ScriptCanvasEditor::SourceHandle& /*assetId*/) const { - // #sc-editor-asset + // #se_editor_asset // ScriptCanvas::ScriptCanvasId scriptCanvasId; // AssetTrackerRequestBus::BroadcastResult(scriptCanvasId, &AssetTrackerRequests::GetScriptCanvasId, assetId); return ScriptCanvas::ScriptCanvasId{}; @@ -2622,7 +2622,7 @@ namespace ScriptCanvasEditor ScriptCanvas::ScriptCanvasId MainWindow::GetScriptCanvasId(const GraphCanvas::GraphId& /*graphCanvasGraphId*/) const { - // #sc-editor-asset + // #se_editor_asset // ScriptCanvas::ScriptCanvasId scriptCanvasId; // AssetTrackerRequestBus::BroadcastResult(scriptCanvasId, &AssetTrackerRequests::GetScriptCanvasIdFromGraphId, graphCanvasGraphId); return ScriptCanvas::ScriptCanvasId{}; @@ -2630,7 +2630,7 @@ namespace ScriptCanvasEditor bool MainWindow::IsInUndoRedo(const AZ::EntityId& graphCanvasGraphId) const { - // #sc-editor-asset + // #se_editor_asset bool isActive = false; UndoRequestBus::EventResult(isActive, GetScriptCanvasId(graphCanvasGraphId), &UndoRequests::IsActive); return isActive; @@ -2685,7 +2685,7 @@ namespace ScriptCanvasEditor void MainWindow::ReconnectSceneBuses(ScriptCanvasEditor::SourceHandle /*previousAssetId*/, ScriptCanvasEditor::SourceHandle /*nextAssetId*/) { - // #sc-editor-asset + // #se_editor_asset /* ScriptCanvasMemoryAsset::pointer previousAsset; AssetTrackerRequestBus::BroadcastResult(previousAsset, &AssetTrackerRequests::GetAsset, previousAssetId); @@ -2723,7 +2723,7 @@ namespace ScriptCanvasEditor void MainWindow::SetActiveAsset(const ScriptCanvasEditor::SourceHandle& /*fileAssetId*/) { - // #sc-editor-asset + // #se_editor_asset /* if (m_activeGraph == fileAssetId) { @@ -2788,7 +2788,7 @@ namespace ScriptCanvasEditor void MainWindow::RefreshActiveAsset() { - // #sc-editor-asset + // #se_editor_asset /* if (m_activeGraph.IsValid()) { @@ -2838,7 +2838,7 @@ namespace ScriptCanvasEditor void MainWindow::Clear() { m_tabBar->CloseAllTabs(); - // #sc-editor-asset + // #se_editor_asset // // AssetTrackerRequests::AssetList assets; // AssetTrackerRequestBus::BroadcastResult(assets, &AssetTrackerRequests::GetAssets); @@ -2862,7 +2862,7 @@ namespace ScriptCanvasEditor Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::NEW; bool isSaving = false; - // #sc-editor-asset Get from widgets + // #se_editor_asset Get from widgets /* AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, fileAssetId); AssetTrackerRequestBus::BroadcastResult(isSaving, &AssetTrackerRequests::IsSaving, fileAssetId); @@ -2878,7 +2878,7 @@ namespace ScriptCanvasEditor { SetActiveAsset(fileAssetId); - // #sc-editor-asset + // #se_editor_asset AZStd::string tabName = "Get from widget"; // AssetTrackerRequestBus::BroadcastResult(tabName, &AssetTrackerRequests::GetTabName, fileAssetId); @@ -2887,7 +2887,7 @@ namespace ScriptCanvasEditor if (saveDialogResults == UnsavedChangesOptions::SAVE) { - // #sc-editor-asset + // #se_editor_asset // auto saveCB = [this](bool isSuccessful, AZ::Data::AssetPtr asset, ScriptCanvasEditor::SourceHandle) // { // if (isSuccessful) @@ -2958,7 +2958,7 @@ namespace ScriptCanvasEditor void MainWindow::CopyPathToClipboard(int /*index*/) { - // #sc-editor-asset + // #se_editor_asset /* QVariant tabdata = m_tabBar->tabData(index); @@ -3696,7 +3696,7 @@ namespace ScriptCanvasEditor void MainWindow::UpdateSaveState() { - // #sc-editor-asset todo, consider making blocking + // #se_editor_asset todo, consider making blocking // bool enabled = m_activeGraph.IsValid(); // bool isSaving = false; // bool hasModifications = false; @@ -3912,7 +3912,7 @@ namespace ScriptCanvasEditor AZ::EntityId MainWindow::FindEditorNodeIdByAssetNodeId(const ScriptCanvasEditor::SourceHandle& /*assetId*/, AZ::EntityId /*assetNodeId*/) const { - // #sc-editor-asset + // #se_editor_asset return AZ::EntityId{}; // AZ::EntityId editorEntityId; // AssetTrackerRequestBus::BroadcastResult(editorEntityId, &AssetTrackerRequests::GetEditorEntityIdFromSceneEntityId, assetId, assetNodeId); @@ -3921,7 +3921,7 @@ namespace ScriptCanvasEditor AZ::EntityId MainWindow::FindAssetNodeIdByEditorNodeId(const ScriptCanvasEditor::SourceHandle& /*assetId*/, AZ::EntityId /*editorNodeId*/) const { - // #sc-editor-asset + // #se_editor_asset return AZ::EntityId{}; // AZ::EntityId sceneEntityId; // AssetTrackerRequestBus::BroadcastResult(sceneEntityId, &AssetTrackerRequests::GetSceneEntityIdFromEditorEntityId, assetId, editorNodeId); @@ -4415,7 +4415,7 @@ namespace ScriptCanvasEditor void MainWindow::OnAssignToSelectedEntities() { - // #sc-editor-asset consider cutting + // #se_editor_asset consider cutting // Tracker::ScriptCanvasFileState fileState; // AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, m_activeGraph); // @@ -4489,7 +4489,7 @@ namespace ScriptCanvasEditor ScriptCanvasEditor::Tracker::ScriptCanvasFileState MainWindow::GetAssetFileState(ScriptCanvasEditor::SourceHandle /*assetId*/) const { - // #sc-editor-asset + // #se_editor_asset return Tracker::ScriptCanvasFileState::INVALID; // Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::INVALID; // AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, assetId); @@ -4542,7 +4542,7 @@ namespace ScriptCanvasEditor if (usableRequestBus) { ScriptCanvasMemoryAsset::pointer memoryAsset; - // #sc-editor-asset + // #se_editor_asset // AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeGraph); if (memoryAsset) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.cpp index 14bc1c4dc8..e88675814b 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.cpp @@ -99,7 +99,8 @@ namespace ScriptCanvasEditor if (assetId.IsValid()) { - GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, assetId, -1); + // #sc_editor_asset + // GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, assetId, -1); } if (!openOutcome) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp index e598700899..09c21fe43f 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp @@ -13,10 +13,13 @@ #include #include #include +// #include #include "Core.h" #include "Attributes.h" +#include + namespace ScriptCanvas { ScopedAuxiliaryEntityHandler::ScopedAuxiliaryEntityHandler(AZ::Entity* buildEntity) @@ -234,4 +237,36 @@ namespace ScriptCanvasEditor { return m_path; } + + AZStd::string SourceHandle::ToString() const + { + return AZStd::string::format + ( "%s, %s, %s" + , IsValid() ? "O" : "X" + , m_path.empty() ? m_path.c_str() : "" + , m_id.IsNull() ? "" : m_id.ToString().c_str()); + } +} + +namespace ScriptCanvas +{ + const Graph* ScriptCanvasData::GetGraph() const + { + return AZ::EntityUtils::FindFirstDerivedComponent(m_scriptCanvasEntity.get()); + } + + const ScriptCanvasEditor::Graph* ScriptCanvasData::GetEditorGraph() const + { + return reinterpret_cast(GetGraph()); + } + + Graph* ScriptCanvasData::ModGraph() + { + return AZ::EntityUtils::FindFirstDerivedComponent(m_scriptCanvasEntity.get()); + } + + ScriptCanvasEditor::Graph* ScriptCanvasData::ModEditorGraph() + { + return reinterpret_cast(ModGraph()); + } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h index e2b2ef5919..4c1734413c 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h @@ -353,6 +353,37 @@ namespace ScriptCanvasEditor }; } +namespace ScriptCanvas +{ + class ScriptCanvasData + { + public: + + AZ_RTTI(ScriptCanvasData, "{1072E894-0C67-4091-8B64-F7DB324AD13C}"); + AZ_CLASS_ALLOCATOR(ScriptCanvasData, AZ::SystemAllocator, 0); + ScriptCanvasData() {} + virtual ~ScriptCanvasData() {} + ScriptCanvasData(ScriptCanvasData&& other); + ScriptCanvasData& operator=(ScriptCanvasData&& other); + + static void Reflect(AZ::ReflectContext* reflectContext); + + AZ::Entity* GetScriptCanvasEntity() const { return m_scriptCanvasEntity.get(); } + + const Graph* GetGraph() const; + + const ScriptCanvasEditor::Graph* GetEditorGraph() const; + + Graph* ModGraph(); + + ScriptCanvasEditor::Graph* ModEditorGraph(); + + AZStd::unique_ptr m_scriptCanvasEntity; + private: + ScriptCanvasData(const ScriptCanvasData&) = delete; + }; +} + namespace AZStd { template<> From cbbd6df0c5e5be14f03e8211d7b47f06d4806f11 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Wed, 3 Nov 2021 19:15:44 -0700 Subject: [PATCH 045/948] clean up open pipeline to render graph Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Assets/ScriptCanvasAssetTracker.cpp | 210 ++++----- .../ScriptCanvasAssetTrackerDefinitions.h | 2 +- .../Assets/ScriptCanvasFileHandling.cpp | 6 + .../Editor/Assets/ScriptCanvasMemoryAsset.cpp | 187 ++++---- .../Include/ScriptCanvas/Bus/RequestBus.h | 2 +- .../Code/Editor/View/Widgets/CanvasWidget.cpp | 4 +- .../Code/Editor/View/Widgets/CanvasWidget.h | 7 +- .../Code/Editor/View/Widgets/GraphTabBar.cpp | 203 +++++--- .../Code/Editor/View/Widgets/GraphTabBar.h | 19 +- .../LoggingPanel/LoggingWindowTreeItems.cpp | 31 +- .../LoggingPanel/LoggingWindowTreeItems.h | 12 +- .../Code/Editor/View/Windows/MainWindow.cpp | 437 +++++++----------- .../Code/Editor/View/Windows/MainWindow.h | 7 +- .../Code/Include/ScriptCanvas/Core/Core.cpp | 15 + .../Code/Include/ScriptCanvas/Core/Core.h | 23 +- 15 files changed, 606 insertions(+), 559 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.cpp index b24e91889e..513dc6afe5 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.cpp @@ -58,111 +58,111 @@ namespace ScriptCanvasEditor SaveAs(assetId, {}, onSaveCallback); } - void AssetTracker::SaveAs(AZ::Data::AssetId assetId, const AZStd::string& path, Callbacks::OnSave onSaveCallback) - { - auto assetIter = m_assetsInUse.find(assetId); - - if (assetIter != m_assetsInUse.end()) - { - auto onSave = [this, assetId, onSaveCallback](bool saveSuccess, AZ::Data::AssetPtr asset, AZ::Data::AssetId previousFileAssetId) - { - AZ::Data::AssetId signalId = assetId; - AZ::Data::AssetId fileAssetId = asset->GetId(); - - // If there is a previous file Id is valid, it means this is a save-as operation and we need to remap the tracking. - if (previousFileAssetId.IsValid()) - { - if (saveSuccess) - { - fileAssetId = m_assetsInUse[assetId]->GetFileAssetId(); - m_remappedAsset[asset->GetId()] = fileAssetId; - - // Erase the asset first so the smart pointer can deal with it's things. - m_assetsInUse.erase(fileAssetId); - - // Then perform the insert once we know nothing will attempt to delete this while we are operating on it. - m_assetsInUse[fileAssetId] = m_assetsInUse[assetId]; - m_assetsInUse.erase(assetId); - } - - m_savingAssets.erase(assetId); - m_savingAssets.insert(fileAssetId); - - signalId = fileAssetId; - - if (m_queuedCloses.erase(assetId)) - { - m_queuedCloses.insert(fileAssetId); - } - - auto assetIter = m_assetsInUse.find(fileAssetId); - - if (assetIter != m_assetsInUse.end()) - { - AZStd::invoke(onSaveCallback, saveSuccess, m_assetsInUse[fileAssetId]->GetAsset().Get(), previousFileAssetId); - } - else - { - AZ_Error("ScriptCanvas", !saveSuccess, "Unable to find Memory Asset for Asset(%s)", fileAssetId.ToString().c_str()); - AZStd::invoke(onSaveCallback, saveSuccess, asset, previousFileAssetId); - } - } - else - { - if (saveSuccess) - { - // This should be the case when we get a save as from a newly created file. - // - // If we find the 'memory' asset id in the assets in use. This means this was a new file that was saved. - // To maintain all of the look-up stuff, we need to treat this like a remapping stage. - auto assetInUseIter = m_assetsInUse.find(assetId); - if (assetInUseIter != m_assetsInUse.end()) - { - fileAssetId = assetInUseIter->second->GetFileAssetId(); - - if (assetId != fileAssetId) - { - m_remappedAsset[assetId] = fileAssetId; - - m_assetsInUse.erase(fileAssetId); - m_assetsInUse[fileAssetId] = AZStd::move(assetInUseIter->second); - m_assetsInUse.erase(assetId); - - m_savingAssets.erase(assetId); - m_savingAssets.insert(fileAssetId); - - if (m_queuedCloses.erase(assetId)) - { - m_queuedCloses.insert(fileAssetId); - } - } - } - else - { - fileAssetId = CheckAssetId(fileAssetId); - } - - signalId = fileAssetId; - } - - if (onSaveCallback) - { - AZStd::invoke(onSaveCallback, saveSuccess, m_assetsInUse[signalId]->GetAsset().Get(), previousFileAssetId); - } - - AssetTrackerNotificationBus::Broadcast(&AssetTrackerNotifications::OnAssetSaved, m_assetsInUse[signalId], saveSuccess); - } - - SignalSaveComplete(signalId); - }; - - m_savingAssets.insert(assetId); - assetIter->second->SaveAs(path, onSave); - } - else - { - AZ_Assert(false, "Cannot SaveAs into an existing AssetId"); - } + void AssetTracker::SaveAs(AZ::Data::AssetId /*assetId*/, const AZStd::string& /*path*/, Callbacks::OnSave /*onSaveCallback*/) + { +// auto assetIter = m_assetsInUse.find(assetId); +// +// if (assetIter != m_assetsInUse.end()) +// { +// auto onSave = [this, assetId, onSaveCallback](bool saveSuccess, AZ::Data::AssetPtr asset, AZ::Data::AssetId previousFileAssetId) +// { +// AZ::Data::AssetId signalId = assetId; +// AZ::Data::AssetId fileAssetId = asset->GetId(); +// +// // If there is a previous file Id is valid, it means this is a save-as operation and we need to remap the tracking. +// if (previousFileAssetId.IsValid()) +// { +// if (saveSuccess) +// { +// fileAssetId = m_assetsInUse[assetId]->GetFileAssetId(); +// m_remappedAsset[asset->GetId()] = fileAssetId; +// +// // Erase the asset first so the smart pointer can deal with it's things. +// m_assetsInUse.erase(fileAssetId); +// +// // Then perform the insert once we know nothing will attempt to delete this while we are operating on it. +// m_assetsInUse[fileAssetId] = m_assetsInUse[assetId]; +// m_assetsInUse.erase(assetId); +// } +// +// m_savingAssets.erase(assetId); +// m_savingAssets.insert(fileAssetId); +// +// signalId = fileAssetId; +// +// if (m_queuedCloses.erase(assetId)) +// { +// m_queuedCloses.insert(fileAssetId); +// } +// +// auto assetIter = m_assetsInUse.find(fileAssetId); +// +// if (assetIter != m_assetsInUse.end()) +// { +// AZStd::invoke(onSaveCallback, saveSuccess, m_assetsInUse[fileAssetId]->GetAsset().Get(), previousFileAssetId); +// } +// else +// { +// AZ_Error("ScriptCanvas", !saveSuccess, "Unable to find Memory Asset for Asset(%s)", fileAssetId.ToString().c_str()); +// AZStd::invoke(onSaveCallback, saveSuccess, asset, previousFileAssetId); +// } +// } +// else +// { +// if (saveSuccess) +// { +// // This should be the case when we get a save as from a newly created file. +// // +// // If we find the 'memory' asset id in the assets in use. This means this was a new file that was saved. +// // To maintain all of the look-up stuff, we need to treat this like a remapping stage. +// auto assetInUseIter = m_assetsInUse.find(assetId); +// if (assetInUseIter != m_assetsInUse.end()) +// { +// fileAssetId = assetInUseIter->second->GetFileAssetId(); +// +// if (assetId != fileAssetId) +// { +// m_remappedAsset[assetId] = fileAssetId; +// +// m_assetsInUse.erase(fileAssetId); +// m_assetsInUse[fileAssetId] = AZStd::move(assetInUseIter->second); +// m_assetsInUse.erase(assetId); +// +// m_savingAssets.erase(assetId); +// m_savingAssets.insert(fileAssetId); +// +// if (m_queuedCloses.erase(assetId)) +// { +// m_queuedCloses.insert(fileAssetId); +// } +// } +// } +// else +// { +// fileAssetId = CheckAssetId(fileAssetId); +// } +// +// signalId = fileAssetId; +// } +// +// if (onSaveCallback) +// { +// AZStd::invoke(onSaveCallback, saveSuccess, m_assetsInUse[signalId]->GetAsset().Get(), previousFileAssetId); +// } +// +// AssetTrackerNotificationBus::Broadcast(&AssetTrackerNotifications::OnAssetSaved, m_assetsInUse[signalId], saveSuccess); +// } +// +// SignalSaveComplete(signalId); +// }; +// +// m_savingAssets.insert(assetId); +// assetIter->second->SaveAs(path, onSave); +// } +// else +// { +// AZ_Assert(false, "Cannot SaveAs into an existing AssetId"); +// } } bool AssetTracker::Load(AZ::Data::AssetId fileAssetId, AZ::Data::AssetType assetType, Callbacks::OnAssetReadyCallback onAssetReadyCallback) diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerDefinitions.h b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerDefinitions.h index e08ce8b74b..2aebf29b24 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerDefinitions.h +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerDefinitions.h @@ -18,7 +18,7 @@ namespace ScriptCanvasEditor namespace Callbacks { //! Callback used to know when a save operation failed or succeeded - using OnSave = AZStd::function; + using OnSave = AZStd::function; using OnAssetReadyCallback = AZStd::function; using OnAssetCreatedCallback = OnAssetReadyCallback; diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp index c21f01bb88..e8ee2ed97c 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp @@ -124,6 +124,12 @@ namespace ScriptCanvasEditor } } + if (auto entity = scriptCanvasData->GetScriptCanvasEntity()) + { + entity->Init(); + entity->Activate(); + } + return AZ::Success(ScriptCanvasEditor::SourceHandle(scriptCanvasData, {}, path)); } } diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp index 165007b79b..7af1aa3d9f 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp @@ -283,10 +283,11 @@ namespace ScriptCanvasEditor m_undoHelper = AZStd::make_unique(*this); } - ScriptCanvasEditor::Widget::CanvasWidget* ScriptCanvasMemoryAsset::CreateView(QWidget* parent) + ScriptCanvasEditor::Widget::CanvasWidget* ScriptCanvasMemoryAsset::CreateView(QWidget* /*parent*/) { - m_canvasWidget = new Widget::CanvasWidget(m_fileAssetId, parent); - return m_canvasWidget; + //m_canvasWidget = new Widget::CanvasWidget(m_fileAssetId, parent); + //return m_canvasWidget; + return nullptr; } void ScriptCanvasMemoryAsset::ClearView() @@ -430,68 +431,68 @@ namespace ScriptCanvasEditor } } - void ScriptCanvasMemoryAsset::SourceFileFailed(AZStd::string relativePath, AZStd::string scanFolder, AZ::Uuid) - { - AZStd::string fullPath; - AzFramework::StringFunc::Path::Join(scanFolder.data(), relativePath.data(), fullPath); - AzFramework::ApplicationRequests::Bus::Broadcast(&AzFramework::ApplicationRequests::NormalizePath, fullPath); - - auto assetPathIdIt = AZStd::find(m_pendingSave.begin(), m_pendingSave.end(), fullPath); - - if (assetPathIdIt != m_pendingSave.end()) - { - if (m_onSaveCallback) - { - m_onSaveCallback(false, m_inMemoryAsset.Get(), AZ::Data::AssetId()); - m_onSaveCallback = nullptr; - } - - m_pendingSave.erase(assetPathIdIt); - } - } - - void ScriptCanvasMemoryAsset::SavingComplete(const AZStd::string& streamName, AZ::Uuid sourceAssetId) - { - AZStd::string normPath = streamName; - AzFramework::ApplicationRequests::Bus::Broadcast(&AzFramework::ApplicationRequests::NormalizePath, normPath); - - auto assetPathIdIt = AZStd::find(m_pendingSave.begin(), m_pendingSave.end(), normPath); - if (assetPathIdIt != m_pendingSave.end()) - { - AZ::Data::AssetId previousFileAssetId; - - if (sourceAssetId != m_fileAssetId.m_guid) - { - previousFileAssetId = m_fileAssetId; - - // The source file has changed, store the AssetId to the canonical asset on file - SetFileAssetId(sourceAssetId); - - } - else if (!m_fileAssetId.IsValid()) - { - SetFileAssetId(sourceAssetId); - } - - m_formerGraphIdPair = AZStd::make_pair(m_scriptCanvasId, m_graphId); - - m_fileState = Tracker::ScriptCanvasFileState::UNMODIFIED; - - m_pendingSave.erase(assetPathIdIt); - - m_absolutePath = m_saveAsPath; - m_saveAsPath.clear(); - - // Connect to the source asset's bus to monitor for situations we may need to handle - AZ::Data::AssetBus::MultiHandler::BusConnect(m_inMemoryAsset.GetId()); - AZ::Data::AssetBus::MultiHandler::BusConnect(m_fileAssetId); - - if (m_onSaveCallback) - { - m_onSaveCallback(true, m_inMemoryAsset.Get(), previousFileAssetId); - m_onSaveCallback = nullptr; - } - } + void ScriptCanvasMemoryAsset::SourceFileFailed(AZStd::string /*relativePath*/, AZStd::string /*scanFolder*/, AZ::Uuid) + { +// AZStd::string fullPath; +// AzFramework::StringFunc::Path::Join(scanFolder.data(), relativePath.data(), fullPath); +// AzFramework::ApplicationRequests::Bus::Broadcast(&AzFramework::ApplicationRequests::NormalizePath, fullPath); +// +// auto assetPathIdIt = AZStd::find(m_pendingSave.begin(), m_pendingSave.end(), fullPath); +// +// if (assetPathIdIt != m_pendingSave.end()) +// { +// if (m_onSaveCallback) +// { +// m_onSaveCallback(false, m_inMemoryAsset.Get(), AZ::Data::AssetId()); +// m_onSaveCallback = nullptr; +// } +// +// m_pendingSave.erase(assetPathIdIt); +// } + } + + void ScriptCanvasMemoryAsset::SavingComplete(const AZStd::string& /*streamName*/, AZ::Uuid /*sourceAssetId*/) + { +// AZStd::string normPath = streamName; +// AzFramework::ApplicationRequests::Bus::Broadcast(&AzFramework::ApplicationRequests::NormalizePath, normPath); +// +// auto assetPathIdIt = AZStd::find(m_pendingSave.begin(), m_pendingSave.end(), normPath); +// if (assetPathIdIt != m_pendingSave.end()) +// { +// AZ::Data::AssetId previousFileAssetId; +// +// if (sourceAssetId != m_fileAssetId.m_guid) +// { +// previousFileAssetId = m_fileAssetId; +// +// // The source file has changed, store the AssetId to the canonical asset on file +// SetFileAssetId(sourceAssetId); +// +// } +// else if (!m_fileAssetId.IsValid()) +// { +// SetFileAssetId(sourceAssetId); +// } +// +// m_formerGraphIdPair = AZStd::make_pair(m_scriptCanvasId, m_graphId); +// +// m_fileState = Tracker::ScriptCanvasFileState::UNMODIFIED; +// +// m_pendingSave.erase(assetPathIdIt); +// +// m_absolutePath = m_saveAsPath; +// m_saveAsPath.clear(); +// +// // Connect to the source asset's bus to monitor for situations we may need to handle +// AZ::Data::AssetBus::MultiHandler::BusConnect(m_inMemoryAsset.GetId()); +// AZ::Data::AssetBus::MultiHandler::BusConnect(m_fileAssetId); +// +// if (m_onSaveCallback) +// { +// m_onSaveCallback(true, m_inMemoryAsset.Get(), previousFileAssetId); +// m_onSaveCallback = nullptr; +// } +// } } void ScriptCanvasMemoryAsset::FinalizeAssetSave(bool, const AzToolsFramework::SourceControlFileInfo& fileInfo, const AZ::Data::AssetStreamInfo& saveInfo, Callbacks::OnSave onSaveCallback) @@ -525,14 +526,14 @@ namespace ScriptCanvasEditor UndoNotificationBus::Broadcast(&UndoNotifications::OnCanRedoChanged, m_undoState->m_undoStack->CanRedo()); } - void ScriptCanvasMemoryAsset::SetFileAssetId(const AZ::Data::AssetId& fileAssetId) + void ScriptCanvasMemoryAsset::SetFileAssetId(const AZ::Data::AssetId& /*fileAssetId*/) { - m_fileAssetId = fileAssetId; - - if (m_canvasWidget) - { - m_canvasWidget->SetAssetId(fileAssetId); - } +// m_fileAssetId = fileAssetId; +// +// if (m_canvasWidget) +// { +// m_canvasWidget->SetAssetId(fileAssetId); +// } } void ScriptCanvasMemoryAsset::SignalFileStateChanged() @@ -604,27 +605,27 @@ namespace ScriptCanvasEditor // AssetSaveFinalizer ////////////////////////////////////// - bool AssetSaveFinalizer::ValidateStatus(const AzToolsFramework::SourceControlFileInfo& fileInfo) - { - auto fileIO = AZ::IO::FileIOBase::GetInstance(); - if (fileInfo.IsLockedByOther()) - { - AZ_Error("Script Canvas", !fileInfo.IsLockedByOther(), "The file is already exclusively opened by another user: %s", fileInfo.m_filePath.data()); - AZStd::invoke(m_onSave, false, m_inMemoryAsset, m_fileAssetId); - return false; - } - else if (fileInfo.IsReadOnly() && fileIO->Exists(fileInfo.m_filePath.c_str())) - { - AZ_Error("Script Canvas", !fileInfo.IsReadOnly(), "File %s is read-only. It cannot be saved." - " If this file is in Perforce it may not have been checked out by the Source Control API.", fileInfo.m_filePath.data()); - AZStd::invoke(m_onSave, false, m_inMemoryAsset, m_fileAssetId); - return false; - } - else if (m_saving) - { - AZ_Warning("Script Canvas", false, "Trying to save the same file twice. Will result in one save callback being ignored."); - return false; - } + bool AssetSaveFinalizer::ValidateStatus(const AzToolsFramework::SourceControlFileInfo& /*fileInfo*/) + { +// auto fileIO = AZ::IO::FileIOBase::GetInstance(); +// if (fileInfo.IsLockedByOther()) +// { +// AZ_Error("Script Canvas", !fileInfo.IsLockedByOther(), "The file is already exclusively opened by another user: %s", fileInfo.m_filePath.data()); +// AZStd::invoke(m_onSave, false, m_inMemoryAsset, m_fileAssetId); +// return false; +// } +// else if (fileInfo.IsReadOnly() && fileIO->Exists(fileInfo.m_filePath.c_str())) +// { +// AZ_Error("Script Canvas", !fileInfo.IsReadOnly(), "File %s is read-only. It cannot be saved." +// " If this file is in Perforce it may not have been checked out by the Source Control API.", fileInfo.m_filePath.data()); +// AZStd::invoke(m_onSave, false, m_inMemoryAsset, m_fileAssetId); +// return false; +// } +// else if (m_saving) +// { +// AZ_Warning("Script Canvas", false, "Trying to save the same file twice. Will result in one save callback being ignored."); +// return false; +// } return true; } diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h index 8dbaf5b31a..90468f5d8c 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h @@ -163,7 +163,7 @@ namespace ScriptCanvasEditor public: static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple; static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; - using BusIdType = AZ::Data::AssetId; + using BusIdType = SourceHandle; virtual void OnAssetVisualized() {}; virtual void OnAssetUnloaded() {}; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/CanvasWidget.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/CanvasWidget.cpp index 359d262d6c..722e9d1c71 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/CanvasWidget.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/CanvasWidget.cpp @@ -36,7 +36,7 @@ namespace ScriptCanvasEditor { namespace Widget { - CanvasWidget::CanvasWidget(const AZ::Data::AssetId& assetId, QWidget* parent) + CanvasWidget::CanvasWidget(const ScriptCanvasEditor::SourceHandle& assetId, QWidget* parent) : QWidget(parent) , ui(new Ui::CanvasWidget()) , m_attached(false) @@ -78,7 +78,7 @@ namespace ScriptCanvasEditor m_scriptCanvasId = scriptCanvasId; } - void CanvasWidget::SetAssetId(const AZ::Data::AssetId& assetId) + void CanvasWidget::SetAssetId(const ScriptCanvasEditor::SourceHandle& assetId) { m_assetId = assetId; } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/CanvasWidget.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/CanvasWidget.h index 9abb41aacc..fc04486c36 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/CanvasWidget.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/CanvasWidget.h @@ -21,6 +21,7 @@ AZ_POP_DISABLE_WARNING #include #include +#include #endif class QVBoxLayout; @@ -46,13 +47,13 @@ namespace ScriptCanvasEditor Q_OBJECT public: AZ_CLASS_ALLOCATOR(CanvasWidget, AZ::SystemAllocator, 0); - CanvasWidget(const AZ::Data::AssetId& assetId, QWidget* parent = nullptr); + CanvasWidget(const ScriptCanvasEditor::SourceHandle& assetId, QWidget* parent = nullptr); ~CanvasWidget() override; void SetDefaultBorderColor(AZ::Color defaultBorderColor); void ShowScene(const ScriptCanvas::ScriptCanvasId& scriptCanvasId); - void SetAssetId(const AZ::Data::AssetId& assetId); + void SetAssetId(const ScriptCanvasEditor::SourceHandle& assetId); const GraphCanvas::ViewId& GetViewId() const; @@ -69,7 +70,7 @@ namespace ScriptCanvasEditor void SetupGraphicsView(); - AZ::Data::AssetId m_assetId; + ScriptCanvasEditor::SourceHandle m_assetId; AZStd::unique_ptr ui; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp index 6db4b5bd3e..ce8c280b35 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp @@ -23,6 +23,8 @@ #include +#include + namespace ScriptCanvasEditor { namespace Widget @@ -31,7 +33,7 @@ namespace ScriptCanvasEditor // GraphTabBar //////////////// - GraphTabBar::GraphTabBar(QWidget* parent /*= nullptr*/) + GraphTabBar::GraphTabBar(QWidget* parent) : AzQtComponents::TabBar(parent) { setTabsClosable(true); @@ -49,40 +51,81 @@ namespace ScriptCanvasEditor InsertGraphTab(count(), assetId); } - int GraphTabBar::InsertGraphTab([[maybe_unused]] int tabIndex, [[maybe_unused]] ScriptCanvasEditor::SourceHandle assetId) + void GraphTabBar::ClearTabView(int tabIndex) { - // #sc_editor_asset - // if (!SelectTab(assetId)) -// { -// AZStd::shared_ptr memoryAsset; -// AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); -// -// if (memoryAsset) -// { -// ScriptCanvas::AssetDescription assetDescription = memoryAsset->GetAsset().Get()->GetAssetDescription(); -// -// QIcon tabIcon = QIcon(assetDescription.GetIconPathImpl()); -// int newTabIndex = qobject_cast(parent())->insertTab(tabIndex, new QWidget(), tabIcon, ""); -// -// CanvasWidget* canvasWidget = memoryAsset->CreateView(this); -// -// canvasWidget->SetDefaultBorderColor(assetDescription.GetDisplayColorImpl()); -// -// AZStd::string tabName; -// AzFramework::StringFunc::Path::GetFileName(memoryAsset->GetAbsolutePath().c_str(), tabName); -// -// ConfigureTab(newTabIndex, assetId, tabName); -// -// // new graphs will need to use their in-memory assetid which we'll need to update -// // upon saving the asset -// if (!memoryAsset->GetFileAssetId().IsValid()) -// { -// setTabData(newTabIndex, QVariant::fromValue(memoryAsset->GetId())); -// } -// -// return newTabIndex; -// } -// } + if (tabIndex < count()) + { + if (QVariant tabDataVariant = tabData(tabIndex); tabDataVariant.isValid()) + { + GraphTabMetadata replacement = tabDataVariant.value(); + if (replacement.m_canvasWidget) + { + delete replacement.m_canvasWidget; + replacement.m_canvasWidget = nullptr; + tabDataVariant.setValue(replacement); + setTabData(tabIndex, tabDataVariant); + } + } + } + } + + CanvasWidget* GraphTabBar::ModOrCreateTabView(int tabIndex) + { + if (tabIndex < count()) + { + if (QVariant tabDataVariant = tabData(tabIndex); tabDataVariant.isValid()) + { + if (!tabDataVariant.value().m_canvasWidget) + { + CanvasWidget* canvasWidget = new CanvasWidget(tabDataVariant.value().m_assetId, this); + canvasWidget->SetDefaultBorderColor(ScriptCanvasAssetDescription().GetDisplayColorImpl()); + GraphTabMetadata replacement = tabDataVariant.value(); + replacement.m_canvasWidget = canvasWidget; + tabDataVariant.setValue(replacement); + setTabData(tabIndex, tabDataVariant); + } + + return tabDataVariant.value().m_canvasWidget; + } + } + + return nullptr; + } + + CanvasWidget* GraphTabBar::ModTabView(int tabIndex) + { + if (tabIndex < count()) + { + if (QVariant tabDataVariant = tabData(tabIndex); tabDataVariant.isValid()) + { + return tabDataVariant.value().m_canvasWidget; + } + } + + return nullptr; + } + + int GraphTabBar::InsertGraphTab(int tabIndex, ScriptCanvasEditor::SourceHandle assetId) + { + if (!SelectTab(assetId)) + { + QIcon tabIcon = QIcon(ScriptCanvasAssetDescription().GetIconPathImpl()); + tabIndex = qobject_cast(parent())->insertTab(tabIndex, new QWidget(), tabIcon, ""); + GraphTabMetadata metaData; + CanvasWidget* canvasWidget = new CanvasWidget(assetId, this); + canvasWidget->SetDefaultBorderColor(ScriptCanvasAssetDescription().GetDisplayColorImpl()); + metaData.m_canvasWidget = canvasWidget; + + AZStd::string tabName; + AzFramework::StringFunc::Path::GetFileName(assetId.Path().c_str(), tabName); + + // #sc_editor_asset filestate + Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::INVALID; + // AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, fileAssetId); + SetTabText(tabIndex, tabName.c_str(), fileState); + setTabData(tabIndex, QVariant::fromValue(metaData)); + return tabIndex; + } return -1; } @@ -98,47 +141,46 @@ namespace ScriptCanvasEditor return false; } - void GraphTabBar::ConfigureTab(int tabIndex, ScriptCanvasEditor::SourceHandle fileAssetId, const AZStd::string& tabName) +// void GraphTabBar::ConfigureTab(int /*tabIndex*/, ScriptCanvasEditor::SourceHandle fileAssetId, const AZStd::string& tabName) +// { +// +// } + + int GraphTabBar::FindTab(ScriptCanvasEditor::SourceHandle assetId) const { - if (fileAssetId.IsValid()) + for (int tabIndex = 0; tabIndex < count(); ++tabIndex) { QVariant tabDataVariant = tabData(tabIndex); - if (tabDataVariant.isValid()) { - // #se_editor_asset - // auto tabAssetId = tabDataVariant.value(); - // MemoryAssetNotificationBus::MultiHandler::BusDisconnect(tabAssetId); + auto tabAssetId = tabDataVariant.value(); + if (tabAssetId.m_assetId == assetId) + { + return tabIndex; + } } - - setTabData(tabIndex, QVariant::fromValue(fileAssetId)); - - // #se_editor_asset - // MemoryAssetNotificationBus::MultiHandler::BusConnect(fileAssetId); } - - // #se_editor_asset - Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::INVALID; - // AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, fileAssetId); - - SetTabText(tabIndex, tabName.c_str(), fileState); + return -1; } - int GraphTabBar::FindTab(ScriptCanvasEditor::SourceHandle assetId) const + ScriptCanvasEditor::SourceHandle GraphTabBar::FindTabByPath(AZStd::string_view path) const { - for (int tabIndex = 0; tabIndex < count(); ++tabIndex) + ScriptCanvasEditor::SourceHandle candidate(nullptr, {}, path); + + for (int index = 0; index < count(); ++index) { - QVariant tabDataVariant = tabData(tabIndex); - if (tabDataVariant.isValid()) + QVariant tabdata = tabData(index); + if (tabdata.isValid()) { - auto tabAssetId = tabDataVariant.value(); - if (tabAssetId == assetId) + auto tabAssetId = tabdata.value(); + if (tabAssetId.m_assetId.AnyEquals(candidate)) { - return tabIndex; + return tabAssetId.m_assetId; } } } - return -1; + + return {}; } ScriptCanvasEditor::SourceHandle GraphTabBar::FindAssetId(int tabIndex) @@ -146,13 +188,31 @@ namespace ScriptCanvasEditor QVariant dataVariant = tabData(tabIndex); if (dataVariant.isValid()) { - auto tabAssetId = dataVariant.value(); - return tabAssetId; + auto tabAssetId = dataVariant.value(); + return tabAssetId.m_assetId; } return ScriptCanvasEditor::SourceHandle(); } + ScriptCanvas::ScriptCanvasId GraphTabBar::FindScriptCanvasIdFromGraphCanvasId(const GraphCanvas::GraphId& graphCanvasGraphId) const + { + for (int index = 0; index < count(); ++index) + { + QVariant tabdata = tabData(index); + if (tabdata.isValid()) + { + auto tabAssetId = tabdata.value(); + if (tabAssetId.m_assetId && tabAssetId.m_assetId.Get()->GetGraphCanvasGraphId() == graphCanvasGraphId) + { + return tabAssetId.m_assetId.Get()->GetScriptCanvasId(); + } + } + } + + return ScriptCanvas::ScriptCanvasId{}; + } + void GraphTabBar::CloseTab(int index) { if (index >= 0 && index < count()) @@ -160,10 +220,11 @@ namespace ScriptCanvasEditor QVariant tabdata = tabData(index); if (tabdata.isValid()) { - auto tabAssetId = tabdata.value(); + // #sc_editor_asset fix tabData + auto tabAssetId = tabdata.value(); - MemoryAssetNotificationBus::MultiHandler::BusDisconnect(tabAssetId); - AssetTrackerRequestBus::Broadcast(&AssetTrackerRequests::ClearView, tabAssetId); + //MemoryAssetNotificationBus::MultiHandler::BusDisconnect(tabAssetId); + //AssetTrackerRequestBus::Broadcast(&AssetTrackerRequests::ClearView, tabAssetId); } qobject_cast(parent())->removeTab(index); @@ -191,10 +252,10 @@ namespace ScriptCanvasEditor QVariant tabdata = tabData(tabIndex); if (tabdata.isValid()) { - auto tabAssetId = tabdata.value(); + auto tabAssetId = tabdata.value(); - Tracker::ScriptCanvasFileState fileState; - AssetTrackerRequestBus::BroadcastResult(fileState , &AssetTrackerRequests::GetFileState, tabAssetId); + Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::INVALID; + //AssetTrackerRequestBus::BroadcastResult(fileState , &AssetTrackerRequests::GetFileState, tabAssetId); isModified = fileState == Tracker::ScriptCanvasFileState::NEW || fileState == Tracker::ScriptCanvasFileState::MODIFIED; } @@ -269,7 +330,7 @@ namespace ScriptCanvasEditor void GraphTabBar::OnFileStateChanged(Tracker::ScriptCanvasFileState ) { - // #se_editor_asset + // #sc_editor_asset // const AZ::Data::AssetId* fileAssetId = MemoryAssetNotificationBus::GetCurrentBusId(); // if (fileAssetId) @@ -332,7 +393,7 @@ namespace ScriptCanvasEditor return; } - auto assetId = tabdata.value(); + auto assetId = tabdata.value(); // #sc_editor_asset // ScriptCanvasEditor::GeneralRequestBus::Broadcast(&ScriptCanvasEditor::GeneralRequests::OnChangeActiveGraphTab, assetId); @@ -346,7 +407,7 @@ namespace ScriptCanvasEditor void GraphTabBar::SetFileState(ScriptCanvasEditor::SourceHandle, Tracker::ScriptCanvasFileState ) { - // #se_editor_asset + // #sc_editor_asset // int index = FindTab(assetId); // if (index >= 0 && index < count()) @@ -354,7 +415,7 @@ namespace ScriptCanvasEditor // QVariant tabdata = tabData(index); // if (tabdata.isValid()) // { -// auto tabAssetId = tabdata.value(); +// auto tabAssetId = tabdata.value(); // // AZStd::string tabName; // AssetTrackerRequestBus::BroadcastResult(tabName, &AssetTrackerRequests::GetTabName, tabAssetId); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h index 490c17cc29..12e73b4ae5 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h @@ -16,6 +16,7 @@ #include #include +#include #include #endif @@ -26,11 +27,13 @@ namespace ScriptCanvasEditor { namespace Widget { + class CanvasWidget; + struct GraphTabMetadata { - AZ::Data::AssetId m_assetId; + SourceHandle m_assetId; QWidget* m_hostWidget = nullptr; - QString m_tabName; + CanvasWidget* m_canvasWidget = nullptr; Tracker::ScriptCanvasFileState m_fileState = Tracker::ScriptCanvasFileState::INVALID; }; @@ -46,16 +49,22 @@ namespace ScriptCanvasEditor ~GraphTabBar() override = default; void AddGraphTab(ScriptCanvasEditor::SourceHandle assetId); + void CloseTab(int index); + void CloseAllTabs(); + int InsertGraphTab(int tabIndex, ScriptCanvasEditor::SourceHandle assetId); bool SelectTab(ScriptCanvasEditor::SourceHandle assetId); - void ConfigureTab(int tabIndex, ScriptCanvasEditor::SourceHandle fileAssetId, const AZStd::string& tabName); + // void ConfigureTab(int tabIndex, ScriptCanvasEditor::SourceHandle fileAssetId, const AZStd::string& tabName); int FindTab(ScriptCanvasEditor::SourceHandle assetId) const; + ScriptCanvasEditor::SourceHandle FindTabByPath(AZStd::string_view path) const; ScriptCanvasEditor::SourceHandle FindAssetId(int tabIndex); + ScriptCanvas::ScriptCanvasId FindScriptCanvasIdFromGraphCanvasId(const GraphCanvas::GraphId& graphCanvasGraphId) const; - void CloseTab(int index); - void CloseAllTabs(); + void ClearTabView(int tabIndex); + CanvasWidget* ModOrCreateTabView(int tabIndex); + CanvasWidget* ModTabView(int tabIndex); void OnContextMenu(const QPoint& point); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.cpp index 732aacc993..a9ffe30fb1 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.cpp @@ -122,7 +122,11 @@ namespace ScriptCanvasEditor { } - ExecutionLogTreeItem* DebugLogRootItem::CreateExecutionItem(const LoggingDataId& loggingDataId, const ScriptCanvas::NodeTypeIdentifier& nodeType, const ScriptCanvas::GraphInfo& graphInfo, const ScriptCanvas::NamedNodeId& nodeId) + ExecutionLogTreeItem* DebugLogRootItem::CreateExecutionItem + ( [[maybe_unused]] const LoggingDataId& loggingDataId + , [[maybe_unused]] const ScriptCanvas::NodeTypeIdentifier& nodeType + , [[maybe_unused]] const ScriptCanvas::GraphInfo& graphInfo + , [[maybe_unused]] const ScriptCanvas::NamedNodeId& nodeId) { ExecutionLogTreeItem* treeItem = nullptr; @@ -136,11 +140,13 @@ namespace ScriptCanvasEditor if (m_updatePolicy == UpdatePolicy::SingleTime) { - treeItem = CreateChildNodeWithoutAddSignal(loggingDataId, nodeType, graphInfo, nodeId); + // #sc_editor_asset + // treeItem = CreateChildNodeWithoutAddSignal(loggingDataId, nodeType, graphInfo, nodeId); } else { - treeItem = CreateChildNode(loggingDataId, nodeType, graphInfo, nodeId); + // #sc_editor_asset + // treeItem = CreateChildNode(loggingDataId, nodeType, graphInfo, nodeId); } return treeItem; @@ -185,7 +191,11 @@ namespace ScriptCanvasEditor // ExecutionLogTreeItem ///////////////////////// - ExecutionLogTreeItem::ExecutionLogTreeItem(const LoggingDataId& loggingDataId, const ScriptCanvas::NodeTypeIdentifier& nodeType, const ScriptCanvas::GraphInfo& graphInfo, const ScriptCanvas::NamedNodeId& nodeId) + ExecutionLogTreeItem::ExecutionLogTreeItem + ( const LoggingDataId& loggingDataId + , const ScriptCanvas::NodeTypeIdentifier& nodeType + , const SourceHandle& graphInfo + , const ScriptCanvas::NamedNodeId& nodeId) : m_loggingDataId(loggingDataId) , m_nodeType(nodeType) , m_graphInfo(graphInfo) @@ -196,7 +206,9 @@ namespace ScriptCanvasEditor m_paletteConfiguration.SetColorPalette("MethodNodeTitlePalette"); AZ::NamedEntityId entityName; - LoggingDataRequestBus::EventResult(entityName, m_loggingDataId, &LoggingDataRequests::FindNamedEntityId, m_graphInfo.m_runtimeEntity); + + // #sc_editor_asset restore this + //LoggingDataRequestBus::EventResult(entityName, m_loggingDataId, &LoggingDataRequests::FindNamedEntityId, m_graphInfo.m_runtimeEntity); m_sourceEntityName = entityName.ToString().c_str(); m_displayName = nodeId.m_name.c_str(); @@ -207,7 +219,7 @@ namespace ScriptCanvasEditor m_inputName = "---"; m_outputName = "---"; - GeneralAssetNotificationBus::Handler::BusConnect(GetAssetId()); + GeneralAssetNotificationBus::Handler::BusConnect(graphInfo); } QVariant ExecutionLogTreeItem::Data(const QModelIndex& index, int role) const @@ -502,12 +514,13 @@ namespace ScriptCanvasEditor const ScriptCanvas::GraphIdentifier& ExecutionLogTreeItem::GetGraphIdentifier() const { - return m_graphInfo.m_graphIdentifier; + // #sc_editor_asset + return m_graphIdentifier; } - const AZ::Data::AssetId& ExecutionLogTreeItem::GetAssetId() const + AZ::Data::AssetId ExecutionLogTreeItem::GetAssetId() const { - return m_graphInfo.m_graphIdentifier.m_assetId; + return m_graphInfo.Id(); } AZ::EntityId ExecutionLogTreeItem::GetScriptCanvasAssetNodeId() const diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.h index 862b231f3a..5b6d23590b 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.h @@ -131,7 +131,12 @@ namespace ScriptCanvasEditor AZ_CLASS_ALLOCATOR(ExecutionLogTreeItem, AZ::SystemAllocator, 0); AZ_RTTI(ExecutionLogTreeItem, "{71139142-A30C-4A16-81CC-D51314AEAF7D}", DebugLogTreeItem); - ExecutionLogTreeItem(const LoggingDataId& loggingDataId, const ScriptCanvas::NodeTypeIdentifier& nodeType, const ScriptCanvas::GraphInfo& graphInfo, const ScriptCanvas::NamedNodeId& nodeId); + ExecutionLogTreeItem + ( const LoggingDataId& loggingDataId + , const ScriptCanvas::NodeTypeIdentifier& nodeType + , const SourceHandle& graphInfo + , const ScriptCanvas::NamedNodeId& nodeId); + ~ExecutionLogTreeItem() override = default; QVariant Data(const QModelIndex& index, int role) const override final; @@ -163,7 +168,7 @@ namespace ScriptCanvasEditor //// const ScriptCanvas::GraphIdentifier& GetGraphIdentifier() const; - const AZ::Data::AssetId& GetAssetId() const; + AZ::Data::AssetId GetAssetId() const; AZ::EntityId GetScriptCanvasAssetNodeId() const; GraphCanvas::NodeId GetGraphCanvasNodeId() const; @@ -184,7 +189,8 @@ namespace ScriptCanvasEditor LoggingDataId m_loggingDataId; ScriptCanvas::NodeTypeIdentifier m_nodeType; - ScriptCanvas::GraphInfo m_graphInfo; + SourceHandle m_graphInfo; + ScriptCanvas::GraphIdentifier m_graphIdentifier; QString m_sourceEntityName; QString m_graphName; QString m_relativeGraphPath; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 207b7ec077..38e5f0172b 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -821,16 +821,10 @@ namespace ScriptCanvasEditor void MainWindow::SignalActiveSceneChanged(ScriptCanvasEditor::SourceHandle assetId) { - // #se_editor_asset - /* - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); - AZ::EntityId graphId; - - if (memoryAsset) + if (assetId) { - graphId = memoryAsset->GetGraphId(); + EditorGraphRequestBus::EventResult(graphId, assetId.Get()->GetScriptCanvasId(), &EditorGraphRequests::GetGraphCanvasGraphId); } m_autoSaveTimer.stop(); @@ -849,18 +843,20 @@ namespace ScriptCanvasEditor GraphCanvas::ViewId viewId; GraphCanvas::SceneRequestBus::EventResult(viewId, graphId, &GraphCanvas::SceneRequests::GetViewId); - AZ_Assert(viewId.IsValid(), "SceneRequest must return a valid ViewId"); if (viewId.IsValid()) { GraphCanvas::ViewNotificationBus::Handler::BusDisconnect(); GraphCanvas::ViewNotificationBus::Handler::BusConnect(viewId); - enabled = memoryAsset->GetScriptCanvasId().IsValid(); + enabled = true; + } + else + { + AZ_Error("ScriptCanvasEditor", viewId.IsValid(), "SceneRequest must return a valid ViewId"); } } UpdateMenuState(enabled); - */ } void MainWindow::UpdateRecentMenu() @@ -940,7 +936,7 @@ namespace ScriptCanvasEditor if (shouldSaveResults == UnsavedChangesOptions::SAVE) { - // #se_editor_asset + // #sc_editor_asset // Callbacks::OnSave saveCB = [this](bool isSuccessful, AZ::Data::AssetPtr, ScriptCanvasEditor::SourceHandle) // { // if (isSuccessful) @@ -1140,7 +1136,7 @@ namespace ScriptCanvasEditor void MainWindow::MarkAssetModified(const ScriptCanvasEditor::SourceHandle& /*assetId*/) { -// #se_editor_asset if (!assetId.IsValid()) +// #sc_editor_asset if (!assetId.IsValid()) // { // return; // } @@ -1161,7 +1157,7 @@ namespace ScriptCanvasEditor void MainWindow::RefreshScriptCanvasAsset(const AZ::Data::Asset& /*asset*/) { - // #se_editor_asset + // #sc_editor_asset /* ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, asset.GetId()); @@ -1194,12 +1190,9 @@ namespace ScriptCanvasEditor */ } - AZ::Outcome MainWindow::OpenScriptCanvasAssetId(const ScriptCanvasEditor::SourceHandle& /*fileAssetId*/) + AZ::Outcome MainWindow::OpenScriptCanvasAssetId(const ScriptCanvasEditor::SourceHandle& fileAssetId) { - // #se_editor_asset - return AZ::Failure(AZStd::string("rewrite MainWindow::OpenScriptCanvasAssetId")); - /* - if (!fileAssetId.IsValid()) + if (fileAssetId.Id().IsNull()) { return AZ::Failure(AZStd::string("Unable to open asset with invalid asset id")); } @@ -1212,79 +1205,47 @@ namespace ScriptCanvasEditor return AZ::Success(outTabIndex); } - AZ::Data::AssetInfo assetInfo; - AZ::Data::AssetCatalogRequestBus::BroadcastResult(assetInfo, &AZ::Data::AssetCatalogRequests::GetAssetInfoById, fileAssetId); - - if (assetInfo.m_relativePath.empty()) - { - return AZ::Failure(AZStd::string("Unknown AssetId")); - } + outTabIndex = CreateAssetTab(fileAssetId); - if (assetInfo.m_assetType != azrtti_typeid()) + if (!m_isRestoringWorkspace) { - return AZ::Failure(AZStd::string("Invalid AssetId provided, it's not a Script Canvas supported type")); + SetActiveAsset(fileAssetId); } - AssetTrackerRequests::OnAssetReadyCallback onAssetReady = [this, fileAssetId, &outTabIndex](ScriptCanvasMemoryAsset& asset) - { - if (!asset.IsSourceInError()) - { - outTabIndex = CreateAssetTab(asset.GetFileAssetId()); - - if (!m_isRestoringWorkspace) - { - SetActiveAsset(fileAssetId); - } - - UpdateWorkspaceStatus(asset); - } - else - { - outTabIndex = -1; - m_loadingAssets.erase(fileAssetId); - } - }; - - m_loadingAssets.insert(fileAssetId); - - AssetTrackerRequestBus::Broadcast(&AssetTrackerRequests::Load, fileAssetId, assetInfo.m_assetType, onAssetReady); - if (outTabIndex >= 0) { + AddRecentFile(fileAssetId.Path().c_str()); + OpenScriptCanvasAssetImplementation(fileAssetId); return AZ::Success(outTabIndex); } else { return AZ::Failure(AZStd::string("Specified asset is in an error state and cannot be properly displayed.")); } - */ } - AZ::Outcome MainWindow::OpenScriptCanvasAsset(const ScriptCanvasMemoryAsset& /*scriptCanvasAsset*/, int /*tabIndex*/ /*= -1*/) + AZ::Outcome MainWindow::OpenScriptCanvasAssetImplementation(const SourceHandle& scriptCanvasAsset, int tabIndex) { - // #se_editor_asset - return AZ::Failure(AZStd::string("rewrite MainWindow::OpenScriptCanvasAsset")); - /* - const ScriptCanvasEditor::SourceHandle& fileAssetId = scriptCanvasAsset.GetFileAssetId(); + const ScriptCanvasEditor::SourceHandle& fileAssetId = scriptCanvasAsset; if (!fileAssetId.IsValid()) { return AZ::Failure(AZStd::string("Unable to open asset with invalid asset id")); } - if (scriptCanvasAsset.IsSourceInError()) + if (!scriptCanvasAsset.IsValid()) { if (!m_isRestoringWorkspace) { - AZStd::string errorPath = scriptCanvasAsset.GetAbsolutePath(); + AZStd::string errorPath = scriptCanvasAsset.Path(); if (errorPath.empty()) { errorPath = m_errorFilePath; } - if (m_queuedFocusOverride == fileAssetId) + if (m_queuedFocusOverride.AnyEquals(fileAssetId)) { - m_queuedFocusOverride.SetInvalid(); + m_queuedFocusOverride = fileAssetId; } QMessageBox::warning(this, "Unable to open source file", QString("Source File(%1) is in error and cannot be opened").arg(errorPath.c_str()), QMessageBox::StandardButton::Ok); @@ -1309,18 +1270,14 @@ namespace ScriptCanvasEditor if (outTabIndex == -1) { - return AZ::Failure(AZStd::string::format("Unable to open existing Script Canvas Asset with id %s in the Script Canvas Editor", AssetHelpers::AssetIdToString(fileAssetId).c_str())); + return AZ::Failure(AZStd::string::format("Unable to open existing Script Canvas Asset with id %s in the Script Canvas Editor" + , fileAssetId.ToString().c_str())); } - AZStd::string assetPath = scriptCanvasAsset.GetAbsolutePath(); + AZStd::string assetPath = scriptCanvasAsset.Path(); if (!assetPath.empty() && !m_loadingNewlySavedFile) { - const size_t eraseCount = m_loadingWorkspaceAssets.erase(fileAssetId); - - if (eraseCount == 0) - { - AddRecentFile(assetPath.c_str()); - } + AddRecentFile(assetPath.c_str()); } if (!m_isRestoringWorkspace) @@ -1328,47 +1285,34 @@ namespace ScriptCanvasEditor SetActiveAsset(fileAssetId); } - GraphCanvas::GraphId graphCanvasGraphId = GetGraphCanvasGraphId(scriptCanvasAsset.GetScriptCanvasId()); + GraphCanvas::GraphId graphCanvasGraphId = GetGraphCanvasGraphId(scriptCanvasAsset.Get()->GetScriptCanvasId()); GraphCanvas::AssetEditorNotificationBus::Event(ScriptCanvasEditor::AssetEditorId, &GraphCanvas::AssetEditorNotifications::OnGraphLoaded, graphCanvasGraphId); GeneralAssetNotificationBus::Event(fileAssetId, &GeneralAssetNotifications::OnAssetVisualized); - AssetTrackerNotificationBus::MultiHandler::BusConnect(fileAssetId); - return AZ::Success(outTabIndex); - */ } - AZ::Outcome MainWindow::OpenScriptCanvasAsset(ScriptCanvasEditor::SourceHandle /*scriptCanvasAssetId*/, int /*tabIndex*/ /*= -1*/) + AZ::Outcome MainWindow::OpenScriptCanvasAsset(ScriptCanvasEditor::SourceHandle scriptCanvasAssetId, int tabIndex) { - // #se_editor_asset - return AZ::Failure(AZStd::string("rewrite MainWindow::OpenScriptCanvasAsset")); - /* - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, scriptCanvasAssetId); - - // If the asset is already tracked we can go directly to opening it. - if (memoryAsset) + if (scriptCanvasAssetId) { - return OpenScriptCanvasAsset(*memoryAsset, tabIndex); + return OpenScriptCanvasAssetImplementation(scriptCanvasAssetId, tabIndex); } else { return OpenScriptCanvasAssetId(scriptCanvasAssetId); } - */ } - int MainWindow::CreateAssetTab(const ScriptCanvasEditor::SourceHandle& /*assetId*/, int /*tabIndex*/) + int MainWindow::CreateAssetTab(const ScriptCanvasEditor::SourceHandle& assetId, int tabIndex) { - // #se_editor_asset - return -1; - // return m_tabBar->InsertGraphTab(tabIndex, assetId); + return m_tabBar->InsertGraphTab(tabIndex, assetId); } AZ::Outcome MainWindow::UpdateScriptCanvasAsset(const AZ::Data::Asset& /*scriptCanvasAsset*/) { - // #se_editor_asset + // #sc_editor_asset return AZ::Failure(AZStd::string("rewrite MainWindow::UpdateScriptCanvasAsset")); /* @@ -1393,7 +1337,7 @@ namespace ScriptCanvasEditor void MainWindow::RemoveScriptCanvasAsset(const ScriptCanvasEditor::SourceHandle& /*assetId*/) { - // #se_editor_asset move what is necessary to the widget + // #sc_editor_asset move what is necessary to the widget /* AssetHelpers::PrintInfo("RemoveScriptCanvasAsset : %s", AssetHelpers::AssetIdToString(assetId).c_str()); @@ -1419,7 +1363,7 @@ namespace ScriptCanvasEditor QVariant tabdata = m_tabBar->tabData(tabIndex); if (tabdata.isValid()) { - auto tabAssetId = tabdata.value(); + auto tabAssetId = tabdata.value(); SetActiveAsset(tabAssetId); } */ @@ -1467,7 +1411,7 @@ namespace ScriptCanvasEditor bool MainWindow::IsScriptCanvasAssetOpen(const ScriptCanvasEditor::SourceHandle& /*assetId*/) const { - // #se_editor_asset + // #sc_editor_asset return false; } @@ -1483,7 +1427,7 @@ namespace ScriptCanvasEditor void MainWindow::GetSuggestedFullFilenameToSaveAs(const ScriptCanvasEditor::SourceHandle& /*assetId*/, AZStd::string& /*filePath*/, AZStd::string& /*fileFilter*/) { - // #se_editor_asset + // #sc_editor_asset /* ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); @@ -1530,18 +1474,50 @@ namespace ScriptCanvasEditor void MainWindow::OpenFile(const char* fullPath) { - AZ::Outcome outcome = LoadFromFile(fullPath); + auto tabIndex = m_tabBar->FindTabByPath(fullPath); + if (tabIndex.IsValid()) + { + SetActiveAsset(tabIndex); + return; + } + + AZStd::string watchFolder; + AZ::Data::AssetInfo assetInfo; + bool sourceInfoFound{}; + AzToolsFramework::AssetSystemRequestBus::BroadcastResult + ( sourceInfoFound + , &AzToolsFramework::AssetSystemRequestBus::Events::GetSourceInfoBySourcePath, fullPath, assetInfo, watchFolder); + + if (!sourceInfoFound) + { + QMessageBox::warning(this, "Invalid Source Asset", QString("'%1' is not a valid asset path.").arg(fullPath), QMessageBox::Ok); + m_errorFilePath = fullPath; + AZ_Warning("ScriptCanvas", false, "Unable to open file as a ScriptCanvas graph: %s", fullPath); + return; + } + AZ::Outcome outcome = LoadFromFile(fullPath); if (!outcome.IsSuccess()) { + QMessageBox::warning(this, "Invalid Source File", QString("'%1' is not a valid file path.").arg(fullPath), QMessageBox::Ok); m_errorFilePath = fullPath; AZ_Warning("ScriptCanvas", false, "Unable to open file as a ScriptCanvas graph: %s", fullPath); + return; + } + + m_errorFilePath.clear(); + m_activeGraph = ScriptCanvasEditor::SourceHandle(outcome.TakeValue(), assetInfo.m_assetId.m_guid, fullPath); + + auto openOutcome = OpenScriptCanvasAsset(m_activeGraph); + if (openOutcome) + { + RunGraphValidation(false); + SetRecentAssetId(m_activeGraph); + SetActiveAsset(m_activeGraph); } else { - m_errorFilePath.clear(); - m_activeGraph = outcome.TakeValue(); - return; + AZ_Warning("Script Canvas", openOutcome, "%s", openOutcome.GetError().data()); } #if defined(EDITOR_ASSET_SUPPORT_ENABLED) @@ -1772,7 +1748,7 @@ namespace ScriptCanvasEditor bool MainWindow::OnFileSave(const Callbacks::OnSave& saveCB) { - return SaveAssetImpl(m_activeGraph, saveCB); + return SaveAssetAsImpl(m_activeGraph, saveCB); } bool MainWindow::OnFileSaveAs(const Callbacks::OnSave& saveCB) @@ -1800,7 +1776,7 @@ namespace ScriptCanvasEditor else if (fileState == Tracker::ScriptCanvasFileState::MODIFIED || fileState == Tracker::ScriptCanvasFileState::SOURCE_REMOVED) { - SaveAsset(assetId, saveCB); + SaveAs(assetId.Path(), assetId, saveCB); saveSuccessful = true; } @@ -1880,7 +1856,7 @@ namespace ScriptCanvasEditor return false; } - SaveNewAsset(internalStringFile, inMemoryAssetId, saveCB); + SaveAs(internalStringFile, inMemoryAssetId, saveCB); m_newlySavedFile = internalStringFile; @@ -1895,7 +1871,7 @@ namespace ScriptCanvasEditor void MainWindow::OnSaveCallback(bool /*saveSuccess*/, AZ::Data::AssetPtr /*fileAsset*/, ScriptCanvasEditor::SourceHandle /*previousFileAssetId*/) { - // #se_editor_asset yikes...just save the thing...move to ::SaveAsset maybe + // #sc_editor_asset yikes...just save the thing...move to ::SaveAsset maybe /* ScriptCanvasMemoryAsset::pointer memoryAsset; @@ -1917,7 +1893,7 @@ namespace ScriptCanvasEditor if (saveTabIndex != m_tabBar->currentIndex()) { // Invalidate the file asset id so we don't delete trigger the asset flow. - m_tabBar->setTabData(saveTabIndex, QVariant::fromValue(ScriptCanvasEditor::SourceHandle())); + m_tabBar->setTabData(saveTabIndex, QVariant::fromValue(GraphTabMetaData)); m_tabBar->CloseTab(saveTabIndex); saveTabIndex = -1; @@ -1938,6 +1914,7 @@ namespace ScriptCanvasEditor AzFramework::StringFunc::Path::GetFileName(memoryAsset->GetAbsolutePath().c_str(), tabName); // Update the tab's assetId to the file asset Id (necessary when saving a new asset) + // used to be configure tab...sets the name and file state m_tabBar->ConfigureTab(saveTabIndex, fileAssetId, tabName); GeneralAssetNotificationBus::Event(memoryAsset->GetId(), &GeneralAssetNotifications::OnAssetVisualized); @@ -2029,25 +2006,13 @@ namespace ScriptCanvasEditor return OnFileSave(saveCB); } - void MainWindow::SaveAsset(ScriptCanvasEditor::SourceHandle /*assetId*/, const Callbacks::OnSave& /*onSave*/) + void MainWindow::SaveAs(AZStd::string_view /*path*/, ScriptCanvasEditor::SourceHandle /*inMemoryAssetId*/, const Callbacks::OnSave& /*onSave*/) { /* - PrepareAssetForSave(assetId); - - auto onSaveCallback = [this, onSave](bool saveSuccess, AZ::Data::AssetPtr asset, ScriptCanvasEditor::SourceHandle previousAssetId) - { - OnSaveCallback(saveSuccess, asset, previousAssetId); - if (onSave) - { - AZStd::invoke(onSave, saveSuccess, asset, previousAssetId); - } - }; - - AssetTrackerRequestBus::Broadcast(&AssetTrackerRequests::Save, assetId, onSaveCallback); - UpdateSaveState(); + PrepareAssetForSave(inMemoryAssetId); ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeGraph); + AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, inMemoryAssetId); // Disable the current view if we are saving. if (memoryAsset) @@ -2055,15 +2020,6 @@ namespace ScriptCanvasEditor DisableAssetView(memoryAsset); } - BlockCloseRequests(); - */ - } - - void MainWindow::SaveNewAsset(AZStd::string_view /*path*/, ScriptCanvasEditor::SourceHandle /*inMemoryAssetId*/, const Callbacks::OnSave& /*onSave*/) - { - /* - PrepareAssetForSave(inMemoryAssetId); - auto onSaveCallback = [this, onSave](bool saveSuccess, AZ::Data::AssetPtr asset, ScriptCanvasEditor::SourceHandle previousAssetId) { OnSaveCallback(saveSuccess, asset, previousAssetId); @@ -2072,19 +2028,36 @@ namespace ScriptCanvasEditor AZStd::invoke(onSave, saveSuccess, asset, previousAssetId); } }; - AssetTrackerRequestBus::Broadcast(&AssetTrackerRequests::SaveAs, inMemoryAssetId, path, onSaveCallback); - UpdateSaveState(); + AZ::Data::AssetStreamInfo streamInfo; + streamInfo.m_streamFlags = AZ::IO::OpenMode::ModeWrite; + streamInfo.m_streamName = m_saveAsPath; - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, inMemoryAssetId); + if (!streamInfo.IsValid()) + { + return; + } - // Disable the current view if we are saving. - if (memoryAsset) + bool sourceControlActive = false; + AzToolsFramework::SourceControlConnectionRequestBus::BroadcastResult(sourceControlActive, &AzToolsFramework::SourceControlConnectionRequests::IsActive); + // If Source Control is active then use it to check out the file before saving otherwise query the file info and save only if the file is not read-only + if (sourceControlActive) { - DisableAssetView(memoryAsset); + AzToolsFramework::SourceControlCommandBus::Broadcast(&AzToolsFramework::SourceControlCommandBus::Events::RequestEdit, + streamInfo.m_streamName.c_str(), + true, + [this, streamInfo, onSaveCallback](bool success, AzToolsFramework::SourceControlFileInfo info) { FinalizeAssetSave(success, info, streamInfo, onSaveCallback); } + ); + } + else + { + AzToolsFramework::SourceControlCommandBus::Broadcast(&AzToolsFramework::SourceControlCommandBus::Events::GetFileInfo, + streamInfo.m_streamName.c_str(), + [this, streamInfo, onSaveCallback](bool success, AzToolsFramework::SourceControlFileInfo info) { FinalizeAssetSave(success, info, streamInfo, onSaveCallback); } + ); } + UpdateSaveState(); BlockCloseRequests(); */ } @@ -2505,7 +2478,6 @@ namespace ScriptCanvasEditor if (eraseCount == 0) { AZStd::string fullPath = AZStd::string::format("%s/%s", rootFilePath.c_str(), assetInfo.m_relativePath.c_str()); - AddRecentFile(fullPath.c_str()); } } } @@ -2568,69 +2540,55 @@ namespace ScriptCanvasEditor AZ::EntityId MainWindow::GetActiveGraphCanvasGraphId() const { - // #se_editor_asset + AZ::EntityId graphId{}; - // AZ::EntityId graphId; - // AssetTrackerRequestBus::BroadcastResult(graphId, &AssetTrackerRequests::GetGraphId, m_activeGraph); - /* - * Falls through to this, which falls through to editor graph, move to canvas widget - AZ::EntityId ScriptCanvasMemoryAsset::GetGraphId() - { - if (!m_graphId.IsValid()) + if (m_activeGraph) { - EditorGraphRequestBus::EventResult(m_graphId, m_scriptCanvasId, &EditorGraphRequests::GetGraphCanvasGraphId); + EditorGraphRequestBus::EventResult + ( graphId, m_activeGraph.Get()->GetScriptCanvasId(), &EditorGraphRequests::GetGraphCanvasGraphId); } - return m_graphId; - } - */ - return AZ::EntityId{}; + return graphId; } ScriptCanvas::ScriptCanvasId MainWindow::GetActiveScriptCanvasId() const { - // ScriptCanvas::ScriptCanvasId sceneId; - // AssetTrackerRequestBus::BroadcastResult(sceneId, &AssetTrackerRequests::GetScriptCanvasId, m_activeGraph); - // #se_editor_asset - return ScriptCanvas::ScriptCanvasId{}; + return FindScriptCanvasIdByAssetId(m_activeGraph); } - GraphCanvas::GraphId MainWindow::GetGraphCanvasGraphId(const ScriptCanvas::ScriptCanvasId& /*scriptCanvasId*/) const + GraphCanvas::GraphId MainWindow::GetGraphCanvasGraphId(const ScriptCanvas::ScriptCanvasId& scriptCanvasId) const { - // #se_editor_asset - // AZ::EntityId graphCanvasId; - // AssetTrackerRequestBus::BroadcastResult(graphCanvasId, &AssetTrackerRequests::GetGraphCanvasId, scriptCanvasId); - // move to widget - return AZ::EntityId{}; + AZ::EntityId graphId{}; + EditorGraphRequestBus::EventResult(graphId, scriptCanvasId, &EditorGraphRequests::GetGraphCanvasGraphId); + return graphId; } - GraphCanvas::GraphId MainWindow::FindGraphCanvasGraphIdByAssetId(const ScriptCanvasEditor::SourceHandle& /*assetId*/) const + GraphCanvas::GraphId MainWindow::FindGraphCanvasGraphIdByAssetId(const ScriptCanvasEditor::SourceHandle& assetId) const { - // #se_editor_asset - // AZ::EntityId graphId; - // AssetTrackerRequestBus::BroadcastResult(graphId, &AssetTrackerRequests::GetGraphId, assetId); - return AZ::EntityId{}; + AZ::EntityId graphId{}; + + if (assetId) + { + EditorGraphRequestBus::EventResult + ( graphId, assetId.Get()->GetScriptCanvasId(), &EditorGraphRequests::GetGraphCanvasGraphId); + } + + return graphId; } - ScriptCanvas::ScriptCanvasId MainWindow::FindScriptCanvasIdByAssetId(const ScriptCanvasEditor::SourceHandle& /*assetId*/) const + ScriptCanvas::ScriptCanvasId MainWindow::FindScriptCanvasIdByAssetId(const ScriptCanvasEditor::SourceHandle& assetId) const { - // #se_editor_asset - // ScriptCanvas::ScriptCanvasId scriptCanvasId; - // AssetTrackerRequestBus::BroadcastResult(scriptCanvasId, &AssetTrackerRequests::GetScriptCanvasId, assetId); - return ScriptCanvas::ScriptCanvasId{}; + return assetId ? assetId.Get()->GetScriptCanvasId() : ScriptCanvas::ScriptCanvasId{}; } - ScriptCanvas::ScriptCanvasId MainWindow::GetScriptCanvasId(const GraphCanvas::GraphId& /*graphCanvasGraphId*/) const + ScriptCanvas::ScriptCanvasId MainWindow::GetScriptCanvasId(const GraphCanvas::GraphId& graphCanvasGraphId) const { - // #se_editor_asset - // ScriptCanvas::ScriptCanvasId scriptCanvasId; - // AssetTrackerRequestBus::BroadcastResult(scriptCanvasId, &AssetTrackerRequests::GetScriptCanvasIdFromGraphId, graphCanvasGraphId); - return ScriptCanvas::ScriptCanvasId{}; + return m_tabBar->FindScriptCanvasIdFromGraphCanvasId(graphCanvasGraphId); } bool MainWindow::IsInUndoRedo(const AZ::EntityId& graphCanvasGraphId) const { - // #se_editor_asset + // #sc_editor_asset bool isActive = false; UndoRequestBus::EventResult(isActive, GetScriptCanvasId(graphCanvasGraphId), &UndoRequests::IsActive); return isActive; @@ -2662,8 +2620,8 @@ namespace ScriptCanvasEditor QVariant tabdata = m_tabBar->tabData(tabIndex); if (tabdata.isValid()) { - auto tabAssetId = tabdata.value(); - if (tabAssetId == assetId) + auto tabAssetId = tabdata.value(); + if (tabAssetId.m_assetId == assetId) { return tabdata; } @@ -2683,21 +2641,15 @@ namespace ScriptCanvasEditor return false; } - void MainWindow::ReconnectSceneBuses(ScriptCanvasEditor::SourceHandle /*previousAssetId*/, ScriptCanvasEditor::SourceHandle /*nextAssetId*/) + void MainWindow::ReconnectSceneBuses(ScriptCanvasEditor::SourceHandle previousAsset, ScriptCanvasEditor::SourceHandle nextAsset) { - // #se_editor_asset - /* - ScriptCanvasMemoryAsset::pointer previousAsset; - AssetTrackerRequestBus::BroadcastResult(previousAsset, &AssetTrackerRequests::GetAsset, previousAssetId); - - ScriptCanvasMemoryAsset::pointer nextAsset; - AssetTrackerRequestBus::BroadcastResult(nextAsset, &AssetTrackerRequests::GetAsset, nextAssetId); - + // #sc_editor_asset + // Disconnect previous asset AZ::EntityId previousScriptCanvasSceneId; if (previousAsset) { - previousScriptCanvasSceneId = previousAsset->GetScriptCanvasId(); + previousScriptCanvasSceneId = previousAsset.Get()->GetScriptCanvasId(); GraphCanvas::SceneNotificationBus::MultiHandler::BusDisconnect(previousScriptCanvasSceneId); } @@ -2705,7 +2657,8 @@ namespace ScriptCanvasEditor if (nextAsset) { // Connect the next asset - nextAssetGraphCanvasId = nextAsset->GetGraphId(); + EditorGraphRequestBus::EventResult(nextAssetGraphCanvasId, nextAsset.Get()->GetScriptCanvasId(), &EditorGraphRequests::GetGraphCanvasGraphId); + if (nextAssetGraphCanvasId.IsValid()) { GraphCanvas::SceneNotificationBus::MultiHandler::BusConnect(nextAssetGraphCanvasId); @@ -2718,13 +2671,12 @@ namespace ScriptCanvasEditor // Notify about the graph refresh GraphCanvas::AssetEditorNotificationBus::Event(ScriptCanvasEditor::AssetEditorId, &GraphCanvas::AssetEditorNotifications::OnGraphRefreshed, previousScriptCanvasSceneId, nextAssetGraphCanvasId); - */ } - void MainWindow::SetActiveAsset(const ScriptCanvasEditor::SourceHandle& /*fileAssetId*/) + void MainWindow::SetActiveAsset(const ScriptCanvasEditor::SourceHandle& fileAssetId) { - // #se_editor_asset - /* + // #sc_editor_asset + if (m_activeGraph == fileAssetId) { return; @@ -2747,98 +2699,61 @@ namespace ScriptCanvasEditor if (m_activeGraph.IsValid()) { - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeGraph); - // If we are saving the asset, the Id may have changed from the in-memory to the file asset Id, in that case, // there's no need to hide the view or remove the widget - if (memoryAsset && memoryAsset->GetView()) + auto oldTab = m_tabBar->FindTab(m_activeGraph); + if (auto view = m_tabBar->ModTabView(oldTab)) { - memoryAsset->GetView()->hide(); - m_layout->removeWidget(memoryAsset->GetView()); + view->hide(); + m_layout->removeWidget(view); + m_tabBar->ClearTabView(oldTab); } } if (fileAssetId.IsValid()) { ScriptCanvasEditor::SourceHandle previousAssetId = m_activeGraph; - m_activeGraph = fileAssetId; RefreshActiveAsset(); - ReconnectSceneBuses(previousAssetId, m_activeGraph); } else { ScriptCanvasEditor::SourceHandle previousAssetId = m_activeGraph; - m_activeGraph.Clear(); m_emptyCanvas->show(); - ReconnectSceneBuses(previousAssetId, m_activeGraph); - SignalActiveSceneChanged(ScriptCanvasEditor::SourceHandle()); } UpdateUndoCache(fileAssetId); - - RefreshSelection(); - */ + RefreshSelection(); } void MainWindow::RefreshActiveAsset() { - // #se_editor_asset - /* if (m_activeGraph.IsValid()) { AssetHelpers::PrintInfo("RefreshActiveAsset : m_activeGraph (%s)", m_activeGraph.ToString().c_str()); - - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeGraph); - - if (memoryAsset) + if (auto view = m_tabBar->ModOrCreateTabView(m_tabBar->FindTab(m_activeGraph))) { - AZ::EntityId sceneEntityId = memoryAsset->GetScriptCanvasId(); - - const auto& scriptCanvasAsset = memoryAsset->GetAsset(); - - if (scriptCanvasAsset.IsReady() && scriptCanvasAsset.Get()->GetScriptCanvasEntity()->GetState() == AZ::Entity::State::Active) - { - if (!memoryAsset->GetView()) - { - memoryAsset->CreateView(m_tabBar); - } - - auto view = memoryAsset->GetView(); - AZ_Assert(view, "Asset should have a view"); - if (view) - { - AssetHelpers::PrintInfo("RefreshActiveAsset : m_activeGraph (%s)", m_activeGraph.ToString().c_str()); - - view->ShowScene(sceneEntityId); - m_layout->addWidget(view); - view->show(); - - m_emptyCanvas->hide(); - } - - SignalActiveSceneChanged(m_activeGraph); - } + view->ShowScene(m_activeGraph.Get()->GetScriptCanvasId()); + m_layout->addWidget(view); + view->show(); + m_emptyCanvas->hide(); + SignalActiveSceneChanged(m_activeGraph); } else { - // If we couldn't load a memory asset for our active asset. Just set ourselves to invalid. SetActiveAsset({}); } } - */ } void MainWindow::Clear() { m_tabBar->CloseAllTabs(); - // #se_editor_asset + // #sc_editor_asset // // AssetTrackerRequests::AssetList assets; // AssetTrackerRequestBus::BroadcastResult(assets, &AssetTrackerRequests::GetAssets); @@ -2857,12 +2772,12 @@ namespace ScriptCanvasEditor QVariant tabdata = m_tabBar->tabData(index); if (tabdata.isValid()) { - auto fileAssetId = tabdata.value(); + auto fileAssetId = tabdata.value(); Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::NEW; bool isSaving = false; - // #se_editor_asset Get from widgets + // #sc_editor_asset Get from widgets /* AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, fileAssetId); AssetTrackerRequestBus::BroadcastResult(isSaving, &AssetTrackerRequests::IsSaving, fileAssetId); @@ -2876,9 +2791,9 @@ namespace ScriptCanvasEditor UnsavedChangesOptions saveDialogResults = UnsavedChangesOptions::CONTINUE_WITHOUT_SAVING; if (!isSaving && (fileState == Tracker::ScriptCanvasFileState::NEW || fileState == Tracker::ScriptCanvasFileState::MODIFIED || fileState == Tracker::ScriptCanvasFileState::SOURCE_REMOVED)) { - SetActiveAsset(fileAssetId); + SetActiveAsset(fileAssetId.m_assetId); - // #se_editor_asset + // #sc_editor_asset AZStd::string tabName = "Get from widget"; // AssetTrackerRequestBus::BroadcastResult(tabName, &AssetTrackerRequests::GetTabName, fileAssetId); @@ -2887,7 +2802,7 @@ namespace ScriptCanvasEditor if (saveDialogResults == UnsavedChangesOptions::SAVE) { - // #se_editor_asset + // #sc_editor_asset // auto saveCB = [this](bool isSuccessful, AZ::Data::AssetPtr asset, ScriptCanvasEditor::SourceHandle) // { // if (isSuccessful) @@ -2929,10 +2844,9 @@ namespace ScriptCanvasEditor QVariant tabdata = m_tabBar->tabData(index); if (tabdata.isValid()) { - auto assetId = tabdata.value(); - SaveAssetImpl(assetId, nullptr); + auto assetId = tabdata.value(); + SaveAssetAsImpl(assetId.m_assetId, nullptr); } - } void MainWindow::CloseAllTabs() @@ -2948,7 +2862,7 @@ namespace ScriptCanvasEditor QVariant tabdata = m_tabBar->tabData(index); if (tabdata.isValid()) { - auto assetId = tabdata.value(); + auto assetId = tabdata.value().m_assetId; m_isClosingTabs = true; m_skipTabOnClose = assetId; @@ -2958,7 +2872,7 @@ namespace ScriptCanvasEditor void MainWindow::CopyPathToClipboard(int /*index*/) { - // #se_editor_asset + // #sc_editor_asset /* QVariant tabdata = m_tabBar->tabData(index); @@ -2966,7 +2880,7 @@ namespace ScriptCanvasEditor { QClipboard* clipBoard = QGuiApplication::clipboard(); - auto assetId = tabdata.value(); + auto assetId = tabdata.value(); ScriptCanvasMemoryAsset::pointer memoryAsset; AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); @@ -3008,9 +2922,9 @@ namespace ScriptCanvasEditor QVariant tabdata = m_tabBar->tabData(tab); if (tabdata.isValid()) { - auto assetId = tabdata.value(); + auto assetId = tabdata.value(); - if (assetId != m_skipTabOnClose) + if (assetId.m_assetId != m_skipTabOnClose) { break; } @@ -3029,7 +2943,7 @@ namespace ScriptCanvasEditor QVariant tabdata = m_tabBar->tabData(index); if (tabdata.isValid()) { - auto tabAssetId = tabdata.value(); + auto tabAssetId = tabdata.value(); if (tabAssetId == m_activeGraph) { @@ -3696,7 +3610,7 @@ namespace ScriptCanvasEditor void MainWindow::UpdateSaveState() { - // #se_editor_asset todo, consider making blocking + // #sc_editor_asset todo, consider making blocking // bool enabled = m_activeGraph.IsValid(); // bool isSaving = false; // bool hasModifications = false; @@ -3912,7 +3826,7 @@ namespace ScriptCanvasEditor AZ::EntityId MainWindow::FindEditorNodeIdByAssetNodeId(const ScriptCanvasEditor::SourceHandle& /*assetId*/, AZ::EntityId /*assetNodeId*/) const { - // #se_editor_asset + // #sc_editor_asset return AZ::EntityId{}; // AZ::EntityId editorEntityId; // AssetTrackerRequestBus::BroadcastResult(editorEntityId, &AssetTrackerRequests::GetEditorEntityIdFromSceneEntityId, assetId, assetNodeId); @@ -3921,7 +3835,7 @@ namespace ScriptCanvasEditor AZ::EntityId MainWindow::FindAssetNodeIdByEditorNodeId(const ScriptCanvasEditor::SourceHandle& /*assetId*/, AZ::EntityId /*editorNodeId*/) const { - // #se_editor_asset + // #sc_editor_asset return AZ::EntityId{}; // AZ::EntityId sceneEntityId; // AssetTrackerRequestBus::BroadcastResult(sceneEntityId, &AssetTrackerRequests::GetSceneEntityIdFromEditorEntityId, assetId, editorNodeId); @@ -4415,7 +4329,7 @@ namespace ScriptCanvasEditor void MainWindow::OnAssignToSelectedEntities() { - // #se_editor_asset consider cutting + // #sc_editor_asset consider cutting // Tracker::ScriptCanvasFileState fileState; // AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, m_activeGraph); // @@ -4489,7 +4403,7 @@ namespace ScriptCanvasEditor ScriptCanvasEditor::Tracker::ScriptCanvasFileState MainWindow::GetAssetFileState(ScriptCanvasEditor::SourceHandle /*assetId*/) const { - // #se_editor_asset + // #sc_editor_asset return Tracker::ScriptCanvasFileState::INVALID; // Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::INVALID; // AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, assetId); @@ -4542,7 +4456,7 @@ namespace ScriptCanvasEditor if (usableRequestBus) { ScriptCanvasMemoryAsset::pointer memoryAsset; - // #se_editor_asset + // #sc_editor_asset // AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeGraph); if (memoryAsset) @@ -4599,6 +4513,7 @@ namespace ScriptCanvasEditor m_filesToOpen.pop_front(); OpenFile(nextFile.toUtf8().data()); + OpenNextFile(); } else { diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h index 1c98769463..ee93308035 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h @@ -230,7 +230,7 @@ namespace ScriptCanvasEditor , private VariablePaletteRequestBus::Handler , private ScriptCanvas::BatchOperationNotificationBus::Handler , private AssetGraphSceneBus::Handler - , private AssetTrackerNotificationBus::MultiHandler + //, private AssetTrackerNotificationBus::MultiHandler #if SCRIPTCANVAS_EDITOR //, public IEditorNotifyListener #endif @@ -421,7 +421,7 @@ namespace ScriptCanvasEditor //! GeneralRequestBus AZ::Outcome OpenScriptCanvasAssetId(const SourceHandle& assetId) override; AZ::Outcome OpenScriptCanvasAsset(SourceHandle scriptCanvasAssetId, int tabIndex = -1) override; - AZ::Outcome OpenScriptCanvasAsset(const ScriptCanvasMemoryAsset& scriptCanvasAsset, int tabIndex = -1); + AZ::Outcome OpenScriptCanvasAssetImplementation(const SourceHandle& sourceHandle, int tabIndex = -1); int CloseScriptCanvasAsset(const SourceHandle& assetId) override; bool CreateScriptCanvasAssetFor(const TypeDefs::EntityComponentId& requestingEntityId) override; @@ -556,8 +556,7 @@ namespace ScriptCanvasEditor bool ActivateAndSaveAsset(const ScriptCanvasEditor::SourceHandle& unsavedAssetId, const Callbacks::OnSave& onSave); - void SaveNewAsset(AZStd::string_view path, ScriptCanvasEditor::SourceHandle assetId, const Callbacks::OnSave& onSave); - void SaveAsset(ScriptCanvasEditor::SourceHandle assetId, const Callbacks::OnSave& onSave); + void SaveAs(AZStd::string_view path, ScriptCanvasEditor::SourceHandle assetId, const Callbacks::OnSave& onSave); void OpenFile(const char* fullPath); void CreateMenus(); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp index 09c21fe43f..15e2192ee8 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp @@ -190,12 +190,27 @@ namespace ScriptCanvas namespace ScriptCanvasEditor { + SourceHandle::SourceHandle(const SourceHandle& data, const AZ::Uuid& id, AZStd::string_view path) + : m_data(data.m_data) + , m_id(id) + , m_path(path) + { + + } + SourceHandle::SourceHandle(ScriptCanvas::DataPtr graph, const AZ::Uuid& id, AZStd::string_view path) : m_data(graph) , m_id(id) , m_path(path) {} + bool SourceHandle::AnyEquals(const SourceHandle& other) const + { + return m_data == other.m_data + || m_id == other.m_id + || m_path == other.m_path; + } + void SourceHandle::Clear() { m_data = nullptr; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h index 4c1734413c..1a81345054 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h @@ -326,8 +326,12 @@ namespace ScriptCanvasEditor SourceHandle() = default; + SourceHandle(const SourceHandle& data, const AZ::Uuid& id, AZStd::string_view path); + SourceHandle(ScriptCanvas::DataPtr graph, const AZ::Uuid& id, AZStd::string_view path); + bool AnyEquals(const SourceHandle& other) const; + void Clear(); GraphPtrConst Get() const; @@ -391,11 +395,28 @@ namespace AZStd { using argument_type = ScriptCanvas::SlotId; using result_type = AZStd::size_t; - AZ_FORCE_INLINE size_t operator()(const argument_type& ref) const + + inline size_t operator()(const argument_type& ref) const { return AZStd::hash()(ref.m_id); } }; + + template<> + struct hash + { + using argument_type = ScriptCanvasEditor::SourceHandle; + using result_type = AZStd::size_t; + + inline size_t operator()(const argument_type& handle) const + { + size_t h = 0; + hash_combine(h, handle.Id()); + hash_combine(h, handle.Path()); + hash_combine(h, handle.Get()); + return h; + } + }; } #define SCRIPT_CANVAS_INFINITE_LOOP_DETECTION_COUNT (2000000) From 20147ddafbccd14831c9cbb1fa9b117f5891601f Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Wed, 3 Nov 2021 21:12:29 -0700 Subject: [PATCH 046/948] it renders! Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Source/Components/SceneComponent.cpp | 1 + .../Editor/Assets/ScriptCanvasFileHandling.cpp | 6 +++++- .../Code/Editor/Components/EditorGraph.cpp | 2 +- .../Code/Editor/View/Widgets/GraphTabBar.cpp | 1 + .../Code/Editor/View/Windows/MainWindow.cpp | 15 ++++----------- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/Gems/GraphCanvas/Code/Source/Components/SceneComponent.cpp b/Gems/GraphCanvas/Code/Source/Components/SceneComponent.cpp index 52e7892364..e821ea9be2 100644 --- a/Gems/GraphCanvas/Code/Source/Components/SceneComponent.cpp +++ b/Gems/GraphCanvas/Code/Source/Components/SceneComponent.cpp @@ -669,6 +669,7 @@ namespace GraphCanvas { GeometryNotificationBus::Handler::BusDisconnect(); SceneNotificationBus::Handler::BusDisconnect(); + AZ::SystemTickBus::Handler::BusDisconnect(); } void GestureSceneHelper::TrackElement(const AZ::EntityId& elementId) diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp index e8ee2ed97c..0acbf640b0 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp @@ -99,7 +99,11 @@ namespace ScriptCanvasEditor } const auto& asString = fileStringOutcome.GetValue(); - DataPtr scriptCanvasData = Graph::Create(); + DataPtr scriptCanvasData = AZStd::make_shared(); + if (!scriptCanvasData) + { + return AZ::Failure(AZStd::string("failed to allocate ScriptCanvas::ScriptCanvasData after loading source file")); + } AZ::SerializeContext* serializeContext = nullptr; AZ::ComponentApplicationBus::BroadcastResult(serializeContext, &AZ::ComponentApplicationRequests::GetSerializeContext); diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp index c70e4b74f3..851a920019 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp @@ -490,7 +490,7 @@ namespace ScriptCanvasEditor EditorGraphRequestBus::Handler::BusDisconnect(); SceneCounterRequestBus::Handler::BusDisconnect(); NodeCreationNotificationBus::Handler::BusDisconnect(); - + AZ::SystemTickBus::Handler::BusDisconnect(); GraphCanvas::SceneNotificationBus::Handler::BusDisconnect(); GraphCanvas::GraphModelRequestBus::Handler::BusDisconnect(); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp index ce8c280b35..11fefe59bf 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp @@ -115,6 +115,7 @@ namespace ScriptCanvasEditor CanvasWidget* canvasWidget = new CanvasWidget(assetId, this); canvasWidget->SetDefaultBorderColor(ScriptCanvasAssetDescription().GetDisplayColorImpl()); metaData.m_canvasWidget = canvasWidget; + metaData.m_assetId = assetId; AZStd::string tabName; AzFramework::StringFunc::Path::GetFileName(assetId.Path().c_str(), tabName); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 38e5f0172b..432c51374c 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -1280,16 +1280,9 @@ namespace ScriptCanvasEditor AddRecentFile(assetPath.c_str()); } - if (!m_isRestoringWorkspace) - { - SetActiveAsset(fileAssetId); - } - GraphCanvas::GraphId graphCanvasGraphId = GetGraphCanvasGraphId(scriptCanvasAsset.Get()->GetScriptCanvasId()); GraphCanvas::AssetEditorNotificationBus::Event(ScriptCanvasEditor::AssetEditorId, &GraphCanvas::AssetEditorNotifications::OnGraphLoaded, graphCanvasGraphId); - GeneralAssetNotificationBus::Event(fileAssetId, &GeneralAssetNotifications::OnAssetVisualized); - return AZ::Success(outTabIndex); } @@ -1506,14 +1499,14 @@ namespace ScriptCanvasEditor } m_errorFilePath.clear(); - m_activeGraph = ScriptCanvasEditor::SourceHandle(outcome.TakeValue(), assetInfo.m_assetId.m_guid, fullPath); + auto activeGraph = ScriptCanvasEditor::SourceHandle(outcome.TakeValue(), assetInfo.m_assetId.m_guid, fullPath); - auto openOutcome = OpenScriptCanvasAsset(m_activeGraph); + auto openOutcome = OpenScriptCanvasAsset(activeGraph); if (openOutcome) { RunGraphValidation(false); - SetRecentAssetId(m_activeGraph); - SetActiveAsset(m_activeGraph); + SetActiveAsset(activeGraph); + SetRecentAssetId(activeGraph); } else { From d40b9fc809c11381afbcecaff476ea49e92bd1b2 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Thu, 4 Nov 2021 15:58:19 -0700 Subject: [PATCH 047/948] add file state for graphs Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Assets/ScriptCanvasFileHandling.cpp | 3 + .../Code/Editor/Components/EditorGraph.cpp | 30 ++++---- .../ScriptCanvas/Components/EditorGraph.h | 5 +- .../Code/Editor/SystemComponent.cpp | 4 +- .../Code/Editor/View/Widgets/GraphTabBar.cpp | 75 ++++++++++++++----- .../Code/Editor/View/Widgets/GraphTabBar.h | 10 ++- .../VariablePanel/GraphVariablesTableView.cpp | 5 +- .../Code/Editor/View/Windows/MainWindow.cpp | 33 ++------ .../Code/Editor/View/Windows/MainWindow.h | 2 +- .../Code/Include/ScriptCanvas/Core/Core.h | 1 + .../Code/Include/ScriptCanvas/Core/Graph.cpp | 5 -- .../Code/Include/ScriptCanvas/Core/Graph.h | 4 +- .../Code/Include/ScriptCanvas/Core/GraphBus.h | 3 - .../ScriptCanvas/Variable/GraphVariable.cpp | 8 -- .../ScriptCanvas/Variable/GraphVariable.h | 4 +- 15 files changed, 99 insertions(+), 93 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp index 0acbf640b0..42dcf81a8d 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp @@ -132,6 +132,9 @@ namespace ScriptCanvasEditor { entity->Init(); entity->Activate(); + + auto graph = entity->FindComponent(); + graph->MarkOwnership(*scriptCanvasData); } return AZ::Success(ScriptCanvasEditor::SourceHandle(scriptCanvasData, {}, path)); diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp index 851a920019..2a15371e93 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp @@ -1030,14 +1030,16 @@ namespace ScriptCanvasEditor { AZStd::any* connectionUserData = nullptr; GraphCanvas::ConnectionRequestBus::EventResult(connectionUserData, connectionId, &GraphCanvas::ConnectionRequests::GetUserData); - auto scConnectionId = connectionUserData && connectionUserData->is() ? *AZStd::any_cast(connectionUserData) : AZ::EntityId(); + auto scConnectionId = connectionUserData && connectionUserData->is() + ? *AZStd::any_cast(connectionUserData) + : AZ::EntityId(); - ScriptCanvas::Connection* connection = AZ::EntityUtils::FindFirstDerivedComponent(scConnectionId); - - if (connection) + if (ScriptCanvas::Connection* connection = AZ::EntityUtils::FindFirstDerivedComponent(scConnectionId)) { - ScriptCanvas::GraphNotificationBus::Event(GetScriptCanvasId(), &ScriptCanvas::GraphNotifications::OnDisonnectionComplete, connectionId); - + ScriptCanvas::GraphNotificationBus::Event + ( GetScriptCanvasId() + , &ScriptCanvas::GraphNotifications::OnDisonnectionComplete + , connectionId); DisconnectById(scConnectionId); } } @@ -1047,12 +1049,12 @@ namespace ScriptCanvasEditor if (AZ::Entity* entity = aznew AZ::Entity("Script Canvas Graph")) { auto graph = entity->CreateComponent(); - graph->SetAssetType(azrtti_typeid()); entity->CreateComponent(graph->GetScriptCanvasId()); if (ScriptCanvas::DataPtr data = AZStd::make_shared()) { data->m_scriptCanvasEntity.reset(entity); + graph->MarkOwnership(*data); return data; } } @@ -1060,6 +1062,11 @@ namespace ScriptCanvasEditor return nullptr; } + void Graph::MarkOwnership(ScriptCanvas::ScriptCanvasData& owner) + { + m_owner = &owner; + } + bool Graph::CreateConnection(const GraphCanvas::ConnectionId& connectionId, const GraphCanvas::Endpoint& sourcePoint, const GraphCanvas::Endpoint& targetPoint) { if (!sourcePoint.IsValid() || !targetPoint.IsValid()) @@ -1342,8 +1349,8 @@ namespace ScriptCanvasEditor void Graph::SignalDirty() { - // #sc_editor_asset - // GeneralRequestBus::Broadcast(&GeneralRequests::SignalSceneDirty, GetAssetId()); + SourceHandle handle(ScriptCanvas::DataPtr(m_owner), {}, {}); + GeneralRequestBus::Broadcast(&GeneralRequests::SignalSceneDirty, handle); } void Graph::HighlightNodesByType(const ScriptCanvas::NodeTypeIdentifier& nodeTypeIdentifier) @@ -3374,11 +3381,6 @@ namespace ScriptCanvasEditor } } - void Graph::SetAssetType(AZ::Data::AssetType assetType) - { - m_assetType = assetType; - } - void Graph::ReportError(const ScriptCanvas::Node& node, const AZStd::string& errorSource, const AZStd::string& errorMessage) { AzQtComponents::ToastConfiguration toastConfiguration(AzQtComponents::ToastType::Error, errorSource.c_str(), errorMessage.c_str()); diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h index c0c8584cbd..526c929664 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h @@ -304,12 +304,12 @@ namespace ScriptCanvasEditor void OnUndoRedoEnd() override; //// - void SetAssetType(AZ::Data::AssetType); - void ReportError(const ScriptCanvas::Node& node, const AZStd::string& errorSource, const AZStd::string& errorMessage) override; const GraphStatisticsHelper& GetNodeUsageStatistics() const; + void MarkOwnership(ScriptCanvas::ScriptCanvasData& owner); + // Finds and returns all nodes within the graph that are of the specified type template AZStd::vector GetNodesOfType() const @@ -393,5 +393,6 @@ namespace ScriptCanvasEditor bool m_saveFormatConverted = true; ScriptCanvasEditor::SourceHandle m_assetId; + ScriptCanvas::ScriptCanvasData* m_owner; }; } diff --git a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp index 0246071172..ab8cd0e61b 100644 --- a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp @@ -173,13 +173,11 @@ namespace ScriptCanvasEditor outCreatableTypes.insert(m_creatableTypes.begin(), m_creatableTypes.end()); } - void SystemComponent::CreateEditorComponentsOnEntity(AZ::Entity* entity, const AZ::Data::AssetType& assetType) + void SystemComponent::CreateEditorComponentsOnEntity(AZ::Entity* entity, [[maybe_unused]] const AZ::Data::AssetType& assetType) { if (entity) { auto graph = entity->CreateComponent(); - graph->SetAssetType(assetType); - entity->CreateComponent(graph->GetScriptCanvasId()); } } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp index 11fefe59bf..029d713277 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp @@ -105,6 +105,44 @@ namespace ScriptCanvasEditor return nullptr; } + AZStd::optional GraphTabBar::GetTabData(int tabIndex) const + { + if (tabIndex < count()) + { + if (QVariant tabDataVariant = tabData(tabIndex); tabDataVariant.isValid()) + { + return tabDataVariant.value(); + } + } + + return AZStd::nullopt; + } + + AZStd::optional GraphTabBar::GetTabData(ScriptCanvasEditor::SourceHandle assetId) const + { + return GetTabData(FindTab(assetId)); + } + + void GraphTabBar::SetTabData(const GraphTabMetadata& metadata, int tabIndex) + { + if (tabIndex < count()) + { + setTabData(tabIndex, QVariant::fromValue(metadata)); + } + } + + void GraphTabBar::SetTabData(const GraphTabMetadata& metadata, ScriptCanvasEditor::SourceHandle assetId) + { + auto index = FindTab(assetId); + auto replacement = GetTabData(assetId); + + if (index >= 0 && replacement) + { + replacement->m_assetId = assetId; + SetTabData(metadata, index); + } + } + int GraphTabBar::InsertGraphTab(int tabIndex, ScriptCanvasEditor::SourceHandle assetId) { if (!SelectTab(assetId)) @@ -119,6 +157,7 @@ namespace ScriptCanvasEditor AZStd::string tabName; AzFramework::StringFunc::Path::GetFileName(assetId.Path().c_str(), tabName); + metaData.m_name = tabName.c_str(); // #sc_editor_asset filestate Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::INVALID; @@ -381,6 +420,23 @@ namespace ScriptCanvasEditor Q_EMIT TabRemoved(index); } + void GraphTabBar::UpdateFileState(const ScriptCanvasEditor::SourceHandle& assetId, Tracker::ScriptCanvasFileState fileState) + { + auto tabData = GetTabData(assetId); + if (tabData && tabData->m_fileState != fileState) + { + int index = FindTab(assetId); + tabData->m_fileState = fileState; + SetTabData(*tabData, assetId); + SetTabText(index, tabData->m_name, fileState); + + if (index == currentIndex()) + { + Q_EMIT OnActiveFileStateChanged(); + } + } + } + void GraphTabBar::currentChangedTab(int index) { if (index < 0) @@ -406,25 +462,6 @@ namespace ScriptCanvasEditor } } - void GraphTabBar::SetFileState(ScriptCanvasEditor::SourceHandle, Tracker::ScriptCanvasFileState ) - { - // #sc_editor_asset - // int index = FindTab(assetId); - -// if (index >= 0 && index < count()) -// { -// QVariant tabdata = tabData(index); -// if (tabdata.isValid()) -// { -// auto tabAssetId = tabdata.value(); -// -// AZStd::string tabName; -// AssetTrackerRequestBus::BroadcastResult(tabName, &AssetTrackerRequests::GetTabName, tabAssetId); -// SetTabText(index, tabName.c_str(), fileState); -// } -// } - } - #include } } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h index 12e73b4ae5..48f327b244 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h @@ -35,6 +35,7 @@ namespace ScriptCanvasEditor QWidget* m_hostWidget = nullptr; CanvasWidget* m_canvasWidget = nullptr; Tracker::ScriptCanvasFileState m_fileState = Tracker::ScriptCanvasFileState::INVALID; + QString m_name; }; class GraphTabBar @@ -48,6 +49,11 @@ namespace ScriptCanvasEditor GraphTabBar(QWidget* parent = nullptr); ~GraphTabBar() override = default; + AZStd::optional GetTabData(int index) const; + AZStd::optional GetTabData(ScriptCanvasEditor::SourceHandle assetId) const; + void SetTabData(const GraphTabMetadata& data, int index); + void SetTabData(const GraphTabMetadata& data, ScriptCanvasEditor::SourceHandle assetId); + void AddGraphTab(ScriptCanvasEditor::SourceHandle assetId); void CloseTab(int index); void CloseAllTabs(); @@ -78,6 +84,8 @@ namespace ScriptCanvasEditor // The host widget field of the tabMetadata is not used and will not overwrite the tab data void SetTabText(int tabIndex, const QString& path, Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::INVALID); + void UpdateFileState(const ScriptCanvasEditor::SourceHandle& assetId, Tracker::ScriptCanvasFileState fileState); + Q_SIGNALS: void TabInserted(int index); void TabRemoved(int index); @@ -101,8 +109,6 @@ namespace ScriptCanvasEditor // Called when the selected tab changes void currentChangedTab(int index); - void SetFileState(ScriptCanvasEditor::SourceHandle, Tracker::ScriptCanvasFileState fileState); - int m_signalSaveOnChangeTo = -1; }; } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/GraphVariablesTableView.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/GraphVariablesTableView.cpp index 5b78c62bac..1af554dd32 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/GraphVariablesTableView.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/GraphVariablesTableView.cpp @@ -716,10 +716,7 @@ namespace ScriptCanvasEditor void GraphVariablesModel::SetActiveScene(const ScriptCanvas::ScriptCanvasId& scriptCanvasId) { ScriptCanvas::GraphVariableManagerNotificationBus::Handler::BusDisconnect(); - - m_assetType = AZ::Data::AssetType::CreateNull(); - ScriptCanvas::GraphRequestBus::EventResult(m_assetType, scriptCanvasId, &ScriptCanvas::GraphRequests::GetAssetType); - + m_assetType = azrtti_typeid(); m_scriptCanvasId = scriptCanvasId; if (m_scriptCanvasId.IsValid()) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 432c51374c..b4269d8917 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -1104,7 +1104,7 @@ namespace ScriptCanvasEditor { ScopedUndoBatch scopedUndoBatch("Modify Graph Canvas Scene"); UndoRequestBus::Event(scriptCanvasId, &UndoRequests::AddGraphItemChangeUndo, "Graph Change"); - MarkAssetModified(m_activeGraph); + UpdateFileState(m_activeGraph, Tracker::ScriptCanvasFileState::MODIFIED); } const bool forceTimer = true; @@ -1113,7 +1113,7 @@ namespace ScriptCanvasEditor void MainWindow::SignalSceneDirty(ScriptCanvasEditor::SourceHandle assetId) { - MarkAssetModified(assetId); + UpdateFileState(assetId, Tracker::ScriptCanvasFileState::MODIFIED); } void MainWindow::PushPreventUndoStateUpdate() @@ -1134,25 +1134,9 @@ namespace ScriptCanvasEditor m_preventUndoStateUpdateCount = 0; } - void MainWindow::MarkAssetModified(const ScriptCanvasEditor::SourceHandle& /*assetId*/) + void MainWindow::UpdateFileState(const ScriptCanvasEditor::SourceHandle& assetId, Tracker::ScriptCanvasFileState fileState) { -// #sc_editor_asset if (!assetId.IsValid()) -// { -// return; -// } -// -// ScriptCanvasMemoryAsset::pointer memoryAsset; -// AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); -// -// if (memoryAsset) -// { -// const auto& memoryAssetId = memoryAsset->GetId(); -// const Tracker::ScriptCanvasFileState& fileState = GetAssetFileState(memoryAssetId); -// if (fileState != Tracker::ScriptCanvasFileState::NEW) -// { -// AssetTrackerRequestBus::Broadcast(&AssetTrackerRequests::UpdateFileState, memoryAssetId, Tracker::ScriptCanvasFileState::MODIFIED); -// } -// } + m_tabBar->UpdateFileState(assetId, fileState); } void MainWindow::RefreshScriptCanvasAsset(const AZ::Data::Asset& /*asset*/) @@ -4394,13 +4378,10 @@ namespace ScriptCanvasEditor } } - ScriptCanvasEditor::Tracker::ScriptCanvasFileState MainWindow::GetAssetFileState(ScriptCanvasEditor::SourceHandle /*assetId*/) const + ScriptCanvasEditor::Tracker::ScriptCanvasFileState MainWindow::GetAssetFileState(ScriptCanvasEditor::SourceHandle assetId) const { - // #sc_editor_asset - return Tracker::ScriptCanvasFileState::INVALID; - // Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::INVALID; - // AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, assetId); - // return fileState; + auto dataOptional = m_tabBar->GetTabData(assetId); + return dataOptional ? dataOptional->m_fileState : Tracker::ScriptCanvasFileState::INVALID; } void MainWindow::AssignGraphToEntityImpl(const AZ::EntityId& entityId) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h index ee93308035..0a687e0011 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h @@ -548,7 +548,7 @@ namespace ScriptCanvasEditor //! \param asset asset to save void GetSuggestedFullFilenameToSaveAs(const ScriptCanvasEditor::SourceHandle& assetId, AZStd::string& filePath, AZStd::string& fileFilter); - void MarkAssetModified(const ScriptCanvasEditor::SourceHandle& assetId); + void UpdateFileState(const ScriptCanvasEditor::SourceHandle& assetId, Tracker::ScriptCanvasFileState fileState); // QMainWindow void closeEvent(QCloseEvent *event) override; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h index 1a81345054..ece7008b06 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h @@ -360,6 +360,7 @@ namespace ScriptCanvasEditor namespace ScriptCanvas { class ScriptCanvasData + : public AZStd::enable_shared_from_this { public: diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp index 9d848ff998..ee500514dc 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp @@ -1190,11 +1190,6 @@ namespace ScriptCanvas m_isObserved = isObserved; } - AZ::Data::AssetType Graph::GetAssetType() const - { - return m_assetType; - } - void Graph::VersioningRemoveSlot(ScriptCanvas::Node& scriptCanvasNode, const SlotId& slotId) { bool deletedSlot = true; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.h index 786e693a04..76fc3a6c7b 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.h @@ -187,8 +187,6 @@ namespace ScriptCanvas bool IsGraphObserved() const override; void SetIsGraphObserved(bool isObserved) override; - - AZ::Data::AssetType GetAssetType() const override; //// const AZStd::unordered_map& GetNodeMapping() const { return m_nodeMapping; } @@ -198,7 +196,7 @@ namespace ScriptCanvas GraphData m_graphData; AZ::Data::AssetType m_assetType; - + private: ScriptCanvasId m_scriptCanvasId; ExecutionMode m_executionMode = ExecutionMode::Interpreted; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/GraphBus.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/GraphBus.h index 6b7133d47e..53d1a95964 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/GraphBus.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/GraphBus.h @@ -147,9 +147,6 @@ namespace ScriptCanvas //! returns a pair of with the supplied id //! The variable datum pointer is non-null if the variable has been found virtual GraphVariable* FindVariableById(const VariableId& variableId) = 0; - - virtual AZ::Data::AssetType GetAssetType() const = 0; - }; using GraphRequestBus = AZ::EBus; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.cpp index 3d76883adc..8b8dfdc3fc 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.cpp @@ -493,14 +493,6 @@ namespace ScriptCanvas return m_sortPriority; } - bool GraphVariable::IsInFunction() const - { - AZ::Data::AssetType assetType = AZ::Data::AssetType::CreateNull(); - ScriptCanvas::GraphRequestBus::EventResult(assetType, m_scriptCanvasId, &ScriptCanvas::GraphRequests::GetAssetType); - - return assetType == azrtti_typeid(); - } - AZ::u32 GraphVariable::OnInitialValueSourceChanged() { VariableNotificationBus::Event(GetGraphScopedId(), &VariableNotifications::OnVariableInitialValueSourceChanged); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.h index dbc0a814c6..e7829ca6c1 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.h @@ -194,9 +194,7 @@ namespace ScriptCanvas choices.emplace_back(AZStd::make_pair(static_cast(VariableFlags::Scope::Function), s_ScopeNames[1])); return choices; } - - bool IsInFunction() const; - + void OnScopeTypedChanged(); AZ::u32 OnInitialValueSourceChanged(); void OnSortPriorityChanged(); From 1ea245e46cde2f350d0a0e3b057b4304c8d088b6 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Mon, 8 Nov 2021 10:00:45 -0800 Subject: [PATCH 048/948] source save asset-free WIP Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Assets/ScriptCanvasAssetHandler.cpp | 1 + .../Assets/ScriptCanvasFileHandling.cpp | 60 +++++ .../Code/Editor/Components/EditorGraph.cpp | 5 + .../Assets/ScriptCanvasFileHandling.h | 6 +- .../ScriptCanvas/Components/EditorGraph.h | 2 + .../Code/Editor/View/Windows/MainWindow.cpp | 230 ++++++++---------- .../Code/Editor/View/Windows/MainWindow.h | 27 +- .../Windows/Tools/UpgradeTool/FileSaver.cpp | 86 ++++++- .../Windows/Tools/UpgradeTool/FileSaver.h | 2 + 9 files changed, 269 insertions(+), 150 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHandler.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHandler.cpp index bac1f770cb..896d285054 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHandler.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHandler.cpp @@ -186,6 +186,7 @@ namespace ScriptCanvasEditor , AZ::IO::GenericStream* stream , [[maybe_unused]] AZ::DataStream::StreamType streamType) { + // #sc_editor_asset delete usage of this, and route to ScriptCanvasEditor::SaveToStream namespace JSRU = AZ::JsonSerializationUtils; using namespace ScriptCanvas; diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp index 42dcf81a8d..9e385443f2 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp @@ -139,4 +139,64 @@ namespace ScriptCanvasEditor return AZ::Success(ScriptCanvasEditor::SourceHandle(scriptCanvasData, {}, path)); } + + AZ::Outcome SaveToStream(const SourceHandle& source, AZ::IO::GenericStream& stream) + { + namespace JSRU = AZ::JsonSerializationUtils; + + if (!source) + { + return AZ::Failure(AZStd::string("no source graph to save")); + } + + if (source.Path().empty()) + { + return AZ::Failure(AZStd::string("no destination path specified")); + } + + AZ::SerializeContext* serializeContext = nullptr; + AZ::ComponentApplicationBus::BroadcastResult(serializeContext, &AZ::ComponentApplicationRequests::GetSerializeContext); + if (!serializeContext) + { + return AZ::Failure(AZStd::string("no serialize context available to properly save source file")); + } + + auto graphData = source.Get()->GetOwnership(); + if (!graphData) + { + return AZ::Failure(AZStd::string("source is missing save container")); + } + + if (graphData->GetEditorGraph() != source.Get()) + { + return AZ::Failure(AZStd::string("source save container refers to incorrect graph")); + } + + auto saveTarget = graphData->ModGraph(); + if (saveTarget || !saveTarget->GetGraphData()) + { + return AZ::Failure(AZStd::string("source save container failed to return graph data")); + } + + AZ::JsonSerializerSettings settings; + settings.m_metadata.Create(); + auto listeners = settings.m_metadata.Find(); + AZ_Assert(listeners, "Failed to create SerializationListeners"); + ScriptCanvasFileHandlingCpp::CollectNodes(saveTarget->GetGraphData()->m_nodes, *listeners); + settings.m_keepDefaults = false; + settings.m_serializeContext = serializeContext; + + for (auto listener : *listeners) + { + listener->OnSerialize(); + } + + auto saveOutcome = JSRU::SaveObjectToStream(graphData.get(), stream, nullptr, &settings); + if (!saveOutcome.IsSuccess()) + { + return AZ::Failure(AZStd::string("JSON serialization failed to save source: %s", saveOutcome.GetError().c_str())); + } + + return AZ::Success(); + } } diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp index 2a15371e93..add1b3a9e5 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp @@ -1067,6 +1067,11 @@ namespace ScriptCanvasEditor m_owner = &owner; } + ScriptCanvas::DataPtr Graph::GetOwnership() const + { + return ScriptCanvas::DataPtr(const_cast(this)->m_owner); + } + bool Graph::CreateConnection(const GraphCanvas::ConnectionId& connectionId, const GraphCanvas::Endpoint& sourcePoint, const GraphCanvas::Endpoint& targetPoint) { if (!sourcePoint.IsValid() || !targetPoint.IsValid()) diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h index 154ff5f2b0..c88a7df28b 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h @@ -26,10 +26,12 @@ namespace ScriptCanvas namespace ScriptCanvasEditor { - AZ::Outcome LoadFromFile(AZStd::string_view path); + AZ::Outcome LoadFromFile(AZStd::string_view path); AZ::Outcome LoadDataFromJson ( ScriptCanvas::ScriptCanvasData& dataTarget , AZStd::string_view source , AZ::SerializeContext& serializeContext); - } + + AZ::Outcome SaveToStream(const SourceHandle& source, AZ::IO::GenericStream& stream); +} diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h index 526c929664..05619caa30 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h @@ -309,6 +309,7 @@ namespace ScriptCanvasEditor const GraphStatisticsHelper& GetNodeUsageStatistics() const; void MarkOwnership(ScriptCanvas::ScriptCanvasData& owner); + ScriptCanvas::DataPtr GetOwnership() const; // Finds and returns all nodes within the graph that are of the specified type template @@ -393,6 +394,7 @@ namespace ScriptCanvasEditor bool m_saveFormatConverted = true; ScriptCanvasEditor::SourceHandle m_assetId; + // #sc_editor_asset temporary step in cleaning up the graph / asset class structure. This reference is deliberately weak. ScriptCanvas::ScriptCanvasData* m_owner; }; } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index b4269d8917..8807219e53 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -1723,17 +1723,18 @@ namespace ScriptCanvasEditor // return AZ::Success(outTabIndex); } - bool MainWindow::OnFileSave(const Callbacks::OnSave& saveCB) + bool MainWindow::OnFileSave() { - return SaveAssetAsImpl(m_activeGraph, saveCB); + return SaveAssetImpl(m_activeGraph, Save::InPlace); } - bool MainWindow::OnFileSaveAs(const Callbacks::OnSave& saveCB) + bool MainWindow::OnFileSaveAs() { - return SaveAssetAsImpl(m_activeGraph, saveCB); + return SaveAssetImpl(m_activeGraph, Save::As); } - bool MainWindow::SaveAssetImpl(const ScriptCanvasEditor::SourceHandle& assetId, const Callbacks::OnSave& saveCB) + /* + bool MainWindow::SaveAssetImpl_OLD(const ScriptCanvasEditor::SourceHandle& assetId, const Callbacks::OnSave& saveCB) { if (!assetId.IsValid()) { @@ -1748,7 +1749,7 @@ namespace ScriptCanvasEditor if (fileState == Tracker::ScriptCanvasFileState::NEW) { - saveSuccessful = SaveAssetAsImpl(assetId, saveCB); + saveSuccessful = SaveAssetImpl(assetId, saveCB); } else if (fileState == Tracker::ScriptCanvasFileState::MODIFIED || fileState == Tracker::ScriptCanvasFileState::SOURCE_REMOVED) @@ -1759,8 +1760,16 @@ namespace ScriptCanvasEditor return saveSuccessful; } + */ - bool MainWindow::SaveAssetAsImpl(const ScriptCanvasEditor::SourceHandle& inMemoryAssetId, const Callbacks::OnSave& saveCB) + + // 1. SaveAssetImpl + // 2. SaveAs + // // 3. OnSaveCallback + // SaveAsEnd + // SaveAssetImpl end + + bool MainWindow::SaveAssetImpl(const ScriptCanvasEditor::SourceHandle& inMemoryAssetId, Save /*save*/) { if (!inMemoryAssetId.IsValid()) { @@ -1803,11 +1812,12 @@ namespace ScriptCanvasEditor AZ::IO::FileIOBase::GetInstance()->ResolvePath("@engroot@", assetRootChar.data(), assetRootChar.size()); assetRoot = assetRootChar.data(); - /* if (!AZ::StringFunc::StartsWith(filePath, assetRoot)) - { - QMessageBox::information(this, "Unable to Save", AZStd::string::format("You must select a path within the current project\n\n%s", assetRoot.c_str()).c_str()); - } - else*/ if (AzFramework::StringFunc::Path::GetFileName(filePath.c_str(), fileName)) +// if (!AZ::StringFunc::StartsWith(filePath, assetRoot)) +// { +// QMessageBox::information(this, "Unable to Save", AZStd::string::format("You must select a path within the current project\n\n%s", assetRoot.c_str()).c_str()); +// } +// else +if (AzFramework::StringFunc::Path::GetFileName(filePath.c_str(), fileName)) { isValidFileName = !(fileName.empty()); } @@ -1833,7 +1843,7 @@ namespace ScriptCanvasEditor return false; } - SaveAs(internalStringFile, inMemoryAssetId, saveCB); + SaveAs(internalStringFile, inMemoryAssetId); m_newlySavedFile = internalStringFile; @@ -1842,103 +1852,95 @@ namespace ScriptCanvasEditor return true; } - return false; } + - void MainWindow::OnSaveCallback(bool /*saveSuccess*/, AZ::Data::AssetPtr /*fileAsset*/, ScriptCanvasEditor::SourceHandle /*previousFileAssetId*/) + void MainWindow::OnSaveCallback(bool saveSuccess, ScriptCanvasEditor::SourceHandle memoryAsset) { - // #sc_editor_asset yikes...just save the thing...move to ::SaveAsset maybe - - /* - ScriptCanvasMemoryAsset::pointer memoryAsset; - AZStd::string tabName = m_tabBar->tabText(m_tabBar->currentIndex()).toUtf8().data(); - - int saveTabIndex = m_tabBar->currentIndex(); + int saveTabIndex = m_tabBar->FindTab(memoryAsset); + AZStd::string tabName = saveTabIndex >= 0 ? m_tabBar->tabText(saveTabIndex).toUtf8().data() : ""; if (saveSuccess) { - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, fileAsset->GetId()); - AZ_Assert(memoryAsset, "At this point we must have a MemoryAsset"); - + // #sc_editor_asset find a tab with the same path name and close non focused old ones with the same name // Update the editor with the new information about this asset. - const ScriptCanvasEditor::SourceHandle& fileAssetId = memoryAsset->GetFileAssetId(); - - saveTabIndex = m_tabBar->FindTab(fileAssetId); - + const ScriptCanvasEditor::SourceHandle& fileAssetId = memoryAsset; // We've saved as over a new graph, so we need to close the old one. if (saveTabIndex != m_tabBar->currentIndex()) { // Invalidate the file asset id so we don't delete trigger the asset flow. - m_tabBar->setTabData(saveTabIndex, QVariant::fromValue(GraphTabMetaData)); - + m_tabBar->setTabData(saveTabIndex, QVariant::fromValue(Widget::GraphTabMetadata())); m_tabBar->CloseTab(saveTabIndex); saveTabIndex = -1; } + // #sc_editor_asset clean up these actions as well, save and close, save as and close, just save, etc if (saveTabIndex < 0) { // This asset had not been saved yet, we will need to use the in memory asset Id to get the index. - saveTabIndex = m_tabBar->FindTab(memoryAsset->GetId()); + // saveTabIndex = m_tabBar->FindTab(memoryAsset->GetId()); if (saveTabIndex < 0) { // Finally, we may have Saved-As and we need the previous file asset Id to find the tab - saveTabIndex = m_tabBar->FindTab(previousFileAssetId); + //saveTabIndex = m_tabBar->FindTab(previousFileAssetId); } } - AzFramework::StringFunc::Path::GetFileName(memoryAsset->GetAbsolutePath().c_str(), tabName); + AzFramework::StringFunc::Path::GetFileName(memoryAsset.Path().c_str(), tabName); // Update the tab's assetId to the file asset Id (necessary when saving a new asset) - // used to be configure tab...sets the name and file state - m_tabBar->ConfigureTab(saveTabIndex, fileAssetId, tabName); - - GeneralAssetNotificationBus::Event(memoryAsset->GetId(), &GeneralAssetNotifications::OnAssetVisualized); - - auto requestorIter = m_assetCreationRequests.find(fileAsset->GetId()); - - if (requestorIter != m_assetCreationRequests.end()) - { - auto editorComponents = AZ::EntityUtils::FindDerivedComponents(requestorIter->second.first); - - if (editorComponents.empty()) - { - auto firstRequestBus = EditorScriptCanvasComponentRequestBus::FindFirstHandler(requestorIter->second.first); + // #sc_editor_asset used to be configure tab...sets the name and file state + // m_tabBar->ConfigureTab(saveTabIndex, fileAssetId, tabName); - if (firstRequestBus) - { - firstRequestBus->SetAssetId(fileAsset->GetId()); - } - } - else - { - for (auto editorComponent : editorComponents) - { - if (editorComponent->GetId() == requestorIter->second.second) - { - editorComponent->SetAssetId(fileAsset->GetId()); - break; - } - } - } - - m_assetCreationRequests.erase(requestorIter); - } +// GeneralAssetNotificationBus::Event(memoryAsset, &GeneralAssetNotifications::OnAssetVisualized); +// +// auto requestorIter = m_assetCreationRequests.find(fileAsset->GetId()); +// +// if (requestorIter != m_assetCreationRequests.end()) +// { +// auto editorComponents = AZ::EntityUtils::FindDerivedComponents(requestorIter->second.first); +// +// if (editorComponents.empty()) +// { +// auto firstRequestBus = EditorScriptCanvasComponentRequestBus::FindFirstHandler(requestorIter->second.first); +// +// if (firstRequestBus) +// { +// firstRequestBus->SetAssetId(fileAsset->GetId()); +// } +// } +// else +// { +// for (auto editorComponent : editorComponents) +// { +// if (editorComponent->GetId() == requestorIter->second.second) +// { +// editorComponent->SetAssetId(fileAsset->GetId()); +// break; +// } +// } +// } +// +// m_assetCreationRequests.erase(requestorIter); +// } // Soft switch the asset id here. We'll do a double scene switch down below to actually switch the active assetid m_activeGraph = fileAssetId; } else { + // #sc_editor_asset this seems to remove the unsaved indicator even on failure + // Use the previous memory asset to find what we had setup as our display - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeGraph); + // AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeGraph); // Drop off our file modifier status for our display name when we fail to save. - if (tabName.at(tabName.size() -1) == '*') - { - tabName = tabName.substr(0, tabName.size() - 2); - } +// if (tabName.at(tabName.size() -1) == '*') +// { +// tabName = tabName.substr(0, tabName.size() - 2); +// } } if (m_tabBar->currentIndex() != saveTabIndex) @@ -1961,7 +1963,7 @@ namespace ScriptCanvasEditor const bool displayAsNotification = true; RunGraphValidation(displayAsNotification); - // This is called during saving, so the is scaving flag is always true Need to update the state after this callback is complete. So schedule for next system tick. + // This is called during saving, so the is saving flag is always true Need to update the state after this callback is complete. So schedule for next system tick. AddSystemTickAction(SystemTickActionFlag::UpdateSaveMenuState); if (m_closeCurrentGraphAfterSave) @@ -1974,69 +1976,27 @@ namespace ScriptCanvasEditor EnableAssetView(memoryAsset); UnblockCloseRequests(); - */ } - bool MainWindow::ActivateAndSaveAsset(const ScriptCanvasEditor::SourceHandle& unsavedAssetId, const Callbacks::OnSave& saveCB) + bool MainWindow::ActivateAndSaveAsset(const ScriptCanvasEditor::SourceHandle& unsavedAssetId) { SetActiveAsset(unsavedAssetId); - return OnFileSave(saveCB); + return OnFileSave(); } - void MainWindow::SaveAs(AZStd::string_view /*path*/, ScriptCanvasEditor::SourceHandle /*inMemoryAssetId*/, const Callbacks::OnSave& /*onSave*/) + void MainWindow::SaveAs(AZStd::string_view path, ScriptCanvasEditor::SourceHandle inMemoryAssetId) { - /* - PrepareAssetForSave(inMemoryAssetId); - - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, inMemoryAssetId); - - // Disable the current view if we are saving. - if (memoryAsset) - { - DisableAssetView(memoryAsset); - } - - auto onSaveCallback = [this, onSave](bool saveSuccess, AZ::Data::AssetPtr asset, ScriptCanvasEditor::SourceHandle previousAssetId) - { - OnSaveCallback(saveSuccess, asset, previousAssetId); - if (onSave) - { - AZStd::invoke(onSave, saveSuccess, asset, previousAssetId); - } - }; - - AZ::Data::AssetStreamInfo streamInfo; - streamInfo.m_streamFlags = AZ::IO::OpenMode::ModeWrite; - streamInfo.m_streamName = m_saveAsPath; - - if (!streamInfo.IsValid()) - { - return; - } + AZ_TracePrintf("ScriptCanvas", "Saving %s to %.*s", inMemoryAssetId.Path().c_str(), path.data()); + // #sc_editor_asset maybe delete this + + DisableAssetView(inMemoryAssetId); - bool sourceControlActive = false; - AzToolsFramework::SourceControlConnectionRequestBus::BroadcastResult(sourceControlActive, &AzToolsFramework::SourceControlConnectionRequests::IsActive); - // If Source Control is active then use it to check out the file before saving otherwise query the file info and save only if the file is not read-only - if (sourceControlActive) - { - AzToolsFramework::SourceControlCommandBus::Broadcast(&AzToolsFramework::SourceControlCommandBus::Events::RequestEdit, - streamInfo.m_streamName.c_str(), - true, - [this, streamInfo, onSaveCallback](bool success, AzToolsFramework::SourceControlFileInfo info) { FinalizeAssetSave(success, info, streamInfo, onSaveCallback); } - ); - } - else - { - AzToolsFramework::SourceControlCommandBus::Broadcast(&AzToolsFramework::SourceControlCommandBus::Events::GetFileInfo, - streamInfo.m_streamName.c_str(), - [this, streamInfo, onSaveCallback](bool success, AzToolsFramework::SourceControlFileInfo info) { FinalizeAssetSave(success, info, streamInfo, onSaveCallback); } - ); - } + // use the file saver, make new version that works on source handle and not asset + // then...connect the failed and succeed versions + // to OnSaveCallBack - UpdateSaveState(); - BlockCloseRequests(); - */ + UpdateSaveState(); + BlockCloseRequests(); } void MainWindow::OnFileOpen() @@ -2802,7 +2762,7 @@ namespace ScriptCanvasEditor // // if (fileState == Tracker::ScriptCanvasFileState::NEW) // { -// SaveAssetAsImpl(fileAssetId, saveCB); +// SaveAssetImpl(fileAssetId, saveCB); // } // else // { @@ -2822,7 +2782,7 @@ namespace ScriptCanvasEditor if (tabdata.isValid()) { auto assetId = tabdata.value(); - SaveAssetAsImpl(assetId.m_assetId, nullptr); + SaveAssetImpl(assetId.m_assetId, Save::InPlace); } } @@ -4761,11 +4721,11 @@ namespace ScriptCanvasEditor //connect(m_unitTestDockWidget, &QDockWidget::visibilityChanged, this, &MainWindow::OnViewVisibilityChanged); } - void MainWindow::DisableAssetView(ScriptCanvasMemoryAsset::pointer memoryAsset) + void MainWindow::DisableAssetView(const ScriptCanvasEditor::SourceHandle& memoryAssetId) { - if (memoryAsset->GetView()) + if (auto view = m_tabBar->ModTabView(m_tabBar->FindTab(memoryAssetId))) { - memoryAsset->GetView()->DisableView(); + view->DisableView(); } m_tabBar->setEnabled(false); @@ -4785,11 +4745,11 @@ namespace ScriptCanvasEditor m_autoSaveTimer.stop(); } - void MainWindow::EnableAssetView(ScriptCanvasMemoryAsset::pointer memoryAsset) + void MainWindow::EnableAssetView(const ScriptCanvasEditor::SourceHandle& memoryAssetId) { - if (memoryAsset->GetView()) + if (auto view = m_tabBar->ModTabView(m_tabBar->FindTab(memoryAssetId))) { - memoryAsset->GetView()->EnableView(); + view->EnableView(); } m_tabBar->setEnabled(true); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h index 0a687e0011..0f126456c0 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h @@ -325,12 +325,17 @@ namespace ScriptCanvasEditor // File menu void OnFileNew(); - bool OnFileSave(const Callbacks::OnSave& saveCB); - bool OnFileSaveAs(const Callbacks::OnSave& saveCB); - bool OnFileSaveCaller(){return OnFileSave(nullptr);}; - bool OnFileSaveAsCaller(){return OnFileSaveAs(nullptr);}; - bool SaveAssetImpl(const ScriptCanvasEditor::SourceHandle& assetId, const Callbacks::OnSave& saveCB); - bool SaveAssetAsImpl(const ScriptCanvasEditor::SourceHandle& assetId, const Callbacks::OnSave& saveCB); + bool OnFileSave(); + bool OnFileSaveAs(); + bool OnFileSaveCaller(){return OnFileSave();}; + bool OnFileSaveAsCaller(){return OnFileSaveAs();}; + bool SaveAssetImpl_OLD(const ScriptCanvasEditor::SourceHandle& assetId, const Callbacks::OnSave& saveCB); + enum class Save + { + InPlace, + As + }; + bool SaveAssetImpl(const ScriptCanvasEditor::SourceHandle& assetId, Save save); void OnFileOpen(); // Edit menu @@ -554,9 +559,9 @@ namespace ScriptCanvasEditor void closeEvent(QCloseEvent *event) override; UnsavedChangesOptions ShowSaveDialog(const QString& filename); - bool ActivateAndSaveAsset(const ScriptCanvasEditor::SourceHandle& unsavedAssetId, const Callbacks::OnSave& onSave); + bool ActivateAndSaveAsset(const ScriptCanvasEditor::SourceHandle& unsavedAssetId); - void SaveAs(AZStd::string_view path, ScriptCanvasEditor::SourceHandle assetId, const Callbacks::OnSave& onSave); + void SaveAs(AZStd::string_view path, ScriptCanvasEditor::SourceHandle assetId); void OpenFile(const char* fullPath); void CreateMenus(); @@ -667,8 +672,8 @@ namespace ScriptCanvasEditor } } - void DisableAssetView(ScriptCanvasMemoryAsset::pointer memoryAsset); - void EnableAssetView(ScriptCanvasMemoryAsset::pointer memoryAsset); + void DisableAssetView(const ScriptCanvasEditor::SourceHandle& memoryAssetId); + void EnableAssetView(const ScriptCanvasEditor::SourceHandle& memoryAssetId); QWidget* m_host = nullptr; @@ -783,6 +788,6 @@ namespace ScriptCanvasEditor //! this object manages the Save/Restore operations Workspace* m_workspace; - void OnSaveCallback(bool saveSuccess, AZ::Data::AssetPtr, ScriptCanvasEditor::SourceHandle previousFileAssetId); + void OnSaveCallback(bool saveSuccess, ScriptCanvasEditor::SourceHandle previousFileAssetId); }; } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp index f067feeca4..82a046b0fc 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp @@ -186,12 +186,73 @@ namespace ScriptCanvasEditor }); } + void FileSaver::OnSourceFileReleased(const SourceHandle& source) + { + AZStd::string tmpFileName; + // here we are saving the graph to a temp file instead of the original file and then copying the temp file to the original file. + // This ensures that AP will not a get a file change notification on an incomplete graph file causing it to fail processing. Temp files are ignored by AP. + if (!AZ::IO::CreateTempFileName(source.Path().c_str(), tmpFileName)) + { + FileSaveResult result; + result.fileSaveError = "Failure to create temporary file name"; + m_onComplete(result); + return; + } + + bool tempSavedSucceeded = false; + AZ::IO::FileIOStream fileStream(tmpFileName.c_str(), AZ::IO::OpenMode::ModeWrite | AZ::IO::OpenMode::ModeText); + if (fileStream.IsOpen()) + { + if (asset.GetType() == azrtti_typeid()) + { + ScriptCanvasEditor::ScriptCanvasAssetHandler handler; + tempSavedSucceeded = handler.SaveAssetData(asset, &fileStream); + } + + fileStream.Close(); + } + + if (!tempSavedSucceeded) + { + FileSaveResult result; + result.fileSaveError = "Save asset data to temporary file failed"; + m_onComplete(result); + return; + } + + AzToolsFramework::SourceControlCommandBus::Broadcast + ( &AzToolsFramework::SourceControlCommandBus::Events::RequestEdit + , fullPath.c_str() + , true + , [this, fullPath, tmpFileName]([[maybe_unused]] bool success, const AzToolsFramework::SourceControlFileInfo& info) + { + constexpr const size_t k_maxAttemps = 10; + + if (!info.IsReadOnly()) + { + PerformMove(tmpFileName, fullPath, k_maxAttemps); + } + else if (m_onReadOnlyFile && m_onReadOnlyFile()) + { + AZ::IO::SystemFile::SetWritable(info.m_filePath.c_str(), true); + PerformMove(tmpFileName, fullPath, k_maxAttemps); + } + else + { + FileSaveResult result; + result.fileSaveError = "Source file was and remained read-only"; + result.tempFileRemovalError = RemoveTempFile(tmpFileName); + m_onComplete(result); + } + }); + } + AZStd::string FileSaver::RemoveTempFile(AZStd::string_view tempFile) { AZ::IO::FileIOBase* fileIO = AZ::IO::FileIOBase::GetInstance(); if (!fileIO) { - return "GraphUpgradeComplete: No FileIO instance"; + return "No FileIO instance"; } if (fileIO->Exists(tempFile.data()) && !fileIO->Remove(tempFile.data())) @@ -202,13 +263,34 @@ namespace ScriptCanvasEditor return ""; } + void FileSaver::Save(const SourceHandle& source) + { + if (source.Path().empty()) + { + FileSaveResult result; + result.fileSaveError = "No save location specified"; + m_onComplete(result); + } + else + { + auto streamer = AZ::Interface::Get(); + AZ::IO::FileRequestPtr flushRequest = streamer->FlushCache(source.Path()); + streamer->SetRequestCompleteCallback(flushRequest, [this, source]([[maybe_unused]] AZ::IO::FileRequestHandle request) + { + this->OnSourceFileReleased(source); + }); + streamer->QueueRequest(flushRequest); + } + } + void FileSaver::Save(AZ::Data::Asset asset) { + // #sc_editor_asset fix this path from the version explorer AZStd::string relativePath, fullPath; AZ::Data::AssetCatalogRequestBus::BroadcastResult(relativePath, &AZ::Data::AssetCatalogRequests::GetAssetPathById, asset.GetId()); bool fullPathFound = false; AzToolsFramework::AssetSystemRequestBus::BroadcastResult - (fullPathFound + ( fullPathFound , &AzToolsFramework::AssetSystemRequestBus::Events::GetFullSourcePathFromRelativeProductPath , relativePath, fullPath); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.h index dd333927ed..6ec0daa2b7 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.h @@ -30,11 +30,13 @@ namespace ScriptCanvasEditor , AZStd::function onComplete); void Save(AZ::Data::Asset asset); + void Save(const SourceHandle& source); private: AZStd::function m_onComplete; AZStd::function m_onReadOnlyFile; + void OnSourceFileReleased(const SourceHandle& source); void OnSourceFileReleased(AZ::Data::Asset asset); void PerformMove From 5cd8eb648ccb1257e7690ae546aee0e26c2b9d20 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Mon, 8 Nov 2021 13:58:48 -0800 Subject: [PATCH 049/948] source save in place first pass Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Assets/ScriptCanvasFileHandling.cpp | 4 +- .../Code/Editor/Components/EditorGraph.cpp | 4 +- .../ScriptCanvas/Components/EditorGraph.h | 2 +- .../Code/Editor/View/Windows/MainWindow.cpp | 135 +++++++++--------- .../Code/Editor/View/Windows/MainWindow.h | 5 +- .../Windows/Tools/UpgradeTool/FileSaver.cpp | 31 ++-- .../Windows/Tools/UpgradeTool/FileSaver.h | 2 + .../Windows/Tools/UpgradeTool/Modifier.cpp | 2 +- .../Code/Include/ScriptCanvas/Core/Core.cpp | 1 - 9 files changed, 99 insertions(+), 87 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp index 9e385443f2..4af7ff247e 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp @@ -173,7 +173,7 @@ namespace ScriptCanvasEditor } auto saveTarget = graphData->ModGraph(); - if (saveTarget || !saveTarget->GetGraphData()) + if (!saveTarget || !saveTarget->GetGraphData()) { return AZ::Failure(AZStd::string("source save container failed to return graph data")); } @@ -191,7 +191,7 @@ namespace ScriptCanvasEditor listener->OnSerialize(); } - auto saveOutcome = JSRU::SaveObjectToStream(graphData.get(), stream, nullptr, &settings); + auto saveOutcome = JSRU::SaveObjectToStream(graphData, stream, nullptr, &settings); if (!saveOutcome.IsSuccess()) { return AZ::Failure(AZStd::string("JSON serialization failed to save source: %s", saveOutcome.GetError().c_str())); diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp index add1b3a9e5..a34dc949f5 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp @@ -1067,9 +1067,9 @@ namespace ScriptCanvasEditor m_owner = &owner; } - ScriptCanvas::DataPtr Graph::GetOwnership() const + ScriptCanvas::ScriptCanvasData* Graph::GetOwnership() const { - return ScriptCanvas::DataPtr(const_cast(this)->m_owner); + return const_cast(this)->m_owner; } bool Graph::CreateConnection(const GraphCanvas::ConnectionId& connectionId, const GraphCanvas::Endpoint& sourcePoint, const GraphCanvas::Endpoint& targetPoint) diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h index 05619caa30..b5269cc45d 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h @@ -309,7 +309,7 @@ namespace ScriptCanvasEditor const GraphStatisticsHelper& GetNodeUsageStatistics() const; void MarkOwnership(ScriptCanvas::ScriptCanvasData& owner); - ScriptCanvas::DataPtr GetOwnership() const; + ScriptCanvas::ScriptCanvasData* GetOwnership() const; // Finds and returns all nodes within the graph that are of the specified type template diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 8807219e53..c298517c4b 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -1405,48 +1405,28 @@ namespace ScriptCanvasEditor void MainWindow::GetSuggestedFullFilenameToSaveAs(const ScriptCanvasEditor::SourceHandle& /*assetId*/, AZStd::string& /*filePath*/, AZStd::string& /*fileFilter*/) { // #sc_editor_asset - /* - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); - - AZStd::string assetPath; - if (memoryAsset) - { - assetPath = memoryAsset->GetAbsolutePath(); - - AZ::Data::AssetType assetType = memoryAsset->GetAsset().GetType(); - - ScriptCanvasAssetHandler* assetHandler; - AssetTrackerRequestBus::BroadcastResult(assetHandler, &AssetTrackerRequests::GetAssetHandlerForType, assetType); - AZ_Assert(assetHandler, "Asset type must have a valid asset handler"); - - AZ::EBusAggregateResults results; - AssetRegistryRequestBus::BroadcastResult(results, &AssetRegistryRequests::GetAssetDescription, assetType); - - ScriptCanvas::AssetDescription* description = nullptr; - for (auto item : results.values) - { - if (item->GetAssetType() == assetType) - { - description = item; - break; - } - } - - AZ_Assert(description, "Asset type must have a valid description"); - - fileFilter = description->GetFileFilterImpl(); - - AZStd::string tabName; - AssetTrackerRequestBus::BroadcastResult(tabName, &AssetTrackerRequests::GetTabName, assetId); - - assetPath = AZStd::string::format("%s/%s%s", description->GetSuggestedSavePathImpl(), tabName.c_str(), description->GetExtensionImpl()); - } - - AZStd::array resolvedPath; - AZ::IO::FileIOBase::GetInstance()->ResolvePath(assetPath.data(), resolvedPath.data(), resolvedPath.size()); - filePath = resolvedPath.data(); - */ +// +// ScriptCanvasMemoryAsset::pointer memoryAsset; +// AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); +// +// AZStd::string assetPath; +// if (memoryAsset) +// { +// assetPath = memoryAsset->GetAbsolutePath(); +// fileFilter = ScriptCanvasAssetDescription().GetFileFilterImpl(); +// +// AZStd::string tabName; +// AssetTrackerRequestBus::BroadcastResult(tabName, &AssetTrackerRequests::GetTabName, assetId); +// +// assetPath = AZStd::string::format("%s/%s%s" +// , ScriptCanvasAssetDescription().GetSuggestedSavePathImpl() +// , tabName.c_str() +// , ScriptCanvasAssetDescription().GetExtensionImpl()); +// } +// +// AZStd::array resolvedPath; +// AZ::IO::FileIOBase::GetInstance()->ResolvePath(assetPath.data(), resolvedPath.data(), resolvedPath.size()); +// filePath = resolvedPath.data(); } void MainWindow::OpenFile(const char* fullPath) @@ -1769,7 +1749,7 @@ namespace ScriptCanvasEditor // SaveAsEnd // SaveAssetImpl end - bool MainWindow::SaveAssetImpl(const ScriptCanvasEditor::SourceHandle& inMemoryAssetId, Save /*save*/) + bool MainWindow::SaveAssetImpl(const ScriptCanvasEditor::SourceHandle& inMemoryAssetId, Save save) { if (!inMemoryAssetId.IsValid()) { @@ -1785,14 +1765,22 @@ namespace ScriptCanvasEditor AZStd::string suggestedFilename; AZStd::string suggestedFileFilter; - GetSuggestedFullFilenameToSaveAs(inMemoryAssetId, suggestedFilename, suggestedFileFilter); + bool isValidFileName = false; + if (save == Save::InPlace) + { + isValidFileName = true; + suggestedFileFilter = ScriptCanvasAssetDescription().GetExtensionImpl(); + suggestedFilename = inMemoryAssetId.Path(); + } + else + { + GetSuggestedFullFilenameToSaveAs(inMemoryAssetId, suggestedFilename, suggestedFileFilter); + } + EnsureSaveDestinationDirectory(suggestedFilename); - QString filter = suggestedFileFilter.c_str(); - QString selectedFile; - - bool isValidFileName = false; + QString selectedFile = suggestedFilename.c_str(); while (!isValidFileName) { @@ -1817,7 +1805,7 @@ namespace ScriptCanvasEditor // QMessageBox::information(this, "Unable to Save", AZStd::string::format("You must select a path within the current project\n\n%s", assetRoot.c_str()).c_str()); // } // else -if (AzFramework::StringFunc::Path::GetFileName(filePath.c_str(), fileName)) + if (AzFramework::StringFunc::Path::GetFileName(filePath.c_str(), fileName)) { isValidFileName = !(fileName.empty()); } @@ -1825,7 +1813,6 @@ if (AzFramework::StringFunc::Path::GetFileName(filePath.c_str(), fileName)) { QMessageBox::information(this, "Unable to Save", "File name cannot be empty"); } - } else { @@ -1844,20 +1831,20 @@ if (AzFramework::StringFunc::Path::GetFileName(filePath.c_str(), fileName)) } SaveAs(internalStringFile, inMemoryAssetId); - m_newlySavedFile = internalStringFile; - // Forcing the file add here, since we are creating a new file AddRecentFile(m_newlySavedFile.c_str()); - return true; } + return false; } - void MainWindow::OnSaveCallback(bool saveSuccess, ScriptCanvasEditor::SourceHandle memoryAsset) + void MainWindow::OnSaveCallBack(const VersionExplorer::FileSaveResult& result) { + const bool saveSuccess = result.fileSaveError.empty(); + auto memoryAsset = m_fileSaver->GetSource(); int saveTabIndex = m_tabBar->FindTab(memoryAsset); AZStd::string tabName = saveTabIndex >= 0 ? m_tabBar->tabText(saveTabIndex).toUtf8().data() : ""; @@ -1866,8 +1853,9 @@ if (AzFramework::StringFunc::Path::GetFileName(filePath.c_str(), fileName)) // #sc_editor_asset find a tab with the same path name and close non focused old ones with the same name // Update the editor with the new information about this asset. const ScriptCanvasEditor::SourceHandle& fileAssetId = memoryAsset; + int currentTabIndex = m_tabBar->currentIndex(); // We've saved as over a new graph, so we need to close the old one. - if (saveTabIndex != m_tabBar->currentIndex()) + if (saveTabIndex != currentTabIndex) { // Invalidate the file asset id so we don't delete trigger the asset flow. m_tabBar->setTabData(saveTabIndex, QVariant::fromValue(Widget::GraphTabMetadata())); @@ -1928,6 +1916,14 @@ if (AzFramework::StringFunc::Path::GetFileName(filePath.c_str(), fileName)) // Soft switch the asset id here. We'll do a double scene switch down below to actually switch the active assetid m_activeGraph = fileAssetId; + + if (tabName.at(tabName.size() - 1) == '*') + { + tabName = tabName.substr(0, tabName.size() - 2); + } + + m_tabBar->UpdateFileState(fileAssetId, Tracker::ScriptCanvasFileState::UNMODIFIED); + m_tabBar->SetTabText(saveTabIndex, tabName.c_str()); } else { @@ -1949,11 +1945,11 @@ if (AzFramework::StringFunc::Path::GetFileName(filePath.c_str(), fileName)) } else { - // Something weird happens with our saving. Where we are relying on these scene changes being called. - ScriptCanvasEditor::SourceHandle previousAssetId = m_activeGraph; - - OnChangeActiveGraphTab(ScriptCanvasEditor::SourceHandle()); - OnChangeActiveGraphTab(previousAssetId); +// // Something weird happens with our saving. Where we are relying on these scene changes being called. +// ScriptCanvasEditor::SourceHandle previousAssetId = m_activeGraph; +// +// OnChangeActiveGraphTab(ScriptCanvasEditor::SourceHandle()); +// OnChangeActiveGraphTab(previousAssetId); } UpdateAssignToSelectionState(); @@ -1966,7 +1962,7 @@ if (AzFramework::StringFunc::Path::GetFileName(filePath.c_str(), fileName)) // This is called during saving, so the is saving flag is always true Need to update the state after this callback is complete. So schedule for next system tick. AddSystemTickAction(SystemTickActionFlag::UpdateSaveMenuState); - if (m_closeCurrentGraphAfterSave) + if (saveSuccess && m_closeCurrentGraphAfterSave) { AddSystemTickAction(SystemTickActionFlag::CloseCurrentGraph); } @@ -1976,6 +1972,7 @@ if (AzFramework::StringFunc::Path::GetFileName(filePath.c_str(), fileName)) EnableAssetView(memoryAsset); UnblockCloseRequests(); + m_fileSaver.reset(); } bool MainWindow::ActivateAndSaveAsset(const ScriptCanvasEditor::SourceHandle& unsavedAssetId) @@ -1986,17 +1983,17 @@ if (AzFramework::StringFunc::Path::GetFileName(filePath.c_str(), fileName)) void MainWindow::SaveAs(AZStd::string_view path, ScriptCanvasEditor::SourceHandle inMemoryAssetId) { - AZ_TracePrintf("ScriptCanvas", "Saving %s to %.*s", inMemoryAssetId.Path().c_str(), path.data()); - // #sc_editor_asset maybe delete this - DisableAssetView(inMemoryAssetId); - // use the file saver, make new version that works on source handle and not asset - // then...connect the failed and succeed versions - // to OnSaveCallBack + m_fileSaver = AZStd::make_unique + ( nullptr + , [this](const VersionExplorer::FileSaveResult& fileSaveResult) { OnSaveCallBack(fileSaveResult); }); + + ScriptCanvasEditor::SourceHandle newLocation(inMemoryAssetId, {}, path); + m_fileSaver->Save(newLocation); - UpdateSaveState(); - BlockCloseRequests(); + UpdateSaveState(); + BlockCloseRequests(); } void MainWindow::OnFileOpen() diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h index 0f126456c0..6704c10fda 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h @@ -53,6 +53,7 @@ #include #include +#include #if SCRIPTCANVAS_EDITOR #include @@ -788,6 +789,8 @@ namespace ScriptCanvasEditor //! this object manages the Save/Restore operations Workspace* m_workspace; - void OnSaveCallback(bool saveSuccess, ScriptCanvasEditor::SourceHandle previousFileAssetId); + AZStd::unique_ptr m_fileSaver; + VersionExplorer::FileSaveResult m_fileSaveResult; + void OnSaveCallBack(const VersionExplorer::FileSaveResult& result); }; } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp index 82a046b0fc..f36f72234b 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp @@ -15,6 +15,7 @@ #include #include #include +#include namespace FileSaverCpp { @@ -58,6 +59,11 @@ namespace ScriptCanvasEditor , m_onComplete(onComplete) {} + const SourceHandle& FileSaver::GetSource() const + { + return m_source; + } + void FileSaver::PerformMove ( AZStd::string tmpFileName , AZStd::string target @@ -179,7 +185,7 @@ namespace ScriptCanvasEditor else { FileSaveResult result; - result.fileSaveError = "Source file was and remained read-only"; + result.fileSaveError = "Source file is read-only"; result.tempFileRemovalError = RemoveTempFile(tmpFileName); m_onComplete(result); } @@ -188,10 +194,12 @@ namespace ScriptCanvasEditor void FileSaver::OnSourceFileReleased(const SourceHandle& source) { + AZStd::string fullPath = source.Path(); AZStd::string tmpFileName; // here we are saving the graph to a temp file instead of the original file and then copying the temp file to the original file. - // This ensures that AP will not a get a file change notification on an incomplete graph file causing it to fail processing. Temp files are ignored by AP. - if (!AZ::IO::CreateTempFileName(source.Path().c_str(), tmpFileName)) + // This ensures that AP will not a get a file change notification on an incomplete graph file causing it to fail processing. + // Temp files are ignored by AP. + if (!AZ::IO::CreateTempFileName(fullPath.c_str(), tmpFileName)) { FileSaveResult result; result.fileSaveError = "Failure to create temporary file name"; @@ -199,23 +207,24 @@ namespace ScriptCanvasEditor return; } - bool tempSavedSucceeded = false; + AZStd::string saveError; + AZ::IO::FileIOStream fileStream(tmpFileName.c_str(), AZ::IO::OpenMode::ModeWrite | AZ::IO::OpenMode::ModeText); if (fileStream.IsOpen()) { - if (asset.GetType() == azrtti_typeid()) + auto saveOutcome = ScriptCanvasEditor::SaveToStream(source, fileStream); + if (!saveOutcome.IsSuccess()) { - ScriptCanvasEditor::ScriptCanvasAssetHandler handler; - tempSavedSucceeded = handler.SaveAssetData(asset, &fileStream); + saveError = saveOutcome.TakeError(); } fileStream.Close(); } - if (!tempSavedSucceeded) + if (!saveError.empty()) { FileSaveResult result; - result.fileSaveError = "Save asset data to temporary file failed"; + result.fileSaveError = AZStd::string::format("Save asset data to temporary file failed: %s", saveError.c_str()); m_onComplete(result); return; } @@ -265,6 +274,8 @@ namespace ScriptCanvasEditor void FileSaver::Save(const SourceHandle& source) { + m_source = source; + if (source.Path().empty()) { FileSaveResult result; @@ -285,7 +296,7 @@ namespace ScriptCanvasEditor void FileSaver::Save(AZ::Data::Asset asset) { - // #sc_editor_asset fix this path from the version explorer + // #sc_editor_asset fix/remove this path that is used by the version explorer AZStd::string relativePath, fullPath; AZ::Data::AssetCatalogRequestBus::BroadcastResult(relativePath, &AZ::Data::AssetCatalogRequests::GetAssetPathById, asset.GetId()); bool fullPathFound = false; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.h index 6ec0daa2b7..439db2d260 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.h @@ -29,10 +29,12 @@ namespace ScriptCanvasEditor ( AZStd::function onReadOnlyFile , AZStd::function onComplete); + const SourceHandle& GetSource() const; void Save(AZ::Data::Asset asset); void Save(const SourceHandle& source); private: + SourceHandle m_source; AZStd::function m_onComplete; AZStd::function m_onReadOnlyFile; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp index f3da1ba309..0e4190b18d 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp @@ -259,7 +259,7 @@ namespace ScriptCanvasEditor m_modifyState = ModifyState::Saving; m_fileSaver = AZStd::make_unique ( m_config.onReadOnlyFile - , [this](const FileSaveResult& result) { OnFileSaveComplete(result); }); + , [this](const FileSaveResult& fileSaveResult) { OnFileSaveComplete(fileSaveResult); }); m_fileSaver->Save(result.asset); } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp index 15e2192ee8..064029eb03 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp @@ -13,7 +13,6 @@ #include #include #include -// #include #include "Core.h" #include "Attributes.h" From 65814e65ccb925b601c30848152ae17f90a19240 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Mon, 8 Nov 2021 14:39:20 -0800 Subject: [PATCH 050/948] source file save-as Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Editor/View/Windows/MainWindow.cpp | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index c298517c4b..98f992bbbf 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -1766,7 +1766,7 @@ namespace ScriptCanvasEditor AZStd::string suggestedFilename; AZStd::string suggestedFileFilter; bool isValidFileName = false; - + if (save == Save::InPlace) { isValidFileName = true; @@ -1775,7 +1775,17 @@ namespace ScriptCanvasEditor } else { - GetSuggestedFullFilenameToSaveAs(inMemoryAssetId, suggestedFilename, suggestedFileFilter); + // replaces GetSuggestedFullFilenameToSaveAs + suggestedFileFilter = ScriptCanvasAssetDescription().GetExtensionImpl(); + + if (inMemoryAssetId.Path().empty()) + { + suggestedFilename = ScriptCanvasAssetDescription().GetSuggestedSavePathImpl(); + } + else + { + suggestedFilename = inMemoryAssetId.Path(); + } } EnsureSaveDestinationDirectory(suggestedFilename); @@ -1790,7 +1800,14 @@ namespace ScriptCanvasEditor // So we want to break out. if (!selectedFile.isEmpty()) { + ScriptCanvasAssetDescription assetDescription; AZStd::string filePath = selectedFile.toUtf8().data(); + + if (!AZ::StringFunc::EndsWith(filePath, assetDescription.GetExtensionImpl(), false)) + { + filePath += assetDescription.GetExtensionImpl(); + } + AZStd::string fileName; // Verify that the path is within the project From 6c1d1dc2e2c4e4e452aba4edd3c3e2b0b414c67e Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Wed, 10 Nov 2021 15:39:17 -0800 Subject: [PATCH 051/948] new source file button works Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../ScriptCanvasAssetTrackerDefinitions.h | 1 + .../Code/Editor/Components/EditorGraph.cpp | 4 +- .../Code/Editor/View/Windows/MainWindow.cpp | 229 +++++++----------- .../Code/Editor/View/Windows/MainWindow.h | 29 +-- .../Code/Include/ScriptCanvas/Core/Core.cpp | 9 + .../Code/Include/ScriptCanvas/Core/Core.h | 2 + 6 files changed, 109 insertions(+), 165 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerDefinitions.h b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerDefinitions.h index 2aebf29b24..29f88b33c8 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerDefinitions.h +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerDefinitions.h @@ -31,6 +31,7 @@ namespace ScriptCanvasEditor NEW, MODIFIED, UNMODIFIED, + // #sc_editor_asset restore this SOURCE_REMOVED, INVALID = -1 }; diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp index a34dc949f5..7658c7d8be 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp @@ -1055,6 +1055,8 @@ namespace ScriptCanvasEditor { data->m_scriptCanvasEntity.reset(entity); graph->MarkOwnership(*data); + entity->Init(); + entity->Activate(); return data; } } @@ -1354,7 +1356,7 @@ namespace ScriptCanvasEditor void Graph::SignalDirty() { - SourceHandle handle(ScriptCanvas::DataPtr(m_owner), {}, {}); + SourceHandle handle(m_owner->shared_from_this(), {}, {}); GeneralRequestBus::Broadcast(&GeneralRequests::SignalSceneDirty, handle); } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 98f992bbbf..ff3dc2da27 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -1148,28 +1148,7 @@ namespace ScriptCanvasEditor if (memoryAsset && asset.IsReady()) { - AZ::EntityId scGraphId = memoryAsset->GetScriptCanvasId(); - GraphCanvas::SceneNotificationBus::MultiHandler::BusDisconnect(scGraphId); - AZ::EntityId graphCanvasId = GetGraphCanvasGraphId(scGraphId); - - GraphCanvas::AssetEditorNotificationBus::Event(ScriptCanvasEditor::AssetEditorId, &GraphCanvas::AssetEditorNotifications::OnGraphRefreshed, graphCanvasId, graphCanvasId); - - int tabIndex = -1; - if (IsTabOpen(asset.GetId(), tabIndex)) - { - const AZStd::string& assetPath = memoryAsset->GetAbsolutePath(); - m_tabBar->setTabToolTip(tabIndex, assetPath.c_str()); - m_tabBar->SetTabText(tabIndex, memoryAsset->GetTabName().c_str(), memoryAsset->GetFileState()); - } - - if (graphCanvasId.IsValid()) - { - GraphCanvas::SceneNotificationBus::MultiHandler::BusConnect(graphCanvasId); - GraphCanvas::SceneMimeDelegateRequestBus::Event(graphCanvasId, &GraphCanvas::SceneMimeDelegateRequests::AddDelegate, m_entityMimeDelegateId); - - GraphCanvas::SceneRequestBus::Event(graphCanvasId, &GraphCanvas::SceneRequests::SetMimeType, Widget::NodePaletteDockWidget::GetMimeType()); - GraphCanvas::SceneMemberNotificationBus::Event(graphCanvasId, &GraphCanvas::SceneMemberNotifications::OnSceneReady); - } + } */ } @@ -1287,31 +1266,6 @@ namespace ScriptCanvasEditor return m_tabBar->InsertGraphTab(tabIndex, assetId); } - AZ::Outcome MainWindow::UpdateScriptCanvasAsset(const AZ::Data::Asset& /*scriptCanvasAsset*/) - { - // #sc_editor_asset - return AZ::Failure(AZStd::string("rewrite MainWindow::UpdateScriptCanvasAsset")); - - /* - int outTabIndex = -1; - - PushPreventUndoStateUpdate(); - RefreshScriptCanvasAsset(scriptCanvasAsset); - if (IsTabOpen(scriptCanvasAsset.GetId(), outTabIndex)) - { - RefreshActiveAsset(); - } - PopPreventUndoStateUpdate(); - - if (outTabIndex == -1) - { - return AZ::Failure(AZStd::string::format("Script Canvas Asset %s is not open in a tab", scriptCanvasAsset.ToString().c_str())); - } - - return AZ::Success(outTabIndex); - */ - } - void MainWindow::RemoveScriptCanvasAsset(const ScriptCanvasEditor::SourceHandle& /*assetId*/) { // #sc_editor_asset move what is necessary to the widget @@ -1640,7 +1594,30 @@ namespace ScriptCanvasEditor void MainWindow::OnFileNew() { - MakeNewFile(); + static int scriptCanvasEditorDefaultNewNameCount = 0; + + ScriptCanvasAssetDescription description; + + AZStd::string newAssetName = AZStd::string::format(description.GetAssetNamePatternImpl(), ++scriptCanvasEditorDefaultNewNameCount); + + AZStd::array assetRootArray; + if (!AZ::IO::FileIOBase::GetInstance()->ResolvePath(description.GetSuggestedSavePathImpl() + , assetRootArray.data(), assetRootArray.size())) + { + AZ_ErrorOnce("Script Canvas", false, "Unable to resolve @projectroot@ path"); + } + + AZStd::string assetPath; + AzFramework::StringFunc::Path::Join(assetRootArray.data(), (newAssetName + description.GetExtensionImpl()).data(), assetPath); + + auto createOutcome = CreateScriptCanvasAsset(assetPath); + if (createOutcome) + { + } + else + { + AZ_Warning("Script Canvas", createOutcome, "%s", createOutcome.GetError().data()); + } } int MainWindow::InsertTabForAsset(AZStd::string_view assetPath, ScriptCanvasEditor::SourceHandle assetId, int tabIndex) @@ -1675,32 +1652,64 @@ namespace ScriptCanvasEditor } } - AZ::Outcome MainWindow::CreateScriptCanvasAsset(AZStd::string_view /*assetPath*/, AZ::Data::AssetType /*assetType*/, int /*tabIndex*/) + AZ::Outcome MainWindow::CreateScriptCanvasAsset(AZStd::string_view assetPath, int tabIndex) { - return AZ::Failure(AZStd::string("MainWindow::CreateScriptCanvasAsset just make a new thing with the project root + untitled...")); -// int outTabIndex = -1; -// -// ScriptCanvasEditor::SourceHandle newAssetId; -// auto onAssetCreated = [this, assetPath, tabIndex, &outTabIndex](ScriptCanvasMemoryAsset& asset) -// { -// const ScriptCanvasEditor::SourceHandle& assetId = asset.GetId(); -// -// outTabIndex = InsertTabForAsset(assetPath, assetId, tabIndex); -// -// SetActiveAsset(assetId); -// -// UpdateScriptCanvasAsset(asset.GetAsset()); -// -// AZ::EntityId scriptCanvasEntityId; -// AssetTrackerRequestBus::BroadcastResult(scriptCanvasEntityId, &AssetTrackerRequests::GetScriptCanvasId, assetId); -// -// GraphCanvas::GraphId graphCanvasGraphId = GetGraphCanvasGraphId(scriptCanvasEntityId); -// GraphCanvas::AssetEditorNotificationBus::Event(ScriptCanvasEditor::AssetEditorId, &GraphCanvas::AssetEditorNotifications::OnGraphLoaded, graphCanvasGraphId); -// -// }; -// AssetTrackerRequestBus::BroadcastResult(newAssetId, &AssetTrackerRequests::Create, assetPath, assetType, onAssetCreated); + int outTabIndex = -1; + + ScriptCanvas::DataPtr graph = Graph::Create(); + AZ::Uuid assetId = AZ::Uuid::CreateRandom(); + ScriptCanvasEditor::SourceHandle handle = ScriptCanvasEditor::SourceHandle(graph, assetId, assetPath); + + outTabIndex = InsertTabForAsset(assetPath, handle, tabIndex); + m_tabBar->UpdateFileState(handle, Tracker::ScriptCanvasFileState::NEW); + + if (outTabIndex == -1) + { + return AZ::Failure(AZStd::string::format("Script Canvas Asset %.*s is not open in a tab", assetPath.data())); + } + + SetActiveAsset(handle); + + // #sc_editor_asset delete candidate - // return AZ::Success(outTabIndex); + PushPreventUndoStateUpdate(); + + AZ::EntityId scriptCanvasEntityId = graph->GetGraph()->GetScriptCanvasId(); + GraphCanvas::SceneNotificationBus::MultiHandler::BusDisconnect(scriptCanvasEntityId); + AZ::EntityId graphCanvasGraphId = GetGraphCanvasGraphId(scriptCanvasEntityId); + + GraphCanvas::AssetEditorNotificationBus::Event(ScriptCanvasEditor::AssetEditorId + , &GraphCanvas::AssetEditorNotifications::OnGraphRefreshed, graphCanvasGraphId, graphCanvasGraphId); + + if (IsTabOpen(handle, tabIndex)) + { + AZStd::string tabName; + AzFramework::StringFunc::Path::GetFileName(assetPath.data(), tabName); + m_tabBar->setTabToolTip(tabIndex, assetPath.data()); + m_tabBar->SetTabText(tabIndex, tabName.c_str(), Tracker::ScriptCanvasFileState::NEW); + } + + if (graphCanvasGraphId.IsValid()) + { + GraphCanvas::SceneNotificationBus::MultiHandler::BusConnect(graphCanvasGraphId); + GraphCanvas::SceneMimeDelegateRequestBus::Event(graphCanvasGraphId, &GraphCanvas::SceneMimeDelegateRequests::AddDelegate, m_entityMimeDelegateId); + + GraphCanvas::SceneRequestBus::Event(graphCanvasGraphId, &GraphCanvas::SceneRequests::SetMimeType, Widget::NodePaletteDockWidget::GetMimeType()); + GraphCanvas::SceneMemberNotificationBus::Event(graphCanvasGraphId, &GraphCanvas::SceneMemberNotifications::OnSceneReady); + } + + if (IsTabOpen(handle, outTabIndex)) + { + RefreshActiveAsset(); + } + + PopPreventUndoStateUpdate(); + + + GraphCanvas::AssetEditorNotificationBus::Event(ScriptCanvasEditor::AssetEditorId + , &GraphCanvas::AssetEditorNotifications::OnGraphLoaded, graphCanvasGraphId); + + return AZ::Success(outTabIndex); } bool MainWindow::OnFileSave() @@ -1944,16 +1953,8 @@ namespace ScriptCanvasEditor } else { - // #sc_editor_asset this seems to remove the unsaved indicator even on failure - - // Use the previous memory asset to find what we had setup as our display - // AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeGraph); - - // Drop off our file modifier status for our display name when we fail to save. -// if (tabName.at(tabName.size() -1) == '*') -// { -// tabName = tabName.substr(0, tabName.size() - 2); -// } + const auto failureMessage = AZStd::string::format("Failed to save %s: %s", tabName.c_str(), result.fileSaveError.c_str()); + QMessageBox::critical(this, QString(), QObject::tr(failureMessage.data())); } if (m_tabBar->currentIndex() != saveTabIndex) @@ -2719,69 +2720,25 @@ namespace ScriptCanvasEditor void MainWindow::OnTabCloseButtonPressed(int index) { - QVariant tabdata = m_tabBar->tabData(index); if (tabdata.isValid()) { - auto fileAssetId = tabdata.value(); - - Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::NEW; - bool isSaving = false; - - // #sc_editor_asset Get from widgets - /* - AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, fileAssetId); - AssetTrackerRequestBus::BroadcastResult(isSaving, &AssetTrackerRequests::IsSaving, fileAssetId); - */ - if (isSaving) - { - m_closeCurrentGraphAfterSave = true; - return; - } - + Widget::GraphTabMetadata tabMetadata = tabdata.value(); + Tracker::ScriptCanvasFileState fileState = tabMetadata.m_fileState; UnsavedChangesOptions saveDialogResults = UnsavedChangesOptions::CONTINUE_WITHOUT_SAVING; - if (!isSaving && (fileState == Tracker::ScriptCanvasFileState::NEW || fileState == Tracker::ScriptCanvasFileState::MODIFIED || fileState == Tracker::ScriptCanvasFileState::SOURCE_REMOVED)) - { - SetActiveAsset(fileAssetId.m_assetId); - - // #sc_editor_asset - AZStd::string tabName = "Get from widget"; - // AssetTrackerRequestBus::BroadcastResult(tabName, &AssetTrackerRequests::GetTabName, fileAssetId); - saveDialogResults = ShowSaveDialog(tabName.c_str()); + if (fileState == Tracker::ScriptCanvasFileState::NEW + || fileState == Tracker::ScriptCanvasFileState::MODIFIED + || fileState == Tracker::ScriptCanvasFileState::SOURCE_REMOVED) + { + SetActiveAsset(tabMetadata.m_assetId); + saveDialogResults = ShowSaveDialog(m_tabBar->tabText(index).toUtf8().constData()); } if (saveDialogResults == UnsavedChangesOptions::SAVE) { - // #sc_editor_asset -// auto saveCB = [this](bool isSuccessful, AZ::Data::AssetPtr asset, ScriptCanvasEditor::SourceHandle) -// { -// if (isSuccessful) -// { -// ScriptCanvasMemoryAsset::pointer memoryAsset; -// AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, asset->GetId()); -// AZ_Assert(memoryAsset, "At this point we must have a MemoryAsset"); -// -// int tabIndex = -1; -// if (IsTabOpen(memoryAsset->GetFileAssetId(), tabIndex)) -// { -// OnTabCloseRequest(tabIndex); -// } -// } -// else -// { -// QMessageBox::critical(this, QString(), QObject::tr("Failed to save.")); -// } -// }; -// -// if (fileState == Tracker::ScriptCanvasFileState::NEW) -// { -// SaveAssetImpl(fileAssetId, saveCB); -// } -// else -// { -// SaveAsset(fileAssetId, saveCB); -// } + m_closeCurrentGraphAfterSave = true; + SaveAssetImpl(tabMetadata.m_assetId, fileState == Tracker::ScriptCanvasFileState::NEW ? Save::As : Save::InPlace); } else if (saveDialogResults == UnsavedChangesOptions::CONTINUE_WITHOUT_SAVING) { diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h index 6704c10fda..7c527a5449 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h @@ -437,9 +437,7 @@ namespace ScriptCanvasEditor const NodePaletteModelInformation* FindNodePaletteModelInformation(const ScriptCanvas::NodeTypeIdentifier& nodeType) const override; //// - AZ::Outcome CreateScriptCanvasAsset(AZStd::string_view assetPath, AZ::Data::AssetType assetType, int tabIndex = -1); - AZ::Outcome UpdateScriptCanvasAsset(const AZ::Data::Asset& scriptCanvasAsset); - + AZ::Outcome CreateScriptCanvasAsset(AZStd::string_view assetPath, int tabIndex = -1); void RefreshScriptCanvasAsset(const AZ::Data::Asset& scriptCanvasAsset); //! Removes the assetId -> ScriptCanvasAsset mapping and disconnects from the asset tracker @@ -647,31 +645,6 @@ namespace ScriptCanvasEditor void OpenNextFile(); - template - void MakeNewFile() - { - static int scriptCanvasEditorDefaultNewNameCount = 0; - - AZStd::string newAssetName = AZStd::string::format(ScriptCanvas::AssetDescription::GetAssetNamePattern(), ++scriptCanvasEditorDefaultNewNameCount); - - AZStd::array assetRootArray; - if (!AZ::IO::FileIOBase::GetInstance()->ResolvePath(ScriptCanvas::AssetDescription::GetSuggestedSavePath(), assetRootArray.data(), assetRootArray.size())) - { - AZ_ErrorOnce("Script Canvas", false, "Unable to resolve @projectroot@ path"); - } - - AZStd::string assetPath; - AzFramework::StringFunc::Path::Join(assetRootArray.data(), (newAssetName + ScriptCanvas::AssetDescription::GetExtension()).data(), assetPath); - - auto createOutcome = CreateScriptCanvasAsset(assetPath, azrtti_typeid()); - if (createOutcome) - { - } - else - { - AZ_Warning("Script Canvas", createOutcome, "%s", createOutcome.GetError().data()); - } - } void DisableAssetView(const ScriptCanvasEditor::SourceHandle& memoryAssetId); void EnableAssetView(const ScriptCanvasEditor::SourceHandle& memoryAssetId); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp index 064029eb03..761f30f88b 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp @@ -203,6 +203,15 @@ namespace ScriptCanvasEditor , m_path(path) {} + SourceHandle::~SourceHandle() + { + AZ_TracePrintf("ScriptCanvas", "Destroy Handle: %p, count %d", m_data.get(), m_data.use_count()); + if (m_data.use_count() <= 1) + { + AZ_TracePrintf("ScriptCanvas", "BOOM Handle: %p, count %d", m_data.get(), m_data.use_count()); + } + } + bool SourceHandle::AnyEquals(const SourceHandle& other) const { return m_data == other.m_data diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h index ece7008b06..53a0ecdeb3 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h @@ -330,6 +330,8 @@ namespace ScriptCanvasEditor SourceHandle(ScriptCanvas::DataPtr graph, const AZ::Uuid& id, AZStd::string_view path); + ~SourceHandle(); + bool AnyEquals(const SourceHandle& other) const; void Clear(); From 5558be2aeb2269f0d524a0d5b3d8ed3583031ee6 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Wed, 10 Nov 2021 16:40:33 -0800 Subject: [PATCH 052/948] new source file close button works, but not on multiple tabs Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Editor/View/Windows/MainWindow.cpp | 54 +++++++++---------- .../Code/Include/ScriptCanvas/Core/Core.cpp | 9 ---- .../Code/Include/ScriptCanvas/Core/Core.h | 2 +- 3 files changed, 25 insertions(+), 40 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index ff3dc2da27..46e57ceaf1 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -1266,38 +1266,27 @@ namespace ScriptCanvasEditor return m_tabBar->InsertGraphTab(tabIndex, assetId); } - void MainWindow::RemoveScriptCanvasAsset(const ScriptCanvasEditor::SourceHandle& /*assetId*/) + void MainWindow::RemoveScriptCanvasAsset(const ScriptCanvasEditor::SourceHandle& assetId) { - // #sc_editor_asset move what is necessary to the widget - /* - AssetHelpers::PrintInfo("RemoveScriptCanvasAsset : %s", AssetHelpers::AssetIdToString(assetId).c_str()); - + AssetHelpers::PrintInfo("RemoveScriptCanvasAsset : %s", assetId.ToString().c_str()); m_assetCreationRequests.erase(assetId); - GeneralAssetNotificationBus::Event(assetId, &GeneralAssetNotifications::OnAssetUnloaded); - AssetTrackerNotificationBus::MultiHandler::BusDisconnect(assetId); - - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); - - if (memoryAsset) + if (assetId) { // Disconnect scene and asset editor buses - GraphCanvas::SceneNotificationBus::MultiHandler::BusDisconnect(memoryAsset->GetScriptCanvasId()); - GraphCanvas::AssetEditorNotificationBus::Event(ScriptCanvasEditor::AssetEditorId, &GraphCanvas::AssetEditorNotifications::OnGraphUnloaded, memoryAsset->GetGraphId()); + GraphCanvas::SceneNotificationBus::MultiHandler::BusDisconnect(assetId.Get()->GetScriptCanvasId()); + GraphCanvas::AssetEditorNotificationBus::Event(ScriptCanvasEditor::AssetEditorId + , &GraphCanvas::AssetEditorNotifications::OnGraphUnloaded, assetId.Get()->GetGraphCanvasGraphId()); } - AssetTrackerRequestBus::Broadcast(&AssetTrackerRequests::Close, assetId); - int tabIndex = m_tabBar->FindTab(assetId); QVariant tabdata = m_tabBar->tabData(tabIndex); if (tabdata.isValid()) { auto tabAssetId = tabdata.value(); - SetActiveAsset(tabAssetId); + SetActiveAsset(tabAssetId.m_assetId); } - */ } int MainWindow::CloseScriptCanvasAsset(const ScriptCanvasEditor::SourceHandle& assetId) @@ -1771,6 +1760,7 @@ namespace ScriptCanvasEditor } PrepareAssetForSave(inMemoryAssetId); + ScriptCanvasAssetDescription assetDescription; AZStd::string suggestedFilename; AZStd::string suggestedFileFilter; @@ -1809,7 +1799,6 @@ namespace ScriptCanvasEditor // So we want to break out. if (!selectedFile.isEmpty()) { - ScriptCanvasAssetDescription assetDescription; AZStd::string filePath = selectedFile.toUtf8().data(); if (!AZ::StringFunc::EndsWith(filePath, assetDescription.GetExtensionImpl(), false)) @@ -1850,6 +1839,12 @@ namespace ScriptCanvasEditor { AZStd::string internalStringFile = selectedFile.toUtf8().data(); + + if (!AZ::StringFunc::EndsWith(internalStringFile, assetDescription.GetExtensionImpl(), false)) + { + internalStringFile += assetDescription.GetExtensionImpl(); + } + if (!AssetHelpers::IsValidSourceFile(internalStringFile, GetActiveScriptCanvasId())) { QMessageBox::warning(this, "Unable to Save", QString("File\n'%1'\n\nDoes not match the asset type of the current Graph.").arg(selectedFile)); @@ -2845,32 +2840,32 @@ namespace ScriptCanvasEditor } } - void MainWindow::OnTabCloseRequest(int /*index*/) + void MainWindow::OnTabCloseRequest(int index) { - /* QVariant tabdata = m_tabBar->tabData(index); if (tabdata.isValid()) { auto tabAssetId = tabdata.value(); - if (tabAssetId == m_activeGraph) + + if (tabAssetId.m_canvasWidget) { - SetActiveAsset({}); + tabAssetId.m_canvasWidget->hide(); } - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, tabAssetId); + bool activeSet = false; - if (memoryAsset && memoryAsset->GetView()) + if (tabAssetId.m_assetId == m_activeGraph) { - memoryAsset->GetView()->hide(); + SetActiveAsset({}); + activeSet = true; } m_tabBar->CloseTab(index); m_tabBar->update(); - RemoveScriptCanvasAsset(tabAssetId); + RemoveScriptCanvasAsset(tabAssetId.m_assetId); - if (m_tabBar->count() == 0) + if (!activeSet && m_tabBar->count() == 0) { // The last tab has been removed. SetActiveAsset({}); @@ -2881,7 +2876,6 @@ namespace ScriptCanvasEditor // information AddSystemTickAction(SystemTickActionFlag::CloseNextTabAction); } - */ } void MainWindow::OnNodeAdded(const AZ::EntityId& nodeId, bool isPaste) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp index 761f30f88b..064029eb03 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp @@ -203,15 +203,6 @@ namespace ScriptCanvasEditor , m_path(path) {} - SourceHandle::~SourceHandle() - { - AZ_TracePrintf("ScriptCanvas", "Destroy Handle: %p, count %d", m_data.get(), m_data.use_count()); - if (m_data.use_count() <= 1) - { - AZ_TracePrintf("ScriptCanvas", "BOOM Handle: %p, count %d", m_data.get(), m_data.use_count()); - } - } - bool SourceHandle::AnyEquals(const SourceHandle& other) const { return m_data == other.m_data diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h index 53a0ecdeb3..415c181033 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h @@ -330,7 +330,7 @@ namespace ScriptCanvasEditor SourceHandle(ScriptCanvas::DataPtr graph, const AZ::Uuid& id, AZStd::string_view path); - ~SourceHandle(); + ~SourceHandle() = default; bool AnyEquals(const SourceHandle& other) const; From d8e8cdba60d699ec4c4b06934f4d42987870beb4 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Wed, 10 Nov 2021 17:15:42 -0800 Subject: [PATCH 053/948] multi tab close fixed Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Assets/ScriptCanvasFileHandling.cpp | 2 +- .../Code/Editor/View/Widgets/GraphTabBar.cpp | 5 +-- .../Code/Editor/View/Windows/MainWindow.cpp | 32 +++++++++---------- .../Code/Include/ScriptCanvas/Core/Core.cpp | 17 +++++++--- .../Code/Include/ScriptCanvas/Core/Core.h | 6 ++-- 5 files changed, 35 insertions(+), 27 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp index 4af7ff247e..cd8d21543f 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp @@ -144,7 +144,7 @@ namespace ScriptCanvasEditor { namespace JSRU = AZ::JsonSerializationUtils; - if (!source) + if (!source.IsValid()) { return AZ::Failure(AZStd::string("no source graph to save")); } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp index 029d713277..1dfb27ce63 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp @@ -194,7 +194,7 @@ namespace ScriptCanvasEditor if (tabDataVariant.isValid()) { auto tabAssetId = tabDataVariant.value(); - if (tabAssetId.m_assetId == assetId) + if (tabAssetId.m_assetId.AnyEquals(assetId)) { return tabIndex; } @@ -243,7 +243,8 @@ namespace ScriptCanvasEditor if (tabdata.isValid()) { auto tabAssetId = tabdata.value(); - if (tabAssetId.m_assetId && tabAssetId.m_assetId.Get()->GetGraphCanvasGraphId() == graphCanvasGraphId) + if (tabAssetId.m_assetId.IsValid() + && tabAssetId.m_assetId.Get()->GetGraphCanvasGraphId() == graphCanvasGraphId) { return tabAssetId.m_assetId.Get()->GetScriptCanvasId(); } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 46e57ceaf1..2f62bbcdf5 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -260,7 +260,7 @@ namespace ScriptCanvasEditor activeAssets.push_back(assetSaveData); } } - else if (assetId == focusedAssetId) + else if (assetId.AnyEquals(focusedAssetId)) { focusedAssetId.Clear(); } @@ -822,7 +822,7 @@ namespace ScriptCanvasEditor void MainWindow::SignalActiveSceneChanged(ScriptCanvasEditor::SourceHandle assetId) { AZ::EntityId graphId; - if (assetId) + if (assetId.IsValid()) { EditorGraphRequestBus::EventResult(graphId, assetId.Get()->GetScriptCanvasId(), &EditorGraphRequests::GetGraphCanvasGraphId); } @@ -1251,7 +1251,7 @@ namespace ScriptCanvasEditor AZ::Outcome MainWindow::OpenScriptCanvasAsset(ScriptCanvasEditor::SourceHandle scriptCanvasAssetId, int tabIndex) { - if (scriptCanvasAssetId) + if (scriptCanvasAssetId.IsValid()) { return OpenScriptCanvasAssetImplementation(scriptCanvasAssetId, tabIndex); } @@ -1272,7 +1272,7 @@ namespace ScriptCanvasEditor m_assetCreationRequests.erase(assetId); GeneralAssetNotificationBus::Event(assetId, &GeneralAssetNotifications::OnAssetUnloaded); - if (assetId) + if (assetId.IsValid()) { // Disconnect scene and asset editor buses GraphCanvas::SceneNotificationBus::MultiHandler::BusDisconnect(assetId.Get()->GetScriptCanvasId()); @@ -1314,7 +1314,7 @@ namespace ScriptCanvasEditor OnFileNew(); - bool createdNewAsset = m_activeGraph != previousAssetId; + bool createdNewAsset = !(m_activeGraph.AnyEquals(previousAssetId)); if (createdNewAsset) { @@ -1754,7 +1754,7 @@ namespace ScriptCanvasEditor return false; } - if (m_activeGraph != inMemoryAssetId) + if (!m_activeGraph.AnyEquals(inMemoryAssetId)) { OnChangeActiveGraphTab(inMemoryAssetId); } @@ -2489,7 +2489,7 @@ namespace ScriptCanvasEditor { AZ::EntityId graphId{}; - if (m_activeGraph) + if (m_activeGraph.IsValid()) { EditorGraphRequestBus::EventResult ( graphId, m_activeGraph.Get()->GetScriptCanvasId(), &EditorGraphRequests::GetGraphCanvasGraphId); @@ -2514,7 +2514,7 @@ namespace ScriptCanvasEditor { AZ::EntityId graphId{}; - if (assetId) + if (assetId.IsValid()) { EditorGraphRequestBus::EventResult ( graphId, assetId.Get()->GetScriptCanvasId(), &EditorGraphRequests::GetGraphCanvasGraphId); @@ -2525,7 +2525,7 @@ namespace ScriptCanvasEditor ScriptCanvas::ScriptCanvasId MainWindow::FindScriptCanvasIdByAssetId(const ScriptCanvasEditor::SourceHandle& assetId) const { - return assetId ? assetId.Get()->GetScriptCanvasId() : ScriptCanvas::ScriptCanvasId{}; + return assetId.IsValid() ? assetId.Get()->GetScriptCanvasId() : ScriptCanvas::ScriptCanvasId{}; } ScriptCanvas::ScriptCanvasId MainWindow::GetScriptCanvasId(const GraphCanvas::GraphId& graphCanvasGraphId) const @@ -2568,7 +2568,7 @@ namespace ScriptCanvasEditor if (tabdata.isValid()) { auto tabAssetId = tabdata.value(); - if (tabAssetId.m_assetId == assetId) + if (tabAssetId.m_assetId.AnyEquals(assetId)) { return tabdata; } @@ -2594,14 +2594,14 @@ namespace ScriptCanvasEditor // Disconnect previous asset AZ::EntityId previousScriptCanvasSceneId; - if (previousAsset) + if (previousAsset.IsValid()) { previousScriptCanvasSceneId = previousAsset.Get()->GetScriptCanvasId(); GraphCanvas::SceneNotificationBus::MultiHandler::BusDisconnect(previousScriptCanvasSceneId); } AZ::EntityId nextAssetGraphCanvasId; - if (nextAsset) + if (nextAsset.IsValid()) { // Connect the next asset EditorGraphRequestBus::EventResult(nextAssetGraphCanvasId, nextAsset.Get()->GetScriptCanvasId(), &EditorGraphRequests::GetGraphCanvasGraphId); @@ -2622,9 +2622,7 @@ namespace ScriptCanvasEditor void MainWindow::SetActiveAsset(const ScriptCanvasEditor::SourceHandle& fileAssetId) { - // #sc_editor_asset - - if (m_activeGraph == fileAssetId) + if (m_activeGraph.AnyEquals(fileAssetId)) { return; } @@ -2827,7 +2825,7 @@ namespace ScriptCanvasEditor { auto assetId = tabdata.value(); - if (assetId.m_assetId != m_skipTabOnClose) + if (!assetId.m_assetId.AnyEquals(m_skipTabOnClose)) { break; } @@ -2855,7 +2853,7 @@ namespace ScriptCanvasEditor bool activeSet = false; - if (tabAssetId.m_assetId == m_activeGraph) + if (tabAssetId.m_assetId.AnyEquals(m_activeGraph)) { SetActiveAsset({}); activeSet = true; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp index 064029eb03..829a25f3d1 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp @@ -229,7 +229,7 @@ namespace ScriptCanvasEditor bool SourceHandle::IsValid() const { - return *this; + return m_data != nullptr; } GraphPtr SourceHandle::Mod() const @@ -237,14 +237,16 @@ namespace ScriptCanvasEditor return m_data ? m_data->ModEditorGraph() : nullptr; } - SourceHandle::operator bool() const + bool SourceHandle::operator==(const SourceHandle& other) const { - return m_data != nullptr; + return m_data.get() == other.m_data.get() + && m_id == other.m_id + && m_path == other.m_path; } - bool SourceHandle::operator!() const + bool SourceHandle::operator!=(const SourceHandle& other) const { - return m_data == nullptr; + return !(*this == other); } const AZStd::string& SourceHandle::Path() const @@ -252,6 +254,11 @@ namespace ScriptCanvasEditor return m_path; } + bool SourceHandle::PathEquals(const SourceHandle& other) const + { + return m_path == other.m_path; + } + AZStd::string SourceHandle::ToString() const { return AZStd::string::format diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h index 415c181033..8d7dc40866 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h @@ -344,12 +344,14 @@ namespace ScriptCanvasEditor GraphPtr Mod() const; - operator bool() const; + bool operator==(const SourceHandle& other) const; - bool operator!() const; + bool operator!=(const SourceHandle& other) const; const AZStd::string& Path() const; + bool PathEquals(const SourceHandle& other) const; + AZStd::string ToString() const; private: From 921f675df298ebb9718653968bc5ca8f988b9085 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Thu, 11 Nov 2021 10:36:55 -0800 Subject: [PATCH 054/948] restore source file deleted behavior Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Editor/View/Windows/MainWindow.cpp | 17 ++++++++++++----- .../Code/Editor/View/Windows/MainWindow.h | 4 +++- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 2f62bbcdf5..cf77653eaf 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -664,7 +664,7 @@ namespace ScriptCanvasEditor ScriptCanvas::BatchOperationNotificationBus::Handler::BusConnect(); AssetGraphSceneBus::Handler::BusConnect(); AzToolsFramework::ToolsApplicationNotificationBus::Handler::BusConnect(); - + AzToolsFramework::AssetSystemBus::Handler::BusConnect(); ScriptCanvas::ScriptCanvasSettingsRequestBus::Handler::BusConnect(); UINotificationBus::Broadcast(&UINotifications::MainWindowCreationEvent, this); @@ -708,6 +708,7 @@ namespace ScriptCanvasEditor ScriptCanvasEditor::GeneralRequestBus::Handler::BusDisconnect(); GraphCanvas::AssetEditorAutomationRequestBus::Handler::BusDisconnect(); ScriptCanvas::ScriptCanvasSettingsRequestBus::Handler::BusDisconnect(); + AzToolsFramework::AssetSystemBus::Handler::BusDisconnect(); Clear(); @@ -1111,6 +1112,15 @@ namespace ScriptCanvasEditor RestartAutoTimerSave(forceTimer); } + void MainWindow::SourceFileRemoved + ( AZStd::string relativePath + , [[maybe_unused]] AZStd::string scanFolder + , [[maybe_unused]] AZ::Uuid fileAssetId) + { + ScriptCanvasEditor::SourceHandle handle(nullptr, fileAssetId, relativePath); + UpdateFileState(handle, Tracker::ScriptCanvasFileState::SOURCE_REMOVED); + } + void MainWindow::SignalSceneDirty(ScriptCanvasEditor::SourceHandle assetId) { UpdateFileState(assetId, Tracker::ScriptCanvasFileState::MODIFIED); @@ -2535,7 +2545,6 @@ namespace ScriptCanvasEditor bool MainWindow::IsInUndoRedo(const AZ::EntityId& graphCanvasGraphId) const { - // #sc_editor_asset bool isActive = false; UndoRequestBus::EventResult(isActive, GetScriptCanvasId(graphCanvasGraphId), &UndoRequests::IsActive); return isActive; @@ -2590,12 +2599,10 @@ namespace ScriptCanvasEditor void MainWindow::ReconnectSceneBuses(ScriptCanvasEditor::SourceHandle previousAsset, ScriptCanvasEditor::SourceHandle nextAsset) { - // #sc_editor_asset - // Disconnect previous asset AZ::EntityId previousScriptCanvasSceneId; if (previousAsset.IsValid()) - { + { previousScriptCanvasSceneId = previousAsset.Get()->GetScriptCanvasId(); GraphCanvas::SceneNotificationBus::MultiHandler::BusDisconnect(previousScriptCanvasSceneId); } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h index 7c527a5449..dfe5d9fa13 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h @@ -231,7 +231,6 @@ namespace ScriptCanvasEditor , private VariablePaletteRequestBus::Handler , private ScriptCanvas::BatchOperationNotificationBus::Handler , private AssetGraphSceneBus::Handler - //, private AssetTrackerNotificationBus::MultiHandler #if SCRIPTCANVAS_EDITOR //, public IEditorNotifyListener #endif @@ -240,6 +239,7 @@ namespace ScriptCanvasEditor , private GraphCanvas::ViewNotificationBus::Handler , public AZ::SystemTickBus::Handler , private AzToolsFramework::ToolsApplicationNotificationBus::Handler + , private AzToolsFramework::AssetSystemBus::Handler , private ScriptCanvas::ScriptCanvasSettingsRequestBus::Handler { Q_OBJECT @@ -525,6 +525,8 @@ namespace ScriptCanvasEditor AZ::EntityId FindAssetNodeIdByEditorNodeId(const ScriptCanvasEditor::SourceHandle& assetId, AZ::EntityId editorNodeId) const override; private: + void SourceFileRemoved(AZStd::string relativePath, AZStd::string scanFolder, AZ::Uuid fileAssetId) override; + void DeleteNodes(const AZ::EntityId& sceneId, const AZStd::vector& nodes) override; void DeleteConnections(const AZ::EntityId& sceneId, const AZStd::vector& connections) override; void DisconnectEndpoints(const AZ::EntityId& sceneId, const AZStd::vector& endpoints) override; From b7d8c1a6449470f1241b06a26cf50ef204588c46 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Thu, 11 Nov 2021 12:18:50 -0800 Subject: [PATCH 055/948] make default names NOT the default name of a previously existing file Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Editor/View/Windows/MainWindow.cpp | 124 ++++++++++-------- 1 file changed, 72 insertions(+), 52 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index cf77653eaf..12d1a2fa3d 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -1593,27 +1593,33 @@ namespace ScriptCanvasEditor void MainWindow::OnFileNew() { - static int scriptCanvasEditorDefaultNewNameCount = 0; + int scriptCanvasEditorDefaultNewNameCount = 0; - ScriptCanvasAssetDescription description; - - AZStd::string newAssetName = AZStd::string::format(description.GetAssetNamePatternImpl(), ++scriptCanvasEditorDefaultNewNameCount); + AZStd::string assetPath; - AZStd::array assetRootArray; - if (!AZ::IO::FileIOBase::GetInstance()->ResolvePath(description.GetSuggestedSavePathImpl() - , assetRootArray.data(), assetRootArray.size())) + for (;;) { - AZ_ErrorOnce("Script Canvas", false, "Unable to resolve @projectroot@ path"); - } + ScriptCanvasAssetDescription description; + AZStd::string newAssetName = AZStd::string::format(description.GetAssetNamePatternImpl(), ++scriptCanvasEditorDefaultNewNameCount); + + AZStd::array assetRootArray; + if (!AZ::IO::FileIOBase::GetInstance()->ResolvePath(description.GetSuggestedSavePathImpl() + , assetRootArray.data(), assetRootArray.size())) + { + AZ_ErrorOnce("Script Canvas", false, "Unable to resolve @projectroot@ path"); + } - AZStd::string assetPath; - AzFramework::StringFunc::Path::Join(assetRootArray.data(), (newAssetName + description.GetExtensionImpl()).data(), assetPath); + AzFramework::StringFunc::Path::Join(assetRootArray.data(), (newAssetName + description.GetExtensionImpl()).data(), assetPath); + AZ::Data::AssetInfo assetInfo; - auto createOutcome = CreateScriptCanvasAsset(assetPath); - if (createOutcome) - { + if (!AssetHelpers::GetAssetInfo(assetPath, assetInfo)) + { + break; + } } - else + + auto createOutcome = CreateScriptCanvasAsset(assetPath); + if (!createOutcome.IsSuccess()) { AZ_Warning("Script Canvas", createOutcome, "%s", createOutcome.GetError().data()); } @@ -1871,7 +1877,6 @@ namespace ScriptCanvasEditor return false; } - void MainWindow::OnSaveCallBack(const VersionExplorer::FileSaveResult& result) { const bool saveSuccess = result.fileSaveError.empty(); @@ -1883,8 +1888,28 @@ namespace ScriptCanvasEditor { // #sc_editor_asset find a tab with the same path name and close non focused old ones with the same name // Update the editor with the new information about this asset. - const ScriptCanvasEditor::SourceHandle& fileAssetId = memoryAsset; + ScriptCanvasEditor::SourceHandle& fileAssetId = memoryAsset; int currentTabIndex = m_tabBar->currentIndex(); + + AZ::Data::AssetId oldId = fileAssetId.Id(); + AZ::Data::AssetInfo assetInfo; + assetInfo.m_assetId = fileAssetId.Id(); + AZ_VerifyWarning("ScriptCanvas", AssetHelpers::GetAssetInfo(fileAssetId.Path(), assetInfo) + , "Failed to find asset info for source file just saved: %s", fileAssetId.Path().c_str()); + + const bool assetIdHasChanged = assetInfo.m_assetId.m_guid != fileAssetId.Id(); + fileAssetId = SourceHandle(fileAssetId, assetInfo.m_assetId.m_guid, fileAssetId.Path()); + + // #sc_editor_asset + // check for saving a graph over another graph with an open tab + { + // find the saved tab by graph* + // find all tabs that match old path, and close them + // update the save tab index + // and the current index + } + + // this path is questionable, this is a save request that is not the current graph // We've saved as over a new graph, so we need to close the old one. if (saveTabIndex != currentTabIndex) { @@ -1908,52 +1933,47 @@ namespace ScriptCanvasEditor } AzFramework::StringFunc::Path::GetFileName(memoryAsset.Path().c_str(), tabName); - // Update the tab's assetId to the file asset Id (necessary when saving a new asset) // #sc_editor_asset used to be configure tab...sets the name and file state - // m_tabBar->ConfigureTab(saveTabIndex, fileAssetId, tabName); -// GeneralAssetNotificationBus::Event(memoryAsset, &GeneralAssetNotifications::OnAssetVisualized); -// -// auto requestorIter = m_assetCreationRequests.find(fileAsset->GetId()); -// -// if (requestorIter != m_assetCreationRequests.end()) -// { -// auto editorComponents = AZ::EntityUtils::FindDerivedComponents(requestorIter->second.first); -// -// if (editorComponents.empty()) -// { -// auto firstRequestBus = EditorScriptCanvasComponentRequestBus::FindFirstHandler(requestorIter->second.first); -// -// if (firstRequestBus) -// { -// firstRequestBus->SetAssetId(fileAsset->GetId()); -// } -// } -// else -// { -// for (auto editorComponent : editorComponents) -// { -// if (editorComponent->GetId() == requestorIter->second.second) -// { -// editorComponent->SetAssetId(fileAsset->GetId()); -// break; -// } -// } -// } -// -// m_assetCreationRequests.erase(requestorIter); -// } + if (assetIdHasChanged) + { + auto entity = memoryAsset.Get()->GetEntity(); + + auto editorComponents = AZ::EntityUtils::FindDerivedComponents(entity); + + if (editorComponents.empty()) + { + if (auto firstRequestBus = EditorScriptCanvasComponentRequestBus::FindFirstHandler(entity->GetId())) + { + firstRequestBus->SetAssetId(memoryAsset.Id()); + } + } + else + { + for (auto editorComponent : editorComponents) + { + if (editorComponent->GetAssetId() == oldId) + { + editorComponent->SetAssetId(memoryAsset.Id()); + break; + } + } + } + } // Soft switch the asset id here. We'll do a double scene switch down below to actually switch the active assetid m_activeGraph = fileAssetId; - if (tabName.at(tabName.size() - 1) == '*') + if (tabName.at(tabName.size() - 1) == '*' || tabName.at(tabName.size() - 1) == '^') { tabName = tabName.substr(0, tabName.size() - 2); } - m_tabBar->UpdateFileState(fileAssetId, Tracker::ScriptCanvasFileState::UNMODIFIED); + auto tabData = m_tabBar->GetTabData(saveTabIndex); + tabData->m_fileState = Tracker::ScriptCanvasFileState::UNMODIFIED; + tabData->m_assetId = fileAssetId; + m_tabBar->SetTabData(*tabData, saveTabIndex); m_tabBar->SetTabText(saveTabIndex, tabName.c_str()); } else From e34c6e55dfd03ca4d8e1affcf7c6fd4004eeda43 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Fri, 12 Nov 2021 09:33:39 -0800 Subject: [PATCH 056/948] fix scoped compile error Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp b/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp index 7913069243..8e273fd2fc 100644 --- a/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp @@ -393,7 +393,7 @@ namespace ScriptCanvasEditor::Nodes if (methodNode->HasBusID() && busId == slot.GetId() && slot.GetDescriptor() == ScriptCanvas::SlotDescriptors::DataIn()) { - key = Translation::GlobalKeys::EBusSenderIDKey; + key = ::Translation::GlobalKeys::EBusSenderIDKey; GraphCanvas::TranslationRequestBus::BroadcastResult(details, &GraphCanvas::TranslationRequests::GetDetails, key + ".details", details); } else @@ -508,7 +508,7 @@ namespace ScriptCanvasEditor::Nodes if (busNode->IsIDRequired() && slot->GetDescriptor() == ScriptCanvas::SlotDescriptors::DataIn()) { GraphCanvas::TranslationKey key; - key << Translation::GlobalKeys::EBusHandlerIDKey << "details"; + key << ::Translation::GlobalKeys::EBusHandlerIDKey << "details"; GraphCanvas::TranslationRequests::Details details; details.m_name = slot->GetName(); details.m_tooltip = slot->GetToolTip(); @@ -726,7 +726,7 @@ namespace ScriptCanvasEditor::Nodes if (busNode->IsIDRequired() && slot->GetDescriptor() == ScriptCanvas::SlotDescriptors::DataIn()) { GraphCanvas::TranslationKey key; - key << Translation::GlobalKeys::EBusHandlerIDKey << "details"; + key << ::Translation::GlobalKeys::EBusHandlerIDKey << "details"; GraphCanvas::TranslationRequests::Details details; GraphCanvas::TranslationRequestBus::BroadcastResult(details, &GraphCanvas::TranslationRequests::GetDetails, key, details); GraphCanvas::SlotRequestBus::Event(gcSlotId, &GraphCanvas::SlotRequests::SetDetails, details.m_name, details.m_tooltip); From 015185f9d61c7dc4121d141ff59d952fbeb9c799 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Mon, 15 Nov 2021 17:15:05 -0800 Subject: [PATCH 057/948] fix upgrade scanner Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Editor/Components/EditorGraph.cpp | 2 +- .../Code/Editor/Components/GraphUpgrade.cpp | 5 +- .../ScriptCanvas/Bus/EditorScriptCanvasBus.h | 4 +- .../ScriptCanvas/Components/EditorGraph.h | 2 +- .../Components/EditorScriptCanvasComponent.h | 2 + .../ScriptCanvas/Components/GraphUpgrade.h | 4 +- .../Code/Editor/View/Windows/MainWindow.cpp | 10 +- .../Windows/Tools/UpgradeTool/Controller.cpp | 144 ++++++------------ .../Windows/Tools/UpgradeTool/Controller.h | 30 ++-- .../Windows/Tools/UpgradeTool/FileSaver.cpp | 98 +----------- .../Windows/Tools/UpgradeTool/FileSaver.h | 4 +- .../View/Windows/Tools/UpgradeTool/Model.cpp | 6 +- .../Windows/Tools/UpgradeTool/ModelTraits.h | 52 +++---- .../Windows/Tools/UpgradeTool/Modifier.cpp | 57 +++---- .../View/Windows/Tools/UpgradeTool/Modifier.h | 8 +- .../Windows/Tools/UpgradeTool/Scanner.cpp | 105 ++++++++----- .../View/Windows/Tools/UpgradeTool/Scanner.h | 6 +- .../Tools/UpgradeTool/UpgradeHelper.cpp | 22 ++- .../Windows/Tools/UpgradeTool/UpgradeHelper.h | 4 +- .../Code/Include/ScriptCanvas/Core/Core.cpp | 12 +- .../Code/Include/ScriptCanvas/Core/Core.h | 22 +-- 21 files changed, 241 insertions(+), 358 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp index 7658c7d8be..7135d983fd 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp @@ -3492,7 +3492,7 @@ namespace ScriptCanvasEditor m_focusHelper.SetActiveGraph(GetGraphCanvasGraphId()); } - bool Graph::UpgradeGraph(const AZ::Data::Asset& asset, UpgradeRequest request, bool isVerbose) + bool Graph::UpgradeGraph(SourceHandle& asset, UpgradeRequest request, bool isVerbose) { m_upgradeSM.SetAsset(asset); m_upgradeSM.SetVerbose(isVerbose); diff --git a/Gems/ScriptCanvas/Code/Editor/Components/GraphUpgrade.cpp b/Gems/ScriptCanvas/Code/Editor/Components/GraphUpgrade.cpp index 0e5f11fa40..e64a47a753 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/GraphUpgrade.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/GraphUpgrade.cpp @@ -675,19 +675,18 @@ namespace ScriptCanvasEditor RegisterState(ParseGraph); } - void EditorGraphUpgradeMachine::SetAsset(const AZ::Data::Asset& asset) + void EditorGraphUpgradeMachine::SetAsset(SourceHandle& asset) { if (m_asset != asset) { m_asset = asset; - SetDebugPrefix(asset.GetHint()); + SetDebugPrefix(asset.Path().c_str()); } } void EditorGraphUpgradeMachine::OnComplete(IState::ExitStatus exitStatus) { UpgradeNotificationsBus::Broadcast(&UpgradeNotifications::OnGraphUpgradeComplete, m_asset, exitStatus == IState::ExitStatus::Skipped); - m_asset = {}; } diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/EditorScriptCanvasBus.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/EditorScriptCanvasBus.h index 7c57d661f0..b55e425d43 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/EditorScriptCanvasBus.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/EditorScriptCanvasBus.h @@ -26,6 +26,8 @@ #include #include +#include + namespace GraphCanvas { class GraphCanvasTreeItem; @@ -223,7 +225,7 @@ namespace ScriptCanvasEditor virtual void OnUpgradeStart() {} virtual void OnUpgradeCancelled() {} - virtual void OnGraphUpgradeComplete(AZ::Data::Asset&, bool skipped = false) { (void)skipped; } + virtual void OnGraphUpgradeComplete(SourceHandle&, bool skipped = false) { (void)skipped; } }; using UpgradeNotificationsBus = AZ::EBus; diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h index b5269cc45d..8a98601d54 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h @@ -237,7 +237,7 @@ namespace ScriptCanvasEditor IfOutOfDate, Forced }; - bool UpgradeGraph(const AZ::Data::Asset& asset, UpgradeRequest request, bool isVerbose = true); + bool UpgradeGraph(SourceHandle& asset, UpgradeRequest request, bool isVerbose = true); void ConnectGraphCanvasBuses(); void DisconnectGraphCanvasBuses(); /////// diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h index 87ffff8b19..1bdb4ccb85 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h @@ -37,6 +37,7 @@ namespace ScriptCanvasEditor , private EditorScriptCanvasComponentLoggingBus::Handler , private EditorScriptCanvasComponentRequestBus::Handler , private AssetTrackerNotificationBus::Handler + , private AzToolsFramework::AssetSystemBus::Handler , private AzToolsFramework::EditorEntityContextNotificationBus::Handler { @@ -44,6 +45,7 @@ namespace ScriptCanvasEditor AZ_COMPONENT(EditorScriptCanvasComponent, "{C28E2D29-0746-451D-A639-7F113ECF5D72}", AzToolsFramework::Components::EditorComponentBase); EditorScriptCanvasComponent(); + // EditorScriptCanvasComponent(AZ::Data::Asset asset); EditorScriptCanvasComponent(AZ::Data::Asset asset); ~EditorScriptCanvasComponent() override; diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/GraphUpgrade.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/GraphUpgrade.h index 817b883695..0e6e69c4bf 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/GraphUpgrade.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/GraphUpgrade.h @@ -184,9 +184,9 @@ namespace ScriptCanvasEditor bool m_graphNeedsDirtying = false; Graph* m_graph = nullptr; - AZ::Data::Asset m_asset; + SourceHandle m_asset; - void SetAsset(const AZ::Data::Asset& asset); + void SetAsset(SourceHandle& assetasset); void OnComplete(IState::ExitStatus exitStatus) override; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 12d1a2fa3d..6203423e29 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -1209,7 +1209,7 @@ namespace ScriptCanvasEditor { if (!m_isRestoringWorkspace) { - AZStd::string errorPath = scriptCanvasAsset.Path(); + AZStd::string errorPath = scriptCanvasAsset.Path().c_str(); if (errorPath.empty()) { @@ -1247,7 +1247,7 @@ namespace ScriptCanvasEditor , fileAssetId.ToString().c_str())); } - AZStd::string assetPath = scriptCanvasAsset.Path(); + AZStd::string assetPath = scriptCanvasAsset.Path().c_str(); if (!assetPath.empty() && !m_loadingNewlySavedFile) { AddRecentFile(assetPath.c_str()); @@ -1786,7 +1786,7 @@ namespace ScriptCanvasEditor { isValidFileName = true; suggestedFileFilter = ScriptCanvasAssetDescription().GetExtensionImpl(); - suggestedFilename = inMemoryAssetId.Path(); + suggestedFilename = inMemoryAssetId.Path().c_str(); } else { @@ -1799,7 +1799,7 @@ namespace ScriptCanvasEditor } else { - suggestedFilename = inMemoryAssetId.Path(); + suggestedFilename = inMemoryAssetId.Path().c_str(); } } @@ -1894,7 +1894,7 @@ namespace ScriptCanvasEditor AZ::Data::AssetId oldId = fileAssetId.Id(); AZ::Data::AssetInfo assetInfo; assetInfo.m_assetId = fileAssetId.Id(); - AZ_VerifyWarning("ScriptCanvas", AssetHelpers::GetAssetInfo(fileAssetId.Path(), assetInfo) + AZ_VerifyWarning("ScriptCanvas", AssetHelpers::GetAssetInfo(fileAssetId.Path().c_str(), assetInfo) , "Failed to find asset info for source file just saved: %s", fileAssetId.Path().c_str()); const bool assetIdHasChanged = assetInfo.m_assetId.m_guid != fileAssetId.Id(); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp index dbcd176ee5..5189895a56 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp @@ -104,9 +104,9 @@ namespace ScriptCanvasEditor } } - QList Controller::FindTableItems(const AZ::Data::AssetInfo& info) + QList Controller::FindTableItems(const SourceHandle& info) { - return m_view->tableWidget->findItems(info.m_relativePath.c_str(), Qt::MatchFlag::MatchExactly); + return m_view->tableWidget->findItems(info.Path().c_str(), Qt::MatchFlag::MatchExactly); } void Controller::OnButtonPressClose() @@ -117,30 +117,20 @@ namespace ScriptCanvasEditor void Controller::OnButtonPressScan() { // \todo move to another file - auto isUpToDate = [this](AZ::Data::Asset asset) + auto isUpToDate = [this](const SourceHandle& asset) { - AZ::Entity* scriptCanvasEntity = nullptr; + auto graphComponent = asset.Get(); - if (asset.GetType() == azrtti_typeid()) - { - ScriptCanvasAsset* scriptCanvasAsset = asset.GetAs(); - if (!scriptCanvasAsset) - { - AZ_Warning - (ScriptCanvas::k_VersionExplorerWindow.data() - , false - , "InspectAsset: %s, AsestData failed to return ScriptCanvasAsset" - , asset.GetHint().c_str()); - return true; - } - - scriptCanvasEntity = scriptCanvasAsset->GetScriptCanvasEntity(); - AZ_Assert(scriptCanvasEntity, "The Script Canvas asset must have a valid entity"); - } - - auto graphComponent = scriptCanvasEntity->FindComponent(); - AZ_Assert(graphComponent, "The Script Canvas entity must have a Graph component"); - return !m_view->forceUpgrade->isChecked() && graphComponent->GetVersion().IsLatest(); + AZ_Warning + ( ScriptCanvas::k_VersionExplorerWindow.data() + , asset.Get() != nullptr + , "InspectAsset: %s, failed to load valid graph" + , asset.Path().c_str()); + + return graphComponent + && (!graphComponent->GetVersion().IsLatest() || m_view->forceUpgrade->isChecked()) + ? ScanConfiguration::Filter::Include + : ScanConfiguration::Filter::Exclude; }; ScanConfiguration config; @@ -156,59 +146,19 @@ namespace ScriptCanvasEditor OnButtonPressUpgradeImplementation({}); } - void Controller::OnButtonPressUpgradeImplementation(const AZ::Data::AssetInfo& assetInfo) + void Controller::OnButtonPressUpgradeImplementation(const SourceHandle& assetInfo) { - auto simpleUpdate = [this](AZ::Data::Asset asset) + auto simpleUpdate = [this](SourceHandle& asset) { - if (asset.GetType() == azrtti_typeid()) - { - ScriptCanvasAsset* scriptCanvasAsset = asset.GetAs(); - AZ_Assert(scriptCanvasAsset, "Unable to get the asset of ScriptCanvasAsset, but received type: %s" - , azrtti_typeid().template ToString().c_str()); - if (!scriptCanvasAsset) - { - return; - } + AZ_Warning(ScriptCanvas::k_VersionExplorerWindow.data(), asset.Get() != nullptr + , "The Script Canvas asset must have a Graph component"); - AZ::Entity* scriptCanvasEntity = scriptCanvasAsset->GetScriptCanvasEntity(); - AZ_Assert(scriptCanvasEntity, "View::UpgradeGraph The Script Canvas asset must have a valid entity"); - if (!scriptCanvasEntity) - { - return; - } - - AZ::Entity* queryEntity = nullptr; - AZ::ComponentApplicationBus::BroadcastResult(queryEntity, &AZ::ComponentApplicationRequests::FindEntity, scriptCanvasEntity->GetId()); - if (queryEntity) - { - if (queryEntity->GetState() == AZ::Entity::State::Active) - { - queryEntity->Deactivate(); - } - - scriptCanvasEntity = queryEntity; - } - - if (scriptCanvasEntity->GetState() == AZ::Entity::State::Constructed) - { - scriptCanvasEntity->Init(); - } - - if (scriptCanvasEntity->GetState() == AZ::Entity::State::Init) - { - scriptCanvasEntity->Activate(); - } - - AZ_Assert(scriptCanvasEntity->GetState() == AZ::Entity::State::Active, "Graph entity is not active"); - auto graphComponent = scriptCanvasEntity->FindComponent(); - AZ_Assert(graphComponent, "The Script Canvas entity must have a Graph component"); - if (graphComponent) - { - graphComponent->UpgradeGraph - (asset - , m_view->forceUpgrade->isChecked() ? Graph::UpgradeRequest::Forced : Graph::UpgradeRequest::IfOutOfDate - , m_view->verbose->isChecked()); - } + if (asset.Get()) + { + asset.Mod()->UpgradeGraph + ( asset + , m_view->forceUpgrade->isChecked() ? Graph::UpgradeRequest::Forced : Graph::UpgradeRequest::IfOutOfDate + , m_view->verbose->isChecked()); } }; @@ -235,12 +185,12 @@ namespace ScriptCanvasEditor ModelRequestsBus::Broadcast(&ModelRequestsTraits::Modify, config); } - void Controller::OnButtonPressUpgradeSingle(const AZ::Data::AssetInfo& assetInfo) + void Controller::OnButtonPressUpgradeSingle(const SourceHandle& info) { - OnButtonPressUpgradeImplementation(assetInfo); + OnButtonPressUpgradeImplementation(info); } - void Controller::OnUpgradeModificationBegin([[maybe_unused]] const ModifyConfiguration& config, const AZ::Data::AssetInfo& info) + void Controller::OnUpgradeModificationBegin([[maybe_unused]] const ModifyConfiguration& config, const SourceHandle& info) { for (auto* item : FindTableItems(info)) { @@ -252,16 +202,16 @@ namespace ScriptCanvasEditor void Controller::OnUpgradeModificationEnd ( [[maybe_unused]] const ModifyConfiguration& config - , const AZ::Data::AssetInfo& info + , const SourceHandle& info , ModificationResult result) { if (result.errorMessage.empty()) { - VE_LOG("Successfully modified %s", result.assetInfo.m_relativePath.c_str()); + VE_LOG("Successfully modified %s", result.asset.Path().c_str()); } else { - VE_LOG("Failed to modify %s: %s", result.assetInfo.m_relativePath.c_str(), result.errorMessage.data()); + VE_LOG("Failed to modify %s: %s", result.asset.Path().c_str(), result.errorMessage.data()); } for (auto* item : FindTableItems(info)) @@ -289,12 +239,10 @@ namespace ScriptCanvasEditor AddLogEntries(); } - void Controller::OnGraphUpgradeComplete(AZ::Data::Asset& asset, bool skipped) + void Controller::OnGraphUpgradeComplete(ScriptCanvasEditor::SourceHandle& asset, bool skipped) { ModificationResult result; result.asset = asset; - AZ::Data::AssetCatalogRequestBus::BroadcastResult - ( result.assetInfo, &AZ::Data::AssetCatalogRequests::GetAssetInfoById, asset.GetId()); if (skipped) { @@ -342,19 +290,19 @@ namespace ScriptCanvasEditor } } - void Controller::OnScanFilteredGraph(const AZ::Data::AssetInfo& info) + void Controller::OnScanFilteredGraph(const SourceHandle& info) { OnScannedGraph(info, Filtered::Yes); } - void Controller::OnScannedGraph(const AZ::Data::AssetInfo& assetInfo, [[maybe_unused]] Filtered filtered) + void Controller::OnScannedGraph(const SourceHandle& assetInfo, [[maybe_unused]] Filtered filtered) { const int rowIndex = m_view->tableWidget->rowCount(); if (filtered == Filtered::No || !m_view->onlyShowOutdated->isChecked()) { m_view->tableWidget->insertRow(rowIndex); - QTableWidgetItem* rowName = new QTableWidgetItem(tr(assetInfo.m_relativePath.c_str())); + QTableWidgetItem* rowName = new QTableWidgetItem(tr(assetInfo.Path().c_str())); m_view->tableWidget->setItem(rowIndex, static_cast(ColumnAsset), rowName); SetRowSucceeded(rowIndex); @@ -378,7 +326,7 @@ namespace ScriptCanvasEditor } char resolvedBuffer[AZ_MAX_PATH_LEN] = { 0 }; - AZStd::string path = AZStd::string::format("@devroot@/%s", assetInfo.m_relativePath.c_str()); + AZStd::string path = AZStd::string::format("@devroot@/%s", assetInfo.Path().c_str()); AZ::IO::FileIOBase::GetInstance()->ResolvePath(path.c_str(), resolvedBuffer, AZ_MAX_PATH_LEN); AZ::StringFunc::Path::GetFullPath(resolvedBuffer, path); AZ::StringFunc::Path::Normalize(path); @@ -386,7 +334,7 @@ namespace ScriptCanvasEditor bool result = false; AZ::Data::AssetInfo info; AZStd::string watchFolder; - QByteArray assetNameUtf8 = assetInfo.m_relativePath.c_str(); + QByteArray assetNameUtf8 = assetInfo.Path().c_str(); AzToolsFramework::AssetSystemRequestBus::BroadcastResult ( result , &AzToolsFramework::AssetSystemRequestBus::Events::GetSourceInfoBySourcePath @@ -413,41 +361,41 @@ namespace ScriptCanvasEditor OnScannedGraphResult(assetInfo); } - void Controller::OnScannedGraphResult([[maybe_unused]] const AZ::Data::AssetInfo& info) + void Controller::OnScannedGraphResult([[maybe_unused]] const SourceHandle& info) { m_view->progressBar->setValue(aznumeric_cast(m_handledAssetCount)); ++m_handledAssetCount; AddLogEntries(); } - void Controller::OnScanLoadFailure(const AZ::Data::AssetInfo& info) + void Controller::OnScanLoadFailure(const SourceHandle& info) { const int rowIndex = m_view->tableWidget->rowCount(); m_view->tableWidget->insertRow(rowIndex); QTableWidgetItem* rowName = new QTableWidgetItem - ( tr(AZStd::string::format("Load Error: %s", info.m_relativePath.c_str()).c_str())); + ( tr(AZStd::string::format("Load Error: %s", info.Path().c_str()).c_str())); m_view->tableWidget->setItem(rowIndex, static_cast(ColumnAsset), rowName); SetRowFailed(rowIndex, "Load failed"); OnScannedGraphResult(info); } - void Controller::OnScanUnFilteredGraph(const AZ::Data::AssetInfo& info) + void Controller::OnScanUnFilteredGraph(const SourceHandle& info) { OnScannedGraph(info, Filtered::No); } void Controller::OnUpgradeBegin ( const ModifyConfiguration& config - , [[maybe_unused]] const WorkingAssets& assets) + , [[maybe_unused]] const AZStd::vector& assets) { QString spinnerText = QStringLiteral("Upgrade in progress - "); - if (config.modifySingleAsset.m_assetId.IsValid()) + if (!config.modifySingleAsset.Path().empty()) { spinnerText.append(" single graph"); if (assets.size() == 1) { - for (auto* item : FindTableItems(assets.front().info)) + for (auto* item : FindTableItems(assets.front())) { int row = item->row(); SetRowBusy(row); @@ -498,7 +446,7 @@ namespace ScriptCanvasEditor m_view->scanButton->setEnabled(true); } - void Controller::OnUpgradeDependenciesGathered(const AZ::Data::AssetInfo& info, Result result) + void Controller::OnUpgradeDependenciesGathered(const SourceHandle& info, Result result) { for (auto* item : FindTableItems(info)) { @@ -527,7 +475,7 @@ namespace ScriptCanvasEditor void Controller::OnUpgradeDependencySortBegin ( [[maybe_unused]] const ModifyConfiguration& config - , const WorkingAssets& assets) + , const AZStd::vector& assets) { m_handledAssetCount = 0; m_view->progressBar->setVisible(true); @@ -553,7 +501,7 @@ namespace ScriptCanvasEditor void Controller::OnUpgradeDependencySortEnd ( [[maybe_unused]] const ModifyConfiguration& config - , const WorkingAssets& assets + , const AZStd::vector& assets , [[maybe_unused]] const AZStd::vector& sortedOrder) { m_handledAssetCount = 0; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.h index 9842ea3da4..2d7b78060e 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.h @@ -65,36 +65,36 @@ namespace ScriptCanvasEditor void AddLogEntries(); void EnableAllUpgradeButtons(); - QList FindTableItems(const AZ::Data::AssetInfo& assetInfo); + QList FindTableItems(const SourceHandle& assetInfo); void OnButtonPressClose(); void OnButtonPressScan(); void OnButtonPressUpgrade(); - void OnButtonPressUpgradeImplementation(const AZ::Data::AssetInfo& assetInfo); - void OnButtonPressUpgradeSingle(const AZ::Data::AssetInfo& assetInfo); + void OnButtonPressUpgradeImplementation(const SourceHandle& assetInfo); + void OnButtonPressUpgradeSingle(const SourceHandle& assetInfo); - void OnGraphUpgradeComplete(AZ::Data::Asset&, bool skipped) override; + void OnGraphUpgradeComplete(SourceHandle&, bool skipped) override; void OnScanBegin(size_t assetCount) override; void OnScanComplete(const ScanResult& result) override; - void OnScanFilteredGraph(const AZ::Data::AssetInfo& info) override; - void OnScanLoadFailure(const AZ::Data::AssetInfo& info) override; - void OnScanUnFilteredGraph(const AZ::Data::AssetInfo& info) override; + void OnScanFilteredGraph(const SourceHandle& info) override; + void OnScanLoadFailure(const SourceHandle& info) override; + void OnScanUnFilteredGraph(const SourceHandle& info) override; enum class Filtered { No, Yes }; - void OnScannedGraph(const AZ::Data::AssetInfo& info, Filtered filtered); - void OnScannedGraphResult(const AZ::Data::AssetInfo& info); + void OnScannedGraph(const SourceHandle& info, Filtered filtered); + void OnScannedGraphResult(const SourceHandle& info); // for single operation UI updates, just check the assets size, or note it on the request - void OnUpgradeBegin(const ModifyConfiguration& config, const WorkingAssets& assets) override; + void OnUpgradeBegin(const ModifyConfiguration& config, const AZStd::vector& assets) override; void OnUpgradeComplete(const ModificationResults& results) override; - void OnUpgradeDependenciesGathered(const AZ::Data::AssetInfo& info, Result result) override; - void OnUpgradeDependencySortBegin(const ModifyConfiguration& config, const WorkingAssets& assets) override; + void OnUpgradeDependenciesGathered(const SourceHandle& info, Result result) override; + void OnUpgradeDependencySortBegin(const ModifyConfiguration& config, const AZStd::vector& assets) override; void OnUpgradeDependencySortEnd ( const ModifyConfiguration& config - , const WorkingAssets& assets + , const AZStd::vector& assets , const AZStd::vector& sortedOrder) override; - void OnUpgradeModificationBegin(const ModifyConfiguration& config, const AZ::Data::AssetInfo& info) override; - void OnUpgradeModificationEnd(const ModifyConfiguration& config, const AZ::Data::AssetInfo& info, ModificationResult result) override; + void OnUpgradeModificationBegin(const ModifyConfiguration& config, const SourceHandle& info) override; + void OnUpgradeModificationEnd(const ModifyConfiguration& config, const SourceHandle& info, ModificationResult result) override; void SetLoggingPreferences(); void SetSpinnerIsBusy(bool isBusy); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp index f36f72234b..a88c6c2c7e 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp @@ -127,74 +127,9 @@ namespace ScriptCanvasEditor } } - void FileSaver::OnSourceFileReleased(AZ::Data::Asset asset) - { - AZStd::string relativePath, fullPath; - AZ::Data::AssetCatalogRequestBus::BroadcastResult(relativePath, &AZ::Data::AssetCatalogRequests::GetAssetPathById, asset.GetId()); - bool fullPathFound = false; - AzToolsFramework::AssetSystemRequestBus::BroadcastResult(fullPathFound, &AzToolsFramework::AssetSystemRequestBus::Events::GetFullSourcePathFromRelativeProductPath, relativePath, fullPath); - AZStd::string tmpFileName; - // here we are saving the graph to a temp file instead of the original file and then copying the temp file to the original file. - // This ensures that AP will not a get a file change notification on an incomplete graph file causing it to fail processing. Temp files are ignored by AP. - if (!AZ::IO::CreateTempFileName(fullPath.c_str(), tmpFileName)) - { - FileSaveResult result; - result.fileSaveError = "Failure to create temporary file name"; - m_onComplete(result); - return; - } - - bool tempSavedSucceeded = false; - AZ::IO::FileIOStream fileStream(tmpFileName.c_str(), AZ::IO::OpenMode::ModeWrite | AZ::IO::OpenMode::ModeText); - if (fileStream.IsOpen()) - { - if (asset.GetType() == azrtti_typeid()) - { - ScriptCanvasEditor::ScriptCanvasAssetHandler handler; - tempSavedSucceeded = handler.SaveAssetData(asset, &fileStream); - } - - fileStream.Close(); - } - - if (!tempSavedSucceeded) - { - FileSaveResult result; - result.fileSaveError = "Save asset data to temporary file failed"; - m_onComplete(result); - return; - } - - AzToolsFramework::SourceControlCommandBus::Broadcast - ( &AzToolsFramework::SourceControlCommandBus::Events::RequestEdit - , fullPath.c_str() - , true - , [this, fullPath, tmpFileName]([[maybe_unused]] bool success, const AzToolsFramework::SourceControlFileInfo& info) - { - constexpr const size_t k_maxAttemps = 10; - - if (!info.IsReadOnly()) - { - PerformMove(tmpFileName, fullPath, k_maxAttemps); - } - else if (m_onReadOnlyFile && m_onReadOnlyFile()) - { - AZ::IO::SystemFile::SetWritable(info.m_filePath.c_str(), true); - PerformMove(tmpFileName, fullPath, k_maxAttemps); - } - else - { - FileSaveResult result; - result.fileSaveError = "Source file is read-only"; - result.tempFileRemovalError = RemoveTempFile(tmpFileName); - m_onComplete(result); - } - }); - } - void FileSaver::OnSourceFileReleased(const SourceHandle& source) { - AZStd::string fullPath = source.Path(); + AZStd::string fullPath = source.Path().c_str(); AZStd::string tmpFileName; // here we are saving the graph to a temp file instead of the original file and then copying the temp file to the original file. // This ensures that AP will not a get a file change notification on an incomplete graph file causing it to fail processing. @@ -285,7 +220,7 @@ namespace ScriptCanvasEditor else { auto streamer = AZ::Interface::Get(); - AZ::IO::FileRequestPtr flushRequest = streamer->FlushCache(source.Path()); + AZ::IO::FileRequestPtr flushRequest = streamer->FlushCache(source.Path().c_str()); streamer->SetRequestCompleteCallback(flushRequest, [this, source]([[maybe_unused]] AZ::IO::FileRequestHandle request) { this->OnSourceFileReleased(source); @@ -293,34 +228,5 @@ namespace ScriptCanvasEditor streamer->QueueRequest(flushRequest); } } - - void FileSaver::Save(AZ::Data::Asset asset) - { - // #sc_editor_asset fix/remove this path that is used by the version explorer - AZStd::string relativePath, fullPath; - AZ::Data::AssetCatalogRequestBus::BroadcastResult(relativePath, &AZ::Data::AssetCatalogRequests::GetAssetPathById, asset.GetId()); - bool fullPathFound = false; - AzToolsFramework::AssetSystemRequestBus::BroadcastResult - ( fullPathFound - , &AzToolsFramework::AssetSystemRequestBus::Events::GetFullSourcePathFromRelativeProductPath - , relativePath, fullPath); - - if (!fullPathFound) - { - FileSaveResult result; - result.fileSaveError = "Full source path not found"; - m_onComplete(result); - } - else - { - auto streamer = AZ::Interface::Get(); - AZ::IO::FileRequestPtr flushRequest = streamer->FlushCache(fullPath); - streamer->SetRequestCompleteCallback(flushRequest, [this, asset]([[maybe_unused]] AZ::IO::FileRequestHandle request) - { - this->OnSourceFileReleased(asset); - }); - streamer->QueueRequest(flushRequest); - } - } } } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.h index 439db2d260..d04b543b0c 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.h @@ -30,7 +30,6 @@ namespace ScriptCanvasEditor , AZStd::function onComplete); const SourceHandle& GetSource() const; - void Save(AZ::Data::Asset asset); void Save(const SourceHandle& source); private: @@ -39,8 +38,7 @@ namespace ScriptCanvasEditor AZStd::function m_onReadOnlyFile; void OnSourceFileReleased(const SourceHandle& source); - void OnSourceFileReleased(AZ::Data::Asset asset); - + void PerformMove ( AZStd::string source , AZStd::string target diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Model.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Model.cpp index d8d242adbb..86a1c1f42e 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Model.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Model.cpp @@ -101,7 +101,7 @@ namespace ScriptCanvasEditor return; } - if (modification.modifySingleAsset.m_assetId.IsValid()) + if (!modification.modifySingleAsset.Path().empty()) { const auto& results = m_scanner->GetResult(); auto iter = AZStd::find_if @@ -109,7 +109,7 @@ namespace ScriptCanvasEditor , results.m_unfiltered.end() , [&modification](const auto& candidate) { - return candidate.info.m_assetId == modification.modifySingleAsset.m_assetId; + return candidate.AnyEquals(modification.modifySingleAsset); }); if (iter == results.m_unfiltered.end()) @@ -120,7 +120,7 @@ namespace ScriptCanvasEditor m_state = State::ModifySingle; - m_modifier = AZStd::make_unique(modification, WorkingAssets{ *iter }, [this]() { OnModificationComplete(); }); + m_modifier = AZStd::make_unique(modification, AZStd::vector{ *iter }, [this]() { OnModificationComplete(); }); } else { diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/ModelTraits.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/ModelTraits.h index 01eb200542..4ab9015a6c 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/ModelTraits.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/ModelTraits.h @@ -9,53 +9,51 @@ #include #include +#include namespace ScriptCanvasEditor { namespace VersionExplorer { - struct WorkingAsset - { - AZ::Data::Asset asset; - AZ::Data::AssetInfo info; - }; - - using WorkingAssets = AZStd::vector; - struct ModifyConfiguration { - AZStd::function)> modification; + AZStd::function modification; AZStd::function onReadOnlyFile; - AZ::Data::AssetInfo modifySingleAsset; + SourceHandle modifySingleAsset; bool backupGraphBeforeModification = false; bool successfulDependencyUpgradeRequired = true; }; struct ModificationResult { - AZ::Data::Asset asset; - AZ::Data::AssetInfo assetInfo; + SourceHandle asset; AZStd::string errorMessage; }; struct ModificationResults { - AZStd::vector m_successes; + AZStd::vector m_successes; AZStd::vector m_failures; }; struct ScanConfiguration { - AZStd::function)> filter; + enum class Filter + { + Include, + Exclude + }; + + AZStd::function filter; bool reportFilteredGraphs = false; }; struct ScanResult { - AZStd::vector m_catalogAssets; - WorkingAssets m_unfiltered; - AZStd::vector m_filteredAssets; - AZStd::vector m_loadErrors; + AZStd::vector m_catalogAssets; + AZStd::vector m_unfiltered; + AZStd::vector m_filteredAssets; + AZStd::vector m_loadErrors; }; enum Result @@ -88,20 +86,20 @@ namespace ScriptCanvasEditor public: virtual void OnScanBegin(size_t assetCount) = 0; virtual void OnScanComplete(const ScanResult& result) = 0; - virtual void OnScanFilteredGraph(const AZ::Data::AssetInfo& info) = 0; - virtual void OnScanLoadFailure(const AZ::Data::AssetInfo& info) = 0; - virtual void OnScanUnFilteredGraph(const AZ::Data::AssetInfo& info) = 0; + virtual void OnScanFilteredGraph(const SourceHandle& info) = 0; + virtual void OnScanLoadFailure(const SourceHandle& info) = 0; + virtual void OnScanUnFilteredGraph(const SourceHandle& info) = 0; - virtual void OnUpgradeBegin(const ModifyConfiguration& config, const WorkingAssets& assets) = 0; + virtual void OnUpgradeBegin(const ModifyConfiguration& config, const AZStd::vector& assets) = 0; virtual void OnUpgradeComplete(const ModificationResults& results) = 0; - virtual void OnUpgradeDependenciesGathered(const AZ::Data::AssetInfo& info, Result result) = 0; - virtual void OnUpgradeDependencySortBegin(const ModifyConfiguration& config, const WorkingAssets& assets) = 0; + virtual void OnUpgradeDependenciesGathered(const SourceHandle& info, Result result) = 0; + virtual void OnUpgradeDependencySortBegin(const ModifyConfiguration& config, const AZStd::vector& assets) = 0; virtual void OnUpgradeDependencySortEnd ( const ModifyConfiguration& config - , const WorkingAssets& assets + , const AZStd::vector& assets , const AZStd::vector& sortedOrder) = 0; - virtual void OnUpgradeModificationBegin(const ModifyConfiguration& config, const AZ::Data::AssetInfo& info) = 0; - virtual void OnUpgradeModificationEnd(const ModifyConfiguration& config, const AZ::Data::AssetInfo& info, ModificationResult result) = 0; + virtual void OnUpgradeModificationBegin(const ModifyConfiguration& config, const SourceHandle& info) = 0; + virtual void OnUpgradeModificationEnd(const ModifyConfiguration& config, const SourceHandle& info, ModificationResult result) = 0; }; using ModelNotificationsBus = AZ::EBus; } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp index 0e4190b18d..56d7264859 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp @@ -6,24 +6,21 @@ * */ +#include #include #include #include #include +#include #include -namespace ModifierCpp -{ - -} - namespace ScriptCanvasEditor { namespace VersionExplorer { Modifier::Modifier ( const ModifyConfiguration& modification - , WorkingAssets&& assets + , AZStd::vector&& assets , AZStd::function onComplete) : m_state(State::GatheringDependencies) , m_config(modification) @@ -35,11 +32,11 @@ namespace ScriptCanvasEditor AZ::SystemTickBus::Handler::BusConnect(); } - const AZ::Data::AssetInfo& Modifier::GetCurrentAsset() const + const SourceHandle& Modifier::GetCurrentAsset() const { return m_state == State::GatheringDependencies - ? m_assets[m_assetIndex].info - : m_assets[m_dependencyOrderedAssetIndicies[m_assetIndex]].info; + ? m_assets[m_assetIndex] + : m_assets[m_dependencyOrderedAssetIndicies[m_assetIndex]]; } AZStd::unordered_set& Modifier::GetOrCreateDependencyIndexSet() @@ -66,13 +63,9 @@ namespace ScriptCanvasEditor bool anyFailures = false; auto asset = LoadAsset(); - - if (asset - && asset.GetAs() - && asset.GetAs()->GetScriptCanvasGraph() - && asset.GetAs()->GetScriptCanvasGraph()->GetGraphData()) + if (asset.Get() && asset.Mod()->GetGraphData()) { - auto graphData = asset.GetAs()->GetScriptCanvasGraph()->GetGraphData(); + auto graphData = asset.Mod()->GetGraphData(); auto dependencyGrabber = [this] ( void* instancePointer @@ -107,15 +100,15 @@ namespace ScriptCanvasEditor , nullptr)) { anyFailures = true; - VE_LOG("Modifier: ERROR - Failed to gather dependencies from graph data: %s" - , GetCurrentAsset().m_relativePath.c_str()) + VE_LOG("Modifier: ERROR - Failed to gather dependencies from graph data: %s" + , GetCurrentAsset().Path().c_str()) } } else { anyFailures = true; VE_LOG("Modifier: ERROR - Failed to load asset %s for modification, even though it scanned properly" - , GetCurrentAsset().m_relativePath.c_str()); + , GetCurrentAsset().Path().c_str()); } ModelNotificationsBus::Broadcast @@ -127,18 +120,12 @@ namespace ScriptCanvasEditor AZ::Data::AssetManager::Instance().DispatchEvents(); } - AZ::Data::Asset Modifier::LoadAsset() + SourceHandle Modifier::LoadAsset() { - AZ::Data::Asset asset = AZ::Data::AssetManager::Instance().GetAsset - ( GetCurrentAsset().m_assetId - , azrtti_typeid() - , AZ::Data::AssetLoadBehavior::PreLoad); - - asset.BlockUntilLoadComplete(); - - if (asset.IsReady()) + auto outcome = LoadFromFile(GetCurrentAsset().Path().c_str()); + if (outcome.IsSuccess()) { - return asset; + return outcome.TakeValue(); } else { @@ -163,11 +150,11 @@ namespace ScriptCanvasEditor void Modifier::ModifyCurrentAsset() { m_result = {}; - m_result.assetInfo = GetCurrentAsset(); + m_result.asset = GetCurrentAsset(); ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnUpgradeModificationBegin, m_config, GetCurrentAsset()); - if (auto asset = LoadAsset()) + if (auto asset = LoadAsset(); asset.IsValid()) { ModificationNotificationsBus::Handler::BusConnect(); m_modifyState = ModifyState::InProgress; @@ -199,7 +186,7 @@ namespace ScriptCanvasEditor void Modifier::ReportModificationSuccess() { - m_results.m_successes.push_back(m_result.assetInfo); + m_results.m_successes.push_back(m_result.asset); ModifyNextAsset(); } @@ -227,7 +214,7 @@ namespace ScriptCanvasEditor { VE_LOG ( "Temporary file not removed for %s: %s" - , m_result.assetInfo.m_relativePath.c_str() + , m_result.asset.Path().c_str() , result.tempFileRemovalError.c_str()); } @@ -287,7 +274,7 @@ namespace ScriptCanvasEditor for (size_t index = 0; index != m_assets.size(); ++index) { - m_assetInfoIndexById.insert({ m_assets[index].info.m_assetId.m_guid, index }); + m_assetInfoIndexById.insert({ m_assets[index].Id(), index }); } } else @@ -380,10 +367,10 @@ namespace ScriptCanvasEditor if (markedTemporary.contains(index)) { AZ_Error - (ScriptCanvas::k_VersionExplorerWindow.data() + (ScriptCanvas::k_VersionExplorerWindow.data() , false , "Modifier: Dependency sort has failed during, circular dependency detected for Asset: %s" - , modifier->GetCurrentAsset().m_relativePath.c_str()); + , modifier->GetCurrentAsset().Path().c_str()); return; } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h index 981a1eb746..c57af605e3 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h @@ -26,7 +26,7 @@ namespace ScriptCanvasEditor Modifier ( const ModifyConfiguration& modification - , WorkingAssets&& assets + , AZStd::vector&& assets , AZStd::function onComplete); const ModificationResults& GetResult() const; @@ -69,7 +69,7 @@ namespace ScriptCanvasEditor size_t m_assetIndex = 0; AZStd::function m_onComplete; // asset infos in scanned order - WorkingAssets m_assets; + AZStd::vector m_assets; // dependency sorted order indices into the asset vector AZStd::vector m_dependencyOrderedAssetIndicies; // dependency indices by asset info index (only exist if graphs have them) @@ -83,9 +83,9 @@ namespace ScriptCanvasEditor FileSaveResult m_fileSaveResult; void GatherDependencies(); - const AZ::Data::AssetInfo& GetCurrentAsset() const; + const SourceHandle& GetCurrentAsset() const; AZStd::unordered_set& GetOrCreateDependencyIndexSet(); - AZ::Data::Asset LoadAsset(); + SourceHandle LoadAsset(); void ModifyCurrentAsset(); void ModifyNextAsset(); void ModificationComplete(const ModificationResult& result) override; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp index bc69f6e634..d959a6b6ab 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp @@ -6,9 +6,45 @@ * */ +#include +#include +#include +#include +#include #include #include -#include +#include + +namespace ScannerCpp +{ + void TraverseTree + ( QModelIndex index + , AzToolsFramework::AssetBrowser::AssetBrowserFilterModel& model + , ScriptCanvasEditor::VersionExplorer::ScanResult& result) + { + QModelIndex sourceIndex = model.mapToSource(index); + AzToolsFramework::AssetBrowser::AssetBrowserEntry* entry = + reinterpret_cast(sourceIndex.internalPointer()); + + if (entry + && entry->GetEntryType() == AzToolsFramework::AssetBrowser::AssetBrowserEntry::AssetEntryType::Source + && azrtti_istypeof(entry) + && entry->GetFullPath().ends_with(".scriptcanvas")) + { + auto sourceEntry = azrtti_cast(entry); + result.m_catalogAssets.push_back( + ScriptCanvasEditor::SourceHandle(nullptr, sourceEntry->GetSourceUuid(), sourceEntry->GetFullPath())); + } + + const int rowCount = model.rowCount(index); + + for (int i = 0; i < rowCount; ++i) + { + TraverseTree(model.index(i, 0, index), model, result); + } + } +} + namespace ScriptCanvasEditor { @@ -18,39 +54,44 @@ namespace ScriptCanvasEditor : m_config(config) , m_onComplete(onComplete) { - AZ::Data::AssetCatalogRequestBus::Broadcast - ( &AZ::Data::AssetCatalogRequestBus::Events::EnumerateAssets - , nullptr - , [this](const AZ::Data::AssetId, const AZ::Data::AssetInfo& assetInfo) - { - if (assetInfo.m_assetType == azrtti_typeid()) - { - m_result.m_catalogAssets.push_back(assetInfo); - } - } - , nullptr); - - ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnScanBegin, m_result.m_catalogAssets.size()); + AzToolsFramework::AssetBrowser::AssetBrowserModel* assetBrowserModel = nullptr; + AzToolsFramework::AssetBrowser::AssetBrowserComponentRequestBus::BroadcastResult + ( assetBrowserModel, &AzToolsFramework::AssetBrowser::AssetBrowserComponentRequests::GetAssetBrowserModel); + + if (assetBrowserModel) + { + auto stringFilter = new AzToolsFramework::AssetBrowser::StringFilter(); + stringFilter->SetName("ScriptCanvas"); + stringFilter->SetFilterString(".scriptcanvas"); + stringFilter->SetFilterPropagation(AzToolsFramework::AssetBrowser::AssetBrowserEntryFilter::PropagateDirection::Down); + + AzToolsFramework::AssetBrowser::AssetBrowserFilterModel assetFilterModel; + assetFilterModel.SetFilter(AzToolsFramework::AssetBrowser::FilterConstType(stringFilter)); + assetFilterModel.setSourceModel(assetBrowserModel); + + ScannerCpp::TraverseTree(QModelIndex(), assetFilterModel, m_result); + } + AZ::SystemTickBus::Handler::BusConnect(); } - void Scanner::FilterAsset(AZ::Data::Asset asset) + void Scanner::FilterAsset(SourceHandle asset) { - if (m_config.filter && m_config.filter(asset)) + if (m_config.filter && m_config.filter(asset) == ScanConfiguration::Filter::Exclude) { - VE_LOG("Scanner: Excluded: %s ", GetCurrentAsset().m_relativePath.c_str()); - m_result.m_filteredAssets.push_back(GetCurrentAsset()); + VE_LOG("Scanner: Excluded: %s ", GetCurrentAsset().Path().c_str()); + m_result.m_filteredAssets.push_back(GetCurrentAsset().Describe()); ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnScanFilteredGraph, GetCurrentAsset()); } else { - VE_LOG("Scanner: Included: %s ", GetCurrentAsset().m_relativePath.c_str()); - m_result.m_unfiltered.push_back({ asset, GetCurrentAsset() }); + VE_LOG("Scanner: Included: %s ", GetCurrentAsset().Path().c_str()); + m_result.m_unfiltered.push_back(GetCurrentAsset().Describe()); ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnScanUnFilteredGraph, GetCurrentAsset()); } } - const AZ::Data::AssetInfo& Scanner::GetCurrentAsset() const + const SourceHandle& Scanner::GetCurrentAsset() const { return m_result.m_catalogAssets[m_catalogAssetIndex]; } @@ -60,18 +101,12 @@ namespace ScriptCanvasEditor return m_result; } - AZ::Data::Asset Scanner::LoadAsset() + SourceHandle Scanner::LoadAsset() { - AZ::Data::Asset asset = AZ::Data::AssetManager::Instance().GetAsset - ( GetCurrentAsset().m_assetId - , azrtti_typeid() - , AZ::Data::AssetLoadBehavior::PreLoad); - - asset.BlockUntilLoadComplete(); - - if (asset.IsReady()) + auto fileOutcome = LoadFromFile(GetCurrentAsset().Path().c_str()); + if (fileOutcome.IsSuccess()) { - return asset; + return fileOutcome.GetValue(); } else { @@ -93,19 +128,19 @@ namespace ScriptCanvasEditor } else { - if (auto asset = LoadAsset()) + if (auto asset = LoadAsset(); asset.IsValid()) { - VE_LOG("Scanner: Loaded: %s ", GetCurrentAsset().m_relativePath.c_str()); + VE_LOG("Scanner: Loaded: %s ", GetCurrentAsset().Path().c_str()); FilterAsset(asset); } else { - VE_LOG("Scanner: Failed to load: %s ", GetCurrentAsset().m_relativePath.c_str()); + VE_LOG("Scanner: Failed to load: %s ", GetCurrentAsset().Path().c_str()); m_result.m_loadErrors.push_back(GetCurrentAsset()); ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnScanLoadFailure, GetCurrentAsset()); } - VE_LOG("Scanner: scan of %s complete", GetCurrentAsset().m_relativePath.c_str()); + VE_LOG("Scanner: scan of %s complete", GetCurrentAsset().Path().c_str()); ++m_catalogAssetIndex; } } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.h index fb030845c7..f276c146da 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.h @@ -33,9 +33,9 @@ namespace ScriptCanvasEditor ScanConfiguration m_config; ScanResult m_result; - void FilterAsset(AZ::Data::Asset); - const AZ::Data::AssetInfo& GetCurrentAsset() const; - AZ::Data::Asset LoadAsset(); + void FilterAsset(SourceHandle); + const SourceHandle& GetCurrentAsset() const; + SourceHandle LoadAsset(); void OnSystemTick() override; }; } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.cpp index e88675814b..3522f3cfa2 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.cpp @@ -55,26 +55,25 @@ namespace ScriptCanvasEditor for (auto& failedUpdate : result->m_failures) { - auto& assetInfo = failedUpdate.assetInfo; - auto assetId = assetInfo.m_assetId; - + auto asset = failedUpdate.asset; + m_ui->tableWidget->insertRow(rows); connect(m_ui->closeButton, &QPushButton::pressed, this, &QDialog::accept); - connect(m_ui->tableWidget, &QTableWidget::itemDoubleClicked, this, [this, rows, assetId](QTableWidgetItem* item) + connect(m_ui->tableWidget, &QTableWidget::itemDoubleClicked, this, [this, rows, asset](QTableWidgetItem* item) { if (item && item->data(Qt::UserRole).toInt() == rows) { - OpenGraph(assetId); + OpenGraph(asset); } } ); - auto openGraph = [this, assetId] { - OpenGraph(assetId); + auto openGraph = [this, asset] { + OpenGraph(asset); }; - QTableWidgetItem* rowName = new QTableWidgetItem(tr(assetInfo.m_relativePath.c_str())); + QTableWidgetItem* rowName = new QTableWidgetItem(tr(asset.Path().c_str())); rowName->setData(Qt::UserRole, rows); m_ui->tableWidget->setItem(rows, 0, rowName); @@ -91,16 +90,15 @@ namespace ScriptCanvasEditor } } - void UpgradeHelper::OpenGraph(AZ::Data::AssetId assetId) + void UpgradeHelper::OpenGraph(const SourceHandle& asset) { // Open the graph in SC editor AzToolsFramework::OpenViewPane(/*LyViewPane::ScriptCanvas*/"Script Canvas"); AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); - if (assetId.IsValid()) + if (!asset.Path().empty()) { - // #sc_editor_asset - // GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, assetId, -1); + GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, asset, -1); } if (!openOutcome) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.h index 36949c1828..4c0c073d70 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.h @@ -35,6 +35,8 @@ namespace Ui namespace ScriptCanvasEditor { + // class SourceHandle; + //! A tool that collects and upgrades all Script Canvas graphs in the asset catalog class UpgradeHelper : public AzQtComponents::StyledDialog @@ -51,6 +53,6 @@ namespace ScriptCanvasEditor AZStd::unique_ptr m_ui; - void OpenGraph(AZ::Data::AssetId assetId); + void OpenGraph(const SourceHandle& assetId); }; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp index 829a25f3d1..7bfa9fabd2 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp @@ -189,7 +189,7 @@ namespace ScriptCanvas namespace ScriptCanvasEditor { - SourceHandle::SourceHandle(const SourceHandle& data, const AZ::Uuid& id, AZStd::string_view path) + SourceHandle::SourceHandle(const SourceHandle& data, const AZ::Uuid& id, const AZ::IO::Path& path) : m_data(data.m_data) , m_id(id) , m_path(path) @@ -197,7 +197,7 @@ namespace ScriptCanvasEditor } - SourceHandle::SourceHandle(ScriptCanvas::DataPtr graph, const AZ::Uuid& id, AZStd::string_view path) + SourceHandle::SourceHandle(ScriptCanvas::DataPtr graph, const AZ::Uuid& id, const AZ::IO::Path& path) : m_data(graph) , m_id(id) , m_path(path) @@ -217,6 +217,12 @@ namespace ScriptCanvasEditor m_path.clear(); } + // return a SourceHandle with only the Id and Path, but without a pointer to the data + SourceHandle SourceHandle::Describe() const + { + return SourceHandle(nullptr, m_id, m_path); + } + GraphPtrConst SourceHandle::Get() const { return m_data ? m_data->GetEditorGraph() : nullptr; @@ -249,7 +255,7 @@ namespace ScriptCanvasEditor return !(*this == other); } - const AZStd::string& SourceHandle::Path() const + const AZ::IO::Path& SourceHandle::Path() const { return m_path; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h index 8d7dc40866..9e7ffc96f8 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h @@ -9,18 +9,19 @@ #pragma once #include +#include +#include +#include #include +#include #include #include -#include #include +#include #include #include #include #include -#include -#include -#include #include #include @@ -326,16 +327,17 @@ namespace ScriptCanvasEditor SourceHandle() = default; - SourceHandle(const SourceHandle& data, const AZ::Uuid& id, AZStd::string_view path); + SourceHandle(const SourceHandle& data, const AZ::Uuid& id, const AZ::IO::Path& path); - SourceHandle(ScriptCanvas::DataPtr graph, const AZ::Uuid& id, AZStd::string_view path); - - ~SourceHandle() = default; + SourceHandle(ScriptCanvas::DataPtr graph, const AZ::Uuid& id, const AZ::IO::Path& path); bool AnyEquals(const SourceHandle& other) const; void Clear(); + // return a SourceHandle with only the Id and Path, but without a pointer to the data + SourceHandle Describe() const; + GraphPtrConst Get() const; const AZ::Uuid& Id() const; @@ -348,7 +350,7 @@ namespace ScriptCanvasEditor bool operator!=(const SourceHandle& other) const; - const AZStd::string& Path() const; + const AZ::IO::Path& Path() const; bool PathEquals(const SourceHandle& other) const; @@ -357,7 +359,7 @@ namespace ScriptCanvasEditor private: ScriptCanvas::DataPtr m_data; AZ::Uuid m_id = AZ::Uuid::CreateNull(); - AZStd::string m_path; + AZ::IO::Path m_path; }; } From 4484b69036870601ac5ff270951a08e5b0d7747c Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Tue, 16 Nov 2021 09:12:36 -0800 Subject: [PATCH 058/948] isolate the loading problem during version explorer Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp | 2 +- .../Code/Builder/ScriptCanvasBuilderComponent.cpp | 2 +- .../Code/Editor/Assets/ScriptCanvasFileHandling.cpp | 5 +++++ .../Editor/View/Windows/Tools/UpgradeTool/Controller.cpp | 1 - 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp index 1c383d04bd..2a3da9f351 100644 --- a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp @@ -64,7 +64,7 @@ namespace ScriptCanvasEditor void EditorAssetSystemComponent::Activate() { - m_editorAssetRegistry.Register(); + // m_editorAssetRegistry.Register(); m_editorAssetRegistry.Register(); AzToolsFramework::AssetBrowser::AssetBrowserInteractionNotificationBus::Handler::BusConnect(); diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp index a37fa47b62..a08e006a19 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp @@ -48,7 +48,7 @@ namespace ScriptCanvasBuilder SharedHandlers HandleAssetTypes() { SharedHandlers handlers; - handlers.m_editorAssetHandler = RegisterHandler("scriptcanvas", false); + // handlers.m_editorAssetHandler = RegisterHandler("scriptcanvas", false); handlers.m_subgraphInterfaceHandler = RegisterHandler("scriptcanvas_fn_compiled", true); handlers.m_runtimeAssetHandler = RegisterHandler("scriptcanvas_compiled", true); diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp index cd8d21543f..ec225017fe 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp @@ -194,6 +194,11 @@ namespace ScriptCanvasEditor auto saveOutcome = JSRU::SaveObjectToStream(graphData, stream, nullptr, &settings); if (!saveOutcome.IsSuccess()) { + + Here is the allocation failure. + + AZStd::string result = saveOutcome.TakeError(); + return AZ::Failure(AZStd::string("JSON serialization failed to save source: %s", saveOutcome.GetError().c_str())); } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp index 5189895a56..035152a521 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp @@ -53,7 +53,6 @@ namespace ScriptCanvasEditor m_view->textEdit->setVerticalScrollBarPolicy(Qt::ScrollBarPolicy::ScrollBarAlwaysOn); connect(m_view->scanButton, &QPushButton::pressed, this, &Controller::OnButtonPressScan); connect(m_view->closeButton, &QPushButton::pressed, this, &Controller::OnButtonPressClose); - m_view->upgradeAllButton->setVisible(false); connect(m_view->upgradeAllButton, &QPushButton::pressed, this, &Controller::OnButtonPressUpgrade); m_view->progressBar->setValue(0); m_view->progressBar->setVisible(false); From f8fdf4b30646486c8332a727547c896ab9e17785 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Wed, 17 Nov 2021 12:17:45 -0800 Subject: [PATCH 059/948] fixed version explorer issue Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Editor/Assets/ScriptCanvasFileHandling.cpp | 10 +++------- .../Code/Editor/View/Windows/MainWindow.cpp | 2 +- .../View/Windows/Tools/UpgradeTool/Controller.cpp | 2 +- .../View/Windows/Tools/UpgradeTool/FileSaver.cpp | 10 ++++++++-- .../Editor/View/Windows/Tools/UpgradeTool/FileSaver.h | 3 +++ .../Code/Include/ScriptCanvas/Core/Core.cpp | 6 +++--- 6 files changed, 19 insertions(+), 14 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp index ec225017fe..68648a71f3 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp @@ -175,7 +175,7 @@ namespace ScriptCanvasEditor auto saveTarget = graphData->ModGraph(); if (!saveTarget || !saveTarget->GetGraphData()) { - return AZ::Failure(AZStd::string("source save container failed to return graph data")); + return AZ::Failure(AZStd::string("source save container failed to return serializable graph data")); } AZ::JsonSerializerSettings settings; @@ -194,12 +194,8 @@ namespace ScriptCanvasEditor auto saveOutcome = JSRU::SaveObjectToStream(graphData, stream, nullptr, &settings); if (!saveOutcome.IsSuccess()) { - - Here is the allocation failure. - - AZStd::string result = saveOutcome.TakeError(); - - return AZ::Failure(AZStd::string("JSON serialization failed to save source: %s", saveOutcome.GetError().c_str())); + AZStd::string result = saveOutcome.TakeError(); + return AZ::Failure(AZStd::string("JSON serialization failed to save source: %s", result.c_str())); } return AZ::Success(); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 6203423e29..a53100eea8 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -1409,7 +1409,7 @@ namespace ScriptCanvasEditor AZ::Outcome outcome = LoadFromFile(fullPath); if (!outcome.IsSuccess()) { - QMessageBox::warning(this, "Invalid Source File", QString("'%1' is not a valid file path.").arg(fullPath), QMessageBox::Ok); + QMessageBox::warning(this, "Invalid Source File", QString("'%1' failed to load properly.").arg(fullPath), QMessageBox::Ok); m_errorFilePath = fullPath; AZ_Warning("ScriptCanvas", false, "Unable to open file as a ScriptCanvas graph: %s", fullPath); return; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp index 035152a521..888f183151 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp @@ -165,7 +165,7 @@ namespace ScriptCanvasEditor { int result = QMessageBox::No; QMessageBox mb - (QMessageBox::Warning + ( QMessageBox::Warning , QObject::tr("Failed to Save Upgraded File") , QObject::tr("The upgraded file could not be saved because the file is read only.\n" "Do you want to make it writeable and overwrite it?") diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp index a88c6c2c7e..c23a3d915b 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp @@ -221,10 +221,16 @@ namespace ScriptCanvasEditor { auto streamer = AZ::Interface::Get(); AZ::IO::FileRequestPtr flushRequest = streamer->FlushCache(source.Path().c_str()); - streamer->SetRequestCompleteCallback(flushRequest, [this, source]([[maybe_unused]] AZ::IO::FileRequestHandle request) + streamer->SetRequestCompleteCallback(flushRequest, [this]([[maybe_unused]] AZ::IO::FileRequestHandle request) { - this->OnSourceFileReleased(source); + AZStd::lock_guard lock(m_mutex); + if (!m_sourceFileReleased) + { + m_sourceFileReleased = true; + AZ::SystemTickBus::QueueFunction([this]() { this->OnSourceFileReleased(m_source); }); + } }); + streamer->QueueRequest(flushRequest); } } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.h index d04b543b0c..e87ee060f7 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.h @@ -33,6 +33,9 @@ namespace ScriptCanvasEditor void Save(const SourceHandle& source); private: + AZStd::mutex m_mutex; + + bool m_sourceFileReleased = false; SourceHandle m_source; AZStd::function m_onComplete; AZStd::function m_onReadOnlyFile; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp index 7bfa9fabd2..de96c9953b 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp @@ -205,9 +205,9 @@ namespace ScriptCanvasEditor bool SourceHandle::AnyEquals(const SourceHandle& other) const { - return m_data == other.m_data - || m_id == other.m_id - || m_path == other.m_path; + return m_data && m_data == other.m_data + || !m_id.IsNull() && m_id == other.m_id + || !m_path.empty() && m_path == other.m_path; } void SourceHandle::Clear() From 4342501804ef705108dd267ec73c4c616183c7f5 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Wed, 17 Nov 2021 13:47:51 -0800 Subject: [PATCH 060/948] fixed unit test running system Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Asset/EditorAssetConversionBus.h | 7 ++----- .../Code/Asset/EditorAssetSystemComponent.cpp | 21 +++---------------- .../Code/Asset/EditorAssetSystemComponent.h | 5 ++--- .../Builder/ScriptCanvasBuilderWorker.cpp | 1 + .../Code/Builder/ScriptCanvasBuilderWorker.h | 5 +++-- .../ScriptCanvasBuilderWorkerUtility.cpp | 13 ++++++------ .../Framework/ScriptCanvasGraphUtilities.h | 1 + .../Framework/ScriptCanvasGraphUtilities.inl | 18 +++++++--------- .../Framework/ScriptCanvasTraceUtilities.h | 4 ++-- 9 files changed, 28 insertions(+), 47 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Asset/EditorAssetConversionBus.h b/Gems/ScriptCanvas/Code/Asset/EditorAssetConversionBus.h index 12313021f7..3b120af5da 100644 --- a/Gems/ScriptCanvas/Code/Asset/EditorAssetConversionBus.h +++ b/Gems/ScriptCanvas/Code/Asset/EditorAssetConversionBus.h @@ -26,17 +26,14 @@ namespace ScriptCanvas namespace ScriptCanvasEditor { - class ScriptCanvasAsset; - class EditorAssetConversionBusTraits : public AZ::EBusTraits { public: static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; - virtual AZ::Data::Asset LoadAsset(AZStd::string_view graphPath) = 0; - virtual AZ::Outcome CreateLuaAsset(const AZ::Data::Asset& editAsset, AZStd::string_view graphPathForRawLuaFile) = 0; - virtual AZ::Outcome, AZStd::string> CreateRuntimeAsset(const AZ::Data::Asset& editAsset) = 0; + virtual AZ::Outcome CreateLuaAsset(const SourceHandle& editAsset, AZStd::string_view graphPathForRawLuaFile) = 0; + virtual AZ::Outcome, AZStd::string> CreateRuntimeAsset(const SourceHandle& editAsset) = 0; }; using EditorAssetConversionBus = AZ::EBus; diff --git a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp index 2a3da9f351..3515eaf34f 100644 --- a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp @@ -64,7 +64,6 @@ namespace ScriptCanvasEditor void EditorAssetSystemComponent::Activate() { - // m_editorAssetRegistry.Register(); m_editorAssetRegistry.Register(); AzToolsFramework::AssetBrowser::AssetBrowserInteractionNotificationBus::Handler::BusConnect(); @@ -98,28 +97,14 @@ namespace ScriptCanvasEditor return false; } - AZ::Data::Asset EditorAssetSystemComponent::LoadAsset(AZStd::string_view graphPath) - { - auto outcome = ScriptCanvasBuilder::LoadEditorAsset(graphPath, AZ::Data::AssetId(AZ::Uuid::CreateRandom())); - - if (outcome.IsSuccess()) - { - return outcome.GetValue(); - } - else - { - return {}; - } - } - - AZ::Outcome, AZStd::string> EditorAssetSystemComponent::CreateRuntimeAsset(const AZ::Data::Asset& editAsset) + AZ::Outcome, AZStd::string> EditorAssetSystemComponent::CreateRuntimeAsset(const SourceHandle& editAsset) { return ScriptCanvasBuilder::CreateRuntimeAsset(editAsset); } - AZ::Outcome EditorAssetSystemComponent::CreateLuaAsset(const AZ::Data::Asset& editAsset, AZStd::string_view graphPathForRawLuaFile) + AZ::Outcome EditorAssetSystemComponent::CreateLuaAsset(const SourceHandle& editAsset, AZStd::string_view graphPathForRawLuaFile) { - return ScriptCanvasBuilder::CreateLuaAsset(editAsset->GetScriptCanvasEntity(), editAsset->GetId(), graphPathForRawLuaFile); + return ScriptCanvasBuilder::CreateLuaAsset(editAsset, graphPathForRawLuaFile); } void EditorAssetSystemComponent::AddSourceFileOpeners([[maybe_unused]] const char* fullSourceFileName, [[maybe_unused]] const AZ::Uuid& sourceUuid, [[maybe_unused]] AzToolsFramework::AssetBrowser::SourceFileOpenerList& openers) diff --git a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.h b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.h index 96e1280cbc..7937950a05 100644 --- a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.h +++ b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.h @@ -49,9 +49,8 @@ namespace ScriptCanvasEditor ////////////////////////////////////////////////////////////////////////// // EditorAssetConversionBus::Handler... - AZ::Data::Asset LoadAsset(AZStd::string_view graphPath) override; - AZ::Outcome, AZStd::string> CreateRuntimeAsset(const AZ::Data::Asset& editAsset) override; - AZ::Outcome CreateLuaAsset(const AZ::Data::Asset& editAsset, AZStd::string_view graphPathForRawLuaFile) override; + AZ::Outcome, AZStd::string> CreateRuntimeAsset(const SourceHandle& editAsset) override; + AZ::Outcome CreateLuaAsset(const SourceHandle& editAsset, AZStd::string_view graphPathForRawLuaFile) override; ////////////////////////////////////////////////////////////////////////// ScriptCanvas::AssetRegistry& GetAssetRegistry(); diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp index 7a7dbfff0b..f38654f565 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp @@ -29,6 +29,7 @@ #include #include #include +#include namespace ScriptCanvasBuilder { diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h index 84c9285362..816206ce33 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h @@ -37,6 +37,7 @@ namespace ScriptCanvasEditor { class Graph; class ScriptCanvasAsset; + class SourceHandle; } namespace ScriptCanvasBuilder @@ -125,13 +126,13 @@ namespace ScriptCanvasBuilder } }; - AZ::Outcome, AZStd::string> CreateRuntimeAsset(const AZ::Data::Asset& asset); + AZ::Outcome, AZStd::string> CreateRuntimeAsset(const ScriptCanvasEditor::SourceHandle& asset); AZ::Outcome CompileGraphData(AZ::Entity* scriptCanvasEntity); AZ::Outcome CompileVariableData(AZ::Entity* scriptCanvasEntity); - AZ::Outcome CreateLuaAsset(AZ::Entity* buildEntity, AZ::Data::AssetId scriptAssetId, AZStd::string_view rawLuaFilePath); + AZ::Outcome CreateLuaAsset(const ScriptCanvasEditor::SourceHandle& editAsset, AZStd::string_view rawLuaFilePath); int GetBuilderVersion(); diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp index 7d4cfec909..f337580cf3 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp @@ -29,6 +29,7 @@ #include #include #include +#include namespace ScriptCanvasBuilder { @@ -77,17 +78,17 @@ namespace ScriptCanvasBuilder return ScriptCanvas::Translation::ParseGraph(request); } - AZ::Outcome CreateLuaAsset(AZ::Entity* buildEntity, AZ::Data::AssetId scriptAssetId, AZStd::string_view rawLuaFilePath) + AZ::Outcome CreateLuaAsset(const ScriptCanvasEditor::SourceHandle& editAsset, AZStd::string_view rawLuaFilePath) { AZStd::string fullPath(rawLuaFilePath); AZStd::string fileNameOnly; AzFramework::StringFunc::Path::GetFullFileName(rawLuaFilePath.data(), fileNameOnly); AzFramework::StringFunc::Path::Normalize(fullPath); - auto sourceGraph = PrepareSourceGraph(buildEntity); + auto sourceGraph = PrepareSourceGraph(editAsset.Mod()->GetEntity()); ScriptCanvas::Grammar::Request request; - request.scriptAssetId = scriptAssetId; + request.scriptAssetId = editAsset.Id(); request.graph = sourceGraph; request.name = fileNameOnly; request.rawSaveDebugOutput = ScriptCanvas::Grammar::g_saveRawTranslationOuputToFile; @@ -117,7 +118,7 @@ namespace ScriptCanvasBuilder auto& translation = translationResult.m_translations.find(ScriptCanvas::Translation::TargetFlags::Lua)->second; AZ::Data::Asset asset; - scriptAssetId.m_subId = AZ::ScriptAsset::CompiledAssetSubId; + AZ::Data::AssetId scriptAssetId(editAsset.Id(), AZ::ScriptAsset::CompiledAssetSubId); asset.Create(scriptAssetId); auto writeStream = asset.Get()->CreateWriteStream(); @@ -144,12 +145,12 @@ namespace ScriptCanvasBuilder return AZ::Success(result); } - AZ::Outcome, AZStd::string> CreateRuntimeAsset(const AZ::Data::Asset& editAsset) + AZ::Outcome, AZStd::string> CreateRuntimeAsset(const ScriptCanvasEditor::SourceHandle& editAsset) { // Flush asset manager events to ensure no asset references are held by closures queued on Ebuses. AZ::Data::AssetManager::Instance().DispatchEvents(); - auto runtimeAssetId = editAsset.GetId(); + AZ::Data::AssetId runtimeAssetId = editAsset.Id(); runtimeAssetId.m_subId = AZ_CRC("RuntimeData", 0x163310ae); AZ::Data::Asset runtimeAsset; runtimeAsset.Create(runtimeAssetId); diff --git a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.h b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.h index 4d1be42d35..8593429b92 100644 --- a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.h +++ b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.h @@ -11,6 +11,7 @@ #include #include #include +#include namespace ScriptCanvas { diff --git a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl index 05541196f7..b1bc7321e6 100644 --- a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl +++ b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl @@ -75,7 +75,7 @@ namespace ScriptCanvasEditor 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); + ScriptCanvasEditor::EditorAssetConversionBus::BroadcastResult(luaAssetOutcome, &ScriptCanvasEditor::EditorAssetConversionBusTraits::CreateLuaAsset, loadResult.m_editorAsset, loadResult.m_editorAsset.Path().c_str()); AZ_Assert(luaAssetOutcome.IsSuccess(), "failed to create Lua asset"); AZStd::string modulePath = namespacePath[0].data(); @@ -112,18 +112,14 @@ namespace ScriptCanvasEditor AZ_INLINE LoadTestGraphResult LoadTestGraph(AZStd::string_view graphPath) { - AZ::Data::Asset editorAsset; - ScriptCanvasEditor::EditorAssetConversionBus::BroadcastResult(editorAsset, &ScriptCanvasEditor::EditorAssetConversionBusTraits::LoadAsset, graphPath); - - if (editorAsset.GetData()) + if (auto loadFileOutcome = LoadFromFile(graphPath); loadFileOutcome.IsSuccess()) { AZ::Outcome< AZ::Data::Asset, AZStd::string> assetOutcome = AZ::Failure(AZStd::string("asset creation failed")); - ScriptCanvasEditor::EditorAssetConversionBus::BroadcastResult(assetOutcome, &ScriptCanvasEditor::EditorAssetConversionBusTraits::CreateRuntimeAsset, editorAsset); + ScriptCanvasEditor::EditorAssetConversionBus::BroadcastResult(assetOutcome, &ScriptCanvasEditor::EditorAssetConversionBusTraits::CreateRuntimeAsset, loadFileOutcome.GetValue()); if (assetOutcome.IsSuccess()) { LoadTestGraphResult result; - result.m_graphPath = graphPath; - result.m_editorAsset = editorAsset; + result.m_editorAsset = loadFileOutcome.TakeValue(); result.m_runtimeAsset = assetOutcome.GetValue(); result.m_entity = AZStd::make_unique("Loaded Graph"); return result; @@ -164,8 +160,7 @@ namespace ScriptCanvasEditor reporter.SetExecutionMode(mode); LoadTestGraphResult loadResult; - loadResult.m_graphPath = asset.GetHint().c_str(); - loadResult.m_editorAsset = asset; + loadResult.m_editorAsset = SourceHandle(nullptr, assetId.m_guid, asset.GetHint()); AZ::EntityId scriptCanvasId; loadResult.m_entity = AZStd::make_unique("Loaded test graph"); loadResult.m_runtimeAsset = runtimeAsset; @@ -206,7 +201,8 @@ namespace ScriptCanvasEditor { ScopedOutputSuppression outputSuppressor; AZ::Outcome luaAssetOutcome = AZ::Failure(AZStd::string("lua asset creation failed")); - ScriptCanvasEditor::EditorAssetConversionBus::BroadcastResult(luaAssetOutcome, &ScriptCanvasEditor::EditorAssetConversionBusTraits::CreateLuaAsset, loadResult.m_editorAsset, loadResult.m_graphPath); + ScriptCanvasEditor::EditorAssetConversionBus::BroadcastResult(luaAssetOutcome + , &ScriptCanvasEditor::EditorAssetConversionBusTraits::CreateLuaAsset, loadResult.m_editorAsset, loadResult.m_editorAsset.Path().c_str()); reporter.MarkParseAttemptMade(); if (luaAssetOutcome.IsSuccess()) diff --git a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h index a87f4450c2..033eed3efd 100644 --- a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h +++ b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h @@ -27,6 +27,7 @@ #include #include #include +#include namespace AZ { @@ -45,11 +46,10 @@ namespace ScriptCanvasEditor struct LoadTestGraphResult { - AZStd::string_view m_graphPath; AZStd::unique_ptr m_entity; ScriptCanvas::RuntimeComponent* m_runtimeComponent = nullptr; bool m_nativeFunctionFound = false; - AZ::Data::Asset m_editorAsset; + SourceHandle m_editorAsset; AZ::Data::Asset m_runtimeAsset; AZ::Data::Asset m_scriptAsset; }; From 727d1b38155eca95a13ec6afb9cf40efbe6530e3 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Thu, 18 Nov 2021 10:41:46 -0800 Subject: [PATCH 061/948] more aggressively release graph memory in version explorer Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Builder/ScriptCanvasBuilderComponent.cpp | 1 - .../Builder/ScriptCanvasBuilderWorker.cpp | 44 ++------------- .../Code/Builder/ScriptCanvasBuilderWorker.h | 4 +- .../ScriptCanvasBuilderWorkerUtility.cpp | 4 +- .../Windows/Tools/UpgradeTool/Modifier.cpp | 55 +++++++++++-------- .../View/Windows/Tools/UpgradeTool/Modifier.h | 3 +- .../Windows/Tools/UpgradeTool/Scanner.cpp | 40 ++++++++------ .../View/Windows/Tools/UpgradeTool/Scanner.h | 2 +- .../Code/Include/ScriptCanvas/Core/Core.h | 2 +- .../Code/Include/ScriptCanvas/Core/Graph.cpp | 16 +++++- 10 files changed, 80 insertions(+), 91 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp index a08e006a19..019dd4f5e3 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp @@ -48,7 +48,6 @@ namespace ScriptCanvasBuilder SharedHandlers HandleAssetTypes() { SharedHandlers handlers; - // handlers.m_editorAssetHandler = RegisterHandler("scriptcanvas", false); handlers.m_subgraphInterfaceHandler = RegisterHandler("scriptcanvas_fn_compiled", true); handlers.m_runtimeAssetHandler = RegisterHandler("scriptcanvas_compiled", true); diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp index f38654f565..faad1871ac 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp @@ -35,7 +35,6 @@ namespace ScriptCanvasBuilder { void Worker::Activate(const AssetHandlers& handlers) { - m_editorAssetHandler = handlers.m_editorAssetHandler; m_runtimeAssetHandler = handlers.m_runtimeAssetHandler; m_subgraphInterfaceHandler = handlers.m_subgraphInterfaceHandler; } @@ -255,49 +254,14 @@ namespace ScriptCanvasBuilder return; } - if (!m_editorAssetHandler) - { - AZ_Error(s_scriptCanvasBuilder, false, R"(Exporting of .scriptcanvas for "%s" file failed as no editor asset handler was registered for script canvas. The ScriptCanvas Gem might not be enabled.)", fullPath.data()); - return; - } - if (!m_runtimeAssetHandler) { AZ_Error(s_scriptCanvasBuilder, false, R"(Exporting of .scriptcanvas for "%s" file failed as no runtime asset handler was registered for script canvas.)", fullPath.data()); return; } - AZStd::shared_ptr assetDataStream = AZStd::make_shared(); - - AZ::IO::FileIOStream stream(fullPath.c_str(), AZ::IO::OpenMode::ModeRead); - if (!AZ::IO::RetryOpenStream(stream)) - { - AZ_Warning(s_scriptCanvasBuilder, false, "CreateJobs for \"%s\" failed because the source file could not be opened.", fullPath.data()); - return; - } - - // Read the asset into a memory buffer, then hand ownership of the buffer to assetDataStream - { - AZ::IO::FileIOStream ioStream; - if (!ioStream.Open(fullPath.data(), AZ::IO::OpenMode::ModeRead)) - { - 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()) - { - AZ_Warning(s_scriptCanvasBuilder, false, AZStd::string::format("File failed to read completely: %s", fullPath.data()).c_str()); - return; - } - - assetDataStream->Open(AZStd::move(fileBuffer)); - } - - AZ::Data::Asset asset; - asset.Create(request.m_sourceFileUUID); - if (m_editorAssetHandler->LoadAssetDataFromStream(asset, assetDataStream, nullptr) != AZ::Data::AssetHandler::LoadResult::LoadComplete) + auto loadOutcome = ScriptCanvasEditor::LoadFromFile(request.m_fullPath); + if (!loadOutcome.IsSuccess()) { AZ_Error(s_scriptCanvasBuilder, false, R"(Loading of ScriptCanvas asset for source file "%s" has failed)", fullPath.data()); return; @@ -310,9 +274,11 @@ namespace ScriptCanvasBuilder AzFramework::StringFunc::Path::Join(request.m_tempDirPath.c_str(), fileNameOnly.c_str(), runtimeScriptCanvasOutputPath, true, true); AzFramework::StringFunc::Path::ReplaceExtension(runtimeScriptCanvasOutputPath, ScriptCanvas::RuntimeAsset::GetFileExtension()); + auto sourceHandle = loadOutcome.TakeValue(); + if (request.m_jobDescription.m_jobKey == s_scriptCanvasProcessJobKey) { - AZ::Entity* buildEntity = asset.Get()->GetScriptCanvasEntity(); + AZ::Entity* buildEntity = sourceHandle.Get()->GetEntity(); ProcessTranslationJobInput input; input.assetID = AZ::Data::AssetId(request.m_sourceFileUUID, AZ_CRC("RuntimeData", 0x163310ae)); input.request = &request; diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h index 816206ce33..e1bf80aa2e 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h @@ -62,6 +62,7 @@ namespace ScriptCanvasBuilder ForceBuildForDevTest0, ForceBuildForDevTest1, + ForceBuildForDevTest2, // add new entries above Current, @@ -73,7 +74,6 @@ namespace ScriptCanvasBuilder struct AssetHandlers { - AZ::Data::AssetHandler* m_editorAssetHandler = nullptr; AZ::Data::AssetHandler* m_editorFunctionAssetHandler = nullptr; AZ::Data::AssetHandler* m_runtimeAssetHandler = nullptr; AZ::Data::AssetHandler* m_subgraphInterfaceHandler = nullptr; @@ -84,7 +84,6 @@ namespace ScriptCanvasBuilder struct SharedHandlers { - HandlerOwnership m_editorAssetHandler{}; HandlerOwnership m_editorFunctionAssetHandler{}; HandlerOwnership m_runtimeAssetHandler{}; HandlerOwnership m_subgraphInterfaceHandler{}; @@ -173,7 +172,6 @@ namespace ScriptCanvasBuilder void ShutDown() override {}; private: - AZ::Data::AssetHandler* m_editorAssetHandler = nullptr; AZ::Data::AssetHandler* m_runtimeAssetHandler = nullptr; AZ::Data::AssetHandler* m_subgraphInterfaceHandler = nullptr; diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp index f337580cf3..a68aeae5e9 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp @@ -34,15 +34,13 @@ namespace ScriptCanvasBuilder { AssetHandlers::AssetHandlers(SharedHandlers& source) - : m_editorAssetHandler(source.m_editorAssetHandler.first) - , m_editorFunctionAssetHandler(source.m_editorFunctionAssetHandler.first) + : m_editorFunctionAssetHandler(source.m_editorFunctionAssetHandler.first) , m_runtimeAssetHandler(source.m_runtimeAssetHandler.first) , m_subgraphInterfaceHandler(source.m_subgraphInterfaceHandler.first) {} void SharedHandlers::DeleteOwnedHandlers() { - DeleteIfOwned(m_editorAssetHandler); DeleteIfOwned(m_editorFunctionAssetHandler); DeleteIfOwned(m_runtimeAssetHandler); DeleteIfOwned(m_subgraphInterfaceHandler); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp index 56d7264859..830d09c7dd 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp @@ -32,13 +32,6 @@ namespace ScriptCanvasEditor AZ::SystemTickBus::Handler::BusConnect(); } - const SourceHandle& Modifier::GetCurrentAsset() const - { - return m_state == State::GatheringDependencies - ? m_assets[m_assetIndex] - : m_assets[m_dependencyOrderedAssetIndicies[m_assetIndex]]; - } - AZStd::unordered_set& Modifier::GetOrCreateDependencyIndexSet() { auto iter = m_dependencies.find(m_assetIndex); @@ -101,36 +94,40 @@ namespace ScriptCanvasEditor { anyFailures = true; VE_LOG("Modifier: ERROR - Failed to gather dependencies from graph data: %s" - , GetCurrentAsset().Path().c_str()) + , ModCurrentAsset().Path().c_str()) } } else { anyFailures = true; VE_LOG("Modifier: ERROR - Failed to load asset %s for modification, even though it scanned properly" - , GetCurrentAsset().Path().c_str()); + , ModCurrentAsset().Path().c_str()); } ModelNotificationsBus::Broadcast ( &ModelNotificationsTraits::OnUpgradeDependenciesGathered - , GetCurrentAsset() + , ModCurrentAsset() , anyFailures ? Result::Failure : Result::Success); + ReleaseCurrentAsset(); + // Flush asset database events to ensure no asset references are held by closures queued on Ebuses. AZ::Data::AssetManager::Instance().DispatchEvents(); } SourceHandle Modifier::LoadAsset() { - auto outcome = LoadFromFile(GetCurrentAsset().Path().c_str()); - if (outcome.IsSuccess()) + auto& handle = ModCurrentAsset(); + if (!handle.IsValid()) { - return outcome.TakeValue(); - } - else - { - return {}; + auto outcome = LoadFromFile(handle.Path().c_str()); + if (outcome.IsSuccess()) + { + handle = outcome.TakeValue(); + } } + + return handle; } void Modifier::ModificationComplete(const ModificationResult& result) @@ -147,12 +144,19 @@ namespace ScriptCanvasEditor } } + SourceHandle& Modifier::ModCurrentAsset() + { + return m_state == State::GatheringDependencies + ? m_assets[m_assetIndex] + : m_assets[m_dependencyOrderedAssetIndicies[m_assetIndex]]; + } + void Modifier::ModifyCurrentAsset() { m_result = {}; - m_result.asset = GetCurrentAsset(); + m_result.asset = ModCurrentAsset(); - ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnUpgradeModificationBegin, m_config, GetCurrentAsset()); + ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnUpgradeModificationBegin, m_config, ModCurrentAsset()); if (auto asset = LoadAsset(); asset.IsValid()) { @@ -169,13 +173,19 @@ namespace ScriptCanvasEditor void Modifier::ModifyNextAsset() { ModelNotificationsBus::Broadcast - ( &ModelNotificationsTraits::OnUpgradeModificationEnd, m_config, GetCurrentAsset(), m_result); + ( &ModelNotificationsTraits::OnUpgradeModificationEnd, m_config, ModCurrentAsset(), m_result); ModificationNotificationsBus::Handler::BusDisconnect(); m_modifyState = ModifyState::Idle; + ReleaseCurrentAsset(); ++m_assetIndex; m_result = {}; } + void Modifier::ReleaseCurrentAsset() + { + ModCurrentAsset() = ModCurrentAsset().Describe(); + } + void Modifier::ReportModificationError(AZStd::string_view report) { m_result.asset = {}; @@ -286,7 +296,7 @@ namespace ScriptCanvasEditor m_dependencyOrderedAssetIndicies.push_back(index); } - // go straight into ModifyinGraphs + // go straight into ModifyingGraphs m_assetIndex = m_assets.size(); } } @@ -309,6 +319,7 @@ namespace ScriptCanvasEditor else { GatherDependencies(); + ReleaseCurrentAsset(); ++m_assetIndex; } } @@ -370,7 +381,7 @@ namespace ScriptCanvasEditor (ScriptCanvas::k_VersionExplorerWindow.data() , false , "Modifier: Dependency sort has failed during, circular dependency detected for Asset: %s" - , modifier->GetCurrentAsset().Path().c_str()); + , modifier->ModCurrentAsset().Path().c_str()); return; } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h index c57af605e3..78c9b3a877 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h @@ -83,12 +83,13 @@ namespace ScriptCanvasEditor FileSaveResult m_fileSaveResult; void GatherDependencies(); - const SourceHandle& GetCurrentAsset() const; AZStd::unordered_set& GetOrCreateDependencyIndexSet(); SourceHandle LoadAsset(); + SourceHandle& ModCurrentAsset(); void ModifyCurrentAsset(); void ModifyNextAsset(); void ModificationComplete(const ModificationResult& result) override; + void ReleaseCurrentAsset(); void ReportModificationError(AZStd::string_view report); void ReportModificationSuccess(); void ReportSaveResult(); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp index d959a6b6ab..f9fc6e497d 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp @@ -32,8 +32,12 @@ namespace ScannerCpp && entry->GetFullPath().ends_with(".scriptcanvas")) { auto sourceEntry = azrtti_cast(entry); + + AZStd::string fullPath = sourceEntry->GetFullPath(); + AzFramework::StringFunc::Path::Normalize(fullPath); + result.m_catalogAssets.push_back( - ScriptCanvasEditor::SourceHandle(nullptr, sourceEntry->GetSourceUuid(), sourceEntry->GetFullPath())); + ScriptCanvasEditor::SourceHandle(nullptr, sourceEntry->GetSourceUuid(), fullPath)); } const int rowCount = model.rowCount(index); @@ -79,23 +83,18 @@ namespace ScriptCanvasEditor { if (m_config.filter && m_config.filter(asset) == ScanConfiguration::Filter::Exclude) { - VE_LOG("Scanner: Excluded: %s ", GetCurrentAsset().Path().c_str()); - m_result.m_filteredAssets.push_back(GetCurrentAsset().Describe()); - ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnScanFilteredGraph, GetCurrentAsset()); + VE_LOG("Scanner: Excluded: %s ", ModCurrentAsset().Path().c_str()); + m_result.m_filteredAssets.push_back(ModCurrentAsset().Describe()); + ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnScanFilteredGraph, ModCurrentAsset()); } else { - VE_LOG("Scanner: Included: %s ", GetCurrentAsset().Path().c_str()); - m_result.m_unfiltered.push_back(GetCurrentAsset().Describe()); - ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnScanUnFilteredGraph, GetCurrentAsset()); + VE_LOG("Scanner: Included: %s ", ModCurrentAsset().Path().c_str()); + m_result.m_unfiltered.push_back(ModCurrentAsset().Describe()); + ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnScanUnFilteredGraph, ModCurrentAsset()); } } - const SourceHandle& Scanner::GetCurrentAsset() const - { - return m_result.m_catalogAssets[m_catalogAssetIndex]; - } - const ScanResult& Scanner::GetResult() const { return m_result; @@ -103,7 +102,7 @@ namespace ScriptCanvasEditor SourceHandle Scanner::LoadAsset() { - auto fileOutcome = LoadFromFile(GetCurrentAsset().Path().c_str()); + auto fileOutcome = LoadFromFile(ModCurrentAsset().Path().c_str()); if (fileOutcome.IsSuccess()) { return fileOutcome.GetValue(); @@ -114,6 +113,11 @@ namespace ScriptCanvasEditor } } + SourceHandle& Scanner::ModCurrentAsset() + { + return m_result.m_catalogAssets[m_catalogAssetIndex]; + } + void Scanner::OnSystemTick() { if (m_catalogAssetIndex == m_result.m_catalogAssets.size()) @@ -130,17 +134,17 @@ namespace ScriptCanvasEditor { if (auto asset = LoadAsset(); asset.IsValid()) { - VE_LOG("Scanner: Loaded: %s ", GetCurrentAsset().Path().c_str()); + VE_LOG("Scanner: Loaded: %s ", ModCurrentAsset().Path().c_str()); FilterAsset(asset); } else { - VE_LOG("Scanner: Failed to load: %s ", GetCurrentAsset().Path().c_str()); - m_result.m_loadErrors.push_back(GetCurrentAsset()); - ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnScanLoadFailure, GetCurrentAsset()); + VE_LOG("Scanner: Failed to load: %s ", ModCurrentAsset().Path().c_str()); + m_result.m_loadErrors.push_back(ModCurrentAsset().Describe()); + ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnScanLoadFailure, ModCurrentAsset()); } - VE_LOG("Scanner: scan of %s complete", GetCurrentAsset().Path().c_str()); + VE_LOG("Scanner: scan of %s complete", ModCurrentAsset().Path().c_str()); ++m_catalogAssetIndex; } } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.h index f276c146da..8e086a10b0 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.h @@ -34,8 +34,8 @@ namespace ScriptCanvasEditor ScanResult m_result; void FilterAsset(SourceHandle); - const SourceHandle& GetCurrentAsset() const; SourceHandle LoadAsset(); + SourceHandle& ModCurrentAsset(); void OnSystemTick() override; }; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h index 9e7ffc96f8..a57d2dc3a1 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h @@ -27,7 +27,7 @@ #define OBJECT_STREAM_EDITOR_ASSET_LOADING_SUPPORT_ENABLED -#define EDITOR_ASSET_SUPPORT_ENABLED +// #define EDITOR_ASSET_SUPPORT_ENABLED namespace AZ { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp index ee500514dc..3d802e4fbc 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp @@ -52,6 +52,7 @@ namespace GraphCpp VariablePanelSymantics, AddVersionData, RemoveFunctionGraphMarker, + FixupVersionDataTypeId, // label your version above Current }; @@ -71,13 +72,24 @@ namespace ScriptCanvas componentElementNode.AddElementWithData(context, "m_assetType", azrtti_typeid()); } - if (componentElementNode.GetVersion() < GraphCpp::GraphVersion::RemoveFunctionGraphMarker) + if (componentElementNode.GetVersion() <= GraphCpp::GraphVersion::RemoveFunctionGraphMarker) { componentElementNode.RemoveElementByName(AZ_CRC_CE("isFunctionGraph")); } + if (componentElementNode.GetVersion() < GraphCpp::GraphVersion::FixupVersionDataTypeId) + { + if (auto subElement = componentElementNode.FindSubElement(AZ_CRC_CE("versionData"))) + { + if (subElement->GetId() == azrtti_typeid()) + { + componentElementNode.RemoveElementByName(AZ_CRC_CE("versionData")); + } + } + } + return true; - } + }s Graph::Graph(const ScriptCanvasId& scriptCanvasId) : m_scriptCanvasId(scriptCanvasId) From b772db5e73487ed9ea691d9bc2259d811015c517 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Thu, 18 Nov 2021 13:31:00 -0800 Subject: [PATCH 062/948] remove typo Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp index 3d802e4fbc..aff212fa4c 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp @@ -89,7 +89,7 @@ namespace ScriptCanvas } return true; - }s + } Graph::Graph(const ScriptCanvasId& scriptCanvasId) : m_scriptCanvasId(scriptCanvasId) From ad8cfa5f99eb3673caf92d173fcc3af2b1c1b10d Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Fri, 19 Nov 2021 10:03:16 -0800 Subject: [PATCH 063/948] editor sc component switched over to source handle, not yet connected to file notifications Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../EditorScriptCanvasComponent.cpp | 249 +++++++----------- .../Code/Editor/Components/EditorUtils.cpp | 39 +++ .../ScriptCanvas/Bus/EditorScriptCanvasBus.h | 29 +- .../Components/EditorScriptCanvasComponent.h | 38 +-- .../ScriptCanvas/Components/EditorUtils.h | 2 + .../Code/Editor/ReflectComponent.cpp | 1 + .../Code/Editor/View/Windows/MainWindow.cpp | 14 +- .../Code/Include/ScriptCanvas/Core/Core.cpp | 33 ++- .../Code/Include/ScriptCanvas/Core/Core.h | 8 +- .../$tmp29198_Test_LY_79396.scriptcanvas | 69 +++++ 10 files changed, 271 insertions(+), 211 deletions(-) create mode 100644 Gems/ScriptCanvasTesting/Assets/ScriptCanvas/Tests/$tmp29198_Test_LY_79396.scriptcanvas diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index d73273103c..3b495f6822 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -26,18 +26,20 @@ #include #include #include +#include #include #include #include #include - +#include +#include namespace EditorScriptCanvasComponentCpp { enum Version { PrefabIntegration = 10, - + AddSourceHandle, // add description above Current }; @@ -142,6 +144,25 @@ namespace ScriptCanvasEditor } } + if (rootElement.GetVersion() < EditorScriptCanvasComponentCpp::Version::AddSourceHandle) + { + ScriptCanvasAssetHolder assetHolder; + if (!rootElement.FindSubElementAndGetData(AZ_CRC_CE("m_assetHolder"), assetHolder)) + { + AZ_Error("ScriptCanvas", false, "EditorScriptCanvasComponent conversion failed: could not retrieve old 'm_assetHolder'"); + return false; + } + + auto assetId = assetHolder.GetAssetId(); + auto path = assetHolder.GetAssetHint(); + + if (!rootElement.AddElementWithData(serializeContext, "runtimeDataOverrides", SourceHandle(nullptr, assetId.m_guid, path))) + { + AZ_Error("ScriptCanvas", false, "EditorScriptCanvasComponent conversion failed: failed to add 'sourceHandle'"); + return false; + } + } + return true; } @@ -153,9 +174,9 @@ namespace ScriptCanvasEditor serializeContext->Class() ->Version(EditorScriptCanvasComponentCpp::Version::Current, &EditorScriptCanvasComponentVersionConverter) ->Field("m_name", &EditorScriptCanvasComponent::m_name) - ->Field("m_assetHolder", &EditorScriptCanvasComponent::m_scriptCanvasAssetHolder) ->Field("runtimeDataIsValid", &EditorScriptCanvasComponent::m_runtimeDataIsValid) ->Field("runtimeDataOverrides", &EditorScriptCanvasComponent::m_variableOverrides) + ->Field("sourceHandle", &EditorScriptCanvasComponent::m_sourceHandle) ; if (AZ::EditContext* editContext = serializeContext->GetEditContext()) @@ -171,7 +192,7 @@ namespace ScriptCanvasEditor ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("UI", 0x27ff46b0)) ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("Level", 0x9aeacc13)) ->Attribute(AZ::Edit::Attributes::HelpPageURL, "https://o3de.org/docs/user-guide/components/reference/scripting/script-canvas/") - ->DataElement(AZ::Edit::UIHandlers::Default, &EditorScriptCanvasComponent::m_scriptCanvasAssetHolder, "Script Canvas Asset", "Script Canvas asset associated with this component") + ->DataElement(AZ::Edit::UIHandlers::Default, &EditorScriptCanvasComponent::m_sourceHandle, "Script Canvas Source File", "Script Canvas source file associated with this component") ->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) @@ -181,19 +202,13 @@ namespace ScriptCanvasEditor } EditorScriptCanvasComponent::EditorScriptCanvasComponent() - : EditorScriptCanvasComponent(AZ::Data::Asset()) + : EditorScriptCanvasComponent(SourceHandle()) { } - EditorScriptCanvasComponent::EditorScriptCanvasComponent(AZ::Data::Asset asset) - : m_scriptCanvasAssetHolder() + EditorScriptCanvasComponent::EditorScriptCanvasComponent(const SourceHandle& sourceHandle) + : m_sourceHandle(sourceHandle) { - if (asset.GetId().IsValid()) - { - m_scriptCanvasAssetHolder.SetAsset(asset.GetId()); - } - - m_scriptCanvasAssetHolder.SetScriptChangedCB([this](AZ::Data::AssetId assetId) { OnScriptCanvasAssetChanged(assetId); }); } EditorScriptCanvasComponent::~EditorScriptCanvasComponent() @@ -209,42 +224,35 @@ namespace ScriptCanvasEditor void EditorScriptCanvasComponent::UpdateName() { - AZ::Data::AssetId assetId = m_scriptCanvasAssetHolder.GetAssetId(); - if (assetId.IsValid()) - { - // Pathname from the asset doesn't seem to return a value unless the asset has been loaded up once(which isn't done until we try to show it). - // Using the Job system to determine the asset name instead. - AZ::Outcome jobOutcome = AZ::Failure(); - AzToolsFramework::AssetSystemJobRequestBus::BroadcastResult(jobOutcome, &AzToolsFramework::AssetSystemJobRequestBus::Events::GetAssetJobsInfoByAssetID, assetId, false, false); - - AZStd::string assetPath; - AZStd::string assetName; - - if (jobOutcome.IsSuccess()) - { - AzToolsFramework::AssetSystem::JobInfoContainer& jobs = jobOutcome.GetValue(); - - // Get the asset relative path - if (!jobs.empty()) - { - assetPath = jobs[0].m_sourceFile; - } - - // Get the asset file name - assetName = assetPath; - - if (!assetPath.empty()) - { - AzFramework::StringFunc::Path::GetFileName(assetPath.c_str(), assetName); - SetName(assetName); - } - } - } + SetName(m_sourceHandle.Path().Filename().Native()); } void EditorScriptCanvasComponent::OpenEditor() { - m_scriptCanvasAssetHolder.OpenEditor(); + AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); + + AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); + + if (m_sourceHandle.IsValid()) + { + GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, m_sourceHandle, -1); + + if (!openOutcome) + { + AZ_Warning("Script Canvas", openOutcome, "%s", openOutcome.GetError().data()); + } + } + else if (GetEntityId().IsValid()) + { + AzToolsFramework::EntityIdList selectedEntityIds; + AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult(selectedEntityIds, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities); + + // Going to bypass the multiple selected entities flow for right now. + if (selectedEntityIds.size() == 1) + { + GeneralRequestBus::Broadcast(&GeneralRequests::CreateScriptCanvasAssetFor, AZStd::make_pair(GetEntityId(), GetId())); + } + } } void EditorScriptCanvasComponent::Init() @@ -260,6 +268,8 @@ namespace ScriptCanvasEditor { EditorComponentBase::Activate(); + AzToolsFramework::AssetSystemBus::Handler::BusConnect(); + AZ::EntityId entityId = GetEntityId(); EditorContextMenuRequestBus::Handler::BusConnect(entityId); @@ -268,19 +278,13 @@ namespace ScriptCanvasEditor EditorScriptCanvasComponentLoggingBus::Handler::BusConnect(entityId); EditorLoggingComponentNotificationBus::Broadcast(&EditorLoggingComponentNotifications::OnEditorScriptCanvasComponentActivated, GetNamedEntityId(), GetGraphIdentifier()); - AZ::Data::AssetId fileAssetId = m_scriptCanvasAssetHolder.GetAssetId(); - - if (fileAssetId.IsValid()) - { - AssetTrackerNotificationBus::Handler::BusConnect(fileAssetId); - AzToolsFramework::ToolsApplicationNotificationBus::Broadcast(&AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay, AzToolsFramework::Refresh_EntireTree_NewContent); - } + AzToolsFramework::ToolsApplicationNotificationBus::Broadcast(&AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay, AzToolsFramework::Refresh_EntireTree_NewContent); } //========================================================================= void EditorScriptCanvasComponent::Deactivate() { - AssetTrackerNotificationBus::Handler::BusDisconnect(); + AzToolsFramework::AssetSystemBus::Handler::BusDisconnect(); EditorScriptCanvasComponentLoggingBus::Handler::BusDisconnect(); EditorLoggingComponentNotificationBus::Broadcast(&EditorLoggingComponentNotifications::OnEditorScriptCanvasComponentDeactivated, GetNamedEntityId(), GetGraphIdentifier()); @@ -297,7 +301,7 @@ namespace ScriptCanvasEditor m_runtimeDataIsValid = false; - auto assetTreeOutcome = LoadEditorAssetTree(m_scriptCanvasAssetHolder.GetAssetId(), m_scriptCanvasAssetHolder.GetAssetHint()); + auto assetTreeOutcome = LoadEditorAssetTree(m_sourceHandle.Id(), m_sourceHandle.Path().c_str()); if (!assetTreeOutcome.IsSuccess()) { AZ_Warning("ScriptCanvas", false, "EditorScriptCanvasComponent::BuildGameEntityData failed: %s", assetTreeOutcome.GetError().c_str()); @@ -335,7 +339,8 @@ namespace ScriptCanvasEditor if (!m_runtimeDataIsValid) { - AZ_Error("ScriptCanvasBuilder", false, "Runtime information did not build for ScriptCanvas Component using asset: %s", m_scriptCanvasAssetHolder.GetAssetId().ToString().c_str()); + AZ_Error("ScriptCanvasBuilder", false, "Runtime information did not build for ScriptCanvas Component using asset: %s" + , m_sourceHandle.ToString().c_str()); return; } @@ -343,123 +348,53 @@ namespace ScriptCanvasEditor runtimeComponent->TakeRuntimeDataOverrides(ConvertToRuntime(m_variableOverrides)); } - void EditorScriptCanvasComponent::OnCatalogAssetAdded(const AZ::Data::AssetId& assetId) - { - if (m_removedCatalogId == assetId) - { - if (!m_scriptCanvasAssetHolder.GetAssetId().IsValid()) - { - SetPrimaryAsset(assetId); - m_removedCatalogId.SetInvalid(); - } - } - } - void EditorScriptCanvasComponent::OnCatalogAssetRemoved(const AZ::Data::AssetId& removedAssetId, const AZ::Data::AssetInfo& /*assetInfo*/) - { - AZ::Data::AssetId assetId = m_scriptCanvasAssetHolder.GetAssetId(); - if (assetId == removedAssetId) - { - m_removedCatalogId = assetId; - SetPrimaryAsset({}); - } - } - void EditorScriptCanvasComponent::SetPrimaryAsset(const AZ::Data::AssetId& assetId) { - m_scriptCanvasAssetHolder.ClearAsset(); + m_sourceHandle = SourceHandle(nullptr, assetId.m_guid, {}); - if (assetId.IsValid()) + auto completeAsset = CompleteDescription(m_sourceHandle); + if (completeAsset) { - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); - - if (memoryAsset) - { - m_scriptCanvasAssetHolder.SetAsset(memoryAsset->GetFileAssetId()); - OnScriptCanvasAssetChanged(memoryAsset->GetFileAssetId()); - SetName(memoryAsset->GetTabName()); - } - else - { - auto scriptCanvasAsset = AZ::Data::AssetManager::Instance().FindAsset(assetId, AZ::Data::AssetLoadBehavior::Default); - if (scriptCanvasAsset) - { - m_scriptCanvasAssetHolder.SetAsset(assetId); - } - } + m_sourceHandle = *completeAsset; } + OnScriptCanvasAssetChanged(m_sourceHandle); + SetName(m_sourceHandle.Path().Filename().Native()); AzToolsFramework::ToolsApplicationEvents::Bus::Broadcast(&AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay, AzToolsFramework::Refresh_AttributesAndValues); } AZ::Data::AssetId EditorScriptCanvasComponent::GetAssetId() const { - return m_scriptCanvasAssetHolder.GetAssetId(); + return m_sourceHandle.Id(); } - AZ::EntityId EditorScriptCanvasComponent::GetGraphEntityId() const + void EditorScriptCanvasComponent::OnScriptCanvasAssetChanged(const SourceHandle& assetId) { - AZ::EntityId scriptCanvasEntityId; - AZ::Data::AssetId assetId = m_scriptCanvasAssetHolder.GetAssetId(); - - if (assetId.IsValid()) - { - AssetTrackerRequestBus::BroadcastResult(scriptCanvasEntityId, &AssetTrackerRequests::GetScriptCanvasId, assetId); - } - - return scriptCanvasEntityId; - } - - void EditorScriptCanvasComponent::OnAssetReady(const ScriptCanvasMemoryAsset::pointer asset) - { - OnScriptCanvasAssetReady(asset); - } - - void EditorScriptCanvasComponent::OnAssetSaved(const ScriptCanvasMemoryAsset::pointer asset, bool isSuccessful) - { - if (isSuccessful) - { - OnScriptCanvasAssetReady(asset); - } - } - - void EditorScriptCanvasComponent::OnAssetReloaded(const ScriptCanvasMemoryAsset::pointer asset) - { - OnScriptCanvasAssetReady(asset); - } - - void EditorScriptCanvasComponent::OnScriptCanvasAssetChanged(AZ::Data::AssetId assetId) - { - AssetTrackerNotificationBus::Handler::BusDisconnect(); ScriptCanvas::GraphIdentifier newIdentifier = GetGraphIdentifier(); - newIdentifier.m_assetId = assetId; + newIdentifier.m_assetId = assetId.Id(); ScriptCanvas::GraphIdentifier oldIdentifier = GetGraphIdentifier(); - oldIdentifier.m_assetId = m_previousAssetId; + oldIdentifier.m_assetId = m_previousHandle.Id(); EditorLoggingComponentNotificationBus::Broadcast(&EditorLoggingComponentNotifications::OnAssetSwitched, GetNamedEntityId(), newIdentifier, oldIdentifier); - m_previousAssetId = m_scriptCanvasAssetHolder.GetAssetId(); + m_previousHandle = m_sourceHandle.Describe(); // Only clear our variables when we are given a new asset id // or when the asset was explicitly set to empty. // // i.e. do not clear variables when we lose the catalog asset. - if ((assetId.IsValid() && assetId != m_removedCatalogId) - || (!assetId.IsValid() && !m_removedCatalogId.IsValid())) + if ((assetId.IsValidDescription() && assetId.Describe() != m_removedHandle.Describe()) + || (!assetId.IsValidDescription() && !m_removedHandle.IsValidDescription())) { ClearVariables(); } - if (assetId.IsValid()) + if (assetId.IsValidDescription()) { - AssetTrackerNotificationBus::Handler::BusConnect(assetId); - - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); - if (memoryAsset && memoryAsset->GetAsset().GetStatus() == AZ::Data::AssetData::AssetStatus::Ready) + if (auto loaded = LoadFromFile(assetId.Path().c_str()); loaded.IsSuccess()) { - OnScriptCanvasAssetReady(memoryAsset); + OnScriptCanvasAssetReady(loaded.GetValue()); } } @@ -476,39 +411,49 @@ namespace ScriptCanvasEditor AZ::ScriptSystemRequestBus::Broadcast(&AZ::ScriptSystemRequests::GarbageCollect); } - void EditorScriptCanvasComponent::SetAssetId(const AZ::Data::AssetId& assetId) + void EditorScriptCanvasComponent::SetAssetId(const SourceHandle& assetId) { - if (m_scriptCanvasAssetHolder.GetAssetId() != assetId) + if (m_sourceHandle.Describe() != assetId.Describe()) { // Invalidate the previously removed catalog id if we are setting a new asset id - m_removedCatalogId.SetInvalid(); - SetPrimaryAsset(assetId); + m_removedHandle = {}; + SetPrimaryAsset(assetId.Id()); } } + void EditorScriptCanvasComponent::SourceFileChanged(AZStd::string /*relativePath*/, AZStd::string /*scanFolder*/, AZ::Uuid /*fileAssetId*/) + {} + + void EditorScriptCanvasComponent::SourceFileRemoved(AZStd::string /*relativePath*/, AZStd::string /*scanFolder*/, AZ::Uuid /*fileAssetId*/) + {} + + void EditorScriptCanvasComponent::SourceFileFailed(AZStd::string /*relativePath*/, AZStd::string /*scanFolder*/, AZ::Uuid /*fileAssetId*/) + {} + bool EditorScriptCanvasComponent::HasAssetId() const { - return m_scriptCanvasAssetHolder.GetAssetId().IsValid(); + return !m_sourceHandle.Id().IsNull(); } ScriptCanvas::GraphIdentifier EditorScriptCanvasComponent::GetGraphIdentifier() const { // For now we don't want to deal with disambiguating duplicates of the same script running on one entity. // Should that change we need to add the component id back into this. - return ScriptCanvas::GraphIdentifier(m_scriptCanvasAssetHolder.GetAssetId(), 0); + return ScriptCanvas::GraphIdentifier(m_sourceHandle.Id(), 0); } - void EditorScriptCanvasComponent::OnScriptCanvasAssetReady(const ScriptCanvasMemoryAsset::pointer memoryAsset) + void EditorScriptCanvasComponent::OnScriptCanvasAssetReady(const SourceHandle& sourceHandle) { - if (memoryAsset->GetFileAssetId() == m_scriptCanvasAssetHolder.GetAssetId()) + if (sourceHandle.IsValid()) { - auto assetData = memoryAsset->GetAsset(); - [[maybe_unused]] AZ::Entity* scriptCanvasEntity = assetData->GetScriptCanvasEntity(); - AZ_Assert(scriptCanvasEntity, "This graph must have a valid entity"); BuildGameEntityData(); UpdateName(); AzToolsFramework::ToolsApplicationNotificationBus::Broadcast(&AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay, AzToolsFramework::Refresh_EntireTree_NewContent); } + else + { + // #sc_editor_asset clear or disable something + } } void EditorScriptCanvasComponent::ClearVariables() diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp index 650be01387..9b83acefa5 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp @@ -17,6 +17,7 @@ AZ_POP_DISABLE_WARNING #include #include #include +#include #include #include @@ -30,6 +31,44 @@ AZ_POP_DISABLE_WARNING namespace ScriptCanvasEditor { + AZStd::optional CompleteDescription(const SourceHandle& source) + { + if (source.IsValidDescription()) + { + return source.Describe(); + } + + AZStd::string watchFolder; + AZ::Data::AssetInfo assetInfo; + bool sourceInfoFound{}; + + if (!source.Id().IsNull()) + { + AzToolsFramework::AssetSystemRequestBus::BroadcastResult + ( sourceInfoFound + , &AzToolsFramework::AssetSystemRequestBus::Events::GetSourceInfoBySourceUUID, source.Id(), assetInfo, watchFolder); + + if (sourceInfoFound && !assetInfo.m_relativePath.empty()) + { + return SourceHandle(nullptr, assetInfo.m_assetId.m_guid, assetInfo.m_relativePath); + } + } + + if (!source.Path().empty()) + { + AzToolsFramework::AssetSystemRequestBus::BroadcastResult + ( sourceInfoFound + , &AzToolsFramework::AssetSystemRequestBus::Events::GetSourceInfoBySourcePath, source.Path().c_str(), assetInfo, watchFolder); + + if (sourceInfoFound && assetInfo.m_assetId.IsValid()) + { + return SourceHandle(nullptr, assetInfo.m_assetId.m_guid, assetInfo.m_relativePath); + } + } + + return AZStd::nullopt; + } + ////////////////////////// // NodeIdentifierFactory ////////////////////////// diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/EditorScriptCanvasBus.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/EditorScriptCanvasBus.h index b55e425d43..b1fd291a1b 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/EditorScriptCanvasBus.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/EditorScriptCanvasBus.h @@ -72,7 +72,7 @@ namespace ScriptCanvasEditor static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; using BusIdType = AZ::EntityId; - virtual void SetAssetId(const AZ::Data::AssetId& assetId) = 0; + virtual void SetAssetId(const SourceHandle& assetId) = 0; virtual bool HasAssetId() const = 0; }; @@ -91,32 +91,7 @@ namespace ScriptCanvasEditor }; using EditorContextMenuRequestBus = AZ::EBus; - - class EditorScriptCanvasAssetNotifications : public AZ::EBusTraits - { - public: - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; - using BusIdType = AZ::Data::AssetId; - - //! Notification which fires after an EditorGraph has received it's on AssetReady callback - //! \param scriptCanvasAsset Script Canvas asset which is now ready for use in the Editor - virtual void OnScriptCanvasAssetReady(const AZ::Data::Asset& /*scriptCanvasAsset*/) {}; - - //! Notification which fires after an EditorGraph has received it's on AssetReloaded callback - //! \param scriptCanvasAsset Script Canvas asset which is now ready for use in the Editor - virtual void OnScriptCanvasAssetReloaded(const AZ::Data::Asset& /*scriptCanvaAsset */) {}; - - //! Notification which fires after an EditorGraph has received it's on AssetReady callback - //! \param AssetId AssetId of unloaded ScriptCanvas - virtual void OnScriptCanvasAssetUnloaded(const AZ::Data::AssetId& /*assetId*/) {}; - - //! Notification which fires after an EditorGraph has received an onAssetSaved callback - //! \param scriptCanvasAsset Script Canvas asset which was attempted to be saved - //! \param isSuccessful specified where the Script Canvas asset was successfully saved - virtual void OnScriptCanvasAssetSaved(const AZ::Data::AssetId) {}; - }; - using EditorScriptCanvasAssetNotificationBus = AZ::EBus; - + class EditorGraphRequests : public AZ::EBusTraits { public: diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h index 1bdb4ccb85..38a84bc75e 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h @@ -17,6 +17,7 @@ #include #include #include +#include namespace ScriptCanvasEditor { @@ -34,10 +35,9 @@ namespace ScriptCanvasEditor : public AzToolsFramework::Components::EditorComponentBase , private EditorContextMenuRequestBus::Handler , private AzFramework::AssetCatalogEventBus::Handler + , private AzToolsFramework::AssetSystemBus::Handler , private EditorScriptCanvasComponentLoggingBus::Handler , private EditorScriptCanvasComponentRequestBus::Handler - , private AssetTrackerNotificationBus::Handler - , private AzToolsFramework::AssetSystemBus::Handler , private AzToolsFramework::EditorEntityContextNotificationBus::Handler { @@ -46,7 +46,7 @@ namespace ScriptCanvasEditor EditorScriptCanvasComponent(); // EditorScriptCanvasComponent(AZ::Data::Asset asset); - EditorScriptCanvasComponent(AZ::Data::Asset asset); + EditorScriptCanvasComponent(const SourceHandle& sourceHandle); ~EditorScriptCanvasComponent() override; //===================================================================== @@ -70,14 +70,14 @@ namespace ScriptCanvasEditor void OpenEditor(); - void SetName(const AZStd::string& name) { m_name = name; } + void SetName(AZStd::string_view name) { m_name = 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; + void SetAssetId(const SourceHandle& assetId) override; bool HasAssetId() const override; //===================================================================== @@ -85,13 +85,12 @@ namespace ScriptCanvasEditor // EditorContextMenuRequestBus AZ::Data::AssetId GetAssetId() const override; //===================================================================== - AZ::EntityId GetGraphEntityId() const; - + //===================================================================== // AssetTrackerNotificationBus - void OnAssetReady(const ScriptCanvasMemoryAsset::pointer asset) override; - void OnAssetSaved(const ScriptCanvasMemoryAsset::pointer asset, bool isSuccessful) override; - void OnAssetReloaded(const ScriptCanvasMemoryAsset::pointer asset) override; + void OnAssetReady(const ScriptCanvasMemoryAsset::pointer asset) ; + void OnAssetSaved(const ScriptCanvasMemoryAsset::pointer asset, bool isSuccessful) ; + void OnAssetReloaded(const ScriptCanvasMemoryAsset::pointer asset) ; //===================================================================== @@ -119,25 +118,30 @@ namespace ScriptCanvasEditor (void)incompatible; } - 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); + // complete the id, load call OnScriptCanvasAssetChanged + void SourceFileChanged(AZStd::string relativePath, AZStd::string scanFolder, AZ::Uuid fileAssetId) override; + + // update the display icon for failure, save the values in the graph + void SourceFileRemoved(AZStd::string relativePath, AZStd::string scanFolder, AZ::Uuid fileAssetId) override; + void SourceFileFailed(AZStd::string relativePath, AZStd::string scanFolder, AZ::Uuid fileAssetId) override; + + void OnScriptCanvasAssetChanged(const SourceHandle& sourceHandle); void UpdateName(); //===================================================================== - void OnScriptCanvasAssetReady(const ScriptCanvasMemoryAsset::pointer asset); + void OnScriptCanvasAssetReady(const SourceHandle& sourceHandle); //===================================================================== void BuildGameEntityData(); void ClearVariables(); private: - AZ::Data::AssetId m_removedCatalogId; - AZ::Data::AssetId m_previousAssetId; AZStd::string m_name; - ScriptCanvasAssetHolder m_scriptCanvasAssetHolder; bool m_runtimeDataIsValid = false; ScriptCanvasBuilder::BuildVariableOverrides m_variableOverrides; + SourceHandle m_sourceHandle; + SourceHandle m_previousHandle; + SourceHandle m_removedHandle; }; } diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorUtils.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorUtils.h index 15100cbf4e..7685133ca4 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorUtils.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorUtils.h @@ -21,6 +21,8 @@ namespace GraphCanvas namespace ScriptCanvasEditor { + AZStd::optional CompleteDescription(const SourceHandle& source); + class Graph; class NodePaletteModel; diff --git a/Gems/ScriptCanvas/Code/Editor/ReflectComponent.cpp b/Gems/ScriptCanvas/Code/Editor/ReflectComponent.cpp index a75671d0f8..7f2a170a4d 100644 --- a/Gems/ScriptCanvas/Code/Editor/ReflectComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/ReflectComponent.cpp @@ -31,6 +31,7 @@ namespace ScriptCanvasEditor { void ReflectComponent::Reflect(AZ::ReflectContext* context) { + SourceHandle::Reflect(context); ScriptCanvas::ScriptCanvasData::Reflect(context); ScriptCanvasAssetHolder::Reflect(context); EditorSettings::EditorWorkspace::Reflect(context); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index a53100eea8..ce4ee7638f 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -1946,7 +1946,7 @@ namespace ScriptCanvasEditor { if (auto firstRequestBus = EditorScriptCanvasComponentRequestBus::FindFirstHandler(entity->GetId())) { - firstRequestBus->SetAssetId(memoryAsset.Id()); + firstRequestBus->SetAssetId(memoryAsset.Describe()); } } else @@ -1955,7 +1955,7 @@ namespace ScriptCanvasEditor { if (editorComponent->GetAssetId() == oldId) { - editorComponent->SetAssetId(memoryAsset.Id()); + editorComponent->SetAssetId(memoryAsset.Describe()); break; } } @@ -4379,15 +4379,7 @@ namespace ScriptCanvasEditor if (usableRequestBus) { - ScriptCanvasMemoryAsset::pointer memoryAsset; - // #sc_editor_asset - // AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, m_activeGraph); - - if (memoryAsset) - { - // We need to assign the AssetId for the file asset, not the in-memory asset - usableRequestBus->SetAssetId(memoryAsset->GetFileAssetId()); - } + usableRequestBus->SetAssetId(m_activeGraph.Describe()); } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp index de96c9953b..ae85dbc6a9 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp @@ -6,6 +6,7 @@ * */ + #include #include #include @@ -14,9 +15,8 @@ #include #include -#include "Core.h" #include "Attributes.h" - +#include "Core.h" #include namespace ScriptCanvas @@ -238,6 +238,11 @@ namespace ScriptCanvasEditor return m_data != nullptr; } + bool SourceHandle::IsValidDescription() const + { + return !m_id.IsNull() && !m_path.empty(); + } + GraphPtr SourceHandle::Mod() const { return m_data ? m_data->ModEditorGraph() : nullptr; @@ -265,6 +270,30 @@ namespace ScriptCanvasEditor return m_path == other.m_path; } + void SourceHandle::Reflect(AZ::ReflectContext* context) + { + if (auto serializeContext = azrtti_cast(context)) + { + serializeContext->Class() + ->Version(0) + ->Field("id", &SourceHandle::m_id) + ->Field("path", &SourceHandle::m_path) + ; + + if (AZ::EditContext* editContext = serializeContext->GetEditContext()) + { + editContext->Class("Script Canvas Source Handle", "References a source editor file") + ->ClassElement(AZ::Edit::ClassElements::EditorData, "") + ->Attribute(AZ::Edit::Attributes::Category, "Scripting") + ->Attribute(AZ::Edit::Attributes::Icon, "Icons/ScriptCanvas/ScriptCanvas.svg") + ->Attribute(AZ::Edit::Attributes::ViewportIcon, "Icons/ScriptCanvas/Viewport/ScriptCanvas.svg") + ->Attribute(AZ::Edit::Attributes::AutoExpand, true) + ->DataElement(AZ::Edit::UIHandlers::Default, &SourceHandle::m_path); + ; + } + } + } + AZStd::string SourceHandle::ToString() const { return AZStd::string::format diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h index a57d2dc3a1..d514683b55 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h @@ -325,6 +325,8 @@ namespace ScriptCanvasEditor AZ_TYPE_INFO(SourceHandle, "{65855A98-AE2F-427F-BFC8-69D45265E312}"); AZ_CLASS_ALLOCATOR(SourceHandle, AZ::SystemAllocator, 0); + static void Reflect(AZ::ReflectContext* context); + SourceHandle() = default; SourceHandle(const SourceHandle& data, const AZ::Uuid& id, const AZ::IO::Path& path); @@ -344,6 +346,8 @@ namespace ScriptCanvasEditor bool IsValid() const; + bool IsValidDescription() const; + GraphPtr Mod() const; bool operator==(const SourceHandle& other) const; @@ -372,8 +376,8 @@ namespace ScriptCanvas AZ_RTTI(ScriptCanvasData, "{1072E894-0C67-4091-8B64-F7DB324AD13C}"); AZ_CLASS_ALLOCATOR(ScriptCanvasData, AZ::SystemAllocator, 0); - ScriptCanvasData() {} - virtual ~ScriptCanvasData() {} + ScriptCanvasData() = default; + virtual ~ScriptCanvasData() = default; ScriptCanvasData(ScriptCanvasData&& other); ScriptCanvasData& operator=(ScriptCanvasData&& other); diff --git a/Gems/ScriptCanvasTesting/Assets/ScriptCanvas/Tests/$tmp29198_Test_LY_79396.scriptcanvas b/Gems/ScriptCanvasTesting/Assets/ScriptCanvas/Tests/$tmp29198_Test_LY_79396.scriptcanvas new file mode 100644 index 0000000000..278d74c28d --- /dev/null +++ b/Gems/ScriptCanvasTesting/Assets/ScriptCanvas/Tests/$tmp29198_Test_LY_79396.scriptcanvas @@ -0,0 +1,69 @@ +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "ScriptCanvasData", + "ClassData": { + "m_scriptCanvas": { + "Id": { + "id": 32884619828465 + }, + "Name": "Script Canvas Graph", + "Components": { + "Component_[14322649685925277086]": { + "$type": "EditorGraphVariableManagerComponent", + "Id": 14322649685925277086, + "m_variableData": { + "m_nameVariableMap": [ + { + "Key": { + "m_id": "{142C0457-38E5-496E-A4F2-67E91852CBCB}" + }, + "Value": { + "Datum": { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 4, + "m_azType": "{5CBE5640-DF5C-5A49-9195-D790881A0747}" + }, + "isNullPointer": false, + "$type": "{5CBE5640-DF5C-5A49-9195-D790881A0747} AZStd::vector", + "value": [ + [ + 0.0, + 0.0, + -498814079205376.0, + 0.0 + ], + [ + 0.0, + 0.0, + 1.1865528051967005e38, + 0.0 + ] + ], + "label": "Variable 7" + }, + "VariableId": { + "m_id": "{142C0457-38E5-496E-A4F2-67E91852CBCB}" + }, + "VariableName": "Variable 7" + } + }, + { + "Key": { + "m_id": "{21DD2B3D-ADC9-46E1-B44C-965A6E2AE543}" + }, + "Value": { + "Datum": { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 4, + "m_azType": "{9ABF5933-C8FC-53CD-A518-B6AF433CF496}" + }, + "isNullPointer": false, + "$type": "{9ABF5933-C8FC-53CD-A518-B6AF433CF496} AZStd::unordered_map", + "value": [ + { + "Key": true, + "Value": { + "roll": \ No newline at end of file From 3f6824571f120ebadb840c4c74236ef5d48a7abe Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Fri, 19 Nov 2021 09:07:31 -0600 Subject: [PATCH 064/948] Added regular expression filter for asset browser entries. Signed-off-by: Chris Galvan --- .../AssetBrowser/Search/Filter.cpp | 34 +++++++++++++++++++ .../AssetBrowser/Search/Filter.h | 22 ++++++++++++ 2 files changed, 56 insertions(+) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/Filter.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/Filter.cpp index 3f267dedd0..d617638632 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/Filter.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/Filter.cpp @@ -251,6 +251,40 @@ namespace AzToolsFramework return false; } + ////////////////////////////////////////////////////////////////////////// + // RegExpFilter + ////////////////////////////////////////////////////////////////////////// + RegExpFilter::RegExpFilter() + : m_filterPattern("") + { + } + + void RegExpFilter::SetFilterPattern(const QString& filterPattern) + { + m_filterPattern = filterPattern; + Q_EMIT updatedSignal(); + } + + QString RegExpFilter::GetNameInternal() const + { + return m_filterPattern; + } + + bool RegExpFilter::MatchInternal(const AssetBrowserEntry* entry) const + { + // no filter pattern matches any asset + if (m_filterPattern.isEmpty()) + { + return true; + } + + // entry's name matches regular expression pattern + QRegExp regExp(m_filterPattern); + regExp.setPatternSyntax(QRegExp::Wildcard); + + return regExp.exactMatch(entry->GetDisplayName()); + } + ////////////////////////////////////////////////////////////////////////// // AssetTypeFilter ////////////////////////////////////////////////////////////////////////// diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/Filter.h b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/Filter.h index 5819ae92d7..94f47e0599 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/Filter.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/Filter.h @@ -115,6 +115,28 @@ namespace AzToolsFramework QString m_filterString; }; + ////////////////////////////////////////////////////////////////////////// + // RegExpFilter + ////////////////////////////////////////////////////////////////////////// + //! RegExpFilter filters assets based on a regular expression pattern + class RegExpFilter + : public AssetBrowserEntryFilter + { + Q_OBJECT + public: + RegExpFilter(); + ~RegExpFilter() override = default; + + void SetFilterPattern(const QString& filterPattern); + + protected: + QString GetNameInternal() const override; + bool MatchInternal(const AssetBrowserEntry* entry) const override; + + private: + QString m_filterPattern; + }; + ////////////////////////////////////////////////////////////////////////// // AssetTypeFilter ////////////////////////////////////////////////////////////////////////// From 231aaa5bf59fddd001e085fb5674c23648b4bd95 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Fri, 19 Nov 2021 14:48:12 -0600 Subject: [PATCH 065/948] Added asset selection model option for a source asset type based on regex. Signed-off-by: Chris Galvan --- .../AssetBrowser/AssetSelectionModel.cpp | 69 ++++++++++++++++--- .../AssetBrowser/AssetSelectionModel.h | 11 ++- 2 files changed, 70 insertions(+), 10 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetSelectionModel.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetSelectionModel.cpp index 3547cf57b3..2fbdcaf40b 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetSelectionModel.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetSelectionModel.cpp @@ -10,18 +10,24 @@ #include #include +#if !defined(Q_MOC_RUN) +AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") +#include +AZ_POP_DISABLE_WARNING +#endif + namespace AzToolsFramework { namespace AssetBrowser { namespace { - FilterConstType ProductsNoFoldersFilter() + FilterConstType EntryTypeNoFoldersFilter(AssetBrowserEntry::AssetEntryType entryType = AssetBrowserEntry::AssetEntryType::Product) { - EntryTypeFilter* productFilter = new EntryTypeFilter(); - productFilter->SetEntryType(AssetBrowserEntry::AssetEntryType::Product); + EntryTypeFilter* entryTypeFilter = new EntryTypeFilter(); + entryTypeFilter->SetEntryType(entryType); // in case entry is a source or folder, it may still contain relevant product - productFilter->SetFilterPropagation(AssetBrowserEntryFilter::PropagateDirection::Down); + entryTypeFilter->SetFilterPropagation(AssetBrowserEntryFilter::PropagateDirection::Down); EntryTypeFilter* foldersFilter = new EntryTypeFilter(); foldersFilter->SetEntryType(AssetBrowserEntry::AssetEntryType::Folder); @@ -30,7 +36,7 @@ namespace AzToolsFramework noFoldersFilter->SetFilter(FilterConstType(foldersFilter)); CompositeFilter* compFilter = new CompositeFilter(CompositeFilter::LogicOperatorType::AND); - compFilter->AddFilter(FilterConstType(productFilter)); + compFilter->AddFilter(FilterConstType(entryTypeFilter)); compFilter->AddFilter(FilterConstType(noFoldersFilter)); return FilterConstType(compFilter); @@ -79,15 +85,39 @@ namespace AzToolsFramework void AssetSelectionModel::SetSelectedAssetIds(const AZStd::vector& selectedAssetIds) { + m_selectedFilePaths.clear(); + m_selectedAssetIds = selectedAssetIds; } void AssetSelectionModel::SetSelectedAssetId(const AZ::Data::AssetId& selectedAssetId) { + m_selectedFilePaths.clear(); + m_selectedAssetIds.clear(); m_selectedAssetIds.push_back(selectedAssetId); } + const AZStd::vector& AssetSelectionModel::GetSelectedFilePaths() const + { + return m_selectedFilePaths; + } + + void AssetSelectionModel::SetSelectedFilePaths(const AZStd::vector& selectedFilePaths) + { + m_selectedAssetIds.clear(); + + m_selectedFilePaths = selectedFilePaths; + } + + void AssetSelectionModel::SetSelectedFilePath(const AZStd::string& selectedFilePath) + { + m_selectedAssetIds.clear(); + + m_selectedFilePaths.clear(); + m_selectedFilePaths.push_back(selectedFilePath); + } + void AssetSelectionModel::SetDefaultDirectory(AZStd::string_view defaultDirectory) { m_defaultDirectory = defaultDirectory; @@ -136,7 +166,7 @@ namespace AzToolsFramework CompositeFilter* compFilter = new CompositeFilter(CompositeFilter::LogicOperatorType::AND); compFilter->AddFilter(assetTypeFilterPtr); - compFilter->AddFilter(ProductsNoFoldersFilter()); + compFilter->AddFilter(EntryTypeNoFoldersFilter()); selection.SetSelectionFilter(FilterConstType(compFilter)); selection.SetMultiselect(multiselect); @@ -169,7 +199,7 @@ namespace AzToolsFramework CompositeFilter* compFilter = new CompositeFilter(CompositeFilter::LogicOperatorType::AND); compFilter->AddFilter(anyAssetTypeFilterPtr); - compFilter->AddFilter(ProductsNoFoldersFilter()); + compFilter->AddFilter(EntryTypeNoFoldersFilter()); selection.SetSelectionFilter(FilterConstType(compFilter)); selection.SetMultiselect(multiselect); @@ -190,7 +220,28 @@ namespace AzToolsFramework CompositeFilter* compFilter = new CompositeFilter(CompositeFilter::LogicOperatorType::AND); compFilter->AddFilter(assetGroupFilterPtr); - compFilter->AddFilter(ProductsNoFoldersFilter()); + compFilter->AddFilter(EntryTypeNoFoldersFilter()); + + selection.SetSelectionFilter(FilterConstType(compFilter)); + selection.SetMultiselect(multiselect); + + return selection; + } + + AssetSelectionModel AssetSelectionModel::SourceAssetTypeSelection(const QString& pattern, bool multiselect) + { + AssetSelectionModel selection; + + RegExpFilter* patternFilter = new RegExpFilter(); + patternFilter->SetFilterPattern(pattern); + patternFilter->SetFilterPropagation(AssetBrowserEntryFilter::PropagateDirection::Down); + auto patternFilterPtr = FilterConstType(patternFilter); + + selection.SetDisplayFilter(patternFilterPtr); + + CompositeFilter* compFilter = new CompositeFilter(CompositeFilter::LogicOperatorType::AND); + compFilter->AddFilter(patternFilterPtr); + compFilter->AddFilter(EntryTypeNoFoldersFilter(AssetBrowserEntry::AssetEntryType::Source)); selection.SetSelectionFilter(FilterConstType(compFilter)); selection.SetMultiselect(multiselect); @@ -204,7 +255,7 @@ namespace AzToolsFramework CompositeFilter* compFilter = new CompositeFilter(CompositeFilter::LogicOperatorType::OR); selection.SetDisplayFilter(FilterConstType(compFilter)); - selection.SetSelectionFilter(ProductsNoFoldersFilter()); + selection.SetSelectionFilter(EntryTypeNoFoldersFilter()); selection.SetMultiselect(multiselect); return selection; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetSelectionModel.h b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetSelectionModel.h index 4036c166ac..241c896123 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetSelectionModel.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetSelectionModel.h @@ -44,6 +44,10 @@ namespace AzToolsFramework void SetSelectedAssetIds(const AZStd::vector& selectedAssetIds); void SetSelectedAssetId(const AZ::Data::AssetId& selectedAssetId); + const AZStd::vector& GetSelectedFilePaths() const; + void SetSelectedFilePaths(const AZStd::vector& selectedFilePaths); + void SetSelectedFilePath(const AZStd::string& selectedFilePath); + void SetDefaultDirectory(AZStd::string_view defaultDirectory); AZStd::string_view GetDefaultDirectory() const; @@ -60,6 +64,7 @@ namespace AzToolsFramework static AssetSelectionModel AssetTypeSelection(const char* assetTypeName, bool multiselect = false); static AssetSelectionModel AssetTypesSelection(const AZStd::vector& assetTypes, bool multiselect = false); static AssetSelectionModel AssetGroupSelection(const char* group, bool multiselect = false); + static AssetSelectionModel SourceAssetTypeSelection(const QString& pattern, bool multiselect = false); static AssetSelectionModel EverythingSelection(bool multiselect = false); private: @@ -68,8 +73,12 @@ namespace AzToolsFramework // some entries like folder should always be displayed, but not always selectable, thus 2 separate filters FilterConstType m_selectionFilter; FilterConstType m_displayFilter; - + + //! Selection can be based on asset ids (for products), or file paths (for sources) + //! These are mututally exclusive AZStd::vector m_selectedAssetIds; + AZStd::vector m_selectedFilePaths; + AZStd::vector m_results; AZStd::string m_defaultDirectory; From d9ee02fddfb382e04ed546dbd76fc17dc89c0fa9 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Fri, 19 Nov 2021 14:48:56 -0600 Subject: [PATCH 066/948] Added method to AssetCompleterModel for specifying a filter directly. Signed-off-by: Chris Galvan --- .../UI/PropertyEditor/Model/AssetCompleterModel.cpp | 7 ++++++- .../UI/PropertyEditor/Model/AssetCompleterModel.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.cpp index 3e5b41ebeb..81f0cb36af 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.cpp @@ -39,7 +39,12 @@ namespace AzToolsFramework typeFilter->SetAssetType(filterType); typeFilter->SetFilterPropagation(AssetBrowserEntryFilter::PropagateDirection::Down); - m_assetBrowserFilterModel->SetFilter(FilterConstType(typeFilter)); + SetFilter(FilterConstType(typeFilter)); + } + + void AssetCompleterModel::SetFilter(FilterConstType filter) + { + m_assetBrowserFilterModel->SetFilter(filter); RefreshAssetList(); } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.h b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.h index 55a6db8589..03660e8fa9 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.h @@ -32,6 +32,7 @@ namespace AzToolsFramework QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; void SetFilter(AZ::Data::AssetType filterType); + void SetFilter(FilterConstType filter); void RefreshAssetList(); void SearchStringHighlight(QString searchString); From 42382cd8d16811fe5c9055a5f24ab5325c898984 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Fri, 19 Nov 2021 14:49:56 -0600 Subject: [PATCH 067/948] Added logic to AssetPickerDialog to pre-select by file paths. Signed-off-by: Chris Galvan --- .../AssetBrowser/AssetPicker/AssetPickerDialog.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetPicker/AssetPickerDialog.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetPicker/AssetPickerDialog.cpp index eae8ec2a1e..4e3b8ee745 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetPicker/AssetPickerDialog.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetPicker/AssetPickerDialog.cpp @@ -99,6 +99,18 @@ namespace AzToolsFramework } } + if (selection.GetSelectedAssetIds().empty()) + { + for (auto& filePath : selection.GetSelectedFilePaths()) + { + if (!filePath.empty()) + { + selectedAsset = true; + m_ui->m_assetBrowserTreeViewWidget->SelectFileAtPath(filePath); + } + } + } + if (!selectedAsset) { m_ui->m_assetBrowserTreeViewWidget->SelectFolder(selection.GetDefaultDirectory()); From b4407e504407d3ea0491252eb8a455efd888f333 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Fri, 19 Nov 2021 14:51:41 -0600 Subject: [PATCH 068/948] Made PropertyAssetCtrl more extensible. Signed-off-by: Chris Galvan --- .../UI/PropertyEditor/PropertyAssetCtrl.cpp | 11 ++++++++--- .../UI/PropertyEditor/PropertyAssetCtrl.hxx | 5 +++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.cpp index 384b384a23..16270ac8c7 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.cpp @@ -1288,7 +1288,7 @@ namespace AzToolsFramework return newCtrl; } - void AssetPropertyHandlerDefault::ConsumeAttribute(PropertyAssetCtrl* GUI, AZ::u32 attrib, PropertyAttributeReader* attrValue, const char* debugName) + void AssetPropertyHandlerDefault::ConsumeAttributeInternal(PropertyAssetCtrl* GUI, AZ::u32 attrib, PropertyAttributeReader* attrValue, const char* debugName) { (void)debugName; @@ -1487,6 +1487,11 @@ namespace AzToolsFramework } } + void AssetPropertyHandlerDefault::ConsumeAttribute(PropertyAssetCtrl* GUI, AZ::u32 attrib, PropertyAttributeReader* attrValue, const char* debugName) + { + ConsumeAttributeInternal(GUI, attrib, attrValue, debugName); + } + void AssetPropertyHandlerDefault::WriteGUIValuesIntoProperty(size_t index, PropertyAssetCtrl* GUI, property_t& instance, InstanceDataNode* node) { (void)index; @@ -1629,8 +1634,8 @@ namespace AzToolsFramework void RegisterAssetPropertyHandler() { - EBUS_EVENT(PropertyTypeRegistrationMessages::Bus, RegisterPropertyType, aznew AssetPropertyHandlerDefault()); - EBUS_EVENT(PropertyTypeRegistrationMessages::Bus, RegisterPropertyType, aznew SimpleAssetPropertyHandlerDefault()); + PropertyTypeRegistrationMessages::Bus::Broadcast(&PropertyTypeRegistrationMessages::RegisterPropertyType, aznew AssetPropertyHandlerDefault()); + PropertyTypeRegistrationMessages::Bus::Broadcast(&PropertyTypeRegistrationMessages::RegisterPropertyType, aznew SimpleAssetPropertyHandlerDefault()); } } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.hxx b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.hxx index 58ddbb967e..403725a429 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.hxx +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.hxx @@ -235,7 +235,7 @@ namespace AzToolsFramework void SetSelectedAssetID(const AZ::Data::AssetId& newID, const AZ::Data::AssetType& newType); void SetCurrentAssetHint(const AZStd::string& hint); void SetDefaultAssetID(const AZ::Data::AssetId& defaultID); - void PopupAssetPicker(); + virtual void PopupAssetPicker(); void OnClearButtonClicked(); void UpdateAssetDisplay(); void OnLineEditFocus(bool focus); @@ -270,7 +270,8 @@ namespace AzToolsFramework virtual void UpdateWidgetInternalTabbing(PropertyAssetCtrl* widget) override { widget->UpdateTabOrder(); } virtual QWidget* CreateGUI(QWidget* pParent) override; - virtual void ConsumeAttribute(PropertyAssetCtrl* GUI, AZ::u32 attrib, PropertyAttributeReader* attrValue, const char* debugName) override; + static void ConsumeAttributeInternal(PropertyAssetCtrl* GUI, AZ::u32 attrib, PropertyAttributeReader* attrValue, const char* debugName); + void ConsumeAttribute(PropertyAssetCtrl* GUI, AZ::u32 attrib, PropertyAttributeReader* attrValue, const char* debugName) override; virtual void WriteGUIValuesIntoProperty(size_t index, PropertyAssetCtrl* GUI, property_t& instance, InstanceDataNode* node) override; virtual bool ReadValuesIntoGUI(size_t index, PropertyAssetCtrl* GUI, const property_t& instance, InstanceDataNode* node) override; }; From befd84cf0bb51a6f75278f6b64e464e3092a3cf6 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Fri, 19 Nov 2021 14:52:45 -0600 Subject: [PATCH 069/948] Added property handler for SourceHandle type. Signed-off-by: Chris Galvan --- .../Serialization/EditContextConstants.inl | 2 + .../Code/Editor/SystemComponent.cpp | 2 + .../Widgets/SourceHandlePropertyAssetCtrl.cpp | 138 ++++++++++++++++++ .../Widgets/SourceHandlePropertyAssetCtrl.h | 67 +++++++++ .../Code/scriptcanvasgem_editor_files.cmake | 2 + 5 files changed, 211 insertions(+) create mode 100644 Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.cpp create mode 100644 Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.h diff --git a/Code/Framework/AzCore/AzCore/Serialization/EditContextConstants.inl b/Code/Framework/AzCore/AzCore/Serialization/EditContextConstants.inl index 4f8c67f058..27f27dd6dd 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/EditContextConstants.inl +++ b/Code/Framework/AzCore/AzCore/Serialization/EditContextConstants.inl @@ -133,6 +133,8 @@ namespace AZ const static AZ::Crc32 AllowClearAsset = AZ_CRC("AllowClearAsset", 0x24827182); // Show the name of the asset that was produced from the source asset const static AZ::Crc32 ShowProductAssetFileName = AZ_CRC("ShowProductAssetFileName"); + //! Regular expression pattern filter for source files + const static AZ::Crc32 SourceAssetFilterPattern = AZ_CRC_CE("SourceAssetFilterPattern"); //! Component icon attributes const static AZ::Crc32 Icon = AZ_CRC("Icon", 0x659429db); diff --git a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp index ab8cd0e61b..3566d8da4b 100644 --- a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -119,6 +120,7 @@ namespace ScriptCanvasEditor PopulateEditorCreatableTypes(); AzToolsFramework::RegisterGenericComboBoxHandler(); + AzToolsFramework::PropertyTypeRegistrationMessages::Bus::Broadcast(&AzToolsFramework::PropertyTypeRegistrationMessages::RegisterPropertyType, aznew SourceHandlePropertyHandler()); SystemRequestBus::Handler::BusConnect(); ScriptCanvasExecutionBus::Handler::BusConnect(); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.cpp new file mode 100644 index 0000000000..66b9b77bdf --- /dev/null +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.cpp @@ -0,0 +1,138 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * 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 ScriptCanvasEditor +{ + SourceHandlePropertyAssetCtrl::SourceHandlePropertyAssetCtrl(QWidget* parent) + : AzToolsFramework::PropertyAssetCtrl(parent) + { + } + + AzToolsFramework::AssetBrowser::AssetSelectionModel SourceHandlePropertyAssetCtrl::GetAssetSelectionModel() + { + auto selectionModel = AssetSelectionModel::SourceAssetTypeSelection(m_sourceAssetFilterPattern); + selectionModel.SetTitle(m_title); + return selectionModel; + } + + void SourceHandlePropertyAssetCtrl::PopupAssetPicker() + { + // Request the AssetBrowser Dialog and set a type filter + AssetSelectionModel selection = GetAssetSelectionModel(); + selection.SetSelectedFilePath(m_selectedSourcePath.c_str()); + + AZStd::string defaultDirectory; + if (m_defaultDirectoryCallback) + { + m_defaultDirectoryCallback->Invoke(m_editNotifyTarget, defaultDirectory); + selection.SetDefaultDirectory(defaultDirectory); + } + + AssetBrowserComponentRequestBus::Broadcast(&AssetBrowserComponentRequests::PickAssets, selection, parentWidget()); + if (selection.IsValid()) + { + const auto source = azrtti_cast(selection.GetResult()); + AZ_Assert(source, "Incorrect entry type selected. Expected source."); + if (source) + { + SetSelectedSourcePath(source->GetFullPath()); + } + } + } + + void SourceHandlePropertyAssetCtrl::ClearAssetInternal() + { + SetSelectedSourcePath(""); + + PropertyAssetCtrl::ClearAssetInternal(); + } + + void SourceHandlePropertyAssetCtrl::SetSourceAssetFilterPattern(const QString& filterPattern) + { + m_sourceAssetFilterPattern = filterPattern; + } + + AZ::IO::Path SourceHandlePropertyAssetCtrl::GetSelectedSourcePath() const + { + return m_selectedSourcePath; + } + + void SourceHandlePropertyAssetCtrl::SetSelectedSourcePath(const AZ::IO::Path& sourcePath) + { + m_selectedSourcePath = sourcePath; + + AZStd::string displayText; + if (!sourcePath.empty()) + { + AzFramework::StringFunc::Path::GetFileName(sourcePath.c_str(), displayText); + } + m_browseEdit->setText(displayText.c_str()); + + // The AssetID gets ignored, the only important bit is triggering the change for the RequestWrite + emit OnAssetIDChanged(AZ::Data::AssetId()); + } + + QWidget* SourceHandlePropertyHandler::CreateGUI(QWidget* pParent) + { + SourceHandlePropertyAssetCtrl* newCtrl = aznew SourceHandlePropertyAssetCtrl(pParent); + connect(newCtrl, &SourceHandlePropertyAssetCtrl::OnAssetIDChanged, this, [newCtrl](AZ::Data::AssetId newAssetID) + { + (void)newAssetID; + AzToolsFramework::PropertyEditorGUIMessages::Bus::Broadcast(&AzToolsFramework::PropertyEditorGUIMessages::RequestWrite, newCtrl); + AzToolsFramework::PropertyEditorGUIMessages::Bus::Broadcast(&AzToolsFramework::PropertyEditorGUIMessages::OnEditingFinished, newCtrl); + }); + return newCtrl; + } + + void SourceHandlePropertyHandler::ConsumeAttribute(SourceHandlePropertyAssetCtrl* GUI, AZ::u32 attrib, AzToolsFramework::PropertyAttributeReader* attrValue, const char* debugName) + { + // Let the AssetPropertyHandlerDefault handle all of the common attributes + AzToolsFramework::AssetPropertyHandlerDefault::ConsumeAttributeInternal(GUI, attrib, attrValue, debugName); + + if (attrib == AZ::Edit::Attributes::SourceAssetFilterPattern) + { + AZStd::string filterPattern; + if (attrValue->Read(filterPattern)) + { + GUI->SetSourceAssetFilterPattern(filterPattern.c_str()); + } + } + } + + void SourceHandlePropertyHandler::WriteGUIValuesIntoProperty(size_t index, SourceHandlePropertyAssetCtrl* GUI, property_t& instance, AzToolsFramework::InstanceDataNode* node) + { + (void)index; + (void)node; + + auto sourceHandle = SourceHandle(nullptr, {}, GUI->GetSelectedSourcePath()); + instance = property_t(*CompleteDescription(sourceHandle)); + } + + bool SourceHandlePropertyHandler::ReadValuesIntoGUI(size_t index, SourceHandlePropertyAssetCtrl* GUI, const property_t& instance, AzToolsFramework::InstanceDataNode* node) + { + (void)index; + (void)node; + + GUI->blockSignals(true); + + GUI->SetSelectedSourcePath(instance.Path()); + GUI->SetEditNotifyTarget(node->GetParent()->GetInstance(0)); + + GUI->blockSignals(false); + return false; + } +} diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.h new file mode 100644 index 0000000000..31a62aacfb --- /dev/null +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.h @@ -0,0 +1,67 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#if !defined(Q_MOC_RUN) +#include + +#include +#endif + +namespace ScriptCanvasEditor +{ + class SourceHandlePropertyAssetCtrl + : public AzToolsFramework::PropertyAssetCtrl + { + Q_OBJECT + + public: + AZ_CLASS_ALLOCATOR(SourceHandlePropertyAssetCtrl, AZ::SystemAllocator, 0); + + SourceHandlePropertyAssetCtrl(QWidget* parent = nullptr); + + AzToolsFramework::AssetBrowser::AssetSelectionModel GetAssetSelectionModel() override; + void PopupAssetPicker() override; + void ClearAssetInternal() override; + + void SetSourceAssetFilterPattern(const QString& filterPattern); + + AZ::IO::Path GetSelectedSourcePath() const; + void SetSelectedSourcePath(const AZ::IO::Path& sourcePath); + + private: + //! A regular expression pattern for filtering by source assets + //! If this is set, the PropertyAssetCtrl will be dealing with source assets + //! instead of a specific asset type + QString m_sourceAssetFilterPattern; + + AZ::IO::Path m_selectedSourcePath; + }; + + class SourceHandlePropertyHandler + : QObject + , public AzToolsFramework::PropertyHandler + { + Q_OBJECT + + public: + AZ_CLASS_ALLOCATOR(SourceHandlePropertyHandler, AZ::SystemAllocator, 0); + + AZ::u32 GetHandlerName(void) const override { return AZ_CRC_CE("SourceHandle"); } + bool IsDefaultHandler() const override { return true; } + QWidget* GetFirstInTabOrder(SourceHandlePropertyAssetCtrl* widget) override { return widget->GetFirstInTabOrder(); } + QWidget* GetLastInTabOrder(SourceHandlePropertyAssetCtrl* widget) override { return widget->GetLastInTabOrder(); } + void UpdateWidgetInternalTabbing(SourceHandlePropertyAssetCtrl* widget) override { widget->UpdateTabOrder(); } + + QWidget* CreateGUI(QWidget* pParent) override; + void ConsumeAttribute(SourceHandlePropertyAssetCtrl* GUI, AZ::u32 attrib, AzToolsFramework::PropertyAttributeReader* attrValue, const char* debugName) override; + void WriteGUIValuesIntoProperty(size_t index, SourceHandlePropertyAssetCtrl* GUI, property_t& instance, AzToolsFramework::InstanceDataNode* node) override; + bool ReadValuesIntoGUI(size_t index, SourceHandlePropertyAssetCtrl* GUI, const property_t& instance, AzToolsFramework::InstanceDataNode* node) override; + }; +} diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake index 49f89d8e48..7f269e2081 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake @@ -182,6 +182,8 @@ set(FILES Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.h Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.cpp Editor/View/Widgets/ScriptCanvasNodePaletteToolbar.ui + Editor/View/Widgets/SourceHandlePropertyAssetCtrl.h + Editor/View/Widgets/SourceHandlePropertyAssetCtrl.cpp Editor/View/Widgets/WidgetBus.h Editor/View/Widgets/DataTypePalette/DataTypePaletteModel.cpp Editor/View/Widgets/DataTypePalette/DataTypePaletteModel.h From c36d827fc5481c9f8924eb6efaa006dbf2eb0116 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Fri, 19 Nov 2021 14:58:01 -0600 Subject: [PATCH 070/948] Updated Script Canvas component to use source handle property. Signed-off-by: Chris Galvan --- .../Components/EditorScriptCanvasComponent.cpp | 9 +++++++-- .../Components/EditorScriptCanvasComponent.h | 2 +- .../Code/Include/ScriptCanvas/Core/Core.cpp | 12 ------------ 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index 3b495f6822..4d870ebca3 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -193,7 +193,12 @@ namespace ScriptCanvasEditor ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("Level", 0x9aeacc13)) ->Attribute(AZ::Edit::Attributes::HelpPageURL, "https://o3de.org/docs/user-guide/components/reference/scripting/script-canvas/") ->DataElement(AZ::Edit::UIHandlers::Default, &EditorScriptCanvasComponent::m_sourceHandle, "Script Canvas Source File", "Script Canvas source file associated with this component") - ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) + ->Attribute("BrowseIcon", ":/stylesheet/img/UI20/browse-edit-select-files.svg") + ->Attribute("EditButton", "") + ->Attribute("EditDescription", "Open in Script Canvas Editor") + ->Attribute("EditCallback", &EditorScriptCanvasComponent::OpenEditor) + ->Attribute(AZ::Edit::Attributes::AssetPickerTitle, "Script Canvas") + ->Attribute(AZ::Edit::Attributes::SourceAssetFilterPattern, "*.scriptcanvas") ->DataElement(AZ::Edit::UIHandlers::Default, &EditorScriptCanvasComponent::m_variableOverrides, "Properties", "Script Canvas Graph Properties") ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) ; @@ -227,7 +232,7 @@ namespace ScriptCanvasEditor SetName(m_sourceHandle.Path().Filename().Native()); } - void EditorScriptCanvasComponent::OpenEditor() + void EditorScriptCanvasComponent::OpenEditor(const AZ::Data::AssetId&, const AZ::Data::AssetType&) { AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h index 38a84bc75e..c496c91a18 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h @@ -68,7 +68,7 @@ namespace ScriptCanvasEditor ScriptCanvas::GraphIdentifier GetGraphIdentifier() const override; //===================================================================== - void OpenEditor(); + void OpenEditor(const AZ::Data::AssetId&, const AZ::Data::AssetType&); void SetName(AZStd::string_view name) { m_name = name; } const AZStd::string& GetName() const; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp index ae85dbc6a9..ef1feae71a 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp @@ -279,18 +279,6 @@ namespace ScriptCanvasEditor ->Field("id", &SourceHandle::m_id) ->Field("path", &SourceHandle::m_path) ; - - if (AZ::EditContext* editContext = serializeContext->GetEditContext()) - { - editContext->Class("Script Canvas Source Handle", "References a source editor file") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::Category, "Scripting") - ->Attribute(AZ::Edit::Attributes::Icon, "Icons/ScriptCanvas/ScriptCanvas.svg") - ->Attribute(AZ::Edit::Attributes::ViewportIcon, "Icons/ScriptCanvas/Viewport/ScriptCanvas.svg") - ->Attribute(AZ::Edit::Attributes::AutoExpand, true) - ->DataElement(AZ::Edit::UIHandlers::Default, &SourceHandle::m_path); - ; - } } } From 31304ee9b180895b9a20d81554e72bb28c416a6c Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Fri, 19 Nov 2021 15:03:49 -0600 Subject: [PATCH 071/948] Fixed issue when clearing out source handle property. Signed-off-by: Chris Galvan --- .../View/Widgets/SourceHandlePropertyAssetCtrl.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.cpp index 66b9b77bdf..4d5cbd91fc 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.cpp @@ -119,7 +119,15 @@ namespace ScriptCanvasEditor (void)node; auto sourceHandle = SourceHandle(nullptr, {}, GUI->GetSelectedSourcePath()); - instance = property_t(*CompleteDescription(sourceHandle)); + auto completeSourceHandle = CompleteDescription(sourceHandle); + if (completeSourceHandle) + { + instance = property_t(*CompleteDescription(sourceHandle)); + } + else + { + instance = property_t(); + } } bool SourceHandlePropertyHandler::ReadValuesIntoGUI(size_t index, SourceHandlePropertyAssetCtrl* GUI, const property_t& instance, AzToolsFramework::InstanceDataNode* node) From 805bd8ef56ee6181a7b966e837b32289b8659a9b Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Fri, 19 Nov 2021 12:22:12 -0800 Subject: [PATCH 072/948] fix graph tab selection: Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Builder/ScriptCanvasBuilder.cpp | 15 +++++-- .../EditorScriptCanvasComponent.cpp | 40 +++++++++++++++---- .../Components/EditorScriptCanvasComponent.h | 3 +- .../Code/Editor/View/Widgets/GraphTabBar.cpp | 10 +---- 4 files changed, 47 insertions(+), 21 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp index 0eb748b2f1..a75b68b518 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp @@ -39,10 +39,19 @@ namespace ScriptCanvasBuilder void BuildVariableOverrides::CopyPreviousOverriddenValues(const BuildVariableOverrides& source) { - auto copyPreviousIfFound = [](ScriptCanvas::GraphVariable& overriddenValue, const AZStd::vector& source) + auto isEqual = [](const ScriptCanvas::GraphVariable& overrideValue, const ScriptCanvas::GraphVariable& candidate) { - if (auto iter = AZStd::find_if(source.begin(), source.end(), [&overriddenValue](const auto& candidate) { return candidate.GetVariableId() == overriddenValue.GetVariableId(); }); - iter != source.end()) + return candidate.GetVariableId() == overrideValue.GetVariableId() + || (candidate.GetVariableName() == overrideValue.GetVariableName() + && candidate.GetDataType() == overrideValue.GetDataType()); + }; + + auto copyPreviousIfFound = [isEqual](ScriptCanvas::GraphVariable& overriddenValue, const AZStd::vector& source) + { + auto iter = AZStd::find_if(source.begin(), source.end() + , [&overriddenValue, isEqual](const auto& candidate) { return isEqual(candidate, overriddenValue); }); + + if (iter != source.end()) { overriddenValue.DeepCopy(*iter); overriddenValue.SetScriptInputControlVisibility(AZ::Edit::PropertyVisibility::Hide); diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index 3b495f6822..27b03874ae 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -394,7 +394,7 @@ namespace ScriptCanvasEditor { if (auto loaded = LoadFromFile(assetId.Path().c_str()); loaded.IsSuccess()) { - OnScriptCanvasAssetReady(loaded.GetValue()); + UpdatePropertyDisplay(loaded.GetValue()); } } @@ -421,14 +421,38 @@ namespace ScriptCanvasEditor } } - void EditorScriptCanvasComponent::SourceFileChanged(AZStd::string /*relativePath*/, AZStd::string /*scanFolder*/, AZ::Uuid /*fileAssetId*/) - {} + void EditorScriptCanvasComponent::SourceFileChanged([[maybe_unused]] AZStd::string relativePath + , [[maybe_unused]] AZStd::string scanFolder, [[maybe_unused]] AZ::Uuid fileAssetId) + { + if (fileAssetId == m_sourceHandle.Id()) + { + if (auto handle = CompleteDescription(SourceHandle(nullptr, fileAssetId, {}))) + { + // consider queueing on tick bus + OnScriptCanvasAssetChanged(*handle); + } + } + } - void EditorScriptCanvasComponent::SourceFileRemoved(AZStd::string /*relativePath*/, AZStd::string /*scanFolder*/, AZ::Uuid /*fileAssetId*/) - {} + void EditorScriptCanvasComponent::SourceFileRemoved([[maybe_unused]] AZStd::string relativePath + , [[maybe_unused]] AZStd::string scanFolder, [[maybe_unused]] AZ::Uuid fileAssetId) + { + if (fileAssetId == m_sourceHandle.Id()) + { + m_removedHandle = m_sourceHandle; + OnScriptCanvasAssetChanged(m_removedHandle); + } + } - void EditorScriptCanvasComponent::SourceFileFailed(AZStd::string /*relativePath*/, AZStd::string /*scanFolder*/, AZ::Uuid /*fileAssetId*/) - {} + void EditorScriptCanvasComponent::SourceFileFailed([[maybe_unused]] AZStd::string relativePath + , [[maybe_unused]] AZStd::string scanFolder, [[maybe_unused]] AZ::Uuid fileAssetId) + { + if (fileAssetId == m_sourceHandle.Id()) + { + m_removedHandle = m_sourceHandle; + OnScriptCanvasAssetChanged(m_removedHandle); + } + } bool EditorScriptCanvasComponent::HasAssetId() const { @@ -442,7 +466,7 @@ namespace ScriptCanvasEditor return ScriptCanvas::GraphIdentifier(m_sourceHandle.Id(), 0); } - void EditorScriptCanvasComponent::OnScriptCanvasAssetReady(const SourceHandle& sourceHandle) + void EditorScriptCanvasComponent::UpdatePropertyDisplay(const SourceHandle& sourceHandle) { if (sourceHandle.IsValid()) { diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h index 38a84bc75e..f9ea8b08e5 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h @@ -45,7 +45,6 @@ namespace ScriptCanvasEditor AZ_COMPONENT(EditorScriptCanvasComponent, "{C28E2D29-0746-451D-A639-7F113ECF5D72}", AzToolsFramework::Components::EditorComponentBase); EditorScriptCanvasComponent(); - // EditorScriptCanvasComponent(AZ::Data::Asset asset); EditorScriptCanvasComponent(const SourceHandle& sourceHandle); ~EditorScriptCanvasComponent() override; @@ -130,7 +129,7 @@ namespace ScriptCanvasEditor void UpdateName(); //===================================================================== - void OnScriptCanvasAssetReady(const SourceHandle& sourceHandle); + void UpdatePropertyDisplay(const SourceHandle& sourceHandle); //===================================================================== void BuildGameEntityData(); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp index 1dfb27ce63..cc43098ad4 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp @@ -181,11 +181,6 @@ namespace ScriptCanvasEditor return false; } -// void GraphTabBar::ConfigureTab(int /*tabIndex*/, ScriptCanvasEditor::SourceHandle fileAssetId, const AZStd::string& tabName) -// { -// -// } - int GraphTabBar::FindTab(ScriptCanvasEditor::SourceHandle assetId) const { for (int tabIndex = 0; tabIndex < count(); ++tabIndex) @@ -451,10 +446,9 @@ namespace ScriptCanvasEditor return; } - auto assetId = tabdata.value(); + auto assetId = tabdata.value().m_assetId; - // #sc_editor_asset - // ScriptCanvasEditor::GeneralRequestBus::Broadcast(&ScriptCanvasEditor::GeneralRequests::OnChangeActiveGraphTab, assetId); + ScriptCanvasEditor::GeneralRequestBus::Broadcast(&ScriptCanvasEditor::GeneralRequests::OnChangeActiveGraphTab, assetId); if (m_signalSaveOnChangeTo >= 0 && m_signalSaveOnChangeTo == index) { From ca5424dd7b25a6f1f39aa33ad43e908d83d33612 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Fri, 19 Nov 2021 16:20:54 -0600 Subject: [PATCH 073/948] Fixed asset completer model for source handle picker. Signed-off-by: Chris Galvan --- .../Model/AssetCompleterModel.cpp | 21 ++++++++++++++----- .../Model/AssetCompleterModel.h | 5 +++++ .../UI/PropertyEditor/PropertyAssetCtrl.hxx | 6 +++--- .../Widgets/SourceHandlePropertyAssetCtrl.cpp | 20 ++++++++++++++++++ .../Widgets/SourceHandlePropertyAssetCtrl.h | 4 ++++ 5 files changed, 48 insertions(+), 8 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.cpp index 81f0cb36af..40f3b7063e 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.cpp @@ -125,9 +125,6 @@ namespace AzToolsFramework int rows = m_assetBrowserFilterModel->rowCount(index); if (rows == 0) { - if (index != QModelIndex()) { - AZ_Error("AssetCompleterModel", false, "No children detected in FetchResources()"); - } return; } @@ -136,7 +133,7 @@ namespace AzToolsFramework QModelIndex childIndex = m_assetBrowserFilterModel->index(i, 0, index); AssetBrowserEntry* childEntry = GetAssetEntry(m_assetBrowserFilterModel->mapToSource(childIndex)); - if (childEntry->GetEntryType() == AssetBrowserEntry::AssetEntryType::Product) + if (childEntry->GetEntryType() == m_entryType) { ProductAssetBrowserEntry* productEntry = static_cast(childEntry); AZStd::string assetName; @@ -172,7 +169,6 @@ namespace AzToolsFramework return m_assets[index.row()].m_displayName; } - const AZ::Data::AssetId AssetCompleterModel::GetAssetIdFromIndex(const QModelIndex& index) { if (!index.isValid()) @@ -182,4 +178,19 @@ namespace AzToolsFramework return m_assets[index.row()].m_assetId; } + + const AZStd::string_view AssetCompleterModel::GetPathFromIndex(const QModelIndex& index) + { + if (!index.isValid()) + { + return ""; + } + + return m_assets[index.row()].m_path; + } + + void AssetCompleterModel::SetFetchEntryType(AssetBrowserEntry::AssetEntryType entryType) + { + m_entryType = entryType; + } } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.h b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.h index 03660e8fa9..4596d70657 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.h @@ -40,6 +40,9 @@ namespace AzToolsFramework const AZStd::string_view GetNameFromIndex(const QModelIndex& index); const AZ::Data::AssetId GetAssetIdFromIndex(const QModelIndex& index); + const AZStd::string_view GetPathFromIndex(const QModelIndex& index); + + void SetFetchEntryType(AssetBrowserEntry::AssetEntryType entryType); private: struct AssetItem @@ -58,6 +61,8 @@ namespace AzToolsFramework AZStd::vector m_assets; //! String that will be highlighted in the suggestions QString m_highlightString; + + AssetBrowserEntry::AssetEntryType m_entryType = AssetBrowserEntry::AssetEntryType::Product; }; } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.hxx b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.hxx index 403725a429..d6ff1b8de6 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.hxx +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.hxx @@ -175,10 +175,11 @@ namespace AzToolsFramework virtual void SetFolderSelection(const AZStd::string& /* folderPath */) {} virtual void ClearAssetInternal(); - void ConfigureAutocompleter(); + virtual void ConfigureAutocompleter(); void RefreshAutocompleter(); void EnableAutocompleter(); void DisableAutocompleter(); + const QModelIndex GetSourceIndex(const QModelIndex& index); void HandleFieldClear(); AZStd::string AddDefaultSuffix(const AZStd::string& filename); @@ -242,13 +243,12 @@ namespace AzToolsFramework virtual void OnEditButtonClicked(); void OnThumbnailClicked(); void OnCompletionModelReset(); - void OnAutocomplete(const QModelIndex& index); + virtual void OnAutocomplete(const QModelIndex& index); void OnTextChange(const QString& text); void OnReturnPressed(); void ShowContextMenu(const QPoint& pos); private: - const QModelIndex GetSourceIndex(const QModelIndex& index); void UpdateThumbnail(); }; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.cpp index 4d5cbd91fc..04f7d79da5 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.cpp @@ -13,6 +13,7 @@ #include #include +#include #include namespace ScriptCanvasEditor @@ -61,6 +62,20 @@ namespace ScriptCanvasEditor PropertyAssetCtrl::ClearAssetInternal(); } + void SourceHandlePropertyAssetCtrl::ConfigureAutocompleter() + { + if (m_completerIsConfigured) + { + return; + } + + AzToolsFramework::PropertyAssetCtrl::ConfigureAutocompleter(); + + AssetSelectionModel selection = GetAssetSelectionModel(); + m_model->SetFetchEntryType(AssetBrowserEntry::AssetEntryType::Source); + m_model->SetFilter(selection.GetDisplayFilter()); + } + void SourceHandlePropertyAssetCtrl::SetSourceAssetFilterPattern(const QString& filterPattern) { m_sourceAssetFilterPattern = filterPattern; @@ -86,6 +101,11 @@ namespace ScriptCanvasEditor emit OnAssetIDChanged(AZ::Data::AssetId()); } + void SourceHandlePropertyAssetCtrl::OnAutocomplete(const QModelIndex& index) + { + SetSelectedSourcePath(m_model->GetPathFromIndex(GetSourceIndex(index))); + } + QWidget* SourceHandlePropertyHandler::CreateGUI(QWidget* pParent) { SourceHandlePropertyAssetCtrl* newCtrl = aznew SourceHandlePropertyAssetCtrl(pParent); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.h index 31a62aacfb..f54279e59c 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.h @@ -29,12 +29,16 @@ namespace ScriptCanvasEditor AzToolsFramework::AssetBrowser::AssetSelectionModel GetAssetSelectionModel() override; void PopupAssetPicker() override; void ClearAssetInternal() override; + void ConfigureAutocompleter() override; void SetSourceAssetFilterPattern(const QString& filterPattern); AZ::IO::Path GetSelectedSourcePath() const; void SetSelectedSourcePath(const AZ::IO::Path& sourcePath); + public Q_SLOTS: + void OnAutocomplete(const QModelIndex& index) override; + private: //! A regular expression pattern for filtering by source assets //! If this is set, the PropertyAssetCtrl will be dealing with source assets From d9f849b03e1826aa8c12c262e181e1b87389591a Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Mon, 22 Nov 2021 11:03:37 -0800 Subject: [PATCH 074/948] File state change include external delete detection Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Asset/EditorAssetSystemComponent.cpp | 50 ++-- .../Builder/ScriptCanvasBuilderWorker.cpp | 51 ---- .../Assets/ScriptCanvasAssetTracker.cpp | 44 --- .../Editor/Assets/ScriptCanvasAssetTracker.h | 6 +- .../Assets/ScriptCanvasAssetTrackerBus.h | 1 + .../ScriptCanvasAssetTrackerDefinitions.h | 12 - .../Editor/Assets/ScriptCanvasMemoryAsset.h | 2 + .../EditorScriptCanvasComponent.cpp | 2 +- .../Code/Editor/Components/EditorUtils.cpp | 49 ++-- .../FunctionNodeDescriptorComponent.cpp | 3 +- .../Include/ScriptCanvas/Bus/RequestBus.h | 16 +- .../Components/EditorScriptCanvasComponent.h | 8 +- .../ScriptCanvas/Components/EditorUtils.h | 3 + .../Code/Editor/View/Widgets/GraphTabBar.cpp | 9 +- .../Code/Editor/View/Widgets/GraphTabBar.h | 6 +- .../LoggingPanel/LoggingWindowSession.cpp | 9 +- .../UnitTestPanel/UnitTestDockWidget.cpp | 5 +- .../Code/Editor/View/Windows/MainWindow.cpp | 261 +++++++----------- .../Code/Editor/View/Windows/MainWindow.h | 27 +- .../Tools/UpgradeTool/UpgradeHelper.cpp | 2 +- .../Code/Include/ScriptCanvas/Core/Core.cpp | 8 +- .../Code/Include/ScriptCanvas/Core/Core.h | 2 - 22 files changed, 216 insertions(+), 360 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp index 3515eaf34f..1f614a5a87 100644 --- a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp @@ -107,11 +107,15 @@ namespace ScriptCanvasEditor return ScriptCanvasBuilder::CreateLuaAsset(editAsset, graphPathForRawLuaFile); } - void EditorAssetSystemComponent::AddSourceFileOpeners([[maybe_unused]] const char* fullSourceFileName, [[maybe_unused]] const AZ::Uuid& sourceUuid, [[maybe_unused]] AzToolsFramework::AssetBrowser::SourceFileOpenerList& openers) + void EditorAssetSystemComponent::AddSourceFileOpeners + ( [[maybe_unused]] const char* fullSourceFileName + , const AZ::Uuid& sourceUuid + , AzToolsFramework::AssetBrowser::SourceFileOpenerList& openers) { using namespace AzToolsFramework; using namespace AzToolsFramework::AssetBrowser; - if (const SourceAssetBrowserEntry* source = SourceAssetBrowserEntry::GetSourceByUuid(sourceUuid)) // get the full details of the source file based on its UUID. + // get the full details of the source file based on its UUID. + if (const SourceAssetBrowserEntry* source = SourceAssetBrowserEntry::GetSourceByUuid(sourceUuid)) { if (!HandlesSource(source)) { @@ -123,23 +127,31 @@ namespace ScriptCanvasEditor // has no UUID / Not a source file. return; } - // You can push back any number of "Openers" - choose a unique identifier, and icon, and then a lambda which will be activated if the user chooses to open it with your opener: - // #sc_editor_asset - // openers.push_back({ "ScriptCanvas_Editor_Asset_Edit", "Script Canvas Editor...", QIcon(), -// [](const char*, const AZ::Uuid& scSourceUuid) -// { -// AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); -// AZ::Data::AssetId sourceAssetId(scSourceUuid, 0); -// -// auto& assetManager = AZ::Data::AssetManager::Instance(); -// AZ::Data::Asset scriptCanvasAsset = assetManager.GetAsset(sourceAssetId, azrtti_typeid(), AZ::Data::AssetLoadBehavior::Default); -// AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); -// GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, scriptCanvasAsset.GetId(), -1); -// if (!openOutcome) -// { -// AZ_Warning("Script Canvas", openOutcome, "%s", openOutcome.GetError().data()); -// } -// } }); + // You can push back any number of "Openers" - choose a unique identifier, and icon, + // and then a lambda which will be activated if the user chooses to open it with your opener: + + openers.push_back({ "ScriptCanvas_Editor_Asset_Edit", "Script Canvas Editor..." + , QIcon(ScriptCanvasAssetDescription().GetIconPathImpl()), + [](const char*, const AZ::Uuid& scSourceUuid) + { + AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); + + if (auto sourceHandle = CompleteDescription(SourceHandle(nullptr, scSourceUuid, {}))) + { + AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); + GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset + , *sourceHandle, Tracker::ScriptCanvasFileState::UNMODIFIED, -1); + if (!openOutcome) + { + AZ_Warning("ScriptCanvas", openOutcome, "%s", openOutcome.GetError().data()); + } + } + else + { + AZ_Warning("ScriptCanvas", false + , "Unabled to find full path for Source UUid %s", scSourceUuid.ToString().c_str()); + } + }}); } } diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp index faad1871ac..bf98e62b71 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp @@ -60,57 +60,6 @@ namespace ScriptCanvasBuilder graphData = sourceGraph->GetGraphDataConst(); } -#if defined(EDITOR_ASSET_SUPPORT_ENABLED) - if (graphData == nullptr) - { - if (!m_editorAssetHandler) - { - AZ_Error(s_scriptCanvasBuilder, false, R"(CreateJobs for %s failed because the ScriptCanvas Editor Asset handler is missing.)", fullPath.data()); - } - - AZStd::shared_ptr assetDataStream = AZStd::make_shared(); - - AZ::IO::FileIOStream stream(fullPath.c_str(), AZ::IO::OpenMode::ModeRead); - if (!AZ::IO::RetryOpenStream(stream)) - { - AZ_Warning(s_scriptCanvasBuilder, false, "CreateJobs for \"%s\" failed because the source file could not be opened.", fullPath.data()); - return; - } - - // Read the asset into a memory buffer, then hand ownership of the buffer to assetDataStream - { - AZ::IO::FileIOStream ioStream; - if (!ioStream.Open(fullPath.data(), AZ::IO::OpenMode::ModeRead)) - { - 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()) - { - AZ_Warning(s_scriptCanvasBuilder, false, AZStd::string::format("File failed to read completely: %s", fullPath.data()).c_str()); - return; - } - - assetDataStream->Open(AZStd::move(fileBuffer)); - } - - m_processEditorAssetDependencies.clear(); - - asset.Create(AZ::Data::AssetId(AZ::Uuid::CreateRandom())); - if (m_editorAssetHandler->LoadAssetDataFromStream(asset, assetDataStream, {}) != AZ::Data::AssetHandler::LoadResult::LoadComplete) - { - AZ_Warning(s_scriptCanvasBuilder, false, "CreateJobs for \"%s\" failed because the asset data could not be loaded from the file", fullPath.data()); - return; - } - - sourceGraph = AZ::EntityUtils::FindFirstDerivedComponent(asset.Get()->GetScriptCanvasEntity()); - graphData = sourceGraph->GetGraphDataConst(); - } -#endif - AZ_Assert(sourceGraph, "Graph component is missing from entity."); AZ_Assert(graphData, "GraphData is missing from entity"); diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.cpp index 513dc6afe5..5ec620a907 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.cpp @@ -541,48 +541,4 @@ namespace ScriptCanvasEditor return AZ::EntityId(); } - void AssetTracker::OnAssetReady(const ScriptCanvasMemoryAsset* asset) - { - AZ::Data::AssetId assetId = CheckAssetId(asset->GetId()); - - auto assetInUseIter = m_assetsInUse.find(assetId); - if (assetInUseIter != m_assetsInUse.end()) - { - AssetTrackerNotificationBus::Broadcast(&AssetTrackerNotifications::OnAssetReady, assetInUseIter->second); - } - } - - void AssetTracker::OnAssetReloaded(const ScriptCanvasMemoryAsset* asset) - { - AZ::Data::AssetId assetId = CheckAssetId(asset->GetId()); - - auto assetInUseIter = m_assetsInUse.find(assetId); - if (assetInUseIter != m_assetsInUse.end()) - { - AssetTrackerNotificationBus::Broadcast(&AssetTrackerNotifications::OnAssetReloaded, assetInUseIter->second); - } - } - - void AssetTracker::OnAssetSaved(const ScriptCanvasMemoryAsset* asset, bool isSuccessful) - { - AZ::Data::AssetId assetId = CheckAssetId(asset->GetId()); - - auto assetInUseIter = m_assetsInUse.find(assetId); - if (assetInUseIter != m_assetsInUse.end()) - { - AssetTrackerNotificationBus::Broadcast(&AssetTrackerNotifications::OnAssetSaved, assetInUseIter->second, isSuccessful); - } - } - - void AssetTracker::OnAssetError(const ScriptCanvasMemoryAsset* asset) - { - AZ::Data::AssetId assetId = CheckAssetId(asset->GetId()); - - auto assetInUseIter = m_assetsInUse.find(assetId); - if (assetInUseIter != m_assetsInUse.end()) - { - AssetTrackerNotificationBus::Broadcast(&AssetTrackerNotifications::OnAssetError, assetInUseIter->second); - } - } - } diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.h b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.h index b55e5c06c8..247aba3b94 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.h +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.h @@ -16,6 +16,7 @@ #include #include +#include namespace ScriptCanvasEditor @@ -122,10 +123,5 @@ namespace ScriptCanvasEditor // Invoked when an asset is loaded from file and becomes ready Callbacks::OnAssetReadyCallback m_onAssetReadyCallback; - // Internal::MemoryAssetNotificationBus - void OnAssetReady(const ScriptCanvasMemoryAsset* asset) override; - void OnAssetReloaded(const ScriptCanvasMemoryAsset* asset) override; - void OnAssetSaved(const ScriptCanvasMemoryAsset* asset, bool isSuccessful) override; - void OnAssetError(const ScriptCanvasMemoryAsset* asset) override; }; } diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerBus.h b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerBus.h index 3fecb0aac9..fd50b40768 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerBus.h +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerBus.h @@ -17,6 +17,7 @@ #include #include +#include class QWidget; diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerDefinitions.h b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerDefinitions.h index 29f88b33c8..73507112c2 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerDefinitions.h +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerDefinitions.h @@ -24,17 +24,5 @@ namespace ScriptCanvasEditor using OnAssetCreatedCallback = OnAssetReadyCallback; } - namespace Tracker - { - enum class ScriptCanvasFileState : AZ::s32 - { - NEW, - MODIFIED, - UNMODIFIED, - // #sc_editor_asset restore this - SOURCE_REMOVED, - INVALID = -1 - }; - } } diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.h b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.h index d7f6ae87b6..6eecc5e04f 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.h +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.h @@ -29,6 +29,8 @@ #include #include +#include + namespace ScriptCanvasEditor { diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index 27b03874ae..b4d8593a87 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -235,7 +235,7 @@ namespace ScriptCanvasEditor if (m_sourceHandle.IsValid()) { - GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, m_sourceHandle, -1); + GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, m_sourceHandle, Tracker::ScriptCanvasFileState::UNMODIFIED, -1); if (!openOutcome) { diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp index 9b83acefa5..adf5035dbd 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp @@ -35,37 +35,46 @@ namespace ScriptCanvasEditor { if (source.IsValidDescription()) { - return source.Describe(); + return source; } - AZStd::string watchFolder; - AZ::Data::AssetInfo assetInfo; - bool sourceInfoFound{}; - - if (!source.Id().IsNull()) + AzToolsFramework::AssetSystemRequestBus::Events* assetSystem = AzToolsFramework::AssetSystemRequestBus::FindFirstHandler(); + if (assetSystem) { - AzToolsFramework::AssetSystemRequestBus::BroadcastResult - ( sourceInfoFound - , &AzToolsFramework::AssetSystemRequestBus::Events::GetSourceInfoBySourceUUID, source.Id(), assetInfo, watchFolder); + AZStd::string watchFolder; + AZ::Data::AssetInfo assetInfo; - if (sourceInfoFound && !assetInfo.m_relativePath.empty()) + if (!source.Id().IsNull()) { - return SourceHandle(nullptr, assetInfo.m_assetId.m_guid, assetInfo.m_relativePath); - } - } + if (assetSystem->GetSourceInfoBySourceUUID(source.Id(), assetInfo, watchFolder)) + { + AZ::IO::Path watchPath(watchFolder); + AZ::IO::Path assetInfoPath(assetInfo.m_relativePath); + SourceHandle fullPathHandle(nullptr, assetInfo.m_assetId.m_guid, watchPath / assetInfoPath); - if (!source.Path().empty()) - { - AzToolsFramework::AssetSystemRequestBus::BroadcastResult - ( sourceInfoFound - , &AzToolsFramework::AssetSystemRequestBus::Events::GetSourceInfoBySourcePath, source.Path().c_str(), assetInfo, watchFolder); + if (assetSystem->GetSourceInfoBySourcePath(fullPathHandle.Path().c_str(), assetInfo, watchFolder) && assetInfo.m_assetId.IsValid()) + { + if (assetInfo.m_assetId.m_guid != source.Id()) + { + AZ_TracePrintf("ScriptCanvas", "This is what I don't get"); + } - if (sourceInfoFound && assetInfo.m_assetId.IsValid()) + auto path = fullPathHandle.Path(); + return SourceHandle(source, assetInfo.m_assetId.m_guid, path.MakePreferred()); + } + } + } + + if (!source.Path().empty()) { - return SourceHandle(nullptr, assetInfo.m_assetId.m_guid, assetInfo.m_relativePath); + if (assetSystem->GetSourceInfoBySourcePath(source.Path().c_str(), assetInfo, watchFolder) && assetInfo.m_assetId.IsValid()) + { + return SourceHandle(source, assetInfo.m_assetId.m_guid, source.Path()); + } } } + return AZStd::nullopt; } diff --git a/Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/FunctionNodeDescriptorComponent.cpp b/Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/FunctionNodeDescriptorComponent.cpp index f649bb9f7d..f80c6dde21 100644 --- a/Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/FunctionNodeDescriptorComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/FunctionNodeDescriptorComponent.cpp @@ -97,7 +97,8 @@ namespace ScriptCanvasEditor } AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); - GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, SourceHandle( nullptr, assetInfo.m_assetId.m_guid, {} ), -1); + GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset + , SourceHandle( nullptr, assetInfo.m_assetId.m_guid, {} ), Tracker::ScriptCanvasFileState::UNMODIFIED, -1); return openOutcome.IsSuccess(); } diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h index 90468f5d8c..15600c2b88 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h @@ -47,6 +47,18 @@ namespace ScriptCanvasEditor struct CategoryInformation; struct NodePaletteModelInformation; + namespace Tracker + { + enum class ScriptCanvasFileState : AZ::s32 + { + NEW, + MODIFIED, + UNMODIFIED, + // #sc_editor_asset restore this + SOURCE_REMOVED, + INVALID = -1 + }; + } namespace Widget { @@ -68,8 +80,8 @@ namespace ScriptCanvasEditor //! Opens an existing graph and returns the tab index in which it was open in. //! \param File AssetId //! \return index of open tab if the asset was able to be open successfully or error message of why the open failed - virtual AZ::Outcome OpenScriptCanvasAsset(SourceHandle scriptCanvasAssetId, int tabIndex = -1) = 0; - virtual AZ::Outcome OpenScriptCanvasAssetId(const SourceHandle& scriptCanvasAsset) = 0; + virtual AZ::Outcome OpenScriptCanvasAsset(SourceHandle scriptCanvasAssetId, Tracker::ScriptCanvasFileState fileState, int tabIndex = -1) = 0; + virtual AZ::Outcome OpenScriptCanvasAssetId(const SourceHandle& scriptCanvasAsset, Tracker::ScriptCanvasFileState fileState) = 0; virtual int CloseScriptCanvasAsset(const SourceHandle&) = 0; diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h index f9ea8b08e5..ddd83d06ba 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h @@ -85,12 +85,7 @@ namespace ScriptCanvasEditor AZ::Data::AssetId GetAssetId() const override; //===================================================================== - //===================================================================== - // AssetTrackerNotificationBus - void OnAssetReady(const ScriptCanvasMemoryAsset::pointer asset) ; - void OnAssetSaved(const ScriptCanvasMemoryAsset::pointer asset, bool isSuccessful) ; - void OnAssetReloaded(const ScriptCanvasMemoryAsset::pointer asset) ; - //===================================================================== + //===================================================================== @@ -119,7 +114,6 @@ namespace ScriptCanvasEditor // complete the id, load call OnScriptCanvasAssetChanged void SourceFileChanged(AZStd::string relativePath, AZStd::string scanFolder, AZ::Uuid fileAssetId) override; - // update the display icon for failure, save the values in the graph void SourceFileRemoved(AZStd::string relativePath, AZStd::string scanFolder, AZ::Uuid fileAssetId) override; void SourceFileFailed(AZStd::string relativePath, AZStd::string scanFolder, AZ::Uuid fileAssetId) override; diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorUtils.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorUtils.h index 7685133ca4..0d27d255af 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorUtils.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorUtils.h @@ -21,6 +21,9 @@ namespace GraphCanvas namespace ScriptCanvasEditor { + // If only the Path or the Id is valid, attempts to fill in the missing piece. + // If both Path and Id is valid, including after correction, returns the handle including source Data, + // otherwise, returns null AZStd::optional CompleteDescription(const SourceHandle& source); class Graph; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp index cc43098ad4..2e0ace4768 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp @@ -46,9 +46,9 @@ namespace ScriptCanvasEditor connect(this, &QTabBar::customContextMenuRequested, this, &GraphTabBar::OnContextMenu); } - void GraphTabBar::AddGraphTab(ScriptCanvasEditor::SourceHandle assetId) + void GraphTabBar::AddGraphTab(ScriptCanvasEditor::SourceHandle assetId, Tracker::ScriptCanvasFileState fileState) { - InsertGraphTab(count(), assetId); + InsertGraphTab(count(), assetId, fileState); } void GraphTabBar::ClearTabView(int tabIndex) @@ -143,7 +143,7 @@ namespace ScriptCanvasEditor } } - int GraphTabBar::InsertGraphTab(int tabIndex, ScriptCanvasEditor::SourceHandle assetId) + int GraphTabBar::InsertGraphTab(int tabIndex, ScriptCanvasEditor::SourceHandle assetId, Tracker::ScriptCanvasFileState fileState) { if (!SelectTab(assetId)) { @@ -159,9 +159,6 @@ namespace ScriptCanvasEditor AzFramework::StringFunc::Path::GetFileName(assetId.Path().c_str(), tabName); metaData.m_name = tabName.c_str(); - // #sc_editor_asset filestate - Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::INVALID; - // AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, fileAssetId); SetTabText(tabIndex, tabName.c_str(), fileState); setTabData(tabIndex, QVariant::fromValue(metaData)); return tabIndex; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h index 48f327b244..9d86583f76 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h @@ -18,6 +18,8 @@ #include #include +#include + #endif class QGraphicsView; @@ -54,11 +56,11 @@ namespace ScriptCanvasEditor void SetTabData(const GraphTabMetadata& data, int index); void SetTabData(const GraphTabMetadata& data, ScriptCanvasEditor::SourceHandle assetId); - void AddGraphTab(ScriptCanvasEditor::SourceHandle assetId); + void AddGraphTab(ScriptCanvasEditor::SourceHandle assetId, Tracker::ScriptCanvasFileState fileState); void CloseTab(int index); void CloseAllTabs(); - int InsertGraphTab(int tabIndex, ScriptCanvasEditor::SourceHandle assetId); + int InsertGraphTab(int tabIndex, ScriptCanvasEditor::SourceHandle assetId, Tracker::ScriptCanvasFileState fileState); bool SelectTab(ScriptCanvasEditor::SourceHandle assetId); // void ConfigureTab(int tabIndex, ScriptCanvasEditor::SourceHandle fileAssetId, const AZStd::string& tabName); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowSession.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowSession.cpp index 2e712cef08..963be52edc 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowSession.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowSession.cpp @@ -256,7 +256,8 @@ namespace ScriptCanvasEditor const AZ::Data::AssetId& assetId = executionItem->GetAssetId(); - GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAssetId, SourceHandle(nullptr, assetId.m_guid, {})); + GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAssetId + , SourceHandle(nullptr, assetId.m_guid, {}), Tracker::ScriptCanvasFileState::UNMODIFIED); } } } @@ -272,10 +273,12 @@ namespace ScriptCanvasEditor bool isAssetOpen = false; GeneralRequestBus::BroadcastResult(isAssetOpen, &GeneralRequests::IsScriptCanvasAssetOpen, SourceHandle(nullptr, assetId.m_guid, {})); - GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAssetId, SourceHandle(nullptr, assetId.m_guid, {})); + GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAssetId + , SourceHandle(nullptr, assetId.m_guid, {}), Tracker::ScriptCanvasFileState::UNMODIFIED); AZ::EntityId graphCanvasGraphId; - GeneralRequestBus::BroadcastResult(graphCanvasGraphId, &GeneralRequests::FindGraphCanvasGraphIdByAssetId, SourceHandle(nullptr, assetId.m_guid, {})); + GeneralRequestBus::BroadcastResult(graphCanvasGraphId, &GeneralRequests::FindGraphCanvasGraphIdByAssetId + , SourceHandle(nullptr, assetId.m_guid, {})); if (isAssetOpen) { diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/UnitTestPanel/UnitTestDockWidget.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/UnitTestPanel/UnitTestDockWidget.cpp index a60c59ad7e..f319a166df 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/UnitTestPanel/UnitTestDockWidget.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/UnitTestPanel/UnitTestDockWidget.cpp @@ -433,7 +433,10 @@ namespace ScriptCanvasEditor AZ::Data::AssetId sourceAssetId(sourceUuid, 0); AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); - GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAssetId, ScriptCanvasEditor::SourceHandle(nullptr, sourceUuid, {})); + GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAssetId + , ScriptCanvasEditor::SourceHandle(nullptr, sourceUuid, {}) + , Tracker::ScriptCanvasFileState::UNMODIFIED); + if (!openOutcome) { AZ_Warning("Script Canvas", openOutcome, "%s", openOutcome.GetError().data()); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index ce4ee7638f..52c5b4c5d2 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -666,6 +666,7 @@ namespace ScriptCanvasEditor AzToolsFramework::ToolsApplicationNotificationBus::Handler::BusConnect(); AzToolsFramework::AssetSystemBus::Handler::BusConnect(); ScriptCanvas::ScriptCanvasSettingsRequestBus::Handler::BusConnect(); + AZ::SystemTickBus::Handler::BusConnect(); UINotificationBus::Broadcast(&UINotifications::MainWindowCreationEvent, this); @@ -1112,13 +1113,47 @@ namespace ScriptCanvasEditor RestartAutoTimerSave(forceTimer); } + void MainWindow::SourceFileChanged + ( [[maybe_unused]] AZStd::string relativePath + , AZStd::string scanFolder + , [[maybe_unused]] AZ::Uuid fileAssetId) + { + auto handle = CompleteDescription(SourceHandle(nullptr, fileAssetId, {})); + if (handle) + { + if (!IsRecentSave(*handle)) + { + UpdateFileState(*handle, Tracker::ScriptCanvasFileState::MODIFIED); + } + else + { + AZ_TracePrintf + ( "ScriptCanvas" + , "Ignoring source file modification notification (possibly external), as a it was recently saved by the editor: %s" + , relativePath.c_str()); + } + } + } + void MainWindow::SourceFileRemoved ( AZStd::string relativePath , [[maybe_unused]] AZStd::string scanFolder - , [[maybe_unused]] AZ::Uuid fileAssetId) + , AZ::Uuid fileAssetId) { - ScriptCanvasEditor::SourceHandle handle(nullptr, fileAssetId, relativePath); - UpdateFileState(handle, Tracker::ScriptCanvasFileState::SOURCE_REMOVED); + SourceHandle handle(nullptr, fileAssetId, relativePath); + { + if (!IsRecentSave(handle)) + { + UpdateFileState(handle, Tracker::ScriptCanvasFileState::SOURCE_REMOVED); + } + else + { + AZ_TracePrintf + ( "ScriptCanvas" + , "Ignoring source file removed notification (possibly external), as a it was recently saved by the editor: %s" + , relativePath.c_str()); + } + } } void MainWindow::SignalSceneDirty(ScriptCanvasEditor::SourceHandle assetId) @@ -1149,21 +1184,7 @@ namespace ScriptCanvasEditor m_tabBar->UpdateFileState(assetId, fileState); } - void MainWindow::RefreshScriptCanvasAsset(const AZ::Data::Asset& /*asset*/) - { - // #sc_editor_asset - /* - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, asset.GetId()); - - if (memoryAsset && asset.IsReady()) - { - - } - */ - } - - AZ::Outcome MainWindow::OpenScriptCanvasAssetId(const ScriptCanvasEditor::SourceHandle& fileAssetId) + AZ::Outcome MainWindow::OpenScriptCanvasAssetId(const ScriptCanvasEditor::SourceHandle& fileAssetId, Tracker::ScriptCanvasFileState fileState) { if (fileAssetId.Id().IsNull()) { @@ -1178,7 +1199,7 @@ namespace ScriptCanvasEditor return AZ::Success(outTabIndex); } - outTabIndex = CreateAssetTab(fileAssetId); + outTabIndex = CreateAssetTab(fileAssetId, fileState); if (!m_isRestoringWorkspace) { @@ -1188,7 +1209,7 @@ namespace ScriptCanvasEditor if (outTabIndex >= 0) { AddRecentFile(fileAssetId.Path().c_str()); - OpenScriptCanvasAssetImplementation(fileAssetId); + OpenScriptCanvasAssetImplementation(fileAssetId, fileState); return AZ::Success(outTabIndex); } else @@ -1197,7 +1218,7 @@ namespace ScriptCanvasEditor } } - AZ::Outcome MainWindow::OpenScriptCanvasAssetImplementation(const SourceHandle& scriptCanvasAsset, int tabIndex) + AZ::Outcome MainWindow::OpenScriptCanvasAssetImplementation(const SourceHandle& scriptCanvasAsset, Tracker::ScriptCanvasFileState fileState, int tabIndex) { const ScriptCanvasEditor::SourceHandle& fileAssetId = scriptCanvasAsset; if (!fileAssetId.IsValid()) @@ -1239,7 +1260,7 @@ namespace ScriptCanvasEditor return AZ::Success(outTabIndex); } - outTabIndex = CreateAssetTab(fileAssetId, tabIndex); + outTabIndex = CreateAssetTab(fileAssetId, fileState, tabIndex); if (outTabIndex == -1) { @@ -1259,21 +1280,21 @@ namespace ScriptCanvasEditor return AZ::Success(outTabIndex); } - AZ::Outcome MainWindow::OpenScriptCanvasAsset(ScriptCanvasEditor::SourceHandle scriptCanvasAssetId, int tabIndex) + AZ::Outcome MainWindow::OpenScriptCanvasAsset(ScriptCanvasEditor::SourceHandle scriptCanvasAssetId, Tracker::ScriptCanvasFileState fileState, int tabIndex) { if (scriptCanvasAssetId.IsValid()) { - return OpenScriptCanvasAssetImplementation(scriptCanvasAssetId, tabIndex); + return OpenScriptCanvasAssetImplementation(scriptCanvasAssetId, fileState, tabIndex); } else { - return OpenScriptCanvasAssetId(scriptCanvasAssetId); + return OpenScriptCanvasAssetId(scriptCanvasAssetId, fileState); } } - int MainWindow::CreateAssetTab(const ScriptCanvasEditor::SourceHandle& assetId, int tabIndex) + int MainWindow::CreateAssetTab(const ScriptCanvasEditor::SourceHandle& assetId, Tracker::ScriptCanvasFileState fileState, int tabIndex) { - return m_tabBar->InsertGraphTab(tabIndex, assetId); + return m_tabBar->InsertGraphTab(tabIndex, assetId, fileState); } void MainWindow::RemoveScriptCanvasAsset(const ScriptCanvasEditor::SourceHandle& assetId) @@ -1316,7 +1337,7 @@ namespace ScriptCanvasEditor { if (createdAssetPair.second == requestingEntityId) { - return OpenScriptCanvasAssetId(createdAssetPair.first).IsSuccess(); + return OpenScriptCanvasAssetId(createdAssetPair.first, Tracker::ScriptCanvasFileState::NEW).IsSuccess(); } } @@ -1355,33 +1376,6 @@ namespace ScriptCanvasEditor return m_nodePaletteModel.FindNodePaletteInformation(nodeType); } - void MainWindow::GetSuggestedFullFilenameToSaveAs(const ScriptCanvasEditor::SourceHandle& /*assetId*/, AZStd::string& /*filePath*/, AZStd::string& /*fileFilter*/) - { - // #sc_editor_asset -// -// ScriptCanvasMemoryAsset::pointer memoryAsset; -// AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); -// -// AZStd::string assetPath; -// if (memoryAsset) -// { -// assetPath = memoryAsset->GetAbsolutePath(); -// fileFilter = ScriptCanvasAssetDescription().GetFileFilterImpl(); -// -// AZStd::string tabName; -// AssetTrackerRequestBus::BroadcastResult(tabName, &AssetTrackerRequests::GetTabName, assetId); -// -// assetPath = AZStd::string::format("%s/%s%s" -// , ScriptCanvasAssetDescription().GetSuggestedSavePathImpl() -// , tabName.c_str() -// , ScriptCanvasAssetDescription().GetExtensionImpl()); -// } -// -// AZStd::array resolvedPath; -// AZ::IO::FileIOBase::GetInstance()->ResolvePath(assetPath.data(), resolvedPath.data(), resolvedPath.size()); -// filePath = resolvedPath.data(); - } - void MainWindow::OpenFile(const char* fullPath) { auto tabIndex = m_tabBar->FindTabByPath(fullPath); @@ -1418,7 +1412,7 @@ namespace ScriptCanvasEditor m_errorFilePath.clear(); auto activeGraph = ScriptCanvasEditor::SourceHandle(outcome.TakeValue(), assetInfo.m_assetId.m_guid, fullPath); - auto openOutcome = OpenScriptCanvasAsset(activeGraph); + auto openOutcome = OpenScriptCanvasAsset(activeGraph, Tracker::ScriptCanvasFileState::UNMODIFIED); if (openOutcome) { RunGraphValidation(false); @@ -1429,66 +1423,10 @@ namespace ScriptCanvasEditor { AZ_Warning("Script Canvas", openOutcome, "%s", openOutcome.GetError().data()); } - -#if defined(EDITOR_ASSET_SUPPORT_ENABLED) - /* - m_errorFilePath = fullPath; - - // Let's find the source file on disk - AZStd::string watchFolder; - AZ::Data::AssetInfo assetInfo; - bool sourceInfoFound{}; - AzToolsFramework::AssetSystemRequestBus::BroadcastResult(sourceInfoFound, &AzToolsFramework::AssetSystemRequestBus::Events::GetSourceInfoBySourcePath, fullPath, assetInfo, watchFolder); - - if (sourceInfoFound) - { - const Tracker::ScriptCanvasFileState& fileState = GetAssetFileState(assetInfo.m_assetId); - if (fileState != Tracker::ScriptCanvasFileState::NEW && fileState != Tracker::ScriptCanvasFileState::INVALID) - { - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetInfo.m_assetId); - - if (m_tabBar->FindTab(assetInfo.m_assetId) < 0) - { - CreateAssetTab(assetInfo.m_assetId); - } - - SetActiveAsset(memoryAsset->GetFileAssetId()); - OpenNextFile(); - return; - } - - Callbacks::OnAssetReadyCallback onAssetReady = [this, assetInfo](ScriptCanvasMemoryAsset&) - { - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetInfo.m_assetId); - - auto openOutcome = OpenScriptCanvasAsset(*memoryAsset); - if (openOutcome) - { - RunGraphValidation(false); - SetRecentAssetId(assetInfo.m_assetId); - } - else - { - AZ_Warning("Script Canvas", openOutcome, "%s", openOutcome.GetError().data()); - } - - OpenNextFile(); - }; - - // TODO-LS the assetInfo.m_assetType is always null for some reason, I know in this case we want default assets so it's ok to hardcode it - AssetTrackerRequestBus::Broadcast(&AssetTrackerRequests::Load, assetInfo.m_assetId, assetInfo.m_assetType, azrtti_typeid(), onAssetReady); - } - else - { - QMessageBox::warning(this, "Invalid Source Asset", QString("'%1' is not a valid asset path.").arg(fullPath), QMessageBox::Ok); - } - */ -#endif } - GraphCanvas::Endpoint MainWindow::HandleProposedConnection(const GraphCanvas::GraphId&, const GraphCanvas::ConnectionId&, const GraphCanvas::Endpoint& endpoint, const GraphCanvas::NodeId& nodeId, const QPoint& screenPoint) + GraphCanvas::Endpoint MainWindow::HandleProposedConnection(const GraphCanvas::GraphId&, const GraphCanvas::ConnectionId& + , const GraphCanvas::Endpoint& endpoint, const GraphCanvas::NodeId& nodeId, const QPoint& screenPoint) { GraphCanvas::Endpoint retVal; @@ -1633,7 +1571,7 @@ namespace ScriptCanvasEditor // Insert tab block AZStd::string tabName; AzFramework::StringFunc::Path::GetFileName(assetPath.data(), tabName); - m_tabBar->InsertGraphTab(tabIndex, assetId); + m_tabBar->InsertGraphTab(tabIndex, assetId, Tracker::ScriptCanvasFileState::NEW); if (!IsTabOpen(assetId, outTabIndex)) { @@ -1666,17 +1604,13 @@ namespace ScriptCanvasEditor ScriptCanvasEditor::SourceHandle handle = ScriptCanvasEditor::SourceHandle(graph, assetId, assetPath); outTabIndex = InsertTabForAsset(assetPath, handle, tabIndex); - m_tabBar->UpdateFileState(handle, Tracker::ScriptCanvasFileState::NEW); - + if (outTabIndex == -1) { return AZ::Failure(AZStd::string::format("Script Canvas Asset %.*s is not open in a tab", assetPath.data())); } SetActiveAsset(handle); - - // #sc_editor_asset delete candidate - PushPreventUndoStateUpdate(); AZ::EntityId scriptCanvasEntityId = graph->GetGraph()->GetScriptCanvasId(); @@ -1790,7 +1724,6 @@ namespace ScriptCanvasEditor } else { - // replaces GetSuggestedFullFilenameToSaveAs suggestedFileFilter = ScriptCanvasAssetDescription().GetExtensionImpl(); if (inMemoryAssetId.Path().empty()) @@ -1880,7 +1813,8 @@ namespace ScriptCanvasEditor void MainWindow::OnSaveCallBack(const VersionExplorer::FileSaveResult& result) { const bool saveSuccess = result.fileSaveError.empty(); - auto memoryAsset = m_fileSaver->GetSource(); + auto completeDescription = CompleteDescription(m_fileSaver->GetSource()); + auto memoryAsset = completeDescription ? *completeDescription : m_fileSaver->GetSource(); int saveTabIndex = m_tabBar->FindTab(memoryAsset); AZStd::string tabName = saveTabIndex >= 0 ? m_tabBar->tabText(saveTabIndex).toUtf8().data() : ""; @@ -2002,18 +1936,11 @@ namespace ScriptCanvasEditor const bool displayAsNotification = true; RunGraphValidation(displayAsNotification); - // This is called during saving, so the is saving flag is always true Need to update the state after this callback is complete. So schedule for next system tick. - AddSystemTickAction(SystemTickActionFlag::UpdateSaveMenuState); - - if (saveSuccess && m_closeCurrentGraphAfterSave) - { - AddSystemTickAction(SystemTickActionFlag::CloseCurrentGraph); - } - m_closeCurrentGraphAfterSave = false; EnableAssetView(memoryAsset); + UpdateSaveState(true); UnblockCloseRequests(); m_fileSaver.reset(); } @@ -2027,15 +1954,15 @@ namespace ScriptCanvasEditor void MainWindow::SaveAs(AZStd::string_view path, ScriptCanvasEditor::SourceHandle inMemoryAssetId) { DisableAssetView(inMemoryAssetId); - + UpdateSaveState(false); m_fileSaver = AZStd::make_unique ( nullptr , [this](const VersionExplorer::FileSaveResult& fileSaveResult) { OnSaveCallBack(fileSaveResult); }); - ScriptCanvasEditor::SourceHandle newLocation(inMemoryAssetId, {}, path); + ScriptCanvasEditor::SourceHandle newLocation(inMemoryAssetId, AZ::Uuid::CreateNull(), path); + MarkRecentSave(newLocation); m_fileSaver->Save(newLocation); - UpdateSaveState(); BlockCloseRequests(); } @@ -2827,7 +2754,6 @@ namespace ScriptCanvasEditor void MainWindow::OnActiveFileStateChanged() { - UpdateSaveState(); UpdateAssignToSelectionState(); } @@ -3457,7 +3383,6 @@ namespace ScriptCanvasEditor UpdateAssignToSelectionState(); UpdateUndoRedoState(); - UpdateSaveState(); } void MainWindow::OnWorkspaceRestoreStart() @@ -3535,25 +3460,10 @@ namespace ScriptCanvasEditor ui->action_Redo->setEnabled(isEnabled); } - void MainWindow::UpdateSaveState() + void MainWindow::UpdateSaveState(bool enabled) { - // #sc_editor_asset todo, consider making blocking -// bool enabled = m_activeGraph.IsValid(); -// bool isSaving = false; -// bool hasModifications = false; -// -// if (enabled) -// { -// Tracker::ScriptCanvasFileState fileState = GetAssetFileState(m_activeGraph); -// hasModifications = ( fileState == Tracker::ScriptCanvasFileState::MODIFIED -// || fileState == Tracker::ScriptCanvasFileState::NEW -// || fileState == Tracker::ScriptCanvasFileState::SOURCE_REMOVED); -// -// AssetTrackerRequestBus::BroadcastResult(isSaving, &AssetTrackerRequests::IsSaving, m_activeGraph); -// } -// -// ui->action_Save->setEnabled(enabled && !isSaving && hasModifications); -// ui->action_Save_As->setEnabled(enabled && !isSaving); + ui->action_Save->setEnabled(enabled); + ui->action_Save_As->setEnabled(enabled); } void MainWindow::CreateFunctionInput() @@ -4143,12 +4053,6 @@ namespace ScriptCanvasEditor qobject_cast(parent())->close(); } - if (HasSystemTickAction(SystemTickActionFlag::UpdateSaveMenuState)) - { - RemoveSystemTickAction(SystemTickActionFlag::UpdateSaveMenuState); - UpdateSaveState(); - } - if (HasSystemTickAction(SystemTickActionFlag::CloseCurrentGraph)) { RemoveSystemTickAction(SystemTickActionFlag::CloseCurrentGraph); @@ -4165,10 +4069,7 @@ namespace ScriptCanvasEditor CloseNextTab(); } - if (m_systemTickActions == 0) - { - AZ::SystemTickBus::Handler::BusDisconnect(); - } + ClearStaleSaves(); } void MainWindow::OnCommandStarted(AZ::Crc32) @@ -4395,11 +4296,6 @@ namespace ScriptCanvasEditor void MainWindow::AddSystemTickAction(SystemTickActionFlag action) { - if (!AZ::SystemTickBus::Handler::BusIsConnected()) - { - AZ::SystemTickBus::Handler::BusConnect(); - } - m_systemTickActions |= action; } @@ -4749,5 +4645,34 @@ namespace ScriptCanvasEditor UpdateUndoRedoState(); } + + void MainWindow::ClearStaleSaves() + { + AZStd::lock_guard lock(m_mutex); + auto timeNow = AZStd::chrono::system_clock::now(); + AZStd::erase_if(m_saves, [&timeNow](const auto& item) + { + AZStd::sys_time_t delta = AZStd::chrono::seconds(timeNow - item.second).count(); + return delta > 2.0f; + }); + } + + bool MainWindow::IsRecentSave(const SourceHandle& handle) const + { + AZStd::lock_guard lock(const_cast(this)->m_mutex); + AZStd::string key = handle.Path().Native(); + AZStd::to_lower(key.begin(), key.end()); + auto iter = m_saves.find(key); + return iter != m_saves.end(); + } + + void MainWindow::MarkRecentSave(const SourceHandle& handle) + { + AZStd::lock_guard lock(m_mutex); + AZStd::string key = handle.Path().Native(); + AZStd::to_lower(key.begin(), key.end()); + m_saves[key] = AZStd::chrono::system_clock::now(); + } + #include } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h index dfe5d9fa13..68488238ec 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h @@ -425,9 +425,9 @@ namespace ScriptCanvasEditor QVariant GetTabData(const SourceHandle& assetId); //! GeneralRequestBus - AZ::Outcome OpenScriptCanvasAssetId(const SourceHandle& assetId) override; - AZ::Outcome OpenScriptCanvasAsset(SourceHandle scriptCanvasAssetId, int tabIndex = -1) override; - AZ::Outcome OpenScriptCanvasAssetImplementation(const SourceHandle& sourceHandle, int tabIndex = -1); + AZ::Outcome OpenScriptCanvasAssetId(const SourceHandle& assetId, Tracker::ScriptCanvasFileState fileState) override; + AZ::Outcome OpenScriptCanvasAsset(SourceHandle scriptCanvasAssetId, Tracker::ScriptCanvasFileState fileState, int tabIndex = -1) override; + AZ::Outcome OpenScriptCanvasAssetImplementation(const SourceHandle& sourceHandle, Tracker::ScriptCanvasFileState fileState, int tabIndex = -1); int CloseScriptCanvasAsset(const SourceHandle& assetId) override; bool CreateScriptCanvasAssetFor(const TypeDefs::EntityComponentId& requestingEntityId) override; @@ -438,8 +438,7 @@ namespace ScriptCanvasEditor //// AZ::Outcome CreateScriptCanvasAsset(AZStd::string_view assetPath, int tabIndex = -1); - void RefreshScriptCanvasAsset(const AZ::Data::Asset& scriptCanvasAsset); - + //! Removes the assetId -> ScriptCanvasAsset mapping and disconnects from the asset tracker void RemoveScriptCanvasAsset(const ScriptCanvasEditor::SourceHandle& assetId); void OnChangeActiveGraphTab(ScriptCanvasEditor::SourceHandle) override; @@ -525,8 +524,9 @@ namespace ScriptCanvasEditor AZ::EntityId FindAssetNodeIdByEditorNodeId(const ScriptCanvasEditor::SourceHandle& assetId, AZ::EntityId editorNodeId) const override; private: + void SourceFileChanged(AZStd::string relativePath, AZStd::string scanFolder, AZ::Uuid fileAssetId) override; void SourceFileRemoved(AZStd::string relativePath, AZStd::string scanFolder, AZ::Uuid fileAssetId) override; - + void DeleteNodes(const AZ::EntityId& sceneId, const AZStd::vector& nodes) override; void DeleteConnections(const AZ::EntityId& sceneId, const AZStd::vector& connections) override; void DisconnectEndpoints(const AZ::EntityId& sceneId, const AZStd::vector& endpoints) override; @@ -549,11 +549,6 @@ namespace ScriptCanvasEditor void OnAutoSave(); - //! Helper function which serializes a file to disk - //! \param filename name of file to serialize the Entity - //! \param asset asset to save - void GetSuggestedFullFilenameToSaveAs(const ScriptCanvasEditor::SourceHandle& assetId, AZStd::string& filePath, AZStd::string& fileFilter); - void UpdateFileState(const ScriptCanvasEditor::SourceHandle& assetId, Tracker::ScriptCanvasFileState fileState); // QMainWindow @@ -599,14 +594,14 @@ namespace ScriptCanvasEditor void UpdateAssignToSelectionState(); void UpdateUndoRedoState(); - void UpdateSaveState(); + void UpdateSaveState(bool enabled); void CreateFunctionInput(); void CreateFunctionOutput(); void CreateFunctionDefinitionNode(int positionOffset); - int CreateAssetTab(const ScriptCanvasEditor::SourceHandle& assetId, int tabIndex = -1); + int CreateAssetTab(const ScriptCanvasEditor::SourceHandle& assetId, Tracker::ScriptCanvasFileState fileState, int tabIndex = -1); //! \param asset The AssetId of the ScriptCanvas Asset. void SetActiveAsset(const ScriptCanvasEditor::SourceHandle& assetId); @@ -767,5 +762,11 @@ namespace ScriptCanvasEditor AZStd::unique_ptr m_fileSaver; VersionExplorer::FileSaveResult m_fileSaveResult; void OnSaveCallBack(const VersionExplorer::FileSaveResult& result); + + void ClearStaleSaves(); + bool IsRecentSave(const SourceHandle& handle) const; + void MarkRecentSave(const SourceHandle& handle); + AZStd::recursive_mutex m_mutex; + AZStd::unordered_map m_saves; }; } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.cpp index 3522f3cfa2..c557a83f0c 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.cpp @@ -98,7 +98,7 @@ namespace ScriptCanvasEditor if (!asset.Path().empty()) { - GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, asset, -1); + GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, asset, Tracker::ScriptCanvasFileState::UNMODIFIED, -1); } if (!openOutcome) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp index ae85dbc6a9..1b24d2d12a 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp @@ -194,14 +194,18 @@ namespace ScriptCanvasEditor , m_id(id) , m_path(path) { - + m_path.MakePreferred(); + m_id = id; } SourceHandle::SourceHandle(ScriptCanvas::DataPtr graph, const AZ::Uuid& id, const AZ::IO::Path& path) : m_data(graph) , m_id(id) , m_path(path) - {} + { + m_path.MakePreferred(); + m_id = id; + } bool SourceHandle::AnyEquals(const SourceHandle& other) const { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h index d514683b55..8671197f7b 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h @@ -27,8 +27,6 @@ #define OBJECT_STREAM_EDITOR_ASSET_LOADING_SUPPORT_ENABLED -// #define EDITOR_ASSET_SUPPORT_ENABLED - namespace AZ { class Entity; From 23267fd862288ef59abc49bd9ce00cbcf7169677 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Mon, 22 Nov 2021 16:04:49 -0800 Subject: [PATCH 075/948] SC Editor serialization update in JSON Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Serialization/Json/BaseJsonSerializer.cpp | 16 +++++ .../Serialization/Json/BaseJsonSerializer.h | 7 +- .../Assets/ScriptCanvasFileHandling.cpp | 2 +- .../EditorScriptCanvasComponent.cpp | 33 ++++++--- .../Code/Editor/Components/EditorUtils.cpp | 2 +- .../Components/EditorScriptCanvasComponent.h | 3 + .../EditorScriptCanvasComponentSerializer.cpp | 55 +++++++++++++++ .../EditorScriptCanvasComponentSerializer.h | 31 +++++++++ .../Code/Editor/View/Widgets/GraphTabBar.cpp | 2 +- .../Code/Editor/View/Windows/MainWindow.cpp | 68 ++++++++++--------- .../Windows/Tools/UpgradeTool/Modifier.cpp | 4 +- .../Windows/Tools/UpgradeTool/Scanner.cpp | 2 +- .../Code/Include/ScriptCanvas/Core/Core.cpp | 10 +-- .../Code/Include/ScriptCanvas/Core/Core.h | 4 +- .../Code/scriptcanvasgem_editor_files.cmake | 2 + 15 files changed, 185 insertions(+), 56 deletions(-) create mode 100644 Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponentSerializer.cpp create mode 100644 Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponentSerializer.h diff --git a/Code/Framework/AzCore/AzCore/Serialization/Json/BaseJsonSerializer.cpp b/Code/Framework/AzCore/AzCore/Serialization/Json/BaseJsonSerializer.cpp index 7309955a1c..4f5657a328 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/Json/BaseJsonSerializer.cpp +++ b/Code/Framework/AzCore/AzCore/Serialization/Json/BaseJsonSerializer.cpp @@ -204,6 +204,22 @@ namespace AZ // BaseJsonSerializer // + JsonSerializationResult::Result BaseJsonSerializer::Load(void* outputValue, const Uuid& outputValueTypeId, const rapidjson::Value& inputValue, + JsonDeserializerContext& context) + { + JsonSerializationResult::ResultCode result(JsonSerializationResult::Tasks::ReadField); + result.Combine(ContinueLoading(outputValue, outputValueTypeId, inputValue, context, ContinuationFlags::IgnoreTypeSerializer)); + return context.Report(result, "Ignoring custom serialization during load"); + } + + JsonSerializationResult::Result BaseJsonSerializer::Store(rapidjson::Value& outputValue, const void* inputValue, const void* defaultValue, + const Uuid& valueTypeId, JsonSerializerContext& context) + { + JsonSerializationResult::ResultCode result(JsonSerializationResult::Tasks::WriteValue); + result.Combine(ContinueStoring(outputValue, inputValue, defaultValue, valueTypeId, context, ContinuationFlags::IgnoreTypeSerializer)); + return context.Report(result, "Ignoring custom serialization during store"); + } + BaseJsonSerializer::OperationFlags BaseJsonSerializer::GetOperationsFlags() const { return OperationFlags::None; diff --git a/Code/Framework/AzCore/AzCore/Serialization/Json/BaseJsonSerializer.h b/Code/Framework/AzCore/AzCore/Serialization/Json/BaseJsonSerializer.h index 7d2af01c16..4e8f545367 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/Json/BaseJsonSerializer.h +++ b/Code/Framework/AzCore/AzCore/Serialization/Json/BaseJsonSerializer.h @@ -180,13 +180,16 @@ namespace AZ //! Transforms the data from the rapidjson Value to outputValue, if the conversion is possible and supported. //! The serializer is responsible for casting to the proper type and safely writing to the outputValue memory. + //! \note The default implementation is to load the object ignoring a custom serializers for the type, which allows for custom serializers + //! to modify the object after all default loading has occurred. virtual JsonSerializationResult::Result Load(void* outputValue, const Uuid& outputValueTypeId, const rapidjson::Value& inputValue, - JsonDeserializerContext& context) = 0; + JsonDeserializerContext& context); //! Write the input value to a rapidjson value if the default value is not null and doesn't match the input value, otherwise //! an error is returned and sets the rapidjson value to a null value. + //! \note The default implementation is to store the object ignoring custom serializers. virtual JsonSerializationResult::Result Store(rapidjson::Value& outputValue, const void* inputValue, const void* defaultValue, - const Uuid& valueTypeId, JsonSerializerContext& context) = 0; + const Uuid& valueTypeId, JsonSerializerContext& context); //! Returns the operation flags which tells the Json Serialization how this custom json serializer can be used. virtual OperationFlags GetOperationsFlags() const; diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp index 68648a71f3..d806eb7e24 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp @@ -144,7 +144,7 @@ namespace ScriptCanvasEditor { namespace JSRU = AZ::JsonSerializationUtils; - if (!source.IsValid()) + if (!source.IsGraphValid()) { return AZ::Failure(AZStd::string("no source graph to save")); } diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index 34a79b2543..e059ff555b 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -6,7 +6,6 @@ * */ - #include #include #include @@ -14,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -21,24 +21,26 @@ #include #include #include +#include #include #include #include +#include #include #include -#include #include #include +#include +#include #include #include -#include -#include namespace EditorScriptCanvasComponentCpp { enum Version { PrefabIntegration = 10, + InternalDev, AddSourceHandle, // add description above Current @@ -49,6 +51,8 @@ namespace ScriptCanvasEditor { static bool EditorScriptCanvasComponentVersionConverter(AZ::SerializeContext& serializeContext, AZ::SerializeContext::DataElementNode& rootElement) { + AZ_TracePrintf("ScriptCanvas", "EditorScriptCanvasComponentVersionConverter called!"); + if (rootElement.GetVersion() <= 4) { int assetElementIndex = rootElement.FindElement(AZ::Crc32("m_asset")); @@ -204,6 +208,11 @@ namespace ScriptCanvasEditor ; } } + + if (AZ::JsonRegistrationContext* jsonContext = azrtti_cast(context)) + { + jsonContext->Serializer()->HandlesType(); + } } EditorScriptCanvasComponent::EditorScriptCanvasComponent() @@ -238,7 +247,7 @@ namespace ScriptCanvasEditor AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); - if (m_sourceHandle.IsValid()) + if (m_sourceHandle.IsDescriptionValid()) { GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, m_sourceHandle, Tracker::ScriptCanvasFileState::UNMODIFIED, -1); @@ -265,7 +274,11 @@ namespace ScriptCanvasEditor EditorComponentBase::Init(); AzFramework::AssetCatalogEventBus::Handler::BusConnect(); AzToolsFramework::EditorEntityContextNotificationBus::Handler::BusConnect(); - // m_scriptCanvasAssetHolder.Init(GetEntityId(), GetId()); + } + + void EditorScriptCanvasComponent::InitializeSource(const SourceHandle& sourceHandle) + { + m_sourceHandle = sourceHandle; } //========================================================================= @@ -389,13 +402,13 @@ namespace ScriptCanvasEditor // or when the asset was explicitly set to empty. // // i.e. do not clear variables when we lose the catalog asset. - if ((assetId.IsValidDescription() && assetId.Describe() != m_removedHandle.Describe()) - || (!assetId.IsValidDescription() && !m_removedHandle.IsValidDescription())) + if ((assetId.IsDescriptionValid() && assetId.Describe() != m_removedHandle.Describe()) + || (!assetId.IsDescriptionValid() && !m_removedHandle.IsDescriptionValid())) { ClearVariables(); } - if (assetId.IsValidDescription()) + if (assetId.IsDescriptionValid()) { if (auto loaded = LoadFromFile(assetId.Path().c_str()); loaded.IsSuccess()) { @@ -473,7 +486,7 @@ namespace ScriptCanvasEditor void EditorScriptCanvasComponent::UpdatePropertyDisplay(const SourceHandle& sourceHandle) { - if (sourceHandle.IsValid()) + if (sourceHandle.IsGraphValid()) { BuildGameEntityData(); UpdateName(); diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp index adf5035dbd..dccc50f732 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp @@ -33,7 +33,7 @@ namespace ScriptCanvasEditor { AZStd::optional CompleteDescription(const SourceHandle& source) { - if (source.IsValidDescription()) + if (source.IsDescriptionValid()) { return source; } diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h index c9cb472808..31ef111b7b 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h @@ -48,6 +48,9 @@ namespace ScriptCanvasEditor EditorScriptCanvasComponent(const SourceHandle& sourceHandle); ~EditorScriptCanvasComponent() override; + // sets the soure but does not attempt to load anything; + void InitializeSource(const SourceHandle& sourceHandle); + //===================================================================== // AZ::Component void Init() override; diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponentSerializer.cpp b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponentSerializer.cpp new file mode 100644 index 0000000000..dfda030403 --- /dev/null +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponentSerializer.cpp @@ -0,0 +1,55 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include +#include +#include + +namespace AZ +{ + AZ_CLASS_ALLOCATOR_IMPL(EditorScriptCanvasComponentSerializer, SystemAllocator, 0); + + JsonSerializationResult::Result EditorScriptCanvasComponentSerializer::Load + ( void* outputValue + , const Uuid& outputValueTypeId + , const rapidjson::Value& inputValue + , JsonDeserializerContext& context) + { + namespace JSR = JsonSerializationResult; + + AZ_Assert(outputValueTypeId == azrtti_typeid() + , "EditorScriptCanvasComponentSerializer Load against output typeID that was not EditorScriptCanvasComponent"); + AZ_Assert(outputValue, "EditorScriptCanvasComponentSerializer Load against null output"); + + auto outputComponent = reinterpret_cast(outputValue); + JsonSerializationResult::ResultCode result = BaseJsonSerializer::Load(outputValue, outputValueTypeId, inputValue, context); + + if (result.GetProcessing() != JSR::Processing::Halted) + { + auto assetHolderMember = inputValue.FindMember("m_assetHolder"); + if (assetHolderMember != inputValue.MemberEnd()) + { + ScriptCanvasEditor::ScriptCanvasAssetHolder assetHolder; + result.Combine + ( ContinueLoading(&assetHolder + , azrtti_typeid(), assetHolderMember->value, context)); + + if (result.GetProcessing() != JSR::Processing::Halted) + { + outputComponent->InitializeSource + ( ScriptCanvasEditor::SourceHandle(nullptr, assetHolder.GetAssetId().m_guid, assetHolder.GetAssetHint())); + } + } + } + + return context.Report(result, result.GetProcessing() != JSR::Processing::Halted + ? "EditorScriptCanvasComponentSerializer Load finished loading EditorScriptCanvasComponent" + : "EditorScriptCanvasComponentSerializer Load failed to load EditorScriptCanvasComponent"); + } +} diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponentSerializer.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponentSerializer.h new file mode 100644 index 0000000000..68ad370997 --- /dev/null +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponentSerializer.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include +#include + +namespace AZ +{ + class EditorScriptCanvasComponentSerializer + : public BaseJsonSerializer + { + public: + AZ_RTTI(EditorScriptCanvasComponentSerializer, "{80B497B3-ABC1-4991-A3C4-047A8CB2C26C}", BaseJsonSerializer); + AZ_CLASS_ALLOCATOR_DECL; + + private: + JsonSerializationResult::Result Load + ( void* outputValue + , const Uuid& outputValueTypeId + , const rapidjson::Value& inputValue + , JsonDeserializerContext& context) override; + }; +} diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp index 2e0ace4768..6ea8f3a75d 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp @@ -235,7 +235,7 @@ namespace ScriptCanvasEditor if (tabdata.isValid()) { auto tabAssetId = tabdata.value(); - if (tabAssetId.m_assetId.IsValid() + if (tabAssetId.m_assetId.IsGraphValid() && tabAssetId.m_assetId.Get()->GetGraphCanvasGraphId() == graphCanvasGraphId) { return tabAssetId.m_assetId.Get()->GetScriptCanvasId(); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 52c5b4c5d2..06c907f56d 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -251,7 +251,7 @@ namespace ScriptCanvasEditor if (fileState == Tracker::ScriptCanvasFileState::MODIFIED || fileState == Tracker::ScriptCanvasFileState::UNMODIFIED) { ScriptCanvasEditor::SourceHandle sourceId = GetSourceAssetId(assetId); - if (sourceId.IsValid()) + if (sourceId.IsGraphValid()) { EditorSettings::EditorWorkspace::WorkspaceAssetSaveData assetSaveData; assetSaveData.m_assetId = sourceId; @@ -267,13 +267,13 @@ namespace ScriptCanvasEditor } // The assetId needs to be the file AssetId to restore the workspace - if (focusedAssetId.IsValid()) + if (focusedAssetId.IsGraphValid()) { focusedAssetId = GetSourceAssetId(focusedAssetId); } // If our currently focused asset won't be restored, just show the first element. - if (!focusedAssetId.IsValid()) + if (!focusedAssetId.IsGraphValid()) { if (!activeAssets.empty()) { @@ -643,7 +643,7 @@ namespace ScriptCanvasEditor QTimer::singleShot(0, [this]() { SetDefaultLayout(); - if (m_activeGraph.IsValid()) + if (m_activeGraph.IsGraphValid()) { m_queuedFocusOverride = m_activeGraph; } @@ -824,7 +824,7 @@ namespace ScriptCanvasEditor void MainWindow::SignalActiveSceneChanged(ScriptCanvasEditor::SourceHandle assetId) { AZ::EntityId graphId; - if (assetId.IsValid()) + if (assetId.IsGraphValid()) { EditorGraphRequestBus::EventResult(graphId, assetId.Get()->GetScriptCanvasId(), &EditorGraphRequests::GetGraphCanvasGraphId); } @@ -1199,17 +1199,23 @@ namespace ScriptCanvasEditor return AZ::Success(outTabIndex); } - outTabIndex = CreateAssetTab(fileAssetId, fileState); + auto loadedGraph = LoadFromFile(fileAssetId.Path().c_str()); + if (!loadedGraph.IsSuccess()) + { + return AZ::Failure(AZStd::string("Failed to load graph at %s", fileAssetId.Path().c_str())); + } + + outTabIndex = CreateAssetTab(loadedGraph.GetValue(), fileState); if (!m_isRestoringWorkspace) { - SetActiveAsset(fileAssetId); + SetActiveAsset(loadedGraph.GetValue()); } if (outTabIndex >= 0) { - AddRecentFile(fileAssetId.Path().c_str()); - OpenScriptCanvasAssetImplementation(fileAssetId, fileState); + AddRecentFile(loadedGraph.GetValue().Path().c_str()); + OpenScriptCanvasAssetImplementation(loadedGraph.GetValue(), fileState); return AZ::Success(outTabIndex); } else @@ -1221,12 +1227,12 @@ namespace ScriptCanvasEditor AZ::Outcome MainWindow::OpenScriptCanvasAssetImplementation(const SourceHandle& scriptCanvasAsset, Tracker::ScriptCanvasFileState fileState, int tabIndex) { const ScriptCanvasEditor::SourceHandle& fileAssetId = scriptCanvasAsset; - if (!fileAssetId.IsValid()) + if (!fileAssetId.IsDescriptionValid()) { return AZ::Failure(AZStd::string("Unable to open asset with invalid asset id")); } - if (!scriptCanvasAsset.IsValid()) + if (!scriptCanvasAsset.IsDescriptionValid()) { if (!m_isRestoringWorkspace) { @@ -1282,7 +1288,7 @@ namespace ScriptCanvasEditor AZ::Outcome MainWindow::OpenScriptCanvasAsset(ScriptCanvasEditor::SourceHandle scriptCanvasAssetId, Tracker::ScriptCanvasFileState fileState, int tabIndex) { - if (scriptCanvasAssetId.IsValid()) + if (scriptCanvasAssetId.IsGraphValid()) { return OpenScriptCanvasAssetImplementation(scriptCanvasAssetId, fileState, tabIndex); } @@ -1303,7 +1309,7 @@ namespace ScriptCanvasEditor m_assetCreationRequests.erase(assetId); GeneralAssetNotificationBus::Event(assetId, &GeneralAssetNotifications::OnAssetUnloaded); - if (assetId.IsValid()) + if (assetId.IsGraphValid()) { // Disconnect scene and asset editor buses GraphCanvas::SceneNotificationBus::MultiHandler::BusDisconnect(assetId.Get()->GetScriptCanvasId()); @@ -1379,7 +1385,7 @@ namespace ScriptCanvasEditor void MainWindow::OpenFile(const char* fullPath) { auto tabIndex = m_tabBar->FindTabByPath(fullPath); - if (tabIndex.IsValid()) + if (tabIndex.IsGraphValid()) { SetActiveAsset(tabIndex); return; @@ -1699,7 +1705,7 @@ namespace ScriptCanvasEditor bool MainWindow::SaveAssetImpl(const ScriptCanvasEditor::SourceHandle& inMemoryAssetId, Save save) { - if (!inMemoryAssetId.IsValid()) + if (!inMemoryAssetId.IsGraphValid()) { return false; } @@ -2446,7 +2452,7 @@ namespace ScriptCanvasEditor { AZ::EntityId graphId{}; - if (m_activeGraph.IsValid()) + if (m_activeGraph.IsGraphValid()) { EditorGraphRequestBus::EventResult ( graphId, m_activeGraph.Get()->GetScriptCanvasId(), &EditorGraphRequests::GetGraphCanvasGraphId); @@ -2471,7 +2477,7 @@ namespace ScriptCanvasEditor { AZ::EntityId graphId{}; - if (assetId.IsValid()) + if (assetId.IsGraphValid()) { EditorGraphRequestBus::EventResult ( graphId, assetId.Get()->GetScriptCanvasId(), &EditorGraphRequests::GetGraphCanvasGraphId); @@ -2482,7 +2488,7 @@ namespace ScriptCanvasEditor ScriptCanvas::ScriptCanvasId MainWindow::FindScriptCanvasIdByAssetId(const ScriptCanvasEditor::SourceHandle& assetId) const { - return assetId.IsValid() ? assetId.Get()->GetScriptCanvasId() : ScriptCanvas::ScriptCanvasId{}; + return assetId.IsGraphValid() ? assetId.Get()->GetScriptCanvasId() : ScriptCanvas::ScriptCanvasId{}; } ScriptCanvas::ScriptCanvasId MainWindow::GetScriptCanvasId(const GraphCanvas::GraphId& graphCanvasGraphId) const @@ -2548,14 +2554,14 @@ namespace ScriptCanvasEditor { // Disconnect previous asset AZ::EntityId previousScriptCanvasSceneId; - if (previousAsset.IsValid()) + if (previousAsset.IsGraphValid()) { previousScriptCanvasSceneId = previousAsset.Get()->GetScriptCanvasId(); GraphCanvas::SceneNotificationBus::MultiHandler::BusDisconnect(previousScriptCanvasSceneId); } AZ::EntityId nextAssetGraphCanvasId; - if (nextAsset.IsValid()) + if (nextAsset.IsGraphValid()) { // Connect the next asset EditorGraphRequestBus::EventResult(nextAssetGraphCanvasId, nextAsset.Get()->GetScriptCanvasId(), &EditorGraphRequests::GetGraphCanvasGraphId); @@ -2583,7 +2589,7 @@ namespace ScriptCanvasEditor AssetHelpers::PrintInfo("SetActiveAsset : from: %s to %s", m_activeGraph.ToString().c_str(), fileAssetId.ToString().c_str()); - if (fileAssetId.IsValid()) + if (fileAssetId.IsGraphValid()) { if (m_tabBar->FindTab(fileAssetId) >= 0) { @@ -2596,7 +2602,7 @@ namespace ScriptCanvasEditor } } - if (m_activeGraph.IsValid()) + if (m_activeGraph.IsGraphValid()) { // If we are saving the asset, the Id may have changed from the in-memory to the file asset Id, in that case, // there's no need to hide the view or remove the widget @@ -2609,7 +2615,7 @@ namespace ScriptCanvasEditor } } - if (fileAssetId.IsValid()) + if (fileAssetId.IsGraphValid()) { ScriptCanvasEditor::SourceHandle previousAssetId = m_activeGraph; m_activeGraph = fileAssetId; @@ -2631,7 +2637,7 @@ namespace ScriptCanvasEditor void MainWindow::RefreshActiveAsset() { - if (m_activeGraph.IsValid()) + if (m_activeGraph.IsGraphValid()) { AssetHelpers::PrintInfo("RefreshActiveAsset : m_activeGraph (%s)", m_activeGraph.ToString().c_str()); if (auto view = m_tabBar->ModOrCreateTabView(m_tabBar->FindTab(m_activeGraph))) @@ -2762,7 +2768,7 @@ namespace ScriptCanvasEditor if (m_isClosingTabs) { if (m_tabBar->count() == 0 - || (m_tabBar->count() == 1 && m_skipTabOnClose.IsValid())) + || (m_tabBar->count() == 1 && m_skipTabOnClose.IsGraphValid())) { m_isClosingTabs = false; m_skipTabOnClose.Clear(); @@ -3003,7 +3009,7 @@ namespace ScriptCanvasEditor bool hasCopiableSelection = false; bool hasSelection = false; - if (m_activeGraph.IsValid()) + if (m_activeGraph.IsGraphValid()) { if (graphCanvasGraphId.IsValid()) { @@ -3396,17 +3402,17 @@ namespace ScriptCanvasEditor { m_isRestoringWorkspace = false; - if (m_queuedFocusOverride.IsValid()) + if (m_queuedFocusOverride.IsGraphValid()) { SetActiveAsset(m_queuedFocusOverride); m_queuedFocusOverride.Clear(); } - else if (lastFocusAsset.IsValid()) + else if (lastFocusAsset.IsGraphValid()) { SetActiveAsset(lastFocusAsset); } - if (!m_activeGraph.IsValid()) + if (!m_activeGraph.IsGraphValid()) { if (m_tabBar->count() > 0) { @@ -3429,7 +3435,7 @@ namespace ScriptCanvasEditor void MainWindow::UpdateAssignToSelectionState() { - bool buttonEnabled = m_activeGraph.IsValid(); + bool buttonEnabled = m_activeGraph.IsGraphValid(); if (buttonEnabled) { @@ -3789,7 +3795,7 @@ namespace ScriptCanvasEditor OnFileNew(); - if (m_activeGraph.IsValid()) + if (m_activeGraph.IsGraphValid()) { graphId = GetActiveGraphCanvasGraphId(); } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp index 830d09c7dd..71aeb1dbb9 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp @@ -118,7 +118,7 @@ namespace ScriptCanvasEditor SourceHandle Modifier::LoadAsset() { auto& handle = ModCurrentAsset(); - if (!handle.IsValid()) + if (!handle.IsGraphValid()) { auto outcome = LoadFromFile(handle.Path().c_str()); if (outcome.IsSuccess()) @@ -158,7 +158,7 @@ namespace ScriptCanvasEditor ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnUpgradeModificationBegin, m_config, ModCurrentAsset()); - if (auto asset = LoadAsset(); asset.IsValid()) + if (auto asset = LoadAsset(); asset.IsGraphValid()) { ModificationNotificationsBus::Handler::BusConnect(); m_modifyState = ModifyState::InProgress; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp index f9fc6e497d..816ded8a7b 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp @@ -132,7 +132,7 @@ namespace ScriptCanvasEditor } else { - if (auto asset = LoadAsset(); asset.IsValid()) + if (auto asset = LoadAsset(); asset.IsGraphValid()) { VE_LOG("Scanner: Loaded: %s ", ModCurrentAsset().Path().c_str()); FilterAsset(asset); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp index 8e3d5c53e8..fd9d2ccd57 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp @@ -237,14 +237,14 @@ namespace ScriptCanvasEditor return m_id; } - bool SourceHandle::IsValid() const + bool SourceHandle::IsDescriptionValid() const { - return m_data != nullptr; + return !m_id.IsNull() && !m_path.empty(); } - bool SourceHandle::IsValidDescription() const + bool SourceHandle::IsGraphValid() const { - return !m_id.IsNull() && !m_path.empty(); + return m_data != nullptr; } GraphPtr SourceHandle::Mod() const @@ -290,7 +290,7 @@ namespace ScriptCanvasEditor { return AZStd::string::format ( "%s, %s, %s" - , IsValid() ? "O" : "X" + , IsGraphValid() ? "O" : "X" , m_path.empty() ? m_path.c_str() : "" , m_id.IsNull() ? "" : m_id.ToString().c_str()); } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h index 8671197f7b..b5cf9c22b3 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h @@ -342,9 +342,9 @@ namespace ScriptCanvasEditor const AZ::Uuid& Id() const; - bool IsValid() const; + bool IsDescriptionValid() const; - bool IsValidDescription() const; + bool IsGraphValid() const; GraphPtr Mod() const; diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake index 7f269e2081..449298097f 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake @@ -59,6 +59,8 @@ set(FILES Editor/Components/EditorGraphVariableManagerComponent.cpp Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h Editor/Components/EditorScriptCanvasComponent.cpp + Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponentSerializer.h + Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponentSerializer.cpp Editor/Components/IconComponent.h Editor/Components/IconComponent.cpp Editor/Include/ScriptCanvas/GraphCanvas/DynamicSlotBus.h From 66e744785f89689fa119a6023e68c77dc59821a1 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Mon, 22 Nov 2021 20:34:11 -0800 Subject: [PATCH 076/948] EditorCOmponent build pipeline WIP Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Builder/ScriptCanvasBuilder.cpp | 127 ++--------------- .../Code/Builder/ScriptCanvasBuilder.h | 27 +--- .../Assets/ScriptCanvasFileHandling.cpp | 132 +++++++++++++++++- .../EditorScriptCanvasComponent.cpp | 43 ++++-- .../Code/Editor/Components/EditorUtils.cpp | 13 ++ .../Assets/ScriptCanvasFileHandling.h | 18 +++ .../Components/EditorScriptCanvasComponent.h | 2 + .../ScriptCanvas/Components/EditorUtils.h | 2 + .../Code/Editor/View/Widgets/GraphTabBar.cpp | 1 + .../Widgets/SourceHandlePropertyAssetCtrl.cpp | 2 +- .../Code/Include/ScriptCanvas/Core/Core.cpp | 20 +++ .../Code/Include/ScriptCanvas/Core/Core.h | 6 +- 12 files changed, 233 insertions(+), 160 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp index a75b68b518..bb2b94bb50 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp @@ -13,23 +13,14 @@ #include #include #include - -namespace ScriptCanvasBuilderCpp -{ - void AppendTabs(AZStd::string& result, size_t depth) - { - for (size_t i = 0; i < depth; ++i) - { - result += "\t"; - } - } -} +#include +#include namespace ScriptCanvasBuilder { void BuildVariableOverrides::Clear() { - m_source.Reset(); + m_source = {}; m_variables.clear(); m_overrides.clear(); m_overridesUnused.clear(); @@ -104,6 +95,7 @@ namespace ScriptCanvasBuilder return m_variables.empty() && m_entityIds.empty() && m_dependencies.empty(); } + // #sc_editor_asset THIS MUST GET VERSIONED! void BuildVariableOverrides::Reflect(AZ::ReflectContext* reflectContext) { if (auto serializeContext = azrtti_cast(reflectContext)) @@ -203,45 +195,12 @@ namespace ScriptCanvasBuilder } } - 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(), {}); + (AZ::Data::AssetId(buildOverrides.m_source.Id(), AZ_CRC("RuntimeData", 0x163310ae)), azrtti_typeid(), {}); runtimeOverrides.m_runtimeAsset.SetAutoLoadBehavior(AZ::Data::AssetLoadBehavior::PreLoad); runtimeOverrides.m_variableIndices.resize(buildOverrides.m_variables.size()); @@ -304,76 +263,9 @@ namespace ScriptCanvasBuilder 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(), aznumeric_cast(assetHint.size()), 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) + AZ::Outcome ParseEditorAssetTree(const ScriptCanvasEditor::EditorAssetTree& editorAssetTree) { - auto buildEntity = editorAssetTree.m_asset->GetScriptCanvasEntity(); + auto buildEntity = editorAssetTree.m_asset.Get()->GetEntity(); if (!buildEntity) { return AZ::Failure(AZStd::string("No entity from source asset")); @@ -409,9 +301,8 @@ namespace ScriptCanvasBuilder 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() + ( "ParseEditorAssetTree failed to parse dependent graph from %s: %s" + , dependentAsset.m_asset.ToString().c_str() , parseDependentOutcome.GetError().c_str())); } diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.h b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.h index f03e78bc3e..0dedd67847 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.h +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.h @@ -16,6 +16,7 @@ namespace ScriptCanvasEditor { class ScriptCanvasAsset; + class EditorAssetTree; } namespace ScriptCanvasBuilder @@ -39,8 +40,8 @@ namespace ScriptCanvasBuilder void PopulateFromParsedResults(ScriptCanvas::Grammar::AbstractCodeModelConstPtr abstractCodeModel, 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; - + ScriptCanvasEditor::SourceHandle m_source; + // all of the variables here are overrides AZStd::vector m_variables; // the values here may or may not be overrides @@ -48,30 +49,12 @@ namespace ScriptCanvasBuilder // these two variable lists are all that gets exposed to the edit context AZStd::vector m_overrides; AZStd::vector m_overridesUnused; - // AZStd::vector m_entityIdRuntimeInputIndices; since all of the entity ids need to go in, they may not need indices + // AZStd::vector m_entityIdRuntimeInputIndices; since all oSf 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); + AZ::Outcome ParseEditorAssetTree(const ScriptCanvasEditor::EditorAssetTree& editorAssetTree); } diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp index d806eb7e24..e5d9e86fbe 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp @@ -22,18 +22,26 @@ #include #include #include - +#include + namespace ScriptCanvasFileHandlingCpp { - using namespace ScriptCanvas; + void AppendTabs(AZStd::string& result, size_t depth) + { + for (size_t i = 0; i < depth; ++i) + { + result += "\t"; + } + } - void CollectNodes(const GraphData::NodeContainer& container, SerializationListeners& listeners) + void CollectNodes(const ScriptCanvas::GraphData::NodeContainer& container, ScriptCanvas::SerializationListeners& listeners) { for (auto& nodeEntity : container) { if (nodeEntity) { - if (auto listener = azrtti_cast(AZ::EntityUtils::FindFirstDerivedComponent(nodeEntity))) + if (auto listener = azrtti_cast + ( AZ::EntityUtils::FindFirstDerivedComponent(nodeEntity))) { listeners.push_back(listener); } @@ -44,6 +52,38 @@ namespace ScriptCanvasFileHandlingCpp namespace ScriptCanvasEditor { + 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; + ScriptCanvasFileHandlingCpp::AppendTabs(result, depth); + result += m_asset.ToString(); + depth += m_dependencies.empty() ? 0 : 1; + + for (const auto& dependency : m_dependencies) + { + result += "\n"; + ScriptCanvasFileHandlingCpp::AppendTabs(result, depth); + result += dependency.ToString(depth); + } + + return result; + } + AZ::Outcome LoadDataFromJson ( ScriptCanvas::ScriptCanvasData& dataTarget , AZStd::string_view source @@ -87,6 +127,88 @@ namespace ScriptCanvasEditor return AZ::Success(); } + + AZ::Outcome LoadEditorAssetTree(SourceHandle handle, EditorAssetTree* parent) + { + if (!CompleteDescriptionInPlace(handle)) + { + return AZ::Failure(AZStd::string::format("LoadEditorAssetTree failed to describe graph from %s", handle.ToString().c_str())); + } + + auto loadAssetOutcome = LoadFromFile(handle.Path().c_str()); + if (!loadAssetOutcome.IsSuccess()) + { + return AZ::Failure(AZStd::string::format("LoadEditorAssetTree failed to load graph from %s: %s" + , handle.ToString().c_str(), loadAssetOutcome.GetError().c_str())); + } + + AZStd::vector dependentAssets; + + auto filterCB = [&dependentAssets](const AZ::Data::AssetFilterInfo& filterInfo)->bool + { + if (filterInfo.m_assetType == azrtti_typeid() + || filterInfo.m_assetType == azrtti_typeid()) + { + dependentAssets.push_back(SourceHandle(nullptr, filterInfo.m_assetId.m_guid, {})); + } + + return true; + }; + + const auto subgraphInterfaceAssetTypeID = azrtti_typeid>(); + + auto beginElementCB = [&subgraphInterfaceAssetTypeID, &dependentAssets] + ( void* instance + , const AZ::SerializeContext::ClassData* classData + , const AZ::SerializeContext::ClassElement* classElement) -> bool + { + if (classElement) + { + // if we are a pointer, then we may be pointing to a derived type. + if (classElement->m_flags & AZ::SerializeContext::ClassElement::FLG_POINTER) + { + // if ptr is a pointer-to-pointer, cast its value to a void* (or const void*) and dereference to get to the actual object pointer. + instance = *(void**)(instance); + } + + if (classData->m_typeId == subgraphInterfaceAssetTypeID) + { + auto id = reinterpret_cast*>(instance)->GetId(); + dependentAssets.push_back(SourceHandle(nullptr, id.m_guid, {})); + } + } + + return true; + }; + + AZ::SerializeContext* serializeContext = nullptr; + AZ::ComponentApplicationBus::BroadcastResult(serializeContext, &AZ::ComponentApplicationRequests::GetSerializeContext); + serializeContext->EnumerateObject( handle.Get(), beginElementCB, nullptr, AZ::SerializeContext::ENUM_ACCESS_FOR_READ); + + EditorAssetTree result; + + for (auto& dependentAsset : dependentAssets) + { + auto loadDependentOutcome = LoadEditorAssetTree(dependentAsset, &result); + if (!loadDependentOutcome.IsSuccess()) + { + return AZ::Failure(AZStd::string::format("LoadEditorAssetTree failed to load graph from %s: %s" + , dependentAsset.ToString().c_str(), 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 LoadFromFile(AZStd::string_view path) { namespace JSRU = AZ::JsonSerializationUtils; @@ -137,7 +259,7 @@ namespace ScriptCanvasEditor graph->MarkOwnership(*scriptCanvasData); } - return AZ::Success(ScriptCanvasEditor::SourceHandle(scriptCanvasData, {}, path)); + return AZ::Success(ScriptCanvasEditor::SourceHandle(scriptCanvasData, path)); } AZ::Outcome SaveToStream(const SourceHandle& source, AZ::IO::GenericStream& stream) diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index e059ff555b..fd2aa3e884 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -134,7 +134,7 @@ namespace ScriptCanvasEditor } ScriptCanvasBuilder::BuildVariableOverrides overrides; - overrides.m_source = AZ::Data::Asset(assetHolder.GetAssetId(), assetHolder.GetAssetType(), assetHolder.GetAssetHint());; + overrides.m_source = SourceHandle(nullptr, assetHolder.GetAssetId().m_guid, {}); for (auto& variable : editableData.GetVariables()) { @@ -197,14 +197,15 @@ namespace ScriptCanvasEditor ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("Level", 0x9aeacc13)) ->Attribute(AZ::Edit::Attributes::HelpPageURL, "https://o3de.org/docs/user-guide/components/reference/scripting/script-canvas/") ->DataElement(AZ::Edit::UIHandlers::Default, &EditorScriptCanvasComponent::m_sourceHandle, "Script Canvas Source File", "Script Canvas source file associated with this component") - ->Attribute("BrowseIcon", ":/stylesheet/img/UI20/browse-edit-select-files.svg") - ->Attribute("EditButton", "") - ->Attribute("EditDescription", "Open in Script Canvas Editor") - ->Attribute("EditCallback", &EditorScriptCanvasComponent::OpenEditor) - ->Attribute(AZ::Edit::Attributes::AssetPickerTitle, "Script Canvas") - ->Attribute(AZ::Edit::Attributes::SourceAssetFilterPattern, "*.scriptcanvas") + ->Attribute("BrowseIcon", ":/stylesheet/img/UI20/browse-edit-select-files.svg") + ->Attribute("EditButton", "") + ->Attribute("EditDescription", "Open in Script Canvas Editor") + ->Attribute("EditCallback", &EditorScriptCanvasComponent::OpenEditor) + ->Attribute(AZ::Edit::Attributes::AssetPickerTitle, "Script Canvas") + ->Attribute(AZ::Edit::Attributes::SourceAssetFilterPattern, "*.scriptcanvas") + ->Attribute(AZ::Edit::Attributes::ChangeNotify, &EditorScriptCanvasComponent::OnFileSelectionChanged) ->DataElement(AZ::Edit::UIHandlers::Default, &EditorScriptCanvasComponent::m_variableOverrides, "Properties", "Script Canvas Graph Properties") - ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) + ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) ; } } @@ -319,7 +320,7 @@ namespace ScriptCanvasEditor m_runtimeDataIsValid = false; - auto assetTreeOutcome = LoadEditorAssetTree(m_sourceHandle.Id(), m_sourceHandle.Path().c_str()); + auto assetTreeOutcome = LoadEditorAssetTree(m_sourceHandle); if (!assetTreeOutcome.IsSuccess()) { AZ_Warning("ScriptCanvas", false, "EditorScriptCanvasComponent::BuildGameEntityData failed: %s", assetTreeOutcome.GetError().c_str()); @@ -386,6 +387,26 @@ namespace ScriptCanvasEditor return m_sourceHandle.Id(); } + AZ::u32 EditorScriptCanvasComponent::OnFileSelectionChanged() + { + m_sourceHandle = SourceHandle(nullptr, m_sourceHandle.Path()); + CompleteDescriptionInPlace(m_sourceHandle); + + m_previousHandle = {}; + m_removedHandle = {}; + + if (m_sourceHandle.IsDescriptionValid()) + { + OnScriptCanvasAssetChanged(m_sourceHandle); + } + else + { + ClearVariables(); + } + + return AZ::Edit::PropertyRefreshLevels::EntireTree; + } + void EditorScriptCanvasComponent::OnScriptCanvasAssetChanged(const SourceHandle& assetId) { ScriptCanvas::GraphIdentifier newIdentifier = GetGraphIdentifier(); @@ -492,10 +513,6 @@ namespace ScriptCanvasEditor UpdateName(); AzToolsFramework::ToolsApplicationNotificationBus::Broadcast(&AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay, AzToolsFramework::Refresh_EntireTree_NewContent); } - else - { - // #sc_editor_asset clear or disable something - } } void EditorScriptCanvasComponent::ClearVariables() diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp index dccc50f732..d21b3d004c 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp @@ -78,6 +78,19 @@ namespace ScriptCanvasEditor return AZStd::nullopt; } + bool CompleteDescriptionInPlace(SourceHandle& source) + { + if (auto completed = CompleteDescription(source)) + { + source = *completed; + return true; + } + else + { + return false; + } + } + ////////////////////////// // NodeIdentifierFactory ////////////////////////// diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h index c88a7df28b..dd0e7aeb62 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h @@ -26,6 +26,22 @@ namespace ScriptCanvas namespace ScriptCanvasEditor { + class EditorAssetTree + { + public: + AZ_CLASS_ALLOCATOR(EditorAssetTree, AZ::SystemAllocator, 0); + + EditorAssetTree* m_parent = nullptr; + AZStd::vector m_dependencies; + SourceHandle m_asset; + + EditorAssetTree* ModRoot(); + + void SetParent(EditorAssetTree& parent); + + AZStd::string ToString(size_t depth = 0) const; + }; + AZ::Outcome LoadFromFile(AZStd::string_view path); AZ::Outcome LoadDataFromJson @@ -33,5 +49,7 @@ namespace ScriptCanvasEditor , AZStd::string_view source , AZ::SerializeContext& serializeContext); + AZ::Outcome LoadEditorAssetTree(SourceHandle handle, EditorAssetTree* parent = nullptr); + AZ::Outcome SaveToStream(const SourceHandle& source, AZ::IO::GenericStream& stream); } diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h index 31ef111b7b..19347e25eb 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h @@ -121,6 +121,8 @@ namespace ScriptCanvasEditor void SourceFileRemoved(AZStd::string relativePath, AZStd::string scanFolder, AZ::Uuid fileAssetId) override; void SourceFileFailed(AZStd::string relativePath, AZStd::string scanFolder, AZ::Uuid fileAssetId) override; + AZ::u32 OnFileSelectionChanged(); + void OnScriptCanvasAssetChanged(const SourceHandle& sourceHandle); void UpdateName(); diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorUtils.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorUtils.h index 0d27d255af..a4522198b7 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorUtils.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorUtils.h @@ -25,6 +25,8 @@ namespace ScriptCanvasEditor // If both Path and Id is valid, including after correction, returns the handle including source Data, // otherwise, returns null AZStd::optional CompleteDescription(const SourceHandle& source); + // if CompleteDescription() succeeds, sets the handle to the result, else does nothing + bool CompleteDescriptionInPlace(SourceHandle& source); class Graph; class NodePaletteModel; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp index 6ea8f3a75d..17228565da 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp @@ -154,6 +154,7 @@ namespace ScriptCanvasEditor canvasWidget->SetDefaultBorderColor(ScriptCanvasAssetDescription().GetDisplayColorImpl()); metaData.m_canvasWidget = canvasWidget; metaData.m_assetId = assetId; + metaData.m_fileState = fileState; AZStd::string tabName; AzFramework::StringFunc::Path::GetFileName(assetId.Path().c_str(), tabName); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.cpp index 04f7d79da5..3e4cb7cd49 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/SourceHandlePropertyAssetCtrl.cpp @@ -138,7 +138,7 @@ namespace ScriptCanvasEditor (void)index; (void)node; - auto sourceHandle = SourceHandle(nullptr, {}, GUI->GetSelectedSourcePath()); + auto sourceHandle = SourceHandle(nullptr, GUI->GetSelectedSourcePath()); auto completeSourceHandle = CompleteDescription(sourceHandle); if (completeSourceHandle) { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp index fd9d2ccd57..1ac7a33821 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp @@ -189,6 +189,10 @@ namespace ScriptCanvas namespace ScriptCanvasEditor { + SourceHandle::SourceHandle() + : m_id(AZ::Uuid::CreateNull()) + {} + SourceHandle::SourceHandle(const SourceHandle& data, const AZ::Uuid& id, const AZ::IO::Path& path) : m_data(data.m_data) , m_id(id) @@ -207,6 +211,22 @@ namespace ScriptCanvasEditor m_id = id; } + SourceHandle::SourceHandle(const SourceHandle& data, const AZ::IO::Path& path) + : m_data(data.m_data) + , m_id(AZ::Uuid::CreateNull()) + , m_path(path) + { + m_path.MakePreferred(); + } + + SourceHandle::SourceHandle(ScriptCanvas::DataPtr graph, const AZ::IO::Path& path) + : m_data(graph) + , m_id(AZ::Uuid::CreateNull()) + , m_path(path) + { + m_path.MakePreferred(); + } + bool SourceHandle::AnyEquals(const SourceHandle& other) const { return m_data && m_data == other.m_data diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h index b5cf9c22b3..297ee70500 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h @@ -325,12 +325,16 @@ namespace ScriptCanvasEditor static void Reflect(AZ::ReflectContext* context); - SourceHandle() = default; + SourceHandle(); SourceHandle(const SourceHandle& data, const AZ::Uuid& id, const AZ::IO::Path& path); SourceHandle(ScriptCanvas::DataPtr graph, const AZ::Uuid& id, const AZ::IO::Path& path); + SourceHandle(const SourceHandle& data, const AZ::IO::Path& path); + + SourceHandle(ScriptCanvas::DataPtr graph, const AZ::IO::Path& path); + bool AnyEquals(const SourceHandle& other) const; void Clear(); From 27cc659ab9cec7a37caf2868e46656bd7f8290c9 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Tue, 23 Nov 2021 10:31:26 -0800 Subject: [PATCH 077/948] Editor Script Component simplified and working Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Builder/ScriptCanvasBuilder.cpp | 18 +++++-- .../Assets/ScriptCanvasFileHandling.cpp | 49 ++++++++++--------- .../EditorScriptCanvasComponent.cpp | 46 ++++++++--------- .../Components/EditorScriptCanvasComponent.h | 10 +++- .../ScriptCanvas/Variable/GraphVariable.cpp | 5 ++ .../ScriptCanvas/Variable/GraphVariable.h | 2 + 6 files changed, 74 insertions(+), 56 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp index bb2b94bb50..fe89c57009 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp @@ -30,11 +30,10 @@ namespace ScriptCanvasBuilder void BuildVariableOverrides::CopyPreviousOverriddenValues(const BuildVariableOverrides& source) { - auto isEqual = [](const ScriptCanvas::GraphVariable& overrideValue, const ScriptCanvas::GraphVariable& candidate) + auto isEqual = [](const ScriptCanvas::GraphVariable& lhs, const ScriptCanvas::GraphVariable& rhs) { - return candidate.GetVariableId() == overrideValue.GetVariableId() - || (candidate.GetVariableName() == overrideValue.GetVariableName() - && candidate.GetDataType() == overrideValue.GetDataType()); + return (lhs.GetVariableId() == rhs.GetVariableId() && lhs.GetDataType() == rhs.GetDataType()) + || (lhs.GetVariableName() == rhs.GetVariableName() && lhs.GetDataType() == rhs.GetDataType()); }; auto copyPreviousIfFound = [isEqual](ScriptCanvas::GraphVariable& overriddenValue, const AZStd::vector& source) @@ -44,7 +43,7 @@ namespace ScriptCanvasBuilder if (iter != source.end()) { - overriddenValue.DeepCopy(*iter); + overriddenValue.ModDatum().DeepCopyDatum(*iter->GetDatum()); overriddenValue.SetScriptInputControlVisibility(AZ::Edit::PropertyVisibility::Hide); overriddenValue.SetAllowSignalOnChange(false); return true; @@ -64,6 +63,15 @@ namespace ScriptCanvasBuilder } } + for (auto& overriddenValue : m_overridesUnused) + { + if (!copyPreviousIfFound(overriddenValue, source.m_overridesUnused)) + { + // the variable in question may have been previously used, and is now unused, so copy the previous value over + copyPreviousIfFound(overriddenValue, source.m_overrides); + } + } + ////////////////////////////////////////////////////////////////////////// // #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 diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp index e5d9e86fbe..8cecdc86d9 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp @@ -23,7 +23,8 @@ #include #include #include - +#include + namespace ScriptCanvasFileHandlingCpp { void AppendTabs(AZStd::string& result, size_t depth) @@ -135,26 +136,19 @@ namespace ScriptCanvasEditor return AZ::Failure(AZStd::string::format("LoadEditorAssetTree failed to describe graph from %s", handle.ToString().c_str())); } - auto loadAssetOutcome = LoadFromFile(handle.Path().c_str()); - if (!loadAssetOutcome.IsSuccess()) - { - return AZ::Failure(AZStd::string::format("LoadEditorAssetTree failed to load graph from %s: %s" - , handle.ToString().c_str(), loadAssetOutcome.GetError().c_str())); - } - - AZStd::vector dependentAssets; - - auto filterCB = [&dependentAssets](const AZ::Data::AssetFilterInfo& filterInfo)->bool + if (!handle.Get()) { - if (filterInfo.m_assetType == azrtti_typeid() - || filterInfo.m_assetType == azrtti_typeid()) + auto loadAssetOutcome = LoadFromFile(handle.Path().c_str()); + if (!loadAssetOutcome.IsSuccess()) { - dependentAssets.push_back(SourceHandle(nullptr, filterInfo.m_assetId.m_guid, {})); + return AZ::Failure(AZStd::string::format("LoadEditorAssetTree failed to load graph from %s: %s" + , handle.ToString().c_str(), loadAssetOutcome.GetError().c_str())); } - return true; - }; + handle = SourceHandle(loadAssetOutcome.GetValue(), handle.Id(), handle.Path().c_str()); + } + AZStd::vector dependentAssets; const auto subgraphInterfaceAssetTypeID = azrtti_typeid>(); auto beginElementCB = [&subgraphInterfaceAssetTypeID, &dependentAssets] @@ -170,12 +164,13 @@ namespace ScriptCanvasEditor // if ptr is a pointer-to-pointer, cast its value to a void* (or const void*) and dereference to get to the actual object pointer. instance = *(void**)(instance); } + } - if (classData->m_typeId == subgraphInterfaceAssetTypeID) - { - auto id = reinterpret_cast*>(instance)->GetId(); - dependentAssets.push_back(SourceHandle(nullptr, id.m_guid, {})); - } + if (classData->m_typeId == subgraphInterfaceAssetTypeID) + { + auto asset = reinterpret_cast*>(instance); + auto id = asset->GetId(); + dependentAssets.push_back(SourceHandle(nullptr, id.m_guid, {})); } return true; @@ -183,7 +178,10 @@ namespace ScriptCanvasEditor AZ::SerializeContext* serializeContext = nullptr; AZ::ComponentApplicationBus::BroadcastResult(serializeContext, &AZ::ComponentApplicationRequests::GetSerializeContext); - serializeContext->EnumerateObject( handle.Get(), beginElementCB, nullptr, AZ::SerializeContext::ENUM_ACCESS_FOR_READ); + AZ_Assert(serializeContext, "LoadEditorAssetTree() ailed to retrieve serialize context!"); + + const ScriptCanvasEditor::Graph* graph = handle.Get(); + serializeContext->EnumerateObject(graph, beginElementCB, nullptr, AZ::SerializeContext::ENUM_ACCESS_FOR_READ); EditorAssetTree result; @@ -204,8 +202,7 @@ namespace ScriptCanvasEditor result.SetParent(*parent); } - result.m_asset = loadAssetOutcome.TakeValue(); - + result.m_asset = AZStd::move(handle); return AZ::Success(result); } @@ -252,6 +249,10 @@ namespace ScriptCanvasEditor if (auto entity = scriptCanvasData->GetScriptCanvasEntity()) { + AZ_Assert(entity->GetState() == AZ::Entity::State::Constructed, "Entity loaded in bad state"); + AZ::u64 entityId = + aznumeric_caster(ScriptCanvas::MathNodeUtilities::GetRandomIntegral(1, std::numeric_limits::max())); + entity->SetId(AZ::EntityId(entityId)); entity->Init(); entity->Activate(); diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index fd2aa3e884..26fbf85a82 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -377,7 +377,7 @@ namespace ScriptCanvasEditor m_sourceHandle = *completeAsset; } - OnScriptCanvasAssetChanged(m_sourceHandle); + OnScriptCanvasAssetChanged(SourceChangeDescription::SelectionChanged); SetName(m_sourceHandle.Path().Filename().Native()); AzToolsFramework::ToolsApplicationEvents::Bus::Broadcast(&AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay, AzToolsFramework::Refresh_AttributesAndValues); } @@ -391,26 +391,16 @@ namespace ScriptCanvasEditor { m_sourceHandle = SourceHandle(nullptr, m_sourceHandle.Path()); CompleteDescriptionInPlace(m_sourceHandle); - m_previousHandle = {}; m_removedHandle = {}; - - if (m_sourceHandle.IsDescriptionValid()) - { - OnScriptCanvasAssetChanged(m_sourceHandle); - } - else - { - ClearVariables(); - } - + OnScriptCanvasAssetChanged(SourceChangeDescription::SelectionChanged); return AZ::Edit::PropertyRefreshLevels::EntireTree; } - void EditorScriptCanvasComponent::OnScriptCanvasAssetChanged(const SourceHandle& assetId) + void EditorScriptCanvasComponent::OnScriptCanvasAssetChanged(SourceChangeDescription changeDescription) { ScriptCanvas::GraphIdentifier newIdentifier = GetGraphIdentifier(); - newIdentifier.m_assetId = assetId.Id(); + newIdentifier.m_assetId = m_sourceHandle.Id(); ScriptCanvas::GraphIdentifier oldIdentifier = GetGraphIdentifier(); oldIdentifier.m_assetId = m_previousHandle.Id(); @@ -419,21 +409,24 @@ namespace ScriptCanvasEditor m_previousHandle = m_sourceHandle.Describe(); - // Only clear our variables when we are given a new asset id - // or when the asset was explicitly set to empty. - // - // i.e. do not clear variables when we lose the catalog asset. - if ((assetId.IsDescriptionValid() && assetId.Describe() != m_removedHandle.Describe()) - || (!assetId.IsDescriptionValid() && !m_removedHandle.IsDescriptionValid())) + if (changeDescription == SourceChangeDescription::SelectionChanged) { ClearVariables(); } - if (assetId.IsDescriptionValid()) + if (m_sourceHandle.IsDescriptionValid()) { - if (auto loaded = LoadFromFile(assetId.Path().c_str()); loaded.IsSuccess()) + if (!m_sourceHandle.Get()) + { + if (auto loaded = LoadFromFile(m_sourceHandle.Path().c_str()); loaded.IsSuccess()) + { + m_sourceHandle = SourceHandle(loaded.TakeValue(), m_sourceHandle.Id(), m_sourceHandle.Path().c_str()); + } + } + + if (m_sourceHandle.Get()) { - UpdatePropertyDisplay(loaded.GetValue()); + UpdatePropertyDisplay(m_sourceHandle); } } @@ -467,8 +460,9 @@ namespace ScriptCanvasEditor { if (auto handle = CompleteDescription(SourceHandle(nullptr, fileAssetId, {}))) { + m_sourceHandle = *handle; // consider queueing on tick bus - OnScriptCanvasAssetChanged(*handle); + OnScriptCanvasAssetChanged(SourceChangeDescription::Modified); } } } @@ -479,7 +473,7 @@ namespace ScriptCanvasEditor if (fileAssetId == m_sourceHandle.Id()) { m_removedHandle = m_sourceHandle; - OnScriptCanvasAssetChanged(m_removedHandle); + OnScriptCanvasAssetChanged(SourceChangeDescription::Removed); } } @@ -489,7 +483,7 @@ namespace ScriptCanvasEditor if (fileAssetId == m_sourceHandle.Id()) { m_removedHandle = m_sourceHandle; - OnScriptCanvasAssetChanged(m_removedHandle); + OnScriptCanvasAssetChanged(SourceChangeDescription::Error); } } diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h index 19347e25eb..52cf49070b 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h @@ -98,6 +98,14 @@ namespace ScriptCanvasEditor void OnStopPlayInEditor() override; protected: + enum class SourceChangeDescription : AZ::u8 + { + Error, + Modified, + Removed, + SelectionChanged, + }; + static void Reflect(AZ::ReflectContext* context); static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided) @@ -123,7 +131,7 @@ namespace ScriptCanvasEditor AZ::u32 OnFileSelectionChanged(); - void OnScriptCanvasAssetChanged(const SourceHandle& sourceHandle); + void OnScriptCanvasAssetChanged(SourceChangeDescription changeDescription); void UpdateName(); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.cpp index 8b8dfdc3fc..59b924196b 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.cpp @@ -335,6 +335,11 @@ namespace ScriptCanvas return &m_datum; } + Datum& GraphVariable::ModDatum() + { + return m_datum; + } + void GraphVariable::ConfigureDatumView(ModifiableDatumView& datumView) { datumView.ConfigureView((*this)); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.h index e7829ca6c1..db83076f67 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariable.h @@ -127,6 +127,8 @@ namespace ScriptCanvas const Datum* GetDatum() const; + Datum& ModDatum(); + bool IsComponentProperty() const; void ConfigureDatumView(ModifiableDatumView& accessController); From 8357fa34e94bba8a04a7dc0b75dc41b94efb1133 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Tue, 23 Nov 2021 23:57:03 -0800 Subject: [PATCH 078/948] fixed unit testing code Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../AzCore/AzCore/Script/ScriptContext.cpp | 13 ++++ .../AzCore/Script/ScriptContextAttributes.h | 1 + .../ScriptCanvasBuilderWorkerUtility.cpp | 15 +---- .../Framework/ScriptCanvasGraphUtilities.inl | 17 ++++- .../Framework/ScriptCanvasTraceUtilities.h | 8 +-- .../Code/Editor/SystemComponent.cpp | 5 +- .../Include/ScriptCanvas/Core/Nodeable.cpp | 9 ++- .../Interpreted/ExecutionInterpretedAPI.cpp | 46 ++++++++++++++ .../Interpreted/ExecutionStateInterpreted.cpp | 2 + ...ExecutionStateInterpretedPerActivation.cpp | 62 +++++++++++++++++++ 10 files changed, 155 insertions(+), 23 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp b/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp index 45f7876993..841387f14d 100644 --- a/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp +++ b/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp @@ -5073,13 +5073,26 @@ LUA_API const Node* lua_getDummyNode() // Check all constructors if they have use ScriptDataContext and if so choose this one if (!customConstructorMethod) { + int overrideIndex = -1; + AZ::AttributeReader(nullptr, FindAttribute + ( Script::Attributes::DefaultConstructorOverrideIndex, behaviorClass->m_attributes)).Read(overrideIndex); + + int methodIndex = 0; for (BehaviorMethod* method : behaviorClass->m_constructors) { + if (methodIndex == overrideIndex) + { + customConstructorMethod = method; + break; + } + if (method->GetNumArguments() && method->GetArgument(method->GetNumArguments() - 1)->m_typeId == AZ::AzTypeInfo::Uuid()) { customConstructorMethod = method; break; } + + ++methodIndex; } } diff --git a/Code/Framework/AzCore/AzCore/Script/ScriptContextAttributes.h b/Code/Framework/AzCore/AzCore/Script/ScriptContextAttributes.h index 9807f0af39..e238289ef5 100644 --- a/Code/Framework/AzCore/AzCore/Script/ScriptContextAttributes.h +++ b/Code/Framework/AzCore/AzCore/Script/ScriptContextAttributes.h @@ -21,6 +21,7 @@ namespace AZ 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 DefaultConstructorOverrideIndex = AZ_CRC_CE("DefaultConstructorOverrideIndex"); ///< Use a different class constructor as the default constructor in Lua 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 diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp index a68aeae5e9..fb7b5e7a4a 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp @@ -30,6 +30,8 @@ #include #include #include +#include + namespace ScriptCanvasBuilder { @@ -93,19 +95,6 @@ namespace ScriptCanvasBuilder request.printModelToConsole = ScriptCanvas::Grammar::g_printAbstractCodeModel; request.path = fullPath; - bool pathFound = false; - AZStd::string relativePath; - AzToolsFramework::AssetSystemRequestBus::BroadcastResult - ( pathFound - , &AzToolsFramework::AssetSystem::AssetSystemRequest::GetRelativeProductPathFromFullSourceOrProductPath - , fullPath.c_str(), relativePath); - - if (!pathFound) - { - AZ::Failure(AZStd::string::format("Failed to get engine relative path from %s", fullPath.c_str())); - } - - request.namespacePath = relativePath; const ScriptCanvas::Translation::Result translationResult = TranslateToLua(request); auto isSuccessOutcome = translationResult.IsSuccess(ScriptCanvas::Translation::TargetFlags::Lua); diff --git a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl index b1bc7321e6..74d0f76dce 100644 --- a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl +++ b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl @@ -114,12 +114,17 @@ namespace ScriptCanvasEditor { if (auto loadFileOutcome = LoadFromFile(graphPath); loadFileOutcome.IsSuccess()) { - AZ::Outcome< AZ::Data::Asset, AZStd::string> assetOutcome = AZ::Failure(AZStd::string("asset creation failed")); - ScriptCanvasEditor::EditorAssetConversionBus::BroadcastResult(assetOutcome, &ScriptCanvasEditor::EditorAssetConversionBusTraits::CreateRuntimeAsset, loadFileOutcome.GetValue()); + auto& source = loadFileOutcome.GetValue(); + auto testableSource = SourceHandle(source, AZ::Uuid::CreateRandom(), source.Path().c_str()); + + AZ::Outcome, AZStd::string> assetOutcome(AZ::Failure(AZStd::string("asset create failed"))); + ScriptCanvasEditor::EditorAssetConversionBus::BroadcastResult(assetOutcome + , &ScriptCanvasEditor::EditorAssetConversionBusTraits::CreateRuntimeAsset, testableSource); + if (assetOutcome.IsSuccess()) { LoadTestGraphResult result; - result.m_editorAsset = loadFileOutcome.TakeValue(); + result.m_editorAsset = AZStd::move(testableSource); result.m_runtimeAsset = assetOutcome.GetValue(); result.m_entity = AZStd::make_unique("Loaded Graph"); return result; @@ -216,6 +221,8 @@ namespace ScriptCanvasEditor { RuntimeDataOverrides runtimeDataOverrides; runtimeDataOverrides.m_runtimeAsset = loadResult.m_runtimeAsset; + runtimeDataOverrides.m_runtimeAsset.SetHint("original"); + runtimeDataOverrides.m_runtimeAsset.Get()->m_runtimeData.m_script.SetHint("original"); #if defined(LINUX) ////////////////////////////////////////////////////////////////////////// // Temporarily disable testing on the Linux build until the file name casing discrepancy @@ -261,6 +268,10 @@ namespace ScriptCanvasEditor RuntimeDataOverrides dependencyRuntimeDataOverrides; dependencyRuntimeDataOverrides.m_runtimeAsset = dependency.runtimeAsset; + AZStd::string dependencyHint = AZStd::string::format("dependency_%d", index); + dependencyRuntimeDataOverrides.m_runtimeAsset.SetHint(dependencyHint); + dependencyRuntimeDataOverrides.m_runtimeAsset.Get()->m_runtimeData.m_script.SetHint(dependencyHint); + runtimeDataOverrides.m_dependencies.push_back(dependencyRuntimeDataOverrides); RuntimeData& dependencyData = dependencyDataBuffer[index]; diff --git a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h index 033eed3efd..dfcb0d2643 100644 --- a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h +++ b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h @@ -161,15 +161,15 @@ namespace ScriptCanvasEditor struct ScopedOutputSuppression { - ScopedOutputSuppression(bool suppressState = true) + ScopedOutputSuppression([[maybe_unused]] bool suppressState = true) { - AZ::Debug::TraceMessageBus::BroadcastResult(m_oldSuppression, &AZ::Debug::TraceMessageEvents::OnOutput, "", ""); - TraceSuppressionBus::Broadcast(&TraceSuppressionRequests::SuppressAllOutput, suppressState); + // AZ::Debug::TraceMessageBus::BroadcastResult(m_oldSuppression, &AZ::Debug::TraceMessageEvents::OnOutput, "", ""); + // TraceSuppressionBus::Broadcast(&TraceSuppressionRequests::SuppressAllOutput, suppressState); } ~ScopedOutputSuppression() { - TraceSuppressionBus::Broadcast(&TraceSuppressionRequests::SuppressAllOutput, m_oldSuppression); + // TraceSuppressionBus::Broadcast(&TraceSuppressionRequests::SuppressAllOutput, m_oldSuppression); } private: bool m_oldSuppression = false; diff --git a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp index 3566d8da4b..88ef93a4c4 100644 --- a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp @@ -120,7 +120,10 @@ namespace ScriptCanvasEditor PopulateEditorCreatableTypes(); AzToolsFramework::RegisterGenericComboBoxHandler(); - AzToolsFramework::PropertyTypeRegistrationMessages::Bus::Broadcast(&AzToolsFramework::PropertyTypeRegistrationMessages::RegisterPropertyType, aznew SourceHandlePropertyHandler()); + if (AzToolsFramework::PropertyTypeRegistrationMessages::Bus::FindFirstHandler()) + { + AzToolsFramework::PropertyTypeRegistrationMessages::Bus::Broadcast(&AzToolsFramework::PropertyTypeRegistrationMessages::RegisterPropertyType, aznew SourceHandlePropertyHandler()); + } SystemRequestBus::Handler::BusConnect(); ScriptCanvasExecutionBus::Handler::BusConnect(); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Nodeable.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Nodeable.cpp index 093f87e1f7..023d46097d 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Nodeable.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Nodeable.cpp @@ -22,12 +22,16 @@ namespace ScriptCanvas Nodeable::Nodeable() : m_noOpFunctor(&NodeableOutCpp::NoOp) - {} + { + AZ_TracePrintf("SCDB", "How many times does this get called? Because it should....NOT GET CALLED!"); + } Nodeable::Nodeable(ExecutionStateWeakPtr executionState) : m_noOpFunctor(&NodeableOutCpp::NoOp) , m_executionState(executionState) - {} + { + AZ_TracePrintf("SCDB", "How many times does this get called 2?"); + } #if !defined(RELEASE) void Nodeable::CallOut(size_t index, AZ::BehaviorValueParameter* resultBVP, AZ::BehaviorValueParameter* argsBVPs, int numArguments) const @@ -80,6 +84,7 @@ namespace ScriptCanvas ->Attribute(AZ::ScriptCanvasAttributes::VariableCreationForbidden, AZ::AttributeIsValid::IfPresent) ->Attribute(AZ::Script::Attributes::UseClassIndexAllowNil, AZ::AttributeIsValid::IfPresent) ->Constructor() + ->Attribute(AZ::Script::Attributes::DefaultConstructorOverrideIndex, 0) ->Method("Deactivate", &Nodeable::Deactivate) ->Method("InitializeExecutionState", &Nodeable::InitializeExecutionState) ->Method("InitializeExecutionOuts", &Nodeable::InitializeExecutionOuts) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp index bbd16dfb96..a706d70629 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp @@ -68,6 +68,8 @@ namespace ExecutionInterpretedAPICpp { if (lua_isstring(lua, -1)) { + AZStd::string errorResult = lua_tostring(lua, -1); + AZ_TracePrintf("ScriptCanvas", errorResult.c_str()); AZ::ScriptContext::FromNativeContext(lua)->Error(AZ::ScriptContext::ErrorType::Error, true, "%s", lua_tostring(lua, -1)); } else @@ -402,6 +404,50 @@ namespace ScriptCanvas AZ_Assert(lua_isuserdata(lua, -2) && !lua_islightuserdata(lua, -2), "Error in compiled lua file, 1st argument to OverrideNodeableMetatable is not userdata (Nodeable)"); AZ_Assert(lua_istable(lua, -1), "Error in compiled lua file, 2nd argument to OverrideNodeableMetatable is not a Lua table"); + /* table is in the stack at index 't' */ + if (lua_istable(lua, -1)) + { + lua_getfield(lua, -1, "__index"); + + if (lua_istable(lua, -1)) + { + int t = -2; + AZStd::string tableGuts; + lua_pushnil(lua); + /* first key */ + while (lua_next(lua, t) != 0) + { + /* uses 'key' (at index -2) and 'value' (at index -1) */ + if (lua_type(lua, -2) == LUA_TSTRING) + { + size_t len; + tableGuts += AZStd::string::format("%s - %s\n", + lua_tolstring(lua, -2, &len), + lua_typename(lua, lua_type(lua, -1))); + } + else if (lua_type(lua, -2) == LUA_TNUMBER) + { + tableGuts += AZStd::string::format("%f - %s\n", + lua_tonumber(lua, -2), + lua_typename(lua, lua_type(lua, -1))); + } + else + { + tableGuts += AZStd::string::format("%s - %s\n", + lua_typename(lua, lua_type(lua, -2)), + lua_typename(lua, lua_type(lua, -1))); + } + + /* removes 'value'; keeps 'key' for next iteration */ + lua_pop(lua, 1); + } + + AZ_TracePrintf("SCDB", tableGuts.c_str()); + } + + lua_pop(lua, 1); + } + [[maybe_unused]] auto userData = reinterpret_cast(lua_touserdata(lua, -2)); AZ_Assert(userData && userData->magicData == AZ_CRC_CE("AZLuaUserData"), "this isn't user data"); // Lua: LuaUserData::nodeable, class_mt diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpreted.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpreted.cpp index 0f090574b5..3ae52846cd 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpreted.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpreted.cpp @@ -143,6 +143,8 @@ namespace ScriptCanvas AZ_Assert(m_luaRegistryIndex == LUA_NOREF, "ExecutionStateInterpreted already in the Lua registry and risks double deletion"); // Lua: instance m_luaRegistryIndex = luaL_ref(m_luaState, LUA_REGISTRYINDEX); + AZ_Assert(m_luaRegistryIndex != LUA_REFNIL, "ExecutionStateInterpreted was nil when trying to gain a reference"); + AZ_Assert(m_luaRegistryIndex != LUA_NOREF, "ExecutionStateInterpreted failed to gain a reference"); } void ExecutionStateInterpreted::Reflect(AZ::ReflectContext* reflectContext) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpretedPerActivation.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpretedPerActivation.cpp index 44b1364682..7ef1e22fbf 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpretedPerActivation.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpretedPerActivation.cpp @@ -111,10 +111,72 @@ namespace ScriptCanvas auto& lua = m_luaState; // Lua: lua_rawgeti(lua, LUA_REGISTRYINDEX, registryIndex); + if (!lua_isuserdata(lua, -1)) + { + AZ_TracePrintf("SCDB", "No light userdata"); + } + // Lua: instance + + lua_getmetatable(lua, -1); + if (!lua_istable(lua, -1)) + { + AZ_TracePrintf("SCDB", "no metatable"); + } + + + /* table is in the stack at index 't' */ + if (lua_istable(lua, -1)) + { + int t = -2; + AZStd::string tableGuts; + lua_pushnil(lua); + /* first key */ + while (lua_next(lua, t) != 0) + { + /* uses 'key' (at index -2) and 'value' (at index -1) */ + if (lua_type(lua, -2) == LUA_TSTRING) + { + size_t len; + tableGuts += AZStd::string::format("%s - %s\n", + lua_tolstring(lua, -2, &len), + lua_typename(lua, lua_type(lua, -1))); + } + else if (lua_type(lua, -2) == LUA_TNUMBER) + { + tableGuts += AZStd::string::format("%f - %s\n", + lua_tonumber(lua, -2), + lua_typename(lua, lua_type(lua, -1))); + } + else + { + tableGuts += AZStd::string::format("%s - %s\n", + lua_typename(lua, lua_type(lua, -2)), + lua_typename(lua, lua_type(lua, -1))); + } + + /* removes 'value'; keeps 'key' for next iteration */ + lua_pop(lua, 1); + } + + AZ_TracePrintf("SCDB", tableGuts.c_str()); + } + + // Lua: instance, instance_mt + lua_pop (lua, 1); + + // Lua: instance lua_getfield(lua, -1, Grammar::k_OnGraphStartFunctionName); // Lua: instance, graph_VM.k_OnGraphStartFunctionName + if (!lua_isfunction(lua, -1)) + { + AZ_TracePrintf("SCDB", "No function"); + } lua_pushvalue(lua, -2); + if (!lua_isuserdata(lua, -1)) + { + AZ_TracePrintf("SCDB", "No light userdata"); + } // Lua: instance, graph_VM.k_OnGraphStartFunctionName, instance const int result = Execution::InterpretedSafeCall(lua, 1, 0); // Lua: instance ? From c4ea3075cc5aad803493658932945a9990efd71d Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Wed, 24 Nov 2021 18:55:11 -0800 Subject: [PATCH 079/948] fixed unit tests bugs, removed commented out code, removed loading spam Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Builder/ScriptCanvasBuilder.cpp | 34 ++++- .../Code/Builder/ScriptCanvasBuilder.h | 1 - .../Code/Builder/ScriptCanvasBuilderWorker.h | 5 +- .../Editor/Assets/ScriptCanvasAssetHolder.cpp | 25 ---- .../Assets/ScriptCanvasAssetTracker.cpp | 103 --------------- .../Editor/Assets/ScriptCanvasAssetTracker.h | 3 - .../Assets/ScriptCanvasAssetTrackerBus.h | 12 -- .../Editor/Assets/ScriptCanvasMemoryAsset.cpp | 86 +------------ .../EditorScriptCanvasComponent.cpp | 2 - .../Code/Editor/Components/EditorUtils.cpp | 6 +- .../Framework/ScriptCanvasTraceUtilities.h | 6 +- .../Include/ScriptCanvas/Bus/RequestBus.h | 1 - .../ScriptCanvas/Components/EditorGraph.h | 7 - .../Code/Editor/View/Widgets/GraphTabBar.cpp | 30 ----- .../Code/Editor/View/Widgets/GraphTabBar.h | 7 - .../LoggingPanel/LoggingWindowTreeItems.cpp | 15 --- .../Code/Editor/View/Windows/MainWindow.cpp | 86 +------------ .../Windows/Tools/UpgradeTool/Controller.cpp | 8 +- .../Code/Include/ScriptCanvas/Core/Graph.cpp | 13 +- .../Include/ScriptCanvas/Core/Nodeable.cpp | 8 +- .../Interpreted/ExecutionInterpretedAPI.cpp | 50 +------- ...ExecutionStateInterpretedPerActivation.cpp | 64 +--------- .../Code/Tests/ScriptCanvas_VM.cpp | 120 ------------------ 23 files changed, 52 insertions(+), 640 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp index fe89c57009..31b63e8fad 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp @@ -16,6 +16,38 @@ #include #include +namespace BuildVariableOverridesCpp +{ + enum Version + { + EditorAssetRedux, + + // add description above + Current + }; + + bool VersionConverter + ( [[maybe_unused]] AZ::SerializeContext& serializeContext + , [[maybe_unused]] AZ::SerializeContext::DataElementNode& rootElement) + { + // #sc_editor_asset +// ScriptCanvasBuilder::BuildVariableOverrides overrides; +// overrides.m_source = SourceHandle(nullptr, assetHolder.GetAssetId().m_guid, {}); +// +// 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; + } +} + namespace ScriptCanvasBuilder { void BuildVariableOverrides::Clear() @@ -109,7 +141,7 @@ namespace ScriptCanvasBuilder if (auto serializeContext = azrtti_cast(reflectContext)) { serializeContext->Class() - ->Version(1) + ->Version(BuildVariableOverridesCpp::Version::Current, &BuildVariableOverridesCpp::VersionConverter) ->Field("source", &BuildVariableOverrides::m_source) ->Field("variables", &BuildVariableOverrides::m_variables) ->Field("entityId", &BuildVariableOverrides::m_entityIds) diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.h b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.h index 0dedd67847..5cffa823dc 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.h +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.h @@ -49,7 +49,6 @@ namespace ScriptCanvasBuilder // these two variable lists are all that gets exposed to the edit context AZStd::vector m_overrides; AZStd::vector m_overridesUnused; - // AZStd::vector m_entityIdRuntimeInputIndices; since all oSf the entity ids need to go in, they may not need indices AZStd::vector m_dependencies; }; diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h index e1bf80aa2e..77b90df3e0 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h @@ -59,10 +59,7 @@ namespace ScriptCanvasBuilder PrefabIntegration, CorrectGraphVariableVersion, ReflectEntityIdNodes, - - ForceBuildForDevTest0, - ForceBuildForDevTest1, - ForceBuildForDevTest2, + FixExecutionStateNodeableConstrution, // add new entries above Current, diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHolder.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHolder.cpp index c5c08d5bbe..f8c89ae7e5 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHolder.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHolder.cpp @@ -82,31 +82,6 @@ namespace ScriptCanvasEditor void ScriptCanvasAssetHolder::OpenEditor() const { - // #sc_editor_asset -// AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); -// -// AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); -// -// if (m_scriptCanvasAsset.IsReady()) -// { -// GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, m_scriptCanvasAsset.GetId(), -1); -// -// if (!openOutcome) -// { -// AZ_Warning("Script Canvas", openOutcome, "%s", openOutcome.GetError().data()); -// } -// } -// else if (m_ownerId.first.IsValid()) -// { -// AzToolsFramework::EntityIdList selectedEntityIds; -// AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult(selectedEntityIds, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities); -// -// // Going to bypass the multiple selected entities flow for right now. -// if (selectedEntityIds.size() == 1) -// { -// GeneralRequestBus::Broadcast(&GeneralRequests::CreateScriptCanvasAssetFor, m_ownerId); -// } -// } } ScriptCanvas::ScriptCanvasId ScriptCanvasAssetHolder::GetScriptCanvasId() const diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.cpp index 5ec620a907..09b967281d 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.cpp @@ -60,109 +60,6 @@ namespace ScriptCanvasEditor void AssetTracker::SaveAs(AZ::Data::AssetId /*assetId*/, const AZStd::string& /*path*/, Callbacks::OnSave /*onSaveCallback*/) { -// auto assetIter = m_assetsInUse.find(assetId); -// -// if (assetIter != m_assetsInUse.end()) -// { -// auto onSave = [this, assetId, onSaveCallback](bool saveSuccess, AZ::Data::AssetPtr asset, AZ::Data::AssetId previousFileAssetId) -// { -// AZ::Data::AssetId signalId = assetId; -// AZ::Data::AssetId fileAssetId = asset->GetId(); -// -// // If there is a previous file Id is valid, it means this is a save-as operation and we need to remap the tracking. -// if (previousFileAssetId.IsValid()) -// { -// if (saveSuccess) -// { -// fileAssetId = m_assetsInUse[assetId]->GetFileAssetId(); -// m_remappedAsset[asset->GetId()] = fileAssetId; -// -// // Erase the asset first so the smart pointer can deal with it's things. -// m_assetsInUse.erase(fileAssetId); -// -// // Then perform the insert once we know nothing will attempt to delete this while we are operating on it. -// m_assetsInUse[fileAssetId] = m_assetsInUse[assetId]; -// m_assetsInUse.erase(assetId); -// } -// -// m_savingAssets.erase(assetId); -// m_savingAssets.insert(fileAssetId); -// -// signalId = fileAssetId; -// -// if (m_queuedCloses.erase(assetId)) -// { -// m_queuedCloses.insert(fileAssetId); -// } -// -// auto assetIter = m_assetsInUse.find(fileAssetId); -// -// if (assetIter != m_assetsInUse.end()) -// { -// AZStd::invoke(onSaveCallback, saveSuccess, m_assetsInUse[fileAssetId]->GetAsset().Get(), previousFileAssetId); -// } -// else -// { -// AZ_Error("ScriptCanvas", !saveSuccess, "Unable to find Memory Asset for Asset(%s)", fileAssetId.ToString().c_str()); -// AZStd::invoke(onSaveCallback, saveSuccess, asset, previousFileAssetId); -// } -// } -// else -// { -// if (saveSuccess) -// { -// // This should be the case when we get a save as from a newly created file. -// // -// // If we find the 'memory' asset id in the assets in use. This means this was a new file that was saved. -// // To maintain all of the look-up stuff, we need to treat this like a remapping stage. -// auto assetInUseIter = m_assetsInUse.find(assetId); -// if (assetInUseIter != m_assetsInUse.end()) -// { -// fileAssetId = assetInUseIter->second->GetFileAssetId(); -// -// if (assetId != fileAssetId) -// { -// m_remappedAsset[assetId] = fileAssetId; -// -// m_assetsInUse.erase(fileAssetId); -// m_assetsInUse[fileAssetId] = AZStd::move(assetInUseIter->second); -// m_assetsInUse.erase(assetId); -// -// m_savingAssets.erase(assetId); -// m_savingAssets.insert(fileAssetId); -// -// if (m_queuedCloses.erase(assetId)) -// { -// m_queuedCloses.insert(fileAssetId); -// } -// } -// } -// else -// { -// fileAssetId = CheckAssetId(fileAssetId); -// } -// -// signalId = fileAssetId; -// } -// -// if (onSaveCallback) -// { -// AZStd::invoke(onSaveCallback, saveSuccess, m_assetsInUse[signalId]->GetAsset().Get(), previousFileAssetId); -// } -// -// AssetTrackerNotificationBus::Broadcast(&AssetTrackerNotifications::OnAssetSaved, m_assetsInUse[signalId], saveSuccess); -// } -// -// SignalSaveComplete(signalId); -// }; -// -// m_savingAssets.insert(assetId); -// assetIter->second->SaveAs(path, onSave); -// } -// else -// { -// AZ_Assert(false, "Cannot SaveAs into an existing AssetId"); -// } } bool AssetTracker::Load(AZ::Data::AssetId fileAssetId, AZ::Data::AssetType assetType, Callbacks::OnAssetReadyCallback onAssetReadyCallback) diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.h b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.h index 247aba3b94..aa06029c98 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.h +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.h @@ -23,9 +23,6 @@ namespace ScriptCanvasEditor { class ScriptCanvasMemoryAsset; - - // MOVE THIS MOSTLY TO TAB BAR, MAIN WINDOW AND THE CANVAS WIDGET - // This class tracks all things related to the assets that the Script Canvas editor // has in play. It also provides helper functionality to quickly getting asset information // from GraphCanvas diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerBus.h b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerBus.h index fd50b40768..7125cb7d9b 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerBus.h +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerBus.h @@ -155,17 +155,5 @@ namespace ScriptCanvasEditor using MemoryAssetSystemNotificationBus = AZ::EBus; } - class MemoryAssetNotifications - : public AZ::EBusTraits - { - public: - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple; - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; - using BusIdType = AZ::Data::AssetId; - - virtual void OnFileStateChanged(Tracker::ScriptCanvasFileState) {} - }; - - using MemoryAssetNotificationBus = AZ::EBus; ////////////////////////////////////////////////////////////////////////////////////////////////////////// } diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp index 7af1aa3d9f..01595e0702 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp @@ -285,8 +285,6 @@ namespace ScriptCanvasEditor ScriptCanvasEditor::Widget::CanvasWidget* ScriptCanvasMemoryAsset::CreateView(QWidget* /*parent*/) { - //m_canvasWidget = new Widget::CanvasWidget(m_fileAssetId, parent); - //return m_canvasWidget; return nullptr; } @@ -433,66 +431,11 @@ namespace ScriptCanvasEditor void ScriptCanvasMemoryAsset::SourceFileFailed(AZStd::string /*relativePath*/, AZStd::string /*scanFolder*/, AZ::Uuid) { -// AZStd::string fullPath; -// AzFramework::StringFunc::Path::Join(scanFolder.data(), relativePath.data(), fullPath); -// AzFramework::ApplicationRequests::Bus::Broadcast(&AzFramework::ApplicationRequests::NormalizePath, fullPath); -// -// auto assetPathIdIt = AZStd::find(m_pendingSave.begin(), m_pendingSave.end(), fullPath); -// -// if (assetPathIdIt != m_pendingSave.end()) -// { -// if (m_onSaveCallback) -// { -// m_onSaveCallback(false, m_inMemoryAsset.Get(), AZ::Data::AssetId()); -// m_onSaveCallback = nullptr; -// } -// -// m_pendingSave.erase(assetPathIdIt); -// } + } void ScriptCanvasMemoryAsset::SavingComplete(const AZStd::string& /*streamName*/, AZ::Uuid /*sourceAssetId*/) { -// AZStd::string normPath = streamName; -// AzFramework::ApplicationRequests::Bus::Broadcast(&AzFramework::ApplicationRequests::NormalizePath, normPath); -// -// auto assetPathIdIt = AZStd::find(m_pendingSave.begin(), m_pendingSave.end(), normPath); -// if (assetPathIdIt != m_pendingSave.end()) -// { -// AZ::Data::AssetId previousFileAssetId; -// -// if (sourceAssetId != m_fileAssetId.m_guid) -// { -// previousFileAssetId = m_fileAssetId; -// -// // The source file has changed, store the AssetId to the canonical asset on file -// SetFileAssetId(sourceAssetId); -// -// } -// else if (!m_fileAssetId.IsValid()) -// { -// SetFileAssetId(sourceAssetId); -// } -// -// m_formerGraphIdPair = AZStd::make_pair(m_scriptCanvasId, m_graphId); -// -// m_fileState = Tracker::ScriptCanvasFileState::UNMODIFIED; -// -// m_pendingSave.erase(assetPathIdIt); -// -// m_absolutePath = m_saveAsPath; -// m_saveAsPath.clear(); -// -// // Connect to the source asset's bus to monitor for situations we may need to handle -// AZ::Data::AssetBus::MultiHandler::BusConnect(m_inMemoryAsset.GetId()); -// AZ::Data::AssetBus::MultiHandler::BusConnect(m_fileAssetId); -// -// if (m_onSaveCallback) -// { -// m_onSaveCallback(true, m_inMemoryAsset.Get(), previousFileAssetId); -// m_onSaveCallback = nullptr; -// } -// } } void ScriptCanvasMemoryAsset::FinalizeAssetSave(bool, const AzToolsFramework::SourceControlFileInfo& fileInfo, const AZ::Data::AssetStreamInfo& saveInfo, Callbacks::OnSave onSaveCallback) @@ -528,17 +471,11 @@ namespace ScriptCanvasEditor void ScriptCanvasMemoryAsset::SetFileAssetId(const AZ::Data::AssetId& /*fileAssetId*/) { -// m_fileAssetId = fileAssetId; -// -// if (m_canvasWidget) -// { -// m_canvasWidget->SetAssetId(fileAssetId); -// } + } void ScriptCanvasMemoryAsset::SignalFileStateChanged() { - MemoryAssetNotificationBus::Event(m_fileAssetId, &MemoryAssetNotifications::OnFileStateChanged, GetFileState()); } AZStd::string ScriptCanvasMemoryAsset::MakeTemporaryFilePathForSave(AZStd::string_view targetFilename) @@ -607,25 +544,6 @@ namespace ScriptCanvasEditor bool AssetSaveFinalizer::ValidateStatus(const AzToolsFramework::SourceControlFileInfo& /*fileInfo*/) { -// auto fileIO = AZ::IO::FileIOBase::GetInstance(); -// if (fileInfo.IsLockedByOther()) -// { -// AZ_Error("Script Canvas", !fileInfo.IsLockedByOther(), "The file is already exclusively opened by another user: %s", fileInfo.m_filePath.data()); -// AZStd::invoke(m_onSave, false, m_inMemoryAsset, m_fileAssetId); -// return false; -// } -// else if (fileInfo.IsReadOnly() && fileIO->Exists(fileInfo.m_filePath.c_str())) -// { -// AZ_Error("Script Canvas", !fileInfo.IsReadOnly(), "File %s is read-only. It cannot be saved." -// " If this file is in Perforce it may not have been checked out by the Source Control API.", fileInfo.m_filePath.data()); -// AZStd::invoke(m_onSave, false, m_inMemoryAsset, m_fileAssetId); -// return false; -// } -// else if (m_saving) -// { -// AZ_Warning("Script Canvas", false, "Trying to save the same file twice. Will result in one save callback being ignored."); -// return false; -// } return true; } diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index 26fbf85a82..9209196873 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -51,8 +51,6 @@ namespace ScriptCanvasEditor { static bool EditorScriptCanvasComponentVersionConverter(AZ::SerializeContext& serializeContext, AZ::SerializeContext::DataElementNode& rootElement) { - AZ_TracePrintf("ScriptCanvas", "EditorScriptCanvasComponentVersionConverter called!"); - if (rootElement.GetVersion() <= 4) { int assetElementIndex = rootElement.FindElement(AZ::Crc32("m_asset")); diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp index d21b3d004c..2cd2dda89e 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp @@ -54,11 +54,7 @@ namespace ScriptCanvasEditor if (assetSystem->GetSourceInfoBySourcePath(fullPathHandle.Path().c_str(), assetInfo, watchFolder) && assetInfo.m_assetId.IsValid()) { - if (assetInfo.m_assetId.m_guid != source.Id()) - { - AZ_TracePrintf("ScriptCanvas", "This is what I don't get"); - } - + AZ_Warning("ScriptCanvas", assetInfo.m_assetId.m_guid == source.Id(), "SourceHandle completion produced conflicting AssetId."); auto path = fullPathHandle.Path(); return SourceHandle(source, assetInfo.m_assetId.m_guid, path.MakePreferred()); } diff --git a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h index dfcb0d2643..458852132d 100644 --- a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h +++ b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h @@ -163,13 +163,13 @@ namespace ScriptCanvasEditor { ScopedOutputSuppression([[maybe_unused]] bool suppressState = true) { - // AZ::Debug::TraceMessageBus::BroadcastResult(m_oldSuppression, &AZ::Debug::TraceMessageEvents::OnOutput, "", ""); - // TraceSuppressionBus::Broadcast(&TraceSuppressionRequests::SuppressAllOutput, suppressState); + AZ::Debug::TraceMessageBus::BroadcastResult(m_oldSuppression, &AZ::Debug::TraceMessageEvents::OnOutput, "", ""); + TraceSuppressionBus::Broadcast(&TraceSuppressionRequests::SuppressAllOutput, suppressState); } ~ScopedOutputSuppression() { - // TraceSuppressionBus::Broadcast(&TraceSuppressionRequests::SuppressAllOutput, m_oldSuppression); + TraceSuppressionBus::Broadcast(&TraceSuppressionRequests::SuppressAllOutput, m_oldSuppression); } private: bool m_oldSuppression = false; diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h index 15600c2b88..5ec0ee1636 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h @@ -54,7 +54,6 @@ namespace ScriptCanvasEditor NEW, MODIFIED, UNMODIFIED, - // #sc_editor_asset restore this SOURCE_REMOVED, INVALID = -1 }; diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h index 8a98601d54..319a835ba5 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h @@ -140,10 +140,6 @@ namespace ScriptCanvasEditor void ReleaseVariableCounter(AZ::u32 variableCounter) override; //// - // RuntimeBus - //AZ::Data::AssetId GetAssetId() const override { return m_assetId; } - //// - // GraphCanvas::GraphModelRequestBus void RequestUndoPoint() override; @@ -223,9 +219,6 @@ namespace ScriptCanvasEditor void OnGraphCanvasNodeCreated(const AZ::EntityId& nodeId) override; /////////////////////////// - // EditorGraphRequestBus - // void SetAssetId(const AZ::Data::AssetId& assetId) override { m_assetId = assetId; } - void CreateGraphCanvasScene() override; void ClearGraphCanvasScene() override; void DisplayGraphCanvasScene() override; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp index 17228565da..b00e2ea3de 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp @@ -251,16 +251,6 @@ namespace ScriptCanvasEditor { if (index >= 0 && index < count()) { - QVariant tabdata = tabData(index); - if (tabdata.isValid()) - { - // #sc_editor_asset fix tabData - auto tabAssetId = tabdata.value(); - - //MemoryAssetNotificationBus::MultiHandler::BusDisconnect(tabAssetId); - //AssetTrackerRequestBus::Broadcast(&AssetTrackerRequests::ClearView, tabAssetId); - } - qobject_cast(parent())->removeTab(index); } } @@ -271,8 +261,6 @@ namespace ScriptCanvasEditor { Q_EMIT TabCloseNoButton(i); } - - MemoryAssetNotificationBus::MultiHandler::BusDisconnect(); } void GraphTabBar::OnContextMenu(const QPoint& point) @@ -289,8 +277,6 @@ namespace ScriptCanvasEditor auto tabAssetId = tabdata.value(); Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::INVALID; - //AssetTrackerRequestBus::BroadcastResult(fileState , &AssetTrackerRequests::GetFileState, tabAssetId); - isModified = fileState == Tracker::ScriptCanvasFileState::NEW || fileState == Tracker::ScriptCanvasFileState::MODIFIED; } @@ -362,22 +348,6 @@ namespace ScriptCanvasEditor AzQtComponents::TabBar::mouseReleaseEvent(event); } - void GraphTabBar::OnFileStateChanged(Tracker::ScriptCanvasFileState ) - { - // #sc_editor_asset - // const AZ::Data::AssetId* fileAssetId = MemoryAssetNotificationBus::GetCurrentBusId(); - -// if (fileAssetId) -// { -// SetFileState((*fileAssetId), fileState); -// -// if (FindTab((*fileAssetId)) == currentIndex()) -// { -// Q_EMIT OnActiveFileStateChanged(); -// } -// } - } - void GraphTabBar::SetTabText(int tabIndex, const QString& path, Tracker::ScriptCanvasFileState fileState) { if (tabIndex >= 0 && tabIndex < count()) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h index 9d86583f76..40b785f016 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h @@ -42,7 +42,6 @@ namespace ScriptCanvasEditor class GraphTabBar : public AzQtComponents::TabBar - , public MemoryAssetNotificationBus::MultiHandler { Q_OBJECT @@ -63,8 +62,6 @@ namespace ScriptCanvasEditor int InsertGraphTab(int tabIndex, ScriptCanvasEditor::SourceHandle assetId, Tracker::ScriptCanvasFileState fileState); bool SelectTab(ScriptCanvasEditor::SourceHandle assetId); - // void ConfigureTab(int tabIndex, ScriptCanvasEditor::SourceHandle fileAssetId, const AZStd::string& tabName); - int FindTab(ScriptCanvasEditor::SourceHandle assetId) const; ScriptCanvasEditor::SourceHandle FindTabByPath(AZStd::string_view path) const; ScriptCanvasEditor::SourceHandle FindAssetId(int tabIndex); @@ -78,10 +75,6 @@ namespace ScriptCanvasEditor void mouseReleaseEvent(QMouseEvent* event) override; - // MemoryAssetNotifications - void OnFileStateChanged(Tracker::ScriptCanvasFileState fileState) override; - //// - // Updates the tab at the supplied index with the GraphTabMetadata // The host widget field of the tabMetadata is not used and will not overwrite the tab data void SetTabText(int tabIndex, const QString& path, Tracker::ScriptCanvasFileState fileState = Tracker::ScriptCanvasFileState::INVALID); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.cpp index a9ffe30fb1..636ee832d4 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.cpp @@ -137,17 +137,6 @@ namespace ScriptCanvasEditor m_additionTimer.start(); } } - - if (m_updatePolicy == UpdatePolicy::SingleTime) - { - // #sc_editor_asset - // treeItem = CreateChildNodeWithoutAddSignal(loggingDataId, nodeType, graphInfo, nodeId); - } - else - { - // #sc_editor_asset - // treeItem = CreateChildNode(loggingDataId, nodeType, graphInfo, nodeId); - } return treeItem; } @@ -207,9 +196,6 @@ namespace ScriptCanvasEditor AZ::NamedEntityId entityName; - // #sc_editor_asset restore this - //LoggingDataRequestBus::EventResult(entityName, m_loggingDataId, &LoggingDataRequests::FindNamedEntityId, m_graphInfo.m_runtimeEntity); - m_sourceEntityName = entityName.ToString().c_str(); m_displayName = nodeId.m_name.c_str(); @@ -514,7 +500,6 @@ namespace ScriptCanvasEditor const ScriptCanvas::GraphIdentifier& ExecutionLogTreeItem::GetGraphIdentifier() const { - // #sc_editor_asset return m_graphIdentifier; } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 06c907f56d..f9653031b4 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -1667,42 +1667,6 @@ namespace ScriptCanvasEditor return SaveAssetImpl(m_activeGraph, Save::As); } - /* - bool MainWindow::SaveAssetImpl_OLD(const ScriptCanvasEditor::SourceHandle& assetId, const Callbacks::OnSave& saveCB) - { - if (!assetId.IsValid()) - { - return false; - } - - // TODO: Set graph read-only to prevent edits during save - - bool saveSuccessful = false; - - Tracker::ScriptCanvasFileState fileState = GetAssetFileState(assetId); - - if (fileState == Tracker::ScriptCanvasFileState::NEW) - { - saveSuccessful = SaveAssetImpl(assetId, saveCB); - } - else if (fileState == Tracker::ScriptCanvasFileState::MODIFIED - || fileState == Tracker::ScriptCanvasFileState::SOURCE_REMOVED) - { - SaveAs(assetId.Path(), assetId, saveCB); - saveSuccessful = true; - } - - return saveSuccessful; - } - */ - - - // 1. SaveAssetImpl - // 2. SaveAs - // // 3. OnSaveCallback - // SaveAsEnd - // SaveAssetImpl end - bool MainWindow::SaveAssetImpl(const ScriptCanvasEditor::SourceHandle& inMemoryAssetId, Save save) { if (!inMemoryAssetId.IsGraphValid()) @@ -1770,11 +1734,6 @@ namespace ScriptCanvasEditor AZ::IO::FileIOBase::GetInstance()->ResolvePath("@engroot@", assetRootChar.data(), assetRootChar.size()); assetRoot = assetRootChar.data(); -// if (!AZ::StringFunc::StartsWith(filePath, assetRoot)) -// { -// QMessageBox::information(this, "Unable to Save", AZStd::string::format("You must select a path within the current project\n\n%s", assetRoot.c_str()).c_str()); -// } -// else if (AzFramework::StringFunc::Path::GetFileName(filePath.c_str(), fileName)) { isValidFileName = !(fileName.empty()); @@ -1926,14 +1885,6 @@ namespace ScriptCanvasEditor { m_tabBar->setCurrentIndex(saveTabIndex); } - else - { -// // Something weird happens with our saving. Where we are relying on these scene changes being called. -// ScriptCanvasEditor::SourceHandle previousAssetId = m_activeGraph; -// -// OnChangeActiveGraphTab(ScriptCanvasEditor::SourceHandle()); -// OnChangeActiveGraphTab(previousAssetId); - } UpdateAssignToSelectionState(); @@ -2367,6 +2318,7 @@ namespace ScriptCanvasEditor GraphCanvas::ViewRequestBus::Event(viewId, &GraphCanvas::ViewRequests::CenterOnEndOfChain); } + // #sc_editor_asset void MainWindow::UpdateWorkspaceStatus(const ScriptCanvasMemoryAsset& /*memoryAsset*/) { // only occurs on file open, do it there, if necessary @@ -2658,16 +2610,6 @@ namespace ScriptCanvasEditor void MainWindow::Clear() { m_tabBar->CloseAllTabs(); - // #sc_editor_asset -// -// AssetTrackerRequests::AssetList assets; -// AssetTrackerRequestBus::BroadcastResult(assets, &AssetTrackerRequests::GetAssets); -// -// for (auto asset : assets) -// { -// RemoveScriptCanvasAsset(asset->GetAsset().GetId()); -// } - SetActiveAsset({}); } @@ -4095,32 +4037,6 @@ namespace ScriptCanvasEditor void MainWindow::PrepareAssetForSave(const ScriptCanvasEditor::SourceHandle& /*assetId*/) { - /* - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); - - if (memoryAsset) - { - AZ::EntityId graphId = memoryAsset->GetGraphId(); - AZ::EntityId scriptCanvasId = memoryAsset->GetScriptCanvasId(); - - AZ::Entity* entity = nullptr; - GraphRequestBus::EventResult(entity, scriptCanvasId, &GraphRequests::GetGraphEntity); - - if (entity) - { - GraphCanvas::GraphModelRequestBus::Event(graphId, &GraphCanvas::GraphModelRequests::OnSaveDataDirtied, entity->GetId()); - } - - GraphCanvas::GraphModelRequestBus::Event(graphId, &GraphCanvas::GraphModelRequests::OnSaveDataDirtied, graphId); - - ScriptCanvasEditor::Graph* graph = AZ::EntityUtils::FindFirstDerivedComponent(entity); - if (graph) - { - graph->MarkVersion(); - } - } - */ } void MainWindow::RestartAutoTimerSave(bool forceTimer) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp index 888f183151..b8ae59d43b 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp @@ -323,13 +323,7 @@ namespace ScriptCanvasEditor m_view->tableWidget->setCellWidget(rowIndex, static_cast(ColumnAction), upgradeButton); } - - char resolvedBuffer[AZ_MAX_PATH_LEN] = { 0 }; - AZStd::string path = AZStd::string::format("@devroot@/%s", assetInfo.Path().c_str()); - AZ::IO::FileIOBase::GetInstance()->ResolvePath(path.c_str(), resolvedBuffer, AZ_MAX_PATH_LEN); - AZ::StringFunc::Path::GetFullPath(resolvedBuffer, path); - AZ::StringFunc::Path::Normalize(path); - + bool result = false; AZ::Data::AssetInfo info; AZStd::string watchFolder; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp index aff212fa4c..9c2c854055 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp @@ -72,19 +72,16 @@ namespace ScriptCanvas componentElementNode.AddElementWithData(context, "m_assetType", azrtti_typeid()); } - if (componentElementNode.GetVersion() <= GraphCpp::GraphVersion::RemoveFunctionGraphMarker) + if (auto subElement = componentElementNode.FindElement(AZ_CRC_CE("isFunctionGraph")); subElement > 0) { - componentElementNode.RemoveElementByName(AZ_CRC_CE("isFunctionGraph")); + componentElementNode.RemoveElement(subElement); } - if (componentElementNode.GetVersion() < GraphCpp::GraphVersion::FixupVersionDataTypeId) + if (auto subElement = componentElementNode.FindSubElement(AZ_CRC_CE("versionData"))) { - if (auto subElement = componentElementNode.FindSubElement(AZ_CRC_CE("versionData"))) + if (subElement->GetId() == azrtti_typeid()) { - if (subElement->GetId() == azrtti_typeid()) - { - componentElementNode.RemoveElementByName(AZ_CRC_CE("versionData")); - } + componentElementNode.RemoveElementByName(AZ_CRC_CE("versionData")); } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Nodeable.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Nodeable.cpp index 023d46097d..7bb37a87dc 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Nodeable.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Nodeable.cpp @@ -22,16 +22,12 @@ namespace ScriptCanvas Nodeable::Nodeable() : m_noOpFunctor(&NodeableOutCpp::NoOp) - { - AZ_TracePrintf("SCDB", "How many times does this get called? Because it should....NOT GET CALLED!"); - } + {} Nodeable::Nodeable(ExecutionStateWeakPtr executionState) : m_noOpFunctor(&NodeableOutCpp::NoOp) , m_executionState(executionState) - { - AZ_TracePrintf("SCDB", "How many times does this get called 2?"); - } + {} #if !defined(RELEASE) void Nodeable::CallOut(size_t index, AZ::BehaviorValueParameter* resultBVP, AZ::BehaviorValueParameter* argsBVPs, int numArguments) const diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp index a706d70629..1855b348f2 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp @@ -68,9 +68,7 @@ namespace ExecutionInterpretedAPICpp { if (lua_isstring(lua, -1)) { - AZStd::string errorResult = lua_tostring(lua, -1); - AZ_TracePrintf("ScriptCanvas", errorResult.c_str()); - AZ::ScriptContext::FromNativeContext(lua)->Error(AZ::ScriptContext::ErrorType::Error, true, "%s", lua_tostring(lua, -1)); + AZ::ScriptContext::FromNativeContext(lua)->Error(AZ::ScriptContext::ErrorType::Error, true, lua_tostring(lua, -1)); } else { @@ -403,51 +401,7 @@ namespace ScriptCanvas // \note: the the object is being constructed, and is assumed to never leave or re-enter Lua again AZ_Assert(lua_isuserdata(lua, -2) && !lua_islightuserdata(lua, -2), "Error in compiled lua file, 1st argument to OverrideNodeableMetatable is not userdata (Nodeable)"); AZ_Assert(lua_istable(lua, -1), "Error in compiled lua file, 2nd argument to OverrideNodeableMetatable is not a Lua table"); - - /* table is in the stack at index 't' */ - if (lua_istable(lua, -1)) - { - lua_getfield(lua, -1, "__index"); - - if (lua_istable(lua, -1)) - { - int t = -2; - AZStd::string tableGuts; - lua_pushnil(lua); - /* first key */ - while (lua_next(lua, t) != 0) - { - /* uses 'key' (at index -2) and 'value' (at index -1) */ - if (lua_type(lua, -2) == LUA_TSTRING) - { - size_t len; - tableGuts += AZStd::string::format("%s - %s\n", - lua_tolstring(lua, -2, &len), - lua_typename(lua, lua_type(lua, -1))); - } - else if (lua_type(lua, -2) == LUA_TNUMBER) - { - tableGuts += AZStd::string::format("%f - %s\n", - lua_tonumber(lua, -2), - lua_typename(lua, lua_type(lua, -1))); - } - else - { - tableGuts += AZStd::string::format("%s - %s\n", - lua_typename(lua, lua_type(lua, -2)), - lua_typename(lua, lua_type(lua, -1))); - } - - /* removes 'value'; keeps 'key' for next iteration */ - lua_pop(lua, 1); - } - - AZ_TracePrintf("SCDB", tableGuts.c_str()); - } - - lua_pop(lua, 1); - } - + [[maybe_unused]] auto userData = reinterpret_cast(lua_touserdata(lua, -2)); AZ_Assert(userData && userData->magicData == AZ_CRC_CE("AZLuaUserData"), "this isn't user data"); // Lua: LuaUserData::nodeable, class_mt diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpretedPerActivation.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpretedPerActivation.cpp index 7ef1e22fbf..425af171c5 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpretedPerActivation.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpretedPerActivation.cpp @@ -111,75 +111,13 @@ namespace ScriptCanvas auto& lua = m_luaState; // Lua: lua_rawgeti(lua, LUA_REGISTRYINDEX, registryIndex); - if (!lua_isuserdata(lua, -1)) - { - AZ_TracePrintf("SCDB", "No light userdata"); - } - // Lua: instance - - lua_getmetatable(lua, -1); - if (!lua_istable(lua, -1)) - { - AZ_TracePrintf("SCDB", "no metatable"); - } - - - /* table is in the stack at index 't' */ - if (lua_istable(lua, -1)) - { - int t = -2; - AZStd::string tableGuts; - lua_pushnil(lua); - /* first key */ - while (lua_next(lua, t) != 0) - { - /* uses 'key' (at index -2) and 'value' (at index -1) */ - if (lua_type(lua, -2) == LUA_TSTRING) - { - size_t len; - tableGuts += AZStd::string::format("%s - %s\n", - lua_tolstring(lua, -2, &len), - lua_typename(lua, lua_type(lua, -1))); - } - else if (lua_type(lua, -2) == LUA_TNUMBER) - { - tableGuts += AZStd::string::format("%f - %s\n", - lua_tonumber(lua, -2), - lua_typename(lua, lua_type(lua, -1))); - } - else - { - tableGuts += AZStd::string::format("%s - %s\n", - lua_typename(lua, lua_type(lua, -2)), - lua_typename(lua, lua_type(lua, -1))); - } - - /* removes 'value'; keeps 'key' for next iteration */ - lua_pop(lua, 1); - } - - AZ_TracePrintf("SCDB", tableGuts.c_str()); - } - - // Lua: instance, instance_mt - lua_pop (lua, 1); - - // Lua: instance lua_getfield(lua, -1, Grammar::k_OnGraphStartFunctionName); // Lua: instance, graph_VM.k_OnGraphStartFunctionName - if (!lua_isfunction(lua, -1)) - { - AZ_TracePrintf("SCDB", "No function"); - } lua_pushvalue(lua, -2); - if (!lua_isuserdata(lua, -1)) - { - AZ_TracePrintf("SCDB", "No light userdata"); - } // Lua: instance, graph_VM.k_OnGraphStartFunctionName, instance const int result = Execution::InterpretedSafeCall(lua, 1, 0); - // Lua: instance ? + // Lua: instance, ? if (result == LUA_OK) { // Lua: instance diff --git a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_VM.cpp b/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_VM.cpp index 2a20ca84df..2c455d80f5 100644 --- a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_VM.cpp +++ b/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_VM.cpp @@ -25,126 +25,6 @@ using namespace ScriptCanvasTests; using namespace TestNodes; using namespace ScriptCanvas::Execution; -// TODO: This fails to compile on Linux only -//ScriptCanvas::Grammar::SubgraphInterface* CreateExecutionMap(AZ::BehaviorContext& behaviorContext) -//{ -// using namespace ScriptCanvas; -// using namespace ScriptCanvas::Grammar; -// -// auto ins = CreateInsFromBehaviorContextMethods("TestNodeableObject", behaviorContext, { "Branch" } ); -// auto branchOutVoidTrue = CreateOut("BranchTrue", { "condition", "message" }); -// auto branchOutVoidFalse = CreateOut("BranchFalse", { "condition", "message", "vector" }); -// -// auto branchOut = FindInByName("Branch", ins); -// -// EXPECT_NE(branchOut, nullptr); -// if (branchOut) -// { -// branchOut->outs.emplace_back(AZStd::move(branchOutVoidTrue)); -// branchOut->outs.emplace_back(AZStd::move(branchOutVoidFalse)); -// } -// -// return aznew SubgraphInterface(AZStd::move(ins)); -//} - - -TEST_F(ScriptCanvasTestFixture, TestLuaObjectOrientation) -{ - using namespace ScriptCanvas; - using namespace ScriptCanvas::Grammar; - - AZ::ScriptContext sc; - sc.BindTo(m_behaviorContext); - RegisterAPI(sc.NativeContext()); - EXPECT_TRUE(sc.Execute( - R"LUA( - -assert(Nodeable ~= nil, 'Nodeable was nill') -assert(Nodeable.__call ~= nil, 'Nodeable.__call was nil') -assert(type(Nodeable.__call) == 'function', 'Nodeable.__call was not a function') - -local nodeable = Nodeable() -assert(nodeable ~= nil, 'nodeable was nil') -assert(type(nodeable) == "userdata", 'nodeable not userdata') - -local SubGraph = {} -SubGraph.s_name = "SubGraphery" -SubGraph.s_createdCount = 0 -function SubGraph:IncrementCreated() - SubGraph.s_createdCount = 1 + SubGraph.s_createdCount -end - -setmetatable(SubGraph, { __index = Nodeable }) -- exposed through BehaviorContext -local SubGraphInstanceMetatable = { __index = SubGraph } - -assert(getmetatable(SubGraph).__index == Nodeable, 'getmetatable(SubGraph).__index = Nodeable') -assert(type(getmetatable(SubGraph).__index) == 'table', "type(getmetatable(SubGraph).__index) ~= 'table'") - -function SubGraph.new() -- Add executionState input here and to Nodeable() - -- now individual instance values can be initialized - local instance = OverrideNodeableMetatable(Nodeable(), SubGraphInstanceMetatable) - assert(type(instance.s_createdCount) == 'number', 'subgraph.s_createdCount was not a number') - instance:IncrementCreated() - instance.name = 'SubGraph '..tostring(instance.s_createdCount) - return instance -end - -function SubGraph.newTable() -- Add executionState input here and to Nodeable() - -- now individual instance values can be initialized - local instance = setmetatable({}, SubGraphInstanceMetatable) - -- assert(getmetatable(instance) == SubGraphInstanceMetatable, "subgraphT") - assert(type(instance.s_createdCount) == 'number', 'subgraphT.s_createdCount was not a number') - instance:IncrementCreated() - instance.name = 'SubGraph '..tostring(instance.s_createdCount) - return instance -end - -function SubGraph:Foo() - return "I, " .. tostring(self.name) .. ", am a user function" -end - -local subgraphT = SubGraph.newTable() -assert(subgraphT ~= nil, "subgraphT was nil") -assert(type(subgraphT) == 'table', 'subgraphT was not a table') -assert(type(subgraphT.IsActive)== 'function', "subgraphT IsActive was not a function") -assert(type(subgraphT.Foo) == 'function', 'subgraphT was not a function') -local subgraphTResult = subgraphT:Foo() -assert(subgraphTResult == "I, SubGraph 1, am a user function", 'subgraphT did not return the right results:' .. tostring(subgraphTResult)) -assert(subgraphT.s_createdCount == 1, "subgraphT created count was not one: ".. tostring(subgraphT.s_createdCount)) -subgraphT = SubGraph.newTable() -assert(subgraphT.s_createdCount == 2, "subgraphT created count was not two: ".. tostring(subgraphT.s_createdCount)) - -local subgraph = SubGraph.new() -assert(subgraph ~= nil, "subgraph was nil") -assert(type(subgraph) == 'userdata', 'was not userdata') -assert(type(subgraph.IsActive)== 'function', "IsActive was not a function") -assert(not subgraph.IsActive(subgraph), "did not inherit properly") -assert(not subgraph:IsActive(), "did not inherit properly") -assert(type(subgraph.Foo) == 'function', 'was not a function') -local subgraphResult = subgraph:Foo() -assert(subgraphResult == "I, SubGraph 3, am a user function", 'subgraph:Foo() did not return the right results: ' .. tostring(subgraphResult)) -assert(subgraph.s_createdCount == 3, "created count was not three: "..tostring(subgraph.s_createdCount)) - -local subgraph2 = SubGraph.new() -assert(subgraph2 ~= nil, "subgraph2 was nil") -assert(type(subgraph2) == 'userdata', 'subgraph2 was not userdata') -assert(type(subgraph2.IsActive)== 'function', "subgraph2 IsActive was not a function") -assert(not subgraph2.IsActive(subgraph2), "subgraph2 did not inherit properly") -assert(not subgraph2:IsActive(), "subgraph2 did not inherit properly") -assert(type(subgraph2.Foo) == 'function', 'subgraph2 was not a function') -local subgraph2Result = subgraph2:Foo() -assert(subgraph2Result == "I, SubGraph 4, am a user function", 'subgraph2:Foo() did not return the right results: ' .. tostring(subgraph2Result)) -assert(subgraph2.s_createdCount == 4, "created count was not three: "..tostring(subgraph2.s_createdCount)) - -return SubGraph - -)LUA" -)); - -} - - -// // TEST_F(ScriptCanvasTestFixture, NativeNodeableStack) // { // TestNodeableObject nodeable; From 55fa33cff4bb4a0e5f7aff8d00e925c53afd8786 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Mon, 29 Nov 2021 13:43:39 -0800 Subject: [PATCH 080/948] Clean up modifier asset handling. Fix file handling string error. Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Assets/ScriptCanvasFileHandling.cpp | 3 +- .../Windows/Tools/UpgradeTool/Modifier.cpp | 49 +++++++++---------- .../View/Windows/Tools/UpgradeTool/Modifier.h | 5 +- 3 files changed, 28 insertions(+), 29 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp index 8cecdc86d9..706c46fa75 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp @@ -317,8 +317,7 @@ namespace ScriptCanvasEditor auto saveOutcome = JSRU::SaveObjectToStream(graphData, stream, nullptr, &settings); if (!saveOutcome.IsSuccess()) { - AZStd::string result = saveOutcome.TakeError(); - return AZ::Failure(AZStd::string("JSON serialization failed to save source: %s", result.c_str())); + return AZ::Failure(AZStd::string::format("JSON serialization failed to save source: %s", saveOutcome.GetError().c_str())); } return AZ::Success(); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp index 71aeb1dbb9..242aea355e 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp @@ -32,6 +32,14 @@ namespace ScriptCanvasEditor AZ::SystemTickBus::Handler::BusConnect(); } + size_t Modifier::GetCurrentIndex() const + { + return m_state == State::GatheringDependencies + ? m_assetIndex + : m_dependencyOrderedAssetIndicies[m_assetIndex]; + + } + AZStd::unordered_set& Modifier::GetOrCreateDependencyIndexSet() { auto iter = m_dependencies.find(m_assetIndex); @@ -55,10 +63,10 @@ namespace ScriptCanvasEditor AZ_Assert(serializeContext, "SerializeContext is required to enumerate dependent assets in the ScriptCanvas file"); bool anyFailures = false; - auto asset = LoadAsset(); - if (asset.Get() && asset.Mod()->GetGraphData()) + + if (m_result.asset.Get() && m_result.asset.Mod()->GetGraphData()) { - auto graphData = asset.Mod()->GetGraphData(); + auto graphData = m_result.asset.Mod()->GetGraphData(); auto dependencyGrabber = [this] ( void* instancePointer @@ -94,19 +102,19 @@ namespace ScriptCanvasEditor { anyFailures = true; VE_LOG("Modifier: ERROR - Failed to gather dependencies from graph data: %s" - , ModCurrentAsset().Path().c_str()) + , m_result.asset.Path().c_str()) } } else { anyFailures = true; VE_LOG("Modifier: ERROR - Failed to load asset %s for modification, even though it scanned properly" - , ModCurrentAsset().Path().c_str()); + , m_result.asset.Path().c_str()); } ModelNotificationsBus::Broadcast ( &ModelNotificationsTraits::OnUpgradeDependenciesGathered - , ModCurrentAsset() + , m_result.asset , anyFailures ? Result::Failure : Result::Success); ReleaseCurrentAsset(); @@ -115,9 +123,9 @@ namespace ScriptCanvasEditor AZ::Data::AssetManager::Instance().DispatchEvents(); } - SourceHandle Modifier::LoadAsset() + void Modifier::LoadAsset() { - auto& handle = ModCurrentAsset(); + auto& handle = m_result.asset; if (!handle.IsGraphValid()) { auto outcome = LoadFromFile(handle.Path().c_str()); @@ -126,8 +134,6 @@ namespace ScriptCanvasEditor handle = outcome.TakeValue(); } } - - return handle; } void Modifier::ModificationComplete(const ModificationResult& result) @@ -144,25 +150,18 @@ namespace ScriptCanvasEditor } } - SourceHandle& Modifier::ModCurrentAsset() - { - return m_state == State::GatheringDependencies - ? m_assets[m_assetIndex] - : m_assets[m_dependencyOrderedAssetIndicies[m_assetIndex]]; - } - void Modifier::ModifyCurrentAsset() { m_result = {}; - m_result.asset = ModCurrentAsset(); - - ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnUpgradeModificationBegin, m_config, ModCurrentAsset()); + m_result.asset = m_assets[GetCurrentIndex()]; + ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnUpgradeModificationBegin, m_config, m_result.asset); + LoadAsset(); - if (auto asset = LoadAsset(); asset.IsGraphValid()) + if (m_result.asset.IsGraphValid()) { ModificationNotificationsBus::Handler::BusConnect(); m_modifyState = ModifyState::InProgress; - m_config.modification(asset); + m_config.modification(m_result.asset); } else { @@ -173,7 +172,7 @@ namespace ScriptCanvasEditor void Modifier::ModifyNextAsset() { ModelNotificationsBus::Broadcast - ( &ModelNotificationsTraits::OnUpgradeModificationEnd, m_config, ModCurrentAsset(), m_result); + ( &ModelNotificationsTraits::OnUpgradeModificationEnd, m_config, m_result.asset, m_result); ModificationNotificationsBus::Handler::BusDisconnect(); m_modifyState = ModifyState::Idle; ReleaseCurrentAsset(); @@ -183,7 +182,7 @@ namespace ScriptCanvasEditor void Modifier::ReleaseCurrentAsset() { - ModCurrentAsset() = ModCurrentAsset().Describe(); + m_result.asset = m_result.asset.Describe(); } void Modifier::ReportModificationError(AZStd::string_view report) @@ -381,7 +380,7 @@ namespace ScriptCanvasEditor (ScriptCanvas::k_VersionExplorerWindow.data() , false , "Modifier: Dependency sort has failed during, circular dependency detected for Asset: %s" - , modifier->ModCurrentAsset().Path().c_str()); + , modifier->m_result.asset.Path().c_str()); return; } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h index 78c9b3a877..32b9253bb5 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h @@ -67,6 +67,7 @@ namespace ScriptCanvasEditor State m_state = State::GatheringDependencies; ModifyState m_modifyState = ModifyState::Idle; size_t m_assetIndex = 0; + AZStd::function m_onComplete; // asset infos in scanned order AZStd::vector m_assets; @@ -82,10 +83,10 @@ namespace ScriptCanvasEditor AZStd::unique_ptr m_fileSaver; FileSaveResult m_fileSaveResult; + size_t GetCurrentIndex() const; void GatherDependencies(); AZStd::unordered_set& GetOrCreateDependencyIndexSet(); - SourceHandle LoadAsset(); - SourceHandle& ModCurrentAsset(); + void LoadAsset(); void ModifyCurrentAsset(); void ModifyNextAsset(); void ModificationComplete(const ModificationResult& result) override; From 499cdaae5e69c3eb9b4f6444f1639ab3203634df Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Wed, 1 Dec 2021 22:18:32 -0800 Subject: [PATCH 081/948] version upgrader in a presumed working story Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Editor/Assets/ScriptCanvasFileHandling.cpp | 5 ++--- .../Code/Editor/Components/EditorGraph.cpp | 4 ++-- .../Code/Editor/Components/GraphUpgrade.cpp | 6 ++++-- .../ScriptCanvas/Components/EditorGraph.h | 2 +- .../Windows/Tools/UpgradeTool/FileSaver.cpp | 13 ++++++++++++- .../Windows/Tools/UpgradeTool/Modifier.cpp | 18 ++++++++++-------- .../Code/Include/ScriptCanvas/Core/Core.h | 6 +++--- .../ScriptCanvas/Grammar/ParsingMetaData.cpp | 8 ++++---- 8 files changed, 38 insertions(+), 24 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp index 706c46fa75..be909e5043 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp @@ -209,7 +209,6 @@ namespace ScriptCanvasEditor AZ::Outcome LoadFromFile(AZStd::string_view path) { namespace JSRU = AZ::JsonSerializationUtils; - using namespace ScriptCanvas; auto fileStringOutcome = AZ::Utils::ReadFile(path); if (!fileStringOutcome) @@ -218,7 +217,7 @@ namespace ScriptCanvasEditor } const auto& asString = fileStringOutcome.GetValue(); - DataPtr scriptCanvasData = AZStd::make_shared(); + ScriptCanvas::DataPtr scriptCanvasData = aznew ScriptCanvas::ScriptCanvasData(); if (!scriptCanvasData) { return AZ::Failure(AZStd::string("failed to allocate ScriptCanvas::ScriptCanvasData after loading source file")); @@ -314,7 +313,7 @@ namespace ScriptCanvasEditor listener->OnSerialize(); } - auto saveOutcome = JSRU::SaveObjectToStream(graphData, stream, nullptr, &settings); + auto saveOutcome = JSRU::SaveObjectToStream(graphData.get(), stream, nullptr, &settings); if (!saveOutcome.IsSuccess()) { return AZ::Failure(AZStd::string::format("JSON serialization failed to save source: %s", saveOutcome.GetError().c_str())); diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp index 7135d983fd..22f9359a09 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp @@ -1069,7 +1069,7 @@ namespace ScriptCanvasEditor m_owner = &owner; } - ScriptCanvas::ScriptCanvasData* Graph::GetOwnership() const + ScriptCanvas::DataPtr Graph::GetOwnership() const { return const_cast(this)->m_owner; } @@ -1356,7 +1356,7 @@ namespace ScriptCanvasEditor void Graph::SignalDirty() { - SourceHandle handle(m_owner->shared_from_this(), {}, {}); + SourceHandle handle(m_owner, {}, {}); GeneralRequestBus::Broadcast(&GeneralRequests::SignalSceneDirty, handle); } diff --git a/Gems/ScriptCanvas/Code/Editor/Components/GraphUpgrade.cpp b/Gems/ScriptCanvas/Code/Editor/Components/GraphUpgrade.cpp index e64a47a753..fec813b0c1 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/GraphUpgrade.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/GraphUpgrade.cpp @@ -438,10 +438,11 @@ namespace ScriptCanvasEditor if (nodeConfig.IsValid()) { ScriptCanvas::NodeUpdateSlotReport nodeUpdateSlotReport; + auto nodeEntity = node->GetEntityId(); auto nodeOutcome = graph->ReplaceNodeByConfig(node, nodeConfig, nodeUpdateSlotReport); if (nodeOutcome.IsSuccess()) { - ScriptCanvas::MergeUpdateSlotReport(node->GetEntityId(), sm->m_updateReport, nodeUpdateSlotReport); + ScriptCanvas::MergeUpdateSlotReport(nodeEntity, sm->m_updateReport, nodeUpdateSlotReport); sm->m_allNodes.erase(node); sm->m_outOfDateNodes.erase(node); @@ -687,7 +688,8 @@ namespace ScriptCanvasEditor void EditorGraphUpgradeMachine::OnComplete(IState::ExitStatus exitStatus) { UpgradeNotificationsBus::Broadcast(&UpgradeNotifications::OnGraphUpgradeComplete, m_asset, exitStatus == IState::ExitStatus::Skipped); - m_asset = {}; + // releasing the asset at this stage of the system tick causes a memory crash + // m_asset = {}; } ////////////////////////////////////////////////////////////////////// diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h index 319a835ba5..be8f274cd6 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h @@ -302,7 +302,7 @@ namespace ScriptCanvasEditor const GraphStatisticsHelper& GetNodeUsageStatistics() const; void MarkOwnership(ScriptCanvas::ScriptCanvasData& owner); - ScriptCanvas::ScriptCanvasData* GetOwnership() const; + ScriptCanvas::DataPtr GetOwnership() const; // Finds and returns all nodes within the graph that are of the specified type template diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp index c23a3d915b..47e43b19d3 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp @@ -76,7 +76,7 @@ namespace ScriptCanvasEditor AZ::SystemTickBus::QueueFunction([this, tmpFileName]() { FileSaveResult result; - result.fileSaveError = "Failed to move updated file from temporary location to tmpFileName destination"; + result.fileSaveError = "Failed to move updated file from temporary location to original destination."; result.tempFileRemovalError = RemoveTempFile(tmpFileName); m_onComplete(result); }); @@ -97,7 +97,16 @@ namespace ScriptCanvasEditor } else { + // #sc_editor_asset - skip save, narrow down the memory corruption + AZ::SystemTickBus::QueueFunction([this, tmpFileName]() + { + FileSaveResult result; + result.tempFileRemovalError = RemoveTempFile(tmpFileName); + m_onComplete(result); + }); + // the actual move attempt + /* auto moveResult = AZ::IO::SmartMove(tmpFileName.c_str(), target.c_str()); if (moveResult.GetResultCode() == AZ::IO::ResultCode::Success) { @@ -105,6 +114,7 @@ namespace ScriptCanvasEditor AZ::IO::FileRequestPtr flushRequest = streamer->FlushCache(target.c_str()); // Bump the slice asset up in the asset processor's queue. AzFramework::AssetSystemRequestBus::Broadcast(&AzFramework::AssetSystem::AssetSystemRequests::EscalateAssetBySearchTerm, target.c_str()); + AZ::SystemTickBus::QueueFunction([this, tmpFileName]() { FileSaveResult result; @@ -124,6 +134,7 @@ namespace ScriptCanvasEditor }); streamer->QueueRequest(flushRequest); } + **/ } } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp index 242aea355e..3c8605e915 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp @@ -138,15 +138,17 @@ namespace ScriptCanvasEditor void Modifier::ModificationComplete(const ModificationResult& result) { - m_result = result; - - if (result.errorMessage.empty()) + if (!result.errorMessage.empty()) { - SaveModifiedGraph(result); + ReportModificationError(result.errorMessage); + } + else if (m_result.asset.Describe() != result.asset.Describe()) + { + ReportModificationError("Received modifiction complete notification for different result"); } else { - ReportModificationError(result.errorMessage); + SaveModifiedGraph(result); } } @@ -187,15 +189,15 @@ namespace ScriptCanvasEditor void Modifier::ReportModificationError(AZStd::string_view report) { - m_result.asset = {}; m_result.errorMessage = report; - m_results.m_failures.push_back(m_result); + m_results.m_failures.push_back({ m_result.asset.Describe(), report }); ModifyNextAsset(); } void Modifier::ReportModificationSuccess() { - m_results.m_successes.push_back(m_result.asset); + m_result.asset = m_result.asset.Describe(); + m_results.m_successes.push_back({ m_result.asset.Describe(), {} }); ModifyNextAsset(); } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h index 297ee70500..215041e1fd 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h @@ -306,8 +306,8 @@ namespace ScriptCanvas { class ScriptCanvasData; - using DataPtr = AZStd::shared_ptr; - using DataPtrConst = AZStd::shared_ptr; + using DataPtr = AZStd::intrusive_ptr; + using DataPtrConst = AZStd::intrusive_ptr; } namespace ScriptCanvasEditor @@ -372,7 +372,7 @@ namespace ScriptCanvasEditor namespace ScriptCanvas { class ScriptCanvasData - : public AZStd::enable_shared_from_this + : public AZStd::intrusive_refcount { public: diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/ParsingMetaData.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/ParsingMetaData.cpp index 476b21d0d6..681bd3b0e4 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/ParsingMetaData.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/ParsingMetaData.cpp @@ -152,19 +152,19 @@ namespace ScriptCanvas { if (azrtti_istypeof(execution->GetId().m_node)) { - return MetaDataPtr(aznew FormatStringMetaData()); + return AZStd::make_shared(); } else if (azrtti_istypeof(execution->GetId().m_node)) { - return MetaDataPtr(aznew PrintMetaData()); + return AZStd::make_shared(); } else if (azrtti_istypeof(execution->GetId().m_node)) { - return MetaDataPtr(aznew MathExpressionMetaData()); + return AZStd::make_shared(); } else if (execution->GetSymbol() == Symbol::FunctionCall) { - return MetaDataPtr(aznew FunctionCallDefaultMetaData()); + return AZStd::make_shared(); } } From d8add36212c0dd64daa2f4e44c82f24d2f808091 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Wed, 1 Dec 2021 23:04:07 -0800 Subject: [PATCH 082/948] restore file save Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Editor/Components/EditorGraph.cpp | 2 +- .../Windows/Tools/UpgradeTool/FileSaver.cpp | 22 +++++++------------ 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp index 22f9359a09..79621bbddb 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp @@ -1051,7 +1051,7 @@ namespace ScriptCanvasEditor auto graph = entity->CreateComponent(); entity->CreateComponent(graph->GetScriptCanvasId()); - if (ScriptCanvas::DataPtr data = AZStd::make_shared()) + if (ScriptCanvas::DataPtr data = aznew ScriptCanvas::ScriptCanvasData()) { data->m_scriptCanvasEntity.reset(entity); graph->MarkOwnership(*data); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp index 47e43b19d3..57c0822b05 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp @@ -97,23 +97,15 @@ namespace ScriptCanvasEditor } else { - // #sc_editor_asset - skip save, narrow down the memory corruption - AZ::SystemTickBus::QueueFunction([this, tmpFileName]() - { - FileSaveResult result; - result.tempFileRemovalError = RemoveTempFile(tmpFileName); - m_onComplete(result); - }); - // the actual move attempt - /* auto moveResult = AZ::IO::SmartMove(tmpFileName.c_str(), target.c_str()); if (moveResult.GetResultCode() == AZ::IO::ResultCode::Success) { auto streamer = AZ::Interface::Get(); AZ::IO::FileRequestPtr flushRequest = streamer->FlushCache(target.c_str()); // Bump the slice asset up in the asset processor's queue. - AzFramework::AssetSystemRequestBus::Broadcast(&AzFramework::AssetSystem::AssetSystemRequests::EscalateAssetBySearchTerm, target.c_str()); + AzFramework::AssetSystemRequestBus::Broadcast + (&AzFramework::AssetSystem::AssetSystemRequests::EscalateAssetBySearchTerm, target.c_str()); AZ::SystemTickBus::QueueFunction([this, tmpFileName]() { @@ -124,17 +116,19 @@ namespace ScriptCanvasEditor } else { - AZ_Warning(ScriptCanvas::k_VersionExplorerWindow.data(), false, "moving converted file to tmpFileName destination failed: %s, trying again", target.c_str()); + AZ_Warning(ScriptCanvas::k_VersionExplorerWindow.data(), false + , "moving converted file to tmpFileName destination failed: %s, trying again", target.c_str()); auto streamer = AZ::Interface::Get(); AZ::IO::FileRequestPtr flushRequest = streamer->FlushCache(target.c_str()); - streamer->SetRequestCompleteCallback(flushRequest, [this, tmpFileName, target, remainingAttempts]([[maybe_unused]] AZ::IO::FileRequestHandle request) + streamer->SetRequestCompleteCallback(flushRequest + , [this, tmpFileName, target, remainingAttempts]([[maybe_unused]] AZ::IO::FileRequestHandle request) { // Continue saving. - AZ::SystemTickBus::QueueFunction([this, tmpFileName, target, remainingAttempts]() { PerformMove(tmpFileName, target, remainingAttempts - 1); }); + AZ::SystemTickBus::QueueFunction( + [this, tmpFileName, target, remainingAttempts]() { PerformMove(tmpFileName, target, remainingAttempts - 1); }); }); streamer->QueueRequest(flushRequest); } - **/ } } From 2c107c364fd760e43ebd3507a92671da733918d2 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Wed, 1 Dec 2021 23:55:11 -0800 Subject: [PATCH 083/948] fix mismatched file name on modification Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Editor/View/Widgets/GraphTabBar.cpp | 13 +++++++++---- .../Code/Editor/View/Widgets/GraphTabBar.h | 1 - 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp index b00e2ea3de..53b2cecabc 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp @@ -158,8 +158,7 @@ namespace ScriptCanvasEditor AZStd::string tabName; AzFramework::StringFunc::Path::GetFileName(assetId.Path().c_str(), tabName); - metaData.m_name = tabName.c_str(); - + SetTabText(tabIndex, tabName.c_str(), fileState); setTabData(tabIndex, QVariant::fromValue(metaData)); return tabIndex; @@ -350,6 +349,12 @@ namespace ScriptCanvasEditor void GraphTabBar::SetTabText(int tabIndex, const QString& path, Tracker::ScriptCanvasFileState fileState) { + QString safePath = path; + if (path.endsWith("^") || path.endsWith("*")) + { + safePath.chop(1); + } + if (tabIndex >= 0 && tabIndex < count()) { const char* fileStateTag = ""; @@ -366,7 +371,7 @@ namespace ScriptCanvasEditor break; } - setTabText(tabIndex, QString("%1%2").arg(path).arg(fileStateTag)); + setTabText(tabIndex, QString("%1%2").arg(safePath).arg(fileStateTag)); } } @@ -392,7 +397,7 @@ namespace ScriptCanvasEditor int index = FindTab(assetId); tabData->m_fileState = fileState; SetTabData(*tabData, assetId); - SetTabText(index, tabData->m_name, fileState); + SetTabText(index, tabText(index), fileState); if (index == currentIndex()) { diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h index 40b785f016..e19ceaa4ec 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h @@ -37,7 +37,6 @@ namespace ScriptCanvasEditor QWidget* m_hostWidget = nullptr; CanvasWidget* m_canvasWidget = nullptr; Tracker::ScriptCanvasFileState m_fileState = Tracker::ScriptCanvasFileState::INVALID; - QString m_name; }; class GraphTabBar From 6421463df254908258ed58dd82908cf415d5a8fb Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Thu, 2 Dec 2021 00:25:50 -0800 Subject: [PATCH 084/948] clean up WIP Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Builder/ScriptCanvasBuilder.cpp | 33 +++--- Gems/ScriptCanvas/Code/Editor/Settings.cpp | 17 ++- .../Code/Editor/SystemComponent.cpp | 93 +++++++-------- .../LoggingPanel/LoggingWindowTreeItems.cpp | 106 +++++++++--------- .../PivotTree/PivotTreeWidget.cpp | 23 ++-- .../FunctionNodePaletteTreeItemTypes.cpp | 14 ++- .../ScriptCanvasStatisticsDialog.cpp | 6 +- .../Code/Editor/View/Windows/MainWindow.cpp | 13 +-- 8 files changed, 154 insertions(+), 151 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp index 31b63e8fad..60a3687d0d 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp @@ -27,23 +27,24 @@ namespace BuildVariableOverridesCpp }; bool VersionConverter - ( [[maybe_unused]] AZ::SerializeContext& serializeContext - , [[maybe_unused]] AZ::SerializeContext::DataElementNode& rootElement) + ( AZ::SerializeContext& serializeContext + , AZ::SerializeContext::DataElementNode& rootElement) { - // #sc_editor_asset -// ScriptCanvasBuilder::BuildVariableOverrides overrides; -// overrides.m_source = SourceHandle(nullptr, assetHolder.GetAssetId().m_guid, {}); -// -// 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; -// } + // #sc_editor_asset + ScriptCanvasBuilder::BuildVariableOverrides overrides; + overrides.m_source = SourceHandle(nullptr, assetHolder.GetAssetId().m_guid, {}); + + 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; } } diff --git a/Gems/ScriptCanvas/Code/Editor/Settings.cpp b/Gems/ScriptCanvas/Code/Editor/Settings.cpp index 997ef4eadf..84744f77e3 100644 --- a/Gems/ScriptCanvas/Code/Editor/Settings.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Settings.cpp @@ -110,15 +110,14 @@ namespace ScriptCanvasEditor if (subElement) { -// #sc_editor_asset -// if (subElement->GetData(assetIds)) -// { -// assetSaveData.reserve(assetIds.size()); -// for (const AZ::Data::AssetId& assetId : assetIds) -// { -// assetSaveData.emplace_back(assetId); -// } -// } + if (subElement->GetData(assetIds)) + { + assetSaveData.reserve(assetIds.size()); + for (const AZ::Data::AssetId& assetId : assetIds) + { + assetSaveData.emplace_back(SourceHandle( nullptr, assetId.m_guid, "" )); + } + } } rootDataElementNode.RemoveElementByName(AZ_CRC_CE("ActiveAssetIds")); diff --git a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp index 88ef93a4c4..0be2d564ee 100644 --- a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp @@ -212,7 +212,7 @@ namespace ScriptCanvasEditor if (!entitiesWithScriptCanvas.empty()) { QMenu* scriptCanvasMenu = nullptr; - // QAction* action = nullptr; + QAction* action = nullptr; // For entities with script canvas component, create a context menu to open any existing script canvases within each selected entity. for (const AZ::EntityId& entityId : entitiesWithScriptCanvas) @@ -245,32 +245,33 @@ namespace ScriptCanvasEditor AZStd::unordered_set< AZ::Data::AssetId > usedIds; - //#sc_editor_asset -// for (const auto& assetId : assetIds.values) -// { -// if (!assetId.IsValid() || usedIds.count(assetId) != 0) -// { -// continue; -// } -// -// entityMenu->setEnabled(true); -// -// usedIds.insert(assetId); -// -// AZStd::string rootPath; -// AZ::Data::AssetInfo assetInfo = AssetHelpers::GetAssetInfo(assetId, rootPath); -// -// AZStd::string displayName; -// AZ::StringFunc::Path::GetFileName(assetInfo.m_relativePath.c_str(), displayName); -// -// action = entityMenu->addAction(QString("%1").arg(QString(displayName.c_str()))); -// -// QObject::connect(action, &QAction::triggered, [assetId] -// { -// AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); -// GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAsset, assetId, -1); -// }); -// } + for (const auto& assetId : assetIds.values) + { + if (!assetId.IsValid() || usedIds.count(assetId) != 0) + { + continue; + } + + entityMenu->setEnabled(true); + + usedIds.insert(assetId); + + AZStd::string rootPath; + AZ::Data::AssetInfo assetInfo = AssetHelpers::GetAssetInfo(assetId, rootPath); + + AZStd::string displayName; + AZ::StringFunc::Path::GetFileName(assetInfo.m_relativePath.c_str(), displayName); + + action = entityMenu->addAction(QString("%1").arg(QString(displayName.c_str()))); + + QObject::connect(action, &QAction::triggered, [assetId] + { + AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); + GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAsset + , SourceHandle(nullptr, assetId.m_guid, "") + , Tracker::ScriptCanvasFileState::UNMODIFIED, -1); + }); + } } } } @@ -319,24 +320,26 @@ namespace ScriptCanvasEditor { isScriptCanvasAsset = true; } - // #sc_editor_asset -// if (isScriptCanvasAsset) -// { -// auto scriptCanvasEditorCallback = []([[maybe_unused]] const char* fullSourceFileNameInCall, const AZ::Uuid& sourceUUIDInCall) -// { -// AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); -// const SourceAssetBrowserEntry* fullDetails = SourceAssetBrowserEntry::GetSourceByUuid(sourceUUIDInCall); -// if (fullDetails) -// { -// AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); -// -// AzToolsFramework::EditorRequests::Bus::Broadcast(&AzToolsFramework::EditorRequests::OpenViewPane, "Script Canvas"); -// GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, sourceUUIDInCall, -1); -// } -// }; -// -// openers.push_back({ "O3DE_ScriptCanvasEditor", "Open In Script Canvas Editor...", QIcon(), scriptCanvasEditorCallback }); -// } + + if (isScriptCanvasAsset) + { + auto scriptCanvasEditorCallback = []([[maybe_unused]] const char* fullSourceFileNameInCall, const AZ::Uuid& sourceUUIDInCall) + { + AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); + const SourceAssetBrowserEntry* fullDetails = SourceAssetBrowserEntry::GetSourceByUuid(sourceUUIDInCall); + if (fullDetails) + { + AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); + + AzToolsFramework::EditorRequests::Bus::Broadcast(&AzToolsFramework::EditorRequests::OpenViewPane, "Script Canvas"); + GeneralRequestBus::BroadcastResult(openOutcome + , &GeneralRequests::OpenScriptCanvasAsset + , SourceHandle(nullptr, sourceUUIDInCall, ""), Tracker::ScriptCanvasFileState::UNMODIFIED, -1); + } + }; + + openers.push_back({ "O3DE_ScriptCanvasEditor", "Open In Script Canvas Editor...", QIcon(), scriptCanvasEditorCallback }); + } } void SystemComponent::OnUserSettingsActivated() diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.cpp index 636ee832d4..6936a0c368 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/LoggingWindowTreeItems.cpp @@ -619,51 +619,54 @@ namespace ScriptCanvasEditor void ExecutionLogTreeItem::ScrapeGraphCanvasData() { - // #sc_editor_asset -// if (!m_graphCanvasGraphId.IsValid()) -// { -// GeneralRequestBus::BroadcastResult(m_graphCanvasGraphId, &GeneralRequests::FindGraphCanvasGraphIdByAssetId, GetAssetId()); -// -// if (!EditorGraphNotificationBus::Handler::BusIsConnected()) -// { -// ScriptCanvas::ScriptCanvasId scriptCanvasId; -// GeneralRequestBus::BroadcastResult(scriptCanvasId, &GeneralRequests::FindScriptCanvasIdByAssetId, GetAssetId()); -// -// EditorGraphNotificationBus::Handler::BusConnect(scriptCanvasId); -// } -// } -// -// if (m_graphCanvasGraphId.IsValid()) -// { -// if (!m_graphCanvasNodeId.IsValid()) -// { -// AssetGraphSceneBus::BroadcastResult(m_scriptCanvasNodeId, &AssetGraphScene::FindEditorNodeIdByAssetNodeId, GetAssetId(), m_scriptCanvasAssetNodeId); -// SceneMemberMappingRequestBus::EventResult(m_graphCanvasNodeId, m_scriptCanvasNodeId, &SceneMemberMappingRequests::GetGraphCanvasEntityId); -// } -// -// if (m_graphCanvasNodeId.IsValid()) -// { -// const bool refreshDisplayData = false; -// ResolveWrapperNode(refreshDisplayData); -// -// AZStd::string displayName; -// GraphCanvas::NodeTitleRequestBus::EventResult(displayName, m_graphCanvasNodeId, &GraphCanvas::NodeTitleRequests::GetTitle); -// -// if (!displayName.empty()) -// { -// m_displayName = displayName.c_str(); -// } -// -// GraphCanvas::NodeTitleRequestBus::Event(m_graphCanvasNodeId, &GraphCanvas::NodeTitleRequests::ConfigureIconConfiguration, m_paletteConfiguration); -// -// OnStylesLoaded(); -// -// PopulateInputSlotData(); -// PopulateOutputSlotData(); -// -// SignalDataChanged(); -// } -// } + if (!m_graphCanvasGraphId.IsValid()) + { + GeneralRequestBus::BroadcastResult(m_graphCanvasGraphId + , &GeneralRequests::FindGraphCanvasGraphIdByAssetId, SourceHandle(nullptr, GetAssetId().m_guid, "")); + + if (!EditorGraphNotificationBus::Handler::BusIsConnected()) + { + ScriptCanvas::ScriptCanvasId scriptCanvasId; + GeneralRequestBus::BroadcastResult(scriptCanvasId + , &GeneralRequests::FindScriptCanvasIdByAssetId, SourceHandle(nullptr, GetAssetId().m_guid, "")); + + EditorGraphNotificationBus::Handler::BusConnect(scriptCanvasId); + } + } + + if (m_graphCanvasGraphId.IsValid()) + { + if (!m_graphCanvasNodeId.IsValid()) + { + AssetGraphSceneBus::BroadcastResult(m_scriptCanvasNodeId + , &AssetGraphScene::FindEditorNodeIdByAssetNodeId + , SourceHandle(nullptr, GetAssetId().m_guid, ""), m_scriptCanvasAssetNodeId); + SceneMemberMappingRequestBus::EventResult(m_graphCanvasNodeId, m_scriptCanvasNodeId, &SceneMemberMappingRequests::GetGraphCanvasEntityId); + } + + if (m_graphCanvasNodeId.IsValid()) + { + const bool refreshDisplayData = false; + ResolveWrapperNode(refreshDisplayData); + + AZStd::string displayName; + GraphCanvas::NodeTitleRequestBus::EventResult(displayName, m_graphCanvasNodeId, &GraphCanvas::NodeTitleRequests::GetTitle); + + if (!displayName.empty()) + { + m_displayName = displayName.c_str(); + } + + GraphCanvas::NodeTitleRequestBus::Event(m_graphCanvasNodeId, &GraphCanvas::NodeTitleRequests::ConfigureIconConfiguration, m_paletteConfiguration); + + OnStylesLoaded(); + + PopulateInputSlotData(); + PopulateOutputSlotData(); + + SignalDataChanged(); + } + } } void ExecutionLogTreeItem::PopulateInputSlotData() @@ -805,8 +808,8 @@ namespace ScriptCanvasEditor { if (!m_graphCanvasGraphId.IsValid()) { - // #sc_editor_asset - // GeneralRequestBus::BroadcastResult(m_graphCanvasGraphId, &GeneralRequests::FindGraphCanvasGraphIdByAssetId, m_graphIdentifier.m_assetId); + GeneralRequestBus::BroadcastResult(m_graphCanvasGraphId + , &GeneralRequests::FindGraphCanvasGraphIdByAssetId, SourceHandle(nullptr, m_graphIdentifier.m_assetId.m_guid, "")); } ScrapeInputName(); @@ -828,8 +831,7 @@ namespace ScriptCanvasEditor if (m_graphCanvasGraphId.IsValid() && m_assetInputEndpoint.IsValid()) { AZ::EntityId scriptCanvasNodeId; - // #sc_editor_asset - // AssetGraphSceneBus::BroadcastResult(scriptCanvasNodeId, &AssetGraphScene::FindEditorNodeIdByAssetNodeId, GetAssetId(), m_assetInputEndpoint.GetNodeId()); + AssetGraphSceneBus::BroadcastResult(scriptCanvasNodeId, &AssetGraphScene::FindEditorNodeIdByAssetNodeId, SourceHandle(nullptr, GetAssetId().m_guid, ""), m_assetInputEndpoint.GetNodeId()); GraphCanvas::NodeId graphCanvasNodeId; SceneMemberMappingRequestBus::EventResult(graphCanvasNodeId, scriptCanvasNodeId, &SceneMemberMappingRequests::GetGraphCanvasEntityId); @@ -852,9 +854,9 @@ namespace ScriptCanvasEditor if (m_graphCanvasGraphId.IsValid() && m_assetOutputEndpoint.IsValid()) { AZ::EntityId scriptCanvasNodeId; - // #sc_editor_asset - // AssetGraphSceneBus::BroadcastResult(scriptCanvasNodeId, &AssetGraphScene::FindEditorNodeIdByAssetNodeId, GetAssetId(), m_assetOutputEndpoint.GetNodeId()); - + AssetGraphSceneBus::BroadcastResult(scriptCanvasNodeId, &AssetGraphScene::FindEditorNodeIdByAssetNodeId + , SourceHandle(nullptr, GetAssetId().m_guid, ""), m_assetOutputEndpoint.GetNodeId()); + GraphCanvas::NodeId graphCanvasNodeId; SceneMemberMappingRequestBus::EventResult(graphCanvasNodeId, scriptCanvasNodeId, &SceneMemberMappingRequests::GetGraphCanvasEntityId); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/PivotTree/PivotTreeWidget.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/PivotTree/PivotTreeWidget.cpp index d085ebbbcf..b1827d7099 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/PivotTree/PivotTreeWidget.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/PivotTree/PivotTreeWidget.cpp @@ -405,18 +405,17 @@ namespace ScriptCanvasEditor { sourceIndex = proxyModel->mapToSource(modelIndex); } - // #sc_editor_asset -// PivotTreeItem* pivotTreeItem = static_cast(sourceIndex.internalPointer()); -// -// if (pivotTreeItem) -// { -// PivotTreeGraphItem* graphItem = azrtti_cast(pivotTreeItem); -// -// if (graphItem) -// { -// GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAssetId, graphItem->GetAssetId()); -// } -// } + + if (PivotTreeItem* pivotTreeItem = static_cast(sourceIndex.internalPointer())) + { + if (PivotTreeGraphItem* graphItem = azrtti_cast(pivotTreeItem)) + { + GeneralRequestBus::Broadcast + ( &GeneralRequests::OpenScriptCanvasAssetId + , SourceHandle(nullptr, graphItem->GetAssetId().m_guid, "") + , Tracker::ScriptCanvasFileState::UNMODIFIED); + } + } } #include diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/FunctionNodePaletteTreeItemTypes.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/FunctionNodePaletteTreeItemTypes.cpp index 6473dcbb40..b2db9508b1 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/FunctionNodePaletteTreeItemTypes.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/FunctionNodePaletteTreeItemTypes.cpp @@ -129,8 +129,10 @@ namespace ScriptCanvasEditor { if (row == NodePaletteTreeItem::Column::Customization) { - // #sc_editor_asset - // GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAsset, GetSourceAssetId(), -1); + GeneralRequestBus::Broadcast + ( &GeneralRequests::OpenScriptCanvasAssetId + , SourceHandle(nullptr, GetSourceAssetId().m_guid, "") + , Tracker::ScriptCanvasFileState::UNMODIFIED); } } @@ -138,9 +140,11 @@ namespace ScriptCanvasEditor { if (row != NodePaletteTreeItem::Column::Customization) { - // #sc_editor_asset - // GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAsset, GetSourceAssetId(), -1); - // return true; + GeneralRequestBus::Broadcast + ( &GeneralRequests::OpenScriptCanvasAssetId + , SourceHandle(nullptr, GetSourceAssetId().m_guid, "") + , Tracker::ScriptCanvasFileState::UNMODIFIED); + return true; } return false; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/ScriptCanvasStatisticsDialog.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/ScriptCanvasStatisticsDialog.cpp index 9538a5732a..4a0905c17c 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/ScriptCanvasStatisticsDialog.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/ScriptCanvasStatisticsDialog.cpp @@ -257,8 +257,10 @@ namespace ScriptCanvasEditor if (treeItem->GetAssetId().IsValid()) { - // #sc_editor_asset - // GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAssetId, treeItem->GetAssetId()); + GeneralRequestBus::Broadcast + ( &GeneralRequests::OpenScriptCanvasAssetId + , SourceHandle(nullptr, treeItem->GetAssetId().m_guid, "") + , Tracker::ScriptCanvasFileState::UNMODIFIED); } } } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index f9653031b4..4eb8fb4cca 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -2673,10 +2673,8 @@ namespace ScriptCanvasEditor } } - void MainWindow::CopyPathToClipboard(int /*index*/) + void MainWindow::CopyPathToClipboard(int index) { - // #sc_editor_asset - /* QVariant tabdata = m_tabBar->tabData(index); if (tabdata.isValid()) @@ -2684,20 +2682,15 @@ namespace ScriptCanvasEditor QClipboard* clipBoard = QGuiApplication::clipboard(); auto assetId = tabdata.value(); - - ScriptCanvasMemoryAsset::pointer memoryAsset; - AssetTrackerRequestBus::BroadcastResult(memoryAsset, &AssetTrackerRequests::GetAsset, assetId); - - if (memoryAsset) + if (!assetId.m_assetId.Path().empty()) { - clipBoard->setText(memoryAsset->GetAbsolutePath().c_str()); + clipBoard->setText(assetId.m_assetId.Path().c_str()); } else { clipBoard->setText(m_tabBar->tabText(index)); } } - */ } void MainWindow::OnActiveFileStateChanged() From 87023cae47df4223529b4d4c84889563ec8a8109 Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Thu, 2 Dec 2021 09:17:05 -0800 Subject: [PATCH 085/948] finish last of pre-PR clean up, including saving over previsouly opened tabs Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Builder/ScriptCanvasBuilder.cpp | 36 ++- .../Code/Editor/View/Widgets/GraphTabBar.cpp | 38 +++ .../Code/Editor/View/Widgets/GraphTabBar.h | 2 + .../Code/Editor/View/Windows/MainWindow.cpp | 258 ++++++------------ .../Code/Editor/View/Windows/MainWindow.h | 2 - 5 files changed, 154 insertions(+), 182 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp index 60a3687d0d..00df5ad07b 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp @@ -20,6 +20,7 @@ namespace BuildVariableOverridesCpp { enum Version { + Original = 1, EditorAssetRedux, // add description above @@ -30,19 +31,29 @@ namespace BuildVariableOverridesCpp ( AZ::SerializeContext& serializeContext , AZ::SerializeContext::DataElementNode& rootElement) { - // #sc_editor_asset - ScriptCanvasBuilder::BuildVariableOverrides overrides; - overrides.m_source = SourceHandle(nullptr, assetHolder.GetAssetId().m_guid, {}); - - for (auto& variable : editableData.GetVariables()) + if (rootElement.GetVersion() < BuildVariableOverridesCpp::Version::EditorAssetRedux) { - 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; + auto sourceIndex = rootElement.FindElement(AZ_CRC_CE("source")); + if (sourceIndex == -1) + { + AZ_Error("ScriptCanvas", false, "BuildVariableOverrides coversion failed: 'source' was missing"); + return false; + } + + auto& sourceElement = rootElement.GetSubElement(sourceIndex); + AZ::Data::Asset asset; + if (!sourceElement.GetData(asset)) + { + AZ_Error("ScriptCanvas", false, "BuildVariableOverrides coversion failed: could not retrieve 'source' data"); + return false; + } + + ScriptCanvasEditor::SourceHandle sourceHandle(nullptr, asset.GetId().m_guid, {}); + if (!rootElement.AddElementWithData(serializeContext, "source", sourceHandle)) + { + AZ_Error("ScriptCanvas", false, "BuildVariableOverrides coversion failed: could not add updated 'source' data"); + return false; + } } return true; @@ -136,7 +147,6 @@ namespace ScriptCanvasBuilder return m_variables.empty() && m_entityIds.empty() && m_dependencies.empty(); } - // #sc_editor_asset THIS MUST GET VERSIONED! void BuildVariableOverrides::Reflect(AZ::ReflectContext* reflectContext) { if (auto serializeContext = azrtti_cast(reflectContext)) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp index 53b2cecabc..4e9398fdcf 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp @@ -175,6 +175,7 @@ namespace ScriptCanvasEditor setCurrentIndex(tabIndex); return true; } + return false; } @@ -192,6 +193,43 @@ namespace ScriptCanvasEditor } } } + + return -1; + } + + int GraphTabBar::FindTab(ScriptCanvasEditor::GraphPtrConst graph) const + { + for (int tabIndex = 0; tabIndex < count(); ++tabIndex) + { + QVariant tabDataVariant = tabData(tabIndex); + if (tabDataVariant.isValid()) + { + auto tabAssetId = tabDataVariant.value(); + if (tabAssetId.m_assetId.Get() == graph) + { + return tabIndex; + } + } + } + + return -1; + } + + int GraphTabBar::FindSaveOverMatch(ScriptCanvasEditor::SourceHandle assetId) const + { + for (int tabIndex = 0; tabIndex < count(); ++tabIndex) + { + QVariant tabDataVariant = tabData(tabIndex); + if (tabDataVariant.isValid()) + { + auto tabAssetId = tabDataVariant.value(); + if (tabAssetId.m_assetId.Get() != assetId.Get() && tabAssetId.m_assetId.PathEquals(assetId)) + { + return tabIndex; + } + } + } + return -1; } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h index e19ceaa4ec..939fb7c8f4 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h @@ -62,6 +62,8 @@ namespace ScriptCanvasEditor bool SelectTab(ScriptCanvasEditor::SourceHandle assetId); int FindTab(ScriptCanvasEditor::SourceHandle assetId) const; + int FindTab(ScriptCanvasEditor::GraphPtrConst graph) const; + int FindSaveOverMatch(ScriptCanvasEditor::SourceHandle assetId) const; ScriptCanvasEditor::SourceHandle FindTabByPath(AZStd::string_view path) const; ScriptCanvasEditor::SourceHandle FindAssetId(int tabIndex); ScriptCanvas::ScriptCanvasId FindScriptCanvasIdFromGraphCanvasId(const GraphCanvas::GraphId& graphCanvasGraphId) const; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 4eb8fb4cca..06877a5659 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -910,19 +910,10 @@ namespace ScriptCanvasEditor return; } - AssetTrackerRequests::AssetList unsavedAssets; - AssetTrackerRequestBus::BroadcastResult(unsavedAssets, &AssetTrackerRequests::GetUnsavedAssets); - for (int tabCounter = 0; tabCounter < m_tabBar->count(); ++tabCounter) { ScriptCanvasEditor::SourceHandle assetId = m_tabBar->FindAssetId(tabCounter); - auto resultIterator = m_processedClosedAssetIds.insert(assetId); - if (!resultIterator.second) - { - continue; - } - const Tracker::ScriptCanvasFileState& fileState = GetAssetFileState(assetId); if (fileState == Tracker::ScriptCanvasFileState::UNMODIFIED) @@ -938,30 +929,13 @@ namespace ScriptCanvasEditor if (shouldSaveResults == UnsavedChangesOptions::SAVE) { - // #sc_editor_asset -// Callbacks::OnSave saveCB = [this](bool isSuccessful, AZ::Data::AssetPtr, ScriptCanvasEditor::SourceHandle) -// { -// if (isSuccessful) -// { -// // Continue closing. -// qobject_cast(parent())->close(); -// } -// else -// { -// // Abort closing. -// QMessageBox::critical(this, QString(), QObject::tr("Failed to save.")); -// m_processedClosedAssetIds.clear(); -// } -// }; -// ActivateAndSaveAsset(assetId, saveCB); + SaveAssetImpl(assetId, Save::InPlace); event->ignore(); return; } else if (shouldSaveResults == UnsavedChangesOptions::CANCEL_WITHOUT_SAVING) { - m_processedClosedAssetIds.clear(); event->ignore(); - return; } else if (shouldSaveResults == UnsavedChangesOptions::CONTINUE_WITHOUT_SAVING && @@ -973,20 +947,6 @@ namespace ScriptCanvasEditor } m_workspace->Save(); - - // Close all files. -// -// AssetTrackerRequests::AssetList allAssets; -// AssetTrackerRequestBus::BroadcastResult(allAssets, &AssetTrackerRequests::GetAssets); -// -// for (auto trackedAsset : allAssets) -// { -// const ScriptCanvasEditor::SourceHandle& assetId = trackedAsset->GetAsset().GetId(); -// CloseScriptCanvasAsset(assetId); -// } - - m_processedClosedAssetIds.clear(); - event->accept(); } @@ -1366,10 +1326,9 @@ namespace ScriptCanvasEditor return createdNewAsset; } - bool MainWindow::IsScriptCanvasAssetOpen(const ScriptCanvasEditor::SourceHandle& /*assetId*/) const + bool MainWindow::IsScriptCanvasAssetOpen(const ScriptCanvasEditor::SourceHandle& assetId) const { - // #sc_editor_asset - return false; + return m_tabBar->FindTab(assetId) >= 0; } const CategoryInformation* MainWindow::FindNodePaletteCategoryInformation(AZStd::string_view categoryPath) const @@ -1537,7 +1496,7 @@ namespace ScriptCanvasEditor void MainWindow::OnFileNew() { - int scriptCanvasEditorDefaultNewNameCount = 0; + static int scriptCanvasEditorDefaultNewNameCount = 0; AZStd::string assetPath; @@ -1785,8 +1744,6 @@ namespace ScriptCanvasEditor if (saveSuccess) { - // #sc_editor_asset find a tab with the same path name and close non focused old ones with the same name - // Update the editor with the new information about this asset. ScriptCanvasEditor::SourceHandle& fileAssetId = memoryAsset; int currentTabIndex = m_tabBar->currentIndex(); @@ -1799,13 +1756,26 @@ namespace ScriptCanvasEditor const bool assetIdHasChanged = assetInfo.m_assetId.m_guid != fileAssetId.Id(); fileAssetId = SourceHandle(fileAssetId, assetInfo.m_assetId.m_guid, fileAssetId.Path()); - // #sc_editor_asset // check for saving a graph over another graph with an open tab + for (;;) { - // find the saved tab by graph* - // find all tabs that match old path, and close them - // update the save tab index - // and the current index + auto graph = fileAssetId.Get(); + int tabIndexByGraph = m_tabBar->FindTab(graph); + if (tabIndexByGraph == -1) + { + AZ_Warning("ScriptCanvas", false, "unable to find graph just saved"); + break; + } + + int saveOverMatch = m_tabBar->FindSaveOverMatch(fileAssetId); + if (saveOverMatch < 0) + { + saveTabIndex = tabIndexByGraph; + currentTabIndex = m_tabBar->currentIndex(); + break; + } + + m_tabBar->CloseTab(saveOverMatch); } // this path is questionable, this is a save request that is not the current graph @@ -1818,22 +1788,7 @@ namespace ScriptCanvasEditor saveTabIndex = -1; } - // #sc_editor_asset clean up these actions as well, save and close, save as and close, just save, etc - if (saveTabIndex < 0) - { - // This asset had not been saved yet, we will need to use the in memory asset Id to get the index. - // saveTabIndex = m_tabBar->FindTab(memoryAsset->GetId()); - - if (saveTabIndex < 0) - { - // Finally, we may have Saved-As and we need the previous file asset Id to find the tab - //saveTabIndex = m_tabBar->FindTab(previousFileAssetId); - } - } - AzFramework::StringFunc::Path::GetFileName(memoryAsset.Path().c_str(), tabName); - // Update the tab's assetId to the file asset Id (necessary when saving a new asset) - // #sc_editor_asset used to be configure tab...sets the name and file state if (assetIdHasChanged) { @@ -2318,34 +2273,6 @@ namespace ScriptCanvasEditor GraphCanvas::ViewRequestBus::Event(viewId, &GraphCanvas::ViewRequests::CenterOnEndOfChain); } - // #sc_editor_asset - void MainWindow::UpdateWorkspaceStatus(const ScriptCanvasMemoryAsset& /*memoryAsset*/) - { - // only occurs on file open, do it there, if necessary - /* - ScriptCanvasEditor::SourceHandle fileAssetId = memoryAsset.GetFileAssetId(); - - size_t eraseCount = m_loadingAssets.erase(fileAssetId); - - if (eraseCount > 0) - { - AZStd::string rootFilePath; - AZ::Data::AssetInfo assetInfo = AssetHelpers::GetAssetInfo(fileAssetId, rootFilePath); - - // Don't want to use the join since I don't want the normalized path - if (!rootFilePath.empty() && !assetInfo.m_relativePath.empty()) - { - eraseCount = m_loadingWorkspaceAssets.erase(fileAssetId); - - if (eraseCount == 0) - { - AZStd::string fullPath = AZStd::string::format("%s/%s", rootFilePath.c_str(), assetInfo.m_relativePath.c_str()); - } - } - } - */ - } - void MainWindow::OnCanUndoChanged(bool canUndo) { ui->action_Undo->setEnabled(canUndo); @@ -3602,25 +3529,24 @@ namespace ScriptCanvasEditor return findChild(elementName); } - AZ::EntityId MainWindow::FindEditorNodeIdByAssetNodeId(const ScriptCanvasEditor::SourceHandle& /*assetId*/, AZ::EntityId /*assetNodeId*/) const + AZ::EntityId MainWindow::FindEditorNodeIdByAssetNodeId(const ScriptCanvasEditor::SourceHandle& assetId, AZ::EntityId assetNodeId) const { - // #sc_editor_asset - return AZ::EntityId{}; - // AZ::EntityId editorEntityId; - // AssetTrackerRequestBus::BroadcastResult(editorEntityId, &AssetTrackerRequests::GetEditorEntityIdFromSceneEntityId, assetId, assetNodeId); - //return AZ::EntityId{};// editorEntityId; + AZ::EntityId editorEntityId; + AssetTrackerRequestBus::BroadcastResult + ( editorEntityId, &AssetTrackerRequests::GetEditorEntityIdFromSceneEntityId, assetId.Id(), assetNodeId); + return editorEntityId; } - AZ::EntityId MainWindow::FindAssetNodeIdByEditorNodeId(const ScriptCanvasEditor::SourceHandle& /*assetId*/, AZ::EntityId /*editorNodeId*/) const + AZ::EntityId MainWindow::FindAssetNodeIdByEditorNodeId(const ScriptCanvasEditor::SourceHandle& assetId, AZ::EntityId editorNodeId) const { - // #sc_editor_asset - return AZ::EntityId{}; - // AZ::EntityId sceneEntityId; - // AssetTrackerRequestBus::BroadcastResult(sceneEntityId, &AssetTrackerRequests::GetSceneEntityIdFromEditorEntityId, assetId, editorNodeId); - // return sceneEntityId; + AZ::EntityId sceneEntityId; + AssetTrackerRequestBus::BroadcastResult + ( sceneEntityId, &AssetTrackerRequests::GetSceneEntityIdFromEditorEntityId, assetId.Id(), editorNodeId); + return sceneEntityId; } - GraphCanvas::Endpoint MainWindow::CreateNodeForProposalWithGroup(const AZ::EntityId& connectionId, const GraphCanvas::Endpoint& endpoint, const QPointF& scenePoint, const QPoint& screenPoint, AZ::EntityId groupTarget) + GraphCanvas::Endpoint MainWindow::CreateNodeForProposalWithGroup(const AZ::EntityId& connectionId + , const GraphCanvas::Endpoint& endpoint, const QPointF& scenePoint, const QPoint& screenPoint, AZ::EntityId groupTarget) { PushPreventUndoStateUpdate(); @@ -4072,65 +3998,63 @@ namespace ScriptCanvasEditor void MainWindow::OnAssignToSelectedEntities() { - // #sc_editor_asset consider cutting -// Tracker::ScriptCanvasFileState fileState; -// AssetTrackerRequestBus::BroadcastResult(fileState, &AssetTrackerRequests::GetFileState, m_activeGraph); -// -// bool isDocumentOpen = false; -// AzToolsFramework::EditorRequests::Bus::BroadcastResult(isDocumentOpen, &AzToolsFramework::EditorRequests::IsLevelDocumentOpen); -// -// if (fileState == Tracker::ScriptCanvasFileState::NEW || fileState == Tracker::ScriptCanvasFileState::SOURCE_REMOVED || !isDocumentOpen) -// { -// return; -// } -// -// AzToolsFramework::EntityIdList selectedEntityIds; -// AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult(selectedEntityIds, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities); -// -// auto selectedEntityIdIter = selectedEntityIds.begin(); -// -// bool isLayerAmbiguous = false; -// AZ::EntityId targetLayer; -// -// while (selectedEntityIdIter != selectedEntityIds.end()) -// { -// bool isLayerEntity = false; -// AzToolsFramework::Layers::EditorLayerComponentRequestBus::EventResult(isLayerEntity, (*selectedEntityIdIter), &AzToolsFramework::Layers::EditorLayerComponentRequestBus::Events::HasLayer); -// -// if (isLayerEntity) -// { -// if (targetLayer.IsValid()) -// { -// isLayerAmbiguous = true; -// } -// -// targetLayer = (*selectedEntityIdIter); -// -// selectedEntityIdIter = selectedEntityIds.erase(selectedEntityIdIter); -// } -// else -// { -// ++selectedEntityIdIter; -// } -// } -// -// if (selectedEntityIds.empty()) -// { -// AZ::EntityId createdId; -// AzToolsFramework::EditorRequests::Bus::BroadcastResult(createdId, &AzToolsFramework::EditorRequests::CreateNewEntity, AZ::EntityId()); -// -// selectedEntityIds.emplace_back(createdId); -// -// if (targetLayer.IsValid() && !isLayerAmbiguous) -// { -// AZ::TransformBus::Event(createdId, &AZ::TransformBus::Events::SetParent, targetLayer); -// } -// } -// -// for (const AZ::EntityId& entityId : selectedEntityIds) -// { -// AssignGraphToEntityImpl(entityId); -// } + Tracker::ScriptCanvasFileState fileState = GetAssetFileState(m_activeGraph);; + + bool isDocumentOpen = false; + AzToolsFramework::EditorRequests::Bus::BroadcastResult(isDocumentOpen, &AzToolsFramework::EditorRequests::IsLevelDocumentOpen); + + if (fileState == Tracker::ScriptCanvasFileState::NEW || fileState == Tracker::ScriptCanvasFileState::SOURCE_REMOVED || !isDocumentOpen) + { + return; + } + + AzToolsFramework::EntityIdList selectedEntityIds; + AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult(selectedEntityIds, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities); + + auto selectedEntityIdIter = selectedEntityIds.begin(); + + bool isLayerAmbiguous = false; + AZ::EntityId targetLayer; + + while (selectedEntityIdIter != selectedEntityIds.end()) + { + bool isLayerEntity = false; + AzToolsFramework::Layers::EditorLayerComponentRequestBus::EventResult(isLayerEntity, (*selectedEntityIdIter), &AzToolsFramework::Layers::EditorLayerComponentRequestBus::Events::HasLayer); + + if (isLayerEntity) + { + if (targetLayer.IsValid()) + { + isLayerAmbiguous = true; + } + + targetLayer = (*selectedEntityIdIter); + + selectedEntityIdIter = selectedEntityIds.erase(selectedEntityIdIter); + } + else + { + ++selectedEntityIdIter; + } + } + + if (selectedEntityIds.empty()) + { + AZ::EntityId createdId; + AzToolsFramework::EditorRequests::Bus::BroadcastResult(createdId, &AzToolsFramework::EditorRequests::CreateNewEntity, AZ::EntityId()); + + selectedEntityIds.emplace_back(createdId); + + if (targetLayer.IsValid() && !isLayerAmbiguous) + { + AZ::TransformBus::Event(createdId, &AZ::TransformBus::Events::SetParent, targetLayer); + } + } + + for (const AZ::EntityId& entityId : selectedEntityIds) + { + AssignGraphToEntityImpl(entityId); + } } void MainWindow::OnAssignToEntity(const AZ::EntityId& entityId) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h index 68488238ec..80117b84fe 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h @@ -532,8 +532,6 @@ namespace ScriptCanvasEditor void DisconnectEndpoints(const AZ::EntityId& sceneId, const AZStd::vector& endpoints) override; ///////////////////////////////////////////////////////////////////////////////////////////// - void UpdateWorkspaceStatus(const ScriptCanvasMemoryAsset& scriptCanvasAsset); - GraphCanvas::Endpoint HandleProposedConnection(const GraphCanvas::GraphId& graphId, const GraphCanvas::ConnectionId& connectionId, const GraphCanvas::Endpoint& endpoint, const GraphCanvas::NodeId& proposedNode, const QPoint& screenPoint); //! UndoNotificationBus From 1af39a5c5cc26028f04e00c8504b44cfa17a4462 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Fri, 10 Dec 2021 15:57:52 -0800 Subject: [PATCH 086/948] Add benchmarks, some light optimizations like SSO Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp | 12 ++ Code/Framework/AzCore/AzCore/DOM/DomUtils.h | 3 + Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 49 ++++++-- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 37 ++++++ .../AzCore/AzCore/DOM/DomValueWriter.cpp | 51 ++++++-- .../AzCore/AzCore/DOM/DomValueWriter.h | 11 +- .../AzCore/AzCore/Memory/PoolAllocator.h | 18 +-- .../AzCore/Tests/DOM/DomJsonBenchmarks.cpp | 42 ++++++- .../AzCore/Tests/DOM/DomValueBenchmarks.cpp | 117 ++++++++++++++++++ .../AzCore/Tests/DOM/DomValueTests.cpp | 19 ++- 10 files changed, 319 insertions(+), 40 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp b/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp index 2e78661518..46fa5b9bac 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp @@ -21,4 +21,16 @@ namespace AZ::Dom::Utils { return backend.ReadFromBufferInPlace(string.data(), string.size(), visitor); } + + AZ::Outcome AZ::Dom::Utils::WriteToValue(Backend::WriteCallback writeCallback) + { + Value value; + AZStd::unique_ptr writer = value.GetWriteHandler(); + Visitor::Result result = writeCallback(*writer); + if (!result.IsSuccess()) + { + return AZ::Failure(result.GetError().FormatVisitorErrorMessage()); + } + return AZ::Success(AZStd::move(value)); + } } // namespace AZ::Dom::Utils diff --git a/Code/Framework/AzCore/AzCore/DOM/DomUtils.h b/Code/Framework/AzCore/AzCore/DOM/DomUtils.h index 84a6eb5687..f03e5b66b8 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomUtils.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomUtils.h @@ -9,9 +9,12 @@ #pragma once #include +#include namespace AZ::Dom::Utils { Visitor::Result ReadFromString(Backend& backend, AZStd::string_view string, AZ::Dom::Lifetime lifetime, Visitor& visitor); Visitor::Result ReadFromStringInPlace(Backend& backend, AZStd::string& string, Visitor& visitor); + + AZ::Outcome WriteToValue(Backend::WriteCallback writeCallback); } // namespace AZ::Dom::Utils diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index d9398da116..d8650601ba 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -19,7 +19,7 @@ namespace AZ::Dom { if (refCountedPointer.use_count() > 1) { - AZStd::shared_ptr newPointer = AZStd::make_shared(); + AZStd::shared_ptr newPointer = AZStd::allocate_shared(AZStdAlloc()); *newPointer = *refCountedPointer; refCountedPointer = AZStd::move(newPointer); } @@ -71,8 +71,8 @@ namespace AZ::Dom } Value::Value(Value&& value) noexcept - : m_value(value.m_value) { + operator=(value); } Value::Value(AZStd::string_view string, bool copy) @@ -174,7 +174,7 @@ namespace AZ::Dom Value& Value::operator=(Value&& other) noexcept { - m_value = other.m_value; + m_value.swap(other.m_value); return *this; } @@ -212,7 +212,7 @@ namespace AZ::Dom void Value::Swap(Value& other) noexcept { - AZStd::swap(m_value, other.m_value); + m_value.swap(other.m_value); } Type Dom::Value::GetType() const @@ -229,14 +229,15 @@ namespace AZ::Dom return AZStd::get(m_value) ? Type::TrueType : Type::FalseType; case 5: // AZStd::string_view case 6: // AZStd::shared_ptr + case 7: // ShortStringType return Type::StringType; - case 7: // ObjectPtr + case 8: // ObjectPtr return Type::ObjectType; - case 8: // ArrayPtr + case 9: // ArrayPtr return Type::ArrayType; - case 9: // NodePtr + case 10: // NodePtr return Type::NodeType; - case 10: // AZStd::any* + case 11: // AZStd::any* return Type::OpaqueType; } AZ_Assert(false, "AZ::Dom::Value::GetType: m_value has an unexpected type"); @@ -310,7 +311,7 @@ namespace AZ::Dom Value& Value::SetObject() { - m_value = AZStd::make_shared(); + m_value = AZStd::allocate_shared(AZStdAlloc()); return *this; } @@ -511,6 +512,7 @@ namespace AZ::Dom Value& Value::AddMember(KeyType name, const Value& value) { Object::ContainerType& object = GetObjectInternal(); + object.reserve((object.size() / Object::ReserveIncrement + 1) * Object::ReserveIncrement); if (auto memberIt = FindMutableMember(name); memberIt != object.end()) { memberIt->second = value; @@ -613,7 +615,7 @@ namespace AZ::Dom Value& Value::SetArray() { - m_value = AZStd::make_shared(); + m_value = AZStd::allocate_shared(AZStdAlloc()); return *this; } @@ -685,7 +687,9 @@ namespace AZ::Dom Value& Value::PushBack(Value value) { - GetArrayInternal().push_back(AZStd::move(value)); + Array::ContainerType& array = GetArrayInternal(); + array.reserve((array.size() / Array::ReserveIncrement + 1) * Array::ReserveIncrement); + array.push_back(AZStd::move(value)); return *this; } @@ -717,7 +721,7 @@ namespace AZ::Dom void Value::SetNode(AZ::Name name) { - m_value = AZStd::make_shared(name); + m_value = AZStd::allocate_shared(AZStdAlloc(), name); } void Value::SetNode(AZStd::string_view name) @@ -899,6 +903,11 @@ namespace AZ::Dom return AZStd::get(m_value); case 6: // AZStd::shared_ptr return *AZStd::get>(m_value); + case 7: // ShortStringType + { + const ShortStringType& ShortString = AZStd::get(m_value); + return { ShortString.m_data.data(), ShortString.m_size }; + } } AZ_Assert(false, "AZ::Dom::Value: Called GetString on a non-string type"); return {}; @@ -911,12 +920,26 @@ namespace AZ::Dom void Value::SetString(AZStd::string_view value) { + if (value.size() <= ShortStringSize) + { + ShortStringType buffer; + buffer.m_size = value.size(); + memcpy(buffer.m_data.data(), value.data(), buffer.m_size); + m_value = buffer; + } m_value = value; } void Value::CopyFromString(AZStd::string_view value) { - m_value = AZStd::make_shared(value); + if (value.size() <= ShortStringSize) + { + SetString(value); + } + else + { + m_value = AZStd::allocate_shared(AZStdAlloc(), value); + } } AZStd::any& Value::GetOpaqueValue() const diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index 39ae5a5c37..4dd3bde197 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -11,11 +11,13 @@ #include #include #include +#include #include #include #include #include #include +#include namespace AZ::Dom { @@ -34,6 +36,22 @@ namespace AZ::Dom OpaqueType = 8, }; + class ValueAllocator final : public ThreadPoolBase + { + public: + AZ_CLASS_ALLOCATOR(ValueAllocator, SystemAllocator, 0); + AZ_TYPE_INFO(ValueAllocator, "{5BC8B389-72C7-459E-B502-12E74D61869F}"); + + ValueAllocator() + : ThreadPoolBase("DomValueAllocator", "Allocator for AZ::Dom::Value") + { + } + }; + + // class ValueAllocator : public Internal::PoolAllocatorHelper; using Iterator = ContainerType::iterator; using ConstIterator = ContainerType::const_iterator; + static constexpr const size_t ReserveIncrement = 4; private: ContainerType m_values; @@ -59,6 +78,7 @@ namespace AZ::Dom using ContainerType = AZStd::vector; using Iterator = ContainerType::iterator; using ConstIterator = ContainerType::const_iterator; + static constexpr const size_t ReserveIncrement = 8; private: ContainerType m_values; @@ -293,6 +313,18 @@ namespace AZ::Dom explicit Value(AZStd::any* opaqueValue); + static constexpr const size_t ShortStringSize = sizeof(AZStd::string_view) - sizeof(size_t); + struct ShortStringType + { + AZStd::array m_data; + size_t m_size; + + bool operator==(const ShortStringType& other) const + { + return m_size == other.m_size ? memcmp(m_data.data(), other.m_data.data(), m_size) == 0 : false; + } + }; + // If using the the copy on write model, anything stored internally as a shared_ptr will // detach and copy when doing a mutating operation if use_count() > 1. @@ -311,6 +343,7 @@ namespace AZ::Dom // StringType AZStd::string_view, AZStd::shared_ptr, + ShortStringType, // ObjectType ObjectPtr, // ArrayType @@ -320,6 +353,10 @@ namespace AZ::Dom // OpaqueType AZStd::any*>; + static_assert( + sizeof(ValueType) == sizeof(AZStd::variant), + "ValueType should have no members larger than ShortStringType"); + ValueType m_value; }; } // namespace AZ::Dom diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp index a760cc5b28..cf46a77d54 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp @@ -103,35 +103,68 @@ namespace AZ::Dom } const ValueInfo& topEntry = m_entryStack.top(); - if (topEntry.m_container.GetType() != containerType) + Value& container = topEntry.m_container; + ValueBuffer& buffer = GetValueBuffer(); + + if (container.GetType() != containerType) { return VisitorFailure( VisitorErrorCode::InternalError, AZStd::string::format("AZ::Dom::ValueWriter: %s called from within a different container type", endMethodName)); } - if (topEntry.m_attributeCount != attributeCount) + if (buffer.m_attributes.size() != attributeCount) { return VisitorFailure( VisitorErrorCode::InternalError, AZStd::string::format( "AZ::Dom::ValueWriter: %s expected %llu attributes but received %llu attributes instead", endMethodName, attributeCount, - topEntry.m_attributeCount)); + buffer.m_attributes.size())); } - if (topEntry.m_elementCount != elementCount) + if (buffer.m_elements.size() != elementCount) { return VisitorFailure( VisitorErrorCode::InternalError, AZStd::string::format( "AZ::Dom::ValueWriter: %s expected %llu elements but received %llu elements instead", endMethodName, elementCount, - topEntry.m_elementCount)); + buffer.m_elements.size())); + } + if (buffer.m_attributes.size() > 0) + { + container.MemberReserve(buffer.m_attributes.size()); + for (AZStd::pair& entry : buffer.m_attributes) + { + container.AddMember(AZStd::move(entry.first), AZStd::move(entry.second)); + } + buffer.m_attributes.clear(); + } + + if(buffer.m_elements.size() > 0) + { + container.Reserve(buffer.m_elements.size()); + for (Value& entry : buffer.m_elements) + { + container.PushBack(AZStd::move(entry)); + } + buffer.m_elements.clear(); } m_entryStack.pop(); return FinishWrite(); } + ValueWriter::ValueBuffer& ValueWriter::GetValueBuffer() + { + if (m_entryStack.size() <= m_valueBuffers.size()) + { + return m_valueBuffers[m_entryStack.size() - 1]; + } + + m_valueBuffers.resize(m_entryStack.size()); + return m_valueBuffers[m_entryStack.size() - 1]; + } + Visitor::Result ValueWriter::EndObject(AZ::u64 attributeCount) { return EndContainer(Type::ObjectType, attributeCount, 0); @@ -192,16 +225,16 @@ namespace AZ::Dom m_entryStack.top().m_value.Swap(value); ValueInfo& newEntry = m_entryStack.top(); + constexpr const size_t reserveSize = 8; + if (!newEntry.m_key.IsEmpty()) { - newEntry.m_container.AddMember(newEntry.m_key, AZStd::move(value)); + GetValueBuffer().m_attributes.emplace_back(AZStd::move(newEntry.m_key), AZStd::move(value)); newEntry.m_key = AZ::Name(); - ++newEntry.m_attributeCount; } else { - newEntry.m_container.PushBack(AZStd::move(value)); - ++newEntry.m_elementCount; + GetValueBuffer().m_elements.emplace_back(AZStd::move(value)); } return VisitorSuccess(); diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h index fb5f4324a6..617184a926 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h @@ -48,11 +48,18 @@ namespace AZ::Dom KeyType m_key; Value m_value; Value& m_container; - AZ::u64 m_attributeCount = 0; - AZ::u64 m_elementCount = 0; }; + struct ValueBuffer + { + AZStd::vector m_elements; + AZStd::vector> m_attributes; + }; + + ValueBuffer& GetValueBuffer(); + Value& m_result; AZStd::stack m_entryStack; + AZStd::vector m_valueBuffers; }; } // namespace AZ::Dom diff --git a/Code/Framework/AzCore/AzCore/Memory/PoolAllocator.h b/Code/Framework/AzCore/AzCore/Memory/PoolAllocator.h index 72418b3d6e..bf24f04156 100644 --- a/Code/Framework/AzCore/AzCore/Memory/PoolAllocator.h +++ b/Code/Framework/AzCore/AzCore/Memory/PoolAllocator.h @@ -25,12 +25,12 @@ namespace AZ * Template you can use to create your own thread pool allocators, as you can't inherit from ThreadPoolAllocator. * This is the case because we use tread local storage and we need separate "static" instance for each allocator. */ - template + template class PoolAllocatorHelper - : public SimpleSchemaAllocator + : public SimpleSchemaAllocator { public: - using Base = SimpleSchemaAllocator; + using Base = SimpleSchemaAllocator; using pointer_type = typename Base::pointer_type; using size_type = typename Base::size_type; using difference_type = typename Base::difference_type; @@ -140,13 +140,13 @@ namespace AZ * use PoolAllocatorThreadSafe or do the sync yourself. */ class PoolAllocator - : public Internal::PoolAllocatorHelper + : public Internal::PoolAllocatorHelper { public: AZ_CLASS_ALLOCATOR(PoolAllocator, SystemAllocator, 0); AZ_TYPE_INFO(PoolAllocator, "{D3DC61AF-0949-4BFA-87E0-62FA03A4C025}"); - using Base = Internal::PoolAllocatorHelper; + using Base = Internal::PoolAllocatorHelper; PoolAllocator(const char* name = "PoolAllocator", const char* desc = "Generic pool allocator for small objects") : Base(name, desc) @@ -154,21 +154,21 @@ namespace AZ } }; - template - using ThreadPoolBase = Internal::PoolAllocatorHelper >; + template + using ThreadPoolBase = Internal::PoolAllocatorHelper, ProfileAllocations >; /*! * Thread safe pool allocator. If you want to create your own thread pool heap, * inherit from ThreadPoolBase, as we need unique static variable for allocator type. */ class ThreadPoolAllocator final - : public ThreadPoolBase + : public ThreadPoolBase { public: AZ_CLASS_ALLOCATOR(ThreadPoolAllocator, SystemAllocator, 0); AZ_TYPE_INFO(ThreadPoolAllocator, "{05B4857F-CD06-4942-99FD-CA6A7BAE855A}"); - using Base = ThreadPoolBase; + using Base = ThreadPoolBase; ThreadPoolAllocator() : Base("PoolAllocatorThreadSafe", "Generic thread safe pool allocator for small objects") diff --git a/Code/Framework/AzCore/Tests/DOM/DomJsonBenchmarks.cpp b/Code/Framework/AzCore/Tests/DOM/DomJsonBenchmarks.cpp index 0baa4aeb53..3e6143e805 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomJsonBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomJsonBenchmarks.cpp @@ -8,9 +8,10 @@ #if defined(HAVE_BENCHMARK) -#include #include #include +#include +#include #include #include #include @@ -25,22 +26,26 @@ namespace Benchmark { UnitTest::AllocatorsBenchmarkFixture::SetUp(st); AZ::NameDictionary::Create(); + AZ::AllocatorInstance::Create(); } void SetUp(::benchmark::State& st) override { UnitTest::AllocatorsBenchmarkFixture::SetUp(st); AZ::NameDictionary::Create(); + AZ::AllocatorInstance::Create(); } void TearDown(::benchmark::State& st) override { + AZ::AllocatorInstance::Destroy(); AZ::NameDictionary::Destroy(); UnitTest::AllocatorsBenchmarkFixture::TearDown(st); } void TearDown(const ::benchmark::State& st) override { + AZ::AllocatorInstance::Destroy(); AZ::NameDictionary::Destroy(); UnitTest::AllocatorsBenchmarkFixture::TearDown(st); } @@ -143,6 +148,30 @@ namespace Benchmark } BENCHMARK_REGISTER_JSON(DomJsonBenchmark, DomDeserializeToDocumentInPlace) + BENCHMARK_DEFINE_F(DomJsonBenchmark, DomDeserializeToDomValueInPlace)(benchmark::State& state) + { + AZ::Dom::JsonBackend backend; + AZStd::string serializedPayload = GenerateDomJsonBenchmarkPayload(state.range(0), state.range(1)); + + for (auto _ : state) + { + state.PauseTiming(); + AZStd::string payloadCopy = serializedPayload; + state.ResumeTiming(); + + auto result = AZ::Dom::Utils::WriteToValue( + [&](AZ::Dom::Visitor& visitor) + { + return AZ::Dom::Utils::ReadFromStringInPlace(backend, payloadCopy, visitor); + }); + + benchmark::DoNotOptimize(result.GetValue()); + } + + state.SetBytesProcessed(serializedPayload.size() * state.iterations()); + } + BENCHMARK_REGISTER_JSON(DomJsonBenchmark, DomDeserializeToDomValueInPlace) + BENCHMARK_DEFINE_F(DomJsonBenchmark, DomDeserializeToDocument)(benchmark::State& state) { AZ::Dom::JsonBackend backend; @@ -179,6 +208,17 @@ namespace Benchmark } BENCHMARK_REGISTER_JSON(DomJsonBenchmark, JsonUtilsDeserializeToDocument) + BENCHMARK_DEFINE_F(DomJsonBenchmark, RapidjsonPayloadGeneration)(benchmark::State& state) + { + for (auto _ : state) + { + benchmark::DoNotOptimize(GenerateDomJsonBenchmarkPayload(state.range(0), state.range(1))); + } + + state.SetItemsProcessed(state.range(0) * state.range(0) * state.iterations()); + } + BENCHMARK_REGISTER_JSON(DomJsonBenchmark, RapidjsonPayloadGeneration) + #undef BENCHMARK_REGISTER_JSON } // namespace Benchmark diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp index e69de29bb2..d11ef7f69e 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp @@ -0,0 +1,117 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include +#include + +namespace AZ::Dom::Benchmark +{ + class DomValueBenchmark : public UnitTest::AllocatorsBenchmarkFixture + { + public: + void SetUp(const ::benchmark::State& st) override + { + UnitTest::AllocatorsBenchmarkFixture::SetUp(st); + AZ::NameDictionary::Create(); + AZ::AllocatorInstance::Create(); + } + + void SetUp(::benchmark::State& st) override + { + UnitTest::AllocatorsBenchmarkFixture::SetUp(st); + AZ::NameDictionary::Create(); + AZ::AllocatorInstance::Create(); + } + + void TearDown(::benchmark::State& st) override + { + AZ::AllocatorInstance::Destroy(); + AZ::NameDictionary::Destroy(); + UnitTest::AllocatorsBenchmarkFixture::TearDown(st); + } + + void TearDown(const ::benchmark::State& st) override + { + AZ::AllocatorInstance::Destroy(); + AZ::NameDictionary::Destroy(); + UnitTest::AllocatorsBenchmarkFixture::TearDown(st); + } + + Value GenerateDomBenchmarkPayload(int64_t entryCount, int64_t stringTemplateLength) + { + Value root(Type::ObjectType); + + AZStd::string entryTemplate; + while (entryTemplate.size() < static_cast(stringTemplateLength)) + { + entryTemplate += "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor "; + } + entryTemplate.resize(stringTemplateLength); + AZStd::string buffer; + + auto createString = [&](int n) -> Value + { + return Value(AZStd::string::format("#%i %s", n, entryTemplate.c_str()), true); + }; + + auto createEntry = [&](int n) -> Value + { + Value entry(Type::ObjectType); + entry.AddMember("string", createString(n)); + entry.AddMember("int", n); + entry.AddMember("double", static_cast(n) * 0.5); + entry.AddMember("bool", n % 2 == 0); + entry.AddMember("null", Value(Type::NullType)); + return entry; + }; + + auto createArray = [&]() -> Value + { + Value array(Type::ArrayType); + for (int i = 0; i < entryCount; ++i) + { + array.PushBack(createEntry(i)); + } + return array; + }; + + auto createObject = [&]() -> Value + { + Value object; + object.SetObject(); + for (int i = 0; i < entryCount; ++i) + { + buffer = AZStd::string::format("Key%i", i); + object.AddMember(AZ::Name(buffer), createArray()); + } + return object; + }; + + root["entries"] = createObject(); + + return root; + } + }; + + BENCHMARK_DEFINE_F(DomValueBenchmark, ValuePayloadGeneration)(benchmark::State& state) + { + for (auto _ : state) + { + benchmark::DoNotOptimize(GenerateDomBenchmarkPayload(state.range(0), state.range(1))); + } + + state.SetItemsProcessed(state.range(0) * state.range(0) * state.iterations()); + } + BENCHMARK_REGISTER_F(DomValueBenchmark, ValuePayloadGeneration) + ->Args({ 10, 5 }) + ->Args({ 10, 500 }) + ->Args({ 100, 5 }) + ->Args({ 100, 500 }) + ->Unit(benchmark::kMillisecond); +} // namespace AZ::Dom::Benchmark diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp index 84e2e16958..125f426e02 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp @@ -25,12 +25,14 @@ namespace AZ::Dom::Tests { UnitTest::AllocatorsFixture::SetUp(); NameDictionary::Create(); + AZ::AllocatorInstance::Create(); } void TearDown() override { m_value = Value(); + AZ::AllocatorInstance::Destroy(); NameDictionary::Destroy(); UnitTest::AllocatorsFixture::TearDown(); } @@ -279,19 +281,24 @@ namespace AZ::Dom::Tests TEST_F(DomValueTests, String) { + const char* s1 = "reference string long enough to avoid SSO"; + const char* s2 = "copy string long enough to avoid SSO"; + m_value.SetObject(); - AZStd::string stringToReference = "foo"; + AZStd::string stringToReference = s1; m_value["no_copy"] = Value(stringToReference, false); - AZStd::string stringToCopy = "bar"; + AZStd::string stringToCopy = s2; m_value["copy"] = Value(stringToCopy, true); EXPECT_EQ(m_value["no_copy"].GetType(), Type::StringType); - EXPECT_EQ(m_value["no_copy"].GetString(), stringToReference); - EXPECT_EQ(m_value["no_copy"].GetString().data(), stringToReference.data()); + EXPECT_EQ(m_value["no_copy"].GetString(), s1); + stringToReference.at(0) = 'F'; + EXPECT_NE(m_value["no_copy"].GetString(), s1); EXPECT_EQ(m_value["copy"].GetType(), Type::StringType); - EXPECT_EQ(m_value["copy"].GetString(), stringToCopy); - EXPECT_NE(m_value["copy"].GetString().data(), stringToCopy.data()); + EXPECT_EQ(m_value["copy"].GetString(), s2); + stringToCopy.at(0) = 'F'; + EXPECT_EQ(m_value["copy"].GetString(), s2); PerformValueChecks(); } From 809ee2dce96fb3464a7a5d5a020469843dcdedc0 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Fri, 10 Dec 2021 16:18:38 -0800 Subject: [PATCH 087/948] Fix "force string copy" logic Signed-off-by: Nicholas Van Sickle --- .../AzCore/DOM/Backends/JSON/JsonSerializationUtils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/Backends/JSON/JsonSerializationUtils.cpp b/Code/Framework/AzCore/AzCore/DOM/Backends/JSON/JsonSerializationUtils.cpp index 17f9bfea54..bc8ac9167c 100644 --- a/Code/Framework/AzCore/AzCore/DOM/Backends/JSON/JsonSerializationUtils.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/Backends/JSON/JsonSerializationUtils.cpp @@ -361,7 +361,7 @@ namespace AZ::Dom::Json bool RapidJsonReadHandler::String(const char* str, rapidjson::SizeType length, bool copy) { - const Lifetime lifetime = copy ? m_stringLifetime : Lifetime::Temporary; + const Lifetime lifetime = !copy ? m_stringLifetime : Lifetime::Temporary; return CheckResult(m_visitor->String(AZStd::string_view(str, length), lifetime)); } @@ -377,7 +377,7 @@ namespace AZ::Dom::Json { m_visitor->Key(AZ::Name(key)); } - const Lifetime lifetime = copy ? m_stringLifetime : Lifetime::Temporary; + const Lifetime lifetime = !copy ? m_stringLifetime : Lifetime::Temporary; return CheckResult(m_visitor->RawKey(key, lifetime)); } From 1f2635d24bdaa200e256312df2df364b9cd26c2c Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Fri, 10 Dec 2021 16:35:26 -0800 Subject: [PATCH 088/948] Switch to the high pref heap allocator, roll back pool interface changes Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 13 ++++++------- .../AzCore/AzCore/Memory/PoolAllocator.h | 18 +++++++++--------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index 4dd3bde197..9399e10d15 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -36,22 +37,20 @@ namespace AZ::Dom OpaqueType = 8, }; - class ValueAllocator final : public ThreadPoolBase + class ValueAllocator final : public SimpleSchemaAllocator { public: - AZ_CLASS_ALLOCATOR(ValueAllocator, SystemAllocator, 0); AZ_TYPE_INFO(ValueAllocator, "{5BC8B389-72C7-459E-B502-12E74D61869F}"); + using Base = SimpleSchemaAllocator; + ValueAllocator() - : ThreadPoolBase("DomValueAllocator", "Allocator for AZ::Dom::Value") + : Base("DomValueAllocator", "Allocator for AZ::Dom::Value") { + DisableOverriding(); } }; - // class ValueAllocator : public Internal::PoolAllocatorHelper + template class PoolAllocatorHelper - : public SimpleSchemaAllocator + : public SimpleSchemaAllocator { public: - using Base = SimpleSchemaAllocator; + using Base = SimpleSchemaAllocator; using pointer_type = typename Base::pointer_type; using size_type = typename Base::size_type; using difference_type = typename Base::difference_type; @@ -140,13 +140,13 @@ namespace AZ * use PoolAllocatorThreadSafe or do the sync yourself. */ class PoolAllocator - : public Internal::PoolAllocatorHelper + : public Internal::PoolAllocatorHelper { public: AZ_CLASS_ALLOCATOR(PoolAllocator, SystemAllocator, 0); AZ_TYPE_INFO(PoolAllocator, "{D3DC61AF-0949-4BFA-87E0-62FA03A4C025}"); - using Base = Internal::PoolAllocatorHelper; + using Base = Internal::PoolAllocatorHelper; PoolAllocator(const char* name = "PoolAllocator", const char* desc = "Generic pool allocator for small objects") : Base(name, desc) @@ -154,21 +154,21 @@ namespace AZ } }; - template - using ThreadPoolBase = Internal::PoolAllocatorHelper, ProfileAllocations >; + template + using ThreadPoolBase = Internal::PoolAllocatorHelper >; /*! * Thread safe pool allocator. If you want to create your own thread pool heap, * inherit from ThreadPoolBase, as we need unique static variable for allocator type. */ class ThreadPoolAllocator final - : public ThreadPoolBase + : public ThreadPoolBase { public: AZ_CLASS_ALLOCATOR(ThreadPoolAllocator, SystemAllocator, 0); AZ_TYPE_INFO(ThreadPoolAllocator, "{05B4857F-CD06-4942-99FD-CA6A7BAE855A}"); - using Base = ThreadPoolBase; + using Base = ThreadPoolBase; ThreadPoolAllocator() : Base("PoolAllocatorThreadSafe", "Generic thread safe pool allocator for small objects") From 5da5ff90670c5260019989de8881d5e67b96ca4c Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Fri, 10 Dec 2021 17:13:23 -0800 Subject: [PATCH 089/948] Removed file size limit on .shadervariantlist files. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../Shader/Code/Source/Editor/ShaderVariantAssetBuilder.cpp | 4 ++-- Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Common/JsonUtils.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderVariantAssetBuilder.cpp b/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderVariantAssetBuilder.cpp index 5eaa0d9ddb..8dc67bb3d1 100644 --- a/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderVariantAssetBuilder.cpp +++ b/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderVariantAssetBuilder.cpp @@ -241,7 +241,7 @@ namespace AZ { // Need to get the name of the shader file from the template so that we can preprocess the shader data and setup // source file dependencies. - if (!RPI::JsonUtils::LoadObjectFromFile(variantListFullPath, shaderVariantList)) + if (!RPI::JsonUtils::LoadObjectFromFile(variantListFullPath, shaderVariantList, AZStd::numeric_limits::max())) { AZ_Error(ShaderVariantAssetBuilderName, false, "Failed to parse Shader Variant List Descriptor JSON from [%s]", variantListFullPath.c_str()); return LoadResult{LoadResult::Code::Error}; @@ -635,7 +635,7 @@ namespace AZ AzFramework::StringFunc::Path::ConstructFull(request.m_watchFolder.data(), request.m_sourceFile.data(), variantListFullPath, true); RPI::ShaderVariantListSourceData shaderVariantListDescriptor; - if (!RPI::JsonUtils::LoadObjectFromFile(variantListFullPath, shaderVariantListDescriptor)) + if (!RPI::JsonUtils::LoadObjectFromFile(variantListFullPath, shaderVariantListDescriptor, AZStd::numeric_limits::max())) { AZ_Assert(false, "Failed to parse Shader Variant List Descriptor JSON [%s]", variantListFullPath.c_str()); response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Failed; diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Common/JsonUtils.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Common/JsonUtils.h index 4715acd64c..9f4cdcf31b 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Common/JsonUtils.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Common/JsonUtils.h @@ -29,7 +29,7 @@ namespace AZ //! Loads serialized object data from a json file at the specified path //! Errors will be reported using AZ trace template - bool LoadObjectFromFile(const AZStd::string& path, ObjectType& objectData); + bool LoadObjectFromFile(const AZStd::string& path, ObjectType& objectData, size_t maxFileSize = DefaultMaxFileSize); //! Saves serialized object data to a json file at the specified path //! Errors will be reported using AZ trace @@ -39,11 +39,11 @@ namespace AZ // Definitions... template - bool LoadObjectFromFile(const AZStd::string& path, ObjectType& objectData) + bool LoadObjectFromFile(const AZStd::string& path, ObjectType& objectData, size_t maxFileSize) { objectData = ObjectType(); - auto loadOutcome = AZ::JsonSerializationUtils::ReadJsonFile(path, DefaultMaxFileSize); + auto loadOutcome = AZ::JsonSerializationUtils::ReadJsonFile(path, maxFileSize); if (!loadOutcome.IsSuccess()) { AZ_Error("AZ::RPI::JsonUtils", false, "%s", loadOutcome.GetError().c_str()); From c53c97cf5f80bda645654cc4613be86a9eccc373 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Sat, 11 Dec 2021 15:54:57 -0800 Subject: [PATCH 090/948] Add another round of benchmarks Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 12 +- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 2 + .../AzCore/AzCore/DOM/DomValueWriter.cpp | 6 + .../AzCore/AzCore/DOM/DomValueWriter.h | 1 + .../AzCore/AzCore/DOM/DomVisitor.cpp | 5 + Code/Framework/AzCore/AzCore/DOM/DomVisitor.h | 2 + .../AzCore/Tests/DOM/DomJsonBenchmarks.cpp | 86 ++++++++++++-- .../AzCore/Tests/DOM/DomValueBenchmarks.cpp | 110 +++++++++++++++++- 8 files changed, 210 insertions(+), 14 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index d8650601ba..ed4488267a 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -61,6 +61,11 @@ namespace AZ::Dom return m_children; } + Value::Value(AZStd::shared_ptr string) + : m_value(string) + { + } + Value::Value() { } @@ -895,6 +900,11 @@ namespace AZ::Dom m_value = aznumeric_cast(value); } + void Value::SetString(AZStd::shared_ptr string) + { + m_value = string; + } + AZStd::string_view Value::GetString() const { switch (m_value.index()) @@ -992,7 +1002,7 @@ namespace AZ::Dom } else if constexpr (AZStd::is_same_v>) { - result = visitor.String(*arg, copyStrings ? Lifetime::Temporary : Lifetime::Persistent); + result = visitor.RefCountedString(arg, copyStrings ? Lifetime::Temporary : Lifetime::Persistent); } else if constexpr (AZStd::is_same_v) { diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index 9399e10d15..ac6a9d0c51 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -127,6 +127,7 @@ namespace AZ::Dom Value(const Value&); Value(Value&&) noexcept; Value(AZStd::string_view string, bool copy); + Value(AZStd::shared_ptr string); Value(int32_t value); Value(uint32_t value); @@ -281,6 +282,7 @@ namespace AZ::Dom AZStd::string_view GetString() const; size_t GetStringLength() const; void SetString(AZStd::string_view); + void SetString(AZStd::shared_ptr); void CopyFromString(AZStd::string_view); // opaque type API... diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp index cf46a77d54..a8cc1f3947 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp @@ -68,6 +68,12 @@ namespace AZ::Dom return FinishWrite(); } + Visitor::Result ValueWriter::RefCountedString(AZStd::shared_ptr value, [[maybe_unused]] Lifetime lifetime) + { + CurrentValue().SetString(value); + return FinishWrite(); + } + Visitor::Result ValueWriter::StartObject() { CurrentValue().SetObject(); diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h index 617184a926..4c1d5a26ee 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h @@ -26,6 +26,7 @@ namespace AZ::Dom Result Double(double value) override; Result String(AZStd::string_view value, Lifetime lifetime) override; + Result RefCountedString(AZStd::shared_ptr value, Lifetime lifetime) override; Result StartObject() override; Result EndObject(AZ::u64 attributeCount) override; Result Key(AZ::Name key) override; diff --git a/Code/Framework/AzCore/AzCore/DOM/DomVisitor.cpp b/Code/Framework/AzCore/AzCore/DOM/DomVisitor.cpp index ad314da385..af64c4cea8 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomVisitor.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomVisitor.cpp @@ -105,6 +105,11 @@ namespace AZ::Dom return VisitorSuccess(); } + Visitor::Result Visitor::RefCountedString(AZStd::shared_ptr value, Lifetime lifetime) + { + return String(*value, lifetime); + } + Visitor::Result Visitor::OpaqueValue([[maybe_unused]] const OpaqueType& value, [[maybe_unused]] Lifetime lifetime) { if (!SupportsOpaqueValues()) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomVisitor.h b/Code/Framework/AzCore/AzCore/DOM/DomVisitor.h index bbe78131c3..3439a566e2 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomVisitor.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomVisitor.h @@ -12,6 +12,7 @@ #include #include #include +#include namespace AZ::Dom { @@ -170,6 +171,7 @@ namespace AZ::Dom //! Operates on a string value. As strings are a reference type. //! Storage semantics are provided to indicate where the value may be stored persistently or requires a copy. virtual Result String(AZStd::string_view value, Lifetime lifetime); + virtual Result RefCountedString(AZStd::shared_ptr value, Lifetime lifetime); //! Operates on an opaque value. As opaque values are a reference type, storage semantics are provided to //! indicate where the value may be stored persistently or requires a copy. //! The base implementation of OpaqueValue rejects the operation, as opaque values are meant for special diff --git a/Code/Framework/AzCore/Tests/DOM/DomJsonBenchmarks.cpp b/Code/Framework/AzCore/Tests/DOM/DomJsonBenchmarks.cpp index 3e6143e805..98e62f4aa6 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomJsonBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomJsonBenchmarks.cpp @@ -50,7 +50,7 @@ namespace Benchmark UnitTest::AllocatorsBenchmarkFixture::TearDown(st); } - AZStd::string GenerateDomJsonBenchmarkPayload(int64_t entryCount, int64_t stringTemplateLength) + rapidjson::Document GenerateDomJsonBenchmarkDocument(int64_t entryCount, int64_t stringTemplateLength) { rapidjson::Document document; document.SetObject(); @@ -108,6 +108,13 @@ namespace Benchmark document.SetObject(); document.AddMember("entries", createObject(), document.GetAllocator()); + return document; + } + + AZStd::string GenerateDomJsonBenchmarkPayload(int64_t entryCount, int64_t stringTemplateLength) + { + rapidjson::Document document = GenerateDomJsonBenchmarkDocument(entryCount, stringTemplateLength); + AZStd::string serializedJson; auto result = AZ::JsonSerializationUtils::WriteJsonString(document, serializedJson); AZ_Assert(result.IsSuccess(), "Failed to serialize generated JSON"); @@ -124,7 +131,7 @@ namespace Benchmark ->Args({ 100, 500 }) \ ->Unit(benchmark::kMillisecond); - BENCHMARK_DEFINE_F(DomJsonBenchmark, DomDeserializeToDocumentInPlace)(benchmark::State& state) + BENCHMARK_DEFINE_F(DomJsonBenchmark, AzDomDeserializeToRapidjsonInPlace)(benchmark::State& state) { AZ::Dom::JsonBackend backend; AZStd::string serializedPayload = GenerateDomJsonBenchmarkPayload(state.range(0), state.range(1)); @@ -146,9 +153,9 @@ namespace Benchmark state.SetBytesProcessed(serializedPayload.size() * state.iterations()); } - BENCHMARK_REGISTER_JSON(DomJsonBenchmark, DomDeserializeToDocumentInPlace) + BENCHMARK_REGISTER_JSON(DomJsonBenchmark, AzDomDeserializeToRapidjsonInPlace) - BENCHMARK_DEFINE_F(DomJsonBenchmark, DomDeserializeToDomValueInPlace)(benchmark::State& state) + BENCHMARK_DEFINE_F(DomJsonBenchmark, AzDomDeserializeToAzDomValueInPlace)(benchmark::State& state) { AZ::Dom::JsonBackend backend; AZStd::string serializedPayload = GenerateDomJsonBenchmarkPayload(state.range(0), state.range(1)); @@ -170,9 +177,9 @@ namespace Benchmark state.SetBytesProcessed(serializedPayload.size() * state.iterations()); } - BENCHMARK_REGISTER_JSON(DomJsonBenchmark, DomDeserializeToDomValueInPlace) + BENCHMARK_REGISTER_JSON(DomJsonBenchmark, AzDomDeserializeToAzDomValueInPlace) - BENCHMARK_DEFINE_F(DomJsonBenchmark, DomDeserializeToDocument)(benchmark::State& state) + BENCHMARK_DEFINE_F(DomJsonBenchmark, AzDomDeserializeToRapidjson)(benchmark::State& state) { AZ::Dom::JsonBackend backend; AZStd::string serializedPayload = GenerateDomJsonBenchmarkPayload(state.range(0), state.range(1)); @@ -190,9 +197,29 @@ namespace Benchmark state.SetBytesProcessed(serializedPayload.size() * state.iterations()); } - BENCHMARK_REGISTER_JSON(DomJsonBenchmark, DomDeserializeToDocument) + BENCHMARK_REGISTER_JSON(DomJsonBenchmark, AzDomDeserializeToRapidjson) + + BENCHMARK_DEFINE_F(DomJsonBenchmark, AzDomDeserializeToAzDomValue)(benchmark::State& state) + { + AZ::Dom::JsonBackend backend; + AZStd::string serializedPayload = GenerateDomJsonBenchmarkPayload(state.range(0), state.range(1)); + + for (auto _ : state) + { + auto result = AZ::Dom::Utils::WriteToValue( + [&](AZ::Dom::Visitor& visitor) + { + return AZ::Dom::Utils::ReadFromString(backend, serializedPayload, AZ::Dom::Lifetime::Temporary, visitor); + }); + + benchmark::DoNotOptimize(result.GetValue()); + } + + state.SetBytesProcessed(serializedPayload.size() * state.iterations()); + } + BENCHMARK_REGISTER_JSON(DomJsonBenchmark, AzDomDeserializeToAzDomValue) - BENCHMARK_DEFINE_F(DomJsonBenchmark, JsonUtilsDeserializeToDocument)(benchmark::State& state) + BENCHMARK_DEFINE_F(DomJsonBenchmark, RapidjsonDeserializeToRapidjson)(benchmark::State& state) { AZ::Dom::JsonBackend backend; AZStd::string serializedPayload = GenerateDomJsonBenchmarkPayload(state.range(0), state.range(1)); @@ -206,9 +233,9 @@ namespace Benchmark state.SetBytesProcessed(serializedPayload.size() * state.iterations()); } - BENCHMARK_REGISTER_JSON(DomJsonBenchmark, JsonUtilsDeserializeToDocument) + BENCHMARK_REGISTER_JSON(DomJsonBenchmark, RapidjsonDeserializeToRapidjson) - BENCHMARK_DEFINE_F(DomJsonBenchmark, RapidjsonPayloadGeneration)(benchmark::State& state) + BENCHMARK_DEFINE_F(DomJsonBenchmark, RapidjsonMakeComplexObject)(benchmark::State& state) { for (auto _ : state) { @@ -217,7 +244,44 @@ namespace Benchmark state.SetItemsProcessed(state.range(0) * state.range(0) * state.iterations()); } - BENCHMARK_REGISTER_JSON(DomJsonBenchmark, RapidjsonPayloadGeneration) + BENCHMARK_REGISTER_JSON(DomJsonBenchmark, RapidjsonMakeComplexObject) + + BENCHMARK_DEFINE_F(DomJsonBenchmark, RapidjsonLookupMemberByString)(benchmark::State& state) + { + rapidjson::Document document(rapidjson::kObjectType); + AZStd::vector keys; + for (int64_t i = 0; i < state.range(0); ++i) + { + AZStd::string key(AZStd::string::format("key%" PRId64, i)); + keys.push_back(key); + document.AddMember(rapidjson::Value(key.data(), static_cast(key.size()), document.GetAllocator()), rapidjson::Value(i), document.GetAllocator()); + } + + for (auto _ : state) + { + for (const AZStd::string& key : keys) + { + benchmark::DoNotOptimize(document.FindMember(key.data())); + } + } + + state.SetItemsProcessed(state.iterations() * state.range(0)); + } + BENCHMARK_REGISTER_F(DomJsonBenchmark, RapidjsonLookupMemberByString)->Arg(100)->Arg(1000)->Arg(10000)->Unit(benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(DomJsonBenchmark, RapidjsonDeepCopy)(benchmark::State& state) + { + rapidjson::Document original = GenerateDomJsonBenchmarkDocument(state.range(0), state.range(1)); + + for (auto _ : state) + { + rapidjson::Document copy; + original.Accept(copy); + } + + state.SetItemsProcessed(state.iterations()); + } + BENCHMARK_REGISTER_JSON(DomJsonBenchmark, RapidjsonDeepCopy) #undef BENCHMARK_REGISTER_JSON } // namespace Benchmark diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp index d11ef7f69e..e3a0db594c 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp @@ -9,6 +9,7 @@ #include #include #include +#include namespace AZ::Dom::Benchmark { @@ -99,7 +100,7 @@ namespace AZ::Dom::Benchmark } }; - BENCHMARK_DEFINE_F(DomValueBenchmark, ValuePayloadGeneration)(benchmark::State& state) + BENCHMARK_DEFINE_F(DomValueBenchmark, AzDomValueMakeComplexObject)(benchmark::State& state) { for (auto _ : state) { @@ -108,10 +109,115 @@ namespace AZ::Dom::Benchmark state.SetItemsProcessed(state.range(0) * state.range(0) * state.iterations()); } - BENCHMARK_REGISTER_F(DomValueBenchmark, ValuePayloadGeneration) + BENCHMARK_REGISTER_F(DomValueBenchmark, AzDomValueMakeComplexObject) ->Args({ 10, 5 }) ->Args({ 10, 500 }) ->Args({ 100, 5 }) ->Args({ 100, 500 }) ->Unit(benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(DomValueBenchmark, AzDomValueShallowCopy)(benchmark::State& state) + { + Value original = GenerateDomBenchmarkPayload(state.range(0), state.range(1)); + + for (auto _ : state) + { + Value copy = original; + benchmark::DoNotOptimize(copy); + } + + state.SetItemsProcessed(state.iterations()); + } + BENCHMARK_REGISTER_F(DomValueBenchmark, AzDomValueShallowCopy) + ->Args({ 10, 5 }) + ->Args({ 10, 500 }) + ->Args({ 100, 5 }) + ->Args({ 100, 500 }) + ->Unit(benchmark::kNanosecond); + + BENCHMARK_DEFINE_F(DomValueBenchmark, AzDomValueShallowCopyAndMutate)(benchmark::State& state) + { + Value original = GenerateDomBenchmarkPayload(state.range(0), state.range(1)); + + for (auto _ : state) + { + Value copy = original; + copy["entries"]["Key0"].PushBack(42); + benchmark::DoNotOptimize(copy); + } + + state.SetItemsProcessed(state.iterations()); + } + BENCHMARK_REGISTER_F(DomValueBenchmark, AzDomValueShallowCopyAndMutate) + ->Args({ 10, 5 }) + ->Args({ 10, 500 }) + ->Args({ 100, 5 }) + ->Args({ 100, 500 }) + ->Unit(benchmark::kNanosecond); + + BENCHMARK_DEFINE_F(DomValueBenchmark, AzDomValueDeepCopy)(benchmark::State& state) + { + Value original = GenerateDomBenchmarkPayload(state.range(0), state.range(1)); + + for (auto _ : state) + { + Value copy = original.DeepCopy(); + benchmark::DoNotOptimize(copy); + } + + state.SetItemsProcessed(state.iterations()); + } + BENCHMARK_REGISTER_F(DomValueBenchmark, AzDomValueDeepCopy) + ->Args({ 10, 5 }) + ->Args({ 10, 500 }) + ->Args({ 100, 5 }) + ->Args({ 100, 500 }) + ->Unit(benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(DomValueBenchmark, LookupMemberByName)(benchmark::State& state) + { + Value value(Type::ObjectType); + AZStd::vector keys; + for (int64_t i = 0; i < state.range(0); ++i) + { + AZ::Name key(AZStd::string::format("key%" PRId64, i)); + keys.push_back(key); + value[key] = i; + } + + for (auto _ : state) + { + for (const AZ::Name& key : keys) + { + benchmark::DoNotOptimize(value[key]); + } + } + + state.SetItemsProcessed(state.iterations() * state.range(0)); + } + BENCHMARK_REGISTER_F(DomValueBenchmark, LookupMemberByName)->Arg(100)->Arg(1000)->Arg(10000)->Unit(benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(DomValueBenchmark, LookupMemberByString)(benchmark::State& state) + { + Value value(Type::ObjectType); + AZStd::vector keys; + for (int64_t i = 0; i < state.range(0); ++i) + { + AZStd::string key(AZStd::string::format("key%" PRId64, i)); + keys.push_back(key); + value[key] = i; + } + + for (auto _ : state) + { + for (const AZStd::string& key : keys) + { + benchmark::DoNotOptimize(value[key]); + } + } + + state.SetItemsProcessed(state.iterations() * state.range(0)); + } + BENCHMARK_REGISTER_F(DomValueBenchmark, LookupMemberByString)->Arg(100)->Arg(1000)->Arg(10000)->Unit(benchmark::kMillisecond); + } // namespace AZ::Dom::Benchmark From cc120c772cab1ba8a601ca063a85d7e9838b00c2 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Sun, 12 Dec 2021 12:58:52 -0800 Subject: [PATCH 091/948] Add RapidjsonCopyAndMutate to compare w/ shallow copy Signed-off-by: Nicholas Van Sickle --- .../AzCore/Tests/DOM/DomJsonBenchmarks.cpp | 20 ++++++++++++++++++- .../AzCore/Tests/DOM/DomValueBenchmarks.cpp | 4 ++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/Code/Framework/AzCore/Tests/DOM/DomJsonBenchmarks.cpp b/Code/Framework/AzCore/Tests/DOM/DomJsonBenchmarks.cpp index 98e62f4aa6..477802dc37 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomJsonBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomJsonBenchmarks.cpp @@ -276,13 +276,31 @@ namespace Benchmark for (auto _ : state) { rapidjson::Document copy; - original.Accept(copy); + copy.CopyFrom(original, copy.GetAllocator(), true); + benchmark::DoNotOptimize(copy); } state.SetItemsProcessed(state.iterations()); } + BENCHMARK_REGISTER_JSON(DomJsonBenchmark, RapidjsonDeepCopy) + BENCHMARK_DEFINE_F(DomJsonBenchmark, RapidjsonCopyAndMutate)(benchmark::State& state) + { + rapidjson::Document original = GenerateDomJsonBenchmarkDocument(state.range(0), state.range(1)); + + for (auto _ : state) + { + rapidjson::Document copy; + copy.CopyFrom(original, copy.GetAllocator(), true); + copy["entries"]["Key0"].PushBack(42, copy.GetAllocator()); + benchmark::DoNotOptimize(copy); + } + + state.SetItemsProcessed(state.iterations()); + } + BENCHMARK_REGISTER_JSON(DomJsonBenchmark, RapidjsonCopyAndMutate) + #undef BENCHMARK_REGISTER_JSON } // namespace Benchmark diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp index e3a0db594c..3e02eaff2e 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp @@ -135,7 +135,7 @@ namespace AZ::Dom::Benchmark ->Args({ 100, 500 }) ->Unit(benchmark::kNanosecond); - BENCHMARK_DEFINE_F(DomValueBenchmark, AzDomValueShallowCopyAndMutate)(benchmark::State& state) + BENCHMARK_DEFINE_F(DomValueBenchmark, AzDomValueCopyAndMutate)(benchmark::State& state) { Value original = GenerateDomBenchmarkPayload(state.range(0), state.range(1)); @@ -148,7 +148,7 @@ namespace AZ::Dom::Benchmark state.SetItemsProcessed(state.iterations()); } - BENCHMARK_REGISTER_F(DomValueBenchmark, AzDomValueShallowCopyAndMutate) + BENCHMARK_REGISTER_F(DomValueBenchmark, AzDomValueCopyAndMutate) ->Args({ 10, 5 }) ->Args({ 10, 500 }) ->Args({ 100, 5 }) From d9ac3c21208442916f3345c01e73306a722beb82 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Sun, 12 Dec 2021 13:56:10 -0800 Subject: [PATCH 092/948] Tidy up Type enum Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 82 +++++++++---------- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 18 ++-- .../AzCore/AzCore/DOM/DomValueWriter.cpp | 12 +-- .../AzCore/Tests/DOM/DomValueBenchmarks.cpp | 12 +-- .../AzCore/Tests/DOM/DomValueTests.cpp | 38 ++++----- 5 files changed, 81 insertions(+), 81 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index ed4488267a..59e21a7d8b 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -141,31 +141,31 @@ namespace AZ::Dom { switch (type) { - case Type::NullType: + case Type::Null: // Null is the default initialized value break; - case Type::FalseType: + case Type::False: m_value = false; break; - case Type::TrueType: + case Type::True: m_value = true; break; - case Type::ObjectType: + case Type::Object: SetObject(); break; - case Type::ArrayType: + case Type::Array: SetArray(); break; - case Type::StringType: + case Type::String: SetString(""); break; - case Type::NumberType: + case Type::Number: m_value = 0.0; break; - case Type::NodeType: + case Type::Node: SetNode(""); break; - case Type::OpaqueType: + case Type::Opaque: AZ_Assert(false, "AZ::Dom::Value may not be constructed with an empty opaque type"); break; } @@ -225,43 +225,43 @@ namespace AZ::Dom switch (m_value.index()) { case 0: // AZStd::monostate - return Type::NullType; + return Type::Null; case 1: // int64_t case 2: // uint64_t case 3: // double - return Type::NumberType; + return Type::Number; case 4: // bool - return AZStd::get(m_value) ? Type::TrueType : Type::FalseType; + return AZStd::get(m_value) ? Type::True : Type::False; case 5: // AZStd::string_view case 6: // AZStd::shared_ptr case 7: // ShortStringType - return Type::StringType; + return Type::String; case 8: // ObjectPtr - return Type::ObjectType; + return Type::Object; case 9: // ArrayPtr - return Type::ArrayType; + return Type::Array; case 10: // NodePtr - return Type::NodeType; + return Type::Node; case 11: // AZStd::any* - return Type::OpaqueType; + return Type::Opaque; } AZ_Assert(false, "AZ::Dom::Value::GetType: m_value has an unexpected type"); - return Type::NullType; + return Type::Null; } bool Value::IsNull() const { - return GetType() == Type::NullType; + return GetType() == Type::Null; } bool Value::IsFalse() const { - return GetType() == Type::FalseType; + return GetType() == Type::False; } bool Value::IsTrue() const { - return GetType() == Type::TrueType; + return GetType() == Type::True; } bool Value::IsBool() const @@ -271,27 +271,27 @@ namespace AZ::Dom bool Value::IsNode() const { - return GetType() == Type::NodeType; + return GetType() == Type::Node; } bool Value::IsObject() const { - return GetType() == Type::ObjectType; + return GetType() == Type::Object; } bool Value::IsArray() const { - return GetType() == Type::ArrayType; + return GetType() == Type::Array; } bool Value::IsOpaqueValue() const { - return GetType() == Type::OpaqueType; + return GetType() == Type::Opaque; } bool Value::IsNumber() const { - return GetType() == Type::NumberType; + return GetType() == Type::Number; } bool Value::IsInt() const @@ -311,7 +311,7 @@ namespace AZ::Dom bool Value::IsString() const { - return GetType() == Type::StringType; + return GetType() == Type::String; } Value& Value::SetObject() @@ -322,13 +322,13 @@ namespace AZ::Dom const Node& Value::GetNodeInternal() const { - AZ_Assert(GetType() == Type::NodeType, "AZ::Dom::Value: attempted to retrieve a node from a non-node value"); + AZ_Assert(GetType() == Type::Node, "AZ::Dom::Value: attempted to retrieve a node from a non-node value"); return *AZStd::get(m_value); } Node& Value::GetNodeInternal() { - AZ_Assert(GetType() == Type::NodeType, "AZ::Dom::Value: attempted to retrieve a node from a non-node value"); + AZ_Assert(GetType() == Type::Node, "AZ::Dom::Value: attempted to retrieve a node from a non-node value"); return *CheckCopyOnWrite(AZStd::get(m_value)); } @@ -336,9 +336,9 @@ namespace AZ::Dom { const Type type = GetType(); AZ_Assert( - type == Type::ObjectType || type == Type::NodeType, + type == Type::Object || type == Type::Node, "AZ::Dom::Value: attempted to retrieve an object from a value that isn't an object or a node"); - if (type == Type::ObjectType) + if (type == Type::Object) { return AZStd::get(m_value)->m_values; } @@ -352,9 +352,9 @@ namespace AZ::Dom { const Type type = GetType(); AZ_Assert( - type == Type::ObjectType || type == Type::NodeType, + type == Type::Object || type == Type::Node, "AZ::Dom::Value: attempted to retrieve an object from a value that isn't an object or a node"); - if (type == Type::ObjectType) + if (type == Type::Object) { return CheckCopyOnWrite(AZStd::get(m_value))->m_values; } @@ -368,9 +368,9 @@ namespace AZ::Dom { const Type type = GetType(); AZ_Assert( - type == Type::ArrayType || type == Type::NodeType, + type == Type::Array || type == Type::Node, "AZ::Dom::Value: attempted to retrieve an array from a value that isn't an array or a node"); - if (type == Type::ArrayType) + if (type == Type::Array) { return AZStd::get(m_value)->m_values; } @@ -384,9 +384,9 @@ namespace AZ::Dom { const Type type = GetType(); AZ_Assert( - type == Type::ArrayType || type == Type::NodeType, + type == Type::Array || type == Type::Node, "AZ::Dom::Value: attempted to retrieve an array from a value that isn't an array or node"); - if (type == Type::ArrayType) + if (type == Type::Array) { return CheckCopyOnWrite(AZStd::get(m_value))->m_values; } @@ -751,13 +751,13 @@ namespace AZ::Dom void Value::SetNodeValue(Value value) { - AZ_Assert(GetType() == Type::NodeType, "AZ::Dom::Value: Attempted to set value for non-node type"); + AZ_Assert(GetType() == Type::Node, "AZ::Dom::Value: Attempted to set value for non-node type"); Array::ContainerType& nodeChildren = GetArrayInternal(); // Set the first non-node child, if one is found for (Value& entry : nodeChildren) { - if (entry.GetType() != Type::NodeType) + if (entry.GetType() != Type::Node) { entry = AZStd::move(value); return; @@ -770,13 +770,13 @@ namespace AZ::Dom Value Value::GetNodeValue() const { - AZ_Assert(GetType() == Type::NodeType, "AZ::Dom::Value: Attempted to get value for non-node type"); + AZ_Assert(GetType() == Type::Node, "AZ::Dom::Value: Attempted to get value for non-node type"); const Array::ContainerType& nodeChildren = GetArrayInternal(); // Get the first non-node child, if one is found for (const Value& entry : nodeChildren) { - if (entry.GetType() != Type::NodeType) + if (entry.GetType() != Type::Node) { return entry; } diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index ac6a9d0c51..274f6b1934 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -26,15 +26,15 @@ namespace AZ::Dom enum class Type { - NullType = 0, - FalseType = 1, - TrueType = 2, - ObjectType = 3, - ArrayType = 4, - StringType = 5, - NumberType = 6, - NodeType = 7, - OpaqueType = 8, + Null = 0, + False = 1, + True = 2, + Object = 3, + Array = 4, + String = 5, + Number = 6, + Node = 7, + Opaque = 8, }; class ValueAllocator final : public SimpleSchemaAllocator diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp index a8cc1f3947..3e48c097c8 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp @@ -87,13 +87,13 @@ namespace AZ::Dom const char* endMethodName; switch (containerType) { - case Type::ObjectType: + case Type::Object: endMethodName = "EndObject"; break; - case Type::ArrayType: + case Type::Array: endMethodName = "EndArray"; break; - case Type::NodeType: + case Type::Node: endMethodName = "EndNode"; break; default: @@ -173,7 +173,7 @@ namespace AZ::Dom Visitor::Result ValueWriter::EndObject(AZ::u64 attributeCount) { - return EndContainer(Type::ObjectType, attributeCount, 0); + return EndContainer(Type::Object, attributeCount, 0); } Visitor::Result ValueWriter::Key(AZ::Name key) @@ -199,7 +199,7 @@ namespace AZ::Dom Visitor::Result ValueWriter::EndArray(AZ::u64 elementCount) { - return EndContainer(Type::ArrayType, 0, elementCount); + return EndContainer(Type::Array, 0, elementCount); } Visitor::Result ValueWriter::StartNode(AZ::Name name) @@ -217,7 +217,7 @@ namespace AZ::Dom Visitor::Result ValueWriter::EndNode(AZ::u64 attributeCount, AZ::u64 elementCount) { - return EndContainer(Type::NodeType, attributeCount, elementCount); + return EndContainer(Type::Node, attributeCount, elementCount); } Visitor::Result ValueWriter::FinishWrite() diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp index 3e02eaff2e..51d2e5c10c 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp @@ -46,7 +46,7 @@ namespace AZ::Dom::Benchmark Value GenerateDomBenchmarkPayload(int64_t entryCount, int64_t stringTemplateLength) { - Value root(Type::ObjectType); + Value root(Type::Object); AZStd::string entryTemplate; while (entryTemplate.size() < static_cast(stringTemplateLength)) @@ -63,18 +63,18 @@ namespace AZ::Dom::Benchmark auto createEntry = [&](int n) -> Value { - Value entry(Type::ObjectType); + Value entry(Type::Object); entry.AddMember("string", createString(n)); entry.AddMember("int", n); entry.AddMember("double", static_cast(n) * 0.5); entry.AddMember("bool", n % 2 == 0); - entry.AddMember("null", Value(Type::NullType)); + entry.AddMember("null", Value(Type::Null)); return entry; }; auto createArray = [&]() -> Value { - Value array(Type::ArrayType); + Value array(Type::Array); for (int i = 0; i < entryCount; ++i) { array.PushBack(createEntry(i)); @@ -176,7 +176,7 @@ namespace AZ::Dom::Benchmark BENCHMARK_DEFINE_F(DomValueBenchmark, LookupMemberByName)(benchmark::State& state) { - Value value(Type::ObjectType); + Value value(Type::Object); AZStd::vector keys; for (int64_t i = 0; i < state.range(0); ++i) { @@ -199,7 +199,7 @@ namespace AZ::Dom::Benchmark BENCHMARK_DEFINE_F(DomValueBenchmark, LookupMemberByString)(benchmark::State& state) { - Value value(Type::ObjectType); + Value value(Type::Object); AZStd::vector keys; for (int64_t i = 0; i < state.range(0); ++i) { diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp index 125f426e02..62f3ad7601 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp @@ -79,7 +79,7 @@ namespace AZ::Dom::Tests m_value.SetArray(); for (int j = 0; j < 5; ++j) { - Value nestedArray(Type::ArrayType); + Value nestedArray(Type::Array); for (int i = 0; i < 5; ++i) { nestedArray.PushBack(Value(i)); @@ -127,7 +127,7 @@ namespace AZ::Dom::Tests m_value.SetObject(); for (int j = 0; j < 3; ++j) { - Value nestedObject(Type::ObjectType); + Value nestedObject(Type::Object); for (int i = 0; i < 5; ++i) { nestedObject.AddMember(AZStd::string::format("Key%i", i), Value(i)); @@ -189,7 +189,7 @@ namespace AZ::Dom::Tests for (int i = 0; i < 5; ++i) { - Value childNode(Type::NodeType); + Value childNode(Type::Node); childNode.SetNodeName(childNodeName); childNode.SetNodeValue(i); @@ -218,9 +218,9 @@ namespace AZ::Dom::Tests m_value["int64_min"] = AZStd::numeric_limits::min(); m_value["int64_max"] = AZStd::numeric_limits::max(); - EXPECT_EQ(m_value["int64_min"].GetType(), Type::NumberType); + EXPECT_EQ(m_value["int64_min"].GetType(), Type::Number); EXPECT_EQ(m_value["int64_min"].GetInt64(), AZStd::numeric_limits::min()); - EXPECT_EQ(m_value["int64_max"].GetType(), Type::NumberType); + EXPECT_EQ(m_value["int64_max"].GetType(), Type::Number); EXPECT_EQ(m_value["int64_max"].GetInt64(), AZStd::numeric_limits::max()); PerformValueChecks(); @@ -232,9 +232,9 @@ namespace AZ::Dom::Tests m_value["uint64_min"] = AZStd::numeric_limits::min(); m_value["uint64_max"] = AZStd::numeric_limits::max(); - EXPECT_EQ(m_value["uint64_min"].GetType(), Type::NumberType); + EXPECT_EQ(m_value["uint64_min"].GetType(), Type::Number); EXPECT_EQ(m_value["uint64_min"].GetInt64(), AZStd::numeric_limits::min()); - EXPECT_EQ(m_value["uint64_max"].GetType(), Type::NumberType); + EXPECT_EQ(m_value["uint64_max"].GetType(), Type::Number); EXPECT_EQ(m_value["uint64_max"].GetInt64(), AZStd::numeric_limits::max()); PerformValueChecks(); @@ -246,9 +246,9 @@ namespace AZ::Dom::Tests m_value["double_min"] = AZStd::numeric_limits::min(); m_value["double_max"] = AZStd::numeric_limits::max(); - EXPECT_EQ(m_value["double_min"].GetType(), Type::NumberType); + EXPECT_EQ(m_value["double_min"].GetType(), Type::Number); EXPECT_EQ(m_value["double_min"].GetDouble(), AZStd::numeric_limits::min()); - EXPECT_EQ(m_value["double_max"].GetType(), Type::NumberType); + EXPECT_EQ(m_value["double_max"].GetType(), Type::Number); EXPECT_EQ(m_value["double_max"].GetDouble(), AZStd::numeric_limits::max()); PerformValueChecks(); @@ -257,9 +257,9 @@ namespace AZ::Dom::Tests TEST_F(DomValueTests, Null) { m_value.SetObject(); - m_value["null_value"] = Value(Type::NullType); + m_value["null_value"] = Value(Type::Null); - EXPECT_EQ(m_value["null_value"].GetType(), Type::NullType); + EXPECT_EQ(m_value["null_value"].GetType(), Type::Null); EXPECT_EQ(m_value["null_type"], Value()); PerformValueChecks(); @@ -271,9 +271,9 @@ namespace AZ::Dom::Tests m_value["true_value"] = true; m_value["false_value"] = false; - EXPECT_EQ(m_value["true_value"].GetType(), Type::TrueType); + EXPECT_EQ(m_value["true_value"].GetType(), Type::True); EXPECT_EQ(m_value["true_value"].GetBool(), true); - EXPECT_EQ(m_value["false_value"].GetType(), Type::FalseType); + EXPECT_EQ(m_value["false_value"].GetType(), Type::False); EXPECT_EQ(m_value["false_value"].GetBool(), false); PerformValueChecks(); @@ -290,12 +290,12 @@ namespace AZ::Dom::Tests AZStd::string stringToCopy = s2; m_value["copy"] = Value(stringToCopy, true); - EXPECT_EQ(m_value["no_copy"].GetType(), Type::StringType); + EXPECT_EQ(m_value["no_copy"].GetType(), Type::String); EXPECT_EQ(m_value["no_copy"].GetString(), s1); stringToReference.at(0) = 'F'; EXPECT_NE(m_value["no_copy"].GetString(), s1); - EXPECT_EQ(m_value["copy"].GetType(), Type::StringType); + EXPECT_EQ(m_value["copy"].GetType(), Type::String); EXPECT_EQ(m_value["copy"].GetString(), s2); stringToCopy.at(0) = 'F'; EXPECT_EQ(m_value["copy"].GetString(), s2); @@ -305,10 +305,10 @@ namespace AZ::Dom::Tests TEST_F(DomValueTests, CopyOnWrite_Object) { - Value v1(Type::ObjectType); + Value v1(Type::Object); v1["foo"] = 5; - Value nestedObject(Type::ObjectType); + Value nestedObject(Type::Object); v1["obj"] = nestedObject; Value v2 = v1; @@ -333,11 +333,11 @@ namespace AZ::Dom::Tests TEST_F(DomValueTests, CopyOnWrite_Array) { - Value v1(Type::ArrayType); + Value v1(Type::Array); v1.PushBack(1); v1.PushBack(2); - Value nestedArray(Type::ArrayType); + Value nestedArray(Type::Array); v1.PushBack(nestedArray); Value v2 = v1; From e080ade885d84fa0bd0852b705dd46670b5e78bf Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Sun, 12 Dec 2021 14:20:16 -0800 Subject: [PATCH 093/948] Switch high perf allocator back on for containers, modest perf boost Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index 274f6b1934..4b09068ec4 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -24,6 +24,7 @@ namespace AZ::Dom { using KeyType = AZ::Name; + //! The type of underlying value stored in a value. \see Value enum class Type { Null = 0, @@ -37,6 +38,9 @@ namespace AZ::Dom Opaque = 8, }; + //! The allocator used by Value. + //! Value heap allocates shared_ptrs for its container storage (Array / Object / Node) alongside the vector + //! contents of its container storage. class ValueAllocator final : public SimpleSchemaAllocator { public: @@ -56,7 +60,7 @@ namespace AZ::Dom class Array { public: - using ContainerType = AZStd::vector; + using ContainerType = AZStd::vector>; using Iterator = ContainerType::iterator; using ConstIterator = ContainerType::const_iterator; static constexpr const size_t ReserveIncrement = 4; @@ -74,7 +78,7 @@ namespace AZ::Dom { public: using EntryType = AZStd::pair; - using ContainerType = AZStd::vector; + using ContainerType = AZStd::vector>; using Iterator = ContainerType::iterator; using ConstIterator = ContainerType::const_iterator; static constexpr const size_t ReserveIncrement = 8; From 5ff65be3145c43215c4a9e635316016919bdcbfa Mon Sep 17 00:00:00 2001 From: nemerle <96597+nemerle@users.noreply.github.com> Date: Sun, 12 Dec 2021 23:48:47 +0100 Subject: [PATCH 094/948] This reduces non-unity build time by ~2% and build size by ~0.5%. This PR is a 'clean' version of #6199 updated to latest development Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> --- Code/Editor/GameEngine.cpp | 1 + .../AtomCore/Instance/InstanceDatabase.h | 5 + .../AzCore/AzCore/Asset/AssetCommon.h | 2 +- .../AzCore/AzCore/Asset/AssetDataStream.cpp | 98 +++-- .../AzCore/AzCore/Asset/AssetDataStream.h | 35 +- .../AzCore/AzCore/Asset/AssetManager.cpp | 1 + .../AzCore/AzCore/Asset/AssetManager.h | 1 - Code/Framework/AzCore/AzCore/IO/IStreamer.h | 6 +- .../AzCore/AzCore/IO/Streamer/BlockCache.cpp | 14 +- .../AzCore/AzCore/IO/Streamer/BlockCache.h | 8 +- .../AzCore/IO/Streamer/DedicatedCache.cpp | 20 +- .../AzCore/IO/Streamer/DedicatedCache.h | 23 +- .../AzCore/AzCore/IO/Streamer/FileRequest.cpp | 143 +++--- .../AzCore/AzCore/IO/Streamer/FileRequest.h | 407 ++++++++++-------- .../IO/Streamer/FullFileDecompressor.cpp | 46 +- .../AzCore/IO/Streamer/FullFileDecompressor.h | 7 +- .../AzCore/IO/Streamer/ReadSplitter.cpp | 10 +- .../AzCore/AzCore/IO/Streamer/Scheduler.cpp | 50 ++- .../AzCore/AzCore/IO/Streamer/Scheduler.h | 19 +- .../AzCore/IO/Streamer/StorageDrive.cpp | 42 +- .../AzCore/AzCore/IO/Streamer/StorageDrive.h | 8 +- .../AzCore/AzCore/IO/Streamer/Streamer.cpp | 7 +- .../AzCore/AzCore/IO/Streamer/Streamer.h | 8 +- .../AzCore/IO/Streamer/StreamerComponent.cpp | 3 +- .../AzCore/IO/Streamer/StreamerContext.cpp | 6 +- .../AzCore/IO/Streamer/StreamerContext.h | 13 +- .../IO/Streamer/StorageDrive_Windows.cpp | 52 +-- .../AzCore/IO/Streamer/StorageDrive_Windows.h | 11 +- .../Tests/Asset/AssetDataStreamTests.cpp | 1 + .../IO/Streamer/StorageDriveTests_Windows.cpp | 26 +- .../AzCore/Tests/Streamer/BlockCacheTests.cpp | 16 +- .../Tests/Streamer/FullDecompressorTests.cpp | 2 +- .../AzCore/Tests/Streamer/IStreamerMock.h | 1 + .../Tests/Streamer/ReadSplitterTests.cpp | 10 +- .../AzCore/Tests/Streamer/SchedulerTests.cpp | 7 +- .../StreamStackEntryConformityTests.h | 1 + Code/Framework/AzCore/Tests/StreamerTests.cpp | 1 + .../Asset/AssetSystemComponent.cpp | 1 + .../AzFramework/IO/RemoteStorageDrive.cpp | 42 +- .../AzFramework/IO/RemoteStorageDrive.h | 11 +- .../Physics/Common/PhysicsSimulatedBody.cpp | 1 + .../Common/PhysicsSimulatedBodyAutomation.cpp | 1 + .../Common/PhysicsSimulatedBodyEvents.cpp | 1 + .../AzFramework/Physics/PhysicsScene.cpp | 1 + .../AzFramework/Physics/PhysicsSystem.cpp | 1 + .../AzFramework/Script/ScriptComponent.cpp | 1 + .../ToolsAssetCatalogComponent.h | 1 + .../Model/AssetCompleterModel.h | 5 +- .../AssetBuilder/AssetBuilderComponent.cpp | 1 + .../Shader/ShaderVariantAsyncLoader.h | 6 +- .../Shader/PrecompiledShaderAssetSourceData.h | 1 + .../RPI/Code/Source/RPI.Public/Culling.cpp | 24 +- .../Shader/Metrics/ShaderMetricsSystem.cpp | 4 +- .../Tests/Common/AssetManagerTestFixture.cpp | 2 + .../Atom/Utils/AssetCollectionAsyncLoader.h | 1 + .../Code/Source/AtomActorInstance.cpp | 2 + .../Code/Rendering/SharedBuffer.cpp | 2 + .../Code/Source/Engine/ATLEntities.cpp | 18 + .../Code/Source/Engine/ATLEntities.h | 14 +- .../Code/Source/Engine/FileCacheManager.cpp | 1 + .../Code/Tests/AudioSystemTest.cpp | 1 + .../Code/Tests/Mocks/FileCacheManagerMock.h | 5 + .../Code/EMotionFX/Source/ActorInstance.cpp | 2 + .../Code/Tests/TestAssetCode/SimpleActors.cpp | 2 + .../Asset/AssetSystemDebugComponent.cpp | 2 + .../Audio/AudioAreaEnvironmentComponent.cpp | 1 + .../ClothComponentMesh/ActorClothColliders.h | 1 + Gems/NvCloth/Code/Source/Utils/AssetHelper.h | 1 + .../Joints/JointsSubComponentModeAngleCone.h | 1 + .../Joints/JointsSubComponentModeSnap.h | 1 + .../Code/Source/ForceRegionComponent.cpp | 2 + .../Code/Source/Joint/PhysXJointUtils.cpp | 14 +- .../PhysX/Code/Source/Joint/PhysXJointUtils.h | 7 + Gems/PhysX/Code/Source/JointComponent.cpp | 11 +- Gems/PhysX/Code/Source/Material.cpp | 3 +- .../PhysXCharacters/API/CharacterUtils.cpp | 11 +- .../PhysXCharacters/API/RagdollNode.cpp | 11 +- .../Pipeline/HeightFieldAssetHandler.cpp | 3 +- .../Code/Source/Pipeline/StreamWrapper.h | 1 + Gems/PhysX/Code/Source/Scene/PhysXScene.cpp | 18 +- Gems/PhysX/Code/Source/System/PhysXSystem.cpp | 16 +- Gems/PhysX/Code/Tests/PhysXTestUtil.cpp | 1 + .../Code/Source/SystemComponent.cpp | 23 +- .../Editor/Assets/ScriptCanvasMemoryAsset.cpp | 7 +- .../Windows/Tools/UpgradeTool/FileSaver.cpp | 2 + .../Code/Source/ScriptEventsSystemComponent.h | 1 + .../WhiteBoxVertexTranslationModifier.h | 1 + 87 files changed, 840 insertions(+), 562 deletions(-) diff --git a/Code/Editor/GameEngine.cpp b/Code/Editor/GameEngine.cpp index db4c587f54..3753b5fa37 100644 --- a/Code/Editor/GameEngine.cpp +++ b/Code/Editor/GameEngine.cpp @@ -18,6 +18,7 @@ // AzCore #include #include +#include #include #include diff --git a/Code/Framework/AtomCore/AtomCore/Instance/InstanceDatabase.h b/Code/Framework/AtomCore/AtomCore/Instance/InstanceDatabase.h index 4b4ad572c2..de98ce97b9 100644 --- a/Code/Framework/AtomCore/AtomCore/Instance/InstanceDatabase.h +++ b/Code/Framework/AtomCore/AtomCore/Instance/InstanceDatabase.h @@ -17,6 +17,11 @@ #include #include +namespace AZStd +{ + class any; +} + namespace AZ { namespace Data diff --git a/Code/Framework/AzCore/AzCore/Asset/AssetCommon.h b/Code/Framework/AzCore/AzCore/Asset/AssetCommon.h index e4d2c7612e..697ca81a49 100644 --- a/Code/Framework/AzCore/AzCore/Asset/AssetCommon.h +++ b/Code/Framework/AzCore/AzCore/Asset/AssetCommon.h @@ -19,7 +19,7 @@ #include #include #include -#include +#include namespace AZ { diff --git a/Code/Framework/AzCore/AzCore/Asset/AssetDataStream.cpp b/Code/Framework/AzCore/AzCore/Asset/AssetDataStream.cpp index 4794b04626..7c9593fe3d 100644 --- a/Code/Framework/AzCore/AzCore/Asset/AssetDataStream.cpp +++ b/Code/Framework/AzCore/AzCore/Asset/AssetDataStream.cpp @@ -7,11 +7,61 @@ */ #include +#include +#include +#include +#include +#include + +#include +#include namespace AZ::Data { + namespace Internal + { + struct AssetDataStreamPrivate + { + //! Optional data buffer that's been directly passed in through Open(), instead of reading data from a file. + AZStd::vector m_preloadedData; + //! The current active streamer read request - tracked in case we need to cancel it prematurely + AZ::IO::FileRequestPtr m_curReadRequest{ nullptr }; + + //! Synchronization for the read request, so that it's possible to block until completion. + AZStd::mutex m_readRequestMutex; + AZStd::condition_variable m_readRequestActive; + + void SetReadRequest(AZ::IO::FileRequestPtr&& req) + { + AZStd::scoped_lock lock(m_readRequestMutex); + // The read request finished, so stop tracking it. + m_curReadRequest = AZStd::move(req); + } + void BlockUntilReadComplete() + { + AZStd::unique_lock lock(m_readRequestMutex); + m_readRequestActive.wait( + lock, + [this] + { + return m_curReadRequest == nullptr; + }); + lock.unlock(); + } + void CancelRequest() + { + AZStd::scoped_lock lock(m_readRequestMutex); + if (m_curReadRequest) + { + auto streamer = Interface::Get(); + m_curReadRequest = streamer->Cancel(m_curReadRequest); + } + } + }; + } // namespace Internal AssetDataStream::AssetDataStream(AZ::IO::IStreamerTypes::RequestMemoryAllocator* bufferAllocator) : m_bufferAllocator(bufferAllocator ? bufferAllocator : &m_defaultAllocator) + , m_privateData(new Internal::AssetDataStreamPrivate) { ClearInternalStateData(); } @@ -22,6 +72,7 @@ namespace AZ::Data { Close(); } + delete m_privateData; } @@ -53,9 +104,9 @@ namespace AZ::Data OpenInternal(data.size(), "(mem buffer)"); // Directly take ownership of the provided buffer - m_preloadedData = AZStd::move(data); - m_buffer = m_preloadedData.data(); - m_loadedSize = m_preloadedData.size(); + m_privateData->m_preloadedData = AZStd::move(data); + m_buffer = m_privateData->m_preloadedData.data(); + m_loadedSize = m_privateData->m_preloadedData.size(); } void AssetDataStream::Open(const AZStd::string& filePath, size_t fileOffset, size_t assetSize, @@ -65,7 +116,7 @@ namespace AZ::Data AZ_PROFILE_FUNCTION(AzCore); AZ_Assert(!m_isOpen, "Attempting to open the stream when it is already open."); - AZ_Assert(!m_curReadRequest, "Queueing an asset stream load while one is still in progress."); + AZ_Assert(!m_privateData->m_curReadRequest, "Queueing an asset stream load while one is still in progress."); AZ_Assert(!filePath.empty(), "AssetDataStream::Open called without a valid file name."); // Initialize the state variables and start tracking the overall load timings @@ -97,11 +148,8 @@ namespace AZ::Data "Buffer for %s was expected to be %zu bytes, but is %zu bytes.", m_filePath.c_str(), m_requestedAssetSize, m_loadedSize); - { - AZStd::scoped_lock lock(m_readRequestMutex); - // The read request finished, so stop tracking it. - m_curReadRequest = nullptr; - } + // The read request finished, so stop tracking it. + m_privateData->SetReadRequest(nullptr); // Call the load callback to start processing the loaded data. if (loadCallback) @@ -115,21 +163,22 @@ namespace AZ::Data } // Notify that the load is complete, in case anyone is using BlockUntilLoadComplete to block. - m_readRequestActive.notify_one(); + m_privateData->m_readRequestActive.notify_one(); }; // Queue the raw file load with the file streamer. auto streamer = AZ::Interface::Get(); - m_curReadRequest = streamer->Read( + m_privateData->m_curReadRequest = + streamer->Read( m_filePath, *m_bufferAllocator, m_requestedAssetSize, deadline, priority, m_fileOffset); m_curDeadline = deadline; m_curPriority = priority; - streamer->SetRequestCompleteCallback(m_curReadRequest, streamerCallback); + streamer->SetRequestCompleteCallback(m_privateData->m_curReadRequest, streamerCallback); - streamer->QueueRequest(m_curReadRequest); + streamer->QueueRequest(m_privateData->m_curReadRequest); } else { @@ -139,19 +188,19 @@ namespace AZ::Data loadCallback(AZ::IO::IStreamerTypes::RequestStatus::Completed); } - m_readRequestActive.notify_one(); + m_privateData->m_readRequestActive.notify_one(); } } void AssetDataStream::Reschedule(AZStd::chrono::milliseconds newDeadline, AZ::IO::IStreamerTypes::Priority newPriority) { - if (m_curReadRequest && (newDeadline < m_curDeadline || newPriority > m_curPriority)) + if (m_privateData->m_curReadRequest && (newDeadline < m_curDeadline || newPriority > m_curPriority)) { auto deadline = AZStd::GetMin(m_curDeadline, newDeadline); auto priority = AZStd::GetMax(m_curPriority, newPriority); auto streamer = Interface::Get(); - m_curReadRequest = streamer->RescheduleRequest(m_curReadRequest, deadline, priority); + m_privateData->m_curReadRequest = streamer->RescheduleRequest(m_privateData->m_curReadRequest, deadline, priority); m_curDeadline = deadline; m_curPriority = priority; } @@ -159,15 +208,13 @@ namespace AZ::Data void AssetDataStream::BlockUntilLoadComplete() { - AZStd::unique_lock lock(m_readRequestMutex); - m_readRequestActive.wait(lock, [this] { return m_curReadRequest == nullptr; }); - lock.unlock(); + m_privateData->BlockUntilReadComplete(); } void AssetDataStream::ClearInternalStateData() { // Clear all our internal state data. - m_preloadedData.resize(0); + m_privateData->m_preloadedData.resize(0); m_buffer = nullptr; m_loadedSize = 0; m_requestedAssetSize = 0; @@ -204,10 +251,10 @@ namespace AZ::Data void AssetDataStream::Close() { AZ_Assert(m_isOpen, "Attempting to close a stream that hasn't been opened."); - AZ_Assert(m_curReadRequest == nullptr, "Attempting to close a stream with a read request in flight."); + AZ_Assert(m_privateData->m_curReadRequest == nullptr, "Attempting to close a stream with a read request in flight."); // Destroy the asset buffer and unlock the allocator, so the allocator itself knows that it is no longer needed. - if (m_buffer != m_preloadedData.data()) + if (m_buffer != m_privateData->m_preloadedData.data()) { m_bufferAllocator->Release(m_buffer); } @@ -221,12 +268,7 @@ namespace AZ::Data void AssetDataStream::RequestCancel() { - AZStd::scoped_lock lock(m_readRequestMutex); - if (m_curReadRequest) - { - auto streamer = Interface::Get(); - m_curReadRequest = streamer->Cancel(m_curReadRequest); - } + m_privateData->CancelRequest(); } void AssetDataStream::Seek(AZ::IO::OffsetType bytes, AZ::IO::GenericStream::SeekMode mode) diff --git a/Code/Framework/AzCore/AzCore/Asset/AssetDataStream.h b/Code/Framework/AzCore/AzCore/Asset/AssetDataStream.h index 79822c8db2..f095e31562 100644 --- a/Code/Framework/AzCore/AzCore/Asset/AssetDataStream.h +++ b/Code/Framework/AzCore/AzCore/Asset/AssetDataStream.h @@ -9,17 +9,26 @@ #include #include -#include -#include -#include -#include -#include +#include + + +namespace AZStd +{ + template + class vector; +} namespace AZ::Data { + namespace Internal + { + struct AssetDataStreamPrivate; + } + class AssetDataStream : public AZ::IO::GenericStream { public: + using VectorDataSource = AZStd::vector; // The default Generic Stream APIs in this class will only allow for a single sequential pass // through the data, no seeking. Reads will block when pages aren't available yet, and // pages will be marked for recycling once reading has progressed beyond them. @@ -29,10 +38,10 @@ namespace AZ::Data ~AssetDataStream() override; // Open the AssetDataStream and make a copy of the provided memory buffer. - void Open(const AZStd::vector& data); + void Open(const VectorDataSource& data); // Open the AssetDataStream and directly take ownership of a pre-populated memory buffer. - void Open(AZStd::vector&& data); + void Open(VectorDataSource&& data); // Open the AssetDataStream and load it via file streaming using OnCompleteCallback = AZStd::function; @@ -91,6 +100,8 @@ namespace AZ::Data void ClearInternalStateData(); + Internal::AssetDataStreamPrivate* m_privateData; + //! The allocator to use for allocating / deallocating asset buffers AZ::IO::IStreamerTypes::RequestMemoryAllocator* m_bufferAllocator{ nullptr }; @@ -106,9 +117,6 @@ namespace AZ::Data //! The amount of data that's expected to be loaded. size_t m_requestedAssetSize{ 0 }; - //! Optional data buffer that's been directly passed in through Open(), instead of reading data from a file. - AZStd::vector m_preloadedData; - //! The buffer that will hold the raw data after it's loaded from the file. void* m_buffer{ nullptr }; @@ -119,19 +127,12 @@ namespace AZ::Data //! The current offset representing how far we've read into the buffer. size_t m_curOffset{ 0 }; - //! The current active streamer read request - tracked in case we need to cancel it prematurely - AZ::IO::FileRequestPtr m_curReadRequest{ nullptr }; - //! The current request deadline. Used to avoid requesting a reschedule to the same (current) deadline. AZStd::chrono::milliseconds m_curDeadline{ AZ::IO::IStreamerTypes::s_noDeadline }; //! The current request priority. Used to avoid requesting a reschedule to the same (current) priority. AZ::IO::IStreamerTypes::Priority m_curPriority{ AZ::IO::IStreamerTypes::s_priorityMedium }; - //! Synchronization for the read request, so that it's possible to block until completion. - AZStd::mutex m_readRequestMutex; - AZStd::condition_variable m_readRequestActive; - //! Track whether or not the stream is currently open bool m_isOpen{ false }; diff --git a/Code/Framework/AzCore/AzCore/Asset/AssetManager.cpp b/Code/Framework/AzCore/AzCore/Asset/AssetManager.cpp index afe3330bd3..b4b1a0d81c 100644 --- a/Code/Framework/AzCore/AzCore/Asset/AssetManager.cpp +++ b/Code/Framework/AzCore/AzCore/Asset/AssetManager.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/Code/Framework/AzCore/AzCore/Asset/AssetManager.h b/Code/Framework/AzCore/AzCore/Asset/AssetManager.h index 9666d434c1..663de2c058 100644 --- a/Code/Framework/AzCore/AzCore/Asset/AssetManager.h +++ b/Code/Framework/AzCore/AzCore/Asset/AssetManager.h @@ -12,7 +12,6 @@ #include #include #include -#include #include #include // used as allocator for most components #include diff --git a/Code/Framework/AzCore/AzCore/IO/IStreamer.h b/Code/Framework/AzCore/AzCore/IO/IStreamer.h index 438384e687..d59ee5007e 100644 --- a/Code/Framework/AzCore/AzCore/IO/IStreamer.h +++ b/Code/Framework/AzCore/AzCore/IO/IStreamer.h @@ -15,14 +15,18 @@ #include #include #include +#include // These Streamer includes need to be moved to Streamer internals/implementation, // and pull out only what we need for visibility at IStreamer.h interface declaration. #include -#include namespace AZ::IO { + class ExternalFileRequest; + class FileRequestHandle; + + using FileRequestPtr = AZStd::intrusive_ptr; /** * Data Streamer Interface */ diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/BlockCache.cpp b/Code/Framework/AzCore/AzCore/IO/Streamer/BlockCache.cpp index 6c873f3050..ca38414eaa 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/BlockCache.cpp +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/BlockCache.cpp @@ -137,18 +137,18 @@ namespace AZ::IO AZStd::visit([this, request](auto&& args) { using Command = AZStd::decay_t; - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { ReadFile(request, args); return; } else { - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { FlushCache(args.m_path); } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { FlushEntireCache(); } @@ -166,7 +166,7 @@ namespace AZ::IO { Section& delayed = m_delayedSections.front(); AZ_Assert(delayed.m_parent, "Delayed section doesn't have a reference to the original request."); - auto data = AZStd::get_if(&delayed.m_parent->GetCommand()); + auto data = AZStd::get_if(&delayed.m_parent->GetCommand()); AZ_Assert(data, "A request in the delayed queue of the BlockCache didn't have a parent with read data."); // This call can add the same section to the back of the queue if there's not // enough space. Because of this the entry needs to be removed from the delayed @@ -233,7 +233,7 @@ namespace AZ::IO } } - void BlockCache::ReadFile(FileRequest* request, FileRequest::ReadData& data) + void BlockCache::ReadFile(FileRequest* request, Requests::ReadData& data) { if (!m_next) { @@ -250,7 +250,7 @@ namespace AZ::IO m_numMetaDataRetrievalInProgress--; if (fileSizeRequest.GetStatus() == IStreamerTypes::RequestStatus::Completed) { - auto& requestInfo = AZStd::get(fileSizeRequest.GetCommand()); + auto& requestInfo = AZStd::get(fileSizeRequest.GetCommand()); if (requestInfo.m_found) { ContinueReadFile(request, requestInfo.m_fileSize); @@ -272,7 +272,7 @@ namespace AZ::IO Section main; Section epilog; - auto& data = AZStd::get(request->GetCommand()); + auto& data = AZStd::get(request->GetCommand()); if (!SplitRequest(prolog, main, epilog, data.m_path, fileLength, data.m_offset, data.m_size, reinterpret_cast(data.m_output))) diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/BlockCache.h b/Code/Framework/AzCore/AzCore/IO/Streamer/BlockCache.h index 90fb7ea193..68aa2da689 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/BlockCache.h +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/BlockCache.h @@ -21,6 +21,12 @@ namespace AZ::IO { + class RequestPath; + namespace Requests + { + struct ReadData; + } + struct BlockCacheConfig final : public IStreamerStackConfig { @@ -109,7 +115,7 @@ namespace AZ::IO using TimePoint = AZStd::chrono::system_clock::time_point; - void ReadFile(FileRequest* request, FileRequest::ReadData& data); + void ReadFile(FileRequest* request, Requests::ReadData& data); void ContinueReadFile(FileRequest* request, u64 fileLength); CacheResult ReadFromCache(FileRequest* request, Section& section, const RequestPath& filePath); CacheResult ReadFromCache(FileRequest* request, Section& section, u32 cacheBlock); diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/DedicatedCache.cpp b/Code/Framework/AzCore/AzCore/IO/Streamer/DedicatedCache.cpp index b80a1ea724..f155d26eef 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/DedicatedCache.cpp +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/DedicatedCache.cpp @@ -101,12 +101,12 @@ namespace AZ::IO AZStd::visit([this, request](auto&& args) { using Command = AZStd::decay_t; - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { args.m_range = FileRange::CreateRangeForEntireFile(); m_context->PushPreparedRequest(request); } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { args.m_range = FileRange::CreateRangeForEntireFile(); m_context->PushPreparedRequest(request); @@ -125,28 +125,28 @@ namespace AZ::IO AZStd::visit([this, request](auto&& args) { using Command = AZStd::decay_t; - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { ReadFile(request, args); return; } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { CreateDedicatedCache(request, args); return; } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { DestroyDedicatedCache(request, args); return; } else { - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { FlushCache(args.m_path); } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { FlushEntireCache(); } @@ -200,7 +200,7 @@ namespace AZ::IO } } - void DedicatedCache::ReadFile(FileRequest* request, FileRequest::ReadData& data) + void DedicatedCache::ReadFile(FileRequest* request, Requests::ReadData& data) { size_t index = FindCache(data.m_path, data.m_offset); if (index == s_fileNotFound) @@ -255,7 +255,7 @@ namespace AZ::IO StreamStackEntry::CollectStatistics(statistics); } - void DedicatedCache::CreateDedicatedCache(FileRequest* request, FileRequest::CreateDedicatedCacheData& data) + void DedicatedCache::CreateDedicatedCache(FileRequest* request, Requests::CreateDedicatedCacheData& data) { size_t index = FindCache(data.m_path, data.m_range); if (index == s_fileNotFound) @@ -276,7 +276,7 @@ namespace AZ::IO m_context->MarkRequestAsCompleted(request); } - void DedicatedCache::DestroyDedicatedCache(FileRequest* request, FileRequest::DestroyDedicatedCacheData& data) + void DedicatedCache::DestroyDedicatedCache(FileRequest* request, Requests::DestroyDedicatedCacheData& data) { size_t index = FindCache(data.m_path, data.m_range); if (index != s_fileNotFound) diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/DedicatedCache.h b/Code/Framework/AzCore/AzCore/IO/Streamer/DedicatedCache.h index 0ef2d879d3..a69dcdbd7f 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/DedicatedCache.h +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/DedicatedCache.h @@ -11,15 +11,21 @@ #include #include #include -#include #include +#include #include -#include #include +#include #include namespace AZ::IO { + namespace Requests + { + struct CreateDedicatedCacheData; + struct DestroyDedicatedCacheData; + } // namespace Requests + struct DedicatedCacheConfig final : public IStreamerStackConfig { @@ -56,16 +62,19 @@ namespace AZ::IO void UpdateStatus(Status& status) const override; - void UpdateCompletionEstimates(AZStd::chrono::system_clock::time_point now, AZStd::vector& internalPending, - StreamerContext::PreparedQueue::iterator pendingBegin, StreamerContext::PreparedQueue::iterator pendingEnd) override; + void UpdateCompletionEstimates( + AZStd::chrono::system_clock::time_point now, + AZStd::vector& internalPending, + StreamerContext::PreparedQueue::iterator pendingBegin, + StreamerContext::PreparedQueue::iterator pendingEnd) override; void CollectStatistics(AZStd::vector& statistics) const override; private: - void CreateDedicatedCache(FileRequest* request, FileRequest::CreateDedicatedCacheData& data); - void DestroyDedicatedCache(FileRequest* request, FileRequest::DestroyDedicatedCacheData& data); + void CreateDedicatedCache(FileRequest* request, Requests::CreateDedicatedCacheData& data); + void DestroyDedicatedCache(FileRequest* request, Requests::DestroyDedicatedCacheData& data); - void ReadFile(FileRequest* request, FileRequest::ReadData& data); + void ReadFile(FileRequest* request, AZ::IO::Requests::ReadData& data); size_t FindCache(const RequestPath& filename, FileRange range); size_t FindCache(const RequestPath& filename, u64 offset); diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/FileRequest.cpp b/Code/Framework/AzCore/AzCore/IO/Streamer/FileRequest.cpp index fc05b77b36..2f96d224e6 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/FileRequest.cpp +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/FileRequest.cpp @@ -12,22 +12,30 @@ #include #include -namespace AZ::IO -{ - // - // Command structures. - // +// +// Command structures. +// - FileRequest::ExternalRequestData::ExternalRequestData(FileRequestPtr&& request) - : m_request(AZStd::move(request)) - {} - - FileRequest::RequestPathStoreData::RequestPathStoreData(RequestPath path) - : m_path(AZStd::move(path)) - {} +namespace AZ::IO::Requests +{ + ReadData::ReadData(void* output, u64 outputSize, const RequestPath& path, u64 offset, u64 size, bool sharedRead) + : m_path(path) + , m_output(output) + , m_outputSize(outputSize) + , m_offset(offset) + , m_size(size) + , m_sharedRead(sharedRead) + { + } - FileRequest::ReadRequestData::ReadRequestData(RequestPath path, void* output, u64 outputSize, u64 offset, u64 size, - AZStd::chrono::system_clock::time_point deadline, IStreamerTypes::Priority priority) + ReadRequestData::ReadRequestData( + RequestPath path, + void* output, + u64 outputSize, + u64 offset, + u64 size, + AZStd::chrono::system_clock::time_point deadline, + IStreamerTypes::Priority priority) : m_path(AZStd::move(path)) , m_allocator(nullptr) , m_deadline(deadline) @@ -37,10 +45,16 @@ namespace AZ::IO , m_size(size) , m_priority(priority) , m_memoryType(IStreamerTypes::MemoryType::ReadWrite) // Only generic memory can be assigned externally. - {} + { + } - FileRequest::ReadRequestData::ReadRequestData(RequestPath path, IStreamerTypes::RequestMemoryAllocator* allocator, - u64 offset, u64 size, AZStd::chrono::system_clock::time_point deadline, IStreamerTypes::Priority priority) + ReadRequestData::ReadRequestData( + RequestPath path, + IStreamerTypes::RequestMemoryAllocator* allocator, + u64 offset, + u64 size, + AZStd::chrono::system_clock::time_point deadline, + IStreamerTypes::Priority priority) : m_path(AZStd::move(path)) , m_allocator(allocator) , m_deadline(deadline) @@ -50,9 +64,10 @@ namespace AZ::IO , m_size(size) , m_priority(priority) , m_memoryType(IStreamerTypes::MemoryType::ReadWrite) // Only generic memory can be assigned externally. - {} + { + } - FileRequest::ReadRequestData::~ReadRequestData() + ReadRequestData::~ReadRequestData() { if (m_allocator != nullptr) { @@ -64,65 +79,81 @@ namespace AZ::IO } } - FileRequest::ReadData::ReadData(void* output, u64 outputSize, const RequestPath& path, u64 offset, u64 size, bool sharedRead) - : m_output(output) - , m_outputSize(outputSize) - , m_path(path) - , m_offset(offset) - , m_size(size) - , m_sharedRead(sharedRead) - {} + CreateDedicatedCacheData::CreateDedicatedCacheData(RequestPath path, const FileRange& range) + : m_path(AZStd::move(path)) + , m_range(range) + { + } + + DestroyDedicatedCacheData::DestroyDedicatedCacheData(RequestPath path, const FileRange& range) + : m_path(AZStd::move(path)) + , m_range(range) + { + } - FileRequest::CompressedReadData::CompressedReadData(CompressionInfo&& compressionInfo, void* output, u64 readOffset, u64 readSize) + ExternalRequestData::ExternalRequestData(FileRequestPtr&& request) + : m_request(AZStd::move(request)) + { + } + + RequestPathStoreData::RequestPathStoreData(RequestPath path) + : m_path(AZStd::move(path)) + { + } + + CompressedReadData::CompressedReadData(CompressionInfo&& compressionInfo, void* output, u64 readOffset, u64 readSize) : m_compressionInfo(AZStd::move(compressionInfo)) , m_output(output) , m_readOffset(readOffset) , m_readSize(readSize) - {} + { + } - FileRequest::FileExistsCheckData::FileExistsCheckData(const RequestPath& path) + FileExistsCheckData::FileExistsCheckData(const RequestPath& path) : m_path(path) - {} + { + } - FileRequest::FileMetaDataRetrievalData::FileMetaDataRetrievalData(const RequestPath& path) + FileMetaDataRetrievalData::FileMetaDataRetrievalData(const RequestPath& path) : m_path(path) - {} + { + } - FileRequest::CancelData::CancelData(FileRequestPtr target) + CancelData::CancelData(FileRequestPtr target) : m_target(AZStd::move(target)) - {} + { + } - FileRequest::FlushData::FlushData(RequestPath path) + FlushData::FlushData(RequestPath path) : m_path(AZStd::move(path)) - {} + { + } - FileRequest::RescheduleData::RescheduleData(FileRequestPtr target, AZStd::chrono::system_clock::time_point newDeadline, + RescheduleData::RescheduleData( + FileRequestPtr target, + AZStd::chrono::system_clock::time_point newDeadline, IStreamerTypes::Priority newPriority) : m_target(AZStd::move(target)) , m_newDeadline(newDeadline) , m_newPriority(newPriority) - {} - - FileRequest::CreateDedicatedCacheData::CreateDedicatedCacheData(RequestPath path, const FileRange& range) - : m_path(AZStd::move(path)) - , m_range(range) - {} - - FileRequest::DestroyDedicatedCacheData::DestroyDedicatedCacheData(RequestPath path, const FileRange& range) - : m_path(AZStd::move(path)) - , m_range(range) - {} + { + } - FileRequest::ReportData::ReportData(ReportType reportType) + Requests::ReportData::ReportData(ReportType reportType) : m_reportType(reportType) - {} + { + } - FileRequest::CustomData::CustomData(AZStd::any data, bool failWhenUnhandled) + CustomData::CustomData(AZStd::any data, bool failWhenUnhandled) : m_data(AZStd::move(data)) , m_failWhenUnhandled(failWhenUnhandled) - {} - + { + } +} // namespace AZ::IO::Requests +namespace AZ::IO +{ + using namespace Requests; // // FileRequest // @@ -263,7 +294,7 @@ namespace AZ::IO SetOptionalParent(parent); } - void FileRequest::CreateReport(ReportData::ReportType reportType) + void FileRequest::CreateReport(Requests::ReportType reportType) { AZ_Assert(AZStd::holds_alternative(m_command), "Attempting to set FileRequest to 'Report', but another task was already assigned."); @@ -361,7 +392,7 @@ namespace AZ::IO "Request does not contain a valid command. It may have been reset already or was never assigned a command."); return true; } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { return args.m_failWhenUnhandled; } diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/FileRequest.h b/Code/Framework/AzCore/AzCore/IO/Streamer/FileRequest.h index dd4dad2387..7f5874c95d 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/FileRequest.h +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/FileRequest.h @@ -27,227 +27,261 @@ namespace AZ::IO class ExternalFileRequest; using FileRequestPtr = AZStd::intrusive_ptr; +} // namespace AZ::IO - class FileRequest final +namespace AZ::IO::Requests +{ + //! Request to read data. This is a translated request and holds an absolute path and has been + //! resolved to the archive file if needed. + struct ReadData { - public: - inline constexpr static AZStd::chrono::system_clock::time_point s_noDeadlineTime = AZStd::chrono::system_clock::time_point::max(); + inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium; + inline constexpr static bool s_failWhenUnhandled = true; - friend class StreamerContext; - friend class ExternalFileRequest; + ReadData(void* output, u64 outputSize, const RequestPath& path, u64 offset, u64 size, bool sharedRead); - //! Stores a reference to the external request so it stays alive while the request is being processed. - //! This is needed because Streamer supports fire-and-forget requests since completion can be handled by - //! registering a callback. - struct ExternalRequestData - { - inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium; - inline constexpr static bool s_failWhenUnhandled = true; + const RequestPath& m_path; //!< The path to the file that contains the requested data. + void* m_output; //!< Target output to write the read data to. + u64 m_outputSize; //!< Size of memory m_output points to. This needs to be at least as big as m_size, but can be bigger. + u64 m_offset; //!< The offset in bytes into the file. + u64 m_size; //!< The number of bytes to read from the file. + bool m_sharedRead; //!< True if other code will be reading from the file or the stack entry can exclusively lock. + }; - explicit ExternalRequestData(FileRequestPtr&& request); + //! Request to read data. This is an untranslated request and holds a relative path. The Scheduler + //! will translate this to the appropriate ReadData or CompressedReadData. + struct ReadRequestData + { + inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium; + inline constexpr static bool s_failWhenUnhandled = true; + + ReadRequestData( + RequestPath path, + void* output, + u64 outputSize, + u64 offset, + u64 size, + AZStd::chrono::system_clock::time_point deadline, + IStreamerTypes::Priority priority); + ReadRequestData( + RequestPath path, + IStreamerTypes::RequestMemoryAllocator* allocator, + u64 offset, + u64 size, + AZStd::chrono::system_clock::time_point deadline, + IStreamerTypes::Priority priority); + ~ReadRequestData(); + + RequestPath m_path; //!< Relative path to the target file. + IStreamerTypes::RequestMemoryAllocator* m_allocator; //!< Allocator used to manage the memory for this request. + AZStd::chrono::system_clock::time_point m_deadline; //!< Time by which this request should have been completed. + void* m_output; //!< The memory address assigned (during processing) to store the read data to. + u64 m_outputSize; //!< The memory size of the addressed used to store the read data. + u64 m_offset; //!< The offset in bytes into the file. + u64 m_size; //!< The number of bytes to read from the file. + IStreamerTypes::Priority m_priority; //!< Priority used for ordering requests. This is used when requests have the same deadline. + IStreamerTypes::MemoryType m_memoryType; //!< The type of memory provided by the allocator if used. + }; - FileRequestPtr m_request; //!< The request that was send to Streamer. - }; + //! Creates a cache dedicated to a single file. This is best used for files where blocks are read from + //! periodically such as audio banks of video files. + struct CreateDedicatedCacheData + { + inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh; + inline constexpr static bool s_failWhenUnhandled = false; - //! Stores an instance of a RequestPath. To reduce copying instances of a RequestPath functions that - //! need a path take them by reference to the original request. In some cases a path originates from - //! within in the stack and temporary storage is needed. This struct allows for that temporary storage - //! so it can be safely referenced later. - struct RequestPathStoreData - { - inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium; - inline constexpr static bool s_failWhenUnhandled = true; + CreateDedicatedCacheData(RequestPath path, const FileRange& range); - explicit RequestPathStoreData(RequestPath path); + RequestPath m_path; + FileRange m_range; + }; - RequestPath m_path; - }; + //! Destroys a cache dedicated to a single file that was previously created by CreateDedicatedCache + struct DestroyDedicatedCacheData + { + inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh; + inline constexpr static bool s_failWhenUnhandled = false; - //! Request to read data. This is an untranslated request and holds a relative path. The Scheduler - //! will translate this to the appropriate ReadData or CompressedReadData. - struct ReadRequestData - { - inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium; - inline constexpr static bool s_failWhenUnhandled = true; - - ReadRequestData(RequestPath path, void* output, u64 outputSize, u64 offset, u64 size, - AZStd::chrono::system_clock::time_point deadline, IStreamerTypes::Priority priority); - ReadRequestData(RequestPath path, IStreamerTypes::RequestMemoryAllocator* allocator, u64 offset, u64 size, - AZStd::chrono::system_clock::time_point deadline, IStreamerTypes::Priority priority); - ~ReadRequestData(); - - RequestPath m_path; //!< Relative path to the target file. - IStreamerTypes::RequestMemoryAllocator* m_allocator; //!< Allocator used to manage the memory for this request. - AZStd::chrono::system_clock::time_point m_deadline; //!< Time by which this request should have been completed. - void* m_output; //!< The memory address assigned (during processing) to store the read data to. - u64 m_outputSize; //!< The memory size of the addressed used to store the read data. - u64 m_offset; //!< The offset in bytes into the file. - u64 m_size; //!< The number of bytes to read from the file. - IStreamerTypes::Priority m_priority; //!< Priority used for ordering requests. This is used when requests have the same deadline. - IStreamerTypes::MemoryType m_memoryType; //!< The type of memory provided by the allocator if used. - }; + DestroyDedicatedCacheData(RequestPath path, const FileRange& range); - //! Request to read data. This is a translated request and holds an absolute path and has been - //! resolved to the archive file if needed. - struct ReadData - { - inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium; - inline constexpr static bool s_failWhenUnhandled = true; + RequestPath m_path; + FileRange m_range; + }; - ReadData(void* output, u64 outputSize, const RequestPath& path, u64 offset, u64 size, bool sharedRead); + enum class ReportType : int8_t + { + FileLocks + }; - const RequestPath& m_path; //!< The path to the file that contains the requested data. - void* m_output; //!< Target output to write the read data to. - u64 m_outputSize; //!< Size of memory m_output points to. This needs to be at least as big as m_size, but can be bigger. - u64 m_offset; //!< The offset in bytes into the file. - u64 m_size; //!< The number of bytes to read from the file. - bool m_sharedRead; //!< True if other code will be reading from the file or the stack entry can exclusively lock. - }; + struct ReportData + { + inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityLow; + inline constexpr static bool s_failWhenUnhandled = false; - //! Request to read and decompress data. - struct CompressedReadData - { - inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium; - inline constexpr static bool s_failWhenUnhandled = true; + explicit ReportData(ReportType reportType); - CompressedReadData(CompressionInfo&& compressionInfo, void* output, u64 readOffset, u64 readSize); + ReportType m_reportType; + }; - CompressionInfo m_compressionInfo; - void* m_output; //!< Target output to write the read data to. - u64 m_readOffset; //!< The offset into the decompressed to start copying from. - u64 m_readSize; //!< Number of bytes to read from the decompressed file. - }; + //! Stores a reference to the external request so it stays alive while the request is being processed. + //! This is needed because Streamer supports fire-and-forget requests since completion can be handled by + //! registering a callback. + struct ExternalRequestData + { + inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium; + inline constexpr static bool s_failWhenUnhandled = true; - //! Holds the progress of an operation chain until this request is explicitly completed. - struct WaitData - { - inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium; - inline constexpr static bool s_failWhenUnhandled = true; - }; + explicit ExternalRequestData(FileRequestPtr&& request); - //! Checks to see if any node in the stack can find a file at the provided path. - struct FileExistsCheckData - { - inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh; - inline constexpr static bool s_failWhenUnhandled = false; + FileRequestPtr m_request; //!< The request that was send to Streamer. + }; - explicit FileExistsCheckData(const RequestPath& path); + //! Stores an instance of a RequestPath. To reduce copying instances of a RequestPath functions that + //! need a path take them by reference to the original request. In some cases a path originates from + //! within in the stack and temporary storage is needed. This struct allows for that temporary storage + //! so it can be safely referenced later. + struct RequestPathStoreData + { + inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium; + inline constexpr static bool s_failWhenUnhandled = true; - const RequestPath& m_path; - bool m_found{ false }; - }; + explicit RequestPathStoreData(RequestPath path); - //! Searches for a file in the stack and retrieves the meta data. This may be slower than a file exists - //! check. - struct FileMetaDataRetrievalData - { - inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh; - inline constexpr static bool s_failWhenUnhandled = false; + RequestPath m_path; + }; - explicit FileMetaDataRetrievalData(const RequestPath& path); + //! Request to read and decompress data. + struct CompressedReadData + { + inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium; + inline constexpr static bool s_failWhenUnhandled = true; - const RequestPath& m_path; - u64 m_fileSize{ 0 }; - bool m_found{ false }; - }; + CompressedReadData(CompressionInfo&& compressionInfo, void* output, u64 readOffset, u64 readSize); - //! Cancels a request in the stream stack, if possible. - struct CancelData - { - inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHighest; - inline constexpr static bool s_failWhenUnhandled = false; + CompressionInfo m_compressionInfo; + void* m_output; //!< Target output to write the read data to. + u64 m_readOffset; //!< The offset into the decompressed to start copying from. + u64 m_readSize; //!< Number of bytes to read from the decompressed file. + }; - explicit CancelData(FileRequestPtr target); + //! Holds the progress of an operation chain until this request is explicitly completed. + struct WaitData + { + inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium; + inline constexpr static bool s_failWhenUnhandled = true; + }; - FileRequestPtr m_target; //!< The request that will be canceled. - }; + //! Checks to see if any node in the stack can find a file at the provided path. + struct FileExistsCheckData + { + inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh; + inline constexpr static bool s_failWhenUnhandled = false; - //! Updates the priority and deadline of a request that has not been queued yet. - struct RescheduleData - { - inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh; - inline constexpr static bool s_failWhenUnhandled = false; + explicit FileExistsCheckData(const RequestPath& path); - RescheduleData(FileRequestPtr target, AZStd::chrono::system_clock::time_point newDeadline, IStreamerTypes::Priority newPriority); + const RequestPath& m_path; + bool m_found{ false }; + }; - FileRequestPtr m_target; //!< The request that will be rescheduled. - AZStd::chrono::system_clock::time_point m_newDeadline; //!< The new deadline for the request. - IStreamerTypes::Priority m_newPriority; //!< The new priority for the request. - }; + //! Searches for a file in the stack and retrieves the meta data. This may be slower than a file exists + //! check. + struct FileMetaDataRetrievalData + { + inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh; + inline constexpr static bool s_failWhenUnhandled = false; - //! Flushes all references to the provided file in the streaming stack. - struct FlushData - { - inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh; - inline constexpr static bool s_failWhenUnhandled = false; + explicit FileMetaDataRetrievalData(const RequestPath& path); - explicit FlushData(RequestPath path); + const RequestPath& m_path; + u64 m_fileSize{ 0 }; + bool m_found{ false }; + }; - RequestPath m_path; - }; + //! Cancels a request in the stream stack, if possible. + struct CancelData + { + inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHighest; + inline constexpr static bool s_failWhenUnhandled = false; - //! Flushes all caches in the streaming stack. - struct FlushAllData - { - inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh; - inline constexpr static bool s_failWhenUnhandled = false; - }; + explicit CancelData(FileRequestPtr target); - //! Creates a cache dedicated to a single file. This is best used for files where blocks are read from - //! periodically such as audio banks of video files. - struct CreateDedicatedCacheData - { - inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh; - inline constexpr static bool s_failWhenUnhandled = false; + FileRequestPtr m_target; //!< The request that will be canceled. + }; - CreateDedicatedCacheData(RequestPath path, const FileRange& range); + //! Updates the priority and deadline of a request that has not been queued yet. + struct RescheduleData + { + inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh; + inline constexpr static bool s_failWhenUnhandled = false; - RequestPath m_path; - FileRange m_range; - }; + RescheduleData(FileRequestPtr target, AZStd::chrono::system_clock::time_point newDeadline, IStreamerTypes::Priority newPriority); - //! Destroys a cache dedicated to a single file that was previously created by CreateDedicatedCache - struct DestroyDedicatedCacheData - { - inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh; - inline constexpr static bool s_failWhenUnhandled = false; + FileRequestPtr m_target; //!< The request that will be rescheduled. + AZStd::chrono::system_clock::time_point m_newDeadline; //!< The new deadline for the request. + IStreamerTypes::Priority m_newPriority; //!< The new priority for the request. + }; - DestroyDedicatedCacheData(RequestPath path, const FileRange& range); + //! Flushes all references to the provided file in the streaming stack. + struct FlushData + { + inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh; + inline constexpr static bool s_failWhenUnhandled = false; - RequestPath m_path; - FileRange m_range; - }; + explicit FlushData(RequestPath path); - struct ReportData - { - inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityLow; - inline constexpr static bool s_failWhenUnhandled = false; + RequestPath m_path; + }; - enum class ReportType - { - FileLocks - }; + //! Flushes all caches in the streaming stack. + struct FlushAllData + { + inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh; + inline constexpr static bool s_failWhenUnhandled = false; + }; - explicit ReportData(ReportType reportType); + //! Data for a custom command. This can be used by nodes added extensions that need data that can't be stored + //! in the already provided data. + struct CustomData + { + inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium; - ReportType m_reportType; - }; + CustomData(AZStd::any data, bool failWhenUnhandled); - //! Data for a custom command. This can be used by nodes added extensions that need data that can't be stored - //! in the already provided data. - struct CustomData - { - inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium; + AZStd::any m_data; //!< The data for the custom request. + bool m_failWhenUnhandled; //!< Whether or not the request is marked as failed or success when no node process it. + }; + using CommandVariant = AZStd::variant< + AZStd::monostate, + ExternalRequestData, + RequestPathStoreData, + ReadRequestData, + ReadData, + CompressedReadData, + WaitData, + FileExistsCheckData, + FileMetaDataRetrievalData, + CancelData, + RescheduleData, + FlushData, + FlushAllData, + CreateDedicatedCacheData, + DestroyDedicatedCacheData, + ReportData, + CustomData>; + +} // namespace AZ::IO::Requests - CustomData(AZStd::any data, bool failWhenUnhandled); +namespace AZ::IO +{ + class FileRequest final + { + public: + inline constexpr static AZStd::chrono::system_clock::time_point s_noDeadlineTime = AZStd::chrono::system_clock::time_point::max(); - AZStd::any m_data; //!< The data for the custom request. - bool m_failWhenUnhandled; //!< Whether or not the request is marked as failed or success when no node process it. - }; + friend class StreamerContext; + friend class ExternalFileRequest; - using CommandVariant = AZStd::variant; + using CommandVariant = Requests::CommandVariant; using OnCompletionCallback = AZStd::function; AZ_CLASS_ALLOCATOR(FileRequest, SystemAllocator, 0); @@ -278,7 +312,7 @@ namespace AZ::IO void CreateFlushAll(); void CreateDedicatedCacheCreation(RequestPath path, const FileRange& range = {}, FileRequest* parent = nullptr); void CreateDedicatedCacheDestruction(RequestPath path, const FileRange& range = {}, FileRequest* parent = nullptr); - void CreateReport(ReportData::ReportType reportType); + void CreateReport(Requests::ReportType reportType); void CreateCustom(AZStd::any data, bool failWhenUnhandled = true, FileRequest* parent = nullptr); void SetCompletionCallback(OnCompletionCallback callback); @@ -325,17 +359,6 @@ namespace AZ::IO //! Command and parameters for the request. CommandVariant m_command; - //! Status of the request. - AZStd::atomic m_status{ IStreamerTypes::RequestStatus::Pending }; - - //! Called once the request has completed. This will always be called from the Streamer thread - //! and thread safety is the responsibility of called function. When assigning a lambda avoid - //! capturing a FileRequestPtr by value as this will cause a circular reference which causes - //! the FileRequestPtr to never be released and causes a memory leak. This call will - //! block the main Streamer thread until it returns so callbacks should be kept short. If - //! a longer running task is needed consider using a job to do the work. - OnCompletionCallback m_onCompletion; - //! Estimated time this request will complete. This is an estimation and depends on many //! factors which can cause it to change drastically from moment to moment. AZStd::chrono::system_clock::time_point m_estimatedCompletion; @@ -344,9 +367,21 @@ namespace AZ::IO //! other request depending on this one to complete. FileRequest* m_parent{ nullptr }; + //! Id assigned when the request is added to the pending queue. size_t m_pendingId{ 0 }; + //! Called once the request has completed. This will always be called from the Streamer thread + //! and thread safety is the responsibility of called function. When assigning a lambda avoid + //! capturing a FileRequestPtr by value as this will cause a circular reference which causes + //! the FileRequestPtr to never be released and causes a memory leak. This call will + //! block the main Streamer thread until it returns so callbacks should be kept short. If + //! a longer running task is needed consider using a job to do the work. + OnCompletionCallback m_onCompletion; + + //! Status of the request. + AZStd::atomic m_status{ IStreamerTypes::RequestStatus::Pending }; + //! The number of dependent file request that need to complete before this one is done. u16 m_dependencies{ 0 }; diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/FullFileDecompressor.cpp b/Code/Framework/AzCore/AzCore/IO/Streamer/FullFileDecompressor.cpp index 723a5d62c8..ac9344dd28 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/FullFileDecompressor.cpp +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/FullFileDecompressor.cpp @@ -91,12 +91,12 @@ namespace AZ::IO AZStd::visit([this, request](auto&& args) { using Command = AZStd::decay_t; - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { PrepareReadRequest(request, args); } - else if constexpr (AZStd::is_same_v || - AZStd::is_same_v) + else if constexpr (AZStd::is_same_v || + AZStd::is_same_v) { PrepareDedicatedCache(request, args.m_path); } @@ -114,11 +114,11 @@ namespace AZ::IO AZStd::visit([this, request](auto&& args) { using Command = AZStd::decay_t; - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { m_pendingReads.push_back(request); } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { m_pendingFileExistChecks.push_back(request); } @@ -203,7 +203,7 @@ namespace AZ::IO { FileRequest* compressedRequest = m_processingJobs[i].m_waitRequest->GetParent(); AZ_Assert(compressedRequest, "A wait request attached to FullFileDecompressor was completed but didn't have a parent compressed request."); - auto data = AZStd::get_if(&compressedRequest->GetCommand()); + auto data = AZStd::get_if(&compressedRequest->GetCommand()); AZ_Assert(data, "Compressed request in the decompression queue in FullFileDecompressor didn't contain compression read data."); size_t bytesToDecompress = data->m_compressionInfo.m_compressedSize; @@ -255,7 +255,7 @@ namespace AZ::IO // Calculate the amount of time it will take to decompress the data. FileRequest* compressedRequest = m_readRequests[i]->GetParent(); - auto data = AZStd::get_if(&compressedRequest->GetCommand()); + auto data = AZStd::get_if(&compressedRequest->GetCommand()); size_t bytesToDecompress = data->m_compressionInfo.m_compressedSize; auto decompressionDuration = AZStd::chrono::microseconds( @@ -290,7 +290,7 @@ namespace AZ::IO void FullFileDecompressor::EstimateCompressedReadRequest(FileRequest* request, AZStd::chrono::microseconds& cumulativeDelay, AZStd::chrono::microseconds decompressionDelay, double totalDecompressionDurationUs, double totalBytesDecompressed) const { - auto data = AZStd::get_if(&request->GetCommand()); + auto data = AZStd::get_if(&request->GetCommand()); if (data) { AZStd::chrono::microseconds processingTime = decompressionDelay; @@ -343,7 +343,7 @@ namespace AZ::IO m_numRunningJobs == 0; } - void FullFileDecompressor::PrepareReadRequest(FileRequest* request, FileRequest::ReadRequestData& data) + void FullFileDecompressor::PrepareReadRequest(FileRequest* request, Requests::ReadRequestData &data) { CompressionInfo info; if (CompressionUtils::FindCompressionInfo(info, data.m_path.GetRelativePath())) @@ -359,7 +359,7 @@ namespace AZ::IO { FileRequest* pathStorageRequest = m_context->GetNewInternalRequest(); pathStorageRequest->CreateRequestPathStore(request, AZStd::move(info.m_archiveFilename)); - auto& pathStorage = AZStd::get(pathStorageRequest->GetCommand()); + auto& pathStorage = AZStd::get(pathStorageRequest->GetCommand()); nextRequest->CreateRead(pathStorageRequest, data.m_output, data.m_outputSize, pathStorage.m_path, info.m_offset + data.m_offset, data.m_size, info.m_isSharedPak); @@ -370,13 +370,13 @@ namespace AZ::IO auto callback = [this, nextRequest](const FileRequest& checkRequest) { AZ_PROFILE_FUNCTION(AzCore); - auto check = AZStd::get_if(&checkRequest.GetCommand()); + auto check = AZStd::get_if(&checkRequest.GetCommand()); AZ_Assert(check, "Callback in FullFileDecompressor::PrepareReadRequest expected FileExistsCheck but got another command."); if (check->m_found) { FileRequest* originalRequest = m_context->RejectRequest(nextRequest); - if (AZStd::holds_alternative(originalRequest->GetCommand())) + if (AZStd::holds_alternative(originalRequest->GetCommand())) { originalRequest = m_context->RejectRequest(originalRequest); } @@ -412,12 +412,12 @@ namespace AZ::IO AZStd::visit([request, &info, nextRequest](auto&& args) { using Command = AZStd::decay_t; - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { nextRequest->CreateDedicatedCacheCreation(AZStd::move(info.m_archiveFilename), FileRange::CreateRange(info.m_offset, info.m_compressedSize), request); } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { nextRequest->CreateDedicatedCacheDestruction(AZStd::move(info.m_archiveFilename), FileRange::CreateRange(info.m_offset, info.m_compressedSize), request); @@ -429,7 +429,7 @@ namespace AZ::IO auto callback = [this, nextRequest](const FileRequest& checkRequest) { AZ_PROFILE_FUNCTION(AzCore); - auto check = AZStd::get_if(&checkRequest.GetCommand()); + auto check = AZStd::get_if(&checkRequest.GetCommand()); AZ_Assert(check, "Callback in FullFileDecompressor::PrepareDedicatedCache expected FileExistsCheck but got another command."); if (check->m_found) @@ -461,7 +461,7 @@ namespace AZ::IO void FullFileDecompressor::FileExistsCheck(FileRequest* checkRequest) { - auto& fileCheckRequest = AZStd::get(checkRequest->GetCommand()); + auto& fileCheckRequest = AZStd::get(checkRequest->GetCommand()); CompressionInfo info; if (CompressionUtils::FindCompressionInfo(info, fileCheckRequest.m_path.GetRelativePath())) { @@ -487,7 +487,7 @@ namespace AZ::IO { if (m_readBufferStatus[i] == ReadBufferStatus::Unused) { - auto data = AZStd::get_if(&compressedReadRequest->GetCommand()); + auto data = AZStd::get_if(&compressedReadRequest->GetCommand()); AZ_Assert(data, "Compressed request that's starting a read in FullFileDecompressor didn't contain compression read data."); AZ_Assert(data->m_compressionInfo.m_decompressor, "FileRequest for FullFileDecompressor is missing a decompression callback."); @@ -549,7 +549,7 @@ namespace AZ::IO } else { - auto data = AZStd::get_if(&compressedRequest->GetCommand()); + auto data = AZStd::get_if(&compressedRequest->GetCommand()); AZ_Assert(data, "Compressed request in FullFileDecompressor that finished unsuccessfully didn't contain compression read data."); CompressionInfo& info = data->m_compressionInfo; size_t offsetAdjustment = info.m_offset - AZ_SIZE_ALIGN_DOWN(info.m_offset, aznumeric_cast(m_alignment)); @@ -591,7 +591,7 @@ namespace AZ::IO } FileRequest* waitRequest = m_readRequests[readSlot]; - AZ_Assert(AZStd::holds_alternative(waitRequest->GetCommand()), + AZ_Assert(AZStd::holds_alternative(waitRequest->GetCommand()), "File request waiting for decompression wasn't marked as being a wait operation."); FileRequest* compressedRequest = waitRequest->GetParent(); AZ_Assert(compressedRequest, "Read requests started by FullFileDecompressor is missing a parent request."); @@ -610,7 +610,7 @@ namespace AZ::IO m_readBuffers[readSlot] = nullptr; AZ::Job* decompressionJob; - auto data = AZStd::get_if(&compressedRequest->GetCommand()); + auto data = AZStd::get_if(&compressedRequest->GetCommand()); AZ_Assert(data, "Compressed request in FullFileDecompressor that's starting decompression didn't contain compression read data."); AZ_Assert(data->m_compressionInfo.m_decompressor, "FullFileDecompressor is queuing a decompression job but couldn't find a decompressor."); @@ -664,7 +664,7 @@ namespace AZ::IO FileRequest* compressedRequest = jobInfo.m_waitRequest->GetParent(); AZ_Assert(compressedRequest, "A wait request attached to FullFileDecompressor was completed but didn't have a parent compressed request."); - auto data = AZStd::get_if(&compressedRequest->GetCommand()); + auto data = AZStd::get_if(&compressedRequest->GetCommand()); AZ_Assert(data, "Compressed request in FullFileDecompressor that completed decompression didn't contain compression read data."); CompressionInfo& info = data->m_compressionInfo; size_t offsetAdjustment = info.m_offset - AZ_SIZE_ALIGN_DOWN(info.m_offset, aznumeric_cast(m_alignment)); @@ -694,7 +694,7 @@ namespace AZ::IO FileRequest* compressedRequest = info.m_waitRequest->GetParent(); AZ_Assert(compressedRequest, "A wait request attached to FullFileDecompressor was completed but didn't have a parent compressed request."); - auto request = AZStd::get_if(&compressedRequest->GetCommand()); + auto request = AZStd::get_if(&compressedRequest->GetCommand()); AZ_Assert(request, "Compressed request in FullFileDecompressor that's running full decompression didn't contain compression read data."); CompressionInfo& compressionInfo = request->m_compressionInfo; AZ_Assert(compressionInfo.m_decompressor, "Full decompressor job started, but there's no decompressor callback assigned."); @@ -719,7 +719,7 @@ namespace AZ::IO FileRequest* compressedRequest = info.m_waitRequest->GetParent(); AZ_Assert(compressedRequest, "A wait request attached to FullFileDecompressor was completed but didn't have a parent compressed request."); - auto request = AZStd::get_if(&compressedRequest->GetCommand()); + auto request = AZStd::get_if(&compressedRequest->GetCommand()); AZ_Assert(request, "Compressed request in FullFileDecompressor that's running partial decompression didn't contain compression read data."); CompressionInfo& compressionInfo = request->m_compressionInfo; AZ_Assert(compressionInfo.m_decompressor, "Partial decompressor job started, but there's no decompressor callback assigned."); diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/FullFileDecompressor.h b/Code/Framework/AzCore/AzCore/IO/Streamer/FullFileDecompressor.h index d9bd68f1a1..cb4226fd7c 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/FullFileDecompressor.h +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/FullFileDecompressor.h @@ -21,6 +21,11 @@ namespace AZ::IO { + namespace Requests + { + struct ReadRequestData; + } + struct FullFileDecompressorConfig final : public IStreamerStackConfig { @@ -87,7 +92,7 @@ namespace AZ::IO bool IsIdle() const; - void PrepareReadRequest(FileRequest* request, FileRequest::ReadRequestData& data); + void PrepareReadRequest(FileRequest* request, Requests::ReadRequestData& data); void PrepareDedicatedCache(FileRequest* request, const RequestPath& path); void FileExistsCheck(FileRequest* checkRequest); diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/ReadSplitter.cpp b/Code/Framework/AzCore/AzCore/IO/Streamer/ReadSplitter.cpp index a952e31a93..282a1e15c9 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/ReadSplitter.cpp +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/ReadSplitter.cpp @@ -118,7 +118,7 @@ namespace AZ::IO return; } - auto data = AZStd::get_if(&request->GetCommand()); + auto data = AZStd::get_if(&request->GetCommand()); if (data == nullptr) { StreamStackEntry::QueueRequest(request); @@ -156,7 +156,7 @@ namespace AZ::IO void ReadSplitter::QueueAlignedRead(FileRequest* request) { - auto data = AZStd::get_if(&request->GetCommand()); + auto data = AZStd::get_if(&request->GetCommand()); AZ_Assert(data != nullptr, "Provided request to queue by the Read Splitter did not contain a read command."); if (data->m_size <= m_maxReadSize) @@ -187,7 +187,7 @@ namespace AZ::IO bool ReadSplitter::QueueAlignedRead(PendingRead& pending) { - auto data = AZStd::get_if(&pending.m_request->GetCommand()); + auto data = AZStd::get_if(&pending.m_request->GetCommand()); AZ_Assert(data != nullptr, "Provided request to queue by the Read Splitter did not contain a read command."); while (pending.m_readSize > 0) @@ -237,7 +237,7 @@ namespace AZ::IO void ReadSplitter::QueueBufferedRead(FileRequest* request) { - auto data = AZStd::get_if(&request->GetCommand()); + auto data = AZStd::get_if(&request->GetCommand()); AZ_Assert(data != nullptr, "Provided request to queue by the Read Splitter did not contain a read command."); PendingRead pendingRead; @@ -262,7 +262,7 @@ namespace AZ::IO bool ReadSplitter::QueueBufferedRead(PendingRead& pending) { - auto data = AZStd::get_if(&pending.m_request->GetCommand()); + auto data = AZStd::get_if(&pending.m_request->GetCommand()); AZ_Assert(data != nullptr, "Provided request to queue by the Read Splitter did not contain a read command."); while (pending.m_readSize > 0) diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/Scheduler.cpp b/Code/Framework/AzCore/AzCore/IO/Streamer/Scheduler.cpp index fe1d5a5eda..65f72946b0 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/Scheduler.cpp +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/Scheduler.cpp @@ -6,9 +6,11 @@ * */ +#include + +#include #include #include -#include #include #include @@ -35,6 +37,10 @@ namespace AZ::IO m_threadData.m_streamStack = AZStd::move(streamStack); } + Scheduler::~Scheduler() + { + } + void Scheduler::Start(const AZStd::thread_desc& threadDesc) { if (!m_isRunning) @@ -222,10 +228,10 @@ namespace AZ::IO { using Command = AZStd::decay_t; if constexpr ( - AZStd::is_same_v || - AZStd::is_same_v) + AZStd::is_same_v || + AZStd::is_same_v) { - auto parentReadRequest = next->GetCommandFromChain(); + auto parentReadRequest = next->GetCommandFromChain(); AZ_Assert(parentReadRequest != nullptr, "The issued read request can't be found for the (compressed) read command."); size_t size = parentReadRequest->m_size; @@ -234,7 +240,7 @@ namespace AZ::IO AZ_Assert(parentReadRequest->m_allocator, "The read request was issued without a memory allocator or valid output address."); u64 recommendedSize = size; - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { recommendedSize = m_recommendations.CalculateRecommendedMemorySize(size, parentReadRequest->m_offset); } @@ -249,12 +255,12 @@ namespace AZ::IO parentReadRequest->m_output = allocation.m_address; parentReadRequest->m_outputSize = allocation.m_size; parentReadRequest->m_memoryType = allocation.m_type; - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { args.m_output = parentReadRequest->m_output; args.m_outputSize = allocation.m_size; } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { args.m_output = parentReadRequest->m_output; } @@ -267,7 +273,7 @@ namespace AZ::IO } #endif - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { m_threadData.m_lastFilePath = args.m_path; m_threadData.m_lastFileOffset = args.m_offset + args.m_size; @@ -275,7 +281,7 @@ namespace AZ::IO m_processingSize += args.m_size; #endif } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { const CompressionInfo& info = args.m_compressionInfo; m_threadData.m_lastFilePath = info.m_archiveFilename; @@ -288,15 +294,15 @@ namespace AZ::IO "Streamer queued %zu: %s", next->GetCommand().index(), parentReadRequest->m_path.GetRelativePath()); m_threadData.m_streamStack->QueueRequest(next); } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { return Thread_ProcessCancelRequest(next, args); } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { return Thread_ProcessRescheduleRequest(next, args); } - else if constexpr (AZStd::is_same_v || AZStd::is_same_v) + else if constexpr (AZStd::is_same_v || AZStd::is_same_v) { AZ_PROFILE_INTERVAL_START_COLORED(AzCore, next, ProfilerColor, "Streamer queued %zu", next->GetCommand().index()); @@ -345,7 +351,7 @@ namespace AZ::IO #endif { using Command = AZStd::decay_t; - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { if (args.m_output == nullptr && args.m_allocator != nullptr) { @@ -393,7 +399,7 @@ namespace AZ::IO } } - void Scheduler::Thread_ProcessCancelRequest(FileRequest* request, FileRequest::CancelData& data) + void Scheduler::Thread_ProcessCancelRequest(FileRequest* request, Requests::CancelData& data) { AZ_PROFILE_INTERVAL_START_COLORED(AzCore, request, ProfilerColor, "Streamer queued cancel"); auto& pending = m_context.GetPreparedRequests(); @@ -415,7 +421,7 @@ namespace AZ::IO m_threadData.m_streamStack->QueueRequest(request); } - void Scheduler::Thread_ProcessRescheduleRequest(FileRequest* request, FileRequest::RescheduleData& data) + void Scheduler::Thread_ProcessRescheduleRequest(FileRequest* request, Requests::RescheduleData& data) { AZ_PROFILE_INTERVAL_START_COLORED(AzCore, request, ProfilerColor, "Streamer queued reschedule"); auto& pendingRequests = m_context.GetPreparedRequests(); @@ -424,7 +430,7 @@ namespace AZ::IO if (pending->WorksOn(data.m_target)) { // Read requests are the only requests that use deadlines and dynamic priorities. - auto readRequest = pending->GetCommandFromChain(); + auto readRequest = pending->GetCommandFromChain(); if (readRequest) { readRequest->m_deadline = data.m_newDeadline; @@ -463,8 +469,8 @@ namespace AZ::IO // Order is the same for both requests, so prioritize the request that are at risk of missing // it's deadline. - const FileRequest::ReadRequestData* firstRead = first->GetCommandFromChain(); - const FileRequest::ReadRequestData* secondRead = second->GetCommandFromChain(); + const Requests::ReadRequestData* firstRead = first->GetCommandFromChain(); + const Requests::ReadRequestData* secondRead = second->GetCommandFromChain(); if (firstRead == nullptr || secondRead == nullptr) { @@ -496,11 +502,11 @@ namespace AZ::IO auto sameFile = [this](auto&& args) { using Command = AZStd::decay_t; - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { return m_threadData.m_lastFilePath == args.m_path; } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { return m_threadData.m_lastFilePath == args.m_compressionInfo.m_archiveFilename; } @@ -517,11 +523,11 @@ namespace AZ::IO auto offset = [](auto&& args) -> s64 { using Command = AZStd::decay_t; - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { return aznumeric_caster(args.m_offset); } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { return aznumeric_caster(args.m_compressionInfo.m_offset); } diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/Scheduler.h b/Code/Framework/AzCore/AzCore/IO/Streamer/Scheduler.h index 053a57d332..502002fd27 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/Scheduler.h +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/Scheduler.h @@ -8,6 +8,7 @@ #pragma once +#include #include #include #include @@ -24,11 +25,19 @@ namespace AZ::IO { class FileRequest; + namespace Requests + { + struct CancelData; + struct RescheduleData; + } // namespace Requests + class Scheduler final { public: explicit Scheduler(AZStd::shared_ptr streamStack, u64 memoryAlignment = AZCORE_GLOBAL_NEW_ALIGNMENT, u64 sizeAlignment = 1, u64 granularity = 1_mib); + ~Scheduler(); + void Start(const AZStd::thread_desc& threadDesc); void Stop(); @@ -61,14 +70,14 @@ namespace AZ::IO bool Thread_ExecuteRequests(); bool Thread_PrepareRequests(AZStd::vector& outstandingRequests); void Thread_ProcessTillIdle(); - void Thread_ProcessCancelRequest(FileRequest* request, FileRequest::CancelData& data); - void Thread_ProcessRescheduleRequest(FileRequest* request, FileRequest::RescheduleData& data); + void Thread_ProcessCancelRequest(FileRequest* request, Requests::CancelData& data); + void Thread_ProcessRescheduleRequest(FileRequest* request, Requests::RescheduleData& data); enum class Order { - FirstRequest, //< The first request is the most important to process next. - SecondRequest, //< The second request is the most important to process next. - Equal //< Both requests are equally important. + FirstRequest, //!< The first request is the most important to process next. + SecondRequest, //!< The second request is the most important to process next. + Equal //!< Both requests are equally important. }; //! Determine which of the two provided requests is more important to process next. Order Thread_PrioritizeRequests(const FileRequest* first, const FileRequest* second) const; diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/StorageDrive.cpp b/Code/Framework/AzCore/AzCore/IO/Streamer/StorageDrive.cpp index cfd191b68f..701eb563ec 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/StorageDrive.cpp +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/StorageDrive.cpp @@ -60,9 +60,9 @@ namespace AZ::IO AZ_PROFILE_FUNCTION(AzCore); AZ_Assert(request, "PrepareRequest was provided a null request."); - if (AZStd::holds_alternative(request->GetCommand())) + if (AZStd::holds_alternative(request->GetCommand())) { - auto& readRequest = AZStd::get(request->GetCommand()); + auto& readRequest = AZStd::get(request->GetCommand()); FileRequest* read = m_context->GetNewInternalRequest(); read->CreateRead(request, readRequest.m_output, readRequest.m_outputSize, readRequest.m_path, @@ -79,29 +79,29 @@ namespace AZ::IO AZStd::visit([this, request](auto&& args) { using Command = AZStd::decay_t; - if constexpr (AZStd::is_same_v || - AZStd::is_same_v || - AZStd::is_same_v) + if constexpr (AZStd::is_same_v || + AZStd::is_same_v || + AZStd::is_same_v) { m_pendingRequests.push_back(request); return; } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { CancelRequest(request, args.m_target); return; } else { - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { FlushCache(args.m_path); } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { FlushEntireCache(); } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { Report(args); } @@ -118,15 +118,15 @@ namespace AZ::IO AZStd::visit([this, request](auto&& args) { using Command = AZStd::decay_t; - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { ReadFile(request); } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { FileExistsRequest(request); } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { FileMetaDataRetrievalRequest(request); } @@ -199,25 +199,25 @@ namespace AZ::IO AZStd::visit([&](auto&& args) { using Command = AZStd::decay_t; - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { targetFile = &args.m_path; readSize = args.m_size; offset = args.m_offset; } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { targetFile = &args.m_compressionInfo.m_archiveFilename; readSize = args.m_compressionInfo.m_compressedSize; offset = args.m_compressionInfo.m_offset; } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { readSize = 0; AZStd::chrono::microseconds averageTime = m_getFileExistsTimeAverage.CalculateAverage(); startTime += averageTime; } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { readSize = 0; AZStd::chrono::microseconds averageTime = m_getFileMetaDataTimeAverage.CalculateAverage(); @@ -254,7 +254,7 @@ namespace AZ::IO { AZ_PROFILE_FUNCTION(AzCore); - auto data = AZStd::get_if(&request->GetCommand()); + auto data = AZStd::get_if(&request->GetCommand()); AZ_Assert(data, "FileRequest queued on StorageDrive to be read didn't contain read data."); SystemFile* file = nullptr; @@ -342,7 +342,7 @@ namespace AZ::IO AZ_PROFILE_FUNCTION(AzCore); TIMED_AVERAGE_WINDOW_SCOPE(m_getFileExistsTimeAverage); - auto& fileExists = AZStd::get(request->GetCommand()); + auto& fileExists = AZStd::get(request->GetCommand()); size_t cacheIndex = FindFileInCache(fileExists.m_path); if (cacheIndex != s_fileNotFound) { @@ -360,7 +360,7 @@ namespace AZ::IO AZ_PROFILE_FUNCTION(AzCore); TIMED_AVERAGE_WINDOW_SCOPE(m_getFileMetaDataTimeAverage); - auto& command = AZStd::get(request->GetCommand()); + auto& command = AZStd::get(request->GetCommand()); // If the file is already open, use the file handle which usually is cheaper than asking for the file by name. size_t cacheIndex = FindFileInCache(command.m_path); if (cacheIndex != s_fileNotFound) @@ -446,11 +446,11 @@ namespace AZ::IO } } - void StorageDrive::Report(const FileRequest::ReportData& data) const + void StorageDrive::Report(const Requests::ReportData& data) const { switch (data.m_reportType) { - case FileRequest::ReportData::ReportType::FileLocks: + case Requests::ReportType::FileLocks: for (u32 i = 0; i < m_fileHandles.size(); ++i) { if (m_fileHandles[i] != nullptr) diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/StorageDrive.h b/Code/Framework/AzCore/AzCore/IO/Streamer/StorageDrive.h index d90b31eeec..25f3d7b353 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/StorageDrive.h +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/StorageDrive.h @@ -8,6 +8,7 @@ #pragma once +#include #include #include #include @@ -16,6 +17,11 @@ #include #include +namespace AZ::IO::Requests +{ + struct ReportData; +} + namespace AZ::IO { struct StorageDriveConfig final : @@ -72,7 +78,7 @@ namespace AZ::IO void EstimateCompletionTimeForRequest(FileRequest* request, AZStd::chrono::system_clock::time_point& startTime, const RequestPath*& activeFile, u64& activeOffset) const; - void Report(const FileRequest::ReportData& data) const; + void Report(const Requests::ReportData& data) const; TimedAverageWindow m_fileOpenCloseTimeAverage; TimedAverageWindow m_getFileExistsTimeAverage; diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/Streamer.cpp b/Code/Framework/AzCore/AzCore/IO/Streamer/Streamer.cpp index e4976f7d1c..dfc156bbee 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/Streamer.cpp +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/Streamer.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -210,7 +211,7 @@ namespace AZ::IO IStreamerTypes::ClaimMemory claimMemory) const { AZ_Assert(request.m_request, "The request handle provided to Streamer::GetReadRequestResult is invalid."); - auto readRequest = AZStd::get_if(&request.m_request->GetCommand()); + auto readRequest = AZStd::get_if(&request.m_request->GetCommand()); if (readRequest != nullptr) { buffer = readRequest->m_output; @@ -281,14 +282,14 @@ namespace AZ::IO } } - FileRequestPtr Streamer::Report(FileRequest::ReportData::ReportType reportType) + FileRequestPtr Streamer::Report(Requests::ReportType reportType) { FileRequestPtr result = CreateRequest(); Report(result, reportType); return result; } - FileRequestPtr& Streamer::Report(FileRequestPtr& request, FileRequest::ReportData::ReportType reportType) + FileRequestPtr& Streamer::Report(FileRequestPtr& request, Requests::ReportType reportType) { request->m_request.CreateReport(reportType); return request; diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/Streamer.h b/Code/Framework/AzCore/AzCore/IO/Streamer/Streamer.h index bb363a0c64..7e3dd1a742 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/Streamer.h +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/Streamer.h @@ -20,6 +20,10 @@ namespace AZStd struct thread_desc; } +namespace AZ::IO::Requests +{ + enum class ReportType : int8_t; +} namespace AZ::IO { @@ -185,9 +189,9 @@ namespace AZ::IO void RecordStatistics(); //! Tells AZ::IO::Streamer the report the information for the report to the output. - FileRequestPtr Report(FileRequest::ReportData::ReportType reportType); + FileRequestPtr Report(Requests::ReportType reportType); //! Tells AZ::IO::Streamer the report the information for the report to the output. - FileRequestPtr& Report(FileRequestPtr& request, FileRequest::ReportData::ReportType reportType); + FileRequestPtr& Report(FileRequestPtr& request, Requests::ReportType reportType); Streamer(const AZStd::thread_desc& threadDesc, AZStd::unique_ptr streamStack); diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/StreamerComponent.cpp b/Code/Framework/AzCore/AzCore/IO/Streamer/StreamerComponent.cpp index 9a465021c2..25fdb9bdfb 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/StreamerComponent.cpp +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/StreamerComponent.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -207,7 +208,7 @@ namespace AZ { if (m_streamer) { - m_streamer->QueueRequest(m_streamer->Report(AZ::IO::FileRequest::ReportData::ReportType::FileLocks)); + m_streamer->QueueRequest(m_streamer->Report(AZ::IO::Requests::ReportType::FileLocks)); } } diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/StreamerContext.cpp b/Code/Framework/AzCore/AzCore/IO/Streamer/StreamerContext.cpp index 5cd483bc55..fc5d6468d8 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/StreamerContext.cpp +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/StreamerContext.cpp @@ -22,6 +22,10 @@ namespace AZ static constexpr char LatePredictionName[] = "Early completions"; static constexpr char MissedDeadlinesName[] = "Missed deadlines"; #endif // AZ_STREAMER_ADD_EXTRA_PROFILING_INFO + + StreamerContext::StreamerContext() + { + } StreamerContext::~StreamerContext() { for (FileRequest* entry : m_internalRecycleBin) @@ -204,7 +208,7 @@ namespace AZ m_latePredictionsPercentageStat.GetMostRecentSample()); } } - auto readRequest = AZStd::get_if(&top->GetCommand()); + auto readRequest = AZStd::get_if(&top->GetCommand()); if (readRequest != nullptr) { m_missedDeadlinePercentageStat.PushSample(now < readRequest->m_deadline ? 0.0 : 1.0); diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/StreamerContext.h b/Code/Framework/AzCore/AzCore/IO/Streamer/StreamerContext.h index 356eb7ddac..f4caaffc70 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/StreamerContext.h +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/StreamerContext.h @@ -7,23 +7,28 @@ */ #pragma once -#include -#include #include #include #include +#include +#include #include -#include #include -#include +#include namespace AZ::IO { + class FileRequest; + class ExternalFileRequest; + + using FileRequestPtr = AZStd::intrusive_ptr; + class StreamerContext { public: using PreparedQueue = AZStd::deque; + StreamerContext(); ~StreamerContext(); //! Gets a new file request, either by creating a new instance or diff --git a/Code/Framework/AzCore/Platform/Windows/AzCore/IO/Streamer/StorageDrive_Windows.cpp b/Code/Framework/AzCore/Platform/Windows/AzCore/IO/Streamer/StorageDrive_Windows.cpp index feb8bce111..708bacd7cd 100644 --- a/Code/Framework/AzCore/Platform/Windows/AzCore/IO/Streamer/StorageDrive_Windows.cpp +++ b/Code/Framework/AzCore/Platform/Windows/AzCore/IO/Streamer/StorageDrive_Windows.cpp @@ -172,9 +172,9 @@ namespace AZ::IO AZ_PROFILE_FUNCTION(AzCore); AZ_Assert(request, "PrepareRequest was provided a null request."); - if (AZStd::holds_alternative(request->GetCommand())) + if (AZStd::holds_alternative(request->GetCommand())) { - auto& readRequest = AZStd::get(request->GetCommand()); + auto& readRequest = AZStd::get(request->GetCommand()); if (IsServicedByThisDrive(readRequest.m_path.GetAbsolutePath())) { FileRequest* read = m_context->GetNewInternalRequest(); @@ -195,7 +195,7 @@ namespace AZ::IO AZStd::visit([this, request](auto&& args) { using Command = AZStd::decay_t; - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { if (IsServicedByThisDrive(args.m_path.GetAbsolutePath())) { @@ -203,8 +203,8 @@ namespace AZ::IO return; } } - else if constexpr (AZStd::is_same_v || - AZStd::is_same_v) + else if constexpr (AZStd::is_same_v || + AZStd::is_same_v) { if (IsServicedByThisDrive(args.m_path.GetAbsolutePath())) { @@ -212,7 +212,7 @@ namespace AZ::IO return; } } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { if (CancelRequest(request, args.m_target)) { @@ -221,15 +221,15 @@ namespace AZ::IO return; } } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { FlushCache(args.m_path); } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { FlushEntireCache(); } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { Report(args); } @@ -257,13 +257,13 @@ namespace AZ::IO hasWorked = AZStd::visit([this, request](auto&& args) { using Command = AZStd::decay_t; - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { FileExistsRequest(request); m_pendingRequests.pop_front(); return true; } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { FileMetaDataRetrievalRequest(request); m_pendingRequests.pop_front(); @@ -308,7 +308,7 @@ namespace AZ::IO FileReadInformation& read = m_readSlots_readInfo[i]; u64 totalBytesRead = m_readSizeAverage.GetTotal(); double totalReadTimeUSec = aznumeric_caster(m_readTimeAverage.GetTotal().count()); - auto readCommand = AZStd::get_if(&read.m_request->GetCommand()); + auto readCommand = AZStd::get_if(&read.m_request->GetCommand()); AZ_Assert(readCommand, "Request currently reading doesn't contain a read command."); auto endTime = read.m_startTime + AZStd::chrono::microseconds(aznumeric_cast((readCommand->m_size * totalReadTimeUSec) / totalBytesRead)); earliestSlot = AZStd::min(earliestSlot, endTime); @@ -354,25 +354,25 @@ namespace AZ::IO AZStd::visit([&](auto&& args) { using Command = AZStd::decay_t; - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { targetFile = &args.m_path; readSize = args.m_size; offset = args.m_offset; } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { targetFile = &args.m_compressionInfo.m_archiveFilename; readSize = args.m_compressionInfo.m_compressedSize; offset = args.m_compressionInfo.m_offset; } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { readSize = 0; AZStd::chrono::microseconds getFileExistsTimeAverage = m_getFileExistsTimeAverage.CalculateAverage(); startTime += getFileExistsTimeAverage; } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { readSize = 0; AZStd::chrono::microseconds getFileExistsTimeAverage = m_getFileMetaDataRetrievalTimeAverage.CalculateAverage(); @@ -411,15 +411,15 @@ namespace AZ::IO AZStd::visit([&, this](auto&& args) { using Command = AZStd::decay_t; - if constexpr (AZStd::is_same_v || - AZStd::is_same_v) + if constexpr (AZStd::is_same_v || + AZStd::is_same_v) { if (IsServicedByThisDrive(args.m_path.GetAbsolutePath())) { EstimateCompletionTimeForRequest(request, startTime, activeFile, activeOffset); } } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { if (IsServicedByThisDrive(args.m_compressionInfo.m_archiveFilename.GetAbsolutePath())) { @@ -435,7 +435,7 @@ namespace AZ::IO aznumeric_cast(m_pendingRequests.size()) - m_activeReads_Count; } - auto StorageDriveWin::OpenFile(HANDLE& fileHandle, size_t& cacheSlot, FileRequest* request, const FileRequest::ReadData& data) -> OpenFileResult + auto StorageDriveWin::OpenFile(HANDLE& fileHandle, size_t& cacheSlot, FileRequest* request, const Requests::ReadData& data) -> OpenFileResult { HANDLE file = INVALID_HANDLE_VALUE; @@ -553,7 +553,7 @@ namespace AZ::IO return false; } - auto data = AZStd::get_if(&request->GetCommand()); + auto data = AZStd::get_if(&request->GetCommand()); AZ_Assert(data, "Read request in StorageDriveWin doesn't contain read data."); HANDLE file = INVALID_HANDLE_VALUE; @@ -780,7 +780,7 @@ namespace AZ::IO void StorageDriveWin::FileExistsRequest(FileRequest* request) { - auto& fileExists = AZStd::get(request->GetCommand()); + auto& fileExists = AZStd::get(request->GetCommand()); AZ_PROFILE_SCOPE(AzCore, "StorageDriveWin::FileExistsRequest %s : %s", m_name.c_str(), fileExists.m_path.GetRelativePath()); @@ -836,7 +836,7 @@ namespace AZ::IO void StorageDriveWin::FileMetaDataRetrievalRequest(FileRequest* request) { - auto& command = AZStd::get(request->GetCommand()); + auto& command = AZStd::get(request->GetCommand()); AZ_PROFILE_SCOPE(AzCore, "StorageDriveWin::FileMetaDataRetrievalRequest %s : %s", m_name.c_str(), command.m_path.GetRelativePath()); @@ -1005,7 +1005,7 @@ namespace AZ::IO FileReadInformation& fileReadInfo = m_readSlots_readInfo[readSlot]; - auto readCommand = AZStd::get_if(&fileReadInfo.m_request->GetCommand()); + auto readCommand = AZStd::get_if(&fileReadInfo.m_request->GetCommand()); AZ_Assert(readCommand != nullptr, "Request stored with the overlapped I/O call did not contain a read request."); if (fileReadInfo.m_sectorAlignedOutput && !encounteredError) @@ -1147,11 +1147,11 @@ namespace AZ::IO StreamStackEntry::CollectStatistics(statistics); } - void StorageDriveWin::Report(const FileRequest::ReportData& data) const + void StorageDriveWin::Report(const Requests::ReportData& data) const { switch (data.m_reportType) { - case FileRequest::ReportData::ReportType::FileLocks: + case Requests::ReportType::FileLocks: if (m_cachesInitialized) { for (u32 i = 0; i < m_maxFileHandles; ++i) diff --git a/Code/Framework/AzCore/Platform/Windows/AzCore/IO/Streamer/StorageDrive_Windows.h b/Code/Framework/AzCore/Platform/Windows/AzCore/IO/Streamer/StorageDrive_Windows.h index c70eb7804d..5207d094ef 100644 --- a/Code/Framework/AzCore/Platform/Windows/AzCore/IO/Streamer/StorageDrive_Windows.h +++ b/Code/Framework/AzCore/Platform/Windows/AzCore/IO/Streamer/StorageDrive_Windows.h @@ -9,6 +9,7 @@ #pragma once #include +#include #include #include #include @@ -19,6 +20,12 @@ #include #include +namespace AZ::IO::Requests +{ + struct ReadData; + struct ReportData; +} + namespace AZ::IO { class StorageDriveWin @@ -111,7 +118,7 @@ namespace AZ::IO CacheFull }; - OpenFileResult OpenFile(HANDLE& fileHandle, size_t& cacheSlot, FileRequest* request, const FileRequest::ReadData& data); + OpenFileResult OpenFile(HANDLE& fileHandle, size_t& cacheSlot, FileRequest* request, const Requests::ReadData& data); bool ReadRequest(FileRequest* request); bool ReadRequest(FileRequest* request, size_t readSlot); bool CancelRequest(FileRequest* cancelRequest, FileRequestPtr& target); @@ -137,7 +144,7 @@ namespace AZ::IO void FinalizeSingleRequest(FileReadStatus& status, size_t readSlot, DWORD numBytesTransferred, bool isCanceled, bool encounteredError); - void Report(const FileRequest::ReportData& data) const; + void Report(const Requests::ReportData& data) const; TimedAverageWindow m_fileOpenCloseTimeAverage; TimedAverageWindow m_getFileExistsTimeAverage; diff --git a/Code/Framework/AzCore/Tests/Asset/AssetDataStreamTests.cpp b/Code/Framework/AzCore/Tests/Asset/AssetDataStreamTests.cpp index 27903495f1..3846c6cf16 100644 --- a/Code/Framework/AzCore/Tests/Asset/AssetDataStreamTests.cpp +++ b/Code/Framework/AzCore/Tests/Asset/AssetDataStreamTests.cpp @@ -6,6 +6,7 @@ * */ #include +#include #include #include #include diff --git a/Code/Framework/AzCore/Tests/Platform/Windows/Tests/IO/Streamer/StorageDriveTests_Windows.cpp b/Code/Framework/AzCore/Tests/Platform/Windows/Tests/IO/Streamer/StorageDriveTests_Windows.cpp index e312e2058d..95b0626d7f 100644 --- a/Code/Framework/AzCore/Tests/Platform/Windows/Tests/IO/Streamer/StorageDriveTests_Windows.cpp +++ b/Code/Framework/AzCore/Tests/Platform/Windows/Tests/IO/Streamer/StorageDriveTests_Windows.cpp @@ -406,7 +406,7 @@ namespace AZ::IO request->CreateFileMetaDataRetrieval(path); request->SetCompletionCallback([](const FileRequest& request) { - auto& fileMetaData = AZStd::get(request.GetCommand()); + auto& fileMetaData = AZStd::get(request.GetCommand()); EXPECT_FALSE(fileMetaData.m_found); EXPECT_EQ(0, fileMetaData.m_fileSize); }); @@ -424,7 +424,7 @@ namespace AZ::IO request->SetCompletionCallback([](const FileRequest& request) { - auto& fileMetaData = AZStd::get(request.GetCommand()); + auto& fileMetaData = AZStd::get(request.GetCommand()); EXPECT_TRUE(fileMetaData.m_found); EXPECT_EQ(4_kib, fileMetaData.m_fileSize); }); @@ -442,7 +442,7 @@ namespace AZ::IO request->CreateFileMetaDataRetrieval(path); request->SetCompletionCallback([](const FileRequest& request) { - auto& fileMetaData = AZStd::get(request.GetCommand()); + auto& fileMetaData = AZStd::get(request.GetCommand()); EXPECT_FALSE(fileMetaData.m_found); EXPECT_EQ(0, fileMetaData.m_fileSize); }); @@ -460,7 +460,7 @@ namespace AZ::IO request->SetCompletionCallback([](const FileRequest& request) { - auto& fileMetaData = AZStd::get(request.GetCommand()); + auto& fileMetaData = AZStd::get(request.GetCommand()); EXPECT_TRUE(fileMetaData.m_found); EXPECT_EQ(16_kib, fileMetaData.m_fileSize); }); @@ -484,7 +484,7 @@ namespace AZ::IO request->SetCompletionCallback([](const FileRequest& request) { - auto& fileMetaData = AZStd::get(request.GetCommand()); + auto& fileMetaData = AZStd::get(request.GetCommand()); EXPECT_TRUE(fileMetaData.m_found); EXPECT_EQ(4_kib, fileMetaData.m_fileSize); }); @@ -502,7 +502,7 @@ namespace AZ::IO request->CreateFileExistsCheck(invalidPath); request->SetCompletionCallback([](const FileRequest& request) { - auto& fileExistsCheck = AZStd::get(request.GetCommand()); + auto& fileExistsCheck = AZStd::get(request.GetCommand()); EXPECT_EQ(AZ::IO::IStreamerTypes::RequestStatus::Completed, request.GetStatus()); EXPECT_FALSE(fileExistsCheck.m_found); }); @@ -519,7 +519,7 @@ namespace AZ::IO request->CreateFileExistsCheck(path); request->SetCompletionCallback([](const FileRequest& request) { - auto& fileExistsCheck = AZStd::get(request.GetCommand()); + auto& fileExistsCheck = AZStd::get(request.GetCommand()); EXPECT_EQ(AZ::IO::IStreamerTypes::RequestStatus::Completed, request.GetStatus()); EXPECT_FALSE(fileExistsCheck.m_found); }); @@ -535,7 +535,7 @@ namespace AZ::IO request->CreateFileExistsCheck(m_dummyRequestPath); request->SetCompletionCallback([](const FileRequest& request) { - auto& fileExistsCheck = AZStd::get(request.GetCommand()); + auto& fileExistsCheck = AZStd::get(request.GetCommand()); EXPECT_EQ(AZ::IO::IStreamerTypes::RequestStatus::Completed, request.GetStatus()); EXPECT_TRUE(fileExistsCheck.m_found); }); @@ -551,7 +551,7 @@ namespace AZ::IO request->CreateFileExistsCheck(m_dummyRequestPath); request->SetCompletionCallback([](const FileRequest& request) { - auto& fileExistsCheck = AZStd::get(request.GetCommand()); + auto& fileExistsCheck = AZStd::get(request.GetCommand()); EXPECT_EQ(AZ::IO::IStreamerTypes::RequestStatus::Completed, request.GetStatus()); EXPECT_TRUE(fileExistsCheck.m_found); }); @@ -573,7 +573,7 @@ namespace AZ::IO request->CreateFileExistsCheck(m_dummyRequestPath); request->SetCompletionCallback([](const FileRequest& request) { - auto& fileExistsCheck = AZStd::get(request.GetCommand()); + auto& fileExistsCheck = AZStd::get(request.GetCommand()); EXPECT_EQ(AZ::IO::IStreamerTypes::RequestStatus::Completed, request.GetStatus()); EXPECT_TRUE(fileExistsCheck.m_found); }); @@ -603,7 +603,7 @@ namespace AZ::IO AZ_POP_DISABLE_WARNING { EXPECT_EQ(request.GetStatus(), AZ::IO::IStreamerTypes::RequestStatus::Completed); - auto& readRequest = AZStd::get(request.GetCommand()); + auto& readRequest = AZStd::get(request.GetCommand()); EXPECT_EQ(readRequest.m_size, fileSize); EXPECT_STREQ(readRequest.m_path.GetAbsolutePath(), m_dummyFilepath.c_str()); }; @@ -648,7 +648,7 @@ namespace AZ::IO AZ_POP_DISABLE_WARNING { EXPECT_EQ(request.GetStatus(), AZ::IO::IStreamerTypes::RequestStatus::Completed); - auto& readRequest = AZStd::get(request.GetCommand()); + auto& readRequest = AZStd::get(request.GetCommand()); EXPECT_EQ(readRequest.m_size, unalignedSize); EXPECT_EQ(readRequest.m_offset, unalignedOffset); EXPECT_STREQ(readRequest.m_path.GetAbsolutePath(), m_dummyFilepath.c_str()); @@ -796,7 +796,7 @@ namespace AZ::IO AZ_POP_DISABLE_WARNING { EXPECT_EQ(request.GetStatus(), AZ::IO::IStreamerTypes::RequestStatus::Completed); - auto& readRequest = AZStd::get(request.GetCommand()); + auto& readRequest = AZStd::get(request.GetCommand()); EXPECT_EQ(readRequest.m_size, chunkSize); EXPECT_EQ(readRequest.m_offset, i * chunkSize); }; diff --git a/Code/Framework/AzCore/Tests/Streamer/BlockCacheTests.cpp b/Code/Framework/AzCore/Tests/Streamer/BlockCacheTests.cpp index 3a107da61d..d9d3623fbd 100644 --- a/Code/Framework/AzCore/Tests/Streamer/BlockCacheTests.cpp +++ b/Code/Framework/AzCore/Tests/Streamer/BlockCacheTests.cpp @@ -100,7 +100,7 @@ namespace AZ::IO void QueueReadRequest(FileRequest* request) { - auto data = AZStd::get_if(&request->GetCommand()); + auto data = AZStd::get_if(&request->GetCommand()); if (data) { if (m_fakeFileFound) @@ -122,15 +122,15 @@ namespace AZ::IO m_context->MarkRequestAsCompleted(request); } else if ( - AZStd::holds_alternative(request->GetCommand()) || - AZStd::holds_alternative(request->GetCommand())) + AZStd::holds_alternative(request->GetCommand()) || + AZStd::holds_alternative(request->GetCommand())) { request->SetStatus(IStreamerTypes::RequestStatus::Completed); m_context->MarkRequestAsCompleted(request); } - else if (AZStd::holds_alternative(request->GetCommand())) + else if (AZStd::holds_alternative(request->GetCommand())) { - auto& data2 = AZStd::get(request->GetCommand()); + auto& data2 = AZStd::get(request->GetCommand()); data2.m_found = m_fakeFileFound; data2.m_fileSize = m_fakeFileLength; request->SetStatus(m_fakeFileFound ? IStreamerTypes::RequestStatus::Completed : IStreamerTypes::RequestStatus::Failed); @@ -158,16 +158,16 @@ namespace AZ::IO void QueueCanceledReadRequest(FileRequest* request) { - auto data = AZStd::get_if(&request->GetCommand()); + auto data = AZStd::get_if(&request->GetCommand()); if (data) { ReadFile(data->m_output, data->m_path, data->m_offset, data->m_size); request->SetStatus(IStreamerTypes::RequestStatus::Canceled); m_context->MarkRequestAsCompleted(request); } - else if (AZStd::holds_alternative(request->GetCommand())) + else if (AZStd::holds_alternative(request->GetCommand())) { - auto& data2 = AZStd::get(request->GetCommand()); + auto& data2 = AZStd::get(request->GetCommand()); data2.m_found = true; data2.m_fileSize = m_fakeFileLength; request->SetStatus(IStreamerTypes::RequestStatus::Completed); diff --git a/Code/Framework/AzCore/Tests/Streamer/FullDecompressorTests.cpp b/Code/Framework/AzCore/Tests/Streamer/FullDecompressorTests.cpp index 9f2f0dbd6b..f465a0dafb 100644 --- a/Code/Framework/AzCore/Tests/Streamer/FullDecompressorTests.cpp +++ b/Code/Framework/AzCore/Tests/Streamer/FullDecompressorTests.cpp @@ -145,7 +145,7 @@ namespace AZ::IO void PrepareReadRequest(FileRequest* request) { - auto data = AZStd::get_if(&request->GetCommand()); + auto data = AZStd::get_if(&request->GetCommand()); ASSERT_NE(nullptr, data); u64 size = data->m_size >> 2; diff --git a/Code/Framework/AzCore/Tests/Streamer/IStreamerMock.h b/Code/Framework/AzCore/Tests/Streamer/IStreamerMock.h index 7b784caffd..0059a25b93 100644 --- a/Code/Framework/AzCore/Tests/Streamer/IStreamerMock.h +++ b/Code/Framework/AzCore/Tests/Streamer/IStreamerMock.h @@ -9,6 +9,7 @@ #include #include +#include using namespace AZ::IO; diff --git a/Code/Framework/AzCore/Tests/Streamer/ReadSplitterTests.cpp b/Code/Framework/AzCore/Tests/Streamer/ReadSplitterTests.cpp index a68ce091b8..01fe2f6a12 100644 --- a/Code/Framework/AzCore/Tests/Streamer/ReadSplitterTests.cpp +++ b/Code/Framework/AzCore/Tests/Streamer/ReadSplitterTests.cpp @@ -155,7 +155,7 @@ namespace AZ::IO { EXPECT_EQ(subRequests[i]->GetParent(), readRequest); - FileRequest::ReadData* data = AZStd::get_if(&subRequests[i]->GetCommand()); + Requests::ReadData* data = AZStd::get_if(&subRequests[i]->GetCommand()); ASSERT_NE(nullptr, data); EXPECT_EQ(SplitSize, data->m_size); EXPECT_EQ(SplitSize * i, data->m_offset); @@ -210,7 +210,7 @@ namespace AZ::IO { EXPECT_EQ(subRequests[i]->GetParent(), readRequest); - FileRequest::ReadData* data = AZStd::get_if(&subRequests[i]->GetCommand()); + Requests::ReadData* data = AZStd::get_if(&subRequests[i]->GetCommand()); ASSERT_NE(nullptr, data); EXPECT_EQ(SplitSize, data->m_size); EXPECT_EQ(SplitSize * i, data->m_offset); @@ -230,7 +230,7 @@ namespace AZ::IO { EXPECT_EQ(subRequests[i]->GetParent(), readRequest); - FileRequest::ReadData* data = AZStd::get_if(&subRequests[i]->GetCommand()); + Requests::ReadData* data = AZStd::get_if(&subRequests[i]->GetCommand()); ASSERT_NE(nullptr, data); EXPECT_EQ(SplitSize, data->m_size); EXPECT_EQ(SplitSize * (batchSize + i), data->m_offset); @@ -265,7 +265,7 @@ namespace AZ::IO m_readSplitter->QueueRequest(readRequest); ASSERT_NE(nullptr, subRequest); - FileRequest::ReadData* data = AZStd::get_if(&subRequest->GetCommand()); + Requests::ReadData* data = AZStd::get_if(&subRequest->GetCommand()); EXPECT_NE(buffer, data->m_output); EXPECT_EQ(readSize, data->m_size); EXPECT_EQ(0, data->m_offset); @@ -311,7 +311,7 @@ namespace AZ::IO m_readSplitter->QueueRequest(readRequest); ASSERT_NE(nullptr, subRequest); - FileRequest::ReadData* data = AZStd::get_if(&subRequest->GetCommand()); + Requests::ReadData* data = AZStd::get_if(&subRequest->GetCommand()); EXPECT_NE(buffer, data->m_output); EXPECT_EQ(readSize + offsetAdjustment, data->m_size); EXPECT_EQ(0, data->m_offset); diff --git a/Code/Framework/AzCore/Tests/Streamer/SchedulerTests.cpp b/Code/Framework/AzCore/Tests/Streamer/SchedulerTests.cpp index 6c360b97de..d1484b7409 100644 --- a/Code/Framework/AzCore/Tests/Streamer/SchedulerTests.cpp +++ b/Code/Framework/AzCore/Tests/Streamer/SchedulerTests.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -86,7 +87,7 @@ namespace AZ::IO .WillOnce([this](FileRequest* request) { AZ_Assert(m_streamerContext, "AZ::IO::Streamer is not ready to process requests."); - auto readData = AZStd::get_if(&request->GetCommand()); + auto readData = AZStd::get_if(&request->GetCommand()); AZ_Assert(readData, "Test didn't pass in the correct request."); FileRequest* read = m_streamerContext->GetNewInternalRequest(); read->CreateRead(request, readData->m_output, readData->m_outputSize, readData->m_path, @@ -99,7 +100,7 @@ namespace AZ::IO .WillOnce([this](FileRequest* request) { AZ_Assert(m_streamerContext, "AZ::IO::Streamer is not ready to process requests."); - auto readData = AZStd::get_if(&request->GetCommand()); + auto readData = AZStd::get_if(&request->GetCommand()); AZ_Assert(readData, "Test didn't pass in the correct request."); auto output = reinterpret_cast(readData->m_output); AZ_Assert(output != nullptr, "Output buffer has not been set."); @@ -304,7 +305,7 @@ namespace AZ::IO EXPECT_CALL(*m_mock, QueueRequest(_)).Times(1) .WillOnce(Invoke([this](FileRequest* request) { - auto* read = request->GetCommandFromChain(); + auto* read = request->GetCommandFromChain(); ASSERT_NE(nullptr, read); EXPECT_LT(read->m_deadline, FileRequest::s_noDeadlineTime); EXPECT_EQ(read->m_priority, IStreamerTypes::s_priorityHighest); diff --git a/Code/Framework/AzCore/Tests/Streamer/StreamStackEntryConformityTests.h b/Code/Framework/AzCore/Tests/Streamer/StreamStackEntryConformityTests.h index 6cbec7ea8a..8a5805cccd 100644 --- a/Code/Framework/AzCore/Tests/Streamer/StreamStackEntryConformityTests.h +++ b/Code/Framework/AzCore/Tests/Streamer/StreamStackEntryConformityTests.h @@ -10,6 +10,7 @@ #include #include +#include #include #include #include diff --git a/Code/Framework/AzCore/Tests/StreamerTests.cpp b/Code/Framework/AzCore/Tests/StreamerTests.cpp index 78f9f9060f..937b6d29de 100644 --- a/Code/Framework/AzCore/Tests/StreamerTests.cpp +++ b/Code/Framework/AzCore/Tests/StreamerTests.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/Code/Framework/AzFramework/AzFramework/Asset/AssetSystemComponent.cpp b/Code/Framework/AzFramework/AzFramework/Asset/AssetSystemComponent.cpp index bb361e56de..35c23d119a 100644 --- a/Code/Framework/AzFramework/AzFramework/Asset/AssetSystemComponent.cpp +++ b/Code/Framework/AzFramework/AzFramework/Asset/AssetSystemComponent.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include diff --git a/Code/Framework/AzFramework/AzFramework/IO/RemoteStorageDrive.cpp b/Code/Framework/AzFramework/AzFramework/IO/RemoteStorageDrive.cpp index 589c805871..23d275cb78 100644 --- a/Code/Framework/AzFramework/AzFramework/IO/RemoteStorageDrive.cpp +++ b/Code/Framework/AzFramework/AzFramework/IO/RemoteStorageDrive.cpp @@ -83,9 +83,9 @@ namespace AzFramework AZ_PROFILE_FUNCTION(AzCore); AZ_Assert(request, "PrepareRequest was provided a null request."); - if (AZStd::holds_alternative(request->GetCommand())) + if (AZStd::holds_alternative(request->GetCommand())) { - auto& readRequest = AZStd::get(request->GetCommand()); + auto& readRequest = AZStd::get(request->GetCommand()); FileRequest* read = m_context->GetNewInternalRequest(); read->CreateRead(request, readRequest.m_output, readRequest.m_outputSize, readRequest.m_path, @@ -106,14 +106,14 @@ namespace AzFramework { using namespace AZ::IO; using Command = AZStd::decay_t; - if constexpr (AZStd::is_same_v || - AZStd::is_same_v || - AZStd::is_same_v) + if constexpr (AZStd::is_same_v || + AZStd::is_same_v || + AZStd::is_same_v) { m_pendingRequests.push_back(request); return; } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { if (CancelRequest(request, args.m_target)) { @@ -124,15 +124,15 @@ namespace AzFramework } else { - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { FlushCache(args.m_path); } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { FlushEntireCache(); } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { Report(args); } @@ -152,15 +152,15 @@ namespace AzFramework { using namespace AZ::IO; using Command = AZStd::decay_t; - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { ReadFile(request); } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { FileExistsRequest(request); } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { FileMetaDataRetrievalRequest(request); } @@ -232,23 +232,23 @@ namespace AzFramework { using namespace AZ::IO; using Command = AZStd::decay_t; - if constexpr (AZStd::is_same_v) + if constexpr (AZStd::is_same_v) { targetFile = &args.m_path; readSize = args.m_size; } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { targetFile = &args.m_compressionInfo.m_archiveFilename; readSize = args.m_compressionInfo.m_compressedSize; } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { readSize = 0; AZStd::chrono::microseconds averageTime = m_getFileExistsTimeAverage.CalculateAverage(); startTime += averageTime; } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { readSize = 0; AZStd::chrono::microseconds averageTime = m_getFileMetaDataTimeAverage.CalculateAverage(); @@ -280,7 +280,7 @@ namespace AzFramework AZ_PROFILE_FUNCTION(AzCore); - auto data = AZStd::get_if(&request->GetCommand()); + auto data = AZStd::get_if(&request->GetCommand()); AZ_Assert(data, "Request doing reading in the RemoteStorageDrive didn't contain read data."); HandleType file = InvalidHandle; @@ -397,7 +397,7 @@ namespace AzFramework TIMED_AVERAGE_WINDOW_SCOPE(m_getFileExistsTimeAverage); - auto& fileExists = AZStd::get(request->GetCommand()); + auto& fileExists = AZStd::get(request->GetCommand()); size_t cacheIndex = FindFileInCache(fileExists.m_path); if (cacheIndex != s_fileNotFound) { @@ -430,7 +430,7 @@ namespace AzFramework AZ::u64 fileSize = 0; bool found = false; - auto& command = AZStd::get(request->GetCommand()); + auto& command = AZStd::get(request->GetCommand()); // If the file is already open, use the file handle which usually is cheaper than asking for the file by name. size_t cacheIndex = FindFileInCache(command.m_path); if (cacheIndex != s_fileNotFound) @@ -526,13 +526,13 @@ namespace AzFramework StreamStackEntry::CollectStatistics(statistics); } - void RemoteStorageDrive::Report(const AZ::IO::FileRequest::ReportData& data) const + void RemoteStorageDrive::Report(const AZ::IO::Requests::ReportData& data) const { using namespace AZ::IO; switch (data.m_reportType) { - case FileRequest::ReportData::ReportType::FileLocks: + case Requests::ReportType::FileLocks: for (AZ::u32 i = 0; i < m_fileHandles.size(); ++i) { if (m_fileHandles[i] != InvalidHandle) diff --git a/Code/Framework/AzFramework/AzFramework/IO/RemoteStorageDrive.h b/Code/Framework/AzFramework/AzFramework/IO/RemoteStorageDrive.h index c3e28f2e55..de0b855dcc 100644 --- a/Code/Framework/AzFramework/AzFramework/IO/RemoteStorageDrive.h +++ b/Code/Framework/AzFramework/AzFramework/IO/RemoteStorageDrive.h @@ -16,6 +16,15 @@ #include #include +namespace AZ::IO +{ + class RequestPath; + namespace Requests + { + struct ReportData; + } +} + namespace AzFramework { struct RemoteStorageDriveConfig final : @@ -63,7 +72,7 @@ namespace AzFramework const AZ::IO::RequestPath*& activeFile) const; void FlushCache(const AZ::IO::RequestPath& filePath); void FlushEntireCache(); - void Report(const AZ::IO::FileRequest::ReportData& data) const; + void Report(const AZ::IO::Requests::ReportData& data) const; AZ::IO::RemoteFileIO m_fileIO; AZ::IO::TimedAverageWindow m_fileOpenCloseTimeAverage; diff --git a/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSimulatedBody.cpp b/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSimulatedBody.cpp index 168152f686..bb1270a387 100644 --- a/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSimulatedBody.cpp +++ b/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSimulatedBody.cpp @@ -10,6 +10,7 @@ #include #include +#include #include #include diff --git a/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSimulatedBodyAutomation.cpp b/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSimulatedBodyAutomation.cpp index e78ff49f2d..a86ef12216 100644 --- a/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSimulatedBodyAutomation.cpp +++ b/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSimulatedBodyAutomation.cpp @@ -8,6 +8,7 @@ #include +#include #include #include diff --git a/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSimulatedBodyEvents.cpp b/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSimulatedBodyEvents.cpp index b51298a797..005ce291f6 100644 --- a/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSimulatedBodyEvents.cpp +++ b/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSimulatedBodyEvents.cpp @@ -8,6 +8,7 @@ #include +#include #include #include #include diff --git a/Code/Framework/AzFramework/AzFramework/Physics/PhysicsScene.cpp b/Code/Framework/AzFramework/AzFramework/Physics/PhysicsScene.cpp index a5ebdd04c6..1937c50555 100644 --- a/Code/Framework/AzFramework/AzFramework/Physics/PhysicsScene.cpp +++ b/Code/Framework/AzFramework/AzFramework/Physics/PhysicsScene.cpp @@ -9,6 +9,7 @@ #include #include +#include #include diff --git a/Code/Framework/AzFramework/AzFramework/Physics/PhysicsSystem.cpp b/Code/Framework/AzFramework/AzFramework/Physics/PhysicsSystem.cpp index 2ff4780c9e..a0bb2d9366 100644 --- a/Code/Framework/AzFramework/AzFramework/Physics/PhysicsSystem.cpp +++ b/Code/Framework/AzFramework/AzFramework/Physics/PhysicsSystem.cpp @@ -8,6 +8,7 @@ #include +#include #include namespace AzPhysics diff --git a/Code/Framework/AzFramework/AzFramework/Script/ScriptComponent.cpp b/Code/Framework/AzFramework/AzFramework/Script/ScriptComponent.cpp index 79365f1ebe..b2c36bc1c8 100644 --- a/Code/Framework/AzFramework/AzFramework/Script/ScriptComponent.cpp +++ b/Code/Framework/AzFramework/AzFramework/Script/ScriptComponent.cpp @@ -17,6 +17,7 @@ #include #include +#include #include #include diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/ToolsAssetCatalogComponent.h b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/ToolsAssetCatalogComponent.h index a68b82468e..56a3e7005c 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/ToolsAssetCatalogComponent.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/ToolsAssetCatalogComponent.h @@ -7,6 +7,7 @@ */ #pragma once +#include #include #include #include diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.h b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.h index 4596d70657..34b3a0a0b6 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.h @@ -10,12 +10,13 @@ #if !defined(Q_MOC_RUN) #include +#include #endif namespace AzToolsFramework { using namespace AzToolsFramework::AssetBrowser; - + //! Model storing all the files that can be suggested in the Asset Autocompleter for PropertyAssetCtrl class AssetCompleterModel : public QAbstractTableModel @@ -45,7 +46,7 @@ namespace AzToolsFramework void SetFetchEntryType(AssetBrowserEntry::AssetEntryType entryType); private: - struct AssetItem + struct AssetItem { AZStd::string m_displayName; AZStd::string m_path; diff --git a/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderComponent.cpp b/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderComponent.cpp index 78244ab02c..78e71ab3f2 100644 --- a/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderComponent.cpp +++ b/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderComponent.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/ShaderVariantAsyncLoader.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/ShaderVariantAsyncLoader.h index 982de92739..838cdd2256 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/ShaderVariantAsyncLoader.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/ShaderVariantAsyncLoader.h @@ -7,13 +7,15 @@ */ #pragma once -#include -#include #include #include #include #include +#include +#include +#include + namespace AZ { class ReflectContext; diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/PrecompiledShaderAssetSourceData.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/PrecompiledShaderAssetSourceData.h index ce5a4c8a7a..701b90ace9 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/PrecompiledShaderAssetSourceData.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/PrecompiledShaderAssetSourceData.h @@ -10,6 +10,7 @@ #include #include +#include namespace AZ { diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Culling.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Culling.cpp index bd196a2e2b..b97ffecccd 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Culling.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Culling.cpp @@ -267,7 +267,7 @@ namespace AZ return m_visScene->GetEntryCount(); } - + struct WorklistData { CullingDebugContext* m_debugCtx = nullptr; @@ -296,13 +296,13 @@ namespace AZ #endif return worklistData; } - + constexpr size_t WorkListCapacity = 5; using WorkListType = AZStd::fixed_vector; #if AZ_TRAIT_MASKED_OCCLUSION_CULLING_SUPPORTED static MaskedOcclusionCulling::CullingResult TestOcclusionCulling( - const AZStd::shared_ptr& worklistData, + const AZStd::shared_ptr& worklistData, AzFramework::VisibilityEntry* visibleEntry); #endif @@ -320,8 +320,8 @@ namespace AZ for (const AzFramework::IVisibilityScene::NodeData& nodeData : worklist) { //If a node is entirely contained within the frustum, then we can skip the fine grained culling. - bool nodeIsContainedInFrustum = - !worklistData->m_debugCtx->m_enableFrustumCulling || + bool nodeIsContainedInFrustum = + !worklistData->m_debugCtx->m_enableFrustumCulling || ShapeIntersection::Contains(worklistData->m_frustum, nodeData.m_bounds); #ifdef AZ_CULL_PROFILE_VERBOSE @@ -460,12 +460,14 @@ namespace AZ cullStats.m_numVisibleCullables += numVisibleCullables; ++cullStats.m_numJobs; } +#else + (void)numDrawPackets; // prevent unused variable warning->error #endif //AZ_CULL_DEBUG_ENABLED } #if AZ_TRAIT_MASKED_OCCLUSION_CULLING_SUPPORTED static MaskedOcclusionCulling::CullingResult TestOcclusionCulling( - const AZStd::shared_ptr& worklistData, + const AZStd::shared_ptr& worklistData, AzFramework::VisibilityEntry* visibleEntry) { if (!worklistData->m_maskedOcclusionCulling) @@ -527,9 +529,9 @@ namespace AZ #endif void CullingScene::ProcessCullablesCommon( - const Scene& scene [[maybe_unused]], - View& view, - AZ::Frustum& frustum [[maybe_unused]], + const Scene& scene [[maybe_unused]], + View& view, + AZ::Frustum& frustum [[maybe_unused]], void*& maskedOcclusionCulling [[maybe_unused]]) { AZ_PROFILE_SCOPE(RPI, "CullingScene::ProcessCullablesCommon() - %s", view.GetName().GetCStr()); @@ -898,7 +900,7 @@ namespace AZ { const Matrix4x4& worldToClip = viewPtr->GetWorldToClipMatrix(); Frustum frustum = Frustum::CreateFromMatrixColumnMajor(worldToClip, Frustum::ReverseDepth::True); - m_debugCtx.m_frozenFrustums.insert({ viewPtr.get(), frustum }); + m_debugCtx.m_frozenFrustums.insert({ viewPtr.get(), frustum }); } } } @@ -911,7 +913,7 @@ namespace AZ } void CullingScene::EndCulling() - { + { m_cullDataConcurrencyCheck.soft_unlock(); } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Metrics/ShaderMetricsSystem.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Metrics/ShaderMetricsSystem.cpp index e11624a921..460e671b4c 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Metrics/ShaderMetricsSystem.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Metrics/ShaderMetricsSystem.cpp @@ -11,13 +11,13 @@ #include +#include +#include #include #include #include - #include -#include namespace AZ { diff --git a/Gems/Atom/RPI/Code/Tests/Common/AssetManagerTestFixture.cpp b/Gems/Atom/RPI/Code/Tests/Common/AssetManagerTestFixture.cpp index fd19c6bcb8..83e8dbf085 100644 --- a/Gems/Atom/RPI/Code/Tests/Common/AssetManagerTestFixture.cpp +++ b/Gems/Atom/RPI/Code/Tests/Common/AssetManagerTestFixture.cpp @@ -7,6 +7,8 @@ */ #include "AssetManagerTestFixture.h" + +#include #include #include diff --git a/Gems/Atom/Utils/Code/Include/Atom/Utils/AssetCollectionAsyncLoader.h b/Gems/Atom/Utils/Code/Include/Atom/Utils/AssetCollectionAsyncLoader.h index d1027daa36..b974b4443d 100644 --- a/Gems/Atom/Utils/Code/Include/Atom/Utils/AssetCollectionAsyncLoader.h +++ b/Gems/Atom/Utils/Code/Include/Atom/Utils/AssetCollectionAsyncLoader.h @@ -9,6 +9,7 @@ #include #include +#include #include #include #include diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.cpp b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.cpp index 58b3d8b56e..35ae1b1257 100644 --- a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.cpp +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.cpp @@ -38,6 +38,8 @@ #include #include +#include + namespace AZ::Render { static constexpr uint32_t s_maxActiveWrinkleMasks = 16; diff --git a/Gems/AtomTressFX/Code/Rendering/SharedBuffer.cpp b/Gems/AtomTressFX/Code/Rendering/SharedBuffer.cpp index b31d9f8ae0..6f97613c89 100644 --- a/Gems/AtomTressFX/Code/Rendering/SharedBuffer.cpp +++ b/Gems/AtomTressFX/Code/Rendering/SharedBuffer.cpp @@ -16,6 +16,8 @@ #include #include +#include + namespace AZ::Render { //! Setting the constructor as private will create compile error to remind the developer to set diff --git a/Gems/AudioSystem/Code/Source/Engine/ATLEntities.cpp b/Gems/AudioSystem/Code/Source/Engine/ATLEntities.cpp index 2d95ddf4dd..ce17803531 100644 --- a/Gems/AudioSystem/Code/Source/Engine/ATLEntities.cpp +++ b/Gems/AudioSystem/Code/Source/Engine/ATLEntities.cpp @@ -8,6 +8,7 @@ #include +#include namespace Audio { @@ -285,5 +286,22 @@ namespace Audio return sResult; } + CATLAudioFileEntry::CATLAudioFileEntry(const char * const filePath, IATLAudioFileEntryData * const implData) + : m_filePath(filePath) + , m_fileSize(0) + , m_useCount(0) + , m_memoryBlockAlignment(AUDIO_MEMORY_ALIGNMENT) + , m_flags(eAFF_NOTFOUND) + , m_dataScope(eADS_ALL) + , m_memoryBlock(nullptr) + , m_implData(implData) + { + } + + CATLAudioFileEntry::~CATLAudioFileEntry() + { + + } + #endif // !AUDIO_RELEASE } // namespace Audio diff --git a/Gems/AudioSystem/Code/Source/Engine/ATLEntities.h b/Gems/AudioSystem/Code/Source/Engine/ATLEntities.h index f1ff74c370..4dfceeebfc 100644 --- a/Gems/AudioSystem/Code/Source/Engine/ATLEntities.h +++ b/Gems/AudioSystem/Code/Source/Engine/ATLEntities.h @@ -379,19 +379,9 @@ namespace Audio class CATLAudioFileEntry { public: - explicit CATLAudioFileEntry(const char* const filePath = nullptr, IATLAudioFileEntryData* const implData = nullptr) - : m_filePath(filePath) - , m_fileSize(0) - , m_useCount(0) - , m_memoryBlockAlignment(AUDIO_MEMORY_ALIGNMENT) - , m_flags(eAFF_NOTFOUND) - , m_dataScope(eADS_ALL) - , m_memoryBlock(nullptr) - , m_implData(implData) - { - } + explicit CATLAudioFileEntry(const char* const filePath = nullptr, IATLAudioFileEntryData* const implData = nullptr); - ~CATLAudioFileEntry() = default; + ~CATLAudioFileEntry(); AZStd::string m_filePath; size_t m_fileSize; diff --git a/Gems/AudioSystem/Code/Source/Engine/FileCacheManager.cpp b/Gems/AudioSystem/Code/Source/Engine/FileCacheManager.cpp index ffa94ad956..d1f2187942 100644 --- a/Gems/AudioSystem/Code/Source/Engine/FileCacheManager.cpp +++ b/Gems/AudioSystem/Code/Source/Engine/FileCacheManager.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include diff --git a/Gems/AudioSystem/Code/Tests/AudioSystemTest.cpp b/Gems/AudioSystem/Code/Tests/AudioSystemTest.cpp index 14e9f74fd2..a197fee96b 100644 --- a/Gems/AudioSystem/Code/Tests/AudioSystemTest.cpp +++ b/Gems/AudioSystem/Code/Tests/AudioSystemTest.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include diff --git a/Gems/AudioSystem/Code/Tests/Mocks/FileCacheManagerMock.h b/Gems/AudioSystem/Code/Tests/Mocks/FileCacheManagerMock.h index 06646216ae..1fb48bb3fb 100644 --- a/Gems/AudioSystem/Code/Tests/Mocks/FileCacheManagerMock.h +++ b/Gems/AudioSystem/Code/Tests/Mocks/FileCacheManagerMock.h @@ -13,6 +13,11 @@ #include #include +namespace AZ::IO +{ + class FileRequestHandle; +} + namespace Audio { class FileCacheManagerMock diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/ActorInstance.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/ActorInstance.cpp index c196f34716..bde1259c44 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/ActorInstance.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/ActorInstance.cpp @@ -34,6 +34,8 @@ #include #include +#include + namespace EMotionFX { AZ_CLASS_ALLOCATOR_IMPL(ActorInstance, ActorInstanceAllocator, 0) diff --git a/Gems/EMotionFX/Code/Tests/TestAssetCode/SimpleActors.cpp b/Gems/EMotionFX/Code/Tests/TestAssetCode/SimpleActors.cpp index 3e1dac41c2..e6415817cc 100644 --- a/Gems/EMotionFX/Code/Tests/TestAssetCode/SimpleActors.cpp +++ b/Gems/EMotionFX/Code/Tests/TestAssetCode/SimpleActors.cpp @@ -15,6 +15,8 @@ #include #include +#include + namespace EMotionFX { SimpleJointChainActor::SimpleJointChainActor(size_t jointCount, const char* name) diff --git a/Gems/LmbrCentral/Code/Source/Asset/AssetSystemDebugComponent.cpp b/Gems/LmbrCentral/Code/Source/Asset/AssetSystemDebugComponent.cpp index acd1bc8dae..91ba63ddd1 100644 --- a/Gems/LmbrCentral/Code/Source/Asset/AssetSystemDebugComponent.cpp +++ b/Gems/LmbrCentral/Code/Source/Asset/AssetSystemDebugComponent.cpp @@ -9,7 +9,9 @@ #include "AssetSystemDebugComponent.h" #include "ISystem.h" #include "IRenderAuxGeom.h" + #include "AzCore/Asset/AssetManager.h" +#include #include #include #include diff --git a/Gems/LmbrCentral/Code/Source/Audio/AudioAreaEnvironmentComponent.cpp b/Gems/LmbrCentral/Code/Source/Audio/AudioAreaEnvironmentComponent.cpp index 827e20b02b..3b14822076 100644 --- a/Gems/LmbrCentral/Code/Source/Audio/AudioAreaEnvironmentComponent.cpp +++ b/Gems/LmbrCentral/Code/Source/Audio/AudioAreaEnvironmentComponent.cpp @@ -8,6 +8,7 @@ #include "AudioAreaEnvironmentComponent.h" +#include #include #include #include diff --git a/Gems/NvCloth/Code/Source/Components/ClothComponentMesh/ActorClothColliders.h b/Gems/NvCloth/Code/Source/Components/ClothComponentMesh/ActorClothColliders.h index a400f742de..baac5b3776 100644 --- a/Gems/NvCloth/Code/Source/Components/ClothComponentMesh/ActorClothColliders.h +++ b/Gems/NvCloth/Code/Source/Components/ClothComponentMesh/ActorClothColliders.h @@ -10,6 +10,7 @@ #include #include +#include #include namespace NvCloth diff --git a/Gems/NvCloth/Code/Source/Utils/AssetHelper.h b/Gems/NvCloth/Code/Source/Utils/AssetHelper.h index e3e5a5e7ad..4a40fe26f0 100644 --- a/Gems/NvCloth/Code/Source/Utils/AssetHelper.h +++ b/Gems/NvCloth/Code/Source/Utils/AssetHelper.h @@ -10,6 +10,7 @@ #include #include +#include #include diff --git a/Gems/PhysX/Code/Editor/Source/ComponentModes/Joints/JointsSubComponentModeAngleCone.h b/Gems/PhysX/Code/Editor/Source/ComponentModes/Joints/JointsSubComponentModeAngleCone.h index 3f6d001112..11215ef29b 100644 --- a/Gems/PhysX/Code/Editor/Source/ComponentModes/Joints/JointsSubComponentModeAngleCone.h +++ b/Gems/PhysX/Code/Editor/Source/ComponentModes/Joints/JointsSubComponentModeAngleCone.h @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include diff --git a/Gems/PhysX/Code/Editor/Source/ComponentModes/Joints/JointsSubComponentModeSnap.h b/Gems/PhysX/Code/Editor/Source/ComponentModes/Joints/JointsSubComponentModeSnap.h index 843fffd4c8..c7a50c43f5 100644 --- a/Gems/PhysX/Code/Editor/Source/ComponentModes/Joints/JointsSubComponentModeSnap.h +++ b/Gems/PhysX/Code/Editor/Source/ComponentModes/Joints/JointsSubComponentModeSnap.h @@ -11,6 +11,7 @@ #include #include #include +#include #include #include diff --git a/Gems/PhysX/Code/Source/ForceRegionComponent.cpp b/Gems/PhysX/Code/Source/ForceRegionComponent.cpp index f8f5f1991e..eba902049d 100644 --- a/Gems/PhysX/Code/Source/ForceRegionComponent.cpp +++ b/Gems/PhysX/Code/Source/ForceRegionComponent.cpp @@ -9,6 +9,8 @@ #include #include +#include +#include #include #include #include diff --git a/Gems/PhysX/Code/Source/Joint/PhysXJointUtils.cpp b/Gems/PhysX/Code/Source/Joint/PhysXJointUtils.cpp index 975fec2181..c02324ed18 100644 --- a/Gems/PhysX/Code/Source/Joint/PhysXJointUtils.cpp +++ b/Gems/PhysX/Code/Source/Joint/PhysXJointUtils.cpp @@ -6,18 +6,22 @@ * */ -#include -#include -#include -#include +#include #include #include #include #include -#include #include +#include +#include +#include +#include +#include + + + namespace PhysX::Utils { struct PxJointActorData diff --git a/Gems/PhysX/Code/Source/Joint/PhysXJointUtils.h b/Gems/PhysX/Code/Source/Joint/PhysXJointUtils.h index da7b3dc4e2..d5aa082763 100644 --- a/Gems/PhysX/Code/Source/Joint/PhysXJointUtils.h +++ b/Gems/PhysX/Code/Source/Joint/PhysXJointUtils.h @@ -14,8 +14,15 @@ #include +#include + namespace PhysX { + struct D6JointLimitConfiguration; + struct FixedJointConfiguration; + struct BallJointConfiguration; + struct HingeJointConfiguration; + namespace JointConstants { // Setting joint limits to very small values can cause extreme stability problems, so clamp above a small diff --git a/Gems/PhysX/Code/Source/JointComponent.cpp b/Gems/PhysX/Code/Source/JointComponent.cpp index d5c04598a5..085fc34b12 100644 --- a/Gems/PhysX/Code/Source/JointComponent.cpp +++ b/Gems/PhysX/Code/Source/JointComponent.cpp @@ -5,17 +5,18 @@ * SPDX-License-Identifier: Apache-2.0 OR MIT * */ +#include +#include +#include +#include +#include +#include #include #include #include #include -#include -#include -#include -#include #include -#include namespace PhysX { diff --git a/Gems/PhysX/Code/Source/Material.cpp b/Gems/PhysX/Code/Source/Material.cpp index be79728cc5..fa131b5159 100644 --- a/Gems/PhysX/Code/Source/Material.cpp +++ b/Gems/PhysX/Code/Source/Material.cpp @@ -7,9 +7,10 @@ */ #include "Material.h" +#include #include -#include #include +#include #include namespace PhysX diff --git a/Gems/PhysX/Code/Source/PhysXCharacters/API/CharacterUtils.cpp b/Gems/PhysX/Code/Source/PhysXCharacters/API/CharacterUtils.cpp index f4cdd01889..fbadb8aa79 100644 --- a/Gems/PhysX/Code/Source/PhysXCharacters/API/CharacterUtils.cpp +++ b/Gems/PhysX/Code/Source/PhysXCharacters/API/CharacterUtils.cpp @@ -5,13 +5,10 @@ * SPDX-License-Identifier: Apache-2.0 OR MIT * */ - #include + #include #include -#include -#include -#include #include #include #include @@ -20,6 +17,12 @@ #include #include +#include +#include +#include + +#include + namespace PhysX::Utils::Characters { AZ::Outcome GetNodeIndex(const Physics::RagdollConfiguration& configuration, const AZStd::string& nodeName) diff --git a/Gems/PhysX/Code/Source/PhysXCharacters/API/RagdollNode.cpp b/Gems/PhysX/Code/Source/PhysXCharacters/API/RagdollNode.cpp index 34fe3d0295..3e240f3611 100644 --- a/Gems/PhysX/Code/Source/PhysXCharacters/API/RagdollNode.cpp +++ b/Gems/PhysX/Code/Source/PhysXCharacters/API/RagdollNode.cpp @@ -5,16 +5,17 @@ * SPDX-License-Identifier: Apache-2.0 OR MIT * */ - -#include -#include -#include #include + #include #include #include - #include +#include +#include +#include +#include + namespace PhysX { diff --git a/Gems/PhysX/Code/Source/Pipeline/HeightFieldAssetHandler.cpp b/Gems/PhysX/Code/Source/Pipeline/HeightFieldAssetHandler.cpp index 2d05612d74..ece6acbd6f 100644 --- a/Gems/PhysX/Code/Source/Pipeline/HeightFieldAssetHandler.cpp +++ b/Gems/PhysX/Code/Source/Pipeline/HeightFieldAssetHandler.cpp @@ -6,15 +6,16 @@ * */ +#include #include #include +#include #include #include #include #include #include -#include #include #include diff --git a/Gems/PhysX/Code/Source/Pipeline/StreamWrapper.h b/Gems/PhysX/Code/Source/Pipeline/StreamWrapper.h index 15f9bfb36e..d987b7194c 100644 --- a/Gems/PhysX/Code/Source/Pipeline/StreamWrapper.h +++ b/Gems/PhysX/Code/Source/Pipeline/StreamWrapper.h @@ -10,6 +10,7 @@ #include #include +#include #include namespace PhysX diff --git a/Gems/PhysX/Code/Source/Scene/PhysXScene.cpp b/Gems/PhysX/Code/Source/Scene/PhysXScene.cpp index dfac43b703..6c02697e90 100644 --- a/Gems/PhysX/Code/Source/Scene/PhysXScene.cpp +++ b/Gems/PhysX/Code/Source/Scene/PhysXScene.cpp @@ -7,14 +7,6 @@ */ #include -#include -#include -#include -#include -#include -#include -#include -#include #include #include @@ -31,6 +23,16 @@ #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include + namespace PhysX { AZ_CLASS_ALLOCATOR_IMPL(PhysXScene, AZ::SystemAllocator, 0); diff --git a/Gems/PhysX/Code/Source/System/PhysXSystem.cpp b/Gems/PhysX/Code/Source/System/PhysXSystem.cpp index 168adc8910..d7ce797b47 100644 --- a/Gems/PhysX/Code/Source/System/PhysXSystem.cpp +++ b/Gems/PhysX/Code/Source/System/PhysXSystem.cpp @@ -5,18 +5,20 @@ * 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 // only enable physx timestep warning when not running debug or in Release #if !defined(DEBUG) && !defined(RELEASE) diff --git a/Gems/PhysX/Code/Tests/PhysXTestUtil.cpp b/Gems/PhysX/Code/Tests/PhysXTestUtil.cpp index 2366f65e07..f79b7c8d34 100644 --- a/Gems/PhysX/Code/Tests/PhysXTestUtil.cpp +++ b/Gems/PhysX/Code/Tests/PhysXTestUtil.cpp @@ -9,6 +9,7 @@ #include "PhysXTestUtil.h" #include #include +#include namespace PhysX { diff --git a/Gems/PhysXDebug/Code/Source/SystemComponent.cpp b/Gems/PhysXDebug/Code/Source/SystemComponent.cpp index 65115f2790..746809a7ca 100644 --- a/Gems/PhysXDebug/Code/Source/SystemComponent.cpp +++ b/Gems/PhysXDebug/Code/Source/SystemComponent.cpp @@ -8,10 +8,7 @@ #include "SystemComponent.h" -#include -#include -#include -#include +#include #include #include @@ -19,20 +16,24 @@ #include #include +#include +#include +#include +#include + +#include #include #include #include #include #include -#include - -#include -#include -#include -#include +#include +#include +#include +#include +#include -#include namespace PhysXDebug { diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp index 439f9a8383..d9ec1de757 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp @@ -10,11 +10,14 @@ #include "ScriptCanvasMemoryAsset.h" #include "ScriptCanvasUndoHelper.h" -#include +#include +#include +#include #include +#include #include +#include #include -#include namespace ScriptCanvasEditor { diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp index 49a35eac8a..95b4fbb843 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp @@ -9,6 +9,8 @@ #include #include #include +#include +#include #include #include #include diff --git a/Gems/ScriptEvents/Code/Source/ScriptEventsSystemComponent.h b/Gems/ScriptEvents/Code/Source/ScriptEventsSystemComponent.h index 64a0e49bca..922bfb1dbc 100644 --- a/Gems/ScriptEvents/Code/Source/ScriptEventsSystemComponent.h +++ b/Gems/ScriptEvents/Code/Source/ScriptEventsSystemComponent.h @@ -11,6 +11,7 @@ #include #include #include +#include #include #include diff --git a/Gems/WhiteBox/Code/Source/Viewport/WhiteBoxVertexTranslationModifier.h b/Gems/WhiteBox/Code/Source/Viewport/WhiteBoxVertexTranslationModifier.h index a9565aedbe..d9bae70a31 100644 --- a/Gems/WhiteBox/Code/Source/Viewport/WhiteBoxVertexTranslationModifier.h +++ b/Gems/WhiteBox/Code/Source/Viewport/WhiteBoxVertexTranslationModifier.h @@ -13,6 +13,7 @@ #include #include #include +#include #include #include From 40e1116e26628849c91fc450f4ce2c3720aca297 Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Mon, 13 Dec 2021 06:10:36 -0600 Subject: [PATCH 095/948] Use LegacySystemInterfaceCreated to initialize physics material library. (#6168) (#6347) * Use LegacySystemInterfaceCreated to initialize physics material library. OnCatalogLoaded was used before but it's not called when running the editor without assets processed yet. Signed-off-by: moraaar Co-authored-by: moraaar --- Gems/PhysX/Code/Source/System/PhysXSystem.cpp | 23 +++++++++++++++---- Gems/PhysX/Code/Source/System/PhysXSystem.h | 11 ++++----- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/Gems/PhysX/Code/Source/System/PhysXSystem.cpp b/Gems/PhysX/Code/Source/System/PhysXSystem.cpp index cc21285f8c..447df6dcc5 100644 --- a/Gems/PhysX/Code/Source/System/PhysXSystem.cpp +++ b/Gems/PhysX/Code/Source/System/PhysXSystem.cpp @@ -7,6 +7,8 @@ */ #include #include +#include +#include #include #include @@ -97,7 +99,20 @@ namespace PhysX m_systemConfig = *physXConfig; } - AzFramework::AssetCatalogEventBus::Handler::BusConnect(); + // If the settings registry isn't available, something earlier in startup will report that failure. + if (auto* settingsRegistry = AZ::SettingsRegistry::Get(); + settingsRegistry != nullptr) + { + // Automatically register the event if it's not registered, because + // this system is initialized before the settings registry has loaded the event list. + AZ::ComponentApplicationLifecycle::RegisterHandler( + *settingsRegistry, m_componentApplicationLifecycleHandler, + [this]([[maybe_unused]] AZStd::string_view path, [[maybe_unused]] AZ::SettingsRegistryInterface::Type type) + { + InitializeMaterialLibrary(); + }, + "LegacySystemInterfaceCreated"); // LegacySystemInterfaceCreated is signaled after critical assets have been processed + } m_state = State::Initialized; m_initializeEvent.Signal(&m_systemConfig); @@ -118,7 +133,7 @@ namespace PhysX RemoveAllScenes(); - AzFramework::AssetCatalogEventBus::Handler::BusDisconnect(); + m_componentApplicationLifecycleHandler.Disconnect(); m_materialLibraryAssetHelper.Disconnect(); // Clear the asset reference in deactivate. The asset system is shut down before destructors are called // for system components, causing any hanging asset references to become crashes on shutdown in release builds. @@ -362,10 +377,8 @@ namespace PhysX return &m_systemConfig; } - void PhysXSystem::OnCatalogLoaded([[maybe_unused]]const char* catalogFile) + void PhysXSystem::InitializeMaterialLibrary() { - // now that assets can be resolved, lets load the default material library. - if (!m_systemConfig.m_materialLibraryAsset.GetId().IsValid()) { m_onMaterialLibraryLoadErrorEvent.Signal(AzPhysics::SystemEvents::MaterialLibraryLoadErrorType::InvalidId); diff --git a/Gems/PhysX/Code/Source/System/PhysXSystem.h b/Gems/PhysX/Code/Source/System/PhysXSystem.h index d1250b6958..48b5dfa075 100644 --- a/Gems/PhysX/Code/Source/System/PhysXSystem.h +++ b/Gems/PhysX/Code/Source/System/PhysXSystem.h @@ -7,10 +7,9 @@ */ #pragma once -#include #include #include -#include +#include #include #include @@ -35,7 +34,6 @@ namespace PhysX { class PhysXSystem : public AZ::Interface::Registrar - , private AzFramework::AssetCatalogEventBus::Handler { public: AZ_CLASS_ALLOCATOR_DECL; @@ -89,10 +87,9 @@ namespace PhysX //! @param cookingParams The cooking params to use when setting up PhysX cooking interface. void InitializePhysXSdk(const physx::PxCookingParams& cookingParams); void ShutdownPhysXSdk(); - bool LoadMaterialLibrary(); - // AzFramework::AssetCatalogEventBus::Handler ... - void OnCatalogLoaded(const char* catalogFile) override; + void InitializeMaterialLibrary(); + bool LoadMaterialLibrary(); PhysXSystemConfiguration m_systemConfig; AzPhysics::SceneConfiguration m_defaultSceneConfiguration; @@ -145,6 +142,8 @@ namespace PhysX OnMaterialLibraryReloadedCallback m_onMaterialLibraryReloadedCallback; }; MaterialLibraryAssetHelper m_materialLibraryAssetHelper; + + AZ::SettingsRegistryInterface::NotifyEventHandler m_componentApplicationLifecycleHandler; }; //! Helper function for getting the PhysX System interface from inside the PhysX gem. From 82ebca826164085d6ef3a8a6f1f2c087c761c103 Mon Sep 17 00:00:00 2001 From: Andre Mitchell Date: Mon, 13 Dec 2021 07:16:14 -0500 Subject: [PATCH 096/948] Disable unused HideActionWhileEntitiesDeselected function in EditorListener. It is only used when the slice editor is enabled, which causes build errors when it is not enabled. Signed-off-by: Andre Mitchell --- Code/Editor/Core/LevelEditorMenuHandler.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Code/Editor/Core/LevelEditorMenuHandler.cpp b/Code/Editor/Core/LevelEditorMenuHandler.cpp index 6be2456d2a..91a609ccf2 100644 --- a/Code/Editor/Core/LevelEditorMenuHandler.cpp +++ b/Code/Editor/Core/LevelEditorMenuHandler.cpp @@ -104,6 +104,11 @@ namespace } } + // Currently (December 13, 2021), this function is only used by slice editor code. + // When the slice editor is not enabled, there are no references to the + // HideActionWhileEntitiesDeselected function, causing a compiler warning and + // subsequently a build error. +#ifdef ENABLE_SLICE_EDITOR void HideActionWhileEntitiesDeselected(QAction* action, EEditorNotifyEvent editorNotifyEvent) { if (action == nullptr) @@ -127,6 +132,7 @@ namespace break; } } +#endif void DisableActionWhileInSimMode(QAction* action, EEditorNotifyEvent editorNotifyEvent) { From 0216d0ae9f75927491feab2effa0e2273374fbc3 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Mon, 13 Dec 2021 09:11:06 -0800 Subject: [PATCH 097/948] Clarify shared string semantics Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 16 +++++----- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 30 +++++++------------ .../AzCore/AzCore/DOM/DomValueWriter.cpp | 2 +- .../AzCore/AzCore/DOM/DomValueWriter.h | 2 +- .../AzCore/AzCore/DOM/DomVisitor.cpp | 2 +- Code/Framework/AzCore/AzCore/DOM/DomVisitor.h | 11 +++++-- 6 files changed, 30 insertions(+), 33 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index 59e21a7d8b..72eb7ebadd 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -61,7 +61,7 @@ namespace AZ::Dom return m_children; } - Value::Value(AZStd::shared_ptr string) + Value::Value(AZStd::shared_ptr string) : m_value(string) { } @@ -233,7 +233,7 @@ namespace AZ::Dom case 4: // bool return AZStd::get(m_value) ? Type::True : Type::False; case 5: // AZStd::string_view - case 6: // AZStd::shared_ptr + case 6: // AZStd::shared_ptr case 7: // ShortStringType return Type::String; case 8: // ObjectPtr @@ -900,7 +900,7 @@ namespace AZ::Dom m_value = aznumeric_cast(value); } - void Value::SetString(AZStd::shared_ptr string) + void Value::SetString(AZStd::shared_ptr string) { m_value = string; } @@ -911,8 +911,8 @@ namespace AZ::Dom { case 5: // AZStd::string_view return AZStd::get(m_value); - case 6: // AZStd::shared_ptr - return *AZStd::get>(m_value); + case 6: // AZStd::shared_ptr + return *AZStd::get>(m_value); case 7: // ShortStringType { const ShortStringType& ShortString = AZStd::get(m_value); @@ -948,7 +948,7 @@ namespace AZ::Dom } else { - m_value = AZStd::allocate_shared(AZStdAlloc(), value); + m_value = AZStd::allocate_shared(AZStdAlloc(), value); } } @@ -1000,7 +1000,7 @@ namespace AZ::Dom { result = visitor.String(arg, copyStrings ? Lifetime::Temporary : Lifetime::Persistent); } - else if constexpr (AZStd::is_same_v>) + else if constexpr (AZStd::is_same_v>) { result = visitor.RefCountedString(arg, copyStrings ? Lifetime::Temporary : Lifetime::Persistent); } @@ -1096,7 +1096,7 @@ namespace AZ::Dom if (IsString() && other.IsString()) { // If we both hold the same ref counted string we don't need to do a full comparison - if (AZStd::holds_alternative>(m_value) && m_value == other.m_value) + if (AZStd::holds_alternative>(m_value) && m_value == other.m_value) { return true; } diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index 4b09068ec4..1a09b9a3c8 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -39,8 +39,7 @@ namespace AZ::Dom }; //! The allocator used by Value. - //! Value heap allocates shared_ptrs for its container storage (Array / Object / Node) alongside the vector - //! contents of its container storage. + //! Value heap allocates shared_ptrs for its container storage (Array / Object / Node) alongside class ValueAllocator final : public SimpleSchemaAllocator { public: @@ -131,7 +130,7 @@ namespace AZ::Dom Value(const Value&); Value(Value&&) noexcept; Value(AZStd::string_view string, bool copy); - Value(AZStd::shared_ptr string); + Value(AZStd::shared_ptr string); Value(int32_t value); Value(uint32_t value); @@ -242,10 +241,6 @@ namespace AZ::Dom const Array::ContainerType& GetArray() const; // Node API (supports both object + array API, plus a dedicated NodeName)... - // bool CanConvertToNodeFromObject() const; - // Value& ConvertToNodeFromObject(); - // Value& ConvertToObjectFromNode(); - void SetNode(AZ::Name name); void SetNode(AZStd::string_view name); @@ -282,14 +277,14 @@ namespace AZ::Dom float GetFloat() const; void SetFloat(float); - // string API... + // String API... AZStd::string_view GetString() const; size_t GetStringLength() const; void SetString(AZStd::string_view); - void SetString(AZStd::shared_ptr); + void SetString(AZStd::shared_ptr); void CopyFromString(AZStd::string_view); - // opaque type API... + // Opaque type API... AZStd::any& GetOpaqueValue() const; //! This sets this Value to represent a value of an type that the DOM has //! no formal knowledge of. Where possible, it should be preferred to @@ -298,10 +293,10 @@ namespace AZ::Dom //! values. void SetOpaqueValue(AZStd::any&); - // null API... + // Null API... void SetNull(); - // Visitor API + // Visitor API... Visitor::Result Accept(Visitor& visitor, bool copyStrings) const; AZStd::unique_ptr GetWriteHandler(); @@ -330,12 +325,9 @@ namespace AZ::Dom } }; - // If using the the copy on write model, anything stored internally as a shared_ptr will - // detach and copy when doing a mutating operation if use_count() > 1. - - // This internal storage will not have a 1:1 mapping to the public Type, as there may be - // multiple storage options (e.g. strings being stored as non-owning string_view or - // owning shared_ptr) + //! The internal storage type for Value. + //! These types do not correspond one-to-one with the Value's external Type as there may be multiple storage classes + //! for the same type in some instances, such as string storage using ValueType = AZStd::variant< // NullType AZStd::monostate, @@ -347,7 +339,7 @@ namespace AZ::Dom bool, // StringType AZStd::string_view, - AZStd::shared_ptr, + AZStd::shared_ptr, ShortStringType, // ObjectType ObjectPtr, diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp index 3e48c097c8..ef99809290 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp @@ -68,7 +68,7 @@ namespace AZ::Dom return FinishWrite(); } - Visitor::Result ValueWriter::RefCountedString(AZStd::shared_ptr value, [[maybe_unused]] Lifetime lifetime) + Visitor::Result ValueWriter::RefCountedString(AZStd::shared_ptr value, [[maybe_unused]] Lifetime lifetime) { CurrentValue().SetString(value); return FinishWrite(); diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h index 4c1d5a26ee..6086ff4fe5 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h @@ -26,7 +26,7 @@ namespace AZ::Dom Result Double(double value) override; Result String(AZStd::string_view value, Lifetime lifetime) override; - Result RefCountedString(AZStd::shared_ptr value, Lifetime lifetime) override; + Result RefCountedString(AZStd::shared_ptr value, Lifetime lifetime) override; Result StartObject() override; Result EndObject(AZ::u64 attributeCount) override; Result Key(AZ::Name key) override; diff --git a/Code/Framework/AzCore/AzCore/DOM/DomVisitor.cpp b/Code/Framework/AzCore/AzCore/DOM/DomVisitor.cpp index af64c4cea8..5e3d6c2882 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomVisitor.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomVisitor.cpp @@ -105,7 +105,7 @@ namespace AZ::Dom return VisitorSuccess(); } - Visitor::Result Visitor::RefCountedString(AZStd::shared_ptr value, Lifetime lifetime) + Visitor::Result Visitor::RefCountedString(AZStd::shared_ptr value, Lifetime lifetime) { return String(*value, lifetime); } diff --git a/Code/Framework/AzCore/AzCore/DOM/DomVisitor.h b/Code/Framework/AzCore/AzCore/DOM/DomVisitor.h index 3439a566e2..938df1bb5a 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomVisitor.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomVisitor.h @@ -168,10 +168,15 @@ namespace AZ::Dom virtual Result Uint64(AZ::u64 value); //! Operates on a double precision, 64 bit floating point value. virtual Result Double(double value); - //! Operates on a string value. As strings are a reference type. - //! Storage semantics are provided to indicate where the value may be stored persistently or requires a copy. + //! Operates on a string value. As strings are a reference type, + //! storage semantics are provided to indicate where the value may be stored persistently or requires a copy. + //! \param lifetime Specifies the lifetime of this string - if the string has a temporary lifetime, it cannot + //! safely be stored as a reference. virtual Result String(AZStd::string_view value, Lifetime lifetime); - virtual Result RefCountedString(AZStd::shared_ptr value, Lifetime lifetime); + //! Operates on a ref-counted string value. S + //! \param lifetime Specifies the lifetime of this string. If the string has a temporary lifetime, it may not + //! be safely stored as a reference, but may still be safely stored as a ref-counted shared_ptr. + virtual Result RefCountedString(AZStd::shared_ptr value, Lifetime lifetime); //! Operates on an opaque value. As opaque values are a reference type, storage semantics are provided to //! indicate where the value may be stored persistently or requires a copy. //! The base implementation of OpaqueValue rejects the operation, as opaque values are meant for special From 3bca63bb7187d640928505d1662c395afb9c4894 Mon Sep 17 00:00:00 2001 From: Guthrie Adams Date: Sat, 11 Dec 2021 15:50:37 -0600 Subject: [PATCH 098/948] Temporary fix for material component losing image overrides with prefabs The bug reported that overridden texture properties would be lost whenever an entity was created, destroyed, or a prefab was created. Initially, it seemed like there was a problem with the custom JSON serializer for material properties. Debugging proved this to be incorrect because all of the data was converted to JSON values in the serializer on multiple passes. At some point during prefab patching, the data for the asset properties is lost while other values like colors and floats serialize correctly. Converting the asset data values into asset IDs resolves the immediate problem for the material component but the underlying issue is still under investigation by the prefab team. This change is being posted for review in case the underlying issue cannot be resolved in time for the next release. Signed-off-by: Guthrie Adams Fixing unittests and moving texture conversion into material component controller Signed-off-by: Guthrie Adams --- .../Material/MaterialAssignmentSerializer.cpp | 24 ++++++++++---- .../Material/MaterialAssignmentSerializer.h | 18 +++++++--- .../Code/Source/Util/MaterialPropertyUtil.cpp | 12 ++++--- .../Material/MaterialComponentController.cpp | 33 +++++++++++++++++++ .../Material/MaterialComponentController.h | 5 +++ 5 files changed, 76 insertions(+), 16 deletions(-) diff --git a/Gems/Atom/Feature/Common/Code/Source/Material/MaterialAssignmentSerializer.cpp b/Gems/Atom/Feature/Common/Code/Source/Material/MaterialAssignmentSerializer.cpp index b757e4bd7e..85dc26089f 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Material/MaterialAssignmentSerializer.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/Material/MaterialAssignmentSerializer.cpp @@ -16,7 +16,9 @@ namespace AZ AZ_CLASS_ALLOCATOR_IMPL(JsonMaterialAssignmentSerializer, AZ::SystemAllocator, 0); JsonSerializationResult::Result JsonMaterialAssignmentSerializer::Load( - void* outputValue, [[maybe_unused]] const Uuid& outputValueTypeId, const rapidjson::Value& inputValue, + void* outputValue, + [[maybe_unused]] const Uuid& outputValueTypeId, + const rapidjson::Value& inputValue, JsonDeserializerContext& context) { namespace JSR = JsonSerializationResult; @@ -62,6 +64,7 @@ namespace AZ LoadAny(propertyValue, inputPropertyPair.value, context, result) || LoadAny(propertyValue, inputPropertyPair.value, context, result) || LoadAny(propertyValue, inputPropertyPair.value, context, result) || + LoadAny>(propertyValue, inputPropertyPair.value, context, result) || LoadAny>(propertyValue, inputPropertyPair.value, context, result) || LoadAny>(propertyValue, inputPropertyPair.value, context, result)) { @@ -78,7 +81,10 @@ namespace AZ } JsonSerializationResult::Result JsonMaterialAssignmentSerializer::Store( - rapidjson::Value& outputValue, const void* inputValue, const void* defaultValue, [[maybe_unused]] const Uuid& valueTypeId, + rapidjson::Value& outputValue, + const void* inputValue, + const void* defaultValue, + [[maybe_unused]] const Uuid& valueTypeId, JsonSerializerContext& context) { namespace JSR = AZ::JsonSerializationResult; @@ -138,9 +144,9 @@ namespace AZ StoreAny(propertyValue, outputPropertyValue, context, result) || StoreAny(propertyValue, outputPropertyValue, context, result) || StoreAny(propertyValue, outputPropertyValue, context, result) || + StoreAny>(propertyValue, outputPropertyValue, context, result) || StoreAny>(propertyValue, outputPropertyValue, context, result) || - StoreAny>( - propertyValue, outputPropertyValue, context, result)) + StoreAny>(propertyValue, outputPropertyValue, context, result)) { outputPropertyValueContainer.AddMember( rapidjson::Value::StringRefType(propertyName.GetCStr()), outputPropertyValue, @@ -164,7 +170,9 @@ namespace AZ template bool JsonMaterialAssignmentSerializer::LoadAny( - AZStd::any& propertyValue, const rapidjson::Value& inputPropertyValue, AZ::JsonDeserializerContext& context, + AZStd::any& propertyValue, + const rapidjson::Value& inputPropertyValue, + AZ::JsonDeserializerContext& context, AZ::JsonSerializationResult::ResultCode& result) { if (inputPropertyValue.IsObject() && inputPropertyValue.HasMember("Value") && inputPropertyValue.HasMember("$type")) @@ -187,7 +195,9 @@ namespace AZ template bool JsonMaterialAssignmentSerializer::StoreAny( - const AZStd::any& propertyValue, rapidjson::Value& outputPropertyValue, AZ::JsonSerializerContext& context, + const AZStd::any& propertyValue, + rapidjson::Value& outputPropertyValue, + AZ::JsonSerializerContext& context, AZ::JsonSerializationResult::ResultCode& result) { if (propertyValue.is()) @@ -199,7 +209,7 @@ namespace AZ result.Combine(StoreTypeId(typeValue, azrtti_typeid(), context)); outputPropertyValue.AddMember("$type", typeValue, context.GetJsonAllocator()); - T value = AZStd::any_cast(propertyValue); + const T& value = AZStd::any_cast(propertyValue); result.Combine( ContinueStoringToJsonObjectField(outputPropertyValue, "Value", &value, nullptr, azrtti_typeid(), context)); return true; diff --git a/Gems/Atom/Feature/Common/Code/Source/Material/MaterialAssignmentSerializer.h b/Gems/Atom/Feature/Common/Code/Source/Material/MaterialAssignmentSerializer.h index e92d756639..069b4d4cdb 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Material/MaterialAssignmentSerializer.h +++ b/Gems/Atom/Feature/Common/Code/Source/Material/MaterialAssignmentSerializer.h @@ -25,21 +25,31 @@ namespace AZ AZ_CLASS_ALLOCATOR_DECL; JsonSerializationResult::Result Load( - void* outputValue, const Uuid& outputValueTypeId, const rapidjson::Value& inputValue, + 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, + rapidjson::Value& outputValue, + const void* inputValue, + const void* defaultValue, + const Uuid& valueTypeId, JsonSerializerContext& context) override; private: template bool LoadAny( - AZStd::any& propertyValue, const rapidjson::Value& inputPropertyValue, AZ::JsonDeserializerContext& context, + AZStd::any& propertyValue, + const rapidjson::Value& inputPropertyValue, + AZ::JsonDeserializerContext& context, AZ::JsonSerializationResult::ResultCode& result); + template bool StoreAny( - const AZStd::any& propertyValue, rapidjson::Value& outputPropertyValue, AZ::JsonSerializerContext& context, + const AZStd::any& propertyValue, + rapidjson::Value& outputPropertyValue, + AZ::JsonSerializerContext& context, AZ::JsonSerializationResult::ResultCode& result); }; } // namespace Render diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Util/MaterialPropertyUtil.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Util/MaterialPropertyUtil.cpp index 3ffd8efa6e..2ad4522094 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Util/MaterialPropertyUtil.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Util/MaterialPropertyUtil.cpp @@ -33,11 +33,13 @@ namespace AtomToolsFramework { if (value.Is>()) { - const AZ::Data::Asset& imageAsset = value.GetValue>(); - return AZStd::any(AZ::Data::Asset( - imageAsset.GetId(), - azrtti_typeid(), - imageAsset.GetHint())); + const auto& imageAsset = value.GetValue>(); + return AZStd::any(AZ::Data::Asset(imageAsset.GetId(), azrtti_typeid(), imageAsset.GetHint())); + } + else if (value.Is>()) + { + const auto& image = value.GetValue>(); + return AZStd::any(AZ::Data::Asset(image->GetAssetId(), azrtti_typeid())); } return AZ::RPI::MaterialPropertyValue::ToAny(value); diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/MaterialComponentController.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/MaterialComponentController.cpp index 0ccdae28de..996a575c69 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/MaterialComponentController.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/MaterialComponentController.cpp @@ -104,6 +104,7 @@ namespace AZ MaterialComponentController::MaterialComponentController(const MaterialComponentConfig& config) : m_configuration(config) { + ConvertAssetsForSerialization(); } void MaterialComponentController::Activate(EntityId entityId) @@ -135,6 +136,7 @@ namespace AZ void MaterialComponentController::SetConfiguration(const MaterialComponentConfig& config) { m_configuration = config; + ConvertAssetsForSerialization(); } const MaterialComponentConfig& MaterialComponentController::GetConfiguration() const @@ -338,6 +340,7 @@ namespace AZ // before LoadMaterials() is called [LYN-2249] auto temp = m_configuration.m_materials; m_configuration.m_materials = materials; + ConvertAssetsForSerialization(); LoadMaterials(); } @@ -489,6 +492,7 @@ namespace AZ auto& materialAssignment = m_configuration.m_materials[materialAssignmentId]; const bool wasEmpty = materialAssignment.m_propertyOverrides.empty(); materialAssignment.m_propertyOverrides[AZ::Name(propertyName)] = value; + ConvertAssetsForSerialization(); if (materialAssignment.RequiresLoading()) { @@ -586,6 +590,7 @@ namespace AZ auto& materialAssignment = m_configuration.m_materials[materialAssignmentId]; const bool wasEmpty = materialAssignment.m_propertyOverrides.empty(); materialAssignment.m_propertyOverrides = propertyOverrides; + ConvertAssetsForSerialization(); if (materialAssignment.RequiresLoading()) { @@ -667,5 +672,33 @@ namespace AZ TickBus::Handler::BusConnect(); } } + + void MaterialComponentController::ConvertAssetsForSerialization() + { + for (auto& materialAssignmentPair : m_configuration.m_materials) + { + MaterialAssignment& materialAssignment = materialAssignmentPair.second; + for (auto& propertyPair : materialAssignment.m_propertyOverrides) + { + auto& value = propertyPair.second; + if (value.is>()) + { + value = AZStd::any_cast>(value).GetId(); + } + else if (value.is>()) + { + value = AZStd::any_cast>(value).GetId(); + } + else if (value.is>()) + { + value = AZStd::any_cast>(value).GetId(); + } + else if (value.is>()) + { + value = AZStd::any_cast>(value)->GetAssetId(); + } + } + } + } } // namespace Render } // namespace AZ diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/MaterialComponentController.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/MaterialComponentController.h index 74b1cfda4d..d3eaa4433d 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/MaterialComponentController.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/MaterialComponentController.h @@ -99,6 +99,11 @@ namespace AZ //! Queue material instance recreation notifiucations until tick void QueueMaterialUpdateNotification(); + //! Converts property overrides storing image asset references into asset IDs. This addresses a problem where image property + //! overrides are lost during prefab serialization and patching. This suboptimal function will be removed once the underlying + //! problem is resolved. + void ConvertAssetsForSerialization(); + EntityId m_entityId; MaterialComponentConfig m_configuration; AZStd::unordered_set m_materialsWithDirtyProperties; From b0ef83e194a4d149e9402c87fe23243af628ea79 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Thu, 2 Dec 2021 10:31:51 -0800 Subject: [PATCH 099/948] Delete $tmp29198_Test_LY_79396.scriptcanvas Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../$tmp29198_Test_LY_79396.scriptcanvas | 69 ------------------- 1 file changed, 69 deletions(-) delete mode 100644 Gems/ScriptCanvasTesting/Assets/ScriptCanvas/Tests/$tmp29198_Test_LY_79396.scriptcanvas diff --git a/Gems/ScriptCanvasTesting/Assets/ScriptCanvas/Tests/$tmp29198_Test_LY_79396.scriptcanvas b/Gems/ScriptCanvasTesting/Assets/ScriptCanvas/Tests/$tmp29198_Test_LY_79396.scriptcanvas deleted file mode 100644 index 278d74c28d..0000000000 --- a/Gems/ScriptCanvasTesting/Assets/ScriptCanvas/Tests/$tmp29198_Test_LY_79396.scriptcanvas +++ /dev/null @@ -1,69 +0,0 @@ -{ - "Type": "JsonSerialization", - "Version": 1, - "ClassName": "ScriptCanvasData", - "ClassData": { - "m_scriptCanvas": { - "Id": { - "id": 32884619828465 - }, - "Name": "Script Canvas Graph", - "Components": { - "Component_[14322649685925277086]": { - "$type": "EditorGraphVariableManagerComponent", - "Id": 14322649685925277086, - "m_variableData": { - "m_nameVariableMap": [ - { - "Key": { - "m_id": "{142C0457-38E5-496E-A4F2-67E91852CBCB}" - }, - "Value": { - "Datum": { - "isOverloadedStorage": false, - "scriptCanvasType": { - "m_type": 4, - "m_azType": "{5CBE5640-DF5C-5A49-9195-D790881A0747}" - }, - "isNullPointer": false, - "$type": "{5CBE5640-DF5C-5A49-9195-D790881A0747} AZStd::vector", - "value": [ - [ - 0.0, - 0.0, - -498814079205376.0, - 0.0 - ], - [ - 0.0, - 0.0, - 1.1865528051967005e38, - 0.0 - ] - ], - "label": "Variable 7" - }, - "VariableId": { - "m_id": "{142C0457-38E5-496E-A4F2-67E91852CBCB}" - }, - "VariableName": "Variable 7" - } - }, - { - "Key": { - "m_id": "{21DD2B3D-ADC9-46E1-B44C-965A6E2AE543}" - }, - "Value": { - "Datum": { - "isOverloadedStorage": false, - "scriptCanvasType": { - "m_type": 4, - "m_azType": "{9ABF5933-C8FC-53CD-A518-B6AF433CF496}" - }, - "isNullPointer": false, - "$type": "{9ABF5933-C8FC-53CD-A518-B6AF433CF496} AZStd::unordered_map", - "value": [ - { - "Key": true, - "Value": { - "roll": \ No newline at end of file From d31c6a27744b56c63c6811a7c67d446f12faa96a Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Thu, 2 Dec 2021 13:08:03 -0800 Subject: [PATCH 100/948] remove uneeded files/comments Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Builder/ScriptCanvasBuilderWorker.cpp | 1 - .../Code/Builder/ScriptCanvasBuilderWorker.h | 2 +- .../ScriptCanvas/Assets/ScriptCanvasFileHandling.h | 1 - .../Assets/ScriptCanvasSourceFileHandle.cpp | 9 --------- .../ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.h | 10 ---------- .../ScriptCanvas/Code/Editor/View/Windows/MainWindow.h | 1 - .../Code/scriptcanvasgem_editor_files.cmake | 2 -- 7 files changed, 1 insertion(+), 25 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.cpp delete mode 100644 Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.h diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp index bf98e62b71..ac7bd4406a 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h index 77b90df3e0..817fe5d294 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h @@ -59,7 +59,7 @@ namespace ScriptCanvasBuilder PrefabIntegration, CorrectGraphVariableVersion, ReflectEntityIdNodes, - FixExecutionStateNodeableConstrution, + FixExecutionStateNodeableConstruction, // add new entries above Current, diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h index dd0e7aeb62..bd3d2b9f0a 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h @@ -12,7 +12,6 @@ #include #include #include -#include namespace AZ { diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.cpp b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.cpp deleted file mode 100644 index 258a862a19..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.cpp +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#include diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.h deleted file mode 100644 index 1d14b9b21b..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.h +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#pragma once - diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h index 80117b84fe..fed4f28f4f 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h @@ -43,7 +43,6 @@ #include #include #include -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake index 449298097f..77ccf7fda9 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake @@ -28,8 +28,6 @@ set(FILES Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetBus.h Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetTypes.h Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h - Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.h - Editor/Include/ScriptCanvas/Assets/ScriptCanvasSourceFileHandle.cpp Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetHandler.h Editor/Assets/ScriptCanvasFileHandling.cpp Editor/Assets/ScriptCanvasAssetHandler.cpp From 0cc4c062131fa87d6aa5c541fc23d8dd91286dcd Mon Sep 17 00:00:00 2001 From: chcurran <82187351+carlitosan@users.noreply.github.com> Date: Thu, 2 Dec 2021 13:08:34 -0800 Subject: [PATCH 101/948] remove uneeded files/comments Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com> --- .../Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h index be8f274cd6..a969187743 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h @@ -387,7 +387,7 @@ namespace ScriptCanvasEditor bool m_saveFormatConverted = true; ScriptCanvasEditor::SourceHandle m_assetId; - // #sc_editor_asset temporary step in cleaning up the graph / asset class structure. This reference is deliberately weak. + // temporary step in cleaning up the graph / asset class structure. This reference is deliberately weak. ScriptCanvas::ScriptCanvasData* m_owner; }; } From 07bf8fc7550684fc378385aceac14ead6e1e3931 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Thu, 2 Dec 2021 16:02:29 -0800 Subject: [PATCH 102/948] fix linux build error Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp | 3 +-- Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.h | 1 - Gems/ScriptCanvas/Code/Editor/View/Widgets/CanvasWidget.cpp | 3 --- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp index 01595e0702..992b33889b 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp @@ -19,8 +19,7 @@ namespace ScriptCanvasEditor { ScriptCanvasMemoryAsset::ScriptCanvasMemoryAsset() - : m_isSaving(false) - , m_sourceInError(false) + : m_sourceInError(false) { m_undoState = AZStd::make_unique(this); } diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.h b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.h index 6eecc5e04f..45647eba1b 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.h +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.h @@ -321,7 +321,6 @@ namespace ScriptCanvasEditor //! The undo helper is an object that implements the Undo behaviors AZStd::unique_ptr m_undoHelper; - bool m_isSaving; bool m_sourceInError; AZ::Data::AssetId m_sourceUuid; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/CanvasWidget.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/CanvasWidget.cpp index 722e9d1c71..69fe4053fe 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/CanvasWidget.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/CanvasWidget.cpp @@ -70,11 +70,8 @@ namespace ScriptCanvasEditor { EditorGraphRequests* editorGraphRequests = EditorGraphRequestBus::FindFirstHandler(scriptCanvasId); editorGraphRequests->CreateGraphCanvasScene(); - AZ::EntityId graphCanvasSceneId = editorGraphRequests->GetGraphCanvasGraphId(); - m_graphicsView->SetScene(graphCanvasSceneId); - m_scriptCanvasId = scriptCanvasId; } From 4f00718a38c6b08b30a526b3217f6f105aab4fd3 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Thu, 2 Dec 2021 18:18:06 -0800 Subject: [PATCH 103/948] fix linux build error, change translation system errors to warnings Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- Gems/GraphCanvas/Code/Source/Translation/TranslationAsset.cpp | 2 +- .../Code/Source/Translation/TranslationSerializer.cpp | 2 +- Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Gems/GraphCanvas/Code/Source/Translation/TranslationAsset.cpp b/Gems/GraphCanvas/Code/Source/Translation/TranslationAsset.cpp index a461866c46..3b026b4579 100644 --- a/Gems/GraphCanvas/Code/Source/Translation/TranslationAsset.cpp +++ b/Gems/GraphCanvas/Code/Source/Translation/TranslationAsset.cpp @@ -195,7 +195,7 @@ namespace GraphCanvas } else { - AZ_Error("TranslationAsset", false, "Serialization of the TranslationFormat failed for: %s", asset.GetHint().c_str()); + AZ_Warning("TranslationAsset", false, "Serialization of the TranslationFormat failed for: %s", asset.GetHint().c_str()); } } } diff --git a/Gems/GraphCanvas/Code/Source/Translation/TranslationSerializer.cpp b/Gems/GraphCanvas/Code/Source/Translation/TranslationSerializer.cpp index 80e488f3dc..5f8d8bc3f1 100644 --- a/Gems/GraphCanvas/Code/Source/Translation/TranslationSerializer.cpp +++ b/Gems/GraphCanvas/Code/Source/Translation/TranslationSerializer.cpp @@ -146,7 +146,7 @@ namespace GraphCanvas AZStd::string baseKey = contextStr; if (keyStr.empty()) { - AZ_Error("TranslationDatabase", false, "Every entry in the Translation data must have a key: %s", baseKey.c_str()); + AZ_Warning("TranslationDatabase", false, "Every entry in the Translation data must have a key: %s", baseKey.c_str()); return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::Unsupported, "Every entry in the Translation data must have a key"); } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 06877a5659..146c563ea7 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -256,7 +256,6 @@ namespace ScriptCanvasEditor EditorSettings::EditorWorkspace::WorkspaceAssetSaveData assetSaveData; assetSaveData.m_assetId = sourceId; - ScriptCanvas::ScriptCanvasId scriptCanvasId = m_mainWindow->FindScriptCanvasIdByAssetId(assetId); activeAssets.push_back(assetSaveData); } } From b10c679c3347cd221cc52ca14b8ff3c9c3289b63 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Thu, 2 Dec 2021 19:55:27 -0800 Subject: [PATCH 104/948] fixed string_view printf error caught by linux compiler Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 146c563ea7..7a0834bb26 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -1571,7 +1571,7 @@ namespace ScriptCanvasEditor if (outTabIndex == -1) { - return AZ::Failure(AZStd::string::format("Script Canvas Asset %.*s is not open in a tab", assetPath.data())); + return AZ::Failure(AZStd::string::format("Script Canvas Asset %.*s is not open in a tab", assetPath.size(), assetPath.data())); } SetActiveAsset(handle); From 3e728d1183218968e7d096da534f8cdc87688686 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Thu, 2 Dec 2021 20:17:36 -0800 Subject: [PATCH 105/948] fixed another string_view printf error caught by linux compiler Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 7a0834bb26..fa13681879 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -1571,7 +1571,8 @@ namespace ScriptCanvasEditor if (outTabIndex == -1) { - return AZ::Failure(AZStd::string::format("Script Canvas Asset %.*s is not open in a tab", assetPath.size(), assetPath.data())); + return AZ::Failure(AZStd::string::format("Script Canvas Asset %.*s is not open in a tab" + , static_cast(assetPath.size()), assetPath.data())); } SetActiveAsset(handle); From b9bbe233be80c46afa40187d73c07061d445b4eb Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Mon, 6 Dec 2021 12:12:46 -0800 Subject: [PATCH 106/948] Restore undo/redo Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../Assets/ScriptCanvasFileHandling.cpp | 9 +++- .../Editor/Assets/ScriptCanvasMemoryAsset.cpp | 2 - .../Editor/Assets/ScriptCanvasUndoHelper.cpp | 48 +++++++++++++------ .../Editor/Assets/ScriptCanvasUndoHelper.h | 16 +++++-- .../Code/Editor/Components/EditorGraph.cpp | 1 + .../ScriptCanvas/Components/EditorGraph.h | 2 + .../Editor/Undo/ScriptCanvasGraphCommand.cpp | 14 +++--- .../Editor/Undo/ScriptCanvasGraphCommand.h | 8 ++-- .../Editor/Undo/ScriptCanvasUndoManager.cpp | 4 +- .../Editor/Undo/ScriptCanvasUndoManager.h | 1 + 10 files changed, 68 insertions(+), 37 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp index be909e5043..c4579c9042 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp @@ -252,11 +252,16 @@ namespace ScriptCanvasEditor AZ::u64 entityId = aznumeric_caster(ScriptCanvas::MathNodeUtilities::GetRandomIntegral(1, std::numeric_limits::max())); entity->SetId(AZ::EntityId(entityId)); - entity->Init(); - entity->Activate(); auto graph = entity->FindComponent(); graph->MarkOwnership(*scriptCanvasData); + + entity->Init(); + entity->Activate(); + } + else + { + return AZ::Failure(AZStd::string("Loaded script canvas file was missing a necessary Entity.")); } return AZ::Success(ScriptCanvasEditor::SourceHandle(scriptCanvasData, path)); diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp index 992b33889b..a20a6e54a1 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp @@ -278,8 +278,6 @@ namespace ScriptCanvasEditor EditorGraphNotificationBus::Handler::BusDisconnect(); EditorGraphNotificationBus::Handler::BusConnect(m_scriptCanvasId); - - m_undoHelper = AZStd::make_unique(*this); } ScriptCanvasEditor::Widget::CanvasWidget* ScriptCanvasMemoryAsset::CreateView(QWidget* /*parent*/) diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.cpp index 388da67987..31bdf0077c 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.cpp @@ -9,13 +9,19 @@ #include "ScriptCanvasUndoHelper.h" #include "ScriptCanvasMemoryAsset.h" #include +#include namespace ScriptCanvasEditor { - UndoHelper::UndoHelper(ScriptCanvasMemoryAsset& memoryAsset) - : m_memoryAsset(memoryAsset) + UndoHelper::UndoHelper() + : m_undoState(this) { - UndoRequestBus::Handler::BusConnect(memoryAsset.GetScriptCanvasId()); + } + + UndoHelper::UndoHelper(SourceHandle memoryAsset) + : m_undoState(this) + { + SetSource(memoryAsset); } UndoHelper::~UndoHelper() @@ -23,15 +29,21 @@ namespace ScriptCanvasEditor UndoRequestBus::Handler::BusDisconnect(); } + void UndoHelper::SetSource(SourceHandle source) + { + m_memoryAsset = source; + UndoRequestBus::Handler::BusConnect(source.Get()->GetScriptCanvasId()); + } + ScriptCanvasEditor::UndoCache* UndoHelper::GetSceneUndoCache() { - return m_memoryAsset.GetUndoState()->m_undoCache.get(); + return m_undoState.m_undoCache.get(); } ScriptCanvasEditor::UndoData UndoHelper::CreateUndoData() { - AZ::EntityId graphCanvasGraphId = m_memoryAsset.GetGraphId(); - ScriptCanvas::ScriptCanvasId scriptCanvasId = m_memoryAsset.GetScriptCanvasId(); + AZ::EntityId graphCanvasGraphId = m_memoryAsset.Get()->GetGraphCanvasGraphId(); + ScriptCanvas::ScriptCanvasId scriptCanvasId = m_memoryAsset.Get()->GetScriptCanvasId(); GraphCanvas::GraphModelRequestBus::Event(graphCanvasGraphId, &GraphCanvas::GraphModelRequests::OnSaveDataDirtied, graphCanvasGraphId); @@ -56,17 +68,17 @@ namespace ScriptCanvasEditor void UndoHelper::BeginUndoBatch(AZStd::string_view label) { - m_memoryAsset.GetUndoState()->BeginUndoBatch(label); + m_undoState.BeginUndoBatch(label); } void UndoHelper::EndUndoBatch() { - m_memoryAsset.GetUndoState()->EndUndoBatch(); + m_undoState.EndUndoBatch(); } void UndoHelper::AddUndo(AzToolsFramework::UndoSystem::URSequencePoint* sequencePoint) { - if (SceneUndoState* sceneUndoState = m_memoryAsset.GetUndoState()) + if (SceneUndoState* sceneUndoState = &m_undoState) { if (!sceneUndoState->m_currentUndoBatch) { @@ -105,7 +117,7 @@ namespace ScriptCanvasEditor { AZ_PROFILE_FUNCTION(ScriptCanvas); - SceneUndoState* sceneUndoState = m_memoryAsset.GetUndoState(); + SceneUndoState* sceneUndoState = &m_undoState; if (sceneUndoState) { AZ_Warning("Script Canvas", !sceneUndoState->m_currentUndoBatch, "Script Canvas Editor has an open undo batch when performing a redo operation"); @@ -125,7 +137,7 @@ namespace ScriptCanvasEditor { AZ_PROFILE_FUNCTION(ScriptCanvas); - SceneUndoState* sceneUndoState = m_memoryAsset.GetUndoState(); + SceneUndoState* sceneUndoState = &m_undoState; if (sceneUndoState) { AZ_Warning("Script Canvas", !sceneUndoState->m_currentUndoBatch, "Script Canvas Editor has an open undo batch when performing a redo operation"); @@ -143,7 +155,7 @@ namespace ScriptCanvasEditor void UndoHelper::Reset() { - if (SceneUndoState* sceneUndoState = m_memoryAsset.GetUndoState()) + if (SceneUndoState* sceneUndoState = &m_undoState) { AZ_Warning("Script Canvas", !sceneUndoState->m_currentUndoBatch, "Script Canvas Editor has an open undo batch when resetting the undo stack"); sceneUndoState->m_undoStack->Reset(); @@ -162,17 +174,23 @@ namespace ScriptCanvasEditor bool UndoHelper::CanUndo() const { - return m_memoryAsset.GetUndoState()->m_undoStack->CanUndo(); + return m_undoState.m_undoStack->CanUndo(); } bool UndoHelper::CanRedo() const { - return m_memoryAsset.GetUndoState()->m_undoStack->CanRedo(); + return m_undoState.m_undoStack->CanRedo(); + } + + void UndoHelper::OnUndoStackChanged() + { + UndoNotificationBus::Broadcast(&UndoNotifications::OnCanUndoChanged, m_undoState.m_undoStack->CanUndo()); + UndoNotificationBus::Broadcast(&UndoNotifications::OnCanRedoChanged, m_undoState.m_undoStack->CanRedo()); } void UndoHelper::UpdateCache() { - ScriptCanvas::ScriptCanvasId scriptCanvasId = m_memoryAsset.GetScriptCanvasId(); + ScriptCanvas::ScriptCanvasId scriptCanvasId = m_memoryAsset.Get()->GetScriptCanvasId(); UndoCache* undoCache = nullptr; UndoRequestBus::EventResult(undoCache, scriptCanvasId, &UndoRequests::GetSceneUndoCache); diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.h b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.h index 7bf5c8b630..3652b07686 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.h +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.h @@ -8,22 +8,27 @@ #pragma once #include +#include namespace ScriptCanvasEditor { - class ScriptCanvasMemoryAsset; // Helper class that provides the implementation for UndoRequestBus - class UndoHelper : UndoRequestBus::Handler + class UndoHelper + : public UndoRequestBus::Handler + , public AzToolsFramework::UndoSystem::IUndoNotify { public: - UndoHelper(ScriptCanvasMemoryAsset& memoryAsset); + UndoHelper(); + UndoHelper(SourceHandle source); ~UndoHelper(); UndoCache* GetSceneUndoCache() override; UndoData CreateUndoData() override; + void SetSource(SourceHandle source); + void BeginUndoBatch(AZStd::string_view label) override; void EndUndoBatch() override; void AddUndo(AzToolsFramework::UndoSystem::URSequencePoint* seqPoint) override; @@ -41,6 +46,7 @@ namespace ScriptCanvasEditor bool CanRedo() const override; private: + void OnUndoStackChanged() override; void UpdateCache(); @@ -51,7 +57,7 @@ namespace ScriptCanvasEditor }; Status m_status = Status::Idle; - - ScriptCanvasMemoryAsset& m_memoryAsset; + SceneUndoState m_undoState; + SourceHandle m_memoryAsset; }; } diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp index 79621bbddb..a46b2a4a5c 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp @@ -1067,6 +1067,7 @@ namespace ScriptCanvasEditor void Graph::MarkOwnership(ScriptCanvas::ScriptCanvasData& owner) { m_owner = &owner; + m_undoHelper.SetSource(SourceHandle(GetOwnership(), {}, "")); } ScriptCanvas::DataPtr Graph::GetOwnership() const diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h index a969187743..9157aaeac9 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h @@ -34,6 +34,7 @@ #include #include +#include namespace ScriptCanvas { @@ -380,6 +381,7 @@ namespace ScriptCanvasEditor GraphCanvas::NodeFocusCyclingHelper m_focusHelper; GraphStatisticsHelper m_statisticsHelper; + UndoHelper m_undoHelper; bool m_ignoreSaveRequests; diff --git a/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.cpp b/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.cpp index 4e3e0c85ad..406e139ef1 100644 --- a/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.cpp @@ -11,6 +11,7 @@ #include #include +#include #include #include @@ -19,7 +20,6 @@ #include #include -#include namespace ScriptCanvasEditor { @@ -36,7 +36,7 @@ namespace ScriptCanvasEditor { } - void GraphItemCommand::Capture(ScriptCanvasMemoryAsset&, bool) + void GraphItemCommand::Capture(SourceHandle&, bool) { } @@ -105,10 +105,10 @@ namespace ScriptCanvasEditor RestoreItem(m_redoState); } - void GraphItemChangeCommand::Capture(ScriptCanvasMemoryAsset& memoryAsset, bool captureUndo) + void GraphItemChangeCommand::Capture(SourceHandle& memoryAsset, bool captureUndo) { - m_scriptCanvasId = memoryAsset.GetScriptCanvasId(); - m_graphCanvasGraphId = memoryAsset.GetGraphId(); + m_scriptCanvasId = memoryAsset.Get()->GetScriptCanvasId(); + m_graphCanvasGraphId = memoryAsset.Get()->GetGraphCanvasGraphId(); UndoCache* undoCache = nullptr; UndoRequestBus::EventResult(undoCache, m_scriptCanvasId, &UndoRequests::GetSceneUndoCache); @@ -204,7 +204,7 @@ namespace ScriptCanvasEditor RestoreItem(m_redoState); } - void GraphItemAddCommand::Capture(ScriptCanvasMemoryAsset& memoryAsset, bool) + void GraphItemAddCommand::Capture(SourceHandle& memoryAsset, bool) { GraphItemChangeCommand::Capture(memoryAsset, false); } @@ -225,7 +225,7 @@ namespace ScriptCanvasEditor RestoreItem(m_redoState); } - void GraphItemRemovalCommand::Capture(ScriptCanvasMemoryAsset& memoryAsset, bool) + void GraphItemRemovalCommand::Capture(SourceHandle& memoryAsset, bool) { GraphItemChangeCommand::Capture(memoryAsset, true); } diff --git a/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.h b/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.h index e0f5adde7e..61102f690c 100644 --- a/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.h +++ b/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.h @@ -46,7 +46,7 @@ namespace ScriptCanvasEditor void Undo() override; void Redo() override; - virtual void Capture(ScriptCanvasMemoryAsset& memoryAsset, bool captureUndo); + virtual void Capture(SourceHandle& memoryAsset, bool captureUndo); bool Changed() const override; @@ -76,7 +76,7 @@ namespace ScriptCanvasEditor void Undo() override; void Redo() override; - void Capture(ScriptCanvasMemoryAsset& memoryAsset, bool captureUndo) override; + void Capture(SourceHandle& memoryAsset, bool captureUndo) override; void RestoreItem(const AZStd::vector& restoreBuffer) override; @@ -103,7 +103,7 @@ namespace ScriptCanvasEditor void Undo() override; void Redo() override; - void Capture(ScriptCanvasMemoryAsset& memoryAsset, bool captureUndo) override; + void Capture(SourceHandle& memoryAsset, bool captureUndo) override; protected: GraphItemAddCommand(const GraphItemAddCommand&) = delete; @@ -124,7 +124,7 @@ namespace ScriptCanvasEditor void Undo() override; void Redo() override; - void Capture(ScriptCanvasMemoryAsset& memoryAsset, bool captureUndo) override; + void Capture(SourceHandle& memoryAsset, bool captureUndo) override; protected: GraphItemRemovalCommand(const GraphItemRemovalCommand&) = delete; diff --git a/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasUndoManager.cpp b/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasUndoManager.cpp index 4d24720227..5a01507352 100644 --- a/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasUndoManager.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasUndoManager.cpp @@ -28,9 +28,9 @@ namespace ScriptCanvasEditor // SceneUndoState SceneUndoState::SceneUndoState(AzToolsFramework::UndoSystem::IUndoNotify* undoNotify) - : m_undoStack(AZStd::make_unique(c_undoLimit, undoNotify)) - , m_undoCache(AZStd::make_unique()) { + m_undoStack = AZStd::make_unique(c_undoLimit, undoNotify); + m_undoCache = AZStd::make_unique(); } void SceneUndoState::BeginUndoBatch(AZStd::string_view label) diff --git a/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasUndoManager.h b/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasUndoManager.h index 52d7b1de3e..1d207e9408 100644 --- a/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasUndoManager.h +++ b/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasUndoManager.h @@ -61,6 +61,7 @@ namespace ScriptCanvasEditor public: AZ_CLASS_ALLOCATOR(SceneUndoState, AZ::SystemAllocator, 0); + SceneUndoState() = default; SceneUndoState(AzToolsFramework::UndoSystem::IUndoNotify* undoNotify); ~SceneUndoState(); From d8e531519961948ebab9f7d5e5731d4459649956 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Mon, 6 Dec 2021 13:37:29 -0800 Subject: [PATCH 107/948] Use weak reference for undo state, as it is an entirely internal class Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../Editor/Assets/ScriptCanvasUndoHelper.cpp | 24 +++++++++---------- .../Editor/Assets/ScriptCanvasUndoHelper.h | 6 ++--- .../Code/Editor/Components/EditorGraph.cpp | 2 +- .../Editor/Undo/ScriptCanvasGraphCommand.cpp | 16 ++++++------- .../Editor/Undo/ScriptCanvasGraphCommand.h | 8 +++---- 5 files changed, 28 insertions(+), 28 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.cpp index 31bdf0077c..f125a4cbc9 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.cpp @@ -18,10 +18,10 @@ namespace ScriptCanvasEditor { } - UndoHelper::UndoHelper(SourceHandle memoryAsset) + UndoHelper::UndoHelper(Graph* graph) : m_undoState(this) { - SetSource(memoryAsset); + SetSource(graph); } UndoHelper::~UndoHelper() @@ -29,10 +29,10 @@ namespace ScriptCanvasEditor UndoRequestBus::Handler::BusDisconnect(); } - void UndoHelper::SetSource(SourceHandle source) + void UndoHelper::SetSource(Graph* graph) { - m_memoryAsset = source; - UndoRequestBus::Handler::BusConnect(source.Get()->GetScriptCanvasId()); + m_graph = graph; + UndoRequestBus::Handler::BusConnect(graph->GetScriptCanvasId()); } ScriptCanvasEditor::UndoCache* UndoHelper::GetSceneUndoCache() @@ -42,8 +42,8 @@ namespace ScriptCanvasEditor ScriptCanvasEditor::UndoData UndoHelper::CreateUndoData() { - AZ::EntityId graphCanvasGraphId = m_memoryAsset.Get()->GetGraphCanvasGraphId(); - ScriptCanvas::ScriptCanvasId scriptCanvasId = m_memoryAsset.Get()->GetScriptCanvasId(); + AZ::EntityId graphCanvasGraphId = m_graph->GetGraphCanvasGraphId(); + ScriptCanvas::ScriptCanvasId scriptCanvasId = m_graph->GetScriptCanvasId(); GraphCanvas::GraphModelRequestBus::Event(graphCanvasGraphId, &GraphCanvas::GraphModelRequests::OnSaveDataDirtied, graphCanvasGraphId); @@ -94,22 +94,22 @@ namespace ScriptCanvasEditor void UndoHelper::AddGraphItemChangeUndo(AZStd::string_view undoLabel) { GraphItemChangeCommand* command = aznew GraphItemChangeCommand(undoLabel); - command->Capture(m_memoryAsset, true); - command->Capture(m_memoryAsset, false); + command->Capture(m_graph, true); + command->Capture(m_graph, false); AddUndo(command); } void UndoHelper::AddGraphItemAdditionUndo(AZStd::string_view undoLabel) { GraphItemAddCommand* command = aznew GraphItemAddCommand(undoLabel); - command->Capture(m_memoryAsset, false); + command->Capture(m_graph, false); AddUndo(command); } void UndoHelper::AddGraphItemRemovalUndo(AZStd::string_view undoLabel) { GraphItemRemovalCommand* command = aznew GraphItemRemovalCommand(undoLabel); - command->Capture(m_memoryAsset, true); + command->Capture(m_graph, true); AddUndo(command); } @@ -190,7 +190,7 @@ namespace ScriptCanvasEditor void UndoHelper::UpdateCache() { - ScriptCanvas::ScriptCanvasId scriptCanvasId = m_memoryAsset.Get()->GetScriptCanvasId(); + ScriptCanvas::ScriptCanvasId scriptCanvasId = m_graph->GetScriptCanvasId(); UndoCache* undoCache = nullptr; UndoRequestBus::EventResult(undoCache, scriptCanvasId, &UndoRequests::GetSceneUndoCache); diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.h b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.h index 3652b07686..e2d4f008fa 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.h +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.h @@ -21,13 +21,13 @@ namespace ScriptCanvasEditor public: UndoHelper(); - UndoHelper(SourceHandle source); + UndoHelper(Graph* source); ~UndoHelper(); UndoCache* GetSceneUndoCache() override; UndoData CreateUndoData() override; - void SetSource(SourceHandle source); + void SetSource(Graph* source); void BeginUndoBatch(AZStd::string_view label) override; void EndUndoBatch() override; @@ -58,6 +58,6 @@ namespace ScriptCanvasEditor Status m_status = Status::Idle; SceneUndoState m_undoState; - SourceHandle m_memoryAsset; + Graph* m_graph = nullptr; }; } diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp index a46b2a4a5c..b50457adbf 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp @@ -481,6 +481,7 @@ namespace ScriptCanvasEditor ScriptCanvas::Graph::Activate(); PostActivate(); + m_undoHelper.SetSource(this); } void Graph::Deactivate() @@ -1067,7 +1068,6 @@ namespace ScriptCanvasEditor void Graph::MarkOwnership(ScriptCanvas::ScriptCanvasData& owner) { m_owner = &owner; - m_undoHelper.SetSource(SourceHandle(GetOwnership(), {}, "")); } ScriptCanvas::DataPtr Graph::GetOwnership() const diff --git a/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.cpp b/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.cpp index 406e139ef1..944a5e667d 100644 --- a/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.cpp @@ -36,7 +36,7 @@ namespace ScriptCanvasEditor { } - void GraphItemCommand::Capture(SourceHandle&, bool) + void GraphItemCommand::Capture(Graph*, bool) { } @@ -105,10 +105,10 @@ namespace ScriptCanvasEditor RestoreItem(m_redoState); } - void GraphItemChangeCommand::Capture(SourceHandle& memoryAsset, bool captureUndo) + void GraphItemChangeCommand::Capture(Graph* graph, bool captureUndo) { - m_scriptCanvasId = memoryAsset.Get()->GetScriptCanvasId(); - m_graphCanvasGraphId = memoryAsset.Get()->GetGraphCanvasGraphId(); + m_scriptCanvasId = graph->GetScriptCanvasId(); + m_graphCanvasGraphId = graph->GetGraphCanvasGraphId(); UndoCache* undoCache = nullptr; UndoRequestBus::EventResult(undoCache, m_scriptCanvasId, &UndoRequests::GetSceneUndoCache); @@ -204,9 +204,9 @@ namespace ScriptCanvasEditor RestoreItem(m_redoState); } - void GraphItemAddCommand::Capture(SourceHandle& memoryAsset, bool) + void GraphItemAddCommand::Capture(Graph* graph, bool) { - GraphItemChangeCommand::Capture(memoryAsset, false); + GraphItemChangeCommand::Capture(graph, false); } //// Graph Item Removal Command @@ -225,8 +225,8 @@ namespace ScriptCanvasEditor RestoreItem(m_redoState); } - void GraphItemRemovalCommand::Capture(SourceHandle& memoryAsset, bool) + void GraphItemRemovalCommand::Capture(Graph* graph, bool) { - GraphItemChangeCommand::Capture(memoryAsset, true); + GraphItemChangeCommand::Capture(graph, true); } } diff --git a/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.h b/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.h index 61102f690c..b9435d0702 100644 --- a/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.h +++ b/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.h @@ -46,7 +46,7 @@ namespace ScriptCanvasEditor void Undo() override; void Redo() override; - virtual void Capture(SourceHandle& memoryAsset, bool captureUndo); + virtual void Capture(Graph* graph, bool captureUndo); bool Changed() const override; @@ -76,7 +76,7 @@ namespace ScriptCanvasEditor void Undo() override; void Redo() override; - void Capture(SourceHandle& memoryAsset, bool captureUndo) override; + void Capture(Graph* graph, bool captureUndo) override; void RestoreItem(const AZStd::vector& restoreBuffer) override; @@ -103,7 +103,7 @@ namespace ScriptCanvasEditor void Undo() override; void Redo() override; - void Capture(SourceHandle& memoryAsset, bool captureUndo) override; + void Capture(Graph* graph, bool captureUndo) override; protected: GraphItemAddCommand(const GraphItemAddCommand&) = delete; @@ -124,7 +124,7 @@ namespace ScriptCanvasEditor void Undo() override; void Redo() override; - void Capture(SourceHandle& memoryAsset, bool captureUndo) override; + void Capture(Graph* graph, bool captureUndo) override; protected: GraphItemRemovalCommand(const GraphItemRemovalCommand&) = delete; From d284d908b9409df175207de45dba3eb41ff93b35 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Wed, 8 Dec 2021 16:11:38 -0800 Subject: [PATCH 108/948] Make version explorer wait on AP for dependent assets Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../Builder/ScriptCanvasBuilderWorker.cpp | 3 +- ...ntReceiverEventNodeDescriptorComponent.cpp | 2 +- .../Code/Editor/View/Windows/MainWindow.cpp | 18 +- .../Windows/Tools/UpgradeTool/Controller.cpp | 5 + .../Windows/Tools/UpgradeTool/Controller.h | 3 +- .../Windows/Tools/UpgradeTool/ModelTraits.h | 2 + .../Windows/Tools/UpgradeTool/Modifier.cpp | 292 ++++++++++++++---- .../View/Windows/Tools/UpgradeTool/Modifier.h | 44 ++- .../Windows/Tools/UpgradeTool/Scanner.cpp | 4 +- .../Grammar/PrimitivesDeclarations.cpp | 1 + .../Grammar/PrimitivesDeclarations.h | 1 + 11 files changed, 293 insertions(+), 82 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp index ac7bd4406a..6c35007987 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp @@ -281,7 +281,8 @@ namespace ScriptCanvasBuilder } else { - if (AzFramework::StringFunc::Find(fileNameOnly, s_unitTestParseErrorPrefix) != AZStd::string::npos) + if (!ScriptCanvas::Grammar::g_processingErrorsForUnitTestsEnabled + && AzFramework::StringFunc::Find(fileNameOnly, s_unitTestParseErrorPrefix) != AZStd::string::npos) { response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success; } diff --git a/Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/ScriptEventReceiverEventNodeDescriptorComponent.cpp b/Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/ScriptEventReceiverEventNodeDescriptorComponent.cpp index ab231ae637..43bfc4b221 100644 --- a/Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/ScriptEventReceiverEventNodeDescriptorComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/ScriptEventReceiverEventNodeDescriptorComponent.cpp @@ -190,7 +190,7 @@ namespace ScriptCanvasEditor { scriptCanvasSlot = eventHandler->GetSlot(slotId); - int& index = (scriptCanvasSlot->IsData() && scriptCanvasSlot->IsInput()) ? paramIndex : outputIndex; + int& index = (scriptCanvasSlot && scriptCanvasSlot->IsData() && scriptCanvasSlot->IsInput()) ? paramIndex : outputIndex; if (scriptCanvasSlot && scriptCanvasSlot->IsVisible()) { diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index fa13681879..306068bd5c 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -1880,10 +1880,6 @@ namespace ScriptCanvasEditor void MainWindow::OnFileOpen() { - AZ::SerializeContext* serializeContext = nullptr; - EBUS_EVENT_RESULT(serializeContext, AZ::ComponentApplicationBus, GetSerializeContext); - AZ_Assert(serializeContext, "Failed to acquire application serialize context."); - AZStd::string assetRoot; { AZStd::array assetRootChar; @@ -1892,21 +1888,9 @@ namespace ScriptCanvasEditor } AZStd::string assetPath = AZStd::string::format("%s/scriptcanvas", assetRoot.c_str()); - - AZ::EBusAggregateResults> fileFilters; - AssetRegistryRequestBus::BroadcastResult(fileFilters, &AssetRegistryRequests::GetAssetHandlerFileFilters); - QString filter; - AZStd::set filterSet; - auto aggregateFilters = fileFilters.values; - for (auto aggregateFilters2 : fileFilters.values) - { - for (const AZStd::string& fileFilter : aggregateFilters2) - { - filterSet.insert(fileFilter); - } - } + AZStd::set filterSet { ".scriptcanvas" }; QStringList nameFilters; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp index b8ae59d43b..f14bc0f965 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp @@ -189,6 +189,11 @@ namespace ScriptCanvasEditor OnButtonPressUpgradeImplementation(info); } + void Controller::OnUpgradeDependencyWaitInterval([[maybe_unused]] const SourceHandle& info) + { + AddLogEntries(); + } + void Controller::OnUpgradeModificationBegin([[maybe_unused]] const ModifyConfiguration& config, const SourceHandle& info) { for (auto* item : FindTableItems(info)) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.h index 2d7b78060e..ab428c0ba3 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.h @@ -93,9 +93,10 @@ namespace ScriptCanvasEditor ( const ModifyConfiguration& config , const AZStd::vector& assets , const AZStd::vector& sortedOrder) override; + void OnUpgradeDependencyWaitInterval(const SourceHandle& info) override; void OnUpgradeModificationBegin(const ModifyConfiguration& config, const SourceHandle& info) override; void OnUpgradeModificationEnd(const ModifyConfiguration& config, const SourceHandle& info, ModificationResult result) override; - + void SetLoggingPreferences(); void SetSpinnerIsBusy(bool isBusy); void SetRowBusy(int index); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/ModelTraits.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/ModelTraits.h index 4ab9015a6c..9351d8c26c 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/ModelTraits.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/ModelTraits.h @@ -22,6 +22,7 @@ namespace ScriptCanvasEditor SourceHandle modifySingleAsset; bool backupGraphBeforeModification = false; bool successfulDependencyUpgradeRequired = true; + AZ::s32 perDependencyWaitSecondsMax = 20; }; struct ModificationResult @@ -98,6 +99,7 @@ namespace ScriptCanvasEditor ( const ModifyConfiguration& config , const AZStd::vector& assets , const AZStd::vector& sortedOrder) = 0; + virtual void OnUpgradeDependencyWaitInterval(const SourceHandle& info) = 0; virtual void OnUpgradeModificationBegin(const ModifyConfiguration& config, const SourceHandle& info) = 0; virtual void OnUpgradeModificationEnd(const ModifyConfiguration& config, const SourceHandle& info, ModificationResult result) = 0; }; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp index 3c8605e915..e46f0ada24 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp @@ -30,38 +30,141 @@ namespace ScriptCanvasEditor AZ_Assert(m_config.modification, "No modification function provided"); ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnUpgradeBegin, modification, m_assets); AZ::SystemTickBus::Handler::BusConnect(); + AzFramework::AssetSystemInfoBus::Handler::BusConnect(); + AzFramework::AssetSystemInfoBus::Handler::BusConnect(); + m_result.asset = m_assets[GetCurrentIndex()]; } - size_t Modifier::GetCurrentIndex() const + Modifier::~Modifier() { - return m_state == State::GatheringDependencies - ? m_assetIndex - : m_dependencyOrderedAssetIndicies[m_assetIndex]; + AzFramework::AssetSystemInfoBus::Handler::BusDisconnect(); + AzFramework::AssetSystemInfoBus::Handler::BusDisconnect(); + } + bool Modifier::AllDependenciesCleared(const AZStd::unordered_set& dependencies) const + { + for (auto index : dependencies) + { + SourceHandle dependency = m_assets[index]; + CompleteDescriptionInPlace(dependency); + + if (dependency.Id().IsNull() || !m_assetsCompletedByAP.contains(dependency.Id())) + { + return false; + } + } + + return true; } - AZStd::unordered_set& Modifier::GetOrCreateDependencyIndexSet() + bool Modifier::AnyDependenciesFailed(const AZStd::unordered_set& dependencies) const { - auto iter = m_dependencies.find(m_assetIndex); - if (iter == m_dependencies.end()) + for (auto index : dependencies) { - iter = m_dependencies.insert_or_assign(m_assetIndex, AZStd::unordered_set()).first; + SourceHandle dependency = m_assets[index]; + CompleteDescriptionInPlace(dependency); + + if (dependency.Id().IsNull() || m_assetsFailedByAP.contains(dependency.Id())) + { + return true; + } } - return iter->second; + return false; } - const ModificationResults& Modifier::GetResult() const + AZStd::sys_time_t Modifier::CalculateRemainingWaitTime(const AZStd::unordered_set& dependencies) const { - return m_results; + auto maxSeconds = AZStd::chrono::seconds(dependencies.size() * m_config.perDependencyWaitSecondsMax); + auto waitedSeconds = AZStd::chrono::seconds(AZStd::chrono::system_clock::now() - m_waitTimeStamp); + return (maxSeconds - waitedSeconds).count(); + } + + void Modifier::SourceFileChanged(AZStd::string relativePath, [[maybe_unused]] AZStd::string scanFolder, [[maybe_unused]] AZ::Uuid fileAssetId) + { + AZ_TracePrintf("SC", "received SourceFileChanged: %s", relativePath.c_str()); + VE_LOG("received SourceFileChanged: %s", relativePath.c_str()); + } + + void Modifier::SourceFileFailed(AZStd::string relativePath, [[maybe_unused]] AZStd::string scanFolder, [[maybe_unused]] AZ::Uuid fileAssetId) + { + AZ_TracePrintf("SC", "received SourceFileFailed: %s", relativePath.c_str()); + VE_LOG("received SourceFileFailed: %s", relativePath.c_str()); + } + + void Modifier::ProcessNotifications() + { + AZStd::lock_guard lock(m_mutex); + + for (const auto& assetPath : m_successNotifications) + { + VE_LOG("received AssetCompilationSuccess: %s", assetPath.c_str()); + SourceHandle sourceHandle(nullptr, {}, assetPath.c_str()); + CompleteDescriptionInPlace(sourceHandle); + + if (m_attemptedAssets.contains(sourceHandle.Id())) + { + m_assetsCompletedByAP.insert(sourceHandle.Id()); + } + } + + m_successNotifications.clear(); + + for (const auto& assetPath : m_failureNotifications) + { + VE_LOG("received AssetCompilationFailed: %s", assetPath.c_str()); + SourceHandle sourceHandle(nullptr, {}, assetPath.c_str()); + CompleteDescriptionInPlace(sourceHandle); + + if (m_attemptedAssets.contains(sourceHandle.Id())) + { + m_assetsFailedByAP.insert(sourceHandle.Id()); + } + } + + m_failureNotifications.clear(); + } + + void Modifier::AssetCompilationSuccess([[maybe_unused]] const AZStd::string& assetPath) + { + AZStd::lock_guard lock(m_mutex); + // test failure path m_successNotifications.insert(assetPath); + m_failureNotifications.insert(assetPath); + } + + void Modifier::AssetCompilationFailed(const AZStd::string& assetPath) + { + AZStd::lock_guard lock(m_mutex); + m_failureNotifications.insert(assetPath); + } + + void Modifier::CheckDependencies() + { + ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnUpgradeModificationBegin, m_config, m_result.asset); + + if (auto dependencies = GetDependencies(GetCurrentIndex()); dependencies != nullptr && !dependencies->empty()) + { + VE_LOG + ( "dependencies found for %s, update will wait for the AP to finish processing them" + , m_result.asset.Path().c_str()); + + m_waitTimeStamp = AZStd::chrono::system_clock::now(); + m_waitLogTimeStamp = AZStd::chrono::system_clock::time_point{}; + m_modifyState = ModifyState::WaitingForDependencyProcessing; + } + else + { + m_modifyState = ModifyState::StartModification; + } } - + void Modifier::GatherDependencies() { AZ::SerializeContext* serializeContext{}; AZ::ComponentApplicationBus::BroadcastResult(serializeContext, &AZ::ComponentApplicationBus::Events::GetSerializeContext); AZ_Assert(serializeContext, "SerializeContext is required to enumerate dependent assets in the ScriptCanvas file"); + LoadAsset(); bool anyFailures = false; if (m_result.asset.Get() && m_result.asset.Mod()->GetGraphData()) @@ -101,7 +204,7 @@ namespace ScriptCanvasEditor , nullptr)) { anyFailures = true; - VE_LOG("Modifier: ERROR - Failed to gather dependencies from graph data: %s" + VE_LOG("Modifier: ERROR - Failed to gather dependencies from graph data: %s" , m_result.asset.Path().c_str()) } } @@ -111,16 +214,40 @@ namespace ScriptCanvasEditor VE_LOG("Modifier: ERROR - Failed to load asset %s for modification, even though it scanned properly" , m_result.asset.Path().c_str()); } - + ModelNotificationsBus::Broadcast ( &ModelNotificationsTraits::OnUpgradeDependenciesGathered , m_result.asset , anyFailures ? Result::Failure : Result::Success); + } - ReleaseCurrentAsset(); + size_t Modifier::GetCurrentIndex() const + { + return m_state == State::GatheringDependencies + ? m_assetIndex + : m_dependencyOrderedAssetIndicies[m_assetIndex]; + } - // Flush asset database events to ensure no asset references are held by closures queued on Ebuses. - AZ::Data::AssetManager::Instance().DispatchEvents(); + const AZStd::unordered_set* Modifier::GetDependencies(size_t index) const + { + auto iter = m_dependencies.find(index); + return iter != m_dependencies.end() ? &iter->second : nullptr; + } + + AZStd::unordered_set& Modifier::GetOrCreateDependencyIndexSet() + { + auto iter = m_dependencies.find(m_assetIndex); + if (iter == m_dependencies.end()) + { + iter = m_dependencies.insert_or_assign(m_assetIndex, AZStd::unordered_set()).first; + } + + return iter->second; + } + + const ModificationResults& Modifier::GetResult() const + { + return m_results; } void Modifier::LoadAsset() @@ -144,7 +271,7 @@ namespace ScriptCanvasEditor } else if (m_result.asset.Describe() != result.asset.Describe()) { - ReportModificationError("Received modifiction complete notification for different result"); + ReportModificationError("Received modification complete notification for different result"); } else { @@ -154,9 +281,6 @@ namespace ScriptCanvasEditor void Modifier::ModifyCurrentAsset() { - m_result = {}; - m_result.asset = m_assets[GetCurrentIndex()]; - ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnUpgradeModificationBegin, m_config, m_result.asset); LoadAsset(); if (m_result.asset.IsGraphValid()) @@ -171,34 +295,55 @@ namespace ScriptCanvasEditor } } - void Modifier::ModifyNextAsset() + void Modifier::InitializeResult() { - ModelNotificationsBus::Broadcast - ( &ModelNotificationsTraits::OnUpgradeModificationEnd, m_config, m_result.asset, m_result); + m_result = {}; + + if (m_assetIndex != m_assets.size()) + { + m_result.asset = m_assets[GetCurrentIndex()]; + CompleteDescriptionInPlace(m_result.asset); + m_attemptedAssets.insert(m_result.asset.Id()); + } + } + + void Modifier::NextAsset() + { + ++m_assetIndex; + InitializeResult(); + } + + void Modifier::NextModification() + { + ModelNotificationsBus::Broadcast( &ModelNotificationsTraits::OnUpgradeModificationEnd, m_config, m_result.asset, m_result); ModificationNotificationsBus::Handler::BusDisconnect(); + NextAsset(); + m_fileSaveResult = {}; m_modifyState = ModifyState::Idle; - ReleaseCurrentAsset(); - ++m_assetIndex; - m_result = {}; } void Modifier::ReleaseCurrentAsset() { m_result.asset = m_result.asset.Describe(); + // Flush asset database events to ensure no asset references are held by closures queued on Ebuses. + AZ::Data::AssetManager::Instance().DispatchEvents(); } void Modifier::ReportModificationError(AZStd::string_view report) { m_result.errorMessage = report; m_results.m_failures.push_back({ m_result.asset.Describe(), report }); - ModifyNextAsset(); + m_assetsFailedByAP.insert(m_result.asset.Id()); + NextModification(); } void Modifier::ReportModificationSuccess() { - m_result.asset = m_result.asset.Describe(); + // \note DO NOT put asset into the m_assetsCompletedByAP here. That can only be done when the message is received by the AP m_results.m_successes.push_back({ m_result.asset.Describe(), {} }); - ModifyNextAsset(); + AzFramework::AssetSystemRequestBus::Broadcast( + &AzFramework::AssetSystem::AssetSystemRequests::EscalateAssetByUuid, m_result.asset.Id()); + NextModification(); } void Modifier::ReportSaveResult() @@ -214,9 +359,6 @@ namespace ScriptCanvasEditor { ReportModificationError(m_fileSaveResult.fileSaveError); } - - m_fileSaveResult = {}; - m_modifyState = ModifyState::Idle; } void Modifier::OnFileSaveComplete(const FileSaveResult& result) @@ -316,49 +458,87 @@ namespace ScriptCanvasEditor m_assetIndex = 0; m_state = State::ModifyingGraphs; + InitializeResult(); } else { GatherDependencies(); - ReleaseCurrentAsset(); - ++m_assetIndex; + NextAsset(); } } void Modifier::TickUpdateGraph() { - if (m_assetIndex == m_assets.size()) + AZStd::lock_guard lock(m_mutex); + + switch (m_modifyState) { - VE_LOG("Modifier: Complete."); - AZ::SystemTickBus::Handler::BusDisconnect(); + case ScriptCanvasEditor::VersionExplorer::Modifier::ModifyState::Idle: + if (m_assetIndex == m_assets.size()) + { + VE_LOG("Modifier: Complete."); + AZ::SystemTickBus::Handler::BusDisconnect(); - if (m_onComplete) + if (m_onComplete) + { + m_onComplete(); + } + } + else { - m_onComplete(); + CheckDependencies(); } + break; + case ScriptCanvasEditor::VersionExplorer::Modifier::ModifyState::WaitingForDependencyProcessing: + WaitForDependencies(); + break; + case ScriptCanvasEditor::VersionExplorer::Modifier::ModifyState::StartModification: + ModifyCurrentAsset(); + break; + case ScriptCanvasEditor::VersionExplorer::Modifier::ModifyState::ReportResult: + ReportSaveResult(); + break; + default: + break; } - else + } + + void Modifier::WaitForDependencies() + { + const AZ::s32 LogPeriodSeconds = 5; + + ProcessNotifications(); + + auto dependencies = GetDependencies(GetCurrentIndex()); + if (dependencies == nullptr || dependencies->empty() || AllDependenciesCleared(*dependencies)) + { + m_modifyState = ModifyState::StartModification; + } + else if (AnyDependenciesFailed(*dependencies)) + { + ReportModificationError("A required dependency failed to update, graph cannot update."); + } + else if (AZStd::chrono::seconds(CalculateRemainingWaitTime(*dependencies)).count() < 0) + { + ReportModificationError("Dependency update time has taken too long, aborting modification."); + } + else if (AZStd::chrono::seconds(AZStd::chrono::system_clock::now() - m_waitLogTimeStamp).count() > LogPeriodSeconds) { - AZStd::lock_guard lock(m_mutex); + m_waitLogTimeStamp = AZStd::chrono::system_clock::now(); - switch (m_modifyState) - { - case ScriptCanvasEditor::VersionExplorer::Modifier::ModifyState::Idle: - ModifyCurrentAsset(); - break; - case ScriptCanvasEditor::VersionExplorer::Modifier::ModifyState::ReportResult: - ReportSaveResult(); - break; - default: - break; - } + AZ_TracePrintf + ( ScriptCanvas::k_VersionExplorerWindow.data() + , "Waiting for dependencies for %d more seconds: %s" + , AZStd::chrono::seconds(CalculateRemainingWaitTime(*dependencies)).count() + , m_result.asset.Path().c_str()); + + ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnUpgradeDependencyWaitInterval, m_result.asset); } } const AZStd::unordered_set* Modifier::Sorter::GetDependencies(size_t index) const { - auto iter = modifier->m_dependencies.find(index); - return iter != modifier->m_dependencies.end() ? &iter->second : nullptr; + return modifier->GetDependencies(index); } void Modifier::Sorter::Sort() @@ -379,7 +559,7 @@ namespace ScriptCanvasEditor if (markedTemporary.contains(index)) { AZ_Error - (ScriptCanvas::k_VersionExplorerWindow.data() + ( ScriptCanvas::k_VersionExplorerWindow.data() , false , "Modifier: Dependency sort has failed during, circular dependency detected for Asset: %s" , modifier->m_result.asset.Path().c_str()); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h index 32b9253bb5..4e0718f6a1 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h @@ -9,17 +9,23 @@ #pragma once #include +#include #include #include #include +// probably not needed if using the asset system bus +#include + namespace ScriptCanvasEditor { namespace VersionExplorer { - class Modifier - : private AZ::SystemTickBus::Handler - , private ModificationNotificationsBus::Handler + class Modifier final + : public AZ::SystemTickBus::Handler + , public ModificationNotificationsBus::Handler + , public AzToolsFramework::AssetSystemBus::Handler + , public AzFramework::AssetSystemInfoBus::Handler { public: AZ_CLASS_ALLOCATOR(Modifier, AZ::SystemAllocator, 0); @@ -29,6 +35,8 @@ namespace ScriptCanvasEditor , AZStd::vector&& assets , AZStd::function onComplete); + virtual ~Modifier(); + const ModificationResults& GetResult() const; ModificationResults&& TakeResult(); @@ -56,6 +64,8 @@ namespace ScriptCanvasEditor enum class ModifyState { Idle, + WaitingForDependencyProcessing, + StartModification, InProgress, Saving, ReportResult @@ -82,13 +92,27 @@ namespace ScriptCanvasEditor ModificationResults m_results; AZStd::unique_ptr m_fileSaver; FileSaveResult m_fileSaveResult; + AZStd::unordered_set m_attemptedAssets; + AZStd::unordered_set m_assetsCompletedByAP; + AZStd::unordered_set m_assetsFailedByAP; + AZStd::chrono::system_clock::time_point m_waitLogTimeStamp; + AZStd::chrono::system_clock::time_point m_waitTimeStamp; + AZStd::unordered_set m_successNotifications; + AZStd::unordered_set m_failureNotifications; - size_t GetCurrentIndex() const; + bool AllDependenciesCleared(const AZStd::unordered_set& dependencies) const; + bool AnyDependenciesFailed(const AZStd::unordered_set& dependencies) const; + AZStd::sys_time_t CalculateRemainingWaitTime(const AZStd::unordered_set& dependencies) const; + void CheckDependencies(); void GatherDependencies(); + size_t GetCurrentIndex() const; + const AZStd::unordered_set* GetDependencies(size_t index) const; AZStd::unordered_set& GetOrCreateDependencyIndexSet(); + void InitializeResult(); void LoadAsset(); void ModifyCurrentAsset(); - void ModifyNextAsset(); + void NextAsset(); + void NextModification(); void ModificationComplete(const ModificationResult& result) override; void ReleaseCurrentAsset(); void ReportModificationError(AZStd::string_view report); @@ -96,10 +120,20 @@ namespace ScriptCanvasEditor void ReportSaveResult(); void SaveModifiedGraph(const ModificationResult& result); void SortGraphsByDependencies(); + + + /// use all this to track the success of dependencies + void SourceFileChanged(AZStd::string relativePath, AZStd::string scanFolder, AZ::Uuid fileAssetId) override; + void SourceFileFailed(AZStd::string relativePath, AZStd::string scanFolder, AZ::Uuid fileAssetId) override; + void AssetCompilationSuccess(const AZStd::string& assetPath) override; + void AssetCompilationFailed(const AZStd::string& assetPath) override; + void ProcessNotifications(); + void OnFileSaveComplete(const FileSaveResult& result); void OnSystemTick() override; void TickGatherDependencies(); void TickUpdateGraph(); + void WaitForDependencies(); }; } } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp index 816ded8a7b..c1551af9f9 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp @@ -81,7 +81,9 @@ namespace ScriptCanvasEditor void Scanner::FilterAsset(SourceHandle asset) { - if (m_config.filter && m_config.filter(asset) == ScanConfiguration::Filter::Exclude) + AZStd::string name = asset.Path().c_str(); + + if ((m_config.filter && m_config.filter(asset) == ScanConfiguration::Filter::Exclude) || !name.contains("LY_SC_UnitTest_FunctionContainer")) { VE_LOG("Scanner: Excluded: %s ", ModCurrentAsset().Path().c_str()); m_result.m_filteredAssets.push_back(ModCurrentAsset().Describe()); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesDeclarations.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesDeclarations.cpp index 14f7a926b1..52f00af6c2 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesDeclarations.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesDeclarations.cpp @@ -15,6 +15,7 @@ namespace ScriptCanvas 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, 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_processingErrorsForUnitTestsEnabled, false, {}, AZ::ConsoleFunctorFlags::Null, "Enable AP processing errors on parse failure for unit tests."); 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 a6ce31d6e7..3caec6ddb5 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesDeclarations.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/PrimitivesDeclarations.h @@ -245,6 +245,7 @@ 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_processingErrorsForUnitTestsEnabled); AZ_CVAR_EXTERNED(bool, g_saveRawTranslationOuputToFile); AZ_CVAR_EXTERNED(bool, g_saveRawTranslationOuputToFileAtPrefabTime); From 169416c2f947e9f9c818eafe10066170ecd4d6f1 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Wed, 8 Dec 2021 16:31:08 -0800 Subject: [PATCH 109/948] remove testing code Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp | 2 ++ .../Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp | 3 +-- .../Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp index f14bc0f965..b666ef32f5 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp @@ -216,6 +216,8 @@ namespace ScriptCanvasEditor else { VE_LOG("Failed to modify %s: %s", result.asset.Path().c_str(), result.errorMessage.data()); + AZ_Warning(ScriptCanvas::k_VersionExplorerWindow.data() + , false, "Failed to modify %s: %s", result.asset.Path().c_str(), result.errorMessage.data()); } for (auto* item : FindTableItems(info)) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp index e46f0ada24..a5515248e5 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp @@ -128,8 +128,7 @@ namespace ScriptCanvasEditor void Modifier::AssetCompilationSuccess([[maybe_unused]] const AZStd::string& assetPath) { AZStd::lock_guard lock(m_mutex); - // test failure path m_successNotifications.insert(assetPath); - m_failureNotifications.insert(assetPath); + m_successNotifications.insert(assetPath); } void Modifier::AssetCompilationFailed(const AZStd::string& assetPath) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp index c1551af9f9..061025faf5 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp @@ -83,7 +83,7 @@ namespace ScriptCanvasEditor { AZStd::string name = asset.Path().c_str(); - if ((m_config.filter && m_config.filter(asset) == ScanConfiguration::Filter::Exclude) || !name.contains("LY_SC_UnitTest_FunctionContainer")) + if (m_config.filter && m_config.filter(asset) == ScanConfiguration::Filter::Exclude) { VE_LOG("Scanner: Excluded: %s ", ModCurrentAsset().Path().c_str()); m_result.m_filteredAssets.push_back(ModCurrentAsset().Describe()); From ac6c90cd2cc86bd9c1aae14d08f0c5d8dc3b07e3 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Wed, 8 Dec 2021 17:32:57 -0800 Subject: [PATCH 110/948] pre-PR cleanup Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../Windows/Tools/UpgradeTool/Modifier.cpp | 184 ++++++++---------- .../View/Windows/Tools/UpgradeTool/Modifier.h | 25 +-- .../Windows/Tools/UpgradeTool/Scanner.cpp | 2 - 3 files changed, 93 insertions(+), 118 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp index a5515248e5..14b292e489 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp @@ -31,14 +31,12 @@ namespace ScriptCanvasEditor ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnUpgradeBegin, modification, m_assets); AZ::SystemTickBus::Handler::BusConnect(); AzFramework::AssetSystemInfoBus::Handler::BusConnect(); - AzFramework::AssetSystemInfoBus::Handler::BusConnect(); m_result.asset = m_assets[GetCurrentIndex()]; } Modifier::~Modifier() { AzFramework::AssetSystemInfoBus::Handler::BusDisconnect(); - AzFramework::AssetSystemInfoBus::Handler::BusDisconnect(); } bool Modifier::AllDependenciesCleared(const AZStd::unordered_set& dependencies) const @@ -73,58 +71,6 @@ namespace ScriptCanvasEditor return false; } - AZStd::sys_time_t Modifier::CalculateRemainingWaitTime(const AZStd::unordered_set& dependencies) const - { - auto maxSeconds = AZStd::chrono::seconds(dependencies.size() * m_config.perDependencyWaitSecondsMax); - auto waitedSeconds = AZStd::chrono::seconds(AZStd::chrono::system_clock::now() - m_waitTimeStamp); - return (maxSeconds - waitedSeconds).count(); - } - - void Modifier::SourceFileChanged(AZStd::string relativePath, [[maybe_unused]] AZStd::string scanFolder, [[maybe_unused]] AZ::Uuid fileAssetId) - { - AZ_TracePrintf("SC", "received SourceFileChanged: %s", relativePath.c_str()); - VE_LOG("received SourceFileChanged: %s", relativePath.c_str()); - } - - void Modifier::SourceFileFailed(AZStd::string relativePath, [[maybe_unused]] AZStd::string scanFolder, [[maybe_unused]] AZ::Uuid fileAssetId) - { - AZ_TracePrintf("SC", "received SourceFileFailed: %s", relativePath.c_str()); - VE_LOG("received SourceFileFailed: %s", relativePath.c_str()); - } - - void Modifier::ProcessNotifications() - { - AZStd::lock_guard lock(m_mutex); - - for (const auto& assetPath : m_successNotifications) - { - VE_LOG("received AssetCompilationSuccess: %s", assetPath.c_str()); - SourceHandle sourceHandle(nullptr, {}, assetPath.c_str()); - CompleteDescriptionInPlace(sourceHandle); - - if (m_attemptedAssets.contains(sourceHandle.Id())) - { - m_assetsCompletedByAP.insert(sourceHandle.Id()); - } - } - - m_successNotifications.clear(); - - for (const auto& assetPath : m_failureNotifications) - { - VE_LOG("received AssetCompilationFailed: %s", assetPath.c_str()); - SourceHandle sourceHandle(nullptr, {}, assetPath.c_str()); - CompleteDescriptionInPlace(sourceHandle); - - if (m_attemptedAssets.contains(sourceHandle.Id())) - { - m_assetsFailedByAP.insert(sourceHandle.Id()); - } - } - - m_failureNotifications.clear(); - } - void Modifier::AssetCompilationSuccess([[maybe_unused]] const AZStd::string& assetPath) { AZStd::lock_guard lock(m_mutex); @@ -137,6 +83,13 @@ namespace ScriptCanvasEditor m_failureNotifications.insert(assetPath); } + AZStd::sys_time_t Modifier::CalculateRemainingWaitTime(const AZStd::unordered_set& dependencies) const + { + auto maxSeconds = AZStd::chrono::seconds(dependencies.size() * m_config.perDependencyWaitSecondsMax); + auto waitedSeconds = AZStd::chrono::seconds(AZStd::chrono::system_clock::now() - m_waitTimeStamp); + return (maxSeconds - waitedSeconds).count(); + } + void Modifier::CheckDependencies() { ModelNotificationsBus::Broadcast(&ModelNotificationsTraits::OnUpgradeModificationBegin, m_config, m_result.asset); @@ -249,6 +202,18 @@ namespace ScriptCanvasEditor return m_results; } + void Modifier::InitializeResult() + { + m_result = {}; + + if (m_assetIndex != m_assets.size()) + { + m_result.asset = m_assets[GetCurrentIndex()]; + CompleteDescriptionInPlace(m_result.asset); + m_attemptedAssets.insert(m_result.asset.Id()); + } + } + void Modifier::LoadAsset() { auto& handle = m_result.asset; @@ -294,18 +259,6 @@ namespace ScriptCanvasEditor } } - void Modifier::InitializeResult() - { - m_result = {}; - - if (m_assetIndex != m_assets.size()) - { - m_result.asset = m_assets[GetCurrentIndex()]; - CompleteDescriptionInPlace(m_result.asset); - m_attemptedAssets.insert(m_result.asset.Id()); - } - } - void Modifier::NextAsset() { ++m_assetIndex; @@ -321,6 +274,72 @@ namespace ScriptCanvasEditor m_modifyState = ModifyState::Idle; } + void Modifier::OnFileSaveComplete(const FileSaveResult& result) + { + if (!result.tempFileRemovalError.empty()) + { + VE_LOG + ("Temporary file not removed for %s: %s" + , m_result.asset.Path().c_str() + , result.tempFileRemovalError.c_str()); + } + + AZStd::lock_guard lock(m_mutex); + m_modifyState = ModifyState::ReportResult; + m_fileSaver.reset(); + m_fileSaveResult = result; + } + + void Modifier::OnSystemTick() + { + switch (m_state) + { + case State::GatheringDependencies: + TickGatherDependencies(); + break; + + case State::ModifyingGraphs: + TickUpdateGraph(); + break; + } + + AZ::Data::AssetManager::Instance().DispatchEvents(); + AZ::SystemTickBus::ExecuteQueuedEvents(); + } + + void Modifier::ProcessNotifications() + { + AZStd::lock_guard lock(m_mutex); + + for (const auto& assetPath : m_successNotifications) + { + VE_LOG("received AssetCompilationSuccess: %s", assetPath.c_str()); + SourceHandle sourceHandle(nullptr, {}, assetPath.c_str()); + CompleteDescriptionInPlace(sourceHandle); + + if (m_attemptedAssets.contains(sourceHandle.Id())) + { + m_assetsCompletedByAP.insert(sourceHandle.Id()); + } + } + + m_successNotifications.clear(); + + for (const auto& assetPath : m_failureNotifications) + { + VE_LOG("received AssetCompilationFailed: %s", assetPath.c_str()); + SourceHandle sourceHandle(nullptr, {}, assetPath.c_str()); + CompleteDescriptionInPlace(sourceHandle); + + if (m_attemptedAssets.contains(sourceHandle.Id())) + { + m_assetsFailedByAP.insert(sourceHandle.Id()); + } + } + + m_failureNotifications.clear(); + } + void Modifier::ReleaseCurrentAsset() { m_result.asset = m_result.asset.Describe(); @@ -360,39 +379,6 @@ namespace ScriptCanvasEditor } } - void Modifier::OnFileSaveComplete(const FileSaveResult& result) - { - if (!result.tempFileRemovalError.empty()) - { - VE_LOG - ( "Temporary file not removed for %s: %s" - , m_result.asset.Path().c_str() - , result.tempFileRemovalError.c_str()); - } - - AZStd::lock_guard lock(m_mutex); - m_modifyState = ModifyState::ReportResult; - m_fileSaver.reset(); - m_fileSaveResult = result; - } - - void Modifier::OnSystemTick() - { - switch (m_state) - { - case State::GatheringDependencies: - TickGatherDependencies(); - break; - - case State::ModifyingGraphs: - TickUpdateGraph(); - break; - } - - AZ::Data::AssetManager::Instance().DispatchEvents(); - AZ::SystemTickBus::ExecuteQueuedEvents(); - } - void Modifier::SaveModifiedGraph(const ModificationResult& result) { m_modifyState = ModifyState::Saving; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h index 4e0718f6a1..699287dd48 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h @@ -14,9 +14,6 @@ #include #include -// probably not needed if using the asset system bus -#include - namespace ScriptCanvasEditor { namespace VersionExplorer @@ -24,7 +21,6 @@ namespace ScriptCanvasEditor class Modifier final : public AZ::SystemTickBus::Handler , public ModificationNotificationsBus::Handler - , public AzToolsFramework::AssetSystemBus::Handler , public AzFramework::AssetSystemInfoBus::Handler { public: @@ -86,12 +82,13 @@ namespace ScriptCanvasEditor // dependency indices by asset info index (only exist if graphs have them) AZStd::unordered_map> m_dependencies; AZStd::unordered_map m_assetInfoIndexById; - AZStd::vector m_failures; ModifyConfiguration m_config; ModificationResult m_result; ModificationResults m_results; AZStd::unique_ptr m_fileSaver; FileSaveResult m_fileSaveResult; + // m_attemptedAssets is assets attempted to be processed by modification, as opposed to + // those processed by the AP as a result of one of their dependencies being processed. AZStd::unordered_set m_attemptedAssets; AZStd::unordered_set m_assetsCompletedByAP; AZStd::unordered_set m_assetsFailedByAP; @@ -102,6 +99,8 @@ namespace ScriptCanvasEditor bool AllDependenciesCleared(const AZStd::unordered_set& dependencies) const; bool AnyDependenciesFailed(const AZStd::unordered_set& dependencies) const; + void AssetCompilationSuccess(const AZStd::string& assetPath) override; + void AssetCompilationFailed(const AZStd::string& assetPath) override; AZStd::sys_time_t CalculateRemainingWaitTime(const AZStd::unordered_set& dependencies) const; void CheckDependencies(); void GatherDependencies(); @@ -110,27 +109,19 @@ namespace ScriptCanvasEditor AZStd::unordered_set& GetOrCreateDependencyIndexSet(); void InitializeResult(); void LoadAsset(); + void ModificationComplete(const ModificationResult& result) override; void ModifyCurrentAsset(); void NextAsset(); void NextModification(); - void ModificationComplete(const ModificationResult& result) override; + void OnFileSaveComplete(const FileSaveResult& result); + void OnSystemTick() override; + void ProcessNotifications(); void ReleaseCurrentAsset(); void ReportModificationError(AZStd::string_view report); void ReportModificationSuccess(); void ReportSaveResult(); void SaveModifiedGraph(const ModificationResult& result); void SortGraphsByDependencies(); - - - /// use all this to track the success of dependencies - void SourceFileChanged(AZStd::string relativePath, AZStd::string scanFolder, AZ::Uuid fileAssetId) override; - void SourceFileFailed(AZStd::string relativePath, AZStd::string scanFolder, AZ::Uuid fileAssetId) override; - void AssetCompilationSuccess(const AZStd::string& assetPath) override; - void AssetCompilationFailed(const AZStd::string& assetPath) override; - void ProcessNotifications(); - - void OnFileSaveComplete(const FileSaveResult& result); - void OnSystemTick() override; void TickGatherDependencies(); void TickUpdateGraph(); void WaitForDependencies(); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp index 061025faf5..816ded8a7b 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp @@ -81,8 +81,6 @@ namespace ScriptCanvasEditor void Scanner::FilterAsset(SourceHandle asset) { - AZStd::string name = asset.Path().c_str(); - if (m_config.filter && m_config.filter(asset) == ScanConfiguration::Filter::Exclude) { VE_LOG("Scanner: Excluded: %s ", ModCurrentAsset().Path().c_str()); From 0f07de7454d1d491cbbb0803a1adaebae96ad9e1 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Wed, 8 Dec 2021 17:44:01 -0800 Subject: [PATCH 111/948] fix verbose setting Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../Editor/Include/ScriptCanvas/Components/GraphUpgrade.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/GraphUpgrade.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/GraphUpgrade.h index 0e6e69c4bf..8a28059753 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/GraphUpgrade.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/GraphUpgrade.h @@ -102,9 +102,6 @@ namespace ScriptCanvasEditor void Log(const char* format, ...); private: - - bool m_verbose = true; - StateMachine* m_stateMachine; }; @@ -363,7 +360,7 @@ namespace ScriptCanvasEditor template void ScriptCanvasEditor::State::Log(const char* format, ...) { - if (m_verbose) + if (GetVerbose()) { char sBuffer[2048]; va_list ArgList; From aeabf21bba7819684adf5bce587d186509a9fc1d Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Wed, 8 Dec 2021 18:52:24 -0800 Subject: [PATCH 112/948] clean up debug output settings Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../Code/Editor/Include/ScriptCanvas/Components/GraphUpgrade.h | 2 +- .../Code/Editor/View/Windows/Tools/UpgradeTool/Model.cpp | 2 ++ .../Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp | 3 +-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/GraphUpgrade.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/GraphUpgrade.h index 8a28059753..9fedc2d1f3 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/GraphUpgrade.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/GraphUpgrade.h @@ -360,7 +360,7 @@ namespace ScriptCanvasEditor template void ScriptCanvasEditor::State::Log(const char* format, ...) { - if (GetVerbose()) + if (m_stateMachine->GetVerbose()) { char sBuffer[2048]; va_list ArgList; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Model.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Model.cpp index 86a1c1f42e..5df1e32c8f 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Model.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Model.cpp @@ -145,6 +145,7 @@ namespace ScriptCanvasEditor } Idle(); + RestoreSettings(); } void Model::OnScanComplete() @@ -161,6 +162,7 @@ namespace ScriptCanvasEditor return; } + CacheSettings(); m_state = State::Scanning; m_log.Activate(); m_keepEditorAlive = AZStd::make_unique(); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp index 7d76dbc27d..829a1098dc 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp @@ -2384,9 +2384,8 @@ namespace ScriptCanvas AZ_TracePrintf("ScriptCanvas", "%s", pretty.data()); AZ_TracePrintf("ScriptCanvas", "SubgraphInterface:"); AZ_TracePrintf("ScriptCanvas", ToString(m_subgraphInterface).data()); + AZ_TracePrintf("Script Canvas", "Parse Duration: %8.4f ms\n", m_parseDuration / 1000.0); } - - AZ_TracePrintf("Script Canvas", "Parse Duration: %8.4f ms\n", m_parseDuration / 1000.0); } } } From cbc70b4b8838f613b8df80ff7a78d21a8544d342 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Tue, 30 Nov 2021 14:05:31 -0800 Subject: [PATCH 113/948] Add dialog window for messaging when SC assets fail to save Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h index fed4f28f4f..1c0055fce6 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h @@ -50,7 +50,7 @@ #include #include - +//#include #include #include From dc538d94e5acddd886611b2407bc4536e774223b Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Tue, 30 Nov 2021 15:02:06 -0800 Subject: [PATCH 114/948] update error window message and add AP launch request Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 306068bd5c..d461ad2a31 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -155,6 +155,7 @@ #include #include +#include namespace ScriptCanvasEditor { From 0963bc0cc564f26a9b589b75053039cbc742e395 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Tue, 30 Nov 2021 15:30:42 -0800 Subject: [PATCH 115/948] removed commented out include Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h index 1c0055fce6..28e9cab948 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h @@ -50,7 +50,6 @@ #include #include -//#include #include #include From 9830925309e74646317a9012e01bf1012c3b60c0 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Wed, 8 Dec 2021 22:54:21 -0800 Subject: [PATCH 116/948] small fixes for SC play in editor and warnings Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../Components/EditorScriptCanvasComponent.cpp | 10 ---------- .../Components/EditorScriptCanvasComponent.h | 4 +--- .../Code/Editor/SystemComponent.cpp | 17 ++++++++++++++--- Gems/ScriptCanvas/Code/Editor/SystemComponent.h | 10 +++++++++- .../Code/Include/ScriptCanvas/Core/Graph.cpp | 12 ++++++++++++ 5 files changed, 36 insertions(+), 17 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index 9209196873..ff1dd2e3a6 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -431,16 +431,6 @@ namespace ScriptCanvasEditor AzToolsFramework::ToolsApplicationNotificationBus::Broadcast(&AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay, AzToolsFramework::Refresh_EntireTree_NewContent); } - void EditorScriptCanvasComponent::OnStartPlayInEditor() - { - ScriptCanvas::Execution::PerformanceStatisticsEBus::Broadcast(&ScriptCanvas::Execution::PerformanceStatisticsBus::ClearSnaphotStatistics); - } - - void EditorScriptCanvasComponent::OnStopPlayInEditor() - { - AZ::ScriptSystemRequestBus::Broadcast(&AZ::ScriptSystemRequests::GarbageCollect); - } - void EditorScriptCanvasComponent::SetAssetId(const SourceHandle& assetId) { if (m_sourceHandle.Describe() != assetId.Describe()) diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h index 52cf49070b..76514267a3 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h @@ -93,9 +93,7 @@ namespace ScriptCanvasEditor //===================================================================== // EditorEntityContextNotificationBus - void OnStartPlayInEditor() override; - - void OnStopPlayInEditor() override; + protected: enum class SourceChangeDescription : AZ::u8 diff --git a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp index 0be2d564ee..758c395238 100644 --- a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -337,9 +338,19 @@ namespace ScriptCanvasEditor , SourceHandle(nullptr, sourceUUIDInCall, ""), Tracker::ScriptCanvasFileState::UNMODIFIED, -1); } }; - - openers.push_back({ "O3DE_ScriptCanvasEditor", "Open In Script Canvas Editor...", QIcon(), scriptCanvasEditorCallback }); - } + + openers.push_back({ "O3DE_ScriptCanvasEditor", "Open In Script Canvas Editor...", QIcon(ScriptCanvasAssetDescription().GetIconPathImpl()), scriptCanvasEditorCallback }); + } + } + + void SystemComponent::OnStartPlayInEditor() + { + ScriptCanvas::Execution::PerformanceStatisticsEBus::Broadcast(&ScriptCanvas::Execution::PerformanceStatisticsBus::ClearSnaphotStatistics); + } + + void SystemComponent::OnStopPlayInEditor() + { + AZ::ScriptSystemRequestBus::Broadcast(&AZ::ScriptSystemRequests::GarbageCollect); } void SystemComponent::OnUserSettingsActivated() diff --git a/Gems/ScriptCanvas/Code/Editor/SystemComponent.h b/Gems/ScriptCanvas/Code/Editor/SystemComponent.h index 6f85b3c5a6..c2c42c5b9d 100644 --- a/Gems/ScriptCanvas/Code/Editor/SystemComponent.h +++ b/Gems/ScriptCanvas/Code/Editor/SystemComponent.h @@ -23,6 +23,7 @@ #include #include #include +#include namespace ScriptCanvasEditor { @@ -36,6 +37,8 @@ namespace ScriptCanvasEditor , private AZ::Data::AssetBus::MultiHandler , private AzToolsFramework::AssetSeedManagerRequests::Bus::Handler , private AzToolsFramework::EditorContextMenuBus::Handler + , private AzToolsFramework::EditorEntityContextNotificationBus::Handler + { public: AZ_COMPONENT(SystemComponent, "{1DE7A120-4371-4009-82B5-8140CB1D7B31}"); @@ -97,7 +100,12 @@ namespace ScriptCanvasEditor //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// - + + protected: + void OnStartPlayInEditor() override; + + void OnStopPlayInEditor() override; + private: SystemComponent(const SystemComponent&) = delete; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp index 9c2c854055..b58e4d1536 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp @@ -85,6 +85,18 @@ namespace ScriptCanvas } } + if (componentElementNode.GetVersion() < GraphCpp::GraphVersion::FixupVersionDataTypeId) + { + if (auto subElement = componentElementNode.FindSubElement(AZ_CRC_CE("versionData"))) + { + if (subElement->GetId() == azrtti_typeid()) + { + componentElementNode.RemoveElementByName(AZ_CRC_CE("versionData")); + componentElementNode.AddElementWithData(context, "versionData", VersionData()); + } + } + } + return true; } From a5b30ffc5a35d73fa4fec36cbb1d5fbff7b257e3 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Wed, 8 Dec 2021 23:23:03 -0800 Subject: [PATCH 117/948] fix interpreted statics Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../Execution/Interpreted/ExecutionInterpretedAPI.cpp | 9 +++++---- .../Execution/Interpreted/ExecutionStateInterpreted.cpp | 5 ++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp index 1855b348f2..561708dea1 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp @@ -503,20 +503,21 @@ namespace ScriptCanvas void InitializeInterpretedStatics(RuntimeData& runtimeData) { - if (!runtimeData.m_areStaticsInitialized) + AZ_Error("ScriptCanvas", !runtimeData.m_areStaticsInitialized, "ScriptCanvas runtime data already initalized"); { runtimeData.m_areStaticsInitialized = true; for (auto& dependency : runtimeData.m_requiredAssets) { - InitializeInterpretedStatics(dependency.Get()->GetData()); + if (!dependency.Get()->GetData().m_areStaticsInitialized) + { + InitializeInterpretedStatics(dependency.Get()->GetData()); + } } #if defined(AZ_PROFILE_BUILD) || defined(AZ_DEBUG_BUILD) Execution::InitializeFromLuaStackFunctions(const_cast(runtimeData.m_debugMap)); #endif - AZ_WarningOnce("ScriptCanvas", !runtimeData.m_areStaticsInitialized, "ScriptCanvas runtime data already initalized"); - if (runtimeData.RequiresStaticInitialization()) { AZ::ScriptLoadResult result{}; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpreted.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpreted.cpp index 3ae52846cd..3b963317ec 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpreted.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpreted.cpp @@ -49,7 +49,10 @@ namespace ScriptCanvas , config.asset.GetId().ToString().data()); #endif - Execution::InitializeInterpretedStatics(runtimeAsset->GetData()); + if (!runtimeAsset->GetData().m_areStaticsInitialized) + { + Execution::InitializeInterpretedStatics(runtimeAsset->GetData()); + } } void ExecutionStateInterpreted::ClearLuaRegistryIndex() From 837e532ad791db8086361f0a2a8bfafe67254045 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Thu, 9 Dec 2021 11:43:36 -0800 Subject: [PATCH 118/948] fail safe for EditorScriptCanvasComponents saved before AZ::IO::Path got json support Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../Code/Editor/Components/EditorScriptCanvasComponent.cpp | 2 ++ .../Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index ff1dd2e3a6..3d8599fdfb 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -295,6 +295,8 @@ namespace ScriptCanvasEditor EditorScriptCanvasComponentLoggingBus::Handler::BusConnect(entityId); EditorLoggingComponentNotificationBus::Broadcast(&EditorLoggingComponentNotifications::OnEditorScriptCanvasComponentActivated, GetNamedEntityId(), GetGraphIdentifier()); + CompleteDescriptionInPlace(m_sourceHandle); + AzToolsFramework::ToolsApplicationNotificationBus::Broadcast(&AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay, AzToolsFramework::Refresh_EntireTree_NewContent); } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h index 699287dd48..d5147cab61 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.h @@ -31,7 +31,7 @@ namespace ScriptCanvasEditor , AZStd::vector&& assets , AZStd::function onComplete); - virtual ~Modifier(); + ~Modifier(); const ModificationResults& GetResult() const; ModificationResults&& TakeResult(); From 0a1dc3c4bda95efa2cb8bd30aa62fb091a473cc9 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Thu, 9 Dec 2021 18:58:47 -0800 Subject: [PATCH 119/948] Fix missing asset handler error on EditorSCComponent load from pre SourceHandle files Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../EditorScriptCanvasComponent.cpp | 2 +- .../Components/EditorScriptCanvasComponent.h | 6 +- .../EditorScriptCanvasComponentSerializer.cpp | 69 ++++++++++++++++--- 3 files changed, 64 insertions(+), 13 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index 3d8599fdfb..3ad2580d3c 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -317,6 +316,7 @@ namespace ScriptCanvasEditor void EditorScriptCanvasComponent::BuildGameEntityData() { using namespace ScriptCanvasBuilder; + CompleteDescriptionInPlace(m_sourceHandle); m_runtimeDataIsValid = false; diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h index 76514267a3..d797f8db08 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h @@ -9,15 +9,16 @@ #pragma once #include +#include #include #include #include #include #include #include +#include #include #include -#include namespace ScriptCanvasEditor { @@ -39,11 +40,12 @@ namespace ScriptCanvasEditor , private EditorScriptCanvasComponentLoggingBus::Handler , private EditorScriptCanvasComponentRequestBus::Handler , private AzToolsFramework::EditorEntityContextNotificationBus::Handler - { public: AZ_COMPONENT(EditorScriptCanvasComponent, "{C28E2D29-0746-451D-A639-7F113ECF5D72}", AzToolsFramework::Components::EditorComponentBase); + friend class AZ::EditorScriptCanvasComponentSerializer; + EditorScriptCanvasComponent(); EditorScriptCanvasComponent(const SourceHandle& sourceHandle); ~EditorScriptCanvasComponent() override; diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponentSerializer.cpp b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponentSerializer.cpp index dfda030403..596c2d9dbf 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponentSerializer.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponentSerializer.cpp @@ -27,23 +27,72 @@ namespace AZ , "EditorScriptCanvasComponentSerializer Load against output typeID that was not EditorScriptCanvasComponent"); AZ_Assert(outputValue, "EditorScriptCanvasComponentSerializer Load against null output"); + // load as parent class auto outputComponent = reinterpret_cast(outputValue); - JsonSerializationResult::ResultCode result = BaseJsonSerializer::Load(outputValue, outputValueTypeId, inputValue, context); + JsonSerializationResult::ResultCode result = BaseJsonSerializer::Load(outputValue + , azrtti_typeid(), inputValue, context); + + // load child data one by one... + result.Combine(BaseJsonSerializer::Load(outputValue, outputValueTypeId, inputValue, context)); if (result.GetProcessing() != JSR::Processing::Halted) { + result.Combine(ContinueLoadingFromJsonObjectField + ( &outputComponent->m_name + , azrtti_typeid(outputComponent->m_name) + , inputValue + , "m_name" + , context)); + + result.Combine(ContinueLoadingFromJsonObjectField + ( &outputComponent->m_runtimeDataIsValid + , azrtti_typeid(outputComponent->m_runtimeDataIsValid) + , inputValue + , "runtimeDataIsValid" + , context)); + + result.Combine(ContinueLoadingFromJsonObjectField + ( &outputComponent->m_variableOverrides + , azrtti_typeid(outputComponent->m_variableOverrides) + , inputValue + , "runtimeDataOverrides" + , context)); + auto assetHolderMember = inputValue.FindMember("m_assetHolder"); - if (assetHolderMember != inputValue.MemberEnd()) + if (assetHolderMember == inputValue.MemberEnd()) { - ScriptCanvasEditor::ScriptCanvasAssetHolder assetHolder; - result.Combine - ( ContinueLoading(&assetHolder - , azrtti_typeid(), assetHolderMember->value, context)); - - if (result.GetProcessing() != JSR::Processing::Halted) + // file was saved with SourceHandle data + result.Combine(ContinueLoadingFromJsonObjectField + ( &outputComponent->m_sourceHandle + , azrtti_typeid(outputComponent->m_sourceHandle) + , inputValue + , "sourceHandle" + , context)); + } + else + { + // manually load the old asset info data + const rapidjson::Value& assetHolderValue = assetHolderMember->value; + if (auto assetMember = assetHolderValue.FindMember("m_asset"); assetMember != assetHolderValue.MemberEnd()) { - outputComponent->InitializeSource - ( ScriptCanvasEditor::SourceHandle(nullptr, assetHolder.GetAssetId().m_guid, assetHolder.GetAssetHint())); + const rapidjson::Value& assetValue = assetMember->value; + + AZ::Data::AssetId assetId{}; + if (auto assetIdMember = assetValue.FindMember("assetId"); assetIdMember != assetValue.MemberEnd()) + { + result.Combine(ContinueLoading(&assetId, azrtti_typeid(assetId), assetIdMember->value, context)); + } + + AZStd::string path{}; + if (auto pathMember = assetValue.FindMember("assetHint"); pathMember != assetValue.MemberEnd()) + { + result.Combine(ContinueLoading(&path, azrtti_typeid(path), pathMember->value, context)); + } + + if (result.GetProcessing() != JSR::Processing::Halted) + { + outputComponent->InitializeSource(ScriptCanvasEditor::SourceHandle(nullptr, assetId.m_guid, path)); + } } } } From 8da04f15d3a7e7c1b02e0d3431fe0bd90dfb481c Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Mon, 13 Dec 2021 11:15:02 -0800 Subject: [PATCH 120/948] Add some Value documentation Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 36 +++++++++---- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 50 +++++++++++++------ .../AzCore/Tests/DOM/DomValueTests.cpp | 16 +++--- 3 files changed, 68 insertions(+), 34 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index 72eb7ebadd..dcecc67460 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -144,12 +144,9 @@ namespace AZ::Dom case Type::Null: // Null is the default initialized value break; - case Type::False: + case Type::Bool: m_value = false; break; - case Type::True: - m_value = true; - break; case Type::Object: SetObject(); break; @@ -159,8 +156,14 @@ namespace AZ::Dom case Type::String: SetString(""); break; - case Type::Number: - m_value = 0.0; + case Type::Int64: + m_value = int64_t{}; + break; + case Type::Uint64: + m_value = uint64_t{}; + break; + case Type::Double: + m_value = double{}; break; case Type::Node: SetNode(""); @@ -227,11 +230,13 @@ namespace AZ::Dom case 0: // AZStd::monostate return Type::Null; case 1: // int64_t + return Type::Int64; case 2: // uint64_t + return Type::Uint64; case 3: // double - return Type::Number; + return Type::Double; case 4: // bool - return AZStd::get(m_value) ? Type::True : Type::False; + return Type::Bool; case 5: // AZStd::string_view case 6: // AZStd::shared_ptr case 7: // ShortStringType @@ -256,12 +261,12 @@ namespace AZ::Dom bool Value::IsFalse() const { - return GetType() == Type::False; + return IsBool() && !AZStd::get(m_value); } bool Value::IsTrue() const { - return GetType() == Type::True; + return IsBool() && AZStd::get(m_value); } bool Value::IsBool() const @@ -291,7 +296,16 @@ namespace AZ::Dom bool Value::IsNumber() const { - return GetType() == Type::Number; + switch (GetType()) + { + case Type::Int64: + [[fallthrough]]; + case Type::Uint64: + [[fallthrough]]; + case Type::Double: + return true; + } + return false; } bool Value::IsInt() const diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index 1a09b9a3c8..7ba73a8a4b 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -10,15 +10,15 @@ #include #include +#include #include #include -#include +#include #include #include #include #include #include -#include namespace AZ::Dom { @@ -27,19 +27,20 @@ namespace AZ::Dom //! The type of underlying value stored in a value. \see Value enum class Type { - Null = 0, - False = 1, - True = 2, - Object = 3, - Array = 4, - String = 5, - Number = 6, - Node = 7, - Opaque = 8, + Null, + Bool, + Object, + Array, + String, + Int64, + Uint64, + Double, + Node, + Opaque, }; //! The allocator used by Value. - //! Value heap allocates shared_ptrs for its container storage (Array / Object / Node) alongside + //! Value heap allocates shared_ptrs for its container storage (Array / Object / Node) alongside class ValueAllocator final : public SimpleSchemaAllocator { public: @@ -56,6 +57,7 @@ namespace AZ::Dom class Value; + //! Internal storage for a Value array: an ordered list of Values. class Array { public: @@ -73,6 +75,7 @@ namespace AZ::Dom using ArrayPtr = AZStd::shared_ptr; using ConstArrayPtr = AZStd::shared_ptr; + //! Internal storage for a Value object: an ordered list of Name / Value pairs. class Object { public: @@ -91,6 +94,9 @@ namespace AZ::Dom using ObjectPtr = AZStd::shared_ptr; using ConstObjectPtr = AZStd::shared_ptr; + //! Storage for a Value node: a named Value with both properties and children. + //! Properties are stored as an ordered list of Name / Value pairs. + //! Children are stored as an oredered list of Values. class Node { public: @@ -122,6 +128,21 @@ namespace AZ::Dom using NodePtr = AZStd::shared_ptr; using ConstNodePtr = AZStd::shared_ptr; + //! Value is a typed union of Dom types that can represent the types provdied by AZ::Dom::Visitor. + //! Value can be one of the following types: + //! - Null: a type with no value, this is the default type for Value + //! - Bool: a true or false boolean value + //! - Object: a container with an ordered list of Name/Value pairs, analagous to a JSON object + //! - Array: a container with an ordered list of Values, analagous to a JSON array + //! - String: a UTF-8 string + //! - Int64: a signed, 64-bit integer + //! - Uint64: an unsigned, 64-bit integer + //! - Double: a double precision floating point value + //! - Node: a container with a Name, an ordered list of Name/Values pairs (attributes), and an ordered list of Values (children), + //! analagous to an XML node + //! - Opaque: an arbitrary value stored in an AZStd::any. This is a non-serializable representation of an entry used only for in-memory + //! options. This is intended to be used as an intermediate value over the course of DOM transformation and as a proxy to pass through + //! types of which the DOM has no knowledge to other systems. class Value { public: @@ -327,7 +348,7 @@ namespace AZ::Dom //! The internal storage type for Value. //! These types do not correspond one-to-one with the Value's external Type as there may be multiple storage classes - //! for the same type in some instances, such as string storage + //! for the same type in some instances, such as string storage using ValueType = AZStd::variant< // NullType AZStd::monostate, @@ -351,8 +372,7 @@ namespace AZ::Dom AZStd::any*>; static_assert( - sizeof(ValueType) == sizeof(AZStd::variant), - "ValueType should have no members larger than ShortStringType"); + sizeof(ValueType) == sizeof(AZStd::variant), "ValueType should have no members larger than ShortStringType"); ValueType m_value; }; diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp index 62f3ad7601..b88ab746b9 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp @@ -218,9 +218,9 @@ namespace AZ::Dom::Tests m_value["int64_min"] = AZStd::numeric_limits::min(); m_value["int64_max"] = AZStd::numeric_limits::max(); - EXPECT_EQ(m_value["int64_min"].GetType(), Type::Number); + EXPECT_EQ(m_value["int64_min"].GetType(), Type::Int64); EXPECT_EQ(m_value["int64_min"].GetInt64(), AZStd::numeric_limits::min()); - EXPECT_EQ(m_value["int64_max"].GetType(), Type::Number); + EXPECT_EQ(m_value["int64_max"].GetType(), Type::Int64); EXPECT_EQ(m_value["int64_max"].GetInt64(), AZStd::numeric_limits::max()); PerformValueChecks(); @@ -232,9 +232,9 @@ namespace AZ::Dom::Tests m_value["uint64_min"] = AZStd::numeric_limits::min(); m_value["uint64_max"] = AZStd::numeric_limits::max(); - EXPECT_EQ(m_value["uint64_min"].GetType(), Type::Number); + EXPECT_EQ(m_value["uint64_min"].GetType(), Type::Uint64); EXPECT_EQ(m_value["uint64_min"].GetInt64(), AZStd::numeric_limits::min()); - EXPECT_EQ(m_value["uint64_max"].GetType(), Type::Number); + EXPECT_EQ(m_value["uint64_max"].GetType(), Type::Uint64); EXPECT_EQ(m_value["uint64_max"].GetInt64(), AZStd::numeric_limits::max()); PerformValueChecks(); @@ -246,9 +246,9 @@ namespace AZ::Dom::Tests m_value["double_min"] = AZStd::numeric_limits::min(); m_value["double_max"] = AZStd::numeric_limits::max(); - EXPECT_EQ(m_value["double_min"].GetType(), Type::Number); + EXPECT_EQ(m_value["double_min"].GetType(), Type::Double); EXPECT_EQ(m_value["double_min"].GetDouble(), AZStd::numeric_limits::min()); - EXPECT_EQ(m_value["double_max"].GetType(), Type::Number); + EXPECT_EQ(m_value["double_max"].GetType(), Type::Double); EXPECT_EQ(m_value["double_max"].GetDouble(), AZStd::numeric_limits::max()); PerformValueChecks(); @@ -271,9 +271,9 @@ namespace AZ::Dom::Tests m_value["true_value"] = true; m_value["false_value"] = false; - EXPECT_EQ(m_value["true_value"].GetType(), Type::True); + EXPECT_EQ(m_value["true_value"].GetType(), Type::Bool); EXPECT_EQ(m_value["true_value"].GetBool(), true); - EXPECT_EQ(m_value["false_value"].GetType(), Type::False); + EXPECT_EQ(m_value["false_value"].GetType(), Type::Bool); EXPECT_EQ(m_value["false_value"].GetBool(), false); PerformValueChecks(); From 2d13b648dad18c5205946370dfdda90f2e2eb78a Mon Sep 17 00:00:00 2001 From: rgba16f <82187279+rgba16f@users.noreply.github.com> Date: Fri, 10 Dec 2021 19:08:18 -0600 Subject: [PATCH 121/948] Change Vulkan RHI CommandList::SetStreamBuffers to not do 2 memory allocation per draw by using fixed_vector Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com> --- Gems/Atom/RHI/Vulkan/Code/Source/RHI/CommandList.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/CommandList.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/CommandList.cpp index 2620aa5f7b..45c04da491 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/CommandList.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/CommandList.cpp @@ -6,6 +6,7 @@ * */ #include +#include #include #include #include @@ -688,8 +689,8 @@ namespace AZ if (interval != InvalidInterval) { uint32_t numBuffers = interval.m_max - interval.m_min + 1; - AZStd::vector nativeBuffers(numBuffers, VK_NULL_HANDLE); - AZStd::vector offsets(numBuffers, 0); + AZStd::fixed_vector nativeBuffers(numBuffers, VK_NULL_HANDLE); + AZStd::fixed_vector offsets(numBuffers, 0); for (uint32_t i = 0; i < numBuffers; ++i) { const RHI::StreamBufferView& bufferView = streams[i + interval.m_min]; From d044f51a8913f60666e379fe143affeaa3dc79a6 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Mon, 13 Dec 2021 11:21:38 -0800 Subject: [PATCH 122/948] Remove DomDocument for now Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomDocument.cpp | 0 Code/Framework/AzCore/AzCore/DOM/DomDocument.h | 0 Code/Framework/AzCore/AzCore/azcore_files.cmake | 2 -- 3 files changed, 2 deletions(-) delete mode 100644 Code/Framework/AzCore/AzCore/DOM/DomDocument.cpp delete mode 100644 Code/Framework/AzCore/AzCore/DOM/DomDocument.h diff --git a/Code/Framework/AzCore/AzCore/DOM/DomDocument.cpp b/Code/Framework/AzCore/AzCore/DOM/DomDocument.cpp deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/Code/Framework/AzCore/AzCore/DOM/DomDocument.h b/Code/Framework/AzCore/AzCore/DOM/DomDocument.h deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/Code/Framework/AzCore/AzCore/azcore_files.cmake b/Code/Framework/AzCore/AzCore/azcore_files.cmake index e17fb941b8..ef2511bddc 100644 --- a/Code/Framework/AzCore/AzCore/azcore_files.cmake +++ b/Code/Framework/AzCore/AzCore/azcore_files.cmake @@ -127,8 +127,6 @@ set(FILES Debug/TraceReflection.h DOM/DomBackend.cpp DOM/DomBackend.h - DOM/DomDocument.cpp - DOM/DomDocument.h DOM/DomUtils.cpp DOM/DomUtils.h DOM/DomValue.cpp From 202226c2cb616dd62c3353ee3adfed805ae2ab60 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Mon, 13 Dec 2021 11:31:23 -0800 Subject: [PATCH 123/948] Document short string usage Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index 7ba73a8a4b..5cb67123e5 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -334,6 +334,8 @@ namespace AZ::Dom explicit Value(AZStd::any* opaqueValue); + // Determine the short string buffer size based on the size of our largest internal type (string_view) + // minus the size of the short string size field. static constexpr const size_t ShortStringSize = sizeof(AZStd::string_view) - sizeof(size_t); struct ShortStringType { @@ -348,7 +350,7 @@ namespace AZ::Dom //! The internal storage type for Value. //! These types do not correspond one-to-one with the Value's external Type as there may be multiple storage classes - //! for the same type in some instances, such as string storage + //! for the same type in some instances, such as string storage. using ValueType = AZStd::variant< // NullType AZStd::monostate, From af91cea8ef25280af54c4d37dadcdb073bca50c7 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Mon, 13 Dec 2021 11:56:53 -0800 Subject: [PATCH 124/948] Add copy-on-write note Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index 5cb67123e5..ecaea3db3d 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -143,6 +143,10 @@ namespace AZ::Dom //! - Opaque: an arbitrary value stored in an AZStd::any. This is a non-serializable representation of an entry used only for in-memory //! options. This is intended to be used as an intermediate value over the course of DOM transformation and as a proxy to pass through //! types of which the DOM has no knowledge to other systems. + //! \note Value is a copy-on-write data structure and may be cheaply returned by value. Heap allocated data larger than the size of the + //! value itself (objects, arrays, and nodes) are copied by new Values only when their contents change, so care should be taken in + //! performance critical code to avoid mutation operations such as operator[] to avoid copies. It is recommended that an immutable Value + //! be explicitly be stored as a `const Value` to avoid accidental detach and copy operations. class Value { public: From 946a77e9144c582f99f024c88f7831191a1150f9 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Mon, 13 Dec 2021 12:06:24 -0800 Subject: [PATCH 125/948] Document ValueWriter, add basic OpaqueValue handling Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp | 6 ++++++ Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h | 6 ++++++ Code/Framework/AzCore/AzCore/DOM/DomVisitor.cpp | 2 +- Code/Framework/AzCore/AzCore/DOM/DomVisitor.h | 3 +-- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp index ef99809290..172f7f2a92 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp @@ -220,6 +220,12 @@ namespace AZ::Dom return EndContainer(Type::Node, attributeCount, elementCount); } + Visitor::Result ValueWriter::OpaqueValue(OpaqueType& value) + { + CurrentValue().SetOpaqueValue(value); + return FinishWrite(); + } + Visitor::Result ValueWriter::FinishWrite() { if (m_entryStack.empty()) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h index 6086ff4fe5..7430ff910b 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h @@ -13,6 +13,8 @@ namespace AZ::Dom { + //! Visitor that writes to a Value. + //! Supports all Visitor operations. class ValueWriter : public Visitor { public: @@ -36,6 +38,7 @@ namespace AZ::Dom Result StartNode(AZ::Name name) override; Result RawStartNode(AZStd::string_view name, Lifetime lifetime) override; Result EndNode(AZ::u64 attributeCount, AZ::u64 elementCount) override; + Result OpaqueValue(OpaqueType& value) override; private: Result FinishWrite(); @@ -60,7 +63,10 @@ namespace AZ::Dom ValueBuffer& GetValueBuffer(); Value& m_result; + // Stores info about the current value being processed AZStd::stack m_entryStack; + // Provides temporary storage for elements and attributes to prevent extra heap allocations + // These buffers persist to be reused even as the entry stack changes AZStd::vector m_valueBuffers; }; } // namespace AZ::Dom diff --git a/Code/Framework/AzCore/AzCore/DOM/DomVisitor.cpp b/Code/Framework/AzCore/AzCore/DOM/DomVisitor.cpp index 5e3d6c2882..4e13a2a95c 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomVisitor.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomVisitor.cpp @@ -110,7 +110,7 @@ namespace AZ::Dom return String(*value, lifetime); } - Visitor::Result Visitor::OpaqueValue([[maybe_unused]] const OpaqueType& value, [[maybe_unused]] Lifetime lifetime) + Visitor::Result Visitor::OpaqueValue([[maybe_unused]] OpaqueType& value) { if (!SupportsOpaqueValues()) { diff --git a/Code/Framework/AzCore/AzCore/DOM/DomVisitor.h b/Code/Framework/AzCore/AzCore/DOM/DomVisitor.h index 938df1bb5a..3bf1b3419b 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomVisitor.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomVisitor.h @@ -181,8 +181,7 @@ namespace AZ::Dom //! indicate where the value may be stored persistently or requires a copy. //! The base implementation of OpaqueValue rejects the operation, as opaque values are meant for special //! cases with specific implementations, not generic usage. - //! Storage semantics are provided to indicate where the value may be stored persistently or requires a copy. - virtual Result OpaqueValue(const OpaqueType& value, Lifetime lifetime); + virtual Result OpaqueValue(OpaqueType& value); //! Operates on a raw value encoded as a UTF-8 string that hasn't had its type deduced. //! Visitors that support raw values (\see VisitorFlags::SupportsRawValues) may parse the raw value and //! forward it to the corresponding value call or calls of their choice. From c5d370723e18de8d2594ebac102ddf2da12467fd Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Mon, 13 Dec 2021 14:14:31 -0800 Subject: [PATCH 126/948] redcoding asset handler, holder, tracker, memory asset Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../Code/Asset/EditorAssetSystemComponent.cpp | 1 - .../Builder/ScriptCanvasBuilderComponent.cpp | 1 - .../Builder/ScriptCanvasBuilderWorker.cpp | 1 - .../ScriptCanvasBuilderWorkerUtility.cpp | 40 - .../Assets/ScriptCanvasAssetHandler.cpp | 289 -------- .../Editor/Assets/ScriptCanvasAssetHolder.cpp | 207 ------ .../Editor/Assets/ScriptCanvasAssetHolder.h | 99 --- .../Assets/ScriptCanvasAssetTracker.cpp | 441 ----------- .../Editor/Assets/ScriptCanvasAssetTracker.h | 124 ---- .../Assets/ScriptCanvasAssetTrackerBus.h | 159 ---- .../ScriptCanvasAssetTrackerDefinitions.h | 28 - .../Editor/Assets/ScriptCanvasMemoryAsset.cpp | 684 ------------------ .../Editor/Assets/ScriptCanvasMemoryAsset.h | 344 --------- .../Editor/Assets/ScriptCanvasUndoHelper.cpp | 1 - .../EditorScriptCanvasComponent.cpp | 17 +- .../FunctionNodeDescriptorComponent.cpp | 10 +- .../Assets/ScriptCanvasAssetHandler.h | 81 --- .../Components/EditorDeprecationData.cpp | 28 + .../Components/EditorDeprecationData.h | 34 + .../Components/EditorScriptCanvasComponent.h | 2 - .../Code/Editor/ReflectComponent.cpp | 4 +- .../Code/Editor/SystemComponent.cpp | 4 +- .../Code/Editor/SystemComponent.h | 3 - .../Editor/Undo/ScriptCanvasGraphCommand.cpp | 1 - .../Editor/Undo/ScriptCanvasGraphCommand.h | 2 - .../Code/Editor/View/Widgets/GraphTabBar.h | 1 - .../Widgets/NodePalette/NodePaletteModel.cpp | 1 - .../ScriptCanvasNodePaletteDockWidget.cpp | 56 +- .../StatisticsDialog/NodeUsageTreeItem.cpp | 6 +- .../UnitTestPanel/UnitTestDockWidget.cpp | 28 +- .../VariablePanel/SlotTypeSelectorWidget.cpp | 1 - .../VariablePanel/VariableDockWidget.cpp | 1 - .../Code/Editor/View/Windows/MainWindow.cpp | 39 +- .../Code/Editor/View/Windows/MainWindow.h | 8 +- .../Windows/Tools/UpgradeTool/Controller.cpp | 1 - .../Windows/Tools/UpgradeTool/FileSaver.cpp | 1 - .../View/Windows/Tools/UpgradeTool/Model.cpp | 1 - .../Tools/UpgradeTool/UpgradeHelper.cpp | 1 - .../Code/scriptcanvasgem_editor_files.cmake | 12 +- .../Framework/ScriptCanvasTestUtilities.cpp | 1 - 40 files changed, 137 insertions(+), 2626 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHandler.cpp delete mode 100644 Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHolder.cpp delete mode 100644 Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHolder.h delete mode 100644 Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.cpp delete mode 100644 Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.h delete mode 100644 Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerBus.h delete mode 100644 Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerDefinitions.h delete mode 100644 Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp delete mode 100644 Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.h delete mode 100644 Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetHandler.h create mode 100644 Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorDeprecationData.cpp create mode 100644 Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorDeprecationData.h diff --git a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp index 1f614a5a87..87a5dbf796 100644 --- a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp @@ -23,7 +23,6 @@ AZ_PUSH_DISABLE_WARNING(4251 4800 4244, "-Wunknown-warning-option") #include #include -#include #include #include AZ_POP_DISABLE_WARNING diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp index 019dd4f5e3..b7e4fb4a79 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp @@ -15,7 +15,6 @@ #include #include #include -#include #include namespace ScriptCanvasBuilder diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp index 6c35007987..24f9836236 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp index fb7b5e7a4a..fb4bb0a386 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -386,45 +385,6 @@ namespace ScriptCanvasBuilder ; } - 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(); - - // Read the asset into a memory buffer, then hand ownership of the buffer to assetDataStream - { - AZ::IO::FileIOStream stream(filePath.data(), AZ::IO::OpenMode::ModeRead); - if (!AZ::IO::RetryOpenStream(stream)) - { - AZ_Warning(s_scriptCanvasBuilder, false, "CreateJobs for \"%s\" failed because the source file could not be opened.", filePath.data()); - AZ::Failure(AZStd::string::format("Failed to load ScriptCavas asset: %s", filePath.data())); - } - AZStd::vector fileBuffer(stream.GetLength()); - size_t bytesRead = stream.Read(fileBuffer.size(), fileBuffer.data()); - if (bytesRead != stream.GetLength()) - { - AZ_Warning(s_scriptCanvasBuilder, false, "CreateJobs for \"%s\" failed because the source file could not be read.", filePath.data()); - AZ::Failure(AZStd::string::format("Failed to load ScriptCavas asset: %s", filePath.data())); - } - - assetDataStream->Open(AZStd::move(fileBuffer)); - } - - ScriptCanvasEditor::ScriptCanvasAssetHandler editorAssetHandler; - - AZ::SerializeContext* context{}; - AZ::ComponentApplicationBus::BroadcastResult(context, &AZ::ComponentApplicationBus::Events::GetSerializeContext); - - AZ::Data::Asset asset; - asset.Create(assetId); - - 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())); - } - - return AZ::Success(asset); - } - ScriptCanvasEditor::Graph* PrepareSourceGraph(AZ::Entity* const buildEntity) { auto sourceGraph = AZ::EntityUtils::FindFirstDerivedComponent(buildEntity); diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHandler.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHandler.cpp deleted file mode 100644 index 896d285054..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHandler.cpp +++ /dev/null @@ -1,289 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace ScriptCanvasAssetHandlerCpp -{ - using namespace ScriptCanvas; - - void CollectNodes(const GraphData::NodeContainer& container, SerializationListeners& listeners) - { - for (auto& nodeEntity : container) - { - if (nodeEntity) - { - if (auto listener = azrtti_cast(AZ::EntityUtils::FindFirstDerivedComponent(nodeEntity))) - { - listeners.push_back(listener); - } - } - } - } -} - -namespace ScriptCanvasEditor -{ - ScriptCanvasAssetHandler::ScriptCanvasAssetHandler(AZ::SerializeContext* context) - { - SetSerializeContext(context); - - AZ::AssetTypeInfoBus::MultiHandler::BusConnect(GetAssetType()); - } - - ScriptCanvasAssetHandler::~ScriptCanvasAssetHandler() - { - AZ::AssetTypeInfoBus::MultiHandler::BusDisconnect(); - } - - AZ::Data::AssetPtr ScriptCanvasAssetHandler::CreateAsset(const AZ::Data::AssetId& id, const AZ::Data::AssetType& type) - { - (void)type; - auto assetData = aznew ScriptCanvasAsset(id); - - AZ::Entity* scriptCanvasEntity = aznew AZ::Entity("Script Canvas Graph"); - SystemRequestBus::Broadcast(&SystemRequests::CreateEditorComponentsOnEntity, scriptCanvasEntity, azrtti_typeid()); - - assetData->SetScriptCanvasEntity(scriptCanvasEntity); - - return assetData; - } - - // Override the stream info to force source assets to load into the Editor instead of cached, processed assets. - void ScriptCanvasAssetHandler::GetCustomAssetStreamInfoForLoad(AZ::Data::AssetStreamInfo& streamInfo) - { - //ScriptCanvas files are source assets and should be placed in a source asset directory - const char* assetPath = streamInfo.m_streamName.c_str(); - if (AzFramework::StringFunc::Path::IsRelative(assetPath)) - { - AZStd::string watchFolder; - bool sourceInfoFound{}; - AZ::Data::AssetInfo assetInfo; - AzToolsFramework::AssetSystemRequestBus::BroadcastResult(sourceInfoFound, &AzToolsFramework::AssetSystemRequestBus::Events::GetSourceInfoBySourcePath, assetPath, assetInfo, watchFolder); - if (sourceInfoFound) - { - AzFramework::StringFunc::Path::Join(watchFolder.data(), assetInfo.m_relativePath.data(), streamInfo.m_streamName); - } - } - } - - AZ::Data::AssetHandler::LoadResult ScriptCanvasAssetHandler::LoadAssetData - ( const AZ::Data::Asset& assetTarget - , AZStd::shared_ptr streamSource - , [[maybe_unused]] const AZ::Data::AssetFilterCB& assetLoadFilterCB) - { - namespace JSRU = AZ::JsonSerializationUtils; - using namespace ScriptCanvas; - - auto* scriptCanvasAssetTarget = assetTarget.GetAs(); - AZ_Assert(scriptCanvasAssetTarget, "This should be a ScriptCanvasAsset, as this is the only type we process!"); - - if (m_serializeContext - && streamSource - && scriptCanvasAssetTarget) - { - streamSource->Seek(0U, AZ::IO::GenericStream::ST_SEEK_BEGIN); - auto& scriptCanvasDataTarget = scriptCanvasAssetTarget->GetScriptCanvasData(); - AZStd::vector byteBuffer; - byteBuffer.resize_no_construct(streamSource->GetLength()); - // this duplicate stream is to allow for trying again if the JSON read fails - AZ::IO::ByteContainerStream byteStreamSource(&byteBuffer); - const size_t bytesRead = streamSource->Read(byteBuffer.size(), byteBuffer.data()); - scriptCanvasDataTarget.m_scriptCanvasEntity.reset(nullptr); - - if (bytesRead == streamSource->GetLength()) - { - byteStreamSource.Seek(0U, AZ::IO::GenericStream::ST_SEEK_BEGIN); - AZ::JsonDeserializerSettings settings; - settings.m_serializeContext = m_serializeContext; - settings.m_metadata.Create(); - // attempt JSON deserialization... - auto jsonResult = LoadDataFromJson - ( scriptCanvasDataTarget - , AZStd::string_view{ byteBuffer.begin(), byteBuffer.size() } - , *m_serializeContext); - - if (jsonResult.IsSuccess()) - { - return AZ::Data::AssetHandler::LoadResult::LoadComplete; - } -#if defined(OBJECT_STREAM_EDITOR_ASSET_LOADING_SUPPORT_ENABLED)//// - else - { - // ...if there is a failure, check if it is saved in the old format - byteStreamSource.Seek(0U, AZ::IO::GenericStream::ST_SEEK_BEGIN); - // tolerate unknown classes in the editor. Let the asset processor warn about bad nodes... - if (AZ::Utils::LoadObjectFromStreamInPlace - ( byteStreamSource - , scriptCanvasDataTarget - , m_serializeContext - , AZ::ObjectStream::FilterDescriptor(assetLoadFilterCB, AZ::ObjectStream::FILTERFLAG_IGNORE_UNKNOWN_CLASSES))) - { - AZ_Warning - ( "ScriptCanvas" - , false - , "ScriptCanvasAssetHandler::LoadAssetData failed to load graph data from JSON, %s, consider converting to JSON" - " by opening it and saving it, or running the graph update tool from the editor0" - , jsonResult.GetError().c_str()); - return AZ::Data::AssetHandler::LoadResult::LoadComplete; - } - } -#else - else - { - AZ_Warning - ( "ScriptCanvas" - , false - , "ScriptCanvasAssetHandler::LoadAssetData failed to load graph data from JSON %s" - , jsonResult.GetError().c_str()"); - } -#endif//defined(OBJECT_STREAM_EDITOR_ASSET_LOADING_SUPPORT_ENABLED) - } - } - - return AZ::Data::AssetHandler::LoadResult::Error; - } - - bool ScriptCanvasAssetHandler::SaveAssetData(const AZ::Data::Asset& asset, AZ::IO::GenericStream* stream) - { - return SaveAssetData(asset.GetAs(), stream); - } - - bool ScriptCanvasAssetHandler::SaveAssetData(const ScriptCanvasAsset* assetData, AZ::IO::GenericStream* stream) - { - return SaveAssetData(assetData, stream, AZ::DataStream::ST_XML); - } - - bool ScriptCanvasAssetHandler::SaveAssetData - ( const ScriptCanvasAsset* assetData - , AZ::IO::GenericStream* stream - , [[maybe_unused]] AZ::DataStream::StreamType streamType) - { - // #sc_editor_asset delete usage of this, and route to ScriptCanvasEditor::SaveToStream - namespace JSRU = AZ::JsonSerializationUtils; - using namespace ScriptCanvas; - - if (m_serializeContext - && stream - && assetData - && assetData->GetScriptCanvasGraph() - && assetData->GetScriptCanvasGraph()->GetGraphData()) - { - auto graphData = assetData->GetScriptCanvasGraph()->GetGraphData(); - AZ::JsonSerializerSettings settings; - settings.m_metadata.Create(); - auto listeners = settings.m_metadata.Find(); - AZ_Assert(listeners, "Failed to create SerializationListeners"); - ScriptCanvasAssetHandlerCpp::CollectNodes(graphData->m_nodes, *listeners); - settings.m_keepDefaults = false; - settings.m_serializeContext = m_serializeContext; - - for (auto listener : *listeners) - { - listener->OnSerialize(); - } - - return JSRU::SaveObjectToStream(&assetData->GetScriptCanvasData(), *stream, nullptr, &settings).IsSuccess(); - } - else - { - AZ_Error("ScriptCanvas", false, "Saving ScriptCavas assets in the handler requires a valid IO stream, " - "asset pointer, and serialize context"); - return false; - } - } - - void ScriptCanvasAssetHandler::DestroyAsset(AZ::Data::AssetPtr ptr) - { - delete ptr; - } - - AZ::SerializeContext* ScriptCanvasAssetHandler::GetSerializeContext() const - { - return m_serializeContext; - } - - void ScriptCanvasAssetHandler::SetSerializeContext(AZ::SerializeContext* context) - { - m_serializeContext = context; - - if (m_serializeContext == nullptr) - { - // use the default app serialize context - EBUS_EVENT_RESULT(m_serializeContext, AZ::ComponentApplicationBus, GetSerializeContext); - if (!m_serializeContext) - { - AZ_Error("Script Canvas", false, "ScriptCanvasAssetHandler: No serialize context provided! " - "We will not be able to process Graph Asset type"); - } - } - } - - void ScriptCanvasAssetHandler::GetHandledAssetTypes(AZStd::vector& assetTypes) - { - assetTypes.push_back(GetAssetType()); - } - - AZ::Data::AssetType ScriptCanvasAssetHandler::GetAssetType() const - { - return ScriptCanvasAssetHandler::GetAssetTypeStatic(); - } - - const char* ScriptCanvasAssetHandler::GetAssetTypeDisplayName() const - { - return "Script Canvas"; - } - - AZ::Data::AssetType ScriptCanvasAssetHandler::GetAssetTypeStatic() - { - return azrtti_typeid(); - } - - void ScriptCanvasAssetHandler::GetAssetTypeExtensions(AZStd::vector& extensions) - { - ScriptCanvasAsset::Description description; - extensions.push_back(description.GetExtensionImpl()); - } - - AZ::Uuid ScriptCanvasAssetHandler::GetComponentTypeId() const - { - return azrtti_typeid(); - } - - const char* ScriptCanvasAssetHandler::GetGroup() const - { - return ScriptCanvas::AssetDescription::GetGroup(); - } - - const char* ScriptCanvasAssetHandler::GetBrowserIcon() const - { - return ScriptCanvas::AssetDescription::GetIconPath(); - } -} diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHolder.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHolder.cpp deleted file mode 100644 index f8c89ae7e5..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHolder.cpp +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#include - -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include - -namespace ScriptCanvasEditor -{ - //========================================================================= - void ScriptCanvasAssetHolder::Reflect(AZ::ReflectContext* context) - { - if (auto serializeContext = azrtti_cast(context)) - { - serializeContext->Class() - ->Version(1) - ->Field("m_asset", &ScriptCanvasAssetHolder::m_scriptCanvasAsset) - ; - - if (AZ::EditContext* editContext = serializeContext->GetEditContext()) - { - editContext->Class("Script Canvas", "Script Canvas Asset Holder") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->DataElement(AZ::Edit::UIHandlers::Default, &ScriptCanvasAssetHolder::m_scriptCanvasAsset, "Script Canvas Asset", "Script Canvas asset associated with this component") - ->Attribute(AZ::Edit::Attributes::ChangeNotify, &ScriptCanvasAssetHolder::OnScriptChanged) - ->Attribute("BrowseIcon", ":/stylesheet/img/UI20/browse-edit-select-files.svg") - ->Attribute("EditButton", "") - ->Attribute("EditDescription", "Open in Script Canvas Editor") - ->Attribute("EditCallback", &ScriptCanvasAssetHolder::LaunchScriptCanvasEditor) - ->Attribute(AZ::Edit::Attributes::ShowProductAssetFileName, false) - ; - } - } - } - - ScriptCanvasAssetHolder::~ScriptCanvasAssetHolder() - { - } - - void ScriptCanvasAssetHolder::Init(AZ::EntityId ownerId, AZ::ComponentId componentId) - { - m_ownerId = AZStd::make_pair(ownerId, componentId); - - if (!m_scriptCanvasAsset || !m_scriptCanvasAsset.IsReady()) - { - AssetTrackerNotificationBus::Handler::BusConnect(m_scriptCanvasAsset.GetId()); - - Callbacks::OnAssetReadyCallback onAssetReady = [](ScriptCanvasMemoryAsset& asset) - { - AssetHelpers::DumpAssetInfo(asset.GetFileAssetId(), "ScriptCanvasAssetHolder::Init"); - }; - AssetTrackerRequestBus::Broadcast(&AssetTrackerRequests::Load, m_scriptCanvasAsset.GetId(), azrtti_typeid(), onAssetReady); - } - } - - void ScriptCanvasAssetHolder::LaunchScriptCanvasEditor(const AZ::Data::AssetId&, const AZ::Data::AssetType&) const - { - OpenEditor(); - } - - void ScriptCanvasAssetHolder::OpenEditor() const - { - } - - ScriptCanvas::ScriptCanvasId ScriptCanvasAssetHolder::GetScriptCanvasId() const - { - ScriptCanvas::ScriptCanvasId graphId; - if (m_scriptCanvasAsset.IsReady()) - { - ScriptCanvas::SystemRequestBus::BroadcastResult(graphId, &ScriptCanvas::SystemRequests::FindScriptCanvasId, m_scriptCanvasAsset.Get()->GetScriptCanvasEntity()); - } - - return graphId; - } - - void ScriptCanvasAssetHolder::SetScriptChangedCB(const ScriptChangedCB& scriptChangedCB) - { - m_scriptNotifyCallback = scriptChangedCB; - } - - void ScriptCanvasAssetHolder::Load(AZ::Data::AssetId fileAssetId) - { - m_scriptCanvasAsset = AZ::Data::AssetManager::Instance().FindAsset(fileAssetId, AZ::Data::AssetLoadBehavior::Default); - - if (!m_scriptCanvasAsset || !m_scriptCanvasAsset.IsReady()) - { - m_scriptCanvasAsset = AZ::Data::AssetManager::Instance().GetAsset(fileAssetId, azrtti_typeid(), AZ::Data::AssetLoadBehavior::Default); - m_triggeredLoad = true; - - AZ::Data::AssetBus::Handler::BusDisconnect(); - AZ::Data::AssetBus::Handler::BusConnect(fileAssetId); - } - else if (m_memoryScriptCanvasAsset.Get() == nullptr) - { - m_triggeredLoad = false; - LoadMemoryAsset(fileAssetId); - } - } - - void ScriptCanvasAssetHolder::LoadMemoryAsset(AZ::Data::AssetId fileAssetId) - { - Callbacks::OnAssetReadyCallback onAssetReady = [this](ScriptCanvasMemoryAsset& asset) - { - m_memoryScriptCanvasAsset = asset.GetAsset(); - AssetHelpers::DumpAssetInfo(asset.GetFileAssetId(), "ScriptCanvasAssetHolder::Load onAssetReady"); - }; - - AssetTrackerRequestBus::Broadcast(&AssetTrackerRequests::Load, fileAssetId, azrtti_typeid(), onAssetReady); - } - - void ScriptCanvasAssetHolder::OnAssetReady(AZ::Data::Asset asset) - { - AZ::Data::AssetBus::Handler::BusDisconnect(); - LoadMemoryAsset(asset.GetId()); - } - - AZ::u32 ScriptCanvasAssetHolder::OnScriptChanged() - { - AssetTrackerNotificationBus::Handler::BusDisconnect(); - - if (m_scriptCanvasAsset.GetId().IsValid()) - { - AssetTrackerNotificationBus::Handler::BusConnect(m_scriptCanvasAsset.GetId()); - Load(m_scriptCanvasAsset.GetId()); - } - else - { - m_scriptCanvasAsset = {}; - m_memoryScriptCanvasAsset = {}; - } - - if (m_scriptNotifyCallback) - { - m_scriptNotifyCallback(m_scriptCanvasAsset.GetId()); - } - - return AZ::Edit::PropertyRefreshLevels::EntireTree; - } - - void ScriptCanvasAssetHolder::OnAssetReady(const ScriptCanvasMemoryAsset::pointer asset) - { - if (asset->GetFileAssetId() == m_scriptCanvasAsset.GetId()) - { - AssetTrackerNotificationBus::Handler::BusDisconnect(m_scriptCanvasAsset.GetId()); - - m_scriptCanvasAsset = AZ::Data::AssetManager::Instance().FindAsset(asset->GetFileAssetId(), AZ::Data::AssetLoadBehavior::Default); - m_memoryScriptCanvasAsset = asset->GetAsset(); - - if (m_triggeredLoad && m_scriptNotifyCallback) - { - m_triggeredLoad = false; - m_scriptNotifyCallback(m_scriptCanvasAsset.GetId()); - } - } - } - - void ScriptCanvasAssetHolder::SetAsset(AZ::Data::AssetId fileAssetId) - { - AZ::Data::AssetBus::Handler::BusDisconnect(); - AssetTrackerNotificationBus::Handler::BusDisconnect(); - - Load(fileAssetId); - - if (m_scriptCanvasAsset) - { - AssetTrackerNotificationBus::Handler::BusConnect(m_scriptCanvasAsset.GetId()); - } - } - - const AZ::Data::AssetType& ScriptCanvasAssetHolder::GetAssetType() const - { - return m_scriptCanvasAsset.GetType(); - } - - void ScriptCanvasAssetHolder::ClearAsset() - { - m_scriptCanvasAsset = {}; - m_memoryScriptCanvasAsset = {}; - } - - AZ::Data::AssetId ScriptCanvasAssetHolder::GetAssetId() const - { - return m_scriptCanvasAsset.GetId(); - } -} diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHolder.h b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHolder.h deleted file mode 100644 index bc2f50144a..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHolder.h +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#pragma once - -#include -#include -#include - -#include -#include - -namespace ScriptCanvasEditor -{ - class ScriptCanvasAsset; - - /*! ScriptCanvasAssetHolder - Wraps a ScriptCanvasAsset reference and registers for the individual AssetBus events - for saving, loading and unloading the asset. - The ScriptCanvasAsset Holder contains functionality for activating the ScriptCanvasEntity stored on the reference asset - as well as attempting to open the ScriptCanvasAsset within the ScriptCanvas Editor. - It also provides the EditContext reflection for opening the asset in the ScriptCanvas Editor via a button - */ - class ScriptCanvasAssetHolder - : AssetTrackerNotificationBus::Handler - , AZ::Data::AssetBus::Handler - { - public: - AZ_RTTI(ScriptCanvasAssetHolder, "{3E80CEE3-2932-4DC1-AADF-398FDDC6DEFE}"); - AZ_CLASS_ALLOCATOR(ScriptCanvasAssetHolder, AZ::SystemAllocator, 0); - - using ScriptChangedCB = AZStd::function; - - ScriptCanvasAssetHolder() = default; - ~ScriptCanvasAssetHolder() override; - - static void Reflect(AZ::ReflectContext* context); - - void Init(AZ::EntityId ownerId = AZ::EntityId(), AZ::ComponentId componentId = AZ::ComponentId()); - - const AZ::Data::AssetType& GetAssetType() const; - void ClearAsset(); - - void SetAsset(AZ::Data::AssetId fileAssetId); - AZ::Data::AssetId GetAssetId() const; - - ScriptCanvas::ScriptCanvasId GetScriptCanvasId() const; - - void LaunchScriptCanvasEditor(const AZ::Data::AssetId&, const AZ::Data::AssetType&) const; - void OpenEditor() const; - - void SetScriptChangedCB(const ScriptChangedCB&); - void Load(AZ::Data::AssetId fileAssetId); - void LoadMemoryAsset(AZ::Data::AssetId fileAssetId); - - //! AZ::Data::AssetBus - void OnAssetReady(AZ::Data::Asset asset) override; - //// - - const AZStd::string_view GetAssetHint() const - { - if (m_scriptCanvasAsset) - { - return m_scriptCanvasAsset.GetHint().c_str(); - } - - if (m_memoryScriptCanvasAsset) - { - return m_memoryScriptCanvasAsset.GetHint().c_str(); - } - - return ""; - } - - protected: - - //===================================================================== - // AssetTrackerNotificationBus - void OnAssetReady(const ScriptCanvasMemoryAsset::pointer asset) override; - //===================================================================== - - //! Reloads the Script From the AssetData if it has changed - AZ::u32 OnScriptChanged(); - - AZ::Data::Asset m_scriptCanvasAsset; - AZ::Data::Asset m_memoryScriptCanvasAsset; - - TypeDefs::EntityComponentId m_ownerId; // Id of Entity which stores this AssetHolder object - ScriptChangedCB m_scriptNotifyCallback; - - bool m_triggeredLoad = false; - }; - -} diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.cpp deleted file mode 100644 index 09b967281d..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.cpp +++ /dev/null @@ -1,441 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * 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 "ScriptCanvasAssetTracker.h" - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include - -#include - -#include -#include - -#include - -namespace ScriptCanvasEditor -{ - ///////////////// - // AssetTracker - ///////////////// - - AZ::Data::AssetId AssetTracker::Create(AZStd::string_view assetAbsolutePath, AZ::Data::AssetType assetType, Callbacks::OnAssetCreatedCallback onAssetCreatedCallback) - { - AZ::Data::AssetId newAssetId = AZ::Uuid::CreateRandom(); - - MemoryAssetMapIterator iterator = m_assetsInUse.emplace(newAssetId, AZStd::make_shared()); - - ScriptCanvasMemoryAsset::pointer memoryAsset = iterator.first->second; - - memoryAsset->Create(newAssetId, assetAbsolutePath, assetType, onAssetCreatedCallback); - - return newAssetId; - } - - bool AssetTracker::IsSaving(AZ::Data::AssetId assetId) const - { - assetId = CheckAssetId(assetId); - return m_savingAssets.find(assetId) != m_savingAssets.end(); - } - - void AssetTracker::Save(AZ::Data::AssetId assetId, Callbacks::OnSave onSaveCallback) - { - SaveAs(assetId, {}, onSaveCallback); - } - - void AssetTracker::SaveAs(AZ::Data::AssetId /*assetId*/, const AZStd::string& /*path*/, Callbacks::OnSave /*onSaveCallback*/) - { - } - - bool AssetTracker::Load(AZ::Data::AssetId fileAssetId, AZ::Data::AssetType assetType, Callbacks::OnAssetReadyCallback onAssetReadyCallback) - { - if (!fileAssetId.IsValid()) - { - return false; - } - - auto assetIter = m_assetsInUse.find(fileAssetId); - - if (assetIter != m_assetsInUse.end()) - { - if (!assetIter->second->IsSourceInError()) - { - if (onAssetReadyCallback) - { - // The asset is already loaded and tracked - AZStd::invoke(onAssetReadyCallback, *m_assetsInUse[fileAssetId]); - AssetTrackerNotificationBus::Event(fileAssetId, &AssetTrackerNotifications::OnAssetReady, m_assetsInUse[fileAssetId]); - } - - return true; - } - else - { - m_assetsInUse.erase(assetIter); - } - } - - m_assetsInUse[fileAssetId] = AZStd::make_shared(); - - m_onAssetReadyCallback = onAssetReadyCallback; - - auto onReady = [this, fileAssetId](ScriptCanvasMemoryAsset& asset) - { - m_remappedAsset[asset.GetId()] = fileAssetId; - - if (m_onAssetReadyCallback) - { - AZStd::invoke(m_onAssetReadyCallback, *m_assetsInUse[fileAssetId]); - } - }; - - // If we failed to load the asset, signal back as much - if (!m_assetsInUse[fileAssetId]->Load(fileAssetId, assetType, onReady)) - { - m_assetsInUse.erase(fileAssetId); - return false; - } - - return true; - } - - void AssetTracker::Close(AZ::Data::AssetId assetId) - { - assetId = CheckAssetId(assetId); - - if (m_assetsInUse.find(assetId) == m_assetsInUse.end()) - { - return; - } - - if (m_savingAssets.find(assetId) == m_savingAssets.end()) - { - m_assetsInUse.erase(assetId); - } - else - { - m_queuedCloses.insert(assetId); - } - } - - void AssetTracker::ClearView(AZ::Data::AssetId assetId) - { - assetId = CheckAssetId(assetId); - - if (m_assetsInUse.find(assetId) != m_assetsInUse.end()) - { - m_assetsInUse[assetId]->ClearView(); - } - } - - void AssetTracker::UntrackAsset(AZ::Data::AssetId assetId) - { - assetId = CheckAssetId(assetId); - m_assetsInUse.erase(assetId); - } - - void AssetTracker::RefreshAll() - { - for (const auto& asset : m_assetsInUse) - { - auto id = asset.second->GetScriptCanvasId(); - ScriptCanvasEditor::EditorGraphRequestBus::Event(id, &ScriptCanvasEditor::EditorGraphRequests::ClearGraphCanvasScene); - ScriptCanvasEditor::EditorGraphRequestBus::Event(id, &ScriptCanvasEditor::EditorGraphRequests::CreateGraphCanvasScene); - ScriptCanvasEditor::EditorGraphRequestBus::Event(id, &ScriptCanvasEditor::EditorGraphRequests::DisplayGraphCanvasScene); - } - } - - void AssetTracker::CreateView(AZ::Data::AssetId assetId, QWidget* parent) - { - assetId = CheckAssetId(assetId); - - if (m_assetsInUse.find(assetId) != m_assetsInUse.end()) - { - m_assetsInUse[assetId]->CreateView(parent); - } - } - - ScriptCanvasMemoryAsset::pointer AssetTracker::GetAsset(AZ::Data::AssetId assetId) - { - if (!assetId.IsValid()) - { - return nullptr; - } - - assetId = CheckAssetId(assetId); - - if (m_assetsInUse.find(assetId) == m_assetsInUse.end()) - { - auto asset = AZ::Data::AssetManager::Instance().FindAsset(assetId, AZ::Data::AssetLoadBehavior::Default); - if (asset) - { - auto insertResult = m_assetsInUse.emplace(AZStd::make_pair(assetId, AZStd::make_shared())); - - auto onReady = [this, assetId](ScriptCanvasMemoryAsset& asset) - { - m_remappedAsset[asset.GetId()] = assetId; - }; - - insertResult.first->second->Load(assetId, AZ::Data::AssetType::CreateNull(), onReady); - insertResult.first->second->ActivateAsset(); - - return insertResult.first->second; - } - - // Handle the weird case of saving out a file you can't load because of pathing issues. - for (auto assetPair : m_assetsInUse) - { - if (assetPair.second->GetFileAssetId() == assetId) - { - return assetPair.second; - } - } - - return nullptr; - } - - if (m_assetsInUse.find(assetId) != m_assetsInUse.end()) - { - return m_assetsInUse[assetId]; - } - - return nullptr; - } - - AZ::Data::AssetId AssetTracker::GetAssetId(ScriptCanvas::ScriptCanvasId scriptCanvasSceneId) - { - for (const auto& asset : m_assetsInUse) - { - if (asset.second && asset.second->GetScriptCanvasId() == scriptCanvasSceneId) - { - AZ::Data::AssetId assetId = asset.second->GetAsset().GetId(); - return assetId; - } - } - return {}; - } - - AZ::Data::AssetType AssetTracker::GetAssetType(ScriptCanvas::ScriptCanvasId scriptCanvasSceneId) - { - for (const auto& asset : m_assetsInUse) - { - if (asset.second && asset.second->GetScriptCanvasId() == scriptCanvasSceneId) - { - return asset.second->GetAssetType(); - } - } - return AZ::Data::AssetType::CreateNull(); - } - - - ScriptCanvas::ScriptCanvasId AssetTracker::GetScriptCanvasId(AZ::Data::AssetId assetId) - { - assetId = CheckAssetId(assetId); - - if (m_assetsInUse.find(assetId) != m_assetsInUse.end()) - { - return m_assetsInUse[assetId]->GetScriptCanvasId(); - } - return ScriptCanvas::ScriptCanvasId(); - } - - AZ::EntityId AssetTracker::GetGraphCanvasId(AZ::EntityId scriptCanvasEntityId) - { - if (scriptCanvasEntityId.IsValid()) - { - for (auto& asset : m_assetsInUse) - { - if (asset.second && asset.second->GetScriptCanvasId() == scriptCanvasEntityId) - { - return asset.second->GetGraphId(); - } - } - } - - return AZ::EntityId(); - } - - ScriptCanvas::ScriptCanvasId AssetTracker::GetScriptCanvasIdFromGraphId(AZ::EntityId graphId) - { - if (graphId.IsValid()) - { - for (auto& asset : m_assetsInUse) - { - if (asset.second && asset.second->GetGraphId() == graphId) - { - return asset.second->GetScriptCanvasId(); - } - } - } - return AZ::EntityId(); - } - - ScriptCanvas::ScriptCanvasId AssetTracker::GetGraphId(AZ::Data::AssetId assetId) - { - if (assetId.IsValid()) - { - assetId = CheckAssetId(assetId); - - auto assetIter = m_assetsInUse.find(assetId); - if (assetIter != m_assetsInUse.end()) - { - return assetIter->second->GetGraphId(); - } - } - - return ScriptCanvas::ScriptCanvasId(); - } - - AZStd::string AssetTracker::GetTabName(AZ::Data::AssetId assetId) - { - assetId = CheckAssetId(assetId); - - if (m_assetsInUse.find(assetId) != m_assetsInUse.end()) - { - return m_assetsInUse[assetId]->GetTabName(); - } - - return {}; - } - - ScriptCanvasEditor::Tracker::ScriptCanvasFileState AssetTracker::GetFileState(AZ::Data::AssetId assetId) - { - assetId = CheckAssetId(assetId); - - if (m_assetsInUse.find(assetId) != m_assetsInUse.end()) - { - return m_assetsInUse[assetId]->GetFileState(); - } - - return Tracker::ScriptCanvasFileState::INVALID; - } - - void AssetTracker::SignalSaveComplete(const AZ::Data::AssetId& fileAssetId) - { - size_t eraseCount = m_savingAssets.erase(fileAssetId); - - if (eraseCount > 0) - { - if (m_queuedCloses.erase(fileAssetId) > 0) - { - Close(fileAssetId); - } - } - } - - AZ::Data::AssetId AssetTracker::CheckAssetId(AZ::Data::AssetId assetId) const - { - auto remappedIter = m_remappedAsset.find(assetId); - if (remappedIter != m_remappedAsset.end()) - { - assetId = remappedIter->second; - } - return assetId; - } - - ScriptCanvasEditor::ScriptCanvasAssetHandler* AssetTracker::GetAssetHandlerForType(AZ::Data::AssetType assetType) - { - ScriptCanvasAssetHandler* assetHandler = nullptr; - - AZ::EBusAggregateResults foundAssetHandlers; - ScriptCanvas::AssetRegistryRequestBus::BroadcastResult(foundAssetHandlers, &ScriptCanvas::AssetRegistryRequests::GetAssetHandler); - - for (auto handler : foundAssetHandlers.values) - { - if (handler != nullptr) - { - ScriptCanvasAssetHandler* theHandler = azrtti_cast(handler); - if (theHandler != nullptr && theHandler->GetAssetType() == assetType) - { - assetHandler = theHandler; - break; - } - } - } - - AZ_Assert(assetHandler, "The specified asset type does not have a registered asset handler."); - return assetHandler; - } - - void AssetTracker::UpdateFileState(AZ::Data::AssetId assetId, Tracker::ScriptCanvasFileState state) - { - assetId = CheckAssetId(assetId); - - if (m_assetsInUse.find(assetId) != m_assetsInUse.end()) - { - m_assetsInUse[assetId]->SetFileState(state); - } - } - - AssetTrackerRequests::AssetList AssetTracker::GetUnsavedAssets() - { - auto pred = [](ScriptCanvasMemoryAsset::pointer asset) - { - auto fileState = asset->GetFileState(); - if (fileState == Tracker::ScriptCanvasFileState::NEW || fileState == Tracker::ScriptCanvasFileState::MODIFIED) - { - return true; - } - return false; - }; - - return GetAssetsIf(pred); - } - - AssetTrackerRequests::AssetList AssetTracker::GetAssets() - { - return GetAssetsIf([](ScriptCanvasMemoryAsset::pointer) { return true; }); - } - - AssetTrackerRequests::AssetList AssetTracker::GetAssetsIf(AZStd::function pred) - { - AZStd::vector unsavedAssets; - for (auto& assetIterator : m_assetsInUse) - { - auto testAsset = assetIterator.second; - if (AZStd::invoke(pred, testAsset) == true) - { - unsavedAssets.push_back(testAsset); - } - } - return unsavedAssets; - } - - AZ::EntityId AssetTracker::GetSceneEntityIdFromEditorEntityId(AZ::Data::AssetId assetId, AZ::EntityId editorEntityId) - { - assetId = CheckAssetId(assetId); - if (m_assetsInUse.find(assetId) != m_assetsInUse.end()) - { - return m_assetsInUse[assetId]->GetSceneEntityIdFromEditorEntityId(editorEntityId); - } - - return AZ::EntityId(); - } - - AZ::EntityId AssetTracker::GetEditorEntityIdFromSceneEntityId(AZ::Data::AssetId assetId, AZ::EntityId sceneEntityId) - { - assetId = CheckAssetId(assetId); - if (m_assetsInUse.find(assetId) != m_assetsInUse.end()) - { - return m_assetsInUse[assetId]->GetEditorEntityIdFromSceneEntityId(sceneEntityId); - } - - return AZ::EntityId(); - } - -} diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.h b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.h deleted file mode 100644 index aa06029c98..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTracker.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#pragma once - -#include -#include -#include -#include - -#include - -#include -#include - - -namespace ScriptCanvasEditor -{ - class ScriptCanvasMemoryAsset; - - // This class tracks all things related to the assets that the Script Canvas editor - // has in play. It also provides helper functionality to quickly getting asset information - // from GraphCanvas - // - // The AssetTracker will be the ONLY allowed place to connect Script Canvas to the Asset System and any of its buses. - // - // The goal is to centralize all of the asset operations to a single place in order to simplify Script Canvas' - // interactions with the asset system as well as keeping any transient cache of information that is - // only important while Script Canvas graphs are open. - - class AssetTracker - : AssetTrackerRequestBus::Handler - , Internal::MemoryAssetSystemNotificationBus::Handler - { - public: - AssetTracker() = default; - ~AssetTracker() = default; - void Activate() - { - AssetTrackerRequestBus::Handler::BusConnect(); - Internal::MemoryAssetSystemNotificationBus::Handler::BusConnect(); - } - - void Deactivate() - { - Internal::MemoryAssetSystemNotificationBus::Handler::BusDisconnect(); - AssetTrackerRequestBus::Handler::BusDisconnect(); - } - - // AssetTrackerRequestBus - AZ::Data::AssetId Create(AZStd::string_view assetAbsolutePath, AZ::Data::AssetType assetType, Callbacks::OnAssetCreatedCallback onAssetCreatedCallback) override; - bool IsSaving(AZ::Data::AssetId assetId) const override; - void Save(AZ::Data::AssetId assetId, Callbacks::OnSave onSaveCallback) override; - void SaveAs(AZ::Data::AssetId assetId, const AZStd::string& path, Callbacks::OnSave onSaveCallback) override; - bool Load(AZ::Data::AssetId assetId, AZ::Data::AssetType assetType, Callbacks::OnAssetReadyCallback onAssetReadyCallback) override; - void Close(AZ::Data::AssetId assetId) override; - void CreateView(AZ::Data::AssetId assetId, QWidget* parent) override; - void ClearView(AZ::Data::AssetId assetId) override; - void UntrackAsset(AZ::Data::AssetId assetId) override; - void RefreshAll() override; - - // Getters - - // Given the assetId it returns a reference to the in-memory asset, returns false if the asset is not tracked - ScriptCanvasMemoryAsset::pointer GetAsset(AZ::Data::AssetId assetId) override; - - // Given a ScriptCanvas EntityId it will lookup the AssetId - AZ::Data::AssetId GetAssetId(ScriptCanvas::ScriptCanvasId scriptCanvasSceneId) override; - - // Given a ScriptCanvas EntityId it will lookup the asset's type - AZ::Data::AssetType GetAssetType(ScriptCanvas::ScriptCanvasId scriptCanvasSceneId) override; - - // Retrieves the ScriptCanvasEntity for a given asset - ScriptCanvas::ScriptCanvasId GetScriptCanvasId(AZ::Data::AssetId assetId) override; - - // Retrieves the Graph Canvas scene Id for a given asset - AZ::EntityId GetGraphCanvasId(AZ::EntityId scriptCanvasEntityId) override; - ScriptCanvas::ScriptCanvasId GetScriptCanvasIdFromGraphId(AZ::EntityId graphId) override; - ScriptCanvas::ScriptCanvasId GetGraphId(AZ::Data::AssetId assetId) override; - Tracker::ScriptCanvasFileState GetFileState(AZ::Data::AssetId assetId) override; - AZStd::string GetTabName(AZ::Data::AssetId assetId) override; - ScriptCanvasEditor::ScriptCanvasAssetHandler* GetAssetHandlerForType(AZ::Data::AssetType assetType) override; - void UpdateFileState(AZ::Data::AssetId assetId, Tracker::ScriptCanvasFileState state) override; - - AssetTrackerRequests::AssetList GetUnsavedAssets() override; - AssetTrackerRequests::AssetList GetAssets() override; - AssetTrackerRequests::AssetList GetAssetsIf(AZStd::function pred = []() { return true; }) override; - - AZ::EntityId GetSceneEntityIdFromEditorEntityId(AZ::Data::AssetId assetId, AZ::EntityId editorEntityId) override; - AZ::EntityId GetEditorEntityIdFromSceneEntityId(AZ::Data::AssetId assetId, AZ::EntityId sceneEntityId) override; - // - - private: - - void SignalSaveComplete(const AZ::Data::AssetId& fileAssetId); - - // Verifies if an asset Id has been remapped, this happens when we save a new graph because the AssetId will - // change on save, but there may be some UX elements still referring to the initial asset Id, this ensures - // we are getting the right key into m_assetsInUse - AZ::Data::AssetId CheckAssetId(AZ::Data::AssetId assetId) const; - - // Map of all the currently tracked in-memory assets - using MemoryAssetMap = AZStd::unordered_map; - using MemoryAssetMapIterator = AZStd::pair>, bool>; - - AZStd::unordered_set m_savingAssets; - AZStd::unordered_set m_queuedCloses; - - // Map of all assets being tracked - MemoryAssetMap m_assetsInUse; - - // When a graph has been saved to file, its Id will change but it may still have external references with the old Id, this maps the file Id to the in-memory Id - AZStd::unordered_map m_remappedAsset; - - // Invoked when an asset is loaded from file and becomes ready - Callbacks::OnAssetReadyCallback m_onAssetReadyCallback; - - }; -} diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerBus.h b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerBus.h deleted file mode 100644 index 7125cb7d9b..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerBus.h +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#pragma once - -#include -#include -#include -#include - -#include - -#include -#include -#include - -class QWidget; - -namespace AZ -{ - class EntityId; -} - -namespace ScriptCanvas -{ - class ScriptCanvasAssetBase; -} - -namespace ScriptCanvasEditor -{ - class ScriptCanvasAssetHandler; - - class AssetTrackerRequests - : public AZ::EBusTraits - { - public: - - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; - - //! Callback used to know when a save operation failed or succeeded - using OnSave = AZStd::function)>; - - //! Callback used when the asset has been loaded and is ready for use - using OnAssetReadyCallback = AZStd::function; - - //! Callback used when the asset is newly created - using OnAssetCreatedCallback = OnAssetReadyCallback; - - // Operations - - //! Creates a new Script Canvas asset and tracks it - virtual AZ::Data::AssetId Create([[maybe_unused]] AZStd::string_view assetAbsolutePath, [[maybe_unused]] AZ::Data::AssetType assetType, Callbacks::OnAssetCreatedCallback onAssetCreatedCallback) { return AZ::Data::AssetId(); } - - //! Saves a Script Canvas asset to a new file, once the save is complete it will use the source Id (not the Id of the in-memory asset) - virtual void SaveAs([[maybe_unused]] AZ::Data::AssetId assetId, [[maybe_unused]] const AZStd::string& path, Callbacks::OnSave onSaveCallback) {} - - //! Saves a previously loaded Script Canvas asset to file - virtual void Save([[maybe_unused]] AZ::Data::AssetId assetId, Callbacks::OnSave onSaveCallback) {} - - //! Returns whether or not the specified asset is currently saving - virtual bool IsSaving([[maybe_unused]] AZ::Data::AssetId assetId) const { return false; } - - //! Loads a Script Canvas graph - virtual bool Load([[maybe_unused]] AZ::Data::AssetId assetId, [[maybe_unused]] AZ::Data::AssetType assetType, Callbacks::OnAssetReadyCallback onAssetReadyCallback) { return false; } - - //! Closes and unloads a Script Canvas graph from the tracker - virtual void Close([[maybe_unused]] AZ::Data::AssetId assetId) {} - - //! Creates the asset's view - virtual void CreateView([[maybe_unused]] AZ::Data::AssetId assetId, [[maybe_unused]] QWidget* parent) {} - - //! Releases the asset's view - virtual void ClearView([[maybe_unused]] AZ::Data::AssetId assetId) {} - - //! Used to make sure assets that are unloaded also get removed from tracking - virtual void UntrackAsset([[maybe_unused]] AZ::Data::AssetId assetId) {} - - //! Recreates the view for all tracked assets - virtual void RefreshAll() {} - - using AssetList = AZStd::vector; - - // Accessors - virtual ScriptCanvasMemoryAsset::pointer GetAsset([[maybe_unused]] AZ::Data::AssetId assetId) { return nullptr; } - virtual ScriptCanvas::ScriptCanvasId GetScriptCanvasId([[maybe_unused]] AZ::Data::AssetId assetId) { return AZ::EntityId(); } - virtual ScriptCanvas::ScriptCanvasId GetScriptCanvasIdFromGraphId([[maybe_unused]] AZ::EntityId graphId) { return AZ::EntityId(); } - virtual ScriptCanvas::ScriptCanvasId GetGraphCanvasId(AZ::EntityId) { return AZ::EntityId(); } - virtual ScriptCanvas::ScriptCanvasId GetGraphId([[maybe_unused]] AZ::Data::AssetId assetId) { return ScriptCanvas::ScriptCanvasId(); } - virtual Tracker::ScriptCanvasFileState GetFileState([[maybe_unused]] AZ::Data::AssetId assetId) { return Tracker::ScriptCanvasFileState::INVALID; } - virtual AZ::Data::AssetId GetAssetId([[maybe_unused]] ScriptCanvas::ScriptCanvasId scriptCanvasSceneId) { return {}; } - virtual AZ::Data::AssetType GetAssetType([[maybe_unused]] ScriptCanvas::ScriptCanvasId scriptCanvasSceneId) { return {}; } - virtual AZStd::string GetTabName([[maybe_unused]] AZ::Data::AssetId assetId) { return {}; } - virtual AssetList GetUnsavedAssets() { return {}; } - virtual AssetList GetAssets() { return {}; } - virtual AssetList GetAssetsIf(AZStd::function) { return {}; } - - virtual AZ::EntityId GetSceneEntityIdFromEditorEntityId([[maybe_unused]] AZ::Data::AssetId assetId, [[maybe_unused]] AZ::EntityId editorEntityId) { return AZ::EntityId(); } - virtual AZ::EntityId GetEditorEntityIdFromSceneEntityId([[maybe_unused]] AZ::Data::AssetId assetId, [[maybe_unused]] AZ::EntityId sceneEntityId) { return AZ::EntityId(); } - - // Setters / Updates - virtual void UpdateFileState([[maybe_unused]] AZ::Data::AssetId assetId, [[maybe_unused]] Tracker::ScriptCanvasFileState state) {} - - // Helpers - virtual ScriptCanvasAssetHandler* GetAssetHandlerForType([[maybe_unused]] AZ::Data::AssetType assetType) { return nullptr; } - }; - - using AssetTrackerRequestBus = AZ::EBus; - - //! These are the notifications sent by the AssetTracker only. - //! We use these to communicate the asset status, do not use the AssetBus directly, all Script Canvas - //! assets are managed by the AssetTracker - class AssetTrackerNotifications - : public AZ::EBusTraits - { - public: - - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple; - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; - using BusIdType = AZ::Data::AssetId; - - // These will be forwarded as a result of the Asset System's events - // this is deliberate in order to keep the AssetTracker as the only - // place that interacts directly with the asset bus, but allowing - // other systems to know the status of tracked assets - virtual void OnAssetReady(const ScriptCanvasMemoryAsset::pointer asset) {} - virtual void OnAssetReloaded(const ScriptCanvasMemoryAsset::pointer asset) {} - virtual void OnAssetUnloaded([[maybe_unused]] const AZ::Data::AssetId assetId, [[maybe_unused]] const AZ::Data::AssetType assetType) {} - virtual void OnAssetSaved(const ScriptCanvasMemoryAsset::pointer asset, [[maybe_unused]] bool isSuccessful) {} - virtual void OnAssetError(const ScriptCanvasMemoryAsset::pointer asset) {} - - }; - using AssetTrackerNotificationBus = AZ::EBus; - - namespace Internal - { - class MemoryAssetSystemNotifications - : public AZ::EBusTraits - { - public: - - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single; - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; - - virtual void OnAssetReady([[maybe_unused]] const ScriptCanvasMemoryAsset* asset) {} - virtual void OnAssetReloaded([[maybe_unused]] const ScriptCanvasMemoryAsset* asset) {} - virtual void OnAssetSaved([[maybe_unused]] const ScriptCanvasMemoryAsset* asset, [[maybe_unused]] bool isSuccessful) {} - virtual void OnAssetError([[maybe_unused]] const ScriptCanvasMemoryAsset* asset) {} - - }; - using MemoryAssetSystemNotificationBus = AZ::EBus; - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////// -} diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerDefinitions.h b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerDefinitions.h deleted file mode 100644 index 73507112c2..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetTrackerDefinitions.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#pragma once - -#include -#include - -namespace ScriptCanvasEditor -{ - class ScriptCanvasMemoryAsset; - - namespace Callbacks - { - //! Callback used to know when a save operation failed or succeeded - using OnSave = AZStd::function; - - using OnAssetReadyCallback = AZStd::function; - using OnAssetCreatedCallback = OnAssetReadyCallback; - } - - -} diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp deleted file mode 100644 index 439f9a8383..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.cpp +++ /dev/null @@ -1,684 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * 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 "ScriptCanvasMemoryAsset.h" -#include "ScriptCanvasUndoHelper.h" - -#include -#include -#include -#include -#include - -namespace ScriptCanvasEditor -{ - ScriptCanvasMemoryAsset::ScriptCanvasMemoryAsset() - : m_sourceInError(false) - { - m_undoState = AZStd::make_unique(this); - } - - ScriptCanvasMemoryAsset::~ScriptCanvasMemoryAsset() - { - AssetTrackerRequestBus::Broadcast(&AssetTrackerRequests::UntrackAsset, m_inMemoryAssetId); - AssetHelpers::PrintInfo(AZStd::string::format("ScriptCanvasMemoryAsset went out of scope and has been released and untracked: %s", m_absolutePath.c_str()).c_str()); - - if (m_inMemoryAsset.IsReady() && !m_inMemoryAsset.Release()) - { - // Something else is holding on to it - AZ_Assert(false, "Unable to release in memory asset"); - } - } - - const AZStd::string ScriptCanvasMemoryAsset::GetTabName() const - { - AZStd::string tabName; - AzFramework::StringFunc::Path::GetFileName(m_absolutePath.c_str(), tabName); - return tabName; - } - - AZ::EntityId ScriptCanvasMemoryAsset::GetGraphId() - { - if (!m_graphId.IsValid()) - { - EditorGraphRequestBus::EventResult(m_graphId, m_scriptCanvasId, &EditorGraphRequests::GetGraphCanvasGraphId); - } - - return m_graphId; - } - - Tracker::ScriptCanvasFileState ScriptCanvasMemoryAsset::GetFileState() const - { - if (m_sourceRemoved) - { - return Tracker::ScriptCanvasFileState::SOURCE_REMOVED; - } - else - { - return m_fileState; - } - } - - void ScriptCanvasMemoryAsset::SetFileState(Tracker::ScriptCanvasFileState fileState) - { - m_fileState = fileState; - - SignalFileStateChanged(); - } - - void ScriptCanvasMemoryAsset::CloneTo(ScriptCanvasMemoryAsset& memoryAsset) - { - if (m_assetType == azrtti_typeid()) - { - AZ::Data::Asset newAsset = Clone(); - memoryAsset.m_inMemoryAsset = newAsset; - } - else - { - AZ_Assert(false, "Unsupported Script Canvas Asset Type"); - } - - memoryAsset.m_sourceAsset = m_sourceAsset; - } - - void ScriptCanvasMemoryAsset::Create(AZ::Data::AssetId assetId, AZStd::string_view assetAbsolutePath, AZ::Data::AssetType assetType, Callbacks::OnAssetCreatedCallback onAssetCreatedCallback) - { - m_inMemoryAssetId = assetId; - m_absolutePath = assetAbsolutePath; - m_assetType = assetType; - m_fileState = Tracker::ScriptCanvasFileState::NEW; - - ScriptCanvasAssetHandler* assetHandler = GetAssetHandlerForType(assetType); - - AZ::Data::AssetPtr asset = nullptr; - if (assetType == azrtti_typeid()) - { - asset = assetHandler->CreateAsset(assetId, azrtti_typeid()); - } - - m_inMemoryAsset = AZ::Data::Asset(asset, AZ::Data::AssetLoadBehavior::PreLoad); - - ActivateAsset(); - - // For new assets, we directly set its status as "Ready" in order to make it usable. - ScriptCanvas::ScriptCanvasAssetBusRequestBus::Event(assetId, &ScriptCanvas::ScriptCanvasAssetBusRequests::SetAsNewAsset); - - Internal::MemoryAssetSystemNotificationBus::Broadcast(&Internal::MemoryAssetSystemNotifications::OnAssetReady, this); - - AssetHelpers::PrintInfo("Newly created Script Canvas asset is now tracked: %s", AssetHelpers::AssetIdToString(assetId).c_str()); - - if (onAssetCreatedCallback) - { - AZStd::invoke(onAssetCreatedCallback, *this); - } - } - - void ScriptCanvasMemoryAsset::Save(Callbacks::OnSave onSaveCallback) - { - if (m_fileState == Tracker::ScriptCanvasFileState::UNMODIFIED) - { - // The file hasn't changed, don't save it - return; - } - - SaveAs({}, onSaveCallback); - } - - void ScriptCanvasMemoryAsset::SaveAs(const AZStd::string& path, Callbacks::OnSave onSaveCallback) - { - if (!path.empty()) - { - m_saveAsPath = path; - } - else - { - m_saveAsPath = m_absolutePath; - } - - AZ::Data::AssetStreamInfo streamInfo; - streamInfo.m_streamFlags = AZ::IO::OpenMode::ModeWrite; - streamInfo.m_streamName = m_saveAsPath; - - if (!streamInfo.IsValid()) - { - return; - } - - bool sourceControlActive = false; - AzToolsFramework::SourceControlConnectionRequestBus::BroadcastResult(sourceControlActive, &AzToolsFramework::SourceControlConnectionRequests::IsActive); - // If Source Control is active then use it to check out the file before saving otherwise query the file info and save only if the file is not read-only - if (sourceControlActive) - { - AzToolsFramework::SourceControlCommandBus::Broadcast(&AzToolsFramework::SourceControlCommandBus::Events::RequestEdit, - streamInfo.m_streamName.c_str(), - true, - [this, streamInfo, onSaveCallback](bool success, AzToolsFramework::SourceControlFileInfo info) { FinalizeAssetSave(success, info, streamInfo, onSaveCallback); } - ); - } - else - { - AzToolsFramework::SourceControlCommandBus::Broadcast(&AzToolsFramework::SourceControlCommandBus::Events::GetFileInfo, - streamInfo.m_streamName.c_str(), - [this, streamInfo, onSaveCallback](bool success, AzToolsFramework::SourceControlFileInfo info) { FinalizeAssetSave(success, info, streamInfo, onSaveCallback); } - ); - } - } - - void ScriptCanvasMemoryAsset::Set(AZ::Data::AssetId fileAssetId) - { - Callbacks::OnAssetReadyCallback onAssetReady = [](ScriptCanvasMemoryAsset&) {}; - Load(fileAssetId, AZ::Data::AssetType::CreateNull(), onAssetReady); - - ActivateAsset(); - } - - bool ScriptCanvasMemoryAsset::Load(AZ::Data::AssetId assetId, AZ::Data::AssetType assetType, Callbacks::OnAssetReadyCallback onAssetReadyCallback) - { - AZStd::string rootPath; - AZ::Data::AssetInfo assetInfo = AssetHelpers::GetAssetInfo(assetId, rootPath); - AzFramework::StringFunc::Path::Join(rootPath.c_str(), assetInfo.m_relativePath.c_str(), m_absolutePath); - - if (assetInfo.m_assetType.IsNull()) - { - // Try to find the asset type from the source file asset - assetInfo.m_assetType = AssetHelpers::GetAssetType(AZStd::string::format("%s/%s", rootPath.c_str(), assetInfo.m_relativePath.c_str()).c_str()); - } - - if (!assetType.IsNull() && assetInfo.m_assetType.IsNull()) - { - assetInfo.m_assetType = assetType; - } - else - { - AZ_Assert(assetInfo.m_assetId.IsValid(), "Failed to get the asset info properly from the asset system"); - } - - SetFileAssetId(assetId); - - auto asset = AZ::Data::AssetManager::Instance().FindAsset(assetId, AZ::Data::AssetLoadBehavior::PreLoad); - if (!asset || !asset.IsReady()) - { - AZ::Data::AssetBus::MultiHandler::BusConnect(assetId); - } - - if (assetInfo.m_assetType == azrtti_typeid()) - { - m_inMemoryAsset = AZ::Data::AssetManager::Instance().GetAsset(assetId, AZ::Data::AssetLoadBehavior::Default); - } - - if (m_inMemoryAsset) - { - m_inMemoryAsset.BlockUntilLoadComplete(); - - m_sourceAsset = m_inMemoryAsset; - - m_assetType = m_inMemoryAsset->GetType(); - - AZ_Assert(m_inMemoryAsset.GetId() == assetId, "The asset IDs must match"); - - m_onAssetReadyCallback = onAssetReadyCallback; - - if (m_inMemoryAsset.IsReady()) - { - OnAssetReady(m_inMemoryAsset); - } - } - - return !m_inMemoryAsset.IsError(); - } - - void ScriptCanvasMemoryAsset::ActivateAsset() - { - ScriptCanvas::ScriptCanvasAssetBase* assetData = m_inMemoryAsset.Get(); - AZ_Assert(assetData, "ActivateAsset should have a valid asset of type %s", AssetHelpers::AssetIdToString(azrtti_typeid()).c_str()); - - if (assetData == nullptr) - { - return; - } - - AZ::Entity* scriptCanvasEntity = assetData->GetScriptCanvasEntity(); - AZ_Assert(scriptCanvasEntity, "ActivateAsset should have a valid ScriptCanvas Entity"); - - // Only activate the entity for assets that have been saved - if (scriptCanvasEntity->GetState() == AZ::Entity::State::Constructed) - { - scriptCanvasEntity->Init(); - } - - if (scriptCanvasEntity->GetState() == AZ::Entity::State::Init) - { - scriptCanvasEntity->Activate(); - } - - const AZStd::string& assetPath = m_absolutePath; - AZStd::string graphName; - AzFramework::StringFunc::Path::GetFileName(assetPath.c_str(), graphName); - - if (!graphName.empty()) - { - scriptCanvasEntity->SetName(graphName); - } - - Graph* editorGraph = AZ::EntityUtils::FindFirstDerivedComponent(scriptCanvasEntity); - AZ_Assert(editorGraph, "Script Canvas entity must have a Graph component"); - - if (editorGraph == nullptr) - { - return; - } - - m_scriptCanvasId = editorGraph->GetScriptCanvasId(); - - EditorGraphNotificationBus::Handler::BusDisconnect(); - EditorGraphNotificationBus::Handler::BusConnect(m_scriptCanvasId); - } - - ScriptCanvasEditor::Widget::CanvasWidget* ScriptCanvasMemoryAsset::CreateView(QWidget* /*parent*/) - { - return nullptr; - } - - void ScriptCanvasMemoryAsset::ClearView() - { - delete m_canvasWidget; - m_canvasWidget = nullptr; - } - - void ScriptCanvasMemoryAsset::UndoStackChange() - { - OnUndoStackChanged(); - } - - bool ScriptCanvasMemoryAsset::IsSourceInError() const - { - return m_sourceInError; - } - - void ScriptCanvasMemoryAsset::OnGraphCanvasSceneDisplayed() - { - // We need to wait until this event in order the get the m_graphId which represents the GraphCanvas scene Id - EditorGraphRequestBus::EventResult(m_graphId, m_scriptCanvasId, &EditorGraphRequests::GetGraphCanvasGraphId); - EditorGraphNotificationBus::Handler::BusDisconnect(); - } - - void ScriptCanvasMemoryAsset::OnAssetReady(AZ::Data::Asset asset) - { - // If we've already cloned the memory asset, we don't want to do the start-up things again. - if (m_inMemoryAsset->GetId() == m_sourceAsset.GetId()) - { - AZStd::string rootPath; - AZ::Data::AssetInfo assetInfo = AssetHelpers::GetAssetInfo(m_fileAssetId, rootPath); - - AZStd::string absolutePath; - AzFramework::StringFunc::Path::Join(rootPath.c_str(), assetInfo.m_relativePath.c_str(), absolutePath); - - m_absolutePath = absolutePath; - m_fileState = Tracker::ScriptCanvasFileState::UNMODIFIED; - m_assetType = asset.GetType(); - - // Keep the canonical asset's Id, we will need it when we want to save the asset back to file - SetFileAssetId(asset.GetId()); - - // The source file is ready, we need to make the an in-memory version of it. - AZ::Data::AssetId inMemoryAssetId = AZ::Uuid::CreateRandom(); - - m_sourceAsset = AZ::Data::AssetManager::Instance().FindAsset(m_fileAssetId, AZ::Data::AssetLoadBehavior::PreLoad); - m_inMemoryAsset = AZStd::move(CloneAssetData(inMemoryAssetId)); - - AZ_Assert(m_inMemoryAsset, "Asset should have been successfully cloned."); - AZ_Assert(m_inMemoryAsset.GetId() == inMemoryAssetId, "Asset Id should match to the newly created one"); - - m_inMemoryAssetId = m_inMemoryAsset.GetId(); - - ActivateAsset(); - - if (m_onAssetReadyCallback) - { - AZStd::invoke(m_onAssetReadyCallback, *this); - } - } - // Instead just update the source asset to the get the new asset to keep it in memory. - else - { - m_sourceAsset = AZ::Data::AssetManager::Instance().FindAsset(m_fileAssetId, AZ::Data::AssetLoadBehavior::PreLoad); - } - - if (m_fileAssetId == asset.GetId()) - { - Internal::MemoryAssetSystemNotificationBus::Broadcast(&Internal::MemoryAssetSystemNotifications::OnAssetReady, this); - } - } - - void ScriptCanvasMemoryAsset::OnAssetReloaded(AZ::Data::Asset asset) - { - if (m_fileAssetId == asset.GetId()) - { - m_sourceInError = false; - - // Update our source asset information so we keep references alive. - m_sourceAsset = AZ::Data::AssetManager::Instance().FindAsset(m_fileAssetId, AZ::Data::AssetLoadBehavior::PreLoad); - - // The source file was reloaded, but we have an in-memory version of it. - // We need to handle this. - } - else - { - Internal::MemoryAssetSystemNotificationBus::Broadcast(&Internal::MemoryAssetSystemNotifications::OnAssetReloaded, this); - } - } - - void ScriptCanvasMemoryAsset::OnAssetError(AZ::Data::Asset asset) - { - if (m_fileAssetId == asset.GetId()) - { - m_sourceInError = true; - - if (m_onAssetReadyCallback) - { - AZStd::invoke(m_onAssetReadyCallback, *this); - } - } - else - { - Internal::MemoryAssetSystemNotificationBus::Broadcast(&Internal::MemoryAssetSystemNotifications::OnAssetError, this); - } - } - - void ScriptCanvasMemoryAsset::OnAssetUnloaded(const AZ::Data::AssetId assetId, const AZ::Data::AssetType assetType) - { - if (m_fileAssetId == assetId) - { - AssetTrackerNotificationBus::Event(assetId, &AssetTrackerNotifications::OnAssetUnloaded, assetId, assetType); - } - } - - void ScriptCanvasMemoryAsset::SourceFileChanged(AZStd::string relativePath, AZStd::string scanFolder, AZ::Uuid sourceAssetId) - { - // This updates the asset Id with the canonical assetId on SourceFileChanged - - // This occurs for new ScriptCanvas assets because before the SC asset is saved to disk, the asset database - // has no asset Id associated with it, so this uses the supplied source path to find the asset Id registered - AZStd::string fullPath; - AzFramework::StringFunc::Path::Join(scanFolder.data(), relativePath.data(), fullPath); - AzFramework::ApplicationRequests::Bus::Broadcast(&AzFramework::ApplicationRequests::NormalizePath, fullPath); - - SavingComplete(fullPath, sourceAssetId); - } - - - - void ScriptCanvasMemoryAsset::SourceFileRemoved(AZStd::string relativePath, AZStd::string scanFolder, AZ::Uuid fileAssetId) - { - AZ_UNUSED(relativePath); - AZ_UNUSED(scanFolder); - - if (m_fileAssetId == fileAssetId) - { - m_sourceRemoved = true; - SignalFileStateChanged(); - } - } - - void ScriptCanvasMemoryAsset::SourceFileFailed(AZStd::string /*relativePath*/, AZStd::string /*scanFolder*/, AZ::Uuid) - { - - } - - void ScriptCanvasMemoryAsset::SavingComplete(const AZStd::string& /*streamName*/, AZ::Uuid /*sourceAssetId*/) - { - } - - void ScriptCanvasMemoryAsset::FinalizeAssetSave(bool, const AzToolsFramework::SourceControlFileInfo& fileInfo, const AZ::Data::AssetStreamInfo& saveInfo, Callbacks::OnSave onSaveCallback) - { - m_onSaveCallback = onSaveCallback; - - AZStd::string normPath = saveInfo.m_streamName; - AzFramework::ApplicationRequests::Bus::Broadcast(&AzFramework::ApplicationRequests::NormalizePath, normPath); - m_pendingSave.emplace_back(normPath); - - m_assetSaveFinalizer.Reset(); - m_assetSaveFinalizer.Start(this, fileInfo, saveInfo, onSaveCallback, AssetSaveFinalizer::OnCompleteHandler([](AZ::Data::AssetId /*assetId*/) - { - })); - } - - AZ::Data::Asset ScriptCanvasMemoryAsset::CloneAssetData(AZ::Data::AssetId newAssetId) - { - if (m_assetType == azrtti_typeid()) - { - return CloneAssetData(newAssetId); - } - - AZ_Assert(false, "The provides asset type is not supported as a valid Script Canvas memory asset"); - return AZ::Data::Asset(); - } - - void ScriptCanvasMemoryAsset::OnUndoStackChanged() - { - UndoNotificationBus::Broadcast(&UndoNotifications::OnCanUndoChanged, m_undoState->m_undoStack->CanUndo()); - UndoNotificationBus::Broadcast(&UndoNotifications::OnCanRedoChanged, m_undoState->m_undoStack->CanRedo()); - } - - void ScriptCanvasMemoryAsset::SetFileAssetId(const AZ::Data::AssetId& /*fileAssetId*/) - { - - } - - void ScriptCanvasMemoryAsset::SignalFileStateChanged() - { - } - - AZStd::string ScriptCanvasMemoryAsset::MakeTemporaryFilePathForSave(AZStd::string_view targetFilename) - { - AZ::IO::FileIOBase* fileIO = AZ::IO::FileIOBase::GetInstance(); - AZ_Assert(fileIO, "File IO is not initialized."); - - AZStd::string tempFilename; - AzFramework::StringFunc::Path::GetFullFileName(targetFilename.data(), tempFilename); - AZStd::string tempPath = AZStd::string::format("@usercache@/scriptcanvas/%s.temp", tempFilename.data()); - - AZStd::array resolvedPath{}; - fileIO->ResolvePath(tempPath.data(), resolvedPath.data(), resolvedPath.size()); - return resolvedPath.data(); - } - - ScriptCanvasAssetHandler* ScriptCanvasMemoryAsset::GetAssetHandlerForType(AZ::Data::AssetType assetType) - { - ScriptCanvasAssetHandler* assetHandler = nullptr; - - AZ::EBusAggregateResults foundAssetHandlers; - ScriptCanvas::AssetRegistryRequestBus::BroadcastResult(foundAssetHandlers, &ScriptCanvas::AssetRegistryRequests::GetAssetHandler); - - for (auto handler : foundAssetHandlers.values) - { - if (handler != nullptr) - { - ScriptCanvasAssetHandler* theHandler = azrtti_cast(handler); - if (theHandler != nullptr && theHandler->GetAssetType() == assetType) - { - assetHandler = theHandler; - break; - } - } - } - - AZ_Assert(assetHandler, "The specified asset type does not have a registered asset handler."); - return assetHandler; - } - - AZ::EntityId ScriptCanvasMemoryAsset::GetEditorEntityIdFromSceneEntityId(AZ::EntityId sceneEntityId) - { - if (m_editorEntityIdMap.find(sceneEntityId) != m_editorEntityIdMap.end()) - { - return m_editorEntityIdMap[sceneEntityId]; - } - - return AZ::EntityId(); - } - - AZ::EntityId ScriptCanvasMemoryAsset::GetSceneEntityIdFromEditorEntityId(AZ::EntityId editorEntityId) - { - for (auto mapEntry : m_editorEntityIdMap) - { - if (mapEntry.second == editorEntityId) - { - return mapEntry.first; - } - } - - return AZ::EntityId(); - } - - // AssetSaveFinalizer - ////////////////////////////////////// - - bool AssetSaveFinalizer::ValidateStatus(const AzToolsFramework::SourceControlFileInfo& /*fileInfo*/) - { - return true; - } - - AssetSaveFinalizer::AssetSaveFinalizer() - : m_inMemoryAsset(nullptr) - , m_sourceAsset(nullptr) - , m_saving(false) - , m_fileAvailableForSave(false) - { - - } - - AssetSaveFinalizer::~AssetSaveFinalizer() - { - AZ::SystemTickBus::Handler::BusDisconnect(); - } - - void AssetSaveFinalizer::Start(ScriptCanvasMemoryAsset* sourceAsset, const AzToolsFramework::SourceControlFileInfo& fileInfo, const AZ::Data::AssetStreamInfo& saveInfo, Callbacks::OnSave onSaveCallback, OnCompleteHandler onComplete) - { - m_onCompleteHandler = onComplete; - m_onCompleteHandler.Connect(m_onComplete); - - m_saveInfo = saveInfo; - m_onSave = onSaveCallback; - m_sourceAsset = sourceAsset; - m_inMemoryAsset = sourceAsset->GetAsset().Get(); - m_assetType = sourceAsset->GetAssetType(); - - if (!ValidateStatus(fileInfo)) - { - return; - } - - auto streamer = AZ::Interface::Get(); - AZ::IO::FileRequestPtr flushRequest = streamer->FlushCache(saveInfo.m_streamName.data()); - streamer->SetRequestCompleteCallback(flushRequest, [this]([[maybe_unused]] AZ::IO::FileRequestHandle request) - { - m_fileAvailableForSave = true; - }); - streamer->QueueRequest(flushRequest); - - AZ::SystemTickBus::Handler::BusConnect(); - - m_saving = true; - } - - AZStd::string AssetSaveFinalizer::MakeTemporaryFilePathForSave(AZStd::string_view targetFilename) - { - AZ::IO::FileIOBase* fileIO = AZ::IO::FileIOBase::GetInstance(); - AZ_Assert(fileIO, "File IO is not initialized."); - - AZStd::string tempFilename; - AzFramework::StringFunc::Path::GetFullFileName(targetFilename.data(), tempFilename); - AZStd::string tempPath = AZStd::string::format("@usercache@/scriptcanvas/%s.temp", tempFilename.data()); - - AZStd::array resolvedPath{}; - fileIO->ResolvePath(tempPath.data(), resolvedPath.data(), resolvedPath.size()); - return resolvedPath.data(); - } - - void AssetSaveFinalizer::OnSystemTick() - { - if (m_fileAvailableForSave) - { - - AZ::SystemTickBus::Handler::BusDisconnect(); - - m_fileAvailableForSave = false; - - const AZStd::string tempPath = MakeTemporaryFilePathForSave(m_saveInfo.m_streamName); - AZ::IO::FileIOStream stream(tempPath.data(), m_saveInfo.m_streamFlags); - if (stream.IsOpen()) - { - ScriptCanvasAssetHandler* assetHandler = nullptr; - AssetTrackerRequestBus::BroadcastResult(assetHandler, &AssetTrackerRequests::GetAssetHandlerForType, m_assetType); - AZ_Assert(assetHandler, "An asset handler must be found"); - - bool savedSuccess; - { - AZ_PROFILE_SCOPE(ScriptCanvas, "ScriptCanvasAssetHandler::SaveAssetData"); - - ScriptCanvasMemoryAsset cloneAsset; - m_sourceAsset->CloneTo(cloneAsset); - - savedSuccess = assetHandler->SaveAssetData(cloneAsset.GetAsset(), &stream); - } - stream.Close(); - if (savedSuccess) - { - AZ_PROFILE_SCOPE(ScriptCanvas, "AssetTracker::SaveAssetPostSourceControl : TempToTargetFileReplacement"); - - AZ::IO::FileIOBase* fileIO = AZ::IO::FileIOBase::GetInstance(); - const bool targetFileExists = fileIO->Exists(m_saveInfo.m_streamName.data()); - - bool removedTargetFile; - { - AZ_PROFILE_SCOPE(ScriptCanvas, "AssetTracker::SaveAssetPostSourceControl : TempToTargetFileReplacement : RemoveTarget"); - removedTargetFile = fileIO->Remove(m_saveInfo.m_streamName.data()); - } - - if (targetFileExists && !removedTargetFile) - { - savedSuccess = false; - } - else - { - AZ_PROFILE_SCOPE(ScriptCanvas, "AssetTracker::SaveAssetPostSourceControl : TempToTargetFileReplacement : RenameTempFile"); - AZ::IO::Result renameResult = fileIO->Rename(tempPath.data(), m_saveInfo.m_streamName.data()); - if (!renameResult) - { - savedSuccess = false; - } - } - } - - if (savedSuccess) - { - AZ_TracePrintf("Script Canvas", "Script Canvas successfully saved as Asset \"%s\"", m_saveInfo.m_streamName.data()); - } - - m_onComplete.Signal(m_sourceAsset->GetId()); - - } - - Reset(); - - } - - } - - void AssetSaveFinalizer::Reset() - { - m_sourceAsset = nullptr; - m_fileAssetId = {}; - m_onSave = nullptr; - m_saving = false; - m_inMemoryAsset = nullptr; - m_saveInfo = {}; - } - -} diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.h b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.h deleted file mode 100644 index f906f13433..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasMemoryAsset.h +++ /dev/null @@ -1,344 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#pragma once - -#include -#include - -#include - -#include -#include - -#include - -#include -#include - -#include -#include - -#include -#include - -#include -#include -#include - - -namespace ScriptCanvasEditor -{ - - class ScriptCanvasAssetHandler; - - template - class MemoryAsset - : protected AZ::Data::AssetBus::MultiHandler - , protected AzToolsFramework::AssetSystemBus::Handler - , public AzToolsFramework::UndoSystem::IUndoNotify - { - public: - - MemoryAsset() - { - AzToolsFramework::AssetSystemBus::Handler::BusConnect(); - } - - ~MemoryAsset() - { - AZ::Data::AssetBus::MultiHandler::BusDisconnect(); - AzToolsFramework::AssetSystemBus::Handler::BusDisconnect(); - } - - using AssetType = BaseAssetType; - - virtual void Create(AZ::Data::AssetId assetId, AZStd::string_view assetAbsolutePath, AZ::Data::AssetType assetType, Callbacks::OnAssetCreatedCallback onAssetCreatedCallback) = 0; - - virtual void SaveAs(const AZStd::string& path, Callbacks::OnSave onSaveCallback) = 0; - virtual void Save(Callbacks::OnSave onSaveCallback) = 0; - - virtual bool Load(AZ::Data::AssetId assetId, AZ::Data::AssetType assetType, Callbacks::OnAssetReadyCallback onAssetReadyCallback) = 0; - }; - - class UndoHelper; - - // Saving an asset is an asynchronous process that requires several steps, this helper - // class ensures asset saving takes place correctly and reduces the complexity of - // ScriptCanvasMemoryAsset's saving requirements - class AssetSaveFinalizer - : AZ::SystemTickBus::Handler - { - public: - - using OnCompleteEvent = AZ::Event; - using OnCompleteHandler = AZ::Event::Handler; - - AssetSaveFinalizer(); - ~AssetSaveFinalizer(); - - void Start(ScriptCanvasMemoryAsset* sourceAsset, const AzToolsFramework::SourceControlFileInfo& fileInfo, const AZ::Data::AssetStreamInfo& saveInfo, Callbacks::OnSave onSaveCallback, OnCompleteHandler onComplete); - void Reset(); - - private: - - // AZ::SystemTickBus::Handler ... - void OnSystemTick() override; - /// - - bool ValidateStatus(const AzToolsFramework::SourceControlFileInfo& fileInfo); - AZStd::string MakeTemporaryFilePathForSave(AZStd::string_view targetFilename); - - OnCompleteHandler m_onCompleteHandler; - OnCompleteEvent m_onComplete; - Callbacks::OnSave m_onSave; - - bool m_saving = false; - bool m_fileAvailableForSave = false; - - AZ::Data::AssetPtr m_inMemoryAsset; - AZ::Data::AssetId m_fileAssetId; - AZ::Data::AssetStreamInfo m_saveInfo; - - ScriptCanvasMemoryAsset* m_sourceAsset; - - AZ::Data::AssetType m_assetType; - - }; - - // Script Canvas primarily works with an in-memory copy of an asset. - // There are two situations, the first is, when a new asset is created and not yet saved. - // Once saved, we will create a new asset on file, however, and this is important - // once the file is saved to file, its asset ID will be changed, if the file is to remain - // open, we need to update the source AssetId to correspond to the file asset. - // - // The other is when an asset is loaded, we clone the asset from file and use an in-memory - // version of the asset until it is time to save, at that moment we need to save to the - // source file - class ScriptCanvasMemoryAsset - : public MemoryAsset - , public AZStd::enable_shared_from_this - , EditorGraphNotificationBus::Handler - { - public: - - ScriptCanvasMemoryAsset(); - ~ScriptCanvasMemoryAsset() override; - - ScriptCanvasMemoryAsset(const ScriptCanvasMemoryAsset& rhs) = delete; - ScriptCanvasMemoryAsset& operator = (const ScriptCanvasMemoryAsset& rhs) = delete; - - using pointer = AZStd::shared_ptr; - - void Create(AZ::Data::AssetId assetId, AZStd::string_view assetAbsolutePath, AZ::Data::AssetType assetType, Callbacks::OnAssetCreatedCallback onAssetCreatedCallback) override; - void SaveAs(const AZStd::string& path, Callbacks::OnSave onSaveCallback) override; - void Save(Callbacks::OnSave onSaveCallback) override; - bool Load(AZ::Data::AssetId assetId, AZ::Data::AssetType assetType, Callbacks::OnAssetReadyCallback onAssetReadyCallback) override; - void Set(AZ::Data::AssetId assetId); - - const AZ::Data::AssetId& GetId() const { return m_inMemoryAssetId; } - const AZ::Data::AssetId& GetFileAssetId() const { return m_fileAssetId; } - - const AZ::Data::AssetType GetAssetType() const { return m_assetType; } - - AZ::Data::Asset GetAsset() { return m_inMemoryAsset; } - const AZ::Data::Asset& GetAsset() const { return m_inMemoryAsset; } - - const AZStd::string GetTabName() const; - - const AZStd::string& GetAbsolutePath() const { return m_absolutePath; } - AZ::EntityId GetScriptCanvasId() const { return m_scriptCanvasId; } - - AZ::EntityId GetGraphId(); - Tracker::ScriptCanvasFileState GetFileState() const; - - void SetFileState(Tracker::ScriptCanvasFileState fileState); - - void CloneTo(ScriptCanvasMemoryAsset& memoryAsset); - - void ActivateAsset(); - - Widget::CanvasWidget* GetView() { return m_canvasWidget; } - - Widget::CanvasWidget* CreateView(QWidget* parent); - void ClearView(); - - void UndoStackChange(); - - SceneUndoState* GetUndoState() { return m_undoState.get(); } - - bool IsSourceInError() const; - - void SavingComplete(const AZStd::string& fullPath, AZ::Uuid sourceAssetId); - - AZ::Data::AssetId GetSourceUuid() const { return m_sourceUuid; } - - private: - - template - auto Clone() - { - AZ::Data::AssetId assetId = AZ::Uuid::CreateRandom(); - - AZ::Data::Asset newAsset = m_inMemoryAsset; - newAsset = { aznew T(assetId, AZ::Data::AssetData::AssetStatus::Ready), AZ::Data::AssetLoadBehavior::Default }; - - auto serializeContext = AZ::EntityUtils::GetApplicationSerializeContext(); - serializeContext->CloneObjectInplace(newAsset.Get()->GetScriptCanvasData(), &m_inMemoryAsset.Get()->GetScriptCanvasData()); - - m_editorEntityIdMap.clear(); - - AZ::IdUtils::Remapper::GenerateNewIdsAndFixRefs(&newAsset.Get()->GetScriptCanvasData(), m_editorEntityIdMap, serializeContext); - - return newAsset; - } - - // EditorGraphNotificationBus - void OnGraphCanvasSceneDisplayed() override; - /// - - //! AZ::Data::AssetBus - void OnAssetReady(AZ::Data::Asset asset) override; - void OnAssetReloaded(AZ::Data::Asset asset) override; - void OnAssetError(AZ::Data::Asset asset) override; - void OnAssetUnloaded(const AZ::Data::AssetId assetId, const AZ::Data::AssetType assetType) override; - /////////////////////// - - // AzToolsFramework::AssetSystemBus::Handler - void SourceFileChanged(AZStd::string relativePath, AZStd::string scanFolder, AZ::Uuid fileAssetId) override; - void SourceFileRemoved(AZStd::string relativePath, AZStd::string scanFolder, AZ::Uuid fileAssetId) override; - void SourceFileFailed(AZStd::string relativePath, AZStd::string scanFolder, AZ::Uuid fileAssetId) override; - /// - - - void FinalizeAssetSave(bool, const AzToolsFramework::SourceControlFileInfo& fileInfo, const AZ::Data::AssetStreamInfo& saveInfo, Callbacks::OnSave onSaveCallback); - - template - void StartAssetLoad(AZ::Data::AssetId assetId, AZ::Data::Asset& asset) - { - asset = AZ::Data::AssetManager::Instance().GetAsset(assetId, asset.GetAutoLoadBehavior()); - } - - template - AZ::Data::Asset CloneAssetData(AZ::Data::AssetId newAssetId) - { - AssetType* assetData = aznew AssetType(newAssetId, AZ::Data::AssetData::AssetStatus::Ready); - - auto& scriptCanvasData = assetData->GetScriptCanvasData(); - - // Clone asset data into SC Editor asset - auto serializeContext = AZ::EntityUtils::GetApplicationSerializeContext(); - serializeContext->CloneObjectInplace(scriptCanvasData, &m_inMemoryAsset.Get()->GetScriptCanvasData()); - - m_editorEntityIdMap.clear(); - - AZ::IdUtils::Remapper::GenerateNewIdsAndFixRefs(&scriptCanvasData, m_editorEntityIdMap, serializeContext); - - // Upon doing this move, the canonical asset will be unloaded - m_inMemoryAsset = { AZStd::move(assetData), AZ::Data::AssetLoadBehavior::Default }; - - return m_inMemoryAsset; - } - - // Upon loading a graph, we clone the source data and we replace the loaded asset with - // a clone, this is to prevent modifications to the source data and it gives us some - // flexibility if we need to load the source asset again - AZ::Data::Asset CloneAssetData(AZ::Data::AssetId newAssetId); - - // IUndoNotify - void OnUndoStackChanged() override; - // - - private: - - void SetFileAssetId(const AZ::Data::AssetId& fileAssetId); - - void SignalFileStateChanged(); - - AZStd::string MakeTemporaryFilePathForSave(AZStd::string_view targetFilename); - - //! Finds the appropriate asset handler for the type of Script Canvas asset given - ScriptCanvasAssetHandler* GetAssetHandlerForType(AZ::Data::AssetType assetType); - - //! The asset type, we need it to make sure we call the correct factory methods - AZ::Data::AssetType m_assetType; - - //! The in-memory asset - AZ::Data::Asset m_inMemoryAsset; - - AZ::Data::Asset m_sourceAsset; - - //! Whether we are making a new asset or loading one, we should always have its absolute path - AZStd::string m_absolutePath; - - AZStd::string m_saveAsPath; - - //! The AssetId of the canonical asset on file, if the asset has never been saved to file, it is Invalid - AZ::Data::AssetId m_fileAssetId; - - //! The AssetId that represents this asset, it will always be the in-memory asset Id and never the file asset Id - AZ::Data::AssetId m_inMemoryAssetId; - - //! When a new asset is saved, we need to keep it's previous internal Ids in order for the front end to remap to the new Ids - using FormerGraphIdPair = AZStd::pair; - FormerGraphIdPair m_formerGraphIdPair; - - //! The EntityId of the ScriptCanvasEntity owned by the ScriptCanvasAsset - ScriptCanvas::ScriptCanvasId m_scriptCanvasId; - - //! The EntityId that represents the ScriptCanvas graph - AZ::EntityId m_graphId; - - //! Gives the ability to provide a lambda invoked when the asset is ready - Callbacks::OnAssetReadyCallback m_onAssetReadyCallback; - - //! The Save is officially complete after SourceFileChange is handled. - Callbacks::OnSave m_onSaveCallback; - - bool m_sourceRemoved = false; - Tracker::ScriptCanvasFileState m_fileState = Tracker::ScriptCanvasFileState::INVALID; - - //! We need to track the filename of the file being saved because we need to match it when we handle SourceFileChange (see SourceFileChange for details) - AZStd::vector m_pendingSave; - - //! Each memory asset owns its view widget - Widget::CanvasWidget* m_canvasWidget = nullptr; - - //! Utility cache of remapped entityIds - using EditorEntityIdMap = AZStd::unordered_map; - - //! Cached mapping of Scene Entity ID to Asset Id, used by the debugger - EditorEntityIdMap m_editorEntityIdMap; - - //! Each asset keeps track of its undo state - AZStd::unique_ptr m_undoState; - - //! The undo helper is an object that implements the Undo behaviors - AZStd::unique_ptr m_undoHelper; - - bool m_sourceInError; - - AZ::Data::AssetId m_sourceUuid; - - AssetSaveFinalizer m_assetSaveFinalizer; - - public: - - //! Given a scene EntityId, find the respective editor EntityId - AZ::EntityId GetEditorEntityIdFromSceneEntityId(AZ::EntityId sceneEntityId); - - //! Given an editor EntityId, find the respective scene EntityId - AZ::EntityId GetSceneEntityIdFromEditorEntityId(AZ::EntityId editorEntityId); - - //! When a new asset is saved, we need to keep it's previous internal Ids in order for the front end to remap to the new Ids - const FormerGraphIdPair& GetFormerGraphIds() const { return m_formerGraphIdPair; } - - }; - - -} diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.cpp index f125a4cbc9..a067bf411e 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.cpp @@ -7,7 +7,6 @@ */ #include "ScriptCanvasUndoHelper.h" -#include "ScriptCanvasMemoryAsset.h" #include #include diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index 3ad2580d3c..6419525726 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -20,13 +20,13 @@ #include #include #include -#include #include #include #include #include #include #include +#include #include #include #include @@ -66,8 +66,8 @@ namespace ScriptCanvasEditor return false; } - ScriptCanvasAssetHolder assetHolder; - assetHolder.SetAsset(scriptCanvasAsset.GetId()); + Deprecated::ScriptCanvasAssetHolder assetHolder; + assetHolder.m_scriptCanvasAsset = scriptCanvasAsset; if (!rootElement.AddElementWithData(serializeContext, "m_assetHolder", assetHolder)) { @@ -115,7 +115,7 @@ namespace ScriptCanvasEditor auto& scriptCanvasAssetHolderElement = rootElement.GetSubElement(scriptCanvasAssetHolderElementIndex); - ScriptCanvasAssetHolder assetHolder; + Deprecated::ScriptCanvasAssetHolder assetHolder; if (!scriptCanvasAssetHolderElement.GetData(assetHolder)) { AZ_Error("ScriptCanvas", false, "EditorScriptCanvasComponent conversion failed: could not retrieve old 'm_assetHolder'"); @@ -131,7 +131,7 @@ namespace ScriptCanvasEditor } ScriptCanvasBuilder::BuildVariableOverrides overrides; - overrides.m_source = SourceHandle(nullptr, assetHolder.GetAssetId().m_guid, {}); + overrides.m_source = SourceHandle(nullptr, assetHolder.m_scriptCanvasAsset.GetId().m_guid, {}); for (auto& variable : editableData.GetVariables()) { @@ -147,15 +147,15 @@ namespace ScriptCanvasEditor if (rootElement.GetVersion() < EditorScriptCanvasComponentCpp::Version::AddSourceHandle) { - ScriptCanvasAssetHolder assetHolder; + Deprecated::ScriptCanvasAssetHolder assetHolder; if (!rootElement.FindSubElementAndGetData(AZ_CRC_CE("m_assetHolder"), assetHolder)) { AZ_Error("ScriptCanvas", false, "EditorScriptCanvasComponent conversion failed: could not retrieve old 'm_assetHolder'"); return false; } - auto assetId = assetHolder.GetAssetId(); - auto path = assetHolder.GetAssetHint(); + auto assetId = assetHolder.m_scriptCanvasAsset.GetId(); + auto path = assetHolder.m_scriptCanvasAsset.GetHint(); if (!rootElement.AddElementWithData(serializeContext, "runtimeDataOverrides", SourceHandle(nullptr, assetId.m_guid, path))) { @@ -188,7 +188,6 @@ namespace ScriptCanvasEditor ->Attribute(AZ::Edit::Attributes::Icon, "Icons/ScriptCanvas/ScriptCanvas.svg") ->Attribute(AZ::Edit::Attributes::ViewportIcon, "Icons/ScriptCanvas/Viewport/ScriptCanvas.svg") ->Attribute(AZ::Edit::Attributes::AutoExpand, true) - ->Attribute(AZ::Edit::Attributes::PrimaryAssetType, ScriptCanvasAssetHandler::GetAssetTypeStatic()) ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("Game", 0x232b318c)) ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("UI", 0x27ff46b0)) ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("Level", 0x9aeacc13)) diff --git a/Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/FunctionNodeDescriptorComponent.cpp b/Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/FunctionNodeDescriptorComponent.cpp index f80c6dde21..c8de1e892a 100644 --- a/Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/FunctionNodeDescriptorComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/GraphCanvas/Components/NodeDescriptors/FunctionNodeDescriptorComponent.cpp @@ -14,7 +14,6 @@ #include #include -#include #include #include @@ -89,16 +88,9 @@ namespace ScriptCanvasEditor bool FunctionNodeDescriptorComponent::OnMouseDoubleClick(const QGraphicsSceneMouseEvent*) { - AZ::Data::AssetInfo assetInfo = AssetHelpers::GetSourceInfoByProductId(m_assetId, azrtti_typeid< ScriptCanvas::SubgraphInterfaceAsset>()); - - if (!assetInfo.m_assetId.IsValid()) - { - return false; - } - AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset - , SourceHandle( nullptr, assetInfo.m_assetId.m_guid, {} ), Tracker::ScriptCanvasFileState::UNMODIFIED, -1); + , SourceHandle( nullptr, m_assetId.m_guid, {} ), Tracker::ScriptCanvasFileState::UNMODIFIED, -1); return openOutcome.IsSuccess(); } diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetHandler.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetHandler.h deleted file mode 100644 index a0e00b40fd..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetHandler.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#pragma once - -#include -#include -#include -#include - -namespace AZ -{ - class SerializeContext; -} - -namespace ScriptCanvasEditor -{ - /** - * Manages editor Script Canvas graph assets. - */ - class ScriptCanvasAssetHandler - : public AZ::Data::AssetHandler - , protected AZ::AssetTypeInfoBus::MultiHandler - { - public: - AZ_CLASS_ALLOCATOR(ScriptCanvasAssetHandler, AZ::SystemAllocator, 0); - AZ_RTTI(ScriptCanvasAssetHandler, "{098B86B2-2527-4155-84C9-A698A0D20068}", AZ::Data::AssetHandler); - - ScriptCanvasAssetHandler(AZ::SerializeContext* context = nullptr); - ~ScriptCanvasAssetHandler(); - - // Called by the asset database to create a new asset. - AZ::Data::AssetPtr CreateAsset(const AZ::Data::AssetId& id, const AZ::Data::AssetType& type) override; - - // Override the stream info to force source assets to load into the Editor instead of cached, processed assets. - void GetCustomAssetStreamInfoForLoad(AZ::Data::AssetStreamInfo& streamInfo) override; - - // Called by the asset database to perform actual asset load. - AZ::Data::AssetHandler::LoadResult LoadAssetData( - const AZ::Data::Asset& asset, - AZStd::shared_ptr stream, - const AZ::Data::AssetFilterCB& assetLoadFilterCB) override; - - // Called by the asset database to perform actual asset save. Returns true if successful otherwise false (default - as we don't require support save). - bool SaveAssetData(const AZ::Data::Asset& asset, AZ::IO::GenericStream* stream) override; - bool SaveAssetData(const ScriptCanvasAsset* assetData, AZ::IO::GenericStream* stream); - bool SaveAssetData(const ScriptCanvasAsset* assetData, AZ::IO::GenericStream* stream, AZ::DataStream::StreamType streamType); - - // Called by the asset database when an asset should be deleted. - void DestroyAsset(AZ::Data::AssetPtr ptr) override; - - // Called by asset database on registration. - void GetHandledAssetTypes(AZStd::vector& assetTypes) override; - - // Provides editor with information about script canvas graph assets. - AZ::Data::AssetType GetAssetType() const override; - const char* GetAssetTypeDisplayName() const override; - void GetAssetTypeExtensions(AZStd::vector& extensions) override; - - AZ::Uuid GetComponentTypeId() const override; - - AZ::SerializeContext* GetSerializeContext() const; - - void SetSerializeContext(AZ::SerializeContext* context); - - static AZ::Data::AssetType GetAssetTypeStatic(); - - // protected AZ::AssetTypeInfoBus::MultiHandler... - const char* GetGroup() const override; - const char* GetBrowserIcon() const override; - - - protected: - AZ::SerializeContext* m_serializeContext; - }; -} diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorDeprecationData.cpp b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorDeprecationData.cpp new file mode 100644 index 0000000000..635f6e09e9 --- /dev/null +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorDeprecationData.cpp @@ -0,0 +1,28 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include + +#include +#include + +namespace ScriptCanvasEditor +{ + namespace Deprecated + { + void ScriptCanvasAssetHolder::Reflect(AZ::ReflectContext* context) + { + if (auto serializeContext = azrtti_cast(context)) + { + serializeContext->Class() + ->Field("m_asset", &ScriptCanvasAssetHolder::m_scriptCanvasAsset) + ; + } + } + } +} diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorDeprecationData.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorDeprecationData.h new file mode 100644 index 0000000000..a8e54f034e --- /dev/null +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorDeprecationData.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include +#include + +class ScriptCanvasAsset; + + +namespace ScriptCanvasEditor +{ + namespace Deprecated + { + class ScriptCanvasAssetHolder + { + public: + AZ_TYPE_INFO(ScriptCanvasAssetHolder, "{3E80CEE3-2932-4DC1-AADF-398FDDC6DEFE}"); + AZ_CLASS_ALLOCATOR(ScriptCanvasAssetHolder, AZ::SystemAllocator, 0); + + ScriptCanvasAssetHolder() = default; + static void Reflect(AZ::ReflectContext* context); + + AZ::Data::Asset m_scriptCanvasAsset; + }; + } +} diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h index d797f8db08..da1b0a22a6 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h @@ -13,8 +13,6 @@ #include #include #include -#include -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Editor/ReflectComponent.cpp b/Gems/ScriptCanvas/Code/Editor/ReflectComponent.cpp index 7f2a170a4d..8990b55798 100644 --- a/Gems/ScriptCanvas/Code/Editor/ReflectComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/ReflectComponent.cpp @@ -12,7 +12,6 @@ #include #include -#include #include #include @@ -24,6 +23,7 @@ #include #include #include +#include #include @@ -33,7 +33,7 @@ namespace ScriptCanvasEditor { SourceHandle::Reflect(context); ScriptCanvas::ScriptCanvasData::Reflect(context); - ScriptCanvasAssetHolder::Reflect(context); + Deprecated::ScriptCanvasAssetHolder::Reflect(context); EditorSettings::EditorWorkspace::Reflect(context); EditorSettings::ScriptCanvasEditorSettings::Reflect(context); LiveLoggingUserSettings::Reflect(context); diff --git a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp index f8424b60d9..4933a31b60 100644 --- a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp @@ -37,6 +37,8 @@ #include #include #include +#include + namespace ScriptCanvasEditor { @@ -109,7 +111,6 @@ namespace ScriptCanvasEditor void SystemComponent::Activate() { - m_assetTracker.Activate(); AZ::JobManagerDesc jobDesc; for (size_t i = 0; i < cs_jobThreads; ++i) { @@ -165,7 +166,6 @@ namespace ScriptCanvasEditor m_jobContext.reset(); m_jobManager.reset(); - m_assetTracker.Deactivate(); } void SystemComponent::AddAsyncJob(AZStd::function&& jobFunc) diff --git a/Gems/ScriptCanvas/Code/Editor/SystemComponent.h b/Gems/ScriptCanvas/Code/Editor/SystemComponent.h index c2c42c5b9d..dc4175f938 100644 --- a/Gems/ScriptCanvas/Code/Editor/SystemComponent.h +++ b/Gems/ScriptCanvas/Code/Editor/SystemComponent.h @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -118,8 +117,6 @@ namespace ScriptCanvasEditor AZStd::unordered_set m_creatableTypes; - AssetTracker m_assetTracker; - AZStd::vector m_assetsThatNeedManualUpgrade; bool m_isUpgrading = false; diff --git a/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.cpp b/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.cpp index 944a5e667d..f497b83b08 100644 --- a/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.cpp @@ -19,7 +19,6 @@ #include #include -#include namespace ScriptCanvasEditor { diff --git a/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.h b/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.h index b9435d0702..9b36a7beb0 100644 --- a/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.h +++ b/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.h @@ -30,8 +30,6 @@ namespace ScriptCanvasEditor using GraphItemCommandNotificationBus = AZ::EBus; - class ScriptCanvasMemoryAsset; - // This command is the base URSequencePoint command from which all Script Canvas undo/redo commands derive class GraphItemCommand : public AzToolsFramework::UndoSystem::URSequencePoint diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h index 939fb7c8f4..39500eb29c 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.h @@ -17,7 +17,6 @@ #include #include -#include #include #endif diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/NodePaletteModel.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/NodePaletteModel.cpp index c5be5cb4c6..0efdf071f5 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/NodePaletteModel.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/NodePaletteModel.cpp @@ -16,7 +16,6 @@ #include -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.cpp index bf8482f0ca..1258842b75 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.cpp @@ -38,7 +38,6 @@ #include -#include #include #include #include @@ -462,32 +461,35 @@ namespace ScriptCanvasEditor return; } - AZStd::string rootPath, absolutePath; - AZ::Data::AssetInfo assetInfo = AssetHelpers::GetAssetInfo(assetId, rootPath); - AzFramework::StringFunc::Path::Join(rootPath.c_str(), assetInfo.m_relativePath.c_str(), absolutePath); - - AZStd::string normPath = absolutePath; - AzFramework::StringFunc::Path::Normalize(normPath); - - AZStd::string watchFolder; - bool sourceInfoFound{}; - AzToolsFramework::AssetSystemRequestBus::BroadcastResult(sourceInfoFound, &AzToolsFramework::AssetSystemRequestBus::Events::GetSourceInfoBySourcePath, normPath.c_str(), assetInfo, watchFolder); - - if (!sourceInfoFound) - { - return; - } - - CreateFunctionPaletteItem(asset, assetInfo); - - treePaletteIter = m_globalFunctionTreeItems.find(asset->GetId()); - - if (treePaletteIter != m_globalFunctionTreeItems.end()) - { - treePaletteIter->second->ClearError(); - } - - m_monitoredAssets.emplace(asset->GetId(), asset); + // #sc_editor_asset_redux THIS WHOLE THING NEEDS TO BE REDONE TO MAKE SURE THAT USER FUNCTIONS SHOW UP IN THE + // NODE PALETTE +// +// AZStd::string rootPath, absolutePath; +// AZ::Data::AssetInfo assetInfo = AssetHelpers::GetAssetInfo(assetId, rootPath); +// AzFramework::StringFunc::Path::Join(rootPath.c_str(), assetInfo.m_relativePath.c_str(), absolutePath); +// +// AZStd::string normPath = absolutePath; +// AzFramework::StringFunc::Path::Normalize(normPath); +// +// AZStd::string watchFolder; +// bool sourceInfoFound{}; +// AzToolsFramework::AssetSystemRequestBus::BroadcastResult(sourceInfoFound, &AzToolsFramework::AssetSystemRequestBus::Events::GetSourceInfoBySourcePath, normPath.c_str(), assetInfo, watchFolder); +// +// if (!sourceInfoFound) +// { +// return; +// } +// +// CreateFunctionPaletteItem(asset, assetInfo); +// +// treePaletteIter = m_globalFunctionTreeItems.find(asset->GetId()); +// +// if (treePaletteIter != m_globalFunctionTreeItems.end()) +// { +// treePaletteIter->second->ClearError(); +// } +// +// m_monitoredAssets.emplace(asset->GetId(), asset); } else { diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/NodeUsageTreeItem.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/NodeUsageTreeItem.cpp index 4dce7ce384..b10a7fc314 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/NodeUsageTreeItem.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/NodeUsageTreeItem.cpp @@ -10,7 +10,6 @@ #include -#include #include #include @@ -152,8 +151,9 @@ namespace ScriptCanvasEditor m_assetType = assetType; - auto onAssetReady = [](ScriptCanvasMemoryAsset&) {}; - AssetTrackerRequestBus::Broadcast(&AssetTrackerRequests::Load, m_assetId, m_assetType, onAssetReady); + // #sc-editor-asset-redux fix up + // auto onAssetReady = [](ScriptCanvasMemoryAsset&) {}; + // AssetTrackerRequestBus::Broadcast(&AssetTrackerRequests::Load, m_assetId, m_assetType, onAssetReady); } const AZ::Data::AssetId& ScriptCanvasAssetNodeUsageTreeItem::GetAssetId() const diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/UnitTestPanel/UnitTestDockWidget.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/UnitTestPanel/UnitTestDockWidget.cpp index f319a166df..d3661a4ef3 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/UnitTestPanel/UnitTestDockWidget.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/UnitTestPanel/UnitTestDockWidget.cpp @@ -35,7 +35,6 @@ #include #include -#include #include #include #include @@ -48,12 +47,11 @@ #include #include -#include #include #include #include #include - +#include #include namespace ScriptCanvasEditor @@ -522,16 +520,20 @@ namespace ScriptCanvasEditor continue; } - AZ::Data::AssetInfo assetInfo; - if (AssetHelpers::GetAssetInfo(sourceBrowserEntry->GetFullPath(), assetInfo)) - { - auto asset = AZ::Data::AssetManager::Instance().GetAsset(assetInfo.m_assetId, azrtti_typeid(), AZ::Data::AssetLoadBehavior::PreLoad); - asset.BlockUntilLoadComplete(); - if (asset.IsReady()) - { - RunTestGraph(asset, mode); - } - } + ScriptCanvasEditor::SourceHandle source(nullptr, scriptUuid, ""); + ScriptCanvasEditor::CompleteDescriptionInPlace(source); + + // #sc_editor_asset_redux +// AZ::Data::AssetInfo assetInfo; +// if (AssetHelpers::GetAssetInfo(sourceBrowserEntry->GetFullPath(), assetInfo)) +// { +// auto asset = AZ::Data::AssetManager::Instance().GetAsset(assetInfo.m_assetId, azrtti_typeid(), AZ::Data::AssetLoadBehavior::PreLoad); +// asset.BlockUntilLoadComplete(); +// if (asset.IsReady()) +// { +// RunTestGraph(asset, mode); +// } +// } } } } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/SlotTypeSelectorWidget.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/SlotTypeSelectorWidget.cpp index fe3a59d28a..a632b7719e 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/SlotTypeSelectorWidget.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/SlotTypeSelectorWidget.cpp @@ -37,7 +37,6 @@ #include -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/VariableDockWidget.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/VariableDockWidget.cpp index 68176d6b95..2222f4d2aa 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/VariableDockWidget.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/VariableDockWidget.cpp @@ -37,7 +37,6 @@ #include -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 306068bd5c..c40c126dd1 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -97,7 +97,6 @@ #include #include #include -#include #include #include @@ -145,9 +144,6 @@ //// #include -#include -#include - #include #include #include @@ -358,21 +354,6 @@ namespace ScriptCanvasEditor } } - void Workspace::OnAssetReady(const ScriptCanvasMemoryAsset::pointer memoryAsset) - { - // open the file in the main window -// const ScriptCanvasEditor::SourceHandle& fileAssetId = memoryAsset->GetFileAssetId(); -// -// if (AssetTrackerNotificationBus::MultiHandler::BusIsConnectedId(fileAssetId)) -// { -// AssetTrackerNotificationBus::MultiHandler::BusDisconnect(fileAssetId); -// -// m_mainWindow->OpenScriptCanvasAsset(*memoryAsset); -// -// SignalAssetComplete(fileAssetId); -// } - } - void Workspace::SignalAssetComplete(const ScriptCanvasEditor::SourceHandle& /*fileAssetId*/) { // When we are done loading all assets we can safely set the focus to the recorded asset @@ -3513,19 +3494,23 @@ namespace ScriptCanvasEditor return findChild(elementName); } - AZ::EntityId MainWindow::FindEditorNodeIdByAssetNodeId(const ScriptCanvasEditor::SourceHandle& assetId, AZ::EntityId assetNodeId) const + AZ::EntityId MainWindow::FindEditorNodeIdByAssetNodeId([[maybe_unused]] const ScriptCanvasEditor::SourceHandle& assetId + , [[maybe_unused]] AZ::EntityId assetNodeId) const { - AZ::EntityId editorEntityId; - AssetTrackerRequestBus::BroadcastResult - ( editorEntityId, &AssetTrackerRequests::GetEditorEntityIdFromSceneEntityId, assetId.Id(), assetNodeId); + AZ::EntityId editorEntityId{}; +// AssetTrackerRequestBus::BroadcastResult +// ( editorEntityId, &AssetTrackerRequests::GetEditorEntityIdFromSceneEntityId, assetId.Id(), assetNodeId); + // #sc_editor_asset_redux fix logger return editorEntityId; } - AZ::EntityId MainWindow::FindAssetNodeIdByEditorNodeId(const ScriptCanvasEditor::SourceHandle& assetId, AZ::EntityId editorNodeId) const + AZ::EntityId MainWindow::FindAssetNodeIdByEditorNodeId([[maybe_unused]] const ScriptCanvasEditor::SourceHandle& assetId + , [[maybe_unused]] AZ::EntityId editorNodeId) const { - AZ::EntityId sceneEntityId; - AssetTrackerRequestBus::BroadcastResult - ( sceneEntityId, &AssetTrackerRequests::GetSceneEntityIdFromEditorEntityId, assetId.Id(), editorNodeId); + AZ::EntityId sceneEntityId{}; + // AssetTrackerRequestBus::BroadcastResult + // ( sceneEntityId, &AssetTrackerRequests::GetSceneEntityIdFromEditorEntityId, assetId.Id(), editorNodeId); + // #sc_editor_asset_redux fix logger return sceneEntityId; } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h index fed4f28f4f..4ff5cf094b 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h @@ -43,11 +43,11 @@ #include #include #include -#include #include #include #include #include +#include #include @@ -58,9 +58,6 @@ #include #endif -#include -#include - #include #endif @@ -155,7 +152,6 @@ namespace ScriptCanvasEditor //! Manages the Save/Restore operations of the user's last opened and focused graphs class Workspace - : AssetTrackerNotificationBus::MultiHandler { public: @@ -174,7 +170,6 @@ namespace ScriptCanvasEditor private: - void OnAssetReady(const ScriptCanvasMemoryAsset::pointer asset) override; void SignalAssetComplete(const ScriptCanvasEditor::SourceHandle& fileAssetId); ScriptCanvasEditor::SourceHandle GetSourceAssetId(const ScriptCanvasEditor::SourceHandle& memoryAssetId) const; @@ -329,7 +324,6 @@ namespace ScriptCanvasEditor bool OnFileSaveAs(); bool OnFileSaveCaller(){return OnFileSave();}; bool OnFileSaveAsCaller(){return OnFileSaveAs();}; - bool SaveAssetImpl_OLD(const ScriptCanvasEditor::SourceHandle& assetId, const Callbacks::OnSave& saveCB); enum class Save { InPlace, diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp index ce8a8e9821..39cd6f565e 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp @@ -29,7 +29,6 @@ #include #include #include -#include #include #include diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp index 49a35eac8a..f703bb17b1 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/FileSaver.cpp @@ -14,7 +14,6 @@ #include #include #include -#include #include namespace ScriptCanvasEditor diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Model.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Model.cpp index 5df1e32c8f..70ff7a92ca 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Model.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Model.cpp @@ -8,7 +8,6 @@ #include #include -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.cpp index c557a83f0c..0678aee013 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/UpgradeHelper.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake index 77ccf7fda9..897539db7b 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake @@ -15,12 +15,8 @@ set(FILES Editor/SystemComponent.h Editor/SystemComponent.cpp Editor/QtMetaTypes.h - Editor/Assets/ScriptCanvasAssetTracker.cpp - Editor/Assets/ScriptCanvasAssetTracker.h - Editor/Assets/ScriptCanvasAssetTrackerBus.h Editor/Assets/ScriptCanvasAssetHelpers.h Editor/Assets/ScriptCanvasAssetHelpers.cpp - Editor/Assets/ScriptCanvasAssetTrackerDefinitions.h Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.h Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.cpp Editor/Include/ScriptCanvas/Assets/ScriptCanvasAsset.h @@ -28,13 +24,7 @@ set(FILES Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetBus.h Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetTypes.h Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h - Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetHandler.h Editor/Assets/ScriptCanvasFileHandling.cpp - Editor/Assets/ScriptCanvasAssetHandler.cpp - Editor/Assets/ScriptCanvasAssetHolder.h - Editor/Assets/ScriptCanvasAssetHolder.cpp - Editor/Assets/ScriptCanvasMemoryAsset.h - Editor/Assets/ScriptCanvasMemoryAsset.cpp Editor/Assets/ScriptCanvasUndoHelper.h Editor/Assets/ScriptCanvasUndoHelper.cpp Editor/Include/ScriptCanvas/Bus/RequestBus.h @@ -56,6 +46,8 @@ set(FILES Editor/Include/ScriptCanvas/Components/EditorGraphVariableManagerComponent.h Editor/Components/EditorGraphVariableManagerComponent.cpp Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h + Editor/Include/ScriptCanvas/Components/EditorDeprecationData.h + Editor/Include/ScriptCanvas/Components/EditorDeprecationData.cpp Editor/Components/EditorScriptCanvasComponent.cpp Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponentSerializer.h Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponentSerializer.cpp diff --git a/Gems/ScriptCanvasTesting/Code/Source/Framework/ScriptCanvasTestUtilities.cpp b/Gems/ScriptCanvasTesting/Code/Source/Framework/ScriptCanvasTestUtilities.cpp index f4abbea7b2..d7f6ac7e88 100644 --- a/Gems/ScriptCanvasTesting/Code/Source/Framework/ScriptCanvasTestUtilities.cpp +++ b/Gems/ScriptCanvasTesting/Code/Source/Framework/ScriptCanvasTestUtilities.cpp @@ -6,7 +6,6 @@ * */ -#include #include #include #include From aa9799a63b0b9c413e5f1431a299d41275648987 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Mon, 13 Dec 2021 15:05:17 -0800 Subject: [PATCH 127/948] Use the high perf allocator for DomValueWriter Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h index 7430ff910b..488535ace6 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h @@ -56,17 +56,17 @@ namespace AZ::Dom struct ValueBuffer { - AZStd::vector m_elements; - AZStd::vector> m_attributes; + Array::ContainerType m_elements; + Object::ContainerType m_attributes; }; ValueBuffer& GetValueBuffer(); Value& m_result; // Stores info about the current value being processed - AZStd::stack m_entryStack; + AZStd::stack>> m_entryStack; // Provides temporary storage for elements and attributes to prevent extra heap allocations // These buffers persist to be reused even as the entry stack changes - AZStd::vector m_valueBuffers; + AZStd::vector> m_valueBuffers; }; } // namespace AZ::Dom From 98fa18558eabb8e28d2901357bff481148c1d6b5 Mon Sep 17 00:00:00 2001 From: AMZN-Phil Date: Mon, 13 Dec 2021 17:40:09 -0800 Subject: [PATCH 128/948] Force Project Manager to use VS2019 Signed-off-by: AMZN-Phil --- .../Platform/Windows/ProjectBuilderWorker_windows.cpp | 1 + .../ProjectManager/Platform/Windows/ProjectUtils_windows.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Code/Tools/ProjectManager/Platform/Windows/ProjectBuilderWorker_windows.cpp b/Code/Tools/ProjectManager/Platform/Windows/ProjectBuilderWorker_windows.cpp index 075c6de774..79258d83ea 100644 --- a/Code/Tools/ProjectManager/Platform/Windows/ProjectBuilderWorker_windows.cpp +++ b/Code/Tools/ProjectManager/Platform/Windows/ProjectBuilderWorker_windows.cpp @@ -19,6 +19,7 @@ namespace O3DE::ProjectManager QString targetBuildPath = QDir(m_projectInfo.m_path).filePath(ProjectBuildPathPostfix); return AZ::Success(QStringList{ ProjectCMakeCommand, + "-G", "Visual Studio 16 2019" "-B", targetBuildPath, "-S", m_projectInfo.m_path, QString("-DLY_3RDPARTY_PATH=").append(thirdPartyPath), diff --git a/Code/Tools/ProjectManager/Platform/Windows/ProjectUtils_windows.cpp b/Code/Tools/ProjectManager/Platform/Windows/ProjectUtils_windows.cpp index 41a878f0ae..89032320cd 100644 --- a/Code/Tools/ProjectManager/Platform/Windows/ProjectUtils_windows.cpp +++ b/Code/Tools/ProjectManager/Platform/Windows/ProjectUtils_windows.cpp @@ -77,7 +77,7 @@ namespace O3DE::ProjectManager if (vsWhereFile.exists() && vsWhereFile.isFile()) { QStringList vsWhereBaseArguments = QStringList{"-version", - "16.9.2", + "[16.9.2,17)", "-latest", "-requires", "Microsoft.VisualStudio.Component.VC.Tools.x86.x64"}; From 087081f449b219e15e7ead8509f373d7420d537b Mon Sep 17 00:00:00 2001 From: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> Date: Mon, 13 Dec 2021 23:26:39 -0700 Subject: [PATCH 129/948] Added DiffuseProbeGridDownsamplePass, which will disable when there are no DiffuseProbeGrids in the scene. Moved the IrradianceImage to the DiffuseGlobalIllumination parent pass. Signed-off-by: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> --- .../Passes/DiffuseGlobalIllumination.pass | 50 ++++++++++++++++++- .../Passes/DiffuseProbeGridDownsample.pass | 48 +----------------- .../Code/Source/CommonSystemComponent.cpp | 2 + ...fuseGlobalIlluminationFeatureProcessor.cpp | 27 ++++++++-- .../DiffuseProbeGridDownsamplePass.cpp | 36 +++++++++++++ .../DiffuseProbeGridDownsamplePass.h | 37 ++++++++++++++ .../Code/atom_feature_common_files.cmake | 2 + 7 files changed, 151 insertions(+), 51 deletions(-) create mode 100644 Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridDownsamplePass.cpp create mode 100644 Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridDownsamplePass.h diff --git a/Gems/Atom/Feature/Common/Assets/Passes/DiffuseGlobalIllumination.pass b/Gems/Atom/Feature/Common/Assets/Passes/DiffuseGlobalIllumination.pass index bd17939925..45278cd511 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/DiffuseGlobalIllumination.pass +++ b/Gems/Atom/Feature/Common/Assets/Passes/DiffuseGlobalIllumination.pass @@ -26,6 +26,54 @@ "Name": "DepthStencilInputOutput", "SlotType": "InputOutput", "ScopeAttachmentUsage": "DepthStencil" + }, + { + "Name": "IrradianceOutput", + "SlotType": "InputOutput", + "ScopeAttachmentUsage": "RenderTarget", + "LoadStoreAction": { + "ClearValue": { + "Value": [ + 0.0, + 0.0, + 0.0, + 0.0 + ] + }, + "LoadAction": "Clear" + } + } + ], + "ImageAttachments": [ + { + "Name": "IrradianceImage", + "SizeSource": { + "Source": { + "Pass": "This", + "Attachment": "NormalInput" + }, + "Multipliers": { + "WidthMultiplier": 0.25, + "HeightMultiplier": 0.25 + } + }, + "MultisampleSource": { + "Pass": "This", + "Attachment": "NormalInput" + }, + "ImageDescriptor": { + "Format": "R16G16B16A16_FLOAT", + "SharedQueueMask": "Graphics" + } + } + ], + "Connections": [ + { + "LocalSlot": "IrradianceOutput", + "AttachmentRef": { + "Pass": "This", + "Attachment": "IrradianceImage" + } } ], "PassRequests": [ @@ -78,7 +126,7 @@ { "LocalSlot": "Output", "AttachmentRef": { - "Pass": "DiffuseProbeGridDownsamplePass", + "Pass": "Parent", "Attachment": "IrradianceOutput" } } diff --git a/Gems/Atom/Feature/Common/Assets/Passes/DiffuseProbeGridDownsample.pass b/Gems/Atom/Feature/Common/Assets/Passes/DiffuseProbeGridDownsample.pass index 266f65f37b..0560cc2d75 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/DiffuseProbeGridDownsample.pass +++ b/Gems/Atom/Feature/Common/Assets/Passes/DiffuseProbeGridDownsample.pass @@ -5,7 +5,7 @@ "ClassData": { "PassTemplate": { "Name": "DiffuseProbeGridDownsamplePassTemplate", - "PassClass": "FullScreenTriangle", + "PassClass": "DiffuseProbeGridDownsamplePass", "Slots": [ { "Name": "NormalInput", @@ -38,24 +38,6 @@ "LoadStoreAction": { "LoadAction": "DontCare" } - }, - { - // Note: this is attached here to ensure that the image is cleared, - // but it is not used as an output from the shader - "Name": "IrradianceOutput", - "SlotType": "Output", - "ScopeAttachmentUsage": "RenderTarget", - "LoadStoreAction": { - "ClearValue": { - "Value": [ - 0.0, - 0.0, - 0.0, - 0.0 - ] - }, - "LoadAction": "Clear" - } } ], "ImageAttachments": [ @@ -103,27 +85,6 @@ "Format": "R16G16B16A16_FLOAT", "SharedQueueMask": "Graphics" } - }, - { - "Name": "IrradianceImage", - "SizeSource": { - "Source": { - "Pass": "This", - "Attachment": "NormalInput" - }, - "Multipliers": { - "WidthMultiplier": 0.25, - "HeightMultiplier": 0.25 - } - }, - "MultisampleSource": { - "Pass": "This", - "Attachment": "NormalInput" - }, - "ImageDescriptor": { - "Format": "R16G16B16A16_FLOAT", - "SharedQueueMask": "Graphics" - } } ], "Connections": [ @@ -140,13 +101,6 @@ "Pass": "This", "Attachment": "DownsampledDepthImage" } - }, - { - "LocalSlot": "IrradianceOutput", - "AttachmentRef": { - "Pass": "This", - "Attachment": "IrradianceImage" - } } ], "PassData": { diff --git a/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp b/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp index c3c189eb62..dc5d1a5c12 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp @@ -97,6 +97,7 @@ #include #include #include +#include #include #include #include @@ -285,6 +286,7 @@ namespace AZ passSystem->AddPassCreator(Name("DiffuseProbeGridBorderUpdatePass"), &Render::DiffuseProbeGridBorderUpdatePass::Create); passSystem->AddPassCreator(Name("DiffuseProbeGridRelocationPass"), &Render::DiffuseProbeGridRelocationPass::Create); passSystem->AddPassCreator(Name("DiffuseProbeGridClassificationPass"), &Render::DiffuseProbeGridClassificationPass::Create); + passSystem->AddPassCreator(Name("DiffuseProbeGridDownsamplePass"), &Render::DiffuseProbeGridDownsamplePass::Create); passSystem->AddPassCreator(Name("DiffuseProbeGridRenderPass"), &Render::DiffuseProbeGridRenderPass::Create); passSystem->AddPassCreator(Name("LuminanceHistogramGeneratorPass"), &LuminanceHistogramGeneratorPass::Create); diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseGlobalIlluminationFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseGlobalIlluminationFeatureProcessor.cpp index 453dbbc0ab..768c183f03 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseGlobalIlluminationFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseGlobalIlluminationFeatureProcessor.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -90,10 +91,11 @@ namespace AZ downsamplePassFilter, [sizeMultiplier](RPI::Pass* pass) -> RPI::PassFilterExecutionFlow { - for (uint32_t outputIndex = 0; outputIndex < pass->GetOutputCount(); ++outputIndex) + // update the downsample pass size multipliers + for (uint32_t attachmentIndex = 0; attachmentIndex < pass->GetOutputCount(); ++attachmentIndex) { - RPI::Ptr outputAttachment = pass->GetOutputBinding(outputIndex).m_attachment; - RPI::PassAttachmentSizeMultipliers& sizeMultipliers = outputAttachment->m_sizeMultipliers; + RPI::Ptr attachment = pass->GetOutputBinding(attachmentIndex).m_attachment; + RPI::PassAttachmentSizeMultipliers& sizeMultipliers = attachment->m_sizeMultipliers; sizeMultipliers.m_widthMultiplier = sizeMultiplier; sizeMultipliers.m_heightMultiplier = sizeMultiplier; @@ -105,6 +107,25 @@ namespace AZ downsamplePass->GetShaderResourceGroup()->SetConstant( outputImageScaleShaderInput, aznumeric_cast(1.0f / sizeMultiplier)); + // update the parent pass IrradianceImage size multiplier + RPI::ParentPass* parentPass = pass->GetParent(); + RPI::Ptr irradianceImageAttachment; + for (uint32_t attachmentIndex = 0; attachmentIndex < parentPass->GetInputOutputCount(); ++attachmentIndex) + { + RPI::Ptr attachment = parentPass->GetInputOutputBinding(attachmentIndex).m_attachment; + if (attachment->m_name == Name("IrradianceImage")) + { + irradianceImageAttachment = attachment; + break; + } + } + + AZ_Assert(irradianceImageAttachment != nullptr, "Unable to find IrradianceImage attachment"); + + RPI::PassAttachmentSizeMultipliers& sizeMultipliers = irradianceImageAttachment->m_sizeMultipliers; + sizeMultipliers.m_widthMultiplier = sizeMultiplier; + sizeMultipliers.m_heightMultiplier = sizeMultiplier; + // handle all downsample passes return RPI::PassFilterExecutionFlow::ContinueVisitingPasses; }); diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridDownsamplePass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridDownsamplePass.cpp new file mode 100644 index 0000000000..2a11218b47 --- /dev/null +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridDownsamplePass.cpp @@ -0,0 +1,36 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include "DiffuseProbeGridDownsamplePass.h" +#include +#include + +namespace AZ +{ + namespace Render + { + RPI::Ptr DiffuseProbeGridDownsamplePass::Create(const RPI::PassDescriptor& descriptor) + { + RPI::Ptr pass = aznew DiffuseProbeGridDownsamplePass(descriptor); + return AZStd::move(pass); + } + + DiffuseProbeGridDownsamplePass::DiffuseProbeGridDownsamplePass(const RPI::PassDescriptor& descriptor) + : RPI::FullscreenTrianglePass(descriptor) + { + } + + bool DiffuseProbeGridDownsamplePass::IsEnabled() const + { + // only enabled if there are DiffuseProbeGrids present in the scene + DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = m_pipeline->GetScene()->GetFeatureProcessor(); + return (diffuseProbeGridFeatureProcessor && !diffuseProbeGridFeatureProcessor->GetProbeGrids().empty()); + } + + } // namespace RPI +} // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridDownsamplePass.h b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridDownsamplePass.h new file mode 100644 index 0000000000..283c758c76 --- /dev/null +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridDownsamplePass.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ +#pragma once + +#include +#include + +namespace AZ +{ + namespace Render + { + //! This pass downsamples the scene for use by the DiffuseProbeGridRenderPass. + class DiffuseProbeGridDownsamplePass + : public RPI::FullscreenTrianglePass + { + AZ_RPI_PASS(DiffuseProbeGridDownsamplePass); + + public: + AZ_RTTI(Render::DiffuseProbeGridDownsamplePass, "{B3331B68-F974-44D6-806B-2CFFB4B6B563}", FullscreenTrianglePass); + AZ_CLASS_ALLOCATOR(Render::DiffuseProbeGridDownsamplePass, SystemAllocator, 0); + + //! Creates a new pass without a PassTemplate + static RPI::Ptr Create(const RPI::PassDescriptor& descriptor); + + private: + explicit DiffuseProbeGridDownsamplePass(const RPI::PassDescriptor& descriptor); + + // Pass behavior overrides... + bool IsEnabled() const override; + }; + } // namespace RPI +} // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake b/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake index 3ed2ec8755..900e71717c 100644 --- a/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake +++ b/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake @@ -133,6 +133,8 @@ set(FILES Source/DiffuseGlobalIllumination/DiffuseProbeGridRelocationPass.h Source/DiffuseGlobalIllumination/DiffuseProbeGridClassificationPass.cpp Source/DiffuseGlobalIllumination/DiffuseProbeGridClassificationPass.h + Source/DiffuseGlobalIllumination/DiffuseProbeGridDownsamplePass.cpp + Source/DiffuseGlobalIllumination/DiffuseProbeGridDownsamplePass.h Source/DiffuseGlobalIllumination/DiffuseProbeGridRenderPass.cpp Source/DiffuseGlobalIllumination/DiffuseProbeGridRenderPass.h Source/DiffuseGlobalIllumination/DiffuseProbeGrid.cpp From f71b134a84516c05973166276b78eeeb1d9300ff Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Mon, 13 Dec 2021 22:25:45 -0800 Subject: [PATCH 130/948] Ensure JsonSerializer::StoreTypeName stores the correct type for generic types Signed-off-by: Nicholas Van Sickle --- .../Serialization/Json/JsonSerializer.cpp | 10 +- .../Serialization/Json/JsonSerializer.h | 2 +- .../Serialization/Json/TestCases_TypeId.cpp | 94 +++++++++++++++++++ 3 files changed, 100 insertions(+), 6 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerializer.cpp b/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerializer.cpp index 8b6c1d154c..46cc0443da 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerializer.cpp +++ b/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerializer.cpp @@ -150,7 +150,7 @@ namespace AZ { // Not using InsertTypeId here to avoid needing to create the temporary value and swap it in that call. node.AddMember(rapidjson::StringRef(JsonSerialization::TypeIdFieldIdentifier), - StoreTypeName(classData, context), context.GetJsonAllocator()); + StoreTypeName(classData, classData.m_typeId, context), context.GetJsonAllocator()); result = ResultCode(Tasks::WriteValue, Outcomes::Success); } return result.Combine(StoreClass(node, object, defaultObject, classData, context)); @@ -531,7 +531,7 @@ namespace AZ return ResolvePointerResult::ContinueProcessing; } - rapidjson::Value JsonSerializer::StoreTypeName(const SerializeContext::ClassData& classData, JsonSerializerContext& context) + rapidjson::Value JsonSerializer::StoreTypeName(const SerializeContext::ClassData& classData, const Uuid& typeId, JsonSerializerContext& context) { rapidjson::Value result; AZStd::vector ids = context.GetSerializeContext()->FindClassId(Crc32(classData.m_name)); @@ -544,7 +544,7 @@ namespace AZ // Only write the Uuid for the class if there are multiple classes sharing the same name. // In this case it wouldn't be enough to determine which class needs to be used. The // class name is still added as a comment for be friendlier for users to read. - AZStd::string fullName = classData.m_typeId.ToString(); + AZStd::string fullName = typeId.ToString(); fullName += ' '; fullName += classData.m_name; result.SetString(fullName.c_str(), aznumeric_caster(fullName.size()), context.GetJsonAllocator()); @@ -560,7 +560,7 @@ namespace AZ const SerializeContext::ClassData* data = context.GetSerializeContext()->FindClassData(typeId); if (data) { - output = JsonSerializer::StoreTypeName(*data, context); + output = JsonSerializer::StoreTypeName(*data, typeId, context); return context.Report(Tasks::WriteValue, Outcomes::Success, "Type id successfully stored to json value."); } else @@ -580,7 +580,7 @@ namespace AZ { rapidjson::Value insertedObject(rapidjson::kObjectType); insertedObject.AddMember( - rapidjson::StringRef(JsonSerialization::TypeIdFieldIdentifier), StoreTypeName(classData, context), + rapidjson::StringRef(JsonSerialization::TypeIdFieldIdentifier), StoreTypeName(classData, classData.m_typeId, context), context.GetJsonAllocator()); for (auto& element : output.GetObject()) diff --git a/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerializer.h b/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerializer.h index 22dd768ec5..0b72fca529 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerializer.h +++ b/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerializer.h @@ -79,7 +79,7 @@ namespace AZ const void*& object, const void*& defaultObject, AZStd::any& defaultObjectStorage, const SerializeContext::ClassData*& elementClassData, const AZ::IRttiHelper& rtti, JsonSerializerContext& context); - static rapidjson::Value StoreTypeName(const SerializeContext::ClassData& classData, JsonSerializerContext& context); + static rapidjson::Value StoreTypeName(const SerializeContext::ClassData& classData, const Uuid& typeId, JsonSerializerContext& context); static JsonSerializationResult::ResultCode StoreTypeName(rapidjson::Value& output, const Uuid& typeId, JsonSerializerContext& context); diff --git a/Code/Framework/AzCore/Tests/Serialization/Json/TestCases_TypeId.cpp b/Code/Framework/AzCore/Tests/Serialization/Json/TestCases_TypeId.cpp index 60b8f55dce..c6c08ca9ae 100644 --- a/Code/Framework/AzCore/Tests/Serialization/Json/TestCases_TypeId.cpp +++ b/Code/Framework/AzCore/Tests/Serialization/Json/TestCases_TypeId.cpp @@ -10,6 +10,72 @@ #include #include #include +#include + +namespace AZ +{ + template + struct SerializeGenericTypeInfo> + { + using ThisType = JsonSerializationTests::TemplatedClass; + + class GenericTemplatedClassInfo : public GenericClassInfo + { + public: + GenericTemplatedClassInfo() + : m_classData{ SerializeContext::ClassData::Create( + "TemplatedClass", "{CA4ADF74-66E7-4D16-B4AC-F71278C60EC7}", nullptr, nullptr) } + { + } + + SerializeContext::ClassData* GetClassData() override + { + return &m_classData; + } + + size_t GetNumTemplatedArguments() override + { + return 1; + } + + const Uuid& GetSpecializedTypeId() const override + { + return m_classData.m_typeId; + } + + const Uuid& GetGenericTypeId() const override + { + return m_classData.m_typeId; + } + + const Uuid& GetTemplatedTypeId(size_t element) override + { + (void)element; + return SerializeGenericTypeInfo::GetClassTypeId(); + } + + void Reflect(SerializeContext* serializeContext) override + { + if (serializeContext) + { + serializeContext->RegisterGenericClassInfo( + GetSpecializedTypeId(), this, &AZ::AnyTypeInfoConcept>::CreateAny); + serializeContext->RegisterGenericClassInfo( + azrtti_typeid(), this, + &AZ::AnyTypeInfoConcept::CreateAny); + } + } + + SerializeContext::ClassData m_classData; + }; + + using ClassInfoType = GenericTemplatedClassInfo; + static ClassInfoType* GetGenericInfo() + { + return GetCurrentSerializeContextModule().CreateGenericClassInfo(); + } + }; +} // namespace AZ namespace JsonSerializationTests { @@ -286,4 +352,32 @@ namespace JsonSerializationTests EXPECT_EQ(Processing::Halted, result.GetProcessing()); EXPECT_EQ(Outcomes::Unknown, result.GetOutcome()); } + + TEST_F(JsonSerializationTests, StoreTypeId_TemplatedType_StoresUuidWithName) + { + using namespace AZ; + using namespace AZ::JsonSerializationResult; + + m_serializeContext->RegisterGenericType>(); + m_serializeContext->RegisterGenericType>(); + + Uuid input = azrtti_typeid>(); + ResultCode result = JsonSerialization::StoreTypeId( + *m_jsonDocument, m_jsonDocument->GetAllocator(), input, AZStd::string_view{}, *m_serializationSettings); + + EXPECT_EQ(Processing::Completed, result.GetProcessing()); + + AZStd::string expected = + AZStd::string::format(R"("%s TemplatedClass")", azrtti_typeid>().ToString().c_str()); + Expect_DocStrEq(expected.c_str(), false); + + input = azrtti_typeid>(); + result = JsonSerialization::StoreTypeId( + *m_jsonDocument, m_jsonDocument->GetAllocator(), input, AZStd::string_view{}, *m_serializationSettings); + + expected = + AZStd::string::format(R"("%s TemplatedClass")", azrtti_typeid>().ToString().c_str()); + EXPECT_EQ(Processing::Completed, result.GetProcessing()); + Expect_DocStrEq(expected.c_str(), false); + } } // namespace JsonSerializationTests From 197e7b95e1b217991c5599134b492dbecf9cedfc Mon Sep 17 00:00:00 2001 From: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> Date: Tue, 14 Dec 2021 09:24:10 +0000 Subject: [PATCH 131/948] Fix for change with axis gizmo labels not appearing (#6256) (#6387) Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> --- .../EditorTransformComponentSelection.cpp | 7 +++---- .../Code/Source/AtomDebugDisplayViewportInterface.cpp | 3 ++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorTransformComponentSelection.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorTransformComponentSelection.cpp index 9ac28cfd91..8c7e5aba98 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorTransformComponentSelection.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorTransformComponentSelection.cpp @@ -3534,10 +3534,9 @@ namespace AzToolsFramework debugDisplay.SetLineWidth(1.0f); const float labelOffset = ed_viewportGizmoAxisLabelOffset; - const float screenScale = GetScreenDisplayScaling(viewportId); - const auto labelXScreenPosition = (gizmoStart + (gizmoAxisX * labelOffset)) * editorCameraState.m_viewportSize * screenScale; - const auto labelYScreenPosition = (gizmoStart + (gizmoAxisY * labelOffset)) * editorCameraState.m_viewportSize * screenScale; - const auto labelZScreenPosition = (gizmoStart + (gizmoAxisZ * labelOffset)) * editorCameraState.m_viewportSize * screenScale; + const auto labelXScreenPosition = (gizmoStart + (gizmoAxisX * labelOffset)) * editorCameraState.m_viewportSize; + const auto labelYScreenPosition = (gizmoStart + (gizmoAxisY * labelOffset)) * editorCameraState.m_viewportSize; + const auto labelZScreenPosition = (gizmoStart + (gizmoAxisZ * labelOffset)) * editorCameraState.m_viewportSize; // draw the label of of each axis for the gizmo const float labelSize = ed_viewportGizmoAxisLabelSize; diff --git a/Gems/AtomLyIntegration/AtomBridge/Code/Source/AtomDebugDisplayViewportInterface.cpp b/Gems/AtomLyIntegration/AtomBridge/Code/Source/AtomDebugDisplayViewportInterface.cpp index 39cc2f63b2..af91615283 100644 --- a/Gems/AtomLyIntegration/AtomBridge/Code/Source/AtomDebugDisplayViewportInterface.cpp +++ b/Gems/AtomLyIntegration/AtomBridge/Code/Source/AtomDebugDisplayViewportInterface.cpp @@ -1362,8 +1362,9 @@ namespace AZ::AtomBridge // if 2d draw need to project pos to screen first AzFramework::TextDrawParameters params; AZ::RPI::ViewportContextPtr viewportContext = GetViewportContext(); + const auto dpiScaleFactor = viewportContext->GetDpiScalingFactor(); params.m_drawViewportId = viewportContext->GetId(); // get the viewport ID so default viewport works - params.m_position = AZ::Vector3(x, y, 1.0f); + params.m_position = AZ::Vector3(x * dpiScaleFactor, y * dpiScaleFactor, 1.0f); params.m_color = m_rendState.m_color; params.m_scale = AZ::Vector2(size); params.m_hAlign = center ? AzFramework::TextHorizontalAlignment::Center : AzFramework::TextHorizontalAlignment::Left; //! Horizontal text alignment From e078eac379a0a75012f55d69b57614e77664c503 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Tue, 14 Dec 2021 14:17:06 -0800 Subject: [PATCH 132/948] redcode the asset itself WIP Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../Code/Asset/EditorAssetSystemComponent.cpp | 7 +- .../Code/Asset/EditorAssetSystemComponent.h | 2 - .../Code/Builder/ScriptCanvasBuilder.cpp | 2 +- .../Builder/ScriptCanvasBuilderComponent.cpp | 2 +- .../Code/Editor/Assets/ScriptCanvasAsset.cpp | 126 ------------------ .../Assets/ScriptCanvasAssetHelpers.cpp | 2 +- .../EditorScriptCanvasComponent.cpp | 2 +- .../Framework/ScriptCanvasGraphUtilities.inl | 2 +- .../ScriptCanvas/Assets/ScriptCanvasAsset.h | 88 ------------ .../Assets/ScriptCanvasAssetBus.h | 31 ----- .../Assets/ScriptCanvasAssetTypes.h | 14 -- .../Assets/ScriptCanvasBaseAssetData.cpp | 10 -- .../Assets/ScriptCanvasBaseAssetData.h | 17 --- .../Assets/ScriptCanvasFileHandling.h | 2 +- .../Components/EditorDeprecationData.h | 43 ++++++ Gems/ScriptCanvas/Code/Editor/Settings.cpp | 2 +- .../GraphPivotTree/GraphPivotTree.cpp | 12 +- .../ScriptCanvasNodePaletteDockWidget.cpp | 57 ++++---- .../StatisticsDialog/NodeUsageTreeItem.cpp | 8 +- .../StatisticsDialog/NodeUsageTreeItem.h | 2 +- .../ScriptCanvasStatisticsDialog.cpp | 62 +++++---- .../UnitTestPanel/UnitTestDockWidget.cpp | 25 +--- .../UnitTestPanel/UnitTestTreeView.cpp | 2 +- .../VariablePanel/GraphVariablesTableView.cpp | 6 - .../VariablePanel/GraphVariablesTableView.h | 2 - .../Code/Editor/View/Windows/MainWindow.cpp | 7 +- .../Code/Editor/View/Windows/MainWindow.h | 1 - .../View/Windows/Tools/UpgradeTool/Model.cpp | 2 +- .../Windows/Tools/UpgradeTool/Modifier.cpp | 2 +- .../Windows/Tools/UpgradeTool/Scanner.cpp | 2 +- .../Code/Include/ScriptCanvas/Core/Core.h | 17 +++ .../Code/scriptcanvasgem_editor_files.cmake | 3 - .../Code/scriptcanvasgem_headers.cmake | 3 - 33 files changed, 152 insertions(+), 413 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAsset.cpp delete mode 100644 Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasAsset.h delete mode 100644 Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetBus.h delete mode 100644 Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetTypes.h delete mode 100644 Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.cpp delete mode 100644 Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.h diff --git a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp index 87a5dbf796..0a0ddbf8b8 100644 --- a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp @@ -22,7 +22,7 @@ // Undo this AZ_PUSH_DISABLE_WARNING(4251 4800 4244, "-Wunknown-warning-option") #include -#include + #include #include AZ_POP_DISABLE_WARNING @@ -84,10 +84,7 @@ namespace ScriptCanvasEditor static bool HandlesSource(const AzToolsFramework::AssetBrowser::SourceAssetBrowserEntry* entry) { AZStd::string_view targetExtension = entry->GetExtension(); - - ScriptCanvasAsset::Description description; - AZStd::string_view scriptCanvasFileFilter = description.GetFileFilterImpl(); - + AZStd::string_view scriptCanvasFileFilter = SourceDescription::GetFileFilter(); if (AZStd::wildcard_match(scriptCanvasFileFilter.data(), targetExtension.data())) { return true; diff --git a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.h b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.h index 7937950a05..ba4fdf56fc 100644 --- a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.h +++ b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.h @@ -17,8 +17,6 @@ namespace ScriptCanvasEditor { - class ScriptCanvasAsset; - class EditorAssetSystemComponent : public AZ::Component , public EditorAssetConversionBus::Handler diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp index 00df5ad07b..65bd8d141f 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp @@ -9,7 +9,7 @@ #include #include #include -#include + #include #include #include diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp index b7e4fb4a79..0705a19ba1 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp @@ -14,7 +14,7 @@ #include #include #include -#include + #include namespace ScriptCanvasBuilder diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAsset.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAsset.cpp deleted file mode 100644 index 18736db12c..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAsset.cpp +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include -#include - -#include - -#include -#include -#include -#include - -namespace ScriptCanvas -{ - ScriptCanvasData::ScriptCanvasData(ScriptCanvasData&& other) - : m_scriptCanvasEntity(AZStd::move(other.m_scriptCanvasEntity)) - { - } - - ScriptCanvasData& ScriptCanvasData::operator=(ScriptCanvasData&& other) - { - m_scriptCanvasEntity = AZStd::move(other.m_scriptCanvasEntity); - return *this; - } - - static bool ScriptCanvasDataVersionConverter(AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& rootDataElementNode) - { - if (rootDataElementNode.GetVersion() == 0) - { - int scriptCanvasEntityIndex = rootDataElementNode.FindElement(AZ_CRC("m_scriptCanvas", 0xfcd20d85)); - if (scriptCanvasEntityIndex == -1) - { - AZ_Error("Script Canvas", false, "Version Converter failed, The Script Canvas Entity is missing"); - return false; - } - - auto scComponentElements = AZ::Utils::FindDescendantElements(context, rootDataElementNode, AZStd::vector{AZ_CRC("m_scriptCanvas", 0xfcd20d85), - AZ_CRC("element", 0x41405e39), AZ_CRC("Components", 0xee48f5fd)}); - if (!scComponentElements.empty()) - { - scComponentElements.front()->AddElementWithData(context, "element", ScriptCanvasEditor::EditorGraphVariableManagerComponent()); - } - } - - if (rootDataElementNode.GetVersion() < 4) - { - auto scEntityElements = AZ::Utils::FindDescendantElements(context, rootDataElementNode, - AZStd::vector{AZ_CRC("m_scriptCanvas", 0xfcd20d85), AZ_CRC("element", 0x41405e39)}); - if (scEntityElements.empty()) - { - AZ_Error("Script Canvas", false, "Version Converter failed, The Script Canvas Entity is missing"); - return false; - } - auto& scEntityDataElement = *scEntityElements.front(); - - AZ::Entity scEntity; - if (!scEntityDataElement.GetData(scEntity)) - { - AZ_Error("Script Canvas", false, "Unable to retrieve entity data from the Data Element"); - return false; - } - - auto graph = AZ::EntityUtils::FindFirstDerivedComponent(&scEntity); - if (!graph) - { - AZ_Error("Script Canvas", false, "Script Canvas graph component could not be found on Script Canvas Entity for ScriptCanvasData version %u", rootDataElementNode.GetVersion()); - return false; - } - auto variableManager = AZ::EntityUtils::FindFirstDerivedComponent(&scEntity); - if (!variableManager) - { - AZ_Error("Script Canvas", false, "Script Canvas variable manager component could not be found on Script Canvas Entity for ScriptCanvasData version %u", rootDataElementNode.GetVersion()); - return false; - } - - variableManager->ConfigureScriptCanvasId(graph->GetScriptCanvasId()); - if (!scEntityDataElement.SetData(context, scEntity)) - { - AZ_Error("Script Canvas", false, "Failed to set converted Script Canvas Entity back on data element node when transitioning from version %u to version 4", rootDataElementNode.GetVersion()); - return false; - } - } - - return true; - } - - - void ScriptCanvasData::Reflect(AZ::ReflectContext* reflectContext) - { - if (auto serializeContext = azrtti_cast(reflectContext)) - { - serializeContext->Class() - ->Version(4, &ScriptCanvasDataVersionConverter) - ->Field("m_scriptCanvas", &ScriptCanvasData::m_scriptCanvasEntity) - ; - } - } - -} - -namespace ScriptCanvasEditor -{ - ScriptCanvas::Graph* ScriptCanvasAsset::GetScriptCanvasGraph() const - { - return AZ::EntityUtils::FindFirstDerivedComponent(m_data->m_scriptCanvasEntity.get()); - } - - ScriptCanvas::ScriptCanvasData& ScriptCanvasAsset::GetScriptCanvasData() - { - AZ_Assert(m_data != nullptr, "ScriptCanvasData not initialized, it must be created on construction"); - return *m_data; - } - - const ScriptCanvas::ScriptCanvasData& ScriptCanvasAsset::GetScriptCanvasData() const - { - AZ_Assert(m_data != nullptr, "ScriptCanvasData not initialized, it must be created on construction"); - return *m_data; - } -} diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHelpers.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHelpers.cpp index 884fa2d5c9..07f7ac1e2f 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHelpers.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHelpers.cpp @@ -8,7 +8,7 @@ #include -#include + #include namespace ScriptCanvasEditor diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index 6419525726..c96ba4b0b3 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -23,7 +23,7 @@ #include #include #include -#include + #include #include #include diff --git a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl index 83e4e2908c..8571c03638 100644 --- a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl +++ b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl @@ -16,7 +16,7 @@ #include #include #include -#include + #include #include #include diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasAsset.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasAsset.h deleted file mode 100644 index 0fb0f567e8..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasAsset.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#pragma once - -#include -#include -#include -#include - -#include - -namespace AZ -{ - class Entity; -} - -namespace ScriptCanvas -{ - class Graph; -} - -namespace ScriptCanvasEditor -{ - class Graph; - class ScriptCanvasAsset; - - class ScriptCanvasAssetDescription : public ScriptCanvas::AssetDescription - { - public: - - AZ_TYPE_INFO(ScriptCanvasAssetDescription, "{3678E33E-521B-4CAC-9DC1-42566AC71249}"); - - ScriptCanvasAssetDescription() - : ScriptCanvas::AssetDescription( - azrtti_typeid(), - "Script Canvas", - "Script Canvas Graph Asset", - "@projectroot@/scriptcanvas", - ".scriptcanvas", - "Script Canvas", - "Untitled-%i", - "Script Canvas Files (*.scriptcanvas)", - "Script Canvas", - "Script Canvas", - "Icons/ScriptCanvas/Viewport/ScriptCanvas.png", - AZ::Color(0.321f, 0.302f, 0.164f, 1.0f), - true - ) - {} - }; - - class ScriptCanvasAsset - : public ScriptCanvas::ScriptCanvasAssetBase - { - - public: - AZ_RTTI(ScriptCanvasAsset, "{FA10C3DA-0717-4B72-8944-CD67D13DFA2B}", ScriptCanvas::ScriptCanvasAssetBase); - AZ_CLASS_ALLOCATOR(ScriptCanvasAsset, AZ::SystemAllocator, 0); - - ScriptCanvasAsset(const AZ::Data::AssetId& assetId = AZ::Data::AssetId(AZ::Uuid::CreateRandom()), - AZ::Data::AssetData::AssetStatus status = AZ::Data::AssetData::AssetStatus::NotLoaded) - : ScriptCanvas::ScriptCanvasAssetBase(assetId, status) - { - m_data = aznew ScriptCanvas::ScriptCanvasData(); - } - ~ScriptCanvasAsset() override - { - } - - ScriptCanvas::AssetDescription GetAssetDescription() const override - { - return ScriptCanvasAssetDescription(); - } - - ScriptCanvas::Graph* GetScriptCanvasGraph() const; - using Description = ScriptCanvasAssetDescription; - - ScriptCanvas::ScriptCanvasData& GetScriptCanvasData() override; - const ScriptCanvas::ScriptCanvasData& GetScriptCanvasData() const override; - - }; -} diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetBus.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetBus.h deleted file mode 100644 index 4c9f714b61..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetBus.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#pragma once - -namespace ScriptCanvas -{ - - class ScriptCanvasAssetBusRequests : public AZ::EBusTraits - { - public: - - using BusIdType = AZ::Data::AssetId; - using MutexType = AZStd::recursive_mutex; - - static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single; - static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; - - virtual void SetAsNewAsset() = 0; - - }; - - using ScriptCanvasAssetBusRequestBus = AZ::EBus; - - -} diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetTypes.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetTypes.h deleted file mode 100644 index 75cf42a894..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetTypes.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#pragma once - -namespace ScriptCanvasEditor -{ - -} diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.cpp b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.cpp deleted file mode 100644 index efb20e3518..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.cpp +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#include - diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.h deleted file mode 100644 index 7597da9081..0000000000 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#pragma once - -#include -#include - -namespace ScriptCanvas -{ - -} diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h index bd3d2b9f0a..2260418fe8 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h @@ -11,7 +11,7 @@ #include #include #include -#include + namespace AZ { diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorDeprecationData.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorDeprecationData.h index a8e54f034e..96b922ddb3 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorDeprecationData.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorDeprecationData.h @@ -19,6 +19,39 @@ namespace ScriptCanvasEditor { namespace Deprecated { + /* source file description + ScriptCanvasAssetDescription() + : ScriptCanvas::AssetDescription( + "{FA10C3DA-0717-4B72-8944-CD67D13DFA2B}", // type + "Script Canvas", // name + "Script Canvas Graph Asset", // description + "@projectroot@/scriptcanvas", // suggested save path + ".scriptcanvas", // fileExtention + "Script Canvas", // group + "Untitled-%i", // asset name pattern + "Script Canvas Files (*.scriptcanvas)", // file filter + "Script Canvas", // asset type display name + "Script Canvas", // entity name + "Icons/ScriptCanvas/Viewport/ScriptCanvas.png", // icon path + AZ::Color(0.321f, 0.302f, 0.164f, 1.0f), // display color + true // is editable type + ) + {} + + AssetDescription( AZ::Data::AssetType assetType, + const char* name, + const char* description, + const char* suggestedSavePath, + const char* fileExtension, + const char* group, + const char* assetNamePattern, + const char* fileFilter, + const char* assetTypeDisplayName, + const char* entityName, + const char* iconPath, + AZ::Color displayColor, + bool isEditableType) + */ class ScriptCanvasAssetHolder { public: @@ -30,5 +63,15 @@ namespace ScriptCanvasEditor AZ::Data::Asset m_scriptCanvasAsset; }; + + class ScriptCanvasAsset + { + public: + AZ_TYPE_INFO(ScriptCanvasAsset, "{3E80CEE3-2932-4DC1-AADF-398FDDC6DEFE}"); + AZ_CLASS_ALLOCATOR(ScriptCanvasAsset, AZ::SystemAllocator, 0); + + ScriptCanvasAsset() = default; + static void Reflect(AZ::ReflectContext * context); + }; } } diff --git a/Gems/ScriptCanvas/Code/Editor/Settings.cpp b/Gems/ScriptCanvas/Code/Editor/Settings.cpp index 84744f77e3..ac40324dff 100644 --- a/Gems/ScriptCanvas/Code/Editor/Settings.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Settings.cpp @@ -13,7 +13,7 @@ #include "Settings.h" -#include + #include #include diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/PivotTree/GraphPivotTree/GraphPivotTree.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/PivotTree/GraphPivotTree/GraphPivotTree.cpp index a6f0a3743e..9b591466da 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/PivotTree/GraphPivotTree/GraphPivotTree.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/LoggingPanel/PivotTree/GraphPivotTree/GraphPivotTree.cpp @@ -9,11 +9,9 @@ #include #include #include - -#include - -#include #include +#include +#include namespace ScriptCanvasEditor { @@ -355,7 +353,7 @@ namespace ScriptCanvasEditor m_assetModel = new AzToolsFramework::AssetBrowser::AssetBrowserFilterModel(); AzToolsFramework::AssetBrowser::AssetGroupFilter* assetFilter = new AzToolsFramework::AssetBrowser::AssetGroupFilter(); - assetFilter->SetAssetGroup(ScriptCanvasEditor::ScriptCanvasAsset::Description::GetGroup(azrtti_typeid())); + assetFilter->SetAssetGroup(ScriptCanvasEditor::SourceDescription::GetGroup()); assetFilter->SetFilterPropagation(AzToolsFramework::AssetBrowser::AssetBrowserEntryFilter::PropagateDirection::Down); @@ -530,7 +528,7 @@ namespace ScriptCanvasEditor { const AzToolsFramework::AssetBrowser::ProductAssetBrowserEntry* productEntry = azrtti_cast(entry); - if (productEntry->GetAssetType() == azrtti_typeid()) + if (productEntry->GetAssetType() == azrtti_typeid()) { auto mapIter = m_graphTreeItemMapping.find(productEntry->GetAssetId()); @@ -556,7 +554,7 @@ namespace ScriptCanvasEditor { const AzToolsFramework::AssetBrowser::ProductAssetBrowserEntry* productEntry = static_cast(entry); - if (productEntry->GetAssetType() == azrtti_typeid()) + if (productEntry->GetAssetType() == azrtti_typeid()) { OnEntityGraphRegistered(AZ::NamedEntityId(), ScriptCanvas::GraphIdentifier(productEntry->GetAssetId(), k_dynamicallySpawnedControllerId)); } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.cpp index 1258842b75..25f38afbae 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.cpp @@ -38,6 +38,7 @@ #include +#include #include #include #include @@ -461,35 +462,33 @@ namespace ScriptCanvasEditor return; } - // #sc_editor_asset_redux THIS WHOLE THING NEEDS TO BE REDONE TO MAKE SURE THAT USER FUNCTIONS SHOW UP IN THE - // NODE PALETTE -// -// AZStd::string rootPath, absolutePath; -// AZ::Data::AssetInfo assetInfo = AssetHelpers::GetAssetInfo(assetId, rootPath); -// AzFramework::StringFunc::Path::Join(rootPath.c_str(), assetInfo.m_relativePath.c_str(), absolutePath); -// -// AZStd::string normPath = absolutePath; -// AzFramework::StringFunc::Path::Normalize(normPath); -// -// AZStd::string watchFolder; -// bool sourceInfoFound{}; -// AzToolsFramework::AssetSystemRequestBus::BroadcastResult(sourceInfoFound, &AzToolsFramework::AssetSystemRequestBus::Events::GetSourceInfoBySourcePath, normPath.c_str(), assetInfo, watchFolder); -// -// if (!sourceInfoFound) -// { -// return; -// } -// -// CreateFunctionPaletteItem(asset, assetInfo); -// -// treePaletteIter = m_globalFunctionTreeItems.find(asset->GetId()); -// -// if (treePaletteIter != m_globalFunctionTreeItems.end()) -// { -// treePaletteIter->second->ClearError(); -// } -// -// m_monitoredAssets.emplace(asset->GetId(), asset); + + AZStd::string rootPath, absolutePath; + AZ::Data::AssetInfo assetInfo = AssetHelpers::GetAssetInfo(assetId, rootPath); + AzFramework::StringFunc::Path::Join(rootPath.c_str(), assetInfo.m_relativePath.c_str(), absolutePath); + + AZStd::string normPath = absolutePath; + AzFramework::StringFunc::Path::Normalize(normPath); + + AZStd::string watchFolder; + bool sourceInfoFound{}; + AzToolsFramework::AssetSystemRequestBus::BroadcastResult(sourceInfoFound, &AzToolsFramework::AssetSystemRequestBus::Events::GetSourceInfoBySourcePath, normPath.c_str(), assetInfo, watchFolder); + + if (!sourceInfoFound) + { + return; + } + + CreateFunctionPaletteItem(asset, assetInfo); + + treePaletteIter = m_globalFunctionTreeItems.find(asset->GetId()); + + if (treePaletteIter != m_globalFunctionTreeItems.end()) + { + treePaletteIter->second->ClearError(); + } + + m_monitoredAssets.emplace(asset->GetId(), asset); } else { diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/NodeUsageTreeItem.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/NodeUsageTreeItem.cpp index b10a7fc314..2770202233 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/NodeUsageTreeItem.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/NodeUsageTreeItem.cpp @@ -13,7 +13,7 @@ #include #include -#include + #include namespace ScriptCanvasEditor @@ -135,8 +135,6 @@ namespace ScriptCanvasEditor void ScriptCanvasAssetNodeUsageTreeItem::SetAssetId(const AZ::Data::AssetId& assetId, AZ::Data::AssetType assetType) { - // If we are setting up a new assetId, we wantt o register for the bus. - // Otherwise we just want to reload the asset to scrape some data from it. if (m_assetId != assetId) { if (AZ::Data::AssetBus::Handler::BusIsConnected()) @@ -150,10 +148,6 @@ namespace ScriptCanvasEditor } m_assetType = assetType; - - // #sc-editor-asset-redux fix up - // auto onAssetReady = [](ScriptCanvasMemoryAsset&) {}; - // AssetTrackerRequestBus::Broadcast(&AssetTrackerRequests::Load, m_assetId, m_assetType, onAssetReady); } const AZ::Data::AssetId& ScriptCanvasAssetNodeUsageTreeItem::GetAssetId() const diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/NodeUsageTreeItem.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/NodeUsageTreeItem.h index 69eb46d423..3e2c0b637b 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/NodeUsageTreeItem.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/NodeUsageTreeItem.h @@ -15,7 +15,7 @@ #include #include -#include + #include namespace ScriptCanvasEditor diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/ScriptCanvasStatisticsDialog.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/ScriptCanvasStatisticsDialog.cpp index 4a0905c17c..62f0d7ddc7 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/ScriptCanvasStatisticsDialog.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/ScriptCanvasStatisticsDialog.cpp @@ -15,7 +15,7 @@ #include -#include + #include namespace @@ -176,14 +176,15 @@ namespace ScriptCanvasEditor { } - void StatisticsDialog::OnCatalogAssetChanged(const AZ::Data::AssetId& assetId) + void StatisticsDialog::OnCatalogAssetChanged(const AZ::Data::AssetId& /*assetId*/) { - AZ::Data::AssetInfo assetInfo; - AZ::Data::AssetCatalogRequestBus::BroadcastResult(assetInfo, &AZ::Data::AssetCatalogRequestBus::Events::GetAssetInfoById, assetId); - if (assetInfo.m_assetType == azrtti_typeid()) - { - m_scriptCanvasAssetTreeRoot->RegisterAsset(assetId, assetInfo.m_assetType); - } + // #sc_editor_asset_redux cut or update +// AZ::Data::AssetInfo assetInfo; +// AZ::Data::AssetCatalogRequestBus::BroadcastResult(assetInfo, &AZ::Data::AssetCatalogRequestBus::Events::GetAssetInfoById, assetId); +// if (assetInfo.m_assetType == azrtti_typeidRegisterAsset(assetId, assetInfo.m_assetType); +// } } void StatisticsDialog::OnCatalogAssetAdded(const AZ::Data::AssetId& assetId) @@ -191,14 +192,16 @@ namespace ScriptCanvasEditor OnCatalogAssetChanged(assetId); } - void StatisticsDialog::OnCatalogAssetRemoved(const AZ::Data::AssetId& assetId, const AZ::Data::AssetInfo& /*assetInfo*/) + void StatisticsDialog::OnCatalogAssetRemoved(const AZ::Data::AssetId& /*assetId*/, const AZ::Data::AssetInfo& /*assetInfo*/) { - AZ::Data::AssetInfo assetInfo; - AZ::Data::AssetCatalogRequestBus::BroadcastResult(assetInfo, &AZ::Data::AssetCatalogRequestBus::Events::GetAssetInfoById, assetId); - if (assetInfo.m_assetType == azrtti_typeid()) - { - m_scriptCanvasAssetTreeRoot->RemoveAsset(assetId); - } + // #sc_editor_asset_redux cut or update + +// AZ::Data::AssetInfo assetInfo; +// AZ::Data::AssetCatalogRequestBus::BroadcastResult(assetInfo, &AZ::Data::AssetCatalogRequestBus::Events::GetAssetInfoById, assetId); +// if (assetInfo.m_assetType == azrtti_typeid()) +// { +// m_scriptCanvasAssetTreeRoot->RemoveAsset(assetId); +// } } void StatisticsDialog::OnAssetModelRepopulated() @@ -434,20 +437,21 @@ namespace ScriptCanvasEditor void StatisticsDialog::ProcessAsset(const AzToolsFramework::AssetBrowser::AssetBrowserEntry* entry) { - if (entry) - { - if (entry->GetEntryType() == AzToolsFramework::AssetBrowser::AssetBrowserEntry::AssetEntryType::Product) - { - const AzToolsFramework::AssetBrowser::ProductAssetBrowserEntry* productEntry = static_cast(entry); - - if (productEntry->GetAssetType() == azrtti_typeid()) - { - const AZ::Data::AssetId& assetId = productEntry->GetAssetId(); - - m_scriptCanvasAssetTreeRoot->RegisterAsset(assetId, productEntry->GetAssetType()); - } - } - } + // #sc_editor_asset_redux cut or update +// if (entry) +// { +// if (entry->GetEntryType() == AzToolsFramework::AssetBrowser::AssetBrowserEntry::AssetEntryType::Product) +// { +// const AzToolsFramework::AssetBrowser::ProductAssetBrowserEntry* productEntry = static_cast(entry); +// +// if (productEntry->GetAssetType() == azrtti_typeid()) +// { +// const AZ::Data::AssetId& assetId = productEntry->GetAssetId(); +// +// m_scriptCanvasAssetTreeRoot->RegisterAsset(assetId, productEntry->GetAssetType()); +// } +// } +// } } #include diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/UnitTestPanel/UnitTestDockWidget.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/UnitTestPanel/UnitTestDockWidget.cpp index d3661a4ef3..63e41896fc 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/UnitTestPanel/UnitTestDockWidget.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/UnitTestPanel/UnitTestDockWidget.cpp @@ -26,7 +26,7 @@ #include #include #include - +#include #include #include @@ -46,7 +46,7 @@ #include -#include + #include #include #include @@ -522,18 +522,7 @@ namespace ScriptCanvasEditor ScriptCanvasEditor::SourceHandle source(nullptr, scriptUuid, ""); ScriptCanvasEditor::CompleteDescriptionInPlace(source); - - // #sc_editor_asset_redux -// AZ::Data::AssetInfo assetInfo; -// if (AssetHelpers::GetAssetInfo(sourceBrowserEntry->GetFullPath(), assetInfo)) -// { -// auto asset = AZ::Data::AssetManager::Instance().GetAsset(assetInfo.m_assetId, azrtti_typeid(), AZ::Data::AssetLoadBehavior::PreLoad); -// asset.BlockUntilLoadComplete(); -// if (asset.IsReady()) -// { -// RunTestGraph(asset, mode); -// } -// } + RunTestGraph(source, mode); } } } @@ -582,19 +571,19 @@ namespace ScriptCanvasEditor m_testMetrics[interpretedMode].Clear(); } - void UnitTestDockWidget::RunTestGraph(AZ::Data::Asset asset, ScriptCanvas::ExecutionMode mode) + void UnitTestDockWidget::RunTestGraph(SourceHandle asset, ScriptCanvas::ExecutionMode mode) { Reporter reporter; - UnitTestWidgetNotificationBus::Broadcast(&UnitTestWidgetNotifications::OnTestStart, asset.GetId().m_guid); + UnitTestWidgetNotificationBus::Broadcast(&UnitTestWidgetNotifications::OnTestStart, asset); ScriptCanvasExecutionBus::BroadcastResult(reporter, &ScriptCanvasExecutionRequests::RunAssetGraph, asset, mode); UnitTestResult testResult; UnitTestVerificationBus::BroadcastResult(testResult, &UnitTestVerificationRequests::Verify, reporter); - UnitTestWidgetNotificationBus::Broadcast(&UnitTestWidgetNotifications::OnTestResult, asset.GetId().m_guid, testResult); + UnitTestWidgetNotificationBus::Broadcast(&UnitTestWidgetNotifications::OnTestResult, asset, testResult); - m_pendingTests.Add(asset.GetId(), mode); + m_pendingTests.Add(asset, mode); ++m_testMetrics[static_cast(mode)].m_graphsTested; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/UnitTestPanel/UnitTestTreeView.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/UnitTestPanel/UnitTestTreeView.cpp index 2e9c5d1852..9dbab22bb3 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/UnitTestPanel/UnitTestTreeView.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/UnitTestPanel/UnitTestTreeView.cpp @@ -33,7 +33,7 @@ #include #include -#include + #include #include diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/GraphVariablesTableView.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/GraphVariablesTableView.cpp index 1af554dd32..806f43aba1 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/GraphVariablesTableView.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/GraphVariablesTableView.cpp @@ -716,7 +716,6 @@ namespace ScriptCanvasEditor void GraphVariablesModel::SetActiveScene(const ScriptCanvas::ScriptCanvasId& scriptCanvasId) { ScriptCanvas::GraphVariableManagerNotificationBus::Handler::BusDisconnect(); - m_assetType = azrtti_typeid(); m_scriptCanvasId = scriptCanvasId; if (m_scriptCanvasId.IsValid()) @@ -919,11 +918,6 @@ namespace ScriptCanvasEditor return -1; } - bool GraphVariablesModel::IsFunction()const - { - return m_assetType == azrtti_typeid(); - } - //////////////////////////////////////////// // GraphVariablesModelSortFilterProxyModel //////////////////////////////////////////// diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/GraphVariablesTableView.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/GraphVariablesTableView.h index 962aadb8c8..f0e45978a0 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/GraphVariablesTableView.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/GraphVariablesTableView.h @@ -106,8 +106,6 @@ namespace ScriptCanvasEditor void PopulateSceneVariables(); - AZ::Data::AssetType m_assetType; - AZStd::vector m_variableIds; ScriptCanvas::ScriptCanvasId m_scriptCanvasId; }; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index c40c126dd1..c0ab11b2fb 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -96,7 +96,7 @@ #include #include -#include + #include #include @@ -146,7 +146,7 @@ #include #include #include -#include + #include #include @@ -434,7 +434,8 @@ namespace ScriptCanvasEditor m_scriptCanvasAssetModel = new ScriptCanvasAssetBrowserModel(this); AzToolsFramework::AssetBrowser::AssetGroupFilter* scriptCanvasAssetFilter = new AzToolsFramework::AssetBrowser::AssetGroupFilter(); - scriptCanvasAssetFilter->SetAssetGroup(ScriptCanvasAsset::Description::GetGroup(azrtti_typeid())); + // #sc_editor_asset_redux this may not be needed, may not be doing the right thing at all... + scriptCanvasAssetFilter->SetAssetGroup(ScriptCanvasAsset::Description::GetGroup(azrtti_typeid())); scriptCanvasAssetFilter->SetFilterPropagation(AzToolsFramework::AssetBrowser::AssetBrowserEntryFilter::PropagateDirection::Down); m_scriptCanvasAssetModel->setSourceModel(assetBrowserModel); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h index 4ff5cf094b..fbc363e444 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h @@ -432,7 +432,6 @@ namespace ScriptCanvasEditor AZ::Outcome CreateScriptCanvasAsset(AZStd::string_view assetPath, int tabIndex = -1); - //! Removes the assetId -> ScriptCanvasAsset mapping and disconnects from the asset tracker void RemoveScriptCanvasAsset(const ScriptCanvasEditor::SourceHandle& assetId); void OnChangeActiveGraphTab(ScriptCanvasEditor::SourceHandle) override; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Model.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Model.cpp index 70ff7a92ca..9714390022 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Model.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Model.cpp @@ -11,7 +11,7 @@ #include #include #include -#include + namespace ModifierCpp { diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp index 14b292e489..37439c5703 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Modifier.cpp @@ -10,7 +10,7 @@ #include #include #include -#include + #include #include diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp index 816ded8a7b..9e6340ee31 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp @@ -12,7 +12,7 @@ #include #include #include -#include + #include namespace ScannerCpp diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h index 215041e1fd..01280a4ee5 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h @@ -317,6 +317,23 @@ namespace ScriptCanvasEditor using GraphPtr = Graph*; using GraphPtrConst = const Graph*; + class SourceDescription + { + public: + static inline constexpr const char* GetAssetGroup() { return "ScriptCanvas"; } + inline static constexpr const char* GetType() { return "{FA10C3DA-0717-4B72-8944-CD67D13DFA2B}"; } // type + inline static constexpr const char* GetName() { return "Script Canvas"; } // name + inline static constexpr const char* GetDescription() { return "Script Canvas Graph Asset"; } // description + inline static constexpr const char* GetSuggestedSavePath() { return "@projectroot@/scriptcanvas"; } // suggested save path + inline static constexpr const char* GetFileExtension() { return ".scriptcanvas"; } // fileExtention + inline static constexpr const char* GetGroup() { return "Script Canvas"; } // group + inline static constexpr const char* GetAssetNamePattern() { return "Untitled-%i"; } // asset name pattern + inline static constexpr const char* GetFileFilter() { return "Script Canvas Files (*.scriptcanvas)"; } // file filter + inline static constexpr const char* GetAssetTypeDisplayName() { return "Script Canvas"; } // asset type display name + inline static constexpr const char* GetEntityName() { return "Script Canvas"; } // entity name + inline static constexpr const char* GetIconPath() { return "Icons/ScriptCanvas/Viewport/ScriptCanvas.png"; } // icon pa + }; + class SourceHandle { public: diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake index 897539db7b..30bedd634b 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake @@ -19,10 +19,7 @@ set(FILES Editor/Assets/ScriptCanvasAssetHelpers.cpp Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.h Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.cpp - Editor/Include/ScriptCanvas/Assets/ScriptCanvasAsset.h - Editor/Assets/ScriptCanvasAsset.cpp Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetBus.h - Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetTypes.h Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h Editor/Assets/ScriptCanvasFileHandling.cpp Editor/Assets/ScriptCanvasUndoHelper.h diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake index 7f39c2f3d0..ecbcdc6ed6 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake @@ -9,15 +9,12 @@ set(FILES Include/ScriptCanvas/SystemComponent.h Include/ScriptCanvas/ScriptCanvasGem.h - Include/ScriptCanvas/Asset/AssetDescription.h Include/ScriptCanvas/Asset/AssetRegistry.h Include/ScriptCanvas/Asset/AssetRegistryBus.h Include/ScriptCanvas/Asset/ExecutionLogAsset.h Include/ScriptCanvas/Asset/ExecutionLogAssetBus.h Include/ScriptCanvas/Asset/RuntimeAsset.h Include/ScriptCanvas/Asset/RuntimeAssetHandler.h - Include/ScriptCanvas/Asset/ScriptCanvasAssetBase.h - Include/ScriptCanvas/Asset/ScriptCanvasAssetData.h Include/ScriptCanvas/Asset/SubgraphInterfaceAssetHandler.h Include/ScriptCanvas/Core/ScriptCanvasBus.h Include/ScriptCanvas/Core/ExecutionNotificationsBus.h From 2271fa3dc693efa4ce5ef6fd5bda7e6e6771f9ab Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Tue, 14 Dec 2021 15:09:46 -0800 Subject: [PATCH 133/948] redcode sc asset files bloodbath Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../Code/Builder/ScriptCanvasBuilder.cpp | 10 +-- .../Code/Builder/ScriptCanvasBuilder.h | 1 - .../Builder/ScriptCanvasBuilderComponent.cpp | 3 - .../Builder/ScriptCanvasBuilderWorker.cpp | 11 ++- .../Code/Builder/ScriptCanvasBuilderWorker.h | 3 - .../EditorScriptCanvasComponent.cpp | 2 +- .../Framework/ScriptCanvasTraceUtilities.h | 2 - .../ScriptCanvas/Bus/EditorScriptCanvasBus.h | 1 - .../Components/EditorDeprecationData.h | 45 ++-------- .../Components/EditorScriptCanvasComponent.h | 17 +--- .../Code/Editor/View/Windows/MainWindow.cpp | 28 +++--- .../Asset/ScriptCanvasAssetBase.h | 89 ------------------- .../Code/scriptcanvasgem_editor_files.cmake | 3 - 13 files changed, 36 insertions(+), 179 deletions(-) delete mode 100644 Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/ScriptCanvasAssetBase.h diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp index 65bd8d141f..d62ebb9c3a 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp @@ -6,15 +6,15 @@ * */ +#include #include #include #include - -#include -#include -#include #include +#include #include +#include +#include namespace BuildVariableOverridesCpp { @@ -41,7 +41,7 @@ namespace BuildVariableOverridesCpp } auto& sourceElement = rootElement.GetSubElement(sourceIndex); - AZ::Data::Asset asset; + AZ::Data::Asset asset; if (!sourceElement.GetData(asset)) { AZ_Error("ScriptCanvas", false, "BuildVariableOverrides coversion failed: could not retrieve 'source' data"); diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.h b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.h index 5cffa823dc..6e8e176145 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.h +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.h @@ -15,7 +15,6 @@ namespace ScriptCanvasEditor { - class ScriptCanvasAsset; class EditorAssetTree; } diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp index 0705a19ba1..4c80b7ed83 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderComponent.cpp @@ -96,8 +96,6 @@ namespace ScriptCanvasBuilder builderDescriptor.m_productsToKeepOnFailure[s_scriptCanvasProcessJobKey] = { AZ_CRC("SubgraphInterface", 0xdfe6dc72) }; m_scriptCanvasBuilder.BusConnect(builderDescriptor.m_busId); AssetBuilderSDK::AssetBuilderBus::Broadcast(&AssetBuilderSDK::AssetBuilderBus::Handler::RegisterBuilderInformation, builderDescriptor); - - AzToolsFramework::ToolsAssetSystemBus::Broadcast(&AzToolsFramework::ToolsAssetSystemRequests::RegisterSourceAssetType, azrtti_typeid(), ScriptCanvasEditor::ScriptCanvasAsset::Description::GetFileFilter()); } m_sharedHandlers = HandleAssetTypes(); @@ -109,7 +107,6 @@ namespace ScriptCanvasBuilder { // Finish all queued work AZ::Data::AssetBus::ExecuteQueuedEvents(); - AzToolsFramework::ToolsAssetSystemBus::Broadcast(&AzToolsFramework::ToolsAssetSystemRequests::UnregisterSourceAssetType, azrtti_typeid()); m_scriptCanvasBuilder.BusDisconnect(); m_sharedHandlers.DeleteOwnedHandlers(); } diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp index 24f9836236..62d5febe91 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp @@ -44,10 +44,8 @@ namespace ScriptCanvasBuilder AzFramework::StringFunc::Path::ConstructFull(request.m_watchFolder.data(), request.m_sourceFile.data(), fullPath, false); AzFramework::StringFunc::Path::Normalize(fullPath); - AZ::Data::Asset asset; const ScriptCanvasEditor::Graph* sourceGraph = nullptr; const ScriptCanvas::GraphData* graphData = nullptr; - ScriptCanvasEditor::SourceHandle sourceHandle; auto sourceOutcome = ScriptCanvasEditor::LoadFromFile(fullPath); @@ -57,7 +55,14 @@ namespace ScriptCanvasBuilder sourceGraph = sourceHandle.Get(); graphData = sourceGraph->GetGraphDataConst(); } - + else + { + AZ_TracePrintf(s_scriptCanvasBuilder, "Failed to load the file: %s", fullPath.c_str()); + response.m_result = AssetBuilderSDK::CreateJobsResultCode::Failed; + } + + // in terms of job creation, assert on anything but smooth sailing from this point + AZ_Assert(sourceGraph, "Graph component is missing from entity."); AZ_Assert(graphData, "GraphData is missing from entity"); diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h index 817fe5d294..d0196d5f5c 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h @@ -36,7 +36,6 @@ namespace ScriptCanvas namespace ScriptCanvasEditor { class Graph; - class ScriptCanvasAsset; class SourceHandle; } @@ -132,8 +131,6 @@ namespace ScriptCanvasBuilder int GetBuilderVersion(); - AZ::Outcome, AZStd::string> LoadEditorAsset(AZStd::string_view graphPath, AZ::Data::AssetId assetId, AZ::Data::AssetFilterCB assetFilterCB = {}); - AZ::Outcome ParseGraph(AZ::Entity& buildEntity, AZStd::string_view graphPath); AZ::Outcome ProcessTranslationJob(ProcessTranslationJobInput& input); diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index c96ba4b0b3..be5d467f44 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -59,7 +59,7 @@ namespace ScriptCanvasEditor } auto assetElement = rootElement.GetSubElement(assetElementIndex); - AZ::Data::Asset scriptCanvasAsset; + AZ::Data::Asset scriptCanvasAsset; if (!assetElement.GetData(scriptCanvasAsset)) { AZ_Error("Script Canvas", false, "Unable to find Script Canvas Asset on a Version %u Editor ScriptCanvas Component", rootElement.GetVersion()); diff --git a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h index 458852132d..4b10c71ba3 100644 --- a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h +++ b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasTraceUtilities.h @@ -42,8 +42,6 @@ namespace ScriptCanvas namespace ScriptCanvasEditor { - class ScriptCanvasAsset; - struct LoadTestGraphResult { AZStd::unique_ptr m_entity; diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/EditorScriptCanvasBus.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/EditorScriptCanvasBus.h index b1fd291a1b..7f2d3ac162 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/EditorScriptCanvasBus.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/EditorScriptCanvasBus.h @@ -20,7 +20,6 @@ #include #include -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorDeprecationData.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorDeprecationData.h index 96b922ddb3..0b55e1cf23 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorDeprecationData.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorDeprecationData.h @@ -11,67 +11,34 @@ #include #include #include - -class ScriptCanvasAsset; - +#include namespace ScriptCanvasEditor { namespace Deprecated { - /* source file description - ScriptCanvasAssetDescription() - : ScriptCanvas::AssetDescription( - "{FA10C3DA-0717-4B72-8944-CD67D13DFA2B}", // type - "Script Canvas", // name - "Script Canvas Graph Asset", // description - "@projectroot@/scriptcanvas", // suggested save path - ".scriptcanvas", // fileExtention - "Script Canvas", // group - "Untitled-%i", // asset name pattern - "Script Canvas Files (*.scriptcanvas)", // file filter - "Script Canvas", // asset type display name - "Script Canvas", // entity name - "Icons/ScriptCanvas/Viewport/ScriptCanvas.png", // icon path - AZ::Color(0.321f, 0.302f, 0.164f, 1.0f), // display color - true // is editable type - ) - {} - - AssetDescription( AZ::Data::AssetType assetType, - const char* name, - const char* description, - const char* suggestedSavePath, - const char* fileExtension, - const char* group, - const char* assetNamePattern, - const char* fileFilter, - const char* assetTypeDisplayName, - const char* entityName, - const char* iconPath, - AZ::Color displayColor, - bool isEditableType) - */ class ScriptCanvasAssetHolder { public: AZ_TYPE_INFO(ScriptCanvasAssetHolder, "{3E80CEE3-2932-4DC1-AADF-398FDDC6DEFE}"); AZ_CLASS_ALLOCATOR(ScriptCanvasAssetHolder, AZ::SystemAllocator, 0); - ScriptCanvasAssetHolder() = default; static void Reflect(AZ::ReflectContext* context); AZ::Data::Asset m_scriptCanvasAsset; + + ScriptCanvasAssetHolder() = default; }; + // only is used as a pass-through to loading a guid / hint during versioning class ScriptCanvasAsset + : public AZ::Data::AssetData { public: - AZ_TYPE_INFO(ScriptCanvasAsset, "{3E80CEE3-2932-4DC1-AADF-398FDDC6DEFE}"); + AZ_TYPE_INFO(ScriptCanvasAsset, "{FA10C3DA-0717-4B72-8944-CD67D13DFA2B}"); AZ_CLASS_ALLOCATOR(ScriptCanvasAsset, AZ::SystemAllocator, 0); ScriptCanvasAsset() = default; - static void Reflect(AZ::ReflectContext * context); }; } } diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h index da1b0a22a6..ca381445ea 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h @@ -21,14 +21,8 @@ namespace ScriptCanvasEditor { /*! EditorScriptCanvasComponent - The user facing Editor Component for interfacing with ScriptCanvas - It connects to the AssetCatalogEventBus in order to remove the ScriptCanvasAssetHolder asset reference - when the asset is removed from the file system. The reason the ScriptCanvasAssetHolder holder does not - remove the asset reference itself is because the ScriptCanvasEditor MainWindow has a ScriptCanvasAssetHolder - 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 + The user facing Editor Component for interfacing with ScriptCanvas. + Per graph instance variables values are stored here and injected into the runtime ScriptCanvas component in BuildGameEntity. */ class EditorScriptCanvasComponent : public AzToolsFramework::Components::EditorComponentBase @@ -88,13 +82,6 @@ namespace ScriptCanvasEditor AZ::Data::AssetId GetAssetId() const override; //===================================================================== - - - - //===================================================================== - // EditorEntityContextNotificationBus - - protected: enum class SourceChangeDescription : AZ::u8 { diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index c0ab11b2fb..3b110aba7b 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -434,8 +434,9 @@ namespace ScriptCanvasEditor m_scriptCanvasAssetModel = new ScriptCanvasAssetBrowserModel(this); AzToolsFramework::AssetBrowser::AssetGroupFilter* scriptCanvasAssetFilter = new AzToolsFramework::AssetBrowser::AssetGroupFilter(); - // #sc_editor_asset_redux this may not be needed, may not be doing the right thing at all... - scriptCanvasAssetFilter->SetAssetGroup(ScriptCanvasAsset::Description::GetGroup(azrtti_typeid())); + // #sc_editor_asset_redux this may not be needed, may not be doing the right thing at all, verify that searching through + // the subgraph interface assets is the correct thing to do + scriptCanvasAssetFilter->SetAssetGroup(ScriptCanvas::SubgraphInterfaceAssetDescription().GetGroupImpl()); scriptCanvasAssetFilter->SetFilterPropagation(AzToolsFramework::AssetBrowser::AssetBrowserEntryFilter::PropagateDirection::Down); m_scriptCanvasAssetModel->setSourceModel(assetBrowserModel); @@ -1483,17 +1484,17 @@ namespace ScriptCanvasEditor for (;;) { - ScriptCanvasAssetDescription description; - AZStd::string newAssetName = AZStd::string::format(description.GetAssetNamePatternImpl(), ++scriptCanvasEditorDefaultNewNameCount); + AZStd::string newAssetName = AZStd::string::format(SourceDescription::GetAssetNamePattern() + , ++scriptCanvasEditorDefaultNewNameCount); AZStd::array assetRootArray; - if (!AZ::IO::FileIOBase::GetInstance()->ResolvePath(description.GetSuggestedSavePathImpl() + if (!AZ::IO::FileIOBase::GetInstance()->ResolvePath(SourceDescription::GetSuggestedSavePath() , assetRootArray.data(), assetRootArray.size())) { AZ_ErrorOnce("Script Canvas", false, "Unable to resolve @projectroot@ path"); } - AzFramework::StringFunc::Path::Join(assetRootArray.data(), (newAssetName + description.GetExtensionImpl()).data(), assetPath); + AzFramework::StringFunc::Path::Join(assetRootArray.data(), (newAssetName + SourceDescription::GetFileExtension()).data(), assetPath); AZ::Data::AssetInfo assetInfo; if (!AssetHelpers::GetAssetInfo(assetPath, assetInfo)) @@ -1621,7 +1622,6 @@ namespace ScriptCanvasEditor } PrepareAssetForSave(inMemoryAssetId); - ScriptCanvasAssetDescription assetDescription; AZStd::string suggestedFilename; AZStd::string suggestedFileFilter; @@ -1630,16 +1630,16 @@ namespace ScriptCanvasEditor if (save == Save::InPlace) { isValidFileName = true; - suggestedFileFilter = ScriptCanvasAssetDescription().GetExtensionImpl(); + suggestedFileFilter = SourceDescription::GetFileExtension(); suggestedFilename = inMemoryAssetId.Path().c_str(); } else { - suggestedFileFilter = ScriptCanvasAssetDescription().GetExtensionImpl(); + suggestedFileFilter = SourceDescription::GetFileExtension(); if (inMemoryAssetId.Path().empty()) { - suggestedFilename = ScriptCanvasAssetDescription().GetSuggestedSavePathImpl(); + suggestedFilename = SourceDescription::GetSuggestedSavePath(); } else { @@ -1661,9 +1661,9 @@ namespace ScriptCanvasEditor { AZStd::string filePath = selectedFile.toUtf8().data(); - if (!AZ::StringFunc::EndsWith(filePath, assetDescription.GetExtensionImpl(), false)) + if (!AZ::StringFunc::EndsWith(filePath, SourceDescription::GetFileExtension(), false)) { - filePath += assetDescription.GetExtensionImpl(); + filePath += SourceDescription::GetFileExtension(); } AZStd::string fileName; @@ -1695,9 +1695,9 @@ namespace ScriptCanvasEditor AZStd::string internalStringFile = selectedFile.toUtf8().data(); - if (!AZ::StringFunc::EndsWith(internalStringFile, assetDescription.GetExtensionImpl(), false)) + if (!AZ::StringFunc::EndsWith(internalStringFile, SourceDescription::GetFileExtension(), false)) { - internalStringFile += assetDescription.GetExtensionImpl(); + internalStringFile += SourceDescription::GetFileExtension(); } if (!AssetHelpers::IsValidSourceFile(internalStringFile, GetActiveScriptCanvasId())) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/ScriptCanvasAssetBase.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/ScriptCanvasAssetBase.h deleted file mode 100644 index 1dc0b38e01..0000000000 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/ScriptCanvasAssetBase.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#pragma once - -#include -#include -#include -#include -#include - -namespace ScriptCanvas -{ - class ScriptCanvasAssetBase - : public AZ::Data::AssetData - , public AZStd::enable_shared_from_this - , ScriptCanvas::ScriptCanvasAssetBusRequestBus::Handler - { - - public: - AZ_RTTI(ScriptCanvasAssetBase, "{D07DBDE4-A169-4650-871B-FC75AFEEB03E}", AZ::Data::AssetData); - AZ_CLASS_ALLOCATOR(ScriptCanvasAssetBase, AZ::SystemAllocator, 0); - - ScriptCanvasAssetBase(const AZ::Data::AssetId& assetId = AZ::Data::AssetId(AZ::Uuid::CreateRandom()), - AZ::Data::AssetData::AssetStatus status = AZ::Data::AssetData::AssetStatus::NotLoaded) - : AZ::Data::AssetData(assetId, status) - { - ScriptCanvas::ScriptCanvasAssetBusRequestBus::Handler::BusConnect(GetId()); - } - - virtual ~ScriptCanvasAssetBase() - { - delete m_data; - ScriptCanvas::ScriptCanvasAssetBusRequestBus::Handler::BusDisconnect(); - } - - template - DataType* GetScriptCanvasDataAs() - { - return azrtti_cast(m_data); - } - - template - const DataType* GetScriptCanvasDataAs() const - { - return azrtti_cast(m_data); - } - - virtual ScriptCanvasData& GetScriptCanvasData() - { - return *m_data; - } - - virtual const ScriptCanvasData& GetScriptCanvasData() const - { - return *m_data; - } - - AZ::Entity* GetScriptCanvasEntity() const - { - return m_data->m_scriptCanvasEntity.get(); - } - - virtual void SetScriptCanvasEntity(AZ::Entity* scriptCanvasEntity) - { - if (m_data->m_scriptCanvasEntity.get() != scriptCanvasEntity) - { - m_data->m_scriptCanvasEntity.reset(scriptCanvasEntity); - } - } - - virtual ScriptCanvas::AssetDescription GetAssetDescription() const = 0; - - protected: - - ScriptCanvasData* m_data; - - void SetAsNewAsset() override - { - m_status = AZ::Data::AssetData::AssetStatus::Ready; - } - - }; -} diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake index 30bedd634b..b2f98226b4 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_editor_files.cmake @@ -17,9 +17,6 @@ set(FILES Editor/QtMetaTypes.h Editor/Assets/ScriptCanvasAssetHelpers.h Editor/Assets/ScriptCanvasAssetHelpers.cpp - Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.h - Editor/Include/ScriptCanvas/Assets/ScriptCanvasBaseAssetData.cpp - Editor/Include/ScriptCanvas/Assets/ScriptCanvasAssetBus.h Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h Editor/Assets/ScriptCanvasFileHandling.cpp Editor/Assets/ScriptCanvasUndoHelper.h From 81bb7aab80024090eab00c1af9a645d8634c0725 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Tue, 14 Dec 2021 17:32:22 -0800 Subject: [PATCH 134/948] the bloodbath compiles Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../Code/Asset/EditorAssetSystemComponent.cpp | 2 +- .../Assets/ScriptCanvasAssetHelpers.cpp | 6 +- .../Code/Editor/Components/EditorGraph.cpp | 1 - .../Framework/ScriptCanvasGraphUtilities.inl | 51 +++++----- .../Include/ScriptCanvas/Bus/RequestBus.h | 5 - .../Bus/ScriptCanvasExecutionBus.h | 2 +- .../Components/EditorDeprecationData.h | 22 +++-- .../Code/Editor/ReflectComponent.cpp | 94 +++++++++++++++++-- .../Code/Editor/SystemComponent.cpp | 8 +- .../Code/Editor/SystemComponent.h | 2 +- .../Code/Editor/View/Widgets/GraphTabBar.cpp | 6 +- .../FunctionNodePaletteTreeItemTypes.h | 2 +- .../StatisticsDialog/NodeUsageTreeItem.cpp | 5 +- .../StatisticsDialog/NodeUsageTreeItem.h | 9 +- .../ScriptCanvasStatisticsDialog.cpp | 4 +- .../UnitTestPanel/UnitTestDockWidget.cpp | 12 +-- .../UnitTestPanel/UnitTestDockWidget.h | 8 +- .../Code/Editor/View/Windows/MainWindow.h | 6 +- .../Windows/Tools/UpgradeTool/Scanner.cpp | 2 +- .../Code/Include/ScriptCanvas/Core/Core.cpp | 1 - .../Code/Include/ScriptCanvas/Core/Core.h | 23 ++--- .../Code/scriptcanvasgem_headers.cmake | 1 + 22 files changed, 170 insertions(+), 102 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp index 0a0ddbf8b8..3491cb5360 100644 --- a/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Asset/EditorAssetSystemComponent.cpp @@ -128,7 +128,7 @@ namespace ScriptCanvasEditor // and then a lambda which will be activated if the user chooses to open it with your opener: openers.push_back({ "ScriptCanvas_Editor_Asset_Edit", "Script Canvas Editor..." - , QIcon(ScriptCanvasAssetDescription().GetIconPathImpl()), + , QIcon(ScriptCanvasEditor::SourceDescription::GetIconPath()), [](const char*, const AZ::Uuid& scSourceUuid) { AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHelpers.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHelpers.cpp index 07f7ac1e2f..44e529249c 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHelpers.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasAssetHelpers.cpp @@ -150,11 +150,7 @@ namespace ScriptCanvasEditor bool IsValidSourceFile(const AZStd::string& filePath, [[maybe_unused]] ScriptCanvas::ScriptCanvasId scriptCanvasId) { - ScriptCanvasAssetDescription assetDescription; - return AZ::StringFunc::EndsWith(filePath, assetDescription.GetExtensionImpl(), false); - { - return true; - } + return AZ::StringFunc::EndsWith(filePath, ScriptCanvasEditor::SourceDescription::GetFileExtension(), false); } } } diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp index b50457adbf..d713bc09a6 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp @@ -77,7 +77,6 @@ AZ_POP_DISABLE_WARNING #include #include #include -#include #include #include #include diff --git a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl index 8571c03638..51fef7efcf 100644 --- a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl +++ b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl @@ -149,36 +149,33 @@ namespace ScriptCanvasEditor } } - AZ_INLINE void RunEditorAsset(AZ::Data::Asset asset, Reporter& reporter, ScriptCanvas::ExecutionMode mode) + AZ_INLINE void RunEditorAsset(SourceHandle asset, Reporter& reporter, ScriptCanvas::ExecutionMode mode) { - if (asset.IsReady()) + AZ::Data::AssetId assetId = asset.Id(); + AZ::Data::AssetId runtimeAssetId(assetId.m_guid, AZ_CRC("RuntimeData", 0x163310ae)); + AZ::Data::Asset runtimeAsset; + if (!runtimeAsset.Create(runtimeAssetId, true)) { - AZ::Data::AssetId assetId = asset.GetId(); - AZ::Data::AssetId runtimeAssetId(assetId.m_guid, AZ_CRC("RuntimeData", 0x163310ae)); - AZ::Data::Asset runtimeAsset; - if (!runtimeAsset.Create(runtimeAssetId, true)) - { - return; - } - - reporter.SetExecutionMode(mode); - - LoadTestGraphResult loadResult; - loadResult.m_editorAsset = SourceHandle(nullptr, assetId.m_guid, asset.GetHint()); - AZ::EntityId scriptCanvasId; - loadResult.m_entity = AZStd::make_unique("Loaded test graph"); - loadResult.m_runtimeAsset = runtimeAsset; - - RunGraphSpec runGraphSpec; - runGraphSpec.dirPath = ""; - runGraphSpec.graphPath = asset.GetHint().c_str(); - runGraphSpec.runSpec.duration.m_spec = eDuration::Ticks; - runGraphSpec.runSpec.duration.m_ticks = 10; - runGraphSpec.runSpec.execution = mode; - runGraphSpec.runSpec.release = true; - runGraphSpec.runSpec.debug = runGraphSpec.runSpec.traced = false; - RunGraphImplementation(runGraphSpec, loadResult, reporter); + return; } + + reporter.SetExecutionMode(mode); + + LoadTestGraphResult loadResult; + loadResult.m_editorAsset = SourceHandle(nullptr, assetId.m_guid, asset.Path()); + AZ::EntityId scriptCanvasId; + loadResult.m_entity = AZStd::make_unique("Loaded test graph"); + loadResult.m_runtimeAsset = runtimeAsset; + + RunGraphSpec runGraphSpec; + runGraphSpec.dirPath = ""; + runGraphSpec.graphPath = asset.Path().c_str(); + runGraphSpec.runSpec.duration.m_spec = eDuration::Ticks; + runGraphSpec.runSpec.duration.m_ticks = 10; + runGraphSpec.runSpec.execution = mode; + runGraphSpec.runSpec.release = true; + runGraphSpec.runSpec.debug = runGraphSpec.runSpec.traced = false; + RunGraphImplementation(runGraphSpec, loadResult, reporter); } AZ_INLINE void RunGraphImplementation(const RunGraphSpec& runGraphSpec, Reporter& reporter) diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h index 5ec0ee1636..fa4d5bbaa1 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/RequestBus.h @@ -37,11 +37,6 @@ namespace GraphCanvas class NodePaletteDockWidget; } -namespace ScriptCanvas -{ - class ScriptCanvasAssetBase; -} - namespace ScriptCanvasEditor { struct CategoryInformation; diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/ScriptCanvasExecutionBus.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/ScriptCanvasExecutionBus.h index 54cc55a993..51d348e285 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/ScriptCanvasExecutionBus.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Bus/ScriptCanvasExecutionBus.h @@ -23,7 +23,7 @@ namespace ScriptCanvasEditor static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single; virtual Reporter RunGraph(AZStd::string_view path, ScriptCanvas::ExecutionMode mode) = 0; - virtual Reporter RunAssetGraph(AZ::Data::Asset, ScriptCanvas::ExecutionMode mode) = 0; + virtual Reporter RunAssetGraph(SourceHandle source, ScriptCanvas::ExecutionMode mode) = 0; }; using ScriptCanvasExecutionBus = AZ::EBus; diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorDeprecationData.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorDeprecationData.h index 0b55e1cf23..4c60441363 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorDeprecationData.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorDeprecationData.h @@ -17,6 +17,18 @@ namespace ScriptCanvasEditor { namespace Deprecated { + // only used as a pass-through to loading a guid / hint during version conversion + class ScriptCanvasAsset + : public AZ::Data::AssetData + { + public: + AZ_TYPE_INFO(ScriptCanvasAsset, "{FA10C3DA-0717-4B72-8944-CD67D13DFA2B}"); + AZ_CLASS_ALLOCATOR(ScriptCanvasAsset, AZ::SystemAllocator, 0); + + ScriptCanvasAsset() = default; + }; + + // only used as a pass-through to loading a guid / hint during version conversion class ScriptCanvasAssetHolder { public: @@ -30,15 +42,5 @@ namespace ScriptCanvasEditor ScriptCanvasAssetHolder() = default; }; - // only is used as a pass-through to loading a guid / hint during versioning - class ScriptCanvasAsset - : public AZ::Data::AssetData - { - public: - AZ_TYPE_INFO(ScriptCanvasAsset, "{FA10C3DA-0717-4B72-8944-CD67D13DFA2B}"); - AZ_CLASS_ALLOCATOR(ScriptCanvasAsset, AZ::SystemAllocator, 0); - - ScriptCanvasAsset() = default; - }; } } diff --git a/Gems/ScriptCanvas/Code/Editor/ReflectComponent.cpp b/Gems/ScriptCanvas/Code/Editor/ReflectComponent.cpp index 8990b55798..45257150c6 100644 --- a/Gems/ScriptCanvas/Code/Editor/ReflectComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/ReflectComponent.cpp @@ -6,26 +6,102 @@ * */ -#include - #include -#include #include - - +#include +#include +#include #include #include - #include -#include #include +#include #include +#include #include #include -#include +#include #include +#include +#include -#include +namespace CoreCpp +{ + static bool ScriptCanvasDataVersionConverter(AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& rootDataElementNode) + { + if (rootDataElementNode.GetVersion() == 0) + { + int scriptCanvasEntityIndex = rootDataElementNode.FindElement(AZ_CRC("m_scriptCanvas", 0xfcd20d85)); + if (scriptCanvasEntityIndex == -1) + { + AZ_Error("Script Canvas", false, "Version Converter failed, The Script Canvas Entity is missing"); + return false; + } + + auto scComponentElements = AZ::Utils::FindDescendantElements(context, rootDataElementNode, AZStd::vector{AZ_CRC("m_scriptCanvas", 0xfcd20d85), + AZ_CRC("element", 0x41405e39), AZ_CRC("Components", 0xee48f5fd)}); + if (!scComponentElements.empty()) + { + scComponentElements.front()->AddElementWithData(context, "element", ScriptCanvasEditor::EditorGraphVariableManagerComponent()); + } + } + + if (rootDataElementNode.GetVersion() < 4) + { + auto scEntityElements = AZ::Utils::FindDescendantElements(context, rootDataElementNode, + AZStd::vector{AZ_CRC("m_scriptCanvas", 0xfcd20d85), AZ_CRC("element", 0x41405e39)}); + if (scEntityElements.empty()) + { + AZ_Error("Script Canvas", false, "Version Converter failed, The Script Canvas Entity is missing"); + return false; + } + auto& scEntityDataElement = *scEntityElements.front(); + + AZ::Entity scEntity; + if (!scEntityDataElement.GetData(scEntity)) + { + AZ_Error("Script Canvas", false, "Unable to retrieve entity data from the Data Element"); + return false; + } + + auto graph = AZ::EntityUtils::FindFirstDerivedComponent(&scEntity); + if (!graph) + { + AZ_Error("Script Canvas", false, "Script Canvas graph component could not be found on Script Canvas Entity for ScriptCanvasData version %u", rootDataElementNode.GetVersion()); + return false; + } + auto variableManager = AZ::EntityUtils::FindFirstDerivedComponent(&scEntity); + if (!variableManager) + { + AZ_Error("Script Canvas", false, "Script Canvas variable manager component could not be found on Script Canvas Entity for ScriptCanvasData version %u", rootDataElementNode.GetVersion()); + return false; + } + + variableManager->ConfigureScriptCanvasId(graph->GetScriptCanvasId()); + if (!scEntityDataElement.SetData(context, scEntity)) + { + AZ_Error("Script Canvas", false, "Failed to set converted Script Canvas Entity back on data element node when transitioning from version %u to version 4", rootDataElementNode.GetVersion()); + return false; + } + } + + return true; + } +} + +namespace ScriptCanvas +{ + void ScriptCanvasData::Reflect(AZ::ReflectContext* reflectContext) + { + if (auto serializeContext = azrtti_cast(reflectContext)) + { + serializeContext->Class() + ->Version(4, &CoreCpp::ScriptCanvasDataVersionConverter) + ->Field("m_scriptCanvas", &ScriptCanvasData::m_scriptCanvasEntity) + ; + } + } +} namespace ScriptCanvasEditor { diff --git a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp index 4933a31b60..9bbdddfedb 100644 --- a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp @@ -316,8 +316,8 @@ namespace ScriptCanvasEditor using namespace AzToolsFramework::AssetBrowser; bool isScriptCanvasAsset = false; - ScriptCanvasAssetDescription scriptCanvasAssetDescription; - if (AZStd::wildcard_match(AZStd::string::format("*%s", scriptCanvasAssetDescription.GetExtensionImpl()).c_str(), fullSourceFileName)) + + if (AZStd::wildcard_match(ScriptCanvasEditor::SourceDescription::GetFileExtension(), fullSourceFileName)) { isScriptCanvasAsset = true; } @@ -339,7 +339,7 @@ namespace ScriptCanvasEditor } }; - openers.push_back({ "O3DE_ScriptCanvasEditor", "Open In Script Canvas Editor...", QIcon(ScriptCanvasAssetDescription().GetIconPathImpl()), scriptCanvasEditorCallback }); + openers.push_back({ "O3DE_ScriptCanvasEditor", "Open In Script Canvas Editor...", QIcon(ScriptCanvasEditor::SourceDescription::GetIconPath()), scriptCanvasEditorCallback }); } } @@ -394,7 +394,7 @@ namespace ScriptCanvasEditor return ScriptCanvasEditor::RunGraph(runGraphSpec).front(); } - Reporter SystemComponent::RunAssetGraph(AZ::Data::Asset asset, ScriptCanvas::ExecutionMode mode) + Reporter SystemComponent::RunAssetGraph(SourceHandle asset, ScriptCanvas::ExecutionMode mode) { Reporter reporter; RunEditorAsset(asset, reporter, mode); diff --git a/Gems/ScriptCanvas/Code/Editor/SystemComponent.h b/Gems/ScriptCanvas/Code/Editor/SystemComponent.h index dc4175f938..9aecd00320 100644 --- a/Gems/ScriptCanvas/Code/Editor/SystemComponent.h +++ b/Gems/ScriptCanvas/Code/Editor/SystemComponent.h @@ -78,7 +78,7 @@ namespace ScriptCanvasEditor //////////////////////////////////////////////////////////////////////// // ScriptCanvasExecutionBus::Handler... - Reporter RunAssetGraph(AZ::Data::Asset, ScriptCanvas::ExecutionMode mode) override; + Reporter RunAssetGraph(SourceHandle source, ScriptCanvas::ExecutionMode mode) override; Reporter RunGraph(AZStd::string_view path, ScriptCanvas::ExecutionMode mode) override; //////////////////////////////////////////////////////////////////////// diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp index 4e9398fdcf..c5f808d5f4 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp @@ -78,7 +78,7 @@ namespace ScriptCanvasEditor if (!tabDataVariant.value().m_canvasWidget) { CanvasWidget* canvasWidget = new CanvasWidget(tabDataVariant.value().m_assetId, this); - canvasWidget->SetDefaultBorderColor(ScriptCanvasAssetDescription().GetDisplayColorImpl()); + canvasWidget->SetDefaultBorderColor(ScriptCanvasEditor::SourceDescription::GetDisplayColor()); GraphTabMetadata replacement = tabDataVariant.value(); replacement.m_canvasWidget = canvasWidget; tabDataVariant.setValue(replacement); @@ -147,11 +147,11 @@ namespace ScriptCanvasEditor { if (!SelectTab(assetId)) { - QIcon tabIcon = QIcon(ScriptCanvasAssetDescription().GetIconPathImpl()); + QIcon tabIcon = QIcon(ScriptCanvasEditor::SourceDescription::GetIconPath()); tabIndex = qobject_cast(parent())->insertTab(tabIndex, new QWidget(), tabIcon, ""); GraphTabMetadata metaData; CanvasWidget* canvasWidget = new CanvasWidget(assetId, this); - canvasWidget->SetDefaultBorderColor(ScriptCanvasAssetDescription().GetDisplayColorImpl()); + canvasWidget->SetDefaultBorderColor(SourceDescription::GetDisplayColor()); metaData.m_canvasWidget = canvasWidget; metaData.m_assetId = assetId; metaData.m_fileState = fileState; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/FunctionNodePaletteTreeItemTypes.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/FunctionNodePaletteTreeItemTypes.h index 479fed1097..459c786edd 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/FunctionNodePaletteTreeItemTypes.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/FunctionNodePaletteTreeItemTypes.h @@ -17,7 +17,7 @@ #include #include #include - +#include #include namespace AZ diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/NodeUsageTreeItem.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/NodeUsageTreeItem.cpp index 2770202233..64dfa30cff 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/NodeUsageTreeItem.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/NodeUsageTreeItem.cpp @@ -182,6 +182,7 @@ namespace ScriptCanvasEditor return nodeIter->second; } + /* void ScriptCanvasAssetNodeUsageTreeItem::OnAssetReady(AZ::Data::Asset asset) { ProcessAsset(asset); @@ -200,7 +201,8 @@ namespace ScriptCanvasEditor ProcessAsset(asset); } - void ScriptCanvasAssetNodeUsageTreeItem::ProcessAsset(const AZ::Data::Asset& scriptCanvasAsset) + // #sc_editor_asset_redux fix graph use statistics + void ScriptCanvasAssetNodeUsageTreeItem::ProcessAsset(const AZ::Data::Asset& scriptCanvasAsset) { if (scriptCanvasAsset.IsReady()) { @@ -222,6 +224,7 @@ namespace ScriptCanvasEditor } } } + */ /////////////////////////////////////////// // ScriptCanvasAssetNodeUsageTreeItemRoot diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/NodeUsageTreeItem.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/NodeUsageTreeItem.h index 3e2c0b637b..7fbe3e173a 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/NodeUsageTreeItem.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/NodeUsageTreeItem.h @@ -94,15 +94,16 @@ namespace ScriptCanvasEditor void SetActiveNodeType(const ScriptCanvas::NodeTypeIdentifier& nodeTypeIdentifier); int GetNodeCount() const; + private: + // AZ::Data::AssetBus::Handler + /* void OnAssetReady(AZ::Data::Asset asset) override; void OnAssetSaved(AZ::Data::Asset asset, bool isSuccessful) override; void OnAssetReloaded(AZ::Data::Asset asset) override; + */ //// - - private: - - void ProcessAsset(const AZ::Data::Asset& scriptCanvasAsset); + // void ProcessAsset(const AZ::Data::Asset& scriptCanvasAsset); QString m_name; QIcon m_icon; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/ScriptCanvasStatisticsDialog.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/ScriptCanvasStatisticsDialog.cpp index 62f0d7ddc7..980e3a1e92 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/ScriptCanvasStatisticsDialog.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/StatisticsDialog/ScriptCanvasStatisticsDialog.cpp @@ -435,9 +435,9 @@ namespace ScriptCanvasEditor } } - void StatisticsDialog::ProcessAsset(const AzToolsFramework::AssetBrowser::AssetBrowserEntry* entry) + void StatisticsDialog::ProcessAsset([[maybe_unused]] const AzToolsFramework::AssetBrowser::AssetBrowserEntry* entry) { - // #sc_editor_asset_redux cut or update + // #sc_editor_asset_redux cut or update // if (entry) // { // if (entry->GetEntryType() == AzToolsFramework::AssetBrowser::AssetBrowserEntry::AssetEntryType::Product) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/UnitTestPanel/UnitTestDockWidget.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/UnitTestPanel/UnitTestDockWidget.cpp index 63e41896fc..d3a948a6c4 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/UnitTestPanel/UnitTestDockWidget.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/UnitTestPanel/UnitTestDockWidget.cpp @@ -574,14 +574,14 @@ namespace ScriptCanvasEditor void UnitTestDockWidget::RunTestGraph(SourceHandle asset, ScriptCanvas::ExecutionMode mode) { Reporter reporter; - UnitTestWidgetNotificationBus::Broadcast(&UnitTestWidgetNotifications::OnTestStart, asset); + UnitTestWidgetNotificationBus::Broadcast(&UnitTestWidgetNotifications::OnTestStart, asset.Id()); ScriptCanvasExecutionBus::BroadcastResult(reporter, &ScriptCanvasExecutionRequests::RunAssetGraph, asset, mode); UnitTestResult testResult; UnitTestVerificationBus::BroadcastResult(testResult, &UnitTestVerificationRequests::Verify, reporter); - UnitTestWidgetNotificationBus::Broadcast(&UnitTestWidgetNotifications::OnTestResult, asset, testResult); + UnitTestWidgetNotificationBus::Broadcast(&UnitTestWidgetNotifications::OnTestResult, asset.Id(), testResult); m_pendingTests.Add(asset, mode); @@ -603,7 +603,7 @@ namespace ScriptCanvasEditor ++m_testMetrics[static_cast(mode)].m_compilationFailures; } - m_pendingTests.Complete(asset.GetId(), mode); + m_pendingTests.Complete(asset, mode); } void UnitTestDockWidget::OnSystemTick() @@ -614,14 +614,14 @@ namespace ScriptCanvasEditor } } - void UnitTestDockWidget::PendingTests::Add(AZ::Data::AssetId assetId, ExecutionMode mode) + void UnitTestDockWidget::PendingTests::Add(ScriptCanvasEditor::SourceHandle assetId, ExecutionMode mode) { m_pendingTests.push_back(AZStd::make_pair(assetId, mode)); } - void UnitTestDockWidget::PendingTests::Complete(AZ::Data::AssetId assetId, ExecutionMode mode) + void UnitTestDockWidget::PendingTests::Complete(ScriptCanvasEditor::SourceHandle assetId, ExecutionMode mode) { - AZStd::erase_if(m_pendingTests, [assetId, mode](const AZStd::pair& pending) + AZStd::erase_if(m_pendingTests, [assetId, mode](const AZStd::pair& pending) { return (assetId == pending.first && mode == pending.second); }); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/UnitTestPanel/UnitTestDockWidget.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/UnitTestPanel/UnitTestDockWidget.h index 93bb093c49..fce520a6f2 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/UnitTestPanel/UnitTestDockWidget.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/UnitTestPanel/UnitTestDockWidget.h @@ -162,7 +162,7 @@ namespace ScriptCanvasEditor void OpenTestResults(AZ::Uuid sourceUuid, AZStd::string_view sourceDisplayName); void RunTests(const AZStd::vector& scriptUuids); - void RunTestGraph(AZ::Data::Asset, ScriptCanvas::ExecutionMode); + void RunTestGraph(SourceHandle sourceHandle, ScriptCanvas::ExecutionMode); void OnTestsComplete(); @@ -184,15 +184,15 @@ namespace ScriptCanvasEditor { public: - void Add(AZ::Data::AssetId assetId, ExecutionMode mode); + void Add(ScriptCanvasEditor::SourceHandle assetId, ExecutionMode mode); - void Complete(AZ::Data::AssetId assetId, ExecutionMode mode); + void Complete(ScriptCanvasEditor::SourceHandle assetId, ExecutionMode mode); bool IsFinished() const; private: - AZStd::vector> m_pendingTests; + AZStd::vector> m_pendingTests; }; PendingTests m_pendingTests; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h index fbc363e444..2d2c32be18 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.h @@ -56,10 +56,9 @@ #if SCRIPTCANVAS_EDITOR #include -#endif +#endif//#if SCRIPTCANVAS_EDITOR -#include -#endif +#endif//#if !defined(Q_MOC_RUN) namespace GraphCanvas { @@ -87,7 +86,6 @@ namespace AzQtComponents class QDir; class QFile; class QProgressDialog; -namespace ScriptCanvas { class ScriptCanvasAssetBase; } namespace ScriptCanvasEditor { diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp index 9e6340ee31..29fa3c62e5 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Scanner.cpp @@ -6,13 +6,13 @@ * */ +#include #include #include #include #include #include #include - #include namespace ScannerCpp diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp index 1ac7a33821..4a1d5d94c1 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp @@ -13,7 +13,6 @@ #include #include #include -#include #include "Attributes.h" #include "Core.h" diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h index 01280a4ee5..d283be79e5 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h @@ -321,17 +321,18 @@ namespace ScriptCanvasEditor { public: static inline constexpr const char* GetAssetGroup() { return "ScriptCanvas"; } - inline static constexpr const char* GetType() { return "{FA10C3DA-0717-4B72-8944-CD67D13DFA2B}"; } // type - inline static constexpr const char* GetName() { return "Script Canvas"; } // name - inline static constexpr const char* GetDescription() { return "Script Canvas Graph Asset"; } // description - inline static constexpr const char* GetSuggestedSavePath() { return "@projectroot@/scriptcanvas"; } // suggested save path - inline static constexpr const char* GetFileExtension() { return ".scriptcanvas"; } // fileExtention - inline static constexpr const char* GetGroup() { return "Script Canvas"; } // group - inline static constexpr const char* GetAssetNamePattern() { return "Untitled-%i"; } // asset name pattern - inline static constexpr const char* GetFileFilter() { return "Script Canvas Files (*.scriptcanvas)"; } // file filter - inline static constexpr const char* GetAssetTypeDisplayName() { return "Script Canvas"; } // asset type display name - inline static constexpr const char* GetEntityName() { return "Script Canvas"; } // entity name - inline static constexpr const char* GetIconPath() { return "Icons/ScriptCanvas/Viewport/ScriptCanvas.png"; } // icon pa + inline static constexpr const char* GetType() { return "{FA10C3DA-0717-4B72-8944-CD67D13DFA2B}"; } + inline static constexpr const char* GetName() { return "Script Canvas"; } + inline static constexpr const char* GetDescription() { return "Script Canvas Graph File"; } + inline static constexpr const char* GetSuggestedSavePath() { return "@projectroot@/scriptcanvas"; } + inline static constexpr const char* GetFileExtension() { return ".scriptcanvas"; } + inline static constexpr const char* GetGroup() { return "Script Canvas"; } + inline static constexpr const char* GetAssetNamePattern() { return "Untitled-%i"; } + inline static constexpr const char* GetFileFilter() { return "Script Canvas Files (*.scriptcanvas)"; } + inline static constexpr const char* GetAssetTypeDisplayName() { return "Script Canvas"; } + inline static constexpr const char* GetEntityName() { return "Script Canvas"; } + inline static constexpr const char* GetIconPath() { return "Icons/ScriptCanvas/Viewport/ScriptCanvas.png"; } + inline static AZ::Color GetDisplayColor() { return AZ::Color(1.0f, 0.0f, 0.0f, 1.0f); }; }; class SourceHandle diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake index ecbcdc6ed6..9830535ad8 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_headers.cmake @@ -9,6 +9,7 @@ set(FILES Include/ScriptCanvas/SystemComponent.h Include/ScriptCanvas/ScriptCanvasGem.h + Include/ScriptCanvas/Asset/AssetDescription.h Include/ScriptCanvas/Asset/AssetRegistry.h Include/ScriptCanvas/Asset/AssetRegistryBus.h Include/ScriptCanvas/Asset/ExecutionLogAsset.h From f2bbf418814bda8e85e167762900c6f7bf753c96 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Tue, 14 Dec 2021 18:01:22 -0800 Subject: [PATCH 135/948] fix color background in editor Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h index d283be79e5..1a644d312e 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h @@ -320,7 +320,7 @@ namespace ScriptCanvasEditor class SourceDescription { public: - static inline constexpr const char* GetAssetGroup() { return "ScriptCanvas"; } + inline static constexpr const char* GetAssetGroup() { return "ScriptCanvas"; } inline static constexpr const char* GetType() { return "{FA10C3DA-0717-4B72-8944-CD67D13DFA2B}"; } inline static constexpr const char* GetName() { return "Script Canvas"; } inline static constexpr const char* GetDescription() { return "Script Canvas Graph File"; } @@ -332,7 +332,7 @@ namespace ScriptCanvasEditor inline static constexpr const char* GetAssetTypeDisplayName() { return "Script Canvas"; } inline static constexpr const char* GetEntityName() { return "Script Canvas"; } inline static constexpr const char* GetIconPath() { return "Icons/ScriptCanvas/Viewport/ScriptCanvas.png"; } - inline static AZ::Color GetDisplayColor() { return AZ::Color(1.0f, 0.0f, 0.0f, 1.0f); }; + inline static AZ::Color GetDisplayColor() { return AZ::Color(0.5f, 0.5f, 0.5f, 0.5f); }; }; class SourceHandle From 686f82666bd2a9434e95faba6a392ba1079fe51e Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Tue, 14 Dec 2021 18:52:50 -0800 Subject: [PATCH 136/948] disable test manager until the asset browsing is fixed Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- Gems/ScriptCanvas/Code/Editor/View/Windows/mainwindow.ui | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/mainwindow.ui b/Gems/ScriptCanvas/Code/Editor/View/Windows/mainwindow.ui index 1208a55a64..6276f7e2b4 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/mainwindow.ui +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/mainwindow.ui @@ -529,7 +529,10 @@ Test Manager - + + false + + Ctrl+Shift+T From 671479c0951434117c2c056a4abe5a1335a86b86 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Tue, 14 Dec 2021 19:05:43 -0800 Subject: [PATCH 137/948] remove dev comment Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 3b110aba7b..40cc52ac85 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -434,8 +434,6 @@ namespace ScriptCanvasEditor m_scriptCanvasAssetModel = new ScriptCanvasAssetBrowserModel(this); AzToolsFramework::AssetBrowser::AssetGroupFilter* scriptCanvasAssetFilter = new AzToolsFramework::AssetBrowser::AssetGroupFilter(); - // #sc_editor_asset_redux this may not be needed, may not be doing the right thing at all, verify that searching through - // the subgraph interface assets is the correct thing to do scriptCanvasAssetFilter->SetAssetGroup(ScriptCanvas::SubgraphInterfaceAssetDescription().GetGroupImpl()); scriptCanvasAssetFilter->SetFilterPropagation(AzToolsFramework::AssetBrowser::AssetBrowserEntryFilter::PropagateDirection::Down); From dc9d1a2f312263058a06c0147ab831ea8eb0996f Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Thu, 9 Dec 2021 18:35:18 -0600 Subject: [PATCH 138/948] Introduced a Json Serializer for the AzCore mutable path classes Added UnitTest for Json Serialization of AzCore Path types resolves #2477 Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- Code/Framework/AzCore/AzCore/IO/Path/Path.h | 1 + Code/Framework/AzCore/AzCore/IO/Path/Path.inl | 7 + .../AzCore/AzCore/IO/Path/PathReflect.cpp | 14 +- .../Serialization/Json/PathSerializer.cpp | 127 ++++++++++++++++++ .../Serialization/Json/PathSerializer.h | 26 ++++ .../AzCore/AzCore/azcore_files.cmake | 2 + .../Json/PathSerializerTests.cpp | 106 +++++++++++++++ .../AzCore/Tests/azcoretests_files.cmake | 1 + 8 files changed, 280 insertions(+), 4 deletions(-) create mode 100644 Code/Framework/AzCore/AzCore/Serialization/Json/PathSerializer.cpp create mode 100644 Code/Framework/AzCore/AzCore/Serialization/Json/PathSerializer.h create mode 100644 Code/Framework/AzCore/Tests/Serialization/Json/PathSerializerTests.cpp diff --git a/Code/Framework/AzCore/AzCore/IO/Path/Path.h b/Code/Framework/AzCore/AzCore/IO/Path/Path.h index 094dee16f2..7f89809294 100644 --- a/Code/Framework/AzCore/AzCore/IO/Path/Path.h +++ b/Code/Framework/AzCore/AzCore/IO/Path/Path.h @@ -484,6 +484,7 @@ namespace AZ::IO // as_posix //! Replicates the behavior of the Python pathlib as_posix method //! by replacing the Windows Path Separator with the Posix Path Seperator + constexpr string_type AsPosix() const; AZStd::string StringAsPosix() const; constexpr AZStd::fixed_string FixedMaxPathStringAsPosix() const noexcept; diff --git a/Code/Framework/AzCore/AzCore/IO/Path/Path.inl b/Code/Framework/AzCore/AzCore/IO/Path/Path.inl index 5ac15fc728..0dc1799528 100644 --- a/Code/Framework/AzCore/AzCore/IO/Path/Path.inl +++ b/Code/Framework/AzCore/AzCore/IO/Path/Path.inl @@ -1043,6 +1043,13 @@ namespace AZ::IO // as_posix // Returns a copy of the path with the path separators converted to PosixPathSeparator template + constexpr auto BasicPath::AsPosix() const -> string_type + { + string_type resultPath(m_path.begin(), m_path.end()); + AZStd::replace(resultPath.begin(), resultPath.end(), WindowsPathSeparator, PosixPathSeparator); + return resultPath; + } + template AZStd::string BasicPath::StringAsPosix() const { AZStd::string resultPath(m_path.begin(), m_path.end()); diff --git a/Code/Framework/AzCore/AzCore/IO/Path/PathReflect.cpp b/Code/Framework/AzCore/AzCore/IO/Path/PathReflect.cpp index 55a991f19f..1d0cdba66c 100644 --- a/Code/Framework/AzCore/AzCore/IO/Path/PathReflect.cpp +++ b/Code/Framework/AzCore/AzCore/IO/Path/PathReflect.cpp @@ -7,6 +7,8 @@ */ #include +#include +#include #include #include @@ -35,10 +37,8 @@ namespace AZ::IO size_t Save(const void* classPtr, IO::GenericStream& stream, bool) override { /// Save paths out using the PosixPathSeparator - PathType path(reinterpret_cast(classPtr)->Native(), AZ::IO::PosixPathSeparator); - path.MakePreferred(); - - return static_cast(stream.Write(path.Native().size(), path.c_str())); + auto posixPathString{ reinterpret_cast(classPtr)->AsPosix() }; + return static_cast(stream.Write(posixPathString.size(), posixPathString.c_str())); } bool Load(void* classPtr, IO::GenericStream& stream, unsigned int, bool) override @@ -73,5 +73,11 @@ namespace AZ::IO AZ::SerializeContext::IDataSerializer::CreateDefaultDeleteDeleter() }) ; } + else if (auto jsonContext = azrtti_cast(context)) + { + jsonContext->Serializer() + ->HandlesType() + ->HandlesType(); + } } } diff --git a/Code/Framework/AzCore/AzCore/Serialization/Json/PathSerializer.cpp b/Code/Framework/AzCore/AzCore/Serialization/Json/PathSerializer.cpp new file mode 100644 index 0000000000..7c057730e8 --- /dev/null +++ b/Code/Framework/AzCore/AzCore/Serialization/Json/PathSerializer.cpp @@ -0,0 +1,127 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include +#include +#include +#include +#include +#include + +namespace AZ::JsonPathSerializerInternal +{ + template + static JsonSerializationResult::Result Load(PathType* pathValue, const rapidjson::Value& inputValue, + JsonDeserializerContext& context) + { + namespace JSR = JsonSerializationResult; // Used remove name conflicts in AzCore in uber builds. + + AZ_Assert(pathValue, "Expected a valid pointer to load from json value."); + + switch (inputValue.GetType()) + { + case rapidjson::kArrayType: + case rapidjson::kObjectType: + case rapidjson::kFalseType: + case rapidjson::kTrueType: + case rapidjson::kNumberType: + [[fallthrough]]; + case rapidjson::kNullType: + return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::Unsupported, + "Unsupported type. String values can't be read from arrays, objects or null."); + case rapidjson::kStringType: + { + size_t pathLength = inputValue.GetStringLength(); + if (pathLength <= pathValue->Native().max_size()) + { + *pathValue = PathType(AZStd::string_view(inputValue.GetString(), pathLength)).LexicallyNormal(); + return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::Success, "Successfully read path."); + } + using UuidString = AZStd::fixed_string; + using ErrorString = AZStd::fixed_string<256>; + return context.Report(JsonSerializationResult::Tasks::ReadField, JSR::Outcomes::Invalid, + ErrorString::format("Json string value is too large to fit within path type %s. It needs to be less than %zu code points", + azrtti_typeid().template ToString().c_str(), pathValue->Native().max_size())); + } + default: + return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::Unknown, "Unknown json type encountered for string value."); + } + } + template + static JsonSerializationResult::Result StoreWithDefault(rapidjson::Value& outputValue, const PathType* pathValue, + const PathType* defaultPathValue, JsonSerializerContext& context) + { + namespace JSR = JsonSerializationResult; // Removes name conflicts in AzCore in uber builds. + + if (context.ShouldKeepDefaults() || defaultPathValue == nullptr || *pathValue != *defaultPathValue) + { + auto posixPathString = pathValue->AsPosix(); + outputValue.SetString(posixPathString.c_str(), aznumeric_caster(posixPathString.size()), context.GetJsonAllocator()); + return context.Report(JSR::Tasks::WriteValue, JSR::Outcomes::Success, "Path successfully stored."); + } + + return context.Report(JSR::Tasks::WriteValue, JSR::Outcomes::DefaultsUsed, "Default Path used."); + } +} + +namespace AZ +{ + AZ_CLASS_ALLOCATOR_IMPL(JsonPathSerializer, SystemAllocator, 0); + + JsonSerializationResult::Result JsonPathSerializer::Load(void* outputValue, const Uuid& outputValueTypeId, + const rapidjson::Value& inputValue, JsonDeserializerContext& context) + { + if (outputValueTypeId == azrtti_typeid()) + { + return JsonPathSerializerInternal::Load(reinterpret_cast(outputValue), inputValue, + context); + } + else if (outputValueTypeId == azrtti_typeid()) + { + return JsonPathSerializerInternal::Load(reinterpret_cast(outputValue), inputValue, + context); + } + + using UuidString = AZStd::fixed_string; + auto errorTypeIdString = outputValueTypeId.ToString(); + AZ_Assert(false, "Unable to serialize json string" + " to a path of type %s", errorTypeIdString.c_str()); + + using ErrorString = AZStd::fixed_string<256>; + return context.Report(JsonSerializationResult::Tasks::ReadField, JsonSerializationResult::Outcomes::TypeMismatch, + ErrorString::format("Output value type ID %s is not a valid Path type", errorTypeIdString.c_str())); + } + + JsonSerializationResult::Result JsonPathSerializer::Store(rapidjson::Value& outputValue, const void* inputValue, + const void* defaultValue, const Uuid& valueTypeId, JsonSerializerContext& context) + { + if (valueTypeId == azrtti_typeid()) + { + return JsonPathSerializerInternal::StoreWithDefault(outputValue, + reinterpret_cast(inputValue), + reinterpret_cast(defaultValue), context); + } + else if (valueTypeId == azrtti_typeid()) + { + return JsonPathSerializerInternal::StoreWithDefault(outputValue, + reinterpret_cast(inputValue), + reinterpret_cast(defaultValue), context); + } + + using UuidString = AZStd::fixed_string; + auto errorTypeIdString = valueTypeId.ToString(); + AZ_Assert(false, "Unable to serialize path type %s to a json string", + errorTypeIdString.c_str()); + + using ErrorString = AZStd::fixed_string<256>; + return context.Report(JsonSerializationResult::Tasks::WriteValue, JsonSerializationResult::Outcomes::TypeMismatch, + ErrorString::format("Input value type ID %s is not a valid Path type", errorTypeIdString.c_str())); + } + +} // namespace AZ diff --git a/Code/Framework/AzCore/AzCore/Serialization/Json/PathSerializer.h b/Code/Framework/AzCore/AzCore/Serialization/Json/PathSerializer.h new file mode 100644 index 0000000000..609a489ec4 --- /dev/null +++ b/Code/Framework/AzCore/AzCore/Serialization/Json/PathSerializer.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include + +namespace AZ +{ + class JsonPathSerializer + : public BaseJsonSerializer + { + public: + AZ_RTTI(JsonPathSerializer, "{F6FBA901-07E0-4F03-A0B6-72A9A6CE1E96}", BaseJsonSerializer); + AZ_CLASS_ALLOCATOR_DECL; + 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; + }; +} // namespace AZ diff --git a/Code/Framework/AzCore/AzCore/azcore_files.cmake b/Code/Framework/AzCore/AzCore/azcore_files.cmake index e8001f7215..0dfce11247 100644 --- a/Code/Framework/AzCore/AzCore/azcore_files.cmake +++ b/Code/Framework/AzCore/AzCore/azcore_files.cmake @@ -533,6 +533,8 @@ set(FILES Serialization/Json/JsonUtils.cpp Serialization/Json/MapSerializer.h Serialization/Json/MapSerializer.cpp + Serialization/Json/PathSerializer.h + Serialization/Json/PathSerializer.cpp Serialization/Json/RegistrationContext.h Serialization/Json/RegistrationContext.cpp Serialization/Json/SmartPointerSerializer.h diff --git a/Code/Framework/AzCore/Tests/Serialization/Json/PathSerializerTests.cpp b/Code/Framework/AzCore/Tests/Serialization/Json/PathSerializerTests.cpp new file mode 100644 index 0000000000..e00a4171a2 --- /dev/null +++ b/Code/Framework/AzCore/Tests/Serialization/Json/PathSerializerTests.cpp @@ -0,0 +1,106 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include +#include +#include +#include + +namespace JsonSerializationTests +{ + template + class PathTestDescription + : public JsonSerializerConformityTestDescriptor + { + public: + using JsonSerializerConformityTestDescriptor::Reflect; + void Reflect(AZStd::unique_ptr& serializeContext) override + { + AZ::IO::PathReflect(serializeContext.get()); + } + void Reflect(AZStd::unique_ptr& jsonContext) override + { + AZ::IO::PathReflect(jsonContext.get()); + } + AZStd::shared_ptr CreateSerializer() override + { + return AZStd::make_shared(); + } + + AZStd::shared_ptr CreateDefaultInstance() override + { + return AZStd::make_shared(); + } + + AZStd::shared_ptr CreateFullySetInstance() override + { + return AZStd::make_shared("O3DE/Relative/Path"); + } + + AZStd::string_view GetJsonForFullySetInstance() override + { + return R"("O3DE/Relative/Path")"; + } + + void ConfigureFeatures(JsonSerializerConformityTestDescriptorFeatures& features) override + { + features.EnableJsonType(rapidjson::kStringType); + features.m_supportsPartialInitialization = false; + features.m_supportsInjection = false; + } + + bool AreEqual(const PathType& lhs, const PathType& rhs) override + { + return lhs == rhs; + } + }; + + using PathConformityTestTypes = ::testing::Types< + PathTestDescription, + PathTestDescription + >; + INSTANTIATE_TYPED_TEST_CASE_P(Path, JsonSerializerConformityTests, PathConformityTestTypes); + + + class PathSerializerTests + : public BaseJsonSerializerFixture + { + public: + AZStd::unique_ptr m_serializer; + + void SetUp() override + { + BaseJsonSerializerFixture::SetUp(); + m_serializer = AZStd::make_unique(); + } + + void TearDown() override + { + m_serializer.reset(); + BaseJsonSerializerFixture::TearDown(); + } + }; + + TEST_F(PathSerializerTests, LoadingIntoFixedMaxPath_GreaterThanMaxPathLength_Fails) + { + AZ::IO::Path testPath; + // Fill a path greater than the AZ::IO::MaxPathLength in write it to Json + testPath.Native().append(AZ::IO::MaxPathLength + 2, 'a'); + + rapidjson::Value loadPathValue; + AZ::JsonSerializationResult::ResultCode resultCode = m_serializer->Store(loadPathValue, + &testPath, nullptr, azrtti_typeid(), *m_jsonSerializationContext); + EXPECT_EQ(AZ::JsonSerializationResult::Outcomes::Success, resultCode.GetOutcome()); + + AZ::IO::FixedMaxPath resultPath; + AZ::JsonSerializationResult::ResultCode result = m_serializer->Load(&resultPath, azrtti_typeid(), + loadPathValue, *m_jsonDeserializationContext); + EXPECT_GE(result.GetOutcome(), AZ::JsonSerializationResult::Outcomes::Invalid); + } +} // namespace JsonSerializationTests diff --git a/Code/Framework/AzCore/Tests/azcoretests_files.cmake b/Code/Framework/AzCore/Tests/azcoretests_files.cmake index b7fe113bc6..98f268b61a 100644 --- a/Code/Framework/AzCore/Tests/azcoretests_files.cmake +++ b/Code/Framework/AzCore/Tests/azcoretests_files.cmake @@ -111,6 +111,7 @@ set(FILES Serialization/Json/MapSerializerTests.cpp Serialization/Json/MathVectorSerializerTests.cpp Serialization/Json/MathMatrixSerializerTests.cpp + Serialization/Json/PathSerializerTests.cpp Serialization/Json/SmartPointerSerializerTests.cpp Serialization/Json/StringSerializerTests.cpp Serialization/Json/TestCases.h From e1c1adf2dcbb2ae23ab68d942754acb0c376b326 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Tue, 14 Dec 2021 23:20:12 -0800 Subject: [PATCH 139/948] fix linux build error Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h index 2260418fe8..93d1558223 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Assets/ScriptCanvasFileHandling.h @@ -11,7 +11,7 @@ #include #include #include - +#include namespace AZ { From 069eb6710d38fa67fbd94010e30a2794cf0ff75d Mon Sep 17 00:00:00 2001 From: chiyenteng <82238204+chiyenteng@users.noreply.github.com> Date: Wed, 15 Dec 2021 08:25:18 -0800 Subject: [PATCH 140/948] Make python automated test 'test_WindowsMacPlatforms_MoveCorruptedSliceFile_MoveSuccess' to use prefab instead Signed-off-by: chiyenteng <82238204+chiyenteng@users.noreply.github.com> --- .../ap_fixtures/clear_moveoutput_fixture.py | 2 +- .../asset_relocator_tests.py | 12 +- .../C21968388/DependencyScannerAsset.prefab | 908 ++++++++++++++++++ 3 files changed, 915 insertions(+), 7 deletions(-) create mode 100644 AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/assets/C21968388/DependencyScannerAsset.prefab diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/clear_moveoutput_fixture.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/clear_moveoutput_fixture.py index 30ecac9a65..17da43a5b9 100755 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/clear_moveoutput_fixture.py +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/clear_moveoutput_fixture.py @@ -4,7 +4,7 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT -Fixture for clearing out 'MoveOutput' folders from \dev and \dev\PROJECT +Fixture for clearing out 'MoveOutput' folders from \\dev and \\dev\\PROJECT """ # Import builtin libraries diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_relocator_tests.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_relocator_tests.py index 744720323e..42c83c7c25 100755 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_relocator_tests.py +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_relocator_tests.py @@ -169,17 +169,17 @@ class TestsAssetRelocator_WindowsAndMac(object): @pytest.mark.test_case_id("C21968388") @pytest.mark.assetpipeline - def test_WindowsMacPlatforms_MoveCorruptedSliceFile_MoveSuccess(self, request, workspace, ap_setup_fixture, + def test_WindowsMacPlatforms_MoveCorruptedPrefabFile_MoveSuccess(self, request, workspace, ap_setup_fixture, asset_processor): """ Asset with UUID/AssetId reference in non-standard format is successfully scanned and relocated to the MoveOutput folder. - This test uses a pre-corrupted .slice file. + This test uses a pre-corrupted .prefab file. Test Steps: - 1. Create temporary testing environment with a corrupted slice - 2. Attempt to move the corrupted slice - 3. Verify that corrupted slice was moved successfully + 1. Create temporary testing environment with a corrupted prefab + 2. Attempt to move the corrupted prefab + 3. Verify that corrupted prefab was moved successfully """ env = ap_setup_fixture @@ -187,7 +187,7 @@ class TestsAssetRelocator_WindowsAndMac(object): asset_folder = "C21968388" source_dir, _ = asset_processor.prepare_test_environment(env["tests_dir"], asset_folder) - filename = "DependencyScannerAsset.slice" + filename = "DependencyScannerAsset.prefab" file_path = os.path.join(source_dir, filename) dst_rel_path = os.path.join("MoveOutput", filename) dst_full_path = os.path.join(source_dir, dst_rel_path) diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/assets/C21968388/DependencyScannerAsset.prefab b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/assets/C21968388/DependencyScannerAsset.prefab new file mode 100644 index 0000000000..1ba25b4463 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/assets/C21968388/DependencyScannerAsset.prefab @@ -0,0 +1,908 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "DependencyScannerAsset", + "Components": { + "Component_[10182366347512475253]": { + "$type": "EditorPrefabComponent", + "Id": 10182366347512475253 + }, + "Component_[12917798267488243668]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12917798267488243668 + }, + "Component_[3261249813163778338]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3261249813163778338 + }, + "Component_[3837204912784440039]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 3837204912784440039 + }, + "Component_[4272963378099646759]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 4272963378099646759, + "Parent Entity": "" + }, + "Component_[4848458548047175816]": { + "$type": "EditorVisibilityComponent", + "Id": 4848458548047175816 + }, + "Component_[5787060997243919943]": { + "$type": "EditorInspectorComponent", + "Id": 5787060997243919943 + }, + "Component_[7804170251266531779]": { + "$type": "EditorLockComponent", + "Id": 7804170251266531779 + }, + "Component_[7874177159288365422]": { + "$type": "EditorEntitySortComponent", + "Id": 7874177159288365422 + }, + "Component_[8018146290632383969]": { + "$type": "EditorEntityIconComponent", + "Id": 8018146290632383969 + }, + "Component_[8452360690590857075]": { + "$type": "SelectionComponent", + "Id": 8452360690590857075 + } + } + }, + "Entities": { + "Entity_[274004659287]": { + "Id": "Entity_[274004659287]", + "Name": "DependencyScannerAsset", + "Components": { + "Component_[10849460799799271301]": { + "$type": "EditorPendingCompositionComponent", + "Id": 10849460799799271301 + }, + "Component_[11098142762746045658]": { + "$type": "SelectionComponent", + "Id": 11098142762746045658 + }, + "Component_[11154538629717040387]": { + "$type": "EditorEntitySortComponent", + "Id": 11154538629717040387, + "Child Entity Order": [ + "Entity_[305822185575]", + "Entity_[278299626583]", + "Entity_[282594593879]", + "Entity_[286889561175]", + "Entity_[291184528471]" + ] + }, + "Component_[1365196255752273753]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1365196255752273753 + }, + "Component_[280906579560376421]": { + "$type": "EditorLockComponent", + "Id": 280906579560376421 + }, + "Component_[4629965429001113748]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 4629965429001113748 + }, + "Component_[4876910656129741263]": { + "$type": "EditorEntityIconComponent", + "Id": 4876910656129741263 + }, + "Component_[5763306492614623496]": { + "$type": "EditorInspectorComponent", + "Id": 5763306492614623496, + "ComponentOrderEntryArray": [ + { + "ComponentId": 7514977506847036117 + } + ] + }, + "Component_[7327709568605458460]": { + "$type": "EditorVisibilityComponent", + "Id": 7327709568605458460 + }, + "Component_[7514977506847036117]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 7514977506847036117, + "Parent Entity": "ContainerEntity" + } + } + }, + "Entity_[278299626583]": { + "Id": "Entity_[278299626583]", + "Name": "AssetIDMatch", + "Components": { + "Component_[10285740519857855186]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 10285740519857855186 + }, + "Component_[11273731016303624898]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11273731016303624898, + "Parent Entity": "Entity_[274004659287]" + }, + "Component_[1136790983026972010]": { + "$type": "EditorVisibilityComponent", + "Id": 1136790983026972010 + }, + "Component_[12777313618328131055]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12777313618328131055 + }, + "Component_[13256044902558773795]": { + "$type": "EditorLockComponent", + "Id": 13256044902558773795 + }, + "Component_[15834551022302435776]": { + "$type": "EditorInspectorComponent", + "Id": 15834551022302435776, + "ComponentOrderEntryArray": [ + { + "ComponentId": 11273731016303624898 + }, + { + "ComponentId": 9671522714018290727, + "SortIndex": 1 + } + ] + }, + "Component_[16345420368214930095]": { + "$type": "SelectionComponent", + "Id": 16345420368214930095 + }, + "Component_[5309075942188429052]": { + "$type": "EditorEntitySortComponent", + "Id": 5309075942188429052 + }, + "Component_[8639731896786645938]": { + "$type": "EditorEntityIconComponent", + "Id": 8639731896786645938 + }, + "Component_[9844585173698551415]": { + "$type": "EditorOnlyEntityComponent", + "Id": 9844585173698551415 + } + } + }, + "Entity_[282594593879]": { + "Id": "Entity_[282594593879]", + "Name": "UUIDMatch", + "Components": { + "Component_[10379494986254888760]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 10379494986254888760 + }, + "Component_[10932830014545295552]": { + "$type": "SelectionComponent", + "Id": 10932830014545295552 + }, + "Component_[16077882919902242532]": { + "$type": "EditorEntitySortComponent", + "Id": 16077882919902242532 + }, + "Component_[2150375322459274584]": { + "$type": "EditorPendingCompositionComponent", + "Id": 2150375322459274584 + }, + "Component_[2645455411436465820]": { + "$type": "EditorEntityIconComponent", + "Id": 2645455411436465820 + }, + "Component_[5422214869037468733]": { + "$type": "EditorOnlyEntityComponent", + "Id": 5422214869037468733 + }, + "Component_[7238126895911071330]": { + "$type": "EditorInspectorComponent", + "Id": 7238126895911071330, + "ComponentOrderEntryArray": [ + { + "ComponentId": 8407607000804893064 + }, + { + "ComponentId": 12952323341649885242, + "SortIndex": 1 + } + ] + }, + "Component_[7981670269715131988]": { + "$type": "EditorVisibilityComponent", + "Id": 7981670269715131988 + }, + "Component_[8407607000804893064]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 8407607000804893064, + "Parent Entity": "Entity_[274004659287]" + }, + "Component_[8567641786004090803]": { + "$type": "EditorLockComponent", + "Id": 8567641786004090803 + } + } + }, + "Entity_[286889561175]": { + "Id": "Entity_[286889561175]", + "Name": "RelativeProductMatch", + "Components": { + "Component_[10180645282669228972]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 10180645282669228972, + "Parent Entity": "Entity_[274004659287]" + }, + "Component_[10200807690182688147]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 10200807690182688147 + }, + "Component_[11014661873645081316]": { + "$type": "EditorInspectorComponent", + "Id": 11014661873645081316, + "ComponentOrderEntryArray": [ + { + "ComponentId": 10180645282669228972 + }, + { + "ComponentId": 12869852248016369650, + "SortIndex": 1 + } + ] + }, + "Component_[12869852248016369650]": { + "$type": "{77CDE991-EC1A-B7C1-B112-7456ABAC81A1} EditorSpawnerComponent", + "Id": 12869852248016369650, + "Slice": { + "assetId": { + "guid": "{29F14025-3BD2-5CA9-A9DE-B8B349268C2F}", + "subId": 2 + }, + "assetHint": "slices/bullet.dynamicslice" + } + }, + "Component_[15136448544716183259]": { + "$type": "EditorOnlyEntityComponent", + "Id": 15136448544716183259 + }, + "Component_[15966001894874626764]": { + "$type": "SelectionComponent", + "Id": 15966001894874626764 + }, + "Component_[16167982631516160155]": { + "$type": "EditorEntityIconComponent", + "Id": 16167982631516160155 + }, + "Component_[16672905198052847867]": { + "$type": "EditorEntitySortComponent", + "Id": 16672905198052847867 + }, + "Component_[4506946122562404190]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4506946122562404190 + }, + "Component_[6836304267269231429]": { + "$type": "EditorLockComponent", + "Id": 6836304267269231429 + }, + "Component_[8756593519140349183]": { + "$type": "EditorVisibilityComponent", + "Id": 8756593519140349183 + } + } + }, + "Entity_[291184528471]": { + "Id": "Entity_[291184528471]", + "Name": "RelativeSourceMatch", + "Components": { + "Component_[11694027325905361034]": { + "$type": "EditorEntitySortComponent", + "Id": 11694027325905361034 + }, + "Component_[13891029613307790064]": { + "$type": "EditorEntityIconComponent", + "Id": 13891029613307790064 + }, + "Component_[15933511034411930900]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 15933511034411930900, + "Parent Entity": "Entity_[274004659287]" + }, + "Component_[17540827492846961803]": { + "$type": "EditorLockComponent", + "Id": 17540827492846961803 + }, + "Component_[2850297705939373458]": { + "$type": "SelectionComponent", + "Id": 2850297705939373458 + }, + "Component_[4809103331004345812]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4809103331004345812 + }, + "Component_[5654779331777839943]": { + "$type": "EditorInspectorComponent", + "Id": 5654779331777839943, + "ComponentOrderEntryArray": [ + { + "ComponentId": 15933511034411930900 + }, + { + "ComponentId": 10284025539900054207, + "SortIndex": 1 + } + ] + }, + "Component_[6097019179005900386]": { + "$type": "EditorVisibilityComponent", + "Id": 6097019179005900386 + }, + "Component_[7748387730313625157]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 7748387730313625157 + }, + "Component_[9822265453841229082]": { + "$type": "EditorOnlyEntityComponent", + "Id": 9822265453841229082 + } + } + }, + "Entity_[297232250983]": { + "Id": "Entity_[297232250983]", + "Name": "1151F14D38A65579888ABE3139882E68:[0]", + "Components": { + "Component_[11936148741777754959]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 11936148741777754959 + }, + "Component_[12610073699988743015]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 12610073699988743015, + "Parent Entity": "Entity_[305822185575]" + }, + "Component_[1603205169722765279]": { + "$type": "EditorLockComponent", + "Id": 1603205169722765279 + }, + "Component_[17691206348057560715]": { + "$type": "EditorPendingCompositionComponent", + "Id": 17691206348057560715 + }, + "Component_[2711821203680330048]": { + "$type": "SelectionComponent", + "Id": 2711821203680330048 + }, + "Component_[3887480309311474860]": { + "$type": "EditorVisibilityComponent", + "Id": 3887480309311474860 + }, + "Component_[5853968883842282450]": { + "$type": "EditorEntityIconComponent", + "Id": 5853968883842282450 + }, + "Component_[7679080692843343453]": { + "$type": "EditorCommentComponent", + "Id": 7679080692843343453, + "Configuration": "Asset ID that matches an existing dependency of this asset (am_grass1.mtl)" + }, + "Component_[8024752235278898687]": { + "$type": "EditorOnlyEntityComponent", + "Id": 8024752235278898687 + }, + "Component_[8373296084678231042]": { + "$type": "EditorEntitySortComponent", + "Id": 8373296084678231042 + }, + "Component_[9782967158965587831]": { + "$type": "EditorInspectorComponent", + "Id": 9782967158965587831, + "ComponentOrderEntryArray": [ + { + "ComponentId": 12610073699988743015 + }, + { + "ComponentId": 7679080692843343453, + "SortIndex": 1 + } + ] + } + } + }, + "Entity_[301527218279]": { + "Id": "Entity_[301527218279]", + "Name": "Slices/bullet.dynamicslice", + "Components": { + "Component_[15613078542630153866]": { + "$type": "EditorInspectorComponent", + "Id": 15613078542630153866, + "ComponentOrderEntryArray": [ + { + "ComponentId": 2483032678718995164 + }, + { + "ComponentId": 9734604379060902193, + "SortIndex": 1 + } + ] + }, + "Component_[16098942854900817264]": { + "$type": "SelectionComponent", + "Id": 16098942854900817264 + }, + "Component_[16720139961856477500]": { + "$type": "EditorEntitySortComponent", + "Id": 16720139961856477500 + }, + "Component_[2483032678718995164]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 2483032678718995164, + "Parent Entity": "Entity_[305822185575]" + }, + "Component_[2502984783426127018]": { + "$type": "EditorLockComponent", + "Id": 2502984783426127018 + }, + "Component_[46714013890147210]": { + "$type": "EditorOnlyEntityComponent", + "Id": 46714013890147210 + }, + "Component_[4907474530744780429]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 4907474530744780429 + }, + "Component_[5420332829198300813]": { + "$type": "EditorPendingCompositionComponent", + "Id": 5420332829198300813 + }, + "Component_[7683578164681693579]": { + "$type": "EditorEntityIconComponent", + "Id": 7683578164681693579 + }, + "Component_[8312115250363172310]": { + "$type": "EditorVisibilityComponent", + "Id": 8312115250363172310 + }, + "Component_[9734604379060902193]": { + "$type": "EditorCommentComponent", + "Id": 9734604379060902193, + "Configuration": "Relative product path that matches an existing dependency of this asset" + } + } + }, + "Entity_[305822185575]": { + "Id": "Entity_[305822185575]", + "Name": "AssetReferences", + "Components": { + "Component_[13422135993444528172]": { + "$type": "EditorPendingCompositionComponent", + "Id": 13422135993444528172 + }, + "Component_[13988015667379021413]": { + "$type": "EditorLockComponent", + "Id": 13988015667379021413 + }, + "Component_[14885956487876614434]": { + "$type": "EditorVisibilityComponent", + "Id": 14885956487876614434 + }, + "Component_[15550715415947731915]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 15550715415947731915 + }, + "Component_[2576266145980379805]": { + "$type": "EditorInspectorComponent", + "Id": 2576266145980379805, + "ComponentOrderEntryArray": [ + { + "ComponentId": 3176911836967955668 + }, + { + "ComponentId": 836721549453007197, + "SortIndex": 1 + } + ] + }, + "Component_[3176911836967955668]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3176911836967955668, + "Parent Entity": "Entity_[274004659287]" + }, + "Component_[5613459137294642234]": { + "$type": "SelectionComponent", + "Id": 5613459137294642234 + }, + "Component_[6400873582148097152]": { + "$type": "EditorEntityIconComponent", + "Id": 6400873582148097152 + }, + "Component_[684670817803453913]": { + "$type": "EditorEntitySortComponent", + "Id": 684670817803453913, + "Child Entity Order": [ + "Entity_[323002054759]", + "Entity_[327297022055]", + "Entity_[301527218279]", + "Entity_[318707087463]", + "Entity_[297232250983]", + "Entity_[314412120167]", + "Entity_[331591989351]", + "Entity_[310117152871]" + ] + }, + "Component_[8118206464926826097]": { + "$type": "EditorOnlyEntityComponent", + "Id": 8118206464926826097 + }, + "Component_[836721549453007197]": { + "$type": "EditorCommentComponent", + "Id": 836721549453007197, + "Configuration": "Entity names are used to trigger the missing dependency scanner. Comments are stripped from dynamic slices." + } + } + }, + "Entity_[310117152871]": { + "Id": "Entity_[310117152871]", + "Name": "Materials/FakeMaterial.mtl", + "Components": { + "Component_[10593857511582714674]": { + "$type": "EditorInspectorComponent", + "Id": 10593857511582714674, + "ComponentOrderEntryArray": [ + { + "ComponentId": 11797216659359478300 + }, + { + "ComponentId": 13816702107134233983, + "SortIndex": 1 + } + ] + }, + "Component_[11797216659359478300]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11797216659359478300, + "Parent Entity": "Entity_[305822185575]" + }, + "Component_[13816702107134233983]": { + "$type": "EditorCommentComponent", + "Id": 13816702107134233983, + "Configuration": "Invalid path that does not match an existing dependency of this asset" + }, + "Component_[14868583012186337705]": { + "$type": "EditorOnlyEntityComponent", + "Id": 14868583012186337705 + }, + "Component_[14965348027145283648]": { + "$type": "EditorEntitySortComponent", + "Id": 14965348027145283648 + }, + "Component_[15075774238648121688]": { + "$type": "EditorEntityIconComponent", + "Id": 15075774238648121688 + }, + "Component_[16157883709857447266]": { + "$type": "EditorLockComponent", + "Id": 16157883709857447266 + }, + "Component_[17712080510249108208]": { + "$type": "EditorVisibilityComponent", + "Id": 17712080510249108208 + }, + "Component_[2247408514677946398]": { + "$type": "SelectionComponent", + "Id": 2247408514677946398 + }, + "Component_[5565369976544134481]": { + "$type": "EditorPendingCompositionComponent", + "Id": 5565369976544134481 + }, + "Component_[6044814215558788086]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 6044814215558788086 + } + } + }, + "Entity_[314412120167]": { + "Id": "Entity_[314412120167]", + "Name": "88888888-4444-4444-4444-CCCCCCCCCCCC", + "Components": { + "Component_[10072177500579430176]": { + "$type": "EditorLockComponent", + "Id": 10072177500579430176 + }, + "Component_[10853215476279564671]": { + "$type": "EditorCommentComponent", + "Id": 10853215476279564671, + "Configuration": "UUID that does not exist" + }, + "Component_[13413154971272749631]": { + "$type": "SelectionComponent", + "Id": 13413154971272749631 + }, + "Component_[15316173756367163440]": { + "$type": "EditorInspectorComponent", + "Id": 15316173756367163440, + "ComponentOrderEntryArray": [ + { + "ComponentId": 3266728630359207653 + }, + { + "ComponentId": 10853215476279564671, + "SortIndex": 1 + } + ] + }, + "Component_[15809307959802829291]": { + "$type": "EditorEntitySortComponent", + "Id": 15809307959802829291 + }, + "Component_[17649652752752487081]": { + "$type": "EditorEntityIconComponent", + "Id": 17649652752752487081 + }, + "Component_[2130036493438440377]": { + "$type": "EditorPendingCompositionComponent", + "Id": 2130036493438440377 + }, + "Component_[3266728630359207653]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3266728630359207653, + "Parent Entity": "Entity_[305822185575]" + }, + "Component_[5892125564582966187]": { + "$type": "EditorVisibilityComponent", + "Id": 5892125564582966187 + }, + "Component_[597602776660257245]": { + "$type": "EditorOnlyEntityComponent", + "Id": 597602776660257245 + }, + "Component_[8238652007701465495]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8238652007701465495 + } + } + }, + "Entity_[318707087463]": { + "Id": "Entity_[318707087463]", + "Name": "BBA1A5494C73578894BF0692CDA5FC33", + "Components": { + "Component_[10222455787643359341]": { + "$type": "EditorPendingCompositionComponent", + "Id": 10222455787643359341 + }, + "Component_[11487845392038268864]": { + "$type": "SelectionComponent", + "Id": 11487845392038268864 + }, + "Component_[12135534290310046764]": { + "$type": "EditorVisibilityComponent", + "Id": 12135534290310046764 + }, + "Component_[14412623226519978498]": { + "$type": "EditorOnlyEntityComponent", + "Id": 14412623226519978498 + }, + "Component_[14516371382857751872]": { + "$type": "EditorEntityIconComponent", + "Id": 14516371382857751872 + }, + "Component_[16011611743122468576]": { + "$type": "EditorInspectorComponent", + "Id": 16011611743122468576, + "ComponentOrderEntryArray": [ + { + "ComponentId": 4157328932578509254 + }, + { + "ComponentId": 8524796860605854850, + "SortIndex": 1 + } + ] + }, + "Component_[3813931698067937301]": { + "$type": "EditorEntitySortComponent", + "Id": 3813931698067937301 + }, + "Component_[4157328932578509254]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 4157328932578509254, + "Parent Entity": "Entity_[305822185575]" + }, + "Component_[8524796860605854850]": { + "$type": "EditorCommentComponent", + "Id": 8524796860605854850, + "Configuration": "UUID that matches an existing dependency of this asset (lumbertank_body.cgf)" + }, + "Component_[8660819596448699427]": { + "$type": "EditorLockComponent", + "Id": 8660819596448699427 + }, + "Component_[8768262795169819026]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8768262795169819026 + } + } + }, + "Entity_[323002054759]": { + "Id": "Entity_[323002054759]", + "Name": "Materials/am_rockground.mtl", + "Components": { + "Component_[13459503224133892836]": { + "$type": "EditorEntityIconComponent", + "Id": 13459503224133892836 + }, + "Component_[1346698328271204385]": { + "$type": "EditorVisibilityComponent", + "Id": 1346698328271204385 + }, + "Component_[13662830241397426219]": { + "$type": "SelectionComponent", + "Id": 13662830241397426219 + }, + "Component_[14169735046939083706]": { + "$type": "EditorInspectorComponent", + "Id": 14169735046939083706, + "ComponentOrderEntryArray": [ + { + "ComponentId": 833157791612452820 + }, + { + "ComponentId": 3573928838741352115, + "SortIndex": 1 + } + ] + }, + "Component_[16049700338512950477]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 16049700338512950477 + }, + "Component_[16191253524853449302]": { + "$type": "EditorOnlyEntityComponent", + "Id": 16191253524853449302 + }, + "Component_[1737139665005484521]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1737139665005484521 + }, + "Component_[17562284119637289685]": { + "$type": "EditorEntitySortComponent", + "Id": 17562284119637289685 + }, + "Component_[3573928838741352115]": { + "$type": "EditorCommentComponent", + "Id": 3573928838741352115, + "Configuration": "Relative source path that matches an existing dependency of this asset" + }, + "Component_[485401015869338526]": { + "$type": "EditorLockComponent", + "Id": 485401015869338526 + }, + "Component_[833157791612452820]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 833157791612452820, + "Parent Entity": "Entity_[305822185575]" + } + } + }, + "Entity_[327297022055]": { + "Id": "Entity_[327297022055]", + "Name": "Config/Game.xml", + "Components": { + "Component_[11848260632907964142]": { + "$type": "EditorInspectorComponent", + "Id": 11848260632907964142, + "ComponentOrderEntryArray": [ + { + "ComponentId": 497869813123895830 + }, + { + "ComponentId": 5248857300320701553, + "SortIndex": 1 + } + ] + }, + "Component_[12842864953492512672]": { + "$type": "EditorEntitySortComponent", + "Id": 12842864953492512672 + }, + "Component_[16656501539883791157]": { + "$type": "EditorLockComponent", + "Id": 16656501539883791157 + }, + "Component_[17365661125603122123]": { + "$type": "EditorEntityIconComponent", + "Id": 17365661125603122123 + }, + "Component_[2967487135389707052]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 2967487135389707052 + }, + "Component_[3356294263684362888]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3356294263684362888 + }, + "Component_[497869813123895830]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 497869813123895830, + "Parent Entity": "Entity_[305822185575]" + }, + "Component_[5248857300320701553]": { + "$type": "EditorCommentComponent", + "Id": 5248857300320701553, + "Configuration": "Valid path that does not match an existing dependency of this asset. Should report as a missing dependency" + }, + "Component_[746309483212393367]": { + "$type": "SelectionComponent", + "Id": 746309483212393367 + }, + "Component_[8319831469290771470]": { + "$type": "EditorPendingCompositionComponent", + "Id": 8319831469290771470 + }, + "Component_[9369067377618608622]": { + "$type": "EditorVisibilityComponent", + "Id": 9369067377618608622 + } + } + }, + "Entity_[331591989351]": { + "Id": "Entity_[331591989351]", + "Name": "1151F14D38A65579888ABE3139882E68:[333]", + "Components": { + "Component_[104857639379046106]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 104857639379046106, + "Parent Entity": "Entity_[305822185575]" + }, + "Component_[1061601983221247493]": { + "$type": "EditorLockComponent", + "Id": 1061601983221247493 + }, + "Component_[11028443253330664986]": { + "$type": "EditorVisibilityComponent", + "Id": 11028443253330664986 + }, + "Component_[13806275118632081006]": { + "$type": "EditorEntitySortComponent", + "Id": 13806275118632081006 + }, + "Component_[13922573109551604801]": { + "$type": "EditorEntityIconComponent", + "Id": 13922573109551604801 + }, + "Component_[17027032709917108335]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 17027032709917108335 + }, + "Component_[17030988165269698825]": { + "$type": "EditorOnlyEntityComponent", + "Id": 17030988165269698825 + }, + "Component_[2294579021665535860]": { + "$type": "EditorPendingCompositionComponent", + "Id": 2294579021665535860 + }, + "Component_[5863078697041048226]": { + "$type": "EditorInspectorComponent", + "Id": 5863078697041048226, + "ComponentOrderEntryArray": [ + { + "ComponentId": 104857639379046106 + }, + { + "ComponentId": 9466290982672370664, + "SortIndex": 1 + } + ] + }, + "Component_[7608263859116142496]": { + "$type": "SelectionComponent", + "Id": 7608263859116142496 + }, + "Component_[9466290982672370664]": { + "$type": "EditorCommentComponent", + "Id": 9466290982672370664, + "Configuration": "Asset ID that does not exist (am_grass1.mtl UUID, no matching product ID)" + } + } + } + } +} \ No newline at end of file From 105524b7c05409c174a27e5511d9ff612e602b26 Mon Sep 17 00:00:00 2001 From: AMZN-Phil Date: Wed, 15 Dec 2021 09:29:40 -0800 Subject: [PATCH 141/948] Add a missing comma to fix generator Signed-off-by: AMZN-Phil --- .../Platform/Windows/ProjectBuilderWorker_windows.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Tools/ProjectManager/Platform/Windows/ProjectBuilderWorker_windows.cpp b/Code/Tools/ProjectManager/Platform/Windows/ProjectBuilderWorker_windows.cpp index 79258d83ea..e355c65762 100644 --- a/Code/Tools/ProjectManager/Platform/Windows/ProjectBuilderWorker_windows.cpp +++ b/Code/Tools/ProjectManager/Platform/Windows/ProjectBuilderWorker_windows.cpp @@ -19,7 +19,7 @@ namespace O3DE::ProjectManager QString targetBuildPath = QDir(m_projectInfo.m_path).filePath(ProjectBuildPathPostfix); return AZ::Success(QStringList{ ProjectCMakeCommand, - "-G", "Visual Studio 16 2019" + "-G", "Visual Studio 16 2019", "-B", targetBuildPath, "-S", m_projectInfo.m_path, QString("-DLY_3RDPARTY_PATH=").append(thirdPartyPath), From c019fe8946269e581683c383966651a81c5f9d38 Mon Sep 17 00:00:00 2001 From: Mike Chang Date: Thu, 2 Dec 2021 17:05:42 -0800 Subject: [PATCH 142/948] Add conditional to pull O3DE_BUILD_VERSION through environment var (#6096) Signed-off-by: Mike Chang --- cmake/Version.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/Version.cmake b/cmake/Version.cmake index de93ebefef..c5504ec62a 100644 --- a/cmake/Version.cmake +++ b/cmake/Version.cmake @@ -16,3 +16,8 @@ if("$ENV{O3DE_VERSION}") # Overriding through environment set(LY_VERSION_STRING "$ENV{O3DE_VERSION}") endif() + +if("$ENV{O3DE_BUILD_VERSION}") + # Overriding through environment + set(LY_VERSION_BUILD_NUMBER "$ENV{O3DE_BUILD_VERSION}") +endif() From f44697fbf45b6288d9f2995cd43b2cef4927b9dc Mon Sep 17 00:00:00 2001 From: AMZN-Phil Date: Tue, 7 Dec 2021 14:05:05 -0800 Subject: [PATCH 143/948] Check whether env variables are defined Signed-off-by: AMZN-Phil --- cmake/Version.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/Version.cmake b/cmake/Version.cmake index c5504ec62a..6fa32e9c73 100644 --- a/cmake/Version.cmake +++ b/cmake/Version.cmake @@ -12,12 +12,12 @@ set(LY_VERSION_STRING "0.0.0.0" CACHE STRING "Open 3D Engine's version") set(LY_VERSION_BUILD_NUMBER 0 CACHE STRING "Open 3D Engine's build number") set(LY_VERSION_ENGINE_NAME "o3de" CACHE STRING "Open 3D Engine's engine name") -if("$ENV{O3DE_VERSION}") +if(DEFINED ENV{O3DE_VERSION}) # Overriding through environment set(LY_VERSION_STRING "$ENV{O3DE_VERSION}") endif() -if("$ENV{O3DE_BUILD_VERSION}") +if(DEFINED ENV{O3DE_BUILD_VERSION}) # Overriding through environment set(LY_VERSION_BUILD_NUMBER "$ENV{O3DE_BUILD_VERSION}") endif() From 38c8d941564ae709a7839a25883807b723fa4657 Mon Sep 17 00:00:00 2001 From: AMZN-Phil Date: Tue, 7 Dec 2021 15:12:11 -0800 Subject: [PATCH 144/948] Use version check to allow for a defined empty string to fail and greater to check build number is a number greater than 0 Signed-off-by: AMZN-Phil --- cmake/Version.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/Version.cmake b/cmake/Version.cmake index 6fa32e9c73..d15d5b9f86 100644 --- a/cmake/Version.cmake +++ b/cmake/Version.cmake @@ -12,12 +12,12 @@ set(LY_VERSION_STRING "0.0.0.0" CACHE STRING "Open 3D Engine's version") set(LY_VERSION_BUILD_NUMBER 0 CACHE STRING "Open 3D Engine's build number") set(LY_VERSION_ENGINE_NAME "o3de" CACHE STRING "Open 3D Engine's engine name") -if(DEFINED ENV{O3DE_VERSION}) +if("$ENV{O3DE_VERSION}" VERSION_GREATER "0.0.0.0") # Overriding through environment set(LY_VERSION_STRING "$ENV{O3DE_VERSION}") endif() -if(DEFINED ENV{O3DE_BUILD_VERSION}) +if("$ENV{O3DE_BUILD_VERSION}" GREATER 0) # Overriding through environment set(LY_VERSION_BUILD_NUMBER "$ENV{O3DE_BUILD_VERSION}") endif() From 82af1e6870ba7f8e705d5f0559591ce42fa57384 Mon Sep 17 00:00:00 2001 From: AMZN-Phil Date: Tue, 7 Dec 2021 17:10:26 -0800 Subject: [PATCH 145/948] Force a string check on the version numbers Signed-off-by: AMZN-Phil --- cmake/Version.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/Version.cmake b/cmake/Version.cmake index d15d5b9f86..876c34f8c4 100644 --- a/cmake/Version.cmake +++ b/cmake/Version.cmake @@ -12,12 +12,12 @@ set(LY_VERSION_STRING "0.0.0.0" CACHE STRING "Open 3D Engine's version") set(LY_VERSION_BUILD_NUMBER 0 CACHE STRING "Open 3D Engine's build number") set(LY_VERSION_ENGINE_NAME "o3de" CACHE STRING "Open 3D Engine's engine name") -if("$ENV{O3DE_VERSION}" VERSION_GREATER "0.0.0.0") +if(NOT "$ENV{O3DE_VERSION}" STREQUAL "") # Overriding through environment set(LY_VERSION_STRING "$ENV{O3DE_VERSION}") endif() -if("$ENV{O3DE_BUILD_VERSION}" GREATER 0) +if(NOT "$ENV{O3DE_BUILD_VERSION}" STREQUAL "") # Overriding through environment set(LY_VERSION_BUILD_NUMBER "$ENV{O3DE_BUILD_VERSION}") endif() From 352b4ab6907eb9bf7890bd4670c34a1781d12409 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Wed, 15 Dec 2021 10:23:58 -0800 Subject: [PATCH 146/948] Make DomValue final Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index ecaea3db3d..1b69c73ecc 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -147,7 +147,7 @@ namespace AZ::Dom //! value itself (objects, arrays, and nodes) are copied by new Values only when their contents change, so care should be taken in //! performance critical code to avoid mutation operations such as operator[] to avoid copies. It is recommended that an immutable Value //! be explicitly be stored as a `const Value` to avoid accidental detach and copy operations. - class Value + class Value final { public: // Constructors... From 024c53ece39b183d93ef3e57dee96d515e5bf090 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Wed, 15 Dec 2021 10:24:32 -0800 Subject: [PATCH 147/948] untested fix for object stream version bug Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../Code/Editor/Components/EditorScriptCanvasComponent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index be5d467f44..1f08207a48 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -157,7 +157,7 @@ namespace ScriptCanvasEditor auto assetId = assetHolder.m_scriptCanvasAsset.GetId(); auto path = assetHolder.m_scriptCanvasAsset.GetHint(); - if (!rootElement.AddElementWithData(serializeContext, "runtimeDataOverrides", SourceHandle(nullptr, assetId.m_guid, path))) + if (!rootElement.AddElementWithData(serializeContext, "sourceHandle", SourceHandle(nullptr, assetId.m_guid, path))) { AZ_Error("ScriptCanvas", false, "EditorScriptCanvasComponent conversion failed: failed to add 'sourceHandle'"); return false; From 797af76f0e1f5f13f2191c7f1776474af659cb89 Mon Sep 17 00:00:00 2001 From: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> Date: Wed, 15 Dec 2021 12:08:11 -0700 Subject: [PATCH 148/948] Minor changes to DiffuseProbeGridDownsamplePass Signed-off-by: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> --- .../DiffuseProbeGridDownsamplePass.cpp | 13 ++++++++++++- .../DiffuseProbeGridDownsamplePass.h | 3 ++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridDownsamplePass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridDownsamplePass.cpp index 2a11218b47..e00213c524 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridDownsamplePass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridDownsamplePass.cpp @@ -27,8 +27,19 @@ namespace AZ bool DiffuseProbeGridDownsamplePass::IsEnabled() const { + if (!Base::IsEnabled()) + { + return false; + } + + RPI::Scene* scene = m_pipeline->GetScene(); + if (!scene) + { + return false; + } + // only enabled if there are DiffuseProbeGrids present in the scene - DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = m_pipeline->GetScene()->GetFeatureProcessor(); + DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); return (diffuseProbeGridFeatureProcessor && !diffuseProbeGridFeatureProcessor->GetProbeGrids().empty()); } diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridDownsamplePass.h b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridDownsamplePass.h index 283c758c76..de5a981fa1 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridDownsamplePass.h +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridDownsamplePass.h @@ -18,10 +18,11 @@ namespace AZ class DiffuseProbeGridDownsamplePass : public RPI::FullscreenTrianglePass { + using Base = RPI::FullscreenTrianglePass; AZ_RPI_PASS(DiffuseProbeGridDownsamplePass); public: - AZ_RTTI(Render::DiffuseProbeGridDownsamplePass, "{B3331B68-F974-44D6-806B-2CFFB4B6B563}", FullscreenTrianglePass); + AZ_RTTI(Render::DiffuseProbeGridDownsamplePass, "{B3331B68-F974-44D6-806B-2CFFB4B6B563}", Base); AZ_CLASS_ALLOCATOR(Render::DiffuseProbeGridDownsamplePass, SystemAllocator, 0); //! Creates a new pass without a PassTemplate From 1fdee48b6d86d1a11d6674014696cace21377e2d Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Wed, 15 Dec 2021 11:08:23 -0800 Subject: [PATCH 149/948] fix Linux build error Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../Code/Editor/Components/EditorScriptCanvasComponent.cpp | 7 +++++-- .../ScriptCanvas/Components/EditorDeprecationData.cpp | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index 1f08207a48..bb9e829bf5 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -145,10 +145,13 @@ namespace ScriptCanvasEditor } } - if (rootElement.GetVersion() < EditorScriptCanvasComponentCpp::Version::AddSourceHandle) + auto scriptCanvasAssetHolderElementIndex = rootElement.FindElement(AZ_CRC_CE("m_assetHolder")); + if (scriptCanvasAssetHolderElementIndex != -1) { + auto& scriptCanvasAssetHolderElement = rootElement.GetSubElement(scriptCanvasAssetHolderElementIndex); Deprecated::ScriptCanvasAssetHolder assetHolder; - if (!rootElement.FindSubElementAndGetData(AZ_CRC_CE("m_assetHolder"), assetHolder)) + + if (!scriptCanvasAssetHolderElement.GetData(assetHolder)) { AZ_Error("ScriptCanvas", false, "EditorScriptCanvasComponent conversion failed: could not retrieve old 'm_assetHolder'"); return false; diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorDeprecationData.cpp b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorDeprecationData.cpp index 635f6e09e9..e94ef68234 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorDeprecationData.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorDeprecationData.cpp @@ -10,6 +10,7 @@ #include #include +#include namespace ScriptCanvasEditor { From 411674e8fcefaf16b97b8483c4e986c3ce53820a Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Wed, 15 Dec 2021 16:51:14 -0800 Subject: [PATCH 150/948] chore[EmotionFX]: replace usage of SafeNormalize ref: https://github.com/o3de/o3de/pull/6433 Signed-off-by: Michael Pollind --- .../EMotionFX/Rendering/Common/RenderUtil.cpp | 2 +- .../EMotionFX/Source/BlendTreeFootIKNode.cpp | 4 ++-- .../EMotionFX/Source/BlendTreeTwoLinkIKNode.cpp | 17 ++++++++--------- Gems/EMotionFX/Code/EMotionFX/Source/Mesh.cpp | 16 ++++++++-------- 4 files changed, 19 insertions(+), 20 deletions(-) diff --git a/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/RenderUtil.cpp b/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/RenderUtil.cpp index 6fd28ee72f..0ebaf8bfee 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/RenderUtil.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/RenderUtil.cpp @@ -688,7 +688,7 @@ namespace MCommon const AZ::Vector3 nodeWorldPos = pose->GetWorldSpaceTransform(jointIndex).m_position; const AZ::Vector3 parentWorldPos = pose->GetWorldSpaceTransform(parentIndex).m_position; const AZ::Vector3 bone = parentWorldPos - nodeWorldPos; - const AZ::Vector3 boneDirection = MCore::SafeNormalize(bone); + const AZ::Vector3 boneDirection = bone.GetNormalizedSafe(); const float boneLength = MCore::SafeLength(bone); const float boneScale = GetBoneScale(actorInstance, joint); const float parentBoneScale = GetBoneScale(actorInstance, skeleton->GetNode(parentIndex)); diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeFootIKNode.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeFootIKNode.cpp index d81b090300..25fcfa7193 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeFootIKNode.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeFootIKNode.cpp @@ -258,9 +258,9 @@ namespace EMotionFX // Calculate the matrix to rotate the solve plane. void BlendTreeFootIKNode::CalculateMatrix(const AZ::Vector3& goal, const AZ::Vector3& bendDir, AZ::Matrix3x3* outForward) { - const AZ::Vector3 x = MCore::SafeNormalize(goal); + const AZ::Vector3 x = goal.GetNormalizedSafe(); const float dot = bendDir.Dot(x); - const AZ::Vector3 y = MCore::SafeNormalize(bendDir - (dot * x)); + const AZ::Vector3 y = (bendDir - (dot * x)).GetNormalizedSafe(); const AZ::Vector3 z = x.Cross(y); outForward->SetRow(0, x); outForward->SetRow(1, y); diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeTwoLinkIKNode.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeTwoLinkIKNode.cpp index 9a91a59390..ec9d69c68a 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeTwoLinkIKNode.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeTwoLinkIKNode.cpp @@ -189,11 +189,11 @@ namespace EMotionFX void BlendTreeTwoLinkIKNode::CalculateMatrix(const AZ::Vector3& goal, const AZ::Vector3& bendDir, AZ::Matrix3x3* outForward) { // the inverse matrix defines a coordinate system whose x axis contains P, so X = unit(P). - const AZ::Vector3 x = MCore::SafeNormalize(goal); + const AZ::Vector3 x = goal.GetNormalizedSafe(); // the y axis of the inverse is perpendicular to P, so Y = unit( D - X(D . X) ). const float dot = bendDir.Dot(x); - const AZ::Vector3 y = MCore::SafeNormalize(bendDir - (dot * x)); + const AZ::Vector3 y = (bendDir - (dot * x)).GetNormalizedSafe(); // the z axis of the inverse is perpendicular to both X and Y, so Z = X x Y. const AZ::Vector3 z = x.Cross(y); @@ -372,11 +372,11 @@ namespace EMotionFX if (m_relativeBendDir && !m_extractBendDir) { bendDir = actorInstance->GetWorldSpaceTransform().m_rotation.TransformVector(bendDir); - bendDir = MCore::SafeNormalize(bendDir); + bendDir.NormalizeSafe(); } else { - bendDir = MCore::SafeNormalize(bendDir); + bendDir.NormalizeSafe(); } // if end node rotation is enabled @@ -470,8 +470,8 @@ namespace EMotionFX // calculate the differences between the current forward vector and the new one after IK AZ::Vector3 oldForward = globalTransformB.m_position - globalTransformA.m_position; AZ::Vector3 newForward = midPos - globalTransformA.m_position; - oldForward = MCore::SafeNormalize(oldForward); - newForward = MCore::SafeNormalize(newForward); + oldForward.NormalizeSafe(); + newForward.NormalizeSafe(); // perform a delta rotation to rotate into the new direction after IK float dotProduct = oldForward.Dot(newForward); @@ -499,9 +499,8 @@ namespace EMotionFX oldForward = endEffectorNodePos - globalTransformB.m_position; } - oldForward = MCore::SafeNormalize(oldForward); - newForward = goal - globalTransformB.m_position; - newForward = MCore::SafeNormalize(newForward); + oldForward.NormalizeSafe(); + newForward = (goal - globalTransformB.m_position).GetNormalizedSafe(); // calculate the delta rotation dotProduct = oldForward.Dot(newForward); diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/Mesh.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/Mesh.cpp index 9845ec1939..9130636e2a 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/Mesh.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/Mesh.cpp @@ -581,8 +581,8 @@ namespace EMotionFX &curTangent, &curBitangent); // normalize the vectors - curTangent = MCore::SafeNormalize(curTangent); - curBitangent = MCore::SafeNormalize(curBitangent); + curTangent.NormalizeSafe(); + curBitangent.NormalizeSafe(); // store the tangents in the orgTangents array const AZ::Vector4 vec4Tangent(curTangent.GetX(), curTangent.GetY(), curTangent.GetZ(), 1.0f); @@ -605,7 +605,7 @@ namespace EMotionFX { // get the normal AZ::Vector3 normal(normals[i]); - normal = MCore::SafeNormalize(normal); + normal.NormalizeSafe(); // get the tangent AZ::Vector3 tangent = AZ::Vector3(orgTangents[i].GetX(), orgTangents[i].GetY(), orgTangents[i].GetZ()); @@ -631,7 +631,7 @@ namespace EMotionFX // Gram-Schmidt orthogonalize AZ::Vector3 fixedTangent = tangent - (normal * normal.Dot(tangent)); - fixedTangent = MCore::SafeNormalize(fixedTangent); + fixedTangent.NormalizeSafe(); // calculate handedness const AZ::Vector3 crossResult = normal.Cross(tangent); @@ -1671,7 +1671,7 @@ namespace EMotionFX const AZ::Vector3& posA = positions[ indexA ]; const AZ::Vector3& posB = positions[ indexB ]; const AZ::Vector3& posC = positions[ indexC ]; - AZ::Vector3 faceNormal = MCore::SafeNormalize((posB - posA).Cross(posC - posB)); + AZ::Vector3 faceNormal = (posB - posA).Cross(posC - posB).GetNormalizedSafe(); // store the tangents in the orgTangents array smoothNormals[ orgVerts[indexA] ] += faceNormal; @@ -1684,7 +1684,7 @@ namespace EMotionFX // normalize for (uint32 i = 0; i < m_numOrgVerts; ++i) { - smoothNormals[i] = MCore::SafeNormalize(smoothNormals[i]); + smoothNormals[i].NormalizeSafe(); } for (uint32 i = 0; i < m_numVertices; ++i) @@ -1721,7 +1721,7 @@ namespace EMotionFX const AZ::Vector3& posA = positions[ indexA ]; const AZ::Vector3& posB = positions[ indexB ]; const AZ::Vector3& posC = positions[ indexC ]; - AZ::Vector3 faceNormal = MCore::SafeNormalize((posB - posA).Cross(posC - posB)); + AZ::Vector3 faceNormal = (posB - posA).Cross(posC - posB).GetNormalizedSafe(); // store the tangents in the orgTangents array normals[indexA] = normals[indexA] + faceNormal; @@ -1734,7 +1734,7 @@ namespace EMotionFX // normalize the normals for (uint32 i = 0; i < m_numVertices; ++i) { - normals[i] = MCore::SafeNormalize(normals[i]); + normals[i].NormalizeSafe(); } } } From 68c756b6f45864416d7f12ebf71be368602e0116 Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Wed, 15 Dec 2021 17:02:50 -0800 Subject: [PATCH 151/948] mark duplicate methods under MCore::Vector as deprecated Signed-off-by: Michael Pollind --- Gems/EMotionFX/Code/MCore/Source/Vector.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Gems/EMotionFX/Code/MCore/Source/Vector.h b/Gems/EMotionFX/Code/MCore/Source/Vector.h index 3f5765762c..d904efcaaa 100644 --- a/Gems/EMotionFX/Code/MCore/Source/Vector.h +++ b/Gems/EMotionFX/Code/MCore/Source/Vector.h @@ -17,12 +17,14 @@ namespace MCore { + //! @deprecated Use AZ::Vector3::NormalizeSafeWithLength() inline float SafeLength(const AZ::Vector3& rhs) { const float lenSq = rhs.Dot(rhs); return (lenSq > FLT_EPSILON) ? sqrtf(lenSq) : 0.0f; } + //! @deprecated Use AZ::Vector3::GetNormalizedSafe() inline AZ::Vector3 SafeNormalize(const AZ::Vector3& rhs) { AZ::Vector3 result(0.0f); @@ -43,6 +45,7 @@ namespace MCore return AZ::Vector3(vec.GetX() - fac * n.GetX(), vec.GetY() - fac * n.GetY(), vec.GetZ() - fac * n.GetZ()); } + //! @deprecated Use AZ::Vector3::Project() MCORE_INLINE AZ::Vector3 Projected(const AZ::Vector3& vec, const AZ::Vector3& projectOnto) { AZ::Vector3 result = projectOnto; @@ -60,6 +63,7 @@ namespace MCore (MCore::Math::Abs(val.GetX() - val.GetZ()) < MCore::Math::epsilon)); } + //! @deprecated Use AZ::Vector3::Lerp() template <> MCORE_INLINE AZ::Vector3 LinearInterpolate(const AZ::Vector3& source, const AZ::Vector3& target, float timeValue) { From 0a8ba357382fc87040444278910b80c32fb668a8 Mon Sep 17 00:00:00 2001 From: antonmic <56370189+antonmic@users.noreply.github.com> Date: Wed, 15 Dec 2021 18:32:59 -0800 Subject: [PATCH 152/948] Added ClearPass and automatic instantiation from ParentPass for slots specifying a clear action Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com> --- .../Feature/Common/Assets/Passes/Clear.pass | 30 ++++++++++ .../Assets/Passes/PassTemplates.azasset | 4 ++ .../Passes/SMAA1xApplyLinearHDRColor.pass | 5 +- .../Passes/SMAA1xApplyPerceptualColor.pass | 5 +- .../atom_feature_common_asset_files.cmake | 4 ++ .../PostProcessing/EyeAdaptationPass.cpp | 2 - .../Include/Atom/RPI.Public/Pass/ClearPass.h | 45 +++++++++++++++ .../Include/Atom/RPI.Public/Pass/ParentPass.h | 4 ++ .../Atom/RPI.Reflect/Pass/ClearPassData.h | 43 ++++++++++++++ .../Code/Source/RPI.Public/Pass/ClearPass.cpp | 57 +++++++++++++++++++ .../Source/RPI.Public/Pass/ParentPass.cpp | 50 +++++++++++++++- .../Source/RPI.Public/Pass/PassFactory.cpp | 2 + .../Source/RPI.Public/Pass/PassSystem.cpp | 2 + .../Atom/RPI/Code/atom_rpi_public_files.cmake | 2 + .../RPI/Code/atom_rpi_reflect_files.cmake | 1 + 15 files changed, 245 insertions(+), 11 deletions(-) create mode 100644 Gems/Atom/Feature/Common/Assets/Passes/Clear.pass create mode 100644 Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/ClearPass.h create mode 100644 Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Pass/ClearPassData.h create mode 100644 Gems/Atom/RPI/Code/Source/RPI.Public/Pass/ClearPass.cpp diff --git a/Gems/Atom/Feature/Common/Assets/Passes/Clear.pass b/Gems/Atom/Feature/Common/Assets/Passes/Clear.pass new file mode 100644 index 0000000000..a36c2ef03d --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Passes/Clear.pass @@ -0,0 +1,30 @@ +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "PassAsset", + "ClassData": { + "PassTemplate": { + "Name": "ClearPassTemplate", + "PassClass": "ClearPass", + "Slots": [ + { + "Name": "ClearInputOutput", + "SlotType": "InputOutput", + "ScopeAttachmentUsage": "RenderTarget", + "LoadStoreAction": { + "ClearValue": { + "Value": [ + 0.0, + 0.0, + 0.0, + 0.0 + ] + }, + "LoadAction": "Clear", + "LoadActionStencil": "Clear" + } + } + ] + } + } +} diff --git a/Gems/Atom/Feature/Common/Assets/Passes/PassTemplates.azasset b/Gems/Atom/Feature/Common/Assets/Passes/PassTemplates.azasset index eba745fb3c..b16536b276 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/PassTemplates.azasset +++ b/Gems/Atom/Feature/Common/Assets/Passes/PassTemplates.azasset @@ -64,6 +64,10 @@ "Name": "CascadedShadowmapsTemplate", "Path": "Passes/CascadedShadowmaps.pass" }, + { + "Name": "ClearPassTemplate", + "Path": "Passes/Clear.pass" + }, { "Name": "FullscreenCopyTemplate", "Path": "Passes/FullscreenCopy.pass" diff --git a/Gems/Atom/Feature/Common/Assets/Passes/SMAA1xApplyLinearHDRColor.pass b/Gems/Atom/Feature/Common/Assets/Passes/SMAA1xApplyLinearHDRColor.pass index 70604fba25..9ae0f62bc7 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/SMAA1xApplyLinearHDRColor.pass +++ b/Gems/Atom/Feature/Common/Assets/Passes/SMAA1xApplyLinearHDRColor.pass @@ -25,10 +25,7 @@ { "Name": "OutputColor", "SlotType": "Output", - "ScopeAttachmentUsage": "RenderTarget", - "LoadStoreAction": { - "LoadAction": "DontCare" - } + "ScopeAttachmentUsage": "RenderTarget" } ], "Connections": [ diff --git a/Gems/Atom/Feature/Common/Assets/Passes/SMAA1xApplyPerceptualColor.pass b/Gems/Atom/Feature/Common/Assets/Passes/SMAA1xApplyPerceptualColor.pass index 27fcff21cf..04484e1f17 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/SMAA1xApplyPerceptualColor.pass +++ b/Gems/Atom/Feature/Common/Assets/Passes/SMAA1xApplyPerceptualColor.pass @@ -25,10 +25,7 @@ { "Name": "OutputColor", "SlotType": "Output", - "ScopeAttachmentUsage": "RenderTarget", - "LoadStoreAction": { - "LoadAction": "DontCare" - } + "ScopeAttachmentUsage": "RenderTarget" } ], "Connections": [ diff --git a/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake b/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake index c4d198fef9..a684b4b299 100644 --- a/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake +++ b/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake @@ -53,6 +53,7 @@ set(FILES Materials/Types/StandardPBR_LowEndForward.azsl Materials/Types/StandardPBR_LowEndForward.shader Materials/Types/StandardPBR_LowEndForward_EDS.shader + Materials/Types/StandardPBR_Metallic.lua Materials/Types/StandardPBR_ParallaxState.lua Materials/Types/StandardPBR_Roughness.lua Materials/Types/StandardPBR_ShaderEnable.lua @@ -85,6 +86,7 @@ set(FILES Passes/CascadedShadowmaps.pass Passes/CheckerboardResolveColor.pass Passes/CheckerboardResolveDepth.pass + Passes/Clear.pass Passes/ContrastAdaptiveSharpening.pass Passes/ConvertToAcescg.pass Passes/DebugOverlayParent.pass @@ -129,6 +131,7 @@ set(FILES Passes/DownsampleMipChain.pass Passes/EnvironmentCubeMapDepthMSAA.pass Passes/EnvironmentCubeMapForwardMSAA.pass + Passes/EnvironmentCubeMapForwardSubsurfaceMSAA.pass Passes/EnvironmentCubeMapPipeline.pass Passes/EnvironmentCubeMapSkyBox.pass Passes/EsmShadowmaps.pass @@ -303,6 +306,7 @@ set(FILES ShaderLib/Atom/Features/ScreenSpace/ScreenSpaceUtil.azsli ShaderLib/Atom/Features/Shadow/BicubicPcfFilters.azsli ShaderLib/Atom/Features/Shadow/DirectionalLightShadow.azsli + ShaderLib/Atom/Features/Shadow/ESM.azsli ShaderLib/Atom/Features/Shadow/NormalOffsetShadows.azsli ShaderLib/Atom/Features/Shadow/ProjectedShadow.azsli ShaderLib/Atom/Features/Shadow/ReceiverPlaneDepthBias.azsli diff --git a/Gems/Atom/Feature/Common/Code/Source/PostProcessing/EyeAdaptationPass.cpp b/Gems/Atom/Feature/Common/Code/Source/PostProcessing/EyeAdaptationPass.cpp index 5683241693..20254690f9 100644 --- a/Gems/Atom/Feature/Common/Code/Source/PostProcessing/EyeAdaptationPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/PostProcessing/EyeAdaptationPass.cpp @@ -73,8 +73,6 @@ namespace AZ return false; } - AZ_Assert(m_pipeline->GetScene(), "EyeAdaptationPass's Pipeline does not have a valid scene pointer"); - AZ::RPI::Scene* scene = GetScene(); bool enabled = false; diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/ClearPass.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/ClearPass.h new file mode 100644 index 0000000000..e917584fca --- /dev/null +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/ClearPass.h @@ -0,0 +1,45 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ +#pragma once + +#include + +#include +#include +#include + +#include + +namespace AZ +{ + namespace RPI + { + //! A simple pass to clear a render target + class ClearPass + : public RenderPass + { + AZ_RPI_PASS(ClearPass); + + public: + AZ_RTTI(ClearPass, "{31CBAD6C-108F-4F3F-B498-ED968DFCFCE2}", RenderPass); + AZ_CLASS_ALLOCATOR(ClearPass, SystemAllocator, 0); + virtual ~ClearPass() = default; + + //! Creates a ClearPass + static Ptr Create(const PassDescriptor& descriptor); + + protected: + ClearPass(const PassDescriptor& descriptor); + void InitializeInternal() override; + + private: + + RHI::ClearValue m_clearValue; + }; + } // namespace RPI +} // namespace AZ diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/ParentPass.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/ParentPass.h index 6523f0a6d8..6ee0b43ce5 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/ParentPass.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/ParentPass.h @@ -131,6 +131,10 @@ namespace AZ // Generates child passes from source PassTemplate void CreatePassesFromTemplate(); + + // Generates child clear passes to clear input and input/output attachments + void CreateClearPassFromBinding(PassAttachmentBinding& binding, PassRequest& clearRequest); + void CreateClearPassesFromBindings(); }; template diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Pass/ClearPassData.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Pass/ClearPassData.h new file mode 100644 index 0000000000..5eed6d54fa --- /dev/null +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Pass/ClearPassData.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ +#pragma once + +#include + +#include + +namespace AZ +{ + namespace RPI + { + //! Custom data for the ClearPass. Should be specified in the PassRequest. + struct ClearPassData + : public RenderPassData + { + AZ_RTTI(ClearPassData, "{5F2C24A4-62D0-4E60-91EC-C207C10D15C6}", RenderPassData); + AZ_CLASS_ALLOCATOR(ClearPassData, SystemAllocator, 0); + + ClearPassData() = default; + virtual ~ClearPassData() = default; + + static void Reflect(ReflectContext* context) + { + if (auto* serializeContext = azrtti_cast(context)) + { + serializeContext->Class() + ->Version(0) + ->Field("ClearValue", &ClearPassData::m_clearValue) + ; + } + } + + RHI::ClearValue m_clearValue; + }; + } // namespace RPI +} // namespace AZ + diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/ClearPass.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/ClearPass.cpp new file mode 100644 index 0000000000..1ba16f4b5a --- /dev/null +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/ClearPass.cpp @@ -0,0 +1,57 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +namespace AZ +{ + namespace RPI + { + Ptr ClearPass::Create(const PassDescriptor& descriptor) + { + Ptr pass = aznew ClearPass(descriptor); + return pass; + } + + ClearPass::ClearPass(const PassDescriptor& descriptor) + : RenderPass(descriptor) + { + const ClearPassData* passData = PassUtils::GetPassData(descriptor); + if (passData != nullptr) + { + m_clearValue = passData->m_clearValue; + } + } + + void ClearPass::InitializeInternal() + { + RenderPass::InitializeInternal(); + + // Set clear value + AZ_Assert(GetInputOutputCount() > 0, "ClearPass: Missing InputOutput binding!"); + RPI::PassAttachmentBinding& binding = GetInputOutputBinding(0); + binding.m_unifiedScopeDesc.m_loadStoreAction.m_clearValue = m_clearValue; + } + + } // namespace RPI +} // namespace AZ diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/ParentPass.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/ParentPass.cpp index dccf5dbc2e..f0154b371a 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/ParentPass.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/ParentPass.cpp @@ -9,11 +9,15 @@ #include #include +#include #include +#include #include #include #include +#include +#include #include namespace AZ @@ -196,7 +200,7 @@ namespace AZ } } - // --- PassTemplate related functions --- + // --- Child creation --- void ParentPass::CreatePassesFromTemplate() { @@ -217,6 +221,49 @@ namespace AZ } } + void ParentPass::CreateClearPassFromBinding(PassAttachmentBinding& binding, PassRequest& clearRequest) + { + if (binding.m_unifiedScopeDesc.m_loadStoreAction.m_loadAction == RHI::AttachmentLoadAction::Clear || + binding.m_unifiedScopeDesc.m_loadStoreAction.m_loadActionStencil == RHI::AttachmentLoadAction::Clear) + { + // Set the name of the child clear pass as well as the binding it's connected to + clearRequest.m_passName = ConcatPassName(Name("Clear"), binding.m_name); + clearRequest.m_connections[0].m_attachmentRef.m_attachment = binding.m_name; + + // Set the pass clear value to the clear value of the attachment binding + ClearPassData* clearData = static_cast(clearRequest.m_passData.get()); + clearData->m_clearValue = binding.m_unifiedScopeDesc.m_loadStoreAction.m_clearValue; + + // Create and add the pass + Ptr clearPass = PassSystemInterface::Get()->CreatePassFromRequest(&clearRequest); + if (clearPass) + { + AddChild(clearPass); + } + } + + } + + void ParentPass::CreateClearPassesFromBindings() + { + PassRequest clearRequest; + clearRequest.m_templateName = Name("ClearPassTemplate"); + clearRequest.m_passData = AZStd::make_shared(); + clearRequest.m_connections.push_back(); + clearRequest.m_connections[0].m_localSlot = Name("ClearInputOutput"); + clearRequest.m_connections[0].m_attachmentRef.m_pass = Name("Parent"); + + for (uint32_t idx = 0; idx < GetInputCount(); ++idx) + { + CreateClearPassFromBinding(GetInputBinding(idx), clearRequest); + } + + for (uint32_t idx = 0; idx < GetInputOutputCount(); ++idx) + { + CreateClearPassFromBinding(GetInputOutputBinding(idx), clearRequest); + } + } + // --- Pass behavior functions --- void ParentPass::CreateChildPasses() @@ -229,6 +276,7 @@ namespace AZ m_flags.m_alreadyCreatedChildren = true; RemoveChildren(); + CreateClearPassesFromBindings(); CreatePassesFromTemplate(); CreateChildPassesInternal(); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/PassFactory.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/PassFactory.cpp index ef8d7a3fae..7443c51bff 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/PassFactory.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/PassFactory.cpp @@ -8,6 +8,7 @@ #include +#include #include #include #include @@ -60,6 +61,7 @@ namespace AZ { AddPassCreator(Name("ParentPass"), &ParentPass::Create); AddPassCreator(Name("RasterPass"), &RasterPass::Create); + AddPassCreator(Name("ClearPass"), &ClearPass::Create); AddPassCreator(Name("CopyPass"), &CopyPass::Create); AddPassCreator(Name("FullScreenTriangle"), &FullscreenTrianglePass::Create); AddPassCreator(Name("ComputePass"), &ComputePass::Create); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/PassSystem.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/PassSystem.cpp index cd64010680..f45d28518f 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/PassSystem.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/PassSystem.cpp @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -67,6 +68,7 @@ namespace AZ PassSlot::Reflect(context); PassData::Reflect(context); + ClearPassData::Reflect(context); CopyPassData::Reflect(context); RenderPassData::Reflect(context); ComputePassData::Reflect(context); diff --git a/Gems/Atom/RPI/Code/atom_rpi_public_files.cmake b/Gems/Atom/RPI/Code/atom_rpi_public_files.cmake index 93b85375f0..91dcf479e9 100644 --- a/Gems/Atom/RPI/Code/atom_rpi_public_files.cmake +++ b/Gems/Atom/RPI/Code/atom_rpi_public_files.cmake @@ -57,6 +57,7 @@ set(FILES Include/Atom/RPI.Public/Model/ModelSystem.h Include/Atom/RPI.Public/Model/UvStreamTangentBitmask.h Include/Atom/RPI.Public/Pass/AttachmentReadback.h + Include/Atom/RPI.Public/Pass/ClearPass.h Include/Atom/RPI.Public/Pass/ComputePass.h Include/Atom/RPI.Public/Pass/CopyPass.h Include/Atom/RPI.Public/Pass/FullscreenTrianglePass.h @@ -135,6 +136,7 @@ set(FILES Source/RPI.Public/Model/ModelSystem.cpp Source/RPI.Public/Model/UvStreamTangentBitmask.cpp Source/RPI.Public/Pass/AttachmentReadback.cpp + Source/RPI.Public/Pass/ClearPass.cpp Source/RPI.Public/Pass/ComputePass.cpp Source/RPI.Public/Pass/CopyPass.cpp Source/RPI.Public/Pass/FullscreenTrianglePass.cpp diff --git a/Gems/Atom/RPI/Code/atom_rpi_reflect_files.cmake b/Gems/Atom/RPI/Code/atom_rpi_reflect_files.cmake index 4f0e432511..921d5a8e46 100644 --- a/Gems/Atom/RPI/Code/atom_rpi_reflect_files.cmake +++ b/Gems/Atom/RPI/Code/atom_rpi_reflect_files.cmake @@ -62,6 +62,7 @@ set(FILES Include/Atom/RPI.Reflect/Material/ShaderCollection.h Include/Atom/RPI.Reflect/Material/MaterialFunctor.h Include/Atom/RPI.Reflect/Material/MaterialVersionUpdate.h + Include/Atom/RPI.Reflect/Pass/ClearPassData.h Include/Atom/RPI.Reflect/Pass/ComputePassData.h Include/Atom/RPI.Reflect/Pass/CopyPassData.h Include/Atom/RPI.Reflect/Pass/DownsampleMipChainPassData.h From fb36145e2e1f34574948233aa65eaa97f20e6e67 Mon Sep 17 00:00:00 2001 From: moudgils <47460854+moudgils@users.noreply.github.com> Date: Wed, 15 Dec 2021 18:35:17 -0800 Subject: [PATCH 153/948] Rte fixes for stability (#6434) * Fixed SRG updated related crash Signed-off-by: moudgils <47460854+moudgils@users.noreply.github.com> * Fixed SRG compile issue with metal which leads to multiple gpu crashes inlucde ImGuiPass render crash (#6315) Signed-off-by: Qing Tao <55564570+VickyAtAZ@users.noreply.github.com> Co-authored-by: Qing Tao <55564570+VickyAtAZ@users.noreply.github.com> --- .../Source/RHI/ShaderResourceGroupPool.cpp | 19 ++------ .../Metal/Code/Source/RHI/PipelineState.cpp | 15 ++++-- .../Source/RHI/ShaderResourceGroupPool.cpp | 48 ++++++++----------- .../Source/RHI/ShaderResourceGroupPool.cpp | 2 +- 4 files changed, 37 insertions(+), 47 deletions(-) diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/ShaderResourceGroupPool.cpp b/Gems/Atom/RHI/DX12/Code/Source/RHI/ShaderResourceGroupPool.cpp index 087a36dc2f..ab969365f6 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/ShaderResourceGroupPool.cpp +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/ShaderResourceGroupPool.cpp @@ -204,23 +204,19 @@ namespace AZ { ShaderResourceGroup& group = static_cast(groupBase); auto& device = static_cast(GetDevice()); - group.m_compiledDataIndex = (group.m_compiledDataIndex + 1) % RHI::Limits::Device::FrameCountMax; if (!groupData.IsAnyResourceTypeUpdated()) { return RHI::ResultCode::Success; } - if (m_constantBufferSize && - groupData.IsResourceTypeEnabledForCompilation(static_cast(RHI::ShaderResourceGroupData::ResourceTypeMask::ConstantDataMask))) + group.m_compiledDataIndex = (group.m_compiledDataIndex + 1) % RHI::Limits::Device::FrameCountMax; + if (m_constantBufferSize) { memcpy(group.GetCompiledData().m_cpuConstantAddress, groupData.GetConstantData().data(), groupData.GetConstantData().size()); } - if (m_viewsDescriptorTableSize && - groupData.IsResourceTypeEnabledForCompilation( - static_cast(RHI::ShaderResourceGroupData::ResourceTypeMask::ImageViewMask) | - static_cast(RHI::ShaderResourceGroupData::ResourceTypeMask::BufferViewMask))) + if (m_viewsDescriptorTableSize) { //Lazy initialization for cbv/srv/uav Descriptor Tables if (!group.m_viewsDescriptorTable.IsValid()) @@ -245,17 +241,12 @@ namespace AZ UpdateViewsDescriptorTable(descriptorTable, groupData); } - if (m_unboundedArrayCount && - groupData.IsResourceTypeEnabledForCompilation( - static_cast(RHI::ShaderResourceGroupData::ResourceTypeMask::ImageViewUnboundedArrayMask) | - static_cast(RHI::ShaderResourceGroupData::ResourceTypeMask::BufferViewUnboundedArrayMask))) + if (m_unboundedArrayCount) { UpdateUnboundedArrayDescriptorTables(group, groupData); } - if (m_samplersDescriptorTableSize && - groupData.IsResourceTypeEnabledForCompilation( - static_cast(RHI::ShaderResourceGroupData::ResourceTypeMask::SamplerMask))) + if (m_samplersDescriptorTableSize) { const DescriptorTable descriptorTable( group.m_samplersDescriptorTable.GetOffset() + group.m_compiledDataIndex * m_samplersDescriptorTableSize, diff --git a/Gems/Atom/RHI/Metal/Code/Source/RHI/PipelineState.cpp b/Gems/Atom/RHI/Metal/Code/Source/RHI/PipelineState.cpp index 8d6ab8fee3..ddd6401723 100644 --- a/Gems/Atom/RHI/Metal/Code/Source/RHI/PipelineState.cpp +++ b/Gems/Atom/RHI/Metal/Code/Source/RHI/PipelineState.cpp @@ -61,10 +61,19 @@ namespace AZ NSError* error = nil; id lib = nil; - + + bool loadFromByteCode = false; + + // MacOS Big Sur (11.16.x) has issue loading some shader's byte code when GPUCapture(Metal) is on. + // Only enable it for Monterey (12.x) + if(@available(iOS 14.0, macOS 12.0, *)) + { + loadFromByteCode = true; + } + const uint8_t* shaderByteCode = reinterpret_cast(shaderFunction->GetByteCode().data()); const int byteCodeLength = shaderFunction->GetByteCode().size(); - if(byteCodeLength > 0 ) + if(byteCodeLength > 0 && loadFromByteCode) { dispatch_data_t dispatchByteCodeData = dispatch_data_create(shaderByteCode, byteCodeLength, NULL, DISPATCH_DATA_DESTRUCTOR_DEFAULT); lib = [mtlDevice newLibraryWithData:dispatchByteCodeData error:&error]; @@ -74,7 +83,7 @@ namespace AZ //In case byte code was not generated try to create the lib with source code MTLCompileOptions* compileOptions = [MTLCompileOptions alloc]; compileOptions.fastMathEnabled = YES; - compileOptions.languageVersion = MTLLanguageVersion2_0; + compileOptions.languageVersion = MTLLanguageVersion2_2; lib = [mtlDevice newLibraryWithSource:source options:compileOptions error:&error]; diff --git a/Gems/Atom/RHI/Metal/Code/Source/RHI/ShaderResourceGroupPool.cpp b/Gems/Atom/RHI/Metal/Code/Source/RHI/ShaderResourceGroupPool.cpp index 0a9c001868..a2854e7d1e 100644 --- a/Gems/Atom/RHI/Metal/Code/Source/RHI/ShaderResourceGroupPool.cpp +++ b/Gems/Atom/RHI/Metal/Code/Source/RHI/ShaderResourceGroupPool.cpp @@ -6,7 +6,6 @@ * */ -#include #include #include #include @@ -62,57 +61,48 @@ namespace AZ RHI::ResultCode ShaderResourceGroupPool::CompileGroupInternal(RHI::ShaderResourceGroup& groupBase, const RHI::ShaderResourceGroupData& groupData) { ShaderResourceGroup& group = static_cast(groupBase); - group.UpdateCompiledDataIndex(); if (!groupData.IsAnyResourceTypeUpdated()) { return RHI::ResultCode::Success; } + group.UpdateCompiledDataIndex(); ArgumentBuffer& argBuffer = *group.m_compiledArgBuffers[group.m_compiledDataIndex]; argBuffer.ClearResourceTracking(); auto constantData = groupData.GetConstantData(); - if (!constantData.empty() && groupData.IsResourceTypeEnabledForCompilation(static_cast(RHI::ShaderResourceGroupData::ResourceTypeMask::ConstantDataMask))) + if (!constantData.empty()) { argBuffer.UpdateConstantBufferViews(groupData.GetConstantData()); } const RHI::ShaderResourceGroupLayout* layout = groupData.GetLayout(); uint32_t shaderInputIndex = 0; - if (groupData.IsResourceTypeEnabledForCompilation(static_cast(RHI::ShaderResourceGroupData::ResourceTypeMask::ImageViewMask))) + for (const RHI::ShaderInputImageDescriptor& shaderInputImage : layout->GetShaderInputListForImages()) { - for (const RHI::ShaderInputImageDescriptor& shaderInputImage : layout->GetShaderInputListForImages()) - { - const RHI::ShaderInputImageIndex imageInputIndex(shaderInputIndex); - AZStd::array_view> imageViews = groupData.GetImageViewArray(imageInputIndex); - argBuffer.UpdateImageViews(shaderInputImage, imageInputIndex, imageViews); - ++shaderInputIndex; - } + const RHI::ShaderInputImageIndex imageInputIndex(shaderInputIndex); + AZStd::array_view> imageViews = groupData.GetImageViewArray(imageInputIndex); + argBuffer.UpdateImageViews(shaderInputImage, imageInputIndex, imageViews); + ++shaderInputIndex; } - if (groupData.IsResourceTypeEnabledForCompilation(static_cast(RHI::ShaderResourceGroupData::ResourceTypeMask::SamplerMask))) + shaderInputIndex = 0; + for (const RHI::ShaderInputSamplerDescriptor& shaderInputSampler : layout->GetShaderInputListForSamplers()) { - shaderInputIndex = 0; - for (const RHI::ShaderInputSamplerDescriptor& shaderInputSampler : layout->GetShaderInputListForSamplers()) - { - const RHI::ShaderInputSamplerIndex samplerInputIndex(shaderInputIndex); - AZStd::array_view samplerStates = groupData.GetSamplerArray(samplerInputIndex); - argBuffer.UpdateSamplers(shaderInputSampler, samplerInputIndex, samplerStates); - ++shaderInputIndex; - } + const RHI::ShaderInputSamplerIndex samplerInputIndex(shaderInputIndex); + AZStd::array_view samplerStates = groupData.GetSamplerArray(samplerInputIndex); + argBuffer.UpdateSamplers(shaderInputSampler, samplerInputIndex, samplerStates); + ++shaderInputIndex; } - if (groupData.IsResourceTypeEnabledForCompilation(static_cast(RHI::ShaderResourceGroupData::ResourceTypeMask::BufferViewMask))) + shaderInputIndex = 0; + for (const RHI::ShaderInputBufferDescriptor& shaderInputBuffer : layout->GetShaderInputListForBuffers()) { - shaderInputIndex = 0; - for (const RHI::ShaderInputBufferDescriptor& shaderInputBuffer : layout->GetShaderInputListForBuffers()) - { - const RHI::ShaderInputBufferIndex bufferInputIndex(shaderInputIndex); - AZStd::array_view> bufferViews = groupData.GetBufferViewArray(bufferInputIndex); - argBuffer.UpdateBufferViews(shaderInputBuffer, bufferInputIndex, bufferViews); - ++shaderInputIndex; - } + const RHI::ShaderInputBufferIndex bufferInputIndex(shaderInputIndex); + AZStd::array_view> bufferViews = groupData.GetBufferViewArray(bufferInputIndex); + argBuffer.UpdateBufferViews(shaderInputBuffer, bufferInputIndex, bufferViews); + ++shaderInputIndex; } return RHI::ResultCode::Success; diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/ShaderResourceGroupPool.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/ShaderResourceGroupPool.cpp index b2772d716e..2c6eb2bc34 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/ShaderResourceGroupPool.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/ShaderResourceGroupPool.cpp @@ -104,13 +104,13 @@ namespace AZ RHI::ResultCode ShaderResourceGroupPool::CompileGroupInternal(RHI::ShaderResourceGroup& groupBase, const RHI::ShaderResourceGroupData& groupData) { auto& group = static_cast(groupBase); - group.UpdateCompiledDataIndex(m_currentIteration); if (!groupData.IsAnyResourceTypeUpdated()) { return RHI::ResultCode::Success; } + group.UpdateCompiledDataIndex(m_currentIteration); DescriptorSet& descriptorSet = *group.m_compiledData[group.GetCompileDataIndex()]; const RHI::ShaderResourceGroupLayout* layout = groupData.GetLayout(); From 18bb69a5cbecf53ce9388300090391bbc5aba071 Mon Sep 17 00:00:00 2001 From: antonmic <56370189+antonmic@users.noreply.github.com> Date: Wed, 15 Dec 2021 18:37:48 -0800 Subject: [PATCH 154/948] removed unnecessary lines Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com> --- .../Code/Include/Atom/RPI.Public/Pass/ClearPass.h | 7 +------ .../Include/Atom/RPI.Reflect/Pass/ClearPassData.h | 2 +- .../RPI/Code/Source/RPI.Public/Pass/ClearPass.cpp | 12 ------------ 3 files changed, 2 insertions(+), 19 deletions(-) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/ClearPass.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/ClearPass.h index e917584fca..3599e6de44 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/ClearPass.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/ClearPass.h @@ -8,11 +8,6 @@ #pragma once #include - -#include -#include -#include - #include namespace AZ @@ -38,8 +33,8 @@ namespace AZ void InitializeInternal() override; private: - RHI::ClearValue m_clearValue; }; + } // namespace RPI } // namespace AZ diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Pass/ClearPassData.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Pass/ClearPassData.h index 5eed6d54fa..9c03f5ccd6 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Pass/ClearPassData.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Pass/ClearPassData.h @@ -8,7 +8,6 @@ #pragma once #include - #include namespace AZ @@ -38,6 +37,7 @@ namespace AZ RHI::ClearValue m_clearValue; }; + } // namespace RPI } // namespace AZ diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/ClearPass.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/ClearPass.cpp index 1ba16f4b5a..0e3ea76728 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/ClearPass.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/ClearPass.cpp @@ -8,20 +8,8 @@ #include #include -#include -#include #include -#include -#include - -#include -#include -#include - -#include -#include -#include namespace AZ { From 73e0bdbe6e35fe465f8c2221a7b79e49bf127ba8 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Wed, 15 Dec 2021 21:49:01 -0800 Subject: [PATCH 155/948] fix version deletion error Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../Include/ScriptCanvas/Components/EditorDeprecationData.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorDeprecationData.cpp b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorDeprecationData.cpp index e94ef68234..a1afc8eeae 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorDeprecationData.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorDeprecationData.cpp @@ -21,6 +21,7 @@ namespace ScriptCanvasEditor if (auto serializeContext = azrtti_cast(context)) { serializeContext->Class() + ->Version(1) ->Field("m_asset", &ScriptCanvasAssetHolder::m_scriptCanvasAsset) ; } From 195764a4274d08afe3dcf97acabce100c252e743 Mon Sep 17 00:00:00 2001 From: sphrose <82213493+sphrose@users.noreply.github.com> Date: Thu, 16 Dec 2021 15:03:53 +0000 Subject: [PATCH 156/948] review changes Signed-off-by: sphrose <82213493+sphrose@users.noreply.github.com> --- Gems/SurfaceData/Code/CMakeLists.txt | 3 --- .../Editor/EditorSurfaceDataSystemComponent.cpp | 5 +---- .../Source/Editor/EditorSurfaceDataSystemComponent.h | 10 ---------- Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp | 12 +++++++----- .../Components/TerrainSurfaceDataSystemComponent.cpp | 9 +++++++++ .../Components/TerrainSurfaceDataSystemComponent.h | 6 ++++++ 6 files changed, 23 insertions(+), 22 deletions(-) diff --git a/Gems/SurfaceData/Code/CMakeLists.txt b/Gems/SurfaceData/Code/CMakeLists.txt index c35da595d6..54363d265e 100644 --- a/Gems/SurfaceData/Code/CMakeLists.txt +++ b/Gems/SurfaceData/Code/CMakeLists.txt @@ -70,7 +70,6 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) AZ::AzToolsFramework Gem::SurfaceData.Static Gem::LmbrCentral.Editor - Gem::Terrain RUNTIME_DEPENDENCIES Gem::LmbrCentral.Editor ) @@ -98,11 +97,9 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) BUILD_DEPENDENCIES PRIVATE AZ::AzTest - AZ::AzToolsFramework Legacy::CryCommon Gem::SurfaceData.Static Gem::LmbrCentral - Gem::Terrain ) ly_add_googletest( NAME Gem::SurfaceData.Tests diff --git a/Gems/SurfaceData/Code/Source/Editor/EditorSurfaceDataSystemComponent.cpp b/Gems/SurfaceData/Code/Source/Editor/EditorSurfaceDataSystemComponent.cpp index 0285ab5ca4..a847da4347 100644 --- a/Gems/SurfaceData/Code/Source/Editor/EditorSurfaceDataSystemComponent.cpp +++ b/Gems/SurfaceData/Code/Source/Editor/EditorSurfaceDataSystemComponent.cpp @@ -123,10 +123,7 @@ namespace SurfaceData void EditorSurfaceDataSystemComponent::GetRegisteredSurfaceTagNames(SurfaceTagNameSet& masks) const { - for (const auto& tagName : Constants::s_allTagNames) - { - masks.insert(tagName); - } + masks.insert(Constants::s_unassignedTagName); for (const auto& assetPair : m_surfaceTagNameAssets) { diff --git a/Gems/SurfaceData/Code/Source/Editor/EditorSurfaceDataSystemComponent.h b/Gems/SurfaceData/Code/Source/Editor/EditorSurfaceDataSystemComponent.h index 68f7ea7291..466da8482e 100644 --- a/Gems/SurfaceData/Code/Source/Editor/EditorSurfaceDataSystemComponent.h +++ b/Gems/SurfaceData/Code/Source/Editor/EditorSurfaceDataSystemComponent.h @@ -14,7 +14,6 @@ #include #include #include -#include namespace AZ::Data { @@ -23,15 +22,6 @@ namespace AZ::Data namespace SurfaceData { - namespace Constants - { - static const char* s_allTagNames[] = { - Constants::s_unassignedTagName, - Terrain::Constants::s_terrainHoleTagName, - Terrain::Constants::s_terrainTagName, - }; - } //namespace Constants - class EditorSurfaceDataSystemConfig : public AZ::ComponentConfig { diff --git a/Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp b/Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp index 23c0a1d4c6..8f4420bcc5 100644 --- a/Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp +++ b/Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp @@ -23,8 +23,8 @@ #include #include #include +#include #include -#include struct MockGlobalEnvironment { @@ -281,15 +281,17 @@ public: TEST_F(SurfaceDataTestApp, SurfaceData_TestRegisteredTags) { + // Check that only the unassigned tag exists if no other providers are registered. AZStd::vector> registeredTags = SurfaceData::SurfaceTag::GetRegisteredTags(); - for (const auto& searchTerm : SurfaceData::Constants::s_allTagNames) - { - ASSERT_TRUE(AZStd::find_if(registeredTags.begin(), registeredTags.end(), [searchTerm](decltype(registeredTags)::value_type pair) + const auto& searchTerm = SurfaceData::Constants::s_unassignedTagName; + + ASSERT_TRUE(AZStd::find_if( + registeredTags.begin(), registeredTags.end(), + [searchTerm](decltype(registeredTags)::value_type pair) { return pair.second == searchTerm; })); - } } #if AZ_TRAIT_DISABLE_FAILED_SURFACE_DATA_TESTS diff --git a/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp b/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp index 8c75aafa65..b36283bd3c 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp +++ b/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp @@ -15,6 +15,7 @@ #include #include #include +#include namespace Terrain { @@ -240,6 +241,8 @@ namespace Terrain // Start listening for surface data events AZ_Assert((m_providerHandle != SurfaceData::InvalidSurfaceDataRegistryHandle), "Invalid surface data handle"); SurfaceData::SurfaceDataProviderRequestBus::Handler::BusConnect(m_providerHandle); + + SurfaceData::SurfaceDataTagProviderRequestBus::Handler::BusConnect(); } else if (terrainValidBeforeUpdate && !terrainValidAfterUpdate) { @@ -263,4 +266,10 @@ namespace Terrain { UpdateTerrainData(dirtyRegion); } + + void TerrainSurfaceDataSystemComponent::GetRegisteredSurfaceTagNames(SurfaceData::SurfaceTagNameSet& names) const + { + names.insert(Constants::s_terrainHoleTagName); + names.insert(Constants::s_terrainTagName); + } } diff --git a/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.h b/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.h index d9c7893c77..4d9a5b7481 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.h +++ b/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.h @@ -13,6 +13,7 @@ #include #include #include +#include namespace Terrain { @@ -32,6 +33,7 @@ namespace Terrain : public AZ::Component , private SurfaceData::SurfaceDataProviderRequestBus::Handler , private AzFramework::Terrain::TerrainDataNotificationBus::Handler + , private SurfaceData::SurfaceDataTagProviderRequestBus::Handler { friend class EditorTerrainSurfaceDataSystemComponent; TerrainSurfaceDataSystemComponent(const TerrainSurfaceDataSystemConfig&); @@ -72,5 +74,9 @@ namespace Terrain AZ::Aabb m_terrainBounds = AZ::Aabb::CreateNull(); AZStd::atomic_bool m_terrainBoundsIsValid{ false }; + + ////////////////////////////////////////////////////////////////////////// + // SurfaceData::SurfaceDataTagProviderRequestBus + void GetRegisteredSurfaceTagNames(SurfaceData::SurfaceTagNameSet& names) const override; }; } From 94ddafc7a2c5c1987e25bfca845c16d03b35f1fc Mon Sep 17 00:00:00 2001 From: Qing Tao <55564570+VickyAtAZ@users.noreply.github.com> Date: Thu, 16 Dec 2021 09:19:44 -0800 Subject: [PATCH 157/948] Atom/qingtao/image builder fixes (#6432) * LYN-8837 o3de Material Editor - Texture Settings Editor - Hangs when converting texture (#6359) Fixed a editor hanging issue when preview texture with astc format (starts multiple job threads inside a job thread) Fixed an issue of changing texture setting didn't trigger image re-process. Fixed an issue with image asset which has texture setting may have dependency with wrong preset Added a EIF_HDR for source image in hdr format. Fixed astc compression issue which may wrongly compress image to HDR astc format Signed-off-by: Qing Tao <55564570+VickyAtAZ@users.noreply.github.com> (cherry picked from commit d9f0a3012d13f739e2df261f176afdb7cecc44fb) * ATOM-16958 [Image Builder] Alpha data would be removed for source image with alpha content (#6412) Fixed a regression issue with image builder which it can choose proper preset for images with alpha content. Signed-off-by: Qing Tao <55564570+VickyAtAZ@users.noreply.github.com> (cherry picked from commit b640f6d691b97ae608081c9a4dd7cbddb019721a) --- .../Config/AlbedoWithGenericAlpha.preset | 2 +- .../Atom/ImageProcessing/PixelFormats.h | 1 + .../BuilderSettings/BuilderSettingManager.cpp | 14 +++- .../Source/Compressors/ASTCCompressor.cpp | 76 ++++++++++++++----- .../Code/Source/ImageBuilderComponent.cpp | 20 +++-- .../Code/Source/ImageLoader/ImageLoaders.cpp | 19 ++++- .../Code/Source/Processing/ImageConvert.cpp | 2 +- .../Code/Source/Processing/ImageFlags.h | 2 +- .../Source/Processing/PixelFormatInfo.cpp | 18 +++++ 9 files changed, 117 insertions(+), 37 deletions(-) diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Assets/Config/AlbedoWithGenericAlpha.preset b/Gems/Atom/Asset/ImageProcessingAtom/Assets/Config/AlbedoWithGenericAlpha.preset index c315ede21c..3340fd39e4 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Assets/Config/AlbedoWithGenericAlpha.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Assets/Config/AlbedoWithGenericAlpha.preset @@ -7,7 +7,7 @@ "UUID": "{5D9ECB52-4CD9-4CB8-80E3-10CAE5EFB8A2}", "Name": "AlbedoWithGenericAlpha", "RGB_Weight": "CIEXYZ", - "PixelFormat": "ASTC_4x4", + "PixelFormat": "BC3", "MipMapSetting": { "MipGenType": "Box" } diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Include/Atom/ImageProcessing/PixelFormats.h b/Gems/Atom/Asset/ImageProcessingAtom/Code/Include/Atom/ImageProcessing/PixelFormats.h index 4da996dbde..1d11a05c17 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Include/Atom/ImageProcessing/PixelFormats.h +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Include/Atom/ImageProcessing/PixelFormats.h @@ -79,6 +79,7 @@ namespace ImageProcessingAtom }; bool IsASTCFormat(EPixelFormat fmt); + bool IsHDRFormat(EPixelFormat fmt); } // namespace ImageProcessingAtom namespace AZ diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/BuilderSettings/BuilderSettingManager.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/BuilderSettings/BuilderSettingManager.cpp index 1ae406c6fd..0e9681f38b 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/BuilderSettings/BuilderSettingManager.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/BuilderSettings/BuilderSettingManager.cpp @@ -620,6 +620,7 @@ namespace ImageProcessingAtom { PresetName emptyPreset; + //get file mask of this image file AZStd::string fileMask = GetFileMask(imageFilePath); @@ -636,8 +637,17 @@ namespace ImageProcessingAtom } if (outPreset == emptyPreset) - { - outPreset = m_defaultPreset; + { + auto image = IImageObjectPtr(LoadImageFromFile(imageFilePath)); + if (image->GetAlphaContent() == EAlphaContent::eAlphaContent_Absent + || image->GetAlphaContent() == EAlphaContent::eAlphaContent_OnlyWhite) + { + outPreset = m_defaultPreset; + } + else + { + outPreset = m_defaultPresetAlpha; + } } return outPreset; diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/ASTCCompressor.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/ASTCCompressor.cpp index 4ef47c043d..91829bb5be 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/ASTCCompressor.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/ASTCCompressor.cpp @@ -78,7 +78,7 @@ namespace ImageProcessingAtom return true; } - astcenc_profile GetAstcProfile(bool isSrgb, EPixelFormat pixelFormat) + astcenc_profile GetAstcProfile(bool isSrgb, bool isHDR) { // select profile depends on LDR or HDR, SRGB or Linear // ASTCENC_PRF_LDR @@ -86,8 +86,6 @@ namespace ImageProcessingAtom // ASTCENC_PRF_HDR_RGB_LDR_A // ASTCENC_PRF_HDR - auto formatInfo = CPixelFormats::GetInstance().GetPixelFormatInfo(pixelFormat); - bool isHDR = formatInfo->eSampleType == ESampleType::eSampleType_Half || formatInfo->eSampleType == ESampleType::eSampleType_Float; astcenc_profile profile; if (isHDR) { @@ -170,7 +168,7 @@ namespace ImageProcessingAtom auto dstFormatInfo = CPixelFormats::GetInstance().GetPixelFormatInfo(fmtDst); const float quality = GetAstcCompressQuality(compressOption->compressQuality); - const astcenc_profile profile = GetAstcProfile(srcImage->HasImageFlags(EIF_SRGBRead), fmtSrc); + const astcenc_profile profile = GetAstcProfile(srcImage->HasImageFlags(EIF_SRGBRead), srcImage->HasImageFlags(EIF_HDR)); astcenc_config config; astcenc_error status; @@ -182,10 +180,12 @@ namespace ImageProcessingAtom // Create a context based on the configuration astcenc_context* context; AZ::u32 blockCount = ((srcImage->GetWidth(0)+ dstFormatInfo->blockWidth-1)/dstFormatInfo->blockWidth) * ((srcImage->GetHeight(0) + dstFormatInfo->blockHeight-1)/dstFormatInfo->blockHeight); - AZ::u32 threadCount = AZStd::min(AZStd::thread::hardware_concurrency(), blockCount); + AZ::u32 threadCount = AZStd::min(AZStd::thread::hardware_concurrency()/2, blockCount); status = astcenc_context_alloc(&config, threadCount, &context); AZ_Assert( status == ASTCENC_SUCCESS, "ERROR: Codec context alloc failed: %s\n", astcenc_get_error_string(status)); + AZ::Job* currentJob = AZ::JobContext::GetGlobalContext()->GetJobManager().GetCurrentJob(); + const astcenc_type dataType =GetAstcDataType(fmtSrc); // Compress the image for each mips @@ -209,29 +209,65 @@ namespace ImageProcessingAtom dstImage->GetImagePointer(mip, dstMem, dstPitch); AZ::u32 dataSize = dstImage->GetMipBufSize(mip); - // Create jobs for each compression thread - auto completionJob = aznew AZ::JobCompletion(); - for (AZ::u32 threadIdx = 0; threadIdx < threadCount; threadIdx++) + if (threadCount == 1) + { + astcenc_error error = astcenc_compress_image(context, &image, &swizzle, dstMem, dataSize, 0); + if (error != ASTCENC_SUCCESS) + { + status = error; + } + } + else { - const auto jobLambda = [&status, context, &image, &swizzle, dstMem, dataSize, threadIdx]() + AZ::JobCompletion* completionJob = nullptr; + if (!currentJob) { + completionJob = aznew AZ::JobCompletion(); + } + // Create jobs for each compression thread + for (AZ::u32 threadIdx = 0; threadIdx < threadCount; threadIdx++) + { + const auto jobLambda = [&status, context, &image, &swizzle, dstMem, dataSize, threadIdx]() + { + astcenc_error error = astcenc_compress_image(context, &image, &swizzle, dstMem, dataSize, threadIdx); + if (error != ASTCENC_SUCCESS) + { + status = error; + } + }; + + AZ::Job* simulationJob = AZ::CreateJobFunction(AZStd::move(jobLambda), true, nullptr); //auto-deletes + + // adds this job as child to current job if there is a current job + // otherwise adds it as a dependent for the complete job + if (currentJob) + { + currentJob->StartAsChild(simulationJob); + } + else + { + simulationJob->SetDependent(completionJob); + simulationJob->Start(); + } + astcenc_error error = astcenc_compress_image(context, &image, &swizzle, dstMem, dataSize, threadIdx); if (error != ASTCENC_SUCCESS) { status = error; } - }; - - AZ::Job* simulationJob = AZ::CreateJobFunction(AZStd::move(jobLambda), true, nullptr); //auto-deletes - simulationJob->SetDependent(completionJob); - simulationJob->Start(); - } + } + + if (currentJob) + { + currentJob->WaitForChildren(); + } - if (completionJob) - { - completionJob->StartAndWaitForCompletion(); - delete completionJob; - completionJob = nullptr; + if (completionJob) + { + completionJob->StartAndWaitForCompletion(); + delete completionJob; + completionJob = nullptr; + } } if (status != ASTCENC_SUCCESS) diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageBuilderComponent.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageBuilderComponent.cpp index 57596f4a71..5e021a3fdd 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageBuilderComponent.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageBuilderComponent.cpp @@ -74,7 +74,7 @@ namespace ImageProcessingAtom builderDescriptor.m_busId = azrtti_typeid(); builderDescriptor.m_createJobFunction = AZStd::bind(&ImageBuilderWorker::CreateJobs, &m_imageBuilder, AZStd::placeholders::_1, AZStd::placeholders::_2); builderDescriptor.m_processJobFunction = AZStd::bind(&ImageBuilderWorker::ProcessJob, &m_imageBuilder, AZStd::placeholders::_1, AZStd::placeholders::_2); - builderDescriptor.m_version = 26; // [ATOM-15086] + builderDescriptor.m_version = 27; // [ATOM-16958] builderDescriptor.m_analysisFingerprint = ImageProcessingAtom::BuilderSettingManager::Instance()->GetAnalysisFingerprint(); m_imageBuilder.BusConnect(builderDescriptor.m_busId); AssetBuilderSDK::AssetBuilderBus::Broadcast(&AssetBuilderSDK::AssetBuilderBusTraits::RegisterBuilderInformation, builderDescriptor); @@ -221,18 +221,19 @@ namespace ImageProcessingAtom m_isShuttingDown = true; } - PresetName GetImagePreset(const AZStd::string& filepath) + PresetName GetImagePreset(const AZStd::string& imageFileFullPath) { // first let preset from asset info TextureSettings textureSettings; - StringOutcome output = TextureSettings::LoadTextureSetting(filepath, textureSettings); + AZStd::string settingFilePath = imageFileFullPath + TextureSettings::ExtensionName; + TextureSettings::LoadTextureSetting(settingFilePath, textureSettings); if (!textureSettings.m_preset.IsEmpty()) { return textureSettings.m_preset; } - return BuilderSettingManager::Instance()->GetSuggestedPreset(filepath); + return BuilderSettingManager::Instance()->GetSuggestedPreset(imageFileFullPath); } void HandlePresetDependency(PresetName presetName, AZStd::vector& sourceDependencyList) @@ -283,6 +284,10 @@ namespace ImageProcessingAtom return; } + // Full path of the image file + AZStd::string fullPath; + AzFramework::StringFunc::Path::Join(request.m_watchFolder.data(), request.m_sourceFile.data(), fullPath, true, true); + // Get the extension of the file AZStd::string ext; AzFramework::StringFunc::Path::GetExtension(request.m_sourceFile.c_str(), ext, false); @@ -305,13 +310,12 @@ namespace ImageProcessingAtom // add source dependency for .assetinfo file AssetBuilderSDK::SourceFileDependency sourceFileDependency; sourceFileDependency.m_sourceDependencyType = AssetBuilderSDK::SourceFileDependency::SourceFileDependencyType::Absolute; - sourceFileDependency.m_sourceFileDependencyPath = request.m_sourceFile; - AZ::StringFunc::Path::ReplaceExtension(sourceFileDependency.m_sourceFileDependencyPath, TextureSettings::ExtensionName); + sourceFileDependency.m_sourceFileDependencyPath = fullPath + TextureSettings::ExtensionName; response.m_sourceFileDependencyList.push_back(sourceFileDependency); // add source dependencies for .preset files - // Get the preset for this file - auto presetName = GetImagePreset(request.m_sourceFile); + // Get the preset for this file + auto presetName = GetImagePreset(fullPath.c_str()); HandlePresetDependency(presetName, response.m_sourceFileDependencyList); response.m_result = AssetBuilderSDK::CreateJobsResultCode::Success; diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageLoader/ImageLoaders.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageLoader/ImageLoaders.cpp index e756174810..74517f5b18 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageLoader/ImageLoaders.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageLoader/ImageLoaders.cpp @@ -8,6 +8,7 @@ #include +#include #include // warning C4251: class QT_Type needs to have dll-interface to be used by clients of class 'QT_Type' AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") @@ -26,21 +27,31 @@ namespace ImageProcessingAtom return nullptr; } + IImageObject* loadedImage = nullptr; if (TIFFLoader::IsExtensionSupported(ext.toUtf8())) { - return TIFFLoader::LoadImageFromTIFF(filename); + loadedImage = TIFFLoader::LoadImageFromTIFF(filename); } else if (DdsLoader::IsExtensionSupported(ext.toUtf8())) { - return DdsLoader::LoadImageFromFile(filename); + loadedImage = DdsLoader::LoadImageFromFile(filename); } else if (QtImageLoader::IsExtensionSupported(ext.toUtf8())) { - return QtImageLoader::LoadImageFromFile(filename); + loadedImage = QtImageLoader::LoadImageFromFile(filename); } else if (ExrLoader::IsExtensionSupported(ext.toUtf8())) { - return ExrLoader::LoadImageFromFile(filename); + loadedImage = ExrLoader::LoadImageFromFile(filename); + } + + if (loadedImage) + { + if (IsHDRFormat(loadedImage->GetPixelFormat())) + { + loadedImage->AddImageFlags(EIF_HDR); + } + return loadedImage; } AZ_Warning("ImageProcessing", false, "No proper image loader to load file: %s", filename.c_str()); diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/ImageConvert.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/ImageConvert.cpp index defca690a3..058daf7ca4 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/ImageConvert.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/ImageConvert.cpp @@ -193,7 +193,7 @@ namespace ImageProcessingAtom } m_image->Get()->Swizzle(swizzle.c_str()); - if (!m_input->m_presetSetting.m_discardAlpha) + if (m_input->m_presetSetting.m_discardAlpha) { m_alphaContent = EAlphaContent::eAlphaContent_Absent; } diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/ImageFlags.h b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/ImageFlags.h index d25533cccd..cefd315448 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/ImageFlags.h +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/ImageFlags.h @@ -19,7 +19,7 @@ namespace ImageProcessingAtom const static AZ::u32 EIF_Decal = 0x4; // this is usually set through the preset const static AZ::u32 EIF_Greyscale = 0x8; // hint for the engine (e.g. greyscale light beams can be applied to shadow mask), can be for DXT1 because compression artfacts don't count as color const static AZ::u32 EIF_SupressEngineReduce = 0x10; // info for the engine: don't reduce texture resolution on this texture - const static AZ::u32 EIF_UNUSED_BIT = 0x40; // Free to use + const static AZ::u32 EIF_HDR = 0x40; // the image contains HDR data const static AZ::u32 EIF_AttachedAlpha = 0x400; // deprecated: info for the engine: it's a texture with attached alpha channel const static AZ::u32 EIF_SRGBRead = 0x800; // info for the engine: if gamma corrected rendering is on, this texture requires SRGBRead (it's not stored in linear) const static AZ::u32 EIF_DontResize = 0x8000; // info for the engine: for dds textures that shouldn't be resized diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/PixelFormatInfo.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/PixelFormatInfo.cpp index 8a741d6637..a413a29862 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/PixelFormatInfo.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/PixelFormatInfo.cpp @@ -52,6 +52,24 @@ namespace ImageProcessingAtom return false; } + bool IsHDRFormat(EPixelFormat fmt) + { + switch (fmt) + { + case ePixelFormat_BC6UH: + case ePixelFormat_R9G9B9E5: + case ePixelFormat_R32G32B32A32F: + case ePixelFormat_R32G32F: + case ePixelFormat_R32F: + case ePixelFormat_R16G16B16A16F: + case ePixelFormat_R16G16F: + case ePixelFormat_R16F: + return true; + default: + return false; + } + } + PixelFormatInfo::PixelFormatInfo( uint32_t a_bitsPerPixel, uint32_t a_Channels, From fc3c5fbd09ed410305cc4f436155850117203701 Mon Sep 17 00:00:00 2001 From: amzn-sj Date: Thu, 16 Dec 2021 09:43:00 -0800 Subject: [PATCH 158/948] [Mac] Fix build error in (#6410) Signed-off-by: amzn-sj --- .../Code/Editor/Framework/ScriptCanvasGraphUtilities.inl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl index 74d0f76dce..8bac7b460f 100644 --- a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl +++ b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl @@ -268,7 +268,7 @@ namespace ScriptCanvasEditor RuntimeDataOverrides dependencyRuntimeDataOverrides; dependencyRuntimeDataOverrides.m_runtimeAsset = dependency.runtimeAsset; - AZStd::string dependencyHint = AZStd::string::format("dependency_%d", index); + AZStd::string dependencyHint = AZStd::string::format("dependency_%zu", index); dependencyRuntimeDataOverrides.m_runtimeAsset.SetHint(dependencyHint); dependencyRuntimeDataOverrides.m_runtimeAsset.Get()->m_runtimeData.m_script.SetHint(dependencyHint); From 2bc381811d0a5d5fd508d7c4443371e8a04f8f36 Mon Sep 17 00:00:00 2001 From: antonmic <56370189+antonmic@users.noreply.github.com> Date: Thu, 16 Dec 2021 10:42:53 -0800 Subject: [PATCH 159/948] addressed PR feedback Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com> --- .../Feature/Common/Assets/Passes/PassTemplates.azasset | 4 ++-- .../Common/Assets/Passes/{Clear.pass => SlowClear.pass} | 6 +++++- .../Common/Assets/atom_feature_common_asset_files.cmake | 2 +- .../RPI/Code/Include/Atom/RPI.Public/Pass/ClearPass.h | 4 +++- .../RPI/Code/Include/Atom/RPI.Public/Pass/ParentPass.h | 9 +++++++++ Gems/Atom/RPI/Code/Source/RPI.Public/Pass/ParentPass.cpp | 2 +- 6 files changed, 21 insertions(+), 6 deletions(-) rename Gems/Atom/Feature/Common/Assets/Passes/{Clear.pass => SlowClear.pass} (79%) diff --git a/Gems/Atom/Feature/Common/Assets/Passes/PassTemplates.azasset b/Gems/Atom/Feature/Common/Assets/Passes/PassTemplates.azasset index b16536b276..96cf769690 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/PassTemplates.azasset +++ b/Gems/Atom/Feature/Common/Assets/Passes/PassTemplates.azasset @@ -65,8 +65,8 @@ "Path": "Passes/CascadedShadowmaps.pass" }, { - "Name": "ClearPassTemplate", - "Path": "Passes/Clear.pass" + "Name": "SlowClearPassTemplate", + "Path": "Passes/SlowClear.pass" }, { "Name": "FullscreenCopyTemplate", diff --git a/Gems/Atom/Feature/Common/Assets/Passes/Clear.pass b/Gems/Atom/Feature/Common/Assets/Passes/SlowClear.pass similarity index 79% rename from Gems/Atom/Feature/Common/Assets/Passes/Clear.pass rename to Gems/Atom/Feature/Common/Assets/Passes/SlowClear.pass index a36c2ef03d..417cf94eac 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/Clear.pass +++ b/Gems/Atom/Feature/Common/Assets/Passes/SlowClear.pass @@ -4,7 +4,11 @@ "ClassName": "PassAsset", "ClassData": { "PassTemplate": { - "Name": "ClearPassTemplate", + + // This is for debug purposes and edge cases only + // If you want to clear an attachment you should + // use the LoadStoreAction on your pass slot. + "Name": "SlowClearPassTemplate", "PassClass": "ClearPass", "Slots": [ { diff --git a/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake b/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake index a684b4b299..a03058e2bf 100644 --- a/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake +++ b/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake @@ -86,7 +86,6 @@ set(FILES Passes/CascadedShadowmaps.pass Passes/CheckerboardResolveColor.pass Passes/CheckerboardResolveDepth.pass - Passes/Clear.pass Passes/ContrastAdaptiveSharpening.pass Passes/ConvertToAcescg.pass Passes/DebugOverlayParent.pass @@ -201,6 +200,7 @@ set(FILES Passes/Skinning.pass Passes/SkyBox.pass Passes/SkyBox_TwoOutputs.pass + Passes/SlowClear.pass Passes/SMAA1xApplyLinearHDRColor.pass Passes/SMAA1xApplyPerceptualColor.pass Passes/SMAABlendingWeightCalculation.pass diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/ClearPass.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/ClearPass.h index 3599e6de44..96252ca82c 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/ClearPass.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/ClearPass.h @@ -14,7 +14,9 @@ namespace AZ { namespace RPI { - //! A simple pass to clear a render target + //! Only use this for debug purposes and edge cases + //! The correct and efficient way to clear a pass is through the LoadStoreAction on the pass slot + //! This will clear a given image attachment to the specified clear value. class ClearPass : public RenderPass { diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/ParentPass.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/ParentPass.h index 6ee0b43ce5..00b7a76f77 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/ParentPass.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/ParentPass.h @@ -133,6 +133,15 @@ namespace AZ void CreatePassesFromTemplate(); // Generates child clear passes to clear input and input/output attachments + // TODO: These two functions are a workaround for a complicated edge case: + // Let Parent Pass P1 have two children, C1 and C2. C1 writes to an attachment that C2 reads, + // but C1 can be disabled, in which case we just want C2 to read the cleared texture. + // Because of this, the attachment is owned by the parent pass, that way it is always available for C2 + // to read even when C1 is disabled. However we still want to clear the attachment before C2 reads it. + // We tried overriding the LoadStoreAction to clear on C2's slot when C1 is disabled, but the RHI + // doesn't allow for clears on Input only slots. Changing the slot to InputOutput was in conflict with + // the texture definition in the SRG, and it couldn't be changed to RW because it was an MSAA texture. + // So now we detect clear actions on parent slots and generate a clear pass for them. void CreateClearPassFromBinding(PassAttachmentBinding& binding, PassRequest& clearRequest); void CreateClearPassesFromBindings(); }; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/ParentPass.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/ParentPass.cpp index f0154b371a..fff6fae0a3 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/ParentPass.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/ParentPass.cpp @@ -247,7 +247,7 @@ namespace AZ void ParentPass::CreateClearPassesFromBindings() { PassRequest clearRequest; - clearRequest.m_templateName = Name("ClearPassTemplate"); + clearRequest.m_templateName = Name("SlowClearPassTemplate"); clearRequest.m_passData = AZStd::make_shared(); clearRequest.m_connections.push_back(); clearRequest.m_connections[0].m_localSlot = Name("ClearInputOutput"); From 53cf7b462bf58385d39cf4714642e1c4e33b6761 Mon Sep 17 00:00:00 2001 From: antonmic <56370189+antonmic@users.noreply.github.com> Date: Thu, 16 Dec 2021 11:03:20 -0800 Subject: [PATCH 160/948] Changing all ClearPass to SlowClearPass Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com> --- .../Feature/Common/Assets/Passes/SlowClear.pass | 2 +- .../Pass/{ClearPass.h => SlowClearPass.h} | 16 ++++++++-------- .../{ClearPassData.h => SlowClearPassData.h} | 16 ++++++++-------- .../Code/Source/RPI.Public/Pass/ParentPass.cpp | 8 ++++---- .../Code/Source/RPI.Public/Pass/PassFactory.cpp | 4 ++-- .../Code/Source/RPI.Public/Pass/PassSystem.cpp | 4 ++-- .../Pass/{ClearPass.cpp => SlowClearPass.cpp} | 16 ++++++++-------- Gems/Atom/RPI/Code/atom_rpi_public_files.cmake | 4 ++-- Gems/Atom/RPI/Code/atom_rpi_reflect_files.cmake | 2 +- 9 files changed, 36 insertions(+), 36 deletions(-) rename Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/{ClearPass.h => SlowClearPass.h} (65%) rename Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Pass/{ClearPassData.h => SlowClearPassData.h} (58%) rename Gems/Atom/RPI/Code/Source/RPI.Public/Pass/{ClearPass.cpp => SlowClearPass.cpp} (59%) diff --git a/Gems/Atom/Feature/Common/Assets/Passes/SlowClear.pass b/Gems/Atom/Feature/Common/Assets/Passes/SlowClear.pass index 417cf94eac..97b486191a 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/SlowClear.pass +++ b/Gems/Atom/Feature/Common/Assets/Passes/SlowClear.pass @@ -9,7 +9,7 @@ // If you want to clear an attachment you should // use the LoadStoreAction on your pass slot. "Name": "SlowClearPassTemplate", - "PassClass": "ClearPass", + "PassClass": "SlowClearPass", "Slots": [ { "Name": "ClearInputOutput", diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/ClearPass.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/SlowClearPass.h similarity index 65% rename from Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/ClearPass.h rename to Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/SlowClearPass.h index 96252ca82c..6fcb7abd17 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/ClearPass.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/SlowClearPass.h @@ -17,21 +17,21 @@ namespace AZ //! Only use this for debug purposes and edge cases //! The correct and efficient way to clear a pass is through the LoadStoreAction on the pass slot //! This will clear a given image attachment to the specified clear value. - class ClearPass + class SlowClearPass : public RenderPass { - AZ_RPI_PASS(ClearPass); + AZ_RPI_PASS(SlowClearPass); public: - AZ_RTTI(ClearPass, "{31CBAD6C-108F-4F3F-B498-ED968DFCFCE2}", RenderPass); - AZ_CLASS_ALLOCATOR(ClearPass, SystemAllocator, 0); - virtual ~ClearPass() = default; + AZ_RTTI(SlowClearPass, "{31CBAD6C-108F-4F3F-B498-ED968DFCFCE2}", RenderPass); + AZ_CLASS_ALLOCATOR(SlowClearPass, SystemAllocator, 0); + virtual ~SlowClearPass() = default; - //! Creates a ClearPass - static Ptr Create(const PassDescriptor& descriptor); + //! Creates a SlowClearPass + static Ptr Create(const PassDescriptor& descriptor); protected: - ClearPass(const PassDescriptor& descriptor); + SlowClearPass(const PassDescriptor& descriptor); void InitializeInternal() override; private: diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Pass/ClearPassData.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Pass/SlowClearPassData.h similarity index 58% rename from Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Pass/ClearPassData.h rename to Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Pass/SlowClearPassData.h index 9c03f5ccd6..7607bca285 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Pass/ClearPassData.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Pass/SlowClearPassData.h @@ -14,23 +14,23 @@ namespace AZ { namespace RPI { - //! Custom data for the ClearPass. Should be specified in the PassRequest. - struct ClearPassData + //! Custom data for the SlowClearPass. Should be specified in the PassRequest. + struct SlowClearPassData : public RenderPassData { - AZ_RTTI(ClearPassData, "{5F2C24A4-62D0-4E60-91EC-C207C10D15C6}", RenderPassData); - AZ_CLASS_ALLOCATOR(ClearPassData, SystemAllocator, 0); + AZ_RTTI(SlowClearPassData, "{5F2C24A4-62D0-4E60-91EC-C207C10D15C6}", RenderPassData); + AZ_CLASS_ALLOCATOR(SlowClearPassData, SystemAllocator, 0); - ClearPassData() = default; - virtual ~ClearPassData() = default; + SlowClearPassData() = default; + virtual ~SlowClearPassData() = default; static void Reflect(ReflectContext* context) { if (auto* serializeContext = azrtti_cast(context)) { - serializeContext->Class() + serializeContext->Class() ->Version(0) - ->Field("ClearValue", &ClearPassData::m_clearValue) + ->Field("ClearValue", &SlowClearPassData::m_clearValue) ; } } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/ParentPass.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/ParentPass.cpp index fff6fae0a3..55f3e44173 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/ParentPass.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/ParentPass.cpp @@ -9,14 +9,14 @@ #include #include -#include +#include #include #include #include #include #include -#include +#include #include #include @@ -231,7 +231,7 @@ namespace AZ clearRequest.m_connections[0].m_attachmentRef.m_attachment = binding.m_name; // Set the pass clear value to the clear value of the attachment binding - ClearPassData* clearData = static_cast(clearRequest.m_passData.get()); + SlowClearPassData* clearData = static_cast(clearRequest.m_passData.get()); clearData->m_clearValue = binding.m_unifiedScopeDesc.m_loadStoreAction.m_clearValue; // Create and add the pass @@ -248,7 +248,7 @@ namespace AZ { PassRequest clearRequest; clearRequest.m_templateName = Name("SlowClearPassTemplate"); - clearRequest.m_passData = AZStd::make_shared(); + clearRequest.m_passData = AZStd::make_shared(); clearRequest.m_connections.push_back(); clearRequest.m_connections[0].m_localSlot = Name("ClearInputOutput"); clearRequest.m_connections[0].m_attachmentRef.m_pass = Name("Parent"); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/PassFactory.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/PassFactory.cpp index 7443c51bff..cc79df144d 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/PassFactory.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/PassFactory.cpp @@ -8,7 +8,6 @@ #include -#include #include #include #include @@ -20,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -61,7 +61,7 @@ namespace AZ { AddPassCreator(Name("ParentPass"), &ParentPass::Create); AddPassCreator(Name("RasterPass"), &RasterPass::Create); - AddPassCreator(Name("ClearPass"), &ClearPass::Create); + AddPassCreator(Name("SlowClearPass"), &SlowClearPass::Create); AddPassCreator(Name("CopyPass"), &CopyPass::Create); AddPassCreator(Name("FullScreenTriangle"), &FullscreenTrianglePass::Create); AddPassCreator(Name("ComputePass"), &ComputePass::Create); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/PassSystem.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/PassSystem.cpp index f45d28518f..9e1333b7ab 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/PassSystem.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/PassSystem.cpp @@ -28,7 +28,6 @@ #include #include -#include #include #include #include @@ -40,6 +39,7 @@ #include #include #include +#include namespace AZ { @@ -68,7 +68,7 @@ namespace AZ PassSlot::Reflect(context); PassData::Reflect(context); - ClearPassData::Reflect(context); + SlowClearPassData::Reflect(context); CopyPassData::Reflect(context); RenderPassData::Reflect(context); ComputePassData::Reflect(context); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/ClearPass.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/SlowClearPass.cpp similarity index 59% rename from Gems/Atom/RPI/Code/Source/RPI.Public/Pass/ClearPass.cpp rename to Gems/Atom/RPI/Code/Source/RPI.Public/Pass/SlowClearPass.cpp index 0e3ea76728..62a8241242 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/ClearPass.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/SlowClearPass.cpp @@ -6,37 +6,37 @@ * */ -#include +#include #include -#include +#include namespace AZ { namespace RPI { - Ptr ClearPass::Create(const PassDescriptor& descriptor) + Ptr SlowClearPass::Create(const PassDescriptor& descriptor) { - Ptr pass = aznew ClearPass(descriptor); + Ptr pass = aznew SlowClearPass(descriptor); return pass; } - ClearPass::ClearPass(const PassDescriptor& descriptor) + SlowClearPass::SlowClearPass(const PassDescriptor& descriptor) : RenderPass(descriptor) { - const ClearPassData* passData = PassUtils::GetPassData(descriptor); + const SlowClearPassData* passData = PassUtils::GetPassData(descriptor); if (passData != nullptr) { m_clearValue = passData->m_clearValue; } } - void ClearPass::InitializeInternal() + void SlowClearPass::InitializeInternal() { RenderPass::InitializeInternal(); // Set clear value - AZ_Assert(GetInputOutputCount() > 0, "ClearPass: Missing InputOutput binding!"); + AZ_Assert(GetInputOutputCount() > 0, "SlowClearPass: Missing InputOutput binding!"); RPI::PassAttachmentBinding& binding = GetInputOutputBinding(0); binding.m_unifiedScopeDesc.m_loadStoreAction.m_clearValue = m_clearValue; } diff --git a/Gems/Atom/RPI/Code/atom_rpi_public_files.cmake b/Gems/Atom/RPI/Code/atom_rpi_public_files.cmake index 91dcf479e9..36df56cdab 100644 --- a/Gems/Atom/RPI/Code/atom_rpi_public_files.cmake +++ b/Gems/Atom/RPI/Code/atom_rpi_public_files.cmake @@ -57,7 +57,6 @@ set(FILES Include/Atom/RPI.Public/Model/ModelSystem.h Include/Atom/RPI.Public/Model/UvStreamTangentBitmask.h Include/Atom/RPI.Public/Pass/AttachmentReadback.h - Include/Atom/RPI.Public/Pass/ClearPass.h Include/Atom/RPI.Public/Pass/ComputePass.h Include/Atom/RPI.Public/Pass/CopyPass.h Include/Atom/RPI.Public/Pass/FullscreenTrianglePass.h @@ -74,6 +73,7 @@ set(FILES Include/Atom/RPI.Public/Pass/RasterPass.h Include/Atom/RPI.Public/Pass/RenderPass.h Include/Atom/RPI.Public/Pass/MSAAResolvePass.h + Include/Atom/RPI.Public/Pass/SlowClearPass.h Include/Atom/RPI.Public/Pass/Specific/DownsampleMipChainPass.h Include/Atom/RPI.Public/Pass/Specific/ImageAttachmentPreviewPass.h Include/Atom/RPI.Public/Pass/Specific/EnvironmentCubeMapPass.h @@ -136,7 +136,6 @@ set(FILES Source/RPI.Public/Model/ModelSystem.cpp Source/RPI.Public/Model/UvStreamTangentBitmask.cpp Source/RPI.Public/Pass/AttachmentReadback.cpp - Source/RPI.Public/Pass/ClearPass.cpp Source/RPI.Public/Pass/ComputePass.cpp Source/RPI.Public/Pass/CopyPass.cpp Source/RPI.Public/Pass/FullscreenTrianglePass.cpp @@ -151,6 +150,7 @@ set(FILES Source/RPI.Public/Pass/RasterPass.cpp Source/RPI.Public/Pass/RenderPass.cpp Source/RPI.Public/Pass/MSAAResolvePass.cpp + Source/RPI.Public/Pass/SlowClearPass.cpp Source/RPI.Public/Pass/Specific/DownsampleMipChainPass.cpp Source/RPI.Public/Pass/Specific/ImageAttachmentPreviewPass.cpp Source/RPI.Public/Pass/Specific/EnvironmentCubeMapPass.cpp diff --git a/Gems/Atom/RPI/Code/atom_rpi_reflect_files.cmake b/Gems/Atom/RPI/Code/atom_rpi_reflect_files.cmake index 921d5a8e46..df8f389c37 100644 --- a/Gems/Atom/RPI/Code/atom_rpi_reflect_files.cmake +++ b/Gems/Atom/RPI/Code/atom_rpi_reflect_files.cmake @@ -62,7 +62,6 @@ set(FILES Include/Atom/RPI.Reflect/Material/ShaderCollection.h Include/Atom/RPI.Reflect/Material/MaterialFunctor.h Include/Atom/RPI.Reflect/Material/MaterialVersionUpdate.h - Include/Atom/RPI.Reflect/Pass/ClearPassData.h Include/Atom/RPI.Reflect/Pass/ComputePassData.h Include/Atom/RPI.Reflect/Pass/CopyPassData.h Include/Atom/RPI.Reflect/Pass/DownsampleMipChainPassData.h @@ -76,6 +75,7 @@ set(FILES Include/Atom/RPI.Reflect/Pass/PassTemplate.h Include/Atom/RPI.Reflect/Pass/RasterPassData.h Include/Atom/RPI.Reflect/Pass/RenderPassData.h + Include/Atom/RPI.Reflect/Pass/SlowClearPassData.h Include/Atom/RPI.Reflect/Shader/ShaderCommonTypes.h Include/Atom/RPI.Reflect/Shader/ShaderAsset.h Include/Atom/RPI.Reflect/Shader/ShaderAssetCreator.h From 20e697a8d66fd914d00741603c2e42d799c338c6 Mon Sep 17 00:00:00 2001 From: nwidmaie Date: Thu, 16 Dec 2021 11:32:47 -0800 Subject: [PATCH 161/948] Fixing case error with material files Signed-off-by: nwidmaie --- .../Levels/PbrMaterialChart/materials/basic_m00_r00.material | 2 +- .../Levels/PbrMaterialChart/materials/basic_m00_r01.material | 2 +- .../Levels/PbrMaterialChart/materials/basic_m00_r02.material | 2 +- .../Levels/PbrMaterialChart/materials/basic_m00_r03.material | 2 +- .../Levels/PbrMaterialChart/materials/basic_m00_r04.material | 2 +- .../Levels/PbrMaterialChart/materials/basic_m00_r05.material | 2 +- .../Levels/PbrMaterialChart/materials/basic_m00_r06.material | 2 +- .../Levels/PbrMaterialChart/materials/basic_m00_r07.material | 2 +- .../Levels/PbrMaterialChart/materials/basic_m00_r08.material | 2 +- .../Levels/PbrMaterialChart/materials/basic_m00_r09.material | 2 +- .../Levels/PbrMaterialChart/materials/basic_m00_r10.material | 2 +- .../Levels/PbrMaterialChart/materials/basic_m10_r00.material | 2 +- .../Levels/PbrMaterialChart/materials/basic_m10_r01.material | 2 +- .../Levels/PbrMaterialChart/materials/basic_m10_r02.material | 2 +- .../Levels/PbrMaterialChart/materials/basic_m10_r03.material | 2 +- .../Levels/PbrMaterialChart/materials/basic_m10_r04.material | 2 +- .../Levels/PbrMaterialChart/materials/basic_m10_r05.material | 2 +- .../Levels/PbrMaterialChart/materials/basic_m10_r06.material | 2 +- .../Levels/PbrMaterialChart/materials/basic_m10_r07.material | 2 +- .../Levels/PbrMaterialChart/materials/basic_m10_r08.material | 2 +- .../Levels/PbrMaterialChart/materials/basic_m10_r09.material | 2 +- .../Levels/PbrMaterialChart/materials/basic_m10_r10.material | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r00.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r00.material index dcadcb9bfe..1c1096bf12 100644 --- a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r00.material +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r00.material @@ -1,6 +1,6 @@ { "parentMaterial": "./basic.material", - "materialType": "materials/Types/StandardPBR.materialtype", + "materialType": "Materials/Types/StandardPBR.materialtype", "propertyLayoutVersion": 1, "properties": { "metallic": { diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r01.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r01.material index 0c2b3e62b3..33148f3f73 100644 --- a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r01.material +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r01.material @@ -1,6 +1,6 @@ { "parentMaterial": "./basic.material", - "materialType": "materials/Types/StandardPBR.materialtype", + "materialType": "Materials/Types/StandardPBR.materialtype", "propertyLayoutVersion": 1, "properties": { "metallic": { diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r02.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r02.material index 8d29890384..38339454cb 100644 --- a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r02.material +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r02.material @@ -1,6 +1,6 @@ { "parentMaterial": "./basic.material", - "materialType": "materials/Types/StandardPBR.materialtype", + "materialType": "Materials/Types/StandardPBR.materialtype", "propertyLayoutVersion": 1, "properties": { "metallic": { diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r03.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r03.material index bb9557241b..e21ab5775a 100644 --- a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r03.material +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r03.material @@ -1,6 +1,6 @@ { "parentMaterial": "./basic.material", - "materialType": "materials/Types/StandardPBR.materialtype", + "materialType": "Materials/Types/StandardPBR.materialtype", "propertyLayoutVersion": 1, "properties": { "metallic": { diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r04.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r04.material index e14e2899fa..0272e66081 100644 --- a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r04.material +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r04.material @@ -1,6 +1,6 @@ { "parentMaterial": "./basic.material", - "materialType": "materials/Types/StandardPBR.materialtype", + "materialType": "Materials/Types/StandardPBR.materialtype", "propertyLayoutVersion": 1, "properties": { "metallic": { diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r05.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r05.material index 344ce084e5..67d51777a4 100644 --- a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r05.material +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r05.material @@ -1,6 +1,6 @@ { "parentMaterial": "./basic.material", - "materialType": "materials/Types/StandardPBR.materialtype", + "materialType": "Materials/Types/StandardPBR.materialtype", "propertyLayoutVersion": 1, "properties": { "metallic": { diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r06.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r06.material index 0f8195653f..3136f654e6 100644 --- a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r06.material +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r06.material @@ -1,6 +1,6 @@ { "parentMaterial": "./basic.material", - "materialType": "materials/Types/StandardPBR.materialtype", + "materialType": "Materials/Types/StandardPBR.materialtype", "propertyLayoutVersion": 1, "properties": { "metallic": { diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r07.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r07.material index d5d95ff285..a79744ea11 100644 --- a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r07.material +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r07.material @@ -1,6 +1,6 @@ { "parentMaterial": "./basic.material", - "materialType": "materials/Types/StandardPBR.materialtype", + "materialType": "Materials/Types/StandardPBR.materialtype", "propertyLayoutVersion": 1, "properties": { "metallic": { diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r08.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r08.material index 801b138831..1372283500 100644 --- a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r08.material +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r08.material @@ -1,6 +1,6 @@ { "parentMaterial": "./basic.material", - "materialType": "materials/Types/StandardPBR.materialtype", + "materialType": "Materials/Types/StandardPBR.materialtype", "propertyLayoutVersion": 1, "properties": { "metallic": { diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r09.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r09.material index 0710a320cb..d1c951e53c 100644 --- a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r09.material +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r09.material @@ -1,6 +1,6 @@ { "parentMaterial": "./basic.material", - "materialType": "materials/Types/StandardPBR.materialtype", + "materialType": "Materials/Types/StandardPBR.materialtype", "propertyLayoutVersion": 1, "properties": { "metallic": { diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r10.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r10.material index d1cc781c61..d34fc46530 100644 --- a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r10.material +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r10.material @@ -1,6 +1,6 @@ { "parentMaterial": "./basic.material", - "materialType": "materials/Types/StandardPBR.materialtype", + "materialType": "Materials/Types/StandardPBR.materialtype", "propertyLayoutVersion": 1, "properties": { "metallic": { diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r00.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r00.material index 945cd1e9eb..92ddfec7c4 100644 --- a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r00.material +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r00.material @@ -1,6 +1,6 @@ { "parentMaterial": "./basic.material", - "materialType": "materials/Types/StandardPBR.materialtype", + "materialType": "Materials/Types/StandardPBR.materialtype", "propertyLayoutVersion": 1, "properties": { "metallic": { diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r01.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r01.material index 85f6008782..874422384a 100644 --- a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r01.material +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r01.material @@ -1,6 +1,6 @@ { "parentMaterial": "./basic.material", - "materialType": "materials/Types/StandardPBR.materialtype", + "materialType": "Materials/Types/StandardPBR.materialtype", "propertyLayoutVersion": 1, "properties": { "metallic": { diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r02.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r02.material index 5abedc34e2..b017add10b 100644 --- a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r02.material +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r02.material @@ -1,6 +1,6 @@ { "parentMaterial": "./basic.material", - "materialType": "materials/Types/StandardPBR.materialtype", + "materialType": "Materials/Types/StandardPBR.materialtype", "propertyLayoutVersion": 1, "properties": { "metallic": { diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r03.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r03.material index 50b37a647d..5353d651c8 100644 --- a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r03.material +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r03.material @@ -1,6 +1,6 @@ { "parentMaterial": "./basic.material", - "materialType": "materials/Types/StandardPBR.materialtype", + "materialType": "Materials/Types/StandardPBR.materialtype", "propertyLayoutVersion": 1, "properties": { "metallic": { diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r04.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r04.material index ad74ddf08b..6dd47e4e3b 100644 --- a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r04.material +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r04.material @@ -1,6 +1,6 @@ { "parentMaterial": "./basic.material", - "materialType": "materials/Types/StandardPBR.materialtype", + "materialType": "Materials/Types/StandardPBR.materialtype", "propertyLayoutVersion": 1, "properties": { "metallic": { diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r05.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r05.material index f7f3260b97..04912cbfd4 100644 --- a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r05.material +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r05.material @@ -1,6 +1,6 @@ { "parentMaterial": "./basic.material", - "materialType": "materials/Types/StandardPBR.materialtype", + "materialType": "Materials/Types/StandardPBR.materialtype", "propertyLayoutVersion": 1, "properties": { "metallic": { diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r06.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r06.material index fc982f9c22..27f7f6ff42 100644 --- a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r06.material +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r06.material @@ -1,6 +1,6 @@ { "parentMaterial": "./basic.material", - "materialType": "materials/Types/StandardPBR.materialtype", + "materialType": "Materials/Types/StandardPBR.materialtype", "propertyLayoutVersion": 1, "properties": { "metallic": { diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r07.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r07.material index c4526dfd2c..e2b5df681c 100644 --- a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r07.material +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r07.material @@ -1,6 +1,6 @@ { "parentMaterial": "./basic.material", - "materialType": "materials/Types/StandardPBR.materialtype", + "materialType": "Materials/Types/StandardPBR.materialtype", "propertyLayoutVersion": 1, "properties": { "metallic": { diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r08.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r08.material index f756a36ded..5418f9c855 100644 --- a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r08.material +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r08.material @@ -1,6 +1,6 @@ { "parentMaterial": "./basic.material", - "materialType": "materials/Types/StandardPBR.materialtype", + "materialType": "Materials/Types/StandardPBR.materialtype", "propertyLayoutVersion": 1, "properties": { "metallic": { diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r09.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r09.material index a853979d6d..dd1ec3489a 100644 --- a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r09.material +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r09.material @@ -1,6 +1,6 @@ { "parentMaterial": "./basic.material", - "materialType": "materials/Types/StandardPBR.materialtype", + "materialType": "Materials/Types/StandardPBR.materialtype", "propertyLayoutVersion": 1, "properties": { "metallic": { diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r10.material b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r10.material index e4528d45fd..5f9317d2cc 100644 --- a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r10.material +++ b/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r10.material @@ -1,6 +1,6 @@ { "parentMaterial": "./basic.material", - "materialType": "materials/Types/StandardPBR.materialtype", + "materialType": "Materials/Types/StandardPBR.materialtype", "propertyLayoutVersion": 1, "properties": { "metallic": { From d7dc2579270d2f78786c14d69648692e714a11bc Mon Sep 17 00:00:00 2001 From: hershey5045 <43485729+hershey5045@users.noreply.github.com> Date: Thu, 16 Dec 2021 12:07:37 -0800 Subject: [PATCH 162/948] Add MainPipeline to pass hierarchy for when HDR color grading component requests for the lut generation's image attachment. (#6436) Signed-off-by: hershey5045 <43485729+hershey5045@users.noreply.github.com> --- .../ColorGrading/EditorHDRColorGradingComponent.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/PostProcess/ColorGrading/EditorHDRColorGradingComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/PostProcess/ColorGrading/EditorHDRColorGradingComponent.cpp index 3cc9535d7a..67db519669 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/PostProcess/ColorGrading/EditorHDRColorGradingComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/PostProcess/ColorGrading/EditorHDRColorGradingComponent.cpp @@ -11,6 +11,9 @@ #include #include #include +#include +#include +#include namespace AZ { @@ -199,7 +202,14 @@ namespace AZ } const char* LutAttachment = "LutOutput"; - const AZStd::vector LutGenerationPassHierarchy{ "LutGenerationPass" }; + auto renderPipelineName = AZ::Interface::Get() + ->GetDefaultViewportContext() + ->GetCurrentPipeline() + ->GetId(); + const AZStd::vector LutGenerationPassHierarchy{ + renderPipelineName.GetCStr(), + "LutGenerationPass" + }; char resolvedOutputFilePath[AZ_MAX_PATH_LEN] = { 0 }; AZ::IO::FileIOBase::GetDirectInstance()->ResolvePath(m_currentTiffFilePath.c_str(), resolvedOutputFilePath, AZ_MAX_PATH_LEN); From 285d92ff0d2e269ac3630b6149a3bb0106ff54be Mon Sep 17 00:00:00 2001 From: Maxim Ivanov <59574542+imginimg@users.noreply.github.com> Date: Thu, 16 Dec 2021 23:53:22 +0300 Subject: [PATCH 163/948] [AudioSystem] ACE bug fix: Ctrl-S doesn't work correctly when a level is loaded. (#6411) Signed-off-by: Maxim Ivanov --- .../Editor/AudioControlsEditorMainWindow.ui | 3 +++ .../Editor/AudioControlsEditorWindow.cpp | 21 ------------------- .../Source/Editor/AudioControlsEditorWindow.h | 1 - 3 files changed, 3 insertions(+), 22 deletions(-) diff --git a/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorMainWindow.ui b/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorMainWindow.ui index 8954bbc812..549e746de6 100644 --- a/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorMainWindow.ui +++ b/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorMainWindow.ui @@ -154,6 +154,9 @@ Save All + + Ctrl+S + diff --git a/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorWindow.cpp b/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorWindow.cpp index 54a8ce616d..5f870d06d4 100644 --- a/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorWindow.cpp +++ b/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorWindow.cpp @@ -121,27 +121,6 @@ namespace AudioControls } } - //-------------------------------------------------------------------------------------------// - void CAudioControlsEditorWindow::keyPressEvent(QKeyEvent* pEvent) - { - if (pEvent->key() == Qt::Key_S && pEvent->modifiers() == Qt::ControlModifier) - { - Save(); - } - else if (pEvent->key() == Qt::Key_Z && (pEvent->modifiers() & Qt::ControlModifier)) - { - if (pEvent->modifiers() & Qt::ShiftModifier) - { - GetIEditor()->Redo(); - } - else - { - GetIEditor()->Undo(); - } - } - QMainWindow::keyPressEvent(pEvent); - } - //-------------------------------------------------------------------------------------------// void CAudioControlsEditorWindow::closeEvent(QCloseEvent* pEvent) { diff --git a/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorWindow.h b/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorWindow.h index abe5fd4511..00ffabfbe9 100644 --- a/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorWindow.h +++ b/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorWindow.h @@ -63,7 +63,6 @@ namespace AudioControls void Update(); protected: - void keyPressEvent(QKeyEvent* pEvent) override; void closeEvent(QCloseEvent* pEvent) override; private: From f52d49834acc3dbaa1652bc93fb50e7bf834afc6 Mon Sep 17 00:00:00 2001 From: Chris Burel Date: Thu, 16 Dec 2021 13:42:38 -0800 Subject: [PATCH 164/948] [EMotionFX] Prefer `#pragma once` (#6435) Signed-off-by: Chris Burel --- .../CommandSystem/Source/ActorInstanceCommands.h | 6 +----- .../EMotionFX/CommandSystem/Source/AttachmentCommands.h | 6 +----- .../EMotionFX/CommandSystem/Source/CommandSystemConfig.h | 5 +---- .../EMotionFX/CommandSystem/Source/ImporterCommands.h | 6 +----- .../EMotionFX/CommandSystem/Source/MorphTargetCommands.h | 6 +----- .../EMotionFX/CommandSystem/Source/SelectionCommands.h | 6 +----- Gems/EMotionFX/Code/EMotionFX/Rendering/Common/Camera.h | 6 +----- .../Code/EMotionFX/Rendering/Common/FirstPersonCamera.h | 6 +----- .../Code/EMotionFX/Rendering/Common/LookAtCamera.h | 6 +----- .../Code/EMotionFX/Rendering/Common/MCommonConfig.h | 5 +---- .../Code/EMotionFX/Rendering/Common/OrbitCamera.h | 6 +----- .../EMotionFX/Rendering/Common/TranslateManipulator.h | 6 +----- .../Code/EMotionFX/Rendering/OpenGL2/Source/GBuffer.h | 6 +----- .../EMotionFX/Rendering/OpenGL2/Source/GLRenderUtil.h | 6 +----- .../Code/EMotionFX/Rendering/OpenGL2/Source/GLSLShader.h | 8 ++------ .../EMotionFX/Rendering/OpenGL2/Source/GraphicsManager.h | 7 ++----- .../Code/EMotionFX/Rendering/OpenGL2/Source/IndexBuffer.h | 7 ++----- .../Code/EMotionFX/Rendering/OpenGL2/Source/Material.h | 7 ++----- .../Rendering/OpenGL2/Source/PostProcessShader.h | 7 ++----- .../EMotionFX/Rendering/OpenGL2/Source/RenderGLConfig.h | 6 +----- .../EMotionFX/Rendering/OpenGL2/Source/RenderTexture.h | 7 ++----- .../Code/EMotionFX/Rendering/OpenGL2/Source/Shader.h | 7 ++----- .../EMotionFX/Rendering/OpenGL2/Source/StandardMaterial.h | 6 +----- .../EMotionFX/Rendering/OpenGL2/Source/TextureCache.h | 8 ++------ .../EMotionFX/Rendering/OpenGL2/Source/VertexBuffer.h | 5 +---- .../Code/EMotionFX/Rendering/OpenGL2/Source/glactor.h | 7 ++----- .../Code/EMotionFX/Rendering/OpenGL2/Source/shadercache.h | 5 +---- .../EMotionStudio/EMStudioSDK/Source/EMStudioConfig.h | 5 +---- .../Tools/EMotionStudio/EMStudioSDK/Source/EMStudioCore.h | 5 +---- .../EMotionStudio/EMStudioSDK/Source/EMStudioPlugin.h | 5 +---- .../EMotionStudio/EMStudioSDK/Source/InvisiblePlugin.h | 5 +---- .../EMStudioSDK/Source/NodeSelectionWindow.h | 5 +---- .../EMotionStudio/EMStudioSDK/Source/PluginManager.h | 5 +---- .../Source/RenderPlugin/ManipulatorCallbacks.h | 8 ++------ .../EMStudioSDK/Source/RenderPlugin/RenderLayouts.h | 6 +----- .../Source/RenderPlugin/RenderUpdateCallback.h | 6 +----- .../EMotionStudio/EMStudioSDK/Source/ToolBarPlugin.h | 5 +---- .../Plugins/RenderPlugins/Source/OpenGLRender/GLWidget.h | 6 +----- .../Plugins/RenderPlugins/Source/RenderPluginsConfig.h | 5 +---- .../StandardPlugins/Source/AnimGraph/AnimGraphPlugin.h | 6 +----- .../StandardPlugins/Source/AnimGraph/DebugEventHandler.h | 5 +---- .../StandardPlugins/Source/AnimGraph/GameController.h | 5 +---- .../Source/AnimGraph/GameControllerWindow.h | 5 +---- .../Source/AnimGraph/GraphWidgetCallback.h | 5 +---- .../Source/Attachments/AttachmentNodesWindow.h | 6 +----- .../Source/Attachments/AttachmentsHierarchyWindow.h | 6 +----- .../Source/Attachments/AttachmentsPlugin.h | 6 +----- .../StandardPlugins/Source/LogWindow/LogWindowCallback.h | 5 +---- .../StandardPlugins/Source/LogWindow/LogWindowPlugin.h | 5 +---- .../Source/MotionWindow/MotionExtractionWindow.h | 6 +----- .../Source/MotionWindow/MotionPropertiesWindow.h | 6 +----- .../Source/MotionWindow/MotionRetargetingWindow.h | 6 +----- .../StandardPlugins/Source/StandardPluginsConfig.h | 5 +---- Gems/EMotionFX/Code/MysticQt/Source/MysticQtManager.h | 5 +---- 54 files changed, 64 insertions(+), 253 deletions(-) diff --git a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/ActorInstanceCommands.h b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/ActorInstanceCommands.h index 604d88d037..4681b19bf2 100644 --- a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/ActorInstanceCommands.h +++ b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/ActorInstanceCommands.h @@ -6,8 +6,7 @@ * */ -#ifndef __EMFX_ACTORINSTANCECOMMANDS_H -#define __EMFX_ACTORINSTANCECOMMANDS_H +#pragma once // include the required headers #include "CommandSystemConfig.h" @@ -61,6 +60,3 @@ public: void COMMANDSYSTEM_API MakeSelectedActorInstancesVisible(); void COMMANDSYSTEM_API UnselectSelectedActorInstances(); } // namespace CommandSystem - - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/AttachmentCommands.h b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/AttachmentCommands.h index db4f4b9e04..8ea098021f 100644 --- a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/AttachmentCommands.h +++ b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/AttachmentCommands.h @@ -6,8 +6,7 @@ * */ -#ifndef __EMFX_ATTACHMENTCOMMANDS_H -#define __EMFX_ATTACHMENTCOMMANDS_H +#pragma once // include the required headers #include "CommandSystemConfig.h" @@ -35,6 +34,3 @@ public: static bool AddAttachment(MCore::Command* command, const MCore::CommandLine& parameters, AZStd::string& outResult, bool remove); MCORE_DEFINECOMMAND_END } // namespace CommandSystem - - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/CommandSystemConfig.h b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/CommandSystemConfig.h index 48d2d01644..328785453c 100644 --- a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/CommandSystemConfig.h +++ b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/CommandSystemConfig.h @@ -6,8 +6,7 @@ * */ -#ifndef __COMMANDSYSTEM_CONFIG_H -#define __COMMANDSYSTEM_CONFIG_H +#pragma once #include @@ -35,5 +34,3 @@ enum { MEMCATEGORY_COMMANDSYSTEM = 990 }; - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/ImporterCommands.h b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/ImporterCommands.h index 6e8f4728c7..b3906dbfe0 100644 --- a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/ImporterCommands.h +++ b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/ImporterCommands.h @@ -6,8 +6,7 @@ * */ -#ifndef __EMFX_IMPORTERCOMMANDS_H -#define __EMFX_IMPORTERCOMMANDS_H +#pragma once // include the required headers #include "CommandSystemConfig.h" @@ -35,6 +34,3 @@ public: MCORE_DEFINECOMMAND_END } // namespace CommandSystem - - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/MorphTargetCommands.h b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/MorphTargetCommands.h index 2ae284e907..7bfb0084aa 100644 --- a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/MorphTargetCommands.h +++ b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/MorphTargetCommands.h @@ -6,8 +6,7 @@ * */ -#ifndef __EMFX_MORPHTARGETCOMMANDS_H -#define __EMFX_MORPHTARGETCOMMANDS_H +#pragma once // include the required headers #include "CommandSystemConfig.h" @@ -30,6 +29,3 @@ namespace CommandSystem bool GetMorphTarget(EMotionFX::Actor* actor, EMotionFX::ActorInstance* actorInstance, uint32 lodLevel, const char* morphTargetName, EMotionFX::MorphTarget** outMorphTarget, EMotionFX::MorphSetupInstance::MorphTarget** outMorphTargetInstance, AZStd::string& outResult); MCORE_DEFINECOMMAND_END } // namespace CommandSystem - - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/SelectionCommands.h b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/SelectionCommands.h index 13a39e5e8a..04af437935 100644 --- a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/SelectionCommands.h +++ b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/SelectionCommands.h @@ -6,8 +6,7 @@ * */ -#ifndef __EMFX_SELECTIONCOMMANDS_H -#define __EMFX_SELECTIONCOMMANDS_H +#pragma once // include the required headers #include "CommandSystemConfig.h" @@ -49,6 +48,3 @@ public: bool COMMANDSYSTEM_API CheckIfHasAnimGraphSelectionParameter(const MCore::CommandLine& parameters); bool COMMANDSYSTEM_API CheckIfHasActorSelectionParameter(const MCore::CommandLine& parameters, bool ignoreInstanceParameters = false); } // namespace CommandSystem - - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/Camera.h b/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/Camera.h index 46b81a9d25..2c685ce77f 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/Camera.h +++ b/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/Camera.h @@ -6,8 +6,7 @@ * */ -#ifndef __MCOMMON_CAMERA_H -#define __MCOMMON_CAMERA_H +#pragma once #include #include @@ -280,6 +279,3 @@ namespace MCommon // include inline code #include "Camera.inl" } // namespace MCommon - - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/FirstPersonCamera.h b/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/FirstPersonCamera.h index e0abe7922c..fa3631713c 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/FirstPersonCamera.h +++ b/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/FirstPersonCamera.h @@ -6,8 +6,7 @@ * */ -#ifndef __MCOMMON_FIRSTPERSONCAMERA_H -#define __MCOMMON_FIRSTPERSONCAMERA_H +#pragma once // include required headers #include "Camera.h" @@ -124,6 +123,3 @@ namespace MCommon float m_roll; /**< Rotation around axis of screen. (0=straight, +clockwise, -CCW) */ }; } // namespace MCommon - - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/LookAtCamera.h b/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/LookAtCamera.h index e17fe65985..a2fd21a9b9 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/LookAtCamera.h +++ b/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/LookAtCamera.h @@ -6,8 +6,7 @@ * */ -#ifndef __MCOMMON_LOOKATCAMERA_H -#define __MCOMMON_LOOKATCAMERA_H +#pragma once // include required headers #include "Camera.h" @@ -91,6 +90,3 @@ namespace MCommon AZ::Vector3 m_up; /**< The up vector of the camera. */ }; } // namespace MCommon - - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/MCommonConfig.h b/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/MCommonConfig.h index 634c01951e..94860cdc1c 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/MCommonConfig.h +++ b/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/MCommonConfig.h @@ -6,8 +6,7 @@ * */ -#ifndef __MCOMMON_CONFIG_H -#define __MCOMMON_CONFIG_H +#pragma once #include @@ -27,5 +26,3 @@ enum { MEMCATEGORY_MCOMMON = 992, }; - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/OrbitCamera.h b/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/OrbitCamera.h index 8aaa465da9..ae6383d6a8 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/OrbitCamera.h +++ b/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/OrbitCamera.h @@ -6,8 +6,7 @@ * */ -#ifndef __MCOMMON_ORBITCAMERA_H -#define __MCOMMON_ORBITCAMERA_H +#pragma once // include required headers #include "LookAtCamera.h" @@ -125,6 +124,3 @@ namespace MCommon float m_flightTargetBeta; }; } // namespace MCommon - - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/TranslateManipulator.h b/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/TranslateManipulator.h index 4b916f43b7..a8946dfff0 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/TranslateManipulator.h +++ b/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/TranslateManipulator.h @@ -6,8 +6,7 @@ * */ -#ifndef __MCOMMON_TRANSLATEMANIPULATOR_H -#define __MCOMMON_TRANSLATEMANIPULATOR_H +#pragma once #include #include @@ -111,6 +110,3 @@ namespace MCommon bool m_zAxisVisible; }; } // namespace MCommon - - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/GBuffer.h b/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/GBuffer.h index cce01485e0..7995d4df2a 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/GBuffer.h +++ b/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/GBuffer.h @@ -6,8 +6,7 @@ * */ -#ifndef __RENDERGL_GBUFFER_H -#define __RENDERGL_GBUFFER_H +#pragma once // include required headers #include @@ -76,6 +75,3 @@ namespace RenderGL RenderTexture* m_renderTargetE; /**< Render target with width and height divided by four. */ }; } // namespace RenderGL - - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/GLRenderUtil.h b/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/GLRenderUtil.h index aa64581449..84e6e1a6b2 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/GLRenderUtil.h +++ b/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/GLRenderUtil.h @@ -6,8 +6,7 @@ * */ -#ifndef __OPENGLRENDERUTIL_H -#define __OPENGLRENDERUTIL_H +#pragma once #include "RenderGLConfig.h" #include "../../Common/RenderUtil.h" @@ -114,6 +113,3 @@ namespace RenderGL uint32 m_maxNumTextures; }; } // namespace RenderGL - - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/GLSLShader.h b/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/GLSLShader.h index 5975470f86..b8e34d90ba 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/GLSLShader.h +++ b/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/GLSLShader.h @@ -6,8 +6,7 @@ * */ -#ifndef __RENDERGL_GLSLSHADER_H -#define __RENDERGL_GLSLSHADER_H +#pragma once #include #include @@ -96,7 +95,4 @@ namespace RenderGL uint32 m_textureUnit; }; -} - - -#endif +} // namespace RenderGL diff --git a/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/GraphicsManager.h b/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/GraphicsManager.h index 67ebbd9441..0b22df1656 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/GraphicsManager.h +++ b/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/GraphicsManager.h @@ -6,8 +6,7 @@ * */ -#ifndef __RENDERGL_GRAPHICSMANAGER__H -#define __RENDERGL_GRAPHICSMANAGER__H +#pragma once #include #include @@ -198,6 +197,4 @@ namespace RenderGL }; GraphicsManager* GetGraphicsManager(); -} - -#endif +} // namespace RenderGL diff --git a/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/IndexBuffer.h b/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/IndexBuffer.h index b09e5f394d..09e49d4c5f 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/IndexBuffer.h +++ b/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/IndexBuffer.h @@ -6,8 +6,7 @@ * */ -#ifndef __RENDERGL_INDEXBUFFER_H -#define __RENDERGL_INDEXBUFFER_H +#pragma once #include "VertexBuffer.h" @@ -51,6 +50,4 @@ namespace RenderGL bool GetIsSuccess(); bool GetHasError(); }; -} - -#endif +} // namespace RenderGL diff --git a/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/Material.h b/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/Material.h index 825fa4c7b0..69b22184c8 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/Material.h +++ b/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/Material.h @@ -6,8 +6,7 @@ * */ -#ifndef __RENDERGL_MATERIAL_H -#define __RENDERGL_MATERIAL_H +#pragma once #include #include @@ -105,6 +104,4 @@ namespace RenderGL GLActor* m_actor; }; -} - -#endif +} // namespace RenderGL diff --git a/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/PostProcessShader.h b/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/PostProcessShader.h index 644e47b9b9..3c38626672 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/PostProcessShader.h +++ b/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/PostProcessShader.h @@ -6,8 +6,7 @@ * */ -#ifndef __RENDERGL_POSTPROCESS_SHADER_H -#define __RENDERGL_POSTPROCESS_SHADER_H +#pragma once #include #include "GLSLShader.h" @@ -38,6 +37,4 @@ namespace RenderGL RenderTexture* m_rt; }; -} - -#endif +} // namespace RenderGL diff --git a/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/RenderGLConfig.h b/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/RenderGLConfig.h index 066b6e681d..4cdf646a34 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/RenderGLConfig.h +++ b/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/RenderGLConfig.h @@ -6,8 +6,7 @@ * */ -#ifndef __RENDERGL_CONFIG_H -#define __RENDERGL_CONFIG_H +#pragma once #include @@ -28,6 +27,3 @@ enum { MEMCATEGORY_RENDERING = 997 }; - - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/RenderTexture.h b/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/RenderTexture.h index 9839ca0a5f..7ff3c08f33 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/RenderTexture.h +++ b/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/RenderTexture.h @@ -6,8 +6,7 @@ * */ -#ifndef __RENDERGL_RENDERTEXTURE_H -#define __RENDERGL_RENDERTEXTURE_H +#pragma once #include "TextureCache.h" #include @@ -66,6 +65,4 @@ namespace RenderGL AZ::u32 m_frameBuffer; AZ::u32 m_depthBuffer; }; -} - -#endif +} // namespace RenderGL diff --git a/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/Shader.h b/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/Shader.h index ebb2e7e0a4..cd57446468 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/Shader.h +++ b/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/Shader.h @@ -6,8 +6,7 @@ * */ -#ifndef __RENDERGL_SHADER__H -#define __RENDERGL_SHADER__H +#pragma once #include #include "RenderGLConfig.h" @@ -51,6 +50,4 @@ namespace RenderGL virtual void SetUniform(const char* name, Texture* texture) = 0; virtual void SetUniform(const char* name, const float* values, uint32 numFloats) = 0; }; -} - -#endif +} // namespace RenderGL diff --git a/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/StandardMaterial.h b/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/StandardMaterial.h index 528269765c..2e240042db 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/StandardMaterial.h +++ b/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/StandardMaterial.h @@ -6,8 +6,7 @@ * */ -#ifndef __RENDERGL_STANDARD_MATERIAL_H -#define __RENDERGL_STANDARD_MATERIAL_H +#pragma once #include #include @@ -54,6 +53,3 @@ namespace RenderGL Texture* m_normalMap; }; } // namespace RenderGL - - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/TextureCache.h b/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/TextureCache.h index 4350cd67c7..57510133af 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/TextureCache.h +++ b/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/TextureCache.h @@ -6,8 +6,7 @@ * */ -#ifndef __RENDERGL_TEXTURECACHE_H -#define __RENDERGL_TEXTURECACHE_H +#pragma once #include #include @@ -76,7 +75,4 @@ namespace RenderGL Texture* m_whiteTexture; Texture* m_defaultNormalTexture; }; -} - - -#endif +} // namespace RenderGL diff --git a/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/VertexBuffer.h b/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/VertexBuffer.h index c76cf5137a..71c04e6c93 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/VertexBuffer.h +++ b/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/VertexBuffer.h @@ -6,8 +6,7 @@ * */ -#ifndef __RENDERGL_VERTEXBUFFER_H -#define __RENDERGL_VERTEXBUFFER_H +#pragma once #include "RenderGLConfig.h" #include @@ -66,5 +65,3 @@ namespace RenderGL bool GetHasError(); }; } // namespace RenderGL - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/glactor.h b/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/glactor.h index 36158306a1..ab2ef8686b 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/glactor.h +++ b/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/glactor.h @@ -6,8 +6,7 @@ * */ -#ifndef __RENDERGL_GLACTOR_H -#define __RENDERGL_GLACTOR_H +#pragma once #include "RenderGLConfig.h" #include "VertexBuffer.h" @@ -99,6 +98,4 @@ namespace RenderGL void Delete() override; }; -} - -#endif +} // namespace RenderGL diff --git a/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/shadercache.h b/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/shadercache.h index d33cfcfd7d..7006e62dde 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/shadercache.h +++ b/Gems/EMotionFX/Code/EMotionFX/Rendering/OpenGL2/Source/shadercache.h @@ -6,8 +6,7 @@ * */ -#ifndef __RENDERGL_SHADERCACHE__H -#define __RENDERGL_SHADERCACHE__H +#pragma once #include "Shader.h" #include @@ -45,5 +44,3 @@ namespace RenderGL AZStd::vector m_entries; // the shader cache entries }; } // namespace RenderGL - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioConfig.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioConfig.h index 7fc4b1224c..6d339148f3 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioConfig.h +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioConfig.h @@ -6,8 +6,7 @@ * */ -#ifndef __EMSTUDIO_EMSTUDIOCONFIG_H -#define __EMSTUDIO_EMSTUDIOCONFIG_H +#pragma once #include @@ -31,5 +30,3 @@ enum }; #define SHOW_REALTIMEINTERFACE_PERFORMANCEINFO - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioCore.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioCore.h index 9d510c0769..2899ebc33a 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioCore.h +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioCore.h @@ -6,8 +6,7 @@ * */ -#ifndef __EMSTUDIO_EMSTUDIOCORE_H -#define __EMSTUDIO_EMSTUDIOCORE_H +#pragma once // include all headers #include "EMStudioConfig.h" @@ -16,5 +15,3 @@ #include "PluginManager.h" #include "EMStudioPlugin.h" #include "LayoutManager.h" - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioPlugin.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioPlugin.h index 8ae84b6e49..f1cabccc31 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioPlugin.h +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/EMStudioPlugin.h @@ -6,8 +6,7 @@ * */ -#ifndef __EMSTUDIO_EMSTUDIOPLUGIN_H -#define __EMSTUDIO_EMSTUDIOPLUGIN_H +#pragma once // include MCore #if !defined(Q_MOC_RUN) @@ -127,5 +126,3 @@ namespace EMStudio virtual void AddWindowMenuEntries([[maybe_unused]] QMenu* parent) { } }; } // namespace EMStudio - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/InvisiblePlugin.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/InvisiblePlugin.h index 6021f52217..127705867a 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/InvisiblePlugin.h +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/InvisiblePlugin.h @@ -6,8 +6,7 @@ * */ -#ifndef __EMSTUDIO_INVISIBLEPLUGIN_H -#define __EMSTUDIO_INVISIBLEPLUGIN_H +#pragma once // include MCore #if !defined(Q_MOC_RUN) @@ -41,5 +40,3 @@ namespace EMStudio void CreateBaseInterface(const char* objectName) override { MCORE_UNUSED(objectName); } }; } // namespace EMStudio - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/NodeSelectionWindow.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/NodeSelectionWindow.h index df6f0195bc..97ca74284a 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/NodeSelectionWindow.h +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/NodeSelectionWindow.h @@ -6,8 +6,7 @@ * */ -#ifndef __EMSTUDIO_NODESELECTIONWINDOW_H -#define __EMSTUDIO_NODESELECTIONWINDOW_H +#pragma once // include MCore #if !defined(Q_MOC_RUN) @@ -57,5 +56,3 @@ namespace EMStudio bool m_accepted; }; } // namespace EMStudio - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/PluginManager.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/PluginManager.h index e3a5f9627a..b295f786a0 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/PluginManager.h +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/PluginManager.h @@ -6,8 +6,7 @@ * */ -#ifndef __EMSTUDIO_PLUGINMANAGER_H -#define __EMSTUDIO_PLUGINMANAGER_H +#pragma once #include #include @@ -68,5 +67,3 @@ namespace EMStudio void UnloadPlugins(); }; } // namespace EMStudio - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/ManipulatorCallbacks.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/ManipulatorCallbacks.h index 2f9201ffa9..16cf8f8f31 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/ManipulatorCallbacks.h +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/ManipulatorCallbacks.h @@ -6,8 +6,7 @@ * */ -#ifndef __MCOMMON_MANIPULATORCALLBACKS_H -#define __MCOMMON_MANIPULATORCALLBACKS_H +#pragma once // include the Core system #include "../EMStudioConfig.h" @@ -142,7 +141,4 @@ namespace EMStudio bool GetResetFollowMode() const override { return true; } }; -} // namespace MCommon - - -#endif +} // namespace EMStudio diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderLayouts.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderLayouts.h index fbc4178009..c792efddda 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderLayouts.h +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderLayouts.h @@ -6,8 +6,7 @@ * */ -#ifndef __EMSTUDIO_RENDERPLUGINLAYOUTS_H -#define __EMSTUDIO_RENDERPLUGINLAYOUTS_H +#pragma once // include the required headers #include "RenderPlugin.h" @@ -176,6 +175,3 @@ namespace EMStudio // register all available layouts (this will be automatically called inside the RenderPlugin's constructor) void EMSTUDIO_API RegisterRenderPluginLayouts(RenderPlugin* renderPlugin); } // namespace EMStudio - - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderUpdateCallback.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderUpdateCallback.h index a9bc26ae22..af5c1c367a 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderUpdateCallback.h +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderUpdateCallback.h @@ -6,8 +6,7 @@ * */ -#ifndef __EMSTUDIO_RENDERUPDATECALLBACK_H -#define __EMSTUDIO_RENDERUPDATECALLBACK_H +#pragma once #include "../EMStudioConfig.h" #include @@ -38,6 +37,3 @@ namespace EMStudio RenderPlugin* m_plugin; }; } // namespace EMStudio - - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/ToolBarPlugin.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/ToolBarPlugin.h index dcda6d2c1f..6c329a1320 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/ToolBarPlugin.h +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/ToolBarPlugin.h @@ -6,8 +6,7 @@ * */ -#ifndef __EMSTUDIO_TOOLBARPLUGIN_H -#define __EMSTUDIO_TOOLBARPLUGIN_H +#pragma once // include MCore #if !defined(Q_MOC_RUN) @@ -59,5 +58,3 @@ namespace EMStudio QPointer m_bar; }; } // namespace EMStudio - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/GLWidget.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/GLWidget.h index f821a7710e..e94fc0a060 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/GLWidget.h +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/GLWidget.h @@ -6,8 +6,7 @@ * */ -#ifndef __EMSTUDIO_GLWIDGET_H -#define __EMSTUDIO_GLWIDGET_H +#pragma once #if !defined(Q_MOC_RUN) #include "../RenderPluginsConfig.h" @@ -84,6 +83,3 @@ namespace EMStudio AZ::Debug::Timer m_perfTimer; }; } // namespace EMStudio - - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/RenderPluginsConfig.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/RenderPluginsConfig.h index 2bb4301781..b4b0299c7e 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/RenderPluginsConfig.h +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/RenderPluginsConfig.h @@ -6,8 +6,7 @@ * */ -#ifndef __EMSTUDIO_RENDERPLUGINSCONFIG_H -#define __EMSTUDIO_RENDERPLUGINSCONFIG_H +#pragma once #include @@ -27,5 +26,3 @@ enum { MEMCATEGORY_RENDERPLUGIN = 993 }; - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/AnimGraphPlugin.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/AnimGraphPlugin.h index 3510920d2c..14ecf6db34 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/AnimGraphPlugin.h +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/AnimGraphPlugin.h @@ -6,8 +6,7 @@ * */ -#ifndef __EMSTUDIO_ANIMGRAPHPLUGIN_H -#define __EMSTUDIO_ANIMGRAPHPLUGIN_H +#pragma once // include MCore #if !defined(Q_MOC_RUN) @@ -320,6 +319,3 @@ namespace EMStudio void UpdateWindowActionsCheckState(); }; } // namespace EMStudio - - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/DebugEventHandler.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/DebugEventHandler.h index 5e8e76b7ef..4786527f62 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/DebugEventHandler.h +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/DebugEventHandler.h @@ -6,8 +6,7 @@ * */ -#ifndef __EMSTUDIO_BENDSETUPINSTANCEDEBUGEVENTHANDLER_H -#define __EMSTUDIO_BENDSETUPINSTANCEDEBUGEVENTHANDLER_H +#pragma once // include MCore #if !defined(Q_MOC_RUN) @@ -45,5 +44,3 @@ namespace EMStudio private: }; } // namespace EMStudio - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/GameController.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/GameController.h index 47cfb9ddfc..b1925add10 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/GameController.h +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/GameController.h @@ -6,8 +6,7 @@ * */ -#ifndef __GAMECONTROLLER_H -#define __GAMECONTROLLER_H +#pragma once // include the required headers @@ -157,5 +156,3 @@ private: }; #endif - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/GameControllerWindow.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/GameControllerWindow.h index 059108625a..d3dda7196f 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/GameControllerWindow.h +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/GameControllerWindow.h @@ -6,8 +6,7 @@ * */ -#ifndef __EMSTUDIO_GAMECONTROLLERWINDOW_H -#define __EMSTUDIO_GAMECONTROLLERWINDOW_H +#pragma once #if !defined(Q_MOC_RUN) #include "../StandardPluginsConfig.h" @@ -190,5 +189,3 @@ namespace EMStudio void AutoSelectGameController(); }; } // namespace EMStudio - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/GraphWidgetCallback.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/GraphWidgetCallback.h index ff14484dc5..2ce33f9011 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/GraphWidgetCallback.h +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/GraphWidgetCallback.h @@ -6,8 +6,7 @@ * */ -#ifndef __EMSTUDIO_GRAPHWIDGETCALLBACK_H -#define __EMSTUDIO_GRAPHWIDGETCALLBACK_H +#pragma once // include required headers #include @@ -36,5 +35,3 @@ namespace EMStudio NodeGraphWidget* m_graphWidget; }; } // namespace EMStudio - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/Attachments/AttachmentNodesWindow.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/Attachments/AttachmentNodesWindow.h index 1743db3ab9..94cfaf275b 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/Attachments/AttachmentNodesWindow.h +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/Attachments/AttachmentNodesWindow.h @@ -6,8 +6,7 @@ * */ -#ifndef __EMSTUDIO_ATTACHMENTNODESWINDOW_H -#define __EMSTUDIO_ATTACHMENTNODESWINDOW_H +#pragma once // include MCore #if !defined(Q_MOC_RUN) @@ -80,6 +79,3 @@ namespace EMStudio QToolButton* m_removeNodesButton; }; } // namespace EMStudio - - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/Attachments/AttachmentsHierarchyWindow.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/Attachments/AttachmentsHierarchyWindow.h index 92a55668e8..e5ecbedc19 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/Attachments/AttachmentsHierarchyWindow.h +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/Attachments/AttachmentsHierarchyWindow.h @@ -6,8 +6,7 @@ * */ -#ifndef __EMSTUDIO_ATTACHMENTSHIERARCHYWINDOW_H -#define __EMSTUDIO_ATTACHMENTSHIERARCHYWINDOW_H +#pragma once // include MCore #if !defined(Q_MOC_RUN) @@ -42,6 +41,3 @@ namespace EMStudio QTreeWidget* m_hierarchy; }; } // namespace EMStudio - - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/Attachments/AttachmentsPlugin.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/Attachments/AttachmentsPlugin.h index edab3a9580..2d8d9632ba 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/Attachments/AttachmentsPlugin.h +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/Attachments/AttachmentsPlugin.h @@ -6,8 +6,7 @@ * */ -#ifndef __EMSTUDIO_ATTACHMENTSPLUGIN_H -#define __EMSTUDIO_ATTACHMENTSPLUGIN_H +#pragma once // include MCore #if !defined(Q_MOC_RUN) @@ -91,6 +90,3 @@ namespace EMStudio AttachmentNodesWindow* m_attachmentNodesWindow; }; } // namespace EMStudio - - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/LogWindow/LogWindowCallback.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/LogWindow/LogWindowCallback.h index 2e319e1dfa..586dfb8f44 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/LogWindow/LogWindowCallback.h +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/LogWindow/LogWindowCallback.h @@ -6,8 +6,7 @@ * */ -#ifndef __EMSTUDIO_LOGWINDOWCALLBACK_H -#define __EMSTUDIO_LOGWINDOWCALLBACK_H +#pragma once #if !defined(Q_MOC_RUN) #include "../StandardPluginsConfig.h" @@ -78,5 +77,3 @@ namespace EMStudio } // namespace EMStudio Q_DECLARE_METATYPE(MCore::LogCallback::ELogLevel) - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/LogWindow/LogWindowPlugin.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/LogWindow/LogWindowPlugin.h index 61b6ab4b8c..db8aa0ab24 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/LogWindow/LogWindowPlugin.h +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/LogWindow/LogWindowPlugin.h @@ -6,8 +6,7 @@ * */ -#ifndef __EMSTUDIO_LOGWINDOWPLUGIN_H -#define __EMSTUDIO_LOGWINDOWPLUGIN_H +#pragma once #if !defined(Q_MOC_RUN) #include @@ -65,5 +64,3 @@ namespace EMStudio AzQtComponents::FilteredSearchWidget* m_searchWidget; }; } // namespace EMStudio - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionWindow/MotionExtractionWindow.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionWindow/MotionExtractionWindow.h index 2f0bf63685..e4004a62aa 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionWindow/MotionExtractionWindow.h +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionWindow/MotionExtractionWindow.h @@ -6,8 +6,7 @@ * */ -#ifndef __EMSTUDIO_MOTIONEXTRACTIONWINDOW_H -#define __EMSTUDIO_MOTIONEXTRACTIONWINDOW_H +#pragma once // include MCore #if !defined(Q_MOC_RUN) @@ -88,6 +87,3 @@ namespace EMStudio void CreateWarningWidget(); }; } // namespace EMStudio - - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionWindow/MotionPropertiesWindow.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionWindow/MotionPropertiesWindow.h index eb1bcad3a3..3aa9133bb4 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionWindow/MotionPropertiesWindow.h +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionWindow/MotionPropertiesWindow.h @@ -6,8 +6,7 @@ * */ -#ifndef __EMSTUDIO_MOTIONPROPERTIESWINDOW_H -#define __EMSTUDIO_MOTIONPROPERTIESWINDOW_H +#pragma once // include MCore #if !defined(Q_MOC_RUN) @@ -48,6 +47,3 @@ namespace EMStudio void FinalizeSubProperties(); }; } // namespace EMStudio - - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionWindow/MotionRetargetingWindow.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionWindow/MotionRetargetingWindow.h index 3090a1f8bd..dbf39ccd84 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionWindow/MotionRetargetingWindow.h +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionWindow/MotionRetargetingWindow.h @@ -6,8 +6,7 @@ * */ -#ifndef __EMSTUDIO_MOTIONRETARGETINGWINDOW_H -#define __EMSTUDIO_MOTIONRETARGETINGWINDOW_H +#pragma once // include MCore #if !defined(Q_MOC_RUN) @@ -52,6 +51,3 @@ namespace EMStudio CommandSystem::SelectionList m_selectionList; }; } // namespace EMStudio - - -#endif diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/StandardPluginsConfig.h b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/StandardPluginsConfig.h index 80c51cc36f..8937c4efaf 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/StandardPluginsConfig.h +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/StandardPluginsConfig.h @@ -6,8 +6,7 @@ * */ -#ifndef __EMSTUDIO_STANDARDPLUGINSCONFIG_H -#define __EMSTUDIO_STANDARDPLUGINSCONFIG_H +#pragma once // include the EMotion FX config and mem categories on default #include @@ -32,5 +31,3 @@ enum MEMCATEGORY_STANDARDPLUGINS_ANIMGRAPH = 1001, MEMCATEGORY_STANDARDPLUGINS_RESEARCH = 1002 }; - -#endif diff --git a/Gems/EMotionFX/Code/MysticQt/Source/MysticQtManager.h b/Gems/EMotionFX/Code/MysticQt/Source/MysticQtManager.h index 9c8a73b92f..c313cd5489 100644 --- a/Gems/EMotionFX/Code/MysticQt/Source/MysticQtManager.h +++ b/Gems/EMotionFX/Code/MysticQt/Source/MysticQtManager.h @@ -6,8 +6,7 @@ * */ -#ifndef __MYSTICQT_MANAGER_H -#define __MYSTICQT_MANAGER_H +#pragma once // include required files #if !defined(Q_MOC_RUN) @@ -91,5 +90,3 @@ namespace MysticQt MCORE_INLINE const AZStd::string& GetAppDir() { return gMysticQtManager->GetAppDir(); } MCORE_INLINE const AZStd::string& GetDataDir() { return gMysticQtManager->GetDataDir(); } } // namespace MysticQt - -#endif From 016eda6cf13fdbaba417b6efc2c63f5e5d3039e3 Mon Sep 17 00:00:00 2001 From: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> Date: Wed, 8 Dec 2021 13:57:45 -0800 Subject: [PATCH 165/948] Fixed infinite recursion when adding prefabs While processing prefabs into spawnables new prefabs can be added for later processing. Because the new prefabs were immediately added to the list of prefabs it could happen that the new prefabs would be added to the active processor for processing, which could lead to infinite recursion. Adding prefabs while iterating prefabs now delays the addition until the iteration has completed. Signed-off-by: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> --- .../Spawnable/PrefabProcessorContext.cpp | 26 +++++++++++++++++-- .../Prefab/Spawnable/PrefabProcessorContext.h | 1 + 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp index efef0f53de..ff32ac2ea5 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp @@ -32,8 +32,24 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils bool PrefabProcessorContext::AddPrefab(AZStd::string prefabName, PrefabDom prefab) { - auto result = m_prefabs.emplace(AZStd::move(prefabName), AZStd::move(prefab)); - return result.second; + if (!m_isIterating) + { + auto result = m_prefabs.emplace(AZStd::move(prefabName), AZStd::move(prefab)); + return result.second; + } + else + { + auto it = m_prefabs.find(prefabName); + if (it == m_prefabs.end()) + { + auto result = m_pendingPrefabAdditions.emplace(AZStd::move(prefabName), AZStd::move(prefab)); + return result.second; + } + else + { + return false; + } + } } void PrefabProcessorContext::ListPrefabs(const AZStd::function& callback) @@ -43,7 +59,13 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils { callback(it.first, it.second); } + m_isIterating = false; + for (auto& prefab : m_pendingPrefabAdditions) + { + m_prefabs.emplace(AZStd::move(prefab.first), AZStd::move(prefab.second)); + } + m_pendingPrefabAdditions.clear(); } void PrefabProcessorContext::ListPrefabs(const AZStd::function& callback) const diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.h index d35a09a574..ade17e2ff0 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.h @@ -134,6 +134,7 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils AZ::Data::AssetLoadBehavior ToAssetLoadBehavior(EntityAliasSpawnableLoadBehavior loadBehavior) const; NamedPrefabContainer m_prefabs; + NamedPrefabContainer m_pendingPrefabAdditions; SpawnableEntityAliasStore m_entityAliases; ProcessedObjectStoreContainer m_products; ProductAssetDependencyContainer m_registeredProductAssetDependencies; From 7e38a5f35cbf99e0fd852bfc276b65cce0716a53 Mon Sep 17 00:00:00 2001 From: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> Date: Wed, 8 Dec 2021 18:32:18 -0800 Subject: [PATCH 166/948] Fixed entity registration issue when setting up Spawnable Entity Aliases. In some cases entities created for use as a Spawnable Entity Alias would share an entity id with their original. This is no longer working due to a reverse lookup from an entity id to its PrefabDOM. Upon further investigation this turned out to not matter as instances that are created by the PrefabCatchmentProcessor would create new entity ids any way. This cause unexpected behavior at runtime as entity relations may be broken. This will be addressed in a future fix. Testing the above also highlighted a possible double delete in the builder when aliases were registered. This has also been fixed. Signed-off-by: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> --- .../Prefab/Spawnable/PrefabProcessorContext.cpp | 5 +++-- .../Prefab/Spawnable/SpawnableUtils.cpp | 11 ++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp index ff32ac2ea5..d4fd785118 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp @@ -246,9 +246,10 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils it = aliasVisitors.emplace(source->m_spawnable.GetId(), AZStd::move(visitor)).first; } it->second.AddAlias( - AZ::Data::Asset(&target->m_spawnable, loadBehavior), alias.m_tag, sourceIndex, targetIndex, + AZ::Data::Asset(target->m_spawnable.GetId(), azrtti_typeid()), alias.m_tag, + sourceIndex, targetIndex, alias.m_aliasType, alias.m_loadBehavior == EntityAliasSpawnableLoadBehavior::QueueLoad); - + // Register the dependency between the two spawnables. RegisterProductAssetDependency(source->m_spawnable.GetId(), target->m_spawnable.GetId(), loadBehavior); } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp index 5e552aad3f..b51df104fe 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp @@ -86,7 +86,9 @@ namespace AzToolsFramework::Prefab::SpawnableUtils entityData.has_value(), "SpawnbleUtils were unable to locate entity '%.*s' in Instance '%s' for replacing.", AZ_STRING_ARG(alias), source.GetTemplateSourcePath().c_str()); auto placeholder = AZStd::make_unique(entityData->get().GetId(), entityData->get().GetName()); - return instance->ReplaceEntity(AZStd::move(placeholder), alias); + AZStd::unique_ptr result = instance->ReplaceEntity(AZStd::move(placeholder), alias); + result->SetId(AZ::Entity::MakeId()); + return result; } AZStd::unique_ptr ReplaceEntityWithPlaceholder(AZ::EntityId entityId, AzFramework::Spawnable& source) @@ -102,7 +104,7 @@ namespace AzToolsFramework::Prefab::SpawnableUtils aznumeric_cast(entityId)); source.GetEntities()[index] = AZStd::make_unique(original->GetId(), original->GetName()); - + original->SetId(AZ::Entity::MakeId()); return original; } @@ -123,10 +125,9 @@ namespace AzToolsFramework::Prefab::SpawnableUtils case PCU::EntityAliasType::Replace: return ResultPair(ReplaceEntityWithPlaceholder(entityId, source), AzFramework::Spawnable::EntityAliasType::Replace); case PCU::EntityAliasType::Additional: - ResultPair(AZStd::make_unique(AZ::Entity::MakeId()), AzFramework::Spawnable::EntityAliasType::Additional); + ResultPair(AZStd::make_unique(), AzFramework::Spawnable::EntityAliasType::Additional); case PCU::EntityAliasType::Merge: - // Use the same entity id as the original entity so at runtime the entity ids can be verified to match. - ResultPair(AZStd::make_unique(entityId), AzFramework::Spawnable::EntityAliasType::Merge); + ResultPair(AZStd::make_unique(), AzFramework::Spawnable::EntityAliasType::Merge); default: AZ_Assert( false, "Invalid PrefabProcessorContext::EntityAliasType type (%i) provided.", aznumeric_cast(aliasType)); From cbea11c452559170f03d2bedbfff1cc4d922b7bb Mon Sep 17 00:00:00 2001 From: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> Date: Thu, 9 Dec 2021 14:48:56 -0800 Subject: [PATCH 167/948] Minor performance optimization to Prefab Instance. Signed-off-by: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> --- .../AzToolsFramework/Prefab/Instance/Instance.cpp | 8 ++++---- .../AzToolsFramework/Prefab/Instance/Instance.h | 4 ++-- .../Prefab/Spawnable/PrefabProcessorContext.cpp | 1 + 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/Instance.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/Instance.cpp index 490a151925..c685735f40 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/Instance.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/Instance.cpp @@ -142,14 +142,14 @@ namespace AzToolsFramework return m_templateSourcePath; } - void Instance::SetTemplateSourcePath(AZ::IO::PathView sourcePath) + void Instance::SetTemplateSourcePath(AZ::IO::Path sourcePath) { - m_templateSourcePath = sourcePath; + m_templateSourcePath = AZStd::move(sourcePath); } - void Instance::SetContainerEntityName(AZStd::string_view containerName) + void Instance::SetContainerEntityName(AZStd::string containerName) { - m_containerEntity->SetName(containerName); + m_containerEntity->SetName(AZStd::move(containerName)); } bool Instance::AddEntity(AZ::Entity& entity) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/Instance.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/Instance.h index 25971093cd..625357f485 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/Instance.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/Instance.h @@ -80,8 +80,8 @@ namespace AzToolsFramework void SetTemplateId(TemplateId templateId); const AZ::IO::Path& GetTemplateSourcePath() const; - void SetTemplateSourcePath(AZ::IO::PathView sourcePath); - void SetContainerEntityName(AZStd::string_view containerName); + void SetTemplateSourcePath(AZ::IO::Path sourcePath); + void SetContainerEntityName(AZStd::string containerName); bool AddEntity(AZ::Entity& entity); bool AddEntity(AZStd::unique_ptr&& entity); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp index d4fd785118..d79b270bb8 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp @@ -154,6 +154,7 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils { using namespace AzToolsFramework::Prefab; + // Resolve prefab links into spawnable links for the provided spawnable. for (EntityAliasStore& entityAlias : m_entityAliases) { auto sourcePrefab = AZStd::get_if(&entityAlias.m_source); From 76a913882c78c631a8bf649ed0d6c4ba6c08439c Mon Sep 17 00:00:00 2001 From: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> Date: Fri, 10 Dec 2021 09:03:36 -0800 Subject: [PATCH 168/948] Resolving links in the Prefab Processing Stack now also makes sure that entity ids of aliased entities are appropriately unique or match. Signed-off-by: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> --- .../Spawnable/PrefabProcessorContext.cpp | 24 +++++++++++++++++++ .../Prefab/Spawnable/SpawnableUtils.cpp | 4 ++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp index d79b270bb8..5c67c8f3b3 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp @@ -7,6 +7,7 @@ */ #include +#include #include #include #include @@ -253,6 +254,29 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils // Register the dependency between the two spawnables. RegisterProductAssetDependency(source->m_spawnable.GetId(), target->m_spawnable.GetId(), loadBehavior); + + // Patch up all entity ids so the alias points to the same entity id if needed. + switch (alias.m_aliasType) + { + case AzFramework::Spawnable::EntityAliasType::Original: + continue; + case AzFramework::Spawnable::EntityAliasType::Disable: + continue; + case AzFramework::Spawnable::EntityAliasType::Replace: + break; // Requires entity id for alias in source and target spawnable matches. + case AzFramework::Spawnable::EntityAliasType::Additional: + continue; + case AzFramework::Spawnable::EntityAliasType::Merge: + break; // Requires entity id for alias in source and target spawnable matches. + default: + continue; + } + + auto entityIdMapper = [source, target](const AZ::EntityId& originalId, bool /*isEntityId*/) -> AZ::EntityId + { + return originalId == target->m_index ? source->m_index : originalId; + }; + AZ::EntityUtils::ReplaceEntityIdsAndEntityRefs(&target->m_spawnable, entityIdMapper); } } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp index b51df104fe..feed44c740 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp @@ -85,9 +85,9 @@ namespace AzToolsFramework::Prefab::SpawnableUtils AZ_Assert( entityData.has_value(), "SpawnbleUtils were unable to locate entity '%.*s' in Instance '%s' for replacing.", AZ_STRING_ARG(alias), source.GetTemplateSourcePath().c_str()); - auto placeholder = AZStd::make_unique(entityData->get().GetId(), entityData->get().GetName()); + // A new entity id can be used for the placeholder as `ReplaceEntity` will swap the entity ids. + auto placeholder = AZStd::make_unique(AZ::Entity::MakeId(), entityData->get().GetName()); AZStd::unique_ptr result = instance->ReplaceEntity(AZStd::move(placeholder), alias); - result->SetId(AZ::Entity::MakeId()); return result; } From 9def902e1ceac7fc82b0a9bca91c75647c755d54 Mon Sep 17 00:00:00 2001 From: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> Date: Fri, 10 Dec 2021 17:52:03 -0800 Subject: [PATCH 169/948] Fixes up parents for entities that are moved to another Prefab. This fixes issues with entities that are moved to another Prefab and have a parent that was also moved to the same Prefab. Entities that have their parent moved to another Prefab continue to work as is because a placeholder entity is always left behind. Entities that are moved to another Prefab but have a parent that's still in the original Prefab will currently not work correctly. This will be a addressed in a future commit. Signed-off-by: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> --- .../Components/TransformComponent.cpp | 25 +-- .../Prefab/Spawnable/SpawnableUtils.cpp | 169 +++++++----------- .../Prefab/Spawnable/SpawnableUtils.h | 18 +- 3 files changed, 78 insertions(+), 134 deletions(-) diff --git a/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.cpp b/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.cpp index 809f664a10..2f3fc3cb8b 100644 --- a/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.cpp +++ b/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.cpp @@ -585,21 +585,24 @@ namespace AzFramework EBUS_EVENT_PTR(m_notificationBus, AZ::TransformNotificationBus, OnParentChanged, oldParent, parentId); m_parentChangedEvent.Signal(oldParent, parentId); - if (oldParent != parentId) // Don't send removal notification while activating. + if (GetEntity() != nullptr) { - EBUS_EVENT_ID(oldParent, AZ::TransformNotificationBus, OnChildRemoved, GetEntityId()); - auto oldParentTransform = AZ::TransformBus::FindFirstHandler(oldParent); - if (oldParentTransform) + if (oldParent != parentId) // Don't send removal notification while activating. { - oldParentTransform->NotifyChildChangedEvent(AZ::ChildChangeType::Removed, GetEntityId()); + EBUS_EVENT_ID(oldParent, AZ::TransformNotificationBus, OnChildRemoved, GetEntityId()); + auto oldParentTransform = AZ::TransformBus::FindFirstHandler(oldParent); + if (oldParentTransform) + { + oldParentTransform->NotifyChildChangedEvent(AZ::ChildChangeType::Removed, GetEntityId()); + } } - } - EBUS_EVENT_ID(parentId, AZ::TransformNotificationBus, OnChildAdded, GetEntityId()); - auto newParentTransform = AZ::TransformBus::FindFirstHandler(parentId); - if (newParentTransform) - { - newParentTransform->NotifyChildChangedEvent(AZ::ChildChangeType::Added, GetEntityId()); + EBUS_EVENT_ID(parentId, AZ::TransformNotificationBus, OnChildAdded, GetEntityId()); + auto newParentTransform = AZ::TransformBus::FindFirstHandler(parentId); + if (newParentTransform) + { + newParentTransform->NotifyChildChangedEvent(AZ::ChildChangeType::Added, GetEntityId()); + } } } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp index feed44c740..e30417324c 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -52,14 +53,32 @@ namespace AzToolsFramework::Prefab::SpawnableUtils return result; } + const AZ::Entity* FindEntity(AZ::EntityId entityId, const AzToolsFramework::Prefab::Instance& source) + { + const AZ::Entity* result = nullptr; + source.GetConstEntities( + [&result, entityId](const AZ::Entity& entity) + { + if (entity.GetId() != entityId) + { + return true; + } + else + { + result = &entity; + return false; + } + }); + return result; + } + AZ::Entity* FindEntity(AZ::EntityId entityId, AzFramework::Spawnable& source) { uint32_t index = AzToolsFramework::Prefab::SpawnableUtils::FindEntityIndex(entityId, source); return index != InvalidEntityIndex ? source.GetEntities()[index].get() : nullptr; } - template - AZStd::unique_ptr CloneEntity(AZ::EntityId entityId, T& source) + AZStd::unique_ptr CloneEntity(AZ::EntityId entityId, AzToolsFramework::Prefab::Instance& source) { AZ::Entity* target = Internal::FindEntity(entityId, source); AZ_Assert( @@ -74,43 +93,30 @@ namespace AzToolsFramework::Prefab::SpawnableUtils return clone; } - AZStd::unique_ptr ReplaceEntityWithPlaceholder(AZ::EntityId entityId, AzToolsFramework::Prefab::Instance& source) + AZStd::unique_ptr ReplaceEntityWithPlaceholder( + AZ::EntityId entityId, + [[maybe_unused]] AZStd::string_view sourcePrefabName, + AzToolsFramework::Prefab::Instance& source) { auto&& [instance, alias] = source.FindInstanceAndAlias(entityId); AZ_Assert( - instance, "SpawnbleUtils were unable to locate entity alias with id %zu in Instance '%s' for replacing.", - aznumeric_cast(entityId), source.GetTemplateSourcePath().c_str()); + instance, "SpawnbleUtils were unable to locate entity alias with id %zu in Instance '%.*s' for replacing.", + aznumeric_cast(entityId), AZ_STRING_ARG(sourcePrefabName)); EntityOptionalReference entityData = instance->GetEntity(alias); AZ_Assert( - entityData.has_value(), "SpawnbleUtils were unable to locate entity '%.*s' in Instance '%s' for replacing.", - AZ_STRING_ARG(alias), source.GetTemplateSourcePath().c_str()); + entityData.has_value(), "SpawnbleUtils were unable to locate entity '%.*s' in Instance '%.*s' for replacing.", + AZ_STRING_ARG(alias), AZ_STRING_ARG(sourcePrefabName)); // A new entity id can be used for the placeholder as `ReplaceEntity` will swap the entity ids. auto placeholder = AZStd::make_unique(AZ::Entity::MakeId(), entityData->get().GetName()); - AZStd::unique_ptr result = instance->ReplaceEntity(AZStd::move(placeholder), alias); - return result; - } - - AZStd::unique_ptr ReplaceEntityWithPlaceholder(AZ::EntityId entityId, AzFramework::Spawnable& source) - { - uint32_t index = AzToolsFramework::Prefab::SpawnableUtils::FindEntityIndex(entityId, source); - AZ_Assert( - index != InvalidEntityIndex, "SpawnbleUtils were unable to locate entity alias with id %zu in Spawnable for replacing.", - aznumeric_cast(entityId)); - - AZStd::unique_ptr original = AZStd::move(source.GetEntities()[index]); - AZ_Assert( - original, "SpawnbleUtils were unable to locate entity with id %zu in Spawnable for replacing.", - aznumeric_cast(entityId)); - - source.GetEntities()[index] = AZStd::make_unique(original->GetId(), original->GetName()); - original->SetId(AZ::Entity::MakeId()); - return original; + return instance->ReplaceEntity(AZStd::move(placeholder), alias); } - template AZStd::pair, AzFramework::Spawnable::EntityAliasType> ApplyAlias( - Source& source, AZ::EntityId entityId, AzToolsFramework::Prefab::PrefabConversionUtils::EntityAliasType aliasType) + AZStd::string_view sourcePrefabName, + AzToolsFramework::Prefab::Instance& source, + AZ::EntityId entityId, + AzToolsFramework::Prefab::PrefabConversionUtils::EntityAliasType aliasType) { namespace PCU = AzToolsFramework::Prefab::PrefabConversionUtils; using ResultPair = AZStd::pair, AzFramework::Spawnable::EntityAliasType>; @@ -123,11 +129,13 @@ namespace AzToolsFramework::Prefab::SpawnableUtils case PCU::EntityAliasType::OptionalReplace: return ResultPair(CloneEntity(entityId, source), AzFramework::Spawnable::EntityAliasType::Replace); case PCU::EntityAliasType::Replace: - return ResultPair(ReplaceEntityWithPlaceholder(entityId, source), AzFramework::Spawnable::EntityAliasType::Replace); + return ResultPair( + ReplaceEntityWithPlaceholder(entityId, sourcePrefabName, source), + AzFramework::Spawnable::EntityAliasType::Replace); case PCU::EntityAliasType::Additional: - ResultPair(AZStd::make_unique(), AzFramework::Spawnable::EntityAliasType::Additional); + return ResultPair(AZStd::make_unique(), AzFramework::Spawnable::EntityAliasType::Additional); case PCU::EntityAliasType::Merge: - ResultPair(AZStd::make_unique(), AzFramework::Spawnable::EntityAliasType::Merge); + return ResultPair(AZStd::make_unique(), AzFramework::Spawnable::EntityAliasType::Merge); default: AZ_Assert( false, "Invalid PrefabProcessorContext::EntityAliasType type (%i) provided.", aznumeric_cast(aliasType)); @@ -183,7 +191,8 @@ namespace AzToolsFramework::Prefab::SpawnableUtils AliasPath alias = source.GetAliasPathRelativeToInstance(entityId); if (!alias.empty()) { - auto&& [replacement, storedAliasType] = Internal::ApplyAlias(source, entityId, aliasType); + auto&& [replacement, storedAliasType] = + Internal::ApplyAlias(sourcePrefabName, source, entityId, aliasType); if (replacement) { AZ::Entity* result = replacement.get(); @@ -213,82 +222,30 @@ namespace AzToolsFramework::Prefab::SpawnableUtils } } - AZ::Entity* CreateEntityAlias( - AZStd::string sourcePrefabName, - AzToolsFramework::Prefab::Instance& source, - AzFramework::Spawnable& target, - AZ::EntityId entityId, - AzToolsFramework::Prefab::PrefabConversionUtils::EntityAliasType aliasType, - AzToolsFramework::Prefab::PrefabConversionUtils::EntityAliasSpawnableLoadBehavior loadBehavior, - uint32_t tag, - AzToolsFramework::Prefab::PrefabConversionUtils::PrefabProcessorContext& context) + void PatchParents(const AzToolsFramework::Prefab::Instance& source, AzToolsFramework::Prefab::Instance& target) { - using namespace AzToolsFramework::Prefab::PrefabConversionUtils; - - AliasPath alias = source.GetAliasPathRelativeToInstance(entityId); - if (!alias.empty()) - { - auto&& [replacement, storedAliasType] = Internal::ApplyAlias(source, entityId, aliasType); - if (replacement) + target.GetEntities( + [&source, &target](AZStd::unique_ptr& entity) { - AZ::Entity* result = replacement.get(); - target.GetEntities().push_back(AZStd::move(replacement)); - - EntityAliasStore store; - store.m_aliasType = storedAliasType; - store.m_source.emplace(AZStd::move(sourcePrefabName), AZStd::move(alias)); - store.m_target.emplace(target, result->GetId()); - store.m_tag = tag; - store.m_loadBehavior = loadBehavior; - context.RegisterSpawnableEntityAlias(AZStd::move(store)); - - return result; - } - else - { - AZ_Assert(false, "A replacement for entity with id %zu could not be created.", static_cast(entityId)); - return nullptr; - } - } - else - { - AZ_Assert(false, "Entity with id %llu was not found in the source prefab.", static_cast(entityId)); - return nullptr; - } - } - - AZ::Entity* CreateEntityAlias( - AzFramework::Spawnable& source, - AzFramework::Spawnable& target, - AZ::EntityId entityId, - AzToolsFramework::Prefab::PrefabConversionUtils::EntityAliasType aliasType, - AzToolsFramework::Prefab::PrefabConversionUtils::EntityAliasSpawnableLoadBehavior loadBehavior, - uint32_t tag, - AzToolsFramework::Prefab::PrefabConversionUtils::PrefabProcessorContext& context) - { - using namespace AzToolsFramework::Prefab::PrefabConversionUtils; - - auto&& [replacement, storedAliasType] = Internal::ApplyAlias(source, entityId, aliasType); - if (replacement) - { - AZ::Entity* result = replacement.get(); - target.GetEntities().push_back(AZStd::move(replacement)); - - EntityAliasStore store; - store.m_aliasType = storedAliasType; - store.m_source.emplace(source, entityId); - store.m_target.emplace(target, result->GetId()); - store.m_tag = tag; - store.m_loadBehavior = loadBehavior; - context.RegisterSpawnableEntityAlias(AZStd::move(store)); - - return result; - } - else - { - AZ_Assert(false, "A replacement for entity with id %zu could not be created.", static_cast(entityId)); - return nullptr; - } + AzFramework::TransformComponent* transform = entity->FindComponent(); + if (transform) + { + if (transform->GetParentId().IsValid()) + { + AliasPath originalParentAlias = source.GetAliasPathRelativeToInstance(transform->GetParentId()); + if (!originalParentAlias.empty()) + { + AZ::EntityId targetParentId = target.GetEntityIdFromAliasPath(originalParentAlias); + if (targetParentId.IsValid()) + { + // If this is valid then the parent was moved to the target spawnable so adjust the entity id. + transform->SetParent(targetParentId); + } + } + } + } + return true; + }); } uint32_t FindEntityIndex(AZ::EntityId entity, const AzFramework::Spawnable& spawnable) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.h index ea8a49857e..ea33ca09cc 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.h @@ -41,23 +41,7 @@ namespace AzToolsFramework::Prefab::SpawnableUtils AzToolsFramework::Prefab::PrefabConversionUtils::EntityAliasSpawnableLoadBehavior loadBehavior, uint32_t tag, AzToolsFramework::Prefab::PrefabConversionUtils::PrefabProcessorContext& context); - AZ::Entity* CreateEntityAlias( - AZStd::string sourcePrefabName, - AzToolsFramework::Prefab::Instance& source, - AzFramework::Spawnable& target, - AZ::EntityId entityId, - AzToolsFramework::Prefab::PrefabConversionUtils::EntityAliasType aliasType, - AzToolsFramework::Prefab::PrefabConversionUtils::EntityAliasSpawnableLoadBehavior loadBehavior, - uint32_t tag, - AzToolsFramework::Prefab::PrefabConversionUtils::PrefabProcessorContext& context); - AZ::Entity* CreateEntityAlias( - AzFramework::Spawnable& source, - AzFramework::Spawnable& target, - AZ::EntityId entityId, - AzToolsFramework::Prefab::PrefabConversionUtils::EntityAliasType aliasType, - AzToolsFramework::Prefab::PrefabConversionUtils::EntityAliasSpawnableLoadBehavior loadBehavior, - uint32_t tag, - AzToolsFramework::Prefab::PrefabConversionUtils::PrefabProcessorContext& context); + void PatchParents(const AzToolsFramework::Prefab::Instance& source, AzToolsFramework::Prefab::Instance& target); uint32_t FindEntityIndex(AZ::EntityId entity, const AzFramework::Spawnable& spawnable); From b8e3b27ea92964c50e131793458ba71aaa30ff66 Mon Sep 17 00:00:00 2001 From: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> Date: Tue, 14 Dec 2021 15:02:04 -0800 Subject: [PATCH 170/948] Added a PrefabDocument for Prefab to simplify working with Prefabs during conversion to spawnables. The new PrefabDocument handles the Prefab and the Instance. This reduces the number of times the Instance has to be reloaded from the Prefab and keeps the entity ids stable between steps. The intention is for all the PrefabDocument to conceptually manipulate the Prefab DOM, although behind the scenes it will manipulate the Instance for now. The Instance should only be directly used in case the PrefabDocument doesn't provide the functionality yet. Signed-off-by: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> --- .../PrefabEditorEntityOwnershipService.cpp | 1 + .../Prefab/Spawnable/EditorInfoRemover.cpp | 45 ++------ .../Prefab/Spawnable/EditorInfoRemover.h | 5 +- .../Spawnable/PrefabCatchmentProcessor.cpp | 63 +++++----- .../Spawnable/PrefabCatchmentProcessor.h | 2 +- .../Prefab/Spawnable/PrefabDocument.cpp | 109 ++++++++++++++++++ .../Prefab/Spawnable/PrefabDocument.h | 47 ++++++++ .../Spawnable/PrefabProcessorContext.cpp | 45 +++----- .../Prefab/Spawnable/PrefabProcessorContext.h | 15 ++- .../aztoolsframework_files.cmake | 2 + .../PrefabBuilder/PrefabBuilderComponent.cpp | 10 +- .../PrefabBuilder/PrefabBuilderComponent.h | 2 +- 12 files changed, 230 insertions(+), 116 deletions(-) create mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp create mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp index b91a0aac93..3d962ade67 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp @@ -417,6 +417,7 @@ namespace AzToolsFramework bool readyToCreateRootSpawnable = m_playInEditorData.m_assetsCache.IsActivated(); if (!readyToCreateRootSpawnable && !m_playInEditorData.m_assetsCache.Activate(Prefab::PrefabConversionUtils::PlayInEditor)) + { AZ_Error("Prefab", false, "Failed to create a prefab processing stack from key '%.*s'.", AZ_STRING_ARG(Prefab::PrefabConversionUtils::PlayInEditor)); return; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/EditorInfoRemover.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/EditorInfoRemover.cpp index dfba1d54ba..3f6d698bbe 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/EditorInfoRemover.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/EditorInfoRemover.cpp @@ -37,7 +37,7 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils } prefabProcessorContext.ListPrefabs( - [this, &serializeContext, &prefabProcessorContext]([[maybe_unused]] AZStd::string_view prefabName, PrefabDom& prefab) + [this, &serializeContext, &prefabProcessorContext]([[maybe_unused]] AZStd::string_view prefabName, PrefabDocument& prefab) { auto result = RemoveEditorInfo(prefab, serializeContext, prefabProcessorContext); if (!result) @@ -58,10 +58,9 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils } } - void EditorInfoRemover::GetEntitiesFromInstance( - AZStd::unique_ptr& instance, EntityList& hierarchyEntities) + void EditorInfoRemover::GetEntitiesFromInstance(AzToolsFramework::Prefab::Instance& instance, EntityList& hierarchyEntities) { - instance->GetAllEntitiesInHierarchy( + instance.GetAllEntitiesInHierarchy( [&hierarchyEntities](const AZStd::unique_ptr& entity) { hierarchyEntities.emplace_back(entity.get()); @@ -498,7 +497,7 @@ exportComponent, prefabProcessorContext); } EditorInfoRemover::RemoveEditorInfoResult EditorInfoRemover::RemoveEditorInfo( - PrefabDom& prefab, + PrefabDocument& prefab, AZ::SerializeContext* serializeContext, PrefabProcessorContext& prefabProcessorContext) { @@ -510,28 +509,10 @@ exportComponent, prefabProcessorContext); m_componentRequirementsValidator.SetPlatformTags(prefabProcessorContext.GetPlatformTags()); - // convert Prefab DOM into Prefab Instance. - AZStd::unique_ptr instance(aznew Instance()); - if (!Prefab::PrefabDomUtils::LoadInstanceFromPrefabDom(*instance, prefab, - Prefab::PrefabDomUtils::LoadFlags::AssignRandomEntityId)) - { - PrefabDomValueReference sourceReference = PrefabDomUtils::FindPrefabDomValue(prefab, PrefabDomUtils::SourceName); - - AZStd::string errorMessage("Failed to Load Prefab Instance from given Prefab Dom during Removal of Editor Info."); - if (sourceReference.has_value() && - sourceReference->get().IsString() && - sourceReference->get().GetStringLength() != 0) - { - AZStd::string_view source(sourceReference->get().GetString(), sourceReference->get().GetStringLength()); - errorMessage += AZStd::string::format("Prefab Source: %.*s", AZ_STRING_ARG(source)); - } - - return AZ::Failure(errorMessage); - } - // grab all nested entities from the Instance as source entities. + Instance& sourceInstance = prefab.GetInstance(); EntityList sourceEntities; - GetEntitiesFromInstance(instance, sourceEntities); + GetEntitiesFromInstance(sourceInstance, sourceEntities); EntityList exportEntities; @@ -597,7 +578,7 @@ exportComponent, prefabProcessorContext); exportEntitiesMap.emplace(entity->GetId(), entity); } ); - instance->RemoveNestedEntities( + sourceInstance.RemoveNestedEntities( [&exportEntitiesMap](const AZStd::unique_ptr& entity) { return exportEntitiesMap.find(entity->GetId()) == exportEntitiesMap.end(); @@ -605,7 +586,7 @@ exportComponent, prefabProcessorContext); ); // replace entities of instance with exported ones. - instance->GetAllEntitiesInHierarchy( + sourceInstance.GetAllEntitiesInHierarchy( [&exportEntitiesMap](AZStd::unique_ptr& entity) { auto entityId = entity->GetId(); @@ -614,16 +595,6 @@ exportComponent, prefabProcessorContext); } ); - // save the final result in the target Prefab DOM. - PrefabDom filteredPrefab; - if (!PrefabDomUtils::StoreInstanceInPrefabDom(*instance, filteredPrefab)) - { - return AZ::Failure(AZStd::string::format( - "Saving exported Prefab Instance within a Prefab Dom failed.") - ); - } - prefab.Swap(filteredPrefab); - return AZ::Success(); } } // namespace AzToolsFramework::Prefab::PrefabConversionUtils diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/EditorInfoRemover.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/EditorInfoRemover.h index dc10952733..dbad58d2f5 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/EditorInfoRemover.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/EditorInfoRemover.h @@ -43,7 +43,7 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils using RemoveEditorInfoResult = AZ::Outcome; RemoveEditorInfoResult RemoveEditorInfo( - PrefabDom& prefab, + PrefabDocument& prefab, AZ::SerializeContext* serializeContext, PrefabProcessorContext& prefabProcessorContext); @@ -51,8 +51,7 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils protected: using EntityList = AZStd::vector; - static void GetEntitiesFromInstance( - AZStd::unique_ptr& instance, EntityList& hierarchyEntities); + static void GetEntitiesFromInstance(AzToolsFramework::Prefab::Instance& instance, EntityList& hierarchyEntities); static bool ReadComponentAttribute( AZ::Component* component, diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.cpp index 7a54950c47..4658eea49f 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.cpp @@ -25,7 +25,7 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils { AZ::DataStream::StreamType serializationFormat = m_serializationFormat == SerializationFormats::Binary ? AZ::DataStream::StreamType::ST_BINARY : AZ::DataStream::StreamType::ST_XML; - context.ListPrefabs([&context, serializationFormat](AZStd::string_view prefabName, PrefabDom& prefab) + context.ListPrefabs([&context, serializationFormat](AZStd::string_view prefabName, PrefabDocument& prefab) { ProcessPrefab(context, prefabName, prefab, serializationFormat); }); @@ -45,7 +45,7 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils } } - void PrefabCatchmentProcessor::ProcessPrefab(PrefabProcessorContext& context, AZStd::string_view prefabName, PrefabDom& prefab, + void PrefabCatchmentProcessor::ProcessPrefab(PrefabProcessorContext& context, AZStd::string_view prefabName, PrefabDocument& prefab, AZ::DataStream::StreamType serializationFormat) { using namespace AzToolsFramework::Prefab::SpawnableUtils; @@ -64,45 +64,34 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils AZStd::move(uniqueName), context.GetSourceUuid(), AZStd::move(serializer)); AZ_Assert(spawnable, "Failed to create a new spawnable."); - Instance instance; - if (Prefab::PrefabDomUtils::LoadInstanceFromPrefabDom( - instance, prefab, object.GetReferencedAssets(), - Prefab::PrefabDomUtils::LoadFlags::AssignRandomEntityId)) // Always assign random entity ids because the spawnable is - // going to be used to create clones of the entities. - { - // Resolve entity aliases that store PrefabDOM information to use the spawnable instead. This is done before the entities are - // moved from the instance as they'd otherwise can't be found. - context.ResolveSpawnableEntityAliases(prefabName, *spawnable, instance); + Instance& instance = prefab.GetInstance(); + // Resolve entity aliases that store PrefabDOM information to use the spawnable instead. This is done before the entities are + // moved from the instance as they'd otherwise can't be found. + context.ResolveSpawnableEntityAliases(prefabName, *spawnable, instance); - AzFramework::Spawnable::EntityList& entities = spawnable->GetEntities(); - instance.DetachAllEntitiesInHierarchy( - [&entities, &context](AZStd::unique_ptr entity) + AzFramework::Spawnable::EntityList& entities = spawnable->GetEntities(); + instance.DetachAllEntitiesInHierarchy( + [&entities, &context](AZStd::unique_ptr entity) + { + if (entity) { - if (entity) + entity->InvalidateDependencies(); + AZ::Entity::DependencySortOutcome evaluation = entity->EvaluateDependenciesGetDetails(); + if (evaluation.IsSuccess()) + { + entities.emplace_back(AZStd::move(entity)); + } + else { - entity->InvalidateDependencies(); - AZ::Entity::DependencySortOutcome evaluation = entity->EvaluateDependenciesGetDetails(); - if (evaluation.IsSuccess()) - { - entities.emplace_back(AZStd::move(entity)); - } - else - { - AZ_Error( - "Prefabs", false, "Entity '%s' %s cannot be activated for the following reason: %s", - entity->GetName().c_str(), entity->GetId().ToString().c_str(), evaluation.GetError().m_message.c_str()); - context.ErrorEncountered(); - } + AZ_Error( + "Prefabs", false, "Entity '%s' %s cannot be activated for the following reason: %s", + entity->GetName().c_str(), entity->GetId().ToString().c_str(), evaluation.GetError().m_message.c_str()); + context.ErrorEncountered(); } - }); + } + }); - SpawnableUtils::SortEntitiesByTransformHierarchy(*spawnable); - 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(); - } + SpawnableUtils::SortEntitiesByTransformHierarchy(*spawnable); + context.GetProcessedObjects().push_back(AZStd::move(object)); } } // namespace AzToolsFramework::Prefab::PrefabConversionUtils diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.h index 253321f8e7..a3556d73b7 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.h @@ -40,7 +40,7 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils static void Reflect(AZ::ReflectContext* context); protected: - static void ProcessPrefab(PrefabProcessorContext& context, AZStd::string_view prefabName, PrefabDom& prefab, + static void ProcessPrefab(PrefabProcessorContext& context, AZStd::string_view prefabName, PrefabDocument& prefab, AZ::DataStream::StreamType serializationFormat); SerializationFormats m_serializationFormat{ SerializationFormats::Binary }; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp new file mode 100644 index 0000000000..1f55e0df1a --- /dev/null +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp @@ -0,0 +1,109 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include + +namespace AzToolsFramework::Prefab::PrefabConversionUtils +{ + PrefabDocument::PrefabDocument(AZStd::string name) + : m_name(AZStd::move(name)) + , m_instance(AZStd::make_unique()) + { + m_instance->SetTemplateSourcePath(AZ::IO::Path("InMemory") / name); + } + + bool PrefabDocument::SetPrefabDom(const PrefabDom& prefab) + { + if (ConstructInstanceFromPrefabDom(prefab)) + { + constexpr bool copyConstStrings = true; + m_dom.CopyFrom(prefab, m_dom.GetAllocator(), copyConstStrings); + return true; + } + else + { + return false; + } + } + + bool PrefabDocument::SetPrefabDom(PrefabDom&& prefab) + { + if (ConstructInstanceFromPrefabDom(prefab)) + { + m_dom = AZStd::move(prefab); + return true; + } + else + { + return false; + } + } + + const AZStd::string& PrefabDocument::GetName() const + { + return m_name; + } + + const PrefabDom& PrefabDocument::GetDom() const + { + if (m_isDirty) + { + m_isDirty = !PrefabDomUtils::StoreInstanceInPrefabDom(*m_instance, m_dom); + } + return m_dom; + } + + PrefabDom&& PrefabDocument::TakeDom() + { + if (m_isDirty) + { + m_isDirty = !PrefabDomUtils::StoreInstanceInPrefabDom(*m_instance, m_dom); + } + return AZStd::move(m_dom); + } + + AzToolsFramework::Prefab::Instance& PrefabDocument::GetInstance() + { + // Assume that changes will be made to the instance. + m_isDirty = true; + return *m_instance; + } + + const AzToolsFramework::Prefab::Instance& PrefabDocument::GetInstance() const + { + return *m_instance; + } + + bool PrefabDocument::ConstructInstanceFromPrefabDom(const PrefabDom& prefab) + { + using namespace AzToolsFramework::Prefab; + + m_instance->Reset(); + if (PrefabDomUtils::LoadInstanceFromPrefabDom(*m_instance, prefab, PrefabDomUtils::LoadFlags::AssignRandomEntityId)) + { + return true; + } + else + { + AZStd::string errorMessage("Failed to construct Prefab instance from given PrefabDOM"); + + PrefabDomValueConstReference sourceReference = PrefabDomUtils::FindPrefabDomValue(prefab, PrefabDomUtils::SourceName); + if (sourceReference.has_value() && sourceReference->get().IsString() && sourceReference->get().GetStringLength() != 0) + { + errorMessage += " (Source: "; + errorMessage += AZStd::string_view(sourceReference->get().GetString(), sourceReference->get().GetStringLength()); + errorMessage += ')'; + } + + errorMessage += '.'; + AZ_Error("PrefabDocument", false, errorMessage.c_str()); + return false; + } + } +} // namespace AzToolsFramework::Prefab::PrefabConversionUtils diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h new file mode 100644 index 0000000000..804082b03b --- /dev/null +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include +#include +#include + +namespace AzToolsFramework::Prefab::PrefabConversionUtils +{ + class PrefabDocument final + { + public: + explicit PrefabDocument(AZStd::string name); + PrefabDocument(const PrefabDocument&) = delete; + PrefabDocument(PrefabDocument&&) = default; + + PrefabDocument& operator=(const PrefabDocument&) = delete; + PrefabDocument& operator=(PrefabDocument&&) = default; + + bool SetPrefabDom(const PrefabDom& prefab); + bool SetPrefabDom(PrefabDom&& prefab); + + const AZStd::string& GetName() const; + const PrefabDom& GetDom() const; + PrefabDom&& TakeDom(); + + // Where possible, prefer functions directly on the PrefabDocument Instead of using the Instance. + AzToolsFramework::Prefab::Instance& GetInstance(); + const AzToolsFramework::Prefab::Instance& GetInstance() const; + + private: + bool ConstructInstanceFromPrefabDom(const PrefabDom& prefab); + + mutable PrefabDom m_dom; + AZStd::unique_ptr m_instance; + AZStd::string m_name; + mutable bool m_isDirty{ false }; + }; +} // namespace AzToolsFramework::Prefab::PrefabConversionUtils diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp index 5c67c8f3b3..0fd428fa3b 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -31,49 +32,39 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils : m_sourceUuid(sourceUuid) {} - bool PrefabProcessorContext::AddPrefab(AZStd::string prefabName, PrefabDom prefab) + bool PrefabProcessorContext::AddPrefab(PrefabDocument&& document) { - if (!m_isIterating) + AZStd::string name = document.GetName(); + if (!m_prefabNames.contains(name)) { - auto result = m_prefabs.emplace(AZStd::move(prefabName), AZStd::move(prefab)); - return result.second; - } - else - { - auto it = m_prefabs.find(prefabName); - if (it == m_prefabs.end()) - { - auto result = m_pendingPrefabAdditions.emplace(AZStd::move(prefabName), AZStd::move(prefab)); - return result.second; - } - else - { - return false; - } + m_prefabNames.emplace(AZStd::move(name)); + PrefabContainer& container = m_isIterating ? m_pendingPrefabAdditions : m_prefabs; + container.push_back(AZStd::move(document)); + return true; } + return false; } - void PrefabProcessorContext::ListPrefabs(const AZStd::function& callback) + void PrefabProcessorContext::ListPrefabs(const AZStd::function& callback) { m_isIterating = true; - for (auto& it : m_prefabs) + for (PrefabDocument& document : m_prefabs) { - callback(it.first, it.second); + callback(document.GetName(), document); } m_isIterating = false; - for (auto& prefab : m_pendingPrefabAdditions) - { - m_prefabs.emplace(AZStd::move(prefab.first), AZStd::move(prefab.second)); - } + m_prefabs.insert( + m_prefabs.end(), AZStd::make_move_iterator(m_pendingPrefabAdditions.begin()), + AZStd::make_move_iterator(m_pendingPrefabAdditions.end())); m_pendingPrefabAdditions.clear(); } - void PrefabProcessorContext::ListPrefabs(const AZStd::function& callback) const + void PrefabProcessorContext::ListPrefabs(const AZStd::function& callback) const { - for (const auto& it : m_prefabs) + for (const PrefabDocument& document : m_prefabs) { - callback(it.first, it.second); + callback(document.GetName(), document); } } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.h index ade17e2ff0..4c2dc73ed8 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.h @@ -21,6 +21,7 @@ #include #include #include +#include #include namespace AzToolsFramework::Prefab::PrefabConversionUtils @@ -93,9 +94,9 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils explicit PrefabProcessorContext(const AZ::Uuid& sourceUuid); virtual ~PrefabProcessorContext() = default; - virtual bool AddPrefab(AZStd::string prefabName, PrefabDom prefab); - virtual void ListPrefabs(const AZStd::function& callback); - virtual void ListPrefabs(const AZStd::function& callback) const; + virtual bool AddPrefab(PrefabDocument&& document); + virtual void ListPrefabs(const AZStd::function& callback); + virtual void ListPrefabs(const AZStd::function& callback) const; virtual bool HasPrefabs() const; virtual bool RegisterSpawnableProductAssetDependency( @@ -128,13 +129,15 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils virtual void ErrorEncountered(); protected: - using NamedPrefabContainer = AZStd::unordered_map; + using PrefabNames = AZStd::unordered_set; + using PrefabContainer = AZStd::vector; using SpawnableEntityAliasStore = AZStd::vector; AZ::Data::AssetLoadBehavior ToAssetLoadBehavior(EntityAliasSpawnableLoadBehavior loadBehavior) const; - NamedPrefabContainer m_prefabs; - NamedPrefabContainer m_pendingPrefabAdditions; + PrefabContainer m_prefabs; + PrefabContainer m_pendingPrefabAdditions; + PrefabNames m_prefabNames; SpawnableEntityAliasStore m_entityAliases; ProcessedObjectStoreContainer m_products; ProductAssetDependencyContainer m_registeredProductAssetDependencies; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake index 2c25cc9222..4c23289805 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake @@ -730,6 +730,8 @@ set(FILES Prefab/Spawnable/PrefabConversionPipeline.h Prefab/Spawnable/PrefabConversionPipeline.cpp Prefab/Spawnable/PrefabConverterStackProfileNames.h + Prefab/Spawnable/PrefabDocument.h + Prefab/Spawnable/PrefabDocument.cpp Prefab/Spawnable/ProcesedObjectStore.h Prefab/Spawnable/ProcesedObjectStore.cpp Prefab/Spawnable/PrefabProcessor.h diff --git a/Gems/Prefab/PrefabBuilder/PrefabBuilderComponent.cpp b/Gems/Prefab/PrefabBuilder/PrefabBuilderComponent.cpp index 6107226783..71464501ba 100644 --- a/Gems/Prefab/PrefabBuilder/PrefabBuilderComponent.cpp +++ b/Gems/Prefab/PrefabBuilder/PrefabBuilderComponent.cpp @@ -237,7 +237,7 @@ namespace AZ::Prefab bool PrefabBuilderComponent::ProcessPrefab( const AZ::PlatformTagSet& platformTags, const char* filePath, AZ::IO::PathView tempDirPath, const AZ::Uuid& sourceFileUuid, - AzToolsFramework::Prefab::PrefabDom& mutableRootDom, AZStd::vector& jobProducts) + AzToolsFramework::Prefab::PrefabDom&& rootDom, AZStd::vector& jobProducts) { AzToolsFramework::Prefab::PrefabConversionUtils::PrefabProcessorContext context(sourceFileUuid); AZStd::string rootPrefabName; @@ -247,7 +247,9 @@ namespace AZ::Prefab filePath); return false; } - context.AddPrefab(AZStd::move(rootPrefabName), AZStd::move(mutableRootDom)); + AzToolsFramework::Prefab::PrefabConversionUtils::PrefabDocument rootDocument(AZStd::move(rootPrefabName)); + rootDocument.SetPrefabDom(AZStd::move(rootDom)); + context.AddPrefab(AZStd::move(rootDocument)); context.SetPlatformTags(AZStd::move(platformTags)); @@ -319,8 +321,8 @@ namespace AZ::Prefab }); if (ProcessPrefab( - platformTags, request.m_fullPath.c_str(), request.m_tempDirPath.c_str(), request.m_sourceFileUUID, mutableRootDom, - response.m_outputProducts)) + platformTags, request.m_fullPath.c_str(), request.m_tempDirPath.c_str(), request.m_sourceFileUUID, + AZStd::move(mutableRootDom), response.m_outputProducts)) { response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success; } diff --git a/Gems/Prefab/PrefabBuilder/PrefabBuilderComponent.h b/Gems/Prefab/PrefabBuilder/PrefabBuilderComponent.h index 9ebdd690f5..73ef6b0426 100644 --- a/Gems/Prefab/PrefabBuilder/PrefabBuilderComponent.h +++ b/Gems/Prefab/PrefabBuilder/PrefabBuilderComponent.h @@ -53,7 +53,7 @@ namespace AZ::Prefab const AzToolsFramework::Prefab::PrefabDom& genericDocument); bool ProcessPrefab( const AZ::PlatformTagSet& platformTags, const char* filePath, AZ::IO::PathView tempDirPath, const AZ::Uuid& sourceFileUuid, - AzToolsFramework::Prefab::PrefabDom& mutableRootDom, + AzToolsFramework::Prefab::PrefabDom&& rootDom, AZStd::vector& jobProducts); protected: From 7b5868d19869e1a045a278b7cce0598dc8a3940c Mon Sep 17 00:00:00 2001 From: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> Date: Wed, 15 Dec 2021 10:05:44 -0800 Subject: [PATCH 171/948] Added additional functions to edit prefabs during processing to PrefabDocument. Signed-off-by: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> --- .../Prefab/Instance/Instance.cpp | 29 +++++++- .../Prefab/Instance/Instance.h | 7 ++ .../Prefab/Spawnable/EntityAliasTypes.h | 69 +++++++++++++++++++ .../Prefab/Spawnable/PrefabDocument.cpp | 52 +++++++++++--- .../Prefab/Spawnable/PrefabDocument.h | 19 +++++ .../Prefab/Spawnable/PrefabDocument.inl | 16 +++++ .../Prefab/Spawnable/PrefabProcessorContext.h | 51 +------------- .../Prefab/Spawnable/SpawnableUtils.cpp | 27 +------- .../Prefab/Spawnable/SpawnableUtils.h | 10 ++- .../aztoolsframework_files.cmake | 2 + 10 files changed, 193 insertions(+), 89 deletions(-) create mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/EntityAliasTypes.h create mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.inl diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/Instance.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/Instance.cpp index c685735f40..03d62dff0a 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/Instance.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/Instance.cpp @@ -608,6 +608,31 @@ namespace AzToolsFramework } AZ::EntityId Instance::GetEntityIdFromAliasPath(AliasPathView relativeAliasPath) const + { + return GetInstanceAndEntityIdFromAliasPath(relativeAliasPath).second; + } + + AZStd::pair Instance::GetInstanceAndEntityIdFromAliasPath(AliasPathView relativeAliasPath) + { + Instance* instance = this; + AliasPathView path = relativeAliasPath.ParentPath(); + for (auto it : path) + { + InstanceOptionalReference child = instance->FindNestedInstance(it.Native()); + if (child.has_value()) + { + instance = &(child->get()); + } + else + { + return AZStd::pair(nullptr, AZ::EntityId()); + } + } + + return AZStd::pair(instance, instance->GetEntityId(relativeAliasPath.Filename().Native())); + } + + AZStd::pair Instance::GetInstanceAndEntityIdFromAliasPath(AliasPathView relativeAliasPath) const { const Instance* instance = this; AliasPathView path = relativeAliasPath.ParentPath(); @@ -620,11 +645,11 @@ namespace AzToolsFramework } else { - return AZ::EntityId(); + return AZStd::pair(nullptr, AZ::EntityId()); } } - return instance->GetEntityId(relativeAliasPath.Filename().Native()); + return AZStd::pair(instance, instance->GetEntityId(relativeAliasPath.Filename().Native())); } AZStd::vector Instance::GetNestedInstanceAliases(TemplateId templateId) const diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/Instance.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/Instance.h index 625357f485..b63eca309a 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/Instance.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/Instance.h @@ -169,6 +169,13 @@ namespace AzToolsFramework * @return entityId, invalid ID if not found */ AZ::EntityId GetEntityIdFromAliasPath(AliasPathView relativeAliasPath) const; + /** + * Retrieves the instance pointer and entity id from an alias path that's relative to this instance. + * + * @return A pair with the Instance and entity id. The Instance is set to null and entityId is set to invalid if not found. + */ + AZStd::pair GetInstanceAndEntityIdFromAliasPath(AliasPathView relativeAliasPath); + AZStd::pair GetInstanceAndEntityIdFromAliasPath(AliasPathView relativeAliasPath) const; /** diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/EntityAliasTypes.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/EntityAliasTypes.h new file mode 100644 index 0000000000..9ab1f9bbd1 --- /dev/null +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/EntityAliasTypes.h @@ -0,0 +1,69 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include +#include +#include +#include +#include + +namespace AzToolsFramework::Prefab::PrefabConversionUtils +{ + enum class EntityAliasType : uint8_t + { + Disable, //!< No alias is added. + OptionalReplace, //!< At runtime the entity might be replaced. If the alias is disabled the original entity will be spawned. + //!< The original entity will be left in the spawnable and a copy is returned. + Replace, //!< At runtime the entity will be replaced. If the alias is disabled nothing will be spawned. The original + //!< entity is returned and a blank entity is left. + Additional, //!< At runtime the alias entity will be added as an additional but unrelated entity with a new entity id. + //!< An empty entity will be returned. + Merge //!< At runtime the components in both entities will be merged. An empty entity will be returned. The added + //!< components may no conflict with the entities already in the root entity. + }; + + enum class EntityAliasSpawnableLoadBehavior : uint8_t + { + NoLoad, //!< Don't load the spawnable referenced in the entity alias. Loading will be up to the caller. + QueueLoad, //!< Queue the spawnable referenced in the entity alias for loading. This will be an async load because asset + //!< handlers aren't allowed to start a blocking load as this can lead to deadlocks. This option will allow + //!< to disable loading the referenced spawnable through the event fired from the spawnables asset handler. + DependentLoad //!< The spawnable referenced in the entity alias is made a dependency of the spawnable that holds the entity + //!< alias. This will cause the spawnable to be automatically loaded along with the owning spawnable. + }; + + struct EntityAliasSpawnableLink + { + EntityAliasSpawnableLink(AzFramework::Spawnable& spawnable, AZ::EntityId index); + + AzFramework::Spawnable& m_spawnable; + AZ::EntityId m_index; + }; + + struct EntityAliasPrefabLink + { + EntityAliasPrefabLink(AZStd::string prefabName, AzToolsFramework::Prefab::AliasPath alias); + + AZStd::string m_prefabName; + AzToolsFramework::Prefab::AliasPath m_alias; + }; + + struct EntityAliasStore + { + using LinkStore = AZStd::variant; + + LinkStore m_source; + LinkStore m_target; + uint32_t m_tag; + AzFramework::Spawnable::EntityAliasType m_aliasType; + EntityAliasSpawnableLoadBehavior m_loadBehavior; + }; +} // namespace AzToolsFramework::Prefab::PrefabConversionUtils diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp index 1f55e0df1a..c0eb5257b0 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp @@ -8,6 +8,7 @@ #include #include +#include namespace AzToolsFramework::Prefab::PrefabConversionUtils { @@ -68,6 +69,43 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils return AZStd::move(m_dom); } + void PrefabDocument::ListEntitiesWithComponentType( + AZ::TypeId componentType, const AZStd::function& callback) const + { + m_instance->GetAllEntitiesInHierarchyConst( + [this, &componentType, &callback](const AZ::Entity& entity) -> bool + { + if (entity.FindComponent(componentType)) + { + return callback(m_instance->GetAliasPathRelativeToInstance(entity.GetId())); + } + else + { + return true; + } + }); + } + + AZ::Entity* PrefabDocument::CreateEntityAlias( + PrefabDocument& source, + AzToolsFramework::Prefab::AliasPathView entity, + AzToolsFramework::Prefab::PrefabConversionUtils::EntityAliasType aliasType, + AzToolsFramework::Prefab::PrefabConversionUtils::EntityAliasSpawnableLoadBehavior loadBehavior, + uint32_t tag, + AzToolsFramework::Prefab::PrefabConversionUtils::PrefabProcessorContext& context) + { + auto&& [sourceInstance, entityId] = source.m_instance->GetInstanceAndEntityIdFromAliasPath(entity); + if (sourceInstance != nullptr && entityId.IsValid()) + { + return SpawnableUtils::CreateEntityAlias( + source.m_name, *sourceInstance, m_name, *m_instance, entityId, aliasType, loadBehavior, tag, context); + } + else + { + return nullptr; + } + } + AzToolsFramework::Prefab::Instance& PrefabDocument::GetInstance() { // Assume that changes will be made to the instance. @@ -91,18 +129,16 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils } else { - AZStd::string errorMessage("Failed to construct Prefab instance from given PrefabDOM"); - +#ifdef AZ_ENABLE_TRACING + AZStd::string_view sourceName = m_name; PrefabDomValueConstReference sourceReference = PrefabDomUtils::FindPrefabDomValue(prefab, PrefabDomUtils::SourceName); if (sourceReference.has_value() && sourceReference->get().IsString() && sourceReference->get().GetStringLength() != 0) { - errorMessage += " (Source: "; - errorMessage += AZStd::string_view(sourceReference->get().GetString(), sourceReference->get().GetStringLength()); - errorMessage += ')'; + sourceName = AZStd::string_view(sourceReference->get().GetString(), sourceReference->get().GetStringLength()); } - - errorMessage += '.'; - AZ_Error("PrefabDocument", false, errorMessage.c_str()); + AZ_Error( + "PrefabDocument", false, "Failed to construct Prefab instance from given PrefabDOM '%.*s'.", AZ_STRING_ARG(sourceName)); +#endif return false; } } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h index 804082b03b..215daf7f71 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h @@ -8,13 +8,18 @@ #pragma once +#include #include #include #include #include +#include +#include namespace AzToolsFramework::Prefab::PrefabConversionUtils { + class PrefabProcessorContext; + class PrefabDocument final { public: @@ -32,6 +37,18 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils const PrefabDom& GetDom() const; PrefabDom&& TakeDom(); + template + void ListEntitiesWithComponentType(const AZStd::function& callback) const; + void ListEntitiesWithComponentType( + AZ::TypeId componentType, const AZStd::function& callback) const; + AZ::Entity* CreateEntityAlias( + PrefabDocument& source, + AzToolsFramework::Prefab::AliasPathView entity, + AzToolsFramework::Prefab::PrefabConversionUtils::EntityAliasType aliasType, + AzToolsFramework::Prefab::PrefabConversionUtils::EntityAliasSpawnableLoadBehavior loadBehavior, + uint32_t tag, + AzToolsFramework::Prefab::PrefabConversionUtils::PrefabProcessorContext& context); + // Where possible, prefer functions directly on the PrefabDocument Instead of using the Instance. AzToolsFramework::Prefab::Instance& GetInstance(); const AzToolsFramework::Prefab::Instance& GetInstance() const; @@ -45,3 +62,5 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils mutable bool m_isDirty{ false }; }; } // namespace AzToolsFramework::Prefab::PrefabConversionUtils + +#include diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.inl b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.inl new file mode 100644 index 0000000000..37b1f1c127 --- /dev/null +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.inl @@ -0,0 +1,16 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +namespace AzToolsFramework::Prefab::PrefabConversionUtils +{ + template + void PrefabDocument::ListEntitiesWithComponentType(const AZStd::function& callback) const + { + ListEntitiesWithComponentType(azrtti_typeid(), callback); + } +} // namespace AzToolsFramework::Prefab::PrefabConversionUtils diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.h index 4c2dc73ed8..8dde89b9e1 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.h @@ -21,61 +21,12 @@ #include #include #include +#include #include #include namespace AzToolsFramework::Prefab::PrefabConversionUtils { - enum class EntityAliasType : uint8_t - { - Disable, //!< No alias is added. - OptionalReplace, //!< At runtime the entity might be replaced. If the alias is disabled the original entity will be spawned. - //!< The original entity will be left in the spawnable and a copy is returned. - Replace, //!< At runtime the entity will be replaced. If the alias is disabled nothing will be spawned. The original - //!< entity is returned and a blank entity is left. - Additional, //!< At runtime the alias entity will be added as an additional but unrelated entity with a new entity id. - //!< An empty entity will be returned. - Merge //!< At runtime the components in both entities will be merged. An empty entity will be returned. The added - //!< components may no conflict with the entities already in the root entity. - }; - - enum class EntityAliasSpawnableLoadBehavior : uint8_t - { - NoLoad, //!< Don't load the spawnable referenced in the entity alias. Loading will be up to the caller. - QueueLoad, //!< Queue the spawnable referenced in the entity alias for loading. This will be an async load because asset - //!< handlers aren't allowed to start a blocking load as this can lead to deadlocks. This option will allow - //!< to disable loading the referenced spawnable through the event fired from the spawnables asset handler. - DependentLoad //!< The spawnable referenced in the entity alias is made a dependency of the spawnable that holds the entity - //!< alias. This will cause the spawnable to be automatically loaded along with the owning spawnable. - }; - - struct EntityAliasSpawnableLink - { - EntityAliasSpawnableLink(AzFramework::Spawnable& spawnable, AZ::EntityId index); - - AzFramework::Spawnable& m_spawnable; - AZ::EntityId m_index; - }; - - struct EntityAliasPrefabLink - { - EntityAliasPrefabLink(AZStd::string prefabName, AzToolsFramework::Prefab::AliasPath alias); - - AZStd::string m_prefabName; - AzToolsFramework::Prefab::AliasPath m_alias; - }; - - struct EntityAliasStore - { - using LinkStore = AZStd::variant; - - LinkStore m_source; - LinkStore m_target; - uint32_t m_tag; - AzFramework::Spawnable::EntityAliasType m_aliasType; - EntityAliasSpawnableLoadBehavior m_loadBehavior; - }; - struct AssetDependencyInfo { AZ::Data::AssetId m_assetId; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp index e30417324c..4f007f509e 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.cpp @@ -21,6 +21,7 @@ #include #include #include +#include namespace AzToolsFramework::Prefab::SpawnableUtils { @@ -222,32 +223,6 @@ namespace AzToolsFramework::Prefab::SpawnableUtils } } - void PatchParents(const AzToolsFramework::Prefab::Instance& source, AzToolsFramework::Prefab::Instance& target) - { - target.GetEntities( - [&source, &target](AZStd::unique_ptr& entity) - { - AzFramework::TransformComponent* transform = entity->FindComponent(); - if (transform) - { - if (transform->GetParentId().IsValid()) - { - AliasPath originalParentAlias = source.GetAliasPathRelativeToInstance(transform->GetParentId()); - if (!originalParentAlias.empty()) - { - AZ::EntityId targetParentId = target.GetEntityIdFromAliasPath(originalParentAlias); - if (targetParentId.IsValid()) - { - // If this is valid then the parent was moved to the target spawnable so adjust the entity id. - transform->SetParent(targetParentId); - } - } - } - } - return true; - }); - } - uint32_t FindEntityIndex(AZ::EntityId entity, const AzFramework::Spawnable& spawnable) { auto begin = spawnable.GetEntities().begin(); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.h index ea33ca09cc..53d007c0c1 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/SpawnableUtils.h @@ -12,7 +12,7 @@ #include #include #include -#include +#include namespace AZ { @@ -24,6 +24,11 @@ namespace AzToolsFramework::Prefab class Instance; } +namespace AzToolsFramework::Prefab::PrefabConversionUtils +{ + class PrefabProcessorContext; +} + namespace AzToolsFramework::Prefab::SpawnableUtils { static constexpr uint32_t InvalidEntityIndex = AZStd::numeric_limits::max(); @@ -41,8 +46,7 @@ namespace AzToolsFramework::Prefab::SpawnableUtils AzToolsFramework::Prefab::PrefabConversionUtils::EntityAliasSpawnableLoadBehavior loadBehavior, uint32_t tag, AzToolsFramework::Prefab::PrefabConversionUtils::PrefabProcessorContext& context); - void PatchParents(const AzToolsFramework::Prefab::Instance& source, AzToolsFramework::Prefab::Instance& target); - + uint32_t FindEntityIndex(AZ::EntityId entity, const AzFramework::Spawnable& spawnable); void SortEntitiesByTransformHierarchy(AzFramework::Spawnable& spawnable); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake index 4c23289805..05c07afecd 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake @@ -723,6 +723,7 @@ set(FILES Prefab/Spawnable/EditorOnlyEntityHandler/UiEditorOnlyEntityHandler.cpp Prefab/Spawnable/EditorOnlyEntityHandler/WorldEditorOnlyEntityHandler.h Prefab/Spawnable/EditorOnlyEntityHandler/WorldEditorOnlyEntityHandler.cpp + Prefab/Spawnable/EntityAliasTypes.h Prefab/Spawnable/InMemorySpawnableAssetContainer.h Prefab/Spawnable/InMemorySpawnableAssetContainer.cpp Prefab/Spawnable/PrefabCatchmentProcessor.h @@ -731,6 +732,7 @@ set(FILES Prefab/Spawnable/PrefabConversionPipeline.cpp Prefab/Spawnable/PrefabConverterStackProfileNames.h Prefab/Spawnable/PrefabDocument.h + Prefab/Spawnable/PrefabDocument.inl Prefab/Spawnable/PrefabDocument.cpp Prefab/Spawnable/ProcesedObjectStore.h Prefab/Spawnable/ProcesedObjectStore.cpp From 43c42f63c642aa47a7aae56a9bb5f765ca55f4c2 Mon Sep 17 00:00:00 2001 From: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> Date: Wed, 15 Dec 2021 10:52:23 -0800 Subject: [PATCH 172/948] Cleaned up some unused code in the Prefab processor. Signed-off-by: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> --- .../Components/TransformComponent.cpp | 25 ++++++++----------- .../Prefab/Spawnable/EditorInfoRemover.cpp | 4 +-- .../Spawnable/PrefabCatchmentProcessor.cpp | 10 ++++---- .../Spawnable/PrefabCatchmentProcessor.h | 3 +-- .../Spawnable/PrefabProcessorContext.cpp | 8 +++--- .../Prefab/Spawnable/PrefabProcessorContext.h | 4 +-- 6 files changed, 25 insertions(+), 29 deletions(-) diff --git a/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.cpp b/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.cpp index 2f3fc3cb8b..809f664a10 100644 --- a/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.cpp +++ b/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.cpp @@ -585,24 +585,21 @@ namespace AzFramework EBUS_EVENT_PTR(m_notificationBus, AZ::TransformNotificationBus, OnParentChanged, oldParent, parentId); m_parentChangedEvent.Signal(oldParent, parentId); - if (GetEntity() != nullptr) + if (oldParent != parentId) // Don't send removal notification while activating. { - if (oldParent != parentId) // Don't send removal notification while activating. + EBUS_EVENT_ID(oldParent, AZ::TransformNotificationBus, OnChildRemoved, GetEntityId()); + auto oldParentTransform = AZ::TransformBus::FindFirstHandler(oldParent); + if (oldParentTransform) { - EBUS_EVENT_ID(oldParent, AZ::TransformNotificationBus, OnChildRemoved, GetEntityId()); - auto oldParentTransform = AZ::TransformBus::FindFirstHandler(oldParent); - if (oldParentTransform) - { - oldParentTransform->NotifyChildChangedEvent(AZ::ChildChangeType::Removed, GetEntityId()); - } + oldParentTransform->NotifyChildChangedEvent(AZ::ChildChangeType::Removed, GetEntityId()); } + } - EBUS_EVENT_ID(parentId, AZ::TransformNotificationBus, OnChildAdded, GetEntityId()); - auto newParentTransform = AZ::TransformBus::FindFirstHandler(parentId); - if (newParentTransform) - { - newParentTransform->NotifyChildChangedEvent(AZ::ChildChangeType::Added, GetEntityId()); - } + EBUS_EVENT_ID(parentId, AZ::TransformNotificationBus, OnChildAdded, GetEntityId()); + auto newParentTransform = AZ::TransformBus::FindFirstHandler(parentId); + if (newParentTransform) + { + newParentTransform->NotifyChildChangedEvent(AZ::ChildChangeType::Added, GetEntityId()); } } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/EditorInfoRemover.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/EditorInfoRemover.cpp index 3f6d698bbe..9488b68ee8 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/EditorInfoRemover.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/EditorInfoRemover.cpp @@ -37,13 +37,13 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils } prefabProcessorContext.ListPrefabs( - [this, &serializeContext, &prefabProcessorContext]([[maybe_unused]] AZStd::string_view prefabName, PrefabDocument& prefab) + [this, &serializeContext, &prefabProcessorContext](PrefabDocument& prefab) { auto result = RemoveEditorInfo(prefab, serializeContext, prefabProcessorContext); if (!result) { AZ_Error( - "Prefab", false, "Converting to runtime Prefab '%.*s' failed, Error: %s .", AZ_STRING_ARG(prefabName), + "Prefab", false, "Converting to runtime Prefab '%s' failed, Error: %s .", prefab.GetName().c_str(), result.GetError().c_str()); return; } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.cpp index 4658eea49f..40cd52cac8 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.cpp @@ -25,9 +25,9 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils { AZ::DataStream::StreamType serializationFormat = m_serializationFormat == SerializationFormats::Binary ? AZ::DataStream::StreamType::ST_BINARY : AZ::DataStream::StreamType::ST_XML; - context.ListPrefabs([&context, serializationFormat](AZStd::string_view prefabName, PrefabDocument& prefab) + context.ListPrefabs([&context, serializationFormat](PrefabDocument& prefab) { - ProcessPrefab(context, prefabName, prefab, serializationFormat); + ProcessPrefab(context, prefab, serializationFormat); }); } @@ -45,12 +45,12 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils } } - void PrefabCatchmentProcessor::ProcessPrefab(PrefabProcessorContext& context, AZStd::string_view prefabName, PrefabDocument& prefab, + void PrefabCatchmentProcessor::ProcessPrefab(PrefabProcessorContext& context, PrefabDocument& prefab, AZ::DataStream::StreamType serializationFormat) { using namespace AzToolsFramework::Prefab::SpawnableUtils; - AZStd::string uniqueName = prefabName; + AZStd::string uniqueName = prefab.GetName(); uniqueName += AzFramework::Spawnable::DotFileExtension; auto serializer = [serializationFormat](AZStd::vector& output, const ProcessedObjectStore& object) -> bool @@ -67,7 +67,7 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils Instance& instance = prefab.GetInstance(); // Resolve entity aliases that store PrefabDOM information to use the spawnable instead. This is done before the entities are // moved from the instance as they'd otherwise can't be found. - context.ResolveSpawnableEntityAliases(prefabName, *spawnable, instance); + context.ResolveSpawnableEntityAliases(prefab.GetName(), *spawnable, instance); AzFramework::Spawnable::EntityList& entities = spawnable->GetEntities(); instance.DetachAllEntitiesInHierarchy( diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.h index a3556d73b7..39a94c86b8 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.h @@ -40,8 +40,7 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils static void Reflect(AZ::ReflectContext* context); protected: - static void ProcessPrefab(PrefabProcessorContext& context, AZStd::string_view prefabName, PrefabDocument& prefab, - AZ::DataStream::StreamType serializationFormat); + static void ProcessPrefab(PrefabProcessorContext& context, PrefabDocument& prefab, AZ::DataStream::StreamType serializationFormat); SerializationFormats m_serializationFormat{ SerializationFormats::Binary }; }; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp index 0fd428fa3b..2e8da9f9a1 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp @@ -45,12 +45,12 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils return false; } - void PrefabProcessorContext::ListPrefabs(const AZStd::function& callback) + void PrefabProcessorContext::ListPrefabs(const AZStd::function& callback) { m_isIterating = true; for (PrefabDocument& document : m_prefabs) { - callback(document.GetName(), document); + callback(document); } m_isIterating = false; @@ -60,11 +60,11 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils m_pendingPrefabAdditions.clear(); } - void PrefabProcessorContext::ListPrefabs(const AZStd::function& callback) const + void PrefabProcessorContext::ListPrefabs(const AZStd::function& callback) const { for (const PrefabDocument& document : m_prefabs) { - callback(document.GetName(), document); + callback(document); } } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.h index 8dde89b9e1..d07761271b 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.h @@ -46,8 +46,8 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils virtual ~PrefabProcessorContext() = default; virtual bool AddPrefab(PrefabDocument&& document); - virtual void ListPrefabs(const AZStd::function& callback); - virtual void ListPrefabs(const AZStd::function& callback) const; + virtual void ListPrefabs(const AZStd::function& callback); + virtual void ListPrefabs(const AZStd::function& callback) const; virtual bool HasPrefabs() const; virtual bool RegisterSpawnableProductAssetDependency( From a964120b7ad8edcd1c47181d13f06237e241989e Mon Sep 17 00:00:00 2001 From: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> Date: Wed, 15 Dec 2021 14:32:28 -0800 Subject: [PATCH 173/948] Updated the NetworkPrefabProcessor with the latest Prefab builder changes. Signed-off-by: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> --- .../Pipeline/NetworkPrefabProcessor.cpp | 75 +++++++------------ .../Source/Pipeline/NetworkPrefabProcessor.h | 19 +++-- 2 files changed, 36 insertions(+), 58 deletions(-) diff --git a/Gems/Multiplayer/Code/Source/Pipeline/NetworkPrefabProcessor.cpp b/Gems/Multiplayer/Code/Source/Pipeline/NetworkPrefabProcessor.cpp index 2a6baed411..a797523bc0 100644 --- a/Gems/Multiplayer/Code/Source/Pipeline/NetworkPrefabProcessor.cpp +++ b/Gems/Multiplayer/Code/Source/Pipeline/NetworkPrefabProcessor.cpp @@ -20,11 +20,10 @@ namespace Multiplayer { - using AzToolsFramework::Prefab::PrefabConversionUtils::PrefabProcessor; - using AzToolsFramework::Prefab::PrefabConversionUtils::ProcessedObjectStore; - - void NetworkPrefabProcessor::Process(PrefabProcessorContext& context) + void NetworkPrefabProcessor::Process(AzToolsFramework::Prefab::PrefabConversionUtils::PrefabProcessorContext& context) { + using AzToolsFramework::Prefab::PrefabConversionUtils::PrefabDocument; + IMultiplayerTools* mpTools = AZ::Interface::Get(); if (mpTools) { @@ -33,11 +32,17 @@ namespace Multiplayer AZ::DataStream::StreamType serializationFormat = GetAzSerializationFormat(); - context.ListPrefabs([&context, serializationFormat](AZStd::string_view prefabName, PrefabDom& prefab) { - ProcessPrefab(context, prefabName, prefab, serializationFormat); - }); + bool networkPrefabsAdded = false; + context.ListPrefabs( + [&networkPrefabsAdded, &context, serializationFormat](PrefabDocument& prefab) + { + if (ProcessPrefab(context, prefab, serializationFormat)) + { + networkPrefabsAdded = true; + } + }); - if (mpTools && !context.GetProcessedObjects().empty()) + if (mpTools && networkPrefabsAdded) { mpTools->SetDidProcessNetworkPrefabs(true); } @@ -59,28 +64,6 @@ namespace Multiplayer } } - static AZStd::unique_ptr LoadInstanceFromPrefab(const PrefabDom& prefab) - { - using namespace AzToolsFramework::Prefab; - - // convert Prefab DOM into Prefab Instance. - AZStd::unique_ptr sourceInstance(aznew Instance()); - if (!PrefabDomUtils::LoadInstanceFromPrefabDom(*sourceInstance, prefab, PrefabDomUtils::LoadFlags::AssignRandomEntityId)) - { - PrefabDomValueConstReference sourceReference = PrefabDomUtils::FindPrefabDomValue(prefab, PrefabDomUtils::SourceName); - - AZStd::string errorMessage("NetworkPrefabProcessor: Failed to Load Prefab Instance from given Prefab Dom."); - if (sourceReference.has_value() && sourceReference->get().IsString() && sourceReference->get().GetStringLength() != 0) - { - AZStd::string_view source(sourceReference->get().GetString(), sourceReference->get().GetStringLength()); - errorMessage += AZStd::string::format("Prefab Source: %.*s", AZ_STRING_ARG(source)); - } - AZ_Error("NetworkPrefabProcessor", false, errorMessage.c_str()); - return nullptr; - } - return sourceInstance; - } - static void GatherNetEntities( AzToolsFramework::Prefab::Instance* instance, AZStd::unordered_map& entityToInstanceMap, @@ -103,18 +86,15 @@ namespace Multiplayer }); } - void NetworkPrefabProcessor::ProcessPrefab(PrefabProcessorContext& context, AZStd::string_view prefabName, PrefabDom& prefab, AZ::DataStream::StreamType serializationFormat) + bool NetworkPrefabProcessor::ProcessPrefab( + AzToolsFramework::Prefab::PrefabConversionUtils::PrefabProcessorContext& context, + AzToolsFramework::Prefab::PrefabConversionUtils::PrefabDocument& prefab, + AZ::DataStream::StreamType serializationFormat) { + using AzToolsFramework::Prefab::PrefabConversionUtils::ProcessedObjectStore; using namespace AzToolsFramework::Prefab; - // convert Prefab DOM into Prefab Instance. - AZStd::unique_ptr sourceInstance = LoadInstanceFromPrefab(prefab); - if (!sourceInstance) - { - return; - } - - AZStd::string uniqueName = prefabName; + AZStd::string uniqueName = prefab.GetName(); uniqueName += ".network.spawnable"; auto serializer = [serializationFormat](AZStd::vector& output, const ProcessedObjectStore& object) -> bool { @@ -127,15 +107,16 @@ namespace Multiplayer ProcessedObjectStore::Create(uniqueName, context.GetSourceUuid(), AZStd::move(serializer)); auto& netSpawnableEntities = networkSpawnable->GetEntities(); + Instance& sourceInstance = prefab.GetInstance(); // Grab all net entities with their corresponding Instances to handle nested prefabs correctly AZStd::unordered_map netEntityToInstanceMap; AZStd::vector prefabNetEntities; - GatherNetEntities(sourceInstance.get(), netEntityToInstanceMap, prefabNetEntities); + GatherNetEntities(&sourceInstance, netEntityToInstanceMap, prefabNetEntities); if (prefabNetEntities.empty()) { // No networked entities in the prefab, no need to do anything in this processor. - return; + return false; } // Sort the entities prior to processing. The entities will end up in the net spawnable in this order. @@ -182,7 +163,7 @@ namespace Multiplayer // Add net spawnable asset holder to the prefab root { - EntityOptionalReference containerEntityRef = sourceInstance->GetContainerEntity(); + EntityOptionalReference containerEntityRef = sourceInstance.GetContainerEntity(); if (containerEntityRef.has_value()) { auto* networkSpawnableHolderComponent = containerEntityRef.value().get().CreateComponent(); @@ -193,18 +174,12 @@ namespace Multiplayer AZ::Entity* networkSpawnableHolderEntity = aznew AZ::Entity(uniqueName); auto* networkSpawnableHolderComponent = networkSpawnableHolderEntity->CreateComponent(); networkSpawnableHolderComponent->SetNetworkSpawnableAsset(networkSpawnableAsset); - sourceInstance->AddEntity(*networkSpawnableHolderEntity); + sourceInstance.AddEntity(*networkSpawnableHolderEntity); } } - // save the final result in the target Prefab DOM. - if (!PrefabDomUtils::StoreInstanceInPrefabDom(*sourceInstance, prefab)) - { - AZ_Error("NetworkPrefabProcessor", false, "Saving exported Prefab Instance within a Prefab Dom failed."); - return; - } - context.GetProcessedObjects().push_back(AZStd::move(object)); + return true; } AZ::DataStream::StreamType NetworkPrefabProcessor::GetAzSerializationFormat() const diff --git a/Gems/Multiplayer/Code/Source/Pipeline/NetworkPrefabProcessor.h b/Gems/Multiplayer/Code/Source/Pipeline/NetworkPrefabProcessor.h index 0fd3529db7..ef8912467d 100644 --- a/Gems/Multiplayer/Code/Source/Pipeline/NetworkPrefabProcessor.h +++ b/Gems/Multiplayer/Code/Source/Pipeline/NetworkPrefabProcessor.h @@ -14,23 +14,23 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils { class PrefabProcessorContext; + class PrefabDocument; } namespace Multiplayer { - using AzToolsFramework::Prefab::PrefabConversionUtils::PrefabProcessor; - using AzToolsFramework::Prefab::PrefabConversionUtils::PrefabProcessorContext; - using AzToolsFramework::Prefab::PrefabDom; - - class NetworkPrefabProcessor : public PrefabProcessor + class NetworkPrefabProcessor : public AzToolsFramework::Prefab::PrefabConversionUtils::PrefabProcessor { public: AZ_CLASS_ALLOCATOR(NetworkPrefabProcessor, AZ::SystemAllocator, 0); - AZ_RTTI(Multiplayer::NetworkPrefabProcessor, "{AF6C36DA-CBB9-4DF4-AE2D-7BC6CCE65176}", PrefabProcessor); + AZ_RTTI( + Multiplayer::NetworkPrefabProcessor, + "{AF6C36DA-CBB9-4DF4-AE2D-7BC6CCE65176}", + AzToolsFramework::Prefab::PrefabConversionUtils::PrefabProcessor); ~NetworkPrefabProcessor() override = default; - void Process(PrefabProcessorContext& context) override; + void Process(AzToolsFramework::Prefab::PrefabConversionUtils::PrefabProcessorContext& context) override; static void Reflect(AZ::ReflectContext* context); @@ -44,7 +44,10 @@ namespace Multiplayer AZ::DataStream::StreamType GetAzSerializationFormat() const; protected: - static void ProcessPrefab(PrefabProcessorContext& context, AZStd::string_view prefabName, PrefabDom& prefab, AZ::DataStream::StreamType serializationFormat); + static bool ProcessPrefab( + AzToolsFramework::Prefab::PrefabConversionUtils::PrefabProcessorContext& context, + AzToolsFramework::Prefab::PrefabConversionUtils::PrefabDocument& prefab, + AZ::DataStream::StreamType serializationFormat); SerializationFormats m_serializationFormat = SerializationFormats::Binary; }; From 02137e2219944987fc3879bbd931b5c4045a91c8 Mon Sep 17 00:00:00 2001 From: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> Date: Wed, 15 Dec 2021 16:11:51 -0800 Subject: [PATCH 174/948] Fixed existing tests for Prefab processing. Signed-off-by: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> --- .../Prefab/SpawnableRemoveEditorInfoTestFixture.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Code/Framework/AzToolsFramework/Tests/Prefab/SpawnableRemoveEditorInfoTestFixture.cpp b/Code/Framework/AzToolsFramework/Tests/Prefab/SpawnableRemoveEditorInfoTestFixture.cpp index b8ce3c7c42..0d75227e38 100644 --- a/Code/Framework/AzToolsFramework/Tests/Prefab/SpawnableRemoveEditorInfoTestFixture.cpp +++ b/Code/Framework/AzToolsFramework/Tests/Prefab/SpawnableRemoveEditorInfoTestFixture.cpp @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -201,15 +202,14 @@ namespace UnitTest { ConvertSourceEntitiesToPrefab(); + AzToolsFramework::Prefab::PrefabConversionUtils::PrefabDocument prefab("Test"); + prefab.SetPrefabDom(m_prefabDom); const bool actualResult = - m_editorInfoRemover.RemoveEditorInfo(m_prefabDom, m_serializeContext, m_prefabProcessorContext).IsSuccess(); + m_editorInfoRemover.RemoveEditorInfo(prefab, m_serializeContext, m_prefabProcessorContext).IsSuccess(); EXPECT_EQ(expectedResult, actualResult); - AZStd::unique_ptr convertedInstance(aznew Instance()); - ASSERT_TRUE(AzToolsFramework::Prefab::PrefabDomUtils::LoadInstanceFromPrefabDom(*convertedInstance, m_prefabDom)); - - convertedInstance->DetachAllEntitiesInHierarchy( + prefab.GetInstance().DetachAllEntitiesInHierarchy( [this](AZStd::unique_ptr entity) { m_runtimeEntities.emplace_back(entity.release()); From 1efbb7216f4bef0e3fd904c7289ee67938bb31b9 Mon Sep 17 00:00:00 2001 From: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> Date: Thu, 16 Dec 2021 10:51:11 -0800 Subject: [PATCH 175/948] Addressed issues found in/by the Spawnables benchmarks and unit tests. Signed-off-by: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> --- .../Spawnable/SpawnableEntitiesInterface.h | 3 +++ .../Spawnable/SpawnableEntitiesManager.cpp | 25 +++++-------------- .../SpawnableEntitiesManagerTests.cpp | 4 +-- .../Spawnable/SpawnAllEntitiesBenchmarks.cpp | 9 ++++--- .../Code/Source/PrefabInstanceSpawner.cpp | 2 +- 5 files changed, 17 insertions(+), 26 deletions(-) diff --git a/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableEntitiesInterface.h b/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableEntitiesInterface.h index dc9c7b4538..66197ae8fc 100644 --- a/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableEntitiesInterface.h +++ b/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableEntitiesInterface.h @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -164,6 +165,8 @@ namespace AzFramework public: friend class SpawnableEntitiesDefinition; + AZ_CLASS_ALLOCATOR(AzFramework::EntitySpawnTicket, AZ::SystemAllocator, 0); + using Id = uint32_t; EntitySpawnTicket() = default; diff --git a/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableEntitiesManager.cpp b/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableEntitiesManager.cpp index 37570caec7..3406057fca 100644 --- a/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableEntitiesManager.cpp +++ b/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableEntitiesManager.cpp @@ -499,12 +499,8 @@ namespace AzFramework for (auto it = newEntitiesBegin; it != newEntitiesEnd; ++it) { AZ::Entity* clone = (*it); - // The entity component framework doesn't handle entities without TransformComponent safely. - if (!clone->GetComponents().empty()) - { - clone->SetSpawnTicketId(request.m_ticketId); - GameEntityContextRequestBus::Broadcast(&GameEntityContextRequestBus::Events::AddGameEntity, *it); - } + clone->SetSpawnTicketId(request.m_ticketId); + GameEntityContextRequestBus::Broadcast(&GameEntityContextRequestBus::Events::AddGameEntity, clone); } // Let other systems know about newly spawned entities for any post-processing after adding to the scene/game context. @@ -636,12 +632,8 @@ namespace AzFramework for (auto it = ticket.m_spawnedEntities.begin() + spawnedEntitiesInitialCount; it != ticket.m_spawnedEntities.end(); ++it) { AZ::Entity* clone = (*it); - // The entity component framework doesn't handle entities without TransformComponent safely. - if (!clone->GetComponents().empty()) - { - clone->SetSpawnTicketId(request.m_ticketId); - GameEntityContextRequestBus::Broadcast(&GameEntityContextRequestBus::Events::AddGameEntity, *it); - } + clone->SetSpawnTicketId(request.m_ticketId); + GameEntityContextRequestBus::Broadcast(&GameEntityContextRequestBus::Events::AddGameEntity, *it); } if (request.m_completionCallback) @@ -668,7 +660,7 @@ namespace AzFramework { if (entity != nullptr) { - // Setting it to 0 is needed to avoid the infite loop between GameEntityContext and SpawnableEntitiesManager. + // Setting it to 0 is needed to avoid the infinite loop between GameEntityContext and SpawnableEntitiesManager. entity->SetSpawnTicketId(0); GameEntityContextRequestBus::Broadcast( &GameEntityContextRequestBus::Events::DestroyGameEntity, entity->GetId()); @@ -702,7 +694,7 @@ namespace AzFramework { if (*entityIterator != nullptr && (*entityIterator)->GetId() == request.m_entityId) { - // Setting it to 0 is needed to avoid the infite loop between GameEntityContext and SpawnableEntitiesManager. + // Setting it to 0 is needed to avoid the infinite loop between GameEntityContext and SpawnableEntitiesManager. (*entityIterator)->SetSpawnTicketId(0); GameEntityContextRequestBus::Broadcast( &GameEntityContextRequestBus::Events::DestroyGameEntity, (*entityIterator)->GetId()); @@ -949,11 +941,6 @@ namespace AzFramework GameEntityContextRequestBus::Broadcast( &GameEntityContextRequestBus::Events::DestroyGameEntity, entity->GetId()); } - else - { - // Entities without components wouldn't have been send to the GameEntityContext. - delete entity; - } } delete request.m_ticket; diff --git a/Code/Framework/AzFramework/Tests/Spawnable/SpawnableEntitiesManagerTests.cpp b/Code/Framework/AzFramework/Tests/Spawnable/SpawnableEntitiesManagerTests.cpp index 0dc00f81dd..d39bfed1e2 100644 --- a/Code/Framework/AzFramework/Tests/Spawnable/SpawnableEntitiesManagerTests.cpp +++ b/Code/Framework/AzFramework/Tests/Spawnable/SpawnableEntitiesManagerTests.cpp @@ -111,7 +111,7 @@ namespace UnitTest m_spawnable = aznew AzFramework::Spawnable( AZ::Data::AssetId::CreateString("{EB2E8A2B-F253-4A90-BBF4-55F2EED786B8}:0"), AZ::Data::AssetData::AssetStatus::Ready); m_spawnableAsset = new AZ::Data::Asset(m_spawnable, AZ::Data::AssetLoadBehavior::Default); - m_ticket = new AzFramework::EntitySpawnTicket(*m_spawnableAsset); + m_ticket = aznew AzFramework::EntitySpawnTicket(*m_spawnableAsset); auto managerInterface = AzFramework::SpawnableEntitiesInterface::Get(); m_manager = azrtti_cast(managerInterface); @@ -516,7 +516,7 @@ namespace UnitTest // Make sure we start with a fresh ticket each time, or else each iteration through this loop would continue to build up // more and more entities. delete m_ticket; - m_ticket = new AzFramework::EntitySpawnTicket(*m_spawnableAsset); + m_ticket = aznew AzFramework::EntitySpawnTicket(*m_spawnableAsset); constexpr size_t NumEntities = 4; FillSpawnable(NumEntities); diff --git a/Code/Framework/AzToolsFramework/Tests/Prefab/Benchmark/Spawnable/SpawnAllEntitiesBenchmarks.cpp b/Code/Framework/AzToolsFramework/Tests/Prefab/Benchmark/Spawnable/SpawnAllEntitiesBenchmarks.cpp index ecbbe10c39..ba0c3a4838 100644 --- a/Code/Framework/AzToolsFramework/Tests/Prefab/Benchmark/Spawnable/SpawnAllEntitiesBenchmarks.cpp +++ b/Code/Framework/AzToolsFramework/Tests/Prefab/Benchmark/Spawnable/SpawnAllEntitiesBenchmarks.cpp @@ -25,7 +25,7 @@ namespace Benchmark for (auto _ : state) { state.PauseTiming(); - m_spawnTicket = new AzFramework::EntitySpawnTicket(m_spawnableAsset); + m_spawnTicket = aznew AzFramework::EntitySpawnTicket(m_spawnableAsset); state.ResumeTiming(); for (uint64_t spwanableCounter = 0; spwanableCounter < spawnAllEntitiesCallCount; spwanableCounter++) @@ -62,7 +62,7 @@ namespace Benchmark for (auto _ : state) { state.PauseTiming(); - m_spawnTicket = new AzFramework::EntitySpawnTicket(m_spawnableAsset); + m_spawnTicket = aznew AzFramework::EntitySpawnTicket(m_spawnableAsset); state.ResumeTiming(); AzFramework::SpawnableEntitiesInterface::Get()->SpawnAllEntities(*m_spawnTicket); @@ -93,15 +93,16 @@ namespace Benchmark SetUpSpawnableAsset(entityCountInSpawnable); + auto spawner = AzFramework::SpawnableEntitiesInterface::Get(); for (auto _ : state) { state.PauseTiming(); - m_spawnTicket = new AzFramework::EntitySpawnTicket(m_spawnableAsset); + m_spawnTicket = aznew AzFramework::EntitySpawnTicket(m_spawnableAsset); state.ResumeTiming(); for (uint64_t spawnCallCounter = 0; spawnCallCounter < spawnCallCount; spawnCallCounter++) { - AzFramework::SpawnableEntitiesInterface::Get()->SpawnAllEntities(*m_spawnTicket); + spawner->SpawnAllEntities(*m_spawnTicket); } m_rootSpawnableInterface->ProcessSpawnableQueue(); diff --git a/Gems/Vegetation/Code/Source/PrefabInstanceSpawner.cpp b/Gems/Vegetation/Code/Source/PrefabInstanceSpawner.cpp index b386f17cab..c7c0ef5d3d 100644 --- a/Gems/Vegetation/Code/Source/PrefabInstanceSpawner.cpp +++ b/Gems/Vegetation/Code/Source/PrefabInstanceSpawner.cpp @@ -342,7 +342,7 @@ namespace Vegetation // Create the EntitySpawnTicket here. This pointer is going to get handed off to the vegetation system as opaque instance data, // where it will be tracked and held onto for the lifetime of the vegetation instance. The vegetation system will pass it back // in to DestroyInstance at the end of the lifetime, so that's the one place where we will delete the ticket pointers. - AzFramework::EntitySpawnTicket* ticket = new AzFramework::EntitySpawnTicket(m_spawnableAsset); + AzFramework::EntitySpawnTicket* ticket = aznew AzFramework::EntitySpawnTicket(m_spawnableAsset); if (ticket->IsValid()) { // Track the ticket that we've created. From e8366040dfb25515bf2f007377171cb40c55bf60 Mon Sep 17 00:00:00 2001 From: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> Date: Thu, 16 Dec 2021 15:30:36 -0800 Subject: [PATCH 176/948] Added unit test to cover the updates to the Spawnable Entities Aliases. Signed-off-by: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> --- .../SpawnableEntitiesManagerTests.cpp | 152 +++++++++++++++--- 1 file changed, 134 insertions(+), 18 deletions(-) diff --git a/Code/Framework/AzFramework/Tests/Spawnable/SpawnableEntitiesManagerTests.cpp b/Code/Framework/AzFramework/Tests/Spawnable/SpawnableEntitiesManagerTests.cpp index d39bfed1e2..1a483a7851 100644 --- a/Code/Framework/AzFramework/Tests/Spawnable/SpawnableEntitiesManagerTests.cpp +++ b/Code/Framework/AzFramework/Tests/Spawnable/SpawnableEntitiesManagerTests.cpp @@ -77,6 +77,12 @@ namespace UnitTest public: AZ_COMPONENT(TargetSpawnableComponent, "{B4041561-63A7-4E1E-80F1-78C08D497960}"); + TargetSpawnableComponent() = default; + explicit TargetSpawnableComponent(AZ::EntityId parent) + : m_parent(parent) + { + } + void Activate() override {} void Deactivate() override {} @@ -84,9 +90,12 @@ namespace UnitTest { if (auto* serializeContext = azrtti_cast(reflection)) { - serializeContext->Class(); + serializeContext->Class() + ->Field("Parent", &TargetSpawnableComponent::m_parent); } } + + AZ::EntityId m_parent; }; class SpawnableEntitiesManagerTest : public AllocatorsFixture @@ -147,22 +156,43 @@ namespace UnitTest { auto entry = AZStd::make_unique(); entry->AddComponent(aznew SourceSpawnableComponent()); + entry->SetId(AZ::EntityId(40 + i)); entities.push_back(AZStd::move(entry)); } } - AZ::Data::Asset CreateTargetSpawnable(size_t numElements) + AZ::Data::Asset CreateTargetSpawnable(size_t numElements, bool requiresMatchingEntityIds) { auto target = aznew AzFramework::Spawnable( AZ::Data::AssetId(AZ::Uuid("{716CD8C3-0BA8-4F32-B579-0EC7C967796F}")), AZ::Data::AssetData::AssetStatus::Ready); AzFramework::Spawnable::EntityList& entities = target->GetEntities(); entities.reserve(numElements); - for (size_t i = 0; i < numElements; ++i) + if (requiresMatchingEntityIds) { - auto entry = AZStd::make_unique(); - entry->AddComponent(aznew TargetSpawnableComponent()); - entities.push_back(AZStd::move(entry)); + for (size_t i = 0; i < numElements; ++i) + { + auto entry = AZStd::make_unique(); + if (i != 0) + { + entry->AddComponent(aznew TargetSpawnableComponent(AZ::EntityId(40 + i - 1))); + } + else + { + entry->AddComponent(aznew TargetSpawnableComponent()); + } + entry->SetId(AZ::EntityId(40 + i)); + entities.push_back(AZStd::move(entry)); + } + } + else + { + for (size_t i = 0; i < numElements; ++i) + { + auto entry = AZStd::make_unique(); + entry->AddComponent(aznew TargetSpawnableComponent()); + entities.push_back(AZStd::move(entry)); + } } return AZ::Data::Asset(target, AZ::Data::AssetLoadBehavior::NoLoad); @@ -212,6 +242,38 @@ namespace UnitTest return true; } + static bool DoParentEntityIdsMatch(AzFramework::SpawnableConstEntityContainerView entities) + { + if (entities.empty()) + { + return false; + } + + const AZ::Entity* previous = nullptr; + for (const AZ::Entity* entity : entities) + { + if (entity) + { + if (previous) + { + if (TargetSpawnableComponent* link = entity->FindComponent(); link != nullptr) + { + if (link->m_parent != previous->GetId()) + { + return false; + } + } + previous = entity; + } + } + else + { + return false; + } + } + return true; + } + static bool IsEveryOtherEntityAReplacement(AzFramework::SpawnableConstEntityContainerView entities) { bool onAlternative = true; @@ -599,7 +661,8 @@ namespace UnitTest using namespace AzFramework; static constexpr size_t NumEntities = 4; FillSpawnable(NumEntities); - AZ::Data::Asset target = CreateTargetSpawnable(4); + constexpr bool requiresMatchingEntityIds = true; + AZ::Data::Asset target = CreateTargetSpawnable(4, requiresMatchingEntityIds); InsertEntityAliases<4>( { 0, 1, 2, 3 }, { 0, 1, 2, 3 }, { Spawnable::EntityAliasType::Replace, Spawnable::EntityAliasType::Replace, Spawnable::EntityAliasType::Replace, @@ -608,11 +671,13 @@ namespace UnitTest size_t spawnedEntitiesCount = 0; bool allReplaced = false; - auto callback = [&spawnedEntitiesCount, &allReplaced]( + bool allEntityIdsPatched = false; + auto callback = [&spawnedEntitiesCount, &allReplaced, &allEntityIdsPatched]( AzFramework::EntitySpawnTicket::Id, AzFramework::SpawnableConstEntityContainerView entities) { spawnedEntitiesCount += entities.size(); allReplaced = AreAllEntitiesReplaced(entities); + allEntityIdsPatched = DoParentEntityIdsMatch(entities); }; AzFramework::SpawnAllEntitiesOptionalArgs optionalArgs; optionalArgs.m_completionCallback = AZStd::move(callback); @@ -621,6 +686,7 @@ namespace UnitTest EXPECT_EQ(4, spawnedEntitiesCount); EXPECT_TRUE(allReplaced); + EXPECT_TRUE(allEntityIdsPatched); } TEST_F(SpawnableEntitiesManagerTest, SpawnAllEntities_AllAliasesWithAdditional_SourceAndTargetComponentsMerged) @@ -628,7 +694,8 @@ namespace UnitTest using namespace AzFramework; static constexpr size_t NumEntities = 4; FillSpawnable(NumEntities); - AZ::Data::Asset target = CreateTargetSpawnable(4); + constexpr bool requiresMatchingEntityIds = false; + AZ::Data::Asset target = CreateTargetSpawnable(4, requiresMatchingEntityIds); InsertEntityAliases<4>( { 0, 1, 2, 3 }, { 0, 1, 2, 3 }, { Spawnable::EntityAliasType::Additional, Spawnable::EntityAliasType::Additional, Spawnable::EntityAliasType::Additional, @@ -637,11 +704,13 @@ namespace UnitTest size_t spawnedEntitiesCount = 0; bool allAdded = false; - auto callback = [&spawnedEntitiesCount, &allAdded]( + bool allEntityIdsPatched = false; + auto callback = [&spawnedEntitiesCount, &allAdded, &allEntityIdsPatched]( AzFramework::EntitySpawnTicket::Id, AzFramework::SpawnableConstEntityContainerView entities) { spawnedEntitiesCount += entities.size(); allAdded = IsEveryOtherEntityAReplacement(entities); + allEntityIdsPatched = DoParentEntityIdsMatch(entities); }; AzFramework::SpawnAllEntitiesOptionalArgs optionalArgs; optionalArgs.m_completionCallback = AZStd::move(callback); @@ -650,6 +719,7 @@ namespace UnitTest EXPECT_EQ(8, spawnedEntitiesCount); EXPECT_TRUE(allAdded); + EXPECT_TRUE(allEntityIdsPatched); } TEST_F(SpawnableEntitiesManagerTest, SpawnAllEntities_AllAliasesWithMerge_SourceAndTargetComponentsMerged) @@ -657,7 +727,8 @@ namespace UnitTest using namespace AzFramework; static constexpr size_t NumEntities = 4; FillSpawnable(NumEntities); - AZ::Data::Asset target = CreateTargetSpawnable(4); + constexpr bool requiresMatchingEntityIds = true; + AZ::Data::Asset target = CreateTargetSpawnable(4, requiresMatchingEntityIds); InsertEntityAliases<4>( { 0, 1, 2, 3 }, { 0, 1, 2, 3 }, { Spawnable::EntityAliasType::Merge, Spawnable::EntityAliasType::Merge, Spawnable::EntityAliasType::Merge, @@ -666,11 +737,13 @@ namespace UnitTest size_t spawnedEntitiesCount = 0; bool allMerged = false; - auto callback = [&spawnedEntitiesCount, &allMerged]( + bool allEntityIdsPatched = false; + auto callback = [&spawnedEntitiesCount, &allMerged, &allEntityIdsPatched]( AzFramework::EntitySpawnTicket::Id, AzFramework::SpawnableConstEntityContainerView entities) { spawnedEntitiesCount += entities.size(); allMerged = AreAllMerged(entities); + allEntityIdsPatched = DoParentEntityIdsMatch(entities); }; AzFramework::SpawnAllEntitiesOptionalArgs optionalArgs; optionalArgs.m_completionCallback = AZStd::move(callback); @@ -679,6 +752,7 @@ namespace UnitTest EXPECT_EQ(4, spawnedEntitiesCount); EXPECT_TRUE(allMerged); + EXPECT_TRUE(allEntityIdsPatched); } // @@ -1095,7 +1169,8 @@ namespace UnitTest using namespace AzFramework; static constexpr size_t NumEntities = 4; FillSpawnable(NumEntities); - AZ::Data::Asset target = CreateTargetSpawnable(4); + constexpr bool requiresMatchingEntityIds = true; + AZ::Data::Asset target = CreateTargetSpawnable(4, requiresMatchingEntityIds); InsertEntityAliases<4>( { 0, 1, 2, 3 }, { 0, 1, 2, 3 }, { Spawnable::EntityAliasType::Replace, Spawnable::EntityAliasType::Replace, Spawnable::EntityAliasType::Replace, @@ -1106,11 +1181,13 @@ namespace UnitTest size_t spawnedEntitiesCount = 0; bool allReplaced = false; - auto callback = [&spawnedEntitiesCount, &allReplaced]( + bool allEntityIdsPatched = false; + auto callback = [&spawnedEntitiesCount, &allReplaced, &allEntityIdsPatched]( AzFramework::EntitySpawnTicket::Id, AzFramework::SpawnableConstEntityContainerView entities) { spawnedEntitiesCount += entities.size(); allReplaced = AreAllEntitiesReplaced(entities); + allEntityIdsPatched = DoParentEntityIdsMatch(entities); }; AzFramework::SpawnEntitiesOptionalArgs optionalArgs; optionalArgs.m_completionCallback = AZStd::move(callback); @@ -1119,6 +1196,7 @@ namespace UnitTest EXPECT_EQ(4, spawnedEntitiesCount); EXPECT_TRUE(allReplaced); + EXPECT_TRUE(allEntityIdsPatched); } TEST_F(SpawnableEntitiesManagerTest, SpawnEntities_AllAliasesWithAdditional_SourceAndTargetComponentsMerged) @@ -1126,7 +1204,8 @@ namespace UnitTest using namespace AzFramework; static constexpr size_t NumEntities = 4; FillSpawnable(NumEntities); - AZ::Data::Asset target = CreateTargetSpawnable(4); + constexpr bool requiresMatchingEntityIds = false; + AZ::Data::Asset target = CreateTargetSpawnable(4, requiresMatchingEntityIds); InsertEntityAliases<4>( { 0, 1, 2, 3 }, { 0, 1, 2, 3 }, { Spawnable::EntityAliasType::Additional, Spawnable::EntityAliasType::Additional, Spawnable::EntityAliasType::Additional, @@ -1137,12 +1216,14 @@ namespace UnitTest size_t spawnedEntitiesCount = 0; bool allAdded = false; + bool allEntityIdsPatched = false; auto callback = - [&spawnedEntitiesCount, &allAdded]( + [&spawnedEntitiesCount, &allAdded, &allEntityIdsPatched]( AzFramework::EntitySpawnTicket::Id, AzFramework::SpawnableConstEntityContainerView entities) { spawnedEntitiesCount += entities.size(); allAdded = IsEveryOtherEntityAReplacement(entities); + allEntityIdsPatched = DoParentEntityIdsMatch(entities); }; AzFramework::SpawnEntitiesOptionalArgs optionalArgs; optionalArgs.m_completionCallback = AZStd::move(callback); @@ -1151,6 +1232,7 @@ namespace UnitTest EXPECT_EQ(8, spawnedEntitiesCount); EXPECT_TRUE(allAdded); + EXPECT_TRUE(allEntityIdsPatched); } TEST_F(SpawnableEntitiesManagerTest, SpawnEntities_AllAliasesWithMerge_SourceAndTargetComponentsMerged) @@ -1158,7 +1240,8 @@ namespace UnitTest using namespace AzFramework; static constexpr size_t NumEntities = 4; FillSpawnable(NumEntities); - AZ::Data::Asset target = CreateTargetSpawnable(4); + constexpr bool requiresMatchingEntityIds = true; + AZ::Data::Asset target = CreateTargetSpawnable(4, requiresMatchingEntityIds); InsertEntityAliases<4>( { 0, 1, 2, 3 }, { 0, 1, 2, 3 }, { Spawnable::EntityAliasType::Merge, Spawnable::EntityAliasType::Merge, Spawnable::EntityAliasType::Merge, @@ -1169,11 +1252,13 @@ namespace UnitTest size_t spawnedEntitiesCount = 0; bool allMerged = false; - auto callback = [&spawnedEntitiesCount, &allMerged]( + bool allEntityIdsPatched = false; + auto callback = [&spawnedEntitiesCount, &allMerged, &allEntityIdsPatched]( AzFramework::EntitySpawnTicket::Id, AzFramework::SpawnableConstEntityContainerView entities) { spawnedEntitiesCount += entities.size(); allMerged = AreAllMerged(entities); + allEntityIdsPatched = DoParentEntityIdsMatch(entities); }; AzFramework::SpawnEntitiesOptionalArgs optionalArgs; optionalArgs.m_completionCallback = AZStd::move(callback); @@ -1182,6 +1267,7 @@ namespace UnitTest EXPECT_EQ(4, spawnedEntitiesCount); EXPECT_TRUE(allMerged); + EXPECT_TRUE(allEntityIdsPatched); } // @@ -1302,6 +1388,36 @@ namespace UnitTest // ClaimEntities // + TEST_F(SpawnableEntitiesManagerTest, ClaimEntities_Call_AllEntitiesWereClaimedAndNotDeleted) + { + static constexpr size_t NumEntities = 4; + FillSpawnable(NumEntities); + + AZStd::vector claimedEntities; + auto callback = [&claimedEntities](AzFramework::EntitySpawnTicket::Id, AzFramework::SpawnableEntityContainerView container) + { + for (AZ::Entity* entity : container) + { + claimedEntities.push_back(entity); + } + }; + + { + AzFramework::EntitySpawnTicket ticket(*m_spawnableAsset); + m_manager->SpawnAllEntities(ticket); + m_manager->ClaimEntities(ticket, AZStd::move(callback)); + m_manager->ProcessQueue(AzFramework::SpawnableEntitiesManager::CommandQueuePriority::Regular); + } + + EXPECT_EQ(NumEntities, claimedEntities.size()); + + // If these calls fail it means that the ticket has still deleted the entities, so they weren't properly claimed. + for (AZ::Entity* entity : claimedEntities) + { + delete entity; + } + } + TEST_F(SpawnableEntitiesManagerTest, ClaimEntities_DeleteTicketBeforeCall_NoCrash) { auto callback = [](AzFramework::EntitySpawnTicket::Id, AzFramework::SpawnableEntityContainerView) {}; From c7c96d8bafa63c80f43aeb16a1ad425e27b900be Mon Sep 17 00:00:00 2001 From: lsemp3d <58790905+lsemp3d@users.noreply.github.com> Date: Thu, 16 Dec 2021 17:20:37 -0800 Subject: [PATCH 177/948] Code maintenance, improved OnCatalogLoaded logic and track additions and removals Signed-off-by: lsemp3d <58790905+lsemp3d@users.noreply.github.com> --- Gems/GraphCanvas/Code/Source/GraphCanvas.cpp | 48 +++++++++++--------- Gems/GraphCanvas/Code/Source/GraphCanvas.h | 7 +-- 2 files changed, 30 insertions(+), 25 deletions(-) diff --git a/Gems/GraphCanvas/Code/Source/GraphCanvas.cpp b/Gems/GraphCanvas/Code/Source/GraphCanvas.cpp index ebc15023cc..75306969f2 100644 --- a/Gems/GraphCanvas/Code/Source/GraphCanvas.cpp +++ b/Gems/GraphCanvas/Code/Source/GraphCanvas.cpp @@ -227,7 +227,6 @@ namespace GraphCanvas AzFramework::AssetCatalogEventBus::Handler::BusDisconnect(); Styling::PseudoElementFactoryRequestBus::Handler::BusDisconnect(); GraphCanvasRequestBus::Handler::BusDisconnect(); - AZ::Data::AssetBus::MultiHandler::BusDisconnect(); m_translationAssetWorker.Deactivate(); UnregisterAssetHandler(); @@ -369,26 +368,46 @@ namespace GraphCanvas void GraphCanvasSystemComponent::OnCatalogLoaded(const char* /*catalogFile*/) { - auto postEnumerateCb = [this]() + AZStd::vector translationAssets; + auto postEnumerateCb = [&translationAssets]() { - PopulateTranslationDatabase(); + for (const AZ::Data::AssetId& assetId : translationAssets) + { + AZ::Data::AssetManager::Instance().GetAsset(assetId, AZ::Data::AssetLoadBehavior::Default); + } }; // Find any TranslationAsset files that may have translation database key/values - AZ::Data::AssetCatalogRequests::AssetEnumerationCB collectAssetsCb = [this](const AZ::Data::AssetId assetId, const AZ::Data::AssetInfo& assetInfo) + AZ::Data::AssetCatalogRequests::AssetEnumerationCB collectAssetsCb = [&translationAssets](const AZ::Data::AssetId assetId, const AZ::Data::AssetInfo& assetInfo) { if (AZ::StringFunc::EndsWith(assetInfo.m_relativePath, ".names", false)) { - m_translationAssets.push_back(assetId); + translationAssets.push_back(assetId); } }; - m_translationAssets.clear(); - AZ::Data::AssetCatalogRequestBus::Broadcast(&AZ::Data::AssetCatalogRequestBus::Events::EnumerateAssets, nullptr, collectAssetsCb, postEnumerateCb); } + void GraphCanvasSystemComponent::OnCatalogAssetRemoved(const AZ::Data::AssetId& /*assetId*/, const AZ::Data::AssetInfo& assetInfo) + { + if (assetInfo.m_assetType == azrtti_typeid()) + { + GraphCanvas::TranslationRequestBus::Broadcast(&GraphCanvas::TranslationRequests::Restore); + } + } + + void GraphCanvasSystemComponent::OnCatalogAssetAdded(const AZ::Data::AssetId& assetId) + { + ReloadDatabase(assetId); + } + void GraphCanvasSystemComponent::OnCatalogAssetChanged(const AZ::Data::AssetId& assetId) + { + ReloadDatabase(assetId); + } + + void GraphCanvasSystemComponent::ReloadDatabase(const AZ::Data::AssetId& assetId) { AZ::Data::AssetInfo assetInfo; AZ::Data::AssetCatalogRequestBus::BroadcastResult(assetInfo, &AZ::Data::AssetCatalogRequestBus::Events::GetAssetInfoById, assetId); @@ -405,20 +424,5 @@ namespace GraphCanvas AZ::Data::AssetManager::Instance().UnregisterHandler(m_assetHandler.get()); m_assetHandler.reset(); } - - for (const AZ::Data::AssetId& assetId : m_translationAssets) - { - AZ::Data::AssetBus::MultiHandler::BusDisconnect(assetId); - } - m_translationAssets.clear(); - } - - void GraphCanvasSystemComponent::PopulateTranslationDatabase() - { - for (const AZ::Data::AssetId& assetId : m_translationAssets) - { - AZ::Data::AssetBus::MultiHandler::BusConnect(assetId); - AZ::Data::AssetManager::Instance().GetAsset(assetId, AZ::Data::AssetLoadBehavior::Default); - } } } diff --git a/Gems/GraphCanvas/Code/Source/GraphCanvas.h b/Gems/GraphCanvas/Code/Source/GraphCanvas.h index 0b47e9010a..37bf064203 100644 --- a/Gems/GraphCanvas/Code/Source/GraphCanvas.h +++ b/Gems/GraphCanvas/Code/Source/GraphCanvas.h @@ -25,7 +25,6 @@ namespace GraphCanvas , private GraphCanvasRequestBus::Handler , protected Styling::PseudoElementFactoryRequestBus::Handler , protected AzFramework::AssetCatalogEventBus::Handler - , protected AZ::Data::AssetBus::MultiHandler { public: @@ -80,15 +79,17 @@ namespace GraphCanvas // AzFramework::AssetCatalogEventBus::Handler void OnCatalogLoaded(const char* /*catalogFile*/) override; void OnCatalogAssetChanged(const AZ::Data::AssetId&) override; + void OnCatalogAssetAdded(const AZ::Data::AssetId&) override; + void OnCatalogAssetRemoved(const AZ::Data::AssetId& /*assetId*/, const AZ::Data::AssetInfo& /*assetInfo*/) override; //// + void ReloadDatabase(const AZ::Data::AssetId&); + AZStd::unique_ptr m_assetHandler; void RegisterTranslationBuilder(); void UnregisterAssetHandler(); TranslationAssetWorker m_translationAssetWorker; - AZStd::vector m_translationAssets; - void PopulateTranslationDatabase(); TranslationDatabase m_translationDatabase; }; From 34edd4d0c011cb184ffe8ba7a5734708d6540d08 Mon Sep 17 00:00:00 2001 From: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> Date: Thu, 16 Dec 2021 18:06:25 -0800 Subject: [PATCH 178/948] Fixed post rebase Spawnable issues. Signed-off-by: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> --- .../Prefab/Spawnable/InMemorySpawnableAssetContainer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/InMemorySpawnableAssetContainer.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/InMemorySpawnableAssetContainer.cpp index 553ad8ece4..dc5cd299b8 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/InMemorySpawnableAssetContainer.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/InMemorySpawnableAssetContainer.cpp @@ -112,9 +112,9 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils // Use a random uuid as this is only a temporary source. PrefabConversionUtils::PrefabProcessorContext context(AZ::Uuid::CreateRandom()); - PrefabDom copy; - copy.CopyFrom(templateReference->get().GetPrefabDom(), copy.GetAllocator(), false); - context.AddPrefab(spawnableName, AZStd::move(copy)); + PrefabDocument document(spawnableName); + document.SetPrefabDom(templateReference->get().GetPrefabDom()); + context.AddPrefab(AZStd::move(document)); m_converter.ProcessPrefab(context); if (!context.HasCompletedSuccessfully() || context.GetProcessedObjects().empty()) From d108fe4804071e1f22612e897021d6653f6bea53 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 16 Dec 2021 18:31:19 -0800 Subject: [PATCH 179/948] Addresses PR comments Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzCore/AzCore/Memory/AllocatorBase.cpp | 297 +++++++++--------- .../AzCore/Memory/BestFitExternalMapSchema.h | 2 +- .../AzCore/AzCore/Memory/IAllocator.h | 4 +- Code/Framework/AzCore/AzCore/Memory/Memory.h | 2 +- .../Tests/Memory/AllocatorBenchmarks.cpp | 4 +- 5 files changed, 157 insertions(+), 152 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp index 4da9ab384f..e877739e29 100644 --- a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp @@ -9,11 +9,10 @@ #include #include -using namespace AZ; +// Only used to create recordings of memory operations to use for memory benchmarks +#define O3DE_RECORDING_ENABLED 0 -#define RECORDING_ENABLED 0 - -#if RECORDING_ENABLED +#if O3DE_RECORDING_ENABLED #include #include @@ -25,10 +24,10 @@ namespace class DebugAllocator { public: - typedef void* pointer_type; - typedef AZStd::size_t size_type; - typedef AZStd::ptrdiff_t difference_type; - typedef AZStd::false_type allow_memory_leaks; ///< Regular allocators should not leak. + using pointer_type = void*; + using size_type = AZStd::size_t; + using difference_type = AZStd::ptrdiff_t; + using allow_memory_leaks = AZStd::false_type; ///< Regular allocators should not leak. AZ_FORCE_INLINE pointer_type allocate(size_t byteSize, size_t alignment, int = 0) { @@ -64,7 +63,7 @@ namespace static constexpr size_t s_maxNumberOfAllocationsToRecord = 16384; static size_t s_numberOfAllocationsRecorded = 0; - static constexpr size_t s_allocationOperationCount = 5 * 1024; + static constexpr size_t s_allocationOperationCount = 8 * 1024; static AZStd::array s_operations = {}; static uint64_t s_operationCounter = 0; @@ -76,11 +75,12 @@ namespace void RecordAllocatorOperation(AllocatorOperation::OperationType type, void* ptr, size_t size = 0, size_t alignment = 0) { - AZStd::scoped_lock lock(s_operationsMutex); + AZStd::scoped_lock lock(s_operationsMutex); if (s_operationCounter == s_allocationOperationCount) { AZ::IO::SystemFile file; int mode = AZ::IO::SystemFile::OpenMode::SF_OPEN_APPEND | AZ::IO::SystemFile::OpenMode::SF_OPEN_WRITE_ONLY; + // memoryrecordings.bin is being output to the current working directory if (!file.Exists("memoryrecordings.bin")) { mode |= AZ::IO::SystemFile::OpenMode::SF_OPEN_CREATE; @@ -158,188 +158,195 @@ namespace } #endif -AllocatorBase::AllocatorBase(IAllocatorSchema* allocationSchema, const char* name, const char* desc) - : IAllocator(allocationSchema) - , m_name(name) - , m_desc(desc) +namespace AZ { -} + AllocatorBase::AllocatorBase(IAllocatorSchema* allocationSchema, const char* name, const char* desc) + : IAllocator(allocationSchema) + , m_name(name) + , m_desc(desc) + { + } -AllocatorBase::~AllocatorBase() -{ - AZ_Assert(!m_isReady, "Allocator %s (%s) is being destructed without first having gone through proper calls to PreDestroy() and Destroy(). Use AllocatorInstance<> for global allocators or AllocatorWrapper<> for local allocators.", m_name, m_desc); -} + AllocatorBase::~AllocatorBase() + { + AZ_Assert( + !m_isReady, + "Allocator %s (%s) is being destructed without first having gone through proper calls to PreDestroy() and Destroy(). Use " + "AllocatorInstance<> for global allocators or AllocatorWrapper<> for local allocators.", + m_name, m_desc); + } -const char* AllocatorBase::GetName() const -{ - return m_name; -} + const char* AllocatorBase::GetName() const + { + return m_name; + } -const char* AllocatorBase::GetDescription() const -{ - return m_desc; -} + const char* AllocatorBase::GetDescription() const + { + return m_desc; + } -Debug::AllocationRecords* AllocatorBase::GetRecords() -{ - return m_records; -} + Debug::AllocationRecords* AllocatorBase::GetRecords() + { + return m_records; + } -void AllocatorBase::SetRecords(Debug::AllocationRecords* records) -{ - m_records = records; - m_memoryGuardSize = records ? records->MemoryGuardSize() : 0; -} + void AllocatorBase::SetRecords(Debug::AllocationRecords* records) + { + m_records = records; + m_memoryGuardSize = records ? records->MemoryGuardSize() : 0; + } -bool AllocatorBase::IsReady() const -{ - return m_isReady; -} + bool AllocatorBase::IsReady() const + { + return m_isReady; + } -void AllocatorBase::PostCreate() -{ - if (m_registrationEnabled) + void AllocatorBase::PostCreate() { - if (AZ::Environment::IsReady()) + if (m_registrationEnabled) { - AllocatorManager::Instance().RegisterAllocator(this); + if (AZ::Environment::IsReady()) + { + AllocatorManager::Instance().RegisterAllocator(this); + } + else + { + AllocatorManager::PreRegisterAllocator(this); + } } - else + + const auto debugConfig = GetDebugConfig(); + if (!debugConfig.m_excludeFromDebugging) { - AllocatorManager::PreRegisterAllocator(this); + SetRecords(aznew Debug::AllocationRecords( + (unsigned char)debugConfig.m_stackRecordLevels, debugConfig.m_usesMemoryGuards, debugConfig.m_marksUnallocatedMemory, + GetName())); } + + m_isReady = true; } - const auto debugConfig = GetDebugConfig(); - if (!debugConfig.m_excludeFromDebugging) + void AllocatorBase::PreDestroy() { - SetRecords(aznew Debug::AllocationRecords((unsigned char)debugConfig.m_stackRecordLevels, debugConfig.m_usesMemoryGuards, debugConfig.m_marksUnallocatedMemory, GetName())); - } + Debug::AllocationRecords* allocatorRecords = GetRecords(); + if (allocatorRecords) + { + delete allocatorRecords; + SetRecords(nullptr); + } - m_isReady = true; -} + if (m_registrationEnabled && AZ::AllocatorManager::IsReady()) + { + AllocatorManager::Instance().UnRegisterAllocator(this); + } -void AllocatorBase::PreDestroy() -{ - Debug::AllocationRecords* allocatorRecords = GetRecords(); - if(allocatorRecords) - { - delete allocatorRecords; - SetRecords(nullptr); + m_isReady = false; } - if (m_registrationEnabled && AZ::AllocatorManager::IsReady()) + void AllocatorBase::SetLazilyCreated(bool lazy) { - AllocatorManager::Instance().UnRegisterAllocator(this); + m_isLazilyCreated = lazy; } - m_isReady = false; -} - -void AllocatorBase::SetLazilyCreated(bool lazy) -{ - m_isLazilyCreated = lazy; -} - -bool AllocatorBase::IsLazilyCreated() const -{ - return m_isLazilyCreated; -} - -void AllocatorBase::SetProfilingActive(bool active) -{ - m_isProfilingActive = active; -} + bool AllocatorBase::IsLazilyCreated() const + { + return m_isLazilyCreated; + } -bool AllocatorBase::IsProfilingActive() const -{ - return m_isProfilingActive; -} + void AllocatorBase::SetProfilingActive(bool active) + { + m_isProfilingActive = active; + } -void AllocatorBase::DisableRegistration() -{ - m_registrationEnabled = false; -} + bool AllocatorBase::IsProfilingActive() const + { + return m_isProfilingActive; + } -void AllocatorBase::ProfileAllocation(void* ptr, size_t byteSize, size_t alignment, const char* name, const char* fileName, int lineNum, int suppressStackRecord) -{ - if (m_isProfilingActive) + void AllocatorBase::DisableRegistration() { -#if defined(AZ_HAS_VARIADIC_TEMPLATES) && defined(AZ_DEBUG_BUILD) - ++suppressStackRecord; // one more for the fact the ebus is a function -#endif // AZ_HAS_VARIADIC_TEMPLATES + m_registrationEnabled = false; + } - auto records = GetRecords(); - if (records) + void AllocatorBase::ProfileAllocation( + void* ptr, size_t byteSize, size_t alignment, const char* name, const char* fileName, int lineNum, int suppressStackRecord) + { + if (m_isProfilingActive) { - records->RegisterAllocation(ptr, byteSize, alignment, name, fileName, lineNum, suppressStackRecord + 1); + auto records = GetRecords(); + if (records) + { + records->RegisterAllocation(ptr, byteSize, alignment, name, fileName, lineNum, suppressStackRecord + 1); + } } - } -#if RECORDING_ENABLED - RecordAllocatorOperation(AllocatorOperation::ALLOCATE, ptr, byteSize, alignment); +#if O3DE_RECORDING_ENABLED + RecordAllocatorOperation(AllocatorOperation::ALLOCATE, ptr, byteSize, alignment); #endif -} + } -void AllocatorBase::ProfileDeallocation(void* ptr, size_t byteSize, size_t alignment, Debug::AllocationInfo* info) -{ - if (m_isProfilingActive) + void AllocatorBase::ProfileDeallocation(void* ptr, size_t byteSize, size_t alignment, Debug::AllocationInfo* info) { - auto records = GetRecords(); - if (records) + if (m_isProfilingActive) { - records->UnregisterAllocation(ptr, byteSize, alignment, info); + auto records = GetRecords(); + if (records) + { + records->UnregisterAllocation(ptr, byteSize, alignment, info); + } } - } -#if RECORDING_ENABLED - RecordAllocatorOperation(AllocatorOperation::DEALLOCATE, ptr, byteSize, alignment); +#if O3DE_RECORDING_ENABLED + RecordAllocatorOperation(AllocatorOperation::DEALLOCATE, ptr, byteSize, alignment); #endif -} - -void AllocatorBase::ProfileReallocationBegin([[maybe_unused]] void* ptr, [[maybe_unused]] size_t newSize) -{ -} + } -void AllocatorBase::ProfileReallocationEnd(void* ptr, void* newPtr, size_t newSize, size_t newAlignment) -{ - if (m_isProfilingActive) + void AllocatorBase::ProfileReallocationBegin([[maybe_unused]] void* ptr, [[maybe_unused]] size_t newSize) { - Debug::AllocationInfo info; - ProfileDeallocation(ptr, 0, 0, &info); - ProfileAllocation(newPtr, newSize, newAlignment, info.m_name, info.m_fileName, info.m_lineNum, 0); } -#if RECORDING_ENABLED - RecordAllocatorOperation(AllocatorOperation::DEALLOCATE, ptr); - RecordAllocatorOperation(AllocatorOperation::ALLOCATE, newPtr, newSize, newAlignment); + + void AllocatorBase::ProfileReallocationEnd(void* ptr, void* newPtr, size_t newSize, size_t newAlignment) + { + if (m_isProfilingActive) + { + Debug::AllocationInfo info; + ProfileDeallocation(ptr, 0, 0, &info); + ProfileAllocation(newPtr, newSize, newAlignment, info.m_name, info.m_fileName, info.m_lineNum, 0); + } +#if O3DE_RECORDING_ENABLED + RecordAllocatorOperation(AllocatorOperation::DEALLOCATE, ptr); + RecordAllocatorOperation(AllocatorOperation::ALLOCATE, newPtr, newSize, newAlignment); #endif -} + } -void AllocatorBase::ProfileReallocation(void* ptr, void* newPtr, size_t newSize, size_t newAlignment) -{ - ProfileReallocationEnd(ptr, newPtr, newSize, newAlignment); -} + void AllocatorBase::ProfileReallocation(void* ptr, void* newPtr, size_t newSize, size_t newAlignment) + { + ProfileReallocationEnd(ptr, newPtr, newSize, newAlignment); + } -void AllocatorBase::ProfileResize(void* ptr, size_t newSize) -{ - if (newSize && m_isProfilingActive) + void AllocatorBase::ProfileResize(void* ptr, size_t newSize) { - auto records = GetRecords(); - if (records) + if (newSize && m_isProfilingActive) { - records->ResizeAllocation(ptr, newSize); + auto records = GetRecords(); + if (records) + { + records->ResizeAllocation(ptr, newSize); + } } - } -#if RECORDING_ENABLED - RecordAllocatorOperation(AllocatorOperation::ALLOCATE, ptr, newSize); +#if O3DE_RECORDING_ENABLED + RecordAllocatorOperation(AllocatorOperation::ALLOCATE, ptr, newSize); #endif -} + } -bool AllocatorBase::OnOutOfMemory(size_t byteSize, size_t alignment, int flags, const char* name, const char* fileName, int lineNum) -{ - if (AllocatorManager::IsReady() && AllocatorManager::Instance().m_outOfMemoryListener) + bool AllocatorBase::OnOutOfMemory(size_t byteSize, size_t alignment, int flags, const char* name, const char* fileName, int lineNum) { - AllocatorManager::Instance().m_outOfMemoryListener(this, byteSize, alignment, flags, name, fileName, lineNum); - return true; + if (AllocatorManager::IsReady() && AllocatorManager::Instance().m_outOfMemoryListener) + { + AllocatorManager::Instance().m_outOfMemoryListener(this, byteSize, alignment, flags, name, fileName, lineNum); + return true; + } + return false; } - return false; -} + +} // namespace AZ diff --git a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.h b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.h index 63e9027dd2..21ce34eb80 100644 --- a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.h +++ b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.h @@ -50,7 +50,7 @@ namespace AZ BestFitExternalMapSchema(const Descriptor& desc); - pointer_type Allocate(size_type byteSize, size_type alignment, int flags = 0, const char* name = 0, const char* fileName = 0, int lineNum = 0, unsigned int suppressStackRecord = 0) override; + pointer_type Allocate(size_type byteSize, size_type alignment, int flags = 0, const char* name = nullptr, const char* fileName = nullptr, int lineNum = 0, unsigned int suppressStackRecord = 0) override; void DeAllocate(pointer_type ptr, size_type byteSize = 0, size_type alignment = 0) override; size_type Resize(pointer_type ptr, size_type newSize) override; pointer_type ReAllocate(pointer_type ptr, size_type newSize, size_type newAlignment) override; diff --git a/Code/Framework/AzCore/AzCore/Memory/IAllocator.h b/Code/Framework/AzCore/AzCore/Memory/IAllocator.h index 319175f9ee..4612b27249 100644 --- a/Code/Framework/AzCore/AzCore/Memory/IAllocator.h +++ b/Code/Framework/AzCore/AzCore/Memory/IAllocator.h @@ -37,9 +37,9 @@ namespace AZ typedef size_t size_type; typedef ptrdiff_t difference_type; - virtual ~IAllocatorSchema() {} + virtual ~IAllocatorSchema() = default; - virtual pointer_type Allocate(size_type byteSize, size_type alignment, int flags = 0, const char* name = 0, const char* fileName = 0, int lineNum = 0, unsigned int suppressStackRecord = 0) = 0; + virtual pointer_type Allocate(size_type byteSize, size_type alignment, int flags = 0, const char* name = nullptr, const char* fileName = nullptr, int lineNum = 0, unsigned int suppressStackRecord = 0) = 0; virtual void DeAllocate(pointer_type ptr, size_type byteSize = 0, size_type alignment = 0) = 0; /// Resize an allocated memory block. Returns the new adjusted size (as close as possible or equal to the requested one) or 0 (if you don't support resize at all). virtual size_type Resize(pointer_type ptr, size_type newSize) = 0; diff --git a/Code/Framework/AzCore/AzCore/Memory/Memory.h b/Code/Framework/AzCore/AzCore/Memory/Memory.h index 2ecba6ebff..c87c9cd303 100644 --- a/Code/Framework/AzCore/AzCore/Memory/Memory.h +++ b/Code/Framework/AzCore/AzCore/Memory/Memory.h @@ -735,7 +735,7 @@ namespace AZ typedef typename Allocator::Descriptor Descriptor; // Maintained for backwards compatibility, prefer to use Get() instead. - // Get was previously used to get the the schema, however, that bypases what the allocators are doing. + // Get was previously used to get the the schema, however, that bypasses what the allocators are doing. // If the schema is needed, call Get().GetSchema() AZ_FORCE_INLINE static IAllocator& GetAllocator() { diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp index 7870749d24..0599038006 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -155,11 +155,9 @@ namespace Benchmark } private: - static size_t s_numAllocatedBytes; + inline static size_t s_numAllocatedBytes = 0; }; - size_t TestAllocatorWrapper::s_numAllocatedBytes = 0; - // Some allocator are not fully declared, those we simply setup from the schema class MallocSchemaAllocator : public AZ::SimpleSchemaAllocator { From 9b5dcf82b5972037daf9f114e79dee6618de88e7 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Thu, 16 Dec 2021 20:46:12 -0800 Subject: [PATCH 180/948] updates extend editor_entity_utils.py functionality Signed-off-by: Scott Murray --- .../editor_entity_utils.py | 200 +++++++++++++++--- 1 file changed, 172 insertions(+), 28 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py index 72530325e0..b9f7576f1c 100644 --- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py @@ -29,6 +29,11 @@ class EditorComponent: which also assigns self.id and self.type_id to the EditorComponent object. """ + def __init__(self, type_id): + self.type_id = type_id + self.id = None + self.property_tree = None + def get_component_name(self) -> str: """ Used to get name of component @@ -50,6 +55,9 @@ class EditorComponent: 7. prop_tree.get_container_item(path, key) :return: Property tree object of a component """ + if self.property_tree is not None: + return self.property_tree + build_prop_tree_outcome = editor.EditorComponentAPIBus( bus.Broadcast, "BuildComponentPropertyTreeEditor", self.id ) @@ -58,7 +66,114 @@ class EditorComponent: ), f"Failure: Could not build property tree of component: '{self.get_component_name()}'" prop_tree = build_prop_tree_outcome.GetValue() Report.info(prop_tree.build_paths_list()) - return prop_tree + self.property_tree = prop_tree + return self.property_tree + + def is_property_container(self, component_property_path: str) -> bool: + """ + + """ + if self.property_tree is None: + self.get_property_tree() + result = self.property_tree.is_container(component_property_path) + if not result: + Report.info(f"{self.get_component_name()}: '{component_property_path}' is not a container") + return result + + def get_container_count(self, component_property_path: str) -> int: + """ + Used to get the count of items in the container. + :param component_property_path: String of component property. (e.g. 'Settings|Visible') + :return: Count of items in the container as unsigned integer + """ + if self.is_property_container(component_property_path): + container_count_outcome = self.property_tree.get_container_count(component_property_path) + assert ( + container_count_outcome.IsSuccess() + ), f"Failure: get_container_count did not return success for '{component_property_path}'" + return container_count_outcome.GetValue() + + def reset_container(self, component_property_path: str) -> bool: + """ + Used to rest a container to empty + :param component_property_path: String of component property. (e.g. 'Settings|Visible') + :return: Boolean success + """ + if self.is_property_container(component_property_path): + reset_outcome = self.property_tree.reset_container(component_property_path) + return reset_outcome.IsSuccess() + else: + return False + + def append_container_item(self, component_property_path: str, value: any) -> bool: + """ + Used to append a container item without providing an index key. + :param component_property_path: String of component property. (e.g. 'Settings|Visible') + :param value: Value to be set + :return: Boolean success + """ + if self.is_property_container(component_property_path): + append_outcome = self.property_tree.append_container_item(component_property_path, value) + return append_outcome.IsSuccess() + else: + return False + + def add_container_item(self, component_property_path: str, key: any, value: any) -> bool: + """ + Used to add a container item at a specified key. In practice key should be an integer index. + :param component_property_path: String of component property. (e.g. 'Settings|Visible') + :param key: Zero index integer key, although this could be any unique unused key value + :param value: Value to be set + :return: Boolean success + """ + if self.is_property_container(component_property_path): + add_outcome = self.property_tree.add_container_item(component_property_path, key, value) + return add_outcome.IsSuccess() + else: + return False + + def get_container_item(self, component_property_path: str, key: any) -> any: + """ + Used to retrieve a container item value at the specified key. In practice key should be an integer index. + :param component_property_path: String of component property. (e.g. 'Settings|Visible') + :param key: Zero index integer key + :return: Value stored at the key specified + """ + if self.is_property_container(component_property_path): + get_outcome = self.property_tree.get_container_item(component_property_path, key) + assert ( + get_outcome.IsSuccess() + ), f"Failure: could not get a value for {self.get_component_name()}: '{component_property_path}' [{key}]" + return get_outcome.GetValue() + else: + return None + + def remove_container_item(self, component_property_path: str, key: any) -> bool: + """ + Used to remove a container item value at the specified key. In practice key should be an integer index. + :param component_property_path: String of component property. (e.g. 'Settings|Visible') + :param key: Zero index integer key + :return: Boolean success + """ + if self.is_property_container(component_property_path): + remove_outcome = self.property_tree.remove_container_item(component_property_path, key) + return remove_outcome.IsSuccess() + else: + return False + + def update_container_item(self, component_property_path: str, key: any, value: any): + """ + Used to update a container item at a specified key. In practice key should be an integer index. + :param component_property_path: String of component property. (e.g. 'Settings|Visible') + :param key: Zero index integer key + :param value: Value to be set + :return: Boolean success + """ + if self.is_property_container(component_property_path): + update_outcome = self.property_tree.update_container_item(component_property_path, key, value) + return update_outcome.IsSuccess() + else: + return False def get_component_property_value(self, component_property_path: str): """ @@ -101,16 +216,25 @@ class EditorComponent: """ editor.EditorComponentAPIBus(bus.Broadcast, "DisableComponents", [self.id]) + def enable_component(self): + """ + used to enable the componet using its id value + """ + editor.EditorComponentAPIBus(bus.Broadcast, "EnabledComponents", [self.id]) + @staticmethod - def get_type_ids(component_names: list) -> list: + def get_type_ids(component_names: list, entity_type: str ='Game') -> list: """ Used to get type ids of given components list :param: component_names: List of components to get type ids :return: List of type ids of given components. """ + if entity_type.lower() == 'level': + entity_type = azlmbr.entity.EntityType().Level + else: + entity_type = azlmbr.entity.EntityType().Game type_ids = editor.EditorComponentAPIBus( - bus.Broadcast, "FindComponentTypeIdsByEntityType", component_names, azlmbr.entity.EntityType().Game - ) + bus.Broadcast, "FindComponentTypeIdsByEntityType", component_names, entity_type) return type_ids @@ -278,8 +402,7 @@ class EditorEntity: components = [] type_ids = EditorComponent.get_type_ids(component_names) for type_id in type_ids: - new_comp = EditorComponent() - new_comp.type_id = type_id + new_comp = EditorComponent(type_id) add_component_outcome = editor.EditorComponentAPIBus( bus.Broadcast, "AddComponentsOfType", self.id, [type_id] ) @@ -291,6 +414,27 @@ class EditorEntity: self.components.append(new_comp) return components + def remove_component(self, component_name: str) -> None: + """ + Used to remove a component from Entity + :param component_name: String of component name to remove + :return: None + """ + self.remove_components([component_name]) + + def remove_components(self, component_names: list): + """ + Used to remove a list of components from Entity + :param component_names: List of component names to remove + :return: None + """ + type_ids = EditorComponent.get_type_ids(component_names) + for type_id in type_ids: + remove_outcome = editor.EditorComponentAPIBus(bus.Broadcast, "RemoveComponents", self.id, [type_id]) + assert ( + remove_outcome.IsSuccess() + ), f"Failure: could not remove component from '{self.get_name()}'" + def get_components_of_type(self, component_names: list) -> List[EditorComponent]: """ Used to get components of type component_name that already exists on Entity @@ -300,8 +444,7 @@ class EditorEntity: component_list = [] type_ids = EditorComponent.get_type_ids(component_names) for type_id in type_ids: - component = EditorComponent() - component.type_id = type_id + component = EditorComponent(type_id) get_component_of_type_outcome = editor.EditorComponentAPIBus( bus.Broadcast, "GetComponentOfType", self.id, type_id ) @@ -359,6 +502,21 @@ class EditorEntity: set_status = self.get_start_status() assert set_status == status_to_set, f"Failed to set start status of {desired_start_status} to {self.get_name}" + def is_locked(self) -> bool: + """ + Used to get the locked status of the entity + :return: Boolean True if locked False if not locked + """ + return editor.EditorEntityInfoRequestBus(bus.Event, "IsLocked", self.id) + + def set_lock_state(self, is_locked: bool) -> None: + """ + Sets the lock state on the object to locked or not locked. + :param is_locked: True for locking, False to unlock. + :return: None + """ + editor.EditorEntityAPIBus(bus.Event, "SetLockState", self.id, is_locked) + def delete(self) -> None: """ Used to delete the Entity. @@ -488,18 +646,6 @@ class EditorLevelEntity: EditorLevelComponentAPIBus requests. """ - @staticmethod - def get_type_ids(component_names: list) -> list: - """ - Used to get type ids of given components list for EntityType Level - :param: component_names: List of components to get type ids - :return: List of type ids of given components. - """ - type_ids = editor.EditorComponentAPIBus( - bus.Broadcast, "FindComponentTypeIdsByEntityType", component_names, azlmbr.entity.EntityType().Level - ) - return type_ids - @staticmethod def add_component(component_name: str) -> EditorComponent: """ @@ -518,10 +664,9 @@ class EditorLevelEntity: :return: List of newly added components to the level """ components = [] - type_ids = EditorLevelEntity.get_type_ids(component_names) + type_ids = EditorComponent.get_type_ids(component_names, 'level') for type_id in type_ids: - new_comp = EditorComponent() - new_comp.type_id = type_id + new_comp = EditorComponent(type_id) add_component_outcome = editor.EditorLevelComponentAPIBus( bus.Broadcast, "AddComponentsOfType", [type_id] ) @@ -540,10 +685,9 @@ class EditorLevelEntity: :return: List of Level Component objects of given component name """ component_list = [] - type_ids = EditorLevelEntity.get_type_ids(component_names) + type_ids = EditorComponent.get_type_ids(component_names, 'level') for type_id in type_ids: - component = EditorComponent() - component.type_id = type_id + component = EditorComponent(type_id) get_component_of_type_outcome = editor.EditorLevelComponentAPIBus( bus.Broadcast, "GetComponentOfType", type_id ) @@ -562,7 +706,7 @@ class EditorLevelEntity: :param component_name: Name of component to check for :return: True, if level has specified component. Else, False """ - type_ids = EditorLevelEntity.get_type_ids([component_name]) + type_ids = EditorComponent.get_type_ids([component_name], 'level') return editor.EditorLevelComponentAPIBus(bus.Broadcast, "HasComponentOfType", type_ids[0]) @staticmethod @@ -572,5 +716,5 @@ class EditorLevelEntity: :param component_name: Name of component to check for :return: integer count of occurences of level component attached to level or zero if none are present """ - type_ids = EditorLevelEntity.get_type_ids([component_name]) + type_ids = EditorComponent.get_type_ids([component_name], 'level') return editor.EditorLevelComponentAPIBus(bus.Broadcast, "CountComponentsOfType", type_ids[0]) From 291e172f9e13285f4e5c6a90eea7740a804ab88a Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Thu, 16 Dec 2021 21:01:39 -0800 Subject: [PATCH 181/948] fixing some docstrings Signed-off-by: Scott Murray --- .../editor_python_test_tools/editor_entity_utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py index b9f7576f1c..58d9e30f81 100644 --- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py @@ -71,7 +71,9 @@ class EditorComponent: def is_property_container(self, component_property_path: str) -> bool: """ - + Used to determine if a component property is a container. Containers are similar to a dictionary with int keys. + :param component_property_path: String of component property. (e.g. 'Settings|Visible') + :return: Boolean True if the property is a container False if it is not. """ if self.property_tree is None: self.get_property_tree() @@ -255,7 +257,7 @@ class EditorEntity: """ Entity class is used to create and interact with Editor Entities. Example: To create Editor Entity, Use the code: - test_entity = Entity.create_editor_entity("TestEntity") + test_entity = EditorEntity.create_editor_entity("TestEntity") # This creates a python object with 'test_entity' linked to entity name "TestEntity" in Editor. # To add component, use: test_entity.add_component() From bf8422152ba9ca3fc951bfb3ef10ed1b00aa5274 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Fri, 17 Dec 2021 00:12:21 -0800 Subject: [PATCH 182/948] Turn off stdout buffering when connecting to editor-server so that the editor properly gets all the server-logging without having to first fill up a buffer. Allows the logs to pipe instantly for easier debugging, and also fixes a problem where the logs wont reach the editor because the buffer doesn't fill Signed-off-by: Gene Walters --- .../AutoComponent_RPC.scriptcanvas | 2339 ++++++++++++++++- .../Editor/MultiplayerEditorConnection.cpp | 5 +- 2 files changed, 2325 insertions(+), 19 deletions(-) diff --git a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.scriptcanvas b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.scriptcanvas index 72cc980550..c1c77b14fe 100644 --- a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.scriptcanvas +++ b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC.scriptcanvas @@ -5,7 +5,7 @@ "ClassData": { "m_scriptCanvas": { "Id": { - "id": 8702689999760 + "id": 2816238339133127497 }, "Name": "AutoComponent_RPC", "Components": { @@ -582,6 +582,1158 @@ { "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, { "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" } @@ -968,6 +2120,1158 @@ { "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, + { + "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" + }, { "m_id": "{82D3E2FD-ADFA-47F7-A889-D1172BF2EC49}" } @@ -2311,23 +4615,6 @@ }, "m_variableCounter": 1, "GraphCanvasData": [ - { - "Key": { - "id": 8702689999760 - }, - "Value": { - "ComponentData": { - "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { - "$type": "SceneComponentSaveData", - "ViewParams": { - "Scale": 0.9240486637125038, - "AnchorX": 1429.578369140625, - "AnchorY": -71.42481231689453 - } - } - } - } - }, { "Key": { "id": 8706984967056 @@ -2663,6 +4950,22 @@ } } } + }, + { + "Key": { + "id": 2816238339133127497 + }, + "Value": { + "ComponentData": { + "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { + "$type": "SceneComponentSaveData", + "ViewParams": { + "AnchorX": 260.0, + "AnchorY": 479.0 + } + } + } + } } ], "StatisticsHelper": { diff --git a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp index 11615137ca..f7882d7bf9 100644 --- a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp +++ b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp @@ -41,7 +41,10 @@ namespace Multiplayer // Automated testing listens for these logs if (editorsv_isDedicated) { - // Server logs piped to the editor. Change the buffering policy to ensure every write to stdout is flushed. + // Server logs will be piped to the editor so turn off buffering, + // otherwise it'll take a lot of logs to fill up the buffer before stdout is finally flushed. + // This isn't optimal, but will only affect + // Note: _IOLBF (flush on newlines) won't work for Automated Testing which uses a headless server app and will fall back to _IOFBF (full buffering) setvbuf(stdout, NULL, _IONBF, 0); // If the settings registry is not available at this point, From d20aa935ba9015299f5b606f81460c4d7aa278c5 Mon Sep 17 00:00:00 2001 From: Benjamin Jillich <43751992+amzn-jillich@users.noreply.github.com> Date: Fri, 17 Dec 2021 09:43:35 +0100 Subject: [PATCH 183/948] Quaternion to scaled-axis angle representation (and back) helpers (#6421) Direct conversion helpers for quaternion to the scaled axis-angle representation and back without the need to convert them first to the axis-angle format and manually scale (or normalize on the way back). This also avoids having to deal with the special case of an identity representation which is 0,0,0 in the scaled axis-angle format while our convention for axis-angle is 0,1,0 for the axis and 0 for the angle. Added unit tests that check the conversion round-trips from quaternion -> (scaled) axis-angle -> quaternion as well as comparing the scaled axis-angle representations from the direct helper functions as well as the axis-angle while manually scaling/normalizing. Signed-off-by: Benjamin Jillich --- .../AzCore/AzCore/Math/Quaternion.cpp | 22 +++- .../Framework/AzCore/AzCore/Math/Quaternion.h | 6 ++ .../AzCore/AzCore/Math/Quaternion.inl | 18 ++++ .../AzCore/Tests/Math/QuaternionTests.cpp | 102 ++++++++++++++++++ 4 files changed, 147 insertions(+), 1 deletion(-) diff --git a/Code/Framework/AzCore/AzCore/Math/Quaternion.cpp b/Code/Framework/AzCore/AzCore/Math/Quaternion.cpp index e06cd184ad..fac70bd05a 100644 --- a/Code/Framework/AzCore/AzCore/Math/Quaternion.cpp +++ b/Code/Framework/AzCore/AzCore/Math/Quaternion.cpp @@ -254,13 +254,13 @@ namespace AZ Method("CreateFromMatrix3x3", &Quaternion::CreateFromMatrix3x3)-> Method("CreateFromMatrix4x4", &Quaternion::CreateFromMatrix4x4)-> Method("CreateFromAxisAngle", &Quaternion::CreateFromAxisAngle)-> + Method("CreateFromScaledAxisAngle", &Quaternion::CreateFromScaledAxisAngle)-> Method("CreateShortestArc", &Quaternion::CreateShortestArc)-> Method("CreateFromEulerAnglesDegrees", &Quaternion::CreateFromEulerAnglesDegrees) ; } } - Quaternion Quaternion::CreateFromMatrix3x3(const Matrix3x3& m) { return CreateFromBasis(m.GetBasisX(), m.GetBasisY(), m.GetBasisZ()); @@ -430,4 +430,24 @@ namespace AZ outAngle = 0.0f; } } + + + Vector3 Quaternion::ConvertToScaledAxisAngle() const + { + // Take the log of the quaternion to convert it to the exponential map + // and multiply it by 2.0 to bring it into the scaled axis-angle representation. + const AZ::Vector3 imaginary = GetImaginary(); + const float length = imaginary.GetLength(); + if (length < AZ::Constants::FloatEpsilon) + { + return imaginary * 2.0f; + } + else + { + const float halfAngle = acosf(AZ::GetClamp(GetW(), -1.0f, 1.0f)); + + // Multiply by 2.0 to convert the half angle into the full one. + return halfAngle * 2.0f * (imaginary / length); + } + } } diff --git a/Code/Framework/AzCore/AzCore/Math/Quaternion.h b/Code/Framework/AzCore/AzCore/Math/Quaternion.h index f2c266ed3e..83e8012a62 100644 --- a/Code/Framework/AzCore/AzCore/Math/Quaternion.h +++ b/Code/Framework/AzCore/AzCore/Math/Quaternion.h @@ -77,6 +77,9 @@ namespace AZ static Quaternion CreateFromAxisAngle(const Vector3& axis, float angle); + //! Create a quaternion from a scaled axis-angle representation. + static Quaternion CreateFromScaledAxisAngle(const Vector3& scaledAxisAngle); + static Quaternion CreateShortestArc(const Vector3& v1, const Vector3& v2); //! Creates a quaternion using rotation in degrees about the axes. First rotated about the X axis, followed by the Y axis, then the Z axis. @@ -231,6 +234,9 @@ namespace AZ //! @param[out] outAngle A float rotation angle around the axis in radians. void ConvertToAxisAngle(Vector3& outAxis, float& outAngle) const; + //! Convert the quaternion into scaled axis-angle representation. + Vector3 ConvertToScaledAxisAngle() const; + //! Returns the imaginary (X/Y/Z) portion of the quaternion. Vector3 GetImaginary() const; diff --git a/Code/Framework/AzCore/AzCore/Math/Quaternion.inl b/Code/Framework/AzCore/AzCore/Math/Quaternion.inl index 82cd9078fa..37319ae146 100644 --- a/Code/Framework/AzCore/AzCore/Math/Quaternion.inl +++ b/Code/Framework/AzCore/AzCore/Math/Quaternion.inl @@ -109,6 +109,24 @@ namespace AZ } + AZ_MATH_INLINE Quaternion Quaternion::CreateFromScaledAxisAngle(const Vector3& scaledAxisAngle) + { + const AZ::Vector3 exponentialMap = scaledAxisAngle / 2.0f; + const float halfAngle = exponentialMap.GetLength(); + + if (halfAngle < AZ::Constants::FloatEpsilon) + { + return AZ::Quaternion::CreateFromVector3AndValue(exponentialMap, 1.0f).GetNormalized(); + } + else + { + float sin, cos; + SinCos(halfAngle, sin, cos); + return AZ::Quaternion::CreateFromVector3AndValue((sin / halfAngle) * exponentialMap, cos); + } + } + + AZ_MATH_INLINE void Quaternion::StoreToFloat4(float* values) const { Simd::Vec4::StoreUnaligned(values, m_value); diff --git a/Code/Framework/AzCore/Tests/Math/QuaternionTests.cpp b/Code/Framework/AzCore/Tests/Math/QuaternionTests.cpp index cbff646990..9ef38d7115 100644 --- a/Code/Framework/AzCore/Tests/Math/QuaternionTests.cpp +++ b/Code/Framework/AzCore/Tests/Math/QuaternionTests.cpp @@ -408,4 +408,106 @@ namespace UnitTest Matrix4x4 m = Matrix4x4::CreateFromQuaternion(rotQuat); AZ_TEST_ASSERT(m.IsClose(rotMatrix)); } + + class QuaternionScaledAxisAngleConversionFixture + : public ::testing::TestWithParam + { + public: + AZ::Quaternion GetAbs(const AZ::Quaternion& in) + { + // Take the shortest path for quaternions containing rotations bigger than 180.0°. + if (in.GetW() < 0.0f) + { + return -in; + } + + return in; + } + }; + + static const AZ::Quaternion RotationRepresentationConversionTestQuats[] = + { + AZ::Quaternion::CreateIdentity(), + -AZ::Quaternion::CreateIdentity(), + AZ::Quaternion::CreateRotationX(AZ::Constants::TwoPi), + AZ::Quaternion::CreateRotationY(AZ::Constants::Pi), + AZ::Quaternion::CreateRotationZ(AZ::Constants::HalfPi), + AZ::Quaternion::CreateRotationX(AZ::Constants::QuarterPi), + AZ::Quaternion(0.64f, 0.36f, 0.48f, 0.48f), + AZ::Quaternion(0.70f, -0.34f, 0.10f, 0.62f), + AZ::Quaternion(-0.38f, 0.34f, 0.70f, -0.50f), + AZ::Quaternion(0.70f, -0.34f, -0.38f, 0.50f), + AZ::Quaternion(0.00f, 0.00f, -0.28f, 0.96f), + AZ::Quaternion(0.24f, -0.64f, 0.72f, 0.12f), + AZ::Quaternion(-0.66f, 0.62f, 0.42f, 0.06f) + }; + + TEST_P(QuaternionScaledAxisAngleConversionFixture, ScaledAxisAngleQuatRoundtripTests) + { + const AZ::Quaternion testQuat = GetAbs(GetParam()); + + // Convert test quaternion to scaled axis-angle representation. + const AZ::Vector3 scaledAxisAngle = testQuat.ConvertToScaledAxisAngle(); + + // Convert the scaled axis-angle back into a quaternion. + AZ::Quaternion backFromScaledAxisAngle = AZ::Quaternion::CreateFromScaledAxisAngle(scaledAxisAngle); + + // Compare the original quaternion with the one after the conversion. + EXPECT_TRUE(testQuat.IsClose(backFromScaledAxisAngle, 1e-6f)); + } + + TEST_P(QuaternionScaledAxisAngleConversionFixture, AxisAngleQuatRoundtripTests) + { + const AZ::Quaternion testQuat = GetAbs(GetParam()); + + // Convert test quaternion to axis-angle representation. + AZ::Vector3 axis; + float angle; + testQuat.ConvertToAxisAngle(axis, angle); + + // Convert the axis-angle back into a quaternion and compare the original quaternion with the one after the conversion. + const AZ::Quaternion backFromAxisAngle = AZ::Quaternion::CreateFromAxisAngle(axis, angle); + EXPECT_TRUE(testQuat.IsClose(backFromAxisAngle, 1e-6f)); + } + + TEST_P(QuaternionScaledAxisAngleConversionFixture, CompareAxisAngleConversionTests) + { + const AZ::Quaternion testQuat = GetAbs(GetParam()); + + // Convert test quaternion to scaled axis-angle representation. + const AZ::Vector3 scaledAxisAngle = testQuat.ConvertToScaledAxisAngle(); + + // Convert test quaternion to axis-angle representation and scale it manually. + AZ::Vector3 axis; + float angle; + testQuat.ConvertToAxisAngle(axis, angle); + + // Compare the scaled result to the version from the helper that directly converts it to scaled axis-angle. + AZ::Vector3 scaledResult = axis*angle; + EXPECT_TRUE(scaledResult.IsClose(scaledAxisAngle, 1e-5f)); + } + + TEST_P(QuaternionScaledAxisAngleConversionFixture, CompareScaledAxisAngleConversionTests) + { + const AZ::Quaternion testQuat = GetAbs(GetParam()); + + // Convert test quaternion to axis-angle representation and scale it manually. + AZ::Vector3 axis; + float angle; + testQuat.ConvertToAxisAngle(axis, angle); + AZ::Vector3 scaledResult = axis*angle; + + // Special case handling for identity rotation. + AZ::Vector3 axisFromScaledResult = scaledResult.GetNormalized(); + float angleFromScaledResult = scaledResult.GetLength(); + if (AZ::IsClose(angleFromScaledResult, 0.0f)) + { + axisFromScaledResult = AZ::Vector3::CreateAxisY(); + } + + const AZ::Quaternion backFromAxisAngle = AZ::Quaternion::CreateFromAxisAngle(axisFromScaledResult, angleFromScaledResult); + EXPECT_TRUE(testQuat.IsClose(backFromAxisAngle, 1e-6f)); + } + + INSTANTIATE_TEST_CASE_P(MATH_Quaternion, QuaternionScaledAxisAngleConversionFixture, ::testing::ValuesIn(RotationRepresentationConversionTestQuats)); } From 2ddf55474e8f8c20fe79f396d5bbf06acf422e37 Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Fri, 17 Dec 2021 05:26:31 -0800 Subject: [PATCH 184/948] chore: remove "using namespace " from AZCore Memory (#6373) * chore: remove "using namespace " from AZCore Memory REF: https://github.com/o3de/o3de/issues/6281 Signed-off-by: Michael Pollind * chore: fix formatting Signed-off-by: Michael Pollind * chore: fix indentation for AllocatorBase.cpp Signed-off-by: Michael Pollind * chore: fix formatting Signed-off-by: Michael Pollind * chore: address minor checkstyle problems Signed-off-by: Michael Pollind --- .../AzCore/Memory/AllocationRecords.cpp | 813 +++---- .../AzCore/AzCore/Memory/AllocatorBase.cpp | 279 +-- .../Memory/BestFitExternalMapAllocator.cpp | 330 ++- .../Memory/BestFitExternalMapAllocator.h | 7 +- .../Memory/BestFitExternalMapSchema.cpp | 311 +-- .../AzCore/Memory/BestFitExternalMapSchema.h | 8 +- .../AzCore/AzCore/Memory/PoolSchema.cpp | 2038 +++++++++-------- .../AzCore/AzCore/Memory/PoolSchema.h | 8 +- .../AzCore/AzCore/Memory/SystemAllocator.cpp | 438 ++-- .../AzCore/AzCore/Memory/SystemAllocator.h | 5 +- 10 files changed, 2123 insertions(+), 2114 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Memory/AllocationRecords.cpp b/Code/Framework/AzCore/AzCore/Memory/AllocationRecords.cpp index 680d93501a..2b2f752b06 100644 --- a/Code/Framework/AzCore/AzCore/Memory/AllocationRecords.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/AllocationRecords.cpp @@ -16,438 +16,421 @@ #include -using namespace AZ; -using namespace AZ::Debug; - -// Many PC tools break with alloc/free size mismatches when the memory guard is enabled. Disable for now -//#define ENABLE_MEMORY_GUARD - -//========================================================================= -// AllocationRecords -// [9/16/2009] -//========================================================================= -AllocationRecords::AllocationRecords(unsigned char stackRecordLevels, [[maybe_unused]] bool isMemoryGuard, bool isMarkUnallocatedMemory, const char* allocatorName) - : m_mode(AllocatorManager::Instance().m_defaultTrackingRecordMode) - , m_isAutoIntegrityCheck(false) - , m_isMarkUnallocatedMemory(isMarkUnallocatedMemory) - , m_saveNames(false) - , m_decodeImmediately(false) - , m_numStackLevels(stackRecordLevels) +namespace AZ::Debug +{ + // Many PC tools break with alloc/free size mismatches when the memory guard is enabled. Disable for now + //#define ENABLE_MEMORY_GUARD + + //========================================================================= + // AllocationRecords + // [9/16/2009] + //========================================================================= + AllocationRecords::AllocationRecords( + unsigned char stackRecordLevels, [[maybe_unused]] bool isMemoryGuard, bool isMarkUnallocatedMemory, const char* allocatorName) + : m_mode(AllocatorManager::Instance().m_defaultTrackingRecordMode) + , m_isAutoIntegrityCheck(false) + , m_isMarkUnallocatedMemory(isMarkUnallocatedMemory) + , m_saveNames(false) + , m_decodeImmediately(false) + , m_numStackLevels(stackRecordLevels) #if defined(ENABLE_MEMORY_GUARD) - , m_memoryGuardSize(isMemoryGuard ? sizeof(Debug::GuardValue) : 0) + , m_memoryGuardSize(isMemoryGuard ? sizeof(Debug::GuardValue) : 0) #else - , m_memoryGuardSize(0) + , m_memoryGuardSize(0) #endif - , m_requestedAllocs(0) - , m_requestedBytes(0) - , m_requestedBytesPeak(0) - , m_allocatorName(allocatorName) -{ - -} - -//========================================================================= -// ~AllocationRecords -// [9/16/2009] -//========================================================================= -AllocationRecords::~AllocationRecords() -{ - if (!AllocatorManager::Instance().m_isAllocatorLeaking) - { - // dump all allocation (we should not have any at this point). - bool includeNameAndFilename = (m_saveNames || m_mode == RECORD_FULL); - EnumerateAllocations(PrintAllocationsCB(true, includeNameAndFilename)); - AZ_Error("Memory", m_records.empty(), "We still have %d allocations on record! They must be freed prior to destroy!", m_records.size()); - } -} - -//========================================================================= -// lock -// [9/16/2009] -//========================================================================= -void -AllocationRecords::lock() -{ - m_recordsMutex.lock(); -} - -//========================================================================= -// try_lock -// [9/16/2009] -//========================================================================= -bool AllocationRecords::try_lock() -{ - return m_recordsMutex.try_lock(); -} - -//========================================================================= -// unlock -// [9/16/2009] -//========================================================================= -void -AllocationRecords::unlock() -{ - m_recordsMutex.unlock(); -} - -//========================================================================= -// RegisterAllocation -// [9/11/2009] -//========================================================================= -const AllocationInfo* -AllocationRecords::RegisterAllocation(void* address, size_t byteSize, size_t alignment, const char* name, const char* fileName, int lineNum, unsigned int stackSuppressCount) -{ - (void)stackSuppressCount; - if (m_mode == RECORD_NO_RECORDS) + , m_requestedAllocs(0) + , m_requestedBytes(0) + , m_requestedBytesPeak(0) + , m_allocatorName(allocatorName) { - return nullptr; - } - if (address == nullptr) - { - return nullptr; } - // memory guard - if (m_memoryGuardSize == sizeof(Debug::GuardValue)) + //========================================================================= + // ~AllocationRecords + // [9/16/2009] + //========================================================================= + AllocationRecords::~AllocationRecords() { - if (m_isAutoIntegrityCheck) + if (!AllocatorManager::Instance().m_isAllocatorLeaking) { - IntegrityCheck(); + // dump all allocation (we should not have any at this point). + bool includeNameAndFilename = (m_saveNames || m_mode == RECORD_FULL); + EnumerateAllocations(PrintAllocationsCB(true, includeNameAndFilename)); + AZ_Error( + "Memory", m_records.empty(), "We still have %d allocations on record! They must be freed prior to destroy!", + m_records.size()); } - - AZ_Assert(byteSize>sizeof(Debug::GuardValue), "Did you forget to add the extra MemoryGuardSize() bytes?"); - byteSize -= sizeof(Debug::GuardValue); - new(reinterpret_cast(address)+byteSize) Debug::GuardValue(); } - Debug::AllocationRecordsType::pair_iter_bool iterBool; + //========================================================================= + // lock + // [9/16/2009] + //========================================================================= + void AllocationRecords::lock() { - AZStd::scoped_lock lock(m_recordsMutex); - iterBool = m_records.insert_key(address); - } - - if (!iterBool.second) - { - // If that memory address was already registered, print the stack trace of the previous registration - PrintAllocationsCB(true, (m_saveNames || m_mode == RECORD_FULL))(address, iterBool.first->second, m_numStackLevels); - AZ_Assert(iterBool.second, "Memory address 0x%p is already allocated and in the records!", address); + m_recordsMutex.lock(); } - Debug::AllocationInfo& ai = iterBool.first->second; - ai.m_byteSize = byteSize; - ai.m_alignment = static_cast(alignment); - if ((m_saveNames || m_mode == RECORD_FULL) && name && fileName) + //========================================================================= + // try_lock + // [9/16/2009] + //========================================================================= + bool AllocationRecords::try_lock() { - // In RECORD_FULL mode or when specifically enabled in app descriptor with - // m_allocationRecordsSaveNames, we allocate our own memory to save off name and fileName. - // When testing for memory leaks, on process shutdown AllocationRecords::~AllocationRecords - // gets called to enumerate the remaining (leaked) allocations. Unfortunately, any names - // referenced in dynamic module memory whose modules are unloaded won't be valid - // references anymore and we won't get useful information from the enumeration print. - // This code block ensures we keep our name/fileName valid for when we need it. - const size_t nameLength = strlen(name); - const size_t fileNameLength = strlen(fileName); - const size_t totalLength = nameLength + fileNameLength + 2; // + 2 for terminating null characters - ai.m_namesBlock = m_records.get_allocator().allocate(totalLength, 1); - ai.m_namesBlockSize = totalLength; - char* savedName = reinterpret_cast(ai.m_namesBlock); - char* savedFileName = savedName + nameLength + 1; - memcpy(reinterpret_cast(savedName), reinterpret_cast(name), nameLength + 1); - memcpy(reinterpret_cast(savedFileName), reinterpret_cast(fileName), fileNameLength + 1); - ai.m_name = savedName; - ai.m_fileName = savedFileName; + return m_recordsMutex.try_lock(); } - else + + //========================================================================= + // unlock + // [9/16/2009] + //========================================================================= + void AllocationRecords::unlock() { - ai.m_name = name; - ai.m_fileName = fileName; - ai.m_namesBlock = nullptr; - ai.m_namesBlockSize = 0; + m_recordsMutex.unlock(); } - ai.m_lineNum = lineNum; - ai.m_timeStamp = AZStd::GetTimeNowMicroSecond(); - // if we don't have a fileName,lineNum record the stack or if the user requested it. - if ((fileName == nullptr && m_mode == RECORD_STACK_IF_NO_FILE_LINE) || m_mode == RECORD_FULL) + //========================================================================= + // RegisterAllocation + // [9/11/2009] + //========================================================================= + const AllocationInfo* AllocationRecords::RegisterAllocation( + void* address, + size_t byteSize, + size_t alignment, + const char* name, + const char* fileName, + int lineNum, + unsigned int stackSuppressCount) { - ai.m_stackFrames = m_numStackLevels ? reinterpret_cast(m_records.get_allocator().allocate(sizeof(AZ::Debug::StackFrame)*m_numStackLevels, 1)) : nullptr; - if (ai.m_stackFrames) + (void)stackSuppressCount; + if (m_mode == RECORD_NO_RECORDS) + { + return nullptr; + } + if (address == nullptr) + { + return nullptr; + } + + // memory guard + if (m_memoryGuardSize == sizeof(Debug::GuardValue)) + { + if (m_isAutoIntegrityCheck) + { + IntegrityCheck(); + } + + AZ_Assert(byteSize > sizeof(Debug::GuardValue), "Did you forget to add the extra MemoryGuardSize() bytes?"); + byteSize -= sizeof(Debug::GuardValue); + new (reinterpret_cast(address) + byteSize) Debug::GuardValue(); + } + + Debug::AllocationRecordsType::pair_iter_bool iterBool; + { + AZStd::scoped_lock lock(m_recordsMutex); + iterBool = m_records.insert_key(address); + } + + if (!iterBool.second) + { + // If that memory address was already registered, print the stack trace of the previous registration + PrintAllocationsCB(true, (m_saveNames || m_mode == RECORD_FULL))(address, iterBool.first->second, m_numStackLevels); + AZ_Assert(iterBool.second, "Memory address 0x%p is already allocated and in the records!", address); + } + + Debug::AllocationInfo& ai = iterBool.first->second; + ai.m_byteSize = byteSize; + ai.m_alignment = static_cast(alignment); + if ((m_saveNames || m_mode == RECORD_FULL) && name && fileName) + { + // In RECORD_FULL mode or when specifically enabled in app descriptor with + // m_allocationRecordsSaveNames, we allocate our own memory to save off name and fileName. + // When testing for memory leaks, on process shutdown AllocationRecords::~AllocationRecords + // gets called to enumerate the remaining (leaked) allocations. Unfortunately, any names + // referenced in dynamic module memory whose modules are unloaded won't be valid + // references anymore and we won't get useful information from the enumeration print. + // This code block ensures we keep our name/fileName valid for when we need it. + const size_t nameLength = strlen(name); + const size_t fileNameLength = strlen(fileName); + const size_t totalLength = nameLength + fileNameLength + 2; // + 2 for terminating null characters + ai.m_namesBlock = m_records.get_allocator().allocate(totalLength, 1); + ai.m_namesBlockSize = totalLength; + char* savedName = reinterpret_cast(ai.m_namesBlock); + char* savedFileName = savedName + nameLength + 1; + memcpy(reinterpret_cast(savedName), reinterpret_cast(name), nameLength + 1); + memcpy(reinterpret_cast(savedFileName), reinterpret_cast(fileName), fileNameLength + 1); + ai.m_name = savedName; + ai.m_fileName = savedFileName; + } + else { - Debug::StackRecorder::Record(ai.m_stackFrames, m_numStackLevels, stackSuppressCount + 1); + ai.m_name = name; + ai.m_fileName = fileName; + ai.m_namesBlock = nullptr; + ai.m_namesBlockSize = 0; + } + ai.m_lineNum = lineNum; + ai.m_timeStamp = AZStd::GetTimeNowMicroSecond(); - if (m_decodeImmediately) + // if we don't have a fileName,lineNum record the stack or if the user requested it. + if ((fileName == nullptr && m_mode == RECORD_STACK_IF_NO_FILE_LINE) || m_mode == RECORD_FULL) + { + ai.m_stackFrames = m_numStackLevels ? reinterpret_cast(m_records.get_allocator().allocate( + sizeof(AZ::Debug::StackFrame) * m_numStackLevels, 1)) + : nullptr; + if (ai.m_stackFrames) { - // OPTIONAL DEBUGGING CODE - enable in app descriptor m_allocationRecordsAttemptDecodeImmediately - // This is optionally-enabled code for tracking down memory allocations - // that fail to be decoded. DecodeFrames() typically runs at the end of - // your application when leaks were found. Sometimes you have stack prints - // full of "(module-name not available)" and "(function-name not available)" - // that are not actionable. If you have those, enable this code. It'll slow - // down your process significantly because for every allocation recorded - // we get the stack trace on the spot. Put a breakpoint in DecodeFrames() - // at the "(module-name not available)" and "(function-name not available)" - // locations and now at the moment those allocations happen you'll have the - // full stack trace available and the ability to debug what could be causing it + Debug::StackRecorder::Record(ai.m_stackFrames, m_numStackLevels, stackSuppressCount + 1); + + if (m_decodeImmediately) { - const unsigned char decodeStep = 40; - Debug::SymbolStorage::StackLine lines[decodeStep]; - unsigned char iFrame = 0; - unsigned char numStackLevels = m_numStackLevels; - while (numStackLevels > 0) + // OPTIONAL DEBUGGING CODE - enable in app descriptor m_allocationRecordsAttemptDecodeImmediately + // This is optionally-enabled code for tracking down memory allocations + // that fail to be decoded. DecodeFrames() typically runs at the end of + // your application when leaks were found. Sometimes you have stack prints + // full of "(module-name not available)" and "(function-name not available)" + // that are not actionable. If you have those, enable this code. It'll slow + // down your process significantly because for every allocation recorded + // we get the stack trace on the spot. Put a breakpoint in DecodeFrames() + // at the "(module-name not available)" and "(function-name not available)" + // locations and now at the moment those allocations happen you'll have the + // full stack trace available and the ability to debug what could be causing it { - unsigned char numToDecode = AZStd::GetMin(decodeStep, numStackLevels); - Debug::SymbolStorage::DecodeFrames(&ai.m_stackFrames[iFrame], numToDecode, lines); - numStackLevels -= numToDecode; - iFrame += numToDecode; + const unsigned char decodeStep = 40; + Debug::SymbolStorage::StackLine lines[decodeStep]; + unsigned char iFrame = 0; + unsigned char numStackLevels = m_numStackLevels; + while (numStackLevels > 0) + { + unsigned char numToDecode = AZStd::GetMin(decodeStep, numStackLevels); + Debug::SymbolStorage::DecodeFrames(&ai.m_stackFrames[iFrame], numToDecode, lines); + numStackLevels -= numToDecode; + iFrame += numToDecode; + } } } } } - } - - AllocatorManager::Instance().DebugBreak(address, ai); - // statistics - m_requestedBytes += byteSize; + AllocatorManager::Instance().DebugBreak(address, ai); - size_t currentRequestedBytePeak; - size_t newRequestedBytePeak; - do - { - currentRequestedBytePeak = m_requestedBytesPeak.load(std::memory_order::memory_order_relaxed); - newRequestedBytePeak = AZStd::GetMax(currentRequestedBytePeak, m_requestedBytes.load(std::memory_order::memory_order_relaxed)); - } while (!m_requestedBytesPeak.compare_exchange_weak(currentRequestedBytePeak, newRequestedBytePeak)); + // statistics + m_requestedBytes += byteSize; - ++m_requestedAllocs; + size_t currentRequestedBytePeak; + size_t newRequestedBytePeak; + do + { + currentRequestedBytePeak = m_requestedBytesPeak.load(std::memory_order::memory_order_relaxed); + newRequestedBytePeak = AZStd::GetMax(currentRequestedBytePeak, m_requestedBytes.load(std::memory_order::memory_order_relaxed)); + } while (!m_requestedBytesPeak.compare_exchange_weak(currentRequestedBytePeak, newRequestedBytePeak)); - return &ai; -} + ++m_requestedAllocs; -//========================================================================= -// UnregisterAllocation -// [9/11/2009] -//========================================================================= -void AllocationRecords::UnregisterAllocation(void* address, size_t byteSize, size_t alignment, AllocationInfo* info) -{ - if (m_mode == RECORD_NO_RECORDS) - { - return; - } - if (address == nullptr) - { - return; + return &ai; } - AllocationInfo allocationInfo; + //========================================================================= + // UnregisterAllocation + // [9/11/2009] + //========================================================================= + void AllocationRecords::UnregisterAllocation(void* address, size_t byteSize, size_t alignment, AllocationInfo* info) { - AZStd::scoped_lock lock(m_recordsMutex); - Debug::AllocationRecordsType::iterator iter = m_records.find(address); - // We cannot assert if an allocation does not exist because allocations may have been made before tracking was enabled. - // It is currently impossible to actually track all allocations that happen before a certain point - // AZ_Assert(iter!=m_records.end(), "Could not find address 0x%p in the allocator!", address); - if (iter == m_records.end()) + if (m_mode == RECORD_NO_RECORDS) + { + return; + } + if (address == nullptr) { return; } - allocationInfo = iter->second; - m_records.erase(iter); - // try to be more aggressive and keep the memory footprint low. - // \todo store the load factor at the last rehash to avoid unnecessary rehash - if (m_records.load_factor() < 0.9f) + AllocationInfo allocationInfo; { - m_records.rehash(0); + AZStd::scoped_lock lock(m_recordsMutex); + Debug::AllocationRecordsType::iterator iter = m_records.find(address); + // We cannot assert if an allocation does not exist because allocations may have been made before tracking was enabled. + // It is currently impossible to actually track all allocations that happen before a certain point + // AZ_Assert(iter!=m_records.end(), "Could not find address 0x%p in the allocator!", address); + if (iter == m_records.end()) + { + return; + } + allocationInfo = iter->second; + m_records.erase(iter); + + // try to be more aggressive and keep the memory footprint low. + // \todo store the load factor at the last rehash to avoid unnecessary rehash + if (m_records.load_factor() < 0.9f) + { + m_records.rehash(0); + } } - } - - AllocatorManager::Instance().DebugBreak(address, allocationInfo); + AllocatorManager::Instance().DebugBreak(address, allocationInfo); - (void)byteSize; - (void)alignment; - AZ_Assert(byteSize==0||byteSize==allocationInfo.m_byteSize, "Mismatched byteSize at deallocation! You supplied an invalid value!"); - AZ_Assert(alignment==0||alignment==allocationInfo.m_alignment, "Mismatched alignment at deallocation! You supplied an invalid value!"); + (void)byteSize; + (void)alignment; + AZ_Assert( + byteSize == 0 || byteSize == allocationInfo.m_byteSize, "Mismatched byteSize at deallocation! You supplied an invalid value!"); + AZ_Assert( + alignment == 0 || alignment == allocationInfo.m_alignment, + "Mismatched alignment at deallocation! You supplied an invalid value!"); + + // statistics + m_requestedBytes -= allocationInfo.m_byteSize; - // statistics - m_requestedBytes -= allocationInfo.m_byteSize; - #if defined(ENABLE_MEMORY_GUARD) - // memory guard - if (m_memoryGuardSize == sizeof(Debug::GuardValue)) - { - if (m_isAutoIntegrityCheck) - { - // full integrity check - IntegrityCheck(); - } - else + // memory guard + if (m_memoryGuardSize == sizeof(Debug::GuardValue)) { - // check current allocation - char* guardAddress = reinterpret_cast(address)+allocationInfo.m_byteSize; - Debug::GuardValue* guard = reinterpret_cast(guardAddress); - if (!guard->Validate()) + if (m_isAutoIntegrityCheck) + { + // full integrity check + IntegrityCheck(); + } + else { - AZ_Printf("Memory", "Memory stomp located at address %p, part of allocation:", guardAddress); - PrintAllocationsCB printAlloc(true); - printAlloc(address, allocationInfo, m_numStackLevels); - AZ_Assert(false, "MEMORY STOMP DETECTED!!!"); + // check current allocation + char* guardAddress = reinterpret_cast(address) + allocationInfo.m_byteSize; + Debug::GuardValue* guard = reinterpret_cast(guardAddress); + if (!guard->Validate()) + { + AZ_Printf("Memory", "Memory stomp located at address %p, part of allocation:", guardAddress); + PrintAllocationsCB printAlloc(true); + printAlloc(address, allocationInfo, m_numStackLevels); + AZ_Assert(false, "MEMORY STOMP DETECTED!!!"); + } + guard->~GuardValue(); } - guard->~GuardValue(); } - } #endif - // delete allocation record - if (allocationInfo.m_namesBlock) - { - m_records.get_allocator().deallocate(allocationInfo.m_namesBlock, allocationInfo.m_namesBlockSize, 1); - allocationInfo.m_namesBlock = nullptr; - allocationInfo.m_namesBlockSize = 0; - allocationInfo.m_name = nullptr; - allocationInfo.m_fileName = nullptr; - } - if (allocationInfo.m_stackFrames) - { - m_records.get_allocator().deallocate(allocationInfo.m_stackFrames, sizeof(AZ::Debug::StackFrame)*m_numStackLevels, 1); - allocationInfo.m_stackFrames = nullptr; - } - - if (info) - { - *info = allocationInfo; - } - + // delete allocation record + if (allocationInfo.m_namesBlock) + { + m_records.get_allocator().deallocate(allocationInfo.m_namesBlock, allocationInfo.m_namesBlockSize, 1); + allocationInfo.m_namesBlock = nullptr; + allocationInfo.m_namesBlockSize = 0; + allocationInfo.m_name = nullptr; + allocationInfo.m_fileName = nullptr; + } + if (allocationInfo.m_stackFrames) + { + m_records.get_allocator().deallocate(allocationInfo.m_stackFrames, sizeof(AZ::Debug::StackFrame) * m_numStackLevels, 1); + allocationInfo.m_stackFrames = nullptr; + } + if (info) + { + *info = allocationInfo; + } - // if requested set memory to a specific value. - if (m_isMarkUnallocatedMemory) - { - memset(address, GetUnallocatedMarkValue(), byteSize); - } -} - -//========================================================================= -// ResizeAllocation -// [9/20/2009] -//========================================================================= -void -AllocationRecords::ResizeAllocation(void* address, size_t newSize) -{ - if (m_mode == RECORD_NO_RECORDS) - { - return; + // if requested set memory to a specific value. + if (m_isMarkUnallocatedMemory) + { + memset(address, GetUnallocatedMarkValue(), byteSize); + } } - AllocationInfo* allocationInfo; - { - AZStd::scoped_lock lock(m_recordsMutex); - Debug::AllocationRecordsType::iterator iter = m_records.find(address); - AZ_Assert(iter != m_records.end(), "Could not find address 0x%p in the allocator!", address); - allocationInfo = &iter->second; - } - AllocatorManager::Instance().DebugBreak(address, *allocationInfo); - -#if defined(ENABLE_MEMORY_GUARD) - if (m_memoryGuardSize == sizeof(Debug::GuardValue)) + //========================================================================= + // ResizeAllocation + // [9/20/2009] + //========================================================================= + void AllocationRecords::ResizeAllocation(void* address, size_t newSize) { - if (m_isAutoIntegrityCheck) + if (m_mode == RECORD_NO_RECORDS) { - // full integrity check - IntegrityCheck(); + return; } - else + + AllocationInfo* allocationInfo; + { + AZStd::scoped_lock lock(m_recordsMutex); + Debug::AllocationRecordsType::iterator iter = m_records.find(address); + AZ_Assert(iter != m_records.end(), "Could not find address 0x%p in the allocator!", address); + allocationInfo = &iter->second; + } + AllocatorManager::Instance().DebugBreak(address, *allocationInfo); + +#if defined(ENABLE_MEMORY_GUARD) + if (m_memoryGuardSize == sizeof(Debug::GuardValue)) { - // check memory guard - char* guardAddress = reinterpret_cast(address) + allocationInfo->m_byteSize; - Debug::GuardValue* guard = reinterpret_cast(guardAddress); - if (!guard->Validate()) + if (m_isAutoIntegrityCheck) + { + // full integrity check + IntegrityCheck(); + } + else { - AZ_Printf("Memory", "Memory stomp located at address %p, part of allocation:", guardAddress); - PrintAllocationsCB printAlloc(true); - printAlloc(address, iter->second, m_numStackLevels); - AZ_Assert(false, "MEMORY STOMP DETECTED!!!"); + // check memory guard + char* guardAddress = reinterpret_cast(address) + allocationInfo->m_byteSize; + Debug::GuardValue* guard = reinterpret_cast(guardAddress); + if (!guard->Validate()) + { + AZ_Printf("Memory", "Memory stomp located at address %p, part of allocation:", guardAddress); + PrintAllocationsCB printAlloc(true); + printAlloc(address, iter->second, m_numStackLevels); + AZ_Assert(false, "MEMORY STOMP DETECTED!!!"); + } + guard->~GuardValue(); } - guard->~GuardValue(); + // init the new memory guard + newSize -= sizeof(Debug::GuardValue); + new (reinterpret_cast(address) + newSize) Debug::GuardValue(); } - // init the new memory guard - newSize -= sizeof(Debug::GuardValue); - new(reinterpret_cast(address)+newSize) Debug::GuardValue(); - } #endif - // statistics - m_requestedBytes -= allocationInfo->m_byteSize; - m_requestedBytes += newSize; - size_t currentRequestedBytePeak; - size_t newRequestedBytePeak; - do - { - currentRequestedBytePeak = m_requestedBytesPeak.load(std::memory_order::memory_order_relaxed); - newRequestedBytePeak = AZStd::GetMax(currentRequestedBytePeak, m_requestedBytes.load(std::memory_order::memory_order_relaxed)); - } while (!m_requestedBytesPeak.compare_exchange_weak(currentRequestedBytePeak, newRequestedBytePeak)); - ++m_requestedAllocs; - - // update allocation size - allocationInfo->m_byteSize = newSize; -} - -//========================================================================= -// EnumerateAllocations -// [9/29/2009] -//========================================================================= -void -AllocationRecords::SetMode(Mode mode) -{ - if (mode == RECORD_NO_RECORDS) - { + // statistics + m_requestedBytes -= allocationInfo->m_byteSize; + m_requestedBytes += newSize; + size_t currentRequestedBytePeak; + size_t newRequestedBytePeak; + do { - AZStd::scoped_lock lock(m_recordsMutex); - m_records.clear(); - } - m_requestedBytes = 0; - m_requestedBytesPeak = 0; - m_requestedAllocs = 0; - } - - AZ_Warning("Memory", m_mode != RECORD_NO_RECORDS || mode == RECORD_NO_RECORDS, "Records recording was disabled and now it's enabled! You might get assert when you free memory, if a you have allocations which were not recorded!"); - - m_mode = mode; -} + currentRequestedBytePeak = m_requestedBytesPeak.load(std::memory_order::memory_order_relaxed); + newRequestedBytePeak = AZStd::GetMax(currentRequestedBytePeak, m_requestedBytes.load(std::memory_order::memory_order_relaxed)); + } while (!m_requestedBytesPeak.compare_exchange_weak(currentRequestedBytePeak, newRequestedBytePeak)); + ++m_requestedAllocs; -//========================================================================= -// EnumerateAllocations -// [9/29/2009] -//========================================================================= -void -AllocationRecords::EnumerateAllocations(AllocationInfoCBType cb) -{ - // enumerate all allocations and stop if requested. - // Since allocations can change during the iteration (code that prints out the records could allocate, which will - // mutate m_records), we are going to make a copy and iterate the copy. - Debug::AllocationRecordsType recordsCopy; - { - AZStd::scoped_lock lock(m_recordsMutex); - recordsCopy = m_records; + // update allocation size + allocationInfo->m_byteSize = newSize; } - for (Debug::AllocationRecordsType::const_iterator iter = recordsCopy.begin(); iter != recordsCopy.end(); ++iter) + + //========================================================================= + // EnumerateAllocations + // [9/29/2009] + //========================================================================= + void AllocationRecords::SetMode(Mode mode) { - if (!cb(iter->first, iter->second, m_numStackLevels)) + if (mode == RECORD_NO_RECORDS) { - break; + { + AZStd::scoped_lock lock(m_recordsMutex); + m_records.clear(); + } + m_requestedBytes = 0; + m_requestedBytesPeak = 0; + m_requestedAllocs = 0; } + + AZ_Warning( + "Memory", m_mode != RECORD_NO_RECORDS || mode == RECORD_NO_RECORDS, + "Records recording was disabled and now it's enabled! You might get assert when you free memory, if a you have allocations " + "which were not recorded!"); + + m_mode = mode; } -} - -//========================================================================= -// IntegrityCheck -// [9/9/2011] -//========================================================================= -void -AllocationRecords::IntegrityCheck() const -{ -#if defined(ENABLE_MEMORY_GUARD) - if (m_memoryGuardSize == sizeof(Debug::GuardValue)) + + //========================================================================= + // EnumerateAllocations + // [9/29/2009] + //========================================================================= + void AllocationRecords::EnumerateAllocations(AllocationInfoCBType cb) { + // enumerate all allocations and stop if requested. + // Since allocations can change during the iteration (code that prints out the records could allocate, which will + // mutate m_records), we are going to make a copy and iterate the copy. Debug::AllocationRecordsType recordsCopy; { AZStd::scoped_lock lock(m_recordsMutex); @@ -455,67 +438,93 @@ AllocationRecords::IntegrityCheck() const } for (Debug::AllocationRecordsType::const_iterator iter = recordsCopy.begin(); iter != recordsCopy.end(); ++iter) { - // check memory guard - const char* guardAddress = reinterpret_cast(iter->first)+ iter->second.m_byteSize; - if (!reinterpret_cast(guardAddress)->Validate()) + if (!cb(iter->first, iter->second, m_numStackLevels)) { - // We have to turn off the integrity check at this point if we want to succesfully report the memory - // stomp we just found. If we don't turn this off, the printf just winds off the stack as each memory - // allocation done therein recurses this same code. - *const_cast(&m_isAutoIntegrityCheck) = false; - AZ_Printf("Memory", "Memory stomp located at address %p, part of allocation:", guardAddress); - PrintAllocationsCB printAlloc(true); - printAlloc(iter->first, iter->second, m_numStackLevels); - AZ_Error("Memory", false, "MEMORY STOMP DETECTED!!!"); + break; } } } -#endif -} - -//========================================================================= -// operator() -// [9/29/2009] -//========================================================================= -bool -PrintAllocationsCB::operator()(void* address, const AllocationInfo& info, unsigned char numStackLevels) -{ - if (m_includeNameAndFilename && info.m_name) - { - AZ_Printf("Memory", "Allocation Name: \"%s\" Addr: 0%p Size: %d Alignment: %d\n", info.m_name, address, info.m_byteSize, info.m_alignment); - } - else + + //========================================================================= + // IntegrityCheck + // [9/9/2011] + //========================================================================= + void AllocationRecords::IntegrityCheck() const { - AZ_Printf("Memory", "Allocation Addr: 0%p Size: %d Alignment: %d\n", address, info.m_byteSize, info.m_alignment); +#if defined(ENABLE_MEMORY_GUARD) + if (m_memoryGuardSize == sizeof(Debug::GuardValue)) + { + Debug::AllocationRecordsType recordsCopy; + { + AZStd::scoped_lock lock(m_recordsMutex); + recordsCopy = m_records; + } + for (Debug::AllocationRecordsType::const_iterator iter = recordsCopy.begin(); iter != recordsCopy.end(); ++iter) + { + // check memory guard + const char* guardAddress = reinterpret_cast(iter->first) + iter->second.m_byteSize; + if (!reinterpret_cast(guardAddress)->Validate()) + { + // We have to turn off the integrity check at this point if we want to succesfully report the memory + // stomp we just found. If we don't turn this off, the printf just winds off the stack as each memory + // allocation done therein recurses this same code. + *const_cast(&m_isAutoIntegrityCheck) = false; + AZ_Printf("Memory", "Memory stomp located at address %p, part of allocation:", guardAddress); + PrintAllocationsCB printAlloc(true); + printAlloc(iter->first, iter->second, m_numStackLevels); + AZ_Error("Memory", false, "MEMORY STOMP DETECTED!!!"); + } + } + } +#endif } - if (m_isDetailed) + //========================================================================= + // operator() + // [9/29/2009] + //========================================================================= + bool PrintAllocationsCB::operator()(void* address, const AllocationInfo& info, unsigned char numStackLevels) { - if (!info.m_stackFrames) + if (m_includeNameAndFilename && info.m_name) { - AZ_Printf("Memory", " %s (%d)\n", info.m_fileName, info.m_lineNum); + AZ_Printf( + "Memory", "Allocation Name: \"%s\" Addr: 0%p Size: %d Alignment: %d\n", info.m_name, address, info.m_byteSize, + info.m_alignment); } else { - // Allocation callstack - const unsigned char decodeStep = 40; - Debug::SymbolStorage::StackLine lines[decodeStep]; - unsigned char iFrame = 0; - while (numStackLevels>0) + AZ_Printf("Memory", "Allocation Addr: 0%p Size: %d Alignment: %d\n", address, info.m_byteSize, info.m_alignment); + } + + if (m_isDetailed) + { + if (!info.m_stackFrames) + { + AZ_Printf("Memory", " %s (%d)\n", info.m_fileName, info.m_lineNum); + } + else { - unsigned char numToDecode = AZStd::GetMin(decodeStep, numStackLevels); - Debug::SymbolStorage::DecodeFrames(&info.m_stackFrames[iFrame], numToDecode, lines); - for (unsigned char i = 0; i < numToDecode; ++i) + // Allocation callstack + const unsigned char decodeStep = 40; + Debug::SymbolStorage::StackLine lines[decodeStep]; + unsigned char iFrame = 0; + while (numStackLevels > 0) { - if (info.m_stackFrames[iFrame+i].IsValid()) + unsigned char numToDecode = AZStd::GetMin(decodeStep, numStackLevels); + Debug::SymbolStorage::DecodeFrames(&info.m_stackFrames[iFrame], numToDecode, lines); + for (unsigned char i = 0; i < numToDecode; ++i) { - AZ_Printf("Memory", " %s\n", lines[i]); + if (info.m_stackFrames[iFrame + i].IsValid()) + { + AZ_Printf("Memory", " %s\n", lines[i]); + } } + numStackLevels -= numToDecode; + iFrame += numToDecode; } - numStackLevels -= numToDecode; - iFrame += numToDecode; } } + return true; // continue enumerating } - return true; // continue enumerating -} + +} // namespace AZ::Debug diff --git a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp index 61e883bb4e..5c510f67c1 100644 --- a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp @@ -6,194 +6,203 @@ * */ -#include #include +#include -using namespace AZ; - -AllocatorBase::AllocatorBase(IAllocatorAllocate* allocationSource, const char* name, const char* desc) : - IAllocator(allocationSource), - m_name(name), - m_desc(desc) +namespace AZ { -} + AllocatorBase::AllocatorBase(IAllocatorAllocate* allocationSource, const char* name, const char* desc) + : IAllocator(allocationSource) + , m_name(name) + , m_desc(desc) + { + } -AllocatorBase::~AllocatorBase() -{ - AZ_Assert(!m_isReady, "Allocator %s (%s) is being destructed without first having gone through proper calls to PreDestroy() and Destroy(). Use AllocatorInstance<> for global allocators or AllocatorWrapper<> for local allocators.", m_name, m_desc); -} + AllocatorBase::~AllocatorBase() + { + AZ_Assert( + !m_isReady, + "Allocator %s (%s) is being destructed without first having gone through proper calls to PreDestroy() and Destroy(). Use " + "AllocatorInstance<> for global allocators or AllocatorWrapper<> for local allocators.", + m_name, m_desc); + } -const char* AllocatorBase::GetName() const -{ - return m_name; -} + const char* AllocatorBase::GetName() const + { + return m_name; + } -const char* AllocatorBase::GetDescription() const -{ - return m_desc; -} + const char* AllocatorBase::GetDescription() const + { + return m_desc; + } -IAllocatorAllocate* AllocatorBase::GetSchema() -{ - return nullptr; -} + IAllocatorAllocate* AllocatorBase::GetSchema() + { + return nullptr; + } -Debug::AllocationRecords* AllocatorBase::GetRecords() -{ - return m_records; -} + Debug::AllocationRecords* AllocatorBase::GetRecords() + { + return m_records; + } -void AllocatorBase::SetRecords(Debug::AllocationRecords* records) -{ - m_records = records; - m_memoryGuardSize = records ? records->MemoryGuardSize() : 0; -} + void AllocatorBase::SetRecords(Debug::AllocationRecords* records) + { + m_records = records; + m_memoryGuardSize = records ? records->MemoryGuardSize() : 0; + } -bool AllocatorBase::IsReady() const -{ - return m_isReady; -} + bool AllocatorBase::IsReady() const + { + return m_isReady; + } -bool AllocatorBase::CanBeOverridden() const -{ - return m_canBeOverridden; -} + bool AllocatorBase::CanBeOverridden() const + { + return m_canBeOverridden; + } -void AllocatorBase::PostCreate() -{ - if (m_registrationEnabled) + void AllocatorBase::PostCreate() { - if (AZ::Environment::IsReady()) + if (m_registrationEnabled) { - AllocatorManager::Instance().RegisterAllocator(this); + if (AZ::Environment::IsReady()) + { + AllocatorManager::Instance().RegisterAllocator(this); + } + else + { + AllocatorManager::PreRegisterAllocator(this); + } } - else + + const auto debugConfig = GetDebugConfig(); + if (!debugConfig.m_excludeFromDebugging) { - AllocatorManager::PreRegisterAllocator(this); + SetRecords(aznew Debug::AllocationRecords( + (unsigned char)debugConfig.m_stackRecordLevels, debugConfig.m_usesMemoryGuards, debugConfig.m_marksUnallocatedMemory, + GetName())); } + + m_isReady = true; } - const auto debugConfig = GetDebugConfig(); - if (!debugConfig.m_excludeFromDebugging) + void AllocatorBase::PreDestroy() { - SetRecords(aznew Debug::AllocationRecords((unsigned char)debugConfig.m_stackRecordLevels, debugConfig.m_usesMemoryGuards, debugConfig.m_marksUnallocatedMemory, GetName())); - } + Debug::AllocationRecords* allocatorRecords = GetRecords(); + if (allocatorRecords) + { + delete allocatorRecords; + SetRecords(nullptr); + } - m_isReady = true; -} + if (m_registrationEnabled && AZ::AllocatorManager::IsReady()) + { + AllocatorManager::Instance().UnRegisterAllocator(this); + } -void AllocatorBase::PreDestroy() -{ - Debug::AllocationRecords* allocatorRecords = GetRecords(); - if(allocatorRecords) - { - delete allocatorRecords; - SetRecords(nullptr); + m_isReady = false; } - if (m_registrationEnabled && AZ::AllocatorManager::IsReady()) + void AllocatorBase::SetLazilyCreated(bool lazy) { - AllocatorManager::Instance().UnRegisterAllocator(this); + m_isLazilyCreated = lazy; } - m_isReady = false; -} - -void AllocatorBase::SetLazilyCreated(bool lazy) -{ - m_isLazilyCreated = lazy; -} - -bool AllocatorBase::IsLazilyCreated() const -{ - return m_isLazilyCreated; -} + bool AllocatorBase::IsLazilyCreated() const + { + return m_isLazilyCreated; + } -void AllocatorBase::SetProfilingActive(bool active) -{ - m_isProfilingActive = active; -} + void AllocatorBase::SetProfilingActive(bool active) + { + m_isProfilingActive = active; + } -bool AllocatorBase::IsProfilingActive() const -{ - return m_isProfilingActive; -} + bool AllocatorBase::IsProfilingActive() const + { + return m_isProfilingActive; + } -void AllocatorBase::DisableOverriding() -{ - m_canBeOverridden = false; -} + void AllocatorBase::DisableOverriding() + { + m_canBeOverridden = false; + } -void AllocatorBase::DisableRegistration() -{ - m_registrationEnabled = false; -} + void AllocatorBase::DisableRegistration() + { + m_registrationEnabled = false; + } -void AllocatorBase::ProfileAllocation(void* ptr, size_t byteSize, size_t alignment, const char* name, const char* fileName, int lineNum, int suppressStackRecord) -{ + void AllocatorBase::ProfileAllocation( + void* ptr, size_t byteSize, size_t alignment, const char* name, const char* fileName, int lineNum, int suppressStackRecord) + { #if defined(AZ_HAS_VARIADIC_TEMPLATES) && defined(AZ_DEBUG_BUILD) - ++suppressStackRecord; // one more for the fact the ebus is a function + ++suppressStackRecord; // one more for the fact the ebus is a function #endif // AZ_HAS_VARIADIC_TEMPLATES - if (m_isProfilingActive) - { - auto records = GetRecords(); - if (records) + if (m_isProfilingActive) { - records->RegisterAllocation(ptr, byteSize, alignment, name, fileName, lineNum, suppressStackRecord + 1); + auto records = GetRecords(); + if (records) + { + records->RegisterAllocation(ptr, byteSize, alignment, name, fileName, lineNum, suppressStackRecord + 1); + } } } -} -void AllocatorBase::ProfileDeallocation(void* ptr, size_t byteSize, size_t alignment, Debug::AllocationInfo* info) -{ - if (m_isProfilingActive) + void AllocatorBase::ProfileDeallocation(void* ptr, size_t byteSize, size_t alignment, Debug::AllocationInfo* info) { - auto records = GetRecords(); - if (records) + if (m_isProfilingActive) { - records->UnregisterAllocation(ptr, byteSize, alignment, info); + auto records = GetRecords(); + if (records) + { + records->UnregisterAllocation(ptr, byteSize, alignment, info); + } } } -} -void AllocatorBase::ProfileReallocationBegin([[maybe_unused]] void* ptr, [[maybe_unused]] size_t newSize) -{ -} + void AllocatorBase::ProfileReallocationBegin([[maybe_unused]] void* ptr, [[maybe_unused]] size_t newSize) + { + } -void AllocatorBase::ProfileReallocationEnd(void* ptr, void* newPtr, size_t newSize, size_t newAlignment) -{ - if (m_isProfilingActive) + void AllocatorBase::ProfileReallocationEnd(void* ptr, void* newPtr, size_t newSize, size_t newAlignment) { - Debug::AllocationInfo info; - ProfileDeallocation(ptr, 0, 0, &info); - ProfileAllocation(newPtr, newSize, newAlignment, info.m_name, info.m_fileName, info.m_lineNum, 0); + if (m_isProfilingActive) + { + Debug::AllocationInfo info; + ProfileDeallocation(ptr, 0, 0, &info); + ProfileAllocation(newPtr, newSize, newAlignment, info.m_name, info.m_fileName, info.m_lineNum, 0); + } } -} -void AllocatorBase::ProfileReallocation(void* ptr, void* newPtr, size_t newSize, size_t newAlignment) -{ - ProfileReallocationEnd(ptr, newPtr, newSize, newAlignment); -} + void AllocatorBase::ProfileReallocation(void* ptr, void* newPtr, size_t newSize, size_t newAlignment) + { + ProfileReallocationEnd(ptr, newPtr, newSize, newAlignment); + } -void AllocatorBase::ProfileResize(void* ptr, size_t newSize) -{ - if (newSize && m_isProfilingActive) + void AllocatorBase::ProfileResize(void* ptr, size_t newSize) { - auto records = GetRecords(); - if (records) + if (newSize && m_isProfilingActive) { - records->ResizeAllocation(ptr, newSize); + auto records = GetRecords(); + if (records) + { + records->ResizeAllocation(ptr, newSize); + } } } -} -bool AllocatorBase::OnOutOfMemory(size_t byteSize, size_t alignment, int flags, const char* name, const char* fileName, int lineNum) -{ - if (AllocatorManager::IsReady() && AllocatorManager::Instance().m_outOfMemoryListener) + bool AllocatorBase::OnOutOfMemory(size_t byteSize, size_t alignment, int flags, const char* name, const char* fileName, int lineNum) { - AllocatorManager::Instance().m_outOfMemoryListener(this, byteSize, alignment, flags, name, fileName, lineNum); - return true; + if (AllocatorManager::IsReady() && AllocatorManager::Instance().m_outOfMemoryListener) + { + AllocatorManager::Instance().m_outOfMemoryListener(this, byteSize, alignment, flags, name, fileName, lineNum); + return true; + } + return false; } - return false; -} + +} // namespace AZ diff --git a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.cpp b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.cpp index 30b0b78fe5..d55ca8b695 100644 --- a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.cpp @@ -13,186 +13,182 @@ #include -using namespace AZ; - -//========================================================================= -// BestFitExternalMapAllocator -// [1/28/2011] -//========================================================================= -BestFitExternalMapAllocator::BestFitExternalMapAllocator() - : AllocatorBase(this, "BestFitExternalMapAllocator", "Best fit allocator with external tracking storage!") - , m_schema(nullptr) -{} - -//========================================================================= -// Create -// [1/28/2011] -//========================================================================= -bool -BestFitExternalMapAllocator::Create(const Descriptor& desc) +namespace AZ { - AZ_Assert(IsReady() == false, "BestFitExternalMapAllocator was already created!"); - if (IsReady()) + //========================================================================= + // BestFitExternalMapAllocator + // [1/28/2011] + //========================================================================= + BestFitExternalMapAllocator::BestFitExternalMapAllocator() + : AllocatorBase(this, "BestFitExternalMapAllocator", "Best fit allocator with external tracking storage!") + , m_schema(nullptr) { - return false; } - bool isReady = true; + //========================================================================= + // Create + // [1/28/2011] + //========================================================================= + bool BestFitExternalMapAllocator::Create(const Descriptor& desc) + { + AZ_Assert(IsReady() == false, "BestFitExternalMapAllocator was already created!"); + if (IsReady()) + { + return false; + } + + bool isReady = true; + + m_desc = desc; + BestFitExternalMapSchema::Descriptor schemaDesc; + schemaDesc.m_mapAllocator = desc.m_mapAllocator; + schemaDesc.m_memoryBlock = desc.m_memoryBlock; + schemaDesc.m_memoryBlockByteSize = desc.m_memoryBlockByteSize; + + m_schema = azcreate(BestFitExternalMapSchema, (schemaDesc), SystemAllocator); + if (m_schema == nullptr) + { + isReady = false; + } + + return isReady; + } - m_desc = desc; - BestFitExternalMapSchema::Descriptor schemaDesc; - schemaDesc.m_mapAllocator = desc.m_mapAllocator; - schemaDesc.m_memoryBlock = desc.m_memoryBlock; - schemaDesc.m_memoryBlockByteSize = desc.m_memoryBlockByteSize; + //========================================================================= + // Destroy + // [1/28/2011] + //========================================================================= + void BestFitExternalMapAllocator::Destroy() + { + azdestroy(m_schema, SystemAllocator); + m_schema = nullptr; + } - m_schema = azcreate(BestFitExternalMapSchema, (schemaDesc), SystemAllocator); - if (m_schema == nullptr) + AllocatorDebugConfig BestFitExternalMapAllocator::GetDebugConfig() { - isReady = false; + return AllocatorDebugConfig() + .ExcludeFromDebugging(!m_desc.m_allocationRecords) + .StackRecordLevels(m_desc.m_stackRecordLevels) + .MarksUnallocatedMemory(false) + .UsesMemoryGuards(false); } - return isReady; -} + //========================================================================= + // Allocate + // [1/28/2011] + //========================================================================= + BestFitExternalMapAllocator::pointer_type BestFitExternalMapAllocator::Allocate( + size_type byteSize, + size_type alignment, + int flags, + [[maybe_unused]] const char* name, + [[maybe_unused]] const char* fileName, + [[maybe_unused]] int lineNum, + unsigned int suppressStackRecord) + { + (void)suppressStackRecord; -//========================================================================= -// Destroy -// [1/28/2011] -//========================================================================= -void -BestFitExternalMapAllocator::Destroy() -{ - azdestroy(m_schema, SystemAllocator); - m_schema = nullptr; -} + AZ_Assert(byteSize > 0, "You can not allocate 0 bytes!"); + AZ_Assert((alignment & (alignment - 1)) == 0, "Alignment must be power of 2!"); + byteSize = MemorySizeAdjustedUp(byteSize); -AllocatorDebugConfig BestFitExternalMapAllocator::GetDebugConfig() -{ - return AllocatorDebugConfig() - .ExcludeFromDebugging(!m_desc.m_allocationRecords) - .StackRecordLevels(m_desc.m_stackRecordLevels) - .MarksUnallocatedMemory(false) - .UsesMemoryGuards(false); -} - -//========================================================================= -// Allocate -// [1/28/2011] -//========================================================================= -BestFitExternalMapAllocator::pointer_type BestFitExternalMapAllocator::Allocate( - size_type byteSize, - size_type alignment, - int flags, - [[maybe_unused]] const char* name, - [[maybe_unused]] const char* fileName, - [[maybe_unused]] int lineNum, - unsigned int suppressStackRecord) -{ - (void)suppressStackRecord; + BestFitExternalMapAllocator::pointer_type address = m_schema->Allocate(byteSize, alignment, flags); + AZ_Assert( + address != nullptr, "BestFitExternalMapAllocator: Failed to allocate %d bytes aligned on %d (flags: 0x%08x) %s : %s (%d)!", + byteSize, alignment, flags, name ? name : "(no name)", fileName ? fileName : "(no file name)", lineNum); + AZ_MEMORY_PROFILE(ProfileAllocation(address, byteSize, alignment, name, fileName, lineNum, suppressStackRecord + 1)); - AZ_Assert(byteSize > 0, "You can not allocate 0 bytes!"); - AZ_Assert((alignment & (alignment - 1)) == 0, "Alignment must be power of 2!"); - byteSize = MemorySizeAdjustedUp(byteSize); + return address; + } - BestFitExternalMapAllocator::pointer_type address = m_schema->Allocate(byteSize, alignment, flags); - AZ_Assert(address != nullptr, "BestFitExternalMapAllocator: Failed to allocate %d bytes aligned on %d (flags: 0x%08x) %s : %s (%d)!", byteSize, alignment, flags, name ? name : "(no name)", fileName ? fileName : "(no file name)", lineNum); - AZ_MEMORY_PROFILE(ProfileAllocation(address, byteSize, alignment, name, fileName, lineNum, suppressStackRecord + 1)); + //========================================================================= + // DeAllocate + // [1/28/2011] + //========================================================================= + void BestFitExternalMapAllocator::DeAllocate(pointer_type ptr, size_type byteSize, size_type alignment) + { + byteSize = MemorySizeAdjustedUp(byteSize); + AZ_MEMORY_PROFILE(ProfileDeallocation(ptr, byteSize, alignment, nullptr)); - return address; -} + (void)byteSize; + (void)alignment; + m_schema->DeAllocate(ptr); + } -//========================================================================= -// DeAllocate -// [1/28/2011] -//========================================================================= -void -BestFitExternalMapAllocator::DeAllocate(pointer_type ptr, size_type byteSize, size_type alignment) -{ - byteSize = MemorySizeAdjustedUp(byteSize); - AZ_MEMORY_PROFILE(ProfileDeallocation(ptr, byteSize, alignment, nullptr)); - - (void)byteSize; - (void)alignment; - m_schema->DeAllocate(ptr); -} - -//========================================================================= -// Resize -// [1/28/2011] -//========================================================================= -BestFitExternalMapAllocator::size_type -BestFitExternalMapAllocator::Resize(pointer_type ptr, size_type newSize) -{ - (void)ptr; - (void)newSize; - /* todo */ - return 0; -} - -//========================================================================= -// ReAllocate -// [9/13/2011] -//========================================================================= -BestFitExternalMapAllocator::pointer_type -BestFitExternalMapAllocator::ReAllocate(pointer_type ptr, size_type newSize, size_type newAlignment) -{ - (void)ptr; - (void)newSize; - (void)newAlignment; - AZ_Assert(false, "Not supported!"); - return nullptr; -} - -//========================================================================= -// AllocationSize -// [1/28/2011] -//========================================================================= -BestFitExternalMapAllocator::size_type -BestFitExternalMapAllocator::AllocationSize(pointer_type ptr) -{ - return MemorySizeAdjustedDown(m_schema->AllocationSize(ptr)); -} - -//========================================================================= -// NumAllocatedBytes -// [1/28/2011] -//========================================================================= -BestFitExternalMapAllocator::size_type -BestFitExternalMapAllocator::NumAllocatedBytes() const -{ - return m_schema->NumAllocatedBytes(); -} - -//========================================================================= -// Capacity -// [1/28/2011] -//========================================================================= -BestFitExternalMapAllocator::size_type -BestFitExternalMapAllocator::Capacity() const -{ - return m_schema->Capacity(); -} - -//========================================================================= -// GetMaxAllocationSize -// [1/28/2011] -//========================================================================= -BestFitExternalMapAllocator::size_type -BestFitExternalMapAllocator::GetMaxAllocationSize() const -{ - return m_schema->GetMaxAllocationSize(); -} + //========================================================================= + // Resize + // [1/28/2011] + //========================================================================= + BestFitExternalMapAllocator::size_type BestFitExternalMapAllocator::Resize(pointer_type ptr, size_type newSize) + { + (void)ptr; + (void)newSize; + /* todo */ + return 0; + } -auto BestFitExternalMapAllocator::GetMaxContiguousAllocationSize() const -> size_type -{ - return m_schema->GetMaxContiguousAllocationSize(); -} - -//========================================================================= -// GetSubAllocator -// [1/28/2011] -//========================================================================= -IAllocatorAllocate* -BestFitExternalMapAllocator::GetSubAllocator() -{ - return m_schema->GetSubAllocator(); -} + //========================================================================= + // ReAllocate + // [9/13/2011] + //========================================================================= + BestFitExternalMapAllocator::pointer_type BestFitExternalMapAllocator::ReAllocate( + pointer_type ptr, size_type newSize, size_type newAlignment) + { + (void)ptr; + (void)newSize; + (void)newAlignment; + AZ_Assert(false, "Not supported!"); + return nullptr; + } + + //========================================================================= + // AllocationSize + // [1/28/2011] + //========================================================================= + BestFitExternalMapAllocator::size_type BestFitExternalMapAllocator::AllocationSize(pointer_type ptr) + { + return MemorySizeAdjustedDown(m_schema->AllocationSize(ptr)); + } + + //========================================================================= + // NumAllocatedBytes + // [1/28/2011] + //========================================================================= + BestFitExternalMapAllocator::size_type BestFitExternalMapAllocator::NumAllocatedBytes() const + { + return m_schema->NumAllocatedBytes(); + } + + //========================================================================= + // Capacity + // [1/28/2011] + //========================================================================= + BestFitExternalMapAllocator::size_type BestFitExternalMapAllocator::Capacity() const + { + return m_schema->Capacity(); + } + + //========================================================================= + // GetMaxAllocationSize + // [1/28/2011] + //========================================================================= + BestFitExternalMapAllocator::size_type BestFitExternalMapAllocator::GetMaxAllocationSize() const + { + return m_schema->GetMaxAllocationSize(); + } + + auto BestFitExternalMapAllocator::GetMaxContiguousAllocationSize() const -> size_type + { + return m_schema->GetMaxContiguousAllocationSize(); + } + + //========================================================================= + // GetSubAllocator + // [1/28/2011] + //========================================================================= + IAllocatorAllocate* BestFitExternalMapAllocator::GetSubAllocator() + { + return m_schema->GetSubAllocator(); + } + +} // namespace AZ diff --git a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.h b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.h index 17425625b7..90e2056d65 100644 --- a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.h +++ b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapAllocator.h @@ -5,8 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 OR MIT * */ -#ifndef AZ_BEST_FIT_EXT_MAP_ALLOCATOR_H -#define AZ_BEST_FIT_EXT_MAP_ALLOCATOR_H +#pragma once #include @@ -76,7 +75,3 @@ namespace AZ }; } -#endif // AZ_BEST_FIT_EXT_MAP_ALLOCATOR_H -#pragma once - - diff --git a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.cpp b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.cpp index 715ecd221e..841f36f58a 100644 --- a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.cpp @@ -9,194 +9,199 @@ #include #include -using namespace AZ; - -//========================================================================= -// BestFitExternalMapSchema -// [1/28/2011] -//========================================================================= -BestFitExternalMapSchema::BestFitExternalMapSchema(const Descriptor& desc) - : m_desc(desc) - , m_used(0) - , m_freeChunksMap(FreeMapType::key_compare(), AZStdIAllocator(desc.m_mapAllocator != nullptr ? desc.m_mapAllocator : &AllocatorInstance::Get())) - , m_allocChunksMap(AllocMapType::hasher(), AllocMapType::key_eq(), AZStdIAllocator(desc.m_mapAllocator != nullptr ? desc.m_mapAllocator : &AllocatorInstance::Get())) +namespace AZ { - if (m_desc.m_mapAllocator == nullptr) + //========================================================================= + // BestFitExternalMapSchema + // [1/28/2011] + //========================================================================= + BestFitExternalMapSchema::BestFitExternalMapSchema(const Descriptor& desc) + : m_desc(desc) + , m_used(0) + , m_freeChunksMap( + FreeMapType::key_compare(), + AZStdIAllocator(desc.m_mapAllocator != nullptr ? desc.m_mapAllocator : &AllocatorInstance::Get())) + , m_allocChunksMap( + AllocMapType::hasher(), + AllocMapType::key_eq(), + AZStdIAllocator(desc.m_mapAllocator != nullptr ? desc.m_mapAllocator : &AllocatorInstance::Get())) { - m_desc.m_mapAllocator = &AllocatorInstance::Get(); // used as our sub allocator + if (m_desc.m_mapAllocator == nullptr) + { + m_desc.m_mapAllocator = &AllocatorInstance::Get(); // used as our sub allocator + } + AZ_Assert(m_desc.m_memoryBlockByteSize > 0, "You must provide memory block size!"); + AZ_Assert(m_desc.m_memoryBlock != nullptr, "You must provide memory block allocated as you with!"); + // if( m_desc.m_memoryBlock == NULL) there is no point to automate this cause we need to flag this memory special, otherwise there + // is no point to use this allocator at all + // m_desc.m_memoryBlock = azmalloc(SystemAllocator,m_desc.m_memoryBlockByteSize,16); + m_freeChunksMap.insert(AZStd::make_pair(m_desc.m_memoryBlockByteSize, reinterpret_cast(m_desc.m_memoryBlock))); } - AZ_Assert(m_desc.m_memoryBlockByteSize > 0, "You must provide memory block size!"); - AZ_Assert(m_desc.m_memoryBlock != nullptr, "You must provide memory block allocated as you with!"); - //if( m_desc.m_memoryBlock == NULL) there is no point to automate this cause we need to flag this memory special, otherwise there is no point to use this allocator at all - // m_desc.m_memoryBlock = azmalloc(SystemAllocator,m_desc.m_memoryBlockByteSize,16); - m_freeChunksMap.insert(AZStd::make_pair(m_desc.m_memoryBlockByteSize, reinterpret_cast(m_desc.m_memoryBlock))); -} -//========================================================================= -// Allocate -// [1/28/2011] -//========================================================================= -BestFitExternalMapSchema::pointer_type -BestFitExternalMapSchema::Allocate(size_type byteSize, size_type alignment, int flags) -{ - (void)flags; - char* address = nullptr; - AZ_Assert(alignment > 0 && (alignment & (alignment - 1)) == 0, "Alignment must be >0 and power of 2!"); - for (int i = 0; i < 2; ++i) // max 2 attempts to allocate + //========================================================================= + // Allocate + // [1/28/2011] + //========================================================================= + BestFitExternalMapSchema::pointer_type BestFitExternalMapSchema::Allocate(size_type byteSize, size_type alignment, int flags) { - FreeMapType::iterator iter = m_freeChunksMap.find(byteSize); - size_t blockSize = 0; - char* blockAddress = nullptr; - size_t preAllocBlockSize = 0; - while (iter != m_freeChunksMap.end()) + (void)flags; + char* address = nullptr; + AZ_Assert(alignment > 0 && (alignment & (alignment - 1)) == 0, "Alignment must be >0 and power of 2!"); + for (int i = 0; i < 2; ++i) // max 2 attempts to allocate { - blockSize = iter->first; - blockAddress = iter->second; - char* alignedAddr = PointerAlignUp(blockAddress, alignment); - preAllocBlockSize = alignedAddr - blockAddress; - if (preAllocBlockSize + byteSize <= blockSize) + FreeMapType::iterator iter = m_freeChunksMap.find(byteSize); + size_t blockSize = 0; + char* blockAddress = nullptr; + size_t preAllocBlockSize = 0; + while (iter != m_freeChunksMap.end()) { - m_freeChunksMap.erase(iter); // we have our allocation - m_used += byteSize; - address = alignedAddr; - m_allocChunksMap.insert(AZStd::make_pair(address, byteSize)); - break; + blockSize = iter->first; + blockAddress = iter->second; + char* alignedAddr = PointerAlignUp(blockAddress, alignment); + preAllocBlockSize = alignedAddr - blockAddress; + if (preAllocBlockSize + byteSize <= blockSize) + { + m_freeChunksMap.erase(iter); // we have our allocation + m_used += byteSize; + address = alignedAddr; + m_allocChunksMap.insert(AZStd::make_pair(address, byteSize)); + break; + } + ++iter; } - ++iter; - } - if (address != nullptr) - { - // split blocks - if (preAllocBlockSize) // if we have a block before the alignment + if (address != nullptr) { - m_freeChunksMap.insert(AZStd::make_pair(preAllocBlockSize, blockAddress)); + // split blocks + if (preAllocBlockSize) // if we have a block before the alignment + { + m_freeChunksMap.insert(AZStd::make_pair(preAllocBlockSize, blockAddress)); + } + size_t postAllocBlockSize = blockSize - preAllocBlockSize - byteSize; + if (postAllocBlockSize) + { + m_freeChunksMap.insert(AZStd::make_pair(postAllocBlockSize, address + byteSize)); + } + + break; } - size_t postAllocBlockSize = blockSize - preAllocBlockSize - byteSize; - if (postAllocBlockSize) + else { - m_freeChunksMap.insert(AZStd::make_pair(postAllocBlockSize, address + byteSize)); + GarbageCollect(); } + } + return address; + } - break; + //========================================================================= + // DeAllocate + // [1/28/2011] + //========================================================================= + void BestFitExternalMapSchema::DeAllocate(pointer_type ptr) + { + if (ptr == nullptr) + { + return; } - else + AllocMapType::iterator iter = m_allocChunksMap.find(reinterpret_cast(ptr)); + if (iter != m_allocChunksMap.end()) { - GarbageCollect(); + m_used -= iter->second; + m_freeChunksMap.insert(AZStd::make_pair(iter->second, iter->first)); + m_allocChunksMap.erase(iter); } } - return address; -} -//========================================================================= -// DeAllocate -// [1/28/2011] -//========================================================================= -void -BestFitExternalMapSchema::DeAllocate(pointer_type ptr) -{ - if (ptr == nullptr) + //========================================================================= + // AllocationSize + // [1/28/2011] + //========================================================================= + BestFitExternalMapSchema::size_type BestFitExternalMapSchema::AllocationSize(pointer_type ptr) { - return; - } - AllocMapType::iterator iter = m_allocChunksMap.find(reinterpret_cast(ptr)); - if (iter != m_allocChunksMap.end()) - { - m_used -= iter->second; - m_freeChunksMap.insert(AZStd::make_pair(iter->second, iter->first)); - m_allocChunksMap.erase(iter); + AllocMapType::iterator iter = m_allocChunksMap.find(reinterpret_cast(ptr)); + if (iter != m_allocChunksMap.end()) + { + return iter->second; + } + return 0; } -} -//========================================================================= -// AllocationSize -// [1/28/2011] -//========================================================================= -BestFitExternalMapSchema::size_type -BestFitExternalMapSchema::AllocationSize(pointer_type ptr) -{ - AllocMapType::iterator iter = m_allocChunksMap.find(reinterpret_cast(ptr)); - if (iter != m_allocChunksMap.end()) + //========================================================================= + // GetMaxAllocationSize + // [1/28/2011] + //========================================================================= + BestFitExternalMapSchema::size_type BestFitExternalMapSchema::GetMaxAllocationSize() const { - return iter->second; + if (!m_freeChunksMap.empty()) + { + return m_freeChunksMap.rbegin()->first; + } + return 0; } - return 0; -} -//========================================================================= -// GetMaxAllocationSize -// [1/28/2011] -//========================================================================= -BestFitExternalMapSchema::size_type -BestFitExternalMapSchema::GetMaxAllocationSize() const -{ - if (!m_freeChunksMap.empty()) + auto BestFitExternalMapSchema::GetMaxContiguousAllocationSize() const -> size_type { - return m_freeChunksMap.rbegin()->first; + // Return the maximum size of any single allocation + return AZ_CORE_MAX_ALLOCATOR_SIZE; } - return 0; -} -auto BestFitExternalMapSchema::GetMaxContiguousAllocationSize() const -> size_type -{ - // Return the maximum size of any single allocation - return AZ_CORE_MAX_ALLOCATOR_SIZE; -} - -//========================================================================= -// GarbageCollect -// [1/28/2011] -//========================================================================= -void -BestFitExternalMapSchema::GarbageCollect() -{ - for (FreeMapType::iterator curBlock = m_freeChunksMap.begin(); curBlock != m_freeChunksMap.end(); ) + //========================================================================= + // GarbageCollect + // [1/28/2011] + //========================================================================= + void BestFitExternalMapSchema::GarbageCollect() { - char* curStart = curBlock->second; - char* curEnd = curStart + curBlock->first; - bool isMerge = false; - for (FreeMapType::iterator nextBlock = curBlock++; nextBlock != m_freeChunksMap.end(); ) + for (FreeMapType::iterator curBlock = m_freeChunksMap.begin(); curBlock != m_freeChunksMap.end();) { - char* nextStart = nextBlock->second; - char* nextEnd = nextStart + nextBlock->first; - if (curStart == nextEnd) + char* curStart = curBlock->second; + char* curEnd = curStart + curBlock->first; + bool isMerge = false; + for (FreeMapType::iterator nextBlock = curBlock++; nextBlock != m_freeChunksMap.end();) { - // merge - size_t newBlockSize = curBlock->first + nextBlock->first; - char* newBlockAddress = nextStart; - m_freeChunksMap.erase(nextBlock); - FreeMapType::iterator toErase = curBlock; - ++curBlock; - m_freeChunksMap.erase(toErase); - FreeMapType::iterator newBlock = m_freeChunksMap.insert(AZStd::make_pair(newBlockSize, newBlockAddress)).first; - if (curBlock != m_freeChunksMap.end() && newBlockSize < curBlock->first) // if the newBlock in before the next in the list, update next in the list to current + char* nextStart = nextBlock->second; + char* nextEnd = nextStart + nextBlock->first; + if (curStart == nextEnd) { - curBlock = newBlock; + // merge + size_t newBlockSize = curBlock->first + nextBlock->first; + char* newBlockAddress = nextStart; + m_freeChunksMap.erase(nextBlock); + FreeMapType::iterator toErase = curBlock; + ++curBlock; + m_freeChunksMap.erase(toErase); + FreeMapType::iterator newBlock = m_freeChunksMap.insert(AZStd::make_pair(newBlockSize, newBlockAddress)).first; + // if the newBlock in before the next in the list, update next in the list to current + if (curBlock != m_freeChunksMap.end() && newBlockSize < curBlock->first) + { + curBlock = newBlock; + } + isMerge = true; + break; } - isMerge = true; - break; + else if (curEnd == nextStart) + { + // merge + size_t newBlockSize = curBlock->first + nextBlock->first; + char* newBlockAddress = curStart; + m_freeChunksMap.erase(nextBlock); + FreeMapType::iterator toErase = curBlock; + ++curBlock; + m_freeChunksMap.erase(toErase); + FreeMapType::iterator newBlock = m_freeChunksMap.insert(AZStd::make_pair(newBlockSize, newBlockAddress)).first; + // if the newBlock in before the next in the list, update next in the list to current + if (curBlock != m_freeChunksMap.end() && newBlockSize < curBlock->first) + { + curBlock = newBlock; + } + isMerge = true; + break; + } + ++nextBlock; } - else if (curEnd == nextStart) + if (!isMerge) { - // merge - size_t newBlockSize = curBlock->first + nextBlock->first; - char* newBlockAddress = curStart; - m_freeChunksMap.erase(nextBlock); - FreeMapType::iterator toErase = curBlock; ++curBlock; - m_freeChunksMap.erase(toErase); - FreeMapType::iterator newBlock = m_freeChunksMap.insert(AZStd::make_pair(newBlockSize, newBlockAddress)).first; - if (curBlock != m_freeChunksMap.end() && newBlockSize < curBlock->first) // if the newBlock in before the next in the list, update next in the list to current - { - curBlock = newBlock; - } - isMerge = true; - break; } - ++nextBlock; - } - if (!isMerge) - { - ++curBlock; } } -} + +} // namespace AZ diff --git a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.h b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.h index eaab614593..0055a86ee2 100644 --- a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.h +++ b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.h @@ -5,8 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 OR MIT * */ -#ifndef AZ_BEST_FIT_EXT_MAP_ALLOCATION_SCHEME_H -#define AZ_BEST_FIT_EXT_MAP_ALLOCATION_SCHEME_H +#pragma once #include #include @@ -77,8 +76,3 @@ namespace AZ AllocMapType m_allocChunksMap; }; } - -#endif // AZ_BEST_FIT_EXT_MAP_ALLOCATION_SCHEME_H -#pragma once - - diff --git a/Code/Framework/AzCore/AzCore/Memory/PoolSchema.cpp b/Code/Framework/AzCore/AzCore/Memory/PoolSchema.cpp index 9167864450..c57cfea222 100644 --- a/Code/Framework/AzCore/AzCore/Memory/PoolSchema.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/PoolSchema.cpp @@ -27,8 +27,8 @@ namespace AZ ////////////////////////////////////////////////////////////////////////// // Pool Allocation algorithm /** - * Pool Allocation algorithm implementation. Used in both PoolAllocator and ThreadPoolAllocator. - */ + * Pool Allocation algorithm implementation. Used in both PoolAllocator and ThreadPoolAllocator. + */ template class PoolAllocation { @@ -41,20 +41,20 @@ namespace AZ PoolAllocation(Allocator* alloc, size_t pageSize, size_t minAllocationSize, size_t maxAllocationSize); virtual ~PoolAllocation(); - void* Allocate(size_t byteSize, size_t alignment); - void DeAllocate(void* ptr); - size_t AllocationSize(void* ptr); + void* Allocate(size_t byteSize, size_t alignment); + void DeAllocate(void* ptr); + size_t AllocationSize(void* ptr); // if isForceFreeAllPages is true we will free all pages even if they have allocations in them. - void GarbageCollect(bool isForceFreeAllPages = false); - - Allocator* m_allocator; - size_t m_pageSize; - size_t m_minAllocationShift; - size_t m_minAllocationSize; - size_t m_maxAllocationSize; - size_t m_numBuckets; - BucketType* m_buckets; - size_t m_numBytesAllocated; + void GarbageCollect(bool isForceFreeAllPages = false); + + Allocator* m_allocator; + size_t m_pageSize; + size_t m_minAllocationShift; + size_t m_minAllocationSize; + size_t m_maxAllocationSize; + size_t m_numBuckets; + BucketType* m_buckets; + size_t m_numBytesAllocated; }; /** @@ -68,23 +68,22 @@ namespace AZ PoolSchemaImpl(const PoolSchema::Descriptor& desc); ~PoolSchemaImpl(); - PoolSchema::pointer_type Allocate(PoolSchema::size_type byteSize, PoolSchema::size_type alignment, int flags = 0); - void DeAllocate(PoolSchema::pointer_type ptr); - PoolSchema::size_type AllocationSize(PoolSchema::pointer_type ptr); + PoolSchema::pointer_type Allocate(PoolSchema::size_type byteSize, PoolSchema::size_type alignment, int flags = 0); + void DeAllocate(PoolSchema::pointer_type ptr); + PoolSchema::size_type AllocationSize(PoolSchema::pointer_type ptr); /** - * We allocate memory for pools in pages. Page is a information struct - * located at the end of the allocated page. When it's in the at the end - * we can usually hide it's size in the free bytes left from the pagesize/poolsize. - * \note IMPORTANT pages are aligned on the page size, this way can find quickly which - * pool the pointer belongs to. - */ - struct Page - : public AZStd::intrusive_list_node + * We allocate memory for pools in pages. Page is a information struct + * located at the end of the allocated page. When it's in the at the end + * we can usually hide it's size in the free bytes left from the pagesize/poolsize. + * \note IMPORTANT pages are aligned on the page size, this way can find quickly which + * pool the pointer belongs to. + */ + struct Page : public AZStd::intrusive_list_node { - struct FakeNode - : public AZStd::intrusive_slist_node - {}; + struct FakeNode : public AZStd::intrusive_slist_node + { + }; void SetupFreeList(size_t elementSize, size_t pageDataBlockSize); @@ -99,22 +98,22 @@ namespace AZ }; /** - * A bucket has a list of pages used with the specific pool size. - */ + * A bucket has a list of pages used with the specific pool size. + */ struct Bucket { using PageListType = AZStd::intrusive_list>; - PageListType m_pages; + PageListType m_pages; }; // Functions used by PoolAllocation template AZ_INLINE Page* PopFreePage(); - AZ_INLINE void PushFreePage(Page* page); - void GarbageCollect(); - inline bool IsInStaticBlock(Page* page) + AZ_INLINE void PushFreePage(Page* page); + void GarbageCollect(); + inline bool IsInStaticBlock(Page* page) { const char* staticBlockStart = reinterpret_cast(m_staticDataBlock); - const char* staticBlockEnd = staticBlockStart + m_numStaticPages*m_pageSize; + const char* staticBlockEnd = staticBlockStart + m_numStaticPages * m_pageSize; const char* pageAddress = reinterpret_cast(page); // all pages are the same size so we either in or out, no need to check the pageAddressEnd if (pageAddress >= staticBlockStart && pageAddress < staticBlockEnd) @@ -126,21 +125,22 @@ namespace AZ return false; } } - inline Page* ConstructPage(size_t elementSize) + inline Page* ConstructPage(size_t elementSize) { AZ_Assert(m_isDynamic, "We run out of static pages (%d) and this is a static allocator!", m_numStaticPages); // We store the page struct at the end of the block char* memBlock; - memBlock = reinterpret_cast(m_pageAllocator->Allocate(m_pageSize, m_pageSize, 0, "AZSystem::PoolSchemaImpl::ConstructPage", __FILE__, __LINE__)); + memBlock = reinterpret_cast( + m_pageAllocator->Allocate(m_pageSize, m_pageSize, 0, "AZSystem::PoolSchemaImpl::ConstructPage", __FILE__, __LINE__)); size_t pageDataSize = m_pageSize - sizeof(Page); - Page* page = new(memBlock+pageDataSize)Page(); + Page* page = new (memBlock + pageDataSize) Page(); page->SetupFreeList(elementSize, pageDataSize); page->m_elementSize = static_cast(elementSize); page->m_maxNumElements = static_cast(pageDataSize / elementSize); return page; } - inline void FreePage(Page* page) + inline void FreePage(Page* page) { // TODO: It's optional if we want to check the guard value for corruption, since we are not going // to use this memory. Yet it might be useful to catch bugs. @@ -150,9 +150,9 @@ namespace AZ m_pageAllocator->DeAllocate(memBlock); } - inline Page* PageFromAddress(void* address) + inline Page* PageFromAddress(void* address) { - char* memBlock = reinterpret_cast(reinterpret_cast(address) & ~(m_pageSize-1)); + char* memBlock = reinterpret_cast(reinterpret_cast(address) & ~(m_pageSize - 1)); memBlock += m_pageSize - sizeof(Page); Page* page = reinterpret_cast(memBlock); if (!page->m_magic.Validate()) @@ -163,18 +163,18 @@ namespace AZ } using AllocatorType = PoolAllocation; - IAllocatorAllocate* m_pageAllocator; - AllocatorType m_allocator; - void* m_staticDataBlock; - unsigned int m_numStaticPages; - bool m_isDynamic; - size_t m_pageSize; - Bucket::PageListType m_freePages; + IAllocatorAllocate* m_pageAllocator; + AllocatorType m_allocator; + void* m_staticDataBlock; + unsigned int m_numStaticPages; + bool m_isDynamic; + size_t m_pageSize; + Bucket::PageListType m_freePages; }; /** - * Thread safe pool allocator. - */ + * Thread safe pool allocator. + */ class ThreadPoolSchemaImpl { public: @@ -183,18 +183,20 @@ namespace AZ /** * Specialized \ref PoolAllocator::Page page for lock free allocator. */ - struct Page - : public AZStd::intrusive_list_node + struct Page : public AZStd::intrusive_list_node { Page(ThreadPoolData* threadData) - : m_threadData(threadData) {} + : m_threadData(threadData) + { + } - struct FakeNode - : public AZStd::intrusive_slist_node - {}; + struct FakeNode : public AZStd::intrusive_slist_node + { + }; // Fake Lock Free node used when we delete an element from another thread. - struct FakeNodeLF - : public AZStd::lock_free_intrusive_stack_node{}; + struct FakeNodeLF : public AZStd::lock_free_intrusive_stack_node + { + }; void SetupFreeList(size_t elementSize, size_t pageDataBlockSize); @@ -202,8 +204,8 @@ namespace AZ using FreeListType = AZStd::intrusive_slist>; FreeListType m_freeList; - AZStd::lock_free_intrusive_stack_node m_lfStack; ///< Lock Free stack node - struct ThreadPoolData* m_threadData; ///< The thread data that own's the page. + AZStd::lock_free_intrusive_stack_node m_lfStack; ///< Lock Free stack node + struct ThreadPoolData* m_threadData; ///< The thread data that own's the page. u32 m_bin; Debug::Magic32 m_magic; u32 m_elementSize; @@ -211,31 +213,34 @@ namespace AZ }; /** - * A bucket has a list of pages used with the specific pool size. - */ + * A bucket has a list of pages used with the specific pool size. + */ struct Bucket { using PageListType = AZStd::intrusive_list>; - PageListType m_pages; + PageListType m_pages; }; - ThreadPoolSchemaImpl(const ThreadPoolSchema::Descriptor& desc, ThreadPoolSchema::GetThreadPoolData threadPoolGetter, ThreadPoolSchema::SetThreadPoolData threadPoolSetter); + ThreadPoolSchemaImpl( + const ThreadPoolSchema::Descriptor& desc, + ThreadPoolSchema::GetThreadPoolData threadPoolGetter, + ThreadPoolSchema::SetThreadPoolData threadPoolSetter); ~ThreadPoolSchemaImpl(); - ThreadPoolSchema::pointer_type Allocate(ThreadPoolSchema::size_type byteSize, ThreadPoolSchema::size_type alignment, int flags = 0); - void DeAllocate(ThreadPoolSchema::pointer_type ptr); - ThreadPoolSchema::size_type AllocationSize(ThreadPoolSchema::pointer_type ptr); + ThreadPoolSchema::pointer_type Allocate(ThreadPoolSchema::size_type byteSize, ThreadPoolSchema::size_type alignment, int flags = 0); + void DeAllocate(ThreadPoolSchema::pointer_type ptr); + ThreadPoolSchema::size_type AllocationSize(ThreadPoolSchema::pointer_type ptr); /// Return unused memory to the OS. Don't call this too often because you will force unnecessary allocations. - void GarbageCollect(); + void GarbageCollect(); ////////////////////////////////////////////////////////////////////////// // Functions used by PoolAllocation template AZ_INLINE Page* PopFreePage(); - AZ_INLINE void PushFreePage(Page* page); - inline bool IsInStaticBlock(Page* page) + AZ_INLINE void PushFreePage(Page* page); + inline bool IsInStaticBlock(Page* page) { const char* staticBlockStart = reinterpret_cast(m_staticDataBlock); - const char* staticBlockEnd = staticBlockStart + m_numStaticPages*m_pageSize; + const char* staticBlockEnd = staticBlockStart + m_numStaticPages * m_pageSize; const char* pageAddress = reinterpret_cast(page); // all pages are the same size so we either in or out, no need to check the pageAddressEnd if (pageAddress > staticBlockStart && pageAddress < staticBlockEnd) @@ -247,33 +252,34 @@ namespace AZ return false; } } - inline Page* ConstructPage(size_t elementSize) + inline Page* ConstructPage(size_t elementSize) { AZ_Assert(m_isDynamic, "We run out of static pages (%d) and this is a static allocator!", m_numStaticPages); // We store the page struct at the end of the block char* memBlock; - memBlock = reinterpret_cast(m_pageAllocator->Allocate(m_pageSize, m_pageSize, 0, "AZSystem::ThreadPoolSchema::ConstructPage", __FILE__, __LINE__)); + memBlock = reinterpret_cast( + m_pageAllocator->Allocate(m_pageSize, m_pageSize, 0, "AZSystem::ThreadPoolSchema::ConstructPage", __FILE__, __LINE__)); size_t pageDataSize = m_pageSize - sizeof(Page); - Page* page = new(memBlock+pageDataSize)Page(m_threadPoolGetter()); + Page* page = new (memBlock + pageDataSize) Page(m_threadPoolGetter()); page->SetupFreeList(elementSize, pageDataSize); page->m_elementSize = static_cast(elementSize); page->m_maxNumElements = static_cast(pageDataSize / elementSize); return page; } - inline void FreePage(Page* page) + inline void FreePage(Page* page) { // TODO: It's optional if we want to check the guard value for corruption, since we are not going // to use this memory. Yet it might be useful to catch bugs. // We store the page struct at the end of the block char* memBlock = reinterpret_cast(page) - m_pageSize + sizeof(Page); - page->~Page(); // destroy the page + page->~Page(); // destroy the page m_pageAllocator->DeAllocate(memBlock); } - inline Page* PageFromAddress(void* address) + inline Page* PageFromAddress(void* address) { - char* memBlock = reinterpret_cast(reinterpret_cast(address) & ~static_cast(m_pageSize-1)); + char* memBlock = reinterpret_cast(reinterpret_cast(address) & ~static_cast(m_pageSize - 1)); memBlock += m_pageSize - sizeof(Page); Page* page = reinterpret_cast(memBlock); if (!page->m_magic.Validate()) @@ -292,18 +298,18 @@ namespace AZ // Fox X64 we push/pop pages using the m_mutex to sync. Pages are using FreePagesType = Bucket::PageListType; - FreePagesType m_freePages; - AZStd::vector m_threads; ///< Array with all separate thread data. Used to traverse end free elements. - - IAllocatorAllocate* m_pageAllocator; - void* m_staticDataBlock; - size_t m_numStaticPages; - size_t m_pageSize; - size_t m_minAllocationSize; - size_t m_maxAllocationSize; - bool m_isDynamic; + FreePagesType m_freePages; + AZStd::vector m_threads; ///< Array with all separate thread data. Used to traverse end free elements. + + IAllocatorAllocate* m_pageAllocator; + void* m_staticDataBlock; + size_t m_numStaticPages; + size_t m_pageSize; + size_t m_minAllocationSize; + size_t m_maxAllocationSize; + bool m_isDynamic; // TODO rbbaklov Changed to recursive_mutex from mutex for Linux support. - AZStd::recursive_mutex m_mutex; + AZStd::recursive_mutex m_mutex; }; struct ThreadPoolData @@ -315,1090 +321,1088 @@ namespace AZ using AllocatorType = PoolAllocation; /** - * Stack with freed elements from other threads. We don't need stamped stack since the ABA problem can not - * happen here. We push from many threads and pop from only one (we don't push from it). - */ - using FreedElementsStack = AZStd::lock_free_intrusive_stack>; + * Stack with freed elements from other threads. We don't need stamped stack since the ABA problem can not + * happen here. We push from many threads and pop from only one (we don't push from it). + */ + using FreedElementsStack = AZStd::lock_free_intrusive_stack< + ThreadPoolSchemaImpl::Page::FakeNodeLF, + AZStd::lock_free_intrusive_stack_base_hook>; - AllocatorType m_allocator; - FreedElementsStack m_freedElements; + AllocatorType m_allocator; + FreedElementsStack m_freedElements; }; -} - -using namespace AZ; - -//========================================================================= -// PoolAllocation -// [9/09/2009] -//========================================================================= -template -PoolAllocation::PoolAllocation(Allocator* alloc, size_t pageSize, size_t minAllocationSize, size_t maxAllocationSize) - : m_allocator(alloc) - , m_pageSize(pageSize) - , m_numBytesAllocated(0) -{ - AZ_Assert(alloc->m_pageAllocator, "We need the page allocator setup!"); - AZ_Assert(pageSize >= maxAllocationSize * 4, "We need to fit at least 4 objects in a pool! Increase your page size! Page %d MaxAllocationSize %d",pageSize,maxAllocationSize); - AZ_Assert(minAllocationSize == maxAllocationSize || ((minAllocationSize)&(minAllocationSize - 1)) == 0, "Min allocation should be either equal to max allocation size or power of two"); - - m_minAllocationSize = AZ::GetMax(minAllocationSize, size_t(8)); - m_maxAllocationSize = AZ::GetMax(maxAllocationSize, minAllocationSize); +} // namespace AZ - m_minAllocationShift = 0; - for (size_t i = 1; i < sizeof(unsigned int)*8; i++) +namespace AZ +{ + //========================================================================= + // PoolAllocation + // [9/09/2009] + //========================================================================= + template + PoolAllocation::PoolAllocation(Allocator* alloc, size_t pageSize, size_t minAllocationSize, size_t maxAllocationSize) + : m_allocator(alloc) + , m_pageSize(pageSize) + , m_numBytesAllocated(0) { - if (m_minAllocationSize >> i == 0) + AZ_Assert(alloc->m_pageAllocator, "We need the page allocator setup!"); + AZ_Assert( + pageSize >= maxAllocationSize * 4, + "We need to fit at least 4 objects in a pool! Increase your page size! Page %d MaxAllocationSize %d", pageSize, + maxAllocationSize); + AZ_Assert( + minAllocationSize == maxAllocationSize || ((minAllocationSize) & (minAllocationSize - 1)) == 0, + "Min allocation should be either equal to max allocation size or power of two"); + + m_minAllocationSize = AZ::GetMax(minAllocationSize, size_t(8)); + m_maxAllocationSize = AZ::GetMax(maxAllocationSize, minAllocationSize); + + m_minAllocationShift = 0; + for (size_t i = 1; i < sizeof(unsigned int) * 8; i++) { - m_minAllocationShift = i-1; - break; + if (m_minAllocationSize >> i == 0) + { + m_minAllocationShift = i - 1; + break; + } + } + + AZ_Assert( + m_maxAllocationSize % m_minAllocationSize == 0, + "You need to be able to divide m_maxAllocationSize (%d) / m_minAllocationSize (%d) without fraction!", m_maxAllocationSize, + m_minAllocationSize); + m_numBuckets = m_maxAllocationSize / m_minAllocationSize; + AZ_Assert(m_numBuckets <= 0xffff, "You can't have more than 65535 number of buckets! We need to increase the index size!"); + m_buckets = reinterpret_cast( + alloc->m_pageAllocator->Allocate(sizeof(BucketType) * m_numBuckets, AZStd::alignment_of::value)); + for (size_t i = 0; i < m_numBuckets; ++i) + { + new (m_buckets + i) BucketType(); } } - AZ_Assert(m_maxAllocationSize % m_minAllocationSize == 0, "You need to be able to divide m_maxAllocationSize (%d) / m_minAllocationSize (%d) without fraction!", m_maxAllocationSize, m_minAllocationSize); - m_numBuckets = m_maxAllocationSize / m_minAllocationSize; - AZ_Assert(m_numBuckets <= 0xffff, "You can't have more than 65535 number of buckets! We need to increase the index size!"); - m_buckets = reinterpret_cast(alloc->m_pageAllocator->Allocate(sizeof(BucketType)*m_numBuckets, AZStd::alignment_of::value)); - for (size_t i = 0; i < m_numBuckets; ++i) + //========================================================================= + // ~PoolAllocation + // [9/09/2009] + //========================================================================= + template + PoolAllocation::~PoolAllocation() { - new(m_buckets + i)BucketType(); + GarbageCollect(true); + + for (size_t i = 0; i < m_numBuckets; ++i) + { + m_buckets[i].~BucketType(); + } + m_allocator->m_pageAllocator->DeAllocate(m_buckets, sizeof(BucketType) * m_numBuckets); } -} - -//========================================================================= -// ~PoolAllocation -// [9/09/2009] -//========================================================================= -template -PoolAllocation::~PoolAllocation() -{ - GarbageCollect(true); - for (size_t i = 0; i < m_numBuckets; ++i) + //========================================================================= + // Allocate + // [9/09/2009] + //========================================================================= + template + AZ_INLINE void* PoolAllocation::Allocate(size_t byteSize, size_t alignment) { - m_buckets[i].~BucketType(); - } - m_allocator->m_pageAllocator->DeAllocate(m_buckets, sizeof(BucketType) * m_numBuckets); -} - -//========================================================================= -// Allocate -// [9/09/2009] -//========================================================================= -template -AZ_INLINE void* -PoolAllocation::Allocate(size_t byteSize, size_t alignment) -{ - AZ_Assert(byteSize>0, "You can not allocate 0 bytes!"); - AZ_Assert(alignment>0&&(alignment&(alignment-1))==0, "Alignment must be >0 and power of 2!"); + AZ_Assert(byteSize > 0, "You can not allocate 0 bytes!"); + AZ_Assert(alignment > 0 && (alignment & (alignment - 1)) == 0, "Alignment must be >0 and power of 2!"); - // pad the size to the min allocation size. - byteSize = AZ::SizeAlignUp(byteSize, m_minAllocationSize); - byteSize = AZ::SizeAlignUp(byteSize, alignment); + // pad the size to the min allocation size. + byteSize = AZ::SizeAlignUp(byteSize, m_minAllocationSize); + byteSize = AZ::SizeAlignUp(byteSize, alignment); - if (byteSize > m_maxAllocationSize) - { - AZ_Assert(false, "Allocation size (%d) is too big (max: %d) for pools!", byteSize, m_maxAllocationSize); - return nullptr; + if (byteSize > m_maxAllocationSize) + { + AZ_Assert(false, "Allocation size (%d) is too big (max: %d) for pools!", byteSize, m_maxAllocationSize); + return nullptr; + } + + u32 bucketIndex = static_cast((byteSize >> m_minAllocationShift) - 1); + BucketType& bucket = m_buckets[bucketIndex]; + PageType* page = nullptr; + if (!bucket.m_pages.empty()) + { + page = &bucket.m_pages.front(); + + // check if we have free slot in the page + if (page->m_freeList.empty()) + { + page = nullptr; + } + else if (page->m_freeList.size() == 1) + { + // if we have only 1 free slot this allocation will + // fill the page, so put in on the back + bucket.m_pages.pop_front(); + bucket.m_pages.push_back(*page); + } + } + if (!page) + { + page = m_allocator->PopFreePage(); + if (page) + { + // We have any pages available on free page stack. + if (page->m_bin != bucketIndex) // if this page was used the same bucket we are ready to roll. + { + size_t elementSize = byteSize; + size_t pageDataSize = m_pageSize - sizeof(PageType); + page->SetupFreeList(elementSize, pageDataSize); + page->m_bin = bucketIndex; + page->m_elementSize = static_cast(elementSize); + page->m_maxNumElements = static_cast(pageDataSize / elementSize); + } + } + else + { + // We need to align each page on it's size, this way we can quickly find which page the pointer belongs to. + page = m_allocator->ConstructPage(byteSize); + page->m_bin = bucketIndex; + } + bucket.m_pages.push_front(*page); + } + + // The data address and the fake node address are shared. + void* address = &page->m_freeList.front(); + page->m_freeList.pop_front(); + + m_numBytesAllocated += byteSize; + + return address; } - u32 bucketIndex = static_cast((byteSize >> m_minAllocationShift)-1); - BucketType& bucket = m_buckets[bucketIndex]; - PageType* page = nullptr; - if (!bucket.m_pages.empty()) + //========================================================================= + // DeAllocate + // [9/09/2009] + //========================================================================= + template + AZ_INLINE void PoolAllocation::DeAllocate(void* ptr) { - page = &bucket.m_pages.front(); + PageType* page = m_allocator->PageFromAddress(ptr); + if (page == nullptr) + { + AZ_Error("Memory", false, "Address 0x%08x is not in the ThreadPool!", ptr); + return; + } - // check if we have free slot in the page - if (page->m_freeList.empty()) + // (pageSize - info struct at the end) / (element size) + size_t maxElementsPerBucket = page->m_maxNumElements; + + size_t numFreeNodes = page->m_freeList.size(); + typename PageType::FakeNode* node = new (ptr) typename PageType::FakeNode(); + page->m_freeList.push_front(*node); + + if (numFreeNodes == 0) { - page = nullptr; + // if the page was full before sort at the front + BucketType& bucket = m_buckets[page->m_bin]; + bucket.m_pages.erase(*page); + bucket.m_pages.push_front(*page); } - else if (page->m_freeList.size()==1) + else if (numFreeNodes == maxElementsPerBucket - 1) { - // if we have only 1 free slot this allocation will - // fill the page, so put in on the back - bucket.m_pages.pop_front(); - bucket.m_pages.push_back(*page); + // push to the list of free pages + BucketType& bucket = m_buckets[page->m_bin]; + PageType* frontPage = &bucket.m_pages.front(); + if (frontPage != page) + { + bucket.m_pages.erase(*page); + // check if the front page is full if so push the free page to the front otherwise push + // push it on the free pages list so it can be reused by other bins. + if (frontPage->m_freeList.empty()) + { + bucket.m_pages.push_front(*page); + } + else + { + m_allocator->PushFreePage(page); + } + } + else if (frontPage->m_next != nullptr) + { + // if the next page has free slots free the current page + if (frontPage->m_next->m_freeList.size() < maxElementsPerBucket) + { + bucket.m_pages.erase(*page); + m_allocator->PushFreePage(page); + } + } } + + m_numBytesAllocated -= page->m_elementSize; } - if (!page) + + //========================================================================= + // AllocationSize + // [11/22/2010] + //========================================================================= + template + AZ_INLINE size_t PoolAllocation::AllocationSize(void* ptr) { - page = m_allocator->PopFreePage(); + PageType* page = m_allocator->PageFromAddress(ptr); + size_t elementSize; if (page) { - // We have any pages available on free page stack. - if (page->m_bin != bucketIndex) // if this page was used the same bucket we are ready to roll. + elementSize = page->m_elementSize; + } + else + { + elementSize = 0; + } + + return elementSize; + } + + //========================================================================= + // GarbageCollect + // [3/1/2012] + //========================================================================= + template + AZ_INLINE void PoolAllocation::GarbageCollect(bool isForceFreeAllPages) + { + // Free empty pages in the buckets (or better be empty) + for (unsigned int i = 0; i < (unsigned int)m_numBuckets; ++i) + { + // (pageSize - info struct at the end) / (element size) + size_t maxElementsPerBucket = (m_pageSize - sizeof(PageType)) / ((i + 1) << m_minAllocationShift); + + typename BucketType::PageListType& pages = m_buckets[i].m_pages; + while (!pages.empty()) { - size_t elementSize = byteSize; - size_t pageDataSize = m_pageSize - sizeof(PageType); - page->SetupFreeList(elementSize, pageDataSize); - page->m_bin = bucketIndex; - page->m_elementSize = static_cast(elementSize); - page->m_maxNumElements = static_cast(pageDataSize / elementSize); + PageType& page = pages.front(); + pages.pop_front(); + if (page.m_freeList.size() == maxElementsPerBucket || isForceFreeAllPages) + { + if (!m_allocator->IsInStaticBlock(&page)) + { + m_allocator->FreePage(&page); + } + else + { + m_allocator->PushFreePage(&page); + } + } } } - else + } + + ////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////// + // PollAllocator + ////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////// + + //========================================================================= + // PoolSchema + // [9/15/2009] + //========================================================================= + PoolSchema::PoolSchema(const Descriptor& desc) + : m_impl(nullptr) + { + (void)desc; // ignored here, applied in Create() + } + + //========================================================================= + // ~PoolSchema + // [9/15/2009] + //========================================================================= + PoolSchema::~PoolSchema() + { + AZ_Assert(m_impl == nullptr, "You did not destroy the pool schema!"); + delete m_impl; + } + + //========================================================================= + // Create + // [9/15/2009] + //========================================================================= + bool PoolSchema::Create(const Descriptor& desc) + { + AZ_Assert(m_impl == nullptr, "PoolSchema already created!"); + if (m_impl == nullptr) { - // We need to align each page on it's size, this way we can quickly find which page the pointer belongs to. - page = m_allocator->ConstructPage(byteSize); - page->m_bin = bucketIndex; + m_impl = aznew PoolSchemaImpl(desc); } - bucket.m_pages.push_front(*page); + return (m_impl != nullptr); } - // The data address and the fake node address are shared. - void* address = &page->m_freeList.front(); - page->m_freeList.pop_front(); + //========================================================================= + // ~Destroy + // [9/15/2009] + //========================================================================= + bool PoolSchema::Destroy() + { + delete m_impl; + m_impl = nullptr; + return true; + } - m_numBytesAllocated += byteSize; + //========================================================================= + // Allocate + // [9/15/2009] + //========================================================================= + PoolSchema::pointer_type PoolSchema::Allocate( + size_type byteSize, + size_type alignment, + int flags, + const char* name, + const char* fileName, + int lineNum, + unsigned int suppressStackRecord) + { + (void)flags; + (void)name; + (void)fileName; + (void)lineNum; + (void)suppressStackRecord; + return m_impl->Allocate(byteSize, alignment); + } - return address; -} + //========================================================================= + // DeAllocate + // [9/15/2009] + //========================================================================= + void PoolSchema::DeAllocate(pointer_type ptr, size_type byteSize, size_type alignment) + { + (void)byteSize; + (void)alignment; + m_impl->DeAllocate(ptr); + } -//========================================================================= -// DeAllocate -// [9/09/2009] -//========================================================================= -template -AZ_INLINE void -PoolAllocation::DeAllocate(void* ptr) -{ - PageType* page = m_allocator->PageFromAddress(ptr); - if (page==nullptr) + //========================================================================= + // Resize + // [10/14/2018] + //========================================================================= + PoolSchema::size_type PoolSchema::Resize(pointer_type ptr, size_type newSize) { - AZ_Error("Memory", false, "Address 0x%08x is not in the ThreadPool!", ptr); - return; + (void)ptr; + (void)newSize; + return 0; // unsupported } - // (pageSize - info struct at the end) / (element size) - size_t maxElementsPerBucket = page->m_maxNumElements; + //========================================================================= + // ReAllocate + // [10/14/2018] + //========================================================================= + PoolSchema::pointer_type PoolSchema::ReAllocate(pointer_type ptr, size_type newSize, size_type newAlignment) + { + (void)ptr; + (void)newSize; + (void)newAlignment; + AZ_Assert(false, "unsupported"); - size_t numFreeNodes = page->m_freeList.size(); - typename PageType::FakeNode* node = new(ptr) typename PageType::FakeNode(); - page->m_freeList.push_front(*node); + return ptr; + } - if (numFreeNodes==0) + //========================================================================= + // AllocationSize + // [11/22/2010] + //========================================================================= + PoolSchema::size_type PoolSchema::AllocationSize(pointer_type ptr) { - // if the page was full before sort at the front - BucketType& bucket = m_buckets[page->m_bin]; - bucket.m_pages.erase(*page); - bucket.m_pages.push_front(*page); + return m_impl->AllocationSize(ptr); } - else if (numFreeNodes == maxElementsPerBucket-1) + + //========================================================================= + // DeAllocate + // [9/15/2009] + //========================================================================= + void PoolSchema::GarbageCollect() { - // push to the list of free pages - BucketType& bucket = m_buckets[page->m_bin]; - PageType* frontPage = &bucket.m_pages.front(); - if (frontPage != page) + // External requests for garbage collection may come from any thread, and the + // garbage collection operation isn't threadsafe, which can lead to crashes. + // + // Due to the low memory consumption of this allocator in practice on Dragonfly + // (~3kb) it makes sense to not bother with garbage collection and leave it to + // occur exclusively in the destruction of the allocator. + // + // TODO: A better solution needs to be found for integrating back into mainline + // Open 3D Engine. + // m_impl->GarbageCollect(); + } + + auto PoolSchema::GetMaxContiguousAllocationSize() const -> size_type + { + return m_impl->m_allocator.m_maxAllocationSize; + } + + //========================================================================= + // NumAllocatedBytes + // [11/1/2010] + //========================================================================= + PoolSchema::size_type PoolSchema::NumAllocatedBytes() const + { + return m_impl->m_allocator.m_numBytesAllocated; + } + + //========================================================================= + // Capacity + // [11/1/2010] + //========================================================================= + PoolSchema::size_type PoolSchema::Capacity() const + { + return m_impl->m_numStaticPages * m_impl->m_pageSize; + } + + //========================================================================= + // GetPageAllocator + // [11/17/2010] + //========================================================================= + IAllocatorAllocate* PoolSchema::GetSubAllocator() + { + return m_impl->m_pageAllocator; + } + + ////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////// + // PollAllocator Implementation + ////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////// + + //========================================================================= + // PoolSchemaImpl + // [9/15/2009] + //========================================================================= + PoolSchemaImpl::PoolSchemaImpl(const PoolSchema::Descriptor& desc) + : m_pageAllocator(desc.m_pageAllocator ? desc.m_pageAllocator : &AllocatorInstance::Get()) + , m_allocator(this, desc.m_pageSize, desc.m_minAllocationSize, desc.m_maxAllocationSize) + , m_staticDataBlock(nullptr) + , m_numStaticPages(desc.m_numStaticPages) + , m_isDynamic(desc.m_isDynamic) + , m_pageSize(desc.m_pageSize) + { + if (m_numStaticPages) { - bucket.m_pages.erase(*page); - // check if the front page is full if so push the free page to the front otherwise push - // push it on the free pages list so it can be reused by other bins. - if (frontPage->m_freeList.empty()) - { - bucket.m_pages.push_front(*page); - } - else + // We store the page struct at the end of the block + char* memBlock = reinterpret_cast(m_pageAllocator->Allocate( + m_pageSize * m_numStaticPages, m_pageSize, 0, "AZSystem::PoolAllocation::Page static array", __FILE__, __LINE__)); + m_staticDataBlock = memBlock; + size_t pageDataSize = m_pageSize - sizeof(Page); + for (unsigned int i = 0; i < m_numStaticPages; ++i) { - m_allocator->PushFreePage(page); + Page* page = new (memBlock + pageDataSize) Page(); + page->m_bin = 0xffffffff; + page->m_elementSize = 0; + page->m_maxNumElements = 0; + PushFreePage(page); + memBlock += m_pageSize; } } - else if (frontPage->m_next != nullptr) + } + + //========================================================================= + // ~PoolSchemaImpl + // [9/15/2009] + //========================================================================= + PoolSchemaImpl::~PoolSchemaImpl() + { + // Force free all pages + m_allocator.GarbageCollect(true); + + // Free all unused memory + GarbageCollect(); + + if (m_staticDataBlock) { - // if the next page has free slots free the current page - if (frontPage->m_next->m_freeList.size() < maxElementsPerBucket) + while (!m_freePages.empty()) { - bucket.m_pages.erase(*page); - m_allocator->PushFreePage(page); + Page* page = &m_freePages.front(); + (void)page; + m_freePages.pop_front(); + AZ_Assert(IsInStaticBlock(page), "All dynamic pages should be deleted by now!"); + }; + + char* memBlock = reinterpret_cast(m_staticDataBlock); + size_t pageDataSize = m_pageSize - sizeof(Page); + for (unsigned int i = 0; i < m_numStaticPages; ++i) + { + Page* page = reinterpret_cast(memBlock + pageDataSize); + page->~Page(); + memBlock += m_pageSize; } + m_pageAllocator->DeAllocate(m_staticDataBlock); } } - m_numBytesAllocated -= page->m_elementSize; -} + //========================================================================= + // Allocate + // [9/15/2009] + //========================================================================= + PoolSchema::pointer_type PoolSchemaImpl::Allocate(PoolSchema::size_type byteSize, PoolSchema::size_type alignment, int flags) + { + // AZ_Warning("Memory",m_ownerThread==AZStd::this_thread::get_id(),"You can't allocation from a different context/thread, use + // ThreadPoolAllocator!"); + (void)flags; + void* address = m_allocator.Allocate(byteSize, alignment); + return address; + } -//========================================================================= -// AllocationSize -// [11/22/2010] -//========================================================================= -template -AZ_INLINE size_t -PoolAllocation::AllocationSize(void* ptr) -{ - PageType* page = m_allocator->PageFromAddress(ptr); - size_t elementSize; - if (page) + //========================================================================= + // DeAllocate + // [9/15/2009] + //========================================================================= + void PoolSchemaImpl::DeAllocate(PoolSchema::pointer_type ptr) { - elementSize = page->m_elementSize; + // AZ_Warning("Memory",m_ownerThread==AZStd::this_thread::get_id(),"You can't deallocate from a different context/thread, use + // ThreadPoolAllocator!"); + m_allocator.DeAllocate(ptr); } - else + + //========================================================================= + // AllocationSize + // [11/22/2010] + //========================================================================= + PoolSchema::size_type PoolSchemaImpl::AllocationSize(PoolSchema::pointer_type ptr) { - elementSize = 0; + // AZ_Warning("Memory",m_ownerThread==AZStd::this_thread::get_id(),"You can't use PoolAllocator from a different context/thread, use + // ThreadPoolAllocator!"); + return m_allocator.AllocationSize(ptr); } - return elementSize; -} + //========================================================================= + // Pop + // [9/15/2009] + //========================================================================= + AZ_FORCE_INLINE PoolSchemaImpl::Page* PoolSchemaImpl::PopFreePage() + { + Page* page = nullptr; + if (!m_freePages.empty()) + { + page = &m_freePages.front(); + m_freePages.pop_front(); + } + return page; + } -//========================================================================= -// GarbageCollect -// [3/1/2012] -//========================================================================= -template -AZ_INLINE void -PoolAllocation::GarbageCollect(bool isForceFreeAllPages) -{ - // Free empty pages in the buckets (or better be empty) - for (unsigned int i = 0; i < (unsigned int)m_numBuckets; ++i) + //========================================================================= + // Push + // [9/15/2009] + //========================================================================= + AZ_INLINE void PoolSchemaImpl::PushFreePage(Page* page) { - // (pageSize - info struct at the end) / (element size) - size_t maxElementsPerBucket = (m_pageSize - sizeof(PageType)) / ((i+1) << m_minAllocationShift); + m_freePages.push_front(*page); + } - typename BucketType::PageListType& pages = m_buckets[i].m_pages; - while (!pages.empty()) + //========================================================================= + // PurgePages + // [9/11/2009] + //========================================================================= + void PoolSchemaImpl::GarbageCollect() + { + // if( m_ownerThread == AZStd::this_thread::get_id() ) { - PageType& page = pages.front(); - pages.pop_front(); - if (page.m_freeList.size()==maxElementsPerBucket || isForceFreeAllPages) + if (m_isDynamic) { - if (!m_allocator->IsInStaticBlock(&page)) + m_allocator.GarbageCollect(); + + Bucket::PageListType staticPages; + while (!m_freePages.empty()) { - m_allocator->FreePage(&page); + Page* page = &m_freePages.front(); + m_freePages.pop_front(); + if (IsInStaticBlock(page)) + { + staticPages.push_front(*page); + } + else + { + FreePage(page); + } } - else + + while (!staticPages.empty()) { - m_allocator->PushFreePage(&page); + Page* page = &staticPages.front(); + staticPages.pop_front(); + m_freePages.push_front(*page); } } } } -} - -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// -// PollAllocator -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// - -//========================================================================= -// PoolSchema -// [9/15/2009] -//========================================================================= -PoolSchema::PoolSchema(const Descriptor& desc) - : m_impl(nullptr) -{ - (void)desc; // ignored here, applied in Create() -} - -//========================================================================= -// ~PoolSchema -// [9/15/2009] -//========================================================================= -PoolSchema::~PoolSchema() -{ - AZ_Assert(m_impl==nullptr, "You did not destroy the pool schema!"); - delete m_impl; -} - -//========================================================================= -// Create -// [9/15/2009] -//========================================================================= -bool PoolSchema::Create(const Descriptor& desc) -{ - AZ_Assert(m_impl==nullptr, "PoolSchema already created!"); - if (m_impl == nullptr) - { - m_impl = aznew PoolSchemaImpl(desc); - } - return (m_impl!=nullptr); -} - -//========================================================================= -// ~Destroy -// [9/15/2009] -//========================================================================= -bool PoolSchema::Destroy() -{ - delete m_impl; - m_impl = nullptr; - return true; -} - -//========================================================================= -// Allocate -// [9/15/2009] -//========================================================================= -PoolSchema::pointer_type -PoolSchema::Allocate(size_type byteSize, size_type alignment, int flags, const char* name, const char* fileName, int lineNum, unsigned int suppressStackRecord) -{ - (void)flags; - (void)name; - (void)fileName; - (void)lineNum; - (void)suppressStackRecord; - return m_impl->Allocate(byteSize, alignment); -} - -//========================================================================= -// DeAllocate -// [9/15/2009] -//========================================================================= -void -PoolSchema::DeAllocate(pointer_type ptr, size_type byteSize, size_type alignment) -{ - (void)byteSize; - (void)alignment; - m_impl->DeAllocate(ptr); -} - -//========================================================================= -// Resize -// [10/14/2018] -//========================================================================= -PoolSchema::size_type -PoolSchema::Resize(pointer_type ptr, size_type newSize) -{ - (void)ptr; - (void)newSize; - return 0; // unsupported -} - -//========================================================================= -// ReAllocate -// [10/14/2018] -//========================================================================= -PoolSchema::pointer_type -PoolSchema::ReAllocate(pointer_type ptr, size_type newSize, size_type newAlignment) -{ - (void)ptr; - (void)newSize; - (void)newAlignment; - AZ_Assert(false, "unsupported"); - - return ptr; -} - -//========================================================================= -// AllocationSize -// [11/22/2010] -//========================================================================= -PoolSchema::size_type -PoolSchema::AllocationSize(pointer_type ptr) -{ - return m_impl->AllocationSize(ptr); -} - -//========================================================================= -// DeAllocate -// [9/15/2009] -//========================================================================= -void -PoolSchema::GarbageCollect() -{ - // External requests for garbage collection may come from any thread, and the - // garbage collection operation isn't threadsafe, which can lead to crashes. - // - // Due to the low memory consumption of this allocator in practice on Dragonfly - // (~3kb) it makes sense to not bother with garbage collection and leave it to - // occur exclusively in the destruction of the allocator. - // - // TODO: A better solution needs to be found for integrating back into mainline - // Open 3D Engine. - //m_impl->GarbageCollect(); -} - -auto PoolSchema::GetMaxContiguousAllocationSize() const -> size_type -{ - return m_impl->m_allocator.m_maxAllocationSize; -} - -//========================================================================= -// NumAllocatedBytes -// [11/1/2010] -//========================================================================= -PoolSchema::size_type -PoolSchema::NumAllocatedBytes() const -{ - return m_impl->m_allocator.m_numBytesAllocated; -} - -//========================================================================= -// Capacity -// [11/1/2010] -//========================================================================= -PoolSchema::size_type -PoolSchema::Capacity() const -{ - return m_impl->m_numStaticPages * m_impl->m_pageSize; -} - -//========================================================================= -// GetPageAllocator -// [11/17/2010] -//========================================================================= -IAllocatorAllocate* -PoolSchema::GetSubAllocator() -{ - return m_impl->m_pageAllocator; -} - - -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// -// PollAllocator Implementation -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// - -//========================================================================= -// PoolSchemaImpl -// [9/15/2009] -//========================================================================= -PoolSchemaImpl::PoolSchemaImpl(const PoolSchema::Descriptor& desc) - : m_pageAllocator(desc.m_pageAllocator ? desc.m_pageAllocator : &AllocatorInstance::Get()) - , m_allocator(this, desc.m_pageSize, desc.m_minAllocationSize, desc.m_maxAllocationSize) - , m_staticDataBlock(nullptr) - , m_numStaticPages(desc.m_numStaticPages) - , m_isDynamic(desc.m_isDynamic) - , m_pageSize(desc.m_pageSize) -{ - if (m_numStaticPages) + + //========================================================================= + // SetupFreeList + // [9/09/2009] + //========================================================================= + AZ_FORCE_INLINE void PoolSchemaImpl::Page::SetupFreeList(size_t elementSize, size_t pageDataBlockSize) { - // We store the page struct at the end of the block - char* memBlock = reinterpret_cast(m_pageAllocator->Allocate(m_pageSize*m_numStaticPages, m_pageSize, 0, "AZSystem::PoolAllocation::Page static array", __FILE__, __LINE__)); - m_staticDataBlock = memBlock; - size_t pageDataSize = m_pageSize - sizeof(Page); - for (unsigned int i = 0; i < m_numStaticPages; ++i) + char* pageData = reinterpret_cast(this) - pageDataBlockSize; + m_freeList.clear(); + // setup free list + size_t numElements = pageDataBlockSize / elementSize; + for (unsigned int i = 0; i < numElements; ++i) { - Page* page = new(memBlock+pageDataSize)Page(); - page->m_bin = 0xffffffff; - page->m_elementSize = 0; - page->m_maxNumElements = 0; - PushFreePage(page); - memBlock += m_pageSize; + char* address = pageData + i * elementSize; + Page::FakeNode* node = new (address) Page::FakeNode(); + m_freeList.push_back(*node); } } -} -//========================================================================= -// ~PoolSchemaImpl -// [9/15/2009] -//========================================================================= -PoolSchemaImpl::~PoolSchemaImpl() -{ - // Force free all pages - m_allocator.GarbageCollect(true); + ////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////// + // ThreadPoolSchema + ////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////// - // Free all unused memory - GarbageCollect(); + //========================================================================= + // ThreadPoolSchema + // [9/15/2009] + //========================================================================= + ThreadPoolSchema::ThreadPoolSchema(GetThreadPoolData getThreadPoolData, SetThreadPoolData setThreadPoolData) + : m_impl(nullptr) + , m_threadPoolGetter(getThreadPoolData) + , m_threadPoolSetter(setThreadPoolData) + { + } - if (m_staticDataBlock) + //========================================================================= + // ~ThreadPoolSchema + // [9/15/2009] + //========================================================================= + ThreadPoolSchema::~ThreadPoolSchema() { - while (!m_freePages.empty()) - { - Page* page = &m_freePages.front(); - (void)page; - m_freePages.pop_front(); - AZ_Assert(IsInStaticBlock(page), "All dynamic pages should be deleted by now!"); - } - ; + AZ_Assert(m_impl == nullptr, "You did not destroy the thread pool schema!"); + delete m_impl; + } - char* memBlock = reinterpret_cast(m_staticDataBlock); - size_t pageDataSize = m_pageSize - sizeof(Page); - for (unsigned int i = 0; i < m_numStaticPages; ++i) + //========================================================================= + // Create + // [9/15/2009] + //========================================================================= + bool ThreadPoolSchema::Create(const Descriptor& desc) + { + AZ_Assert(m_impl == nullptr, "PoolSchema already created!"); + if (m_impl == nullptr) { - Page* page = reinterpret_cast(memBlock+pageDataSize); - page->~Page(); - memBlock += m_pageSize; + m_impl = aznew ThreadPoolSchemaImpl(desc, m_threadPoolGetter, m_threadPoolSetter); } - m_pageAllocator->DeAllocate(m_staticDataBlock); + return (m_impl != nullptr); } -} - -//========================================================================= -// Allocate -// [9/15/2009] -//========================================================================= -PoolSchema::pointer_type -PoolSchemaImpl::Allocate(PoolSchema::size_type byteSize, PoolSchema::size_type alignment, int flags) -{ - //AZ_Warning("Memory",m_ownerThread==AZStd::this_thread::get_id(),"You can't allocation from a different context/thread, use ThreadPoolAllocator!"); - (void)flags; - void* address = m_allocator.Allocate(byteSize, alignment); - return address; -} - -//========================================================================= -// DeAllocate -// [9/15/2009] -//========================================================================= -void -PoolSchemaImpl::DeAllocate(PoolSchema::pointer_type ptr) -{ - //AZ_Warning("Memory",m_ownerThread==AZStd::this_thread::get_id(),"You can't deallocate from a different context/thread, use ThreadPoolAllocator!"); - m_allocator.DeAllocate(ptr); -} - -//========================================================================= -// AllocationSize -// [11/22/2010] -//========================================================================= -PoolSchema::size_type -PoolSchemaImpl::AllocationSize(PoolSchema::pointer_type ptr) -{ - //AZ_Warning("Memory",m_ownerThread==AZStd::this_thread::get_id(),"You can't use PoolAllocator from a different context/thread, use ThreadPoolAllocator!"); - return m_allocator.AllocationSize(ptr); -} - -//========================================================================= -// Pop -// [9/15/2009] -//========================================================================= -AZ_FORCE_INLINE PoolSchemaImpl::Page* -PoolSchemaImpl::PopFreePage() -{ - Page* page = nullptr; - if (!m_freePages.empty()) + + //========================================================================= + // Destroy + // [9/15/2009] + //========================================================================= + bool ThreadPoolSchema::Destroy() { - page = &m_freePages.front(); - m_freePages.pop_front(); + delete m_impl; + m_impl = nullptr; + return true; } - return page; -} - -//========================================================================= -// Push -// [9/15/2009] -//========================================================================= -AZ_INLINE void -PoolSchemaImpl::PushFreePage(Page* page) -{ - m_freePages.push_front(*page); -} - -//========================================================================= -// PurgePages -// [9/11/2009] -//========================================================================= -void -PoolSchemaImpl::GarbageCollect() -{ - //if( m_ownerThread == AZStd::this_thread::get_id() ) + //========================================================================= + // Allocate + // [9/15/2009] + //========================================================================= + ThreadPoolSchema::pointer_type ThreadPoolSchema::Allocate( + size_type byteSize, + size_type alignment, + int flags, + const char* name, + const char* fileName, + int lineNum, + unsigned int suppressStackRecord) { - if (m_isDynamic) - { - m_allocator.GarbageCollect(); + (void)flags; + (void)name; + (void)fileName; + (void)lineNum; + (void)suppressStackRecord; + return m_impl->Allocate(byteSize, alignment); + } - Bucket::PageListType staticPages; - while (!m_freePages.empty()) - { - Page* page = &m_freePages.front(); - m_freePages.pop_front(); - if (IsInStaticBlock(page)) - { - staticPages.push_front(*page); - } - else - { - FreePage(page); - } - } + //========================================================================= + // DeAllocate + // [9/15/2009] + //========================================================================= + void ThreadPoolSchema::DeAllocate(pointer_type ptr, size_type byteSize, size_type alignment) + { + (void)byteSize; + (void)alignment; + m_impl->DeAllocate(ptr); + } - while (!staticPages.empty()) - { - Page* page = &staticPages.front(); - staticPages.pop_front(); - m_freePages.push_front(*page); - } - } + //========================================================================= + // Resize + // [10/14/2018] + //========================================================================= + ThreadPoolSchema::size_type ThreadPoolSchema::Resize(pointer_type ptr, size_type newSize) + { + (void)ptr; + (void)newSize; + return 0; // unsupported } -} - -//========================================================================= -// SetupFreeList -// [9/09/2009] -//========================================================================= -AZ_FORCE_INLINE void -PoolSchemaImpl::Page::SetupFreeList(size_t elementSize, size_t pageDataBlockSize) -{ - char* pageData = reinterpret_cast(this) - pageDataBlockSize; - m_freeList.clear(); - // setup free list - size_t numElements = pageDataBlockSize / elementSize; - for (unsigned int i = 0; i < numElements; ++i) + + //========================================================================= + // ReAllocate + // [10/14/2018] + //========================================================================= + ThreadPoolSchema::pointer_type ThreadPoolSchema::ReAllocate(pointer_type ptr, size_type newSize, size_type newAlignment) { - char* address = pageData+i*elementSize; - Page::FakeNode* node = new(address) Page::FakeNode(); - m_freeList.push_back(*node); + (void)ptr; + (void)newSize; + (void)newAlignment; + AZ_Assert(false, "unsupported"); + + return ptr; } -} - -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// -// ThreadPoolSchema -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// - -//========================================================================= -// ThreadPoolSchema -// [9/15/2009] -//========================================================================= -ThreadPoolSchema::ThreadPoolSchema(GetThreadPoolData getThreadPoolData, SetThreadPoolData setThreadPoolData) - : m_impl(nullptr) - , m_threadPoolGetter(getThreadPoolData) - , m_threadPoolSetter(setThreadPoolData) -{ -} -//========================================================================= -// ~ThreadPoolSchema -// [9/15/2009] -//========================================================================= -ThreadPoolSchema::~ThreadPoolSchema() -{ - AZ_Assert(m_impl==nullptr, "You did not destroy the thread pool schema!"); - delete m_impl; -} - -//========================================================================= -// Create -// [9/15/2009] -//========================================================================= -bool ThreadPoolSchema::Create(const Descriptor& desc) -{ - AZ_Assert(m_impl==nullptr, "PoolSchema already created!"); - if (m_impl == nullptr) + //========================================================================= + // AllocationSize + // [11/22/2010] + //========================================================================= + ThreadPoolSchema::size_type ThreadPoolSchema::AllocationSize(pointer_type ptr) { - m_impl = aznew ThreadPoolSchemaImpl(desc, m_threadPoolGetter, m_threadPoolSetter); + return m_impl->AllocationSize(ptr); } - return (m_impl!=nullptr); -} - -//========================================================================= -// Destroy -// [9/15/2009] -//========================================================================= -bool ThreadPoolSchema::Destroy() -{ - delete m_impl; - m_impl = nullptr; - return true; -} -//========================================================================= -// Allocate -// [9/15/2009] -//========================================================================= -ThreadPoolSchema::pointer_type -ThreadPoolSchema::Allocate(size_type byteSize, size_type alignment, int flags, const char* name, const char* fileName, int lineNum, unsigned int suppressStackRecord) -{ - (void)flags; - (void)name; - (void)fileName; - (void)lineNum; - (void)suppressStackRecord; - return m_impl->Allocate(byteSize, alignment); -} - -//========================================================================= -// DeAllocate -// [9/15/2009] -//========================================================================= -void -ThreadPoolSchema::DeAllocate(pointer_type ptr, size_type byteSize, size_type alignment) -{ - (void)byteSize; - (void)alignment; - m_impl->DeAllocate(ptr); -} - -//========================================================================= -// Resize -// [10/14/2018] -//========================================================================= -ThreadPoolSchema::size_type -ThreadPoolSchema::Resize(pointer_type ptr, size_type newSize) -{ - (void)ptr; - (void)newSize; - return 0; // unsupported -} - -//========================================================================= -// ReAllocate -// [10/14/2018] -//========================================================================= -ThreadPoolSchema::pointer_type -ThreadPoolSchema::ReAllocate(pointer_type ptr, size_type newSize, size_type newAlignment) -{ - (void)ptr; - (void)newSize; - (void)newAlignment; - AZ_Assert(false, "unsupported"); - - return ptr; -} - -//========================================================================= -// AllocationSize -// [11/22/2010] -//========================================================================= -ThreadPoolSchema::size_type -ThreadPoolSchema::AllocationSize(pointer_type ptr) -{ - return m_impl->AllocationSize(ptr); -} - -//========================================================================= -// DeAllocate -// [9/15/2009] -//========================================================================= -void -ThreadPoolSchema::GarbageCollect() -{ - m_impl->GarbageCollect(); -} -auto ThreadPoolSchema::GetMaxContiguousAllocationSize() const -> size_type -{ - return m_impl->m_maxAllocationSize; -} - -//========================================================================= -// NumAllocatedBytes -// [11/1/2010] -//========================================================================= -ThreadPoolSchema::size_type -ThreadPoolSchema::NumAllocatedBytes() const -{ - size_type bytesAllocated = 0; + //========================================================================= + // DeAllocate + // [9/15/2009] + //========================================================================= + void ThreadPoolSchema::GarbageCollect() { - AZStd::lock_guard lock(m_impl->m_mutex); - for (size_t i = 0; i < m_impl->m_threads.size(); ++i) - { - bytesAllocated += m_impl->m_threads[i]->m_allocator.m_numBytesAllocated; - } + m_impl->GarbageCollect(); } - return bytesAllocated; -} - -//========================================================================= -// Capacity -// [11/1/2010] -//========================================================================= -ThreadPoolSchema::size_type -ThreadPoolSchema::Capacity() const -{ - return m_impl->m_numStaticPages * m_impl->m_pageSize; -} - -//========================================================================= -// GetPageAllocator -// [11/17/2010] -//========================================================================= -IAllocatorAllocate* -ThreadPoolSchema::GetSubAllocator() -{ - return m_impl->m_pageAllocator; -} - - -//========================================================================= -// ThreadPoolSchemaImpl -// [9/15/2009] -//========================================================================= -ThreadPoolSchemaImpl::ThreadPoolSchemaImpl(const ThreadPoolSchema::Descriptor& desc, ThreadPoolSchema::GetThreadPoolData threadPoolGetter, ThreadPoolSchema::SetThreadPoolData threadPoolSetter) - : m_threadPoolGetter(threadPoolGetter) - , m_threadPoolSetter(threadPoolSetter) - , m_pageAllocator(desc.m_pageAllocator) - , m_staticDataBlock(nullptr) - , m_numStaticPages(desc.m_numStaticPages) - , m_pageSize(desc.m_pageSize) - , m_minAllocationSize(desc.m_minAllocationSize) - , m_maxAllocationSize(desc.m_maxAllocationSize) - , m_isDynamic(desc.m_isDynamic) -{ -# if AZ_TRAIT_OS_HAS_CRITICAL_SECTION_SPIN_COUNT - // In memory allocation case (usually tools) we might have high contention, - // using spin lock will improve performance. - SetCriticalSectionSpinCount(m_mutex.native_handle(), 4000); -# endif - if (m_pageAllocator == nullptr) + auto ThreadPoolSchema::GetMaxContiguousAllocationSize() const -> size_type { - m_pageAllocator = &AllocatorInstance::Get(); // use the SystemAllocator if no page allocator is provided + return m_impl->m_maxAllocationSize; } - if (m_numStaticPages) + + //========================================================================= + // NumAllocatedBytes + // [11/1/2010] + //========================================================================= + ThreadPoolSchema::size_type ThreadPoolSchema::NumAllocatedBytes() const { - // We store the page struct at the end of the block - char* memBlock = reinterpret_cast(m_pageAllocator->Allocate(m_pageSize*m_numStaticPages, m_pageSize, 0, "AZSystem::ThreadPoolSchemaImpl::Page static array", __FILE__, __LINE__)); - m_staticDataBlock = memBlock; - size_t pageDataSize = m_pageSize - sizeof(Page); - for (unsigned int i = 0; i < m_numStaticPages; ++i) + size_type bytesAllocated = 0; { - Page* page = new(memBlock+pageDataSize)Page(m_threadPoolGetter()); - page->m_bin = 0xffffffff; - PushFreePage(page); - memBlock += m_pageSize; + AZStd::lock_guard lock(m_impl->m_mutex); + for (size_t i = 0; i < m_impl->m_threads.size(); ++i) + { + bytesAllocated += m_impl->m_threads[i]->m_allocator.m_numBytesAllocated; + } } + return bytesAllocated; } -} -//========================================================================= -// ~ThreadPoolSchemaImpl -// [9/15/2009] -//========================================================================= -ThreadPoolSchemaImpl::~ThreadPoolSchemaImpl() -{ - // clean up all the thread data. - // IMPORTANT: We assume/rely that all threads (except the calling one) are or will - // destroyed before you create another instance of the pool allocation. - // This should generally be ok since the all allocators are singletons. + //========================================================================= + // Capacity + // [11/1/2010] + //========================================================================= + ThreadPoolSchema::size_type ThreadPoolSchema::Capacity() const { - AZStd::lock_guard lock(m_mutex); - if (!m_threads.empty()) + return m_impl->m_numStaticPages * m_impl->m_pageSize; + } + + //========================================================================= + // GetPageAllocator + // [11/17/2010] + //========================================================================= + IAllocatorAllocate* ThreadPoolSchema::GetSubAllocator() + { + return m_impl->m_pageAllocator; + } + + //========================================================================= + // ThreadPoolSchemaImpl + // [9/15/2009] + //========================================================================= + ThreadPoolSchemaImpl::ThreadPoolSchemaImpl( + const ThreadPoolSchema::Descriptor& desc, + ThreadPoolSchema::GetThreadPoolData threadPoolGetter, + ThreadPoolSchema::SetThreadPoolData threadPoolSetter) + : m_threadPoolGetter(threadPoolGetter) + , m_threadPoolSetter(threadPoolSetter) + , m_pageAllocator(desc.m_pageAllocator) + , m_staticDataBlock(nullptr) + , m_numStaticPages(desc.m_numStaticPages) + , m_pageSize(desc.m_pageSize) + , m_minAllocationSize(desc.m_minAllocationSize) + , m_maxAllocationSize(desc.m_maxAllocationSize) + , m_isDynamic(desc.m_isDynamic) + { +#if AZ_TRAIT_OS_HAS_CRITICAL_SECTION_SPIN_COUNT + // In memory allocation case (usually tools) we might have high contention, + // using spin lock will improve performance. + SetCriticalSectionSpinCount(m_mutex.native_handle(), 4000); +#endif + + if (m_pageAllocator == nullptr) { - for (size_t i = 0; i < m_threads.size(); ++i) + m_pageAllocator = &AllocatorInstance::Get(); // use the SystemAllocator if no page allocator is provided + } + if (m_numStaticPages) + { + // We store the page struct at the end of the block + char* memBlock = reinterpret_cast(m_pageAllocator->Allocate( + m_pageSize * m_numStaticPages, m_pageSize, 0, "AZSystem::ThreadPoolSchemaImpl::Page static array", __FILE__, __LINE__)); + m_staticDataBlock = memBlock; + size_t pageDataSize = m_pageSize - sizeof(Page); + for (unsigned int i = 0; i < m_numStaticPages; ++i) { - if (m_threads[i]) - { - // Force free all pages - delete m_threads[i]; - } + Page* page = new (memBlock + pageDataSize) Page(m_threadPoolGetter()); + page->m_bin = 0xffffffff; + PushFreePage(page); + memBlock += m_pageSize; } - - /// reset the variable for the owner thread. - m_threadPoolSetter(nullptr); } } - GarbageCollect(); - - if (m_staticDataBlock) + //========================================================================= + // ~ThreadPoolSchemaImpl + // [9/15/2009] + //========================================================================= + ThreadPoolSchemaImpl::~ThreadPoolSchemaImpl() { - Page* page; + // clean up all the thread data. + // IMPORTANT: We assume/rely that all threads (except the calling one) are or will + // destroyed before you create another instance of the pool allocation. + // This should generally be ok since the all allocators are singletons. { AZStd::lock_guard lock(m_mutex); - while (!m_freePages.empty()) + if (!m_threads.empty()) { - page = &m_freePages.front(); - m_freePages.pop_front(); - AZ_Assert(IsInStaticBlock(page), "All dynamic pages should be free by now!"); + for (size_t i = 0; i < m_threads.size(); ++i) + { + if (m_threads[i]) + { + // Force free all pages + delete m_threads[i]; + } + } + + /// reset the variable for the owner thread. + m_threadPoolSetter(nullptr); } } - char* memBlock = reinterpret_cast(m_staticDataBlock); - size_t pageDataSize = m_pageSize - sizeof(Page); - for (unsigned int i = 0; i < m_numStaticPages; ++i) + GarbageCollect(); + + if (m_staticDataBlock) { - page = reinterpret_cast(memBlock+pageDataSize); - page->~Page(); - memBlock += m_pageSize; + Page* page; + { + AZStd::lock_guard lock(m_mutex); + while (!m_freePages.empty()) + { + page = &m_freePages.front(); + m_freePages.pop_front(); + AZ_Assert(IsInStaticBlock(page), "All dynamic pages should be free by now!"); + } + } + + char* memBlock = reinterpret_cast(m_staticDataBlock); + size_t pageDataSize = m_pageSize - sizeof(Page); + for (unsigned int i = 0; i < m_numStaticPages; ++i) + { + page = reinterpret_cast(memBlock + pageDataSize); + page->~Page(); + memBlock += m_pageSize; + } + m_pageAllocator->DeAllocate(m_staticDataBlock); } - m_pageAllocator->DeAllocate(m_staticDataBlock); } -} - -//========================================================================= -// Allocate -// [9/15/2009] -//========================================================================= -ThreadPoolSchema::pointer_type -ThreadPoolSchemaImpl::Allocate(ThreadPoolSchema::size_type byteSize, ThreadPoolSchema::size_type alignment, int flags) -{ - (void)flags; - - ThreadPoolData* threadData = m_threadPoolGetter(); - if (threadData == nullptr) + //========================================================================= + // Allocate + // [9/15/2009] + //========================================================================= + ThreadPoolSchema::pointer_type ThreadPoolSchemaImpl::Allocate( + ThreadPoolSchema::size_type byteSize, ThreadPoolSchema::size_type alignment, int flags) { - threadData = aznew ThreadPoolData(this, m_pageSize, m_minAllocationSize, m_maxAllocationSize); - m_threadPoolSetter(threadData); + (void)flags; + + ThreadPoolData* threadData = m_threadPoolGetter(); + + if (threadData == nullptr) { - AZStd::lock_guard lock(m_mutex); - m_threads.push_back(threadData); + threadData = aznew ThreadPoolData(this, m_pageSize, m_minAllocationSize, m_maxAllocationSize); + m_threadPoolSetter(threadData); + { + AZStd::lock_guard lock(m_mutex); + m_threads.push_back(threadData); + } } - } - else - { - // deallocate elements if they were freed from other threads - Page::FakeNodeLF* fakeLFNode; - while ((fakeLFNode = threadData->m_freedElements.pop())!=nullptr) + else { - threadData->m_allocator.DeAllocate(fakeLFNode); + // deallocate elements if they were freed from other threads + Page::FakeNodeLF* fakeLFNode; + while ((fakeLFNode = threadData->m_freedElements.pop()) != nullptr) + { + threadData->m_allocator.DeAllocate(fakeLFNode); + } } - } - return threadData->m_allocator.Allocate(byteSize, alignment); -} - -//========================================================================= -// DeAllocate -// [9/15/2009] -//========================================================================= -void -ThreadPoolSchemaImpl::DeAllocate(ThreadPoolSchema::pointer_type ptr) -{ - Page* page = PageFromAddress(ptr); - if (page==nullptr) - { - AZ_Error("Memory", false, "Address 0x%08x is not in the ThreadPool!", ptr); - return; + return threadData->m_allocator.Allocate(byteSize, alignment); } - AZ_Assert(page->m_threadData!=nullptr, ("We must have valid page thread data for the page!")); - ThreadPoolData* threadData = m_threadPoolGetter(); - if (threadData == page->m_threadData) - { - // we can free here - threadData->m_allocator.DeAllocate(ptr); - } - else + + //========================================================================= + // DeAllocate + // [9/15/2009] + //========================================================================= + void ThreadPoolSchemaImpl::DeAllocate(ThreadPoolSchema::pointer_type ptr) { - // push this element to be deleted from it's own thread! - // cast the pointer to a fake lock free node - Page::FakeNodeLF* fakeLFNode = reinterpret_cast(ptr); + Page* page = PageFromAddress(ptr); + if (page == nullptr) + { + AZ_Error("Memory", false, "Address 0x%08x is not in the ThreadPool!", ptr); + return; + } + AZ_Assert(page->m_threadData != nullptr, ("We must have valid page thread data for the page!")); + ThreadPoolData* threadData = m_threadPoolGetter(); + if (threadData == page->m_threadData) + { + // we can free here + threadData->m_allocator.DeAllocate(ptr); + } + else + { + // push this element to be deleted from it's own thread! + // cast the pointer to a fake lock free node + Page::FakeNodeLF* fakeLFNode = reinterpret_cast(ptr); #ifdef AZ_DEBUG_BUILD - // we need to reset the fakeLFNode because we share the memory. - // otherwise we will assert the node is in the list - fakeLFNode->m_next = 0; + // we need to reset the fakeLFNode because we share the memory. + // otherwise we will assert the node is in the list + fakeLFNode->m_next = 0; #endif - page->m_threadData->m_freedElements.push(*fakeLFNode); + page->m_threadData->m_freedElements.push(*fakeLFNode); + } } -} - -//========================================================================= -// AllocationSize -// [11/22/2010] -//========================================================================= -ThreadPoolSchema::size_type -ThreadPoolSchemaImpl::AllocationSize(ThreadPoolSchema::pointer_type ptr) -{ - Page* page = PageFromAddress(ptr); - if (page==nullptr) + + //========================================================================= + // AllocationSize + // [11/22/2010] + //========================================================================= + ThreadPoolSchema::size_type ThreadPoolSchemaImpl::AllocationSize(ThreadPoolSchema::pointer_type ptr) { - return 0; + Page* page = PageFromAddress(ptr); + if (page == nullptr) + { + return 0; + } + AZ_Assert(page->m_threadData != nullptr, ("We must have valid page thread data for the page!")); + return page->m_threadData->m_allocator.AllocationSize(ptr); } - AZ_Assert(page->m_threadData!=nullptr, ("We must have valid page thread data for the page!")); - return page->m_threadData->m_allocator.AllocationSize(ptr); -} - -//========================================================================= -// PopFreePage -// [9/15/2009] -//========================================================================= -AZ_INLINE ThreadPoolSchemaImpl::Page* -ThreadPoolSchemaImpl::PopFreePage() -{ - Page* page; + + //========================================================================= + // PopFreePage + // [9/15/2009] + //========================================================================= + AZ_INLINE ThreadPoolSchemaImpl::Page* ThreadPoolSchemaImpl::PopFreePage() { - AZStd::lock_guard lock(m_mutex); - if (m_freePages.empty()) + Page* page; { - page = nullptr; + AZStd::lock_guard lock(m_mutex); + if (m_freePages.empty()) + { + page = nullptr; + } + else + { + page = &m_freePages.front(); + m_freePages.pop_front(); + } } - else + if (page) { - page = &m_freePages.front(); - m_freePages.pop_front(); +#ifdef AZ_DEBUG_BUILD + AZ_Assert(page->m_threadData == 0, "If we stored the free page properly we should have null here!"); +#endif + // store the current thread data, used when we free elements + page->m_threadData = m_threadPoolGetter(); } + return page; } - if (page) + + //========================================================================= + // PushFreePage + // [9/15/2009] + //========================================================================= + AZ_INLINE void ThreadPoolSchemaImpl::PushFreePage(Page* page) { -# ifdef AZ_DEBUG_BUILD - AZ_Assert(page->m_threadData == 0, "If we stored the free page properly we should have null here!"); -# endif - // store the current thread data, used when we free elements - page->m_threadData = m_threadPoolGetter(); - } - return page; -} - -//========================================================================= -// PushFreePage -// [9/15/2009] -//========================================================================= -AZ_INLINE void -ThreadPoolSchemaImpl::PushFreePage(Page* page) -{ #ifdef AZ_DEBUG_BUILD - page->m_threadData = 0; + page->m_threadData = 0; #endif - { - AZStd::lock_guard lock(m_mutex); - m_freePages.push_front(*page); - } -} - -//========================================================================= -// GarbageCollect -// [9/15/2009] -//========================================================================= -void -ThreadPoolSchemaImpl::GarbageCollect() -{ - if (!m_isDynamic) - { - return; // we have the memory statically allocated, can't collect garbage. + { + AZStd::lock_guard lock(m_mutex); + m_freePages.push_front(*page); + } } - FreePagesType staticPages; - AZStd::lock_guard lock(m_mutex); - while (!m_freePages.empty()) + //========================================================================= + // GarbageCollect + // [9/15/2009] + //========================================================================= + void ThreadPoolSchemaImpl::GarbageCollect() { - Page* page = &m_freePages.front(); - m_freePages.pop_front(); - if (IsInStaticBlock(page)) + if (!m_isDynamic) { - staticPages.push_front(*page); + return; // we have the memory statically allocated, can't collect garbage. } - else + + FreePagesType staticPages; + AZStd::lock_guard lock(m_mutex); + while (!m_freePages.empty()) + { + Page* page = &m_freePages.front(); + m_freePages.pop_front(); + if (IsInStaticBlock(page)) + { + staticPages.push_front(*page); + } + else + { + FreePage(page); + } + } + while (!staticPages.empty()) { - FreePage(page); + Page* page = &staticPages.front(); + staticPages.pop_front(); + m_freePages.push_front(*page); } } - while (!staticPages.empty()) + + //========================================================================= + // SetupFreeList + // [9/15/2009] + //========================================================================= + inline void ThreadPoolSchemaImpl::Page::SetupFreeList(size_t elementSize, size_t pageDataBlockSize) { - Page* page = &staticPages.front(); - staticPages.pop_front(); - m_freePages.push_front(*page); + char* pageData = reinterpret_cast(this) - pageDataBlockSize; + m_freeList.clear(); + // setup free list + size_t numElements = pageDataBlockSize / elementSize; + for (size_t i = 0; i < numElements; ++i) + { + char* address = pageData + i * elementSize; + Page::FakeNode* node = new (address) Page::FakeNode(); + m_freeList.push_back(*node); + } } -} - -//========================================================================= -// SetupFreeList -// [9/15/2009] -//========================================================================= -inline void -ThreadPoolSchemaImpl::Page::SetupFreeList(size_t elementSize, size_t pageDataBlockSize) -{ - char* pageData = reinterpret_cast(this) - pageDataBlockSize; - m_freeList.clear(); - // setup free list - size_t numElements = pageDataBlockSize / elementSize; - for (size_t i = 0; i < numElements; ++i) + + //========================================================================= + // ThreadPoolData::ThreadPoolData + // [9/15/2009] + //========================================================================= + ThreadPoolData::ThreadPoolData(ThreadPoolSchemaImpl* alloc, size_t pageSize, size_t minAllocationSize, size_t maxAllocationSize) + : m_allocator(alloc, pageSize, minAllocationSize, maxAllocationSize) { - char* address = pageData+i*elementSize; - Page::FakeNode* node = new(address) Page::FakeNode(); - m_freeList.push_back(*node); } -} - -//========================================================================= -// ThreadPoolData::ThreadPoolData -// [9/15/2009] -//========================================================================= -ThreadPoolData::ThreadPoolData(ThreadPoolSchemaImpl* alloc, size_t pageSize, size_t minAllocationSize, size_t maxAllocationSize) - : m_allocator(alloc, pageSize, minAllocationSize, maxAllocationSize) -{} - -//========================================================================= -// ThreadPoolData::~ThreadPoolData -// [9/15/2009] -//========================================================================= -ThreadPoolData::~ThreadPoolData() -{ - // deallocate elements if they were freed from other threads - ThreadPoolSchemaImpl::Page::FakeNodeLF* fakeLFNode; - while ((fakeLFNode = m_freedElements.pop())!=nullptr) + + //========================================================================= + // ThreadPoolData::~ThreadPoolData + // [9/15/2009] + //========================================================================= + ThreadPoolData::~ThreadPoolData() { - m_allocator.DeAllocate(fakeLFNode); + // deallocate elements if they were freed from other threads + ThreadPoolSchemaImpl::Page::FakeNodeLF* fakeLFNode; + while ((fakeLFNode = m_freedElements.pop()) != nullptr) + { + m_allocator.DeAllocate(fakeLFNode); + } } -} + +} // namespace AZ diff --git a/Code/Framework/AzCore/AzCore/Memory/PoolSchema.h b/Code/Framework/AzCore/AzCore/Memory/PoolSchema.h index cfc5e3ea07..ef38dcf24f 100644 --- a/Code/Framework/AzCore/AzCore/Memory/PoolSchema.h +++ b/Code/Framework/AzCore/AzCore/Memory/PoolSchema.h @@ -5,8 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 OR MIT * */ -#ifndef AZ_POOL_ALLOCATION_SCHEME_H -#define AZ_POOL_ALLOCATION_SCHEME_H +#pragma once #include @@ -164,8 +163,3 @@ namespace AZ template AZ_THREAD_LOCAL ThreadPoolData* ThreadPoolSchemaHelper::m_threadData = 0; } - -#endif // AZ_POOL_ALLOCATION_SCHEME_H -#pragma once - - diff --git a/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp b/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp index ddcc046b8e..15cf5de8bc 100644 --- a/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp @@ -21,8 +21,8 @@ #define AZCORE_SYSTEM_ALLOCATOR_HEAP 3 #if !defined(AZCORE_SYSTEM_ALLOCATOR) - // define the default - #define AZCORE_SYSTEM_ALLOCATOR AZCORE_SYSTEM_ALLOCATOR_HPHA +// define the default +#define AZCORE_SYSTEM_ALLOCATOR AZCORE_SYSTEM_ALLOCATOR_HPHA #endif #if AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HPHA @@ -35,12 +35,11 @@ #error "Invalid allocator selected for SystemAllocator" #endif - -using namespace AZ; - -////////////////////////////////////////////////////////////////////////// -// Globals - we use global storage for the first memory schema, since we can't use dynamic memory! -static bool g_isSystemSchemaUsed = false; +namespace AZ +{ + ////////////////////////////////////////////////////////////////////////// + // Globals - we use global storage for the first memory schema, since we can't use dynamic memory! + static bool g_isSystemSchemaUsed = false; #if AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HPHA static AZStd::aligned_storage::value>::type g_systemSchema; #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC @@ -49,268 +48,275 @@ static bool g_isSystemSchemaUsed = false; static AZStd::aligned_storage::value>::type g_systemSchema; #endif -////////////////////////////////////////////////////////////////////////// - -//========================================================================= -// SystemAllocator -// [9/2/2009] -//========================================================================= -SystemAllocator::SystemAllocator() - : AllocatorBase(this, "SystemAllocator", "Fundamental generic memory allocator") - , m_isCustom(false) - , m_allocator(nullptr) - , m_ownsOSAllocator(false) -{ -} - -//========================================================================= -// ~SystemAllocator -//========================================================================= -SystemAllocator::~SystemAllocator() -{ - if (IsReady()) + ////////////////////////////////////////////////////////////////////////// + + //========================================================================= + // SystemAllocator + // [9/2/2009] + //========================================================================= + SystemAllocator::SystemAllocator() + : AllocatorBase(this, "SystemAllocator", "Fundamental generic memory allocator") + , m_isCustom(false) + , m_allocator(nullptr) + , m_ownsOSAllocator(false) { - Destroy(); - } -} - -//========================================================================= -// ~Create -// [9/2/2009] -//========================================================================= -bool -SystemAllocator::Create(const Descriptor& desc) -{ - AZ_Assert(IsReady() == false, "System allocator was already created!"); - if (IsReady()) - { - return false; } - m_desc = desc; - - if (!AllocatorInstance::IsReady()) + //========================================================================= + // ~SystemAllocator + //========================================================================= + SystemAllocator::~SystemAllocator() { - m_ownsOSAllocator = true; - AllocatorInstance::Create(); - } - bool isReady = false; - if (desc.m_custom) - { - m_isCustom = true; - m_allocator = desc.m_custom; - isReady = true; + if (IsReady()) + { + Destroy(); + } } - else + + //========================================================================= + // ~Create + // [9/2/2009] + //========================================================================= + bool SystemAllocator::Create(const Descriptor& desc) { - m_isCustom = false; -#if AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HPHA - HphaSchema::Descriptor heapDesc; - heapDesc.m_pageSize = desc.m_heap.m_pageSize; - heapDesc.m_poolPageSize = desc.m_heap.m_poolPageSize; - AZ_Assert(desc.m_heap.m_numFixedMemoryBlocks <= 1, "We support max1 memory block at the moment!"); - if (desc.m_heap.m_numFixedMemoryBlocks > 0) + AZ_Assert(IsReady() == false, "System allocator was already created!"); + if (IsReady()) { - heapDesc.m_fixedMemoryBlock = desc.m_heap.m_fixedMemoryBlocks[0]; - heapDesc.m_fixedMemoryBlockByteSize = desc.m_heap.m_fixedMemoryBlocksByteSize[0]; + return false; } - heapDesc.m_subAllocator = desc.m_heap.m_subAllocator; - heapDesc.m_isPoolAllocations = desc.m_heap.m_isPoolAllocations; - // Fix SystemAllocator from growing in small chunks - heapDesc.m_systemChunkSize = desc.m_heap.m_systemChunkSize; -#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC - MallocSchema::Descriptor heapDesc; -#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP - HeapSchema::Descriptor heapDesc; - memcpy(heapDesc.m_memoryBlocks, desc.m_heap.m_memoryBlocks, sizeof(heapDesc.m_memoryBlocks)); - memcpy(heapDesc.m_memoryBlocksByteSize, desc.m_heap.m_memoryBlocksByteSize, sizeof(heapDesc.m_memoryBlocksByteSize)); - heapDesc.m_numMemoryBlocks = desc.m_heap.m_numMemoryBlocks; -#endif - if (&AllocatorInstance::Get() == this) // if we are the system allocator - { - AZ_Assert(!g_isSystemSchemaUsed, "AZ::SystemAllocator MUST be created first! It's the source of all allocations!"); -#if AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HPHA - m_allocator = new(&g_systemSchema)HphaSchema(heapDesc); -#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC - m_allocator = new(&g_systemSchema)MallocSchema(heapDesc); -#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP - m_allocator = new(&g_systemSchema)HeapSchema(heapDesc); -#endif - g_isSystemSchemaUsed = true; + m_desc = desc; + + if (!AllocatorInstance::IsReady()) + { + m_ownsOSAllocator = true; + AllocatorInstance::Create(); + } + bool isReady = false; + if (desc.m_custom) + { + m_isCustom = true; + m_allocator = desc.m_custom; isReady = true; } else { - // this class should be inheriting from SystemAllocator - AZ_Assert(AllocatorInstance::IsReady(), "System allocator must be created before any other allocator! They allocate from it."); - + m_isCustom = false; #if AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HPHA - m_allocator = azcreate(HphaSchema, (heapDesc), SystemAllocator); + HphaSchema::Descriptor heapDesc; + heapDesc.m_pageSize = desc.m_heap.m_pageSize; + heapDesc.m_poolPageSize = desc.m_heap.m_poolPageSize; + AZ_Assert(desc.m_heap.m_numFixedMemoryBlocks <= 1, "We support max1 memory block at the moment!"); + if (desc.m_heap.m_numFixedMemoryBlocks > 0) + { + heapDesc.m_fixedMemoryBlock = desc.m_heap.m_fixedMemoryBlocks[0]; + heapDesc.m_fixedMemoryBlockByteSize = desc.m_heap.m_fixedMemoryBlocksByteSize[0]; + } + heapDesc.m_subAllocator = desc.m_heap.m_subAllocator; + heapDesc.m_isPoolAllocations = desc.m_heap.m_isPoolAllocations; + // Fix SystemAllocator from growing in small chunks + heapDesc.m_systemChunkSize = desc.m_heap.m_systemChunkSize; #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC - m_allocator = azcreate(MallocSchema, (heapDesc), SystemAllocator); + MallocSchema::Descriptor heapDesc; #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP - m_allocator = azcreate(HeapSchema, (heapDesc), SystemAllocator); + HeapSchema::Descriptor heapDesc; + memcpy(heapDesc.m_memoryBlocks, desc.m_heap.m_memoryBlocks, sizeof(heapDesc.m_memoryBlocks)); + memcpy(heapDesc.m_memoryBlocksByteSize, desc.m_heap.m_memoryBlocksByteSize, sizeof(heapDesc.m_memoryBlocksByteSize)); + heapDesc.m_numMemoryBlocks = desc.m_heap.m_numMemoryBlocks; #endif - if (m_allocator == nullptr) + if (&AllocatorInstance::Get() == this) // if we are the system allocator { - isReady = false; + AZ_Assert(!g_isSystemSchemaUsed, "AZ::SystemAllocator MUST be created first! It's the source of all allocations!"); + +#if AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HPHA + m_allocator = new (&g_systemSchema) HphaSchema(heapDesc); +#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC + m_allocator = new (&g_systemSchema) MallocSchema(heapDesc); +#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP + m_allocator = new (&g_systemSchema) HeapSchema(heapDesc); +#endif + g_isSystemSchemaUsed = true; + isReady = true; } else { - isReady = true; + // this class should be inheriting from SystemAllocator + AZ_Assert( + AllocatorInstance::IsReady(), + "System allocator must be created before any other allocator! They allocate from it."); + +#if AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HPHA + m_allocator = azcreate(HphaSchema, (heapDesc), SystemAllocator); +#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC + m_allocator = azcreate(MallocSchema, (heapDesc), SystemAllocator); +#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP + m_allocator = azcreate(HeapSchema, (heapDesc), SystemAllocator); +#endif + if (m_allocator == nullptr) + { + isReady = false; + } + else + { + isReady = true; + } } } - } - - return isReady; -} -//========================================================================= -// Allocate -// [9/2/2009] -//========================================================================= -void -SystemAllocator::Destroy() -{ - if (g_isSystemSchemaUsed) - { - int dummy; - (void)dummy; + return isReady; } - if (!m_isCustom) + //========================================================================= + // Allocate + // [9/2/2009] + //========================================================================= + void SystemAllocator::Destroy() { - if ((void*)m_allocator == (void*)&g_systemSchema) + if (g_isSystemSchemaUsed) { + int dummy; + (void)dummy; + } + + if (!m_isCustom) + { + if ((void*)m_allocator == (void*)&g_systemSchema) + { #if AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HPHA - static_cast(m_allocator)->~HphaSchema(); + static_cast(m_allocator)->~HphaSchema(); #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC - static_cast(m_allocator)->~MallocSchema(); + static_cast(m_allocator)->~MallocSchema(); #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP - static_cast(m_allocator)->~HeapSchema(); + static_cast(m_allocator)->~HeapSchema(); #endif - g_isSystemSchemaUsed = false; + g_isSystemSchemaUsed = false; + } + else + { + azdestroy(m_allocator); + } } - else + + if (m_ownsOSAllocator) { - azdestroy(m_allocator); + AllocatorInstance::Destroy(); + m_ownsOSAllocator = false; } } - if (m_ownsOSAllocator) + AllocatorDebugConfig SystemAllocator::GetDebugConfig() { - AllocatorInstance::Destroy(); - m_ownsOSAllocator = false; + return AllocatorDebugConfig() + .StackRecordLevels(m_desc.m_stackRecordLevels) + .UsesMemoryGuards(!m_isCustom) + .MarksUnallocatedMemory(!m_isCustom) + .ExcludeFromDebugging(!m_desc.m_allocationRecords); } -} -AllocatorDebugConfig SystemAllocator::GetDebugConfig() -{ - return AllocatorDebugConfig() - .StackRecordLevels(m_desc.m_stackRecordLevels) - .UsesMemoryGuards(!m_isCustom) - .MarksUnallocatedMemory(!m_isCustom) - .ExcludeFromDebugging(!m_desc.m_allocationRecords); -} - -IAllocatorAllocate* SystemAllocator::GetSchema() -{ - return m_allocator; -} - -//========================================================================= -// Allocate -// [9/2/2009] -//========================================================================= -SystemAllocator::pointer_type -SystemAllocator::Allocate(size_type byteSize, size_type alignment, int flags, const char* name, const char* fileName, int lineNum, unsigned int suppressStackRecord) -{ - if (byteSize == 0) + IAllocatorAllocate* SystemAllocator::GetSchema() { - return nullptr; + return m_allocator; } - AZ_Assert(byteSize > 0, "You can not allocate 0 bytes!"); - AZ_Assert((alignment & (alignment - 1)) == 0, "Alignment must be power of 2!"); - - byteSize = MemorySizeAdjustedUp(byteSize); - SystemAllocator::pointer_type address = m_allocator->Allocate(byteSize, alignment, flags, name, fileName, lineNum, suppressStackRecord + 1); - if (address == nullptr) + //========================================================================= + // Allocate + // [9/2/2009] + //========================================================================= + SystemAllocator::pointer_type SystemAllocator::Allocate( + size_type byteSize, + size_type alignment, + int flags, + const char* name, + const char* fileName, + int lineNum, + unsigned int suppressStackRecord) { - // Free all memory we can and try again! - AllocatorManager::Instance().GarbageCollect(); + if (byteSize == 0) + { + return nullptr; + } + AZ_Assert(byteSize > 0, "You can not allocate 0 bytes!"); + AZ_Assert((alignment & (alignment - 1)) == 0, "Alignment must be power of 2!"); - address = m_allocator->Allocate(byteSize, alignment, flags, name, fileName, lineNum, suppressStackRecord + 1); + byteSize = MemorySizeAdjustedUp(byteSize); + SystemAllocator::pointer_type address = + m_allocator->Allocate(byteSize, alignment, flags, name, fileName, lineNum, suppressStackRecord + 1); + + if (address == nullptr) + { + // Free all memory we can and try again! + AllocatorManager::Instance().GarbageCollect(); + + address = m_allocator->Allocate(byteSize, alignment, flags, name, fileName, lineNum, suppressStackRecord + 1); + } + + if (address == nullptr) + { + byteSize = MemorySizeAdjustedDown(byteSize); // restore original size + } + + AZ_Assert( + address != nullptr, "SystemAllocator: Failed to allocate %d bytes aligned on %d (flags: 0x%08x) %s : %s (%d)!", byteSize, + alignment, flags, name ? name : "(no name)", fileName ? fileName : "(no file name)", lineNum); + + AZ_PROFILE_MEMORY_ALLOC_EX(MemoryReserved, fileName, lineNum, address, byteSize, name); + AZ_MEMORY_PROFILE(ProfileAllocation(address, byteSize, alignment, name, fileName, lineNum, suppressStackRecord + 1)); + + return address; } - if (address == nullptr) + //========================================================================= + // DeAllocate + // [9/2/2009] + //========================================================================= + void SystemAllocator::DeAllocate(pointer_type ptr, size_type byteSize, size_type alignment) { - byteSize = MemorySizeAdjustedDown(byteSize); // restore original size + byteSize = MemorySizeAdjustedUp(byteSize); + AZ_PROFILE_MEMORY_FREE(MemoryReserved, ptr); + AZ_MEMORY_PROFILE(ProfileDeallocation(ptr, byteSize, alignment, nullptr)); + m_allocator->DeAllocate(ptr, byteSize, alignment); } - AZ_Assert(address != nullptr, "SystemAllocator: Failed to allocate %d bytes aligned on %d (flags: 0x%08x) %s : %s (%d)!", byteSize, alignment, flags, name ? name : "(no name)", fileName ? fileName : "(no file name)", lineNum); + //========================================================================= + // ReAllocate + // [9/13/2011] + //========================================================================= + SystemAllocator::pointer_type SystemAllocator::ReAllocate(pointer_type ptr, size_type newSize, size_type newAlignment) + { + newSize = MemorySizeAdjustedUp(newSize); - AZ_PROFILE_MEMORY_ALLOC_EX(MemoryReserved, fileName, lineNum, address, byteSize, name); - AZ_MEMORY_PROFILE(ProfileAllocation(address, byteSize, alignment, name, fileName, lineNum, suppressStackRecord + 1)); + AZ_MEMORY_PROFILE(ProfileReallocationBegin(ptr, newSize)); + AZ_PROFILE_MEMORY_FREE(MemoryReserved, ptr); + pointer_type newAddress = m_allocator->ReAllocate(ptr, newSize, newAlignment); + AZ_PROFILE_MEMORY_ALLOC(MemoryReserved, newAddress, newSize, "SystemAllocator realloc"); + AZ_MEMORY_PROFILE(ProfileReallocationEnd(ptr, newAddress, newSize, newAlignment)); - return address; -} + return newAddress; + } -//========================================================================= -// DeAllocate -// [9/2/2009] -//========================================================================= -void -SystemAllocator::DeAllocate(pointer_type ptr, size_type byteSize, size_type alignment) -{ - byteSize = MemorySizeAdjustedUp(byteSize); - AZ_PROFILE_MEMORY_FREE(MemoryReserved, ptr); - AZ_MEMORY_PROFILE(ProfileDeallocation(ptr, byteSize, alignment, nullptr)); - m_allocator->DeAllocate(ptr, byteSize, alignment); -} - -//========================================================================= -// ReAllocate -// [9/13/2011] -//========================================================================= -SystemAllocator::pointer_type -SystemAllocator::ReAllocate(pointer_type ptr, size_type newSize, size_type newAlignment) -{ - newSize = MemorySizeAdjustedUp(newSize); - - AZ_MEMORY_PROFILE(ProfileReallocationBegin(ptr, newSize)); - AZ_PROFILE_MEMORY_FREE(MemoryReserved, ptr); - pointer_type newAddress = m_allocator->ReAllocate(ptr, newSize, newAlignment); - AZ_PROFILE_MEMORY_ALLOC(MemoryReserved, newAddress, newSize, "SystemAllocator realloc"); - AZ_MEMORY_PROFILE(ProfileReallocationEnd(ptr, newAddress, newSize, newAlignment)); - - return newAddress; -} - -//========================================================================= -// Resize -// [8/12/2011] -//========================================================================= -SystemAllocator::size_type -SystemAllocator::Resize(pointer_type ptr, size_type newSize) -{ - newSize = MemorySizeAdjustedUp(newSize); - size_type resizedSize = m_allocator->Resize(ptr, newSize); + //========================================================================= + // Resize + // [8/12/2011] + //========================================================================= + SystemAllocator::size_type SystemAllocator::Resize(pointer_type ptr, size_type newSize) + { + newSize = MemorySizeAdjustedUp(newSize); + size_type resizedSize = m_allocator->Resize(ptr, newSize); - AZ_MEMORY_PROFILE(ProfileResize(ptr, resizedSize)); + AZ_MEMORY_PROFILE(ProfileResize(ptr, resizedSize)); - return MemorySizeAdjustedDown(resizedSize); -} + return MemorySizeAdjustedDown(resizedSize); + } -//========================================================================= -// -// [8/12/2011] -//========================================================================= -SystemAllocator::size_type -SystemAllocator::AllocationSize(pointer_type ptr) -{ - size_type allocSize = MemorySizeAdjustedDown(m_allocator->AllocationSize(ptr)); + //========================================================================= + // + // [8/12/2011] + //========================================================================= + SystemAllocator::size_type SystemAllocator::AllocationSize(pointer_type ptr) + { + size_type allocSize = MemorySizeAdjustedDown(m_allocator->AllocationSize(ptr)); + + return allocSize; + } - return allocSize; -} +} // namespace AZ diff --git a/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.h b/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.h index c02ada5843..c730b8dde6 100644 --- a/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.h +++ b/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.h @@ -5,8 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 OR MIT * */ -#ifndef AZCORE_SYS_ALLOCATOR_H -#define AZCORE_SYS_ALLOCATOR_H +#pragma once #include @@ -120,7 +119,5 @@ namespace AZ }; } -#endif // AZCORE_SYS_ALLOCATOR_H -#pragma once From b2c9c01622c6171050027717db67093d3e66c9c1 Mon Sep 17 00:00:00 2001 From: chiyenteng <82238204+chiyenteng@users.noreply.github.com> Date: Fri, 17 Dec 2021 05:44:18 -0800 Subject: [PATCH 185/948] Remove incorrect comment Signed-off-by: chiyenteng <82238204+chiyenteng@users.noreply.github.com> --- .../assetpipeline/ap_fixtures/clear_moveoutput_fixture.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/clear_moveoutput_fixture.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/clear_moveoutput_fixture.py index 17da43a5b9..4b23f52006 100755 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/clear_moveoutput_fixture.py +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/clear_moveoutput_fixture.py @@ -3,8 +3,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 - -Fixture for clearing out 'MoveOutput' folders from \\dev and \\dev\\PROJECT """ # Import builtin libraries From 1be475c81a8e98c2afe128676cad2f8d16845df3 Mon Sep 17 00:00:00 2001 From: Maxim Ivanov Date: Fri, 17 Dec 2021 14:53:54 +0300 Subject: [PATCH 186/948] [AudioSystem] ACE: Added Ctrl-R shortcut for the "File->Reload" action. Signed-off-by: Maxim Ivanov --- .../Code/Source/Editor/AudioControlsEditorMainWindow.ui | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorMainWindow.ui b/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorMainWindow.ui index 549e746de6..352e1bdf78 100644 --- a/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorMainWindow.ui +++ b/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorMainWindow.ui @@ -166,6 +166,9 @@ Reload + + Ctrl+R + From d9e1e59af703eb6c4d852bf62542c38afd8a0dba Mon Sep 17 00:00:00 2001 From: Maxim Ivanov Date: Fri, 17 Dec 2021 15:42:05 +0300 Subject: [PATCH 187/948] [AudioSystem] ACE: Added "File -> Refresh Audio System" action (same as "Game -> Refresh Audio") with "Ctrl-Shift-R" shortcut. Signed-off-by: Maxim Ivanov --- .../Editor/AudioControlsEditorMainWindow.ui | 25 +++++++++++++++++++ .../Editor/AudioControlsEditorWindow.cpp | 24 +++++++++++------- .../Source/Editor/AudioControlsEditorWindow.h | 1 + 3 files changed, 41 insertions(+), 9 deletions(-) diff --git a/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorMainWindow.ui b/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorMainWindow.ui index 352e1bdf78..7a1f4793b8 100644 --- a/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorMainWindow.ui +++ b/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorMainWindow.ui @@ -143,6 +143,7 @@ + @@ -170,6 +171,14 @@ Ctrl+R + + + Refresh Audio System + + + Ctrl+Shift+R + + @@ -207,6 +216,22 @@ + + actionRefreshAudioSystem + triggered() + MainWindow + RefreshAudioSystem() + + + -1 + -1 + + + 485 + 336 + + + CurrentControlNameChanged(QString) diff --git a/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorWindow.cpp b/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorWindow.cpp index 5f870d06d4..35b1f3f2c8 100644 --- a/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorWindow.cpp +++ b/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorWindow.cpp @@ -198,6 +198,20 @@ namespace AudioControls } } + //-------------------------------------------------------------------------------------------// + void CAudioControlsEditorWindow::RefreshAudioSystem() + { + QString sLevelName = GetIEditor()->GetLevelName(); + + if (QString::compare(sLevelName, "Untitled", Qt::CaseInsensitive) == 0) + { + // Rather pass empty QString to indicate that no level is loaded! + sLevelName = QString(); + } + + Audio::AudioSystemRequestBus::Broadcast(&Audio::AudioSystemRequestBus::Events::RefreshAudioSystem, sLevelName.toUtf8().data()); + } + //-------------------------------------------------------------------------------------------// void CAudioControlsEditorWindow::Save() { @@ -215,15 +229,7 @@ namespace AudioControls messageBox.setWindowTitle("Audio Controls Editor"); if (messageBox.exec() == QMessageBox::Yes) { - QString sLevelName = GetIEditor()->GetLevelName(); - - if (QString::compare(sLevelName, "Untitled", Qt::CaseInsensitive) == 0) - { - // Rather pass empty QString to indicate that no level is loaded! - sLevelName = QString(); - } - - Audio::AudioSystemRequestBus::Broadcast(&Audio::AudioSystemRequestBus::Events::RefreshAudioSystem, sLevelName.toUtf8().data()); + RefreshAudioSystem(); } } m_pATLModel->ClearDirtyFlags(); diff --git a/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorWindow.h b/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorWindow.h index 00ffabfbe9..43d0ed8c8e 100644 --- a/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorWindow.h +++ b/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorWindow.h @@ -61,6 +61,7 @@ namespace AudioControls void UpdateInspector(); void FilterControlType(EACEControlType type, bool bShow); void Update(); + void RefreshAudioSystem(); protected: void closeEvent(QCloseEvent* pEvent) override; From 3ecf622804474af37cab528eba371a57f605ee00 Mon Sep 17 00:00:00 2001 From: Maxim Ivanov Date: Fri, 17 Dec 2021 16:06:44 +0300 Subject: [PATCH 188/948] [AudioSystem] ACE: Panels now can be resized horizontally by dragging the boundary between them. Signed-off-by: Maxim Ivanov --- .../Editor/AudioControlsEditorMainWindow.ui | 188 +++++++++--------- 1 file changed, 96 insertions(+), 92 deletions(-) diff --git a/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorMainWindow.ui b/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorMainWindow.ui index 7a1f4793b8..b375f5e174 100644 --- a/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorMainWindow.ui +++ b/Gems/AudioSystem/Code/Source/Editor/AudioControlsEditorMainWindow.ui @@ -28,101 +28,105 @@ - - - - 1 - 0 - + + + Qt::Horizontal - - QDockWidget::NoDockWidgetFeatures - - - ATL Controls + + false - - - - 4 - - - 9 - - - 4 - - - 9 - - + + + + 1 + 0 + + + + QDockWidget::NoDockWidgetFeatures + + + ATL Controls + + + + + 4 + + + 9 + + + 4 + + + 9 + + + - - - - - - - 2 - 1 - - - - QDockWidget::NoDockWidgetFeatures - - - Inspector - - - - - 4 - - - 9 - - - 4 - - - 9 - - + + + + 2 + 1 + + + + QDockWidget::NoDockWidgetFeatures + + + Inspector + + + + + 4 + + + 9 + + + 4 + + + 9 + + + - - - - - - - 1 - 0 - - - - false - - - QDockWidget::NoDockWidgetFeatures - - - Audio Middleware Controls - - - - - 4 - - - 9 - - - 4 - - - 9 - - + + + + 1 + 0 + + + + false + + + QDockWidget::NoDockWidgetFeatures + + + Audio Middleware Controls + + + + + 4 + + + 9 + + + 4 + + + 9 + + + @@ -134,7 +138,7 @@ 0 0 972 - 21 + 26 From 9c7a558ccb0597e6ffe014266b3ded0f9aa708d3 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Fri, 17 Dec 2021 12:36:05 -0800 Subject: [PATCH 189/948] basic refactor of assets (#6467) Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../Code/Builder/ScriptCanvasBuilderWorker.h | 2 +- .../ScriptCanvasBuilderWorkerUtility.cpp | 4 +- .../EditorScriptCanvasComponent.cpp | 1 + .../Framework/ScriptCanvasGraphUtilities.inl | 14 ++-- .../Code/Editor/Nodes/NodeDisplayUtils.cpp | 2 +- .../ScriptCanvasNodePaletteDockWidget.cpp | 6 +- .../ScriptCanvas/Asset/RuntimeAsset.cpp | 8 +- .../Include/ScriptCanvas/Asset/RuntimeAsset.h | 74 +++---------------- .../Asset/RuntimeAssetHandler.cpp | 10 ++- .../Asset/SubgraphInterfaceAssetHandler.cpp | 9 ++- .../Code/Include/ScriptCanvas/Core/Core.cpp | 6 ++ .../Code/Include/ScriptCanvas/Core/Core.h | 4 + .../Execution/ExecutionContext.cpp | 2 +- .../ScriptCanvas/Execution/ExecutionState.cpp | 2 +- .../Interpreted/ExecutionInterpretedAPI.cpp | 4 +- .../Interpreted/ExecutionStateInterpreted.cpp | 20 ++--- .../Execution/RuntimeComponent.cpp | 2 +- .../Libraries/Core/FunctionCallNode.cpp | 10 +-- .../Code/Tests/ScriptCanvasBuilderTests.cpp | 5 +- 19 files changed, 75 insertions(+), 110 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h index d0196d5f5c..142886f98c 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h @@ -59,7 +59,7 @@ namespace ScriptCanvasBuilder CorrectGraphVariableVersion, ReflectEntityIdNodes, FixExecutionStateNodeableConstruction, - + SwitchAssetsToBinary, // add new entries above Current, }; diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp index fb4bb0a386..64e73de9b9 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp @@ -521,7 +521,7 @@ namespace ScriptCanvasBuilder { AZ::Data::Asset runtimeAsset; runtimeAsset.Create(AZ::Data::AssetId(input.assetID.m_guid, AZ_CRC("SubgraphInterface", 0xdfe6dc72))); - runtimeAsset.Get()->SetData(subgraphInterface); + runtimeAsset.Get()->m_interfaceData = subgraphInterface; AZStd::vector byteBuffer; AZ::IO::ByteContainerStream byteStream(&byteBuffer); @@ -557,7 +557,7 @@ namespace ScriptCanvasBuilder { AZ::Data::Asset runtimeAsset; runtimeAsset.Create(AZ::Data::AssetId(input.assetID.m_guid, AZ_CRC("RuntimeData", 0x163310ae))); - runtimeAsset.Get()->SetData(runtimeData); + runtimeAsset.Get()->m_runtimeData = runtimeData; AZStd::vector byteBuffer; AZ::IO::ByteContainerStream byteStream(&byteBuffer); diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index bb9e829bf5..0a0dbfc160 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -41,6 +41,7 @@ namespace EditorScriptCanvasComponentCpp PrefabIntegration = 10, InternalDev, AddSourceHandle, + RefactorAssets, // add description above Current }; diff --git a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl index 51fef7efcf..f4e97600bc 100644 --- a/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl +++ b/Gems/ScriptCanvas/Code/Editor/Framework/ScriptCanvasGraphUtilities.inl @@ -30,8 +30,8 @@ namespace ScriptCanvasEditor // over to the override data to simulate build step that does this when building prefabs AZ_INLINE void CopyAssetEntityIdsToOverrides(RuntimeDataOverrides& runtimeDataOverrides) { - 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.reserve(runtimeDataOverrides.m_runtimeAsset->m_runtimeData.m_input.m_entityIds.size()); + for (auto& varEntityPar : runtimeDataOverrides.m_runtimeAsset->m_runtimeData.m_input.m_entityIds) { runtimeDataOverrides.m_entityIds.push_back(varEntityPar.second); } @@ -281,14 +281,14 @@ namespace ScriptCanvasEditor #endif ////////////////////////////////////////////////////////////////////////////////////// loadResult.m_scriptAsset = luaAssetResult.m_scriptAsset; - 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_runtimeAsset.Get()->m_runtimeData.m_script = loadResult.m_scriptAsset; + loadResult.m_runtimeAsset.Get()->m_runtimeData.m_input = luaAssetResult.m_runtimeInputs; + loadResult.m_runtimeAsset.Get()->m_runtimeData.m_debugMap = luaAssetResult.m_debugMap; loadResult.m_runtimeComponent = loadResult.m_entity->CreateComponent(); CopyAssetEntityIdsToOverrides(runtimeDataOverrides); loadResult.m_runtimeComponent->TakeRuntimeDataOverrides(AZStd::move(runtimeDataOverrides)); - Execution::Context::InitializeActivationData(loadResult.m_runtimeAsset->GetData()); - Execution::InitializeInterpretedStatics(loadResult.m_runtimeAsset->GetData()); + Execution::Context::InitializeActivationData(loadResult.m_runtimeAsset->m_runtimeData); + Execution::InitializeInterpretedStatics(loadResult.m_runtimeAsset->m_runtimeData); } else { diff --git a/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp b/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp index 8e273fd2fc..31d012fd4a 100644 --- a/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp @@ -932,7 +932,7 @@ namespace ScriptCanvasEditor::Nodes if (asset) { - GraphCanvas::NodeTitleRequestBus::Event(graphCanvasNodeId, &GraphCanvas::NodeTitleRequests::SetTitle, asset->GetData().m_name); + GraphCanvas::NodeTitleRequestBus::Event(graphCanvasNodeId, &GraphCanvas::NodeTitleRequests::SetTitle, asset->m_interfaceData.m_name); } GraphCanvas::NodeTitleRequestBus::Event(graphCanvasNodeId, &GraphCanvas::NodeTitleRequests::SetPaletteOverride, "MethodNodeTitlePalette"); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.cpp index 25f38afbae..60d903d748 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/ScriptCanvasNodePaletteDockWidget.cpp @@ -456,7 +456,7 @@ namespace ScriptCanvasEditor return; } - if (!data->m_runtimeData.m_interface.HasAnyFunctionality()) + if (!data->m_interfaceData.m_interface.HasAnyFunctionality()) { // check for deleting the old entry return; @@ -517,7 +517,7 @@ namespace ScriptCanvasEditor return; } - const ScriptCanvas::Grammar::SubgraphInterface& graphInterface = data->m_runtimeData.m_interface; + const ScriptCanvas::Grammar::SubgraphInterface& graphInterface = data->m_interfaceData.m_interface; if (!graphInterface.HasAnyFunctionality()) { return; @@ -566,7 +566,7 @@ namespace ScriptCanvasEditor return; } - const ScriptCanvas::Grammar::SubgraphInterface& graphInterface = data->m_runtimeData.m_interface; + const ScriptCanvas::Grammar::SubgraphInterface& graphInterface = data->m_interfaceData.m_interface; if (!graphInterface.HasAnyFunctionality()) { return; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAsset.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAsset.cpp index d55fcf7838..faa1d06b63 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAsset.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAsset.cpp @@ -11,7 +11,7 @@ #include #include -namespace ScriptCanvasRuntimeAssetCpp +namespace DoNotVersionRuntimeAssetsBumpTheBuilderVersionInstead { enum class RuntimeDataVersion { @@ -72,7 +72,7 @@ namespace ScriptCanvas if (auto serializeContext = azrtti_cast(reflectContext)) { serializeContext->Class() - ->Version(static_cast(ScriptCanvasRuntimeAssetCpp::RuntimeDataVersion::Current)) + ->Version(static_cast(DoNotVersionRuntimeAssetsBumpTheBuilderVersionInstead::RuntimeDataVersion::Current)) ->Field("input", &RuntimeData::m_input) ->Field("debugMap", &RuntimeData::m_debugMap) ->Field("script", &RuntimeData::m_script) @@ -146,7 +146,7 @@ namespace ScriptCanvas if (auto serializeContext = azrtti_cast(context)) { serializeContext->Class() - ->Version(static_cast(ScriptCanvasRuntimeAssetCpp::RuntimeDataOverridesVersion::Current)) + ->Version(static_cast(DoNotVersionRuntimeAssetsBumpTheBuilderVersionInstead::RuntimeDataOverridesVersion::Current)) ->Field("runtimeAsset", &RuntimeDataOverrides::m_runtimeAsset) ->Field("variables", &RuntimeDataOverrides::m_variables) ->Field("variableIndices", &RuntimeDataOverrides::m_variableIndices) @@ -195,7 +195,7 @@ namespace ScriptCanvas if (auto serializeContext = azrtti_cast(reflectContext)) { serializeContext->Class() - ->Version(static_cast(ScriptCanvasRuntimeAssetCpp::FunctionRuntimeDataVersion::Current)) + ->Version(static_cast(DoNotVersionRuntimeAssetsBumpTheBuilderVersionInstead::FunctionRuntimeDataVersion::Current)) ->Field("name", &SubgraphInterfaceData::m_name) ->Field("interface", &SubgraphInterfaceData::m_interface) ; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAsset.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAsset.h index 8c5da5ac07..ad6f7c07b4 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAsset.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAsset.h @@ -106,65 +106,20 @@ namespace ScriptCanvas void EnforcePreloadBehavior(); }; - class RuntimeAssetBase + class RuntimeAsset : public AZ::Data::AssetData { public: - - AZ_RTTI(RuntimeAssetBase, "{19BAD220-E505-4443-AA95-743106748F37}", AZ::Data::AssetData); - AZ_CLASS_ALLOCATOR(RuntimeAssetBase, AZ::SystemAllocator, 0); - RuntimeAssetBase(const AZ::Data::AssetId& assetId = AZ::Data::AssetId(), AZ::Data::AssetData::AssetStatus status = AZ::Data::AssetData::AssetStatus::NotLoaded) - : AZ::Data::AssetData(assetId, status) - { - - } - }; - template - class RuntimeAssetTyped - : public RuntimeAssetBase - { - public: - AZ_RTTI(RuntimeAssetBase, "{C925213E-A1FA-4487-831F-9551A984700E}", RuntimeAssetBase); - AZ_CLASS_ALLOCATOR(RuntimeAssetBase, AZ::SystemAllocator, 0); - - RuntimeAssetTyped(const AZ::Data::AssetId& assetId = AZ::Data::AssetId(), AZ::Data::AssetData::AssetStatus status = AZ::Data::AssetData::AssetStatus::NotLoaded) - : RuntimeAssetBase(assetId, status) - { - - } + AZ_RTTI(RuntimeAsset, "{3E2AC8CD-713F-453E-967F-29517F331784}", AZ::Data::AssetData); static const char* GetFileExtension() { return "scriptcanvas_compiled"; } static const char* GetFileFilter() { return "*.scriptcanvas_compiled"; } - const DataType& GetData() const { return m_runtimeData; } - DataType& GetData() { return m_runtimeData; } - void SetData(const DataType& runtimeData) - { - m_runtimeData = runtimeData; - // When setting data instead of serializing, immediately mark the asset as ready. - m_status = AZ::Data::AssetData::AssetStatus::Ready; - } - - DataType m_runtimeData; - - protected: - friend class RuntimeAssetHandler; - RuntimeAssetTyped(const RuntimeAssetTyped&) = delete; - - }; - - class RuntimeAsset : public RuntimeAssetTyped - { - public: - - AZ_RTTI(RuntimeAsset, "{3E2AC8CD-713F-453E-967F-29517F331784}", RuntimeAssetTyped); + RuntimeData m_runtimeData; RuntimeAsset(const AZ::Data::AssetId& assetId = AZ::Data::AssetId(), AZ::Data::AssetData::AssetStatus status = AZ::Data::AssetData::AssetStatus::NotLoaded) - : RuntimeAssetTyped(assetId, status) - { - - } - + : AZ::Data::AssetData(assetId, status) + {} }; class SubgraphInterfaceAsset; @@ -212,24 +167,19 @@ namespace ScriptCanvas }; class SubgraphInterfaceAsset - : public RuntimeAssetTyped + : public AZ::Data::AssetData { public: - AZ_RTTI(SubgraphInterfaceAsset, "{E22967AC-7673-4778-9125-AF49D82CAF9F}", RuntimeAssetTyped); + AZ_RTTI(SubgraphInterfaceAsset, "{E22967AC-7673-4778-9125-AF49D82CAF9F}", AZ::Data::AssetData); AZ_CLASS_ALLOCATOR(SubgraphInterfaceAsset, AZ::SystemAllocator, 0); - SubgraphInterfaceAsset(const AZ::Data::AssetId& assetId = AZ::Data::AssetId(), AZ::Data::AssetData::AssetStatus status = AZ::Data::AssetData::AssetStatus::NotLoaded) - : RuntimeAssetTyped(assetId, status) - {} - - void SetData(const SubgraphInterfaceData& runtimeData) - { - m_runtimeData = runtimeData; - } - static const char* GetFileExtension() { return "scriptcanvas_fn_compiled"; } static const char* GetFileFilter() { return "*.scriptcanvas_fn_compiled"; } - friend class SubgraphInterfaceAssetHandler; + SubgraphInterfaceData m_interfaceData; + + SubgraphInterfaceAsset(const AZ::Data::AssetId& assetId = AZ::Data::AssetId(), AZ::Data::AssetData::AssetStatus status = AZ::Data::AssetData::AssetStatus::NotLoaded) + : AZ::Data::AssetData(assetId, status) + {} }; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAssetHandler.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAssetHandler.cpp index 05b6f4397b..0b94fb370a 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAssetHandler.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAssetHandler.cpp @@ -81,7 +81,6 @@ namespace ScriptCanvas { (void)type; AZ_Assert(type == AZ::AzTypeInfo::Uuid(), "This handler deals only with the Script Canvas Runtime Asset type!"); - return aznew RuntimeAsset(id); } @@ -93,7 +92,7 @@ namespace ScriptCanvas { RuntimeAsset* runtimeAsset = asset.GetAs(); AZ_Assert(runtimeAsset, "RuntimeAssetHandler::InitAsset This should be a Script Canvas runtime asset, as this is the only type this handler processes!"); - Execution::Context::InitializeActivationData(runtimeAsset->GetData()); + Execution::Context::InitializeActivationData(runtimeAsset->m_runtimeData); } } @@ -116,7 +115,10 @@ namespace ScriptCanvas AZ_Assert(runtimeAsset, "This should be a Script Canvas runtime asset, as this is the only type we process!"); if (runtimeAsset && m_serializeContext) { - AZ::ObjectStream* binaryObjStream = AZ::ObjectStream::Create(stream, *m_serializeContext, AZ::ObjectStream::ST_XML); + AZ::ObjectStream* binaryObjStream = AZ::ObjectStream::Create(stream, *m_serializeContext + , g_saveRuntimeAssetsAsPlainTextForDebug + ? AZ::ObjectStream::ST_XML + : AZ::ObjectStream::ST_BINARY); bool graphSaved = binaryObjStream->WriteClass(&runtimeAsset->m_runtimeData); binaryObjStream->Finalize(); return graphSaved; @@ -128,7 +130,7 @@ namespace ScriptCanvas void RuntimeAssetHandler::DestroyAsset(AZ::Data::AssetPtr ptr) { RuntimeAsset* runtimeAsset = azrtti_cast(ptr); - Execution::Context::UnloadData(runtimeAsset->GetData()); + Execution::Context::UnloadData(runtimeAsset->m_runtimeData); delete ptr; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/SubgraphInterfaceAssetHandler.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/SubgraphInterfaceAssetHandler.cpp index 451e0dfc47..d0371bb88f 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/SubgraphInterfaceAssetHandler.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/SubgraphInterfaceAssetHandler.cpp @@ -93,7 +93,7 @@ namespace ScriptCanvas if (runtimeFunctionAsset && m_serializeContext) { stream->Seek(0U, AZ::IO::GenericStream::ST_SEEK_BEGIN); - bool loadSuccess = AZ::Utils::LoadObjectFromStreamInPlace(*stream, runtimeFunctionAsset->m_runtimeData, m_serializeContext, AZ::ObjectStream::FilterDescriptor(assetLoadFilterCB)); + bool loadSuccess = AZ::Utils::LoadObjectFromStreamInPlace(*stream, runtimeFunctionAsset->m_interfaceData, m_serializeContext, AZ::ObjectStream::FilterDescriptor(assetLoadFilterCB)); return loadSuccess ? AZ::Data::AssetHandler::LoadResult::LoadComplete : AZ::Data::AssetHandler::LoadResult::Error; } return AZ::Data::AssetHandler::LoadResult::Error; @@ -105,8 +105,11 @@ namespace ScriptCanvas AZ_Assert(runtimeFunctionAsset, "This should be a Script Canvas runtime asset, as this is the only type we process!"); if (runtimeFunctionAsset && m_serializeContext) { - AZ::ObjectStream* binaryObjStream = AZ::ObjectStream::Create(stream, *m_serializeContext, AZ::ObjectStream::ST_XML); - bool graphSaved = binaryObjStream->WriteClass(&runtimeFunctionAsset->m_runtimeData); + AZ::ObjectStream* binaryObjStream = AZ::ObjectStream::Create(stream, *m_serializeContext + , ScriptCanvas::g_saveEditorAssetsAsPlainTextForDebug + ? AZ::ObjectStream::ST_XML + : AZ::ObjectStream::ST_BINARY); + bool graphSaved = binaryObjStream->WriteClass(&runtimeFunctionAsset->m_interfaceData); binaryObjStream->Finalize(); return graphSaved; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp index 4a1d5d94c1..1e00e70075 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp @@ -20,6 +20,12 @@ namespace ScriptCanvas { + AZ_CVAR(bool, g_saveRuntimeAssetsAsPlainTextForDebug, false, {}, AZ::ConsoleFunctorFlags::Null + , "Save runtime assets as plain text rather than binary for debug purposes."); + + AZ_CVAR(bool, g_saveEditorAssetsAsPlainTextForDebug, false, {}, AZ::ConsoleFunctorFlags::Null + , "Save editor assets as plain text rather than binary for debug purposes."); + ScopedAuxiliaryEntityHandler::ScopedAuxiliaryEntityHandler(AZ::Entity* buildEntity) : m_buildEntity(buildEntity) , m_wasAdded(false) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h index 1a644d312e..c29a648eca 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h @@ -24,6 +24,7 @@ #include #include #include +#include #define OBJECT_STREAM_EDITOR_ASSET_LOADING_SUPPORT_ENABLED @@ -42,6 +43,9 @@ namespace AZ namespace ScriptCanvas { + AZ_CVAR_EXTERNED(bool, g_saveRuntimeAssetsAsPlainTextForDebug); + AZ_CVAR_EXTERNED(bool, g_saveEditorAssetsAsPlainTextForDebug); + // A place holder identifier for the AZ::Entity that owns the graph. // 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; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionContext.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionContext.cpp index f7ae4a931e..8c3c3d6da2 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionContext.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionContext.cpp @@ -41,7 +41,7 @@ namespace ScriptCanvas { ActivationData::ActivationData(const RuntimeDataOverrides& variableOverrides, ActivationInputArray& storage) : variableOverrides(variableOverrides) - , runtimeData(variableOverrides.m_runtimeAsset->GetData()) + , runtimeData(variableOverrides.m_runtimeAsset->m_runtimeData) , storage(storage) {} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionState.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionState.cpp index 81f0528b45..882003e7a4 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionState.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/ExecutionState.cpp @@ -22,7 +22,7 @@ namespace ScriptCanvas ExecutionStateConfig::ExecutionStateConfig(AZ::Data::Asset runtimeAsset, RuntimeComponent& component) : asset(runtimeAsset) , component(component) - , runtimeData(runtimeAsset.Get()->GetData()) + , runtimeData(runtimeAsset.Get()->m_runtimeData) {} ExecutionState::ExecutionState(const ExecutionStateConfig& config) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp index 561708dea1..eb856963f7 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionInterpretedAPI.cpp @@ -509,9 +509,9 @@ namespace ScriptCanvas for (auto& dependency : runtimeData.m_requiredAssets) { - if (!dependency.Get()->GetData().m_areStaticsInitialized) + if (!dependency.Get()->m_runtimeData.m_areStaticsInitialized) { - InitializeInterpretedStatics(dependency.Get()->GetData()); + InitializeInterpretedStatics(dependency.Get()->m_runtimeData); } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpreted.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpreted.cpp index 3b963317ec..f0288fb279 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpreted.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/Interpreted/ExecutionStateInterpreted.cpp @@ -49,9 +49,9 @@ namespace ScriptCanvas , config.asset.GetId().ToString().data()); #endif - if (!runtimeAsset->GetData().m_areStaticsInitialized) + if (!runtimeAsset->m_runtimeData.m_areStaticsInitialized) { - Execution::InitializeInterpretedStatics(runtimeAsset->GetData()); + Execution::InitializeInterpretedStatics(runtimeAsset->m_runtimeData); } } @@ -70,8 +70,8 @@ namespace ScriptCanvas const Grammar::DebugExecution* ExecutionStateInterpreted::GetDebugSymbolIn(size_t index, const AZ::Data::AssetId& id) const { auto asset = ExecutionStateInterpretedCpp::GetSubgraphAssetForDebug(id); - return asset && asset.Get() && index < asset.Get()->GetData().m_debugMap.m_ins.size() - ? &(asset.Get()->GetData().m_debugMap.m_ins[index]) + return asset && asset.Get() && index < asset.Get()->m_runtimeData.m_debugMap.m_ins.size() + ? &(asset.Get()->m_runtimeData.m_debugMap.m_ins[index]) : nullptr; } @@ -85,8 +85,8 @@ namespace ScriptCanvas const Grammar::DebugExecution* ExecutionStateInterpreted::GetDebugSymbolOut(size_t index, const AZ::Data::AssetId& id) const { auto asset = ExecutionStateInterpretedCpp::GetSubgraphAssetForDebug(id); - return asset && asset.Get() && index < asset.Get()->GetData().m_debugMap.m_outs.size() - ? &(asset.Get()->GetData().m_debugMap.m_outs[index]) + return asset && asset.Get() && index < asset.Get()->m_runtimeData.m_debugMap.m_outs.size() + ? &(asset.Get()->m_runtimeData.m_debugMap.m_outs[index]) : nullptr; } @@ -100,8 +100,8 @@ namespace ScriptCanvas const Grammar::DebugExecution* ExecutionStateInterpreted::GetDebugSymbolReturn(size_t index, const AZ::Data::AssetId& id) const { auto asset = ExecutionStateInterpretedCpp::GetSubgraphAssetForDebug(id); - return asset && asset.Get() && index < asset.Get()->GetData().m_debugMap.m_returns.size() - ? &(asset.Get()->GetData().m_debugMap.m_returns[index]) + return asset && asset.Get() && index < asset.Get()->m_runtimeData.m_debugMap.m_returns.size() + ? &(asset.Get()->m_runtimeData.m_debugMap.m_returns[index]) : nullptr; } @@ -115,8 +115,8 @@ namespace ScriptCanvas const Grammar::DebugDataSource* ExecutionStateInterpreted::GetDebugSymbolVariableChange(size_t index, const AZ::Data::AssetId& id) const { auto asset = ExecutionStateInterpretedCpp::GetSubgraphAssetForDebug(id); - return asset && asset.Get() && index < asset.Get()->GetData().m_debugMap.m_variables.size() - ? &(asset.Get()->GetData().m_debugMap.m_variables[index]) + return asset && asset.Get() && index < asset.Get()->m_runtimeData.m_debugMap.m_variables.size() + ? &(asset.Get()->m_runtimeData.m_debugMap.m_variables[index]) : nullptr; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/RuntimeComponent.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/RuntimeComponent.cpp index 930b84abe4..23eba22524 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/RuntimeComponent.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Execution/RuntimeComponent.cpp @@ -71,7 +71,7 @@ namespace ScriptCanvas const RuntimeData& RuntimeComponent::GetRuntimeAssetData() const { - return m_runtimeOverrides.m_runtimeAsset->GetData(); + return m_runtimeOverrides.m_runtimeAsset->m_runtimeData; } ExecutionMode RuntimeComponent::GetExecutionMode() const diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionCallNode.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionCallNode.cpp index 225949d833..551b9b4002 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionCallNode.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionCallNode.cpp @@ -261,11 +261,11 @@ namespace ScriptCanvas , const ScriptCanvas::Grammar::FunctionSourceId& sourceId , const SlotExecution::Map& previousMap) { - const Grammar::SubgraphInterface& subgraphInterface = runtimeAsset.Get()->m_runtimeData.m_interface; + const Grammar::SubgraphInterface& subgraphInterface = runtimeAsset.Get()->m_interfaceData.m_interface; if (subgraphInterface.IsUserNodeable() && Grammar::IsFunctionSourceIdNodeable(sourceId) && subgraphInterface.HasIn(sourceId)) { - m_prettyName = runtimeAsset.Get()->m_runtimeData.m_name; + m_prettyName = runtimeAsset.Get()->m_interfaceData.m_name; BuildUserNodeableNode(subgraphInterface, previousMap); } else if ((!Grammar::IsFunctionSourceIdNodeable(sourceId)) && subgraphInterface.HasIn(sourceId)) @@ -477,7 +477,7 @@ namespace ScriptCanvas return true; } - const Grammar::SubgraphInterface* latestAssetInterface = asset ? &asset.Get()->GetData().m_interface : nullptr; + const Grammar::SubgraphInterface* latestAssetInterface = asset ? &asset.Get()->m_interfaceData.m_interface : nullptr; if (!latestAssetInterface) { AZ_Warning("ScriptCanvas", false, "FunctionCallNode %s failed to load latest interface from the source asset.", m_prettyName.data()); @@ -517,7 +517,7 @@ namespace ScriptCanvas DataSlotMap dataSlotMap; if (m_slotExecutionMap.IsEmpty()) { - const Grammar::SubgraphInterface& subgraphInterface = assetData.Get()->m_runtimeData.m_interface; + const Grammar::SubgraphInterface& subgraphInterface = assetData.Get()->m_interfaceData.m_interface; RemoveInsFromInterface(subgraphInterface.GetIns(), executionSlotMap, dataSlotMap, k_DoNotRemoveConnections, k_DoNotWarnOnMissingDataSlots); RemoveOutsFromInterface(subgraphInterface.GetLatentOuts(), executionSlotMap, dataSlotMap, k_DoNotRemoveConnections, k_DoNotWarnOnMissingDataSlots); } @@ -806,7 +806,7 @@ namespace ScriptCanvas return; } - m_prettyName = assetData.Get()->m_runtimeData.m_name; + m_prettyName = assetData.Get()->m_interfaceData.m_name; } } } diff --git a/Gems/ScriptCanvas/Code/Tests/ScriptCanvasBuilderTests.cpp b/Gems/ScriptCanvas/Code/Tests/ScriptCanvasBuilderTests.cpp index 33982bbcd7..cac26eff95 100644 --- a/Gems/ScriptCanvas/Code/Tests/ScriptCanvasBuilderTests.cpp +++ b/Gems/ScriptCanvas/Code/Tests/ScriptCanvasBuilderTests.cpp @@ -153,11 +153,10 @@ TEST_F(ScriptCanvasBuilderTests, ScriptCanvasWithAssetReference_GatherProductDep graphEntity->AddComponent(assetComponent); ScriptCanvas::RuntimeData runtimeData; - //runtimeData.m_graphData.m_nodes.emplace(graphEntity); - + AZ::Data::Asset runtimeAsset; runtimeAsset.Create(AZ::Uuid::CreateRandom()); - runtimeAsset.Get()->SetData(runtimeData); + runtimeAsset.Get()->m_runtimeData = runtimeData; AZStd::vector productDependencies; AssetBuilderSDK::ProductPathDependencySet productPathDependencySet; From 18ce01ba7c3832b8fcc15899834cd0b9d74a9e1f Mon Sep 17 00:00:00 2001 From: rgba16f <82187279+rgba16f@users.noreply.github.com> Date: Fri, 17 Dec 2021 15:08:43 -0600 Subject: [PATCH 190/948] Add 2 performance testing levels (#6463) First a level with approximately 10K cubes with various PBR materials Second a level with a vegetation system set up to spawn between 10K - 30K instances of cubes with various PBR materials Plus ancillary data files these levels need. Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com> --- .../10KEntityCpuPerfTest.prefab | 1032 + .../Performance/10KEntityCpuPerfTest/tags.txt | 12 + .../10KVegInstancesTest.prefab | 4216 + .../Performance/10kVegInstancesTest/tags.txt | 12 + .../TestData/Graphics/AtomCubeWall.prefab | 102345 +++++++++++++++ .../Graphics/CubeAluminumPolishedPBR.prefab | 156 + .../Graphics/CubeBrassPolishedPBR.prefab | 156 + .../Graphics/CubeChromePolishedPBR.prefab | 156 + .../Graphics/CubeCobaltPolishedPBR.prefab | 156 + .../Graphics/CubeCopperPolishedPBR.prefab | 156 + .../Graphics/CubeGoldPolishedPBR.prefab | 156 + .../Graphics/CubeIronPolishedPBR.prefab | 156 + .../TestData/Graphics/CubeMercuryPBR.prefab | 156 + .../Graphics/CubeNickelPolishedPBR.prefab | 156 + .../Graphics/CubePalladiumPolishedPBR.prefab | 156 + .../Graphics/CubePlatinumPolishedPBR.prefab | 156 + .../Graphics/CubeSilverPolishedPBR.prefab | 156 + .../Graphics/CubeTitaniumPolishedPBR.prefab | 156 + 18 files changed, 109645 insertions(+) create mode 100644 AutomatedTesting/Levels/Performance/10KEntityCpuPerfTest/10KEntityCpuPerfTest.prefab create mode 100644 AutomatedTesting/Levels/Performance/10KEntityCpuPerfTest/tags.txt create mode 100644 AutomatedTesting/Levels/Performance/10kVegInstancesTest/10KVegInstancesTest.prefab create mode 100644 AutomatedTesting/Levels/Performance/10kVegInstancesTest/tags.txt create mode 100644 AutomatedTesting/Prefabs/TestData/Graphics/AtomCubeWall.prefab create mode 100644 AutomatedTesting/Prefabs/TestData/Graphics/CubeAluminumPolishedPBR.prefab create mode 100644 AutomatedTesting/Prefabs/TestData/Graphics/CubeBrassPolishedPBR.prefab create mode 100644 AutomatedTesting/Prefabs/TestData/Graphics/CubeChromePolishedPBR.prefab create mode 100644 AutomatedTesting/Prefabs/TestData/Graphics/CubeCobaltPolishedPBR.prefab create mode 100644 AutomatedTesting/Prefabs/TestData/Graphics/CubeCopperPolishedPBR.prefab create mode 100644 AutomatedTesting/Prefabs/TestData/Graphics/CubeGoldPolishedPBR.prefab create mode 100644 AutomatedTesting/Prefabs/TestData/Graphics/CubeIronPolishedPBR.prefab create mode 100644 AutomatedTesting/Prefabs/TestData/Graphics/CubeMercuryPBR.prefab create mode 100644 AutomatedTesting/Prefabs/TestData/Graphics/CubeNickelPolishedPBR.prefab create mode 100644 AutomatedTesting/Prefabs/TestData/Graphics/CubePalladiumPolishedPBR.prefab create mode 100644 AutomatedTesting/Prefabs/TestData/Graphics/CubePlatinumPolishedPBR.prefab create mode 100644 AutomatedTesting/Prefabs/TestData/Graphics/CubeSilverPolishedPBR.prefab create mode 100644 AutomatedTesting/Prefabs/TestData/Graphics/CubeTitaniumPolishedPBR.prefab diff --git a/AutomatedTesting/Levels/Performance/10KEntityCpuPerfTest/10KEntityCpuPerfTest.prefab b/AutomatedTesting/Levels/Performance/10KEntityCpuPerfTest/10KEntityCpuPerfTest.prefab new file mode 100644 index 0000000000..5024ca9192 --- /dev/null +++ b/AutomatedTesting/Levels/Performance/10KEntityCpuPerfTest/10KEntityCpuPerfTest.prefab @@ -0,0 +1,1032 @@ +{ + "ContainerEntity": { + "Id": "Entity_[1146574390643]", + "Name": "Level", + "Components": { + "Component_[10641544592923449938]": { + "$type": "EditorInspectorComponent", + "Id": 10641544592923449938 + }, + "Component_[12039882709170782873]": { + "$type": "EditorOnlyEntityComponent", + "Id": 12039882709170782873 + }, + "Component_[12265484671603697631]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12265484671603697631 + }, + "Component_[14126657869720434043]": { + "$type": "EditorEntitySortComponent", + "Id": 14126657869720434043, + "Child Entity Order": [ + "Entity_[1176639161715]", + "Instance_[470615713748]/ContainerEntity", + "Instance_[62786296211412]/ContainerEntity", + "Instance_[513945563413]/ContainerEntity", + "Instance_[612729811221]/ContainerEntity", + "Instance_[745873797397]/ContainerEntity" + ] + }, + "Component_[15230859088967841193]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 15230859088967841193, + "Parent Entity": "" + }, + "Component_[16239496886950819870]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 16239496886950819870 + }, + "Component_[5688118765544765547]": { + "$type": "EditorEntityIconComponent", + "Id": 5688118765544765547 + }, + "Component_[6545738857812235305]": { + "$type": "SelectionComponent", + "Id": 6545738857812235305 + }, + "Component_[7247035804068349658]": { + "$type": "EditorPrefabComponent", + "Id": 7247035804068349658 + }, + "Component_[9307224322037797205]": { + "$type": "EditorLockComponent", + "Id": 9307224322037797205 + }, + "Component_[9562516168917670048]": { + "$type": "EditorVisibilityComponent", + "Id": 9562516168917670048 + } + } + }, + "Entities": { + "Entity_[1155164325235]": { + "Id": "Entity_[1155164325235]", + "Name": "Sun", + "Components": { + "Component_[10440557478882592717]": { + "$type": "SelectionComponent", + "Id": 10440557478882592717 + }, + "Component_[13620450453324765907]": { + "$type": "EditorLockComponent", + "Id": 13620450453324765907 + }, + "Component_[2134313378593666258]": { + "$type": "EditorInspectorComponent", + "Id": 2134313378593666258 + }, + "Component_[234010807770404186]": { + "$type": "EditorVisibilityComponent", + "Id": 234010807770404186 + }, + "Component_[2970359110423865725]": { + "$type": "EditorEntityIconComponent", + "Id": 2970359110423865725 + }, + "Component_[3722854130373041803]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3722854130373041803 + }, + "Component_[5992533738676323195]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5992533738676323195 + }, + "Component_[7378860763541895402]": { + "$type": "AZ::Render::EditorDirectionalLightComponent", + "Id": 7378860763541895402, + "Controller": { + "Configuration": { + "Intensity": 1.0, + "CameraEntityId": "", + "ShadowFilterMethod": 1 + } + } + }, + "Component_[7892834440890947578]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 7892834440890947578, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + 0.0, + 0.0, + 13.487043380737305 + ], + "Rotate": [ + -76.13099670410156, + -0.847000002861023, + -15.8100004196167 + ] + } + }, + "Component_[8599729549570828259]": { + "$type": "EditorEntitySortComponent", + "Id": 8599729549570828259 + }, + "Component_[952797371922080273]": { + "$type": "EditorPendingCompositionComponent", + "Id": 952797371922080273 + } + } + }, + "Entity_[1159459292531]": { + "Id": "Entity_[1159459292531]", + "Name": "Ground", + "Components": { + "Component_[11701138785793981042]": { + "$type": "SelectionComponent", + "Id": 11701138785793981042 + }, + "Component_[12260880513256986252]": { + "$type": "EditorEntityIconComponent", + "Id": 12260880513256986252 + }, + "Component_[13711420870643673468]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13711420870643673468 + }, + "Component_[138002849734991713]": { + "$type": "EditorOnlyEntityComponent", + "Id": 138002849734991713 + }, + "Component_[16578565737331764849]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 16578565737331764849, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[16919232076966545697]": { + "$type": "EditorInspectorComponent", + "Id": 16919232076966545697 + }, + "Component_[5182430712893438093]": { + "$type": "EditorMaterialComponent", + "Id": 5182430712893438093 + }, + "Component_[5675108321710651991]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 5675108321710651991, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{0CD745C0-6AA8-569A-A68A-73A3270986C4}", + "subId": 277889906 + }, + "assetHint": "objects/groudplane/groundplane_512x512m.azmodel" + } + } + } + }, + "Component_[5681893399601237518]": { + "$type": "EditorEntitySortComponent", + "Id": 5681893399601237518 + }, + "Component_[592692962543397545]": { + "$type": "EditorPendingCompositionComponent", + "Id": 592692962543397545 + }, + "Component_[7090012899106946164]": { + "$type": "EditorLockComponent", + "Id": 7090012899106946164 + }, + "Component_[9410832619875640998]": { + "$type": "EditorVisibilityComponent", + "Id": 9410832619875640998 + } + } + }, + "Entity_[1163754259827]": { + "Id": "Entity_[1163754259827]", + "Name": "Camera", + "Components": { + "Component_[11895140916889160460]": { + "$type": "EditorEntityIconComponent", + "Id": 11895140916889160460 + }, + "Component_[16880285896855930892]": { + "$type": "{CA11DA46-29FF-4083-B5F6-E02C3A8C3A3D} EditorCameraComponent", + "Id": 16880285896855930892, + "Controller": { + "Configuration": { + "Field of View": 55.0, + "EditorEntityId": 4792520350429473643 + } + } + }, + "Component_[17187464423780271193]": { + "$type": "EditorLockComponent", + "Id": 17187464423780271193 + }, + "Component_[17495696818315413311]": { + "$type": "EditorEntitySortComponent", + "Id": 17495696818315413311 + }, + "Component_[18086214374043522055]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 18086214374043522055, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + -2.3000001907348633, + -3.9368600845336914, + 1.0 + ], + "Rotate": [ + -2.050307512283325, + 1.9552897214889526, + -43.623355865478516 + ] + } + }, + "Component_[18387556550380114975]": { + "$type": "SelectionComponent", + "Id": 18387556550380114975 + }, + "Component_[2654521436129313160]": { + "$type": "EditorVisibilityComponent", + "Id": 2654521436129313160 + }, + "Component_[5265045084611556958]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5265045084611556958 + }, + "Component_[7169798125182238623]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7169798125182238623 + }, + "Component_[7255796294953281766]": { + "$type": "GenericComponentWrapper", + "Id": 7255796294953281766, + "m_template": { + "$type": "FlyCameraInputComponent" + } + }, + "Component_[8866210352157164042]": { + "$type": "EditorInspectorComponent", + "Id": 8866210352157164042 + }, + "Component_[9129253381063760879]": { + "$type": "EditorOnlyEntityComponent", + "Id": 9129253381063760879 + } + } + }, + "Entity_[1168049227123]": { + "Id": "Entity_[1168049227123]", + "Name": "Grid", + "Components": { + "Component_[11443347433215807130]": { + "$type": "EditorEntityIconComponent", + "Id": 11443347433215807130 + }, + "Component_[11779275529534764488]": { + "$type": "SelectionComponent", + "Id": 11779275529534764488 + }, + "Component_[14249419413039427459]": { + "$type": "EditorInspectorComponent", + "Id": 14249419413039427459 + }, + "Component_[15448581635946161318]": { + "$type": "AZ::Render::EditorGridComponent", + "Id": 15448581635946161318, + "Controller": { + "Configuration": { + "primarySpacing": 4.0, + "primaryColor": [ + 0.501960813999176, + 0.501960813999176, + 0.501960813999176 + ], + "secondarySpacing": 0.5, + "secondaryColor": [ + 0.250980406999588, + 0.250980406999588, + 0.250980406999588 + ] + } + } + }, + "Component_[1843303322527297409]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1843303322527297409 + }, + "Component_[380249072065273654]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 380249072065273654, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[7476660583684339787]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7476660583684339787 + }, + "Component_[7557626501215118375]": { + "$type": "EditorEntitySortComponent", + "Id": 7557626501215118375 + }, + "Component_[7984048488947365511]": { + "$type": "EditorVisibilityComponent", + "Id": 7984048488947365511 + }, + "Component_[8118181039276487398]": { + "$type": "EditorOnlyEntityComponent", + "Id": 8118181039276487398 + }, + "Component_[9189909764215270515]": { + "$type": "EditorLockComponent", + "Id": 9189909764215270515 + } + } + }, + "Entity_[1176639161715]": { + "Id": "Entity_[1176639161715]", + "Name": "Atom Default Environment", + "Components": { + "Component_[10757302973393310045]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 10757302973393310045, + "Parent Entity": "Entity_[1146574390643]" + }, + "Component_[14505817420424255464]": { + "$type": "EditorInspectorComponent", + "Id": 14505817420424255464, + "ComponentOrderEntryArray": [ + { + "ComponentId": 10757302973393310045 + } + ] + }, + "Component_[14988041764659020032]": { + "$type": "EditorLockComponent", + "Id": 14988041764659020032 + }, + "Component_[15808690248755038124]": { + "$type": "SelectionComponent", + "Id": 15808690248755038124 + }, + "Component_[15900837685796817138]": { + "$type": "EditorVisibilityComponent", + "Id": 15900837685796817138 + }, + "Component_[3298767348226484884]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3298767348226484884 + }, + "Component_[4076975109609220594]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4076975109609220594 + }, + "Component_[5679760548946028854]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5679760548946028854 + }, + "Component_[5855590796136709437]": { + "$type": "EditorEntitySortComponent", + "Id": 5855590796136709437, + "Child Entity Order": [ + "Entity_[1155164325235]", + "Entity_[1180934129011]", + "Entity_[1168049227123]", + "Entity_[1163754259827]", + "Entity_[1159459292531]" + ] + }, + "Component_[9277695270015777859]": { + "$type": "EditorEntityIconComponent", + "Id": 9277695270015777859 + } + } + }, + "Entity_[1180934129011]": { + "Id": "Entity_[1180934129011]", + "Name": "Global Sky", + "Components": { + "Component_[11980494120202836095]": { + "$type": "SelectionComponent", + "Id": 11980494120202836095 + }, + "Component_[12198510776899974386]": { + "$type": "AZ::Render::EditorHDRiSkyboxComponent", + "Id": 12198510776899974386, + "Controller": { + "Configuration": { + "CubemapAsset": { + "assetId": { + "guid": "{215E47FD-D181-5832-B1AB-91673ABF6399}", + "subId": 1000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_skyboxcm.exr.streamingimage" + } + } + } + }, + "Component_[1428633914413949476]": { + "$type": "EditorLockComponent", + "Id": 1428633914413949476 + }, + "Component_[14936200426671614999]": { + "$type": "AZ::Render::EditorImageBasedLightComponent", + "Id": 14936200426671614999, + "Controller": { + "Configuration": { + "diffuseImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 3000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_ibldiffuse.exr.streamingimage" + }, + "specularImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 2000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_iblspecular.exr.streamingimage" + } + } + } + }, + "Component_[14994774102579326069]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 14994774102579326069 + }, + "Component_[15417479889044493340]": { + "$type": "EditorPendingCompositionComponent", + "Id": 15417479889044493340 + }, + "Component_[15826613364991382688]": { + "$type": "EditorEntitySortComponent", + "Id": 15826613364991382688 + }, + "Component_[1665003113283562343]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1665003113283562343 + }, + "Component_[3704934735944502280]": { + "$type": "EditorEntityIconComponent", + "Id": 3704934735944502280 + }, + "Component_[5698542331457326479]": { + "$type": "EditorVisibilityComponent", + "Id": 5698542331457326479 + }, + "Component_[6644513399057217122]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6644513399057217122, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[931091830724002070]": { + "$type": "EditorInspectorComponent", + "Id": 931091830724002070 + } + } + } + }, + "Instances": { + "Instance_[470615713748]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[513945563413]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 10.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[612729811221]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 15.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[62786296211412]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 5.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[745873797397]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 20.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[745873797497]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 25.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[745873797597]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 30.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[745873797697]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 35.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[745873797797]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 40.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[745873797897]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 45.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[745873797997]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[745873798097]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 55.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[745873798197]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 60.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[745873798297]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 65.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[745873798397]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 70.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[745873798497]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 75.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[745873798597]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 80.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[745873798697]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 85.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[745873798797]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 90.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[745873798897]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 95.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[745873798997]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 100.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[745873799097]": { + "Source": "Prefabs/TestData/Graphics/AtomCubeWall.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Parent Entity", + "value": "../Entity_[1146574390643]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/0", + "value": 50.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/1", + "value": 105.0 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5052757994340238524]/Transform Data/Translate/2", + "value": 1.0 + } + ] + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/Performance/10KEntityCpuPerfTest/tags.txt b/AutomatedTesting/Levels/Performance/10KEntityCpuPerfTest/tags.txt new file mode 100644 index 0000000000..0d6c1880e7 --- /dev/null +++ b/AutomatedTesting/Levels/Performance/10KEntityCpuPerfTest/tags.txt @@ -0,0 +1,12 @@ +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 diff --git a/AutomatedTesting/Levels/Performance/10kVegInstancesTest/10KVegInstancesTest.prefab b/AutomatedTesting/Levels/Performance/10kVegInstancesTest/10KVegInstancesTest.prefab new file mode 100644 index 0000000000..4e6b17de73 --- /dev/null +++ b/AutomatedTesting/Levels/Performance/10kVegInstancesTest/10KVegInstancesTest.prefab @@ -0,0 +1,4216 @@ +{ + "ContainerEntity": { + "Id": "Entity_[1146574390643]", + "Name": "Level", + "Components": { + "Component_[10641544592923449938]": { + "$type": "EditorInspectorComponent", + "Id": 10641544592923449938 + }, + "Component_[12039882709170782873]": { + "$type": "EditorOnlyEntityComponent", + "Id": 12039882709170782873 + }, + "Component_[12265484671603697631]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12265484671603697631 + }, + "Component_[14126657869720434043]": { + "$type": "EditorEntitySortComponent", + "Id": 14126657869720434043, + "Child Entity Order": [ + "Entity_[1176639161715]", + "Entity_[655472831242]", + "Entity_[659767798538]" + ] + }, + "Component_[14900044899939389494]": { + "$type": "EditorDebugComponent", + "Id": 14900044899939389494, + "Configuration": { + "ShowDebugStats": true + } + }, + "Component_[15230859088967841193]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 15230859088967841193, + "Parent Entity": "" + }, + "Component_[16239496886950819870]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 16239496886950819870 + }, + "Component_[16599802339219703605]": { + "$type": "EditorLevelSettingsComponent", + "Id": 16599802339219703605, + "Configuration": { + "AreaSystemConfig": { + "ViewRectangleSize": 25, + "SectorDensity": 2, + "SectorSizeInMeters": 10 + } + } + }, + "Component_[5688118765544765547]": { + "$type": "EditorEntityIconComponent", + "Id": 5688118765544765547 + }, + "Component_[6545738857812235305]": { + "$type": "SelectionComponent", + "Id": 6545738857812235305 + }, + "Component_[7247035804068349658]": { + "$type": "EditorPrefabComponent", + "Id": 7247035804068349658 + }, + "Component_[9307224322037797205]": { + "$type": "EditorLockComponent", + "Id": 9307224322037797205 + }, + "Component_[9562516168917670048]": { + "$type": "EditorVisibilityComponent", + "Id": 9562516168917670048 + } + } + }, + "Entities": { + "Entity_[1155164325235]": { + "Id": "Entity_[1155164325235]", + "Name": "Sun", + "Components": { + "Component_[10440557478882592717]": { + "$type": "SelectionComponent", + "Id": 10440557478882592717 + }, + "Component_[13620450453324765907]": { + "$type": "EditorLockComponent", + "Id": 13620450453324765907 + }, + "Component_[2134313378593666258]": { + "$type": "EditorInspectorComponent", + "Id": 2134313378593666258 + }, + "Component_[234010807770404186]": { + "$type": "EditorVisibilityComponent", + "Id": 234010807770404186 + }, + "Component_[2970359110423865725]": { + "$type": "EditorEntityIconComponent", + "Id": 2970359110423865725 + }, + "Component_[3722854130373041803]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3722854130373041803 + }, + "Component_[5992533738676323195]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5992533738676323195 + }, + "Component_[7378860763541895402]": { + "$type": "AZ::Render::EditorDirectionalLightComponent", + "Id": 7378860763541895402, + "Controller": { + "Configuration": { + "Intensity": 1.0, + "CameraEntityId": "", + "ShadowFilterMethod": 1 + } + } + }, + "Component_[7892834440890947578]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 7892834440890947578, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + 0.0, + 0.0, + 13.487043380737305 + ], + "Rotate": [ + -76.13099670410156, + -0.847000002861023, + -15.8100004196167 + ] + } + }, + "Component_[8599729549570828259]": { + "$type": "EditorEntitySortComponent", + "Id": 8599729549570828259 + }, + "Component_[952797371922080273]": { + "$type": "EditorPendingCompositionComponent", + "Id": 952797371922080273 + } + } + }, + "Entity_[1159459292531]": { + "Id": "Entity_[1159459292531]", + "Name": "Ground", + "Components": { + "Component_[11701138785793981042]": { + "$type": "SelectionComponent", + "Id": 11701138785793981042 + }, + "Component_[12260880513256986252]": { + "$type": "EditorEntityIconComponent", + "Id": 12260880513256986252 + }, + "Component_[13711420870643673468]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13711420870643673468 + }, + "Component_[138002849734991713]": { + "$type": "EditorOnlyEntityComponent", + "Id": 138002849734991713 + }, + "Component_[16578565737331764849]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 16578565737331764849, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[16919232076966545697]": { + "$type": "EditorInspectorComponent", + "Id": 16919232076966545697 + }, + "Component_[5182430712893438093]": { + "$type": "EditorMaterialComponent", + "Id": 5182430712893438093 + }, + "Component_[5675108321710651991]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 5675108321710651991, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{0CD745C0-6AA8-569A-A68A-73A3270986C4}", + "subId": 277889906 + }, + "assetHint": "objects/groudplane/groundplane_512x512m.azmodel" + } + } + } + }, + "Component_[5681893399601237518]": { + "$type": "EditorEntitySortComponent", + "Id": 5681893399601237518 + }, + "Component_[592692962543397545]": { + "$type": "EditorPendingCompositionComponent", + "Id": 592692962543397545 + }, + "Component_[7090012899106946164]": { + "$type": "EditorLockComponent", + "Id": 7090012899106946164 + }, + "Component_[9410832619875640998]": { + "$type": "EditorVisibilityComponent", + "Id": 9410832619875640998 + } + } + }, + "Entity_[1163754259827]": { + "Id": "Entity_[1163754259827]", + "Name": "Camera", + "Components": { + "Component_[11895140916889160460]": { + "$type": "EditorEntityIconComponent", + "Id": 11895140916889160460 + }, + "Component_[16880285896855930892]": { + "$type": "{CA11DA46-29FF-4083-B5F6-E02C3A8C3A3D} EditorCameraComponent", + "Id": 16880285896855930892, + "Controller": { + "Configuration": { + "Field of View": 55.0, + "EditorEntityId": 17772187112516355261 + } + } + }, + "Component_[17187464423780271193]": { + "$type": "EditorLockComponent", + "Id": 17187464423780271193 + }, + "Component_[17495696818315413311]": { + "$type": "EditorEntitySortComponent", + "Id": 17495696818315413311 + }, + "Component_[18086214374043522055]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 18086214374043522055, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + -2.3000001907348633, + -3.9368600845336914, + 1.0 + ], + "Rotate": [ + -2.050307512283325, + 1.9552897214889526, + -43.623355865478516 + ] + } + }, + "Component_[18387556550380114975]": { + "$type": "SelectionComponent", + "Id": 18387556550380114975 + }, + "Component_[2654521436129313160]": { + "$type": "EditorVisibilityComponent", + "Id": 2654521436129313160 + }, + "Component_[5265045084611556958]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5265045084611556958 + }, + "Component_[7169798125182238623]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7169798125182238623 + }, + "Component_[7255796294953281766]": { + "$type": "GenericComponentWrapper", + "Id": 7255796294953281766, + "m_template": { + "$type": "FlyCameraInputComponent" + } + }, + "Component_[8866210352157164042]": { + "$type": "EditorInspectorComponent", + "Id": 8866210352157164042 + }, + "Component_[9129253381063760879]": { + "$type": "EditorOnlyEntityComponent", + "Id": 9129253381063760879 + } + } + }, + "Entity_[1168049227123]": { + "Id": "Entity_[1168049227123]", + "Name": "Grid", + "Components": { + "Component_[11443347433215807130]": { + "$type": "EditorEntityIconComponent", + "Id": 11443347433215807130 + }, + "Component_[11779275529534764488]": { + "$type": "SelectionComponent", + "Id": 11779275529534764488 + }, + "Component_[14249419413039427459]": { + "$type": "EditorInspectorComponent", + "Id": 14249419413039427459 + }, + "Component_[15448581635946161318]": { + "$type": "AZ::Render::EditorGridComponent", + "Id": 15448581635946161318, + "Controller": { + "Configuration": { + "primarySpacing": 4.0, + "primaryColor": [ + 0.501960813999176, + 0.501960813999176, + 0.501960813999176 + ], + "secondarySpacing": 0.5, + "secondaryColor": [ + 0.250980406999588, + 0.250980406999588, + 0.250980406999588 + ] + } + } + }, + "Component_[1843303322527297409]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1843303322527297409 + }, + "Component_[380249072065273654]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 380249072065273654, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[7476660583684339787]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7476660583684339787 + }, + "Component_[7557626501215118375]": { + "$type": "EditorEntitySortComponent", + "Id": 7557626501215118375 + }, + "Component_[7984048488947365511]": { + "$type": "EditorVisibilityComponent", + "Id": 7984048488947365511 + }, + "Component_[8118181039276487398]": { + "$type": "EditorOnlyEntityComponent", + "Id": 8118181039276487398 + }, + "Component_[9189909764215270515]": { + "$type": "EditorLockComponent", + "Id": 9189909764215270515 + } + } + }, + "Entity_[1172344194419]": { + "Id": "Entity_[1172344194419]", + "Name": "Shader Ball", + "Components": { + "Component_[10789351944715265527]": { + "$type": "EditorOnlyEntityComponent", + "Id": 10789351944715265527 + }, + "Component_[12037033284781049225]": { + "$type": "EditorEntitySortComponent", + "Id": 12037033284781049225 + }, + "Component_[13759153306105970079]": { + "$type": "EditorPendingCompositionComponent", + "Id": 13759153306105970079 + }, + "Component_[14135560884830586279]": { + "$type": "EditorInspectorComponent", + "Id": 14135560884830586279 + }, + "Component_[16247165675903986673]": { + "$type": "EditorVisibilityComponent", + "Id": 16247165675903986673 + }, + "Component_[18082433625958885247]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 18082433625958885247 + }, + "Component_[6472623349872972660]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6472623349872972660, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Rotate": [ + 0.0, + 0.10000000149011612, + 180.0 + ] + } + }, + "Component_[6495255223970673916]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 6495255223970673916, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{FD340C30-755C-5911-92A3-19A3F7A77931}", + "subId": 281415304 + }, + "assetHint": "objects/shaderball/shaderball_default_1m.azmodel" + } + } + } + }, + "Component_[8056625192494070973]": { + "$type": "SelectionComponent", + "Id": 8056625192494070973 + }, + "Component_[8550141614185782969]": { + "$type": "EditorEntityIconComponent", + "Id": 8550141614185782969 + }, + "Component_[9439770997198325425]": { + "$type": "EditorLockComponent", + "Id": 9439770997198325425 + } + } + }, + "Entity_[1176639161715]": { + "Id": "Entity_[1176639161715]", + "Name": "Atom Default Environment", + "Components": { + "Component_[10757302973393310045]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 10757302973393310045, + "Parent Entity": "Entity_[1146574390643]" + }, + "Component_[14505817420424255464]": { + "$type": "EditorInspectorComponent", + "Id": 14505817420424255464, + "ComponentOrderEntryArray": [ + { + "ComponentId": 10757302973393310045 + } + ] + }, + "Component_[14988041764659020032]": { + "$type": "EditorLockComponent", + "Id": 14988041764659020032 + }, + "Component_[15808690248755038124]": { + "$type": "SelectionComponent", + "Id": 15808690248755038124 + }, + "Component_[15900837685796817138]": { + "$type": "EditorVisibilityComponent", + "Id": 15900837685796817138 + }, + "Component_[3298767348226484884]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3298767348226484884 + }, + "Component_[4076975109609220594]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4076975109609220594 + }, + "Component_[5679760548946028854]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5679760548946028854 + }, + "Component_[5855590796136709437]": { + "$type": "EditorEntitySortComponent", + "Id": 5855590796136709437, + "Child Entity Order": [ + "Entity_[1155164325235]", + "Entity_[1180934129011]", + "Entity_[1172344194419]", + "Entity_[1168049227123]", + "Entity_[1163754259827]", + "Entity_[1159459292531]" + ] + }, + "Component_[9277695270015777859]": { + "$type": "EditorEntityIconComponent", + "Id": 9277695270015777859 + } + } + }, + "Entity_[1180934129011]": { + "Id": "Entity_[1180934129011]", + "Name": "Global Sky", + "Components": { + "Component_[11231930600558681245]": { + "$type": "AZ::Render::EditorHDRiSkyboxComponent", + "Id": 11231930600558681245, + "Controller": { + "Configuration": { + "CubemapAsset": { + "assetId": { + "guid": "{215E47FD-D181-5832-B1AB-91673ABF6399}", + "subId": 1000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_skyboxcm.exr.streamingimage" + } + } + } + }, + "Component_[11980494120202836095]": { + "$type": "SelectionComponent", + "Id": 11980494120202836095 + }, + "Component_[1428633914413949476]": { + "$type": "EditorLockComponent", + "Id": 1428633914413949476 + }, + "Component_[14936200426671614999]": { + "$type": "AZ::Render::EditorImageBasedLightComponent", + "Id": 14936200426671614999, + "Controller": { + "Configuration": { + "diffuseImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 3000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_ibldiffuse.exr.streamingimage" + }, + "specularImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 2000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_iblspecular.exr.streamingimage" + } + } + } + }, + "Component_[14994774102579326069]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 14994774102579326069 + }, + "Component_[15417479889044493340]": { + "$type": "EditorPendingCompositionComponent", + "Id": 15417479889044493340 + }, + "Component_[15826613364991382688]": { + "$type": "EditorEntitySortComponent", + "Id": 15826613364991382688 + }, + "Component_[1665003113283562343]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1665003113283562343 + }, + "Component_[3704934735944502280]": { + "$type": "EditorEntityIconComponent", + "Id": 3704934735944502280 + }, + "Component_[5698542331457326479]": { + "$type": "EditorVisibilityComponent", + "Id": 5698542331457326479 + }, + "Component_[6644513399057217122]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6644513399057217122, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[931091830724002070]": { + "$type": "EditorInspectorComponent", + "Id": 931091830724002070 + } + } + }, + "Entity_[2994134174757065]": { + "Id": "Entity_[2994134174757065]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 31.24283218383789 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[2994138469724361]": { + "Id": "Entity_[2994138469724361]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 33.24283218383789 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[2994142764691657]": { + "Id": "Entity_[2994142764691657]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 29.24283218383789 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[2994147059658953]": { + "Id": "Entity_[2994147059658953]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 27.24283218383789 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[2994151354626249]": { + "Id": "Entity_[2994151354626249]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 19.24283218383789 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[2994155649593545]": { + "Id": "Entity_[2994155649593545]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 25.24283218383789 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[2994159944560841]": { + "Id": "Entity_[2994159944560841]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 37.24283218383789 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[2994164239528137]": { + "Id": "Entity_[2994164239528137]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 35.24283218383789 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[2994168534495433]": { + "Id": "Entity_[2994168534495433]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 21.24283218383789 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[2994172829462729]": { + "Id": "Entity_[2994172829462729]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 23.24283218383789 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[3446213842399433]": { + "Id": "Entity_[3446213842399433]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 49.431697845458984 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[3446218137366729]": { + "Id": "Entity_[3446218137366729]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 41.431697845458984 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[3446222432334025]": { + "Id": "Entity_[3446222432334025]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 45.431697845458984 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[3446226727301321]": { + "Id": "Entity_[3446226727301321]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 57.431697845458984 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[3446231022268617]": { + "Id": "Entity_[3446231022268617]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 53.431697845458984 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[3446235317235913]": { + "Id": "Entity_[3446235317235913]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 43.431697845458984 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[3446239612203209]": { + "Id": "Entity_[3446239612203209]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 51.431697845458984 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[3446243907170505]": { + "Id": "Entity_[3446243907170505]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 47.431697845458984 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[3446248202137801]": { + "Id": "Entity_[3446248202137801]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 39.431697845458984 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[3446252497105097]": { + "Id": "Entity_[3446252497105097]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 55.431697845458984 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[4073064319250633]": { + "Id": "Entity_[4073064319250633]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 72.24310302734375 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[4073068614217929]": { + "Id": "Entity_[4073068614217929]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 60.243099212646484 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[4073072909185225]": { + "Id": "Entity_[4073072909185225]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 78.24310302734375 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[4073077204152521]": { + "Id": "Entity_[4073077204152521]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 68.24310302734375 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[4073081499119817]": { + "Id": "Entity_[4073081499119817]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 62.243099212646484 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[4073085794087113]": { + "Id": "Entity_[4073085794087113]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 76.24310302734375 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[4073090089054409]": { + "Id": "Entity_[4073090089054409]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 70.24310302734375 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[4073094384021705]": { + "Id": "Entity_[4073094384021705]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 64.24310302734375 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[4073098678989001]": { + "Id": "Entity_[4073098678989001]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 66.24310302734375 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[4073102973956297]": { + "Id": "Entity_[4073102973956297]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 74.24310302734375 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[612523158282]": { + "Id": "Entity_[612523158282]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 0.0 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[616818125578]": { + "Id": "Entity_[616818125578]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 18.0 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[621113092874]": { + "Id": "Entity_[621113092874]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 2.0 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[625408060170]": { + "Id": "Entity_[625408060170]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 16.0 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[629703027466]": { + "Id": "Entity_[629703027466]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 14.0 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[633997994762]": { + "Id": "Entity_[633997994762]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 12.0 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[638292962058]": { + "Id": "Entity_[638292962058]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 4.0 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[642587929354]": { + "Id": "Entity_[642587929354]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 10.0 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[646882896650]": { + "Id": "Entity_[646882896650]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 8.0 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[651177863946]": { + "Id": "Entity_[651177863946]", + "Name": "Surface", + "Components": { + "Component_[11461736083966389166]": { + "$type": "EditorSurfaceDataShapeComponent", + "Id": 11461736083966389166 + }, + "Component_[13283029886763197381]": { + "$type": "EditorLockComponent", + "Id": 13283029886763197381 + }, + "Component_[14567565716714370511]": { + "$type": "SelectionComponent", + "Id": 14567565716714370511 + }, + "Component_[14826005606950858247]": { + "$type": "EditorEntitySortComponent", + "Id": 14826005606950858247 + }, + "Component_[15952534836289892585]": { + "$type": "EditorInspectorComponent", + "Id": 15952534836289892585 + }, + "Component_[16429683758229234581]": { + "$type": "EditorPendingCompositionComponent", + "Id": 16429683758229234581 + }, + "Component_[3145304225809715428]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3145304225809715428, + "Parent Entity": "Entity_[655472831242]", + "Transform Data": { + "Translate": [ + 24.860464096069336, + 6.0520172119140625, + 6.0 + ] + } + }, + "Component_[3194434268397003277]": { + "$type": "EditorBoxShapeComponent", + "Id": 3194434268397003277, + "Visible": false, + "DisplayFilled": false, + "BoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 0.10000000149011612 + ] + } + } + }, + "Component_[5124743265172522601]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5124743265172522601 + }, + "Component_[6141261141385234831]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6141261141385234831 + }, + "Component_[8075217947437400102]": { + "$type": "EditorVisibilityComponent", + "Id": 8075217947437400102 + }, + "Component_[9742596769363363433]": { + "$type": "EditorEntityIconComponent", + "Id": 9742596769363363433 + } + } + }, + "Entity_[655472831242]": { + "Id": "Entity_[655472831242]", + "Name": "Surfaces", + "Components": { + "Component_[11463830567025741777]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11463830567025741777, + "Parent Entity": "Entity_[1146574390643]", + "Transform Data": { + "Translate": [ + 25.139535903930664, + 43.94798278808594, + 0.0 + ] + } + }, + "Component_[16576383876931487287]": { + "$type": "EditorLockComponent", + "Id": 16576383876931487287 + }, + "Component_[17475328349202721984]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 17475328349202721984 + }, + "Component_[2693664693208376125]": { + "$type": "EditorVisibilityComponent", + "Id": 2693664693208376125 + }, + "Component_[3772848404212958248]": { + "$type": "EditorInspectorComponent", + "Id": 3772848404212958248 + }, + "Component_[3891212684133169478]": { + "$type": "SelectionComponent", + "Id": 3891212684133169478 + }, + "Component_[4930031329153667734]": { + "$type": "EditorEntityIconComponent", + "Id": 4930031329153667734 + }, + "Component_[5015604486311198963]": { + "$type": "EditorEntitySortComponent", + "Id": 5015604486311198963, + "Child Entity Order": [ + "Entity_[612523158282]", + "Entity_[621113092874]", + "Entity_[638292962058]", + "Entity_[651177863946]", + "Entity_[646882896650]", + "Entity_[642587929354]", + "Entity_[633997994762]", + "Entity_[629703027466]", + "Entity_[625408060170]", + "Entity_[616818125578]", + "Entity_[2994164239528137]", + "Entity_[2994155649593545]", + "Entity_[2994134174757065]", + "Entity_[2994142764691657]", + "Entity_[2994138469724361]", + "Entity_[2994159944560841]", + "Entity_[2994151354626249]", + "Entity_[2994147059658953]", + "Entity_[2994172829462729]", + "Entity_[2994168534495433]", + "Entity_[3446243907170505]", + "Entity_[3446213842399433]", + "Entity_[3446239612203209]", + "Entity_[3446226727301321]", + "Entity_[3446218137366729]", + "Entity_[3446231022268617]", + "Entity_[3446222432334025]", + "Entity_[3446252497105097]", + "Entity_[3446248202137801]", + "Entity_[3446235317235913]", + "Entity_[4073090089054409]", + "Entity_[4073064319250633]", + "Entity_[4073077204152521]", + "Entity_[4073068614217929]", + "Entity_[4073072909185225]", + "Entity_[4073081499119817]", + "Entity_[4073085794087113]", + "Entity_[4073102973956297]", + "Entity_[4073094384021705]", + "Entity_[4073098678989001]" + ] + }, + "Component_[7096718211285552582]": { + "$type": "EditorOnlyEntityComponent", + "Id": 7096718211285552582 + }, + "Component_[8091190759736241533]": { + "$type": "EditorPendingCompositionComponent", + "Id": 8091190759736241533 + } + } + }, + "Entity_[659767798538]": { + "Id": "Entity_[659767798538]", + "Name": "VegArea", + "Components": { + "Component_[10457867987348570858]": { + "$type": "EditorInspectorComponent", + "Id": 10457867987348570858 + }, + "Component_[1229363445910756890]": { + "$type": "{DD96FD51-A86B-48BC-A6AB-89183B538269} EditorSpawnerComponent", + "Id": 1229363445910756890, + "PreviewEntity": "Entity_[659767798538]" + }, + "Component_[12481711086985445589]": { + "$type": "EditorVisibilityComponent", + "Id": 12481711086985445589 + }, + "Component_[14421356574908560819]": { + "$type": "EditorAxisAlignedBoxShapeComponent", + "Id": 14421356574908560819, + "Visible": false, + "DisplayFilled": false, + "AxisAlignedBoxShape": { + "Configuration": { + "IsFilled": false, + "Dimensions": [ + 200.0, + 200.0, + 200.0 + ] + } + } + }, + "Component_[14627293932927606859]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 14627293932927606859, + "Parent Entity": "Entity_[1146574390643]", + "Transform Data": { + "Translate": [ + 25.139535903930664, + 43.94798278808594, + 0.0 + ] + } + }, + "Component_[16742116787858765489]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 16742116787858765489 + }, + "Component_[17369607211365211528]": { + "$type": "EditorEntitySortComponent", + "Id": 17369607211365211528, + "Child Entity Order": [ + "Instance_[919926567113]/ContainerEntity", + "Instance_[1031595716809]/ContainerEntity", + "Instance_[1160444735689]/ContainerEntity", + "Instance_[1306473623753]/ContainerEntity", + "Instance_[1469682381001]/ContainerEntity", + "Instance_[1650071007433]/ContainerEntity", + "Instance_[1847639503049]/ContainerEntity", + "Instance_[2062387867849]/ContainerEntity", + "Instance_[2294316101833]/ContainerEntity", + "Instance_[2543424205001]/ContainerEntity", + "Instance_[2809712177353]/ContainerEntity", + "Instance_[3093180018889]/ContainerEntity", + "Instance_[3398122696905]/ContainerEntity" + ] + }, + "Component_[17539394596964090620]": { + "$type": "EditorDescriptorListComponent", + "Id": 17539394596964090620, + "Configuration": { + "Descriptors": [ + { + "SpawnerType": "{74BEEDB5-81CF-409F-B375-0D93D81EF2E3}", + "InstanceSpawner": { + "$type": "PrefabInstanceSpawner", + "SpawnableAsset": { + "assetId": { + "guid": "{60CF6C60-8620-5173-814C-ED8B0C395BA7}", + "subId": 1611714993 + }, + "assetHint": "prefabs/testdata/graphics/cubealuminumpolishedpbr.spawnable" + } + } + }, + { + "SpawnerType": "{74BEEDB5-81CF-409F-B375-0D93D81EF2E3}", + "InstanceSpawner": { + "$type": "PrefabInstanceSpawner", + "SpawnableAsset": { + "assetId": { + "guid": "{B030470B-92ED-5673-B108-5BD3C31A3795}", + "subId": 2910987375 + }, + "assetHint": "prefabs/testdata/graphics/cubebrasspolishedpbr.spawnable" + } + } + }, + { + "SpawnerType": "{74BEEDB5-81CF-409F-B375-0D93D81EF2E3}", + "InstanceSpawner": { + "$type": "PrefabInstanceSpawner", + "SpawnableAsset": { + "assetId": { + "guid": "{D4AC76BB-BA32-5787-A862-3C6296503126}", + "subId": 1351414441 + }, + "assetHint": "prefabs/testdata/graphics/cubechromepolishedpbr.spawnable" + } + } + }, + { + "SpawnerType": "{74BEEDB5-81CF-409F-B375-0D93D81EF2E3}", + "InstanceSpawner": { + "$type": "PrefabInstanceSpawner", + "SpawnableAsset": { + "assetId": { + "guid": "{6E0DF0BD-2B50-5353-A063-88AAEEBED799}", + "subId": 1382904365 + }, + "assetHint": "prefabs/testdata/graphics/cubecobaltpolishedpbr.spawnable" + } + } + }, + { + "SpawnerType": "{74BEEDB5-81CF-409F-B375-0D93D81EF2E3}", + "InstanceSpawner": { + "$type": "PrefabInstanceSpawner", + "SpawnableAsset": { + "assetId": { + "guid": "{CB9E61C4-1122-56D8-8906-2FF8FC4D1876}", + "subId": 3884585917 + }, + "assetHint": "prefabs/testdata/graphics/cubecopperpolishedpbr.spawnable" + } + } + }, + { + "SpawnerType": "{74BEEDB5-81CF-409F-B375-0D93D81EF2E3}", + "InstanceSpawner": { + "$type": "PrefabInstanceSpawner", + "SpawnableAsset": { + "assetId": { + "guid": "{9105AA91-FE70-56C2-BA83-E08F268C333F}", + "subId": 2449326585 + }, + "assetHint": "prefabs/testdata/graphics/cubegoldpolishedpbr.spawnable" + } + } + }, + { + "SpawnerType": "{74BEEDB5-81CF-409F-B375-0D93D81EF2E3}", + "InstanceSpawner": { + "$type": "PrefabInstanceSpawner", + "SpawnableAsset": { + "assetId": { + "guid": "{7DB86E6D-05C1-5B3C-88B4-DC9039005E1F}", + "subId": 932993536 + }, + "assetHint": "prefabs/testdata/graphics/cubeironpolishedpbr.spawnable" + } + } + }, + { + "SpawnerType": "{74BEEDB5-81CF-409F-B375-0D93D81EF2E3}", + "InstanceSpawner": { + "$type": "PrefabInstanceSpawner", + "SpawnableAsset": { + "assetId": { + "guid": "{D8EEB566-07A9-5F39-9B89-66492858F178}", + "subId": 2937511027 + }, + "assetHint": "prefabs/testdata/graphics/cubemercurypbr.spawnable" + } + } + }, + { + "SpawnerType": "{74BEEDB5-81CF-409F-B375-0D93D81EF2E3}", + "InstanceSpawner": { + "$type": "PrefabInstanceSpawner", + "SpawnableAsset": { + "assetId": { + "guid": "{7988D594-BA33-5843-886B-9E23FD9B1B3F}", + "subId": 3637668335 + }, + "assetHint": "prefabs/testdata/graphics/cubenickelpolishedpbr.spawnable" + } + } + }, + { + "SpawnerType": "{74BEEDB5-81CF-409F-B375-0D93D81EF2E3}", + "InstanceSpawner": { + "$type": "PrefabInstanceSpawner", + "SpawnableAsset": { + "assetId": { + "guid": "{CDDFE051-9910-5CD5-BD62-6FC729910CE5}", + "subId": 3334536131 + }, + "assetHint": "prefabs/testdata/graphics/cubepalladiumpolishedpbr.spawnable" + } + } + }, + { + "SpawnerType": "{74BEEDB5-81CF-409F-B375-0D93D81EF2E3}", + "InstanceSpawner": { + "$type": "PrefabInstanceSpawner", + "SpawnableAsset": { + "assetId": { + "guid": "{F336F1A7-7FDF-5972-A48E-58DC83D152A4}", + "subId": 610633662 + }, + "assetHint": "prefabs/testdata/graphics/cubeplatinumpolishedpbr.spawnable" + } + }, + "Advanced": true + }, + { + "SpawnerType": "{74BEEDB5-81CF-409F-B375-0D93D81EF2E3}", + "InstanceSpawner": { + "$type": "PrefabInstanceSpawner", + "SpawnableAsset": { + "assetId": { + "guid": "{32B00E51-BC05-5F03-A9AA-2D7AFE680EAC}", + "subId": 3534297619 + }, + "assetHint": "prefabs/testdata/graphics/cubesilverpolishedpbr.spawnable" + } + } + }, + { + "SpawnerType": "{74BEEDB5-81CF-409F-B375-0D93D81EF2E3}", + "InstanceSpawner": { + "$type": "PrefabInstanceSpawner", + "SpawnableAsset": { + "assetId": { + "guid": "{BBAB8640-03D2-5138-B52F-D031F29AF8C9}", + "subId": 923463205 + }, + "assetHint": "prefabs/testdata/graphics/cubetitaniumpolishedpbr.spawnable" + } + } + } + ] + } + }, + "Component_[2434532182352640072]": { + "$type": "EditorLockComponent", + "Id": 2434532182352640072 + }, + "Component_[6884260241620821202]": { + "$type": "SelectionComponent", + "Id": 6884260241620821202 + }, + "Component_[7575363224499024733]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7575363224499024733 + }, + "Component_[9440481613501976688]": { + "$type": "EditorEntityIconComponent", + "Id": 9440481613501976688 + }, + "Component_[9636552512161785427]": { + "$type": "EditorOnlyEntityComponent", + "Id": 9636552512161785427 + } + } + } + }, + "Instances": { + "Instance_[1031595716809]": { + "Source": "Prefabs/TestData/Graphics/CubeAluminumPolishedPBR.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[1006636009791072742]/Parent Entity", + "value": "../Entity_[659767798538]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[1006636009791072742]/Transform Data/Translate/0", + "value": -264.5232849121094 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[1006636009791072742]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[1160444735689]": { + "Source": "Prefabs/TestData/Graphics/CubeBrassPolishedPBR.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[17333992135029064645]/Parent Entity", + "value": "../Entity_[659767798538]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[17333992135029064645]/Transform Data/Translate/0", + "value": -264.5232849121094 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[17333992135029064645]/Transform Data/Translate/1", + "value": 1.4970321655273438 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[17333992135029064645]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[1306473623753]": { + "Source": "Prefabs/TestData/Graphics/CubeChromePolishedPBR.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[15205683346512266293]/Parent Entity", + "value": "../Entity_[659767798538]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[15205683346512266293]/Transform Data/Translate/0", + "value": -264.5232849121094 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[15205683346512266293]/Transform Data/Translate/1", + "value": 3.06375503540039 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[15205683346512266293]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[1469682381001]": { + "Source": "Prefabs/TestData/Graphics/CubeCobaltPolishedPBR.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[12811832964126776693]/Parent Entity", + "value": "../Entity_[659767798538]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[12811832964126776693]/Transform Data/Translate/0", + "value": -264.5232849121094 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[12811832964126776693]/Transform Data/Translate/1", + "value": 4.512233734130859 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[12811832964126776693]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[1650071007433]": { + "Source": "Prefabs/TestData/Graphics/CubeCopperPolishedPBR.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5749675910289562089]/Parent Entity", + "value": "../Entity_[659767798538]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5749675910289562089]/Transform Data/Translate/0", + "value": -264.5232849121094 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5749675910289562089]/Transform Data/Translate/1", + "value": 5.966960906982422 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[5749675910289562089]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[1847639503049]": { + "Source": "Prefabs/TestData/Graphics/CubeGoldPolishedPBR.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[11570676153379582500]/Parent Entity", + "value": "../Entity_[659767798538]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[11570676153379582500]/Transform Data/Translate/0", + "value": -264.5232849121094 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[11570676153379582500]/Transform Data/Translate/1", + "value": 7.424510955810547 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[11570676153379582500]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[2062387867849]": { + "Source": "Prefabs/TestData/Graphics/CubeIronPolishedPBR.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[17506200912680653288]/Parent Entity", + "value": "../Entity_[659767798538]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[17506200912680653288]/Transform Data/Translate/0", + "value": -264.5232849121094 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[17506200912680653288]/Transform Data/Translate/1", + "value": 8.888202667236328 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[17506200912680653288]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[2294316101833]": { + "Source": "Prefabs/TestData/Graphics/CubeNickelPolishedPBR.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[12821987693261496174]/Parent Entity", + "value": "../Entity_[659767798538]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[12821987693261496174]/Transform Data/Translate/0", + "value": -264.5232849121094 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[12821987693261496174]/Transform Data/Translate/1", + "value": 10.4295654296875 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[12821987693261496174]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[2543424205001]": { + "Source": "Prefabs/TestData/Graphics/CubePalladiumPolishedPBR.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[16012620721047170064]/Parent Entity", + "value": "../Entity_[659767798538]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[16012620721047170064]/Transform Data/Translate/0", + "value": -264.5232849121094 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[16012620721047170064]/Transform Data/Translate/1", + "value": 12.071407318115234 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[16012620721047170064]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[2809712177353]": { + "Source": "Prefabs/TestData/Graphics/CubePlatinumPolishedPBR.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[1499102502234135899]/Parent Entity", + "value": "../Entity_[659767798538]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[1499102502234135899]/Transform Data/Translate/0", + "value": -264.5232849121094 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[1499102502234135899]/Transform Data/Translate/1", + "value": 13.582500457763672 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[1499102502234135899]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[3093180018889]": { + "Source": "Prefabs/TestData/Graphics/CubeSilverPolishedPBR.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[18049054501916401618]/Parent Entity", + "value": "../Entity_[659767798538]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[18049054501916401618]/Transform Data/Translate/0", + "value": -264.5232849121094 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[18049054501916401618]/Transform Data/Translate/1", + "value": 15.026111602783203 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[18049054501916401618]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[3398122696905]": { + "Source": "Prefabs/TestData/Graphics/CubeTitaniumPolishedPBR.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[14924371629431224666]/Parent Entity", + "value": "../Entity_[659767798538]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[14924371629431224666]/Transform Data/Translate/0", + "value": -264.5232849121094 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[14924371629431224666]/Transform Data/Translate/1", + "value": 16.513294219970703 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[14924371629431224666]/Transform Data/Translate/2", + "value": 1.0 + } + ] + }, + "Instance_[919926567113]": { + "Source": "Prefabs/TestData/Graphics/CubeMercuryPBR.prefab", + "Patches": [ + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[2268958959705742396]/Parent Entity", + "value": "../Entity_[659767798538]" + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[2268958959705742396]/Transform Data/Translate/0", + "value": -270.14752197265625 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[2268958959705742396]/Transform Data/Translate/1", + "value": 10.24942398071289 + }, + { + "op": "replace", + "path": "/ContainerEntity/Components/Component_[2268958959705742396]/Transform Data/Translate/2", + "value": 1.0 + } + ] + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/Performance/10kVegInstancesTest/tags.txt b/AutomatedTesting/Levels/Performance/10kVegInstancesTest/tags.txt new file mode 100644 index 0000000000..0d6c1880e7 --- /dev/null +++ b/AutomatedTesting/Levels/Performance/10kVegInstancesTest/tags.txt @@ -0,0 +1,12 @@ +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 diff --git a/AutomatedTesting/Prefabs/TestData/Graphics/AtomCubeWall.prefab b/AutomatedTesting/Prefabs/TestData/Graphics/AtomCubeWall.prefab new file mode 100644 index 0000000000..eda62c6f52 --- /dev/null +++ b/AutomatedTesting/Prefabs/TestData/Graphics/AtomCubeWall.prefab @@ -0,0 +1,102345 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "AtomCubeWall", + "Components": { + "Component_[1378762968271397696]": { + "$type": "EditorPrefabComponent", + "Id": 1378762968271397696 + }, + "Component_[15861901244881316506]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 15861901244881316506 + }, + "Component_[1667542861598358689]": { + "$type": "EditorVisibilityComponent", + "Id": 1667542861598358689 + }, + "Component_[2970248835877935836]": { + "$type": "EditorPendingCompositionComponent", + "Id": 2970248835877935836 + }, + "Component_[3475481110579263685]": { + "$type": "EditorEntityIconComponent", + "Id": 3475481110579263685 + }, + "Component_[4960733274366718926]": { + "$type": "EditorOnlyEntityComponent", + "Id": 4960733274366718926 + }, + "Component_[5052757994340238524]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 5052757994340238524, + "Parent Entity": "" + }, + "Component_[5847627832229774671]": { + "$type": "SelectionComponent", + "Id": 5847627832229774671 + }, + "Component_[686142448804056059]": { + "$type": "EditorInspectorComponent", + "Id": 686142448804056059 + }, + "Component_[8743584510936460932]": { + "$type": "EditorLockComponent", + "Id": 8743584510936460932 + }, + "Component_[9497718940671573904]": { + "$type": "EditorEntitySortComponent", + "Id": 9497718940671573904, + "Child Entity Order": [ + "Entity_[728313751508]", + "Entity_[3017531320276]", + "Entity_[2149947926484]", + "Entity_[3236574652372]", + "Entity_[2618099361748]", + "Entity_[1922314659796]", + "Entity_[2493545310164]", + "Entity_[887227541460]", + "Entity_[1458458191828]", + "Entity_[1638846818260]", + "Entity_[479205648340]", + "Entity_[2850027595732]", + "Entity_[947357083604]", + "Entity_[3640301578196]", + "Entity_[3094840731604]", + "Entity_[483500615636]", + "Entity_[4327496345556]", + "Entity_[2880092366804]", + "Entity_[487795582932]", + "Entity_[3348243802068]", + "Entity_[3983898961876]", + "Entity_[3429848180692]", + "Entity_[1497112897492]", + "Entity_[2295976814548]", + "Entity_[504975452116]", + "Entity_[2351811389396]", + "Entity_[3507157592020]", + "Entity_[646709372884]", + "Entity_[577989896148]", + "Entity_[2545084917716]", + "Entity_[2609509427156]", + "Entity_[3919474452436]", + "Entity_[3305294129108]", + "Entity_[3030416222164]", + "Entity_[1973854267348]", + "Entity_[4275956738004]", + "Entity_[2892977268692]", + "Entity_[2390466095060]", + "Entity_[3790625433556]", + "Entity_[3185035044820]", + "Entity_[492090550228]", + "Entity_[2781308118996]", + "Entity_[1230824925140]", + "Entity_[3399783409620]", + "Entity_[2098408318932]", + "Entity_[1862185117652]", + "Entity_[3090545764308]", + "Entity_[1600192112596]", + "Entity_[762673489876]", + "Entity_[2029688842196]", + "Entity_[917292312532]", + "Entity_[706838915028]", + "Entity_[745493620692]", + "Entity_[2562264786900]", + "Entity_[2141357991892]", + "Entity_[556515059668]", + "Entity_[2575149688788]", + "Entity_[535040223188]", + "Entity_[530745255892]", + "Entity_[496385517524]", + "Entity_[3043301124052]", + "Entity_[2635279230932]", + "Entity_[2777013151700]", + "Entity_[3425553213396]", + "Entity_[2716883609556]", + "Entity_[1909429757908]", + "Entity_[3524337461204]", + "Entity_[3116315568084]", + "Entity_[4495000070100]", + "Entity_[865752704980]", + "Entity_[831392966612]", + "Entity_[2373286225876]", + "Entity_[3876524779476]", + "Entity_[500680484820]", + "Entity_[509270419412]", + "Entity_[513565386708]", + "Entity_[2953106810836]", + "Entity_[4125632882644]", + "Entity_[3756265695188]", + "Entity_[2025393874900]", + "Entity_[3159265241044]", + "Entity_[2003919038420]", + "Entity_[1385443747796]", + "Entity_[719723816916]", + "Entity_[2476365440980]", + "Entity_[3296704194516]", + "Entity_[4314611443668]", + "Entity_[1329609172948]", + "Entity_[517860354004]", + "Entity_[4245891966932]", + "Entity_[1540062570452]", + "Entity_[522155321300]", + "Entity_[1814940477396]", + "Entity_[1093385971668]", + "Entity_[4215827195860]", + "Entity_[3966719092692]", + "Entity_[771263424468]", + "Entity_[526450288596]", + "Entity_[681069111252]", + "Entity_[1205055121364]", + "Entity_[2368991258580]", + "Entity_[3258049488852]", + "Entity_[4104158046164]", + "Entity_[912997345236]", + "Entity_[1282364532692]", + "Entity_[1617371981780]", + "Entity_[4357561116628]", + "Entity_[629529503700]", + "Entity_[2845732628436]", + "Entity_[2557969819604]", + "Entity_[2210077468628]", + "Entity_[1411213551572]", + "Entity_[1634551850964]", + "Entity_[552220092372]", + "Entity_[1905134790612]", + "Entity_[1552947472340]", + "Entity_[2317451651028]", + "Entity_[1278069565396]", + "Entity_[3142085371860]", + "Entity_[1123450742740]", + "Entity_[539335190484]", + "Entity_[3416963278804]", + "Entity_[1136335644628]", + "Entity_[1677501523924]", + "Entity_[3180740077524]", + "Entity_[2630984263636]", + "Entity_[638119438292]", + "Entity_[754083555284]", + "Entity_[1771990804436]", + "Entity_[981716821972]", + "Entity_[844277868500]", + "Entity_[543630157780]", + "Entity_[1733336098772]", + "Entity_[3283819292628]", + "Entity_[1007486625748]", + "Entity_[4013963732948]", + "Entity_[1673206556628]", + "Entity_[2940221908948]", + "Entity_[595169765332]", + "Entity_[3897999615956]", + "Entity_[1325314205652]", + "Entity_[547925125076]", + "Entity_[2424825833428]", + "Entity_[2347516422100]", + "Entity_[612349634516]", + "Entity_[1918019692500]", + "Entity_[1754810935252]", + "Entity_[4301726541780]", + "Entity_[3584467003348]", + "Entity_[560810026964]", + "Entity_[2832847726548]", + "Entity_[2016803940308]", + "Entity_[3915179485140]", + "Entity_[4585194383316]", + "Entity_[569399961556]", + "Entity_[3520042493908]", + "Entity_[3859344910292]", + "Entity_[2463480539092]", + "Entity_[4039733536724]", + "Entity_[779853359060]", + "Entity_[2983171581908]", + "Entity_[1832120346580]", + "Entity_[2334631520212]", + "Entity_[603759699924]", + "Entity_[1342494074836]", + "Entity_[2673933936596]", + "Entity_[565104994260]", + "Entity_[3279524325332]", + "Entity_[573694928852]", + "Entity_[3601646872532]", + "Entity_[582284863444]", + "Entity_[4443460462548]", + "Entity_[1879364986836]", + "Entity_[1750515967956]", + "Entity_[4082683209684]", + "Entity_[620939569108]", + "Entity_[973126887380]", + "Entity_[1179285317588]", + "Entity_[1406918584276]", + "Entity_[2330336552916]", + "Entity_[2253027141588]", + "Entity_[1802055575508]", + "Entity_[3992488896468]", + "Entity_[1359673944020]", + "Entity_[1424098453460]", + "Entity_[1720451196884]", + "Entity_[3545812297684]", + "Entity_[4482115168212]", + "Entity_[4589489350612]", + "Entity_[3906589550548]", + "Entity_[4224417130452]", + "Entity_[3412668311508]", + "Entity_[3812100270036]", + "Entity_[3447028049876]", + "Entity_[2068343547860]", + "Entity_[1887954921428]", + "Entity_[4546539677652]", + "Entity_[4147107719124]", + "Entity_[1196465186772]", + "Entity_[2987466549204]", + "Entity_[2695408773076]", + "Entity_[2691113805780]", + "Entity_[4202942293972]", + "Entity_[2171422762964]", + "Entity_[1501407864788]", + "Entity_[4563719546836]", + "Entity_[4417690658772]", + "Entity_[3683251251156]", + "Entity_[2046868711380]", + "Entity_[4529359808468]", + "Entity_[3837870073812]", + "Entity_[3163560208340]", + "Entity_[2785603086292]", + "Entity_[3073365895124]", + "Entity_[2523610081236]", + "Entity_[4159992621012]", + "Entity_[1978149234644]", + "Entity_[4035438569428]", + "Entity_[1759105902548]", + "Entity_[2145652959188]", + "Entity_[934472181716]", + "Entity_[3975309027284]", + "Entity_[3721905956820]", + "Entity_[2918747072468]", + "Entity_[3666071381972]", + "Entity_[3893704648660]", + "Entity_[2313156683732]", + "Entity_[2510725179348]", + "Entity_[1059026233300]", + "Entity_[2403350996948]", + "Entity_[1286659499988]", + "Entity_[3356833736660]", + "Entity_[2497840277460]", + "Entity_[2648164132820]", + "Entity_[3605941839828]", + "Entity_[741198653396]", + "Entity_[2579444656084]", + "Entity_[1840710281172]", + "Entity_[1960969365460]", + "Entity_[2764128249812]", + "Entity_[4469230266324]", + "Entity_[4022553667540]", + "Entity_[4336086280148]", + "Entity_[1471343093716]", + "Entity_[2837142693844]", + "Entity_[2703998707668]", + "Entity_[4409100724180]", + "Entity_[4237302032340]", + "Entity_[3039006156756]", + "Entity_[4430575560660]", + "Entity_[3335358900180]", + "Entity_[2923042039764]", + "Entity_[4593784317908]", + "Entity_[1213645055956]", + "Entity_[4344676214740]", + "Entity_[827097999316]", + "Entity_[951652050900]", + "Entity_[4413395691476]", + "Entity_[4207237261268]", + "Entity_[4056913405908]", + "Entity_[2721178576852]", + "Entity_[2081228449748]", + "Entity_[3794920400852]", + "Entity_[4194352359380]", + "Entity_[2965991712724]", + "Entity_[1415508518868]", + "Entity_[4031143602132]", + "Entity_[3197919946708]", + "Entity_[3099135698900]", + "Entity_[1570127341524]", + "Entity_[4516474906580]", + "Entity_[3438438115284]", + "Entity_[4172877522900]", + "Entity_[2433415768020]", + "Entity_[4473525233620]", + "Entity_[3760560662484]", + "Entity_[4052618438612]", + "Entity_[1643141785556]", + "Entity_[1368263878612]", + "Entity_[3240869619668]", + "Entity_[4572309481428]", + "Entity_[2798487988180]", + "Entity_[1101975906260]", + "Entity_[1518587733972]", + "Entity_[3962424125396]", + "Entity_[4267366803412]", + "Entity_[4095568111572]", + "Entity_[1557242439636]", + "Entity_[3936654321620]", + "Entity_[2665344002004]", + "Entity_[4044028504020]", + "Entity_[4447755429844]", + "Entity_[1243709827028]", + "Entity_[977421854676]", + "Entity_[2901567203284]", + "Entity_[642414405588]", + "Entity_[4323201378260]", + "Entity_[1767695837140]", + "Entity_[3691841185748]", + "Entity_[1492817930196]", + "Entity_[3674661316564]", + "Entity_[3515747526612]", + "Entity_[2871502432212]", + "Entity_[2506430212052]", + "Entity_[3777740531668]", + "Entity_[2386171127764]", + "Entity_[1265184663508]", + "Entity_[586579830740]", + "Entity_[3120610535380]", + "Entity_[2420530866132]", + "Entity_[2725473544148]", + "Entity_[1252299761620]", + "Entity_[2321746618324]", + "Entity_[3820690204628]", + "Entity_[3979603994580]", + "Entity_[3318179030996]", + "Entity_[1505702832084]", + "Entity_[1428393420756]", + "Entity_[3678956283860]", + "Entity_[1338199107540]", + "Entity_[895817476052]", + "Entity_[1660321654740]", + "Entity_[4525064841172]", + "Entity_[698248980436]", + "Entity_[4134222817236]", + "Entity_[2265912043476]", + "Entity_[1312429303764]", + "Entity_[4254481901524]", + "Entity_[4499295037396]", + "Entity_[3000351451092]", + "Entity_[3988193929172]", + "Entity_[655299307476]", + "Entity_[1346789042132]", + "Entity_[3769150597076]", + "Entity_[2480660408276]", + "Entity_[1866480084948]", + "Entity_[2214372435924]", + "Entity_[1046141331412]", + "Entity_[2261617076180]", + "Entity_[2042573744084]", + "Entity_[1183580284884]", + "Entity_[861457737684]", + "Entity_[1033256429524]", + "Entity_[711133882324]", + "Entity_[3928064387028]", + "Entity_[1316724271060]", + "Entity_[1003191658452]", + "Entity_[2218667403220]", + "Entity_[2991761516500]", + "Entity_[4452050397140]", + "Entity_[2291681847252]", + "Entity_[2751243347924]", + "Entity_[1784875706324]", + "Entity_[3176445110228]", + "Entity_[2815667857364]", + "Entity_[4533654775764]", + "Entity_[3610236807124]", + "Entity_[3880819746772]", + "Entity_[3124905502676]", + "Entity_[3494272690132]", + "Entity_[835687933908]", + "Entity_[1363968911316]", + "Entity_[3378308573140]", + "Entity_[1703271327700]", + "Entity_[3636006610900]", + "Entity_[2180012697556]", + "Entity_[1389738715092]", + "Entity_[4580899416020]", + "Entity_[3322473998292]", + "Entity_[878637606868]", + "Entity_[3550107264980]", + "Entity_[1166400415700]", + "Entity_[4370446018516]", + "Entity_[2240142239700]", + "Entity_[2399056029652]", + "Entity_[2729768511444]", + "Entity_[4310316476372]", + "Entity_[3189330012116]", + "Entity_[3047596091348]", + "Entity_[3867934844884]", + "Entity_[2867207464916]", + "Entity_[3575877068756]", + "Entity_[2446300669908]", + "Entity_[2536494983124]", + "Entity_[3262344456148]", + "Entity_[4486410135508]", + "Entity_[2519315113940]", + "Entity_[1724746164180]", + "Entity_[4048323471316]", + "Entity_[3051891058644]", + "Entity_[1419803486164]", + "Entity_[797033228244]", + "Entity_[1041846364116]", + "Entity_[4460640331732]", + "Entity_[3833575106516]", + "Entity_[3464207919060]", + "Entity_[1651731720148]", + "Entity_[1162105448404]", + "Entity_[663889242068]", + "Entity_[2755538315220]", + "Entity_[4507884971988]", + "Entity_[1522882701268]", + "Entity_[4151402686420]", + "Entity_[1144925579220]", + "Entity_[3850754975700]", + "Entity_[1467048126420]", + "Entity_[3945244256212]", + "Entity_[3958129158100]", + "Entity_[4061208373204]", + "Entity_[4555129612244]", + "Entity_[1299544401876]", + "Entity_[2897272235988]", + "Entity_[882932574164]", + "Entity_[4396215822292]", + "Entity_[1106270873556]", + "Entity_[2188602632148]", + "Entity_[2807077922772]", + "Entity_[998896691156]", + "Entity_[4331791312852]", + "Entity_[2197192566740]", + "Entity_[2738358446036]", + "Entity_[986011789268]", + "Entity_[4138517784532]", + "Entity_[1239414859732]", + "Entity_[1273774598100]", + "Entity_[2338926487508]", + "Entity_[2450595637204]", + "Entity_[784148326356]", + "Entity_[3704726087636]", + "Entity_[689659045844]", + "Entity_[3571582101460]", + "Entity_[1900839823316]", + "Entity_[1114860808148]", + "Entity_[4426280593364]", + "Entity_[4280251705300]", + "Entity_[4108453013460]", + "Entity_[1793465640916]", + "Entity_[4404805756884]", + "Entity_[2394761062356]", + "Entity_[2175717730260]", + "Entity_[3532927395796]", + "Entity_[3459912951764]", + "Entity_[1217940023252]", + "Entity_[1097680938964]", + "Entity_[3751970727892]", + "Entity_[1028961462228]", + "Entity_[3747675760596]", + "Entity_[4220122163156]", + "Entity_[3717610989524]", + "Entity_[3288114259924]", + "Entity_[1595897145300]", + "Entity_[1149220546516]", + "Entity_[599464732628]", + "Entity_[2583739623380]", + "Entity_[1436983355348]", + "Entity_[1913724725204]", + "Entity_[2935926941652]", + "Entity_[1690386425812]", + "Entity_[3206509881300]", + "Entity_[2137063024596]", + "Entity_[1054731266004]", + "Entity_[3842165041108]", + "Entity_[4001078831060]", + "Entity_[4348971182036]", + "Entity_[4293136607188]", + "Entity_[1222234990548]", + "Entity_[968831920084]", + "Entity_[4391920854996]", + "Entity_[2592329557972]", + "Entity_[870047672276]", + "Entity_[1711861262292]", + "Entity_[1608782047188]", + "Entity_[4306021509076]", + "Entity_[1999624071124]", + "Entity_[1269479630804]", + "Entity_[1140630611924]", + "Entity_[2227257337812]", + "Entity_[3339653867476]", + "Entity_[2854322563028]", + "Entity_[1024666494932]", + "Entity_[2686818838484]", + "Entity_[2300271781844]", + "Entity_[4361856083924]", + "Entity_[1527177668564]", + "Entity_[1372558845908]", + "Entity_[1514292766676]", + "Entity_[1943789496276]", + "Entity_[4340381247444]", + "Entity_[1737631066068]", + "Entity_[3996783863764]", + "Entity_[1574422308820]", + "Entity_[2059753613268]", + "Entity_[4009668765652]", + "Entity_[3713316022228]", + "Entity_[3846460008404]", + "Entity_[2553674852308]", + "Entity_[1321019238356]", + "Entity_[3167855175636]", + "Entity_[2961696745428]", + "Entity_[788443293652]", + "Entity_[4250186934228]", + "Entity_[4074093275092]", + "Entity_[3537222363092]", + "Entity_[4318906410964]", + "Entity_[1664616622036]", + "Entity_[4297431574484]", + "Entity_[4065503340500]", + "Entity_[994601723860]", + "Entity_[4142812751828]", + "Entity_[1333904140244]", + "Entity_[4117042948052]", + "Entity_[2996056483796]", + "Entity_[4263071836116]", + "Entity_[3940949288916]", + "Entity_[1351084009428]", + "Entity_[2094113351636]", + "Entity_[1797760608212]", + "Entity_[4241596999636]", + "Entity_[857162770388]", + "Entity_[3855049942996]", + "Entity_[2742653413332]", + "Entity_[2416235898836]", + "Entity_[3472797853652]", + "Entity_[3644596545492]", + "Entity_[2759833282516]", + "Entity_[4185762424788]", + "Entity_[3077660862420]", + "Entity_[2154242893780]", + "Entity_[2794193020884]", + "Entity_[1819235444692]", + "Entity_[3004646418388]", + "Entity_[1810645510100]", + "Entity_[4078388242388]", + "Entity_[4503590004692]", + "Entity_[2270207010772]", + "Entity_[3902294583252]", + "Entity_[3270934390740]", + "Entity_[1780580739028]", + "Entity_[3567287134164]", + "Entity_[3511452559316]", + "Entity_[4190057392084]", + "Entity_[1355378976724]", + "Entity_[3249459554260]", + "Entity_[3137790404564]", + "Entity_[4129927849940]", + "Entity_[2235847272404]", + "Entity_[4086978176980]", + "Entity_[3657481447380]", + "Entity_[2841437661140]", + "Entity_[2862912497620]", + "Entity_[4005373798356]", + "Entity_[3786330466260]", + "Entity_[814213097428]", + "Entity_[1308134336468]", + "Entity_[1707566294996]", + "Entity_[2356106356692]", + "Entity_[3889409681364]", + "Entity_[1153515513812]", + "Entity_[4542244710356]", + "Entity_[3614531774420]", + "Entity_[4434870527956]", + "Entity_[3202214914004]", + "Entity_[616644601812]", + "Entity_[2978876614612]", + "Entity_[3421258246100]", + "Entity_[4177172490196]", + "Entity_[2119883155412]", + "Entity_[1986739169236]", + "Entity_[2661049034708]", + "Entity_[3648891512788]", + "Entity_[4026848634836]", + "Entity_[2283091912660]", + "Entity_[1020371527636]", + "Entity_[990306756564]", + "Entity_[3498567657428]", + "Entity_[964536952788]", + "Entity_[2605214459860]", + "Entity_[2802782955476]", + "Entity_[2162832828372]", + "Entity_[2639574198228]", + "Entity_[4353266149332]", + "Entity_[4550834644948]", + "Entity_[2888682301396]", + "Entity_[3726200924116]", + "Entity_[2326041585620]", + "Entity_[1303839369172]", + "Entity_[3227984717780]", + "Entity_[1462753159124]", + "Entity_[2278796945364]", + "Entity_[1698976360404]", + "Entity_[4464935299028]", + "Entity_[2669638969300]", + "Entity_[801328195540]", + "Entity_[1565832374228]", + "Entity_[2377581193172]", + "Entity_[2970286680020]", + "Entity_[4387625887700]", + "Entity_[1763400869844]", + "Entity_[1789170673620]", + "Entity_[3021826287572]", + "Entity_[1982444201940]", + "Entity_[1625961916372]", + "Entity_[2613804394452]", + "Entity_[4211532228564]", + "Entity_[3807805302740]", + "Entity_[3502862624724]", + "Entity_[775558391764]", + "Entity_[3326768965588]", + "Entity_[2532200015828]", + "Entity_[3154970273748]", + "Entity_[3872229812180]", + "Entity_[3382603540436]", + "Entity_[1991034136532]", + "Entity_[1119155775444]", + "Entity_[2699703740372]", + "Entity_[2515020146644]", + "Entity_[1952379430868]", + "Entity_[1011781593044]", + "Entity_[4421985626068]", + "Entity_[1402623616980]", + "Entity_[4568014514132]", + "Entity_[4576604448724]", + "Entity_[3253754521556]", + "Entity_[1630256883668]", + "Entity_[2222962370516]", + "Entity_[3219394783188]", + "Entity_[3232279685076]", + "Entity_[3107725633492]", + "Entity_[633824470996]", + "Entity_[1896544856020]", + "Entity_[724018784212]", + "Entity_[1531472635860]", + "Entity_[2588034590676]", + "Entity_[3408373344212]", + "Entity_[852867803092]", + "Entity_[904407410644]", + "Entity_[2489250342868]", + "Entity_[3554402232276]", + "Entity_[921587279828]", + "Entity_[1827825379284]", + "Entity_[1295249434580]", + "Entity_[2540789950420]", + "Entity_[4271661770708]", + "Entity_[3442733082580]", + "Entity_[2527905048532]", + "Entity_[1544357537748]", + "Entity_[608054667220]", + "Entity_[2734063478740]", + "Entity_[4477820200916]", + "Entity_[693954013140]", + "Entity_[2931631974356]", + "Entity_[2111293220820]", + "Entity_[736903686100]", + "Entity_[1170695382996]", + "Entity_[3597351905236]", + "Entity_[2033983809492]", + "Entity_[839982901204]", + "Entity_[3562992166868]", + "Entity_[2914452105172]", + "Entity_[766968457172]", + "Entity_[848572835796]", + "Entity_[2132768057300]", + "Entity_[3395488442324]", + "Entity_[1883659954132]", + "Entity_[1484227995604]", + "Entity_[1849300215764]", + "Entity_[3343948834772]", + "Entity_[1587307210708]", + "Entity_[2467775506388]", + "Entity_[3971014059988]", + "Entity_[874342639572]", + "Entity_[1187875252180]", + "Entity_[1995329103828]", + "Entity_[3485682755540]", + "Entity_[2910157137876]", + "Entity_[4228712097748]", + "Entity_[3064775960532]", + "Entity_[2102703286228]", + "Entity_[3150675306452]", + "Entity_[2051163678676]", + "Entity_[2643869165524]", + "Entity_[1591602178004]", + "Entity_[2244437206996]", + "Entity_[2746948380628]", + "Entity_[1256594728916]", + "Entity_[1248004794324]", + "Entity_[3215099815892]", + "Entity_[2626689296340]", + "Entity_[672479176660]", + "Entity_[891522508756]", + "Entity_[1965264332756]", + "Entity_[1260889696212]", + "Entity_[955947018196]", + "Entity_[1445573289940]", + "Entity_[3653186480084]", + "Entity_[2459185571796]", + "Entity_[3588761970644]", + "Entity_[2304566749140]", + "Entity_[2948811843540]", + "Entity_[1080501069780]", + "Entity_[3829280139220]", + "Entity_[1127745710036]", + "Entity_[685364078548]", + "Entity_[3060480993236]", + "Entity_[2549379885012]", + "Entity_[3700431120340]", + "Entity_[2201487534036]", + "Entity_[3365423671252]", + "Entity_[925882247124]", + "Entity_[3361128703956]", + "Entity_[2308861716436]", + "Entity_[3086250797012]", + "Entity_[1686091458516]", + "Entity_[3623121709012]", + "Entity_[1776285771732]", + "Entity_[1376853813204]", + "Entity_[960241985492]", + "Entity_[3309589096404]", + "Entity_[1449868257236]", + "Entity_[3013236352980]", + "Entity_[2600919492564]", + "Entity_[3172150142932]", + "Entity_[2205782501332]", + "Entity_[4258776868820]", + "Entity_[2927337007060]", + "Entity_[1969559300052]", + "Entity_[1488522962900]", + "Entity_[809918130132]", + "Entity_[3558697199572]", + "Entity_[4383330920404]", + "Entity_[1381148780500]", + "Entity_[4233007065044]", + "Entity_[3292409227220]", + "Entity_[3910884517844]", + "Entity_[1935199561684]", + "Entity_[2076933482452]", + "Entity_[900112443348]", + "Entity_[2274501978068]", + "Entity_[1089091004372]", + "Entity_[3193624979412]", + "Entity_[1892249888724]", + "Entity_[1209350088660]", + "Entity_[3885114714068]", + "Entity_[2957401778132]", + "Entity_[2231552305108]", + "Entity_[2192897599444]", + "Entity_[943062116308]", + "Entity_[2974581647316]", + "Entity_[3580172036052]", + "Entity_[3627416676308]", + "Entity_[4559424579540]", + "Entity_[2454890604500]", + "Entity_[1475638061012]", + "Entity_[2824257791956]", + "Entity_[4198647326676]", + "Entity_[4520769873876]", + "Entity_[1479933028308]", + "Entity_[2566559754196]", + "Entity_[1604487079892]", + "Entity_[1561537406932]", + "Entity_[3331063932884]", + "Entity_[1729041131476]", + "Entity_[676774143956]", + "Entity_[2158537861076]", + "Entity_[1948084463572]", + "Entity_[4112747980756]", + "Entity_[1132040677332]", + "Entity_[1870775052244]", + "Entity_[3468502886356]", + "Entity_[1174990350292]", + "Entity_[715428849620]", + "Entity_[590874798036]", + "Entity_[3773445564372]", + "Entity_[1716156229588]", + "Entity_[3803510335444]", + "Entity_[1441278322644]", + "Entity_[2248732174292]", + "Entity_[4284546672596]", + "Entity_[3369718638548]", + "Entity_[4598079285204]", + "Entity_[659594274772]", + "Entity_[2381876160468]", + "Entity_[2115588188116]", + "Entity_[3764855629780]", + "Entity_[2811372890068]", + "Entity_[1746221000660]", + "Entity_[3034711189460]", + "Entity_[4366151051220]", + "Entity_[1157810481108]", + "Entity_[651004340180]", + "Entity_[2875797399508]", + "Entity_[2257322108884]", + "Entity_[3223689750484]", + "Entity_[2570854721492]", + "Entity_[4456345364436]", + "Entity_[1578717276116]", + "Entity_[2656754067412]", + "Entity_[1926609627092]", + "Entity_[2772718184404]", + "Entity_[1647436752852]", + "Entity_[3210804848596]", + "Entity_[818508064724]", + "Entity_[4537949743060]", + "Entity_[4018258700244]", + "Entity_[2768423217108]", + "Entity_[1432688388052]", + "Entity_[2360401323988]", + "Entity_[2343221454804]", + "Entity_[2622394329044]", + "Entity_[792738260948]", + "Entity_[1694681393108]", + "Entity_[2038278776788]", + "Entity_[3266639423444]", + "Entity_[4155697653716]", + "Entity_[3313884063700]", + "Entity_[2442005702612]", + "Entity_[1084796037076]", + "Entity_[1535767603156]", + "Entity_[3391193475028]", + "Entity_[3923769419732]", + "Entity_[3782035498964]", + "Entity_[3953834190804]", + "Entity_[625234536404]", + "Entity_[4512179939284]", + "Entity_[3081955829716]", + "Entity_[3275229358036]", + "Entity_[4091273144276]", + "Entity_[2858617530324]", + "Entity_[1235119892436]", + "Entity_[3300999161812]", + "Entity_[2021098907604]", + "Entity_[2596624525268]", + "Entity_[3069070927828]", + "Entity_[2905862170580]", + "Entity_[3734790858708]", + "Entity_[3008941385684]", + "Entity_[4490705102804]", + "Entity_[822803032020]", + "Entity_[3709021054932]", + "Entity_[2484955375572]", + "Entity_[2502135244756]", + "Entity_[3404078376916]", + "Entity_[3687546218452]", + "Entity_[3112020600788]", + "Entity_[3056186025940]", + "Entity_[749788587988]", + "Entity_[4379035953108]", + "Entity_[1067616167892]", + "Entity_[3352538769364]", + "Entity_[4099863078868]", + "Entity_[2411940931540]", + "Entity_[1656026687444]", + "Entity_[3932359354324]", + "Entity_[1741926033364]", + "Entity_[4168582555604]", + "Entity_[2064048580564]", + "Entity_[758378522580]", + "Entity_[2678228903892]", + "Entity_[3631711643604]", + "Entity_[2287386879956]", + "Entity_[1845005248468]", + "Entity_[3477092820948]", + "Entity_[2089818384340]", + "Entity_[1037551396820]", + "Entity_[702543947732]", + "Entity_[1681796491220]", + "Entity_[908702377940]", + "Entity_[2106998253524]", + "Entity_[3129200469972]", + "Entity_[3863639877588]", + "Entity_[1050436298708]", + "Entity_[2012508973012]", + "Entity_[3618826741716]", + "Entity_[3386898507732]", + "Entity_[3434143147988]", + "Entity_[2437710735316]", + "Entity_[4288841639892]", + "Entity_[1875070019540]", + "Entity_[2128473090004]", + "Entity_[3949539223508]", + "Entity_[3489977722836]", + "Entity_[1668911589332]", + "Entity_[1398328649684]", + "Entity_[3541517330388]", + "Entity_[1806350542804]", + "Entity_[2085523417044]", + "Entity_[732608718804]", + "Entity_[4439165495252]", + "Entity_[3528632428500]", + "Entity_[2407645964244]", + "Entity_[1930904594388]", + "Entity_[4374740985812]", + "Entity_[1509997799380]", + "Entity_[1290954467284]", + "Entity_[2819962824660]", + "Entity_[2944516876244]", + "Entity_[1583012243412]", + "Entity_[1613077014484]", + "Entity_[3451323017172]", + "Entity_[938767149012]", + "Entity_[3739085826004]", + "Entity_[1192170219476]", + "Entity_[3824985171924]", + "Entity_[1956674398164]", + "Entity_[2789898053588]", + "Entity_[3146380339156]", + "Entity_[3670366349268]", + "Entity_[2429120800724]", + "Entity_[1076206102484]", + "Entity_[1394033682388]", + "Entity_[3455617984468]", + "Entity_[2712588642260]", + "Entity_[4181467457492]", + "Entity_[3103430666196]", + "Entity_[1200760154068]", + "Entity_[4121337915348]", + "Entity_[2652459100116]", + "Entity_[1621666949076]", + "Entity_[1063321200596]", + "Entity_[1823530411988]", + "Entity_[2682523871188]", + "Entity_[3696136153044]", + "Entity_[3816395237332]", + "Entity_[1939494528980]", + "Entity_[2884387334100]", + "Entity_[2124178122708]", + "Entity_[3026121254868]", + "Entity_[1853595183060]", + "Entity_[2828552759252]", + "Entity_[2364696291284]", + "Entity_[2072638515156]", + "Entity_[2008214005716]", + "Entity_[930177214420]", + "Entity_[2472070473684]", + "Entity_[3133495437268]", + "Entity_[668184209364]", + "Entity_[3593056937940]", + "Entity_[3481387788244]", + "Entity_[1016076560340]", + "Entity_[3730495891412]", + "Entity_[2055458645972]", + "Entity_[1454163224532]", + "Entity_[2167127795668]", + "Entity_[2184307664852]", + "Entity_[1836415313876]", + "Entity_[3374013605844]", + "Entity_[2708293674964]", + "Entity_[3743380793300]", + "Entity_[3661776414676]", + "Entity_[805623162836]", + "Entity_[4400510789588]", + "Entity_[1071911135188]", + "Entity_[1857890150356]", + "Entity_[3245164586964]", + "Entity_[1226529957844]", + "Entity_[1548652505044]", + "Entity_[1110565840852]", + "Entity_[3799215368148]", + "Entity_[4164287588308]", + "Entity_[4069798307796]" + ] + } + } + }, + "Entities": { + "Entity_[1003191658452]": { + "Id": "Entity_[1003191658452]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1007486625748]": { + "Id": "Entity_[1007486625748]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1011781593044]": { + "Id": "Entity_[1011781593044]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1016076560340]": { + "Id": "Entity_[1016076560340]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E23FC75B-4142-55F1-B9AE-884826E7EB23}" + }, + "assetHint": "materials/presets/pbr/metal_platinum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1020371527636]": { + "Id": "Entity_[1020371527636]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1024666494932]": { + "Id": "Entity_[1024666494932]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1028961462228]": { + "Id": "Entity_[1028961462228]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1033256429524]": { + "Id": "Entity_[1033256429524]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1037551396820]": { + "Id": "Entity_[1037551396820]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1041846364116]": { + "Id": "Entity_[1041846364116]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CDA13277-5EAB-5E2A-93F5-B7003597FBCE}" + }, + "assetHint": "materials/presets/pbr/metal_silver.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1046141331412]": { + "Id": "Entity_[1046141331412]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1050436298708]": { + "Id": "Entity_[1050436298708]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1054731266004]": { + "Id": "Entity_[1054731266004]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2AC06FA3-7670-542E-8996-DF346AFF1B61}" + }, + "assetHint": "materials/presets/pbr/metal_silver_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1059026233300]": { + "Id": "Entity_[1059026233300]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CDA13277-5EAB-5E2A-93F5-B7003597FBCE}" + }, + "assetHint": "materials/presets/pbr/metal_silver.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1063321200596]": { + "Id": "Entity_[1063321200596]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1067616167892]": { + "Id": "Entity_[1067616167892]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1071911135188]": { + "Id": "Entity_[1071911135188]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1076206102484]": { + "Id": "Entity_[1076206102484]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1080501069780]": { + "Id": "Entity_[1080501069780]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1084796037076]": { + "Id": "Entity_[1084796037076]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1089091004372]": { + "Id": "Entity_[1089091004372]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1093385971668]": { + "Id": "Entity_[1093385971668]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1097680938964]": { + "Id": "Entity_[1097680938964]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1101975906260]": { + "Id": "Entity_[1101975906260]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1106270873556]": { + "Id": "Entity_[1106270873556]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1110565840852]": { + "Id": "Entity_[1110565840852]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1114860808148]": { + "Id": "Entity_[1114860808148]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1119155775444]": { + "Id": "Entity_[1119155775444]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1123450742740]": { + "Id": "Entity_[1123450742740]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1127745710036]": { + "Id": "Entity_[1127745710036]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A3F3CD98-1634-5542-AD5A-78E91BE21AE9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1132040677332]": { + "Id": "Entity_[1132040677332]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E23FC75B-4142-55F1-B9AE-884826E7EB23}" + }, + "assetHint": "materials/presets/pbr/metal_platinum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1136335644628]": { + "Id": "Entity_[1136335644628]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{D0E9960A-4B31-5136-BAC6-5482B203D3B4}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1140630611924]": { + "Id": "Entity_[1140630611924]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2AC06FA3-7670-542E-8996-DF346AFF1B61}" + }, + "assetHint": "materials/presets/pbr/metal_silver_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1144925579220]": { + "Id": "Entity_[1144925579220]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1149220546516]": { + "Id": "Entity_[1149220546516]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1153515513812]": { + "Id": "Entity_[1153515513812]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{D0E9960A-4B31-5136-BAC6-5482B203D3B4}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1157810481108]": { + "Id": "Entity_[1157810481108]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1162105448404]": { + "Id": "Entity_[1162105448404]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E56377B1-6310-5311-A494-135BE50B74F0}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1166400415700]": { + "Id": "Entity_[1166400415700]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E23FC75B-4142-55F1-B9AE-884826E7EB23}" + }, + "assetHint": "materials/presets/pbr/metal_platinum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1170695382996]": { + "Id": "Entity_[1170695382996]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E23FC75B-4142-55F1-B9AE-884826E7EB23}" + }, + "assetHint": "materials/presets/pbr/metal_platinum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1174990350292]": { + "Id": "Entity_[1174990350292]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1179285317588]": { + "Id": "Entity_[1179285317588]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1183580284884]": { + "Id": "Entity_[1183580284884]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1187875252180]": { + "Id": "Entity_[1187875252180]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1192170219476]": { + "Id": "Entity_[1192170219476]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1196465186772]": { + "Id": "Entity_[1196465186772]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1200760154068]": { + "Id": "Entity_[1200760154068]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1205055121364]": { + "Id": "Entity_[1205055121364]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1209350088660]": { + "Id": "Entity_[1209350088660]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1213645055956]": { + "Id": "Entity_[1213645055956]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2AC06FA3-7670-542E-8996-DF346AFF1B61}" + }, + "assetHint": "materials/presets/pbr/metal_silver_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1217940023252]": { + "Id": "Entity_[1217940023252]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1222234990548]": { + "Id": "Entity_[1222234990548]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1226529957844]": { + "Id": "Entity_[1226529957844]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E66E4343-F45A-536D-AAE1-C4D096420640}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1230824925140]": { + "Id": "Entity_[1230824925140]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1235119892436]": { + "Id": "Entity_[1235119892436]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1239414859732]": { + "Id": "Entity_[1239414859732]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1243709827028]": { + "Id": "Entity_[1243709827028]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CDA13277-5EAB-5E2A-93F5-B7003597FBCE}" + }, + "assetHint": "materials/presets/pbr/metal_silver.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1248004794324]": { + "Id": "Entity_[1248004794324]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1252299761620]": { + "Id": "Entity_[1252299761620]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2AC06FA3-7670-542E-8996-DF346AFF1B61}" + }, + "assetHint": "materials/presets/pbr/metal_silver_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1256594728916]": { + "Id": "Entity_[1256594728916]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1260889696212]": { + "Id": "Entity_[1260889696212]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1265184663508]": { + "Id": "Entity_[1265184663508]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E66E4343-F45A-536D-AAE1-C4D096420640}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1269479630804]": { + "Id": "Entity_[1269479630804]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1273774598100]": { + "Id": "Entity_[1273774598100]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1278069565396]": { + "Id": "Entity_[1278069565396]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1282364532692]": { + "Id": "Entity_[1282364532692]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1286659499988]": { + "Id": "Entity_[1286659499988]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1290954467284]": { + "Id": "Entity_[1290954467284]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1295249434580]": { + "Id": "Entity_[1295249434580]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1299544401876]": { + "Id": "Entity_[1299544401876]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1303839369172]": { + "Id": "Entity_[1303839369172]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1308134336468]": { + "Id": "Entity_[1308134336468]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1312429303764]": { + "Id": "Entity_[1312429303764]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1316724271060]": { + "Id": "Entity_[1316724271060]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1321019238356]": { + "Id": "Entity_[1321019238356]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E66E4343-F45A-536D-AAE1-C4D096420640}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1325314205652]": { + "Id": "Entity_[1325314205652]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1329609172948]": { + "Id": "Entity_[1329609172948]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E23FC75B-4142-55F1-B9AE-884826E7EB23}" + }, + "assetHint": "materials/presets/pbr/metal_platinum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1333904140244]": { + "Id": "Entity_[1333904140244]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1338199107540]": { + "Id": "Entity_[1338199107540]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E54E46E7-9FA3-54D7-B5F8-8DCCDF17BC24}" + }, + "assetHint": "materials/presets/pbr/metal_silver_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1342494074836]": { + "Id": "Entity_[1342494074836]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{60D4CA04-A2FE-5AE7-B472-694C38D05183}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1346789042132]": { + "Id": "Entity_[1346789042132]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1351084009428]": { + "Id": "Entity_[1351084009428]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1355378976724]": { + "Id": "Entity_[1355378976724]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1359673944020]": { + "Id": "Entity_[1359673944020]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1363968911316]": { + "Id": "Entity_[1363968911316]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1368263878612]": { + "Id": "Entity_[1368263878612]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1372558845908]": { + "Id": "Entity_[1372558845908]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1376853813204]": { + "Id": "Entity_[1376853813204]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DD1E26AE-80FB-5DB6-8786-26D438190A38}" + }, + "assetHint": "materials/presets/pbr/metal_nickel.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1381148780500]": { + "Id": "Entity_[1381148780500]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{60D4CA04-A2FE-5AE7-B472-694C38D05183}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1385443747796]": { + "Id": "Entity_[1385443747796]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1389738715092]": { + "Id": "Entity_[1389738715092]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1394033682388]": { + "Id": "Entity_[1394033682388]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1398328649684]": { + "Id": "Entity_[1398328649684]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1402623616980]": { + "Id": "Entity_[1402623616980]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1406918584276]": { + "Id": "Entity_[1406918584276]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1411213551572]": { + "Id": "Entity_[1411213551572]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1415508518868]": { + "Id": "Entity_[1415508518868]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1419803486164]": { + "Id": "Entity_[1419803486164]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1424098453460]": { + "Id": "Entity_[1424098453460]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{D0E9960A-4B31-5136-BAC6-5482B203D3B4}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1428393420756]": { + "Id": "Entity_[1428393420756]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1432688388052]": { + "Id": "Entity_[1432688388052]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1436983355348]": { + "Id": "Entity_[1436983355348]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1441278322644]": { + "Id": "Entity_[1441278322644]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1445573289940]": { + "Id": "Entity_[1445573289940]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1449868257236]": { + "Id": "Entity_[1449868257236]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1454163224532]": { + "Id": "Entity_[1454163224532]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{79419183-FFCE-5A89-AA16-C2789D81AF75}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1458458191828]": { + "Id": "Entity_[1458458191828]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{79419183-FFCE-5A89-AA16-C2789D81AF75}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1462753159124]": { + "Id": "Entity_[1462753159124]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1467048126420]": { + "Id": "Entity_[1467048126420]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1471343093716]": { + "Id": "Entity_[1471343093716]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CDA13277-5EAB-5E2A-93F5-B7003597FBCE}" + }, + "assetHint": "materials/presets/pbr/metal_silver.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1475638061012]": { + "Id": "Entity_[1475638061012]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1479933028308]": { + "Id": "Entity_[1479933028308]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1484227995604]": { + "Id": "Entity_[1484227995604]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1488522962900]": { + "Id": "Entity_[1488522962900]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1492817930196]": { + "Id": "Entity_[1492817930196]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1497112897492]": { + "Id": "Entity_[1497112897492]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{60D4CA04-A2FE-5AE7-B472-694C38D05183}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1501407864788]": { + "Id": "Entity_[1501407864788]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1505702832084]": { + "Id": "Entity_[1505702832084]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1509997799380]": { + "Id": "Entity_[1509997799380]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1514292766676]": { + "Id": "Entity_[1514292766676]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1518587733972]": { + "Id": "Entity_[1518587733972]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1522882701268]": { + "Id": "Entity_[1522882701268]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1527177668564]": { + "Id": "Entity_[1527177668564]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E54E46E7-9FA3-54D7-B5F8-8DCCDF17BC24}" + }, + "assetHint": "materials/presets/pbr/metal_silver_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1531472635860]": { + "Id": "Entity_[1531472635860]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1535767603156]": { + "Id": "Entity_[1535767603156]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DD1E26AE-80FB-5DB6-8786-26D438190A38}" + }, + "assetHint": "materials/presets/pbr/metal_nickel.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1540062570452]": { + "Id": "Entity_[1540062570452]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1544357537748]": { + "Id": "Entity_[1544357537748]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1548652505044]": { + "Id": "Entity_[1548652505044]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1552947472340]": { + "Id": "Entity_[1552947472340]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1557242439636]": { + "Id": "Entity_[1557242439636]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1561537406932]": { + "Id": "Entity_[1561537406932]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + 0.010651908814907074, + 54.6579704284668 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1565832374228]": { + "Id": "Entity_[1565832374228]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1570127341524]": { + "Id": "Entity_[1570127341524]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1574422308820]": { + "Id": "Entity_[1574422308820]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E56377B1-6310-5311-A494-135BE50B74F0}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1578717276116]": { + "Id": "Entity_[1578717276116]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1583012243412]": { + "Id": "Entity_[1583012243412]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1587307210708]": { + "Id": "Entity_[1587307210708]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1591602178004]": { + "Id": "Entity_[1591602178004]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1595897145300]": { + "Id": "Entity_[1595897145300]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1600192112596]": { + "Id": "Entity_[1600192112596]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1604487079892]": { + "Id": "Entity_[1604487079892]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1608782047188]": { + "Id": "Entity_[1608782047188]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1613077014484]": { + "Id": "Entity_[1613077014484]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1617371981780]": { + "Id": "Entity_[1617371981780]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1621666949076]": { + "Id": "Entity_[1621666949076]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A3F3CD98-1634-5542-AD5A-78E91BE21AE9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1625961916372]": { + "Id": "Entity_[1625961916372]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CDA13277-5EAB-5E2A-93F5-B7003597FBCE}" + }, + "assetHint": "materials/presets/pbr/metal_silver.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1630256883668]": { + "Id": "Entity_[1630256883668]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{D0E9960A-4B31-5136-BAC6-5482B203D3B4}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1634551850964]": { + "Id": "Entity_[1634551850964]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DD1E26AE-80FB-5DB6-8786-26D438190A38}" + }, + "assetHint": "materials/presets/pbr/metal_nickel.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1638846818260]": { + "Id": "Entity_[1638846818260]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{9187B84B-425F-5D11-B4D7-35BBDB0959D1}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1643141785556]": { + "Id": "Entity_[1643141785556]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{3F0DF0C4-5F23-5EB1-B762-7344AFFDC011}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1647436752852]": { + "Id": "Entity_[1647436752852]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1651731720148]": { + "Id": "Entity_[1651731720148]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A3F3CD98-1634-5542-AD5A-78E91BE21AE9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1656026687444]": { + "Id": "Entity_[1656026687444]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DC0598ED-1EDD-5B37-892E-E0867621D74C}" + }, + "assetHint": "materials/presets/pbr/metal_palladium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1660321654740]": { + "Id": "Entity_[1660321654740]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1664616622036]": { + "Id": "Entity_[1664616622036]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1668911589332]": { + "Id": "Entity_[1668911589332]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1673206556628]": { + "Id": "Entity_[1673206556628]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1677501523924]": { + "Id": "Entity_[1677501523924]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{3F0DF0C4-5F23-5EB1-B762-7344AFFDC011}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1681796491220]": { + "Id": "Entity_[1681796491220]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1686091458516]": { + "Id": "Entity_[1686091458516]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2AC06FA3-7670-542E-8996-DF346AFF1B61}" + }, + "assetHint": "materials/presets/pbr/metal_silver_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1690386425812]": { + "Id": "Entity_[1690386425812]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E23FC75B-4142-55F1-B9AE-884826E7EB23}" + }, + "assetHint": "materials/presets/pbr/metal_platinum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1694681393108]": { + "Id": "Entity_[1694681393108]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DC0598ED-1EDD-5B37-892E-E0867621D74C}" + }, + "assetHint": "materials/presets/pbr/metal_palladium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1698976360404]": { + "Id": "Entity_[1698976360404]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1703271327700]": { + "Id": "Entity_[1703271327700]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1707566294996]": { + "Id": "Entity_[1707566294996]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + 0.010651908814907074, + 54.6579704284668 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1711861262292]": { + "Id": "Entity_[1711861262292]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1716156229588]": { + "Id": "Entity_[1716156229588]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E23FC75B-4142-55F1-B9AE-884826E7EB23}" + }, + "assetHint": "materials/presets/pbr/metal_platinum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1720451196884]": { + "Id": "Entity_[1720451196884]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1724746164180]": { + "Id": "Entity_[1724746164180]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1729041131476]": { + "Id": "Entity_[1729041131476]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1733336098772]": { + "Id": "Entity_[1733336098772]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{79419183-FFCE-5A89-AA16-C2789D81AF75}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1737631066068]": { + "Id": "Entity_[1737631066068]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1741926033364]": { + "Id": "Entity_[1741926033364]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1746221000660]": { + "Id": "Entity_[1746221000660]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1750515967956]": { + "Id": "Entity_[1750515967956]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1754810935252]": { + "Id": "Entity_[1754810935252]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1759105902548]": { + "Id": "Entity_[1759105902548]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1763400869844]": { + "Id": "Entity_[1763400869844]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1767695837140]": { + "Id": "Entity_[1767695837140]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CDA13277-5EAB-5E2A-93F5-B7003597FBCE}" + }, + "assetHint": "materials/presets/pbr/metal_silver.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1771990804436]": { + "Id": "Entity_[1771990804436]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1776285771732]": { + "Id": "Entity_[1776285771732]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1780580739028]": { + "Id": "Entity_[1780580739028]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{9187B84B-425F-5D11-B4D7-35BBDB0959D1}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1784875706324]": { + "Id": "Entity_[1784875706324]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1789170673620]": { + "Id": "Entity_[1789170673620]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E23FC75B-4142-55F1-B9AE-884826E7EB23}" + }, + "assetHint": "materials/presets/pbr/metal_platinum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1793465640916]": { + "Id": "Entity_[1793465640916]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E56377B1-6310-5311-A494-135BE50B74F0}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1797760608212]": { + "Id": "Entity_[1797760608212]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{9187B84B-425F-5D11-B4D7-35BBDB0959D1}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1802055575508]": { + "Id": "Entity_[1802055575508]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1806350542804]": { + "Id": "Entity_[1806350542804]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1810645510100]": { + "Id": "Entity_[1810645510100]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1814940477396]": { + "Id": "Entity_[1814940477396]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1819235444692]": { + "Id": "Entity_[1819235444692]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1823530411988]": { + "Id": "Entity_[1823530411988]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1827825379284]": { + "Id": "Entity_[1827825379284]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E66E4343-F45A-536D-AAE1-C4D096420640}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1832120346580]": { + "Id": "Entity_[1832120346580]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1836415313876]": { + "Id": "Entity_[1836415313876]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1840710281172]": { + "Id": "Entity_[1840710281172]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1845005248468]": { + "Id": "Entity_[1845005248468]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1849300215764]": { + "Id": "Entity_[1849300215764]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1853595183060]": { + "Id": "Entity_[1853595183060]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1857890150356]": { + "Id": "Entity_[1857890150356]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1862185117652]": { + "Id": "Entity_[1862185117652]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1866480084948]": { + "Id": "Entity_[1866480084948]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E66E4343-F45A-536D-AAE1-C4D096420640}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1870775052244]": { + "Id": "Entity_[1870775052244]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1875070019540]": { + "Id": "Entity_[1875070019540]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CDA13277-5EAB-5E2A-93F5-B7003597FBCE}" + }, + "assetHint": "materials/presets/pbr/metal_silver.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1879364986836]": { + "Id": "Entity_[1879364986836]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + 0.010651908814907074, + 114.53101348876953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1883659954132]": { + "Id": "Entity_[1883659954132]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1887954921428]": { + "Id": "Entity_[1887954921428]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1892249888724]": { + "Id": "Entity_[1892249888724]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1896544856020]": { + "Id": "Entity_[1896544856020]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1900839823316]": { + "Id": "Entity_[1900839823316]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1905134790612]": { + "Id": "Entity_[1905134790612]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1909429757908]": { + "Id": "Entity_[1909429757908]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1913724725204]": { + "Id": "Entity_[1913724725204]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1918019692500]": { + "Id": "Entity_[1918019692500]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DC0598ED-1EDD-5B37-892E-E0867621D74C}" + }, + "assetHint": "materials/presets/pbr/metal_palladium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1922314659796]": { + "Id": "Entity_[1922314659796]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1926609627092]": { + "Id": "Entity_[1926609627092]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E56377B1-6310-5311-A494-135BE50B74F0}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1930904594388]": { + "Id": "Entity_[1930904594388]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1935199561684]": { + "Id": "Entity_[1935199561684]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E54E46E7-9FA3-54D7-B5F8-8DCCDF17BC24}" + }, + "assetHint": "materials/presets/pbr/metal_silver_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1939494528980]": { + "Id": "Entity_[1939494528980]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1943789496276]": { + "Id": "Entity_[1943789496276]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{79419183-FFCE-5A89-AA16-C2789D81AF75}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1948084463572]": { + "Id": "Entity_[1948084463572]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1952379430868]": { + "Id": "Entity_[1952379430868]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + 0.010651908814907074, + 24.573455810546875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1956674398164]": { + "Id": "Entity_[1956674398164]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{9187B84B-425F-5D11-B4D7-35BBDB0959D1}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1960969365460]": { + "Id": "Entity_[1960969365460]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E56377B1-6310-5311-A494-135BE50B74F0}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1965264332756]": { + "Id": "Entity_[1965264332756]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A3F3CD98-1634-5542-AD5A-78E91BE21AE9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1969559300052]": { + "Id": "Entity_[1969559300052]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1973854267348]": { + "Id": "Entity_[1973854267348]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E56377B1-6310-5311-A494-135BE50B74F0}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1978149234644]": { + "Id": "Entity_[1978149234644]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1982444201940]": { + "Id": "Entity_[1982444201940]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1986739169236]": { + "Id": "Entity_[1986739169236]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1991034136532]": { + "Id": "Entity_[1991034136532]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1995329103828]": { + "Id": "Entity_[1995329103828]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{79419183-FFCE-5A89-AA16-C2789D81AF75}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[1999624071124]": { + "Id": "Entity_[1999624071124]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2003919038420]": { + "Id": "Entity_[2003919038420]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2008214005716]": { + "Id": "Entity_[2008214005716]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2012508973012]": { + "Id": "Entity_[2012508973012]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2AC06FA3-7670-542E-8996-DF346AFF1B61}" + }, + "assetHint": "materials/presets/pbr/metal_silver_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2016803940308]": { + "Id": "Entity_[2016803940308]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2021098907604]": { + "Id": "Entity_[2021098907604]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2025393874900]": { + "Id": "Entity_[2025393874900]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E56377B1-6310-5311-A494-135BE50B74F0}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2029688842196]": { + "Id": "Entity_[2029688842196]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{D0E9960A-4B31-5136-BAC6-5482B203D3B4}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2033983809492]": { + "Id": "Entity_[2033983809492]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E56377B1-6310-5311-A494-135BE50B74F0}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2038278776788]": { + "Id": "Entity_[2038278776788]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2042573744084]": { + "Id": "Entity_[2042573744084]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2046868711380]": { + "Id": "Entity_[2046868711380]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{3F0DF0C4-5F23-5EB1-B762-7344AFFDC011}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2051163678676]": { + "Id": "Entity_[2051163678676]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{3F0DF0C4-5F23-5EB1-B762-7344AFFDC011}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2055458645972]": { + "Id": "Entity_[2055458645972]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2059753613268]": { + "Id": "Entity_[2059753613268]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2064048580564]": { + "Id": "Entity_[2064048580564]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2068343547860]": { + "Id": "Entity_[2068343547860]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2072638515156]": { + "Id": "Entity_[2072638515156]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2076933482452]": { + "Id": "Entity_[2076933482452]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E54E46E7-9FA3-54D7-B5F8-8DCCDF17BC24}" + }, + "assetHint": "materials/presets/pbr/metal_silver_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2081228449748]": { + "Id": "Entity_[2081228449748]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{79419183-FFCE-5A89-AA16-C2789D81AF75}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2085523417044]": { + "Id": "Entity_[2085523417044]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2089818384340]": { + "Id": "Entity_[2089818384340]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{D0E9960A-4B31-5136-BAC6-5482B203D3B4}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2094113351636]": { + "Id": "Entity_[2094113351636]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2098408318932]": { + "Id": "Entity_[2098408318932]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2102703286228]": { + "Id": "Entity_[2102703286228]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2106998253524]": { + "Id": "Entity_[2106998253524]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2111293220820]": { + "Id": "Entity_[2111293220820]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2115588188116]": { + "Id": "Entity_[2115588188116]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2119883155412]": { + "Id": "Entity_[2119883155412]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2124178122708]": { + "Id": "Entity_[2124178122708]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2128473090004]": { + "Id": "Entity_[2128473090004]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E66E4343-F45A-536D-AAE1-C4D096420640}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2132768057300]": { + "Id": "Entity_[2132768057300]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2137063024596]": { + "Id": "Entity_[2137063024596]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2141357991892]": { + "Id": "Entity_[2141357991892]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2145652959188]": { + "Id": "Entity_[2145652959188]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2149947926484]": { + "Id": "Entity_[2149947926484]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2154242893780]": { + "Id": "Entity_[2154242893780]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2158537861076]": { + "Id": "Entity_[2158537861076]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{9187B84B-425F-5D11-B4D7-35BBDB0959D1}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2162832828372]": { + "Id": "Entity_[2162832828372]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2AC06FA3-7670-542E-8996-DF346AFF1B61}" + }, + "assetHint": "materials/presets/pbr/metal_silver_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2167127795668]": { + "Id": "Entity_[2167127795668]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2171422762964]": { + "Id": "Entity_[2171422762964]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2175717730260]": { + "Id": "Entity_[2175717730260]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2180012697556]": { + "Id": "Entity_[2180012697556]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DC0598ED-1EDD-5B37-892E-E0867621D74C}" + }, + "assetHint": "materials/presets/pbr/metal_palladium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2184307664852]": { + "Id": "Entity_[2184307664852]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2188602632148]": { + "Id": "Entity_[2188602632148]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2192897599444]": { + "Id": "Entity_[2192897599444]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{79419183-FFCE-5A89-AA16-C2789D81AF75}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2197192566740]": { + "Id": "Entity_[2197192566740]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2201487534036]": { + "Id": "Entity_[2201487534036]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DC0598ED-1EDD-5B37-892E-E0867621D74C}" + }, + "assetHint": "materials/presets/pbr/metal_palladium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2205782501332]": { + "Id": "Entity_[2205782501332]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{3F0DF0C4-5F23-5EB1-B762-7344AFFDC011}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2210077468628]": { + "Id": "Entity_[2210077468628]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2214372435924]": { + "Id": "Entity_[2214372435924]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2218667403220]": { + "Id": "Entity_[2218667403220]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E54E46E7-9FA3-54D7-B5F8-8DCCDF17BC24}" + }, + "assetHint": "materials/presets/pbr/metal_silver_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2222962370516]": { + "Id": "Entity_[2222962370516]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E56377B1-6310-5311-A494-135BE50B74F0}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2227257337812]": { + "Id": "Entity_[2227257337812]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2231552305108]": { + "Id": "Entity_[2231552305108]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2235847272404]": { + "Id": "Entity_[2235847272404]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{79419183-FFCE-5A89-AA16-C2789D81AF75}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2240142239700]": { + "Id": "Entity_[2240142239700]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2244437206996]": { + "Id": "Entity_[2244437206996]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E66E4343-F45A-536D-AAE1-C4D096420640}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2248732174292]": { + "Id": "Entity_[2248732174292]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E66E4343-F45A-536D-AAE1-C4D096420640}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2253027141588]": { + "Id": "Entity_[2253027141588]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{9187B84B-425F-5D11-B4D7-35BBDB0959D1}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2257322108884]": { + "Id": "Entity_[2257322108884]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2261617076180]": { + "Id": "Entity_[2261617076180]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2265912043476]": { + "Id": "Entity_[2265912043476]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2270207010772]": { + "Id": "Entity_[2270207010772]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2274501978068]": { + "Id": "Entity_[2274501978068]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2278796945364]": { + "Id": "Entity_[2278796945364]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E56377B1-6310-5311-A494-135BE50B74F0}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2283091912660]": { + "Id": "Entity_[2283091912660]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2287386879956]": { + "Id": "Entity_[2287386879956]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2291681847252]": { + "Id": "Entity_[2291681847252]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2295976814548]": { + "Id": "Entity_[2295976814548]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2300271781844]": { + "Id": "Entity_[2300271781844]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E54E46E7-9FA3-54D7-B5F8-8DCCDF17BC24}" + }, + "assetHint": "materials/presets/pbr/metal_silver_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2304566749140]": { + "Id": "Entity_[2304566749140]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2308861716436]": { + "Id": "Entity_[2308861716436]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2313156683732]": { + "Id": "Entity_[2313156683732]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2317451651028]": { + "Id": "Entity_[2317451651028]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2321746618324]": { + "Id": "Entity_[2321746618324]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{3F0DF0C4-5F23-5EB1-B762-7344AFFDC011}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2326041585620]": { + "Id": "Entity_[2326041585620]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2330336552916]": { + "Id": "Entity_[2330336552916]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2334631520212]": { + "Id": "Entity_[2334631520212]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2338926487508]": { + "Id": "Entity_[2338926487508]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A3F3CD98-1634-5542-AD5A-78E91BE21AE9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2343221454804]": { + "Id": "Entity_[2343221454804]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2347516422100]": { + "Id": "Entity_[2347516422100]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2351811389396]": { + "Id": "Entity_[2351811389396]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E56377B1-6310-5311-A494-135BE50B74F0}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2356106356692]": { + "Id": "Entity_[2356106356692]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2360401323988]": { + "Id": "Entity_[2360401323988]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2364696291284]": { + "Id": "Entity_[2364696291284]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2368991258580]": { + "Id": "Entity_[2368991258580]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2373286225876]": { + "Id": "Entity_[2373286225876]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2377581193172]": { + "Id": "Entity_[2377581193172]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2381876160468]": { + "Id": "Entity_[2381876160468]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2386171127764]": { + "Id": "Entity_[2386171127764]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2390466095060]": { + "Id": "Entity_[2390466095060]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2394761062356]": { + "Id": "Entity_[2394761062356]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2399056029652]": { + "Id": "Entity_[2399056029652]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2403350996948]": { + "Id": "Entity_[2403350996948]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2407645964244]": { + "Id": "Entity_[2407645964244]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2411940931540]": { + "Id": "Entity_[2411940931540]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2416235898836]": { + "Id": "Entity_[2416235898836]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DD1E26AE-80FB-5DB6-8786-26D438190A38}" + }, + "assetHint": "materials/presets/pbr/metal_nickel.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2420530866132]": { + "Id": "Entity_[2420530866132]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{9187B84B-425F-5D11-B4D7-35BBDB0959D1}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2424825833428]": { + "Id": "Entity_[2424825833428]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2429120800724]": { + "Id": "Entity_[2429120800724]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{60D4CA04-A2FE-5AE7-B472-694C38D05183}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2433415768020]": { + "Id": "Entity_[2433415768020]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2437710735316]": { + "Id": "Entity_[2437710735316]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2442005702612]": { + "Id": "Entity_[2442005702612]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CDA13277-5EAB-5E2A-93F5-B7003597FBCE}" + }, + "assetHint": "materials/presets/pbr/metal_silver.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2446300669908]": { + "Id": "Entity_[2446300669908]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2450595637204]": { + "Id": "Entity_[2450595637204]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2454890604500]": { + "Id": "Entity_[2454890604500]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{D0E9960A-4B31-5136-BAC6-5482B203D3B4}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2459185571796]": { + "Id": "Entity_[2459185571796]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2463480539092]": { + "Id": "Entity_[2463480539092]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2467775506388]": { + "Id": "Entity_[2467775506388]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{79419183-FFCE-5A89-AA16-C2789D81AF75}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2472070473684]": { + "Id": "Entity_[2472070473684]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CDA13277-5EAB-5E2A-93F5-B7003597FBCE}" + }, + "assetHint": "materials/presets/pbr/metal_silver.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2476365440980]": { + "Id": "Entity_[2476365440980]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2480660408276]": { + "Id": "Entity_[2480660408276]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2484955375572]": { + "Id": "Entity_[2484955375572]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2489250342868]": { + "Id": "Entity_[2489250342868]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2493545310164]": { + "Id": "Entity_[2493545310164]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2497840277460]": { + "Id": "Entity_[2497840277460]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2502135244756]": { + "Id": "Entity_[2502135244756]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2506430212052]": { + "Id": "Entity_[2506430212052]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2510725179348]": { + "Id": "Entity_[2510725179348]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2515020146644]": { + "Id": "Entity_[2515020146644]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2519315113940]": { + "Id": "Entity_[2519315113940]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A3F3CD98-1634-5542-AD5A-78E91BE21AE9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2523610081236]": { + "Id": "Entity_[2523610081236]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2527905048532]": { + "Id": "Entity_[2527905048532]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2532200015828]": { + "Id": "Entity_[2532200015828]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2536494983124]": { + "Id": "Entity_[2536494983124]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2540789950420]": { + "Id": "Entity_[2540789950420]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CDA13277-5EAB-5E2A-93F5-B7003597FBCE}" + }, + "assetHint": "materials/presets/pbr/metal_silver.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2545084917716]": { + "Id": "Entity_[2545084917716]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2549379885012]": { + "Id": "Entity_[2549379885012]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2553674852308]": { + "Id": "Entity_[2553674852308]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2557969819604]": { + "Id": "Entity_[2557969819604]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A3F3CD98-1634-5542-AD5A-78E91BE21AE9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2562264786900]": { + "Id": "Entity_[2562264786900]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{3F0DF0C4-5F23-5EB1-B762-7344AFFDC011}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2566559754196]": { + "Id": "Entity_[2566559754196]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2570854721492]": { + "Id": "Entity_[2570854721492]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{D0E9960A-4B31-5136-BAC6-5482B203D3B4}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2575149688788]": { + "Id": "Entity_[2575149688788]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2579444656084]": { + "Id": "Entity_[2579444656084]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2583739623380]": { + "Id": "Entity_[2583739623380]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2588034590676]": { + "Id": "Entity_[2588034590676]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DC0598ED-1EDD-5B37-892E-E0867621D74C}" + }, + "assetHint": "materials/presets/pbr/metal_palladium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2592329557972]": { + "Id": "Entity_[2592329557972]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2596624525268]": { + "Id": "Entity_[2596624525268]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2600919492564]": { + "Id": "Entity_[2600919492564]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2605214459860]": { + "Id": "Entity_[2605214459860]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2609509427156]": { + "Id": "Entity_[2609509427156]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2613804394452]": { + "Id": "Entity_[2613804394452]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2618099361748]": { + "Id": "Entity_[2618099361748]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2622394329044]": { + "Id": "Entity_[2622394329044]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2626689296340]": { + "Id": "Entity_[2626689296340]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2630984263636]": { + "Id": "Entity_[2630984263636]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2635279230932]": { + "Id": "Entity_[2635279230932]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E66E4343-F45A-536D-AAE1-C4D096420640}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2639574198228]": { + "Id": "Entity_[2639574198228]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2643869165524]": { + "Id": "Entity_[2643869165524]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2648164132820]": { + "Id": "Entity_[2648164132820]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2652459100116]": { + "Id": "Entity_[2652459100116]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2656754067412]": { + "Id": "Entity_[2656754067412]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2661049034708]": { + "Id": "Entity_[2661049034708]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2665344002004]": { + "Id": "Entity_[2665344002004]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2669638969300]": { + "Id": "Entity_[2669638969300]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2673933936596]": { + "Id": "Entity_[2673933936596]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2678228903892]": { + "Id": "Entity_[2678228903892]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2682523871188]": { + "Id": "Entity_[2682523871188]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2686818838484]": { + "Id": "Entity_[2686818838484]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2691113805780]": { + "Id": "Entity_[2691113805780]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2695408773076]": { + "Id": "Entity_[2695408773076]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2699703740372]": { + "Id": "Entity_[2699703740372]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2703998707668]": { + "Id": "Entity_[2703998707668]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2708293674964]": { + "Id": "Entity_[2708293674964]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{3F0DF0C4-5F23-5EB1-B762-7344AFFDC011}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2712588642260]": { + "Id": "Entity_[2712588642260]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2716883609556]": { + "Id": "Entity_[2716883609556]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2721178576852]": { + "Id": "Entity_[2721178576852]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2725473544148]": { + "Id": "Entity_[2725473544148]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E56377B1-6310-5311-A494-135BE50B74F0}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2729768511444]": { + "Id": "Entity_[2729768511444]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{79419183-FFCE-5A89-AA16-C2789D81AF75}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2734063478740]": { + "Id": "Entity_[2734063478740]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2738358446036]": { + "Id": "Entity_[2738358446036]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2742653413332]": { + "Id": "Entity_[2742653413332]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2746948380628]": { + "Id": "Entity_[2746948380628]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{60D4CA04-A2FE-5AE7-B472-694C38D05183}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2751243347924]": { + "Id": "Entity_[2751243347924]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2755538315220]": { + "Id": "Entity_[2755538315220]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2759833282516]": { + "Id": "Entity_[2759833282516]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2764128249812]": { + "Id": "Entity_[2764128249812]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2768423217108]": { + "Id": "Entity_[2768423217108]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E56377B1-6310-5311-A494-135BE50B74F0}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2772718184404]": { + "Id": "Entity_[2772718184404]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{79419183-FFCE-5A89-AA16-C2789D81AF75}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2777013151700]": { + "Id": "Entity_[2777013151700]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2781308118996]": { + "Id": "Entity_[2781308118996]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{60D4CA04-A2FE-5AE7-B472-694C38D05183}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2785603086292]": { + "Id": "Entity_[2785603086292]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E54E46E7-9FA3-54D7-B5F8-8DCCDF17BC24}" + }, + "assetHint": "materials/presets/pbr/metal_silver_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2789898053588]": { + "Id": "Entity_[2789898053588]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E54E46E7-9FA3-54D7-B5F8-8DCCDF17BC24}" + }, + "assetHint": "materials/presets/pbr/metal_silver_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2794193020884]": { + "Id": "Entity_[2794193020884]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2798487988180]": { + "Id": "Entity_[2798487988180]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2802782955476]": { + "Id": "Entity_[2802782955476]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2807077922772]": { + "Id": "Entity_[2807077922772]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2811372890068]": { + "Id": "Entity_[2811372890068]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2815667857364]": { + "Id": "Entity_[2815667857364]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2819962824660]": { + "Id": "Entity_[2819962824660]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E56377B1-6310-5311-A494-135BE50B74F0}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2824257791956]": { + "Id": "Entity_[2824257791956]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2828552759252]": { + "Id": "Entity_[2828552759252]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2832847726548]": { + "Id": "Entity_[2832847726548]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2837142693844]": { + "Id": "Entity_[2837142693844]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E54E46E7-9FA3-54D7-B5F8-8DCCDF17BC24}" + }, + "assetHint": "materials/presets/pbr/metal_silver_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2841437661140]": { + "Id": "Entity_[2841437661140]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2845732628436]": { + "Id": "Entity_[2845732628436]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2850027595732]": { + "Id": "Entity_[2850027595732]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2854322563028]": { + "Id": "Entity_[2854322563028]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2858617530324]": { + "Id": "Entity_[2858617530324]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2862912497620]": { + "Id": "Entity_[2862912497620]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2867207464916]": { + "Id": "Entity_[2867207464916]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2871502432212]": { + "Id": "Entity_[2871502432212]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2875797399508]": { + "Id": "Entity_[2875797399508]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2880092366804]": { + "Id": "Entity_[2880092366804]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2884387334100]": { + "Id": "Entity_[2884387334100]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2888682301396]": { + "Id": "Entity_[2888682301396]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2892977268692]": { + "Id": "Entity_[2892977268692]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2897272235988]": { + "Id": "Entity_[2897272235988]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2901567203284]": { + "Id": "Entity_[2901567203284]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2905862170580]": { + "Id": "Entity_[2905862170580]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2910157137876]": { + "Id": "Entity_[2910157137876]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2914452105172]": { + "Id": "Entity_[2914452105172]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2918747072468]": { + "Id": "Entity_[2918747072468]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2923042039764]": { + "Id": "Entity_[2923042039764]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2AC06FA3-7670-542E-8996-DF346AFF1B61}" + }, + "assetHint": "materials/presets/pbr/metal_silver_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2927337007060]": { + "Id": "Entity_[2927337007060]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2931631974356]": { + "Id": "Entity_[2931631974356]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2935926941652]": { + "Id": "Entity_[2935926941652]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2940221908948]": { + "Id": "Entity_[2940221908948]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2944516876244]": { + "Id": "Entity_[2944516876244]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2948811843540]": { + "Id": "Entity_[2948811843540]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2953106810836]": { + "Id": "Entity_[2953106810836]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + 0.010651908814907074, + 99.47334289550781 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2957401778132]": { + "Id": "Entity_[2957401778132]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2961696745428]": { + "Id": "Entity_[2961696745428]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2965991712724]": { + "Id": "Entity_[2965991712724]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2970286680020]": { + "Id": "Entity_[2970286680020]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2974581647316]": { + "Id": "Entity_[2974581647316]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2978876614612]": { + "Id": "Entity_[2978876614612]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2983171581908]": { + "Id": "Entity_[2983171581908]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2987466549204]": { + "Id": "Entity_[2987466549204]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2991761516500]": { + "Id": "Entity_[2991761516500]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[2996056483796]": { + "Id": "Entity_[2996056483796]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3000351451092]": { + "Id": "Entity_[3000351451092]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E66E4343-F45A-536D-AAE1-C4D096420640}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3004646418388]": { + "Id": "Entity_[3004646418388]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3008941385684]": { + "Id": "Entity_[3008941385684]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3013236352980]": { + "Id": "Entity_[3013236352980]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3017531320276]": { + "Id": "Entity_[3017531320276]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3021826287572]": { + "Id": "Entity_[3021826287572]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3026121254868]": { + "Id": "Entity_[3026121254868]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3030416222164]": { + "Id": "Entity_[3030416222164]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DC0598ED-1EDD-5B37-892E-E0867621D74C}" + }, + "assetHint": "materials/presets/pbr/metal_palladium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3034711189460]": { + "Id": "Entity_[3034711189460]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A3F3CD98-1634-5542-AD5A-78E91BE21AE9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3039006156756]": { + "Id": "Entity_[3039006156756]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DD1E26AE-80FB-5DB6-8786-26D438190A38}" + }, + "assetHint": "materials/presets/pbr/metal_nickel.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3043301124052]": { + "Id": "Entity_[3043301124052]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3047596091348]": { + "Id": "Entity_[3047596091348]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3051891058644]": { + "Id": "Entity_[3051891058644]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + 0.010651908814907074, + 69.38883209228516 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3056186025940]": { + "Id": "Entity_[3056186025940]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3060480993236]": { + "Id": "Entity_[3060480993236]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3064775960532]": { + "Id": "Entity_[3064775960532]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3069070927828]": { + "Id": "Entity_[3069070927828]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3073365895124]": { + "Id": "Entity_[3073365895124]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{9187B84B-425F-5D11-B4D7-35BBDB0959D1}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3077660862420]": { + "Id": "Entity_[3077660862420]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{60D4CA04-A2FE-5AE7-B472-694C38D05183}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3081955829716]": { + "Id": "Entity_[3081955829716]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3086250797012]": { + "Id": "Entity_[3086250797012]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3090545764308]": { + "Id": "Entity_[3090545764308]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3094840731604]": { + "Id": "Entity_[3094840731604]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3099135698900]": { + "Id": "Entity_[3099135698900]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3103430666196]": { + "Id": "Entity_[3103430666196]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3107725633492]": { + "Id": "Entity_[3107725633492]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3112020600788]": { + "Id": "Entity_[3112020600788]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3116315568084]": { + "Id": "Entity_[3116315568084]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3120610535380]": { + "Id": "Entity_[3120610535380]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A3F3CD98-1634-5542-AD5A-78E91BE21AE9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3124905502676]": { + "Id": "Entity_[3124905502676]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3129200469972]": { + "Id": "Entity_[3129200469972]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3133495437268]": { + "Id": "Entity_[3133495437268]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3137790404564]": { + "Id": "Entity_[3137790404564]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3142085371860]": { + "Id": "Entity_[3142085371860]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3146380339156]": { + "Id": "Entity_[3146380339156]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3150675306452]": { + "Id": "Entity_[3150675306452]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3154970273748]": { + "Id": "Entity_[3154970273748]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3159265241044]": { + "Id": "Entity_[3159265241044]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3163560208340]": { + "Id": "Entity_[3163560208340]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3167855175636]": { + "Id": "Entity_[3167855175636]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3172150142932]": { + "Id": "Entity_[3172150142932]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3176445110228]": { + "Id": "Entity_[3176445110228]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3180740077524]": { + "Id": "Entity_[3180740077524]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3185035044820]": { + "Id": "Entity_[3185035044820]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3189330012116]": { + "Id": "Entity_[3189330012116]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3193624979412]": { + "Id": "Entity_[3193624979412]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3197919946708]": { + "Id": "Entity_[3197919946708]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DD1E26AE-80FB-5DB6-8786-26D438190A38}" + }, + "assetHint": "materials/presets/pbr/metal_nickel.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3202214914004]": { + "Id": "Entity_[3202214914004]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3206509881300]": { + "Id": "Entity_[3206509881300]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3210804848596]": { + "Id": "Entity_[3210804848596]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DD1E26AE-80FB-5DB6-8786-26D438190A38}" + }, + "assetHint": "materials/presets/pbr/metal_nickel.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3215099815892]": { + "Id": "Entity_[3215099815892]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3219394783188]": { + "Id": "Entity_[3219394783188]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2AC06FA3-7670-542E-8996-DF346AFF1B61}" + }, + "assetHint": "materials/presets/pbr/metal_silver_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3223689750484]": { + "Id": "Entity_[3223689750484]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3227984717780]": { + "Id": "Entity_[3227984717780]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3232279685076]": { + "Id": "Entity_[3232279685076]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3236574652372]": { + "Id": "Entity_[3236574652372]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3240869619668]": { + "Id": "Entity_[3240869619668]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3245164586964]": { + "Id": "Entity_[3245164586964]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{D0E9960A-4B31-5136-BAC6-5482B203D3B4}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3249459554260]": { + "Id": "Entity_[3249459554260]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3253754521556]": { + "Id": "Entity_[3253754521556]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3258049488852]": { + "Id": "Entity_[3258049488852]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3262344456148]": { + "Id": "Entity_[3262344456148]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3266639423444]": { + "Id": "Entity_[3266639423444]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3270934390740]": { + "Id": "Entity_[3270934390740]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3275229358036]": { + "Id": "Entity_[3275229358036]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3279524325332]": { + "Id": "Entity_[3279524325332]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3283819292628]": { + "Id": "Entity_[3283819292628]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3288114259924]": { + "Id": "Entity_[3288114259924]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3292409227220]": { + "Id": "Entity_[3292409227220]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CDA13277-5EAB-5E2A-93F5-B7003597FBCE}" + }, + "assetHint": "materials/presets/pbr/metal_silver.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3296704194516]": { + "Id": "Entity_[3296704194516]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DD1E26AE-80FB-5DB6-8786-26D438190A38}" + }, + "assetHint": "materials/presets/pbr/metal_nickel.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3300999161812]": { + "Id": "Entity_[3300999161812]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{9187B84B-425F-5D11-B4D7-35BBDB0959D1}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3305294129108]": { + "Id": "Entity_[3305294129108]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3309589096404]": { + "Id": "Entity_[3309589096404]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3313884063700]": { + "Id": "Entity_[3313884063700]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3318179030996]": { + "Id": "Entity_[3318179030996]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3322473998292]": { + "Id": "Entity_[3322473998292]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3326768965588]": { + "Id": "Entity_[3326768965588]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3331063932884]": { + "Id": "Entity_[3331063932884]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3335358900180]": { + "Id": "Entity_[3335358900180]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3339653867476]": { + "Id": "Entity_[3339653867476]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3343948834772]": { + "Id": "Entity_[3343948834772]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3348243802068]": { + "Id": "Entity_[3348243802068]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3352538769364]": { + "Id": "Entity_[3352538769364]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3356833736660]": { + "Id": "Entity_[3356833736660]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3361128703956]": { + "Id": "Entity_[3361128703956]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3365423671252]": { + "Id": "Entity_[3365423671252]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{60D4CA04-A2FE-5AE7-B472-694C38D05183}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3369718638548]": { + "Id": "Entity_[3369718638548]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3374013605844]": { + "Id": "Entity_[3374013605844]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3378308573140]": { + "Id": "Entity_[3378308573140]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{9187B84B-425F-5D11-B4D7-35BBDB0959D1}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3382603540436]": { + "Id": "Entity_[3382603540436]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3386898507732]": { + "Id": "Entity_[3386898507732]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3391193475028]": { + "Id": "Entity_[3391193475028]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3395488442324]": { + "Id": "Entity_[3395488442324]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A3F3CD98-1634-5542-AD5A-78E91BE21AE9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3399783409620]": { + "Id": "Entity_[3399783409620]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3404078376916]": { + "Id": "Entity_[3404078376916]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3408373344212]": { + "Id": "Entity_[3408373344212]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{D0E9960A-4B31-5136-BAC6-5482B203D3B4}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3412668311508]": { + "Id": "Entity_[3412668311508]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E23FC75B-4142-55F1-B9AE-884826E7EB23}" + }, + "assetHint": "materials/presets/pbr/metal_platinum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3416963278804]": { + "Id": "Entity_[3416963278804]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3421258246100]": { + "Id": "Entity_[3421258246100]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3425553213396]": { + "Id": "Entity_[3425553213396]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3429848180692]": { + "Id": "Entity_[3429848180692]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3434143147988]": { + "Id": "Entity_[3434143147988]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{3F0DF0C4-5F23-5EB1-B762-7344AFFDC011}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3438438115284]": { + "Id": "Entity_[3438438115284]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3442733082580]": { + "Id": "Entity_[3442733082580]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3447028049876]": { + "Id": "Entity_[3447028049876]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3451323017172]": { + "Id": "Entity_[3451323017172]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E23FC75B-4142-55F1-B9AE-884826E7EB23}" + }, + "assetHint": "materials/presets/pbr/metal_platinum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3455617984468]": { + "Id": "Entity_[3455617984468]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3459912951764]": { + "Id": "Entity_[3459912951764]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E54E46E7-9FA3-54D7-B5F8-8DCCDF17BC24}" + }, + "assetHint": "materials/presets/pbr/metal_silver_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3464207919060]": { + "Id": "Entity_[3464207919060]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3468502886356]": { + "Id": "Entity_[3468502886356]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3472797853652]": { + "Id": "Entity_[3472797853652]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3477092820948]": { + "Id": "Entity_[3477092820948]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3481387788244]": { + "Id": "Entity_[3481387788244]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DC0598ED-1EDD-5B37-892E-E0867621D74C}" + }, + "assetHint": "materials/presets/pbr/metal_palladium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3485682755540]": { + "Id": "Entity_[3485682755540]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3489977722836]": { + "Id": "Entity_[3489977722836]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3494272690132]": { + "Id": "Entity_[3494272690132]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3498567657428]": { + "Id": "Entity_[3498567657428]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3502862624724]": { + "Id": "Entity_[3502862624724]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DD1E26AE-80FB-5DB6-8786-26D438190A38}" + }, + "assetHint": "materials/presets/pbr/metal_nickel.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3507157592020]": { + "Id": "Entity_[3507157592020]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3511452559316]": { + "Id": "Entity_[3511452559316]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3515747526612]": { + "Id": "Entity_[3515747526612]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{79419183-FFCE-5A89-AA16-C2789D81AF75}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3520042493908]": { + "Id": "Entity_[3520042493908]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + 0.010651908814907074, + 84.44650268554688 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3524337461204]": { + "Id": "Entity_[3524337461204]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3528632428500]": { + "Id": "Entity_[3528632428500]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{79419183-FFCE-5A89-AA16-C2789D81AF75}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3532927395796]": { + "Id": "Entity_[3532927395796]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3537222363092]": { + "Id": "Entity_[3537222363092]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3541517330388]": { + "Id": "Entity_[3541517330388]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A3F3CD98-1634-5542-AD5A-78E91BE21AE9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3545812297684]": { + "Id": "Entity_[3545812297684]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3550107264980]": { + "Id": "Entity_[3550107264980]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3554402232276]": { + "Id": "Entity_[3554402232276]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3558697199572]": { + "Id": "Entity_[3558697199572]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3562992166868]": { + "Id": "Entity_[3562992166868]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3567287134164]": { + "Id": "Entity_[3567287134164]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3571582101460]": { + "Id": "Entity_[3571582101460]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3575877068756]": { + "Id": "Entity_[3575877068756]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3580172036052]": { + "Id": "Entity_[3580172036052]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3584467003348]": { + "Id": "Entity_[3584467003348]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E23FC75B-4142-55F1-B9AE-884826E7EB23}" + }, + "assetHint": "materials/presets/pbr/metal_platinum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3588761970644]": { + "Id": "Entity_[3588761970644]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3593056937940]": { + "Id": "Entity_[3593056937940]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3597351905236]": { + "Id": "Entity_[3597351905236]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3601646872532]": { + "Id": "Entity_[3601646872532]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3605941839828]": { + "Id": "Entity_[3605941839828]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3610236807124]": { + "Id": "Entity_[3610236807124]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3614531774420]": { + "Id": "Entity_[3614531774420]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CDA13277-5EAB-5E2A-93F5-B7003597FBCE}" + }, + "assetHint": "materials/presets/pbr/metal_silver.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3618826741716]": { + "Id": "Entity_[3618826741716]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3623121709012]": { + "Id": "Entity_[3623121709012]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E54E46E7-9FA3-54D7-B5F8-8DCCDF17BC24}" + }, + "assetHint": "materials/presets/pbr/metal_silver_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3627416676308]": { + "Id": "Entity_[3627416676308]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3631711643604]": { + "Id": "Entity_[3631711643604]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3636006610900]": { + "Id": "Entity_[3636006610900]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2AC06FA3-7670-542E-8996-DF346AFF1B61}" + }, + "assetHint": "materials/presets/pbr/metal_silver_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3640301578196]": { + "Id": "Entity_[3640301578196]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3644596545492]": { + "Id": "Entity_[3644596545492]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3648891512788]": { + "Id": "Entity_[3648891512788]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3653186480084]": { + "Id": "Entity_[3653186480084]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3657481447380]": { + "Id": "Entity_[3657481447380]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3661776414676]": { + "Id": "Entity_[3661776414676]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3666071381972]": { + "Id": "Entity_[3666071381972]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3670366349268]": { + "Id": "Entity_[3670366349268]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E56377B1-6310-5311-A494-135BE50B74F0}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3674661316564]": { + "Id": "Entity_[3674661316564]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3678956283860]": { + "Id": "Entity_[3678956283860]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3683251251156]": { + "Id": "Entity_[3683251251156]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3687546218452]": { + "Id": "Entity_[3687546218452]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3691841185748]": { + "Id": "Entity_[3691841185748]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{9187B84B-425F-5D11-B4D7-35BBDB0959D1}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3696136153044]": { + "Id": "Entity_[3696136153044]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3700431120340]": { + "Id": "Entity_[3700431120340]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3704726087636]": { + "Id": "Entity_[3704726087636]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3709021054932]": { + "Id": "Entity_[3709021054932]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3713316022228]": { + "Id": "Entity_[3713316022228]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3717610989524]": { + "Id": "Entity_[3717610989524]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E66E4343-F45A-536D-AAE1-C4D096420640}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3721905956820]": { + "Id": "Entity_[3721905956820]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3726200924116]": { + "Id": "Entity_[3726200924116]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3730495891412]": { + "Id": "Entity_[3730495891412]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3734790858708]": { + "Id": "Entity_[3734790858708]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E66E4343-F45A-536D-AAE1-C4D096420640}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3739085826004]": { + "Id": "Entity_[3739085826004]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3743380793300]": { + "Id": "Entity_[3743380793300]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3747675760596]": { + "Id": "Entity_[3747675760596]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3751970727892]": { + "Id": "Entity_[3751970727892]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DC0598ED-1EDD-5B37-892E-E0867621D74C}" + }, + "assetHint": "materials/presets/pbr/metal_palladium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3756265695188]": { + "Id": "Entity_[3756265695188]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3760560662484]": { + "Id": "Entity_[3760560662484]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{79419183-FFCE-5A89-AA16-C2789D81AF75}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3764855629780]": { + "Id": "Entity_[3764855629780]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3769150597076]": { + "Id": "Entity_[3769150597076]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CDA13277-5EAB-5E2A-93F5-B7003597FBCE}" + }, + "assetHint": "materials/presets/pbr/metal_silver.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3773445564372]": { + "Id": "Entity_[3773445564372]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3777740531668]": { + "Id": "Entity_[3777740531668]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3782035498964]": { + "Id": "Entity_[3782035498964]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3786330466260]": { + "Id": "Entity_[3786330466260]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3790625433556]": { + "Id": "Entity_[3790625433556]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3794920400852]": { + "Id": "Entity_[3794920400852]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DD1E26AE-80FB-5DB6-8786-26D438190A38}" + }, + "assetHint": "materials/presets/pbr/metal_nickel.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3799215368148]": { + "Id": "Entity_[3799215368148]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3803510335444]": { + "Id": "Entity_[3803510335444]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2AC06FA3-7670-542E-8996-DF346AFF1B61}" + }, + "assetHint": "materials/presets/pbr/metal_silver_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3807805302740]": { + "Id": "Entity_[3807805302740]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3812100270036]": { + "Id": "Entity_[3812100270036]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3816395237332]": { + "Id": "Entity_[3816395237332]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + 0.010651908814907074, + 9.51578426361084 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3820690204628]": { + "Id": "Entity_[3820690204628]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3824985171924]": { + "Id": "Entity_[3824985171924]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3829280139220]": { + "Id": "Entity_[3829280139220]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E23FC75B-4142-55F1-B9AE-884826E7EB23}" + }, + "assetHint": "materials/presets/pbr/metal_platinum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3833575106516]": { + "Id": "Entity_[3833575106516]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3837870073812]": { + "Id": "Entity_[3837870073812]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3842165041108]": { + "Id": "Entity_[3842165041108]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3846460008404]": { + "Id": "Entity_[3846460008404]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3850754975700]": { + "Id": "Entity_[3850754975700]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3855049942996]": { + "Id": "Entity_[3855049942996]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3859344910292]": { + "Id": "Entity_[3859344910292]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3863639877588]": { + "Id": "Entity_[3863639877588]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{9187B84B-425F-5D11-B4D7-35BBDB0959D1}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3867934844884]": { + "Id": "Entity_[3867934844884]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3872229812180]": { + "Id": "Entity_[3872229812180]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E23FC75B-4142-55F1-B9AE-884826E7EB23}" + }, + "assetHint": "materials/presets/pbr/metal_platinum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3876524779476]": { + "Id": "Entity_[3876524779476]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3880819746772]": { + "Id": "Entity_[3880819746772]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3885114714068]": { + "Id": "Entity_[3885114714068]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3889409681364]": { + "Id": "Entity_[3889409681364]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DC0598ED-1EDD-5B37-892E-E0867621D74C}" + }, + "assetHint": "materials/presets/pbr/metal_palladium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3893704648660]": { + "Id": "Entity_[3893704648660]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3897999615956]": { + "Id": "Entity_[3897999615956]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3902294583252]": { + "Id": "Entity_[3902294583252]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3906589550548]": { + "Id": "Entity_[3906589550548]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{60D4CA04-A2FE-5AE7-B472-694C38D05183}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3910884517844]": { + "Id": "Entity_[3910884517844]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{3F0DF0C4-5F23-5EB1-B762-7344AFFDC011}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3915179485140]": { + "Id": "Entity_[3915179485140]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CDA13277-5EAB-5E2A-93F5-B7003597FBCE}" + }, + "assetHint": "materials/presets/pbr/metal_silver.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3919474452436]": { + "Id": "Entity_[3919474452436]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3923769419732]": { + "Id": "Entity_[3923769419732]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3928064387028]": { + "Id": "Entity_[3928064387028]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3932359354324]": { + "Id": "Entity_[3932359354324]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DD1E26AE-80FB-5DB6-8786-26D438190A38}" + }, + "assetHint": "materials/presets/pbr/metal_nickel.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3936654321620]": { + "Id": "Entity_[3936654321620]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3940949288916]": { + "Id": "Entity_[3940949288916]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3945244256212]": { + "Id": "Entity_[3945244256212]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3949539223508]": { + "Id": "Entity_[3949539223508]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + 0.010651908814907074, + 24.573455810546875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3953834190804]": { + "Id": "Entity_[3953834190804]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3958129158100]": { + "Id": "Entity_[3958129158100]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3962424125396]": { + "Id": "Entity_[3962424125396]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3966719092692]": { + "Id": "Entity_[3966719092692]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3971014059988]": { + "Id": "Entity_[3971014059988]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3975309027284]": { + "Id": "Entity_[3975309027284]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3979603994580]": { + "Id": "Entity_[3979603994580]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{3F0DF0C4-5F23-5EB1-B762-7344AFFDC011}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3983898961876]": { + "Id": "Entity_[3983898961876]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{79419183-FFCE-5A89-AA16-C2789D81AF75}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3988193929172]": { + "Id": "Entity_[3988193929172]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3992488896468]": { + "Id": "Entity_[3992488896468]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E56377B1-6310-5311-A494-135BE50B74F0}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[3996783863764]": { + "Id": "Entity_[3996783863764]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4001078831060]": { + "Id": "Entity_[4001078831060]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4005373798356]": { + "Id": "Entity_[4005373798356]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4009668765652]": { + "Id": "Entity_[4009668765652]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4013963732948]": { + "Id": "Entity_[4013963732948]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4018258700244]": { + "Id": "Entity_[4018258700244]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4022553667540]": { + "Id": "Entity_[4022553667540]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{60D4CA04-A2FE-5AE7-B472-694C38D05183}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4026848634836]": { + "Id": "Entity_[4026848634836]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4031143602132]": { + "Id": "Entity_[4031143602132]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E54E46E7-9FA3-54D7-B5F8-8DCCDF17BC24}" + }, + "assetHint": "materials/presets/pbr/metal_silver_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4035438569428]": { + "Id": "Entity_[4035438569428]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4039733536724]": { + "Id": "Entity_[4039733536724]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4044028504020]": { + "Id": "Entity_[4044028504020]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4048323471316]": { + "Id": "Entity_[4048323471316]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4052618438612]": { + "Id": "Entity_[4052618438612]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4056913405908]": { + "Id": "Entity_[4056913405908]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4061208373204]": { + "Id": "Entity_[4061208373204]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E66E4343-F45A-536D-AAE1-C4D096420640}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4065503340500]": { + "Id": "Entity_[4065503340500]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E54E46E7-9FA3-54D7-B5F8-8DCCDF17BC24}" + }, + "assetHint": "materials/presets/pbr/metal_silver_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4069798307796]": { + "Id": "Entity_[4069798307796]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4074093275092]": { + "Id": "Entity_[4074093275092]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4078388242388]": { + "Id": "Entity_[4078388242388]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + 0.010651908814907074, + 39.60029602050781 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4082683209684]": { + "Id": "Entity_[4082683209684]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E23FC75B-4142-55F1-B9AE-884826E7EB23}" + }, + "assetHint": "materials/presets/pbr/metal_platinum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4086978176980]": { + "Id": "Entity_[4086978176980]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4091273144276]": { + "Id": "Entity_[4091273144276]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + 0.010651908814907074, + 39.60029602050781 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4095568111572]": { + "Id": "Entity_[4095568111572]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4099863078868]": { + "Id": "Entity_[4099863078868]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4104158046164]": { + "Id": "Entity_[4104158046164]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4108453013460]": { + "Id": "Entity_[4108453013460]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + 0.010651908814907074, + 84.44650268554688 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4112747980756]": { + "Id": "Entity_[4112747980756]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4117042948052]": { + "Id": "Entity_[4117042948052]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2AC06FA3-7670-542E-8996-DF346AFF1B61}" + }, + "assetHint": "materials/presets/pbr/metal_silver_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4121337915348]": { + "Id": "Entity_[4121337915348]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4125632882644]": { + "Id": "Entity_[4125632882644]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4129927849940]": { + "Id": "Entity_[4129927849940]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4134222817236]": { + "Id": "Entity_[4134222817236]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4138517784532]": { + "Id": "Entity_[4138517784532]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4142812751828]": { + "Id": "Entity_[4142812751828]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4147107719124]": { + "Id": "Entity_[4147107719124]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4151402686420]": { + "Id": "Entity_[4151402686420]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4155697653716]": { + "Id": "Entity_[4155697653716]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4159992621012]": { + "Id": "Entity_[4159992621012]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{60D4CA04-A2FE-5AE7-B472-694C38D05183}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4164287588308]": { + "Id": "Entity_[4164287588308]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4168582555604]": { + "Id": "Entity_[4168582555604]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4172877522900]": { + "Id": "Entity_[4172877522900]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4177172490196]": { + "Id": "Entity_[4177172490196]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{3F0DF0C4-5F23-5EB1-B762-7344AFFDC011}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4181467457492]": { + "Id": "Entity_[4181467457492]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4185762424788]": { + "Id": "Entity_[4185762424788]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4190057392084]": { + "Id": "Entity_[4190057392084]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4194352359380]": { + "Id": "Entity_[4194352359380]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4198647326676]": { + "Id": "Entity_[4198647326676]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4202942293972]": { + "Id": "Entity_[4202942293972]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4207237261268]": { + "Id": "Entity_[4207237261268]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{3F0DF0C4-5F23-5EB1-B762-7344AFFDC011}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4211532228564]": { + "Id": "Entity_[4211532228564]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4215827195860]": { + "Id": "Entity_[4215827195860]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{60D4CA04-A2FE-5AE7-B472-694C38D05183}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4220122163156]": { + "Id": "Entity_[4220122163156]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{9187B84B-425F-5D11-B4D7-35BBDB0959D1}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4224417130452]": { + "Id": "Entity_[4224417130452]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{D0E9960A-4B31-5136-BAC6-5482B203D3B4}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4228712097748]": { + "Id": "Entity_[4228712097748]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4233007065044]": { + "Id": "Entity_[4233007065044]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4237302032340]": { + "Id": "Entity_[4237302032340]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4241596999636]": { + "Id": "Entity_[4241596999636]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4245891966932]": { + "Id": "Entity_[4245891966932]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4250186934228]": { + "Id": "Entity_[4250186934228]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{9187B84B-425F-5D11-B4D7-35BBDB0959D1}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4254481901524]": { + "Id": "Entity_[4254481901524]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DC0598ED-1EDD-5B37-892E-E0867621D74C}" + }, + "assetHint": "materials/presets/pbr/metal_palladium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4258776868820]": { + "Id": "Entity_[4258776868820]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4263071836116]": { + "Id": "Entity_[4263071836116]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4267366803412]": { + "Id": "Entity_[4267366803412]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4271661770708]": { + "Id": "Entity_[4271661770708]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4275956738004]": { + "Id": "Entity_[4275956738004]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DD1E26AE-80FB-5DB6-8786-26D438190A38}" + }, + "assetHint": "materials/presets/pbr/metal_nickel.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4280251705300]": { + "Id": "Entity_[4280251705300]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4284546672596]": { + "Id": "Entity_[4284546672596]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4288841639892]": { + "Id": "Entity_[4288841639892]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{60D4CA04-A2FE-5AE7-B472-694C38D05183}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4293136607188]": { + "Id": "Entity_[4293136607188]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4297431574484]": { + "Id": "Entity_[4297431574484]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4301726541780]": { + "Id": "Entity_[4301726541780]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4306021509076]": { + "Id": "Entity_[4306021509076]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4310316476372]": { + "Id": "Entity_[4310316476372]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4314611443668]": { + "Id": "Entity_[4314611443668]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4318906410964]": { + "Id": "Entity_[4318906410964]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4323201378260]": { + "Id": "Entity_[4323201378260]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4327496345556]": { + "Id": "Entity_[4327496345556]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4331791312852]": { + "Id": "Entity_[4331791312852]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4336086280148]": { + "Id": "Entity_[4336086280148]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E66E4343-F45A-536D-AAE1-C4D096420640}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4340381247444]": { + "Id": "Entity_[4340381247444]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4344676214740]": { + "Id": "Entity_[4344676214740]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4348971182036]": { + "Id": "Entity_[4348971182036]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4353266149332]": { + "Id": "Entity_[4353266149332]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4357561116628]": { + "Id": "Entity_[4357561116628]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2AC06FA3-7670-542E-8996-DF346AFF1B61}" + }, + "assetHint": "materials/presets/pbr/metal_silver_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4361856083924]": { + "Id": "Entity_[4361856083924]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A3F3CD98-1634-5542-AD5A-78E91BE21AE9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4366151051220]": { + "Id": "Entity_[4366151051220]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DC0598ED-1EDD-5B37-892E-E0867621D74C}" + }, + "assetHint": "materials/presets/pbr/metal_palladium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4370446018516]": { + "Id": "Entity_[4370446018516]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4374740985812]": { + "Id": "Entity_[4374740985812]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4379035953108]": { + "Id": "Entity_[4379035953108]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4383330920404]": { + "Id": "Entity_[4383330920404]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4387625887700]": { + "Id": "Entity_[4387625887700]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4391920854996]": { + "Id": "Entity_[4391920854996]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CDA13277-5EAB-5E2A-93F5-B7003597FBCE}" + }, + "assetHint": "materials/presets/pbr/metal_silver.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4396215822292]": { + "Id": "Entity_[4396215822292]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A3F3CD98-1634-5542-AD5A-78E91BE21AE9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4400510789588]": { + "Id": "Entity_[4400510789588]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4404805756884]": { + "Id": "Entity_[4404805756884]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4409100724180]": { + "Id": "Entity_[4409100724180]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4413395691476]": { + "Id": "Entity_[4413395691476]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4417690658772]": { + "Id": "Entity_[4417690658772]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4421985626068]": { + "Id": "Entity_[4421985626068]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4426280593364]": { + "Id": "Entity_[4426280593364]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{9187B84B-425F-5D11-B4D7-35BBDB0959D1}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4430575560660]": { + "Id": "Entity_[4430575560660]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4434870527956]": { + "Id": "Entity_[4434870527956]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4439165495252]": { + "Id": "Entity_[4439165495252]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4443460462548]": { + "Id": "Entity_[4443460462548]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4447755429844]": { + "Id": "Entity_[4447755429844]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DC0598ED-1EDD-5B37-892E-E0867621D74C}" + }, + "assetHint": "materials/presets/pbr/metal_palladium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4452050397140]": { + "Id": "Entity_[4452050397140]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4456345364436]": { + "Id": "Entity_[4456345364436]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4460640331732]": { + "Id": "Entity_[4460640331732]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4464935299028]": { + "Id": "Entity_[4464935299028]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4469230266324]": { + "Id": "Entity_[4469230266324]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4473525233620]": { + "Id": "Entity_[4473525233620]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4477820200916]": { + "Id": "Entity_[4477820200916]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4482115168212]": { + "Id": "Entity_[4482115168212]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4486410135508]": { + "Id": "Entity_[4486410135508]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4490705102804]": { + "Id": "Entity_[4490705102804]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4495000070100]": { + "Id": "Entity_[4495000070100]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4499295037396]": { + "Id": "Entity_[4499295037396]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E54E46E7-9FA3-54D7-B5F8-8DCCDF17BC24}" + }, + "assetHint": "materials/presets/pbr/metal_silver_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4503590004692]": { + "Id": "Entity_[4503590004692]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CDA13277-5EAB-5E2A-93F5-B7003597FBCE}" + }, + "assetHint": "materials/presets/pbr/metal_silver.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4507884971988]": { + "Id": "Entity_[4507884971988]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4512179939284]": { + "Id": "Entity_[4512179939284]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4516474906580]": { + "Id": "Entity_[4516474906580]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4520769873876]": { + "Id": "Entity_[4520769873876]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4525064841172]": { + "Id": "Entity_[4525064841172]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E23FC75B-4142-55F1-B9AE-884826E7EB23}" + }, + "assetHint": "materials/presets/pbr/metal_platinum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4529359808468]": { + "Id": "Entity_[4529359808468]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{3F0DF0C4-5F23-5EB1-B762-7344AFFDC011}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4533654775764]": { + "Id": "Entity_[4533654775764]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4537949743060]": { + "Id": "Entity_[4537949743060]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4542244710356]": { + "Id": "Entity_[4542244710356]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4546539677652]": { + "Id": "Entity_[4546539677652]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4550834644948]": { + "Id": "Entity_[4550834644948]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4555129612244]": { + "Id": "Entity_[4555129612244]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4559424579540]": { + "Id": "Entity_[4559424579540]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4563719546836]": { + "Id": "Entity_[4563719546836]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4568014514132]": { + "Id": "Entity_[4568014514132]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4572309481428]": { + "Id": "Entity_[4572309481428]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DD1E26AE-80FB-5DB6-8786-26D438190A38}" + }, + "assetHint": "materials/presets/pbr/metal_nickel.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4576604448724]": { + "Id": "Entity_[4576604448724]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4580899416020]": { + "Id": "Entity_[4580899416020]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{D0E9960A-4B31-5136-BAC6-5482B203D3B4}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4585194383316]": { + "Id": "Entity_[4585194383316]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4589489350612]": { + "Id": "Entity_[4589489350612]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4593784317908]": { + "Id": "Entity_[4593784317908]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[4598079285204]": { + "Id": "Entity_[4598079285204]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[479205648340]": { + "Id": "Entity_[479205648340]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{D0E9960A-4B31-5136-BAC6-5482B203D3B4}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[483500615636]": { + "Id": "Entity_[483500615636]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DC0598ED-1EDD-5B37-892E-E0867621D74C}" + }, + "assetHint": "materials/presets/pbr/metal_palladium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[487795582932]": { + "Id": "Entity_[487795582932]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[492090550228]": { + "Id": "Entity_[492090550228]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[496385517524]": { + "Id": "Entity_[496385517524]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[500680484820]": { + "Id": "Entity_[500680484820]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{D0E9960A-4B31-5136-BAC6-5482B203D3B4}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[504975452116]": { + "Id": "Entity_[504975452116]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[509270419412]": { + "Id": "Entity_[509270419412]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{D0E9960A-4B31-5136-BAC6-5482B203D3B4}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[513565386708]": { + "Id": "Entity_[513565386708]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{5BC13D95-377E-53EA-9A93-156384BE8B04}" + }, + "assetHint": "materials/presets/pbr/metal_gold_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[517860354004]": { + "Id": "Entity_[517860354004]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[522155321300]": { + "Id": "Entity_[522155321300]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E23FC75B-4142-55F1-B9AE-884826E7EB23}" + }, + "assetHint": "materials/presets/pbr/metal_platinum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[526450288596]": { + "Id": "Entity_[526450288596]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[530745255892]": { + "Id": "Entity_[530745255892]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DD1E26AE-80FB-5DB6-8786-26D438190A38}" + }, + "assetHint": "materials/presets/pbr/metal_nickel.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[535040223188]": { + "Id": "Entity_[535040223188]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[539335190484]": { + "Id": "Entity_[539335190484]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[543630157780]": { + "Id": "Entity_[543630157780]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[547925125076]": { + "Id": "Entity_[547925125076]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[552220092372]": { + "Id": "Entity_[552220092372]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[556515059668]": { + "Id": "Entity_[556515059668]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[560810026964]": { + "Id": "Entity_[560810026964]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A3F3CD98-1634-5542-AD5A-78E91BE21AE9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[565104994260]": { + "Id": "Entity_[565104994260]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[569399961556]": { + "Id": "Entity_[569399961556]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[573694928852]": { + "Id": "Entity_[573694928852]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[577989896148]": { + "Id": "Entity_[577989896148]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DC0598ED-1EDD-5B37-892E-E0867621D74C}" + }, + "assetHint": "materials/presets/pbr/metal_palladium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[582284863444]": { + "Id": "Entity_[582284863444]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[586579830740]": { + "Id": "Entity_[586579830740]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[590874798036]": { + "Id": "Entity_[590874798036]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A3F3CD98-1634-5542-AD5A-78E91BE21AE9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[595169765332]": { + "Id": "Entity_[595169765332]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[599464732628]": { + "Id": "Entity_[599464732628]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[603759699924]": { + "Id": "Entity_[603759699924]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[608054667220]": { + "Id": "Entity_[608054667220]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DC0598ED-1EDD-5B37-892E-E0867621D74C}" + }, + "assetHint": "materials/presets/pbr/metal_palladium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[612349634516]": { + "Id": "Entity_[612349634516]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{60D4CA04-A2FE-5AE7-B472-694C38D05183}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[616644601812]": { + "Id": "Entity_[616644601812]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[620939569108]": { + "Id": "Entity_[620939569108]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[625234536404]": { + "Id": "Entity_[625234536404]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[629529503700]": { + "Id": "Entity_[629529503700]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[633824470996]": { + "Id": "Entity_[633824470996]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[638119438292]": { + "Id": "Entity_[638119438292]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[642414405588]": { + "Id": "Entity_[642414405588]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[646709372884]": { + "Id": "Entity_[646709372884]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[651004340180]": { + "Id": "Entity_[651004340180]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[655299307476]": { + "Id": "Entity_[655299307476]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[659594274772]": { + "Id": "Entity_[659594274772]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{60D4CA04-A2FE-5AE7-B472-694C38D05183}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[663889242068]": { + "Id": "Entity_[663889242068]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[668184209364]": { + "Id": "Entity_[668184209364]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[672479176660]": { + "Id": "Entity_[672479176660]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[676774143956]": { + "Id": "Entity_[676774143956]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[681069111252]": { + "Id": "Entity_[681069111252]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[685364078548]": { + "Id": "Entity_[685364078548]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DD1E26AE-80FB-5DB6-8786-26D438190A38}" + }, + "assetHint": "materials/presets/pbr/metal_nickel.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[689659045844]": { + "Id": "Entity_[689659045844]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[693954013140]": { + "Id": "Entity_[693954013140]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + 0.010651908814907074, + 9.51578426361084 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[698248980436]": { + "Id": "Entity_[698248980436]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[702543947732]": { + "Id": "Entity_[702543947732]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E54E46E7-9FA3-54D7-B5F8-8DCCDF17BC24}" + }, + "assetHint": "materials/presets/pbr/metal_silver_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[706838915028]": { + "Id": "Entity_[706838915028]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 74.93071746826172 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[711133882324]": { + "Id": "Entity_[711133882324]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[715428849620]": { + "Id": "Entity_[715428849620]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[719723816916]": { + "Id": "Entity_[719723816916]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[724018784212]": { + "Id": "Entity_[724018784212]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{D0E9960A-4B31-5136-BAC6-5482B203D3B4}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[728313751508]": { + "Id": "Entity_[728313751508]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E54E46E7-9FA3-54D7-B5F8-8DCCDF17BC24}" + }, + "assetHint": "materials/presets/pbr/metal_silver_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[732608718804]": { + "Id": "Entity_[732608718804]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[736903686100]": { + "Id": "Entity_[736903686100]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[741198653396]": { + "Id": "Entity_[741198653396]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A3F3CD98-1634-5542-AD5A-78E91BE21AE9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[745493620692]": { + "Id": "Entity_[745493620692]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[749788587988]": { + "Id": "Entity_[749788587988]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[754083555284]": { + "Id": "Entity_[754083555284]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[758378522580]": { + "Id": "Entity_[758378522580]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[762673489876]": { + "Id": "Entity_[762673489876]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[766968457172]": { + "Id": "Entity_[766968457172]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[771263424468]": { + "Id": "Entity_[771263424468]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[775558391764]": { + "Id": "Entity_[775558391764]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[779853359060]": { + "Id": "Entity_[779853359060]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[784148326356]": { + "Id": "Entity_[784148326356]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[788443293652]": { + "Id": "Entity_[788443293652]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[792738260948]": { + "Id": "Entity_[792738260948]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 39.56034851074219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[797033228244]": { + "Id": "Entity_[797033228244]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + 0.010651908814907074, + 114.53101348876953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[801328195540]": { + "Id": "Entity_[801328195540]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 22.53014373779297, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[805623162836]": { + "Id": "Entity_[805623162836]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2AC06FA3-7670-542E-8996-DF346AFF1B61}" + }, + "assetHint": "materials/presets/pbr/metal_silver_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[809918130132]": { + "Id": "Entity_[809918130132]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[814213097428]": { + "Id": "Entity_[814213097428]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{60D4CA04-A2FE-5AE7-B472-694C38D05183}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[818508064724]": { + "Id": "Entity_[818508064724]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2AC06FA3-7670-542E-8996-DF346AFF1B61}" + }, + "assetHint": "materials/presets/pbr/metal_silver_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[822803032020]": { + "Id": "Entity_[822803032020]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -42.53056335449219, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{AE350D9F-0000-526D-B49C-4303D687BB86}" + }, + "assetHint": "materials/presets/pbr/metal_brass_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[827097999316]": { + "Id": "Entity_[827097999316]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[831392966612]": { + "Id": "Entity_[831392966612]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[835687933908]": { + "Id": "Entity_[835687933908]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 79.38228607177734 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[839982901204]": { + "Id": "Entity_[839982901204]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{3F0DF0C4-5F23-5EB1-B762-7344AFFDC011}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 45.14218521118164 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[844277868500]": { + "Id": "Entity_[844277868500]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 84.40655517578125 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[848572835796]": { + "Id": "Entity_[848572835796]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[852867803092]": { + "Id": "Entity_[852867803092]", + "Name": "Entity1", + "Components": { + "Component_[1057179753323467068]": { + "$type": "EditorMaterialComponent", + "Id": 1057179753323467068, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{3F0DF0C4-5F23-5EB1-B762-7344AFFDC011}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 1057179753323467068, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 12.530143737792969, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[857162770388]": { + "Id": "Entity_[857162770388]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[861457737684]": { + "Id": "Entity_[861457737684]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 2.5301437377929688, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{79419183-FFCE-5A89-AA16-C2789D81AF75}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[865752704980]": { + "Id": "Entity_[865752704980]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[870047672276]": { + "Id": "Entity_[870047672276]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -37.53056335449219, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[874342639572]": { + "Id": "Entity_[874342639572]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 4.451573371887207 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[878637606868]": { + "Id": "Entity_[878637606868]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 89.95755767822266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E66E4343-F45A-536D-AAE1-C4D096420640}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[882932574164]": { + "Id": "Entity_[882932574164]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{94CF2BD7-7D09-5577-B1D8-3FF85B15E127}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[887227541460]": { + "Id": "Entity_[887227541460]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 69.34888458251953 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[891522508756]": { + "Id": "Entity_[891522508756]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 0.0 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E66E4343-F45A-536D-AAE1-C4D096420640}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[895817476052]": { + "Id": "Entity_[895817476052]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[900112443348]": { + "Id": "Entity_[900112443348]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 34.53608703613281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[904407410644]": { + "Id": "Entity_[904407410644]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{C60A39AF-BB76-51BD-9468-A88C9A6F78D7}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[908702377940]": { + "Id": "Entity_[908702377940]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[912997345236]": { + "Id": "Entity_[912997345236]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[917292312532]": { + "Id": "Entity_[917292312532]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 94.40913391113281 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[921587279828]": { + "Id": "Entity_[921587279828]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -27.530563354492188, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[925882247124]": { + "Id": "Entity_[925882247124]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 17.53014373779297, + -0.00018183141946792603, + 15.057670593261719 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": {}, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{721188E0-B7CC-5D06-8D5D-39AF8ABF2EF9}" + }, + "assetHint": "materials/presets/pbr/metal_titanium.azmaterial" + } + } + }, + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[930177214420]": { + "Id": "Entity_[930177214420]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -7.5305633544921875, + -0.00018183141946792603, + 9.475835800170898 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{DD1E26AE-80FB-5DB6-8786-26D438190A38}" + }, + "assetHint": "materials/presets/pbr/metal_nickel.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[934472181716]": { + "Id": "Entity_[934472181716]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 47.53014373779297, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[938767149012]": { + "Id": "Entity_[938767149012]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 32.53014373779297, + -0.00018183141946792603, + 24.533506393432617 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[943062116308]": { + "Id": "Entity_[943062116308]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -22.530563354492188, + -0.00018183141946792603, + 30.08451271057129 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[947357083604]": { + "Id": "Entity_[947357083604]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 7.530143737792969, + -0.00018183141946792603, + 105.0152359008789 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2AC06FA3-7670-542E-8996-DF346AFF1B61}" + }, + "assetHint": "materials/presets/pbr/metal_silver_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[951652050900]": { + "Id": "Entity_[951652050900]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -32.53056335449219, + -0.00018183141946792603, + 114.4910659790039 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{99976D73-6248-5D66-AD15-E8F52B0AFE36}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[955947018196]": { + "Id": "Entity_[955947018196]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{970148AC-7258-5EC8-9CE7-F4EF93164D93}" + }, + "assetHint": "materials/presets/pbr/metal_iron_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[960241985492]": { + "Id": "Entity_[960241985492]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[964536952788]": { + "Id": "Entity_[964536952788]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -2.5305633544921875, + -0.00018183141946792603, + 19.50924301147461 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{9187B84B-425F-5D11-B4D7-35BBDB0959D1}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[968831920084]": { + "Id": "Entity_[968831920084]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 27.53014373779297, + -0.00018183141946792603, + 64.32462310791016 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[973126887380]": { + "Id": "Entity_[973126887380]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + -0.00018183141946792603, + 109.46680450439453 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2D054071-BEF7-53C0-A8C9-E4F026BD8364}" + }, + "assetHint": "materials/presets/pbr/metal_copper_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[977421854676]": { + "Id": "Entity_[977421854676]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + 0.010651908814907074, + 69.38883209228516 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[981716821972]": { + "Id": "Entity_[981716821972]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 42.53014373779297, + -0.00018183141946792603, + 99.43339538574219 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FE52E7C8-064D-506A-9C26-433EB93747DE}" + }, + "assetHint": "materials/presets/pbr/metal_gold.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[986011789268]": { + "Id": "Entity_[986011789268]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 37.53014373779297, + 0.010651908814907074, + 99.47334289550781 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E621C5BF-B8E1-55F0-A791-EC960F2FA46F}" + }, + "assetHint": "materials/presets/pbr/metal_copper.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[990306756564]": { + "Id": "Entity_[990306756564]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -47.53056335449219, + -0.00018183141946792603, + 49.593753814697266 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{549D26B8-881D-569F-AF05-961F36A43F4F}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_matte.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[994601723860]": { + "Id": "Entity_[994601723860]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -17.530563354492188, + -0.00018183141946792603, + 54.618019104003906 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{892EA944-0325-5FA6-94D7-4AB4FC02A0F5}" + }, + "assetHint": "materials/presets/pbr/metal_iron.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + }, + "Entity_[998896691156]": { + "Id": "Entity_[998896691156]", + "Name": "Entity1", + "Components": { + "Component_[11525365929370623807]": { + "$type": "EditorVisibilityComponent", + "Id": 11525365929370623807 + }, + "Component_[12334620273692642550]": { + "$type": "EditorLockComponent", + "Id": 12334620273692642550 + }, + "Component_[14389735759337977675]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14389735759337977675 + }, + "Component_[16184381538555246534]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 16184381538555246534, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + }, + "Component_[17962478023087084794]": { + "$type": "SelectionComponent", + "Id": 17962478023087084794 + }, + "Component_[18071675051915092508]": { + "$type": "EditorEntityIconComponent", + "Id": 18071675051915092508 + }, + "Component_[2115498007879087044]": { + "$type": "EditorInspectorComponent", + "Id": 2115498007879087044, + "ComponentOrderEntryArray": [ + { + "ComponentId": 399415038452606756 + }, + { + "ComponentId": 16184381538555246534, + "SortIndex": 1 + }, + { + "ComponentId": 7827190074535394331, + "SortIndex": 2 + } + ] + }, + "Component_[3518973002096080237]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3518973002096080237 + }, + "Component_[399415038452606756]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 399415038452606756, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -12.530563354492188, + -0.00018183141946792603, + 59.873046875 + ] + } + }, + "Component_[4564240319609068082]": { + "$type": "EditorEntitySortComponent", + "Id": 4564240319609068082 + }, + "Component_[7827190074535394331]": { + "$type": "EditorMaterialComponent", + "Id": 7827190074535394331, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[8092226976542590265]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8092226976542590265 + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Prefabs/TestData/Graphics/CubeAluminumPolishedPBR.prefab b/AutomatedTesting/Prefabs/TestData/Graphics/CubeAluminumPolishedPBR.prefab new file mode 100644 index 0000000000..afec89bcc0 --- /dev/null +++ b/AutomatedTesting/Prefabs/TestData/Graphics/CubeAluminumPolishedPBR.prefab @@ -0,0 +1,156 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "CubeAluminumPolishedPBR", + "Components": { + "Component_[1006636009791072742]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 1006636009791072742, + "Parent Entity": "" + }, + "Component_[1076262440422199293]": { + "$type": "EditorEntitySortComponent", + "Id": 1076262440422199293, + "Child Entity Order": [ + "Entity_[1040185651401]" + ] + }, + "Component_[10918235158079012184]": { + "$type": "EditorEntityIconComponent", + "Id": 10918235158079012184 + }, + "Component_[14325323304581185195]": { + "$type": "EditorOnlyEntityComponent", + "Id": 14325323304581185195 + }, + "Component_[15952647410502679667]": { + "$type": "EditorPendingCompositionComponent", + "Id": 15952647410502679667 + }, + "Component_[1646402264018781142]": { + "$type": "EditorVisibilityComponent", + "Id": 1646402264018781142 + }, + "Component_[2017972571432187012]": { + "$type": "EditorInspectorComponent", + "Id": 2017972571432187012 + }, + "Component_[478000835478069459]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 478000835478069459 + }, + "Component_[7132130710158542124]": { + "$type": "EditorPrefabComponent", + "Id": 7132130710158542124 + }, + "Component_[7457311619910333402]": { + "$type": "SelectionComponent", + "Id": 7457311619910333402 + }, + "Component_[8761313808145525748]": { + "$type": "EditorLockComponent", + "Id": 8761313808145525748 + } + } + }, + "Entities": { + "Entity_[1040185651401]": { + "Id": "Entity_[1040185651401]", + "Name": "Entity1", + "Components": { + "Component_[11024839750215572075]": { + "$type": "SelectionComponent", + "Id": 11024839750215572075 + }, + "Component_[11384176886283708819]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11384176886283708819, + "Parent Entity": "ContainerEntity" + }, + "Component_[1606410272595503925]": { + "$type": "EditorMaterialComponent", + "Id": 1606410272595503925, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{64C1F6A6-6BDA-551A-BE56-1829E5913278}" + }, + "assetHint": "materials/presets/pbr/metal_aluminum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[16470114336751653654]": { + "$type": "EditorInspectorComponent", + "Id": 16470114336751653654, + "ComponentOrderEntryArray": [ + { + "ComponentId": 11384176886283708819 + }, + { + "ComponentId": 89717634602996901, + "SortIndex": 1 + }, + { + "ComponentId": 1606410272595503925, + "SortIndex": 2 + } + ] + }, + "Component_[4303036201889516060]": { + "$type": "EditorLockComponent", + "Id": 4303036201889516060 + }, + "Component_[44336138790150350]": { + "$type": "EditorEntitySortComponent", + "Id": 44336138790150350 + }, + "Component_[4558973254917759795]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 4558973254917759795 + }, + "Component_[4674030476408790307]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4674030476408790307 + }, + "Component_[4802851695039968062]": { + "$type": "EditorVisibilityComponent", + "Id": 4802851695039968062 + }, + "Component_[5821006029055754615]": { + "$type": "EditorOnlyEntityComponent", + "Id": 5821006029055754615 + }, + "Component_[8587156575497792590]": { + "$type": "EditorEntityIconComponent", + "Id": 8587156575497792590 + }, + "Component_[89717634602996901]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 89717634602996901, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Prefabs/TestData/Graphics/CubeBrassPolishedPBR.prefab b/AutomatedTesting/Prefabs/TestData/Graphics/CubeBrassPolishedPBR.prefab new file mode 100644 index 0000000000..beca9c9dba --- /dev/null +++ b/AutomatedTesting/Prefabs/TestData/Graphics/CubeBrassPolishedPBR.prefab @@ -0,0 +1,156 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "CubeBrassPolishedPBR", + "Components": { + "Component_[11392538078593907718]": { + "$type": "EditorVisibilityComponent", + "Id": 11392538078593907718 + }, + "Component_[15271285664593091377]": { + "$type": "EditorPrefabComponent", + "Id": 15271285664593091377 + }, + "Component_[16445950008096288691]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 16445950008096288691 + }, + "Component_[17031759897155285515]": { + "$type": "EditorOnlyEntityComponent", + "Id": 17031759897155285515 + }, + "Component_[17333992135029064645]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 17333992135029064645, + "Parent Entity": "" + }, + "Component_[2440848159410013062]": { + "$type": "EditorInspectorComponent", + "Id": 2440848159410013062 + }, + "Component_[4872690920600271776]": { + "$type": "EditorEntityIconComponent", + "Id": 4872690920600271776 + }, + "Component_[8105157811055641931]": { + "$type": "SelectionComponent", + "Id": 8105157811055641931 + }, + "Component_[8121804356127130254]": { + "$type": "EditorLockComponent", + "Id": 8121804356127130254 + }, + "Component_[9156467458085058309]": { + "$type": "EditorPendingCompositionComponent", + "Id": 9156467458085058309 + }, + "Component_[998572165026441124]": { + "$type": "EditorEntitySortComponent", + "Id": 998572165026441124, + "Child Entity Order": [ + "Entity_[1169034670281]" + ] + } + } + }, + "Entities": { + "Entity_[1169034670281]": { + "Id": "Entity_[1169034670281]", + "Name": "Entity1", + "Components": { + "Component_[11024839750215572075]": { + "$type": "SelectionComponent", + "Id": 11024839750215572075 + }, + "Component_[11384176886283708819]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11384176886283708819, + "Parent Entity": "ContainerEntity" + }, + "Component_[1606410272595503925]": { + "$type": "EditorMaterialComponent", + "Id": 1606410272595503925, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FC69F2F8-F73B-5A0C-B8B7-94BAA45780FC}" + }, + "assetHint": "materials/presets/pbr/metal_brass_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[16470114336751653654]": { + "$type": "EditorInspectorComponent", + "Id": 16470114336751653654, + "ComponentOrderEntryArray": [ + { + "ComponentId": 11384176886283708819 + }, + { + "ComponentId": 89717634602996901, + "SortIndex": 1 + }, + { + "ComponentId": 1606410272595503925, + "SortIndex": 2 + } + ] + }, + "Component_[4303036201889516060]": { + "$type": "EditorLockComponent", + "Id": 4303036201889516060 + }, + "Component_[44336138790150350]": { + "$type": "EditorEntitySortComponent", + "Id": 44336138790150350 + }, + "Component_[4558973254917759795]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 4558973254917759795 + }, + "Component_[4674030476408790307]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4674030476408790307 + }, + "Component_[4802851695039968062]": { + "$type": "EditorVisibilityComponent", + "Id": 4802851695039968062 + }, + "Component_[5821006029055754615]": { + "$type": "EditorOnlyEntityComponent", + "Id": 5821006029055754615 + }, + "Component_[8587156575497792590]": { + "$type": "EditorEntityIconComponent", + "Id": 8587156575497792590 + }, + "Component_[89717634602996901]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 89717634602996901, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Prefabs/TestData/Graphics/CubeChromePolishedPBR.prefab b/AutomatedTesting/Prefabs/TestData/Graphics/CubeChromePolishedPBR.prefab new file mode 100644 index 0000000000..6f933ad666 --- /dev/null +++ b/AutomatedTesting/Prefabs/TestData/Graphics/CubeChromePolishedPBR.prefab @@ -0,0 +1,156 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "CubeChromePolishedPBR", + "Components": { + "Component_[10194322458002226643]": { + "$type": "EditorOnlyEntityComponent", + "Id": 10194322458002226643 + }, + "Component_[12036481316264753863]": { + "$type": "EditorVisibilityComponent", + "Id": 12036481316264753863 + }, + "Component_[12378089635489881977]": { + "$type": "EditorInspectorComponent", + "Id": 12378089635489881977 + }, + "Component_[14430665156325163680]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14430665156325163680 + }, + "Component_[15205683346512266293]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 15205683346512266293, + "Parent Entity": "" + }, + "Component_[16051828087924530008]": { + "$type": "EditorLockComponent", + "Id": 16051828087924530008 + }, + "Component_[3910753277078082783]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 3910753277078082783 + }, + "Component_[4999195701117409226]": { + "$type": "EditorEntityIconComponent", + "Id": 4999195701117409226 + }, + "Component_[5435519106043975119]": { + "$type": "EditorEntitySortComponent", + "Id": 5435519106043975119, + "Child Entity Order": [ + "Entity_[1315063558345]" + ] + }, + "Component_[6762050164377989214]": { + "$type": "EditorPrefabComponent", + "Id": 6762050164377989214 + }, + "Component_[7395721573111063938]": { + "$type": "SelectionComponent", + "Id": 7395721573111063938 + } + } + }, + "Entities": { + "Entity_[1315063558345]": { + "Id": "Entity_[1315063558345]", + "Name": "Entity1", + "Components": { + "Component_[11024839750215572075]": { + "$type": "SelectionComponent", + "Id": 11024839750215572075 + }, + "Component_[11384176886283708819]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11384176886283708819, + "Parent Entity": "ContainerEntity" + }, + "Component_[1606410272595503925]": { + "$type": "EditorMaterialComponent", + "Id": 1606410272595503925, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[16470114336751653654]": { + "$type": "EditorInspectorComponent", + "Id": 16470114336751653654, + "ComponentOrderEntryArray": [ + { + "ComponentId": 11384176886283708819 + }, + { + "ComponentId": 89717634602996901, + "SortIndex": 1 + }, + { + "ComponentId": 1606410272595503925, + "SortIndex": 2 + } + ] + }, + "Component_[4303036201889516060]": { + "$type": "EditorLockComponent", + "Id": 4303036201889516060 + }, + "Component_[44336138790150350]": { + "$type": "EditorEntitySortComponent", + "Id": 44336138790150350 + }, + "Component_[4558973254917759795]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 4558973254917759795 + }, + "Component_[4674030476408790307]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4674030476408790307 + }, + "Component_[4802851695039968062]": { + "$type": "EditorVisibilityComponent", + "Id": 4802851695039968062 + }, + "Component_[5821006029055754615]": { + "$type": "EditorOnlyEntityComponent", + "Id": 5821006029055754615 + }, + "Component_[8587156575497792590]": { + "$type": "EditorEntityIconComponent", + "Id": 8587156575497792590 + }, + "Component_[89717634602996901]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 89717634602996901, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Prefabs/TestData/Graphics/CubeCobaltPolishedPBR.prefab b/AutomatedTesting/Prefabs/TestData/Graphics/CubeCobaltPolishedPBR.prefab new file mode 100644 index 0000000000..82ed5264dd --- /dev/null +++ b/AutomatedTesting/Prefabs/TestData/Graphics/CubeCobaltPolishedPBR.prefab @@ -0,0 +1,156 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "CubeCobaltPolishedPBR", + "Components": { + "Component_[12811832964126776693]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 12811832964126776693, + "Parent Entity": "" + }, + "Component_[13295886036381057017]": { + "$type": "EditorPrefabComponent", + "Id": 13295886036381057017 + }, + "Component_[13767840970182343359]": { + "$type": "SelectionComponent", + "Id": 13767840970182343359 + }, + "Component_[16269039178417460408]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 16269039178417460408 + }, + "Component_[16338942903899315753]": { + "$type": "EditorLockComponent", + "Id": 16338942903899315753 + }, + "Component_[16938354010512315058]": { + "$type": "EditorVisibilityComponent", + "Id": 16938354010512315058 + }, + "Component_[18087692989611771228]": { + "$type": "EditorEntitySortComponent", + "Id": 18087692989611771228, + "Child Entity Order": [ + "Entity_[1478272315593]" + ] + }, + "Component_[2408892657833094901]": { + "$type": "EditorInspectorComponent", + "Id": 2408892657833094901 + }, + "Component_[3273159330768091937]": { + "$type": "EditorPendingCompositionComponent", + "Id": 3273159330768091937 + }, + "Component_[8251134042453350781]": { + "$type": "EditorEntityIconComponent", + "Id": 8251134042453350781 + }, + "Component_[9830348537229676775]": { + "$type": "EditorOnlyEntityComponent", + "Id": 9830348537229676775 + } + } + }, + "Entities": { + "Entity_[1478272315593]": { + "Id": "Entity_[1478272315593]", + "Name": "Entity1", + "Components": { + "Component_[11024839750215572075]": { + "$type": "SelectionComponent", + "Id": 11024839750215572075 + }, + "Component_[11384176886283708819]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11384176886283708819, + "Parent Entity": "ContainerEntity" + }, + "Component_[1606410272595503925]": { + "$type": "EditorMaterialComponent", + "Id": 1606410272595503925, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{93DF55AE-8D1B-5AD1-A609-05F1BD9F6EA0}" + }, + "assetHint": "materials/presets/pbr/metal_cobalt_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[16470114336751653654]": { + "$type": "EditorInspectorComponent", + "Id": 16470114336751653654, + "ComponentOrderEntryArray": [ + { + "ComponentId": 11384176886283708819 + }, + { + "ComponentId": 89717634602996901, + "SortIndex": 1 + }, + { + "ComponentId": 1606410272595503925, + "SortIndex": 2 + } + ] + }, + "Component_[4303036201889516060]": { + "$type": "EditorLockComponent", + "Id": 4303036201889516060 + }, + "Component_[44336138790150350]": { + "$type": "EditorEntitySortComponent", + "Id": 44336138790150350 + }, + "Component_[4558973254917759795]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 4558973254917759795 + }, + "Component_[4674030476408790307]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4674030476408790307 + }, + "Component_[4802851695039968062]": { + "$type": "EditorVisibilityComponent", + "Id": 4802851695039968062 + }, + "Component_[5821006029055754615]": { + "$type": "EditorOnlyEntityComponent", + "Id": 5821006029055754615 + }, + "Component_[8587156575497792590]": { + "$type": "EditorEntityIconComponent", + "Id": 8587156575497792590 + }, + "Component_[89717634602996901]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 89717634602996901, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Prefabs/TestData/Graphics/CubeCopperPolishedPBR.prefab b/AutomatedTesting/Prefabs/TestData/Graphics/CubeCopperPolishedPBR.prefab new file mode 100644 index 0000000000..ca6680593b --- /dev/null +++ b/AutomatedTesting/Prefabs/TestData/Graphics/CubeCopperPolishedPBR.prefab @@ -0,0 +1,156 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "CubeCopperPolishedPBR", + "Components": { + "Component_[14120317269315619433]": { + "$type": "SelectionComponent", + "Id": 14120317269315619433 + }, + "Component_[143917687187100454]": { + "$type": "EditorInspectorComponent", + "Id": 143917687187100454 + }, + "Component_[15260876699496078513]": { + "$type": "EditorPrefabComponent", + "Id": 15260876699496078513 + }, + "Component_[1746418914802949089]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1746418914802949089 + }, + "Component_[18443523081045072277]": { + "$type": "EditorPendingCompositionComponent", + "Id": 18443523081045072277 + }, + "Component_[4010874908443542212]": { + "$type": "EditorLockComponent", + "Id": 4010874908443542212 + }, + "Component_[4271734532103635304]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 4271734532103635304 + }, + "Component_[4383829137523954163]": { + "$type": "EditorEntityIconComponent", + "Id": 4383829137523954163 + }, + "Component_[5749675910289562089]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 5749675910289562089, + "Parent Entity": "" + }, + "Component_[6232920837132171119]": { + "$type": "EditorVisibilityComponent", + "Id": 6232920837132171119 + }, + "Component_[7306146920796854544]": { + "$type": "EditorEntitySortComponent", + "Id": 7306146920796854544, + "Child Entity Order": [ + "Entity_[1658660942025]" + ] + } + } + }, + "Entities": { + "Entity_[1658660942025]": { + "Id": "Entity_[1658660942025]", + "Name": "Entity1", + "Components": { + "Component_[11024839750215572075]": { + "$type": "SelectionComponent", + "Id": 11024839750215572075 + }, + "Component_[11384176886283708819]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11384176886283708819, + "Parent Entity": "ContainerEntity" + }, + "Component_[1606410272595503925]": { + "$type": "EditorMaterialComponent", + "Id": 1606410272595503925, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{CF5C7B01-4912-58AE-991A-F25251E505AC}" + }, + "assetHint": "materials/presets/pbr/metal_copper_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[16470114336751653654]": { + "$type": "EditorInspectorComponent", + "Id": 16470114336751653654, + "ComponentOrderEntryArray": [ + { + "ComponentId": 11384176886283708819 + }, + { + "ComponentId": 89717634602996901, + "SortIndex": 1 + }, + { + "ComponentId": 1606410272595503925, + "SortIndex": 2 + } + ] + }, + "Component_[4303036201889516060]": { + "$type": "EditorLockComponent", + "Id": 4303036201889516060 + }, + "Component_[44336138790150350]": { + "$type": "EditorEntitySortComponent", + "Id": 44336138790150350 + }, + "Component_[4558973254917759795]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 4558973254917759795 + }, + "Component_[4674030476408790307]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4674030476408790307 + }, + "Component_[4802851695039968062]": { + "$type": "EditorVisibilityComponent", + "Id": 4802851695039968062 + }, + "Component_[5821006029055754615]": { + "$type": "EditorOnlyEntityComponent", + "Id": 5821006029055754615 + }, + "Component_[8587156575497792590]": { + "$type": "EditorEntityIconComponent", + "Id": 8587156575497792590 + }, + "Component_[89717634602996901]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 89717634602996901, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Prefabs/TestData/Graphics/CubeGoldPolishedPBR.prefab b/AutomatedTesting/Prefabs/TestData/Graphics/CubeGoldPolishedPBR.prefab new file mode 100644 index 0000000000..f6b678bb32 --- /dev/null +++ b/AutomatedTesting/Prefabs/TestData/Graphics/CubeGoldPolishedPBR.prefab @@ -0,0 +1,156 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "CubeGoldPolishedPBR", + "Components": { + "Component_[10011820011377711118]": { + "$type": "EditorLockComponent", + "Id": 10011820011377711118 + }, + "Component_[10068789746496377466]": { + "$type": "EditorPrefabComponent", + "Id": 10068789746496377466 + }, + "Component_[11570676153379582500]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11570676153379582500, + "Parent Entity": "" + }, + "Component_[13003038310843603631]": { + "$type": "EditorVisibilityComponent", + "Id": 13003038310843603631 + }, + "Component_[15807328745370882636]": { + "$type": "SelectionComponent", + "Id": 15807328745370882636 + }, + "Component_[2750440106393392905]": { + "$type": "EditorEntitySortComponent", + "Id": 2750440106393392905, + "Child Entity Order": [ + "Entity_[1856229437641]" + ] + }, + "Component_[2761752922494043610]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 2761752922494043610 + }, + "Component_[3027606009106407466]": { + "$type": "EditorInspectorComponent", + "Id": 3027606009106407466 + }, + "Component_[4326682049246572673]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4326682049246572673 + }, + "Component_[5821381882600148312]": { + "$type": "EditorOnlyEntityComponent", + "Id": 5821381882600148312 + }, + "Component_[6068739143830165037]": { + "$type": "EditorEntityIconComponent", + "Id": 6068739143830165037 + } + } + }, + "Entities": { + "Entity_[1856229437641]": { + "Id": "Entity_[1856229437641]", + "Name": "Entity1", + "Components": { + "Component_[11024839750215572075]": { + "$type": "SelectionComponent", + "Id": 11024839750215572075 + }, + "Component_[11384176886283708819]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11384176886283708819, + "Parent Entity": "ContainerEntity" + }, + "Component_[1606410272595503925]": { + "$type": "EditorMaterialComponent", + "Id": 1606410272595503925, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{FB4657EB-FB3A-5EC3-A772-DC36D6F733C3}" + }, + "assetHint": "materials/presets/pbr/metal_gold_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[16470114336751653654]": { + "$type": "EditorInspectorComponent", + "Id": 16470114336751653654, + "ComponentOrderEntryArray": [ + { + "ComponentId": 11384176886283708819 + }, + { + "ComponentId": 89717634602996901, + "SortIndex": 1 + }, + { + "ComponentId": 1606410272595503925, + "SortIndex": 2 + } + ] + }, + "Component_[4303036201889516060]": { + "$type": "EditorLockComponent", + "Id": 4303036201889516060 + }, + "Component_[44336138790150350]": { + "$type": "EditorEntitySortComponent", + "Id": 44336138790150350 + }, + "Component_[4558973254917759795]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 4558973254917759795 + }, + "Component_[4674030476408790307]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4674030476408790307 + }, + "Component_[4802851695039968062]": { + "$type": "EditorVisibilityComponent", + "Id": 4802851695039968062 + }, + "Component_[5821006029055754615]": { + "$type": "EditorOnlyEntityComponent", + "Id": 5821006029055754615 + }, + "Component_[8587156575497792590]": { + "$type": "EditorEntityIconComponent", + "Id": 8587156575497792590 + }, + "Component_[89717634602996901]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 89717634602996901, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Prefabs/TestData/Graphics/CubeIronPolishedPBR.prefab b/AutomatedTesting/Prefabs/TestData/Graphics/CubeIronPolishedPBR.prefab new file mode 100644 index 0000000000..f7118b4084 --- /dev/null +++ b/AutomatedTesting/Prefabs/TestData/Graphics/CubeIronPolishedPBR.prefab @@ -0,0 +1,156 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "CubeIronPolishedPBR", + "Components": { + "Component_[10744633821142630765]": { + "$type": "EditorOnlyEntityComponent", + "Id": 10744633821142630765 + }, + "Component_[15160812085690623525]": { + "$type": "EditorPrefabComponent", + "Id": 15160812085690623525 + }, + "Component_[17506200912680653288]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 17506200912680653288, + "Parent Entity": "" + }, + "Component_[1779514216896114299]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1779514216896114299 + }, + "Component_[2089200513910230823]": { + "$type": "EditorPendingCompositionComponent", + "Id": 2089200513910230823 + }, + "Component_[3904312129158421170]": { + "$type": "EditorEntityIconComponent", + "Id": 3904312129158421170 + }, + "Component_[5126366677360310098]": { + "$type": "EditorVisibilityComponent", + "Id": 5126366677360310098 + }, + "Component_[6443652007083636420]": { + "$type": "EditorEntitySortComponent", + "Id": 6443652007083636420, + "Child Entity Order": [ + "Entity_[2070977802441]" + ] + }, + "Component_[8531209872369121358]": { + "$type": "EditorInspectorComponent", + "Id": 8531209872369121358 + }, + "Component_[8558242753126803571]": { + "$type": "SelectionComponent", + "Id": 8558242753126803571 + }, + "Component_[8938179055081804896]": { + "$type": "EditorLockComponent", + "Id": 8938179055081804896 + } + } + }, + "Entities": { + "Entity_[2070977802441]": { + "Id": "Entity_[2070977802441]", + "Name": "Entity1", + "Components": { + "Component_[11024839750215572075]": { + "$type": "SelectionComponent", + "Id": 11024839750215572075 + }, + "Component_[11384176886283708819]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11384176886283708819, + "Parent Entity": "ContainerEntity" + }, + "Component_[1606410272595503925]": { + "$type": "EditorMaterialComponent", + "Id": 1606410272595503925, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{A7F03135-ECAD-5440-99DB-E84ABA3D50DA}" + }, + "assetHint": "materials/presets/pbr/metal_iron_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[16470114336751653654]": { + "$type": "EditorInspectorComponent", + "Id": 16470114336751653654, + "ComponentOrderEntryArray": [ + { + "ComponentId": 11384176886283708819 + }, + { + "ComponentId": 89717634602996901, + "SortIndex": 1 + }, + { + "ComponentId": 1606410272595503925, + "SortIndex": 2 + } + ] + }, + "Component_[4303036201889516060]": { + "$type": "EditorLockComponent", + "Id": 4303036201889516060 + }, + "Component_[44336138790150350]": { + "$type": "EditorEntitySortComponent", + "Id": 44336138790150350 + }, + "Component_[4558973254917759795]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 4558973254917759795 + }, + "Component_[4674030476408790307]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4674030476408790307 + }, + "Component_[4802851695039968062]": { + "$type": "EditorVisibilityComponent", + "Id": 4802851695039968062 + }, + "Component_[5821006029055754615]": { + "$type": "EditorOnlyEntityComponent", + "Id": 5821006029055754615 + }, + "Component_[8587156575497792590]": { + "$type": "EditorEntityIconComponent", + "Id": 8587156575497792590 + }, + "Component_[89717634602996901]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 89717634602996901, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Prefabs/TestData/Graphics/CubeMercuryPBR.prefab b/AutomatedTesting/Prefabs/TestData/Graphics/CubeMercuryPBR.prefab new file mode 100644 index 0000000000..2977bff25b --- /dev/null +++ b/AutomatedTesting/Prefabs/TestData/Graphics/CubeMercuryPBR.prefab @@ -0,0 +1,156 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "CubeMercuryPBR", + "Components": { + "Component_[11796219437064669544]": { + "$type": "SelectionComponent", + "Id": 11796219437064669544 + }, + "Component_[12551667429170676889]": { + "$type": "EditorPrefabComponent", + "Id": 12551667429170676889 + }, + "Component_[12693460746131498096]": { + "$type": "EditorInspectorComponent", + "Id": 12693460746131498096 + }, + "Component_[14262931207267008977]": { + "$type": "EditorEntityIconComponent", + "Id": 14262931207267008977 + }, + "Component_[18045441039226816973]": { + "$type": "EditorEntitySortComponent", + "Id": 18045441039226816973, + "Child Entity Order": [ + "Entity_[928516501705]" + ] + }, + "Component_[2268958959705742396]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 2268958959705742396, + "Parent Entity": "" + }, + "Component_[3379321424051234761]": { + "$type": "EditorVisibilityComponent", + "Id": 3379321424051234761 + }, + "Component_[3967973434353405611]": { + "$type": "EditorLockComponent", + "Id": 3967973434353405611 + }, + "Component_[6260092263143569388]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 6260092263143569388 + }, + "Component_[6596926416684557718]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6596926416684557718 + }, + "Component_[9068640134216835201]": { + "$type": "EditorPendingCompositionComponent", + "Id": 9068640134216835201 + } + } + }, + "Entities": { + "Entity_[928516501705]": { + "Id": "Entity_[928516501705]", + "Name": "Entity1", + "Components": { + "Component_[11024839750215572075]": { + "$type": "SelectionComponent", + "Id": 11024839750215572075 + }, + "Component_[11384176886283708819]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11384176886283708819, + "Parent Entity": "ContainerEntity" + }, + "Component_[1606410272595503925]": { + "$type": "EditorMaterialComponent", + "Id": 1606410272595503925, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{F2AD0EBF-7137-58D1-9991-9552FAD41B19}" + }, + "assetHint": "materials/presets/pbr/metal_mercury.azmaterial" + } + } + } + ] + } + } + }, + "Component_[16470114336751653654]": { + "$type": "EditorInspectorComponent", + "Id": 16470114336751653654, + "ComponentOrderEntryArray": [ + { + "ComponentId": 11384176886283708819 + }, + { + "ComponentId": 89717634602996901, + "SortIndex": 1 + }, + { + "ComponentId": 1606410272595503925, + "SortIndex": 2 + } + ] + }, + "Component_[4303036201889516060]": { + "$type": "EditorLockComponent", + "Id": 4303036201889516060 + }, + "Component_[44336138790150350]": { + "$type": "EditorEntitySortComponent", + "Id": 44336138790150350 + }, + "Component_[4558973254917759795]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 4558973254917759795 + }, + "Component_[4674030476408790307]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4674030476408790307 + }, + "Component_[4802851695039968062]": { + "$type": "EditorVisibilityComponent", + "Id": 4802851695039968062 + }, + "Component_[5821006029055754615]": { + "$type": "EditorOnlyEntityComponent", + "Id": 5821006029055754615 + }, + "Component_[8587156575497792590]": { + "$type": "EditorEntityIconComponent", + "Id": 8587156575497792590 + }, + "Component_[89717634602996901]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 89717634602996901, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Prefabs/TestData/Graphics/CubeNickelPolishedPBR.prefab b/AutomatedTesting/Prefabs/TestData/Graphics/CubeNickelPolishedPBR.prefab new file mode 100644 index 0000000000..22fa0873b1 --- /dev/null +++ b/AutomatedTesting/Prefabs/TestData/Graphics/CubeNickelPolishedPBR.prefab @@ -0,0 +1,156 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "CubeNickelPolishedPBR", + "Components": { + "Component_[10826024012928681054]": { + "$type": "EditorPendingCompositionComponent", + "Id": 10826024012928681054 + }, + "Component_[12821987693261496174]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 12821987693261496174, + "Parent Entity": "" + }, + "Component_[1347237730046420905]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1347237730046420905 + }, + "Component_[13962868105035894085]": { + "$type": "EditorInspectorComponent", + "Id": 13962868105035894085 + }, + "Component_[17956955568472089321]": { + "$type": "EditorOnlyEntityComponent", + "Id": 17956955568472089321 + }, + "Component_[1982369816302736367]": { + "$type": "EditorLockComponent", + "Id": 1982369816302736367 + }, + "Component_[2765278216943439310]": { + "$type": "EditorEntityIconComponent", + "Id": 2765278216943439310 + }, + "Component_[2823302329697962266]": { + "$type": "SelectionComponent", + "Id": 2823302329697962266 + }, + "Component_[5490362878017390612]": { + "$type": "EditorVisibilityComponent", + "Id": 5490362878017390612 + }, + "Component_[7468073145776592577]": { + "$type": "EditorEntitySortComponent", + "Id": 7468073145776592577, + "Child Entity Order": [ + "Entity_[2302906036425]" + ] + }, + "Component_[7692885660975737763]": { + "$type": "EditorPrefabComponent", + "Id": 7692885660975737763 + } + } + }, + "Entities": { + "Entity_[2302906036425]": { + "Id": "Entity_[2302906036425]", + "Name": "Entity1", + "Components": { + "Component_[11024839750215572075]": { + "$type": "SelectionComponent", + "Id": 11024839750215572075 + }, + "Component_[11384176886283708819]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11384176886283708819, + "Parent Entity": "ContainerEntity" + }, + "Component_[1606410272595503925]": { + "$type": "EditorMaterialComponent", + "Id": 1606410272595503925, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{E66E4343-F45A-536D-AAE1-C4D096420640}" + }, + "assetHint": "materials/presets/pbr/metal_nickel_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[16470114336751653654]": { + "$type": "EditorInspectorComponent", + "Id": 16470114336751653654, + "ComponentOrderEntryArray": [ + { + "ComponentId": 11384176886283708819 + }, + { + "ComponentId": 89717634602996901, + "SortIndex": 1 + }, + { + "ComponentId": 1606410272595503925, + "SortIndex": 2 + } + ] + }, + "Component_[4303036201889516060]": { + "$type": "EditorLockComponent", + "Id": 4303036201889516060 + }, + "Component_[44336138790150350]": { + "$type": "EditorEntitySortComponent", + "Id": 44336138790150350 + }, + "Component_[4558973254917759795]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 4558973254917759795 + }, + "Component_[4674030476408790307]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4674030476408790307 + }, + "Component_[4802851695039968062]": { + "$type": "EditorVisibilityComponent", + "Id": 4802851695039968062 + }, + "Component_[5821006029055754615]": { + "$type": "EditorOnlyEntityComponent", + "Id": 5821006029055754615 + }, + "Component_[8587156575497792590]": { + "$type": "EditorEntityIconComponent", + "Id": 8587156575497792590 + }, + "Component_[89717634602996901]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 89717634602996901, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Prefabs/TestData/Graphics/CubePalladiumPolishedPBR.prefab b/AutomatedTesting/Prefabs/TestData/Graphics/CubePalladiumPolishedPBR.prefab new file mode 100644 index 0000000000..ace44a3d34 --- /dev/null +++ b/AutomatedTesting/Prefabs/TestData/Graphics/CubePalladiumPolishedPBR.prefab @@ -0,0 +1,156 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "CubePalladiumPolishedPBR", + "Components": { + "Component_[10678536274818457672]": { + "$type": "EditorInspectorComponent", + "Id": 10678536274818457672 + }, + "Component_[12041428694628704247]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12041428694628704247 + }, + "Component_[12143022343588526078]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 12143022343588526078 + }, + "Component_[15178316190409605112]": { + "$type": "EditorVisibilityComponent", + "Id": 15178316190409605112 + }, + "Component_[16012620721047170064]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 16012620721047170064, + "Parent Entity": "" + }, + "Component_[1646888921009876369]": { + "$type": "EditorPrefabComponent", + "Id": 1646888921009876369 + }, + "Component_[17677550467282239311]": { + "$type": "EditorEntitySortComponent", + "Id": 17677550467282239311, + "Child Entity Order": [ + "Entity_[2552014139593]" + ] + }, + "Component_[4972639499125068141]": { + "$type": "EditorLockComponent", + "Id": 4972639499125068141 + }, + "Component_[5526570610744382545]": { + "$type": "SelectionComponent", + "Id": 5526570610744382545 + }, + "Component_[6509459924043770606]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6509459924043770606 + }, + "Component_[7268409859686144269]": { + "$type": "EditorEntityIconComponent", + "Id": 7268409859686144269 + } + } + }, + "Entities": { + "Entity_[2552014139593]": { + "Id": "Entity_[2552014139593]", + "Name": "Entity1", + "Components": { + "Component_[11024839750215572075]": { + "$type": "SelectionComponent", + "Id": 11024839750215572075 + }, + "Component_[11384176886283708819]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11384176886283708819, + "Parent Entity": "ContainerEntity" + }, + "Component_[1606410272595503925]": { + "$type": "EditorMaterialComponent", + "Id": 1606410272595503925, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{D0E9960A-4B31-5136-BAC6-5482B203D3B4}" + }, + "assetHint": "materials/presets/pbr/metal_palladium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[16470114336751653654]": { + "$type": "EditorInspectorComponent", + "Id": 16470114336751653654, + "ComponentOrderEntryArray": [ + { + "ComponentId": 11384176886283708819 + }, + { + "ComponentId": 89717634602996901, + "SortIndex": 1 + }, + { + "ComponentId": 1606410272595503925, + "SortIndex": 2 + } + ] + }, + "Component_[4303036201889516060]": { + "$type": "EditorLockComponent", + "Id": 4303036201889516060 + }, + "Component_[44336138790150350]": { + "$type": "EditorEntitySortComponent", + "Id": 44336138790150350 + }, + "Component_[4558973254917759795]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 4558973254917759795 + }, + "Component_[4674030476408790307]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4674030476408790307 + }, + "Component_[4802851695039968062]": { + "$type": "EditorVisibilityComponent", + "Id": 4802851695039968062 + }, + "Component_[5821006029055754615]": { + "$type": "EditorOnlyEntityComponent", + "Id": 5821006029055754615 + }, + "Component_[8587156575497792590]": { + "$type": "EditorEntityIconComponent", + "Id": 8587156575497792590 + }, + "Component_[89717634602996901]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 89717634602996901, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Prefabs/TestData/Graphics/CubePlatinumPolishedPBR.prefab b/AutomatedTesting/Prefabs/TestData/Graphics/CubePlatinumPolishedPBR.prefab new file mode 100644 index 0000000000..79bc443342 --- /dev/null +++ b/AutomatedTesting/Prefabs/TestData/Graphics/CubePlatinumPolishedPBR.prefab @@ -0,0 +1,156 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "CubePlatinumPolishedPBR", + "Components": { + "Component_[12172311178585433096]": { + "$type": "EditorEntityIconComponent", + "Id": 12172311178585433096 + }, + "Component_[14133734575774270778]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 14133734575774270778 + }, + "Component_[1499102502234135899]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 1499102502234135899, + "Parent Entity": "" + }, + "Component_[17753826932279572795]": { + "$type": "EditorOnlyEntityComponent", + "Id": 17753826932279572795 + }, + "Component_[3472150728361446089]": { + "$type": "EditorPrefabComponent", + "Id": 3472150728361446089 + }, + "Component_[5413614787652013946]": { + "$type": "EditorLockComponent", + "Id": 5413614787652013946 + }, + "Component_[6608132617418028580]": { + "$type": "EditorEntitySortComponent", + "Id": 6608132617418028580, + "Child Entity Order": [ + "Entity_[2818302111945]" + ] + }, + "Component_[6809102061425149362]": { + "$type": "EditorInspectorComponent", + "Id": 6809102061425149362 + }, + "Component_[6916818921856882722]": { + "$type": "EditorPendingCompositionComponent", + "Id": 6916818921856882722 + }, + "Component_[7486700682637381880]": { + "$type": "SelectionComponent", + "Id": 7486700682637381880 + }, + "Component_[7993011597330638847]": { + "$type": "EditorVisibilityComponent", + "Id": 7993011597330638847 + } + } + }, + "Entities": { + "Entity_[2818302111945]": { + "Id": "Entity_[2818302111945]", + "Name": "Entity1", + "Components": { + "Component_[11024839750215572075]": { + "$type": "SelectionComponent", + "Id": 11024839750215572075 + }, + "Component_[11384176886283708819]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11384176886283708819, + "Parent Entity": "ContainerEntity" + }, + "Component_[1606410272595503925]": { + "$type": "EditorMaterialComponent", + "Id": 1606410272595503925, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{79419183-FFCE-5A89-AA16-C2789D81AF75}" + }, + "assetHint": "materials/presets/pbr/metal_platinum_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[16470114336751653654]": { + "$type": "EditorInspectorComponent", + "Id": 16470114336751653654, + "ComponentOrderEntryArray": [ + { + "ComponentId": 11384176886283708819 + }, + { + "ComponentId": 89717634602996901, + "SortIndex": 1 + }, + { + "ComponentId": 1606410272595503925, + "SortIndex": 2 + } + ] + }, + "Component_[4303036201889516060]": { + "$type": "EditorLockComponent", + "Id": 4303036201889516060 + }, + "Component_[44336138790150350]": { + "$type": "EditorEntitySortComponent", + "Id": 44336138790150350 + }, + "Component_[4558973254917759795]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 4558973254917759795 + }, + "Component_[4674030476408790307]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4674030476408790307 + }, + "Component_[4802851695039968062]": { + "$type": "EditorVisibilityComponent", + "Id": 4802851695039968062 + }, + "Component_[5821006029055754615]": { + "$type": "EditorOnlyEntityComponent", + "Id": 5821006029055754615 + }, + "Component_[8587156575497792590]": { + "$type": "EditorEntityIconComponent", + "Id": 8587156575497792590 + }, + "Component_[89717634602996901]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 89717634602996901, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Prefabs/TestData/Graphics/CubeSilverPolishedPBR.prefab b/AutomatedTesting/Prefabs/TestData/Graphics/CubeSilverPolishedPBR.prefab new file mode 100644 index 0000000000..74a166e09c --- /dev/null +++ b/AutomatedTesting/Prefabs/TestData/Graphics/CubeSilverPolishedPBR.prefab @@ -0,0 +1,156 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "CubeSilverPolishedPBR", + "Components": { + "Component_[10846467226799581471]": { + "$type": "EditorPrefabComponent", + "Id": 10846467226799581471 + }, + "Component_[11321068769303258722]": { + "$type": "SelectionComponent", + "Id": 11321068769303258722 + }, + "Component_[14255141886015898000]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 14255141886015898000 + }, + "Component_[14442599743555977836]": { + "$type": "EditorLockComponent", + "Id": 14442599743555977836 + }, + "Component_[15390328167304917483]": { + "$type": "EditorOnlyEntityComponent", + "Id": 15390328167304917483 + }, + "Component_[16667892946203958068]": { + "$type": "EditorInspectorComponent", + "Id": 16667892946203958068 + }, + "Component_[17957849336986334052]": { + "$type": "EditorPendingCompositionComponent", + "Id": 17957849336986334052 + }, + "Component_[18049054501916401618]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 18049054501916401618, + "Parent Entity": "" + }, + "Component_[362051120594559781]": { + "$type": "EditorVisibilityComponent", + "Id": 362051120594559781 + }, + "Component_[5852346937789040993]": { + "$type": "EditorEntitySortComponent", + "Id": 5852346937789040993, + "Child Entity Order": [ + "Entity_[3101769953481]" + ] + }, + "Component_[7250311833503679341]": { + "$type": "EditorEntityIconComponent", + "Id": 7250311833503679341 + } + } + }, + "Entities": { + "Entity_[3101769953481]": { + "Id": "Entity_[3101769953481]", + "Name": "Entity1", + "Components": { + "Component_[11024839750215572075]": { + "$type": "SelectionComponent", + "Id": 11024839750215572075 + }, + "Component_[11384176886283708819]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11384176886283708819, + "Parent Entity": "ContainerEntity" + }, + "Component_[1606410272595503925]": { + "$type": "EditorMaterialComponent", + "Id": 1606410272595503925, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{2AC06FA3-7670-542E-8996-DF346AFF1B61}" + }, + "assetHint": "materials/presets/pbr/metal_silver_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[16470114336751653654]": { + "$type": "EditorInspectorComponent", + "Id": 16470114336751653654, + "ComponentOrderEntryArray": [ + { + "ComponentId": 11384176886283708819 + }, + { + "ComponentId": 89717634602996901, + "SortIndex": 1 + }, + { + "ComponentId": 1606410272595503925, + "SortIndex": 2 + } + ] + }, + "Component_[4303036201889516060]": { + "$type": "EditorLockComponent", + "Id": 4303036201889516060 + }, + "Component_[44336138790150350]": { + "$type": "EditorEntitySortComponent", + "Id": 44336138790150350 + }, + "Component_[4558973254917759795]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 4558973254917759795 + }, + "Component_[4674030476408790307]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4674030476408790307 + }, + "Component_[4802851695039968062]": { + "$type": "EditorVisibilityComponent", + "Id": 4802851695039968062 + }, + "Component_[5821006029055754615]": { + "$type": "EditorOnlyEntityComponent", + "Id": 5821006029055754615 + }, + "Component_[8587156575497792590]": { + "$type": "EditorEntityIconComponent", + "Id": 8587156575497792590 + }, + "Component_[89717634602996901]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 89717634602996901, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Prefabs/TestData/Graphics/CubeTitaniumPolishedPBR.prefab b/AutomatedTesting/Prefabs/TestData/Graphics/CubeTitaniumPolishedPBR.prefab new file mode 100644 index 0000000000..c732fee593 --- /dev/null +++ b/AutomatedTesting/Prefabs/TestData/Graphics/CubeTitaniumPolishedPBR.prefab @@ -0,0 +1,156 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "CubeTitaniumPolishedPBR", + "Components": { + "Component_[11835136016071721229]": { + "$type": "EditorInspectorComponent", + "Id": 11835136016071721229 + }, + "Component_[14924371629431224666]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 14924371629431224666, + "Parent Entity": "" + }, + "Component_[15534521734777674027]": { + "$type": "EditorPrefabComponent", + "Id": 15534521734777674027 + }, + "Component_[16612248066971579226]": { + "$type": "SelectionComponent", + "Id": 16612248066971579226 + }, + "Component_[16806731875899878085]": { + "$type": "EditorLockComponent", + "Id": 16806731875899878085 + }, + "Component_[3294763415970396682]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3294763415970396682 + }, + "Component_[3871617444656658973]": { + "$type": "EditorEntitySortComponent", + "Id": 3871617444656658973, + "Child Entity Order": [ + "Entity_[3406712631497]" + ] + }, + "Component_[6604961087017250006]": { + "$type": "EditorEntityIconComponent", + "Id": 6604961087017250006 + }, + "Component_[6721284225512452216]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 6721284225512452216 + }, + "Component_[8673188027501037544]": { + "$type": "EditorPendingCompositionComponent", + "Id": 8673188027501037544 + }, + "Component_[9993323762911548658]": { + "$type": "EditorVisibilityComponent", + "Id": 9993323762911548658 + } + } + }, + "Entities": { + "Entity_[3406712631497]": { + "Id": "Entity_[3406712631497]", + "Name": "Entity1", + "Components": { + "Component_[11024839750215572075]": { + "$type": "SelectionComponent", + "Id": 11024839750215572075 + }, + "Component_[11384176886283708819]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11384176886283708819, + "Parent Entity": "ContainerEntity" + }, + "Component_[1606410272595503925]": { + "$type": "EditorMaterialComponent", + "Id": 1606410272595503925, + "Controller": { + "Configuration": { + "materials": [ + { + "Key": { + "materialSlotStableId": 2418540911 + }, + "Value": { + "MaterialAsset": { + "assetId": { + "guid": "{3F0DF0C4-5F23-5EB1-B762-7344AFFDC011}" + }, + "assetHint": "materials/presets/pbr/metal_titanium_polished.azmaterial" + } + } + } + ] + } + } + }, + "Component_[16470114336751653654]": { + "$type": "EditorInspectorComponent", + "Id": 16470114336751653654, + "ComponentOrderEntryArray": [ + { + "ComponentId": 11384176886283708819 + }, + { + "ComponentId": 89717634602996901, + "SortIndex": 1 + }, + { + "ComponentId": 1606410272595503925, + "SortIndex": 2 + } + ] + }, + "Component_[4303036201889516060]": { + "$type": "EditorLockComponent", + "Id": 4303036201889516060 + }, + "Component_[44336138790150350]": { + "$type": "EditorEntitySortComponent", + "Id": 44336138790150350 + }, + "Component_[4558973254917759795]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 4558973254917759795 + }, + "Component_[4674030476408790307]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4674030476408790307 + }, + "Component_[4802851695039968062]": { + "$type": "EditorVisibilityComponent", + "Id": 4802851695039968062 + }, + "Component_[5821006029055754615]": { + "$type": "EditorOnlyEntityComponent", + "Id": 5821006029055754615 + }, + "Component_[8587156575497792590]": { + "$type": "EditorEntityIconComponent", + "Id": 8587156575497792590 + }, + "Component_[89717634602996901]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 89717634602996901, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E14975EF-E676-51A4-B826-3EF59CB645AA}", + "subId": 285127096 + }, + "assetHint": "testdata/objects/cube/cube.azmodel" + } + } + } + } + } + } + } +} \ No newline at end of file From ddfcccfe2a7e921b521fb59d843543ccc8de859c Mon Sep 17 00:00:00 2001 From: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> Date: Fri, 17 Dec 2021 22:24:16 +0000 Subject: [PATCH 191/948] Add EditorPythonBindings as an explicit dependency of the White Box Tool (#6479) * add EditorPythonBindings as an explicit dependency of the White Box Tool Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * add Gem::EditorPythonBindings.Editor as a runtime dependency to White Box Tool Gem Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * remove redundant target scope Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> --- Gems/WhiteBox/Code/CMakeLists.txt | 3 ++- Gems/WhiteBox/gem.json | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Gems/WhiteBox/Code/CMakeLists.txt b/Gems/WhiteBox/Code/CMakeLists.txt index ee76031beb..bfc4eb724a 100644 --- a/Gems/WhiteBox/Code/CMakeLists.txt +++ b/Gems/WhiteBox/Code/CMakeLists.txt @@ -29,7 +29,6 @@ if(NOT PAL_TRAIT_WHITEBOX_SUPPORTED) if(PAL_TRAIT_BUILD_HOST_TOOLS) ly_add_target( NAME WhiteBox.Editor GEM_MODULE - NAMESPACE Gem FILES_CMAKE whitebox_unsupported_files.cmake @@ -44,6 +43,8 @@ if(NOT PAL_TRAIT_WHITEBOX_SUPPORTED) BUILD_DEPENDENCIES PRIVATE AZ::AzCore + RUNTIME_DEPENDENCIES + Gem::EditorPythonBindings.Editor ) endif() return() diff --git a/Gems/WhiteBox/gem.json b/Gems/WhiteBox/gem.json index 41865efc56..2d173e9a6b 100644 --- a/Gems/WhiteBox/gem.json +++ b/Gems/WhiteBox/gem.json @@ -20,6 +20,7 @@ "dependencies": [ "Atom_RPI", "Atom_Feature_Common", - "CommonFeaturesAtom" + "CommonFeaturesAtom", + "EditorPythonBindings" ] } From 1ba23247b42602fa2c8a64e6d0ac9bcde6e3d285 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Fri, 17 Dec 2021 15:16:24 -0800 Subject: [PATCH 192/948] sandboxing DisplayMapper P0 test for investigation Signed-off-by: Scott Murray --- .../Gem/PythonTests/Atom/TestSuite_Main.py | 4 ---- .../Gem/PythonTests/Atom/TestSuite_Sandbox.py | 14 +++++++------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main.py b/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main.py index d79e144ae0..905722d103 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main.py @@ -39,10 +39,6 @@ class TestAutomation(EditorTestSuite): class AtomEditorComponents_DirectionalLightAdded(EditorSharedTest): from Atom.tests import hydra_AtomEditorComponents_DirectionalLightAdded as test_module - @pytest.mark.test_case_id("C36525660") - class AtomEditorComponents_DisplayMapperAdded(EditorSharedTest): - from Atom.tests import hydra_AtomEditorComponents_DisplayMapperAdded as test_module - @pytest.mark.test_case_id("C36525661") class AtomEditorComponents_EntityReferenceAdded(EditorSharedTest): from Atom.tests import hydra_AtomEditorComponents_EntityReferenceAdded as test_module diff --git a/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Sandbox.py b/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Sandbox.py index f0bb6e72ca..29f90e6807 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Sandbox.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Sandbox.py @@ -19,13 +19,6 @@ logger = logging.getLogger(__name__) TEST_DIRECTORY = os.path.join(os.path.dirname(__file__), "tests") -class TestAtomEditorComponentsSandbox(object): - - # It requires at least one test - def test_Dummy(self, request, editor, level, workspace, project, launcher_platform): - pass - - @pytest.mark.parametrize("project", ["AutomatedTesting"]) @pytest.mark.parametrize("launcher_platform", ['windows_editor']) @pytest.mark.parametrize("level", ["auto_test"]) @@ -167,10 +160,17 @@ class TestAutomation(EditorTestSuite): enable_prefab_system = False + #this test is intermittently timing out without ever having executed. sandboxing while we investigate cause. + @pytest.mark.test_case_id("C36525660") + class AtomEditorComponents_DisplayMapperAdded(EditorSharedTest): + from Atom.tests import hydra_AtomEditorComponents_DisplayMapperAdded as test_module + + # this test causes editor to crash when using slices. once automation transitions to prefabs it should pass @pytest.mark.test_case_id("C36529666") class AtomEditorComponentsLevel_DiffuseGlobalIlluminationAdded(EditorSharedTest): from Atom.tests import hydra_AtomEditorComponentsLevel_DiffuseGlobalIlluminationAdded as test_module + # this test causes editor to crash when using slices. once automation transitions to prefabs it should pass @pytest.mark.test_case_id("C36525660") class AtomEditorComponentsLevel_DisplayMapperAdded(EditorSharedTest): from Atom.tests import hydra_AtomEditorComponentsLevel_DisplayMapperAdded as test_module From c6eead4efa9a4971588e47dc508ef0301a8f68a2 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Fri, 17 Dec 2021 15:23:14 -0800 Subject: [PATCH 193/948] remove uber build exceptions (#6466) Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake index 34b2c4d326..c0dcc04838 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake @@ -206,9 +206,4 @@ set(FILES Include/ScriptCanvas/Utils/VersioningUtils.cpp Include/ScriptCanvas/Utils/VersioningUtils.cpp Include/ScriptCanvas/Utils/BehaviorContextUtils.cpp -) - -set(SKIP_UNITY_BUILD_INCLUSION_FILES - Include/ScriptCanvas/Libraries/Core/FunctionCallNode.cpp - Include/ScriptCanvas/Libraries/Core/FunctionCallNodeIsOutOfDate.cpp -) +) \ No newline at end of file From 20d55c62670ce0a6986bd93bc8f2fa2e7616e477 Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Fri, 17 Dec 2021 16:31:39 -0600 Subject: [PATCH 194/948] Fixed the translation error messages for GraphCanvas It was unconditionally logging an AZ_Warning and AZ_Error if a translation entry with the same key was added to the database. This didn't account for the same key and value being added to the database, so loading the same translation file twice would result in error messages for each entry. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- .../Code/Source/Translation/TranslationDatabase.cpp | 8 +++++--- .../Code/Source/Translation/TranslationSerializer.cpp | 7 ++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Gems/GraphCanvas/Code/Source/Translation/TranslationDatabase.cpp b/Gems/GraphCanvas/Code/Source/Translation/TranslationDatabase.cpp index 0b5029de63..448f69adfa 100644 --- a/Gems/GraphCanvas/Code/Source/Translation/TranslationDatabase.cpp +++ b/Gems/GraphCanvas/Code/Source/Translation/TranslationDatabase.cpp @@ -163,9 +163,11 @@ namespace GraphCanvas } else { - AZStd::string warning = AZStd::string::format("Unable to store key: %s with value: %s because that key already exists with value: %s", entry.first.c_str(), entry.second.c_str(), m_database[entry.first].c_str()); - AZ_Warning("TranslationSerializer", false, warning.c_str()); - warnings = true; + const bool valueMatches = entry.second == m_database[entry.first]; + AZ_Warning("TranslationDatabase", valueMatches, + R"(Unable to store key: "%s" with value: "%s" because that key already exists with value: "%s")", + entry.first.c_str(), entry.second.c_str(), m_database[entry.first].c_str()); + warnings = !valueMatches; } } diff --git a/Gems/GraphCanvas/Code/Source/Translation/TranslationSerializer.cpp b/Gems/GraphCanvas/Code/Source/Translation/TranslationSerializer.cpp index 754267b27d..72cbfbb9e8 100644 --- a/Gems/GraphCanvas/Code/Source/Translation/TranslationSerializer.cpp +++ b/Gems/GraphCanvas/Code/Source/Translation/TranslationSerializer.cpp @@ -24,11 +24,12 @@ namespace GraphCanvas } else { - const AZStd::string& existingValue = translationDbItr->second; + [[maybe_unused]] const AZStd::string& existingValue = translationDbItr->second; // There is a name collision - const AZStd::string error = AZStd::string::format("Unable to store key: %s with value: %s because that key already exists with value: %s (proposed: %s)", baseKey.c_str(), it.GetString(), existingValue.c_str(), it.GetString()); - AZ_Error("TranslationSerializer", false, error.c_str()); + AZ_Error("TranslationSerializer", existingValue == it.GetString(), + R"(Unable to store key: "%s" with value: "%s" because that key already exists with value: "%s" (proposed: "%s"))", + baseKey.c_str(), it.GetString(), existingValue.c_str(), it.GetString()); } } else if (it.IsObject()) From 86d22c8bb38ead46a237bcee497ed8e528eb751b Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Fri, 17 Dec 2021 18:26:36 -0600 Subject: [PATCH 195/948] Updated GraphCanvasSystemComponent::OnCatalogLoaded to use TranslationRequests::Restore The TranslationDatabase::Restore function will clear out the database before merging in all the translation .names files making it idempotent. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- Gems/GraphCanvas/Code/Source/GraphCanvas.cpp | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/Gems/GraphCanvas/Code/Source/GraphCanvas.cpp b/Gems/GraphCanvas/Code/Source/GraphCanvas.cpp index 75306969f2..de7966e53c 100644 --- a/Gems/GraphCanvas/Code/Source/GraphCanvas.cpp +++ b/Gems/GraphCanvas/Code/Source/GraphCanvas.cpp @@ -368,25 +368,7 @@ namespace GraphCanvas void GraphCanvasSystemComponent::OnCatalogLoaded(const char* /*catalogFile*/) { - AZStd::vector translationAssets; - auto postEnumerateCb = [&translationAssets]() - { - for (const AZ::Data::AssetId& assetId : translationAssets) - { - AZ::Data::AssetManager::Instance().GetAsset(assetId, AZ::Data::AssetLoadBehavior::Default); - } - }; - - // Find any TranslationAsset files that may have translation database key/values - AZ::Data::AssetCatalogRequests::AssetEnumerationCB collectAssetsCb = [&translationAssets](const AZ::Data::AssetId assetId, const AZ::Data::AssetInfo& assetInfo) - { - if (AZ::StringFunc::EndsWith(assetInfo.m_relativePath, ".names", false)) - { - translationAssets.push_back(assetId); - } - }; - - AZ::Data::AssetCatalogRequestBus::Broadcast(&AZ::Data::AssetCatalogRequestBus::Events::EnumerateAssets, nullptr, collectAssetsCb, postEnumerateCb); + GraphCanvas::TranslationRequestBus::Broadcast(&GraphCanvas::TranslationRequests::Restore); } void GraphCanvasSystemComponent::OnCatalogAssetRemoved(const AZ::Data::AssetId& /*assetId*/, const AZ::Data::AssetInfo& assetInfo) From d508d5c4c2a57eecdc4a7efcb990b803393f373d Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Fri, 17 Dec 2021 17:49:36 -0800 Subject: [PATCH 196/948] Updating pytest code comments and RPC name based on review feedback Signed-off-by: Gene Walters --- ...tworkTestPlayerComponent.AutoComponent.xml | 2 +- .../editor_python_test_tools/utils.py | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml b/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml index 9037db43ee..251d2b25af 100644 --- a/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml +++ b/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml @@ -29,7 +29,7 @@ - + diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/utils.py index 92ac279627..2ba692d89b 100644 --- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/utils.py +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/utils.py @@ -117,11 +117,31 @@ class TestHelper: @staticmethod def wait_for_critical_expected_line(window, expected_message, print_infos, time_out): + """ + Looks for an expected line in a list of tracer log lines for a period of time. + Reports a critical result based on if the expected line was found. The result is successful if the line is found. + :param window: The log's window name. For example, logs printed via script-canvas use the "Script" window. + :param expected_message: The log message we're expecting to find. + :param print_infos: A list of PrintInfos collected by Tracer to search. Example options: your_tracer.warnings, your_tracer.errors, your_tracer.asserts, or your_tracer.prints + :param time_out: The total amount of time to wait before giving up looking for the expected line. + + :return: No return value, but if the expected message is found, a successful critical result is reported; otherwise failure. + """ TestHelper.wait_for_condition(lambda : TestHelper.find_expected_line(window, expected_message, print_infos), time_out) Report.critical_result(("Found expected line: " + expected_message, "Failed to find expected line: " + expected_message), TestHelper.find_expected_line(window, expected_message, print_infos)) @staticmethod def wait_for_critical_unexpected_line(window, unexpected_line, print_infos, time_out): + """ + Looks for an unexpected line in a list of tracer log lines over a period of time. + Reports a critical result based on if the unexpected line was found. The result is successful if the line is not found. + :param window: The log's window name. For example, logs printed via script-canvas use the "Script" window. + :param unexpected_line: The log message we're hoping to not find. + :param print_infos: A list of PrintInfos collected by Tracer to search. Example options: your_tracer.warnings, your_tracer.errors, your_tracer.asserts, or your_tracer.prints + :param time_out: The total amount of time to wait before giving up looking for the unexpected line. + + :return: No return value, but if the unexpected message is found, a failed critical result is reported; otherwise success. + """ TestHelper.wait_for_condition(lambda : TestHelper.find_expected_line(window, unexpected_line, print_infos), time_out) Report.critical_result(("Unexpected line not found: " + unexpected_line, "Unexpected line found: " + unexpected_line), not TestHelper.find_expected_line(window, unexpected_line, print_infos)) From fd078e3c29a5d39f96cb4965f65ede334b55e338 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Sat, 18 Dec 2021 10:11:20 -0800 Subject: [PATCH 197/948] Small py var name change based on review feedback. Updating script graphs from previous commit to use new RPC name Signed-off-by: Gene Walters --- .../tests/Multiplayer_AutoComponent_RPC.py | 8 +- ...oComponent_RPC_NetLevelEntity.scriptcanvas | 664 ++++++++++-------- 2 files changed, 377 insertions(+), 295 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py b/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py index 387de66acd..3b7ae89368 100644 --- a/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py +++ b/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py @@ -10,7 +10,7 @@ SPDX-License-Identifier: Apache-2.0 OR MIT # fmt: off -class Tests(): +class TestSuccessFailTuples(): enter_game_mode = ("Entered game mode", "Failed to enter game mode") exit_game_mode = ("Exited game mode", "Couldn't exit game mode") find_network_player = ("Found network player", "Couldn't find network player") @@ -55,11 +55,11 @@ def Multiplayer_AutoComponent_RPC(): with Tracer() as section_tracer: # 2) Enter game mode - helper.multiplayer_enter_game_mode(Tests.enter_game_mode, player_prefab_path.lower()) + helper.multiplayer_enter_game_mode(TestSuccessFailTuples.enter_game_mode, player_prefab_path.lower()) # 3) Make sure the network player was spawned player_id = general.find_game_entity(player_prefab_name) - Report.critical_result(Tests.find_network_player, player_id.IsValid()) + Report.critical_result(TestSuccessFailTuples.find_network_player, player_id.IsValid()) # 4) Check the editor logs for expected and unexpected log output EXPECTEDLINE_WAIT_TIME_SECONDS = 1.0 @@ -68,7 +68,7 @@ def Multiplayer_AutoComponent_RPC(): # Exit game mode - helper.exit_game_mode(Tests.exit_game_mode) + helper.exit_game_mode(TestSuccessFailTuples.exit_game_mode) diff --git a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC_NetLevelEntity.scriptcanvas b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC_NetLevelEntity.scriptcanvas index aa5244a7cd..8e5a6b374c 100644 --- a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC_NetLevelEntity.scriptcanvas +++ b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC_NetLevelEntity.scriptcanvas @@ -5,7 +5,7 @@ "ClassData": { "m_scriptCanvas": { "Id": { - "id": 56982432064952 + "id": 5286394689911028851 }, "Name": "AutoComponent_RPC_NetLevelEntity", "Components": { @@ -216,40 +216,51 @@ }, { "Id": { - "id": 57021086770616 + "id": 28956289730909 }, - "Name": "SC-Node(GetAuthorityToClientNoParams_PlaySomeSuperficialFxEventByEntityId)", + "Name": "SC-EventNode(AuthorityToClientNoParams_PlayFx Notify Event)", "Components": { - "Component_[1410603071340071190]": { - "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", - "Id": 1410603071340071190, + "Component_[12478098247313937239]": { + "$type": "AzEventHandler", + "Id": 12478098247313937239, "Slots": [ { "id": { - "m_id": "{406DA66F-95FA-406B-8A5B-F2C5E292EC21}" + "m_id": "{E97830A5-323D-4CD1-85CF-BAFB1735AC34}" }, "contracts": [ { "$type": "SlotTypeContract" + }, + { + "$type": "ConnectionLimitContract", + "limit": 1 + }, + { + "$type": "RestrictedNodeContract", + "m_nodeId": { + "id": 28466663459165 + } } ], - "slotName": "EntityId: 0", + "slotName": "Connect", + "toolTip": "Connect the AZ Event to this AZ Event Handler.", "Descriptor": { "ConnectionType": 1, - "SlotType": 2 - }, - "DataType": 1 + "SlotType": 1 + } }, { "id": { - "m_id": "{5CDED810-9455-424A-9A1D-40B9366D1F94}" + "m_id": "{2A7ABD07-368B-44F3-BB16-946539B76A16}" }, "contracts": [ { "$type": "SlotTypeContract" } ], - "slotName": "In", + "slotName": "Disconnect", + "toolTip": "Disconnect current AZ Event from this AZ Event Handler.", "Descriptor": { "ConnectionType": 1, "SlotType": 1 @@ -257,14 +268,15 @@ }, { "id": { - "m_id": "{2FC162C0-D717-4053-9842-39DAD3E8EA86}" + "m_id": "{E1C7B2B6-B5ED-4BA6-8484-A74F336CD53F}" }, "contracts": [ { "$type": "SlotTypeContract" } ], - "slotName": "Out", + "slotName": "On Connected", + "toolTip": "Signaled when a connection has taken place.", "Descriptor": { "ConnectionType": 2, "SlotType": 1 @@ -272,20 +284,59 @@ }, { "id": { - "m_id": "{C18E637D-BFD1-42C8-A30D-C2B52D157142}" + "m_id": "{2731EE09-9E48-4EDB-9548-024EAAC23A03}" }, "contracts": [ { "$type": "SlotTypeContract" } ], - "slotName": "Event<>", - "DisplayDataType": { - "m_type": 4, - "m_azType": "{F429F985-AF00-529B-8449-16E56694E5F9}" + "slotName": "On Disconnected", + "toolTip": "Signaled when this event handler is disconnected.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{1F11AAA9-2A99-41A2-AABE-7B57463E3664}" }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnEvent", + "toolTip": "Triggered when the AZ Event invokes Signal() function.", "Descriptor": { "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{7A4D75C3-C9C8-4CFB-A87C-C15B71AB3296}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "ConnectionLimitContract", + "limit": 1 + }, + { + "$type": "RestrictedNodeContract", + "m_nodeId": { + "id": 28466663459165 + } + } + ], + "slotName": "AuthorityToClientNoParams_PlayFx Notify Event", + "Descriptor": { + "ConnectionType": 1, "SlotType": 2 }, "DataType": 1 @@ -293,29 +344,21 @@ ], "Datums": [ { + "isOverloadedStorage": false, "scriptCanvasType": { - "m_type": 1 - }, - "isNullPointer": false, - "$type": "EntityId", - "value": { - "id": 2901262558 + "m_type": 4, + "m_azType": "{F429F985-AF00-529B-8449-16E56694E5F9}" }, - "label": "EntityId: 0" + "isNullPointer": true, + "label": "AuthorityToClientNoParams_PlayFx Notify Event" } ], - "methodType": 2, - "methodName": "GetAuthorityToClientNoParams_PlaySomeSuperficialFxEventByEntityId", - "className": "NetworkTestPlayerComponent", - "resultSlotIDs": [ - {} - ], - "inputSlots": [ - { - "m_id": "{406DA66F-95FA-406B-8A5B-F2C5E292EC21}" + "m_azEventEntry": { + "m_eventName": "AuthorityToClientNoParams_PlayFx Notify Event", + "m_eventSlotId": { + "m_id": "{7A4D75C3-C9C8-4CFB-A87C-C15B71AB3296}" } - ], - "prettyClassName": "NetworkTestPlayerComponent" + } } } }, @@ -642,83 +685,85 @@ }, { "Id": { - "id": 57016791803320 + "id": 57025381737912 }, - "Name": "SC-EventNode(AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event)", + "Name": "SC-Node(Start)", "Components": { - "Component_[17598011665473695286]": { - "$type": "AzEventHandler", - "Id": 17598011665473695286, + "Component_[1888047318201703857]": { + "$type": "Start", + "Id": 1888047318201703857, "Slots": [ { "id": { - "m_id": "{6F8A1DAB-76A6-445F-B532-6B71CD5DB48F}" + "m_id": "{28664064-2483-465A-9BB1-4E1890048CDF}" }, "contracts": [ { "$type": "SlotTypeContract" - }, - { - "$type": "ConnectionLimitContract", - "limit": 1 - }, - { - "$type": "RestrictedNodeContract", - "m_nodeId": { - "id": 57021086770616 - } } ], - "slotName": "Connect", - "toolTip": "Connect the AZ Event to this AZ Event Handler.", + "slotName": "Out", + "toolTip": "Signaled when the entity that owns this graph is fully activated.", "Descriptor": { - "ConnectionType": 1, + "ConnectionType": 2, "SlotType": 1 } - }, + } + ] + } + } + }, + { + "Id": { + "id": 28466663459165 + }, + "Name": "SC-Node(GetAuthorityToClientNoParams_PlayFxEventByEntityId)", + "Components": { + "Component_[5890343372099746558]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 5890343372099746558, + "Slots": [ { "id": { - "m_id": "{D986DF89-49E8-4CFF-907E-7A46BC118208}" + "m_id": "{4E1A6903-3F02-4395-A4C9-202D1F13250E}" }, "contracts": [ { "$type": "SlotTypeContract" } ], - "slotName": "Disconnect", - "toolTip": "Disconnect current AZ Event from this AZ Event Handler.", + "slotName": "EntityId: 0", "Descriptor": { "ConnectionType": 1, - "SlotType": 1 - } + "SlotType": 2 + }, + "DataType": 1 }, { "id": { - "m_id": "{277D7B39-E1B0-4700-946B-FFA024EEDF89}" + "m_id": "{26902930-1BC7-4BF6-8F41-C313BA819AA3}" }, "contracts": [ { "$type": "SlotTypeContract" } ], - "slotName": "On Connected", - "toolTip": "Signaled when a connection has taken place.", + "slotName": "In", "Descriptor": { - "ConnectionType": 2, + "ConnectionType": 1, "SlotType": 1 } }, { "id": { - "m_id": "{7673B52D-3BEC-4BFF-B29A-D027400B16B1}" + "m_id": "{B6C92656-7593-4759-B657-98DB7CA30482}" }, "contracts": [ { "$type": "SlotTypeContract" } ], - "slotName": "On Disconnected", - "toolTip": "Signaled when this event handler is disconnected.", + "slotName": "Out", "Descriptor": { "ConnectionType": 2, "SlotType": 1 @@ -726,43 +771,20 @@ }, { "id": { - "m_id": "{A53312FA-7FAB-4C8C-A105-478C634ECD33}" + "m_id": "{10D59D8F-E406-431B-87F9-FC1AF1EC65AF}" }, "contracts": [ { "$type": "SlotTypeContract" } ], - "slotName": "OnEvent", - "toolTip": "Triggered when the AZ Event invokes Signal() function.", - "Descriptor": { - "ConnectionType": 2, - "SlotType": 1 - }, - "IsLatent": true - }, - { - "id": { - "m_id": "{F5D0C2B0-F557-4D94-B747-6F3EF01AF54B}" + "slotName": "Event<>", + "DisplayDataType": { + "m_type": 4, + "m_azType": "{F429F985-AF00-529B-8449-16E56694E5F9}" }, - "contracts": [ - { - "$type": "SlotTypeContract" - }, - { - "$type": "ConnectionLimitContract", - "limit": 1 - }, - { - "$type": "RestrictedNodeContract", - "m_nodeId": { - "id": 57021086770616 - } - } - ], - "slotName": "AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event", "Descriptor": { - "ConnectionType": 1, + "ConnectionType": 2, "SlotType": 2 }, "DataType": 1 @@ -770,66 +792,43 @@ ], "Datums": [ { + "isOverloadedStorage": false, "scriptCanvasType": { - "m_type": 4, - "m_azType": "{F429F985-AF00-529B-8449-16E56694E5F9}" + "m_type": 1 }, - "isNullPointer": true, - "label": "AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event" + "isNullPointer": false, + "$type": "EntityId", + "value": { + "id": 2901262558 + }, + "label": "EntityId: 0" } ], - "m_azEventEntry": { - "m_eventName": "AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event", - "m_eventSlotId": { - "m_id": "{F5D0C2B0-F557-4D94-B747-6F3EF01AF54B}" - } - } - } - } - }, - { - "Id": { - "id": 57025381737912 - }, - "Name": "SC-Node(Start)", - "Components": { - "Component_[1888047318201703857]": { - "$type": "Start", - "Id": 1888047318201703857, - "Slots": [ + "methodType": 2, + "methodName": "GetAuthorityToClientNoParams_PlayFxEventByEntityId", + "className": "NetworkTestPlayerComponent", + "inputSlots": [ { - "id": { - "m_id": "{28664064-2483-465A-9BB1-4E1890048CDF}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - } - ], - "slotName": "Out", - "toolTip": "Signaled when the entity that owns this graph is fully activated.", - "Descriptor": { - "ConnectionType": 2, - "SlotType": 1 - } + "m_id": "{4E1A6903-3F02-4395-A4C9-202D1F13250E}" } - ] + ], + "prettyClassName": "NetworkTestPlayerComponent" } } }, { "Id": { - "id": 57008201868728 + "id": 8400576252253 }, - "Name": "SC-Node(AuthorityToClientNoParams_PlaySomeSuperficialFxByEntityId)", + "Name": "SC-Node(AuthorityToClientNoParams_PlayFxByEntityId)", "Components": { - "Component_[5156950796673122600]": { + "Component_[6332803108634970671]": { "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", - "Id": 5156950796673122600, + "Id": 6332803108634970671, "Slots": [ { "id": { - "m_id": "{AF45BF64-D202-411F-9CE1-A7139ABC6E65}" + "m_id": "{87B7266B-D7B1-4CAD-9898-4D7F0274DAB0}" }, "contracts": [ { @@ -846,7 +845,7 @@ }, { "id": { - "m_id": "{A6449574-6CD4-4986-ABED-2E10136D1B2C}" + "m_id": "{AB0D7C00-A334-449A-AC56-EA3167AB8900}" }, "contracts": [ { @@ -861,7 +860,7 @@ }, { "id": { - "m_id": "{F8CE0394-770E-4F0D-B908-3E01D0E04AE1}" + "m_id": "{A52302D6-9DF9-45C2-960D-19BF90A4A931}" }, "contracts": [ { @@ -889,14 +888,14 @@ } ], "methodType": 2, - "methodName": "AuthorityToClientNoParams_PlaySomeSuperficialFxByEntityId", + "methodName": "AuthorityToClientNoParams_PlayFxByEntityId", "className": "NetworkTestPlayerComponent", "resultSlotIDs": [ {} ], "inputSlots": [ { - "m_id": "{AF45BF64-D202-411F-9CE1-A7139ABC6E65}" + "m_id": "{87B7266B-D7B1-4CAD-9898-4D7F0274DAB0}" } ], "prettyClassName": "NetworkTestPlayerComponent" @@ -1074,27 +1073,83 @@ }, { "Id": { - "id": 57033971672504 + "id": 57042561607096 }, - "Name": "srcEndpoint=(GetAuthorityToClientNoParams_PlaySomeSuperficialFxEventByEntityId: Event<>), destEndpoint=(AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event: AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event)", + "Name": "srcEndpoint=(On Graph Start: Out), destEndpoint=(GetAuthorityToClientNoParams_PlaySomeSuperficialFxEventByEntityId: In)", "Components": { - "Component_[9588403027578693736]": { + "Component_[17563947682404363417]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 9588403027578693736, + "Id": 17563947682404363417, "sourceEndpoint": { + "nodeId": { + "id": 57025381737912 + }, + "slotId": { + "m_id": "{28664064-2483-465A-9BB1-4E1890048CDF}" + } + }, + "targetEndpoint": { "nodeId": { "id": 57021086770616 }, "slotId": { - "m_id": "{C18E637D-BFD1-42C8-A30D-C2B52D157142}" + "m_id": "{5CDED810-9455-424A-9A1D-40B9366D1F94}" + } + } + } + } + }, + { + "Id": { + "id": 57046856574392 + }, + "Name": "srcEndpoint=(AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event: OnEvent), destEndpoint=(Print: In)", + "Components": { + "Component_[12226462283795741406]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 12226462283795741406, + "sourceEndpoint": { + "nodeId": { + "id": 57016791803320 + }, + "slotId": { + "m_id": "{A53312FA-7FAB-4C8C-A105-478C634ECD33}" } }, "targetEndpoint": { + "nodeId": { + "id": 56995316966840 + }, + "slotId": { + "m_id": "{7CAD6E31-6218-4326-8FFB-0523F545E250}" + } + } + } + } + }, + { + "Id": { + "id": 57051151541688 + }, + "Name": "srcEndpoint=(AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event: OnEvent), destEndpoint=(DrawTextOnEntity: In)", + "Components": { + "Component_[7209285242155620531]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 7209285242155620531, + "sourceEndpoint": { "nodeId": { "id": 57016791803320 }, "slotId": { - "m_id": "{F5D0C2B0-F557-4D94-B747-6F3EF01AF54B}" + "m_id": "{A53312FA-7FAB-4C8C-A105-478C634ECD33}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 57003906901432 + }, + "slotId": { + "m_id": "{1673B8A0-D4EC-4CC7-8F80-0419BB5560EB}" } } } @@ -1102,27 +1157,27 @@ }, { "Id": { - "id": 57038266639800 + "id": 57055446508984 }, - "Name": "srcEndpoint=(GetAuthorityToClientNoParams_PlaySomeSuperficialFxEventByEntityId: Out), destEndpoint=(AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event: Connect)", + "Name": "srcEndpoint=(TimeDelay: Done), destEndpoint=(Repeater: Start)", "Components": { - "Component_[1452138089363094396]": { + "Component_[6292481678297438578]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 1452138089363094396, + "Id": 6292481678297438578, "sourceEndpoint": { "nodeId": { - "id": 57021086770616 + "id": 57012496836024 }, "slotId": { - "m_id": "{2FC162C0-D717-4053-9842-39DAD3E8EA86}" + "m_id": "{158B30BE-BD39-40AE-A8A8-F0E5694F0180}" } }, "targetEndpoint": { "nodeId": { - "id": 57016791803320 + "id": 56986727032248 }, "slotId": { - "m_id": "{6F8A1DAB-76A6-445F-B532-6B71CD5DB48F}" + "m_id": "{07267CBA-B377-4B57-8A04-E322F8BFC07F}" } } } @@ -1130,13 +1185,13 @@ }, { "Id": { - "id": 57042561607096 + "id": 57068331410872 }, - "Name": "srcEndpoint=(On Graph Start: Out), destEndpoint=(GetAuthorityToClientNoParams_PlaySomeSuperficialFxEventByEntityId: In)", + "Name": "srcEndpoint=(On Graph Start: Out), destEndpoint=(Print: In)", "Components": { - "Component_[17563947682404363417]": { + "Component_[11504712829988319988]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 17563947682404363417, + "Id": 11504712829988319988, "sourceEndpoint": { "nodeId": { "id": 57025381737912 @@ -1147,10 +1202,10 @@ }, "targetEndpoint": { "nodeId": { - "id": 57021086770616 + "id": 56991021999544 }, "slotId": { - "m_id": "{5CDED810-9455-424A-9A1D-40B9366D1F94}" + "m_id": "{8E1B9705-148A-42E4-831E-D7B2877358E3}" } } } @@ -1158,27 +1213,27 @@ }, { "Id": { - "id": 57046856574392 + "id": 9392713697629 }, - "Name": "srcEndpoint=(AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event: OnEvent), destEndpoint=(Print: In)", + "Name": "srcEndpoint=(Repeater: Action), destEndpoint=(AuthorityToClientNoParams_PlayFxByEntityId: In)", "Components": { - "Component_[12226462283795741406]": { + "Component_[17811480012084226596]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 12226462283795741406, + "Id": 17811480012084226596, "sourceEndpoint": { "nodeId": { - "id": 57016791803320 + "id": 56986727032248 }, "slotId": { - "m_id": "{A53312FA-7FAB-4C8C-A105-478C634ECD33}" + "m_id": "{C1CCBA7B-A13B-4FCE-99ED-8FD1A8F72869}" } }, "targetEndpoint": { "nodeId": { - "id": 56995316966840 + "id": 8400576252253 }, "slotId": { - "m_id": "{7CAD6E31-6218-4326-8FFB-0523F545E250}" + "m_id": "{AB0D7C00-A334-449A-AC56-EA3167AB8900}" } } } @@ -1186,27 +1241,27 @@ }, { "Id": { - "id": 57051151541688 + "id": 9732016114013 }, - "Name": "srcEndpoint=(AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event: OnEvent), destEndpoint=(DrawTextOnEntity: In)", + "Name": "srcEndpoint=(AuthorityToClientNoParams_PlayFxByEntityId: Out), destEndpoint=(Print: In)", "Components": { - "Component_[7209285242155620531]": { + "Component_[14133537125895802472]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 7209285242155620531, + "Id": 14133537125895802472, "sourceEndpoint": { "nodeId": { - "id": 57016791803320 + "id": 8400576252253 }, "slotId": { - "m_id": "{A53312FA-7FAB-4C8C-A105-478C634ECD33}" + "m_id": "{A52302D6-9DF9-45C2-960D-19BF90A4A931}" } }, "targetEndpoint": { "nodeId": { - "id": 57003906901432 + "id": 56999611934136 }, "slotId": { - "m_id": "{1673B8A0-D4EC-4CC7-8F80-0419BB5560EB}" + "m_id": "{2F11CF04-DC4B-4881-8D74-AB0E51B4A278}" } } } @@ -1214,27 +1269,27 @@ }, { "Id": { - "id": 57055446508984 + "id": 29660664367453 }, - "Name": "srcEndpoint=(TimeDelay: Done), destEndpoint=(Repeater: Start)", + "Name": "srcEndpoint=(GetAuthorityToClientNoParams_PlayFxEventByEntityId: Event<>), destEndpoint=(AuthorityToClientNoParams_PlayFx Notify Event: AuthorityToClientNoParams_PlayFx Notify Event)", "Components": { - "Component_[6292481678297438578]": { + "Component_[17084894170988218373]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 6292481678297438578, + "Id": 17084894170988218373, "sourceEndpoint": { "nodeId": { - "id": 57012496836024 + "id": 28466663459165 }, "slotId": { - "m_id": "{158B30BE-BD39-40AE-A8A8-F0E5694F0180}" + "m_id": "{10D59D8F-E406-431B-87F9-FC1AF1EC65AF}" } }, "targetEndpoint": { "nodeId": { - "id": 56986727032248 + "id": 28956289730909 }, "slotId": { - "m_id": "{07267CBA-B377-4B57-8A04-E322F8BFC07F}" + "m_id": "{7A4D75C3-C9C8-4CFB-A87C-C15B71AB3296}" } } } @@ -1242,27 +1297,27 @@ }, { "Id": { - "id": 57059741476280 + "id": 29716498942301 }, - "Name": "srcEndpoint=(Repeater: Action), destEndpoint=(AuthorityToClientNoParams_PlaySomeSuperficialFxByEntityId: In)", + "Name": "srcEndpoint=(GetAuthorityToClientNoParams_PlayFxEventByEntityId: Out), destEndpoint=(AuthorityToClientNoParams_PlayFx Notify Event: Connect)", "Components": { - "Component_[8833903103579494596]": { + "Component_[6504512854579046293]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 8833903103579494596, + "Id": 6504512854579046293, "sourceEndpoint": { "nodeId": { - "id": 56986727032248 + "id": 28466663459165 }, "slotId": { - "m_id": "{C1CCBA7B-A13B-4FCE-99ED-8FD1A8F72869}" + "m_id": "{B6C92656-7593-4759-B657-98DB7CA30482}" } }, "targetEndpoint": { "nodeId": { - "id": 57008201868728 + "id": 28956289730909 }, "slotId": { - "m_id": "{A6449574-6CD4-4986-ABED-2E10136D1B2C}" + "m_id": "{E97830A5-323D-4CD1-85CF-BAFB1735AC34}" } } } @@ -1270,27 +1325,27 @@ }, { "Id": { - "id": 57064036443576 + "id": 30240484952413 }, - "Name": "srcEndpoint=(AuthorityToClientNoParams_PlaySomeSuperficialFxByEntityId: Out), destEndpoint=(Print: In)", + "Name": "srcEndpoint=(: ), destEndpoint=(GetAuthorityToClientNoParams_PlayFxEventByEntityId: In)", "Components": { - "Component_[8297971328953001309]": { + "Component_[4329986353751309486]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 8297971328953001309, + "Id": 4329986353751309486, "sourceEndpoint": { "nodeId": { - "id": 57008201868728 + "id": 57025381737912 }, "slotId": { - "m_id": "{F8CE0394-770E-4F0D-B908-3E01D0E04AE1}" + "m_id": "{28664064-2483-465A-9BB1-4E1890048CDF}" } }, "targetEndpoint": { "nodeId": { - "id": 56999611934136 + "id": 28466663459165 }, "slotId": { - "m_id": "{2F11CF04-DC4B-4881-8D74-AB0E51B4A278}" + "m_id": "{26902930-1BC7-4BF6-8F41-C313BA819AA3}" } } } @@ -1298,27 +1353,55 @@ }, { "Id": { - "id": 57068331410872 + "id": 30678571616605 }, - "Name": "srcEndpoint=(On Graph Start: Out), destEndpoint=(Print: In)", + "Name": "srcEndpoint=(AuthorityToClientNoParams_PlayFx Notify Event: OnEvent), destEndpoint=(: )", "Components": { - "Component_[11504712829988319988]": { + "Component_[14658596010250057469]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 11504712829988319988, + "Id": 14658596010250057469, "sourceEndpoint": { "nodeId": { - "id": 57025381737912 + "id": 28956289730909 }, "slotId": { - "m_id": "{28664064-2483-465A-9BB1-4E1890048CDF}" + "m_id": "{1F11AAA9-2A99-41A2-AABE-7B57463E3664}" } }, "targetEndpoint": { "nodeId": { - "id": 56991021999544 + "id": 57003906901432 }, "slotId": { - "m_id": "{8E1B9705-148A-42E4-831E-D7B2877358E3}" + "m_id": "{1673B8A0-D4EC-4CC7-8F80-0419BB5560EB}" + } + } + } + } + }, + { + "Id": { + "id": 31060823705949 + }, + "Name": "srcEndpoint=(AuthorityToClientNoParams_PlayFx Notify Event: OnEvent), destEndpoint=(: )", + "Components": { + "Component_[16833378372852944435]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 16833378372852944435, + "sourceEndpoint": { + "nodeId": { + "id": 28956289730909 + }, + "slotId": { + "m_id": "{1F11AAA9-2A99-41A2-AABE-7B57463E3664}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 56995316966840 + }, + "slotId": { + "m_id": "{7CAD6E31-6218-4326-8FFB-0523F545E250}" } } } @@ -1335,24 +1418,7 @@ "GraphCanvasData": [ { "Key": { - "id": 56982432064952 - }, - "Value": { - "ComponentData": { - "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { - "$type": "SceneComponentSaveData", - "ViewParams": { - "Scale": 1.0440124999999998, - "AnchorX": 173.36956787109375, - "AnchorY": -153.25486755371094 - } - } - } - } - }, - { - "Key": { - "id": 56986727032248 + "id": 8400576252253 }, "Value": { "ComponentData": { @@ -1361,28 +1427,29 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "DefaultNodeTitlePalette" + "PaletteOverride": "MethodNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 80.0, - -60.0 + 440.0, + -20.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData" + "$type": "StylingComponentSaveData", + "SubStyle": ".method" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{41B7477C-D5B9-49AC-AFA3-AAAE2A6ED7C5}" + "PersistentId": "{2B6329F7-4CE7-4E01-B1A4-1FFCAB2D0B72}" } } } }, { "Key": { - "id": 56991021999544 + "id": 28466663459165 }, "Value": { "ComponentData": { @@ -1391,28 +1458,29 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "StringNodeTitlePalette" + "PaletteOverride": "MethodNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - -240.0, - -300.0 + -200.0, + 300.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData" + "$type": "StylingComponentSaveData", + "SubStyle": ".method" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{0CF0846C-1D21-4B33-8723-1538FD4FD04A}" + "PersistentId": "{A84996D5-99BD-4F5D-859E-02BFAB3FA83A}" } } } }, { "Key": { - "id": 56995316966840 + "id": 28956289730909 }, "Value": { "ComponentData": { @@ -1421,28 +1489,29 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "StringNodeTitlePalette" + "PaletteOverride": "HandlerNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 800.0, - 260.0 + 260.0, + 300.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData" + "$type": "StylingComponentSaveData", + "SubStyle": ".azeventhandler" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{0D04EBA6-E1E7-4DF7-BAA9-CC87F4689CD2}" + "PersistentId": "{B237687E-F57E-4C04-9B46-103548751B5D}" } } } }, { "Key": { - "id": 56999611934136 + "id": 56986727032248 }, "Value": { "ComponentData": { @@ -1451,13 +1520,13 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "StringNodeTitlePalette" + "PaletteOverride": "DefaultNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 960.0, - -40.0 + 80.0, + -60.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { @@ -1465,14 +1534,14 @@ }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{A4FDCB87-B021-48B9-ABCB-AECA986B33D6}" + "PersistentId": "{41B7477C-D5B9-49AC-AFA3-AAAE2A6ED7C5}" } } } }, { "Key": { - "id": 57003906901432 + "id": 56991021999544 }, "Value": { "ComponentData": { @@ -1481,29 +1550,28 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "MethodNodeTitlePalette" + "PaletteOverride": "StringNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 800.0, - 460.0 + -240.0, + -300.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData", - "SubStyle": ".method" + "$type": "StylingComponentSaveData" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{82D0ED1B-98D3-4AEF-B1DA-2F27CACD3A4D}" + "PersistentId": "{0CF0846C-1D21-4B33-8723-1538FD4FD04A}" } } } }, { "Key": { - "id": 57008201868728 + "id": 56995316966840 }, "Value": { "ComponentData": { @@ -1512,29 +1580,28 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "MethodNodeTitlePalette" + "PaletteOverride": "StringNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 380.0, - -40.0 + 800.0, + 260.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData", - "SubStyle": ".method" + "$type": "StylingComponentSaveData" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{FD25E23C-E976-4F9A-8C16-80B125D80485}" + "PersistentId": "{0D04EBA6-E1E7-4DF7-BAA9-CC87F4689CD2}" } } } }, { "Key": { - "id": 57012496836024 + "id": 56999611934136 }, "Value": { "ComponentData": { @@ -1543,12 +1610,12 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "DefaultNodeTitlePalette" + "PaletteOverride": "StringNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - -220.0, + 960.0, -40.0 ] }, @@ -1557,14 +1624,14 @@ }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{D3F081D7-40C1-4C31-B298-B18C6AFDFD25}" + "PersistentId": "{A4FDCB87-B021-48B9-ABCB-AECA986B33D6}" } } } }, { "Key": { - "id": 57016791803320 + "id": 57003906901432 }, "Value": { "ComponentData": { @@ -1573,29 +1640,29 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "HandlerNodeTitlePalette" + "PaletteOverride": "MethodNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 220.0, - 260.0 + 800.0, + 460.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { "$type": "StylingComponentSaveData", - "SubStyle": ".azeventhandler" + "SubStyle": ".method" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{58CEEB80-152A-4B8E-8698-8B8EE5F31A41}" + "PersistentId": "{82D0ED1B-98D3-4AEF-B1DA-2F27CACD3A4D}" } } } }, { "Key": { - "id": 57021086770616 + "id": 57012496836024 }, "Value": { "ComponentData": { @@ -1604,22 +1671,21 @@ }, "{328FF15C-C302-458F-A43D-E1794DE0904E}": { "$type": "GeneralNodeTitleComponentSaveData", - "PaletteOverride": "MethodNodeTitlePalette" + "PaletteOverride": "DefaultNodeTitlePalette" }, "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ -220.0, - 260.0 + -40.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { - "$type": "StylingComponentSaveData", - "SubStyle": ".method" + "$type": "StylingComponentSaveData" }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{30443D97-4B57-482D-BA92-005DB39A9FA7}" + "PersistentId": "{D3F081D7-40C1-4C31-B298-B18C6AFDFD25}" } } } @@ -1653,6 +1719,22 @@ } } } + }, + { + "Key": { + "id": 5286394689911028851 + }, + "Value": { + "ComponentData": { + "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { + "$type": "SceneComponentSaveData", + "ViewParams": { + "AnchorX": -579.0, + "AnchorY": -194.0 + } + } + } + } } ], "StatisticsHelper": { @@ -1670,23 +1752,23 @@ "Value": 1 }, { - "Key": 10684225535275896474, - "Value": 3 + "Key": 7087687843968394353, + "Value": 1 }, { - "Key": 11941188735314642437, + "Key": 8679770052035517025, "Value": 1 }, { - "Key": 11983076003173356132, - "Value": 1 + "Key": 10684225535275896474, + "Value": 3 }, { - "Key": 13774516226790665785, + "Key": 11983076003173356132, "Value": 1 }, { - "Key": 17705307213431043531, + "Key": 13774516226790665785, "Value": 1 } ] From 92d3df17fadb7ea5c872068f9d6df26a28664d9b Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Sat, 18 Dec 2021 10:16:02 -0800 Subject: [PATCH 198/948] Fix incomplete comment Signed-off-by: Gene Walters --- .../Code/Source/Editor/MultiplayerEditorConnection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp index f7882d7bf9..f112098eae 100644 --- a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp +++ b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp @@ -43,7 +43,7 @@ namespace Multiplayer { // Server logs will be piped to the editor so turn off buffering, // otherwise it'll take a lot of logs to fill up the buffer before stdout is finally flushed. - // This isn't optimal, but will only affect + // This isn't optimal, but will only affect editor-servers (used when testing multiplayer levels in Editor gameplay mode) and not production servers. // Note: _IOLBF (flush on newlines) won't work for Automated Testing which uses a headless server app and will fall back to _IOFBF (full buffering) setvbuf(stdout, NULL, _IONBF, 0); From 874bbbfca35e1f20a55a028453fa5ca5991f2f6d Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Sat, 18 Dec 2021 10:26:37 -0800 Subject: [PATCH 199/948] Better magic number naming based on review feedback Signed-off-by: Gene Walters --- .../Multiplayer/tests/Multiplayer_AutoComponent_RPC.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py b/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py index 3b7ae89368..8c13806a30 100644 --- a/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py +++ b/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py @@ -62,9 +62,9 @@ def Multiplayer_AutoComponent_RPC(): Report.critical_result(TestSuccessFailTuples.find_network_player, player_id.IsValid()) # 4) Check the editor logs for expected and unexpected log output - EXPECTEDLINE_WAIT_TIME_SECONDS = 1.0 - helper.wait_for_critical_expected_line('EditorServer', 'Script: AutoComponent_RPC: Sending client PlayerNumber 1', section_tracer.prints, EXPECTEDLINE_WAIT_TIME_SECONDS) - helper.wait_for_critical_expected_line('Script', "AutoComponent_RPC: I'm Player #1", section_tracer.prints, EXPECTEDLINE_WAIT_TIME_SECONDS) + PLAYERID_RPC_WAIT_TIME_SECONDS = 1.0 # The player id is sent from the server as soon as the player script is spawned. 1 second should be more than enough time to send/receive that RPC. + helper.wait_for_critical_expected_line('EditorServer', 'Script: AutoComponent_RPC: Sending client PlayerNumber 1', section_tracer.prints, PLAYERID_RPC_WAIT_TIME_SECONDS) + helper.wait_for_critical_expected_line('Script', "AutoComponent_RPC: I'm Player #1", section_tracer.prints, PLAYERID_RPC_WAIT_TIME_SECONDS) # Exit game mode From e58d8815f105f0e28645801d79935685f3bdde2d Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Sat, 18 Dec 2021 17:38:50 -0800 Subject: [PATCH 200/948] chore: add assertions to plane to ensure normalization Signed-off-by: Michael Pollind --- Code/Framework/AzCore/AzCore/Math/Plane.inl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Code/Framework/AzCore/AzCore/Math/Plane.inl b/Code/Framework/AzCore/AzCore/Math/Plane.inl index f33d356312..bade6f1775 100644 --- a/Code/Framework/AzCore/AzCore/Math/Plane.inl +++ b/Code/Framework/AzCore/AzCore/Math/Plane.inl @@ -19,12 +19,14 @@ namespace AZ AZ_MATH_INLINE Plane Plane::CreateFromNormalAndPoint(const Vector3& normal, const Vector3& point) { + AZ_MATH_ASSERT(normal.IsNormalized(), "This normal is not a normalized"); return Plane(Simd::Vec4::ConstructPlane(normal.GetSimdValue(), point.GetSimdValue())); } AZ_MATH_INLINE Plane Plane::CreateFromNormalAndDistance(const Vector3& normal, float dist) { + AZ_MATH_ASSERT(normal.IsNormalized(), "This normal is not a normalized"); Plane result; result.Set(normal, dist); return result; @@ -33,6 +35,7 @@ namespace AZ AZ_MATH_INLINE Plane Plane::CreateFromCoefficients(const float a, const float b, const float c, const float d) { + AZ_MATH_ASSERT(Vector3(a, b, c).IsNormalized(), "This normal is not normalized"); Plane result; result.Set(a, b, c, d); return result; @@ -65,18 +68,21 @@ namespace AZ AZ_MATH_INLINE void Plane::Set(const Vector3& normal, float d) { + AZ_MATH_ASSERT(normal.IsNormalized(), "This normal is not normalized"); m_plane.Set(normal, d); } AZ_MATH_INLINE void Plane::Set(float a, float b, float c, float d) { + AZ_MATH_ASSERT(Vector3(a, b, c).IsNormalized(), "This normal is not normalized"); m_plane.Set(a, b, c, d); } AZ_MATH_INLINE void Plane::SetNormal(const Vector3& normal) { + AZ_MATH_ASSERT(normal.IsNormalized(), "This normal is not normalized"); m_plane.SetX(normal.GetX()); m_plane.SetY(normal.GetY()); m_plane.SetZ(normal.GetZ()); From 15c6f6a4a824711a2bdfb06a76f0093e837dc3e4 Mon Sep 17 00:00:00 2001 From: "T.J. McGrath-Daly" Date: Thu, 16 Dec 2021 10:35:25 +0800 Subject: [PATCH 201/948] =?UTF-8?q?When=20the=20tag=20of=20Region=20Force?= =?UTF-8?q?=20component=20changed=EF=BC=8Cthe=20AABB=20of=20the=20componen?= =?UTF-8?q?t=20should=20be=20appended=20to=20=20m=5FpendingAabbUpdates=20o?= =?UTF-8?q?f=20local=20wind=20handler=20in=20wind=20bus=20after=20the=20wi?= =?UTF-8?q?nd=20provider=20delete=20the=20Force=20Region=20entity.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: T.J. McGrath-Daly --- Gems/PhysX/Code/Source/WindProvider.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Gems/PhysX/Code/Source/WindProvider.cpp b/Gems/PhysX/Code/Source/WindProvider.cpp index 3090cea062..3490e79412 100644 --- a/Gems/PhysX/Code/Source/WindProvider.cpp +++ b/Gems/PhysX/Code/Source/WindProvider.cpp @@ -159,6 +159,12 @@ namespace PhysX AZStd::swap(m_entityTransformHandlers[index], m_entityTransformHandlers.back()); m_entityTransformHandlers.pop_back(); + // When deleting entity from handler's m_entities, the AABB should be appended to m_pendingAabbUpdates + // for local wind handler to broadcast OnWindChanged to notify relative entities of wind changes in OnTick(). + m_pendingAabbUpdates.push_back(); + ColliderShapeRequestBus::EventResult(m_pendingAabbUpdates.back(), + entityId, &ColliderShapeRequestBus::Events::GetColliderShapeAabb); + m_changed = true; } } From 4245bf7ac97b01a97f43806cb4f68873bbd677ed Mon Sep 17 00:00:00 2001 From: Tobias Alexander Franke Date: Tue, 7 Dec 2021 17:00:52 +0800 Subject: [PATCH 202/948] Notify relative component to acquire wind information when the tag of global wind and local wind in PhysX configuration changes. Signed-off-by: T.J. McGrath-Daly --- Gems/PhysX/Code/Source/WindProvider.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/PhysX/Code/Source/WindProvider.cpp b/Gems/PhysX/Code/Source/WindProvider.cpp index 3090cea062..c7d5d0863b 100644 --- a/Gems/PhysX/Code/Source/WindProvider.cpp +++ b/Gems/PhysX/Code/Source/WindProvider.cpp @@ -177,7 +177,7 @@ namespace PhysX AZStd::vector m_entityTransformHandlers; AZStd::vector m_pendingAabbUpdates; ChangeCallback m_changeCallback; - bool m_changed = false; + bool m_changed = true; }; WindProvider::WindProvider() From fea4d0e6b160e04072826cd3b808179f45d4180a Mon Sep 17 00:00:00 2001 From: amzn-sean <75276488+amzn-sean@users.noreply.github.com> Date: Mon, 20 Dec 2021 14:32:25 +0000 Subject: [PATCH 203/948] adding TimeSystem unit tests (#6446) Signed-off-by: amzn-sean <75276488+amzn-sean@users.noreply.github.com> --- .../AzCore/AzCore/Time/TimeSystem.cpp | 10 +- .../Framework/AzCore/Tests/Time/TimeTests.cpp | 193 +++++++++++++++++- 2 files changed, 195 insertions(+), 8 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Time/TimeSystem.cpp b/Code/Framework/AzCore/AzCore/Time/TimeSystem.cpp index f8e254d32d..7ba306fbe6 100644 --- a/Code/Framework/AzCore/AzCore/Time/TimeSystem.cpp +++ b/Code/Framework/AzCore/AzCore/Time/TimeSystem.cpp @@ -23,11 +23,11 @@ namespace AZ } } - void cvar_t_simulationTickDeltaOverride_Changed(const float& value) + void cvar_t_simulationTickDeltaOverride_Changed(const int64_t& value) { if (auto* timeSystem = AZ::Interface::Get()) { - timeSystem->SetSimulationTickDeltaOverride(AZ::SecondsToTimeMs(value)); + timeSystem->SetSimulationTickDeltaOverride(static_cast(value)); } } @@ -44,8 +44,8 @@ namespace AZ AZ_CVAR(float, t_simulationTickScale, 1.0f, cvar_t_simulationTickScale_Changed, AZ::ConsoleFunctorFlags::Null, "A scalar amount to adjust time passage by, 1.0 == realtime, 0.5 == half realtime, 2.0 == doubletime"); - AZ_CVAR(float, t_simulationTickDeltaOverride, 0.0f, cvar_t_simulationTickDeltaOverride_Changed, AZ::ConsoleFunctorFlags::Null, - "If > 0, overrides the simulation tick delta time with the provided value (Seconds) and ignores any t_simulationTickScale value."); + AZ_CVAR(int64_t, t_simulationTickDeltaOverride, 0, cvar_t_simulationTickDeltaOverride_Changed, AZ::ConsoleFunctorFlags::Null, + "If > 0, overrides the simulation tick delta time with the provided value (Milliseconds) and ignores any t_simulationTickScale value."); AZ_CVAR(int, t_simulationTickRate, 0, cvar_t_simulationTickRate_Changed, AZ::ConsoleFunctorFlags::Null, "The minimum rate to force the game simulation tick to run. 0 for as fast as possible. 30 = ~33ms, 60 = ~16ms"); @@ -176,7 +176,7 @@ namespace AZ if (timeUs != m_simulationTickDeltaOverride) { m_simulationTickDeltaOverride = timeUs; - t_simulationTickDeltaOverride = AZ::TimeUsToSeconds(timeUs); //update the cvar + t_simulationTickDeltaOverride = static_cast (timeMs); // update the cvar } } diff --git a/Code/Framework/AzCore/Tests/Time/TimeTests.cpp b/Code/Framework/AzCore/Tests/Time/TimeTests.cpp index 7ba01ec0e0..446368a8ca 100644 --- a/Code/Framework/AzCore/Tests/Time/TimeTests.cpp +++ b/Code/Framework/AzCore/Tests/Time/TimeTests.cpp @@ -11,8 +11,7 @@ namespace UnitTest { - class TimeTests - : public AllocatorsFixture + class TimeTests : public AllocatorsFixture { public: void SetUp() override @@ -77,4 +76,192 @@ namespace UnitTest int64_t delta = static_cast(timeMs) - static_cast(timeUsToMs); EXPECT_LT(abs(delta), 1); } -} + + class TimeSystemTests : public AllocatorsTestFixture + { + public: + void SetUp() override + { + SetupAllocator(); + m_controlTime = static_cast(AZStd::GetTimeNowMicroSecond()); + m_timeSystem = AZStd::make_unique(); + } + + void TearDown() override + { + m_controlTime = AZ::Time::ZeroTimeUs; + m_timeSystem.reset(); + TeardownAllocator(); + } + + AZ::TimeUs GetDiff(AZ::TimeUs time1, AZ::TimeUs time2) const + { + // AZ::TimeUs is unsigned so make sure to not underflow. + return time1 > time2 ? time1 - time2 : time2 - time1; + } + + AZ::TimeUs m_controlTime; + AZStd::unique_ptr m_timeSystem; + }; + + TEST_F(TimeSystemTests, GetRealElapsedTimeUs) + { + // sleep for a bit to advance time. + AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(2)); + + // find the delta for the control and from GetRealElapsedTimeUs + const AZ::TimeUs baseline = static_cast(AZStd::GetTimeNowMicroSecond()) - m_controlTime; + const AZ::TimeUs elapsedTime = m_timeSystem->GetRealElapsedTimeUs(); + + const AZ::TimeUs diff = GetDiff(baseline, elapsedTime); + + // elapsedTime should be within 10 microseconds from baseline. + EXPECT_LT(diff, AZ::TimeUs{ 10 }); + } + + TEST_F(TimeSystemTests, GetElapsedTimeUs) + { + // sleep for a bit to advance time. + AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(2)); + + // find the delta for the control and from GetElapsedTimeUs + const AZ::TimeUs baseline = static_cast(AZStd::GetTimeNowMicroSecond()) - m_controlTime; + const AZ::TimeUs elapsedTime = m_timeSystem->GetElapsedTimeUs(); + + const AZ::TimeUs diff = GetDiff(baseline, elapsedTime); + + // elapsedTime should be within 10 microseconds from baseline. + EXPECT_LT(diff, AZ::TimeUs{ 10 }); + } + + TEST_F(TimeSystemTests, ElapsedTimeScales) + { + // slow down 'time' + m_timeSystem->SetSimulationTickScale(0.5f); + + // sleep for a bit to advance time. + AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(2)); + + // find the delta for the control and from GetElapsedTimeUs + const AZ::TimeUs baseline = static_cast(AZStd::GetTimeNowMicroSecond()) - m_controlTime; + const AZ::TimeUs elapsedTime = m_timeSystem->GetElapsedTimeUs(); + const AZ::TimeUs halfBaseline = (baseline / AZ::TimeUs{ 2 }); + + // elapsedTime should be about half of the control. + const AZ::TimeUs diff = GetDiff(halfBaseline, elapsedTime); + + // elapsedTime should be within 10 microseconds from baseline. + EXPECT_LT(diff, AZ::TimeUs{ 10 }); + + // reset time scale + m_timeSystem->SetSimulationTickScale(1.0f); + } + + TEST_F(TimeSystemTests, AdvanceTickDeltaTimes) + { + // advance the tick delta to get a clean base. + m_timeSystem->AdvanceTickDeltaTimes(); + const AZ::TimeUs baselineStart = static_cast(AZStd::GetTimeNowMicroSecond()); + + // sleep for a bit to advance time. + AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(2)); + + // advance the tick delta. + const AZ::TimeUs delta = m_timeSystem->AdvanceTickDeltaTimes(); + const AZ::TimeUs baselineDelta = static_cast(AZStd::GetTimeNowMicroSecond()) - baselineStart; + + // the delta should be close to the baselineDelta. + const AZ::TimeUs diff = GetDiff(delta, baselineDelta); + EXPECT_LT(diff, AZ::TimeUs{ 10 }); + } + + TEST_F(TimeSystemTests, SimulationAndRealTickDeltaTimesWithNoTimeScale) + { + // advance the tick delta to get a clean base. + m_timeSystem->AdvanceTickDeltaTimes(); + const AZ::TimeUs baselineStart = static_cast(AZStd::GetTimeNowMicroSecond()); + + // sleep for a bit to advance time. + AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(2)); + + // advance the tick delta. + const AZ::TimeUs delta = m_timeSystem->AdvanceTickDeltaTimes(); + const AZ::TimeUs baselineDelta = static_cast(AZStd::GetTimeNowMicroSecond()) - baselineStart; + + // the delta should be close to the baselineDelta. + AZ::TimeUs diff = GetDiff(delta, baselineDelta); + EXPECT_LT(diff, AZ::TimeUs{ 10 }); + + // the delta should be the same as GetSimulationTickDeltaTimeUs and near GetRealTickDeltaTimeUs + const AZ::TimeUs simDeltaTime = m_timeSystem->GetSimulationTickDeltaTimeUs(); + EXPECT_EQ(delta, simDeltaTime); + + const AZ::TimeUs realDeltaTime = m_timeSystem->GetRealTickDeltaTimeUs(); + diff = GetDiff(delta, realDeltaTime); + EXPECT_LT(diff, AZ::TimeUs{ 10 }); + } + + TEST_F(TimeSystemTests, SimulationAndRealTickDeltaTimesWithTimeScale) + { + // advance the tick delta to get a clean base. + m_timeSystem->AdvanceTickDeltaTimes(); + const AZ::TimeUs baselineStart = static_cast(AZStd::GetTimeNowMicroSecond()); + + // slow down 'time'; + m_timeSystem->SetSimulationTickScale(0.5f); + + // sleep for a bit to advance time. + AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(2)); + + // advance the tick delta. + const AZ::TimeUs delta = m_timeSystem->AdvanceTickDeltaTimes(); + const AZ::TimeUs baselineDelta = static_cast(AZStd::GetTimeNowMicroSecond()) - baselineStart; + const AZ::TimeUs halfBaselineDelta = (baselineDelta / AZ::TimeUs{ 2 }); + + // the delta should be half the baselineDelta + AZ::TimeUs diff = GetDiff(delta, halfBaselineDelta); + EXPECT_LT(diff, AZ::TimeUs{ 10 }); + + // the delta should be the same as GetSimulationTickDeltaTimeUs + const AZ::TimeUs simDeltaTime = m_timeSystem->GetSimulationTickDeltaTimeUs(); + EXPECT_EQ(delta, simDeltaTime); + + // the delta should be near half the GetRealTickDeltaTimeUs + const AZ::TimeUs realDeltaTime = m_timeSystem->GetRealTickDeltaTimeUs(); + const AZ::TimeUs halfRealDeltaTime = (realDeltaTime / AZ::TimeUs{ 2 }); + diff = GetDiff(delta, halfRealDeltaTime); + EXPECT_LT(diff, AZ::TimeUs{ 10 }); + + // reset time scale + m_timeSystem->SetSimulationTickScale(1.0f); + } + + TEST_F(TimeSystemTests, SimulationTickDeltaOverride) + { + // advance the tick delta to get a clean base. + m_timeSystem->AdvanceTickDeltaTimes(); + const AZ::TimeUs baselineStart = static_cast(AZStd::GetTimeNowMicroSecond()); + + // set the tick delta override + const AZ::TimeMs tickOverride = AZ::TimeMs{ 3462 }; + m_timeSystem->SetSimulationTickDeltaOverride(tickOverride); + + // sleep for a bit to advance time. + AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(2)); + + // advance the tick delta. + const AZ::TimeUs delta = m_timeSystem->AdvanceTickDeltaTimes(); + const AZ::TimeUs baselineDelta = static_cast(AZStd::GetTimeNowMicroSecond()) - baselineStart; + + // the delta should be equal to the tickOverride + EXPECT_EQ(delta, AZ::TimeMsToUs(tickOverride)); + + // real tick delta should be near the baselineDelta + const AZ::TimeUs realDeltaTime = m_timeSystem->GetRealTickDeltaTimeUs(); + const AZ::TimeUs diff = GetDiff(realDeltaTime, baselineDelta); + EXPECT_LT(diff, AZ::TimeUs{ 10 }); + + // reset the tick delta override + m_timeSystem->SetSimulationTickDeltaOverride(AZ::Time::ZeroTimeMs); + } +} // namespace UnitTest From d5b9cf10cf0019ebd97f5b7f150dc7a6745e3c89 Mon Sep 17 00:00:00 2001 From: bosnichd Date: Mon, 20 Dec 2021 08:15:10 -0700 Subject: [PATCH 204/948] Collection of miscellaneous PAL changes required for restricted platforms. (#6482) Signed-off-by: bosnichd --- .../CrySystem/RemoteConsole/RemoteConsole.h | 2 +- .../RemoteConsole/RemoteConsole_none.inl | 10 +++--- .../Code/Source/Editor/EditorCommon.cpp | 4 +++ .../Source/Editor/ShaderBuilderUtility.cpp | 8 +++++ Gems/Atom/Feature/Common/Code/CMakeLists.txt | 10 ++++-- .../DiffuseProbeGridBlendDistancePass.cpp | 11 ++++++- .../DiffuseProbeGridBlendIrradiancePass.cpp | 11 ++++++- .../DiffuseProbeGridBorderUpdatePass.cpp | 31 ++++++++++++------- .../DiffuseProbeGridClassificationPass.cpp | 11 ++++++- .../DiffuseProbeGridRayTracingPass.cpp | 5 +-- .../DiffuseProbeGridRelocationPass.cpp | 11 ++++++- .../DiffuseProbeGridRenderPass.cpp | 8 +++++ .../Common/Code/Source/ImGui/ImGuiPass.cpp | 4 +++ .../Android/Atom_Feature_Traits_Android.h | 1 + .../Linux/Atom_Feature_Traits_Linux.h | 1 + .../Platform/Mac/Atom_Feature_Traits_Mac.h | 1 + .../Windows/Atom_Feature_Traits_Windows.h | 1 + .../Platform/iOS/Atom_Feature_Traits_iOS.h | 1 + .../Include/Atom/RHI/MemorySubAllocator.h | 5 ++- .../Source/Platform/Windows/PAL_windows.cmake | 7 +++++ ...ShaderPlatformInterfaceSystemComponent.cpp | 18 +++++------ Gems/Atom/RHI/gem.json | 1 + .../AtomBridge/Code/CMakeLists.txt | 10 +++++- Gems/ImGui/Code/Source/ImGuiManager.cpp | 4 ++- Registry/bootstrap.setreg | 1 + 25 files changed, 140 insertions(+), 37 deletions(-) diff --git a/Code/Legacy/CrySystem/RemoteConsole/RemoteConsole.h b/Code/Legacy/CrySystem/RemoteConsole/RemoteConsole.h index 23edafa736..f075dd2c17 100644 --- a/Code/Legacy/CrySystem/RemoteConsole/RemoteConsole.h +++ b/Code/Legacy/CrySystem/RemoteConsole/RemoteConsole.h @@ -15,7 +15,7 @@ #include #include -#if !defined(RELEASE) || defined(RELEASE_LOGGING) || defined(ENABLE_PROFILING_CODE) +#if (!defined(RELEASE) || defined(RELEASE_LOGGING) || defined(ENABLE_PROFILING_CODE)) && !defined(AZ_LEGACY_CRYSYSTEM_TRAIT_REMOTE_CONSOLE_UNSUPPORTED) #define USE_REMOTE_CONSOLE struct SRemoteServer; diff --git a/Code/Legacy/CrySystem/RemoteConsole/RemoteConsole_none.inl b/Code/Legacy/CrySystem/RemoteConsole/RemoteConsole_none.inl index faf928a377..ae96fc112a 100644 --- a/Code/Legacy/CrySystem/RemoteConsole/RemoteConsole_none.inl +++ b/Code/Legacy/CrySystem/RemoteConsole/RemoteConsole_none.inl @@ -41,17 +41,17 @@ void CRemoteConsole::Stop() } ///////////////////////////////////////////////////////////////////////////////////////////// -void CRemoteConsole::AddLogMessage(const char* log) +void CRemoteConsole::AddLogMessage(const char*) { } ///////////////////////////////////////////////////////////////////////////////////////////// -void CRemoteConsole::AddLogWarning(const char* log) +void CRemoteConsole::AddLogWarning(const char*) { } ///////////////////////////////////////////////////////////////////////////////////////////// -void CRemoteConsole::AddLogError(const char* log) +void CRemoteConsole::AddLogError(const char*) { } @@ -61,11 +61,11 @@ void CRemoteConsole::Update() } ///////////////////////////////////////////////////////////////////////////////////////////// -void CRemoteConsole::RegisterListener(IRemoteConsoleListener* pListener, const char* name) +void CRemoteConsole::RegisterListener(IRemoteConsoleListener*, const char*) { } ///////////////////////////////////////////////////////////////////////////////////////////// -void CRemoteConsole::UnregisterListener(IRemoteConsoleListener* pListener) +void CRemoteConsole::UnregisterListener(IRemoteConsoleListener*) { } diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Editor/EditorCommon.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Editor/EditorCommon.cpp index 3e255dcccc..f9fe1b791f 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Editor/EditorCommon.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Editor/EditorCommon.cpp @@ -123,6 +123,10 @@ namespace ImageProcessingAtomEditor { readableString = "iOS"; } + else if (platformStrLowerCase == "salem") + { + readableString = "Salem"; + } else if (platformStrLowerCase == "jasper") { readableString = "Jasper"; diff --git a/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderBuilderUtility.cpp b/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderBuilderUtility.cpp index e6c99630b2..911981142b 100644 --- a/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderBuilderUtility.cpp +++ b/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderBuilderUtility.cpp @@ -492,6 +492,14 @@ namespace AZ { platformId = AzFramework::PlatformId::IOS; } + else if (platformIdentifier == "salem") + { + platformId = AzFramework::PlatformId::SALEM; + } + else if (platformIdentifier == "jasper") + { + platformId = AzFramework::PlatformId::JASPER; + } else if (platformIdentifier == "server") { platformId = AzFramework::PlatformId::SERVER; diff --git a/Gems/Atom/Feature/Common/Code/CMakeLists.txt b/Gems/Atom/Feature/Common/Code/CMakeLists.txt index b558be3714..3ebb9df104 100644 --- a/Gems/Atom/Feature/Common/Code/CMakeLists.txt +++ b/Gems/Atom/Feature/Common/Code/CMakeLists.txt @@ -96,6 +96,12 @@ ly_add_target( if(PAL_TRAIT_BUILD_HOST_TOOLS) + set(runtime_dependencies_tools ${pal_source_dir}/runtime_dependencies_tools.cmake) + foreach(pal_tools_platform ${LY_PAL_TOOLS_ENABLED}) + ly_get_list_relative_pal_filename(pal_runtime_dependencies_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${pal_tools_platform}) + list(APPEND runtime_dependencies_tools ${pal_runtime_dependencies_source_dir}/runtime_dependencies_tools.cmake) + endforeach() + ly_add_target( NAME Atom_Feature_Common.Editor GEM_MODULE @@ -103,7 +109,7 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) FILES_CMAKE atom_feature_common_editor_files.cmake PLATFORM_INCLUDE_FILES - ${pal_source_dir}/runtime_dependencies_tools.cmake + ${runtime_dependencies_tools} INCLUDE_DIRECTORIES PRIVATE . @@ -136,7 +142,7 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) FILES_CMAKE atom_feature_common_builders_files.cmake PLATFORM_INCLUDE_FILES - ${pal_source_dir}/runtime_dependencies_tools.cmake + ${runtime_dependencies_tools} INCLUDE_DIRECTORIES PRIVATE Source/Builders diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistancePass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistancePass.cpp index 0cdc4d14b1..702e784c86 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistancePass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistancePass.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -30,7 +31,15 @@ namespace AZ DiffuseProbeGridBlendDistancePass::DiffuseProbeGridBlendDistancePass(const RPI::PassDescriptor& descriptor) : RPI::RenderPass(descriptor) { - LoadShader(); + if (!AZ_TRAIT_DIFFUSE_GI_PASSES_SUPPORTED) + { + // GI is not supported on this platform + SetEnabled(false); + } + else + { + LoadShader(); + } } void DiffuseProbeGridBlendDistancePass::LoadShader() diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiancePass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiancePass.cpp index e0a4f1ae42..7609e27b66 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiancePass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiancePass.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -30,7 +31,15 @@ namespace AZ DiffuseProbeGridBlendIrradiancePass::DiffuseProbeGridBlendIrradiancePass(const RPI::PassDescriptor& descriptor) : RPI::RenderPass(descriptor) { - LoadShader(); + if (!AZ_TRAIT_DIFFUSE_GI_PASSES_SUPPORTED) + { + // GI is not supported on this platform + SetEnabled(false); + } + else + { + LoadShader(); + } } void DiffuseProbeGridBlendIrradiancePass::LoadShader() diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdatePass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdatePass.cpp index 6c72f904b9..c4fcb49c17 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdatePass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdatePass.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -30,17 +31,25 @@ namespace AZ DiffuseProbeGridBorderUpdatePass::DiffuseProbeGridBorderUpdatePass(const RPI::PassDescriptor& descriptor) : RPI::RenderPass(descriptor) { - LoadShader("Shaders/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdateRow.azshader", - m_rowShader, - m_rowPipelineState, - m_rowSrgLayout, - m_rowDispatchArgs); - - LoadShader("Shaders/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdateColumn.azshader", - m_columnShader, - m_columnPipelineState, - m_columnSrgLayout, - m_columnDispatchArgs); + if (!AZ_TRAIT_DIFFUSE_GI_PASSES_SUPPORTED) + { + // GI is not supported on this platform + SetEnabled(false); + } + else + { + LoadShader("Shaders/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdateRow.azshader", + m_rowShader, + m_rowPipelineState, + m_rowSrgLayout, + m_rowDispatchArgs); + + LoadShader("Shaders/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdateColumn.azshader", + m_columnShader, + m_columnPipelineState, + m_columnSrgLayout, + m_columnDispatchArgs); + } } void DiffuseProbeGridBorderUpdatePass::LoadShader(AZStd::string shaderFilePath, diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridClassificationPass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridClassificationPass.cpp index a6e5fd03ff..7394b1ccfb 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridClassificationPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridClassificationPass.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -34,7 +35,15 @@ namespace AZ DiffuseProbeGridClassificationPass::DiffuseProbeGridClassificationPass(const RPI::PassDescriptor& descriptor) : RPI::RenderPass(descriptor) { - LoadShader(); + if (!AZ_TRAIT_DIFFUSE_GI_PASSES_SUPPORTED) + { + // GI is not supported on this platform + SetEnabled(false); + } + else + { + LoadShader(); + } } void DiffuseProbeGridClassificationPass::LoadShader() diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRayTracingPass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRayTracingPass.cpp index abee3693f8..df551e7f42 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRayTracingPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRayTracingPass.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -38,9 +39,9 @@ namespace AZ : RPI::RenderPass(descriptor) { RHI::Ptr device = RHI::RHISystemInterface::Get()->GetDevice(); - if (device->GetFeatures().m_rayTracing == false) + if (device->GetFeatures().m_rayTracing == false || !AZ_TRAIT_DIFFUSE_GI_PASSES_SUPPORTED) { - // raytracing is not supported on this platform + // raytracing or GI is not supported on this platform SetEnabled(false); } } diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRelocationPass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRelocationPass.cpp index e35686d343..fd23dadf6f 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRelocationPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRelocationPass.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -34,7 +35,15 @@ namespace AZ DiffuseProbeGridRelocationPass::DiffuseProbeGridRelocationPass(const RPI::PassDescriptor& descriptor) : RPI::RenderPass(descriptor) { - LoadShader(); + if (!AZ_TRAIT_DIFFUSE_GI_PASSES_SUPPORTED) + { + // GI is not supported on this platform + SetEnabled(false); + } + else + { + LoadShader(); + } } void DiffuseProbeGridRelocationPass::LoadShader() diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRenderPass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRenderPass.cpp index fb674673fa..f444c0c6ba 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRenderPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRenderPass.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -27,6 +28,13 @@ namespace AZ DiffuseProbeGridRenderPass::DiffuseProbeGridRenderPass(const RPI::PassDescriptor& descriptor) : Base(descriptor) { + if (!AZ_TRAIT_DIFFUSE_GI_PASSES_SUPPORTED) + { + // GI is not supported on this platform + SetEnabled(false); + return; + } + // create the shader resource group // Note: the shader may not be available on all platforms AZStd::string shaderFilePath = "Shaders/DiffuseGlobalIllumination/DiffuseProbeGridRender.azshader"; diff --git a/Gems/Atom/Feature/Common/Code/Source/ImGui/ImGuiPass.cpp b/Gems/Atom/Feature/Common/Code/Source/ImGui/ImGuiPass.cpp index 5dcb0dc2bb..8ba92a3317 100644 --- a/Gems/Atom/Feature/Common/Code/Source/ImGui/ImGuiPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/ImGui/ImGuiPass.cpp @@ -27,6 +27,7 @@ #include #include +#include #include namespace AZ @@ -460,6 +461,9 @@ namespace AZ { auto imguiContextScope = ImguiContextScope(m_imguiContext); auto& io = ImGui::GetIO(); + #if defined(AZ_TRAIT_IMGUI_INI_FILENAME) + io.IniFilename = AZ_TRAIT_IMGUI_INI_FILENAME; + #endif // ImGui IO Setup { diff --git a/Gems/Atom/Feature/Common/Code/Source/Platform/Android/Atom_Feature_Traits_Android.h b/Gems/Atom/Feature/Common/Code/Source/Platform/Android/Atom_Feature_Traits_Android.h index 81f41bd8c9..f2501f3366 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Platform/Android/Atom_Feature_Traits_Android.h +++ b/Gems/Atom/Feature/Common/Code/Source/Platform/Android/Atom_Feature_Traits_Android.h @@ -9,3 +9,4 @@ #define AZ_TRAIT_LUXCORE_SUPPORTED 0 #define AZ_TRAIT_LUXCORE_EXEPATH UNUSED_TRAIT +#define AZ_TRAIT_DIFFUSE_GI_PASSES_SUPPORTED 1 diff --git a/Gems/Atom/Feature/Common/Code/Source/Platform/Linux/Atom_Feature_Traits_Linux.h b/Gems/Atom/Feature/Common/Code/Source/Platform/Linux/Atom_Feature_Traits_Linux.h index 81f41bd8c9..f2501f3366 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Platform/Linux/Atom_Feature_Traits_Linux.h +++ b/Gems/Atom/Feature/Common/Code/Source/Platform/Linux/Atom_Feature_Traits_Linux.h @@ -9,3 +9,4 @@ #define AZ_TRAIT_LUXCORE_SUPPORTED 0 #define AZ_TRAIT_LUXCORE_EXEPATH UNUSED_TRAIT +#define AZ_TRAIT_DIFFUSE_GI_PASSES_SUPPORTED 1 diff --git a/Gems/Atom/Feature/Common/Code/Source/Platform/Mac/Atom_Feature_Traits_Mac.h b/Gems/Atom/Feature/Common/Code/Source/Platform/Mac/Atom_Feature_Traits_Mac.h index 81f41bd8c9..f2501f3366 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Platform/Mac/Atom_Feature_Traits_Mac.h +++ b/Gems/Atom/Feature/Common/Code/Source/Platform/Mac/Atom_Feature_Traits_Mac.h @@ -9,3 +9,4 @@ #define AZ_TRAIT_LUXCORE_SUPPORTED 0 #define AZ_TRAIT_LUXCORE_EXEPATH UNUSED_TRAIT +#define AZ_TRAIT_DIFFUSE_GI_PASSES_SUPPORTED 1 diff --git a/Gems/Atom/Feature/Common/Code/Source/Platform/Windows/Atom_Feature_Traits_Windows.h b/Gems/Atom/Feature/Common/Code/Source/Platform/Windows/Atom_Feature_Traits_Windows.h index c35b6f0960..71c521a7f2 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Platform/Windows/Atom_Feature_Traits_Windows.h +++ b/Gems/Atom/Feature/Common/Code/Source/Platform/Windows/Atom_Feature_Traits_Windows.h @@ -9,3 +9,4 @@ #define AZ_TRAIT_LUXCORE_SUPPORTED 0 #define AZ_TRAIT_LUXCORE_EXEPATH "Gems/Atom/Feature/Common/External/LuxCore2.2/win64/dll/luxcoreui.exe" +#define AZ_TRAIT_DIFFUSE_GI_PASSES_SUPPORTED 1 diff --git a/Gems/Atom/Feature/Common/Code/Source/Platform/iOS/Atom_Feature_Traits_iOS.h b/Gems/Atom/Feature/Common/Code/Source/Platform/iOS/Atom_Feature_Traits_iOS.h index 81f41bd8c9..f2501f3366 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Platform/iOS/Atom_Feature_Traits_iOS.h +++ b/Gems/Atom/Feature/Common/Code/Source/Platform/iOS/Atom_Feature_Traits_iOS.h @@ -9,3 +9,4 @@ #define AZ_TRAIT_LUXCORE_SUPPORTED 0 #define AZ_TRAIT_LUXCORE_EXEPATH UNUSED_TRAIT +#define AZ_TRAIT_DIFFUSE_GI_PASSES_SUPPORTED 1 diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/MemorySubAllocator.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/MemorySubAllocator.h index 514907b19e..580ca97b46 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/MemorySubAllocator.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/MemorySubAllocator.h @@ -91,7 +91,10 @@ namespace AZ m_pageAllocator = &pageAllocator; m_descriptor = descriptor; m_descriptor.m_addressBase = 0; - m_descriptor.m_capacityInBytes = m_pageAllocator->GetPageSize(); + if (m_descriptor.m_capacityInBytes == 0) + { + m_descriptor.m_capacityInBytes = m_pageAllocator->GetPageSize(); + } } template diff --git a/Gems/Atom/RHI/DX12/Code/Source/Platform/Windows/PAL_windows.cmake b/Gems/Atom/RHI/DX12/Code/Source/Platform/Windows/PAL_windows.cmake index eb733a4d5a..1ee87e3099 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/Platform/Windows/PAL_windows.cmake +++ b/Gems/Atom/RHI/DX12/Code/Source/Platform/Windows/PAL_windows.cmake @@ -33,6 +33,13 @@ if(aftermath_header) set(PAL_TRAIT_AFTERMATH_AVAILABLE TRUE) endif() +ly_add_source_properties( + SOURCES + Source/RHI.Builders/ShaderPlatformInterfaceSystemComponent.cpp + PROPERTY COMPILE_DEFINITIONS + VALUES ${LY_PAL_TOOLS_DEFINES} +) + # Disable windows OS version check until infra can upgrade all our jenkins nodes # if(NOT CMAKE_SYSTEM_VERSION VERSION_GREATER_EQUAL "10.0.17763") # message(FATAL_ERROR "Windows DX12 RHI implementation requires an OS version and SDK matching windows 10 build 1809 or greater") diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI.Builders/ShaderPlatformInterfaceSystemComponent.cpp b/Gems/Atom/RHI/DX12/Code/Source/RHI.Builders/ShaderPlatformInterfaceSystemComponent.cpp index 18834bdf46..3912fbed80 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI.Builders/ShaderPlatformInterfaceSystemComponent.cpp +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI.Builders/ShaderPlatformInterfaceSystemComponent.cpp @@ -15,15 +15,15 @@ #include #if defined(AZ_TOOLS_EXPAND_FOR_RESTRICTED_PLATFORMS) - #if defined(TOOLS_SUPPORT_JASPER) - #include - #endif - #if defined(TOOLS_SUPPORT_PROVO) - #include - #endif - #if defined(TOOLS_SUPPORT_SALEM) - #include - #endif +# if defined(TOOLS_SUPPORT_JASPER) +# include AZ_RESTRICTED_FILE_EXPLICIT(RHI.Builders/ShaderPlatformInterface, Jasper) +# endif +# if defined(TOOLS_SUPPORT_PROVO) +# include AZ_RESTRICTED_FILE_EXPLICIT(RHI.Builders/ShaderPlatformInterface, Provo) +# endif +# if defined(TOOLS_SUPPORT_SALEM) +# include AZ_RESTRICTED_FILE_EXPLICIT(RHI.Builders/ShaderPlatformInterface, Salem) +# endif #endif #include diff --git a/Gems/Atom/RHI/gem.json b/Gems/Atom/RHI/gem.json index 7b64476c65..de46c312ad 100644 --- a/Gems/Atom/RHI/gem.json +++ b/Gems/Atom/RHI/gem.json @@ -15,6 +15,7 @@ "Atom_RHI_DX12", "Atom_RHI_Metal", "Atom_RHI_Vulkan", + "Atom_RHI_Salem", "Atom_RHI_Null", "Atom_Feature_Common" ] diff --git a/Gems/AtomLyIntegration/AtomBridge/Code/CMakeLists.txt b/Gems/AtomLyIntegration/AtomBridge/Code/CMakeLists.txt index e53a0c6281..67f28767e0 100644 --- a/Gems/AtomLyIntegration/AtomBridge/Code/CMakeLists.txt +++ b/Gems/AtomLyIntegration/AtomBridge/Code/CMakeLists.txt @@ -68,6 +68,14 @@ ly_create_alias(NAME Atom_AtomBridge.Clients NAMESPACE Gem TARGETS Gem::Atom_Ato ly_create_alias(NAME Atom_AtomBridge.Servers NAMESPACE Gem TARGETS Gem::Atom_AtomBridge) if(PAL_TRAIT_BUILD_HOST_TOOLS) + + set(additional_tool_deps ${pal_dir}/additional_${PAL_PLATFORM_NAME_LOWERCASE}_tool_deps.cmake) + foreach(pal_tools_platform ${LY_PAL_TOOLS_ENABLED}) + string(TOLOWER ${pal_tools_platform} pal_tools_platform_lowercase) + ly_get_list_relative_pal_filename(pal_runtime_dependencies_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${pal_tools_platform}) + list(APPEND additional_tool_deps ${pal_runtime_dependencies_source_dir}/additional_${pal_tools_platform_lowercase}_tool_deps.cmake) + endforeach() + ly_add_target( NAME Atom_AtomBridge.Editor ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE} NAMESPACE Gem @@ -79,7 +87,7 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) PUBLIC Include PLATFORM_INCLUDE_FILES - ${pal_dir}/additional_${PAL_PLATFORM_NAME_LOWERCASE}_tool_deps.cmake + ${additional_tool_deps} COMPILE_DEFINITIONS PRIVATE EDITOR diff --git a/Gems/ImGui/Code/Source/ImGuiManager.cpp b/Gems/ImGui/Code/Source/ImGuiManager.cpp index 4f49fd6509..4b841a7b1e 100644 --- a/Gems/ImGui/Code/Source/ImGuiManager.cpp +++ b/Gems/ImGui/Code/Source/ImGuiManager.cpp @@ -115,7 +115,9 @@ void ImGuiManager::Initialize() // Set config file ImGuiIO& io = ImGui::GetIO(); - io.IniFilename = "imgui.ini"; +#if defined(IMGUI_DISABLE_AUTOMATIC_INI_SAVING_LOADING) + io.IniFilename = nullptr; +#endif // Enable Nav Keyboard by default and allow io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; diff --git a/Registry/bootstrap.setreg b/Registry/bootstrap.setreg index b2bcdd7f3f..5fdb8e0941 100644 --- a/Registry/bootstrap.setreg +++ b/Registry/bootstrap.setreg @@ -12,6 +12,7 @@ "android_assets": "android", "ios_assets": "ios", "mac_assets": "mac", + "salem_assets": "salem", "allowed_list": "", "remote_ip": "127.0.0.1", "remote_port": 45643, From bb14675db718f474ecc79a5b7957efe45dc6dfb6 Mon Sep 17 00:00:00 2001 From: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> Date: Mon, 20 Dec 2021 16:53:41 +0000 Subject: [PATCH 205/948] Fix tests Debug (#6405) Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> --- .../AzToolsFramework/Tests/UI/AssetBrowserTests.cpp | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/Code/Framework/AzToolsFramework/Tests/UI/AssetBrowserTests.cpp b/Code/Framework/AzToolsFramework/Tests/UI/AssetBrowserTests.cpp index ae5ea5f0ae..5173e40c63 100644 --- a/Code/Framework/AzToolsFramework/Tests/UI/AssetBrowserTests.cpp +++ b/Code/Framework/AzToolsFramework/Tests/UI/AssetBrowserTests.cpp @@ -74,10 +74,6 @@ namespace UnitTest AZStd::unique_ptr m_filterModel; AZStd::unique_ptr m_tableModel; - AZStd::unique_ptr m_modelTesterAssetBrowser; - AZStd::unique_ptr m_modelTesterFilterModel; - AZStd::unique_ptr m_modelTesterTableModel; - QVector m_folderIds = { 13, 14, 15 }; QVector m_sourceIDs = { 1, 2, 3, 4, 5 }; QVector m_productIDs = { 1, 2, 3, 4, 5 }; @@ -96,9 +92,6 @@ namespace UnitTest m_filterModel->setSourceModel(m_assetBrowserComponent->GetAssetBrowserModel()); m_tableModel->setSourceModel(m_filterModel.get()); - m_modelTesterAssetBrowser = AZStd::make_unique(m_assetBrowserComponent->GetAssetBrowserModel()); - m_modelTesterFilterModel = AZStd::make_unique(m_filterModel.get()); - m_modelTesterTableModel = AZStd::make_unique(m_tableModel.get()); m_searchWidget = AZStd::make_unique(); // Setup String filters @@ -110,10 +103,6 @@ namespace UnitTest void AssetBrowserTest::TearDownEditorFixtureImpl() { - m_modelTesterAssetBrowser.reset(); - m_modelTesterFilterModel.reset(); - m_modelTesterTableModel.reset(); - m_tableModel.reset(); m_filterModel.reset(); m_assetBrowserComponent->Deactivate(); From 7cce6dde41febbe6bdf8b3ac077e292ede9402d7 Mon Sep 17 00:00:00 2001 From: tjmgd <92784061+tjmgd@users.noreply.github.com> Date: Mon, 20 Dec 2021 20:09:00 +0000 Subject: [PATCH 206/948] Hide the invalid parameters in the EnhancedPBR in the Material Editor (#6298) * Hide the invalid parameters in the EnhancedPBR in the Material Editor Signed-off-by: T.J. McGrath-Daly * Fixed headers Signed-off-by: T.J. McGrath-Daly --- .../Materials/Types/EnhancedPBR.materialtype | 6 +++ .../Types/EnhancedPBR_Anisotropy.lua | 41 +++++++++++++++++++ .../Assets/Materials/Types/Skin.materialtype | 6 +++ .../Materials/Types/Skin_SpecularF0.lua | 30 ++++++++++++++ .../Types/StandardPBR_ClearCoatState.lua | 11 +++++ .../Types/StandardPBR_HandleOpacityMode.lua | 4 ++ 6 files changed, 98 insertions(+) create mode 100644 Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_Anisotropy.lua create mode 100644 Gems/Atom/Feature/Common/Assets/Materials/Types/Skin_SpecularF0.lua diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype index 5de756067a..d4b5882f21 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype @@ -1652,6 +1652,12 @@ "file": "EnhancedPBR_SubsurfaceState.lua" } }, + { + "type": "Lua", + "args": { + "file": "EnhancedPBR_Anisotropy.lua" + } + }, { "type": "Lua", "args": { diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_Anisotropy.lua b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_Anisotropy.lua new file mode 100644 index 0000000000..575a3a3d5e --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_Anisotropy.lua @@ -0,0 +1,41 @@ +-------------------------------------------------------------------------------------- +-- +-- Copyright (c) Contributors to the Open 3D Engine Project. +-- For complete copyright and license terms please see the LICENSE at the root of this distribution. +-- +-- SPDX-License-Identifier: Apache-2.0 OR MIT +-- +-- +-- +---------------------------------------------------------------------------------------------------- + +function GetMaterialPropertyDependencies() + return { + "anisotropy.enableAnisotropy" + , "anisotropy.factor" + , "anisotropy.anisotropyAngle" + } +end + +function GetShaderOptionDependencies() + return {"o_enableAnisotropy"} +end + +function Process(context) + local enableAnisotropy = context:GetMaterialPropertyValue_bool("anisotropy.enableAnisotropy") +end + +function ProcessEditor(context) + + local enableAnisotropy = context:GetMaterialPropertyValue_bool("anisotropy.enableAnisotropy") + + local visibility + if(enableAnisotropy) then + visibility = MaterialPropertyVisibility_Enabled + else + visibility = MaterialPropertyVisibility_Hidden + end + + context:SetMaterialPropertyVisibility("anisotropy.factor", visibility) + context:SetMaterialPropertyVisibility("anisotropy.anisotropyAngle", visibility) +end diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype index e2a05aa916..a49eba7975 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype @@ -1084,6 +1084,12 @@ "file": "Skin_WrinkleMaps.lua" } }, + { + "type": "Lua", + "args": { + "file": "Skin_SpecularF0.lua" + } + }, { "type": "Lua", "args": { diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin_SpecularF0.lua b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin_SpecularF0.lua new file mode 100644 index 0000000000..d727e8f301 --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin_SpecularF0.lua @@ -0,0 +1,30 @@ +-------------------------------------------------------------------------------------- +-- +-- Copyright (c) Contributors to the Open 3D Engine Project. +-- For complete copyright and license terms please see the LICENSE at the root of this distribution. +-- +-- SPDX-License-Identifier: Apache-2.0 OR MIT +-- +-- +-- +---------------------------------------------------------------------------------------------------- + +function GetMaterialPropertyDependencies() + return { + "specularF0.enableMultiScatterCompensation" + } +end + +function GetShaderOptionDependencies() + return { + "o_specularF0_enableMultiScatterCompensation" + } +end + +function Process(context) + local enableMultiScatterCompensation = context:GetMaterialPropertyValue_bool("specularF0.enableMultiScatterCompensation") +end + +function ProcessEditor(context) + context:SetMaterialPropertyVisibility("specularF0.enableMultiScatterCompensation", MaterialPropertyVisibility_Hidden) +end \ No newline at end of file diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ClearCoatState.lua b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ClearCoatState.lua index 3d7eca134e..50644adef4 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ClearCoatState.lua +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ClearCoatState.lua @@ -58,6 +58,15 @@ function UpdateTextureDependentPropertyVisibility(context, textureMapPropertyNam end end +function UpdateNormalStrengthPropertyVisibility(context, textureMapPropertyName, useTexturePropertyName) + local textureMap = context:GetMaterialPropertyValue_Image(textureMapPropertyName) + local useTexture = context:GetMaterialPropertyValue_bool(useTexturePropertyName) + + if(textureMap == nil) or (not useTexture) then + context:SetMaterialPropertyVisibility("clearCoat.normalStrength", MaterialPropertyVisibility_Hidden) + end +end + function ProcessEditor(context) local enable = context:GetMaterialPropertyValue_bool("clearCoat.enable") @@ -79,10 +88,12 @@ function ProcessEditor(context) context:SetMaterialPropertyVisibility("clearCoat.normalMap", mainVisibility) context:SetMaterialPropertyVisibility("clearCoat.useNormalMap", mainVisibility) context:SetMaterialPropertyVisibility("clearCoat.normalMapUv", mainVisibility) + context:SetMaterialPropertyVisibility("clearCoat.normalStrength", mainVisibility) if(enable) then UpdateTextureDependentPropertyVisibility(context, "clearCoat.influenceMap", "clearCoat.useInfluenceMap", "clearCoat.influenceMapUv") UpdateTextureDependentPropertyVisibility(context, "clearCoat.roughnessMap", "clearCoat.useRoughnessMap", "clearCoat.roughnessMapUv") UpdateTextureDependentPropertyVisibility(context, "clearCoat.normalMap", "clearCoat.useNormalMap", "clearCoat.normalMapUv") + UpdateNormalStrengthPropertyVisibility(context, "clearCoat.normalMap", "clearCoat.useNormalMap") end end 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 9315131e44..462d433d34 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_HandleOpacityMode.lua +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_HandleOpacityMode.lua @@ -91,6 +91,10 @@ function ProcessEditor(context) if(mainVisibility == MaterialPropertyVisibility_Enabled) then local alphaSource = context:GetMaterialPropertyValue_enum("opacity.alphaSource") + if (opacityMode == OpacityMode_Cutout and alphaSource == AlphaSource_None) then + context:SetMaterialPropertyVisibility("opacity.factor", MaterialPropertyVisibility_Hidden) + end + if(alphaSource ~= AlphaSource_Split) then context:SetMaterialPropertyVisibility("opacity.textureMap", MaterialPropertyVisibility_Hidden) context:SetMaterialPropertyVisibility("opacity.textureMapUv", MaterialPropertyVisibility_Hidden) From 9ee60e6eba56a9b419b21c809a69ad975a843236 Mon Sep 17 00:00:00 2001 From: Junbo Liang <68558268+junbo75@users.noreply.github.com> Date: Mon, 20 Dec 2021 12:15:52 -0800 Subject: [PATCH 207/948] AWSI automation tests support on Linux (#6278) * AWSI automation tests support on Linux Signed-off-by: Junbo Liang <68558268+junbo75@users.noreply.github.com> --- .../Gem/PythonTests/AWS/CMakeLists.txt | 4 +- .../Gem/PythonTests/AWS/README.md | 63 +- .../AWS/Windows/aws_metrics/__init__.py | 6 - .../{Windows/core => aws_metrics}/__init__.py | 0 .../aws_metrics_automation_test.py | 578 ++++++------- .../aws_metrics/aws_metrics_custom_thread.py | 58 +- .../aws_metrics/aws_metrics_utils.py | 478 +++++------ .../aws_metrics/aws_metrics_waiters.py | 278 +++---- .../AWS/{Windows => client_auth}/__init__.py | 0 .../aws_client_auth_automation_test.py | 8 +- .../{Windows/client_auth => core}/__init__.py | 1 - .../core/test_aws_resource_interaction.py | 2 +- .../Levels/AWS/ClientAuth/ClientAuth.ly | 3 - .../Levels/AWS/ClientAuth/ClientAuth.prefab | 620 ++++++++++++++ .../Levels/AWS/ClientAuth/filelist.xml | 6 - .../Levels/AWS/ClientAuth/level.pak | 3 - .../ClientAuthPasswordSignIn.ly | 3 - .../ClientAuthPasswordSignIn.prefab | 620 ++++++++++++++ .../AWS/ClientAuthPasswordSignIn/filelist.xml | 6 - .../AWS/ClientAuthPasswordSignIn/level.pak | 3 - .../ClientAuthPasswordSignUp.ly | 3 - .../ClientAuthPasswordSignUp.prefab | 620 ++++++++++++++ .../AWS/ClientAuthPasswordSignUp/filelist.xml | 6 - .../AWS/ClientAuthPasswordSignUp/level.pak | 3 - AutomatedTesting/Levels/AWS/Core/Core.ly | 3 - AutomatedTesting/Levels/AWS/Core/Core.prefab | 758 ++++++++++++++++++ AutomatedTesting/Levels/AWS/Core/filelist.xml | 6 - AutomatedTesting/Levels/AWS/Core/level.pak | 3 - .../Levels/AWS/Metrics/Metrics.ly | 3 - .../Levels/AWS/Metrics/Metrics.prefab | 627 +++++++++++++++ .../Levels/AWS/Metrics/filelist.xml | 6 - AutomatedTesting/Levels/AWS/Metrics/level.pak | 3 - .../Platform/Linux/deploy_cdk_applications.sh | 106 +++ .../Linux/destroy_cdk_applications.sh | 96 +++ 34 files changed, 4197 insertions(+), 786 deletions(-) delete mode 100644 AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/__init__.py rename AutomatedTesting/Gem/PythonTests/AWS/{Windows/core => aws_metrics}/__init__.py (100%) rename AutomatedTesting/Gem/PythonTests/AWS/{Windows => }/aws_metrics/aws_metrics_automation_test.py (96%) rename AutomatedTesting/Gem/PythonTests/AWS/{Windows => }/aws_metrics/aws_metrics_custom_thread.py (96%) rename AutomatedTesting/Gem/PythonTests/AWS/{Windows => }/aws_metrics/aws_metrics_utils.py (97%) rename AutomatedTesting/Gem/PythonTests/AWS/{Windows => }/aws_metrics/aws_metrics_waiters.py (96%) rename AutomatedTesting/Gem/PythonTests/AWS/{Windows => client_auth}/__init__.py (100%) rename AutomatedTesting/Gem/PythonTests/AWS/{Windows => }/client_auth/aws_client_auth_automation_test.py (94%) rename AutomatedTesting/Gem/PythonTests/AWS/{Windows/client_auth => core}/__init__.py (99%) rename AutomatedTesting/Gem/PythonTests/AWS/{Windows => }/core/test_aws_resource_interaction.py (99%) delete mode 100644 AutomatedTesting/Levels/AWS/ClientAuth/ClientAuth.ly create mode 100644 AutomatedTesting/Levels/AWS/ClientAuth/ClientAuth.prefab delete mode 100644 AutomatedTesting/Levels/AWS/ClientAuth/filelist.xml delete mode 100644 AutomatedTesting/Levels/AWS/ClientAuth/level.pak delete mode 100644 AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/ClientAuthPasswordSignIn.ly create mode 100644 AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/ClientAuthPasswordSignIn.prefab delete mode 100644 AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/filelist.xml delete mode 100644 AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/level.pak delete mode 100644 AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/ClientAuthPasswordSignUp.ly create mode 100644 AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/ClientAuthPasswordSignUp.prefab delete mode 100644 AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/filelist.xml delete mode 100644 AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/level.pak delete mode 100644 AutomatedTesting/Levels/AWS/Core/Core.ly create mode 100644 AutomatedTesting/Levels/AWS/Core/Core.prefab delete mode 100644 AutomatedTesting/Levels/AWS/Core/filelist.xml delete mode 100644 AutomatedTesting/Levels/AWS/Core/level.pak delete mode 100644 AutomatedTesting/Levels/AWS/Metrics/Metrics.ly create mode 100644 AutomatedTesting/Levels/AWS/Metrics/Metrics.prefab delete mode 100644 AutomatedTesting/Levels/AWS/Metrics/filelist.xml delete mode 100644 AutomatedTesting/Levels/AWS/Metrics/level.pak create mode 100755 scripts/build/Platform/Linux/deploy_cdk_applications.sh create mode 100755 scripts/build/Platform/Linux/destroy_cdk_applications.sh diff --git a/AutomatedTesting/Gem/PythonTests/AWS/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/AWS/CMakeLists.txt index 2a5e1d7cab..d6740152a7 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/AWS/CMakeLists.txt @@ -13,7 +13,8 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) # Only enable AWS automated tests on Windows - if(NOT "${PAL_PLATFORM_NAME}" STREQUAL "Windows") + set(SUPPORTED_PLATFORMS "Windows" "Linux") + if (NOT "${PAL_PLATFORM_NAME}" IN_LIST SUPPORTED_PLATFORMS) return() endif() @@ -23,7 +24,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) TEST_SERIAL PATH ${CMAKE_CURRENT_LIST_DIR}/${PAL_PLATFORM_NAME}/ RUNTIME_DEPENDENCIES - Legacy::Editor AZ::AssetProcessor AutomatedTesting.GameLauncher AutomatedTesting.Assets diff --git a/AutomatedTesting/Gem/PythonTests/AWS/README.md b/AutomatedTesting/Gem/PythonTests/AWS/README.md index 0d046cbe4c..a25f39d9c2 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/README.md +++ b/AutomatedTesting/Gem/PythonTests/AWS/README.md @@ -2,30 +2,61 @@ ## Prerequisites 1. Build the O3DE Editor and AutomatedTesting.GameLauncher in Profile. -2. AWS CLI is installed and configured following [Configuration and Credential File Settings](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html). -3. [AWS Cloud Development Kit (CDK)](https://docs.aws.amazon.com/cdk/latest/guide/getting_started.html#getting_started_install) is installed. +2. Install the latest version of NodeJs. +3. AWS CLI is installed and configured following [Configuration and Credential File Settings](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html). +4. [AWS Cloud Development Kit (CDK)](https://docs.aws.amazon.com/cdk/latest/guide/getting_started.html#getting_started_install) is installed. ## Deploy CDK Applications 1. Go to the AWS IAM console and create an IAM role called o3de-automation-tests which adds your own account as as a trusted entity and uses the "AdministratorAccess" permissions policy. -2. Copy {engine_root}\scripts\build\Platform\Windows\deploy_cdk_applications.cmd to your engine root folder. -3. Open a new Command Prompt window at the engine root and set the following environment variables: -``` - Set O3DE_AWS_PROJECT_NAME=AWSAUTO - Set O3DE_AWS_DEPLOY_REGION=us-east-1 - Set O3DE_AWS_DEPLOY_ACCOUNT={your_aws_account_id} - Set ASSUME_ROLE_ARN=arn:aws:iam::{your_aws_account_id}:role/o3de-automation-tests - Set COMMIT_ID=HEAD -``` -4. In the same Command Prompt window, Deploy the CDK applications for AWS gems by running deploy_cdk_applications.cmd. +2. Copy the following deployment script to your engine root folder: + * Windows (Command Prompt) + ``` + {engine_root}\scripts\build\Platform\Windows\deploy_cdk_applications.cmd + ``` + * Linux + ``` + {engine_root}/scripts/build/Platform/Linux/deploy_cdk_applications.sh + ``` +3. Open a new CLI window at the engine root and set the following environment variables: + * Windows + ``` + Set O3DE_AWS_PROJECT_NAME=AWSAUTO + Set O3DE_AWS_DEPLOY_REGION=us-east-1 + Set ASSUME_ROLE_ARN=arn:aws:iam::{your_aws_account_id}:role/o3de-automation-tests + Set COMMIT_ID=HEAD + ``` + * Linux + ``` + export O3DE_AWS_PROJECT_NAME=AWSAUTO + export O3DE_AWS_DEPLOY_REGION=us-east-1 + export ASSUME_ROLE_ARN=arn:aws:iam::{your_aws_account_id}:role/o3de-automation-tests + export COMMIT_ID=HEAD + ``` +4. In the same CLI window, Deploy the CDK applications for AWS gems by running deploy_cdk_applications.cmd. ## Run Automation Tests ### CLI -In the same Command Prompt window, run the following CLI command: -python\python.cmd -m pytest {path_to_the_test_file} --build-directory {directory_to_the_profile_build} +1. In the same CLI window, run the following CLI command: + * Windows + ``` + python\python.cmd -m pytest {path_to_the_test_file} --build-directory {directory_to_the_profile_build} + ``` + * Linux + ``` + python/python.sh -m pytest {path_to_the_test_file} --build-directory {directory_to_the_profile_build} + ``` ### Pycharm You can also run any specific automation test directly from Pycharm by providing the "--build-directory" argument in the Run Configuration. ## Destroy CDK Applications -1. Copy {engine_root}\scripts\build\Platform\Windows\destroy_cdk_applications.cmd to your engine root folder. -2. In the same Command Prompt window, destroy the CDK applications for AWS gems by running destroy_cdk_applications.cmd. \ No newline at end of file +1. Copy the following destruction script to your engine root folder: + * Windows + ``` + {engine_root}\scripts\build\Platform\Windows\destroy_cdk_applications.cmd + ``` + * Linux + ``` + {engine_root}/scripts/build/Platform/Linux/destroy_cdk_applications.sh + ``` +2. In the same CLI window, destroy the CDK applications for AWS gems by running destroy_cdk_applications.cmd. diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/__init__.py b/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/__init__.py deleted file mode 100644 index 50cbb262dd..0000000000 --- a/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -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/AutomatedTesting/Gem/PythonTests/AWS/Windows/core/__init__.py b/AutomatedTesting/Gem/PythonTests/AWS/aws_metrics/__init__.py similarity index 100% rename from AutomatedTesting/Gem/PythonTests/AWS/Windows/core/__init__.py rename to AutomatedTesting/Gem/PythonTests/AWS/aws_metrics/__init__.py diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_automation_test.py b/AutomatedTesting/Gem/PythonTests/AWS/aws_metrics/aws_metrics_automation_test.py similarity index 96% rename from AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_automation_test.py rename to AutomatedTesting/Gem/PythonTests/AWS/aws_metrics/aws_metrics_automation_test.py index 6f3113d771..77d71df370 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_automation_test.py +++ b/AutomatedTesting/Gem/PythonTests/AWS/aws_metrics/aws_metrics_automation_test.py @@ -1,289 +1,289 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -import logging -import os -import pytest -import typing -from datetime import datetime - -import ly_test_tools.log.log_monitor - -from AWS.common import constants -from AWS.common.resource_mappings import AWS_RESOURCE_MAPPINGS_ACCOUNT_ID_KEY -from .aws_metrics_custom_thread import AWSMetricsThread - -# fixture imports -from assetpipeline.ap_fixtures.asset_processor_fixture import asset_processor -from .aws_metrics_utils import aws_metrics_utils - -AWS_METRICS_FEATURE_NAME = 'AWSMetrics' - -logger = logging.getLogger(__name__) - - -def setup(launcher: pytest.fixture, - asset_processor: pytest.fixture) -> pytest.fixture: - """ - Set up the resource mapping configuration and start the log monitor. - :param launcher: Client launcher for running the test level. - :param asset_processor: asset_processor fixture. - :return log monitor object. - """ - asset_processor.start() - asset_processor.wait_for_idle() - - file_to_monitor = os.path.join(launcher.workspace.paths.project_log(), constants.GAME_LOG_NAME) - - # Initialize the log monitor. - log_monitor = ly_test_tools.log.log_monitor.LogMonitor(launcher=launcher, log_file_path=file_to_monitor) - - return log_monitor - - -def monitor_metrics_submission(log_monitor: pytest.fixture) -> None: - """ - Monitor the messages and notifications for submitting metrics. - :param log_monitor: Log monitor to check the log messages. - """ - expected_lines = [ - '(Script) - Submitted metrics without buffer.', - '(Script) - Submitted metrics with buffer.', - '(Script) - Flushed the buffered metrics.', - '(Script) - Metrics is sent successfully.' - ] - - unexpected_lines = [ - '(Script) - Failed to submit metrics without buffer.', - '(Script) - Failed to submit metrics with buffer.', - '(Script) - Failed to send metrics.' - ] - - result = log_monitor.monitor_log_for_lines( - expected_lines=expected_lines, - unexpected_lines=unexpected_lines, - halt_on_unexpected=True) - - # Assert the log monitor detected expected lines and did not detect any unexpected lines. - assert result, ( - f'Log monitoring failed. Used expected_lines values: {expected_lines} & ' - f'unexpected_lines values: {unexpected_lines}') - - -def query_metrics_from_s3(aws_metrics_utils: pytest.fixture, resource_mappings: pytest.fixture) -> None: - """ - Verify that the metrics events are delivered to the S3 bucket and can be queried. - :param aws_metrics_utils: aws_metrics_utils fixture. - :param resource_mappings: resource_mappings fixture. - """ - aws_metrics_utils.verify_s3_delivery( - resource_mappings.get_resource_name_id('AWSMetrics.AnalyticsBucketName') - ) - logger.info('Metrics are sent to S3.') - - aws_metrics_utils.run_glue_crawler( - resource_mappings.get_resource_name_id('AWSMetrics.EventsCrawlerName')) - - # Remove the events_json table if exists so that the sample query can create a table with the same name. - aws_metrics_utils.delete_table(resource_mappings.get_resource_name_id('AWSMetrics.EventDatabaseName'), 'events_json') - aws_metrics_utils.run_named_queries(resource_mappings.get_resource_name_id('AWSMetrics.AthenaWorkGroupName')) - logger.info('Query metrics from S3 successfully.') - - -def verify_operational_metrics(aws_metrics_utils: pytest.fixture, - resource_mappings: pytest.fixture, start_time: datetime) -> None: - """ - Verify that operational health metrics are delivered to CloudWatch. - :param aws_metrics_utils: aws_metrics_utils fixture. - :param resource_mappings: resource_mappings fixture. - :param start_time: Time when the game launcher starts. - """ - aws_metrics_utils.verify_cloud_watch_delivery( - 'AWS/Lambda', - 'Invocations', - [{'Name': 'FunctionName', - 'Value': resource_mappings.get_resource_name_id('AWSMetrics.AnalyticsProcessingLambdaName')}], - start_time) - logger.info('AnalyticsProcessingLambda metrics are sent to CloudWatch.') - - aws_metrics_utils.verify_cloud_watch_delivery( - 'AWS/Lambda', - 'Invocations', - [{'Name': 'FunctionName', - 'Value': resource_mappings.get_resource_name_id('AWSMetrics.EventProcessingLambdaName')}], - start_time) - logger.info('EventsProcessingLambda metrics are sent to CloudWatch.') - - -def update_kinesis_analytics_application_status(aws_metrics_utils: pytest.fixture, - resource_mappings: pytest.fixture, start_application: bool) -> None: - """ - Update the Kinesis analytics application to start or stop it. - :param aws_metrics_utils: aws_metrics_utils fixture. - :param resource_mappings: resource_mappings fixture. - :param start_application: whether to start or stop the application. - """ - if start_application: - aws_metrics_utils.start_kinesis_data_analytics_application( - resource_mappings.get_resource_name_id('AWSMetrics.AnalyticsApplicationName')) - else: - aws_metrics_utils.stop_kinesis_data_analytics_application( - resource_mappings.get_resource_name_id('AWSMetrics.AnalyticsApplicationName')) - -@pytest.mark.SUITE_awsi -@pytest.mark.usefixtures('automatic_process_killer') -@pytest.mark.usefixtures('aws_credentials') -@pytest.mark.usefixtures('resource_mappings') -@pytest.mark.parametrize('assume_role_arn', [constants.ASSUME_ROLE_ARN]) -@pytest.mark.parametrize('feature_name', [AWS_METRICS_FEATURE_NAME]) -@pytest.mark.parametrize('profile_name', ['AWSAutomationTest']) -@pytest.mark.parametrize('project', ['AutomatedTesting']) -@pytest.mark.parametrize('region_name', [constants.AWS_REGION]) -@pytest.mark.parametrize('resource_mappings_filename', [constants.AWS_RESOURCE_MAPPING_FILE_NAME]) -@pytest.mark.parametrize('session_name', [constants.SESSION_NAME]) -@pytest.mark.parametrize('stacks', [[f'{constants.AWS_PROJECT_NAME}-{AWS_METRICS_FEATURE_NAME}-{constants.AWS_REGION}']]) -class TestAWSMetricsWindows(object): - """ - Test class to verify the real-time and batch analytics for metrics. - """ - @pytest.mark.parametrize('level', ['AWS/Metrics']) - def test_realtime_and_batch_analytics(self, - level: str, - launcher: pytest.fixture, - asset_processor: pytest.fixture, - workspace: pytest.fixture, - aws_utils: pytest.fixture, - resource_mappings: pytest.fixture, - aws_metrics_utils: pytest.fixture): - """ - Verify that the metrics events are sent to CloudWatch and S3 for analytics. - """ - # Start Kinesis analytics application on a separate thread to avoid blocking the test. - kinesis_analytics_application_thread = AWSMetricsThread(target=update_kinesis_analytics_application_status, - args=(aws_metrics_utils, resource_mappings, True)) - kinesis_analytics_application_thread.start() - - log_monitor = setup(launcher, asset_processor) - - # Kinesis analytics application needs to be in the running state before we start the game launcher. - kinesis_analytics_application_thread.join() - launcher.args = ['+LoadLevel', level] - launcher.args.extend(['-rhi=null']) - start_time = datetime.utcnow() - with launcher.start(launch_ap=False): - monitor_metrics_submission(log_monitor) - - # Verify that real-time analytics metrics are delivered to CloudWatch. - aws_metrics_utils.verify_cloud_watch_delivery( - AWS_METRICS_FEATURE_NAME, - 'TotalLogins', - [], - start_time) - logger.info('Real-time metrics are sent to CloudWatch.') - - # Run time-consuming operations on separate threads to avoid blocking the test. - operational_threads = list() - operational_threads.append( - AWSMetricsThread(target=query_metrics_from_s3, - args=(aws_metrics_utils, resource_mappings))) - operational_threads.append( - AWSMetricsThread(target=verify_operational_metrics, - args=(aws_metrics_utils, resource_mappings, start_time))) - operational_threads.append( - AWSMetricsThread(target=update_kinesis_analytics_application_status, - args=(aws_metrics_utils, resource_mappings, False))) - for thread in operational_threads: - thread.start() - for thread in operational_threads: - thread.join() - - @pytest.mark.parametrize('level', ['AWS/Metrics']) - def test_realtime_and_batch_analytics_no_global_accountid(self, - level: str, - launcher: pytest.fixture, - asset_processor: pytest.fixture, - workspace: pytest.fixture, - aws_utils: pytest.fixture, - resource_mappings: pytest.fixture, - aws_metrics_utils: pytest.fixture): - """ - Verify that the metrics events are sent to CloudWatch and S3 for analytics. - """ - # Remove top-level account ID from resource mappings - resource_mappings.clear_select_keys([AWS_RESOURCE_MAPPINGS_ACCOUNT_ID_KEY]) - # Start Kinesis analytics application on a separate thread to avoid blocking the test. - kinesis_analytics_application_thread = AWSMetricsThread(target=update_kinesis_analytics_application_status, - args=(aws_metrics_utils, resource_mappings, True)) - kinesis_analytics_application_thread.start() - - log_monitor = setup(launcher, asset_processor) - - # Kinesis analytics application needs to be in the running state before we start the game launcher. - kinesis_analytics_application_thread.join() - launcher.args = ['+LoadLevel', level] - launcher.args.extend(['-rhi=null']) - start_time = datetime.utcnow() - with launcher.start(launch_ap=False): - monitor_metrics_submission(log_monitor) - - # Verify that real-time analytics metrics are delivered to CloudWatch. - aws_metrics_utils.verify_cloud_watch_delivery( - AWS_METRICS_FEATURE_NAME, - 'TotalLogins', - [], - start_time) - logger.info('Real-time metrics are sent to CloudWatch.') - - # Run time-consuming operations on separate threads to avoid blocking the test. - operational_threads = list() - operational_threads.append( - AWSMetricsThread(target=query_metrics_from_s3, - args=(aws_metrics_utils, resource_mappings))) - operational_threads.append( - AWSMetricsThread(target=verify_operational_metrics, - args=(aws_metrics_utils, resource_mappings, start_time))) - operational_threads.append( - AWSMetricsThread(target=update_kinesis_analytics_application_status, - args=(aws_metrics_utils, resource_mappings, False))) - for thread in operational_threads: - thread.start() - for thread in operational_threads: - thread.join() - - @pytest.mark.parametrize('level', ['AWS/Metrics']) - def test_unauthorized_user_request_rejected(self, - level: str, - launcher: pytest.fixture, - asset_processor: pytest.fixture, - workspace: pytest.fixture): - """ - Verify that unauthorized users cannot send metrics events to the AWS backed backend. - """ - log_monitor = setup(launcher, asset_processor) - - # Set invalid AWS credentials. - launcher.args = ['+LoadLevel', level, '+cl_awsAccessKey', 'AKIAIOSFODNN7EXAMPLE', - '+cl_awsSecretKey', 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY'] - launcher.args.extend(['-rhi=null']) - - with launcher.start(launch_ap=False): - result = log_monitor.monitor_log_for_lines( - expected_lines=['(Script) - Failed to send metrics.'], - unexpected_lines=['(Script) - Metrics is sent successfully.'], - halt_on_unexpected=True) - assert result, 'Metrics events are sent successfully by unauthorized user' - logger.info('Unauthorized user is rejected to send metrics.') - - def test_clean_up_s3_bucket(self, - aws_utils: pytest.fixture, - resource_mappings: pytest.fixture, - aws_metrics_utils: pytest.fixture): - """ - Clear the analytics bucket objects so that the S3 bucket can be destroyed during tear down. - """ - aws_metrics_utils.empty_bucket( - resource_mappings.get_resource_name_id('AWSMetrics.AnalyticsBucketName')) +""" +Copyright (c) Contributors to the Open 3D Engine Project. +For complete copyright and license terms please see the LICENSE at the root of this distribution. + +SPDX-License-Identifier: Apache-2.0 OR MIT +""" + +import logging +import os +import pytest +import typing +from datetime import datetime + +import ly_test_tools.log.log_monitor + +from AWS.common import constants +from AWS.common.resource_mappings import AWS_RESOURCE_MAPPINGS_ACCOUNT_ID_KEY +from .aws_metrics_custom_thread import AWSMetricsThread + +# fixture imports +from assetpipeline.ap_fixtures.asset_processor_fixture import asset_processor +from .aws_metrics_utils import aws_metrics_utils + +AWS_METRICS_FEATURE_NAME = 'AWSMetrics' + +logger = logging.getLogger(__name__) + + +def setup(launcher: pytest.fixture, + asset_processor: pytest.fixture) -> pytest.fixture: + """ + Set up the resource mapping configuration and start the log monitor. + :param launcher: Client launcher for running the test level. + :param asset_processor: asset_processor fixture. + :return log monitor object. + """ + asset_processor.start() + asset_processor.wait_for_idle() + + file_to_monitor = os.path.join(launcher.workspace.paths.project_log(), constants.GAME_LOG_NAME) + + # Initialize the log monitor. + log_monitor = ly_test_tools.log.log_monitor.LogMonitor(launcher=launcher, log_file_path=file_to_monitor) + + return log_monitor + + +def monitor_metrics_submission(log_monitor: pytest.fixture) -> None: + """ + Monitor the messages and notifications for submitting metrics. + :param log_monitor: Log monitor to check the log messages. + """ + expected_lines = [ + '(Script) - Submitted metrics without buffer.', + '(Script) - Submitted metrics with buffer.', + '(Script) - Flushed the buffered metrics.', + '(Script) - Metrics is sent successfully.' + ] + + unexpected_lines = [ + '(Script) - Failed to submit metrics without buffer.', + '(Script) - Failed to submit metrics with buffer.', + '(Script) - Failed to send metrics.' + ] + + result = log_monitor.monitor_log_for_lines( + expected_lines=expected_lines, + unexpected_lines=unexpected_lines, + halt_on_unexpected=True) + + # Assert the log monitor detected expected lines and did not detect any unexpected lines. + assert result, ( + f'Log monitoring failed. Used expected_lines values: {expected_lines} & ' + f'unexpected_lines values: {unexpected_lines}') + + +def query_metrics_from_s3(aws_metrics_utils: pytest.fixture, resource_mappings: pytest.fixture) -> None: + """ + Verify that the metrics events are delivered to the S3 bucket and can be queried. + :param aws_metrics_utils: aws_metrics_utils fixture. + :param resource_mappings: resource_mappings fixture. + """ + aws_metrics_utils.verify_s3_delivery( + resource_mappings.get_resource_name_id('AWSMetrics.AnalyticsBucketName') + ) + logger.info('Metrics are sent to S3.') + + aws_metrics_utils.run_glue_crawler( + resource_mappings.get_resource_name_id('AWSMetrics.EventsCrawlerName')) + + # Remove the events_json table if exists so that the sample query can create a table with the same name. + aws_metrics_utils.delete_table(resource_mappings.get_resource_name_id('AWSMetrics.EventDatabaseName'), 'events_json') + aws_metrics_utils.run_named_queries(resource_mappings.get_resource_name_id('AWSMetrics.AthenaWorkGroupName')) + logger.info('Query metrics from S3 successfully.') + + +def verify_operational_metrics(aws_metrics_utils: pytest.fixture, + resource_mappings: pytest.fixture, start_time: datetime) -> None: + """ + Verify that operational health metrics are delivered to CloudWatch. + :param aws_metrics_utils: aws_metrics_utils fixture. + :param resource_mappings: resource_mappings fixture. + :param start_time: Time when the game launcher starts. + """ + aws_metrics_utils.verify_cloud_watch_delivery( + 'AWS/Lambda', + 'Invocations', + [{'Name': 'FunctionName', + 'Value': resource_mappings.get_resource_name_id('AWSMetrics.AnalyticsProcessingLambdaName')}], + start_time) + logger.info('AnalyticsProcessingLambda metrics are sent to CloudWatch.') + + aws_metrics_utils.verify_cloud_watch_delivery( + 'AWS/Lambda', + 'Invocations', + [{'Name': 'FunctionName', + 'Value': resource_mappings.get_resource_name_id('AWSMetrics.EventProcessingLambdaName')}], + start_time) + logger.info('EventsProcessingLambda metrics are sent to CloudWatch.') + + +def update_kinesis_analytics_application_status(aws_metrics_utils: pytest.fixture, + resource_mappings: pytest.fixture, start_application: bool) -> None: + """ + Update the Kinesis analytics application to start or stop it. + :param aws_metrics_utils: aws_metrics_utils fixture. + :param resource_mappings: resource_mappings fixture. + :param start_application: whether to start or stop the application. + """ + if start_application: + aws_metrics_utils.start_kinesis_data_analytics_application( + resource_mappings.get_resource_name_id('AWSMetrics.AnalyticsApplicationName')) + else: + aws_metrics_utils.stop_kinesis_data_analytics_application( + resource_mappings.get_resource_name_id('AWSMetrics.AnalyticsApplicationName')) + +@pytest.mark.SUITE_awsi +@pytest.mark.usefixtures('automatic_process_killer') +@pytest.mark.usefixtures('aws_credentials') +@pytest.mark.usefixtures('resource_mappings') +@pytest.mark.parametrize('assume_role_arn', [constants.ASSUME_ROLE_ARN]) +@pytest.mark.parametrize('feature_name', [AWS_METRICS_FEATURE_NAME]) +@pytest.mark.parametrize('profile_name', ['AWSAutomationTest']) +@pytest.mark.parametrize('project', ['AutomatedTesting']) +@pytest.mark.parametrize('region_name', [constants.AWS_REGION]) +@pytest.mark.parametrize('resource_mappings_filename', [constants.AWS_RESOURCE_MAPPING_FILE_NAME]) +@pytest.mark.parametrize('session_name', [constants.SESSION_NAME]) +@pytest.mark.parametrize('stacks', [[f'{constants.AWS_PROJECT_NAME}-{AWS_METRICS_FEATURE_NAME}-{constants.AWS_REGION}']]) +class TestAWSMetricsWindows(object): + """ + Test class to verify the real-time and batch analytics for metrics. + """ + @pytest.mark.parametrize('level', ['levels/aws/metrics/metrics.spawnable']) + def test_realtime_and_batch_analytics(self, + level: str, + launcher: pytest.fixture, + asset_processor: pytest.fixture, + workspace: pytest.fixture, + aws_utils: pytest.fixture, + resource_mappings: pytest.fixture, + aws_metrics_utils: pytest.fixture): + """ + Verify that the metrics events are sent to CloudWatch and S3 for analytics. + """ + # Start Kinesis analytics application on a separate thread to avoid blocking the test. + kinesis_analytics_application_thread = AWSMetricsThread(target=update_kinesis_analytics_application_status, + args=(aws_metrics_utils, resource_mappings, True)) + kinesis_analytics_application_thread.start() + + log_monitor = setup(launcher, asset_processor) + + # Kinesis analytics application needs to be in the running state before we start the game launcher. + kinesis_analytics_application_thread.join() + launcher.args = ['+LoadLevel', level] + launcher.args.extend(['-rhi=null']) + start_time = datetime.utcnow() + with launcher.start(launch_ap=False): + monitor_metrics_submission(log_monitor) + + # Verify that real-time analytics metrics are delivered to CloudWatch. + aws_metrics_utils.verify_cloud_watch_delivery( + AWS_METRICS_FEATURE_NAME, + 'TotalLogins', + [], + start_time) + logger.info('Real-time metrics are sent to CloudWatch.') + + # Run time-consuming operations on separate threads to avoid blocking the test. + operational_threads = list() + operational_threads.append( + AWSMetricsThread(target=query_metrics_from_s3, + args=(aws_metrics_utils, resource_mappings))) + operational_threads.append( + AWSMetricsThread(target=verify_operational_metrics, + args=(aws_metrics_utils, resource_mappings, start_time))) + operational_threads.append( + AWSMetricsThread(target=update_kinesis_analytics_application_status, + args=(aws_metrics_utils, resource_mappings, False))) + for thread in operational_threads: + thread.start() + for thread in operational_threads: + thread.join() + + @pytest.mark.parametrize('level', ['levels/aws/metrics/metrics.spawnable']) + def test_realtime_and_batch_analytics_no_global_accountid(self, + level: str, + launcher: pytest.fixture, + asset_processor: pytest.fixture, + workspace: pytest.fixture, + aws_utils: pytest.fixture, + resource_mappings: pytest.fixture, + aws_metrics_utils: pytest.fixture): + """ + Verify that the metrics events are sent to CloudWatch and S3 for analytics. + """ + # Remove top-level account ID from resource mappings + resource_mappings.clear_select_keys([AWS_RESOURCE_MAPPINGS_ACCOUNT_ID_KEY]) + # Start Kinesis analytics application on a separate thread to avoid blocking the test. + kinesis_analytics_application_thread = AWSMetricsThread(target=update_kinesis_analytics_application_status, + args=(aws_metrics_utils, resource_mappings, True)) + kinesis_analytics_application_thread.start() + + log_monitor = setup(launcher, asset_processor) + + # Kinesis analytics application needs to be in the running state before we start the game launcher. + kinesis_analytics_application_thread.join() + launcher.args = ['+LoadLevel', level] + launcher.args.extend(['-rhi=null']) + start_time = datetime.utcnow() + with launcher.start(launch_ap=False): + monitor_metrics_submission(log_monitor) + + # Verify that real-time analytics metrics are delivered to CloudWatch. + aws_metrics_utils.verify_cloud_watch_delivery( + AWS_METRICS_FEATURE_NAME, + 'TotalLogins', + [], + start_time) + logger.info('Real-time metrics are sent to CloudWatch.') + + # Run time-consuming operations on separate threads to avoid blocking the test. + operational_threads = list() + operational_threads.append( + AWSMetricsThread(target=query_metrics_from_s3, + args=(aws_metrics_utils, resource_mappings))) + operational_threads.append( + AWSMetricsThread(target=verify_operational_metrics, + args=(aws_metrics_utils, resource_mappings, start_time))) + operational_threads.append( + AWSMetricsThread(target=update_kinesis_analytics_application_status, + args=(aws_metrics_utils, resource_mappings, False))) + for thread in operational_threads: + thread.start() + for thread in operational_threads: + thread.join() + + @pytest.mark.parametrize('level', ['levels/aws/metrics/metrics.spawnable']) + def test_unauthorized_user_request_rejected(self, + level: str, + launcher: pytest.fixture, + asset_processor: pytest.fixture, + workspace: pytest.fixture): + """ + Verify that unauthorized users cannot send metrics events to the AWS backed backend. + """ + log_monitor = setup(launcher, asset_processor) + + # Set invalid AWS credentials. + launcher.args = ['+LoadLevel', level, '+cl_awsAccessKey', 'AKIAIOSFODNN7EXAMPLE', + '+cl_awsSecretKey', 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY'] + launcher.args.extend(['-rhi=null']) + + with launcher.start(launch_ap=False): + result = log_monitor.monitor_log_for_lines( + expected_lines=['(Script) - Failed to send metrics.'], + unexpected_lines=['(Script) - Metrics is sent successfully.'], + halt_on_unexpected=True) + assert result, 'Metrics events are sent successfully by unauthorized user' + logger.info('Unauthorized user is rejected to send metrics.') + + def test_clean_up_s3_bucket(self, + aws_utils: pytest.fixture, + resource_mappings: pytest.fixture, + aws_metrics_utils: pytest.fixture): + """ + Clear the analytics bucket objects so that the S3 bucket can be destroyed during tear down. + """ + aws_metrics_utils.empty_bucket( + resource_mappings.get_resource_name_id('AWSMetrics.AnalyticsBucketName')) diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_custom_thread.py b/AutomatedTesting/Gem/PythonTests/AWS/aws_metrics/aws_metrics_custom_thread.py similarity index 96% rename from AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_custom_thread.py rename to AutomatedTesting/Gem/PythonTests/AWS/aws_metrics/aws_metrics_custom_thread.py index 1bba9c3e39..99f9072c4b 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_custom_thread.py +++ b/AutomatedTesting/Gem/PythonTests/AWS/aws_metrics/aws_metrics_custom_thread.py @@ -1,29 +1,29 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -from threading import Thread - - -class AWSMetricsThread(Thread): - """ - Custom thread for raising assertion errors on the main thread. - """ - def __init__(self, **kwargs): - super().__init__(**kwargs) - self._error = None - - def run(self) -> None: - try: - super().run() - except AssertionError as e: - self._error = e - - def join(self, **kwargs) -> None: - super().join(**kwargs) - - if self._error: - raise AssertionError(self._error) +""" +Copyright (c) Contributors to the Open 3D Engine Project. +For complete copyright and license terms please see the LICENSE at the root of this distribution. + +SPDX-License-Identifier: Apache-2.0 OR MIT +""" + +from threading import Thread + + +class AWSMetricsThread(Thread): + """ + Custom thread for raising assertion errors on the main thread. + """ + def __init__(self, **kwargs): + super().__init__(**kwargs) + self._error = None + + def run(self) -> None: + try: + super().run() + except AssertionError as e: + self._error = e + + def join(self, **kwargs) -> None: + super().join(**kwargs) + + if self._error: + raise AssertionError(self._error) diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_utils.py b/AutomatedTesting/Gem/PythonTests/AWS/aws_metrics/aws_metrics_utils.py similarity index 97% rename from AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_utils.py rename to AutomatedTesting/Gem/PythonTests/AWS/aws_metrics/aws_metrics_utils.py index e7eb486d02..64ee224f4e 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_utils.py +++ b/AutomatedTesting/Gem/PythonTests/AWS/aws_metrics/aws_metrics_utils.py @@ -1,239 +1,239 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -import logging -import pathlib -import pytest -import typing - -from datetime import datetime -from botocore.exceptions import WaiterError - -from .aws_metrics_waiters import KinesisAnalyticsApplicationUpdatedWaiter, \ - CloudWatchMetricsDeliveredWaiter, DataLakeMetricsDeliveredWaiter, GlueCrawlerReadyWaiter - -logging.getLogger('boto').setLevel(logging.CRITICAL) - -# Expected directory and file extension for the S3 objects. -EXPECTED_S3_DIRECTORY = 'firehose_events/' -EXPECTED_S3_OBJECT_EXTENSION = '.parquet' - - -class AWSMetricsUtils: - """ - Provide utils functions for the AWSMetrics gem to interact with the deployed resources. - """ - - def __init__(self, aws_utils: pytest.fixture): - self._aws_util = aws_utils - - def start_kinesis_data_analytics_application(self, application_name: str) -> None: - """ - Start the Kenisis Data Analytics application for real-time analytics. - :param application_name: Name of the Kenisis Data Analytics application. - """ - input_id = self.get_kinesis_analytics_application_input_id(application_name) - assert input_id, 'invalid Kinesis Data Analytics application input.' - - client = self._aws_util.client('kinesisanalytics') - try: - client.start_application( - ApplicationName=application_name, - InputConfigurations=[ - { - 'Id': input_id, - 'InputStartingPositionConfiguration': { - 'InputStartingPosition': 'NOW' - } - }, - ] - ) - except client.exceptions.ResourceInUseException: - # The application has been started. - return - - try: - KinesisAnalyticsApplicationUpdatedWaiter(client, 'RUNNING').wait(application_name=application_name) - except WaiterError as e: - assert False, f'Failed to start the Kinesis Data Analytics application: {str(e)}.' - - def get_kinesis_analytics_application_input_id(self, application_name: str) -> str: - """ - Get the input ID for the Kenisis Data Analytics application. - :param application_name: Name of the Kenisis Data Analytics application. - :return: Input ID for the Kenisis Data Analytics application. - """ - client = self._aws_util.client('kinesisanalytics') - response = client.describe_application( - ApplicationName=application_name - ) - if not response: - return '' - input_descriptions = response.get('ApplicationDetail', {}).get('InputDescriptions', []) - if len(input_descriptions) != 1: - return '' - - return input_descriptions[0].get('InputId', '') - - def stop_kinesis_data_analytics_application(self, application_name: str) -> None: - """ - Stop the Kenisis Data Analytics application. - :param application_name: Name of the Kenisis Data Analytics application. - """ - client = self._aws_util.client('kinesisanalytics') - client.stop_application( - ApplicationName=application_name - ) - - try: - KinesisAnalyticsApplicationUpdatedWaiter(client, 'READY').wait(application_name=application_name) - except WaiterError as e: - assert False, f'Failed to stop the Kinesis Data Analytics application: {str(e)}.' - - def verify_cloud_watch_delivery(self, namespace: str, metrics_name: str, - dimensions: typing.List[dict], start_time: datetime) -> None: - """ - Verify that the expected metrics is delivered to CloudWatch. - :param namespace: Namespace of the metrics. - :param metrics_name: Name of the metrics. - :param dimensions: Dimensions of the metrics. - :param start_time: Start time for generating the metrics. - """ - client = self._aws_util.client('cloudwatch') - - try: - CloudWatchMetricsDeliveredWaiter(client).wait( - namespace=namespace, - metrics_name=metrics_name, - dimensions=dimensions, - start_time=start_time - ) - except WaiterError as e: - assert False, f'Failed to deliver metrics to CloudWatch: {str(e)}.' - - def verify_s3_delivery(self, analytics_bucket_name: str) -> None: - """ - Verify that metrics are delivered to S3 for batch analytics successfully. - :param analytics_bucket_name: Name of the deployed S3 bucket. - """ - client = self._aws_util.client('s3') - bucket_name = analytics_bucket_name - - try: - DataLakeMetricsDeliveredWaiter(client).wait(bucket_name=bucket_name, prefix=EXPECTED_S3_DIRECTORY) - except WaiterError as e: - assert False, f'Failed to find the S3 directory for storing metrics data: {str(e)}.' - - # Check whether the data is converted to the expected data format. - response = client.list_objects_v2( - Bucket=bucket_name, - Prefix=EXPECTED_S3_DIRECTORY - ) - assert response.get('KeyCount', 0) != 0, f'Failed to deliver metrics to the S3 bucket {bucket_name}.' - - s3_objects = response.get('Contents', []) - for s3_object in s3_objects: - key = s3_object.get('Key', '') - assert pathlib.Path(key).suffix == EXPECTED_S3_OBJECT_EXTENSION, \ - f'Invalid data format is found in the S3 bucket {bucket_name}' - - def run_glue_crawler(self, crawler_name: str) -> None: - """ - Run the Glue crawler and wait for it to finish. - :param crawler_name: Name of the Glue crawler - """ - client = self._aws_util.client('glue') - try: - client.start_crawler( - Name=crawler_name - ) - except client.exceptions.CrawlerRunningException: - # The crawler has already been started. - return - - try: - GlueCrawlerReadyWaiter(client).wait(crawler_name=crawler_name) - except WaiterError as e: - assert False, f'Failed to run the Glue crawler: {str(e)}.' - - def run_named_queries(self, work_group: str) -> None: - """ - Run the named queries under the specific Athena work group. - :param work_group: Name of the Athena work group. - """ - client = self._aws_util.client('athena') - # List all the named queries. - response = client.list_named_queries( - WorkGroup=work_group - ) - named_query_ids = response.get('NamedQueryIds', []) - - # Run each of the queries. - for named_query_id in named_query_ids: - get_named_query_response = client.get_named_query( - NamedQueryId=named_query_id - ) - named_query = get_named_query_response.get('NamedQuery', {}) - - start_query_execution_response = client.start_query_execution( - QueryString=named_query.get('QueryString', ''), - QueryExecutionContext={ - 'Database': named_query.get('Database', '') - }, - WorkGroup=work_group - ) - - # Wait for the query to finish. - state = 'RUNNING' - while state == 'QUEUED' or state == 'RUNNING': - get_query_execution_response = client.get_query_execution( - QueryExecutionId=start_query_execution_response.get('QueryExecutionId', '') - ) - - state = get_query_execution_response.get('QueryExecution', {}).get('Status', {}).get('State', '') - - assert state == 'SUCCEEDED', f'Failed to run the named query {named_query.get("Name", {})}' - - def empty_bucket(self, bucket_name: str) -> None: - """ - Empty the S3 bucket following: - https://boto3.amazonaws.com/v1/documentation/api/latest/guide/migrations3.html - - :param bucket_name: Name of the S3 bucket. - """ - s3 = self._aws_util.resource('s3') - bucket = s3.Bucket(bucket_name) - - for key in bucket.objects.all(): - key.delete() - - def delete_table(self, database_name: str, table_name: str) -> None: - """ - Delete an existing Glue table. - - :param database_name: Name of the Glue database. - :param table_name: Name of the table to delete. - """ - client = self._aws_util.client('glue') - client.delete_table( - DatabaseName=database_name, - Name=table_name - ) - - -@pytest.fixture(scope='function') -def aws_metrics_utils( - request: pytest.fixture, - aws_utils: pytest.fixture): - """ - Fixture for the AWS metrics util functions. - :param request: _pytest.fixtures.SubRequest class that handles getting - a pytest fixture from a pytest function/fixture. - :param aws_utils: aws_utils fixture. - """ - aws_utils_obj = AWSMetricsUtils(aws_utils) - return aws_utils_obj +""" +Copyright (c) Contributors to the Open 3D Engine Project. +For complete copyright and license terms please see the LICENSE at the root of this distribution. + +SPDX-License-Identifier: Apache-2.0 OR MIT +""" + +import logging +import pathlib +import pytest +import typing + +from datetime import datetime +from botocore.exceptions import WaiterError + +from .aws_metrics_waiters import KinesisAnalyticsApplicationUpdatedWaiter, \ + CloudWatchMetricsDeliveredWaiter, DataLakeMetricsDeliveredWaiter, GlueCrawlerReadyWaiter + +logging.getLogger('boto').setLevel(logging.CRITICAL) + +# Expected directory and file extension for the S3 objects. +EXPECTED_S3_DIRECTORY = 'firehose_events/' +EXPECTED_S3_OBJECT_EXTENSION = '.parquet' + + +class AWSMetricsUtils: + """ + Provide utils functions for the AWSMetrics gem to interact with the deployed resources. + """ + + def __init__(self, aws_utils: pytest.fixture): + self._aws_util = aws_utils + + def start_kinesis_data_analytics_application(self, application_name: str) -> None: + """ + Start the Kenisis Data Analytics application for real-time analytics. + :param application_name: Name of the Kenisis Data Analytics application. + """ + input_id = self.get_kinesis_analytics_application_input_id(application_name) + assert input_id, 'invalid Kinesis Data Analytics application input.' + + client = self._aws_util.client('kinesisanalytics') + try: + client.start_application( + ApplicationName=application_name, + InputConfigurations=[ + { + 'Id': input_id, + 'InputStartingPositionConfiguration': { + 'InputStartingPosition': 'NOW' + } + }, + ] + ) + except client.exceptions.ResourceInUseException: + # The application has been started. + return + + try: + KinesisAnalyticsApplicationUpdatedWaiter(client, 'RUNNING').wait(application_name=application_name) + except WaiterError as e: + assert False, f'Failed to start the Kinesis Data Analytics application: {str(e)}.' + + def get_kinesis_analytics_application_input_id(self, application_name: str) -> str: + """ + Get the input ID for the Kenisis Data Analytics application. + :param application_name: Name of the Kenisis Data Analytics application. + :return: Input ID for the Kenisis Data Analytics application. + """ + client = self._aws_util.client('kinesisanalytics') + response = client.describe_application( + ApplicationName=application_name + ) + if not response: + return '' + input_descriptions = response.get('ApplicationDetail', {}).get('InputDescriptions', []) + if len(input_descriptions) != 1: + return '' + + return input_descriptions[0].get('InputId', '') + + def stop_kinesis_data_analytics_application(self, application_name: str) -> None: + """ + Stop the Kenisis Data Analytics application. + :param application_name: Name of the Kenisis Data Analytics application. + """ + client = self._aws_util.client('kinesisanalytics') + client.stop_application( + ApplicationName=application_name + ) + + try: + KinesisAnalyticsApplicationUpdatedWaiter(client, 'READY').wait(application_name=application_name) + except WaiterError as e: + assert False, f'Failed to stop the Kinesis Data Analytics application: {str(e)}.' + + def verify_cloud_watch_delivery(self, namespace: str, metrics_name: str, + dimensions: typing.List[dict], start_time: datetime) -> None: + """ + Verify that the expected metrics is delivered to CloudWatch. + :param namespace: Namespace of the metrics. + :param metrics_name: Name of the metrics. + :param dimensions: Dimensions of the metrics. + :param start_time: Start time for generating the metrics. + """ + client = self._aws_util.client('cloudwatch') + + try: + CloudWatchMetricsDeliveredWaiter(client).wait( + namespace=namespace, + metrics_name=metrics_name, + dimensions=dimensions, + start_time=start_time + ) + except WaiterError as e: + assert False, f'Failed to deliver metrics to CloudWatch: {str(e)}.' + + def verify_s3_delivery(self, analytics_bucket_name: str) -> None: + """ + Verify that metrics are delivered to S3 for batch analytics successfully. + :param analytics_bucket_name: Name of the deployed S3 bucket. + """ + client = self._aws_util.client('s3') + bucket_name = analytics_bucket_name + + try: + DataLakeMetricsDeliveredWaiter(client).wait(bucket_name=bucket_name, prefix=EXPECTED_S3_DIRECTORY) + except WaiterError as e: + assert False, f'Failed to find the S3 directory for storing metrics data: {str(e)}.' + + # Check whether the data is converted to the expected data format. + response = client.list_objects_v2( + Bucket=bucket_name, + Prefix=EXPECTED_S3_DIRECTORY + ) + assert response.get('KeyCount', 0) != 0, f'Failed to deliver metrics to the S3 bucket {bucket_name}.' + + s3_objects = response.get('Contents', []) + for s3_object in s3_objects: + key = s3_object.get('Key', '') + assert pathlib.Path(key).suffix == EXPECTED_S3_OBJECT_EXTENSION, \ + f'Invalid data format is found in the S3 bucket {bucket_name}' + + def run_glue_crawler(self, crawler_name: str) -> None: + """ + Run the Glue crawler and wait for it to finish. + :param crawler_name: Name of the Glue crawler + """ + client = self._aws_util.client('glue') + try: + client.start_crawler( + Name=crawler_name + ) + except client.exceptions.CrawlerRunningException: + # The crawler has already been started. + return + + try: + GlueCrawlerReadyWaiter(client).wait(crawler_name=crawler_name) + except WaiterError as e: + assert False, f'Failed to run the Glue crawler: {str(e)}.' + + def run_named_queries(self, work_group: str) -> None: + """ + Run the named queries under the specific Athena work group. + :param work_group: Name of the Athena work group. + """ + client = self._aws_util.client('athena') + # List all the named queries. + response = client.list_named_queries( + WorkGroup=work_group + ) + named_query_ids = response.get('NamedQueryIds', []) + + # Run each of the queries. + for named_query_id in named_query_ids: + get_named_query_response = client.get_named_query( + NamedQueryId=named_query_id + ) + named_query = get_named_query_response.get('NamedQuery', {}) + + start_query_execution_response = client.start_query_execution( + QueryString=named_query.get('QueryString', ''), + QueryExecutionContext={ + 'Database': named_query.get('Database', '') + }, + WorkGroup=work_group + ) + + # Wait for the query to finish. + state = 'RUNNING' + while state == 'QUEUED' or state == 'RUNNING': + get_query_execution_response = client.get_query_execution( + QueryExecutionId=start_query_execution_response.get('QueryExecutionId', '') + ) + + state = get_query_execution_response.get('QueryExecution', {}).get('Status', {}).get('State', '') + + assert state == 'SUCCEEDED', f'Failed to run the named query {named_query.get("Name", {})}' + + def empty_bucket(self, bucket_name: str) -> None: + """ + Empty the S3 bucket following: + https://boto3.amazonaws.com/v1/documentation/api/latest/guide/migrations3.html + + :param bucket_name: Name of the S3 bucket. + """ + s3 = self._aws_util.resource('s3') + bucket = s3.Bucket(bucket_name) + + for key in bucket.objects.all(): + key.delete() + + def delete_table(self, database_name: str, table_name: str) -> None: + """ + Delete an existing Glue table. + + :param database_name: Name of the Glue database. + :param table_name: Name of the table to delete. + """ + client = self._aws_util.client('glue') + client.delete_table( + DatabaseName=database_name, + Name=table_name + ) + + +@pytest.fixture(scope='function') +def aws_metrics_utils( + request: pytest.fixture, + aws_utils: pytest.fixture): + """ + Fixture for the AWS metrics util functions. + :param request: _pytest.fixtures.SubRequest class that handles getting + a pytest fixture from a pytest function/fixture. + :param aws_utils: aws_utils fixture. + """ + aws_utils_obj = AWSMetricsUtils(aws_utils) + return aws_utils_obj diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_waiters.py b/AutomatedTesting/Gem/PythonTests/AWS/aws_metrics/aws_metrics_waiters.py similarity index 96% rename from AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_waiters.py rename to AutomatedTesting/Gem/PythonTests/AWS/aws_metrics/aws_metrics_waiters.py index 46070a3a64..7b09557c79 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/Windows/aws_metrics/aws_metrics_waiters.py +++ b/AutomatedTesting/Gem/PythonTests/AWS/aws_metrics/aws_metrics_waiters.py @@ -1,139 +1,139 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -import botocore.client -import logging - -from datetime import timedelta -from AWS.common.custom_waiter import CustomWaiter, WaitState - -logging.getLogger('boto').setLevel(logging.CRITICAL) - - -class KinesisAnalyticsApplicationUpdatedWaiter(CustomWaiter): - """ - Subclass of the base custom waiter class. - Wait for the Kinesis analytics application being updated to a specific status. - """ - def __init__(self, client: botocore.client, status: str): - """ - Initialize the waiter. - - :param client: Boto3 client to use. - :param status: Expected status. - """ - super().__init__( - 'KinesisAnalyticsApplicationUpdated', - 'DescribeApplication', - 'ApplicationDetail.ApplicationStatus', - {status: WaitState.SUCCESS}, - client) - - def wait(self, application_name: str): - """ - Wait for the expected status. - - :param application_name: Name of the Kinesis analytics application. - """ - self._wait(ApplicationName=application_name) - - -class GlueCrawlerReadyWaiter(CustomWaiter): - """ - Subclass of the base custom waiter class. - Wait for the Glue crawler to finish its processing. Return when the crawler is in the "Stopping" status - to avoid wasting too much time in the automation tests on its shutdown process. - """ - def __init__(self, client: botocore.client): - """ - Initialize the waiter. - - :param client: Boto3 client to use. - """ - super().__init__( - 'GlueCrawlerReady', - 'GetCrawler', - 'Crawler.State', - {'STOPPING': WaitState.SUCCESS}, - client) - - def wait(self, crawler_name): - """ - Wait for the expected status. - - :param crawler_name: Name of the Glue crawler. - """ - self._wait(Name=crawler_name) - - -class DataLakeMetricsDeliveredWaiter(CustomWaiter): - """ - Subclass of the base custom waiter class. - Wait for the expected directory being created in the S3 bucket. - """ - def __init__(self, client: botocore.client): - """ - Initialize the waiter. - - :param client: Boto3 client to use. - """ - super().__init__( - 'DataLakeMetricsDelivered', - 'ListObjectsV2', - 'KeyCount > `0`', - {True: WaitState.SUCCESS}, - client) - - def wait(self, bucket_name, prefix): - """ - Wait for the expected directory being created. - - :param bucket_name: Name of the S3 bucket. - :param prefix: Name of the expected directory prefix. - """ - self._wait(Bucket=bucket_name, Prefix=prefix) - - -class CloudWatchMetricsDeliveredWaiter(CustomWaiter): - """ - Subclass of the base custom waiter class. - Wait for the expected metrics being delivered to CloudWatch. - """ - def __init__(self, client: botocore.client): - """ - Initialize the waiter. - - :param client: Boto3 client to use. - """ - super().__init__( - 'CloudWatchMetricsDelivered', - 'GetMetricStatistics', - 'length(Datapoints) > `0`', - {True: WaitState.SUCCESS}, - client) - - def wait(self, namespace, metrics_name, dimensions, start_time): - """ - Wait for the expected metrics being delivered. - - :param namespace: Namespace of the metrics. - :param metrics_name: Name of the metrics. - :param dimensions: Dimensions of the metrics. - :param start_time: Start time for generating the metrics. - """ - self._wait( - Namespace=namespace, - MetricName=metrics_name, - Dimensions=dimensions, - StartTime=start_time, - EndTime=start_time + timedelta(0, self.timeout), - Period=60, - Statistics=[ - 'SampleCount' - ], - Unit='Count' - ) +""" +Copyright (c) Contributors to the Open 3D Engine Project. +For complete copyright and license terms please see the LICENSE at the root of this distribution. + +SPDX-License-Identifier: Apache-2.0 OR MIT +""" + +import botocore.client +import logging + +from datetime import timedelta +from AWS.common.custom_waiter import CustomWaiter, WaitState + +logging.getLogger('boto').setLevel(logging.CRITICAL) + + +class KinesisAnalyticsApplicationUpdatedWaiter(CustomWaiter): + """ + Subclass of the base custom waiter class. + Wait for the Kinesis analytics application being updated to a specific status. + """ + def __init__(self, client: botocore.client, status: str): + """ + Initialize the waiter. + + :param client: Boto3 client to use. + :param status: Expected status. + """ + super().__init__( + 'KinesisAnalyticsApplicationUpdated', + 'DescribeApplication', + 'ApplicationDetail.ApplicationStatus', + {status: WaitState.SUCCESS}, + client) + + def wait(self, application_name: str): + """ + Wait for the expected status. + + :param application_name: Name of the Kinesis analytics application. + """ + self._wait(ApplicationName=application_name) + + +class GlueCrawlerReadyWaiter(CustomWaiter): + """ + Subclass of the base custom waiter class. + Wait for the Glue crawler to finish its processing. Return when the crawler is in the "Stopping" status + to avoid wasting too much time in the automation tests on its shutdown process. + """ + def __init__(self, client: botocore.client): + """ + Initialize the waiter. + + :param client: Boto3 client to use. + """ + super().__init__( + 'GlueCrawlerReady', + 'GetCrawler', + 'Crawler.State', + {'STOPPING': WaitState.SUCCESS}, + client) + + def wait(self, crawler_name): + """ + Wait for the expected status. + + :param crawler_name: Name of the Glue crawler. + """ + self._wait(Name=crawler_name) + + +class DataLakeMetricsDeliveredWaiter(CustomWaiter): + """ + Subclass of the base custom waiter class. + Wait for the expected directory being created in the S3 bucket. + """ + def __init__(self, client: botocore.client): + """ + Initialize the waiter. + + :param client: Boto3 client to use. + """ + super().__init__( + 'DataLakeMetricsDelivered', + 'ListObjectsV2', + 'KeyCount > `0`', + {True: WaitState.SUCCESS}, + client) + + def wait(self, bucket_name, prefix): + """ + Wait for the expected directory being created. + + :param bucket_name: Name of the S3 bucket. + :param prefix: Name of the expected directory prefix. + """ + self._wait(Bucket=bucket_name, Prefix=prefix) + + +class CloudWatchMetricsDeliveredWaiter(CustomWaiter): + """ + Subclass of the base custom waiter class. + Wait for the expected metrics being delivered to CloudWatch. + """ + def __init__(self, client: botocore.client): + """ + Initialize the waiter. + + :param client: Boto3 client to use. + """ + super().__init__( + 'CloudWatchMetricsDelivered', + 'GetMetricStatistics', + 'length(Datapoints) > `0`', + {True: WaitState.SUCCESS}, + client) + + def wait(self, namespace, metrics_name, dimensions, start_time): + """ + Wait for the expected metrics being delivered. + + :param namespace: Namespace of the metrics. + :param metrics_name: Name of the metrics. + :param dimensions: Dimensions of the metrics. + :param start_time: Start time for generating the metrics. + """ + self._wait( + Namespace=namespace, + MetricName=metrics_name, + Dimensions=dimensions, + StartTime=start_time, + EndTime=start_time + timedelta(0, self.timeout), + Period=60, + Statistics=[ + 'SampleCount' + ], + Unit='Count' + ) diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/__init__.py b/AutomatedTesting/Gem/PythonTests/AWS/client_auth/__init__.py similarity index 100% rename from AutomatedTesting/Gem/PythonTests/AWS/Windows/__init__.py rename to AutomatedTesting/Gem/PythonTests/AWS/client_auth/__init__.py diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/aws_client_auth_automation_test.py b/AutomatedTesting/Gem/PythonTests/AWS/client_auth/aws_client_auth_automation_test.py similarity index 94% rename from AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/aws_client_auth_automation_test.py rename to AutomatedTesting/Gem/PythonTests/AWS/client_auth/aws_client_auth_automation_test.py index 077a068a18..b185a155ed 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/aws_client_auth_automation_test.py +++ b/AutomatedTesting/Gem/PythonTests/AWS/client_auth/aws_client_auth_automation_test.py @@ -40,7 +40,7 @@ class TestAWSClientAuthWindows(object): Test class to verify AWS Client Auth gem features on Windows. """ - @pytest.mark.parametrize('level', ['AWS/ClientAuth']) + @pytest.mark.parametrize('level', ['levels/aws/clientauth/clientauth.spawnable']) def test_anonymous_credentials(self, level: str, launcher: pytest.fixture, @@ -72,7 +72,7 @@ class TestAWSClientAuthWindows(object): ) assert result, 'Anonymous credentials fetched successfully.' - @pytest.mark.parametrize('level', ['AWS/ClientAuth']) + @pytest.mark.parametrize('level', ['levels/aws/clientauth/clientauth.spawnable']) def test_anonymous_credentials_no_global_accountid(self, level: str, launcher: pytest.fixture, @@ -140,7 +140,7 @@ class TestAWSClientAuthWindows(object): except cognito_idp.exceptions.UserNotFoundException: pass - launcher.args = ['+LoadLevel', 'AWS/ClientAuthPasswordSignUp'] + launcher.args = ['+LoadLevel', 'levels/aws/clientauthpasswordsignup/clientauthpasswordsignup.spawnable'] launcher.args.extend(['-rhi=null']) with launcher.start(launch_ap=False): @@ -158,7 +158,7 @@ class TestAWSClientAuthWindows(object): Username='test1' ) - launcher.args = ['+LoadLevel', 'AWS/ClientAuthPasswordSignIn'] + launcher.args = ['+LoadLevel', 'levels/aws/clientauthpasswordsignin/clientauthpasswordsignin.spawnable'] launcher.args.extend(['-rhi=null']) with launcher.start(launch_ap=False): diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/__init__.py b/AutomatedTesting/Gem/PythonTests/AWS/core/__init__.py similarity index 99% rename from AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/__init__.py rename to AutomatedTesting/Gem/PythonTests/AWS/core/__init__.py index bbcbcf1807..f5193b300e 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/__init__.py +++ b/AutomatedTesting/Gem/PythonTests/AWS/core/__init__.py @@ -4,4 +4,3 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ - diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/core/test_aws_resource_interaction.py b/AutomatedTesting/Gem/PythonTests/AWS/core/test_aws_resource_interaction.py similarity index 99% rename from AutomatedTesting/Gem/PythonTests/AWS/Windows/core/test_aws_resource_interaction.py rename to AutomatedTesting/Gem/PythonTests/AWS/core/test_aws_resource_interaction.py index 59c517fd1c..367f02cac3 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/Windows/core/test_aws_resource_interaction.py +++ b/AutomatedTesting/Gem/PythonTests/AWS/core/test_aws_resource_interaction.py @@ -84,7 +84,7 @@ def write_test_data_to_dynamodb_table(resource_mappings: pytest.fixture, aws_uti @pytest.mark.parametrize('session_name', [constants.SESSION_NAME]) @pytest.mark.usefixtures('workspace') @pytest.mark.parametrize('project', ['AutomatedTesting']) -@pytest.mark.parametrize('level', ['AWS/Core']) +@pytest.mark.parametrize('level', ['levels/aws/core/core.spawnable']) @pytest.mark.usefixtures('resource_mappings') @pytest.mark.parametrize('resource_mappings_filename', [constants.AWS_RESOURCE_MAPPING_FILE_NAME]) @pytest.mark.parametrize('stacks', [[f'{constants.AWS_PROJECT_NAME}-{AWS_CORE_FEATURE_NAME}', diff --git a/AutomatedTesting/Levels/AWS/ClientAuth/ClientAuth.ly b/AutomatedTesting/Levels/AWS/ClientAuth/ClientAuth.ly deleted file mode 100644 index b4a2d6cb3a..0000000000 --- a/AutomatedTesting/Levels/AWS/ClientAuth/ClientAuth.ly +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:19f2c4454bb395cdc0a36d1e45e6a384bbd23037af1a2fb93e088ecfa0f10e5b -size 9343 diff --git a/AutomatedTesting/Levels/AWS/ClientAuth/ClientAuth.prefab b/AutomatedTesting/Levels/AWS/ClientAuth/ClientAuth.prefab new file mode 100644 index 0000000000..8f2fb61c71 --- /dev/null +++ b/AutomatedTesting/Levels/AWS/ClientAuth/ClientAuth.prefab @@ -0,0 +1,620 @@ +{ + "ContainerEntity": { + "Id": "Entity_[1146574390643]", + "Name": "Level", + "Components": { + "Component_[10641544592923449938]": { + "$type": "EditorInspectorComponent", + "Id": 10641544592923449938 + }, + "Component_[12039882709170782873]": { + "$type": "EditorOnlyEntityComponent", + "Id": 12039882709170782873 + }, + "Component_[12265484671603697631]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12265484671603697631 + }, + "Component_[14126657869720434043]": { + "$type": "EditorEntitySortComponent", + "Id": 14126657869720434043, + "Child Entity Order": [ + "Entity_[1176639161715]", + "Entity_[2670735447885]", + "Entity_[2670735447885]" + ] + }, + "Component_[15230859088967841193]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 15230859088967841193, + "Parent Entity": "" + }, + "Component_[16239496886950819870]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 16239496886950819870 + }, + "Component_[5688118765544765547]": { + "$type": "EditorEntityIconComponent", + "Id": 5688118765544765547 + }, + "Component_[6545738857812235305]": { + "$type": "SelectionComponent", + "Id": 6545738857812235305 + }, + "Component_[7247035804068349658]": { + "$type": "EditorPrefabComponent", + "Id": 7247035804068349658 + }, + "Component_[9307224322037797205]": { + "$type": "EditorLockComponent", + "Id": 9307224322037797205 + }, + "Component_[9562516168917670048]": { + "$type": "EditorVisibilityComponent", + "Id": 9562516168917670048 + } + } + }, + "Entities": { + "Entity_[1155164325235]": { + "Id": "Entity_[1155164325235]", + "Name": "Sun", + "Components": { + "Component_[10440557478882592717]": { + "$type": "SelectionComponent", + "Id": 10440557478882592717 + }, + "Component_[13620450453324765907]": { + "$type": "EditorLockComponent", + "Id": 13620450453324765907 + }, + "Component_[2134313378593666258]": { + "$type": "EditorInspectorComponent", + "Id": 2134313378593666258 + }, + "Component_[234010807770404186]": { + "$type": "EditorVisibilityComponent", + "Id": 234010807770404186 + }, + "Component_[2970359110423865725]": { + "$type": "EditorEntityIconComponent", + "Id": 2970359110423865725 + }, + "Component_[3722854130373041803]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3722854130373041803 + }, + "Component_[5992533738676323195]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5992533738676323195 + }, + "Component_[7378860763541895402]": { + "$type": "AZ::Render::EditorDirectionalLightComponent", + "Id": 7378860763541895402, + "Controller": { + "Configuration": { + "Intensity": 1.0, + "CameraEntityId": "", + "ShadowFilterMethod": 1 + } + } + }, + "Component_[7892834440890947578]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 7892834440890947578, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + 0.0, + 0.0, + 13.487043380737305 + ], + "Rotate": [ + -76.13099670410156, + -0.847000002861023, + -15.8100004196167 + ] + } + }, + "Component_[8599729549570828259]": { + "$type": "EditorEntitySortComponent", + "Id": 8599729549570828259 + }, + "Component_[952797371922080273]": { + "$type": "EditorPendingCompositionComponent", + "Id": 952797371922080273 + } + } + }, + "Entity_[1159459292531]": { + "Id": "Entity_[1159459292531]", + "Name": "Ground", + "Components": { + "Component_[11701138785793981042]": { + "$type": "SelectionComponent", + "Id": 11701138785793981042 + }, + "Component_[12260880513256986252]": { + "$type": "EditorEntityIconComponent", + "Id": 12260880513256986252 + }, + "Component_[13711420870643673468]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13711420870643673468 + }, + "Component_[138002849734991713]": { + "$type": "EditorOnlyEntityComponent", + "Id": 138002849734991713 + }, + "Component_[16578565737331764849]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 16578565737331764849, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[16919232076966545697]": { + "$type": "EditorInspectorComponent", + "Id": 16919232076966545697 + }, + "Component_[5182430712893438093]": { + "$type": "EditorMaterialComponent", + "Id": 5182430712893438093 + }, + "Component_[5675108321710651991]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 5675108321710651991, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{0CD745C0-6AA8-569A-A68A-73A3270986C4}", + "subId": 277889906 + }, + "assetHint": "objects/groudplane/groundplane_512x512m.azmodel" + } + } + } + }, + "Component_[5681893399601237518]": { + "$type": "EditorEntitySortComponent", + "Id": 5681893399601237518 + }, + "Component_[592692962543397545]": { + "$type": "EditorPendingCompositionComponent", + "Id": 592692962543397545 + }, + "Component_[7090012899106946164]": { + "$type": "EditorLockComponent", + "Id": 7090012899106946164 + }, + "Component_[9410832619875640998]": { + "$type": "EditorVisibilityComponent", + "Id": 9410832619875640998 + } + } + }, + "Entity_[1163754259827]": { + "Id": "Entity_[1163754259827]", + "Name": "Camera", + "Components": { + "Component_[11895140916889160460]": { + "$type": "EditorEntityIconComponent", + "Id": 11895140916889160460 + }, + "Component_[16880285896855930892]": { + "$type": "{CA11DA46-29FF-4083-B5F6-E02C3A8C3A3D} EditorCameraComponent", + "Id": 16880285896855930892, + "Controller": { + "Configuration": { + "Field of View": 55.0, + "EditorEntityId": 6861302815203973165 + } + } + }, + "Component_[17187464423780271193]": { + "$type": "EditorLockComponent", + "Id": 17187464423780271193 + }, + "Component_[17495696818315413311]": { + "$type": "EditorEntitySortComponent", + "Id": 17495696818315413311 + }, + "Component_[18086214374043522055]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 18086214374043522055, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + -2.3000001907348633, + -3.9368600845336914, + 1.0 + ], + "Rotate": [ + -2.050307512283325, + 1.9552897214889526, + -43.623355865478516 + ] + } + }, + "Component_[18387556550380114975]": { + "$type": "SelectionComponent", + "Id": 18387556550380114975 + }, + "Component_[2654521436129313160]": { + "$type": "EditorVisibilityComponent", + "Id": 2654521436129313160 + }, + "Component_[5265045084611556958]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5265045084611556958 + }, + "Component_[7169798125182238623]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7169798125182238623 + }, + "Component_[7255796294953281766]": { + "$type": "GenericComponentWrapper", + "Id": 7255796294953281766, + "m_template": { + "$type": "FlyCameraInputComponent" + } + }, + "Component_[8866210352157164042]": { + "$type": "EditorInspectorComponent", + "Id": 8866210352157164042 + }, + "Component_[9129253381063760879]": { + "$type": "EditorOnlyEntityComponent", + "Id": 9129253381063760879 + } + } + }, + "Entity_[1168049227123]": { + "Id": "Entity_[1168049227123]", + "Name": "Grid", + "Components": { + "Component_[11443347433215807130]": { + "$type": "EditorEntityIconComponent", + "Id": 11443347433215807130 + }, + "Component_[11779275529534764488]": { + "$type": "SelectionComponent", + "Id": 11779275529534764488 + }, + "Component_[14249419413039427459]": { + "$type": "EditorInspectorComponent", + "Id": 14249419413039427459 + }, + "Component_[15448581635946161318]": { + "$type": "AZ::Render::EditorGridComponent", + "Id": 15448581635946161318, + "Controller": { + "Configuration": { + "primarySpacing": 4.0, + "primaryColor": [ + 0.501960813999176, + 0.501960813999176, + 0.501960813999176 + ], + "secondarySpacing": 0.5, + "secondaryColor": [ + 0.250980406999588, + 0.250980406999588, + 0.250980406999588 + ] + } + } + }, + "Component_[1843303322527297409]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1843303322527297409 + }, + "Component_[380249072065273654]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 380249072065273654, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[7476660583684339787]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7476660583684339787 + }, + "Component_[7557626501215118375]": { + "$type": "EditorEntitySortComponent", + "Id": 7557626501215118375 + }, + "Component_[7984048488947365511]": { + "$type": "EditorVisibilityComponent", + "Id": 7984048488947365511 + }, + "Component_[8118181039276487398]": { + "$type": "EditorOnlyEntityComponent", + "Id": 8118181039276487398 + }, + "Component_[9189909764215270515]": { + "$type": "EditorLockComponent", + "Id": 9189909764215270515 + } + } + }, + "Entity_[1172344194419]": { + "Id": "Entity_[1172344194419]", + "Name": "Shader Ball", + "Components": { + "Component_[10789351944715265527]": { + "$type": "EditorOnlyEntityComponent", + "Id": 10789351944715265527 + }, + "Component_[12037033284781049225]": { + "$type": "EditorEntitySortComponent", + "Id": 12037033284781049225 + }, + "Component_[13759153306105970079]": { + "$type": "EditorPendingCompositionComponent", + "Id": 13759153306105970079 + }, + "Component_[14135560884830586279]": { + "$type": "EditorInspectorComponent", + "Id": 14135560884830586279 + }, + "Component_[16247165675903986673]": { + "$type": "EditorVisibilityComponent", + "Id": 16247165675903986673 + }, + "Component_[18082433625958885247]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 18082433625958885247 + }, + "Component_[6472623349872972660]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6472623349872972660, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Rotate": [ + 0.0, + 0.10000000149011612, + 180.0 + ] + } + }, + "Component_[6495255223970673916]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 6495255223970673916, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{FD340C30-755C-5911-92A3-19A3F7A77931}", + "subId": 281415304 + }, + "assetHint": "objects/shaderball/shaderball_default_1m.azmodel" + } + } + } + }, + "Component_[8056625192494070973]": { + "$type": "SelectionComponent", + "Id": 8056625192494070973 + }, + "Component_[8550141614185782969]": { + "$type": "EditorEntityIconComponent", + "Id": 8550141614185782969 + }, + "Component_[9439770997198325425]": { + "$type": "EditorLockComponent", + "Id": 9439770997198325425 + } + } + }, + "Entity_[1176639161715]": { + "Id": "Entity_[1176639161715]", + "Name": "Atom Default Environment", + "Components": { + "Component_[10757302973393310045]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 10757302973393310045, + "Parent Entity": "Entity_[1146574390643]" + }, + "Component_[14505817420424255464]": { + "$type": "EditorInspectorComponent", + "Id": 14505817420424255464, + "ComponentOrderEntryArray": [ + { + "ComponentId": 10757302973393310045 + } + ] + }, + "Component_[14988041764659020032]": { + "$type": "EditorLockComponent", + "Id": 14988041764659020032 + }, + "Component_[15808690248755038124]": { + "$type": "SelectionComponent", + "Id": 15808690248755038124 + }, + "Component_[15900837685796817138]": { + "$type": "EditorVisibilityComponent", + "Id": 15900837685796817138 + }, + "Component_[3298767348226484884]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3298767348226484884 + }, + "Component_[4076975109609220594]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4076975109609220594 + }, + "Component_[5679760548946028854]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5679760548946028854 + }, + "Component_[5855590796136709437]": { + "$type": "EditorEntitySortComponent", + "Id": 5855590796136709437, + "Child Entity Order": [ + "Entity_[1155164325235]", + "Entity_[1180934129011]", + "Entity_[1172344194419]", + "Entity_[1168049227123]", + "Entity_[1163754259827]", + "Entity_[1159459292531]" + ] + }, + "Component_[9277695270015777859]": { + "$type": "EditorEntityIconComponent", + "Id": 9277695270015777859 + } + } + }, + "Entity_[1180934129011]": { + "Id": "Entity_[1180934129011]", + "Name": "Global Sky", + "Components": { + "Component_[11231930600558681245]": { + "$type": "AZ::Render::EditorHDRiSkyboxComponent", + "Id": 11231930600558681245, + "Controller": { + "Configuration": { + "CubemapAsset": { + "assetId": { + "guid": "{215E47FD-D181-5832-B1AB-91673ABF6399}", + "subId": 1000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_skyboxcm.exr.streamingimage" + } + } + } + }, + "Component_[11980494120202836095]": { + "$type": "SelectionComponent", + "Id": 11980494120202836095 + }, + "Component_[1428633914413949476]": { + "$type": "EditorLockComponent", + "Id": 1428633914413949476 + }, + "Component_[14936200426671614999]": { + "$type": "AZ::Render::EditorImageBasedLightComponent", + "Id": 14936200426671614999, + "Controller": { + "Configuration": { + "diffuseImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 3000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_ibldiffuse.exr.streamingimage" + }, + "specularImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 2000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_iblspecular.exr.streamingimage" + } + } + } + }, + "Component_[14994774102579326069]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 14994774102579326069 + }, + "Component_[15417479889044493340]": { + "$type": "EditorPendingCompositionComponent", + "Id": 15417479889044493340 + }, + "Component_[15826613364991382688]": { + "$type": "EditorEntitySortComponent", + "Id": 15826613364991382688 + }, + "Component_[1665003113283562343]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1665003113283562343 + }, + "Component_[3704934735944502280]": { + "$type": "EditorEntityIconComponent", + "Id": 3704934735944502280 + }, + "Component_[5698542331457326479]": { + "$type": "EditorVisibilityComponent", + "Id": 5698542331457326479 + }, + "Component_[6644513399057217122]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6644513399057217122, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[931091830724002070]": { + "$type": "EditorInspectorComponent", + "Id": 931091830724002070 + } + } + }, + "Entity_[2670735447885]": { + "Id": "Entity_[2670735447885]", + "Name": "AnonymousAuthorization", + "Components": { + "Component_[11400228652398928245]": { + "$type": "EditorOnlyEntityComponent", + "Id": 11400228652398928245 + }, + "Component_[15542812360906781451]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 15542812360906781451, + "Parent Entity": "Entity_[1146574390643]", + "Transform Data": { + "Translate": [ + 0.0, + 0.10000038146972656, + 4.005923748016357 + ] + } + }, + "Component_[16858205397479531670]": { + "$type": "EditorLockComponent", + "Id": 16858205397479531670 + }, + "Component_[1921474395300693283]": { + "$type": "EditorScriptCanvasComponent", + "Id": 1921474395300693283, + "m_name": "ConitoAnonymousAuthorization.scriptcanvas", + "runtimeDataIsValid": true, + "runtimeDataOverrides": { + "source": { + "id": "{C0B0CEBA-064E-580F-AD81-CFE8CE0D61B1}" + } + }, + "sourceHandle": { + "id": "{C0B0CEBA-064E-580F-AD81-CFE8CE0D61B1}" + } + }, + "Component_[2312432053711106201]": { + "$type": "EditorEntityIconComponent", + "Id": 2312432053711106201 + }, + "Component_[4066858233846929269]": { + "$type": "EditorEntitySortComponent", + "Id": 4066858233846929269 + }, + "Component_[6542133807409587028]": { + "$type": "EditorPendingCompositionComponent", + "Id": 6542133807409587028 + }, + "Component_[7002965736546436267]": { + "$type": "SelectionComponent", + "Id": 7002965736546436267 + }, + "Component_[7455250879152263787]": { + "$type": "EditorVisibilityComponent", + "Id": 7455250879152263787 + }, + "Component_[8081535907930415421]": { + "$type": "EditorInspectorComponent", + "Id": 8081535907930415421 + }, + "Component_[9630473919092479415]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 9630473919092479415 + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/AWS/ClientAuth/filelist.xml b/AutomatedTesting/Levels/AWS/ClientAuth/filelist.xml deleted file mode 100644 index 6b5b5a8727..0000000000 --- a/AutomatedTesting/Levels/AWS/ClientAuth/filelist.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/AutomatedTesting/Levels/AWS/ClientAuth/level.pak b/AutomatedTesting/Levels/AWS/ClientAuth/level.pak deleted file mode 100644 index bd791070e9..0000000000 --- a/AutomatedTesting/Levels/AWS/ClientAuth/level.pak +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8a674e05824e5ceec13a0487b318923568710bc8269e5be84adad59c495a7ceb -size 3610 diff --git a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/ClientAuthPasswordSignIn.ly b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/ClientAuthPasswordSignIn.ly deleted file mode 100644 index 40d9ad619c..0000000000 --- a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/ClientAuthPasswordSignIn.ly +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a1c0b621525b8e88c3775ea4c60c2197d1e1b060ace9bad9d6efcb0532817e44 -size 9356 diff --git a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/ClientAuthPasswordSignIn.prefab b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/ClientAuthPasswordSignIn.prefab new file mode 100644 index 0000000000..46c01bbb0f --- /dev/null +++ b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/ClientAuthPasswordSignIn.prefab @@ -0,0 +1,620 @@ +{ + "ContainerEntity": { + "Id": "Entity_[1146574390643]", + "Name": "Level", + "Components": { + "Component_[10641544592923449938]": { + "$type": "EditorInspectorComponent", + "Id": 10641544592923449938 + }, + "Component_[12039882709170782873]": { + "$type": "EditorOnlyEntityComponent", + "Id": 12039882709170782873 + }, + "Component_[12265484671603697631]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12265484671603697631 + }, + "Component_[14126657869720434043]": { + "$type": "EditorEntitySortComponent", + "Id": 14126657869720434043, + "Child Entity Order": [ + "Entity_[1176639161715]", + "Entity_[3263440934733]", + "Entity_[3263440934733]" + ] + }, + "Component_[15230859088967841193]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 15230859088967841193, + "Parent Entity": "" + }, + "Component_[16239496886950819870]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 16239496886950819870 + }, + "Component_[5688118765544765547]": { + "$type": "EditorEntityIconComponent", + "Id": 5688118765544765547 + }, + "Component_[6545738857812235305]": { + "$type": "SelectionComponent", + "Id": 6545738857812235305 + }, + "Component_[7247035804068349658]": { + "$type": "EditorPrefabComponent", + "Id": 7247035804068349658 + }, + "Component_[9307224322037797205]": { + "$type": "EditorLockComponent", + "Id": 9307224322037797205 + }, + "Component_[9562516168917670048]": { + "$type": "EditorVisibilityComponent", + "Id": 9562516168917670048 + } + } + }, + "Entities": { + "Entity_[1155164325235]": { + "Id": "Entity_[1155164325235]", + "Name": "Sun", + "Components": { + "Component_[10440557478882592717]": { + "$type": "SelectionComponent", + "Id": 10440557478882592717 + }, + "Component_[13620450453324765907]": { + "$type": "EditorLockComponent", + "Id": 13620450453324765907 + }, + "Component_[2134313378593666258]": { + "$type": "EditorInspectorComponent", + "Id": 2134313378593666258 + }, + "Component_[234010807770404186]": { + "$type": "EditorVisibilityComponent", + "Id": 234010807770404186 + }, + "Component_[2970359110423865725]": { + "$type": "EditorEntityIconComponent", + "Id": 2970359110423865725 + }, + "Component_[3722854130373041803]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3722854130373041803 + }, + "Component_[5992533738676323195]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5992533738676323195 + }, + "Component_[7378860763541895402]": { + "$type": "AZ::Render::EditorDirectionalLightComponent", + "Id": 7378860763541895402, + "Controller": { + "Configuration": { + "Intensity": 1.0, + "CameraEntityId": "", + "ShadowFilterMethod": 1 + } + } + }, + "Component_[7892834440890947578]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 7892834440890947578, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + 0.0, + 0.0, + 13.487043380737305 + ], + "Rotate": [ + -76.13099670410156, + -0.847000002861023, + -15.8100004196167 + ] + } + }, + "Component_[8599729549570828259]": { + "$type": "EditorEntitySortComponent", + "Id": 8599729549570828259 + }, + "Component_[952797371922080273]": { + "$type": "EditorPendingCompositionComponent", + "Id": 952797371922080273 + } + } + }, + "Entity_[1159459292531]": { + "Id": "Entity_[1159459292531]", + "Name": "Ground", + "Components": { + "Component_[11701138785793981042]": { + "$type": "SelectionComponent", + "Id": 11701138785793981042 + }, + "Component_[12260880513256986252]": { + "$type": "EditorEntityIconComponent", + "Id": 12260880513256986252 + }, + "Component_[13711420870643673468]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13711420870643673468 + }, + "Component_[138002849734991713]": { + "$type": "EditorOnlyEntityComponent", + "Id": 138002849734991713 + }, + "Component_[16578565737331764849]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 16578565737331764849, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[16919232076966545697]": { + "$type": "EditorInspectorComponent", + "Id": 16919232076966545697 + }, + "Component_[5182430712893438093]": { + "$type": "EditorMaterialComponent", + "Id": 5182430712893438093 + }, + "Component_[5675108321710651991]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 5675108321710651991, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{0CD745C0-6AA8-569A-A68A-73A3270986C4}", + "subId": 277889906 + }, + "assetHint": "objects/groudplane/groundplane_512x512m.azmodel" + } + } + } + }, + "Component_[5681893399601237518]": { + "$type": "EditorEntitySortComponent", + "Id": 5681893399601237518 + }, + "Component_[592692962543397545]": { + "$type": "EditorPendingCompositionComponent", + "Id": 592692962543397545 + }, + "Component_[7090012899106946164]": { + "$type": "EditorLockComponent", + "Id": 7090012899106946164 + }, + "Component_[9410832619875640998]": { + "$type": "EditorVisibilityComponent", + "Id": 9410832619875640998 + } + } + }, + "Entity_[1163754259827]": { + "Id": "Entity_[1163754259827]", + "Name": "Camera", + "Components": { + "Component_[11895140916889160460]": { + "$type": "EditorEntityIconComponent", + "Id": 11895140916889160460 + }, + "Component_[16880285896855930892]": { + "$type": "{CA11DA46-29FF-4083-B5F6-E02C3A8C3A3D} EditorCameraComponent", + "Id": 16880285896855930892, + "Controller": { + "Configuration": { + "Field of View": 55.0, + "EditorEntityId": 6861302815203973165 + } + } + }, + "Component_[17187464423780271193]": { + "$type": "EditorLockComponent", + "Id": 17187464423780271193 + }, + "Component_[17495696818315413311]": { + "$type": "EditorEntitySortComponent", + "Id": 17495696818315413311 + }, + "Component_[18086214374043522055]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 18086214374043522055, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + -2.3000001907348633, + -3.9368600845336914, + 1.0 + ], + "Rotate": [ + -2.050307512283325, + 1.9552897214889526, + -43.623355865478516 + ] + } + }, + "Component_[18387556550380114975]": { + "$type": "SelectionComponent", + "Id": 18387556550380114975 + }, + "Component_[2654521436129313160]": { + "$type": "EditorVisibilityComponent", + "Id": 2654521436129313160 + }, + "Component_[5265045084611556958]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5265045084611556958 + }, + "Component_[7169798125182238623]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7169798125182238623 + }, + "Component_[7255796294953281766]": { + "$type": "GenericComponentWrapper", + "Id": 7255796294953281766, + "m_template": { + "$type": "FlyCameraInputComponent" + } + }, + "Component_[8866210352157164042]": { + "$type": "EditorInspectorComponent", + "Id": 8866210352157164042 + }, + "Component_[9129253381063760879]": { + "$type": "EditorOnlyEntityComponent", + "Id": 9129253381063760879 + } + } + }, + "Entity_[1168049227123]": { + "Id": "Entity_[1168049227123]", + "Name": "Grid", + "Components": { + "Component_[11443347433215807130]": { + "$type": "EditorEntityIconComponent", + "Id": 11443347433215807130 + }, + "Component_[11779275529534764488]": { + "$type": "SelectionComponent", + "Id": 11779275529534764488 + }, + "Component_[14249419413039427459]": { + "$type": "EditorInspectorComponent", + "Id": 14249419413039427459 + }, + "Component_[15448581635946161318]": { + "$type": "AZ::Render::EditorGridComponent", + "Id": 15448581635946161318, + "Controller": { + "Configuration": { + "primarySpacing": 4.0, + "primaryColor": [ + 0.501960813999176, + 0.501960813999176, + 0.501960813999176 + ], + "secondarySpacing": 0.5, + "secondaryColor": [ + 0.250980406999588, + 0.250980406999588, + 0.250980406999588 + ] + } + } + }, + "Component_[1843303322527297409]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1843303322527297409 + }, + "Component_[380249072065273654]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 380249072065273654, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[7476660583684339787]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7476660583684339787 + }, + "Component_[7557626501215118375]": { + "$type": "EditorEntitySortComponent", + "Id": 7557626501215118375 + }, + "Component_[7984048488947365511]": { + "$type": "EditorVisibilityComponent", + "Id": 7984048488947365511 + }, + "Component_[8118181039276487398]": { + "$type": "EditorOnlyEntityComponent", + "Id": 8118181039276487398 + }, + "Component_[9189909764215270515]": { + "$type": "EditorLockComponent", + "Id": 9189909764215270515 + } + } + }, + "Entity_[1172344194419]": { + "Id": "Entity_[1172344194419]", + "Name": "Shader Ball", + "Components": { + "Component_[10789351944715265527]": { + "$type": "EditorOnlyEntityComponent", + "Id": 10789351944715265527 + }, + "Component_[12037033284781049225]": { + "$type": "EditorEntitySortComponent", + "Id": 12037033284781049225 + }, + "Component_[13759153306105970079]": { + "$type": "EditorPendingCompositionComponent", + "Id": 13759153306105970079 + }, + "Component_[14135560884830586279]": { + "$type": "EditorInspectorComponent", + "Id": 14135560884830586279 + }, + "Component_[16247165675903986673]": { + "$type": "EditorVisibilityComponent", + "Id": 16247165675903986673 + }, + "Component_[18082433625958885247]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 18082433625958885247 + }, + "Component_[6472623349872972660]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6472623349872972660, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Rotate": [ + 0.0, + 0.10000000149011612, + 180.0 + ] + } + }, + "Component_[6495255223970673916]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 6495255223970673916, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{FD340C30-755C-5911-92A3-19A3F7A77931}", + "subId": 281415304 + }, + "assetHint": "objects/shaderball/shaderball_default_1m.azmodel" + } + } + } + }, + "Component_[8056625192494070973]": { + "$type": "SelectionComponent", + "Id": 8056625192494070973 + }, + "Component_[8550141614185782969]": { + "$type": "EditorEntityIconComponent", + "Id": 8550141614185782969 + }, + "Component_[9439770997198325425]": { + "$type": "EditorLockComponent", + "Id": 9439770997198325425 + } + } + }, + "Entity_[1176639161715]": { + "Id": "Entity_[1176639161715]", + "Name": "Atom Default Environment", + "Components": { + "Component_[10757302973393310045]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 10757302973393310045, + "Parent Entity": "Entity_[1146574390643]" + }, + "Component_[14505817420424255464]": { + "$type": "EditorInspectorComponent", + "Id": 14505817420424255464, + "ComponentOrderEntryArray": [ + { + "ComponentId": 10757302973393310045 + } + ] + }, + "Component_[14988041764659020032]": { + "$type": "EditorLockComponent", + "Id": 14988041764659020032 + }, + "Component_[15808690248755038124]": { + "$type": "SelectionComponent", + "Id": 15808690248755038124 + }, + "Component_[15900837685796817138]": { + "$type": "EditorVisibilityComponent", + "Id": 15900837685796817138 + }, + "Component_[3298767348226484884]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3298767348226484884 + }, + "Component_[4076975109609220594]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4076975109609220594 + }, + "Component_[5679760548946028854]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5679760548946028854 + }, + "Component_[5855590796136709437]": { + "$type": "EditorEntitySortComponent", + "Id": 5855590796136709437, + "Child Entity Order": [ + "Entity_[1155164325235]", + "Entity_[1180934129011]", + "Entity_[1172344194419]", + "Entity_[1168049227123]", + "Entity_[1163754259827]", + "Entity_[1159459292531]" + ] + }, + "Component_[9277695270015777859]": { + "$type": "EditorEntityIconComponent", + "Id": 9277695270015777859 + } + } + }, + "Entity_[1180934129011]": { + "Id": "Entity_[1180934129011]", + "Name": "Global Sky", + "Components": { + "Component_[11231930600558681245]": { + "$type": "AZ::Render::EditorHDRiSkyboxComponent", + "Id": 11231930600558681245, + "Controller": { + "Configuration": { + "CubemapAsset": { + "assetId": { + "guid": "{215E47FD-D181-5832-B1AB-91673ABF6399}", + "subId": 1000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_skyboxcm.exr.streamingimage" + } + } + } + }, + "Component_[11980494120202836095]": { + "$type": "SelectionComponent", + "Id": 11980494120202836095 + }, + "Component_[1428633914413949476]": { + "$type": "EditorLockComponent", + "Id": 1428633914413949476 + }, + "Component_[14936200426671614999]": { + "$type": "AZ::Render::EditorImageBasedLightComponent", + "Id": 14936200426671614999, + "Controller": { + "Configuration": { + "diffuseImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 3000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_ibldiffuse.exr.streamingimage" + }, + "specularImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 2000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_iblspecular.exr.streamingimage" + } + } + } + }, + "Component_[14994774102579326069]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 14994774102579326069 + }, + "Component_[15417479889044493340]": { + "$type": "EditorPendingCompositionComponent", + "Id": 15417479889044493340 + }, + "Component_[15826613364991382688]": { + "$type": "EditorEntitySortComponent", + "Id": 15826613364991382688 + }, + "Component_[1665003113283562343]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1665003113283562343 + }, + "Component_[3704934735944502280]": { + "$type": "EditorEntityIconComponent", + "Id": 3704934735944502280 + }, + "Component_[5698542331457326479]": { + "$type": "EditorVisibilityComponent", + "Id": 5698542331457326479 + }, + "Component_[6644513399057217122]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6644513399057217122, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[931091830724002070]": { + "$type": "EditorInspectorComponent", + "Id": 931091830724002070 + } + } + }, + "Entity_[3263440934733]": { + "Id": "Entity_[3263440934733]", + "Name": "Auth", + "Components": { + "Component_[10677660472305013611]": { + "$type": "EditorPendingCompositionComponent", + "Id": 10677660472305013611 + }, + "Component_[12020966173483420539]": { + "$type": "EditorInspectorComponent", + "Id": 12020966173483420539 + }, + "Component_[1395011275436594572]": { + "$type": "EditorLockComponent", + "Id": 1395011275436594572 + }, + "Component_[14204408480276164321]": { + "$type": "EditorScriptCanvasComponent", + "Id": 14204408480276164321, + "m_name": "PasswordSignIn.scriptcanvas", + "runtimeDataIsValid": true, + "runtimeDataOverrides": { + "source": { + "id": "{DA0FCA2B-66E4-575B-802E-BA93F35690C1}" + } + }, + "sourceHandle": { + "id": "{DA0FCA2B-66E4-575B-802E-BA93F35690C1}" + } + }, + "Component_[15510129631063791276]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 15510129631063791276 + }, + "Component_[2829815269827202953]": { + "$type": "EditorEntitySortComponent", + "Id": 2829815269827202953 + }, + "Component_[4152540778425032559]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 4152540778425032559, + "Parent Entity": "Entity_[1146574390643]", + "Transform Data": { + "Translate": [ + 0.0, + 0.10000038146972656, + 4.005923748016357 + ] + } + }, + "Component_[4562090268412258507]": { + "$type": "EditorEntityIconComponent", + "Id": 4562090268412258507 + }, + "Component_[4826060551136971267]": { + "$type": "SelectionComponent", + "Id": 4826060551136971267 + }, + "Component_[8974703175361704047]": { + "$type": "EditorVisibilityComponent", + "Id": 8974703175361704047 + }, + "Component_[9513341577149946975]": { + "$type": "EditorOnlyEntityComponent", + "Id": 9513341577149946975 + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/filelist.xml b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/filelist.xml deleted file mode 100644 index ce3f3f3407..0000000000 --- a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/filelist.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/level.pak b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/level.pak deleted file mode 100644 index 1af55520b6..0000000000 --- a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignIn/level.pak +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f318a1787069385de291660f79e350cea2ca2c3ef3b5e0576686066bd9c49395 -size 3667 diff --git a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/ClientAuthPasswordSignUp.ly b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/ClientAuthPasswordSignUp.ly deleted file mode 100644 index b3f66ff34a..0000000000 --- a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/ClientAuthPasswordSignUp.ly +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:afc5d665128738e6bea09e78a16ee38acc923a8ecefff90d987858ce72c395fa -size 9360 diff --git a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/ClientAuthPasswordSignUp.prefab b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/ClientAuthPasswordSignUp.prefab new file mode 100644 index 0000000000..3d85ec02a5 --- /dev/null +++ b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/ClientAuthPasswordSignUp.prefab @@ -0,0 +1,620 @@ +{ + "ContainerEntity": { + "Id": "Entity_[1146574390643]", + "Name": "Level", + "Components": { + "Component_[10641544592923449938]": { + "$type": "EditorInspectorComponent", + "Id": 10641544592923449938 + }, + "Component_[12039882709170782873]": { + "$type": "EditorOnlyEntityComponent", + "Id": 12039882709170782873 + }, + "Component_[12265484671603697631]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12265484671603697631 + }, + "Component_[14126657869720434043]": { + "$type": "EditorEntitySortComponent", + "Id": 14126657869720434043, + "Child Entity Order": [ + "Entity_[1176639161715]", + "Entity_[3851851454285]", + "Entity_[3851851454285]" + ] + }, + "Component_[15230859088967841193]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 15230859088967841193, + "Parent Entity": "" + }, + "Component_[16239496886950819870]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 16239496886950819870 + }, + "Component_[5688118765544765547]": { + "$type": "EditorEntityIconComponent", + "Id": 5688118765544765547 + }, + "Component_[6545738857812235305]": { + "$type": "SelectionComponent", + "Id": 6545738857812235305 + }, + "Component_[7247035804068349658]": { + "$type": "EditorPrefabComponent", + "Id": 7247035804068349658 + }, + "Component_[9307224322037797205]": { + "$type": "EditorLockComponent", + "Id": 9307224322037797205 + }, + "Component_[9562516168917670048]": { + "$type": "EditorVisibilityComponent", + "Id": 9562516168917670048 + } + } + }, + "Entities": { + "Entity_[1155164325235]": { + "Id": "Entity_[1155164325235]", + "Name": "Sun", + "Components": { + "Component_[10440557478882592717]": { + "$type": "SelectionComponent", + "Id": 10440557478882592717 + }, + "Component_[13620450453324765907]": { + "$type": "EditorLockComponent", + "Id": 13620450453324765907 + }, + "Component_[2134313378593666258]": { + "$type": "EditorInspectorComponent", + "Id": 2134313378593666258 + }, + "Component_[234010807770404186]": { + "$type": "EditorVisibilityComponent", + "Id": 234010807770404186 + }, + "Component_[2970359110423865725]": { + "$type": "EditorEntityIconComponent", + "Id": 2970359110423865725 + }, + "Component_[3722854130373041803]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3722854130373041803 + }, + "Component_[5992533738676323195]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5992533738676323195 + }, + "Component_[7378860763541895402]": { + "$type": "AZ::Render::EditorDirectionalLightComponent", + "Id": 7378860763541895402, + "Controller": { + "Configuration": { + "Intensity": 1.0, + "CameraEntityId": "", + "ShadowFilterMethod": 1 + } + } + }, + "Component_[7892834440890947578]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 7892834440890947578, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + 0.0, + 0.0, + 13.487043380737305 + ], + "Rotate": [ + -76.13099670410156, + -0.847000002861023, + -15.8100004196167 + ] + } + }, + "Component_[8599729549570828259]": { + "$type": "EditorEntitySortComponent", + "Id": 8599729549570828259 + }, + "Component_[952797371922080273]": { + "$type": "EditorPendingCompositionComponent", + "Id": 952797371922080273 + } + } + }, + "Entity_[1159459292531]": { + "Id": "Entity_[1159459292531]", + "Name": "Ground", + "Components": { + "Component_[11701138785793981042]": { + "$type": "SelectionComponent", + "Id": 11701138785793981042 + }, + "Component_[12260880513256986252]": { + "$type": "EditorEntityIconComponent", + "Id": 12260880513256986252 + }, + "Component_[13711420870643673468]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13711420870643673468 + }, + "Component_[138002849734991713]": { + "$type": "EditorOnlyEntityComponent", + "Id": 138002849734991713 + }, + "Component_[16578565737331764849]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 16578565737331764849, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[16919232076966545697]": { + "$type": "EditorInspectorComponent", + "Id": 16919232076966545697 + }, + "Component_[5182430712893438093]": { + "$type": "EditorMaterialComponent", + "Id": 5182430712893438093 + }, + "Component_[5675108321710651991]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 5675108321710651991, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{0CD745C0-6AA8-569A-A68A-73A3270986C4}", + "subId": 277889906 + }, + "assetHint": "objects/groudplane/groundplane_512x512m.azmodel" + } + } + } + }, + "Component_[5681893399601237518]": { + "$type": "EditorEntitySortComponent", + "Id": 5681893399601237518 + }, + "Component_[592692962543397545]": { + "$type": "EditorPendingCompositionComponent", + "Id": 592692962543397545 + }, + "Component_[7090012899106946164]": { + "$type": "EditorLockComponent", + "Id": 7090012899106946164 + }, + "Component_[9410832619875640998]": { + "$type": "EditorVisibilityComponent", + "Id": 9410832619875640998 + } + } + }, + "Entity_[1163754259827]": { + "Id": "Entity_[1163754259827]", + "Name": "Camera", + "Components": { + "Component_[11895140916889160460]": { + "$type": "EditorEntityIconComponent", + "Id": 11895140916889160460 + }, + "Component_[16880285896855930892]": { + "$type": "{CA11DA46-29FF-4083-B5F6-E02C3A8C3A3D} EditorCameraComponent", + "Id": 16880285896855930892, + "Controller": { + "Configuration": { + "Field of View": 55.0, + "EditorEntityId": 6861302815203973165 + } + } + }, + "Component_[17187464423780271193]": { + "$type": "EditorLockComponent", + "Id": 17187464423780271193 + }, + "Component_[17495696818315413311]": { + "$type": "EditorEntitySortComponent", + "Id": 17495696818315413311 + }, + "Component_[18086214374043522055]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 18086214374043522055, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + -2.3000001907348633, + -3.9368600845336914, + 1.0 + ], + "Rotate": [ + -2.050307512283325, + 1.9552897214889526, + -43.623355865478516 + ] + } + }, + "Component_[18387556550380114975]": { + "$type": "SelectionComponent", + "Id": 18387556550380114975 + }, + "Component_[2654521436129313160]": { + "$type": "EditorVisibilityComponent", + "Id": 2654521436129313160 + }, + "Component_[5265045084611556958]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5265045084611556958 + }, + "Component_[7169798125182238623]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7169798125182238623 + }, + "Component_[7255796294953281766]": { + "$type": "GenericComponentWrapper", + "Id": 7255796294953281766, + "m_template": { + "$type": "FlyCameraInputComponent" + } + }, + "Component_[8866210352157164042]": { + "$type": "EditorInspectorComponent", + "Id": 8866210352157164042 + }, + "Component_[9129253381063760879]": { + "$type": "EditorOnlyEntityComponent", + "Id": 9129253381063760879 + } + } + }, + "Entity_[1168049227123]": { + "Id": "Entity_[1168049227123]", + "Name": "Grid", + "Components": { + "Component_[11443347433215807130]": { + "$type": "EditorEntityIconComponent", + "Id": 11443347433215807130 + }, + "Component_[11779275529534764488]": { + "$type": "SelectionComponent", + "Id": 11779275529534764488 + }, + "Component_[14249419413039427459]": { + "$type": "EditorInspectorComponent", + "Id": 14249419413039427459 + }, + "Component_[15448581635946161318]": { + "$type": "AZ::Render::EditorGridComponent", + "Id": 15448581635946161318, + "Controller": { + "Configuration": { + "primarySpacing": 4.0, + "primaryColor": [ + 0.501960813999176, + 0.501960813999176, + 0.501960813999176 + ], + "secondarySpacing": 0.5, + "secondaryColor": [ + 0.250980406999588, + 0.250980406999588, + 0.250980406999588 + ] + } + } + }, + "Component_[1843303322527297409]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1843303322527297409 + }, + "Component_[380249072065273654]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 380249072065273654, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[7476660583684339787]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7476660583684339787 + }, + "Component_[7557626501215118375]": { + "$type": "EditorEntitySortComponent", + "Id": 7557626501215118375 + }, + "Component_[7984048488947365511]": { + "$type": "EditorVisibilityComponent", + "Id": 7984048488947365511 + }, + "Component_[8118181039276487398]": { + "$type": "EditorOnlyEntityComponent", + "Id": 8118181039276487398 + }, + "Component_[9189909764215270515]": { + "$type": "EditorLockComponent", + "Id": 9189909764215270515 + } + } + }, + "Entity_[1172344194419]": { + "Id": "Entity_[1172344194419]", + "Name": "Shader Ball", + "Components": { + "Component_[10789351944715265527]": { + "$type": "EditorOnlyEntityComponent", + "Id": 10789351944715265527 + }, + "Component_[12037033284781049225]": { + "$type": "EditorEntitySortComponent", + "Id": 12037033284781049225 + }, + "Component_[13759153306105970079]": { + "$type": "EditorPendingCompositionComponent", + "Id": 13759153306105970079 + }, + "Component_[14135560884830586279]": { + "$type": "EditorInspectorComponent", + "Id": 14135560884830586279 + }, + "Component_[16247165675903986673]": { + "$type": "EditorVisibilityComponent", + "Id": 16247165675903986673 + }, + "Component_[18082433625958885247]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 18082433625958885247 + }, + "Component_[6472623349872972660]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6472623349872972660, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Rotate": [ + 0.0, + 0.10000000149011612, + 180.0 + ] + } + }, + "Component_[6495255223970673916]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 6495255223970673916, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{FD340C30-755C-5911-92A3-19A3F7A77931}", + "subId": 281415304 + }, + "assetHint": "objects/shaderball/shaderball_default_1m.azmodel" + } + } + } + }, + "Component_[8056625192494070973]": { + "$type": "SelectionComponent", + "Id": 8056625192494070973 + }, + "Component_[8550141614185782969]": { + "$type": "EditorEntityIconComponent", + "Id": 8550141614185782969 + }, + "Component_[9439770997198325425]": { + "$type": "EditorLockComponent", + "Id": 9439770997198325425 + } + } + }, + "Entity_[1176639161715]": { + "Id": "Entity_[1176639161715]", + "Name": "Atom Default Environment", + "Components": { + "Component_[10757302973393310045]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 10757302973393310045, + "Parent Entity": "Entity_[1146574390643]" + }, + "Component_[14505817420424255464]": { + "$type": "EditorInspectorComponent", + "Id": 14505817420424255464, + "ComponentOrderEntryArray": [ + { + "ComponentId": 10757302973393310045 + } + ] + }, + "Component_[14988041764659020032]": { + "$type": "EditorLockComponent", + "Id": 14988041764659020032 + }, + "Component_[15808690248755038124]": { + "$type": "SelectionComponent", + "Id": 15808690248755038124 + }, + "Component_[15900837685796817138]": { + "$type": "EditorVisibilityComponent", + "Id": 15900837685796817138 + }, + "Component_[3298767348226484884]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3298767348226484884 + }, + "Component_[4076975109609220594]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4076975109609220594 + }, + "Component_[5679760548946028854]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5679760548946028854 + }, + "Component_[5855590796136709437]": { + "$type": "EditorEntitySortComponent", + "Id": 5855590796136709437, + "Child Entity Order": [ + "Entity_[1155164325235]", + "Entity_[1180934129011]", + "Entity_[1172344194419]", + "Entity_[1168049227123]", + "Entity_[1163754259827]", + "Entity_[1159459292531]" + ] + }, + "Component_[9277695270015777859]": { + "$type": "EditorEntityIconComponent", + "Id": 9277695270015777859 + } + } + }, + "Entity_[1180934129011]": { + "Id": "Entity_[1180934129011]", + "Name": "Global Sky", + "Components": { + "Component_[11231930600558681245]": { + "$type": "AZ::Render::EditorHDRiSkyboxComponent", + "Id": 11231930600558681245, + "Controller": { + "Configuration": { + "CubemapAsset": { + "assetId": { + "guid": "{215E47FD-D181-5832-B1AB-91673ABF6399}", + "subId": 1000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_skyboxcm.exr.streamingimage" + } + } + } + }, + "Component_[11980494120202836095]": { + "$type": "SelectionComponent", + "Id": 11980494120202836095 + }, + "Component_[1428633914413949476]": { + "$type": "EditorLockComponent", + "Id": 1428633914413949476 + }, + "Component_[14936200426671614999]": { + "$type": "AZ::Render::EditorImageBasedLightComponent", + "Id": 14936200426671614999, + "Controller": { + "Configuration": { + "diffuseImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 3000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_ibldiffuse.exr.streamingimage" + }, + "specularImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 2000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_iblspecular.exr.streamingimage" + } + } + } + }, + "Component_[14994774102579326069]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 14994774102579326069 + }, + "Component_[15417479889044493340]": { + "$type": "EditorPendingCompositionComponent", + "Id": 15417479889044493340 + }, + "Component_[15826613364991382688]": { + "$type": "EditorEntitySortComponent", + "Id": 15826613364991382688 + }, + "Component_[1665003113283562343]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1665003113283562343 + }, + "Component_[3704934735944502280]": { + "$type": "EditorEntityIconComponent", + "Id": 3704934735944502280 + }, + "Component_[5698542331457326479]": { + "$type": "EditorVisibilityComponent", + "Id": 5698542331457326479 + }, + "Component_[6644513399057217122]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6644513399057217122, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[931091830724002070]": { + "$type": "EditorInspectorComponent", + "Id": 931091830724002070 + } + } + }, + "Entity_[3851851454285]": { + "Id": "Entity_[3851851454285]", + "Name": "Auth", + "Components": { + "Component_[10199578265902796701]": { + "$type": "EditorScriptCanvasComponent", + "Id": 10199578265902796701, + "m_name": "PasswordSignUp.scriptcanvas", + "runtimeDataIsValid": true, + "runtimeDataOverrides": { + "source": { + "id": "{367CEE66-3A7D-549E-BD69-C63612B3F12D}" + } + }, + "sourceHandle": { + "id": "{367CEE66-3A7D-549E-BD69-C63612B3F12D}" + } + }, + "Component_[10665743855533689275]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 10665743855533689275 + }, + "Component_[15982638153420818774]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 15982638153420818774, + "Parent Entity": "Entity_[1146574390643]", + "Transform Data": { + "Translate": [ + 0.0, + 0.10000038146972656, + 4.005923748016357 + ] + } + }, + "Component_[17743308263820862394]": { + "$type": "EditorOnlyEntityComponent", + "Id": 17743308263820862394 + }, + "Component_[18074634570765223479]": { + "$type": "SelectionComponent", + "Id": 18074634570765223479 + }, + "Component_[3471158028107369345]": { + "$type": "EditorEntityIconComponent", + "Id": 3471158028107369345 + }, + "Component_[376079292001997684]": { + "$type": "EditorInspectorComponent", + "Id": 376079292001997684 + }, + "Component_[4387781728620577034]": { + "$type": "EditorLockComponent", + "Id": 4387781728620577034 + }, + "Component_[8591645353763910598]": { + "$type": "EditorEntitySortComponent", + "Id": 8591645353763910598 + }, + "Component_[9373910525775599099]": { + "$type": "EditorVisibilityComponent", + "Id": 9373910525775599099 + }, + "Component_[9394316863271268125]": { + "$type": "EditorPendingCompositionComponent", + "Id": 9394316863271268125 + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/filelist.xml b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/filelist.xml deleted file mode 100644 index 6565342dd4..0000000000 --- a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/filelist.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/level.pak b/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/level.pak deleted file mode 100644 index 781de219f7..0000000000 --- a/AutomatedTesting/Levels/AWS/ClientAuthPasswordSignUp/level.pak +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:87882b64688a77815d93c6973929fa21b89dc6c13d4866c710124ce2cd0f411e -size 3652 diff --git a/AutomatedTesting/Levels/AWS/Core/Core.ly b/AutomatedTesting/Levels/AWS/Core/Core.ly deleted file mode 100644 index 8b01ee7abe..0000000000 --- a/AutomatedTesting/Levels/AWS/Core/Core.ly +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5242a9b598bc329ef2af2b114092e4e50c7c398cdde4605a0717b0b3ce66d797 -size 10030 diff --git a/AutomatedTesting/Levels/AWS/Core/Core.prefab b/AutomatedTesting/Levels/AWS/Core/Core.prefab new file mode 100644 index 0000000000..3d2749849b --- /dev/null +++ b/AutomatedTesting/Levels/AWS/Core/Core.prefab @@ -0,0 +1,758 @@ +{ + "ContainerEntity": { + "Id": "Entity_[1146574390643]", + "Name": "Level", + "Components": { + "Component_[10641544592923449938]": { + "$type": "EditorInspectorComponent", + "Id": 10641544592923449938 + }, + "Component_[12039882709170782873]": { + "$type": "EditorOnlyEntityComponent", + "Id": 12039882709170782873 + }, + "Component_[12265484671603697631]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12265484671603697631 + }, + "Component_[14126657869720434043]": { + "$type": "EditorEntitySortComponent", + "Id": 14126657869720434043, + "Child Entity Order": [ + "Entity_[1176639161715]", + "Entity_[1386540226381]", + "Entity_[1390835193677]", + "Entity_[1395130160973]", + "Entity_[1395130160973]" + ] + }, + "Component_[15230859088967841193]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 15230859088967841193, + "Parent Entity": "" + }, + "Component_[16239496886950819870]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 16239496886950819870 + }, + "Component_[5688118765544765547]": { + "$type": "EditorEntityIconComponent", + "Id": 5688118765544765547 + }, + "Component_[6545738857812235305]": { + "$type": "SelectionComponent", + "Id": 6545738857812235305 + }, + "Component_[7247035804068349658]": { + "$type": "EditorPrefabComponent", + "Id": 7247035804068349658 + }, + "Component_[9307224322037797205]": { + "$type": "EditorLockComponent", + "Id": 9307224322037797205 + }, + "Component_[9562516168917670048]": { + "$type": "EditorVisibilityComponent", + "Id": 9562516168917670048 + } + } + }, + "Entities": { + "Entity_[1155164325235]": { + "Id": "Entity_[1155164325235]", + "Name": "Sun", + "Components": { + "Component_[10440557478882592717]": { + "$type": "SelectionComponent", + "Id": 10440557478882592717 + }, + "Component_[13620450453324765907]": { + "$type": "EditorLockComponent", + "Id": 13620450453324765907 + }, + "Component_[2134313378593666258]": { + "$type": "EditorInspectorComponent", + "Id": 2134313378593666258 + }, + "Component_[234010807770404186]": { + "$type": "EditorVisibilityComponent", + "Id": 234010807770404186 + }, + "Component_[2970359110423865725]": { + "$type": "EditorEntityIconComponent", + "Id": 2970359110423865725 + }, + "Component_[3722854130373041803]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3722854130373041803 + }, + "Component_[5992533738676323195]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5992533738676323195 + }, + "Component_[7378860763541895402]": { + "$type": "AZ::Render::EditorDirectionalLightComponent", + "Id": 7378860763541895402, + "Controller": { + "Configuration": { + "Intensity": 1.0, + "CameraEntityId": "", + "ShadowFilterMethod": 1 + } + } + }, + "Component_[7892834440890947578]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 7892834440890947578, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + 0.0, + 0.0, + 13.487043380737305 + ], + "Rotate": [ + -76.13099670410156, + -0.847000002861023, + -15.8100004196167 + ] + } + }, + "Component_[8599729549570828259]": { + "$type": "EditorEntitySortComponent", + "Id": 8599729549570828259 + }, + "Component_[952797371922080273]": { + "$type": "EditorPendingCompositionComponent", + "Id": 952797371922080273 + } + } + }, + "Entity_[1159459292531]": { + "Id": "Entity_[1159459292531]", + "Name": "Ground", + "Components": { + "Component_[11701138785793981042]": { + "$type": "SelectionComponent", + "Id": 11701138785793981042 + }, + "Component_[12260880513256986252]": { + "$type": "EditorEntityIconComponent", + "Id": 12260880513256986252 + }, + "Component_[13711420870643673468]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13711420870643673468 + }, + "Component_[138002849734991713]": { + "$type": "EditorOnlyEntityComponent", + "Id": 138002849734991713 + }, + "Component_[16578565737331764849]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 16578565737331764849, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[16919232076966545697]": { + "$type": "EditorInspectorComponent", + "Id": 16919232076966545697 + }, + "Component_[5182430712893438093]": { + "$type": "EditorMaterialComponent", + "Id": 5182430712893438093 + }, + "Component_[5675108321710651991]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 5675108321710651991, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{0CD745C0-6AA8-569A-A68A-73A3270986C4}", + "subId": 277889906 + }, + "assetHint": "objects/groudplane/groundplane_512x512m.azmodel" + } + } + } + }, + "Component_[5681893399601237518]": { + "$type": "EditorEntitySortComponent", + "Id": 5681893399601237518 + }, + "Component_[592692962543397545]": { + "$type": "EditorPendingCompositionComponent", + "Id": 592692962543397545 + }, + "Component_[7090012899106946164]": { + "$type": "EditorLockComponent", + "Id": 7090012899106946164 + }, + "Component_[9410832619875640998]": { + "$type": "EditorVisibilityComponent", + "Id": 9410832619875640998 + } + } + }, + "Entity_[1163754259827]": { + "Id": "Entity_[1163754259827]", + "Name": "Camera", + "Components": { + "Component_[11895140916889160460]": { + "$type": "EditorEntityIconComponent", + "Id": 11895140916889160460 + }, + "Component_[16880285896855930892]": { + "$type": "{CA11DA46-29FF-4083-B5F6-E02C3A8C3A3D} EditorCameraComponent", + "Id": 16880285896855930892, + "Controller": { + "Configuration": { + "Field of View": 55.0, + "EditorEntityId": 6861302815203973165 + } + } + }, + "Component_[17187464423780271193]": { + "$type": "EditorLockComponent", + "Id": 17187464423780271193 + }, + "Component_[17495696818315413311]": { + "$type": "EditorEntitySortComponent", + "Id": 17495696818315413311 + }, + "Component_[18086214374043522055]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 18086214374043522055, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + -2.3000001907348633, + -3.9368600845336914, + 1.0 + ], + "Rotate": [ + -2.050307512283325, + 1.9552897214889526, + -43.623355865478516 + ] + } + }, + "Component_[18387556550380114975]": { + "$type": "SelectionComponent", + "Id": 18387556550380114975 + }, + "Component_[2654521436129313160]": { + "$type": "EditorVisibilityComponent", + "Id": 2654521436129313160 + }, + "Component_[5265045084611556958]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5265045084611556958 + }, + "Component_[7169798125182238623]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7169798125182238623 + }, + "Component_[7255796294953281766]": { + "$type": "GenericComponentWrapper", + "Id": 7255796294953281766, + "m_template": { + "$type": "FlyCameraInputComponent" + } + }, + "Component_[8866210352157164042]": { + "$type": "EditorInspectorComponent", + "Id": 8866210352157164042 + }, + "Component_[9129253381063760879]": { + "$type": "EditorOnlyEntityComponent", + "Id": 9129253381063760879 + } + } + }, + "Entity_[1168049227123]": { + "Id": "Entity_[1168049227123]", + "Name": "Grid", + "Components": { + "Component_[11443347433215807130]": { + "$type": "EditorEntityIconComponent", + "Id": 11443347433215807130 + }, + "Component_[11779275529534764488]": { + "$type": "SelectionComponent", + "Id": 11779275529534764488 + }, + "Component_[14249419413039427459]": { + "$type": "EditorInspectorComponent", + "Id": 14249419413039427459 + }, + "Component_[15448581635946161318]": { + "$type": "AZ::Render::EditorGridComponent", + "Id": 15448581635946161318, + "Controller": { + "Configuration": { + "primarySpacing": 4.0, + "primaryColor": [ + 0.501960813999176, + 0.501960813999176, + 0.501960813999176 + ], + "secondarySpacing": 0.5, + "secondaryColor": [ + 0.250980406999588, + 0.250980406999588, + 0.250980406999588 + ] + } + } + }, + "Component_[1843303322527297409]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1843303322527297409 + }, + "Component_[380249072065273654]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 380249072065273654, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[7476660583684339787]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7476660583684339787 + }, + "Component_[7557626501215118375]": { + "$type": "EditorEntitySortComponent", + "Id": 7557626501215118375 + }, + "Component_[7984048488947365511]": { + "$type": "EditorVisibilityComponent", + "Id": 7984048488947365511 + }, + "Component_[8118181039276487398]": { + "$type": "EditorOnlyEntityComponent", + "Id": 8118181039276487398 + }, + "Component_[9189909764215270515]": { + "$type": "EditorLockComponent", + "Id": 9189909764215270515 + } + } + }, + "Entity_[1172344194419]": { + "Id": "Entity_[1172344194419]", + "Name": "Shader Ball", + "Components": { + "Component_[10789351944715265527]": { + "$type": "EditorOnlyEntityComponent", + "Id": 10789351944715265527 + }, + "Component_[12037033284781049225]": { + "$type": "EditorEntitySortComponent", + "Id": 12037033284781049225 + }, + "Component_[13759153306105970079]": { + "$type": "EditorPendingCompositionComponent", + "Id": 13759153306105970079 + }, + "Component_[14135560884830586279]": { + "$type": "EditorInspectorComponent", + "Id": 14135560884830586279 + }, + "Component_[16247165675903986673]": { + "$type": "EditorVisibilityComponent", + "Id": 16247165675903986673 + }, + "Component_[18082433625958885247]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 18082433625958885247 + }, + "Component_[6472623349872972660]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6472623349872972660, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Rotate": [ + 0.0, + 0.10000000149011612, + 180.0 + ] + } + }, + "Component_[6495255223970673916]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 6495255223970673916, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{FD340C30-755C-5911-92A3-19A3F7A77931}", + "subId": 281415304 + }, + "assetHint": "objects/shaderball/shaderball_default_1m.azmodel" + } + } + } + }, + "Component_[8056625192494070973]": { + "$type": "SelectionComponent", + "Id": 8056625192494070973 + }, + "Component_[8550141614185782969]": { + "$type": "EditorEntityIconComponent", + "Id": 8550141614185782969 + }, + "Component_[9439770997198325425]": { + "$type": "EditorLockComponent", + "Id": 9439770997198325425 + } + } + }, + "Entity_[1176639161715]": { + "Id": "Entity_[1176639161715]", + "Name": "Atom Default Environment", + "Components": { + "Component_[10757302973393310045]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 10757302973393310045, + "Parent Entity": "Entity_[1146574390643]" + }, + "Component_[14505817420424255464]": { + "$type": "EditorInspectorComponent", + "Id": 14505817420424255464, + "ComponentOrderEntryArray": [ + { + "ComponentId": 10757302973393310045 + } + ] + }, + "Component_[14988041764659020032]": { + "$type": "EditorLockComponent", + "Id": 14988041764659020032 + }, + "Component_[15808690248755038124]": { + "$type": "SelectionComponent", + "Id": 15808690248755038124 + }, + "Component_[15900837685796817138]": { + "$type": "EditorVisibilityComponent", + "Id": 15900837685796817138 + }, + "Component_[3298767348226484884]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3298767348226484884 + }, + "Component_[4076975109609220594]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4076975109609220594 + }, + "Component_[5679760548946028854]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5679760548946028854 + }, + "Component_[5855590796136709437]": { + "$type": "EditorEntitySortComponent", + "Id": 5855590796136709437, + "Child Entity Order": [ + "Entity_[1155164325235]", + "Entity_[1180934129011]", + "Entity_[1172344194419]", + "Entity_[1168049227123]", + "Entity_[1163754259827]", + "Entity_[1159459292531]" + ] + }, + "Component_[9277695270015777859]": { + "$type": "EditorEntityIconComponent", + "Id": 9277695270015777859 + } + } + }, + "Entity_[1180934129011]": { + "Id": "Entity_[1180934129011]", + "Name": "Global Sky", + "Components": { + "Component_[11231930600558681245]": { + "$type": "AZ::Render::EditorHDRiSkyboxComponent", + "Id": 11231930600558681245, + "Controller": { + "Configuration": { + "CubemapAsset": { + "assetId": { + "guid": "{215E47FD-D181-5832-B1AB-91673ABF6399}", + "subId": 1000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_skyboxcm.exr.streamingimage" + } + } + } + }, + "Component_[11980494120202836095]": { + "$type": "SelectionComponent", + "Id": 11980494120202836095 + }, + "Component_[1428633914413949476]": { + "$type": "EditorLockComponent", + "Id": 1428633914413949476 + }, + "Component_[14936200426671614999]": { + "$type": "AZ::Render::EditorImageBasedLightComponent", + "Id": 14936200426671614999, + "Controller": { + "Configuration": { + "diffuseImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 3000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_ibldiffuse.exr.streamingimage" + }, + "specularImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 2000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_iblspecular.exr.streamingimage" + } + } + } + }, + "Component_[14994774102579326069]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 14994774102579326069 + }, + "Component_[15417479889044493340]": { + "$type": "EditorPendingCompositionComponent", + "Id": 15417479889044493340 + }, + "Component_[15826613364991382688]": { + "$type": "EditorEntitySortComponent", + "Id": 15826613364991382688 + }, + "Component_[1665003113283562343]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1665003113283562343 + }, + "Component_[3704934735944502280]": { + "$type": "EditorEntityIconComponent", + "Id": 3704934735944502280 + }, + "Component_[5698542331457326479]": { + "$type": "EditorVisibilityComponent", + "Id": 5698542331457326479 + }, + "Component_[6644513399057217122]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6644513399057217122, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[931091830724002070]": { + "$type": "EditorInspectorComponent", + "Id": 931091830724002070 + } + } + }, + "Entity_[1386540226381]": { + "Id": "Entity_[1386540226381]", + "Name": "s3", + "Components": { + "Component_[11158492000035348927]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 11158492000035348927 + }, + "Component_[13101294672800983417]": { + "$type": "EditorPendingCompositionComponent", + "Id": 13101294672800983417 + }, + "Component_[13312594438559441372]": { + "$type": "EditorEntitySortComponent", + "Id": 13312594438559441372 + }, + "Component_[14532086496432860950]": { + "$type": "EditorVisibilityComponent", + "Id": 14532086496432860950 + }, + "Component_[15284288439796123368]": { + "$type": "EditorOnlyEntityComponent", + "Id": 15284288439796123368 + }, + "Component_[17553238493971510581]": { + "$type": "EditorScriptCanvasComponent", + "Id": 17553238493971510581, + "m_name": "s3demo.scriptcanvas", + "runtimeDataIsValid": true, + "runtimeDataOverrides": { + "source": { + "id": "{D72821C5-1C31-5AE5-891D-30371C49B9E0}" + } + }, + "sourceHandle": { + "id": "{D72821C5-1C31-5AE5-891D-30371C49B9E0}" + } + }, + "Component_[17621265899133139471]": { + "$type": "EditorLockComponent", + "Id": 17621265899133139471 + }, + "Component_[2763569637558196086]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 2763569637558196086, + "Parent Entity": "Entity_[1146574390643]", + "Transform Data": { + "Translate": [ + 0.0, + 0.10000038146972656, + 4.005923748016357 + ] + } + }, + "Component_[3946146016045577093]": { + "$type": "SelectionComponent", + "Id": 3946146016045577093 + }, + "Component_[4521094551057628689]": { + "$type": "EditorInspectorComponent", + "Id": 4521094551057628689 + }, + "Component_[5378520857609165944]": { + "$type": "EditorEntityIconComponent", + "Id": 5378520857609165944 + } + } + }, + "Entity_[1390835193677]": { + "Id": "Entity_[1390835193677]", + "Name": "dynamodb", + "Components": { + "Component_[13579073750136791325]": { + "$type": "EditorVisibilityComponent", + "Id": 13579073750136791325 + }, + "Component_[14581079376974874313]": { + "$type": "EditorEntitySortComponent", + "Id": 14581079376974874313 + }, + "Component_[15354545119837386836]": { + "$type": "SelectionComponent", + "Id": 15354545119837386836 + }, + "Component_[15913971829919706180]": { + "$type": "EditorEntityIconComponent", + "Id": 15913971829919706180 + }, + "Component_[17308449372189366987]": { + "$type": "EditorPendingCompositionComponent", + "Id": 17308449372189366987 + }, + "Component_[17741852956994822371]": { + "$type": "EditorOnlyEntityComponent", + "Id": 17741852956994822371 + }, + "Component_[4363122368868820254]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 4363122368868820254 + }, + "Component_[4890242568951925088]": { + "$type": "EditorScriptCanvasComponent", + "Id": 4890242568951925088, + "m_name": "dynamodbdemo.scriptcanvas", + "runtimeDataIsValid": true, + "runtimeDataOverrides": { + "source": { + "id": "{004B97C6-75F3-5B95-ADA4-EBF751EEF697}" + } + }, + "sourceHandle": { + "id": "{004B97C6-75F3-5B95-ADA4-EBF751EEF697}" + } + }, + "Component_[7140725680315799866]": { + "$type": "EditorLockComponent", + "Id": 7140725680315799866 + }, + "Component_[8431133659360426398]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 8431133659360426398, + "Parent Entity": "Entity_[1146574390643]", + "Transform Data": { + "Translate": [ + 0.0, + 0.10000038146972656, + 4.005923748016357 + ] + } + }, + "Component_[9486500593077263666]": { + "$type": "EditorInspectorComponent", + "Id": 9486500593077263666 + } + } + }, + "Entity_[1395130160973]": { + "Id": "Entity_[1395130160973]", + "Name": "lambda", + "Components": { + "Component_[14224781635611846065]": { + "$type": "SelectionComponent", + "Id": 14224781635611846065 + }, + "Component_[14532864313352417822]": { + "$type": "EditorInspectorComponent", + "Id": 14532864313352417822 + }, + "Component_[14621438229914413040]": { + "$type": "EditorEntitySortComponent", + "Id": 14621438229914413040 + }, + "Component_[15642112885025274607]": { + "$type": "EditorLockComponent", + "Id": 15642112885025274607 + }, + "Component_[16340039184260739086]": { + "$type": "EditorVisibilityComponent", + "Id": 16340039184260739086 + }, + "Component_[17170806711467412600]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 17170806711467412600, + "Parent Entity": "Entity_[1146574390643]", + "Transform Data": { + "Translate": [ + 0.0, + 0.10000038146972656, + 4.005923748016357 + ] + } + }, + "Component_[18080677632538463069]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 18080677632538463069 + }, + "Component_[2663457305102263144]": { + "$type": "EditorEntityIconComponent", + "Id": 2663457305102263144 + }, + "Component_[4954526281430171003]": { + "$type": "EditorOnlyEntityComponent", + "Id": 4954526281430171003 + }, + "Component_[6251151424244415885]": { + "$type": "EditorScriptCanvasComponent", + "Id": 6251151424244415885, + "m_name": "lambdademo.scriptcanvas", + "runtimeDataIsValid": true, + "runtimeDataOverrides": { + "source": { + "id": "{3DCA213D-534E-5C86-9308-2F7675A08029}" + } + }, + "sourceHandle": { + "id": "{3DCA213D-534E-5C86-9308-2F7675A08029}" + } + }, + "Component_[6526999075003995619]": { + "$type": "EditorPendingCompositionComponent", + "Id": 6526999075003995619 + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/AWS/Core/filelist.xml b/AutomatedTesting/Levels/AWS/Core/filelist.xml deleted file mode 100644 index 9d1fcd2e83..0000000000 --- a/AutomatedTesting/Levels/AWS/Core/filelist.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/AutomatedTesting/Levels/AWS/Core/level.pak b/AutomatedTesting/Levels/AWS/Core/level.pak deleted file mode 100644 index 01b79da84e..0000000000 --- a/AutomatedTesting/Levels/AWS/Core/level.pak +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4ba2f409fc974c72b8ee8b660d200ed1d013ee8408419b0e91d6d487e71e4997 -size 3774 diff --git a/AutomatedTesting/Levels/AWS/Metrics/Metrics.ly b/AutomatedTesting/Levels/AWS/Metrics/Metrics.ly deleted file mode 100644 index 12998e89be..0000000000 --- a/AutomatedTesting/Levels/AWS/Metrics/Metrics.ly +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:023992998ab5a1d64b38dacd1d5e1a9dc930ff704289c0656ed6eaba6951d660 -size 9066 diff --git a/AutomatedTesting/Levels/AWS/Metrics/Metrics.prefab b/AutomatedTesting/Levels/AWS/Metrics/Metrics.prefab new file mode 100644 index 0000000000..7f4144d734 --- /dev/null +++ b/AutomatedTesting/Levels/AWS/Metrics/Metrics.prefab @@ -0,0 +1,627 @@ +{ + "ContainerEntity": { + "Id": "Entity_[1146574390643]", + "Name": "Level", + "Components": { + "Component_[10641544592923449938]": { + "$type": "EditorInspectorComponent", + "Id": 10641544592923449938 + }, + "Component_[12039882709170782873]": { + "$type": "EditorOnlyEntityComponent", + "Id": 12039882709170782873 + }, + "Component_[12265484671603697631]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12265484671603697631 + }, + "Component_[14126657869720434043]": { + "$type": "EditorEntitySortComponent", + "Id": 14126657869720434043, + "Child Entity Order": [ + "Entity_[1176639161715]", + "Entity_[2086619895629]", + "Entity_[2086619895629]" + ] + }, + "Component_[15230859088967841193]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 15230859088967841193, + "Parent Entity": "" + }, + "Component_[16239496886950819870]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 16239496886950819870 + }, + "Component_[5688118765544765547]": { + "$type": "EditorEntityIconComponent", + "Id": 5688118765544765547 + }, + "Component_[6545738857812235305]": { + "$type": "SelectionComponent", + "Id": 6545738857812235305 + }, + "Component_[7247035804068349658]": { + "$type": "EditorPrefabComponent", + "Id": 7247035804068349658 + }, + "Component_[9307224322037797205]": { + "$type": "EditorLockComponent", + "Id": 9307224322037797205 + }, + "Component_[9562516168917670048]": { + "$type": "EditorVisibilityComponent", + "Id": 9562516168917670048 + } + } + }, + "Entities": { + "Entity_[1155164325235]": { + "Id": "Entity_[1155164325235]", + "Name": "Sun", + "Components": { + "Component_[10440557478882592717]": { + "$type": "SelectionComponent", + "Id": 10440557478882592717 + }, + "Component_[13620450453324765907]": { + "$type": "EditorLockComponent", + "Id": 13620450453324765907 + }, + "Component_[2134313378593666258]": { + "$type": "EditorInspectorComponent", + "Id": 2134313378593666258 + }, + "Component_[234010807770404186]": { + "$type": "EditorVisibilityComponent", + "Id": 234010807770404186 + }, + "Component_[2970359110423865725]": { + "$type": "EditorEntityIconComponent", + "Id": 2970359110423865725 + }, + "Component_[3722854130373041803]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3722854130373041803 + }, + "Component_[5992533738676323195]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5992533738676323195 + }, + "Component_[7378860763541895402]": { + "$type": "AZ::Render::EditorDirectionalLightComponent", + "Id": 7378860763541895402, + "Controller": { + "Configuration": { + "Intensity": 1.0, + "CameraEntityId": "", + "ShadowFilterMethod": 1 + } + } + }, + "Component_[7892834440890947578]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 7892834440890947578, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + 0.0, + 0.0, + 13.487043380737305 + ], + "Rotate": [ + -76.13099670410156, + -0.847000002861023, + -15.8100004196167 + ] + } + }, + "Component_[8599729549570828259]": { + "$type": "EditorEntitySortComponent", + "Id": 8599729549570828259 + }, + "Component_[952797371922080273]": { + "$type": "EditorPendingCompositionComponent", + "Id": 952797371922080273 + } + } + }, + "Entity_[1159459292531]": { + "Id": "Entity_[1159459292531]", + "Name": "Ground", + "Components": { + "Component_[11701138785793981042]": { + "$type": "SelectionComponent", + "Id": 11701138785793981042 + }, + "Component_[12260880513256986252]": { + "$type": "EditorEntityIconComponent", + "Id": 12260880513256986252 + }, + "Component_[13711420870643673468]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13711420870643673468 + }, + "Component_[138002849734991713]": { + "$type": "EditorOnlyEntityComponent", + "Id": 138002849734991713 + }, + "Component_[16578565737331764849]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 16578565737331764849, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[16919232076966545697]": { + "$type": "EditorInspectorComponent", + "Id": 16919232076966545697 + }, + "Component_[5182430712893438093]": { + "$type": "EditorMaterialComponent", + "Id": 5182430712893438093 + }, + "Component_[5675108321710651991]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 5675108321710651991, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{0CD745C0-6AA8-569A-A68A-73A3270986C4}", + "subId": 277889906 + }, + "assetHint": "objects/groudplane/groundplane_512x512m.azmodel" + } + } + } + }, + "Component_[5681893399601237518]": { + "$type": "EditorEntitySortComponent", + "Id": 5681893399601237518 + }, + "Component_[592692962543397545]": { + "$type": "EditorPendingCompositionComponent", + "Id": 592692962543397545 + }, + "Component_[7090012899106946164]": { + "$type": "EditorLockComponent", + "Id": 7090012899106946164 + }, + "Component_[9410832619875640998]": { + "$type": "EditorVisibilityComponent", + "Id": 9410832619875640998 + } + } + }, + "Entity_[1163754259827]": { + "Id": "Entity_[1163754259827]", + "Name": "Camera", + "Components": { + "Component_[11895140916889160460]": { + "$type": "EditorEntityIconComponent", + "Id": 11895140916889160460 + }, + "Component_[16880285896855930892]": { + "$type": "{CA11DA46-29FF-4083-B5F6-E02C3A8C3A3D} EditorCameraComponent", + "Id": 16880285896855930892, + "Controller": { + "Configuration": { + "Field of View": 55.0, + "EditorEntityId": 6861302815203973165 + } + } + }, + "Component_[17187464423780271193]": { + "$type": "EditorLockComponent", + "Id": 17187464423780271193 + }, + "Component_[17495696818315413311]": { + "$type": "EditorEntitySortComponent", + "Id": 17495696818315413311 + }, + "Component_[18086214374043522055]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 18086214374043522055, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + -2.3000001907348633, + -3.9368600845336914, + 1.0 + ], + "Rotate": [ + -2.050307512283325, + 1.9552897214889526, + -43.623355865478516 + ] + } + }, + "Component_[18387556550380114975]": { + "$type": "SelectionComponent", + "Id": 18387556550380114975 + }, + "Component_[2654521436129313160]": { + "$type": "EditorVisibilityComponent", + "Id": 2654521436129313160 + }, + "Component_[5265045084611556958]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5265045084611556958 + }, + "Component_[7169798125182238623]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7169798125182238623 + }, + "Component_[7255796294953281766]": { + "$type": "GenericComponentWrapper", + "Id": 7255796294953281766, + "m_template": { + "$type": "FlyCameraInputComponent" + } + }, + "Component_[8866210352157164042]": { + "$type": "EditorInspectorComponent", + "Id": 8866210352157164042 + }, + "Component_[9129253381063760879]": { + "$type": "EditorOnlyEntityComponent", + "Id": 9129253381063760879 + } + } + }, + "Entity_[1168049227123]": { + "Id": "Entity_[1168049227123]", + "Name": "Grid", + "Components": { + "Component_[11443347433215807130]": { + "$type": "EditorEntityIconComponent", + "Id": 11443347433215807130 + }, + "Component_[11779275529534764488]": { + "$type": "SelectionComponent", + "Id": 11779275529534764488 + }, + "Component_[14249419413039427459]": { + "$type": "EditorInspectorComponent", + "Id": 14249419413039427459 + }, + "Component_[15448581635946161318]": { + "$type": "AZ::Render::EditorGridComponent", + "Id": 15448581635946161318, + "Controller": { + "Configuration": { + "primarySpacing": 4.0, + "primaryColor": [ + 0.501960813999176, + 0.501960813999176, + 0.501960813999176 + ], + "secondarySpacing": 0.5, + "secondaryColor": [ + 0.250980406999588, + 0.250980406999588, + 0.250980406999588 + ] + } + } + }, + "Component_[1843303322527297409]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1843303322527297409 + }, + "Component_[380249072065273654]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 380249072065273654, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[7476660583684339787]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7476660583684339787 + }, + "Component_[7557626501215118375]": { + "$type": "EditorEntitySortComponent", + "Id": 7557626501215118375 + }, + "Component_[7984048488947365511]": { + "$type": "EditorVisibilityComponent", + "Id": 7984048488947365511 + }, + "Component_[8118181039276487398]": { + "$type": "EditorOnlyEntityComponent", + "Id": 8118181039276487398 + }, + "Component_[9189909764215270515]": { + "$type": "EditorLockComponent", + "Id": 9189909764215270515 + } + } + }, + "Entity_[1172344194419]": { + "Id": "Entity_[1172344194419]", + "Name": "Shader Ball", + "Components": { + "Component_[10789351944715265527]": { + "$type": "EditorOnlyEntityComponent", + "Id": 10789351944715265527 + }, + "Component_[12037033284781049225]": { + "$type": "EditorEntitySortComponent", + "Id": 12037033284781049225 + }, + "Component_[13759153306105970079]": { + "$type": "EditorPendingCompositionComponent", + "Id": 13759153306105970079 + }, + "Component_[14135560884830586279]": { + "$type": "EditorInspectorComponent", + "Id": 14135560884830586279 + }, + "Component_[16247165675903986673]": { + "$type": "EditorVisibilityComponent", + "Id": 16247165675903986673 + }, + "Component_[18082433625958885247]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 18082433625958885247 + }, + "Component_[6472623349872972660]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6472623349872972660, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Rotate": [ + 0.0, + 0.10000000149011612, + 180.0 + ] + } + }, + "Component_[6495255223970673916]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 6495255223970673916, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{FD340C30-755C-5911-92A3-19A3F7A77931}", + "subId": 281415304 + }, + "assetHint": "objects/shaderball/shaderball_default_1m.azmodel" + } + } + } + }, + "Component_[8056625192494070973]": { + "$type": "SelectionComponent", + "Id": 8056625192494070973 + }, + "Component_[8550141614185782969]": { + "$type": "EditorEntityIconComponent", + "Id": 8550141614185782969 + }, + "Component_[9439770997198325425]": { + "$type": "EditorLockComponent", + "Id": 9439770997198325425 + } + } + }, + "Entity_[1176639161715]": { + "Id": "Entity_[1176639161715]", + "Name": "Atom Default Environment", + "Components": { + "Component_[10757302973393310045]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 10757302973393310045, + "Parent Entity": "Entity_[1146574390643]" + }, + "Component_[14505817420424255464]": { + "$type": "EditorInspectorComponent", + "Id": 14505817420424255464, + "ComponentOrderEntryArray": [ + { + "ComponentId": 10757302973393310045 + } + ] + }, + "Component_[14988041764659020032]": { + "$type": "EditorLockComponent", + "Id": 14988041764659020032 + }, + "Component_[15808690248755038124]": { + "$type": "SelectionComponent", + "Id": 15808690248755038124 + }, + "Component_[15900837685796817138]": { + "$type": "EditorVisibilityComponent", + "Id": 15900837685796817138 + }, + "Component_[3298767348226484884]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3298767348226484884 + }, + "Component_[4076975109609220594]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4076975109609220594 + }, + "Component_[5679760548946028854]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5679760548946028854 + }, + "Component_[5855590796136709437]": { + "$type": "EditorEntitySortComponent", + "Id": 5855590796136709437, + "Child Entity Order": [ + "Entity_[1155164325235]", + "Entity_[1180934129011]", + "Entity_[1172344194419]", + "Entity_[1168049227123]", + "Entity_[1163754259827]", + "Entity_[1159459292531]" + ] + }, + "Component_[9277695270015777859]": { + "$type": "EditorEntityIconComponent", + "Id": 9277695270015777859 + } + } + }, + "Entity_[1180934129011]": { + "Id": "Entity_[1180934129011]", + "Name": "Global Sky", + "Components": { + "Component_[11231930600558681245]": { + "$type": "AZ::Render::EditorHDRiSkyboxComponent", + "Id": 11231930600558681245, + "Controller": { + "Configuration": { + "CubemapAsset": { + "assetId": { + "guid": "{215E47FD-D181-5832-B1AB-91673ABF6399}", + "subId": 1000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_skyboxcm.exr.streamingimage" + } + } + } + }, + "Component_[11980494120202836095]": { + "$type": "SelectionComponent", + "Id": 11980494120202836095 + }, + "Component_[1428633914413949476]": { + "$type": "EditorLockComponent", + "Id": 1428633914413949476 + }, + "Component_[14936200426671614999]": { + "$type": "AZ::Render::EditorImageBasedLightComponent", + "Id": 14936200426671614999, + "Controller": { + "Configuration": { + "diffuseImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 3000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_ibldiffuse.exr.streamingimage" + }, + "specularImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 2000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_iblspecular.exr.streamingimage" + } + } + } + }, + "Component_[14994774102579326069]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 14994774102579326069 + }, + "Component_[15417479889044493340]": { + "$type": "EditorPendingCompositionComponent", + "Id": 15417479889044493340 + }, + "Component_[15826613364991382688]": { + "$type": "EditorEntitySortComponent", + "Id": 15826613364991382688 + }, + "Component_[1665003113283562343]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1665003113283562343 + }, + "Component_[3704934735944502280]": { + "$type": "EditorEntityIconComponent", + "Id": 3704934735944502280 + }, + "Component_[5698542331457326479]": { + "$type": "EditorVisibilityComponent", + "Id": 5698542331457326479 + }, + "Component_[6644513399057217122]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6644513399057217122, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[931091830724002070]": { + "$type": "EditorInspectorComponent", + "Id": 931091830724002070 + } + } + }, + "Entity_[2086619895629]": { + "Id": "Entity_[2086619895629]", + "Name": "metrics", + "Components": { + "Component_[10664937239001700943]": { + "$type": "SelectionComponent", + "Id": 10664937239001700943 + }, + "Component_[12411100785613400502]": { + "$type": "EditorVisibilityComponent", + "Id": 12411100785613400502 + }, + "Component_[13461617945403887462]": { + "$type": "EditorEntityIconComponent", + "Id": 13461617945403887462 + }, + "Component_[1398528805938487915]": { + "$type": "EditorInspectorComponent", + "Id": 1398528805938487915 + }, + "Component_[15586634767575159325]": { + "$type": "EditorEntitySortComponent", + "Id": 15586634767575159325 + }, + "Component_[1737734807882912852]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1737734807882912852 + }, + "Component_[2398400563175352537]": { + "$type": "EditorOnlyEntityComponent", + "Id": 2398400563175352537 + }, + "Component_[3845542252660517302]": { + "$type": "EditorPendingCompositionComponent", + "Id": 3845542252660517302 + }, + "Component_[3873433240186817282]": { + "$type": "EditorLockComponent", + "Id": 3873433240186817282 + }, + "Component_[4474288881478318615]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 4474288881478318615, + "Parent Entity": "Entity_[1146574390643]", + "Transform Data": { + "Translate": [ + 0.0, + 0.10000038146972656, + 4.005923748016357 + ] + } + }, + "Component_[5865591669658426602]": { + "$type": "ScriptEditorComponent", + "Id": 5865591669658426602, + "ScriptComponent": { + "Script": { + "assetId": { + "guid": "{50D66834-9277-5469-892E-DAD087FF4C0E}", + "subId": 1 + }, + "loadBehavior": "QueueLoad", + "assetHint": "levels/aws/metrics/script/metrics.luac" + } + }, + "ScriptAsset": { + "assetId": { + "guid": "{50D66834-9277-5469-892E-DAD087FF4C0E}", + "subId": 1 + }, + "assetHint": "levels/aws/metrics/script/metrics.luac" + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/AWS/Metrics/filelist.xml b/AutomatedTesting/Levels/AWS/Metrics/filelist.xml deleted file mode 100644 index 3539102346..0000000000 --- a/AutomatedTesting/Levels/AWS/Metrics/filelist.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/AutomatedTesting/Levels/AWS/Metrics/level.pak b/AutomatedTesting/Levels/AWS/Metrics/level.pak deleted file mode 100644 index fd1f5ac6ad..0000000000 --- a/AutomatedTesting/Levels/AWS/Metrics/level.pak +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e7c0c07b13bb64db344b94d5712e1e802e607a9dee506768b34481f4a76d8505 -size 3593 diff --git a/scripts/build/Platform/Linux/deploy_cdk_applications.sh b/scripts/build/Platform/Linux/deploy_cdk_applications.sh new file mode 100755 index 0000000000..93a3dccd9f --- /dev/null +++ b/scripts/build/Platform/Linux/deploy_cdk_applications.sh @@ -0,0 +1,106 @@ +#!/bin/bash + +# Copyright (c) Contributors to the Open 3D Engine Project. +# For complete copyright and license terms please see the LICENSE at the root of this distribution. +# +# SPDX-License-Identifier: Apache-2.0 OR MIT +# + +# Deploy the CDK applications for AWS gems (Linux only) +# Prerequisites: +# 1) Node.js is installed +# 2) Node.js version >= 10.13.0, except for versions 13.0.0 - 13.6.0. A version in active long-term support is recommended. + +SOURCE_DIRECTORY=$(dirname "$0") +PATH=$SOURCE_DIRECTORY/python:$PATH +GEM_DIRECTORY=$SOURCE_DIRECTORY/Gems + +DeployCDKApplication() +{ + # Deploy the CDK application for a specific AWS gem + GEM_NAME=$1 + ADDITIONAL_ARGUMENTS=$2 + echo [cdk_deployment] Deploy the CDK application for the $GEM_NAME gem + pushd $GEM_DIRECTORY/$GEM_NAME/cdk + + # Revert the CDK application code to a stable state using the provided commit ID + if ! git checkout $COMMIT_ID -- .; + then + echo [git_checkout] Failed to checkout the CDK application for the $GEM_NAME gem using commit ID $COMMIT_ID + popd + exit 1 + fi + + # Install required packages for the CDK application + if ! python -m pip install -r requirements.txt; + then + echo [cdk_deployment] Failed to install required packages for the $GEM_NAME gem + popd + exit 1 + fi + + # Deploy the CDK application + if ! cdk deploy $ADDITIONAL_ARGUMENTS --require-approval never; + then + echo [cdk_deployment] Failed to deploy the CDK application for the $GEM_NAME gem + popd + exit 1 + fi + popd +} + +# Create and activate a virtualenv for the CDK deployment +if ! python/python.sh -m venv .env; +then + echo [cdk_bootstrap] Failed to create a virtualenv for the CDK deployment + exit 1 +fi +if ! source .env/bin/activate; +then + echo [cdk_bootstrap] Failed to activate the virtualenv for the CDK deployment + exit 1 +fi + +echo [cdk_installation] Install the latest version of CDK +if ! sudo npm uninstall -g aws-cdk; +then + echo [cdk_bootstrap] Failed to uninstall the current version of CDK + exit 1 +fi +if ! sudo npm install -g aws-cdk@latest; +then + echo [cdk_bootstrap] Failed to install the latest version of CDK + exit 1 +fi + +# Set temporary AWS credentials from the assume role +credentials=$(aws sts assume-role --query Credentials.[SecretAccessKey,SessionToken,AccessKeyId] --output text --role-arn $ASSUME_ROLE_ARN --role-session-name o3de-Automation-session) +AWS_SECRET_ACCESS_KEY=$(echo "$credentials" | cut -d' ' -f1) +AWS_SESSION_TOKEN=$(echo "$credentials" | cut -d' ' -f2) +AWS_ACCESS_KEY_ID=$(echo "$credentials" | cut -d' ' -f3) + +O3DE_AWS_DEPLOY_ACCOUNT=$(echo "$ASSUME_ROLE_ARN" | cut -d':' -f5) + +# Bootstrap and deploy the CDK applications +echo [cdk_bootstrap] Bootstrap CDK +if ! cdk bootstrap aws://$O3DE_AWS_DEPLOY_ACCOUNT/$O3DE_AWS_DEPLOY_REGION; +then + echo [cdk_bootstrap] Failed to bootstrap CDK + exit 1 +fi + +if ! DeployCDKApplication AWSCore "-c disable_access_log=true -c remove_all_storage_on_destroy=true --all"; +then + exit 1 +fi +if ! DeployCDKApplication AWSClientAuth; +then + exit 1 +fi +if ! DeployCDKApplication AWSMetrics "-c batch_processing=true"; +then + exit 1 +fi + +exit 0 + diff --git a/scripts/build/Platform/Linux/destroy_cdk_applications.sh b/scripts/build/Platform/Linux/destroy_cdk_applications.sh new file mode 100755 index 0000000000..795ab78484 --- /dev/null +++ b/scripts/build/Platform/Linux/destroy_cdk_applications.sh @@ -0,0 +1,96 @@ +#!/bin/bash + +# Copyright (c) Contributors to the Open 3D Engine Project. +# For complete copyright and license terms please see the LICENSE at the root of this distribution. +# +# SPDX-License-Identifier: Apache-2.0 OR MIT +# + +# Deploy the CDK applications for AWS gems (Linux only) +# Prerequisites: +# 1) Node.js is installed +# 2) Node.js version >= 10.13.0, except for versions 13.0.0 - 13.6.0. A version in active long-term support is recommended. + +SOURCE_DIRECTORY=$(dirname "$0") +PATH=$SOURCE_DIRECTORY/python:$PATH +GEM_DIRECTORY=$SOURCE_DIRECTORY/Gems + +DestroyCDKApplication() +{ +# Destroy the CDK application for a specific AWS gem +GEM_NAME=$1 +echo [cdk_destruction] Destroy the CDK application for the $GEM_NAME gem +pushd $GEM_DIRECTORY/$GEM_NAME/cdk + +# Revert the CDK application code to a stable state using the provided commit ID +if ! git checkout $COMMIT_ID -- .; +then + echo [git_checkout] Failed to checkout the CDK application for the $GEM_NAME gem using commit ID $COMMIT_ID + popd + return 1 +fi + +# Install required packages for the CDK application +if ! python -m pip install -r requirements.txt; +then + echo [cdk_destruction] Failed to install required packages for the $GEM_NAME gem + popd + return 1 +fi + +# Destroy the CDK application +if ! cdk destroy --all -f; +then + echo [cdk_destruction] Failed to destroy the CDK application for the $GEM_NAME gem + popd + return 1 +fi +popd +return 0 +} + +# Create and activate a virtualenv for the CDK deployment +if ! python/python.sh -m venv .env; +then + echo [cdk_bootstrap] Failed to create a virtualenv for the CDK deployment + return 1 +fi +if ! source .env/bin/activate; +then + echo [cdk_bootstrap] Failed to activate the virtualenv for the CDK deployment + exit 1 +fi + +echo [cdk_installation] Install the latest version of CDK +if ! sudo npm uninstall -g aws-cdk; +then + echo [cdk_bootstrap] Failed to uninstall the current version of CDK + exit 1 +fi +if ! sudo npm install -g aws-cdk@latest; +then + echo [cdk_bootstrap] Failed to install the latest version of CDK + exit 1 +fi + +# Set temporary AWS credentials from the assume role +credentials=$(aws sts assume-role --query Credentials.[SecretAccessKey,SessionToken,AccessKeyId] --output text --role-arn $ASSUME_ROLE_ARN --role-session-name o3de-Automation-session) +AWS_SECRET_ACCESS_KEY=$(echo "$credentials" | cut -d' ' -f1) +AWS_SESSION_TOKEN=$(echo "$credentials" | cut -d' ' -f2) +AWS_ACCESS_KEY_ID=$(echo "$credentials" | cut -d' ' -f3) + +ERROR_EXISTS=0 +DestroyCDKApplication AWSCore +ERROR_EXISTS=$? +DestroyCDKApplication AWSClientAuth +ERROR_EXISTS=$? +DestroyCDKApplication AWSMetrics +ERROR_EXISTS=$? + +if [ $ERROR_EXISTS -eq 1 ] +then + exit 1 +fi + +exit 0 + From 92b0514b4842ab75ca5dcad86a6d084e95f59e9f Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Mon, 20 Dec 2021 15:20:38 -0600 Subject: [PATCH 208/948] Merge commit 'fb36145e2e1f34574948233aa65eaa97f20e6e67' into mbalfour/gitflow_211220_stabilization_2111RTE # Conflicts: # Gems/Atom/RHI/Metal/Code/Source/RHI/ShaderResourceGroupPool.cpp Also fixed bad merge on ScripCanvas MainWindow.cpp Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 37ef63c1a1..f0bee2171a 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -1617,7 +1617,6 @@ namespace ScriptCanvasEditor } PrepareAssetForSave(inMemoryAssetId); - ScriptCanvasAssetDescription assetDescription; AZStd::string suggestedFilename; AZStd::string suggestedFileFilter; From 1845eba6eeb8c141857bdc8a8b5a26daa73074b0 Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Mon, 20 Dec 2021 16:33:36 -0600 Subject: [PATCH 209/948] Fixed compile error. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- .../AzCore/Tests/Serialization/Json/TestCases_TypeId.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Code/Framework/AzCore/Tests/Serialization/Json/TestCases_TypeId.cpp b/Code/Framework/AzCore/Tests/Serialization/Json/TestCases_TypeId.cpp index c6c08ca9ae..b7362a5e61 100644 --- a/Code/Framework/AzCore/Tests/Serialization/Json/TestCases_TypeId.cpp +++ b/Code/Framework/AzCore/Tests/Serialization/Json/TestCases_TypeId.cpp @@ -74,6 +74,11 @@ namespace AZ { return GetCurrentSerializeContextModule().CreateGenericClassInfo(); } + + static const Uuid& GetClassTypeId() + { + return GetGenericInfo()->GetClassData()->m_typeId; + } }; } // namespace AZ From bbd00adadeaf315a615b1e08259f44763a5272fb Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Mon, 20 Dec 2021 16:54:06 -0800 Subject: [PATCH 210/948] Address some AZ::Dom::Value feedback - Use a vector for shared string storage (to avoid the double heap allocation for AZStd::string) - Use a shared heap allocated any for opaque types (instead of an unsafe ref) - Add a string comparison key lookup benchmark to measure the impact of Name Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 49 ++++++++------- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 59 +++++++++---------- .../AzCore/AzCore/DOM/DomValueWriter.cpp | 2 +- .../AzCore/AzCore/DOM/DomValueWriter.h | 2 +- .../AzCore/AzCore/DOM/DomVisitor.cpp | 4 +- Code/Framework/AzCore/AzCore/DOM/DomVisitor.h | 5 +- .../AzCore/Tests/DOM/DomValueBenchmarks.cpp | 29 +++++++++ 7 files changed, 91 insertions(+), 59 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index dcecc67460..3dafc02c6e 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -19,7 +19,7 @@ namespace AZ::Dom { if (refCountedPointer.use_count() > 1) { - AZStd::shared_ptr newPointer = AZStd::allocate_shared(AZStdAlloc()); + AZStd::shared_ptr newPointer = AZStd::allocate_shared(StdValueAllocator()); *newPointer = *refCountedPointer; refCountedPointer = AZStd::move(newPointer); } @@ -92,12 +92,12 @@ namespace AZ::Dom } } - Value::Value(AZStd::any* value) - : m_value(value) + Value::Value(const AZStd::any& value) + : m_value(AZStd::allocate_shared(StdValueAllocator(), value)) { } - Value Value::FromOpaqueValue(AZStd::any& value) + Value Value::FromOpaqueValue(const AZStd::any& value) { return Value(&value); } @@ -330,7 +330,7 @@ namespace AZ::Dom Value& Value::SetObject() { - m_value = AZStd::allocate_shared(AZStdAlloc()); + m_value = AZStd::allocate_shared(StdValueAllocator()); return *this; } @@ -634,7 +634,7 @@ namespace AZ::Dom Value& Value::SetArray() { - m_value = AZStd::allocate_shared(AZStdAlloc()); + m_value = AZStd::allocate_shared(StdValueAllocator()); return *this; } @@ -740,7 +740,7 @@ namespace AZ::Dom void Value::SetNode(AZ::Name name) { - m_value = AZStd::allocate_shared(AZStdAlloc(), name); + m_value = AZStd::allocate_shared(StdValueAllocator(), name); } void Value::SetNode(AZStd::string_view name) @@ -914,9 +914,9 @@ namespace AZ::Dom m_value = aznumeric_cast(value); } - void Value::SetString(AZStd::shared_ptr string) + void Value::SetString(SharedStringType sharedString) { - m_value = string; + m_value = sharedString; } AZStd::string_view Value::GetString() const @@ -925,12 +925,15 @@ namespace AZ::Dom { case 5: // AZStd::string_view return AZStd::get(m_value); - case 6: // AZStd::shared_ptr - return *AZStd::get>(m_value); + case 6: // AZStd::shared_ptr> + { + auto& buffer = *AZStd::get(m_value); + return { buffer.data(), buffer.size() }; + } case 7: // ShortStringType { - const ShortStringType& ShortString = AZStd::get(m_value); - return { ShortString.m_data.data(), ShortString.m_size }; + const ShortStringType& shortString = AZStd::get(m_value); + return { shortString.data(), shortString.size() }; } } AZ_Assert(false, "AZ::Dom::Value: Called GetString on a non-string type"); @@ -947,8 +950,8 @@ namespace AZ::Dom if (value.size() <= ShortStringSize) { ShortStringType buffer; - buffer.m_size = value.size(); - memcpy(buffer.m_data.data(), value.data(), buffer.m_size); + buffer.resize_no_construct(value.size()); + memcpy(buffer.data(), value.data(), value.size()); m_value = buffer; } m_value = value; @@ -962,18 +965,20 @@ namespace AZ::Dom } else { - m_value = AZStd::allocate_shared(AZStdAlloc(), value); + SharedStringType sharedString = + AZStd::allocate_shared(StdValueAllocator(), value.begin(), value.end()); + m_value = AZStd::move(sharedString); } } - AZStd::any& Value::GetOpaqueValue() const + const AZStd::any& Value::GetOpaqueValue() const { - return *AZStd::get(m_value); + return *AZStd::get>(m_value); } - void Value::SetOpaqueValue(AZStd::any& value) + void Value::SetOpaqueValue(const AZStd::any& value) { - m_value = &value; + m_value = AZStd::allocate_shared(StdValueAllocator(), value); } void Value::SetNull() @@ -1014,7 +1019,7 @@ namespace AZ::Dom { result = visitor.String(arg, copyStrings ? Lifetime::Temporary : Lifetime::Persistent); } - else if constexpr (AZStd::is_same_v>) + else if constexpr (AZStd::is_same_v) { result = visitor.RefCountedString(arg, copyStrings ? Lifetime::Temporary : Lifetime::Persistent); } @@ -1110,7 +1115,7 @@ namespace AZ::Dom if (IsString() && other.IsString()) { // If we both hold the same ref counted string we don't need to do a full comparison - if (AZStd::holds_alternative>(m_value) && m_value == other.m_value) + if (AZStd::holds_alternative(m_value) && m_value == other.m_value) { return true; } diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index 1b69c73ecc..bc1b790009 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -55,13 +55,15 @@ namespace AZ::Dom } }; + using StdValueAllocator = AZStdAlloc; + class Value; //! Internal storage for a Value array: an ordered list of Values. class Array { public: - using ContainerType = AZStd::vector>; + using ContainerType = AZStd::vector; using Iterator = ContainerType::iterator; using ConstIterator = ContainerType::const_iterator; static constexpr const size_t ReserveIncrement = 4; @@ -80,7 +82,7 @@ namespace AZ::Dom { public: using EntryType = AZStd::pair; - using ContainerType = AZStd::vector>; + using ContainerType = AZStd::vector; using Iterator = ContainerType::iterator; using ConstIterator = ContainerType::const_iterator; static constexpr const size_t ReserveIncrement = 8; @@ -150,6 +152,13 @@ namespace AZ::Dom class Value final { public: + // Determine the short string buffer size based on the size of our largest internal type (string_view) + // minus the size of the short string size field. + static constexpr const size_t ShortStringSize = sizeof(AZStd::string_view) - 2; + using ShortStringType = AZStd::fixed_string; + using SharedStringContainer = AZStd::vector; + using SharedStringType = AZStd::shared_ptr; + // Constructors... Value(); Value(const Value&); @@ -167,7 +176,7 @@ namespace AZ::Dom explicit Value(Type type); - static Value FromOpaqueValue(AZStd::any& value); + static Value FromOpaqueValue(const AZStd::any& value); // Equality / comparison / swap... Value& operator=(const Value&); @@ -306,17 +315,17 @@ namespace AZ::Dom AZStd::string_view GetString() const; size_t GetStringLength() const; void SetString(AZStd::string_view); - void SetString(AZStd::shared_ptr); + void SetString(SharedStringType sharedString); void CopyFromString(AZStd::string_view); // Opaque type API... - AZStd::any& GetOpaqueValue() const; + const AZStd::any& GetOpaqueValue() const; //! This sets this Value to represent a value of an type that the DOM has //! no formal knowledge of. Where possible, it should be preferred to //! serialize an opaque type into a DOM value instead, as serializers //! and other systems will have no means of dealing with fully arbitrary //! values. - void SetOpaqueValue(AZStd::any&); + void SetOpaqueValue(const AZStd::any&); // Null API... void SetNull(); @@ -336,49 +345,37 @@ namespace AZ::Dom const Array::ContainerType& GetArrayInternal() const; Array::ContainerType& GetArrayInternal(); - explicit Value(AZStd::any* opaqueValue); - - // Determine the short string buffer size based on the size of our largest internal type (string_view) - // minus the size of the short string size field. - static constexpr const size_t ShortStringSize = sizeof(AZStd::string_view) - sizeof(size_t); - struct ShortStringType - { - AZStd::array m_data; - size_t m_size; - - bool operator==(const ShortStringType& other) const - { - return m_size == other.m_size ? memcmp(m_data.data(), other.m_data.data(), m_size) == 0 : false; - } - }; + explicit Value(const AZStd::any& opaqueValue); //! The internal storage type for Value. //! These types do not correspond one-to-one with the Value's external Type as there may be multiple storage classes //! for the same type in some instances, such as string storage. using ValueType = AZStd::variant< - // NullType + // Null AZStd::monostate, - // NumberType + // Int64 int64_t, + // Uint64 uint64_t, + // Double double, - // FalseType & TrueType + // Bool bool, // StringType AZStd::string_view, - AZStd::shared_ptr, + SharedStringType, ShortStringType, - // ObjectType + // Object ObjectPtr, - // ArrayType + // Array ArrayPtr, - // NodeType + // Node NodePtr, - // OpaqueType - AZStd::any*>; + // Opaque + AZStd::shared_ptr>; static_assert( - sizeof(ValueType) == sizeof(AZStd::variant), "ValueType should have no members larger than ShortStringType"); + sizeof(ValueType) == sizeof(ShortStringType) + sizeof(size_t), "ValueType should have no members larger than ShortStringType"); ValueType m_value; }; diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp index 172f7f2a92..9b814b1bff 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp @@ -68,7 +68,7 @@ namespace AZ::Dom return FinishWrite(); } - Visitor::Result ValueWriter::RefCountedString(AZStd::shared_ptr value, [[maybe_unused]] Lifetime lifetime) + Visitor::Result ValueWriter::RefCountedString(AZStd::shared_ptr> value, [[maybe_unused]] Lifetime lifetime) { CurrentValue().SetString(value); return FinishWrite(); diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h index 488535ace6..4fdea293eb 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.h @@ -28,7 +28,7 @@ namespace AZ::Dom Result Double(double value) override; Result String(AZStd::string_view value, Lifetime lifetime) override; - Result RefCountedString(AZStd::shared_ptr value, Lifetime lifetime) override; + Result RefCountedString(AZStd::shared_ptr> value, Lifetime lifetime) override; Result StartObject() override; Result EndObject(AZ::u64 attributeCount) override; Result Key(AZ::Name key) override; diff --git a/Code/Framework/AzCore/AzCore/DOM/DomVisitor.cpp b/Code/Framework/AzCore/AzCore/DOM/DomVisitor.cpp index 4e13a2a95c..0da4bcd5d3 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomVisitor.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomVisitor.cpp @@ -105,9 +105,9 @@ namespace AZ::Dom return VisitorSuccess(); } - Visitor::Result Visitor::RefCountedString(AZStd::shared_ptr value, Lifetime lifetime) + Visitor::Result Visitor::RefCountedString(AZStd::shared_ptr> value, Lifetime lifetime) { - return String(*value, lifetime); + return String({ value->data(), value->size() }, lifetime); } Visitor::Result Visitor::OpaqueValue([[maybe_unused]] OpaqueType& value) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomVisitor.h b/Code/Framework/AzCore/AzCore/DOM/DomVisitor.h index 3bf1b3419b..f9930f93c6 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomVisitor.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomVisitor.h @@ -11,8 +11,9 @@ #include #include #include -#include +#include #include +#include namespace AZ::Dom { @@ -176,7 +177,7 @@ namespace AZ::Dom //! Operates on a ref-counted string value. S //! \param lifetime Specifies the lifetime of this string. If the string has a temporary lifetime, it may not //! be safely stored as a reference, but may still be safely stored as a ref-counted shared_ptr. - virtual Result RefCountedString(AZStd::shared_ptr value, Lifetime lifetime); + virtual Result RefCountedString(AZStd::shared_ptr> value, Lifetime lifetime); //! Operates on an opaque value. As opaque values are a reference type, storage semantics are provided to //! indicate where the value may be stored persistently or requires a copy. //! The base implementation of OpaqueValue rejects the operation, as opaque values are meant for special diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp index 51d2e5c10c..af5b367d63 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp @@ -220,4 +220,33 @@ namespace AZ::Dom::Benchmark } BENCHMARK_REGISTER_F(DomValueBenchmark, LookupMemberByString)->Arg(100)->Arg(1000)->Arg(10000)->Unit(benchmark::kMillisecond); + BENCHMARK_DEFINE_F(DomValueBenchmark, LookupMemberByStringComparison)(benchmark::State& state) + { + Value value(Type::Object); + AZStd::vector keys; + for (int64_t i = 0; i < state.range(0); ++i) + { + AZStd::string key(AZStd::string::format("key%" PRId64, i)); + keys.push_back(key); + value[key] = i; + } + + for (auto _ : state) + { + for (const AZStd::string& key : keys) + { + const Object::ContainerType& object = value.GetObject(); + benchmark::DoNotOptimize(AZStd::find_if( + object.cbegin(), object.cend(), + [&key](const Object::EntryType& entry) + { + return key == entry.first.GetStringView(); + })); + } + } + + state.SetItemsProcessed(state.iterations() * state.range(0)); + } + BENCHMARK_REGISTER_F(DomValueBenchmark, LookupMemberByStringComparison)->Arg(100)->Arg(1000)->Arg(10000)->Unit(benchmark::kMillisecond); + } // namespace AZ::Dom::Benchmark From a4df91b718b673d676af0dbcd40e9322ec904ff9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Dec 2021 17:38:47 -0800 Subject: [PATCH 211/948] Bump pyyaml in /scripts/build/build_node/Platform/Common (#6514) Bumps [pyyaml](https://github.com/yaml/pyyaml) from 5.3.1 to 5.4. - [Release notes](https://github.com/yaml/pyyaml/releases) - [Changelog](https://github.com/yaml/pyyaml/blob/master/CHANGES) - [Commits](https://github.com/yaml/pyyaml/compare/5.3.1...5.4) --- updated-dependencies: - dependency-name: pyyaml dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../Platform/Common/requirements.txt | 36 +++++++++++-------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/scripts/build/build_node/Platform/Common/requirements.txt b/scripts/build/build_node/Platform/Common/requirements.txt index 6fb767509e..7375d3e849 100644 --- a/scripts/build/build_node/Platform/Common/requirements.txt +++ b/scripts/build/build_node/Platform/Common/requirements.txt @@ -148,20 +148,28 @@ pywin32==228 \ pyxb==1.2.6 \ --hash=sha256:2a00f38dd1d87b88f92d79bc5a09718d730419b88e814545f472bbd5a3bf27b4 \ # via -r requirements.txt -pyyaml==5.3.1 \ - --hash=sha256:06a0d7ba600ce0b2d2fe2e78453a470b5a6e000a985dd4a4e54e436cc36b0e97 \ - --hash=sha256:240097ff019d7c70a4922b6869d8a86407758333f02203e0fc6ff79c5dcede76 \ - --hash=sha256:4f4b913ca1a7319b33cfb1369e91e50354d6f07a135f3b901aca02aa95940bd2 \ - --hash=sha256:6034f55dab5fea9e53f436aa68fa3ace2634918e8b5994d82f3621c04ff5ed2e \ - --hash=sha256:69f00dca373f240f842b2931fb2c7e14ddbacd1397d57157a9b005a6a9942648 \ - --hash=sha256:73f099454b799e05e5ab51423c7bcf361c58d3206fa7b0d555426b1f4d9a3eaf \ - --hash=sha256:74809a57b329d6cc0fdccee6318f44b9b8649961fa73144a98735b0aaf029f1f \ - --hash=sha256:7739fc0fa8205b3ee8808aea45e968bc90082c10aef6ea95e855e10abf4a37b2 \ - --hash=sha256:95f71d2af0ff4227885f7a6605c37fd53d3a106fcab511b8860ecca9fcf400ee \ - --hash=sha256:ad9c67312c84def58f3c04504727ca879cb0013b2517c85a9a253f0cb6380c0a \ - --hash=sha256:b8eac752c5e14d3eca0e6dd9199cd627518cb5ec06add0de9d32baeee6fe645d \ - --hash=sha256:cc8955cfbfc7a115fa81d85284ee61147059a753344bc51098f3ccd69b0d7e0c \ - --hash=sha256:d13155f591e6fcc1ec3b30685d50bf0711574e2c0dfffd7644babf8b5102ca1a \ +pyyaml==5.4 \ + --hash=sha256:f7a21e3d99aa3095ef0553e7ceba36fb693998fbb1226f1392ce33681047465f \ + --hash=sha256:5e7ac4e0e79a53451dc2814f6876c2fa6f71452de1498bbe29c0b54b69a986f4 \ + --hash=sha256:52bf0930903818e600ae6c2901f748bc4869c0c406056f679ab9614e5d21a166 \ + --hash=sha256:a36a48a51e5471513a5aea920cdad84cbd56d70a5057cca3499a637496ea379c \ + --hash=sha256:cc552b6434b90d9dbed6a4f13339625dc466fd82597119897e9489c953acbc22 \ + --hash=sha256:0dc9f2eb2e3c97640928dec63fd8dc1dd91e6b6ed236bd5ac00332b99b5c2ff9 \ + --hash=sha256:5a3f345acff76cad4aa9cb171ee76c590f37394186325d53d1aa25318b0d4a09 \ + --hash=sha256:f3790156c606299ff499ec44db422f66f05a7363b39eb9d5b064f17bd7d7c47b \ + --hash=sha256:124fd7c7bc1e95b1eafc60825f2daf67c73ce7b33f1194731240d24b0d1bf628 \ + --hash=sha256:8b818b6c5a920cbe4203b5a6b14256f0e5244338244560da89b7b0f1313ea4b6 \ + --hash=sha256:737bd70e454a284d456aa1fa71a0b429dd527bcbf52c5c33f7c8eee81ac16b89 \ + --hash=sha256:7242790ab6c20316b8e7bb545be48d7ed36e26bbe279fd56f2c4a12510e60b4b \ + --hash=sha256:cc547d3ead3754712223abb7b403f0a184e4c3eae18c9bb7fd15adef1597cc4b \ + --hash=sha256:8635d53223b1f561b081ff4adecb828fd484b8efffe542edcfdff471997f7c39 \ + --hash=sha256:26fcb33776857f4072601502d93e1a619f166c9c00befb52826e7b774efaa9db \ + --hash=sha256:b2243dd033fd02c01212ad5c601dafb44fbb293065f430b0d3dbf03f3254d615 \ + --hash=sha256:31ba07c54ef4a897758563e3a0fcc60077698df10180abe4b8165d9895c00ebf \ + --hash=sha256:02c78d77281d8f8d07a255e57abdbf43b02257f59f50cc6b636937d68efa5dd0 \ + --hash=sha256:fdc6b2cb4b19e431994f25a9160695cc59a4e861710cc6fc97161c5e845fc579 \ + --hash=sha256:8bf38641b4713d77da19e91f8b5296b832e4db87338d6aeffe422d42f1ca896d \ + --hash=sha256:3c49e39ac034fd64fd576d63bb4db53cda89b362768a67f07749d55f128ac18a \ # via -r requirements.txt requests==2.25.0 \ --hash=sha256:7f1a0b932f4a60a1a65caa4263921bb7d9ee911957e0ae4a23a6dd08185ad5f8 \ From 1da99eaea02874f22c1fde8df07e7e730dbd3c6a Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Mon, 20 Dec 2021 18:27:00 -0800 Subject: [PATCH 212/948] Add type-safe GetTypeIndex instead of hardcoded index lookups Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 96 ++++++++++++++----- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 54 +++++------ 2 files changed, 97 insertions(+), 53 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index 3dafc02c6e..3836568f37 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -26,6 +26,51 @@ namespace AZ::Dom return refCountedPointer; } + namespace Internal + { + template + constexpr size_t GetTypeIndexInternal(size_t index = 0) + { + static_assert(false, "Type not found in ValueType"); + return index; + } + + template + constexpr size_t GetTypeIndexInternal(size_t index = 0) + { + if constexpr (AZStd::is_same_v) + { + return index; + } + else + { + return GetTypeIndexInternal(index + 1); + } + } + + template + struct ExtractTypeArgs + { + }; + + template class TypeToExtract, typename... Args> + struct ExtractTypeArgs> + { + template + static constexpr size_t GetTypeIndex() + { + return GetTypeIndexInternal(); + } + }; + } // namespace Internal + + // Helper function, looks up the index of a type within Value::m_value's storage + template + constexpr size_t GetTypeIndex() + { + return Internal::ExtractTypeArgs::GetTypeIndex(); + } + Node::Node(AZ::Name name) : m_name(name) { @@ -227,27 +272,27 @@ namespace AZ::Dom { switch (m_value.index()) { - case 0: // AZStd::monostate + case GetTypeIndex(): return Type::Null; - case 1: // int64_t + case GetTypeIndex(): return Type::Int64; - case 2: // uint64_t + case GetTypeIndex(): return Type::Uint64; - case 3: // double + case GetTypeIndex(): return Type::Double; - case 4: // bool + case GetTypeIndex(): return Type::Bool; - case 5: // AZStd::string_view - case 6: // AZStd::shared_ptr - case 7: // ShortStringType + case GetTypeIndex(): + case GetTypeIndex(): + case GetTypeIndex(): return Type::String; - case 8: // ObjectPtr + case GetTypeIndex(): return Type::Object; - case 9: // ArrayPtr + case GetTypeIndex(): return Type::Array; - case 10: // NodePtr + case GetTypeIndex(): return Type::Node; - case 11: // AZStd::any* + case GetTypeIndex>(): return Type::Opaque; } AZ_Assert(false, "AZ::Dom::Value::GetType: m_value has an unexpected type"); @@ -813,11 +858,11 @@ namespace AZ::Dom { switch (m_value.index()) { - case 1: // int64_t + case GetTypeIndex(): return AZStd::get(m_value); - case 2: // uint64_t + case GetTypeIndex(): return aznumeric_cast(AZStd::get(m_value)); - case 3: // double + case GetTypeIndex(): return aznumeric_cast(AZStd::get(m_value)); } AZ_Assert(false, "AZ::Dom::Value: Called GetInt on a non-numeric type"); @@ -843,11 +888,11 @@ namespace AZ::Dom { switch (m_value.index()) { - case 1: // int64_t + case GetTypeIndex(): return aznumeric_cast(AZStd::get(m_value)); - case 2: // uint64_t + case GetTypeIndex(): return AZStd::get(m_value); - case 3: // double + case GetTypeIndex(): return aznumeric_cast(AZStd::get(m_value)); } AZ_Assert(false, "AZ::Dom::Value: Called GetInt on a non-numeric type"); @@ -888,11 +933,11 @@ namespace AZ::Dom { switch (m_value.index()) { - case 1: // int64_t + case GetTypeIndex(): return aznumeric_cast(AZStd::get(m_value)); - case 2: // uint64_t + case GetTypeIndex(): return aznumeric_cast(AZStd::get(m_value)); - case 3: // double + case GetTypeIndex(): return AZStd::get(m_value); } AZ_Assert(false, "AZ::Dom::Value: Called GetInt on a non-numeric type"); @@ -923,14 +968,14 @@ namespace AZ::Dom { switch (m_value.index()) { - case 5: // AZStd::string_view + case GetTypeIndex(): return AZStd::get(m_value); - case 6: // AZStd::shared_ptr> + case GetTypeIndex(): { auto& buffer = *AZStd::get(m_value); return { buffer.data(), buffer.size() }; } - case 7: // ShortStringType + case GetTypeIndex(): { const ShortStringType& shortString = AZStd::get(m_value); return { shortString.data(), shortString.size() }; @@ -965,8 +1010,7 @@ namespace AZ::Dom } else { - SharedStringType sharedString = - AZStd::allocate_shared(StdValueAllocator(), value.begin(), value.end()); + SharedStringType sharedString = AZStd::allocate_shared(StdValueAllocator(), value.begin(), value.end()); m_value = AZStd::move(sharedString); } } diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index bc1b790009..86e98030e2 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -159,6 +159,33 @@ namespace AZ::Dom using SharedStringContainer = AZStd::vector; using SharedStringType = AZStd::shared_ptr; + //! The internal storage type for Value. + //! These types do not correspond one-to-one with the Value's external Type as there may be multiple storage classes + //! for the same type in some instances, such as string storage. + using ValueType = AZStd::variant< + // Null + AZStd::monostate, + // Int64 + int64_t, + // Uint64 + uint64_t, + // Double + double, + // Bool + bool, + // StringType + AZStd::string_view, + SharedStringType, + ShortStringType, + // Object + ObjectPtr, + // Array + ArrayPtr, + // Node + NodePtr, + // Opaque + AZStd::shared_ptr>; + // Constructors... Value(); Value(const Value&); @@ -347,33 +374,6 @@ namespace AZ::Dom explicit Value(const AZStd::any& opaqueValue); - //! The internal storage type for Value. - //! These types do not correspond one-to-one with the Value's external Type as there may be multiple storage classes - //! for the same type in some instances, such as string storage. - using ValueType = AZStd::variant< - // Null - AZStd::monostate, - // Int64 - int64_t, - // Uint64 - uint64_t, - // Double - double, - // Bool - bool, - // StringType - AZStd::string_view, - SharedStringType, - ShortStringType, - // Object - ObjectPtr, - // Array - ArrayPtr, - // Node - NodePtr, - // Opaque - AZStd::shared_ptr>; - static_assert( sizeof(ValueType) == sizeof(ShortStringType) + sizeof(size_t), "ValueType should have no members larger than ShortStringType"); From 366a7118ab8e2f7eb11b271feeae5c2d0b73fe37 Mon Sep 17 00:00:00 2001 From: Roman <69218254+amzn-rhhong@users.noreply.github.com> Date: Mon, 20 Dec 2021 22:00:47 -0800 Subject: [PATCH 213/948] Attachment: expose more function from AttachmentComponentRequestBus to behavior context (#6456) Signed-off-by: rhhong --- .../Code/Source/Animation/AttachmentComponent.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Animation/AttachmentComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Animation/AttachmentComponent.cpp index ee66518779..74e01c7829 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Animation/AttachmentComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Animation/AttachmentComponent.cpp @@ -58,13 +58,17 @@ namespace AZ behaviorContext->EBus("AttachmentComponentRequestBus") ->Event("Attach", &LmbrCentral::AttachmentComponentRequestBus::Events::Attach) ->Event("Detach", &LmbrCentral::AttachmentComponentRequestBus::Events::Detach) - ->Event("SetAttachmentOffset", &LmbrCentral::AttachmentComponentRequestBus::Events::SetAttachmentOffset); + ->Event("SetAttachmentOffset", &LmbrCentral::AttachmentComponentRequestBus::Events::SetAttachmentOffset) + ->Event("GetJointName", &LmbrCentral::AttachmentComponentRequestBus::Events::GetJointName) + ->Event("GetTargetEntityId", &LmbrCentral::AttachmentComponentRequestBus::Events::GetTargetEntityId) + ->Event("GetOffset", &LmbrCentral::AttachmentComponentRequestBus::Events::GetOffset); behaviorContext->EBus("AttachmentComponentNotificationBus") ->Handler(); } } + void AttachmentComponent::Reflect(AZ::ReflectContext* context) { AttachmentConfiguration::Reflect(context); From 657e56edf7b06d986e1588aaf59c0af9c308143a Mon Sep 17 00:00:00 2001 From: sphrose <82213493+sphrose@users.noreply.github.com> Date: Tue, 21 Dec 2021 09:55:29 +0000 Subject: [PATCH 214/948] revew changes Signed-off-by: sphrose <82213493+sphrose@users.noreply.github.com> --- .../Source/Components/TerrainSurfaceDataSystemComponent.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp b/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp index b36283bd3c..a35fa50e65 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp +++ b/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp @@ -98,6 +98,7 @@ namespace Terrain { m_providerHandle = SurfaceData::InvalidSurfaceDataRegistryHandle; AzFramework::Terrain::TerrainDataNotificationBus::Handler::BusConnect(); + SurfaceData::SurfaceDataTagProviderRequestBus::Handler::BusConnect(); UpdateTerrainData(AZ::Aabb::CreateNull()); } @@ -112,6 +113,7 @@ namespace Terrain } SurfaceData::SurfaceDataProviderRequestBus::Handler::BusDisconnect(); + SurfaceData::SurfaceDataTagProviderRequestBus::Handler::BusDisconnect(); AzFramework::Terrain::TerrainDataNotificationBus::Handler::BusDisconnect(); // Clear the cached terrain bounds data @@ -241,8 +243,6 @@ namespace Terrain // Start listening for surface data events AZ_Assert((m_providerHandle != SurfaceData::InvalidSurfaceDataRegistryHandle), "Invalid surface data handle"); SurfaceData::SurfaceDataProviderRequestBus::Handler::BusConnect(m_providerHandle); - - SurfaceData::SurfaceDataTagProviderRequestBus::Handler::BusConnect(); } else if (terrainValidBeforeUpdate && !terrainValidAfterUpdate) { @@ -251,8 +251,6 @@ namespace Terrain SurfaceData::SurfaceDataSystemRequestBus::Broadcast( &SurfaceData::SurfaceDataSystemRequestBus::Events::UnregisterSurfaceDataProvider, m_providerHandle); m_providerHandle = SurfaceData::InvalidSurfaceDataRegistryHandle; - - SurfaceData::SurfaceDataProviderRequestBus::Handler::BusDisconnect(); } else { From 219653a75beddc3db51bb8de5a9d6b980214f272 Mon Sep 17 00:00:00 2001 From: John Jones-Steele <82226755+jjjoness@users.noreply.github.com> Date: Tue, 21 Dec 2021 10:43:18 +0000 Subject: [PATCH 215/948] Fixes rounding error display in Slider control (#6477) Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com> --- .../Components/Widgets/SliderCombo.cpp | 28 +++++++++++++++++-- .../Components/Widgets/SliderCombo.h | 3 ++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SliderCombo.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SliderCombo.cpp index 7b818459d6..6333d28365 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SliderCombo.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SliderCombo.cpp @@ -243,7 +243,7 @@ SliderDoubleCombo::SliderDoubleCombo(QWidget* parent) InitialiseSliderCombo(this, layout, m_spinbox, m_slider); - connect(m_slider, &SliderDouble::valueChanged, this, &SliderDoubleCombo::setValue); + connect(m_slider, &SliderDouble::valueChanged, this, &SliderDoubleCombo::setValueSlider); connect(m_spinbox, QOverload::of(&DoubleSpinBox::valueChanged), this, &SliderDoubleCombo::setValue); connect(m_slider, &SliderDouble::sliderReleased, this, &SliderDoubleCombo::editingFinished); connect(m_spinbox, &DoubleSpinBox::editingFinished, this, &SliderDoubleCombo::editingFinished); @@ -254,7 +254,7 @@ SliderDoubleCombo::~SliderDoubleCombo() { } -void SliderDoubleCombo::setValue(double value) +void SliderDoubleCombo::setValueSlider(double value) { const bool doEmit = m_value != value; m_value = value; @@ -264,10 +264,34 @@ void SliderDoubleCombo::setValue(double value) if (doEmit) { + // We don't want to update the slider from setValue as this + // causes rounding errors in the tooltip hint. + m_fromSlider = true; Q_EMIT valueChanged(); } } +void SliderDoubleCombo::setValue(double value) +{ + const bool doEmit = m_value != value; + m_value = value; + + updateSpinBox(); + if (!m_fromSlider) + { + updateSlider(); + + if (doEmit) + { + Q_EMIT valueChanged(); + } + } + else + { + m_fromSlider = false; + } +} + SliderDouble* SliderDoubleCombo::slider() const { return m_slider; diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SliderCombo.h b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SliderCombo.h index 2646162af4..05d0f7b51b 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SliderCombo.h +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SliderCombo.h @@ -151,6 +151,8 @@ namespace AzQtComponents //! Sets the current value. void setValue(double value); + //! Sets the current value. + void setValueSlider(double value); //! Return the current value. Q_REQUIRED_RESULT double value() const; @@ -235,5 +237,6 @@ namespace AzQtComponents double m_softMinimum = 0.0; double m_softMaximum = 100.0; double m_value = 0.0; + bool m_fromSlider{ false }; }; } // namespace AzQtComponents From 704aef8cad2ac4b8b9c12fde26c9e66ae5a8977c Mon Sep 17 00:00:00 2001 From: allisaurus <34254888+allisaurus@users.noreply.github.com> Date: Tue, 21 Dec 2021 11:11:45 -0800 Subject: [PATCH 216/948] Add pytest to Resource Mapping Tool requirements.txt (#6259) * Add pytest to Resource Mapping Tool requirements.txt Signed-off-by: allisaurus <34254888+allisaurus@users.noreply.github.com> --- .../Code/Tools/ResourceMappingTool/README.md | 48 +++++++++++++------ .../ResourceMappingTool/requirements.txt | 3 ++ 2 files changed, 37 insertions(+), 14 deletions(-) diff --git a/Gems/AWSCore/Code/Tools/ResourceMappingTool/README.md b/Gems/AWSCore/Code/Tools/ResourceMappingTool/README.md index ba764dc993..33152fb2ee 100644 --- a/Gems/AWSCore/Code/Tools/ResourceMappingTool/README.md +++ b/Gems/AWSCore/Code/Tools/ResourceMappingTool/README.md @@ -1,35 +1,40 @@ # Welcome to the AWS Core Resource Mapping Tool project! -## Setup aws config and credential -Resource mapping tool is using boto3 to interact with aws services: +## Setup aws config and credentials +The Resource Mapping Tool uses boto3 to interact with aws services: * Read boto3 [Configuration](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/configuration.html) to setup default aws region. * Read boto3 [Credentials](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html) to setup default profile or credential keys. -Or follow **AWS CLI** configuration which can be reused by boto3 lib: +Or follow **AWS CLI** configuration directions which can be reused by the boto3 lib: * Follow [Quick configuration with aws configure](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html#cli-configure-quickstart-config) ## Python Environment Setup Options -### 1. Engine python environment (Including Editor) -1. In order to use engine python environment, it requires to link Qt binaries for this tool. +### 1. Use Engine python environment (Including Editor) +1. In order to use the Open 3D Engine's python environment, this tool requires linking the Qt binaries. Follow cmake instructions to configure your project, for example: ``` $ cmake -B -S . -G "Visual Studio 16 2019" -DLY_PROJECTS= ``` -2. At this point, double check engine python environment gets setup under */python/runtime* directory +2. At this point, double check that the Open 3D Engine's python environment gets set up under */python/runtime* directory -3. Build project with **AWSCore.Editor** (or **AWSCore.ResourceMappintTool**, or **Editor**) target to generate required Qt binaries. +3. Build the project with the **AWSCore.Editor** (or **AWSCore.ResourceMappingTool**, or **Editor**) target to generate the required Qt binaries. + * Windows + ``` + $ cmake --build --target AWSCore.Editor --config /m + ``` + * Linux ``` $ cmake --build --target AWSCore.Editor --config -j ``` -4. At this point, double check Qt binaries gets generated under */bin//AWSCoreEditorQtBin* directory +4. At this point, double check the Qt binaries have been generated under */bin//AWSCoreEditorQtBin* directory -5. Launch resource mapping tool under engine root folder: +5. Launch the Resource Mapping Tool from the engine root folder: * Windows * release mode ``` @@ -49,10 +54,9 @@ Follow cmake instructions to configure your project, for example: $ python/python.sh Gems/AWSCore/Code/Tools/ResourceMappingTool/resource_mapping_tool.py --binaries_path /bin/debug/AWSCoreEditorQtBin ``` -* Note - Editor is integrated with the same engine python environment to launch Resource Mapping Tool. If it is failed to launch the tool -in Editor, please follow above steps to make sure expected scripts/binaries are present. +* Note - the engine Editor is integrated with the same python environment used to launch the Resource Mapping Tool. If the tool fails to launch from the Editor, please double check that you have completed all of the above steps and that the expected scripts and binaries are present in the expected directories. -### 2. Python virtual environment +### 2. Use a separate python virtual environment This project is set up like a standard Python project. The initialization process also creates a virtualenv within this project, stored under the `.env` directory. To create the virtualenv it assumes that there is a `python3` @@ -105,7 +109,23 @@ you can create the virtualenv manually. * `--config-path` **[Optional]** Path to resource mapping config directory, if not provided tool will use current directory. * `--debug` **[Optional]** Execute on debug mode to enable DEBUG logging level. -* `--log-path` **[Optional]** Path to resource mapping tool logging directory, +* `--log-path` **[Optional]** Path to Resource Mapping Tool logging directory, if not provided tool will store logging under tool source code directory. * `--profile` **[Optional]** Named AWS profile to use for querying AWS resources, - if not provided tool will use `default` aws profile. \ No newline at end of file + if not provided tool will use `default` aws profile. + + +## Running tests + +How to run the unit tests for the project: + +1. If not already activated, activate the project's python environment as explained above. +2. Use `pytest` to run one or more tests (command paths formatted as if run from this directory): + * Run all the tests + ``` + python -m pytest -vv . + ``` + * Run a specific test file or directory: + ``` + python -m pytest tests\unit\model\test_basic_resource_attributes.py + ``` \ No newline at end of file diff --git a/Gems/AWSCore/Code/Tools/ResourceMappingTool/requirements.txt b/Gems/AWSCore/Code/Tools/ResourceMappingTool/requirements.txt index 2b931e0b51..ee8e94640a 100644 --- a/Gems/AWSCore/Code/Tools/ResourceMappingTool/requirements.txt +++ b/Gems/AWSCore/Code/Tools/ResourceMappingTool/requirements.txt @@ -1,2 +1,5 @@ PySide2>=5.15.2 boto3>=1.17.30 +pytest>=5.3.2 + + From 44744d95b0682a19108b1fa8d71475589fabdf42 Mon Sep 17 00:00:00 2001 From: Junbo Liang <68558268+junbo75@users.noreply.github.com> Date: Tue, 21 Dec 2021 12:28:54 -0800 Subject: [PATCH 217/948] Fix the cmake issue for AWSI automation tests (#6531) Signed-off-by: Junbo Liang <68558268+junbo75@users.noreply.github.com> --- AutomatedTesting/Gem/PythonTests/AWS/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AutomatedTesting/Gem/PythonTests/AWS/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/AWS/CMakeLists.txt index d6740152a7..c8629bbe8b 100644 --- a/AutomatedTesting/Gem/PythonTests/AWS/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/AWS/CMakeLists.txt @@ -22,7 +22,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) NAME AutomatedTesting::AWSTests TEST_SUITE awsi TEST_SERIAL - PATH ${CMAKE_CURRENT_LIST_DIR}/${PAL_PLATFORM_NAME}/ + PATH ${CMAKE_CURRENT_LIST_DIR}/ RUNTIME_DEPENDENCIES AZ::AssetProcessor AutomatedTesting.GameLauncher From a96387ee3585ae9abb0e2bdde676e3703dac1d3e Mon Sep 17 00:00:00 2001 From: Jeremy Ong Date: Tue, 21 Dec 2021 13:12:25 -0700 Subject: [PATCH 218/948] Fix compile issues blocking adoption of Pix 2108 Signed-off-by: Jeremy Ong --- Code/Editor/IEditorImpl.cpp | 2 +- Code/Editor/Include/IEditorClassFactory.h | 7 ++----- Code/Editor/Include/IViewPane.h | 2 +- Code/Editor/Plugin.cpp | 2 +- .../PerforcePlugin/PerforceSourceControl.h | 2 +- Code/Editor/PreferencesStdPages.cpp | 2 +- Code/Editor/Util/FileUtil.cpp | 2 +- .../native/utilities/ApplicationManagerBase.cpp | 16 ++++++++-------- 8 files changed, 16 insertions(+), 19 deletions(-) diff --git a/Code/Editor/IEditorImpl.cpp b/Code/Editor/IEditorImpl.cpp index e5df6be58e..5bd816174c 100644 --- a/Code/Editor/IEditorImpl.cpp +++ b/Code/Editor/IEditorImpl.cpp @@ -1445,7 +1445,7 @@ ISourceControl* CEditorImpl::GetSourceControl() { IClassDesc* pClass = classes[i]; ISourceControl* pSCM = nullptr; - HRESULT hRes = pClass->QueryInterface(__uuidof(ISourceControl), (void**)&pSCM); + HRESULT hRes = pClass->QueryInterface(__az_uuidof(ISourceControl), (void**)&pSCM); if (!FAILED(hRes) && pSCM) { m_pSourceControl = pSCM; diff --git a/Code/Editor/Include/IEditorClassFactory.h b/Code/Editor/Include/IEditorClassFactory.h index dd47f803e2..6c85192436 100644 --- a/Code/Editor/Include/IEditorClassFactory.h +++ b/Code/Editor/Include/IEditorClassFactory.h @@ -31,10 +31,7 @@ struct IUnknown }; #endif -#ifdef __uuidof -#undef __uuidof -#endif -#define __uuidof(T) T::uuid() +#define __az_uuidof(T) T::uuid() #if defined(AZ_PLATFORM_LINUX) || defined(AZ_PLATFORM_MAC) @@ -107,7 +104,7 @@ struct IClassDesc template HRESULT STDMETHODCALLTYPE QueryInterface(Q** pp) { - return QueryInterface(__uuidof(Q), (void**)pp); + return QueryInterface(__az_uuidof(Q), (void**)pp); } ////////////////////////////////////////////////////////////////////////// diff --git a/Code/Editor/Include/IViewPane.h b/Code/Editor/Include/IViewPane.h index b4a25a87a9..f2425fb954 100644 --- a/Code/Editor/Include/IViewPane.h +++ b/Code/Editor/Include/IViewPane.h @@ -60,7 +60,7 @@ struct IViewPaneClass ////////////////////////////////////////////////////////////////////////// HRESULT STDMETHODCALLTYPE QueryInterface(const IID& riid, void** ppvObj) { - if (riid == __uuidof(IViewPaneClass)) + if (riid == __az_uuidof(IViewPaneClass)) { *ppvObj = this; return S_OK; diff --git a/Code/Editor/Plugin.cpp b/Code/Editor/Plugin.cpp index 68f8d8833b..16c386e31c 100644 --- a/Code/Editor/Plugin.cpp +++ b/Code/Editor/Plugin.cpp @@ -155,7 +155,7 @@ IViewPaneClass* CClassFactory::FindViewPaneClassByTitle(const char* pPaneTitle) { IViewPaneClass* viewPane = nullptr; IClassDesc* desc = m_classes[i]; - if (SUCCEEDED(desc->QueryInterface(__uuidof(IViewPaneClass), (void**)&viewPane))) + if (SUCCEEDED(desc->QueryInterface(__az_uuidof(IViewPaneClass), (void**)&viewPane))) { if (QString::compare(viewPane->GetPaneTitle(), pPaneTitle) == 0) { diff --git a/Code/Editor/Plugins/PerforcePlugin/PerforceSourceControl.h b/Code/Editor/Plugins/PerforcePlugin/PerforceSourceControl.h index ec06fdc82a..794dca0f86 100644 --- a/Code/Editor/Plugins/PerforcePlugin/PerforceSourceControl.h +++ b/Code/Editor/Plugins/PerforcePlugin/PerforceSourceControl.h @@ -49,7 +49,7 @@ public: // from IUnknown HRESULT STDMETHODCALLTYPE QueryInterface(const IID& riid, void** ppvObj) { - if (riid == __uuidof(ISourceControl) /* && m_pIntegrator*/) + if (riid == __az_uuidof(ISourceControl) /* && m_pIntegrator*/) { *ppvObj = this; return S_OK; diff --git a/Code/Editor/PreferencesStdPages.cpp b/Code/Editor/PreferencesStdPages.cpp index 1dd40702a7..77b912a44e 100644 --- a/Code/Editor/PreferencesStdPages.cpp +++ b/Code/Editor/PreferencesStdPages.cpp @@ -50,7 +50,7 @@ CStdPreferencesClassDesc::CStdPreferencesClassDesc() HRESULT CStdPreferencesClassDesc::QueryInterface(const IID& riid, void** ppvObj) { - if (riid == __uuidof(IPreferencesPageCreator)) + if (riid == __az_uuidof(IPreferencesPageCreator)) { *ppvObj = (IPreferencesPageCreator*)this; return S_OK; diff --git a/Code/Editor/Util/FileUtil.cpp b/Code/Editor/Util/FileUtil.cpp index 9f96d45381..182a122ea8 100644 --- a/Code/Editor/Util/FileUtil.cpp +++ b/Code/Editor/Util/FileUtil.cpp @@ -251,7 +251,7 @@ bool CFileUtil::ExtractDccFilenameFromAssetDatabase(const QString& assetFilename for (size_t i = 0; i < assetDatabasePlugins.size(); ++i) { - if (assetDatabasePlugins[i]->QueryInterface(__uuidof(IAssetItemDatabase), (void**)&pCurrentDatabaseInterface) == S_OK) + if (assetDatabasePlugins[i]->QueryInterface(__az_uuidof(IAssetItemDatabase), (void**)&pCurrentDatabaseInterface) == S_OK) { if (!pCurrentDatabaseInterface) { diff --git a/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp b/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp index 499e5fe4f7..8837e9dc3f 100644 --- a/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp +++ b/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp @@ -966,18 +966,18 @@ void ApplicationManagerBase::HandleFileRelocation() const AZ_Printf(AssetProcessor::ConsoleChannel, "SETTING: Preview file move. Run again with --%s to actually make changes\n", ConfirmCommand); } - auto* interface = AZ::Interface::Get(); + auto* relocationInterface = AZ::Interface::Get(); - if(interface) + if(relocationInterface) { - auto result = interface->Move(source, destination, previewOnly, allowBrokenDependencies, !leaveEmptyFolders, updateReferences, excludeMetaDataFiles); + auto result = relocationInterface->Move(source, destination, previewOnly, allowBrokenDependencies, !leaveEmptyFolders, updateReferences, excludeMetaDataFiles); if (result.IsSuccess()) { AssetProcessor::RelocationSuccess success = result.TakeValue(); // The report can be too long for the AZ_Printf buffer, so split it into individual lines - AZStd::string report = interface->BuildReport(success.m_relocationContainer, success.m_updateTasks, true, updateReferences); + AZStd::string report = relocationInterface->BuildReport(success.m_relocationContainer, success.m_updateTasks, true, updateReferences); AZStd::vector lines; AzFramework::StringFunc::Tokenize(report.c_str(), lines, "\n"); @@ -1051,18 +1051,18 @@ void ApplicationManagerBase::HandleFileRelocation() const AZ_Printf(AssetProcessor::ConsoleChannel, "SETTING: Preview file delete. Run again with --%s to actually make changes\n", ConfirmCommand); } - auto* interface = AZ::Interface::Get(); + auto* relocationInterface = AZ::Interface::Get(); - if (interface) + if (relocationInterface) { - auto result = interface->Delete(source, previewOnly, allowBrokenDependencies, !leaveEmptyFolders, excludeMetaDataFiles); + auto result = relocationInterface->Delete(source, previewOnly, allowBrokenDependencies, !leaveEmptyFolders, excludeMetaDataFiles); if (result.IsSuccess()) { AssetProcessor::RelocationSuccess success = result.TakeValue(); // The report can be too long for the AZ_Printf buffer, so split it into individual lines - AZStd::string report = interface->BuildReport(success.m_relocationContainer, success.m_updateTasks, false, updateReferences); + AZStd::string report = relocationInterface->BuildReport(success.m_relocationContainer, success.m_updateTasks, false, updateReferences); AZStd::vector lines; AzFramework::StringFunc::Tokenize(report.c_str(), lines, "\n"); From 09c041559c45b6b86ad8ab8421701975abcab47e Mon Sep 17 00:00:00 2001 From: evanchia Date: Tue, 21 Dec 2021 13:13:57 -0800 Subject: [PATCH 219/948] removing outdated remote console test Signed-off-by: evanchia --- .../Gem/PythonTests/smoke/CMakeLists.txt | 16 ------- .../test_RemoteConsole_GPULoadLevel_Works.py | 43 ------------------- 2 files changed, 59 deletions(-) delete mode 100644 AutomatedTesting/Gem/PythonTests/smoke/test_RemoteConsole_GPULoadLevel_Works.py diff --git a/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt index 3fc4f3db0e..5d0808adb6 100644 --- a/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt @@ -31,22 +31,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) Smoke ) - ly_add_pytest( - NAME AutomatedTesting::LoadLevelGPU - TEST_SUITE smoke - TEST_SERIAL - TEST_REQUIRES gpu - PATH ${CMAKE_CURRENT_LIST_DIR}/test_RemoteConsole_GPULoadLevel_Works.py - TIMEOUT 100 - RUNTIME_DEPENDENCIES - AZ::AssetProcessor - AZ::PythonBindingsExample - AutomatedTesting.GameLauncher - AutomatedTesting.Assets - COMPONENT - Smoke - ) - ly_add_pytest( NAME AutomatedTesting::EditorTestWithGPU TEST_REQUIRES gpu diff --git a/AutomatedTesting/Gem/PythonTests/smoke/test_RemoteConsole_GPULoadLevel_Works.py b/AutomatedTesting/Gem/PythonTests/smoke/test_RemoteConsole_GPULoadLevel_Works.py deleted file mode 100644 index 7debcab938..0000000000 --- a/AutomatedTesting/Gem/PythonTests/smoke/test_RemoteConsole_GPULoadLevel_Works.py +++ /dev/null @@ -1,43 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT - - -UI Apps: AutomatedTesting.GameLauncher -Launch AutomatedTesting.GameLauncher with Simple level -Test should run in both gpu and non gpu -""" - -import pytest -import psutil - -import ly_test_tools.environment.waiter as waiter -import editor_python_test_tools.hydra_test_utils as editor_test_utils -from ly_remote_console.remote_console_commands import RemoteConsole as RemoteConsole -from ly_remote_console.remote_console_commands import ( - send_command_and_expect_response as send_command_and_expect_response, -) - - -@pytest.mark.parametrize("launcher_platform", ["windows"]) -@pytest.mark.parametrize("project", ["AutomatedTesting"]) -@pytest.mark.parametrize("level", ["Simple"]) -class TestRemoteConsoleLoadLevelWorks(object): - @pytest.fixture - def remote_console_instance(self, request): - console = RemoteConsole() - - def teardown(): - if console.connected: - console.stop() - - request.addfinalizer(teardown) - - return console - - def test_RemoteConsole_LoadLevel_Works(self, launcher, level, remote_console_instance, launcher_platform): - expected_lines = ['Level system is loading "Simple"'] - - editor_test_utils.launch_and_validate_results_launcher(launcher, level, remote_console_instance, expected_lines, null_renderer=False) From 845525a722eae059e7750e6281d2cc751b4fad21 Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Tue, 21 Dec 2021 16:28:44 -0600 Subject: [PATCH 220/948] Add support for loading Png data directly from a memory buffer. (#6527) * Add support for loading Png data directly from a memory buffer. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> (cherry picked from commit 6193dcf603d3c16ee193e1e6dc868bd6d04f89bc) * Addressed PR feedback. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Addressed PR feedback. Simplified LoadInternal() by having it always use a GenericStream. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- .../Utils/Code/Include/Atom/Utils/PngFile.h | 8 +- Gems/Atom/Utils/Code/Source/PngFile.cpp | 84 +++++++++++++++---- Gems/Atom/Utils/Code/Tests/PngFileTests.cpp | 64 +++++++++++++- 3 files changed, 138 insertions(+), 18 deletions(-) diff --git a/Gems/Atom/Utils/Code/Include/Atom/Utils/PngFile.h b/Gems/Atom/Utils/Code/Include/Atom/Utils/PngFile.h index 1de27e9b96..b862786c2f 100644 --- a/Gems/Atom/Utils/Code/Include/Atom/Utils/PngFile.h +++ b/Gems/Atom/Utils/Code/Include/Atom/Utils/PngFile.h @@ -7,6 +7,7 @@ */ #pragma once +#include #include #include #include @@ -53,6 +54,9 @@ namespace AZ //! @return the loaded PngFile or an invalid PngFile if there was an error. static PngFile Load(const char* path, LoadSettings loadSettings = {}); + //! @return the loaded PngFile or an invalid PngFile if there was an error. + static PngFile LoadFromBuffer(AZStd::array_view data, LoadSettings loadSettings = {}); + //! Create a PngFile from an RHI data buffer. //! @param size the dimensions of the image (m_depth is not used, assumed to be 1) //! @param format indicates the pixel format represented by @data. Only a limited set of formats are supported, see implementation. @@ -83,10 +87,12 @@ namespace AZ private: AZ_DEFAULT_COPY(PngFile) - static const int HeaderSize = 8; + static const int HeaderSize = 8; static void DefaultErrorHandler(const char* message); + static PngFile LoadInternal(AZ::IO::GenericStream& dataStream, LoadSettings loadSettings); + uint32_t m_width = 0; uint32_t m_height = 0; int32_t m_bitDepth = 0; diff --git a/Gems/Atom/Utils/Code/Source/PngFile.cpp b/Gems/Atom/Utils/Code/Source/PngFile.cpp index 28f5374d88..1454dc68c9 100644 --- a/Gems/Atom/Utils/Code/Source/PngFile.cpp +++ b/Gems/Atom/Utils/Code/Source/PngFile.cpp @@ -8,6 +8,7 @@ #include #include +#include namespace AZ { @@ -68,24 +69,66 @@ namespace AZ { if (!loadSettings.m_errorHandler) { - loadSettings.m_errorHandler = [path](const char* message) { DefaultErrorHandler(AZStd::string::format("Could not load file '%s'. %s", path, message).c_str()); }; + loadSettings.m_errorHandler = [path](const char* message) + { + DefaultErrorHandler(AZStd::string::format("Could not load file '%s'. %s", path, message).c_str()); + }; + } + + AZ::IO::SystemFile file; + file.Open(path, AZ::IO::SystemFile::SF_OPEN_READ_ONLY); + if (!file.IsOpen()) + { + loadSettings.m_errorHandler("Cannot open file."); + return {}; } + constexpr bool StreamOwnsFilePointer = true; + AZ::IO::SystemFileStream fileLoadStream(&file, StreamOwnsFilePointer); + + auto pngFile = LoadInternal(fileLoadStream, loadSettings); + return pngFile; + } + + PngFile PngFile::LoadFromBuffer(AZStd::array_view data, LoadSettings loadSettings) + { + if (!loadSettings.m_errorHandler) + { + loadSettings.m_errorHandler = [](const char* message) + { + DefaultErrorHandler(AZStd::string::format("Could not load Png from buffer. %s", message).c_str()); + }; + } + + if (data.empty()) + { + loadSettings.m_errorHandler("Buffer is empty."); + return {}; + } + + AZ::IO::MemoryStream memStream(data.data(), data.size()); + + return LoadInternal(memStream, loadSettings); + } + PngFile PngFile::LoadInternal(AZ::IO::GenericStream& dataStream, LoadSettings loadSettings) + { // For documentation of this code, see http://www.libpng.org/pub/png/libpng-1.4.0-manual.pdf chapter 3 - FILE* fp = NULL; - azfopen(&fp, path, "rb"); // return type differs across platforms so can't do inside if - if (!fp) + // Verify that we've passed in a valid data stream. + if (!dataStream.IsOpen() || !dataStream.CanRead()) { - loadSettings.m_errorHandler("Cannot open file."); + loadSettings.m_errorHandler("Data stream isn't valid."); return {}; } png_byte header[HeaderSize] = {}; + size_t headerBytesRead = 0; - if (fread(header, 1, HeaderSize, fp) != HeaderSize) + // This is the one I/O read that occurs outside of the png library, so either read from the file or the buffer and + // verify the results. + headerBytesRead = dataStream.Read(HeaderSize, header); + if (headerBytesRead != HeaderSize) { - fclose(fp); loadSettings.m_errorHandler("Invalid png header."); return {}; } @@ -93,7 +136,6 @@ namespace AZ bool isPng = !png_sig_cmp(header, 0, HeaderSize); if (!isPng) { - fclose(fp); loadSettings.m_errorHandler("Invalid png header."); return {}; } @@ -105,7 +147,6 @@ namespace AZ png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, user_error_ptr, user_error_fn, user_warning_fn); if (!png_ptr) { - fclose(fp); loadSettings.m_errorHandler("png_create_read_struct failed."); return {}; } @@ -114,7 +155,6 @@ namespace AZ if (!info_ptr) { png_destroy_read_struct(&png_ptr, (png_infopp)NULL, (png_infopp)NULL); - fclose(fp); loadSettings.m_errorHandler("png_create_info_struct failed."); return {}; } @@ -123,22 +163,35 @@ namespace AZ if (!end_info) { png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL); - fclose(fp); loadSettings.m_errorHandler("png_create_info_struct failed."); return {}; } -AZ_PUSH_DISABLE_WARNING(4611, "-Wunknown-warning-option") // Disables "interaction between '_setjmp' and C++ object destruction is non-portable". See https://docs.microsoft.com/en-us/cpp/preprocessor/warning?view=msvc-160 +// Disables "interaction between '_setjmp' and C++ object destruction is non-portable". +// See https://docs.microsoft.com/en-us/cpp/preprocessor/warning?view=msvc-160 +AZ_PUSH_DISABLE_WARNING(4611, "-Wunknown-warning-option") if (setjmp(png_jmpbuf(png_ptr))) { png_destroy_read_struct(&png_ptr, &info_ptr, &end_info); - fclose(fp); // We don't report an error message here because the user_error_fn should have done that already. return {}; } AZ_POP_DISABLE_WARNING - png_init_io(png_ptr, fp); + auto genericStreamReader = [](png_structp pngPtr, png_bytep data, png_size_t length) + { + // Here we get our IO pointer back from the read struct. + // This should be the GenericStream pointer we passed to the png_set_read_fn() function. + png_voidp ioPtr = png_get_io_ptr(pngPtr); + + if (ioPtr != nullptr) + { + AZ::IO::GenericStream* genericStream = static_cast(ioPtr); + genericStream->Read(length, data); + } + }; + + png_set_read_fn(png_ptr, &dataStream, genericStreamReader); png_set_sig_bytes(png_ptr, HeaderSize); @@ -187,7 +240,6 @@ AZ_POP_DISABLE_WARNING default: AZ_Assert(false, "The png transforms should have ensured a pixel format of RGB or RGBA, 8 bits per channel"); png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL); - fclose(fp); loadSettings.m_errorHandler("Unsupported pixel format."); return {}; } @@ -201,7 +253,6 @@ AZ_POP_DISABLE_WARNING } png_destroy_read_struct(&png_ptr, &info_ptr, &end_info); - fclose(fp); return pngFile; } @@ -322,3 +373,4 @@ AZ_POP_DISABLE_WARNING } // namespace Utils }// namespace AZ + diff --git a/Gems/Atom/Utils/Code/Tests/PngFileTests.cpp b/Gems/Atom/Utils/Code/Tests/PngFileTests.cpp index b60939b39b..436b9ae752 100644 --- a/Gems/Atom/Utils/Code/Tests/PngFileTests.cpp +++ b/Gems/Atom/Utils/Code/Tests/PngFileTests.cpp @@ -311,4 +311,66 @@ namespace UnitTest EXPECT_TRUE(gotErrorMessage.find("PngFile is invalid") != AZStd::string::npos); EXPECT_FALSE(AZ::IO::FileIOBase::GetInstance()->Exists(m_tempPngFilePath.c_str())); } -} + + TEST_F(PngFileTests, LoadRgbFromMemoryBuffer) + { + // This is an in-memory copy of the ColorChart_rgb.png test file. + AZStd::fixed_vector pngBuffer = + { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, + 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, + + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, + 0x08, 0x02, 0x00, 0x00, 0x00, 0x12, 0x16, 0xf1, + + 0x4d, 0x00, 0x00, 0x00, 0x01, 0x73, 0x52, 0x47, + 0x42, 0x00, 0xae, 0xce, 0x1c, 0xe9, 0x00, 0x00, + + 0x00, 0x04, 0x67, 0x41, 0x4d, 0x41, 0x00, 0x00, + 0xb1, 0x8f, 0x0b, 0xfc, 0x61, 0x05, 0x00, 0x00, + + 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, + 0x0e, 0xc3, 0x00, 0x00, 0x0e, 0xc3, 0x01, 0xc7, + + 0x6f, 0xa8, 0x64, 0x00, 0x00, 0x00, 0x13, 0x49, + 0x44, 0x41, 0x54, 0x18, 0x57, 0x63, 0xf8, 0xcf, + + 0xc0, 0x00, 0xc1, 0x4c, 0x10, 0xea, 0x3f, 0x03, + 0x03, 0x00, 0x3b, 0xec, 0x05, 0xfd, 0x6a, 0x50, + + 0x07, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, + 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 + }; + + PngFile image = PngFile::LoadFromBuffer(pngBuffer); + EXPECT_TRUE(image.IsValid()); + EXPECT_EQ(image.GetBufferFormat(), PngFile::Format::RGB); + EXPECT_EQ(image.GetWidth(), 3); + EXPECT_EQ(image.GetHeight(), 2); + EXPECT_EQ(image.GetBuffer().size(), 18); + EXPECT_EQ(Color3(image.GetBuffer().begin() + 0), Color3(255u, 0u, 0u)); + EXPECT_EQ(Color3(image.GetBuffer().begin() + 3), Color3(0u, 255u, 0u)); + EXPECT_EQ(Color3(image.GetBuffer().begin() + 6), Color3(0u, 0u, 255u)); + EXPECT_EQ(Color3(image.GetBuffer().begin() + 9), Color3(255u, 255u, 0u)); + EXPECT_EQ(Color3(image.GetBuffer().begin() + 12), Color3(0u, 255u, 255u)); + EXPECT_EQ(Color3(image.GetBuffer().begin() + 15), Color3(255u, 0u, 255u)); + } + + TEST_F(PngFileTests, ErrorCannotLoadEmptyMemoryBuffer) + { + AZStd::vector pngBuffer; + + AZStd::string gotErrorMessage; + + PngFile::LoadSettings loadSettings; + loadSettings.m_errorHandler = [&gotErrorMessage](const char* errorMessage) + { + gotErrorMessage = errorMessage; + }; + + PngFile image = PngFile::LoadFromBuffer(pngBuffer, loadSettings); + EXPECT_FALSE(image.IsValid()); + EXPECT_TRUE(gotErrorMessage.find("Buffer is empty") != AZStd::string::npos); + } + +} // namespace UnitTest From 37330c43a9408ad9ffcd726c14f510c4b5d264f5 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Tue, 21 Dec 2021 15:47:42 -0800 Subject: [PATCH 221/948] Address some more Generic Dom Value perf feedback Signed-off-by: Nicholas Van Sickle --- .../Backends/JSON/JsonSerializationUtils.cpp | 4 -- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 57 ++++++++++--------- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 4 +- .../AzCore/AzCore/DOM/DomValueWriter.cpp | 26 ++++----- .../AzCore/Tests/DOM/DomJsonBenchmarks.cpp | 26 ++++++--- .../AzCore/Tests/DOM/DomValueBenchmarks.cpp | 16 +++++- 6 files changed, 77 insertions(+), 56 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/Backends/JSON/JsonSerializationUtils.cpp b/Code/Framework/AzCore/AzCore/DOM/Backends/JSON/JsonSerializationUtils.cpp index bc8ac9167c..3baf78b63d 100644 --- a/Code/Framework/AzCore/AzCore/DOM/Backends/JSON/JsonSerializationUtils.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/Backends/JSON/JsonSerializationUtils.cpp @@ -373,10 +373,6 @@ namespace AZ::Dom::Json bool RapidJsonReadHandler::Key(const char* str, rapidjson::SizeType length, [[maybe_unused]] bool copy) { AZStd::string_view key = AZStd::string_view(str, length); - if (!m_visitor->SupportsRawKeys()) - { - m_visitor->Key(AZ::Name(key)); - } const Lifetime lifetime = !copy ? m_stringLifetime : Lifetime::Temporary; return CheckResult(m_visitor->RawKey(key, lifetime)); } diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index 3836568f37..407d1e66a2 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -17,13 +17,15 @@ namespace AZ::Dom template AZStd::shared_ptr& CheckCopyOnWrite(AZStd::shared_ptr& refCountedPointer) { - if (refCountedPointer.use_count() > 1) + if (refCountedPointer.use_count() == 1) { - AZStd::shared_ptr newPointer = AZStd::allocate_shared(StdValueAllocator()); - *newPointer = *refCountedPointer; - refCountedPointer = AZStd::move(newPointer); + return refCountedPointer; + } + else + { + refCountedPointer = AZStd::allocate_shared(StdValueAllocator(), *refCountedPointer); + return refCountedPointer; } - return refCountedPointer; } namespace Internal @@ -72,7 +74,7 @@ namespace AZ::Dom } Node::Node(AZ::Name name) - : m_name(name) + : m_name(AZStd::move(name)) { } @@ -83,7 +85,7 @@ namespace AZ::Dom void Node::SetName(AZ::Name name) { - m_name = name; + m_name = AZStd::move(name); } Object::ContainerType& Node::GetProperties() @@ -106,8 +108,8 @@ namespace AZ::Dom return m_children; } - Value::Value(AZStd::shared_ptr string) - : m_value(string) + Value::Value(SharedStringType sharedString) + : m_value(AZStd::move(sharedString)) { } @@ -122,18 +124,19 @@ namespace AZ::Dom Value::Value(Value&& value) noexcept { - operator=(value); + memcpy(this, &value, sizeof(Value)); + memset(&value, 0, sizeof(Value)); } - Value::Value(AZStd::string_view string, bool copy) + Value::Value(AZStd::string_view stringView, bool copy) { if (copy) { - CopyFromString(string); + CopyFromString(stringView); } else { - SetString(string); + SetString(stringView); } } @@ -227,7 +230,9 @@ namespace AZ::Dom Value& Value::operator=(Value&& other) noexcept { - m_value.swap(other.m_value); + SetNull(); + memcpy(this, &other, sizeof(Value)); + memset(&other, 0, sizeof(Value)); return *this; } @@ -265,7 +270,10 @@ namespace AZ::Dom void Value::Swap(Value& other) noexcept { - m_value.swap(other.m_value); + AZStd::aligned_storage_for_t temp; + memcpy(&temp, this, sizeof(Value)); + memcpy(this, &other, sizeof(Value)); + memcpy(&other, &temp, sizeof(Value)); } Type Dom::Value::GetType() const @@ -583,7 +591,7 @@ namespace AZ::Dom } else { - object.emplace_back(name, value); + object.emplace_back(AZStd::move(name), value); } return *this; } @@ -602,7 +610,7 @@ namespace AZ::Dom } else { - object.emplace_back(name, value); + object.emplace_back(AZStd::move(name), value); } return *this; } @@ -636,15 +644,12 @@ namespace AZ::Dom Object::Iterator Value::RemoveMember(Object::Iterator pos) { Object::ContainerType& object = GetObjectInternal(); - Object::Iterator nextIndex = object.end(); - auto lastEntry = object.end() - 1; - if (pos != lastEntry) + if (!object.empty()) { - AZStd::swap(*pos, *lastEntry); - nextIndex = pos; + AZStd::swap(*pos, object.back()); + object.pop_back(); } - object.resize(object.size() - 1); - return nextIndex; + return object.end(); } Object::Iterator Value::EraseMember(Object::ConstIterator pos) @@ -785,7 +790,7 @@ namespace AZ::Dom void Value::SetNode(AZ::Name name) { - m_value = AZStd::allocate_shared(StdValueAllocator(), name); + m_value = AZStd::allocate_shared(StdValueAllocator(), AZStd::move(name)); } void Value::SetNode(AZStd::string_view name) @@ -800,7 +805,7 @@ namespace AZ::Dom void Value::SetNodeName(AZ::Name name) { - GetNodeInternal().SetName(name); + GetNodeInternal().SetName(AZStd::move(name)); } void Value::SetNodeName(AZStd::string_view name) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index 86e98030e2..a777640aaf 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -190,8 +190,8 @@ namespace AZ::Dom Value(); Value(const Value&); Value(Value&&) noexcept; - Value(AZStd::string_view string, bool copy); - Value(AZStd::shared_ptr string); + Value(AZStd::string_view stringView, bool copy); + Value(SharedStringType sharedString); Value(int32_t value); Value(uint32_t value); diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp index 9b814b1bff..3259579aaa 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp @@ -82,6 +82,16 @@ namespace AZ::Dom return VisitorSuccess(); } + template + void MoveVectorMemory(AZStd::vector& dest, AZStd::vector& source) + { + dest.resize_no_construct(source.size()); + const size_t size = sizeof(T) * source.size(); + memcpy(dest.data(), source.data(), size); + memset(source.data(), 0, size); + source.resize(0); + } + Visitor::Result ValueWriter::EndContainer(Type containerType, AZ::u64 attributeCount, AZ::u64 elementCount) { const char* endMethodName; @@ -138,22 +148,12 @@ namespace AZ::Dom } if (buffer.m_attributes.size() > 0) { - container.MemberReserve(buffer.m_attributes.size()); - for (AZStd::pair& entry : buffer.m_attributes) - { - container.AddMember(AZStd::move(entry.first), AZStd::move(entry.second)); - } - buffer.m_attributes.clear(); + MoveVectorMemory(container.GetMutableObject(), buffer.m_attributes); } if(buffer.m_elements.size() > 0) { - container.Reserve(buffer.m_elements.size()); - for (Value& entry : buffer.m_elements) - { - container.PushBack(AZStd::move(entry)); - } - buffer.m_elements.clear(); + MoveVectorMemory(container.GetMutableArray(), buffer.m_elements); } m_entryStack.pop(); @@ -180,7 +180,7 @@ namespace AZ::Dom { AZ_Assert(!m_entryStack.empty(), "Attempmted to push a key with no object"); AZ_Assert(!m_entryStack.top().m_container.IsArray(), "Attempted to push a key to an array"); - m_entryStack.top().m_key = key; + m_entryStack.top().m_key = AZStd::move(key); return VisitorSuccess(); } diff --git a/Code/Framework/AzCore/Tests/DOM/DomJsonBenchmarks.cpp b/Code/Framework/AzCore/Tests/DOM/DomJsonBenchmarks.cpp index 477802dc37..8eda110e7b 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomJsonBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomJsonBenchmarks.cpp @@ -120,6 +120,16 @@ namespace Benchmark AZ_Assert(result.IsSuccess(), "Failed to serialize generated JSON"); return serializedJson; } + + template + void TakeAndDiscardWithoutTimingDtor(T&& value, benchmark::State& state) + { + { + T instance = AZStd::move(value); + state.PauseTiming(); + } + state.ResumeTiming(); + } }; // Helper macro for registering JSON benchmarks @@ -148,7 +158,7 @@ namespace Benchmark return AZ::Dom::Utils::ReadFromStringInPlace(backend, payloadCopy, visitor); }); - benchmark::DoNotOptimize(result.GetValue()); + TakeAndDiscardWithoutTimingDtor(result.TakeValue(), state); } state.SetBytesProcessed(serializedPayload.size() * state.iterations()); @@ -172,7 +182,7 @@ namespace Benchmark return AZ::Dom::Utils::ReadFromStringInPlace(backend, payloadCopy, visitor); }); - benchmark::DoNotOptimize(result.GetValue()); + TakeAndDiscardWithoutTimingDtor(result.TakeValue(), state); } state.SetBytesProcessed(serializedPayload.size() * state.iterations()); @@ -192,7 +202,7 @@ namespace Benchmark return AZ::Dom::Utils::ReadFromString(backend, serializedPayload, AZ::Dom::Lifetime::Temporary, visitor); }); - benchmark::DoNotOptimize(result.GetValue()); + TakeAndDiscardWithoutTimingDtor(result.TakeValue(), state); } state.SetBytesProcessed(serializedPayload.size() * state.iterations()); @@ -212,7 +222,7 @@ namespace Benchmark return AZ::Dom::Utils::ReadFromString(backend, serializedPayload, AZ::Dom::Lifetime::Temporary, visitor); }); - benchmark::DoNotOptimize(result.GetValue()); + TakeAndDiscardWithoutTimingDtor(result.TakeValue(), state); } state.SetBytesProcessed(serializedPayload.size() * state.iterations()); @@ -228,7 +238,7 @@ namespace Benchmark { auto result = AZ::JsonSerializationUtils::ReadJsonString(serializedPayload); - benchmark::DoNotOptimize(result.GetValue()); + TakeAndDiscardWithoutTimingDtor(result.TakeValue(), state); } state.SetBytesProcessed(serializedPayload.size() * state.iterations()); @@ -239,7 +249,7 @@ namespace Benchmark { for (auto _ : state) { - benchmark::DoNotOptimize(GenerateDomJsonBenchmarkPayload(state.range(0), state.range(1))); + TakeAndDiscardWithoutTimingDtor(GenerateDomJsonBenchmarkPayload(state.range(0), state.range(1)), state); } state.SetItemsProcessed(state.range(0) * state.range(0) * state.iterations()); @@ -277,7 +287,7 @@ namespace Benchmark { rapidjson::Document copy; copy.CopyFrom(original, copy.GetAllocator(), true); - benchmark::DoNotOptimize(copy); + TakeAndDiscardWithoutTimingDtor(AZStd::move(copy), state); } state.SetItemsProcessed(state.iterations()); @@ -294,7 +304,7 @@ namespace Benchmark rapidjson::Document copy; copy.CopyFrom(original, copy.GetAllocator(), true); copy["entries"]["Key0"].PushBack(42, copy.GetAllocator()); - benchmark::DoNotOptimize(copy); + TakeAndDiscardWithoutTimingDtor(AZStd::move(copy), state); } state.SetItemsProcessed(state.iterations()); diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp index af5b367d63..12684c64bc 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp @@ -98,13 +98,23 @@ namespace AZ::Dom::Benchmark return root; } + + template + void TakeAndDiscardWithoutTimingDtor(T&& value, benchmark::State& state) + { + { + T instance = AZStd::move(value); + state.PauseTiming(); + } + state.ResumeTiming(); + } }; BENCHMARK_DEFINE_F(DomValueBenchmark, AzDomValueMakeComplexObject)(benchmark::State& state) { for (auto _ : state) { - benchmark::DoNotOptimize(GenerateDomBenchmarkPayload(state.range(0), state.range(1))); + TakeAndDiscardWithoutTimingDtor(GenerateDomBenchmarkPayload(state.range(0), state.range(1)), state); } state.SetItemsProcessed(state.range(0) * state.range(0) * state.iterations()); @@ -143,7 +153,7 @@ namespace AZ::Dom::Benchmark { Value copy = original; copy["entries"]["Key0"].PushBack(42); - benchmark::DoNotOptimize(copy); + TakeAndDiscardWithoutTimingDtor(AZStd::move(copy), state); } state.SetItemsProcessed(state.iterations()); @@ -162,7 +172,7 @@ namespace AZ::Dom::Benchmark for (auto _ : state) { Value copy = original.DeepCopy(); - benchmark::DoNotOptimize(copy); + TakeAndDiscardWithoutTimingDtor(AZStd::move(copy), state); } state.SetItemsProcessed(state.iterations()); From 68c93273d687bda5c57e88d9ab630ca6ee03b6f1 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Tue, 21 Dec 2021 16:09:11 -0800 Subject: [PATCH 222/948] Add 8 and 16 bit numeric type API Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 20 +++++++++++++++++++ Code/Framework/AzCore/AzCore/DOM/DomValue.h | 12 +++++++++++ 2 files changed, 32 insertions(+) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index 407d1e66a2..f9f4f726dd 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -150,6 +150,26 @@ namespace AZ::Dom return Value(&value); } + Value::Value(int8_t value) + : m_value(aznumeric_cast(value)) + { + } + + Value::Value(uint8_t value) + : m_value(aznumeric_cast(value)) + { + } + + Value::Value(int16_t value) + : m_value(aznumeric_cast(value)) + { + } + + Value::Value(uint16_t value) + : m_value(aznumeric_cast(value)) + { + } + Value::Value(int32_t value) : m_value(aznumeric_cast(value)) { diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index a777640aaf..7ef794486e 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -193,6 +193,10 @@ namespace AZ::Dom Value(AZStd::string_view stringView, bool copy); Value(SharedStringType sharedString); + Value(int8_t value); + Value(uint8_t value); + Value(int16_t value); + Value(uint16_t value); Value(int32_t value); Value(uint32_t value); Value(int64_t value); @@ -321,12 +325,20 @@ namespace AZ::Dom void SetInt64(int64_t); int32_t GetInt32() const; void SetInt32(int32_t); + int16_t GetInt16() const; + void SetInt16(int16_t); + int8_t GetInt8() const; + void SetInt8(int8_t); // uint API... uint64_t GetUint64() const; void SetUint64(uint64_t); uint32_t GetUint32() const; void SetUint32(uint32_t); + uint16_t GetUint16() const; + void SetUint16(uint16_t); + uint8_t GetUint8() const; + void SetUint8(uint8_t); // bool API... bool GetBool() const; From deb3568aaa15e962b49fb5a0aa6b19960866fa73 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Tue, 21 Dec 2021 16:19:32 -0800 Subject: [PATCH 223/948] Fix up a couple opaque value cases Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 4 ++-- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index f9f4f726dd..01d7bcf6e1 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -1042,7 +1042,7 @@ namespace AZ::Dom const AZStd::any& Value::GetOpaqueValue() const { - return *AZStd::get>(m_value); + return *AZStd::get(m_value); } void Value::SetOpaqueValue(const AZStd::any& value) @@ -1165,7 +1165,7 @@ namespace AZ::Dom result = visitor.EndNode(object.size(), arrayContainer.size()); } } - else if constexpr (AZStd::is_same_v) + else if constexpr (AZStd::is_same_v) { result = visitor.OpaqueValue(*arg); } diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index 7ef794486e..b9c1062ed7 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -158,6 +158,7 @@ namespace AZ::Dom using ShortStringType = AZStd::fixed_string; using SharedStringContainer = AZStd::vector; using SharedStringType = AZStd::shared_ptr; + using OpaqueStorageType = AZStd::shared_ptr; //! The internal storage type for Value. //! These types do not correspond one-to-one with the Value's external Type as there may be multiple storage classes @@ -184,7 +185,7 @@ namespace AZ::Dom // Node NodePtr, // Opaque - AZStd::shared_ptr>; + OpaqueStorageType>; // Constructors... Value(); From fd70a2207e68dc456a91e23e5446f64b5a6971a6 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Tue, 21 Dec 2021 16:47:13 -0800 Subject: [PATCH 224/948] Address a few other small pieces of feedback Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 14 +++++--------- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 8 ++++---- .../Framework/AzCore/AzCore/DOM/DomValueWriter.cpp | 2 +- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index 01d7bcf6e1..7659afa070 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -113,10 +113,6 @@ namespace AZ::Dom { } - Value::Value() - { - } - Value::Value(const Value& value) : m_value(value.m_value) { @@ -344,7 +340,7 @@ namespace AZ::Dom bool Value::IsBool() const { - return AZStd::holds_alternative(m_value); + return GetType() == Type::Bool; } bool Value::IsNode() const @@ -383,17 +379,17 @@ namespace AZ::Dom bool Value::IsInt() const { - return AZStd::holds_alternative(m_value); + return GetType() == Type::Int64; } bool Value::IsUint() const { - return AZStd::holds_alternative(m_value); + return GetType() == Type::Uint64; } bool Value::IsDouble() const { - return AZStd::holds_alternative(m_value); + return GetType() == Type::Double; } bool Value::IsString() const @@ -666,7 +662,7 @@ namespace AZ::Dom Object::ContainerType& object = GetObjectInternal(); if (!object.empty()) { - AZStd::swap(*pos, object.back()); + *pos = AZStd::move(object.back()); object.pop_back(); } return object.end(); diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index b9c1062ed7..b73da92d23 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -103,9 +103,9 @@ namespace AZ::Dom { public: Node() = default; - Node(AZ::Name name); - Node(const Node&) = default; - Node(Node&&) = default; + explicit Node(AZ::Name name); + explicit Node(const Node&) = default; + explicit Node(Node&&) = default; Node& operator=(const Node&) = default; Node& operator=(Node&&) = default; @@ -188,7 +188,7 @@ namespace AZ::Dom OpaqueStorageType>; // Constructors... - Value(); + Value() = default; Value(const Value&); Value(Value&&) noexcept; Value(AZStd::string_view stringView, bool copy); diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp index 3259579aaa..f8ca56ea32 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp @@ -70,7 +70,7 @@ namespace AZ::Dom Visitor::Result ValueWriter::RefCountedString(AZStd::shared_ptr> value, [[maybe_unused]] Lifetime lifetime) { - CurrentValue().SetString(value); + CurrentValue().SetString(AZStd::move(value)); return FinishWrite(); } From 8aa54659741a4f67861c43b94dfbd3008006ce61 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Tue, 21 Dec 2021 17:53:59 -0800 Subject: [PATCH 225/948] Resaving script graph which was old and causing some deserialization errors on game start Signed-off-by: Gene Walters --- ...oComponent_RPC_NetLevelEntity.scriptcanvas | 778 +++++++++++------- 1 file changed, 470 insertions(+), 308 deletions(-) diff --git a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC_NetLevelEntity.scriptcanvas b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC_NetLevelEntity.scriptcanvas index 8e5a6b374c..3869dfdfcb 100644 --- a/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC_NetLevelEntity.scriptcanvas +++ b/AutomatedTesting/Levels/Multiplayer/AutoComponent_RPC/AutoComponent_RPC_NetLevelEntity.scriptcanvas @@ -5,7 +5,7 @@ "ClassData": { "m_scriptCanvas": { "Id": { - "id": 5286394689911028851 + "id": 1685762441320719908 }, "Name": "AutoComponent_RPC_NetLevelEntity", "Components": { @@ -148,7 +148,7 @@ }, "isNullPointer": false, "$type": "double", - "value": 10.0, + "value": 99.0, "label": "Repetitions" }, { @@ -214,154 +214,6 @@ } } }, - { - "Id": { - "id": 28956289730909 - }, - "Name": "SC-EventNode(AuthorityToClientNoParams_PlayFx Notify Event)", - "Components": { - "Component_[12478098247313937239]": { - "$type": "AzEventHandler", - "Id": 12478098247313937239, - "Slots": [ - { - "id": { - "m_id": "{E97830A5-323D-4CD1-85CF-BAFB1735AC34}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - }, - { - "$type": "ConnectionLimitContract", - "limit": 1 - }, - { - "$type": "RestrictedNodeContract", - "m_nodeId": { - "id": 28466663459165 - } - } - ], - "slotName": "Connect", - "toolTip": "Connect the AZ Event to this AZ Event Handler.", - "Descriptor": { - "ConnectionType": 1, - "SlotType": 1 - } - }, - { - "id": { - "m_id": "{2A7ABD07-368B-44F3-BB16-946539B76A16}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - } - ], - "slotName": "Disconnect", - "toolTip": "Disconnect current AZ Event from this AZ Event Handler.", - "Descriptor": { - "ConnectionType": 1, - "SlotType": 1 - } - }, - { - "id": { - "m_id": "{E1C7B2B6-B5ED-4BA6-8484-A74F336CD53F}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - } - ], - "slotName": "On Connected", - "toolTip": "Signaled when a connection has taken place.", - "Descriptor": { - "ConnectionType": 2, - "SlotType": 1 - } - }, - { - "id": { - "m_id": "{2731EE09-9E48-4EDB-9548-024EAAC23A03}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - } - ], - "slotName": "On Disconnected", - "toolTip": "Signaled when this event handler is disconnected.", - "Descriptor": { - "ConnectionType": 2, - "SlotType": 1 - } - }, - { - "id": { - "m_id": "{1F11AAA9-2A99-41A2-AABE-7B57463E3664}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - } - ], - "slotName": "OnEvent", - "toolTip": "Triggered when the AZ Event invokes Signal() function.", - "Descriptor": { - "ConnectionType": 2, - "SlotType": 1 - }, - "IsLatent": true - }, - { - "id": { - "m_id": "{7A4D75C3-C9C8-4CFB-A87C-C15B71AB3296}" - }, - "contracts": [ - { - "$type": "SlotTypeContract" - }, - { - "$type": "ConnectionLimitContract", - "limit": 1 - }, - { - "$type": "RestrictedNodeContract", - "m_nodeId": { - "id": 28466663459165 - } - } - ], - "slotName": "AuthorityToClientNoParams_PlayFx Notify Event", - "Descriptor": { - "ConnectionType": 1, - "SlotType": 2 - }, - "DataType": 1 - } - ], - "Datums": [ - { - "isOverloadedStorage": false, - "scriptCanvasType": { - "m_type": 4, - "m_azType": "{F429F985-AF00-529B-8449-16E56694E5F9}" - }, - "isNullPointer": true, - "label": "AuthorityToClientNoParams_PlayFx Notify Event" - } - ], - "m_azEventEntry": { - "m_eventName": "AuthorityToClientNoParams_PlayFx Notify Event", - "m_eventSlotId": { - "m_id": "{7A4D75C3-C9C8-4CFB-A87C-C15B71AB3296}" - } - } - } - } - }, { "Id": { "id": 57003906901432 @@ -578,9 +430,9 @@ } } ], - "m_format": "AutoComponent_RPC_NetLevelEntity: Authority sending RPC to play some superficial fx.\n", + "m_format": "AutoComponent_RPC_NetLevelEntity: Authority sending RPC to play some fx.\n", "m_unresolvedString": [ - "AutoComponent_RPC_NetLevelEntity: Authority sending RPC to play some superficial fx.\n" + "AutoComponent_RPC_NetLevelEntity: Authority sending RPC to play some fx.\n" ] } } @@ -627,13 +479,160 @@ } } ], - "m_format": "AutoComponent_RPC_NetLevelEntity: I'm a client playing some superficial fx.\n", + "m_format": "AutoComponent_RPC_NetLevelEntity: I'm a client playing some fx.\n", "m_unresolvedString": [ - "AutoComponent_RPC_NetLevelEntity: I'm a client playing some superficial fx.\n" + "AutoComponent_RPC_NetLevelEntity: I'm a client playing some fx.\n" ] } } }, + { + "Id": { + "id": 8318619017825 + }, + "Name": "SC-EventNode(AuthorityToClientNoParams_PlayFx Notify Event)", + "Components": { + "Component_[15772128920819427182]": { + "$type": "AzEventHandler", + "Id": 15772128920819427182, + "Slots": [ + { + "id": { + "m_id": "{2A42C379-8E3B-46EF-BC63-C1D5395CB583}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "ConnectionLimitContract", + "limit": 1 + }, + { + "$type": "RestrictedNodeContract", + "m_nodeId": { + "id": 7820402811489 + } + } + ], + "slotName": "Connect", + "toolTip": "Connect the AZ Event to this AZ Event Handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{3DB9829E-6088-49B9-A56D-4D1884C679BD}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Disconnect", + "toolTip": "Disconnect current AZ Event from this AZ Event Handler.", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{9AC3CF57-B648-4B43-8FCA-8576B6EA350B}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "On Connected", + "toolTip": "Signaled when a connection has taken place.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{5FB8D529-6FC6-4543-99B5-5B147EBD7BE6}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "On Disconnected", + "toolTip": "Signaled when this event handler is disconnected.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{0481BBFE-D31E-421F-A6C2-8A7AF3012545}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "OnEvent", + "toolTip": "Triggered when the AZ Event invokes Signal() function.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + }, + { + "id": { + "m_id": "{5F809F1C-ED4E-4391-9E33-AD3B64561A40}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "ConnectionLimitContract", + "limit": 1 + }, + { + "$type": "RestrictedNodeContract", + "m_nodeId": { + "id": 7820402811489 + } + } + ], + "slotName": "AuthorityToClientNoParams_PlayFx Notify Event", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 4, + "m_azType": "{F429F985-AF00-529B-8449-16E56694E5F9}" + }, + "isNullPointer": true, + "label": "AuthorityToClientNoParams_PlayFx Notify Event" + } + ], + "m_azEventEntry": { + "m_eventName": "AuthorityToClientNoParams_PlayFx Notify Event", + "m_eventSlotId": { + "m_id": "{5F809F1C-ED4E-4391-9E33-AD3B64561A40}" + } + } + } + } + }, { "Id": { "id": 56991021999544 @@ -657,8 +656,32 @@ "toolTip": "Input signal", "Descriptor": { "ConnectionType": 1, - "SlotType": 1 - } + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{CEBD2B9C-7DBA-486A-88DB-19F9C406B18E}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Value", + "toolTip": "Value which replaces instances of {Value} in the resulting string.", + "DisplayDataType": { + "m_type": 5 + }, + "DisplayGroup": { + "Value": 1015031923 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 }, { "id": { @@ -676,10 +699,36 @@ } } ], - "m_format": "AutoComponent_RPC_NetLevelEntity Activated!\n", + "Datums": [ + { + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "", + "label": "Value" + } + ], + "m_format": "AutoComponent_RPC_NetLevelEntity Activated on entity: {Value}\n", + "m_arrayBindingMap": [ + { + "Key": 1, + "Value": { + "m_id": "{CEBD2B9C-7DBA-486A-88DB-19F9C406B18E}" + } + } + ], "m_unresolvedString": [ - "AutoComponent_RPC_NetLevelEntity Activated!\n" - ] + "AutoComponent_RPC_NetLevelEntity Activated on entity: ", + {}, + "\n" + ], + "m_formatSlotMap": { + "Value": { + "m_id": "{CEBD2B9C-7DBA-486A-88DB-19F9C406B18E}" + } + } } } }, @@ -715,17 +764,17 @@ }, { "Id": { - "id": 28466663459165 + "id": 8310662318335 }, - "Name": "SC-Node(GetAuthorityToClientNoParams_PlayFxEventByEntityId)", + "Name": "SC-Node(GetEntityName)", "Components": { - "Component_[5890343372099746558]": { + "Component_[2232030369305027010]": { "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", - "Id": 5890343372099746558, + "Id": 2232030369305027010, "Slots": [ { "id": { - "m_id": "{4E1A6903-3F02-4395-A4C9-202D1F13250E}" + "m_id": "{F69C5762-0CAB-4A54-9C81-C99CDB73C834}" }, "contracts": [ { @@ -741,7 +790,7 @@ }, { "id": { - "m_id": "{26902930-1BC7-4BF6-8F41-C313BA819AA3}" + "m_id": "{03554C56-8237-4C19-B9F8-87DEA1AC3ED0}" }, "contracts": [ { @@ -756,7 +805,7 @@ }, { "id": { - "m_id": "{B6C92656-7593-4759-B657-98DB7CA30482}" + "m_id": "{6ECBD749-25FE-4813-B34E-EF46BC09E616}" }, "contracts": [ { @@ -771,17 +820,16 @@ }, { "id": { - "m_id": "{10D59D8F-E406-431B-87F9-FC1AF1EC65AF}" + "m_id": "{36D47097-8F0C-4CBD-8DE2-32F4754C569F}" }, "contracts": [ { "$type": "SlotTypeContract" } ], - "slotName": "Event<>", + "slotName": "String", "DisplayDataType": { - "m_type": 4, - "m_azType": "{F429F985-AF00-529B-8449-16E56694E5F9}" + "m_type": 5 }, "Descriptor": { "ConnectionType": 2, @@ -792,7 +840,6 @@ ], "Datums": [ { - "isOverloadedStorage": false, "scriptCanvasType": { "m_type": 1 }, @@ -801,18 +848,21 @@ "value": { "id": 2901262558 }, - "label": "EntityId: 0" + "label": "Entity Id" } ], - "methodType": 2, - "methodName": "GetAuthorityToClientNoParams_PlayFxEventByEntityId", - "className": "NetworkTestPlayerComponent", + "methodType": 0, + "methodName": "GetEntityName", + "className": "GameEntityContextRequestBus", + "resultSlotIDs": [ + {} + ], "inputSlots": [ { - "m_id": "{4E1A6903-3F02-4395-A4C9-202D1F13250E}" + "m_id": "{F69C5762-0CAB-4A54-9C81-C99CDB73C834}" } ], - "prettyClassName": "NetworkTestPlayerComponent" + "prettyClassName": "GameEntityContextRequestBus" } } }, @@ -1040,46 +1090,123 @@ } } } - } - ], - "m_connections": [ + }, { "Id": { - "id": 57029676705208 + "id": 7820402811489 }, - "Name": "srcEndpoint=(On Graph Start: Out), destEndpoint=(TimeDelay: Start)", + "Name": "SC-Node(GetAuthorityToClientNoParams_PlayFxEventByEntityId)", "Components": { - "Component_[5204535376548158590]": { - "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 5204535376548158590, - "sourceEndpoint": { - "nodeId": { - "id": 57025381737912 + "Component_[9263945554457190064]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 9263945554457190064, + "Slots": [ + { + "id": { + "m_id": "{F22A7438-E72F-4757-90D9-99F03C91E10D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "EntityId: 0", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 }, - "slotId": { - "m_id": "{28664064-2483-465A-9BB1-4E1890048CDF}" - } - }, - "targetEndpoint": { - "nodeId": { - "id": 57012496836024 + { + "id": { + "m_id": "{510F56FD-6778-4DB8-BDDE-258335431CC6}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } }, - "slotId": { - "m_id": "{EA0DF0AE-2FF7-4670-8D99-7CF863038E68}" + { + "id": { + "m_id": "{94C2AF04-6BFA-4E5A-9490-C7479A7AF61E}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{9C6DDF96-6BF0-45ED-B15F-2E6C2FF5F886}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Event<>", + "DisplayDataType": { + "m_type": 4, + "m_azType": "{F429F985-AF00-529B-8449-16E56694E5F9}" + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 } - } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 1 + }, + "isNullPointer": false, + "$type": "EntityId", + "value": { + "id": 2901262558 + }, + "label": "EntityId: 0" + } + ], + "methodType": 2, + "methodName": "GetAuthorityToClientNoParams_PlayFxEventByEntityId", + "className": "NetworkTestPlayerComponent", + "resultSlotIDs": [ + {} + ], + "inputSlots": [ + { + "m_id": "{F22A7438-E72F-4757-90D9-99F03C91E10D}" + } + ], + "prettyClassName": "NetworkTestPlayerComponent" } } - }, + } + ], + "m_connections": [ { "Id": { - "id": 57042561607096 + "id": 57029676705208 }, - "Name": "srcEndpoint=(On Graph Start: Out), destEndpoint=(GetAuthorityToClientNoParams_PlaySomeSuperficialFxEventByEntityId: In)", + "Name": "srcEndpoint=(On Graph Start: Out), destEndpoint=(TimeDelay: Start)", "Components": { - "Component_[17563947682404363417]": { + "Component_[5204535376548158590]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 17563947682404363417, + "Id": 5204535376548158590, "sourceEndpoint": { "nodeId": { "id": 57025381737912 @@ -1090,10 +1217,10 @@ }, "targetEndpoint": { "nodeId": { - "id": 57021086770616 + "id": 57012496836024 }, "slotId": { - "m_id": "{5CDED810-9455-424A-9A1D-40B9366D1F94}" + "m_id": "{EA0DF0AE-2FF7-4670-8D99-7CF863038E68}" } } } @@ -1101,27 +1228,27 @@ }, { "Id": { - "id": 57046856574392 + "id": 57055446508984 }, - "Name": "srcEndpoint=(AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event: OnEvent), destEndpoint=(Print: In)", + "Name": "srcEndpoint=(TimeDelay: Done), destEndpoint=(Repeater: Start)", "Components": { - "Component_[12226462283795741406]": { + "Component_[6292481678297438578]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 12226462283795741406, + "Id": 6292481678297438578, "sourceEndpoint": { "nodeId": { - "id": 57016791803320 + "id": 57012496836024 }, "slotId": { - "m_id": "{A53312FA-7FAB-4C8C-A105-478C634ECD33}" + "m_id": "{158B30BE-BD39-40AE-A8A8-F0E5694F0180}" } }, "targetEndpoint": { "nodeId": { - "id": 56995316966840 + "id": 56986727032248 }, "slotId": { - "m_id": "{7CAD6E31-6218-4326-8FFB-0523F545E250}" + "m_id": "{07267CBA-B377-4B57-8A04-E322F8BFC07F}" } } } @@ -1129,27 +1256,27 @@ }, { "Id": { - "id": 57051151541688 + "id": 9392713697629 }, - "Name": "srcEndpoint=(AuthorityToClientNoParams_PlaySomeSuperficialFx Notify Event: OnEvent), destEndpoint=(DrawTextOnEntity: In)", + "Name": "srcEndpoint=(Repeater: Action), destEndpoint=(AuthorityToClientNoParams_PlayFxByEntityId: In)", "Components": { - "Component_[7209285242155620531]": { + "Component_[17811480012084226596]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 7209285242155620531, + "Id": 17811480012084226596, "sourceEndpoint": { "nodeId": { - "id": 57016791803320 + "id": 56986727032248 }, "slotId": { - "m_id": "{A53312FA-7FAB-4C8C-A105-478C634ECD33}" + "m_id": "{C1CCBA7B-A13B-4FCE-99ED-8FD1A8F72869}" } }, "targetEndpoint": { "nodeId": { - "id": 57003906901432 + "id": 8400576252253 }, "slotId": { - "m_id": "{1673B8A0-D4EC-4CC7-8F80-0419BB5560EB}" + "m_id": "{AB0D7C00-A334-449A-AC56-EA3167AB8900}" } } } @@ -1157,27 +1284,27 @@ }, { "Id": { - "id": 57055446508984 + "id": 10269167405311 }, - "Name": "srcEndpoint=(TimeDelay: Done), destEndpoint=(Repeater: Start)", + "Name": "srcEndpoint=(GetEntityName: String), destEndpoint=(Print: Value)", "Components": { - "Component_[6292481678297438578]": { + "Component_[11931728297561282182]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 6292481678297438578, + "Id": 11931728297561282182, "sourceEndpoint": { "nodeId": { - "id": 57012496836024 + "id": 8310662318335 }, "slotId": { - "m_id": "{158B30BE-BD39-40AE-A8A8-F0E5694F0180}" + "m_id": "{36D47097-8F0C-4CBD-8DE2-32F4754C569F}" } }, "targetEndpoint": { "nodeId": { - "id": 56986727032248 + "id": 56991021999544 }, "slotId": { - "m_id": "{07267CBA-B377-4B57-8A04-E322F8BFC07F}" + "m_id": "{CEBD2B9C-7DBA-486A-88DB-19F9C406B18E}" } } } @@ -1185,19 +1312,19 @@ }, { "Id": { - "id": 57068331410872 + "id": 11042261518591 }, - "Name": "srcEndpoint=(On Graph Start: Out), destEndpoint=(Print: In)", + "Name": "srcEndpoint=(GetEntityName: Out), destEndpoint=(Print: In)", "Components": { - "Component_[11504712829988319988]": { + "Component_[5559381044656171146]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 11504712829988319988, + "Id": 5559381044656171146, "sourceEndpoint": { "nodeId": { - "id": 57025381737912 + "id": 8310662318335 }, "slotId": { - "m_id": "{28664064-2483-465A-9BB1-4E1890048CDF}" + "m_id": "{6ECBD749-25FE-4813-B34E-EF46BC09E616}" } }, "targetEndpoint": { @@ -1213,27 +1340,27 @@ }, { "Id": { - "id": 9392713697629 + "id": 36365388695807 }, - "Name": "srcEndpoint=(Repeater: Action), destEndpoint=(AuthorityToClientNoParams_PlayFxByEntityId: In)", + "Name": "srcEndpoint=(TimeDelay: Done), destEndpoint=(GetEntityName: In)", "Components": { - "Component_[17811480012084226596]": { + "Component_[5574600651313925988]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 17811480012084226596, + "Id": 5574600651313925988, "sourceEndpoint": { "nodeId": { - "id": 56986727032248 + "id": 57012496836024 }, "slotId": { - "m_id": "{C1CCBA7B-A13B-4FCE-99ED-8FD1A8F72869}" + "m_id": "{158B30BE-BD39-40AE-A8A8-F0E5694F0180}" } }, "targetEndpoint": { "nodeId": { - "id": 8400576252253 + "id": 8310662318335 }, "slotId": { - "m_id": "{AB0D7C00-A334-449A-AC56-EA3167AB8900}" + "m_id": "{03554C56-8237-4C19-B9F8-87DEA1AC3ED0}" } } } @@ -1241,27 +1368,27 @@ }, { "Id": { - "id": 9732016114013 + "id": 9022993654369 }, - "Name": "srcEndpoint=(AuthorityToClientNoParams_PlayFxByEntityId: Out), destEndpoint=(Print: In)", + "Name": "srcEndpoint=(GetAuthorityToClientNoParams_PlayFxEventByEntityId: Event<>), destEndpoint=(AuthorityToClientNoParams_PlayFx Notify Event: AuthorityToClientNoParams_PlayFx Notify Event)", "Components": { - "Component_[14133537125895802472]": { + "Component_[4910818715692868417]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 14133537125895802472, + "Id": 4910818715692868417, "sourceEndpoint": { "nodeId": { - "id": 8400576252253 + "id": 7820402811489 }, "slotId": { - "m_id": "{A52302D6-9DF9-45C2-960D-19BF90A4A931}" + "m_id": "{9C6DDF96-6BF0-45ED-B15F-2E6C2FF5F886}" } }, "targetEndpoint": { "nodeId": { - "id": 56999611934136 + "id": 8318619017825 }, "slotId": { - "m_id": "{2F11CF04-DC4B-4881-8D74-AB0E51B4A278}" + "m_id": "{5F809F1C-ED4E-4391-9E33-AD3B64561A40}" } } } @@ -1269,27 +1396,27 @@ }, { "Id": { - "id": 29660664367453 + "id": 9078828229217 }, - "Name": "srcEndpoint=(GetAuthorityToClientNoParams_PlayFxEventByEntityId: Event<>), destEndpoint=(AuthorityToClientNoParams_PlayFx Notify Event: AuthorityToClientNoParams_PlayFx Notify Event)", + "Name": "srcEndpoint=(GetAuthorityToClientNoParams_PlayFxEventByEntityId: Out), destEndpoint=(AuthorityToClientNoParams_PlayFx Notify Event: Connect)", "Components": { - "Component_[17084894170988218373]": { + "Component_[16758724763058723803]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 17084894170988218373, + "Id": 16758724763058723803, "sourceEndpoint": { "nodeId": { - "id": 28466663459165 + "id": 7820402811489 }, "slotId": { - "m_id": "{10D59D8F-E406-431B-87F9-FC1AF1EC65AF}" + "m_id": "{94C2AF04-6BFA-4E5A-9490-C7479A7AF61E}" } }, "targetEndpoint": { "nodeId": { - "id": 28956289730909 + "id": 8318619017825 }, "slotId": { - "m_id": "{7A4D75C3-C9C8-4CFB-A87C-C15B71AB3296}" + "m_id": "{2A42C379-8E3B-46EF-BC63-C1D5395CB583}" } } } @@ -1297,27 +1424,27 @@ }, { "Id": { - "id": 29716498942301 + "id": 9808972669537 }, - "Name": "srcEndpoint=(GetAuthorityToClientNoParams_PlayFxEventByEntityId: Out), destEndpoint=(AuthorityToClientNoParams_PlayFx Notify Event: Connect)", + "Name": "srcEndpoint=(TimeDelay: Done), destEndpoint=(GetAuthorityToClientNoParams_PlayFxEventByEntityId: In)", "Components": { - "Component_[6504512854579046293]": { + "Component_[597205010205160938]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 6504512854579046293, + "Id": 597205010205160938, "sourceEndpoint": { "nodeId": { - "id": 28466663459165 + "id": 57012496836024 }, "slotId": { - "m_id": "{B6C92656-7593-4759-B657-98DB7CA30482}" + "m_id": "{158B30BE-BD39-40AE-A8A8-F0E5694F0180}" } }, "targetEndpoint": { "nodeId": { - "id": 28956289730909 + "id": 7820402811489 }, "slotId": { - "m_id": "{E97830A5-323D-4CD1-85CF-BAFB1735AC34}" + "m_id": "{510F56FD-6778-4DB8-BDDE-258335431CC6}" } } } @@ -1325,27 +1452,27 @@ }, { "Id": { - "id": 30240484952413 + "id": 10148275085921 }, - "Name": "srcEndpoint=(: ), destEndpoint=(GetAuthorityToClientNoParams_PlayFxEventByEntityId: In)", + "Name": "srcEndpoint=(AuthorityToClientNoParams_PlayFx Notify Event: OnEvent), destEndpoint=(Print: In)", "Components": { - "Component_[4329986353751309486]": { + "Component_[1594149632687531010]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 4329986353751309486, + "Id": 1594149632687531010, "sourceEndpoint": { "nodeId": { - "id": 57025381737912 + "id": 8318619017825 }, "slotId": { - "m_id": "{28664064-2483-465A-9BB1-4E1890048CDF}" + "m_id": "{0481BBFE-D31E-421F-A6C2-8A7AF3012545}" } }, "targetEndpoint": { "nodeId": { - "id": 28466663459165 + "id": 56995316966840 }, "slotId": { - "m_id": "{26902930-1BC7-4BF6-8F41-C313BA819AA3}" + "m_id": "{7CAD6E31-6218-4326-8FFB-0523F545E250}" } } } @@ -1353,19 +1480,19 @@ }, { "Id": { - "id": 30678571616605 + "id": 10629311423073 }, - "Name": "srcEndpoint=(AuthorityToClientNoParams_PlayFx Notify Event: OnEvent), destEndpoint=(: )", + "Name": "srcEndpoint=(AuthorityToClientNoParams_PlayFx Notify Event: OnEvent), destEndpoint=(DrawTextOnEntity: In)", "Components": { - "Component_[14658596010250057469]": { + "Component_[17976200298405988971]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 14658596010250057469, + "Id": 17976200298405988971, "sourceEndpoint": { "nodeId": { - "id": 28956289730909 + "id": 8318619017825 }, "slotId": { - "m_id": "{1F11AAA9-2A99-41A2-AABE-7B57463E3664}" + "m_id": "{0481BBFE-D31E-421F-A6C2-8A7AF3012545}" } }, "targetEndpoint": { @@ -1381,27 +1508,27 @@ }, { "Id": { - "id": 31060823705949 + "id": 42045766425613 }, - "Name": "srcEndpoint=(AuthorityToClientNoParams_PlayFx Notify Event: OnEvent), destEndpoint=(: )", + "Name": "srcEndpoint=(Repeater: Action), destEndpoint=(Print: In)", "Components": { - "Component_[16833378372852944435]": { + "Component_[1911118463107071864]": { "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", - "Id": 16833378372852944435, + "Id": 1911118463107071864, "sourceEndpoint": { "nodeId": { - "id": 28956289730909 + "id": 56986727032248 }, "slotId": { - "m_id": "{1F11AAA9-2A99-41A2-AABE-7B57463E3664}" + "m_id": "{C1CCBA7B-A13B-4FCE-99ED-8FD1A8F72869}" } }, "targetEndpoint": { "nodeId": { - "id": 56995316966840 + "id": 56999611934136 }, "slotId": { - "m_id": "{7CAD6E31-6218-4326-8FFB-0523F545E250}" + "m_id": "{2F11CF04-DC4B-4881-8D74-AB0E51B4A278}" } } } @@ -1418,7 +1545,7 @@ "GraphCanvasData": [ { "Key": { - "id": 8400576252253 + "id": 7820402811489 }, "Value": { "ComponentData": { @@ -1432,8 +1559,8 @@ "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 440.0, - -20.0 + -100.0, + 400.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { @@ -1442,14 +1569,14 @@ }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{2B6329F7-4CE7-4E01-B1A4-1FFCAB2D0B72}" + "PersistentId": "{F35F8202-B5EE-4ADD-9FF6-AF214A094266}" } } } }, { "Key": { - "id": 28466663459165 + "id": 8310662318335 }, "Value": { "ComponentData": { @@ -1463,8 +1590,8 @@ "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - -200.0, - 300.0 + 80.0, + -320.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { @@ -1473,14 +1600,14 @@ }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{A84996D5-99BD-4F5D-859E-02BFAB3FA83A}" + "PersistentId": "{346AFC26-B2EF-4495-AA1A-347BF77CB99D}" } } } }, { "Key": { - "id": 28956289730909 + "id": 8318619017825 }, "Value": { "ComponentData": { @@ -1494,8 +1621,8 @@ "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 260.0, - 300.0 + 340.0, + 400.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { @@ -1504,7 +1631,38 @@ }, "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { "$type": "PersistentIdComponentSaveData", - "PersistentId": "{B237687E-F57E-4C04-9B46-103548751B5D}" + "PersistentId": "{67499699-CA73-48B4-87E0-C66F4A3EA7CB}" + } + } + } + }, + { + "Key": { + "id": 8400576252253 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 420.0, + -60.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{2B6329F7-4CE7-4E01-B1A4-1FFCAB2D0B72}" } } } @@ -1555,8 +1713,8 @@ "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - -240.0, - -300.0 + 540.0, + -320.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { @@ -1615,8 +1773,8 @@ "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { "$type": "GeometrySaveData", "Position": [ - 960.0, - -40.0 + 420.0, + 100.0 ] }, "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { @@ -1722,15 +1880,15 @@ }, { "Key": { - "id": 5286394689911028851 + "id": 1685762441320719908 }, "Value": { "ComponentData": { "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { "$type": "SceneComponentSaveData", "ViewParams": { - "AnchorX": -579.0, - "AnchorY": -194.0 + "AnchorX": -349.0, + "AnchorY": 10.0 } } } @@ -1767,6 +1925,10 @@ "Key": 11983076003173356132, "Value": 1 }, + { + "Key": 13774516196858047560, + "Value": 1 + }, { "Key": 13774516226790665785, "Value": 1 From 9aec7d311382de38d9c84a7fb151206b350a41e7 Mon Sep 17 00:00:00 2001 From: sphrose <82213493+sphrose@users.noreply.github.com> Date: Wed, 22 Dec 2021 10:43:37 +0000 Subject: [PATCH 226/948] Fix compile issues in tests Signed-off-by: sphrose <82213493+sphrose@users.noreply.github.com> --- Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp | 2 +- Gems/Vegetation/Code/Tests/VegetationComponentFilterTests.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp b/Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp index 8f4420bcc5..9d182312a4 100644 --- a/Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp +++ b/Gems/SurfaceData/Code/Tests/SurfaceDataTest.cpp @@ -288,7 +288,7 @@ TEST_F(SurfaceDataTestApp, SurfaceData_TestRegisteredTags) ASSERT_TRUE(AZStd::find_if( registeredTags.begin(), registeredTags.end(), - [searchTerm](decltype(registeredTags)::value_type pair) + [=](decltype(registeredTags)::value_type pair) { return pair.second == searchTerm; })); diff --git a/Gems/Vegetation/Code/Tests/VegetationComponentFilterTests.cpp b/Gems/Vegetation/Code/Tests/VegetationComponentFilterTests.cpp index 221a2da432..bb1efb5ebd 100644 --- a/Gems/Vegetation/Code/Tests/VegetationComponentFilterTests.cpp +++ b/Gems/Vegetation/Code/Tests/VegetationComponentFilterTests.cpp @@ -108,7 +108,7 @@ namespace UnitTest Vegetation::SurfaceMaskDepthFilterConfig config; config.m_lowerDistance = -1000.0f; config.m_upperDistance = -0.5f; - config.m_depthComparisonTags.push_back(SurfaceData::Constants::s_terrainTagCrc); + config.m_depthComparisonTags.push_back(SurfaceData::Constants::s_unassignedTagCrc); Vegetation::SurfaceMaskDepthFilterComponent* component = nullptr; auto entity = CreateEntity(config, &component, [](AZ::Entity* e) @@ -120,7 +120,7 @@ namespace UnitTest mockSurfaceHandler.m_outPosition = AZ::Vector3::CreateZero(); mockSurfaceHandler.m_outNormal = AZ::Vector3::CreateAxisZ(); mockSurfaceHandler.m_outMasks.clear(); - mockSurfaceHandler.m_outMasks[SurfaceData::Constants::s_terrainTagCrc] = 1.0f; + mockSurfaceHandler.m_outMasks[SurfaceData::Constants::s_unassignedTagCrc] = 1.0f; // passes { From aafb9e81106e140949c9096c2c3c05880ea03e62 Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Wed, 22 Dec 2021 10:38:04 -0600 Subject: [PATCH 227/948] Misc Bugfixes (#6530) * Bugfix: AreaIds don't compare correctly when the priority bus doesn't have a listener. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> (cherry picked from commit eb9e95fcb3884dee638b9032785b828359b0d8c0) * Bugfix: Only deactivate a component if it's currently active. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> (cherry picked from commit 7c9e4b7de49e8fe009616651d6e09f66c356db38) * Switched shared_lock to unique_lock, since the data is being written to. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Moved Legacy::CryCommon build dependency to correct location. It was a public build dependency in FastNoise and GradientSignal, but really only should be a private dependency in Vegetation due to the vegetation system needing some init/shutdown events. Fixing this up also required cleanup of a few unused legacy remnants in other files. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * InWorldBounds was incorrectly checking the X bounds against the Z bounds. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Removed some additional unneeded legacy code that was now causing compile errors. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Addressed PR feedback. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Adjusted cmake dependencies again, based on what's needed in the public header files in the gems. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Second attempt at the Deactivate() fix, this time by tracking the nested component state. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Addressed PR feedback, made operation symmetrical. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Added CryCommon privately to other veg modules too, since they all reference AreaSystemComponent, which uses the legacy events. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- .../Source/Animation/AttachmentComponent.cpp | 1 - .../SurfaceData/SurfaceDataMeshComponent.cpp | 2 -- Gems/FastNoise/Code/CMakeLists.txt | 4 ++- Gems/FastNoise/Code/Tests/FastNoiseTest.cpp | 28 ------------------- Gems/GradientSignal/Code/CMakeLists.txt | 15 +++++++--- .../Code/Include/GradientSignal/Util.h | 5 ---- .../Component/EditorWrappedComponentBase.h | 1 + .../Component/EditorWrappedComponentBase.inl | 16 +++++++++-- .../include/LmbrCentral/Rendering/MeshAsset.h | 2 -- .../Source/TerrainSystem/TerrainSystem.cpp | 13 +++++---- Gems/Vegetation/Code/CMakeLists.txt | 4 +++ 11 files changed, 39 insertions(+), 52 deletions(-) diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Animation/AttachmentComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Animation/AttachmentComponent.cpp index 74e01c7829..e8cf03d26e 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Animation/AttachmentComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Animation/AttachmentComponent.cpp @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/SurfaceData/SurfaceDataMeshComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/SurfaceData/SurfaceDataMeshComponent.cpp index d8cae4564d..862e3599a3 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/SurfaceData/SurfaceDataMeshComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/SurfaceData/SurfaceDataMeshComponent.cpp @@ -17,8 +17,6 @@ #include #include -#include - namespace SurfaceData { void SurfaceDataMeshConfig::Reflect(AZ::ReflectContext* context) diff --git a/Gems/FastNoise/Code/CMakeLists.txt b/Gems/FastNoise/Code/CMakeLists.txt index 76b2cb4bd1..819592e018 100644 --- a/Gems/FastNoise/Code/CMakeLists.txt +++ b/Gems/FastNoise/Code/CMakeLists.txt @@ -18,9 +18,11 @@ ly_add_target( Include BUILD_DEPENDENCIES PUBLIC - Legacy::CryCommon Gem::GradientSignal + PUBLIC + AZ::AzCore PRIVATE + AZ::AzFramework Gem::LmbrCentral ) diff --git a/Gems/FastNoise/Code/Tests/FastNoiseTest.cpp b/Gems/FastNoise/Code/Tests/FastNoiseTest.cpp index 3fb60cdaf6..bae1d424c7 100644 --- a/Gems/FastNoise/Code/Tests/FastNoiseTest.cpp +++ b/Gems/FastNoise/Code/Tests/FastNoiseTest.cpp @@ -7,9 +7,6 @@ */ #include -#include -#include -#include #include #include @@ -101,28 +98,6 @@ public: void SetAdvancedMode([[maybe_unused]] bool value) override {} }; -struct MockGlobalEnvironment -{ - MockGlobalEnvironment() - { - m_stubEnv.pCryPak = &m_stubPak; - m_stubEnv.pConsole = &m_stubConsole; - m_stubEnv.pSystem = &m_stubSystem; - gEnv = &m_stubEnv; - } - - ~MockGlobalEnvironment() - { - gEnv = nullptr; - } - -private: - SSystemGlobalEnvironment m_stubEnv; - testing::NiceMock m_stubPak; - testing::NiceMock m_stubConsole; - testing::NiceMock m_stubSystem; -}; - TEST(FastNoiseTest, ComponentsWithComponentApplication) { AZ::ComponentApplication::Descriptor appDesc; @@ -130,8 +105,6 @@ TEST(FastNoiseTest, ComponentsWithComponentApplication) appDesc.m_recordingMode = AZ::Debug::AllocationRecords::RECORD_FULL; appDesc.m_stackRecordLevels = 20; - MockGlobalEnvironment mocks; - AZ::ComponentApplication app; AZ::Entity* systemEntity = app.Create(appDesc); ASSERT_TRUE(systemEntity != nullptr); @@ -186,7 +159,6 @@ public: AZ::ComponentApplication m_application; AZ::Entity* m_systemEntity; - MockGlobalEnvironment m_mocks; }; ////////////////////////////////////////////////////////////////////////// diff --git a/Gems/GradientSignal/Code/CMakeLists.txt b/Gems/GradientSignal/Code/CMakeLists.txt index 5b88044116..c0b36f4b12 100644 --- a/Gems/GradientSignal/Code/CMakeLists.txt +++ b/Gems/GradientSignal/Code/CMakeLists.txt @@ -18,10 +18,11 @@ ly_add_target( Include BUILD_DEPENDENCIES PUBLIC - Legacy::CryCommon + AZ::AzCore + AZ::AtomCore + AZ::AzFramework Gem::SurfaceData Gem::ImageProcessingAtom.Headers - PRIVATE Gem::LmbrCentral ) @@ -37,9 +38,11 @@ ly_add_target( Include BUILD_DEPENDENCIES PRIVATE - Gem::GradientSignal.Static Gem::LmbrCentral PUBLIC + AZ::AzCore + AZ::AtomCore + Gem::GradientSignal.Static Gem::ImageProcessingAtom.Headers # Atom/ImageProcessing/PixelFormats.h is part of a header in Includes RUNTIME_DEPENDENCIES Gem::LmbrCentral @@ -69,7 +72,9 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) Gem::LmbrCentral.Editor PUBLIC 3rdParty::Qt::Widgets - Legacy::CryCommon + AZ::AzCore + AZ::AtomCore + AZ::AzFramework AZ::AzToolsFramework AZ::AssetBuilderSDK Gem::GradientSignal.Static @@ -92,6 +97,8 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) PRIVATE Gem::GradientSignal.Editor.Static Gem::LmbrCentral.Editor + PUBLIC + AZ::AtomCore RUNTIME_DEPENDENCIES Gem::LmbrCentral.Editor ) diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Util.h b/Gems/GradientSignal/Code/Include/GradientSignal/Util.h index 1e0ae79e08..a6dbe118af 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Util.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Util.h @@ -14,11 +14,6 @@ #include #include -namespace LmbrCentral -{ - class MeshAsset; -} - namespace GradientSignal { enum class WrappingType : AZ::u8 diff --git a/Gems/LmbrCentral/Code/include/LmbrCentral/Component/EditorWrappedComponentBase.h b/Gems/LmbrCentral/Code/include/LmbrCentral/Component/EditorWrappedComponentBase.h index 29169ec9d7..af7509e3a6 100644 --- a/Gems/LmbrCentral/Code/include/LmbrCentral/Component/EditorWrappedComponentBase.h +++ b/Gems/LmbrCentral/Code/include/LmbrCentral/Component/EditorWrappedComponentBase.h @@ -56,6 +56,7 @@ namespace LmbrCentral TComponent m_component; TConfiguration m_configuration; bool m_visible = true; + bool m_runtimeComponentActive = false; }; } // namespace LmbrCentral diff --git a/Gems/LmbrCentral/Code/include/LmbrCentral/Component/EditorWrappedComponentBase.inl b/Gems/LmbrCentral/Code/include/LmbrCentral/Component/EditorWrappedComponentBase.inl index 6a9fceabbf..ee5dbe867e 100644 --- a/Gems/LmbrCentral/Code/include/LmbrCentral/Component/EditorWrappedComponentBase.inl +++ b/Gems/LmbrCentral/Code/include/LmbrCentral/Component/EditorWrappedComponentBase.inl @@ -177,6 +177,7 @@ namespace LmbrCentral void EditorWrappedComponentBase::Init() { AzToolsFramework::Components::EditorComponentBase::Init(); + m_runtimeComponentActive = false; m_component.ReadInConfig(&m_configuration); m_component.Init(); } @@ -196,6 +197,7 @@ namespace LmbrCentral if (m_visible) { m_component.Activate(); + m_runtimeComponentActive = true; } } @@ -205,8 +207,10 @@ namespace LmbrCentral AzToolsFramework::EditorVisibilityNotificationBus::Handler::BusDisconnect(); AzToolsFramework::Components::EditorComponentBase::Deactivate(); + m_runtimeComponentActive = false; m_component.Deactivate(); - m_component.SetEntity(nullptr); // remove the entity association, in case the parent component is being removed, otherwise the component will be reactivated + // remove the entity association, in case the parent component is being removed, otherwise the component will be reactivated + m_component.SetEntity(nullptr); } template @@ -222,12 +226,18 @@ namespace LmbrCentral template AZ::u32 EditorWrappedComponentBase::ConfigurationChanged() { - m_component.Deactivate(); + if (m_runtimeComponentActive) + { + m_runtimeComponentActive = false; + m_component.Deactivate(); + } + m_component.ReadInConfig(&m_configuration); - if (m_visible && m_component.GetEntity()) + if (m_visible && !m_runtimeComponentActive) { m_component.Activate(); + m_runtimeComponentActive = true; } return AZ::Edit::PropertyRefreshLevels::None; diff --git a/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/MeshAsset.h b/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/MeshAsset.h index b4cefa8502..329687ab82 100644 --- a/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/MeshAsset.h +++ b/Gems/LmbrCentral/Code/include/LmbrCentral/Rendering/MeshAsset.h @@ -9,8 +9,6 @@ #include -#include - namespace LmbrCentral { class MeshAsset diff --git a/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.cpp b/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.cpp index bc951f7c48..1b2dedd469 100644 --- a/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.cpp +++ b/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.cpp @@ -25,10 +25,12 @@ bool TerrainLayerPriorityComparator::operator()(const AZ::EntityId& layer1id, co { // Comparator for insertion/keylookup. // Sorts into layer/priority order, highest priority first. - AZ::u32 priority1, layer1; + AZ::u32 priority1 = 0; + AZ::u32 layer1 = 0; Terrain::TerrainSpawnerRequestBus::Event(layer1id, &Terrain::TerrainSpawnerRequestBus::Events::GetPriority, layer1, priority1); - AZ::u32 priority2, layer2; + AZ::u32 priority2 = 0; + AZ::u32 layer2 = 0; Terrain::TerrainSpawnerRequestBus::Event(layer2id, &Terrain::TerrainSpawnerRequestBus::Events::GetPriority, layer2, priority2); if (layer1 < layer2) @@ -80,7 +82,7 @@ void TerrainSystem::Activate() m_requestedSettings.m_systemActive = true; { - AZStd::shared_lock lock(m_areaMutex); + AZStd::unique_lock lock(m_areaMutex); m_registeredAreas.clear(); } @@ -109,7 +111,7 @@ void TerrainSystem::Deactivate() AzFramework::Terrain::TerrainDataRequestBus::Handler::BusDisconnect(); { - AZStd::shared_lock lock(m_areaMutex); + AZStd::unique_lock lock(m_areaMutex); m_registeredAreas.clear(); } @@ -163,8 +165,7 @@ void TerrainSystem::ClampPosition(float x, float y, AZ::Vector2& outPosition, AZ bool TerrainSystem::InWorldBounds(float x, float y) const { - const float zTestValue = m_currentSettings.m_worldBounds.GetMin().GetX() + - ((m_currentSettings.m_worldBounds.GetMax().GetX() - m_currentSettings.m_worldBounds.GetMin().GetX()) / 2.0f); + const float zTestValue = m_currentSettings.m_worldBounds.GetMin().GetZ(); const AZ::Vector3 testValue{ x, y, zTestValue }; if (m_currentSettings.m_worldBounds.Contains(testValue)) { diff --git a/Gems/Vegetation/Code/CMakeLists.txt b/Gems/Vegetation/Code/CMakeLists.txt index 53fa6bd59f..c5e2accc9e 100644 --- a/Gems/Vegetation/Code/CMakeLists.txt +++ b/Gems/Vegetation/Code/CMakeLists.txt @@ -24,6 +24,7 @@ ly_add_target( PRIVATE Gem::LmbrCentral Gem::SurfaceData + Legacy::CryCommon PUBLIC Gem::AtomLyIntegration_CommonFeatures.Static RUNTIME_DEPENDENCIES @@ -43,6 +44,7 @@ ly_add_target( BUILD_DEPENDENCIES PRIVATE Gem::Vegetation.Static + Legacy::CryCommon RUNTIME_DEPENDENCIES Gem::LmbrCentral Gem::GradientSignal @@ -72,6 +74,7 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) PRIVATE Gem::Vegetation.Static AZ::AzToolsFramework + Legacy::CryCommon RUNTIME_DEPENDENCIES Gem::LmbrCentral.Editor Gem::GradientSignal.Editor @@ -104,6 +107,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) AZ::AzFrameworkTestShared Gem::Vegetation.Static Gem::LmbrCentral.Mocks + Legacy::CryCommon ) ly_add_googletest( NAME Gem::Vegetation.Tests From 74f0cb5b984ef997763bb6aeba9f0313cb696ab8 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 22 Dec 2021 09:06:28 -0800 Subject: [PATCH 228/948] Removes LuxCore (#6491) Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Assets/Shaders/LuxCore/RenderTexture.azsl | 61 ---- .../Shaders/LuxCore/RenderTexture.shader | 22 -- .../LuxCore/RenderTexture.shadervariantlist | 17 - .../atom_feature_common_asset_files.cmake | 2 - Gems/Atom/Feature/Common/Code/CMakeLists.txt | 2 - .../Include/Atom/Feature/LuxCore/LuxCoreBus.h | 63 ---- .../Atom/Feature/LuxCore/LuxCoreTexturePass.h | 51 --- .../Atom/Feature/LuxCore/RenderTexturePass.h | 55 ---- .../Code/Source/CommonSystemComponent.cpp | 10 - .../Code/Source/CommonSystemComponent.h | 9 - .../Code/Source/LuxCore/LuxCoreMaterial.cpp | 139 -------- .../Code/Source/LuxCore/LuxCoreMaterial.h | 61 ---- .../Code/Source/LuxCore/LuxCoreMesh.cpp | 135 -------- .../Common/Code/Source/LuxCore/LuxCoreMesh.h | 49 --- .../Code/Source/LuxCore/LuxCoreObject.cpp | 57 ---- .../Code/Source/LuxCore/LuxCoreObject.h | 41 --- .../Code/Source/LuxCore/LuxCoreRenderer.cpp | 308 ------------------ .../Code/Source/LuxCore/LuxCoreRenderer.h | 56 ---- .../Code/Source/LuxCore/LuxCoreTexture.cpp | 158 --------- .../Code/Source/LuxCore/LuxCoreTexture.h | 62 ---- .../Source/LuxCore/LuxCoreTexturePass.cpp | 90 ----- .../Code/Source/LuxCore/RenderTexturePass.cpp | 90 ----- .../Android/Atom_Feature_Traits_Android.h | 3 +- .../Clang/atom_feature_common_clang.cmake | 6 - .../MSVC/atom_feature_common_msvc.cmake | 6 - .../Linux/Atom_Feature_Traits_Linux.h | 3 +- .../Platform/Mac/Atom_Feature_Traits_Mac.h | 3 +- .../Windows/Atom_Feature_Traits_Windows.h | 3 +- .../Windows/LaunchLuxCoreUI_Windows.cpp | 45 --- .../Windows/platform_windows_files.cmake | 1 - .../Platform/iOS/Atom_Feature_Traits_iOS.h | 3 +- .../Code/atom_feature_common_files.cmake | 15 - .../Android/BuiltInPackages_android.cmake | 2 +- .../Linux/BuiltInPackages_linux.cmake | 1 - .../Platform/Mac/BuiltInPackages_mac.cmake | 1 - .../Windows/BuiltInPackages_windows.cmake | 1 - .../Platform/iOS/BuiltInPackages_ios.cmake | 1 - 37 files changed, 6 insertions(+), 1626 deletions(-) delete mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/LuxCore/RenderTexture.azsl delete mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/LuxCore/RenderTexture.shader delete mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/LuxCore/RenderTexture.shadervariantlist delete mode 100644 Gems/Atom/Feature/Common/Code/Include/Atom/Feature/LuxCore/LuxCoreBus.h delete mode 100644 Gems/Atom/Feature/Common/Code/Include/Atom/Feature/LuxCore/LuxCoreTexturePass.h delete mode 100644 Gems/Atom/Feature/Common/Code/Include/Atom/Feature/LuxCore/RenderTexturePass.h delete mode 100644 Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreMaterial.cpp delete mode 100644 Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreMaterial.h delete mode 100644 Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreMesh.cpp delete mode 100644 Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreMesh.h delete mode 100644 Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreObject.cpp delete mode 100644 Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreObject.h delete mode 100644 Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreRenderer.cpp delete mode 100644 Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreRenderer.h delete mode 100644 Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreTexture.cpp delete mode 100644 Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreTexture.h delete mode 100644 Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreTexturePass.cpp delete mode 100644 Gems/Atom/Feature/Common/Code/Source/LuxCore/RenderTexturePass.cpp delete mode 100644 Gems/Atom/Feature/Common/Code/Source/Platform/Windows/LaunchLuxCoreUI_Windows.cpp diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/LuxCore/RenderTexture.azsl b/Gems/Atom/Feature/Common/Assets/Shaders/LuxCore/RenderTexture.azsl deleted file mode 100644 index e31179c733..0000000000 --- a/Gems/Atom/Feature/Common/Assets/Shaders/LuxCore/RenderTexture.azsl +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * 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 - -ShaderResourceGroup PassSrg : SRG_PerPass -{ - Texture2D m_sourceTexture; - - Sampler TextureSampler - { - MinFilter = Point; - MagFilter = Point; - MipFilter = Point; - AddressU = Clamp; - AddressV = Clamp; - AddressW = Clamp; - }; -} - -float4 RestoreNormalMap(float4 normalMapSample) -{ - float4 restoredNormal; - - // [GFX TODO][ATOM-2404] For some reason, the image build pipeline swaps the R and G channels so we swap them back here. - restoredNormal.xy = normalMapSample.yx; - - // The image build pipeline drops the B channel so we have to reconstruct it here. - restoredNormal.z = sqrt(1 - dot(restoredNormal.xy, restoredNormal.xy)); - - restoredNormal.xyz = restoredNormal.xyz * 0.5 + 0.5; - restoredNormal.a = 1; - - return restoredNormal; -} - -option bool o_isNormal; - -PSOutput MainPS(VSOutput IN) -{ - PSOutput OUT; - - if(o_isNormal) - { - float4 sampledValue = PassSrg::m_sourceTexture.SampleLevel(PassSrg::TextureSampler, IN.m_texCoord, 0); - OUT.m_color = RestoreNormalMap(sampledValue); - } - else - { - OUT.m_color = PassSrg::m_sourceTexture.SampleLevel(PassSrg::TextureSampler, IN.m_texCoord, 0); - } - - return OUT; -} diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/LuxCore/RenderTexture.shader b/Gems/Atom/Feature/Common/Assets/Shaders/LuxCore/RenderTexture.shader deleted file mode 100644 index 6035f98f5d..0000000000 --- a/Gems/Atom/Feature/Common/Assets/Shaders/LuxCore/RenderTexture.shader +++ /dev/null @@ -1,22 +0,0 @@ -{ - "Source" : "RenderTexture.azsl", - - "DepthStencilState" : { - "Depth" : { "Enable" : false } - }, - - "ProgramSettings": - { - "EntryPoints": - [ - { - "name": "MainVS", - "type": "Vertex" - }, - { - "name": "MainPS", - "type": "Fragment" - } - ] - } -} diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/LuxCore/RenderTexture.shadervariantlist b/Gems/Atom/Feature/Common/Assets/Shaders/LuxCore/RenderTexture.shadervariantlist deleted file mode 100644 index 97faeac819..0000000000 --- a/Gems/Atom/Feature/Common/Assets/Shaders/LuxCore/RenderTexture.shadervariantlist +++ /dev/null @@ -1,17 +0,0 @@ -{ - "Shader" : "RenderTexture.shader", - "Variants" : [ - { - "StableId": 1, - "Options": { - "o_isNormal": "false" - } - }, - { - "StableId": 2, - "Options": { - "o_isNormal": "true" - } - } - ] -} diff --git a/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake b/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake index a03058e2bf..1844d26e10 100644 --- a/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake +++ b/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake @@ -366,8 +366,6 @@ set(FILES Shaders/LightCulling/LightCullingRemap.shader Shaders/LightCulling/LightCullingTilePrepare.azsl Shaders/LightCulling/LightCullingTilePrepare.shader - Shaders/LuxCore/RenderTexture.azsl - Shaders/LuxCore/RenderTexture.shader Shaders/MorphTargets/MorphTargetCS.azsl Shaders/MorphTargets/MorphTargetCS.shader Shaders/MorphTargets/MorphTargetSRG.azsli diff --git a/Gems/Atom/Feature/Common/Code/CMakeLists.txt b/Gems/Atom/Feature/Common/Code/CMakeLists.txt index 3ebb9df104..db9ac8560f 100644 --- a/Gems/Atom/Feature/Common/Code/CMakeLists.txt +++ b/Gems/Atom/Feature/Common/Code/CMakeLists.txt @@ -40,7 +40,6 @@ ly_add_target( Gem::Atom_Feature_Common.Public Gem::ImGui.imguilib 3rdParty::TIFF - #3rdParty::lux_core # AZ_TRAIT_LUXCORE_SUPPORTED is disabled in every platform, Issue #3915 will remove RUNTIME_DEPENDENCIES Gem::ImGui.imguilib ) @@ -91,7 +90,6 @@ ly_add_target( AZ::AzFramework Gem::Atom_Feature_Common.Static Gem::Atom_Feature_Common.Public - #3rdParty::lux_core # AZ_TRAIT_LUXCORE_SUPPORTED is disabled in every platform, Issue #3915 will remove ) if(PAL_TRAIT_BUILD_HOST_TOOLS) diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/LuxCore/LuxCoreBus.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/LuxCore/LuxCoreBus.h deleted file mode 100644 index 1aa7778834..0000000000 --- a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/LuxCore/LuxCoreBus.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#pragma once - -#include -#include -#include - -namespace AZ -{ - namespace Render - { - enum LuxCoreTextureType - { - Default = 0, - IBL, - Albedo, - Normal - }; - - class LuxCoreRequests - : public EBusTraits - { - - public: - /// Overrides the default AZ::EBusTraits handler policy to allow one listener only. - static const EBusHandlerPolicy HandlerPolicy = EBusHandlerPolicy::Single; - virtual ~LuxCoreRequests() {} - virtual void SetCameraEntityID(AZ::EntityId id) = 0; - virtual void AddMesh(Data::Asset modelAsset) = 0; - virtual void AddMaterial(Data::Instance material) = 0; - virtual void AddTexture(Data::Instance texture, LuxCoreTextureType type) = 0; - virtual void AddObject(Data::Asset modelAsset, Data::InstanceId materialInstanceId) = 0; - virtual bool CheckTextureStatus() = 0; - virtual void RenderInLuxCore() = 0; - virtual void ClearLuxCore() = 0; - virtual void ClearObject() = 0; - }; - - typedef AZ::EBus LuxCoreRequestsBus; - - class LuxCoreNotification - : public EBusTraits - { - public: - static const EBusAddressPolicy AddressPolicy = EBusAddressPolicy::ById; - /** - * Overrides the default AZ::EBusTraits ID type so that AssetId are - * used to access the addresses of the bus. - */ - typedef Data::AssetId BusIdType; - virtual ~LuxCoreNotification() {} - - virtual void OnRenderPrepare() {} - }; - typedef AZ::EBus LuxCoreNotificationBus; - } -} diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/LuxCore/LuxCoreTexturePass.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/LuxCore/LuxCoreTexturePass.h deleted file mode 100644 index 63258a6570..0000000000 --- a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/LuxCore/LuxCoreTexturePass.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#pragma once - -#include - -#include -#include -#include - -#include - -namespace AZ -{ - namespace Render - { - class LuxCoreTexturePass final - : public RPI::ParentPass - { - public: - AZ_RTTI(LuxCoreTexturePass, "{A6CA80C0-63A6-4686-A627-B5D1DA04B627}", ParentPass); - AZ_CLASS_ALLOCATOR(LuxCoreTexturePass, SystemAllocator, 0); - - static RPI::Ptr Create(const RPI::PassDescriptor& descriptor); - - LuxCoreTexturePass(const RPI::PassDescriptor& descriptor); - ~LuxCoreTexturePass(); - - void SetSourceTexture(Data::Instance image, RHI::Format format); - void SetIsNormalTexture(bool isNormal); - void SetReadbackCallback(RPI::AttachmentReadback::CallbackFunction callbackFunciton); - - protected: - // Pass behavior overrides - void CreateChildPassesInternal() final; - void BuildInternal() final; - void FrameBeginInternal(FramePrepareParams params) final; - - private: - - RPI::Ptr m_renderTargetPass = nullptr; - AZStd::shared_ptr m_readback = nullptr; - bool m_attachmentReadbackComplete = false; - }; - } -} diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/LuxCore/RenderTexturePass.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/LuxCore/RenderTexturePass.h deleted file mode 100644 index 8389fe33a7..0000000000 --- a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/LuxCore/RenderTexturePass.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 - -namespace AZ -{ - namespace Render - { - /* - * A simple pass to render a texture to an attachment render target - * The attachment size and format will be configure as the same as the input texture - */ - class RenderTexturePass final - : public RPI::FullscreenTrianglePass - { - - AZ_RPI_PASS(RenderTexturePass); - - public: - AZ_RTTI(RenderTexturePass, "{476A4E41-08D7-456C-B324-E0493A321FE7}", FullscreenTrianglePass); - AZ_CLASS_ALLOCATOR(RenderTexturePass, SystemAllocator, 0); - virtual ~RenderTexturePass(); - - static RPI::Ptr Create(const RPI::PassDescriptor& descriptor); - - // Set the source image - void SetPassSrgImage(AZ::Data::Instance image, RHI::Format format); - - RHI::AttachmentId GetRenderTargetId(); - - void InitShaderVariant(bool isNormal); - - protected: - RenderTexturePass(const RPI::PassDescriptor& descriptor); - - private: - - void BuildInternal() override; - void FrameBeginInternal(FramePrepareParams params) override; - - void UpdataAttachment(); - - RHI::ShaderInputImageIndex m_textureIndex; - RHI::Size m_attachmentSize; - RHI::Format m_attachmentFormat; - }; - } -} diff --git a/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp b/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp index dc5d1a5c12..a06defff08 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp @@ -74,11 +74,6 @@ #include -#if AZ_TRAIT_LUXCORE_SUPPORTED -#include -#include -#endif - #include #include @@ -221,11 +216,6 @@ namespace AZ passSystem->AddPassCreator(Name("DisplayMapperFullScreenPass"), &DisplayMapperFullScreenPass::Create); passSystem->AddPassCreator(Name("OutputTransformPass"), &OutputTransformPass::Create); passSystem->AddPassCreator(Name("EyeAdaptationPass"), &EyeAdaptationPass::Create); - // Add RenderTexture and LuxCoreTexture pass -#if AZ_TRAIT_LUXCORE_SUPPORTED - passSystem->AddPassCreator(Name("RenderTexturePass"), &RenderTexturePass::Create); - passSystem->AddPassCreator(Name("LuxCoreTexturePass"), &LuxCoreTexturePass::Create); -#endif passSystem->AddPassCreator(Name("ImGuiPass"), &ImGuiPass::Create); passSystem->AddPassCreator(Name("LightCullingPass"), &LightCullingPass::Create); passSystem->AddPassCreator(Name("LightCullingRemapPass"), &LightCullingRemap::Create); diff --git a/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.h b/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.h index b12ad3459c..4838cc3d3d 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.h +++ b/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.h @@ -12,10 +12,6 @@ #include -#if AZ_TRAIT_LUXCORE_SUPPORTED -#include "LuxCore/LuxCoreRenderer.h" -#endif - namespace AZ { namespace Render @@ -50,11 +46,6 @@ namespace AZ RPI::PassSystemInterface::OnReadyLoadTemplatesEvent::Handler m_loadTemplatesHandler; AZStd::unique_ptr m_modelReloaderSystem; - -#if AZ_TRAIT_LUXCORE_SUPPORTED - // LuxCore - LuxCoreRenderer m_luxCore; -#endif }; } // namespace Render } // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreMaterial.cpp b/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreMaterial.cpp deleted file mode 100644 index e454a1c7ba..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreMaterial.cpp +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * 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 -#if AZ_TRAIT_LUXCORE_SUPPORTED - -#include "LuxCoreMaterial.h" -#include - -#include -#include - -namespace AZ -{ - namespace Render - { - LuxCoreMaterial::LuxCoreMaterial(const AZ::Data::Instance& material) - { - Init(material); - } - - LuxCoreMaterial::LuxCoreMaterial(const LuxCoreMaterial &material) - { - Init(material.m_material); - } - - LuxCoreMaterial::~LuxCoreMaterial() - { - if (m_material) - { - m_material = nullptr; - } - } - - void LuxCoreMaterial::Init(const AZ::Data::Instance& material) - { - m_material = material; - m_luxCoreMaterialName = "scene.materials." + m_material->GetId().ToString(); - m_luxCoreMaterial = m_luxCoreMaterial << luxrays::Property(std::string(m_luxCoreMaterialName.data()) + ".type")("disney"); - - ParseProperty(s_pbrColorGroup, ".basecolor"); - ParseProperty(s_pbrMetallicGroup, ".metallic"); - ParseProperty(s_pbrRoughnessGroup, ".roughness"); - ParseProperty(s_pbrSpecularGroup, ".specular"); - ParseProperty(s_pbrNormalGroup, ".bumptex"); - } - - bool LuxCoreMaterial::ParseTexture(const char* group, AZStd::string propertyName) - { - AZ::RPI::MaterialPropertyIndex propertyIndex; - - propertyIndex = m_material->FindPropertyIndex(MakePbrPropertyName(group, s_pbrUseTextureProperty)); - bool useTexture = m_material->GetPropertyValue(propertyIndex); - - if (useTexture) - { - propertyIndex = m_material->FindPropertyIndex(MakePbrPropertyName(group, s_pbrTextureProperty)); - Data::Instance texture = m_material->GetPropertyValue>(propertyIndex); - - if (texture) - { - if (group == s_pbrNormalGroup) - { - AZ::Render::LuxCoreRequestsBus::Broadcast(&AZ::Render::LuxCoreRequestsBus::Events::AddTexture, texture, LuxCoreTextureType::Normal); - } - else if (group == s_pbrColorGroup) - { - AZ::Render::LuxCoreRequestsBus::Broadcast(&AZ::Render::LuxCoreRequestsBus::Events::AddTexture, texture, LuxCoreTextureType::Albedo); - } - else - { - AZ::Render::LuxCoreRequestsBus::Broadcast(&AZ::Render::LuxCoreRequestsBus::Events::AddTexture, texture, LuxCoreTextureType::Default); - } - - AZStd::string materialProperty = m_luxCoreMaterialName + propertyName; - m_luxCoreMaterial = m_luxCoreMaterial << luxrays::Property(std::string(materialProperty.data()))(std::string(texture->GetAssetId().ToString().data())); - return true; - } - } - - return false; - } - - AZ::Name LuxCoreMaterial::MakePbrPropertyName(const char* groupName, const char* propertyName) const - { - return AZ::Name{AZStd::string::format("%s.%s", groupName, propertyName)}; - } - - void LuxCoreMaterial::ParseProperty(const char* group, AZStd::string propertyName) - { - if (!ParseTexture(group, propertyName)) - { - if (group == s_pbrNormalGroup) - { - // Normal should always be texture - return; - } - else if (group == s_pbrColorGroup) - { - AZ::RPI::MaterialPropertyIndex propertyIndex; - propertyIndex = m_material->FindPropertyIndex(MakePbrPropertyName(s_pbrColorGroup, s_pbrColorProperty)); - Color color = m_material->GetPropertyValue(propertyIndex); - propertyIndex = m_material->FindPropertyIndex(MakePbrPropertyName(s_pbrColorGroup, s_pbrFactorProperty)); - float factor = m_material->GetPropertyValue(propertyIndex); - - AZStd::string materialProperty = m_luxCoreMaterialName + propertyName; - m_luxCoreMaterial = m_luxCoreMaterial << luxrays::Property(std::string(materialProperty.data()))(float(color.GetR())* factor, float(color.GetG())*factor, float(color.GetB())*factor); - } - else - { - AZ::RPI::MaterialPropertyIndex propertyIndex; - propertyIndex = m_material->FindPropertyIndex(MakePbrPropertyName(group, s_pbrFactorProperty)); - float factor = m_material->GetPropertyValue(propertyIndex); - - AZStd::string materialProperty = m_luxCoreMaterialName + propertyName; - m_luxCoreMaterial = m_luxCoreMaterial << luxrays::Property(std::string(materialProperty.data()))(factor); - } - } - } - - luxrays::Properties LuxCoreMaterial::GetLuxCoreMaterialProperties() - { - return m_luxCoreMaterial; - } - - AZ::Data::InstanceId LuxCoreMaterial::GetMaterialId() - { - return m_material->GetId(); - } - } -} - -#endif diff --git a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreMaterial.h b/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreMaterial.h deleted file mode 100644 index 86c095f7fd..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreMaterial.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#pragma once - - -#include -#if AZ_TRAIT_LUXCORE_SUPPORTED - -#include -#include "LuxCoreTexture.h" - -#include - -namespace AZ -{ - namespace Render - { - // Manage mapping between Atom PBR material and LuxCore Disney material - class LuxCoreMaterial final - { - public: - LuxCoreMaterial() = default; - LuxCoreMaterial(const AZ::Data::Instance& material); - LuxCoreMaterial(const LuxCoreMaterial &material); - ~LuxCoreMaterial(); - - luxrays::Properties GetLuxCoreMaterialProperties(); - AZ::Data::InstanceId GetMaterialId(); - private: - - static constexpr const char* s_pbrColorGroup = "baseColor"; - static constexpr const char* s_pbrMetallicGroup = "metallic"; - static constexpr const char* s_pbrRoughnessGroup = "roughness"; - static constexpr const char* s_pbrSpecularGroup = "specularF0"; - static constexpr const char* s_pbrNormalGroup = "normal"; - static constexpr const char* s_pbrOpacityGroup = "opacity"; - - static constexpr const char* s_pbrColorProperty = "color"; - static constexpr const char* s_pbrFactorProperty = "factor"; - static constexpr const char* s_pbrUseTextureProperty = "useTexture"; - static constexpr const char* s_pbrTextureProperty = "textureMap"; - - void ParseProperty(const char* group, AZStd::string propertyName); - bool ParseTexture(const char* group, AZStd::string propertyName); - AZ::Name MakePbrPropertyName(const char* groupName, const char* propertyName) const; - - void Init(const AZ::Data::Instance& material); - - AZStd::string m_luxCoreMaterialName; - luxrays::Properties m_luxCoreMaterial; - - AZ::Data::Instance m_material = nullptr; - }; - } -} -#endif diff --git a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreMesh.cpp b/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreMesh.cpp deleted file mode 100644 index 34272f8cbf..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreMesh.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * 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 -#if AZ_TRAIT_LUXCORE_SUPPORTED - -#include "LuxCoreMesh.h" -#include - -namespace AZ -{ - namespace Render - { - LuxCoreMesh::LuxCoreMesh(AZ::Data::Asset modelAsset) - { - Init(modelAsset); - } - - LuxCoreMesh::LuxCoreMesh(const LuxCoreMesh &model) - { - Init(model.m_modelAsset); - } - - LuxCoreMesh::~LuxCoreMesh() - { - if (m_position) - { - delete m_position; - m_position = nullptr; - } - - if (m_normal) - { - delete m_normal; - m_normal = nullptr; - } - - if (m_uv) - { - delete m_uv; - m_uv = nullptr; - } - - if (m_index) - { - delete m_index; - m_index = nullptr; - } - - if (m_modelAsset) - { - m_modelAsset.Reset(); - } - } - - void LuxCoreMesh::Init(AZ::Data::Asset modelAsset) - { - m_modelAsset = modelAsset; - // [TODO ATOM-3547] Multiple meshes handling - AZ::RPI::ModelLodAsset::Mesh mesh = m_modelAsset->GetLodAssets()[0]->GetMeshes()[0]; - - // index data - AZStd::array_view indexBuffer = mesh.GetIndexBufferAssetView().GetBufferAsset()->GetBuffer(); - m_index = luxcore::Scene::AllocTrianglesBuffer(mesh.GetIndexCount() / 3); - memcpy(m_index, indexBuffer.data(), indexBuffer.size()); - - // vertices data - for (AZ::RPI::ModelLodAsset::Mesh::StreamBufferInfo streamBufferInfo : mesh.GetStreamBufferInfoList()) - { - AZStd::array_view dataBuffer = streamBufferInfo.m_bufferAssetView.GetBufferAsset()->GetBuffer(); - - if (streamBufferInfo.m_semantic == RHI::ShaderSemantic{ "POSITION" }) - { - m_position = luxcore::Scene::AllocVerticesBuffer(mesh.GetVertexCount()); - memcpy(m_position, dataBuffer.data(), dataBuffer.size()); - } - else if (streamBufferInfo.m_semantic == RHI::ShaderSemantic{ "NORMAL" }) - { - m_normal = new float[mesh.GetVertexCount() * 3]; - memcpy(m_normal, dataBuffer.data(), dataBuffer.size()); - } - else if (streamBufferInfo.m_semantic == RHI::ShaderSemantic{ "UV", 0 }) - { - m_uv = new float[mesh.GetVertexCount() * 2]; - memcpy(m_uv, dataBuffer.data(), dataBuffer.size()); - } - } - } - - - uint32_t LuxCoreMesh::GetVertexCount() - { - // [TODO ATOM-3547] Multiple meshes handling - return m_modelAsset->GetLodAssets()[0]->GetMeshes()[0].GetVertexCount(); - } - - uint32_t LuxCoreMesh::GetTriangleCount() - { - // [TODO ATOM-3547] Multiple meshes handling - return (m_modelAsset->GetLodAssets()[0]->GetMeshes()[0].GetIndexCount() / 3); - } - - AZ::Data::AssetId LuxCoreMesh::GetMeshId() - { - return m_modelAsset->GetId(); - } - - const float* LuxCoreMesh::GetPositionData() - { - return m_position; - } - - const float* LuxCoreMesh::GetNormalData() - { - return m_normal; - } - - const float* LuxCoreMesh::GetUVData() - { - return m_uv; - } - - const unsigned int* LuxCoreMesh::GetIndexData() - { - return m_index; - } - } -} -#endif diff --git a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreMesh.h b/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreMesh.h deleted file mode 100644 index 597049f849..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreMesh.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#pragma once - - -#include -#if AZ_TRAIT_LUXCORE_SUPPORTED - -#include - -namespace AZ -{ - namespace Render - { - // Extract vertex and index data from source model - class LuxCoreMesh final - { - public: - LuxCoreMesh() = default; - LuxCoreMesh(AZ::Data::Asset modelAsset); - LuxCoreMesh(const LuxCoreMesh &mesh); - ~LuxCoreMesh(); - - AZ::Data::AssetId GetMeshId(); - const float* GetPositionData(); - const float* GetNormalData(); - const float* GetUVData(); - const unsigned int* GetIndexData(); - - uint32_t GetVertexCount(); - uint32_t GetTriangleCount(); - - private: - void Init(AZ::Data::Asset modelAsset); - - float* m_position = nullptr; - float* m_normal = nullptr; - float* m_uv = nullptr; - unsigned int* m_index = nullptr; - AZ::Data::Asset m_modelAsset; - }; - } -} -#endif diff --git a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreObject.cpp b/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreObject.cpp deleted file mode 100644 index ddeb61e394..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreObject.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 -#if AZ_TRAIT_LUXCORE_SUPPORTED - -#include "LuxCoreObject.h" -#include - -namespace AZ -{ - namespace Render - { - LuxCoreObject::LuxCoreObject(AZStd::string modelAssetId, AZStd::string materialInstanceId) - { - Init(modelAssetId, materialInstanceId); - } - - LuxCoreObject::LuxCoreObject(const LuxCoreObject &object) - { - Init(object.m_modelAssetId, object.m_materialInstanceId); - } - - LuxCoreObject::~LuxCoreObject() - { - } - - luxrays::Properties LuxCoreObject::GetLuxCoreObjectProperties() - { - return m_luxCoreObject; - } - - void LuxCoreObject::Init(AZStd::string modelAssetId, AZStd::string materialInstanceId) - { - m_modelAssetId = modelAssetId; - m_materialInstanceId = materialInstanceId; - - static std::atomic_int ObjectId { 0 }; - const int localObjectId = ObjectId++; - - m_luxCoreObjectName = "scene.objects." + AZStd::to_string(localObjectId); - AZStd::string shapePropertyName = m_luxCoreObjectName + ".shape"; - AZStd::string materialPropertyName = m_luxCoreObjectName + ".material"; - - m_luxCoreObject = m_luxCoreObject << luxrays::Property(std::string(shapePropertyName.data()))(std::string(modelAssetId.data())); - m_luxCoreObject = m_luxCoreObject << luxrays::Property(std::string(materialPropertyName.data()))(std::string(materialInstanceId.data())); - } - }; -}; - -#endif diff --git a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreObject.h b/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreObject.h deleted file mode 100644 index 6529b0487b..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreObject.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#pragma once - -#include -#if AZ_TRAIT_LUXCORE_SUPPORTED - -#include -#include - -namespace AZ -{ - namespace Render - { - // Object holds mesh and material in LuxCore - class LuxCoreObject final - { - public: - LuxCoreObject(AZStd::string modelAssetId, AZStd::string materialInstanceId); - LuxCoreObject(const LuxCoreObject &object); - ~LuxCoreObject(); - - luxrays::Properties GetLuxCoreObjectProperties(); - - private: - - void Init(AZStd::string modelAssetId, AZStd::string materialInstanceId); - AZStd::string m_luxCoreObjectName; - luxrays::Properties m_luxCoreObject; - - AZStd::string m_modelAssetId; - AZStd::string m_materialInstanceId; - }; - }; -}; -#endif diff --git a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreRenderer.cpp b/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreRenderer.cpp deleted file mode 100644 index ef3f33d1c3..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreRenderer.cpp +++ /dev/null @@ -1,308 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * 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 -#if AZ_TRAIT_LUXCORE_SUPPORTED - -#include "LuxCoreRenderer.h" - -#include -#include -#include -#include -#include - -#include - -namespace LuxCoreUI -{ - void LaunchLuxCoreUI(const AZStd::string& luxCoreExeFullPath, const AZStd::string& commandLine); -} - -namespace AZ -{ - namespace Render - { - LuxCoreRenderer::LuxCoreRenderer() - { - LuxCoreRequestsBus::Handler::BusConnect(); - } - - LuxCoreRenderer::~LuxCoreRenderer() - { - LuxCoreRequestsBus::Handler::BusDisconnect(); - ClearLuxCore(); - } - - void LuxCoreRenderer::SetCameraEntityID(AZ::EntityId id) - { - m_cameraEntityId = id; - } - - void LuxCoreRenderer::AddMesh(Data::Asset modelAsset) - { - AZStd::string meshId = modelAsset->GetId().ToString(); - m_meshs.emplace(AZStd::piecewise_construct_t{}, - AZStd::forward_as_tuple(meshId), - AZStd::forward_as_tuple(modelAsset)); - } - - void LuxCoreRenderer::AddMaterial(Data::Instance material) - { - AZStd::string materialId = material->GetId().ToString(); - m_materials.emplace(AZStd::piecewise_construct_t{}, - AZStd::forward_as_tuple(materialId), - AZStd::forward_as_tuple(material)); - } - - void LuxCoreRenderer::AddTexture(Data::Instance image, LuxCoreTextureType type) - { - AZStd::string textureId = image->GetAssetId().ToString(); - m_textures.emplace(AZStd::piecewise_construct_t{}, - AZStd::forward_as_tuple(textureId), - AZStd::forward_as_tuple(image, type)); - } - - void LuxCoreRenderer::AddObject(AZ::Data::Asset modelAsset, AZ::Data::InstanceId materialInstanceId) - { - m_objects.emplace_back(modelAsset->GetId().ToString(), materialInstanceId.ToString()); - } - - bool LuxCoreRenderer::CheckTextureStatus() - { - for (auto it = m_textures.begin(); it != m_textures.end(); ++it) - { - if (!it->second.IsTextureReady()) - { - return false; - } - } - return true; - } - - void LuxCoreRenderer::ClearLuxCore() - { - m_meshs.clear(); - m_materials.clear(); - m_textures.clear(); - m_objects.clear(); - } - - void LuxCoreRenderer::ClearObject() - { - m_objects.clear(); - } - - void LuxCoreRenderer::RenderInLuxCore() - { - luxcore::Init(); - luxcore::Scene *luxCoreScene = luxcore::Scene::Create(); - - const char* folderName = "luxcoredata"; - if (!AZ::IO::FileIOBase::GetInstance()->Exists(folderName)) - { - AZ::IO::FileIOBase::GetInstance()->CreatePath(folderName); - } - - char resolvedPath[1024]; - AZ::IO::FileIOBase::GetInstance()->ResolvePath(folderName, resolvedPath, 1024); - - // Camera transform - if (!m_cameraEntityId.IsValid()) - { - AZ_Assert(false, "Please set camera entity id"); - return; - } - - AZ::Transform cameraTransform = AZ::Transform::CreateIdentity(); - AZ::Vector4 cameraUp, cameraFwd, cameraOrig, cameraTarget; - AZ::TransformBus::EventResult(cameraTransform, m_cameraEntityId, &AZ::TransformBus::Events::GetWorldTM); - - const AZ::Matrix4x4 rotationMatrix = AZ::Matrix4x4::CreateFromTransform(cameraTransform); - - cameraFwd = rotationMatrix.GetColumn(1); - cameraUp = rotationMatrix.GetColumn(2); - cameraOrig = rotationMatrix.GetColumn(3); - cameraTarget = cameraOrig + cameraFwd; - - // Camera parameter - float nearClip, farClip, fieldOfView; - Camera::CameraRequestBus::EventResult(fieldOfView, m_cameraEntityId, &Camera::CameraRequestBus::Events::GetFovDegrees); - Camera::CameraRequestBus::EventResult(nearClip, m_cameraEntityId, &Camera::CameraRequestBus::Events::GetNearClipDistance); - Camera::CameraRequestBus::EventResult(farClip, m_cameraEntityId, &Camera::CameraRequestBus::Events::GetFarClipDistance); - - // Set Camera - luxCoreScene->Parse( - luxrays::Property("scene.camera.lookat.orig")((float)cameraOrig.GetX(), (float)cameraOrig.GetY(), (float)cameraOrig.GetZ()) << - luxrays::Property("scene.camera.lookat.target")((float)cameraTarget.GetX(), (float)cameraTarget.GetY(), (float)cameraTarget.GetZ()) << - luxrays::Property("scene.camera.up")((float)cameraUp.GetX(), (float)cameraUp.GetY(), (float)cameraUp.GetZ()) << - luxrays::Property("scene.camera.fieldofview")(fieldOfView) << - luxrays::Property("scene.camera.cliphither")(nearClip) << - luxrays::Property("scene.camera.clipyon")(farClip) << - luxrays::Property("scene.camera.type")("perspective")); - - // Set Texture - try { - for (auto it = m_textures.begin(); it != m_textures.end(); ++it) - { - if (it->second.GetRawDataPointer() != nullptr) - { - if (it->second.IsIBLTexture()) - { - luxCoreScene->DefineImageMap(std::string(it->first.data()), static_cast(it->second.GetRawDataPointer()), 1.f, it->second.GetTextureChannels(), it->second.GetTextureWidth(), it->second.GetTextureHeight()); - } - else - { - luxCoreScene->DefineImageMap(std::string(it->first.data()), static_cast(it->second.GetRawDataPointer()), 1.f, it->second.GetTextureChannels(), it->second.GetTextureWidth(), it->second.GetTextureHeight()); - } - - luxCoreScene->Parse( - - it->second.GetLuxCoreTextureProperties() - ); - } - else - { - AZ_Assert(false, "texture data is nullptr!!!"); - return; - } - } - } - catch (const std::runtime_error& e) - { - (void)e; - AZ_Assert(false, "%s", e.what()); - return; - } - catch (const std::exception& e) - { - (void)e; - AZ_Assert(false, "%s", e.what()); - return; - } - - - // Set Material - try { - for (auto it = m_materials.begin(); it != m_materials.end(); ++it) - { - luxCoreScene->Parse( - it->second.GetLuxCoreMaterialProperties() - ); - } - } - catch (const std::exception& e) - { - (void)e; - AZ_Assert(false, "%s", e.what()); - return; - } - - // Set Model - try { - for (auto it = m_meshs.begin(); it != m_meshs.end(); ++it) - { - luxCoreScene->DefineMesh(std::string(it->second.GetMeshId().ToString().data()), - it->second.GetVertexCount(), - it->second.GetTriangleCount(), - const_cast(it->second.GetPositionData()), - const_cast(it->second.GetIndexData()), - const_cast(it->second.GetNormalData()), - const_cast(it->second.GetUVData()), - NULL, - NULL); - } - } - catch (const std::exception& e) - { - (void)e; - AZ_Assert(false, "%s", e.what()); - return; - } - - // Objects - try { - for (auto it = m_objects.begin(); it != m_objects.end(); ++it) - { - luxCoreScene->Parse( - it->GetLuxCoreObjectProperties() - ); - } - } - catch (const std::exception& e) - { - (void)e; - AZ_Assert(false, "%s", e.what()); - return; - } - - // RenderConfig - luxcore::RenderConfig *config = luxcore::RenderConfig::Create( - luxrays::Property("path.pathdepth.total")(7) << - luxrays::Property("path.pathdepth.diffuse")(5) << - luxrays::Property("path.pathdepth.glossy")(5) << - luxrays::Property("path.pathdepth.specular")(6) << - luxrays::Property("path.hybridbackforward.enable")(0) << - luxrays::Property("path.hybridbackforward.partition")(0) << - luxrays::Property("path.hybridbackforward.glossinessthreshold ")(0.05) << - luxrays::Property("path.forceblackbackground.enable")(0) << - luxrays::Property("film.noiseestimation.warmup")(8) << - luxrays::Property("film.noiseestimation.step")(32) << - luxrays::Property("film.width")(1920) << - luxrays::Property("film.height")(1080) << - luxrays::Property("film.filter.type")("BLACKMANHARRIS") << - luxrays::Property("film.filter.width")(1.5) << - luxrays::Property("film.imagepipelines.0.0.type")("NOP") << - luxrays::Property("film.imagepipelines.0.1.type")("GAMMA_CORRECTION") << - luxrays::Property("film.imagepipelines.0.1.value")(2.2f) << - luxrays::Property("film.imagepipelines.0.radiancescales.0.enabled")(1) << - luxrays::Property("film.imagepipelines.0.radiancescales.0.globalscale")(1) << - luxrays::Property("film.imagepipelines.0.radiancescales.0.rgbscale")(1, 1, 1) << - luxrays::Property("film.outputs.0.type")("RGB_IMAGEPIPELINE") << - luxrays::Property("film.outputs.0.index")(0) << - luxrays::Property("film.outputs.0.filename")("RGB_IMAGEPIPELINE_0.png") << - luxrays::Property("sampler.type")("SOBOL") << - luxrays::Property("renderengine.type")("PATHCPU") << - luxrays::Property("renderengine.seed")(1) << - luxrays::Property("lightstrategy.type")("LOG_POWER") << - luxrays::Property("scene.epsilon.min")(9.9999997473787516e-06f) << - luxrays::Property("scene.epsilon.max")(0.10000000149011612f) << - luxrays::Property("scene.epsilon.max")(0.10000000149011612f) << - luxrays::Property("batch.haltthreshold")(0.01953125f) << - luxrays::Property("batch.haltthreshold.warmup")(64) << - luxrays::Property("batch.haltthreshold.step")(64) << - luxrays::Property("batch.haltthreshold.filter.enable")(1) << - luxrays::Property("batch.haltthreshold.stoprendering.enable")(1) << - luxrays::Property("batch.haltspp")(0) << - luxrays::Property("batch.halttime")(0) << - luxrays::Property("filesaver.renderengine.type")("PATHCPU") << - luxrays::Property("filesaver.format")("TXT"), - luxCoreScene); - - - // Export - try { - config->Export(resolvedPath); - } - catch (const std::runtime_error& e) - { - (void)e; - AZ_Assert(false, "%s", e.what()); - return; - } - - // Run luxcoreui.exe - AZ::IO::FixedMaxPath luxCoreExeFullPath = AZ::Utils::GetEnginePath(); - luxCoreExeFullPath /= AZ_TRAIT_LUXCORE_EXEPATH; - - AZStd::string commandLine = "-o " + AZStd::string(resolvedPath) + "/render.cfg"; - - LuxCoreUI::LaunchLuxCoreUI(luxCoreExeFullPath.String(), commandLine); - } - } -} -#endif diff --git a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreRenderer.h b/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreRenderer.h deleted file mode 100644 index 9c9f8039f5..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreRenderer.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#pragma once - -#include -#if AZ_TRAIT_LUXCORE_SUPPORTED - -#include -#include "LuxCoreMaterial.h" -#include "LuxCoreMesh.h" -#include "LuxCoreObject.h" -#include "LuxCoreTexture.h" - -namespace AZ -{ - namespace Render - { - // Hold all converted data, write scene and render file to disk when command received - // Can be extend to do real-time rendering in the future - class LuxCoreRenderer - : public LuxCoreRequestsBus::Handler - { - public: - LuxCoreRenderer(); - ~LuxCoreRenderer(); - - //////////////////////////////////////////////////////////////////////// - // LuxCoreRequestsBus - void SetCameraEntityID(AZ::EntityId id); - void AddMesh( Data::Asset modelAsset); - void AddMaterial(Data::Instance material); - void AddTexture(Data::Instance image, LuxCoreTextureType type); - void AddObject(AZ::Data::Asset modelAsset, AZ::Data::InstanceId materialInstanceId); - bool CheckTextureStatus(); - void RenderInLuxCore(); - void ClearLuxCore(); - void ClearObject(); - ///////////////////////////////////////////////////////////////////////// - - private: - AZ::EntityId m_cameraEntityId; - AZ::Transform m_cameraTransform; - - AZStd::unordered_map m_meshs; - AZStd::unordered_map m_materials; - AZStd::unordered_map m_textures; - AZStd::vector m_objects; - }; - } -} -#endif diff --git a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreTexture.cpp b/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreTexture.cpp deleted file mode 100644 index 1fd8f0d91c..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreTexture.cpp +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * 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 -#if AZ_TRAIT_LUXCORE_SUPPORTED - -#include "LuxCoreTexture.h" -#include -#include - -namespace AZ -{ - namespace Render - { - LuxCoreTexture::LuxCoreTexture(AZ::Data::Instance image, LuxCoreTextureType type) - { - Init(image, type); - } - - LuxCoreTexture::LuxCoreTexture(const LuxCoreTexture &texture) - { - Init(texture.m_texture, texture.m_type); - } - - LuxCoreTexture::~LuxCoreTexture() - { - if (m_rtPipeline) - { - m_rtPipeline->RemoveFromScene(); - m_rtPipeline = nullptr; - } - - if (m_texture) - { - m_texture = nullptr; - } - } - - void LuxCoreTexture::Init(AZ::Data::Instance image, LuxCoreTextureType type) - { - m_textureAssetId = image->GetAssetId(); - m_texture = image; - m_type = type; - - if (m_type == LuxCoreTextureType::IBL) - { - m_luxCoreTextureName = "scene.lights." + m_textureAssetId.ToString(); - m_luxCoreTexture = m_luxCoreTexture << luxrays::Property(std::string(m_luxCoreTextureName.data()) + ".type")("infinite"); - } - else - { - m_luxCoreTextureName = "scene.textures." + m_textureAssetId.ToString(); - m_luxCoreTexture = m_luxCoreTexture << luxrays::Property(std::string(m_luxCoreTextureName.data()) + ".type")("imagemap"); - } - - m_luxCoreTexture = m_luxCoreTexture << luxrays::Property(std::string(m_luxCoreTextureName.data()) + ".file")(std::string(m_textureAssetId.ToString().data())); - m_textureChannels = 4; - - AddRenderTargetPipeline(); - } - - void LuxCoreTexture::AddRenderTargetPipeline() - { - // Render Texture pipeline - AZ::RPI::RenderPipelineDescriptor pipelineDesc; - pipelineDesc.m_name = m_textureAssetId.ToString(); - pipelineDesc.m_rootPassTemplate = "LuxCoreTexturePassTemplate"; - m_rtPipeline = AZ::RPI::RenderPipeline::CreateRenderPipeline(pipelineDesc); - - // Set source texture - AZ::RPI::Pass* rootPass = m_rtPipeline->GetRootPass().get(); - AZ_Assert(rootPass != nullptr, "Failed to get root pass for render target pipeline"); - LuxCoreTexturePass* parentPass = static_cast(rootPass); - - // Setup call back to save read back data to m_textureData - RPI::AttachmentReadback::CallbackFunction callback = - [this](const AZ::RPI::AttachmentReadback::ReadbackResult& readbackResult) - { - RHI::ImageSubresourceLayout imageLayout = RHI::GetImageSubresourceLayout(readbackResult.m_imageDescriptor.m_size, - readbackResult.m_imageDescriptor.m_format); - m_textureData.resize_no_construct(imageLayout.m_bytesPerImage); - memcpy(m_textureData.data(), readbackResult.m_dataBuffer->data(), imageLayout.m_bytesPerImage); - - m_textureReadbackComplete = true; - }; - parentPass->SetReadbackCallback(callback); - - switch (m_type) - { - case LuxCoreTextureType::Default: - // assume a 8 bits linear texture - parentPass->SetSourceTexture(m_texture, RHI::Format::R8G8B8A8_UNORM); - break; - case LuxCoreTextureType::IBL: - // assume its a float image if its an IBL source - parentPass->SetSourceTexture(m_texture, RHI::Format::R32G32B32A32_FLOAT); - break; - case LuxCoreTextureType::Albedo: - // albedo texture is in sRGB space - parentPass->SetSourceTexture(m_texture, RHI::Format::R8G8B8A8_UNORM_SRGB); - break; - case LuxCoreTextureType::Normal: - // Normal texture needs special handling - parentPass->SetIsNormalTexture(true); - parentPass->SetSourceTexture(m_texture, RHI::Format::R8G8B8A8_UNORM); - break; - } - - const auto mainScene = AZ::RPI::RPISystemInterface::Get()->GetSceneByName(AZ::Name("RPI")); - if (mainScene) - { - mainScene->AddRenderPipeline(m_rtPipeline); - } - } - - bool LuxCoreTexture::IsIBLTexture() - { - return m_type == LuxCoreTextureType::IBL; - } - - void* LuxCoreTexture::GetRawDataPointer() - { - return (void*)m_textureData.data(); - } - - unsigned int LuxCoreTexture::GetTextureWidth() - { - return m_texture->GetRHIImage()->GetDescriptor().m_size.m_width; - } - - unsigned int LuxCoreTexture::GetTextureHeight() - { - return m_texture->GetRHIImage()->GetDescriptor().m_size.m_height; - } - - unsigned int LuxCoreTexture::GetTextureChannels() - { - return m_textureChannels; - } - - luxrays::Properties LuxCoreTexture::GetLuxCoreTextureProperties() - { - return m_luxCoreTexture; - } - - bool LuxCoreTexture::IsTextureReady() - { - return m_textureReadbackComplete; - } - } -} -#endif diff --git a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreTexture.h b/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreTexture.h deleted file mode 100644 index abfb7cfe13..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreTexture.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#pragma once - - -#include -#if AZ_TRAIT_LUXCORE_SUPPORTED - -#include -#include -#include -#include - -namespace AZ -{ - namespace Render - { - // Build a pipeline to get raw data from runtime texture - class LuxCoreTexture final - { - public: - LuxCoreTexture() = default; - LuxCoreTexture( AZ::Data::Instance image, LuxCoreTextureType type); - LuxCoreTexture(const LuxCoreTexture &texture); - ~LuxCoreTexture(); - - void* GetRawDataPointer(); - - unsigned int GetTextureWidth(); - unsigned int GetTextureHeight(); - unsigned int GetTextureChannels(); - - void Init(AZ::Data::Instance image, LuxCoreTextureType type); - - void AddRenderTargetPipeline(); - luxrays::Properties GetLuxCoreTextureProperties(); - bool IsIBLTexture(); - bool IsTextureReady(); - - private: - AZStd::string m_luxCoreTextureName; - luxrays::Properties m_luxCoreTexture; - - AZ::RPI::RenderPipelinePtr m_rtPipeline = nullptr; - - AZStd::vector m_textureData; - AZ::Data::Instance m_texture; - unsigned int m_textureChannels = 4; - - Data::AssetId m_textureAssetId; - LuxCoreTextureType m_type = LuxCoreTextureType::Default; - - bool m_textureReadbackComplete = false; - }; - } -} -#endif diff --git a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreTexturePass.cpp b/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreTexturePass.cpp deleted file mode 100644 index 721e8b0c90..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/LuxCore/LuxCoreTexturePass.cpp +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#include -#include - -#include - -namespace AZ -{ - namespace Render - { - RPI::Ptr LuxCoreTexturePass::Create(const RPI::PassDescriptor& descriptor) - { - RPI::Ptr pass = aznew LuxCoreTexturePass(descriptor); - return pass; - } - - LuxCoreTexturePass::LuxCoreTexturePass(const RPI::PassDescriptor& descriptor) - : ParentPass(descriptor) - { - RPI::PassSystemInterface* passSystem = RPI::PassSystemInterface::Get(); - - // Create render target pass - RPI::PassRequest request; - request.m_templateName = "RenderTextureTemplate"; - request.m_passName = "RenderTarget"; - m_renderTargetPass = passSystem->CreatePassFromRequest(&request); - AZ_Assert(m_renderTargetPass, "render target pass is invalid"); - - // Create readback - m_readback = AZStd::make_shared(AZ::RHI::ScopeId{ Uuid::CreateRandom().ToString() }); - } - - LuxCoreTexturePass::~LuxCoreTexturePass() - { - m_renderTargetPass = nullptr; - m_readback = nullptr; - } - - void LuxCoreTexturePass::SetSourceTexture(AZ::Data::Instance image, RHI::Format format) - { - static_cast(m_renderTargetPass.get())->SetPassSrgImage(image, format); - } - - void LuxCoreTexturePass::CreateChildPassesInternal() - { - AddChild(m_renderTargetPass); - } - - void LuxCoreTexturePass::BuildInternal() - { - ParentPass::BuildInternal(); - } - - void LuxCoreTexturePass::FrameBeginInternal(FramePrepareParams params) - { - if (!m_attachmentReadbackComplete && m_readback != nullptr) - { - // Set up read back attachment before children prepare - if (m_readback->IsReady()) - { - if (m_renderTargetPass) - { - m_attachmentReadbackComplete = m_renderTargetPass->ReadbackAttachment(m_readback, AZ::Name("RenderTargetOutput")); - } - } - } - ParentPass::FrameBeginInternal(params); - } - - void LuxCoreTexturePass::SetIsNormalTexture(bool isNormal) - { - static_cast(m_renderTargetPass.get())->InitShaderVariant(isNormal); - } - - void LuxCoreTexturePass::SetReadbackCallback(RPI::AttachmentReadback::CallbackFunction callbackFunciton) - { - if (m_readback != nullptr) - { - m_readback->SetCallback(callbackFunciton); - } - } - } -} diff --git a/Gems/Atom/Feature/Common/Code/Source/LuxCore/RenderTexturePass.cpp b/Gems/Atom/Feature/Common/Code/Source/LuxCore/RenderTexturePass.cpp deleted file mode 100644 index c890da596b..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/LuxCore/RenderTexturePass.cpp +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#include -#include - -namespace AZ -{ - namespace Render - { - RPI::Ptr RenderTexturePass::Create(const RPI::PassDescriptor& descriptor) - { - RPI::Ptr pass = aznew RenderTexturePass(descriptor); - return pass; - } - - RenderTexturePass::RenderTexturePass(const RPI::PassDescriptor& descriptor) - : FullscreenTrianglePass(descriptor) - { - m_textureIndex = m_shaderResourceGroup->FindShaderInputImageIndex(Name("m_sourceTexture")); - } - - RenderTexturePass::~RenderTexturePass() - { - } - - void RenderTexturePass::SetPassSrgImage(AZ::Data::Instance image, RHI::Format format) - { - m_attachmentSize = image->GetRHIImage()->GetDescriptor().m_size; - m_attachmentFormat = format; - m_shaderResourceGroup->SetImage(m_textureIndex, image); - QueueForBuildAndInitialization(); - } - - void RenderTexturePass::BuildInternal() - { - UpdataAttachment(); - FullscreenTrianglePass::BuildInternal(); - } - - void RenderTexturePass::FrameBeginInternal(FramePrepareParams params) - { - FullscreenTrianglePass::FrameBeginInternal(params); - } - - void RenderTexturePass::UpdataAttachment() - { - // [GFX TODO][ATOM-2470] stop caring about attachment - RPI::Ptr attachment = m_ownedAttachments.front(); - if (!attachment) - { - AZ_Assert(false, "[RenderTexturePass %s] Cannot find any image attachment.", GetPathName().GetCStr()); - return; - } - AZ_Assert(attachment->m_descriptor.m_type == RHI::AttachmentType::Image, "[RenderTexturePass %s] requires an image attachment", GetPathName().GetCStr()); - - RPI::PassAttachmentBinding& binding = GetOutputBinding(0); - binding.m_attachment = attachment; - - RHI::ImageDescriptor& imageDescriptor = attachment->m_descriptor.m_image; - imageDescriptor.m_size = m_attachmentSize; - imageDescriptor.m_format = m_attachmentFormat; - } - - RHI::AttachmentId RenderTexturePass::GetRenderTargetId() - { - return m_ownedAttachments.front()->GetAttachmentId(); - } - - void RenderTexturePass::InitShaderVariant(bool isNormal) - { - auto shaderOption = m_shader->CreateShaderOptionGroup(); - RPI::ShaderOptionValue isNormalOption{ isNormal }; - shaderOption.SetValue(AZ::Name("o_isNormal"), isNormalOption); - - RPI::ShaderVariantSearchResult result = m_shader->FindVariantStableId(shaderOption.GetShaderVariantId()); - m_shaderVariantStableId = result.GetStableId(); - - if (!result.IsFullyBaked() && m_drawShaderResourceGroup->HasShaderVariantKeyFallbackEntry()) - { - m_drawShaderResourceGroup->SetShaderVariantKeyFallbackValue(shaderOption.GetShaderVariantId().m_key); - } - } - } -} diff --git a/Gems/Atom/Feature/Common/Code/Source/Platform/Android/Atom_Feature_Traits_Android.h b/Gems/Atom/Feature/Common/Code/Source/Platform/Android/Atom_Feature_Traits_Android.h index f2501f3366..40f06f7191 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Platform/Android/Atom_Feature_Traits_Android.h +++ b/Gems/Atom/Feature/Common/Code/Source/Platform/Android/Atom_Feature_Traits_Android.h @@ -7,6 +7,5 @@ */ #pragma once -#define AZ_TRAIT_LUXCORE_SUPPORTED 0 -#define AZ_TRAIT_LUXCORE_EXEPATH UNUSED_TRAIT #define AZ_TRAIT_DIFFUSE_GI_PASSES_SUPPORTED 1 + diff --git a/Gems/Atom/Feature/Common/Code/Source/Platform/Common/Clang/atom_feature_common_clang.cmake b/Gems/Atom/Feature/Common/Code/Source/Platform/Common/Clang/atom_feature_common_clang.cmake index b3f7867308..7a325ca97e 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Platform/Common/Clang/atom_feature_common_clang.cmake +++ b/Gems/Atom/Feature/Common/Code/Source/Platform/Common/Clang/atom_feature_common_clang.cmake @@ -5,9 +5,3 @@ # SPDX-License-Identifier: Apache-2.0 OR MIT # # - -set_source_files_properties( - Source/LuxCore/LuxCoreRenderer.cpp - PROPERTIES - COMPILE_OPTIONS -fexceptions -) diff --git a/Gems/Atom/Feature/Common/Code/Source/Platform/Common/MSVC/atom_feature_common_msvc.cmake b/Gems/Atom/Feature/Common/Code/Source/Platform/Common/MSVC/atom_feature_common_msvc.cmake index 9b5c59d310..7a325ca97e 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Platform/Common/MSVC/atom_feature_common_msvc.cmake +++ b/Gems/Atom/Feature/Common/Code/Source/Platform/Common/MSVC/atom_feature_common_msvc.cmake @@ -5,9 +5,3 @@ # SPDX-License-Identifier: Apache-2.0 OR MIT # # - -set_source_files_properties( - Source/LuxCore/LuxCoreRenderer.cpp - PROPERTIES - COMPILE_OPTIONS /EHsc -) diff --git a/Gems/Atom/Feature/Common/Code/Source/Platform/Linux/Atom_Feature_Traits_Linux.h b/Gems/Atom/Feature/Common/Code/Source/Platform/Linux/Atom_Feature_Traits_Linux.h index f2501f3366..40f06f7191 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Platform/Linux/Atom_Feature_Traits_Linux.h +++ b/Gems/Atom/Feature/Common/Code/Source/Platform/Linux/Atom_Feature_Traits_Linux.h @@ -7,6 +7,5 @@ */ #pragma once -#define AZ_TRAIT_LUXCORE_SUPPORTED 0 -#define AZ_TRAIT_LUXCORE_EXEPATH UNUSED_TRAIT #define AZ_TRAIT_DIFFUSE_GI_PASSES_SUPPORTED 1 + diff --git a/Gems/Atom/Feature/Common/Code/Source/Platform/Mac/Atom_Feature_Traits_Mac.h b/Gems/Atom/Feature/Common/Code/Source/Platform/Mac/Atom_Feature_Traits_Mac.h index f2501f3366..40f06f7191 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Platform/Mac/Atom_Feature_Traits_Mac.h +++ b/Gems/Atom/Feature/Common/Code/Source/Platform/Mac/Atom_Feature_Traits_Mac.h @@ -7,6 +7,5 @@ */ #pragma once -#define AZ_TRAIT_LUXCORE_SUPPORTED 0 -#define AZ_TRAIT_LUXCORE_EXEPATH UNUSED_TRAIT #define AZ_TRAIT_DIFFUSE_GI_PASSES_SUPPORTED 1 + diff --git a/Gems/Atom/Feature/Common/Code/Source/Platform/Windows/Atom_Feature_Traits_Windows.h b/Gems/Atom/Feature/Common/Code/Source/Platform/Windows/Atom_Feature_Traits_Windows.h index 71c521a7f2..40f06f7191 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Platform/Windows/Atom_Feature_Traits_Windows.h +++ b/Gems/Atom/Feature/Common/Code/Source/Platform/Windows/Atom_Feature_Traits_Windows.h @@ -7,6 +7,5 @@ */ #pragma once -#define AZ_TRAIT_LUXCORE_SUPPORTED 0 -#define AZ_TRAIT_LUXCORE_EXEPATH "Gems/Atom/Feature/Common/External/LuxCore2.2/win64/dll/luxcoreui.exe" #define AZ_TRAIT_DIFFUSE_GI_PASSES_SUPPORTED 1 + diff --git a/Gems/Atom/Feature/Common/Code/Source/Platform/Windows/LaunchLuxCoreUI_Windows.cpp b/Gems/Atom/Feature/Common/Code/Source/Platform/Windows/LaunchLuxCoreUI_Windows.cpp deleted file mode 100644 index 7f15949201..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/Platform/Windows/LaunchLuxCoreUI_Windows.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#include -#include -#include - -namespace LuxCoreUI -{ - void LaunchLuxCoreUI(const AZStd::string& luxCoreExeFullPath, const AZStd::string& commandLine) - { - STARTUPINFO si; - PROCESS_INFORMATION pi; - - ZeroMemory(&si, sizeof(si)); - si.cb = sizeof(si); - ZeroMemory(&pi, sizeof(pi)); - - AZStd::wstring luxCoreExeFullPathW; - AZStd::to_wstring(luxCoreExeFullPathW, luxCoreExeFullPath.c_str()); - AZStd::wstring commandLineW; - AZStd::to_wstring(commandLineW, commandLine.c_str()); - - // start the program up - CreateProcessW(luxCoreExeFullPathW.c_str(), // the path - commandLineW.data(), // Command line - NULL, // Process handle not inheritable - NULL, // Thread handle not inheritable - FALSE, // Set handle inheritance to FALSE - 0, // No creation flags - NULL, // Use parent's environment block - NULL, // Use parent's starting directory - &si, // Pointer to STARTUPINFO structure - &pi // Pointer to PROCESS_INFORMATION structure (removed extra parentheses) - ); - // Close process and thread handles. - CloseHandle(pi.hProcess); - CloseHandle(pi.hThread); - } -} diff --git a/Gems/Atom/Feature/Common/Code/Source/Platform/Windows/platform_windows_files.cmake b/Gems/Atom/Feature/Common/Code/Source/Platform/Windows/platform_windows_files.cmake index 95d27d01ac..4acf1599f5 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Platform/Windows/platform_windows_files.cmake +++ b/Gems/Atom/Feature/Common/Code/Source/Platform/Windows/platform_windows_files.cmake @@ -9,5 +9,4 @@ set(FILES Atom_Feature_Traits_Platform.h Atom_Feature_Traits_Windows.h - LaunchLuxCoreUI_Windows.cpp ) diff --git a/Gems/Atom/Feature/Common/Code/Source/Platform/iOS/Atom_Feature_Traits_iOS.h b/Gems/Atom/Feature/Common/Code/Source/Platform/iOS/Atom_Feature_Traits_iOS.h index f2501f3366..40f06f7191 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Platform/iOS/Atom_Feature_Traits_iOS.h +++ b/Gems/Atom/Feature/Common/Code/Source/Platform/iOS/Atom_Feature_Traits_iOS.h @@ -7,6 +7,5 @@ */ #pragma once -#define AZ_TRAIT_LUXCORE_SUPPORTED 0 -#define AZ_TRAIT_LUXCORE_EXEPATH UNUSED_TRAIT #define AZ_TRAIT_DIFFUSE_GI_PASSES_SUPPORTED 1 + diff --git a/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake b/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake index 900e71717c..375dbd9724 100644 --- a/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake +++ b/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake @@ -46,9 +46,6 @@ set(FILES Include/Atom/Feature/Utils/MultiSparseVector.h Include/Atom/Feature/Utils/ProfilingCaptureBus.h Include/Atom/Feature/Utils/SparseVector.h - Include/Atom/Feature/LuxCore/LuxCoreBus.h - Include/Atom/Feature/LuxCore/LuxCoreTexturePass.h - Include/Atom/Feature/LuxCore/RenderTexturePass.h Source/CommonModule.cpp Source/CommonSystemComponent.cpp Source/FrameCaptureSystemComponent.cpp @@ -317,18 +314,6 @@ set(FILES Source/SkyBox/SkyBoxFogSettings.cpp Source/TransformService/TransformServiceFeatureProcessor.cpp Source/Utils/GpuBufferHandler.cpp - Source/LuxCore/LuxCoreTexturePass.cpp - Source/LuxCore/RenderTexturePass.cpp - Source/LuxCore/LuxCoreMaterial.cpp - Source/LuxCore/LuxCoreMaterial.h - Source/LuxCore/LuxCoreMesh.cpp - Source/LuxCore/LuxCoreMesh.h - Source/LuxCore/LuxCoreObject.cpp - Source/LuxCore/LuxCoreObject.h - Source/LuxCore/LuxCoreRenderer.cpp - Source/LuxCore/LuxCoreRenderer.h - Source/LuxCore/LuxCoreTexture.cpp - Source/LuxCore/LuxCoreTexture.h ) set(SKIP_UNITY_BUILD_INCLUSION_FILES diff --git a/cmake/3rdParty/Platform/Android/BuiltInPackages_android.cmake b/cmake/3rdParty/Platform/Android/BuiltInPackages_android.cmake index 6bd50861c7..c6a262926c 100644 --- a/cmake/3rdParty/Platform/Android/BuiltInPackages_android.cmake +++ b/cmake/3rdParty/Platform/Android/BuiltInPackages_android.cmake @@ -14,7 +14,7 @@ ly_associate_package(PACKAGE_NAME cityhash-1.1-multiplatform TARGETS cit ly_associate_package(PACKAGE_NAME expat-2.1.0-multiplatform TARGETS expat PACKAGE_HASH 452256acd1fd699cef24162575b3524fccfb712f5321c83f1df1ce878de5b418) ly_associate_package(PACKAGE_NAME zstd-1.35-multiplatform TARGETS zstd PACKAGE_HASH 45d466c435f1095898578eedde85acf1fd27190e7ea99aeaa9acfd2f09e12665) ly_associate_package(PACKAGE_NAME glad-2.0.0-beta-rev2-multiplatform TARGETS glad PACKAGE_HASH ff97ee9664e97d0854b52a3734c2289329d9f2b4cd69478df6d0ca1f1c9392ee) -ly_associate_package(PACKAGE_NAME lux_core-2.2-rev5-multiplatform TARGETS lux_core PACKAGE_HASH c8c13cf7bc351643e1abd294d0841b24dee60e51647dff13db7aec396ad1e0b5) + # platform-specific: ly_associate_package(PACKAGE_NAME tiff-4.2.0.15-rev4-android TARGETS TIFF PACKAGE_HASH 2c62cdf34a8ee6c7eb091d05d98f60b4da7634c74054d4dbb8736886182f4589) ly_associate_package(PACKAGE_NAME freetype-2.10.4.16-android TARGETS freetype PACKAGE_HASH df9e4d559ea0f03b0666b48c79813b1cd4d9624429148a249865de9f5c2c11cd) diff --git a/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake b/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake index 5c84fc3198..109ae75f38 100644 --- a/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake +++ b/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake @@ -18,7 +18,6 @@ ly_associate_package(PACKAGE_NAME expat-2.1.0-multiplatform ly_associate_package(PACKAGE_NAME zstd-1.35-multiplatform TARGETS zstd PACKAGE_HASH 45d466c435f1095898578eedde85acf1fd27190e7ea99aeaa9acfd2f09e12665) ly_associate_package(PACKAGE_NAME SQLite-3.32.2-rev3-multiplatform TARGETS SQLite PACKAGE_HASH dd4d3de6cbb4ce3d15fc504ba0ae0587e515dc89a25228037035fc0aef4831f4) ly_associate_package(PACKAGE_NAME glad-2.0.0-beta-rev2-multiplatform TARGETS glad PACKAGE_HASH ff97ee9664e97d0854b52a3734c2289329d9f2b4cd69478df6d0ca1f1c9392ee) -ly_associate_package(PACKAGE_NAME lux_core-2.2-rev5-multiplatform TARGETS lux_core PACKAGE_HASH c8c13cf7bc351643e1abd294d0841b24dee60e51647dff13db7aec396ad1e0b5) ly_associate_package(PACKAGE_NAME xxhash-0.7.4-rev1-multiplatform TARGETS xxhash PACKAGE_HASH e81f3e6c4065975833996dd1fcffe46c3cf0f9e3a4207ec5f4a1b564ba75861e) # platform-specific: diff --git a/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake b/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake index 994f42e983..35a6b87c6c 100644 --- a/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake +++ b/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake @@ -18,7 +18,6 @@ ly_associate_package(PACKAGE_NAME expat-2.1.0-multiplatform ly_associate_package(PACKAGE_NAME zstd-1.35-multiplatform TARGETS zstd PACKAGE_HASH 45d466c435f1095898578eedde85acf1fd27190e7ea99aeaa9acfd2f09e12665) ly_associate_package(PACKAGE_NAME SQLite-3.32.2-rev3-multiplatform TARGETS SQLite PACKAGE_HASH dd4d3de6cbb4ce3d15fc504ba0ae0587e515dc89a25228037035fc0aef4831f4) ly_associate_package(PACKAGE_NAME glad-2.0.0-beta-rev2-multiplatform TARGETS glad PACKAGE_HASH ff97ee9664e97d0854b52a3734c2289329d9f2b4cd69478df6d0ca1f1c9392ee) -ly_associate_package(PACKAGE_NAME lux_core-2.2-rev5-multiplatform TARGETS lux_core PACKAGE_HASH c8c13cf7bc351643e1abd294d0841b24dee60e51647dff13db7aec396ad1e0b5) ly_associate_package(PACKAGE_NAME xxhash-0.7.4-rev1-multiplatform TARGETS xxhash PACKAGE_HASH e81f3e6c4065975833996dd1fcffe46c3cf0f9e3a4207ec5f4a1b564ba75861e) # platform-specific: diff --git a/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake b/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake index 6e2d2a92e2..90d44a3658 100644 --- a/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake +++ b/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake @@ -18,7 +18,6 @@ ly_associate_package(PACKAGE_NAME expat-2.1.0-multiplatform ly_associate_package(PACKAGE_NAME zstd-1.35-multiplatform TARGETS zstd PACKAGE_HASH 45d466c435f1095898578eedde85acf1fd27190e7ea99aeaa9acfd2f09e12665) ly_associate_package(PACKAGE_NAME SQLite-3.32.2-rev3-multiplatform TARGETS SQLite PACKAGE_HASH dd4d3de6cbb4ce3d15fc504ba0ae0587e515dc89a25228037035fc0aef4831f4) ly_associate_package(PACKAGE_NAME glad-2.0.0-beta-rev2-multiplatform TARGETS glad PACKAGE_HASH ff97ee9664e97d0854b52a3734c2289329d9f2b4cd69478df6d0ca1f1c9392ee) -ly_associate_package(PACKAGE_NAME lux_core-2.2-rev5-multiplatform TARGETS lux_core PACKAGE_HASH c8c13cf7bc351643e1abd294d0841b24dee60e51647dff13db7aec396ad1e0b5) ly_associate_package(PACKAGE_NAME xxhash-0.7.4-rev1-multiplatform TARGETS xxhash PACKAGE_HASH e81f3e6c4065975833996dd1fcffe46c3cf0f9e3a4207ec5f4a1b564ba75861e) # platform-specific: diff --git a/cmake/3rdParty/Platform/iOS/BuiltInPackages_ios.cmake b/cmake/3rdParty/Platform/iOS/BuiltInPackages_ios.cmake index 1eea5082da..d8dd7e8134 100644 --- a/cmake/3rdParty/Platform/iOS/BuiltInPackages_ios.cmake +++ b/cmake/3rdParty/Platform/iOS/BuiltInPackages_ios.cmake @@ -14,7 +14,6 @@ ly_associate_package(PACKAGE_NAME cityhash-1.1-multiplatform TARGETS cit ly_associate_package(PACKAGE_NAME expat-2.1.0-multiplatform TARGETS expat PACKAGE_HASH 452256acd1fd699cef24162575b3524fccfb712f5321c83f1df1ce878de5b418) ly_associate_package(PACKAGE_NAME zstd-1.35-multiplatform TARGETS zstd PACKAGE_HASH 45d466c435f1095898578eedde85acf1fd27190e7ea99aeaa9acfd2f09e12665) ly_associate_package(PACKAGE_NAME glad-2.0.0-beta-rev2-multiplatform TARGETS glad PACKAGE_HASH ff97ee9664e97d0854b52a3734c2289329d9f2b4cd69478df6d0ca1f1c9392ee) -ly_associate_package(PACKAGE_NAME lux_core-2.2-rev5-multiplatform TARGETS lux_core PACKAGE_HASH c8c13cf7bc351643e1abd294d0841b24dee60e51647dff13db7aec396ad1e0b5) # platform-specific: ly_associate_package(PACKAGE_NAME tiff-4.2.0.15-rev3-ios TARGETS TIFF PACKAGE_HASH e9067e88649fb6e93a926d9ed38621a9fae360a2e6f6eb24ebca63c1bc7761ea) From 1a26ea439aab0b43dd1a591587801c3caf72d141 Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Wed, 22 Dec 2021 09:07:42 -0800 Subject: [PATCH 229/948] bugfix[Linux]: resolve Lua script file not found (#6369) * bugfix: resolve Lua script file not found REF: https://github.com/o3de/o3de/issues/5899 Signed-off-by: Michael Pollind * chore: user lowcase version of assetIdLower Signed-off-by: Michael Pollind --- .../LuaIDE/Source/LUA/LUAEditorContext.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Code/Tools/LuaIDE/Source/LUA/LUAEditorContext.cpp b/Code/Tools/LuaIDE/Source/LUA/LUAEditorContext.cpp index f36724ee1a..533a89a77c 100644 --- a/Code/Tools/LuaIDE/Source/LUA/LUAEditorContext.cpp +++ b/Code/Tools/LuaIDE/Source/LUA/LUAEditorContext.cpp @@ -1433,7 +1433,8 @@ namespace LUAEditor return; } - AZStd::to_lower(const_cast(assetId).begin(), const_cast(assetId).end()); + AZStd::string assetIdLower(assetId); + AZStd::to_lower(assetIdLower.begin(), assetIdLower.end()); ShowLUAEditorView(); @@ -1446,11 +1447,11 @@ namespace LUAEditor // * we need to load that lua panel with the document's data, initializing it. // are we already tracking it? - auto it = m_documentInfoMap.find(assetId); + auto it = m_documentInfoMap.find(assetIdLower); if (it != m_documentInfoMap.end()) { // tell the view that it needs to focus that document! - mostRecentlyOpenedDocumentView = assetId; + mostRecentlyOpenedDocumentView = assetIdLower; if (m_queuedOpenRecent) { return; @@ -1482,14 +1483,14 @@ namespace LUAEditor // Register the script into the asset catalog AZ::Data::AssetType assetType = AZ::AzTypeInfo::Uuid(); AZ::Data::AssetId catalogAssetId; - EBUS_EVENT_RESULT(catalogAssetId, AZ::Data::AssetCatalogRequestBus, GetAssetIdByPath, assetId.c_str(), assetType, true); + EBUS_EVENT_RESULT(catalogAssetId, AZ::Data::AssetCatalogRequestBus, GetAssetIdByPath, assetIdLower.c_str(), assetType, true); uint64_t modTime = m_fileIO->ModificationTime(assetId.c_str()); DocumentInfo info; - info.m_assetName = assetId; + info.m_assetName = assetIdLower; AzFramework::StringFunc::Path::GetFullFileName(assetId.c_str(), info.m_displayName); - info.m_assetId = assetId; + info.m_assetId = assetIdLower; info.m_bSourceControl_BusyGettingStats = true; info.m_bSourceControl_BusyGettingStats = false; info.m_bSourceControl_CanWrite = true; @@ -1532,7 +1533,7 @@ namespace LUAEditor luaFile.Close(); } - DataLoadDoneCallback(isLoaded, assetId); + DataLoadDoneCallback(isLoaded, assetIdLower); ////////////////////////////////////////////////////////////////////////// if (m_queuedOpenRecent) @@ -1545,7 +1546,7 @@ namespace LUAEditor m_pLUAEditorMainWindow->IgnoreFocusEvents(false); } - mostRecentlyOpenedDocumentView = assetId; + mostRecentlyOpenedDocumentView = assetIdLower; EBUS_QUEUE_FUNCTION(AZ::SystemTickBus, &Context::OpenMostRecentDocumentView, this); } From 67689d48cc0f142eccd4856b0686277b49ca42d0 Mon Sep 17 00:00:00 2001 From: rgba16f <82187279+rgba16f@users.noreply.github.com> Date: Wed, 22 Dec 2021 11:29:48 -0600 Subject: [PATCH 230/948] Add precise keyword to the depth and forward pass shaders. (#6536) * Add precise keyword to the depth and forward pass shaders. Make sure metal shader pipeline passes the invariant along Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com> * Update with VickyAtAZ's feedback, split the preserve invariance into a separate string Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com> * Fix attribute comment alignment in the shaders Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com> --- .../Code/Source/Editor/AzslShaderBuilderSystemComponent.cpp | 3 +-- .../Materials/Types/StandardPBR_DepthPass_WithPS.azsl | 2 +- .../Assets/Materials/Types/StandardPBR_ForwardPass.azsl | 2 +- .../Atom/Features/PBR/Surfaces/BasePbrSurfaceData.azsli | 2 +- .../Atom/Features/PBR/Surfaces/StandardSurface.azsli | 2 +- .../Code/Source/RHI.Builders/ShaderPlatformInterface.cpp | 6 ++++-- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslShaderBuilderSystemComponent.cpp b/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslShaderBuilderSystemComponent.cpp index 99b7c814d1..cc80b38b85 100644 --- a/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslShaderBuilderSystemComponent.cpp +++ b/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslShaderBuilderSystemComponent.cpp @@ -82,8 +82,7 @@ namespace AZ // Register Shader Asset Builder AssetBuilderSDK::AssetBuilderDesc shaderAssetBuilderDescriptor; shaderAssetBuilderDescriptor.m_name = "Shader Asset Builder"; - shaderAssetBuilderDescriptor.m_version = 108; // The Build Time Stamp of ShaderAsset And ShaderVariantAsset Should Be Based On GetTimeUTCMilliSecond() - // .shader file changes trigger rebuilds + shaderAssetBuilderDescriptor.m_version = 109; // Modify Metal shader platform to permit the precise keyword to fix depth bitwise mismatch between passes shaderAssetBuilderDescriptor.m_patterns.push_back(AssetBuilderSDK::AssetBuilderPattern( AZStd::string::format("*.%s", RPI::ShaderSourceData::Extension), AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard)); shaderAssetBuilderDescriptor.m_busId = azrtti_typeid(); shaderAssetBuilderDescriptor.m_createJobFunction = AZStd::bind(&ShaderAssetBuilder::CreateJobs, &m_shaderAssetBuilder, AZStd::placeholders::_1, AZStd::placeholders::_2); diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_DepthPass_WithPS.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_DepthPass_WithPS.azsl index 136841907b..264542cd0a 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_DepthPass_WithPS.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_DepthPass_WithPS.azsl @@ -29,7 +29,7 @@ struct VSInput struct VSDepthOutput { // "centroid" is needed for SV_Depth to compile - linear centroid float4 m_position : SV_Position; + precise linear centroid float4 m_position : SV_Position; float2 m_uv[UvSetCount] : UV1; // only used for parallax depth calculation diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ForwardPass.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ForwardPass.azsl index 1d5e4ad9e3..b99ea734af 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ForwardPass.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ForwardPass.azsl @@ -62,7 +62,7 @@ struct VSOutput { // Base fields (required by the template azsli file)... // "centroid" is needed for SV_Depth to compile - linear centroid float4 m_position : SV_Position; + precise linear centroid float4 m_position : SV_Position; float3 m_normal: NORMAL; float3 m_tangent : TANGENT; float3 m_bitangent : BITANGENT; diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/BasePbrSurfaceData.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/BasePbrSurfaceData.azsli index 54bfa31fe8..484958c26c 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/BasePbrSurfaceData.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/BasePbrSurfaceData.azsli @@ -24,7 +24,7 @@ static const float MinRoughnessA = 0.0005f; class BasePbrSurfaceData { - float3 position; //!< Position in world-space + precise float3 position; //!< Position in world-space float3 normal; //!< Normal in world-space float3 albedo; //!< Albedo color of the non-metallic material, will be multiplied against the diffuse lighting value float3 specularF0; //!< Fresnel f0 spectral value of the surface diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/StandardSurface.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/StandardSurface.azsli index 084943bf38..e1b3ff8206 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/StandardSurface.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Surfaces/StandardSurface.azsli @@ -20,7 +20,7 @@ class Surface // ------- BasePbrSurfaceData ------- - float3 position; //!< Position in world-space + precise float3 position; //!< Position in world-space float3 normal; //!< Normal in world-space float3 vertexNormal; //!< Vertex normal in world-space float3 albedo; //!< Albedo color of the non-metallic material, will be multiplied against the diffuse lighting value diff --git a/Gems/Atom/RHI/Metal/Code/Source/RHI.Builders/ShaderPlatformInterface.cpp b/Gems/Atom/RHI/Metal/Code/Source/RHI.Builders/ShaderPlatformInterface.cpp index d43d88a7e1..8c80205c17 100644 --- a/Gems/Atom/RHI/Metal/Code/Source/RHI.Builders/ShaderPlatformInterface.cpp +++ b/Gems/Atom/RHI/Metal/Code/Source/RHI.Builders/ShaderPlatformInterface.cpp @@ -347,7 +347,7 @@ namespace AZ // spirv cross compiler executable static const char* spirvCrossRelativePath = "Builders/SPIRVCross/spirv-cross"; - AZStd::string spirvCrossCommandOptions = AZStd::string::format("--msl --msl-version 20100 --msl-argument-buffers --msl-decoration-binding --msl-texture-buffer-native --output \"%s\" \"%s\"", shaderMSLOutputFile.c_str(), shaderSpirvOutputFile.c_str()); + AZStd::string spirvCrossCommandOptions = AZStd::string::format("--msl --msl-version 20100 --msl-invariant-float-math --msl-argument-buffers --msl-decoration-binding --msl-texture-buffer-native --output \"%s\" \"%s\"", shaderMSLOutputFile.c_str(), shaderSpirvOutputFile.c_str()); // Run spirv cross if (!RHI::ExecuteShaderCompiler(spirvCrossRelativePath, spirvCrossCommandOptions, shaderSpirvOutputFile, "SpirvCross")) @@ -426,6 +426,8 @@ namespace AZ //Debug symbols are always enabled at the moment. Need to turn them off for optimized shader assets. AZStd::string shaderDebugInfo = "-gline-tables-only -MO"; + AZStd::string shaderMslToAirOptions = "-fpreserve-invariance"; + //Apply the correct platform sdk option AZStd::string platformSdk = "macosx"; if (platform.HasTag("mobile")) @@ -434,7 +436,7 @@ namespace AZ } //Convert to air file - AZStd::string mslToAirCommandOptions = AZStd::string::format("-sdk %s metal \"%s\" %s -c -o \"%s\"", platformSdk.c_str(), inputMetalFile.c_str(), shaderDebugInfo.c_str(), outputAirFile.c_str()); + AZStd::string mslToAirCommandOptions = AZStd::string::format("-sdk %s metal \"%s\" %s %s -c -o \"%s\"", platformSdk.c_str(), inputMetalFile.c_str(), shaderDebugInfo.c_str(), shaderMslToAirOptions.c_str(), outputAirFile.c_str()); if (!RHI::ExecuteShaderCompiler("/usr/bin/xcrun", mslToAirCommandOptions, inputMetalFile, "MslToAir")) { From d5e6ec5758f910b22f38611d78efa81567981850 Mon Sep 17 00:00:00 2001 From: rgba16f <82187279+rgba16f@users.noreply.github.com> Date: Wed, 22 Dec 2021 11:30:32 -0600 Subject: [PATCH 231/948] Change the nvidia Aftermath integration to use c strings directly rather than convert to an AZStd::string (#6535) Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com> --- .../Source/Platform/Windows/RHI/NsightAftermath_Windows.cpp | 6 +++--- Gems/Atom/RHI/DX12/Code/Source/RHI/CommandListBase.cpp | 2 +- Gems/Atom/RHI/DX12/Code/Source/RHI/CommandListBase.h | 2 +- Gems/Atom/RHI/DX12/Code/Source/RHI/NsightAftermath.h | 1 + 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Gems/Atom/RHI/DX12/Code/Source/Platform/Windows/RHI/NsightAftermath_Windows.cpp b/Gems/Atom/RHI/DX12/Code/Source/Platform/Windows/RHI/NsightAftermath_Windows.cpp index 199efbb139..429fded6ad 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/Platform/Windows/RHI/NsightAftermath_Windows.cpp +++ b/Gems/Atom/RHI/DX12/Code/Source/Platform/Windows/RHI/NsightAftermath_Windows.cpp @@ -53,14 +53,14 @@ namespace Aftermath #endif } - void SetAftermathEventMarker( [[maybe_unused]] void* cntxHandle, [[maybe_unused]] const AZStd::string& markerData, [[maybe_unused]] bool isAftermathInitialized) + void SetAftermathEventMarker( [[maybe_unused]] void* cntxHandle, [[maybe_unused]] const char* markerData, [[maybe_unused]] bool isAftermathInitialized) { #if defined(USE_NSIGHT_AFTERMATH) if (isAftermathInitialized) { GFSDK_Aftermath_Result result = GFSDK_Aftermath_SetEventMarker( - static_cast(cntxHandle), static_cast(markerData.c_str()), - static_cast(markerData.size()) + 1); + static_cast(cntxHandle), static_cast(markerData), + static_cast(strlen(markerData) + 1); AssertOnError(result); } #endif diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandListBase.cpp b/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandListBase.cpp index 9733045179..35f52b3930 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandListBase.cpp +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandListBase.cpp @@ -85,7 +85,7 @@ namespace AZ return m_hardwareQueueClass; } - void CommandListBase::SetAftermathEventMarker(const AZStd::string& markerData) + void CommandListBase::SetAftermathEventMarker(const char* markerData) { auto& device = static_cast(GetDevice()); Aftermath::SetAftermathEventMarker(m_aftermathCommandListContext, markerData, device.IsAftermathInitialized()); diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandListBase.h b/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandListBase.h index 5f3e4dce1e..d2ad804524 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandListBase.h +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/CommandListBase.h @@ -52,7 +52,7 @@ namespace AZ RHI::HardwareQueueClass GetHardwareQueueClass() const; - void SetAftermathEventMarker(const AZStd::string& markerData); + void SetAftermathEventMarker(const char* markerData); protected: void Init(Device& device, RHI::HardwareQueueClass hardwareQueueClass, ID3D12CommandAllocator* commandAllocator); diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/NsightAftermath.h b/Gems/Atom/RHI/DX12/Code/Source/RHI/NsightAftermath.h index a486822309..bce293ad29 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/NsightAftermath.h +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/NsightAftermath.h @@ -15,6 +15,7 @@ namespace Aftermath { void SetAftermathEventMarker(void* cntxHandle, const AZStd::string& markerData, bool isAftermathInitialized); + void SetAftermathEventMarker(void* cntxHandle, const char* markerData, bool isAftermathInitialized); bool InitializeAftermath(AZ::RHI::Ptr dx12Device); void* CreateAftermathContextHandle(ID3D12GraphicsCommandList* commandList, void* crashTracker); void OutputLastScopeExecutingOnGPU(void* crashTracker); From 3f766629bc2e05644e072e3f1cc86b23a58a56ee Mon Sep 17 00:00:00 2001 From: tjmgd <92784061+tjmgd@users.noreply.github.com> Date: Wed, 22 Dec 2021 17:36:34 +0000 Subject: [PATCH 232/948] Lua Editor log - text ghosted (#6329) Signed-off-by: T.J. McGrath-Daly --- .../AzToolsFramework/UI/Logging/LogPanel_Panel.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Logging/LogPanel_Panel.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Logging/LogPanel_Panel.cpp index ef8bf42713..a9449645c7 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Logging/LogPanel_Panel.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Logging/LogPanel_Panel.cpp @@ -840,8 +840,6 @@ namespace AzToolsFramework richLabel->setTextFormat(Qt::RichText); } - richLabel->setText(data); - richLabel->setGeometry(options.rect); richLabel->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::LinksAccessibleByMouse); richLabel->setPalette(options.palette); From 38bbf9659e4254564e71e901588d91f7568c12f8 Mon Sep 17 00:00:00 2001 From: tjmgd <92784061+tjmgd@users.noreply.github.com> Date: Wed, 22 Dec 2021 18:54:49 +0000 Subject: [PATCH 233/948] Fix: jumps disordered (Go to Line,Transpose Lines UP,Transpose Lines (#6210) Down,Comment Selected Block and UnComment Selected Block) Signed-off-by: T.J. McGrath-Daly Co-authored-by: Tobias Alexander Franke --- .../LuaIDE/Source/LUA/LUAEditorMainWindow.cpp | 2 +- .../Tools/LuaIDE/Source/LUA/LUAEditorView.cpp | 33 ++++++++++++------- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/Code/Tools/LuaIDE/Source/LUA/LUAEditorMainWindow.cpp b/Code/Tools/LuaIDE/Source/LUA/LUAEditorMainWindow.cpp index 33d8373487..85274cf5e1 100644 --- a/Code/Tools/LuaIDE/Source/LUA/LUAEditorMainWindow.cpp +++ b/Code/Tools/LuaIDE/Source/LUA/LUAEditorMainWindow.cpp @@ -1280,7 +1280,7 @@ namespace LUAEditor // go to that line of the selected file. lineNumber = dlg.getLineNumber(); - currentView->SetCursorPosition(lineNumber - 1, 0); + currentView->SetCursorPosition(lineNumber, 0); } } diff --git a/Code/Tools/LuaIDE/Source/LUA/LUAEditorView.cpp b/Code/Tools/LuaIDE/Source/LUA/LUAEditorView.cpp index 18d12f292c..c83c9a5513 100644 --- a/Code/Tools/LuaIDE/Source/LUA/LUAEditorView.cpp +++ b/Code/Tools/LuaIDE/Source/LUA/LUAEditorView.cpp @@ -964,9 +964,11 @@ namespace LUAEditor int endLine; auto newText = AcumulateSelectedLines(startLine, endLine, callable); - SetSelection(startLine, 0, endLine + 1, 0); + SetSelection(startLine + 1, 0, endLine + 2, 0); + RemoveSelectedText(); + SetCursorPosition(startLine + 1, 0); ReplaceSelectedText(newText); - SetSelection(startLine, 0, endLine + 1, 0); + SetSelection(startLine + 1, 0, endLine + 1, INT_MAX); } void LUAViewWidget::CommentSelectedLines() @@ -1002,21 +1004,30 @@ namespace LUAEditor { int startLine; int endLine; - auto newText = AcumulateSelectedLines(startLine, endLine, [&](QString& newText, QTextBlock& block) + auto currText = AcumulateSelectedLines(startLine, endLine, [&](QString& newText, QTextBlock& block) { newText.append(block.text()); newText.append("\n"); }); + currText.remove(currText.count() - 1, 1); + if (startLine == 0) { return; } - - SetSelection(startLine - 1, INT_MAX, endLine, INT_MAX); + auto upText = GetLineText(startLine -1); + SetSelection(startLine, 0, startLine, INT_MAX); RemoveSelectedText(); - SetCursorPosition(startLine - 1, 0); - ReplaceSelectedText(newText); - SetSelection(startLine - 1, 0, endLine - 1, INT_MAX); + SetSelection(startLine + 1, 0, endLine + 1, INT_MAX); + RemoveSelectedText(); + + SetCursorPosition(startLine , 0); + ReplaceSelectedText(currText); + + SetCursorPosition(endLine + 1, 0); + ReplaceSelectedText(upText); + + SetSelection(startLine, 0, endLine, INT_MAX); } void LUAViewWidget::MoveSelectedLinesDn() @@ -1040,11 +1051,11 @@ namespace LUAEditor newText.prepend("\n"); } - SetSelection(startLine, 0, endLine + 1, 0); + SetSelection(startLine + 1, 0, endLine + 2, 0); RemoveSelectedText(); - SetCursorPosition(startLine + 1, 0); + SetCursorPosition(startLine + 2, 0); ReplaceSelectedText(newText); - SetSelection(startLine + 1, 0, endLine + 1, INT_MAX); + SetSelection(startLine + 2, 0, endLine + 2, INT_MAX); } void LUAViewWidget::SetReadonly(bool readonly) From f69b9b817c19b73921d5e4095d309a51b656fe8c Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Wed, 22 Dec 2021 11:03:51 -0800 Subject: [PATCH 234/948] Round of clang compile fixes Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp | 2 +- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 10 ++-------- Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp | 7 +++---- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp b/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp index 46fa5b9bac..d65497e194 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp @@ -22,7 +22,7 @@ namespace AZ::Dom::Utils return backend.ReadFromBufferInPlace(string.data(), string.size(), visitor); } - AZ::Outcome AZ::Dom::Utils::WriteToValue(Backend::WriteCallback writeCallback) + AZ::Outcome WriteToValue(Backend::WriteCallback writeCallback) { Value value; AZStd::unique_ptr writer = value.GetWriteHandler(); diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index 7659afa070..7401a5ac98 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -6,8 +6,6 @@ * */ -#pragma once - #include #include #include @@ -31,11 +29,7 @@ namespace AZ::Dom namespace Internal { template - constexpr size_t GetTypeIndexInternal(size_t index = 0) - { - static_assert(false, "Type not found in ValueType"); - return index; - } + constexpr size_t GetTypeIndexInternal(size_t index = 0); template constexpr size_t GetTypeIndexInternal(size_t index = 0) @@ -143,7 +137,7 @@ namespace AZ::Dom Value Value::FromOpaqueValue(const AZStd::any& value) { - return Value(&value); + return Value(value); } Value::Value(int8_t value) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp index f8ca56ea32..b7ed44f8de 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp @@ -129,7 +129,7 @@ namespace AZ::Dom AZStd::string::format("AZ::Dom::ValueWriter: %s called from within a different container type", endMethodName)); } - if (buffer.m_attributes.size() != attributeCount) + if (static_cast(buffer.m_attributes.size()) != attributeCount) { return VisitorFailure( VisitorErrorCode::InternalError, @@ -138,7 +138,7 @@ namespace AZ::Dom buffer.m_attributes.size())); } - if (buffer.m_elements.size() != elementCount) + if (static_cast(buffer.m_elements.size()) != elementCount) { return VisitorFailure( VisitorErrorCode::InternalError, @@ -146,6 +146,7 @@ namespace AZ::Dom "AZ::Dom::ValueWriter: %s expected %llu elements but received %llu elements instead", endMethodName, elementCount, buffer.m_elements.size())); } + if (buffer.m_attributes.size() > 0) { MoveVectorMemory(container.GetMutableObject(), buffer.m_attributes); @@ -237,8 +238,6 @@ namespace AZ::Dom m_entryStack.top().m_value.Swap(value); ValueInfo& newEntry = m_entryStack.top(); - constexpr const size_t reserveSize = 8; - if (!newEntry.m_key.IsEmpty()) { GetValueBuffer().m_attributes.emplace_back(AZStd::move(newEntry.m_key), AZStd::move(value)); From 7b99b6a1e2ede0b8fb70e894de666853e52f966f Mon Sep 17 00:00:00 2001 From: tjmgd <92784061+tjmgd@users.noreply.github.com> Date: Wed, 22 Dec 2021 19:31:49 +0000 Subject: [PATCH 235/948] Fix: next and prev tabs incorrectly implemented (#6208) Signed-off-by: T.J. McGrath-Daly Co-authored-by: Tobias Alexander Franke --- .../LuaIDE/Source/LUA/LUAEditorMainWindow.cpp | 126 ++++++++---------- 1 file changed, 52 insertions(+), 74 deletions(-) diff --git a/Code/Tools/LuaIDE/Source/LUA/LUAEditorMainWindow.cpp b/Code/Tools/LuaIDE/Source/LUA/LUAEditorMainWindow.cpp index 85274cf5e1..c05e11f575 100644 --- a/Code/Tools/LuaIDE/Source/LUA/LUAEditorMainWindow.cpp +++ b/Code/Tools/LuaIDE/Source/LUA/LUAEditorMainWindow.cpp @@ -2141,24 +2141,7 @@ namespace LUAEditor if (event->type() == QEvent::KeyPress) { QKeyEvent* keyEvent = static_cast(event); - if (keyEvent->key() == Qt::Key_Control) - { - TrackedLUACtrlTabOrder::iterator tabIter = m_CtrlTabOrder.begin(); - while (tabIter != m_CtrlTabOrder.end()) - { - if (*tabIter == m_lastFocusedAssetId) - { - // store the visible top window and make it the list's topmost - m_StoredTabAssetId = m_lastFocusedAssetId; - m_CtrlTabOrder.erase(tabIter); - m_CtrlTabOrder.push_front(m_lastFocusedAssetId); - break; - } - - ++tabIter; - } - } - else if (keyEvent->key() == Qt::Key_C && (keyEvent->modifiers() & Qt::ControlModifier)) + if (keyEvent->key() == Qt::Key_C && (keyEvent->modifiers() & Qt::ControlModifier)) { OnEditMenuCopy(); return true; @@ -2174,32 +2157,6 @@ namespace LUAEditor QKeyEvent* keyEvent = static_cast(event); if (keyEvent->key() == Qt::Key_Control) { - // reconfigure the ctrl+tab stack to set the next document to be the stored guid - // which was recorded when Ctrl was first pressed - TrackedLUACtrlTabOrder::iterator tabIter = m_CtrlTabOrder.begin(); - while (tabIter != m_CtrlTabOrder.end()) - { - if (*tabIter == m_StoredTabAssetId) - { - m_CtrlTabOrder.erase(tabIter); - - tabIter = m_CtrlTabOrder.begin(); - ++tabIter; - if (tabIter != m_CtrlTabOrder.end()) - { - m_CtrlTabOrder.insert(tabIter, m_StoredTabAssetId); - } - else - { - m_CtrlTabOrder.push_back(m_StoredTabAssetId); - } - - break; - } - - ++tabIter; - } - m_StoredTabAssetId = ""; } } @@ -2210,46 +2167,67 @@ namespace LUAEditor void LUAEditorMainWindow::OnTabForwards() { - // pop the first entry and push it to the last spot TrackedLUACtrlTabOrder::iterator tabIter = m_CtrlTabOrder.begin(); - if (tabIter != m_CtrlTabOrder.end()) - { - AZStd::string assetId = *tabIter; - m_CtrlTabOrder.pop_front(); - m_CtrlTabOrder.push_back(assetId); - // then grab the new first entry and pass it on to the widgetry - tabIter = m_CtrlTabOrder.begin(); - - TrackedLUAViewMap::iterator viewInfoIter = m_dOpenLUAView.find(*tabIter); - if (viewInfoIter != m_dOpenLUAView.end()) + while (tabIter != m_CtrlTabOrder.end()) + { + if (*tabIter == m_lastFocusedAssetId) { - viewInfoIter->second.luaDockWidget()->show(); - viewInfoIter->second.luaDockWidget()->raise(); - viewInfoIter->second.luaViewWidget()->setFocus(); + break; } + tabIter++; + } + + if (tabIter == m_CtrlTabOrder.begin()) + { + tabIter = m_CtrlTabOrder.end(); + --tabIter; + } + else + { + --tabIter; + } + + TrackedLUAViewMap::iterator viewInfoIter = m_dOpenLUAView.find(*tabIter); + if (viewInfoIter != m_dOpenLUAView.end()) + { + viewInfoIter->second.luaDockWidget()->show(); + viewInfoIter->second.luaDockWidget()->raise(); + viewInfoIter->second.luaViewWidget()->setFocus(); + m_lastFocusedAssetId = *tabIter; } } void LUAEditorMainWindow::OnTabBackwards() - { - // pop the last entry and push it to the first spot - TrackedLUACtrlTabOrder::iterator tabIter = m_CtrlTabOrder.end(); - --tabIter; - if (tabIter != m_CtrlTabOrder.end()) + { + TrackedLUACtrlTabOrder::iterator tabIter = m_CtrlTabOrder.begin(); + while (tabIter != m_CtrlTabOrder.end()) { - AZStd::string assetId = *tabIter; - m_CtrlTabOrder.pop_back(); - m_CtrlTabOrder.push_front(assetId); - // then grab the new first entry and pass it on to the widgetry - tabIter = m_CtrlTabOrder.begin(); - - TrackedLUAViewMap::iterator viewInfoIter = m_dOpenLUAView.find(*tabIter); - if (viewInfoIter != m_dOpenLUAView.end()) + if (*tabIter == m_lastFocusedAssetId) { - viewInfoIter->second.luaDockWidget()->show(); - viewInfoIter->second.luaDockWidget()->raise(); - viewInfoIter->second.luaViewWidget()->setFocus(); + break; } + tabIter++; + } + + if (tabIter == m_CtrlTabOrder.end()) + { + return; + } + + tabIter++; + if (tabIter == m_CtrlTabOrder.end()) + { + tabIter = m_CtrlTabOrder.begin(); + + } + + TrackedLUAViewMap::iterator viewInfoIter = m_dOpenLUAView.find(*tabIter); + if (viewInfoIter != m_dOpenLUAView.end()) + { + viewInfoIter->second.luaDockWidget()->show(); + viewInfoIter->second.luaDockWidget()->raise(); + viewInfoIter->second.luaViewWidget()->setFocus(); + m_lastFocusedAssetId = *tabIter; } } From 33495e4858f5cd1fd576a2deb2fc5fa0061483a1 Mon Sep 17 00:00:00 2001 From: tjmgd <92784061+tjmgd@users.noreply.github.com> Date: Wed, 22 Dec 2021 19:32:14 +0000 Subject: [PATCH 236/948] Slice save path incorrect, and error message incomplete (#6214) Signed-off-by: T.J. McGrath-Daly --- .../AzToolsFramework/Slice/SliceUtilities.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Slice/SliceUtilities.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Slice/SliceUtilities.cpp index c13f7dd848..93b1fce5b4 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Slice/SliceUtilities.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Slice/SliceUtilities.cpp @@ -2666,19 +2666,15 @@ namespace AzToolsFramework if (!isPathSafeForAssets) { // Put an error in the console, so the log files have info about this error, or the user can look up the error after dismissing it. - AZStd::string errorMessage = "You can save slices only to your game project folder or the Gems folder. Update the location and try again.\n\n" - "You can also review and update your save locations in the AssetProcessorPlatformConfig.ini file."; + AZStd::string errorMessage = "You can save slices only to your game project folder or the Gems folder. Update the location and try again.\n\n"; AZ_Error("Slice", false, errorMessage.c_str()); - QString learnMoreLink(QObject::tr("")); - QString learnMoreDescription(QObject::tr(" Learn more").arg(learnMoreLink)); - // Display a pop-up, the logs are easy to miss. This will make sure a user who encounters this error immediately knows their slice save has failed. QMessageBox msgBox(activeWindow); msgBox.setIcon(QMessageBox::Icon::Warning); msgBox.setTextFormat(Qt::RichText); msgBox.setWindowTitle(QObject::tr("Invalid save location")); - msgBox.setText(QString("%1 %2").arg(QObject::tr(errorMessage.c_str())).arg(learnMoreDescription)); + msgBox.setText(QString("%1").arg(QObject::tr(errorMessage.c_str()))); msgBox.setStandardButtons(QMessageBox::Cancel | QMessageBox::Retry); msgBox.setDefaultButton(QMessageBox::Retry); const int response = msgBox.exec(); @@ -2689,7 +2685,16 @@ namespace AzToolsFramework // so set the suggested save path to a known valid location. if (assetSafeFolders.size() > 0) { - retrySavePath = assetSafeFolders[0]; + QStringList strList = slicePath.split("/"); + if (strList.size() > 0) + { + retrySavePath = assetSafeFolders[0] + ("/" + strList[strList.size() - 1]).toUtf8().data(); + } + else + { + retrySavePath = assetSafeFolders[0]; + } + } return SliceSaveResult::Retry; case QMessageBox::Cancel: From 254906cd83daa9ea34637ccfb7dd3221be8cf0f7 Mon Sep 17 00:00:00 2001 From: tjmgd <92784061+tjmgd@users.noreply.github.com> Date: Wed, 22 Dec 2021 19:32:40 +0000 Subject: [PATCH 237/948] The line number displayed by Breakpoints in Lua Editor is 1 larger than (#6299) the actual line number of the code. Signed-off-by: T.J. McGrath-Daly --- Code/Tools/LuaIDE/Source/LUA/BreakpointPanel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Tools/LuaIDE/Source/LUA/BreakpointPanel.cpp b/Code/Tools/LuaIDE/Source/LUA/BreakpointPanel.cpp index 56379a3f07..cb8fffffc7 100644 --- a/Code/Tools/LuaIDE/Source/LUA/BreakpointPanel.cpp +++ b/Code/Tools/LuaIDE/Source/LUA/BreakpointPanel.cpp @@ -140,7 +140,7 @@ void DHBreakpointsWidget::CreateBreakpoint(const AZStd::string& debugName, int l QTableWidgetItem* newItem = new QTableWidgetItem(debugName.c_str()); newItem->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable); setItem(newRow, 1, newItem); - newItem = new QTableWidgetItem(QString().setNum(lineNumber + 1)); // +1 offset to match editor numbering + newItem = new QTableWidgetItem(QString().setNum(lineNumber)); newItem->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable); setItem(newRow, 0, newItem); } From 5867e65720cc3b55fb049cf37df8670a7824fbeb Mon Sep 17 00:00:00 2001 From: tjmgd <92784061+tjmgd@users.noreply.github.com> Date: Wed, 22 Dec 2021 19:34:48 +0000 Subject: [PATCH 238/948] The search cursor on the Node Palette interface does not cover the (#6218) searched keywords completely Signed-off-by: T.J. McGrath-Daly --- .../GraphCanvas/Widgets/NodePalette/NodePaletteWidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/NodePalette/NodePaletteWidget.cpp b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/NodePalette/NodePaletteWidget.cpp index 5a1aaedeb9..f6cec6de6b 100644 --- a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/NodePalette/NodePaletteWidget.cpp +++ b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/NodePalette/NodePaletteWidget.cpp @@ -85,7 +85,7 @@ namespace GraphCanvas if (leftSpot < textRect.right()) { int visibleLength = AZStd::GetMin(selectedTextLength, textRect.right() - leftSpot); - QRect highlightRect(textRect.left() + preSelectedTextLength, textRect.top(), visibleLength, textRect.height()); + QRect highlightRect(textRect.left() + preSelectedTextLength + 4, textRect.top(), visibleLength, textRect.height()); // paint the highlight rect painter->fillRect(highlightRect, options.palette.highlight()); From 515e363151185c1270838f8155cf08e198549ed5 Mon Sep 17 00:00:00 2001 From: tjmgd <92784061+tjmgd@users.noreply.github.com> Date: Wed, 22 Dec 2021 19:50:14 +0000 Subject: [PATCH 239/948] added pass class (#6244) Signed-off-by: T.J. McGrath-Daly --- .../Assets/Passes/DiffuseComposite.pass | 2 +- .../Code/Source/CommonSystemComponent.cpp | 2 + .../DiffuseCompositePass.cpp | 45 +++++++++++++++++++ .../DiffuseCompositePass.h | 36 +++++++++++++++ .../Code/atom_feature_common_files.cmake | 2 + 5 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseCompositePass.cpp create mode 100644 Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseCompositePass.h diff --git a/Gems/Atom/Feature/Common/Assets/Passes/DiffuseComposite.pass b/Gems/Atom/Feature/Common/Assets/Passes/DiffuseComposite.pass index 615ee8a162..3ad5c06c90 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/DiffuseComposite.pass +++ b/Gems/Atom/Feature/Common/Assets/Passes/DiffuseComposite.pass @@ -5,7 +5,7 @@ "ClassData": { "PassTemplate": { "Name": "DiffuseCompositePassTemplate", - "PassClass": "FullScreenTriangle", + "PassClass": "DiffuseCompositePass", "Slots": [ { "Name": "DownsampledIrradianceInput", diff --git a/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp b/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp index a06defff08..04098f5c20 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp @@ -96,6 +96,7 @@ #include #include #include +#include #include #include #include @@ -278,6 +279,7 @@ namespace AZ passSystem->AddPassCreator(Name("DiffuseProbeGridClassificationPass"), &Render::DiffuseProbeGridClassificationPass::Create); passSystem->AddPassCreator(Name("DiffuseProbeGridDownsamplePass"), &Render::DiffuseProbeGridDownsamplePass::Create); passSystem->AddPassCreator(Name("DiffuseProbeGridRenderPass"), &Render::DiffuseProbeGridRenderPass::Create); + passSystem->AddPassCreator(Name("DiffuseCompositePass"), &Render::DiffuseCompositePass::Create); passSystem->AddPassCreator(Name("LuminanceHistogramGeneratorPass"), &LuminanceHistogramGeneratorPass::Create); diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseCompositePass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseCompositePass.cpp new file mode 100644 index 0000000000..0b0dfda391 --- /dev/null +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseCompositePass.cpp @@ -0,0 +1,45 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include + +namespace AZ +{ + namespace Render + { + // --- Dedicated class for disabling --- + + RPI::Ptr DiffuseCompositePass::Create(const RPI::PassDescriptor& descriptor) + { + RPI::Ptr pass = aznew DiffuseCompositePass(descriptor); + return AZStd::move(pass); + } + + DiffuseCompositePass::DiffuseCompositePass(const RPI::PassDescriptor& descriptor) + : RPI::FullscreenTrianglePass(descriptor) + { } + + bool DiffuseCompositePass::IsEnabled() const + { + const RPI::Scene* scene = GetScene(); + if (!scene) + { + return false; + } + DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = + scene->GetFeatureProcessor(); + if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids().empty()) + { + // no diffuse probe grids + return false; + } + return true; + } + } // namespace Render +} // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseCompositePass.h b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseCompositePass.h new file mode 100644 index 0000000000..333c66ebea --- /dev/null +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseCompositePass.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ +#pragma once + +#include + +namespace AZ +{ + namespace Render + { + //! A class for DiffuseComposite to allow for disabling + class DiffuseCompositePass final + : public RPI::FullscreenTrianglePass + { + AZ_RPI_PASS(DiffuseCompositePass); + + public: + AZ_RTTI(DiffuseCompositePass, "{F3DBEBCB-66F8-465C-A06B-DFA76B9D4856}", AZ::RPI::FullscreenTrianglePass); + AZ_CLASS_ALLOCATOR(DiffuseCompositePass, SystemAllocator, 0); + + ~DiffuseCompositePass() = default; + static RPI::Ptr Create(const RPI::PassDescriptor& descriptor); + + bool IsEnabled() const override; + + private: + DiffuseCompositePass(const RPI::PassDescriptor& descriptor); + + }; + } // namespace Render +} // namespace AZ \ No newline at end of file diff --git a/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake b/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake index 375dbd9724..952085e136 100644 --- a/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake +++ b/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake @@ -134,6 +134,8 @@ set(FILES Source/DiffuseGlobalIllumination/DiffuseProbeGridDownsamplePass.h Source/DiffuseGlobalIllumination/DiffuseProbeGridRenderPass.cpp Source/DiffuseGlobalIllumination/DiffuseProbeGridRenderPass.h + Source/DiffuseGlobalIllumination/DiffuseCompositePass.cpp + Source/DiffuseGlobalIllumination/DiffuseCompositePass.h Source/DiffuseGlobalIllumination/DiffuseProbeGrid.cpp Source/DiffuseGlobalIllumination/DiffuseProbeGrid.h Source/DiffuseGlobalIllumination/DiffuseProbeGridTextureReadback.cpp From 457007e037090484306309d6e53d32ce4979d823 Mon Sep 17 00:00:00 2001 From: tjmgd <92784061+tjmgd@users.noreply.github.com> Date: Wed, 22 Dec 2021 19:51:11 +0000 Subject: [PATCH 240/948] Negative distances invalid (#6288) Signed-off-by: T.J. McGrath-Daly Co-authored-by: Tobias Alexander Franke --- .../Code/Source/Integration/Components/SimpleLODComponent.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Gems/EMotionFX/Code/Source/Integration/Components/SimpleLODComponent.cpp b/Gems/EMotionFX/Code/Source/Integration/Components/SimpleLODComponent.cpp index fdc6426e4c..c673e14bce 100644 --- a/Gems/EMotionFX/Code/Source/Integration/Components/SimpleLODComponent.cpp +++ b/Gems/EMotionFX/Code/Source/Integration/Components/SimpleLODComponent.cpp @@ -53,6 +53,7 @@ namespace EMotionFX ->Attribute(AZ::Edit::Attributes::AutoExpand, true) ->ElementAttribute(AZ::Edit::Attributes::Step, 0.01f) ->ElementAttribute(AZ::Edit::Attributes::Suffix, " m") + ->ElementAttribute(AZ::Edit::Attributes::Min, 0.00f) ->DataElement(0, &SimpleLODComponent::Configuration::m_enableLodSampling, "Enable LOD anim graph sampling", "AnimGraph sample rate will adjust based on LOD level.") ->Attribute(AZ::Edit::Attributes::ChangeNotify, AZ::Edit::PropertyRefreshLevels::EntireTree) @@ -61,7 +62,8 @@ namespace EMotionFX ->Attribute(AZ::Edit::Attributes::Visibility, &SimpleLODComponent::Configuration::GetEnableLodSampling) ->Attribute(AZ::Edit::Attributes::ContainerCanBeModified, false) ->Attribute(AZ::Edit::Attributes::AutoExpand, true) - ->ElementAttribute(AZ::Edit::Attributes::Step, 1.0f); + ->ElementAttribute(AZ::Edit::Attributes::Step, 1.0f) + ->ElementAttribute(AZ::Edit::Attributes::Min, 0.0f); } } } From a6240ff6bc547a1774c3beaea567cfeb6895c09f Mon Sep 17 00:00:00 2001 From: tjmgd <92784061+tjmgd@users.noreply.github.com> Date: Wed, 22 Dec 2021 19:51:33 +0000 Subject: [PATCH 241/948] Editor issue after clicking Find Layer in Asset Browser and (#6327) Find Slice in Asset Browser in Slice mode Signed-off-by: T.J. McGrath-Daly --- .../AssetBrowser/Views/AssetBrowserTableView.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/AssetBrowserTableView.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/AssetBrowserTableView.cpp index feab9a9e5a..cfcac579ff 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/AssetBrowserTableView.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/AssetBrowserTableView.cpp @@ -144,7 +144,10 @@ namespace AzToolsFramework { emit ClearStringFilter(); emit ClearTypeFilter(); - m_sourceFilterModel->FilterUpdatedSlotImmediate(); + if (m_sourceFilterModel) + { + m_sourceFilterModel->FilterUpdatedSlotImmediate(); + } } void AssetBrowserTableView::Update() From cb740a3b3ebb5d6f0bab2774435a88eb9cd8c866 Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Wed, 22 Dec 2021 11:51:47 -0800 Subject: [PATCH 242/948] chore: remove "using namespace AZ" from AZCore Script (#6366) * chore: remove "using namespace AZ" from AZCore Script REF: https://github.com/o3de/o3de/issues/6281 Signed-off-by: Michael Pollind * chore: address changes Signed-off-by: Michael Pollind --- .../AzCore/AzCore/Script/ScriptContext.cpp | 6 ++++-- .../AzCore/AzCore/Script/ScriptContext.h | 4 +--- .../AzCore/AzCore/Script/ScriptContextDebug.cpp | 8 ++++---- .../AzCore/AzCore/Script/ScriptContextDebug.h | 6 +----- .../AzCore/Script/ScriptSystemComponent.cpp | 17 ++++++++++------- .../AzCore/Script/ScriptSystemComponent.h | 6 +----- 6 files changed, 21 insertions(+), 26 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp b/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp index 841387f14d..64822684da 100644 --- a/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp +++ b/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp @@ -1424,7 +1424,8 @@ namespace AZ } } -using namespace AZ; +namespace AZ +{ #ifndef AZ_USE_CUSTOM_SCRIPT_BIND @@ -2254,6 +2255,7 @@ LUA_API const Node* lua_getDummyNode() } #endif // AZ_USE_CUSTOM_SCRIPT_BIND +} // namespace AZ ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// @@ -5825,7 +5827,6 @@ LUA_API const Node* lua_getDummyNode() AllocatorWrapper m_luaAllocator; AZStd::thread::id m_ownerThreadId; // Check if Lua methods (including EBus handlers) are called from background threads. }; - } // namespace AZ ScriptContext::ScriptContext(ScriptContextId id, IAllocatorAllocate* allocator, lua_State* nativeContext) { @@ -6116,5 +6117,6 @@ LUA_API const Node* lua_getDummyNode() { return m_impl->ConstructScriptProperty(sdc, valueIndex, name, restrictToPropertyArrays); } +} // namespace AZ #undef AZ_DBG_NAME_FIXER diff --git a/Code/Framework/AzCore/AzCore/Script/ScriptContext.h b/Code/Framework/AzCore/AzCore/Script/ScriptContext.h index bb63a9368d..5a7fca704f 100644 --- a/Code/Framework/AzCore/AzCore/Script/ScriptContext.h +++ b/Code/Framework/AzCore/AzCore/Script/ScriptContext.h @@ -5,8 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 OR MIT * */ -#ifndef AZCORE_SCRIPT_CONTEXT_H -#define AZCORE_SCRIPT_CONTEXT_H +#pragma once #include #include @@ -1032,4 +1031,3 @@ namespace AZ } } // namespace AZ -#endif // AZCORE_SCRIPT_CONTEXT_H diff --git a/Code/Framework/AzCore/AzCore/Script/ScriptContextDebug.cpp b/Code/Framework/AzCore/AzCore/Script/ScriptContextDebug.cpp index 81ede7a5d3..698c5a0043 100644 --- a/Code/Framework/AzCore/AzCore/Script/ScriptContextDebug.cpp +++ b/Code/Framework/AzCore/AzCore/Script/ScriptContextDebug.cpp @@ -25,10 +25,8 @@ extern "C" { namespace AZ { + void LuaHook(lua_State* l, lua_Debug* ar); -} - -using namespace AZ; /** * A temp class that will override the current script context error handler and store the error (without any messages) @@ -599,7 +597,7 @@ static ScriptContextDebug::BreakpointId MakeBreakpointId(const char* sourceName, // LuaHook // [6/28/2012] //========================================================================= -void AZ::LuaHook(lua_State* l, lua_Debug* ar) +void LuaHook(lua_State* l, lua_Debug* ar) { // Read contexts lua_rawgeti(l, LUA_REGISTRYINDEX, AZ_LUA_SCRIPT_CONTEXT_REF); @@ -1543,4 +1541,6 @@ ScriptContextDebug::SetValue(const DebugValue& sourceValue) return true; } +} // namespace AZ + #endif // #if !defined(AZCORE_EXCLUDE_LUA) diff --git a/Code/Framework/AzCore/AzCore/Script/ScriptContextDebug.h b/Code/Framework/AzCore/AzCore/Script/ScriptContextDebug.h index a8f0ba643c..a1d73352c4 100644 --- a/Code/Framework/AzCore/AzCore/Script/ScriptContextDebug.h +++ b/Code/Framework/AzCore/AzCore/Script/ScriptContextDebug.h @@ -5,8 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 OR MIT * */ -#ifndef AZCORE_SCRIPT_CONTEXT_DEBUG_H -#define AZCORE_SCRIPT_CONTEXT_DEBUG_H +#pragma once #include #include @@ -213,6 +212,3 @@ namespace AZ ScriptContext& m_context; }; } - -#endif // AZCORE_SCRIPT_CONTEXT_DEBUG_H -#pragma once diff --git a/Code/Framework/AzCore/AzCore/Script/ScriptSystemComponent.cpp b/Code/Framework/AzCore/AzCore/Script/ScriptSystemComponent.cpp index 4b71c57682..32081afce7 100644 --- a/Code/Framework/AzCore/AzCore/Script/ScriptSystemComponent.cpp +++ b/Code/Framework/AzCore/AzCore/Script/ScriptSystemComponent.cpp @@ -31,7 +31,8 @@ #include #include -using namespace AZ; +namespace AZ +{ /** * Script lifecycle: @@ -44,8 +45,7 @@ using namespace AZ; * If the script was loaded by a ScriptComponent, Load will be called once reload is complete. */ -namespace -{ +namespace LocalTU_ScriptSystemComponent { // Called when a module has already been loaded static int LuaRequireLoadedModule(lua_State* l) { @@ -54,8 +54,10 @@ namespace return 1; } + } + //========================================================================= // ScriptSystemComponent // [5/29/2012] @@ -479,7 +481,7 @@ int ScriptSystemComponent::DefaultRequireHook(lua_State* lua, ScriptContext* con scriptIt->second.m_scriptNames.emplace(module); // Push the value to a closure that will just return it lua_rawgeti(lua, LUA_REGISTRYINDEX, scriptIt->second.m_tableReference); - lua_pushcclosure(lua, LuaRequireLoadedModule, 1); + lua_pushcclosure(lua, LocalTU_ScriptSystemComponent::LuaRequireLoadedModule, 1); // If asset reference already populated, just return now. Otherwise, capture reference if (scriptIt->second.m_scriptAsset.GetId().IsValid()) @@ -519,7 +521,7 @@ int ScriptSystemComponent::DefaultRequireHook(lua_State* lua, ScriptContext* con } // Push function returning the result - lua_pushcclosure(lua, LuaRequireLoadedModule, 1); + lua_pushcclosure(lua, LocalTU_ScriptSystemComponent::LuaRequireLoadedModule, 1); // Set asset reference on the loaded script scriptIt = container->m_loadedScripts.find(scriptId.m_guid); @@ -565,7 +567,7 @@ int ScriptSystemComponent::InMemoryRequireHook(lua_State* lua, ScriptContext* co scriptIt->second.m_scriptNames.emplace(module); // Push the value to a closure that will just return it lua_rawgeti(lua, LUA_REGISTRYINDEX, scriptIt->second.m_tableReference); - lua_pushcclosure(lua, LuaRequireLoadedModule, 1); + lua_pushcclosure(lua, LocalTU_ScriptSystemComponent::LuaRequireLoadedModule, 1); // If asset reference already populated, just return now. Otherwise, capture reference if (scriptIt->second.m_scriptAsset.GetId().IsValid()) @@ -591,7 +593,7 @@ int ScriptSystemComponent::InMemoryRequireHook(lua_State* lua, ScriptContext* co } // Push function returning the result - lua_pushcclosure(lua, LuaRequireLoadedModule, 1); + lua_pushcclosure(lua, LocalTU_ScriptSystemComponent::LuaRequireLoadedModule, 1); // Set asset reference on the loaded script scriptIt = container->m_loadedScripts.find(scriptId.m_guid); @@ -996,4 +998,5 @@ void ScriptSystemComponent::Reflect(ReflectContext* reflection) } } +} // namespace AZ #endif // #if !defined(AZCORE_EXCLUDE_LUA) diff --git a/Code/Framework/AzCore/AzCore/Script/ScriptSystemComponent.h b/Code/Framework/AzCore/AzCore/Script/ScriptSystemComponent.h index eb2e968a95..a7b1245546 100644 --- a/Code/Framework/AzCore/AzCore/Script/ScriptSystemComponent.h +++ b/Code/Framework/AzCore/AzCore/Script/ScriptSystemComponent.h @@ -5,8 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 OR MIT * */ -#ifndef AZCORE_SCRIPT_SYSTEM_COMPONENT_H -#define AZCORE_SCRIPT_SYSTEM_COMPONENT_H +#pragma once #include #include @@ -182,6 +181,3 @@ namespace AZ void OnAssetReloaded(Data::Asset asset) override; }; } - -#endif // AZCORE_SCRIPT_SYSTEM_COMPONENT_H -#pragma once From 8732fab19284ca5736d30f1406659949bed02710 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Wed, 22 Dec 2021 12:35:44 -0800 Subject: [PATCH 243/948] One more compile fix Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp index b7ed44f8de..210d1fa123 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp @@ -134,7 +134,7 @@ namespace AZ::Dom return VisitorFailure( VisitorErrorCode::InternalError, AZStd::string::format( - "AZ::Dom::ValueWriter: %s expected %llu attributes but received %llu attributes instead", endMethodName, attributeCount, + "AZ::Dom::ValueWriter: %s expected %llu attributes but received %zu attributes instead", endMethodName, attributeCount, buffer.m_attributes.size())); } @@ -143,7 +143,7 @@ namespace AZ::Dom return VisitorFailure( VisitorErrorCode::InternalError, AZStd::string::format( - "AZ::Dom::ValueWriter: %s expected %llu elements but received %llu elements instead", endMethodName, elementCount, + "AZ::Dom::ValueWriter: %s expected %llu elements but received %zu elements instead", endMethodName, elementCount, buffer.m_elements.size())); } From 7dac0bac0dfc75a5ff275e709a8d774b33c2ee81 Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Wed, 22 Dec 2021 13:11:41 -0800 Subject: [PATCH 244/948] chore: remove "using namespace " from AZCore Math (#6372) * chore: remove "using namespace " from AZCore Math REF: https://github.com/o3de/o3de/issues/6281 Signed-off-by: Michael Pollind * chore: fix formatting Signed-off-by: Michael Pollind --- .../AzCore/AzCore/Math/IntersectSegment.cpp | 2496 +++++++++-------- Code/Framework/AzCore/AzCore/Math/Sfmt.cpp | 560 ++-- 2 files changed, 1551 insertions(+), 1505 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Math/IntersectSegment.cpp b/Code/Framework/AzCore/AzCore/Math/IntersectSegment.cpp index 5d13acc34c..4f143cde53 100644 --- a/Code/Framework/AzCore/AzCore/Math/IntersectSegment.cpp +++ b/Code/Framework/AzCore/AzCore/Math/IntersectSegment.cpp @@ -8,1558 +8,1608 @@ #include -using namespace AZ; -using namespace Intersect; - -//========================================================================= -// IntersectSegmentTriangleCCW -// [10/21/2009] -//========================================================================= -bool Intersect::IntersectSegmentTriangleCCW( - const Vector3& p, const Vector3& q, const Vector3& a, const Vector3& b, const Vector3& c, - /*float &u, float &v, float &w,*/ Vector3& normal, float& t) +namespace AZ { - float v, w; // comment this and enable input params if we need the barycentric coordinates + //========================================================================= + // IntersectSegmentTriangleCCW + // [10/21/2009] + //========================================================================= + bool Intersect::IntersectSegmentTriangleCCW( + const Vector3& p, + const Vector3& q, + const Vector3& a, + const Vector3& b, + const Vector3& c, + /*float &u, float &v, float &w,*/ Vector3& normal, + float& t) + { + float v, w; // comment this and enable input params if we need the barycentric coordinates + + Vector3 ab = b - a; + Vector3 ac = c - a; + Vector3 qp = p - q; + + // Compute triangle normal. Can be pre-calculated/cached if + // intersecting multiple segments against the same triangle + normal = ab.Cross(ac); // Right hand CCW + + // Compute denominator d. If d <= 0, segment is parallel to or points + // away from triangle, so exit early + float d = qp.Dot(normal); + if (d <= 0.0f) + { + return false; + } - Vector3 ab = b - a; - Vector3 ac = c - a; - Vector3 qp = p - q; + // Compute intersection t value of pq with plane of triangle. A ray + // intersects iff 0 <= t. Segment intersects iff 0 <= t <= 1. Delay + // dividing by d until intersection has been found to pierce triangle + Vector3 ap = p - a; + t = ap.Dot(normal); - // Compute triangle normal. Can be pre-calculated/cached if - // intersecting multiple segments against the same triangle - normal = ab.Cross(ac); // Right hand CCW + // range segment check t[0,1] (it this case [0,d]) + if (t < 0.0f || t > d) + { + return false; + } - // Compute denominator d. If d <= 0, segment is parallel to or points - // away from triangle, so exit early - float d = qp.Dot(normal); - if (d <= 0.0f) - { - return false; - } + // Compute barycentric coordinate components and test if within bounds + Vector3 e = qp.Cross(ap); + v = ac.Dot(e); + if (v < 0.0f || v > d) + { + return false; + } + w = -ab.Dot(e); + if (w < 0.0f || v + w > d) + { + return false; + } - // Compute intersection t value of pq with plane of triangle. A ray - // intersects iff 0 <= t. Segment intersects iff 0 <= t <= 1. Delay - // dividing by d until intersection has been found to pierce triangle - Vector3 ap = p - a; - t = ap.Dot(normal); + // Segment/ray intersects triangle. Perform delayed division and + // compute the last barycentric coordinate component + float ood = 1.0f / d; + t *= ood; + /*v *= ood; + w *= ood; + u = 1.0f - v - w;*/ - // range segment check t[0,1] (it this case [0,d]) - if (t < 0.0f || t > d) - { - return false; - } + normal.Normalize(); - // Compute barycentric coordinate components and test if within bounds - Vector3 e = qp.Cross(ap); - v = ac.Dot(e); - if (v < 0.0f || v > d) - { - return false; + return true; } - w = -ab.Dot(e); - if (w < 0.0f || v + w > d) + + //========================================================================= + // IntersectSegmentTriangle + // [10/21/2009] + //========================================================================= + bool Intersect::IntersectSegmentTriangle( + const Vector3& p, + const Vector3& q, + const Vector3& a, + const Vector3& b, + const Vector3& c, + /*float &u, float &v, float &w,*/ Vector3& normal, + float& t) { - return false; - } + float v, w; // comment this and enable input params if we need the barycentric coordinates - // Segment/ray intersects triangle. Perform delayed division and - // compute the last barycentric coordinate component - float ood = 1.0f / d; - t *= ood; - /*v *= ood; - w *= ood; - u = 1.0f - v - w;*/ + Vector3 ab = b - a; + Vector3 ac = c - a; + Vector3 qp = p - q; + Vector3 ap = p - a; - normal.Normalize(); + // Compute triangle normal. Can be pre-calculated or cached if + // intersecting multiple segments against the same triangle + normal = ab.Cross(ac); // Right hand CCW - return true; -} + // Compute denominator d. If d <= 0, segment is parallel to or points + // away from triangle, so exit early + float d = qp.Dot(normal); + Vector3 e; + if (d > Constants::FloatEpsilon) + { + // the normal is on the right side + e = qp.Cross(ap); + } + else + { + normal = -normal; -//========================================================================= -// IntersectSegmentTriangle -// [10/21/2009] -//========================================================================= -bool -Intersect::IntersectSegmentTriangle( - const Vector3& p, const Vector3& q, const Vector3& a, const Vector3& b, const Vector3& c, - /*float &u, float &v, float &w,*/ Vector3& normal, float& t) -{ - float v, w; // comment this and enable input params if we need the barycentric coordinates - - Vector3 ab = b - a; - Vector3 ac = c - a; - Vector3 qp = p - q; - Vector3 ap = p - a; - - // Compute triangle normal. Can be pre-calculated or cached if - // intersecting multiple segments against the same triangle - normal = ab.Cross(ac); // Right hand CCW - - // Compute denominator d. If d <= 0, segment is parallel to or points - // away from triangle, so exit early - float d = qp.Dot(normal); - Vector3 e; - if (d > Constants::FloatEpsilon) - { - // the normal is on the right side - e = qp.Cross(ap); - } - else - { - normal = -normal; + // so either have a parallel ray or our normal is flipped + if (d >= -Constants::FloatEpsilon) + { + return false; // parallel + } + d = -d; + e = ap.Cross(qp); + } + + // Compute intersection t value of pq with plane of triangle. A ray + // intersects iff 0 <= t. Segment intersects iff 0 <= t <= 1. Delay + // dividing by d until intersection has been found to pierce triangle + t = ap.Dot(normal); - // so either have a parallel ray or our normal is flipped - if (d >= -Constants::FloatEpsilon) + // range segment check t[0,1] (it this case [0,d]) + if (t < 0.0f || t > d) { - return false; // parallel + return false; } - d = -d; - e = ap.Cross(qp); - } - // Compute intersection t value of pq with plane of triangle. A ray - // intersects iff 0 <= t. Segment intersects iff 0 <= t <= 1. Delay - // dividing by d until intersection has been found to pierce triangle - t = ap.Dot(normal); + // Compute barycentric coordinate components and test if within bounds + v = ac.Dot(e); + if (v < 0.0f || v > d) + { + return false; + } + w = -ab.Dot(e); + if (w < 0.0f || v + w > d) + { + return false; + } - // range segment check t[0,1] (it this case [0,d]) - if (t < 0.0f || t > d) - { - return false; - } + // Segment/ray intersects the triangle. Perform delayed division and + // compute the last barycentric coordinate component + float ood = 1.0f / d; + t *= ood; + // v *= ood; + // w *= ood; + // u = 1.0f - v - w; - // Compute barycentric coordinate components and test if within bounds - v = ac.Dot(e); - if (v < 0.0f || v > d) - { - return false; + normal.Normalize(); + + return true; } - w = -ab.Dot(e); - if (w < 0.0f || v + w > d) + + //========================================================================= + // TestSegmentAABBOrigin + // [10/21/2009] + //========================================================================= + bool Intersect::TestSegmentAABBOrigin(const Vector3& midPoint, const Vector3& halfVector, const Vector3& aabbExtends) { - return false; - } + const Vector3 EPSILON(0.001f); // \todo this is slow load move to a const + Vector3 absHalfVector = halfVector.GetAbs(); + Vector3 absMidpoint = midPoint.GetAbs(); + Vector3 absHalfMidpoint = absHalfVector + aabbExtends; - // Segment/ray intersects the triangle. Perform delayed division and - // compute the last barycentric coordinate component - float ood = 1.0f / d; - t *= ood; - //v *= ood; - //w *= ood; - //u = 1.0f - v - w; + // Try world coordinate axes as separating axes + if (!absMidpoint.IsLessEqualThan(absHalfMidpoint)) + { + return false; + } - normal.Normalize(); + // Add in an epsilon term to counteract arithmetic errors when segment is + // (near) parallel to a coordinate axis (see text for detail) + absHalfVector += EPSILON; - return true; -} + // Try cross products of segment direction vector with coordinate axes + Vector3 absMDCross = midPoint.Cross(halfVector).GetAbs(); + // Vector3 eaDCross = absHalfVector.Cross(aabbExtends); + float ex = aabbExtends.GetX(); + float ey = aabbExtends.GetY(); + float ez = aabbExtends.GetZ(); + float adx = absHalfVector.GetX(); + float ady = absHalfVector.GetY(); + float adz = absHalfVector.GetZ(); -//========================================================================= -// TestSegmentAABBOrigin -// [10/21/2009] -//========================================================================= -bool -AZ::Intersect::TestSegmentAABBOrigin(const Vector3& midPoint, const Vector3& halfVector, const Vector3& aabbExtends) -{ - const Vector3 EPSILON(0.001f); // \todo this is slow load move to a const - Vector3 absHalfVector = halfVector.GetAbs(); - Vector3 absMidpoint = midPoint.GetAbs(); - Vector3 absHalfMidpoint = absHalfVector + aabbExtends; + Vector3 ead(ey * adz + ez * ady, ex * adz + ez * adx, ex * ady + ey * adx); + if (!absMDCross.IsLessEqualThan(ead)) + { + return false; + } - // Try world coordinate axes as separating axes - if (!absMidpoint.IsLessEqualThan(absHalfMidpoint)) - { - return false; + // No separating axis found; segment must be overlapping AABB + return true; } - // Add in an epsilon term to counteract arithmetic errors when segment is - // (near) parallel to a coordinate axis (see text for detail) - absHalfVector += EPSILON; - - // Try cross products of segment direction vector with coordinate axes - Vector3 absMDCross = midPoint.Cross(halfVector).GetAbs(); - //Vector3 eaDCross = absHalfVector.Cross(aabbExtends); - float ex = aabbExtends.GetX(); - float ey = aabbExtends.GetY(); - float ez = aabbExtends.GetZ(); - float adx = absHalfVector.GetX(); - float ady = absHalfVector.GetY(); - float adz = absHalfVector.GetZ(); - - Vector3 ead(ey * adz + ez * ady, ex * adz + ez * adx, ex * ady + ey * adx); - if (!absMDCross.IsLessEqualThan(ead)) + //========================================================================= + // IntersectRayAABB + // [10/21/2009] + //========================================================================= + Intersect::RayAABBIsectTypes Intersect::IntersectRayAABB( + const Vector3& rayStart, + const Vector3& dir, + const Vector3& dirRCP, + const Aabb& aabb, + float& tStart, + float& tEnd, + Vector3& startNormal /*, Vector3& inter*/) { - return false; - } - - // No separating axis found; segment must be overlapping AABB - return true; -} - + // we don't need to test with all 6 normals (just 3) -//========================================================================= -// IntersectRayAABB -// [10/21/2009] -//========================================================================= -RayAABBIsectTypes -AZ::Intersect::IntersectRayAABB( - const Vector3& rayStart, const Vector3& dir, const Vector3& dirRCP, const Aabb& aabb, - float& tStart, float& tEnd, Vector3& startNormal /*, Vector3& inter*/) -{ - // we don't need to test with all 6 normals (just 3) - - const float eps = 0.0001f; // \todo move to constant - float tmin = 0.0f; // set to -RR_FLT_MAX to get first hit on line - float tmax = std::numeric_limits::max(); // set to max distance ray can travel (for segment) + const float eps = 0.0001f; // \todo move to constant + float tmin = 0.0f; // set to -RR_FLT_MAX to get first hit on line + float tmax = std::numeric_limits::max(); // set to max distance ray can travel (for segment) - const Vector3& aabbMin = aabb.GetMin(); - const Vector3& aabbMax = aabb.GetMax(); + const Vector3& aabbMin = aabb.GetMin(); + const Vector3& aabbMax = aabb.GetMax(); - // we unroll manually because there is no way to get in efficient way vectors for - // each axis while getting it as a index - Vector3 time1 = (aabbMin - rayStart) * dirRCP; - Vector3 time2 = (aabbMax - rayStart) * dirRCP; + // we unroll manually because there is no way to get in efficient way vectors for + // each axis while getting it as a index + Vector3 time1 = (aabbMin - rayStart) * dirRCP; + Vector3 time2 = (aabbMax - rayStart) * dirRCP; - // X - if (std::fabs(dir.GetX()) < eps) - { - // Ray is parallel to slab. No hit if origin not within slab - if (rayStart.GetX() < aabbMin.GetX() || rayStart.GetX() > aabbMax.GetX()) + // X + if (std::fabs(dir.GetX()) < eps) { - return ISECT_RAY_AABB_NONE; + // Ray is parallel to slab. No hit if origin not within slab + if (rayStart.GetX() < aabbMin.GetX() || rayStart.GetX() > aabbMax.GetX()) + { + return ISECT_RAY_AABB_NONE; + } } - } - else - { - // Compute intersection t value of ray with near and far plane of slab - float t1 = time1.GetX(); - float t2 = time2.GetX(); - float nSign = -1.0f; - - // Make t1 be intersection with near plane, t2 with far plane - if (t1 > t2) + else { - AZStd::swap(t1, t2); - nSign = 1.0f; - } + // Compute intersection t value of ray with near and far plane of slab + float t1 = time1.GetX(); + float t2 = time2.GetX(); + float nSign = -1.0f; - // Compute the intersection of slab intersections intervals - if (tmin < t1) - { - tmin = t1; + // Make t1 be intersection with near plane, t2 with far plane + if (t1 > t2) + { + AZStd::swap(t1, t2); + nSign = 1.0f; + } - startNormal.Set(nSign, 0.0f, 0.0f); - } + // Compute the intersection of slab intersections intervals + if (tmin < t1) + { + tmin = t1; - tmax = AZ::GetMin(tmax, t2); + startNormal.Set(nSign, 0.0f, 0.0f); + } - // Exit with no collision as soon as slab intersection becomes empty - if (tmin > tmax) - { - return ISECT_RAY_AABB_NONE; - } - } + tmax = AZ::GetMin(tmax, t2); - // Y - if (std::fabs(dir.GetY()) < eps) - { - // Ray is parallel to slab. No hit if origin not within slab - if (rayStart.GetY() < aabbMin.GetY() || rayStart.GetY() > aabbMax.GetY()) - { - return ISECT_RAY_AABB_NONE; + // Exit with no collision as soon as slab intersection becomes empty + if (tmin > tmax) + { + return ISECT_RAY_AABB_NONE; + } } - } - else - { - // Compute intersection t value of ray with near and far plane of slab - float t1 = time1.GetY(); - float t2 = time2.GetY(); - float nSign = -1.0f; - // Make t1 be intersection with near plane, t2 with far plane - if (t1 > t2) + // Y + if (std::fabs(dir.GetY()) < eps) { - AZStd::swap(t1, t2); - nSign = 1.0f; + // Ray is parallel to slab. No hit if origin not within slab + if (rayStart.GetY() < aabbMin.GetY() || rayStart.GetY() > aabbMax.GetY()) + { + return ISECT_RAY_AABB_NONE; + } } - - // Compute the intersection of slab intersections intervals - if (tmin < t1) + else { - tmin = t1; + // Compute intersection t value of ray with near and far plane of slab + float t1 = time1.GetY(); + float t2 = time2.GetY(); + float nSign = -1.0f; - startNormal.Set(0.0f, nSign, 0.0f); - } + // Make t1 be intersection with near plane, t2 with far plane + if (t1 > t2) + { + AZStd::swap(t1, t2); + nSign = 1.0f; + } - tmax = AZ::GetMin(tmax, t2); + // Compute the intersection of slab intersections intervals + if (tmin < t1) + { + tmin = t1; - // Exit with no collision as soon as slab intersection becomes empty - if (tmin > tmax) - { - return ISECT_RAY_AABB_NONE; - } - } + startNormal.Set(0.0f, nSign, 0.0f); + } - // Z - if (std::fabs(dir.GetZ()) < eps) - { - // Ray is parallel to slab. No hit if origin not within slab - if (rayStart.GetZ() < aabbMin.GetZ() || rayStart.GetZ() > aabbMax.GetZ()) - { - return ISECT_RAY_AABB_NONE; - } - } - else - { - // Compute intersection t value of ray with near and far plane of slab - float t1 = time1.GetZ(); - float t2 = time2.GetZ(); - float nSign = -1.0f; + tmax = AZ::GetMin(tmax, t2); - // Make t1 be intersection with near plane, t2 with far plane - if (t1 > t2) - { - AZStd::swap(t1, t2); - nSign = 1.0f; + // Exit with no collision as soon as slab intersection becomes empty + if (tmin > tmax) + { + return ISECT_RAY_AABB_NONE; + } } - // Compute the intersection of slab intersections intervals - if (tmin < t1) + // Z + if (std::fabs(dir.GetZ()) < eps) { - tmin = t1; - - startNormal.Set(0.0f, 0.0f, nSign); + // Ray is parallel to slab. No hit if origin not within slab + if (rayStart.GetZ() < aabbMin.GetZ() || rayStart.GetZ() > aabbMax.GetZ()) + { + return ISECT_RAY_AABB_NONE; + } } - - tmax = AZ::GetMin(tmax, t2); - - // Exit with no collision as soon as slab intersection becomes empty - if (tmin > tmax) + else { - return ISECT_RAY_AABB_NONE; - } - } - - tStart = tmin; - tEnd = tmax; + // Compute intersection t value of ray with near and far plane of slab + float t1 = time1.GetZ(); + float t2 = time2.GetZ(); + float nSign = -1.0f; - if (tmin == 0.0f) // no intersect if the segments starts inside or coincident the aabb - { - return ISECT_RAY_AABB_SA_INSIDE; - } - - // Ray intersects all 3 slabs. Return point (q) and intersection t value (tmin) - //inter = rayStart + dir * tmin; - return ISECT_RAY_AABB_ISECT; -} - -//========================================================================= -// IntersectRayAABB2 -// [2/18/2011] -//========================================================================= -RayAABBIsectTypes -AZ::Intersect::IntersectRayAABB2(const Vector3& rayStart, const Vector3& dirRCP, const Aabb& aabb, float& start, float& end) -{ - float tmin, tmax, tymin, tymax, tzmin, tzmax; - Vector3 vZero = Vector3::CreateZero(); + // Make t1 be intersection with near plane, t2 with far plane + if (t1 > t2) + { + AZStd::swap(t1, t2); + nSign = 1.0f; + } - Vector3 min = (Vector3::CreateSelectCmpGreaterEqual(dirRCP, vZero, aabb.GetMin(), aabb.GetMax()) - rayStart) * dirRCP; - Vector3 max = (Vector3::CreateSelectCmpGreaterEqual(dirRCP, vZero, aabb.GetMax(), aabb.GetMin()) - rayStart) * dirRCP; + // Compute the intersection of slab intersections intervals + if (tmin < t1) + { + tmin = t1; - tmin = min.GetX(); - tmax = max.GetX(); - tymin = min.GetY(); - tymax = max.GetY(); + startNormal.Set(0.0f, 0.0f, nSign); + } - if (tmin > tymax || tymin > tmax) - { - return ISECT_RAY_AABB_NONE; - } + tmax = AZ::GetMin(tmax, t2); - if (tymin > tmin) - { - tmin = tymin; - } + // Exit with no collision as soon as slab intersection becomes empty + if (tmin > tmax) + { + return ISECT_RAY_AABB_NONE; + } + } - if (tymax < tmax) - { - tmax = tymax; - } + tStart = tmin; + tEnd = tmax; - tzmin = min.GetZ(); - tzmax = max.GetZ(); + if (tmin == 0.0f) // no intersect if the segments starts inside or coincident the aabb + { + return ISECT_RAY_AABB_SA_INSIDE; + } - if (tmin > tzmax || tzmin > tmax) - { - return ISECT_RAY_AABB_NONE; + // Ray intersects all 3 slabs. Return point (q) and intersection t value (tmin) + // inter = rayStart + dir * tmin; + return ISECT_RAY_AABB_ISECT; } - if (tzmin > tmin) - { - tmin = tzmin; - } - if (tzmax < tmax) + //========================================================================= + // IntersectRayAABB2 + // [2/18/2011] + //========================================================================= + Intersect::RayAABBIsectTypes Intersect::IntersectRayAABB2( + const Vector3& rayStart, const Vector3& dirRCP, const Aabb& aabb, float& start, float& end) { - tmax = tzmax; - } + float tmin, tmax, tymin, tymax, tzmin, tzmax; + Vector3 vZero = Vector3::CreateZero(); - start = tmin; - end = tmax; + Vector3 min = (Vector3::CreateSelectCmpGreaterEqual(dirRCP, vZero, aabb.GetMin(), aabb.GetMax()) - rayStart) * dirRCP; + Vector3 max = (Vector3::CreateSelectCmpGreaterEqual(dirRCP, vZero, aabb.GetMax(), aabb.GetMin()) - rayStart) * dirRCP; - return ISECT_RAY_AABB_ISECT; -} + tmin = min.GetX(); + tmax = max.GetX(); + tymin = min.GetY(); + tymax = max.GetY(); -bool AZ::Intersect::IntersectRayDisk( - const Vector3& rayOrigin, const Vector3& rayDir, const Vector3& diskCenter, const float diskRadius, const Vector3& diskNormal, float& t) -{ - // First intersect with the plane of the disk - float planeIntersectionDistance; - int intersectionCount = IntersectRayPlane(rayOrigin, rayDir, diskCenter, diskNormal, planeIntersectionDistance); - if (intersectionCount == 1) - { - // If the plane intersection point is inside the disk radius, then it intersected the disk. - Vector3 pointOnPlane = rayOrigin + rayDir * planeIntersectionDistance; - if (pointOnPlane.GetDistance(diskCenter) < diskRadius) + if (tmin > tymax || tymin > tmax) { - t = planeIntersectionDistance; - return true; + return ISECT_RAY_AABB_NONE; } - } - return false; -} -// Reference: Real-Time Collision Detection - 5.3.7 Intersecting Ray or Segment Against Cylinder, and the book's errata. -int AZ::Intersect::IntersectRayCappedCylinder( - const Vector3& rayOrigin, const Vector3& rayDir, - const Vector3& cylinderEnd1, const Vector3& cylinderDir, - float cylinderHeight, float cylinderRadius, float &t1, float &t2) -{ - // dr = rayDir - // dc = cylinderDir - // r = cylinderRadius - // Vector3 cylinderEnd2 = cylinderEnd1 + cylinderHeight * cylinderDir; - Vector3 m = rayOrigin - cylinderEnd1; // vector from cylinderEnd1 to rayOrigin - float dcm = cylinderDir.Dot(m); // projection of m on cylinderDir - float dcdr = cylinderDir.Dot(rayDir); // projection of rayDir on cylinderDir - float drm = rayDir.Dot(m); // projection of m on rayDir - float r2 = cylinderRadius * cylinderRadius; - - if (dcm < 0.0f && dcdr <= 0.0f) - { - return 0; // rayOrigin is outside cylinderEnd1 and rayDir is pointing away from cylinderEnd1 - } - if (dcm > cylinderHeight && dcdr >= 0.0f) - { - return 0; // rayOrigin is outside cylinderEnd2 and rayDir is pointing away from cylinderEnd2 - } - - // point RP on the ray: RP(t) = rayOrigin + t * rayDir - // point CP on the cylinder surface: |(CP - cylinderEnd1) - cylinderDir.Dot(cp - cylinderEnd1) * cylinderDir|^2 = cylinderRadius^2 - // substitute RP(t) for CP: a*t^2 + 2b*t + c = 0, solving for t = [-2b +/- sqrt(4b^2 - 4ac)] / 2a - float a = 1.0f - dcdr * dcdr; // always greater than or equal to 0 - float b = drm - dcm * dcdr; - float c = m.Dot(m) - dcm * dcm - r2; - - const float EPSILON = 0.00001f; + if (tymin > tmin) + { + tmin = tymin; + } - if (fabsf(a) < EPSILON) // the ray is parallel to the cylinder - { - if (c > EPSILON) // the ray is outside the cylinder + if (tymax < tmax) { - return 0; + tmax = tymax; } - else if (dcm < 0.0f) // the ray origin is on cylinderEnd1 side and ray is pointing to cylinderEnd2 + + tzmin = min.GetZ(); + tzmax = max.GetZ(); + + if (tmin > tzmax || tzmin > tmax) { - t1 = -dcm; - t2 = -dcm + cylinderHeight; - return 2; + return ISECT_RAY_AABB_NONE; } - else if (dcm > cylinderHeight) // the ray origin is on cylinderEnd2 side and ray is pointing to cylinderEnd1 + + if (tzmin > tmin) { - t1 = dcm - cylinderHeight; - t2 = dcm; - return 2; + tmin = tzmin; } - else // (dcm > 0.0f && dcm < cylinderHeight) // the ray origin is inside the cylinder + if (tzmax < tmax) { - if (dcdr > 0.0f) // the ray is pointing to cylinderEnd2 - { - t1 = cylinderHeight - dcm; - return 1; - } - else if (dcdr < 0.0f) // the ray is pointing to cylinderEnd1 - { - t2 = dcm; - return 1; - } - else // impossible in theory - { - return 0; - } + tmax = tzmax; } - } - - float discr = b * b - a * c; - if (discr < 0.0f) - { - return 0; - } - float sqrt_discr = sqrt(discr); - float tt1 = (-b - sqrt_discr) / a; - float tt2 = (-b + sqrt_discr) / a; + start = tmin; + end = tmax; - if (tt2 < 0.0f) // both intersections are behind the ray origin - { - return 0; + return ISECT_RAY_AABB_ISECT; } - // Vector3 AP2 = (rayOrigin + tt2 * rayDir) - cylinderEnd1; // vector from cylinderEnd1 to the intersecting point of parameter tt2 - // float s2 = cylinderDir.Dot(AP2); - float s2 = dcm + tt2 * dcdr; - - if (discr < EPSILON) // tt1 == tt2 + bool Intersect::IntersectRayDisk( + const Vector3& rayOrigin, + const Vector3& rayDir, + const Vector3& diskCenter, + const float diskRadius, + const Vector3& diskNormal, + float& t) { - if (s2 >= 0.0f && s2 <= cylinderHeight) + // First intersect with the plane of the disk + float planeIntersectionDistance; + int intersectionCount = IntersectRayPlane(rayOrigin, rayDir, diskCenter, diskNormal, planeIntersectionDistance); + if (intersectionCount == 1) { - t1 = tt1; - return 1; + // If the plane intersection point is inside the disk radius, then it intersected the disk. + Vector3 pointOnPlane = rayOrigin + rayDir * planeIntersectionDistance; + if (pointOnPlane.GetDistance(diskCenter) < diskRadius) + { + t = planeIntersectionDistance; + return true; + } } + return false; } - // Vector3 AP1 = (rayOrigin + tt1 * rayDir) - cylinderEnd1; // vector from cylinderEnd1 to the intersecting point of parameter tt1 - // float s1 = cylinderDir.Dot(AP1); - float s1 = dcm + tt1 * dcdr; - - if (s1 < 0.0f) // intersecting point of parameter tt1 is outside on cylinderEnd1 side + // Reference: Real-Time Collision Detection - 5.3.7 Intersecting Ray or Segment Against Cylinder, and the book's errata. + int Intersect::IntersectRayCappedCylinder( + const Vector3& rayOrigin, + const Vector3& rayDir, + const Vector3& cylinderEnd1, + const Vector3& cylinderDir, + float cylinderHeight, + float cylinderRadius, + float& t1, + float& t2) { - if (s2 < 0.0f) // intersecting point of parameter tt2 is outside on cylinderEnd1 side + // dr = rayDir + // dc = cylinderDir + // r = cylinderRadius + // Vector3 cylinderEnd2 = cylinderEnd1 + cylinderHeight * cylinderDir; + Vector3 m = rayOrigin - cylinderEnd1; // vector from cylinderEnd1 to rayOrigin + float dcm = cylinderDir.Dot(m); // projection of m on cylinderDir + float dcdr = cylinderDir.Dot(rayDir); // projection of rayDir on cylinderDir + float drm = rayDir.Dot(m); // projection of m on rayDir + float r2 = cylinderRadius * cylinderRadius; + + if (dcm < 0.0f && dcdr <= 0.0f) { - return 0; + return 0; // rayOrigin is outside cylinderEnd1 and rayDir is pointing away from cylinderEnd1 } - else if (s2 == 0.0f) // ray touching the brim of the cylinderEnd1 + if (dcm > cylinderHeight && dcdr >= 0.0f) { - t1 = tt2; - return 1; + return 0; // rayOrigin is outside cylinderEnd2 and rayDir is pointing away from cylinderEnd2 } - else + + // point RP on the ray: RP(t) = rayOrigin + t * rayDir + // point CP on the cylinder surface: |(CP - cylinderEnd1) - cylinderDir.Dot(cp - cylinderEnd1) * cylinderDir|^2 = cylinderRadius^2 + // substitute RP(t) for CP: a*t^2 + 2b*t + c = 0, solving for t = [-2b +/- sqrt(4b^2 - 4ac)] / 2a + float a = 1.0f - dcdr * dcdr; // always greater than or equal to 0 + float b = drm - dcm * dcdr; + float c = m.Dot(m) - dcm * dcm - r2; + + const float EPSILON = 0.00001f; + + if (fabsf(a) < EPSILON) // the ray is parallel to the cylinder { - if (s2 > cylinderHeight) // intersecting point of parameter tt2 is outside on cylinderEnd2 side + if (c > EPSILON) // the ray is outside the cylinder { - // t2 can be computed from the equation: dot(rayOrigin + t2 * rayDir - cylinderEnd1, cylinderDir) = cylinderHeight - t2 = (cylinderHeight - dcm) / dcdr; + return 0; } - else + else if (dcm < 0.0f) // the ray origin is on cylinderEnd1 side and ray is pointing to cylinderEnd2 { - t2 = tt2; + t1 = -dcm; + t2 = -dcm + cylinderHeight; + return 2; } - if (dcm > 0.0f) // ray origin inside cylinder + else if (dcm > cylinderHeight) // the ray origin is on cylinderEnd2 side and ray is pointing to cylinderEnd1 { - t1 = t2; - return 1; + t1 = dcm - cylinderHeight; + t2 = dcm; + return 2; } - else + else // (dcm > 0.0f && dcm < cylinderHeight) // the ray origin is inside the cylinder { - // t1 can be computed from the equation: dot(rayOrigin + t1 * rayDir - cylinderEnd1, cylinderDir) = 0 - t1 = -dcm / dcdr; - return 2; + if (dcdr > 0.0f) // the ray is pointing to cylinderEnd2 + { + t1 = cylinderHeight - dcm; + return 1; + } + else if (dcdr < 0.0f) // the ray is pointing to cylinderEnd1 + { + t2 = dcm; + return 1; + } + else // impossible in theory + { + return 0; + } } } - } - else if (s1 > cylinderHeight) // intersecting point of parameter tt1 is outside on cylinderEnd2 side - { - if (s2 > cylinderHeight) // intersecting point of parameter tt2 is outside on cylinderEnd2 side + + float discr = b * b - a * c; + if (discr < 0.0f) { return 0; } - else if (s2 == cylinderHeight) + + float sqrt_discr = sqrt(discr); + float tt1 = (-b - sqrt_discr) / a; + float tt2 = (-b + sqrt_discr) / a; + + if (tt2 < 0.0f) // both intersections are behind the ray origin { - t1 = tt2; - return 1; + return 0; } - else + + // Vector3 AP2 = (rayOrigin + tt2 * rayDir) - cylinderEnd1; // vector from cylinderEnd1 to the intersecting point of parameter tt2 + // float s2 = cylinderDir.Dot(AP2); + float s2 = dcm + tt2 * dcdr; + + if (discr < EPSILON) // tt1 == tt2 { - if (s2 < 0.0f) + if (s2 >= 0.0f && s2 <= cylinderHeight) { - t2 = -dcm / dcdr; + t1 = tt1; + return 1; } - else + } + + // Vector3 AP1 = (rayOrigin + tt1 * rayDir) - cylinderEnd1; // vector from cylinderEnd1 to the intersecting point of parameter tt1 + // float s1 = cylinderDir.Dot(AP1); + float s1 = dcm + tt1 * dcdr; + + if (s1 < 0.0f) // intersecting point of parameter tt1 is outside on cylinderEnd1 side + { + if (s2 < 0.0f) // intersecting point of parameter tt2 is outside on cylinderEnd1 side { - t2 = tt2; + return 0; } - if (dcm < cylinderHeight) + else if (s2 == 0.0f) // ray touching the brim of the cylinderEnd1 { - t1 = t2; + t1 = tt2; return 1; } else { - t1 = (cylinderHeight - dcm) / dcdr; - return 2; - } - } - } - else // intersecting point of parameter tt1 is in between two cylinder ends - { - if (s2 < 0.0f) - { - t2 = -dcm / dcdr; - } - else if (s2 > cylinderHeight) - { - t2 = (cylinderHeight - dcm) / dcdr; - } - else - { - t2 = tt2; + if (s2 > cylinderHeight) // intersecting point of parameter tt2 is outside on cylinderEnd2 side + { + // t2 can be computed from the equation: dot(rayOrigin + t2 * rayDir - cylinderEnd1, cylinderDir) = cylinderHeight + t2 = (cylinderHeight - dcm) / dcdr; + } + else + { + t2 = tt2; + } + if (dcm > 0.0f) // ray origin inside cylinder + { + t1 = t2; + return 1; + } + else + { + // t1 can be computed from the equation: dot(rayOrigin + t1 * rayDir - cylinderEnd1, cylinderDir) = 0 + t1 = -dcm / dcdr; + return 2; + } + } } - if (tt1 > 0.0f) + else if (s1 > cylinderHeight) // intersecting point of parameter tt1 is outside on cylinderEnd2 side { - t1 = tt1; - return 2; + if (s2 > cylinderHeight) // intersecting point of parameter tt2 is outside on cylinderEnd2 side + { + return 0; + } + else if (s2 == cylinderHeight) + { + t1 = tt2; + return 1; + } + else + { + if (s2 < 0.0f) + { + t2 = -dcm / dcdr; + } + else + { + t2 = tt2; + } + if (dcm < cylinderHeight) + { + t1 = t2; + return 1; + } + else + { + t1 = (cylinderHeight - dcm) / dcdr; + return 2; + } + } } - else + else // intersecting point of parameter tt1 is in between two cylinder ends { - t1 = t2; - return 1; + if (s2 < 0.0f) + { + t2 = -dcm / dcdr; + } + else if (s2 > cylinderHeight) + { + t2 = (cylinderHeight - dcm) / dcdr; + } + else + { + t2 = tt2; + } + if (tt1 > 0.0f) + { + t1 = tt1; + return 2; + } + else + { + t1 = t2; + return 1; + } } } -} -int AZ::Intersect::IntersectRayCone( - const Vector3& rayOrigin, const Vector3& rayDir, - const Vector3& coneApex, const Vector3& coneDir, float coneHeight, - float coneBaseRadius, float& t1, float& t2) -{ - // Q = rayOrgin, A = coneApex - Vector3 AQ = rayOrigin - coneApex; - float m = coneDir.Dot(AQ); // projection of m on cylinderDir - float k = coneDir.Dot(rayDir); // projection of rayDir on cylinderDir - - if (m < 0.0f && k <= 0.0f) - { - // rayOrigin is outside the cone on coneApex side and rayDir is pointing away - return 0; - } - if (m > coneHeight && k >= 0.0f) + int Intersect::IntersectRayCone( + const Vector3& rayOrigin, + const Vector3& rayDir, + const Vector3& coneApex, + const Vector3& coneDir, + float coneHeight, + float coneBaseRadius, + float& t1, + float& t2) { - // rayOrigin is outside the cone on coneBase side and rayDir is pointing away - return 0; - } - - float r2 = coneBaseRadius * coneBaseRadius; - float h2 = coneHeight * coneHeight; + // Q = rayOrgin, A = coneApex + Vector3 AQ = rayOrigin - coneApex; + float m = coneDir.Dot(AQ); // projection of m on cylinderDir + float k = coneDir.Dot(rayDir); // projection of rayDir on cylinderDir - float m2 = m * m; - float k2 = k * k; - float q2 = AQ.Dot(AQ); - - float n = rayDir.Dot(AQ); + if (m < 0.0f && k <= 0.0f) + { + // rayOrigin is outside the cone on coneApex side and rayDir is pointing away + return 0; + } + if (m > coneHeight && k >= 0.0f) + { + // rayOrigin is outside the cone on coneBase side and rayDir is pointing away + return 0; + } - const float EPSILON = 0.00001f; + float r2 = coneBaseRadius * coneBaseRadius; + float h2 = coneHeight * coneHeight; - // point RP on the ray: RP(t) = rayOrigin + t * rayDir - // point CP on the cone surface: similar triangle property - // |dot(CP - A, coneDir) * coneDir| / coneHeight = |(CP - A) - (dot(CP - A, coneDir) * coneDir)| coneRadius - // substitute RP(t) for CP: a*t^2 + 2b*t + c = 0, solving for t - float a = (r2 + h2) * k2 - h2; - float b = (r2 + h2) * m * k - h2 * n; - float c = (r2 + h2) * m2 - h2 * q2; + float m2 = m * m; + float k2 = k * k; + float q2 = AQ.Dot(AQ); - float discriminant = b * b - a * c; - if (discriminant < -EPSILON) - { - return 0; - } - discriminant = AZ::GetMax(discriminant, 0.0f); + float n = rayDir.Dot(AQ); - if (fabsf(a) < EPSILON) // the ray is parallel to the cone surface's tangent line - { - if (b < EPSILON && fabsf(c) < EPSILON) // ray overlapping with cone surface - { - t1 = rayDir.Dot(coneApex - rayOrigin); - } - else // ray has only one intersecting point with the cone - { - t1 = -c / (2 * b); - } + const float EPSILON = 0.00001f; - t2 = (coneHeight - m) / k; // t2 can be computed from the equation: dot(Q + t2 * rayDir - A, coneDir) = coneHeight + // point RP on the ray: RP(t) = rayOrigin + t * rayDir + // point CP on the cone surface: similar triangle property + // |dot(CP - A, coneDir) * coneDir| / coneHeight = |(CP - A) - (dot(CP - A, coneDir) * coneDir)| coneRadius + // substitute RP(t) for CP: a*t^2 + 2b*t + c = 0, solving for t + float a = (r2 + h2) * k2 - h2; + float b = (r2 + h2) * m * k - h2 * n; + float c = (r2 + h2) * m2 - h2 * q2; - if (t1 < 0.0f && t2 < 0.0f) + float discriminant = b * b - a * c; + if (discriminant < -EPSILON) { return 0; } + discriminant = AZ::GetMax(discriminant, 0.0f); - if (fabsf(t1 - t2) < EPSILON) // the ray intersects the brim of the circumference of the cone base + if (fabsf(a) < EPSILON) // the ray is parallel to the cone surface's tangent line { - return 1; - } + if (b < EPSILON && fabsf(c) < EPSILON) // ray overlapping with cone surface + { + t1 = rayDir.Dot(coneApex - rayOrigin); + } + else // ray has only one intersecting point with the cone + { + t1 = -c / (2 * b); + } - float s1 = m + t1 * k; // coneDir.Dot(rayOrigin + t1 * rayDir - coneApex); - if (s1 < 0.0f || s1 > coneHeight) - { - return 0; - } - else - { - if (k < 0.0f) // ray shooting from base to apex + t2 = (coneHeight - m) / k; // t2 can be computed from the equation: dot(Q + t2 * rayDir - A, coneDir) = coneHeight + + if (t1 < 0.0f && t2 < 0.0f) { - if (m >= coneHeight) // ray origin outside cone - { - float temp = t1; - t1 = t2; - t2 = temp; - return 2; - } - else if (t1 >= 0.0f) // ray origin inside cone - { - t1 = t2; - return 1; - } - else - { - return 0; - } + return 0; + } + + if (fabsf(t1 - t2) < EPSILON) // the ray intersects the brim of the circumference of the cone base + { + return 1; + } + + float s1 = m + t1 * k; // coneDir.Dot(rayOrigin + t1 * rayDir - coneApex); + if (s1 < 0.0f || s1 > coneHeight) + { + return 0; } else { - if (m > coneHeight) - { - return 0; - } - if (t1 >= 0.0f) // ray origin outside cone + if (k < 0.0f) // ray shooting from base to apex { - return 2; + if (m >= coneHeight) // ray origin outside cone + { + float temp = t1; + t1 = t2; + t2 = temp; + return 2; + } + else if (t1 >= 0.0f) // ray origin inside cone + { + t1 = t2; + return 1; + } + else + { + return 0; + } } else { - t1 = t2; - return 1; + if (m > coneHeight) + { + return 0; + } + if (t1 >= 0.0f) // ray origin outside cone + { + return 2; + } + else + { + t1 = t2; + return 1; + } } } } - } - if (discriminant < EPSILON) // two intersecting points coincide - { - if (fabsf(n * n - q2) < EPSILON) // the ray is through the apex + if (discriminant < EPSILON) // two intersecting points coincide { - float cosineA2 = h2 / (r2 + h2); - float cosineAQ2 = cosineA2 * q2; - - if (m2 > cosineAQ2) // the ray origin is inside the cone or its mirroring counterpart + if (fabsf(n * n - q2) < EPSILON) // the ray is through the apex { - if (m <= 0.0f) // the ray origin outside the cone on the apex side, shooting towards the base - { - t1 = -b / a; - t2 = (coneHeight - m) / k; - return 2; - } - else if (m >= coneHeight) // the ray origin is outside the cone on the base side, shooting towards towards the apex + float cosineA2 = h2 / (r2 + h2); + float cosineAQ2 = cosineA2 * q2; + + if (m2 > cosineAQ2) // the ray origin is inside the cone or its mirroring counterpart { - t1 = (coneHeight - m) / k; - t2 = -b / a; - return 2; + if (m <= 0.0f) // the ray origin outside the cone on the apex side, shooting towards the base + { + t1 = -b / a; + t2 = (coneHeight - m) / k; + return 2; + } + else if (m >= coneHeight) // the ray origin is outside the cone on the base side, shooting towards towards the apex + { + t1 = (coneHeight - m) / k; + t2 = -b / a; + return 2; + } + else + { + if (k > 0.0f) // the ray origin is inside the cone, shooting towards the base + { + t1 = (coneHeight - m) / k; + return 1; + } + else // the ray origin is inside the cone, shooting towards the apex + { + t1 = -b / a; + return 1; + } + } } - else + else // the ray origin is outside the cone { - if (k > 0.0f) // the ray origin is inside the cone, shooting towards the base + t1 = -b / a; + if (t1 > 0.0f) { - t1 = (coneHeight - m) / k; return 1; } - else // the ray origin is inside the cone, shooting towards the apex + else { - t1 = -b / a; - return 1; + return 0; } } } - else // the ray origin is outside the cone + else // the ray is touching the cone surface but not through the apex { t1 = -b / a; if (t1 > 0.0f) { - return 1; - } - else - { - return 0; - } - } - } - else // the ray is touching the cone surface but not through the apex - { - t1 = -b / a; - if (t1 > 0.0f) - { - float s1 = m + t1 * k; // projection length of the line segment from the apex to intersection_t1 onto the coneDir - if (s1 >= 0.0f && s1 <= coneHeight) - { - return 1; + float s1 = m + t1 * k; // projection length of the line segment from the apex to intersection_t1 onto the coneDir + if (s1 >= 0.0f && s1 <= coneHeight) + { + return 1; + } } + return 0; } - return 0; } - } - - float sqrtDiscr = sqrt(discriminant); - float tt1 = (-b - sqrtDiscr) / a; - float tt2 = (-b + sqrtDiscr) / a; - /* Test s1 and s2 to see the positions of the intersecting points relative to the cylinder's two ends. */ + float sqrtDiscr = sqrt(discriminant); + float tt1 = (-b - sqrtDiscr) / a; + float tt2 = (-b + sqrtDiscr) / a; - // s1 = coneDir.Dot(rayOrigin + tt1 * rayDir - coneApex), which expands into the following - float s1 = m + tt1 * k; - // s2 = coneDir.Dot(rayOrigin + tt2 * rayDir - coneApex), which expands into the following - float s2 = m + tt2 * k; + /* Test s1 and s2 to see the positions of the intersecting points relative to the cylinder's two ends. */ - if (s1 < 0.0f) - { - if (s2 < 0.0f || s2 > coneHeight) - { - return 0; - } - else + // s1 = coneDir.Dot(rayOrigin + tt1 * rayDir - coneApex), which expands into the following + float s1 = m + tt1 * k; + // s2 = coneDir.Dot(rayOrigin + tt2 * rayDir - coneApex), which expands into the following + float s2 = m + tt2 * k; + + if (s1 < 0.0f) { - if (tt2 >= 0.0f) // ray origin outside cone - { - t1 = tt2; - t2 = (coneHeight - m) / k; - return 2; - } - else if (m > coneHeight) // ray origin outside cone on the base side, the + if (s2 < 0.0f || s2 > coneHeight) { return 0; } else { - t1 = (coneHeight - m) / k; - return 1; - } - } - } - else if (s1 > coneHeight) - { - if (s2 < 0.0f || s2 > coneHeight ) - { - return 0; - } - else - { - if (tt2 < 0.0f) - { - return 0; - } - else if (m >= coneHeight) - { - t1 = (coneHeight - m) / k; - t2 = tt2; - return 2; - } - else // ray origin inside cone - { - t1 = tt2; - return 1; + if (tt2 >= 0.0f) // ray origin outside cone + { + t1 = tt2; + t2 = (coneHeight - m) / k; + return 2; + } + else if (m > coneHeight) // ray origin outside cone on the base side, the + { + return 0; + } + else + { + t1 = (coneHeight - m) / k; + return 1; + } } } - } - else - { - if (s2 < 0.0f) + else if (s1 > coneHeight) { - if (m >= coneHeight) - { - t1 = (coneHeight - m) / k; - t2 = tt1; - return 2; - } - else if (tt1 >= 0.0f) // ray origin inside cone - { - t1 = tt1; - return 1; - } - else + if (s2 < 0.0f || s2 > coneHeight) { return 0; } - } - else if (s2 > coneHeight) - { - if (tt1 >= 0.0f) - { - t1 = tt1; - t2 = (coneHeight - m) / k; - return 2; - } - else if (m <= coneHeight) - { - t1 = (coneHeight - m) / k; - return 1; - } else { - return 0; + if (tt2 < 0.0f) + { + return 0; + } + else if (m >= coneHeight) + { + t1 = (coneHeight - m) / k; + t2 = tt2; + return 2; + } + else // ray origin inside cone + { + t1 = tt2; + return 1; + } } } else { - if (tt1 >= 0.0f) + if (s2 < 0.0f) { - t1 = tt1; - t2 = tt2; - return 2; + if (m >= coneHeight) + { + t1 = (coneHeight - m) / k; + t2 = tt1; + return 2; + } + else if (tt1 >= 0.0f) // ray origin inside cone + { + t1 = tt1; + return 1; + } + else + { + return 0; + } } - else if (tt2 >= 0.0f) + else if (s2 > coneHeight) { - t1 = tt2; - return 1; + if (tt1 >= 0.0f) + { + t1 = tt1; + t2 = (coneHeight - m) / k; + return 2; + } + else if (m <= coneHeight) + { + t1 = (coneHeight - m) / k; + return 1; + } + else + { + return 0; + } } else { - return 0; - } - } - } -} - -int AZ::Intersect::IntersectRayPlane(const Vector3& rayOrigin, const Vector3& rayDir, const Vector3& planePos, const Vector3& planeNormal, float& t) -{ - // (rayOrigin + t * rayDir - planePos).dot(planeNormal) = 0 - - const float EPSILON = 0.00001f; - - float n = rayDir.Dot(planeNormal); - if (fabsf(n) < EPSILON) - { - return 0; - } - - t = planeNormal.Dot(planePos - rayOrigin) / n; - if (t < 0.0f) - { - return 0; - } - else - { - return 1; - } -} - -int AZ::Intersect::IntersectRayQuad( - const Vector3& rayOrigin, const Vector3& rayDir, const Vector3& vertexA, - const Vector3& vertexB, const Vector3& vertexC, const Vector3& vertexD, float& t) -{ - const float EPSILON = 0.0001f; - - Vector3 AC = vertexC - vertexA; - Vector3 AB = vertexB - vertexA; - Vector3 QA = vertexA - rayOrigin; - - Vector3 triN = AB.Cross(AC); // the normal of the triangle ABC - float dn = rayDir.Dot(triN); - - // Early-out if ray is facing away from ABC triangle - if (dn * triN.Dot(QA) < 0) - { - return 0; - } - - Vector3 E = rayDir.Cross(QA); - float dnAbs = 0.0f; - - if (dn < -EPSILON) // vertices have counter-clock wise winding when looking at the quad from rayOrigin - { - dnAbs = -dn; - } - else if (dn > EPSILON) - { - E = -E; - dnAbs = dn; - } - else // the ray is parallel to the quad plane - { - return 0; - } - - // compute barycentric coordinates - float v = E.Dot(AC); - - if (v >= 0.0f && v < dnAbs) - { - float w = -E.Dot(AB); - if (w < 0.0f || v + w > dnAbs) - { - return 0; - } - } - else if (v < 0.0f && v > -dnAbs) - { - Vector3 DA = vertexA - vertexD; - float w = E.Dot(DA); - if (w > 0.0f || v + w < -dnAbs) // v, w are negative - { - return 0; - } - } - else - { - return 0; - } - - t = triN.Dot(QA) / dn; - return 1; -} - -// reference: Real-Time Collision Detection, 5.3.3 Intersecting Ray or Segment Against Box -bool AZ::Intersect::IntersectRayBox( - const Vector3& rayOrigin, const Vector3& rayDir, const Vector3& boxCenter, const Vector3& boxAxis1, - const Vector3& boxAxis2, const Vector3& boxAxis3, float boxHalfExtent1, float boxHalfExtent2, float boxHalfExtent3, float& t) -{ - const float EPSILON = 0.00001f; - - float tmin = 0.0f; // the nearest to the ray origin - float tmax = AZ::Constants::FloatMax; // the farthest from the ray origin - - Vector3 P = boxCenter - rayOrigin; // precomputed variable for calculating the vector from rayOrigin to a point on each box facet - Vector3 QAp; // vector from rayOrigin to the center of the facet of boxAxis - Vector3 QAn; // vector from rayOrigin to the center of the facet of -boxAxis - float tp = 0.0f; - float tn = 0.0f; - bool isRayOriginInsideBox = true; - - /* Test the slab_1 formed by the planes with normals boxAxis1 and -boxAxis1. */ - - Vector3 axis1 = boxHalfExtent1 * boxAxis1; - - QAp = P + axis1; - tp = QAp.Dot(boxAxis1); - - QAn = P - axis1; - tn = -QAn.Dot(boxAxis1); - - float n = rayDir.Dot(boxAxis1); - if (fabsf(n) < EPSILON) - { - // If the ray is parallel to the slab and the ray origin is outside, return no intersection. - if (tp < 0.0f || tn < 0.0f) - { - return false; + if (tt1 >= 0.0f) + { + t1 = tt1; + t2 = tt2; + return 2; + } + else if (tt2 >= 0.0f) + { + t1 = tt2; + return 1; + } + else + { + return 0; + } + } } } - else + + int Intersect::IntersectRayPlane( + const Vector3& rayOrigin, const Vector3& rayDir, const Vector3& planePos, const Vector3& planeNormal, float& t) { - if (tp < 0.0f || tn < 0.0f) + // (rayOrigin + t * rayDir - planePos).dot(planeNormal) = 0 + + const float EPSILON = 0.00001f; + + float n = rayDir.Dot(planeNormal); + if (fabsf(n) < EPSILON) { - isRayOriginInsideBox = false; + return 0; } - float div = 1.0f / n; - float t1 = tp * div; - float t2 = tn * (-div); - if (t1 > t2) + t = planeNormal.Dot(planePos - rayOrigin) / n; + if (t < 0.0f) { - AZStd::swap(t1, t2); + return 0; } - tmin = AZ::GetMax(tmin, t1); - tmax = AZ::GetMin(tmax, t2); - if (tmin > tmax) + else { - return false; + return 1; } } - /* test the slab_2 formed by plane with normals boxAxis2 and -boxAxis2 */ + int Intersect::IntersectRayQuad( + const Vector3& rayOrigin, + const Vector3& rayDir, + const Vector3& vertexA, + const Vector3& vertexB, + const Vector3& vertexC, + const Vector3& vertexD, + float& t) + { + const float EPSILON = 0.0001f; + + Vector3 AC = vertexC - vertexA; + Vector3 AB = vertexB - vertexA; + Vector3 QA = vertexA - rayOrigin; - Vector3 axis2 = boxHalfExtent2 * boxAxis2; + Vector3 triN = AB.Cross(AC); // the normal of the triangle ABC + float dn = rayDir.Dot(triN); - QAp = P + axis2; - tp = QAp.Dot(boxAxis2); + // Early-out if ray is facing away from ABC triangle + if (dn * triN.Dot(QA) < 0) + { + return 0; + } - QAn = P - axis2; - tn = -QAn.Dot(boxAxis2); + Vector3 E = rayDir.Cross(QA); + float dnAbs = 0.0f; - n = rayDir.Dot(boxAxis2); - if (fabsf(n) < EPSILON) - { - // If the ray is parallel to the slab and the ray origin is outside, return no intersection. - if (tp < 0.0f || tn < 0.0f) + if (dn < -EPSILON) // vertices have counter-clock wise winding when looking at the quad from rayOrigin { - return false; + dnAbs = -dn; } - } - else - { - if (tp < 0.0f || tn < 0.0f) + else if (dn > EPSILON) + { + E = -E; + dnAbs = dn; + } + else // the ray is parallel to the quad plane { - isRayOriginInsideBox = false; + return 0; } - float div = 1.0f / n; - float t1 = tp * div; - float t2 = tn * (-div); - if (t1 > t2) + // compute barycentric coordinates + float v = E.Dot(AC); + + if (v >= 0.0f && v < dnAbs) { - AZStd::swap(t1, t2); + float w = -E.Dot(AB); + if (w < 0.0f || v + w > dnAbs) + { + return 0; + } } - tmin = AZ::GetMax(tmin, t1); - tmax = AZ::GetMin(tmax, t2); - if (tmin > tmax) + else if (v < 0.0f && v > -dnAbs) { - return false; + Vector3 DA = vertexA - vertexD; + float w = E.Dot(DA); + if (w > 0.0f || v + w < -dnAbs) // v, w are negative + { + return 0; + } } + else + { + return 0; + } + + t = triN.Dot(QA) / dn; + return 1; } - /* test the slab_3 formed by plane with normals boxAxis3 and -boxAxis3 */ + // reference: Real-Time Collision Detection, 5.3.3 Intersecting Ray or Segment Against Box + bool Intersect::IntersectRayBox( + const Vector3& rayOrigin, + const Vector3& rayDir, + const Vector3& boxCenter, + const Vector3& boxAxis1, + const Vector3& boxAxis2, + const Vector3& boxAxis3, + float boxHalfExtent1, + float boxHalfExtent2, + float boxHalfExtent3, + float& t) + { + const float EPSILON = 0.00001f; - Vector3 axis3 = boxHalfExtent3 * boxAxis3; + float tmin = 0.0f; // the nearest to the ray origin + float tmax = AZ::Constants::FloatMax; // the farthest from the ray origin - QAp = P + axis3; - tp = QAp.Dot(boxAxis3); + Vector3 P = boxCenter - rayOrigin; // precomputed variable for calculating the vector from rayOrigin to a point on each box facet + Vector3 QAp; // vector from rayOrigin to the center of the facet of boxAxis + Vector3 QAn; // vector from rayOrigin to the center of the facet of -boxAxis + float tp = 0.0f; + float tn = 0.0f; + bool isRayOriginInsideBox = true; - QAn = P - axis3; - tn = -QAn.Dot(boxAxis3); + /* Test the slab_1 formed by the planes with normals boxAxis1 and -boxAxis1. */ - n = rayDir.Dot(boxAxis3); - if (fabsf(n) < EPSILON) - { - // If the ray is parallel to the slab and the ray origin is outside, return no intersection. - if (tp < 0.0f || tn < 0.0f) - { - return false; - } - } - else - { - if (tp < 0.0f || tn < 0.0f) - { - isRayOriginInsideBox = false; - } + Vector3 axis1 = boxHalfExtent1 * boxAxis1; + + QAp = P + axis1; + tp = QAp.Dot(boxAxis1); - float div = 1.0f / n; - float t1 = tp * div; - float t2 = tn * (-div); - if (t1 > t2) + QAn = P - axis1; + tn = -QAn.Dot(boxAxis1); + + float n = rayDir.Dot(boxAxis1); + if (fabsf(n) < EPSILON) { - AZStd::swap(t1, t2); + // If the ray is parallel to the slab and the ray origin is outside, return no intersection. + if (tp < 0.0f || tn < 0.0f) + { + return false; + } } - tmin = AZ::GetMax(tmin, t1); - tmax = AZ::GetMin(tmax, t2); - if (tmin > tmax) + else { - return false; + if (tp < 0.0f || tn < 0.0f) + { + isRayOriginInsideBox = false; + } + + float div = 1.0f / n; + float t1 = tp * div; + float t2 = tn * (-div); + if (t1 > t2) + { + AZStd::swap(t1, t2); + } + tmin = AZ::GetMax(tmin, t1); + tmax = AZ::GetMin(tmax, t2); + if (tmin > tmax) + { + return false; + } } - } - t = (isRayOriginInsideBox ? tmax : tmin); - return true; -} + /* test the slab_2 formed by plane with normals boxAxis2 and -boxAxis2 */ -bool AZ::Intersect::IntersectRayObb(const Vector3& rayOrigin, const Vector3& rayDir, const Obb& obb, float& t) -{ - return AZ::Intersect::IntersectRayBox(rayOrigin, rayDir, obb.GetPosition(), - obb.GetAxisX(), obb.GetAxisY(), obb.GetAxisZ(), - obb.GetHalfLengthX(), obb.GetHalfLengthY(), obb.GetHalfLengthZ(), t); -} + Vector3 axis2 = boxHalfExtent2 * boxAxis2; -//========================================================================= -// IntersectSegmentCylinder -// [10/21/2009] -//========================================================================= -CylinderIsectTypes -AZ::Intersect::IntersectSegmentCylinder( - const Vector3& sa, const Vector3& dir, const Vector3& p, const Vector3& q, const float r, float& t) -{ - const float epsilon = 0.001f; - Vector3 d = q - p; // can be cached - Vector3 m = sa - p; // -"- - Vector3 n = /*sb - sa*/ dir; // -"- + QAp = P + axis2; + tp = QAp.Dot(boxAxis2); - float md = m.Dot(d); - float nd = n.Dot(d); - float dd = d.Dot(d); + QAn = P - axis2; + tn = -QAn.Dot(boxAxis2); - // Test if segment fully outside either endcap of cylinder - if (md < 0.0f && md + nd < 0.0f) - { - return RR_ISECT_RAY_CYL_NONE; // Segment outside 'p' side of cylinder - } - if (md > dd && md + nd > dd) - { - return RR_ISECT_RAY_CYL_NONE; // Segment outside 'q' side of cylinder - } - float nn = n.Dot(n); - float mn = m.Dot(n); - float a = dd * nn - nd * nd; - float k = m.Dot(m) - r * r; - float c = dd * k - md * md; - if (std::fabs(a) < epsilon) - { - // Segment runs parallel to cylinder axis - if (c > 0.0f) + n = rayDir.Dot(boxAxis2); + if (fabsf(n) < EPSILON) { - return RR_ISECT_RAY_CYL_NONE; // 'a' and thus the segment lie outside cylinder + // If the ray is parallel to the slab and the ray origin is outside, return no intersection. + if (tp < 0.0f || tn < 0.0f) + { + return false; + } } - // Now known that segment intersects cylinder; figure out how it intersects - if (md < 0.0f) + else { - t = -mn / nn; // Intersect segment against 'p' endcap - return RR_ISECT_RAY_CYL_P_SIDE; + if (tp < 0.0f || tn < 0.0f) + { + isRayOriginInsideBox = false; + } + + float div = 1.0f / n; + float t1 = tp * div; + float t2 = tn * (-div); + if (t1 > t2) + { + AZStd::swap(t1, t2); + } + tmin = AZ::GetMax(tmin, t1); + tmax = AZ::GetMin(tmax, t2); + if (tmin > tmax) + { + return false; + } } - else if (md > dd) + + /* test the slab_3 formed by plane with normals boxAxis3 and -boxAxis3 */ + + Vector3 axis3 = boxHalfExtent3 * boxAxis3; + + QAp = P + axis3; + tp = QAp.Dot(boxAxis3); + + QAn = P - axis3; + tn = -QAn.Dot(boxAxis3); + + n = rayDir.Dot(boxAxis3); + if (fabsf(n) < EPSILON) { - t = (nd - mn) / nn; // Intersect segment against 'q' endcap - return RR_ISECT_RAY_CYL_Q_SIDE; + // If the ray is parallel to the slab and the ray origin is outside, return no intersection. + if (tp < 0.0f || tn < 0.0f) + { + return false; + } } else { - // 'a' lies inside cylinder - t = 0.0f; - return RR_ISECT_RAY_CYL_SA_INSIDE; + if (tp < 0.0f || tn < 0.0f) + { + isRayOriginInsideBox = false; + } + + float div = 1.0f / n; + float t1 = tp * div; + float t2 = tn * (-div); + if (t1 > t2) + { + AZStd::swap(t1, t2); + } + tmin = AZ::GetMax(tmin, t1); + tmax = AZ::GetMin(tmax, t2); + if (tmin > tmax) + { + return false; + } } + + t = (isRayOriginInsideBox ? tmax : tmin); + return true; } - float b = dd * mn - nd * md; - float discr = b * b - a * c; - if (discr < 0.0f) + + bool Intersect::IntersectRayObb(const Vector3& rayOrigin, const Vector3& rayDir, const Obb& obb, float& t) { - return RR_ISECT_RAY_CYL_NONE; // No real roots; no intersection + return Intersect::IntersectRayBox( + rayOrigin, rayDir, obb.GetPosition(), obb.GetAxisX(), obb.GetAxisY(), obb.GetAxisZ(), obb.GetHalfLengthX(), + obb.GetHalfLengthY(), obb.GetHalfLengthZ(), t); } - t = (-b - Sqrt(discr)) / a; - CylinderIsectTypes result = RR_ISECT_RAY_CYL_PQ; // default along the PQ segment - if (md + t * nd < 0.0f) + //========================================================================= + // IntersectSegmentCylinder + // [10/21/2009] + //========================================================================= + Intersect::CylinderIsectTypes Intersect::IntersectSegmentCylinder( + const Vector3& sa, const Vector3& dir, const Vector3& p, const Vector3& q, const float r, float& t) { - // Intersection outside cylinder on 'p' side - if (nd <= 0.0f) + const float epsilon = 0.001f; + Vector3 d = q - p; // can be cached + Vector3 m = sa - p; // -"- + Vector3 n = /*sb - sa*/ dir; // -"- + + float md = m.Dot(d); + float nd = n.Dot(d); + float dd = d.Dot(d); + + // Test if segment fully outside either endcap of cylinder + if (md < 0.0f && md + nd < 0.0f) { - return RR_ISECT_RAY_CYL_NONE; // Segment pointing away from endcap + return RR_ISECT_RAY_CYL_NONE; // Segment outside 'p' side of cylinder } - float t0 = -md / nd; - // Keep intersection if Dot(S(t) - p, S(t) - p) <= r^2 - if (k + t0 * (2.0f * mn + t0 * nn) <= 0.0f) + if (md > dd && md + nd > dd) { - // if( t0 < 0.0f ) t0 = 0.0f; // it's inside the cylinder - t = t0; - result = RR_ISECT_RAY_CYL_P_SIDE; + return RR_ISECT_RAY_CYL_NONE; // Segment outside 'q' side of cylinder } - else + float nn = n.Dot(n); + float mn = m.Dot(n); + float a = dd * nn - nd * nd; + float k = m.Dot(m) - r * r; + float c = dd * k - md * md; + if (std::fabs(a) < epsilon) { - return RR_ISECT_RAY_CYL_NONE; + // Segment runs parallel to cylinder axis + if (c > 0.0f) + { + return RR_ISECT_RAY_CYL_NONE; // 'a' and thus the segment lie outside cylinder + } + // Now known that segment intersects cylinder; figure out how it intersects + if (md < 0.0f) + { + t = -mn / nn; // Intersect segment against 'p' endcap + return RR_ISECT_RAY_CYL_P_SIDE; + } + else if (md > dd) + { + t = (nd - mn) / nn; // Intersect segment against 'q' endcap + return RR_ISECT_RAY_CYL_Q_SIDE; + } + else + { + // 'a' lies inside cylinder + t = 0.0f; + return RR_ISECT_RAY_CYL_SA_INSIDE; + } } - } - else if (md + t * nd > dd) - { - // Intersection outside cylinder on 'q' side - if (nd >= 0.0f) + float b = dd * mn - nd * md; + float discr = b * b - a * c; + if (discr < 0.0f) { - return RR_ISECT_RAY_CYL_NONE; // Segment pointing away from endcap + return RR_ISECT_RAY_CYL_NONE; // No real roots; no intersection } - float t0 = (dd - md) / nd; - // Keep intersection if Dot(S(t) - q, S(t) - q) <= r^2 - if (k + dd - 2.0f * md + t0 * (2.0f * (mn - nd) + t0 * nn) <= 0.0f) + t = (-b - Sqrt(discr)) / a; + CylinderIsectTypes result = RR_ISECT_RAY_CYL_PQ; // default along the PQ segment + + if (md + t * nd < 0.0f) { - // if( t0 < 0.0f ) t0 = 0.0f; // it's inside the cylinder - t = t0; - result = RR_ISECT_RAY_CYL_Q_SIDE; + // Intersection outside cylinder on 'p' side + if (nd <= 0.0f) + { + return RR_ISECT_RAY_CYL_NONE; // Segment pointing away from endcap + } + float t0 = -md / nd; + // Keep intersection if Dot(S(t) - p, S(t) - p) <= r^2 + if (k + t0 * (2.0f * mn + t0 * nn) <= 0.0f) + { + // if( t0 < 0.0f ) t0 = 0.0f; // it's inside the cylinder + t = t0; + result = RR_ISECT_RAY_CYL_P_SIDE; + } + else + { + return RR_ISECT_RAY_CYL_NONE; + } } - else + else if (md + t * nd > dd) { - return RR_ISECT_RAY_CYL_NONE; + // Intersection outside cylinder on 'q' side + if (nd >= 0.0f) + { + return RR_ISECT_RAY_CYL_NONE; // Segment pointing away from endcap + } + float t0 = (dd - md) / nd; + // Keep intersection if Dot(S(t) - q, S(t) - q) <= r^2 + if (k + dd - 2.0f * md + t0 * (2.0f * (mn - nd) + t0 * nn) <= 0.0f) + { + // if( t0 < 0.0f ) t0 = 0.0f; // it's inside the cylinder + t = t0; + result = RR_ISECT_RAY_CYL_Q_SIDE; + } + else + { + return RR_ISECT_RAY_CYL_NONE; + } } - } - // Segment intersects cylinder between the end-caps; t is correct - if (t > 1.0f) - { - return RR_ISECT_RAY_CYL_NONE; // Intersection lies outside segment - } - else if (t < 0.0f) - { - if (c <= 0.0f) - { - t = 0.0f; - return RR_ISECT_RAY_CYL_SA_INSIDE; // Segment starts inside - } - else + // Segment intersects cylinder between the end-caps; t is correct + if (t > 1.0f) { return RR_ISECT_RAY_CYL_NONE; // Intersection lies outside segment } - } - else - { - return result; - } -} -//========================================================================= -// IntersectSegmentCapsule -// [10/21/2009] -//========================================================================= -CapsuleIsectTypes -AZ::Intersect::IntersectSegmentCapsule(const Vector3& sa, const Vector3& dir, const Vector3& p, const Vector3& q, const float r, float& t) -{ - int result = IntersectSegmentCylinder(sa, dir, p, q, r, t); - - if (result == RR_ISECT_RAY_CYL_SA_INSIDE) - { - return ISECT_RAY_CAPSULE_SA_INSIDE; - } - - if (result == RR_ISECT_RAY_CYL_PQ) - { - return ISECT_RAY_CAPSULE_PQ; - } - - Vector3 dirNorm = dir; - float len = dirNorm.NormalizeWithLength(); - - // check spheres - float timeLenTop, timeLenBottom; - int resultTop = IntersectRaySphere(sa, dirNorm, p, r, timeLenTop); - if (resultTop == ISECT_RAY_SPHERE_SA_INSIDE) - { - return ISECT_RAY_CAPSULE_SA_INSIDE; - } - int resultBottom = IntersectRaySphere(sa, dirNorm, q, r, timeLenBottom); - if (resultBottom == ISECT_RAY_SPHERE_SA_INSIDE) - { - return ISECT_RAY_CAPSULE_SA_INSIDE; - } - - if (resultTop == ISECT_RAY_SPHERE_ISECT) - { - if (resultBottom == ISECT_RAY_SPHERE_ISECT) + else if (t < 0.0f) { - // if we intersect both spheres pick the closest one - if (timeLenTop < timeLenBottom) + if (c <= 0.0f) { - t = timeLenTop / len; - return ISECT_RAY_CAPSULE_P_SIDE; + t = 0.0f; + return RR_ISECT_RAY_CYL_SA_INSIDE; // Segment starts inside } else { - t = timeLenBottom / len; - return ISECT_RAY_CAPSULE_Q_SIDE; + return RR_ISECT_RAY_CYL_NONE; // Intersection lies outside segment } } else { - t = timeLenTop / len; - return ISECT_RAY_CAPSULE_P_SIDE; + return result; } } - - if (resultBottom == ISECT_RAY_SPHERE_ISECT) + //========================================================================= + // IntersectSegmentCapsule + // [10/21/2009] + //========================================================================= + Intersect::CapsuleIsectTypes Intersect::IntersectSegmentCapsule( + const Vector3& sa, const Vector3& dir, const Vector3& p, const Vector3& q, const float r, float& t) { - t = timeLenBottom / len; - return ISECT_RAY_CAPSULE_Q_SIDE; - } + int result = IntersectSegmentCylinder(sa, dir, p, q, r, t); - return ISECT_RAY_CAPSULE_NONE; -} + if (result == RR_ISECT_RAY_CYL_SA_INSIDE) + { + return ISECT_RAY_CAPSULE_SA_INSIDE; + } -//========================================================================= -// IntersectSegmentPolyhedron -// [10/21/2009] -//========================================================================= -bool -AZ::Intersect::IntersectSegmentPolyhedron( - const Vector3& sa, const Vector3& dir, const Plane p[], int numPlanes, - float& tfirst, float& tlast, int& iFirstPlane, int& iLastPlane) -{ - // Compute direction vector for the segment - Vector3 d = /*b - a*/ dir; - // Set initial interval to being the whole segment. For a ray, tlast should be - // set to +RR_FLT_MAX. For a line, additionally tfirst should be set to -RR_FLT_MAX - tfirst = 0.0f; - tlast = 1.0f; - iFirstPlane = -1; - iLastPlane = -1; - // Intersect segment against each plane - for (int i = 0; i < numPlanes; i++) - { - const Vector4& plane = p[i].GetPlaneEquationCoefficients(); + if (result == RR_ISECT_RAY_CYL_PQ) + { + return ISECT_RAY_CAPSULE_PQ; + } - float denom = plane.Dot3(d); - // don't forget we store -D in the plane - float dist = (-plane.GetW()) - plane.Dot3(sa); - // Test if segment runs parallel to the plane - if (denom == 0.0f) + Vector3 dirNorm = dir; + float len = dirNorm.NormalizeWithLength(); + + // check spheres + float timeLenTop, timeLenBottom; + int resultTop = IntersectRaySphere(sa, dirNorm, p, r, timeLenTop); + if (resultTop == ISECT_RAY_SPHERE_SA_INSIDE) { - // If so, return "no intersection" if segment lies outside plane - if (dist < 0.0f) - { - return false; - } + return ISECT_RAY_CAPSULE_SA_INSIDE; } - else + int resultBottom = IntersectRaySphere(sa, dirNorm, q, r, timeLenBottom); + if (resultBottom == ISECT_RAY_SPHERE_SA_INSIDE) + { + return ISECT_RAY_CAPSULE_SA_INSIDE; + } + + if (resultTop == ISECT_RAY_SPHERE_ISECT) { - // Compute parameterized t value for intersection with current plane - float t = dist / denom; - if (denom < 0.0f) + if (resultBottom == ISECT_RAY_SPHERE_ISECT) { - // When entering half space, update tfirst if t is larger - if (t > tfirst) + // if we intersect both spheres pick the closest one + if (timeLenTop < timeLenBottom) + { + t = timeLenTop / len; + return ISECT_RAY_CAPSULE_P_SIDE; + } + else { - tfirst = t; - iFirstPlane = i; + t = timeLenBottom / len; + return ISECT_RAY_CAPSULE_Q_SIDE; } } else { - // When exiting half space, update tlast if t is smaller - if (t < tlast) + t = timeLenTop / len; + return ISECT_RAY_CAPSULE_P_SIDE; + } + } + + if (resultBottom == ISECT_RAY_SPHERE_ISECT) + { + t = timeLenBottom / len; + return ISECT_RAY_CAPSULE_Q_SIDE; + } + + return ISECT_RAY_CAPSULE_NONE; + } + + //========================================================================= + // IntersectSegmentPolyhedron + // [10/21/2009] + //========================================================================= + bool Intersect::IntersectSegmentPolyhedron( + const Vector3& sa, + const Vector3& dir, + const Plane p[], + int numPlanes, + float& tfirst, + float& tlast, + int& iFirstPlane, + int& iLastPlane) + { + // Compute direction vector for the segment + Vector3 d = /*b - a*/ dir; + // Set initial interval to being the whole segment. For a ray, tlast should be + // set to +RR_FLT_MAX. For a line, additionally tfirst should be set to -RR_FLT_MAX + tfirst = 0.0f; + tlast = 1.0f; + iFirstPlane = -1; + iLastPlane = -1; + // Intersect segment against each plane + for (int i = 0; i < numPlanes; i++) + { + const Vector4& plane = p[i].GetPlaneEquationCoefficients(); + + float denom = plane.Dot3(d); + // don't forget we store -D in the plane + float dist = (-plane.GetW()) - plane.Dot3(sa); + // Test if segment runs parallel to the plane + if (denom == 0.0f) + { + // If so, return "no intersection" if segment lies outside plane + if (dist < 0.0f) { - tlast = t; - iLastPlane = i; + return false; } } - - // Exit with "no intersection" if intersection becomes empty - if (tfirst > tlast) + else { - return false; + // Compute parameterized t value for intersection with current plane + float t = dist / denom; + if (denom < 0.0f) + { + // When entering half space, update tfirst if t is larger + if (t > tfirst) + { + tfirst = t; + iFirstPlane = i; + } + } + else + { + // When exiting half space, update tlast if t is smaller + if (t < tlast) + { + tlast = t; + iLastPlane = i; + } + } + + // Exit with "no intersection" if intersection becomes empty + if (tfirst > tlast) + { + return false; + } } } - } - - //DBG_Assert(iFirstPlane!=-1&&iLastPlane!=-1,("We have some bad border case to have only one plane, fix this function!")); - if (iFirstPlane == -1 && iLastPlane == -1) - { - return false; - } - // A nonzero logical intersection, so the segment intersects the polyhedron - return true; -} + // DBG_Assert(iFirstPlane!=-1&&iLastPlane!=-1,("We have some bad border case to have only one plane, fix this function!")); + if (iFirstPlane == -1 && iLastPlane == -1) + { + return false; + } -//========================================================================= -// ClosestSegmentSegment -// [10/21/2009] -//========================================================================= -void -AZ::Intersect::ClosestSegmentSegment( - const Vector3& segment1Start, const Vector3& segment1End, - const Vector3& segment2Start, const Vector3& segment2End, - float& segment1Proportion, float& segment2Proportion, - Vector3& closestPointSegment1, Vector3& closestPointSegment2, - float epsilon) -{ - const Vector3 segment1 = segment1End - segment1Start; - const Vector3 segment2 = segment2End - segment2Start; - const Vector3 segmentStartsVector = segment1Start - segment2Start; - const float segment1LengthSquared = segment1.Dot(segment1); - const float segment2LengthSquared = segment2.Dot(segment2); - - // Check if both segments degenerate into points - if (segment1LengthSquared <= epsilon && segment2LengthSquared <= epsilon) - { - segment1Proportion = 0.0f; - segment2Proportion = 0.0f; - closestPointSegment1 = segment1Start; - closestPointSegment2 = segment2Start; - return; + // A nonzero logical intersection, so the segment intersects the polyhedron + return true; } - float projSegment2SegmentStarts = segment2.Dot(segmentStartsVector); - - // Check if segment 1 degenerates into a point - if (segment1LengthSquared <= epsilon) - { - segment1Proportion = 0.0f; - segment2Proportion = AZ::GetClamp(projSegment2SegmentStarts / segment2LengthSquared, 0.0f, 1.0f); - } - else + //========================================================================= + // ClosestSegmentSegment + // [10/21/2009] + //========================================================================= + void Intersect::ClosestSegmentSegment( + const Vector3& segment1Start, + const Vector3& segment1End, + const Vector3& segment2Start, + const Vector3& segment2End, + float& segment1Proportion, + float& segment2Proportion, + Vector3& closestPointSegment1, + Vector3& closestPointSegment2, + float epsilon) { - float projSegment1SegmentStarts = segment1.Dot(segmentStartsVector); - // Check if segment 2 degenerates into a point - if (segment2LengthSquared <= epsilon) + const Vector3 segment1 = segment1End - segment1Start; + const Vector3 segment2 = segment2End - segment2Start; + const Vector3 segmentStartsVector = segment1Start - segment2Start; + const float segment1LengthSquared = segment1.Dot(segment1); + const float segment2LengthSquared = segment2.Dot(segment2); + + // Check if both segments degenerate into points + if (segment1LengthSquared <= epsilon && segment2LengthSquared <= epsilon) { - segment1Proportion = AZ::GetClamp(-projSegment1SegmentStarts / segment1LengthSquared, 0.0f, 1.0f); + segment1Proportion = 0.0f; segment2Proportion = 0.0f; + closestPointSegment1 = segment1Start; + closestPointSegment2 = segment2Start; + return; + } + + float projSegment2SegmentStarts = segment2.Dot(segmentStartsVector); + + // Check if segment 1 degenerates into a point + if (segment1LengthSquared <= epsilon) + { + segment1Proportion = 0.0f; + segment2Proportion = AZ::GetClamp(projSegment2SegmentStarts / segment2LengthSquared, 0.0f, 1.0f); } else { - // The general non-degenerate case starts here - float projSegment1Segment2 = segment1.Dot(segment2); - float denom = segment1LengthSquared * segment2LengthSquared - projSegment1Segment2 * projSegment1Segment2; // Always nonnegative - - // If segments not parallel, compute closest point on segment1 to segment2, and - // clamp to segment1. Else pick arbitrary segment1Proportion (here 0) - if (denom != 0.0f) + float projSegment1SegmentStarts = segment1.Dot(segmentStartsVector); + // Check if segment 2 degenerates into a point + if (segment2LengthSquared <= epsilon) { - segment1Proportion = AZ::GetClamp((projSegment1Segment2 * projSegment2SegmentStarts - projSegment1SegmentStarts * segment2LengthSquared) / denom, 0.0f, 1.0f); + segment1Proportion = AZ::GetClamp(-projSegment1SegmentStarts / segment1LengthSquared, 0.0f, 1.0f); + segment2Proportion = 0.0f; } else { - segment1Proportion = 0.0f; - } + // The general non-degenerate case starts here + float projSegment1Segment2 = segment1.Dot(segment2); + float denom = + segment1LengthSquared * segment2LengthSquared - projSegment1Segment2 * projSegment1Segment2; // Always nonnegative - // Compute point on segment2 closest to segment1 using - segment2Proportion = (projSegment1Segment2 * segment1Proportion + projSegment2SegmentStarts) / segment2LengthSquared; + // If segments not parallel, compute closest point on segment1 to segment2, and + // clamp to segment1. Else pick arbitrary segment1Proportion (here 0) + if (denom != 0.0f) + { + segment1Proportion = AZ::GetClamp( + (projSegment1Segment2 * projSegment2SegmentStarts - projSegment1SegmentStarts * segment2LengthSquared) / denom, + 0.0f, 1.0f); + } + else + { + segment1Proportion = 0.0f; + } - // If segment2Proportion in [0,1] done. Else clamp segment2Proportion, recompute segment1Proportion for the new value of segment2Proportion - // and clamp segment1Proportion to [0, 1] - if (segment2Proportion < 0.0f) - { - segment2Proportion = 0.0f; - segment1Proportion = AZ::GetClamp(-projSegment1SegmentStarts / segment1LengthSquared, 0.0f, 1.0f); - } - else if (segment2Proportion > 1.0f) - { - segment2Proportion = 1.0f; - segment1Proportion = AZ::GetClamp((projSegment1Segment2 - projSegment1SegmentStarts) / segment1LengthSquared, 0.0f, 1.0f); + // Compute point on segment2 closest to segment1 using + segment2Proportion = (projSegment1Segment2 * segment1Proportion + projSegment2SegmentStarts) / segment2LengthSquared; + + // If segment2Proportion in [0,1] done. Else clamp segment2Proportion, recompute segment1Proportion for the new value of + // segment2Proportion and clamp segment1Proportion to [0, 1] + if (segment2Proportion < 0.0f) + { + segment2Proportion = 0.0f; + segment1Proportion = AZ::GetClamp(-projSegment1SegmentStarts / segment1LengthSquared, 0.0f, 1.0f); + } + else if (segment2Proportion > 1.0f) + { + segment2Proportion = 1.0f; + segment1Proportion = + AZ::GetClamp((projSegment1Segment2 - projSegment1SegmentStarts) / segment1LengthSquared, 0.0f, 1.0f); + } } } - } - - closestPointSegment1 = segment1Start + segment1 * segment1Proportion; - closestPointSegment2 = segment2Start + segment2 * segment2Proportion; -} -void AZ::Intersect::ClosestSegmentSegment( - const Vector3& segment1Start, const Vector3& segment1End, - const Vector3& segment2Start, const Vector3& segment2End, - Vector3& closestPointSegment1, Vector3& closestPointSegment2, - float epsilon) -{ - float proportion1, proportion2; - AZ::Intersect::ClosestSegmentSegment( - segment1Start, segment1End, - segment2Start, segment2End, - proportion1, proportion2, - closestPointSegment1, closestPointSegment2, epsilon); -} + closestPointSegment1 = segment1Start + segment1 * segment1Proportion; + closestPointSegment2 = segment2Start + segment2 * segment2Proportion; + } -void AZ::Intersect::ClosestPointSegment( - const Vector3& point, const Vector3& segmentStart, const Vector3& segmentEnd, - float& proportion, Vector3& closestPointOnSegment) -{ - Vector3 segment = segmentEnd - segmentStart; - // Project point onto segment, but deferring divide by segment.Dot(segment) - proportion = (point - segmentStart).Dot(segment); - if (proportion <= 0.0f) + void Intersect::ClosestSegmentSegment( + const Vector3& segment1Start, + const Vector3& segment1End, + const Vector3& segment2Start, + const Vector3& segment2End, + Vector3& closestPointSegment1, + Vector3& closestPointSegment2, + float epsilon) { - // Point projects outside the [segmentStart, segmentEnd] interval, on the segmentStart side, clamp to segmentStart - proportion = 0.0f; - closestPointOnSegment = segmentStart; + float proportion1, proportion2; + Intersect::ClosestSegmentSegment( + segment1Start, segment1End, segment2Start, segment2End, proportion1, proportion2, closestPointSegment1, closestPointSegment2, + epsilon); } - else + + void Intersect::ClosestPointSegment( + const Vector3& point, const Vector3& segmentStart, const Vector3& segmentEnd, float& proportion, Vector3& closestPointOnSegment) { - float segmentLengthSquared = segment.Dot(segment); - if (proportion >= segmentLengthSquared) + Vector3 segment = segmentEnd - segmentStart; + // Project point onto segment, but deferring divide by segment.Dot(segment) + proportion = (point - segmentStart).Dot(segment); + if (proportion <= 0.0f) { - // Point projects outside the [segmentStart, segmentEnd] interval, on the segmentEnd side, clamp to segmentEnd - proportion = 1.0f; - closestPointOnSegment = segmentEnd; + // Point projects outside the [segmentStart, segmentEnd] interval, on the segmentStart side, clamp to segmentStart + proportion = 0.0f; + closestPointOnSegment = segmentStart; } else { - // Point projects inside the [segmentStart, segmentEnd] interval, must do deferred divide now - proportion = proportion / segmentLengthSquared; - closestPointOnSegment = segmentStart + (proportion * segment); + float segmentLengthSquared = segment.Dot(segment); + if (proportion >= segmentLengthSquared) + { + // Point projects outside the [segmentStart, segmentEnd] interval, on the segmentEnd side, clamp to segmentEnd + proportion = 1.0f; + closestPointOnSegment = segmentEnd; + } + else + { + // Point projects inside the [segmentStart, segmentEnd] interval, must do deferred divide now + proportion = proportion / segmentLengthSquared; + closestPointOnSegment = segmentStart + (proportion * segment); + } } } -} #if 0 ////////////////////////////////////////////////////////////////////////// @@ -2121,3 +2171,5 @@ namespace test } ////////////////////////////////////////////////////////////////////////// #endif + +} // namespace AZ diff --git a/Code/Framework/AzCore/AzCore/Math/Sfmt.cpp b/Code/Framework/AzCore/AzCore/Math/Sfmt.cpp index 5f4dc9e5df..96c1a6a420 100644 --- a/Code/Framework/AzCore/AzCore/Math/Sfmt.cpp +++ b/Code/Framework/AzCore/AzCore/Math/Sfmt.cpp @@ -9,39 +9,38 @@ #include #include -#include #include +#include #include // for memset namespace AZ::SfmtInternal { - static const int N32 = N * 4; - static const int N64 = N * 2; - static const int POS1 = 122; - static const int SL1 = 18; - static const int SR1 = 11; - static const int SL2 = 1; - static const int SR2 = 1; - static const unsigned int MSK1 = 0xdfffffefU; - static const unsigned int MSK2 = 0xddfecb7fU; - static const unsigned int MSK3 = 0xbffaffffU; - static const unsigned int MSK4 = 0xbffffff6U; - static const unsigned int PARITY1 = 0x00000001U; - static const unsigned int PARITY2 = 0x00000000U; - static const unsigned int PARITY3 = 0x00000000U; - static const unsigned int PARITY4 = 0x13c9e684U; + static const int N32 = N * 4; + static const int N64 = N * 2; + static const int POS1 = 122; + static const int SL1 = 18; + static const int SR1 = 11; + static const int SL2 = 1; + static const int SR2 = 1; + static const unsigned int MSK1 = 0xdfffffefU; + static const unsigned int MSK2 = 0xddfecb7fU; + static const unsigned int MSK3 = 0xbffaffffU; + static const unsigned int MSK4 = 0xbffffff6U; + static const unsigned int PARITY1 = 0x00000001U; + static const unsigned int PARITY2 = 0x00000000U; + static const unsigned int PARITY3 = 0x00000000U; + static const unsigned int PARITY4 = 0x13c9e684U; /** a parity check vector which certificate the period of 2^{MEXP} */ - static unsigned int parity[4] = {PARITY1, PARITY2, PARITY3, PARITY4}; + static unsigned int parity[4] = { PARITY1, PARITY2, PARITY3, PARITY4 }; #ifdef ONLY64 -# define idxof(_i) (_i ^ 1) +#define idxof(_i) (_i ^ 1) #else -# define idxof(_i) _i +#define idxof(_i) _i #endif // ONLY64 - #if AZ_TRAIT_USE_PLATFORM_SIMD_SSE /** * This function represents the recursion formula. @@ -52,7 +51,8 @@ namespace AZ::SfmtInternal * @param mask 128-bit mask * @return output */ - AZ_FORCE_INLINE static Simd::Vec4::Int32Type simd_recursion(Simd::Vec4::Int32Type* a, Simd::Vec4::Int32Type* b, Simd::Vec4::Int32Type c, Simd::Vec4::Int32Type d, Simd::Vec4::Int32Type mask) + AZ_FORCE_INLINE static Simd::Vec4::Int32Type simd_recursion( + Simd::Vec4::Int32Type* a, Simd::Vec4::Int32Type* b, Simd::Vec4::Int32Type c, Simd::Vec4::Int32Type d, Simd::Vec4::Int32Type mask) { Simd::Vec4::Int32Type v, x, y, z; x = *a; @@ -151,7 +151,7 @@ namespace AZ::SfmtInternal inline void rshift128(w128_t* out, w128_t const* in, int shift) { AZ::u64 th, tl, oh, ol; - #ifdef ONLY64 +#ifdef ONLY64 th = ((AZ::u64)in->u[2] << 32) | ((AZ::u64)in->u[3]); tl = ((AZ::u64)in->u[0] << 32) | ((AZ::u64)in->u[1]); @@ -204,7 +204,7 @@ namespace AZ::SfmtInternal #endif } - inline void do_recursion(w128_t* r, w128_t* a, w128_t* b, w128_t* c, w128_t* d) + inline void do_recursion(w128_t* r, w128_t* a, w128_t* b, w128_t* c, w128_t* d) { w128_t x; w128_t y; @@ -229,7 +229,7 @@ namespace AZ::SfmtInternal inline void gen_rand_all(Sfmt& g) { int i; - w128_t* r1, * r2; + w128_t *r1, *r2; r1 = &g.m_sfmt[N - 2]; r2 = &g.m_sfmt[N - 1]; @@ -257,7 +257,7 @@ namespace AZ::SfmtInternal inline void gen_rand_array(Sfmt& g, w128_t* array, int size) { int i, j; - w128_t* r1, * r2; + w128_t *r1, *r2; r1 = &g.m_sfmt[N - 2]; r2 = &g.m_sfmt[N - 1]; @@ -295,82 +295,80 @@ namespace AZ::SfmtInternal #endif } // namespace AZ::SfmtInternal -using namespace AZ; - ////////////////////////////////////////////////////////////////////////// // Statics ////////////////////////////////////////////////////////////////////////// +namespace AZ +{ + static EnvironmentVariable s_sfmt; + static const char* s_globalSfmtName = "GlobalSfmt"; -static EnvironmentVariable s_sfmt; -static const char* s_globalSfmtName = "GlobalSfmt"; + Sfmt& Sfmt::GetInstance() + { + if (!s_sfmt) + { + s_sfmt = AZ::Environment::FindVariable(s_globalSfmtName); + if (!s_sfmt) + { + Sfmt::Create(); + } + } -Sfmt& Sfmt::GetInstance() -{ - if (!s_sfmt) + return s_sfmt.Get(); + } + + void Sfmt::Create() { - s_sfmt = AZ::Environment::FindVariable(s_globalSfmtName); if (!s_sfmt) { - Sfmt::Create(); + s_sfmt = AZ::Environment::CreateVariable(s_globalSfmtName); } } - return s_sfmt.Get(); -} + void Sfmt::Destroy() + { + s_sfmt.Reset(); + } -void Sfmt::Create() -{ - if (!s_sfmt) + //========================================================================= + // Sfmt + // [4/10/2012] + //========================================================================= + Sfmt::Sfmt() { - s_sfmt = AZ::Environment::CreateVariable(s_globalSfmtName); + m_psfmt32 = &m_sfmt[0].u[0]; + m_psfmt64 = reinterpret_cast(m_psfmt32); + + Seed(); } -} -void Sfmt::Destroy() -{ - s_sfmt.Reset(); -} - -//========================================================================= -// Sfmt -// [4/10/2012] -//========================================================================= -Sfmt::Sfmt() -{ - m_psfmt32 = &m_sfmt[0].u[0]; - m_psfmt64 = reinterpret_cast(m_psfmt32); + //========================================================================= + // Seed + // [4/10/2012] + //========================================================================= + Sfmt::Sfmt(AZ::u32* keys, int numKeys) + { + m_psfmt32 = &m_sfmt[0].u[0]; + m_psfmt64 = reinterpret_cast(m_psfmt32); - Seed(); -} + Seed(keys, numKeys); + } -//========================================================================= -// Seed -// [4/10/2012] -//========================================================================= -Sfmt::Sfmt(AZ::u32* keys, int numKeys) -{ - m_psfmt32 = &m_sfmt[0].u[0]; - m_psfmt64 = reinterpret_cast(m_psfmt32); - - Seed(keys, numKeys); -} - -//========================================================================= -// Seed -// [4/10/2012] -//========================================================================= -void -Sfmt::Seed() -{ - // buffer with random values - AZ::u32 buffer[32]; - BetterPseudoRandom rnd; - bool result = rnd.GetRandom(buffer, sizeof(buffer)); - (void)result; - AZ_Warning("System", result, "Failed to seed properly the Smft generator!"); - Seed(buffer, AZ_ARRAY_SIZE(buffer)); -} + //========================================================================= + // Seed + // [4/10/2012] + //========================================================================= + void Sfmt::Seed() + { + // buffer with random values + AZ::u32 buffer[32]; + BetterPseudoRandom rnd; + bool result = rnd.GetRandom(buffer, sizeof(buffer)); + (void)result; + AZ_Warning("System", result, "Failed to seed properly the Smft generator!"); + Seed(buffer, AZ_ARRAY_SIZE(buffer)); + } /** * This function represents a function used in the initialization @@ -388,226 +386,222 @@ Sfmt::Seed() */ #define azsfmt_func2(x) ((x ^ (x >> 27)) * (AZ::u32)1566083941UL) -//========================================================================= -// Seed -// [4/10/2012] -//========================================================================= -void -Sfmt::Seed(AZ::u32* keys, int numKeys) -{ - using SfmtInternal::N; - using SfmtInternal::N32; - int i, j, count; - AZ::u32 r; - int lag; - int mid; - int size = N * 4; - - if (size >= 623) - { - lag = 11; - } - else if (size >= 68) - { - lag = 7; - } - else if (size >= 39) - { - lag = 5; - } - else + //========================================================================= + // Seed + // [4/10/2012] + //========================================================================= + void Sfmt::Seed(AZ::u32* keys, int numKeys) { - lag = 3; - } - mid = (size - lag) / 2; + using SfmtInternal::N; + using SfmtInternal::N32; + int i, j, count; + AZ::u32 r; + int lag; + int mid; + int size = N * 4; + + if (size >= 623) + { + lag = 11; + } + else if (size >= 68) + { + lag = 7; + } + else if (size >= 39) + { + lag = 5; + } + else + { + lag = 3; + } + mid = (size - lag) / 2; - memset(m_sfmt, 0x8b, sizeof(m_sfmt)); - if (numKeys + 1 > SfmtInternal::N32) - { - count = numKeys + 1; - } - else - { - count = N32; - } - r = azsfmt_func1((m_psfmt32[idxof(0)] ^ m_psfmt32[idxof(mid)] ^ m_psfmt32[idxof(N32 - 1)])); - m_psfmt32[idxof(mid)] += r; - r += numKeys; - m_psfmt32[idxof(mid + lag)] += r; - m_psfmt32[idxof(0)] = r; - - count--; - for (i = 1, j = 0; (j < count) && (j < numKeys); j++) - { - r = azsfmt_func1((m_psfmt32[idxof(i)] ^ m_psfmt32[idxof((i + mid) % N32)] ^ m_psfmt32[idxof((i + N32 - 1) % N32)])); - m_psfmt32[idxof((i + mid) % N32)] += r; - r += keys[j] + i; - m_psfmt32[idxof((i + mid + lag) % N32)] += r; - m_psfmt32[idxof(i)] = r; - i = (i + 1) % N32; - } - for (; j < count; j++) - { - r = azsfmt_func1((m_psfmt32[idxof(i)] ^ m_psfmt32[idxof((i + mid) % N32)] ^ m_psfmt32[idxof((i + N32 - 1) % N32)])); - m_psfmt32[idxof((i + mid) % N32)] += r; - r += i; - m_psfmt32[idxof((i + mid + lag) % N32)] += r; - m_psfmt32[idxof(i)] = r; - i = (i + 1) % N32; - } - for (j = 0; j < N32; j++) - { - r = azsfmt_func2((m_psfmt32[idxof(i)] + m_psfmt32[idxof((i + mid) % N32)] + m_psfmt32[idxof((i + N32 - 1) % N32)])); - m_psfmt32[idxof((i + mid) % N32)] ^= r; - r -= i; - m_psfmt32[idxof((i + mid + lag) % N32)] ^= r; - m_psfmt32[idxof(i)] = r; - i = (i + 1) % N32; - } + memset(m_sfmt, 0x8b, sizeof(m_sfmt)); + if (numKeys + 1 > SfmtInternal::N32) + { + count = numKeys + 1; + } + else + { + count = N32; + } + r = azsfmt_func1((m_psfmt32[idxof(0)] ^ m_psfmt32[idxof(mid)] ^ m_psfmt32[idxof(N32 - 1)])); + m_psfmt32[idxof(mid)] += r; + r += numKeys; + m_psfmt32[idxof(mid + lag)] += r; + m_psfmt32[idxof(0)] = r; + + count--; + for (i = 1, j = 0; (j < count) && (j < numKeys); j++) + { + r = azsfmt_func1((m_psfmt32[idxof(i)] ^ m_psfmt32[idxof((i + mid) % N32)] ^ m_psfmt32[idxof((i + N32 - 1) % N32)])); + m_psfmt32[idxof((i + mid) % N32)] += r; + r += keys[j] + i; + m_psfmt32[idxof((i + mid + lag) % N32)] += r; + m_psfmt32[idxof(i)] = r; + i = (i + 1) % N32; + } + for (; j < count; j++) + { + r = azsfmt_func1((m_psfmt32[idxof(i)] ^ m_psfmt32[idxof((i + mid) % N32)] ^ m_psfmt32[idxof((i + N32 - 1) % N32)])); + m_psfmt32[idxof((i + mid) % N32)] += r; + r += i; + m_psfmt32[idxof((i + mid + lag) % N32)] += r; + m_psfmt32[idxof(i)] = r; + i = (i + 1) % N32; + } + for (j = 0; j < N32; j++) + { + r = azsfmt_func2((m_psfmt32[idxof(i)] + m_psfmt32[idxof((i + mid) % N32)] + m_psfmt32[idxof((i + N32 - 1) % N32)])); + m_psfmt32[idxof((i + mid) % N32)] ^= r; + r -= i; + m_psfmt32[idxof((i + mid + lag) % N32)] ^= r; + m_psfmt32[idxof(i)] = r; + i = (i + 1) % N32; + } - m_index = N32; - PeriodCertification(); -} + m_index = N32; + PeriodCertification(); + } #undef azsfmt_func1 #undef azsfmt_func2 -//========================================================================= -// PeriodCertification -// [4/10/2012] -//========================================================================= -void -Sfmt::PeriodCertification() -{ - int inner = 0; - int i, j; - AZ::u32 work; - - for (i = 0; i < 4; i++) + //========================================================================= + // PeriodCertification + // [4/10/2012] + //========================================================================= + void Sfmt::PeriodCertification() { - inner ^= m_psfmt32[idxof(i)] & SfmtInternal::parity[i]; - } - for (i = 16; i > 0; i >>= 1) - { - inner ^= inner >> i; - } - inner &= 1; - /* check OK */ - if (inner == 1) - { - return; - } - /* check NG, and modification */ - for (i = 0; i < 4; i++) - { - work = 1; - for (j = 0; j < 32; j++) + int inner = 0; + int i, j; + AZ::u32 work; + + for (i = 0; i < 4; i++) + { + inner ^= m_psfmt32[idxof(i)] & SfmtInternal::parity[i]; + } + for (i = 16; i > 0; i >>= 1) + { + inner ^= inner >> i; + } + inner &= 1; + /* check OK */ + if (inner == 1) + { + return; + } + /* check NG, and modification */ + for (i = 0; i < 4; i++) { - if ((work & SfmtInternal::parity[i]) != 0) + work = 1; + for (j = 0; j < 32; j++) { - m_psfmt32[idxof(i)] ^= work; - return; + if ((work & SfmtInternal::parity[i]) != 0) + { + m_psfmt32[idxof(i)] ^= work; + return; + } + work = work << 1; } - work = work << 1; } } -} -//========================================================================= -// Rand32 -// [4/10/2012] -//========================================================================= -AZ::u32 Sfmt::Rand32() -{ - int index = m_index.fetch_add(1); - if (index >= SfmtInternal::N32) + //========================================================================= + // Rand32 + // [4/10/2012] + //========================================================================= + AZ::u32 Sfmt::Rand32() { - AZStd::lock_guard lock(m_generationMutex); - // if this thread is the one that sets m_index to 0, then this thread - // does the generation - index += 1; // compare against the result of fetch_add(1) above - if (m_index.compare_exchange_strong(index, 0)) + int index = m_index.fetch_add(1); + if (index >= SfmtInternal::N32) { - SfmtInternal::gen_rand_all(*this); + AZStd::lock_guard lock(m_generationMutex); + // if this thread is the one that sets m_index to 0, then this thread + // does the generation + index += 1; // compare against the result of fetch_add(1) above + if (m_index.compare_exchange_strong(index, 0)) + { + SfmtInternal::gen_rand_all(*this); + } + // try again, with the new table + return Rand32(); } - // try again, with the new table - return Rand32(); + return m_psfmt32[index]; } - return m_psfmt32[index]; -} - -//========================================================================= -// Rand64 -// [4/10/2012] -//========================================================================= -AZ::u64 Sfmt::Rand64() -{ - int index = m_index.fetch_add(2); - if (index >= (SfmtInternal::N32 - 1)) + + //========================================================================= + // Rand64 + // [4/10/2012] + //========================================================================= + AZ::u64 Sfmt::Rand64() { - AZStd::lock_guard lock(m_generationMutex); - // if this thread is the one that sets m_index to 0, then this thread - // does the generation - index += 2; // compare against the result of fetch_add(2) above - if (m_index.compare_exchange_strong(index, 0)) + int index = m_index.fetch_add(2); + if (index >= (SfmtInternal::N32 - 1)) { - SfmtInternal::gen_rand_all(*this); + AZStd::lock_guard lock(m_generationMutex); + // if this thread is the one that sets m_index to 0, then this thread + // does the generation + index += 2; // compare against the result of fetch_add(2) above + if (m_index.compare_exchange_strong(index, 0)) + { + SfmtInternal::gen_rand_all(*this); + } + // try again, with the new table + return Rand64(); } - // try again, with the new table - return Rand64(); + + AZ::u64 r; + r = m_psfmt64[index / 2]; + return r; } - AZ::u64 r; - r = m_psfmt64[index / 2]; - return r; -} - -//========================================================================= -// FillArray32 -// [4/10/2012] -//========================================================================= -void -Sfmt::FillArray32(AZ::u32* array, int size) -{ - AZ_MATH_ASSERT(m_index == SfmtInternal::N32, "Invalid m_index! Reinitialize!"); - AZ_MATH_ASSERT(size % 4 == 0, "Size must be multiple of 4!"); - AZ_MATH_ASSERT(size >= SfmtInternal::N32, "Size must be bigger than %d GetMinArray32Size()!", SfmtInternal::N32); - - SfmtInternal::gen_rand_array(*this, (SfmtInternal::w128_t*)array, size / 4); - m_index = SfmtInternal::N32; -} - -//========================================================================= -// FillArray64 -// [4/10/2012] -//========================================================================= -void -Sfmt::FillArray64(AZ::u64* array, int size) -{ - AZ_MATH_ASSERT(m_index == SfmtInternal::N32, "Invalid m_index! Reinitialize!"); - AZ_MATH_ASSERT(size % 4 == 0, "Size must be multiple of 4!"); - AZ_MATH_ASSERT(size >= SfmtInternal::N64, "Size must be bigger than %d GetMinArray64Size()!", SfmtInternal::N64); - - SfmtInternal::gen_rand_array(*this, (SfmtInternal::w128_t*)array, size / 2); - m_index = SfmtInternal::N32; -} - -//========================================================================= -// GetMinArray32Size -// [4/10/2012] -//========================================================================= -int -Sfmt::GetMinArray32Size() const -{ - return SfmtInternal::N32; -} - -//========================================================================= -// GetMinArray64Size -// [4/10/2012] -//========================================================================= -int -Sfmt::GetMinArray64Size() const -{ - return SfmtInternal::N64; -} + //========================================================================= + // FillArray32 + // [4/10/2012] + //========================================================================= + void Sfmt::FillArray32(AZ::u32* array, int size) + { + AZ_MATH_ASSERT(m_index == SfmtInternal::N32, "Invalid m_index! Reinitialize!"); + AZ_MATH_ASSERT(size % 4 == 0, "Size must be multiple of 4!"); + AZ_MATH_ASSERT(size >= SfmtInternal::N32, "Size must be bigger than %d GetMinArray32Size()!", SfmtInternal::N32); + + SfmtInternal::gen_rand_array(*this, (SfmtInternal::w128_t*)array, size / 4); + m_index = SfmtInternal::N32; + } + + //========================================================================= + // FillArray64 + // [4/10/2012] + //========================================================================= + void Sfmt::FillArray64(AZ::u64* array, int size) + { + AZ_MATH_ASSERT(m_index == SfmtInternal::N32, "Invalid m_index! Reinitialize!"); + AZ_MATH_ASSERT(size % 4 == 0, "Size must be multiple of 4!"); + AZ_MATH_ASSERT(size >= SfmtInternal::N64, "Size must be bigger than %d GetMinArray64Size()!", SfmtInternal::N64); + + SfmtInternal::gen_rand_array(*this, (SfmtInternal::w128_t*)array, size / 2); + m_index = SfmtInternal::N32; + } + + //========================================================================= + // GetMinArray32Size + // [4/10/2012] + //========================================================================= + int Sfmt::GetMinArray32Size() const + { + return SfmtInternal::N32; + } + + //========================================================================= + // GetMinArray64Size + // [4/10/2012] + //========================================================================= + int Sfmt::GetMinArray64Size() const + { + return SfmtInternal::N64; + } + +} // namespace AZ From ce709b99d04b77ae5134e8d1176d5a7e75041116 Mon Sep 17 00:00:00 2001 From: Mike Chang Date: Wed, 22 Dec 2021 14:58:31 -0800 Subject: [PATCH 245/948] Development dockerfile for Linux (#6532) This is the initial Dockerfile used for local development or for remote CI environments for Ubuntu. Build and test instructions are in the Dockerfile comments. Signed-off-by: Mike Chang --- .../build_node/Platform/Linux/Dockerfile | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 scripts/build/build_node/Platform/Linux/Dockerfile diff --git a/scripts/build/build_node/Platform/Linux/Dockerfile b/scripts/build/build_node/Platform/Linux/Dockerfile new file mode 100644 index 0000000000..0bbbcb3a5b --- /dev/null +++ b/scripts/build/build_node/Platform/Linux/Dockerfile @@ -0,0 +1,57 @@ +# +# Copyright (c) Contributors to the Open 3D Engine Project. +# For complete copyright and license terms please see the LICENSE at the root of this distribution. +# +# SPDX-License-Identifier: Apache-2.0 OR MIT +# + +# This is a base Dockerfile to use for self-containing local or remote development environments +# +# Once docker is installed, build a local image with this command: +# `docker build /localDockerfilepath -t ubuntu-build:latest` +# +# To build using a local repo on disk, run this command: +# `docker run -it -v /localo3depath:/data/workspace/o3de -v /localbuildpath:/data/workspace/o3de/build -v /local3rdPartypath:/root/.o3de/3rdParty \ +# --name build-o3de -d ubuntu-build:latest /bin/sh -c 'cd /data/workspace/o3de && python/python.sh -u scripts/build/ci_build.py --platform Linux --type profile'` +# +# Attach to the running build to interact or view logs using this command: +# `docker attach build-o3de` + +FROM ubuntu:20.04 + +WORKDIR /data/workspace + +# Initilize apt cache +RUN apt-get clean && apt-get update + +# Setup time zone and locale data (necessary for SSL and HTTPS packages) +RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install tzdata locales keyboard-configuration + +RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \ + dpkg-reconfigure --frontend=noninteractive locales && \ + update-locale LANG=en_US.UTF-8 + +ENV LANG=en_US.UTF-8 + +# Install common tools +RUN apt-get -y install tar sudo less vim lsof firewalld net-tools pciutils \ + file wget kmod xz-utils ca-certificates binutils kbd \ + python3-pip bind9-utils jq bc unzip git git-lfs lsb-release \ + software-properties-common + +# Install build and development tools +RUN git clone --no-checkout https://github.com/o3de/o3de.git .o3de && \ + cd .o3de && \ + git sparse-checkout init --cone && \ + git sparse-checkout set scripts/build/build_node && \ + cd scripts/build/build_node/Platform/Linux && \ + ./install-ubuntu.sh + +# Install supported version of cmake if build tool installation runs into issues +ENV CMAKE_VER=3.21.1-0kitware1ubuntu20.04.1 +RUN $(cmake --version) || apt-get -y install cmake=${CMAKE_VER} cmake-data=${CMAKE_VER} + +# Symlink clang version to non-versioned clang and set cc to clang +RUN find /usr/bin/ -name clang* | sed -E 's/^(\/usr\/bin\/.*)(\-[0-9]*)$/ln -s -v \1\2 \1/' | xargs -d '\n' -n 1 bash -c && \ + update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100 && \ + update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++ 100 From 227eea2cf6a35e1d5b6395c5b536d7ee95031957 Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Thu, 23 Dec 2021 11:53:01 -0600 Subject: [PATCH 246/948] Restore BusDisconnect() that got accidentally removed on a recent commit. (#6557) Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- .../Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp b/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp index a35fa50e65..dbaae0118a 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp +++ b/Gems/Terrain/Code/Source/Components/TerrainSurfaceDataSystemComponent.cpp @@ -251,6 +251,7 @@ namespace Terrain SurfaceData::SurfaceDataSystemRequestBus::Broadcast( &SurfaceData::SurfaceDataSystemRequestBus::Events::UnregisterSurfaceDataProvider, m_providerHandle); m_providerHandle = SurfaceData::InvalidSurfaceDataRegistryHandle; + SurfaceData::SurfaceDataProviderRequestBus::Handler::BusDisconnect(); } else { From 17f928cddd720951133164238ac5b429491b993d Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Thu, 23 Dec 2021 11:53:17 -0600 Subject: [PATCH 247/948] Removed chatty profile markers. (#6556) * Removed chatty profile markers. These 4 markers removed tens of thousands of events, which reduced an example capture from 1685 ms to 1614 ms and made it far more readable. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Restored one marker Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- Gems/Atom/RHI/Code/Include/Atom/RHI/MemorySubAllocator.h | 1 - Gems/Atom/RHI/DX12/Code/Source/RHI/MemoryView.cpp | 2 -- .../RPI/Code/Source/RPI.Public/Shader/ShaderResourceGroup.cpp | 2 -- 3 files changed, 5 deletions(-) diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/MemorySubAllocator.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/MemorySubAllocator.h index 580ca97b46..4a038276d1 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/MemorySubAllocator.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/MemorySubAllocator.h @@ -100,7 +100,6 @@ namespace AZ template typename MemorySubAllocator::memory_allocation MemorySubAllocator::Allocate(size_t sizeInBytes, size_t alignmentInBytes) { - AZ_PROFILE_FUNCTION(RHI); if (RHI::AlignUp(sizeInBytes, alignmentInBytes) > m_descriptor.m_capacityInBytes) { return memory_allocation(); diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/MemoryView.cpp b/Gems/Atom/RHI/DX12/Code/Source/RHI/MemoryView.cpp index c1a7156362..7cca24d3de 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/MemoryView.cpp +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/MemoryView.cpp @@ -57,8 +57,6 @@ namespace AZ CpuVirtualAddress MemoryView::Map(RHI::HostMemoryAccess hostAccess) const { - AZ_PROFILE_FUNCTION(RHI); - CpuVirtualAddress cpuAddress = nullptr; D3D12_RANGE readRange = {}; if (hostAccess == RHI::HostMemoryAccess::Read) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/ShaderResourceGroup.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/ShaderResourceGroup.cpp index 7e43fba7a3..b927e864fc 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/ShaderResourceGroup.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/ShaderResourceGroup.cpp @@ -74,8 +74,6 @@ namespace AZ RHI::ResultCode ShaderResourceGroup::Init(ShaderAsset& shaderAsset, const SupervariantIndex& supervariantIndex, const AZ::Name& srgName) { - AZ_PROFILE_FUNCTION(RPI); - const auto& lay = shaderAsset.FindShaderResourceGroupLayout(srgName, supervariantIndex); m_layout = lay.get(); From c2373f1f5965b490daa626dbf551782913270f53 Mon Sep 17 00:00:00 2001 From: tjmgd <92784061+tjmgd@users.noreply.github.com> Date: Thu, 23 Dec 2021 20:12:27 +0000 Subject: [PATCH 248/948] Fix: search results not expanded when searching for .lua files (#6211) Signed-off-by: T.J. McGrath-Daly Co-authored-by: Tobias Alexander Franke --- Code/Tools/LuaIDE/Source/LUA/LUAEditorMainWindow.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Code/Tools/LuaIDE/Source/LUA/LUAEditorMainWindow.cpp b/Code/Tools/LuaIDE/Source/LUA/LUAEditorMainWindow.cpp index c05e11f575..65008f08bb 100644 --- a/Code/Tools/LuaIDE/Source/LUA/LUAEditorMainWindow.cpp +++ b/Code/Tools/LuaIDE/Source/LUA/LUAEditorMainWindow.cpp @@ -372,9 +372,17 @@ namespace LUAEditor StringFilter* stringFilter = new StringFilter(); stringFilter->SetFilterPropagation(AssetTypeFilter::PropagateDirection::Up); - connect(m_gui->m_assetBrowserSearchWidget, &AzQtComponents::FilteredSearchWidget::TextFilterChanged, this, [stringFilter](const QString& newString) + connect(m_gui->m_assetBrowserSearchWidget, &AzQtComponents::FilteredSearchWidget::TextFilterChanged, this, [&, stringFilter](const QString& newString) { stringFilter->SetFilterString(newString); + if (newString.isEmpty()) + { + m_gui->m_assetBrowserTreeView->collapseAll(); + } + else + { + m_gui->m_assetBrowserTreeView->expandAll(); + } }); // Construct the final filter where they are all and'd together From f1a1cb3ec0614b6bba9a822ee936e0006564c5a6 Mon Sep 17 00:00:00 2001 From: tjmgd <92784061+tjmgd@users.noreply.github.com> Date: Thu, 23 Dec 2021 20:12:40 +0000 Subject: [PATCH 249/948] Fix: Lua directory empty and always loading in editor (#6207) * Fix: Lua directory empty and always loading in editor Signed-off-by: T.J. McGrath-Daly * fixed naming convention errors Signed-off-by: T.J. McGrath-Daly * Tidy up Signed-off-by: T.J. McGrath-Daly Co-authored-by: Tobias Alexander Franke --- Code/Tools/LuaIDE/Source/LUA/LUAEditorMainWindow.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Code/Tools/LuaIDE/Source/LUA/LUAEditorMainWindow.cpp b/Code/Tools/LuaIDE/Source/LUA/LUAEditorMainWindow.cpp index 65008f08bb..776e290042 100644 --- a/Code/Tools/LuaIDE/Source/LUA/LUAEditorMainWindow.cpp +++ b/Code/Tools/LuaIDE/Source/LUA/LUAEditorMainWindow.cpp @@ -346,7 +346,11 @@ namespace LUAEditor { auto selectedAsset = selectedAssets.front(); const AZStd::string filePath = selectedAsset->GetFullPath(); - EBUS_EVENT(Context_DocumentManagement::Bus, OnLoadDocument, filePath, true); + auto entryType = selectedAsset->GetEntryType(); + if (entryType == AzToolsFramework::AssetBrowser::AssetBrowserEntry::AssetEntryType::Source) + { + EBUS_EVENT(Context_DocumentManagement::Bus, OnLoadDocument, filePath, true); + } } }); } From 3e9b76cdeeb82b3eef98d62908ef6693780b7bf6 Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Thu, 23 Dec 2021 14:16:22 -0600 Subject: [PATCH 250/948] Image Gradient: Switch to shared_mutex (#6558) * Improve lock contention by switching to a shared_lock. ImageGradient is accessed via a many-reader-one-writer pattern, so a shared_lock causes less contention in the common "read" case. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Remove chatty profile marker. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- .../Code/Include/GradientSignal/GradientSampler.h | 2 -- .../Source/Components/ImageGradientComponent.cpp | 14 +++++++------- .../Source/Components/ImageGradientComponent.h | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h b/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h index c06265fb24..1dd7d44376 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h @@ -88,8 +88,6 @@ namespace GradientSignal inline float GradientSampler::GetValue(const GradientSampleParams& sampleParams) const { - AZ_PROFILE_FUNCTION(Entity); - if (m_opacity <= 0.0f || !m_gradientId.IsValid()) { return 0.0f; diff --git a/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp index 021e083ea6..065f0ace0f 100644 --- a/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp @@ -135,7 +135,7 @@ namespace GradientSignal GradientRequestBus::Handler::BusConnect(GetEntityId()); AZ::Data::AssetBus::Handler::BusConnect(m_configuration.m_imageAsset.GetId()); - AZStd::lock_guard imageLock(m_imageMutex); + AZStd::unique_lock imageLock(m_imageMutex); m_configuration.m_imageAsset.QueueLoad(); } @@ -147,7 +147,7 @@ namespace GradientSignal m_dependencyMonitor.Reset(); - AZStd::lock_guard imageLock(m_imageMutex); + AZStd::unique_lock imageLock(m_imageMutex); m_configuration.m_imageAsset.Release(); } @@ -173,19 +173,19 @@ namespace GradientSignal void ImageGradientComponent::OnAssetReady(AZ::Data::Asset asset) { - AZStd::lock_guard imageLock(m_imageMutex); + AZStd::unique_lock imageLock(m_imageMutex); m_configuration.m_imageAsset = asset; } void ImageGradientComponent::OnAssetMoved(AZ::Data::Asset asset, [[maybe_unused]] void* oldDataPointer) { - AZStd::lock_guard imageLock(m_imageMutex); + AZStd::unique_lock imageLock(m_imageMutex); m_configuration.m_imageAsset = asset; } void ImageGradientComponent::OnAssetReloaded(AZ::Data::Asset asset) { - AZStd::lock_guard imageLock(m_imageMutex); + AZStd::unique_lock imageLock(m_imageMutex); m_configuration.m_imageAsset = asset; } @@ -200,7 +200,7 @@ namespace GradientSignal if (!wasPointRejected) { - AZStd::lock_guard imageLock(m_imageMutex); + AZStd::shared_lock imageLock(m_imageMutex); return GetValueFromImageAsset(m_configuration.m_imageAsset, uvw, m_configuration.m_tilingX, m_configuration.m_tilingY, 0.0f); } @@ -223,7 +223,7 @@ namespace GradientSignal AZ::Data::AssetBus::Handler::BusDisconnect(m_configuration.m_imageAsset.GetId()); { - AZStd::lock_guard imageLock(m_imageMutex); + AZStd::unique_lock imageLock(m_imageMutex); m_configuration.m_imageAsset = AZ::Data::AssetManager::Instance().FindOrCreateAsset(assetId, azrtti_typeid(), m_configuration.m_imageAsset.GetAutoLoadBehavior()); } diff --git a/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.h b/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.h index 5033c44735..e73c8d0c4a 100644 --- a/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.h @@ -94,6 +94,6 @@ namespace GradientSignal private: ImageGradientConfig m_configuration; LmbrCentral::DependencyMonitor m_dependencyMonitor; - mutable AZStd::recursive_mutex m_imageMutex; + mutable AZStd::shared_mutex m_imageMutex; }; } From 6660c365b99d10037c9a32b5abc048ca98cbbc25 Mon Sep 17 00:00:00 2001 From: Jeremy Ong Date: Thu, 23 Dec 2021 16:25:44 -0700 Subject: [PATCH 251/948] Disambiguate null interface case In some cases, the interface being queried may be persistently nullptr (e.g. a gem isn't active, or a feature was disabled by a cvar). In this case, querying the interface would always enter the writer-lock branch with existing code because nullptr was synonmous with "we haven't queried for this variable yet." This PR adds an additional state variable that is set when s_instance is assigned to, so that after the variable is queried and found to be null, future queries can enter the read-lock branch. Signed-off-by: Jeremy Ong --- .../Framework/AzCore/AzCore/Interface/Interface.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Interface/Interface.h b/Code/Framework/AzCore/AzCore/Interface/Interface.h index 8664e2905f..8f72cfa109 100644 --- a/Code/Framework/AzCore/AzCore/Interface/Interface.h +++ b/Code/Framework/AzCore/AzCore/Interface/Interface.h @@ -109,6 +109,7 @@ namespace AZ */ static EnvironmentVariable s_instance; static AZStd::shared_mutex s_mutex; + static bool s_instanceAssigned; }; template @@ -117,6 +118,9 @@ namespace AZ template AZStd::shared_mutex Interface::s_mutex; + template + bool Interface::s_instanceAssigned; + template void Interface::Register(T* type) { @@ -135,18 +139,19 @@ namespace AZ AZStd::unique_lock lock(s_mutex); s_instance = Environment::CreateVariable(GetVariableName()); s_instance.Get() = type; + s_instanceAssigned = true; } template void Interface::Unregister(T* type) { - if (!s_instance || !s_instance.Get()) + if (!s_instanceAssigned) { AZ_Assert(false, "Interface '%s' not registered on this module!", AzTypeInfo::Name()); return; } - if (s_instance.Get() != type) + if (s_instance && s_instance.Get() != type) { AZ_Assert(false, "Interface '%s' is not the same instance that was registered! [Expected '%p', Found '%p']", AzTypeInfo::Name(), type, s_instance.Get()); return; @@ -156,6 +161,7 @@ namespace AZ AZStd::unique_lock lock(s_mutex); *s_instance = nullptr; s_instance.Reset(); + s_instanceAssigned = false; } template @@ -165,9 +171,9 @@ namespace AZ // This is the fast path which won't block. { AZStd::shared_lock lock(s_mutex); - if (s_instance) + if (s_instanceAssigned) { - return s_instance.Get(); + return s_instance ? s_instance.Get() : nullptr; } } @@ -175,6 +181,7 @@ namespace AZ // take the full lock and request it. AZStd::unique_lock lock(s_mutex); s_instance = Environment::FindVariable(GetVariableName()); + s_instanceAssigned = true; return s_instance ? s_instance.Get() : nullptr; } From 5b76d47e17b3ab7d80cfecc5fbfb85a03558e302 Mon Sep 17 00:00:00 2001 From: Jeremy Ong Date: Thu, 23 Dec 2021 17:15:49 -0700 Subject: [PATCH 252/948] Remove time tests that relied on main-thread sleeps Sleeping in tests and attempting to rely on fine-grained measurements to check code validity is intrinsically brittle. Wall-clock time is unreliable in an environment where tests are run under a hypervisor that may choose to suspend your VM at any point, or in situations where the OS cannot schedule your thread in time. The correct way to reintroduce these tests in the future is provide an override for the timestamp queries that can be injected in the test environment to control the wall time deterministically. Signed-off-by: Jeremy Ong --- .../Framework/AzCore/Tests/Time/TimeTests.cpp | 188 ------------------ 1 file changed, 188 deletions(-) diff --git a/Code/Framework/AzCore/Tests/Time/TimeTests.cpp b/Code/Framework/AzCore/Tests/Time/TimeTests.cpp index 446368a8ca..164e72343b 100644 --- a/Code/Framework/AzCore/Tests/Time/TimeTests.cpp +++ b/Code/Framework/AzCore/Tests/Time/TimeTests.cpp @@ -76,192 +76,4 @@ namespace UnitTest int64_t delta = static_cast(timeMs) - static_cast(timeUsToMs); EXPECT_LT(abs(delta), 1); } - - class TimeSystemTests : public AllocatorsTestFixture - { - public: - void SetUp() override - { - SetupAllocator(); - m_controlTime = static_cast(AZStd::GetTimeNowMicroSecond()); - m_timeSystem = AZStd::make_unique(); - } - - void TearDown() override - { - m_controlTime = AZ::Time::ZeroTimeUs; - m_timeSystem.reset(); - TeardownAllocator(); - } - - AZ::TimeUs GetDiff(AZ::TimeUs time1, AZ::TimeUs time2) const - { - // AZ::TimeUs is unsigned so make sure to not underflow. - return time1 > time2 ? time1 - time2 : time2 - time1; - } - - AZ::TimeUs m_controlTime; - AZStd::unique_ptr m_timeSystem; - }; - - TEST_F(TimeSystemTests, GetRealElapsedTimeUs) - { - // sleep for a bit to advance time. - AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(2)); - - // find the delta for the control and from GetRealElapsedTimeUs - const AZ::TimeUs baseline = static_cast(AZStd::GetTimeNowMicroSecond()) - m_controlTime; - const AZ::TimeUs elapsedTime = m_timeSystem->GetRealElapsedTimeUs(); - - const AZ::TimeUs diff = GetDiff(baseline, elapsedTime); - - // elapsedTime should be within 10 microseconds from baseline. - EXPECT_LT(diff, AZ::TimeUs{ 10 }); - } - - TEST_F(TimeSystemTests, GetElapsedTimeUs) - { - // sleep for a bit to advance time. - AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(2)); - - // find the delta for the control and from GetElapsedTimeUs - const AZ::TimeUs baseline = static_cast(AZStd::GetTimeNowMicroSecond()) - m_controlTime; - const AZ::TimeUs elapsedTime = m_timeSystem->GetElapsedTimeUs(); - - const AZ::TimeUs diff = GetDiff(baseline, elapsedTime); - - // elapsedTime should be within 10 microseconds from baseline. - EXPECT_LT(diff, AZ::TimeUs{ 10 }); - } - - TEST_F(TimeSystemTests, ElapsedTimeScales) - { - // slow down 'time' - m_timeSystem->SetSimulationTickScale(0.5f); - - // sleep for a bit to advance time. - AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(2)); - - // find the delta for the control and from GetElapsedTimeUs - const AZ::TimeUs baseline = static_cast(AZStd::GetTimeNowMicroSecond()) - m_controlTime; - const AZ::TimeUs elapsedTime = m_timeSystem->GetElapsedTimeUs(); - const AZ::TimeUs halfBaseline = (baseline / AZ::TimeUs{ 2 }); - - // elapsedTime should be about half of the control. - const AZ::TimeUs diff = GetDiff(halfBaseline, elapsedTime); - - // elapsedTime should be within 10 microseconds from baseline. - EXPECT_LT(diff, AZ::TimeUs{ 10 }); - - // reset time scale - m_timeSystem->SetSimulationTickScale(1.0f); - } - - TEST_F(TimeSystemTests, AdvanceTickDeltaTimes) - { - // advance the tick delta to get a clean base. - m_timeSystem->AdvanceTickDeltaTimes(); - const AZ::TimeUs baselineStart = static_cast(AZStd::GetTimeNowMicroSecond()); - - // sleep for a bit to advance time. - AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(2)); - - // advance the tick delta. - const AZ::TimeUs delta = m_timeSystem->AdvanceTickDeltaTimes(); - const AZ::TimeUs baselineDelta = static_cast(AZStd::GetTimeNowMicroSecond()) - baselineStart; - - // the delta should be close to the baselineDelta. - const AZ::TimeUs diff = GetDiff(delta, baselineDelta); - EXPECT_LT(diff, AZ::TimeUs{ 10 }); - } - - TEST_F(TimeSystemTests, SimulationAndRealTickDeltaTimesWithNoTimeScale) - { - // advance the tick delta to get a clean base. - m_timeSystem->AdvanceTickDeltaTimes(); - const AZ::TimeUs baselineStart = static_cast(AZStd::GetTimeNowMicroSecond()); - - // sleep for a bit to advance time. - AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(2)); - - // advance the tick delta. - const AZ::TimeUs delta = m_timeSystem->AdvanceTickDeltaTimes(); - const AZ::TimeUs baselineDelta = static_cast(AZStd::GetTimeNowMicroSecond()) - baselineStart; - - // the delta should be close to the baselineDelta. - AZ::TimeUs diff = GetDiff(delta, baselineDelta); - EXPECT_LT(diff, AZ::TimeUs{ 10 }); - - // the delta should be the same as GetSimulationTickDeltaTimeUs and near GetRealTickDeltaTimeUs - const AZ::TimeUs simDeltaTime = m_timeSystem->GetSimulationTickDeltaTimeUs(); - EXPECT_EQ(delta, simDeltaTime); - - const AZ::TimeUs realDeltaTime = m_timeSystem->GetRealTickDeltaTimeUs(); - diff = GetDiff(delta, realDeltaTime); - EXPECT_LT(diff, AZ::TimeUs{ 10 }); - } - - TEST_F(TimeSystemTests, SimulationAndRealTickDeltaTimesWithTimeScale) - { - // advance the tick delta to get a clean base. - m_timeSystem->AdvanceTickDeltaTimes(); - const AZ::TimeUs baselineStart = static_cast(AZStd::GetTimeNowMicroSecond()); - - // slow down 'time'; - m_timeSystem->SetSimulationTickScale(0.5f); - - // sleep for a bit to advance time. - AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(2)); - - // advance the tick delta. - const AZ::TimeUs delta = m_timeSystem->AdvanceTickDeltaTimes(); - const AZ::TimeUs baselineDelta = static_cast(AZStd::GetTimeNowMicroSecond()) - baselineStart; - const AZ::TimeUs halfBaselineDelta = (baselineDelta / AZ::TimeUs{ 2 }); - - // the delta should be half the baselineDelta - AZ::TimeUs diff = GetDiff(delta, halfBaselineDelta); - EXPECT_LT(diff, AZ::TimeUs{ 10 }); - - // the delta should be the same as GetSimulationTickDeltaTimeUs - const AZ::TimeUs simDeltaTime = m_timeSystem->GetSimulationTickDeltaTimeUs(); - EXPECT_EQ(delta, simDeltaTime); - - // the delta should be near half the GetRealTickDeltaTimeUs - const AZ::TimeUs realDeltaTime = m_timeSystem->GetRealTickDeltaTimeUs(); - const AZ::TimeUs halfRealDeltaTime = (realDeltaTime / AZ::TimeUs{ 2 }); - diff = GetDiff(delta, halfRealDeltaTime); - EXPECT_LT(diff, AZ::TimeUs{ 10 }); - - // reset time scale - m_timeSystem->SetSimulationTickScale(1.0f); - } - - TEST_F(TimeSystemTests, SimulationTickDeltaOverride) - { - // advance the tick delta to get a clean base. - m_timeSystem->AdvanceTickDeltaTimes(); - const AZ::TimeUs baselineStart = static_cast(AZStd::GetTimeNowMicroSecond()); - - // set the tick delta override - const AZ::TimeMs tickOverride = AZ::TimeMs{ 3462 }; - m_timeSystem->SetSimulationTickDeltaOverride(tickOverride); - - // sleep for a bit to advance time. - AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(2)); - - // advance the tick delta. - const AZ::TimeUs delta = m_timeSystem->AdvanceTickDeltaTimes(); - const AZ::TimeUs baselineDelta = static_cast(AZStd::GetTimeNowMicroSecond()) - baselineStart; - - // the delta should be equal to the tickOverride - EXPECT_EQ(delta, AZ::TimeMsToUs(tickOverride)); - - // real tick delta should be near the baselineDelta - const AZ::TimeUs realDeltaTime = m_timeSystem->GetRealTickDeltaTimeUs(); - const AZ::TimeUs diff = GetDiff(realDeltaTime, baselineDelta); - EXPECT_LT(diff, AZ::TimeUs{ 10 }); - - // reset the tick delta override - m_timeSystem->SetSimulationTickDeltaOverride(AZ::Time::ZeroTimeMs); - } } // namespace UnitTest From 4f746fddac6a2f82e4172a961ac3a8aa5ddfd113 Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Fri, 24 Dec 2021 16:56:39 -0800 Subject: [PATCH 253/948] chore: Rename Graph to EditorGraph Signed-off-by: Michael Pollind --- .../Builder/ScriptCanvasBuilderWorker.cpp | 2 +- .../Code/Builder/ScriptCanvasBuilderWorker.h | 4 +- .../ScriptCanvasBuilderWorkerUtility.cpp | 6 +- .../Assets/ScriptCanvasFileHandling.cpp | 4 +- .../Editor/Assets/ScriptCanvasUndoHelper.cpp | 4 +- .../Editor/Assets/ScriptCanvasUndoHelper.h | 6 +- .../Code/Editor/Components/EditorGraph.cpp | 264 +++++++++--------- .../Code/Editor/Components/EditorUtils.cpp | 2 +- .../Code/Editor/Components/GraphUpgrade.cpp | 4 +- .../ScriptCanvas/Components/EditorGraph.h | 22 +- .../ScriptCanvas/Components/EditorUtils.h | 4 +- .../ScriptCanvas/Components/GraphUpgrade.h | 6 +- .../Code/Editor/ScriptCanvasEditorGem.cpp | 2 +- .../Code/Editor/SystemComponent.cpp | 2 +- .../Editor/Undo/ScriptCanvasGraphCommand.cpp | 8 +- .../Editor/Undo/ScriptCanvasGraphCommand.h | 8 +- .../Code/Editor/View/Windows/MainWindow.cpp | 2 +- .../Windows/Tools/UpgradeTool/Controller.cpp | 2 +- .../Code/Include/ScriptCanvas/Core/Core.cpp | 8 +- .../Code/Include/ScriptCanvas/Core/Core.h | 10 +- 20 files changed, 184 insertions(+), 186 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp index a1a2d1d20f..2f44dfe090 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.cpp @@ -44,7 +44,7 @@ namespace ScriptCanvasBuilder AzFramework::StringFunc::Path::ConstructFull(request.m_watchFolder.data(), request.m_sourceFile.data(), fullPath, false); AzFramework::StringFunc::Path::Normalize(fullPath); - const ScriptCanvasEditor::Graph* sourceGraph = nullptr; + const ScriptCanvasEditor::EditorGraph* sourceGraph = nullptr; const ScriptCanvas::GraphData* graphData = nullptr; ScriptCanvasEditor::SourceHandle sourceHandle; diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h index 142886f98c..42cc958a07 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h @@ -35,7 +35,7 @@ namespace ScriptCanvas namespace ScriptCanvasEditor { - class Graph; + class EditorGraph; class SourceHandle; } @@ -135,7 +135,7 @@ namespace ScriptCanvasBuilder AZ::Outcome ProcessTranslationJob(ProcessTranslationJobInput& input); - ScriptCanvasEditor::Graph* PrepareSourceGraph(AZ::Entity* const buildEntity); + ScriptCanvasEditor::EditorGraph* PrepareSourceGraph(AZ::Entity* const buildEntity); AZ::Outcome SaveSubgraphInterface(ProcessTranslationJobInput& input, ScriptCanvas::SubgraphInterfaceData& subgraphInterface); diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp index 64e73de9b9..110f8c5164 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp @@ -153,7 +153,7 @@ namespace ScriptCanvasBuilder return AZ::Failure(AZStd::string("Cannot compile graph data from a nullptr Script Canvas Entity")); } - auto sourceGraph = AZ::EntityUtils::FindFirstDerivedComponent(scriptCanvasEntity); + auto sourceGraph = AZ::EntityUtils::FindFirstDerivedComponent(scriptCanvasEntity); if (!sourceGraph) { return AZ::Failure(AZStd::string("Failed to find Script Canvas Graph Component")); @@ -385,9 +385,9 @@ namespace ScriptCanvasBuilder ; } - ScriptCanvasEditor::Graph* PrepareSourceGraph(AZ::Entity* const buildEntity) + ScriptCanvasEditor::EditorGraph* PrepareSourceGraph(AZ::Entity* const buildEntity) { - auto sourceGraph = AZ::EntityUtils::FindFirstDerivedComponent(buildEntity); + auto sourceGraph = AZ::EntityUtils::FindFirstDerivedComponent(buildEntity); if (!sourceGraph) { return nullptr; diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp index c4579c9042..bea3cdfe21 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasFileHandling.cpp @@ -180,7 +180,7 @@ namespace ScriptCanvasEditor AZ::ComponentApplicationBus::BroadcastResult(serializeContext, &AZ::ComponentApplicationRequests::GetSerializeContext); AZ_Assert(serializeContext, "LoadEditorAssetTree() ailed to retrieve serialize context!"); - const ScriptCanvasEditor::Graph* graph = handle.Get(); + const ScriptCanvasEditor::EditorGraph* graph = handle.Get(); serializeContext->EnumerateObject(graph, beginElementCB, nullptr, AZ::SerializeContext::ENUM_ACCESS_FOR_READ); EditorAssetTree result; @@ -253,7 +253,7 @@ namespace ScriptCanvasEditor aznumeric_caster(ScriptCanvas::MathNodeUtilities::GetRandomIntegral(1, std::numeric_limits::max())); entity->SetId(AZ::EntityId(entityId)); - auto graph = entity->FindComponent(); + auto graph = entity->FindComponent(); graph->MarkOwnership(*scriptCanvasData); entity->Init(); diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.cpp b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.cpp index a067bf411e..35c2f9a11a 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.cpp @@ -17,7 +17,7 @@ namespace ScriptCanvasEditor { } - UndoHelper::UndoHelper(Graph* graph) + UndoHelper::UndoHelper(EditorGraph* graph) : m_undoState(this) { SetSource(graph); @@ -28,7 +28,7 @@ namespace ScriptCanvasEditor UndoRequestBus::Handler::BusDisconnect(); } - void UndoHelper::SetSource(Graph* graph) + void UndoHelper::SetSource(EditorGraph* graph) { m_graph = graph; UndoRequestBus::Handler::BusConnect(graph->GetScriptCanvasId()); diff --git a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.h b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.h index e2d4f008fa..4765468ee7 100644 --- a/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.h +++ b/Gems/ScriptCanvas/Code/Editor/Assets/ScriptCanvasUndoHelper.h @@ -21,13 +21,13 @@ namespace ScriptCanvasEditor public: UndoHelper(); - UndoHelper(Graph* source); + UndoHelper(EditorGraph* source); ~UndoHelper(); UndoCache* GetSceneUndoCache() override; UndoData CreateUndoData() override; - void SetSource(Graph* source); + void SetSource(EditorGraph* source); void BeginUndoBatch(AZStd::string_view label) override; void EndUndoBatch() override; @@ -58,6 +58,6 @@ namespace ScriptCanvasEditor Status m_status = Status::Idle; SceneUndoState m_undoState; - Graph* m_graph = nullptr; + EditorGraph* m_graph = nullptr; }; } diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp index d713bc09a6..2a610cd44f 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp @@ -100,20 +100,8 @@ namespace EditorGraphCpp } namespace ScriptCanvasEditor { - namespace EditorGraph - { - static const char* GetMimeType() - { - return "application/x-o3de-scriptcanvas"; - } - - static const char* GetWrappedNodeGroupingMimeType() - { - return "application/x-03de-scriptcanvas-wrappednodegrouping"; - } - } - Graph::~Graph() + EditorGraph::~EditorGraph() { for (auto& entry : m_graphCanvasSaveData) { @@ -152,7 +140,7 @@ namespace ScriptCanvasEditor return true; } - void Graph::ConvertToGetVariableNode(Graph* graph, ScriptCanvas::VariableId variableId, const AZ::EntityId& nodeId, AZStd::unordered_map< AZ::EntityId, AZ::EntityId >& setVariableRemapping) + void EditorGraph::ConvertToGetVariableNode(EditorGraph* graph, ScriptCanvas::VariableId variableId, const AZ::EntityId& nodeId, AZStd::unordered_map< AZ::EntityId, AZ::EntityId >& setVariableRemapping) { ScriptCanvas::ScriptCanvasId scriptCanvasId = graph->GetScriptCanvasId(); GraphCanvas::GraphId graphId = graph->GetGraphCanvasGraphId(); @@ -440,7 +428,7 @@ namespace ScriptCanvasEditor } } - void Graph::Reflect(AZ::ReflectContext* context) + void EditorGraph::Reflect(AZ::ReflectContext* context) { GraphStatisticsHelper::Reflect(context); @@ -453,19 +441,19 @@ namespace ScriptCanvasEditor ->Field("Count", &CRCCache::m_cacheCount) ; - serializeContext->Class() + serializeContext->Class() ->Version(EditorGraphCpp::Version::Current, &GraphVersionConverter) - ->Field("m_variableCounter", &Graph::m_variableCounter) - ->Field("m_saveFormatConverted", &Graph::m_saveFormatConverted) - ->Field("GraphCanvasData", &Graph::m_graphCanvasSaveData) - ->Field("CRCCacheMap", &Graph::m_crcCacheMap) - ->Field("StatisticsHelper", &Graph::m_statisticsHelper) - ->Field("GraphCanvasSaveVersion", &Graph::m_graphCanvasSaveVersion) + ->Field("m_variableCounter", &EditorGraph::m_variableCounter) + ->Field("m_saveFormatConverted", &EditorGraph::m_saveFormatConverted) + ->Field("GraphCanvasData", &EditorGraph::m_graphCanvasSaveData) + ->Field("CRCCacheMap", &EditorGraph::m_crcCacheMap) + ->Field("StatisticsHelper", &EditorGraph::m_statisticsHelper) + ->Field("GraphCanvasSaveVersion", &EditorGraph::m_graphCanvasSaveVersion) ; } } - void Graph::Activate() + void EditorGraph::Activate() { const ScriptCanvas::ScriptCanvasId& scriptCanvasId = GetScriptCanvasId(); @@ -483,7 +471,7 @@ namespace ScriptCanvasEditor m_undoHelper.SetSource(this); } - void Graph::Deactivate() + void EditorGraph::Deactivate() { GraphItemCommandNotificationBus::Handler::BusDisconnect(); ScriptCanvas::GraphRequestBus::Handler::BusDisconnect(); @@ -499,7 +487,7 @@ namespace ScriptCanvasEditor m_graphCanvasSceneEntity = nullptr; } - void Graph::OnViewRegistered() + void EditorGraph::OnViewRegistered() { if (!m_saveFormatConverted) { @@ -507,7 +495,7 @@ namespace ScriptCanvasEditor } } - bool Graph::SanityCheckNodeReplacement(ScriptCanvas::Node* oldNode, ScriptCanvas::Node* newNode, ScriptCanvas::NodeUpdateSlotReport& nodeUpdateSlotReport) + bool EditorGraph::SanityCheckNodeReplacement(ScriptCanvas::Node* oldNode, ScriptCanvas::Node* newNode, ScriptCanvas::NodeUpdateSlotReport& nodeUpdateSlotReport) { auto findReplacementMatch = [](const ScriptCanvas::Slot* oldSlot, const AZStd::vector& newSlots)->ScriptCanvas::SlotId { @@ -623,7 +611,7 @@ namespace ScriptCanvasEditor return true; } - void Graph::HandleFunctionDefinitionExtension(ScriptCanvas::Node* node, GraphCanvas::SlotId graphCanvasSlotId, const GraphCanvas::NodeId& nodeId) + void EditorGraph::HandleFunctionDefinitionExtension(ScriptCanvas::Node* node, GraphCanvas::SlotId graphCanvasSlotId, const GraphCanvas::NodeId& nodeId) { // Special-case for the execution nodeling extensions, which are adding input/output data slots. // We want to automatically promote them to variables so that the user can refer to them more easily @@ -690,7 +678,7 @@ namespace ScriptCanvasEditor } } - AZ::Outcome Graph::ReplaceNodeByConfig + AZ::Outcome EditorGraph::ReplaceNodeByConfig ( ScriptCanvas::Node* oldNode , const ScriptCanvas::NodeConfiguration& nodeConfig , ScriptCanvas::NodeUpdateSlotReport& nodeUpdateSlotReport) @@ -809,7 +797,7 @@ namespace ScriptCanvasEditor } } - void Graph::OnEntitiesSerialized(GraphCanvas::GraphSerialization& serializationTarget) + void EditorGraph::OnEntitiesSerialized(GraphCanvas::GraphSerialization& serializationTarget) { const GraphCanvas::GraphData& graphCanvasGraphData = serializationTarget.GetGraphData(); @@ -939,7 +927,7 @@ namespace ScriptCanvasEditor } } - void Graph::OnEntitiesDeserialized(const GraphCanvas::GraphSerialization& serializationSource) + void EditorGraph::OnEntitiesDeserialized(const GraphCanvas::GraphSerialization& serializationSource) { const auto& userDataMap = serializationSource.GetUserDataMapRef(); @@ -1026,7 +1014,7 @@ namespace ScriptCanvasEditor } } - void Graph::DisconnectConnection(const GraphCanvas::ConnectionId& connectionId) + void EditorGraph::DisconnectConnection(const GraphCanvas::ConnectionId& connectionId) { AZStd::any* connectionUserData = nullptr; GraphCanvas::ConnectionRequestBus::EventResult(connectionUserData, connectionId, &GraphCanvas::ConnectionRequests::GetUserData); @@ -1044,11 +1032,11 @@ namespace ScriptCanvasEditor } } - ScriptCanvas::DataPtr Graph::Create() + ScriptCanvas::DataPtr EditorGraph::Create() { if (AZ::Entity* entity = aznew AZ::Entity("Script Canvas Graph")) { - auto graph = entity->CreateComponent(); + auto graph = entity->CreateComponent(); entity->CreateComponent(graph->GetScriptCanvasId()); if (ScriptCanvas::DataPtr data = aznew ScriptCanvas::ScriptCanvasData()) @@ -1064,17 +1052,17 @@ namespace ScriptCanvasEditor return nullptr; } - void Graph::MarkOwnership(ScriptCanvas::ScriptCanvasData& owner) + void EditorGraph::MarkOwnership(ScriptCanvas::ScriptCanvasData& owner) { m_owner = &owner; } - ScriptCanvas::DataPtr Graph::GetOwnership() const + ScriptCanvas::DataPtr EditorGraph::GetOwnership() const { - return const_cast(this)->m_owner; + return const_cast(this)->m_owner; } - bool Graph::CreateConnection(const GraphCanvas::ConnectionId& connectionId, const GraphCanvas::Endpoint& sourcePoint, const GraphCanvas::Endpoint& targetPoint) + bool EditorGraph::CreateConnection(const GraphCanvas::ConnectionId& connectionId, const GraphCanvas::Endpoint& sourcePoint, const GraphCanvas::Endpoint& targetPoint) { if (!sourcePoint.IsValid() || !targetPoint.IsValid()) { @@ -1103,7 +1091,7 @@ namespace ScriptCanvasEditor return scConnected; } - bool Graph::IsValidConnection(const GraphCanvas::Endpoint& sourcePoint, const GraphCanvas::Endpoint& targetPoint) const + bool EditorGraph::IsValidConnection(const GraphCanvas::Endpoint& sourcePoint, const GraphCanvas::Endpoint& targetPoint) const { ScriptCanvas::Endpoint scSourceEndpoint = ConvertToScriptCanvasEndpoint(sourcePoint); ScriptCanvas::Endpoint scTargetEndpoint = ConvertToScriptCanvasEndpoint(targetPoint); @@ -1111,23 +1099,23 @@ namespace ScriptCanvasEditor return CanCreateConnectionBetween(scSourceEndpoint, scTargetEndpoint).IsSuccess(); } - AZStd::string Graph::GetDataTypeString(const AZ::Uuid&) + AZStd::string EditorGraph::GetDataTypeString(const AZ::Uuid&) { // This is used by the default tooltip setting in GraphCanvas, returning an empty string // in order for tooltips to be fully controlled by ScriptCanvas return {}; } - void Graph::OnRemoveUnusedNodes() + void EditorGraph::OnRemoveUnusedNodes() { } - void Graph::OnRemoveUnusedElements() + void EditorGraph::OnRemoveUnusedElements() { RemoveUnusedVariables(); } - bool Graph::AllowReset(const GraphCanvas::Endpoint& endpoint) const + bool EditorGraph::AllowReset(const GraphCanvas::Endpoint& endpoint) const { ScriptCanvas::Endpoint scEndpoint = ConvertToScriptCanvasEndpoint(endpoint); @@ -1159,7 +1147,7 @@ namespace ScriptCanvasEditor return false; } - GraphCanvas::NodePropertyDisplay* Graph::CreateDataSlotPropertyDisplay(const AZ::Uuid& dataType, const GraphCanvas::NodeId& nodeId, const GraphCanvas::SlotId& slotId) const + GraphCanvas::NodePropertyDisplay* EditorGraph::CreateDataSlotPropertyDisplay(const AZ::Uuid& dataType, const GraphCanvas::NodeId& nodeId, const GraphCanvas::SlotId& slotId) const { (void)dataType; @@ -1174,7 +1162,7 @@ namespace ScriptCanvasEditor return CreateDisplayPropertyForSlot(scriptCanvasNodeId, scriptCanvasSlotId); } - GraphCanvas::NodePropertyDisplay* Graph::CreatePropertySlotPropertyDisplay(const AZ::Crc32& propertyId, const GraphCanvas::NodeId& nodeId, const GraphCanvas::NodeId& slotId) const + GraphCanvas::NodePropertyDisplay* EditorGraph::CreatePropertySlotPropertyDisplay(const AZ::Crc32& propertyId, const GraphCanvas::NodeId& nodeId, const GraphCanvas::NodeId& slotId) const { (void)slotId; @@ -1234,7 +1222,7 @@ namespace ScriptCanvasEditor return nullptr; } - AZ::EntityId Graph::ConvertToScriptCanvasNodeId(const GraphCanvas::NodeId& nodeId) const + AZ::EntityId EditorGraph::ConvertToScriptCanvasNodeId(const GraphCanvas::NodeId& nodeId) const { AZStd::any* userData = nullptr; @@ -1243,7 +1231,7 @@ namespace ScriptCanvasEditor return (userData && userData->is()) ? *AZStd::any_cast(userData) : AZ::EntityId(); } - GraphCanvas::NodePropertyDisplay* Graph::CreateDisplayPropertyForSlot(const AZ::EntityId& scriptCanvasNodeId, const ScriptCanvas::SlotId& scriptCanvasSlotId) const + GraphCanvas::NodePropertyDisplay* EditorGraph::CreateDisplayPropertyForSlot(const AZ::EntityId& scriptCanvasNodeId, const ScriptCanvas::SlotId& scriptCanvasSlotId) const { ScriptCanvas::Slot* slot = nullptr; ScriptCanvas::NodeRequestBus::EventResult(slot, scriptCanvasNodeId, &ScriptCanvas::NodeRequests::GetSlot, scriptCanvasSlotId); @@ -1354,13 +1342,13 @@ namespace ScriptCanvasEditor return nullptr; } - void Graph::SignalDirty() + void EditorGraph::SignalDirty() { SourceHandle handle(m_owner, {}, {}); GeneralRequestBus::Broadcast(&GeneralRequests::SignalSceneDirty, handle); } - void Graph::HighlightNodesByType(const ScriptCanvas::NodeTypeIdentifier& nodeTypeIdentifier) + void EditorGraph::HighlightNodesByType(const ScriptCanvas::NodeTypeIdentifier& nodeTypeIdentifier) { for (const auto& nodePair : GetNodeMapping()) { @@ -1371,7 +1359,7 @@ namespace ScriptCanvasEditor } } - void Graph::HighlightEBusNodes(const ScriptCanvas::EBusBusId& busId, const ScriptCanvas::EBusEventId& eventId) + void EditorGraph::HighlightEBusNodes(const ScriptCanvas::EBusBusId& busId, const ScriptCanvas::EBusEventId& eventId) { ScriptCanvas::NodeTypeIdentifier ebusIdentifier = ScriptCanvas::NodeUtils::ConstructEBusIdentifier(busId); @@ -1394,7 +1382,7 @@ namespace ScriptCanvasEditor } } - void Graph::HighlightScriptEventNodes(const ScriptCanvas::EBusBusId& busId, const ScriptCanvas::EBusEventId& eventId) + void EditorGraph::HighlightScriptEventNodes(const ScriptCanvas::EBusBusId& busId, const ScriptCanvas::EBusEventId& eventId) { ScriptCanvas::NodeTypeIdentifier sendScriptEventIdentifier = ScriptCanvas::NodeUtils::ConstructSendScriptEventIdentifier(busId, eventId); ScriptCanvas::NodeTypeIdentifier receiveScriptEventIdentifier = ScriptCanvas::NodeUtils::ConstructScriptEventIdentifier(busId); @@ -1422,7 +1410,7 @@ namespace ScriptCanvasEditor } } - void Graph::HighlightScriptCanvasEntity(const AZ::EntityId& scriptCanvasId) + void EditorGraph::HighlightScriptCanvasEntity(const AZ::EntityId& scriptCanvasId) { GraphCanvas::SceneMemberGlowOutlineConfiguration glowConfiguration; @@ -1446,7 +1434,7 @@ namespace ScriptCanvasEditor } } - AZ::EntityId Graph::FindGraphCanvasSlotId(const AZ::EntityId& graphCanvasNodeId, const ScriptCanvas::SlotId& slotId) + AZ::EntityId EditorGraph::FindGraphCanvasSlotId(const AZ::EntityId& graphCanvasNodeId, const ScriptCanvas::SlotId& slotId) { AZ::EntityId graphCanvasSlotId; SlotMappingRequestBus::EventResult(graphCanvasSlotId, graphCanvasNodeId, &SlotMappingRequests::MapToGraphCanvasId, slotId); @@ -1467,7 +1455,7 @@ namespace ScriptCanvasEditor return graphCanvasSlotId; } - bool Graph::ConfigureConnectionUserData(const ScriptCanvas::Endpoint& sourceEndpoint, const ScriptCanvas::Endpoint& targetEndpoint, GraphCanvas::ConnectionId connectionId) + bool EditorGraph::ConfigureConnectionUserData(const ScriptCanvas::Endpoint& sourceEndpoint, const ScriptCanvas::Endpoint& targetEndpoint, GraphCanvas::ConnectionId connectionId) { bool isConfigured = true; @@ -1493,7 +1481,7 @@ namespace ScriptCanvasEditor return isConfigured; } - void Graph::HandleQueuedUpdates() + void EditorGraph::HandleQueuedUpdates() { bool signalDirty = false; @@ -1573,7 +1561,7 @@ namespace ScriptCanvasEditor } } - bool Graph::IsNodeVersionConverting(const AZ::EntityId& graphCanvasNodeId) const + bool EditorGraph::IsNodeVersionConverting(const AZ::EntityId& graphCanvasNodeId) const { bool isConverting = false; @@ -1598,7 +1586,7 @@ namespace ScriptCanvasEditor return isConverting; } - void Graph::OnPreNodeDeleted(const AZ::EntityId& nodeId) + void EditorGraph::OnPreNodeDeleted(const AZ::EntityId& nodeId) { // If we are cdeleteing a HandlerEventNode we don't need to do anything since they are purely visual. // And the underlying ScriptCanvas nodes will persist and maintain all of their state. @@ -1630,7 +1618,7 @@ namespace ScriptCanvasEditor } } - void Graph::OnPreConnectionDeleted(const AZ::EntityId& connectionId) + void EditorGraph::OnPreConnectionDeleted(const AZ::EntityId& connectionId) { AZStd::any* userData = nullptr; GraphCanvas::ConnectionRequestBus::EventResult(userData, connectionId, &GraphCanvas::ConnectionRequests::GetUserData); @@ -1671,22 +1659,22 @@ namespace ScriptCanvasEditor DisconnectConnection(connectionId); } - void Graph::OnUnknownPaste([[maybe_unused]] const QPointF& scenePos) + void EditorGraph::OnUnknownPaste([[maybe_unused]] const QPointF& scenePos) { GraphVariablesTableView::HandleVariablePaste(GetScriptCanvasId()); } - void Graph::OnSelectionChanged() + void EditorGraph::OnSelectionChanged() { ClearHighlights(); } - AZ::u32 Graph::GetNewVariableCounter() + AZ::u32 EditorGraph::GetNewVariableCounter() { return ++m_variableCounter; } - void Graph::ReleaseVariableCounter(AZ::u32 variableCounter) + void EditorGraph::ReleaseVariableCounter(AZ::u32 variableCounter) { if (m_variableCounter == variableCounter) { @@ -1694,32 +1682,32 @@ namespace ScriptCanvasEditor } } - void Graph::RequestUndoPoint() + void EditorGraph::RequestUndoPoint() { GeneralRequestBus::Broadcast(&GeneralRequests::PostUndoPoint, GetScriptCanvasId()); } - void Graph::RequestPushPreventUndoStateUpdate() + void EditorGraph::RequestPushPreventUndoStateUpdate() { GeneralRequestBus::Broadcast(&GeneralRequests::PushPreventUndoStateUpdate); } - void Graph::RequestPopPreventUndoStateUpdate() + void EditorGraph::RequestPopPreventUndoStateUpdate() { GeneralRequestBus::Broadcast(&GeneralRequests::PopPreventUndoStateUpdate); } - void Graph::TriggerUndo() + void EditorGraph::TriggerUndo() { GeneralRequestBus::Broadcast(&GeneralRequests::TriggerUndo); } - void Graph::TriggerRedo() + void EditorGraph::TriggerRedo() { GeneralRequestBus::Broadcast(&GeneralRequests::TriggerRedo); } - void Graph::EnableNodes(const AZStd::unordered_set< GraphCanvas::NodeId >& nodeIds) + void EditorGraph::EnableNodes(const AZStd::unordered_set< GraphCanvas::NodeId >& nodeIds) { bool enabledNodes = false; for (auto graphCanvasNodeId : nodeIds) @@ -1745,7 +1733,7 @@ namespace ScriptCanvasEditor } } - void Graph::DisableNodes(const AZStd::unordered_set< GraphCanvas::NodeId >& nodeIds) + void EditorGraph::DisableNodes(const AZStd::unordered_set< GraphCanvas::NodeId >& nodeIds) { bool disabledNodes = false; for (auto graphCanvasNodeId : nodeIds) @@ -1766,12 +1754,12 @@ namespace ScriptCanvasEditor } } - void Graph::PostDeletionEvent() + void EditorGraph::PostDeletionEvent() { GeneralRequestBus::Broadcast(&GeneralRequests::PostUndoPoint, GetScriptCanvasId()); } - void Graph::PostCreationEvent() + void EditorGraph::PostCreationEvent() { GeneralRequestBus::Broadcast(&GeneralRequests::PushPreventUndoStateUpdate); if (m_wrapperNodeDropTarget.IsValid()) @@ -1979,7 +1967,7 @@ namespace ScriptCanvasEditor GeneralRequestBus::Broadcast(&GeneralRequests::PostUndoPoint, GetScriptCanvasId()); } - void Graph::PostRestore(const UndoData&) + void EditorGraph::PostRestore(const UndoData&) { AZStd::vector graphCanvasNodeIds; GraphCanvas::SceneRequestBus::EventResult(graphCanvasNodeIds, GetGraphCanvasGraphId(), &GraphCanvas::SceneRequests::GetNodes); @@ -1995,23 +1983,23 @@ namespace ScriptCanvasEditor GraphCanvas::ViewRequestBus::Event(viewId, &GraphCanvas::ViewRequests::RefreshView); } - void Graph::OnPasteBegin() + void EditorGraph::OnPasteBegin() { GeneralRequestBus::Broadcast(&GeneralRequests::PushPreventUndoStateUpdate); } - void Graph::OnPasteEnd() + void EditorGraph::OnPasteEnd() { GeneralRequestBus::Broadcast(&GeneralRequests::PopPreventUndoStateUpdate); GeneralRequestBus::Broadcast(&GeneralRequests::PostUndoPoint, GetScriptCanvasId()); } - void Graph::OnGraphCanvasNodeCreated(const AZ::EntityId& nodeId) + void EditorGraph::OnGraphCanvasNodeCreated(const AZ::EntityId& nodeId) { m_lastGraphCanvasCreationGroup.emplace_back(nodeId); } - void Graph::ResetSlotToDefaultValue(const GraphCanvas::Endpoint& endpoint) + void EditorGraph::ResetSlotToDefaultValue(const GraphCanvas::Endpoint& endpoint) { ScriptCanvas::Endpoint scEndpoint = ConvertToScriptCanvasEndpoint(endpoint); @@ -2023,13 +2011,13 @@ namespace ScriptCanvasEditor } } - void Graph::ResetReference(const GraphCanvas::Endpoint& endpoint) + void EditorGraph::ResetReference(const GraphCanvas::Endpoint& endpoint) { // ResetSlotToDefault deals with resetting the reference internal to the function call on the node. ResetSlotToDefaultValue(endpoint); } - void Graph::ResetProperty(const GraphCanvas::NodeId& nodeId, const AZ::Crc32& propertyId) + void EditorGraph::ResetProperty(const GraphCanvas::NodeId& nodeId, const AZ::Crc32& propertyId) { AZ::EntityId scriptCanvasNodeId = ConvertToScriptCanvasNodeId(nodeId); ScriptCanvas::Node* canvasNode = FindNode(scriptCanvasNodeId); @@ -2040,7 +2028,7 @@ namespace ScriptCanvasEditor } } - void Graph::RemoveSlot(const GraphCanvas::Endpoint& endpoint) + void EditorGraph::RemoveSlot(const GraphCanvas::Endpoint& endpoint) { ScriptCanvas::Endpoint scEndpoint = ConvertToScriptCanvasEndpoint(endpoint); @@ -2067,7 +2055,7 @@ namespace ScriptCanvasEditor } } - bool Graph::IsSlotRemovable(const GraphCanvas::Endpoint& endpoint) const + bool EditorGraph::IsSlotRemovable(const GraphCanvas::Endpoint& endpoint) const { ScriptCanvas::Endpoint scEndpoint = ConvertToScriptCanvasEndpoint(endpoint); @@ -2081,7 +2069,7 @@ namespace ScriptCanvasEditor return false; } - bool Graph::ConvertSlotToReference(const GraphCanvas::Endpoint& endpoint) + bool EditorGraph::ConvertSlotToReference(const GraphCanvas::Endpoint& endpoint) { ScriptCanvas::Endpoint scEndpoint = ConvertToScriptCanvasEndpoint(endpoint); ScriptCanvas::Node* canvasNode = FindNode(scEndpoint.GetNodeId()); @@ -2094,7 +2082,7 @@ namespace ScriptCanvasEditor return false; } - bool Graph::CanConvertSlotToReference(const GraphCanvas::Endpoint& endpoint) + bool EditorGraph::CanConvertSlotToReference(const GraphCanvas::Endpoint& endpoint) { ScriptCanvas::Endpoint scEndpoint = ConvertToScriptCanvasEndpoint(endpoint); ScriptCanvas::Node* canvasNode = FindNode(scEndpoint.GetNodeId()); @@ -2111,7 +2099,7 @@ namespace ScriptCanvasEditor return false; } - GraphCanvas::CanHandleMimeEventOutcome Graph::CanHandleReferenceMimeEvent(const GraphCanvas::Endpoint& endpoint, const QMimeData* mimeData) + GraphCanvas::CanHandleMimeEventOutcome EditorGraph::CanHandleReferenceMimeEvent(const GraphCanvas::Endpoint& endpoint, const QMimeData* mimeData) { ScriptCanvas::Endpoint scEndpoint = ConvertToScriptCanvasEndpoint(endpoint); ScriptCanvas::Node* canvasNode = FindNode(scEndpoint.GetNodeId()); @@ -2144,7 +2132,7 @@ namespace ScriptCanvasEditor return AZ::Failure(AZStd::string("Unable to find Node")); } - bool Graph::HandleReferenceMimeEvent(const GraphCanvas::Endpoint& endpoint, const QMimeData* mimeData) + bool EditorGraph::HandleReferenceMimeEvent(const GraphCanvas::Endpoint& endpoint, const QMimeData* mimeData) { bool handledEvent = false; @@ -2170,7 +2158,7 @@ namespace ScriptCanvasEditor return handledEvent; } - bool Graph::CanPromoteToVariable(const GraphCanvas::Endpoint& endpoint) const + bool EditorGraph::CanPromoteToVariable(const GraphCanvas::Endpoint& endpoint) const { ScriptCanvas::Endpoint scriptCanvasEndpoint = ConvertToScriptCanvasEndpoint(endpoint); auto activeSlot = FindSlot(scriptCanvasEndpoint); @@ -2189,7 +2177,7 @@ namespace ScriptCanvasEditor return false; } - bool Graph::PromoteToVariableAction(const GraphCanvas::Endpoint& endpoint) + bool EditorGraph::PromoteToVariableAction(const GraphCanvas::Endpoint& endpoint) { ScriptCanvas::Endpoint scriptCanvasEndpoint = ConvertToScriptCanvasEndpoint(endpoint); @@ -2296,7 +2284,7 @@ namespace ScriptCanvasEditor return addOutcome.IsSuccess(); } - bool Graph::SynchronizeReferences(const GraphCanvas::Endpoint& referenceSource, const GraphCanvas::Endpoint& referenceTarget) + bool EditorGraph::SynchronizeReferences(const GraphCanvas::Endpoint& referenceSource, const GraphCanvas::Endpoint& referenceTarget) { ScriptCanvas::Endpoint scriptCanvasSourceEndpoint = ConvertToScriptCanvasEndpoint(referenceSource); ScriptCanvas::Endpoint scriptCanvasTargetEndpoint = ConvertToScriptCanvasEndpoint(referenceTarget); @@ -2334,7 +2322,7 @@ namespace ScriptCanvasEditor return false; } - bool Graph::ConvertSlotToValue(const GraphCanvas::Endpoint& endpoint) + bool EditorGraph::ConvertSlotToValue(const GraphCanvas::Endpoint& endpoint) { ScriptCanvas::Endpoint scEndpoint = ConvertToScriptCanvasEndpoint(endpoint); ScriptCanvas::Node* canvasNode = FindNode(scEndpoint.GetNodeId()); @@ -2347,7 +2335,7 @@ namespace ScriptCanvasEditor return false; } - bool Graph::CanConvertSlotToValue(const GraphCanvas::Endpoint& endpoint) + bool EditorGraph::CanConvertSlotToValue(const GraphCanvas::Endpoint& endpoint) { ScriptCanvas::Endpoint scEndpoint = ConvertToScriptCanvasEndpoint(endpoint); ScriptCanvas::Node* canvasNode = FindNode(scEndpoint.GetNodeId()); @@ -2361,7 +2349,7 @@ namespace ScriptCanvasEditor return false; } - GraphCanvas::CanHandleMimeEventOutcome Graph::CanHandleValueMimeEvent(const GraphCanvas::Endpoint& endpoint, const QMimeData* mimeData) + GraphCanvas::CanHandleMimeEventOutcome EditorGraph::CanHandleValueMimeEvent(const GraphCanvas::Endpoint& endpoint, const QMimeData* mimeData) { AZ_UNUSED(endpoint); AZ_UNUSED(mimeData); @@ -2371,7 +2359,7 @@ namespace ScriptCanvasEditor return AZ::Failure(AZStd::string("Unimplemented drag and drop flow")); } - bool Graph::HandleValueMimeEvent(const GraphCanvas::Endpoint& endpoint, const QMimeData* mimeData) + bool EditorGraph::HandleValueMimeEvent(const GraphCanvas::Endpoint& endpoint, const QMimeData* mimeData) { AZ_UNUSED(endpoint); AZ_UNUSED(mimeData); @@ -2379,7 +2367,7 @@ namespace ScriptCanvasEditor return false; } - GraphCanvas::SlotId Graph::RequestExtension(const GraphCanvas::NodeId& nodeId, const GraphCanvas::ExtenderId& extenderId, GraphModelRequests::ExtensionRequestReason reason) + GraphCanvas::SlotId EditorGraph::RequestExtension(const GraphCanvas::NodeId& nodeId, const GraphCanvas::ExtenderId& extenderId, GraphModelRequests::ExtensionRequestReason reason) { GraphCanvas::SlotId graphCanvasSlotId; @@ -2414,7 +2402,7 @@ namespace ScriptCanvasEditor return graphCanvasSlotId; } - void Graph::ExtensionCancelled(const GraphCanvas::NodeId& nodeId, const GraphCanvas::ExtenderId& extenderId) + void EditorGraph::ExtensionCancelled(const GraphCanvas::NodeId& nodeId, const GraphCanvas::ExtenderId& extenderId) { AZ::EntityId scNodeId = ConvertToScriptCanvasNodeId(nodeId); @@ -2429,7 +2417,7 @@ namespace ScriptCanvasEditor } } - void Graph::FinalizeExtension(const GraphCanvas::NodeId& nodeId, const GraphCanvas::ExtenderId& extenderId) + void EditorGraph::FinalizeExtension(const GraphCanvas::NodeId& nodeId, const GraphCanvas::ExtenderId& extenderId) { AZ::EntityId scNodeId = ConvertToScriptCanvasNodeId(nodeId); @@ -2444,7 +2432,7 @@ namespace ScriptCanvasEditor } } - bool Graph::ShouldWrapperAcceptDrop(const AZ::EntityId& wrapperNode, const QMimeData* mimeData) const + bool EditorGraph::ShouldWrapperAcceptDrop(const AZ::EntityId& wrapperNode, const QMimeData* mimeData) const { if (!mimeData->hasFormat(Widget::NodePaletteDockWidget::GetMimeType())) { @@ -2492,7 +2480,7 @@ namespace ScriptCanvasEditor return true; } - void Graph::AddWrapperDropTarget(const AZ::EntityId& wrapperNode) + void EditorGraph::AddWrapperDropTarget(const AZ::EntityId& wrapperNode) { if (!m_wrapperNodeDropTarget.IsValid()) { @@ -2500,7 +2488,7 @@ namespace ScriptCanvasEditor } } - void Graph::RemoveWrapperDropTarget(const AZ::EntityId& wrapperNode) + void EditorGraph::RemoveWrapperDropTarget(const AZ::EntityId& wrapperNode) { if (m_wrapperNodeDropTarget == wrapperNode) { @@ -2508,7 +2496,7 @@ namespace ScriptCanvasEditor } } - GraphCanvas::GraphId Graph::GetGraphCanvasGraphId() const + GraphCanvas::GraphId EditorGraph::GetGraphCanvasGraphId() const { if (m_saveFormatConverted) { @@ -2525,7 +2513,7 @@ namespace ScriptCanvasEditor } } - NodeIdPair Graph::CreateCustomNode(const AZ::Uuid& typeId, const AZ::Vector2& position) + NodeIdPair EditorGraph::CreateCustomNode(const AZ::Uuid& typeId, const AZ::Vector2& position) { CreateCustomNodeMimeEvent mimeEvent(typeId); @@ -2539,7 +2527,7 @@ namespace ScriptCanvasEditor return NodeIdPair(); } - void Graph::AddCrcCache(const AZ::Crc32& crcValue, const AZStd::string& cacheString) + void EditorGraph::AddCrcCache(const AZ::Crc32& crcValue, const AZStd::string& cacheString) { auto mapIter = m_crcCacheMap.find(crcValue); @@ -2553,7 +2541,7 @@ namespace ScriptCanvasEditor } } - void Graph::RemoveCrcCache(const AZ::Crc32& crcValue) + void EditorGraph::RemoveCrcCache(const AZ::Crc32& crcValue) { auto mapIter = m_crcCacheMap.find(crcValue); @@ -2568,7 +2556,7 @@ namespace ScriptCanvasEditor } } - AZStd::string Graph::DecodeCrc(const AZ::Crc32& crcValue) + AZStd::string EditorGraph::DecodeCrc(const AZ::Crc32& crcValue) { auto mapIter = m_crcCacheMap.find(crcValue); @@ -2580,7 +2568,7 @@ namespace ScriptCanvasEditor return ""; } - void Graph::ClearHighlights() + void EditorGraph::ClearHighlights() { for (const GraphCanvas::GraphicsEffectId& effectId : m_highlights) { @@ -2590,7 +2578,7 @@ namespace ScriptCanvasEditor m_highlights.clear(); } - void Graph::HighlightMembersFromTreeItem(const GraphCanvas::GraphCanvasTreeItem* treeItem) + void EditorGraph::HighlightMembersFromTreeItem(const GraphCanvas::GraphCanvasTreeItem* treeItem) { ClearHighlights(); @@ -2608,7 +2596,7 @@ namespace ScriptCanvasEditor } } - void Graph::HighlightVariables(const AZStd::unordered_set< ScriptCanvas::VariableId >& variableIds) + void EditorGraph::HighlightVariables(const AZStd::unordered_set< ScriptCanvas::VariableId >& variableIds) { ClearHighlights(); @@ -2623,7 +2611,7 @@ namespace ScriptCanvasEditor } } - void Graph::HighlightNodes(const AZStd::vector& nodes) + void EditorGraph::HighlightNodes(const AZStd::vector& nodes) { ClearHighlights(); @@ -2633,7 +2621,7 @@ namespace ScriptCanvasEditor } } - void Graph::RemoveUnusedVariables() + void EditorGraph::RemoveUnusedVariables() { RequestPushPreventUndoStateUpdate(); auto variableData = GetVariableData(); @@ -2679,7 +2667,7 @@ namespace ScriptCanvasEditor } } - bool Graph::CanConvertVariableNodeToReference(const GraphCanvas::NodeId& nodeId) + bool EditorGraph::CanConvertVariableNodeToReference(const GraphCanvas::NodeId& nodeId) { AZ::EntityId scriptCanvasNodeId = ConvertToScriptCanvasNodeId(nodeId); @@ -2725,7 +2713,7 @@ namespace ScriptCanvasEditor return false; } - bool Graph::ConvertVariableNodeToReference(const GraphCanvas::NodeId& nodeId) + bool EditorGraph::ConvertVariableNodeToReference(const GraphCanvas::NodeId& nodeId) { AZ::EntityId scriptCanvasNodeId = ConvertToScriptCanvasNodeId(nodeId); @@ -2899,12 +2887,12 @@ namespace ScriptCanvasEditor return true; } - bool Graph::ConvertReferenceToVariableNode([[maybe_unused]] const GraphCanvas::Endpoint& endpoint) + bool EditorGraph::ConvertReferenceToVariableNode([[maybe_unused]] const GraphCanvas::Endpoint& endpoint) { return false; } - bool Graph::OnVersionConversionBegin(ScriptCanvas::Node& scriptCanvasNode) + bool EditorGraph::OnVersionConversionBegin(ScriptCanvas::Node& scriptCanvasNode) { auto insertResult = m_convertingNodes.insert(scriptCanvasNode.GetEntityId()); @@ -2923,7 +2911,7 @@ namespace ScriptCanvasEditor return true; } - void Graph::OnVersionConversionEnd(ScriptCanvas::Node& scriptCanvasNode) + void EditorGraph::OnVersionConversionEnd(ScriptCanvas::Node& scriptCanvasNode) { EditorNodeNotificationBus::Event(scriptCanvasNode.GetEntityId(), &EditorNodeNotifications::OnVersionConversionEnd); @@ -3041,7 +3029,7 @@ namespace ScriptCanvasEditor } } - AZStd::vector Graph::GetNodesOfType(const ScriptCanvas::NodeTypeIdentifier& nodeTypeIdentifier) + AZStd::vector EditorGraph::GetNodesOfType(const ScriptCanvas::NodeTypeIdentifier& nodeTypeIdentifier) { AZStd::vector nodeIdPairs; @@ -3120,7 +3108,7 @@ namespace ScriptCanvasEditor return nodeIdPairs; } - AZStd::vector Graph::GetVariableNodes(const ScriptCanvas::VariableId& variableId) + AZStd::vector EditorGraph::GetVariableNodes(const ScriptCanvas::VariableId& variableId) { AZStd::vector variableNodes; @@ -3143,7 +3131,7 @@ namespace ScriptCanvasEditor return variableNodes; } - void Graph::QueueVersionUpdate(const AZ::EntityId& graphCanvasNodeId) + void EditorGraph::QueueVersionUpdate(const AZ::EntityId& graphCanvasNodeId) { bool queueUpdate = m_queuedConvertingNodes.empty(); auto insertResult = m_queuedConvertingNodes.insert(graphCanvasNodeId); @@ -3155,7 +3143,7 @@ namespace ScriptCanvasEditor } } - bool Graph::CanExposeEndpoint(const GraphCanvas::Endpoint& endpoint) + bool EditorGraph::CanExposeEndpoint(const GraphCanvas::Endpoint& endpoint) { bool isEnabled = false; @@ -3213,7 +3201,7 @@ namespace ScriptCanvasEditor return isEnabled && !isNodeling; } - ScriptCanvas::Endpoint Graph::ConvertToScriptCanvasEndpoint(const GraphCanvas::Endpoint& endpoint) const + ScriptCanvas::Endpoint EditorGraph::ConvertToScriptCanvasEndpoint(const GraphCanvas::Endpoint& endpoint) const { AZStd::any* userData = nullptr; @@ -3230,7 +3218,7 @@ namespace ScriptCanvasEditor return scriptCanvasEndpoint; } - GraphCanvas::Endpoint Graph::ConvertToGraphCanvasEndpoint(const ScriptCanvas::Endpoint& endpoint) const + GraphCanvas::Endpoint EditorGraph::ConvertToGraphCanvasEndpoint(const ScriptCanvas::Endpoint& endpoint) const { GraphCanvas::Endpoint graphCanvasEndpoint; @@ -3240,7 +3228,7 @@ namespace ScriptCanvasEditor return graphCanvasEndpoint; } - void Graph::OnSaveDataDirtied(const AZ::EntityId& savedElement) + void EditorGraph::OnSaveDataDirtied(const AZ::EntityId& savedElement) { // The EbusHandlerEvent's are a visual only representation of alternative data, and should not be saved. if (EBusHandlerEventNodeDescriptorRequestBus::FindFirstHandler(savedElement) != nullptr @@ -3292,12 +3280,12 @@ namespace ScriptCanvasEditor } } - bool Graph::NeedsSaveConversion() const + bool EditorGraph::NeedsSaveConversion() const { return !m_saveFormatConverted; } - void Graph::ConvertSaveFormat() + void EditorGraph::ConvertSaveFormat() { if (!m_saveFormatConverted) { @@ -3326,7 +3314,7 @@ namespace ScriptCanvasEditor } } - void Graph::ConstructSaveData() + void EditorGraph::ConstructSaveData() { // Save out the SceneData // @@ -3345,7 +3333,7 @@ namespace ScriptCanvasEditor } } - void Graph::OnToastInteraction() + void EditorGraph::OnToastInteraction() { const AzToolsFramework::ToastId* toastId = AzToolsFramework::ToastNotificationBus::GetCurrentBusId(); @@ -3370,7 +3358,7 @@ namespace ScriptCanvasEditor } } - void Graph::OnToastDismissed() + void EditorGraph::OnToastDismissed() { const AzToolsFramework::ToastId* toastId = AzToolsFramework::ToastNotificationBus::GetCurrentBusId(); @@ -3380,7 +3368,7 @@ namespace ScriptCanvasEditor } } - void Graph::OnUndoRedoEnd() + void EditorGraph::OnUndoRedoEnd() { for (const auto& nodePair : GetNodeMapping()) { @@ -3388,7 +3376,7 @@ namespace ScriptCanvasEditor } } - void Graph::ReportError(const ScriptCanvas::Node& node, const AZStd::string& errorSource, const AZStd::string& errorMessage) + void EditorGraph::ReportError(const ScriptCanvas::Node& node, const AZStd::string& errorSource, const AZStd::string& errorMessage) { AzQtComponents::ToastConfiguration toastConfiguration(AzQtComponents::ToastType::Error, errorSource.c_str(), errorMessage.c_str()); @@ -3402,13 +3390,13 @@ namespace ScriptCanvasEditor m_toastNodeIds[toastId] = node.GetEntityId(); } - void Graph::UnregisterToast(const AzToolsFramework::ToastId& toastId) + void EditorGraph::UnregisterToast(const AzToolsFramework::ToastId& toastId) { AzToolsFramework::ToastNotificationBus::MultiHandler::BusDisconnect(toastId); m_toastNodeIds.erase(toastId); } - void Graph::DisplayUpdateToast() + void EditorGraph::DisplayUpdateToast() { GraphCanvas::ViewId viewId; GraphCanvas::SceneRequestBus::EventResult(viewId, GetGraphCanvasGraphId(), &GraphCanvas::SceneRequests::GetViewId); @@ -3442,12 +3430,12 @@ namespace ScriptCanvasEditor } } - const GraphStatisticsHelper& Graph::GetNodeUsageStatistics() const + const GraphStatisticsHelper& EditorGraph::GetNodeUsageStatistics() const { return m_statisticsHelper; } - void Graph::CreateGraphCanvasScene() + void EditorGraph::CreateGraphCanvasScene() { if (!m_saveFormatConverted) { @@ -3492,7 +3480,7 @@ namespace ScriptCanvasEditor m_focusHelper.SetActiveGraph(GetGraphCanvasGraphId()); } - bool Graph::UpgradeGraph(SourceHandle& asset, UpgradeRequest request, bool isVerbose) + bool EditorGraph::UpgradeGraph(SourceHandle& asset, UpgradeRequest request, bool isVerbose) { m_upgradeSM.SetAsset(asset); m_upgradeSM.SetVerbose(isVerbose); @@ -3509,7 +3497,7 @@ namespace ScriptCanvasEditor } } - void Graph::ConnectGraphCanvasBuses() + void EditorGraph::ConnectGraphCanvasBuses() { GraphCanvas::GraphId graphCanvasGraphId = GetGraphCanvasGraphId(); @@ -3517,14 +3505,14 @@ namespace ScriptCanvasEditor GraphCanvas::SceneNotificationBus::Handler::BusConnect(graphCanvasGraphId); } - void Graph::DisconnectGraphCanvasBuses() + void EditorGraph::DisconnectGraphCanvasBuses() { GraphCanvas::GraphModelRequestBus::Handler::BusDisconnect(); GraphCanvas::SceneNotificationBus::Handler::BusDisconnect(); } - void Graph::OnSystemTick() + void EditorGraph::OnSystemTick() { if (!m_allowVersionUpdate) { @@ -3539,7 +3527,7 @@ namespace ScriptCanvasEditor } } - void Graph::DisplayGraphCanvasScene() + void EditorGraph::DisplayGraphCanvasScene() { m_variableDataModel.Activate(GetScriptCanvasId()); @@ -3839,17 +3827,17 @@ namespace ScriptCanvasEditor MarkVersion(); } - void Graph::OnGraphCanvasSceneVisible() + void EditorGraph::OnGraphCanvasSceneVisible() { DisplayUpdateToast(); } - AZStd::unordered_map< AZ::EntityId, GraphCanvas::EntitySaveDataContainer* > Graph::GetGraphCanvasSaveData() + AZStd::unordered_map< AZ::EntityId, GraphCanvas::EntitySaveDataContainer* > EditorGraph::GetGraphCanvasSaveData() { return m_graphCanvasSaveData; } - void Graph::UpdateGraphCanvasSaveData(const AZStd::unordered_map< AZ::EntityId, GraphCanvas::EntitySaveDataContainer* >& saveData) + void EditorGraph::UpdateGraphCanvasSaveData(const AZStd::unordered_map< AZ::EntityId, GraphCanvas::EntitySaveDataContainer* >& saveData) { QScopedValueRollback ignoreRequests(m_ignoreSaveRequests, true); @@ -3868,7 +3856,7 @@ namespace ScriptCanvasEditor DisplayGraphCanvasScene(); } - void Graph::ClearGraphCanvasScene() + void EditorGraph::ClearGraphCanvasScene() { GraphCanvas::GraphId graphCanvasGraphId = GetGraphCanvasGraphId(); diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp index 2cd2dda89e..4e512a3678 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp @@ -171,7 +171,7 @@ namespace ScriptCanvasEditor } } - void GraphStatisticsHelper::PopulateStatisticData(const Graph* editorGraph) + void GraphStatisticsHelper::PopulateStatisticData(const EditorGraph* editorGraph) { // Opportunistically use this time to refresh out node count array. m_nodeIdentifierCount.clear(); diff --git a/Gems/ScriptCanvas/Code/Editor/Components/GraphUpgrade.cpp b/Gems/ScriptCanvas/Code/Editor/Components/GraphUpgrade.cpp index fec813b0c1..d23c371096 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/GraphUpgrade.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/GraphUpgrade.cpp @@ -25,7 +25,7 @@ namespace ScriptCanvasEditor namespace Helpers { - static AZStd::string ConnectionToText(ScriptCanvasEditor::Graph* graph, ScriptCanvas::Endpoint& from, ScriptCanvas::Endpoint& to) + static AZStd::string ConnectionToText(ScriptCanvasEditor::EditorGraph* graph, ScriptCanvas::Endpoint& from, ScriptCanvas::Endpoint& to) { AZ_Assert(graph, "A valid graph must be provided"); @@ -653,7 +653,7 @@ namespace ScriptCanvasEditor #define RegisterState(stateName) m_states.emplace_back(new stateName(this)); - EditorGraphUpgradeMachine::EditorGraphUpgradeMachine(Graph* graph) + EditorGraphUpgradeMachine::EditorGraphUpgradeMachine(EditorGraph* graph) : m_graph(graph) { RegisterState(Start); diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h index 9157aaeac9..aff47222e1 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h @@ -45,7 +45,7 @@ namespace ScriptCanvas namespace ScriptCanvasEditor { //! EditorGraph is the editor version of the ScriptCanvas::Graph component that is activated when executing the script canvas engine - class Graph + class EditorGraph : public ScriptCanvas::Graph , private NodeCreationNotificationBus::Handler , private SceneCounterRequestBus::Handler @@ -77,7 +77,7 @@ namespace ScriptCanvasEditor typedef AZStd::unordered_map< AZ::EntityId, AZ::EntityId > WrappedNodeGroupingMap; - static void ConvertToGetVariableNode(Graph* graph, ScriptCanvas::VariableId variableId, const AZ::EntityId& nodeId, AZStd::unordered_map& setVariableRemapping); + static void ConvertToGetVariableNode(EditorGraph* graph, ScriptCanvas::VariableId variableId, const AZ::EntityId& nodeId, AZStd::unordered_map& setVariableRemapping); struct CRCCache { @@ -100,13 +100,13 @@ namespace ScriptCanvasEditor }; public: - AZ_COMPONENT(Graph, "{4D755CA9-AB92-462C-B24F-0B3376F19967}", ScriptCanvas::Graph); + AZ_COMPONENT(EditorGraph, "{4D755CA9-AB92-462C-B24F-0B3376F19967}", ScriptCanvas::Graph); static ScriptCanvas::DataPtr Create(); static void Reflect(AZ::ReflectContext* context); - Graph(const ScriptCanvas::ScriptCanvasId& scriptCanvasId = AZ::Entity::MakeId()) + EditorGraph(const ScriptCanvas::ScriptCanvasId& scriptCanvasId = AZ::Entity::MakeId()) : ScriptCanvas::Graph(scriptCanvasId) , m_variableCounter(0) , m_graphCanvasSceneEntity(nullptr) @@ -115,11 +115,21 @@ namespace ScriptCanvasEditor , m_upgradeSM(this) {} - ~Graph() override; + ~EditorGraph() override; void Activate() override; void Deactivate() override; + static const char* GetMimeType() + { + return "application/x-o3de-scriptcanvas"; + } + + static const char* GetWrappedNodeGroupingMimeType() + { + return "application/x-03de-scriptcanvas-wrappednodegrouping"; + } + static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided) { ScriptCanvas::Graph::GetProvidedServices(provided); @@ -326,7 +336,7 @@ namespace ScriptCanvasEditor void UnregisterToast(const AzToolsFramework::ToastId& toastId); - Graph(const Graph&) = delete; + EditorGraph(const EditorGraph&) = delete; void DisplayUpdateToast(); diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorUtils.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorUtils.h index a4522198b7..d99da61d8d 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorUtils.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorUtils.h @@ -28,7 +28,7 @@ namespace ScriptCanvasEditor // if CompleteDescription() succeeds, sets the handle to the result, else does nothing bool CompleteDescriptionInPlace(SourceHandle& source); - class Graph; + class EditorGraph; class NodePaletteModel; class NodeIdentifierFactory @@ -48,7 +48,7 @@ namespace ScriptCanvasEditor virtual ~GraphStatisticsHelper() = default; - void PopulateStatisticData(const Graph* editorGraph); + void PopulateStatisticData(const EditorGraph* editorGraph); AZStd::unordered_map< ScriptCanvas::NodeTypeIdentifier, int > m_nodeIdentifierCount; diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/GraphUpgrade.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/GraphUpgrade.h index 9fedc2d1f3..78b59e48d1 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/GraphUpgrade.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/GraphUpgrade.h @@ -20,7 +20,7 @@ namespace ScriptCanvas namespace ScriptCanvasEditor { - class Graph; + class EditorGraph; class StateMachine; //! StateTraits provides each state the ability to provide its own compile time ID @@ -158,7 +158,7 @@ namespace ScriptCanvasEditor public: AZ_RTTI(EditorGraphUpgradeMachine, "{C7EABC22-A3DD-4ABE-8303-418EA3CD1246}", StateMachine); - EditorGraphUpgradeMachine(Graph* graph); + EditorGraphUpgradeMachine(EditorGraph* graph); AZStd::unordered_set m_allNodes; AZStd::unordered_set m_outOfDateNodes; @@ -180,7 +180,7 @@ namespace ScriptCanvasEditor bool m_graphNeedsDirtying = false; - Graph* m_graph = nullptr; + EditorGraph* m_graph = nullptr; SourceHandle m_asset; void SetAsset(SourceHandle& assetasset); diff --git a/Gems/ScriptCanvas/Code/Editor/ScriptCanvasEditorGem.cpp b/Gems/ScriptCanvas/Code/Editor/ScriptCanvasEditorGem.cpp index 7c204e8790..1a3bb0e4f9 100644 --- a/Gems/ScriptCanvas/Code/Editor/ScriptCanvasEditorGem.cpp +++ b/Gems/ScriptCanvas/Code/Editor/ScriptCanvasEditorGem.cpp @@ -81,7 +81,7 @@ namespace ScriptCanvas ScriptCanvasEditor::EditorAssetSystemComponent::CreateDescriptor(), ScriptCanvasEditor::EditorScriptCanvasComponent::CreateDescriptor(), ScriptCanvasEditor::EntityMimeDataHandler::CreateDescriptor(), - ScriptCanvasEditor::Graph::CreateDescriptor(), + ScriptCanvasEditor::EditorGraph::CreateDescriptor(), ScriptCanvasEditor::IconComponent::CreateDescriptor(), ScriptCanvasEditor::ReflectComponent::CreateDescriptor(), ScriptCanvasEditor::SystemComponent::CreateDescriptor(), diff --git a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp index 9bbdddfedb..a79cf2d6cf 100644 --- a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp @@ -183,7 +183,7 @@ namespace ScriptCanvasEditor { if (entity) { - auto graph = entity->CreateComponent(); + auto graph = entity->CreateComponent(); entity->CreateComponent(graph->GetScriptCanvasId()); } } diff --git a/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.cpp b/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.cpp index f497b83b08..eb42daa3d8 100644 --- a/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.cpp @@ -35,7 +35,7 @@ namespace ScriptCanvasEditor { } - void GraphItemCommand::Capture(Graph*, bool) + void GraphItemCommand::Capture(EditorGraph*, bool) { } @@ -104,7 +104,7 @@ namespace ScriptCanvasEditor RestoreItem(m_redoState); } - void GraphItemChangeCommand::Capture(Graph* graph, bool captureUndo) + void GraphItemChangeCommand::Capture(EditorGraph* graph, bool captureUndo) { m_scriptCanvasId = graph->GetScriptCanvasId(); m_graphCanvasGraphId = graph->GetGraphCanvasGraphId(); @@ -203,7 +203,7 @@ namespace ScriptCanvasEditor RestoreItem(m_redoState); } - void GraphItemAddCommand::Capture(Graph* graph, bool) + void GraphItemAddCommand::Capture(EditorGraph* graph, bool) { GraphItemChangeCommand::Capture(graph, false); } @@ -224,7 +224,7 @@ namespace ScriptCanvasEditor RestoreItem(m_redoState); } - void GraphItemRemovalCommand::Capture(Graph* graph, bool) + void GraphItemRemovalCommand::Capture(EditorGraph* graph, bool) { GraphItemChangeCommand::Capture(graph, true); } diff --git a/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.h b/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.h index 9b36a7beb0..38eb1099ac 100644 --- a/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.h +++ b/Gems/ScriptCanvas/Code/Editor/Undo/ScriptCanvasGraphCommand.h @@ -44,7 +44,7 @@ namespace ScriptCanvasEditor void Undo() override; void Redo() override; - virtual void Capture(Graph* graph, bool captureUndo); + virtual void Capture(EditorGraph* graph, bool captureUndo); bool Changed() const override; @@ -74,7 +74,7 @@ namespace ScriptCanvasEditor void Undo() override; void Redo() override; - void Capture(Graph* graph, bool captureUndo) override; + void Capture(EditorGraph* graph, bool captureUndo) override; void RestoreItem(const AZStd::vector& restoreBuffer) override; @@ -101,7 +101,7 @@ namespace ScriptCanvasEditor void Undo() override; void Redo() override; - void Capture(Graph* graph, bool captureUndo) override; + void Capture(EditorGraph* graph, bool captureUndo) override; protected: GraphItemAddCommand(const GraphItemAddCommand&) = delete; @@ -122,7 +122,7 @@ namespace ScriptCanvasEditor void Undo() override; void Redo() override; - void Capture(Graph* graph, bool captureUndo) override; + void Capture(EditorGraph* graph, bool captureUndo) override; protected: GraphItemRemovalCommand(const GraphItemRemovalCommand&) = delete; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index f0bee2171a..f51467971d 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -1541,7 +1541,7 @@ namespace ScriptCanvasEditor { int outTabIndex = -1; - ScriptCanvas::DataPtr graph = Graph::Create(); + ScriptCanvas::DataPtr graph = EditorGraph::Create(); AZ::Uuid assetId = AZ::Uuid::CreateRandom(); ScriptCanvasEditor::SourceHandle handle = ScriptCanvasEditor::SourceHandle(graph, assetId, assetPath); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp index 39cd6f565e..7646ef9dcd 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/Controller.cpp @@ -154,7 +154,7 @@ namespace ScriptCanvasEditor { asset.Mod()->UpgradeGraph ( asset - , m_view->forceUpgrade->isChecked() ? Graph::UpgradeRequest::Forced : Graph::UpgradeRequest::IfOutOfDate + , m_view->forceUpgrade->isChecked() ? EditorGraph::UpgradeRequest::Forced : EditorGraph::UpgradeRequest::IfOutOfDate , m_view->verbose->isChecked()); } }; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp index 1e00e70075..7f659952e8 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.cpp @@ -328,9 +328,9 @@ namespace ScriptCanvas return AZ::EntityUtils::FindFirstDerivedComponent(m_scriptCanvasEntity.get()); } - const ScriptCanvasEditor::Graph* ScriptCanvasData::GetEditorGraph() const + const ScriptCanvasEditor::EditorGraph* ScriptCanvasData::GetEditorGraph() const { - return reinterpret_cast(GetGraph()); + return reinterpret_cast(GetGraph()); } Graph* ScriptCanvasData::ModGraph() @@ -338,8 +338,8 @@ namespace ScriptCanvas return AZ::EntityUtils::FindFirstDerivedComponent(m_scriptCanvasEntity.get()); } - ScriptCanvasEditor::Graph* ScriptCanvasData::ModEditorGraph() + ScriptCanvasEditor::EditorGraph* ScriptCanvasData::ModEditorGraph() { - return reinterpret_cast(ModGraph()); + return reinterpret_cast(ModGraph()); } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h index c29a648eca..5de5c7adb8 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Core.h @@ -316,10 +316,10 @@ namespace ScriptCanvas namespace ScriptCanvasEditor { - class Graph; + class EditorGraph; - using GraphPtr = Graph*; - using GraphPtrConst = const Graph*; + using GraphPtr = EditorGraph*; + using GraphPtrConst = const EditorGraph*; class SourceDescription { @@ -411,11 +411,11 @@ namespace ScriptCanvas const Graph* GetGraph() const; - const ScriptCanvasEditor::Graph* GetEditorGraph() const; + const ScriptCanvasEditor::EditorGraph* GetEditorGraph() const; Graph* ModGraph(); - ScriptCanvasEditor::Graph* ModEditorGraph(); + ScriptCanvasEditor::EditorGraph* ModEditorGraph(); AZStd::unique_ptr m_scriptCanvasEntity; private: From 0b78c377f8baa7941aad3094b513d069690168a4 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Mon, 27 Dec 2021 09:39:04 -0800 Subject: [PATCH 254/948] Minor: py method comment added Signed-off-by: Gene Walters --- .../EditorPythonTestTools/editor_python_test_tools/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/utils.py index 2ba692d89b..1674fba7be 100644 --- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/utils.py +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/utils.py @@ -138,7 +138,7 @@ class TestHelper: :param window: The log's window name. For example, logs printed via script-canvas use the "Script" window. :param unexpected_line: The log message we're hoping to not find. :param print_infos: A list of PrintInfos collected by Tracer to search. Example options: your_tracer.warnings, your_tracer.errors, your_tracer.asserts, or your_tracer.prints - :param time_out: The total amount of time to wait before giving up looking for the unexpected line. + :param time_out: The total amount of time to wait before giving up looking for the unexpected line. If time runs out and we don't see the unexpected line then report a success. :return: No return value, but if the unexpected message is found, a failed critical result is reported; otherwise success. """ From 451ebf2691a736d53331c35ed876984db8b1cf41 Mon Sep 17 00:00:00 2001 From: nggieber <52797929+AMZN-nggieber@users.noreply.github.com> Date: Mon, 27 Dec 2021 12:32:24 -0800 Subject: [PATCH 255/948] Reflow Project Tiles Everytime They Are Updated Signed-off-by: nggieber <52797929+AMZN-nggieber@users.noreply.github.com> --- Code/Tools/ProjectManager/Source/ProjectsScreen.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp b/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp index 7e5675918d..15a6f22d85 100644 --- a/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp +++ b/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp @@ -284,13 +284,14 @@ namespace O3DE::ProjectManager { currentButton = projectButtonIter.value(); currentButton->RestoreDefaultState(); - m_projectsFlowLayout->addWidget(currentButton); } } // Check whether project manager has successfully built the project if (currentButton) { + m_projectsFlowLayout->addWidget(currentButton); + bool projectBuiltSuccessfully = false; SettingsInterface::Get()->GetProjectBuiltSuccessfully(projectBuiltSuccessfully, project); @@ -341,6 +342,7 @@ namespace O3DE::ProjectManager } m_stack->setCurrentWidget(m_projectsContent); + m_projectsFlowLayout->update(); } ProjectManagerScreen ProjectsScreen::GetScreenEnum() @@ -399,7 +401,6 @@ namespace O3DE::ProjectManager { if (ProjectUtils::AddProjectDialog(this)) { - ResetProjectsContent(); emit ChangeScreenRequest(ProjectManagerScreen::Projects); } } @@ -490,7 +491,6 @@ namespace O3DE::ProjectManager // Open file dialog and choose location for copied project then register copy with O3DE if (ProjectUtils::CopyProjectDialog(projectInfo.m_path, newProjectInfo, this)) { - ResetProjectsContent(); emit NotifyBuildProject(newProjectInfo); emit ChangeScreenRequest(ProjectManagerScreen::Projects); } @@ -503,7 +503,6 @@ namespace O3DE::ProjectManager // Unregister Project from O3DE and reload projects if (ProjectUtils::UnregisterProject(projectPath)) { - ResetProjectsContent(); emit ChangeScreenRequest(ProjectManagerScreen::Projects); } } From 81b2841bd2b75137b6e7b7ce6618d3a4c3245e3e Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Tue, 28 Dec 2021 09:16:48 -0800 Subject: [PATCH 256/948] chore: correct text for assertion Signed-off-by: Michael Pollind --- Code/Framework/AzCore/AzCore/Math/Plane.inl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Math/Plane.inl b/Code/Framework/AzCore/AzCore/Math/Plane.inl index bade6f1775..795ee8b4bc 100644 --- a/Code/Framework/AzCore/AzCore/Math/Plane.inl +++ b/Code/Framework/AzCore/AzCore/Math/Plane.inl @@ -19,14 +19,14 @@ namespace AZ AZ_MATH_INLINE Plane Plane::CreateFromNormalAndPoint(const Vector3& normal, const Vector3& point) { - AZ_MATH_ASSERT(normal.IsNormalized(), "This normal is not a normalized"); + AZ_MATH_ASSERT(normal.IsNormalized(), "This normal is not normalized"); return Plane(Simd::Vec4::ConstructPlane(normal.GetSimdValue(), point.GetSimdValue())); } AZ_MATH_INLINE Plane Plane::CreateFromNormalAndDistance(const Vector3& normal, float dist) { - AZ_MATH_ASSERT(normal.IsNormalized(), "This normal is not a normalized"); + AZ_MATH_ASSERT(normal.IsNormalized(), "This normal is not normalized"); Plane result; result.Set(normal, dist); return result; @@ -35,7 +35,7 @@ namespace AZ AZ_MATH_INLINE Plane Plane::CreateFromCoefficients(const float a, const float b, const float c, const float d) { - AZ_MATH_ASSERT(Vector3(a, b, c).IsNormalized(), "This normal is not normalized"); + AZ_MATH_ASSERT(Vector3(a, b, c).IsNormalized(), "This normal is notormalized"); Plane result; result.Set(a, b, c, d); return result; @@ -68,21 +68,21 @@ namespace AZ AZ_MATH_INLINE void Plane::Set(const Vector3& normal, float d) { - AZ_MATH_ASSERT(normal.IsNormalized(), "This normal is not normalized"); + AZ_MATH_ASSERT(normal.IsNormalized(), "This normal is notormalized"); m_plane.Set(normal, d); } AZ_MATH_INLINE void Plane::Set(float a, float b, float c, float d) { - AZ_MATH_ASSERT(Vector3(a, b, c).IsNormalized(), "This normal is not normalized"); + AZ_MATH_ASSERT(Vector3(a, b, c).IsNormalized(), "This normal is notormalized"); m_plane.Set(a, b, c, d); } AZ_MATH_INLINE void Plane::SetNormal(const Vector3& normal) { - AZ_MATH_ASSERT(normal.IsNormalized(), "This normal is not normalized"); + AZ_MATH_ASSERT(normal.IsNormalized(), "This normal is notormalized"); m_plane.SetX(normal.GetX()); m_plane.SetY(normal.GetY()); m_plane.SetZ(normal.GetZ()); From 49dd17f410a5ffefb55c1484e8a1bec9b257362e Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Wed, 29 Dec 2021 11:25:17 -0600 Subject: [PATCH 257/948] Optimized Terrain Debugger Wireframe rendering (#6572) * Optimized wireframe drawing. As a part of rearranging the code to make use of the upcoming ProcessHeightsFromRegion, the number of calls to GetHeight could be reduced, dropping the refresh time in my test case from 2550 ms to 1068 ms. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Change refresh to only happen on wireframe draws. This helps ensure that multiple data changes in a single frame don't cause multiple refreshes, and prevents us from taking a refresh penalty when the wireframe isn't being drawn at all. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Change debugger to update wireframes incrementally. This works by having a fixed NxN grid of sectors. The camera is always considered as being in the center of the grid, so anytime the camera's grid square changes, only a subset of sectors are updated to have the new wireframe data. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Bugfix - sector vertex count was 4x too high. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Bugfixes & comments. Fixed initial "mark dirty" refresh - the dirty region Z value needed to be ignored. Added copious comments for the math & logic, and simplified some of the math. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Small update to comment for better readability. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Addressed PR feedback. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- .../TerrainWorldDebuggerComponent.cpp | 364 +++++++++++------- .../TerrainWorldDebuggerComponent.h | 25 +- 2 files changed, 243 insertions(+), 146 deletions(-) diff --git a/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.cpp b/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.cpp index 79fd5509f2..8daccd7d61 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.cpp +++ b/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.cpp @@ -90,13 +90,28 @@ namespace Terrain void TerrainWorldDebuggerComponent::Activate() { - m_wireframeBounds = AZ::Aabb::CreateNull(); + // Given the AuxGeom vertex limits, MaxSectorsToDraw is the max number of wireframe sectors we can draw without exceeding the + // limits. Since we want an N x N sector grid, take the square root to get the number of sectors in each direction. + m_sectorGridSize = aznumeric_cast(sqrtf(MaxSectorsToDraw)); + + // We're always going to keep the camera in the center square, so "round" downwards to an odd number of sectors if we currently + // have an even number. (If we added a sector, we'll go above the max sectors that we can draw with our vertex limits) + m_sectorGridSize = (m_sectorGridSize & 0x01) ? m_sectorGridSize : m_sectorGridSize - 1; + + // Create our fixed set of sectors that we'll draw. By default, they'll all be constructed as dirty, so they'll get refreshed + // the first time we try to draw them. (If wireframe drawing is disabled, we'll never refresh them) + m_wireframeSectors.clear(); + m_wireframeSectors.resize(m_sectorGridSize * m_sectorGridSize); AzFramework::EntityDebugDisplayEventBus::Handler::BusConnect(GetEntityId()); AzFramework::BoundsRequestBus::Handler::BusConnect(GetEntityId()); AzFramework::Terrain::TerrainDataNotificationBus::Handler::BusConnect(); - RefreshCachedWireframeGrid(AZ::Aabb::CreateNull()); + // Any time the world bounds potentially changes, notify that the terrain debugger's visibility bounds also changed. + // Otherwise, DisplayEntityViewport() won't get called at the appropriate times, since the visibility could get incorrectly + // culled out. + AzFramework::IEntityBoundsUnionRequestBus::Broadcast( + &AzFramework::IEntityBoundsUnionRequestBus::Events::RefreshEntityLocalBoundsUnion, GetEntityId()); } void TerrainWorldDebuggerComponent::Deactivate() @@ -105,7 +120,6 @@ namespace Terrain AzFramework::BoundsRequestBus::Handler::BusDisconnect(); AzFramework::EntityDebugDisplayEventBus::Handler::BusDisconnect(); - m_wireframeBounds = AZ::Aabb::CreateNull(); m_wireframeSectors.clear(); } @@ -144,170 +158,239 @@ namespace Terrain return GetWorldBounds(); } - void TerrainWorldDebuggerComponent::DisplayEntityViewport( - const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay) + void TerrainWorldDebuggerComponent::MarkDirtySectors(const AZ::Aabb& dirtyRegion) { - // Draw a wireframe box around the entire terrain world bounds - if (m_configuration.m_drawWorldBounds) + // Create a 2D version of dirtyRegion that has Z set to min/max float values, so that we can just check for XY overlap with + // each sector. + const AZ::Aabb dirtyRegion2D = AZ::Aabb::CreateFromMinMaxValues( + dirtyRegion.GetMin().GetX(), dirtyRegion.GetMin().GetY(), AZStd::numeric_limits::lowest(), + dirtyRegion.GetMax().GetX(), dirtyRegion.GetMax().GetY(), AZStd::numeric_limits::max()); + + // For each sector that overlaps the dirty region (or all of them if the region is invalid), mark them as dirty so that + // they'll get refreshed the next time we need to draw them. + for (auto& sector : m_wireframeSectors) { - AZ::Color outlineColor(1.0f, 0.0f, 0.0f, 1.0f); - AZ::Aabb aabb = GetWorldBounds(); + if (!dirtyRegion2D.IsValid() || dirtyRegion2D.Overlaps(sector.m_aabb)) + { + sector.m_isDirty = true; + } + } + } - debugDisplay.SetColor(outlineColor); - debugDisplay.DrawWireBox(aabb.GetMin(), aabb.GetMax()); + void TerrainWorldDebuggerComponent::DrawWorldBounds(AzFramework::DebugDisplayRequests& debugDisplay) + { + if (!m_configuration.m_drawWorldBounds) + { + return; } - // Draw a wireframe representation of the terrain surface - if (m_configuration.m_drawWireframe && !m_wireframeSectors.empty()) + // Draw a wireframe box around the entire terrain world bounds + AZ::Color outlineColor(1.0f, 0.0f, 0.0f, 1.0f); + AZ::Aabb aabb = GetWorldBounds(); + + debugDisplay.SetColor(outlineColor); + debugDisplay.DrawWireBox(aabb.GetMin(), aabb.GetMax()); + } + + void TerrainWorldDebuggerComponent::DrawWireframe( + const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay) + { + AZ_PROFILE_FUNCTION(Entity); + + if (!m_configuration.m_drawWireframe) { - // Start by assuming we'll draw the entire world. - AZ::Aabb drawingAabb = GetWorldBounds(); + return; + } - // Assuming we can get the camera, reduce the drawing bounds to a fixed distance around the camera. - if (auto viewportContextRequests = AZ::RPI::ViewportContextRequests::Get(); viewportContextRequests) - { - // Get the current camera position. - AZ::RPI::ViewportContextPtr viewportContext = viewportContextRequests->GetViewportContextById(viewportInfo.m_viewportId); - AZ::Vector3 cameraPos = viewportContext->GetCameraTransform().GetTranslation(); + /* This draws a wireframe centered on the camera that extends out to a certain distance at all times. To reduce the amount of + * recalculations we need to do on each camera movement, we divide the world into a conceptual grid of sectors, where each sector + * contains a fixed number of terrain height points. So for example, if the terrain has height data at 1 m spacing, the sectors + * might be 10 m x 10 m in size. If the height data is spaced at 0.5 m, the sectors might be 5 m x 5 m in size. The wireframe + * draws N x N sectors centered around the camera, as determined by m_sectorGridSize. So a gridSize of 7 with a sector size of + * 10 m means that we'll be drawing 7 x 7 sectors, or 70 m x 70 m, centered around the camera. Each time the camera moves into + * a new sector, we refresh the changed sectors before drawing them. + * + * The only tricky bit to this design is the way the sectors are stored and indexed. They're stored in a single vector as NxN + * entries, so they would normally be indexed as (y * N) + x. Since we want this to be centered on the camera, the easy answer + * would be to take the camera position - (N / 2) (since we're centering) as the relative offset to the first entry. But this + * would mean that the entire set of entries would change every time we move the camera. For example, if we had 5 entries, + * they might map to 0-4, 1-5, 2-6, 3-7, etc as the camera moves. + * + * Instead, we use mod (%) to rotate our indices around, so it would go (0 1 2 3 4), (5 1 2 3 4), (5 6 2 3 4), (5 6 7 3 4), etc + * as the camera moves. For negative entries, we rotate the indices in reverse, so that we get results like (0 1 2 3 4), + * (0 1 2 3 -1), (0 1 2 -2 -1), (0 1 -3 -2 -1), etc. This way we always have the correct range of sectors, and sectors that have + * remained visible are left alone and don't need to be updated again. + */ + + // Get the terrain world bounds + AZ::Aabb worldBounds = GetWorldBounds(); + float worldMinZ = worldBounds.GetMin().GetZ(); - // Determine how far to draw in each direction in world space based on our MaxSectorsToDraw - AZ::Vector2 queryResolution = AZ::Vector2(1.0f); - AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( - queryResolution, &AzFramework::Terrain::TerrainDataRequests::GetTerrainHeightQueryResolution); - AZ::Vector3 viewDistance( - queryResolution.GetX() * SectorSizeInGridPoints * sqrtf(MaxSectorsToDraw), - queryResolution.GetY() * SectorSizeInGridPoints * sqrtf(MaxSectorsToDraw), - 0.0f); - - // Create an AABB around the camera based on how far we want to be able to draw in each direction and clamp the - // drawing AABB to it. - AZ::Aabb cameraAabb = AZ::Aabb::CreateFromMinMax( - AZ::Vector3( - cameraPos.GetX() - viewDistance.GetX(), cameraPos.GetY() - viewDistance.GetY(), drawingAabb.GetMin().GetZ()), - AZ::Vector3( - cameraPos.GetX() + viewDistance.GetX(), cameraPos.GetY() + viewDistance.GetY(), drawingAabb.GetMin().GetZ())); - drawingAabb.Clamp(cameraAabb); - } + // Get the terrain height data resolution + AZ::Vector2 heightDataResolution = AZ::Vector2(1.0f); + AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( + heightDataResolution, &AzFramework::Terrain::TerrainDataRequests::GetTerrainHeightQueryResolution); + + // Get the size of a wireframe sector in world space + const AZ::Vector2 sectorSize = heightDataResolution * SectorSizeInGridPoints; - // For each sector, if it appears within our view distance, draw it. - for (auto& sector : m_wireframeSectors) + // Try to get the current camera position, or default to (0,0) if we can't. + AZ::Vector3 cameraPos = AZ::Vector3::CreateZero(); + if (auto viewportContextRequests = AZ::RPI::ViewportContextRequests::Get(); viewportContextRequests) + { + AZ::RPI::ViewportContextPtr viewportContext = viewportContextRequests->GetViewportContextById(viewportInfo.m_viewportId); + cameraPos = viewportContext->GetCameraTransform().GetTranslation(); + } + + // Convert our camera position to a wireframe grid sector. We first convert from world space to sector space by dividing by + // sectorSize, so that integer values are sectors, and fractional values are the distance within the sector. Then we get the + // floor, so that we consistently get the next lowest integer - i.e. 2.3 -> 2, and -2.3 -> -3. This gives us consistent behavior + // across both positive and negative positions. + AZ::Vector2 gridPosition = AZ::Vector2(cameraPos.GetX(), cameraPos.GetY()) / sectorSize; + int32_t cameraSectorX = aznumeric_cast(gridPosition.GetFloor().GetX()); + int32_t cameraSectorY = aznumeric_cast(gridPosition.GetFloor().GetY()); + + // Loop through each sector that we *want* to draw, based on camera position. If the current sector at that index in + // m_wireframeSectors doesn't match the world position we want, update its world position and mark it as dirty. + // (We loop from -gridSize/2 to gridSize/2 so that the camera is always in the center sector.) + for (int32_t sectorY = cameraSectorY - (m_sectorGridSize / 2); sectorY <= cameraSectorY + (m_sectorGridSize / 2); sectorY++) + { + for (int32_t sectorX = cameraSectorX - (m_sectorGridSize / 2); sectorX <= cameraSectorX + (m_sectorGridSize / 2); sectorX++) { - if (drawingAabb.Overlaps(sector.m_aabb)) + + // Calculate the index in m_wireframeSectors for this sector. Our indices should rotate through 0 - gridSize, but just + // using a single mod will produce a negative result for negative sector indices. Using abs() will give us incorrect + // "backwards" indices for negative numbers, so instead we add the grid size and mod a second time. + // Ex: For a grid size of 5, we want the indices to map like this: + // Index 0 1 2 3 4 + // Values -10 -9 -8 -7 -6 + // -5 -4 -3 -2 -1 + // 0 1 2 3 4 + // 5 6 7 8 9 + // For -9, (-9 % 5) = -4, then (-4 + 5) % 5 = 1. If we used abs(), we'd get 4, which is backwards from what we want. + int32_t sectorYIndex = ((sectorY % m_sectorGridSize) + m_sectorGridSize) % m_sectorGridSize; + int32_t sectorXIndex = ((sectorX % m_sectorGridSize) + m_sectorGridSize) % m_sectorGridSize; + int32_t sectorIndex = (sectorYIndex * m_sectorGridSize) + sectorXIndex; + + WireframeSector& sector = m_wireframeSectors[sectorIndex]; + + // Calculate the new world space box for this sector. + AZ::Aabb sectorAabb = AZ::Aabb::CreateFromMinMax( + AZ::Vector3(sectorX * sectorSize.GetX(), sectorY * sectorSize.GetY(), worldMinZ), + AZ::Vector3((sectorX + 1) * sectorSize.GetX(), (sectorY + 1) * sectorSize.GetY(), worldMinZ)); + + // Clamp it to the terrain world bounds. + sectorAabb.Clamp(worldBounds); + + // If the world space box for the sector doesn't match, set it and mark the sector as dirty so we refresh the height data. + if (sector.m_aabb != sectorAabb) { - if (!sector.m_lineVertices.empty()) - { - const AZ::Color primaryColor = AZ::Color(0.25f, 0.25f, 0.25f, 1.0f); - debugDisplay.DrawLines(sector.m_lineVertices, primaryColor); - } - else - { - AZ_Warning("Debug", false, "empty sector!"); - } + sector.m_aabb = sectorAabb; + sector.m_isDirty = true; } } } + + // Finally, for each sector, rebuild the data if it's dirty, then draw it assuming it has valid data. + // (Sectors that are outside the world bounds won't have any valid data, so they'll get skipped) + for (auto& sector : m_wireframeSectors) + { + if (sector.m_isDirty) + { + RebuildSectorWireframe(sector, heightDataResolution, worldMinZ); + } + + if (!sector.m_lineVertices.empty()) + { + const AZ::Color primaryColor = AZ::Color(0.25f, 0.25f, 0.25f, 1.0f); + debugDisplay.DrawLines(sector.m_lineVertices, primaryColor); + } + } } - void TerrainWorldDebuggerComponent::RefreshCachedWireframeGrid(const AZ::Aabb& dirtyRegion) + + void TerrainWorldDebuggerComponent::DisplayEntityViewport( + const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay) { - // Get the terrain world bounds and grid resolution. + DrawWorldBounds(debugDisplay); + DrawWireframe(viewportInfo, debugDisplay); - AZ::Aabb worldBounds = GetWorldBounds(); + } - AZ::Vector2 queryResolution = AZ::Vector2(1.0f); - AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( - queryResolution, &AzFramework::Terrain::TerrainDataRequests::GetTerrainHeightQueryResolution); - - // Take the dirty region and adjust the Z values to the world min/max so that even if the dirty region falls outside the current - // world bounds, we still update the wireframe accordingly. - AZ::Aabb dirtyRegion2D = AZ::Aabb::CreateFromMinMaxValues( - dirtyRegion.GetMin().GetX(), dirtyRegion.GetMin().GetY(), worldBounds.GetMin().GetZ(), - dirtyRegion.GetMax().GetX(), dirtyRegion.GetMax().GetY(), worldBounds.GetMax().GetZ()); - - // Calculate the world size of each sector. Note that this size actually ends at the last point, not the last square. - // So for example, the sector size for 3 points will go from (*--*--*) even though it will be used to draw (*--*--*--). - const float xSectorSize = (queryResolution.GetX() * SectorSizeInGridPoints); - const float ySectorSize = (queryResolution.GetY() * SectorSizeInGridPoints); - - // Calculate the total number of sectors to cache. The world bounds might not be evenly divisible by sector bounds, so we add - // an extra sector's worth of size in each direction so that clamping down to an integer still accounts for that fractional sector. - const int32_t numSectorsX = aznumeric_cast((worldBounds.GetXExtent() + xSectorSize) / xSectorSize); - const int32_t numSectorsY = aznumeric_cast((worldBounds.GetYExtent() + ySectorSize) / ySectorSize); - - // If we haven't cached anything before, or if the world bounds has changed, clear our cache structure and repopulate it - // with WireframeSector entries with the proper AABB sizes. - if (!m_wireframeBounds.IsValid() || !dirtyRegion2D.IsValid() || !m_wireframeBounds.IsClose(worldBounds)) + void TerrainWorldDebuggerComponent::RebuildSectorWireframe(WireframeSector& sector, const AZ::Vector2& gridResolution, float worldMinZ) + { + if (!sector.m_isDirty) { - m_wireframeBounds = worldBounds; + return; + } - m_wireframeSectors.clear(); - m_wireframeSectors.reserve(numSectorsX * numSectorsY); + sector.m_isDirty = false; - for (int32_t ySector = 0; ySector < numSectorsY; ySector++) - { - for (int32_t xSector = 0; xSector < numSectorsX; xSector++) - { - // For each sector, set up the AABB for the sector and reserve memory for the line vertices. - WireframeSector sector; - sector.m_lineVertices.reserve(VerticesPerSector); - sector.m_aabb = AZ::Aabb::CreateFromMinMax( - AZ::Vector3( - worldBounds.GetMin().GetX() + (xSector * xSectorSize), worldBounds.GetMin().GetY() + (ySector * ySectorSize), - worldBounds.GetMin().GetZ()), - AZ::Vector3( - worldBounds.GetMin().GetX() + ((xSector + 1) * xSectorSize), - worldBounds.GetMin().GetY() + ((ySector + 1) * ySectorSize), worldBounds.GetMax().GetZ())); - - sector.m_aabb.Clamp(worldBounds); - - m_wireframeSectors.push_back(AZStd::move(sector)); - } - } + // To rebuild the wireframe, we walk through the sector by X, then by Y. For each point, we add two lines in a _| shape. + // To do that, we'll need to cache the height from the previous point to draw the _ line, and from the previous row to draw + // the | line. - // Notify the visibility system that our bounds have changed. - AzFramework::IEntityBoundsUnionRequestBus::Broadcast( - &AzFramework::IEntityBoundsUnionRequestBus::Events::RefreshEntityLocalBoundsUnion, GetEntityId()); - } + // When walking through the bounding box, the loops will be inclusive on one side, and exclusive on the other. However, since + // our box is exactly aligned with grid points, we want to get the grid points on both sides in each direction, so we need to + // expand our query region by one extra point. + // For example, if our AABB is 2 m and our grid resolution is 1 m, we'll want to query (*--*--*--), not (*--*--). + // Since we're processing lines based on the grid points and going backwards, this will give us (*--*--*). - // For each sector, if it overlaps with the dirty region, clear it out and recache the wireframe line data. - for (auto& sector : m_wireframeSectors) + AZ::Aabb region = sector.m_aabb; + region.SetMax(region.GetMax() + AZ::Vector3(gridResolution.GetX(), gridResolution.GetY(), 0.0f)); + + // This keeps track of the height from the previous point for the _ line. + float previousHeight = 0.0f; + + // This keeps track of the heights from the previous row for the | line. + AZStd::vector rowHeights(aznumeric_cast(ceil(region.GetExtents().GetX() / gridResolution.GetX()))); + + // We need 4 vertices for each grid point in our sector to hold the _| shape. + const uint32_t numSamplesX = static_cast((region.GetMax().GetX() - region.GetMin().GetX()) / gridResolution.GetX()); + const uint32_t numSamplesY = static_cast((region.GetMax().GetY() - region.GetMin().GetY()) / gridResolution.GetY()); + sector.m_lineVertices.clear(); + sector.m_lineVertices.reserve(numSamplesX * numSamplesY * 4); + + // For each terrain height value in the region, create the _| grid lines for that point and cache off the height value + // for use with subsequent grid line calculations. + auto ProcessHeightValue = [gridResolution, &previousHeight, &rowHeights, §or] + (uint32_t xIndex, uint32_t yIndex, const AZ::Vector3& position, [[maybe_unused]] bool terrainExists) { - if (dirtyRegion2D.IsValid() && !dirtyRegion2D.Overlaps(sector.m_aabb)) + // Don't add any vertices for the first column or first row. These grid lines will be handled by an adjacent sector, if + // there is one. + if ((xIndex > 0) && (yIndex > 0)) { - continue; + float x = position.GetX() - gridResolution.GetX(); + float y = position.GetY() - gridResolution.GetY(); + + sector.m_lineVertices.emplace_back(AZ::Vector3(x, position.GetY(), previousHeight)); + sector.m_lineVertices.emplace_back(position); + + sector.m_lineVertices.emplace_back(AZ::Vector3(position.GetX(), y, rowHeights[xIndex])); + sector.m_lineVertices.emplace_back(position); } - sector.m_lineVertices.clear(); + // Save off the heights so that we can use them to draw subsequent columns and rows. + previousHeight = position.GetZ(); + rowHeights[xIndex] = position.GetZ(); + }; - for (float y = sector.m_aabb.GetMin().GetY(); y < sector.m_aabb.GetMax().GetY(); y += queryResolution.GetY()) + // This set of nested loops will get replaced with a call to ProcessHeightsFromRegion once the API exists. + uint32_t yIndex = 0; + for (float y = region.GetMin().GetY(); y < region.GetMax().GetY(); y += gridResolution.GetY()) + { + uint32_t xIndex = 0; + for (float x = region.GetMin().GetX(); x < region.GetMax().GetX(); x += gridResolution.GetX()) { - for (float x = sector.m_aabb.GetMin().GetX(); x < sector.m_aabb.GetMax().GetX(); x += queryResolution.GetX()) - { - float x1 = x + queryResolution.GetX(); - float y1 = y + queryResolution.GetY(); - - float z00 = 0.0f; - float z01 = 0.0f; - float z10 = 0.0f; - bool terrainExists; - - AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( - z00, &AzFramework::Terrain::TerrainDataRequests::GetHeightFromFloats, x, y, - AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT, &terrainExists); - AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( - z01, &AzFramework::Terrain::TerrainDataRequests::GetHeightFromFloats, x, y1, - AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT, &terrainExists); - AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( - z10, &AzFramework::Terrain::TerrainDataRequests::GetHeightFromFloats, x1, y, - AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT, &terrainExists); - - sector.m_lineVertices.push_back(AZ::Vector3(x, y, z00)); - sector.m_lineVertices.push_back(AZ::Vector3(x1, y, z10)); - - sector.m_lineVertices.push_back(AZ::Vector3(x, y, z00)); - sector.m_lineVertices.push_back(AZ::Vector3(x, y1, z01)); - } + float height = worldMinZ; + bool terrainExists = false; + AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( + height, &AzFramework::Terrain::TerrainDataRequests::GetHeightFromFloats, x, y, + AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT, &terrainExists); + ProcessHeightValue(xIndex, yIndex, AZ::Vector3(x, y, height), terrainExists); + xIndex++; } + yIndex++; } } @@ -315,7 +398,14 @@ namespace Terrain { if (dataChangedMask & (TerrainDataChangedMask::Settings | TerrainDataChangedMask::HeightData)) { - RefreshCachedWireframeGrid(dirtyRegion); + MarkDirtySectors(dirtyRegion); + } + + if (dataChangedMask & TerrainDataChangedMask::Settings) + { + // Any time the world bounds potentially changes, notify that the terrain debugger's visibility bounds also changed. + AzFramework::IEntityBoundsUnionRequestBus::Broadcast( + &AzFramework::IEntityBoundsUnionRequestBus::Events::RefreshEntityLocalBoundsUnion, GetEntityId()); } } diff --git a/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.h b/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.h index 5ec831c038..f3bcead8c3 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.h +++ b/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.h @@ -82,33 +82,40 @@ namespace Terrain private: + TerrainWorldDebuggerConfig m_configuration; + // Cache our debug wireframe representation in "sectors" of data so that we can easily control how far out we draw // the wireframe representation in each direction. struct WireframeSector { - AZ::Aabb m_aabb; + AZ::Aabb m_aabb{ AZ::Aabb::CreateNull() }; AZStd::vector m_lineVertices; + bool m_isDirty{ true }; }; + void RebuildSectorWireframe(WireframeSector& sector, const AZ::Vector2& gridResolution, float worldMinZ); + void MarkDirtySectors(const AZ::Aabb& dirtyRegion); + void DrawWorldBounds(AzFramework::DebugDisplayRequests& debugDisplay); + void DrawWireframe(const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay); + // Each sector contains an N x N grid of squares that it will draw. Since this is a count of the number of terrain grid points // in each direction, the actual world size will depend on the terrain grid resolution in each direction. static constexpr int32_t SectorSizeInGridPoints = 10; - // For each grid point we will draw half a square (left-right, top-down), so we need 4 vertices for the two lines. + // For each grid point we will draw half a square ( _| ), so we need 4 vertices for the two lines. static constexpr int32_t VerticesPerGridPoint = 4; - // Pre-calculate the total number of vertices per sector. - static constexpr int32_t VerticesPerSector = - (SectorSizeInGridPoints * VerticesPerGridPoint) * (SectorSizeInGridPoints * VerticesPerGridPoint); + // Pre-calculate the total number of vertices per sector (N x N grid points, with 4 vertices per grid point) + static constexpr int32_t VerticesPerSector = (SectorSizeInGridPoints * SectorSizeInGridPoints) * VerticesPerGridPoint; // AuxGeom has limits to the number of lines it can draw in a frame, so we'll cap how many total sectors to draw. static constexpr int32_t MaxVerticesToDraw = 500000; static constexpr int32_t MaxSectorsToDraw = MaxVerticesToDraw / VerticesPerSector; - void RefreshCachedWireframeGrid(const AZ::Aabb& dirtyRegion); - - TerrainWorldDebuggerConfig m_configuration; + // Structure to keep track of all our current wireframe sectors, so that we don't have to recalculate them every frame. AZStd::vector m_wireframeSectors; - AZ::Aabb m_wireframeBounds; + + // The size in sectors of our wireframe grid in each direction (i.e. a 5 x 5 sector grid has a sectorGridSize of 5) + int32_t m_sectorGridSize{ 0 }; }; } From 26a5128576e169df7984146617598f1798a9b30e Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Wed, 29 Dec 2021 10:02:32 -0800 Subject: [PATCH 258/948] Renaming py util methods for reporting log lines based on feedback Signed-off-by: Gene Walters --- .../editor_python_test_tools/utils.py | 46 +++++++++---------- .../tests/Multiplayer_AutoComponent_RPC.py | 10 +++- 2 files changed, 30 insertions(+), 26 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/utils.py index 1674fba7be..35a50b6090 100644 --- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/utils.py +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/utils.py @@ -101,49 +101,47 @@ class TestHelper: Report.critical_result(msgtuple_success_fail, general.is_in_game_mode()) @staticmethod - def find_expected_line(window, expected_message, print_infos): + def find_line(window, line, print_infos): """ Looks for an expected line in a list of tracer log lines :param window: The log's window name. For example, logs printed via script-canvas use the "Script" window. - :param expected_message: The log message to search. + :param line: The log message to search for. :param print_infos: A list of PrintInfos collected by Tracer to search. Example options: your_tracer.warnings, your_tracer.errors, your_tracer.asserts, or your_tracer.prints - :return: True if the message is found, otherwise false. + :return: True if the line is found, otherwise false. """ for printInfo in print_infos: - if printInfo.window == window.strip() and printInfo.message.strip() == expected_message: + if printInfo.window == window.strip() and printInfo.message.strip() == line: return True return False @staticmethod - def wait_for_critical_expected_line(window, expected_message, print_infos, time_out): + def succeed_if_log_line_found(window, line, print_infos, time_out): """ - Looks for an expected line in a list of tracer log lines for a period of time. - Reports a critical result based on if the expected line was found. The result is successful if the line is found. + Looks for a line in a list of tracer log lines and reports success if found. :param window: The log's window name. For example, logs printed via script-canvas use the "Script" window. - :param expected_message: The log message we're expecting to find. + :param line: The log message we're hoping to find. :param print_infos: A list of PrintInfos collected by Tracer to search. Example options: your_tracer.warnings, your_tracer.errors, your_tracer.asserts, or your_tracer.prints :param time_out: The total amount of time to wait before giving up looking for the expected line. - :return: No return value, but if the expected message is found, a successful critical result is reported; otherwise failure. + :return: No return value, but if the message is found, a successful critical result is reported; otherwise failure. """ - TestHelper.wait_for_condition(lambda : TestHelper.find_expected_line(window, expected_message, print_infos), time_out) - Report.critical_result(("Found expected line: " + expected_message, "Failed to find expected line: " + expected_message), TestHelper.find_expected_line(window, expected_message, print_infos)) + TestHelper.wait_for_condition(lambda : TestHelper.find_line(window, line, print_infos), time_out) + Report.critical_result(("Found expected line: " + line, "Failed to find expected line: " + line), TestHelper.find_line(window, line, print_infos)) @staticmethod - def wait_for_critical_unexpected_line(window, unexpected_line, print_infos, time_out): + def fail_if_log_line_found(window, line, print_infos, time_out): """ - Looks for an unexpected line in a list of tracer log lines over a period of time. - Reports a critical result based on if the unexpected line was found. The result is successful if the line is not found. + Reports a failure if a log line in a list of tracer log lines is found. :param window: The log's window name. For example, logs printed via script-canvas use the "Script" window. - :param unexpected_line: The log message we're hoping to not find. + :param line: The log message we're hoping to not find. :param print_infos: A list of PrintInfos collected by Tracer to search. Example options: your_tracer.warnings, your_tracer.errors, your_tracer.asserts, or your_tracer.prints :param time_out: The total amount of time to wait before giving up looking for the unexpected line. If time runs out and we don't see the unexpected line then report a success. - :return: No return value, but if the unexpected message is found, a failed critical result is reported; otherwise success. + :return: No return value, but if the line is found, a failed critical result is reported; otherwise success. """ - TestHelper.wait_for_condition(lambda : TestHelper.find_expected_line(window, unexpected_line, print_infos), time_out) - Report.critical_result(("Unexpected line not found: " + unexpected_line, "Unexpected line found: " + unexpected_line), not TestHelper.find_expected_line(window, unexpected_line, print_infos)) + TestHelper.wait_for_condition(lambda : TestHelper.find_line(window, line, print_infos), time_out) + Report.critical_result(("Unexpected line not found: " + line, "Unexpected line found: " + line), not TestHelper.find_line(window, line, print_infos)) @staticmethod def multiplayer_enter_game_mode(msgtuple_success_fail: Tuple[str, str], sv_default_player_spawn_asset: str) -> None: @@ -163,20 +161,20 @@ class TestHelper: multiplayer.PythonEditorFuncs_enter_game_mode() # make sure the server launcher binary exists - TestHelper.wait_for_critical_unexpected_line("MultiplayerEditor", "LaunchEditorServer failed! The ServerLauncher binary is missing!", section_tracer.errors, 0.5) + TestHelper.fail_if_log_line_found("MultiplayerEditor", "LaunchEditorServer failed! The ServerLauncher binary is missing!", section_tracer.errors, 0.5) # make sure the server launcher is running waiter.wait_for(lambda: process_utils.process_exists("AutomatedTesting.ServerLauncher", ignore_extensions=True), timeout=5.0, exc=AssertionError("AutomatedTesting.ServerLauncher has NOT launched!"), interval=1.0) - TestHelper.wait_for_critical_expected_line("EditorServer", "MultiplayerEditorConnection: Editor-server activation has found and connected to the editor.", section_tracer.prints, 15.0) + TestHelper.succeed_if_log_line_found("EditorServer", "MultiplayerEditorConnection: Editor-server activation has found and connected to the editor.", section_tracer.prints, 15.0) - TestHelper.wait_for_critical_expected_line("MultiplayerEditor", "Editor is sending the editor-server the level data packet.", section_tracer.prints, 5.0) + TestHelper.succeed_if_log_line_found("MultiplayerEditor", "Editor is sending the editor-server the level data packet.", section_tracer.prints, 5.0) - TestHelper.wait_for_critical_expected_line("EditorServer", "Logger: Editor Server completed receiving the editor's level assets, responding to Editor...", section_tracer.prints, 5.0) + TestHelper.succeed_if_log_line_found("EditorServer", "Logger: Editor Server completed receiving the editor's level assets, responding to Editor...", section_tracer.prints, 5.0) - TestHelper.wait_for_critical_expected_line("MultiplayerEditorConnection", "Editor-server ready. Editor has successfully connected to the editor-server's network simulation.", section_tracer.prints, 5.0) + TestHelper.succeed_if_log_line_found("MultiplayerEditorConnection", "Editor-server ready. Editor has successfully connected to the editor-server's network simulation.", section_tracer.prints, 5.0) - TestHelper.wait_for_critical_unexpected_line("EditorServer", f"MultiplayerSystemComponent: SpawnDefaultPlayerPrefab failed. Missing sv_defaultPlayerSpawnAsset at path '{sv_default_player_spawn_asset.lower()}'.", section_tracer.prints, 0.5) + TestHelper.fail_if_log_line_found("EditorServer", f"MultiplayerSystemComponent: SpawnDefaultPlayerPrefab failed. Missing sv_defaultPlayerSpawnAsset at path '{sv_default_player_spawn_asset.lower()}'.", section_tracer.prints, 0.5) TestHelper.wait_for_condition(lambda : multiplayer.PythonEditorFuncs_is_in_game_mode(), 5.0) Report.critical_result(msgtuple_success_fail, multiplayer.PythonEditorFuncs_is_in_game_mode()) diff --git a/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py b/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py index 8c13806a30..827826cbcc 100644 --- a/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py +++ b/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_AutoComponent_RPC.py @@ -63,8 +63,14 @@ def Multiplayer_AutoComponent_RPC(): # 4) Check the editor logs for expected and unexpected log output PLAYERID_RPC_WAIT_TIME_SECONDS = 1.0 # The player id is sent from the server as soon as the player script is spawned. 1 second should be more than enough time to send/receive that RPC. - helper.wait_for_critical_expected_line('EditorServer', 'Script: AutoComponent_RPC: Sending client PlayerNumber 1', section_tracer.prints, PLAYERID_RPC_WAIT_TIME_SECONDS) - helper.wait_for_critical_expected_line('Script', "AutoComponent_RPC: I'm Player #1", section_tracer.prints, PLAYERID_RPC_WAIT_TIME_SECONDS) + helper.succeed_if_log_line_found('EditorServer', 'Script: AutoComponent_RPC: Sending client PlayerNumber 1', section_tracer.prints, PLAYERID_RPC_WAIT_TIME_SECONDS) + helper.succeed_if_log_line_found('Script', "AutoComponent_RPC: I'm Player #1", section_tracer.prints, PLAYERID_RPC_WAIT_TIME_SECONDS) + + # Uncomment once editor game-play mode supports level entities with net-binding + #PLAYFX_RPC_WAIT_TIME_SECONDS = 1.1 # The server will send an RPC to play an fx on the client every second. + #helper.succeed_if_log_line_found('EditorServer', "Script: AutoComponent_RPC_NetLevelEntity Activated on entity: NetLevelEntity", section_tracer.prints, PLAYFX_RPC_WAIT_TIME_SECONDS) + #helper.succeed_if_log_line_found('EditorServer', "Script: AutoComponent_RPC_NetLevelEntity: Authority sending RPC to play some fx.", section_tracer.prints, PLAYFX_RPC_WAIT_TIME_SECONDS) + #helper.succeed_if_log_line_found('Script', "AutoComponent_RPC_NetLevelEntity: I'm a client playing some superficial fx.", section_tracer.prints, PLAYFX_RPC_WAIT_TIME_SECONDS) # Exit game mode From a10bf927393934821ea2df3986df6561e99e4a49 Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Wed, 29 Dec 2021 13:44:03 -0600 Subject: [PATCH 259/948] Encapsulated gradient transform logic into separate class (#6586) * First version of GradientTransform class. The gradient transform logic is getting encapsulated into a class so that it can be cached and used by components in a much more optimal way than making ebus calls to the GradientTransform component on every transformed point. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Moved GradientTransform into its own source files. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Clean up and simplify GradientTransform logic. Added extensive commenting and split TransformPositionToUVW into a separate method for normalizing (TransformPositionToUVWNormalized) so that there doesn't need to be any conditional logic. There's no runtime variance as to which one needs to be called from a given call site. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Added unit tests for GradientTransform. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Add comparison operators to GradientTransform so we can easily tell when it has changed. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Updated comments to be more Doxygen-friendly. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- .../Source/FastNoiseGradientComponent.cpp | 3 +- Gems/FastNoise/Code/Tests/FastNoiseTest.cpp | 12 +- Gems/GradientSignal/Code/CMakeLists.txt | 2 + .../GradientTransformModifierRequestBus.h | 24 +- .../Ebuses/GradientTransformRequestBus.h | 3 +- .../GradientSignal/GradientTransform.h | 157 ++++++++++ .../Code/Include/GradientSignal/Util.h | 42 +-- .../Components/GradientTransformComponent.cpp | 59 +--- .../Components/GradientTransformComponent.h | 4 +- .../Components/ImageGradientComponent.cpp | 3 +- .../Components/PerlinGradientComponent.cpp | 3 +- .../Components/RandomGradientComponent.cpp | 3 +- .../Code/Source/GradientTransform.cpp | 163 ++++++++++ Gems/GradientSignal/Code/Source/Util.cpp | 77 ----- .../Tests/GradientSignalTransformTests.cpp | 284 ++++++++++++++++++ .../Code/gradientsignal_files.cmake | 3 +- .../Code/gradientsignal_tests_files.cmake | 1 + 17 files changed, 663 insertions(+), 180 deletions(-) create mode 100644 Gems/GradientSignal/Code/Include/GradientSignal/GradientTransform.h create mode 100644 Gems/GradientSignal/Code/Source/GradientTransform.cpp delete mode 100644 Gems/GradientSignal/Code/Source/Util.cpp create mode 100644 Gems/GradientSignal/Code/Tests/GradientSignalTransformTests.cpp diff --git a/Gems/FastNoise/Code/Source/FastNoiseGradientComponent.cpp b/Gems/FastNoise/Code/Source/FastNoiseGradientComponent.cpp index 0f8ce4c5da..bb4c337299 100644 --- a/Gems/FastNoise/Code/Source/FastNoiseGradientComponent.cpp +++ b/Gems/FastNoise/Code/Source/FastNoiseGradientComponent.cpp @@ -299,9 +299,8 @@ namespace FastNoiseGem AZ::Vector3 uvw = sampleParams.m_position; bool wasPointRejected = false; - const bool shouldNormalizeOutput = false; GradientSignal::GradientTransformRequestBus::Event( - GetEntityId(), &GradientSignal::GradientTransformRequestBus::Events::TransformPositionToUVW, sampleParams.m_position, uvw, shouldNormalizeOutput, wasPointRejected); + GetEntityId(), &GradientSignal::GradientTransformRequestBus::Events::TransformPositionToUVW, sampleParams.m_position, uvw, wasPointRejected); if (!wasPointRejected) { diff --git a/Gems/FastNoise/Code/Tests/FastNoiseTest.cpp b/Gems/FastNoise/Code/Tests/FastNoiseTest.cpp index bae1d424c7..620f538c71 100644 --- a/Gems/FastNoise/Code/Tests/FastNoiseTest.cpp +++ b/Gems/FastNoise/Code/Tests/FastNoiseTest.cpp @@ -46,8 +46,16 @@ public: //////////////////////////////////////////////////////////////////////////// //// GradientTransformRequestBus - void TransformPositionToUVW([[maybe_unused]] const AZ::Vector3& inPosition, [[maybe_unused]] AZ::Vector3& outUVW, [[maybe_unused]] const bool shouldNormalizeOutput, [[maybe_unused]] bool& wasPointRejected) const override {} - void GetGradientLocalBounds([[maybe_unused]] AZ::Aabb& bounds) const override {} + void TransformPositionToUVW([[maybe_unused]] const AZ::Vector3& inPosition, [[maybe_unused]] AZ::Vector3& outUVW, [[maybe_unused]] bool& wasPointRejected) const override {} + void TransformPositionToUVWNormalized( + [[maybe_unused]] const AZ::Vector3& inPosition, + [[maybe_unused]] AZ::Vector3& outUVW, + [[maybe_unused]] bool& wasPointRejected) const override + { + } + void GetGradientLocalBounds([[maybe_unused]] AZ::Aabb& bounds) const override + { + } void GetGradientEncompassingBounds([[maybe_unused]] AZ::Aabb& bounds) const override {} ////////////////////////////////////////////////////////////////////////// diff --git a/Gems/GradientSignal/Code/CMakeLists.txt b/Gems/GradientSignal/Code/CMakeLists.txt index c0b36f4b12..f5c0457c23 100644 --- a/Gems/GradientSignal/Code/CMakeLists.txt +++ b/Gems/GradientSignal/Code/CMakeLists.txt @@ -136,6 +136,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) BUILD_DEPENDENCIES PRIVATE AZ::AzTest + AZ::AzTestShared Gem::GradientSignal.Static Gem::LmbrCentral Gem::GradientSignal.Mocks @@ -157,6 +158,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) BUILD_DEPENDENCIES PRIVATE AZ::AzTest + AZ::AzTestShared Gem::GradientSignal.Static Gem::GradientSignal.Editor.Static Gem::LmbrCentral.Editor diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientTransformModifierRequestBus.h b/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientTransformModifierRequestBus.h index 34cc8ef685..eba6aad12c 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientTransformModifierRequestBus.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientTransformModifierRequestBus.h @@ -13,14 +13,30 @@ namespace GradientSignal { + //! TransformType describes where the gradient's origin is mapped to. + enum class TransformType : AZ::u8 + { + //! The gradient's origin is the world position of this entity. + World_ThisEntity = 0, + //! The gradient's origin is the local position of this entity, but in world space. + //! i.e. If the parent is at (2, 2), and the gradient is at (3,3) in local space, the gradient entity itself will be at (5,5) in + //! world space but its origin will frozen at (3,3) in world space, no matter how much the parent moves around. + Local_ThisEntity, + //! The gradient's origin is the world position of the reference entity. + World_ReferenceEntity, + //! The gradient's origin is the local position of the reference entity, but in world space. + Local_ReferenceEntity, + //! The gradient's origin is at (0,0,0) in world space. + World_Origin, + //! The gradient's origin is in translated world space relative to the reference entity. + Relative, + }; + class GradientTransformModifierRequests : public AZ::ComponentBus { public: - /** - * Overrides the default AZ::EBusTraits handler policy to allow one - * listener only. - */ + //! Overrides the default AZ::EBusTraits handler policy to allow only one listener. static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single; virtual bool GetAllowReference() const = 0; diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientTransformRequestBus.h b/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientTransformRequestBus.h index 426255efe7..ac2f1a9cb1 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientTransformRequestBus.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientTransformRequestBus.h @@ -27,7 +27,8 @@ namespace GradientSignal virtual ~GradientTransformRequests() = default; - virtual void TransformPositionToUVW(const AZ::Vector3& inPosition, AZ::Vector3& outUVW, const bool shouldNormalizeOutput, bool& wasPointRejected) const = 0; + virtual void TransformPositionToUVW(const AZ::Vector3& inPosition, AZ::Vector3& outUVW, bool& wasPointRejected) const = 0; + virtual void TransformPositionToUVWNormalized(const AZ::Vector3& inPosition, AZ::Vector3& outUVW, bool& wasPointRejected) const = 0; virtual void GetGradientLocalBounds(AZ::Aabb& bounds) const = 0; virtual void GetGradientEncompassingBounds(AZ::Aabb& bounds) const = 0; }; diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/GradientTransform.h b/Gems/GradientSignal/Code/Include/GradientSignal/GradientTransform.h new file mode 100644 index 0000000000..c8073c2f4f --- /dev/null +++ b/Gems/GradientSignal/Code/Include/GradientSignal/GradientTransform.h @@ -0,0 +1,157 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ +#pragma once + +#include +#include +#include +#include +#include + +namespace GradientSignal +{ + //! Controls how the gradient repeats itself when queried outside the bounds of the shape. + enum class WrappingType : AZ::u8 + { + None = 0, //! Unbounded - the gradient ignores the shape bounds. + ClampToEdge, //! The values on the edge of the shape will be extended outward in each direction. + Mirror, //! The gradient signal will be repeated but mirrored on every repeat. + Repeat, //! The gradient signal will be repeated in every direction. + ClampToZero, //! The value will always be 0 outside of the shape. + }; + + class GradientTransform + { + public: + GradientTransform() = default; + + /** + * Create a GradientTransform with the given parameters. + * GradientTransform is a utility class that converts world space positions to gradient space UVW values which can be used + * to look up deterministic gradient values for the input spatial locations. + * \param shapeBounds The bounds of the shape associated with the gradient, in local space. + * \param transform The transform to use to convert from world space to gradient space. + * \param use3d True for 3D gradient lookup outputs, false for 2D gradient lookup outputs. (i.e. output W will be nonzero or zero) + * \param frequencyZoom Amount to scale the UVW results after wrapping is applied. + * \param wrappingType The way in which the gradient repeats itself outside the shape bounds. + */ + GradientTransform( + const AZ::Aabb& shapeBounds, + const AZ::Matrix3x4& transform, + bool use3d, + float frequencyZoom, + GradientSignal::WrappingType wrappingType); + + /** + * Checks to see if two GradientTransform instances are equivalent. + * Useful for being able to send out notifications when a GradientTransform has changed. + * \param rhs The second GradientTranform to compare against. + * \return True if they're equal, False if they aren't. + */ + bool operator==(const GradientTransform& rhs) const + { + return ( + (m_shapeBounds == rhs.m_shapeBounds) && + (m_inverseTransform == rhs.m_inverseTransform) && + (m_alwaysAcceptPoint == rhs.m_alwaysAcceptPoint) && + (m_frequencyZoom == rhs.m_frequencyZoom) && + (m_wrappingType == rhs.m_wrappingType) && + (m_normalizeExtentsReciprocal == rhs.m_normalizeExtentsReciprocal)); + } + + /** + * Checks to see if two GradientTransform instances aren't equivalent. + * Useful for being able to send out notifications when a GradientTransform has changed. + * \param rhs The second GradientTranform to compare against. + * \return True if they're not equal, False if they are. + */ + bool operator!=(const GradientTransform& rhs) const + { + return !(*this == rhs); + } + + + /** + * Transform the given world space position to a gradient space UVW lookup value. + * \param inPosition The input world space position to transform. + * \param outUVW [out] The UVW value that can be used to look up a deterministic gradient value. + * \param wasPointRejected [out] True if the input position doesn't have a gradient value, false if it does. + * Most gradients have values mapped to infinite world space, so wasPointRejected will almost always be false. + * It will only be true when using ClampToZero and the world space position falls outside the shape bounds. + */ + void TransformPositionToUVW(const AZ::Vector3& inPosition, AZ::Vector3& outUVW, bool& wasPointRejected) const; + + /** + * Transform the given world space position to a gradient space UVW lookup value and normalize to the shape bounds. + * "Normalizing" in this context means that regardless of the world space coordinates, (0,0,0) represents the minimum + * shape bounds corner, and (1,1,1) represents the maximum shape bounds corner. Depending on the wrapping type, it's possible + * (and even likely) to get values outside the 0-1 range. + * \param inPosition The input world space position to transform. + * \param outUVW [out] The UVW value that can be used to look up a deterministic gradient value. + * \param wasPointRejected [out] True if the input position doesn't have a gradient value, false if it does. + * Most gradients have values mapped to infinite world space, so wasPointRejected will almost always be false. + * It will only be true when using ClampToZero and the world space position falls outside the shape bounds. + */ + void TransformPositionToUVWNormalized(const AZ::Vector3& inPosition, AZ::Vector3& outUVW, bool& wasPointRejected) const; + + /** + * Epsilon value to allow our UVW range to go to [min, max) by using the range [min, max - epsilon]. + * To keep things behaving consistently between clamped and unbounded uv ranges, we want our clamped uvs to use a + * range of [min, max), so we'll actually clamp to [min, max - epsilon]. Since our floating-point numbers are likely in the + * -16384 to 16384 range, an epsilon of 0.001 will work without rounding to 0. + * (This constant is public so that it can be used from unit tests for validating transformation results) + */ + static constexpr float UvEpsilon = 0.001f; + + private: + + //! These are the various transformations that will be performed, based on wrapping type. + using WrappingTransformFunction = AZStd::function; + static AZ::Vector3 NoTransform(const AZ::Vector3& point, const AZ::Aabb& bounds); + static AZ::Vector3 GetUnboundedPointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds); + static AZ::Vector3 GetClampedPointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds); + static AZ::Vector3 GetMirroredPointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds); + static AZ::Vector3 GetRelativePointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds); + static AZ::Vector3 GetWrappedPointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds); + + //! The shape bounds are used for determining the wrapping bounds, and to normalize the UVW results into if requested. + AZ::Aabb m_shapeBounds = AZ::Aabb::CreateNull(); + + /** + * The relative transform to use for converting from world space to gradient space, stored as an inverse transform. + * We only ever need to use the inverse transform, so we compute it once and store it instead of keeping the original + * transform around. Note that the GradientTransformComponent has many options for choosing which relative space to use + * for the transform, so the transform passed in to this class might already have many modifications applied to it. + * The inverse transform will also get its 3rd row cleared out if "use3d" is false and we're only performing 2D gradient + * transformations, so that the W component of the UVW output will always be 0. + */ + AZ::Matrix3x4 m_inverseTransform = AZ::Matrix3x4::CreateIdentity(); + + /** + * Whether or not to always accept the input point as a valid output point. + * Most of the time, the gradient exists everywhere in world space, so we always accept the input point. + * The one exception is ClampToZero, which will return that the point is rejected if it falls outside the shape bounds. + */ + bool m_alwaysAcceptPoint = true; + + //! Apply a scale to the point *after* the wrapping is applied. + float m_frequencyZoom = 1.0f; + + //! How the gradient should repeat itself outside of the shape bounds. + WrappingType m_wrappingType = WrappingType::None; + WrappingTransformFunction m_wrappingTransform = NoTransform; + + /** + * Cached reciprocal for performing an inverse lerp back to shape bounds. + * When normalizing the output UVW back into the shape bounds, we perform an inverse lerp. The inverse lerp + * equation is (point - min) * (1 / (max-min)), so we save off the (1 / (max-min)) term to avoid recalculating it on every point. + */ + AZ::Vector3 m_normalizeExtentsReciprocal = AZ::Vector3(1.0f); + }; + +} // namespace GradientSignal diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Util.h b/Gems/GradientSignal/Code/Include/GradientSignal/Util.h index a6dbe118af..fa1791c053 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Util.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Util.h @@ -13,49 +13,10 @@ #include #include #include +#include namespace GradientSignal { - enum class WrappingType : AZ::u8 - { - None = 0, - ClampToEdge, - Mirror, - Repeat, - ClampToZero, - }; - - enum class TransformType : AZ::u8 - { - World_ThisEntity = 0, - Local_ThisEntity, - World_ReferenceEntity, - Local_ReferenceEntity, - World_Origin, - Relative, - }; - - AZ::Vector3 GetUnboundedPointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds); - AZ::Vector3 GetClampedPointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds); - AZ::Vector3 GetMirroredPointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds); - AZ::Vector3 GetRelativePointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds); - - inline AZ::Vector3 GetWrappedPointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds) - { - return AZ::Vector3( - AZ::Wrap(point.GetX(), bounds.GetMin().GetX(), bounds.GetMax().GetX()), - AZ::Wrap(point.GetY(), bounds.GetMin().GetY(), bounds.GetMax().GetY()), - AZ::Wrap(point.GetZ(), bounds.GetMin().GetZ(), bounds.GetMax().GetZ())); - } - - inline AZ::Vector3 GetNormalizedPointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds) - { - return AZ::Vector3( - AZ::LerpInverse(bounds.GetMin().GetX(), bounds.GetMax().GetX(), point.GetX()), - AZ::LerpInverse(bounds.GetMin().GetY(), bounds.GetMax().GetY(), point.GetY()), - AZ::LerpInverse(bounds.GetMin().GetZ(), bounds.GetMax().GetZ(), point.GetZ())); - } - inline void GetObbParamsFromShape(const AZ::EntityId& entity, AZ::Aabb& bounds, AZ::Matrix3x4& worldToBoundsTransform) { //get bound and transform data for associated shape @@ -115,4 +76,5 @@ namespace GradientSignal return AZ::Lerp(outputMin, outputMax, inputCorrected); } + } // namespace GradientSignal diff --git a/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.cpp b/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.cpp index 57de6f776a..8cd7dc56a1 100644 --- a/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.cpp @@ -322,55 +322,17 @@ namespace GradientSignal return false; } - void GradientTransformComponent::TransformPositionToUVW(const AZ::Vector3& inPosition, AZ::Vector3& outUVW, const bool shouldNormalizeOutput, bool& wasPointRejected) const + void GradientTransformComponent::TransformPositionToUVW(const AZ::Vector3& inPosition, AZ::Vector3& outUVW, bool& wasPointRejected) const { AZStd::lock_guard lock(m_cacheMutex); + m_gradientTransform.TransformPositionToUVW(inPosition, outUVW, wasPointRejected); + } - //transforming coordinate into "local" relative space of shape bounds - outUVW = m_shapeTransformInverse * inPosition; - - if (!m_configuration.m_advancedMode || !m_configuration.m_is3d) - { - outUVW.SetZ(0.0f); - } - - wasPointRejected = false; - if (m_shapeBounds.IsValid()) - { - //all wrap types and transformations are applied after the coordinate is transformed into shape relative space - //this allows all calculations to be simplified and done using the shapes untransformed aabb - //outputting a value that can be used to sample a gradient in its local space - switch (m_configuration.m_wrappingType) - { - default: - case WrappingType::None: - outUVW = GetUnboundedPointInAabb(outUVW, m_shapeBounds); - break; - case WrappingType::ClampToEdge: - outUVW = GetClampedPointInAabb(outUVW, m_shapeBounds); - break; - case WrappingType::ClampToZero: - // We don't want to use m_shapeBounds.Contains() here because Contains() is inclusive on all edges. - // For uv consistency between clamped and unclamped states, we only want to accept uv ranges of [min, max), - // so we specifically need to exclude the max edges here. - wasPointRejected = !(outUVW.IsGreaterEqualThan(m_shapeBounds.GetMin()) && outUVW.IsLessThan(m_shapeBounds.GetMax())); - outUVW = GetClampedPointInAabb(outUVW, m_shapeBounds); - break; - case WrappingType::Mirror: - outUVW = GetMirroredPointInAabb(outUVW, m_shapeBounds); - break; - case WrappingType::Repeat: - outUVW = GetWrappedPointInAabb(outUVW, m_shapeBounds); - break; - } - } - - outUVW *= m_configuration.m_frequencyZoom; - - if (shouldNormalizeOutput) - { - outUVW = GetNormalizedPointInAabb(outUVW, m_shapeBounds); - } + void GradientTransformComponent::TransformPositionToUVWNormalized( + const AZ::Vector3& inPosition, AZ::Vector3& outUVW, bool& wasPointRejected) const + { + AZStd::lock_guard lock(m_cacheMutex); + m_gradientTransform.TransformPositionToUVWNormalized(inPosition, outUVW, wasPointRejected); } void GradientTransformComponent::GetGradientLocalBounds(AZ::Aabb& bounds) const @@ -499,6 +461,11 @@ namespace GradientSignal shapeTransformFinal.SetTranslation(m_configuration.m_translate); shapeTransformFinal.MultiplyByScale(m_configuration.m_scale); m_shapeTransformInverse = shapeTransformFinal.GetInverseFull(); + + // Set everything up on the Gradient Transform + const bool use3dGradients = m_configuration.m_advancedMode && m_configuration.m_is3d; + m_gradientTransform = GradientTransform( + m_shapeBounds, shapeTransformFinal, use3dGradients, m_configuration.m_frequencyZoom, m_configuration.m_wrappingType); } AZ::EntityId GradientTransformComponent::GetShapeEntityId() const diff --git a/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.h b/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.h index abaa245f15..50ae6fe475 100644 --- a/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.h +++ b/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.h @@ -101,7 +101,8 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientTransformRequestBus - void TransformPositionToUVW(const AZ::Vector3& inPosition, AZ::Vector3& outUVW, const bool shouldNormalizeOutput, bool& wasPointRejected) const override; + void TransformPositionToUVW(const AZ::Vector3& inPosition, AZ::Vector3& outUVW, bool& wasPointRejected) const override; + void TransformPositionToUVWNormalized(const AZ::Vector3& inPosition, AZ::Vector3& outUVW, bool& wasPointRejected) const override; void GetGradientLocalBounds(AZ::Aabb& bounds) const override; void GetGradientEncompassingBounds(AZ::Aabb& bounds) const override; @@ -172,5 +173,6 @@ namespace GradientSignal AZ::Matrix3x4 m_shapeTransformInverse = AZ::Matrix3x4::CreateIdentity(); LmbrCentral::DependencyMonitor m_dependencyMonitor; AZStd::atomic_bool m_dirty{ false }; + GradientTransform m_gradientTransform; }; } //namespace GradientSignal diff --git a/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp index 065f0ace0f..2d594a201c 100644 --- a/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp @@ -194,9 +194,8 @@ namespace GradientSignal AZ::Vector3 uvw = sampleParams.m_position; bool wasPointRejected = false; - const bool shouldNormalizeOutput = true; GradientTransformRequestBus::Event( - GetEntityId(), &GradientTransformRequestBus::Events::TransformPositionToUVW, sampleParams.m_position, uvw, shouldNormalizeOutput, wasPointRejected); + GetEntityId(), &GradientTransformRequestBus::Events::TransformPositionToUVWNormalized, sampleParams.m_position, uvw, wasPointRejected); if (!wasPointRejected) { diff --git a/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp index e150ff4305..d5e846b9ef 100644 --- a/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp @@ -179,9 +179,8 @@ namespace GradientSignal AZ::Vector3 uvw = sampleParams.m_position; bool wasPointRejected = false; - const bool shouldNormalizeOutput = false; GradientTransformRequestBus::Event( - GetEntityId(), &GradientTransformRequestBus::Events::TransformPositionToUVW, sampleParams.m_position, uvw, shouldNormalizeOutput, wasPointRejected); + GetEntityId(), &GradientTransformRequestBus::Events::TransformPositionToUVW, sampleParams.m_position, uvw, wasPointRejected); if (!wasPointRejected) { diff --git a/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp index d28fe13aff..d320dbeb3d 100644 --- a/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp @@ -142,9 +142,8 @@ namespace GradientSignal AZ::Vector3 uvw = sampleParams.m_position; bool wasPointRejected = false; - const bool shouldNormalizeOutput = false; GradientTransformRequestBus::Event( - GetEntityId(), &GradientTransformRequestBus::Events::TransformPositionToUVW, sampleParams.m_position, uvw, shouldNormalizeOutput, wasPointRejected); + GetEntityId(), &GradientTransformRequestBus::Events::TransformPositionToUVW, sampleParams.m_position, uvw, wasPointRejected); if (!wasPointRejected) { diff --git a/Gems/GradientSignal/Code/Source/GradientTransform.cpp b/Gems/GradientSignal/Code/Source/GradientTransform.cpp new file mode 100644 index 0000000000..acf9e2f150 --- /dev/null +++ b/Gems/GradientSignal/Code/Source/GradientTransform.cpp @@ -0,0 +1,163 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + + +#include +#include + + +namespace GradientSignal +{ + GradientTransform::GradientTransform( + const AZ::Aabb& shapeBounds, const AZ::Matrix3x4& transform, bool use3d, + float frequencyZoom, GradientSignal::WrappingType wrappingType) + : m_shapeBounds(shapeBounds) + , m_inverseTransform(transform.GetInverseFull()) + , m_frequencyZoom(frequencyZoom) + , m_wrappingType(wrappingType) + , m_wrappingTransform(NoTransform) + , m_alwaysAcceptPoint(true) + { + // If we want this to be a 2D gradient lookup, we always want to set the W result in the output to 0. + // The easiest / cheapest way to make this happen is just to clear out the third row in the inverseTransform. + if (!use3d) + { + m_inverseTransform.SetRow(2, AZ::Vector4::CreateZero()); + } + + // Set up the appropriate wrapping transform function for the the given wrapping type. + // Also note that ClampToZero is the only wrapping type that allows us to return a "pointIsRejected" result + // for points that fall outside the shape bounds. + if (m_shapeBounds.IsValid()) + { + switch (wrappingType) + { + default: + case WrappingType::None: + m_wrappingTransform = GetUnboundedPointInAabb; + break; + case WrappingType::ClampToEdge: + m_wrappingTransform = GetClampedPointInAabb; + break; + case WrappingType::ClampToZero: + m_alwaysAcceptPoint = false; + m_wrappingTransform = GetClampedPointInAabb; + break; + case WrappingType::Mirror: + m_wrappingTransform = GetMirroredPointInAabb; + break; + case WrappingType::Repeat: + m_wrappingTransform = GetWrappedPointInAabb; + break; + } + } + + m_normalizeExtentsReciprocal = AZ::Vector3( + AZ::IsClose(0.0f, m_shapeBounds.GetXExtent()) ? 0.0f : (1.0f / m_shapeBounds.GetXExtent()), + AZ::IsClose(0.0f, m_shapeBounds.GetYExtent()) ? 0.0f : (1.0f / m_shapeBounds.GetYExtent()), + AZ::IsClose(0.0f, m_shapeBounds.GetZExtent()) ? 0.0f : (1.0f / m_shapeBounds.GetZExtent())); + } + + void GradientTransform::TransformPositionToUVW(const AZ::Vector3& inPosition, AZ::Vector3& outUVW, bool& wasPointRejected) const + { + // Transform coordinate into "local" relative space of shape bounds, and set W to 0 if this is a 2D gradient. + outUVW = m_inverseTransform * inPosition; + + // For most wrapping types, we always accept the point, but for ClampToZero we only accept it if it's within + // the shape bounds. We don't use m_shapeBounds.Contains() here because Contains() is inclusive on all edges. + // For uv consistency between clamped and unclamped states, we only want to accept uv ranges of [min, max), + // so we specifically need to exclude the max edges here. + bool wasPointAccepted = m_alwaysAcceptPoint || + (outUVW.IsGreaterEqualThan(m_shapeBounds.GetMin()) && outUVW.IsLessThan(m_shapeBounds.GetMax())); + wasPointRejected = !wasPointAccepted; + + outUVW = m_wrappingTransform(outUVW, m_shapeBounds); + outUVW *= m_frequencyZoom; + } + + void GradientTransform::TransformPositionToUVWNormalized(const AZ::Vector3& inPosition, AZ::Vector3& outUVW, bool& wasPointRejected) const + { + TransformPositionToUVW(inPosition, outUVW, wasPointRejected); + + // This effectively does AZ::LerpInverse(bounds.GetMin(), bounds.GetMax(), point) if shouldNormalize is true, + // and just returns outUVW if shouldNormalize is false. + outUVW = m_normalizeExtentsReciprocal * (outUVW - m_shapeBounds.GetMin()); + } + + AZ::Vector3 GradientTransform::NoTransform(const AZ::Vector3& point, const AZ::Aabb& /*bounds*/) + { + return point; + } + + AZ::Vector3 GradientTransform::GetUnboundedPointInAabb(const AZ::Vector3& point, const AZ::Aabb& /*bounds*/) + { + return point; + } + + AZ::Vector3 GradientTransform::GetClampedPointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds) + { + // We want the clamped sampling states to clamp uvs to the [min, max) range. + return point.GetClamp(bounds.GetMin(), bounds.GetMax() - AZ::Vector3(UvEpsilon)); + } + + AZ::Vector3 GradientTransform::GetWrappedPointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds) + { + return AZ::Vector3( + AZ::Wrap(point.GetX(), bounds.GetMin().GetX(), bounds.GetMax().GetX()), + AZ::Wrap(point.GetY(), bounds.GetMin().GetY(), bounds.GetMax().GetY()), + AZ::Wrap(point.GetZ(), bounds.GetMin().GetZ(), bounds.GetMax().GetZ())); + } + + AZ::Vector3 GradientTransform::GetMirroredPointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds) + { + /* For mirroring, we want to produce the following pattern: + * [min, max) : value + * [max, min) : max - value - epsilon + * [min, max) : value + * [max, min) : max - value - epsilon + * ... + * The epsilon is because we always want to keep our output values in the [min, max) range. We apply the epsilon to all + * the mirrored values so that we get consistent spacing between the values. + */ + + auto GetMirror = [](float value, float min, float max) -> float + { + // To calculate the mirror value, we move our value into relative space of [0, rangeX2), then use + // the first half of the range for our "[min, max)" range, and the second half for our "[max, min)" mirrored range. + + float relativeValue = value - min; + float range = max - min; + float rangeX2 = range * 2.0f; + + // A positive relativeValue will produce a value of [0, rangeX2) from a single mod, but a negative relativeValue + // will produce a value of (-rangeX2, 0]. Adding rangeX2 to the result and taking the mod again puts us back in + // the range of [0, rangeX2) for both negative and positive values. This keeps our mirroring pattern consistent and + // unbroken across both negative and positive coordinate space. + relativeValue = AZ::Mod(AZ::Mod(relativeValue, rangeX2) + rangeX2, rangeX2); + + // [range, rangeX2) is our mirrored range, so flip the value when we're in this range and apply the epsilon so that + // we never return the max value, and so that our mirrored values have consistent spacing in the results. + if (relativeValue >= range) + { + relativeValue = rangeX2 - (relativeValue + UvEpsilon); + } + + return relativeValue + min; + }; + + return AZ::Vector3( + GetMirror(point.GetX(), bounds.GetMin().GetX(), bounds.GetMax().GetX()), + GetMirror(point.GetY(), bounds.GetMin().GetY(), bounds.GetMax().GetY()), + GetMirror(point.GetZ(), bounds.GetMin().GetZ(), bounds.GetMax().GetZ())); + } + + AZ::Vector3 GradientTransform::GetRelativePointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds) + { + return point - bounds.GetMin(); + } +} diff --git a/Gems/GradientSignal/Code/Source/Util.cpp b/Gems/GradientSignal/Code/Source/Util.cpp deleted file mode 100644 index d9ebf36aec..0000000000 --- a/Gems/GradientSignal/Code/Source/Util.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include -#include -#include -#include -#include - - -namespace GradientSignal -{ - // To keep things behaving consistently between clamped and unbounded uv ranges, we - // we want our clamped uvs to use a range of [min, max), so we'll actually clamp to - // [min, max - epsilon]. Since our floating-point numbers are likely in the - // -16384 to 16384 range, an epsilon of 0.001 will work without rounding to 0. - static const float uvEpsilon = 0.001f; - - AZ::Vector3 GetUnboundedPointInAabb(const AZ::Vector3& point, const AZ::Aabb& /*bounds*/) - { - return point; - } - - AZ::Vector3 GetClampedPointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds) - { - // We want the clamped sampling states to clamp uvs to the [min, max) range. - return AZ::Vector3( - AZ::GetClamp(point.GetX(), bounds.GetMin().GetX(), bounds.GetMax().GetX() - uvEpsilon), - AZ::GetClamp(point.GetY(), bounds.GetMin().GetY(), bounds.GetMax().GetY() - uvEpsilon), - AZ::GetClamp(point.GetZ(), bounds.GetMin().GetZ(), bounds.GetMax().GetZ() - uvEpsilon)); - } - - float GetMirror(float value, float min, float max) - { - float relativeValue = value - min; - float range = max - min; - float rangeX2 = range * 2.0f; - if (relativeValue < 0.0) - { - relativeValue = rangeX2 - fmod(-relativeValue, rangeX2); - } - else - { - relativeValue = fmod(relativeValue, rangeX2); - } - if (relativeValue >= range) - { - // Since we want our uv range to stay in the [min, max) range, - // it means that for mirroring, we want both the "forward" values - // and the "mirrored" values to be in [0, range). We don't want - // relativeValue == range, so we shift relativeValue by a small epsilon - // in the mirrored case. - relativeValue = rangeX2 - (relativeValue + uvEpsilon); - } - - return relativeValue + min; - } - - AZ::Vector3 GetMirroredPointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds) - { - return AZ::Vector3( - GetMirror(point.GetX(), bounds.GetMin().GetX(), bounds.GetMax().GetX()), - GetMirror(point.GetY(), bounds.GetMin().GetY(), bounds.GetMax().GetY()), - GetMirror(point.GetZ(), bounds.GetMin().GetZ(), bounds.GetMax().GetZ())); - } - - AZ::Vector3 GetRelativePointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds) - { - return point - bounds.GetMin(); - } -} diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalTransformTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalTransformTests.cpp new file mode 100644 index 0000000000..73dabf1d6a --- /dev/null +++ b/Gems/GradientSignal/Code/Tests/GradientSignalTransformTests.cpp @@ -0,0 +1,284 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * 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 "Tests/GradientSignalTestMocks.h" + +#include +#include +#include +#include +#include + +#include + +namespace UnitTest +{ + struct GradientSignalTransformTestsFixture : public GradientSignalTest + { + // By default, we'll use a shape half extents of (5, 10, 20) for every test, and a world translation of (100, 200, 300). + struct GradientTransformSetupData + { + GradientSignal::WrappingType m_wrappingType{ GradientSignal::WrappingType::None }; + AZ::Vector3 m_shapeHalfExtents{ 5.0f, 10.0f, 20.0f }; + AZ::Vector3 m_worldTranslation{ 100.0f, 200.0f, 300.0f }; + float m_frequencyZoom{ 1.0f }; + }; + + struct GradientTransformTestData + { + AZ::Vector3 m_positionToTest; + AZ::Vector3 m_expectedOutputUVW; + bool m_expectedOutputRejectionResult; + }; + + static constexpr float UvEpsilon = GradientSignal::GradientTransform::UvEpsilon; + + void TestGradientTransform(const GradientTransformSetupData& setup, const GradientTransformTestData& test) + { + AZ::Aabb shapeBounds = AZ::Aabb::CreateCenterHalfExtents(AZ::Vector3::CreateZero(), setup.m_shapeHalfExtents); + AZ::Matrix3x4 transform = AZ::Matrix3x4::CreateTranslation(setup.m_worldTranslation); + float frequencyZoom = setup.m_frequencyZoom; + GradientSignal::WrappingType wrappingType = setup.m_wrappingType; + + AZ::Vector3 outUVW; + bool wasPointRejected; + + // Perform the query with a 3D gradient and verify that the results match expectations. + GradientSignal::GradientTransform gradientTransform3d(shapeBounds, transform, true, frequencyZoom, wrappingType); + gradientTransform3d.TransformPositionToUVW(test.m_positionToTest, outUVW, wasPointRejected); + EXPECT_THAT(outUVW, IsClose(test.m_expectedOutputUVW)); + EXPECT_EQ(wasPointRejected, test.m_expectedOutputRejectionResult); + + // Perform the query with a 2D gradient and verify that the results match, but always returns a W value of 0. + GradientSignal::GradientTransform gradientTransform2d(shapeBounds, transform, false, frequencyZoom, wrappingType); + gradientTransform2d.TransformPositionToUVW(test.m_positionToTest, outUVW, wasPointRejected); + EXPECT_THAT(outUVW, IsClose(AZ::Vector3(test.m_expectedOutputUVW.GetX(), test.m_expectedOutputUVW.GetY(), 0.0f))); + EXPECT_EQ(wasPointRejected, test.m_expectedOutputRejectionResult); + } + }; + + TEST_F(GradientSignalTransformTestsFixture, UnboundedWrappingReturnsTranslatedInput) + { + GradientTransformSetupData setup = { GradientSignal::WrappingType::None }; + GradientTransformTestData test = { + // Input position to query + { 0.0f, 0.0f, 0.0f }, + + // Output: For no wrapping, the output is just the input position offset by the world translation. + { -100.0f, -200.0f, -300.0f }, false + }; + + TestGradientTransform(setup, test); + } + + TEST_F(GradientSignalTransformTestsFixture, ClampToEdgeReturnsValuesClampedToShapeBounds) + { + GradientTransformSetupData setup = { GradientSignal::WrappingType::ClampToEdge }; + GradientTransformTestData tests[] = { + // Test: Input point far below minimum shape bounds + // Our input point is below the minimum of shape bounds, so the result should be the minimum corner of the shape. + { { 0.0f, 0.0f, 0.0f }, { -5.0f, -10.0f, -20.0f }, false }, + + // Test: Input point directly on minimum shape bounds + // Our input point is directly on the minimum of shape bounds, so the result should be the minimum corner of the shape. + { { 95.0f, 190.0f, 280.0f }, { -5.0f, -10.0f, -20.0f }, false }, + + // Test: Input point inside shape bounds + // Our input point is inside the shape bounds, so the result is just input - translation. + { { 101.0f, 202.0f, 303.0f }, { 1.0f, 2.0f, 3.0f }, false }, + + // Test: Input point directly on maximum shape bounds + // On the maximum side, GradientTransform clamps to "max - epsilon" for consistency with other wrapping types, so our + // expected results are the max shape corner - epsilon. + { { 105.0f, 210.0f, 320.0f }, { 5.0f - UvEpsilon, 10.0f - UvEpsilon, 20.0f - UvEpsilon }, false }, + + // Test: Input point far above maximum shape bounds + // On the maximum side, GradientTransform clamps to "max - epsilon" for consistency with other wrapping types, so our + // expected results are the max shape corner - epsilon. + { { 1000.0f, 1000.0f, 1000.0f }, { 5.0f - UvEpsilon, 10.0f - UvEpsilon, 20.0f - UvEpsilon }, false }, + }; + + for (auto& test : tests) + { + TestGradientTransform(setup, test); + } + } + + TEST_F(GradientSignalTransformTestsFixture, MirrorReturnsValuesMirroredBasedOnShapeBounds) + { + /* Here's how the results are expected to work for various inputs when using Mirror wrapping. + * This assumes shape half extents of (5, 10, 20), and a center translation of (100, 200, 300): + * Inputs: Outputs: + * ... ... + * (75, 150, 200) - (85, 170, 240) (-5, -10, -20) to (5, 10, 20) // forward mirror + * (85, 170, 240) - (95, 190, 280) (5, 10, 20) to (-5, -10, -20) // back mirror + * (95, 190, 280) - (105, 210, 320) (-5, -10, -20) to (5, 10, 20) // starting point + * (105, 210, 320) - (115, 230, 360) (5, 10, 20) to (-5, -10, -20) // back mirror + * (115, 230, 360) - (125, 250, 400) (-5, -10, -20) to (5, 10, 20) // forward mirror + * ... ... + * When below the starting point, both forward and back mirrors will be adjusted by UvEpsilon except for points that fall on the + * shape minimums. + * When above the starting point, only back mirrors will be adjusted by UvEpsilon. + */ + + GradientTransformSetupData setup = { GradientSignal::WrappingType::Mirror }; + GradientTransformTestData tests[] = { + // Test: Input exactly 2x below minimum bounds + // When landing exactly on the 2x boundary, we return the minumum shape bounds. There is no adjustment by epsilon + // on the minimum side of the bounds, even when we're in a mirror below the shape bounds. + { { 75.0f, 150.0f, 200.0f }, { -5.0f, -10.0f, -20.0f }, false }, + + // Test: Input within 2nd mirror repeat below minimum bounds + // The second mirror repeat should go forward in values, but will be adjusted by UvEpsilon since we're below the + // minimum bounds. + { { 84.0f, 168.0f, 237.0f }, { 4.0f - UvEpsilon, 8.0f - UvEpsilon, 17.0f - UvEpsilon }, false }, + + // Test: Input exactly 1x below minimum bounds. + // When landing exactly on the 1x boundary, we return the maximum shape bounds minus epsilon. + { { 85.0f, 170.0f, 240.0f }, { 5.0f - UvEpsilon, 10.0f - UvEpsilon, 20.0f - UvEpsilon }, false }, + + // Test: Input within 1st mirror repeat below minimum bounds + // The first mirror repeat should go backwards in values, but will be adjusted by UvEpsilon since we're below the + // minimum bounds. + { { 94.0f, 188.0f, 277.0f }, { -4.0f - UvEpsilon, -8.0f - UvEpsilon, -17.0f - UvEpsilon }, false }, + + // Test: Input inside shape bounds + // The translated input position is (1, 2, 3) is inside the shape bounds, so we should just get the translated + // position back as output. + { { 101.0f, 202.0f, 303.0f }, { 1.0f, 2.0f, 3.0f }, false }, + + // Test: Input within 1st mirror repeat above maximum bounds + // The first mirror repeat should go backwards in values. We're above the maximum bounds, so the expected result + // is (4, 8, 17) minus an epsilon. + { { 106.0f, 212.0f, 323.0f }, { 4.0f - UvEpsilon, 8.0f - UvEpsilon, 17.0f - UvEpsilon }, false }, + + // Test: Input exactly 2x above minimum bounds. + // When landing exactly on the 2x boundary, we return the exact minimum value again. + { { 115.0f, 230.0f, 360.0f }, { -5.0f, -10.0f, -20.0f }, false }, + + // Test: Input within 2nd mirror repeat above maximum bounds + // The second mirror repeat should go forwards in values. We're above the maximum bounds, so the expected result + // is (-4, -8, -17) with no epsilon. + { { 116.0f, 232.0f, 363.0f }, { -4.0f, -8.0f, -17.0f }, false }, + + // Test: Input exactly 2x above maximum bounds + // When landing exactly on the 2x boundary, we return the maximum adjusted by the epsilon again. + { { 125.0f, 250.0f, 400.0f }, { 5.0f - UvEpsilon, 10.0f - UvEpsilon, 20.0f - UvEpsilon }, false } + }; + + for (auto& test : tests) + { + TestGradientTransform(setup, test); + } + } + + TEST_F(GradientSignalTransformTestsFixture, RepeatReturnsRepeatingValuesBasedOnShapeBounds) + { + /* Here's how the results are expected to work for various inputs when using Repeat wrapping. + * This assumes shape half extents of (5, 10, 20), and a center translation of (100, 200, 300): + * Inputs: Outputs: + * ... ... + * (75, 150, 200) - (85, 170, 240) (-5, -10, -20) to (5, 10, 20) + * (85, 170, 240) - (95, 190, 280) (-5, -10, -20) to (5, 10, 20) + * (95, 190, 280) - (105, 210, 320) (-5, -10, -20) to (5, 10, 20) // starting point + * (105, 210, 320) - (115, 230, 360) (-5, -10, -20) to (5, 10, 20) + * (115, 230, 360) - (125, 250, 400) (-5, -10, -20) to (5, 10, 20) + * ... ... + * Every shape min/max boundary point below the starting point will have the max shape value. + * Every shape min/max boundary point above the starting point with have the min shape value. + */ + + + GradientTransformSetupData setup = { GradientSignal::WrappingType::Repeat }; + GradientTransformTestData tests[] = { + // Test: 2x below minimum shape bounds + // We're on a shape boundary below the minimum bounds, so it should return the maximum. + { { 75.0f, 150.0f, 200.0f }, { 5.0f, 10.0f, 20.0f }, false }, + + // Test: Input within 2nd repeat below minimum shape bounds + // Every repeat should go forwards in values. + { { 76.0f, 152.0f, 203.0f }, { -4.0f, -8.0f, -17.0f }, false }, + + // Test: 1x below minimum shape bounds + // We're on a shape boundary below the minimum bounds, so it should return the maximum. + { { 85.0f, 170.0f, 240.0f }, { 5.0f, 10.0f, 20.0f }, false }, + + // Test: Input within 1st repeat below minimum shape bounds + // Every repeat should go forwards in values. + { { 86.0f, 172.0f, 243.0f }, { -4.0f, -8.0f, -17.0f }, false }, + + // Test: Input exactly on minimum shape bounds + // This should return the actual minimum bounds. + { { 95.0f, 190.0f, 280.0f }, { -5.0f, -10.0f, -20.0f }, false }, + + // Test: Input inside shape bounds + // This should return the mapped value. + { { 101.0f, 202.0f, 303.0f }, { 1.0f, 2.0f, 3.0f }, false }, + + // Test: Input exactly on maximum shape bounds + // We're on a shape boundary above the minimum bounds, so it should return the minimum. + { { 105.0f, 210.0f, 320.0f }, { -5.0f, -10.0f, -20.0f }, false }, + + // Test: Input within 1st repeat above maximum shape bounds + // Every repeat should go forwards in values. + { { 106.0f, 212.0f, 323.0f }, { -4.0f, -8.0f, -17.0f }, false }, + + // Test: 1x above maximum shape bounds + // We're on a shape boundary above the minimum bounds, so it should return the minimum. + { { 105.0f, 210.0f, 320.0f }, { -5.0f, -10.0f, -20.0f }, false }, + + // Test: Input within 2nd repeat above maximum shape bounds + // Every repeat should go forwards in values. + { { 106.0f, 212.0f, 323.0f }, { -4.0f, -8.0f, -17.0f }, false }, + }; + + for (auto& test : tests) + { + TestGradientTransform(setup, test); + } + } + + TEST_F(GradientSignalTransformTestsFixture, ClampToZeroReturnsClampedValuesBasedOnShapeBounds) + { + GradientTransformSetupData setup = { GradientSignal::WrappingType::ClampToZero }; + GradientTransformTestData tests[] = { + // Test: Input point far below minimum shape bounds + // Our input point is below the minimum of shape bounds, so the result should be the minimum corner of the shape. + // Points outside the shape bounds should return "true" for rejected. + { { 0.0f, 0.0f, 0.0f }, { -5.0f, -10.0f, -20.0f }, true }, + + // Test: Input point directly on minimum shape bounds + // Our input point is directly on the minimum of shape bounds, so the result should be the minimum corner of the shape. + { { 95.0f, 190.0f, 280.0f }, { -5.0f, -10.0f, -20.0f }, false }, + + // Test: Input point inside shape bounds + // Our input point is inside the shape bounds, so the result is just input - translation. + { { 101.0f, 202.0f, 303.0f }, { 1.0f, 2.0f, 3.0f }, false }, + + // Test: Input point directly on maximum shape bounds + // On the maximum side, GradientTransform clamps to "max - epsilon" for consistency with other wrapping types, so our + // expected results are the max shape corner - epsilon. + // Points outside the shape bounds (which includes the maximum edge of the shape bounds) should return "true" for rejected. + { { 105.0f, 210.0f, 320.0f }, { 5.0f - UvEpsilon, 10.0f - UvEpsilon, 20.0f - UvEpsilon }, true }, + + // Test: Input point far above maximum shape bounds + // On the maximum side, GradientTransform clamps to "max - epsilon" for consistency with other wrapping types, so our + // expected results are the max shape corner - epsilon. + // Points outside the shape bounds should return "true" for rejected. + { { 1000.0f, 1000.0f, 1000.0f }, { 5.0f - UvEpsilon, 10.0f - UvEpsilon, 20.0f - UvEpsilon }, true }, + }; + + for (auto& test : tests) + { + TestGradientTransform(setup, test); + } + } +} + + diff --git a/Gems/GradientSignal/Code/gradientsignal_files.cmake b/Gems/GradientSignal/Code/gradientsignal_files.cmake index 5b28150eb4..7318f18739 100644 --- a/Gems/GradientSignal/Code/gradientsignal_files.cmake +++ b/Gems/GradientSignal/Code/gradientsignal_files.cmake @@ -8,6 +8,7 @@ set(FILES Include/GradientSignal/GradientSampler.h + Include/GradientSignal/GradientTransform.h Include/GradientSignal/SmoothStep.h Include/GradientSignal/ImageAsset.h Include/GradientSignal/ImageSettings.h @@ -77,10 +78,10 @@ set(FILES Source/GradientSampler.cpp Source/GradientSignalSystemComponent.cpp Source/GradientSignalSystemComponent.h + Source/GradientTransform.cpp Source/SmoothStep.cpp Source/ImageAsset.cpp Source/ImageSettings.cpp Source/PerlinImprovedNoise.cpp - Source/Util.cpp Source/GradientImageConversion.cpp ) diff --git a/Gems/GradientSignal/Code/gradientsignal_tests_files.cmake b/Gems/GradientSignal/Code/gradientsignal_tests_files.cmake index 8c8a4c25e1..5f8ffe2ebb 100644 --- a/Gems/GradientSignal/Code/gradientsignal_tests_files.cmake +++ b/Gems/GradientSignal/Code/gradientsignal_tests_files.cmake @@ -11,6 +11,7 @@ set(FILES Tests/GradientSignalReferencesTests.cpp Tests/GradientSignalServicesTests.cpp Tests/GradientSignalSurfaceTests.cpp + Tests/GradientSignalTransformTests.cpp Tests/GradientSignalTestMocks.h Tests/GradientSignalTest.cpp Tests/ImageAssetTests.cpp From 2f1346c719d5e6ed9c2c9a878bb13e9a75d34c69 Mon Sep 17 00:00:00 2001 From: Ken Pruiksma Date: Wed, 29 Dec 2021 16:38:28 -0600 Subject: [PATCH 260/948] Terrain Feature Processor separated into several classes. Macro materials abstracted from meshes. (#6350) * Breaking up terrain FP wip - macro materials decoupled from meshes. Mesh creation and rendering pulled out from MeshFeatureProcessor into TerrainMeshManager. Stubs added for macro and detail material managers. Signed-off-by: Ken Pruiksma * Separated macro material management from the terrain feature processor. Also separated bindless image array handling from terrain feature processor. Signed-off-by: Ken Pruiksma * Detail materials separated from terrain feature processor. Also pulled out Aabb2i and Vector2i into their own simple classes Signed-off-by: Ken Pruiksma * Changed some classes so that when the SRG changes the classes don't need to be completely reinitialized and can instead just update their indices and push data to the new srg. Fixed an issue where MacroMaterialData wasn't being exposed to ScriptCanvas. Terrain shader reloads should now work correctly. Also added some debug logging to help catch an issue where sometimes detail materials don't seem to load. Signed-off-by: Ken Pruiksma * Terrain PR reveiw updates Signed-off-by: Ken Pruiksma * Some small PR review fixes. More comments in TerrainDetailMaterialManager.h Signed-off-by: Ken Pruiksma * Fixing unused variable causing clang failure Signed-off-by: Ken Pruiksma * Fixing unused variable in release. Signed-off-by: Ken Pruiksma * Fixing a forward declare that oddly didn't work on linux. Signed-off-by: Ken Pruiksma * Fixing linux missing include... not sure why only linux failed on this. Signed-off-by: Ken Pruiksma * Adding missing include Signed-off-by: Ken Pruiksma --- .../ShaderResourceGroups/SceneSrgAll.azsli | 1 + .../ShaderResourceGroups/ViewSrgAll.azsli | 1 - .../Code/Source/Utils/GpuBufferHandler.cpp | 6 +- .../Terrain/DefaultPbrTerrain.material | 2 +- .../Materials/Terrain/PbrTerrain.materialtype | 2 +- .../Assets/Shaders/Terrain/SceneSrg.azsli | 35 + .../Shaders/Terrain/TerrainCommon.azsli | 237 +-- .../Terrain/TerrainDetailHelpers.azsli | 14 +- .../Terrain/TerrainPBR_ForwardPass.azsl | 117 +- .../Assets/Shaders/Terrain/TerrainSrg.azsli | 28 +- .../Shaders/Terrain/Terrain_DepthPass.azsl | 28 +- .../Assets/Shaders/Terrain/ViewSrg.azsli | 80 - .../Code/Source/TerrainRenderer/Aabb2i.cpp | 44 + .../Code/Source/TerrainRenderer/Aabb2i.h | 34 + .../BindlessImageArrayHandler.cpp | 101 ++ .../BindlessImageArrayHandler.h | 48 + .../TerrainDetailMaterialManager.cpp | 912 ++++++++++ .../TerrainDetailMaterialManager.h | 226 +++ .../TerrainFeatureProcessor.cpp | 1614 ++--------------- .../TerrainRenderer/TerrainFeatureProcessor.h | 314 +--- .../TerrainMacroMaterialBus.cpp | 19 + .../TerrainRenderer/TerrainMacroMaterialBus.h | 6 +- .../TerrainMacroMaterialManager.cpp | 412 +++++ .../TerrainMacroMaterialManager.h | 116 ++ .../TerrainRenderer/TerrainMeshManager.cpp | 354 ++++ .../TerrainRenderer/TerrainMeshManager.h | 117 ++ .../Code/Source/TerrainRenderer/Vector2i.cpp | 41 + .../Code/Source/TerrainRenderer/Vector2i.h | 29 + Gems/Terrain/Code/terrain_files.cmake | 12 + 29 files changed, 2965 insertions(+), 1985 deletions(-) create mode 100644 Gems/Terrain/Assets/Shaders/Terrain/SceneSrg.azsli delete mode 100644 Gems/Terrain/Assets/Shaders/Terrain/ViewSrg.azsli create mode 100644 Gems/Terrain/Code/Source/TerrainRenderer/Aabb2i.cpp create mode 100644 Gems/Terrain/Code/Source/TerrainRenderer/Aabb2i.h create mode 100644 Gems/Terrain/Code/Source/TerrainRenderer/BindlessImageArrayHandler.cpp create mode 100644 Gems/Terrain/Code/Source/TerrainRenderer/BindlessImageArrayHandler.h create mode 100644 Gems/Terrain/Code/Source/TerrainRenderer/TerrainDetailMaterialManager.cpp create mode 100644 Gems/Terrain/Code/Source/TerrainRenderer/TerrainDetailMaterialManager.h create mode 100644 Gems/Terrain/Code/Source/TerrainRenderer/TerrainMacroMaterialManager.cpp create mode 100644 Gems/Terrain/Code/Source/TerrainRenderer/TerrainMacroMaterialManager.h create mode 100644 Gems/Terrain/Code/Source/TerrainRenderer/TerrainMeshManager.cpp create mode 100644 Gems/Terrain/Code/Source/TerrainRenderer/TerrainMeshManager.h create mode 100644 Gems/Terrain/Code/Source/TerrainRenderer/Vector2i.cpp create mode 100644 Gems/Terrain/Code/Source/TerrainRenderer/Vector2i.h diff --git a/Gems/Atom/Feature/Common/Assets/ShaderResourceGroups/SceneSrgAll.azsli b/Gems/Atom/Feature/Common/Assets/ShaderResourceGroups/SceneSrgAll.azsli index 421178bb01..4480524468 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderResourceGroups/SceneSrgAll.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderResourceGroups/SceneSrgAll.azsli @@ -13,4 +13,5 @@ #ifdef AZ_COLLECTING_PARTIAL_SRGS #include #include +#include // Temporary until gem partial view srgs can be included automatically. #endif diff --git a/Gems/Atom/Feature/Common/Assets/ShaderResourceGroups/ViewSrgAll.azsli b/Gems/Atom/Feature/Common/Assets/ShaderResourceGroups/ViewSrgAll.azsli index 9253885cfc..3e90e1a441 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderResourceGroups/ViewSrgAll.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderResourceGroups/ViewSrgAll.azsli @@ -12,5 +12,4 @@ #ifdef AZ_COLLECTING_PARTIAL_SRGS #include -#include // Temporary until gem partial view srgs can be included automatically. #endif diff --git a/Gems/Atom/Feature/Common/Code/Source/Utils/GpuBufferHandler.cpp b/Gems/Atom/Feature/Common/Code/Source/Utils/GpuBufferHandler.cpp index 7a2827bebe..65bdf655a7 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Utils/GpuBufferHandler.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/Utils/GpuBufferHandler.cpp @@ -24,14 +24,14 @@ namespace AZ { m_elementSize = descriptor.m_elementSize; m_elementCount = 0; - + m_bufferIndex = descriptor.m_srgLayout->FindShaderInputBufferIndex(Name(descriptor.m_bufferSrgName)); - AZ_Error(ClassName, m_bufferIndex.IsValid(), "Unable to find %s in view shader resource group.", descriptor.m_bufferSrgName.c_str()); + AZ_Error(ClassName, m_bufferIndex.IsValid(), "Unable to find %s in %s shader resource group.", descriptor.m_bufferSrgName.c_str(), descriptor.m_srgLayout->GetName().GetCStr()); if (!descriptor.m_elementCountSrgName.empty()) { m_elementCountIndex = descriptor.m_srgLayout->FindShaderInputConstantIndex(Name(descriptor.m_elementCountSrgName)); - AZ_Error(ClassName, m_elementCountIndex.IsValid(), "Unable to find %s in view shader resource group.", descriptor.m_elementCountSrgName.c_str()); + AZ_Error(ClassName, m_elementCountIndex.IsValid(), "Unable to find %s in %s shader resource group.", descriptor.m_elementCountSrgName.c_str(), descriptor.m_srgLayout->GetName().GetCStr()); } if (m_bufferIndex.IsValid()) diff --git a/Gems/Terrain/Assets/Materials/Terrain/DefaultPbrTerrain.material b/Gems/Terrain/Assets/Materials/Terrain/DefaultPbrTerrain.material index 53f6fd5b9e..da2fc95293 100644 --- a/Gems/Terrain/Assets/Materials/Terrain/DefaultPbrTerrain.material +++ b/Gems/Terrain/Assets/Materials/Terrain/DefaultPbrTerrain.material @@ -5,7 +5,7 @@ "propertyLayoutVersion": 1, "properties": { "baseColor": { - "color": [ 0.18, 0.18, 0.18 ] + "color": [ 0.18, 0.18, 0.18 ] } } } diff --git a/Gems/Terrain/Assets/Materials/Terrain/PbrTerrain.materialtype b/Gems/Terrain/Assets/Materials/Terrain/PbrTerrain.materialtype index 1e7305cc11..836e85661d 100644 --- a/Gems/Terrain/Assets/Materials/Terrain/PbrTerrain.materialtype +++ b/Gems/Terrain/Assets/Materials/Terrain/PbrTerrain.materialtype @@ -107,7 +107,7 @@ "displayName": "Detail Texture UV Multiplier", "description": "How many times to repeat the detail texture per sector", "type": "Float", - "defaultValue": 8.0, + "defaultValue": 0.5, "connection": { "type": "ShaderInput", "id": "m_detailTextureMultiplier" diff --git a/Gems/Terrain/Assets/Shaders/Terrain/SceneSrg.azsli b/Gems/Terrain/Assets/Shaders/Terrain/SceneSrg.azsli new file mode 100644 index 0000000000..2545db7c93 --- /dev/null +++ b/Gems/Terrain/Assets/Shaders/Terrain/SceneSrg.azsli @@ -0,0 +1,35 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#ifndef AZ_COLLECTING_PARTIAL_SRGS +#error Do not include this file directly. Include the main .srgi file instead. +#endif + +partial ShaderResourceGroup SceneSrg +{ + Sampler HeightmapSampler + { + MinFilter = Linear; + MagFilter = Linear; + MipFilter = Point; + AddressU = Clamp; + AddressV = Clamp; + AddressW = Clamp; + }; + + struct TerrainWorldData + { + float3 m_min; + float m_padding1; + float3 m_max; + float m_padding2; + }; + + Texture2D m_heightmapImage; + TerrainWorldData m_terrainWorldData; +} diff --git a/Gems/Terrain/Assets/Shaders/Terrain/TerrainCommon.azsli b/Gems/Terrain/Assets/Shaders/Terrain/TerrainCommon.azsli index 770f877ea8..ee3e9b2a5f 100644 --- a/Gems/Terrain/Assets/Shaders/Terrain/TerrainCommon.azsli +++ b/Gems/Terrain/Assets/Shaders/Terrain/TerrainCommon.azsli @@ -15,34 +15,13 @@ ShaderResourceGroup ObjectSrg : SRG_PerObject { - struct TerrainData + struct PatchData { - float2 m_uvMin; - float2 m_uvMax; - float2 m_uvStep; - float m_sampleSpacing; - float m_heightScale; + float2 m_xyTranslation; + float m_xyScale; }; - struct MacroMaterialData - { - float2 m_uvMin; - float2 m_uvMax; - float m_normalFactor; - bool m_flipNormalX; - bool m_flipNormalY; - uint m_mapsInUse; - }; - - row_major float3x4 m_modelToWorld; - - TerrainData m_terrainData; - - MacroMaterialData m_macroMaterialData[4]; - uint m_macroMaterialCount; - - Texture2D m_macroColorMap[4]; - Texture2D m_macroNormalMap[4]; + PatchData m_patchData; // The below shouldn't be in this SRG but needs to be for now because the lighting functions depend on them. @@ -117,109 +96,137 @@ option bool o_useTerrainSmoothing = false; struct VertexInput { float2 m_position : POSITION; - float2 m_uv : UV; }; -// Sample a texture with a 5 tap B-Spline. Consider ripping this out and putting in a more general location. -// This function samples a 4x4 neighborhood around the uv. Normally this would take 16 samples, but by taking -// advantage of bilinear filtering this can be done with 9 taps on the edges between pixels. The cost is further -// reduced by dropping the diagonals. -float SampleBSpline5Tap(Texture2D texture, SamplerState textureSampler, float2 uv, float2 textureSize, float2 rcpTextureSize) +// This class is used to calculate heights and normals for terrain. Using a class for this was the easiest way to +// de-duplicate code between the forward and depth shaders. +class HeightContext { - // Think of sample locations in the 4x4 neighborhood as having a top left coordinate of 0,0 and - // a bottom right coordinate of 3,3. - - // Find the position in texture space then round it to get the center of the 1,1 pixel (tc1) - float2 texelPos = uv * textureSize; - float2 tc1= floor(texelPos - 0.5) + 0.5; - - // Offset from center position to texel - float2 f = texelPos - tc1; - - // Compute B-Spline weights based on the offset - float2 OneMinusF = (1.0 - f); - float2 OneMinusF2 = OneMinusF * OneMinusF; - float2 OneMinusF3 = OneMinusF2 * OneMinusF; - float2 w0 = OneMinusF3; - float2 w1 = 4.0 + 3.0 * f * f * f - 6.0 * f * f; - float2 w2 = 4.0 + 3.0 * OneMinusF3 - 6.0 * OneMinusF2; - float2 w3 = f * f * f; - - float2 w12 = w1 + w2; - - // Compute uv coordinates for sampling the texture - float2 tc0 = (tc1 - 1.0f) * rcpTextureSize; - float2 tc3 = (tc1 + 2.0f) * rcpTextureSize; - float2 tc12 = (tc1 + w2 / w12) * rcpTextureSize; - - // Compute sample weights - float sw0 = w12.x * w12.y; // middle - float sw1 = w12.x * w0.y; // top - float sw2 = w0.x * w12.y; // left - float sw3 = w12.x * w3.y; // bottom - float sw4 = w3.x * w12.y; // right - - // total weight of samples to normalize result. - float totalWeight = sw0 + sw1 + sw2 + sw3 + sw4; - - float result = 0.0f; - result += texture.SampleLevel(textureSampler, float2(tc12.x, tc12.y), 0.0).r * sw0; - result += texture.SampleLevel(textureSampler, float2(tc12.x, tc0.y), 0.0).r * sw1; - result += texture.SampleLevel(textureSampler, float2( tc0.x, tc12.y), 0.0).r * sw2; - result += texture.SampleLevel(textureSampler, float2(tc12.x, tc3.y), 0.0).r * sw3; - result += texture.SampleLevel(textureSampler, float2( tc3.x, tc12.y), 0.0).r * sw4; - - return result / totalWeight; -} + float3 m_worldMin; + float3 m_worldMax; + float2 m_xyPosition; -float4x4 GetObject_WorldMatrix() -{ - float4x4 modelToWorld = float4x4( - float4(1, 0, 0, 0), - float4(0, 1, 0, 0), - float4(0, 0, 1, 0), - float4(0, 0, 0, 1)); - - modelToWorld[0] = ObjectSrg::m_modelToWorld[0]; - modelToWorld[1] = ObjectSrg::m_modelToWorld[1]; - modelToWorld[2] = ObjectSrg::m_modelToWorld[2]; - return modelToWorld; -} + float2 m_textureSize; + float2 m_rcpTextureSize; + float2 m_sampleSpacing; + float2 m_rcpSampleSpacing; -float GetHeight(float2 origUv) -{ - float2 halfStep = ObjectSrg::m_terrainData.m_uvStep * 0.5; - float2 uv = origUv * (1.0 - ObjectSrg::m_terrainData.m_uvStep) + halfStep; + float m_heightScale; + int2 m_heightmapCoord; - float height = 0.0f; - if (o_useTerrainSmoothing) + + // Sample a texture with a 5 tap B-Spline. Consider ripping this out and putting in a more general location. + // This function samples a 4x4 neighborhood around the uv. Normally this would take 16 samples, but by taking + // advantage of bilinear filtering this can be done with 9 taps on the edges between pixels. The cost is further + // reduced by dropping the diagonals. + float SampleBSpline5Tap(Texture2D texture, SamplerState textureSampler, float2 uv, float2 textureSize, float2 rcpTextureSize) { - float2 textureSize; - ViewSrg::m_heightmapImage.GetDimensions(textureSize.x, textureSize.y); - height = SampleBSpline5Tap(ViewSrg::m_heightmapImage, ViewSrg::HeightmapSampler, uv, textureSize, rcp(textureSize)); + // Think of sample locations in the 4x4 neighborhood as having a top left coordinate of 0,0 and + // a bottom right coordinate of 3,3. + + // Find the position in texture space then round it to get the center of the 1,1 pixel (tc1) + float2 texelPos = uv * textureSize; + float2 tc1= floor(texelPos - 0.5) + 0.5; + + // Offset from center position to texel + float2 f = texelPos - tc1; + + // Compute B-Spline weights based on the offset + float2 OneMinusF = (1.0 - f); + float2 OneMinusF2 = OneMinusF * OneMinusF; + float2 OneMinusF3 = OneMinusF2 * OneMinusF; + float2 w0 = OneMinusF3; + float2 w1 = 4.0 + 3.0 * f * f * f - 6.0 * f * f; + float2 w2 = 4.0 + 3.0 * OneMinusF3 - 6.0 * OneMinusF2; + float2 w3 = f * f * f; + + float2 w12 = w1 + w2; + + // Compute uv coordinates for sampling the texture + float2 tc0 = (tc1 - 1.0f) * rcpTextureSize; + float2 tc3 = (tc1 + 2.0f) * rcpTextureSize; + float2 tc12 = (tc1 + w2 / w12) * rcpTextureSize; + + // Compute sample weights + float sw0 = w12.x * w12.y; // middle + float sw1 = w12.x * w0.y; // top + float sw2 = w0.x * w12.y; // left + float sw3 = w12.x * w3.y; // bottom + float sw4 = w3.x * w12.y; // right + + // total weight of samples to normalize result. + float totalWeight = sw0 + sw1 + sw2 + sw3 + sw4; + + float result = 0.0f; + result += texture.SampleLevel(textureSampler, float2(tc12.x, tc12.y), 0.0).r * sw0; + result += texture.SampleLevel(textureSampler, float2(tc12.x, tc0.y), 0.0).r * sw1; + result += texture.SampleLevel(textureSampler, float2( tc0.x, tc12.y), 0.0).r * sw2; + result += texture.SampleLevel(textureSampler, float2(tc12.x, tc3.y), 0.0).r * sw3; + result += texture.SampleLevel(textureSampler, float2( tc3.x, tc12.y), 0.0).r * sw4; + + return result / totalWeight; } - else + + float2 GetWorldXYPosition(in ObjectSrg::PatchData patchData, in float2 vertexPosition) { - height = ViewSrg::m_heightmapImage.SampleLevel(ViewSrg::HeightmapSampler, uv, 0).r; + return float2(patchData.m_xyTranslation + vertexPosition * patchData.m_xyScale); } - return ObjectSrg::m_terrainData.m_heightScale * (height - 0.5f); -} + float2 GetHeightmapUv(in float2 position, in float2 worldMin, in float2 worldMax) + { + return (position - worldMin) / (worldMax - worldMin); + } -float3 GetTerrainWorldPosition(ObjectSrg::TerrainData terrainData, float2 vertexPosition, float2 uv) -{ - // Remove all vertices outside our bounds by turning them into NaN positions. - if (any(uv > 1.0) || any (uv < 0.0)) + int2 GetHeightmapCoord(in float2 position, in float2 rcpSampleSpacing, in float2 worldMin) { - return asfloat(0x7fc00000); // NaN + return int2((position - worldMin) * rcpSampleSpacing); } - // Loop up the height and calculate our final position. - float height = GetHeight(uv); - return mul(GetObject_WorldMatrix(), float4(vertexPosition, height, 1.0f)).xyz; -} + float GetHeight(Texture2D heightmapImage, int2 offset = int2(0, 0)) + { + float height = heightmapImage.Load(int3(m_heightmapCoord + offset, 0)).r; + return m_worldMin.z + height * m_heightScale; + } -float4 GetTerrainProjectedPosition(ObjectSrg::TerrainData terrainData, float2 vertexPosition, float2 uv) -{ - return mul(ViewSrg::m_viewProjectionMatrix, float4(GetTerrainWorldPosition(terrainData, vertexPosition, uv), 1.0)); -} + float GetSmoothedHeight(Texture2D heightmapImage, SamplerState heightmapSampler) + { + float2 uv = GetHeightmapUv(m_xyPosition, m_worldMin.xy, m_worldMax.xy); + float2 halfStep = m_rcpTextureSize * 0.5; + uv = uv * (1.0 - m_rcpTextureSize) + halfStep; + float height = SampleBSpline5Tap(heightmapImage, heightmapSampler, uv, m_textureSize, m_rcpTextureSize); + return m_worldMin.z + height * (m_worldMax.z - m_worldMin.z); + } + + float3 CalculateNormal(Texture2D heightmapImage) + { + float up = GetHeight(heightmapImage, int2( 0, -1)); + float right = GetHeight(heightmapImage, int2( 1, 0)); + float down = GetHeight(heightmapImage, int2( 0, 1)); + float left = GetHeight(heightmapImage, int2(-1, 0)); + + float3 bitangent = normalize(float3(0.0, m_sampleSpacing.y * 2.0f, down - up)); + float3 tangent = normalize(float3(m_sampleSpacing.x * 2.0f, 0.0, right - left)); + return normalize(cross(tangent, bitangent)); + } + + bool IsVertexOutsideOfTerrainBounds() + { + return (any(m_xyPosition < m_worldMin.xy) || + any(m_xyPosition > m_worldMax.xy)); + } + + void Initialize(Texture2D heightmapImage, float2 vertexPosition, ObjectSrg::PatchData patchData, float3 worldMin, float3 worldMax) + { + m_worldMin = worldMin; + m_worldMax = worldMax; + m_xyPosition = GetWorldXYPosition(patchData, vertexPosition); + + heightmapImage.GetDimensions(m_textureSize.x, m_textureSize.y); + m_rcpTextureSize = rcp(m_textureSize); + m_sampleSpacing = (worldMax.xy - worldMin.xy) * m_rcpTextureSize; + m_rcpSampleSpacing = rcp(m_sampleSpacing); + + m_heightScale = worldMax.z - worldMin.z; + m_heightmapCoord = GetHeightmapCoord(m_xyPosition, m_rcpSampleSpacing, worldMin.xy); + } +}; diff --git a/Gems/Terrain/Assets/Shaders/Terrain/TerrainDetailHelpers.azsli b/Gems/Terrain/Assets/Shaders/Terrain/TerrainDetailHelpers.azsli index 33c817c0f9..b18f2885db 100644 --- a/Gems/Terrain/Assets/Shaders/Terrain/TerrainDetailHelpers.azsli +++ b/Gems/Terrain/Assets/Shaders/Terrain/TerrainDetailHelpers.azsli @@ -123,7 +123,7 @@ float3 GetDetailColor(TerrainSrg::DetailMaterialData materialData, float2 uv, fl float3 color = materialData.m_baseColor; if ((materialData.m_flags & DetailTextureFlags::UseTextureBaseColor) > 0) { - color = TerrainSrg::m_detailTextures[GetDetailColorIndex(materialData)].SampleGrad(TerrainMaterialSrg::m_sampler, uv, ddx, ddy).rgb; + color = TerrainSrg::m_textures[GetDetailColorIndex(materialData)].SampleGrad(TerrainMaterialSrg::m_sampler, uv, ddx, ddy).rgb; } return color * materialData.m_baseColorFactor; } @@ -133,7 +133,7 @@ float3 GetDetailNormal(TerrainSrg::DetailMaterialData materialData, float2 uv, f float2 normal = float2(0.0, 0.0); if ((materialData.m_flags & DetailTextureFlags::UseTextureNormal) > 0) { - normal = TerrainSrg::m_detailTextures[GetDetailNormalIndex(materialData)].SampleGrad(TerrainMaterialSrg::m_sampler, uv, ddx, ddy).rg; + normal = TerrainSrg::m_textures[GetDetailNormalIndex(materialData)].SampleGrad(TerrainMaterialSrg::m_sampler, uv, ddx, ddy).rg; } // X and Y are inverted here to be consistent with SampleNormalXY in NormalInput.azsli. @@ -153,7 +153,7 @@ float GetDetailRoughness(TerrainSrg::DetailMaterialData materialData, float2 uv, float roughness = materialData.m_roughnessScale; if ((materialData.m_flags & DetailTextureFlags::UseTextureRoughness) > 0) { - roughness = TerrainSrg::m_detailTextures[GetDetailRoughnessIndex(materialData)].SampleGrad(TerrainMaterialSrg::m_sampler, uv, ddx, ddy).r; + roughness = TerrainSrg::m_textures[GetDetailRoughnessIndex(materialData)].SampleGrad(TerrainMaterialSrg::m_sampler, uv, ddx, ddy).r; roughness = materialData.m_roughnessBias + roughness * materialData.m_roughnessScale; } return roughness; @@ -164,7 +164,7 @@ float GetDetailMetalness(TerrainSrg::DetailMaterialData materialData, float2 uv, float metalness = 1.0; if ((materialData.m_flags & DetailTextureFlags::UseTextureMetallic) > 0) { - metalness = TerrainSrg::m_detailTextures[GetDetailMetalnessIndex(materialData)].SampleGrad(TerrainMaterialSrg::m_sampler, uv, ddx, ddy).r; + metalness = TerrainSrg::m_textures[GetDetailMetalnessIndex(materialData)].SampleGrad(TerrainMaterialSrg::m_sampler, uv, ddx, ddy).r; } return metalness * materialData.m_metalFactor; } @@ -174,7 +174,7 @@ float GetDetailSpecularF0(TerrainSrg::DetailMaterialData materialData, float2 uv float specularF0 = 1.0; if ((materialData.m_flags & DetailTextureFlags::UseTextureSpecularF0) > 0) { - specularF0 = TerrainSrg::m_detailTextures[GetDetailSpecularF0Index(materialData)].SampleGrad(TerrainMaterialSrg::m_sampler, uv, ddx, ddy).r; + specularF0 = TerrainSrg::m_textures[GetDetailSpecularF0Index(materialData)].SampleGrad(TerrainMaterialSrg::m_sampler, uv, ddx, ddy).r; } return specularF0 * materialData.m_specularF0Factor; } @@ -184,7 +184,7 @@ float GetDetailOcclusion(TerrainSrg::DetailMaterialData materialData, float2 uv, float occlusion = 1.0; if ((materialData.m_flags & DetailTextureFlags::UseTextureOcclusion) > 0) { - occlusion = TerrainSrg::m_detailTextures[GetDetailOcclusionIndex(materialData)].SampleGrad(TerrainMaterialSrg::m_sampler, uv, ddx, ddy).r; + occlusion = TerrainSrg::m_textures[GetDetailOcclusionIndex(materialData)].SampleGrad(TerrainMaterialSrg::m_sampler, uv, ddx, ddy).r; } return occlusion * materialData.m_occlusionFactor; } @@ -194,7 +194,7 @@ float GetDetailHeight(TerrainSrg::DetailMaterialData materialData, float2 uv, fl float height = materialData.m_heightFactor; if ((materialData.m_flags & DetailTextureFlags::UseTextureHeight) > 0) { - height = TerrainSrg::m_detailTextures[GetDetailHeightIndex(materialData)].SampleGrad(TerrainMaterialSrg::m_sampler, uv, ddx, ddy).r; + height = TerrainSrg::m_textures[GetDetailHeightIndex(materialData)].SampleGrad(TerrainMaterialSrg::m_sampler, uv, ddx, ddy).r; height = materialData.m_heightOffset + height * materialData.m_heightFactor; } return height; diff --git a/Gems/Terrain/Assets/Shaders/Terrain/TerrainPBR_ForwardPass.azsl b/Gems/Terrain/Assets/Shaders/Terrain/TerrainPBR_ForwardPass.azsl index ab9064e740..741f45d775 100644 --- a/Gems/Terrain/Assets/Shaders/Terrain/TerrainPBR_ForwardPass.azsl +++ b/Gems/Terrain/Assets/Shaders/Terrain/TerrainPBR_ForwardPass.azsl @@ -8,6 +8,7 @@ #include +#include #include #include #include @@ -26,7 +27,6 @@ struct VSOutput float4 m_position : SV_Position; float3 m_normal: NORMAL; float3 m_worldPosition : UV0; - float2 m_uv : UV1; float3 m_shadowCoords[ViewSrg::MaxCascadeCount] : UV2; }; @@ -34,24 +34,30 @@ VSOutput TerrainPBR_MainPassVS(VertexInput IN) { VSOutput OUT; - ObjectSrg::TerrainData terrainData = ObjectSrg::m_terrainData; + HeightContext heightContext; + heightContext.Initialize(SceneSrg::m_heightmapImage, IN.m_position, ObjectSrg::m_patchData, SceneSrg::m_terrainWorldData.m_min, SceneSrg::m_terrainWorldData.m_max); - float2 uv = IN.m_uv; - float2 origUv = lerp(terrainData.m_uvMin, terrainData.m_uvMax, uv); - float3 worldPosition = GetTerrainWorldPosition(terrainData, IN.m_position, origUv); - OUT.m_position = mul(ViewSrg::m_viewProjectionMatrix, float4(worldPosition, 1.0)); - OUT.m_worldPosition = worldPosition; + if (heightContext.IsVertexOutsideOfTerrainBounds()) + { + // Output a NaN to remove this vertex. + OUT.m_position = 1.0 / 0.0; + return OUT; + } - // Calculate normal - float up = GetHeight(origUv + terrainData.m_uvStep * float2( 0.0f, -1.0f)); - float right = GetHeight(origUv + terrainData.m_uvStep * float2( 1.0f, 0.0f)); - float down = GetHeight(origUv + terrainData.m_uvStep * float2( 0.0f, 1.0f)); - float left = GetHeight(origUv + terrainData.m_uvStep * float2(-1.0f, 0.0f)); + float height = 0.0; - float3 bitangent = normalize(float3(0.0, terrainData.m_sampleSpacing * 2.0f, down - up)); - float3 tangent = normalize(float3(terrainData.m_sampleSpacing * 2.0f, 0.0, right - left)); - OUT.m_normal = normalize(cross(tangent, bitangent)); - OUT.m_uv = uv; + if (o_useTerrainSmoothing) + { + height = heightContext.GetSmoothedHeight(SceneSrg::m_heightmapImage, SceneSrg::HeightmapSampler); + } + else + { + height = heightContext.GetHeight(SceneSrg::m_heightmapImage); + } + + OUT.m_worldPosition = float3(heightContext.m_xyPosition, height); + OUT.m_position = mul(ViewSrg::m_viewProjectionMatrix, float4(OUT.m_worldPosition, 1.0)); + OUT.m_normal = heightContext.CalculateNormal(SceneSrg::m_heightmapImage); // directional light shadow const uint shadowIndex = ViewSrg::m_shadowIndexDirectionalLight; @@ -59,7 +65,7 @@ VSOutput TerrainPBR_MainPassVS(VertexInput IN) { DirectionalLightShadow::GetShadowCoords( shadowIndex, - worldPosition, + OUT.m_worldPosition, OUT.m_normal, OUT.m_shadowCoords); } @@ -76,7 +82,7 @@ ForwardPassOutput TerrainPBR_MainPassPS(VSOutput IN) float viewDistance = length(ViewSrg::m_worldPosition - surface.position); float detailFactor = saturate((viewDistance - TerrainMaterialSrg::m_detailFadeDistance) / max(TerrainMaterialSrg::m_detailFadeLength, EPSILON)); - float2 detailUv = IN.m_uv * TerrainMaterialSrg::m_detailTextureMultiplier; + float2 detailUv = IN.m_worldPosition.xy * TerrainMaterialSrg::m_detailTextureMultiplier; // ------- Normal ------- float3 macroNormal = normalize(IN.m_normal); @@ -84,39 +90,54 @@ ForwardPassOutput TerrainPBR_MainPassPS(VSOutput IN) // ------- Macro Color / Normal ------- float3 macroColor = TerrainMaterialSrg::m_baseColor.rgb; - // There's a bug that shows up with an NVidia GTX 1660 Super card happening on driver versions as recent as 496.49 (10/26/21) in which - // the IN.m_uv values will intermittently "flicker" to 0.0 after entering and exiting game mode. - // (See https://github.com/o3de/o3de/issues/5014) - // This bug has only shown up on PCs when using the DX12 RHI. It doesn't show up with Vulkan or when capturing frames with PIX or - // RenderDoc. Our best guess is that it is a driver bug. The workaround is to use the IN.m_uv values in a calculation prior to the - // point that we actually use them for macroUv below. The "if(any(!isnan(IN.m_uv)))" seems to be sufficient for the workaround. The - // if statement will always be true, but just the act of reading these values in the if statement makes the values stable. Removing - // the if statement causes the flickering to occur using the steps documented in the bug. - if (any(!isnan(IN.m_uv))) + uint2 macroGridResolution = uint2(TerrainSrg::m_macroMaterialGrid.m_resolution >> 16, TerrainSrg::m_macroMaterialGrid.m_resolution & 0xFFFF); + float macroTileSize = TerrainSrg::m_macroMaterialGrid.m_tileSize; + float2 macroGridOffset = TerrainSrg::m_macroMaterialGrid.m_offset; + uint2 macroGridPosition = (surface.position.xy - macroGridOffset) / macroTileSize; + + uint macroTileIndex = macroGridResolution.x * macroGridPosition.y + macroGridPosition.x; + static const uint NumMacroMaterialsPerTile = 4; + macroTileIndex *= NumMacroMaterialsPerTile; + + [unroll] for (uint i = 0; i < NumMacroMaterialsPerTile; ++i) { - [unroll] for (uint i = 0; i < 4 && (i < ObjectSrg::m_macroMaterialCount); ++i) + TerrainSrg::MacroMaterialData macroMaterialData = TerrainSrg::m_macroMaterialData[macroTileIndex + i]; + if ((macroMaterialData.m_flags & 1) == 0) + { + break; // No more macro materials for this tile + } + + if (any(surface.position.xy < macroMaterialData.m_boundsMin) || any (surface.position.xy > macroMaterialData.m_boundsMax)) + { + continue; // Macro material exists for this tile but is out of the bounds of this particular position + } + + float2 macroUvSize = macroMaterialData.m_boundsMax - macroMaterialData.m_boundsMin; + macroUvSize.x = -macroUvSize.x; + float2 macroUv = (macroMaterialData.m_boundsMin - surface.position.xy) / macroUvSize; + + // The macro uv gradient can vary massively over the quad because different pixels may choose different macro materials with different UVs. + // To fix, we use the world position scaled by the macro uv scale which should be fairly uniform across macro materials. + float2 macroUvScale = IN.m_worldPosition.xy / macroUvSize; + float2 ddx_macroUv = ddx(macroUvScale); + float2 ddy_macroUv = ddy(macroUvScale); + + if (macroMaterialData.m_colorMapId != 0xFFFF) + { + macroColor = TerrainSrg::m_textures[macroMaterialData.m_colorMapId].SampleGrad(TerrainMaterialSrg::m_sampler, macroUv, ddx_macroUv, ddy_macroUv).rgb; + macroColor = TransformColor(macroColor, ColorSpaceId::LinearSRGB, ColorSpaceId::ACEScg); + } + + if (macroMaterialData.m_normalMapId != 0xFFFF) { - float2 macroUvMin = ObjectSrg::m_macroMaterialData[i].m_uvMin; - float2 macroUvMax = ObjectSrg::m_macroMaterialData[i].m_uvMax; - float2 macroUv = lerp(macroUvMin, macroUvMax, IN.m_uv); - if (macroUv.x >= 0.0 && macroUv.x <= 1.0 && macroUv.y >= 0.0 && macroUv.y <= 1.0) - { - if ((ObjectSrg::m_macroMaterialData[i].m_mapsInUse & 1) > 0) - { - macroColor = GetBaseColorInput(ObjectSrg::m_macroColorMap[i], TerrainMaterialSrg::m_sampler, macroUv, macroColor, true); - } - if ((ObjectSrg::m_macroMaterialData[i].m_mapsInUse & 2) > 0) - { - bool flipX = ObjectSrg::m_macroMaterialData[i].m_flipNormalX; - bool flipY = ObjectSrg::m_macroMaterialData[i].m_flipNormalY; - float factor = ObjectSrg::m_macroMaterialData[i].m_normalFactor; - - float2 sampledValue = SampleNormalXY(ObjectSrg::m_macroNormalMap[i], TerrainMaterialSrg::m_sampler, macroUv, flipX, flipY); - macroNormal = normalize(GetTangentSpaceNormal_Unnormalized(sampledValue.xy, factor)); - } - break; - } + bool flipX = macroMaterialData.m_flags & 2; + bool flipY = macroMaterialData.m_flags & 4; + float factor = macroMaterialData.m_normalFactor; + + float2 sampledValue = SampleNormalXY(TerrainSrg::m_textures[macroMaterialData.m_normalMapId], TerrainMaterialSrg::m_sampler, macroUv, flipX, flipY); + macroNormal = normalize(GetTangentSpaceNormal_Unnormalized(sampledValue, factor)); } + break; } // ------- Base Color ------- diff --git a/Gems/Terrain/Assets/Shaders/Terrain/TerrainSrg.azsli b/Gems/Terrain/Assets/Shaders/Terrain/TerrainSrg.azsli index f980e02b9d..3fcf8d75ca 100644 --- a/Gems/Terrain/Assets/Shaders/Terrain/TerrainSrg.azsli +++ b/Gems/Terrain/Assets/Shaders/Terrain/TerrainSrg.azsli @@ -53,12 +53,38 @@ ShaderResourceGroup TerrainSrg : SRG_Terrain uint2 m_padding; }; + struct MacroMaterialData + { + // bit 1 : Is this macro material used. + // bit 2 : flip normal x + // bit 3 : flip normal y + uint m_flags; + + uint m_colorMapId; + uint m_normalMapId; + float m_normalFactor; + float2 m_boundsMin; + float2 m_boundsMax; + }; + + struct MacroMaterialGrid + { + uint m_resolution; // How many x/y tiles in grid. x & y stored in 16 bits each. Total number of entries in m_macroMaterialData will be x * y + float m_tileSize; // Size of a tile in meters. + float2 m_offset; // x/y offset of min x/y corner of grid. + }; + Texture2D m_detailMaterialIdImage; StructuredBuffer m_detailMaterialData; - Texture2D m_detailTextures[]; // bindless array of all textures for detail materials + StructuredBuffer m_macroMaterialData; + MacroMaterialGrid m_macroMaterialGrid; + + Texture2D m_textures[]; // bindless array of all textures for detail and macro materials float2 m_detailMaterialIdImageCenter; float m_detailHalfPixelUv; float4 m_detailAabb; } + +static const float MacroMaterialsPerTile = 4; diff --git a/Gems/Terrain/Assets/Shaders/Terrain/Terrain_DepthPass.azsl b/Gems/Terrain/Assets/Shaders/Terrain/Terrain_DepthPass.azsl index fd855a1bcd..c74a0646ee 100644 --- a/Gems/Terrain/Assets/Shaders/Terrain/Terrain_DepthPass.azsl +++ b/Gems/Terrain/Assets/Shaders/Terrain/Terrain_DepthPass.azsl @@ -6,6 +6,7 @@ */ #include +#include #include #include "TerrainCommon.azsli" #include @@ -18,9 +19,30 @@ struct VSDepthOutput VSDepthOutput MainVS(in VertexInput input) { VSDepthOutput output; - ObjectSrg::TerrainData terrainData = ObjectSrg::m_terrainData; - float2 origUv = lerp(terrainData.m_uvMin, terrainData.m_uvMax, input.m_uv); - output.m_position = GetTerrainProjectedPosition(terrainData, input.m_position, origUv); + HeightContext heightContext; + heightContext.Initialize(SceneSrg::m_heightmapImage, input.m_position, ObjectSrg::m_patchData, SceneSrg::m_terrainWorldData.m_min, SceneSrg::m_terrainWorldData.m_max); + + if (heightContext.IsVertexOutsideOfTerrainBounds()) + { + // Output a NaN to remove this vertex. + output.m_position = 1.0 / 0.0; + return output; + } + + float height = 0.0; + + if (o_useTerrainSmoothing) + { + height = heightContext.GetSmoothedHeight(SceneSrg::m_heightmapImage, SceneSrg::HeightmapSampler); + } + else + { + height = heightContext.GetHeight(SceneSrg::m_heightmapImage); + } + + float3 worldPosition = float3(heightContext.m_xyPosition, height); + output.m_position = mul(ViewSrg::m_viewProjectionMatrix, float4(worldPosition, 1.0)); + return output; } diff --git a/Gems/Terrain/Assets/Shaders/Terrain/ViewSrg.azsli b/Gems/Terrain/Assets/Shaders/Terrain/ViewSrg.azsli deleted file mode 100644 index 144f2abf6b..0000000000 --- a/Gems/Terrain/Assets/Shaders/Terrain/ViewSrg.azsli +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#ifndef AZ_COLLECTING_PARTIAL_SRGS -#error Do not include this file directly. Include the main .srgi file instead. -#endif - -partial ShaderResourceGroup ViewSrg -{ - Sampler HeightmapSampler - { - MinFilter = Linear; - MagFilter = Linear; - MipFilter = Point; - AddressU = Clamp; - AddressV = Clamp; - AddressW = Clamp; - }; - - Sampler DetailSampler - { - AddressU = Wrap; - AddressV = Wrap; - MinFilter = Point; - MagFilter = Point; - MipFilter = Point; - }; - - struct DetailMaterialData - { - // Uv - row_major float3x4 m_uvTransform; - - float3 m_baseColor; - - // Factor / Scale / Bias for input textures - float m_baseColorFactor; - - float m_normalFactor; - float m_metalFactor; - float m_roughnessScale; - float m_roughnessBias; - - float m_specularF0Factor; - float m_occlusionFactor; - float m_heightFactor; - float m_heightOffset; - - float m_heightBlendFactor; - - // Flags - uint m_flags; // see DetailTextureFlags - - // Image indices - uint m_colorNormalImageIndices; - uint m_roughnessMetalnessImageIndices; - - uint m_specularF0OcclusionImageIndices; - uint m_heightImageIndex; // only first 16 bits used - - // 16 byte aligned - uint2 m_padding; - }; - - Texture2D m_heightmapImage; - Texture2D m_detailMaterialIdImage; - StructuredBuffer m_detailMaterialData; - - Texture2D m_detailTextures[]; // bindless array of all textures for detail materials - - float2 m_detailMaterialIdImageCenter; - float m_detailHalfPixelUv; - - float4 m_detailAabb; -} diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/Aabb2i.cpp b/Gems/Terrain/Code/Source/TerrainRenderer/Aabb2i.cpp new file mode 100644 index 0000000000..c38651f296 --- /dev/null +++ b/Gems/Terrain/Code/Source/TerrainRenderer/Aabb2i.cpp @@ -0,0 +1,44 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include + +namespace Terrain +{ + Aabb2i::Aabb2i(const Vector2i& min, const Vector2i& max) + : m_min(min) + , m_max(max) + {} + + Aabb2i Aabb2i::operator+(const Vector2i& rhs) const + { + return { m_min + rhs, m_max + rhs }; + } + + Aabb2i Aabb2i::operator-(const Vector2i& rhs) const + { + return *this + -rhs; + } + + Aabb2i Aabb2i::GetClamped(Aabb2i rhs) const + { + Aabb2i ret; + ret.m_min.m_x = AZ::GetMax(m_min.m_x, rhs.m_min.m_x); + ret.m_min.m_y = AZ::GetMax(m_min.m_y, rhs.m_min.m_y); + ret.m_max.m_x = AZ::GetMin(m_max.m_x, rhs.m_max.m_x); + ret.m_max.m_y = AZ::GetMin(m_max.m_y, rhs.m_max.m_y); + return ret; + } + + bool Aabb2i::IsValid() const + { + // Intentionally strict, equal min/max not valid. + return m_min.m_x < m_max.m_x && m_min.m_y < m_max.m_y; + } +} diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/Aabb2i.h b/Gems/Terrain/Code/Source/TerrainRenderer/Aabb2i.h new file mode 100644 index 0000000000..88f735564d --- /dev/null +++ b/Gems/Terrain/Code/Source/TerrainRenderer/Aabb2i.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * 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 Terrain +{ + class Aabb2i + { + public: + + Aabb2i() = default; + Aabb2i(const Vector2i& min, const Vector2i& max); + + Aabb2i operator+(const Vector2i& offset) const; + Aabb2i operator-(const Vector2i& offset) const; + + Aabb2i GetClamped(Aabb2i rhs) const; + bool IsValid() const; + + + Vector2i m_min{AZStd::numeric_limits::min(), AZStd::numeric_limits::min()}; + Vector2i m_max{AZStd::numeric_limits::max(), AZStd::numeric_limits::max()}; + + }; +} diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/BindlessImageArrayHandler.cpp b/Gems/Terrain/Code/Source/TerrainRenderer/BindlessImageArrayHandler.cpp new file mode 100644 index 0000000000..595877c88b --- /dev/null +++ b/Gems/Terrain/Code/Source/TerrainRenderer/BindlessImageArrayHandler.cpp @@ -0,0 +1,101 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include +#include + +namespace AZ::Render +{ + namespace + { + [[maybe_unused]] const char* BindlessImageArrayHandlerName = "TerrainFeatureProcessor"; + } + + void BindlessImageArrayHandler::Initialize(AZ::Data::Instance& srg, const AZ::Name& propertyName) + { + if (!m_isInitialized) + { + m_isInitialized = UpdateSrgIndices(srg, propertyName); + } + else + { + AZ_Error(BindlessImageArrayHandlerName, false, "Already initialized."); + } + } + + void BindlessImageArrayHandler::Reset() + { + m_texturesIndex = {}; + m_isInitialized = false; + } + + bool BindlessImageArrayHandler::IsInitialized() const + { + return m_isInitialized; + } + + bool BindlessImageArrayHandler::UpdateSrgIndices(AZ::Data::Instance& srg, const AZ::Name& propertyName) + { + if (srg) + { + m_texturesIndex = srg->GetLayout()->FindShaderInputImageUnboundedArrayIndex(propertyName); + AZ_Error(BindlessImageArrayHandlerName, m_texturesIndex.IsValid(), "Failed to find srg input constant %s.", propertyName.GetCStr()); + } + else + { + AZ_Error(BindlessImageArrayHandlerName, false, "Cannot initialize using a null shader resource group."); + } + return m_texturesIndex.IsValid(); + } + + uint16_t BindlessImageArrayHandler::AppendBindlessImage(const AZ::RHI::ImageView* imageView) + { + uint16_t imageIndex = 0xFFFF; + + AZStd::unique_lock lock(m_updateMutex); + if (m_bindlessImageViewFreeList.size() > 0) + { + imageIndex = m_bindlessImageViewFreeList.back(); + m_bindlessImageViewFreeList.pop_back(); + m_bindlessImageViews.at(imageIndex) = imageView; + } + else + { + imageIndex = aznumeric_cast(m_bindlessImageViews.size()); + m_bindlessImageViews.push_back(imageView); + } + return imageIndex; + } + + void BindlessImageArrayHandler::UpdateBindlessImage(uint16_t index, const AZ::RHI::ImageView* imageView) + { + AZStd::shared_lock lock(m_updateMutex); + m_bindlessImageViews.at(index) = imageView; + } + + void BindlessImageArrayHandler::RemoveBindlessImage(uint16_t index) + { + AZStd::unique_lock lock(m_updateMutex); + m_bindlessImageViews.at(index) = AZ::RPI::ImageSystemInterface::Get()->GetSystemImage(AZ::RPI::SystemImage::Magenta)->GetImageView(); + m_bindlessImageViewFreeList.push_back(index); + } + + bool BindlessImageArrayHandler::UpdateSrg(AZ::Data::Instance& srg) const + { + if (!m_isInitialized) + { + AZ_Error("BindlessImageArrayHandler", false, "BindlessImageArrayHandler not initialized") + return false; + } + + AZStd::array_view imageViews(m_bindlessImageViews.data(), m_bindlessImageViews.size()); + return srg->SetImageViewUnboundedArray(m_texturesIndex, imageViews); + } + +} diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/BindlessImageArrayHandler.h b/Gems/Terrain/Code/Source/TerrainRenderer/BindlessImageArrayHandler.h new file mode 100644 index 0000000000..5315e8526d --- /dev/null +++ b/Gems/Terrain/Code/Source/TerrainRenderer/BindlessImageArrayHandler.h @@ -0,0 +1,48 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include + +#include +#include +#include + +namespace AZ::Render +{ + class BindlessImageArrayHandler + { + public: + + static constexpr uint16_t InvalidImageIndex = 0xFFFF; + + BindlessImageArrayHandler() = default; + ~BindlessImageArrayHandler() = default; + + void Initialize(AZ::Data::Instance& srg, const AZ::Name& propertyName); + void Reset(); + bool IsInitialized() const; + bool UpdateSrgIndices(AZ::Data::Instance& srg, const AZ::Name& propertyName); + + uint16_t AppendBindlessImage(const RHI::ImageView* imageView); + void UpdateBindlessImage(uint16_t index, const RHI::ImageView* imageView); + void RemoveBindlessImage(uint16_t index); + + bool UpdateSrg(AZ::Data::Instance& srg) const; + + private: + + AZStd::vector m_bindlessImageViews; + AZStd::vector m_bindlessImageViewFreeList; + RHI::ShaderInputImageUnboundedArrayIndex m_texturesIndex; + AZStd::shared_mutex m_updateMutex; + bool m_isInitialized{ false }; + }; +} + diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainDetailMaterialManager.cpp b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainDetailMaterialManager.cpp new file mode 100644 index 0000000000..2bc9e42bff --- /dev/null +++ b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainDetailMaterialManager.cpp @@ -0,0 +1,912 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * 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 + +namespace Terrain +{ + namespace + { + [[maybe_unused]] static const char* TerrainDetailMaterialManagerName = "TerrainDetailMaterialManager"; + static const char* TerrainDetailChars = "TerrainDetail"; + } + + namespace DetailMaterialInputs + { + static const char* const BaseColorColor("baseColor.color"); + static const char* const BaseColorMap("baseColor.textureMap"); + static const char* const BaseColorUseTexture("baseColor.useTexture"); + static const char* const BaseColorFactor("baseColor.factor"); + static const char* const BaseColorBlendMode("baseColor.textureBlendMode"); + static const char* const MetallicMap("metallic.textureMap"); + static const char* const MetallicUseTexture("metallic.useTexture"); + static const char* const MetallicFactor("metallic.factor"); + static const char* const RoughnessMap("roughness.textureMap"); + static const char* const RoughnessUseTexture("roughness.useTexture"); + static const char* const RoughnessFactor("roughness.factor"); + static const char* const RoughnessLowerBound("roughness.lowerBound"); + static const char* const RoughnessUpperBound("roughness.upperBound"); + static const char* const SpecularF0Map("specularF0.textureMap"); + static const char* const SpecularF0UseTexture("specularF0.useTexture"); + static const char* const SpecularF0Factor("specularF0.factor"); + static const char* const NormalMap("normal.textureMap"); + static const char* const NormalUseTexture("normal.useTexture"); + static const char* const NormalFactor("normal.factor"); + static const char* const NormalFlipX("normal.flipX"); + static const char* const NormalFlipY("normal.flipY"); + static const char* const DiffuseOcclusionMap("occlusion.diffuseTextureMap"); + static const char* const DiffuseOcclusionUseTexture("occlusion.diffuseUseTexture"); + static const char* const DiffuseOcclusionFactor("occlusion.diffuseFactor"); + static const char* const HeightMap("parallax.textureMap"); + static const char* const HeightUseTexture("parallax.useTexture"); + static const char* const HeightFactor("parallax.factor"); + static const char* const HeightOffset("parallax.offset"); + static const char* const HeightBlendFactor("parallax.blendFactor"); + } + + namespace TerrainSrgInputs + { + static const char* const DetailMaterialIdImage("m_detailMaterialIdImage"); + static const char* const DetailMaterialData("m_detailMaterialData"); + static const char* const DetailMaterialIdImageCenter("m_detailMaterialIdImageCenter"); + static const char* const DetailHalfPixelUv("m_detailHalfPixelUv"); + static const char* const DetailAabb("m_detailAabb"); + } + + AZ_CVAR(bool, + r_terrainDebugDetailMaterials, + false, + [](const bool& value) + { + AZ::RPI::ShaderSystemInterface::Get()->SetGlobalShaderOption(AZ::Name{ "o_debugDetailMaterialIds" }, AZ::RPI::ShaderOptionValue{ value }); + }, + AZ::ConsoleFunctorFlags::Null, + "Turns on debugging for detail material ids for terrain." + ); + + AZ_CVAR(bool, + r_terrainDebugDetailImageUpdates, + false, + nullptr, + AZ::ConsoleFunctorFlags::Null, + "Turns on debugging for detail material update regions for terrain." + ); + + void TerrainDetailMaterialManager::Initialize( + const AZStd::shared_ptr& bindlessImageHandler, + AZ::Data::Instance& terrainSrg) + { + AZ_Error(TerrainDetailMaterialManagerName, bindlessImageHandler, "bindlessImageHandler must not be null."); + AZ_Error(TerrainDetailMaterialManagerName, terrainSrg, "terrainSrg must not be null."); + AZ_Error(TerrainDetailMaterialManagerName, !m_isInitialized, "Already initialized."); + + if (!bindlessImageHandler || !terrainSrg || m_isInitialized) + { + return; + } + + if (UpdateSrgIndices(terrainSrg)) + { + m_bindlessImageHandler = bindlessImageHandler; + + // Find any detail material areas that have already been created. + TerrainAreaMaterialRequestBus::EnumerateHandlers( + [&](TerrainAreaMaterialRequests* handler) + { + const AZ::Aabb& bounds = handler->GetTerrainSurfaceMaterialRegion(); + const AZStd::vector materialMappings = handler->GetSurfaceMaterialMappings(); + AZ::EntityId entityId = *(Terrain::TerrainAreaMaterialRequestBus::GetCurrentBusId()); + + DetailMaterialListRegion& materialRegion = FindOrCreateByEntityId(entityId, m_detailMaterialRegions); + materialRegion.m_region = bounds; + + for (const auto& materialMapping : materialMappings) + { + if (materialMapping.m_materialInstance) + { + OnTerrainSurfaceMaterialMappingCreated(entityId, materialMapping.m_surfaceTag, materialMapping.m_materialInstance); + } + } + return true; + } + ); + TerrainAreaMaterialNotificationBus::Handler::BusConnect(); + + AZ::Aabb worldBounds = AZ::Aabb::CreateNull(); + AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( + worldBounds, &AzFramework::Terrain::TerrainDataRequests::GetTerrainAabb); + + OnTerrainDataChanged(worldBounds, TerrainDataChangedMask::SurfaceData); + AzFramework::Terrain::TerrainDataNotificationBus::Handler::BusConnect(); + + m_isInitialized = true; + } + } + + bool TerrainDetailMaterialManager::UpdateSrgIndices(AZ::Data::Instance& terrainSrg) + { + const AZ::RHI::ShaderResourceGroupLayout* terrainSrgLayout = terrainSrg->GetLayout(); + + m_detailMaterialIdPropertyIndex = terrainSrgLayout->FindShaderInputImageIndex(AZ::Name(TerrainSrgInputs::DetailMaterialIdImage)); + AZ_Error(TerrainDetailMaterialManagerName, m_detailMaterialIdPropertyIndex.IsValid(), "Failed to find terrain srg input constant %s.", TerrainSrgInputs::DetailMaterialIdImage); + + m_detailCenterPropertyIndex = terrainSrgLayout->FindShaderInputConstantIndex(AZ::Name(TerrainSrgInputs::DetailMaterialIdImageCenter)); + AZ_Error(TerrainDetailMaterialManagerName, m_detailCenterPropertyIndex.IsValid(), "Failed to find terrain srg input constant %s.", TerrainSrgInputs::DetailMaterialIdImageCenter); + + m_detailHalfPixelUvPropertyIndex = terrainSrgLayout->FindShaderInputConstantIndex(AZ::Name(TerrainSrgInputs::DetailHalfPixelUv)); + AZ_Error(TerrainDetailMaterialManagerName, m_detailHalfPixelUvPropertyIndex.IsValid(), "Failed to find terrain srg input constant %s.", TerrainSrgInputs::DetailHalfPixelUv); + + m_detailAabbPropertyIndex = terrainSrgLayout->FindShaderInputConstantIndex(AZ::Name(TerrainSrgInputs::DetailAabb)); + AZ_Error(TerrainDetailMaterialManagerName, m_detailAabbPropertyIndex.IsValid(), "Failed to find terrain srg input constant %s.", TerrainSrgInputs::DetailAabb); + + // Set up the gpu buffer for detail material data + AZ::Render::GpuBufferHandler::Descriptor desc; + desc.m_bufferName = "Detail Material Data"; + desc.m_bufferSrgName = TerrainSrgInputs::DetailMaterialData; + desc.m_elementSize = sizeof(DetailMaterialShaderData); + desc.m_srgLayout = terrainSrgLayout; + m_detailMaterialDataBuffer = AZ::Render::GpuBufferHandler(desc); + + bool IndicesValid = + m_detailMaterialIdPropertyIndex.IsValid() && + m_detailCenterPropertyIndex.IsValid() && + m_detailHalfPixelUvPropertyIndex.IsValid() && + m_detailAabbPropertyIndex.IsValid(); + + m_detailImageNeedsUpdate = true; + m_detailMaterialBufferNeedsUpdate = true; + + return IndicesValid && m_detailMaterialDataBuffer.IsValid(); + } + + void TerrainDetailMaterialManager::RemoveAllImages() + { + for (const DetailMaterialData& materialData: m_detailMaterials.GetDataVector()) + { + DetailMaterialShaderData& shaderData = m_detailMaterialShaderData.GetElement(materialData.m_detailMaterialBufferIndex); + + auto checkRemoveImage = [&](uint16_t index) + { + if (index != 0xFFFF) + { + m_bindlessImageHandler->RemoveBindlessImage(index); + } + }; + + checkRemoveImage(shaderData.m_colorImageIndex); + checkRemoveImage(shaderData.m_normalImageIndex); + checkRemoveImage(shaderData.m_roughnessImageIndex); + checkRemoveImage(shaderData.m_metalnessImageIndex); + checkRemoveImage(shaderData.m_specularF0ImageIndex); + checkRemoveImage(shaderData.m_occlusionImageIndex); + checkRemoveImage(shaderData.m_heightImageIndex); + } + } + + bool TerrainDetailMaterialManager::IsInitialized() const + { + return m_isInitialized; + } + + void TerrainDetailMaterialManager::Reset() + { + RemoveAllImages(); + m_bindlessImageHandler.reset(); + + m_detailTextureImage = {}; + m_detailMaterials.Clear(); + m_detailMaterialRegions.Clear(); + m_detailMaterialShaderData.Clear(); + m_detailMaterialDataBuffer.Release(); + + m_dirtyDetailRegion = AZ::Aabb::CreateNull(); + m_previousCameraPosition = AZ::Vector3(AZStd::numeric_limits::max(), 0.0, 0.0); + m_detailTextureBounds = {}; + m_detailTextureCenter = {}; + + m_detailMaterialBufferNeedsUpdate = false; + m_detailImageNeedsUpdate = false; + + TerrainAreaMaterialNotificationBus::Handler::BusDisconnect(); + AzFramework::Terrain::TerrainDataNotificationBus::Handler::BusDisconnect(); + + m_isInitialized = false; + } + + void TerrainDetailMaterialManager::Update(const AZ::Vector3& cameraPosition, AZ::Data::Instance& terrainSrg) + { + if (m_detailMaterialBufferNeedsUpdate) + { + m_detailMaterialBufferNeedsUpdate = false; + m_detailMaterialDataBuffer.UpdateBuffer(m_detailMaterialShaderData.GetRawData(), aznumeric_cast(m_detailMaterialShaderData.GetSize())); + } + + if (m_dirtyDetailRegion.IsValid() || !cameraPosition.IsClose(m_previousCameraPosition) || m_detailImageNeedsUpdate) + { + if (r_terrainDebugDetailImageUpdates) + { + AZ_Printf("TerrainDetailMaterialManager", "Previous Camera: (%f, %f, %f) New Cameara: (%f, %f, %f)", + m_previousCameraPosition.GetX(), m_previousCameraPosition.GetY(), m_previousCameraPosition.GetZ(), + cameraPosition.GetX(), cameraPosition.GetY(), cameraPosition.GetZ()); + } + int32_t newDetailTexturePosX = aznumeric_cast(AZStd::roundf(cameraPosition.GetX() / DetailTextureScale)); + int32_t newDetailTexturePosY = aznumeric_cast(AZStd::roundf(cameraPosition.GetY() / DetailTextureScale)); + + Aabb2i newBounds; + newBounds.m_min.m_x = newDetailTexturePosX - DetailTextureSizeHalf; + newBounds.m_min.m_y = newDetailTexturePosY - DetailTextureSizeHalf; + newBounds.m_max.m_x = newDetailTexturePosX + DetailTextureSizeHalf; + newBounds.m_max.m_y = newDetailTexturePosY + DetailTextureSizeHalf; + + // Use modulo to find the center point in texture space. Care must be taken so negative values are + // handled appropriately (ie, we want -1 % 1024 to equal 1023, not -1) + Vector2i newCenter; + newCenter.m_x = (DetailTextureSize + (newDetailTexturePosX % DetailTextureSize)) % DetailTextureSize; + newCenter.m_y = (DetailTextureSize + (newDetailTexturePosY % DetailTextureSize)) % DetailTextureSize; + + CheckUpdateDetailTexture(newBounds, newCenter); + + m_detailTextureBounds = newBounds; + m_dirtyDetailRegion = AZ::Aabb::CreateNull(); + + m_previousCameraPosition = cameraPosition; + + AZ::Vector4 detailAabb = AZ::Vector4( + m_detailTextureBounds.m_min.m_x * DetailTextureScale, + m_detailTextureBounds.m_min.m_y * DetailTextureScale, + m_detailTextureBounds.m_max.m_x * DetailTextureScale, + m_detailTextureBounds.m_max.m_y * DetailTextureScale + ); + AZ::Vector2 detailUvOffset = AZ::Vector2(float(newCenter.m_x) / DetailTextureSize, float(newCenter.m_y) / DetailTextureSize); + + terrainSrg->SetConstant(m_detailAabbPropertyIndex, detailAabb); + terrainSrg->SetConstant(m_detailHalfPixelUvPropertyIndex, 0.5f / DetailTextureSize); + terrainSrg->SetConstant(m_detailCenterPropertyIndex, detailUvOffset); + terrainSrg->SetImage(m_detailMaterialIdPropertyIndex, m_detailTextureImage); + + m_detailMaterialDataBuffer.UpdateSrg(terrainSrg.get()); + } + + m_detailImageNeedsUpdate = false; + } + + void TerrainDetailMaterialManager::OnTerrainDataChanged(const AZ::Aabb& dirtyRegion, TerrainDataChangedMask dataChangedMask) + { + if ((dataChangedMask & TerrainDataChangedMask::SurfaceData) != 0) + { + m_dirtyDetailRegion.AddAabb(dirtyRegion); + } + } + + void TerrainDetailMaterialManager::OnTerrainSurfaceMaterialMappingCreated(AZ::EntityId entityId, SurfaceData::SurfaceTag surfaceTag, MaterialInstance material) + { + DetailMaterialListRegion& materialRegion = FindOrCreateByEntityId(entityId, m_detailMaterialRegions); + + // Validate that the surface tag is new + for (DetailMaterialSurface& surface : materialRegion.m_materialsForSurfaces) + { + if (surface.m_surfaceTag == surfaceTag) + { + AZ_Error(TerrainDetailMaterialManagerName, false, "Already have a surface material mapping for this surface tag."); + return; + } + } + + uint16_t detailMaterialId = CreateOrUpdateDetailMaterial(material); + materialRegion.m_materialsForSurfaces.push_back({ surfaceTag, detailMaterialId }); + m_detailMaterials.GetData(detailMaterialId).refCount++; + m_dirtyDetailRegion.AddAabb(materialRegion.m_region); + } + + void TerrainDetailMaterialManager::OnTerrainSurfaceMaterialMappingDestroyed(AZ::EntityId entityId, SurfaceData::SurfaceTag surfaceTag) + { + DetailMaterialListRegion& materialRegion = FindOrCreateByEntityId(entityId, m_detailMaterialRegions); + + for (DetailMaterialSurface& surface : materialRegion.m_materialsForSurfaces) + { + if (surface.m_surfaceTag == surfaceTag) + { + CheckDetailMaterialForDeletion(surface.m_detailMaterialId); + + if (surface.m_surfaceTag != materialRegion.m_materialsForSurfaces.back().m_surfaceTag) + { + AZStd::swap(surface, materialRegion.m_materialsForSurfaces.back()); + } + materialRegion.m_materialsForSurfaces.pop_back(); + m_dirtyDetailRegion.AddAabb(materialRegion.m_region); + return; + } + } + AZ_Error(TerrainDetailMaterialManagerName, false, "Could not find surface tag to destroy for OnTerrainSurfaceMaterialMappingDestroyed()."); + } + + void TerrainDetailMaterialManager::OnTerrainSurfaceMaterialMappingChanged(AZ::EntityId entityId, SurfaceData::SurfaceTag surfaceTag, MaterialInstance material) + { + DetailMaterialListRegion& materialRegion = FindOrCreateByEntityId(entityId, m_detailMaterialRegions); + + bool found = false; + uint16_t materialId = CreateOrUpdateDetailMaterial(material); + for (DetailMaterialSurface& surface : materialRegion.m_materialsForSurfaces) + { + if (surface.m_surfaceTag == surfaceTag) + { + found = true; + if (surface.m_detailMaterialId != materialId) + { + ++m_detailMaterials.GetData(materialId).refCount; + CheckDetailMaterialForDeletion(surface.m_detailMaterialId); + surface.m_detailMaterialId = materialId; + } + break; + } + } + + if (!found) + { + ++m_detailMaterials.GetData(materialId).refCount; + materialRegion.m_materialsForSurfaces.push_back({ surfaceTag, materialId }); + } + m_dirtyDetailRegion.AddAabb(materialRegion.m_region); + } + + void TerrainDetailMaterialManager::OnTerrainSurfaceMaterialMappingRegionChanged(AZ::EntityId entityId, const AZ::Aabb& oldRegion, const AZ::Aabb& newRegion) + { + DetailMaterialListRegion& materialRegion = FindOrCreateByEntityId(entityId, m_detailMaterialRegions); + materialRegion.m_region = newRegion; + m_dirtyDetailRegion.AddAabb(oldRegion); + m_dirtyDetailRegion.AddAabb(newRegion); + } + + void TerrainDetailMaterialManager::CheckDetailMaterialForDeletion(uint16_t detailMaterialId) + { + auto& detailMaterialData = m_detailMaterials.GetData(detailMaterialId); + if (--detailMaterialData.refCount == 0) + { + uint16_t bufferIndex = detailMaterialData.m_detailMaterialBufferIndex; + DetailMaterialShaderData& shaderData = m_detailMaterialShaderData.GetElement(bufferIndex); + + for (uint16_t imageIndex : + { + shaderData.m_colorImageIndex, + shaderData.m_normalImageIndex, + shaderData.m_roughnessImageIndex, + shaderData.m_metalnessImageIndex, + shaderData.m_specularF0ImageIndex, + shaderData.m_occlusionImageIndex, + shaderData.m_heightImageIndex + }) + { + if (imageIndex != InvalidImageIndex) + { + m_bindlessImageHandler->RemoveBindlessImage(imageIndex); + } + } + + m_detailMaterialShaderData.Release(bufferIndex); + m_detailMaterials.RemoveIndex(detailMaterialId); + + m_detailMaterialBufferNeedsUpdate = true; + } + } + + uint16_t TerrainDetailMaterialManager::CreateOrUpdateDetailMaterial(MaterialInstance material) + { + static constexpr uint16_t InvalidDetailMaterial = 0xFFFF; + uint16_t detailMaterialId = InvalidDetailMaterial; + + for (auto& detailMaterialData : m_detailMaterials.GetDataVector()) + { + if (detailMaterialData.m_assetId == material->GetAssetId()) + { + detailMaterialId = m_detailMaterials.GetIndexForData(&detailMaterialData); + UpdateDetailMaterialData(detailMaterialId, material); + break; + } + } + + AZ_Assert(m_detailMaterialShaderData.GetSize() < 0xFF, "Only 255 detail materials supported."); + + if (detailMaterialId == InvalidDetailMaterial && m_detailMaterialShaderData.GetSize() < 0xFF) + { + detailMaterialId = m_detailMaterials.GetFreeSlotIndex(); + auto& detailMaterialData = m_detailMaterials.GetData(detailMaterialId); + detailMaterialData.m_detailMaterialBufferIndex = aznumeric_cast(m_detailMaterialShaderData.Reserve()); + UpdateDetailMaterialData(detailMaterialId, material); + } + return detailMaterialId; + } + + void TerrainDetailMaterialManager::UpdateDetailMaterialData(uint16_t detailMaterialIndex, MaterialInstance material) + { + DetailMaterialData& materialData = m_detailMaterials.GetData(detailMaterialIndex); + DetailMaterialShaderData& shaderData = m_detailMaterialShaderData.GetElement(materialData.m_detailMaterialBufferIndex); + + if (materialData.m_materialChangeId == material->GetCurrentChangeId()) + { + return; // material hasn't changed, nothing to do + } + + materialData.m_materialChangeId = material->GetCurrentChangeId(); + materialData.m_assetId = material->GetAssetId(); + + DetailTextureFlags& flags = shaderData.m_flags; + + auto getIndex = [&](const char* const indexName) -> AZ::RPI::MaterialPropertyIndex + { + const AZ::RPI::MaterialPropertyIndex index = material->FindPropertyIndex(AZ::Name(indexName)); + AZ_Warning(TerrainDetailMaterialManagerName, index.IsValid(), "Failed to find shader input constant %s.", indexName); + return index; + }; + + auto applyProperty = [&](const char* const indexName, auto& ref) -> void + { + const auto index = getIndex(indexName); + if (index.IsValid()) + { + // GetValue() expects the actaul type, not a reference type, so the reference needs to be removed. + using TypeRefRemoved = AZStd::remove_cvref_t; + ref = material->GetPropertyValue(index).GetValue(); + } + }; + + auto applyImage = [&](const char* const indexName, AZ::Data::Instance& ref, const char* const usingFlagName, DetailTextureFlags flagToSet, uint16_t& imageIndex) -> void + { + // Determine if an image exists and if its using flag allows it to be used. + const auto index = getIndex(indexName); + const auto useTextureIndex = getIndex(usingFlagName); + bool useTextureValue = true; + if (useTextureIndex.IsValid()) + { + useTextureValue = material->GetPropertyValue(useTextureIndex).GetValue(); + } + if (index.IsValid() && useTextureValue) + { + ref = material->GetPropertyValue(index).GetValue>(); + } + useTextureValue = useTextureValue && ref; + flags = DetailTextureFlags(useTextureValue ? (flags | flagToSet) : (flags & ~flagToSet)); + + // Update queues to add/remove textures depending on if the image is used + if (ref) + { + if (imageIndex == InvalidImageIndex) + { + imageIndex = m_bindlessImageHandler->AppendBindlessImage(ref->GetImageView()); + } + else + { + m_bindlessImageHandler->UpdateBindlessImage(imageIndex, ref->GetImageView()); + } + } + else if (imageIndex != InvalidImageIndex) + { + m_bindlessImageHandler->RemoveBindlessImage(imageIndex); + imageIndex = InvalidImageIndex; + } + }; + + auto applyFlag = [&](const char* const indexName, DetailTextureFlags flagToSet) -> void + { + const auto index = getIndex(indexName); + if (index.IsValid()) + { + bool flagValue = material->GetPropertyValue(index).GetValue(); + flags = DetailTextureFlags(flagValue ? flags | flagToSet : flags); + } + }; + + auto getEnumName = [&](const char* const indexName) -> const AZStd::string_view + { + const auto index = getIndex(indexName); + if (index.IsValid()) + { + uint32_t enumIndex = material->GetPropertyValue(index).GetValue(); + const AZ::Name& enumName = material->GetMaterialPropertiesLayout()->GetPropertyDescriptor(index)->GetEnumName(enumIndex); + return enumName.GetStringView(); + } + return ""; + }; + + using namespace DetailMaterialInputs; + applyImage(BaseColorMap, materialData.m_colorImage, BaseColorUseTexture, DetailTextureFlags::UseTextureBaseColor, shaderData.m_colorImageIndex); + applyProperty(BaseColorFactor, shaderData.m_baseColorFactor); + + const auto index = getIndex(BaseColorColor); + if (index.IsValid()) + { + AZ::Color baseColor = material->GetPropertyValue(index).GetValue(); + shaderData.m_baseColorRed = baseColor.GetR(); + shaderData.m_baseColorGreen = baseColor.GetG(); + shaderData.m_baseColorBlue = baseColor.GetB(); + } + + const AZStd::string_view& blendModeString = getEnumName(BaseColorBlendMode); + if (blendModeString == "Multiply") + { + flags = DetailTextureFlags(flags | DetailTextureFlags::BlendModeMultiply); + } + else if (blendModeString == "LinearLight") + { + flags = DetailTextureFlags(flags | DetailTextureFlags::BlendModeLinearLight); + } + else if (blendModeString == "Lerp") + { + flags = DetailTextureFlags(flags | DetailTextureFlags::BlendModeLerp); + } + else if (blendModeString == "Overlay") + { + flags = DetailTextureFlags(flags | DetailTextureFlags::BlendModeOverlay); + } + + applyImage(MetallicMap, materialData.m_metalnessImage, MetallicUseTexture, DetailTextureFlags::UseTextureMetallic, shaderData.m_metalnessImageIndex); + applyProperty(MetallicFactor, shaderData.m_metalFactor); + + applyImage(RoughnessMap, materialData.m_roughnessImage, RoughnessUseTexture, DetailTextureFlags::UseTextureRoughness, shaderData.m_roughnessImageIndex); + + if ((flags & DetailTextureFlags::UseTextureRoughness) > 0) + { + float lowerBound = 0.0; + float upperBound = 1.0; + applyProperty(RoughnessLowerBound, lowerBound); + applyProperty(RoughnessUpperBound, upperBound); + shaderData.m_roughnessBias = lowerBound; + shaderData.m_roughnessScale = upperBound - lowerBound; + } + else + { + shaderData.m_roughnessBias = 0.0; + applyProperty(RoughnessFactor, shaderData.m_roughnessScale); + } + + applyImage(SpecularF0Map, materialData.m_specularF0Image, SpecularF0UseTexture, DetailTextureFlags::UseTextureSpecularF0, shaderData.m_specularF0ImageIndex); + applyProperty(SpecularF0Factor, shaderData.m_specularF0Factor); + + applyImage(NormalMap, materialData.m_normalImage, NormalUseTexture, DetailTextureFlags::UseTextureNormal, shaderData.m_normalImageIndex); + applyProperty(NormalFactor, shaderData.m_normalFactor); + applyFlag(NormalFlipX, DetailTextureFlags::FlipNormalX); + applyFlag(NormalFlipY, DetailTextureFlags::FlipNormalY); + + applyImage(DiffuseOcclusionMap, materialData.m_occlusionImage, DiffuseOcclusionUseTexture, DetailTextureFlags::UseTextureOcclusion, shaderData.m_occlusionImageIndex); + applyProperty(DiffuseOcclusionFactor, shaderData.m_occlusionFactor); + + applyImage(HeightMap, materialData.m_heightImage, HeightUseTexture, DetailTextureFlags::UseTextureHeight, shaderData.m_heightImageIndex); + applyProperty(HeightFactor, shaderData.m_heightFactor); + applyProperty(HeightOffset, shaderData.m_heightOffset); + applyProperty(HeightBlendFactor, shaderData.m_heightBlendFactor); + + m_detailMaterialBufferNeedsUpdate = true; + } + + void TerrainDetailMaterialManager::CheckUpdateDetailTexture(const Aabb2i& newBounds, const Vector2i& newCenter) + { + if (r_terrainDebugDetailImageUpdates) + { + AZ_Printf("TerrainDetailMaterialManager", "Old Bounds: m(%i, %i)M(%i, %i) New Bounds: m(%i, %i)M(%i, %i)", + m_detailTextureBounds.m_min.m_x, m_detailTextureBounds.m_min.m_y, m_detailTextureBounds.m_max.m_x, m_detailTextureBounds.m_max.m_y, + newBounds.m_min.m_x, newBounds.m_min.m_y, newBounds.m_max.m_x, newBounds.m_max.m_y + ); + } + if (!m_detailTextureImage) + { + // If the m_detailTextureImage doesn't exist, create it and populate the entire texture + + const AZ::Data::Instance imagePool = AZ::RPI::ImageSystemInterface::Get()->GetSystemAttachmentPool(); + AZ::RHI::ImageDescriptor imageDescriptor = AZ::RHI::ImageDescriptor::Create2D( + AZ::RHI::ImageBindFlags::ShaderRead, DetailTextureSize, DetailTextureSize, AZ::RHI::Format::R8G8B8A8_UINT + ); + const AZ::Name TerrainDetailName = AZ::Name(TerrainDetailChars); + m_detailTextureImage = AZ::RPI::AttachmentImage::Create(*imagePool.get(), imageDescriptor, TerrainDetailName, nullptr, nullptr); + AZ_Error(TerrainDetailMaterialManagerName, m_detailTextureImage, "Failed to initialize the detail texture image."); + + UpdateDetailTexture(newBounds, newBounds, newCenter); + } + else + { + // If the new bounds of the detail texture are different than the old bounds, then the edges of the texture need to be updated. + + int32_t offsetX = m_detailTextureBounds.m_min.m_x - newBounds.m_min.m_x; + + // Horizontal edge update + if (newBounds.m_min.m_x != m_detailTextureBounds.m_min.m_x) + { + Aabb2i updateBounds; + if (newBounds.m_min.m_x < m_detailTextureBounds.m_min.m_x) + { + updateBounds.m_min.m_x = newBounds.m_min.m_x; + updateBounds.m_max.m_x = m_detailTextureBounds.m_min.m_x; + } + else + { + updateBounds.m_min.m_x = m_detailTextureBounds.m_max.m_x; + updateBounds.m_max.m_x = newBounds.m_max.m_x; + } + updateBounds.m_min.m_y = newBounds.m_min.m_y; + updateBounds.m_max.m_y = newBounds.m_max.m_y; + + if (r_terrainDebugDetailImageUpdates) + { + AZ_Printf("TerrainDetailMaterialManager", "Updating horizontal edge: m(%i, %i)M(%i, %i)", + updateBounds.m_min.m_x, updateBounds.m_min.m_y, updateBounds.m_max.m_x, updateBounds.m_max.m_y); + } + UpdateDetailTexture(updateBounds, newBounds, newCenter); + } + + // Vertical edge update + if (newBounds.m_min.m_y != m_detailTextureBounds.m_min.m_y) + { + Aabb2i updateBounds; + // Don't update areas that have already been updated in the horizontal update. + updateBounds.m_min.m_x = newBounds.m_min.m_x + AZ::GetMax(0, offsetX); + updateBounds.m_max.m_x = newBounds.m_max.m_x + AZ::GetMin(0, offsetX); + if (newBounds.m_min.m_y < m_detailTextureBounds.m_min.m_y) + { + updateBounds.m_min.m_y = newBounds.m_min.m_y; + updateBounds.m_max.m_y = m_detailTextureBounds.m_min.m_y; + } + else + { + updateBounds.m_min.m_y = m_detailTextureBounds.m_max.m_y; + updateBounds.m_max.m_y = newBounds.m_max.m_y; + } + + if (r_terrainDebugDetailImageUpdates) + { + AZ_Printf("TerrainDetailMaterialManager", "Updating vertical edge: m(%i, %i)M(%i, %i)", + updateBounds.m_min.m_x, updateBounds.m_min.m_y, updateBounds.m_max.m_x, updateBounds.m_max.m_y); + } + UpdateDetailTexture(updateBounds, newBounds, newCenter); + } + + if (m_dirtyDetailRegion.IsValid()) + { + if (r_terrainDebugDetailImageUpdates) + { + AZ_Printf("TerrainDetailMaterialManager", "m_dirtyDetailRegion: m(%f, %f)M(%f, %f)", + m_dirtyDetailRegion.GetMin().GetX(), m_dirtyDetailRegion.GetMin().GetY(), m_dirtyDetailRegion.GetMax().GetX(), m_dirtyDetailRegion.GetMax().GetY()); + } + // If any regions are marked as dirty, then they should be updated. + + AZ::Vector3 currentMin = AZ::Vector3(newBounds.m_min.m_x * DetailTextureScale, newBounds.m_min.m_y * DetailTextureScale, -0.5f); + AZ::Vector3 currentMax = AZ::Vector3(newBounds.m_max.m_x * DetailTextureScale, newBounds.m_max.m_y * DetailTextureScale, 0.5f); + AZ::Aabb detailTextureCoverage = AZ::Aabb::CreateFromMinMax(currentMin, currentMax); + AZ::Vector3 previousMin = AZ::Vector3(m_detailTextureBounds.m_min.m_x * DetailTextureScale, m_detailTextureBounds.m_min.m_y * DetailTextureScale, -0.5f); + AZ::Vector3 previousMax = AZ::Vector3(m_detailTextureBounds.m_max.m_x * DetailTextureScale, m_detailTextureBounds.m_max.m_y * DetailTextureScale, 0.5f); + AZ::Aabb previousCoverage = AZ::Aabb::CreateFromMinMax(previousMin, previousMax); + + // Area of texture not already updated by camera movement above. + AZ::Aabb clampedCoverage = previousCoverage.GetClamped(detailTextureCoverage); + + // Clamp the dirty region to the area of the detail texture that is visible and not already updated. + clampedCoverage.Clamp(m_dirtyDetailRegion); + + if (clampedCoverage.IsValid()) + { + Aabb2i updateBounds; + updateBounds.m_min.m_x = aznumeric_cast(AZStd::roundf(clampedCoverage.GetMin().GetX() / DetailTextureScale)); + updateBounds.m_min.m_y = aznumeric_cast(AZStd::roundf(clampedCoverage.GetMin().GetY() / DetailTextureScale)); + updateBounds.m_max.m_x = aznumeric_cast(AZStd::roundf(clampedCoverage.GetMax().GetX() / DetailTextureScale)); + updateBounds.m_max.m_y = aznumeric_cast(AZStd::roundf(clampedCoverage.GetMax().GetY() / DetailTextureScale)); + if (updateBounds.m_min.m_x < updateBounds.m_max.m_x && updateBounds.m_min.m_y < updateBounds.m_max.m_y) + { + + if (r_terrainDebugDetailImageUpdates) + { + AZ_Printf("TerrainDetailMaterialManager", "Updating dirty region: m(%i, %i)M(%i, %i)", + updateBounds.m_min.m_x, updateBounds.m_min.m_y, updateBounds.m_max.m_x, updateBounds.m_max.m_y); + } + UpdateDetailTexture(updateBounds, newBounds, newCenter); + } + } + } + } + } + + void TerrainDetailMaterialManager::UpdateDetailTexture(const Aabb2i& updateArea, const Aabb2i& textureBounds, const Vector2i& centerPixel) + { + if (!m_detailTextureImage) + { + return; + } + + struct DetailMaterialPixel + { + uint8_t m_material1{ 255 }; + uint8_t m_material2{ 255 }; + uint8_t m_blend{ 0 }; // 0 = full weight on material1, 255 = full weight on material2 + uint8_t m_padding{ 0 }; + }; + + // Because the center of the detail texture may be offset, each update area may actually need to be split into + // up to 4 separate update areas in each sector of the quadrant. + AZStd::array textureSpaceAreas; + AZStd::array scaledWorldSpaceAreas; + uint8_t updateAreaCount = CalculateUpdateRegions(updateArea, textureBounds, centerPixel, textureSpaceAreas, scaledWorldSpaceAreas); + + if (updateAreaCount > 0) + { + m_detailImageNeedsUpdate = true; + } + + // Pull the data for each area updated and use it to construct an update for the detail material id texture. + for (uint8_t i = 0; i < updateAreaCount; ++i) + { + const Aabb2i& quadrantTextureArea = textureSpaceAreas[i]; + const Aabb2i& quadrantWorldArea = scaledWorldSpaceAreas[i]; + + AZStd::vector pixels; + pixels.resize((quadrantWorldArea.m_max.m_x - quadrantWorldArea.m_min.m_x) * (quadrantWorldArea.m_max.m_y - quadrantWorldArea.m_min.m_y)); + uint32_t index = 0; + + for (int yPos = quadrantWorldArea.m_min.m_y; yPos < quadrantWorldArea.m_max.m_y; ++yPos) + { + for (int xPos = quadrantWorldArea.m_min.m_x; xPos < quadrantWorldArea.m_max.m_x; ++xPos) + { + AZ::Vector2 position = AZ::Vector2(xPos * DetailTextureScale, yPos * DetailTextureScale); + AzFramework::SurfaceData::SurfaceTagWeightList surfaceWeights; + AzFramework::Terrain::TerrainDataRequestBus::Broadcast(&AzFramework::Terrain::TerrainDataRequests::GetSurfaceWeightsFromVector2, position, surfaceWeights, AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT, nullptr); + + // Store the top two surface weights in the texture with m_blend storing the relative weight. + bool isFirstMaterial = true; + float firstWeight = 0.0f; + for (const auto& surfaceTagWeight : surfaceWeights) + { + if (surfaceTagWeight.m_weight > 0.0f) + { + AZ::Crc32 surfaceType = surfaceTagWeight.m_surfaceType; + uint16_t materialId = GetDetailMaterialForSurfaceTypeAndPosition(surfaceType, position); + if (materialId != m_detailMaterials.NoFreeSlot && materialId < 255) + { + if (isFirstMaterial) + { + pixels.at(index).m_material1 = aznumeric_cast(materialId); + firstWeight = surfaceTagWeight.m_weight; + // m_blend only needs to be calculated is material 2 is found, otherwise the initial value of 0 is correct. + isFirstMaterial = false; + } + else + { + pixels.at(index).m_material2 = aznumeric_cast(materialId); + float totalWeight = firstWeight + surfaceTagWeight.m_weight; + float blendWeight = 1.0f - (firstWeight / totalWeight); + pixels.at(index).m_blend = aznumeric_cast(AZStd::round(blendWeight * 255.0f)); + break; + } + } + } + else + { + break; // since the list is ordered, no other materials are in the list with positive weights. + } + } + ++index; + } + } + + const int32_t left = quadrantTextureArea.m_min.m_x; + const int32_t top = quadrantTextureArea.m_min.m_y; + const int32_t width = quadrantTextureArea.m_max.m_x - quadrantTextureArea.m_min.m_x; + const int32_t height = quadrantTextureArea.m_max.m_y - quadrantTextureArea.m_min.m_y; + + AZ::RHI::ImageUpdateRequest imageUpdateRequest; + imageUpdateRequest.m_imageSubresourcePixelOffset.m_left = aznumeric_cast(left); + imageUpdateRequest.m_imageSubresourcePixelOffset.m_top = aznumeric_cast(top); + imageUpdateRequest.m_sourceSubresourceLayout.m_bytesPerRow = width * sizeof(DetailMaterialPixel); + imageUpdateRequest.m_sourceSubresourceLayout.m_bytesPerImage = width * height * sizeof(DetailMaterialPixel); + imageUpdateRequest.m_sourceSubresourceLayout.m_rowCount = height; + imageUpdateRequest.m_sourceSubresourceLayout.m_size.m_width = width; + imageUpdateRequest.m_sourceSubresourceLayout.m_size.m_height = height; + imageUpdateRequest.m_sourceSubresourceLayout.m_size.m_depth = 1; + imageUpdateRequest.m_sourceData = pixels.data(); + imageUpdateRequest.m_image = m_detailTextureImage->GetRHIImage(); + + m_detailTextureImage->UpdateImageContents(imageUpdateRequest); + } + } + + uint8_t TerrainDetailMaterialManager::CalculateUpdateRegions(const Aabb2i& updateArea, const Aabb2i& textureBounds, const Vector2i& centerPixel, + AZStd::array& textureSpaceAreas, AZStd::array& scaledWorldSpaceAreas) + { + Vector2i centerOffset = { centerPixel.m_x - DetailTextureSizeHalf, centerPixel.m_y - DetailTextureSizeHalf }; + + int32_t quadrantXOffset = centerPixel.m_x < DetailTextureSizeHalf ? DetailTextureSize : -DetailTextureSize; + int32_t quadrantYOffset = centerPixel.m_y < DetailTextureSizeHalf ? DetailTextureSize : -DetailTextureSize; + + uint8_t numQuadrants = 0; + + // For each of the 4 quadrants: + auto calculateQuadrant = [&](Vector2i quadrantOffset) + { + Aabb2i offsetUpdateArea = updateArea + centerOffset + quadrantOffset; + Aabb2i updateSectionBounds = textureBounds.GetClamped(offsetUpdateArea); + if (updateSectionBounds.IsValid()) + { + textureSpaceAreas[numQuadrants] = updateSectionBounds - textureBounds.m_min; + scaledWorldSpaceAreas[numQuadrants] = updateSectionBounds - centerOffset - quadrantOffset; + ++numQuadrants; + } + }; + + calculateQuadrant({ 0, 0 }); + calculateQuadrant({ quadrantXOffset, 0 }); + calculateQuadrant({ 0, quadrantYOffset }); + calculateQuadrant({ quadrantXOffset, quadrantYOffset }); + + return numQuadrants; + } + + uint16_t TerrainDetailMaterialManager::GetDetailMaterialForSurfaceTypeAndPosition(AZ::Crc32 surfaceType, const AZ::Vector2& position) + { + for (const auto& materialRegion : m_detailMaterialRegions.GetDataVector()) + { + if (materialRegion.m_region.Contains(AZ::Vector3(position.GetX(), position.GetY(), 0.0f))) + { + for (const auto& materialSurface : materialRegion.m_materialsForSurfaces) + { + if (materialSurface.m_surfaceTag == surfaceType) + { + return m_detailMaterials.GetData(materialSurface.m_detailMaterialId).m_detailMaterialBufferIndex; + } + } + } + } + return m_detailMaterials.NoFreeSlot; + } + + auto TerrainDetailMaterialManager::FindByEntityId(AZ::EntityId entityId, AZ::Render::IndexedDataVector& container) + -> DetailMaterialListRegion* + { + for (DetailMaterialListRegion& data : container.GetDataVector()) + { + if (data.m_entityId == entityId) + { + return &data; + } + } + return nullptr; + } + + auto TerrainDetailMaterialManager::FindOrCreateByEntityId(AZ::EntityId entityId, AZ::Render::IndexedDataVector& container) + -> DetailMaterialListRegion& + { + DetailMaterialListRegion* dataPtr = FindByEntityId(entityId, container); + if (dataPtr != nullptr) + { + return *dataPtr; + } + + const uint16_t slotId = container.GetFreeSlotIndex(); + AZ_Assert(slotId != AZ::Render::IndexedDataVector::NoFreeSlot, "Ran out of indices"); + + DetailMaterialListRegion& data = container.GetData(slotId); + data.m_entityId = entityId; + return data; + } + + void TerrainDetailMaterialManager::RemoveByEntityId(AZ::EntityId entityId, AZ::Render::IndexedDataVector& container) + { + for (DetailMaterialListRegion& data : container.GetDataVector()) + { + if (data.m_entityId == entityId) + { + container.RemoveData(&data); + return; + } + } + AZ_Assert(false, "Entity Id not found in container.") + } + +} diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainDetailMaterialManager.h b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainDetailMaterialManager.h new file mode 100644 index 0000000000..98f2c26dd8 --- /dev/null +++ b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainDetailMaterialManager.h @@ -0,0 +1,226 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +namespace Terrain +{ + class TerrainDetailMaterialManager + : private AzFramework::Terrain::TerrainDataNotificationBus::Handler + , private TerrainAreaMaterialNotificationBus::Handler + { + public: + + AZ_RTTI(TerrainDetailMaterialManager, "{3CBAF88F-E3B1-43B8-97A5-999133188BCC}"); + AZ_DISABLE_COPY_MOVE(TerrainDetailMaterialManager); + + TerrainDetailMaterialManager() = default; + ~TerrainDetailMaterialManager() = default; + + void Initialize( + const AZStd::shared_ptr& bindlessImageHandler, + AZ::Data::Instance& terrainSrg); + bool IsInitialized() const; + void Reset(); + bool UpdateSrgIndices(AZ::Data::Instance& srg); + + void Update(const AZ::Vector3& cameraPosition, AZ::Data::Instance& terrainSrg); + + private: + + using MaterialInstance = AZ::Data::Instance; + static constexpr auto InvalidImageIndex = AZ::Render::BindlessImageArrayHandler::InvalidImageIndex; + + enum DetailTextureFlags : uint32_t + { + UseTextureBaseColor = 0b0000'0000'0000'0000'0000'0000'0000'0001, + UseTextureNormal = 0b0000'0000'0000'0000'0000'0000'0000'0010, + UseTextureMetallic = 0b0000'0000'0000'0000'0000'0000'0000'0100, + UseTextureRoughness = 0b0000'0000'0000'0000'0000'0000'0000'1000, + UseTextureOcclusion = 0b0000'0000'0000'0000'0000'0000'0001'0000, + UseTextureHeight = 0b0000'0000'0000'0000'0000'0000'0010'0000, + UseTextureSpecularF0 = 0b0000'0000'0000'0000'0000'0000'0100'0000, + + FlipNormalX = 0b0000'0000'0000'0001'0000'0000'0000'0000, + FlipNormalY = 0b0000'0000'0000'0010'0000'0000'0000'0000, + + BlendModeMask = 0b0000'0000'0000'1100'0000'0000'0000'0000, + BlendModeLerp = 0b0000'0000'0000'0000'0000'0000'0000'0000, + BlendModeLinearLight = 0b0000'0000'0000'0100'0000'0000'0000'0000, + BlendModeMultiply = 0b0000'0000'0000'1000'0000'0000'0000'0000, + BlendModeOverlay = 0b0000'0000'0000'1100'0000'0000'0000'0000, + }; + + struct DetailMaterialShaderData + { + // Uv + AZStd::array m_uvTransform + { + 1.0, 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 1.0, 0.0, + }; + + float m_baseColorRed{ 1.0f }; + float m_baseColorGreen{ 1.0f }; + float m_baseColorBlue{ 1.0f }; + + // Factor / Scale / Bias for input textures + float m_baseColorFactor{ 1.0f }; + + float m_normalFactor{ 1.0f }; + float m_metalFactor{ 1.0f }; + float m_roughnessScale{ 1.0f }; + float m_roughnessBias{ 0.0f }; + + float m_specularF0Factor{ 1.0f }; + float m_occlusionFactor{ 1.0f }; + float m_heightFactor{ 1.0f }; + float m_heightOffset{ 0.0f }; + + float m_heightBlendFactor{ 0.5f }; + + // Flags + DetailTextureFlags m_flags{ 0 }; + + // Image indices + uint16_t m_colorImageIndex{ InvalidImageIndex }; + uint16_t m_normalImageIndex{ InvalidImageIndex }; + uint16_t m_roughnessImageIndex{ InvalidImageIndex }; + uint16_t m_metalnessImageIndex{ InvalidImageIndex }; + + uint16_t m_specularF0ImageIndex{ InvalidImageIndex }; + uint16_t m_occlusionImageIndex{ InvalidImageIndex }; + uint16_t m_heightImageIndex{ InvalidImageIndex }; + + // 16 byte aligned + uint16_t m_padding1; + uint32_t m_padding2; + uint32_t m_padding3; + }; + static_assert(sizeof(DetailMaterialShaderData) % 16 == 0, "DetailMaterialShaderData must be 16 byte aligned."); + + struct DetailMaterialData + { + AZ::Data::AssetId m_assetId; + AZ::RPI::Material::ChangeId m_materialChangeId{AZ::RPI::Material::DEFAULT_CHANGE_ID}; + uint32_t refCount = 0; + uint16_t m_detailMaterialBufferIndex{ 0xFFFF }; + + AZ::Data::Instance m_colorImage; + AZ::Data::Instance m_normalImage; + AZ::Data::Instance m_roughnessImage; + AZ::Data::Instance m_metalnessImage; + AZ::Data::Instance m_specularF0Image; + AZ::Data::Instance m_occlusionImage; + AZ::Data::Instance m_heightImage; + }; + + struct DetailMaterialSurface + { + AZ::Crc32 m_surfaceTag; + uint16_t m_detailMaterialId; + }; + + struct DetailMaterialListRegion + { + AZ::EntityId m_entityId; + AZ::Aabb m_region{AZ::Aabb::CreateNull()}; + AZStd::vector m_materialsForSurfaces; + }; + + // System-level parameters + static constexpr int32_t DetailTextureSize{ 1024 }; + static constexpr int32_t DetailTextureSizeHalf{ DetailTextureSize / 2 }; + static constexpr float DetailTextureScale{ 0.5f }; + + // AzFramework::Terrain::TerrainDataNotificationBus overrides... + void OnTerrainDataChanged(const AZ::Aabb& dirtyRegion, TerrainDataChangedMask dataChangedMask) override; + + // TerrainAreaMaterialNotificationBus overrides... + void OnTerrainSurfaceMaterialMappingCreated(AZ::EntityId entityId, SurfaceData::SurfaceTag surfaceTag, MaterialInstance material) override; + void OnTerrainSurfaceMaterialMappingDestroyed(AZ::EntityId entityId, SurfaceData::SurfaceTag surfaceTag) override; + void OnTerrainSurfaceMaterialMappingChanged(AZ::EntityId entityId, SurfaceData::SurfaceTag surfaceTag, MaterialInstance material) override; + void OnTerrainSurfaceMaterialMappingRegionChanged(AZ::EntityId entityId, const AZ::Aabb& oldRegion, const AZ::Aabb& newRegion) override; + + //! Removes all images from all detail materials from the bindless image array + void RemoveAllImages(); + + //! Creates or updates an existing detail material with settings from a material instance + uint16_t CreateOrUpdateDetailMaterial(MaterialInstance material); + + //! Decrements the ref count on a detail material and removes it if it reaches 0 + void CheckDetailMaterialForDeletion(uint16_t detailMaterialId); + + //! Updates a specific detail material with settings from a material instance + void UpdateDetailMaterialData(uint16_t detailMaterialIndex, MaterialInstance material); + + //! Checks to see if the detail material id texture needs to update based on new center and bounds. Any + //! required updates are then executed. + void CheckUpdateDetailTexture(const Aabb2i& newBounds, const Vector2i& newCenter); + + //! Updates the detail texture in a given area + void UpdateDetailTexture(const Aabb2i& updateArea, const Aabb2i& textureBounds, const Vector2i& centerPixel); + + //! Finds the detail material Id for a surface type and position + uint16_t GetDetailMaterialForSurfaceTypeAndPosition(AZ::Crc32 surfaceType, const AZ::Vector2& position); + + //! Calculates which regions of the detail material id texture need to be updated based on the update area. Since + //! the "center" of the detail material id texture can move, a single update region in contiguous world space may + //! map to up to 4 different areas on teh detail material id texture. + uint8_t CalculateUpdateRegions(const Aabb2i& updateArea, const Aabb2i& textureBounds, const Vector2i& centerPixel, + AZStd::array& textureSpaceAreas, AZStd::array& scaledWorldSpaceAreas); + + DetailMaterialListRegion* FindByEntityId(AZ::EntityId entityId, AZ::Render::IndexedDataVector& container); + DetailMaterialListRegion& FindOrCreateByEntityId(AZ::EntityId entityId, AZ::Render::IndexedDataVector& container); + void RemoveByEntityId(AZ::EntityId entityId, AZ::Render::IndexedDataVector& container); + + AZStd::shared_ptr m_bindlessImageHandler; + + AZ::Data::Instance m_detailTextureImage; + + AZ::Render::IndexedDataVector m_detailMaterials; + AZ::Render::IndexedDataVector m_detailMaterialRegions; + AZ::Render::SparseVector m_detailMaterialShaderData; + AZ::Render::GpuBufferHandler m_detailMaterialDataBuffer; + + AZ::Aabb m_dirtyDetailRegion{ AZ::Aabb::CreateNull() }; + AZ::Vector3 m_previousCameraPosition = AZ::Vector3(AZStd::numeric_limits::max(), 0.0, 0.0); + Aabb2i m_detailTextureBounds; + Vector2i m_detailTextureCenter; + + AZ::RHI::ShaderInputImageIndex m_detailMaterialIdPropertyIndex; + AZ::RHI::ShaderInputBufferIndex m_detailMaterialDataIndex; + AZ::RHI::ShaderInputConstantIndex m_detailCenterPropertyIndex; + AZ::RHI::ShaderInputConstantIndex m_detailAabbPropertyIndex; + AZ::RHI::ShaderInputConstantIndex m_detailHalfPixelUvPropertyIndex; + + bool m_isInitialized{ false }; + bool m_detailMaterialBufferNeedsUpdate{ false }; + bool m_detailImageNeedsUpdate{ false }; + + }; +} diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainFeatureProcessor.cpp b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainFeatureProcessor.cpp index 9f83844243..351c34308a 100644 --- a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainFeatureProcessor.cpp +++ b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainFeatureProcessor.cpp @@ -7,38 +7,22 @@ */ #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 @@ -50,79 +34,19 @@ namespace Terrain { [[maybe_unused]] const char* TerrainFPName = "TerrainFeatureProcessor"; const char* TerrainHeightmapChars = "TerrainHeightmap"; - const char* TerrainDetailChars = "TerrainDetail"; } - namespace ViewSrgInputs + namespace SceneSrgInputs { static const char* const HeightmapImage("m_heightmapImage"); + static const char* const TerrainWorldData("m_terrainWorldData"); } namespace TerrainSrgInputs { - static const char* const DetailMaterialIdImage("m_detailMaterialIdImage"); - static const char* const DetailMaterialData("m_detailMaterialData"); - static const char* const DetailMaterialIdImageCenter("m_detailMaterialIdImageCenter"); - static const char* const DetailHalfPixelUv("m_detailHalfPixelUv"); - static const char* const DetailAabb("m_detailAabb"); - static const char* const DetailTextures("m_detailTextures"); - } - - namespace DetailMaterialInputs - { - static const char* const BaseColorColor("baseColor.color"); - static const char* const BaseColorMap("baseColor.textureMap"); - static const char* const BaseColorUseTexture("baseColor.useTexture"); - static const char* const BaseColorFactor("baseColor.factor"); - static const char* const BaseColorBlendMode("baseColor.textureBlendMode"); - static const char* const MetallicMap("metallic.textureMap"); - static const char* const MetallicUseTexture("metallic.useTexture"); - static const char* const MetallicFactor("metallic.factor"); - static const char* const RoughnessMap("roughness.textureMap"); - static const char* const RoughnessUseTexture("roughness.useTexture"); - static const char* const RoughnessFactor("roughness.factor"); - static const char* const RoughnessLowerBound("roughness.lowerBound"); - static const char* const RoughnessUpperBound("roughness.upperBound"); - static const char* const SpecularF0Map("specularF0.textureMap"); - static const char* const SpecularF0UseTexture("specularF0.useTexture"); - static const char* const SpecularF0Factor("specularF0.factor"); - static const char* const NormalMap("normal.textureMap"); - static const char* const NormalUseTexture("normal.useTexture"); - static const char* const NormalFactor("normal.factor"); - static const char* const NormalFlipX("normal.flipX"); - static const char* const NormalFlipY("normal.flipY"); - static const char* const DiffuseOcclusionMap("occlusion.diffuseTextureMap"); - static const char* const DiffuseOcclusionUseTexture("occlusion.diffuseUseTexture"); - static const char* const DiffuseOcclusionFactor("occlusion.diffuseFactor"); - static const char* const HeightMap("parallax.textureMap"); - static const char* const HeightUseTexture("parallax.useTexture"); - static const char* const HeightFactor("parallax.factor"); - static const char* const HeightOffset("parallax.offset"); - static const char* const HeightBlendFactor("parallax.blendFactor"); + static const char* const Textures("m_textures"); } - namespace ShaderInputs - { - static const char* const ModelToWorld("m_modelToWorld"); - static const char* const TerrainData("m_terrainData"); - static const char* const MacroMaterialData("m_macroMaterialData"); - static const char* const MacroMaterialCount("m_macroMaterialCount"); - static const char* const MacroColorMap("m_macroColorMap"); - static const char* const MacroNormalMap("m_macroNormalMap"); - } - - AZ_CVAR(bool, - r_terrainDebugDetailMaterials, - false, - [](const bool& value) - { - AZ::RPI::ShaderSystemInterface::Get()->SetGlobalShaderOption(AZ::Name{ "o_debugDetailMaterialIds" }, AZ::RPI::ShaderOptionValue{ value }); - }, - AZ::ConsoleFunctorFlags::Null, - "Turns on debugging for detail material ids for terrain." - ); - - void TerrainFeatureProcessor::Reflect(AZ::ReflectContext* context) { if (AZ::SerializeContext* serialize = azrtti_cast(context)) @@ -150,13 +74,17 @@ namespace Terrain void TerrainFeatureProcessor::Initialize() { - // Load indices for the View Srg. + m_meshManager.Initialize(); + m_imageArrayHandler = AZStd::make_shared(); - auto viewSrgLayout = AZ::RPI::RPISystemInterface::Get()->GetViewSrgLayout(); + auto sceneSrgLayout = AZ::RPI::RPISystemInterface::Get()->GetSceneSrgLayout(); - m_heightmapPropertyIndex = viewSrgLayout->FindShaderInputImageIndex(AZ::Name(ViewSrgInputs::HeightmapImage)); - AZ_Error(TerrainFPName, m_heightmapPropertyIndex.IsValid(), "Failed to find view srg input constant %s.", ViewSrgInputs::HeightmapImage); + m_heightmapPropertyIndex = sceneSrgLayout->FindShaderInputImageIndex(AZ::Name(SceneSrgInputs::HeightmapImage)); + AZ_Error(TerrainFPName, m_heightmapPropertyIndex.IsValid(), "Failed to find scene srg input constant %s.", SceneSrgInputs::HeightmapImage); + m_worldDataIndex = sceneSrgLayout->FindShaderInputConstantIndex(AZ::Name(SceneSrgInputs::TerrainWorldData)); + AZ_Error(TerrainFPName, m_worldDataIndex.IsValid(), "Failed to find scene srg input constant %s.", SceneSrgInputs::TerrainWorldData); + // Load the terrain material asynchronously const AZStd::string materialFilePath = "Materials/Terrain/DefaultPbrTerrain.azmaterial"; m_materialAssetLoader = AZStd::make_unique(); @@ -179,31 +107,24 @@ namespace Terrain } } ); - if (!InitializePatchModel()) - { - AZ_Error(TerrainFPName, false, "Failed to create Terrain render buffers!"); - return; - } OnTerrainDataChanged(AZ::Aabb::CreateNull(), TerrainDataChangedMask::HeightData); } void TerrainFeatureProcessor::Deactivate() { - TerrainMacroMaterialNotificationBus::Handler::BusDisconnect(); AzFramework::Terrain::TerrainDataNotificationBus::Handler::BusDisconnect(); AZ::RPI::MaterialReloadNotificationBus::Handler::BusDisconnect(); DisableSceneNotification(); + OnTerrainDataDestroyBegin(); - m_patchModel = {}; - m_areaData = {}; - m_dirtyRegion = AZ::Aabb::CreateNull(); - m_sectorData.clear(); - m_macroMaterials.Clear(); m_materialAssetLoader = {}; m_materialInstance = {}; + m_meshManager.Reset(); + m_macroMaterialManager.Reset(); + m_detailMaterialManager.Reset(); } void TerrainFeatureProcessor::Render(const AZ::RPI::FeatureProcessor::RenderPacket& packet) @@ -213,7 +134,10 @@ namespace Terrain void TerrainFeatureProcessor::OnTerrainDataDestroyBegin() { - m_areaData = {}; + m_heightmapImage = {}; + m_terrainBounds = AZ::Aabb::CreateNull(); + m_dirtyRegion = AZ::Aabb::CreateNull(); + m_heightmapNeedsUpdate = false; } void TerrainFeatureProcessor::OnTerrainDataChanged(const AZ::Aabb& dirtyRegion, TerrainDataChangedMask dataChangedMask) @@ -222,10 +146,6 @@ namespace Terrain { TerrainHeightOrSettingsUpdated(dirtyRegion); } - if ((dataChangedMask & TerrainDataChangedMask::SurfaceData) != 0) - { - TerrainSurfaceDataUpdated(dirtyRegion); - } } void TerrainFeatureProcessor::TerrainHeightOrSettingsUpdated(const AZ::Aabb& dirtyRegion) @@ -239,1335 +159,263 @@ namespace Terrain m_dirtyRegion.AddAabb(regionToUpdate); m_dirtyRegion.Clamp(worldBounds); - const AZ::Transform transform = AZ::Transform::CreateTranslation(worldBounds.GetCenter()); - AZ::Vector2 queryResolution2D = AZ::Vector2(1.0f); AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( queryResolution2D, &AzFramework::Terrain::TerrainDataRequests::GetTerrainHeightQueryResolution); // Currently query resolution is multidimensional but the rendering system only supports this changing in one dimension. float queryResolution = queryResolution2D.GetX(); - // Sectors need to be rebuilt if the world bounds change in the x/y, or the sample spacing changes. - m_areaData.m_rebuildSectors = m_areaData.m_rebuildSectors || - m_areaData.m_terrainBounds.GetMin().GetX() != worldBounds.GetMin().GetX() || - m_areaData.m_terrainBounds.GetMin().GetY() != worldBounds.GetMin().GetY() || - m_areaData.m_terrainBounds.GetMax().GetX() != worldBounds.GetMax().GetX() || - m_areaData.m_terrainBounds.GetMax().GetY() != worldBounds.GetMax().GetY() || - m_areaData.m_sampleSpacing != queryResolution; - - m_areaData.m_transform = transform; - m_areaData.m_terrainBounds = worldBounds; - m_areaData.m_sampleSpacing = queryResolution; - m_areaData.m_heightmapUpdated = true; + m_terrainBounds = worldBounds; + m_sampleSpacing = queryResolution; + m_heightmapNeedsUpdate = true; } - void TerrainFeatureProcessor::TerrainSurfaceDataUpdated(const AZ::Aabb& dirtyRegion) + void TerrainFeatureProcessor::OnRenderPipelinePassesChanged([[maybe_unused]] AZ::RPI::RenderPipeline* renderPipeline) { - m_dirtyDetailRegion.AddAabb(dirtyRegion); + CacheForwardPass(); } - void TerrainFeatureProcessor::OnTerrainMacroMaterialCreated(AZ::EntityId entityId, const MacroMaterialData& newMaterialData) + void TerrainFeatureProcessor::UpdateHeightmapImage() { - MacroMaterialData& materialData = FindOrCreateByEntityId(entityId, m_macroMaterials); - - UpdateMacroMaterialData(materialData, newMaterialData); + int32_t heightmapImageXStart = aznumeric_cast(AZStd::ceilf(m_terrainBounds.GetMin().GetX() / m_sampleSpacing)); + int32_t heightmapImageXEnd = aznumeric_cast(AZStd::floorf(m_terrainBounds.GetMax().GetX() / m_sampleSpacing)) + 1; + int32_t heightmapImageYStart = aznumeric_cast(AZStd::ceilf(m_terrainBounds.GetMin().GetY() / m_sampleSpacing)); + int32_t heightmapImageYEnd = aznumeric_cast(AZStd::floorf(m_terrainBounds.GetMax().GetY() / m_sampleSpacing)) + 1; + uint32_t heightmapImageWidth = heightmapImageXEnd - heightmapImageXStart; + uint32_t heightmapImageHeight = heightmapImageYEnd - heightmapImageYStart; - // Update all sectors in region. - ForOverlappingSectors(materialData.m_bounds, - [&](SectorData& sectorData) { - if (sectorData.m_macroMaterials.size() < sectorData.m_macroMaterials.max_size()) - { - sectorData.m_macroMaterials.push_back(m_macroMaterials.GetIndexForData(&materialData)); - } - } - ); - } + const AZ::RHI::Size heightmapSize = AZ::RHI::Size(heightmapImageWidth, heightmapImageHeight, 1); - void TerrainFeatureProcessor::OnTerrainMacroMaterialChanged(AZ::EntityId entityId, const MacroMaterialData& newMaterialData) - { - MacroMaterialData& data = FindOrCreateByEntityId(entityId, m_macroMaterials); - UpdateMacroMaterialData(data, newMaterialData); - } - - void TerrainFeatureProcessor::OnTerrainMacroMaterialRegionChanged( - AZ::EntityId entityId, [[maybe_unused]] const AZ::Aabb& oldRegion, const AZ::Aabb& newRegion) - { - MacroMaterialData& materialData = FindOrCreateByEntityId(entityId, m_macroMaterials); - for (SectorData& sectorData : m_sectorData) + if (!m_heightmapImage || m_heightmapImage->GetDescriptor().m_size != heightmapSize) { - bool overlapsOld = sectorData.m_aabb.Overlaps(materialData.m_bounds); - bool overlapsNew = sectorData.m_aabb.Overlaps(newRegion); - if (overlapsOld && !overlapsNew) - { - // Remove the macro material from this sector - for (uint16_t& idx : sectorData.m_macroMaterials) - { - if (m_macroMaterials.GetData(idx).m_entityId == entityId) - { - idx = sectorData.m_macroMaterials.back(); - sectorData.m_macroMaterials.pop_back(); - } - } - } - else if (overlapsNew && !overlapsOld) - { - // Add the macro material to this sector - if (sectorData.m_macroMaterials.size() < MaxMaterialsPerSector) - { - sectorData.m_macroMaterials.push_back(m_macroMaterials.GetIndexForData(&materialData)); - } - } - } - m_areaData.m_macroMaterialsUpdated = true; - materialData.m_bounds = newRegion; - } + const AZ::Data::Instance imagePool = AZ::RPI::ImageSystemInterface::Get()->GetSystemAttachmentPool(); + AZ::RHI::ImageDescriptor imageDescriptor = AZ::RHI::ImageDescriptor::Create2D( + AZ::RHI::ImageBindFlags::ShaderRead, heightmapSize.m_width, heightmapSize.m_height, AZ::RHI::Format::R16_UNORM + ); - void TerrainFeatureProcessor::OnTerrainMacroMaterialDestroyed(AZ::EntityId entityId) - { - const MacroMaterialData* materialData = FindByEntityId(entityId, m_macroMaterials); + const AZ::Name TerrainHeightmapName = AZ::Name(TerrainHeightmapChars); + m_heightmapImage = AZ::RPI::AttachmentImage::Create(*imagePool.get(), imageDescriptor, TerrainHeightmapName, nullptr, nullptr); + AZ_Error(TerrainFPName, m_heightmapImage, "Failed to initialize the heightmap image."); + + // World size changed, so the whole height map needs updating. + m_dirtyRegion = m_terrainBounds; + m_imageBindingsNeedUpdate = true; + } - if (materialData) + if (!m_dirtyRegion.IsValid()) { - uint16_t destroyedMaterialIndex = m_macroMaterials.GetIndexForData(materialData); - ForOverlappingSectors(materialData->m_bounds, - [&](SectorData& sectorData) { - for (uint16_t& idx : sectorData.m_macroMaterials) - { - if (idx == destroyedMaterialIndex) - { - idx = sectorData.m_macroMaterials.back(); - sectorData.m_macroMaterials.pop_back(); - } - } - }); + return; } - m_areaData.m_macroMaterialsUpdated = true; - RemoveByEntityId(entityId, m_macroMaterials); - } - - void TerrainFeatureProcessor::OnTerrainSurfaceMaterialMappingCreated(AZ::EntityId entityId, SurfaceData::SurfaceTag surfaceTag, MaterialInstance material) - { - DetailMaterialListRegion& materialRegion = FindOrCreateByEntityId(entityId, m_detailMaterialRegions); + int32_t xStart = aznumeric_cast(AZStd::ceilf(m_dirtyRegion.GetMin().GetX() / m_sampleSpacing)); + int32_t xEnd = aznumeric_cast(AZStd::floorf(m_dirtyRegion.GetMax().GetX() / m_sampleSpacing)) + 1; + int32_t yStart = aznumeric_cast(AZStd::ceilf(m_dirtyRegion.GetMin().GetY() / m_sampleSpacing)); + int32_t yEnd = aznumeric_cast(AZStd::floorf(m_dirtyRegion.GetMax().GetY() / m_sampleSpacing)) + 1; + uint32_t updateWidth = xEnd - xStart; + uint32_t updateHeight = yEnd - yStart; - // Validate that the surface tag is new - for (DetailMaterialSurface& surface : materialRegion.m_materialsForSurfaces) + AZStd::vector pixels; + pixels.reserve(updateWidth * updateHeight); { - if (surface.m_surfaceTag == surfaceTag) - { - AZ_Error(TerrainFPName, false, "Already have a surface material mapping for this surface tag."); - return; - } - } - - uint16_t detailMaterialId = CreateOrUpdateDetailMaterial(material); - materialRegion.m_materialsForSurfaces.push_back({ surfaceTag, detailMaterialId }); - m_detailMaterials.GetData(detailMaterialId).refCount++; - m_dirtyDetailRegion.AddAabb(materialRegion.m_region); - } - - void TerrainFeatureProcessor::OnRenderPipelinePassesChanged([[maybe_unused]] AZ::RPI::RenderPipeline* renderPipeline) - { - CacheForwardPass(); - } + // Block other threads from accessing the surface data bus while we are in GetHeightFromFloats (which may call into the SurfaceData bus). + // We lock our surface data mutex *before* checking / setting "isRequestInProgress" so that we prevent race conditions + // that create false detection of cyclic dependencies when multiple requests occur on different threads simultaneously. + // (One case where this was previously able to occur was in rapid updating of the Preview widget on the + // GradientSurfaceDataComponent in the Editor when moving the threshold sliders back and forth rapidly) - void TerrainFeatureProcessor::CheckDetailMaterialForDeletion(uint16_t detailMaterialId) - { - auto& detailMaterialData = m_detailMaterials.GetData(detailMaterialId); - if (--detailMaterialData.refCount == 0) - { - uint16_t bufferIndex = detailMaterialData.m_detailMaterialBufferIndex; - DetailMaterialShaderData& shaderData = m_detailMaterialShaderData.GetElement(bufferIndex); + auto& surfaceDataContext = SurfaceData::SurfaceDataSystemRequestBus::GetOrCreateContext(false); + typename SurfaceData::SurfaceDataSystemRequestBus::Context::DispatchLockGuard scopeLock(surfaceDataContext.m_contextMutex); - for (uint16_t imageIndex : - { - shaderData.m_colorImageIndex, - shaderData.m_normalImageIndex, - shaderData.m_roughnessImageIndex, - shaderData.m_metalnessImageIndex, - shaderData.m_specularF0ImageIndex, - shaderData.m_occlusionImageIndex, - shaderData.m_heightImageIndex - }) + for (int32_t y = yStart; y < yEnd; y++) { - if (imageIndex != InvalidDetailImageIndex) + for (int32_t x = xStart; x < xEnd; x++) { - m_detailImageViews.at(imageIndex) = AZ::RPI::ImageSystemInterface::Get()->GetSystemImage(AZ::RPI::SystemImage::Magenta)->GetImageView(); - m_detailImageViewFreeList.push_back(imageIndex); - m_detailImagesNeedUpdate = true; - } - } - - m_detailMaterialShaderData.Release(bufferIndex); - m_detailMaterials.RemoveIndex(detailMaterialId); - } - } - - void TerrainFeatureProcessor::OnTerrainSurfaceMaterialMappingDestroyed(AZ::EntityId entityId, SurfaceData::SurfaceTag surfaceTag) - { - DetailMaterialListRegion& materialRegion = FindOrCreateByEntityId(entityId, m_detailMaterialRegions); + bool terrainExists = true; + float terrainHeight = 0.0f; + float xPos = x * m_sampleSpacing; + float yPos = y * m_sampleSpacing; + AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( + terrainHeight, &AzFramework::Terrain::TerrainDataRequests::GetHeightFromFloats, + xPos, yPos, AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT, &terrainExists); - for (DetailMaterialSurface& surface : materialRegion.m_materialsForSurfaces) - { - if (surface.m_surfaceTag == surfaceTag) - { - CheckDetailMaterialForDeletion(surface.m_detailMaterialId); + const float clampedHeight = AZ::GetClamp((terrainHeight - m_terrainBounds.GetMin().GetZ()) / m_terrainBounds.GetExtents().GetZ(), 0.0f, 1.0f); + const float expandedHeight = AZStd::roundf(clampedHeight * AZStd::numeric_limits::max()); + const uint16_t uint16Height = aznumeric_cast(expandedHeight); - if (surface.m_surfaceTag != materialRegion.m_materialsForSurfaces.back().m_surfaceTag) - { - AZStd::swap(surface, materialRegion.m_materialsForSurfaces.back()); + pixels.push_back(uint16Height); } - materialRegion.m_materialsForSurfaces.pop_back(); - m_dirtyDetailRegion.AddAabb(materialRegion.m_region); - return; } } - AZ_Error(TerrainFPName, false, "Could not find surface tag to destroy for OnTerrainSurfaceMaterialMappingDestroyed()."); - } - - void TerrainFeatureProcessor::OnTerrainSurfaceMaterialMappingChanged(AZ::EntityId entityId, SurfaceData::SurfaceTag surfaceTag, MaterialInstance material) - { - DetailMaterialListRegion& materialRegion = FindOrCreateByEntityId(entityId, m_detailMaterialRegions); - bool found = false; - uint16_t materialId = CreateOrUpdateDetailMaterial(material); - for (DetailMaterialSurface& surface : materialRegion.m_materialsForSurfaces) + if (m_heightmapImage) { - if (surface.m_surfaceTag == surfaceTag) - { - found = true; - if (surface.m_detailMaterialId != materialId) - { - ++m_detailMaterials.GetData(materialId).refCount; - CheckDetailMaterialForDeletion(surface.m_detailMaterialId); - surface.m_detailMaterialId = materialId; - } - break; - } - } + constexpr uint32_t BytesPerPixel = sizeof(uint16_t); + const float left = xStart - (m_terrainBounds.GetMin().GetX() / m_sampleSpacing); + const float top = yStart - (m_terrainBounds.GetMin().GetY() / m_sampleSpacing); - if (!found) - { - ++m_detailMaterials.GetData(materialId).refCount; - materialRegion.m_materialsForSurfaces.push_back({ surfaceTag, materialId }); - } - m_dirtyDetailRegion.AddAabb(materialRegion.m_region); - } + AZ::RHI::ImageUpdateRequest imageUpdateRequest; + imageUpdateRequest.m_imageSubresourcePixelOffset.m_left = aznumeric_cast(left); + imageUpdateRequest.m_imageSubresourcePixelOffset.m_top = aznumeric_cast(top); + imageUpdateRequest.m_sourceSubresourceLayout.m_bytesPerRow = updateWidth * BytesPerPixel; + imageUpdateRequest.m_sourceSubresourceLayout.m_bytesPerImage = updateWidth * updateHeight * BytesPerPixel; + imageUpdateRequest.m_sourceSubresourceLayout.m_rowCount = updateHeight; + imageUpdateRequest.m_sourceSubresourceLayout.m_size = AZ::RHI::Size(updateWidth, updateHeight, 1); + imageUpdateRequest.m_sourceData = pixels.data(); + imageUpdateRequest.m_image = m_heightmapImage->GetRHIImage(); - void TerrainFeatureProcessor::OnTerrainSurfaceMaterialMappingRegionChanged(AZ::EntityId entityId, const AZ::Aabb& oldRegion, const AZ::Aabb& newRegion) - { - DetailMaterialListRegion& materialRegion = FindOrCreateByEntityId(entityId, m_detailMaterialRegions); - materialRegion.m_region = newRegion; - m_dirtyDetailRegion.AddAabb(oldRegion); - m_dirtyDetailRegion.AddAabb(newRegion); + m_heightmapImage->UpdateImageContents(imageUpdateRequest); + } + + m_dirtyRegion = AZ::Aabb::CreateNull(); } - uint16_t TerrainFeatureProcessor::CreateOrUpdateDetailMaterial(MaterialInstance material) + void TerrainFeatureProcessor::PrepareMaterialData() { - static constexpr uint16_t InvalidDetailMaterial = 0xFFFF; - uint16_t detailMaterialId = InvalidDetailMaterial; + m_terrainSrg = {}; - for (auto& detailMaterialData : m_detailMaterials.GetDataVector()) + for (auto& shaderItem : m_materialInstance->GetShaderCollection()) { - if (detailMaterialData.m_assetId == material->GetAssetId()) + if (shaderItem.GetShaderAsset()->GetDrawListName() == AZ::Name("forward")) { - detailMaterialId = m_detailMaterials.GetIndexForData(&detailMaterialData); - UpdateDetailMaterialData(detailMaterialId, material); + const auto& shaderAsset = shaderItem.GetShaderAsset(); + m_terrainSrg = AZ::RPI::ShaderResourceGroup::Create(shaderItem.GetShaderAsset(), shaderAsset->GetSupervariantIndex(AZ::Name()), AZ::Name{"TerrainSrg"}); + AZ_Error(TerrainFPName, m_terrainSrg, "Failed to create Terrain shader resource group"); break; } } - AZ_Assert(m_detailMaterialShaderData.GetSize() < 0xFF, "Only 255 detail materials supported."); - - if (detailMaterialId == InvalidDetailMaterial && m_detailMaterialShaderData.GetSize() < 0xFF) - { - detailMaterialId = m_detailMaterials.GetFreeSlotIndex(); - auto& detailMaterialData = m_detailMaterials.GetData(detailMaterialId); - detailMaterialData.m_detailMaterialBufferIndex = aznumeric_cast(m_detailMaterialShaderData.Reserve()); - UpdateDetailMaterialData(detailMaterialId, material); - } - return detailMaterialId; - } - - void TerrainFeatureProcessor::UpdateDetailMaterialData(uint16_t detailMaterialIndex, MaterialInstance material) - { - DetailMaterialData& materialData = m_detailMaterials.GetData(detailMaterialIndex); - DetailMaterialShaderData& shaderData = m_detailMaterialShaderData.GetElement(materialData.m_detailMaterialBufferIndex); - - if (materialData.m_materialChangeId == material->GetCurrentChangeId()) - { - return; // material hasn't changed, nothing to do - } - - materialData.m_materialChangeId = material->GetCurrentChangeId(); - materialData.m_assetId = material->GetAssetId(); - - DetailTextureFlags& flags = shaderData.m_flags; - - auto getIndex = [&](const char* const indexName) -> AZ::RPI::MaterialPropertyIndex - { - const AZ::RPI::MaterialPropertyIndex index = material->FindPropertyIndex(AZ::Name(indexName)); - AZ_Warning(TerrainFPName, index.IsValid(), "Failed to find shader input constant %s.", indexName); - return index; - }; - - auto applyProperty = [&](const char* const indexName, auto& ref) -> void - { - const auto index = getIndex(indexName); - if (index.IsValid()) - { - // GetValue() expects the actaul type, not a reference type, so the reference needs to be removed. - using TypeRefRemoved = AZStd::remove_cvref_t; - ref = material->GetPropertyValue(index).GetValue(); - } - }; + AZ_Error(TerrainFPName, m_terrainSrg, "Terrain Srg not found on any shader in the terrain material"); - auto applyImage = [&](const char* const indexName, AZ::Data::Instance& ref, const char* const usingFlagName, DetailTextureFlags flagToSet, uint16_t& imageIndex) -> void + if (m_terrainSrg) { - // Determine if an image exists and if its using flag allows it to be used. - const auto index = getIndex(indexName); - const auto useTextureIndex = getIndex(usingFlagName); - bool useTextureValue = true; - if (useTextureIndex.IsValid()) + if (m_imageArrayHandler->IsInitialized()) { - useTextureValue = material->GetPropertyValue(useTextureIndex).GetValue(); + m_imageArrayHandler->UpdateSrgIndices(m_terrainSrg, AZ::Name(TerrainSrgInputs::Textures)); } - if (index.IsValid() && useTextureValue) + else { - ref = material->GetPropertyValue(index).GetValue>(); + m_imageArrayHandler->Initialize(m_terrainSrg, AZ::Name(TerrainSrgInputs::Textures)); } - useTextureValue = useTextureValue && ref; - flags = DetailTextureFlags(useTextureValue ? (flags | flagToSet) : (flags & ~flagToSet)); - // Update queues to add/remove textures depending on if the image is used - if (ref) + if (m_macroMaterialManager.IsInitialized()) { - if (imageIndex == InvalidDetailImageIndex) - { - if (m_detailImageViewFreeList.size() > 0) - { - imageIndex = m_detailImageViewFreeList.back(); - m_detailImageViewFreeList.pop_back(); - } - else - { - imageIndex = aznumeric_cast(m_detailImageViews.size()); - m_detailImageViews.push_back(); - } - } - m_detailImageViews.at(imageIndex) = ref->GetImageView(); - m_detailImagesNeedUpdate = true; + m_macroMaterialManager.UpdateSrgIndices(m_terrainSrg); } - else if (imageIndex != InvalidDetailImageIndex) + else { - m_detailImageViews.at(imageIndex) = AZ::RPI::ImageSystemInterface::Get()->GetSystemImage(AZ::RPI::SystemImage::Magenta)->GetImageView(); - m_detailImageViewFreeList.push_back(imageIndex); - m_detailImagesNeedUpdate = true; - imageIndex = InvalidDetailImageIndex; + m_macroMaterialManager.Initialize(m_imageArrayHandler, m_terrainSrg); } - }; - auto applyFlag = [&](const char* const indexName, DetailTextureFlags flagToSet) -> void - { - const auto index = getIndex(indexName); - if (index.IsValid()) + if (m_detailMaterialManager.IsInitialized()) { - bool flagValue = material->GetPropertyValue(index).GetValue(); - flags = DetailTextureFlags(flagValue ? flags | flagToSet : flags); + m_detailMaterialManager.UpdateSrgIndices(m_terrainSrg); } - }; - - auto getEnumName = [&](const char* const indexName) -> const AZStd::string_view - { - const auto index = getIndex(indexName); - if (index.IsValid()) + else { - uint32_t enumIndex = material->GetPropertyValue(index).GetValue(); - const AZ::Name& enumName = material->GetMaterialPropertiesLayout()->GetPropertyDescriptor(index)->GetEnumName(enumIndex); - return enumName.GetStringView(); + m_detailMaterialManager.Initialize(m_imageArrayHandler, m_terrainSrg); } - return ""; - }; - - using namespace DetailMaterialInputs; - applyImage(BaseColorMap, materialData.m_colorImage, BaseColorUseTexture, DetailTextureFlags::UseTextureBaseColor, shaderData.m_colorImageIndex); - applyProperty(BaseColorFactor, shaderData.m_baseColorFactor); - - const auto index = getIndex(BaseColorColor); - if (index.IsValid()) - { - AZ::Color baseColor = material->GetPropertyValue(index).GetValue(); - shaderData.m_baseColorRed = baseColor.GetR(); - shaderData.m_baseColorGreen = baseColor.GetG(); - shaderData.m_baseColorBlue = baseColor.GetB(); - } - - const AZStd::string_view& blendModeString = getEnumName(BaseColorBlendMode); - if (blendModeString == "Multiply") - { - flags = DetailTextureFlags(flags | DetailTextureFlags::BlendModeMultiply); - } - else if (blendModeString == "LinearLight") - { - flags = DetailTextureFlags(flags | DetailTextureFlags::BlendModeLinearLight); - } - else if (blendModeString == "Lerp") - { - flags = DetailTextureFlags(flags | DetailTextureFlags::BlendModeLerp); - } - else if (blendModeString == "Overlay") - { - flags = DetailTextureFlags(flags | DetailTextureFlags::BlendModeOverlay); - } - - applyImage(MetallicMap, materialData.m_metalnessImage, MetallicUseTexture, DetailTextureFlags::UseTextureMetallic, shaderData.m_metalnessImageIndex); - applyProperty(MetallicFactor, shaderData.m_metalFactor); - - applyImage(RoughnessMap, materialData.m_roughnessImage, RoughnessUseTexture, DetailTextureFlags::UseTextureRoughness, shaderData.m_roughnessImageIndex); - - if ((flags & DetailTextureFlags::UseTextureRoughness) > 0) - { - float lowerBound = 0.0; - float upperBound = 1.0; - applyProperty(RoughnessLowerBound, lowerBound); - applyProperty(RoughnessUpperBound, upperBound); - shaderData.m_roughnessBias = lowerBound; - shaderData.m_roughnessScale = upperBound - lowerBound; } else { - shaderData.m_roughnessBias = 0.0; - applyProperty(RoughnessFactor, shaderData.m_roughnessScale); + m_imageArrayHandler->Reset(); + m_macroMaterialManager.Reset(); + m_detailMaterialManager.Reset(); } - - applyImage(SpecularF0Map, materialData.m_specularF0Image, SpecularF0UseTexture, DetailTextureFlags::UseTextureSpecularF0, shaderData.m_specularF0ImageIndex); - applyProperty(SpecularF0Factor, shaderData.m_specularF0Factor); - - applyImage(NormalMap, materialData.m_normalImage, NormalUseTexture, DetailTextureFlags::UseTextureNormal, shaderData.m_normalImageIndex); - applyProperty(NormalFactor, shaderData.m_normalFactor); - applyFlag(NormalFlipX, DetailTextureFlags::FlipNormalX); - applyFlag(NormalFlipY, DetailTextureFlags::FlipNormalY); - - applyImage(DiffuseOcclusionMap, materialData.m_occlusionImage, DiffuseOcclusionUseTexture, DetailTextureFlags::UseTextureOcclusion, shaderData.m_occlusionImageIndex); - applyProperty(DiffuseOcclusionFactor, shaderData.m_occlusionFactor); - - applyImage(HeightMap, materialData.m_heightImage, HeightUseTexture, DetailTextureFlags::UseTextureHeight, shaderData.m_heightImageIndex); - applyProperty(HeightFactor, shaderData.m_heightFactor); - applyProperty(HeightOffset, shaderData.m_heightOffset); - applyProperty(HeightBlendFactor, shaderData.m_heightBlendFactor); - - m_updateDetailMaterialBuffer = true; } - void TerrainFeatureProcessor::CheckUpdateDetailTexture(const Aabb2i& newBounds, const Vector2i& newCenter) + void TerrainFeatureProcessor::ProcessSurfaces(const FeatureProcessor::RenderPacket& process) { - if (!m_detailTextureImage) + AZ_PROFILE_FUNCTION(AzRender); + + if (!m_terrainBounds.IsValid()) { - // If the m_detailTextureImage doesn't exist, create it and populate the entire texture - - const AZ::Data::Instance imagePool = AZ::RPI::ImageSystemInterface::Get()->GetSystemAttachmentPool(); - AZ::RHI::ImageDescriptor imageDescriptor = AZ::RHI::ImageDescriptor::Create2D( - AZ::RHI::ImageBindFlags::ShaderRead, DetailTextureSize, DetailTextureSize, AZ::RHI::Format::R8G8B8A8_UINT - ); - const AZ::Name TerrainDetailName = AZ::Name(TerrainDetailChars); - m_detailTextureImage = AZ::RPI::AttachmentImage::Create(*imagePool.get(), imageDescriptor, TerrainDetailName, nullptr, nullptr); - AZ_Error(TerrainFPName, m_detailTextureImage, "Failed to initialize the detail texture image."); - - UpdateDetailTexture(newBounds, newBounds, newCenter); + return; } - else - { - // If the new bounds of the detail texture are different than the old bounds, then the edges of the texture need to be updated. - int32_t offsetX = m_detailTextureBounds.m_min.m_x - newBounds.m_min.m_x; - - // Horizontal edge update - if (newBounds.m_min.m_x != m_detailTextureBounds.m_min.m_x) + if (m_materialInstance && m_materialInstance->CanCompile()) + { + AZ::Vector3 cameraPosition = AZ::Vector3::CreateZero(); + for (auto& view : process.m_views) { - Aabb2i updateBounds; - if (newBounds.m_min.m_x < m_detailTextureBounds.m_min.m_x) + if ((view->GetUsageFlags() & AZ::RPI::View::UsageFlags::UsageCamera) > 0) { - updateBounds.m_min.m_x = newBounds.m_min.m_x; - updateBounds.m_max.m_x = m_detailTextureBounds.m_min.m_x; + cameraPosition = view->GetCameraTransform().GetTranslation(); + break; } - else - { - updateBounds.m_min.m_x = m_detailTextureBounds.m_max.m_x; - updateBounds.m_max.m_x = newBounds.m_max.m_x; + } + + if (m_meshManager.IsInitialized()) + { + bool surfacesRebuilt = false; + surfacesRebuilt = m_meshManager.CheckRebuildSurfaces(m_materialInstance, *GetParentScene()); + if (m_forceRebuildDrawPackets && !surfacesRebuilt) + { + m_meshManager.RebuildDrawPackets(*GetParentScene()); } - updateBounds.m_min.m_y = newBounds.m_min.m_y; - updateBounds.m_max.m_y = newBounds.m_max.m_y; - UpdateDetailTexture(updateBounds, newBounds, newCenter); + m_forceRebuildDrawPackets = false; } - // Vertical edge update - if (newBounds.m_min.m_y != m_detailTextureBounds.m_min.m_y) + if (m_terrainSrg) { - Aabb2i updateBounds; - // Don't update areas that have already been updated in the horizontal update. - updateBounds.m_min.m_x = newBounds.m_min.m_x + AZ::GetMax(0, offsetX); - updateBounds.m_max.m_x = newBounds.m_max.m_x + AZ::GetMin(0, offsetX); - if (newBounds.m_min.m_y < m_detailTextureBounds.m_min.m_y) + if (m_macroMaterialManager.IsInitialized()) { - updateBounds.m_min.m_y = newBounds.m_min.m_y; - updateBounds.m_max.m_y = m_detailTextureBounds.m_min.m_y; + m_macroMaterialManager.Update(m_terrainSrg); } - else + + if (m_detailMaterialManager.IsInitialized()) { - updateBounds.m_min.m_y = m_detailTextureBounds.m_max.m_y; - updateBounds.m_max.m_y = newBounds.m_max.m_y; + m_detailMaterialManager.Update(cameraPosition, m_terrainSrg); } - UpdateDetailTexture(updateBounds, newBounds, newCenter); } - if (m_dirtyDetailRegion.IsValid()) + if (m_heightmapNeedsUpdate) { - // If any regions are marked as dirty, then they should be updated. - - AZ::Vector3 currentMin = AZ::Vector3(newBounds.m_min.m_x * DetailTextureScale, newBounds.m_min.m_y * DetailTextureScale, -0.5f); - AZ::Vector3 currentMax = AZ::Vector3(newBounds.m_max.m_x * DetailTextureScale, newBounds.m_max.m_y * DetailTextureScale, 0.5f); - AZ::Aabb detailTextureCoverage = AZ::Aabb::CreateFromMinMax(currentMin, currentMax); - AZ::Vector3 previousMin = AZ::Vector3(m_detailTextureBounds.m_min.m_x * DetailTextureScale, m_detailTextureBounds.m_min.m_y * DetailTextureScale, -0.5f); - AZ::Vector3 previousMax = AZ::Vector3(m_detailTextureBounds.m_max.m_x * DetailTextureScale, m_detailTextureBounds.m_max.m_y * DetailTextureScale, 0.5f); - AZ::Aabb previousCoverage = AZ::Aabb::CreateFromMinMax(previousMin, previousMax); - - // Area of texture not already updated by camera movement above. - AZ::Aabb clampedCoverage = previousCoverage.GetClamped(detailTextureCoverage); - - // Clamp the dirty region to the area of the detail texture that is visible and not already updated. - clampedCoverage.Clamp(m_dirtyDetailRegion); - - if (clampedCoverage.IsValid()) - { - Aabb2i updateBounds; - updateBounds.m_min.m_x = aznumeric_cast(AZStd::roundf(clampedCoverage.GetMin().GetX() / DetailTextureScale)); - updateBounds.m_min.m_y = aznumeric_cast(AZStd::roundf(clampedCoverage.GetMin().GetY() / DetailTextureScale)); - updateBounds.m_max.m_x = aznumeric_cast(AZStd::roundf(clampedCoverage.GetMax().GetX() / DetailTextureScale)); - updateBounds.m_max.m_y = aznumeric_cast(AZStd::roundf(clampedCoverage.GetMax().GetY() / DetailTextureScale)); - if (updateBounds.m_min.m_x < updateBounds.m_max.m_x && updateBounds.m_min.m_y < updateBounds.m_max.m_y) - { - UpdateDetailTexture(updateBounds, newBounds, newCenter); - } - } + UpdateHeightmapImage(); + m_heightmapNeedsUpdate = false; + } + + if (m_imageArrayHandler->IsInitialized()) + { + bool result [[maybe_unused]] = m_imageArrayHandler->UpdateSrg(m_terrainSrg); + AZ_Error(TerrainFPName, result, "Failed to set image view unbounded array into shader resource group."); } } + + if (m_meshManager.IsInitialized()) + { + m_meshManager.DrawMeshes(process); + } - } - - uint8_t TerrainFeatureProcessor::CalculateUpdateRegions(const Aabb2i& updateArea, const Aabb2i& textureBounds, const Vector2i& centerPixel, - AZStd::array& textureSpaceAreas, AZStd::array& scaledWorldSpaceAreas) - { - Vector2i centerOffset = { centerPixel.m_x - DetailTextureSizeHalf, centerPixel.m_y - DetailTextureSizeHalf }; - - int32_t quadrantXOffset = centerPixel.m_x < DetailTextureSizeHalf ? DetailTextureSize : -DetailTextureSize; - int32_t quadrantYOffset = centerPixel.m_y < DetailTextureSizeHalf ? DetailTextureSize : -DetailTextureSize; - - uint8_t numQuadrants = 0; - - // For each of the 4 quadrants: - auto calculateQuadrant = [&](Vector2i quadrantOffset) + if (m_heightmapImage && m_imageBindingsNeedUpdate) { - Aabb2i offsetUpdateArea = updateArea + centerOffset + quadrantOffset; - Aabb2i updateSectionBounds = textureBounds.GetClamped(offsetUpdateArea); - if (updateSectionBounds.IsValid()) - { - textureSpaceAreas[numQuadrants] = updateSectionBounds - textureBounds.m_min; - scaledWorldSpaceAreas[numQuadrants] = updateSectionBounds - centerOffset - quadrantOffset; - ++numQuadrants; - } - }; + WorldShaderData worldData; + m_terrainBounds.GetMin().StoreToFloat3(worldData.m_min.data()); + m_terrainBounds.GetMax().StoreToFloat3(worldData.m_max.data()); - calculateQuadrant({ 0, 0 }); - calculateQuadrant({ quadrantXOffset, 0 }); - calculateQuadrant({ 0, quadrantYOffset }); - calculateQuadrant({ quadrantXOffset, quadrantYOffset }); + m_imageBindingsNeedUpdate = false; - return numQuadrants; - } + auto sceneSrg = GetParentScene()->GetShaderResourceGroup(); + sceneSrg->SetImage(m_heightmapPropertyIndex, m_heightmapImage); + sceneSrg->SetConstant(m_worldDataIndex, worldData); + } - void TerrainFeatureProcessor::UpdateDetailTexture(const Aabb2i& updateArea, const Aabb2i& textureBounds, const Vector2i& centerPixel) - { - if (!m_detailTextureImage) + if (m_materialInstance) { - return; + m_materialInstance->Compile(); } - struct DetailMaterialPixel + if (m_terrainSrg && m_forwardPass) { - uint8_t m_material1{ 255 }; - uint8_t m_material2{ 255 }; - uint8_t m_blend{ 0 }; // 0 = full weight on material1, 255 = full weight on material2 - uint8_t m_padding{ 0 }; - }; + m_terrainSrg->Compile(); + m_forwardPass->BindSrg(m_terrainSrg->GetRHIShaderResourceGroup()); + } + } - // Because the center of the detail texture may be offset, each update area may actually need to be split into - // up to 4 separate update areas in each sector of the quadrant. - AZStd::array textureSpaceAreas; - AZStd::array scaledWorldSpaceAreas; - uint8_t updateAreaCount = CalculateUpdateRegions(updateArea, textureBounds, centerPixel, textureSpaceAreas, scaledWorldSpaceAreas); - - // Pull the data for each area updated and use it to construct an update for the detail material id texture. - for (uint8_t i = 0; i < updateAreaCount; ++i) - { - const Aabb2i& quadrantTextureArea = textureSpaceAreas[i]; - const Aabb2i& quadrantWorldArea = scaledWorldSpaceAreas[i]; - - AZStd::vector pixels; - pixels.resize((quadrantWorldArea.m_max.m_x - quadrantWorldArea.m_min.m_x) * (quadrantWorldArea.m_max.m_y - quadrantWorldArea.m_min.m_y)); - uint32_t index = 0; - - for (int yPos = quadrantWorldArea.m_min.m_y; yPos < quadrantWorldArea.m_max.m_y; ++yPos) - { - for (int xPos = quadrantWorldArea.m_min.m_x; xPos < quadrantWorldArea.m_max.m_x; ++xPos) - { - AZ::Vector2 position = AZ::Vector2(xPos * DetailTextureScale, yPos * DetailTextureScale); - AzFramework::SurfaceData::SurfaceTagWeightList surfaceWeights; - AzFramework::Terrain::TerrainDataRequestBus::Broadcast(&AzFramework::Terrain::TerrainDataRequests::GetSurfaceWeightsFromVector2, position, surfaceWeights, AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT, nullptr); - - // Store the top two surface weights in the texture with m_blend storing the relative weight. - bool isFirstMaterial = true; - float firstWeight = 0.0f; - for (const auto& surfaceTagWeight : surfaceWeights) - { - if (surfaceTagWeight.m_weight > 0.0f) - { - AZ::Crc32 surfaceType = surfaceTagWeight.m_surfaceType; - uint16_t materialId = GetDetailMaterialForSurfaceTypeAndPosition(surfaceType, position); - if (materialId != m_detailMaterials.NoFreeSlot && materialId < 255) - { - if (isFirstMaterial) - { - pixels.at(index).m_material1 = aznumeric_cast(materialId); - firstWeight = surfaceTagWeight.m_weight; - // m_blend only needs to be calculated is material 2 is found, otherwise the initial value of 0 is correct. - isFirstMaterial = false; - } - else - { - pixels.at(index).m_material2 = aznumeric_cast(materialId); - float totalWeight = firstWeight + surfaceTagWeight.m_weight; - float blendWeight = 1.0f - (firstWeight / totalWeight); - pixels.at(index).m_blend = aznumeric_cast(AZStd::round(blendWeight * 255.0f)); - break; - } - } - } - else - { - break; // since the list is ordered, no other materials are in the list with positive weights. - } - } - ++index; - } - } - - const int32_t left = quadrantTextureArea.m_min.m_x; - const int32_t top = quadrantTextureArea.m_min.m_y; - const int32_t width = quadrantTextureArea.m_max.m_x - quadrantTextureArea.m_min.m_x; - const int32_t height = quadrantTextureArea.m_max.m_y - quadrantTextureArea.m_min.m_y; - - AZ::RHI::ImageUpdateRequest imageUpdateRequest; - imageUpdateRequest.m_imageSubresourcePixelOffset.m_left = aznumeric_cast(left); - imageUpdateRequest.m_imageSubresourcePixelOffset.m_top = aznumeric_cast(top); - imageUpdateRequest.m_sourceSubresourceLayout.m_bytesPerRow = width * sizeof(DetailMaterialPixel); - imageUpdateRequest.m_sourceSubresourceLayout.m_bytesPerImage = width * height * sizeof(DetailMaterialPixel); - imageUpdateRequest.m_sourceSubresourceLayout.m_rowCount = height; - imageUpdateRequest.m_sourceSubresourceLayout.m_size.m_width = width; - imageUpdateRequest.m_sourceSubresourceLayout.m_size.m_height = height; - imageUpdateRequest.m_sourceSubresourceLayout.m_size.m_depth = 1; - imageUpdateRequest.m_sourceData = pixels.data(); - imageUpdateRequest.m_image = m_detailTextureImage->GetRHIImage(); - - m_detailTextureImage->UpdateImageContents(imageUpdateRequest); - } - } - - uint16_t TerrainFeatureProcessor::GetDetailMaterialForSurfaceTypeAndPosition(AZ::Crc32 surfaceType, const AZ::Vector2& position) - { - for (const auto& materialRegion : m_detailMaterialRegions.GetDataVector()) - { - if (materialRegion.m_region.Contains(AZ::Vector3(position.GetX(), position.GetY(), 0.0f))) - { - for (const auto& materialSurface : materialRegion.m_materialsForSurfaces) - { - if (materialSurface.m_surfaceTag == surfaceType) - { - return m_detailMaterials.GetData(materialSurface.m_detailMaterialId).m_detailMaterialBufferIndex; - } - } - } - } - return m_detailMaterials.NoFreeSlot; - } - - void TerrainFeatureProcessor::UpdateTerrainData() - { - - const float queryResolution = m_areaData.m_sampleSpacing; - const AZ::Aabb& worldBounds = m_areaData.m_terrainBounds; - - int32_t heightmapImageXStart = aznumeric_cast(AZStd::ceilf(worldBounds.GetMin().GetX() / queryResolution)); - int32_t heightmapImageXEnd = aznumeric_cast(AZStd::floorf(worldBounds.GetMax().GetX() / queryResolution)) + 1; - int32_t heightmapImageYStart = aznumeric_cast(AZStd::ceilf(worldBounds.GetMin().GetY() / queryResolution)); - int32_t heightmapImageYEnd = aznumeric_cast(AZStd::floorf(worldBounds.GetMax().GetY() / queryResolution)) + 1; - uint32_t heightmapImageWidth = heightmapImageXEnd - heightmapImageXStart; - uint32_t heightmapImageHeight = heightmapImageYEnd - heightmapImageYStart; - - const AZ::RHI::Size heightmapSize = AZ::RHI::Size(heightmapImageWidth, heightmapImageHeight, 1); - - if (!m_areaData.m_heightmapImage || m_areaData.m_heightmapImage->GetDescriptor().m_size != heightmapSize) - { - const AZ::Data::Instance imagePool = AZ::RPI::ImageSystemInterface::Get()->GetSystemAttachmentPool(); - AZ::RHI::ImageDescriptor imageDescriptor = AZ::RHI::ImageDescriptor::Create2D( - AZ::RHI::ImageBindFlags::ShaderRead, heightmapSize.m_width, heightmapSize.m_height, AZ::RHI::Format::R16_UNORM - ); - - const AZ::Name TerrainHeightmapName = AZ::Name(TerrainHeightmapChars); - m_areaData.m_heightmapImage = AZ::RPI::AttachmentImage::Create(*imagePool.get(), imageDescriptor, TerrainHeightmapName, nullptr, nullptr); - AZ_Error(TerrainFPName, m_areaData.m_heightmapImage, "Failed to initialize the heightmap image."); - - // World size changed, so the whole height map needs updating. - m_dirtyRegion = worldBounds; - m_imagesNeedUpdate = true; - } - - int32_t xStart = aznumeric_cast(AZStd::ceilf(m_dirtyRegion.GetMin().GetX() / queryResolution)); - int32_t xEnd = aznumeric_cast(AZStd::floorf(m_dirtyRegion.GetMax().GetX() / queryResolution)) + 1; - int32_t yStart = aznumeric_cast(AZStd::ceilf(m_dirtyRegion.GetMin().GetY() / queryResolution)); - int32_t yEnd = aznumeric_cast(AZStd::floorf(m_dirtyRegion.GetMax().GetY() / queryResolution)) + 1; - uint32_t updateWidth = xEnd - xStart; - uint32_t updateHeight = yEnd - yStart; - - AZStd::vector pixels; - pixels.reserve(updateWidth * updateHeight); - - { - // Block other threads from accessing the surface data bus while we are in GetHeightFromFloats (which may call into the SurfaceData bus). - // We lock our surface data mutex *before* checking / setting "isRequestInProgress" so that we prevent race conditions - // that create false detection of cyclic dependencies when multiple requests occur on different threads simultaneously. - // (One case where this was previously able to occur was in rapid updating of the Preview widget on the - // GradientSurfaceDataComponent in the Editor when moving the threshold sliders back and forth rapidly) - - auto& surfaceDataContext = SurfaceData::SurfaceDataSystemRequestBus::GetOrCreateContext(false); - typename SurfaceData::SurfaceDataSystemRequestBus::Context::DispatchLockGuard scopeLock(surfaceDataContext.m_contextMutex); - - for (int32_t y = yStart; y < yEnd; y++) - { - for (int32_t x = xStart; x < xEnd; x++) - { - bool terrainExists = true; - float terrainHeight = 0.0f; - float xPos = x * queryResolution; - float yPos = y * queryResolution; - AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( - terrainHeight, &AzFramework::Terrain::TerrainDataRequests::GetHeightFromFloats, - xPos, yPos, AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT, &terrainExists); - - const float clampedHeight = AZ::GetClamp((terrainHeight - worldBounds.GetMin().GetZ()) / worldBounds.GetExtents().GetZ(), 0.0f, 1.0f); - const float expandedHeight = AZStd::roundf(clampedHeight * AZStd::numeric_limits::max()); - const uint16_t uint16Height = aznumeric_cast(expandedHeight); - - pixels.push_back(uint16Height); - } - } - } - - if (m_areaData.m_heightmapImage) - { - constexpr uint32_t BytesPerPixel = sizeof(uint16_t); - const float left = xStart - (worldBounds.GetMin().GetX() / queryResolution); - const float top = yStart - (worldBounds.GetMin().GetY() / queryResolution); - - AZ::RHI::ImageUpdateRequest imageUpdateRequest; - imageUpdateRequest.m_imageSubresourcePixelOffset.m_left = aznumeric_cast(left); - imageUpdateRequest.m_imageSubresourcePixelOffset.m_top = aznumeric_cast(top); - imageUpdateRequest.m_sourceSubresourceLayout.m_bytesPerRow = updateWidth * BytesPerPixel; - imageUpdateRequest.m_sourceSubresourceLayout.m_bytesPerImage = updateWidth * updateHeight * BytesPerPixel; - imageUpdateRequest.m_sourceSubresourceLayout.m_rowCount = updateHeight; - imageUpdateRequest.m_sourceSubresourceLayout.m_size.m_width = updateWidth; - imageUpdateRequest.m_sourceSubresourceLayout.m_size.m_height = updateHeight; - imageUpdateRequest.m_sourceSubresourceLayout.m_size.m_depth = 1; - imageUpdateRequest.m_sourceData = pixels.data(); - imageUpdateRequest.m_image = m_areaData.m_heightmapImage->GetRHIImage(); - - m_areaData.m_heightmapImage->UpdateImageContents(imageUpdateRequest); - } - - m_dirtyRegion = AZ::Aabb::CreateNull(); - } - - void TerrainFeatureProcessor::PrepareMaterialData() - { - const auto layout = m_materialInstance->GetAsset()->GetObjectSrgLayout(); - - m_modelToWorldIndex = layout->FindShaderInputConstantIndex(AZ::Name(ShaderInputs::ModelToWorld)); - AZ_Error(TerrainFPName, m_modelToWorldIndex.IsValid(), "Failed to find shader input constant %s.", ShaderInputs::ModelToWorld); - - m_terrainDataIndex = layout->FindShaderInputConstantIndex(AZ::Name(ShaderInputs::TerrainData)); - AZ_Error(TerrainFPName, m_terrainDataIndex.IsValid(), "Failed to find shader input constant %s.", ShaderInputs::TerrainData); - - m_macroMaterialDataIndex = layout->FindShaderInputConstantIndex(AZ::Name(ShaderInputs::MacroMaterialData)); - AZ_Error(TerrainFPName, m_macroMaterialDataIndex.IsValid(), "Failed to find shader input constant %s.", ShaderInputs::MacroMaterialData); - - m_macroMaterialCountIndex = layout->FindShaderInputConstantIndex(AZ::Name(ShaderInputs::MacroMaterialCount)); - AZ_Error(TerrainFPName, m_macroMaterialCountIndex.IsValid(), "Failed to find shader input constant %s.", ShaderInputs::MacroMaterialCount); - - m_macroColorMapIndex = layout->FindShaderInputImageIndex(AZ::Name(ShaderInputs::MacroColorMap)); - AZ_Error(TerrainFPName, m_macroColorMapIndex.IsValid(), "Failed to find shader input constant %s.", ShaderInputs::MacroColorMap); - - m_macroNormalMapIndex = layout->FindShaderInputImageIndex(AZ::Name(ShaderInputs::MacroNormalMap)); - AZ_Error(TerrainFPName, m_macroNormalMapIndex.IsValid(), "Failed to find shader input constant %s.", ShaderInputs::MacroNormalMap); - - m_terrainSrg = {}; - for (auto& shaderItem : m_materialInstance->GetShaderCollection()) - { - if (shaderItem.GetShaderAsset()->GetDrawListName() == AZ::Name("forward")) - { - const auto& shaderAsset = shaderItem.GetShaderAsset(); - m_terrainSrg = AZ::RPI::ShaderResourceGroup::Create(shaderItem.GetShaderAsset(), shaderAsset->GetSupervariantIndex(AZ::Name()), AZ::Name{"TerrainSrg"}); - AZ_Error(TerrainFPName, m_terrainSrg, "Failed to create Terrain shader resource group"); - break; - } - } - - AZ_Error(TerrainFPName, m_terrainSrg, "Terrain Srg not found on any shader in the terrain material"); - - if (m_terrainSrg) - { - const AZ::RHI::ShaderResourceGroupLayout* terrainSrgLayout = m_terrainSrg->GetLayout(); - - m_detailMaterialIdPropertyIndex = terrainSrgLayout->FindShaderInputImageIndex(AZ::Name(TerrainSrgInputs::DetailMaterialIdImage)); - AZ_Error(TerrainFPName, m_detailMaterialIdPropertyIndex.IsValid(), "Failed to find view srg input constant %s.", TerrainSrgInputs::DetailMaterialIdImage); - - m_detailCenterPropertyIndex = terrainSrgLayout->FindShaderInputConstantIndex(AZ::Name(TerrainSrgInputs::DetailMaterialIdImageCenter)); - AZ_Error(TerrainFPName, m_detailCenterPropertyIndex.IsValid(), "Failed to find view srg input constant %s.", TerrainSrgInputs::DetailMaterialIdImageCenter); - - m_detailHalfPixelUvPropertyIndex = terrainSrgLayout->FindShaderInputConstantIndex(AZ::Name(TerrainSrgInputs::DetailHalfPixelUv)); - AZ_Error(TerrainFPName, m_detailHalfPixelUvPropertyIndex.IsValid(), "Failed to find view srg input constant %s.", TerrainSrgInputs::DetailHalfPixelUv); - - m_detailAabbPropertyIndex = terrainSrgLayout->FindShaderInputConstantIndex(AZ::Name(TerrainSrgInputs::DetailAabb)); - AZ_Error(TerrainFPName, m_detailAabbPropertyIndex.IsValid(), "Failed to find view srg input constant %s.", TerrainSrgInputs::DetailAabb); - - m_detailTexturesIndex = terrainSrgLayout->FindShaderInputImageUnboundedArrayIndex(AZ::Name(TerrainSrgInputs::DetailTextures)); - AZ_Error(TerrainFPName, m_detailTexturesIndex.IsValid(), "Failed to find view srg input constant %s.", TerrainSrgInputs::DetailTextures); - - // Set up the gpu buffer for detail material data - AZ::Render::GpuBufferHandler::Descriptor desc; - desc.m_bufferName = "Detail Material Data"; - desc.m_bufferSrgName = TerrainSrgInputs::DetailMaterialData; - desc.m_elementSize = sizeof(DetailMaterialShaderData); - desc.m_srgLayout = terrainSrgLayout; - m_detailMaterialDataBuffer = AZ::Render::GpuBufferHandler(desc); - } - - // Find any macro materials that have already been created. - TerrainMacroMaterialRequestBus::EnumerateHandlers( - [&](TerrainMacroMaterialRequests* handler) - { - MacroMaterialData macroMaterial = handler->GetTerrainMacroMaterialData(); - AZ::EntityId entityId = *(Terrain::TerrainMacroMaterialRequestBus::GetCurrentBusId()); - OnTerrainMacroMaterialCreated(entityId, macroMaterial); - return true; - } - ); - TerrainMacroMaterialNotificationBus::Handler::BusConnect(); - - // Find any detail material areas that have already been created. - TerrainAreaMaterialRequestBus::EnumerateHandlers( - [&](TerrainAreaMaterialRequests* handler) - { - const AZ::Aabb& bounds = handler->GetTerrainSurfaceMaterialRegion(); - const AZStd::vector materialMappings = handler->GetSurfaceMaterialMappings(); - AZ::EntityId entityId = *(Terrain::TerrainAreaMaterialRequestBus::GetCurrentBusId()); - - DetailMaterialListRegion& materialRegion = FindOrCreateByEntityId(entityId, m_detailMaterialRegions); - materialRegion.m_region = bounds; - - for (const auto& materialMapping : materialMappings) - { - if (materialMapping.m_materialInstance) - { - OnTerrainSurfaceMaterialMappingCreated(entityId, materialMapping.m_surfaceTag, materialMapping.m_materialInstance); - } - } - return true; - } - ); - TerrainAreaMaterialNotificationBus::Handler::BusConnect(); - - } - - void TerrainFeatureProcessor::UpdateMacroMaterialData(MacroMaterialData& macroMaterialData, const MacroMaterialData& newMaterialData) - { - macroMaterialData = newMaterialData; - - if (macroMaterialData.m_bounds.IsValid()) - { - m_areaData.m_macroMaterialsUpdated = true; - } - } - - void TerrainFeatureProcessor::ProcessSurfaces(const FeatureProcessor::RenderPacket& process) - { - AZ_PROFILE_FUNCTION(AzRender); - - const AZ::Aabb& terrainBounds = m_areaData.m_terrainBounds; - - if (!terrainBounds.IsValid()) - { - return; - } - - if (m_materialInstance && m_materialInstance->CanCompile()) - { - if (m_areaData.m_rebuildSectors) - { - // Something about the whole world changed, so the sectors need to be rebuilt - - m_areaData.m_rebuildSectors = false; - - m_sectorData.clear(); - const float xFirstPatchStart = AZStd::floorf(terrainBounds.GetMin().GetX() / GridMeters) * GridMeters; - const float xLastPatchStart = AZStd::floorf(terrainBounds.GetMax().GetX() / GridMeters) * GridMeters; - const float yFirstPatchStart = AZStd::floorf(terrainBounds.GetMin().GetY() / GridMeters) * GridMeters; - const float yLastPatchStart = AZStd::floorf(terrainBounds.GetMax().GetY() / GridMeters) * GridMeters; - - const auto& materialAsset = m_materialInstance->GetAsset(); - const auto& shaderAsset = materialAsset->GetMaterialTypeAsset()->GetShaderAssetForObjectSrg(); - - for (float yPatch = yFirstPatchStart; yPatch <= yLastPatchStart; yPatch += GridMeters) - { - for (float xPatch = xFirstPatchStart; xPatch <= xLastPatchStart; xPatch += GridMeters) - { - auto objectSrg = AZ::RPI::ShaderResourceGroup::Create(shaderAsset, materialAsset->GetObjectSrgLayout()->GetName()); - if (!objectSrg) - { - AZ_Warning(TerrainFPName, false, "Failed to create a new shader resource group, skipping."); - continue; - } - - m_sectorData.push_back(); - SectorData& sectorData = m_sectorData.back(); - - for (auto& lod : m_patchModel->GetLods()) - { - AZ::RPI::ModelLod& modelLod = *lod.get(); - sectorData.m_drawPackets.emplace_back(modelLod, 0, m_materialInstance, objectSrg); - AZ::RPI::MeshDrawPacket& drawPacket = sectorData.m_drawPackets.back(); - - // set the shader option to select forward pass IBL specular if necessary - if (!drawPacket.SetShaderOption(AZ::Name("o_meshUseForwardPassIBLSpecular"), AZ::RPI::ShaderOptionValue{ false })) - { - AZ_Warning(TerrainFPName, false, "Failed to set o_meshUseForwardPassIBLSpecular on mesh draw packet"); - } - const uint8_t stencilRef = AZ::Render::StencilRefs::UseDiffuseGIPass | AZ::Render::StencilRefs::UseIBLSpecularPass; - drawPacket.SetStencilRef(stencilRef); - drawPacket.Update(*GetParentScene(), true); - } - - sectorData.m_aabb = - AZ::Aabb::CreateFromMinMax( - AZ::Vector3(xPatch, yPatch, terrainBounds.GetMin().GetZ()), - AZ::Vector3(xPatch + GridMeters, yPatch + GridMeters, terrainBounds.GetMax().GetZ()) - ); - sectorData.m_srg = objectSrg; - } - } - - if (m_areaData.m_macroMaterialsUpdated) - { - // sectors were rebuilt, so any cached macro material data needs to be regenerated - for (SectorData& sectorData : m_sectorData) - { - for (MacroMaterialData& macroMaterialData : m_macroMaterials.GetDataVector()) - { - if (macroMaterialData.m_bounds.Overlaps(sectorData.m_aabb)) - { - sectorData.m_macroMaterials.push_back(m_macroMaterials.GetIndexForData(¯oMaterialData)); - if (sectorData.m_macroMaterials.size() == MaxMaterialsPerSector) - { - break; - } - } - } - } - } - } - else if (m_forceRebuildDrawPackets) - { - for (auto& sectorData : m_sectorData) - { - for (auto& drawPacket : sectorData.m_drawPackets) - { - drawPacket.Update(*GetParentScene(), true); - } - } - } - m_forceRebuildDrawPackets = false; - - if (m_areaData.m_heightmapUpdated) - { - UpdateTerrainData(); - } - - if (m_updateDetailMaterialBuffer) - { - m_updateDetailMaterialBuffer = false; - m_detailMaterialDataBuffer.UpdateBuffer(m_detailMaterialShaderData.GetRawData(), aznumeric_cast(m_detailMaterialShaderData.GetSize())); - } - - AZ::Vector3 cameraPosition = AZ::Vector3::CreateZero(); - for (auto& view : process.m_views) - { - if ((view->GetUsageFlags() & AZ::RPI::View::UsageFlags::UsageCamera) > 0) - { - cameraPosition = view->GetCameraTransform().GetTranslation(); - break; - } - } - - if (m_dirtyDetailRegion.IsValid() || !cameraPosition.IsClose(m_previousCameraPosition) || m_detailImagesNeedUpdate) - { - int32_t newDetailTexturePosX = aznumeric_cast(AZStd::roundf(cameraPosition.GetX() / DetailTextureScale)); - int32_t newDetailTexturePosY = aznumeric_cast(AZStd::roundf(cameraPosition.GetY() / DetailTextureScale)); - - Aabb2i newBounds; - newBounds.m_min.m_x = newDetailTexturePosX - DetailTextureSizeHalf; - newBounds.m_min.m_y = newDetailTexturePosY - DetailTextureSizeHalf; - newBounds.m_max.m_x = newDetailTexturePosX + DetailTextureSizeHalf; - newBounds.m_max.m_y = newDetailTexturePosY + DetailTextureSizeHalf; - - // Use modulo to find the center point in texture space. Care must be taken so negative values are - // handled appropriately (ie, we want -1 % 1024 to equal 1023, not -1) - Vector2i newCenter; - newCenter.m_x = (DetailTextureSize + (newDetailTexturePosX % DetailTextureSize)) % DetailTextureSize; - newCenter.m_y = (DetailTextureSize + (newDetailTexturePosY % DetailTextureSize)) % DetailTextureSize; - - CheckUpdateDetailTexture(newBounds, newCenter); - - m_detailTextureBounds = newBounds; - m_dirtyDetailRegion = AZ::Aabb::CreateNull(); - - m_previousCameraPosition = cameraPosition; - - AZ::Vector4 detailAabb = AZ::Vector4( - m_detailTextureBounds.m_min.m_x * DetailTextureScale, - m_detailTextureBounds.m_min.m_y * DetailTextureScale, - m_detailTextureBounds.m_max.m_x * DetailTextureScale, - m_detailTextureBounds.m_max.m_y * DetailTextureScale - ); - AZ::Vector2 detailUvOffset = AZ::Vector2(float(newCenter.m_x) / DetailTextureSize, float(newCenter.m_y) / DetailTextureSize); - - if (m_terrainSrg) - { - m_terrainSrg->SetConstant(m_detailAabbPropertyIndex, detailAabb); - m_terrainSrg->SetConstant(m_detailHalfPixelUvPropertyIndex, 0.5f / DetailTextureSize); - m_terrainSrg->SetConstant(m_detailCenterPropertyIndex, detailUvOffset); - - m_detailMaterialDataBuffer.UpdateSrg(m_terrainSrg.get()); - } - } - - if (m_areaData.m_heightmapUpdated || m_areaData.m_macroMaterialsUpdated) - { - // Currently when anything in the heightmap changes we're updating all the srgs, but this could probably - // be optimized to only update the srgs that changed. - - m_areaData.m_heightmapUpdated = false; - m_areaData.m_macroMaterialsUpdated = false; - - AZStd::array uvStep = - { - 1.0f / aznumeric_cast(m_areaData.m_terrainBounds.GetXExtent() / m_areaData.m_sampleSpacing), - 1.0f / aznumeric_cast(m_areaData.m_terrainBounds.GetYExtent() / m_areaData.m_sampleSpacing), - }; - - for (SectorData& sectorData : m_sectorData) - { - ShaderTerrainData terrainDataForSrg; - - const float xPatch = sectorData.m_aabb.GetMin().GetX(); - const float yPatch = sectorData.m_aabb.GetMin().GetY(); - - terrainDataForSrg.m_uvMin = { - (xPatch - terrainBounds.GetMin().GetX()) / terrainBounds.GetXExtent(), - (yPatch - terrainBounds.GetMin().GetY()) / terrainBounds.GetYExtent() - }; - - terrainDataForSrg.m_uvMax = { - ((xPatch + GridMeters) - terrainBounds.GetMin().GetX()) / terrainBounds.GetXExtent(), - ((yPatch + GridMeters) - terrainBounds.GetMin().GetY()) / terrainBounds.GetYExtent() - }; - - terrainDataForSrg.m_uvStep = uvStep; - - AZ::Transform transform = m_areaData.m_transform; - transform.SetTranslation(xPatch, yPatch, m_areaData.m_transform.GetTranslation().GetZ()); - - terrainDataForSrg.m_sampleSpacing = m_areaData.m_sampleSpacing; - terrainDataForSrg.m_heightScale = terrainBounds.GetZExtent(); - - sectorData.m_srg->SetConstant(m_terrainDataIndex, terrainDataForSrg); - - AZStd::array macroMaterialData; - - uint32_t i = 0; - for (; i < sectorData.m_macroMaterials.size(); ++i) - { - const MacroMaterialData& materialData = m_macroMaterials.GetData(sectorData.m_macroMaterials.at(i)); - ShaderMacroMaterialData& shaderData = macroMaterialData.at(i); - const AZ::Aabb& materialBounds = materialData.m_bounds; - - // Use reverse coordinates (1 - y) for the y direction so that the lower left corner of the macro material images - // map to the lower left corner in world space. This will match up with the height uv coordinate mapping. - shaderData.m_uvMin = { - (xPatch - materialBounds.GetMin().GetX()) / materialBounds.GetXExtent(), - 1.0f - ((yPatch - materialBounds.GetMin().GetY()) / materialBounds.GetYExtent()) - }; - shaderData.m_uvMax = { - ((xPatch + GridMeters) - materialBounds.GetMin().GetX()) / materialBounds.GetXExtent(), - 1.0f - (((yPatch + GridMeters) - materialBounds.GetMin().GetY()) / materialBounds.GetYExtent()) - }; - shaderData.m_normalFactor = materialData.m_normalFactor; - shaderData.m_flipNormalX = materialData.m_normalFlipX; - shaderData.m_flipNormalY = materialData.m_normalFlipY; - - const AZ::RHI::ImageView* colorImageView = materialData.m_colorImage ? materialData.m_colorImage->GetImageView() : nullptr; - sectorData.m_srg->SetImageView(m_macroColorMapIndex, colorImageView, i); - - const AZ::RHI::ImageView* normalImageView = materialData.m_normalImage ? materialData.m_normalImage->GetImageView() : nullptr; - sectorData.m_srg->SetImageView(m_macroNormalMapIndex, normalImageView, i); - - // set flags for which images are used. - shaderData.m_mapsInUse = (colorImageView ? ColorImageUsed : 0) | (normalImageView ? NormalImageUsed : 0); - } - for (; i < sectorData.m_macroMaterials.capacity(); ++i) - { - sectorData.m_srg->SetImageView(m_macroColorMapIndex, nullptr, i); - sectorData.m_srg->SetImageView(m_macroNormalMapIndex, nullptr, i); - } - - sectorData.m_srg->SetConstantArray(m_macroMaterialDataIndex, macroMaterialData); - sectorData.m_srg->SetConstant(m_macroMaterialCountIndex, aznumeric_cast(sectorData.m_macroMaterials.size())); - - const AZ::Matrix3x4 matrix3x4 = AZ::Matrix3x4::CreateFromTransform(transform); - sectorData.m_srg->SetConstant(m_modelToWorldIndex, matrix3x4); - - sectorData.m_srg->Compile(); - } - } - - // Currently there seems to be a bug in unbounded image arrays where flickering can occur if this isn't updated every frame. - if (m_terrainSrg/* && m_detailImagesUpdated*/) - { - AZStd::array_view imageViews(m_detailImageViews.data(), m_detailImageViews.size()); - [[maybe_unused]] bool result = m_terrainSrg->SetImageViewUnboundedArray(m_detailTexturesIndex, imageViews); - AZ_Error(TerrainFPName, result, "Failed to set image view unbounded array into shader resource group."); - m_detailImagesNeedUpdate = false; - } - } - - for (auto& sectorData : m_sectorData) - { - uint8_t lodChoice = AZ::RPI::ModelLodAsset::LodCountMax; - - // Go through all cameras and choose an LOD based on the closest camera. - for (auto& view : process.m_views) - { - if ((view->GetUsageFlags() & AZ::RPI::View::UsageFlags::UsageCamera) > 0) - { - const AZ::Vector3 cameraPosition = view->GetCameraTransform().GetTranslation(); - const AZ::Vector2 cameraPositionXY = AZ::Vector2(cameraPosition.GetX(), cameraPosition.GetY()); - const AZ::Vector2 sectorCenterXY = AZ::Vector2(sectorData.m_aabb.GetCenter().GetX(), sectorData.m_aabb.GetCenter().GetY()); - - const float sectorDistance = sectorCenterXY.GetDistance(cameraPositionXY); - - // This will be configurable later - const float minDistanceForLod0 = (GridMeters * 4.0f); - - // For every distance doubling beyond a minDistanceForLod0, we only need half the mesh density. Each LOD - // is exactly half the resolution of the last. - const float lodForCamera = AZStd::floorf(AZ::GetMax(0.0f, log2f(sectorDistance / minDistanceForLod0))); - - // All cameras should render the same LOD so effects like shadows are consistent. - lodChoice = AZ::GetMin(lodChoice, aznumeric_cast(lodForCamera)); - } - } - - // Add the correct LOD draw packet for visible sectors. - for (auto& view : process.m_views) - { - AZ::Frustum viewFrustum = AZ::Frustum::CreateFromMatrixColumnMajor(view->GetWorldToClipMatrix()); - if (viewFrustum.IntersectAabb(sectorData.m_aabb) != AZ::IntersectResult::Exterior) - { - const uint8_t lodToRender = AZ::GetMin(lodChoice, aznumeric_cast(sectorData.m_drawPackets.size() - 1)); - view->AddDrawPacket(sectorData.m_drawPackets.at(lodToRender).GetRHIDrawPacket()); - } - } - } - - if (m_detailTextureImage && m_areaData.m_heightmapImage && m_imagesNeedUpdate) - { - m_imagesNeedUpdate = false; - for (auto& view : process.m_views) - { - auto viewSrg = view->GetShaderResourceGroup(); - viewSrg->SetImage(m_heightmapPropertyIndex, m_areaData.m_heightmapImage); - } - if (m_terrainSrg) - { - m_terrainSrg->SetImage(m_detailMaterialIdPropertyIndex, m_detailTextureImage); - } - } - - if (m_materialInstance) - { - m_materialInstance->Compile(); - } - - if (m_terrainSrg && m_forwardPass) - { - m_terrainSrg->Compile(); - m_forwardPass->BindSrg(m_terrainSrg->GetRHIShaderResourceGroup()); - } - } - - void TerrainFeatureProcessor::InitializeTerrainPatch(uint16_t gridSize, float gridSpacing, PatchData& patchdata) - { - patchdata.m_positions.clear(); - patchdata.m_uvs.clear(); - patchdata.m_indices.clear(); - - const uint16_t gridVertices = gridSize + 1; // For m_gridSize quads, (m_gridSize + 1) vertices are needed. - const size_t size = gridVertices * gridVertices; - - patchdata.m_positions.reserve(size); - patchdata.m_uvs.reserve(size); - - for (uint16_t y = 0; y < gridVertices; ++y) - { - for (uint16_t x = 0; x < gridVertices; ++x) - { - patchdata.m_positions.push_back({ aznumeric_cast(x) * gridSpacing, aznumeric_cast(y) * gridSpacing }); - patchdata.m_uvs.push_back({ aznumeric_cast(x) / gridSize, aznumeric_cast(y) / gridSize }); - } - } - - patchdata.m_indices.reserve(gridSize * gridSize * 6); // total number of quads, 2 triangles with 6 indices per quad. - - for (uint16_t y = 0; y < gridSize; ++y) - { - for (uint16_t x = 0; x < gridSize; ++x) - { - const uint16_t topLeft = y * gridVertices + x; - const uint16_t topRight = topLeft + 1; - const uint16_t bottomLeft = (y + 1) * gridVertices + x; - const uint16_t bottomRight = bottomLeft + 1; - - patchdata.m_indices.emplace_back(topLeft); - patchdata.m_indices.emplace_back(topRight); - patchdata.m_indices.emplace_back(bottomLeft); - patchdata.m_indices.emplace_back(bottomLeft); - patchdata.m_indices.emplace_back(topRight); - patchdata.m_indices.emplace_back(bottomRight); - } - } - } - - AZ::Outcome> TerrainFeatureProcessor::CreateBufferAsset( - const void* data, const AZ::RHI::BufferViewDescriptor& bufferViewDescriptor, const AZStd::string& bufferName) - { - AZ::RPI::BufferAssetCreator creator; - creator.Begin(AZ::Uuid::CreateRandom()); - - AZ::RHI::BufferDescriptor bufferDescriptor; - bufferDescriptor.m_bindFlags = AZ::RHI::BufferBindFlags::InputAssembly | AZ::RHI::BufferBindFlags::ShaderRead; - bufferDescriptor.m_byteCount = static_cast(bufferViewDescriptor.m_elementSize) * static_cast(bufferViewDescriptor.m_elementCount); - - creator.SetBuffer(data, bufferDescriptor.m_byteCount, bufferDescriptor); - creator.SetBufferViewDescriptor(bufferViewDescriptor); - creator.SetUseCommonPool(AZ::RPI::CommonBufferPoolType::StaticInputAssembly); - - AZ::Data::Asset bufferAsset; - if (creator.End(bufferAsset)) - { - bufferAsset.SetHint(bufferName); - return AZ::Success(bufferAsset); - } - - return AZ::Failure(); - } - - bool TerrainFeatureProcessor::InitializePatchModel() - { - AZ::RPI::ModelAssetCreator modelAssetCreator; - modelAssetCreator.Begin(AZ::Uuid::CreateRandom()); - - uint16_t gridSize = GridSize; - float gridSpacing = GridSpacing; - - for (uint32_t i = 0; i < AZ::RPI::ModelLodAsset::LodCountMax && gridSize > 0; ++i) - { - PatchData patchData; - InitializeTerrainPatch(gridSize, gridSpacing, patchData); - - const auto positionBufferViewDesc = AZ::RHI::BufferViewDescriptor::CreateTyped(0, aznumeric_cast(patchData.m_positions.size()), AZ::RHI::Format::R32G32_FLOAT); - const auto positionsOutcome = CreateBufferAsset(patchData.m_positions.data(), positionBufferViewDesc, "TerrainPatchPositions"); - - const auto uvBufferViewDesc = AZ::RHI::BufferViewDescriptor::CreateTyped(0, aznumeric_cast(patchData.m_uvs.size()), AZ::RHI::Format::R32G32_FLOAT); - const auto uvsOutcome = CreateBufferAsset(patchData.m_uvs.data(), uvBufferViewDesc, "TerrainPatchUvs"); - - const auto indexBufferViewDesc = AZ::RHI::BufferViewDescriptor::CreateTyped(0, aznumeric_cast(patchData.m_indices.size()), AZ::RHI::Format::R16_UINT); - const auto indicesOutcome = CreateBufferAsset(patchData.m_indices.data(), indexBufferViewDesc, "TerrainPatchIndices"); - - if (!positionsOutcome.IsSuccess() || !uvsOutcome.IsSuccess() || !indicesOutcome.IsSuccess()) - { - AZ_Error(TerrainFPName, false, "Failed to create GPU buffers for Terrain"); - return false; - } - - AZ::RPI::ModelLodAssetCreator modelLodAssetCreator; - modelLodAssetCreator.Begin(AZ::Uuid::CreateRandom()); - - modelLodAssetCreator.BeginMesh(); - modelLodAssetCreator.AddMeshStreamBuffer(AZ::RHI::ShaderSemantic{ "POSITION" }, AZ::Name(), {positionsOutcome.GetValue(), positionBufferViewDesc}); - modelLodAssetCreator.AddMeshStreamBuffer(AZ::RHI::ShaderSemantic{ "UV" }, AZ::Name(), {uvsOutcome.GetValue(), uvBufferViewDesc}); - modelLodAssetCreator.SetMeshIndexBuffer({indicesOutcome.GetValue(), indexBufferViewDesc}); - - AZ::Aabb aabb = AZ::Aabb::CreateFromMinMax(AZ::Vector3(0.0, 0.0, 0.0), AZ::Vector3(GridMeters, GridMeters, 0.0)); - modelLodAssetCreator.SetMeshAabb(AZStd::move(aabb)); - modelLodAssetCreator.SetMeshName(AZ::Name("Terrain Patch")); - modelLodAssetCreator.EndMesh(); - - AZ::Data::Asset modelLodAsset; - modelLodAssetCreator.End(modelLodAsset); - - modelAssetCreator.AddLodAsset(AZStd::move(modelLodAsset)); - - gridSize = gridSize / 2; - gridSpacing *= 2.0f; - } - - AZ::Data::Asset modelAsset; - bool success = modelAssetCreator.End(modelAsset); - - m_patchModel = AZ::RPI::Model::FindOrCreate(modelAsset); - - return success; - } - void TerrainFeatureProcessor::OnMaterialReinitialized([[maybe_unused]] const MaterialInstance& material) { PrepareMaterialData(); - for (auto& sectorData : m_sectorData) - { - for (auto& drawPacket : sectorData.m_drawPackets) - { - drawPacket.Update(*GetParentScene()); - } - } - m_imagesNeedUpdate = true; - m_detailImagesNeedUpdate = true; + m_forceRebuildDrawPackets = true; + m_imageBindingsNeedUpdate = true; } void TerrainFeatureProcessor::SetWorldSize([[maybe_unused]] AZ::Vector2 sizeInMeters) @@ -1576,62 +424,6 @@ namespace Terrain // larger but this will limit how much is rendered. } - template - T* TerrainFeatureProcessor::FindByEntityId(AZ::EntityId entityId, AZ::Render::IndexedDataVector& container) - { - for (T& data : container.GetDataVector()) - { - if (data.m_entityId == entityId) - { - return &data; - } - } - return nullptr; - } - - template - T& TerrainFeatureProcessor::FindOrCreateByEntityId(AZ::EntityId entityId, AZ::Render::IndexedDataVector& container) - { - T* dataPtr = FindByEntityId(entityId, container); - if (dataPtr != nullptr) - { - return *dataPtr; - } - - const uint16_t slotId = container.GetFreeSlotIndex(); - AZ_Assert(slotId != AZ::Render::IndexedDataVector::NoFreeSlot, "Ran out of indices"); - - T& data = container.GetData(slotId); - data.m_entityId = entityId; - return data; - } - - template - void TerrainFeatureProcessor::RemoveByEntityId(AZ::EntityId entityId, AZ::Render::IndexedDataVector& container) - { - for (T& data : container.GetDataVector()) - { - if (data.m_entityId == entityId) - { - container.RemoveData(&data); - return; - } - } - AZ_Assert(false, "Entity Id not found in container.") - } - - template - void TerrainFeatureProcessor::ForOverlappingSectors(const AZ::Aabb& bounds, Callback callback) - { - for (SectorData& sectorData : m_sectorData) - { - if (sectorData.m_aabb.Overlaps(bounds)) - { - callback(sectorData); - } - } - } - void TerrainFeatureProcessor::CacheForwardPass() { auto rasterPassFilter = AZ::RPI::PassFilter::CreateWithPassClass(); @@ -1653,59 +445,5 @@ namespace Terrain ); } - auto TerrainFeatureProcessor::Vector2i::operator+(const Vector2i& rhs) const -> Vector2i - { - Vector2i offsetPoint = *this; - offsetPoint += rhs; - return offsetPoint; - } - - auto TerrainFeatureProcessor::Vector2i::operator+=(const Vector2i& rhs) -> Vector2i& - { - m_x += rhs.m_x; - m_y += rhs.m_y; - return *this; - } - - auto TerrainFeatureProcessor::Vector2i::operator-(const Vector2i& rhs) const -> Vector2i - { - return *this + -rhs; - } - - auto TerrainFeatureProcessor::Vector2i::operator-=(const Vector2i& rhs) -> Vector2i& - { - return *this += -rhs; - } - - auto TerrainFeatureProcessor::Vector2i::operator-() const -> Vector2i - { - return {-m_x, -m_y}; - } - - auto TerrainFeatureProcessor::Aabb2i::operator+(const Vector2i& rhs) const -> Aabb2i - { - return { m_min + rhs, m_max + rhs }; - } - - auto TerrainFeatureProcessor::Aabb2i::operator-(const Vector2i& rhs) const -> Aabb2i - { - return *this + -rhs; - } - - auto TerrainFeatureProcessor::Aabb2i::GetClamped(Aabb2i rhs) const -> Aabb2i - { - Aabb2i ret; - ret.m_min.m_x = AZ::GetMax(m_min.m_x, rhs.m_min.m_x); - ret.m_min.m_y = AZ::GetMax(m_min.m_y, rhs.m_min.m_y); - ret.m_max.m_x = AZ::GetMin(m_max.m_x, rhs.m_max.m_x); - ret.m_max.m_y = AZ::GetMin(m_max.m_y, rhs.m_max.m_y); - return ret; - } - - bool TerrainFeatureProcessor::Aabb2i::IsValid() const - { - // Intentionally strict, equal min/max not valid. - return m_min.m_x < m_max.m_x && m_min.m_y < m_max.m_y; - } } diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainFeatureProcessor.h b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainFeatureProcessor.h index 7d68e6b185..016c0d478a 100644 --- a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainFeatureProcessor.h +++ b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainFeatureProcessor.h @@ -8,20 +8,17 @@ #pragma once -#include - #include -#include -#include + +#include +#include +#include +#include #include #include -#include #include #include -#include -#include -#include namespace AZ::RPI { @@ -30,9 +27,7 @@ namespace AZ::RPI class AsyncAssetLoader; } class Material; - class Model; class RenderPass; - class StreamingImage; } namespace Terrain @@ -41,8 +36,6 @@ namespace Terrain : public AZ::RPI::FeatureProcessor , private AZ::RPI::MaterialReloadNotificationBus::Handler , private AzFramework::Terrain::TerrainDataNotificationBus::Handler - , private TerrainMacroMaterialNotificationBus::Handler - , private TerrainAreaMaterialNotificationBus::Handler { public: AZ_RTTI(TerrainFeatureProcessor, "{D7DAC1F9-4A9F-4D3C-80AE-99579BF8AB1C}", AZ::RPI::FeatureProcessor); @@ -62,189 +55,16 @@ namespace Terrain void SetWorldSize(AZ::Vector2 sizeInMeters); private: - - using MaterialInstance = AZ::Data::Instance; - static constexpr uint32_t MaxMaterialsPerSector = 4; - - enum MacroMaterialFlags - { - ColorImageUsed = 0b01, - NormalImageUsed = 0b10, - }; - - struct ShaderTerrainData // Must align with struct in Object Srg - { - AZStd::array m_uvMin{ 0.0f, 0.0f }; - AZStd::array m_uvMax{ 1.0f, 1.0f }; - AZStd::array m_uvStep{ 1.0f, 1.0f }; - float m_sampleSpacing{ 1.0f }; - float m_heightScale{ 1.0f }; - }; - - struct ShaderMacroMaterialData // Must align with struct in Object Srg - { - AZStd::array m_uvMin{ 0.0f, 0.0f }; - AZStd::array m_uvMax{ 1.0f, 1.0f }; - float m_normalFactor{ 0.0f }; - uint32_t m_flipNormalX{ 0 }; // bool in shader - uint32_t m_flipNormalY{ 0 }; // bool in shader - uint32_t m_mapsInUse{ 0b00 }; // 0b01 = color, 0b10 = normal - }; - - struct VertexPosition - { - float m_posx; - float m_posy; - }; - - struct VertexUv - { - float m_u; - float m_v; - }; - - struct PatchData - { - AZStd::vector m_positions; - AZStd::vector m_uvs; - AZStd::vector m_indices; - }; - - struct SectorData - { - AZ::Data::Instance m_srg; // Hold on to ref so it's not dropped - AZ::Aabb m_aabb; - AZStd::fixed_vector m_drawPackets; - AZStd::fixed_vector m_macroMaterials; - }; - - enum DetailTextureFlags : uint32_t - { - UseTextureBaseColor = 0b0000'0000'0000'0000'0000'0000'0000'0001, - UseTextureNormal = 0b0000'0000'0000'0000'0000'0000'0000'0010, - UseTextureMetallic = 0b0000'0000'0000'0000'0000'0000'0000'0100, - UseTextureRoughness = 0b0000'0000'0000'0000'0000'0000'0000'1000, - UseTextureOcclusion = 0b0000'0000'0000'0000'0000'0000'0001'0000, - UseTextureHeight = 0b0000'0000'0000'0000'0000'0000'0010'0000, - UseTextureSpecularF0 = 0b0000'0000'0000'0000'0000'0000'0100'0000, - - FlipNormalX = 0b0000'0000'0000'0001'0000'0000'0000'0000, - FlipNormalY = 0b0000'0000'0000'0010'0000'0000'0000'0000, - - BlendModeMask = 0b0000'0000'0000'1100'0000'0000'0000'0000, - BlendModeLerp = 0b0000'0000'0000'0000'0000'0000'0000'0000, - BlendModeLinearLight = 0b0000'0000'0000'0100'0000'0000'0000'0000, - BlendModeMultiply = 0b0000'0000'0000'1000'0000'0000'0000'0000, - BlendModeOverlay = 0b0000'0000'0000'1100'0000'0000'0000'0000, - }; - - static constexpr uint16_t InvalidDetailImageIndex = 0xFFFF; - - struct DetailMaterialShaderData - { - // Uv - AZStd::array m_uvTransform - { - 1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - }; - - float m_baseColorRed{ 1.0f }; - float m_baseColorGreen{ 1.0f }; - float m_baseColorBlue{ 1.0f }; - - // Factor / Scale / Bias for input textures - float m_baseColorFactor{ 1.0f }; - - float m_normalFactor{ 1.0f }; - float m_metalFactor{ 1.0f }; - float m_roughnessScale{ 1.0f }; - float m_roughnessBias{ 0.0f }; - - float m_specularF0Factor{ 1.0f }; - float m_occlusionFactor{ 1.0f }; - float m_heightFactor{ 1.0f }; - float m_heightOffset{ 0.0f }; - - float m_heightBlendFactor{ 0.5f }; - - // Flags - DetailTextureFlags m_flags{ 0 }; - - // Image indices - uint16_t m_colorImageIndex{ InvalidDetailImageIndex }; - uint16_t m_normalImageIndex{ InvalidDetailImageIndex }; - uint16_t m_roughnessImageIndex{ InvalidDetailImageIndex }; - uint16_t m_metalnessImageIndex{ InvalidDetailImageIndex }; - - uint16_t m_specularF0ImageIndex{ InvalidDetailImageIndex }; - uint16_t m_occlusionImageIndex{ InvalidDetailImageIndex }; - uint16_t m_heightImageIndex{ InvalidDetailImageIndex }; - // 16 byte aligned - uint16_t m_padding1; - uint32_t m_padding2; - uint32_t m_padding3; - }; - - struct DetailMaterialData - { - AZ::Data::AssetId m_assetId; - AZ::RPI::Material::ChangeId m_materialChangeId{AZ::RPI::Material::DEFAULT_CHANGE_ID}; - uint32_t refCount = 0; - uint16_t m_detailMaterialBufferIndex{ 0xFFFF }; - - AZ::Data::Instance m_colorImage; - AZ::Data::Instance m_normalImage; - AZ::Data::Instance m_roughnessImage; - AZ::Data::Instance m_metalnessImage; - AZ::Data::Instance m_specularF0Image; - AZ::Data::Instance m_occlusionImage; - AZ::Data::Instance m_heightImage; - }; - - struct DetailMaterialSurface - { - AZ::Crc32 m_surfaceTag; - uint16_t m_detailMaterialId; - }; - - struct DetailMaterialListRegion - { - AZ::EntityId m_entityId; - AZ::Aabb m_region{AZ::Aabb::CreateNull()}; - AZStd::vector m_materialsForSurfaces; - }; - - struct Vector2i - { - int32_t m_x{ 0 }; - int32_t m_y{ 0 }; - - Vector2i operator+(const Vector2i& rhs) const; - Vector2i& operator+=(const Vector2i& rhs); - Vector2i operator-(const Vector2i& rhs) const; - Vector2i& operator-=(const Vector2i& rhs); - Vector2i operator-() const; - }; - - struct Aabb2i - { - Vector2i m_min; - Vector2i m_max; - - Aabb2i operator+(const Vector2i& offset) const; - Aabb2i operator-(const Vector2i& offset) const; - - Aabb2i GetClamped(Aabb2i rhs) const; - bool IsValid() const; - }; + static constexpr auto InvalidImageIndex = AZ::Render::BindlessImageArrayHandler::InvalidImageIndex; + using MaterialInstance = AZ::Data::Instance; - struct DetailTextureLocation + struct WorldShaderData { - uint16_t m_index; - AZ::Data::Instance m_image; + AZStd::array m_min{ 0.0f, 0.0f, 0.0f }; + float padding1{ 0.0f }; + AZStd::array m_max{ 0.0f, 0.0f, 0.0f }; + float padding2{ 0.0f }; }; // AZ::RPI::MaterialReloadNotificationBus::Handler overrides... @@ -254,122 +74,46 @@ namespace Terrain void OnTerrainDataDestroyBegin() override; void OnTerrainDataChanged(const AZ::Aabb& dirtyRegion, TerrainDataChangedMask dataChangedMask) override; - // TerrainMacroMaterialNotificationBus overrides... - void OnTerrainMacroMaterialCreated(AZ::EntityId entityId, const MacroMaterialData& material) override; - void OnTerrainMacroMaterialChanged(AZ::EntityId entityId, const MacroMaterialData& material) override; - void OnTerrainMacroMaterialRegionChanged(AZ::EntityId entityId, const AZ::Aabb& oldRegion, const AZ::Aabb& newRegion) override; - void OnTerrainMacroMaterialDestroyed(AZ::EntityId entityId) override; - - // TerrainAreaMaterialNotificationBus overrides... - void OnTerrainSurfaceMaterialMappingCreated(AZ::EntityId entityId, SurfaceData::SurfaceTag surfaceTag, MaterialInstance material) override; - void OnTerrainSurfaceMaterialMappingDestroyed(AZ::EntityId entityId, SurfaceData::SurfaceTag surfaceTag) override; - void OnTerrainSurfaceMaterialMappingChanged(AZ::EntityId entityId, SurfaceData::SurfaceTag surfaceTag, MaterialInstance material) override; - void OnTerrainSurfaceMaterialMappingRegionChanged(AZ::EntityId entityId, const AZ::Aabb& oldRegion, const AZ::Aabb& newRegion) override; - // AZ::RPI::SceneNotificationBus overrides... void OnRenderPipelinePassesChanged(AZ::RPI::RenderPipeline* renderPipeline) override; void Initialize(); - void InitializeTerrainPatch(uint16_t gridSize, float gridSpacing, PatchData& patchdata); - bool InitializePatchModel(); - void UpdateTerrainData(); + void UpdateHeightmapImage(); void PrepareMaterialData(); - void UpdateMacroMaterialData(MacroMaterialData& macroMaterialData, const MacroMaterialData& newMaterialData); - - void TerrainHeightOrSettingsUpdated(const AZ::Aabb& dirtyRegion); - void TerrainSurfaceDataUpdated(const AZ::Aabb& dirtyRegion); - uint16_t CreateOrUpdateDetailMaterial(MaterialInstance material); - void CheckDetailMaterialForDeletion(uint16_t detailMaterialId); - void UpdateDetailMaterialData(uint16_t detailMaterialIndex, MaterialInstance material); - void CheckUpdateDetailTexture(const Aabb2i& newBounds, const Vector2i& newCenter); - void UpdateDetailTexture(const Aabb2i& updateArea, const Aabb2i& textureBounds, const Vector2i& centerPixel); - uint16_t GetDetailMaterialForSurfaceTypeAndPosition(AZ::Crc32 surfaceType, const AZ::Vector2& position); - uint8_t CalculateUpdateRegions(const Aabb2i& updateArea, const Aabb2i& textureBounds, const Vector2i& centerPixel, - AZStd::array& textureSpaceAreas, AZStd::array& scaledWorldSpaceAreas); + void TerrainHeightOrSettingsUpdated(const AZ::Aabb& dirtyRegion); void ProcessSurfaces(const FeatureProcessor::RenderPacket& process); - template - T* FindByEntityId(AZ::EntityId entityId, AZ::Render::IndexedDataVector& container); - template - T& FindOrCreateByEntityId(AZ::EntityId entityId, AZ::Render::IndexedDataVector& container); - template - void RemoveByEntityId(AZ::EntityId entityId, AZ::Render::IndexedDataVector& container); - - template - void ForOverlappingSectors(const AZ::Aabb& bounds, Callback callback); - - AZ::Outcome> CreateBufferAsset( - const void* data, const AZ::RHI::BufferViewDescriptor& bufferViewDescriptor, const AZStd::string& bufferName); - void CacheForwardPass(); - // System-level parameters - static constexpr float GridSpacing{ 1.0f }; - static constexpr int32_t GridSize{ 64 }; // number of terrain quads (vertices are m_gridSize + 1) - static constexpr float GridMeters{ GridSpacing * GridSize }; - static constexpr int32_t DetailTextureSize{ 1024 }; - static constexpr int32_t DetailTextureSizeHalf{ DetailTextureSize / 2 }; - static constexpr float DetailTextureScale{ 0.5f }; + TerrainMeshManager m_meshManager; + TerrainMacroMaterialManager m_macroMaterialManager; + TerrainDetailMaterialManager m_detailMaterialManager; + + AZStd::shared_ptr m_imageArrayHandler; AZStd::unique_ptr m_materialAssetLoader; MaterialInstance m_materialInstance; + AZ::Data::Instance m_terrainSrg; + AZ::Data::Instance m_heightmapImage; - AZ::RHI::ShaderInputConstantIndex m_modelToWorldIndex; - AZ::RHI::ShaderInputConstantIndex m_terrainDataIndex; - AZ::RHI::ShaderInputConstantIndex m_macroMaterialDataIndex; - AZ::RHI::ShaderInputConstantIndex m_macroMaterialCountIndex; - AZ::RHI::ShaderInputImageIndex m_macroColorMapIndex; - AZ::RHI::ShaderInputImageIndex m_macroNormalMapIndex; AZ::RHI::ShaderInputImageIndex m_heightmapPropertyIndex; - AZ::RHI::ShaderInputImageIndex m_detailMaterialIdPropertyIndex; - AZ::RHI::ShaderInputBufferIndex m_detailMaterialDataIndex; - AZ::RHI::ShaderInputConstantIndex m_detailCenterPropertyIndex; - AZ::RHI::ShaderInputConstantIndex m_detailAabbPropertyIndex; - AZ::RHI::ShaderInputConstantIndex m_detailHalfPixelUvPropertyIndex; - AZ::RHI::ShaderInputImageUnboundedArrayIndex m_detailTexturesIndex; + AZ::RHI::ShaderInputConstantIndex m_worldDataIndex; - AZ::Data::Instance m_patchModel; - AZ::Vector3 m_previousCameraPosition = AZ::Vector3(AZStd::numeric_limits::max(), 0.0, 0.0); - - // Per-area data - struct TerrainAreaData - { - AZ::Transform m_transform{ AZ::Transform::CreateIdentity() }; - AZ::Aabb m_terrainBounds{ AZ::Aabb::CreateNull() }; - AZ::Data::Instance m_heightmapImage; - float m_sampleSpacing{ 0.0f }; - bool m_heightmapUpdated{ true }; - bool m_macroMaterialsUpdated{ true }; - bool m_rebuildSectors{ true }; - }; - - TerrainAreaData m_areaData; + AZ::Aabb m_terrainBounds{ AZ::Aabb::CreateNull() }; AZ::Aabb m_dirtyRegion{ AZ::Aabb::CreateNull() }; - AZ::Aabb m_dirtyDetailRegion{ AZ::Aabb::CreateNull() }; - bool m_updateDetailMaterialBuffer{ false }; - - Aabb2i m_detailTextureBounds; - Vector2i m_detailTextureCenter; - AZ::Data::Instance m_detailTextureImage; - AZ::RPI::ShaderSystemInterface::GlobalShaderOptionUpdatedEvent::Handler m_handleGlobalShaderOptionUpdate; + + float m_sampleSpacing{ 0.0f }; + + bool m_heightmapNeedsUpdate{ false }; bool m_forceRebuildDrawPackets{ false }; - bool m_imagesNeedUpdate{ false }; + bool m_imageBindingsNeedUpdate{ false }; - AZStd::vector m_sectorData; + AZ::RPI::ShaderSystemInterface::GlobalShaderOptionUpdatedEvent::Handler m_handleGlobalShaderOptionUpdate; - AZ::Render::IndexedDataVector m_macroMaterials; - AZ::Render::IndexedDataVector m_detailMaterials; - AZ::Render::IndexedDataVector m_detailMaterialRegions; - AZ::Render::SparseVector m_detailMaterialShaderData; - AZ::Render::GpuBufferHandler m_detailMaterialDataBuffer; AZ::RPI::RenderPass* m_forwardPass; - - AZStd::vector m_detailImageViews; - AZStd::vector m_detailImageViewFreeList; - bool m_detailImagesNeedUpdate{ false }; }; } diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMacroMaterialBus.cpp b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMacroMaterialBus.cpp index b1c6f2d54b..7f84874e63 100644 --- a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMacroMaterialBus.cpp +++ b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMacroMaterialBus.cpp @@ -66,8 +66,27 @@ namespace Terrain } }; + void MacroMaterialData::Reflect(AZ::ReflectContext* context) + { + if (AZ::BehaviorContext* behaviorContext = azrtti_cast(context)) + { + behaviorContext->Class() + ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common) + ->Attribute(AZ::Script::Attributes::Category, "Terrain") + ->Attribute(AZ::Script::Attributes::Module, "terrain") + ->Property("EntityId", BehaviorValueProperty(&MacroMaterialData::m_entityId)) + ->Property("Bounds", BehaviorValueProperty(&MacroMaterialData::m_bounds)) + ->Property("NormalFlipX", BehaviorValueProperty(&MacroMaterialData::m_normalFlipX)) + ->Property("NormalFlipY", BehaviorValueProperty(&MacroMaterialData::m_normalFlipY)) + ->Property("NormalFactor", BehaviorValueProperty(&MacroMaterialData::m_normalFactor)) + ; + } + } + void TerrainMacroMaterialRequests::Reflect(AZ::ReflectContext* context) { + MacroMaterialData::Reflect(context); + if (AZ::BehaviorContext* behaviorContext = azrtti_cast(context)) { behaviorContext->EBus("TerrainMacroMaterialRequestBus") diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMacroMaterialBus.h b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMacroMaterialBus.h index 9a7151da56..abcf4d4df0 100644 --- a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMacroMaterialBus.h +++ b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMacroMaterialBus.h @@ -18,8 +18,10 @@ namespace Terrain { struct MacroMaterialData final { - AZ_RTTI(MacroMaterialData, "{DC68E20A-3251-4E4E-8BC7-F6A2521FEF46}"); - + AZ_TYPE_INFO(MacroMaterialData, "{DC68E20A-3251-4E4E-8BC7-F6A2521FEF46}"); + + static void Reflect(AZ::ReflectContext* context); + AZ::EntityId m_entityId; AZ::Aabb m_bounds = AZ::Aabb::CreateNull(); diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMacroMaterialManager.cpp b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMacroMaterialManager.cpp new file mode 100644 index 0000000000..82349cdcdb --- /dev/null +++ b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMacroMaterialManager.cpp @@ -0,0 +1,412 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * 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 Terrain +{ + namespace + { + [[maybe_unused]] static const char* TerrainMacroMaterialManagerName = "TerrainMacroMaterialManager"; + } + + namespace TerrainSrgInputs + { + static const char* const MacroMaterialData("m_macroMaterialData"); + static const char* const MacroMaterialGrid("m_macroMaterialGrid"); + } + + void TerrainMacroMaterialManager::Initialize( + const AZStd::shared_ptr& bindlessImageHandler, + AZ::Data::Instance& terrainSrg) + { + AZ_Error(TerrainMacroMaterialManagerName, bindlessImageHandler, "bindlessImageHandler must not be null."); + AZ_Error(TerrainMacroMaterialManagerName, terrainSrg, "terrainSrg must not be null."); + AZ_Error(TerrainMacroMaterialManagerName, !m_isInitialized, "Already initialized."); + + if (!bindlessImageHandler || !terrainSrg || m_isInitialized) + { + return; + } + + if (UpdateSrgIndices(terrainSrg)) + { + m_bindlessImageHandler = bindlessImageHandler; + + OnTerrainDataChanged(AZ::Aabb::CreateNull(), TerrainDataChangedMask::Settings); + AzFramework::Terrain::TerrainDataNotificationBus::Handler::BusConnect(); + TerrainMacroMaterialNotificationBus::Handler::BusConnect(); + + m_terrainSizeChanged = true; + m_isInitialized = true; + } + } + + void TerrainMacroMaterialManager::Reset() + { + m_isInitialized = false; + + m_macroMaterialDataBuffer = {}; + + m_macroMaterialShaderData.clear(); + m_macroMaterialEntities.clear(); + + RemoveAllImages(); + m_macroMaterials.clear(); + + m_bindlessImageHandler = {}; + + AzFramework::Terrain::TerrainDataNotificationBus::Handler::BusDisconnect(); + TerrainMacroMaterialNotificationBus::Handler::BusDisconnect(); + } + + bool TerrainMacroMaterialManager::IsInitialized() + { + return m_isInitialized; + } + + bool TerrainMacroMaterialManager::UpdateSrgIndices(AZ::Data::Instance& terrainSrg) + { + const AZ::RHI::ShaderResourceGroupLayout* terrainSrgLayout = terrainSrg->GetLayout(); + + m_macroMaterialGridIndex = terrainSrgLayout->FindShaderInputConstantIndex(AZ::Name(TerrainSrgInputs::MacroMaterialGrid)); + AZ_Error(TerrainMacroMaterialManagerName, m_macroMaterialGridIndex.IsValid(), "Failed to find terrain srg input constant %s.", TerrainSrgInputs::MacroMaterialGrid); + + AZ::Render::GpuBufferHandler::Descriptor desc; + + // Set up the gpu buffer for macro material data + desc.m_bufferName = "Macro Material Data"; + desc.m_bufferSrgName = TerrainSrgInputs::MacroMaterialData; + desc.m_elementSize = sizeof(MacroMaterialShaderData); + desc.m_srgLayout = terrainSrgLayout; + m_macroMaterialDataBuffer = AZ::Render::GpuBufferHandler(desc); + + m_bufferNeedsUpdate = true; + + return m_macroMaterialDataBuffer.IsValid() && m_macroMaterialGridIndex.IsValid(); + } + + void TerrainMacroMaterialManager::OnTerrainDataChanged(const AZ::Aabb& dirtyRegion [[maybe_unused]], TerrainDataChangedMask dataChangedMask) + { + if ((dataChangedMask & TerrainDataChangedMask::Settings) != 0) + { + AZ::Aabb worldBounds = AZ::Aabb::CreateNull(); + AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( + worldBounds, &AzFramework::Terrain::TerrainDataRequests::GetTerrainAabb); + + m_terrainSizeChanged = m_terrainSizeChanged || m_terrainBounds != worldBounds; + m_terrainBounds = worldBounds; + } + } + + void TerrainMacroMaterialManager::OnTerrainMacroMaterialCreated(AZ::EntityId entityId, const MacroMaterialData& newMaterialData) + { + AZ_Assert(!m_macroMaterials.contains(entityId), + "OnTerrainMacroMaterialCreated called for a macro material that already exists. This indicates that either the bus is incorrectly sending out " + "OnCreated announcements for existing materials, or the terrain feature processor isn't properly cleaning up macro materials."); + + MacroMaterial& macroMaterial = m_macroMaterials[entityId]; + macroMaterial.m_data = newMaterialData; + if (newMaterialData.m_colorImage) + { + macroMaterial.m_colorIndex = m_bindlessImageHandler->AppendBindlessImage(newMaterialData.m_colorImage->GetImageView()); + } + if (newMaterialData.m_normalImage) + { + macroMaterial.m_normalIndex = m_bindlessImageHandler->AppendBindlessImage(newMaterialData.m_normalImage->GetImageView()); + } + + ForMacroMaterialsInBounds(newMaterialData.m_bounds, + [&](uint16_t idx, [[maybe_unused]] const AZ::Vector2& corner) + { + for (uint16_t offset = 0; offset < MacroMaterialsPerTile; ++offset) + { + MacroMaterialShaderData& macroMaterialShaderData = m_macroMaterialShaderData.at(idx + offset); + if ((macroMaterialShaderData.m_flags & MacroMaterialShaderFlags::IsUsed) == 0) + { + UpdateMacroMaterialShaderEntry(idx + offset, macroMaterial); + break; + } + AZ_Assert(m_macroMaterialEntities.at(idx + offset) != entityId, "Found existing macro material tile for what should be a completely new macro material."); + } + } + ); + + m_bufferNeedsUpdate = true; + } + + void TerrainMacroMaterialManager::OnTerrainMacroMaterialChanged(AZ::EntityId entityId, const MacroMaterialData& newMaterialData) + { + AZ_Assert(m_macroMaterials.contains(entityId), + "OnTerrainMacroMaterialChanged called for a macro material that TerrainFeatureProcessor isn't tracking. This indicates that either the bus is sending out " + "Changed announcements for materials that haven't had a OnCreated event sent, or the terrain feature processor isn't properly tracking macro materials."); + + MacroMaterial& macroMaterial = m_macroMaterials[entityId]; + macroMaterial.m_data = newMaterialData; + + auto UpdateImageIndex = [&](uint16_t& indexRef, const AZ::Data::Instance& imageView) + { + if (indexRef) + { + if (imageView) + { + m_bindlessImageHandler->UpdateBindlessImage(indexRef, imageView->GetImageView()); + } + else + { + m_bindlessImageHandler->RemoveBindlessImage(indexRef); + indexRef = 0xFFFF; + } + } + else if (imageView) + { + indexRef = m_bindlessImageHandler->AppendBindlessImage(imageView->GetImageView()); + } + }; + + UpdateImageIndex(macroMaterial.m_colorIndex, newMaterialData.m_colorImage); + UpdateImageIndex(macroMaterial.m_normalIndex, newMaterialData.m_normalImage); + + ForMacroMaterialsInBounds(newMaterialData.m_bounds, + [&](uint16_t idx, [[maybe_unused]] const AZ::Vector2& corner) + { + for (uint16_t offset = 0; offset < MacroMaterialsPerTile; ++offset) + { + if (m_macroMaterialEntities.at(idx + offset) == entityId) + { + UpdateMacroMaterialShaderEntry(idx + offset, macroMaterial); + break; + } + } + } + ); + + m_bufferNeedsUpdate = true; + } + + void TerrainMacroMaterialManager::OnTerrainMacroMaterialRegionChanged( + AZ::EntityId entityId, [[maybe_unused]] const AZ::Aabb& oldRegion, const AZ::Aabb& newRegion) + { + AZ_Assert(m_macroMaterials.contains(entityId), + "OnTerrainMacroMaterialChanged called for a macro material that TerrainFeatureProcessor isn't tracking. This indicates that either the bus is sending out " + "Changed announcements for materials that haven't had a OnCreated event sent, or the terrain feature processor isn't properly tracking macro materials."); + + MacroMaterial& macroMaterial = m_macroMaterials[entityId]; + macroMaterial.m_data.m_bounds = newRegion; + + AZ::Aabb changedRegion = oldRegion; + changedRegion.AddAabb(newRegion); + + ForMacroMaterialsInBounds(changedRegion, + [&](uint16_t idx, const AZ::Vector2& corner) + { + AZ::Aabb tileAabb = AZ::Aabb::CreateFromMinMaxValues( + corner.GetX(), corner.GetY(), m_terrainBounds.GetMin().GetZ(), + corner.GetX() + MacroMaterialGridSize, corner.GetY() + MacroMaterialGridSize, m_terrainBounds.GetMax().GetZ()); + + bool overlapsNew = tileAabb.Overlaps(newRegion); + uint16_t end = idx + MacroMaterialsPerTile; + + for (; idx < end; ++idx) + { + if (m_macroMaterialEntities.at(idx) == entityId) + { + if (overlapsNew) + { + // Update the macro material entry from this tile. + UpdateMacroMaterialShaderEntry(idx, macroMaterial); + } + else + { + // Remove the macro material entry from this tile. + RemoveMacroMaterialShaderEntry(idx); + } + break; + } + else if (overlapsNew && (m_macroMaterialShaderData.at(idx).m_flags & MacroMaterialShaderFlags::IsUsed) == 0) + { + // Add a macro material entry from this tile. (!overlapsOld && overlapsNew) + UpdateMacroMaterialShaderEntry(idx, macroMaterial); + break; + } + } + } + ); + + m_bufferNeedsUpdate = true; + } + + void TerrainMacroMaterialManager::OnTerrainMacroMaterialDestroyed(AZ::EntityId entityId) + { + AZ_Assert(m_macroMaterials.contains(entityId), + "OnTerrainMacroMaterialChanged called for a macro material that TerrainFeatureProcessor isn't tracking. This indicates that either the bus is sending out " + "Changed announcements for materials that haven't had a OnCreated event sent, or the terrain feature processor isn't properly tracking macro materials."); + + const MacroMaterial& macroMaterial = m_macroMaterials[entityId]; + + ForMacroMaterialsInBounds(macroMaterial.m_data.m_bounds, + [&](uint16_t idx, [[maybe_unused]] const AZ::Vector2& corner) + { + uint16_t end = idx + MacroMaterialsPerTile; + + for (; idx < end; ++idx) + { + if (m_macroMaterialEntities.at(idx) == entityId) + { + RemoveMacroMaterialShaderEntry(idx); + } + } + } + ); + + if (macroMaterial.m_colorIndex != 0xFFFF) + { + m_bindlessImageHandler->RemoveBindlessImage(macroMaterial.m_colorIndex); + } + if (macroMaterial.m_normalIndex != 0xFFFF) + { + m_bindlessImageHandler->RemoveBindlessImage(macroMaterial.m_normalIndex); + } + + m_macroMaterials.erase(entityId); + m_bufferNeedsUpdate = true; + } + + void TerrainMacroMaterialManager::UpdateMacroMaterialShaderEntry(uint16_t shaderDataIdx, const MacroMaterial& macroMaterial) + { + m_macroMaterialEntities.at(shaderDataIdx) = macroMaterial.m_data.m_entityId; + MacroMaterialShaderData& macroMaterialShaderData = m_macroMaterialShaderData.at(shaderDataIdx); + + macroMaterialShaderData.m_flags = (MacroMaterialShaderFlags)( + MacroMaterialShaderFlags::IsUsed | + (macroMaterial.m_data.m_normalFlipX ? MacroMaterialShaderFlags::FlipMacroNormalX : 0) | + (macroMaterial.m_data.m_normalFlipY ? MacroMaterialShaderFlags::FlipMacroNormalY : 0) + ); + + macroMaterialShaderData.m_normalFactor = macroMaterial.m_data.m_normalFactor; + macroMaterialShaderData.m_boundsMin = { macroMaterial.m_data.m_bounds.GetMin().GetX(), macroMaterial.m_data.m_bounds.GetMin().GetY() }; + macroMaterialShaderData.m_boundsMax = { macroMaterial.m_data.m_bounds.GetMax().GetX(), macroMaterial.m_data.m_bounds.GetMax().GetY() }; + macroMaterialShaderData.m_colorMapId = macroMaterial.m_colorIndex; + macroMaterialShaderData.m_normalMapId = macroMaterial.m_normalIndex; + } + + void TerrainMacroMaterialManager::RemoveMacroMaterialShaderEntry(uint16_t shaderDataIdx) + { + // Remove the macro material entry from this tile by copying the remaining entries on top. + for (++shaderDataIdx; shaderDataIdx % MacroMaterialsPerTile != 0; ++shaderDataIdx) + { + m_macroMaterialEntities.at(shaderDataIdx - 1) = m_macroMaterialEntities.at(shaderDataIdx); + m_macroMaterialShaderData.at(shaderDataIdx - 1) = m_macroMaterialShaderData.at(shaderDataIdx); + } + // Disable the last entry. + m_macroMaterialEntities.at(shaderDataIdx - 1) = AZ::EntityId(); + m_macroMaterialShaderData.at(shaderDataIdx - 1).m_flags = MacroMaterialShaderFlags(0); + } + + template + void TerrainMacroMaterialManager::ForMacroMaterialsInBounds(const AZ::Aabb& bounds, Callback callback) + { + // Get the macro material bounds relative to the terrain + float yStart = bounds.GetMin().GetY() - m_terrainBounds.GetMin().GetY(); + float yEnd = bounds.GetMax().GetY() - m_terrainBounds.GetMin().GetY(); + float xStart = bounds.GetMin().GetX() - m_terrainBounds.GetMin().GetX(); + float xEnd = bounds.GetMax().GetX() - m_terrainBounds.GetMin().GetX(); + + // Clamp the bounds to the terrain + uint16_t yStartIdx = yStart > 0.0f ? uint16_t(yStart / MacroMaterialGridSize) : 0; + uint16_t yEndIdx = yEnd > 0.0f ? AZStd::GetMin(uint16_t(yEnd / MacroMaterialGridSize) + 1, m_tilesY) : 0; + uint16_t xStartIdx = xStart > 0.0f ? uint16_t(xStart / MacroMaterialGridSize) : 0; + uint16_t xEndIdx = xEnd > 0.0f ? AZStd::GetMin(uint16_t(xEnd / MacroMaterialGridSize) + 1, m_tilesX) : 0; + + AZ::Vector2 gridCorner = AZ::Vector2( + floor(m_terrainBounds.GetMin().GetX() / MacroMaterialGridSize) * MacroMaterialGridSize, + floor(m_terrainBounds.GetMin().GetY() / MacroMaterialGridSize) * MacroMaterialGridSize); + + for (uint16_t y = yStartIdx; y < yEndIdx; ++y) + { + for (uint16_t x = xStartIdx; x < xEndIdx; ++x) + { + uint16_t idx = (y * m_tilesX + x) * MacroMaterialsPerTile; + const AZ::Vector2 corner = gridCorner + AZ::Vector2(x * MacroMaterialGridSize, y * MacroMaterialGridSize); + callback(idx, corner); + } + } + } + + void TerrainMacroMaterialManager::Update(AZ::Data::Instance& terrainSrg) + { + if (m_terrainSizeChanged) + { + m_terrainSizeChanged = false; + + // Rebuild the macro material tiles from scratch when the world size changes. This could be made more efficient + // but is fine for now since world resizes are rare. + + RemoveAllImages(); + m_macroMaterials.clear(); + + m_macroMaterialShaderData.clear(); + m_macroMaterialEntities.clear(); + + m_tilesX = aznumeric_cast(m_terrainBounds.GetXExtent() / MacroMaterialGridSize) + 1; + m_tilesY = aznumeric_cast(m_terrainBounds.GetYExtent() / MacroMaterialGridSize) + 1; + const uint32_t macroMaterialTileCount = m_tilesX * m_tilesY * MacroMaterialsPerTile; + + m_macroMaterialShaderData.resize(macroMaterialTileCount); + m_macroMaterialEntities.resize(macroMaterialTileCount); + + TerrainMacroMaterialRequestBus::EnumerateHandlers( + [&](TerrainMacroMaterialRequests* handler) + { + MacroMaterialData macroMaterial = handler->GetTerrainMacroMaterialData(); + AZ::EntityId entityId = *(Terrain::TerrainMacroMaterialRequestBus::GetCurrentBusId()); + OnTerrainMacroMaterialCreated(entityId, macroMaterial); + return true; + } + ); + } + + if (m_bufferNeedsUpdate) + { + m_bufferNeedsUpdate = false; + m_macroMaterialDataBuffer.UpdateBuffer(m_macroMaterialShaderData.data(), aznumeric_cast(m_macroMaterialShaderData.size())); + + MacroMaterialGridShaderData macroMaterialGridShaderData; + macroMaterialGridShaderData.m_offset = { m_terrainBounds.GetMin().GetX(), m_terrainBounds.GetMin().GetY() }; + macroMaterialGridShaderData.m_resolution = (m_tilesX << 16) | m_tilesY; + macroMaterialGridShaderData.m_tileSize = MacroMaterialGridSize; + + if (terrainSrg) + { + m_macroMaterialDataBuffer.UpdateSrg(terrainSrg.get()); + terrainSrg->SetConstant(m_macroMaterialGridIndex, macroMaterialGridShaderData); + } + } + } + + void TerrainMacroMaterialManager::RemoveAllImages() + { + for (const auto& [entity, macroMaterial] : m_macroMaterials) + { + RemoveImagesForMaterial(macroMaterial); + } + } + + void TerrainMacroMaterialManager::RemoveImagesForMaterial(const MacroMaterial& macroMaterial) + { + if (macroMaterial.m_colorIndex != 0xFFFF) + { + m_bindlessImageHandler->RemoveBindlessImage(macroMaterial.m_colorIndex); + } + if (macroMaterial.m_normalIndex != 0xFFFF) + { + m_bindlessImageHandler->RemoveBindlessImage(macroMaterial.m_normalIndex); + } + } + +} diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMacroMaterialManager.h b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMacroMaterialManager.h new file mode 100644 index 0000000000..6a603eeced --- /dev/null +++ b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMacroMaterialManager.h @@ -0,0 +1,116 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include +#include +#include +#include + +namespace Terrain +{ + class TerrainMacroMaterialManager + : private TerrainMacroMaterialNotificationBus::Handler + , private AzFramework::Terrain::TerrainDataNotificationBus::Handler + { + public: + + TerrainMacroMaterialManager() = default; + ~TerrainMacroMaterialManager() = default; + + void Initialize( + const AZStd::shared_ptr& bindlessImageHandler, + AZ::Data::Instance& terrainSrg); + void Reset(); + bool IsInitialized(); + bool UpdateSrgIndices(AZ::Data::Instance& terrainSrg); + + void Update(AZ::Data::Instance& terrainSrg); + + private: + + static constexpr auto InvalidImageIndex = AZ::Render::BindlessImageArrayHandler::InvalidImageIndex; + static constexpr float MacroMaterialGridSize = 64.0f; + static constexpr uint16_t MacroMaterialsPerTile = 4; + + enum MacroMaterialShaderFlags : uint32_t + { + IsUsed = 0b0000'0000'0000'0000'0000'0000'0000'0001, + FlipMacroNormalX = 0b0000'0000'0000'0000'0000'0000'0000'0010, + FlipMacroNormalY = 0b0000'0000'0000'0000'0000'0000'0000'0100, + }; + + struct MacroMaterialShaderData + { + MacroMaterialShaderFlags m_flags; + uint32_t m_colorMapId{InvalidImageIndex}; + uint32_t m_normalMapId{InvalidImageIndex}; + float m_normalFactor; + + // macro material bounds in world space + AZStd::array m_boundsMin{ 0.0f, 0.0f }; + AZStd::array m_boundsMax{ 0.0f, 0.0f }; + }; + static_assert(sizeof(MacroMaterialShaderData) % 16 == 0, "MacroMaterialShaderData must be 16 byte aligned."); + + struct MacroMaterial + { + MacroMaterialData m_data; + uint16_t m_colorIndex{ 0xFFFF }; + uint16_t m_normalIndex{ 0xFFFF }; + }; + + struct MacroMaterialGridShaderData + { + uint32_t m_resolution; // How many x/y tiles in grid. x & y stored in 16 bits each. Total number of entries in m_macroMaterialData will be x * y + float m_tileSize; // Size of a tile in meters. + AZStd::array m_offset; // x/y offset of min x/y corner of grid. + }; + static_assert(sizeof(MacroMaterialGridShaderData) % 16 == 0, "MacroMaterialGridShaderData must be 16 byte aligned."); + + // AzFramework::Terrain::TerrainDataNotificationBus overrides... + void OnTerrainDataChanged(const AZ::Aabb& dirtyRegion [[maybe_unused]], TerrainDataChangedMask dataChangedMask) override; + + // TerrainMacroMaterialNotificationBus overrides... + void OnTerrainMacroMaterialCreated(AZ::EntityId entityId, const MacroMaterialData& material) override; + void OnTerrainMacroMaterialChanged(AZ::EntityId entityId, const MacroMaterialData& material) override; + void OnTerrainMacroMaterialRegionChanged(AZ::EntityId entityId, const AZ::Aabb& oldRegion, const AZ::Aabb& newRegion) override; + void OnTerrainMacroMaterialDestroyed(AZ::EntityId entityId) override; + + void UpdateMacroMaterialShaderEntry(uint16_t shaderDataIdx, const MacroMaterial& macroMaterialData); + void RemoveMacroMaterialShaderEntry(uint16_t shaderDataIdx); + + template + void ForMacroMaterialsInBounds(const AZ::Aabb& bounds, Callback callback); + + void RemoveAllImages(); + void RemoveImagesForMaterial(const MacroMaterial& macroMaterial); + + AZ::Aabb m_terrainBounds{ AZ::Aabb::CreateNull() }; + + // Macro materials stored in a grid of (MacroMaterialGridCount * MacroMaterialGridCount) where each tile in the grid covers + // an area of (MacroMaterialGridSize * MacroMaterialGridSize) and each tile can hold MacroMaterialsPerTile macro materials + AZStd::vector m_macroMaterialShaderData; + AZStd::vector m_macroMaterialEntities; // Same as above, but used to track entity ids which aren't needed by the shader. + AZStd::map m_macroMaterials; // Used for looking up macro materials by entity id when the data isn't provided by a bus. + uint16_t m_tilesX{ 0 }; + uint16_t m_tilesY{ 0 }; + + AZStd::shared_ptr m_bindlessImageHandler; + AZ::Render::GpuBufferHandler m_macroMaterialDataBuffer; + + AZ::RHI::ShaderInputConstantIndex m_macroMaterialGridIndex; + + bool m_terrainSizeChanged{ false }; + bool m_bufferNeedsUpdate{ false }; + bool m_isInitialized{ false }; + + }; +} diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMeshManager.cpp b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMeshManager.cpp new file mode 100644 index 0000000000..d689d2635c --- /dev/null +++ b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMeshManager.cpp @@ -0,0 +1,354 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include + +#include + +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +namespace Terrain +{ + namespace + { + [[maybe_unused]] static const char* TerrainMeshManagerName = "TerrainMeshManager"; + } + + namespace ShaderInputs + { + static const char* const PatchData("m_patchData"); + } + + void TerrainMeshManager::Initialize() + { + if (!InitializePatchModel()) + { + AZ_Error(TerrainMeshManagerName, false, "Failed to create Terrain render buffers!"); + return; + } + + OnTerrainDataChanged(AZ::Aabb::CreateNull(), TerrainDataChangedMask::HeightData); + AzFramework::Terrain::TerrainDataNotificationBus::Handler::BusConnect(); + + m_isInitialized = true; + } + + bool TerrainMeshManager::IsInitialized() const + { + return m_isInitialized; + } + + void TerrainMeshManager::Reset() + { + AzFramework::Terrain::TerrainDataNotificationBus::Handler::BusDisconnect(); + m_patchModel = {}; + m_sectorData.clear(); + m_rebuildSectors = true; + m_isInitialized = false; + } + + bool TerrainMeshManager::CheckRebuildSurfaces(MaterialInstance materialInstance, AZ::RPI::Scene& parentScene) + { + if (!m_rebuildSectors) + { + return false; + } + + m_rebuildSectors = false; + m_sectorData.clear(); + + const auto layout = materialInstance->GetAsset()->GetObjectSrgLayout(); + + AZ::RHI::ShaderInputConstantIndex patchDataIndex = layout->FindShaderInputConstantIndex(AZ::Name(ShaderInputs::PatchData)); + AZ_Error(TerrainMeshManagerName, patchDataIndex.IsValid(), "Failed to find shader input constant %s.", ShaderInputs::PatchData); + + const float xFirstPatchStart = AZStd::floorf(m_worldBounds.GetMin().GetX() / GridMeters) * GridMeters; + const float xLastPatchStart = AZStd::floorf(m_worldBounds.GetMax().GetX() / GridMeters) * GridMeters; + const float yFirstPatchStart = AZStd::floorf(m_worldBounds.GetMin().GetY() / GridMeters) * GridMeters; + const float yLastPatchStart = AZStd::floorf(m_worldBounds.GetMax().GetY() / GridMeters) * GridMeters; + + const auto& materialAsset = materialInstance->GetAsset(); + const auto& shaderAsset = materialAsset->GetMaterialTypeAsset()->GetShaderAssetForObjectSrg(); + + for (float yPatch = yFirstPatchStart; yPatch <= yLastPatchStart; yPatch += GridMeters) + { + for (float xPatch = xFirstPatchStart; xPatch <= xLastPatchStart; xPatch += GridMeters) + { + ShaderTerrainData objectSrgData; + objectSrgData.m_xyTranslation = { xPatch, yPatch }; + + m_sectorData.push_back(); + SectorData& sectorData = m_sectorData.back(); + + for (auto& lod : m_patchModel->GetLods()) + { + objectSrgData.m_xyScale = m_sampleSpacing * GridSize; + + auto objectSrg = AZ::RPI::ShaderResourceGroup::Create(shaderAsset, materialAsset->GetObjectSrgLayout()->GetName()); + if (!objectSrg) + { + AZ_WarningOnce(TerrainMeshManagerName, false, "Failed to create a new shader resource group, skipping."); + continue; + } + objectSrg->SetConstant(patchDataIndex, objectSrgData); + objectSrg->Compile(); + + AZ::RPI::ModelLod& modelLod = *lod.get(); + sectorData.m_drawPackets.emplace_back(modelLod, 0, materialInstance, objectSrg); + AZ::RPI::MeshDrawPacket& drawPacket = sectorData.m_drawPackets.back(); + + sectorData.m_srgs.emplace_back(objectSrg); + + // set the shader option to select forward pass IBL specular if necessary + if (!drawPacket.SetShaderOption(AZ::Name("o_meshUseForwardPassIBLSpecular"), AZ::RPI::ShaderOptionValue{ false })) + { + AZ_Warning(TerrainMeshManagerName, false, "Failed to set o_meshUseForwardPassIBLSpecular on mesh draw packet"); + } + const uint8_t stencilRef = AZ::Render::StencilRefs::UseDiffuseGIPass | AZ::Render::StencilRefs::UseIBLSpecularPass; + drawPacket.SetStencilRef(stencilRef); + drawPacket.Update(parentScene, true); + } + + sectorData.m_aabb = + AZ::Aabb::CreateFromMinMax( + AZ::Vector3(xPatch, yPatch, m_worldBounds.GetMin().GetZ()), + AZ::Vector3(xPatch + GridMeters, yPatch + GridMeters, m_worldBounds.GetMax().GetZ()) + ); + } + } + return true; + } + + void TerrainMeshManager::DrawMeshes(const AZ::RPI::FeatureProcessor::RenderPacket& process) + { + for (auto& sectorData : m_sectorData) + { + uint8_t lodChoice = AZ::RPI::ModelLodAsset::LodCountMax; + + // Go through all cameras and choose an LOD based on the closest camera. + for (auto& view : process.m_views) + { + if ((view->GetUsageFlags() & AZ::RPI::View::UsageFlags::UsageCamera) > 0) + { + const AZ::Vector3 cameraPosition = view->GetCameraTransform().GetTranslation(); + const AZ::Vector2 cameraPositionXY = AZ::Vector2(cameraPosition.GetX(), cameraPosition.GetY()); + const AZ::Vector2 sectorCenterXY = AZ::Vector2(sectorData.m_aabb.GetCenter().GetX(), sectorData.m_aabb.GetCenter().GetY()); + + const float sectorDistance = sectorCenterXY.GetDistance(cameraPositionXY); + + // This will be configurable later + const float minDistanceForLod0 = (GridMeters * 4.0f); + + // For every distance doubling beyond a minDistanceForLod0, we only need half the mesh density. Each LOD + // is exactly half the resolution of the last. + const float lodForCamera = AZStd::floorf(AZ::GetMax(0.0f, log2f(sectorDistance / minDistanceForLod0))); + + // All cameras should render the same LOD so effects like shadows are consistent. + lodChoice = AZ::GetMin(lodChoice, aznumeric_cast(lodForCamera)); + } + } + + // Add the correct LOD draw packet for visible sectors. + for (auto& view : process.m_views) + { + AZ::Frustum viewFrustum = AZ::Frustum::CreateFromMatrixColumnMajor(view->GetWorldToClipMatrix()); + if (viewFrustum.IntersectAabb(sectorData.m_aabb) != AZ::IntersectResult::Exterior) + { + const uint8_t lodToRender = AZ::GetMin(lodChoice, aznumeric_cast(sectorData.m_drawPackets.size() - 1)); + view->AddDrawPacket(sectorData.m_drawPackets.at(lodToRender).GetRHIDrawPacket()); + } + } + } + } + + void TerrainMeshManager::RebuildDrawPackets(AZ::RPI::Scene& scene) + { + for (auto& sectorData : m_sectorData) + { + for (auto& drawPacket : sectorData.m_drawPackets) + { + drawPacket.Update(scene, true); + } + } + } + + void TerrainMeshManager::OnTerrainDataDestroyBegin() + { + Reset(); + } + + void TerrainMeshManager::OnTerrainDataChanged([[maybe_unused]] const AZ::Aabb& dirtyRegion, TerrainDataChangedMask dataChangedMask) + { + if ((dataChangedMask & (TerrainDataChangedMask::HeightData | TerrainDataChangedMask::Settings)) != 0) + { + AZ::Aabb worldBounds = AZ::Aabb::CreateNull(); + AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( + worldBounds, &AzFramework::Terrain::TerrainDataRequests::GetTerrainAabb); + + AZ::Vector2 queryResolution2D = AZ::Vector2(1.0f); + AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( + queryResolution2D, &AzFramework::Terrain::TerrainDataRequests::GetTerrainHeightQueryResolution); + // Currently query resolution is multidimensional but the rendering system only supports this changing in one dimension. + float queryResolution = queryResolution2D.GetX(); + + // Sectors need to be rebuilt if the world bounds change in the x/y, or the sample spacing changes. + m_rebuildSectors = m_rebuildSectors || + m_worldBounds.GetMin().GetX() != worldBounds.GetMin().GetX() || + m_worldBounds.GetMin().GetY() != worldBounds.GetMin().GetY() || + m_worldBounds.GetMax().GetX() != worldBounds.GetMax().GetX() || + m_worldBounds.GetMax().GetY() != worldBounds.GetMax().GetY() || + m_sampleSpacing != queryResolution; + + m_worldBounds = worldBounds; + m_sampleSpacing = queryResolution; + } + } + + void TerrainMeshManager::InitializeTerrainPatch(uint16_t gridSize, PatchData& patchdata) + { + patchdata.m_positions.clear(); + patchdata.m_indices.clear(); + + const uint16_t gridVertices = gridSize + 1; // For m_gridSize quads, (m_gridSize + 1) vertices are needed. + const size_t size = gridVertices * gridVertices; + + patchdata.m_positions.reserve(size); + + for (uint16_t y = 0; y < gridVertices; ++y) + { + for (uint16_t x = 0; x < gridVertices; ++x) + { + patchdata.m_positions.push_back({ aznumeric_cast(x) / gridSize, aznumeric_cast(y) / gridSize }); + } + } + + patchdata.m_indices.reserve(gridSize * gridSize * 6); // total number of quads, 2 triangles with 6 indices per quad. + + for (uint16_t y = 0; y < gridSize; ++y) + { + for (uint16_t x = 0; x < gridSize; ++x) + { + const uint16_t topLeft = y * gridVertices + x; + const uint16_t topRight = topLeft + 1; + const uint16_t bottomLeft = (y + 1) * gridVertices + x; + const uint16_t bottomRight = bottomLeft + 1; + + patchdata.m_indices.emplace_back(topLeft); + patchdata.m_indices.emplace_back(topRight); + patchdata.m_indices.emplace_back(bottomLeft); + patchdata.m_indices.emplace_back(bottomLeft); + patchdata.m_indices.emplace_back(topRight); + patchdata.m_indices.emplace_back(bottomRight); + } + } + } + + AZ::Outcome> TerrainMeshManager::CreateBufferAsset( + const void* data, const AZ::RHI::BufferViewDescriptor& bufferViewDescriptor, const AZStd::string& bufferName) + { + AZ::RPI::BufferAssetCreator creator; + creator.Begin(AZ::Uuid::CreateRandom()); + + AZ::RHI::BufferDescriptor bufferDescriptor; + bufferDescriptor.m_bindFlags = AZ::RHI::BufferBindFlags::InputAssembly | AZ::RHI::BufferBindFlags::ShaderRead; + bufferDescriptor.m_byteCount = static_cast(bufferViewDescriptor.m_elementSize) * static_cast(bufferViewDescriptor.m_elementCount); + + creator.SetBuffer(data, bufferDescriptor.m_byteCount, bufferDescriptor); + creator.SetBufferViewDescriptor(bufferViewDescriptor); + creator.SetUseCommonPool(AZ::RPI::CommonBufferPoolType::StaticInputAssembly); + + AZ::Data::Asset bufferAsset; + if (creator.End(bufferAsset)) + { + bufferAsset.SetHint(bufferName); + return AZ::Success(bufferAsset); + } + + return AZ::Failure(); + } + + bool TerrainMeshManager::InitializePatchModel() + { + AZ::RPI::ModelAssetCreator modelAssetCreator; + modelAssetCreator.Begin(AZ::Uuid::CreateRandom()); + + uint16_t gridSize = GridSize; + float gridSpacing = GridSpacing; + + for (uint32_t i = 0; i < AZ::RPI::ModelLodAsset::LodCountMax && gridSize > 0; ++i) + { + PatchData patchData; + InitializeTerrainPatch(gridSize, patchData); + + const auto positionBufferViewDesc = AZ::RHI::BufferViewDescriptor::CreateTyped(0, aznumeric_cast(patchData.m_positions.size()), AZ::RHI::Format::R32G32_FLOAT); + const auto positionsOutcome = CreateBufferAsset(patchData.m_positions.data(), positionBufferViewDesc, "TerrainPatchPositions"); + + const auto indexBufferViewDesc = AZ::RHI::BufferViewDescriptor::CreateTyped(0, aznumeric_cast(patchData.m_indices.size()), AZ::RHI::Format::R16_UINT); + const auto indicesOutcome = CreateBufferAsset(patchData.m_indices.data(), indexBufferViewDesc, "TerrainPatchIndices"); + + if (!positionsOutcome.IsSuccess() || !indicesOutcome.IsSuccess()) + { + AZ_Error(TerrainMeshManagerName, false, "Failed to create GPU buffers for Terrain"); + return false; + } + + AZ::RPI::ModelLodAssetCreator modelLodAssetCreator; + modelLodAssetCreator.Begin(AZ::Uuid::CreateRandom()); + + modelLodAssetCreator.BeginMesh(); + modelLodAssetCreator.AddMeshStreamBuffer(AZ::RHI::ShaderSemantic{ "POSITION" }, AZ::Name(), {positionsOutcome.GetValue(), positionBufferViewDesc}); + modelLodAssetCreator.SetMeshIndexBuffer({indicesOutcome.GetValue(), indexBufferViewDesc}); + + AZ::Aabb aabb = AZ::Aabb::CreateFromMinMax(AZ::Vector3(0.0, 0.0, 0.0), AZ::Vector3(GridMeters, GridMeters, 0.0)); + modelLodAssetCreator.SetMeshAabb(AZStd::move(aabb)); + modelLodAssetCreator.SetMeshName(AZ::Name("Terrain Patch")); + modelLodAssetCreator.EndMesh(); + + AZ::Data::Asset modelLodAsset; + modelLodAssetCreator.End(modelLodAsset); + + modelAssetCreator.AddLodAsset(AZStd::move(modelLodAsset)); + + gridSize = gridSize / 2; + gridSpacing *= 2.0f; + } + + AZ::Data::Asset modelAsset; + bool success = modelAssetCreator.End(modelAsset); + + m_patchModel = AZ::RPI::Model::FindOrCreate(modelAsset); + + return success; + } + + template + void TerrainMeshManager::ForOverlappingSectors(const AZ::Aabb& bounds, Callback callback) + { + for (SectorData& sectorData : m_sectorData) + { + if (sectorData.m_aabb.Overlaps(bounds)) + { + callback(sectorData); + } + } + } + +} diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMeshManager.h b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMeshManager.h new file mode 100644 index 0000000000..7252a85686 --- /dev/null +++ b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainMeshManager.h @@ -0,0 +1,117 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include + +#include + + +namespace AZ::RPI +{ + class BufferAsset; +} + +namespace AZ::RHI +{ + struct BufferViewDescriptor; +} + +namespace Terrain +{ + class TerrainMeshManager + : private AzFramework::Terrain::TerrainDataNotificationBus::Handler + { + private: + + using MaterialInstance = AZ::Data::Instance; + + public: + + AZ_RTTI(TerrainMeshManager, "{62C84AD8-05FE-4C78-8501-A2DB6731B9B7}"); + AZ_DISABLE_COPY_MOVE(TerrainMeshManager); + + TerrainMeshManager() = default; + ~TerrainMeshManager() = default; + + void Initialize(); + bool IsInitialized() const; + void Reset(); + + bool CheckRebuildSurfaces(MaterialInstance materialInstance, AZ::RPI::Scene& parentScene); + void DrawMeshes(const AZ::RPI::FeatureProcessor::RenderPacket& process); + void RebuildDrawPackets(AZ::RPI::Scene& scene); + + static constexpr float GridSpacing{ 1.0f }; + static constexpr int32_t GridSize{ 64 }; // number of terrain quads (vertices are m_gridSize + 1) + static constexpr float GridMeters{ GridSpacing * GridSize }; + static constexpr uint32_t MaxMaterialsPerSector = 4; + + private: + + struct VertexPosition + { + float m_posx; + float m_posy; + }; + + struct PatchData + { + AZStd::vector m_positions; + AZStd::vector m_indices; + }; + + struct SectorData + { + AZStd::fixed_vector m_drawPackets; + AZStd::fixed_vector, AZ::RPI::ModelLodAsset::LodCountMax> m_srgs; // Hold on to refs so it's not dropped + AZ::Aabb m_aabb; + }; + + struct ShaderTerrainData // Must align with struct in Object Srg + { + AZStd::array m_xyTranslation{ 0.0f, 0.0f }; + float m_xyScale{ 1.0f }; + }; + + // AzFramework::Terrain::TerrainDataNotificationBus overrides... + void OnTerrainDataDestroyBegin() override; + void OnTerrainDataChanged(const AZ::Aabb& dirtyRegion, TerrainDataChangedMask dataChangedMask) override; + + AZ::Outcome> CreateBufferAsset( + const void* data, const AZ::RHI::BufferViewDescriptor& bufferViewDescriptor, const AZStd::string& bufferName); + + void InitializeTerrainPatch(uint16_t gridSize, PatchData& patchdata); + bool InitializePatchModel(); + + template + void ForOverlappingSectors(const AZ::Aabb& bounds, Callback callback); + + AZStd::vector m_sectorData; + AZ::Data::Instance m_patchModel; + + AZ::Aabb m_worldBounds{ AZ::Aabb::CreateNull() }; + float m_sampleSpacing = 1.0f; + + bool m_isInitialized{ false }; + bool m_rebuildSectors{ true }; + + }; +} diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/Vector2i.cpp b/Gems/Terrain/Code/Source/TerrainRenderer/Vector2i.cpp new file mode 100644 index 0000000000..1df945b88c --- /dev/null +++ b/Gems/Terrain/Code/Source/TerrainRenderer/Vector2i.cpp @@ -0,0 +1,41 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * 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 Terrain +{ + auto Vector2i::operator+(const Vector2i& rhs) const -> Vector2i + { + Vector2i offsetPoint = *this; + offsetPoint += rhs; + return offsetPoint; + } + + auto Vector2i::operator+=(const Vector2i& rhs) -> Vector2i& + { + m_x += rhs.m_x; + m_y += rhs.m_y; + return *this; + } + + auto Vector2i::operator-(const Vector2i& rhs) const -> Vector2i + { + return *this + -rhs; + } + + auto Vector2i::operator-=(const Vector2i& rhs) -> Vector2i& + { + return *this += -rhs; + } + + auto Vector2i::operator-() const -> Vector2i + { + return {-m_x, -m_y}; + } +} diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/Vector2i.h b/Gems/Terrain/Code/Source/TerrainRenderer/Vector2i.h new file mode 100644 index 0000000000..1244972fe9 --- /dev/null +++ b/Gems/Terrain/Code/Source/TerrainRenderer/Vector2i.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include + +namespace Terrain +{ + class Vector2i + { + public: + + Vector2i operator+(const Vector2i& rhs) const; + Vector2i& operator+=(const Vector2i& rhs); + Vector2i operator-(const Vector2i& rhs) const; + Vector2i& operator-=(const Vector2i& rhs); + Vector2i operator-() const; + + int32_t m_x{ 0 }; + int32_t m_y{ 0 }; + + }; +} diff --git a/Gems/Terrain/Code/terrain_files.cmake b/Gems/Terrain/Code/terrain_files.cmake index a4f39056e4..ab19d33618 100644 --- a/Gems/Terrain/Code/terrain_files.cmake +++ b/Gems/Terrain/Code/terrain_files.cmake @@ -31,11 +31,23 @@ set(FILES Source/TerrainRenderer/Components/TerrainSurfaceMaterialsListComponent.h Source/TerrainRenderer/Components/TerrainMacroMaterialComponent.cpp Source/TerrainRenderer/Components/TerrainMacroMaterialComponent.h + Source/TerrainRenderer/Aabb2i.cpp + Source/TerrainRenderer/Aabb2i.h Source/TerrainRenderer/TerrainFeatureProcessor.cpp Source/TerrainRenderer/TerrainFeatureProcessor.h + Source/TerrainRenderer/TerrainDetailMaterialManager.cpp + Source/TerrainRenderer/TerrainDetailMaterialManager.h + Source/TerrainRenderer/TerrainMacroMaterialManager.cpp + Source/TerrainRenderer/TerrainMacroMaterialManager.h + Source/TerrainRenderer/TerrainMeshManager.cpp + Source/TerrainRenderer/TerrainMeshManager.h + Source/TerrainRenderer/BindlessImageArrayHandler.cpp + Source/TerrainRenderer/BindlessImageArrayHandler.h Source/TerrainRenderer/TerrainAreaMaterialRequestBus.h Source/TerrainRenderer/TerrainMacroMaterialBus.cpp Source/TerrainRenderer/TerrainMacroMaterialBus.h + Source/TerrainRenderer/Vector2i.cpp + Source/TerrainRenderer/Vector2i.h Source/TerrainSystem/TerrainSystem.cpp Source/TerrainSystem/TerrainSystem.h Source/TerrainSystem/TerrainSystemBus.h From 49652352f483a92a142fe04a8d526dbf4c00ec97 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Wed, 29 Dec 2021 16:38:21 -0800 Subject: [PATCH 261/948] Allowing default ImGui clipboard behavior so copy+paste works in the imgui console menu Signed-off-by: Gene Walters --- Gems/ImGui/Code/Source/Platform/Windows/imgui_windows.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/Gems/ImGui/Code/Source/Platform/Windows/imgui_windows.cmake b/Gems/ImGui/Code/Source/Platform/Windows/imgui_windows.cmake index 419c652a38..bea2cfc38b 100644 --- a/Gems/ImGui/Code/Source/Platform/Windows/imgui_windows.cmake +++ b/Gems/ImGui/Code/Source/Platform/Windows/imgui_windows.cmake @@ -8,6 +8,5 @@ set(LY_COMPILE_DEFINITIONS PRIVATE - IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS ) From 48260486fb606020f4715f4299e46b26faa0c0cd Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Thu, 30 Dec 2021 12:43:00 -0600 Subject: [PATCH 262/948] Change gradients to use cached GradientTransform instance (#6591) * Change flow so that TerrainSystem stops responding during deactivation. Some systems might accidentally try to call back to the TerrainSystem inside a DestroyBegin notification, so make sure it stops listening before sending out the notification. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Change gradients to cache and use a GradientTransform instance. In my local test case, calling EBus on every call took 337 ms, using a lambda to wrap the calls took 197 ms, and using the fully cached version took 170 ms. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Remove the wrappingTransform function and go back to the switch statement. There was a bit of overhead to each function call due to using AZStd::function that just isn't necessary for this use case. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Add profile markers to the heightfield updates so that they're more visible. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Cleared state while component is deactivated. The state was getting refreshed even while the component was in a deactivated state, which meant that it wasn't properly notifying of state changes when it became active since it wasn't detecting an actual change. By clearing the state when deactivated, and ensuring the state isn't getting refreshed *while* deactivated, the notifications work properly. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Fixed compile warning on unit test. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Addressed PR feedback - changed comments, reduced mutex scope Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- .../Source/FastNoiseGradientComponent.cpp | 18 +++- .../Code/Source/FastNoiseGradientComponent.h | 16 ++-- Gems/FastNoise/Code/Tests/FastNoiseTest.cpp | 13 +-- .../Ebuses/GradientTransformRequestBus.h | 51 +++++++++-- .../GradientSignal/GradientTransform.h | 2 - .../Components/GradientTransformComponent.cpp | 85 +++++++++---------- .../Components/GradientTransformComponent.h | 9 +- .../Components/ImageGradientComponent.cpp | 23 +++-- .../Components/ImageGradientComponent.h | 17 ++-- .../Components/PerlinGradientComponent.cpp | 24 ++++-- .../Components/PerlinGradientComponent.h | 16 ++-- .../Components/RandomGradientComponent.cpp | 19 ++++- .../Components/RandomGradientComponent.h | 16 ++-- .../EditorGradientTransformComponent.cpp | 12 ++- .../Code/Source/GradientTransform.cpp | 58 +++++++------ .../TerrainPhysicsColliderComponent.cpp | 4 + .../Source/TerrainSystem/TerrainSystem.cpp | 6 +- 17 files changed, 245 insertions(+), 144 deletions(-) diff --git a/Gems/FastNoise/Code/Source/FastNoiseGradientComponent.cpp b/Gems/FastNoise/Code/Source/FastNoiseGradientComponent.cpp index bb4c337299..4cea2efcc8 100644 --- a/Gems/FastNoise/Code/Source/FastNoiseGradientComponent.cpp +++ b/Gems/FastNoise/Code/Source/FastNoiseGradientComponent.cpp @@ -249,6 +249,9 @@ namespace FastNoiseGem void FastNoiseGradientComponent::Activate() { + // This will immediately call OnGradientTransformChanged and initialize m_gradientTransform. + GradientSignal::GradientTransformNotificationBus::Handler::BusConnect(GetEntityId()); + // Some platforms require random seeds to be > 0. Clamp to a positive range to ensure we're always safe. m_generator.SetSeed(AZ::GetMax(m_configuration.m_seed, 1)); m_generator.SetFrequency(m_configuration.m_frequency); @@ -272,6 +275,7 @@ namespace FastNoiseGem { GradientSignal::GradientRequestBus::Handler::BusDisconnect(); FastNoiseGradientRequestBus::Handler::BusDisconnect(); + GradientSignal::GradientTransformNotificationBus::Handler::BusDisconnect(); } bool FastNoiseGradientComponent::ReadInConfig(const AZ::ComponentConfig* baseConfig) @@ -294,13 +298,21 @@ namespace FastNoiseGem return false; } + void FastNoiseGradientComponent::OnGradientTransformChanged(const GradientSignal::GradientTransform& newTransform) + { + AZStd::unique_lock lock(m_transformMutex); + m_gradientTransform = newTransform; + } + float FastNoiseGradientComponent::GetValue(const GradientSignal::GradientSampleParams& sampleParams) const { AZ::Vector3 uvw = sampleParams.m_position; - bool wasPointRejected = false; - GradientSignal::GradientTransformRequestBus::Event( - GetEntityId(), &GradientSignal::GradientTransformRequestBus::Events::TransformPositionToUVW, sampleParams.m_position, uvw, wasPointRejected); + + { + AZStd::shared_lock lock(m_transformMutex); + m_gradientTransform.TransformPositionToUVW(sampleParams.m_position, uvw, wasPointRejected); + } if (!wasPointRejected) { diff --git a/Gems/FastNoise/Code/Source/FastNoiseGradientComponent.h b/Gems/FastNoise/Code/Source/FastNoiseGradientComponent.h index da972743ec..dd19049ee6 100644 --- a/Gems/FastNoise/Code/Source/FastNoiseGradientComponent.h +++ b/Gems/FastNoise/Code/Source/FastNoiseGradientComponent.h @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -67,6 +68,7 @@ namespace FastNoiseGem : public AZ::Component , private GradientSignal::GradientRequestBus::Handler , private FastNoiseGradientRequestBus::Handler + , private GradientSignal::GradientTransformNotificationBus::Handler { public: friend class EditorFastNoiseGradientComponent; @@ -80,23 +82,25 @@ namespace FastNoiseGem FastNoiseGradientComponent(const FastNoiseGradientConfig& configuration); FastNoiseGradientComponent() = default; - ////////////////////////////////////////////////////////////////////////// - // AZ::Component interface implementation + // AZ::Component overrides... void Activate() override; void Deactivate() override; bool ReadInConfig(const AZ::ComponentConfig* baseConfig) override; bool WriteOutConfig(AZ::ComponentConfig* outBaseConfig) const override; - ////////////////////////////////////////////////////////////////////////// - // GradientRequestBus + // GradientRequestBus overrides... float GetValue(const GradientSignal::GradientSampleParams& sampleParams) const override; protected: FastNoiseGradientConfig m_configuration; FastNoise m_generator; + GradientSignal::GradientTransform m_gradientTransform; + mutable AZStd::shared_mutex m_transformMutex; - ///////////////////////////////////////////////////////////////////////// - // FastNoiseGradientRequest overrides + // GradientTransformNotificationBus overrides... + void OnGradientTransformChanged(const GradientSignal::GradientTransform& newTransform) override; + + // FastNoiseGradientRequest overrides... int GetRandomSeed() const override; void SetRandomSeed(int seed) override; diff --git a/Gems/FastNoise/Code/Tests/FastNoiseTest.cpp b/Gems/FastNoise/Code/Tests/FastNoiseTest.cpp index 620f538c71..f0d5a9d1bd 100644 --- a/Gems/FastNoise/Code/Tests/FastNoiseTest.cpp +++ b/Gems/FastNoise/Code/Tests/FastNoiseTest.cpp @@ -46,17 +46,10 @@ public: //////////////////////////////////////////////////////////////////////////// //// GradientTransformRequestBus - void TransformPositionToUVW([[maybe_unused]] const AZ::Vector3& inPosition, [[maybe_unused]] AZ::Vector3& outUVW, [[maybe_unused]] bool& wasPointRejected) const override {} - void TransformPositionToUVWNormalized( - [[maybe_unused]] const AZ::Vector3& inPosition, - [[maybe_unused]] AZ::Vector3& outUVW, - [[maybe_unused]] bool& wasPointRejected) const override + const GradientSignal::GradientTransform& GetGradientTransform() const override { + return m_gradientTransform; } - void GetGradientLocalBounds([[maybe_unused]] AZ::Aabb& bounds) const override - { - } - void GetGradientEncompassingBounds([[maybe_unused]] AZ::Aabb& bounds) const override {} ////////////////////////////////////////////////////////////////////////// // GradientTransformModifierRequestBus @@ -104,6 +97,8 @@ public: bool GetAdvancedMode() const override { return false; } void SetAdvancedMode([[maybe_unused]] bool value) override {} + + GradientSignal::GradientTransform m_gradientTransform; }; TEST(FastNoiseTest, ComponentsWithComponentApplication) diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientTransformRequestBus.h b/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientTransformRequestBus.h index ac2f1a9cb1..3b674d0bd5 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientTransformRequestBus.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientTransformRequestBus.h @@ -11,6 +11,7 @@ #include #include #include +#include namespace GradientSignal { @@ -22,16 +23,56 @@ namespace GradientSignal static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; using BusIdType = AZ::EntityId; - //! allows multiple threads to call shape requests + //! allows multiple threads to call gradient transform requests using MutexType = AZStd::recursive_mutex; virtual ~GradientTransformRequests() = default; - virtual void TransformPositionToUVW(const AZ::Vector3& inPosition, AZ::Vector3& outUVW, bool& wasPointRejected) const = 0; - virtual void TransformPositionToUVWNormalized(const AZ::Vector3& inPosition, AZ::Vector3& outUVW, bool& wasPointRejected) const = 0; - virtual void GetGradientLocalBounds(AZ::Aabb& bounds) const = 0; - virtual void GetGradientEncompassingBounds(AZ::Aabb& bounds) const = 0; + //! Get the GradientTransform that's been configured by the bus listener. + //! \return the GradientTransform instance that can be used to transform world points into gradient lookup space. + virtual const GradientTransform& GetGradientTransform() const = 0; }; using GradientTransformRequestBus = AZ::EBus; + + /** + * Notifies about changes to the GradientTransform configuration + */ + class GradientTransformNotifications + : public AZ::EBusTraits + { + public: + //////////////////////////////////////////////////////////////////////// + // EBusTraits + static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; + using BusIdType = AZ::EntityId; + using MutexType = AZStd::recursive_mutex; + //////////////////////////////////////////////////////////////////////// + + //! Notify listeners that the GradientTransform configuration has changed. + //! \return the GradientTransform instance that can be used to transform world points into gradient lookup space. + virtual void OnGradientTransformChanged(const GradientTransform& newTransform) = 0; + + //! Connection policy that auto-calls OnGradientTransformChanged on connection with the current GradientTransform data. + template + struct ConnectionPolicy : public AZ::EBusConnectionPolicy + { + static void Connect( + typename Bus::BusPtr& busPtr, + typename Bus::Context& context, + typename Bus::HandlerNode& handler, + typename Bus::Context::ConnectLockGuard& connectLock, + const typename Bus::BusIdType& id = 0) + { + AZ::EBusConnectionPolicy::Connect(busPtr, context, handler, connectLock, id); + + GradientTransform transform; + GradientTransformRequestBus::EventResult(transform, id, &GradientTransformRequests::GetGradientTransform); + handler->OnGradientTransformChanged(transform); + } + }; + }; + + using GradientTransformNotificationBus = AZ::EBus; + } //namespace GradientSignal diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/GradientTransform.h b/Gems/GradientSignal/Code/Include/GradientSignal/GradientTransform.h index c8073c2f4f..b191ea245a 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/GradientTransform.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/GradientTransform.h @@ -111,7 +111,6 @@ namespace GradientSignal private: //! These are the various transformations that will be performed, based on wrapping type. - using WrappingTransformFunction = AZStd::function; static AZ::Vector3 NoTransform(const AZ::Vector3& point, const AZ::Aabb& bounds); static AZ::Vector3 GetUnboundedPointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds); static AZ::Vector3 GetClampedPointInAabb(const AZ::Vector3& point, const AZ::Aabb& bounds); @@ -144,7 +143,6 @@ namespace GradientSignal //! How the gradient should repeat itself outside of the shape bounds. WrappingType m_wrappingType = WrappingType::None; - WrappingTransformFunction m_wrappingTransform = NoTransform; /** * Cached reciprocal for performing an inverse lerp back to shape bounds. diff --git a/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.cpp b/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.cpp index 8cd7dc56a1..5b2ce4d4cf 100644 --- a/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.cpp @@ -276,24 +276,29 @@ namespace GradientSignal void GradientTransformComponent::Activate() { + m_dirty = false; + m_gradientTransform = GradientTransform(); + + // Update our GradientTransform to be configured correctly. We don't need to notify dependents of the change though. + // If anyone is listening, they're already getting notified below. + const bool notifyDependentsOfChange = false; + UpdateFromShape(notifyDependentsOfChange); + GradientTransformRequestBus::Handler::BusConnect(GetEntityId()); LmbrCentral::DependencyNotificationBus::Handler::BusConnect(GetEntityId()); AZ::TickBus::Handler::BusConnect(); GradientTransformModifierRequestBus::Handler::BusConnect(GetEntityId()); - m_dirty = false; - m_dependencyMonitor.Reset(); m_dependencyMonitor.ConnectOwner(GetEntityId()); m_dependencyMonitor.ConnectDependency(GetEntityId()); m_dependencyMonitor.ConnectDependency(GetShapeEntityId()); - - UpdateFromShape(); } void GradientTransformComponent::Deactivate() { m_dirty = false; + m_gradientTransform = GradientTransform(); m_dependencyMonitor.Reset(); GradientTransformRequestBus::Handler::BusDisconnect(); @@ -322,28 +327,10 @@ namespace GradientSignal return false; } - void GradientTransformComponent::TransformPositionToUVW(const AZ::Vector3& inPosition, AZ::Vector3& outUVW, bool& wasPointRejected) const + const GradientTransform& GradientTransformComponent::GetGradientTransform() const { AZStd::lock_guard lock(m_cacheMutex); - m_gradientTransform.TransformPositionToUVW(inPosition, outUVW, wasPointRejected); - } - - void GradientTransformComponent::TransformPositionToUVWNormalized( - const AZ::Vector3& inPosition, AZ::Vector3& outUVW, bool& wasPointRejected) const - { - AZStd::lock_guard lock(m_cacheMutex); - m_gradientTransform.TransformPositionToUVWNormalized(inPosition, outUVW, wasPointRejected); - } - - void GradientTransformComponent::GetGradientLocalBounds(AZ::Aabb& bounds) const - { - bounds = m_shapeBounds; - } - - void GradientTransformComponent::GetGradientEncompassingBounds(AZ::Aabb& bounds) const - { - bounds = m_shapeBounds; - bounds.ApplyMatrix3x4(m_shapeTransformInverse.GetInverseFull()); + return m_gradientTransform; } void GradientTransformComponent::OnCompositionChanged() @@ -355,25 +342,16 @@ namespace GradientSignal { if (m_dirty) { - const auto configurationOld = m_configuration; - const auto shapeBoundsOld = m_shapeBounds; - const auto shapeTransformInverseOld = m_shapeTransformInverse; - - //updating on tick to query transform bus on main thread - UpdateFromShape(); + // Updating on tick to query transform bus on main thread. + // Also, if the GradientTransform configuration changes, notify listeners so they can refresh themselves. + const bool notifyDependentsOfChange = true; + UpdateFromShape(notifyDependentsOfChange); - //notify observers if content has changed - if (configurationOld != m_configuration || - shapeBoundsOld != m_shapeBounds || - shapeTransformInverseOld != m_shapeTransformInverse) - { - LmbrCentral::DependencyNotificationBus::Event(GetEntityId(), &LmbrCentral::DependencyNotificationBus::Events::OnCompositionChanged); - } m_dirty = false; } } - void GradientTransformComponent::UpdateFromShape() + void GradientTransformComponent::UpdateFromShape(bool notifyDependentsOfChange) { AZ_PROFILE_FUNCTION(Entity); @@ -385,6 +363,10 @@ namespace GradientSignal return; } + const GradientTransform oldGradientTransform = m_gradientTransform; + AZ::Aabb shapeBounds = AZ::Aabb::CreateNull(); + AZ::Matrix3x4 shapeTransformInverse = AZ::Matrix3x4::CreateIdentity(); + AZ::Transform shapeTransform = AZ::Transform::CreateIdentity(); switch (m_configuration.m_transformType) { @@ -428,10 +410,10 @@ namespace GradientSignal if (!m_configuration.m_advancedMode || !m_configuration.m_overrideBounds) { // If we have a shape reference, grab its local space bounds and (inverse) transform into that local space - GetObbParamsFromShape(shapeReference, m_shapeBounds, m_shapeTransformInverse); - if (m_shapeBounds.IsValid()) + GetObbParamsFromShape(shapeReference, shapeBounds, shapeTransformInverse); + if (shapeBounds.IsValid()) { - m_configuration.m_bounds = m_shapeBounds.GetExtents(); + m_configuration.m_bounds = shapeBounds.GetExtents(); } } @@ -453,19 +435,34 @@ namespace GradientSignal //rebuild bounds from parameters m_configuration.m_bounds = m_configuration.m_bounds.GetAbs(); - m_shapeBounds = AZ::Aabb::CreateFromMinMax(-m_configuration.m_bounds * 0.5f, m_configuration.m_bounds * 0.5f); + shapeBounds = AZ::Aabb::CreateFromMinMax(-m_configuration.m_bounds * 0.5f, m_configuration.m_bounds * 0.5f); //rebuild transform from parameters AZ::Matrix3x4 shapeTransformFinal; shapeTransformFinal.SetFromEulerDegrees(m_configuration.m_rotate); shapeTransformFinal.SetTranslation(m_configuration.m_translate); shapeTransformFinal.MultiplyByScale(m_configuration.m_scale); - m_shapeTransformInverse = shapeTransformFinal.GetInverseFull(); + shapeTransformInverse = shapeTransformFinal.GetInverseFull(); // Set everything up on the Gradient Transform const bool use3dGradients = m_configuration.m_advancedMode && m_configuration.m_is3d; m_gradientTransform = GradientTransform( - m_shapeBounds, shapeTransformFinal, use3dGradients, m_configuration.m_frequencyZoom, m_configuration.m_wrappingType); + shapeBounds, shapeTransformFinal, use3dGradients, m_configuration.m_frequencyZoom, m_configuration.m_wrappingType); + + // If the transform has changed, send out notifications. + if (oldGradientTransform != m_gradientTransform) + { + // Always notify on the GradientTransformNotificationBus. + GradientTransformNotificationBus::Event( + GetEntityId(), &GradientTransformNotificationBus::Events::OnGradientTransformChanged, m_gradientTransform); + + // Only notify the DependencyNotificationBus when requested by the caller. + if (notifyDependentsOfChange) + { + LmbrCentral::DependencyNotificationBus::Event( + GetEntityId(), &LmbrCentral::DependencyNotificationBus::Events::OnCompositionChanged); + } + } } AZ::EntityId GradientTransformComponent::GetShapeEntityId() const diff --git a/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.h b/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.h index 50ae6fe475..805fba9e74 100644 --- a/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.h +++ b/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.h @@ -101,10 +101,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientTransformRequestBus - void TransformPositionToUVW(const AZ::Vector3& inPosition, AZ::Vector3& outUVW, bool& wasPointRejected) const override; - void TransformPositionToUVWNormalized(const AZ::Vector3& inPosition, AZ::Vector3& outUVW, bool& wasPointRejected) const override; - void GetGradientLocalBounds(AZ::Aabb& bounds) const override; - void GetGradientEncompassingBounds(AZ::Aabb& bounds) const override; + const GradientTransform& GetGradientTransform() const override; ////////////////////////////////////////////////////////////////////////// // DependencyNotificationBus @@ -114,7 +111,7 @@ namespace GradientSignal // AZ::TickBus::Handler void OnTick(float deltaTime, AZ::ScriptTimePoint time) override; - void UpdateFromShape(); + void UpdateFromShape(bool notifyDependentsOfChange); AZ::EntityId GetShapeEntityId() const; @@ -169,8 +166,6 @@ namespace GradientSignal private: mutable AZStd::recursive_mutex m_cacheMutex; GradientTransformConfig m_configuration; - AZ::Aabb m_shapeBounds = AZ::Aabb::CreateNull(); - AZ::Matrix3x4 m_shapeTransformInverse = AZ::Matrix3x4::CreateIdentity(); LmbrCentral::DependencyMonitor m_dependencyMonitor; AZStd::atomic_bool m_dirty{ false }; GradientTransform m_gradientTransform; diff --git a/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp index 2d594a201c..4bf709755b 100644 --- a/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp @@ -129,6 +129,9 @@ namespace GradientSignal void ImageGradientComponent::Activate() { + // This will immediately call OnGradientTransformChanged and initialize m_gradientTransform. + GradientTransformNotificationBus::Handler::BusConnect(GetEntityId()); + SetupDependencies(); ImageGradientRequestBus::Handler::BusConnect(GetEntityId()); @@ -144,6 +147,7 @@ namespace GradientSignal AZ::Data::AssetBus::Handler::BusDisconnect(); GradientRequestBus::Handler::BusDisconnect(); ImageGradientRequestBus::Handler::BusDisconnect(); + GradientTransformNotificationBus::Handler::BusDisconnect(); m_dependencyMonitor.Reset(); @@ -189,18 +193,27 @@ namespace GradientSignal m_configuration.m_imageAsset = asset; } + void ImageGradientComponent::OnGradientTransformChanged(const GradientTransform& newTransform) + { + AZStd::unique_lock lock(m_imageMutex); + m_gradientTransform = newTransform; + } + float ImageGradientComponent::GetValue(const GradientSampleParams& sampleParams) const { AZ::Vector3 uvw = sampleParams.m_position; - bool wasPointRejected = false; - GradientTransformRequestBus::Event( - GetEntityId(), &GradientTransformRequestBus::Events::TransformPositionToUVWNormalized, sampleParams.m_position, uvw, wasPointRejected); - if (!wasPointRejected) { AZStd::shared_lock imageLock(m_imageMutex); - return GetValueFromImageAsset(m_configuration.m_imageAsset, uvw, m_configuration.m_tilingX, m_configuration.m_tilingY, 0.0f); + + m_gradientTransform.TransformPositionToUVWNormalized(sampleParams.m_position, uvw, wasPointRejected); + + if (!wasPointRejected) + { + return GetValueFromImageAsset( + m_configuration.m_imageAsset, uvw, m_configuration.m_tilingX, m_configuration.m_tilingY, 0.0f); + } } return 0.0f; diff --git a/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.h b/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.h index e73c8d0c4a..8214436f83 100644 --- a/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.h @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -46,6 +47,7 @@ namespace GradientSignal , private AZ::Data::AssetBus::Handler , private GradientRequestBus::Handler , private ImageGradientRequestBus::Handler + , private GradientTransformNotificationBus::Handler { public: template friend class LmbrCentral::EditorWrappedComponentBase; @@ -59,29 +61,27 @@ namespace GradientSignal ImageGradientComponent() = default; ~ImageGradientComponent() = default; - ////////////////////////////////////////////////////////////////////////// - // AZ::Component interface implementation + // AZ::Component overrides... void Activate() override; void Deactivate() override; bool ReadInConfig(const AZ::ComponentConfig* baseConfig) override; bool WriteOutConfig(AZ::ComponentConfig* outBaseConfig) const override; - ////////////////////////////////////////////////////////////////////////// - // GradientRequestBus + // GradientRequestBus overrides... float GetValue(const GradientSampleParams& sampleParams) const override; - ////////////////////////////////////////////////////////////////////////// - // AZ::Data::AssetBus::Handler + // AZ::Data::AssetBus overrides... void OnAssetReady(AZ::Data::Asset asset) override; void OnAssetMoved(AZ::Data::Asset asset, void* oldDataPointer) override; void OnAssetReloaded(AZ::Data::Asset asset) override; protected: + // GradientTransformNotificationBus overrides... + void OnGradientTransformChanged(const GradientTransform& newTransform) override; void SetupDependencies(); - ////////////////////////////////////////////////////////////////////////// - // ImageGradientRequestBus + // ImageGradientRequestBus overrides... AZStd::string GetImageAssetPath() const override; void SetImageAssetPath(const AZStd::string& assetPath) override; @@ -95,5 +95,6 @@ namespace GradientSignal ImageGradientConfig m_configuration; LmbrCentral::DependencyMonitor m_dependencyMonitor; mutable AZStd::shared_mutex m_imageMutex; + GradientTransform m_gradientTransform; }; } diff --git a/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp index d5e846b9ef..8f9d40387b 100644 --- a/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp @@ -138,6 +138,9 @@ namespace GradientSignal void PerlinGradientComponent::Activate() { + // This will immediately call OnGradientTransformChanged and initialize m_gradientTransform. + GradientTransformNotificationBus::Handler::BusConnect(GetEntityId()); + m_perlinImprovedNoise.reset(aznew PerlinImprovedNoise(AZ::GetMax(m_configuration.m_randomSeed, 1))); GradientRequestBus::Handler::BusConnect(GetEntityId()); PerlinGradientRequestBus::Handler::BusConnect(GetEntityId()); @@ -148,6 +151,7 @@ namespace GradientSignal m_perlinImprovedNoise.reset(); GradientRequestBus::Handler::BusDisconnect(); PerlinGradientRequestBus::Handler::BusDisconnect(); + GradientTransformNotificationBus::Handler::BusDisconnect(); } bool PerlinGradientComponent::ReadInConfig(const AZ::ComponentConfig* baseConfig) @@ -170,21 +174,29 @@ namespace GradientSignal return false; } - float PerlinGradientComponent::GetValue(const GradientSampleParams& sampleParams) const + void PerlinGradientComponent::OnGradientTransformChanged(const GradientTransform& newTransform) { - AZ_PROFILE_FUNCTION(Entity); + AZStd::unique_lock lock(m_transformMutex); + m_gradientTransform = newTransform; + } + float PerlinGradientComponent::GetValue(const GradientSampleParams& sampleParams) const + { if (m_perlinImprovedNoise) { AZ::Vector3 uvw = sampleParams.m_position; - bool wasPointRejected = false; - GradientTransformRequestBus::Event( - GetEntityId(), &GradientTransformRequestBus::Events::TransformPositionToUVW, sampleParams.m_position, uvw, wasPointRejected); + + { + AZStd::shared_lock lock(m_transformMutex); + m_gradientTransform.TransformPositionToUVW(sampleParams.m_position, uvw, wasPointRejected); + } if (!wasPointRejected) { - return m_perlinImprovedNoise->GenerateOctaveNoise(uvw.GetX(), uvw.GetY(), uvw.GetZ(), m_configuration.m_octave, m_configuration.m_amplitude, m_configuration.m_frequency); + return m_perlinImprovedNoise->GenerateOctaveNoise( + uvw.GetX(), uvw.GetY(), uvw.GetZ(), m_configuration.m_octave, m_configuration.m_amplitude, + m_configuration.m_frequency); } } diff --git a/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.h b/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.h index 9fda45c716..ef171f5319 100644 --- a/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.h @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -47,6 +48,7 @@ namespace GradientSignal : public AZ::Component , private GradientRequestBus::Handler , private PerlinGradientRequestBus::Handler + , private GradientTransformNotificationBus::Handler { public: template friend class LmbrCentral::EditorWrappedComponentBase; @@ -60,23 +62,25 @@ namespace GradientSignal PerlinGradientComponent() = default; ~PerlinGradientComponent() = default; - ////////////////////////////////////////////////////////////////////////// - // AZ::Component interface implementation + // AZ::Component overrides... void Activate() override; void Deactivate() override; bool ReadInConfig(const AZ::ComponentConfig* baseConfig) override; bool WriteOutConfig(AZ::ComponentConfig* outBaseConfig) const override; - ////////////////////////////////////////////////////////////////////////// - // GradientRequestBus + // GradientRequestBus overrides... float GetValue(const GradientSampleParams& sampleParams) const override; private: PerlinGradientConfig m_configuration; AZStd::unique_ptr m_perlinImprovedNoise; + GradientTransform m_gradientTransform; + mutable AZStd::shared_mutex m_transformMutex; - ///////////////////////////////////////////////////////////////////////// - //PerlinGradientRequest overrides + // GradientTransformNotificationBus overrides... + void OnGradientTransformChanged(const GradientTransform& newTransform) override; + + // PerlinGradientRequestBus overrides... int GetRandomSeed() const override; void SetRandomSeed(int seed) override; diff --git a/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp index d320dbeb3d..fc2ccbef70 100644 --- a/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp @@ -105,6 +105,9 @@ namespace GradientSignal void RandomGradientComponent::Activate() { + // This will immediately call OnGradientTransformChanged and initialize m_gradientTransform. + GradientTransformNotificationBus::Handler::BusConnect(GetEntityId()); + GradientRequestBus::Handler::BusConnect(GetEntityId()); RandomGradientRequestBus::Handler::BusConnect(GetEntityId()); } @@ -113,6 +116,7 @@ namespace GradientSignal { GradientRequestBus::Handler::BusDisconnect(); RandomGradientRequestBus::Handler::BusDisconnect(); + GradientTransformNotificationBus::Handler::BusDisconnect(); } bool RandomGradientComponent::ReadInConfig(const AZ::ComponentConfig* baseConfig) @@ -135,15 +139,22 @@ namespace GradientSignal return false; } + void RandomGradientComponent::OnGradientTransformChanged(const GradientTransform& newTransform) + { + AZStd::unique_lock lock(m_transformMutex); + m_gradientTransform = newTransform; + } + float RandomGradientComponent::GetValue(const GradientSampleParams& sampleParams) const { - AZ_PROFILE_FUNCTION(Entity); AZ::Vector3 uvw = sampleParams.m_position; - bool wasPointRejected = false; - GradientTransformRequestBus::Event( - GetEntityId(), &GradientTransformRequestBus::Events::TransformPositionToUVW, sampleParams.m_position, uvw, wasPointRejected); + + { + AZStd::shared_lock lock(m_transformMutex); + m_gradientTransform.TransformPositionToUVW(sampleParams.m_position, uvw, wasPointRejected); + } if (!wasPointRejected) { diff --git a/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.h b/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.h index 299b9dadfe..b0dbd964a0 100644 --- a/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.h @@ -10,6 +10,7 @@ #include #include +#include #include namespace LmbrCentral @@ -38,6 +39,7 @@ namespace GradientSignal : public AZ::Component , private GradientRequestBus::Handler , private RandomGradientRequestBus::Handler + , private GradientTransformNotificationBus::Handler { public: template friend class LmbrCentral::EditorWrappedComponentBase; @@ -51,22 +53,24 @@ namespace GradientSignal RandomGradientComponent() = default; ~RandomGradientComponent() = default; - ////////////////////////////////////////////////////////////////////////// - // AZ::Component interface implementation + // AZ::Component overrides... void Activate() override; void Deactivate() override; bool ReadInConfig(const AZ::ComponentConfig* baseConfig) override; bool WriteOutConfig(AZ::ComponentConfig* outBaseConfig) const override; - ////////////////////////////////////////////////////////////////////////// - // GradientRequestBus + // GradientRequestBus overrides... float GetValue(const GradientSampleParams& sampleParams) const override; private: RandomGradientConfig m_configuration; + GradientTransform m_gradientTransform; + mutable AZStd::shared_mutex m_transformMutex; - ///////////////////////////////////////////////////////////////////////// - // RandomGradientRequest overrides + // GradientTransformNotificationBus overrides... + void OnGradientTransformChanged(const GradientTransform& newTransform) override; + + // RandomGradientRequestBus overrides... int GetRandomSeed() const override; void SetRandomSeed(int seed) override; }; diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorGradientTransformComponent.cpp b/Gems/GradientSignal/Code/Source/Editor/EditorGradientTransformComponent.cpp index 4517c30711..850faf19df 100644 --- a/Gems/GradientSignal/Code/Source/Editor/EditorGradientTransformComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Editor/EditorGradientTransformComponent.cpp @@ -55,9 +55,13 @@ namespace GradientSignal void EditorGradientTransformComponent::UpdateFromShape() { - // Update config from shape on game component, copy that back to our config - m_component.UpdateFromShape(); - m_component.WriteOutConfig(&m_configuration); - SetDirty(); + if (m_runtimeComponentActive) + { + // Update config from shape on game component, copy that back to our config. + bool notifyDependentsOfChange = true; + m_component.UpdateFromShape(notifyDependentsOfChange); + m_component.WriteOutConfig(&m_configuration); + SetDirty(); + } } } //namespace GradientSignal diff --git a/Gems/GradientSignal/Code/Source/GradientTransform.cpp b/Gems/GradientSignal/Code/Source/GradientTransform.cpp index acf9e2f150..ffaa8f7e6a 100644 --- a/Gems/GradientSignal/Code/Source/GradientTransform.cpp +++ b/Gems/GradientSignal/Code/Source/GradientTransform.cpp @@ -20,7 +20,6 @@ namespace GradientSignal , m_inverseTransform(transform.GetInverseFull()) , m_frequencyZoom(frequencyZoom) , m_wrappingType(wrappingType) - , m_wrappingTransform(NoTransform) , m_alwaysAcceptPoint(true) { // If we want this to be a 2D gradient lookup, we always want to set the W result in the output to 0. @@ -30,31 +29,17 @@ namespace GradientSignal m_inverseTransform.SetRow(2, AZ::Vector4::CreateZero()); } - // Set up the appropriate wrapping transform function for the the given wrapping type. - // Also note that ClampToZero is the only wrapping type that allows us to return a "pointIsRejected" result - // for points that fall outside the shape bounds. - if (m_shapeBounds.IsValid()) + // If we have invalid shape bounds, reset the wrapping type back to None. Wrapping won't work without valid bounds. + if (!m_shapeBounds.IsValid()) { - switch (wrappingType) - { - default: - case WrappingType::None: - m_wrappingTransform = GetUnboundedPointInAabb; - break; - case WrappingType::ClampToEdge: - m_wrappingTransform = GetClampedPointInAabb; - break; - case WrappingType::ClampToZero: - m_alwaysAcceptPoint = false; - m_wrappingTransform = GetClampedPointInAabb; - break; - case WrappingType::Mirror: - m_wrappingTransform = GetMirroredPointInAabb; - break; - case WrappingType::Repeat: - m_wrappingTransform = GetWrappedPointInAabb; - break; - } + m_wrappingType = WrappingType::None; + } + + // ClampToZero is the only wrapping type that allows us to return a "pointIsRejected" result for points that fall + // outside the shape bounds. + if (m_wrappingType == WrappingType::ClampToZero) + { + m_alwaysAcceptPoint = false; } m_normalizeExtentsReciprocal = AZ::Vector3( @@ -76,7 +61,26 @@ namespace GradientSignal (outUVW.IsGreaterEqualThan(m_shapeBounds.GetMin()) && outUVW.IsLessThan(m_shapeBounds.GetMax())); wasPointRejected = !wasPointAccepted; - outUVW = m_wrappingTransform(outUVW, m_shapeBounds); + switch (m_wrappingType) + { + default: + case WrappingType::None: + outUVW = GetUnboundedPointInAabb(outUVW, m_shapeBounds); + break; + case WrappingType::ClampToEdge: + outUVW = GetClampedPointInAabb(outUVW, m_shapeBounds); + break; + case WrappingType::ClampToZero: + outUVW = GetClampedPointInAabb(outUVW, m_shapeBounds); + break; + case WrappingType::Mirror: + outUVW = GetMirroredPointInAabb(outUVW, m_shapeBounds); + break; + case WrappingType::Repeat: + outUVW = GetWrappedPointInAabb(outUVW, m_shapeBounds); + break; + } + outUVW *= m_frequencyZoom; } @@ -121,7 +125,7 @@ namespace GradientSignal * [min, max) : value * [max, min) : max - value - epsilon * ... - * The epsilon is because we always want to keep our output values in the [min, max) range. We apply the epsilon to all + * The epsilon is because we always want to keep our output values in the [min, max) range. We apply the epsilon to all * the mirrored values so that we get consistent spacing between the values. */ diff --git a/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp b/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp index 1299403659..8c2c0e80b6 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp +++ b/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp @@ -255,6 +255,8 @@ namespace Terrain void TerrainPhysicsColliderComponent::GenerateHeightsInBounds(AZStd::vector& heights) const { + AZ_PROFILE_FUNCTION(Entity); + const AZ::Vector2 gridResolution = GetHeightfieldGridSpacing(); AZ::Aabb worldSize = GetHeightfieldAabb(); @@ -315,6 +317,8 @@ namespace Terrain void TerrainPhysicsColliderComponent::GenerateHeightsAndMaterialsInBounds( AZStd::vector& heightMaterials) const { + AZ_PROFILE_FUNCTION(Entity); + const AZ::Vector2 gridResolution = GetHeightfieldGridSpacing(); AZ::Aabb worldSize = GetHeightfieldAabb(); diff --git a/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.cpp b/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.cpp index 1b2dedd469..7c8b6021af 100644 --- a/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.cpp +++ b/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.cpp @@ -105,11 +105,13 @@ void TerrainSystem::Activate() void TerrainSystem::Deactivate() { + // Stop listening to the bus even before we signal DestroyBegin so that way any calls to the terrain system as a *result* of + // calling DestroyBegin will fail to reach the terrain system. + AzFramework::Terrain::TerrainDataRequestBus::Handler::BusDisconnect(); + AzFramework::Terrain::TerrainDataNotificationBus::Broadcast( &AzFramework::Terrain::TerrainDataNotificationBus::Events::OnTerrainDataDestroyBegin); - AzFramework::Terrain::TerrainDataRequestBus::Handler::BusDisconnect(); - { AZStd::unique_lock lock(m_areaMutex); m_registeredAreas.clear(); From 8cd4a3dceda4654bdb9741d9b7a0c75e84309de4 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Thu, 30 Dec 2021 12:50:06 -0800 Subject: [PATCH 263/948] Fix netbind component to use the new svg icons instead of png (which no longer exist) Signed-off-by: Gene Walters --- Gems/Multiplayer/Code/Source/Components/NetBindComponent.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gems/Multiplayer/Code/Source/Components/NetBindComponent.cpp b/Gems/Multiplayer/Code/Source/Components/NetBindComponent.cpp index e7cf297f1e..beb17ed9f6 100644 --- a/Gems/Multiplayer/Code/Source/Components/NetBindComponent.cpp +++ b/Gems/Multiplayer/Code/Source/Components/NetBindComponent.cpp @@ -39,8 +39,8 @@ namespace Multiplayer "Network Binding", "The Network Binding component marks an entity as able to be replicated across the network") ->ClassElement(AZ::Edit::ClassElements::EditorData, "") ->Attribute(AZ::Edit::Attributes::Category, "Multiplayer") - ->Attribute(AZ::Edit::Attributes::Icon, "Icons/Components/NetBind.png") - ->Attribute(AZ::Edit::Attributes::ViewportIcon, "Icons/Components/Viewport/NetBind.png") + ->Attribute(AZ::Edit::Attributes::Icon, "Icons/Components/NetBinding.svg") + ->Attribute(AZ::Edit::Attributes::ViewportIcon, "Icons/Components/Viewport/NetBinding.svg") ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC_CE("Game")); } } From 955a6db374f851e31c920b1d2e017fc315565330 Mon Sep 17 00:00:00 2001 From: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> Date: Thu, 30 Dec 2021 15:56:27 -0600 Subject: [PATCH 264/948] Converting Editor automated tests to utilize prefab system Signed-off-by: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> --- .../hydra_editor_utils.py | 13 +++++-- .../AssetBrowser_SearchFiltering.py | 5 ++- .../AssetBrowser_TreeNavigation.py | 4 +-- .../editor/EditorScripts/AssetPicker_UI_UX.py | 3 +- ...flows_ExistingLevel_EntityComponentCRUD.py | 6 ++-- ...ditorWorkflows_LevelEntityComponentCRUD.py | 30 +++++++--------- .../ComponentCRUD_Add_Delete_Components.py | 6 ++-- .../EditorScripts/Docking_BasicDockedTools.py | 13 ++++--- .../EntityOutliner_EntityOrdering.py | 11 +++--- .../InputBindings_Add_Remove_Input_Events.py | 5 ++- .../EditorScripts/Menus_EditMenuOptions.py | 5 ++- .../EditorScripts/Menus_FileMenuOptions.py | 12 +++---- .../EditorScripts/Menus_ViewMenuOptions.py | 5 ++- .../Gem/PythonTests/editor/TestSuite_Main.py | 20 +++++------ .../editor/TestSuite_Main_Optimized.py | 33 +++++++++-------- .../PythonTests/editor/TestSuite_Periodic.py | 35 +++++++++++-------- .../PythonTests/editor/TestSuite_Sandbox.py | 4 +-- .../editor/TestSuite_Sandbox_Optimized.py | 2 -- 18 files changed, 105 insertions(+), 107 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_editor_utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_editor_utils.py index 5e3828ad02..36fc6003f7 100644 --- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_editor_utils.py +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_editor_utils.py @@ -5,15 +5,22 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ +from typing import List +from math import isclose +import collections.abc + import azlmbr.bus as bus import azlmbr.editor as editor import azlmbr.entity as entity import azlmbr.legacy.general as general import azlmbr.object -from typing import List -from math import isclose -import collections.abc +from editor_python_test_tools.utils import TestHelper as helper + + +def open_base_level(): + helper.init_idle() + helper.open_level("Prefab", "Base") def find_entity_by_name(entity_name): diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_SearchFiltering.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_SearchFiltering.py index 7366faafdc..254224a2f8 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_SearchFiltering.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_SearchFiltering.py @@ -59,8 +59,8 @@ def AssetBrowser_SearchFiltering(): import azlmbr.legacy.general as general + import editor_python_test_tools.hydra_editor_utils as hydra from editor_python_test_tools.utils import Report - from editor_python_test_tools.utils import TestHelper as helper def verify_files_appeared(model, allowed_asset_extensions, parent_index=QtCore.QModelIndex()): indexes = [parent_index] @@ -80,8 +80,7 @@ def AssetBrowser_SearchFiltering(): return True # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # 2) Open Asset Browser (if not opened already) editor_window = pyside_utils.get_editor_main_window() diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_TreeNavigation.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_TreeNavigation.py index ecc77778cc..52072205b5 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_TreeNavigation.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_TreeNavigation.py @@ -53,6 +53,7 @@ def AssetBrowser_TreeNavigation(): import azlmbr.legacy.general as general import editor_python_test_tools.pyside_utils as pyside_utils + import editor_python_test_tools.hydra_editor_utils as hydra from editor_python_test_tools.utils import Report from editor_python_test_tools.utils import TestHelper as helper @@ -69,8 +70,7 @@ def AssetBrowser_TreeNavigation(): file_path = ("AutomatedTesting", "Assets", "ImageGradients", "image_grad_test_gsi.png") # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # 2) Open Asset Browser (if not opened already) editor_window = pyside_utils.get_editor_main_window() diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetPicker_UI_UX.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetPicker_UI_UX.py index 59a78c9e5d..047d6edf41 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetPicker_UI_UX.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetPicker_UI_UX.py @@ -215,8 +215,7 @@ def AssetPicker_UI_UX(): QtTest.QTest.keyClick(tree, Qt.Key_Enter, Qt.NoModifier) # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # 2) Create entity and add Mesh component entity_position = math.Vector3(125.0, 136.0, 32.0) diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD.py index 39cacf9af5..48b7d2b176 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD.py @@ -56,19 +56,17 @@ def BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD(): 06. delete parent entity """ + import editor_python_test_tools.hydra_editor_utils as hydra from editor_python_test_tools.utils import Report from editor_python_test_tools.editor_entity_utils import EditorEntity import azlmbr.bus as bus import azlmbr.editor as editor import azlmbr.entity as entity - import azlmbr.legacy.general as general import azlmbr.object # 01. load an existing level - test_level = 'Simple' - general.open_level_no_prompt(test_level) - Report.result(Tests.load_level, general.get_current_level_name() == test_level) + hydra.open_base_level() # 02. create parent entity and set name # Delete any exiting entity and Create a new Entity at the root level diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/BasicEditorWorkflows_LevelEntityComponentCRUD.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/BasicEditorWorkflows_LevelEntityComponentCRUD.py index 9c5880ab1e..f13b924e30 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/BasicEditorWorkflows_LevelEntityComponentCRUD.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/BasicEditorWorkflows_LevelEntityComponentCRUD.py @@ -31,7 +31,7 @@ class Tests: "Component removed from entity successfully", "Failed to remove component from entity" ) - level_saved_and_exported = ( + saved_and_exported = ( "Level saved and exported successfully", "Failed to save/export level" ) @@ -52,8 +52,7 @@ def BasicEditorWorkflows_LevelEntityComponentCRUD(): - A new entity can be created - Entity hierarchy can be adjusted - Components can be added/removed/updated - - Level can be saved - - Level can be exported + - Level can be saved/exported Note: - This test file must be called from the O3DE Editor command terminal @@ -70,7 +69,7 @@ def BasicEditorWorkflows_LevelEntityComponentCRUD(): import azlmbr.editor as editor import azlmbr.entity as entity import azlmbr.math as math - import azlmbr.paths + import azlmbr.paths as paths import editor_python_test_tools.hydra_editor_utils as hydra from editor_python_test_tools.utils import Report @@ -84,7 +83,7 @@ def BasicEditorWorkflows_LevelEntityComponentCRUD(): return None # 1) Create a new level - level = "tmp_level" + lvl_name = "tmp_level" editor_window = pyside_utils.get_editor_main_window() new_level_action = pyside_utils.get_action_for_menu_path(editor_window, "File", "New Level") pyside_utils.trigger_action_async(new_level_action) @@ -95,23 +94,24 @@ def BasicEditorWorkflows_LevelEntityComponentCRUD(): Report.info("New Level dialog opened") grp_box = new_level_dlg.findChild(QtWidgets.QGroupBox, "STATIC_GROUP1") level_name = grp_box.findChild(QtWidgets.QLineEdit, "LEVEL") - level_name.setText(level) + level_name.setText(lvl_name) button_box = new_level_dlg.findChild(QtWidgets.QDialogButtonBox, "buttonBox") button_box.button(QtWidgets.QDialogButtonBox.Ok).click() # Verify new level was created successfully level_create_success = await pyside_utils.wait_for_condition(lambda: editor.EditorToolsApplicationRequestBus( - bus.Broadcast, "GetCurrentLevelName") == level, 5.0) + bus.Broadcast, "GetCurrentLevelName") == lvl_name, 5.0) Report.critical_result(Tests.level_created, level_create_success) # 2) Delete existing entities, and create and manipulate new entities via Entity Inspector search_filter = azlmbr.entity.SearchFilter() all_entities = entity.SearchBus(azlmbr.bus.Broadcast, "SearchEntities", search_filter) editor.ToolsApplicationRequestBus(bus.Broadcast, "DeleteEntities", all_entities) - entity_outliner_widget = editor_window.findChild(QtWidgets.QWidget, "OutlinerWidgetUI") + entity_outliner_widget = editor_window.findChild(QtWidgets.QWidget, "EntityOutlinerWidgetUI") outliner_object_list = entity_outliner_widget.findChild(QtWidgets.QWidget, "m_objectList_Contents") outliner_tree = outliner_object_list.findChild(QtWidgets.QWidget, "m_objectTree") - await pyside_utils.trigger_context_menu_entry(outliner_tree, "Create entity") + outliner_viewport = outliner_tree.findChild(QtWidgets.QWidget, "qt_scrollarea_viewport") + await pyside_utils.trigger_context_menu_entry(outliner_viewport, "Create entity") # Find the new entity parent_entity_id = find_entity_by_name("Entity1") @@ -153,14 +153,10 @@ def BasicEditorWorkflows_LevelEntityComponentCRUD(): save_level_action = pyside_utils.get_action_for_menu_path(editor_window, "File", "Save") pyside_utils.trigger_action_async(save_level_action) - # 5) Export the level - export_action = pyside_utils.get_action_for_menu_path(editor_window, "Game", "Export to Engine") - pyside_utils.trigger_action_async(export_action) - level_pak_file = os.path.join( - "AutomatedTesting", "Levels", level, "level.pak" - ) - export_success = await pyside_utils.wait_for_condition(lambda: os.path.exists(level_pak_file), 5.0) - Report.result(Tests.level_saved_and_exported, export_success) + # 5) Verify the save/export of the level + level_prefab_path = os.path.join(paths.products, "levels", lvl_name, f"{lvl_name}.spawnable") + success = await pyside_utils.wait_for_condition(lambda: os.path.exists(level_prefab_path), 5.0) + Report.result(Tests.saved_and_exported, success) run_test() diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/ComponentCRUD_Add_Delete_Components.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/ComponentCRUD_Add_Delete_Components.py index 779f1ef953..6772450405 100755 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/ComponentCRUD_Add_Delete_Components.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/ComponentCRUD_Add_Delete_Components.py @@ -63,7 +63,7 @@ def ComponentCRUD_Add_Delete_Components(): :return: None """ - from PySide2 import QtWidgets, QtTest, QtCore + from PySide2 import QtWidgets, QtTest from PySide2.QtCore import Qt import azlmbr.legacy.general as general @@ -74,7 +74,6 @@ def ComponentCRUD_Add_Delete_Components(): import editor_python_test_tools.hydra_editor_utils as hydra from editor_python_test_tools.utils import Report - from editor_python_test_tools.utils import TestHelper as helper async def add_component(component_name): pyside_utils.click_button_async(add_comp_btn) @@ -88,8 +87,7 @@ def ComponentCRUD_Add_Delete_Components(): QtTest.QTest.keyClick(tree, Qt.Key_Enter, Qt.NoModifier) # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # 2) Create entity entity_position = math.Vector3(125.0, 136.0, 32.0) diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Docking_BasicDockedTools.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Docking_BasicDockedTools.py index 6683fc952a..d83db7d90c 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Docking_BasicDockedTools.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Docking_BasicDockedTools.py @@ -62,12 +62,11 @@ def Docking_BasicDockedTools(): import azlmbr.editor as editor import azlmbr.entity as entity + import editor_python_test_tools.hydra_editor_utils as hydra from editor_python_test_tools.utils import Report - from editor_python_test_tools.utils import TestHelper as helper # Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # Make sure the Entity Outliner, Entity Inspector and Console tools are open general.open_pane("Entity Outliner (PREVIEW)") @@ -80,7 +79,7 @@ def Docking_BasicDockedTools(): editor.EditorEntityAPIBus(bus.Event, 'SetName', entity_id, entity_original_name) editor_window = pyside_utils.get_editor_main_window() - entity_outliner = editor_window.findChild(QtWidgets.QDockWidget, "Entity Outliner (PREVIEW)") + entity_outliner = editor_window.findChild(QtWidgets.QDockWidget, "Entity Outliner") # 1) Open the tools and dock them together in a floating tabbed widget. # We drag/drop it over the viewport since it doesn't allow docking, so this will undock it @@ -89,7 +88,7 @@ def Docking_BasicDockedTools(): # We need to grab a new reference to the Entity Outliner QDockWidget because when it gets moved # to the floating window, its parent changes so the wrapped intance we had becomes invalid - entity_outliner = editor_window.findChild(QtWidgets.QDockWidget, "Entity Outliner (PREVIEW)") + entity_outliner = editor_window.findChild(QtWidgets.QDockWidget, "Entity Outliner") # Dock the Entity Inspector tabbed with the floating Entity Outliner entity_inspector = editor_window.findChild(QtWidgets.QDockWidget, "Entity Inspector") @@ -106,7 +105,7 @@ def Docking_BasicDockedTools(): # Check to ensure all the tools are parented to the same QStackedWidget def check_all_panes_tabbed(): entity_inspector = editor_window.findChild(QtWidgets.QDockWidget, "Entity Inspector") - entity_outliner = editor_window.findChild(QtWidgets.QDockWidget, "Entity Outliner (PREVIEW)") + entity_outliner = editor_window.findChild(QtWidgets.QDockWidget, "Entity Outliner") console = editor_window.findChild(QtWidgets.QDockWidget, "Console") entity_inspector_parent = entity_inspector.parentWidget() entity_outliner_parent = entity_outliner.parentWidget() @@ -122,7 +121,7 @@ def Docking_BasicDockedTools(): # 2.1,2) Select an Entity in the Entity Outliner. entity_inspector = editor_window.findChild(QtWidgets.QDockWidget, "Entity Inspector") - entity_outliner = editor_window.findChild(QtWidgets.QDockWidget, "Entity Outliner (PREVIEW)") + entity_outliner = editor_window.findChild(QtWidgets.QDockWidget, "Entity Outliner") console = editor_window.findChild(QtWidgets.QDockWidget, "Console") object_tree = entity_outliner.findChild(QtWidgets.QTreeView, "m_objectTree") test_entity_index = pyside_utils.find_child_by_pattern(object_tree, entity_original_name) diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/EntityOutliner_EntityOrdering.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/EntityOutliner_EntityOrdering.py index 5fa8130302..fab7984df9 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/EntityOutliner_EntityOrdering.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/EntityOutliner_EntityOrdering.py @@ -30,11 +30,13 @@ def EntityOutliner_EntityOrdering(): 5) Add another new entity, ensure the rest of the order is unchanged """ - import editor_python_test_tools.pyside_utils as pyside_utils + from PySide2 import QtCore + import azlmbr.legacy.general as general + + import editor_python_test_tools.hydra_editor_utils as hydra + import editor_python_test_tools.pyside_utils as pyside_utils from editor_python_test_tools.utils import Report - from editor_python_test_tools.utils import TestHelper as helper - from PySide2 import QtCore, QtWidgets, QtGui, QtTest # Grab the Editor, Entity Outliner, and Outliner Model editor_window = pyside_utils.get_editor_main_window() @@ -110,8 +112,7 @@ def EntityOutliner_EntityOrdering(): expected_order = [] # 1) Open the empty Prefab Base level - helper.init_idle() - helper.open_level("Prefab", "Base") + hydra.open_base_level() # 2) Add 5 entities to the outliner ENTITIES_TO_ADD = 5 diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/InputBindings_Add_Remove_Input_Events.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/InputBindings_Add_Remove_Input_Events.py index f4769dab4d..07c89ff110 100755 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/InputBindings_Add_Remove_Input_Events.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/InputBindings_Add_Remove_Input_Events.py @@ -69,8 +69,8 @@ def InputBindings_Add_Remove_Input_Events(): import azlmbr.legacy.general as general + import editor_python_test_tools.hydra_editor_utils as hydra from editor_python_test_tools.utils import Report - from editor_python_test_tools.utils import TestHelper as helper def open_asset_editor(): general.open_pane("Asset Editor") @@ -81,8 +81,7 @@ def InputBindings_Add_Remove_Input_Events(): return not general.is_pane_visible("Asset Editor") # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # 2) Open Asset Editor Report.result(Tests.asset_editor_opened, open_asset_editor()) diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_EditMenuOptions.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_EditMenuOptions.py index bd213be293..7d72d76776 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_EditMenuOptions.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_EditMenuOptions.py @@ -26,9 +26,9 @@ def Menus_EditMenuOptions_Work(): :return: None """ + import editor_python_test_tools.hydra_editor_utils as hydra import editor_python_test_tools.pyside_utils as pyside_utils from editor_python_test_tools.utils import Report - from editor_python_test_tools.utils import TestHelper as helper edit_menu_options = [ ("Undo",), @@ -57,8 +57,7 @@ def Menus_EditMenuOptions_Work(): ] # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # 2) Interact with Edit Menu options editor_window = pyside_utils.get_editor_main_window() diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py index a3e7611b5e..cade2125e2 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py @@ -26,29 +26,27 @@ def Menus_FileMenuOptions_Work(): :return: None """ + import editor_python_test_tools.hydra_editor_utils as hydra import editor_python_test_tools.pyside_utils as pyside_utils from editor_python_test_tools.utils import Report - from editor_python_test_tools.utils import TestHelper as helper file_menu_options = [ ("New Level",), - ("Open Level",), + #("Open Level",), Temporarily disabled due to https://github.com/o3de/o3de/issues/6605 ("Import",), ("Save",), - ("Save As",), + #("Save As",), Temporarily disabled due to https://github.com/o3de/o3de/issues/6605 ("Save Level Statistics",), ("Edit Project Settings",), - ("Edit Platform Settings",), + #("Edit Platform Settings",), Temporarily disabled due to https://github.com/o3de/o3de/issues/6604 ("New Project",), ("Open Project",), ("Show Log File",), - ("Resave All Slices",), ("Exit",), ] # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # 2) Interact with File Menu options editor_window = pyside_utils.get_editor_main_window() diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_ViewMenuOptions.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_ViewMenuOptions.py index deff2855a0..2d92fdb97c 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_ViewMenuOptions.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_ViewMenuOptions.py @@ -26,9 +26,9 @@ def Menus_ViewMenuOptions_Work(): :return: None """ + import editor_python_test_tools.hydra_editor_utils as hydra import editor_python_test_tools.pyside_utils as pyside_utils from editor_python_test_tools.utils import Report - from editor_python_test_tools.utils import TestHelper as helper view_menu_options = [ ("Center on Selection",), @@ -45,8 +45,7 @@ def Menus_ViewMenuOptions_Work(): ] # 1) Open an existing simple level - helper.init_idle() - helper.open_level("Physics", "Base") + hydra.open_base_level() # 2) Interact with View Menu options editor_window = pyside_utils.get_editor_main_window() diff --git a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main.py b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main.py index c9e91687e0..949aab140d 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main.py +++ b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main.py @@ -33,22 +33,20 @@ class TestAutomation(TestAutomationBase): def test_BasicEditorWorkflows_LevelEntityComponentCRUD(self, request, workspace, editor, launcher_platform, remove_test_level): from .EditorScripts import BasicEditorWorkflows_LevelEntityComponentCRUD as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False, enable_prefab_system=False) + self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False) @pytest.mark.REQUIRES_gpu def test_BasicEditorWorkflows_GPU_LevelEntityComponentCRUD(self, request, workspace, editor, launcher_platform, remove_test_level): from .EditorScripts import BasicEditorWorkflows_LevelEntityComponentCRUD as test_module self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False, - use_null_renderer=False, enable_prefab_system=False) + use_null_renderer=False) - def test_EntityOutlienr_EntityOrdering(self, request, workspace, editor, launcher_platform): + def test_BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD(self, request, workspace, editor, + launcher_platform): + from .EditorScripts import BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD as test_module + self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False) + + def test_EntityOutliner_EntityOrdering(self, request, workspace, editor, launcher_platform): from .EditorScripts import EntityOutliner_EntityOrdering as test_module - self._run_test( - request, - workspace, - editor, - test_module, - batch_mode=False, - autotest_mode=True, - ) + self._run_test(request, workspace, editor, test_module, batch_mode=False) diff --git a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main_Optimized.py b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main_Optimized.py index d87fd8625b..7364cd8bc9 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main_Optimized.py +++ b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main_Optimized.py @@ -12,7 +12,6 @@ import ly_test_tools.environment.file_system as file_system from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, EditorParallelTest, EditorTestSuite -@pytest.mark.xfail(reason="Optimized tests are experimental, we will enable xfail and monitor them temporarily.") @pytest.mark.SUITE_main @pytest.mark.parametrize("launcher_platform", ['windows_editor']) @pytest.mark.parametrize("project", ["AutomatedTesting"]) @@ -21,8 +20,12 @@ class TestAutomationNoAutoTestMode(EditorTestSuite): # Disable -autotest_mode and -BatchMode. Tests cannot run in -BatchMode due to UI interactions, and these tests # interact with modal dialogs global_extra_cmdline_args = [] - - enable_prefab_system = False + + class test_AssetPicker_UI_UX(EditorSharedTest): + from .EditorScripts import AssetPicker_UI_UX as test_module + + class test_BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD(EditorSingleTest): + from .EditorScripts import BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD as test_module class test_BasicEditorWorkflows_LevelEntityComponentCRUD(EditorSingleTest): # Custom teardown to remove slice asset created during test @@ -45,9 +48,6 @@ class TestAutomationNoAutoTestMode(EditorTestSuite): class test_InputBindings_Add_Remove_Input_Events(EditorSharedTest): from .EditorScripts import InputBindings_Add_Remove_Input_Events as test_module - class test_AssetPicker_UI_UX(EditorSharedTest): - from .EditorScripts import AssetPicker_UI_UX as test_module - @pytest.mark.SUITE_main @pytest.mark.parametrize("launcher_platform", ['windows_editor']) @@ -57,23 +57,26 @@ class TestAutomationAutoTestMode(EditorTestSuite): # Enable only -autotest_mode for these tests. Tests cannot run in -BatchMode due to UI interactions global_extra_cmdline_args = ["-autotest_mode"] - enable_prefab_system = False + class test_AssetBrowser_SearchFiltering(EditorSharedTest): + from .EditorScripts import AssetBrowser_SearchFiltering as test_module class test_AssetBrowser_TreeNavigation(EditorSharedTest): from .EditorScripts import AssetBrowser_TreeNavigation as test_module - class test_AssetBrowser_SearchFiltering(EditorSharedTest): - from .EditorScripts import AssetBrowser_SearchFiltering as test_module - class test_ComponentCRUD_Add_Delete_Components(EditorSharedTest): from .EditorScripts import ComponentCRUD_Add_Delete_Components as test_module - class test_Menus_ViewMenuOptions_Work(EditorSharedTest): - from .EditorScripts import Menus_ViewMenuOptions as test_module + class test_Docking_BasicDockedTools(EditorSharedTest): + from .EditorScripts import Docking_BasicDockedTools as test_module + + class test_EntityOutliner_EntityOrdering(EditorSharedTest): + from .EditorScripts import EntityOutliner_EntityOrdering as test_module + + class test_Menus_EditMenuOptions_Work(EditorSharedTest): + from .EditorScripts import Menus_EditMenuOptions as test_module - @pytest.mark.skip(reason="Times out due to dialogs failing to dismiss: LYN-4208") class test_Menus_FileMenuOptions_Work(EditorSharedTest): from .EditorScripts import Menus_FileMenuOptions as test_module - class test_BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD(EditorSharedTest): - from .EditorScripts import BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD as test_module + class test_Menus_ViewMenuOptions_Work(EditorSharedTest): + from .EditorScripts import Menus_ViewMenuOptions as test_module \ No newline at end of file diff --git a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Periodic.py b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Periodic.py index 1bd1d7f987..f8a054d517 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Periodic.py +++ b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Periodic.py @@ -10,6 +10,7 @@ import pytest import sys import ly_test_tools.environment.file_system as file_system +import ly_test_tools.environment.process_utils as process_utils sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared') from base import TestAutomationBase @@ -25,36 +26,42 @@ def remove_test_level(request, workspace, project): request.addfinalizer(teardown) +@pytest.fixture +def kill_external_tools(request): + def teardown(): + process_utils.kill_processes_named("o3de.exe") + request.addfinalizer(teardown) + + @pytest.mark.SUITE_periodic @pytest.mark.parametrize("launcher_platform", ['windows_editor']) @pytest.mark.parametrize("project", ["AutomatedTesting"]) class TestAutomation(TestAutomationBase): - def test_AssetBrowser_TreeNavigation(self, request, workspace, editor, launcher_platform): - from .EditorScripts import AssetBrowser_TreeNavigation as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False, enable_prefab_system=False) - def test_AssetBrowser_SearchFiltering(self, request, workspace, editor, launcher_platform): from .EditorScripts import AssetBrowser_SearchFiltering as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False, enable_prefab_system=False) + self._run_test(request, workspace, editor, test_module, batch_mode=False) + + def test_AssetBrowser_TreeNavigation(self, request, workspace, editor, launcher_platform): + from .EditorScripts import AssetBrowser_TreeNavigation as test_module + self._run_test(request, workspace, editor, test_module, batch_mode=False) def test_AssetPicker_UI_UX(self, request, workspace, editor, launcher_platform): from .EditorScripts import AssetPicker_UI_UX as test_module - self._run_test(request, workspace, editor, test_module, autotest_mode=False, batch_mode=False, enable_prefab_system=False) + self._run_test(request, workspace, editor, test_module, autotest_mode=False, batch_mode=False) def test_ComponentCRUD_Add_Delete_Components(self, request, workspace, editor, launcher_platform): from .EditorScripts import ComponentCRUD_Add_Delete_Components as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False, enable_prefab_system=False) + self._run_test(request, workspace, editor, test_module, batch_mode=False) def test_InputBindings_Add_Remove_Input_Events(self, request, workspace, editor, launcher_platform): from .EditorScripts import InputBindings_Add_Remove_Input_Events as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False, enable_prefab_system=False) + self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False) + + def test_Menus_FileMenuOptions_Work(self, request, workspace, editor, launcher_platform, kill_external_tools): + from .EditorScripts import Menus_FileMenuOptions as test_module + self._run_test(request, workspace, editor, test_module, batch_mode=False) def test_Menus_ViewMenuOptions_Work(self, request, workspace, editor, launcher_platform): from .EditorScripts import Menus_ViewMenuOptions as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False, enable_prefab_system=False) - - @pytest.mark.skip(reason="Times out due to dialogs failing to dismiss: LYN-4208") - def test_Menus_FileMenuOptions_Work(self, request, workspace, editor, launcher_platform): - from .EditorScripts import Menus_FileMenuOptions as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False, enable_prefab_system=False) + self._run_test(request, workspace, editor, test_module, batch_mode=False) diff --git a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox.py b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox.py index 8a56a2dbfd..98a6620d9c 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox.py +++ b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox.py @@ -20,8 +20,8 @@ class TestAutomation(TestAutomationBase): def test_Menus_EditMenuOptions_Work(self, request, workspace, editor, launcher_platform): from .EditorScripts import Menus_EditMenuOptions as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False, enable_prefab_system=False) + self._run_test(request, workspace, editor, test_module, batch_mode=False) def test_Docking_BasicDockedTools(self, request, workspace, editor, launcher_platform): from .EditorScripts import Docking_BasicDockedTools as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False, enable_prefab_system=False) + self._run_test(request, workspace, editor, test_module, batch_mode=False) diff --git a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox_Optimized.py b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox_Optimized.py index ce0d5e43e9..4a472095ae 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox_Optimized.py +++ b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox_Optimized.py @@ -19,8 +19,6 @@ class TestAutomationAutoTestMode(EditorTestSuite): # Enable only -autotest_mode for these tests. Tests cannot run in -BatchMode due to UI interactions global_extra_cmdline_args = ["-autotest_mode"] - enable_prefab_system = False - class test_Docking_BasicDockedTools(EditorSharedTest): from .EditorScripts import Docking_BasicDockedTools as test_module From 79dd65e1ccfdef85747cbc26c8f868b42df060d6 Mon Sep 17 00:00:00 2001 From: Benjamin Jillich <43751992+amzn-jillich@users.noreply.github.com> Date: Mon, 3 Jan 2022 10:20:27 +0100 Subject: [PATCH 265/948] Quaternion shortest equivalent (#6472) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Added new helper functions to get the shortest equivalent of the rotation. In case the w component of the quaternion is negative the rotation is > 180° and taking the longer path. The quaternion will be inverted in that case to take the shortest path of rotation. * Added unit test. * Renamed the angle parameter of the CreateRotationX/Y/Z() functions into angleInRadians. Signed-off-by: Benjamin Jillich --- .../Framework/AzCore/AzCore/Math/Quaternion.h | 16 +++++++--- .../AzCore/AzCore/Math/Quaternion.inl | 29 +++++++++++++++---- .../AzCore/Tests/Math/QuaternionTests.cpp | 19 ++++++++++-- 3 files changed, 51 insertions(+), 13 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Math/Quaternion.h b/Code/Framework/AzCore/AzCore/Math/Quaternion.h index 83e8012a62..ad454aab4f 100644 --- a/Code/Framework/AzCore/AzCore/Math/Quaternion.h +++ b/Code/Framework/AzCore/AzCore/Math/Quaternion.h @@ -54,11 +54,11 @@ namespace AZ //! Sets components using a Vector3 for the imaginary part and a float for the real part. static Quaternion CreateFromVector3AndValue(const Vector3& v, float w); - //! Sets the quaternion to be a rotation around a specified axis. + //! Sets the quaternion to be a rotation around a specified axis in radians. //! @{ - static Quaternion CreateRotationX(float angle); - static Quaternion CreateRotationY(float angle); - static Quaternion CreateRotationZ(float angle); + static Quaternion CreateRotationX(float angleInRadians); + static Quaternion CreateRotationY(float angleInRadians); + static Quaternion CreateRotationZ(float angleInRadians); //! @} //! Creates a quaternion from a Matrix3x3 @@ -168,6 +168,14 @@ namespace AZ float NormalizeWithLengthEstimate(); //! @} + //! Get the shortest equivalent of the rotation. + //! In case the w component of the quaternion is negative the rotation is > 180° and taking the longer path. + //! The quaternion will be inverted in that case to take the shortest path of rotation. + //! @{ + Quaternion GetShortestEquivalent() const; + void ShortestEquivalent(); + //! @} + //! Linearly interpolate towards a destination quaternion. //! @param[in] dest The quaternion to interpolate towards. //! @param[in] t Normalized interpolation value where 0.0 represents the current and 1.0 the destination value. diff --git a/Code/Framework/AzCore/AzCore/Math/Quaternion.inl b/Code/Framework/AzCore/AzCore/Math/Quaternion.inl index 37319ae146..bd51a90fca 100644 --- a/Code/Framework/AzCore/AzCore/Math/Quaternion.inl +++ b/Code/Framework/AzCore/AzCore/Math/Quaternion.inl @@ -73,27 +73,27 @@ namespace AZ } - AZ_MATH_INLINE Quaternion Quaternion::CreateRotationX(float angle) + AZ_MATH_INLINE Quaternion Quaternion::CreateRotationX(float angleInRadians) { - const float halfAngle = 0.5f * angle; + const float halfAngle = 0.5f * angleInRadians; float sin, cos; SinCos(halfAngle, sin, cos); return Quaternion(sin, 0.0f, 0.0f, cos); } - AZ_MATH_INLINE Quaternion Quaternion::CreateRotationY(float angle) + AZ_MATH_INLINE Quaternion Quaternion::CreateRotationY(float angleInRadians) { - const float halfAngle = 0.5f * angle; + const float halfAngle = 0.5f * angleInRadians; float sin, cos; SinCos(halfAngle, sin, cos); return Quaternion(0.0f, sin, 0.0f, cos); } - AZ_MATH_INLINE Quaternion Quaternion::CreateRotationZ(float angle) + AZ_MATH_INLINE Quaternion Quaternion::CreateRotationZ(float angleInRadians) { - const float halfAngle = 0.5f * angle; + const float halfAngle = 0.5f * angleInRadians; float sin, cos; SinCos(halfAngle, sin, cos); return Quaternion(0.0f, 0.0f, sin, cos); @@ -345,6 +345,23 @@ namespace AZ } + AZ_MATH_INLINE Quaternion Quaternion::GetShortestEquivalent() const + { + if (GetW() < 0.0f) + { + return -(*this); + } + + return *this; + } + + + AZ_MATH_INLINE void Quaternion::ShortestEquivalent() + { + *this = GetShortestEquivalent(); + } + + AZ_MATH_INLINE Quaternion Quaternion::Lerp(const Quaternion& dest, float t) const { if (Dot(dest) >= 0.0f) diff --git a/Code/Framework/AzCore/Tests/Math/QuaternionTests.cpp b/Code/Framework/AzCore/Tests/Math/QuaternionTests.cpp index 9ef38d7115..3de60a1fd4 100644 --- a/Code/Framework/AzCore/Tests/Math/QuaternionTests.cpp +++ b/Code/Framework/AzCore/Tests/Math/QuaternionTests.cpp @@ -11,6 +11,7 @@ #include #include #include +#include using namespace AZ; @@ -453,7 +454,7 @@ namespace UnitTest AZ::Quaternion backFromScaledAxisAngle = AZ::Quaternion::CreateFromScaledAxisAngle(scaledAxisAngle); // Compare the original quaternion with the one after the conversion. - EXPECT_TRUE(testQuat.IsClose(backFromScaledAxisAngle, 1e-6f)); + EXPECT_THAT(testQuat, IsCloseTolerance(backFromScaledAxisAngle, 1e-6f)); } TEST_P(QuaternionScaledAxisAngleConversionFixture, AxisAngleQuatRoundtripTests) @@ -467,7 +468,7 @@ namespace UnitTest // Convert the axis-angle back into a quaternion and compare the original quaternion with the one after the conversion. const AZ::Quaternion backFromAxisAngle = AZ::Quaternion::CreateFromAxisAngle(axis, angle); - EXPECT_TRUE(testQuat.IsClose(backFromAxisAngle, 1e-6f)); + EXPECT_THAT(testQuat, IsCloseTolerance(backFromAxisAngle, 1e-6f)); } TEST_P(QuaternionScaledAxisAngleConversionFixture, CompareAxisAngleConversionTests) @@ -506,8 +507,20 @@ namespace UnitTest } const AZ::Quaternion backFromAxisAngle = AZ::Quaternion::CreateFromAxisAngle(axisFromScaledResult, angleFromScaledResult); - EXPECT_TRUE(testQuat.IsClose(backFromAxisAngle, 1e-6f)); + EXPECT_THAT(testQuat, IsCloseTolerance(backFromAxisAngle, 1e-6f)); } INSTANTIATE_TEST_CASE_P(MATH_Quaternion, QuaternionScaledAxisAngleConversionFixture, ::testing::ValuesIn(RotationRepresentationConversionTestQuats)); + + TEST(MATH_Quaternion, ShortestEquivalent) + { + const AZ::Quaternion testQuat = AZ::Quaternion::CreateRotationX(AZ::Constants::HalfPi * 3.0f); + + AZ::Quaternion absQuat = testQuat; + absQuat.ShortestEquivalent(); + EXPECT_THAT(testQuat.GetShortestEquivalent(), IsCloseTolerance(absQuat, 1e-6f)); + + const float angle = absQuat.GetEulerRadians().GetX(); + EXPECT_THAT(angle, testing::FloatEq(-AZ::Constants::HalfPi)); + } } From 346a414aff6a79b4651337b473c82f8c924aa749 Mon Sep 17 00:00:00 2001 From: amzn-mike <80125227+amzn-mike@users.noreply.github.com> Date: Mon, 3 Jan 2022 09:44:34 -0600 Subject: [PATCH 266/948] Change AP unit test project to a DLL like all others, add benchmarks project (#6588) Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> --- Code/Tools/AssetProcessor/CMakeLists.txt | 15 ++-- .../native/tests/AssetProcessorTest.cpp | 8 +-- .../AssetProcessor/native/tests/test_main.cpp | 70 +------------------ 3 files changed, 13 insertions(+), 80 deletions(-) diff --git a/Code/Tools/AssetProcessor/CMakeLists.txt b/Code/Tools/AssetProcessor/CMakeLists.txt index 431a167163..98c5f8e5e8 100644 --- a/Code/Tools/AssetProcessor/CMakeLists.txt +++ b/Code/Tools/AssetProcessor/CMakeLists.txt @@ -52,7 +52,7 @@ get_property(asset_builders GLOBAL PROPERTY LY_ASSET_BUILDERS) string (REPLACE ";" "," asset_builders "${asset_builders}") ly_add_source_properties( SOURCES native/utilities/ApplicationManager.cpp - PROPERTY COMPILE_DEFINITIONS + PROPERTY COMPILE_DEFINITIONS VALUES LY_ASSET_BUILDERS="${asset_builders}" ) @@ -147,9 +147,9 @@ endif() # Tests ################################################################################ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) - + ly_add_target( - NAME AssetProcessor.Tests EXECUTABLE + NAME AssetProcessor.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} NAMESPACE AZ AUTOMOC AUTORCC @@ -167,12 +167,12 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) ) ly_add_source_properties( SOURCES native/tests/assetBuilderSDK/assetBuilderSDKTest.cpp - PROPERTY COMPILE_DEFINITIONS + PROPERTY COMPILE_DEFINITIONS VALUES ${LY_PAL_TOOLS_DEFINES} ) ly_add_source_properties( SOURCES native/unittests/AssetProcessorManagerUnitTests.cpp - PROPERTY COMPILE_DEFINITIONS + PROPERTY COMPILE_DEFINITIONS VALUES LY_CMAKE_BINARY_DIR="${CMAKE_BINARY_DIR}" ) @@ -266,7 +266,10 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) ly_add_googletest( NAME AZ::AssetProcessor.Tests - TEST_COMMAND $ --unittest --gtest_filter=-*.SUITE_sandbox* + ) + ly_add_googlebenchmark( + NAME AZ::AssetProcessor.Benchmarks + TARGET AZ::AssetProcessor.Tests ) endif() diff --git a/Code/Tools/AssetProcessor/native/tests/AssetProcessorTest.cpp b/Code/Tools/AssetProcessor/native/tests/AssetProcessorTest.cpp index 5be9436145..e2b28c1260 100644 --- a/Code/Tools/AssetProcessor/native/tests/AssetProcessorTest.cpp +++ b/Code/Tools/AssetProcessor/native/tests/AssetProcessorTest.cpp @@ -18,8 +18,6 @@ #include -AZ_UNIT_TEST_HOOK(new BaseAssetProcessorTestEnvironment) - namespace AssetProcessor { class UnitTestAppManager : public BatchApplicationManager @@ -35,7 +33,7 @@ namespace AssetProcessor { return false; } - + // tests which use the builder bus plug in their own mock version, so disconnect ours. AssetProcessor::AssetBuilderInfoBus::Handler::BusDisconnect(); @@ -59,7 +57,7 @@ namespace AssetProcessor void SetUp() override { AssetProcessorTest::SetUp(); - + static int numParams = 1; static char processName[] = {"AssetProcessorBatch"}; static char* namePtr = &processName[0]; @@ -147,7 +145,7 @@ namespace AssetProcessor time.start(); actualTest->StartTest(); - + while (!testIsComplete) { QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete); diff --git a/Code/Tools/AssetProcessor/native/tests/test_main.cpp b/Code/Tools/AssetProcessor/native/tests/test_main.cpp index e0cdc8cb3c..69f6e9a6c8 100644 --- a/Code/Tools/AssetProcessor/native/tests/test_main.cpp +++ b/Code/Tools/AssetProcessor/native/tests/test_main.cpp @@ -5,76 +5,8 @@ * SPDX-License-Identifier: Apache-2.0 OR MIT * */ -#include "utilities/BatchApplicationManager.h" - #include -#include #include -DECLARE_AZ_UNIT_TEST_MAIN() - -int RunUnitTests(int argc, char* argv[], bool& ranUnitTests) -{ - ranUnitTests = true; - - INVOKE_AZ_UNIT_TEST_MAIN(nullptr); // nullptr turns off default test environment used to catch stray asserts - - // This looks a bit weird, but the macro returns conditionally, so *if* we get here, it means the unit tests didn't run - ranUnitTests = false; - return 0; -} - -int main(int argc, char* argv[]) -{ - qputenv("QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM", "1"); - - AZ::Debug::Trace::HandleExceptions(true); - AZ::Test::ApplyGlobalParameters(&argc, argv); - - // If "--unittest" is present on the command line, run unit testing - // and return immediately. Otherwise, continue as normal. - AZ::Test::addTestEnvironment(new BaseAssetProcessorTestEnvironment()); - - bool pauseOnComplete = false; - - if (AZ::Test::ContainsParameter(argc, argv, "--pause-on-completion")) - { - pauseOnComplete = true; - } - - bool ranUnitTests; - int result = RunUnitTests(argc, argv, ranUnitTests); - - if (ranUnitTests) - { - if (pauseOnComplete) - { - system("pause"); - } - - return result; - } - - BatchApplicationManager applicationManager(&argc, &argv); - setvbuf(stdout, NULL, _IONBF, 0); // Disabling output buffering to fix test failures due to incomplete logs - - ApplicationManager::BeforeRunStatus status = applicationManager.BeforeRun(); - - if (status != ApplicationManager::BeforeRunStatus::Status_Success) - { - if (status == ApplicationManager::BeforeRunStatus::Status_Restarting) - { - //AssetProcessor will restart - return 0; - } - else - { - //Initialization failed - return 1; - } - } - - return applicationManager.Run() ? 0 : 1; -} - +AZ_UNIT_TEST_HOOK(new BaseAssetProcessorTestEnvironment) From a95b303f197d242c01db1100e235870047ae0c4d Mon Sep 17 00:00:00 2001 From: amzn-mike <80125227+amzn-mike@users.noreply.github.com> Date: Mon, 3 Jan 2022 09:44:51 -0600 Subject: [PATCH 267/948] Remove Shader compiler tab from Asset Processor (#6486) * Remove Shader compiler tab from Asset Processor Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Remove more references to shader compiler Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> --- .../assetprocessor_static_files.cmake | 7 - .../assetprocessor_test_files.cmake | 2 - .../shadercompiler/shadercompilerManager.cpp | 162 --------------- .../shadercompiler/shadercompilerManager.h | 67 ------ .../shadercompiler/shadercompilerMessages.h | 24 --- .../shadercompiler/shadercompilerModel.cpp | 150 -------------- .../shadercompiler/shadercompilerModel.h | 93 --------- .../shadercompiler/shadercompilerjob.cpp | 194 ------------------ .../native/shadercompiler/shadercompilerjob.h | 44 ---- .../AssetProcessor/native/ui/MainWindow.cpp | 10 - .../AssetProcessor/native/ui/MainWindow.h | 1 - .../AssetProcessor/native/ui/MainWindow.ui | 53 ----- .../unittests/ShaderCompilerUnitTests.cpp | 188 ----------------- .../unittests/ShaderCompilerUnitTests.h | 81 -------- .../utilities/GUIApplicationManager.cpp | 63 +----- .../native/utilities/GUIApplicationManager.h | 11 +- 16 files changed, 8 insertions(+), 1142 deletions(-) delete mode 100644 Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerManager.cpp delete mode 100644 Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerManager.h delete mode 100644 Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerMessages.h delete mode 100644 Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerModel.cpp delete mode 100644 Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerModel.h delete mode 100644 Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerjob.cpp delete mode 100644 Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerjob.h delete mode 100644 Code/Tools/AssetProcessor/native/unittests/ShaderCompilerUnitTests.cpp delete mode 100644 Code/Tools/AssetProcessor/native/unittests/ShaderCompilerUnitTests.h diff --git a/Code/Tools/AssetProcessor/assetprocessor_static_files.cmake b/Code/Tools/AssetProcessor/assetprocessor_static_files.cmake index 400a3f7ba5..7daca9bbc1 100644 --- a/Code/Tools/AssetProcessor/assetprocessor_static_files.cmake +++ b/Code/Tools/AssetProcessor/assetprocessor_static_files.cmake @@ -63,13 +63,6 @@ set(FILES native/resourcecompiler/RCJobSortFilterProxyModel.h native/resourcecompiler/RCQueueSortModel.cpp native/resourcecompiler/RCQueueSortModel.h - native/shadercompiler/shadercompilerjob.cpp - native/shadercompiler/shadercompilerjob.h - native/shadercompiler/shadercompilerManager.cpp - native/shadercompiler/shadercompilerManager.h - native/shadercompiler/shadercompilerMessages.h - native/shadercompiler/shadercompilerModel.cpp - native/shadercompiler/shadercompilerModel.h native/utilities/ApplicationManagerAPI.h native/utilities/ApplicationManager.cpp native/utilities/ApplicationManager.h diff --git a/Code/Tools/AssetProcessor/assetprocessor_test_files.cmake b/Code/Tools/AssetProcessor/assetprocessor_test_files.cmake index 3a336ce97b..2c4c53642c 100644 --- a/Code/Tools/AssetProcessor/assetprocessor_test_files.cmake +++ b/Code/Tools/AssetProcessor/assetprocessor_test_files.cmake @@ -67,8 +67,6 @@ set(FILES native/unittests/PlatformConfigurationUnitTests.h native/unittests/RCcontrollerUnitTests.cpp native/unittests/RCcontrollerUnitTests.h - native/unittests/ShaderCompilerUnitTests.cpp - native/unittests/ShaderCompilerUnitTests.h native/unittests/UnitTestRunner.cpp native/unittests/UnitTestRunner.h native/unittests/UtilitiesUnitTests.cpp diff --git a/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerManager.cpp b/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerManager.cpp deleted file mode 100644 index 47b2ca9047..0000000000 --- a/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerManager.cpp +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * 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 "shadercompilerManager.h" -#include "shadercompilerjob.h" - -#include - -#include "native/utilities/assetUtils.h" - -ShaderCompilerManager::ShaderCompilerManager(QObject* parent) - : QObject(parent) - , m_isUnitTesting(false) - , m_numberOfJobsStarted(0) - , m_numberOfJobsEnded(0) - , m_numberOfErrors(0) -{ -} - -ShaderCompilerManager::~ShaderCompilerManager() -{ -} - -void ShaderCompilerManager::process(unsigned int connID, unsigned int type, unsigned int serial, QByteArray payload) -{ - (void)type; - (void)serial; - Q_ASSERT(AssetUtilities::ComputeCRC32Lowercase("ShaderCompilerProxyRequest") == type); - decodeShaderCompilerRequest(connID, payload); -} - -void ShaderCompilerManager::decodeShaderCompilerRequest(unsigned int connID, QByteArray payload) -{ - if (payload.length() < sizeof(unsigned int) + sizeof(unsigned int) + 2 + sizeof(unsigned short)) - { - QString error = "Payload size is too small"; - AZ_Warning(AssetProcessor::ConsoleChannel, false, error.toUtf8().data()); - emit sendErrorMessage(error); - return; - } - - unsigned char* data_end = reinterpret_cast(payload.data() + payload.size()); - unsigned int* requestId = reinterpret_cast(data_end - sizeof(unsigned int)); - unsigned int* serverListSizePtr = reinterpret_cast(data_end - sizeof(unsigned int) - sizeof(unsigned int)); - unsigned short* serverPortPtr = reinterpret_cast(data_end - sizeof(unsigned int) - sizeof(unsigned int) - sizeof(unsigned short)); - - ShaderCompilerRequestMessage msg; - QString error; - - msg.requestId = *requestId; - msg.serverListSize = *serverListSizePtr; - msg.serverPort = *serverPortPtr; - if ((msg.serverListSize <= 0) || (msg.serverListSize > 100000)) - { - error = "Shader Compiler Server List is wrong"; - AZ_Warning(AssetProcessor::ConsoleChannel, false, error.toUtf8().data()); - emit sendErrorMessage(error); - return; - } - if (msg.serverPort == 0) - { - error = "Shader Compiler port is wrong"; - AZ_Warning(AssetProcessor::ConsoleChannel, false, error.toUtf8().data()); - emit sendErrorMessage(error); - return; - } - - char* position_of_first_null = reinterpret_cast(serverPortPtr) - 1;// -1 for null - if ((*position_of_first_null) != '\0') - { - error = "Shader Compiler payload is corrupt,position is not null"; - AZ_Warning(AssetProcessor::ConsoleChannel, false, error.toUtf8().data()); - emit sendErrorMessage(error); - return; - } - char* beginning_of_serverList = position_of_first_null - msg.serverListSize; - char* position_of_second_null = beginning_of_serverList - 1;//-1 for null - - if ((*position_of_second_null) != '\0') - { - error = "Shader Compiler payload is corrupt,position is not null"; - AZ_Warning(AssetProcessor::ConsoleChannel, false, error.toUtf8().data()); - emit sendErrorMessage(error); - return; - } - - unsigned int originalPayloadSize = static_cast(payload.size()) - sizeof(unsigned int) - sizeof(unsigned int) - sizeof(unsigned short) - static_cast(msg.serverListSize) - 2; - msg.serverList = beginning_of_serverList; - msg.originalPayload.insert(0, payload.data(), static_cast(originalPayloadSize)); - ShaderCompilerJob* shaderCompilerJob = new ShaderCompilerJob(); - shaderCompilerJob->initialize(this, msg); - shaderCompilerJob->setIsUnitTesting(m_isUnitTesting); - m_shaderCompilerJobMap[msg.requestId] = connID; - shaderCompilerJob->setAutoDelete(true); - QThreadPool* threadPool = QThreadPool::globalInstance(); - threadPool->start(shaderCompilerJob); -} - -void ShaderCompilerManager::OnShaderCompilerJobComplete(QByteArray payload, unsigned int requestId) -{ - auto iterator = m_shaderCompilerJobMap.find(requestId); - if (iterator != m_shaderCompilerJobMap.end()) - { - sendResponse(iterator.value(), AssetUtilities::ComputeCRC32Lowercase("ShaderCompilerProxyResponse"), 0, payload); - } - else - { - QString error = "Shader Compiler cannot find the connection id"; - AZ_Warning(AssetProcessor::ConsoleChannel, false, error.toUtf8().data()); - emit sendErrorMessage(error); - } -} - -void ShaderCompilerManager::sendResponse(unsigned int connId, unsigned int /*type*/, unsigned int /*serial*/, QByteArray payload) -{ - EBUS_EVENT_ID(connId, AssetProcessor::ConnectionBus, SendRaw, AssetUtilities::ComputeCRC32Lowercase("ShaderCompilerProxyResponse"), 0, payload); -} - -void ShaderCompilerManager::shaderCompilerError(QString errorMessage, QString server, QString timestamp, QString payload) -{ - m_numberOfErrors++; - emit numberOfErrorsChanged(); - emit sendErrorMessageFromShaderJob(errorMessage, server, timestamp, payload); -} - -void ShaderCompilerManager::jobStarted() -{ - m_numberOfJobsStarted++; - emit numberOfJobsStartedChanged(); -} - -void ShaderCompilerManager::jobEnded() -{ - m_numberOfJobsEnded++; - numberOfJobsEndedChanged(); -} - - -void ShaderCompilerManager::setIsUnitTesting(bool isUnitTesting) -{ - m_isUnitTesting = isUnitTesting; -} - -int ShaderCompilerManager::numberOfJobsStarted() -{ - return m_numberOfJobsStarted; -} - -int ShaderCompilerManager::numberOfJobsEnded() -{ - return m_numberOfJobsEnded; -} - -int ShaderCompilerManager::numberOfErrors() -{ - return m_numberOfErrors; -} - diff --git a/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerManager.h b/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerManager.h deleted file mode 100644 index cb51ee98f6..0000000000 --- a/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerManager.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#ifndef SHADERCOMPILERMANAGER_H -#define SHADERCOMPILERMANAGER_H - -#if !defined(Q_MOC_RUN) -#include -#include -#include -#include -#endif - -typedef QHash ShaderCompilerJobMap; - -/** - * The Shader Compiler Manager class receive a shader compile request - * and starts a shader compiler job for it - */ -class ShaderCompilerManager - : public QObject -{ - Q_OBJECT - Q_PROPERTY(int numberOfJobsStarted READ numberOfJobsStarted NOTIFY numberOfJobsStartedChanged) - Q_PROPERTY(int numberOfJobsEnded READ numberOfJobsEnded NOTIFY numberOfJobsEndedChanged) - Q_PROPERTY(int numberOfErrors READ numberOfErrors NOTIFY numberOfErrorsChanged) -public: - - explicit ShaderCompilerManager(QObject* parent = 0); - virtual ~ShaderCompilerManager(); - - void process(unsigned int connID, unsigned int type, unsigned int serial, QByteArray payload); - void decodeShaderCompilerRequest(unsigned int connID, QByteArray payload); - void setIsUnitTesting(bool isUnitTesting); - int numberOfJobsStarted(); - int numberOfJobsEnded(); - int numberOfErrors(); - virtual void sendResponse(unsigned int connId, unsigned int type, unsigned int serial, QByteArray payload); - -signals: - void sendErrorMessage(QString errorMessage); - void sendErrorMessageFromShaderJob(QString errorMessage, QString server, QString timestamp, QString payload); - void numberOfJobsStartedChanged(); - void numberOfJobsEndedChanged(); - void numberOfErrorsChanged(); - - -public slots: - void OnShaderCompilerJobComplete(QByteArray payload, unsigned int requestId); - void shaderCompilerError(QString errorMessage, QString server, QString timestamp, QString payload); - void jobStarted(); - void jobEnded(); - - -private: - ShaderCompilerJobMap m_shaderCompilerJobMap; - bool m_isUnitTesting; - int m_numberOfJobsStarted; - int m_numberOfJobsEnded; - int m_numberOfErrors; -}; - -#endif // SHADERCOMPILERMANAGER_H diff --git a/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerMessages.h b/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerMessages.h deleted file mode 100644 index be90a7b3e5..0000000000 --- a/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerMessages.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#ifndef SHADERCOMPILERMESSAGES_H -#define SHADERCOMPILERMESSAGES_H - -#include -#include - -struct ShaderCompilerRequestMessage -{ - QByteArray originalPayload; - QString serverList; - unsigned short serverPort; - unsigned int serverListSize; - unsigned int requestId; -}; - -#endif //SHADERCOMPILERMESSAGES_H - diff --git a/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerModel.cpp b/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerModel.cpp deleted file mode 100644 index 50b5254e79..0000000000 --- a/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerModel.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#include "shadercompilerModel.h" - -namespace -{ - ShaderCompilerModel* s_singleton = nullptr; -} - -ShaderCompilerModel::ShaderCompilerModel(QObject* parent) - : QAbstractItemModel(parent) -{ - Q_ASSERT(s_singleton == nullptr); - s_singleton = this; -} - -ShaderCompilerModel::~ShaderCompilerModel() -{ - s_singleton = nullptr; -} - -ShaderCompilerModel* ShaderCompilerModel::Get() -{ - return s_singleton; -} - -QVariant ShaderCompilerModel::data(const QModelIndex& index, int role) const -{ - if (!index.isValid()) - { - return QVariant(); - } - - int row = index.row(); - - if (row < 0) - { - return QVariant(); - } - if (row >= m_shaderErrorInfoList.count()) - { - return QVariant(); - } - - switch (role) - { - case TimeStampRole: - return m_shaderErrorInfoList[row].m_shaderTimestamp; - case ServerRole: - return m_shaderErrorInfoList[row].m_shaderServerName; - case ErrorRole: - return m_shaderErrorInfoList[row].m_shaderError; - case OriginalRequestRole: - return m_shaderErrorInfoList[row].m_shaderOriginalPayload; - - case Qt::DisplayRole: - switch (index.column()) - { - case ColumnTimeStamp: - return m_shaderErrorInfoList[row].m_shaderTimestamp; - case ColumnServer: - return m_shaderErrorInfoList[row].m_shaderServerName; - case ColumnError: - return m_shaderErrorInfoList[row].m_shaderServerName; - } - } - - return QVariant(); -} - - -Qt::ItemFlags ShaderCompilerModel::flags(const QModelIndex& index) const -{ - (void)index; - return Qt::ItemIsSelectable | Qt::ItemIsEnabled; -} - - -int ShaderCompilerModel::rowCount(const QModelIndex& parent) const -{ - (void)parent; - return m_shaderErrorInfoList.count(); -} - - -QModelIndex ShaderCompilerModel::parent(const QModelIndex&) const -{ - return QModelIndex(); -} - - -QModelIndex ShaderCompilerModel::index(int row, int column, const QModelIndex& parent) const -{ - if (row >= rowCount(parent) || column >= columnCount(parent)) - { - return QModelIndex(); - } - return createIndex(row, column); -} - - -int ShaderCompilerModel::columnCount(const QModelIndex& parent) const -{ - return parent.isValid() ? 0 : Column::Max; -} - - -QVariant ShaderCompilerModel::headerData(int section, Qt::Orientation orientation, int role) const -{ - if (orientation == Qt::Horizontal && role == Qt::DisplayRole) - { - switch (section) - { - case ColumnTimeStamp: - return tr("Time Stamp"); - case ColumnServer: - return tr("Server"); - case ColumnError: - return tr("Error"); - default: - break; - } - } - - return QAbstractItemModel::headerData(section, orientation, role); -} - - -QHash ShaderCompilerModel::roleNames() const -{ - QHash result; - result[TimeStampRole] = "timestamp"; - result[ServerRole] = "server"; - result[ErrorRole] = "error"; - result[OriginalRequestRole] = "originalRequest"; - return result; -} -void ShaderCompilerModel::addShaderErrorInfoEntry(QString errorMessage, QString timestamp, QString payload, QString server) -{ - ShaderCompilerErrorInfo shaderCompileErrorInfo(errorMessage, timestamp, payload, server); - beginInsertRows(QModelIndex(), m_shaderErrorInfoList.size(), m_shaderErrorInfoList.size()); - m_shaderErrorInfoList.append(shaderCompileErrorInfo); - endInsertRows(); -} - diff --git a/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerModel.h b/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerModel.h deleted file mode 100644 index 464ca9b5b0..0000000000 --- a/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerModel.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#ifndef SHADERCOMPILERMODEL_H -#define SHADERCOMPILERMODEL_H - -#if !defined(Q_MOC_RUN) -#include -#include -#include -#include -#include -#include -#endif - -class QModelIndex; -class QObject; - -struct ShaderCompilerErrorInfo -{ - QString m_shaderError; - QString m_shaderTimestamp; - QString m_shaderOriginalPayload; - QString m_shaderServerName; - - ShaderCompilerErrorInfo(QString shaderError, QString shaderTimestamp, QString shaderOriginalPayload, QString shaderServerName) - : m_shaderError(shaderError) - , m_shaderTimestamp(shaderTimestamp) - , m_shaderOriginalPayload(shaderOriginalPayload) - , m_shaderServerName(shaderServerName) - { - } -}; - -/** The Shader Compiler model is responsible for capturing error requests - */ -class ShaderCompilerModel - : public QAbstractItemModel -{ - Q_OBJECT -public: - - enum DataRoles - { - TimeStampRole = Qt::UserRole + 1, - ServerRole, - ErrorRole, - OriginalRequestRole, - }; - - enum Column - { - ColumnTimeStamp, - ColumnServer, - ColumnError, - Max - }; - - /// standard Qt constructor - explicit ShaderCompilerModel(QObject* parent = 0); - virtual ~ShaderCompilerModel(); - - // singleton pattern - static ShaderCompilerModel* Get(); - - - /// QAbstractListModel interface - QModelIndex parent(const QModelIndex&) const override; - QModelIndex index(int row, int column, const QModelIndex& parent) const override; - int columnCount(const QModelIndex&) const override; - virtual int rowCount(const QModelIndex& parent) const override; - QVariant headerData(int section, Qt::Orientation orientation, int role) const override; - virtual QVariant data(const QModelIndex& index, int role) const override; - virtual QHash roleNames() const override; - virtual Qt::ItemFlags flags(const QModelIndex& index) const override; - -public slots: - void addShaderErrorInfoEntry(QString errorMessage, QString timestamp, QString payload, QString server); - -private: - - QList m_shaderErrorInfoList; -}; - - -#endif // SHADERCOMPILERMODEL_H - - - diff --git a/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerjob.cpp b/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerjob.cpp deleted file mode 100644 index 58f9244616..0000000000 --- a/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerjob.cpp +++ /dev/null @@ -1,194 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * 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 "shadercompilerjob.h" -#include "native/assetprocessor.h" - -#include - -ShaderCompilerJob::ShaderCompilerJob() - : m_isUnitTesting(false) - , m_manager(nullptr) -{ -} - -ShaderCompilerJob::~ShaderCompilerJob() -{ - m_manager = nullptr; -} - -ShaderCompilerRequestMessage ShaderCompilerJob::ShaderCompilerMessage() const -{ - return m_ShaderCompilerMessage; -} - -void ShaderCompilerJob::initialize(QObject* pManager, const ShaderCompilerRequestMessage& ShaderCompilerMessage) -{ - m_manager = pManager; - m_ShaderCompilerMessage = ShaderCompilerMessage; -} - -QString ShaderCompilerJob::getServerAddress() -{ - if (isServerListEmpty()) - { - return QString(); - } - - QString serverAddress; - if (!m_ShaderCompilerMessage.serverList.contains(",")) - { - serverAddress = m_ShaderCompilerMessage.serverList; - m_ShaderCompilerMessage.serverList.clear(); - return serverAddress; - } - - QStringList serverList = m_ShaderCompilerMessage.serverList.split(","); - serverAddress = serverList.takeAt(0); - m_ShaderCompilerMessage.serverList = serverList.join(","); - return serverAddress; -} - -bool ShaderCompilerJob::isServerListEmpty() -{ - return m_ShaderCompilerMessage.serverList.isEmpty(); -} - -bool ShaderCompilerJob::attemptDelivery(QString serverAddress, QByteArray& payload) -{ - QTcpSocket socket; - QString error; - int waitingTime = 8000; // 8 sec timeout for sending. - int jobCompileMaxTime = 1000 * 60; // 60 sec timeout for compilation - if (m_isUnitTesting) - { - waitingTime = 500; - jobCompileMaxTime = 500; - } - - socket.connectToHost(serverAddress, m_ShaderCompilerMessage.serverPort, QIODevice::ReadWrite); - - if (socket.waitForConnected(waitingTime)) - { - qint64 bytesWritten = 0; - qint64 payloadSize = static_cast(m_ShaderCompilerMessage.originalPayload.size()); - // send payload size to server - while (bytesWritten != sizeof(qint64)) - { - qint64 currentWrite = socket.write(reinterpret_cast(&payloadSize) + bytesWritten, - sizeof(qint64) - bytesWritten); - if (currentWrite == -1) - { - //It is important to note that we are only outputting the error to debugchannel only here because - //we are forwarding these error messages upstream to the manager,who will take the appropriate action - error = "Connection Lost:Unable to send data"; - AZ_TracePrintf(AssetProcessor::DebugChannel, error.toUtf8().data()); - QMetaObject::invokeMethod(m_manager, "shaderCompilerError", Qt::QueuedConnection, Q_ARG(QString, error), Q_ARG(QString, QDateTime::currentDateTime().toString()), Q_ARG(QString, QString(m_ShaderCompilerMessage.originalPayload)), Q_ARG(QString, serverAddress)); - return false; - } - socket.flush(); - bytesWritten += currentWrite; - } - bytesWritten = 0; - //send actual payload to server - while (bytesWritten != m_ShaderCompilerMessage.originalPayload.size()) - { - qint64 currentWrite = socket.write(m_ShaderCompilerMessage.originalPayload.data() + bytesWritten, - m_ShaderCompilerMessage.originalPayload.size() - bytesWritten); - if (currentWrite == -1) - { - error = "Connection Lost:Unable to send data"; - AZ_TracePrintf(AssetProcessor::DebugChannel, error.toUtf8().data()); - QMetaObject::invokeMethod(m_manager, "shaderCompilerError", Qt::QueuedConnection, Q_ARG(QString, error), Q_ARG(QString, QDateTime::currentDateTime().toString()), Q_ARG(QString, QString(m_ShaderCompilerMessage.originalPayload)), Q_ARG(QString, serverAddress)); - } - socket.flush(); - bytesWritten += currentWrite; - } - } - else - { - error = "Unable to connect to IP Address " + serverAddress; - AZ_TracePrintf(AssetProcessor::DebugChannel, error.toUtf8().data()); - QMetaObject::invokeMethod(m_manager, "shaderCompilerError", Qt::QueuedConnection, Q_ARG(QString, error), Q_ARG(QString, QDateTime::currentDateTime().toString()), Q_ARG(QString, QString(m_ShaderCompilerMessage.originalPayload)), Q_ARG(QString, serverAddress)); - return false; - } - - unsigned int expectedBytes = sizeof(unsigned int) + sizeof(qint8); - unsigned int bytesReadTotal = 0; - unsigned int messageSize = 0; - bool isMessageSizeKnown = false; - //read the entire payload - while ((bytesReadTotal < expectedBytes + messageSize)) - { - if (socket.bytesAvailable() == 0) - { - if (!socket.waitForReadyRead(jobCompileMaxTime)) - { - error = "Remote IP is taking too long to respond: " + serverAddress; - AZ_TracePrintf(AssetProcessor::DebugChannel, error.toUtf8().data()); - QMetaObject::invokeMethod(m_manager, "shaderCompilerError", Qt::QueuedConnection, Q_ARG(QString, error), Q_ARG(QString, QDateTime::currentDateTime().toString()), Q_ARG(QString, QString(m_ShaderCompilerMessage.originalPayload)), Q_ARG(QString, serverAddress)); - payload.clear(); - return false; - } - } - - qint64 bytesAvailable = socket.bytesAvailable(); - - if (bytesAvailable >= expectedBytes && !isMessageSizeKnown) - { - socket.peek(reinterpret_cast(&messageSize), sizeof(unsigned int)); - payload.resize(expectedBytes + messageSize); - isMessageSizeKnown = true; - } - - if (bytesAvailable > 0) - { - qint64 bytesRead = socket.read(payload.data() + bytesReadTotal, bytesAvailable); - - if (bytesRead <= 0) - { - error = "Connection closed by remote IP Address " + serverAddress; - AZ_TracePrintf(AssetProcessor::DebugChannel, error.toUtf8().data()); - QMetaObject::invokeMethod(m_manager, "shaderCompilerError", Qt::QueuedConnection, Q_ARG(QString, error), Q_ARG(QString, QDateTime::currentDateTime().toString()), Q_ARG(QString, QString(m_ShaderCompilerMessage.originalPayload)), Q_ARG(QString, serverAddress)); - payload.clear(); - return false; - } - - bytesReadTotal = aznumeric_cast(bytesReadTotal + bytesRead); - } - } - - return true; // payload successfully send -} - -void ShaderCompilerJob::run() -{ - QMetaObject::invokeMethod(m_manager, "jobStarted", Qt::QueuedConnection); - QByteArray payload; - //until server list is empty, keep trying - while (!isServerListEmpty()) - { - QString serverAddress = getServerAddress(); - //attempt to send payload - if (attemptDelivery(serverAddress, payload)) - { - break; - } - } - //we are appending request id at the end of every payload, - //therefore in the case of any errors also - //we will be sending atleast four bytes to the game - payload.append(reinterpret_cast(&m_ShaderCompilerMessage.requestId), sizeof(unsigned int)); - QMetaObject::invokeMethod(m_manager, "OnShaderCompilerJobComplete", Qt::QueuedConnection, Q_ARG(QByteArray, payload), Q_ARG(unsigned int, m_ShaderCompilerMessage.requestId)); - QMetaObject::invokeMethod(m_manager, "jobEnded", Qt::QueuedConnection); -} - - -void ShaderCompilerJob::setIsUnitTesting(bool isUnitTesting) -{ - m_isUnitTesting = isUnitTesting; -} diff --git a/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerjob.h b/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerjob.h deleted file mode 100644 index 1d72365331..0000000000 --- a/Code/Tools/AssetProcessor/native/shadercompiler/shadercompilerjob.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#ifndef SHADERCOMPILERJOB_H -#define SHADERCOMPILERJOB_H - -#include -#include "shadercompilerMessages.h" - -class QByteArray; -class QObject; - -/** - * This class is responsible for connecting to the shader compiler server - * and getting back the response to the shader compiler manager - */ -class ShaderCompilerJob - : public QRunnable -{ -public: - - explicit ShaderCompilerJob(); - virtual ~ShaderCompilerJob(); - ShaderCompilerRequestMessage ShaderCompilerMessage() const; - void initialize(QObject* pManager, const ShaderCompilerRequestMessage& ShaderCompilerMessage); - QString getServerAddress(); - bool isServerListEmpty(); - virtual void run() override; - - void setIsUnitTesting(bool isUnitTesting); - - bool attemptDelivery(QString serverAddress, QByteArray& payload); - -private: - ShaderCompilerRequestMessage m_ShaderCompilerMessage; - QObject* m_manager; - bool m_isUnitTesting; -}; - -#endif // SHADERCOMPILERJOB_H diff --git a/Code/Tools/AssetProcessor/native/ui/MainWindow.cpp b/Code/Tools/AssetProcessor/native/ui/MainWindow.cpp index 70b7ceb009..c3674e6431 100644 --- a/Code/Tools/AssetProcessor/native/ui/MainWindow.cpp +++ b/Code/Tools/AssetProcessor/native/ui/MainWindow.cpp @@ -37,7 +37,6 @@ #include "../connection/connection.h" #include "../resourcecompiler/rccontroller.h" #include "../resourcecompiler/RCJobSortFilterProxyModel.h" -#include "../shadercompiler/shadercompilerModel.h" #include @@ -148,7 +147,6 @@ void MainWindow::Activate() ui->buttonList->addTab(QStringLiteral("Jobs")); ui->buttonList->addTab(QStringLiteral("Assets")); ui->buttonList->addTab(QStringLiteral("Logs")); - ui->buttonList->addTab(QStringLiteral("Shaders")); ui->buttonList->addTab(QStringLiteral("Connections")); ui->buttonList->addTab(QStringLiteral("Tools")); @@ -317,14 +315,6 @@ void MainWindow::Activate() connect(ui->jobFilteredSearchWidget, &AzQtComponents::FilteredSearchWidget::TextFilterChanged, this, writeJobFilterSettings); - //Shader view - ui->shaderTreeView->setModel(m_guiApplicationManager->GetShaderCompilerModel()); - ui->shaderTreeView->header()->resizeSection(ShaderCompilerModel::ColumnTimeStamp, 80); - ui->shaderTreeView->header()->resizeSection(ShaderCompilerModel::ColumnServer, 40); - ui->shaderTreeView->header()->resizeSection(ShaderCompilerModel::ColumnError, 220); - ui->shaderTreeView->header()->setSectionResizeMode(ShaderCompilerModel::ColumnError, QHeaderView::Stretch); - ui->shaderTreeView->header()->setStretchLastSection(false); - // Asset view m_sourceAssetTreeFilterModel = new AssetProcessor::AssetTreeFilterModel(this); m_sourceModel = new AssetProcessor::SourceAssetTreeModel(m_sharedDbConnection, this); diff --git a/Code/Tools/AssetProcessor/native/ui/MainWindow.h b/Code/Tools/AssetProcessor/native/ui/MainWindow.h index 8dc1f3e356..1bec6f982d 100644 --- a/Code/Tools/AssetProcessor/native/ui/MainWindow.h +++ b/Code/Tools/AssetProcessor/native/ui/MainWindow.h @@ -65,7 +65,6 @@ public: Jobs, Assets, Logs, - Shaders, Connections, Tools }; diff --git a/Code/Tools/AssetProcessor/native/ui/MainWindow.ui b/Code/Tools/AssetProcessor/native/ui/MainWindow.ui index d4f341d2b5..9d90beec13 100644 --- a/Code/Tools/AssetProcessor/native/ui/MainWindow.ui +++ b/Code/Tools/AssetProcessor/native/ui/MainWindow.ui @@ -763,59 +763,6 @@ - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Shaders - - - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - diff --git a/Code/Tools/AssetProcessor/native/unittests/ShaderCompilerUnitTests.cpp b/Code/Tools/AssetProcessor/native/unittests/ShaderCompilerUnitTests.cpp deleted file mode 100644 index f8bab90118..0000000000 --- a/Code/Tools/AssetProcessor/native/unittests/ShaderCompilerUnitTests.cpp +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * 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 "ShaderCompilerUnitTests.h" -#include "native/connection/connectionManager.h" -#include "native/connection/connection.h" -#include "native/utilities/assetUtils.h" - -#define UNIT_TEST_CONNECT_PORT 12125 - -ShaderCompilerUnitTest::ShaderCompilerUnitTest() -{ - m_connectionManager = ConnectionManager::Get(); - connect(this, SIGNAL(StartUnitTestForGoodShaderCompiler()), this, SLOT(UnitTestForGoodShaderCompiler())); - connect(this, SIGNAL(StartUnitTestForFirstBadShaderCompiler()), this, SLOT(UnitTestForFirstBadShaderCompiler())); - connect(this, SIGNAL(StartUnitTestForSecondBadShaderCompiler()), this, SLOT(UnitTestForSecondBadShaderCompiler())); - connect(this, SIGNAL(StartUnitTestForThirdBadShaderCompiler()), this, SLOT(UnitTestForThirdBadShaderCompiler())); - connect(&m_shaderCompilerManager, SIGNAL(sendErrorMessageFromShaderJob(QString, QString, QString, QString)), this, SLOT(ReceiveShaderCompilerErrorMessage(QString, QString, QString, QString))); - - m_shaderCompilerManager.setIsUnitTesting(true); - m_connectionManager->RegisterService(AssetUtilities::ComputeCRC32Lowercase("ShaderCompilerProxyRequest"), AZStd::bind(&ShaderCompilerManager::process, &m_shaderCompilerManager, AZStd::placeholders::_1, AZStd::placeholders::_2, AZStd::placeholders::_3, AZStd::placeholders::_4)); - ContructPayloadForShaderCompilerServer(m_testPayload); -} - -ShaderCompilerUnitTest::~ShaderCompilerUnitTest() -{ - m_connectionManager->removeConnection(m_connectionId); -} - -void ShaderCompilerUnitTest::ContructPayloadForShaderCompilerServer(QByteArray& payload) -{ - QString testString = "This is a test string"; - QString testServerList = "127.0.0.3,198.51.100.0,127.0.0.1"; // note - 198.51.100.0 is in the 'test' range that will never be assigned to anyone. - unsigned int testServerListLength = static_cast(testServerList.size()); - unsigned short testServerPort = 12348; - unsigned int testRequestId = 1; - qint64 testStringLength = static_cast(testString.size()); - payload.resize(static_cast(testStringLength)); - memcpy(payload.data(), (testString.toStdString().c_str()), testStringLength); - unsigned int payloadSize = payload.size(); - payload.resize(payloadSize + 1 + static_cast(testServerListLength) + 1 + sizeof(unsigned short) + sizeof(unsigned int) + sizeof(unsigned int)); - char* dataStart = payload.data() + payloadSize; - *dataStart = 0;// null - memcpy(payload.data() + payloadSize + 1, (testServerList.toStdString().c_str()), testServerListLength); - dataStart += 1 + testServerListLength; - *dataStart = 0; //null - memcpy(payload.data() + payloadSize + 1 + testServerListLength + 1, reinterpret_cast(&testServerPort), sizeof(unsigned short)); - memcpy(payload.data() + payloadSize + 1 + testServerListLength + 1 + sizeof(unsigned short), reinterpret_cast(&testServerListLength), sizeof(unsigned int)); - memcpy(payload.data() + payloadSize + 1 + testServerListLength + 1 + sizeof(unsigned short) + sizeof(unsigned int), reinterpret_cast(&testRequestId), sizeof(unsigned int)); -} - -void ShaderCompilerUnitTest::StartTest() -{ - m_connectionId = m_connectionManager->addConnection(); - Connection* connection = m_connectionManager->getConnection(m_connectionId); - connection->SetPort(UNIT_TEST_CONNECT_PORT); - connection->SetIpAddress("127.0.0.1"); - connection->SetAutoConnect(true); - UnitTestForGoodShaderCompiler(); -} - -int ShaderCompilerUnitTest::UnitTestPriority() const -{ - return -4; -} - -void ShaderCompilerUnitTest::UnitTestForGoodShaderCompiler() -{ - AZ_TracePrintf("ShaderCompilerUnitTest", " ... Starting test of 'good' shader compiler...\n"); - m_shaderCompilerManager.m_sendResponseCallbackFn = AZStd::bind(&ShaderCompilerUnitTest::VerifyPayloadForGoodShaderCompiler, this , AZStd::placeholders::_1, AZStd::placeholders::_2, AZStd::placeholders::_3, AZStd::placeholders::_4); - m_server.Init("127.0.0.1", 12348); - m_server.setServerStatus(UnitTestShaderCompilerServer::GoodServer); - m_connectionManager->SendMessageToService(m_connectionId, AssetUtilities::ComputeCRC32Lowercase("ShaderCompilerProxyRequest"), 0, m_testPayload); -} - -void ShaderCompilerUnitTest::UnitTestForFirstBadShaderCompiler() -{ - AZ_TracePrintf("ShaderCompilerUnitTest", " ... Starting test of 'bad' shader compiler... (Incomplete Payload)\n"); - m_shaderCompilerManager.m_sendResponseCallbackFn = AZStd::bind(&ShaderCompilerUnitTest::VerifyPayloadForFirstBadShaderCompiler, this, AZStd::placeholders::_1, AZStd::placeholders::_2, AZStd::placeholders::_3, AZStd::placeholders::_4); - m_server.setServerStatus(UnitTestShaderCompilerServer::BadServer_SendsIncompletePayload); - m_connectionManager->SendMessageToService(m_connectionId, AssetUtilities::ComputeCRC32Lowercase("ShaderCompilerProxyRequest"), 0, m_testPayload); -} - -void ShaderCompilerUnitTest::UnitTestForSecondBadShaderCompiler() -{ - AZ_TracePrintf("ShaderCompilerUnitTest", " ... Starting test of 'bad' shader compiler... (Payload followed by disconnection)\n"); - m_shaderCompilerManager.m_sendResponseCallbackFn = AZStd::bind(&ShaderCompilerUnitTest::VerifyPayloadForSecondBadShaderCompiler, this, AZStd::placeholders::_1, AZStd::placeholders::_2, AZStd::placeholders::_3, AZStd::placeholders::_4); - m_server.setServerStatus(UnitTestShaderCompilerServer::BadServer_ReadsPayloadAndDisconnect); - m_connectionManager->SendMessageToService(m_connectionId, AssetUtilities::ComputeCRC32Lowercase("ShaderCompilerProxyRequest"), 0, m_testPayload); -} - -void ShaderCompilerUnitTest::UnitTestForThirdBadShaderCompiler() -{ - AZ_TracePrintf("ShaderCompilerUnitTest", " ... Starting test of 'bad' shader compiler... (Connect but disconnect without data)\n"); - m_shaderCompilerManager.m_sendResponseCallbackFn = AZStd::bind(&ShaderCompilerUnitTest::VerifyPayloadForThirdBadShaderCompiler, this, AZStd::placeholders::_1, AZStd::placeholders::_2, AZStd::placeholders::_3, AZStd::placeholders::_4); - m_server.setServerStatus(UnitTestShaderCompilerServer::BadServer_DisconnectAfterConnect); - m_server.startServer(); - m_connectionManager->SendMessageToService(m_connectionId, AssetUtilities::ComputeCRC32Lowercase("ShaderCompilerProxyRequest"), 0, m_testPayload); -} - -void ShaderCompilerUnitTest::VerifyPayloadForGoodShaderCompiler(unsigned int connId, unsigned int type, unsigned int serial, QByteArray payload) -{ - (void) connId; - (void) type; - (void) serial; - m_shaderCompilerManager.m_sendResponseCallbackFn = nullptr; - - unsigned int messageSize; - quint8 status; - QByteArray payloadToCheck; - unsigned int requestId; - memcpy((&messageSize), payload.data(), sizeof(unsigned int)); - memcpy((&status), payload.data() + sizeof(unsigned int), sizeof(unsigned char)); - payloadToCheck.resize(messageSize); - memcpy((payloadToCheck.data()), payload.data() + sizeof(unsigned int) + sizeof(unsigned char), messageSize); - memcpy((&requestId), payload.data() + sizeof(unsigned int) + sizeof(unsigned char) + messageSize, sizeof(unsigned int)); - QString outgoingTestString = "Test string validated"; - if (QString::compare(QString(payloadToCheck), outgoingTestString, Qt::CaseSensitive) != 0) - { - Q_EMIT UnitTestFailed("Unit Test for Good Shader Compiler Failed"); - return; - } - Q_EMIT StartUnitTestForFirstBadShaderCompiler(); -} - -void ShaderCompilerUnitTest::VerifyPayloadForFirstBadShaderCompiler(unsigned int connId, unsigned int type, unsigned int serial, QByteArray payload) -{ - (void) connId; - (void) type; - (void) serial; - m_shaderCompilerManager.m_sendResponseCallbackFn = nullptr; - QString error = "Remote IP is taking too long to respond: 127.0.0.1"; - if ((payload.size() != 4) || (QString::compare(m_lastShaderCompilerErrorMessage, error, Qt::CaseSensitive) != 0)) - { - Q_EMIT UnitTestFailed("Unit Test for First Bad Shader Compiler Failed"); - return; - } - m_lastShaderCompilerErrorMessage.clear(); - Q_EMIT StartUnitTestForSecondBadShaderCompiler(); -} - -void ShaderCompilerUnitTest::VerifyPayloadForSecondBadShaderCompiler(unsigned int connId, unsigned int type, unsigned int serial, QByteArray payload) -{ - (void) connId; - (void) type; - (void) serial; - m_shaderCompilerManager.m_sendResponseCallbackFn = nullptr; - QString error = "Remote IP is taking too long to respond: 127.0.0.1"; - if ((payload.size() != 4) || (QString::compare(m_lastShaderCompilerErrorMessage, error, Qt::CaseSensitive) != 0)) - { - Q_EMIT UnitTestFailed("Unit Test for Second Bad Shader Compiler Failed"); - return; - } - m_lastShaderCompilerErrorMessage.clear(); - Q_EMIT StartUnitTestForThirdBadShaderCompiler(); -} - -void ShaderCompilerUnitTest::VerifyPayloadForThirdBadShaderCompiler(unsigned int connId, unsigned int type, unsigned int serial, QByteArray payload) -{ - (void) connId; - (void) type; - (void) serial; - m_shaderCompilerManager.m_sendResponseCallbackFn = nullptr; - QString error = "Remote IP is taking too long to respond: 127.0.0.1"; - if ((payload.size() != 4) || (QString::compare(m_lastShaderCompilerErrorMessage, error, Qt::CaseSensitive) != 0)) - { - Q_EMIT UnitTestFailed("Unit Test for Third Bad Shader Compiler Failed"); - return; - } - m_lastShaderCompilerErrorMessage.clear(); - Q_EMIT UnitTestPassed(); -} - -void ShaderCompilerUnitTest::ReceiveShaderCompilerErrorMessage(QString error, QString server, QString timestamp, QString payload) -{ - (void) server; - (void) timestamp; - (void) payload; - m_lastShaderCompilerErrorMessage = error; -} - - -REGISTER_UNIT_TEST(ShaderCompilerUnitTest) - diff --git a/Code/Tools/AssetProcessor/native/unittests/ShaderCompilerUnitTests.h b/Code/Tools/AssetProcessor/native/unittests/ShaderCompilerUnitTests.h deleted file mode 100644 index edcff7e949..0000000000 --- a/Code/Tools/AssetProcessor/native/unittests/ShaderCompilerUnitTests.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#ifndef SHADERCOMPILERUNITTEST_H -#define SHADERCOMPILERUNITTEST_H - -#if !defined(Q_MOC_RUN) -#include "UnitTestRunner.h" - -#include - -#include "native/shadercompiler/shadercompilerManager.h" -//#include "native/shadercompiler/shadercompilerMessages.h" -#include "native/utilities/UnitTestShaderCompilerServer.h" -#include -#include -#endif - -class ConnectionManager; - -class ShaderCompilerManagerForUnitTest : public ShaderCompilerManager -{ -public: - explicit ShaderCompilerManagerForUnitTest(QObject* parent = 0) : ShaderCompilerManager(parent) {}; - - // for this test, we override sendResponse and make it so that it just calls a callback instead of actually sending it to the connection manager. - void sendResponse(unsigned int connId, unsigned int type, unsigned int serial, QByteArray payload) override - { - if (m_sendResponseCallbackFn) - { - m_sendResponseCallbackFn(connId, type, serial, payload); - } - } - AZStd::function m_sendResponseCallbackFn; -}; - -class ShaderCompilerUnitTest - : public UnitTestRun -{ - Q_OBJECT -public: - ShaderCompilerUnitTest(); - ~ShaderCompilerUnitTest(); - virtual void StartTest() override; - virtual int UnitTestPriority() const override; - void ContructPayloadForShaderCompilerServer(QByteArray& payload); - -Q_SIGNALS: - void StartUnitTestForGoodShaderCompiler(); - void StartUnitTestForFirstBadShaderCompiler(); - void StartUnitTestForSecondBadShaderCompiler(); - void StartUnitTestForThirdBadShaderCompiler(); - -public Q_SLOTS: - void UnitTestForGoodShaderCompiler(); - void UnitTestForFirstBadShaderCompiler(); - void UnitTestForSecondBadShaderCompiler(); - void UnitTestForThirdBadShaderCompiler(); - void VerifyPayloadForGoodShaderCompiler(unsigned int connId, unsigned int type, unsigned int serial, QByteArray payload); - void VerifyPayloadForFirstBadShaderCompiler(unsigned int connId, unsigned int type, unsigned int serial, QByteArray payload); - void VerifyPayloadForSecondBadShaderCompiler(unsigned int connId, unsigned int type, unsigned int serial, QByteArray payload); - void VerifyPayloadForThirdBadShaderCompiler(unsigned int connId, unsigned int type, unsigned int serial, QByteArray payload); - void ReceiveShaderCompilerErrorMessage(QString error, QString server, QString timestamp, QString payload); - - -private: - UnitTestShaderCompilerServer m_server; - ShaderCompilerManagerForUnitTest m_shaderCompilerManager; - ConnectionManager* m_connectionManager; - QByteArray m_testPayload; - QString m_lastShaderCompilerErrorMessage; - unsigned int m_connectionId = 0; -}; - -#endif // SHADERCOMPILERUNITTEST_H - - diff --git a/Code/Tools/AssetProcessor/native/utilities/GUIApplicationManager.cpp b/Code/Tools/AssetProcessor/native/utilities/GUIApplicationManager.cpp index c3ff22a39e..7652b67db0 100644 --- a/Code/Tools/AssetProcessor/native/utilities/GUIApplicationManager.cpp +++ b/Code/Tools/AssetProcessor/native/utilities/GUIApplicationManager.cpp @@ -12,8 +12,6 @@ #include "native/resourcecompiler/rccontroller.h" #include "native/FileServer/fileServer.h" #include "native/AssetManager/assetScanner.h" -#include "native/shadercompiler/shadercompilerManager.h" -#include "native/shadercompiler/shadercompilerModel.h" #include #include @@ -55,7 +53,7 @@ namespace { moduleFileInfo.setFile(executableDirectory); } - + QDir binaryDir = moduleFileInfo.absoluteDir(); // strip extension QString applicationBase = moduleFileInfo.completeBaseName(); @@ -70,7 +68,7 @@ namespace binaryDir.remove(tempFile); } } - + } @@ -145,8 +143,6 @@ void GUIApplicationManager::Destroy() DestroyIniConfiguration(); DestroyFileServer(); - DestroyShaderCompilerManager(); - DestroyShaderCompilerModel(); } @@ -192,7 +188,7 @@ bool GUIApplicationManager::Run() wrapper->enableSaveRestoreGeometry(GetOrganizationName(), GetApplicationName(), "MainWindow", restoreOnFirstShow); AzQtComponents::StyleManager::setStyleSheet(m_mainWindow, QStringLiteral("style:AssetProcessor.qss")); - + auto refreshStyleSheets = [styleManager]() { styleManager->Refresh(); @@ -334,7 +330,7 @@ bool GUIApplicationManager::Run() m_duringStartup = false; int resultCode = qApp->exec(); // this blocks until the last window is closed. - + if(!InitiatedShutdown()) { // if we are here it implies that AP did not stop the Qt event loop and is shutting down prematurely @@ -427,7 +423,7 @@ bool GUIApplicationManager::OnError(const char* /*window*/, const char* message) return true; } - // If we're the main thread, then consider showing the message box directly. + // If we're the main thread, then consider showing the message box directly. // note that all other threads will PAUSE if they emit a message while the main thread is showing this box // due to the way the trace system EBUS is mutex-protected. Qt::ConnectionType connection = Qt::DirectConnection; @@ -470,7 +466,7 @@ bool GUIApplicationManager::Activate() AssetUtilities::ComputeProjectCacheRoot(projectCacheRoot); m_localUserSettings.Load(projectCacheRoot.filePath("AssetProcessorUserSettings.xml").toUtf8().data(), context); m_localUserSettings.Activate(AZ::UserSettings::CT_LOCAL); - + InitIniConfiguration(); InitFileServer(); @@ -479,9 +475,6 @@ bool GUIApplicationManager::Activate() { return false; } - - InitShaderCompilerModel(); - InitShaderCompilerManager(); return true; } @@ -606,7 +599,7 @@ void GUIApplicationManager::InitConnectionManager() QObject::connect(m_fileServer, SIGNAL(AddRenameRequest(unsigned int, bool)), m_connectionManager, SLOT(AddRenameRequest(unsigned int, bool))); QObject::connect(m_fileServer, SIGNAL(AddFindFileNamesRequest(unsigned int, bool)), m_connectionManager, SLOT(AddFindFileNamesRequest(unsigned int, bool))); QObject::connect(m_fileServer, SIGNAL(UpdateConnectionMetrics()), m_connectionManager, SLOT(UpdateConnectionMetrics())); - + m_connectionManager->RegisterService(ShowAssetProcessorRequest::MessageType, std::bind([this](unsigned int /*connId*/, unsigned int /*type*/, unsigned int /*serial*/, QByteArray /*payload*/) { @@ -661,40 +654,6 @@ void GUIApplicationManager::DestroyFileServer() } } -void GUIApplicationManager::InitShaderCompilerManager() -{ - m_shaderCompilerManager = new ShaderCompilerManager(); - - //Shader compiler stuff - m_connectionManager->RegisterService(AssetUtilities::ComputeCRC32Lowercase("ShaderCompilerProxyRequest"), std::bind(&ShaderCompilerManager::process, m_shaderCompilerManager, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4)); - QObject::connect(m_shaderCompilerManager, SIGNAL(sendErrorMessageFromShaderJob(QString, QString, QString, QString)), m_shaderCompilerModel, SLOT(addShaderErrorInfoEntry(QString, QString, QString, QString))); - - -} - -void GUIApplicationManager::DestroyShaderCompilerManager() -{ - if (m_shaderCompilerManager) - { - delete m_shaderCompilerManager; - m_shaderCompilerManager = nullptr; - } -} - -void GUIApplicationManager::InitShaderCompilerModel() -{ - m_shaderCompilerModel = new ShaderCompilerModel(); -} - -void GUIApplicationManager::DestroyShaderCompilerModel() -{ - if (m_shaderCompilerModel) - { - delete m_shaderCompilerModel; - m_shaderCompilerModel = nullptr; - } -} - IniConfiguration* GUIApplicationManager::GetIniConfiguration() const { return m_iniConfiguration; @@ -704,14 +663,6 @@ FileServer* GUIApplicationManager::GetFileServer() const { return m_fileServer; } -ShaderCompilerManager* GUIApplicationManager::GetShaderCompilerManager() const -{ - return m_shaderCompilerManager; -} -ShaderCompilerModel* GUIApplicationManager::GetShaderCompilerModel() const -{ - return m_shaderCompilerModel; -} void GUIApplicationManager::ShowTrayIconErrorMessage(QString msg) { diff --git a/Code/Tools/AssetProcessor/native/utilities/GUIApplicationManager.h b/Code/Tools/AssetProcessor/native/utilities/GUIApplicationManager.h index 3cf58231f2..c10d841daf 100644 --- a/Code/Tools/AssetProcessor/native/utilities/GUIApplicationManager.h +++ b/Code/Tools/AssetProcessor/native/utilities/GUIApplicationManager.h @@ -24,8 +24,6 @@ class ConnectionManager; class IniConfiguration; class ApplicationServer; class FileServer; -class ShaderCompilerManager; -class ShaderCompilerModel; namespace AssetProcessor { @@ -47,8 +45,6 @@ public: ApplicationManager::BeforeRunStatus BeforeRun() override; IniConfiguration* GetIniConfiguration() const; FileServer* GetFileServer() const; - ShaderCompilerManager* GetShaderCompilerManager() const; - ShaderCompilerModel* GetShaderCompilerModel() const; bool Run() override; //////////////////////////////////////////////////// @@ -72,10 +68,6 @@ private: void DestroyIniConfiguration(); void InitFileServer(); void DestroyFileServer(); - void InitShaderCompilerManager(); - void DestroyShaderCompilerManager(); - void InitShaderCompilerModel(); - void DestroyShaderCompilerModel(); void Destroy() override; Q_SIGNALS: @@ -99,8 +91,7 @@ private: IniConfiguration* m_iniConfiguration = nullptr; FileServer* m_fileServer = nullptr; - ShaderCompilerManager* m_shaderCompilerManager = nullptr; - ShaderCompilerModel* m_shaderCompilerModel = nullptr; + QFileSystemWatcher m_qtFileWatcher; AZ::UserSettingsProvider m_localUserSettings; bool m_messageBoxIsVisible = false; From 81453defa02e691f17860ab7327a169c7b7cc0b4 Mon Sep 17 00:00:00 2001 From: amzn-mike <80125227+amzn-mike@users.noreply.github.com> Date: Mon, 3 Jan 2022 09:56:19 -0600 Subject: [PATCH 268/948] Load QIcons once for asset tree and share with each Asset Tree Item to avoid file loads for every asset and improve start up time (#6485) Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> --- .../Tools/AssetProcessor/native/ui/AssetTreeItem.cpp | 12 +++++++----- Code/Tools/AssetProcessor/native/ui/AssetTreeItem.h | 2 ++ .../AssetProcessor/native/ui/AssetTreeModel.cpp | 9 ++++++--- Code/Tools/AssetProcessor/native/ui/AssetTreeModel.h | 2 ++ 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/Code/Tools/AssetProcessor/native/ui/AssetTreeItem.cpp b/Code/Tools/AssetProcessor/native/ui/AssetTreeItem.cpp index d8b69a80f5..75823374a0 100644 --- a/Code/Tools/AssetProcessor/native/ui/AssetTreeItem.cpp +++ b/Code/Tools/AssetProcessor/native/ui/AssetTreeItem.cpp @@ -29,14 +29,16 @@ namespace AssetProcessor AssetTreeItem::AssetTreeItem( AZStd::shared_ptr data, QIcon errorIcon, + QIcon folderIcon, + QIcon fileIcon, AssetTreeItem* parentItem) : m_data(data), m_parent(parentItem), - m_errorIcon(errorIcon), // QIcon is implicitily shared. - m_folderIcon(QIcon(QStringLiteral(":/Gallery/Asset_Folder.svg"))), - m_fileIcon(QIcon(QStringLiteral(":/Gallery/Asset_File.svg"))) + m_errorIcon(errorIcon), // QIcon is implicitly shared. + m_folderIcon(folderIcon), + m_fileIcon(fileIcon) { - m_folderIcon.addFile(QStringLiteral(":/Gallery/Asset_Folder.svg"), QSize(), QIcon::Selected); + } AssetTreeItem::~AssetTreeItem() @@ -45,7 +47,7 @@ namespace AssetProcessor AssetTreeItem* AssetTreeItem::CreateChild(AZStd::shared_ptr data) { - m_childItems.emplace_back(new AssetTreeItem(data, m_errorIcon, this)); + m_childItems.emplace_back(new AssetTreeItem(data, m_errorIcon, m_folderIcon, m_fileIcon, this)); return m_childItems.back().get(); } diff --git a/Code/Tools/AssetProcessor/native/ui/AssetTreeItem.h b/Code/Tools/AssetProcessor/native/ui/AssetTreeItem.h index c9bc926c34..f36855adfe 100644 --- a/Code/Tools/AssetProcessor/native/ui/AssetTreeItem.h +++ b/Code/Tools/AssetProcessor/native/ui/AssetTreeItem.h @@ -50,6 +50,8 @@ namespace AssetProcessor explicit AssetTreeItem( AZStd::shared_ptr data, QIcon errorIcon, + QIcon folderIcon, + QIcon fileIcon, AssetTreeItem* parentItem = nullptr); virtual ~AssetTreeItem(); diff --git a/Code/Tools/AssetProcessor/native/ui/AssetTreeModel.cpp b/Code/Tools/AssetProcessor/native/ui/AssetTreeModel.cpp index 8d889343f9..e8540c3d8d 100644 --- a/Code/Tools/AssetProcessor/native/ui/AssetTreeModel.cpp +++ b/Code/Tools/AssetProcessor/native/ui/AssetTreeModel.cpp @@ -16,9 +16,12 @@ namespace AssetProcessor AssetTreeModel::AssetTreeModel(AZStd::shared_ptr sharedDbConnection, QObject *parent) : QAbstractItemModel(parent), - m_sharedDbConnection(sharedDbConnection), - m_errorIcon(QStringLiteral(":/stylesheet/img/logging/error.svg")) + m_sharedDbConnection(sharedDbConnection) + , m_errorIcon(QStringLiteral(":/stylesheet/img/logging/error.svg")) + , m_folderIcon(QIcon(QStringLiteral(":/Gallery/Asset_Folder.svg"))) + , m_fileIcon(QIcon(QStringLiteral(":/Gallery/Asset_File.svg"))) { + m_folderIcon.addFile(QStringLiteral(":/Gallery/Asset_Folder.svg"), QSize(), QIcon::Selected); ApplicationManagerNotifications::Bus::Handler::BusConnect(); AzToolsFramework::AssetDatabase::AssetDatabaseNotificationBus::Handler::BusConnect(); } @@ -40,7 +43,7 @@ namespace AssetProcessor void AssetTreeModel::Reset() { beginResetModel(); - m_root.reset(new AssetTreeItem(AZStd::make_shared("", "", true, AZ::Uuid::CreateNull()), m_errorIcon)); + m_root.reset(new AssetTreeItem(AZStd::make_shared("", "", true, AZ::Uuid::CreateNull()), m_errorIcon, m_folderIcon, m_fileIcon)); ResetModel(); diff --git a/Code/Tools/AssetProcessor/native/ui/AssetTreeModel.h b/Code/Tools/AssetProcessor/native/ui/AssetTreeModel.h index d33bc0bc48..27201c55a3 100644 --- a/Code/Tools/AssetProcessor/native/ui/AssetTreeModel.h +++ b/Code/Tools/AssetProcessor/native/ui/AssetTreeModel.h @@ -54,5 +54,7 @@ namespace AssetProcessor AZStd::shared_ptr m_sharedDbConnection; QIcon m_errorIcon; + QIcon m_folderIcon; + QIcon m_fileIcon; }; } From ee554f6464715c342acb6d26f64bd27b71200560 Mon Sep 17 00:00:00 2001 From: Roman <69218254+amzn-rhhong@users.noreply.github.com> Date: Mon, 3 Jan 2022 09:25:41 -0800 Subject: [PATCH 269/948] ActorInstanceId default to -1 when no %lastresult matches (#6442) * small bugfix Signed-off-by: rhhong * ActorInstanceId default to -1 when no %lastresult matches Signed-off-by: rhhong * CR feedback - wrap function to get the first available editor actor instance. Signed-off-by: rhhong * Remove mcore inline Signed-off-by: rhhong * Fixed the bug that delete an instance from actor manager crashes the editor. Signed-off-by: rhhong --- .../Source/ActorInstanceCommands.cpp | 20 ++++++++++++++++++- .../Source/AnimGraphCommands.cpp | 13 ++++++++++-- .../Code/EMotionFX/Source/ActorManager.cpp | 14 +++++++++++++ .../Code/EMotionFX/Source/ActorManager.h | 6 ++++++ .../EMStudioSDK/Source/MainWindow.cpp | 10 +++++++++- .../Source/RenderPlugin/RenderPlugin.cpp | 10 +++++++++- .../EMStudioSDK/Source/Workspace.cpp | 13 ++++++++++++ .../Code/MCore/Source/MCoreCommandManager.cpp | 7 ++++++- 8 files changed, 87 insertions(+), 6 deletions(-) diff --git a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/ActorInstanceCommands.cpp b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/ActorInstanceCommands.cpp index ba25318944..328c905ded 100644 --- a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/ActorInstanceCommands.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/ActorInstanceCommands.cpp @@ -439,6 +439,12 @@ namespace CommandSystem return false; } + if (actorInstance->GetEntity()) + { + outResult = AZStd::string::format("Cannot remove actor instance. Actor instance %i belongs to an entity.", actorInstanceID); + return false; + } + // store the old values before removing the instance m_oldPosition = actorInstance->GetLocalSpaceTransform().m_position; m_oldRotation = actorInstance->GetLocalSpaceTransform().m_rotation; @@ -618,7 +624,7 @@ namespace CommandSystem MCore::CommandGroup commandGroup("Remove actor instances", numActorInstances); AZStd::string tempString; - // iterate over the selected instances and clone them + // iterate over the selected instances and remove them for (size_t i = 0; i < numActorInstances; ++i) { // get the current actor instance @@ -628,6 +634,18 @@ namespace CommandSystem continue; } + // Do not remove any runtime instance from the manager using the commands. + if (actorInstance->GetIsOwnedByRuntime()) + { + continue; + } + + // Do not remove the any instances owned by an entity from the manager using the commands. + if (actorInstance->GetEntity()) + { + continue; + } + tempString = AZStd::string::format("RemoveActorInstance -actorInstanceID %i", actorInstance->GetID()); commandGroup.AddCommandString(tempString.c_str()); } diff --git a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/AnimGraphCommands.cpp b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/AnimGraphCommands.cpp index bd5a14f772..b1a830c838 100644 --- a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/AnimGraphCommands.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/AnimGraphCommands.cpp @@ -455,8 +455,17 @@ namespace CommandSystem EMotionFX::ActorInstance* actorInstance = nullptr; if (parameters.CheckIfHasParameter("actorInstanceID")) { - const uint32 actorInstanceID = parameters.GetValueAsInt("actorInstanceID", this); - actorInstance = EMotionFX::GetActorManager().FindActorInstanceByID(actorInstanceID); + const int actorInstanceID = parameters.GetValueAsInt("actorInstanceID", this); + if (actorInstanceID == -1) + { + // If there isn't an actorInstanceId, grab the first actor instance. + actorInstance = EMotionFX::GetActorManager().GetFirstEditorActorInstance(); + } + else + { + actorInstance = EMotionFX::GetActorManager().FindActorInstanceByID(actorInstanceID); + } + if (!actorInstance) { outResult = AZStd::string::format("Cannot activate anim graph. Actor instance id '%i' is not valid.", actorInstanceID); diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/ActorManager.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/ActorManager.cpp index 184aac6e2c..252fccdb94 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/ActorManager.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/ActorManager.cpp @@ -434,6 +434,20 @@ namespace EMotionFX } + ActorInstance* ActorManager::GetFirstEditorActorInstance() const + { + const size_t numActorInstances = m_actorInstances.size(); + for (size_t i = 0; i < numActorInstances; ++i) + { + if (!m_actorInstances[i]->GetIsOwnedByRuntime()) + { + return m_actorInstances[i]; + } + } + return nullptr; + } + + const AZStd::vector& ActorManager::GetActorInstanceArray() const { return m_actorInstances; diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/ActorManager.h b/Gems/EMotionFX/Code/EMotionFX/Source/ActorManager.h index 003153b36c..016edb302e 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/ActorManager.h +++ b/Gems/EMotionFX/Code/EMotionFX/Source/ActorManager.h @@ -136,6 +136,12 @@ namespace EMotionFX */ MCORE_INLINE ActorInstance* GetActorInstance(size_t nr) const { return m_actorInstances[nr]; } + /** + * Get a given registered actor instance owned by editor (not owned by runtime). + * @result A pointer to the actor instance. + */ + ActorInstance* GetFirstEditorActorInstance() const; + /** * Get the array of actor instances. * @result The const reference to the actor instance array. diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/MainWindow.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/MainWindow.cpp index b75fb71060..083d6a9be1 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/MainWindow.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/MainWindow.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -1340,8 +1341,15 @@ namespace EMStudio // add the load and the create instance commands commandGroup.AddCommandString(loadActorCommand.c_str()); - commandGroup.AddCommandString("CreateActorInstance -actorID %LASTRESULT%"); + // Temp solution after we refactor / remove the actor manager. + // We only need to create the actor instance by ourselves when openGLRenderPlugin is present. + // Atom render viewport will create actor instance along with the actor component. + PluginManager* pluginManager = GetPluginManager(); + if (pluginManager->FindActivePlugin(static_cast(OpenGLRenderPlugin::CLASS_ID))) + { + commandGroup.AddCommandString("CreateActorInstance -actorID %LASTRESULT%"); + } // execute the group command if (GetCommandManager()->ExecuteCommandGroup(commandGroup, outResult) == false) diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderPlugin.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderPlugin.cpp index 2c9e84c9b9..3451855c86 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderPlugin.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderPlugin.cpp @@ -429,6 +429,7 @@ namespace EMStudio // 3. Relink the actor instances with the emstudio actors const size_t numActorInstances = EMotionFX::GetActorManager().GetNumActorInstances(); + size_t numActorInstancesInRenderPlugin = 0; for (size_t i = 0; i < numActorInstances; ++i) { EMotionFX::ActorInstance* actorInstance = EMotionFX::GetActorManager().GetActorInstance(i); @@ -440,6 +441,12 @@ namespace EMStudio continue; } + if (actorInstance->GetEntity()) + { + continue; + } + + numActorInstancesInRenderPlugin++; if (!emstudioActor) { for (EMStudioRenderActor* currentEMStudioActor : m_actors) @@ -485,6 +492,7 @@ namespace EMStudio if (found == false) { emstudioActor->m_actorInstances.erase(AZStd::next(begin(emstudioActor->m_actorInstances), j)); + numActorInstancesInRenderPlugin--; } else { @@ -497,7 +505,7 @@ namespace EMStudio m_reinitRequested = false; // zoom the camera to the available character only in case we're dealing with a single instance - if (resetViewCloseup && numActorInstances == 1) + if (resetViewCloseup && numActorInstancesInRenderPlugin == 1) { ViewCloseup(false); } diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/Workspace.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/Workspace.cpp index cada8c7f59..c8ee9be995 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/Workspace.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/Workspace.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -430,6 +431,18 @@ namespace EMStudio continue; } + // Temp solution after we refactor / remove the actor manager. + // We only need to create the actor instance by ourselves when openGLRenderPlugin is present. + // Atom render viewport will create actor instance along with the actor component. + PluginManager* pluginManager = GetPluginManager(); + if (!pluginManager->FindActivePlugin(static_cast(OpenGLRenderPlugin::CLASS_ID))) + { + if (commands[i].find("CreateActorInstance") == 0) + { + continue; + } + } + AzFramework::StringFunc::Replace(commands[i], "@products@", assetCacheFolder.c_str()); AzFramework::StringFunc::Replace(commands[i], "@assets@", assetCacheFolder.c_str()); AzFramework::StringFunc::Replace(commands[i], "@root@", assetCacheFolder.c_str()); diff --git a/Gems/EMotionFX/Code/MCore/Source/MCoreCommandManager.cpp b/Gems/EMotionFX/Code/MCore/Source/MCoreCommandManager.cpp index b59f2b69a0..4b21cde9f6 100644 --- a/Gems/EMotionFX/Code/MCore/Source/MCoreCommandManager.cpp +++ b/Gems/EMotionFX/Code/MCore/Source/MCoreCommandManager.cpp @@ -547,7 +547,12 @@ namespace MCore } tmpStr = commandString.substr(lastResultIndex, rightPercentagePos - lastResultIndex + 1); - AzFramework::StringFunc::Replace(commandString, tmpStr.c_str(), intermediateCommandResults[i - relativeIndex].c_str()); + AZStd::string replaceStr = intermediateCommandResults[i - relativeIndex]; + if (replaceStr.empty()) + { + replaceStr = "-1"; + } + AzFramework::StringFunc::Replace(commandString, tmpStr.c_str(), replaceStr.c_str()); replaceHappen = true; // Search again in case the command group is referring to other results From 1d819e25917a41a5f619195c6c1070b07bd83f90 Mon Sep 17 00:00:00 2001 From: amzn-sj Date: Mon, 3 Jan 2022 11:50:49 -0800 Subject: [PATCH 270/948] Fix crash caused by trying to dereference a nullptr Early return if input attachment is null (#6590) Signed-off-by: amzn-sj --- .../Common/Code/Source/CoreLights/EsmShadowmapsPass.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/EsmShadowmapsPass.cpp b/Gems/Atom/Feature/Common/Code/Source/CoreLights/EsmShadowmapsPass.cpp index b92d538fb5..553133aef7 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CoreLights/EsmShadowmapsPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/CoreLights/EsmShadowmapsPass.cpp @@ -101,6 +101,13 @@ namespace AZ void EsmShadowmapsPass::UpdateChildren() { const RPI::PassAttachmentBinding& inputBinding = GetInputBinding(0); + + if (!inputBinding.m_attachment) + { + AZ_Assert(false, "[EsmShadowmapsPass %s] requires an input attachment", GetPathName().GetCStr()); + return; + } + AZ_Assert(inputBinding.m_attachment->m_descriptor.m_type == RHI::AttachmentType::Image, "[EsmShadowmapsPass %s] input attachment requires an image attachment", GetPathName().GetCStr()); m_shadowmapImageSize = inputBinding.m_attachment->m_descriptor.m_image.m_size; m_shadowmapArraySize = inputBinding.m_attachment->m_descriptor.m_image.m_arraySize; From 75476032ab97809e37507e7a1801562bc450efeb Mon Sep 17 00:00:00 2001 From: Junbo Liang <68558268+junbo75@users.noreply.github.com> Date: Mon, 3 Jan 2022 11:59:03 -0800 Subject: [PATCH 271/948] Define AWSI automation tests pipe for Jenkins (#6518) * Define AWSI automation tests pipe for Jenkins Signed-off-by: Junbo Liang <68558268+junbo75@users.noreply.github.com> --- .../build/Platform/Linux/build_config.json | 49 +++++++++++++++ .../Platform/Linux/deploy_cdk_applications.sh | 8 +++ .../Linux/destroy_cdk_applications.sh | 8 +++ scripts/build/Platform/Linux/pipeline.json | 62 +++++++++++++++++++ 4 files changed, 127 insertions(+) diff --git a/scripts/build/Platform/Linux/build_config.json b/scripts/build/Platform/Linux/build_config.json index 5290a32f6d..988cf23703 100644 --- a/scripts/build/Platform/Linux/build_config.json +++ b/scripts/build/Platform/Linux/build_config.json @@ -132,6 +132,35 @@ "ASSET_PROCESSOR_PLATFORMS": "linux,server" } }, + "awsi_test_profile_pipe": { + "TAGS": [ + "nightly-incremental", + "nightly-clean" + ], + "steps": [ + "awsi_deployment", + "awsi_test_profile", + "awsi_destruction" + ] + }, + "awsi_test_profile": { + "TAGS": [ + "weekly-build-metrics" + ], + "PIPELINE_ENV": { + "NONBLOCKING_STEP": "True" + }, + "COMMAND": "build_test_linux.sh", + "PARAMETERS": { + "CONFIGURATION": "profile", + "OUTPUT_DIRECTORY": "build\\linux", + "CMAKE_OPTIONS": "-G 'Ninja Multi-Config' -DLY_PARALLEL_LINK_JOBS=4", + "CMAKE_LY_PROJECTS": "AutomatedTesting", + "CMAKE_TARGET": "TEST_SUITE_awsi", + "CTEST_OPTIONS": "-L \"(SUITE_awsi)\" --no-tests=error", + "TEST_RESULTS": "True" + } + }, "periodic_test_profile": { "TAGS": [ "nightly-incremental", @@ -275,5 +304,25 @@ "CMAKE_OPTIONS": "-G 'Ninja Multi-Config' -DLY_PARALLEL_LINK_JOBS=4 -DCMAKE_MODULE_PATH=${WORKSPACE}/o3de/install/cmake", "CMAKE_TARGET": "all" } + }, + "awsi_deployment": { + "TAGS": [], + "PIPELINE_ENV": { + "NONBLOCKING_STEP": "True" + }, + "COMMAND": "deploy_cdk_applications.sh", + "PARAMETERS": { + "NVM_VERSION": "v0.39.1" + } + }, + "awsi_destruction": { + "TAGS": [], + "PIPELINE_ENV": { + "NONBLOCKING_STEP": "True" + }, + "COMMAND": "destroy_cdk_applications.sh", + "PARAMETERS": { + "NVM_VERSION": "v0.39.1" + } } } diff --git a/scripts/build/Platform/Linux/deploy_cdk_applications.sh b/scripts/build/Platform/Linux/deploy_cdk_applications.sh index 93a3dccd9f..97668ee70c 100755 --- a/scripts/build/Platform/Linux/deploy_cdk_applications.sh +++ b/scripts/build/Platform/Linux/deploy_cdk_applications.sh @@ -61,6 +61,14 @@ then exit 1 fi +echo [cdk_installation] Install nvm $NVM_VERSION +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/$NVM_VERSION/install.sh | bash +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm +[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion +echo [cdk_installation] Install the current version of nodejs +nvm install node + echo [cdk_installation] Install the latest version of CDK if ! sudo npm uninstall -g aws-cdk; then diff --git a/scripts/build/Platform/Linux/destroy_cdk_applications.sh b/scripts/build/Platform/Linux/destroy_cdk_applications.sh index 795ab78484..54f84911a6 100755 --- a/scripts/build/Platform/Linux/destroy_cdk_applications.sh +++ b/scripts/build/Platform/Linux/destroy_cdk_applications.sh @@ -61,6 +61,14 @@ then exit 1 fi +echo [cdk_installation] Install nvm $NVM_VERSION +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/$NVM_VERSION/install.sh | bash +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm +[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion +echo [cdk_installation] Install the current version of nodejs +nvm install node + echo [cdk_installation] Install the latest version of CDK if ! sudo npm uninstall -g aws-cdk; then diff --git a/scripts/build/Platform/Linux/pipeline.json b/scripts/build/Platform/Linux/pipeline.json index f44ed5f9de..d10e2886f2 100644 --- a/scripts/build/Platform/Linux/pipeline.json +++ b/scripts/build/Platform/Linux/pipeline.json @@ -16,5 +16,67 @@ "nightly-clean": { "CLEAN_WORKSPACE": true } + }, + "PIPELINE_JENKINS_PARAMETERS": { + "nightly-incremental": [ + { + "parameter_name": "O3DE_AWS_PROJECT_NAME", + "parameter_type": "string", + "default_value": "", + "use_last_run_value": true, + "description": "The name of the O3DE project that stacks should be deployed for." + }, + { + "parameter_name": "O3DE_AWS_DEPLOY_REGION", + "parameter_type": "string", + "default_value": "", + "use_last_run_value": true, + "description": "The region to deploy the stacks into." + }, + { + "parameter_name": "ASSUME_ROLE_ARN", + "parameter_type": "string", + "default_value": "", + "use_last_run_value": true, + "description": "The ARN of the IAM role to assume to retrieve temporary AWS credentials." + }, + { + "parameter_name": "COMMIT_ID", + "parameter_type": "string", + "default_value": "", + "use_last_run_value": true, + "description": "The commit ID for locking the version of CDK applications to deploy." + } + ], + "nightly-clean": [ + { + "parameter_name": "O3DE_AWS_PROJECT_NAME", + "parameter_type": "string", + "default_value": "", + "use_last_run_value": true, + "description": "The name of the O3DE project that stacks should be deployed for." + }, + { + "parameter_name": "O3DE_AWS_DEPLOY_REGION", + "parameter_type": "string", + "default_value": "", + "use_last_run_value": true, + "description": "The region to deploy the stacks into." + }, + { + "parameter_name": "ASSUME_ROLE_ARN", + "parameter_type": "string", + "default_value": "", + "use_last_run_value": true, + "description": "The ARN of the IAM role to assume to retrieve temporary AWS credentials." + }, + { + "parameter_name": "COMMIT_ID", + "parameter_type": "string", + "default_value": "", + "use_last_run_value": true, + "description": "The commit ID for locking the version of CDK applications to deploy." + } + ] } } From fd9574c6489bcbcb644db6e49ff876b79c72a17b Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Mon, 3 Jan 2022 14:21:44 -0600 Subject: [PATCH 272/948] Removed legacy QtUi/ClickableLabel and re-worked about dialog to use QLabel for terms of use label Signed-off-by: Chris Galvan --- Code/Editor/AboutDialog.cpp | 7 -- Code/Editor/AboutDialog.h | 2 - Code/Editor/AboutDialog.ui | 14 ++- Code/Editor/Lib/Tests/test_ClickableLabel.cpp | 58 ---------- Code/Editor/QtUI/ClickableLabel.cpp | 101 ------------------ Code/Editor/QtUI/ClickableLabel.h | 39 ------- Code/Editor/editor_lib_files.cmake | 2 - Code/Editor/editor_lib_test_files.cmake | 1 - 8 files changed, 6 insertions(+), 218 deletions(-) delete mode 100644 Code/Editor/Lib/Tests/test_ClickableLabel.cpp delete mode 100644 Code/Editor/QtUI/ClickableLabel.cpp delete mode 100644 Code/Editor/QtUI/ClickableLabel.h diff --git a/Code/Editor/AboutDialog.cpp b/Code/Editor/AboutDialog.cpp index c0fd39e1ae..ba086cad5d 100644 --- a/Code/Editor/AboutDialog.cpp +++ b/Code/Editor/AboutDialog.cpp @@ -30,8 +30,6 @@ CAboutDialog::CAboutDialog(QString versionText, QString richTextCopyrightNotice, m_ui->setupUi(this); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); - connect(m_ui->m_transparentAgreement, &QLabel::linkActivated, this, &CAboutDialog::OnCustomerAgreement); - m_ui->m_transparentTrademarks->setText(versionText); m_ui->m_transparentAllRightReserved->setObjectName("copyrightNotice"); @@ -84,9 +82,4 @@ void CAboutDialog::mouseReleaseEvent(QMouseEvent* event) QDialog::mouseReleaseEvent(event); } -void CAboutDialog::OnCustomerAgreement() -{ - QDesktopServices::openUrl(QUrl(QStringLiteral("https://www.o3debinaries.org/license"))); -} - #include diff --git a/Code/Editor/AboutDialog.h b/Code/Editor/AboutDialog.h index db079a6ec7..279d7cd399 100644 --- a/Code/Editor/AboutDialog.h +++ b/Code/Editor/AboutDialog.h @@ -30,8 +30,6 @@ public: private: - void OnCustomerAgreement(); - void mouseReleaseEvent(QMouseEvent* event) override; void paintEvent(QPaintEvent* event) override; diff --git a/Code/Editor/AboutDialog.ui b/Code/Editor/AboutDialog.ui index 09a7c18841..a7433c620f 100644 --- a/Code/Editor/AboutDialog.ui +++ b/Code/Editor/AboutDialog.ui @@ -181,14 +181,17 @@ - + - Terms of Use + <a href="https://www.o3debinaries.org/license">Terms of Use</a> + + + Qt::RichText Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - + true @@ -274,11 +277,6 @@ QWidget
qsvgwidget.h
- - ClickableLabel - QLabel -
QtUI/ClickableLabel.h
-
diff --git a/Code/Editor/Lib/Tests/test_ClickableLabel.cpp b/Code/Editor/Lib/Tests/test_ClickableLabel.cpp deleted file mode 100644 index a676714992..0000000000 --- a/Code/Editor/Lib/Tests/test_ClickableLabel.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#include "EditorDefs.h" -#include -#include -#include - -#include - -using namespace AZ; -using namespace ::testing; - -namespace UnitTest -{ - class TestingClickableLabel - : public ScopedAllocatorSetupFixture - { - public: - ClickableLabel m_clickableLabel; - }; - - TEST_F(TestingClickableLabel, CursorDoesNotUpdateWhileDisabled) - { - m_clickableLabel.setEnabled(false); - - QApplication::setOverrideCursor(QCursor(Qt::BlankCursor)); - QEnterEvent enterEvent{ QPointF(), QPointF(), QPointF() }; - QApplication::sendEvent(&m_clickableLabel, &enterEvent); - - const Qt::CursorShape cursorShape = QApplication::overrideCursor()->shape(); - EXPECT_THAT(cursorShape, Ne(Qt::PointingHandCursor)); - EXPECT_THAT(cursorShape, Eq(Qt::BlankCursor)); - } - - TEST_F(TestingClickableLabel, DoesNotRespondToDblClickWhileDisabled) - { - m_clickableLabel.setEnabled(false); - - bool linkActivated = false; - QObject::connect(&m_clickableLabel, &QLabel::linkActivated, [&linkActivated]() - { - linkActivated = true; - }); - - QMouseEvent mouseEvent { - QEvent::MouseButtonDblClick, QPointF(), - Qt::LeftButton, Qt::LeftButton, Qt::NoModifier }; - QApplication::sendEvent(&m_clickableLabel, &mouseEvent); - - EXPECT_THAT(linkActivated, Eq(false)); - } -} // namespace UnitTest diff --git a/Code/Editor/QtUI/ClickableLabel.cpp b/Code/Editor/QtUI/ClickableLabel.cpp deleted file mode 100644 index b0694e5f18..0000000000 --- a/Code/Editor/QtUI/ClickableLabel.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#include "EditorDefs.h" - -#include "ClickableLabel.h" - - -ClickableLabel::ClickableLabel(const QString& text, QWidget* parent) - : QLabel(parent) - , m_text(text) - , m_showDecoration(false) -{ - setTextFormat(Qt::RichText); - setTextInteractionFlags(Qt::TextBrowserInteraction); -} - -ClickableLabel::ClickableLabel(QWidget* parent) - : QLabel(parent) - , m_showDecoration(false) -{ - setTextFormat(Qt::RichText); - setTextInteractionFlags(Qt::TextBrowserInteraction); -} - -void ClickableLabel::showEvent([[maybe_unused]] QShowEvent* event) -{ - updateFormatting(false); -} - -void ClickableLabel::enterEvent(QEvent* ev) -{ - if (!isEnabled()) - { - return; - } - - updateFormatting(true); - QApplication::setOverrideCursor(QCursor(Qt::PointingHandCursor)); - QLabel::enterEvent(ev); -} - -void ClickableLabel::leaveEvent(QEvent* ev) -{ - if (!isEnabled()) - { - return; - } - - updateFormatting(false); - QApplication::restoreOverrideCursor(); - QLabel::leaveEvent(ev); -} - -void ClickableLabel::setText(const QString& text) -{ - m_text = text; - QLabel::setText(text); - updateFormatting(false); -} - -void ClickableLabel::setShowDecoration(bool b) -{ - m_showDecoration = b; - updateFormatting(false); -} - -void ClickableLabel::updateFormatting(bool mouseOver) -{ - //FIXME: this should be done differently. Using a style sheet would be easiest. - - QColor c = palette().color(QPalette::WindowText); - if (mouseOver || m_showDecoration) - { - QLabel::setText(QString(R"(%2)").arg(c.name(), m_text)); - } - else - { - QLabel::setText(m_text); - } -} - -bool ClickableLabel::event(QEvent* e) -{ - if (isEnabled()) - { - if (e->type() == QEvent::MouseButtonDblClick) - { - emit linkActivated(QString()); - return true; //ignore - } - } - - return QLabel::event(e); -} - -#include diff --git a/Code/Editor/QtUI/ClickableLabel.h b/Code/Editor/QtUI/ClickableLabel.h deleted file mode 100644 index 2b14676eae..0000000000 --- a/Code/Editor/QtUI/ClickableLabel.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#pragma once -#ifndef CRYINCLUDE_EDITORCOMMON_CLICKABLELABEL_H -#define CRYINCLUDE_EDITORCOMMON_CLICKABLELABEL_H - -#if !defined(Q_MOC_RUN) -#include -#endif - -class SANDBOX_API ClickableLabel - : public QLabel -{ - Q_OBJECT -public: - explicit ClickableLabel(const QString& text, QWidget* parent = nullptr); - explicit ClickableLabel(QWidget* parent = nullptr); - bool event(QEvent* e) override; - - void setText(const QString& text); - void setShowDecoration(bool b); - -protected: - void showEvent(QShowEvent* event) override; - void enterEvent(QEvent* ev) override; - void leaveEvent(QEvent* ev) override; - -private: - void updateFormatting(bool mouseOver); - QString m_text; - bool m_showDecoration; -}; - -#endif diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index fa627176d8..78a15123d6 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -526,8 +526,6 @@ set(FILES PythonEditorFuncs.h QtUI/QCollapsibleGroupBox.h QtUI/QCollapsibleGroupBox.cpp - QtUI/ClickableLabel.h - QtUI/ClickableLabel.cpp QtUI/PixmapLabelPreview.h QtUI/PixmapLabelPreview.cpp QtUI/WaitCursor.h diff --git a/Code/Editor/editor_lib_test_files.cmake b/Code/Editor/editor_lib_test_files.cmake index 17f36228db..5b66357c41 100644 --- a/Code/Editor/editor_lib_test_files.cmake +++ b/Code/Editor/editor_lib_test_files.cmake @@ -8,7 +8,6 @@ set(FILES Lib/Tests/IEditorMock.h - Lib/Tests/test_ClickableLabel.cpp Lib/Tests/test_CryEditPythonBindings.cpp Lib/Tests/test_CryEditDocPythonBindings.cpp Lib/Tests/test_EditorPythonBindings.cpp From 6c986657b416b151a4f5a0ea2ff73416b6ab9eb6 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Mon, 3 Jan 2022 13:18:18 -0800 Subject: [PATCH 273/948] Fix for file-save-as-new and open asset (#6490) Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../EditorScriptCanvasComponent.cpp | 2 +- .../Code/Editor/View/Widgets/GraphTabBar.cpp | 2 +- .../Code/Editor/View/Windows/MainWindow.cpp | 37 ++++++++++++------- 3 files changed, 26 insertions(+), 15 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index 0a0dbfc160..750097b428 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -242,7 +242,7 @@ namespace ScriptCanvasEditor SetName(m_sourceHandle.Path().Filename().Native()); } - void EditorScriptCanvasComponent::OpenEditor(const AZ::Data::AssetId&, const AZ::Data::AssetType&) + void EditorScriptCanvasComponent::OpenEditor([[maybe_unused]] const AZ::Data::AssetId& assetId, const AZ::Data::AssetType&) { AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp index c5f808d5f4..0213765737 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/GraphTabBar.cpp @@ -430,7 +430,7 @@ namespace ScriptCanvasEditor void GraphTabBar::UpdateFileState(const ScriptCanvasEditor::SourceHandle& assetId, Tracker::ScriptCanvasFileState fileState) { auto tabData = GetTabData(assetId); - if (tabData && tabData->m_fileState != fileState) + if (tabData && tabData->m_fileState != Tracker::ScriptCanvasFileState::NEW && tabData->m_fileState != fileState) { int index = FindTab(assetId); tabData->m_fileState = fileState; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index f0bee2171a..6222d902da 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -1136,23 +1136,20 @@ namespace ScriptCanvasEditor return AZ::Success(outTabIndex); } - auto loadedGraph = LoadFromFile(fileAssetId.Path().c_str()); - if (!loadedGraph.IsSuccess()) + auto loadedGraphOutcome = LoadFromFile(fileAssetId.Path().c_str()); + if (!loadedGraphOutcome.IsSuccess()) { return AZ::Failure(AZStd::string("Failed to load graph at %s", fileAssetId.Path().c_str())); } - outTabIndex = CreateAssetTab(loadedGraph.GetValue(), fileState); - - if (!m_isRestoringWorkspace) - { - SetActiveAsset(loadedGraph.GetValue()); - } + auto loadedGraph = loadedGraphOutcome.TakeValue(); + CompleteDescriptionInPlace(loadedGraph); + outTabIndex = CreateAssetTab(loadedGraph, fileState); if (outTabIndex >= 0) { - AddRecentFile(loadedGraph.GetValue().Path().c_str()); - OpenScriptCanvasAssetImplementation(loadedGraph.GetValue(), fileState); + AddRecentFile(loadedGraph.Path().c_str()); + OpenScriptCanvasAssetImplementation(loadedGraph, fileState); return AZ::Success(outTabIndex); } else @@ -1169,6 +1166,11 @@ namespace ScriptCanvasEditor return AZ::Failure(AZStd::string("Unable to open asset with invalid asset id")); } + if (!m_isRestoringWorkspace) + { + SetActiveAsset(scriptCanvasAsset); + } + if (!scriptCanvasAsset.IsDescriptionValid()) { if (!m_isRestoringWorkspace) @@ -1345,9 +1347,11 @@ namespace ScriptCanvasEditor AZ::Outcome outcome = LoadFromFile(fullPath); if (!outcome.IsSuccess()) { - QMessageBox::warning(this, "Invalid Source File", QString("'%1' failed to load properly.").arg(fullPath), QMessageBox::Ok); + QMessageBox::warning(this, "Invalid Source File" + , QString("'%1' failed to load properly.\nFailure: %2").arg(fullPath).arg(outcome.GetError().c_str()), QMessageBox::Ok); m_errorFilePath = fullPath; - AZ_Warning("ScriptCanvas", false, "Unable to open file as a ScriptCanvas graph: %s", fullPath); + AZ_Warning("ScriptCanvas", false, "Unable to open file as a ScriptCanvas graph: %s. Failure: %s" + , fullPath, outcome.GetError().c_str()); return; } @@ -1596,7 +1600,14 @@ namespace ScriptCanvasEditor bool MainWindow::OnFileSave() { - return SaveAssetImpl(m_activeGraph, Save::InPlace); + if (auto metaData = m_tabBar->GetTabData(m_activeGraph); metaData && metaData->m_fileState == Tracker::ScriptCanvasFileState::NEW) + { + return SaveAssetImpl(m_activeGraph, Save::As); + } + else + { + return SaveAssetImpl(m_activeGraph, Save::InPlace); + } } bool MainWindow::OnFileSaveAs() From a000198b1bd5e38feb18355b6cdafbea3e85c814 Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Mon, 3 Jan 2022 16:07:31 -0600 Subject: [PATCH 274/948] Add benchmarks to GradientSignal. (#6616) * Add benchmarks to GradientSignal. Cleaned up and rearranged a bit of the unit testing code to make it reusable from a benchmark suite as well. Added set of benchmarks for measuring GetValue(), so that we can compare against GetValues() when it gets added. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Fixed Editor unit tests. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- Gems/GradientSignal/Code/CMakeLists.txt | 6 + .../Code/Include/GradientSignal/ImageAsset.h | 7 + .../EditorGradientSignalPreviewTests.cpp | 4 +- .../Code/Tests/GradientSignalBenchmarks.cpp | 106 +++++++++++++++ .../Code/Tests/GradientSignalImageTests.cpp | 125 +----------------- .../Tests/GradientSignalReferencesTests.cpp | 2 +- .../Tests/GradientSignalServicesTests.cpp | 2 +- .../Code/Tests/GradientSignalSurfaceTests.cpp | 2 +- .../Code/Tests/GradientSignalTest.cpp | 2 +- .../Code/Tests/GradientSignalTestFixtures.cpp | 121 +++++++++++++++++ .../Code/Tests/GradientSignalTestFixtures.h | 124 +++++++++++++++++ .../Code/Tests/GradientSignalTestMocks.cpp | 72 ++++++++++ .../Code/Tests/GradientSignalTestMocks.h | 91 +++++-------- .../Tests/GradientSignalTransformTests.cpp | 2 +- .../gradientsignal_editor_tests_files.cmake | 1 + .../Code/gradientsignal_tests_files.cmake | 4 + 16 files changed, 486 insertions(+), 185 deletions(-) create mode 100644 Gems/GradientSignal/Code/Tests/GradientSignalBenchmarks.cpp create mode 100644 Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.cpp create mode 100644 Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.h create mode 100644 Gems/GradientSignal/Code/Tests/GradientSignalTestMocks.cpp diff --git a/Gems/GradientSignal/Code/CMakeLists.txt b/Gems/GradientSignal/Code/CMakeLists.txt index f5c0457c23..d1ac8cdacf 100644 --- a/Gems/GradientSignal/Code/CMakeLists.txt +++ b/Gems/GradientSignal/Code/CMakeLists.txt @@ -145,6 +145,12 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) NAME Gem::GradientSignal.Tests ) + ly_add_googlebenchmark( + NAME Gem::GradientSignal.Benchmarks + TARGET Gem::GradientSignal.Tests + ) + + if(PAL_TRAIT_BUILD_HOST_TOOLS) ly_add_target( NAME GradientSignal.Editor.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/ImageAsset.h b/Gems/GradientSignal/Code/Include/GradientSignal/ImageAsset.h index f65702c36c..4ffab0b4b4 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/ImageAsset.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/ImageAsset.h @@ -35,6 +35,13 @@ namespace GradientSignal static bool VersionConverter(AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& classElement); + ImageAsset() = default; + + ImageAsset(const AZ::Data::AssetId& assetId, AZ::Data::AssetData::AssetStatus status) + : AssetData(assetId, status) + { + } + AZ::u32 m_imageWidth = 0; AZ::u32 m_imageHeight = 0; AZ::u8 m_bytesPerPixel = 0; diff --git a/Gems/GradientSignal/Code/Tests/EditorGradientSignalPreviewTests.cpp b/Gems/GradientSignal/Code/Tests/EditorGradientSignalPreviewTests.cpp index 7e98aa1361..e8bd9f2dff 100644 --- a/Gems/GradientSignal/Code/Tests/EditorGradientSignalPreviewTests.cpp +++ b/Gems/GradientSignal/Code/Tests/EditorGradientSignalPreviewTests.cpp @@ -6,7 +6,7 @@ * */ -#include "Tests/GradientSignalTestMocks.h" +#include #include #include @@ -28,7 +28,6 @@ namespace UnitTest void SetUp() override { GradientSignalTest::SetUp(); - AZ::AllocatorInstance::Create(); // Set up job manager with two threads so that we can run and test the preview job logic. AZ::JobManagerDesc desc; @@ -46,7 +45,6 @@ namespace UnitTest delete m_jobContext; delete m_jobManager; - AZ::AllocatorInstance::Destroy(); GradientSignalTest::TearDown(); } diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalBenchmarks.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalBenchmarks.cpp new file mode 100644 index 0000000000..e780a5d893 --- /dev/null +++ b/Gems/GradientSignal/Code/Tests/GradientSignalBenchmarks.cpp @@ -0,0 +1,106 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#ifdef HAVE_BENCHMARK + +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +namespace UnitTest +{ + BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_ImageGradientGetValue)(benchmark::State& state) + { + // Create the Image Gradient Component with some default sizes and parameters. + GradientSignal::ImageGradientConfig config; + const uint32_t imageSize = 4096; + const int32_t imageSeed = 12345; + config.m_imageAsset = ImageAssetMockAssetHandler::CreateImageAsset(imageSize, imageSize, imageSeed); + config.m_tilingX = 1.0f; + config.m_tilingY = 1.0f; + CreateComponent(m_testEntity.get(), config); + + // Create the Gradient Transform Component with some default parameters. + GradientSignal::GradientTransformConfig gradientTransformConfig; + gradientTransformConfig.m_wrappingType = GradientSignal::WrappingType::None; + CreateComponent(m_testEntity.get(), gradientTransformConfig); + + // Run the benchmark + RunGetValueBenchmark(state); + } + + BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_ImageGradientGetValue) + ->Args({ 1024, 1024 }) + ->Args({ 2048, 2048 }) + ->Args({ 4096, 4096 }) + ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_PerlinGradientGetValue)(benchmark::State& state) + { + // Create the Perlin Gradient Component with some default sizes and parameters. + GradientSignal::PerlinGradientConfig config; + config.m_amplitude = 1.0f; + config.m_frequency = 1.1f; + config.m_octave = 4; + config.m_randomSeed = 12345; + CreateComponent(m_testEntity.get(), config); + + // Create the Gradient Transform Component with some default parameters. + GradientSignal::GradientTransformConfig gradientTransformConfig; + gradientTransformConfig.m_wrappingType = GradientSignal::WrappingType::None; + CreateComponent(m_testEntity.get(), gradientTransformConfig); + + // Run the benchmark + RunGetValueBenchmark(state); + } + + BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_PerlinGradientGetValue) + ->Args({ 1024, 1024 }) + ->Args({ 2048, 2048 }) + ->Args({ 4096, 4096 }) + ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_RandomGradientGetValue)(benchmark::State& state) + { + // Create the Random Gradient Component with some default parameters. + GradientSignal::RandomGradientConfig config; + config.m_randomSeed = 12345; + CreateComponent(m_testEntity.get(), config); + + // Create the Gradient Transform Component with some default parameters. + GradientSignal::GradientTransformConfig gradientTransformConfig; + gradientTransformConfig.m_wrappingType = GradientSignal::WrappingType::None; + CreateComponent(m_testEntity.get(), gradientTransformConfig); + + // Run the benchmark + RunGetValueBenchmark(state); + } + + BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_RandomGradientGetValue) + ->Args({ 1024, 1024 }) + ->Args({ 2048, 2048 }) + ->Args({ 4096, 4096 }) + ->Unit(::benchmark::kMillisecond); + +#endif + + + + +} + + diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalImageTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalImageTests.cpp index 4c22afac76..fa30132836 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalImageTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalImageTests.cpp @@ -7,7 +7,7 @@ */ -#include "Tests/GradientSignalTestMocks.h" +#include #include #include @@ -23,69 +23,6 @@ namespace UnitTest struct GradientSignalImageTestsFixture : public GradientSignalTest { - struct MockAssetHandler - : public AZ::Data::AssetHandler - { - AZ::Data::AssetPtr CreateAsset([[maybe_unused]] const AZ::Data::AssetId& id, [[maybe_unused]] const AZ::Data::AssetType& type) override - { - return AZ::Data::AssetPtr(); - } - - void DestroyAsset(AZ::Data::AssetPtr ptr) override - { - if (ptr) - { - delete ptr; - } - } - - void GetHandledAssetTypes([[maybe_unused]] AZStd::vector& assetTypes) override - { - } - - AZ::Data::AssetHandler::LoadResult LoadAssetData( - [[maybe_unused]] const AZ::Data::Asset& asset, - [[maybe_unused]] AZStd::shared_ptr stream, - [[maybe_unused]] const AZ::Data::AssetFilterCB& assetLoadFilterCB) override - { - return AZ::Data::AssetHandler::LoadResult::LoadComplete; - } - - }; - - MockAssetHandler* m_mockHandler = nullptr; - GradientSignal::ImageAsset* m_imageData = nullptr; - - void SetUp() override - { - GradientSignalTest::SetUp(); - AZ::AllocatorInstance::Create(); - AZ::Data::AssetManager::Descriptor desc; - AZ::Data::AssetManager::Create(desc); - m_mockHandler = new MockAssetHandler(); - AZ::Data::AssetManager::Instance().RegisterHandler(m_mockHandler, azrtti_typeid()); - } - - void TearDown() override - { - AZ::Data::AssetManager::Instance().UnregisterHandler(m_mockHandler); - delete m_mockHandler; // delete after removing from the asset manager - AzFramework::LegacyAssetEventBus::ClearQueuedEvents(); - AZ::Data::AssetManager::Destroy(); - AZ::AllocatorInstance::Destroy(); - GradientSignalTest::TearDown(); - } - - struct AssignIdToAsset - : public AZ::Data::AssetData - { - void MakeReady() - { - m_assetId = AZ::Data::AssetId(AZ::Uuid::CreateRandom()); - m_status.store(AZ::Data::AssetData::AssetStatus::Ready); - } - }; - struct PixelTestSetup { // How to create the source image @@ -105,61 +42,6 @@ namespace UnitTest static const AZ::Vector2 EndOfList; }; - AZ::Data::Asset CreateImageAsset(AZ::u32 width, AZ::u32 height, AZ::s32 seed) - { - m_imageData = aznew GradientSignal::ImageAsset(); - m_imageData->m_imageWidth = width; - m_imageData->m_imageHeight = height; - m_imageData->m_bytesPerPixel = 1; - m_imageData->m_imageFormat = ImageProcessingAtom::EPixelFormat::ePixelFormat_R8; - - size_t value = 0; - AZStd::hash_combine(value, seed); - - for (AZ::u32 x = 0; x < width; ++x) - { - for (AZ::u32 y = 0; y < height; ++y) - { - AZStd::hash_combine(value, x); - AZStd::hash_combine(value, y); - m_imageData->m_imageData.push_back(static_cast(value)); - } - } - - reinterpret_cast(m_imageData)->MakeReady(); - return AZ::Data::Asset(m_imageData, AZ::Data::AssetLoadBehavior::Default); - } - - AZ::Data::Asset CreateSpecificPixelImageAsset(AZ::u32 width, AZ::u32 height, AZ::u32 pixelX, AZ::u32 pixelY) - { - m_imageData = aznew GradientSignal::ImageAsset(); - m_imageData->m_imageWidth = width; - m_imageData->m_imageHeight = height; - m_imageData->m_bytesPerPixel = 1; - m_imageData->m_imageFormat = ImageProcessingAtom::EPixelFormat::ePixelFormat_R8; - - const AZ::u8 pixelValue = 255; - - // Image data should be stored inverted on the y axis relative to our engine, so loop backwards through y. - for (int y = static_cast(height) - 1; y >= 0; --y) - { - for (AZ::u32 x = 0; x < width; ++x) - { - if ((x == static_cast(pixelX)) && (y == static_cast(pixelY))) - { - m_imageData->m_imageData.push_back(pixelValue); - } - else - { - m_imageData->m_imageData.push_back(0); - } - } - } - - reinterpret_cast(m_imageData)->MakeReady(); - return AZ::Data::Asset(m_imageData, AZ::Data::AssetLoadBehavior::Default); - } - void TestPixels(GradientSignal::GradientSampler& sampler, AZ::u32 width, AZ::u32 height, float stepSize, const AZStd::vector& expectedPoints) { AZStd::vector foundPoints; @@ -203,7 +85,8 @@ namespace UnitTest // Create the Image Gradient Component. GradientSignal::ImageGradientConfig config; - config.m_imageAsset = CreateSpecificPixelImageAsset(test.m_imageSize, test.m_imageSize, static_cast(test.m_pixel.GetX()), static_cast(test.m_pixel.GetY())); + config.m_imageAsset = ImageAssetMockAssetHandler::CreateSpecificPixelImageAsset( + test.m_imageSize, test.m_imageSize, static_cast(test.m_pixel.GetX()), static_cast(test.m_pixel.GetY())); config.m_tilingX = test.m_tiling; config.m_tilingY = test.m_tiling; CreateComponent(entity.get(), config); @@ -495,7 +378,7 @@ namespace UnitTest // Create an ImageGradient with a 3x3 asset with the center pixel set. GradientSignal::ImageGradientConfig gradientConfig; - gradientConfig.m_imageAsset = CreateSpecificPixelImageAsset(3, 3, 1, 1); + gradientConfig.m_imageAsset = ImageAssetMockAssetHandler::CreateSpecificPixelImageAsset(3, 3, 1, 1); CreateComponent(entity.get(), gradientConfig); // Create the test GradientTransform diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalReferencesTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalReferencesTests.cpp index 25a1aa28bb..ec22fbc1ec 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalReferencesTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalReferencesTests.cpp @@ -10,7 +10,7 @@ #include #include #include -#include "Tests/GradientSignalTestMocks.h" +#include #include #include diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp index b8c0f85cf3..dc11d21b11 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp @@ -6,7 +6,7 @@ * */ -#include "Tests/GradientSignalTestMocks.h" +#include #include diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalSurfaceTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalSurfaceTests.cpp index 809bbf2fe6..a0c8f5cf50 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalSurfaceTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalSurfaceTests.cpp @@ -9,7 +9,7 @@ #include #include #include -#include "Tests/GradientSignalTestMocks.h" +#include #include #include diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalTest.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalTest.cpp index 78aa4f1ac5..84b2daab84 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalTest.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalTest.cpp @@ -7,7 +7,7 @@ */ -#include "Tests/GradientSignalTestMocks.h" +#include #include #include diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.cpp new file mode 100644 index 0000000000..bc9b39aae8 --- /dev/null +++ b/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.cpp @@ -0,0 +1,121 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * 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 UnitTest +{ + void GradientSignalBaseFixture::SetupCoreSystems() + { + m_app = AZStd::make_unique(); + ASSERT_TRUE(m_app != nullptr); + + AZ::ComponentApplication::Descriptor componentAppDesc; + + m_systemEntity = m_app->Create(componentAppDesc); + ASSERT_TRUE(m_systemEntity != nullptr); + m_app->AddEntity(m_systemEntity); + + AZ::AllocatorInstance::Create(); + AZ::Data::AssetManager::Descriptor desc; + AZ::Data::AssetManager::Create(desc); + m_mockHandler = new ImageAssetMockAssetHandler(); + AZ::Data::AssetManager::Instance().RegisterHandler(m_mockHandler, azrtti_typeid()); + } + + void GradientSignalBaseFixture::TearDownCoreSystems() + { + AZ::Data::AssetManager::Instance().UnregisterHandler(m_mockHandler); + delete m_mockHandler; // delete after removing from the asset manager + AzFramework::LegacyAssetEventBus::ClearQueuedEvents(); + AZ::Data::AssetManager::Destroy(); + AZ::AllocatorInstance::Destroy(); + + m_app->Destroy(); + m_app.reset(); + m_systemEntity = nullptr; + } + + void GradientSignalTest::TestFixedDataSampler(const AZStd::vector& expectedOutput, int size, AZ::EntityId gradientEntityId) + { + GradientSignal::GradientSampler gradientSampler; + gradientSampler.m_gradientId = gradientEntityId; + + for (int y = 0; y < size; ++y) + { + for (int x = 0; x < size; ++x) + { + GradientSignal::GradientSampleParams params; + params.m_position = AZ::Vector3(static_cast(x), static_cast(y), 0.0f); + + const int index = y * size + x; + float actualValue = gradientSampler.GetValue(params); + float expectedValue = expectedOutput[index]; + + EXPECT_NEAR(actualValue, expectedValue, 0.01f); + } + } + } + +#ifdef HAVE_BENCHMARK + void GradientSignalBenchmarkFixture::CreateTestEntity(float shapeHalfBounds) + { + // Create the base entity + m_testEntity = CreateEntity(); + + // Create a mock Shape component that describes the bounds that we're using to map our gradient into world space. + CreateComponent(m_testEntity.get()); + MockShapeComponentHandler mockShapeHandler(m_testEntity->GetId()); + mockShapeHandler.m_GetLocalBounds = AZ::Aabb::CreateCenterRadius(AZ::Vector3(shapeHalfBounds), shapeHalfBounds); + + // Create a mock Transform component that locates our gradient in the center of our desired mock Shape. + MockTransformHandler mockTransformHandler; + mockTransformHandler.m_GetLocalTMOutput = AZ::Transform::CreateTranslation(AZ::Vector3(shapeHalfBounds)); + mockTransformHandler.m_GetWorldTMOutput = AZ::Transform::CreateTranslation(AZ::Vector3(shapeHalfBounds)); + mockTransformHandler.BusConnect(m_testEntity->GetId()); + } + + void GradientSignalBenchmarkFixture::DestroyTestEntity() + { + m_testEntity.reset(); + } + + void GradientSignalBenchmarkFixture::RunGetValueBenchmark(benchmark::State& state) + { + // All components are created, so activate the entity + ActivateEntity(m_testEntity.get()); + + // Create a gradient sampler and run through a series of points to see if they match expectations. + GradientSignal::GradientSampler gradientSampler; + gradientSampler.m_gradientId = m_testEntity->GetId(); + + // Get the height and width ranges for querying from our benchmark parameters + float height = aznumeric_cast(state.range(0)); + float width = aznumeric_cast(state.range(1)); + + // Call GetValue() for every height and width in our ranges. + for (auto _ : state) + { + for (float y = 0.0f; y < height; y += 1.0f) + { + for (float x = 0.0f; x < width; x += 1.0f) + { + GradientSignal::GradientSampleParams params; + params.m_position = AZ::Vector3(x, y, 0.0f); + float value = gradientSampler.GetValue(params); + benchmark::DoNotOptimize(value); + } + } + } + } + +#endif + +} + diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.h b/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.h new file mode 100644 index 0000000000..5e05cba374 --- /dev/null +++ b/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.h @@ -0,0 +1,124 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ +#pragma once + +#include + +namespace UnitTest +{ + // Base test fixture used for GradientSignal unit tests and benchmark tests + class GradientSignalBaseFixture + { + public: + void SetupCoreSystems(); + void TearDownCoreSystems(); + + AZStd::unique_ptr CreateEntity() + { + return AZStd::make_unique(); + } + + void ActivateEntity(AZ::Entity* entity) + { + entity->Init(); + entity->Activate(); + } + + template + AZ::Component* CreateComponent(AZ::Entity* entity, const Configuration& config) + { + m_app->RegisterComponentDescriptor(Component::CreateDescriptor()); + return entity->CreateComponent(config); + } + + template + AZ::Component* CreateComponent(AZ::Entity* entity) + { + m_app->RegisterComponentDescriptor(Component::CreateDescriptor()); + return entity->CreateComponent(); + } + + AZStd::unique_ptr m_app; + AZ::Entity* m_systemEntity = nullptr; + ImageAssetMockAssetHandler* m_mockHandler = nullptr; + }; + + struct GradientSignalTest + : public GradientSignalBaseFixture + , public UnitTest::AllocatorsTestFixture + { + protected: + void SetUp() override + { + UnitTest::AllocatorsTestFixture::SetUp(); + SetupCoreSystems(); + } + + void TearDown() override + { + TearDownCoreSystems(); + UnitTest::AllocatorsTestFixture::TearDown(); + } + + void TestFixedDataSampler(const AZStd::vector& expectedOutput, int size, AZ::EntityId gradientEntityId); + }; + +#ifdef HAVE_BENCHMARK + class GradientSignalBenchmarkFixture + : public GradientSignalBaseFixture + , public UnitTest::AllocatorsBenchmarkFixture + , public UnitTest::TraceBusRedirector + { + public: + void internalSetUp(const benchmark::State& state) + { + AZ::Debug::TraceMessageBus::Handler::BusConnect(); + UnitTest::AllocatorsBenchmarkFixture::SetUp(state); + SetupCoreSystems(); + + // Create a default test entity with bounds of 256 m x 256 m x 256 m. + const float shapeHalfBounds = 128.0f; + CreateTestEntity(shapeHalfBounds); + } + + void internalTearDown(const benchmark::State& state) + { + DestroyTestEntity(); + TearDownCoreSystems(); + UnitTest::AllocatorsBenchmarkFixture::TearDown(state); + AZ::Debug::TraceMessageBus::Handler::BusDisconnect(); + } + + void CreateTestEntity(float shapeHalfBounds); + void DestroyTestEntity(); + + void RunGetValueBenchmark(benchmark::State& state); + + protected: + void SetUp(const benchmark::State& state) override + { + internalSetUp(state); + } + void SetUp(benchmark::State& state) override + { + internalSetUp(state); + } + + void TearDown(const benchmark::State& state) override + { + internalTearDown(state); + } + void TearDown(benchmark::State& state) override + { + internalTearDown(state); + } + + AZStd::unique_ptr m_testEntity; + }; +#endif +} diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalTestMocks.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalTestMocks.cpp new file mode 100644 index 0000000000..ccbe17dee8 --- /dev/null +++ b/Gems/GradientSignal/Code/Tests/GradientSignalTestMocks.cpp @@ -0,0 +1,72 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * 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 UnitTest +{ + AZ::Data::Asset ImageAssetMockAssetHandler::CreateImageAsset(AZ::u32 width, AZ::u32 height, AZ::s32 seed) + { + GradientSignal::ImageAsset* imageData = + aznew GradientSignal::ImageAsset(AZ::Data::AssetId(AZ::Uuid::CreateRandom()), AZ::Data::AssetData::AssetStatus::Ready); + imageData->m_imageWidth = width; + imageData->m_imageHeight = height; + imageData->m_bytesPerPixel = 1; + imageData->m_imageFormat = ImageProcessingAtom::EPixelFormat::ePixelFormat_R8; + imageData->m_imageData.reserve(width * height); + + size_t value = 0; + AZStd::hash_combine(value, seed); + + for (AZ::u32 x = 0; x < width; ++x) + { + for (AZ::u32 y = 0; y < height; ++y) + { + AZStd::hash_combine(value, x); + AZStd::hash_combine(value, y); + imageData->m_imageData.push_back(static_cast(value)); + } + } + + return AZ::Data::Asset(imageData, AZ::Data::AssetLoadBehavior::Default); + } + + AZ::Data::Asset ImageAssetMockAssetHandler::CreateSpecificPixelImageAsset( + AZ::u32 width, AZ::u32 height, AZ::u32 pixelX, AZ::u32 pixelY) + { + GradientSignal::ImageAsset* imageData = + aznew GradientSignal::ImageAsset(AZ::Data::AssetId(AZ::Uuid::CreateRandom()), AZ::Data::AssetData::AssetStatus::Ready); + imageData->m_imageWidth = width; + imageData->m_imageHeight = height; + imageData->m_bytesPerPixel = 1; + imageData->m_imageFormat = ImageProcessingAtom::EPixelFormat::ePixelFormat_R8; + imageData->m_imageData.reserve(width * height); + + const AZ::u8 pixelValue = 255; + + // Image data should be stored inverted on the y axis relative to our engine, so loop backwards through y. + for (int y = static_cast(height) - 1; y >= 0; --y) + { + for (AZ::u32 x = 0; x < width; ++x) + { + if ((x == static_cast(pixelX)) && (y == static_cast(pixelY))) + { + imageData->m_imageData.push_back(pixelValue); + } + else + { + imageData->m_imageData.push_back(0); + } + } + } + + return AZ::Data::Asset(imageData, AZ::Data::AssetLoadBehavior::Default); + } +} + diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalTestMocks.h b/Gems/GradientSignal/Code/Tests/GradientSignalTestMocks.h index 9c0d8be588..1d83a5eb55 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalTestMocks.h +++ b/Gems/GradientSignal/Code/Tests/GradientSignalTestMocks.h @@ -8,90 +8,69 @@ #pragma once #include -#include +#include +#include #include #include #include +#include +#include +#include #include #include #include +#include #include #include -#include - #include namespace UnitTest { - struct GradientSignalTest - : public ::testing::Test + // Mock asset handler for GradientSignal::ImageAsset that we can use in unit tests to pretend to load an image asset with. + // Also includes utility functions for creating image assets with specific testable patterns. + struct ImageAssetMockAssetHandler : public AZ::Data::AssetHandler { - protected: - AZ::ComponentApplication m_app; - AZ::Entity* m_systemEntity = nullptr; + //! Creates a deterministically random set of pixel data as an ImageAsset. + //! \param width The width of the ImageAsset + //! \param height The height of the ImageAsset + //! \param seed The random seed to use for generating the random data + //! \return The ImageAsset in a loaded ready state + static AZ::Data::Asset CreateImageAsset(AZ::u32 width, AZ::u32 height, AZ::s32 seed); - void SetUp() override - { - AZ::ComponentApplication::Descriptor appDesc; - appDesc.m_memoryBlocksByteSize = 128 * 1024 * 1024; - m_systemEntity = m_app.Create(appDesc); - m_app.AddEntity(m_systemEntity); - } + //! Creates an ImageAsset where all the pixels are 0 except for the one pixel at the given coordinates, which is set to 1. + //! \param width The width of the ImageAsset + //! \param height The height of the ImageAsset + //! \param pixelX The X coordinate of the pixel to set to 1 + //! \param pixelY The Y coordinate of the pixel to set to 1 + //! \return The ImageAsset in a loaded ready state + static AZ::Data::Asset CreateSpecificPixelImageAsset( + AZ::u32 width, AZ::u32 height, AZ::u32 pixelX, AZ::u32 pixelY); - void TearDown() override + AZ::Data::AssetPtr CreateAsset( + [[maybe_unused]] const AZ::Data::AssetId& id, [[maybe_unused]] const AZ::Data::AssetType& type) override { - m_app.Destroy(); - m_systemEntity = nullptr; + return AZ::Data::AssetPtr(); } - void TestFixedDataSampler(const AZStd::vector& expectedOutput, int size, AZ::EntityId gradientEntityId) + void DestroyAsset(AZ::Data::AssetPtr ptr) override { - GradientSignal::GradientSampler gradientSampler; - gradientSampler.m_gradientId = gradientEntityId; - - for(int y = 0; y < size; ++y) + if (ptr) { - for (int x = 0; x < size; ++x) - { - GradientSignal::GradientSampleParams params; - params.m_position = AZ::Vector3(static_cast(x), static_cast(y), 0.0f); - - const int index = y * size + x; - float actualValue = gradientSampler.GetValue(params); - float expectedValue = expectedOutput[index]; - - EXPECT_NEAR(actualValue, expectedValue, 0.01f); - } + delete ptr; } } - AZStd::unique_ptr CreateEntity() - { - return AZStd::make_unique(); - } - - void ActivateEntity(AZ::Entity* entity) - { - entity->Init(); - EXPECT_EQ(AZ::Entity::State::Init, entity->GetState()); - - entity->Activate(); - EXPECT_EQ(AZ::Entity::State::Active, entity->GetState()); - } - - template - AZ::Component* CreateComponent(AZ::Entity* entity, const Configuration& config) + void GetHandledAssetTypes([[maybe_unused]] AZStd::vector& assetTypes) override { - m_app.RegisterComponentDescriptor(Component::CreateDescriptor()); - return entity->CreateComponent(config); } - template - AZ::Component* CreateComponent(AZ::Entity* entity) + AZ::Data::AssetHandler::LoadResult LoadAssetData( + [[maybe_unused]] const AZ::Data::Asset& asset, + [[maybe_unused]] AZStd::shared_ptr stream, + [[maybe_unused]] const AZ::Data::AssetFilterCB& assetLoadFilterCB) override { - m_app.RegisterComponentDescriptor(Component::CreateDescriptor()); - return entity->CreateComponent(); + return AZ::Data::AssetHandler::LoadResult::LoadComplete; } }; diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalTransformTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalTransformTests.cpp index 73dabf1d6a..ddebc0ce1f 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalTransformTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalTransformTests.cpp @@ -7,7 +7,7 @@ */ -#include "Tests/GradientSignalTestMocks.h" +#include #include #include diff --git a/Gems/GradientSignal/Code/gradientsignal_editor_tests_files.cmake b/Gems/GradientSignal/Code/gradientsignal_editor_tests_files.cmake index 5a3a75602b..8172591afa 100644 --- a/Gems/GradientSignal/Code/gradientsignal_editor_tests_files.cmake +++ b/Gems/GradientSignal/Code/gradientsignal_editor_tests_files.cmake @@ -7,5 +7,6 @@ # set(FILES + Tests/GradientSignalTestFixtures.cpp Tests/EditorGradientSignalPreviewTests.cpp ) diff --git a/Gems/GradientSignal/Code/gradientsignal_tests_files.cmake b/Gems/GradientSignal/Code/gradientsignal_tests_files.cmake index 5f8ffe2ebb..8e081e5711 100644 --- a/Gems/GradientSignal/Code/gradientsignal_tests_files.cmake +++ b/Gems/GradientSignal/Code/gradientsignal_tests_files.cmake @@ -7,11 +7,15 @@ # set(FILES + Tests/GradientSignalBenchmarks.cpp Tests/GradientSignalImageTests.cpp Tests/GradientSignalReferencesTests.cpp Tests/GradientSignalServicesTests.cpp Tests/GradientSignalSurfaceTests.cpp Tests/GradientSignalTransformTests.cpp + Tests/GradientSignalTestFixtures.cpp + Tests/GradientSignalTestFixtures.h + Tests/GradientSignalTestMocks.cpp Tests/GradientSignalTestMocks.h Tests/GradientSignalTest.cpp Tests/ImageAssetTests.cpp From b0af08e61fd213865314abb4c4b450f0ddb8c742 Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Mon, 3 Jan 2022 16:12:15 -0600 Subject: [PATCH 275/948] Moved GradientSignal component headers to Include directory. All of the component headers in the gem have been moved to the Include directory to make them public to other gems. This allows "upstream" unit tests and benchmarks to easily create real non-mocked-out versions of these components to do more integration-level and system-level testing and benchmarking. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- .../Components/ConstantGradientComponent.h | 0 .../Components/DitherGradientComponent.h | 0 .../Components/GradientSurfaceDataComponent.h | 0 .../Components/GradientTransformComponent.h | 0 .../Components/ImageGradientComponent.h | 0 .../Components/InvertGradientComponent.h | 0 .../Components/LevelsGradientComponent.h | 0 .../Components/MixedGradientComponent.h | 0 .../Components/PerlinGradientComponent.h | 0 .../Components/PosterizeGradientComponent.h | 0 .../Components/RandomGradientComponent.h | 0 .../Components/ReferenceGradientComponent.h | 0 .../ShapeAreaFalloffGradientComponent.h | 0 .../Components/SmoothStepGradientComponent.h | 0 .../SurfaceAltitudeGradientComponent.h | 0 .../Components/SurfaceMaskGradientComponent.h | 0 .../SurfaceSlopeGradientComponent.h | 0 .../Components/ThresholdGradientComponent.h | 0 .../Components/ConstantGradientComponent.cpp | 2 +- .../Components/DitherGradientComponent.cpp | 2 +- .../GradientSurfaceDataComponent.cpp | 2 +- .../Components/GradientTransformComponent.cpp | 2 +- .../Components/ImageGradientComponent.cpp | 2 +- .../Components/InvertGradientComponent.cpp | 2 +- .../Components/LevelsGradientComponent.cpp | 2 +- .../Components/MixedGradientComponent.cpp | 2 +- .../Components/PerlinGradientComponent.cpp | 2 +- .../Components/PosterizeGradientComponent.cpp | 2 +- .../Components/RandomGradientComponent.cpp | 2 +- .../Components/ReferenceGradientComponent.cpp | 2 +- .../ShapeAreaFalloffGradientComponent.cpp | 2 +- .../SmoothStepGradientComponent.cpp | 2 +- .../SurfaceAltitudeGradientComponent.cpp | 2 +- .../SurfaceMaskGradientComponent.cpp | 2 +- .../SurfaceSlopeGradientComponent.cpp | 2 +- .../Components/ThresholdGradientComponent.cpp | 2 +- .../Editor/EditorConstantGradientComponent.h | 2 +- .../Editor/EditorDitherGradientComponent.h | 2 +- .../EditorGradientSurfaceDataComponent.h | 2 +- .../Editor/EditorGradientTransformComponent.h | 2 +- .../Editor/EditorImageGradientComponent.h | 2 +- .../Editor/EditorInvertGradientComponent.h | 2 +- .../Editor/EditorLevelsGradientComponent.h | 2 +- .../Editor/EditorMixedGradientComponent.h | 2 +- .../Editor/EditorPerlinGradientComponent.h | 2 +- .../Editor/EditorPosterizeGradientComponent.h | 2 +- .../Editor/EditorRandomGradientComponent.h | 2 +- .../Editor/EditorReferenceGradientComponent.h | 2 +- .../EditorShapeAreaFalloffGradientComponent.h | 2 +- .../EditorSmoothStepGradientComponent.h | 2 +- .../EditorSurfaceAltitudeGradientComponent.h | 2 +- .../EditorSurfaceMaskGradientComponent.h | 2 +- .../EditorSurfaceSlopeGradientComponent.h | 2 +- .../Editor/EditorThresholdGradientComponent.h | 2 +- .../Code/Source/GradientSignalModule.cpp | 36 +++++++++---------- .../Code/Tests/GradientSignalBenchmarks.cpp | 8 ++--- .../Code/Tests/GradientSignalImageTests.cpp | 4 +-- .../Tests/GradientSignalReferencesTests.cpp | 20 +++++------ .../Tests/GradientSignalServicesTests.cpp | 6 ++-- .../Code/Tests/GradientSignalSurfaceTests.cpp | 4 +-- .../Code/Tests/GradientSignalTest.cpp | 14 ++++---- .../Tests/GradientSignalTransformTests.cpp | 2 +- .../Code/gradientsignal_files.cmake | 36 +++++++++---------- 63 files changed, 101 insertions(+), 101 deletions(-) rename Gems/GradientSignal/Code/{Source => Include/GradientSignal}/Components/ConstantGradientComponent.h (100%) rename Gems/GradientSignal/Code/{Source => Include/GradientSignal}/Components/DitherGradientComponent.h (100%) rename Gems/GradientSignal/Code/{Source => Include/GradientSignal}/Components/GradientSurfaceDataComponent.h (100%) rename Gems/GradientSignal/Code/{Source => Include/GradientSignal}/Components/GradientTransformComponent.h (100%) rename Gems/GradientSignal/Code/{Source => Include/GradientSignal}/Components/ImageGradientComponent.h (100%) rename Gems/GradientSignal/Code/{Source => Include/GradientSignal}/Components/InvertGradientComponent.h (100%) rename Gems/GradientSignal/Code/{Source => Include/GradientSignal}/Components/LevelsGradientComponent.h (100%) rename Gems/GradientSignal/Code/{Source => Include/GradientSignal}/Components/MixedGradientComponent.h (100%) rename Gems/GradientSignal/Code/{Source => Include/GradientSignal}/Components/PerlinGradientComponent.h (100%) rename Gems/GradientSignal/Code/{Source => Include/GradientSignal}/Components/PosterizeGradientComponent.h (100%) rename Gems/GradientSignal/Code/{Source => Include/GradientSignal}/Components/RandomGradientComponent.h (100%) rename Gems/GradientSignal/Code/{Source => Include/GradientSignal}/Components/ReferenceGradientComponent.h (100%) rename Gems/GradientSignal/Code/{Source => Include/GradientSignal}/Components/ShapeAreaFalloffGradientComponent.h (100%) rename Gems/GradientSignal/Code/{Source => Include/GradientSignal}/Components/SmoothStepGradientComponent.h (100%) rename Gems/GradientSignal/Code/{Source => Include/GradientSignal}/Components/SurfaceAltitudeGradientComponent.h (100%) rename Gems/GradientSignal/Code/{Source => Include/GradientSignal}/Components/SurfaceMaskGradientComponent.h (100%) rename Gems/GradientSignal/Code/{Source => Include/GradientSignal}/Components/SurfaceSlopeGradientComponent.h (100%) rename Gems/GradientSignal/Code/{Source => Include/GradientSignal}/Components/ThresholdGradientComponent.h (100%) diff --git a/Gems/GradientSignal/Code/Source/Components/ConstantGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ConstantGradientComponent.h similarity index 100% rename from Gems/GradientSignal/Code/Source/Components/ConstantGradientComponent.h rename to Gems/GradientSignal/Code/Include/GradientSignal/Components/ConstantGradientComponent.h diff --git a/Gems/GradientSignal/Code/Source/Components/DitherGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/DitherGradientComponent.h similarity index 100% rename from Gems/GradientSignal/Code/Source/Components/DitherGradientComponent.h rename to Gems/GradientSignal/Code/Include/GradientSignal/Components/DitherGradientComponent.h diff --git a/Gems/GradientSignal/Code/Source/Components/GradientSurfaceDataComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/GradientSurfaceDataComponent.h similarity index 100% rename from Gems/GradientSignal/Code/Source/Components/GradientSurfaceDataComponent.h rename to Gems/GradientSignal/Code/Include/GradientSignal/Components/GradientSurfaceDataComponent.h diff --git a/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/GradientTransformComponent.h similarity index 100% rename from Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.h rename to Gems/GradientSignal/Code/Include/GradientSignal/Components/GradientTransformComponent.h diff --git a/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h similarity index 100% rename from Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.h rename to Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h diff --git a/Gems/GradientSignal/Code/Source/Components/InvertGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/InvertGradientComponent.h similarity index 100% rename from Gems/GradientSignal/Code/Source/Components/InvertGradientComponent.h rename to Gems/GradientSignal/Code/Include/GradientSignal/Components/InvertGradientComponent.h diff --git a/Gems/GradientSignal/Code/Source/Components/LevelsGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/LevelsGradientComponent.h similarity index 100% rename from Gems/GradientSignal/Code/Source/Components/LevelsGradientComponent.h rename to Gems/GradientSignal/Code/Include/GradientSignal/Components/LevelsGradientComponent.h diff --git a/Gems/GradientSignal/Code/Source/Components/MixedGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/MixedGradientComponent.h similarity index 100% rename from Gems/GradientSignal/Code/Source/Components/MixedGradientComponent.h rename to Gems/GradientSignal/Code/Include/GradientSignal/Components/MixedGradientComponent.h diff --git a/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/PerlinGradientComponent.h similarity index 100% rename from Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.h rename to Gems/GradientSignal/Code/Include/GradientSignal/Components/PerlinGradientComponent.h diff --git a/Gems/GradientSignal/Code/Source/Components/PosterizeGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/PosterizeGradientComponent.h similarity index 100% rename from Gems/GradientSignal/Code/Source/Components/PosterizeGradientComponent.h rename to Gems/GradientSignal/Code/Include/GradientSignal/Components/PosterizeGradientComponent.h diff --git a/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/RandomGradientComponent.h similarity index 100% rename from Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.h rename to Gems/GradientSignal/Code/Include/GradientSignal/Components/RandomGradientComponent.h diff --git a/Gems/GradientSignal/Code/Source/Components/ReferenceGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ReferenceGradientComponent.h similarity index 100% rename from Gems/GradientSignal/Code/Source/Components/ReferenceGradientComponent.h rename to Gems/GradientSignal/Code/Include/GradientSignal/Components/ReferenceGradientComponent.h diff --git a/Gems/GradientSignal/Code/Source/Components/ShapeAreaFalloffGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ShapeAreaFalloffGradientComponent.h similarity index 100% rename from Gems/GradientSignal/Code/Source/Components/ShapeAreaFalloffGradientComponent.h rename to Gems/GradientSignal/Code/Include/GradientSignal/Components/ShapeAreaFalloffGradientComponent.h diff --git a/Gems/GradientSignal/Code/Source/Components/SmoothStepGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/SmoothStepGradientComponent.h similarity index 100% rename from Gems/GradientSignal/Code/Source/Components/SmoothStepGradientComponent.h rename to Gems/GradientSignal/Code/Include/GradientSignal/Components/SmoothStepGradientComponent.h diff --git a/Gems/GradientSignal/Code/Source/Components/SurfaceAltitudeGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceAltitudeGradientComponent.h similarity index 100% rename from Gems/GradientSignal/Code/Source/Components/SurfaceAltitudeGradientComponent.h rename to Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceAltitudeGradientComponent.h diff --git a/Gems/GradientSignal/Code/Source/Components/SurfaceMaskGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceMaskGradientComponent.h similarity index 100% rename from Gems/GradientSignal/Code/Source/Components/SurfaceMaskGradientComponent.h rename to Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceMaskGradientComponent.h diff --git a/Gems/GradientSignal/Code/Source/Components/SurfaceSlopeGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceSlopeGradientComponent.h similarity index 100% rename from Gems/GradientSignal/Code/Source/Components/SurfaceSlopeGradientComponent.h rename to Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceSlopeGradientComponent.h diff --git a/Gems/GradientSignal/Code/Source/Components/ThresholdGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ThresholdGradientComponent.h similarity index 100% rename from Gems/GradientSignal/Code/Source/Components/ThresholdGradientComponent.h rename to Gems/GradientSignal/Code/Include/GradientSignal/Components/ThresholdGradientComponent.h diff --git a/Gems/GradientSignal/Code/Source/Components/ConstantGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ConstantGradientComponent.cpp index 3bb27b00f3..86e8a5abc6 100644 --- a/Gems/GradientSignal/Code/Source/Components/ConstantGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ConstantGradientComponent.cpp @@ -6,7 +6,7 @@ * */ -#include "ConstantGradientComponent.h" +#include #include #include #include diff --git a/Gems/GradientSignal/Code/Source/Components/DitherGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/DitherGradientComponent.cpp index dbc2cd2827..c7845a41a6 100644 --- a/Gems/GradientSignal/Code/Source/Components/DitherGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/DitherGradientComponent.cpp @@ -6,7 +6,7 @@ * */ -#include "DitherGradientComponent.h" +#include #include #include #include diff --git a/Gems/GradientSignal/Code/Source/Components/GradientSurfaceDataComponent.cpp b/Gems/GradientSignal/Code/Source/Components/GradientSurfaceDataComponent.cpp index bdda0e48d2..5a0555fe33 100644 --- a/Gems/GradientSignal/Code/Source/Components/GradientSurfaceDataComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/GradientSurfaceDataComponent.cpp @@ -6,7 +6,7 @@ * */ -#include "GradientSurfaceDataComponent.h" +#include #include #include #include diff --git a/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.cpp b/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.cpp index 5b2ce4d4cf..67f073a178 100644 --- a/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.cpp @@ -6,7 +6,7 @@ * */ -#include "GradientTransformComponent.h" +#include #include #include #include diff --git a/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp index 4bf709755b..269bfbc2df 100644 --- a/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp @@ -6,7 +6,7 @@ * */ -#include "ImageGradientComponent.h" +#include #include #include #include diff --git a/Gems/GradientSignal/Code/Source/Components/InvertGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/InvertGradientComponent.cpp index 11ae5a67da..678f3b363c 100644 --- a/Gems/GradientSignal/Code/Source/Components/InvertGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/InvertGradientComponent.cpp @@ -6,7 +6,7 @@ * */ -#include "InvertGradientComponent.h" +#include #include #include #include diff --git a/Gems/GradientSignal/Code/Source/Components/LevelsGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/LevelsGradientComponent.cpp index af26ba494d..b2958c590c 100644 --- a/Gems/GradientSignal/Code/Source/Components/LevelsGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/LevelsGradientComponent.cpp @@ -6,7 +6,7 @@ * */ -#include "LevelsGradientComponent.h" +#include #include #include #include diff --git a/Gems/GradientSignal/Code/Source/Components/MixedGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/MixedGradientComponent.cpp index 5f6a18c7fb..e042188f8a 100644 --- a/Gems/GradientSignal/Code/Source/Components/MixedGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/MixedGradientComponent.cpp @@ -6,7 +6,7 @@ * */ -#include "MixedGradientComponent.h" +#include #include #include #include diff --git a/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp index 8f9d40387b..3096afa3dc 100644 --- a/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp @@ -6,7 +6,7 @@ * */ -#include "PerlinGradientComponent.h" +#include #include #include #include diff --git a/Gems/GradientSignal/Code/Source/Components/PosterizeGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/PosterizeGradientComponent.cpp index 89beb15f32..21d321df13 100644 --- a/Gems/GradientSignal/Code/Source/Components/PosterizeGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/PosterizeGradientComponent.cpp @@ -6,7 +6,7 @@ * */ -#include "PosterizeGradientComponent.h" +#include #include #include #include diff --git a/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp index fc2ccbef70..1b6753560c 100644 --- a/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp @@ -6,7 +6,7 @@ * */ -#include "RandomGradientComponent.h" +#include #include #include #include diff --git a/Gems/GradientSignal/Code/Source/Components/ReferenceGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ReferenceGradientComponent.cpp index 28ffaad7d3..ea304a7eed 100644 --- a/Gems/GradientSignal/Code/Source/Components/ReferenceGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ReferenceGradientComponent.cpp @@ -6,7 +6,7 @@ * */ -#include "ReferenceGradientComponent.h" +#include #include #include #include diff --git a/Gems/GradientSignal/Code/Source/Components/ShapeAreaFalloffGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ShapeAreaFalloffGradientComponent.cpp index cdf542bf51..9e1a250900 100644 --- a/Gems/GradientSignal/Code/Source/Components/ShapeAreaFalloffGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ShapeAreaFalloffGradientComponent.cpp @@ -6,7 +6,7 @@ * */ -#include "ShapeAreaFalloffGradientComponent.h" +#include #include #include #include diff --git a/Gems/GradientSignal/Code/Source/Components/SmoothStepGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/SmoothStepGradientComponent.cpp index 13b641426b..510ed41510 100644 --- a/Gems/GradientSignal/Code/Source/Components/SmoothStepGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/SmoothStepGradientComponent.cpp @@ -6,7 +6,7 @@ * */ -#include "SmoothStepGradientComponent.h" +#include #include #include #include diff --git a/Gems/GradientSignal/Code/Source/Components/SurfaceAltitudeGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/SurfaceAltitudeGradientComponent.cpp index 476e0971f4..8b36182750 100644 --- a/Gems/GradientSignal/Code/Source/Components/SurfaceAltitudeGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/SurfaceAltitudeGradientComponent.cpp @@ -6,7 +6,7 @@ * */ -#include "SurfaceAltitudeGradientComponent.h" +#include #include #include #include diff --git a/Gems/GradientSignal/Code/Source/Components/SurfaceMaskGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/SurfaceMaskGradientComponent.cpp index 7f46ad6e98..df7a3f5787 100644 --- a/Gems/GradientSignal/Code/Source/Components/SurfaceMaskGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/SurfaceMaskGradientComponent.cpp @@ -6,7 +6,7 @@ * */ -#include "SurfaceMaskGradientComponent.h" +#include #include #include #include diff --git a/Gems/GradientSignal/Code/Source/Components/SurfaceSlopeGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/SurfaceSlopeGradientComponent.cpp index 15b462f292..84e0b61a62 100644 --- a/Gems/GradientSignal/Code/Source/Components/SurfaceSlopeGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/SurfaceSlopeGradientComponent.cpp @@ -6,7 +6,7 @@ * */ -#include "SurfaceSlopeGradientComponent.h" +#include #include #include #include diff --git a/Gems/GradientSignal/Code/Source/Components/ThresholdGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ThresholdGradientComponent.cpp index 97acbb4441..a47ebdebe6 100644 --- a/Gems/GradientSignal/Code/Source/Components/ThresholdGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ThresholdGradientComponent.cpp @@ -6,7 +6,7 @@ * */ -#include "ThresholdGradientComponent.h" +#include #include #include #include diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorConstantGradientComponent.h b/Gems/GradientSignal/Code/Source/Editor/EditorConstantGradientComponent.h index 02a5d8ec33..87228671b3 100644 --- a/Gems/GradientSignal/Code/Source/Editor/EditorConstantGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Editor/EditorConstantGradientComponent.h @@ -9,7 +9,7 @@ #pragma once #include -#include +#include namespace GradientSignal { diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorDitherGradientComponent.h b/Gems/GradientSignal/Code/Source/Editor/EditorDitherGradientComponent.h index 39ce4973c5..b01968eed6 100644 --- a/Gems/GradientSignal/Code/Source/Editor/EditorDitherGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Editor/EditorDitherGradientComponent.h @@ -9,7 +9,7 @@ #pragma once #include -#include +#include namespace GradientSignal { diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorGradientSurfaceDataComponent.h b/Gems/GradientSignal/Code/Source/Editor/EditorGradientSurfaceDataComponent.h index 4c31283768..e79571e662 100644 --- a/Gems/GradientSignal/Code/Source/Editor/EditorGradientSurfaceDataComponent.h +++ b/Gems/GradientSignal/Code/Source/Editor/EditorGradientSurfaceDataComponent.h @@ -8,7 +8,7 @@ #pragma once -#include +#include #include #include diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorGradientTransformComponent.h b/Gems/GradientSignal/Code/Source/Editor/EditorGradientTransformComponent.h index 8478d3e434..d2e2dc38eb 100644 --- a/Gems/GradientSignal/Code/Source/Editor/EditorGradientTransformComponent.h +++ b/Gems/GradientSignal/Code/Source/Editor/EditorGradientTransformComponent.h @@ -8,7 +8,7 @@ #pragma once -#include +#include #include namespace GradientSignal diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorImageGradientComponent.h b/Gems/GradientSignal/Code/Source/Editor/EditorImageGradientComponent.h index d1682be46f..f84766e73b 100644 --- a/Gems/GradientSignal/Code/Source/Editor/EditorImageGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Editor/EditorImageGradientComponent.h @@ -9,7 +9,7 @@ #pragma once #include -#include +#include namespace GradientSignal { diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorInvertGradientComponent.h b/Gems/GradientSignal/Code/Source/Editor/EditorInvertGradientComponent.h index ab9c13679c..652ddc3279 100644 --- a/Gems/GradientSignal/Code/Source/Editor/EditorInvertGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Editor/EditorInvertGradientComponent.h @@ -9,7 +9,7 @@ #pragma once #include -#include +#include namespace GradientSignal { diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorLevelsGradientComponent.h b/Gems/GradientSignal/Code/Source/Editor/EditorLevelsGradientComponent.h index a2626d9a0a..b43f9bbb73 100644 --- a/Gems/GradientSignal/Code/Source/Editor/EditorLevelsGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Editor/EditorLevelsGradientComponent.h @@ -9,7 +9,7 @@ #pragma once #include -#include +#include namespace GradientSignal { diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorMixedGradientComponent.h b/Gems/GradientSignal/Code/Source/Editor/EditorMixedGradientComponent.h index 837c64e6d8..c2ca707014 100644 --- a/Gems/GradientSignal/Code/Source/Editor/EditorMixedGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Editor/EditorMixedGradientComponent.h @@ -9,7 +9,7 @@ #pragma once #include -#include +#include namespace GradientSignal { diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorPerlinGradientComponent.h b/Gems/GradientSignal/Code/Source/Editor/EditorPerlinGradientComponent.h index 4ef09ee3e4..1c39cf8faa 100644 --- a/Gems/GradientSignal/Code/Source/Editor/EditorPerlinGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Editor/EditorPerlinGradientComponent.h @@ -10,7 +10,7 @@ #include #include -#include +#include namespace GradientSignal { diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorPosterizeGradientComponent.h b/Gems/GradientSignal/Code/Source/Editor/EditorPosterizeGradientComponent.h index af85429b32..0078e2865f 100644 --- a/Gems/GradientSignal/Code/Source/Editor/EditorPosterizeGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Editor/EditorPosterizeGradientComponent.h @@ -9,7 +9,7 @@ #pragma once #include -#include +#include namespace GradientSignal { diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorRandomGradientComponent.h b/Gems/GradientSignal/Code/Source/Editor/EditorRandomGradientComponent.h index 750e5bae4f..f5f9daee0a 100644 --- a/Gems/GradientSignal/Code/Source/Editor/EditorRandomGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Editor/EditorRandomGradientComponent.h @@ -12,7 +12,7 @@ #include #include #include -#include +#include namespace GradientSignal { diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorReferenceGradientComponent.h b/Gems/GradientSignal/Code/Source/Editor/EditorReferenceGradientComponent.h index 41eccf27e4..bf29b270bd 100644 --- a/Gems/GradientSignal/Code/Source/Editor/EditorReferenceGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Editor/EditorReferenceGradientComponent.h @@ -9,7 +9,7 @@ #pragma once #include -#include +#include namespace GradientSignal { diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorShapeAreaFalloffGradientComponent.h b/Gems/GradientSignal/Code/Source/Editor/EditorShapeAreaFalloffGradientComponent.h index d8d7c052ce..7772dfe7c5 100644 --- a/Gems/GradientSignal/Code/Source/Editor/EditorShapeAreaFalloffGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Editor/EditorShapeAreaFalloffGradientComponent.h @@ -9,7 +9,7 @@ #pragma once #include -#include +#include namespace GradientSignal { diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorSmoothStepGradientComponent.h b/Gems/GradientSignal/Code/Source/Editor/EditorSmoothStepGradientComponent.h index 864a419985..4a43920a6c 100644 --- a/Gems/GradientSignal/Code/Source/Editor/EditorSmoothStepGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Editor/EditorSmoothStepGradientComponent.h @@ -9,7 +9,7 @@ #pragma once #include -#include +#include namespace GradientSignal { diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorSurfaceAltitudeGradientComponent.h b/Gems/GradientSignal/Code/Source/Editor/EditorSurfaceAltitudeGradientComponent.h index b334bb149d..f40176a9f5 100644 --- a/Gems/GradientSignal/Code/Source/Editor/EditorSurfaceAltitudeGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Editor/EditorSurfaceAltitudeGradientComponent.h @@ -9,7 +9,7 @@ #pragma once #include -#include +#include namespace GradientSignal { diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorSurfaceMaskGradientComponent.h b/Gems/GradientSignal/Code/Source/Editor/EditorSurfaceMaskGradientComponent.h index 5df17a2699..9e71526541 100644 --- a/Gems/GradientSignal/Code/Source/Editor/EditorSurfaceMaskGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Editor/EditorSurfaceMaskGradientComponent.h @@ -9,7 +9,7 @@ #pragma once #include -#include +#include namespace GradientSignal { diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorSurfaceSlopeGradientComponent.h b/Gems/GradientSignal/Code/Source/Editor/EditorSurfaceSlopeGradientComponent.h index ad1adb98f9..20daa662a9 100644 --- a/Gems/GradientSignal/Code/Source/Editor/EditorSurfaceSlopeGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Editor/EditorSurfaceSlopeGradientComponent.h @@ -9,7 +9,7 @@ #pragma once #include -#include +#include namespace GradientSignal { diff --git a/Gems/GradientSignal/Code/Source/Editor/EditorThresholdGradientComponent.h b/Gems/GradientSignal/Code/Source/Editor/EditorThresholdGradientComponent.h index 0291e65fd8..cbeb626c5e 100644 --- a/Gems/GradientSignal/Code/Source/Editor/EditorThresholdGradientComponent.h +++ b/Gems/GradientSignal/Code/Source/Editor/EditorThresholdGradientComponent.h @@ -9,7 +9,7 @@ #pragma once #include -#include +#include namespace GradientSignal { diff --git a/Gems/GradientSignal/Code/Source/GradientSignalModule.cpp b/Gems/GradientSignal/Code/Source/GradientSignalModule.cpp index 9986e62b34..eeaeae00dd 100644 --- a/Gems/GradientSignal/Code/Source/GradientSignalModule.cpp +++ b/Gems/GradientSignal/Code/Source/GradientSignalModule.cpp @@ -9,24 +9,24 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include namespace GradientSignal { diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalBenchmarks.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalBenchmarks.cpp index e780a5d893..dd179bd253 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalBenchmarks.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalBenchmarks.cpp @@ -16,10 +16,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include namespace UnitTest { diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalImageTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalImageTests.cpp index fa30132836..e99bf1de5b 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalImageTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalImageTests.cpp @@ -15,8 +15,8 @@ #include #include -#include -#include +#include +#include namespace UnitTest { diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalReferencesTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalReferencesTests.cpp index ec22fbc1ec..32cd483c81 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalReferencesTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalReferencesTests.cpp @@ -12,16 +12,16 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include namespace UnitTest { diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp index dc11d21b11..dd81c14a09 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp @@ -10,9 +10,9 @@ #include -#include -#include -#include +#include +#include +#include namespace UnitTest { diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalSurfaceTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalSurfaceTests.cpp index a0c8f5cf50..702965c0de 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalSurfaceTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalSurfaceTests.cpp @@ -11,8 +11,8 @@ #include #include -#include -#include +#include +#include namespace UnitTest { diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalTest.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalTest.cpp index 84b2daab84..adc35e6738 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalTest.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalTest.cpp @@ -11,13 +11,13 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include namespace UnitTest { diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalTransformTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalTransformTests.cpp index ddebc0ce1f..04e4611e71 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalTransformTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalTransformTests.cpp @@ -15,7 +15,7 @@ #include #include -#include +#include namespace UnitTest { diff --git a/Gems/GradientSignal/Code/gradientsignal_files.cmake b/Gems/GradientSignal/Code/gradientsignal_files.cmake index 7318f18739..8555c2c0b4 100644 --- a/Gems/GradientSignal/Code/gradientsignal_files.cmake +++ b/Gems/GradientSignal/Code/gradientsignal_files.cmake @@ -15,6 +15,24 @@ set(FILES Include/GradientSignal/PerlinImprovedNoise.h Include/GradientSignal/Util.h Include/GradientSignal/GradientImageConversion.h + Include/GradientSignal/Components/ConstantGradientComponent.h + Include/GradientSignal/Components/DitherGradientComponent.h + Include/GradientSignal/Components/GradientSurfaceDataComponent.h + Include/GradientSignal/Components/GradientTransformComponent.h + Include/GradientSignal/Components/ImageGradientComponent.h + Include/GradientSignal/Components/InvertGradientComponent.h + Include/GradientSignal/Components/LevelsGradientComponent.h + Include/GradientSignal/Components/MixedGradientComponent.h + Include/GradientSignal/Components/PerlinGradientComponent.h + Include/GradientSignal/Components/PosterizeGradientComponent.h + Include/GradientSignal/Components/RandomGradientComponent.h + Include/GradientSignal/Components/ReferenceGradientComponent.h + Include/GradientSignal/Components/ShapeAreaFalloffGradientComponent.h + Include/GradientSignal/Components/SmoothStepGradientComponent.h + Include/GradientSignal/Components/SurfaceAltitudeGradientComponent.h + Include/GradientSignal/Components/SurfaceMaskGradientComponent.h + Include/GradientSignal/Components/SurfaceSlopeGradientComponent.h + Include/GradientSignal/Components/ThresholdGradientComponent.h Include/GradientSignal/Ebuses/GradientTransformRequestBus.h Include/GradientSignal/Ebuses/GradientRequestBus.h Include/GradientSignal/Ebuses/GradientPreviewRequestBus.h @@ -40,41 +58,23 @@ set(FILES Include/GradientSignal/Ebuses/GradientSurfaceDataRequestBus.h Include/GradientSignal/Ebuses/SmoothStepRequestBus.h Source/Components/ConstantGradientComponent.cpp - Source/Components/ConstantGradientComponent.h Source/Components/DitherGradientComponent.cpp - Source/Components/DitherGradientComponent.h Source/Components/GradientSurfaceDataComponent.cpp - Source/Components/GradientSurfaceDataComponent.h Source/Components/GradientTransformComponent.cpp - Source/Components/GradientTransformComponent.h Source/Components/ImageGradientComponent.cpp - Source/Components/ImageGradientComponent.h Source/Components/InvertGradientComponent.cpp - Source/Components/InvertGradientComponent.h Source/Components/LevelsGradientComponent.cpp - Source/Components/LevelsGradientComponent.h Source/Components/MixedGradientComponent.cpp - Source/Components/MixedGradientComponent.h Source/Components/PerlinGradientComponent.cpp - Source/Components/PerlinGradientComponent.h Source/Components/PosterizeGradientComponent.cpp - Source/Components/PosterizeGradientComponent.h Source/Components/RandomGradientComponent.cpp - Source/Components/RandomGradientComponent.h Source/Components/ReferenceGradientComponent.cpp - Source/Components/ReferenceGradientComponent.h Source/Components/ShapeAreaFalloffGradientComponent.cpp - Source/Components/ShapeAreaFalloffGradientComponent.h Source/Components/SmoothStepGradientComponent.cpp - Source/Components/SmoothStepGradientComponent.h Source/Components/SurfaceAltitudeGradientComponent.cpp - Source/Components/SurfaceAltitudeGradientComponent.h Source/Components/SurfaceMaskGradientComponent.cpp - Source/Components/SurfaceMaskGradientComponent.h Source/Components/SurfaceSlopeGradientComponent.cpp - Source/Components/SurfaceSlopeGradientComponent.h Source/Components/ThresholdGradientComponent.cpp - Source/Components/ThresholdGradientComponent.h Source/GradientSampler.cpp Source/GradientSignalSystemComponent.cpp Source/GradientSignalSystemComponent.h From 9556c5bf628f5be54c9f6b159751346c39a37028 Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Mon, 3 Jan 2022 17:37:38 -0600 Subject: [PATCH 276/948] Add benchmarks for terrain APIs. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- Gems/Terrain/Code/CMakeLists.txt | 5 + .../TerrainSurfaceGradientListComponent.h | 7 + .../Code/Tests/TerrainSystemBenchmarks.cpp | 421 ++++++++++++++++++ Gems/Terrain/Code/terrain_tests_files.cmake | 1 + 4 files changed, 434 insertions(+) create mode 100644 Gems/Terrain/Code/Tests/TerrainSystemBenchmarks.cpp diff --git a/Gems/Terrain/Code/CMakeLists.txt b/Gems/Terrain/Code/CMakeLists.txt index d532284350..69a1bef3c0 100644 --- a/Gems/Terrain/Code/CMakeLists.txt +++ b/Gems/Terrain/Code/CMakeLists.txt @@ -119,6 +119,11 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) NAME Gem::Terrain.Tests ) + ly_add_googlebenchmark( + NAME Gem::Terrain.Benchmarks + TARGET Gem::Terrain.Tests + ) + # If we are a host platform we want to add tools test like editor tests here if(PAL_TRAIT_BUILD_HOST_TOOLS) # We support Terrain.Editor.Tests on this platform, add Terrain.Editor.Tests target which depends on Terrain.Editor diff --git a/Gems/Terrain/Code/Source/Components/TerrainSurfaceGradientListComponent.h b/Gems/Terrain/Code/Source/Components/TerrainSurfaceGradientListComponent.h index 20851c127f..8a3c097b6c 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainSurfaceGradientListComponent.h +++ b/Gems/Terrain/Code/Source/Components/TerrainSurfaceGradientListComponent.h @@ -32,6 +32,13 @@ namespace Terrain AZ_RTTI(TerrainSurfaceGradientMapping, "{473AD2CE-F22A-45A9-803F-2192F3D9F2BF}"); static void Reflect(AZ::ReflectContext* context); + TerrainSurfaceGradientMapping() = default; + TerrainSurfaceGradientMapping(const AZ::EntityId& entityId, const SurfaceData::SurfaceTag& surfaceTag) + : m_gradientEntityId(entityId) + , m_surfaceTag(surfaceTag) + { + } + AZ::EntityId m_gradientEntityId; SurfaceData::SurfaceTag m_surfaceTag; }; diff --git a/Gems/Terrain/Code/Tests/TerrainSystemBenchmarks.cpp b/Gems/Terrain/Code/Tests/TerrainSystemBenchmarks.cpp new file mode 100644 index 0000000000..b921681ab5 --- /dev/null +++ b/Gems/Terrain/Code/Tests/TerrainSystemBenchmarks.cpp @@ -0,0 +1,421 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#ifdef HAVE_BENCHMARK + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include +#include + +#include + +namespace UnitTest +{ + using ::testing::NiceMock; + using ::testing::Return; + + class TerrainSystemBenchmarkFixture + : public UnitTest::AllocatorsBenchmarkFixture + , public UnitTest::TraceBusRedirector + { + public: + void SetUp(const benchmark::State& state) override + { + InternalSetUp(state); + } + void SetUp(benchmark::State& state) override + { + InternalSetUp(state); + } + + void TearDown(const benchmark::State& state) override + { + InternalTearDown(state); + } + void TearDown(benchmark::State& state) override + { + InternalTearDown(state); + } + + void InternalSetUp(const benchmark::State& state) + { + AZ::Debug::TraceMessageBus::Handler::BusConnect(); + UnitTest::AllocatorsBenchmarkFixture::SetUp(state); + + m_app = AZStd::make_unique(); + ASSERT_TRUE(m_app != nullptr); + + AZ::ComponentApplication::Descriptor componentAppDesc; + + AZ::Entity* systemEntity = m_app->Create(componentAppDesc); + ASSERT_TRUE(systemEntity != nullptr); + m_app->AddEntity(systemEntity); + + AZ::AllocatorInstance::Create(); + } + + void InternalTearDown(const benchmark::State& state) + { + AZ::AllocatorInstance::Destroy(); + + m_app->Destroy(); + m_app.reset(); + + UnitTest::AllocatorsBenchmarkFixture::TearDown(state); + AZ::Debug::TraceMessageBus::Handler::BusDisconnect(); + } + + AZStd::unique_ptr CreateEntity() + { + return AZStd::make_unique(); + } + + void ActivateEntity(AZ::Entity* entity) + { + entity->Init(); + entity->Activate(); + } + + template + Component* CreateComponent(AZ::Entity* entity, const Configuration& config) + { + m_app->RegisterComponentDescriptor(Component::CreateDescriptor()); + return entity->CreateComponent(config); + } + + template + Component* CreateComponent(AZ::Entity* entity) + { + m_app->RegisterComponentDescriptor(Component::CreateDescriptor()); + return entity->CreateComponent(); + } + + // Create a terrain system with reasonable defaults for testing, but with the ability to override the defaults + // on a test-by-test basis. + AZStd::unique_ptr CreateAndActivateTerrainSystem( + AZ::Vector2 queryResolution = AZ::Vector2(1.0f), + AZ::Aabb worldBounds = AZ::Aabb::CreateFromMinMax(AZ::Vector3(-128.0f), AZ::Vector3(128.0f))) + { + // Create the terrain system and give it one tick to fully initialize itself. + auto terrainSystem = AZStd::make_unique(); + terrainSystem->SetTerrainAabb(worldBounds); + terrainSystem->SetTerrainHeightQueryResolution(queryResolution); + terrainSystem->Activate(); + AZ::TickBus::Broadcast(&AZ::TickBus::Events::OnTick, 0.f, AZ::ScriptTimePoint{}); + return terrainSystem; + } + + // Create a mock shape bus listener that will listen to the given EntityId for shape requests and returns the following: + // - GetEncompassingAabb - returns the given Aabb + // - GetTransformAndLocalBounds - returns the center of the Aabb as the transform, and the size of the Aabb as the local bounds + // - IsPointInside - true if the point is in the Aabb, false if not + AZStd::unique_ptr> CreateMockShape( + const AZ::Aabb& spawnerBox, const AZ::EntityId& shapeEntityId) + { + AZStd::unique_ptr> mockShape = + AZStd::make_unique>(shapeEntityId); + + ON_CALL(*mockShape, GetEncompassingAabb).WillByDefault(Return(spawnerBox)); + ON_CALL(*mockShape, GetTransformAndLocalBounds) + .WillByDefault( + [spawnerBox](AZ::Transform& transform, AZ::Aabb& bounds) + { + transform = AZ::Transform::CreateTranslation(spawnerBox.GetCenter()); + bounds = spawnerBox.GetTranslated(-spawnerBox.GetCenter()); + }); + ON_CALL(*mockShape, IsPointInside) + .WillByDefault( + [spawnerBox](const AZ::Vector3& point) -> bool + { + return spawnerBox.Contains(point); + }); + + return mockShape; + } + + // Create an entity with a Random Gradient on it that can be used for gradient queries. + AZStd::unique_ptr CreateTestRandomGradientEntity(const AZ::Aabb& spawnerBox, uint32_t randomSeed) + { + // Create the base entity + AZStd::unique_ptr testGradientEntity = CreateEntity(); + + // Add a mock AABB Shape so that the shape requirement is fulfilled. + CreateComponent(testGradientEntity.get()); + + // Create the Random Gradient Component with some default parameters. + GradientSignal::RandomGradientConfig config; + config.m_randomSeed = randomSeed; + CreateComponent(testGradientEntity.get(), config); + + // Create the Gradient Transform Component with some default parameters. + GradientSignal::GradientTransformConfig gradientTransformConfig; + gradientTransformConfig.m_wrappingType = GradientSignal::WrappingType::None; + CreateComponent(testGradientEntity.get(), gradientTransformConfig); + + // Set the transform to match the given spawnerBox + auto transform = CreateComponent(testGradientEntity.get()); + transform->SetLocalTM(AZ::Transform::CreateTranslation(spawnerBox.GetCenter())); + transform->SetWorldTM(AZ::Transform::CreateTranslation(spawnerBox.GetCenter())); + + return testGradientEntity; + } + + AZStd::unique_ptr CreateTestLayerSpawnerEntity( + const AZ::Aabb& spawnerBox, const AZ::EntityId& heightGradientEntityId, + const Terrain::TerrainSurfaceGradientListConfig& surfaceConfig) + { + // Create the base entity + AZStd::unique_ptr testLayerSpawnerEntity = CreateEntity(); + + // Add a mock AABB Shape so that the shape requirement is fulfilled. + CreateComponent(testLayerSpawnerEntity.get()); + + // Add a Terrain Layer Spawner + CreateComponent(testLayerSpawnerEntity.get()); + + // Add a Terrain Height Gradient List with one entry pointing to the given gradient entity + Terrain::TerrainHeightGradientListConfig heightConfig; + heightConfig.m_gradientEntities.emplace_back(heightGradientEntityId); + CreateComponent(testLayerSpawnerEntity.get(), heightConfig); + + // Add a Terrain Surface Gradient List with however many entries we were given + CreateComponent(testLayerSpawnerEntity.get(), surfaceConfig); + + // Set the transform to match the given spawnerBox + auto transform = CreateComponent(testLayerSpawnerEntity.get()); + transform->SetLocalTM(AZ::Transform::CreateTranslation(spawnerBox.GetCenter())); + transform->SetWorldTM(AZ::Transform::CreateTranslation(spawnerBox.GetCenter())); + + return testLayerSpawnerEntity; + } + + void RunTerrainApiBenchmark( + benchmark::State& state, + AZStd::function ApiCaller) + { + // Get the ranges for querying from our benchmark parameters + float boundsRange = aznumeric_cast(state.range(0)); + uint32_t numSurfaces = aznumeric_cast(state.range(1)); + AzFramework::Terrain::TerrainDataRequests::Sampler sampler = + static_cast(state.range(2)); + + // Set up our world bounds and query resolution + AZ::Aabb worldBounds = AZ::Aabb::CreateFromMinMax(AZ::Vector3(-boundsRange / 2.0f), AZ::Vector3(boundsRange / 2.0f)); + AZ::Vector2 queryResolution = AZ::Vector2(1.0f); + + // Create a Random Gradient to use as our height provider + const uint32_t heightRandomSeed = 12345; + auto heightGradientEntity = CreateTestRandomGradientEntity(worldBounds, heightRandomSeed); + auto heightGradientShapeRequests = CreateMockShape(worldBounds, heightGradientEntity->GetId()); + ActivateEntity(heightGradientEntity.get()); + + + // Create a set of Random Gradients to use as our surface providers + Terrain::TerrainSurfaceGradientListConfig surfaceConfig; + AZStd::vector> surfaceGradientEntities; + AZStd::vector>> surfaceGradientShapeRequests; + for (uint32_t surfaces = 0; surfaces < numSurfaces; surfaces++) + { + const uint32_t surfaceRandomSeed = 23456 + surfaces; + auto surfaceGradientEntity = CreateTestRandomGradientEntity(worldBounds, surfaceRandomSeed); + auto shapeRequests = CreateMockShape(worldBounds, surfaceGradientEntity->GetId()); + ActivateEntity(surfaceGradientEntity.get()); + + // Give each gradient a new surface tag + surfaceConfig.m_gradientSurfaceMappings.emplace_back( + surfaceGradientEntity->GetId(), SurfaceData::SurfaceTag(AZStd::string::format("test%zu", surfaces))); + + surfaceGradientEntities.emplace_back(AZStd::move(surfaceGradientEntity)); + surfaceGradientShapeRequests.emplace_back(AZStd::move(shapeRequests)); + } + + // Create a single Terrain Layer Spawner that covers the entire terrain world bounds + // (Do this *after* creating and activating the height and surface gradients) + auto testLayerSpawnerEntity = CreateTestLayerSpawnerEntity(worldBounds, heightGradientEntity->GetId(), surfaceConfig); + auto spawnerShapeRequests = CreateMockShape(worldBounds, testLayerSpawnerEntity->GetId()); + ActivateEntity(testLayerSpawnerEntity.get()); + + // Create the terrain system (do this after creating the terrain layer entity to ensure that we don't need any data refreshes) + auto terrainSystem = CreateAndActivateTerrainSystem(queryResolution, worldBounds); + + // Call the terrain API we're testing for every height and width in our ranges. + for (auto stateIterator : state) + { + ApiCaller(queryResolution, worldBounds, sampler); + } + + testLayerSpawnerEntity.reset(); + spawnerShapeRequests.reset(); + + heightGradientEntity.reset(); + heightGradientShapeRequests.reset(); + + surfaceGradientEntities.clear(); + surfaceGradientShapeRequests.clear(); + } + + protected: + AZStd::unique_ptr m_app; + }; + + + BENCHMARK_DEFINE_F(TerrainSystemBenchmarkFixture, BM_GetHeight)(benchmark::State& state) + { + // Run the benchmark + RunTerrainApiBenchmark( + state, + []([[maybe_unused]] const AZ::Vector2& queryResolution, const AZ::Aabb& worldBounds, + AzFramework::Terrain::TerrainDataRequests::Sampler sampler) + { + float worldMinZ = worldBounds.GetMin().GetZ(); + + for (float y = worldBounds.GetMin().GetY(); y < worldBounds.GetMax().GetY(); y += 1.0f) + { + for (float x = worldBounds.GetMin().GetX(); x < worldBounds.GetMax().GetX(); x += 1.0f) + { + float terrainHeight = worldMinZ; + bool terrainExists = false; + AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( + terrainHeight, &AzFramework::Terrain::TerrainDataRequests::GetHeightFromFloats, x, y, sampler, &terrainExists); + benchmark::DoNotOptimize(terrainHeight); + } + } + }); + } + + BENCHMARK_REGISTER_F(TerrainSystemBenchmarkFixture, BM_GetHeight) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 4096, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 4096, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 4096, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(TerrainSystemBenchmarkFixture, BM_GetNormal)(benchmark::State& state) + { + // Run the benchmark + RunTerrainApiBenchmark( + state, + []([[maybe_unused]] const AZ::Vector2& queryResolution, const AZ::Aabb& worldBounds, + AzFramework::Terrain::TerrainDataRequests::Sampler sampler) + { + for (float y = worldBounds.GetMin().GetY(); y < worldBounds.GetMax().GetY(); y += 1.0f) + { + for (float x = worldBounds.GetMin().GetX(); x < worldBounds.GetMax().GetX(); x += 1.0f) + { + AZ::Vector3 terrainNormal; + bool terrainExists = false; + AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( + terrainNormal, &AzFramework::Terrain::TerrainDataRequests::GetNormalFromFloats, x, y, sampler, &terrainExists); + benchmark::DoNotOptimize(terrainNormal); + } + } + }); + } + + BENCHMARK_REGISTER_F(TerrainSystemBenchmarkFixture, BM_GetNormal) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(TerrainSystemBenchmarkFixture, BM_GetSurfaceWeights)(benchmark::State& state) + { + // Run the benchmark + RunTerrainApiBenchmark( + state, + []([[maybe_unused]] const AZ::Vector2& queryResolution, const AZ::Aabb& worldBounds, + AzFramework::Terrain::TerrainDataRequests::Sampler sampler) + { + AzFramework::SurfaceData::SurfaceTagWeightList surfaceWeights; + for (float y = worldBounds.GetMin().GetY(); y < worldBounds.GetMax().GetY(); y += 1.0f) + { + for (float x = worldBounds.GetMin().GetX(); x < worldBounds.GetMax().GetX(); x += 1.0f) + { + bool terrainExists = false; + AzFramework::Terrain::TerrainDataRequestBus::Broadcast( + &AzFramework::Terrain::TerrainDataRequests::GetSurfaceWeightsFromFloats, x, y, surfaceWeights, sampler, + &terrainExists); + benchmark::DoNotOptimize(surfaceWeights); + } + } + }); + } + + BENCHMARK_REGISTER_F(TerrainSystemBenchmarkFixture, BM_GetSurfaceWeights) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 1024, 2, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 2, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 1024, 4, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 4, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(TerrainSystemBenchmarkFixture, BM_GetSurfacePoints)(benchmark::State& state) + { + // Run the benchmark + RunTerrainApiBenchmark( + state, + []([[maybe_unused]] const AZ::Vector2& queryResolution, const AZ::Aabb& worldBounds, + AzFramework::Terrain::TerrainDataRequests::Sampler sampler) + { + AzFramework::SurfaceData::SurfacePoint surfacePoint; + for (float y = worldBounds.GetMin().GetY(); y < worldBounds.GetMax().GetY(); y += 1.0f) + { + for (float x = worldBounds.GetMin().GetX(); x < worldBounds.GetMax().GetX(); x += 1.0f) + { + bool terrainExists = false; + AzFramework::Terrain::TerrainDataRequestBus::Broadcast( + &AzFramework::Terrain::TerrainDataRequests::GetSurfacePointFromFloats, x, y, surfacePoint, sampler, + &terrainExists); + benchmark::DoNotOptimize(surfacePoint); + } + } + }); + } + + BENCHMARK_REGISTER_F(TerrainSystemBenchmarkFixture, BM_GetSurfacePoints) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Unit(::benchmark::kMillisecond); +#endif + +} diff --git a/Gems/Terrain/Code/terrain_tests_files.cmake b/Gems/Terrain/Code/terrain_tests_files.cmake index 88de53f8cf..1a46fdd203 100644 --- a/Gems/Terrain/Code/terrain_tests_files.cmake +++ b/Gems/Terrain/Code/terrain_tests_files.cmake @@ -16,4 +16,5 @@ set(FILES Tests/TerrainHeightGradientListTests.cpp Tests/TerrainMacroMaterialTests.cpp Tests/TerrainSurfaceGradientListTests.cpp + Tests/TerrainSystemBenchmarks.cpp ) From a7d173db3d530dbf0d5f0067e05e4bd8ea422406 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Mon, 3 Jan 2022 16:15:35 -0800 Subject: [PATCH 277/948] changes from review and switching to assert model instead of return bool Signed-off-by: Scott Murray --- .../editor_entity_utils.py | 164 ++++++++++-------- 1 file changed, 93 insertions(+), 71 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py index 58d9e30f81..0878431054 100644 --- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py @@ -8,7 +8,8 @@ SPDX-License-Identifier: Apache-2.0 OR MIT # Built-in Imports from __future__ import annotations from typing import List, Tuple, Union - +from enum import Enum +import warnings # Open 3D Engine Imports import azlmbr @@ -21,15 +22,21 @@ import azlmbr.legacy.general as general from editor_python_test_tools.utils import Report +class Entity_Type(Enum): + GAME = azlmbr.entity.EntityType().Game + LEVEL = azlmbr.entity.EntityType().Level + + class EditorComponent: """ EditorComponent class used to set and get the component property value using path EditorComponent object is returned from either of EditorEntity.add_component() or Entity.add_components() or EditorEntity.get_components_of_type() which also assigns self.id and self.type_id to the EditorComponent object. + self.type_id is the UUID for the component type as provided by an ebus call. """ - def __init__(self, type_id): + def __init__(self, type_id: uuid): self.type_id = type_id self.id = None self.property_tree = None @@ -88,51 +95,59 @@ class EditorComponent: :param component_property_path: String of component property. (e.g. 'Settings|Visible') :return: Count of items in the container as unsigned integer """ - if self.is_property_container(component_property_path): - container_count_outcome = self.property_tree.get_container_count(component_property_path) - assert ( - container_count_outcome.IsSuccess() - ), f"Failure: get_container_count did not return success for '{component_property_path}'" - return container_count_outcome.GetValue() + assert ( + self.is_property_container(component_property_path) + ), f"Failure: '{component_property_path}' is not a property container" + container_count_outcome = self.property_tree.get_container_count(component_property_path) + assert ( + container_count_outcome.IsSuccess() + ), f"Failure: get_container_count did not return success for '{component_property_path}'" + return container_count_outcome.GetValue() - def reset_container(self, component_property_path: str) -> bool: + def reset_container(self, component_property_path: str): """ Used to rest a container to empty :param component_property_path: String of component property. (e.g. 'Settings|Visible') - :return: Boolean success + :return: None """ - if self.is_property_container(component_property_path): - reset_outcome = self.property_tree.reset_container(component_property_path) - return reset_outcome.IsSuccess() - else: - return False + assert ( + self.is_property_container(component_property_path) + ), f"Failure: '{component_property_path}' is not a property container" + reset_outcome = self.property_tree.reset_container(component_property_path) + assert ( + reset_outcome.IsSuccess() + ), f"Failure: could not reset_container on '{component_property_path}'" - def append_container_item(self, component_property_path: str, value: any) -> bool: + def append_container_item(self, component_property_path: str, value: any): """ Used to append a container item without providing an index key. :param component_property_path: String of component property. (e.g. 'Settings|Visible') :param value: Value to be set - :return: Boolean success + :return: None """ - if self.is_property_container(component_property_path): - append_outcome = self.property_tree.append_container_item(component_property_path, value) - return append_outcome.IsSuccess() - else: - return False + assert ( + self.is_property_container(component_property_path) + ), f"Failure: '{component_property_path}' is not a property container" + append_outcome = self.property_tree.append_container_item(component_property_path, value) + assert ( + append_outcome.IsSuccess() + ), f"Failure: could not append_container_item to '{component_property_path}'" - def add_container_item(self, component_property_path: str, key: any, value: any) -> bool: + def add_container_item(self, component_property_path: str, key: any, value: any): """ Used to add a container item at a specified key. In practice key should be an integer index. :param component_property_path: String of component property. (e.g. 'Settings|Visible') :param key: Zero index integer key, although this could be any unique unused key value :param value: Value to be set - :return: Boolean success + :return: None """ - if self.is_property_container(component_property_path): - add_outcome = self.property_tree.add_container_item(component_property_path, key, value) - return add_outcome.IsSuccess() - else: - return False + assert ( + self.is_property_container(component_property_path) + ), f"Failure: '{component_property_path}' is not a property container" + add_outcome = self.property_tree.add_container_item(component_property_path, key, value) + assert ( + add_outcome.IsSuccess() + ), f"Failure: could not add_container_item '{key}' to '{component_property_path}'" def get_container_item(self, component_property_path: str, key: any) -> any: """ @@ -141,27 +156,29 @@ class EditorComponent: :param key: Zero index integer key :return: Value stored at the key specified """ - if self.is_property_container(component_property_path): - get_outcome = self.property_tree.get_container_item(component_property_path, key) - assert ( - get_outcome.IsSuccess() - ), f"Failure: could not get a value for {self.get_component_name()}: '{component_property_path}' [{key}]" - return get_outcome.GetValue() - else: - return None + assert ( + self.is_property_container(component_property_path) + ), f"Failure: '{component_property_path}' is not a property container" + get_outcome = self.property_tree.get_container_item(component_property_path, key) + assert ( + get_outcome.IsSuccess() + ), f"Failure: could not get a value for {self.get_component_name()}: '{component_property_path}' [{key}]" + return get_outcome.GetValue() - def remove_container_item(self, component_property_path: str, key: any) -> bool: + def remove_container_item(self, component_property_path: str, key: any): """ Used to remove a container item value at the specified key. In practice key should be an integer index. :param component_property_path: String of component property. (e.g. 'Settings|Visible') :param key: Zero index integer key - :return: Boolean success + :return: None """ - if self.is_property_container(component_property_path): - remove_outcome = self.property_tree.remove_container_item(component_property_path, key) - return remove_outcome.IsSuccess() - else: - return False + assert ( + self.is_property_container(component_property_path) + ), f"Failure: '{component_property_path}' is not a property container" + remove_outcome = self.property_tree.remove_container_item(component_property_path, key) + assert ( + remove_outcome.IsSuccess() + ), f"Failure: could not remove_container_item '{key}' from '{component_property_path}'" def update_container_item(self, component_property_path: str, key: any, value: any): """ @@ -169,13 +186,15 @@ class EditorComponent: :param component_property_path: String of component property. (e.g. 'Settings|Visible') :param key: Zero index integer key :param value: Value to be set - :return: Boolean success + :return: None """ - if self.is_property_container(component_property_path): - update_outcome = self.property_tree.update_container_item(component_property_path, key, value) - return update_outcome.IsSuccess() - else: - return False + assert ( + self.is_property_container(component_property_path) + ), f"Failure: '{component_property_path}' is not a property container" + update_outcome = self.property_tree.update_container_item(component_property_path, key, value) + assert ( + update_outcome.IsSuccess() + ), f"Failure: could not update '{key}' in '{component_property_path}'" def get_component_property_value(self, component_property_path: str): """ @@ -211,30 +230,33 @@ class EditorComponent: """ return editor.EditorComponentAPIBus(bus.Broadcast, "IsComponentEnabled", self.id) - def disable_component(self): + def set_enabled(self, new_state: bool): """ - Used to disable the component using its id value. + Used to set the component enabled state + :param new_state: Boolean enabled True, disabled False :return: None """ - editor.EditorComponentAPIBus(bus.Broadcast, "DisableComponents", [self.id]) + if new_state: + editor.EditorComponentAPIBus(bus.Broadcast, "EnableComponents", [self.id]) + else: + editor.EditorComponentAPIBus(bus.Broadcast, "DisableComponents", [self.id]) - def enable_component(self): + def disable_component(self): """ - used to enable the componet using its id value + Used to disable the component using its id value. + :return: None """ - editor.EditorComponentAPIBus(bus.Broadcast, "EnabledComponents", [self.id]) + warnings.warn("disable_component is deprecated, use set_enabled(False) instead.", DeprecationWarning) + editor.EditorComponentAPIBus(bus.Broadcast, "DisableComponents", [self.id]) @staticmethod - def get_type_ids(component_names: list, entity_type: str ='Game') -> list: + def get_type_ids(component_names: list, entity_type: Entity_Type = Entity_Type.GAME) -> list: """ Used to get type ids of given components list - :param: component_names: List of components to get type ids - :return: List of type ids of given components. + :param component_names: List of components to get type ids + :param entity_type: Entity_Type enum value Entity_Type.GAME is the default + :return: List of type ids of given components. Type id is a UUID as provided by the ebus call """ - if entity_type.lower() == 'level': - entity_type = azlmbr.entity.EntityType().Level - else: - entity_type = azlmbr.entity.EntityType().Game type_ids = editor.EditorComponentAPIBus( bus.Broadcast, "FindComponentTypeIdsByEntityType", component_names, entity_type) return type_ids @@ -402,7 +424,7 @@ class EditorEntity: :return: List of newly added components to the entity """ components = [] - type_ids = EditorComponent.get_type_ids(component_names) + type_ids = EditorComponent.get_type_ids(component_names, Entity_Type.GAME) for type_id in type_ids: new_comp = EditorComponent(type_id) add_component_outcome = editor.EditorComponentAPIBus( @@ -430,7 +452,7 @@ class EditorEntity: :param component_names: List of component names to remove :return: None """ - type_ids = EditorComponent.get_type_ids(component_names) + type_ids = EditorComponent.get_type_ids(component_names, Entity_Type.GAME) for type_id in type_ids: remove_outcome = editor.EditorComponentAPIBus(bus.Broadcast, "RemoveComponents", self.id, [type_id]) assert ( @@ -444,7 +466,7 @@ class EditorEntity: :return: List of Entity Component objects of given component name """ component_list = [] - type_ids = EditorComponent.get_type_ids(component_names) + type_ids = EditorComponent.get_type_ids(component_names, Entity_Type.GAME) for type_id in type_ids: component = EditorComponent(type_id) get_component_of_type_outcome = editor.EditorComponentAPIBus( @@ -464,7 +486,7 @@ class EditorEntity: :param component_name: Name of component to check for :return: True, if entity has specified component. Else, False """ - type_ids = EditorComponent.get_type_ids([component_name]) + type_ids = EditorComponent.get_type_ids([component_name], Entity_Type.GAME) return editor.EditorComponentAPIBus(bus.Broadcast, "HasComponentOfType", self.id, type_ids[0]) def get_start_status(self) -> int: @@ -666,7 +688,7 @@ class EditorLevelEntity: :return: List of newly added components to the level """ components = [] - type_ids = EditorComponent.get_type_ids(component_names, 'level') + type_ids = EditorComponent.get_type_ids(component_names, Entity_Type.LEVEL) for type_id in type_ids: new_comp = EditorComponent(type_id) add_component_outcome = editor.EditorLevelComponentAPIBus( @@ -687,7 +709,7 @@ class EditorLevelEntity: :return: List of Level Component objects of given component name """ component_list = [] - type_ids = EditorComponent.get_type_ids(component_names, 'level') + type_ids = EditorComponent.get_type_ids(component_names, Entity_Type.LEVEL) for type_id in type_ids: component = EditorComponent(type_id) get_component_of_type_outcome = editor.EditorLevelComponentAPIBus( @@ -708,7 +730,7 @@ class EditorLevelEntity: :param component_name: Name of component to check for :return: True, if level has specified component. Else, False """ - type_ids = EditorComponent.get_type_ids([component_name], 'level') + type_ids = EditorComponent.get_type_ids([component_name], Entity_Type.LEVEL) return editor.EditorLevelComponentAPIBus(bus.Broadcast, "HasComponentOfType", type_ids[0]) @staticmethod @@ -718,5 +740,5 @@ class EditorLevelEntity: :param component_name: Name of component to check for :return: integer count of occurences of level component attached to level or zero if none are present """ - type_ids = EditorComponent.get_type_ids([component_name], 'level') + type_ids = EditorComponent.get_type_ids([component_name], Entity_Type.LEVEL) return editor.EditorLevelComponentAPIBus(bus.Broadcast, "CountComponentsOfType", type_ids[0]) From 0f2e33af680e608eb622821deee0bd063534d292 Mon Sep 17 00:00:00 2001 From: evanchia Date: Mon, 3 Jan 2022 16:48:20 -0800 Subject: [PATCH 278/948] Changed test artifact upload check Signed-off-by: evanchia --- scripts/build/Jenkins/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build/Jenkins/Jenkinsfile b/scripts/build/Jenkins/Jenkinsfile index 9e013fd816..ec40840fa6 100644 --- a/scripts/build/Jenkins/Jenkinsfile +++ b/scripts/build/Jenkins/Jenkinsfile @@ -610,7 +610,7 @@ def CreateSingleNode(Map pipelineConfig, def platform, def build_job, Map envVar CreateUploadAPLogsStage(platform.key, build_job_name, envVars['WORKSPACE'], platform.value.build_types[build_job_name].PARAMETERS).call() } // Upload test artifacts only on builds that failed and ran test suites - if (env.IS_UPLOAD_TEST_ARTIFACTS?.toBoolean() && params.containsKey('CMAKE_TARGET') && params.CMAKE_TARGET.contains("TEST_SUITE")) { + if (env.IS_UPLOAD_TEST_ARTIFACTS?.toBoolean() && params.containsKey('CTEST_OPTIONS')) { CreateUploadTestArtifactStage(build_job_name, envVars['WORKSPACE'], params.OUTPUT_DIRECTORY).call() } // All other errors will be raised outside the retry block From f9404baabcafc1670a8653e2667dffb2c2cc929d Mon Sep 17 00:00:00 2001 From: abrmich Date: Wed, 22 Dec 2021 17:32:20 -0800 Subject: [PATCH 279/948] Move LyShine shader to the gem Signed-off-by: abrmich --- .../Assets => LyShine/Assets/LyShine}/Shaders/LyShineUI.azsl | 0 .../Assets => LyShine/Assets/LyShine}/Shaders/LyShineUI.shader | 0 .../Assets/LyShine}/Shaders/LyShineUI.shadervariantlist | 0 Gems/LyShine/Code/Source/UiRenderer.cpp | 2 +- 4 files changed, 1 insertion(+), 1 deletion(-) rename Gems/{AtomLyIntegration/AtomBridge/Assets => LyShine/Assets/LyShine}/Shaders/LyShineUI.azsl (100%) rename Gems/{AtomLyIntegration/AtomBridge/Assets => LyShine/Assets/LyShine}/Shaders/LyShineUI.shader (100%) rename Gems/{AtomLyIntegration/AtomBridge/Assets => LyShine/Assets/LyShine}/Shaders/LyShineUI.shadervariantlist (100%) diff --git a/Gems/AtomLyIntegration/AtomBridge/Assets/Shaders/LyShineUI.azsl b/Gems/LyShine/Assets/LyShine/Shaders/LyShineUI.azsl similarity index 100% rename from Gems/AtomLyIntegration/AtomBridge/Assets/Shaders/LyShineUI.azsl rename to Gems/LyShine/Assets/LyShine/Shaders/LyShineUI.azsl diff --git a/Gems/AtomLyIntegration/AtomBridge/Assets/Shaders/LyShineUI.shader b/Gems/LyShine/Assets/LyShine/Shaders/LyShineUI.shader similarity index 100% rename from Gems/AtomLyIntegration/AtomBridge/Assets/Shaders/LyShineUI.shader rename to Gems/LyShine/Assets/LyShine/Shaders/LyShineUI.shader diff --git a/Gems/AtomLyIntegration/AtomBridge/Assets/Shaders/LyShineUI.shadervariantlist b/Gems/LyShine/Assets/LyShine/Shaders/LyShineUI.shadervariantlist similarity index 100% rename from Gems/AtomLyIntegration/AtomBridge/Assets/Shaders/LyShineUI.shadervariantlist rename to Gems/LyShine/Assets/LyShine/Shaders/LyShineUI.shadervariantlist diff --git a/Gems/LyShine/Code/Source/UiRenderer.cpp b/Gems/LyShine/Code/Source/UiRenderer.cpp index ea5dfdd134..b43be90a36 100644 --- a/Gems/LyShine/Code/Source/UiRenderer.cpp +++ b/Gems/LyShine/Code/Source/UiRenderer.cpp @@ -57,7 +57,7 @@ void UiRenderer::OnBootstrapSceneReady(AZ::RPI::Scene* bootstrapScene) // At this point the RPI is ready for use // Load the UI shader - const char* uiShaderFilepath = "Shaders/LyShineUI.azshader"; + const char* uiShaderFilepath = "LyShine/Shaders/LyShineUI.azshader"; AZ::Data::Instance uiShader = AZ::RPI::LoadCriticalShader(uiShaderFilepath); // Create scene to be used by the dynamic draw context From 95245e2424681d2b86c35cb1c7f9847540ff2451 Mon Sep 17 00:00:00 2001 From: Benjamin Jillich <43751992+amzn-jillich@users.noreply.github.com> Date: Tue, 4 Jan 2022 09:13:14 +0100 Subject: [PATCH 280/948] EMotion FX: Linear and angular velocity calculation and debug visualization helpers (#6613) * Added helper functions for calculating linear and angular velocities. * Added debug visualization helper for linear and angular velocities. Signed-off-by: Benjamin Jillich --- .../Code/EMotionFX/Source/Velocity.cpp | 83 +++++++++++++++++++ .../Code/EMotionFX/Source/Velocity.h | 23 +++++ .../Code/EMotionFX/emotionfx_files.cmake | 2 + 3 files changed, 108 insertions(+) create mode 100644 Gems/EMotionFX/Code/EMotionFX/Source/Velocity.cpp create mode 100644 Gems/EMotionFX/Code/EMotionFX/Source/Velocity.h diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/Velocity.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/Velocity.cpp new file mode 100644 index 0000000000..e02262fa8e --- /dev/null +++ b/Gems/EMotionFX/Code/EMotionFX/Source/Velocity.cpp @@ -0,0 +1,83 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include + +namespace EMotionFX +{ + AZ::Vector3 CalculateLinearVelocity(const AZ::Vector3& lastPosition, + const AZ::Vector3& currentPosition, + float timeDelta) + { + if (timeDelta <= AZ::Constants::FloatEpsilon) + { + return AZ::Vector3::CreateZero(); + } + + const AZ::Vector3 deltaPosition = currentPosition - lastPosition; + const AZ::Vector3 velocity = deltaPosition / timeDelta; + + if (velocity.GetLength() > AZ::Constants::FloatEpsilon) + { + return velocity; + } + + return AZ::Vector3::CreateZero(); + } + + AZ::Vector3 CalculateAngularVelocity(const AZ::Quaternion& lastRotation, + const AZ::Quaternion& currentRotation, + float timeDelta) + { + if (timeDelta <= AZ::Constants::FloatEpsilon) + { + return AZ::Vector3::CreateZero(); + } + + const AZ::Quaternion deltaRotation = currentRotation * lastRotation.GetInverseFull(); + const AZ::Quaternion shortestEquivalent = deltaRotation.GetShortestEquivalent().GetNormalized(); + const AZ::Vector3 scaledAxisAngle = shortestEquivalent.ConvertToScaledAxisAngle(); + const AZ::Vector3 angularVelocity = scaledAxisAngle / timeDelta; + + if (angularVelocity.GetLength() > AZ::Constants::FloatEpsilon) + { + return angularVelocity; + } + + return AZ::Vector3::CreateZero(); + } + + void DebugDrawVelocity(AzFramework::DebugDisplayRequests& debugDisplay, + const AZ::Vector3& position, const AZ::Vector3& velocity, const AZ::Color& color) + { + // Don't visualize joints that remain motionless (zero velocity). + if (velocity.GetLength() < AZ::Constants::FloatEpsilon) + { + return; + } + + const float scale = 0.15f; + const AZ::Vector3 arrowPosition = position + velocity; + + debugDisplay.DepthTestOff(); + debugDisplay.SetColor(color); + + debugDisplay.DrawSolidCylinder(/*center=*/(arrowPosition + position) * 0.5f, + /*direction=*/(arrowPosition - position).GetNormalizedSafe(), + /*radius=*/0.003f, + /*height=*/(arrowPosition - position).GetLength(), + /*drawShaded=*/false); + + debugDisplay.DrawSolidCone(position + velocity, + velocity, + 0.1f * scale, + scale * 0.5f, + /*drawShaded=*/false); + } +} // namespace EMotionFX diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/Velocity.h b/Gems/EMotionFX/Code/EMotionFX/Source/Velocity.h new file mode 100644 index 0000000000..a37a888024 --- /dev/null +++ b/Gems/EMotionFX/Code/EMotionFX/Source/Velocity.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include +#include +#include + +namespace EMotionFX +{ + AZ::Vector3 EMFX_API CalculateLinearVelocity(const AZ::Vector3& lastPosition, const AZ::Vector3& currentPosition, float timeDelta); + AZ::Vector3 EMFX_API CalculateAngularVelocity(const AZ::Quaternion& lastRotation, const AZ::Quaternion& currentRotation, float timeDelta); + + void EMFX_API DebugDrawVelocity(AzFramework::DebugDisplayRequests& debugDisplay, + const AZ::Vector3& position, const AZ::Vector3& velocity, const AZ::Color& color); +} // namespace EMotionFX diff --git a/Gems/EMotionFX/Code/EMotionFX/emotionfx_files.cmake b/Gems/EMotionFX/Code/EMotionFX/emotionfx_files.cmake index 8135f14f12..52c9d6aa15 100644 --- a/Gems/EMotionFX/Code/EMotionFX/emotionfx_files.cmake +++ b/Gems/EMotionFX/Code/EMotionFX/emotionfx_files.cmake @@ -144,6 +144,8 @@ set(FILES Source/TransformData.h Source/TriggerActionSetup.cpp Source/TriggerActionSetup.h + Source/Velocity.cpp + Source/Velocity.h Source/VertexAttributeLayer.cpp Source/VertexAttributeLayer.h Source/VertexAttributeLayerAbstractData.cpp From aefe1aa8b9e82f3fccb86cb053d2656d70d35fc2 Mon Sep 17 00:00:00 2001 From: Tobias Alexander Franke Date: Thu, 16 Dec 2021 11:43:24 +0800 Subject: [PATCH 281/948] Fix: Tube spline Signed-off-by: T.J. McGrath-Daly --- Gems/LmbrCentral/Code/Source/Shape/TubeShapeComponent.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Gems/LmbrCentral/Code/Source/Shape/TubeShapeComponent.cpp b/Gems/LmbrCentral/Code/Source/Shape/TubeShapeComponent.cpp index d96fc8c9ce..194204dd93 100644 --- a/Gems/LmbrCentral/Code/Source/Shape/TubeShapeComponent.cpp +++ b/Gems/LmbrCentral/Code/Source/Shape/TubeShapeComponent.cpp @@ -124,8 +124,14 @@ namespace LmbrCentral void TubeShapeDebugDisplayComponent::GenerateVertices() { + if (!m_spline) + { + AZ_Error("TubeShapeComponent", false, "A TubeShape must have a Spline to work"); + return; + } + const AZ::u32 endSegments = m_spline->IsClosed() ? 0 : m_tubeShapeMeshConfig.m_endSegments; GenerateTubeMesh( - m_spline, m_radiusAttribute, m_radius, m_tubeShapeMeshConfig.m_endSegments, + m_spline, m_radiusAttribute, m_radius, endSegments, m_tubeShapeMeshConfig.m_sides, m_tubeShapeMesh.m_vertexBuffer, m_tubeShapeMesh.m_indexBuffer, m_tubeShapeMesh.m_lineBuffer); } From c7d72bc6b68a93e194466eac80fdb17d78acf22f Mon Sep 17 00:00:00 2001 From: Tobias Alexander Franke Date: Wed, 17 Nov 2021 15:30:46 +0800 Subject: [PATCH 282/948] Ragdoll saving issue Signed-off-by: T.J. McGrath-Daly --- .../Code/Source/Editor/Plugins/Ragdoll/RagdollNodeWidget.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Gems/EMotionFX/Code/Source/Editor/Plugins/Ragdoll/RagdollNodeWidget.cpp b/Gems/EMotionFX/Code/Source/Editor/Plugins/Ragdoll/RagdollNodeWidget.cpp index 29745beb68..538ad3ba52 100644 --- a/Gems/EMotionFX/Code/Source/Editor/Plugins/Ragdoll/RagdollNodeWidget.cpp +++ b/Gems/EMotionFX/Code/Source/Editor/Plugins/Ragdoll/RagdollNodeWidget.cpp @@ -125,6 +125,10 @@ namespace EMotionFX Physics::RagdollNodeConfiguration* ragdollNodeConfig = GetRagdollNodeConfig(); if (ragdollNodeConfig) { + AzPhysics::JointConfiguration* jointLimitConfig = ragdollNodeConfig->m_jointConfig.get(); + jointLimitConfig->SetPropertyVisibility(AzPhysics::JointConfiguration::PropertyVisibility::ParentLocalRotation, jointLimitConfig != nullptr); + jointLimitConfig->SetPropertyVisibility(AzPhysics::JointConfiguration::PropertyVisibility::ChildLocalRotation, jointLimitConfig != nullptr); + m_addColliderButton->show(); m_addRemoveButton->setText("Remove from ragdoll"); From e4880cf9a18617b2504cf64ac73bc6b16996777c Mon Sep 17 00:00:00 2001 From: Tobias Alexander Franke Date: Tue, 21 Dec 2021 19:35:34 +0800 Subject: [PATCH 283/948] Fix: Right hand bones misplaced Signed-off-by: T.J. McGrath-Daly --- .../Code/EMotionFX/Rendering/Common/RenderUtil.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/RenderUtil.cpp b/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/RenderUtil.cpp index 6fd28ee72f..b1dd26061a 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/RenderUtil.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/RenderUtil.cpp @@ -952,7 +952,15 @@ namespace MCommon } else { - worldTM = AZ::Transform::CreateFromQuaternion(MCore::AzEulerAnglesToAzQuat(0.0f, 0.0f, MCore::Math::DegreesToRadians(180.0f))); + if (direction.GetX() > 0) + { + worldTM = AZ::Transform::CreateFromQuaternion(MCore::AzEulerAnglesToAzQuat(MCore::Math::DegreesToRadians(180.0f), 0.0f, MCore::Math::DegreesToRadians(180.0f))); + } + else + { + worldTM = AZ::Transform::CreateFromQuaternion(MCore::AzEulerAnglesToAzQuat(0.0f, 0.0f, 0.0f)); + } + } // set the cylinder to the given position From 07c862bd5295093ffd975bfa9fee07a154ffefbc Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Tue, 4 Jan 2022 08:37:58 -0600 Subject: [PATCH 284/948] Fix string format specifier. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- Gems/Terrain/Code/Tests/TerrainSystemBenchmarks.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/Terrain/Code/Tests/TerrainSystemBenchmarks.cpp b/Gems/Terrain/Code/Tests/TerrainSystemBenchmarks.cpp index b921681ab5..3d0cb5222e 100644 --- a/Gems/Terrain/Code/Tests/TerrainSystemBenchmarks.cpp +++ b/Gems/Terrain/Code/Tests/TerrainSystemBenchmarks.cpp @@ -250,7 +250,7 @@ namespace UnitTest // Give each gradient a new surface tag surfaceConfig.m_gradientSurfaceMappings.emplace_back( - surfaceGradientEntity->GetId(), SurfaceData::SurfaceTag(AZStd::string::format("test%zu", surfaces))); + surfaceGradientEntity->GetId(), SurfaceData::SurfaceTag(AZStd::string::format("test%u", surfaces))); surfaceGradientEntities.emplace_back(AZStd::move(surfaceGradientEntity)); surfaceGradientShapeRequests.emplace_back(AZStd::move(shapeRequests)); From 6643b4b53cb209e57904c5ff6b51e08d481c98eb Mon Sep 17 00:00:00 2001 From: "T.J. McGrath-Daly" Date: Mon, 6 Dec 2021 08:48:24 +0800 Subject: [PATCH 285/948] Fix: LOD stops animation Signed-off-by: T.J. McGrath-Daly --- .../SkinnedMeshFeatureProcessor.cpp | 61 +++++++++++++------ 1 file changed, 41 insertions(+), 20 deletions(-) diff --git a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshFeatureProcessor.cpp index 37b18291dc..8cd20b77d5 100644 --- a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshFeatureProcessor.cpp @@ -204,35 +204,56 @@ namespace AZ // do the enumeration for each view, keep track of the lowest lod for each entry, // and submit the appropriate dispatch item - //the [1][1] element of a perspective projection matrix stores cot(FovY/2) (equal to 2*nearPlaneDistance/nearPlaneHeight), - //which is used to determine the (vertical) projected size in screen space - const float yScale = viewToClip.GetElement(1, 1); - const bool isPerspective = viewToClip.GetElement(3, 3) == 0.f; - const Vector3 cameraPos = view->GetViewToWorldMatrix().GetTranslation(); - - const Vector3 pos = cullable.m_cullData.m_boundingSphere.GetCenter(); + switch (cullable.m_lodData.m_lodConfiguration.m_lodType) + { + case RPI::Cullable::LodType::SpecificLod: + { + AZStd::lock_guard lock(m_dispatchItemMutex); + auto lodIndex = cullable.m_lodData.m_lodConfiguration.m_lodOverride; + m_skinningDispatches.insert(&renderProxy.m_dispatchItemsByLod[lodIndex]->GetRHIDispatchItem()); + for (size_t morphTargetIndex = 0; morphTargetIndex < renderProxy.m_morphTargetDispatchItemsByLod[lodIndex].size(); morphTargetIndex++) + { + const MorphTargetDispatchItem* dispatchItem = renderProxy.m_morphTargetDispatchItemsByLod[lodIndex][morphTargetIndex].get(); + if (dispatchItem && dispatchItem->GetWeight() > AZ::Constants::FloatEpsilon) + { + m_morphTargetDispatches.insert(&dispatchItem->GetRHIDispatchItem()); + } + } + } + break; + case RPI::Cullable::LodType::ScreenCoverage: + default: + //the [1][1] element of a perspective projection matrix stores cot(FovY/2) (equal to 2*nearPlaneDistance/nearPlaneHeight), + //which is used to determine the (vertical) projected size in screen space + const float yScale = viewToClip.GetElement(1, 1); + const bool isPerspective = viewToClip.GetElement(3, 3) == 0.f; + const Vector3 cameraPos = view->GetViewToWorldMatrix().GetTranslation(); - const float approxScreenPercentage = RPI::ModelLodUtils::ApproxScreenPercentage( - pos, cullable.m_lodData.m_lodSelectionRadius, cameraPos, yScale, isPerspective); + const Vector3 pos = cullable.m_cullData.m_boundingSphere.GetCenter(); - for (size_t lodIndex = 0; lodIndex < cullable.m_lodData.m_lods.size(); ++lodIndex) - { - const RPI::Cullable::LodData::Lod& lod = cullable.m_lodData.m_lods[lodIndex]; + const float approxScreenPercentage = RPI::ModelLodUtils::ApproxScreenPercentage( + pos, cullable.m_lodData.m_lodSelectionRadius, cameraPos, yScale, isPerspective); - //Note that this supports overlapping lod ranges (to support cross-fading lods, for example) - if (approxScreenPercentage >= lod.m_screenCoverageMin && approxScreenPercentage <= lod.m_screenCoverageMax) + for (size_t lodIndex = 0; lodIndex < cullable.m_lodData.m_lods.size(); ++lodIndex) { - AZStd::lock_guard lock(m_dispatchItemMutex); - m_skinningDispatches.insert(&renderProxy.m_dispatchItemsByLod[lodIndex]->GetRHIDispatchItem()); - for (size_t morphTargetIndex = 0; morphTargetIndex < renderProxy.m_morphTargetDispatchItemsByLod[lodIndex].size(); morphTargetIndex++) + const RPI::Cullable::LodData::Lod& lod = cullable.m_lodData.m_lods[lodIndex]; + + //Note that this supports overlapping lod ranges (to support cross-fading lods, for example) + if (approxScreenPercentage >= lod.m_screenCoverageMin && approxScreenPercentage <= lod.m_screenCoverageMax) { - const MorphTargetDispatchItem* dispatchItem = renderProxy.m_morphTargetDispatchItemsByLod[lodIndex][morphTargetIndex].get(); - if (dispatchItem && dispatchItem->GetWeight() > AZ::Constants::FloatEpsilon) + AZStd::lock_guard lock(m_dispatchItemMutex); + m_skinningDispatches.insert(&renderProxy.m_dispatchItemsByLod[lodIndex]->GetRHIDispatchItem()); + for (size_t morphTargetIndex = 0; morphTargetIndex < renderProxy.m_morphTargetDispatchItemsByLod[lodIndex].size(); morphTargetIndex++) { - m_morphTargetDispatches.insert(&dispatchItem->GetRHIDispatchItem()); + const MorphTargetDispatchItem* dispatchItem = renderProxy.m_morphTargetDispatchItemsByLod[lodIndex][morphTargetIndex].get(); + if (dispatchItem && dispatchItem->GetWeight() > AZ::Constants::FloatEpsilon) + { + m_morphTargetDispatches.insert(&dispatchItem->GetRHIDispatchItem()); + } } } } + break; } } } From cab09dc4aec745a2be94172645c9624c7b0126ff Mon Sep 17 00:00:00 2001 From: mrieggeramzn <61609885+mrieggeramzn@users.noreply.github.com> Date: Tue, 4 Jan 2022 08:27:43 -0800 Subject: [PATCH 286/948] Adding better decal culling (#6519) * Adding better decal culling Signed-off-by: mrieggeramzn * removing accidental commit Signed-off-by: mrieggeramzn * Breja's suggestion for decal sphere size estimation Signed-off-by: mrieggeramzn * Removing unused variable Signed-off-by: mrieggeramzn --- .../Assets/Shaders/LightCulling/LightCulling.azsl | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/LightCulling/LightCulling.azsl b/Gems/Atom/Feature/Common/Assets/Shaders/LightCulling/LightCulling.azsl index 707ede9868..e806bc7cb7 100644 --- a/Gems/Atom/Feature/Common/Assets/Shaders/LightCulling/LightCulling.azsl +++ b/Gems/Atom/Feature/Common/Assets/Shaders/LightCulling/LightCulling.azsl @@ -368,16 +368,19 @@ void CullDecals(uint groupIndex, TileLightData tileLightData, float3 aabb_center float3 decalPosition = WorldToView_Point(decal.m_position); // just wrapping a bounding sphere around a cube for now to get a minor perf boost. i.e. the sphere radius is sqrt(x*x + y*y + z*z) - // ATOM-4224 - try AABB-AABB and implement depth binning for the decals - float maxHalfSize = max(max(decal.m_halfSize.x, decal.m_halfSize.y), decal.m_halfSize.z); - float boundingSphereRadiusSqr = maxHalfSize * maxHalfSize * 3; + // ATOM-4224 - try AABB-AABB + float boundingSphereRadiusSqr = dot(decal.m_halfSize, decal.m_halfSize); bool potentiallyIntersects = TestSphereVsAabb(decalPosition, boundingSphereRadiusSqr, aabb_center, aabb_extents); + if (potentiallyIntersects) { - // Implement and profile fine-grained light culling testing - // ATOM-3732 - MarkLightAsVisibleInSharedMemory(decalIndex, 0xFFFF); + uint inside = 0; + float2 minmax = ComputePointLightMinMaxZ(sqrt(boundingSphereRadiusSqr), decalPosition); + if (IsObjectInsideTile(tileLightData, minmax, inside)) + { + MarkLightAsVisibleInSharedMemory(decalIndex, inside); + } } } } From 03f6ba55fd1d1ae58aa2d67a19ddc26266d0fe36 Mon Sep 17 00:00:00 2001 From: mrieggeramzn <61609885+mrieggeramzn@users.noreply.github.com> Date: Tue, 4 Jan 2022 08:29:34 -0800 Subject: [PATCH 287/948] Adding cascade blending for pcf (#6181) * Adding cascade blending for pcf Signed-off-by: mrieggeramzn * tabs to spaces Signed-off-by: mrieggeramzn * tabs to spaces Signed-off-by: mrieggeramzn * tabs 2 spaces Signed-off-by: mrieggeramzn * Feedback using min3 Signed-off-by: mrieggeramzn * Only enable flag if > 1 cascade Signed-off-by: mrieggeramzn * no blending if last cascade Signed-off-by: mrieggeramzn * Remove unused Signed-off-by: mrieggeramzn --- .../Shadow/DirectionalLightShadow.azsli | 52 +++++++++++++++++-- ...irectionalLightFeatureProcessorInterface.h | 3 ++ .../DirectionalLightFeatureProcessor.cpp | 13 +++-- .../DirectionalLightFeatureProcessor.h | 4 ++ .../CoreLights/DirectionalLightBus.h | 8 +++ .../DirectionalLightComponentConfig.h | 3 ++ .../DirectionalLightComponentConfig.cpp | 6 +-- .../DirectionalLightComponentController.cpp | 17 +++++- .../DirectionalLightComponentController.h | 4 +- .../EditorDirectionalLightComponent.cpp | 6 ++- 10 files changed, 104 insertions(+), 12 deletions(-) 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 59817af701..870bebdf4b 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 @@ -10,6 +10,7 @@ #include #include +#include #include "Shadow.azsli" #include "ShadowmapAtlasLib.azsli" #include "BicubicPcfFilters.azsli" @@ -25,6 +26,10 @@ enum class ShadowFilterMethod {None, Pcf, Esm, EsmPcf}; option ShadowFilterMethod o_directional_shadow_filtering_method = ShadowFilterMethod::None; option bool o_directional_shadow_receiver_plane_bias_enable = true; +option bool o_blend_between_cascades_enable = false; + +static const float CascadeBlendArea = 0.015f; // might be worth exposing this as a slider. + // DirectionalLightShadow calculates lit ratio for a directional light. class DirectionalLightShadow @@ -98,6 +103,8 @@ class DirectionalLightShadow float SamplePcfBicubic(float3 shadowCoord, uint indexOfCascade); + float CalculateCascadeBlendAmount(const float3 texCoord); + uint m_lightIndex; float3 m_shadowCoords[ViewSrg::MaxCascadeCount]; float m_slopeBias[ViewSrg::MaxCascadeCount]; @@ -174,6 +181,7 @@ bool2 DirectionalLightShadow::IsShadowed(float3 shadowCoord, uint indexOfCascade const uint cascadeCount = ViewSrg::m_directionalLightShadows[m_lightIndex].m_cascadeCount; Texture2DArray shadowmap = PassSrg::m_directionalLightShadowmap; + [branch] if (shadowCoord.x >= 0. && shadowCoord.x * size < size - PixelMargin && shadowCoord.y >= 0. && shadowCoord.y * size < size - PixelMargin) { @@ -213,20 +221,46 @@ float DirectionalLightShadow::GetVisibilityFromLightPcf() static const float PixelMargin = 1.5; // avoiding artifact between cascade levels. static const float DepthMargin = 1e-8; // avoiding artifact when near depth bounds. + bool cascadeFound = false; + int currentCascadeIndex = 0; + const uint size = ViewSrg::m_directionalLightShadows[m_lightIndex].m_shadowmapSize; const uint cascadeCount = ViewSrg::m_directionalLightShadows[m_lightIndex].m_cascadeCount; for (uint indexOfCascade = 0; indexOfCascade < cascadeCount; ++indexOfCascade) { const float3 shadowCoord = m_shadowCoords[indexOfCascade]; - + if (shadowCoord.x >= 0. && shadowCoord.x * size < size - PixelMargin && shadowCoord.y >= 0. && shadowCoord.y * size < size - PixelMargin && shadowCoord.z < 1. - DepthMargin) { - m_debugInfo.m_cascadeIndex = indexOfCascade; - return SamplePcfBicubic(shadowCoord, indexOfCascade); + currentCascadeIndex = m_debugInfo.m_cascadeIndex = indexOfCascade; + cascadeFound = true; + break; } } + + [branch] + if (cascadeFound) + { + float lit = SamplePcfBicubic(m_shadowCoords[currentCascadeIndex], currentCascadeIndex); + + if(o_blend_between_cascades_enable) + { + const float blendBetweenCascadesAmount = CalculateCascadeBlendAmount(m_shadowCoords[currentCascadeIndex].xyz); + + const int nextCascadeIndex = currentCascadeIndex + 1; + [branch] + if (blendBetweenCascadesAmount < 1.0f && nextCascadeIndex < cascadeCount) + { + const float nextLit = SamplePcfBicubic(m_shadowCoords[nextCascadeIndex], nextCascadeIndex); + lit = lerp(nextLit, lit, blendBetweenCascadesAmount); + } + } + + return lit; + } + m_debugInfo.m_cascadeIndex = cascadeCount; return 1.; } @@ -244,6 +278,8 @@ float DirectionalLightShadow::GetVisibilityFromLightEsm() const float distanceMin = ViewSrg::m_esmsDirectional[indexOfCascade].m_lightDistanceOfCameraViewFrustum; bool2 checkedShadowed = IsShadowed(shadowCoord, indexOfCascade); const float depthDiff = shadowCoord.z - distanceMin; + + [branch] if (checkedShadowed.x && depthDiff >= 0) { const float distanceWithinCameraView = depthDiff / (1. - distanceMin); @@ -274,6 +310,8 @@ float DirectionalLightShadow::GetVisibilityFromLightEsmPcf() const float distanceMin = ViewSrg::m_esmsDirectional[indexOfCascade].m_lightDistanceOfCameraViewFrustum; bool2 checkedShadowed = IsShadowed(shadowCoord, indexOfCascade); const float depthDiff = shadowCoord.z - distanceMin; + + [branch] if (checkedShadowed.x && depthDiff >= 0) { const float distanceWithinCameraView = depthDiff / (1. - distanceMin); @@ -319,6 +357,7 @@ float DirectionalLightShadow::SamplePcfBicubic(float3 shadowCoord, uint indexOfC param.samplerState = SceneSrg::m_hwPcfSampler; param.receiverPlaneDepthBias = o_directional_shadow_receiver_plane_bias_enable ? ComputeReceiverPlaneDepthBias(m_shadowPosDX[indexOfCascade], m_shadowPosDY[indexOfCascade]) : 0; + [branch] if (filteringSampleCount <= 4) { return SampleShadowMapBicubic_4Tap(param); @@ -420,3 +459,10 @@ float3 DirectionalLightShadow::AddDebugColoring( } return color; } + +float DirectionalLightShadow::CalculateCascadeBlendAmount(const float3 texCoord) +{ + const float distanceToOneMin = min3(1.0f - texCoord); + const float currentPixelsBlendBandLocation = min(min(texCoord.x, texCoord.y), distanceToOneMin); + return currentPixelsBlendBandLocation / CascadeBlendArea; +} diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/CoreLights/DirectionalLightFeatureProcessorInterface.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/CoreLights/DirectionalLightFeatureProcessorInterface.h index fa987a7156..6119585d9d 100644 --- a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/CoreLights/DirectionalLightFeatureProcessorInterface.h +++ b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/CoreLights/DirectionalLightFeatureProcessorInterface.h @@ -163,6 +163,9 @@ namespace AZ //! Reduces acne by biasing the shadowmap lookup along the geometric normal. virtual void SetNormalShadowBias(LightHandle handle, float normalShadowBias) = 0; + + //! Sets whether or not blending between shadow map cascades is enabled. + virtual void SetCascadeBlendingEnabled(LightHandle handle, bool enable) = 0; }; } // namespace Render } // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.cpp index ee60ff412a..5cf65adcee 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.cpp @@ -198,13 +198,15 @@ namespace AZ if (m_shadowingLightHandle.IsValid()) { - uint32_t shadowFilterMethod = m_shadowData.at(nullptr).GetData(m_shadowingLightHandle.GetIndex()).m_shadowFilterMethod; + const uint32_t shadowFilterMethod = m_shadowData.at(nullptr).GetData(m_shadowingLightHandle.GetIndex()).m_shadowFilterMethod; RPI::ShaderSystemInterface::Get()->SetGlobalShaderOption(m_directionalShadowFilteringMethodName, AZ::RPI::ShaderOptionValue{shadowFilterMethod}); - RPI::ShaderSystemInterface::Get()->SetGlobalShaderOption(m_directionalShadowReceiverPlaneBiasEnableName, AZ::RPI::ShaderOptionValue{ m_shadowProperties.GetData(m_shadowingLightHandle.GetIndex()).m_isReceiverPlaneBiasEnabled }); + RPI::ShaderSystemInterface::Get()->SetGlobalShaderOption(m_directionalShadowReceiverPlaneBiasEnableName, AZ::RPI::ShaderOptionValue{ m_shadowProperties.GetData(m_shadowingLightHandle.GetIndex()).m_isReceiverPlaneBiasEnabled }); const uint32_t cascadeCount = m_shadowData.at(nullptr).GetData(m_shadowingLightHandle.GetIndex()).m_cascadeCount; - ShadowProperty& property = m_shadowProperties.GetData(m_shadowingLightHandle.GetIndex()); + RPI::ShaderSystemInterface::Get()->SetGlobalShaderOption(m_BlendBetweenCascadesEnableName, AZ::RPI::ShaderOptionValue{cascadeCount > 1 && m_shadowProperties.GetData(m_shadowingLightHandle.GetIndex()).m_blendBetwenCascades }); + + ShadowProperty& property = m_shadowProperties.GetData(m_shadowingLightHandle.GetIndex()); bool segmentsNeedUpdate = property.m_segments.empty(); for (const auto& passIt : m_cascadedShadowmapsPasses) { @@ -577,6 +579,11 @@ namespace AZ m_shadowProperties.GetData(handle.GetIndex()).m_isReceiverPlaneBiasEnabled = enable; } + void DirectionalLightFeatureProcessor::SetCascadeBlendingEnabled(LightHandle handle, bool enable) + { + m_shadowProperties.GetData(handle.GetIndex()).m_blendBetwenCascades = enable; + } + void DirectionalLightFeatureProcessor::SetShadowBias(LightHandle handle, float bias) { for (auto& it : m_shadowData) diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.h b/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.h index c206a5097f..83ab7cb15b 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.h +++ b/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.h @@ -176,6 +176,8 @@ namespace AZ // If true, this will reduce the shadow acne introduced by large pcf kernels by estimating the angle of the triangle being shaded // with the ddx/ddy functions. bool m_isReceiverPlaneBiasEnabled = true; + + bool m_blendBetwenCascades = false; }; static void Reflect(ReflectContext* context); @@ -215,6 +217,7 @@ namespace AZ void SetShadowFilterMethod(LightHandle handle, ShadowFilterMethod method) override; void SetFilteringSampleCount(LightHandle handle, uint16_t count) override; void SetShadowReceiverPlaneBiasEnabled(LightHandle handle, bool enable) override; + void SetCascadeBlendingEnabled(LightHandle handle, bool enable) override; void SetShadowBias(LightHandle handle, float bias) override; void SetNormalShadowBias(LightHandle handle, float normalShadowBias) override; @@ -367,6 +370,7 @@ namespace AZ Name m_lightTypeName = Name("directional"); Name m_directionalShadowFilteringMethodName = Name("o_directional_shadow_filtering_method"); Name m_directionalShadowReceiverPlaneBiasEnableName = Name("o_directional_shadow_receiver_plane_bias_enable"); + Name m_BlendBetweenCascadesEnableName = Name("o_blend_between_cascades_enable"); static constexpr const char* FeatureProcessorName = "DirectionalLightFeatureProcessor"; }; } // namespace Render diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/DirectionalLightBus.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/DirectionalLightBus.h index 3cafc183a5..ebccccadcd 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/DirectionalLightBus.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/DirectionalLightBus.h @@ -184,6 +184,14 @@ namespace AZ //! Reduces acne by biasing the shadowmap lookup along the geometric normal. //! @param normalShadowBias Sets the amount of normal shadow bias to apply. virtual void SetNormalShadowBias(float normalShadowBias) = 0; + + //! Gets whether the directional shadow map has cascade blending enabled. + //! This smooths out the border between cascades at the cost of some performance in the blend area. + virtual bool GetCascadeBlendingEnabled() const = 0; + + //! Sets whether the directional shadow map has cascade blending enabled. + //! @param enable flag specifying whether to enable cascade blending. + virtual void SetCascadeBlendingEnabled(bool enable) = 0; }; using DirectionalLightRequestBus = EBus; diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/DirectionalLightComponentConfig.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/DirectionalLightComponentConfig.h index 92d5cc9ac0..ca872d78d6 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/DirectionalLightComponentConfig.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/DirectionalLightComponentConfig.h @@ -115,6 +115,9 @@ namespace AZ //! Reduces shadow acne by applying a small amount of offset along shadow-space z. float m_shadowBias = 0.0f; + // If true, sample between two adjacent shadow map cascades in a small boundary area to smooth out the transition. + bool m_cascadeBlendingEnabled = false; + bool IsSplitManual() const; bool IsSplitAutomatic() const; bool IsCascadeCorrectionDisabled() const; diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentConfig.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentConfig.cpp index 78a9cc21d1..d9f93cc825 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentConfig.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentConfig.cpp @@ -40,7 +40,8 @@ namespace AZ ->Field("PcfFilteringSampleCount", &DirectionalLightComponentConfig::m_filteringSampleCount) ->Field("ShadowReceiverPlaneBiasEnabled", &DirectionalLightComponentConfig::m_receiverPlaneBiasEnabled) ->Field("Shadow Bias", &DirectionalLightComponentConfig::m_shadowBias) - ->Field("Normal Shadow Bias", &DirectionalLightComponentConfig::m_normalShadowBias); + ->Field("Normal Shadow Bias", &DirectionalLightComponentConfig::m_normalShadowBias) + ->Field("CascadeBlendingEnabled", &DirectionalLightComponentConfig::m_cascadeBlendingEnabled); } } @@ -113,8 +114,7 @@ namespace AZ bool DirectionalLightComponentConfig::IsShadowPcfDisabled() const { - return !(m_shadowFilterMethod == ShadowFilterMethod::Pcf || - m_shadowFilterMethod == ShadowFilterMethod::EsmPcf); + return !(m_shadowFilterMethod == ShadowFilterMethod::Pcf); } bool DirectionalLightComponentConfig::IsEsmDisabled() const diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentController.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentController.cpp index e36868c4bb..ce39a32b19 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentController.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentController.cpp @@ -88,6 +88,8 @@ namespace AZ ->Event("SetShadowBias", &DirectionalLightRequestBus::Events::SetShadowBias) ->Event("GetNormalShadowBias", &DirectionalLightRequestBus::Events::GetNormalShadowBias) ->Event("SetNormalShadowBias", &DirectionalLightRequestBus::Events::SetNormalShadowBias) + ->Event("GetCascadeBlendingEnabled", &DirectionalLightRequestBus::Events::GetCascadeBlendingEnabled) + ->Event("SetCascadeBlendingEnabled", &DirectionalLightRequestBus::Events::SetCascadeBlendingEnabled) ->VirtualProperty("Color", "GetColor", "SetColor") ->VirtualProperty("Intensity", "GetIntensity", "SetIntensity") ->VirtualProperty("AngularDiameter", "GetAngularDiameter", "SetAngularDiameter") @@ -104,7 +106,8 @@ namespace AZ ->VirtualProperty("FilteringSampleCount", "GetFilteringSampleCount", "SetFilteringSampleCount") ->VirtualProperty("ShadowReceiverPlaneBiasEnabled", "GetShadowReceiverPlaneBiasEnabled", "SetShadowReceiverPlaneBiasEnabled") ->VirtualProperty("ShadowBias", "GetShadowBias", "SetShadowBias") - ->VirtualProperty("NormalShadowBias", "GetNormalShadowBias", "SetNormalShadowBias"); + ->VirtualProperty("NormalShadowBias", "GetNormalShadowBias", "SetNormalShadowBias") + ->VirtualProperty("BlendBetweenCascadesEnabled", "GetCascadeBlendingEnabled", "SetCascadeBlendingEnabled"); ; } } @@ -537,6 +540,7 @@ namespace AZ SetNormalShadowBias(m_configuration.m_normalShadowBias); SetFilteringSampleCount(m_configuration.m_filteringSampleCount); SetShadowReceiverPlaneBiasEnabled(m_configuration.m_receiverPlaneBiasEnabled); + SetCascadeBlendingEnabled(m_configuration.m_cascadeBlendingEnabled); // [GFX TODO][ATOM-1726] share config for multiple light (e.g., light ID). // [GFX TODO][ATOM-2416] adapt to multiple viewports. @@ -636,5 +640,16 @@ namespace AZ m_featureProcessor->SetShadowReceiverPlaneBiasEnabled(m_lightHandle, enable); } + bool DirectionalLightComponentController::GetCascadeBlendingEnabled() const + { + return m_configuration.m_cascadeBlendingEnabled; + } + + void DirectionalLightComponentController::SetCascadeBlendingEnabled(bool enable) + { + m_configuration.m_cascadeBlendingEnabled = enable; + m_featureProcessor->SetCascadeBlendingEnabled(m_lightHandle, enable); + } + } // namespace Render } // namespace AZ diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentController.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentController.h index 9a6edda666..4aa8aed2fd 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentController.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentController.h @@ -83,7 +83,9 @@ namespace AZ float GetShadowBias() const override; void SetShadowBias(float bias) override; float GetNormalShadowBias() const override; - void SetNormalShadowBias(float bias) override; + void SetNormalShadowBias(float bias) override; + bool GetCascadeBlendingEnabled() const override; + void SetCascadeBlendingEnabled(bool enable) override; private: friend class EditorDirectionalLightComponent; diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorDirectionalLightComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorDirectionalLightComponent.cpp index 545064b86f..2b1510b861 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorDirectionalLightComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorDirectionalLightComponent.cpp @@ -161,7 +161,11 @@ namespace AZ ->Attribute(Edit::Attributes::Min, 0.f) ->Attribute(Edit::Attributes::Max, 10.0f) ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) - ; + ->DataElement( + Edit::UIHandlers::CheckBox, &DirectionalLightComponentConfig::m_cascadeBlendingEnabled, + "Blend between cascades\n", "Enables smooth blending between shadow map cascades.") + ->Attribute(Edit::Attributes::ReadOnly, &DirectionalLightComponentConfig::IsShadowPcfDisabled) + ; } } From c15ead9c30048ad5a2cf49eae9fbad0518e78779 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Tue, 4 Jan 2022 10:32:52 -0600 Subject: [PATCH 288/948] Removed unused bone name class. Signed-off-by: Chris Galvan --- .../Animation/AnimationBipedBoneNames.cpp | 30 ---------------- .../Animation/AnimationBipedBoneNames.h | 34 ------------------- Code/Editor/editor_lib_files.cmake | 2 -- 3 files changed, 66 deletions(-) delete mode 100644 Code/Editor/Animation/AnimationBipedBoneNames.cpp delete mode 100644 Code/Editor/Animation/AnimationBipedBoneNames.h diff --git a/Code/Editor/Animation/AnimationBipedBoneNames.cpp b/Code/Editor/Animation/AnimationBipedBoneNames.cpp deleted file mode 100644 index 72502fe61d..0000000000 --- a/Code/Editor/Animation/AnimationBipedBoneNames.cpp +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#include "EditorDefs.h" - -#include "AnimationBipedBoneNames.h" - -namespace EditorAnimationBones::Biped -{ - const char* Pelvis = "Bip01 Pelvis"; - const char* Head = "Bip01 Head"; - const char* Weapon = "weapon_bone"; - - const char* LeftEye = "eye_bone_left"; - const char* RightEye = "eye_bone_right"; - - const char* Spine[5] = { "Bip01 Spine", "Bip01 Spine1", "Bip01 Spine2", "Bip01 Spine3", "Bip01 Spine4" }; - const char* Neck[2] = { "Bip01 Neck", "Bip01 Neck1" }; - - const char* LeftHeel = "Bip01 L Heel"; - const char* LeftToe[2] = { "Bip01 L Toe0", "Bip01 L Toe1" }; - - const char* RightHeel = "Bip01 R Heel"; - const char* RightToe[2] = { "Bip01 R Toe0", "Bip01 R Toe1" }; -} // namespace EditorAnimationBones::Biped diff --git a/Code/Editor/Animation/AnimationBipedBoneNames.h b/Code/Editor/Animation/AnimationBipedBoneNames.h deleted file mode 100644 index fdcfff7c82..0000000000 --- a/Code/Editor/Animation/AnimationBipedBoneNames.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#ifndef CRYINCLUDE_EDITOR_ANIMATION_ANIMATIONBIPEDBONENAMES_H -#define CRYINCLUDE_EDITOR_ANIMATION_ANIMATIONBIPEDBONENAMES_H -#pragma once - -namespace EditorAnimationBones -{ - namespace Biped - { - extern const char* Pelvis; - extern const char* Head; - extern const char* Weapon; - - extern const char* Spine[5]; - extern const char* Neck[2]; - - extern const char* LeftEye; - extern const char* RightEye; - - extern const char* LeftHeel; - extern const char* RightHeel; - extern const char* LeftToe[2]; - extern const char* RightToe[2]; - } -} - - -#endif // CRYINCLUDE_EDITOR_ANIMATION_ANIMATIONBIPEDBONENAMES_H diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index 78a15123d6..a63a74f01d 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -297,8 +297,6 @@ set(FILES Util/AffineParts.cpp Objects/BaseObject.cpp Objects/BaseObject.h - Animation/AnimationBipedBoneNames.cpp - Animation/AnimationBipedBoneNames.h AnimationContext.cpp AnimationContext.h AzAssetBrowser/AzAssetBrowserRequestHandler.cpp From 2dfdabdfc9631556f732f21883cd00fc60d8d622 Mon Sep 17 00:00:00 2001 From: bosnichd Date: Tue, 4 Jan 2022 09:54:20 -0700 Subject: [PATCH 289/948] ProcessWatcher fixes. (#6570) * ProcessWatcher fixes. Signed-off-by: bosnichd * Update based on review feedback. Signed-off-by: bosnichd --- .../AzFramework/AzFramework/azframework_files.cmake | 2 -- .../Default/AzFramework/Process/ProcessWatcher_Default.cpp | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake index aac7bd8f14..73608d6a85 100644 --- a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake +++ b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake @@ -270,8 +270,6 @@ set(FILES Physics/WindBus.h Process/ProcessCommunicator.cpp Process/ProcessCommunicator.h - Process/ProcessWatcher.cpp - Process/ProcessWatcher.h Process/ProcessCommon_fwd.h Process/ProcessCommunicator.h Process/ProcessWatcher.cpp diff --git a/Code/Framework/AzFramework/Platform/Common/Default/AzFramework/Process/ProcessWatcher_Default.cpp b/Code/Framework/AzFramework/Platform/Common/Default/AzFramework/Process/ProcessWatcher_Default.cpp index f87c51bdc5..a30ab72420 100644 --- a/Code/Framework/AzFramework/Platform/Common/Default/AzFramework/Process/ProcessWatcher_Default.cpp +++ b/Code/Framework/AzFramework/Platform/Common/Default/AzFramework/Process/ProcessWatcher_Default.cpp @@ -83,4 +83,9 @@ namespace AzFramework { } + + AZStd::string ProcessLauncher::ProcessLaunchInfo::GetCommandLineParametersAsString() const + { + return AZStd::string{}; + } } //namespace AzFramework From 685706f8174c31068b4474b1b19545aff117ea4b Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Tue, 4 Jan 2022 10:58:50 -0600 Subject: [PATCH 290/948] Removed unused images under Editor/Common Signed-off-by: Chris Galvan --- Code/Editor/Common/spline_edit-00.png | 3 --- Code/Editor/Common/spline_edit-01.png | 3 --- Code/Editor/Common/spline_edit-02.png | 3 --- Code/Editor/Common/spline_edit-03.png | 3 --- Code/Editor/Common/spline_edit-04.png | 3 --- Code/Editor/Common/spline_edit-05.png | 3 --- Code/Editor/Common/spline_edit-06.png | 3 --- Code/Editor/Common/spline_edit-07.png | 3 --- Code/Editor/Common/spline_edit-08.png | 3 --- Code/Editor/Common/spline_edit-09.png | 3 --- Code/Editor/Common/spline_edit-10.png | 3 --- Code/Editor/Common/spline_edit-11.png | 3 --- Code/Editor/Common/spline_edit-12.png | 3 --- Code/Editor/Common/spline_edit-13.png | 3 --- Code/Editor/Common/spline_edit-14.png | 3 --- Code/Editor/Common/spline_edit-15.png | 3 --- Code/Editor/Common/spline_edit-16.png | 3 --- 17 files changed, 51 deletions(-) delete mode 100644 Code/Editor/Common/spline_edit-00.png delete mode 100644 Code/Editor/Common/spline_edit-01.png delete mode 100644 Code/Editor/Common/spline_edit-02.png delete mode 100644 Code/Editor/Common/spline_edit-03.png delete mode 100644 Code/Editor/Common/spline_edit-04.png delete mode 100644 Code/Editor/Common/spline_edit-05.png delete mode 100644 Code/Editor/Common/spline_edit-06.png delete mode 100644 Code/Editor/Common/spline_edit-07.png delete mode 100644 Code/Editor/Common/spline_edit-08.png delete mode 100644 Code/Editor/Common/spline_edit-09.png delete mode 100644 Code/Editor/Common/spline_edit-10.png delete mode 100644 Code/Editor/Common/spline_edit-11.png delete mode 100644 Code/Editor/Common/spline_edit-12.png delete mode 100644 Code/Editor/Common/spline_edit-13.png delete mode 100644 Code/Editor/Common/spline_edit-14.png delete mode 100644 Code/Editor/Common/spline_edit-15.png delete mode 100644 Code/Editor/Common/spline_edit-16.png diff --git a/Code/Editor/Common/spline_edit-00.png b/Code/Editor/Common/spline_edit-00.png deleted file mode 100644 index 0243becc2b..0000000000 --- a/Code/Editor/Common/spline_edit-00.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:58ef978b31b31df9aaf715a0e9b006fde414a17a3ff15a3bf680eaad7418867a -size 364 diff --git a/Code/Editor/Common/spline_edit-01.png b/Code/Editor/Common/spline_edit-01.png deleted file mode 100644 index 4789ee0820..0000000000 --- a/Code/Editor/Common/spline_edit-01.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:98a681ec3d89ee57c5d1057fe984dcf8ad45721f47ae4df57fa358fbee85e616 -size 385 diff --git a/Code/Editor/Common/spline_edit-02.png b/Code/Editor/Common/spline_edit-02.png deleted file mode 100644 index 476883a514..0000000000 --- a/Code/Editor/Common/spline_edit-02.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:24a2b2c9242a841c20e7815dab0d80a575844055328aea413d28b7283b65a92e -size 386 diff --git a/Code/Editor/Common/spline_edit-03.png b/Code/Editor/Common/spline_edit-03.png deleted file mode 100644 index c1e79719a5..0000000000 --- a/Code/Editor/Common/spline_edit-03.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ce23a276fec849b8f832fab96d3b738793335c27d37ae3813158387f3415b508 -size 377 diff --git a/Code/Editor/Common/spline_edit-04.png b/Code/Editor/Common/spline_edit-04.png deleted file mode 100644 index e9cfb9d79e..0000000000 --- a/Code/Editor/Common/spline_edit-04.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c03befab41765200f4f28dbf1e0b2a702d2244bfa79b0d463f5d58d0a26095fc -size 386 diff --git a/Code/Editor/Common/spline_edit-05.png b/Code/Editor/Common/spline_edit-05.png deleted file mode 100644 index 3046c6008d..0000000000 --- a/Code/Editor/Common/spline_edit-05.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:418c3f0f27854b3795841359014d87686a7bf94daf2568d9cfd3ffac22675f69 -size 386 diff --git a/Code/Editor/Common/spline_edit-06.png b/Code/Editor/Common/spline_edit-06.png deleted file mode 100644 index 3c170baa3e..0000000000 --- a/Code/Editor/Common/spline_edit-06.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d3a831f34ac53c9b1f20037290e8a2b62a3cfb8a4f86467591f44fd2a0e3c15b -size 379 diff --git a/Code/Editor/Common/spline_edit-07.png b/Code/Editor/Common/spline_edit-07.png deleted file mode 100644 index 1c87d462ed..0000000000 --- a/Code/Editor/Common/spline_edit-07.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4267102ca7a889c34eff905480a68878d4d56e15bc723a5b0575cd472e259f5d -size 389 diff --git a/Code/Editor/Common/spline_edit-08.png b/Code/Editor/Common/spline_edit-08.png deleted file mode 100644 index 52c436f877..0000000000 --- a/Code/Editor/Common/spline_edit-08.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a0df013dd102b87348fba18b4da5443591309e9c40166d27ae928636924154ea -size 388 diff --git a/Code/Editor/Common/spline_edit-09.png b/Code/Editor/Common/spline_edit-09.png deleted file mode 100644 index 1223730915..0000000000 --- a/Code/Editor/Common/spline_edit-09.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e713076ab5abbbb2cf28da431a339e9905acc790e35295f025aa2e79e1c04141 -size 376 diff --git a/Code/Editor/Common/spline_edit-10.png b/Code/Editor/Common/spline_edit-10.png deleted file mode 100644 index 3b2a27bdbf..0000000000 --- a/Code/Editor/Common/spline_edit-10.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9e5af9d62ceafc3b8a1dfc36772350cd623fcc86c68711b299e143ff133f79b6 -size 387 diff --git a/Code/Editor/Common/spline_edit-11.png b/Code/Editor/Common/spline_edit-11.png deleted file mode 100644 index 7b68ead52b..0000000000 --- a/Code/Editor/Common/spline_edit-11.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:17c5fb3d7b87ea87a98934954c721573c641bc44005a34f1e16589d7f39b71e8 -size 409 diff --git a/Code/Editor/Common/spline_edit-12.png b/Code/Editor/Common/spline_edit-12.png deleted file mode 100644 index 3c7abb2182..0000000000 --- a/Code/Editor/Common/spline_edit-12.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6f5c78d9f764b62fb7dcf400c91c1edea9d7f88a426ba513fbf70825c6bcd2ac -size 383 diff --git a/Code/Editor/Common/spline_edit-13.png b/Code/Editor/Common/spline_edit-13.png deleted file mode 100644 index f71a5ec300..0000000000 --- a/Code/Editor/Common/spline_edit-13.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:376b549602afffca407525b77c1a9821bf6a0e279792ae2e52fe0a4f7c3c5bd4 -size 364 diff --git a/Code/Editor/Common/spline_edit-14.png b/Code/Editor/Common/spline_edit-14.png deleted file mode 100644 index 4a5f89b089..0000000000 --- a/Code/Editor/Common/spline_edit-14.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e7dc48f8d324b7563b168f27ebde1e00ee2bd11ba462f114a05b297913e285c5 -size 374 diff --git a/Code/Editor/Common/spline_edit-15.png b/Code/Editor/Common/spline_edit-15.png deleted file mode 100644 index 8542318682..0000000000 --- a/Code/Editor/Common/spline_edit-15.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:66b73afbd6dba1caaedfaae161b277b460b5198f7fc00bec414530116c567276 -size 375 diff --git a/Code/Editor/Common/spline_edit-16.png b/Code/Editor/Common/spline_edit-16.png deleted file mode 100644 index 6926024cbd..0000000000 --- a/Code/Editor/Common/spline_edit-16.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ae6e6714acf495246f4e59f6e5640f3a4417ea50100d37a116950d2b859aed0c -size 417 From 4426d15d32c76d924e6870c4006cada0704295ef Mon Sep 17 00:00:00 2001 From: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> Date: Tue, 4 Jan 2022 11:25:13 -0600 Subject: [PATCH 291/948] Adding explicit wait to avoid teardown issues with external tools Signed-off-by: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> --- .../editor/EditorScripts/Menus_FileMenuOptions.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py index cade2125e2..c319535c05 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py @@ -26,6 +26,8 @@ def Menus_FileMenuOptions_Work(): :return: None """ + import azlmbr.legacy.general as general + import editor_python_test_tools.hydra_editor_utils as hydra import editor_python_test_tools.pyside_utils as pyside_utils from editor_python_test_tools.utils import Report @@ -64,6 +66,9 @@ def Menus_FileMenuOptions_Work(): ) Report.result(menu_action_triggered, action_triggered) + # Wait a few seconds for Project Settings dialogs to load so teardown can properly close them + general.idle_wait(2.0) + if __name__ == "__main__": From a891993c35091f4eb3f18ff1ac91c944b08d22ef Mon Sep 17 00:00:00 2001 From: mrieggeramzn Date: Tue, 4 Jan 2022 09:58:30 -0800 Subject: [PATCH 292/948] Remove 'INF' from integer widget and replace it with better formatted integers. Also fix warning message with invalid param Signed-off-by: mrieggeramzn --- .../UI/PropertyEditor/PropertyIntCtrlCommon.h | 39 +++++++------------ 1 file changed, 13 insertions(+), 26 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyIntCtrlCommon.h b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyIntCtrlCommon.h index bb7d03367b..7d3e7191e3 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyIntCtrlCommon.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyIntCtrlCommon.h @@ -93,23 +93,13 @@ namespace AzToolsFramework toolTipString += "\n"; } toolTipString += "["; - if (propertyControl->minimum() <= aznumeric_cast(QtWidgetLimits::Min())) - { - toolTipString += "-" + QObject::tr(PropertyQTConstant_InfinityString); - } - else - { - toolTipString += QString::number(propertyControl->minimum()); - } + + const QString minString = QLocale().toString(propertyControl->minimum()); + const QString maxString = QLocale().toString(propertyControl->maximum()); + + toolTipString += minString; toolTipString += ", "; - if (propertyControl->maximum() >= aznumeric_cast(QtWidgetLimits::Max())) - { - toolTipString += QObject::tr(PropertyQTConstant_InfinityString); - } - else - { - toolTipString += QString::number(propertyControl->maximum()); - } + toolTipString += maxString; toolTipString += "]"; return true; } @@ -128,15 +118,12 @@ namespace AzToolsFramework { toolTipString += "\n"; } - toolTipString += "[" + QString::number(propertyControl->minimum()) + ", "; - if (propertyControl->maximum() >= aznumeric_cast(QtWidgetLimits::Max())) - { - toolTipString += QObject::tr(PropertyQTConstant_InfinityString); - } - else - { - toolTipString += QString::number(propertyControl->maximum()); - } + + const QString minString = QLocale().toString(propertyControl->minimum()); + const QString maxString = QLocale().toString(propertyControl->maximum()); + + toolTipString += "[" + minString + ", "; + toolTipString += maxString; toolTipString += "]"; return true; } @@ -196,7 +183,7 @@ namespace AzToolsFramework } else { - AZ_WarningOnce("AzToolsFramework", false, "Property %s: 'Min' attribute from property '%s' into widget", debugName); + AZ_WarningOnce("AzToolsFramework", false, "Failed to read 'Min' attribute from property '%s' into widget", debugName); } } else if (attrib == AZ::Edit::Attributes::Max) From d343caa3f2d846610b4b1a29adac682d9e567867 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Tue, 4 Jan 2022 11:58:17 -0800 Subject: [PATCH 293/948] add optional force_get to get_property_tree Signed-off-by: Scott Murray --- .../editor_python_test_tools/editor_entity_utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py index 0878431054..4dd7ec1446 100644 --- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py @@ -50,7 +50,7 @@ class EditorComponent: assert len(type_names) != 0, "Component object does not have type id" return type_names[0] - def get_property_tree(self): + def get_property_tree(self, force_get: bool = False): """ Used to get the property tree object of component that has following functions associated with it: 1. prop_tree.is_container(path) @@ -60,9 +60,10 @@ class EditorComponent: 5. prop_tree.remove_container_item(path, key) 6. prop_tree.update_container_item(path, key, value) 7. prop_tree.get_container_item(path, key) + :param force_get: Force a fresh property tree to be returned rather than using an existing self.property_tree :return: Property tree object of a component """ - if self.property_tree is not None: + if (not force_get) and (self.property_tree is not None): return self.property_tree build_prop_tree_outcome = editor.EditorComponentAPIBus( @@ -244,6 +245,7 @@ class EditorComponent: def disable_component(self): """ Used to disable the component using its id value. + Deprecation warning! Use set_enable(False) instead as this method is in deprecation :return: None """ warnings.warn("disable_component is deprecated, use set_enabled(False) instead.", DeprecationWarning) From 8ee384f436a1092cafd3a7bdd7128bbbea0208f9 Mon Sep 17 00:00:00 2001 From: amzn-mike <80125227+amzn-mike@users.noreply.github.com> Date: Tue, 4 Jan 2022 14:34:56 -0600 Subject: [PATCH 294/948] Asset Processor: Remove gem loading from AP (#6488) * AssetBuilder sends builder registration network message to AP Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Add AP activating status message Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * First builder handles registration. Fixed deadlock caused by AP and AssetBuilder waiting on each other when registering by moving AP builder start code to a thread Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Clean up external builder registration Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Add thread description for builder manager idle thread Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Remove gem loading Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Clean up builder registration and remove unused functions Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Remove PostActivate call from batch application since it will be called after builders are registered Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Removal external builder dependency scanning since we no longer support builder dlls Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Fix missing bus disconnect Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Remove unused variable Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Moved AP-AssetBuilder specific types into AssetBuilder.Static library. Also removed some unused/old code Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> --- .../AssetBuilder/AssetBuilderApplication.cpp | 2 + .../AssetBuilder/AssetBuilderComponent.cpp | 127 ++++--- .../AssetBuilder/AssetBuilderComponent.h | 13 +- .../AssetBuilder/AssetBuilderStatic.cpp | 182 +++++++++ .../AssetBuilder/AssetBuilderStatic.h | 140 +++++++ .../AssetBuilder/CMakeLists.txt | 17 + .../asset_builder_static_files.cmake | 12 + .../AssetBuilderSDK/AssetBuilderSDK.cpp | 168 --------- .../AssetBuilderSDK/AssetBuilderSDK.h | 164 +------- Code/Tools/AssetProcessor/CMakeLists.txt | 1 + .../AssetProcessor/native/assetprocessor.h | 16 +- .../AssetProcessor/native/ui/MainWindow.cpp | 30 +- .../native/utilities/ApplicationManager.cpp | 47 --- .../native/utilities/ApplicationManager.h | 5 +- .../utilities/ApplicationManagerBase.cpp | 355 +++++++----------- .../native/utilities/ApplicationManagerBase.h | 7 +- .../native/utilities/BuilderManager.cpp | 67 ++-- .../native/utilities/BuilderManager.h | 8 +- .../native/utilities/BuilderManager.inl | 4 +- .../utilities/GUIApplicationManager.cpp | 11 +- 20 files changed, 654 insertions(+), 722 deletions(-) create mode 100644 Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderStatic.cpp create mode 100644 Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderStatic.h create mode 100644 Code/Tools/AssetProcessor/AssetBuilder/asset_builder_static_files.cmake diff --git a/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderApplication.cpp b/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderApplication.cpp index da2edcc51f..074138b324 100644 --- a/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderApplication.cpp +++ b/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderApplication.cpp @@ -37,6 +37,7 @@ #include #include #include +#include namespace AssetBuilder { @@ -165,6 +166,7 @@ void AssetBuilderApplication::StartCommon(AZ::Entity* systemEntity) AssetBuilderSDK::InitializeSerializationContext(); AssetBuilderSDK::InitializeBehaviorContext(); + AssetBuilder::InitializeSerializationContext(); // the asset builder app never writes source files, only assets, so there is no need to do any kind of asset upgrading AZ::Data::AssetManager::Instance().SetAssetInfoUpgradingEnabled(false); diff --git a/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderComponent.cpp b/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderComponent.cpp index 78244ab02c..21b8c31cf4 100644 --- a/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderComponent.cpp +++ b/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderComponent.cpp @@ -34,6 +34,7 @@ #include #include #include +#include // Command-line parameter options: static const char* const s_paramHelp = "help"; // Print help information. @@ -51,10 +52,10 @@ static const char* const s_paramDebugCreate = "debug_create"; // Debug mode for static const char* const s_paramDebugProcess = "debug_process"; // Debug mode for the process job of the specified file. static const char* const s_paramPlatformTags = "tags"; // Additional list of tags to add platform tag list. static const char* const s_paramPlatform = "platform"; // Platform to use +static const char* const s_paramRegisterBuilders = "register"; // Indicates the AP is starting up and requesting a list of registered builders // Task modes: static const char* const s_taskResident = "resident"; // stays up and running indefinitely, accepting jobs via network connection -static const char* const s_taskRegisterBuilder = "register"; // outputs all the builder descriptors static const char* const s_taskCreateJob = "create"; // runs a builders createJobs function static const char* const s_taskProcessJob = "process"; // runs processJob function static const char* const s_taskDebug = "debug"; // runs a one shot job in a fake environment for a specified file. @@ -204,6 +205,40 @@ void AssetBuilderComponent::Reflect(AZ::ReflectContext* context) } } +bool AssetBuilderComponent::DoHelloPing() +{ + using namespace AssetBuilder; + + BuilderHelloRequest request; + BuilderHelloResponse response; + + AZStd::string id; + + if (!GetParameter(s_paramId, id)) + { + return false; + } + + request.m_uuid = AZ::Uuid::CreateString(id.c_str()); + + AZ_TracePrintf( + "AssetBuilderComponent", "RunInResidentMode: Pinging asset processor with the builder UUID %s\n", + request.m_uuid.ToString().c_str()); + + bool result = AzFramework::AssetSystem::SendRequest(request, response); + + AZ_Error("AssetBuilder", result, "Failed to send hello request to Asset Processor"); + // This error is only shown if we successfully got a response AND the response explicitly indicates the AP rejected the builder + AZ_Error("AssetBuilder", !result || response.m_accepted, "Asset Processor rejected connection request"); + + if (result) + { + AZ_TracePrintf("AssetBuilder", "Builder ID: %s\n", response.m_uuid.ToString().c_str()); + } + + return result; +} + bool AssetBuilderComponent::Run() { AZ_TracePrintf("AssetBuilderComponent", "Run: Parsing command line.\n"); @@ -217,8 +252,8 @@ bool AssetBuilderComponent::Run() } AZStd::string task; - AZStd::string debugFile; + if (GetParameter(s_paramDebug, debugFile, false)) { task = s_taskDebug; @@ -256,11 +291,13 @@ bool AssetBuilderComponent::Run() AZ_TracePrintf("AssetBuilderComponent", "Run: Connecting back to Asset Processor...\n"); bool connectedToAssetProcessor = ConnectToAssetProcessor(); //AP connection is required to access the asset catalog - AZ_Error("AssetBuilder", connectedToAssetProcessor, "Failed to establish a network connection to the AssetProcessor. Use -help for options.");; + AZ_Error("AssetBuilder", connectedToAssetProcessor, "Failed to establish a network connection to the AssetProcessor. Use -help for options."); + + bool registerBuilders = commandLine->GetNumSwitchValues(s_paramRegisterBuilders) > 0; IBuilderApplication* builderApplication = AZ::Interface::Get(); - if(!builderApplication) + if (!builderApplication) { AZ_Error("AssetBuilder", false, "Failed to retreive IBuilderApplication interface"); return false; @@ -274,7 +311,7 @@ bool AssetBuilderComponent::Run() { if (task == s_taskResident) { - result = RunInResidentMode(); + result = RunInResidentMode(registerBuilders); } else if (task == s_taskDebug) { @@ -370,43 +407,46 @@ bool AssetBuilderComponent::ConnectToAssetProcessor() ////////////////////////////////////////////////////////////////////////// -bool AssetBuilderComponent::RunInResidentMode() +bool AssetBuilderComponent::SendRegisteredBuildersToAp() { - using namespace AssetBuilderSDK; - using namespace AZStd::placeholders; - - AZ_TracePrintf("AssetBuilderComponent", "RunInResidentMode: Starting resident mode (waiting for commands to arrive)\n"); + AssetBuilder::BuilderRegistrationRequest registrationRequest; - AZStd::string port, id, builderFolder; - - if (!GetParameter(s_paramId, id) - || !GetParameter(s_paramModule, builderFolder)) + for (const auto& [uuid, desc] : m_assetBuilderDescMap) { - return false; + AssetBuilder::BuilderRegistration registration; + + registration.m_name = desc->m_name; + registration.m_analysisFingerprint = desc->m_analysisFingerprint; + registration.m_flags = desc->m_flags; + registration.m_flagsByJobKey = desc->m_flagsByJobKey; + registration.m_version = desc->m_version; + registration.m_busId = desc->m_busId; + registration.m_patterns = desc->m_patterns; + registration.m_productsToKeepOnFailure = desc->m_productsToKeepOnFailure; + + registrationRequest.m_builders.push_back(AZStd::move(registration)); } - if (!LoadBuilders(builderFolder)) - { - return false; - } + bool result = SendRequest(registrationRequest); - AzFramework::SocketConnection::GetInstance()->AddMessageHandler(CreateJobsNetRequest::MessageType(), AZStd::bind(&AssetBuilderComponent::CreateJobsResidentHandler, this, _1, _2, _3, _4)); - AzFramework::SocketConnection::GetInstance()->AddMessageHandler(ProcessJobNetRequest::MessageType(), AZStd::bind(&AssetBuilderComponent::ProcessJobResidentHandler, this, _1, _2, _3, _4)); + AZ_Error("AssetBuilder", result, "Failed to send builder registration request to Asset Processor"); - BuilderHelloRequest request; - BuilderHelloResponse response; + return result; +} - request.m_uuid = AZ::Uuid::CreateString(id.c_str()); +bool AssetBuilderComponent::RunInResidentMode(bool sendRegistration) +{ + using namespace AssetBuilder; + using namespace AZStd::placeholders; - AZ_TracePrintf("AssetBuilderComponent", "RunInResidentMode: Pinging asset processor with the builder UUID %s\n", request.m_uuid.ToString().c_str()); + AZ_TracePrintf("AssetBuilderComponent", "RunInResidentMode: Starting resident mode (waiting for commands to arrive)\n"); - bool result = AzFramework::AssetSystem::SendRequest(request, response); + AzFramework::SocketConnection::GetInstance()->AddMessageHandler(CreateJobsNetRequest::MessageType(), AZStd::bind(&AssetBuilderComponent::CreateJobsResidentHandler, this, _1, _2, _3, _4)); + AzFramework::SocketConnection::GetInstance()->AddMessageHandler(ProcessJobNetRequest::MessageType(), AZStd::bind(&AssetBuilderComponent::ProcessJobResidentHandler, this, _1, _2, _3, _4)); - AZ_Error("AssetBuilder", result, "Failed to send hello request to Asset Processor"); - // This error is only shown if we successfully got a response AND the response explicitly indicates the AP rejected the builder - AZ_Error("AssetBuilder", !result || response.m_accepted, "Asset Processor rejected connection request"); + bool result = DoHelloPing() && ((sendRegistration && SendRegisteredBuildersToAp()) || !sendRegistration); - if (result && response.m_accepted) + if (result) { m_running = true; @@ -415,7 +455,6 @@ bool AssetBuilderComponent::RunInResidentMode() AzFramework::EngineConnectionEvents::Bus::Handler::BusConnect(); // Listen for disconnects - AZ_TracePrintf("AssetBuilder", "Builder ID: %s\n", response.m_uuid.ToString().c_str()); AZ_TracePrintf("AssetBuilder", "Resident mode ready\n"); m_mainEvent.acquire(); AZ_TracePrintf("AssetBuilder", "Shutting down\n"); @@ -736,11 +775,7 @@ bool AssetBuilderComponent::RunOneShotTask(const AZStd::string& task) AZ::StringFunc::Path::Normalize(inputFilePath); AZ::StringFunc::Path::Normalize(outputFilePath); - if (task == s_taskRegisterBuilder) - { - return HandleRegisterBuilder(inputFilePath, outputFilePath); - } - else if (task == s_taskCreateJob) + if (task == s_taskCreateJob) { auto func = [this](const AssetBuilderSDK::CreateJobsRequest& request, AssetBuilderSDK::CreateJobsResponse& response) { @@ -896,7 +931,7 @@ void AssetBuilderComponent::JobThread() { case JobType::Create: { - using namespace AssetBuilderSDK; + using namespace AssetBuilder; auto* netRequest = azrtti_cast(job->m_netRequest.get()); auto* netResponse = azrtti_cast(job->m_netResponse.get()); @@ -922,7 +957,7 @@ void AssetBuilderComponent::JobThread() } case JobType::Process: { - using namespace AssetBuilderSDK; + using namespace AssetBuilder; AZ_TracePrintf("AssetBuilder", "Running processJob task\n"); @@ -981,14 +1016,14 @@ void AssetBuilderComponent::JobThread() void AssetBuilderComponent::CreateJobsResidentHandler(AZ::u32 /*typeId*/, AZ::u32 serial, const void* data, AZ::u32 dataLength) { - using namespace AssetBuilderSDK; + using namespace AssetBuilder; ResidentJobHandler(serial, data, dataLength, JobType::Create); } void AssetBuilderComponent::ProcessJobResidentHandler(AZ::u32 /*typeId*/, AZ::u32 serial, const void* data, AZ::u32 dataLength) { - using namespace AssetBuilderSDK; + using namespace AssetBuilder; ResidentJobHandler(serial, data, dataLength, JobType::Process); } @@ -1018,18 +1053,6 @@ bool AssetBuilderComponent::HandleTask(const AZStd::string& inputFilePath, const return true; } -bool AssetBuilderComponent::HandleRegisterBuilder(const AZStd::string& /*inputFilePath*/, const AZStd::string& outputFilePath) const -{ - AssetBuilderSDK::RegisterBuilderResponse response; - - for (const auto& pair : m_assetBuilderDescMap) - { - response.m_assetBuilderDescList.push_back(*pair.second); - } - - return AZ::Utils::SaveObjectToFile(outputFilePath, AZ::DataStream::ST_XML, &response); -} - void AssetBuilderComponent::UpdateResultCode(const AssetBuilderSDK::ProcessJobRequest& request, AssetBuilderSDK::ProcessJobResponse& response) const { if (request.m_jobDescription.m_failOnError) diff --git a/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderComponent.h b/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderComponent.h index 2014be41aa..2172e9093e 100644 --- a/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderComponent.h +++ b/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderComponent.h @@ -46,6 +46,7 @@ class AssetBuilderComponent public: AZ_COMPONENT(AssetBuilderComponent, "{04332899-5d73-4d41-86b7-b1017d349673}") static void Reflect(AZ::ReflectContext* context); + bool DoHelloPing(); AssetBuilderComponent() = default; ~AssetBuilderComponent() override = default; @@ -64,7 +65,7 @@ public: void RegisterBuilderInformation(const AssetBuilderSDK::AssetBuilderDesc& builderDesc) override; void RegisterComponentDescriptor(AZ::ComponentDescriptor* descriptor) override; - + //EngineConnectionEvents Handler void Disconnected(AzFramework::SocketConnection* connection) override; @@ -98,12 +99,13 @@ protected: static const char* GetLibraryExtension(); bool ConnectToAssetProcessor(); + bool SendRegisteredBuildersToAp(); bool LoadBuilders(const AZStd::string& builderFolder); bool LoadBuilder(const AZStd::string& filePath); void UnloadBuilders(); //! Hooks up net job request handling and keeps the AssetBuilder running indefinitely - bool RunInResidentMode(); + bool RunInResidentMode(bool sendRegistration); bool RunDebugTask(AZStd::string&& debugFile, bool runCreateJobs, bool runProcessJob); bool RunOneShotTask(const AZStd::string& task); @@ -120,9 +122,6 @@ protected: void ProcessJob(const AssetBuilderSDK::ProcessJobFunction& job, const AssetBuilderSDK::ProcessJobRequest& request, AssetBuilderSDK::ProcessJobResponse& outResponse); - //! Handles a builder registration request - bool HandleRegisterBuilder(const AZStd::string& inputFilePath, const AZStd::string& outputFilePath) const; - //! If needed looks at collected data and updates the result code from the job accordingly. void UpdateResultCode(const AssetBuilderSDK::ProcessJobRequest& request, AssetBuilderSDK::ProcessJobResponse& response) const; @@ -141,7 +140,7 @@ protected: //! Currently loading builder AssetBuilder::ExternalModuleAssetBuilderInfo* m_currentAssetBuilder = nullptr; - + //! Thread for running a job, so we don't block the network thread while doing work AZStd::thread_desc m_jobThreadDesc; AZStd::thread m_jobThread; @@ -153,7 +152,7 @@ protected: AZStd::binary_semaphore m_mainEvent; //! Use to signal a new job is ready to be processed AZStd::binary_semaphore m_jobEvent; - + //! Lock for m_queuedJob AZStd::mutex m_jobMutex; diff --git a/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderStatic.cpp b/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderStatic.cpp new file mode 100644 index 0000000000..6a67fbe425 --- /dev/null +++ b/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderStatic.cpp @@ -0,0 +1,182 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include + +namespace AssetBuilder +{ + void Reflect(AZ::ReflectContext* context) + { + BuilderRegistrationRequest::Reflect(context); + + BuilderHelloRequest::Reflect(context); + BuilderHelloResponse::Reflect(context); + CreateJobsNetRequest::Reflect(context); + CreateJobsNetResponse::Reflect(context); + ProcessJobNetRequest::Reflect(context); + ProcessJobNetResponse::Reflect(context); + } + + void InitializeSerializationContext() + { + AZ::SerializeContext* serializeContext = nullptr; + + AZ::ComponentApplicationBus::BroadcastResult(serializeContext, &AZ::ComponentApplicationBus::Events::GetSerializeContext); + AZ_Assert(serializeContext, "Unable to retrieve serialize context."); + + Reflect(serializeContext); + } + + void BuilderHelloRequest::Reflect(AZ::ReflectContext* context) + { + auto serialize = azrtti_cast(context); + if (serialize) + { + serialize->Class()->Version(1)->Field("UUID", &BuilderHelloRequest::m_uuid); + } + } + + unsigned int BuilderHelloRequest::MessageType() + { + static unsigned int messageType = AZ_CRC("AssetBuilderSDK::BuilderHelloRequest", 0x213a7248); + + return messageType; + } + + unsigned int BuilderHelloRequest::GetMessageType() const + { + return MessageType(); + } + + void BuilderHelloResponse::Reflect(AZ::ReflectContext* context) + { + auto serialize = azrtti_cast(context); + if (serialize) + { + serialize->Class() + ->Version(1) + ->Field("Accepted", &BuilderHelloResponse::m_accepted) + ->Field("UUID", &BuilderHelloResponse::m_uuid); + } + } + + unsigned int BuilderHelloResponse::GetMessageType() const + { + return BuilderHelloRequest::MessageType(); + } + + ////////////////////////////////////////////////////////////////////////// + + void CreateJobsNetRequest::Reflect(AZ::ReflectContext* context) + { + auto serialize = azrtti_cast(context); + if (serialize) + { + serialize->Class()->Version(1)->Field("Request", &CreateJobsNetRequest::m_request); + } + } + + unsigned int CreateJobsNetRequest::MessageType() + { + static unsigned int messageType = AZ_CRC("AssetBuilderSDK::CreateJobsNetRequest", 0xc48209c0); + + return messageType; + } + + unsigned int CreateJobsNetRequest::GetMessageType() const + { + return MessageType(); + } + + void CreateJobsNetResponse::Reflect(AZ::ReflectContext* context) + { + auto serialize = azrtti_cast(context); + if (serialize) + { + serialize->Class()->Version(1)->Field("Response", &CreateJobsNetResponse::m_response); + } + } + + unsigned int CreateJobsNetResponse::GetMessageType() const + { + return CreateJobsNetRequest::MessageType(); + } + + void ProcessJobNetRequest::Reflect(AZ::ReflectContext* context) + { + auto serialize = azrtti_cast(context); + if (serialize) + { + serialize->Class()->Version(1)->Field("Request", &ProcessJobNetRequest::m_request); + } + } + + unsigned int ProcessJobNetRequest::MessageType() + { + static unsigned int messageType = AZ_CRC("AssetBuilderSDK::ProcessJobNetRequest", 0x479f340f); + + return messageType; + } + + unsigned int ProcessJobNetRequest::GetMessageType() const + { + return MessageType(); + } + + void ProcessJobNetResponse::Reflect(AZ::ReflectContext* context) + { + auto serialize = azrtti_cast(context); + if (serialize) + { + serialize->Class()->Version(1)->Field("Response", &ProcessJobNetResponse::m_response); + } + } + + unsigned int ProcessJobNetResponse::GetMessageType() const + { + return ProcessJobNetRequest::MessageType(); + } + + //--------------------------------------------------------------------- + void BuilderRegistration::Reflect(AZ::ReflectContext* context) + { + auto serialize = azrtti_cast(context); + if (serialize) + { + serialize->Class() + ->Version(1) + ->Field("Name", &BuilderRegistration::m_name) + ->Field("Patterns", &BuilderRegistration::m_patterns) + ->Field("BusId", &BuilderRegistration::m_busId) + ->Field("Version", &BuilderRegistration::m_version) + ->Field("AnalysisFingerprint", &BuilderRegistration::m_analysisFingerprint) + ->Field("Flags", &BuilderRegistration::m_flags) + ->Field("FlagsByJobKey", &BuilderRegistration::m_flagsByJobKey) + ->Field("ProductsToKeepOnFailure", &BuilderRegistration::m_productsToKeepOnFailure); + } + } + + void BuilderRegistrationRequest::Reflect(AZ::ReflectContext* context) + { + BuilderRegistration::Reflect(context); + + auto serialize = azrtti_cast(context); + if (serialize) + { + serialize->Class()->Version(1)->Field( + "Builders", &BuilderRegistrationRequest::m_builders); + } + } + + unsigned int BuilderRegistrationRequest::GetMessageType() const + { + return BuilderRegistrationRequest::MessageType; + } + +} // namespace AssetBuilder diff --git a/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderStatic.h b/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderStatic.h new file mode 100644 index 0000000000..41b6531116 --- /dev/null +++ b/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilderStatic.h @@ -0,0 +1,140 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * 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 AssetBuilder +{ + void Reflect(AZ::ReflectContext* context); + + void InitializeSerializationContext(); + + //! BuilderHelloRequest is sent by an AssetBuilder that is attempting to connect to the AssetProcessor to register itself as a worker + class BuilderHelloRequest : public AzFramework::AssetSystem::BaseAssetProcessorMessage + { + public: + AZ_CLASS_ALLOCATOR(BuilderHelloRequest, AZ::OSAllocator, 0); + AZ_RTTI(BuilderHelloRequest, "{5fab5962-a1d8-42a5-bf7a-fb1a8c5a9588}", BaseAssetProcessorMessage); + + static void Reflect(AZ::ReflectContext* context); + static unsigned int MessageType(); + + unsigned int GetMessageType() const override; + + //! Unique ID assigned to this builder to identify it + AZ::Uuid m_uuid = AZ::Uuid::CreateNull(); + }; + + //! BuilderHelloResponse contains the AssetProcessor's response to a builder connection attempt, indicating if it is accepted and the ID + //! that it was assigned + class BuilderHelloResponse : public AzFramework::AssetSystem::BaseAssetProcessorMessage + { + public: + AZ_CLASS_ALLOCATOR(BuilderHelloResponse, AZ::OSAllocator, 0); + AZ_RTTI(BuilderHelloResponse, "{5f3d7c11-6639-4c6f-980a-32be546903c2}", BaseAssetProcessorMessage); + + static void Reflect(AZ::ReflectContext* context); + + unsigned int GetMessageType() const override; + + //! Indicates if the builder was accepted by the AP + bool m_accepted = false; + + //! Unique ID assigned to the builder. If the builder isn't a local process, this is the ID assigned by the AP + AZ::Uuid m_uuid = AZ::Uuid::CreateNull(); + }; + + class CreateJobsNetRequest : public AzFramework::AssetSystem::BaseAssetProcessorMessage + { + public: + AZ_CLASS_ALLOCATOR(CreateJobsNetRequest, AZ::OSAllocator, 0); + AZ_RTTI(CreateJobsNetRequest, "{97fa717d-3a09-4d21-95c6-b2eafd773f1c}", BaseAssetProcessorMessage); + + static void Reflect(AZ::ReflectContext* context); + static unsigned int MessageType(); + + unsigned int GetMessageType() const override; + + AssetBuilderSDK::CreateJobsRequest m_request; + }; + + class CreateJobsNetResponse : public AzFramework::AssetSystem::BaseAssetProcessorMessage + { + public: + AZ_CLASS_ALLOCATOR(CreateJobsNetResponse, AZ::OSAllocator, 0); + AZ_RTTI(CreateJobsNetResponse, "{b2c7c2d3-b60e-4b27-b699-43e0ba991c33}", BaseAssetProcessorMessage); + + static void Reflect(AZ::ReflectContext* context); + + unsigned int GetMessageType() const override; + + AssetBuilderSDK::CreateJobsResponse m_response; + }; + + class ProcessJobNetRequest : public AzFramework::AssetSystem::BaseAssetProcessorMessage + { + public: + AZ_CLASS_ALLOCATOR(ProcessJobNetRequest, AZ::OSAllocator, 0); + AZ_RTTI(ProcessJobNetRequest, "{05288de1-020b-48db-b9de-715f17284efa}", BaseAssetProcessorMessage); + + static void Reflect(AZ::ReflectContext* context); + static unsigned int MessageType(); + + unsigned int GetMessageType() const override; + + AssetBuilderSDK::ProcessJobRequest m_request; + }; + + class ProcessJobNetResponse : public AzFramework::AssetSystem::BaseAssetProcessorMessage + { + public: + AZ_CLASS_ALLOCATOR(ProcessJobNetResponse, AZ::OSAllocator, 0); + AZ_RTTI(ProcessJobNetResponse, "{26ddf882-246c-4cfb-912f-9b8e389df4f6}", BaseAssetProcessorMessage); + + static void Reflect(AZ::ReflectContext* context); + + unsigned int GetMessageType() const override; + + AssetBuilderSDK::ProcessJobResponse m_response; + }; + + ////////////////////////////////////////////////////////////////////////// + struct BuilderRegistration + { + AZ_CLASS_ALLOCATOR(BuilderRegistration, AZ::OSAllocator, 0); + AZ_TYPE_INFO(BuilderRegistration, "{36E785C3-5046-4568-870A-336C8249E453}"); + + static void Reflect(AZ::ReflectContext* context); + + AZStd::string m_name; + AZStd::vector m_patterns; + AZ::Uuid m_busId; + int m_version = 0; + AZStd::string m_analysisFingerprint; + AZ::u8 m_flags = 0; + AZStd::unordered_map m_flagsByJobKey; + AZStd::unordered_map> m_productsToKeepOnFailure; + }; + + class BuilderRegistrationRequest : public AzFramework::AssetSystem::BaseAssetProcessorMessage + { + public: + AZ_CLASS_ALLOCATOR(BuilderRegistrationRequest, AZ::OSAllocator, 0); + AZ_RTTI(BuilderRegistrationRequest, "{FA9CF2D5-C847-47F3-979D-6C3AE061715C}", BaseAssetProcessorMessage); + static void Reflect(AZ::ReflectContext* context); + static constexpr unsigned int MessageType = AZ_CRC_CE("AssetSystem::BuilderRegistrationRequest"); + + BuilderRegistrationRequest() = default; + unsigned int GetMessageType() const override; + + AZStd::vector m_builders; + }; +} // namespace AssetBuilder diff --git a/Code/Tools/AssetProcessor/AssetBuilder/CMakeLists.txt b/Code/Tools/AssetProcessor/AssetBuilder/CMakeLists.txt index 6baa99d43b..f23e749169 100644 --- a/Code/Tools/AssetProcessor/AssetBuilder/CMakeLists.txt +++ b/Code/Tools/AssetProcessor/AssetBuilder/CMakeLists.txt @@ -6,6 +6,22 @@ # # +ly_add_target( + NAME AssetBuilder.Static STATIC + NAMESPACE AZ + FILES_CMAKE + asset_builder_static_files.cmake + INCLUDE_DIRECTORIES + PUBLIC + . + BUILD_DEPENDENCIES + PUBLIC + AZ::AzCore + AZ::AzFramework + AZ::AzToolsFramework + AZ::AssetBuilderSDK +) + ly_add_target( NAME AssetBuilder EXECUTABLE NAMESPACE AZ @@ -17,6 +33,7 @@ ly_add_target( . BUILD_DEPENDENCIES PRIVATE + AssetBuilder.Static 3rdParty::Qt::Core 3rdParty::Qt::Gui 3rdParty::Qt::Network diff --git a/Code/Tools/AssetProcessor/AssetBuilder/asset_builder_static_files.cmake b/Code/Tools/AssetProcessor/AssetBuilder/asset_builder_static_files.cmake new file mode 100644 index 0000000000..48de742704 --- /dev/null +++ b/Code/Tools/AssetProcessor/AssetBuilder/asset_builder_static_files.cmake @@ -0,0 +1,12 @@ +# +# Copyright (c) Contributors to the Open 3D Engine Project. +# For complete copyright and license terms please see the LICENSE at the root of this distribution. +# +# SPDX-License-Identifier: Apache-2.0 OR MIT +# +# + +set(FILES + AssetBuilderStatic.h + AssetBuilderStatic.cpp +) diff --git a/Code/Tools/AssetProcessor/AssetBuilderSDK/AssetBuilderSDK/AssetBuilderSDK.cpp b/Code/Tools/AssetProcessor/AssetBuilderSDK/AssetBuilderSDK/AssetBuilderSDK.cpp index b5323dd419..43126dd673 100644 --- a/Code/Tools/AssetProcessor/AssetBuilderSDK/AssetBuilderSDK/AssetBuilderSDK.cpp +++ b/Code/Tools/AssetProcessor/AssetBuilderSDK/AssetBuilderSDK/AssetBuilderSDK.cpp @@ -1172,19 +1172,10 @@ namespace AssetBuilderSDK JobProduct::Reflect(context); AssetBuilderDesc::Reflect(context); - RegisterBuilderRequest::Reflect(context); - RegisterBuilderResponse::Reflect(context); CreateJobsRequest::Reflect(context); CreateJobsResponse::Reflect(context); ProcessJobRequest::Reflect(context); ProcessJobResponse::Reflect(context); - - BuilderHelloRequest::Reflect(context); - BuilderHelloResponse::Reflect(context); - CreateJobsNetRequest::Reflect(context); - CreateJobsNetResponse::Reflect(context); - ProcessJobNetRequest::Reflect(context); - ProcessJobNetResponse::Reflect(context); } void InitializeSerializationContext() @@ -1263,24 +1254,6 @@ namespace AssetBuilderSDK } } - void RegisterBuilderRequest::Reflect(AZ::ReflectContext* context) - { - if (AZ::SerializeContext* serializeContext = azrtti_cast(context)) - { - serializeContext->Class()-> - Version(1)-> - Field("FilePath", &RegisterBuilderRequest::m_filePath); - } - - if (AZ::BehaviorContext* behaviorContext = azrtti_cast(context)) - { - behaviorContext->Class("RegisterBuilderRequest") - ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation) - ->Attribute(AZ::Script::Attributes::Module, "asset.builder") - ->Property("filePath", BehaviorValueProperty(&RegisterBuilderRequest::m_filePath)); - } - } - void AssetBuilderDesc::Reflect(AZ::ReflectContext* context) { if (AZ::SerializeContext* serializeContext = azrtti_cast(context)) @@ -1313,25 +1286,6 @@ namespace AssetBuilderSDK } } - void RegisterBuilderResponse::Reflect(AZ::ReflectContext* context) - { - if (AZ::SerializeContext* serializeContext = azrtti_cast(context)) - { - serializeContext->Class() - ->Version(1) - ->Field("Asset Builder Desc List", &RegisterBuilderResponse::m_assetBuilderDescList); - } - - if (AZ::BehaviorContext* behaviorContext = azrtti_cast(context)) - { - behaviorContext->Class("RegisterBuilderResponse") - ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation) - ->Attribute(AZ::Script::Attributes::Module, "asset.builder") - ->Constructor() - ->Property("assetBuilderDescList", BehaviorValueProperty(&RegisterBuilderResponse::m_assetBuilderDescList)); - } - } - bool CreateJobsResponse::Succeeded() const { return m_result == CreateJobsResultCode::Success; @@ -1362,128 +1316,6 @@ namespace AssetBuilderSDK } } - void BuilderHelloRequest::Reflect(AZ::ReflectContext* context) - { - auto serialize = azrtti_cast(context); - if (serialize) - { - serialize->Class() - ->Version(1) - ->Field("UUID", &BuilderHelloRequest::m_uuid); - } - } - - unsigned int BuilderHelloRequest::MessageType() - { - static unsigned int messageType = AZ_CRC("AssetBuilderSDK::BuilderHelloRequest", 0x213a7248); - - return messageType; - } - - unsigned int BuilderHelloRequest::GetMessageType() const - { - return MessageType(); - } - - void BuilderHelloResponse::Reflect(AZ::ReflectContext* context) - { - auto serialize = azrtti_cast(context); - if (serialize) - { - serialize->Class() - ->Version(1) - ->Field("Accepted", &BuilderHelloResponse::m_accepted) - ->Field("UUID", &BuilderHelloResponse::m_uuid); - } - } - - unsigned int BuilderHelloResponse::GetMessageType() const - { - return BuilderHelloRequest::MessageType(); - } - - ////////////////////////////////////////////////////////////////////////// - - void CreateJobsNetRequest::Reflect(AZ::ReflectContext* context) - { - auto serialize = azrtti_cast(context); - if (serialize) - { - serialize->Class() - ->Version(1) - ->Field("Request", &CreateJobsNetRequest::m_request); - } - } - - unsigned int CreateJobsNetRequest::MessageType() - { - static unsigned int messageType = AZ_CRC("AssetBuilderSDK::CreateJobsNetRequest", 0xc48209c0); - - return messageType; - } - - unsigned int CreateJobsNetRequest::GetMessageType() const - { - return MessageType(); - } - - void CreateJobsNetResponse::Reflect(AZ::ReflectContext* context) - { - auto serialize = azrtti_cast(context); - if (serialize) - { - serialize->Class() - ->Version(1) - ->Field("Response", &CreateJobsNetResponse::m_response); - } - } - - unsigned int CreateJobsNetResponse::GetMessageType() const - { - return CreateJobsNetRequest::MessageType(); - } - - - - void ProcessJobNetRequest::Reflect(AZ::ReflectContext* context) - { - auto serialize = azrtti_cast(context); - if (serialize) - { - serialize->Class() - ->Version(1) - ->Field("Request", &ProcessJobNetRequest::m_request); - } - } - - unsigned int ProcessJobNetRequest::MessageType() - { - static unsigned int messageType = AZ_CRC("AssetBuilderSDK::ProcessJobNetRequest", 0x479f340f); - - return messageType; - } - - unsigned int ProcessJobNetRequest::GetMessageType() const - { - return MessageType(); - } - - void ProcessJobNetResponse::Reflect(AZ::ReflectContext* context) - { - auto serialize = azrtti_cast(context); - if (serialize) - { - serialize->Class() - ->Version(1) - ->Field("Response", &ProcessJobNetResponse::m_response); - } - } - - unsigned int ProcessJobNetResponse::GetMessageType() const - { - return ProcessJobNetRequest::MessageType(); - } - JobDependency::JobDependency(const AZStd::string& jobKey, const AZStd::string& platformIdentifier, const JobDependencyType& type, const SourceFileDependency& sourceFile) : m_jobKey(jobKey) , m_platformIdentifier(platformIdentifier) diff --git a/Code/Tools/AssetProcessor/AssetBuilderSDK/AssetBuilderSDK/AssetBuilderSDK.h b/Code/Tools/AssetProcessor/AssetBuilderSDK/AssetBuilderSDK/AssetBuilderSDK.h index f977e15be9..65bf9cc7d4 100644 --- a/Code/Tools/AssetProcessor/AssetBuilderSDK/AssetBuilderSDK/AssetBuilderSDK.h +++ b/Code/Tools/AssetProcessor/AssetBuilderSDK/AssetBuilderSDK/AssetBuilderSDK.h @@ -464,35 +464,6 @@ namespace AssetBuilderSDK AZStd::string m_platformIdentifier; }; - //! RegisterBuilderRequest contains input data that will be sent by the AssetProcessor to the builder during the startup registration phase - struct RegisterBuilderRequest - { - AZ_CLASS_ALLOCATOR(RegisterBuilderRequest, AZ::SystemAllocator, 0); - AZ_TYPE_INFO(RegisterBuilderRequest, "{7C6C5198-4766-42B8-9A1E-48479CE2F5EA}"); - - AZStd::string m_filePath; - - RegisterBuilderRequest() {} - - explicit RegisterBuilderRequest(const AZStd::string& filePath) - : m_filePath(filePath) - { - } - - static void Reflect(AZ::ReflectContext* context); - }; - - //! INTERNAL USE ONLY - RegisterBuilderResponse contains registration data that will be sent by the builder to the AssetProcessor in response to RegisterBuilderRequest - struct RegisterBuilderResponse - { - AZ_CLASS_ALLOCATOR(RegisterBuilderResponse, AZ::SystemAllocator, 0); - AZ_TYPE_INFO(RegisterBuilderResponse, "{0AE5583F-C763-410E-BA7F-78BD90546C01}"); - - AZStd::vector m_assetBuilderDescList; - - static void Reflect(AZ::ReflectContext* context); - }; - /** * This tells you about a platform in your CreateJobsRequest or your ProcessJobRequest */ @@ -756,99 +727,9 @@ namespace AssetBuilderSDK static void Reflect(AZ::ReflectContext* context); }; - //! BuilderHelloRequest is sent by an AssetBuilder that is attempting to connect to the AssetProcessor to register itself as a worker - class BuilderHelloRequest : public AzFramework::AssetSystem::BaseAssetProcessorMessage - { - public: - - AZ_CLASS_ALLOCATOR(BuilderHelloRequest, AZ::OSAllocator, 0); - AZ_RTTI(BuilderHelloRequest, "{5fab5962-a1d8-42a5-bf7a-fb1a8c5a9588}", BaseAssetProcessorMessage); - - static void Reflect(AZ::ReflectContext* context); - static unsigned int MessageType(); - - unsigned int GetMessageType() const override; - - //! Unique ID assigned to this builder to identify it - AZ::Uuid m_uuid = AZ::Uuid::CreateNull(); - }; - - //! BuilderHelloResponse contains the AssetProcessor's response to a builder connection attempt, indicating if it is accepted and the ID that it was assigned - class BuilderHelloResponse : public AzFramework::AssetSystem::BaseAssetProcessorMessage - { - public: - - AZ_CLASS_ALLOCATOR(BuilderHelloResponse, AZ::OSAllocator, 0); - AZ_RTTI(BuilderHelloResponse, "{5f3d7c11-6639-4c6f-980a-32be546903c2}", BaseAssetProcessorMessage); - - static void Reflect(AZ::ReflectContext* context); - - unsigned int GetMessageType() const override; - - //! Indicates if the builder was accepted by the AP - bool m_accepted = false; - - //! Unique ID assigned to the builder. If the builder isn't a local process, this is the ID assigned by the AP - AZ::Uuid m_uuid = AZ::Uuid::CreateNull(); - }; - - class CreateJobsNetRequest : public AzFramework::AssetSystem::BaseAssetProcessorMessage - { - public: + - AZ_CLASS_ALLOCATOR(CreateJobsNetRequest, AZ::OSAllocator, 0); - AZ_RTTI(CreateJobsNetRequest, "{97fa717d-3a09-4d21-95c6-b2eafd773f1c}", BaseAssetProcessorMessage); - - static void Reflect(AZ::ReflectContext* context); - static unsigned int MessageType(); - - unsigned int GetMessageType() const override; - - CreateJobsRequest m_request; - }; - - class CreateJobsNetResponse : public AzFramework::AssetSystem::BaseAssetProcessorMessage - { - public: - - AZ_CLASS_ALLOCATOR(CreateJobsNetResponse, AZ::OSAllocator, 0); - AZ_RTTI(CreateJobsNetResponse, "{b2c7c2d3-b60e-4b27-b699-43e0ba991c33}", BaseAssetProcessorMessage); - - static void Reflect(AZ::ReflectContext* context); - - unsigned int GetMessageType() const override; - - CreateJobsResponse m_response; - }; - - class ProcessJobNetRequest : public AzFramework::AssetSystem::BaseAssetProcessorMessage - { - public: - - AZ_CLASS_ALLOCATOR(ProcessJobNetRequest, AZ::OSAllocator, 0); - AZ_RTTI(ProcessJobNetRequest, "{05288de1-020b-48db-b9de-715f17284efa}", BaseAssetProcessorMessage); - - static void Reflect(AZ::ReflectContext* context); - static unsigned int MessageType(); - - unsigned int GetMessageType() const override; - - ProcessJobRequest m_request; - }; - - class ProcessJobNetResponse : public AzFramework::AssetSystem::BaseAssetProcessorMessage - { - public: - - AZ_CLASS_ALLOCATOR(ProcessJobNetResponse, AZ::OSAllocator, 0); - AZ_RTTI(ProcessJobNetResponse, "{26ddf882-246c-4cfb-912f-9b8e389df4f6}", BaseAssetProcessorMessage); - - static void Reflect(AZ::ReflectContext* context); - - unsigned int GetMessageType() const override; - - ProcessJobResponse m_response; - }; + //! JobCancelListener can be used by builders in their processJob method to listen for job cancellation request. //! The address of this listener is the jobid which can be found in the process job request. @@ -935,44 +816,3 @@ namespace AZ AZ_TYPE_INFO_SPECIALIZE(AssetBuilderSDK::ProductPathDependencyType, "{EF77742B-9627-4072-B431-396AA7183C80}"); AZ_TYPE_INFO_SPECIALIZE(AssetBuilderSDK::SourceFileDependency::SourceFileDependencyType, "{BE9C8805-DB17-4500-944A-EB33FD0BE347}"); } - -//! This macro should be used by every AssetBuilder to register itself, -//! AssetProcessor uses these exported function to identify whether a dll is an Asset Builder or not -//! If you want something highly custom you can do these entry points yourself instead of using the macro. -#define REGISTER_ASSETBUILDER \ - extern void BuilderOnInit(); \ - extern void BuilderDestroy(); \ - extern void BuilderRegisterDescriptors(); \ - extern void BuilderAddComponents(AZ::Entity * entity); \ - extern "C" \ - { \ - AZ_DLL_EXPORT int IsAssetBuilder() \ - { \ - return 0; \ - } \ - \ - AZ_DLL_EXPORT void InitializeModule(AZ::EnvironmentInstance sharedEnvironment) \ - { \ - AZ::Environment::Attach(sharedEnvironment); \ - BuilderOnInit(); \ - } \ - \ - AZ_DLL_EXPORT void UninitializeModule() \ - { \ - BuilderDestroy(); \ - AZ::Environment::Detach(); \ - } \ - \ - AZ_DLL_EXPORT void ModuleRegisterDescriptors() \ - { \ - BuilderRegisterDescriptors(); \ - } \ - \ - AZ_DLL_EXPORT void ModuleAddComponents(AZ::Entity * entity) \ - { \ - BuilderAddComponents(entity); \ - } \ - } -// confusion-reducing note: above end-brace is part of the macro, not a namespace - - diff --git a/Code/Tools/AssetProcessor/CMakeLists.txt b/Code/Tools/AssetProcessor/CMakeLists.txt index 98c5f8e5e8..a47ced43be 100644 --- a/Code/Tools/AssetProcessor/CMakeLists.txt +++ b/Code/Tools/AssetProcessor/CMakeLists.txt @@ -42,6 +42,7 @@ ly_add_target( AZ::AzQtComponents AZ::AzToolsFramework AZ::AssetBuilderSDK + AZ::AssetBuilder.Static ${additional_dependencies} RUNTIME_DEPENDENCIES AZ::AssetBuilder diff --git a/Code/Tools/AssetProcessor/native/assetprocessor.h b/Code/Tools/AssetProcessor/native/assetprocessor.h index 1c13eca200..83eb0464a5 100644 --- a/Code/Tools/AssetProcessor/native/assetprocessor.h +++ b/Code/Tools/AssetProcessor/native/assetprocessor.h @@ -85,7 +85,7 @@ namespace AssetProcessor enum AssetCatalogStatus { - RequiresSaving, + RequiresSaving, UpToDate }; @@ -213,11 +213,11 @@ namespace AssetProcessor bool m_critical = false; int m_priority = -1; - // indicates whether we need to check the server first for the outputs of this job + // indicates whether we need to check the server first for the outputs of this job // before we start processing locally bool m_checkServer = false; - - // Indicates whether this job needs to be processed irrespective of whether its fingerprint got modified or not. + + // Indicates whether this job needs to be processed irrespective of whether its fingerprint got modified or not. bool m_autoProcessJob = false; AssetBuilderSDK::AssetBuilderDesc m_assetBuilderDesc; @@ -251,9 +251,9 @@ namespace AssetProcessor JobDetails() = default; }; - - //! JobDesc struct is used for identifying jobs that need to be processed again - //! because of job dependency declared on them by other jobs + + //! JobDesc struct is used for identifying jobs that need to be processed again + //! because of job dependency declared on them by other jobs struct JobDesc { AZStd::string m_databaseSourceName; @@ -283,7 +283,7 @@ namespace AssetProcessor } }; - //! JobIndentifier is an internal structure that store all the data that can uniquely identify a job + //! JobIndentifier is an internal structure that store all the data that can uniquely identify a job struct JobIndentifier { JobDesc m_jobDesc; diff --git a/Code/Tools/AssetProcessor/native/ui/MainWindow.cpp b/Code/Tools/AssetProcessor/native/ui/MainWindow.cpp index c3674e6431..0837384d95 100644 --- a/Code/Tools/AssetProcessor/native/ui/MainWindow.cpp +++ b/Code/Tools/AssetProcessor/native/ui/MainWindow.cpp @@ -165,7 +165,7 @@ void MainWindow::Activate() ui->connectionTreeView->header()->resizeSection(ConnectionManager::PortColumn, 60); ui->connectionTreeView->header()->resizeSection(ConnectionManager::PlatformColumn, 60); ui->connectionTreeView->header()->resizeSection(ConnectionManager::AutoConnectColumn, 60); - + ui->connectionTreeView->header()->setStretchLastSection(false); connect(ui->connectionTreeView->selectionModel(), &QItemSelectionModel::selectionChanged, this, &MainWindow::OnConnectionSelectionChanged); @@ -189,12 +189,12 @@ void MainWindow::Activate() ui->allowListAllowedListConnectionsListView->setModel(&m_allowedListAddresses); connect(ui->allowedListRejectedConnectionsListView, &QListView::clicked, this, &MainWindow::OnRejectedConnectionsListViewClicked); ui->allowedListRejectedConnectionsListView->setModel(&m_rejectedAddresses); - + connect(ui->allowedListEnableCheckBox, &QCheckBox::toggled, this, &MainWindow::OnAllowedListCheckBoxToggled); - + connect(ui->allowedListAddHostNameToolButton, &QToolButton::clicked, this, &MainWindow::OnAddHostNameAllowedListButtonClicked); connect(ui->allowedListAddIPToolButton, &QPushButton::clicked, this, &MainWindow::OnAddIPAllowedListButtonClicked); - + connect(ui->allowedListToAllowedListToolButton, &QPushButton::clicked, this, &MainWindow::OnToAllowedListButtonClicked); connect(ui->allowedListToRejectedListToolButton, &QToolButton::clicked, this, &MainWindow::OnToRejectedListButtonClicked); @@ -204,7 +204,7 @@ void MainWindow::Activate() QRegExpValidator* hostNameValidator = new QRegExpValidator(validHostName, this); ui->allowedListAddHostNameLineEdit->setValidator(hostNameValidator); - + QRegExpValidator* ipValidator = new QRegExpValidator(validIP, this); ui->allowedListAddIPLineEdit->setValidator(ipValidator); @@ -235,7 +235,7 @@ void MainWindow::Activate() m_logSortFilterProxy->setSourceModel(m_logsModel); m_logSortFilterProxy->setFilterKeyColumn(AzToolsFramework::Logging::LogTableModel::ColumnMessage); m_logSortFilterProxy->setFilterCaseSensitivity(Qt::CaseInsensitive); - + ui->jobLogTableView->setModel(m_logSortFilterProxy); ui->jobLogTableView->setItemDelegate(new AzToolsFramework::Logging::LogTableItemDelegate(ui->jobLogTableView)); ui->jobLogTableView->setExpandOnSelection(); @@ -400,7 +400,7 @@ void MainWindow::Activate() bool zeroAnalysisModeFromSettings = settings.value("EnableZeroAnalysis", QVariant(true)).toBool(); settings.endGroup(); - QObject::connect(ui->modtimeSkippingCheckBox, &QCheckBox::stateChanged, this, + QObject::connect(ui->modtimeSkippingCheckBox, &QCheckBox::stateChanged, this, [this](int newCheckState) { bool newOption = newCheckState == Qt::Checked ? true : false; @@ -543,7 +543,7 @@ void MainWindow::OnAddConnection(bool /*checked*/) m_guiApplicationManager->GetConnectionManager()->addUserConnection(); } -void MainWindow::OnAllowedListConnectionsListViewClicked() +void MainWindow::OnAllowedListConnectionsListViewClicked() { ui->allowedListRejectedConnectionsListView->clearSelection(); } @@ -553,7 +553,7 @@ void MainWindow::OnRejectedConnectionsListViewClicked() ui->allowListAllowedListConnectionsListView->clearSelection(); } -void MainWindow::OnAllowedListCheckBoxToggled() +void MainWindow::OnAllowedListCheckBoxToggled() { if (!ui->allowedListEnableCheckBox->isChecked()) { @@ -588,7 +588,7 @@ void MainWindow::OnAllowedListCheckBoxToggled() ui->allowedListToAllowedListToolButton->setEnabled(true); ui->allowedListToRejectedListToolButton->setEnabled(true); } - + m_guiApplicationManager->GetConnectionManager()->AllowedListingEnabled(ui->allowedListEnableCheckBox->isChecked()); } @@ -858,7 +858,7 @@ void MainWindow::OnAssetProcessorStatusChanged(const AssetProcessor::AssetProces text = tr("Working, analyzing jobs remaining %1, processing jobs remaining %2...").arg(m_createJobCount).arg(m_processJobsCount); ui->timerContainerWidget->setVisible(false); ui->productAssetDetailsPanel->SetScanQueueEnabled(false); - + IntervalAssetTabFilterRefresh(); } else @@ -877,7 +877,7 @@ void MainWindow::OnAssetProcessorStatusChanged(const AssetProcessor::AssetProces break; case AssetProcessorStatus::Processing_Jobs: CheckStartProcessTimers(); - m_processJobsCount = entry.m_count; + m_processJobsCount = entry.m_count; if (m_processJobsCount + m_createJobCount > 0) { @@ -983,7 +983,7 @@ void MainWindow::ApplyConfig() ui->jobLogTableView->header()->resizeSection(AzToolsFramework::Logging::LogTableModel::ColumnType, m_config.logTypeColumnWidth); } -MainWindow::LogSortFilterProxy::LogSortFilterProxy(QObject* parentOjbect) : QSortFilterProxyModel(parentOjbect) +MainWindow::LogSortFilterProxy::LogSortFilterProxy(QObject* parentOjbect) : QSortFilterProxyModel(parentOjbect) { } @@ -1302,7 +1302,7 @@ void MainWindow::ShowJobViewContextMenu(const QPoint& pos) ui->sourceAssetDetailsPanel->GoToSource(item->m_elementId.GetInputAssetName().toUtf8().constData()); }); - QString productMenuTitle(tr("View product asset...")); + QString productMenuTitle(tr("View product asset...")); if (item->m_jobState != AzToolsFramework::AssetSystem::JobStatus::Completed) { QString disabledActionTooltip(tr("Only completed jobs are available in the Assets tab.")); @@ -1610,7 +1610,7 @@ void MainWindow::ShowProductAssetContextMenu(const QPoint& pos) { AzQtComponents::ShowFileOnDesktop(pathToProduct.GetValue()); } - + }); QString fileOrFolder(cachedAsset->getChildCount() > 0 ? tr("folder") : tr("file")); diff --git a/Code/Tools/AssetProcessor/native/utilities/ApplicationManager.cpp b/Code/Tools/AssetProcessor/native/utilities/ApplicationManager.cpp index 7a14f158d6..57884b304f 100644 --- a/Code/Tools/AssetProcessor/native/utilities/ApplicationManager.cpp +++ b/Code/Tools/AssetProcessor/native/utilities/ApplicationManager.cpp @@ -231,44 +231,6 @@ bool ApplicationManager::InitiatedShutdown() const return m_duringShutdown; } -void ApplicationManager::GetExternalBuilderFileList(QStringList& externalBuilderModules) -{ - externalBuilderModules.clear(); - - static const char* builder_folder_name = "Builders"; - - // LY_ASSET_BUILDERS is defined by the CMakeLists.txt. The asset builders add themselves to a variable that - // is populated to allow selective building of those asset builder targets. - // This allows left over Asset builders in the output directory to not be loaded by the AssetProcessor -#if !defined(LY_ASSET_BUILDERS) - #error LY_ASSET_BUILDERS was not defined for ApplicationManager.cpp -#endif - - QDir builderDir = QDir::toNativeSeparators(QString(this->m_frameworkApp.GetExecutableFolder())); - builderDir.cd(QString(builder_folder_name)); - if (builderDir.exists()) - { - AZStd::vector tokens; - AZ::StringFunc::Tokenize(AZStd::string_view(LY_ASSET_BUILDERS), tokens, ','); - AZStd::string builderLibrary; - for (const AZStd::string& token : tokens) - { - QString assetBuilderPath(token.c_str()); - if (builderDir.exists(assetBuilderPath)) - { - externalBuilderModules.push_back(builderDir.absoluteFilePath(assetBuilderPath)); - } - } - } - - if (externalBuilderModules.empty()) - { - AZ_TracePrintf(AssetProcessor::ConsoleChannel, "AssetProcessor was unable to locate any external builders\n"); - } -} - - - QDir ApplicationManager::GetSystemRoot() const { return m_systemRoot; @@ -459,15 +421,6 @@ void ApplicationManager::PopulateApplicationDependencies() m_filesOfInterest.push_back(dir.absoluteFilePath(pathWithPlatformExtension)); } - // Get the external builder modules to add to the files of interest - QStringList builderModuleFileList; - GetExternalBuilderFileList(builderModuleFileList); - for (const QString& builderModuleFile : builderModuleFileList) - { - m_filesOfInterest.push_back(builderModuleFile); - } - - QDir assetRoot; AssetUtilities::ComputeAssetRoot(assetRoot); diff --git a/Code/Tools/AssetProcessor/native/utilities/ApplicationManager.h b/Code/Tools/AssetProcessor/native/utilities/ApplicationManager.h index 91cf2185b7..56d65d6784 100644 --- a/Code/Tools/AssetProcessor/native/utilities/ApplicationManager.h +++ b/Code/Tools/AssetProcessor/native/utilities/ApplicationManager.h @@ -139,7 +139,7 @@ protected: void RegisterObjectForQuit(QObject* source, bool insertInFront = false); bool NeedRestart() const; void addRunningThread(AssetProcessor::ThreadWorker* thread); - + template void RegisterInternalBuilder(const QString& builderName); @@ -151,9 +151,6 @@ protected: bool m_duringStartup = true; AssetProcessorAZApplication m_frameworkApp; QCoreApplication* m_qApp = nullptr; - - //! Get the list of external builder files for this asset processor - void GetExternalBuilderFileList(QStringList& externalBuilderModules); virtual void Reflect() = 0; virtual const char* GetLogBaseName() = 0; diff --git a/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp b/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp index 8837e9dc3f..04036602db 100644 --- a/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp +++ b/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include @@ -32,9 +33,6 @@ #include -//! Amount of time to wait between checking the status of the AssetBuilder process -static const int s_MaximumSleepTimeMS = 10; - //! CreateJobs will wait up to 2 minutes before timing out //! This shouldn't need to be so high but very large slices can take a while to process currently //! This should be reduced down to something more reasonable after slice jobs are sped up @@ -64,6 +62,7 @@ ApplicationManagerBase::~ApplicationManagerBase() AZ::Debug::TraceMessageBus::Handler::BusDisconnect(); AssetProcessor::AssetBuilderRegistrationBus::Handler::BusDisconnect(); AssetBuilderSDK::AssetBuilderBus::Handler::BusDisconnect(); + AssetProcessor::AssetBuilderInfoBus::Handler::BusDisconnect(); if (m_settingsRegistryBuilder) { @@ -192,7 +191,7 @@ void ApplicationManagerBase::InitAssetProcessorManager() { m_assetProcessorManager->SetEnableModtimeSkippingFeature(true); } - + if (commandLine->HasSwitch(Command_enableQueryLogging.m_switch)) { m_assetProcessorManager->SetQueryLogging(true); @@ -206,7 +205,7 @@ void ApplicationManagerBase::InitAssetProcessorManager() { m_dependencyScanPattern = commandLine->GetSwitchValue(Command_dsp.m_switch, 0).c_str(); } - + m_fileDependencyScanPattern = "*"; if (commandLine->HasSwitch(Command_fileDependencyScanPattern.m_switch)) @@ -327,7 +326,7 @@ void ApplicationManagerBase::InitAssetCatalog() AssetProcessor::AssetCatalog* catalog = new AssetCatalog(assetCatalogHelper, m_platformConfiguration); // Using a direct connection so we know the catalog has been updated before continuing on with code might depend on the asset being in the catalog - connect(m_assetProcessorManager, &AssetProcessorManager::AssetMessage, catalog, &AssetCatalog::OnAssetMessage, Qt::DirectConnection); + connect(m_assetProcessorManager, &AssetProcessorManager::AssetMessage, catalog, &AssetCatalog::OnAssetMessage, Qt::DirectConnection); connect(m_assetProcessorManager, &AssetProcessorManager::SourceQueued, catalog, &AssetCatalog::OnSourceQueued); connect(m_assetProcessorManager, &AssetProcessorManager::SourceFinished, catalog, &AssetCatalog::OnSourceFinished); connect(m_assetProcessorManager, &AssetProcessorManager::PathDependencyResolved, catalog, &AssetCatalog::OnDependencyResolved); @@ -379,12 +378,12 @@ void ApplicationManagerBase::InitAssetScanner() QObject::connect(m_assetScanner, &AssetScanner::FilesFound, [this](QSet files) { m_fileStateCache->AddInfoSet(files); }); QObject::connect(m_assetScanner, &AssetScanner::FoldersFound, [this](QSet files) { m_fileStateCache->AddInfoSet(files); }); QObject::connect(m_assetScanner, &AssetScanner::ExcludedFound, [this](QSet files) { m_fileStateCache->AddInfoSet(files); }); - + // file table QObject::connect(m_assetScanner, &AssetScanner::AssetScanningStatusChanged, m_fileProcessor.get(), &FileProcessor::OnAssetScannerStatusChange); QObject::connect(m_assetScanner, &AssetScanner::FilesFound, m_fileProcessor.get(), &FileProcessor::AssessFilesFromScanner); QObject::connect(m_assetScanner, &AssetScanner::FoldersFound, m_fileProcessor.get(), &FileProcessor::AssessFoldersFromScanner); - + } void ApplicationManagerBase::DestroyAssetScanner() @@ -591,6 +590,51 @@ void ApplicationManagerBase::InitConnectionManager() }, AZStd::placeholders::_1, AZStd::placeholders::_2, AZStd::placeholders::_3, AZStd::placeholders::_4) ); + m_connectionManager->RegisterService( + AssetBuilder::BuilderRegistrationRequest::MessageType, + [this](unsigned int /*connId*/, unsigned int /*type*/, unsigned int /*serial*/, QByteArray payload, QString) + { + AssetBuilder::BuilderRegistrationRequest registrationRequest; + + if (m_builderRegistrationComplete) + { + return; + } + + m_builderRegistrationComplete = true; + + if (AssetProcessor::UnpackMessage(payload, registrationRequest)) + { + for (const auto& builder : registrationRequest.m_builders) + { + AssetBuilderSDK::AssetBuilderDesc desc; + desc.m_name = builder.m_name; + desc.m_patterns = builder.m_patterns; + desc.m_version = builder.m_version; + desc.m_analysisFingerprint = builder.m_analysisFingerprint; + desc.m_flags = builder.m_flags; + desc.m_busId = builder.m_busId; + desc.m_flagsByJobKey = builder.m_flagsByJobKey; + desc.m_productsToKeepOnFailure = builder.m_productsToKeepOnFailure; + + // Builders registered this way are always external builders + desc.m_builderType = AssetBuilderSDK::AssetBuilderDesc::AssetBuilderType::External; + + RegisterBuilderInformation(desc); + } + + QTimer::singleShot( + 0, this, + [this]() + { + if (!PostActivate()) + { + QuitRequested(); + } + }); + } + }); + //You can get Asset Processor Current State using AzFramework::AssetSystem::RequestAssetProcessorStatus; auto GetState = [this](unsigned int connId, unsigned int, unsigned int serial, QByteArray payload, QString) @@ -633,11 +677,11 @@ void ApplicationManagerBase::InitConnectionManager() AssetProcessorPlatformStatusRequest requestMessage; if (AssetProcessor::UnpackMessage(payload, requestMessage)) { - AzToolsFramework::AssetSystemRequestBus::BroadcastResult(responseMessage.m_isPlatformEnabled, + AzToolsFramework::AssetSystemRequestBus::BroadcastResult(responseMessage.m_isPlatformEnabled, &AzToolsFramework::AssetSystemRequestBus::Events::IsAssetPlatformEnabled, requestMessage.m_platform.c_str()); } - AssetProcessor::ConnectionBus::Event(connId, + AssetProcessor::ConnectionBus::Event(connId, &AssetProcessor::ConnectionBus::Events::SendResponse, serial, responseMessage); }); @@ -653,11 +697,11 @@ void ApplicationManagerBase::InitConnectionManager() if (AssetProcessor::UnpackMessage(payload, requestMessage)) { const char* platformIdentifier = requestMessage.m_platform.c_str(); - responseMessage.m_numberOfPendingJobs = + responseMessage.m_numberOfPendingJobs = GetRCController()->NumberOfPendingJobsPerPlatform(platformIdentifier); } - AssetProcessor::ConnectionBus::Event(connId, + AssetProcessor::ConnectionBus::Event(connId, &AssetProcessor::ConnectionBus::Events::SendResponse, serial, responseMessage); }); } @@ -696,7 +740,7 @@ void ApplicationManagerBase::InitAssetRequestHandler(AssetProcessor::AssetReques QObject::connect(GetAssetProcessorManager(), &AssetProcessorManager::SendAssetExistsResponse, m_assetRequestHandler, &AssetRequestHandler::OnRequestAssetExistsResponse); QObject::connect(GetAssetProcessorManager(), &AssetProcessorManager::FenceFileDetected, m_assetRequestHandler, &AssetRequestHandler::OnFenceFileDetected); - + // connect the Asset Request Handler to RC: QObject::connect(m_assetRequestHandler, &AssetRequestHandler::RequestCompileGroup, GetRCController(), &RCController::OnRequestCompileGroup); QObject::connect(m_assetRequestHandler, &AssetRequestHandler::RequestEscalateAssetBySearchTerm, GetRCController(), &RCController::OnEscalateJobsBySearchTerm); @@ -840,14 +884,6 @@ bool ApplicationManagerBase::Run() return false; } - bool startedSuccessfully = true; - - if (!PostActivate()) - { - QuitRequested(); - startedSuccessfully = false; - } - AZ_Printf(AssetProcessor::ConsoleChannel, "Asset Processor Batch Processing Started.\n"); AZ_Printf(AssetProcessor::ConsoleChannel, "-----------------------------------------\n"); QElapsedTimer allAssetsProcessingTimer; @@ -867,7 +903,7 @@ bool ApplicationManagerBase::Run() RemoveOldTempFolders(); Destroy(); - return (startedSuccessfully && FailedAssetsCount() == 0); + return FailedAssetsCount() == 0; } void ApplicationManagerBase::HandleFileRelocation() const @@ -899,7 +935,7 @@ void ApplicationManagerBase::HandleFileRelocation() const while(!m_sourceControlReady) { // We need to wait for source control to be ready before continuing - + if (printCounter % 10 == 0) { AZ_TracePrintf(AssetProcessor::ConsoleChannel, "Waiting for Source Control connection\n"); @@ -1129,7 +1165,7 @@ void ApplicationManagerBase::CheckForIdle() TryScanProductDependencies(); TryHandleFileRelocation(); - + // since we are shutting down, we save the registry and then we quit. AZ_Printf(AssetProcessor::ConsoleChannel, "No assets remain in the build queue. Saving the catalog, and then shutting down.\n"); // stop accepting any further idle messages, as we will shut down - don't want this function to repeat! @@ -1173,7 +1209,7 @@ void ApplicationManagerBase::InitBuilderManager() { m_builderManager->ConnectionLost(connId); }); - + } void ApplicationManagerBase::ShutdownBuilderManager() @@ -1207,7 +1243,7 @@ void ApplicationManagerBase::ShutDownAssetDatabase() AzToolsFramework::AssetDatabase::AssetDatabaseRequests::Bus::Handler::BusDisconnect(); } -void ApplicationManagerBase::InitFileProcessor() +void ApplicationManagerBase::InitFileProcessor() { AssetProcessor::ThreadController* fileProcessorHelper = new AssetProcessor::ThreadController(); @@ -1298,22 +1334,13 @@ bool ApplicationManagerBase::Activate() } InitBuilderConfiguration(); - - m_isCurrentlyLoadingGems = true; - if (!ActivateModules()) - { - // ActivateModules reports any errors it encounters. - m_isCurrentlyLoadingGems = false; - return false; - } - - m_isCurrentlyLoadingGems = false; PopulateApplicationDependencies(); InitAssetProcessorManager(); AssetBuilderSDK::InitializeSerializationContext(); AssetBuilderSDK::InitializeBehaviorContext(); - + AssetBuilder::InitializeSerializationContext(); + InitFileStateCache(); InitFileProcessor(); @@ -1341,7 +1368,7 @@ bool ApplicationManagerBase::Activate() RegisterObjectForQuit(m_rcController); m_connectionsToRemoveOnShutdown << QObject::connect( - m_assetProcessorManager, &AssetProcessor::AssetProcessorManager::AssetProcessorManagerIdleState, + m_assetProcessorManager, &AssetProcessor::AssetProcessorManager::AssetProcessorManagerIdleState, this, [this](bool state) { if (state) @@ -1362,7 +1389,7 @@ bool ApplicationManagerBase::Activate() }); m_connectionsToRemoveOnShutdown << QObject::connect( - this, &ApplicationManagerBase::CheckAssetProcessorManagerIdleState, + this, &ApplicationManagerBase::CheckAssetProcessorManagerIdleState, m_assetProcessorManager, &AssetProcessor::AssetProcessorManager::CheckAssetProcessorIdleState); MakeActivationConnections(); @@ -1376,6 +1403,22 @@ bool ApplicationManagerBase::Activate() return false; } } + + AssetProcessor::AssetProcessorStatusEntry entry(AssetProcessor::AssetProcessorStatus::Initializing_Builders, 0, QString()); + Q_EMIT AssetProcessorStatusChanged(entry); + + AZStd::thread_desc desc; + desc.m_name = "Builder Component Registration"; + AZStd::thread builderRegistrationThread( + desc, + []() + { + AssetProcessor::BuilderRef builder; + AssetProcessor::BuilderManagerBus::BroadcastResult(builder, &AssetProcessor::BuilderManagerBus::Events::GetBuilder, true); + }); + + builderRegistrationThread.detach(); + return true; } @@ -1384,11 +1427,6 @@ bool ApplicationManagerBase::PostActivate() m_connectionManager->LoadConnections(); InitializeInternalBuilders(); - if (!InitializeExternalBuilders()) - { - AZ_Error("AssetProcessor", false, "AssetProcessor is closing. Failed to initialize and load all the external builders. Please ensure that Builders_Temp directory is not read-only. Please see log for more information.\n"); - return false; - } Q_EMIT OnBuildersRegistered(); @@ -1401,7 +1439,7 @@ bool ApplicationManagerBase::PostActivate() AZ::SystemTickBus::Broadcast(&AZ::SystemTickEvents::OnSystemTick); }); - // now that everything is up and running, we start scanning. Before this, we don't want file events to start percolating through the + // now that everything is up and running, we start scanning. Before this, we don't want file events to start percolating through the // asset system. GetAssetScanner()->StartScan(); @@ -1425,192 +1463,87 @@ bool ApplicationManagerBase::InitializeInternalBuilders() return result; } -bool ApplicationManagerBase::InitializeExternalBuilders() -{ - AssetProcessor::AssetProcessorStatusEntry entry(AssetProcessor::AssetProcessorStatus::Initializing_Builders); - Q_EMIT AssetProcessorStatusChanged(entry); - QCoreApplication::processEvents(QEventLoop::AllEvents); - - - // Get the list of external build modules (full paths) - QStringList fileList; - GetExternalBuilderFileList(fileList); - - for (const QString& filePath : fileList) - { - if (QLibrary::isLibrary(filePath)) - { - AssetProcessor::ExternalModuleAssetBuilderInfo* externalAssetBuilderInfo = new AssetProcessor::ExternalModuleAssetBuilderInfo(filePath); - AssetProcessor::AssetBuilderType assetBuilderType = externalAssetBuilderInfo->Load(); - AZ_TracePrintf(AssetProcessor::ConsoleChannel, "AssetProcessor is loading library %s\n", filePath.toUtf8().data()); - if (assetBuilderType == AssetProcessor::AssetBuilderType::None) - { - AZ_Warning(AssetProcessor::DebugChannel, false, "Non-builder DLL was found in Builders directory %s, skipping. \n", filePath.toUtf8().data()); - delete externalAssetBuilderInfo; - continue; - } - - if (assetBuilderType == AssetProcessor::AssetBuilderType::Invalid) - { - AZ_Warning(AssetProcessor::DebugChannel, false, "AssetProcessor was not able to load the library: %s\n", filePath.toUtf8().data()); - delete externalAssetBuilderInfo; - return false; - } - - AZ_TracePrintf(AssetProcessor::ConsoleChannel, "Initializing and registering builder %s\n", externalAssetBuilderInfo->GetName().toUtf8().data()); - - m_currentExternalAssetBuilder = externalAssetBuilderInfo; - - externalAssetBuilderInfo->Initialize(); - - m_currentExternalAssetBuilder = nullptr; - - m_externalAssetBuilders.push_back(externalAssetBuilderInfo); - } - } - - // Also init external builders which may be inside of Gems - AzToolsFramework::ToolsApplicationRequestBus::Broadcast( - &AzToolsFramework::ToolsApplicationRequests::CreateAndAddEntityFromComponentTags, - AZStd::vector({ AssetBuilderSDK::ComponentTags::AssetBuilder }), "AssetBuilders Entity"); - - return true; -} - -bool ApplicationManagerBase::WaitForBuilderExit(AzFramework::ProcessWatcher* processWatcher, AssetBuilderSDK::JobCancelListener* jobCancelListener, AZ::u32 processTimeoutLimitInSeconds) +void ApplicationManagerBase::RegisterBuilderInformation(const AssetBuilderSDK::AssetBuilderDesc& builderDesc) { - AZ::u32 exitCode = 0; - bool finishedOK = false; - QElapsedTimer ticker; - ProcessCommunicatorTracePrinter tracer(processWatcher->GetCommunicator(), "AssetBuilder"); - - ticker.start(); - - while (!finishedOK) - { - AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(s_MaximumSleepTimeMS)); - - tracer.Pump(); - - if (ticker.elapsed() > processTimeoutLimitInSeconds * 1000 || (jobCancelListener && jobCancelListener->IsCancelled())) - { - break; - } - - if (!processWatcher->IsProcessRunning(&exitCode)) - { - finishedOK = true; // we either cant wait for it, or it finished. - break; - } - } - - tracer.Pump(); // empty whats left if possible. - - if (processWatcher->IsProcessRunning(&exitCode)) + if (!builderDesc.IsExternalBuilder()) { - processWatcher->TerminateProcess(1); - } + // Create Job Function validation + AZ_Error( + AssetProcessor::ConsoleChannel, builderDesc.m_createJobFunction, + "Create Job Function (m_createJobFunction) for %s builder is empty.\n", builderDesc.m_name.c_str()); - if (exitCode != 0) - { - AZ_Error(AssetProcessor::ConsoleChannel, false, "AssetBuilder exited with error code %d", exitCode); - return false; - } - else if (jobCancelListener && jobCancelListener->IsCancelled()) - { - AZ_TracePrintf(AssetProcessor::DebugChannel, "AssetBuilder was terminated. There was a request to cancel the job.\n"); - return false; - } - else if (!finishedOK) - { - AZ_Error(AssetProcessor::ConsoleChannel, false, "AssetBuilder failed to terminate within %d seconds", processTimeoutLimitInSeconds); - return false; + // Process Job Function validation + AZ_Error( + AssetProcessor::ConsoleChannel, builderDesc.m_processJobFunction, + "Process Job Function (m_processJobFunction) for %s builder is empty.\n", builderDesc.m_name.c_str()); } - return true; -} - -void ApplicationManagerBase::RegisterBuilderInformation(const AssetBuilderSDK::AssetBuilderDesc& builderDesc) -{ - // Create Job Function validation - AZ_Error(AssetProcessor::ConsoleChannel, - builderDesc.m_createJobFunction, - "Create Job Function (m_createJobFunction) for %s builder is empty.\n", - builderDesc.m_name.c_str()); - - // Process Job Function validation - AZ_Error(AssetProcessor::ConsoleChannel, - builderDesc.m_processJobFunction, - "Process Job Function (m_processJobFunction) for %s builder is empty.\n", - builderDesc.m_name.c_str()); - // Bus ID validation AZ_Error(AssetProcessor::ConsoleChannel, !builderDesc.m_busId.IsNull(), "Bus ID for %s builder is empty.\n", builderDesc.m_name.c_str()); - // This is an external builder registering, we will want to track its builder desc since it can register multiple ones - AZStd::string builderFilePath; - if (m_currentExternalAssetBuilder) - { - m_currentExternalAssetBuilder->RegisterBuilderDesc(builderDesc.m_busId); - builderFilePath = m_currentExternalAssetBuilder->GetModuleFullPath().toUtf8().data(); - } - AssetBuilderSDK::AssetBuilderDesc modifiedBuilderDesc = builderDesc; // Allow for overrides defined in a BuilderConfig.ini file to update our code defined default values AssetProcessor::BuilderConfigurationRequestBus::Broadcast(&AssetProcessor::BuilderConfigurationRequests::UpdateBuilderDescriptor, builderDesc.m_name, modifiedBuilderDesc); if (builderDesc.IsExternalBuilder()) { - // We're going to override the createJob function so we can run it externally in AssetBuilder, rather than having it run inside the AP - modifiedBuilderDesc.m_createJobFunction = [builderFilePath](const AssetBuilderSDK::CreateJobsRequest& request, AssetBuilderSDK::CreateJobsResponse& response) - { - AssetProcessor::BuilderRef builderRef; - AssetProcessor::BuilderManagerBus::BroadcastResult(builderRef, &AssetProcessor::BuilderManagerBusTraits::GetBuilder); + // We're going to override the createJob function so we can run it externally in AssetBuilder, rather than having it run + // inside the AP + modifiedBuilderDesc.m_createJobFunction = + [](const AssetBuilderSDK::CreateJobsRequest& request, AssetBuilderSDK::CreateJobsResponse& response) + { + AssetProcessor::BuilderRef builderRef; + AssetProcessor::BuilderManagerBus::BroadcastResult(builderRef, &AssetProcessor::BuilderManagerBusTraits::GetBuilder, false); - if (builderRef) - { - int retryCount = 0; - AssetProcessor::BuilderRunJobOutcome result; + if (builderRef) + { + int retryCount = 0; + AssetProcessor::BuilderRunJobOutcome result; - do - { - retryCount++; - result = builderRef->RunJob(request, response, s_MaximumCreateJobsTimeSeconds, "create", builderFilePath, nullptr); - } while (result == AssetProcessor::BuilderRunJobOutcome::LostConnection && retryCount <= AssetProcessor::RetriesForJobNetworkError); - } - else + do { - AZ_Error("AssetProcessor", false, "Failed to retrieve a valid builder to process job"); - } - }; + retryCount++; + result = builderRef->RunJob( + request, response, s_MaximumCreateJobsTimeSeconds, "create", "", nullptr); + } while (result == AssetProcessor::BuilderRunJobOutcome::LostConnection && + retryCount <= AssetProcessor::RetriesForJobNetworkError); + } + else + { + AZ_Error("AssetProcessor", false, "Failed to retrieve a valid builder to process job"); + } + }; // Also override the processJob function to run externally - modifiedBuilderDesc.m_processJobFunction = [builderFilePath](const AssetBuilderSDK::ProcessJobRequest& request, AssetBuilderSDK::ProcessJobResponse& response) - { - AssetBuilderSDK::JobCancelListener jobCancelListener(request.m_jobId); + modifiedBuilderDesc.m_processJobFunction = + [](const AssetBuilderSDK::ProcessJobRequest& request, AssetBuilderSDK::ProcessJobResponse& response) + { + AssetBuilderSDK::JobCancelListener jobCancelListener(request.m_jobId); - AssetProcessor::BuilderRef builderRef; - AssetProcessor::BuilderManagerBus::BroadcastResult(builderRef, &AssetProcessor::BuilderManagerBusTraits::GetBuilder); + AssetProcessor::BuilderRef builderRef; + AssetProcessor::BuilderManagerBus::BroadcastResult(builderRef, &AssetProcessor::BuilderManagerBusTraits::GetBuilder, false); - if (builderRef) - { - int retryCount = 0; - AssetProcessor::BuilderRunJobOutcome result; + if (builderRef) + { + int retryCount = 0; + AssetProcessor::BuilderRunJobOutcome result; - do - { - retryCount++; - result = builderRef->RunJob(request, response, s_MaximumProcessJobsTimeSeconds, "process", builderFilePath, &jobCancelListener, request.m_tempDirPath); - } while (result == AssetProcessor::BuilderRunJobOutcome::LostConnection && retryCount <= AssetProcessor::RetriesForJobNetworkError); - } - else + do { - AZ_Error("AssetProcessor", false, "Failed to retrieve a valid builder to process job"); - } - }; + retryCount++; + result = builderRef->RunJob( + request, response, s_MaximumProcessJobsTimeSeconds, "process", "", &jobCancelListener, request.m_tempDirPath); + } while (result == AssetProcessor::BuilderRunJobOutcome::LostConnection && + retryCount <= AssetProcessor::RetriesForJobNetworkError); + } + else + { + AZ_Error("AssetProcessor", false, "Failed to retrieve a valid builder to process job"); + } + }; } if (m_builderDescMap.find(modifiedBuilderDesc.m_busId) != m_builderDescMap.end()) @@ -1768,7 +1701,7 @@ bool ApplicationManagerBase::CheckSufficientDiskSpace(const QString& savePath, q [[maybe_unused]] bool result = AzToolsFramework::ToolsFileUtils::GetFreeDiskSpace(savePath, bytesFree); AZ_Assert(result, "Unable to determine the amount of free space on drive containing path (%s).", savePath.toUtf8().constData()); - + if (bytesFree < requiredSpace + s_ReservedDiskSpaceInBytes) { if (shutdownIfInsufficient) @@ -1806,8 +1739,8 @@ void ApplicationManagerBase::RemoveOldTempFolders() return; } - // We will remove old temp folders if either their modified time is older than the cutoff time or - // if the total number of temp folders have exceeded the maximum number of temp folders. + // We will remove old temp folders if either their modified time is older than the cutoff time or + // if the total number of temp folders have exceeded the maximum number of temp folders. QFileInfoList entries = root.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Time); // sorting by modification time int folderCount = 0; bool removeFolder = false; @@ -1821,9 +1754,9 @@ void ApplicationManagerBase::RemoveOldTempFolders() // Since we are sorting the folders list from latest to oldest, we will either be in a state where we have to delete all the remaining folders or not // because either we have reached the folder limit or reached the cutoff date limit. - removeFolder = removeFolder || (folderCount++ >= s_MaximumTempFolders) || + removeFolder = removeFolder || (folderCount++ >= s_MaximumTempFolders) || (entry.lastModified() < cutoffTime); - + if (removeFolder) { QDir dir(entry.absoluteFilePath()); @@ -1837,8 +1770,6 @@ void ApplicationManagerBase::ConnectivityStateChanged(const AzToolsFramework::So Q_EMIT SourceControlReady(); } - - void ApplicationManagerBase::OnAssetProcessorManagerIdleState(bool isIdle) { // these can come in during shutdown. diff --git a/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.h b/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.h index 886880df3a..dbc4841599 100644 --- a/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.h +++ b/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.h @@ -149,7 +149,6 @@ protected: void CreateQtApplication() override; bool InitializeInternalBuilders(); - bool InitializeExternalBuilders(); void InitBuilderManager(); void ShutdownBuilderManager(); bool InitAssetDatabase(); @@ -173,8 +172,6 @@ protected: AssetProcessor::AssetCatalog* GetAssetCatalog() const { return m_assetCatalog; } - static bool WaitForBuilderExit(AzFramework::ProcessWatcher* processWatcher, AssetBuilderSDK::JobCancelListener* jobCancelListener, AZ::u32 processTimeoutLimitInSeconds); - ApplicationServer* m_applicationServer = nullptr; ConnectionManager* m_connectionManager = nullptr; @@ -218,6 +215,8 @@ protected: AZStd::shared_ptr m_internalBuilder; AZStd::shared_ptr m_settingsRegistryBuilder; + bool m_builderRegistrationComplete = false; + // Builder description map based on the builder id AZStd::unordered_map m_builderDescMap; @@ -231,7 +230,7 @@ protected: AZStd::list m_externalAssetBuilders; AssetProcessor::ExternalModuleAssetBuilderInfo* m_currentExternalAssetBuilder = nullptr; - + QAtomicInt m_connectionsAwaitingAssetCatalogSave = 0; int m_remainingAPMJobs = 0; bool m_assetProcessorManagerIsReady = false; diff --git a/Code/Tools/AssetProcessor/native/utilities/BuilderManager.cpp b/Code/Tools/AssetProcessor/native/utilities/BuilderManager.cpp index ddaa5aa777..75c84630f5 100644 --- a/Code/Tools/AssetProcessor/native/utilities/BuilderManager.cpp +++ b/Code/Tools/AssetProcessor/native/utilities/BuilderManager.cpp @@ -16,6 +16,7 @@ #include #include #include +#include namespace AssetProcessor { @@ -138,7 +139,7 @@ namespace AssetProcessor } } - bool Builder::Start() + bool Builder::Start(bool doRegistration) { // Get the current BinXXX folder based on the current running AP QString applicationDir = QCoreApplication::instance()->applicationDirPath(); @@ -155,7 +156,7 @@ namespace AssetProcessor return false; } - const AZStd::vector params = BuildParams("resident", buildersFolder.c_str(), UuidString(), "", ""); + const AZStd::vector params = BuildParams("resident", buildersFolder.c_str(), UuidString(), "", "", doRegistration); m_processWatcher = LaunchProcess(fullExePathString.c_str(), params); @@ -179,7 +180,7 @@ namespace AssetProcessor return !m_processWatcher || (m_processWatcher && m_processWatcher->IsProcessRunning(exitCode)); } - AZStd::vector Builder::BuildParams(const char* task, const char* moduleFilePath, const AZStd::string& builderGuid, const AZStd::string& jobDescriptionFile, const AZStd::string& jobResponseFile) const + AZStd::vector Builder::BuildParams(const char* task, const char* moduleFilePath, const AZStd::string& builderGuid, const AZStd::string& jobDescriptionFile, const AZStd::string& jobResponseFile, bool doRegistration) const { QDir projectCacheRoot; AssetUtilities::ComputeProjectCacheRoot(projectCacheRoot); @@ -200,6 +201,11 @@ namespace AssetProcessor params.emplace_back(AZStd::string::format(R"(-engine-path="%s")", enginePath.c_str())); params.emplace_back(AZStd::string::format("-port=%d", portNumber)); + if(doRegistration) + { + params.emplace_back("--register"); + } + if (moduleFilePath && moduleFilePath[0]) { params.emplace_back(AZStd::string::format(R"(-module="%s")", moduleFilePath)); @@ -232,7 +238,7 @@ namespace AssetProcessor { AzFramework::ProcessLauncher::ProcessLaunchInfo processLaunchInfo; processLaunchInfo.m_processExecutableString = fullExePath; - + AZStd::vector commandLineArray{ fullExePath }; commandLineArray.insert(commandLineArray.end(), params.begin(), params.end()); processLaunchInfo.m_commandlineParameters = AZStd::move(commandLineArray); @@ -350,17 +356,19 @@ namespace AssetProcessor BuilderManager::BuilderManager(ConnectionManager* connectionManager) { using namespace AZStd::placeholders; - connectionManager->RegisterService(AssetBuilderSDK::BuilderHelloRequest::MessageType(), AZStd::bind(&BuilderManager::IncomingBuilderPing, this, _1, _2, _3, _4, _5)); + connectionManager->RegisterService(AssetBuilder::BuilderHelloRequest::MessageType(), AZStd::bind(&BuilderManager::IncomingBuilderPing, this, _1, _2, _3, _4, _5)); // Setup a background thread to pump the idle builders so they don't get blocked trying to output to stdout/err - m_pollingThread = AZStd::thread([this]() + AZStd::thread_desc desc; + desc.m_name = "BuilderManager Idle Pump"; + m_pollingThread = AZStd::thread(desc, [this]() + { + while (!m_quitListener.WasQuitRequested()) { - while (!m_quitListener.WasQuitRequested()) - { - PumpIdleBuilders(); - AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(s_IdleBuilderPumpingDelayMS)); - } - }); + PumpIdleBuilders(); + AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(s_IdleBuilderPumpingDelayMS)); + } + }); m_quitListener.BusConnect(); BusConnect(); @@ -399,8 +407,8 @@ namespace AssetProcessor void BuilderManager::IncomingBuilderPing(AZ::u32 connId, AZ::u32 /*type*/, AZ::u32 serial, QByteArray payload, QString platform) { - AssetBuilderSDK::BuilderHelloRequest requestPing; - AssetBuilderSDK::BuilderHelloResponse responsePing; + AssetBuilder::BuilderHelloRequest requestPing; + AssetBuilder::BuilderHelloResponse responsePing; if (!AZ::Utils::LoadObjectFromBufferInPlace(payload.data(), payload.length(), requestPing)) { @@ -476,7 +484,7 @@ namespace AssetProcessor return builder; } - BuilderRef BuilderManager::GetBuilder() + BuilderRef BuilderManager::GetBuilder(bool doRegistration) { AZStd::shared_ptr newBuilder; BuilderRef builderRef; @@ -484,27 +492,30 @@ namespace AssetProcessor { AZStd::unique_lock lock(m_buildersMutex); - for (auto itr = m_builders.begin(); itr != m_builders.end(); ) + if (!doRegistration) { - auto& builder = itr->second; - - if (!builder->m_busy) + for (auto itr = m_builders.begin(); itr != m_builders.end();) { - builder->PumpCommunicator(); + auto& builder = itr->second; - if (builder->IsValid()) + if (!builder->m_busy) { - return BuilderRef(builder); + builder->PumpCommunicator(); + + if (builder->IsValid()) + { + return BuilderRef(builder); + } + else + { + itr = m_builders.erase(itr); + } } else { - itr = m_builders.erase(itr); + ++itr; } } - else - { - ++itr; - } } AZ_TracePrintf("BuilderManager", "Starting new builder for job request\n"); @@ -516,7 +527,7 @@ namespace AssetProcessor builderRef = BuilderRef(newBuilder); } - if (!newBuilder->Start()) + if (!newBuilder->Start(doRegistration)) { AZ_Error("BuilderManager", false, "Builder failed to start"); diff --git a/Code/Tools/AssetProcessor/native/utilities/BuilderManager.h b/Code/Tools/AssetProcessor/native/utilities/BuilderManager.h index 1208345a39..64241b106e 100644 --- a/Code/Tools/AssetProcessor/native/utilities/BuilderManager.h +++ b/Code/Tools/AssetProcessor/native/utilities/BuilderManager.h @@ -39,7 +39,7 @@ namespace AssetProcessor virtual ~BuilderManagerBusTraits() = default; //! Returns a builder for doing work - virtual BuilderRef GetBuilder() = 0; + virtual BuilderRef GetBuilder(bool doRegistration) = 0; }; using BuilderManagerBus = AZ::EBus; @@ -98,12 +98,12 @@ namespace AssetProcessor private: //! Starts the builder process and waits for it to connect - bool Start(); + bool Start(bool doRegistration); //! Sets the connection id and signals that the builder has connected void SetConnection(AZ::u32 connId); - AZStd::vector BuildParams(const char* task, const char* moduleFilePath, const AZStd::string& builderGuid, const AZStd::string& jobDescriptionFile, const AZStd::string& jobResponseFile) const; + AZStd::vector BuildParams(const char* task, const char* moduleFilePath, const AZStd::string& builderGuid, const AZStd::string& jobDescriptionFile, const AZStd::string& jobResponseFile, bool doRegistration) const; AZStd::unique_ptr LaunchProcess(const char* fullExePath, const AZStd::vector& params) const; //! Waits for the builder exe to send the job response and pumps stdout/err @@ -169,7 +169,7 @@ namespace AssetProcessor void ConnectionLost(AZ::u32 connId); //BuilderManagerBus - BuilderRef GetBuilder() override; + BuilderRef GetBuilder(bool doRegistration) override; private: diff --git a/Code/Tools/AssetProcessor/native/utilities/BuilderManager.inl b/Code/Tools/AssetProcessor/native/utilities/BuilderManager.inl index 9893f32f6a..039680dfae 100644 --- a/Code/Tools/AssetProcessor/native/utilities/BuilderManager.inl +++ b/Code/Tools/AssetProcessor/native/utilities/BuilderManager.inl @@ -50,7 +50,7 @@ namespace AssetProcessor if (!netResponse.m_response.Succeeded() || s_createRequestFileForSuccessfulJob) { - // we write the request out to disk for failure or debugging + // we write the request out to disk for failure or debugging if (!DebugWriteRequestFile(tempFolderPath.c_str(), request, task, modulePath)) { return BuilderRunJobOutcome::FailedToWriteDebugRequest; @@ -83,7 +83,7 @@ namespace AssetProcessor return false; } - auto params = BuildParams(task.c_str(), modulePath.c_str(), "", jobRequestFile, jobResponseFile); + auto params = BuildParams(task.c_str(), modulePath.c_str(), "", jobRequestFile, jobResponseFile, false); AZStd::string paramString; AZ::StringFunc::Join(paramString, params.begin(), params.end(), " "); diff --git a/Code/Tools/AssetProcessor/native/utilities/GUIApplicationManager.cpp b/Code/Tools/AssetProcessor/native/utilities/GUIApplicationManager.cpp index 7652b67db0..13a6b0699a 100644 --- a/Code/Tools/AssetProcessor/native/utilities/GUIApplicationManager.cpp +++ b/Code/Tools/AssetProcessor/native/utilities/GUIApplicationManager.cpp @@ -318,16 +318,8 @@ bool GUIApplicationManager::Run() qApp->setQuitOnLastWindowClosed(false); - QTimer::singleShot(0, this, [this]() - { - if (!PostActivate()) - { - QuitRequested(); - m_startedSuccessfully = false; - } - }); - m_duringStartup = false; + m_startedSuccessfully = true; int resultCode = qApp->exec(); // this blocks until the last window is closed. @@ -483,6 +475,7 @@ bool GUIApplicationManager::PostActivate() { if (!ApplicationManagerBase::PostActivate()) { + m_startedSuccessfully = false; return false; } From 2b9d1ca8132085b6bda548bdefb5a49bd3e63340 Mon Sep 17 00:00:00 2001 From: Vincent Liu <5900509+onecent1101@users.noreply.github.com> Date: Tue, 4 Jan 2022 12:45:51 -0800 Subject: [PATCH 295/948] Update to use AWSNativeSDK 1.9.50 (#6618) * Update to use AWSNativeSDK 1.9.50 * After SDK upgrade, some AWS objects are bound to SDK allocator, init AWS SDK for unit test --- .../AWSNativeSDKInit/AWSLogSystemInterface.h | 2 +- .../AWSNativeSDKInit/AWSMemoryInterface.h | 1 + .../AWSNativeSDKInit/AWSNativeSDKInit.h | 2 +- Gems/AWSCore/Code/CMakeLists.txt | 1 + .../Platform/Windows/AWSCore_Traits_Windows.h | 2 +- .../Code/Tests/AWSCoreSystemComponentTest.cpp | 4 + .../AWSCoreConfigurationTest.cpp | 87 +++----------- .../AWSCVarCredentialHandlerTest.cpp | 5 + .../Tests/Credential/AWSCredentialBusTest.cpp | 20 ++-- .../AWSDefaultCredentialHandlerTest.cpp | 16 ++- .../AWSAttributionServiceApiTest.cpp | 4 +- .../AWSCoreAttributionManagerTest.cpp | 21 ++-- .../Framework/AWSApiClientJobConfigTest.cpp | 13 +-- .../Tests/Framework/AWSApiJobConfigTest.cpp | 7 +- .../Tests/Framework/HttpRequestJobTest.cpp | 6 +- .../Tests/Framework/JsonObjectHandlerTest.cpp | 4 +- .../Code/Tests/Framework/JsonWriterTest.cpp | 4 +- .../Tests/Framework/RequestBuilderTest.cpp | 4 +- .../Framework/ServiceClientJobConfigTest.cpp | 8 +- .../Tests/Framework/ServiceJobUtilTest.cpp | 4 +- .../Tests/Framework/ServiceRequestJobTest.cpp | 4 +- .../AWSCore/Code/Tests/Framework/UtilTest.cpp | 4 +- .../AWSResourceMappingManagerTest.cpp | 110 +++++------------- .../AWSResourceMappingUtilsTest.cpp | 4 +- .../AWSScriptBehaviorDynamoDBTest.cpp | 3 +- .../AWSScriptBehaviorLambdaTest.cpp | 6 +- .../ScriptCanvas/AWSScriptBehaviorS3Test.cpp | 13 ++- .../AWSScriptBehaviorsComponentTest.cpp | 5 +- .../Code/Tests/TestFramework/AWSCoreFixture.h | 15 ++- .../Windows/BuiltInPackages_windows.cmake | 2 +- 30 files changed, 143 insertions(+), 238 deletions(-) diff --git a/Code/Tools/AWSNativeSDKInit/include/AWSNativeSDKInit/AWSLogSystemInterface.h b/Code/Tools/AWSNativeSDKInit/include/AWSNativeSDKInit/AWSLogSystemInterface.h index 4982d3efbd..901e37cd7b 100644 --- a/Code/Tools/AWSNativeSDKInit/include/AWSNativeSDKInit/AWSLogSystemInterface.h +++ b/Code/Tools/AWSNativeSDKInit/include/AWSNativeSDKInit/AWSLogSystemInterface.h @@ -10,7 +10,7 @@ #if defined(PLATFORM_SUPPORTS_AWS_NATIVE_SDK) -#include +#include AZ_PUSH_DISABLE_WARNING(4251 4996, "-Wunknown-warning-option") #include diff --git a/Code/Tools/AWSNativeSDKInit/include/AWSNativeSDKInit/AWSMemoryInterface.h b/Code/Tools/AWSNativeSDKInit/include/AWSNativeSDKInit/AWSMemoryInterface.h index 805088563f..26126057e2 100644 --- a/Code/Tools/AWSNativeSDKInit/include/AWSNativeSDKInit/AWSMemoryInterface.h +++ b/Code/Tools/AWSNativeSDKInit/include/AWSNativeSDKInit/AWSMemoryInterface.h @@ -8,6 +8,7 @@ #pragma once +#include #if defined(PLATFORM_SUPPORTS_AWS_NATIVE_SDK) #include #else diff --git a/Code/Tools/AWSNativeSDKInit/include/AWSNativeSDKInit/AWSNativeSDKInit.h b/Code/Tools/AWSNativeSDKInit/include/AWSNativeSDKInit/AWSNativeSDKInit.h index 32bf02a247..f50d7002eb 100644 --- a/Code/Tools/AWSNativeSDKInit/include/AWSNativeSDKInit/AWSNativeSDKInit.h +++ b/Code/Tools/AWSNativeSDKInit/include/AWSNativeSDKInit/AWSNativeSDKInit.h @@ -13,7 +13,7 @@ #include #if defined(PLATFORM_SUPPORTS_AWS_NATIVE_SDK) - +#include // The AWS Native SDK AWSAllocator triggers a warning due to accessing members of std::allocator directly. // AWSAllocator.h(70): warning C4996: 'std::allocator::pointer': warning STL4010: Various members of std::allocator are deprecated in C++17. // Use std::allocator_traits instead of accessing these members directly. diff --git a/Gems/AWSCore/Code/CMakeLists.txt b/Gems/AWSCore/Code/CMakeLists.txt index 974f3f03bf..877696e26c 100644 --- a/Gems/AWSCore/Code/CMakeLists.txt +++ b/Gems/AWSCore/Code/CMakeLists.txt @@ -202,6 +202,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) 3rdParty::Qt::Gui 3rdParty::Qt::Widgets AZ::AzTest + AZ::AWSNativeSDKInit Gem::AWSCore.Static Gem::AWSCore.Editor.Static ) diff --git a/Gems/AWSCore/Code/Platform/Windows/AWSCore_Traits_Windows.h b/Gems/AWSCore/Code/Platform/Windows/AWSCore_Traits_Windows.h index d7b1f32461..2cacfb0d34 100644 --- a/Gems/AWSCore/Code/Platform/Windows/AWSCore_Traits_Windows.h +++ b/Gems/AWSCore/Code/Platform/Windows/AWSCore_Traits_Windows.h @@ -7,4 +7,4 @@ */ #pragma once -#define AWSCORE_BACKWARD_INCOMPATIBLE_CHANGE 0 +#define AWSCORE_BACKWARD_INCOMPATIBLE_CHANGE 1 diff --git a/Gems/AWSCore/Code/Tests/AWSCoreSystemComponentTest.cpp b/Gems/AWSCore/Code/Tests/AWSCoreSystemComponentTest.cpp index 648648e945..b66b43f735 100644 --- a/Gems/AWSCore/Code/Tests/AWSCoreSystemComponentTest.cpp +++ b/Gems/AWSCore/Code/Tests/AWSCoreSystemComponentTest.cpp @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -103,6 +104,9 @@ public: TEST_F(AWSCoreSystemComponentTest, ComponentActivateTest) { + // Shutdown SDK which is init in fixture setup step + AWSNativeSDKInit::InitializationManager::Shutdown(); + EXPECT_FALSE(m_coreSystemsComponent->IsAWSApiInitialized()); // activate component diff --git a/Gems/AWSCore/Code/Tests/Configuration/AWSCoreConfigurationTest.cpp b/Gems/AWSCore/Code/Tests/Configuration/AWSCoreConfigurationTest.cpp index e54a55f728..696dfd25d3 100644 --- a/Gems/AWSCore/Code/Tests/Configuration/AWSCoreConfigurationTest.cpp +++ b/Gems/AWSCore/Code/Tests/Configuration/AWSCoreConfigurationTest.cpp @@ -8,7 +8,6 @@ #include #include -#include #include #include @@ -39,12 +38,11 @@ class AWSCoreConfigurationTest : public AWSCoreFixture { public: - void CreateTestSetRegFile(const AZStd::string& setregContent) + AWSCoreConfigurationTest() { - m_normalizedSetRegFilePath = AZStd::string::format("%s/%s", - m_normalizedSetRegFolderPath.c_str(), AWSCore::AWSCoreConfiguration::AWSCoreConfigurationFileName); - AzFramework::StringFunc::Path::Normalize(m_normalizedSetRegFilePath); - CreateTestFile(m_normalizedSetRegFilePath, setregContent); + m_setRegFilePath = (GetTestTempDirectoryPath() / + AZ::SettingsRegistryInterface::RegistryFolder / + AWSCore::AWSCoreConfiguration::AWSCoreConfigurationFileName).LexicallyNormal(); } void SetUp() override @@ -53,22 +51,13 @@ public: m_awsCoreConfiguration = AZStd::make_unique(); - m_normalizedSourceProjectFolder = AZStd::string::format("%s/%s%s/", AZ::Test::GetCurrentExecutablePath().c_str(), - "AWSResourceMappingManager", AZ::Uuid::CreateRandom().ToString(false, false).c_str()); - AzFramework::StringFunc::Path::Normalize(m_normalizedSourceProjectFolder); - m_normalizedSetRegFolderPath = AZStd::string::format("%s/%s/", - m_normalizedSourceProjectFolder.c_str(), AZ::SettingsRegistryInterface::RegistryFolder); - AzFramework::StringFunc::Path::Normalize(m_normalizedSetRegFolderPath); - - m_localFileIO->SetAlias("@projectroot@", m_normalizedSourceProjectFolder.c_str()); - - CreateTestSetRegFile(TEST_VALID_RESOURCE_MAPPING_SETREG); + CreateFile(m_setRegFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_SETREG); + m_localFileIO->SetAlias("@projectroot@", GetTestTempDirectoryPath().Native().c_str()); } void TearDown() override { - RemoveTestFile(); - RemoveTestDirectory(); + RemoveFile(m_setRegFilePath.Native()); m_awsCoreConfiguration.reset(); @@ -76,52 +65,12 @@ public: } AZStd::unique_ptr m_awsCoreConfiguration; - AZStd::string m_normalizedSetRegFilePath; - -private: - AZStd::string m_normalizedSourceProjectFolder; - AZStd::string m_normalizedSetRegFolderPath; - - void CreateTestFile(const AZStd::string& filePath, const AZStd::string& fileContent) - { - AZ::IO::SystemFile file; - if (!file.Open(filePath.c_str(), - AZ::IO::SystemFile::OpenMode::SF_OPEN_CREATE | AZ::IO::SystemFile::SF_OPEN_CREATE_PATH | AZ::IO::SystemFile::SF_OPEN_WRITE_ONLY)) - { - AZ_Assert(false, "Failed to open test file"); - } - - if (file.Write(fileContent.c_str(), fileContent.size()) != fileContent.size()) - { - AZ_Assert(false, "Failed to write test file"); - } - file.Close(); - } - - void RemoveTestFile() - { - if (!m_normalizedSetRegFilePath.empty()) - { - AZ_Assert(AZ::IO::SystemFile::Delete(m_normalizedSetRegFilePath.c_str()), - "Failed to delete test settings registry file at %s", m_normalizedSetRegFilePath.c_str()); - } - } - - void RemoveTestDirectory() - { - if (!m_normalizedSetRegFilePath.empty()) - { - AZ_Assert(AZ::IO::SystemFile::DeleteDir(m_normalizedSetRegFolderPath.c_str()), - "Failed to delete test settings registry folder at %s", m_normalizedSetRegFolderPath.c_str()); - AZ_Assert(AZ::IO::SystemFile::DeleteDir(m_normalizedSourceProjectFolder.c_str()), - "Failed to delete test folder at %s", m_normalizedSourceProjectFolder.c_str()); - } - } + AZ::IO::Path m_setRegFilePath; }; TEST_F(AWSCoreConfigurationTest, InitConfig_NoSourceProjectFolderFound_ReturnEmptyConfigFilePath) { - m_settingsRegistry->MergeSettingsFile(m_normalizedSetRegFilePath, AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); + m_settingsRegistry->MergeSettingsFile(m_setRegFilePath.Native(), AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); m_localFileIO->ClearAlias("@projectroot@"); AZ_TEST_START_TRACE_SUPPRESSION; @@ -134,8 +83,8 @@ TEST_F(AWSCoreConfigurationTest, InitConfig_NoSourceProjectFolderFound_ReturnEmp TEST_F(AWSCoreConfigurationTest, InitConfig_SettingsRegistryIsEmpty_ReturnEmptyConfigFilePath) { - CreateTestSetRegFile(TEST_INVALID_RESOURCE_MAPPING_SETREG); - m_settingsRegistry->MergeSettingsFile(m_normalizedSetRegFilePath, AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); + CreateFile(m_setRegFilePath.Native(), TEST_INVALID_RESOURCE_MAPPING_SETREG); + m_settingsRegistry->MergeSettingsFile(m_setRegFilePath.Native(), AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); m_awsCoreConfiguration->InitConfig(); auto actualConfigFilePath = m_awsCoreConfiguration->GetResourceMappingConfigFilePath(); @@ -144,7 +93,7 @@ TEST_F(AWSCoreConfigurationTest, InitConfig_SettingsRegistryIsEmpty_ReturnEmptyC TEST_F(AWSCoreConfigurationTest, InitConfig_LoadValidSettingsRegistry_ReturnNonEmptyConfigFilePath) { - m_settingsRegistry->MergeSettingsFile(m_normalizedSetRegFilePath, AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); + m_settingsRegistry->MergeSettingsFile(m_setRegFilePath.Native(), AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); m_awsCoreConfiguration->InitConfig(); auto actualConfigFilePath = m_awsCoreConfiguration->GetResourceMappingConfigFilePath(); @@ -153,7 +102,7 @@ TEST_F(AWSCoreConfigurationTest, InitConfig_LoadValidSettingsRegistry_ReturnNonE TEST_F(AWSCoreConfigurationTest, ReloadConfiguration_NoSourceProjectFolderFound_ReturnEmptyConfigFilePath) { - m_settingsRegistry->MergeSettingsFile(m_normalizedSetRegFilePath, AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); + m_settingsRegistry->MergeSettingsFile(m_setRegFilePath.Native(), AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); m_localFileIO->ClearAlias("@projectroot@"); m_awsCoreConfiguration->ReloadConfiguration(); @@ -163,8 +112,8 @@ 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, {}); + CreateFile(m_setRegFilePath.Native(), TEST_INVALID_RESOURCE_MAPPING_SETREG); + m_settingsRegistry->MergeSettingsFile(m_setRegFilePath.Native(), AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); m_awsCoreConfiguration->InitConfig(); auto actualConfigFilePath = m_awsCoreConfiguration->GetResourceMappingConfigFilePath(); @@ -172,7 +121,7 @@ TEST_F(AWSCoreConfigurationTest, ReloadConfiguration_LoadValidSettingsRegistryAf EXPECT_TRUE(actualConfigFilePath.empty()); EXPECT_TRUE(actualProfileName == AWSCoreConfiguration::AWSCoreDefaultProfileName); - CreateTestSetRegFile(TEST_VALID_RESOURCE_MAPPING_SETREG); + CreateFile(m_setRegFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_SETREG); m_awsCoreConfiguration->ReloadConfiguration(); actualConfigFilePath = m_awsCoreConfiguration->GetResourceMappingConfigFilePath(); @@ -183,7 +132,7 @@ TEST_F(AWSCoreConfigurationTest, ReloadConfiguration_LoadValidSettingsRegistryAf TEST_F(AWSCoreConfigurationTest, ReloadConfiguration_LoadInvalidSettingsRegistryAfterValidOne_ReturnEmptyConfigFilePath) { - m_settingsRegistry->MergeSettingsFile(m_normalizedSetRegFilePath, AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); + m_settingsRegistry->MergeSettingsFile(m_setRegFilePath.Native(), AZ::SettingsRegistryInterface::Format::JsonMergePatch, {}); m_awsCoreConfiguration->InitConfig(); auto actualConfigFilePath = m_awsCoreConfiguration->GetResourceMappingConfigFilePath(); @@ -191,7 +140,7 @@ TEST_F(AWSCoreConfigurationTest, ReloadConfiguration_LoadInvalidSettingsRegistry EXPECT_FALSE(actualConfigFilePath.empty()); EXPECT_TRUE(actualProfileName != AWSCoreConfiguration::AWSCoreDefaultProfileName); - CreateTestSetRegFile(TEST_INVALID_RESOURCE_MAPPING_SETREG); + CreateFile(m_setRegFilePath.Native(), TEST_INVALID_RESOURCE_MAPPING_SETREG); m_awsCoreConfiguration->ReloadConfiguration(); actualConfigFilePath = m_awsCoreConfiguration->GetResourceMappingConfigFilePath(); diff --git a/Gems/AWSCore/Code/Tests/Credential/AWSCVarCredentialHandlerTest.cpp b/Gems/AWSCore/Code/Tests/Credential/AWSCVarCredentialHandlerTest.cpp index 244c945af9..248737fbe6 100644 --- a/Gems/AWSCore/Code/Tests/Credential/AWSCVarCredentialHandlerTest.cpp +++ b/Gems/AWSCore/Code/Tests/Credential/AWSCVarCredentialHandlerTest.cpp @@ -25,6 +25,11 @@ public: m_credentialHandler = AZStd::make_unique(); } + void TearDown() override + { + m_credentialHandler.reset(); + } + AZStd::unique_ptr m_credentialHandler; }; diff --git a/Gems/AWSCore/Code/Tests/Credential/AWSCredentialBusTest.cpp b/Gems/AWSCore/Code/Tests/Credential/AWSCredentialBusTest.cpp index 82c8c84b81..1b4318f472 100644 --- a/Gems/AWSCore/Code/Tests/Credential/AWSCredentialBusTest.cpp +++ b/Gems/AWSCore/Code/Tests/Credential/AWSCredentialBusTest.cpp @@ -6,8 +6,6 @@ * */ -#include - #include #include @@ -19,14 +17,10 @@ class TestCredentialHandlerOne : AWSCredentialRequestBus::Handler { public: - TestCredentialHandlerOne() + void ActivateHandler() { m_handlerCounter = 0; m_credentialsProvider = std::make_shared(); - } - - void ActivateHandler() - { AWSCredentialRequestBus::Handler::BusConnect(); } @@ -55,14 +49,10 @@ class TestCredentialHandlerTwo : AWSCredentialRequestBus::Handler { public: - TestCredentialHandlerTwo() + void ActivateHandler() { m_handlerCounter = 0; m_credentialsProvider = std::make_shared(); - } - - void ActivateHandler() - { AWSCredentialRequestBus::Handler::BusConnect(); } @@ -88,7 +78,7 @@ public: }; class AWSCredentialBusTest - : public UnitTest::ScopedAllocatorSetupFixture + : public AWSCoreFixture { public: AWSCredentialBusTest() @@ -99,6 +89,8 @@ public: void SetUp() override { + AWSCoreFixture::SetUpFixture(); + m_handlerOne->ActivateHandler(); m_handlerTwo->ActivateHandler(); } @@ -107,6 +99,8 @@ public: { m_handlerOne->DeactivateHandler(); m_handlerTwo->DeactivateHandler(); + + AWSCoreFixture::TearDownFixture(); } AZStd::unique_ptr m_handlerOne; diff --git a/Gems/AWSCore/Code/Tests/Credential/AWSDefaultCredentialHandlerTest.cpp b/Gems/AWSCore/Code/Tests/Credential/AWSDefaultCredentialHandlerTest.cpp index af03afb337..4ff82bcb62 100644 --- a/Gems/AWSCore/Code/Tests/Credential/AWSDefaultCredentialHandlerTest.cpp +++ b/Gems/AWSCore/Code/Tests/Credential/AWSDefaultCredentialHandlerTest.cpp @@ -6,11 +6,9 @@ * */ -#include -#include - #include #include +#include using namespace AWSCore; @@ -18,13 +16,15 @@ static constexpr char AWSDEFAULTCREDENTIALHANDLERTEST_ALLOC_TAG[] = "AWSDefaultC static constexpr const char* AWS_ACCESS_KEY = "AWSACCESSKEY"; static constexpr const char* AWS_SECRET_KEY = "AWSSECRETKEY"; -class EnvironmentAWSCredentialsProviderMock : public Aws::Auth::EnvironmentAWSCredentialsProvider +class EnvironmentAWSCredentialsProviderMock + : public Aws::Auth::EnvironmentAWSCredentialsProvider { public: MOCK_METHOD0(GetAWSCredentials, Aws::Auth::AWSCredentials()); }; -class ProfileConfigFileAWSCredentialsProviderMock : public Aws::Auth::ProfileConfigFileAWSCredentialsProvider +class ProfileConfigFileAWSCredentialsProviderMock + : public Aws::Auth::ProfileConfigFileAWSCredentialsProvider { public: MOCK_METHOD0(GetAWSCredentials, Aws::Auth::AWSCredentials()); @@ -44,7 +44,7 @@ public: }; class AWSDefaultCredentialHandlerTest - : public UnitTest::ScopedAllocatorSetupFixture + : public AWSCoreFixture , public AWSCoreInternalRequestBus::Handler { public: @@ -53,6 +53,8 @@ public: void SetUp() override { + AWSCoreFixture::SetUpFixture(); + AWSCoreInternalRequestBus::Handler::BusConnect(); m_environmentCredentialsProviderMock = Aws::MakeShared(AWSDEFAULTCREDENTIALHANDLERTEST_ALLOC_TAG); m_profileCredentialsProviderMock = Aws::MakeShared(AWSDEFAULTCREDENTIALHANDLERTEST_ALLOC_TAG); @@ -68,6 +70,8 @@ public: m_profileCredentialsProviderMock.reset(); m_environmentCredentialsProviderMock.reset(); AWSCoreInternalRequestBus::Handler::BusDisconnect(); + + AWSCoreFixture::TearDownFixture(); } // AWSCoreInternalRequestBus interface implementation diff --git a/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSAttributionServiceApiTest.cpp b/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSAttributionServiceApiTest.cpp index 4290713e5c..7ce0290ea3 100644 --- a/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSAttributionServiceApiTest.cpp +++ b/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSAttributionServiceApiTest.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include using namespace AWSCore; @@ -36,7 +36,7 @@ namespace AWSCoreUnitTest }; class AWSAttributionServiceApiTest - : public UnitTest::ScopedAllocatorSetupFixture + : public AWSCoreFixture { public: testing::NiceMock JsonReader; diff --git a/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSCoreAttributionManagerTest.cpp b/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSCoreAttributionManagerTest.cpp index e996e0b9c0..b78bfe29c8 100644 --- a/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSCoreAttributionManagerTest.cpp +++ b/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSCoreAttributionManagerTest.cpp @@ -10,7 +10,6 @@ #include #include -#include #include #include #include @@ -23,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -167,7 +165,6 @@ namespace AWSAttributionUnitTest AZStd::unique_ptr m_jobManager; AZStd::array m_resolvedSettingsPath; ModuleManagerRequestBusMock m_moduleManagerRequestBusMock; - AWSCredentialRquestsBusMock m_credentialRequestBusMock; void SetUp() override { @@ -221,6 +218,7 @@ namespace AWSAttributionUnitTest TEST_F(AttributionManagerTest, MetricsSettings_ConsentShown_AttributionDisabled_SkipsSend) { // GIVEN + AWSCredentialRquestsBusMock credentialRequestBusMock; AWSAttributionManagerMock manager; CreateFile(m_resolvedSettingsPath.data(), R"({ @@ -239,7 +237,7 @@ namespace AWSAttributionUnitTest EXPECT_CALL(manager, SubmitMetric(testing::_)).Times(0); EXPECT_CALL(m_moduleManagerRequestBusMock, EnumerateModules(testing::_)).Times(0); - EXPECT_CALL(m_credentialRequestBusMock, GetCredentialsProvider()).Times(1); + EXPECT_CALL(credentialRequestBusMock, GetCredentialsProvider()).Times(1); // WHEN manager.MetricCheck(); @@ -255,6 +253,7 @@ namespace AWSAttributionUnitTest TEST_F(AttributionManagerTest, AttributionEnabled_ContentShown_NoPreviousTimeStamp_SendSuccess) { // GIVEN + AWSCredentialRquestsBusMock credentialRequestBusMock; AWSAttributionManagerMock manager; CreateFile(m_resolvedSettingsPath.data(), R"({ @@ -272,7 +271,7 @@ namespace AWSAttributionUnitTest EXPECT_CALL(manager, SubmitMetric(testing::_)).Times(1); EXPECT_CALL(m_moduleManagerRequestBusMock, EnumerateModules(testing::_)).Times(1); - EXPECT_CALL(m_credentialRequestBusMock, GetCredentialsProvider()).Times(1); + EXPECT_CALL(credentialRequestBusMock, GetCredentialsProvider()).Times(1); // WHEN manager.MetricCheck(); @@ -289,6 +288,7 @@ namespace AWSAttributionUnitTest TEST_F(AttributionManagerTest, AttributionEnabled_ContentShown_ValidPreviousTimeStamp_SendSuccess) { // GIVEN + AWSCredentialRquestsBusMock credentialRequestBusMock; AWSAttributionManagerMock manager; CreateFile(m_resolvedSettingsPath.data(), R"({ @@ -308,7 +308,7 @@ namespace AWSAttributionUnitTest EXPECT_CALL(manager, SubmitMetric(testing::_)).Times(1); EXPECT_CALL(m_moduleManagerRequestBusMock, EnumerateModules(testing::_)).Times(1); - EXPECT_CALL(m_credentialRequestBusMock, GetCredentialsProvider()).Times(1); + EXPECT_CALL(credentialRequestBusMock, GetCredentialsProvider()).Times(1); // WHEN manager.MetricCheck(); @@ -324,6 +324,7 @@ namespace AWSAttributionUnitTest TEST_F(AttributionManagerTest, AttributionEnabled_ContentShown_DelayNotSatisfied_SendFail) { // GIVEN + AWSCredentialRquestsBusMock credentialRequestBusMock; AWSAttributionManagerMock manager; CreateFile(m_resolvedSettingsPath.data(), R"({ @@ -346,7 +347,7 @@ namespace AWSAttributionUnitTest EXPECT_CALL(manager, SubmitMetric(testing::_)).Times(0); EXPECT_CALL(m_moduleManagerRequestBusMock, EnumerateModules(testing::_)).Times(0); - EXPECT_CALL(m_credentialRequestBusMock, GetCredentialsProvider()).Times(1); + EXPECT_CALL(credentialRequestBusMock, GetCredentialsProvider()).Times(1); // WHEN manager.MetricCheck(); @@ -362,6 +363,7 @@ namespace AWSAttributionUnitTest TEST_F(AttributionManagerTest, AttributionEnabledNotFound_ContentShown_SendFail) { // GIVEN + AWSCredentialRquestsBusMock credentialRequestBusMock; AWSAttributionManagerMock manager; CreateFile(m_resolvedSettingsPath.data(), R"({ @@ -378,7 +380,7 @@ namespace AWSAttributionUnitTest EXPECT_CALL(manager, SubmitMetric(testing::_)).Times(0); EXPECT_CALL(m_moduleManagerRequestBusMock, EnumerateModules(testing::_)).Times(0); - EXPECT_CALL(m_credentialRequestBusMock, GetCredentialsProvider()).Times(1); + EXPECT_CALL(credentialRequestBusMock, GetCredentialsProvider()).Times(1); // WHEN manager.MetricCheck(); @@ -394,12 +396,13 @@ namespace AWSAttributionUnitTest TEST_F(AttributionManagerTest, AttributionEnabledNotFound_ContentNotShown_SendFail) { // GIVEN + AWSCredentialRquestsBusMock credentialRequestBusMock; AWSAttributionManagerMock manager; manager.Init(); EXPECT_CALL(manager, SubmitMetric(testing::_)).Times(0); EXPECT_CALL(m_moduleManagerRequestBusMock, EnumerateModules(testing::_)).Times(0); - EXPECT_CALL(m_credentialRequestBusMock, GetCredentialsProvider()).Times(1); + EXPECT_CALL(credentialRequestBusMock, GetCredentialsProvider()).Times(1); EXPECT_CALL(manager, ShowConsentDialog()).Times(1); // WHEN diff --git a/Gems/AWSCore/Code/Tests/Framework/AWSApiClientJobConfigTest.cpp b/Gems/AWSCore/Code/Tests/Framework/AWSApiClientJobConfigTest.cpp index db433062ad..0eca8a37ed 100644 --- a/Gems/AWSCore/Code/Tests/Framework/AWSApiClientJobConfigTest.cpp +++ b/Gems/AWSCore/Code/Tests/Framework/AWSApiClientJobConfigTest.cpp @@ -6,9 +6,6 @@ * */ -#include - -#include #include #include @@ -19,7 +16,7 @@ using namespace AWSCore; class AWSApiClientJobConfigTest - : public UnitTest::ScopedAllocatorSetupFixture + : public AWSCoreFixture , public AWSCredentialRequestBus::Handler { public: @@ -30,13 +27,9 @@ public: void SetUp() override { - AWSNativeSDKInit::InitializationManager::InitAwsApi(); - m_credentialHandlerCounter = 0; - } + AWSCoreFixture::SetUpFixture(); - void TearDown() override - { - AWSNativeSDKInit::InitializationManager::Shutdown(); + m_credentialHandlerCounter = 0; } // AWSCredentialRequestBus interface implementation diff --git a/Gems/AWSCore/Code/Tests/Framework/AWSApiJobConfigTest.cpp b/Gems/AWSCore/Code/Tests/Framework/AWSApiJobConfigTest.cpp index 6976856b60..8caf0ac013 100644 --- a/Gems/AWSCore/Code/Tests/Framework/AWSApiJobConfigTest.cpp +++ b/Gems/AWSCore/Code/Tests/Framework/AWSApiJobConfigTest.cpp @@ -8,7 +8,6 @@ #include #include -#include #include @@ -20,14 +19,14 @@ using namespace AWSCore; class AwsApiJobConfigTest - : public UnitTest::ScopedAllocatorSetupFixture + : public AWSCoreFixture , AWSCredentialRequestBus::Handler , AWSCoreRequestBus::Handler { public: void SetUp() override { - AZ::AllocatorInstance::Create(); + AWSCoreFixture::SetUpFixture(); m_credentialsHandler = std::make_shared(); AZ::JobManagerDesc jobDesc; @@ -45,7 +44,7 @@ public: m_jobManager.reset(); m_credentialsHandler.reset(); - AZ::AllocatorInstance::Destroy(); + AWSCoreFixture::TearDownFixture(); } // AWSCredentialRequestBus interface implementation diff --git a/Gems/AWSCore/Code/Tests/Framework/HttpRequestJobTest.cpp b/Gems/AWSCore/Code/Tests/Framework/HttpRequestJobTest.cpp index e04cdcb2d9..cee5ec0624 100644 --- a/Gems/AWSCore/Code/Tests/Framework/HttpRequestJobTest.cpp +++ b/Gems/AWSCore/Code/Tests/Framework/HttpRequestJobTest.cpp @@ -6,24 +6,24 @@ * */ -#include - #include #include using namespace AWSCore; class HttpRequestJobTest - : public UnitTest::ScopedAllocatorSetupFixture + : public AWSCoreFixture { void SetUp() override { + AWSCoreFixture::SetUpFixture(); HttpRequestJob::StaticInit(); } void TearDown() override { HttpRequestJob::StaticShutdown(); + AWSCoreFixture::TearDownFixture(); } }; diff --git a/Gems/AWSCore/Code/Tests/Framework/JsonObjectHandlerTest.cpp b/Gems/AWSCore/Code/Tests/Framework/JsonObjectHandlerTest.cpp index f7b1546561..49e77be35f 100644 --- a/Gems/AWSCore/Code/Tests/Framework/JsonObjectHandlerTest.cpp +++ b/Gems/AWSCore/Code/Tests/Framework/JsonObjectHandlerTest.cpp @@ -6,8 +6,6 @@ * */ -#include - #include #include @@ -18,7 +16,7 @@ using OBJECT_TYPE = TestObject; using ARRAY_TYPE = AZStd::vector; using ARRAY_OF_ARRAY_TYPE = AZStd::vector>; using ARRAY_OF_OBJECT_TYPE = AZStd::vector>; -using JsonReaderTest = UnitTest::ScopedAllocatorSetupFixture; +using JsonReaderTest = AWSCoreFixture; template void TestJsonReaderSuccess(const ValueType& expectedValue, const char* valueString) diff --git a/Gems/AWSCore/Code/Tests/Framework/JsonWriterTest.cpp b/Gems/AWSCore/Code/Tests/Framework/JsonWriterTest.cpp index 12ada1188c..9a08e6f111 100644 --- a/Gems/AWSCore/Code/Tests/Framework/JsonWriterTest.cpp +++ b/Gems/AWSCore/Code/Tests/Framework/JsonWriterTest.cpp @@ -6,8 +6,6 @@ * */ -#include - #include #include @@ -17,7 +15,7 @@ using namespace AWSCoreTestingUtils; using OBJECT_TYPE = TestObject; using ARRAY_TYPE = AZStd::vector; -using JsonWriterTest = UnitTest::ScopedAllocatorSetupFixture; +using JsonWriterTest = AWSCoreFixture; template void TestJsonWriterSuccess(const ValueType& actualValue, const char* valueString) diff --git a/Gems/AWSCore/Code/Tests/Framework/RequestBuilderTest.cpp b/Gems/AWSCore/Code/Tests/Framework/RequestBuilderTest.cpp index 0c08868100..35ce262f30 100644 --- a/Gems/AWSCore/Code/Tests/Framework/RequestBuilderTest.cpp +++ b/Gems/AWSCore/Code/Tests/Framework/RequestBuilderTest.cpp @@ -6,15 +6,13 @@ * */ -#include - #include #include using namespace AWSCore; using namespace AWSCoreTestingUtils; -using RequestBuilderTest = UnitTest::ScopedAllocatorSetupFixture; +using RequestBuilderTest = AWSCoreFixture; TEST_F(RequestBuilderTest, WriteJsonBodyParameter_UseTestJsonBody_GetExpectedValue) { diff --git a/Gems/AWSCore/Code/Tests/Framework/ServiceClientJobConfigTest.cpp b/Gems/AWSCore/Code/Tests/Framework/ServiceClientJobConfigTest.cpp index 9bc43482cd..3907b097db 100644 --- a/Gems/AWSCore/Code/Tests/Framework/ServiceClientJobConfigTest.cpp +++ b/Gems/AWSCore/Code/Tests/Framework/ServiceClientJobConfigTest.cpp @@ -6,8 +6,6 @@ * */ -#include - #include #include #include @@ -19,17 +17,21 @@ static constexpr const char TEST_EXPECTED_FEATURE_SERVICE_URL[] = "https://featu static constexpr const char TEST_EXPECTED_CUSTOM_SERVICE_URL[] = "https://custom.service.com"; class ServiceClientJobConfigTest - : public UnitTest::ScopedAllocatorSetupFixture + : public AWSCoreFixture , AWSResourceMappingRequestBus::Handler { void SetUp() override { + AWSCoreFixture::SetUpFixture(); + AWSResourceMappingRequestBus::Handler::BusConnect(); } void TearDown() override { AWSResourceMappingRequestBus::Handler::BusDisconnect(); + + AWSCoreFixture::TearDownFixture(); } // AWSResourceMappingRequestBus interface implementation diff --git a/Gems/AWSCore/Code/Tests/Framework/ServiceJobUtilTest.cpp b/Gems/AWSCore/Code/Tests/Framework/ServiceJobUtilTest.cpp index 230fd304d2..c162a0fa13 100644 --- a/Gems/AWSCore/Code/Tests/Framework/ServiceJobUtilTest.cpp +++ b/Gems/AWSCore/Code/Tests/Framework/ServiceJobUtilTest.cpp @@ -6,12 +6,10 @@ * */ -#include - #include #include -using ServiceJobUtilTest = UnitTest::ScopedAllocatorSetupFixture; +using ServiceJobUtilTest = AWSCoreFixture; TEST_F(ServiceJobUtilTest, DetermineRegionFromRequestUrl_DefaultUrlFormat_Success) { diff --git a/Gems/AWSCore/Code/Tests/Framework/ServiceRequestJobTest.cpp b/Gems/AWSCore/Code/Tests/Framework/ServiceRequestJobTest.cpp index bf4f6dd4fd..23fa78cc23 100644 --- a/Gems/AWSCore/Code/Tests/Framework/ServiceRequestJobTest.cpp +++ b/Gems/AWSCore/Code/Tests/Framework/ServiceRequestJobTest.cpp @@ -6,15 +6,13 @@ * */ -#include - #include #include #include using namespace AWSCore; -using ServiceRequestJobTest = UnitTest::ScopedAllocatorSetupFixture; +using ServiceRequestJobTest = AWSCoreFixture; #define TEST_SERVICE_REQUEST(SERVICE_NAME, METHOD, PATH) \ static const char* Path() { return PATH; } \ diff --git a/Gems/AWSCore/Code/Tests/Framework/UtilTest.cpp b/Gems/AWSCore/Code/Tests/Framework/UtilTest.cpp index 5a1589c073..a0320a894c 100644 --- a/Gems/AWSCore/Code/Tests/Framework/UtilTest.cpp +++ b/Gems/AWSCore/Code/Tests/Framework/UtilTest.cpp @@ -6,14 +6,12 @@ * */ -#include - #include #include using namespace AWSCoreTestingUtils; -using FrameworkUtilTest = UnitTest::ScopedAllocatorSetupFixture; +using FrameworkUtilTest = AWSCoreFixture; TEST_F(FrameworkUtilTest, ToAwsString_UseAzString_GetExpectedAwsString) { diff --git a/Gems/AWSCore/Code/Tests/ResourceMapping/AWSResourceMappingManagerTest.cpp b/Gems/AWSCore/Code/Tests/ResourceMapping/AWSResourceMappingManagerTest.cpp index fd37e6e228..6c798dbeca 100644 --- a/Gems/AWSCore/Code/Tests/ResourceMapping/AWSResourceMappingManagerTest.cpp +++ b/Gems/AWSCore/Code/Tests/ResourceMapping/AWSResourceMappingManagerTest.cpp @@ -8,7 +8,6 @@ #include #include -#include #include #include @@ -112,31 +111,21 @@ public: m_resourceMappingManager = AZStd::make_unique(); } - void CreateTestConfigFile(const AZStd::string& configContent) - { - m_normalizedConfigFilePath = AZStd::string::format("%s/%s", m_normalizedConfigFolderPath.c_str(), "test_aws_resource_mappings.json"); - AzFramework::StringFunc::Path::Normalize(m_normalizedConfigFilePath); - CreateTestFile(m_normalizedConfigFilePath, configContent); - } - void SetUp() override { AWSCoreFixture::SetUpFixture(false); - m_normalizedSourceProjectFolder = AZStd::string::format("%s/%s%s/", AZ::Test::GetCurrentExecutablePath().c_str(), - "AWSResourceMappingManager", AZ::Uuid::CreateRandom().ToString(false, false).c_str()); - AzFramework::StringFunc::Path::Normalize(m_normalizedSourceProjectFolder); - m_normalizedConfigFolderPath = AZStd::string::format("%s/%s/", - m_normalizedSourceProjectFolder.c_str(), AWSCore::AWSCoreConfiguration::AWSCoreResourceMappingConfigFolderName); - AzFramework::StringFunc::Path::Normalize(m_normalizedConfigFolderPath); + m_configFilePath = (GetTestTempDirectoryPath() / + AWSCore::AWSCoreConfiguration::AWSCoreResourceMappingConfigFolderName / + "test_aws_resource_mappings.json").LexicallyNormal(); AWSCoreInternalRequestBus::Handler::BusConnect(); } void TearDown() override { AWSCoreInternalRequestBus::Handler::BusDisconnect(); - RemoveTestFile(); - RemoveTestDirectory(); + RemoveFile(m_configFilePath.Native()); + m_configFilePath.clear(); m_reloadConfigurationCounter = 0; m_resourceMappingManager->DeactivateManager(); @@ -147,57 +136,17 @@ public: // AWSCoreInternalRequestBus interface implementation AZStd::string GetProfileName() const override { return ""; } - AZStd::string GetResourceMappingConfigFilePath() const override { return m_normalizedConfigFilePath; } + AZStd::string GetResourceMappingConfigFilePath() const override { return m_configFilePath.Native(); } void ReloadConfiguration() override { m_reloadConfigurationCounter++; } AZStd::unique_ptr m_resourceMappingManager; AZ::u8 m_reloadConfigurationCounter; - -private: - AZStd::string m_normalizedSourceProjectFolder; - AZStd::string m_normalizedConfigFolderPath; - AZStd::string m_normalizedConfigFilePath; - - void CreateTestFile(const AZStd::string& filePath, const AZStd::string& fileContent) - { - AZ::IO::SystemFile file; - if (!file.Open(filePath.c_str(), - AZ::IO::SystemFile::OpenMode::SF_OPEN_CREATE | AZ::IO::SystemFile::SF_OPEN_CREATE_PATH | AZ::IO::SystemFile::SF_OPEN_WRITE_ONLY)) - { - AZ_Assert(false, "Failed to open test file"); - } - - if (file.Write(fileContent.c_str(), fileContent.size()) != fileContent.size()) - { - AZ_Assert(false, "Failed to write test file"); - } - file.Close(); - } - - void RemoveTestFile() - { - if (!m_normalizedConfigFilePath.empty()) - { - AZ_Assert(AZ::IO::SystemFile::Delete(m_normalizedConfigFilePath.c_str()), - "Failed to delete test config file at %s", m_normalizedConfigFilePath.c_str()); - } - } - - void RemoveTestDirectory() - { - if (!m_normalizedConfigFilePath.empty()) - { - AZ_Assert(AZ::IO::SystemFile::DeleteDir(m_normalizedConfigFolderPath.c_str()), - "Failed to delete test config folder at %s", m_normalizedConfigFolderPath.c_str()); - AZ_Assert(AZ::IO::SystemFile::DeleteDir(m_normalizedSourceProjectFolder.c_str()), - "Failed to delete test folder at %s", m_normalizedSourceProjectFolder.c_str()); - } - } + AZ::IO::Path m_configFilePath; }; TEST_F(AWSResourceMappingManagerTest, ActivateManager_ParseInvalidConfigFile_ConfigDataIsEmpty) { - CreateTestConfigFile(TEST_INVALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_INVALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); AZStd::string actualAccountId; @@ -212,7 +161,7 @@ TEST_F(AWSResourceMappingManagerTest, ActivateManager_ParseInvalidConfigFile_Con TEST_F(AWSResourceMappingManagerTest, ActivateManager_ParseValidConfigFile_ConfigDataIsNotEmpty) { - CreateTestConfigFile(TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); AZStd::string actualAccountId; @@ -227,7 +176,7 @@ TEST_F(AWSResourceMappingManagerTest, ActivateManager_ParseValidConfigFile_Confi TEST_F(AWSResourceMappingManagerTest, ActivateManager_ParseTemplateConfigFile_ConfigDataIsNotEmpty) { - CreateTestConfigFile(TEST_TEMPLATE_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_TEMPLATE_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); AZStd::string actualAccountId; @@ -242,7 +191,7 @@ TEST_F(AWSResourceMappingManagerTest, ActivateManager_ParseTemplateConfigFile_Co TEST_F(AWSResourceMappingManagerTest, ActivateManager_ParseValidConfigFile_ConfigDataIsNotEmptyWithMultithreadCalls) { - CreateTestConfigFile(TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); constexpr int testThreadNumber = 10; @@ -267,7 +216,7 @@ TEST_F(AWSResourceMappingManagerTest, ActivateManager_ParseValidConfigFile_Confi TEST_F(AWSResourceMappingManagerTest, ActivateManager_ParseValidConfigFile_GlobalAccountIdEmpty) { - CreateTestConfigFile(TEST_VALID_EMPTY_ACCOUNTID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_VALID_EMPTY_ACCOUNTID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); AZStd::string actualAccountId; @@ -282,7 +231,7 @@ TEST_F(AWSResourceMappingManagerTest, ActivateManager_ParseValidConfigFile_Globa TEST_F(AWSResourceMappingManagerTest, DeactivateManager_AfterActivatingWithValidConfigFile_ConfigDataGetCleanedUp) { - CreateTestConfigFile(TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); AZStd::string actualAccountId; @@ -302,7 +251,7 @@ TEST_F(AWSResourceMappingManagerTest, DeactivateManager_AfterActivatingWithValid TEST_F(AWSResourceMappingManagerTest, GetDefaultAccountId_AfterParsingValidConfigFile_GetExpectedDefaultAccountId) { - CreateTestConfigFile(TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); AZStd::string actualAccountId; @@ -313,7 +262,7 @@ TEST_F(AWSResourceMappingManagerTest, GetDefaultAccountId_AfterParsingValidConfi TEST_F(AWSResourceMappingManagerTest, GetDefaultRegion_AfterParsingValidConfigFile_GetExpectedDefaultRegion) { - CreateTestConfigFile(TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); AZStd::string actualRegion; @@ -324,7 +273,7 @@ TEST_F(AWSResourceMappingManagerTest, GetDefaultRegion_AfterParsingValidConfigFi TEST_F(AWSResourceMappingManagerTest, GetResourceAccountId_AfterParsingValidConfigFile_GetExpectedAccountId) { - CreateTestConfigFile(TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); AZStd::string actualAccountId; @@ -341,7 +290,7 @@ TEST_F(AWSResourceMappingManagerTest, GetResourceAccountId_AfterParsingValidConf TEST_F(AWSResourceMappingManagerTest, GetResourceAccountId_QueryNonexistResourceMappingKeyName_GetEmptyAccountId) { - CreateTestConfigFile(TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); AZStd::string actualAccountId; @@ -352,7 +301,7 @@ TEST_F(AWSResourceMappingManagerTest, GetResourceAccountId_QueryNonexistResource TEST_F(AWSResourceMappingManagerTest, GetResourceNameId_AfterParsingValidConfigFile_GetExpectedNameId) { - CreateTestConfigFile(TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); AZStd::string actualNameId; @@ -369,7 +318,7 @@ TEST_F(AWSResourceMappingManagerTest, GetResourceNameId_AfterParsingValidConfigF TEST_F(AWSResourceMappingManagerTest, GetResourceNameId_QueryNonexistResourceMappingKeyName_GetEmptyNameId) { - CreateTestConfigFile(TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); AZStd::string actualNameId; @@ -380,7 +329,7 @@ TEST_F(AWSResourceMappingManagerTest, GetResourceNameId_QueryNonexistResourceMap TEST_F(AWSResourceMappingManagerTest, GetResourceRegion_AfterParsingValidConfigFile_GetExpectedRegion) { - CreateTestConfigFile(TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); AZStd::string actualRegion; @@ -397,7 +346,7 @@ TEST_F(AWSResourceMappingManagerTest, GetResourceRegion_AfterParsingValidConfigF TEST_F(AWSResourceMappingManagerTest, GetResourceRegion_QueryNonexistResourceMappingKeyName_GetEmptyRegion) { - CreateTestConfigFile(TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); AZStd::string actualRegion; @@ -408,7 +357,7 @@ TEST_F(AWSResourceMappingManagerTest, GetResourceRegion_QueryNonexistResourceMap TEST_F(AWSResourceMappingManagerTest, GetResourceType_AfterParsingValidConfigFile_GetExpectedType) { - CreateTestConfigFile(TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); AZStd::string actualType; @@ -425,7 +374,7 @@ TEST_F(AWSResourceMappingManagerTest, GetResourceType_AfterParsingValidConfigFil TEST_F(AWSResourceMappingManagerTest, GetResourceType_QueryNonexistResourceMappingKeyName_GetEmptyType) { - CreateTestConfigFile(TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); AZStd::string actualType; @@ -436,7 +385,7 @@ TEST_F(AWSResourceMappingManagerTest, GetResourceType_QueryNonexistResourceMappi TEST_F(AWSResourceMappingManagerTest, GetServiceUrl_PassingEmptyServiceName_GetEmptyUrl) { - CreateTestConfigFile(TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); AZStd::string actualServiceUrl; @@ -447,7 +396,7 @@ TEST_F(AWSResourceMappingManagerTest, GetServiceUrl_PassingEmptyServiceName_GetE TEST_F(AWSResourceMappingManagerTest, GetServiceUrl_PassingEmptyRESTApiIdAndStage_GetEmptyUrl) { - CreateTestConfigFile(TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); AZStd::string actualServiceUrl; @@ -458,7 +407,7 @@ TEST_F(AWSResourceMappingManagerTest, GetServiceUrl_PassingEmptyRESTApiIdAndStag TEST_F(AWSResourceMappingManagerTest, GetServiceUrl_RESTApiIdAndStageHaveInconsistentRegion_GetEmptyUrl) { - CreateTestConfigFile(TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); AZStd::string actualServiceUrl; @@ -469,7 +418,7 @@ TEST_F(AWSResourceMappingManagerTest, GetServiceUrl_RESTApiIdAndStageHaveInconsi TEST_F(AWSResourceMappingManagerTest, ReloadConfigFile_ParseValidConfigFileAfterParsingInvalid_ConfigDataGetParsed) { - CreateTestConfigFile(TEST_INVALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_INVALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ActivateManager(); AZStd::string actualAccountId; @@ -481,7 +430,7 @@ TEST_F(AWSResourceMappingManagerTest, ReloadConfigFile_ParseValidConfigFileAfter EXPECT_TRUE(actualRegion.empty()); EXPECT_TRUE(m_resourceMappingManager->GetStatus() == AWSResourceMappingManager::Status::Error); - CreateTestConfigFile(TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ReloadConfigFile(); AWSResourceMappingRequestBus::BroadcastResult(actualAccountId, &AWSResourceMappingRequests::GetDefaultAccountId); @@ -494,7 +443,7 @@ TEST_F(AWSResourceMappingManagerTest, ReloadConfigFile_ParseValidConfigFileAfter TEST_F(AWSResourceMappingManagerTest, ReloadConfigFile_ReloadConfigFileNameAndParseValidConfigFile_ConfigDataGetParsed) { - CreateTestConfigFile(TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); + CreateFile(m_configFilePath.Native(), TEST_VALID_RESOURCE_MAPPING_CONFIG_FILE); m_resourceMappingManager->ReloadConfigFile(true); EXPECT_EQ(m_reloadConfigurationCounter, 1); @@ -505,6 +454,7 @@ TEST_F(AWSResourceMappingManagerTest, ReloadConfigFile_ReloadConfigFileNameAndPa TEST_F(AWSResourceMappingManagerTest, ReloadConfigFile_MissingSetRegFile_ConfigDataIsNotParsed) { + m_configFilePath.clear(); m_resourceMappingManager->ReloadConfigFile(true); EXPECT_EQ(m_reloadConfigurationCounter, 1); diff --git a/Gems/AWSCore/Code/Tests/ResourceMapping/AWSResourceMappingUtilsTest.cpp b/Gems/AWSCore/Code/Tests/ResourceMapping/AWSResourceMappingUtilsTest.cpp index f1a90aa2ae..f5215f89c2 100644 --- a/Gems/AWSCore/Code/Tests/ResourceMapping/AWSResourceMappingUtilsTest.cpp +++ b/Gems/AWSCore/Code/Tests/ResourceMapping/AWSResourceMappingUtilsTest.cpp @@ -6,8 +6,6 @@ * */ -#include - #include #include @@ -18,7 +16,7 @@ static constexpr const char TEST_VALID_RESTAPI_REGION[] = "us-west-2"; static constexpr const char TEST_VALID_RESTAPI_CHINA_REGION[] = "cn-north-1"; static constexpr const char TEST_VALID_RESTAPI_STAGE[] = "prod"; -using AWSResourceMappingUtilsTest = UnitTest::ScopedAllocatorSetupFixture; +using AWSResourceMappingUtilsTest = AWSCoreFixture; TEST_F(AWSResourceMappingUtilsTest, FormatRESTApiUrl_PassingValidArguments_ReturnExpectedResult) { diff --git a/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorDynamoDBTest.cpp b/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorDynamoDBTest.cpp index e42e270bc2..bd66ccb309 100644 --- a/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorDynamoDBTest.cpp +++ b/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorDynamoDBTest.cpp @@ -7,7 +7,6 @@ */ #include -#include #include #include @@ -32,7 +31,7 @@ public: MOCK_METHOD1(OnGetItemError, void(const AZStd::string&)); }; -using AWSScriptBehaviorDynamoDBTest = UnitTest::ScopedAllocatorSetupFixture; +using AWSScriptBehaviorDynamoDBTest = AWSCoreFixture; TEST_F(AWSScriptBehaviorDynamoDBTest, GetItemRaw_CallWithEmptyTableName_InvokeOnError) { diff --git a/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorLambdaTest.cpp b/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorLambdaTest.cpp index 42ccd6eddc..0b2dc8e30c 100644 --- a/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorLambdaTest.cpp +++ b/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorLambdaTest.cpp @@ -7,14 +7,14 @@ */ #include -#include #include #include using namespace AWSCore; -class AWSScriptBehaviorLambdaNotificationBusHandlerMock : public AWSScriptBehaviorLambdaNotificationBusHandler +class AWSScriptBehaviorLambdaNotificationBusHandlerMock + : public AWSScriptBehaviorLambdaNotificationBusHandler { public: AWSScriptBehaviorLambdaNotificationBusHandlerMock() @@ -31,7 +31,7 @@ public: MOCK_METHOD1(OnInvokeError, void(const AZStd::string&)); }; -using AWSScriptBehaviorLambdaTest = UnitTest::ScopedAllocatorSetupFixture; +using AWSScriptBehaviorLambdaTest = AWSCoreFixture; TEST_F(AWSScriptBehaviorLambdaTest, InvokeRaw_CallWithEmptyFunctionName_InvokeOnError) { diff --git a/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorS3Test.cpp b/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorS3Test.cpp index 34a0166e32..da754a0de6 100644 --- a/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorS3Test.cpp +++ b/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorS3Test.cpp @@ -145,17 +145,18 @@ TEST_F(AWSScriptBehaviorS3Test, GetObjectRaw_CallWithOutfileDirectoryNoExist_Inv AWSScriptBehaviorS3::GetObjectRaw("dummyBucket", "dummyObject", "dummyRegion", dummyDirectory); } +#if defined(AZ_DEBUG_BUILD) || defined(AZ_PROFILE_BUILD) +// The preparation step for this test case does not work in release mode TEST_F(AWSScriptBehaviorS3Test, GetObjectRaw_CallWithOutfileIsReadOnly_InvokeOnError) { AWSScriptBehaviorS3NotificationBusHandlerMock s3HandlerMock; EXPECT_CALL(s3HandlerMock, OnGetObjectError(::testing::_)).Times(1); - AZStd::string randomTestFile = AZStd::string::format("%s/test%s.txt", - AZ::Test::GetCurrentExecutablePath().c_str(), AZ::Uuid::CreateRandom().ToString(false, false).c_str()); - AzFramework::StringFunc::Path::Normalize(randomTestFile); - CreateReadOnlyTestFile(randomTestFile); - AWSScriptBehaviorS3::GetObjectRaw("dummyBucket", "dummyObject", "dummyRegion", randomTestFile); - RemoveReadOnlyTestFile(randomTestFile); + AZ::IO::Path randomTestFilePath = (GetTestTempDirectoryPath() / "random_test.txt").LexicallyNormal(); + CreateReadOnlyTestFile(randomTestFilePath.Native()); + AWSScriptBehaviorS3::GetObjectRaw("dummyBucket", "dummyObject", "dummyRegion", randomTestFilePath.Native()); + RemoveReadOnlyTestFile(randomTestFilePath.Native()); } +#endif TEST_F(AWSScriptBehaviorS3Test, GetObject_NoBucketNameInResourceMappingFound_InvokeOnError) { diff --git a/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorsComponentTest.cpp b/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorsComponentTest.cpp index caba8b5ae7..387aa932f6 100644 --- a/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorsComponentTest.cpp +++ b/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorsComponentTest.cpp @@ -9,7 +9,6 @@ #include #include #include -#include #include #include @@ -17,11 +16,12 @@ using namespace AWSCore; class AWSScriptBehaviorsComponentTest - : public UnitTest::ScopedAllocatorSetupFixture + : public AWSCoreFixture { public: void SetUp() override { + AWSCoreFixture::SetUpFixture(); m_serializeContext = AZStd::make_unique(); m_serializeContext->CreateEditContext(); m_behaviorContext = AZStd::make_unique(); @@ -39,6 +39,7 @@ public: m_componentDescriptor.reset(); m_behaviorContext.reset(); m_serializeContext.reset(); + AWSCoreFixture::TearDownFixture(); } protected: diff --git a/Gems/AWSCore/Code/Tests/TestFramework/AWSCoreFixture.h b/Gems/AWSCore/Code/Tests/TestFramework/AWSCoreFixture.h index 65e609b490..6ea5593d0e 100644 --- a/Gems/AWSCore/Code/Tests/TestFramework/AWSCoreFixture.h +++ b/Gems/AWSCore/Code/Tests/TestFramework/AWSCoreFixture.h @@ -17,6 +17,8 @@ #include #include +#include + namespace AWSCoreTestingUtils { static const AZStd::string STRING_VALUE{"s"}; @@ -135,6 +137,8 @@ public: { m_app = AZStd::make_unique(); } + + AWSNativeSDKInit::InitializationManager::InitAwsApi(); } void TearDown() override @@ -144,6 +148,8 @@ public: void TearDownFixture(bool mockSettingsRegistry = true) { + AWSNativeSDKInit::InitializationManager::Shutdown(); + if (mockSettingsRegistry) { AZ::SettingsRegistry::Unregister(m_settingsRegistry.get()); @@ -171,7 +177,7 @@ public: bool CreateFile(const AZStd::string& filePath, const AZStd::string& content) { AZ::IO::HandleType fileHandle; - if (!m_localFileIO->Open(filePath.c_str(), AZ::IO::OpenMode::ModeWrite | AZ::IO::OpenMode::ModeText, fileHandle)) + if (!m_localFileIO->Open(filePath.c_str(), AZ::IO::OpenMode::ModeCreatePath | AZ::IO::OpenMode::ModeWrite | AZ::IO::OpenMode::ModeText, fileHandle)) { return false; } @@ -197,6 +203,13 @@ private: AZ::IO::FileIOBase* m_otherFileIO = nullptr; protected: + AZ::IO::Path GetTestTempDirectoryPath() + { + AZ::IO::Path testTempDirPath{ m_testTempDirectory.GetDirectory() }; + return testTempDirPath; + } + + AZ::Test::ScopedAutoTempDirectory m_testTempDirectory; AZStd::unique_ptr m_settingsRegistry; AZStd::unique_ptr m_app; }; diff --git a/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake b/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake index 90d44a3658..5441bcd76f 100644 --- a/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake +++ b/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake @@ -26,7 +26,7 @@ ly_associate_package(PACKAGE_NAME DirectXShaderCompilerDxc-1.6.2104-o3de-rev3-wi ly_associate_package(PACKAGE_NAME SPIRVCross-2021.04.29-rev1-windows TARGETS SPIRVCross PACKAGE_HASH 7d601ea9d625b1d509d38bd132a1f433d7e895b16adab76bac6103567a7a6817) ly_associate_package(PACKAGE_NAME tiff-4.2.0.15-rev3-windows TARGETS TIFF PACKAGE_HASH c6000a906e6d2a0816b652e93dfbeab41c9ed73cdd5a613acd53e553d0510b60) ly_associate_package(PACKAGE_NAME freetype-2.10.4.16-windows TARGETS freetype PACKAGE_HASH 9809255f1c59b07875097aa8d8c6c21c97c47a31fb35e30f2bb93188e99a85ff) -ly_associate_package(PACKAGE_NAME AWSNativeSDK-1.7.167-rev4-windows TARGETS AWSNativeSDK PACKAGE_HASH a900e80f7259e43aed5c847afee2599ada37f29db70505481397675bcbb6c76c) +ly_associate_package(PACKAGE_NAME AWSNativeSDK-1.9.50-rev2-windows TARGETS AWSNativeSDK PACKAGE_HASH 047de23fa57d33196666c22f45afc9c628bae354a6c39d774cbeee8054b2eb53) ly_associate_package(PACKAGE_NAME Lua-5.3.5-rev5-windows TARGETS Lua PACKAGE_HASH 136faccf1f73891e3fa3b95f908523187792e56f5b92c63c6a6d7e72d1158d40) ly_associate_package(PACKAGE_NAME PhysX-4.1.2.29882248-rev5-windows TARGETS PhysX PACKAGE_HASH 4e31a3e1f5bf3952d8af8e28d1a29f04167995a6362fc3a7c20c25f74bf01e23) ly_associate_package(PACKAGE_NAME mcpp-2.7.2_az.2-rev1-windows TARGETS mcpp PACKAGE_HASH 794789aba639bfe2f4e8fcb4424d679933dd6290e523084aa0a4e287ac44acb2) From 641037e30c11cac03cb67066cef502c2062d2149 Mon Sep 17 00:00:00 2001 From: rgba16f <82187279+rgba16f@users.noreply.github.com> Date: Tue, 4 Jan 2022 15:40:10 -0600 Subject: [PATCH 296/948] Revert "added pass class (#6244)" This reverts commit 515e363151185c1270838f8155cf08e198549ed5. Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com> --- .../Assets/Passes/DiffuseComposite.pass | 2 +- .../Code/Source/CommonSystemComponent.cpp | 2 - .../DiffuseCompositePass.cpp | 45 ------------------- .../DiffuseCompositePass.h | 36 --------------- .../Code/atom_feature_common_files.cmake | 2 - 5 files changed, 1 insertion(+), 86 deletions(-) delete mode 100644 Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseCompositePass.cpp delete mode 100644 Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseCompositePass.h diff --git a/Gems/Atom/Feature/Common/Assets/Passes/DiffuseComposite.pass b/Gems/Atom/Feature/Common/Assets/Passes/DiffuseComposite.pass index 3ad5c06c90..615ee8a162 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/DiffuseComposite.pass +++ b/Gems/Atom/Feature/Common/Assets/Passes/DiffuseComposite.pass @@ -5,7 +5,7 @@ "ClassData": { "PassTemplate": { "Name": "DiffuseCompositePassTemplate", - "PassClass": "DiffuseCompositePass", + "PassClass": "FullScreenTriangle", "Slots": [ { "Name": "DownsampledIrradianceInput", diff --git a/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp b/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp index 04098f5c20..a06defff08 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp @@ -96,7 +96,6 @@ #include #include #include -#include #include #include #include @@ -279,7 +278,6 @@ namespace AZ passSystem->AddPassCreator(Name("DiffuseProbeGridClassificationPass"), &Render::DiffuseProbeGridClassificationPass::Create); passSystem->AddPassCreator(Name("DiffuseProbeGridDownsamplePass"), &Render::DiffuseProbeGridDownsamplePass::Create); passSystem->AddPassCreator(Name("DiffuseProbeGridRenderPass"), &Render::DiffuseProbeGridRenderPass::Create); - passSystem->AddPassCreator(Name("DiffuseCompositePass"), &Render::DiffuseCompositePass::Create); passSystem->AddPassCreator(Name("LuminanceHistogramGeneratorPass"), &LuminanceHistogramGeneratorPass::Create); diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseCompositePass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseCompositePass.cpp deleted file mode 100644 index 0b0dfda391..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseCompositePass.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#include -#include - -namespace AZ -{ - namespace Render - { - // --- Dedicated class for disabling --- - - RPI::Ptr DiffuseCompositePass::Create(const RPI::PassDescriptor& descriptor) - { - RPI::Ptr pass = aznew DiffuseCompositePass(descriptor); - return AZStd::move(pass); - } - - DiffuseCompositePass::DiffuseCompositePass(const RPI::PassDescriptor& descriptor) - : RPI::FullscreenTrianglePass(descriptor) - { } - - bool DiffuseCompositePass::IsEnabled() const - { - const RPI::Scene* scene = GetScene(); - if (!scene) - { - return false; - } - DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = - scene->GetFeatureProcessor(); - if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids().empty()) - { - // no diffuse probe grids - return false; - } - return true; - } - } // namespace Render -} // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseCompositePass.h b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseCompositePass.h deleted file mode 100644 index 333c66ebea..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseCompositePass.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#pragma once - -#include - -namespace AZ -{ - namespace Render - { - //! A class for DiffuseComposite to allow for disabling - class DiffuseCompositePass final - : public RPI::FullscreenTrianglePass - { - AZ_RPI_PASS(DiffuseCompositePass); - - public: - AZ_RTTI(DiffuseCompositePass, "{F3DBEBCB-66F8-465C-A06B-DFA76B9D4856}", AZ::RPI::FullscreenTrianglePass); - AZ_CLASS_ALLOCATOR(DiffuseCompositePass, SystemAllocator, 0); - - ~DiffuseCompositePass() = default; - static RPI::Ptr Create(const RPI::PassDescriptor& descriptor); - - bool IsEnabled() const override; - - private: - DiffuseCompositePass(const RPI::PassDescriptor& descriptor); - - }; - } // namespace Render -} // namespace AZ \ No newline at end of file diff --git a/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake b/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake index 952085e136..375dbd9724 100644 --- a/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake +++ b/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake @@ -134,8 +134,6 @@ set(FILES Source/DiffuseGlobalIllumination/DiffuseProbeGridDownsamplePass.h Source/DiffuseGlobalIllumination/DiffuseProbeGridRenderPass.cpp Source/DiffuseGlobalIllumination/DiffuseProbeGridRenderPass.h - Source/DiffuseGlobalIllumination/DiffuseCompositePass.cpp - Source/DiffuseGlobalIllumination/DiffuseCompositePass.h Source/DiffuseGlobalIllumination/DiffuseProbeGrid.cpp Source/DiffuseGlobalIllumination/DiffuseProbeGrid.h Source/DiffuseGlobalIllumination/DiffuseProbeGridTextureReadback.cpp From c83bf11a3d81d848d11bfbca56c7ebcc68afbbd4 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Tue, 4 Jan 2022 14:21:06 -0800 Subject: [PATCH 297/948] on demand reflect az events when they are the return value of ebuses (#6625) Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../View/Widgets/NodePalette/NodePaletteModel.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/NodePaletteModel.cpp b/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/NodePaletteModel.cpp index 0efdf071f5..113c43682f 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/NodePaletteModel.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/NodePalette/NodePaletteModel.cpp @@ -1159,7 +1159,7 @@ namespace ScriptCanvasEditor , AZStd::string_view eventName , const ScriptCanvas::EBusBusId& busId , const ScriptCanvas::EBusEventId& eventId - , const AZ::BehaviorEBusEventSender& + , const AZ::BehaviorEBusEventSender& sender , ScriptCanvas::PropertyStatus propertyStatus , bool isOverload) { @@ -1193,6 +1193,17 @@ namespace ScriptCanvasEditor senderInformation->m_displayName = details.m_name.empty() ? eventName : details.m_name.c_str(); senderInformation->m_toolTip = details.m_tooltip.empty() ? "" : details.m_tooltip; + auto safeRegister = [](AZ::BehaviorMethod* method) + { + if (method && AZ::MethodReturnsAzEventByReferenceOrPointer(*method)) + { + const AZ::BehaviorParameter* resultParameter = method->GetResult(); + ScriptCanvas::ReflectEventTypeOnDemand(resultParameter->m_typeId, resultParameter->m_name, resultParameter->m_azRtti); + } + }; + + safeRegister(sender.m_event); + safeRegister(sender.m_broadcast); m_registeredNodes.emplace(AZStd::make_pair(nodeIdentifier, senderInformation)); } } From c773c9e9aa512062f097ecf3cbb4211500e462a6 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Tue, 4 Jan 2022 16:39:04 -0600 Subject: [PATCH 298/948] Removed some unused classes from Editor/Controls Signed-off-by: Chris Galvan --- Code/Editor/Controls/ConsoleSCBMFC.h | 111 ---- Code/Editor/Controls/ConsoleSCBMFC.ui | 132 ----- Code/Editor/Controls/HotTrackingTreeCtrl.cpp | 48 -- Code/Editor/Controls/HotTrackingTreeCtrl.h | 33 -- Code/Editor/Controls/ImageListCtrl.cpp | 567 ------------------- Code/Editor/Controls/ImageListCtrl.h | 97 ---- Code/Editor/Controls/MultiMonHelper.cpp | 67 --- Code/Editor/Controls/MultiMonHelper.h | 44 -- Code/Editor/Controls/NumberCtrl.cpp | 143 ----- Code/Editor/Controls/NumberCtrl.h | 64 --- Code/Editor/Controls/TextEditorCtrl.cpp | 93 --- Code/Editor/Controls/TextEditorCtrl.h | 42 -- Code/Editor/Controls/TreeCtrlUtils.h | 322 ----------- Code/Editor/EditorPanelUtils.cpp | 542 ------------------ Code/Editor/EditorPanelUtils.h | 16 - Code/Editor/IEditor.h | 3 - Code/Editor/IEditorImpl.cpp | 13 - Code/Editor/IEditorImpl.h | 2 - Code/Editor/IEditorPanelUtils.h | 131 ----- Code/Editor/Lib/Tests/IEditorMock.h | 1 - Code/Editor/editor_lib_files.cmake | 14 - 21 files changed, 2485 deletions(-) delete mode 100644 Code/Editor/Controls/ConsoleSCBMFC.h delete mode 100644 Code/Editor/Controls/ConsoleSCBMFC.ui delete mode 100644 Code/Editor/Controls/HotTrackingTreeCtrl.cpp delete mode 100644 Code/Editor/Controls/HotTrackingTreeCtrl.h delete mode 100644 Code/Editor/Controls/ImageListCtrl.cpp delete mode 100644 Code/Editor/Controls/ImageListCtrl.h delete mode 100644 Code/Editor/Controls/MultiMonHelper.cpp delete mode 100644 Code/Editor/Controls/MultiMonHelper.h delete mode 100644 Code/Editor/Controls/NumberCtrl.cpp delete mode 100644 Code/Editor/Controls/NumberCtrl.h delete mode 100644 Code/Editor/Controls/TextEditorCtrl.cpp delete mode 100644 Code/Editor/Controls/TextEditorCtrl.h delete mode 100644 Code/Editor/Controls/TreeCtrlUtils.h delete mode 100644 Code/Editor/EditorPanelUtils.cpp delete mode 100644 Code/Editor/EditorPanelUtils.h delete mode 100644 Code/Editor/IEditorPanelUtils.h diff --git a/Code/Editor/Controls/ConsoleSCBMFC.h b/Code/Editor/Controls/ConsoleSCBMFC.h deleted file mode 100644 index fcf7f71df7..0000000000 --- a/Code/Editor/Controls/ConsoleSCBMFC.h +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_CONTROLS_CONSOLESCBMFC_H -#define CRYINCLUDE_EDITOR_CONTROLS_CONSOLESCBMFC_H -#pragma once - -#if !defined(Q_MOC_RUN) -#include -#include -#include - -#include "ConsoleSCB.h" -#endif - -class QMenu; -class ConsoleWidget; -class QFocusEvent; - -namespace Ui { - class ConsoleMFC; -} - -namespace MFC -{ - -struct ConsoleLine -{ - QString text; - bool newLine; -}; -typedef std::deque Lines; - -class ConsoleLineEdit - : public QLineEdit -{ - Q_OBJECT -public: - explicit ConsoleLineEdit(QWidget* parent = nullptr); - -protected: - void mousePressEvent(QMouseEvent* ev) override; - void mouseDoubleClickEvent(QMouseEvent* ev) override; - void keyPressEvent(QKeyEvent* ev) override; - bool event(QEvent* ev) override; - -signals: - void variableEditorRequested(); - void setWindowTitle(const QString&); - -private: - void DisplayHistory(bool bForward); - QStringList m_history; - unsigned int m_historyIndex; - bool m_bReusedHistory; -}; - -class ConsoleTextEdit - : public QTextEdit -{ - Q_OBJECT -public: - explicit ConsoleTextEdit(QWidget* parent = nullptr); -}; - -class CConsoleSCB - : public QWidget -{ - Q_OBJECT -public: - explicit CConsoleSCB(QWidget* parent = nullptr); - ~CConsoleSCB(); - - static void RegisterViewClass(); - void SetInputFocus(); - void AddToConsole(const QString& text, bool bNewLine); - void FlushText(); - void showPopupAndSetTitle(); - QSize sizeHint() const override; - QSize minimumSizeHint() const override; - static CConsoleSCB* GetCreatedInstance(); - - static void AddToPendingLines(const QString& text, bool bNewLine); // call this function instead of AddToConsole() until an instance of CConsoleSCB exists to prevent messages from getting lost - -public Q_SLOTS: - void OnStyleSettingsChanged(); - -private Q_SLOTS: - void showVariableEditor(); - -private: - QScopedPointer ui; - int m_richEditTextLength; - - Lines m_lines; - static Lines s_pendingLines; - - QList m_colorTable; - SEditorSettings::ConsoleColorTheme m_backgroundTheme; -}; - -} // namespace MFC - -#endif // CRYINCLUDE_EDITOR_CONTROLS_CONSOLESCB_H - diff --git a/Code/Editor/Controls/ConsoleSCBMFC.ui b/Code/Editor/Controls/ConsoleSCBMFC.ui deleted file mode 100644 index b9386558ed..0000000000 --- a/Code/Editor/Controls/ConsoleSCBMFC.ui +++ /dev/null @@ -1,132 +0,0 @@ - - - ConsoleMFC - - - - 0 - 0 - 400 - 120 - - - - - 0 - 0 - - - - Console - - - - 0 - - - 0 - - - - - - 0 - 0 - - - - - - - - - - - - 0 - 0 - - - - - 0 - 20 - - - - - 16777215 - 20 - - - - true - - - - - - - 0 - - - 0 - - - - - - 0 - 0 - - - - - 20 - 0 - - - - - 20 - 30 - - - - - 0 - 0 - - - - - - - - - - - - 0 - 0 - - - - - - - - - - - - MFC::ConsoleLineEdit - QLineEdit -
ConsoleSCBMFC.h
-
-
- - - - -
diff --git a/Code/Editor/Controls/HotTrackingTreeCtrl.cpp b/Code/Editor/Controls/HotTrackingTreeCtrl.cpp deleted file mode 100644 index 54152a9fd4..0000000000 --- a/Code/Editor/Controls/HotTrackingTreeCtrl.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include "EditorDefs.h" - -#include "HotTrackingTreeCtrl.h" - -// Qt -#include - - -CHotTrackingTreeCtrl::CHotTrackingTreeCtrl(QWidget* parent) - : QTreeWidget(parent) -{ - setMouseTracking(true); - m_hHoverItem = nullptr; -} - -void CHotTrackingTreeCtrl::mouseMoveEvent(QMouseEvent* event) -{ - QTreeWidgetItem* hItem = itemAt(event->pos()); - - if (m_hHoverItem != nullptr) - { - QFont font = m_hHoverItem->font(0); - font.setBold(false); - m_hHoverItem->setFont(0, font); - m_hHoverItem = nullptr; - } - - if (hItem != nullptr) - { - QFont font = hItem->font(0); - font.setBold(true); - hItem->setFont(0, font); - m_hHoverItem = hItem; - } - - QTreeWidget::mouseMoveEvent(event); -} - -#include diff --git a/Code/Editor/Controls/HotTrackingTreeCtrl.h b/Code/Editor/Controls/HotTrackingTreeCtrl.h deleted file mode 100644 index 2ca7e11a91..0000000000 --- a/Code/Editor/Controls/HotTrackingTreeCtrl.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_CONTROLS_HOTTRACKINGTREECTRL_H -#define CRYINCLUDE_EDITOR_CONTROLS_HOTTRACKINGTREECTRL_H -#pragma once - -#if !defined(Q_MOC_RUN) -#include -#endif - -class CHotTrackingTreeCtrl - : public QTreeWidget -{ - Q_OBJECT - -public: - CHotTrackingTreeCtrl(QWidget* parent = 0); - virtual ~CHotTrackingTreeCtrl(){}; - -protected: - void mouseMoveEvent(QMouseEvent* event) override; - -private: - QTreeWidgetItem* m_hHoverItem; -}; -#endif // CRYINCLUDE_EDITOR_CONTROLS_HOTTRACKINGTREECTRL_H diff --git a/Code/Editor/Controls/ImageListCtrl.cpp b/Code/Editor/Controls/ImageListCtrl.cpp deleted file mode 100644 index 9c8451c2e9..0000000000 --- a/Code/Editor/Controls/ImageListCtrl.cpp +++ /dev/null @@ -1,567 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include "EditorDefs.h" - -#include "ImageListCtrl.h" - -// Qt -#include -#include - -////////////////////////////////////////////////////////////////////////// -CImageListCtrl::CImageListCtrl(QWidget* parent) - : QAbstractItemView(parent) - , m_itemSize(60, 60) - , m_borderSize(4, 4) - , m_style(DefaultStyle) -{ - setItemDelegate(new QImageListDelegate(this)); - setAutoFillBackground(false); - - QPalette p = palette(); - p.setColor(QPalette::Highlight, QColor(255, 55, 50)); - setPalette(p); - - horizontalScrollBar()->setRange(0, 0); - verticalScrollBar()->setRange(0, 0); -} - -////////////////////////////////////////////////////////////////////////// -CImageListCtrl::~CImageListCtrl() -{ -} - -////////////////////////////////////////////////////////////////////////// -CImageListCtrl::ListStyle CImageListCtrl::Style() const -{ - return m_style; -} - -////////////////////////////////////////////////////////////////////////// -void CImageListCtrl::SetStyle(ListStyle style) -{ - m_style = style; - scheduleDelayedItemsLayout(); -} - -////////////////////////////////////////////////////////////////////////// -const QSize& CImageListCtrl::ItemSize() const -{ - return m_itemSize; -} - -////////////////////////////////////////////////////////////////////////// -void CImageListCtrl::SetItemSize(QSize size) -{ - Q_ASSERT(size.isValid()); - m_itemSize = size; - scheduleDelayedItemsLayout(); -} - -////////////////////////////////////////////////////////////////////////// -const QSize& CImageListCtrl::BorderSize() const -{ - return m_borderSize; -} - -////////////////////////////////////////////////////////////////////////// -void CImageListCtrl::SetBorderSize(QSize size) -{ - Q_ASSERT(size.isValid()); - m_borderSize = size; - scheduleDelayedItemsLayout(); -} - -////////////////////////////////////////////////////////////////////////// -QModelIndexList CImageListCtrl::ItemsInRect(const QRect& rect) const -{ - QModelIndexList list; - - if (!model()) - { - return list; - } - - QHash::const_iterator i; - QHash::const_iterator c = m_geometry.cend(); - for (i = m_geometry.cbegin(); i != c; ++i) - { - if (i.value().intersects(rect)) - { - list << model()->index(i.key(), 0, rootIndex()); - } - } - - return list; -} - -////////////////////////////////////////////////////////////////////////// -void CImageListCtrl::paintEvent(QPaintEvent* event) -{ - QAbstractItemView::paintEvent(event); - - if (!model()) - { - return; - } - - const int rowCount = model()->rowCount(); - - if (m_geometry.isEmpty() && rowCount) - { - updateGeometries(); - } - - QPainter painter(viewport()); - painter.setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing); - painter.setBackground(palette().window()); - painter.setFont(font()); - - QStyleOptionViewItem option; - option.palette = palette(); - option.font = font(); - option.fontMetrics = fontMetrics(); - option.decorationAlignment = Qt::AlignCenter; - - const QRect visibleRect(QPoint(horizontalOffset(), verticalOffset()), viewport()->contentsRect().size()); - - painter.translate(-horizontalOffset(), -verticalOffset()); - - for (int r = 0; r < rowCount; ++r) - { - const QModelIndex& index = model()->index(r, 0, rootIndex()); - - option.rect = m_geometry.value(r); - if (!option.rect.intersects(visibleRect)) - { - continue; - } - - option.state = QStyle::State_None; - - if (selectionModel()->isSelected(index)) - { - option.state |= QStyle::State_Selected; - } - - if (currentIndex() == index) - { - option.state |= QStyle::State_HasFocus; - } - - QAbstractItemDelegate* idt = itemDelegate(index); - idt->paint(&painter, option, index); - } -} - -////////////////////////////////////////////////////////////////////////// -void CImageListCtrl::rowsInserted(const QModelIndex& parent, int start, int end) -{ - QAbstractItemView::rowsInserted(parent, start, end); - - if (isVisible()) - { - scheduleDelayedItemsLayout(); - } -} - -////////////////////////////////////////////////////////////////////////// -void CImageListCtrl::updateGeometries() -{ - ClearItemGeometries(); - - if (!model()) - { - return; - } - - const int rowCount = model()->rowCount(); - - const int nPageHorz = viewport()->width(); - const int nPageVert = viewport()->height(); - - if (nPageHorz == 0 || nPageVert == 0 || rowCount <= 0) - { - return; - } - - int x = m_borderSize.width(); - int y = m_borderSize.height(); - - const int nItemWidth = m_itemSize.width() + m_borderSize.width(); - - if (m_style == HorizontalStyle) - { - for (int row = 0; row < rowCount; ++row) - { - m_geometry.insert(row, QRect(QPoint(x, y), m_itemSize)); - x += nItemWidth; - } - - horizontalScrollBar()->setPageStep(viewport()->width()); - horizontalScrollBar()->setRange(0, x - viewport()->width()); - } - else - { - const int nTextHeight = fontMetrics().height(); - const int nItemHeight = m_itemSize.height() + m_borderSize.height() + nTextHeight; - - int nNumOfHorzItems = nPageHorz / nItemWidth; - if (nNumOfHorzItems <= 0) - { - nNumOfHorzItems = 1; - } - - for (int row = 0; row < rowCount; ++row) - { - m_geometry.insert(row, QRect(QPoint(x, y), m_itemSize)); - - if ((row + 1) % nNumOfHorzItems == 0) - { - y += nItemHeight; - x = m_borderSize.width(); - } - else - { - x += nItemWidth; - } - } - - verticalScrollBar()->setPageStep(viewport()->height()); - verticalScrollBar()->setRange(0, (y + nItemHeight) - viewport()->height()); - } -} - -////////////////////////////////////////////////////////////////////////// -QModelIndex CImageListCtrl::indexAt(const QPoint& point) const -{ - if (!model()) - { - return QModelIndex(); - } - - const QPoint p = point + - QPoint(horizontalOffset(), verticalOffset()); - - QHash::const_iterator i; - QHash::const_iterator c = m_geometry.cend(); - for (i = m_geometry.cbegin(); i != c; ++i) - { - if (i.value().contains(p)) - { - return model()->index(i.key(), 0, rootIndex()); - } - } - - return QModelIndex(); -} - -////////////////////////////////////////////////////////////////////////// -void CImageListCtrl::scrollTo(const QModelIndex& index, ScrollHint hint) -{ - if (!index.isValid()) - { - return; - } - - QRect rect = m_geometry.value(index.row()); - - switch (hint) - { - case EnsureVisible: - if (horizontalOffset() > rect.right()) - { - horizontalScrollBar()->setValue(rect.left()); - } - else if ((horizontalOffset() + viewport()->width()) < rect.left()) - { - horizontalScrollBar()->setValue(rect.right() - viewport()->width()); - } - - if (verticalOffset() > rect.bottom()) - { - verticalScrollBar()->setValue(rect.top()); - } - else if ((verticalOffset() + viewport()->height()) < rect.top()) - { - verticalScrollBar()->setValue(rect.bottom() - viewport()->height()); - } - break; - - case PositionAtTop: - horizontalScrollBar()->setValue(rect.left()); - verticalScrollBar()->setValue(rect.top()); - break; - - case PositionAtBottom: - horizontalScrollBar()->setValue(rect.right() - viewport()->width()); - verticalScrollBar()->setValue(rect.bottom() - viewport()->height()); - break; - - case PositionAtCenter: - horizontalScrollBar()->setValue(rect.center().x() - (viewport()->width() / 2)); - verticalScrollBar()->setValue(rect.center().y() - (viewport()->height() / 2)); - break; - } -} - -////////////////////////////////////////////////////////////////////////// -QRect CImageListCtrl::visualRect(const QModelIndex& index) const -{ - if (!index.isValid()) - { - return QRect(); - } - - - if (!m_geometry.contains(index.row())) - { - return QRect(); - } - - return m_geometry.value(index.row()) - .translated(-horizontalOffset(), -verticalOffset()); -} - -////////////////////////////////////////////////////////////////////////// -QRect CImageListCtrl::ItemGeometry(const QModelIndex& index) const -{ - Q_ASSERT(index.model() == model()); - Q_ASSERT(m_geometry.contains(index.row())); - - return m_geometry.value(index.row()); -} - -void CImageListCtrl::SetItemGeometry(const QModelIndex& index, const QRect& rect) -{ - Q_ASSERT(index.model() == model()); - m_geometry.insert(index.row(), rect); - update(rect); -} - -void CImageListCtrl::ClearItemGeometries() -{ - m_geometry.clear(); -} - -////////////////////////////////////////////////////////////////////////// -int CImageListCtrl::horizontalOffset() const -{ - return horizontalScrollBar()->value(); -} - -////////////////////////////////////////////////////////////////////////// -int CImageListCtrl::verticalOffset() const -{ - return verticalScrollBar()->value(); -} - -////////////////////////////////////////////////////////////////////////// -bool CImageListCtrl::isIndexHidden([[maybe_unused]] const QModelIndex& index) const -{ - return false; /* not supported */ -} - -////////////////////////////////////////////////////////////////////////// -QModelIndex CImageListCtrl::moveCursor(CursorAction cursorAction, [[maybe_unused]] Qt::KeyboardModifiers modifiers) -{ - if (!model()) - { - return QModelIndex(); - } - - const int rowCount = model()->rowCount(); - - if (0 == rowCount) - { - return QModelIndex(); - } - - switch (cursorAction) - { - case MoveHome: - return model()->index(0, 0, rootIndex()); - - case MoveEnd: - return model()->index(rowCount - 1, 0, rootIndex()); - - case MovePrevious: - { - QModelIndex current = currentIndex(); - if (current.isValid()) - { - return model()->index((current.row() - 1) % rowCount, 0, rootIndex()); - } - } break; - - case MoveNext: - { - QModelIndex current = currentIndex(); - if (current.isValid()) - { - return model()->index((current.row() + 1) % rowCount, 0, rootIndex()); - } - } break; - - case MoveUp: - case MoveDown: - case MoveLeft: - case MoveRight: - case MovePageUp: - case MovePageDown: - /* TODO */ - break; - } - return QModelIndex(); -} - -////////////////////////////////////////////////////////////////////////// -void CImageListCtrl::setSelection(const QRect& rect, QItemSelectionModel::SelectionFlags flags) -{ - if (!model()) - { - return; - } - - const QRect lrect = - rect.translated(horizontalOffset(), verticalOffset()); - - QHash::const_iterator i; - QHash::const_iterator c = m_geometry.cend(); - for (i = m_geometry.cbegin(); i != c; ++i) - { - if (i.value().intersects(lrect)) - { - selectionModel()->select(model()->index(i.key(), 0, rootIndex()), flags); - } - } -} - -////////////////////////////////////////////////////////////////////////// -QRegion CImageListCtrl::visualRegionForSelection(const QItemSelection& selection) const -{ - QRegion region; - - foreach(const QModelIndex &index, selection.indexes()) - { - region += visualRect(index); - } - - return region; -} - -////////////////////////////////////////////////////////////////////////// -QImageListDelegate::QImageListDelegate(QObject* parent) - : QAbstractItemDelegate(parent) -{ -} - -////////////////////////////////////////////////////////////////////////// -void QImageListDelegate::paint(QPainter* painter, - const QStyleOptionViewItem& option, const QModelIndex& index) const -{ - painter->save(); - - painter->setFont(option.font); - - if (option.rect.isValid()) - { - painter->setClipRect(option.rect); - } - - QRect innerRect = option.rect.adjusted(1, 1, -1, -1); - - QRect textRect(innerRect.left(), innerRect.bottom() - option.fontMetrics.height(), - innerRect.width(), option.fontMetrics.height() + 1); - - /* fill item background */ - - painter->fillRect(option.rect, option.palette.color(QPalette::Base)); - - /* draw image */ - - if (index.data(Qt::DecorationRole).isValid()) - { - const QPixmap& p = index.data(Qt::DecorationRole).value(); - if (p.isNull() || p.size() == QSize(1, 1)) - { - emit InvalidPixmapGenerated(index); - } - else - { - painter->drawPixmap(innerRect, p); - } - } - - /* draw text */ - - const QColor trColor = option.palette.color(QPalette::Shadow); - painter->fillRect(textRect, (option.state & QStyle::State_Selected) ? - trColor.lighter() : trColor); - - if (option.state & QStyle::State_Selected) - { - painter->setPen(QPen(option.palette.color(QPalette::HighlightedText))); - - QFont f = painter->font(); - f.setBold(true); - painter->setFont(f); - } - else - { - painter->setPen(QPen(option.palette.color(QPalette::Text))); - } - - painter->drawText(textRect, index.data(Qt::DisplayRole).toString(), - QTextOption(option.decorationAlignment)); - - painter->setPen(QPen(option.palette.color(QPalette::Shadow))); - painter->drawRect(textRect); - - /* draw border */ - - if (option.state & QStyle::State_Selected) - { - QPen pen(option.palette.color(QPalette::Highlight)); - pen.setWidth(2); - painter->setPen(pen); - painter->drawRect(innerRect); - } - else - { - painter->setPen(QPen(option.palette.color(QPalette::Shadow))); - painter->drawRect(option.rect); - } - - if (option.state & QStyle::State_HasFocus) - { - QPen pen(Qt::DotLine); - pen.setColor(option.palette.color(QPalette::AlternateBase)); - painter->setPen(pen); - painter->drawRect(option.rect); - } - - painter->restore(); -} - -////////////////////////////////////////////////////////////////////////// -QSize QImageListDelegate::sizeHint(const QStyleOptionViewItem& option, - [[maybe_unused]] const QModelIndex& index) const -{ - return option.rect.size(); -} - -////////////////////////////////////////////////////////////////////////// -QVector QImageListDelegate::paintingRoles() const -{ - return QVector() << Qt::DecorationRole << Qt::DisplayRole; -} - -#include diff --git a/Code/Editor/Controls/ImageListCtrl.h b/Code/Editor/Controls/ImageListCtrl.h deleted file mode 100644 index db393c8497..0000000000 --- a/Code/Editor/Controls/ImageListCtrl.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_CONTROLS_IMAGELISTCTRL_H -#define CRYINCLUDE_EDITOR_CONTROLS_IMAGELISTCTRL_H -#pragma once - -#if !defined(Q_MOC_RUN) -#include - -#include -#endif - -////////////////////////////////////////////////////////////////////////// -// Custom control to display list of images. -////////////////////////////////////////////////////////////////////////// -class CImageListCtrl - : public QAbstractItemView -{ - Q_OBJECT -public: - enum ListStyle - { - DefaultStyle, - HorizontalStyle - }; - -public: - CImageListCtrl(QWidget* parent = nullptr); - ~CImageListCtrl(); - - ListStyle Style() const; - void SetStyle(ListStyle style); - - const QSize& ItemSize() const; - void SetItemSize(QSize size); - - const QSize& BorderSize() const; - void SetBorderSize(QSize size); - - // Get all items inside specified rectangle. - QModelIndexList ItemsInRect(const QRect& rect) const; - - QModelIndex indexAt(const QPoint& point) const override; - void scrollTo(const QModelIndex& index, ScrollHint hint = EnsureVisible) override; - QRect visualRect(const QModelIndex& index) const override; - -protected: - QRect ItemGeometry(const QModelIndex& index) const; - void SetItemGeometry(const QModelIndex& index, const QRect& rect); - void ClearItemGeometries(); - - int horizontalOffset() const override; - int verticalOffset() const override; - bool isIndexHidden(const QModelIndex& index) const override; - QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) override; - void setSelection(const QRect& rect, QItemSelectionModel::SelectionFlags flags) override; - QRegion visualRegionForSelection(const QItemSelection& selection) const override; - - void paintEvent(QPaintEvent* event) override; - void rowsInserted(const QModelIndex& parent, int start, int end) override; - - void updateGeometries() override; - -private: - QHash m_geometry; - QSize m_itemSize; - QSize m_borderSize; - ListStyle m_style; -}; - -class QImageListDelegate - : public QAbstractItemDelegate -{ - Q_OBJECT -signals: - void InvalidPixmapGenerated(const QModelIndex& index) const; -public: - QImageListDelegate(QObject* parent = nullptr); - - void paint(QPainter* painter, - const QStyleOptionViewItem& option, - const QModelIndex& index) const override; - - QSize sizeHint(const QStyleOptionViewItem& option, - const QModelIndex& index) const override; - - QVector paintingRoles() const override; -}; - -#endif // CRYINCLUDE_EDITOR_CONTROLS_IMAGELISTCTRL_H diff --git a/Code/Editor/Controls/MultiMonHelper.cpp b/Code/Editor/Controls/MultiMonHelper.cpp deleted file mode 100644 index 5b3ed3a204..0000000000 --- a/Code/Editor/Controls/MultiMonHelper.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include "EditorDefs.h" - -#include "MultiMonHelper.h" - -// Qt -#include - -//////////////////////////////////////////////////////////////////////////// -void ClipOrCenterRectToMonitor(QRect *prc, const UINT flags) -{ - const QScreen* currentScreen = nullptr; - QRect rc; - - Q_ASSERT(prc); - - const auto screens = qApp->screens(); - for (auto screen : screens) - { - if (screen->geometry().contains(prc->center())) - { - currentScreen = screen; - break; - } - } - - if (!currentScreen) - { - return; - } - - const int w = prc->width(); - const int h = prc->height(); - - if (flags & MONITOR_WORKAREA) - { - rc = currentScreen->availableGeometry(); - } - else - { - rc = currentScreen->geometry(); - } - - // center or clip the passed rect to the monitor rect - if (flags & MONITOR_CENTER) - { - prc->setLeft(rc.left() + (rc.right() - rc.left() - w) / 2); - prc->setTop(rc.top() + (rc.bottom() - rc.top() - h) / 2); - prc->setRight(prc->left() + w); - prc->setBottom(prc->top() + h); - } - else - { - prc->setLeft(qMax(rc.left(), qMin(rc.right() - w, prc->left()))); - prc->setTop(qMax(rc.top(), qMin(rc.bottom() - h, prc->top()))); - prc->setRight(prc->left() + w); - prc->setBottom(prc->top() + h); - } -} diff --git a/Code/Editor/Controls/MultiMonHelper.h b/Code/Editor/Controls/MultiMonHelper.h deleted file mode 100644 index 54e47bf022..0000000000 --- a/Code/Editor/Controls/MultiMonHelper.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_CONTROLS_MULTIMONHELPER_H -#define CRYINCLUDE_EDITOR_CONTROLS_MULTIMONHELPER_H -#pragma once - -// Taken from: http://msdn.microsoft.com/en-us/library/dd162826(v=vs.85).aspx -#define MONITOR_CENTER 0x0001 // center rect to monitor -#define MONITOR_CLIP 0x0000 // clip rect to monitor -#define MONITOR_WORKAREA 0x0002 // use monitor work area -#define MONITOR_AREA 0x0000 // use monitor entire area - -// -// ClipOrCenterRectToMonitor -// -// The most common problem apps have when running on a -// multimonitor system is that they "clip" or "pin" windows -// based on the SM_CXSCREEN and SM_CYSCREEN system metrics. -// Because of app compatibility reasons these system metrics -// return the size of the primary monitor. -// -// This shows how you use the multi-monitor functions -// to do the same thing. -// -// params: -// prc : pointer to QRect to modify -// flags : some combination of the MONITOR_* flags above -// -// example: -// -// ClipOrCenterRectToMonitor(&aRect, MONITOR_CLIP | MONITOR_WORKAREA); -// -// Takes parameter pointer to RECT "aRect" and flags MONITOR_CLIP | MONITOR_WORKAREA -// This will modify aRect without resizing it so that it remains within the on-screen boundaries. -void ClipOrCenterRectToMonitor(QRect *prc, const UINT flags); - -#endif // CRYINCLUDE_EDITOR_CONTROLS_MULTIMONHELPER_H diff --git a/Code/Editor/Controls/NumberCtrl.cpp b/Code/Editor/Controls/NumberCtrl.cpp deleted file mode 100644 index 473dd7e4af..0000000000 --- a/Code/Editor/Controls/NumberCtrl.cpp +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include "EditorDefs.h" - -#include "NumberCtrl.h" - - -QNumberCtrl::QNumberCtrl(QWidget* parent) - : QDoubleSpinBox(parent) - , m_bMouseDown(false) - , m_bDragged(false) - , m_bUndoEnabled(false) - , m_prevValue(0) -{ - connect(this, &QAbstractSpinBox::editingFinished, this, &QNumberCtrl::onEditingFinished); -} - -void QNumberCtrl::changeEvent(QEvent* event) -{ - if (event->type() == QEvent::EnabledChange) - { - setButtonSymbols(isEnabled() ? UpDownArrows : NoButtons); - } - - QDoubleSpinBox::changeEvent(event); -} - - -void QNumberCtrl::SetRange(double newMin, double newMax) -{ - // Avoid setting this value if its close to the current value, because otherwise qt will pump events into the queue to redraw/etc. - if ( (!AZ::IsClose(this->minimum(), newMin, DBL_EPSILON)) || (!AZ::IsClose(this->maximum(), newMax, DBL_EPSILON)) ) - { - setRange(newMin, newMax); - } -} - - -void QNumberCtrl::mousePressEvent(QMouseEvent* event) -{ - if (event->button() == Qt::LeftButton) - { - emit mousePressed(); - - m_bMouseDown = true; - m_bDragged = false; - m_mousePos = event->pos(); - - if (m_bUndoEnabled && !CUndo::IsRecording()) - { - GetIEditor()->BeginUndo(); - } - - emit dragStarted(); - - grabMouse(); - } - - QDoubleSpinBox::mousePressEvent(event); -} - -void QNumberCtrl::mouseReleaseEvent(QMouseEvent* event) -{ - QDoubleSpinBox::mouseReleaseEvent(event); - - if (event->button() == Qt::LeftButton) - { - m_bMouseDown = m_bDragged = false; - - emit valueUpdated(); - emit valueChanged(); - - if (m_bUndoEnabled && CUndo::IsRecording()) - { - GetIEditor()->AcceptUndo(m_undoText); - } - - emit dragFinished(); - - releaseMouse(); - - m_prevValue = value(); - - emit mouseReleased(); - } -} - -void QNumberCtrl::mouseMoveEvent(QMouseEvent* event) -{ - QDoubleSpinBox::mousePressEvent(event); - - if (m_bMouseDown) - { - m_bDragged = true; - - int dy = event->pos().y() - m_mousePos.y(); - setValue(value() - singleStep() * dy); - - emit valueUpdated(); - - m_mousePos = event->pos(); - } -} - -void QNumberCtrl::EnableUndo(const QString& undoText) -{ - m_undoText = undoText; - m_bUndoEnabled = true; -} - -void QNumberCtrl::focusInEvent(QFocusEvent* event) -{ - m_prevValue = value(); - QDoubleSpinBox::focusInEvent(event); -} - -void QNumberCtrl::onEditingFinished() -{ - bool undo = m_bUndoEnabled && !CUndo::IsRecording() && m_prevValue != value(); - if (undo) - { - GetIEditor()->BeginUndo(); - } - - emit valueUpdated(); - emit valueChanged(); - - if (undo) - { - GetIEditor()->AcceptUndo(m_undoText); - } - - m_prevValue = value(); -} - -#include diff --git a/Code/Editor/Controls/NumberCtrl.h b/Code/Editor/Controls/NumberCtrl.h deleted file mode 100644 index 22ee7b867f..0000000000 --- a/Code/Editor/Controls/NumberCtrl.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_CONTROLS_NUMBERCTRL_H -#define CRYINCLUDE_EDITOR_CONTROLS_NUMBERCTRL_H -#pragma once - -// NumberCtrl.h : header file -// - -#if !defined(Q_MOC_RUN) -#include -#endif - -class QNumberCtrl - : public QDoubleSpinBox -{ - Q_OBJECT - -public: - QNumberCtrl(QWidget* parent = nullptr); - - bool IsDragging() const { return m_bDragged; } - - //! If called will enable undo with given text when control is modified. - void EnableUndo(const QString& undoText); - void SetRange(double newMin, double maxRange); - -Q_SIGNALS: - void dragStarted(); - void dragFinished(); - - void valueUpdated(); - void valueChanged(); - - void mouseReleased(); - void mousePressed(); - -protected: - void changeEvent(QEvent* event) override; - void focusInEvent(QFocusEvent* event) override; - void mousePressEvent(QMouseEvent* event) override; - void mouseMoveEvent(QMouseEvent* event) override; - void mouseReleaseEvent(QMouseEvent* event) override; - -private: - void onEditingFinished(); - void onValueChanged(double d); - - bool m_bMouseDown; - bool m_bDragged; - QPoint m_mousePos; - bool m_bUndoEnabled; - double m_prevValue; - QString m_undoText; -}; - -#endif // CRYINCLUDE_EDITOR_CONTROLS_NUMBERCTRL_H diff --git a/Code/Editor/Controls/TextEditorCtrl.cpp b/Code/Editor/Controls/TextEditorCtrl.cpp deleted file mode 100644 index c372138d80..0000000000 --- a/Code/Editor/Controls/TextEditorCtrl.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include "EditorDefs.h" - -#include "TextEditorCtrl.h" - - -// CTextEditorCtrl -CTextEditorCtrl::CTextEditorCtrl(QWidget* pParent) - : QTextEdit(pParent) -{ - m_bModified = true; - - QFont font; - font.setFamily("Courier New"); - font.setFixedPitch(true); - font.setPointSize(10); - setFont(font); - - setLineWrapMode(NoWrap); - - connect(this, &QTextEdit::textChanged, this, &CTextEditorCtrl::OnChange); -} - -CTextEditorCtrl::~CTextEditorCtrl() -{ -} - - -// CTextEditorCtrl message handlers - -void CTextEditorCtrl::LoadFile(const QString& sFileName) -{ - if (m_filename == sFileName) - { - return; - } - - m_filename = sFileName; - - clear(); - - CCryFile file(sFileName.toUtf8().data(), "rb"); - if (file.Open(sFileName.toUtf8().data(), "rb")) - { - size_t length = file.GetLength(); - - QByteArray text; - text.resize(static_cast(length)); - file.ReadRaw(text.data(), length); - - setPlainText(text); - } - - m_bModified = false; -} - -////////////////////////////////////////////////////////////////////////// -void CTextEditorCtrl::SaveFile(const QString& sFileName) -{ - if (sFileName.isEmpty()) - { - return; - } - - if (!CFileUtil::OverwriteFile(sFileName.toUtf8().data())) - { - return; - } - - QFile file(sFileName); - file.open(QFile::WriteOnly); - - file.write(toPlainText().toUtf8()); - - m_bModified = false; -} - -////////////////////////////////////////////////////////////////////////// -void CTextEditorCtrl::OnChange() -{ - - m_bModified = true; -} - -#include diff --git a/Code/Editor/Controls/TextEditorCtrl.h b/Code/Editor/Controls/TextEditorCtrl.h deleted file mode 100644 index e155185f90..0000000000 --- a/Code/Editor/Controls/TextEditorCtrl.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_CONTROLS_TEXTEDITORCTRL_H -#define CRYINCLUDE_EDITOR_CONTROLS_TEXTEDITORCTRL_H -#pragma once - -// CTextEditorCtrl -#if !defined(Q_MOC_RUN) -#include -#endif - -class CTextEditorCtrl - : public QTextEdit -{ - Q_OBJECT - -public: - CTextEditorCtrl(QWidget* pParent = nullptr); - virtual ~CTextEditorCtrl(); - - void LoadFile(const QString& sFileName); - void SaveFile(const QString& sFileName); - QString GetFilename() const { return m_filename; } - - bool IsModified() const { return m_bModified; } - - //! Must be called after OnChange message. - void OnChange(); - -protected: - QString m_filename; - bool m_bModified; -}; - -#endif // CRYINCLUDE_EDITOR_CONTROLS_TEXTEDITORCTRL_H diff --git a/Code/Editor/Controls/TreeCtrlUtils.h b/Code/Editor/Controls/TreeCtrlUtils.h deleted file mode 100644 index 7498360d2e..0000000000 --- a/Code/Editor/Controls/TreeCtrlUtils.h +++ /dev/null @@ -1,322 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_CONTROLS_TREECTRLUTILS_H -#define CRYINCLUDE_EDITOR_CONTROLS_TREECTRLUTILS_H -#pragma once - -#include - -namespace TreeCtrlUtils -{ - template - class TreeItemIterator - : public P - { - public: - typedef P Traits; - - //iterator traits, required by STL - typedef ptrdiff_t difference_type; - typedef HTREEITEM value_type; - typedef HTREEITEM* pointer; - typedef HTREEITEM& reference; - typedef std::forward_iterator_tag iterator_category; - - TreeItemIterator() - : pCtrl(0) - , hItem(0) {} - explicit TreeItemIterator(const P& traits) - : P(traits) - , pCtrl(0) - , hItem(0) {} - TreeItemIterator(const TreeItemIterator& other) - : P(other) - , pCtrl(other.pCtrl) - , hItem(other.hItem) {} - TreeItemIterator(CTreeCtrl* pCtrl, HTREEITEM hItem) - : pCtrl(pCtrl) - , hItem(hItem) {} - TreeItemIterator(CTreeCtrl* pCtrl, HTREEITEM hItem, const P& traits) - : P(traits) - , pCtrl(pCtrl) - , hItem(hItem) {} - - HTREEITEM operator*() {return hItem; } - bool operator==(const TreeItemIterator& other) const {return pCtrl == other.pCtrl && hItem == other.hItem; } - bool operator!=(const TreeItemIterator& other) const {return pCtrl != other.pCtrl || hItem != other.hItem; } - - TreeItemIterator& operator++() - { - HTREEITEM hNextItem = 0; - if (RecurseToChildren(hItem)) - { - hNextItem = (pCtrl ? pCtrl->GetChildItem(hItem) : 0); - } - while (pCtrl && hItem && !hNextItem) - { - hNextItem = pCtrl->GetNextSiblingItem(hItem); - if (!hNextItem) - { - hItem = pCtrl->GetParentItem(hItem); - } - } - hItem = hNextItem; - - return *this; - } - - TreeItemIterator operator++(int) {TreeItemIterator old = *this; ++(*this); return old; } - - CTreeCtrl* pCtrl; - HTREEITEM hItem; - }; - - class NonRecursiveTreeItemIteratorTraits - { - public: - bool RecurseToChildren(HTREEITEM hItem) {return false; } - }; - typedef TreeItemIterator NonRecursiveTreeItemIterator; - - class RecursiveTreeItemIteratorTraits - { - public: - bool RecurseToChildren(HTREEITEM hItem) {return true; } - }; - typedef TreeItemIterator RecursiveTreeItemIterator; - - inline RecursiveTreeItemIterator BeginTreeItemsRecursive(CTreeCtrl* pCtrl, HTREEITEM hItem = 0) - { - if (hItem == 0) - { - hItem = (pCtrl ? pCtrl->GetRootItem() : 0); - } - return RecursiveTreeItemIterator(pCtrl, hItem); - } - - inline RecursiveTreeItemIterator EndTreeItemsRecursive(CTreeCtrl* pCtrl, HTREEITEM hItem = 0) - { - HTREEITEM hEndItem = 0; - HTREEITEM hParent = hItem; - do - { - if (hParent) - { - hEndItem = pCtrl->GetNextSiblingItem(hParent); - } - hParent = (pCtrl && hParent ? pCtrl->GetParentItem(hParent) : 0); - } - while (hParent && !hEndItem); - return RecursiveTreeItemIterator(pCtrl, hEndItem); - } - - inline NonRecursiveTreeItemIterator BeginTreeItemsNonRecursive(CTreeCtrl* pCtrl, HTREEITEM hItem = 0) - { - if (hItem == 0) - { - hItem = (pCtrl ? pCtrl->GetRootItem() : 0); - } - if (hItem) - { - hItem = pCtrl->GetChildItem(hItem); - } - return NonRecursiveTreeItemIterator(pCtrl, hItem); - } - - inline NonRecursiveTreeItemIterator EndTreeItemsNonRecursive(CTreeCtrl* pCtrl, HTREEITEM hItem = 0) - { - HTREEITEM hEndItem = 0; - HTREEITEM hParent = 0; - while (hParent && !hEndItem) - { - hParent = (pCtrl && hItem ? pCtrl->GetParentItem(hItem) : 0); - if (hParent) - { - hEndItem = pCtrl->GetNextSiblingItem(hParent); - } - } - return NonRecursiveTreeItemIterator(pCtrl, hEndItem); - } - - template - class TreeItemDataIterator - { - public: - typedef T Type; - typedef TreeItemIterator

InternalIterator; - - //iterator traits, required by STL - typedef ptrdiff_t difference_type; - typedef Type* value_type; - typedef Type** pointer; - typedef Type*& reference; - typedef std::forward_iterator_tag iterator_category; - - TreeItemDataIterator() {} - TreeItemDataIterator(const TreeItemDataIterator& other) - : iterator(other.iterator) {AdvanceToValidIterator(); } - explicit TreeItemDataIterator(const InternalIterator& iterator) - : iterator(iterator) {AdvanceToValidIterator(); } - - Type* operator*() {return reinterpret_cast(iterator.pCtrl->GetItemData(iterator.hItem)); } - bool operator==(const TreeItemDataIterator& other) const {return iterator == other.iterator; } - bool operator!=(const TreeItemDataIterator& other) const {return iterator != other.iterator; } - - HTREEITEM GetTreeItem() {return iterator.hItem; } - - TreeItemDataIterator& operator++() - { - ++iterator; - AdvanceToValidIterator(); - return *this; - } - - TreeItemDataIterator operator++(int) {TreeItemDataIterator old = *this; ++(*this); return old; } - - private: - void AdvanceToValidIterator() - { - while (iterator.pCtrl && iterator.hItem && !iterator.pCtrl->GetItemData(iterator.hItem)) - { - ++iterator; - } - } - - InternalIterator iterator; - }; - - template - class RecursiveItemDataIteratorType - { - public: typedef TreeItemDataIterator type; - }; - template - inline TreeItemDataIterator BeginTreeItemDataRecursive(CTreeCtrl* pCtrl, HTREEITEM hItem = 0) - { - return TreeItemDataIterator(BeginTreeItemsRecursive(pCtrl, hItem)); - } - - template - inline TreeItemDataIterator EndTreeItemDataRecursive(CTreeCtrl* pCtrl, HTREEITEM hItem = 0) - { - return TreeItemDataIterator(EndTreeItemsRecursive(pCtrl, hItem)); - } - - template - class NonRecursiveItemDataIteratorType - { - typedef TreeItemDataIterator type; - }; - template - inline TreeItemDataIterator BeginTreeItemDataNonRecursive(CTreeCtrl* pCtrl, HTREEITEM hItem = 0) - { - return TreeItemDataIterator(BeginTreeItemsNonRecursive(pCtrl, hItem)); - } - - template - inline TreeItemDataIterator EndTreeItemDataNonRecursive(CTreeCtrl* pCtrl, HTREEITEM hItem = 0) - { - return TreeItemDataIterator(EndTreeItemsNonRecursive(pCtrl, hItem)); - } - - class SelectedTreeItemIterator - { - public: - SelectedTreeItemIterator() - : pCtrl(0) - , hItem(0) {} - SelectedTreeItemIterator(const SelectedTreeItemIterator& other) - : pCtrl(other.pCtrl) - , hItem(other.hItem) {} - SelectedTreeItemIterator(CXTTreeCtrl* pCtrl, HTREEITEM hItem) - : pCtrl(pCtrl) - , hItem(hItem) {} - - HTREEITEM operator*() {return hItem; } - bool operator==(const SelectedTreeItemIterator& other) const {return pCtrl == other.pCtrl && hItem == other.hItem; } - bool operator!=(const SelectedTreeItemIterator& other) const {return pCtrl != other.pCtrl || hItem != other.hItem; } - - SelectedTreeItemIterator& operator++() - { - hItem = (pCtrl ? pCtrl->GetNextSelectedItem(hItem) : 0); - - return *this; - } - - SelectedTreeItemIterator operator++(int) {SelectedTreeItemIterator old = *this; ++(*this); return old; } - - CXTTreeCtrl* pCtrl; - HTREEITEM hItem; - }; - - SelectedTreeItemIterator BeginSelectedTreeItems(CXTTreeCtrl* pCtrl) - { - return SelectedTreeItemIterator(pCtrl, (pCtrl ? pCtrl->GetFirstSelectedItem() : 0)); - } - - SelectedTreeItemIterator EndSelectedTreeItems(CXTTreeCtrl* pCtrl) - { - return SelectedTreeItemIterator(pCtrl, 0); - } - - template - class SelectedTreeItemDataIterator - { - public: - typedef T Type; - typedef SelectedTreeItemIterator InternalIterator; - - SelectedTreeItemDataIterator() {} - SelectedTreeItemDataIterator(const SelectedTreeItemDataIterator& other) - : iterator(other.iterator) {AdvanceToValidIterator(); } - explicit SelectedTreeItemDataIterator(const InternalIterator& iterator) - : iterator(iterator) {AdvanceToValidIterator(); } - - Type* operator*() {return reinterpret_cast(iterator.pCtrl->GetItemData(iterator.hItem)); } - bool operator==(const SelectedTreeItemDataIterator& other) const {return iterator == other.iterator; } - bool operator!=(const SelectedTreeItemDataIterator& other) const {return iterator != other.iterator; } - - HTREEITEM GetTreeItem() {return iterator.hItem; } - - SelectedTreeItemDataIterator& operator++() - { - ++iterator; - AdvanceToValidIterator(); - return *this; - } - - SelectedTreeItemDataIterator operator++(int) {SelectedTreeItemDataIterator old = *this; ++(*this); return old; } - - private: - void AdvanceToValidIterator() - { - while (iterator.pCtrl && iterator.hItem && !iterator.pCtrl->GetItemData(iterator.hItem)) - { - ++iterator; - } - } - - InternalIterator iterator; - }; - - template - SelectedTreeItemDataIterator BeginSelectedTreeItemData(CXTTreeCtrl* pCtrl) - { - return SelectedTreeItemDataIterator(BeginSelectedTreeItems(pCtrl)); - } - - template - SelectedTreeItemDataIterator EndSelectedTreeItemData(CXTTreeCtrl* pCtrl) - { - return SelectedTreeItemDataIterator(EndSelectedTreeItems(pCtrl)); - } -} - -#endif // CRYINCLUDE_EDITOR_CONTROLS_TREECTRLUTILS_H diff --git a/Code/Editor/EditorPanelUtils.cpp b/Code/Editor/EditorPanelUtils.cpp deleted file mode 100644 index 1a3c9bcb4a..0000000000 --- a/Code/Editor/EditorPanelUtils.cpp +++ /dev/null @@ -1,542 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - - -#include "EditorDefs.h" - -#include "EditorPanelUtils.h" - -#include - -// Qt -#include -#include -#include - -// Editor -#include "IEditorPanelUtils.h" -#include "Objects/EntityObject.h" -#include "CryEditDoc.h" -#include "ViewManager.h" -#include "Controls/QToolTipWidget.h" -#include "Objects/SelectionGroup.h" - - - -#ifndef PI -#define PI 3.14159265358979323f -#endif - - -struct ToolTip -{ - bool isValid; - QString title; - QString content; - QString specialContent; - QString disabledContent; -}; - -// internal implementation for better compile times - should also never be used externally, use IParticleEditorUtils interface for that. -class CEditorPanelUtils_Impl - : public IEditorPanelUtils -{ -public: - void SetViewportDragOperation(void(* dropCallback)(CViewport* viewport, int dragPointX, int dragPointY, void* custom), void* custom) override - { - for (int i = 0; i < GetIEditor()->GetViewManager()->GetViewCount(); i++) - { - GetIEditor()->GetViewManager()->GetView(i)->SetGlobalDropCallback(dropCallback, custom); - } - } - -public: - - int PreviewWindow_GetDisplaySettingsDebugFlags(CDisplaySettings* settings) override - { - CRY_ASSERT(settings); - return settings->GetDebugFlags(); - } - - void PreviewWindow_SetDisplaySettingsDebugFlags(CDisplaySettings* settings, int flags) override - { - CRY_ASSERT(settings); - settings->SetDebugFlags(flags); - } - -protected: - QVector hotkeys; - bool m_hotkeysAreEnabled; -public: - - bool HotKey_Import() override - { - QVector > keys; - QString filepath = QFileDialog::getOpenFileName(nullptr, "Select shortcut configuration to load", - QString(), "HotKey Config Files (*.hkxml)"); - QFile file(filepath); - if (!file.open(QIODevice::ReadOnly)) - { - return false; - } - QXmlStreamReader stream(&file); - bool result = true; - - while (!stream.isEndDocument()) - { - if (stream.isStartElement()) - { - if (stream.name() == "HotKey") - { - QPair key; - QXmlStreamAttributes att = stream.attributes(); - for (QXmlStreamAttribute attr : att) - { - if (attr.name().compare(QLatin1String("path"), Qt::CaseInsensitive) == 0) - { - key.first = attr.value().toString(); - } - if (attr.name().compare(QLatin1String("sequence"), Qt::CaseInsensitive) == 0) - { - key.second = attr.value().toString(); - } - } - if (!key.first.isEmpty()) - { - keys.push_back(key); // we allow blank key sequences for unassigned shortcuts - } - else - { - result = false; //but not blank paths! - } - } - } - stream.readNext(); - } - file.close(); - - if (result) - { - HotKey_BuildDefaults(); - for (QPair key : keys) - { - for (int j = 0; j < hotkeys.count(); j++) - { - if (hotkeys[j].path.compare(key.first, Qt::CaseInsensitive) == 0) - { - hotkeys[j].SetPath(key.first.toStdString().c_str()); - hotkeys[j].SetSequenceFromString(key.second.toStdString().c_str()); - } - } - } - } - return result; - } - - void HotKey_Export() override - { - auto settingDir = AZ::IO::FixedMaxPath(AZ::Utils::GetEnginePath()) / "Editor" / "Plugins" / "ParticleEditorPlugin" / "settings"; - QString filepath = QFileDialog::getSaveFileName(nullptr, "Select shortcut configuration to load", settingDir.c_str(), "HotKey Config Files (*.hkxml)"); - QFile file(filepath); - if (!file.open(QIODevice::WriteOnly)) - { - return; - } - - QXmlStreamWriter stream(&file); - stream.setAutoFormatting(true); - stream.writeStartDocument(); - stream.writeStartElement("HotKeys"); - - for (HotKey key : hotkeys) - { - stream.writeStartElement("HotKey"); - stream.writeAttribute("path", key.path); - stream.writeAttribute("sequence", key.sequence.toString()); - stream.writeEndElement(); - } - stream.writeEndElement(); - stream.writeEndDocument(); - file.close(); - } - - QKeySequence HotKey_GetShortcut(const char* path) override - { - for (HotKey combo : hotkeys) - { - if (combo.IsMatch(path)) - { - return combo.sequence; - } - } - return QKeySequence(); - } - - bool HotKey_IsPressed(const QKeyEvent* event, const char* path) override - { - if (!m_hotkeysAreEnabled) - { - return false; - } - unsigned int keyInt = 0; - //Capture any modifiers - Qt::KeyboardModifiers modifiers = QApplication::keyboardModifiers(); - if (modifiers & Qt::ShiftModifier) - { - keyInt += Qt::SHIFT; - } - if (modifiers & Qt::ControlModifier) - { - keyInt += Qt::CTRL; - } - if (modifiers & Qt::AltModifier) - { - keyInt += Qt::ALT; - } - if (modifiers & Qt::MetaModifier) - { - keyInt += Qt::META; - } - //Capture any key - keyInt += event->key(); - - QString t0 = QKeySequence(keyInt).toString(); - QString t1 = HotKey_GetShortcut(path).toString(); - - //if strings match then shortcut is pressed - if (t1.compare(t0, Qt::CaseInsensitive) == 0) - { - return true; - } - return false; - } - - bool HotKey_IsPressed(const QShortcutEvent* event, const char* path) override - { - if (!m_hotkeysAreEnabled) - { - return false; - } - - QString t0 = event->key().toString(); - QString t1 = HotKey_GetShortcut(path).toString(); - - //if strings match then shortcut is pressed - if (t1.compare(t0, Qt::CaseInsensitive) == 0) - { - return true; - } - return false; - } - - bool HotKey_LoadExisting() override - { - QSettings settings("O3DE", "O3DE"); - QString group = "Hotkeys/"; - - HotKey_BuildDefaults(); - - int size = settings.beginReadArray(group); - - for (int i = 0; i < size; i++) - { - settings.setArrayIndex(i); - QPair hotkey; - hotkey.first = settings.value("name").toString(); - hotkey.second = settings.value("keySequence").toString(); - if (!hotkey.first.isEmpty()) - { - for (int j = 0; j < hotkeys.count(); j++) - { - if (hotkeys[j].path.compare(hotkey.first, Qt::CaseInsensitive) == 0) - { - hotkeys[j].SetPath(hotkey.first.toStdString().c_str()); - hotkeys[j].SetSequenceFromString(hotkey.second.toStdString().c_str()); - } - } - } - } - - settings.endArray(); - if (hotkeys.isEmpty()) - { - return false; - } - return true; - } - - void HotKey_SaveCurrent() override - { - QSettings settings("O3DE", "O3DE"); - QString group = "Hotkeys/"; - settings.remove("Hotkeys/"); - settings.sync(); - settings.beginWriteArray(group); - int saveIndex = 0; - for (HotKey key : hotkeys) - { - if (!key.path.isEmpty()) - { - settings.setArrayIndex(saveIndex++); - settings.setValue("name", key.path); - settings.setValue("keySequence", key.sequence.toString()); - } - } - settings.endArray(); - settings.sync(); - } - - void HotKey_BuildDefaults() override - { - m_hotkeysAreEnabled = true; - QVector > keys; - while (hotkeys.count() > 0) - { - hotkeys.takeAt(0); - } - - //MENU SELECTION SHORTCUTS//////////////////////////////////////////////// - keys.push_back(QPair("Menus.File Menu", "Alt+F")); - keys.push_back(QPair("Menus.Edit Menu", "Alt+E")); - keys.push_back(QPair("Menus.View Menu", "Alt+V")); - //FILE MENU SHORTCUTS///////////////////////////////////////////////////// - keys.push_back(QPair("File Menu.Create new emitter", "Ctrl+N")); - keys.push_back(QPair("File Menu.Create new library", "Ctrl+Shift+N")); - keys.push_back(QPair("File Menu.Create new folder", "")); - keys.push_back(QPair("File Menu.Import", "Ctrl+I")); - keys.push_back(QPair("File Menu.Import level library", "Ctrl+Shift+I")); - keys.push_back(QPair("File Menu.Save", "Ctrl+S")); - keys.push_back(QPair("File Menu.Close", "Ctrl+Q")); - //EDIT MENU SHORTCUTS///////////////////////////////////////////////////// - keys.push_back(QPair("Edit Menu.Copy", "Ctrl+C")); - keys.push_back(QPair("Edit Menu.Paste", "Ctrl+V")); - keys.push_back(QPair("Edit Menu.Duplicate", "Ctrl+D")); - keys.push_back(QPair("Edit Menu.Undo", "Ctrl+Z")); - keys.push_back(QPair("Edit Menu.Redo", "Ctrl+Shift+Z")); - keys.push_back(QPair("Edit Menu.Group", "Ctrl+Alt+O")); - keys.push_back(QPair("Edit Menu.Ungroup", "Ctrl+Alt+P")); - keys.push_back(QPair("Edit Menu.Rename", "Ctrl+R")); - keys.push_back(QPair("Edit Menu.Reset", "")); - keys.push_back(QPair("Edit Menu.Edit Hotkeys", "")); - keys.push_back(QPair("Edit Menu.Assign to selected", "Ctrl+Space")); - keys.push_back(QPair("Edit Menu.Insert Comment", "Ctrl+Alt+M")); - keys.push_back(QPair("Edit Menu.Enable/Disable Emitter", "Ctrl+E")); - keys.push_back(QPair("File Menu.Enable All", "")); - keys.push_back(QPair("File Menu.Disable All", "")); - keys.push_back(QPair("Edit Menu.Delete", "Del")); - //VIEW MENU SHORTCUTS///////////////////////////////////////////////////// - keys.push_back(QPair("View Menu.Reset Layout", "")); - //PLAYBACK CONTROL//////////////////////////////////////////////////////// - keys.push_back(QPair("Previewer.Play/Pause Toggle", "Space")); - keys.push_back(QPair("Previewer.Step forward through time", "c")); - keys.push_back(QPair("Previewer.Loop Toggle", "z")); - keys.push_back(QPair("Previewer.Reset Playback", "x")); - keys.push_back(QPair("Previewer.Focus", "Ctrl+F")); - keys.push_back(QPair("Previewer.Zoom In", "w")); - keys.push_back(QPair("Previewer.Zoom Out", "s")); - keys.push_back(QPair("Previewer.Pan Left", "a")); - keys.push_back(QPair("Previewer.Pan Right", "d")); - - for (QPair key : keys) - { - unsigned int index = hotkeys.count(); - hotkeys.push_back(HotKey()); - hotkeys[index].SetPath(key.first.toStdString().c_str()); - hotkeys[index].SetSequenceFromString(key.second.toStdString().c_str()); - } - } - - void HotKey_SetKeys(QVector keys) override - { - hotkeys = keys; - } - - QVector HotKey_GetKeys() override - { - return hotkeys; - } - - QString HotKey_GetPressedHotkey(const QKeyEvent* event) override - { - if (!m_hotkeysAreEnabled) - { - return ""; - } - for (HotKey key : hotkeys) - { - if (HotKey_IsPressed(event, key.path.toUtf8())) - { - return key.path; - } - } - return ""; - } - QString HotKey_GetPressedHotkey(const QShortcutEvent* event) override - { - if (!m_hotkeysAreEnabled) - { - return ""; - } - for (HotKey key : hotkeys) - { - if (HotKey_IsPressed(event, key.path.toUtf8())) - { - return key.path; - } - } - return ""; - } - //building the default hotkey list re-enables hotkeys - //do not use this when rebuilding the default list is a possibility. - void HotKey_SetEnabled(bool val) override - { - m_hotkeysAreEnabled = val; - } - - bool HotKey_IsEnabled() const override - { - return m_hotkeysAreEnabled; - } - -protected: - QMap m_tooltips; - - void ToolTip_ParseNode(XmlNodeRef node) - { - if (QString(node->getTag()).compare("tooltip", Qt::CaseInsensitive) != 0) - { - unsigned int childCount = node->getChildCount(); - - for (unsigned int i = 0; i < childCount; i++) - { - ToolTip_ParseNode(node->getChild(i)); - } - } - - QString title = node->getAttr("title"); - QString content = node->getAttr("content"); - QString specialContent = node->getAttr("special_content"); - QString disabledContent = node->getAttr("disabled_content"); - - QMap::iterator itr = m_tooltips.insert(node->getAttr("path"), ToolTip()); - itr->isValid = true; - itr->title = title; - itr->content = content; - itr->specialContent = specialContent; - itr->disabledContent = disabledContent; - - unsigned int childCount = node->getChildCount(); - - for (unsigned int i = 0; i < childCount; i++) - { - ToolTip_ParseNode(node->getChild(i)); - } - } - - ToolTip GetToolTip(QString path) - { - if (m_tooltips.contains(path)) - { - return m_tooltips[path]; - } - ToolTip temp; - temp.isValid = false; - return temp; - } - -public: - void ToolTip_LoadConfigXML(QString filepath) override - { - XmlNodeRef node = GetIEditor()->GetSystem()->LoadXmlFromFile(filepath.toStdString().c_str()); - ToolTip_ParseNode(node); - } - - void ToolTip_BuildFromConfig(IQToolTip* tooltip, QString path, QString option, QString optionalData = "", bool isEnabled = true) override - { - AZ_Assert(tooltip, "tooltip cannot be null"); - - QString title = ToolTip_GetTitle(path, option); - QString content = ToolTip_GetContent(path, option); - QString specialContent = ToolTip_GetSpecialContentType(path, option); - QString disabledContent = ToolTip_GetDisabledContent(path, option); - - // Even if these items are empty, we set them anyway to clear out any data that was left over from when the tooltip was used for a different object. - tooltip->SetTitle(title); - tooltip->SetContent(content); - - //this only handles simple creation...if you need complex call this then add specials separate - if (!specialContent.contains("::")) - { - tooltip->AddSpecialContent(specialContent, optionalData); - } - - if (!isEnabled) // If disabled, add disabled value - { - tooltip->AppendContent(disabledContent); - } - } - - QString ToolTip_GetTitle(QString path, QString option) override - { - if (!option.isEmpty() && GetToolTip(path + "." + option).isValid) - { - return GetToolTip(path + "." + option).title; - } - if (!option.isEmpty() && GetToolTip("Options." + option).isValid) - { - return GetToolTip("Options." + option).title; - } - return GetToolTip(path).title; - } - - QString ToolTip_GetContent(QString path, QString option) override - { - if (!option.isEmpty() && GetToolTip(path + "." + option).isValid) - { - return GetToolTip(path + "." + option).content; - } - if (!option.isEmpty() && GetToolTip("Options." + option).isValid) - { - return GetToolTip("Options." + option).content; - } - return GetToolTip(path).content; - } - - QString ToolTip_GetSpecialContentType(QString path, QString option) override - { - if (!option.isEmpty() && GetToolTip(path + "." + option).isValid) - { - return GetToolTip(path + "." + option).specialContent; - } - if (!option.isEmpty() && GetToolTip("Options." + option).isValid) - { - return GetToolTip("Options." + option).specialContent; - } - return GetToolTip(path).specialContent; - } - - QString ToolTip_GetDisabledContent(QString path, QString option) override - { - if (!option.isEmpty() && GetToolTip(path + "." + option).isValid) - { - return GetToolTip(path + "." + option).disabledContent; - } - if (!option.isEmpty() && GetToolTip("Options." + option).isValid) - { - return GetToolTip("Options." + option).disabledContent; - } - return GetToolTip(path).disabledContent; - } -}; - -IEditorPanelUtils* CreateEditorPanelUtils() -{ - return new CEditorPanelUtils_Impl(); -} - diff --git a/Code/Editor/EditorPanelUtils.h b/Code/Editor/EditorPanelUtils.h deleted file mode 100644 index 6ac15ebfc9..0000000000 --- a/Code/Editor/EditorPanelUtils.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -// Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. -#ifndef CRYINCLUDE_CRYEDITOR_EDITORPANELUTILS_H -#define CRYINCLUDE_CRYEDITOR_EDITORPANELUTILS_H -#pragma once - -struct IEditorPanelUtils; -IEditorPanelUtils* CreateEditorPanelUtils(); - -#endif diff --git a/Code/Editor/IEditor.h b/Code/Editor/IEditor.h index c6f72a7dbc..d2d4998187 100644 --- a/Code/Editor/IEditor.h +++ b/Code/Editor/IEditor.h @@ -69,7 +69,6 @@ class CSelectionTreeManager; struct SEditorSettings; class CGameExporter; class IAWSResourceManager; -struct IEditorPanelUtils; namespace WinWidget { @@ -526,8 +525,6 @@ struct IEditor virtual IEditorMaterialManager* GetIEditorMaterialManager() = 0; // Vladimir@Conffx //! Returns IconManager. virtual IIconManager* GetIconManager() = 0; - //! Get Panel Editor Utilities - virtual IEditorPanelUtils* GetEditorPanelUtils() = 0; //! Get Music Manager. virtual CMusicManager* GetMusicManager() = 0; virtual float GetTerrainElevation(float x, float y) = 0; diff --git a/Code/Editor/IEditorImpl.cpp b/Code/Editor/IEditorImpl.cpp index 5bd816174c..0846cf8a9e 100644 --- a/Code/Editor/IEditorImpl.cpp +++ b/Code/Editor/IEditorImpl.cpp @@ -81,9 +81,6 @@ AZ_POP_DISABLE_WARNING // AWSNativeSDK #include -#include "IEditorPanelUtils.h" -#include "EditorPanelUtils.h" - #include "Core/QtEditorApplication.h" // for Editor::EditorQtApplication static CCryEditDoc * theDocument; @@ -143,7 +140,6 @@ CEditorImpl::CEditorImpl() , m_QtApplication(static_cast(qApp)) , m_pImageUtil(nullptr) , m_pLogFile(nullptr) - , m_panelEditorUtils(nullptr) { // note that this is a call into EditorCore.dll, which stores the g_pEditorPointer for all shared modules that share EditorCore.dll // this means that they don't need to do SetIEditor(...) themselves and its available immediately @@ -167,8 +163,6 @@ CEditorImpl::CEditorImpl() m_pDisplaySettings->LoadRegistry(); m_pPluginManager = new CPluginManager; - m_panelEditorUtils = CreateEditorPanelUtils(); - m_pObjectManager = new CObjectManager; m_pViewManager = new CViewManager; m_pIconManager = new CIconManager; @@ -301,8 +295,6 @@ CEditorImpl::~CEditorImpl() SAFE_DELETE(m_pViewManager) SAFE_DELETE(m_pObjectManager) // relies on prefab manager - SAFE_DELETE(m_panelEditorUtils); - // some plugins may be exporter - this must be above plugin manager delete. SAFE_DELETE(m_pExportManager); @@ -1658,8 +1650,3 @@ void CEditorImpl::DestroyQMimeData(QMimeData* data) const { delete data; } - -IEditorPanelUtils* CEditorImpl::GetEditorPanelUtils() -{ - return m_panelEditorUtils; -} diff --git a/Code/Editor/IEditorImpl.h b/Code/Editor/IEditorImpl.h index 4976c0c1ca..d99b8ae802 100644 --- a/Code/Editor/IEditorImpl.h +++ b/Code/Editor/IEditorImpl.h @@ -298,7 +298,6 @@ public: IEditorMaterialManager* GetIEditorMaterialManager() override; // Vladimir@Conffx IImageUtil* GetImageUtil() override; // Vladimir@conffx SEditorSettings* GetEditorSettings() override; - IEditorPanelUtils* GetEditorPanelUtils() override; ILogFile* GetLogFile() override { return m_pLogFile; } void UnloadPlugins() override; @@ -356,7 +355,6 @@ protected: CErrorsDlg* m_pErrorsDlg; //! Source control interface. ISourceControl* m_pSourceControl; - IEditorPanelUtils* m_panelEditorUtils; CSelectionTreeManager* m_pSelectionTreeManager; diff --git a/Code/Editor/IEditorPanelUtils.h b/Code/Editor/IEditorPanelUtils.h deleted file mode 100644 index 4649213ae7..0000000000 --- a/Code/Editor/IEditorPanelUtils.h +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - */ - -#ifndef CRYINCLUDE_CRYEDITOR_IPANELEDITORUTILS_H -#define CRYINCLUDE_CRYEDITOR_IPANELEDITORUTILS_H -#pragma once - -#include "Cry_Vector3.h" - -#include "DisplaySettings.h" -#include "Include/IDisplayViewport.h" -#include "Include/IIconManager.h" -#include -#include -#include -#include - -class CBaseObject; -class CViewport; -class IQToolTip; - -struct HotKey -{ - HotKey() - : path("") - , sequence(QKeySequence()) - { - } - void CopyFrom(const HotKey& other) - { - path = other.path; - sequence = other.sequence; - } - void SetPath(const char* _path) - { - path = QString(_path); - } - void SetSequenceFromString(const char* _sequence) - { - sequence = QKeySequence::fromString(_sequence); - } - void SetSequence(const QKeySequence& other) - { - sequence = other; - } - bool IsMatch(QString _path) - { - return path.compare(_path, Qt::CaseInsensitive) == 0; - } - bool IsMatch(QKeySequence _sequence) - { - return sequence.matches(_sequence); - } - bool operator < (const HotKey& other) const - { - //split the paths into lists compare per level - QStringList m_categories = path.split('.'); - QStringList o_categories = other.path.split('.'); - int m_catSize = m_categories.size(); - int o_catSize = o_categories.size(); - int size = (m_catSize < o_catSize) ? m_catSize : o_catSize; - - //sort categories to keep them together - for (int i = 0; i < size; i++) - { - if (m_categories[i] < o_categories[i]) - { - return true; - } - if (m_categories[i] > o_categories[i]) - { - return false; - } - } - //if comparing a category and a item in that category the category is < item - return m_catSize > o_catSize; - } - QKeySequence sequence; - QString path; -}; - -struct IEditorPanelUtils -{ - virtual ~IEditorPanelUtils() {} - virtual void SetViewportDragOperation(void(*)(CViewport* viewport, int dragPointX, int dragPointY, void* custom), void* custom) = 0; - - //PREVIEW WINDOW UTILS//////////////////////////////////////////////////// - virtual int PreviewWindow_GetDisplaySettingsDebugFlags(CDisplaySettings* settings) = 0; - virtual void PreviewWindow_SetDisplaySettingsDebugFlags(CDisplaySettings* settings, int flags) = 0; - - //HOTKEY UTILS//////////////////////////////////////////////////////////// - virtual bool HotKey_Import() = 0; - virtual void HotKey_Export() = 0; - virtual QKeySequence HotKey_GetShortcut(const char* path) = 0; - virtual bool HotKey_IsPressed(const QKeyEvent* event, const char* path) = 0; - virtual bool HotKey_IsPressed(const QShortcutEvent* event, const char* path) = 0; - virtual bool HotKey_LoadExisting() = 0; - virtual void HotKey_SaveCurrent() = 0; - virtual void HotKey_BuildDefaults() = 0; - virtual void HotKey_SetKeys(QVector keys) = 0; - virtual QVector HotKey_GetKeys() = 0; - virtual QString HotKey_GetPressedHotkey(const QKeyEvent* event) = 0; - virtual QString HotKey_GetPressedHotkey(const QShortcutEvent* event) = 0; - virtual void HotKey_SetEnabled(bool val) = 0; - virtual bool HotKey_IsEnabled() const = 0; - - //TOOLTIP UTILS/////////////////////////////////////////////////////////// - - //! Loads a table of tooltip configuration data from an xml file. - virtual void ToolTip_LoadConfigXML(QString filepath) = 0; - - //! Initializes a QToolTipWidget from loaded configuration data (see ToolTip_LoadConfigXML()) - //! \param tooltip Will be initialized using loaded configuration data - //! \param path Variable serialization path. Will be used as the key for looking up data in the configuration table. (ex: "Rotation.Rotation_Rate_X") - //! \param option Name of a sub-option of the variable specified by "path". (ex: "Emitter_Strength" will look up the tooltip data for "Rotation.Rotation_Rate_X.Emitter_Strength") - //! \param optionalData The argument to be used with "special_content" feature. See ToolTip_GetSpecialContentType() and QToolTipWidget::AddSpecialContent(). - //! \param isEnabled If false, the tooltip will indicate the reason why the widget is disabled. - virtual void ToolTip_BuildFromConfig(IQToolTip* tooltip, QString path, QString option, QString optionalData = "", bool isEnabled = true) = 0; - - virtual QString ToolTip_GetTitle(QString path, QString option = "") = 0; - virtual QString ToolTip_GetContent(QString path, QString option = "") = 0; - virtual QString ToolTip_GetSpecialContentType(QString path, QString option = "") = 0; - virtual QString ToolTip_GetDisabledContent(QString path, QString option = "") = 0; -}; - - -#endif diff --git a/Code/Editor/Lib/Tests/IEditorMock.h b/Code/Editor/Lib/Tests/IEditorMock.h index 390ffebe79..590f98e6d7 100644 --- a/Code/Editor/Lib/Tests/IEditorMock.h +++ b/Code/Editor/Lib/Tests/IEditorMock.h @@ -187,6 +187,5 @@ public: MOCK_METHOD0(UnloadPlugins, void()); MOCK_METHOD0(LoadPlugins, void()); MOCK_METHOD1(GetSearchPath, QString(EEditorPathName)); - MOCK_METHOD0(GetEditorPanelUtils, IEditorPanelUtils* ()); }; diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index a63a74f01d..a018333925 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -334,23 +334,12 @@ set(FILES Controls/ConsoleSCB.qrc Controls/FolderTreeCtrl.cpp Controls/FolderTreeCtrl.h - Controls/HotTrackingTreeCtrl.cpp - Controls/HotTrackingTreeCtrl.h Controls/ImageHistogramCtrl.cpp Controls/ImageHistogramCtrl.h - Controls/ImageListCtrl.cpp - Controls/ImageListCtrl.h - Controls/MultiMonHelper.cpp - Controls/MultiMonHelper.h - Controls/NumberCtrl.cpp - Controls/NumberCtrl.h - Controls/NumberCtrl.h Controls/SplineCtrl.cpp Controls/SplineCtrl.h Controls/SplineCtrlEx.cpp Controls/SplineCtrlEx.h - Controls/TextEditorCtrl.cpp - Controls/TextEditorCtrl.h Controls/TimelineCtrl.cpp Controls/TimelineCtrl.h Controls/WndGridHelper.h @@ -796,9 +785,6 @@ set(FILES ViewportTitleDlg.h EditorEnvironment.cpp EditorEnvironment.h - IEditorPanelUtils.h - EditorPanelUtils.h - EditorPanelUtils.cpp ) From 30e21bc2d115f9309a3629df0ac71837861d8e8a Mon Sep 17 00:00:00 2001 From: mrieggeramzn Date: Tue, 4 Jan 2022 14:52:00 -0800 Subject: [PATCH 299/948] Updating formatting Signed-off-by: mrieggeramzn --- .../UI/PropertyEditor/PropertyIntCtrlCommon.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyIntCtrlCommon.h b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyIntCtrlCommon.h index 7d3e7191e3..504e3fd0dc 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyIntCtrlCommon.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyIntCtrlCommon.h @@ -92,15 +92,11 @@ namespace AzToolsFramework { toolTipString += "\n"; } - toolTipString += "["; const QString minString = QLocale().toString(propertyControl->minimum()); const QString maxString = QLocale().toString(propertyControl->maximum()); + toolTipString += QString("[%1, %2]").arg(minString).arg(maxString); - toolTipString += minString; - toolTipString += ", "; - toolTipString += maxString; - toolTipString += "]"; return true; } return false; @@ -121,10 +117,8 @@ namespace AzToolsFramework const QString minString = QLocale().toString(propertyControl->minimum()); const QString maxString = QLocale().toString(propertyControl->maximum()); + toolTipString += QString("[%1, %2]").arg(minString).arg(maxString); - toolTipString += "[" + minString + ", "; - toolTipString += maxString; - toolTipString += "]"; return true; } return false; From daf4dbb54d94b1c4240a273a9fdd831cce543339 Mon Sep 17 00:00:00 2001 From: michabr <82236305+michabr@users.noreply.github.com> Date: Tue, 4 Jan 2022 15:14:35 -0800 Subject: [PATCH 300/948] Fix LyShine debug display to work with Atom (#6516) * LyShine cleanup pass for Atom conversion Signed-off-by: abrmich * Add GHI numbers to comments Signed-off-by: abrmich * Fix debug texture data Signed-off-by: abrmich * Fix debug canvas and draw call data Signed-off-by: abrmich * Add GHI issue Signed-off-by: abrmich * Address PR feedback Signed-off-by: abrmich * Remove unused variable Signed-off-by: abrmich --- Gems/LyShine/Code/Include/LyShine/Draw2d.h | 3 + Gems/LyShine/Code/Source/Draw2d.cpp | 6 + Gems/LyShine/Code/Source/RenderGraph.cpp | 15 ++- Gems/LyShine/Code/Source/UiCanvasManager.cpp | 30 ++--- Gems/LyShine/Code/Source/UiRenderer.cpp | 123 +++++++++---------- Gems/LyShine/Code/Source/UiRenderer.h | 7 +- 6 files changed, 92 insertions(+), 92 deletions(-) diff --git a/Gems/LyShine/Code/Include/LyShine/Draw2d.h b/Gems/LyShine/Code/Include/LyShine/Draw2d.h index 8123a834a1..881479bd23 100644 --- a/Gems/LyShine/Code/Include/LyShine/Draw2d.h +++ b/Gems/LyShine/Code/Include/LyShine/Draw2d.h @@ -205,6 +205,9 @@ public: // member functions //! Get the height of the rendering viewport (in pixels). float GetViewportHeight() const; + //! Get dpi scale factor + float GetViewportDpiScalingFactor() const; + //! Get the default values that would be used if no image options were passed in // //! This is a convenient way to initialize the imageOptions struct diff --git a/Gems/LyShine/Code/Source/Draw2d.cpp b/Gems/LyShine/Code/Source/Draw2d.cpp index f2c7c360d2..6b6356aa4f 100644 --- a/Gems/LyShine/Code/Source/Draw2d.cpp +++ b/Gems/LyShine/Code/Source/Draw2d.cpp @@ -452,6 +452,12 @@ float CDraw2d::GetViewportHeight() const return viewHeight; } +//////////////////////////////////////////////////////////////////////////////////////////////////// +float CDraw2d::GetViewportDpiScalingFactor() const +{ + return GetViewportContext()->GetDpiScalingFactor(); +} + //////////////////////////////////////////////////////////////////////////////////////////////////// const CDraw2d::ImageOptions& CDraw2d::GetDefaultImageOptions() const { diff --git a/Gems/LyShine/Code/Source/RenderGraph.cpp b/Gems/LyShine/Code/Source/RenderGraph.cpp index db17fde601..c05e87bc64 100644 --- a/Gems/LyShine/Code/Source/RenderGraph.cpp +++ b/Gems/LyShine/Code/Source/RenderGraph.cpp @@ -122,14 +122,10 @@ namespace LyShine uint32_t isClampTextureMode = 0; for (int i = 0; i < m_numTextures; ++i) { - const AZ::RHI::ImageView* imageView = m_textures[i].m_texture ? m_textures[i].m_texture->GetImageView() : nullptr; - - if (!imageView) - { - // Default to white texture - auto image = AZ::RPI::ImageSystemInterface::Get()->GetSystemImage(AZ::RPI::SystemImage::White); - imageView = image->GetImageView(); - } + // Default to white texture + const AZ::Data::Instance& image = m_textures[i].m_texture ? m_textures[i].m_texture + : AZ::RPI::ImageSystemInterface::Get()->GetSystemImage(AZ::RPI::SystemImage::White); + const AZ::RHI::ImageView* imageView = image->GetImageView(); if (imageView) { @@ -138,6 +134,9 @@ namespace LyShine { isClampTextureMode |= (1 << i); } +#ifndef _RELEASE + uiRenderer->DebugUseTexture(image); +#endif } } diff --git a/Gems/LyShine/Code/Source/UiCanvasManager.cpp b/Gems/LyShine/Code/Source/UiCanvasManager.cpp index 62d1c6e2a8..c6564f9b3a 100644 --- a/Gems/LyShine/Code/Source/UiCanvasManager.cpp +++ b/Gems/LyShine/Code/Source/UiCanvasManager.cpp @@ -999,26 +999,23 @@ void UiCanvasManager::DebugDisplayCanvasData(int setting) const CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); - float xOffset = 20.0f; - float yOffset = 20.0f; + float dpiScale = draw2d->GetViewportDpiScalingFactor(); + float xOffset = 20.0f * dpiScale; + float yOffset = 20.0f * dpiScale; const int elementNameFieldLength = 20; auto blackTexture = AZ::RPI::ImageSystemInterface::Get()->GetSystemImage(AZ::RPI::SystemImage::Black); - float textOpacity = 1.0f; - float backgroundRectOpacity = 0.75f; + float backgroundRectOpacity = 0.0f; // 0.75f; // [GHI #6515] Reenable background rect const AZ::Vector3 white(1.0f, 1.0f, 1.0f); const AZ::Vector3 grey(0.5f, 0.5f, 0.5f); const AZ::Vector3 red(1.0f, 0.3f, 0.3f); const AZ::Vector3 blue(0.3f, 0.3f, 1.0f); - // If the viewport is narrow then a font size of 16 might be too large, so we use a size between 12 and 16 depending - // on the viewport width. - float fontSize(draw2d->GetViewportWidth() / 75.f); - fontSize = AZ::GetClamp(fontSize, 12.f, 16.f); - const float lineSpacing = fontSize; + const float fontSize = 8.0f; + const float lineSpacing = 20.0f * dpiScale; // local function to write a line of text (with a background rect) and increment Y offset AZStd::function WriteLine = [&](const char* buffer, const AZ::Vector3& color) @@ -1157,13 +1154,13 @@ void UiCanvasManager::DebugDisplayDrawCallData() const { CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); - float xOffset = 20.0f; - float yOffset = 20.0f; + float dpiScale = draw2d->GetViewportDpiScalingFactor(); + float xOffset = 20.0f * dpiScale; + float yOffset = 20.0f * dpiScale; auto blackTexture = AZ::RPI::ImageSystemInterface::Get()->GetSystemImage(AZ::RPI::SystemImage::Black); float textOpacity = 1.0f; - float backgroundRectOpacity = 0.75f; - const float lineSpacing = 20.0f; + float backgroundRectOpacity = 0.0f; // 0.75f; // [GHI #6515] Reenable background rect const AZ::Vector3 white(1,1,1); const AZ::Vector3 red(1,0.3f,0.3f); @@ -1171,16 +1168,19 @@ void UiCanvasManager::DebugDisplayDrawCallData() const const AZ::Vector3 green(0.3f,1,0.3f); const AZ::Vector3 yellow(0.7f,0.7f,0.2f); + const float fontSize = 8.0f; + const float lineSpacing = 20.0f * dpiScale; + // local function to write a line of text (with a background rect) and increment Y offset AZStd::function WriteLine = [&](const char* buffer, const AZ::Vector3& color) { CDraw2d::TextOptions textOptions = draw2d->GetDefaultTextOptions(); textOptions.color = color; - AZ::Vector2 textSize = draw2d->GetTextSize(buffer, 16, &textOptions); + AZ::Vector2 textSize = draw2d->GetTextSize(buffer, fontSize, &textOptions); AZ::Vector2 rectTopLeft = AZ::Vector2(xOffset - 2, yOffset); AZ::Vector2 rectSize = AZ::Vector2(textSize.GetX() + 4, lineSpacing); draw2d->DrawImage(blackTexture, rectTopLeft, rectSize, backgroundRectOpacity); - draw2d->DrawText(buffer, AZ::Vector2(xOffset, yOffset), 16, textOpacity, &textOptions); + draw2d->DrawText(buffer, AZ::Vector2(xOffset, yOffset), fontSize, textOpacity, &textOptions); yOffset += lineSpacing; }; diff --git a/Gems/LyShine/Code/Source/UiRenderer.cpp b/Gems/LyShine/Code/Source/UiRenderer.cpp index b43be90a36..64ec1bb485 100644 --- a/Gems/LyShine/Code/Source/UiRenderer.cpp +++ b/Gems/LyShine/Code/Source/UiRenderer.cpp @@ -216,17 +216,11 @@ void UiRenderer::BeginUiFrameRender() m_texturesUsedInFrame.clear(); } #endif - - // Various platform drivers expect all texture slots used in the shader to be bound - BindNullTexture(); } //////////////////////////////////////////////////////////////////////////////////////////////////// void UiRenderer::EndUiFrameRender() { - // We never want to leave a texture bound that could get unloaded before the next render - // So bind the global white texture for all the texture units we use. - BindNullTexture(); } //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -384,45 +378,6 @@ void UiRenderer::DecrementStencilRef() --m_stencilRef; } -#ifdef LYSHINE_ATOM_TODO -//////////////////////////////////////////////////////////////////////////////////////////////////// -void UiRenderer::SetTexture(ITexture* texture, int texUnit, bool clamp) -{ - if (!texture) - { - texture = m_renderer->GetWhiteTexture(); - } - else - { - texture->SetClamp(clamp); - } - - m_renderer->SetTexture(texture->GetTextureID(), texUnit); - -#ifndef _RELEASE - if (m_debugTextureDataRecordLevel > 0) - { - m_texturesUsedInFrame.insert(texture); - } -#endif -} -#endif - - -//////////////////////////////////////////////////////////////////////////////////////////////////// -void UiRenderer::BindNullTexture() -{ -#ifdef LYSHINE_ATOM_TODO - // Bind the global white texture for all the texture units we use - const int MaxTextures = 16; - int whiteTexId = m_renderer->GetWhiteTextureId(); - for (int texUnit = 0; texUnit < MaxTextures; ++texUnit) - { - m_renderer->SetTexture(whiteTexId, texUnit); - } -#endif -} - #ifndef _RELEASE //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -436,38 +391,42 @@ void UiRenderer::DebugDisplayTextureData(int recordingOption) { if (recordingOption > 0) { -#ifdef LYSHINE_ATOM_TODO // [GHI #3568] Support canvas debug display with Atom // compute the total area of all the textures, also create a vector that we can sort by area - AZStd::vector textures; + AZStd::vector, uint32_t>> textures; int totalArea = 0; int totalDataSize = 0; - for (ITexture* texture : m_texturesUsedInFrame) + for (AZ::Data::Instance image : m_texturesUsedInFrame) { - int area = texture->GetWidth() * texture->GetHeight(); - int dataSize = texture->GetDataSize(); + const AZ::RHI::ImageDescriptor& imageDescriptor = image->GetRHIImage()->GetDescriptor(); + AZ::RHI::Size size = imageDescriptor.m_size; + int area = size.m_width * size.m_height; + uint32_t dataSize = AZ::RHI::GetFormatSize(imageDescriptor.m_format) * area; + totalArea += area; totalDataSize += dataSize; - textures.push_back(texture); + textures.push_back(AZStd::pair, uint32_t>(image, dataSize)); } // sort the vector by data size - std::sort( textures.begin( ), textures.end( ), [ ]( const ITexture* lhs, const ITexture* rhs ) + std::sort( textures.begin( ), textures.end( ), [ ]( const AZStd::pair, uint32_t> lhs, const AZStd::pair, uint32_t> rhs ) { - return lhs->GetDataSize() > rhs->GetDataSize(); + return lhs.second > rhs.second; }); CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); // setup to render lines of text for the debug display - float xOffset = 20.0f; - float yOffset = 20.0f; + float dpiScale = GetViewportContext()->GetDpiScalingFactor(); + float xOffset = 20.0f * dpiScale; + float yOffset = 20.0f * dpiScale; auto blackTexture = AZ::RPI::ImageSystemInterface::Get()->GetSystemImage(AZ::RPI::SystemImage::Black); float textOpacity = 1.0f; - float backgroundRectOpacity = 0.75f; - const float lineSpacing = 20.0f; + float backgroundRectOpacity = 0.0f; // 0.75f; // [GHI #6515] Reenable background rect + const float fontSize = 8.0f; + const float lineSpacing = 20.0f * dpiScale; const AZ::Vector3 white(1,1,1); const AZ::Vector3 red(1,0.3f,0.3f); @@ -492,29 +451,61 @@ void UiRenderer::DebugDisplayTextureData(int recordingOption) { CDraw2d::TextOptions textOptions = draw2d->GetDefaultTextOptions(); textOptions.color = color; - AZ::Vector2 textSize = draw2d->GetTextSize(buffer, 16, &textOptions); + AZ::Vector2 textSize = draw2d->GetTextSize(buffer, fontSize, &textOptions); AZ::Vector2 rectTopLeft = AZ::Vector2(xOffset - 2, yOffset); AZ::Vector2 rectSize = AZ::Vector2(textSize.GetX() + 4, lineSpacing); draw2d->DrawImage(blackTexture, rectTopLeft, rectSize, backgroundRectOpacity); - draw2d->DrawText(buffer, AZ::Vector2(xOffset, yOffset), 16, textOpacity, &textOptions); + draw2d->DrawText(buffer, AZ::Vector2(xOffset, yOffset), fontSize, textOpacity, &textOptions); yOffset += lineSpacing; }; - int numTexturesUsedInFrame = m_texturesUsedInFrame.size(); + size_t numTexturesUsedInFrame = m_texturesUsedInFrame.size(); char buffer[200]; - sprintf_s(buffer, "There are %d unique UI textures rendered in this frame, the total texture area is %d (%d x %d), total data size is %d (%.2f MB)", + sprintf_s(buffer, "There are %zu unique UI textures rendered in this frame, the total texture area is %d (%d x %d), total data size is %d (%.2f MB)", numTexturesUsedInFrame, totalArea, xDim, yDim, totalDataSize, totalDataSizeMB); WriteLine(buffer, white); - sprintf_s(buffer, "Dimensions Data Size Format Texture name"); + sprintf_s(buffer, "Dimensions Data Size Format Texture name"); WriteLine(buffer, blue); - for (ITexture* texture : textures) + for (auto texture : textures) { - sprintf_s(buffer, "%4d x %4d, %9d %8s %s", - texture->GetWidth(), texture->GetHeight(), texture->GetDataSize(), texture->GetFormatName(), texture->GetName()); + AZ::Data::Instance image = texture.first; + const AZ::RHI::ImageDescriptor& imageDescriptor = image->GetRHIImage()->GetDescriptor(); + uint32_t width = imageDescriptor.m_size.m_width; + uint32_t height = imageDescriptor.m_size.m_height; + uint32_t dataSize = texture.second; + + const char* displayName = "Unnamed Texture"; + AZStd::string imagePath; + // Check if the image has been assigned a name (ex. if it's an attachment image or a cpu generated image) + const AZ::Name& imageName = image->GetRHIImage()->GetName(); + if (!imageName.IsEmpty()) + { + displayName = imageName.GetCStr(); + } + else + { + // Use the image's asset path as the display name + AZ::Data::AssetCatalogRequestBus::BroadcastResult(imagePath, + &AZ::Data::AssetCatalogRequests::GetAssetPathById, image->GetAssetId()); + if (!imagePath.empty()) + { + displayName = imagePath.c_str(); + } + } + + sprintf_s(buffer, "%4u x %4u, %9u %19s %s", + width, height, dataSize, AZ::RHI::ToString(imageDescriptor.m_format), displayName); WriteLine(buffer, white); } -#endif + } +} + +void UiRenderer::DebugUseTexture(AZ::Data::Instance image) +{ + if (m_debugTextureDataRecordLevel > 0) + { + m_texturesUsedInFrame.insert(image); } } diff --git a/Gems/LyShine/Code/Source/UiRenderer.h b/Gems/LyShine/Code/Source/UiRenderer.h index 3ff3de5507..35705441f5 100644 --- a/Gems/LyShine/Code/Source/UiRenderer.h +++ b/Gems/LyShine/Code/Source/UiRenderer.h @@ -19,8 +19,6 @@ #include #endif -class ITexture; - //////////////////////////////////////////////////////////////////////////////////////////////////// //! UI render interface // @@ -137,6 +135,9 @@ public: // member functions //! Display debug texture data after rendering void DebugDisplayTextureData(int recordingOption); + + //! Track textures being used in the current frame + void DebugUseTexture(AZ::Data::Instance image); #endif private: // member functions @@ -179,6 +180,6 @@ protected: // attributes #ifndef _RELEASE int m_debugTextureDataRecordLevel = 0; - AZStd::unordered_set m_texturesUsedInFrame; // [LYN-7857] - Support debug display with Atom + AZStd::unordered_set> m_texturesUsedInFrame; #endif }; From 04f4d5e0318eac4d01f8f72e5a2b06a0da6d5388 Mon Sep 17 00:00:00 2001 From: Chris Burel Date: Tue, 26 Oct 2021 16:36:35 -0700 Subject: [PATCH 301/948] [Linux] Avoid recursive inotify when a watch folder is set to recursive=false Signed-off-by: Chris Burel --- .../native/FileWatcher/FileWatcher_linux.cpp | 31 +++++++++++++++---- .../native/FileWatcher/FileWatcher.cpp | 6 ++-- .../native/FileWatcher/FileWatcher.h | 5 +-- .../utilities/ApplicationManagerBase.cpp | 2 +- 4 files changed, 32 insertions(+), 12 deletions(-) diff --git a/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.cpp b/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.cpp index b7f7affd6d..f63282abfc 100644 --- a/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.cpp +++ b/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.cpp @@ -63,7 +63,7 @@ struct FolderRootWatch::PlatformImplementation } } - void AddWatchFolder(QString folder) + void AddWatchFolder(QString folder, bool recursive) { if (m_iNotifyHandle >= 0) { @@ -75,6 +75,11 @@ struct FolderRootWatch::PlatformImplementation cleanPath.toUtf8().constData(), IN_CREATE | IN_CLOSE_WRITE | IN_DELETE | IN_DELETE_SELF | IN_MODIFY | IN_MOVE); + if (watchHandle < 0) + { + AZ_Error("FileWatcher", false, "inotify_add_watch failed for path %s", cleanPath.toUtf8().constData()); + return; + } if (!m_handleToFolderMapLock.tryLock(s_handleToFolderMapLockTimeout)) { AZ_Error("FileWatcher", false, "Unable to obtain inotify handle lock on thread"); @@ -83,6 +88,11 @@ struct FolderRootWatch::PlatformImplementation m_handleToFolderMap[watchHandle] = cleanPath; m_handleToFolderMapLock.unlock(); + if (!recursive) + { + return; + } + // Add all the subfolders to watch and track them QDirIterator dirIter(folder, QDirIterator::Subdirectories | QDirIterator::FollowSymlinks); @@ -97,6 +107,11 @@ struct FolderRootWatch::PlatformImplementation int watchHandle = inotify_add_watch(m_iNotifyHandle, dirName.toUtf8().constData(), IN_CREATE | IN_CLOSE_WRITE | IN_DELETE | IN_DELETE_SELF | IN_MODIFY | IN_MOVE); + if (watchHandle < 0) + { + AZ_Error("FileWatcher", false, "inotify_add_watch failed for path %s", dirName.toUtf8().constData()); + return; + } if (!m_handleToFolderMapLock.tryLock(s_handleToFolderMapLockTimeout)) { @@ -133,10 +148,11 @@ struct FolderRootWatch::PlatformImplementation ////////////////////////////////////////////////////////////////////////////// /// FolderWatchRoot -FolderRootWatch::FolderRootWatch(const QString rootFolder) +FolderRootWatch::FolderRootWatch(const QString rootFolder, bool recursive) : m_root(rootFolder) , m_shutdownThreadSignal(false) , m_fileWatcher(nullptr) + , m_recursive(recursive) , m_platformImpl(new PlatformImplementation()) { } @@ -156,10 +172,13 @@ bool FolderRootWatch::Start() { return false; } - m_platformImpl->AddWatchFolder(m_root); + m_platformImpl->AddWatchFolder(m_root, m_recursive); m_shutdownThreadSignal = false; - m_thread = std::thread([this]() { WatchFolderLoop(); }); + if (m_platformImpl->m_iNotifyHandle >= 0) + { + m_thread = std::thread([this]() { WatchFolderLoop(); }); + } return true; } @@ -200,10 +219,10 @@ void FolderRootWatch::WatchFolderLoop() if (event->mask & (IN_CREATE | IN_MOVED_TO)) { - if ( event->mask & IN_ISDIR ) + if ( event->mask & IN_ISDIR && m_recursive) { // New Directory, add it to the watch - m_platformImpl->AddWatchFolder(pathStr); + m_platformImpl->AddWatchFolder(pathStr, true); } else { diff --git a/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.cpp b/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.cpp index ff9876ebdd..4d4b4e9690 100644 --- a/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.cpp +++ b/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.cpp @@ -49,7 +49,7 @@ FileWatcher::~FileWatcher() { } -int FileWatcher::AddFolderWatch(FolderWatchBase* pFolderWatch) +int FileWatcher::AddFolderWatch(FolderWatchBase* pFolderWatch, bool recursive) { if (!pFolderWatch) { @@ -72,7 +72,7 @@ int FileWatcher::AddFolderWatch(FolderWatchBase* pFolderWatch) if (!pFolderRootWatch) { //create a new root and start listening for changes - pFolderRootWatch = new FolderRootWatch(pFolderWatch->m_folder); + pFolderRootWatch = new FolderRootWatch(pFolderWatch->m_folder, recursive); //make sure the folder watcher(s) get deleted before this pFolderRootWatch->setParent(this); @@ -93,7 +93,7 @@ int FileWatcher::AddFolderWatch(FolderWatchBase* pFolderWatch) //of other roots, if it is then then fold those roots into the new super root for (auto rootsIter = m_folderWatchRoots.begin(); rootsIter != m_folderWatchRoots.end(); ) { - if (FolderWatchBase::IsSubfolder((*rootsIter)->m_root, pFolderWatch->m_folder)) + if (pFolderWatch->m_watchSubtree && FolderWatchBase::IsSubfolder((*rootsIter)->m_root, pFolderWatch->m_folder)) { //union the sub folder map over to the new root pFolderRootWatch->m_subFolderWatchesMap.insert((*rootsIter)->m_subFolderWatchesMap); diff --git a/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.h b/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.h index 392f8194a6..fc3f109604 100644 --- a/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.h +++ b/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.h @@ -33,7 +33,7 @@ class FolderRootWatch friend class FileWatcher; public: - FolderRootWatch(const QString rootFolder); + FolderRootWatch(const QString rootFolder, bool recursive = true); virtual ~FolderRootWatch(); void ProcessNewFileEvent(const QString& file); @@ -54,6 +54,7 @@ private: QMap m_subFolderWatchesMap; volatile bool m_shutdownThreadSignal; FileWatcher* m_fileWatcher; + bool m_recursive; // Can't use unique_ptr because this is a QObject and Qt's magic sauce is // unable to determine the size of the unique_ptr and so fails to compile @@ -76,7 +77,7 @@ public: virtual ~FileWatcher(); ////////////////////////////////////////////////////////////////////////// - virtual int AddFolderWatch(FolderWatchBase* pFolderWatch); + virtual int AddFolderWatch(FolderWatchBase* pFolderWatch, bool recursive = true); virtual void RemoveFolderWatch(int handle); ////////////////////////////////////////////////////////////////////////// diff --git a/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp b/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp index 04036602db..f9827bda2e 100644 --- a/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp +++ b/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp @@ -461,7 +461,7 @@ void ApplicationManagerBase::InitFileMonitor() m_fileProcessor.get(), &AssetProcessor::FileProcessor::AssessDeletedFile); m_folderWatches.push_back(AZStd::unique_ptr(newFolderWatch)); - m_watchHandles.push_back(m_fileWatcher.AddFolderWatch(newFolderWatch)); + m_watchHandles.push_back(m_fileWatcher.AddFolderWatch(newFolderWatch, info.RecurseSubFolders())); } // also hookup monitoring for the cache (output directory) From 7ac5bc3d5cb54701b9ffea18ebb660d2fa673081 Mon Sep 17 00:00:00 2001 From: Chris Burel Date: Mon, 15 Nov 2021 11:06:32 -0800 Subject: [PATCH 302/948] [Linux] Display a warning in AP if inotify fails to initialize Signed-off-by: Chris Burel --- .../Platform/Linux/native/FileWatcher/FileWatcher_linux.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.cpp b/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.cpp index f63282abfc..d20bb6c5b4 100644 --- a/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.cpp +++ b/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.cpp @@ -34,6 +34,12 @@ struct FolderRootWatch::PlatformImplementation { // The CLOEXEC flag prevents the inotify watchers from copying on fork/exec m_iNotifyHandle = inotify_init1(IN_CLOEXEC); + const auto err = errno; + + if (m_iNotifyHandle < 0) + { + AZ_Warning("FileWatcher", false, "Unable to initialize inotify, file monitoring will not be available: %s\n", strerror(err)); + } } return (m_iNotifyHandle >= 0); } From ce0bb1ca2be99c7677c6a94d9b96bc5796f48e77 Mon Sep 17 00:00:00 2001 From: Chris Burel Date: Mon, 15 Nov 2021 11:30:37 -0800 Subject: [PATCH 303/948] [AssetProcessor] Refactor the FileWatcher to use only one watch thread This change reworks the AssetProcessor's FileWatcher so that it only uses one thread. This is motivated by getting better support for inotify on Linux. The previous architecture required calling `inotify_init` once for each directory that was being watched, and using separate inotify instances for each watched tree. In addition, having separate threads per watched tree is not necessary, and just consumes system resources. Each platform supports watching multiple directories with the same platform-specific watcher API, so each platform has been updated accordingly. The interface to the FileWatcher class is greatly simplified. Previously, it supported client-supplied filtering of the paths that would generate notifications. This was done by subclassing `FolderWatchBase` and implementing `OnFileChange`. However, only one filter was ever used, so that filter is now hard-coded in the FileWatcher class, and the classes driving the old filtering mechanism are removed. Users of the interface now have a much easier time, they just call `AddFolderWatch` with the path to watch, and only have to connect to one set of signals, instead of separate signals per watched directory. Signed-off-by: Chris Burel --- .../Linux/assetprocessor_linux_files.cmake | 2 + .../native/FileWatcher/FileWatcher_linux.cpp | 287 +++++++----------- .../native/FileWatcher/FileWatcher_linux.h | 26 ++ .../native/FileWatcher/FileWatcher_platform.h | 11 + .../Mac/assetprocessor_mac_files.cmake | 2 + .../Mac/native/FileWatcher/FileWatcher_mac.h | 20 ++ .../native/FileWatcher/FileWatcher_macos.cpp | 84 ++--- .../native/FileWatcher/FileWatcher_platform.h | 11 + .../native/FileWatcher/FileWatcher_win.cpp | 130 -------- .../assetprocessor_windows_files.cmake | 2 + .../native/FileWatcher/FileWatcher_platform.h | 11 + .../native/FileWatcher/FileWatcher_win.cpp | 199 ++++++------ .../native/FileWatcher/FileWatcher_windows.h | 65 ++++ .../assetprocessor_static_files.cmake | 1 - .../native/FileWatcher/FileWatcher.cpp | 248 ++++++++------- .../native/FileWatcher/FileWatcher.h | 96 +++--- .../native/FileWatcher/FileWatcherAPI.h | 222 -------------- .../native/unittests/FileWatcherUnitTests.cpp | 16 +- .../native/utilities/ApplicationManager.h | 1 - .../utilities/ApplicationManagerBase.cpp | 98 +++--- .../native/utilities/ApplicationManagerBase.h | 3 - .../native/utilities/AssetBuilderInfo.h | 1 - 22 files changed, 631 insertions(+), 905 deletions(-) create mode 100644 Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.h create mode 100644 Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_platform.h create mode 100644 Code/Tools/AssetProcessor/Platform/Mac/native/FileWatcher/FileWatcher_mac.h create mode 100644 Code/Tools/AssetProcessor/Platform/Mac/native/FileWatcher/FileWatcher_platform.h delete mode 100644 Code/Tools/AssetProcessor/Platform/Mac/native/FileWatcher/FileWatcher_win.cpp create mode 100644 Code/Tools/AssetProcessor/Platform/Windows/native/FileWatcher/FileWatcher_platform.h create mode 100644 Code/Tools/AssetProcessor/Platform/Windows/native/FileWatcher/FileWatcher_windows.h delete mode 100644 Code/Tools/AssetProcessor/native/FileWatcher/FileWatcherAPI.h diff --git a/Code/Tools/AssetProcessor/Platform/Linux/assetprocessor_linux_files.cmake b/Code/Tools/AssetProcessor/Platform/Linux/assetprocessor_linux_files.cmake index 25f5c41445..b21393bcaa 100644 --- a/Code/Tools/AssetProcessor/Platform/Linux/assetprocessor_linux_files.cmake +++ b/Code/Tools/AssetProcessor/Platform/Linux/assetprocessor_linux_files.cmake @@ -8,4 +8,6 @@ set(FILES native/FileWatcher/FileWatcher_linux.cpp + native/FileWatcher/FileWatcher_linux.h + native/FileWatcher/FileWatcher_platform.h ) diff --git a/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.cpp b/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.cpp index d20bb6c5b4..7d38372e18 100644 --- a/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.cpp +++ b/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.cpp @@ -5,7 +5,10 @@ * SPDX-License-Identifier: Apache-2.0 OR MIT * */ + +#include #include +#include #include #include @@ -15,180 +18,127 @@ #include -static constexpr int s_handleToFolderMapLockTimeout = 1000; // 1 sec timeout for obtaining the handle to folder map lock -static constexpr size_t s_iNotifyMaxEntries = 1024 * 16; // Control the maximum number of entries (from inotify) that can be read at one time -static constexpr size_t s_iNotifyEventSize = sizeof(struct inotify_event); -static constexpr size_t s_iNotifyReadBufferSize = s_iNotifyMaxEntries * s_iNotifyEventSize; +static constexpr size_t s_inotifyMaxEntries = 1024 * 16; // Control the maximum number of entries (from inotify) that can be read at one time +static constexpr size_t s_inotifyEventSize = sizeof(struct inotify_event); +static constexpr size_t s_inotifyReadBufferSize = s_inotifyMaxEntries * s_inotifyEventSize; -struct FolderRootWatch::PlatformImplementation +bool FileWatcher::PlatformImplementation::Initialize() { - PlatformImplementation() = default; - - int m_iNotifyHandle = -1; - QMutex m_handleToFolderMapLock; - QHash m_handleToFolderMap; - - bool Initialize() + if (m_inotifyHandle < 0) { - if (m_iNotifyHandle < 0) - { - // The CLOEXEC flag prevents the inotify watchers from copying on fork/exec - m_iNotifyHandle = inotify_init1(IN_CLOEXEC); - const auto err = errno; + // The CLOEXEC flag prevents the inotify watchers from copying on fork/exec + m_inotifyHandle = inotify_init1(IN_CLOEXEC); - if (m_iNotifyHandle < 0) - { - AZ_Warning("FileWatcher", false, "Unable to initialize inotify, file monitoring will not be available: %s\n", strerror(err)); - } - } - return (m_iNotifyHandle >= 0); + [[maybe_unused]] const auto err = errno; + [[maybe_unused]] AZStd::fixed_string<255> errorString; + AZ_Warning("FileWatcher", (m_inotifyHandle >= 0), "Unable to initialize inotify, file monitoring will not be available: %s\n", strerror_r(err, errorString.data(), errorString.capacity())); } + return (m_inotifyHandle >= 0); +} - void Finalize() +void FileWatcher::PlatformImplementation::Finalize() +{ + if (m_inotifyHandle < 0) { - if (m_iNotifyHandle >= 0) - { - if (!m_handleToFolderMapLock.tryLock(s_handleToFolderMapLockTimeout)) - { - AZ_Error("FileWatcher", false, "Unable to obtain inotify handle lock on thread"); - return; - } - - QHashIterator iter(m_handleToFolderMap); - while (iter.hasNext()) - { - iter.next(); - int watchHandle = iter.key(); - inotify_rm_watch(m_iNotifyHandle, watchHandle); - } - m_handleToFolderMap.clear(); - m_handleToFolderMapLock.unlock(); - - ::close(m_iNotifyHandle); - m_iNotifyHandle = -1; - } + return; } - void AddWatchFolder(QString folder, bool recursive) { - if (m_iNotifyHandle >= 0) + QMutexLocker lock{&m_handleToFolderMapLock}; + for (const auto& watchHandle : m_handleToFolderMap.keys()) { - // Clean up the path before accepting it as a watch folder - QString cleanPath = QDir::cleanPath(folder); + inotify_rm_watch(m_inotifyHandle, watchHandle); + } + m_handleToFolderMap.clear(); + } - // Add the folder to watch and track it - int watchHandle = inotify_add_watch(m_iNotifyHandle, - cleanPath.toUtf8().constData(), - IN_CREATE | IN_CLOSE_WRITE | IN_DELETE | IN_DELETE_SELF | IN_MODIFY | IN_MOVE); - - if (watchHandle < 0) - { - AZ_Error("FileWatcher", false, "inotify_add_watch failed for path %s", cleanPath.toUtf8().constData()); - return; - } - if (!m_handleToFolderMapLock.tryLock(s_handleToFolderMapLockTimeout)) - { - AZ_Error("FileWatcher", false, "Unable to obtain inotify handle lock on thread"); - return; - } - m_handleToFolderMap[watchHandle] = cleanPath; - m_handleToFolderMapLock.unlock(); + ::close(m_inotifyHandle); + m_inotifyHandle = -1; +} - if (!recursive) - { - return; - } +void FileWatcher::PlatformImplementation::AddWatchFolder(QString folder, bool recursive) +{ + if (m_inotifyHandle < 0) + { + return; + } - // Add all the subfolders to watch and track them - QDirIterator dirIter(folder, QDirIterator::Subdirectories | QDirIterator::FollowSymlinks); + // Clean up the path before accepting it as a watch folder + QString cleanPath = QDir::cleanPath(folder); - while (dirIter.hasNext()) - { - QString dirName = dirIter.next(); - if (dirName.endsWith("/.") || dirName.endsWith("/..")) - { - continue; - } - - int watchHandle = inotify_add_watch(m_iNotifyHandle, - dirName.toUtf8().constData(), - IN_CREATE | IN_CLOSE_WRITE | IN_DELETE | IN_DELETE_SELF | IN_MODIFY | IN_MOVE); - if (watchHandle < 0) - { - AZ_Error("FileWatcher", false, "inotify_add_watch failed for path %s", dirName.toUtf8().constData()); - return; - } + // Add the folder to watch and track it + int watchHandle = inotify_add_watch(m_inotifyHandle, + cleanPath.toUtf8().constData(), + IN_CREATE | IN_CLOSE_WRITE | IN_DELETE | IN_DELETE_SELF | IN_MODIFY | IN_MOVE); - if (!m_handleToFolderMapLock.tryLock(s_handleToFolderMapLockTimeout)) - { - AZ_Error("FileWatcher", false, "Unable to obtain inotify handle lock on thread"); - return; - } - m_handleToFolderMap[watchHandle] = dirName; - m_handleToFolderMapLock.unlock(); - } - } + if (watchHandle < 0) + { + [[maybe_unused]] const auto err = errno; + [[maybe_unused]] AZStd::fixed_string<255> errorString; + AZ_Warning("FileWatcher", false, "inotify_add_watch failed for path %s: %s", cleanPath.toUtf8().constData(), strerror_r(err, errorString.data(), errorString.capacity())); + return; } - - void RemoveWatchFolder(int watchHandle) { - if (m_iNotifyHandle >= 0) - { - if (!m_handleToFolderMapLock.tryLock(s_handleToFolderMapLockTimeout)) - { - AZ_Error("FileWatcher", false, "Unable to obtain inotify handle lock on thread"); - return; - } + QMutexLocker lock{&m_handleToFolderMapLock}; + m_handleToFolderMap[watchHandle] = cleanPath; + } - QHash::iterator handleToRemove = m_handleToFolderMap.find(watchHandle); - if (handleToRemove != m_handleToFolderMap.end()) - { - inotify_rm_watch(m_iNotifyHandle, watchHandle); - m_handleToFolderMap.erase(handleToRemove); - } + // Add all the contents (files and directories) to watch and track them + QDirIterator dirIter(folder, QDir::NoDotAndDotDot | QDir::Dirs | QDir::Files, (recursive ? QDirIterator::Subdirectories : QDirIterator::NoIteratorFlags) | QDirIterator::FollowSymlinks); + + while (dirIter.hasNext()) + { + QString dirName = dirIter.next(); - m_handleToFolderMapLock.unlock(); + watchHandle = inotify_add_watch(m_inotifyHandle, + dirName.toUtf8().constData(), + IN_CREATE | IN_CLOSE_WRITE | IN_DELETE | IN_DELETE_SELF | IN_MODIFY | IN_MOVE); + if (watchHandle < 0) + { + [[maybe_unused]] const auto err = errno; + [[maybe_unused]] AZStd::fixed_string<255> errorString; + AZ_Warning("FileWatcher", false, "inotify_add_watch failed for path %s: %s", dirName.toUtf8().constData(), strerror_r(err, errorString.data(), errorString.capacity())); + return; } - } -}; -////////////////////////////////////////////////////////////////////////////// -/// FolderWatchRoot -FolderRootWatch::FolderRootWatch(const QString rootFolder, bool recursive) - : m_root(rootFolder) - , m_shutdownThreadSignal(false) - , m_fileWatcher(nullptr) - , m_recursive(recursive) - , m_platformImpl(new PlatformImplementation()) -{ + QMutexLocker lock{&m_handleToFolderMapLock}; + m_handleToFolderMap[watchHandle] = dirName; + } } -FolderRootWatch::~FolderRootWatch() +void FileWatcher::PlatformImplementation::RemoveWatchFolder(int watchHandle) { - // Destructor is required in here since this file contains the definition of struct PlatformImplementation - Stop(); + if (m_inotifyHandle < 0) + { + return; + } - delete m_platformImpl; + QMutexLocker lock{&m_handleToFolderMapLock}; + if (m_handleToFolderMap.remove(watchHandle)) + { + inotify_rm_watch(m_inotifyHandle, watchHandle); + } } -bool FolderRootWatch::Start() +bool FileWatcher::PlatformStart() { // inotify will be used by linux to monitor file changes within directories under the root folder if (!m_platformImpl->Initialize()) { return false; } - m_platformImpl->AddWatchFolder(m_root, m_recursive); - - m_shutdownThreadSignal = false; - if (m_platformImpl->m_iNotifyHandle >= 0) + for (const auto& [directory, recursive] : m_folderWatchRoots) { - m_thread = std::thread([this]() { WatchFolderLoop(); }); + if (QDir(directory).exists()) + { + m_platformImpl->AddWatchFolder(directory, recursive); + } } + return true; } -void FolderRootWatch::Stop() +void FileWatcher::PlatformStop() { m_shutdownThreadSignal = true; @@ -197,64 +147,63 @@ void FolderRootWatch::Stop() if (m_thread.joinable()) { m_thread.join(); // wait for the thread to finish - m_thread = std::thread(); //destroy } } -void FolderRootWatch::WatchFolderLoop() +void FileWatcher::WatchFolderLoop() { - char eventBuffer[s_iNotifyReadBufferSize]; + char eventBuffer[s_inotifyReadBufferSize]; while (!m_shutdownThreadSignal) { - ssize_t bytesRead = ::read(m_platformImpl->m_iNotifyHandle, eventBuffer, s_iNotifyReadBufferSize); + ssize_t bytesRead = ::read(m_platformImpl->m_inotifyHandle, eventBuffer, s_inotifyReadBufferSize); if (bytesRead < 0) { // Break out of the loop when the notify handle was closed (outside of this thread) break; } - else if (bytesRead > 0) + if (!bytesRead) + { + continue; + } + for (size_t index=0; index(&eventBuffer[index]); + + if (event->mask & (IN_CREATE | IN_DELETE | IN_MODIFY | IN_MOVE)) { - struct inotify_event *event = ( struct inotify_event * ) &eventBuffer[ index ]; + const QString pathStr = QDir(m_platformImpl->m_handleToFolderMap[event->wd]).absoluteFilePath(event->name); - if (event->mask & (IN_CREATE | IN_DELETE | IN_MODIFY | IN_MOVE )) + if (event->mask & (IN_CREATE | IN_MOVED_TO)) { - QString pathStr = QString("%1%2%3").arg(m_platformImpl->m_handleToFolderMap[event->wd], QDir::separator(), event->name); - - if (event->mask & (IN_CREATE | IN_MOVED_TO)) + if (event->mask & IN_ISDIR /*&& m_recursive*/) + { + // New Directory, add it to the watch + m_platformImpl->AddWatchFolder(pathStr, true); + } + else { - if ( event->mask & IN_ISDIR && m_recursive) - { - // New Directory, add it to the watch - m_platformImpl->AddWatchFolder(pathStr, true); - } - else - { - ProcessNewFileEvent(pathStr); - } + rawFileAdded(pathStr, {}); } - else if (event->mask & (IN_DELETE | IN_MOVED_FROM)) + } + else if (event->mask & (IN_DELETE | IN_MOVED_FROM)) + { + if (event->mask & IN_ISDIR) { - if (event->mask & IN_ISDIR) - { - // Directory Deleted, remove it from the watch - m_platformImpl->RemoveWatchFolder(event->wd); - } - else - { - ProcessDeleteFileEvent(pathStr); - } + // Directory Deleted, remove it from the watch + m_platformImpl->RemoveWatchFolder(event->wd); } - else if ((event->mask & IN_MODIFY) && ((event->mask & IN_ISDIR) != IN_ISDIR)) + else { - ProcessModifyFileEvent(pathStr); + rawFileRemoved(pathStr, {}); } } - index += s_iNotifyEventSize + event->len; + else if ((event->mask & IN_MODIFY) && ((event->mask & IN_ISDIR) != IN_ISDIR)) + { + rawFileModified(pathStr, {}); + } } + index += s_inotifyEventSize + event->len; } } } - diff --git a/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.h b/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.h new file mode 100644 index 0000000000..a6fead401c --- /dev/null +++ b/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include +#include + +class FileWatcher::PlatformImplementation +{ +public: + bool Initialize(); + void Finalize(); + void AddWatchFolder(QString folder, bool recursive); + void RemoveWatchFolder(int watchHandle); + + int m_inotifyHandle = -1; + QMutex m_handleToFolderMapLock; + QHash m_handleToFolderMap; +}; diff --git a/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_platform.h b/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_platform.h new file mode 100644 index 0000000000..e3cb91d73a --- /dev/null +++ b/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_platform.h @@ -0,0 +1,11 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include diff --git a/Code/Tools/AssetProcessor/Platform/Mac/assetprocessor_mac_files.cmake b/Code/Tools/AssetProcessor/Platform/Mac/assetprocessor_mac_files.cmake index 0f20ef2f38..476bcde500 100644 --- a/Code/Tools/AssetProcessor/Platform/Mac/assetprocessor_mac_files.cmake +++ b/Code/Tools/AssetProcessor/Platform/Mac/assetprocessor_mac_files.cmake @@ -8,4 +8,6 @@ set(FILES native/FileWatcher/FileWatcher_macos.cpp + native/FileWatcher/FileWatcher_mac.h + native/FileWatcher/FileWatcher_platform.h ) diff --git a/Code/Tools/AssetProcessor/Platform/Mac/native/FileWatcher/FileWatcher_mac.h b/Code/Tools/AssetProcessor/Platform/Mac/native/FileWatcher/FileWatcher_mac.h new file mode 100644 index 0000000000..ade2497c4d --- /dev/null +++ b/Code/Tools/AssetProcessor/Platform/Mac/native/FileWatcher/FileWatcher_mac.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include + +#include + +class FileWatcher::PlatformImplementation +{ +public: + FSEventStreamRef m_stream = nullptr; + CFRunLoopRef m_runLoop = nullptr; +}; diff --git a/Code/Tools/AssetProcessor/Platform/Mac/native/FileWatcher/FileWatcher_macos.cpp b/Code/Tools/AssetProcessor/Platform/Mac/native/FileWatcher/FileWatcher_macos.cpp index 1dd6e65a15..47b344ff81 100644 --- a/Code/Tools/AssetProcessor/Platform/Mac/native/FileWatcher/FileWatcher_macos.cpp +++ b/Code/Tools/AssetProcessor/Platform/Mac/native/FileWatcher/FileWatcher_macos.cpp @@ -6,47 +6,23 @@ * */ #include +#include #include #include -#include void FileEventStreamCallback(ConstFSEventStreamRef streamRef, void *clientCallBackInfo, size_t numEvents, void *eventPaths, const FSEventStreamEventFlags eventFlags[], const FSEventStreamEventId eventIds[]); -struct FolderRootWatch::PlatformImplementation -{ - PlatformImplementation() : m_stream(nullptr), m_runLoop(nullptr) { } - - FSEventStreamRef m_stream; - CFRunLoopRef m_runLoop; - QString m_renameFileDirectory; -}; - -////////////////////////////////////////////////////////////////////////////// -/// FolderWatchRoot -FolderRootWatch::FolderRootWatch(const QString rootFolder) - : m_root(rootFolder) - , m_shutdownThreadSignal(false) - , m_fileWatcher(nullptr) - , m_platformImpl(new PlatformImplementation()) -{ -} - -FolderRootWatch::~FolderRootWatch() -{ - // Destructor is required in here since this file contains the definition of struct PlatformImplementation - Stop(); - - delete m_platformImpl; -} - -bool FolderRootWatch::Start() +bool FileWatcher::PlatformStart() { m_shutdownThreadSignal = false; - CFStringRef rootPath = CFStringCreateWithCString(kCFAllocatorDefault, m_root.toStdString().data(), kCFStringEncodingMacRoman); - CFArrayRef pathsToWatch = CFArrayCreate(NULL, (const void **)&rootPath, 1, NULL); + CFMutableArrayRef pathsToWatch = CFArrayCreateMutable(nullptr, this->m_folderWatchRoots.size(), nullptr); + for (const auto& root : this->m_folderWatchRoots) + { + CFArrayAppendValue(pathsToWatch, root.m_directory.toCFString()); + } // The larger this number, the larger the delay between the kernel knowing a file changed // and us actually consuming the event. It is very important for asset processor to deal with @@ -60,11 +36,12 @@ bool FolderRootWatch::Start() // Set ourselves as the value for the context info field so that in the callback // we get passed into it and the callback can call our public API to handle // the file change events - FSEventStreamContext streamContext; - ::memset(&streamContext, 0, sizeof(streamContext)); - streamContext.info = this; + FSEventStreamContext streamContext{ + /*.version =*/ 0, + /*.info =*/ this, + }; - m_platformImpl->m_stream = FSEventStreamCreate(NULL, + m_platformImpl->m_stream = FSEventStreamCreate(nullptr, FileEventStreamCallback, &streamContext, pathsToWatch, @@ -72,24 +49,25 @@ bool FolderRootWatch::Start() timeBetweenKernelUpdateAndNotification, kFSEventStreamCreateFlagFileEvents); - AZ_Error("FileWatcher", (m_platformImpl->m_stream != nullptr), "FSEventStreamCreate returned a nullptr. No file events will be reported for %s", m_root.toStdString().c_str()); - - m_thread = std::thread(std::bind(&FolderRootWatch::WatchFolderLoop, this)); + AZ_Error("FileWatcher", (m_platformImpl->m_stream != nullptr), "FSEventStreamCreate returned a nullptr. No file events will be reported."); + const CFIndex pathCount = CFArrayGetCount(pathsToWatch); + for(CFIndex i = 0; i < pathCount; ++i) + { + CFRelease(CFArrayGetValueAtIndex(pathsToWatch, i)); + } CFRelease(pathsToWatch); - CFRelease(rootPath); - return (m_platformImpl->m_stream != nullptr); + return m_platformImpl->m_stream != nullptr; } -void FolderRootWatch::Stop() +void FileWatcher::PlatformStop() { m_shutdownThreadSignal = true; if (m_thread.joinable()) { m_thread.join(); // wait for the thread to finish - m_thread = std::thread(); //destroy } FSEventStreamStop(m_platformImpl->m_stream); @@ -97,7 +75,7 @@ void FolderRootWatch::Stop() FSEventStreamRelease(m_platformImpl->m_stream); } -void FolderRootWatch::WatchFolderLoop() +void FileWatcher::WatchFolderLoop() { // Use a half second timeout interval so that we can check if // m_shutdownThreadSignal has been changed while we were running the RunLoop @@ -117,14 +95,14 @@ void FolderRootWatch::WatchFolderLoop() void FileEventStreamCallback(ConstFSEventStreamRef streamRef, void *clientCallBackInfo, size_t numEvents, void *eventPaths, const FSEventStreamEventFlags eventFlags[], const FSEventStreamEventId eventIds[]) { - FolderRootWatch* watcher = reinterpret_cast(clientCallBackInfo); + auto* watcher = reinterpret_cast(clientCallBackInfo); const char** filePaths = reinterpret_cast(eventPaths); for (int i = 0; i < numEvents; ++i) { - QFileInfo fileInfo(QDir::cleanPath(filePaths[i])); - QString fileAndPath = fileInfo.absoluteFilePath(); + const QFileInfo fileInfo(QDir::cleanPath(filePaths[i])); + const QString fileAndPath = fileInfo.absoluteFilePath(); if (!fileInfo.isHidden()) { @@ -133,38 +111,38 @@ void FileEventStreamCallback(ConstFSEventStreamRef streamRef, void *clientCallBa // so check for all of them if (eventFlags[i] & kFSEventStreamEventFlagItemCreated) { - watcher->ProcessNewFileEvent(fileAndPath); + watcher->rawFileAdded(fileAndPath, {}); } if (eventFlags[i] & kFSEventStreamEventFlagItemModified) { - watcher->ProcessModifyFileEvent(fileAndPath); + watcher->rawFileModified(fileAndPath, {}); } if (eventFlags[i] & kFSEventStreamEventFlagItemRemoved) { - watcher->ProcessDeleteFileEvent(fileAndPath); + watcher->rawFileRemoved(fileAndPath, {}); } if (eventFlags[i] & kFSEventStreamEventFlagItemRenamed) { if (fileInfo.exists()) { - watcher->ProcessNewFileEvent(fileAndPath); + watcher->rawFileAdded(fileAndPath, {}); // macOS does not send out an event for the directory being // modified when a file has been renamed but the FileWatcher // API expects it so send out the modification event ourselves. - watcher->ProcessModifyFileEvent(fileInfo.absolutePath()); + watcher->rawFileModified(fileInfo.absolutePath(), {}); } else { - watcher->ProcessDeleteFileEvent(fileAndPath); + watcher->rawFileRemoved(fileAndPath, {}); // macOS does not send out an event for the directory being // modified when a file has been renamed but the FileWatcher // API expects it so send out the modification event ourselves. - watcher->ProcessModifyFileEvent(fileInfo.absolutePath()); + watcher->rawFileModified(fileInfo.absolutePath(), {}); } } } diff --git a/Code/Tools/AssetProcessor/Platform/Mac/native/FileWatcher/FileWatcher_platform.h b/Code/Tools/AssetProcessor/Platform/Mac/native/FileWatcher/FileWatcher_platform.h new file mode 100644 index 0000000000..58b60354e7 --- /dev/null +++ b/Code/Tools/AssetProcessor/Platform/Mac/native/FileWatcher/FileWatcher_platform.h @@ -0,0 +1,11 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include diff --git a/Code/Tools/AssetProcessor/Platform/Mac/native/FileWatcher/FileWatcher_win.cpp b/Code/Tools/AssetProcessor/Platform/Mac/native/FileWatcher/FileWatcher_win.cpp deleted file mode 100644 index a6b0841f05..0000000000 --- a/Code/Tools/AssetProcessor/Platform/Mac/native/FileWatcher/FileWatcher_win.cpp +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * 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 - -struct FolderRootWatch::PlatformImplementation -{ - PlatformImplementation() : m_directoryHandle(nullptr), m_ioHandle(nullptr) { } - HANDLE m_directoryHandle; - HANDLE m_ioHandle; -}; - -////////////////////////////////////////////////////////////////////////////// -/// FolderWatchRoot -FolderRootWatch::FolderRootWatch(const QString rootFolder) - : m_root(rootFolder) - , m_shutdownThreadSignal(false) - , m_fileWatcher(nullptr) - , m_platformImpl(new PlatformImplementation()) -{ -} - -FolderRootWatch::~FolderRootWatch() -{ - // Destructor is required in here since this file contains the definition of struct PlatformImplementation - Stop(); - - delete m_platformImpl; -} - -bool FolderRootWatch::Start() -{ - m_platformImpl->m_directoryHandle = ::CreateFileW(m_root.toStdWString().data(), FILE_LIST_DIRECTORY, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, nullptr, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OVERLAPPED, nullptr); - - if (m_platformImpl->m_directoryHandle != INVALID_HANDLE_VALUE) - { - m_platformImpl->m_ioHandle = ::CreateIoCompletionPort(m_platformImpl->m_directoryHandle, nullptr, 1, 0); - if (m_platformImpl->m_ioHandle != INVALID_HANDLE_VALUE) - { - m_shutdownThreadSignal = false; - m_thread = std::thread(std::bind(&FolderRootWatch::WatchFolderLoop, this)); - return true; - } - } - return false; -} - -void FolderRootWatch::Stop() -{ - m_shutdownThreadSignal = true; - CloseHandle(m_platformImpl->m_ioHandle); - m_platformImpl->m_ioHandle = nullptr; - - if (m_thread.joinable()) - { - m_thread.join(); // wait for the thread to finish - m_thread = std::thread(); //destroy - } - CloseHandle(m_platformImpl->m_directoryHandle); - m_platformImpl->m_directoryHandle = nullptr; -} - -void FolderRootWatch::WatchFolderLoop() -{ - FILE_NOTIFY_INFORMATION aFileNotifyInformationList[50000]; - QString path; - OVERLAPPED aOverlapped; - LPOVERLAPPED pOverlapped; - DWORD dwByteCount; - ULONG_PTR ulKey; - - while (!m_shutdownThreadSignal) - { - ::memset(aFileNotifyInformationList, 0, sizeof(aFileNotifyInformationList)); - ::memset(&aOverlapped, 0, sizeof(aOverlapped)); - - if (::ReadDirectoryChangesW(m_platformImpl->m_directoryHandle, aFileNotifyInformationList, sizeof(aFileNotifyInformationList), true, FILE_NOTIFY_CHANGE_LAST_WRITE | FILE_NOTIFY_CHANGE_DIR_NAME | FILE_NOTIFY_CHANGE_ATTRIBUTES | FILE_NOTIFY_CHANGE_FILE_NAME, nullptr, &aOverlapped, nullptr)) - { - //wait for up to a second for I/O to signal - dwByteCount = 0; - if (::GetQueuedCompletionStatus(m_platformImpl->m_ioHandle, &dwByteCount, &ulKey, &pOverlapped, INFINITE)) - { - //if we are signaled to shutdown bypass - if (!m_shutdownThreadSignal && ulKey) - { - if (dwByteCount) - { - int offset = 0; - FILE_NOTIFY_INFORMATION* pFileNotifyInformation = aFileNotifyInformationList; - do - { - pFileNotifyInformation = (FILE_NOTIFY_INFORMATION*)((char*)pFileNotifyInformation + offset); - - path.clear(); - path.append(m_root); - path.append(QString::fromWCharArray(pFileNotifyInformation->FileName, pFileNotifyInformation->FileNameLength / 2)); - - QString file = QDir::toNativeSeparators(QDir::cleanPath(path)); - - switch (pFileNotifyInformation->Action) - { - case FILE_ACTION_ADDED: - case FILE_ACTION_RENAMED_NEW_NAME: - ProcessNewFileEvent(file); - break; - case FILE_ACTION_REMOVED: - case FILE_ACTION_RENAMED_OLD_NAME: - ProcessDeleteFileEvent(file); - break; - case FILE_ACTION_MODIFIED: - ProcessModifyFileEvent(file); - break; - } - - offset = pFileNotifyInformation->NextEntryOffset; - } while (offset); - } - } - } - } - } -} - diff --git a/Code/Tools/AssetProcessor/Platform/Windows/assetprocessor_windows_files.cmake b/Code/Tools/AssetProcessor/Platform/Windows/assetprocessor_windows_files.cmake index 5d1f4d1eed..2bd9fa6470 100644 --- a/Code/Tools/AssetProcessor/Platform/Windows/assetprocessor_windows_files.cmake +++ b/Code/Tools/AssetProcessor/Platform/Windows/assetprocessor_windows_files.cmake @@ -7,6 +7,8 @@ # set(FILES + native/FileWatcher/FileWatcher_platform.h native/FileWatcher/FileWatcher_win.cpp + native/FileWatcher/FileWatcher_windows.h native/resource.h ) diff --git a/Code/Tools/AssetProcessor/Platform/Windows/native/FileWatcher/FileWatcher_platform.h b/Code/Tools/AssetProcessor/Platform/Windows/native/FileWatcher/FileWatcher_platform.h new file mode 100644 index 0000000000..5fe5f05f87 --- /dev/null +++ b/Code/Tools/AssetProcessor/Platform/Windows/native/FileWatcher/FileWatcher_platform.h @@ -0,0 +1,11 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include diff --git a/Code/Tools/AssetProcessor/Platform/Windows/native/FileWatcher/FileWatcher_win.cpp b/Code/Tools/AssetProcessor/Platform/Windows/native/FileWatcher/FileWatcher_win.cpp index a6b0841f05..b7d1d4c74c 100644 --- a/Code/Tools/AssetProcessor/Platform/Windows/native/FileWatcher/FileWatcher_win.cpp +++ b/Code/Tools/AssetProcessor/Platform/Windows/native/FileWatcher/FileWatcher_win.cpp @@ -6,125 +6,148 @@ * */ +#include +#include #include +#include +#include -#include - -struct FolderRootWatch::PlatformImplementation -{ - PlatformImplementation() : m_directoryHandle(nullptr), m_ioHandle(nullptr) { } - HANDLE m_directoryHandle; - HANDLE m_ioHandle; -}; - -////////////////////////////////////////////////////////////////////////////// -/// FolderWatchRoot -FolderRootWatch::FolderRootWatch(const QString rootFolder) - : m_root(rootFolder) - , m_shutdownThreadSignal(false) - , m_fileWatcher(nullptr) - , m_platformImpl(new PlatformImplementation()) +bool FileWatcher::PlatformStart() { + m_shutdownThreadSignal = false; + + bool allSucceeded = true; + for (const auto& [directory, recursive] : m_folderWatchRoots) + { + if (QDir(directory).exists()) + { + allSucceeded &= m_platformImpl->AddWatchFolder(directory, recursive); + } + } + return allSucceeded; } -FolderRootWatch::~FolderRootWatch() +bool FileWatcher::PlatformImplementation::AddWatchFolder(QString root, bool recursive) { - // Destructor is required in here since this file contains the definition of struct PlatformImplementation - Stop(); + HandleUniquePtr directoryHandle{::CreateFileW( + root.toStdWString().data(), + FILE_LIST_DIRECTORY, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + nullptr, + OPEN_EXISTING, + FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OVERLAPPED, + nullptr + )}; + + if (directoryHandle.get() == INVALID_HANDLE_VALUE) + { + AZ_Warning("FileWatcher", false, "Failed to start watching %s", root.toUtf8().constData()); + return false; + } - delete m_platformImpl; -} + // Associate this file handle with our existing io completion port handle + if (!::CreateIoCompletionPort(directoryHandle.get(), m_ioHandle.get(), /*CompletionKey =*/ static_cast(PlatformImplementation::EventType::FileRead), 1)) + { + return false; + } -bool FolderRootWatch::Start() -{ - m_platformImpl->m_directoryHandle = ::CreateFileW(m_root.toStdWString().data(), FILE_LIST_DIRECTORY, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, nullptr, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OVERLAPPED, nullptr); + auto id = AZStd::make_unique(); + auto* idp = id.get(); + const auto& [folderWatch, inserted] = m_folderRootWatches.emplace(AZStd::piecewise_construct, AZStd::forward_as_tuple(idp), + AZStd::forward_as_tuple(AZStd::move(id), AZStd::move(directoryHandle), root, recursive)); - if (m_platformImpl->m_directoryHandle != INVALID_HANDLE_VALUE) + if (!inserted) { - m_platformImpl->m_ioHandle = ::CreateIoCompletionPort(m_platformImpl->m_directoryHandle, nullptr, 1, 0); - if (m_platformImpl->m_ioHandle != INVALID_HANDLE_VALUE) - { - m_shutdownThreadSignal = false; - m_thread = std::thread(std::bind(&FolderRootWatch::WatchFolderLoop, this)); - return true; - } + return false; } - return false; + + return folderWatch->second.ReadChanges(); } -void FolderRootWatch::Stop() +bool FileWatcher::PlatformImplementation::FolderRootWatch::ReadChanges() +{ + // Register to get directory change notifications for our directory handle + return ::ReadDirectoryChangesW( + m_directoryHandle.get(), + &m_fileNotifyInformationList, + sizeof(m_fileNotifyInformationList), + m_recursive, + FILE_NOTIFY_CHANGE_LAST_WRITE | FILE_NOTIFY_CHANGE_DIR_NAME | FILE_NOTIFY_CHANGE_ATTRIBUTES | FILE_NOTIFY_CHANGE_FILE_NAME, + nullptr, + m_overlapped.get(), + nullptr + ); +} + +void FileWatcher::PlatformStop() { m_shutdownThreadSignal = true; - CloseHandle(m_platformImpl->m_ioHandle); - m_platformImpl->m_ioHandle = nullptr; + // Send a special signal to the child thread, that is blocked in a GetQueuedCompletionStatus call, with a completion + // key set to Shutdown. The child thread will stop its processing when it receives this value for the completion key + PostQueuedCompletionStatus(m_platformImpl->m_ioHandle.get(), 0, /*CompletionKey =*/ static_cast(PlatformImplementation::EventType::Shutdown), nullptr); if (m_thread.joinable()) { m_thread.join(); // wait for the thread to finish - m_thread = std::thread(); //destroy } - CloseHandle(m_platformImpl->m_directoryHandle); - m_platformImpl->m_directoryHandle = nullptr; } -void FolderRootWatch::WatchFolderLoop() +void FileWatcher::WatchFolderLoop() { - FILE_NOTIFY_INFORMATION aFileNotifyInformationList[50000]; - QString path; - OVERLAPPED aOverlapped; - LPOVERLAPPED pOverlapped; - DWORD dwByteCount; - ULONG_PTR ulKey; + LPOVERLAPPED directoryId = nullptr; + ULONG_PTR completionKey = 0; while (!m_shutdownThreadSignal) { - ::memset(aFileNotifyInformationList, 0, sizeof(aFileNotifyInformationList)); - ::memset(&aOverlapped, 0, sizeof(aOverlapped)); - - if (::ReadDirectoryChangesW(m_platformImpl->m_directoryHandle, aFileNotifyInformationList, sizeof(aFileNotifyInformationList), true, FILE_NOTIFY_CHANGE_LAST_WRITE | FILE_NOTIFY_CHANGE_DIR_NAME | FILE_NOTIFY_CHANGE_ATTRIBUTES | FILE_NOTIFY_CHANGE_FILE_NAME, nullptr, &aOverlapped, nullptr)) + DWORD dwByteCount = 0; + if (::GetQueuedCompletionStatus(m_platformImpl->m_ioHandle.get(), &dwByteCount, &completionKey, &directoryId, INFINITE)) { - //wait for up to a second for I/O to signal - dwByteCount = 0; - if (::GetQueuedCompletionStatus(m_platformImpl->m_ioHandle, &dwByteCount, &ulKey, &pOverlapped, INFINITE)) + if (m_shutdownThreadSignal || completionKey == static_cast(PlatformImplementation::EventType::Shutdown)) + { + break; + } + if (dwByteCount == 0) + { + continue; + } + + const auto foundFolderRoot = m_platformImpl->m_folderRootWatches.find(directoryId); + if (foundFolderRoot == end(m_platformImpl->m_folderRootWatches)) { - //if we are signaled to shutdown bypass - if (!m_shutdownThreadSignal && ulKey) + continue; + } + + PlatformImplementation::FolderRootWatch& folderRoot = foundFolderRoot->second; + + // Initialize offset to 1 to ensure that the first iteration is always processed + DWORD offset = 1; + for ( + const FILE_NOTIFY_INFORMATION* pFileNotifyInformation = reinterpret_cast(&folderRoot.m_fileNotifyInformationList); + offset; + pFileNotifyInformation = reinterpret_cast(reinterpret_cast(pFileNotifyInformation) + offset) + ){ + const QString file = QDir::toNativeSeparators(QDir(folderRoot.m_directoryRoot) + .filePath(QString::fromWCharArray(pFileNotifyInformation->FileName, pFileNotifyInformation->FileNameLength / 2))); + + switch (pFileNotifyInformation->Action) { - if (dwByteCount) - { - int offset = 0; - FILE_NOTIFY_INFORMATION* pFileNotifyInformation = aFileNotifyInformationList; - do - { - pFileNotifyInformation = (FILE_NOTIFY_INFORMATION*)((char*)pFileNotifyInformation + offset); - - path.clear(); - path.append(m_root); - path.append(QString::fromWCharArray(pFileNotifyInformation->FileName, pFileNotifyInformation->FileNameLength / 2)); - - QString file = QDir::toNativeSeparators(QDir::cleanPath(path)); - - switch (pFileNotifyInformation->Action) - { - case FILE_ACTION_ADDED: - case FILE_ACTION_RENAMED_NEW_NAME: - ProcessNewFileEvent(file); - break; - case FILE_ACTION_REMOVED: - case FILE_ACTION_RENAMED_OLD_NAME: - ProcessDeleteFileEvent(file); - break; - case FILE_ACTION_MODIFIED: - ProcessModifyFileEvent(file); - break; - } - - offset = pFileNotifyInformation->NextEntryOffset; - } while (offset); - } + case FILE_ACTION_ADDED: + case FILE_ACTION_RENAMED_NEW_NAME: + rawFileAdded(file, {}); + break; + case FILE_ACTION_REMOVED: + case FILE_ACTION_RENAMED_OLD_NAME: + rawFileRemoved(file, {}); + break; + case FILE_ACTION_MODIFIED: + rawFileModified(file, {}); + break; } + + offset = pFileNotifyInformation->NextEntryOffset; } + + folderRoot.ReadChanges(); } } } - diff --git a/Code/Tools/AssetProcessor/Platform/Windows/native/FileWatcher/FileWatcher_windows.h b/Code/Tools/AssetProcessor/Platform/Windows/native/FileWatcher/FileWatcher_windows.h new file mode 100644 index 0000000000..28092961f5 --- /dev/null +++ b/Code/Tools/AssetProcessor/Platform/Windows/native/FileWatcher/FileWatcher_windows.h @@ -0,0 +1,65 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include +#include +#include + +#include +#include + +struct HandleDeleter +{ + void operator()(HANDLE handle) + { + if (handle && handle != INVALID_HANDLE_VALUE) + { + CloseHandle(handle); + } + } +}; + +using HandleUniquePtr = AZStd::unique_ptr, HandleDeleter>; + +class FileWatcher::PlatformImplementation +{ +public: + bool AddWatchFolder(QString folder, bool recursive); + + struct FolderRootWatch + { + FolderRootWatch(AZStd::unique_ptr&& overlapped, HandleUniquePtr&& directoryHandle, QString root, bool recursive) + : m_overlapped(AZStd::move(overlapped)) + , m_directoryHandle(AZStd::move(directoryHandle)) + , m_directoryRoot(AZStd::move(root)) + , m_recursive(recursive) + { + } + + bool ReadChanges(); + + AZStd::unique_ptr m_overlapped; // Identifies this root watch + HandleUniquePtr m_directoryHandle; + QString m_directoryRoot; + bool m_recursive; + AZStd::aligned_storage_t<64 * 1024, sizeof(DWORD)> m_fileNotifyInformationList{}; + }; + + enum class EventType + { + FileRead, + Shutdown + }; + + AZStd::unordered_map m_folderRootWatches; + + HandleUniquePtr m_ioHandle{CreateIoCompletionPort(INVALID_HANDLE_VALUE, nullptr, /*CompletionKey =*/ static_cast(EventType::FileRead), 1)}; +}; diff --git a/Code/Tools/AssetProcessor/assetprocessor_static_files.cmake b/Code/Tools/AssetProcessor/assetprocessor_static_files.cmake index 7daca9bbc1..6dda9af682 100644 --- a/Code/Tools/AssetProcessor/assetprocessor_static_files.cmake +++ b/Code/Tools/AssetProcessor/assetprocessor_static_files.cmake @@ -44,7 +44,6 @@ set(FILES native/FileProcessor/FileProcessor.h native/FileWatcher/FileWatcher.cpp native/FileWatcher/FileWatcher.h - native/FileWatcher/FileWatcherAPI.h native/InternalBuilders/SettingsRegistryBuilder.cpp native/InternalBuilders/SettingsRegistryBuilder.h native/resourcecompiler/JobsModel.cpp diff --git a/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.cpp b/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.cpp index 4d4b4e9690..c1c1a29d74 100644 --- a/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.cpp +++ b/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.cpp @@ -6,154 +6,122 @@ * */ #include "FileWatcher.h" +#include "AzCore/std/containers/vector.h" #include +#include +#include -////////////////////////////////////////////////////////////////////////////// -/// FolderWatchRoot -void FolderRootWatch::ProcessNewFileEvent(const QString& file) +//! IsSubfolder(folderA, folderB) +//! returns whether folderA is a subfolder of folderB +//! assumptions: absolute paths, case insensitive +static bool IsSubfolder(const QString& folderA, const QString& folderB) { - FileChangeInfo info; - info.m_action = FileAction::FileAction_Added; - info.m_filePath = file; - const bool invoked = QMetaObject::invokeMethod(m_fileWatcher, "AnyFileChange", Qt::QueuedConnection, Q_ARG(FileChangeInfo, info)); - Q_ASSERT(invoked); -} + // lets avoid allocating or messing with memory - this is a MAJOR hotspot as it is called for any file change even in the cache! + int sizeB = folderB.length(); + int sizeA = folderA.length(); -void FolderRootWatch::ProcessDeleteFileEvent(const QString& file) -{ - FileChangeInfo info; - info.m_action = FileAction::FileAction_Removed; - info.m_filePath = file; - const bool invoked = QMetaObject::invokeMethod(m_fileWatcher, "AnyFileChange", Qt::QueuedConnection, Q_ARG(FileChangeInfo, info)); - Q_ASSERT(invoked); -} + if (sizeA <= sizeB) + { + return false; + } -void FolderRootWatch::ProcessModifyFileEvent(const QString& file) -{ - FileChangeInfo info; - info.m_action = FileAction::FileAction_Modified; - info.m_filePath = file; - const bool invoked = QMetaObject::invokeMethod(m_fileWatcher, "AnyFileChange", Qt::QueuedConnection, Q_ARG(FileChangeInfo, info)); - Q_ASSERT(invoked); + QChar slash1 = QChar('\\'); + QChar slash2 = QChar('/'); + int posA = 0; + + // A is going to be the longer one, so use B: + for (int idx = 0; idx < sizeB; ++idx) + { + QChar charAtA = folderA.at(posA); + QChar charAtB = folderB.at(idx); + + if ((charAtB == slash1) || (charAtB == slash2)) + { + if ((charAtA != slash1) && (charAtA != slash2)) + { + return false; + } + ++posA; + } + else + { + if (charAtA.toLower() != charAtB.toLower()) + { + return false; + } + ++posA; + } + } + return true; } ////////////////////////////////////////////////////////////////////////// /// FileWatcher FileWatcher::FileWatcher() - : m_nextHandle(0) + : m_platformImpl(AZStd::make_unique()) { - qRegisterMetaType("FileChangeInfo"); + auto makeFilter = [this](auto signal) + { + return [this, signal](QString path) + { + const auto foundWatchRoot = AZStd::find_if(begin(m_folderWatchRoots), end(m_folderWatchRoots), [path](const WatchRoot& watchRoot) + { + return Filter(path, watchRoot); + }); + if (foundWatchRoot == end(m_folderWatchRoots)) + { + return; + } + AZStd::invoke(signal, this, path); + }; + }; + + // The rawFileAdded signals are emitted by the watcher thread. Use a queued + // connection so that the consumers of the notification process the + // notification on the main thread. + connect(this, &FileWatcher::rawFileAdded, this, makeFilter(&FileWatcher::fileAdded), Qt::QueuedConnection); + connect(this, &FileWatcher::rawFileRemoved, this, makeFilter(&FileWatcher::fileRemoved), Qt::QueuedConnection); + connect(this, &FileWatcher::rawFileModified, this, makeFilter(&FileWatcher::fileModified), Qt::QueuedConnection); } FileWatcher::~FileWatcher() { + disconnect(); + StopWatching(); } -int FileWatcher::AddFolderWatch(FolderWatchBase* pFolderWatch, bool recursive) +void FileWatcher::AddFolderWatch(QString directory, bool recursive) { - if (!pFolderWatch) + // Search for an already monitored root that is a parent of `directory`, + // that is already watching subdirectories recursively + const auto found = AZStd::find_if(begin(m_folderWatchRoots), end(m_folderWatchRoots), [directory](const WatchRoot& root) { - return -1; - } - - FolderRootWatch* pFolderRootWatch = nullptr; + return root.m_recursive && IsSubfolder(directory, root.m_directory); + }); - //see if this a sub folder of an already watched root - for (auto rootsIter = m_folderWatchRoots.begin(); !pFolderRootWatch && rootsIter != m_folderWatchRoots.end(); ++rootsIter) + if (found != end(m_folderWatchRoots)) { - if (FolderWatchBase::IsSubfolder(pFolderWatch->m_folder, (*rootsIter)->m_root)) - { - pFolderRootWatch = *rootsIter; - } - } - - bool bCreatedNewRoot = false; - //if its not a sub folder - if (!pFolderRootWatch) - { - //create a new root and start listening for changes - pFolderRootWatch = new FolderRootWatch(pFolderWatch->m_folder, recursive); - - //make sure the folder watcher(s) get deleted before this - pFolderRootWatch->setParent(this); - bCreatedNewRoot = true; + // This directory is already watched + return; } - pFolderRootWatch->m_fileWatcher = this; - QObject::connect(this, &FileWatcher::AnyFileChange, pFolderWatch, &FolderWatchBase::OnAnyFileChange); + //create a new root and start listening for changes + m_folderWatchRoots.push_back({directory, recursive}); - if (bCreatedNewRoot) + //since we created a new root, see if the new root is a super folder + //of other roots, if it is then then fold those roots into the new super root + if (recursive) { - if (m_startedWatching) + AZStd::erase_if(m_folderWatchRoots, [directory](const WatchRoot& root) { - pFolderRootWatch->Start(); - } - - //since we created a new root, see if the new root is a super folder - //of other roots, if it is then then fold those roots into the new super root - for (auto rootsIter = m_folderWatchRoots.begin(); rootsIter != m_folderWatchRoots.end(); ) - { - if (pFolderWatch->m_watchSubtree && FolderWatchBase::IsSubfolder((*rootsIter)->m_root, pFolderWatch->m_folder)) - { - //union the sub folder map over to the new root - pFolderRootWatch->m_subFolderWatchesMap.insert((*rootsIter)->m_subFolderWatchesMap); - - //clear the old root sub folders map so they don't get deleted when we - //delete the old root as they are now pointed to by the new root - (*rootsIter)->m_subFolderWatchesMap.clear(); - - //delete the empty old root, deleting a root will call Stop() - //automatically which kills the thread - delete *rootsIter; - - //remove the old root pointer form the watched list - rootsIter = m_folderWatchRoots.erase(rootsIter); - } - else - { - ++rootsIter; - } - } - - //add the new root to the watched roots - m_folderWatchRoots.push_back(pFolderRootWatch); + return IsSubfolder(root.m_directory, directory); + }); } - - //add to the root - pFolderRootWatch->m_subFolderWatchesMap.insert(m_nextHandle, pFolderWatch); - - m_nextHandle++; - - return m_nextHandle - 1; } -void FileWatcher::RemoveFolderWatch(int handle) +void FileWatcher::ClearFolderWatches() { - for (auto rootsIter = m_folderWatchRoots.begin(); rootsIter != m_folderWatchRoots.end(); ) - { - //find an element by the handle - auto foundIter = (*rootsIter)->m_subFolderWatchesMap.find(handle); - if (foundIter != (*rootsIter)->m_subFolderWatchesMap.end()) - { - //remove the element - (*rootsIter)->m_subFolderWatchesMap.erase(foundIter); - - //we removed a folder watch, if it's empty then there is no reason to keep watching it. - if ((*rootsIter)->m_subFolderWatchesMap.empty()) - { - delete(*rootsIter); - rootsIter = m_folderWatchRoots.erase(rootsIter); - } - else - { - ++rootsIter; - } - } - else - { - ++rootsIter; - } - } + m_folderWatchRoots.clear(); } void FileWatcher::StartWatching() @@ -164,12 +132,18 @@ void FileWatcher::StartWatching() return; } - for (FolderRootWatch* root : m_folderWatchRoots) + if (PlatformStart()) + { + m_thread = AZStd::thread({/*.name=*/ "AssetProcessor FileWatcher thread"}, [this]{ + WatchFolderLoop(); + }); + AZ_TracePrintf(AssetProcessor::ConsoleChannel, "File Change Monitoring started.\n"); + } + else { - root->Start(); + AZ_TracePrintf(AssetProcessor::ConsoleChannel, "File Change Monitoring failed to start.\n"); } - AZ_TracePrintf(AssetProcessor::ConsoleChannel, "File Change Monitoring started.\n"); m_startedWatching = true; } @@ -177,17 +151,35 @@ void FileWatcher::StopWatching() { if (!m_startedWatching) { - AZ_Warning("FileWatcher", false, "StartWatching() called when is not watching for file changes."); + AZ_Warning("FileWatcher", false, "StopWatching() called when is not watching for file changes."); return; } - for (FolderRootWatch* root : m_folderWatchRoots) - { - root->Stop(); - } + PlatformStop(); m_startedWatching = false; } -#include "native/FileWatcher/moc_FileWatcher.cpp" -#include "native/FileWatcher/moc_FileWatcherAPI.cpp" +bool FileWatcher::Filter(QString path, const WatchRoot& watchRoot) +{ + if (!IsSubfolder(path, watchRoot.m_directory)) + { + return false; + } + if (!watchRoot.m_recursive) + { + // filter out subtrees too. + QStringRef subRef = path.rightRef(path.length() - watchRoot.m_directory.length()); + if ((subRef.indexOf('/') != -1) || (subRef.indexOf('\\') != -1)) + { + return false; // filter this out. + } + + // we don't care about subdirs. IsDir is more expensive so we do it after the above filter. + if (QFileInfo(path).isDir()) + { + return false; + } + } + return true; +} diff --git a/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.h b/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.h index fc3f109604..b7d8cbe1a4 100644 --- a/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.h +++ b/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.h @@ -5,63 +5,21 @@ * SPDX-License-Identifier: Apache-2.0 OR MIT * */ -#ifndef FILEWATCHER_COMPONENT_H -#define FILEWATCHER_COMPONENT_H -////////////////////////////////////////////////////////////////////////// -#if !defined(Q_MOC_RUN) -#include "FileWatcherAPI.h" +#pragma once +#if !defined(Q_MOC_RUN) +#include #include +#include +#include #include #include #include +#include -#include #endif -class FileWatcher; - -////////////////////////////////////////////////////////////////////////// -//! FolderRootWatch -/*! Class used for holding a point in the files system from which file changes are tracked. - * */ -class FolderRootWatch - : public QObject -{ - Q_OBJECT - - friend class FileWatcher; -public: - FolderRootWatch(const QString rootFolder, bool recursive = true); - virtual ~FolderRootWatch(); - - void ProcessNewFileEvent(const QString& file); - void ProcessDeleteFileEvent(const QString& file); - void ProcessModifyFileEvent(const QString& file); - void ProcessRenameFileEvent(const QString& fileOld, const QString& fileNew); - -public Q_SLOTS: - bool Start(); - void Stop(); - -private: - void WatchFolderLoop(); - -private: - std::thread m_thread; - QString m_root; - QMap m_subFolderWatchesMap; - volatile bool m_shutdownThreadSignal; - FileWatcher* m_fileWatcher; - bool m_recursive; - - // Can't use unique_ptr because this is a QObject and Qt's magic sauce is - // unable to determine the size of the unique_ptr and so fails to compile - struct PlatformImplementation; - PlatformImplementation* m_platformImpl; -}; - ////////////////////////////////////////////////////////////////////////// //! FileWatcher /*! Class that handles creation and deletion of FolderRootWatches based on @@ -74,23 +32,47 @@ class FileWatcher public: FileWatcher(); - virtual ~FileWatcher(); + ~FileWatcher() override; ////////////////////////////////////////////////////////////////////////// - virtual int AddFolderWatch(FolderWatchBase* pFolderWatch, bool recursive = true); - virtual void RemoveFolderWatch(int handle); + void AddFolderWatch(QString directory, bool recursive = true); + void ClearFolderWatches(); ////////////////////////////////////////////////////////////////////////// - + void StartWatching(); void StopWatching(); Q_SIGNALS: - void AnyFileChange(FileChangeInfo info); + // These signals are emitted when a file under a watched path changes + void fileAdded(QString filePath); + void fileRemoved(QString filePath); + void fileModified(QString filePath); + + // These signals are emitted by the platform implementations when files + // change. Some platforms' file watch APIs do not support non-recursive + // watches, so the signals are filtered before being forwarded to the + // non-"raw" fileAdded/Removed/Modified signals above. + void rawFileAdded(QString filePath, QPrivateSignal); + void rawFileRemoved(QString filePath, QPrivateSignal); + void rawFileModified(QString filePath, QPrivateSignal); private: - int m_nextHandle; - AZStd::vector m_folderWatchRoots; + bool PlatformStart(); + void PlatformStop(); + void WatchFolderLoop(); + + class PlatformImplementation; + friend class PlatformImplementation; + struct WatchRoot + { + QString m_directory; + bool m_recursive; + }; + static bool Filter(QString path, const WatchRoot& watchRoot); + + AZStd::unique_ptr m_platformImpl; + AZStd::vector m_folderWatchRoots; + AZStd::thread m_thread; bool m_startedWatching = false; + AZStd::atomic_bool m_shutdownThreadSignal = false; }; - -#endif//FILEWATCHER_COMPONENT_H diff --git a/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcherAPI.h b/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcherAPI.h deleted file mode 100644 index 155056d477..0000000000 --- a/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcherAPI.h +++ /dev/null @@ -1,222 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * 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 FILEWATCHERAPI_H -#define FILEWATCHERAPI_H - -#include -#include -#include - -////////////////////////////////////////////////////////////////////////// -//! FileAction -/*! Enum for which file changes are tracked. - * */ -enum FileAction -{ - FileAction_None = 0x00, - FileAction_Added = 0x01, - FileAction_Removed = 0x02, - FileAction_Modified = 0x04, - FileAction_Any = 0xFF, -}; -inline FileAction operator | (FileAction a, FileAction b) -{ - return static_cast(static_cast(a) | static_cast(b)); -} -inline FileAction operator & (FileAction a, FileAction b) -{ - return static_cast(static_cast(a) & static_cast(b)); -} - -////////////////////////////////////////////////////////////////////////// -//! FileChangeInfo -/*! Struct for passing along information about file changes. - * */ -struct FileChangeInfo -{ - FileChangeInfo() - : m_action(FileAction::FileAction_None) - {} - FileChangeInfo(const FileChangeInfo& rhs) - : m_action(rhs.m_action) - , m_filePath(rhs.m_filePath) - , m_filePathOld(rhs.m_filePathOld) - { - } - - FileAction m_action; - QString m_filePath; - QString m_filePathOld; -}; - -Q_DECLARE_METATYPE(FileChangeInfo) - -////////////////////////////////////////////////////////////////////////// -//! FolderWatchBase -/*! Class for filtering file changes generated from a root watch. Define your own - *! custom filtering by deriving from this base class and implement your own - *! custom code for what to do when receiving a file change notification. - * */ -class FolderWatchBase - : public QObject -{ - Q_OBJECT - -public: - FolderWatchBase(const QString strFolder, bool bWatchSubtree = true, FileAction fileAction = FileAction::FileAction_Any) - : m_folder(strFolder) - , m_watchSubtree(bWatchSubtree) - , m_fileAction(fileAction) - { - m_folder = QDir::toNativeSeparators(QDir::cleanPath(m_folder) + "/"); - } - - //! IsSubfolder(folderA, folderB) - //! returns whether folderA is a subfolder of folderB - //! assumptions: absolute paths, case insensitive - static bool IsSubfolder(const QString& folderA, const QString& folderB) - { - // lets avoid allocating or messing with memory - this is a MAJOR hotspot as it is called for any file change even in the cache! - int sizeB = folderB.length(); - int sizeA = folderA.length(); - - if (sizeA <= sizeB) - { - return false; - } - - QChar slash1 = QChar('\\'); - QChar slash2 = QChar('/'); - int posA = 0; - - // A is going to be the longer one, so use B: - for (int idx = 0; idx < sizeB; ++idx) - { - QChar charAtA = folderA.at(posA); - QChar charAtB = folderB.at(idx); - - if ((charAtB == slash1) || (charAtB == slash2)) - { - if ((charAtA != slash1) && (charAtA != slash2)) - { - return false; - } - ++posA; - } - else - { - if (charAtA.toLower() != charAtB.toLower()) - { - return false; - } - ++posA; - } - } - return true; - } - - QString m_folder; - bool m_watchSubtree; - FileAction m_fileAction; - -public Q_SLOTS: - void OnAnyFileChange(FileChangeInfo info) - { - //if they set a file action then respect it by rejecting non matching file actions - if (info.m_action & m_fileAction) - { - //is the file is in the folder or subtree (if specified) then call OnFileChange - - if (FolderWatchBase::IsSubfolder(info.m_filePath, m_folder)) - { - OnFileChange(info); - } - } - } - - virtual void OnFileChange(const FileChangeInfo& info) = 0; -}; - -////////////////////////////////////////////////////////////////////////// -//! FolderWatchCallbackEx -/*! Class implements a more complex filtering that can optionally filter for file - *! extension and call different callback for different kinds of file changes - *! generated from a root watch. - *! Notes: - *! - empty extension "" catches all file changes - *! - extension should not include the leading "." - * */ -class FolderWatchCallbackEx - : public FolderWatchBase -{ - Q_OBJECT - -public: - FolderWatchCallbackEx(const QString strFolder, const QString extension, bool bWatchSubtree) - : FolderWatchBase(strFolder, bWatchSubtree) - , m_extension(extension) - { - } - - QString m_extension; - - //on file change call the change callback if passes extension then route - //to specific file action type callback - virtual void OnFileChange(const FileChangeInfo& info) - { - //if they set an extension to watch for only let matching extensions through - QFileInfo fileInfo(info.m_filePath); - - if (!m_watchSubtree) - { - // filter out subtrees too. - QStringRef subRef = info.m_filePath.rightRef(info.m_filePath.length() - m_folder.length()); - if ((subRef.indexOf('/') != -1) || (subRef.indexOf('\\') != -1)) - { - return; // filter this out. - } - - // we don't care about subdirs. IsDir is more expensive so we do it after the above filter. - if (fileInfo.isDir()) - { - return; - } - } - - if (m_extension.isEmpty() || fileInfo.completeSuffix().compare(m_extension, Qt::CaseInsensitive) == 0) - { - if (info.m_action & FileAction::FileAction_Any) - { - Q_EMIT fileChange(info); - } - - if (info.m_action & FileAction::FileAction_Added) - { - Q_EMIT fileAdded(info.m_filePath); - } - - if (info.m_action & FileAction::FileAction_Removed) - { - Q_EMIT fileRemoved(info.m_filePath); - } - - if (info.m_action & FileAction::FileAction_Modified) - { - Q_EMIT fileModified(info.m_filePath); - } - } - } - -Q_SIGNALS: - void fileChange(FileChangeInfo info); - void fileAdded(QString filePath); - void fileRemoved(QString filePath); - void fileModified(QString filePath); -}; - -#endif//FILEWATCHERAPI_H diff --git a/Code/Tools/AssetProcessor/native/unittests/FileWatcherUnitTests.cpp b/Code/Tools/AssetProcessor/native/unittests/FileWatcherUnitTests.cpp index a68b116f3d..2dd911b662 100644 --- a/Code/Tools/AssetProcessor/native/unittests/FileWatcherUnitTests.cpp +++ b/Code/Tools/AssetProcessor/native/unittests/FileWatcherUnitTests.cpp @@ -24,14 +24,12 @@ void FileWatcherUnitTestRunner::StartTest() FileWatcher fileWatcher; - FolderWatchCallbackEx folderWatch(tempPath, "", true); - - fileWatcher.AddFolderWatch(&folderWatch); + fileWatcher.AddFolderWatch(tempPath); fileWatcher.StartWatching(); { // test a single file create/write bool foundFile = false; - auto connection = QObject::connect(&folderWatch, &FolderWatchCallbackEx::fileAdded, this, [&](QString filename) + auto connection = QObject::connect(&fileWatcher, &FileWatcher::fileAdded, this, [&](QString filename) { AZ_TracePrintf(AssetProcessor::DebugChannel, "Single file test Found asset: %s.\n", filename.toUtf8().data()); foundFile = true; @@ -66,7 +64,7 @@ void FileWatcherUnitTestRunner::StartTest() const unsigned long maxFiles = 10000; QSet outstandingFiles; - auto connection = QObject::connect(&folderWatch, &FolderWatchCallbackEx::fileAdded, this, [&](QString filename) + auto connection = QObject::connect(&fileWatcher, &FileWatcher::fileAdded, this, [&](QString filename) { outstandingFiles.remove(filename); }); @@ -122,7 +120,7 @@ void FileWatcherUnitTestRunner::StartTest() { // test deletion bool foundFile = false; - auto connection = QObject::connect(&folderWatch, &FolderWatchCallbackEx::fileRemoved, this, [&](QString filename) + auto connection = QObject::connect(&fileWatcher, &FileWatcher::fileRemoved, this, [&](QString filename) { AZ_TracePrintf(AssetProcessor::DebugChannel, "Deleted asset: %s...\n", filename.toUtf8().data()); foundFile = true; @@ -155,7 +153,7 @@ void FileWatcherUnitTestRunner::StartTest() { bool fileAddCalled = false; QString fileAddName; - auto connectionAdd = QObject::connect(&folderWatch, &FolderWatchCallbackEx::fileAdded, this, [&](QString filename) + auto connectionAdd = QObject::connect(&fileWatcher, &FileWatcher::fileAdded, this, [&](QString filename) { fileAddCalled = true; fileAddName = filename; @@ -163,7 +161,7 @@ void FileWatcherUnitTestRunner::StartTest() bool fileRemoveCalled = false; QString fileRemoveName; - auto connectionRemove = QObject::connect(&folderWatch, &FolderWatchCallbackEx::fileRemoved, this, [&](QString filename) + auto connectionRemove = QObject::connect(&fileWatcher, &FileWatcher::fileRemoved, this, [&](QString filename) { fileRemoveCalled = true; fileRemoveName = filename; @@ -171,7 +169,7 @@ void FileWatcherUnitTestRunner::StartTest() QStringList fileModifiedNames; bool fileModifiedCalled = false; - auto connectionModified = QObject::connect(&folderWatch, &FolderWatchCallbackEx::fileModified, this, [&](QString filename) + auto connectionModified = QObject::connect(&fileWatcher, &FileWatcher::fileModified, this, [&](QString filename) { fileModifiedCalled = true; fileModifiedNames.append(filename); diff --git a/Code/Tools/AssetProcessor/native/utilities/ApplicationManager.h b/Code/Tools/AssetProcessor/native/utilities/ApplicationManager.h index 56d65d6784..2ecea4e512 100644 --- a/Code/Tools/AssetProcessor/native/utilities/ApplicationManager.h +++ b/Code/Tools/AssetProcessor/native/utilities/ApplicationManager.h @@ -21,7 +21,6 @@ #include "native/assetprocessor.h" #endif -class FolderWatchCallbackEx; class QCoreApplication; namespace AZ diff --git a/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp b/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp index f9827bda2e..36450c4e65 100644 --- a/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp +++ b/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp @@ -433,63 +433,77 @@ void ApplicationManagerBase::DestroyPlatformConfiguration() void ApplicationManagerBase::InitFileMonitor() { - m_folderWatches.reserve(m_platformConfiguration->GetScanFolderCount()); - m_watchHandles.reserve(m_platformConfiguration->GetScanFolderCount()); for (int folderIdx = 0; folderIdx < m_platformConfiguration->GetScanFolderCount(); ++folderIdx) { const AssetProcessor::ScanFolderInfo& info = m_platformConfiguration->GetScanFolderAt(folderIdx); - - FolderWatchCallbackEx* newFolderWatch = new FolderWatchCallbackEx(info.ScanPath(), "", info.RecurseSubFolders()); - // hook folder watcher to assess files on add/modify - // relevant files will be sent to resource compiler - QObject::connect(newFolderWatch, &FolderWatchCallbackEx::fileAdded, - m_assetProcessorManager, &AssetProcessor::AssetProcessorManager::AssessAddedFile); - QObject::connect(newFolderWatch, &FolderWatchCallbackEx::fileModified, - m_assetProcessorManager, &AssetProcessor::AssetProcessorManager::AssessModifiedFile); - QObject::connect(newFolderWatch, &FolderWatchCallbackEx::fileRemoved, - m_assetProcessorManager, &AssetProcessor::AssetProcessorManager::AssessDeletedFile); - - QObject::connect(newFolderWatch, &FolderWatchCallbackEx::fileAdded, [this](QString path) { m_fileStateCache->AddFile(path); }); - QObject::connect(newFolderWatch, &FolderWatchCallbackEx::fileModified, [this](QString path) { m_fileStateCache->UpdateFile(path); }); - QObject::connect(newFolderWatch, &FolderWatchCallbackEx::fileRemoved, [this](QString path) { m_fileStateCache->RemoveFile(path); }); - - QObject::connect(newFolderWatch, &FolderWatchCallbackEx::fileAdded, [](QString path) { AZ::Interface::Get()->FileAdded(path); }); - - QObject::connect(newFolderWatch, &FolderWatchCallbackEx::fileAdded, - m_fileProcessor.get(), &AssetProcessor::FileProcessor::AssessAddedFile); - QObject::connect(newFolderWatch, &FolderWatchCallbackEx::fileRemoved, - m_fileProcessor.get(), &AssetProcessor::FileProcessor::AssessDeletedFile); - - m_folderWatches.push_back(AZStd::unique_ptr(newFolderWatch)); - m_watchHandles.push_back(m_fileWatcher.AddFolderWatch(newFolderWatch, info.RecurseSubFolders())); + m_fileWatcher.AddFolderWatch(info.ScanPath(), info.RecurseSubFolders()); } - // also hookup monitoring for the cache (output directory) QDir cacheRoot; if (AssetUtilities::ComputeProjectCacheRoot(cacheRoot)) { - FolderWatchCallbackEx* newFolderWatch = new FolderWatchCallbackEx(cacheRoot.absolutePath(), "", true); + m_fileWatcher.AddFolderWatch(cacheRoot.absolutePath(), true); + } - QObject::connect(newFolderWatch, &FolderWatchCallbackEx::fileAdded, [this](QString path) { m_fileStateCache->AddFile(path); }); - QObject::connect(newFolderWatch, &FolderWatchCallbackEx::fileModified, [this](QString path) { m_fileStateCache->UpdateFile(path); }); - QObject::connect(newFolderWatch, &FolderWatchCallbackEx::fileRemoved, [this](QString path) { m_fileStateCache->RemoveFile(path); }); + if (m_platformConfiguration->GetScanFolderCount() || !cacheRoot.path().isEmpty()) + { + const auto cachePath = QDir::toNativeSeparators(cacheRoot.absolutePath()); - // we only care about cache root deletions. - QObject::connect(newFolderWatch, &FolderWatchCallbackEx::fileRemoved, - m_assetProcessorManager, &AssetProcessor::AssetProcessorManager::AssessDeletedFile); + const auto OnFileAdded = [this, cachePath](QString path) + { + const bool isCacheRoot = path.startsWith(cachePath); + if (isCacheRoot) + { + m_fileStateCache->AddFile(path); + } + else + { + m_assetProcessorManager->AssessAddedFile(path); + m_fileStateCache->AddFile(path); + AZ::Interface::Get()->FileAdded(path); + m_fileProcessor->AssetProcessor::FileProcessor::AssessAddedFile(path); + } + }; - m_folderWatches.push_back(AZStd::unique_ptr(newFolderWatch)); - m_watchHandles.push_back(m_fileWatcher.AddFolderWatch(newFolderWatch)); + const auto OnFileModified = [this, cachePath](QString path) + { + const bool isCacheRoot = path.startsWith(cachePath); + if (isCacheRoot) + { + m_assetProcessorManager->AssessModifiedFile(path); + } + else + { + m_assetProcessorManager->AssessModifiedFile(path); + m_fileStateCache->UpdateFile(path); + } + }; + + const auto OnFileRemoved = [this, cachePath](QString path) + { + const bool isCacheRoot = path.startsWith(cachePath); + if (isCacheRoot) + { + m_fileStateCache->RemoveFile(path); + m_assetProcessorManager->AssessDeletedFile(path); + } + else + { + m_assetProcessorManager->AssessDeletedFile(path); + m_fileStateCache->RemoveFile(path); + m_fileProcessor->AssessDeletedFile(path); + } + }; + + connect(&m_fileWatcher, &FileWatcher::fileAdded, OnFileAdded); + connect(&m_fileWatcher, &FileWatcher::fileModified, OnFileModified); + connect(&m_fileWatcher, &FileWatcher::fileRemoved, OnFileRemoved); } } void ApplicationManagerBase::DestroyFileMonitor() { - for (int watchHandle : m_watchHandles) - { - m_fileWatcher.RemoveFolderWatch(watchHandle); - } - m_folderWatches.resize(0); + m_fileWatcher.ClearFolderWatches(); } void ApplicationManagerBase::DestroyApplicationServer() @@ -798,8 +812,6 @@ ApplicationManager::BeforeRunStatus ApplicationManagerBase::BeforeRun() qRegisterMetaType("AzFramework::AssetSystem::AssetStatus"); qRegisterMetaType("AssetStatus"); - qRegisterMetaType("FileChangeInfo"); - qRegisterMetaType("AssetScanningStatus"); qRegisterMetaType("NetworkRequestID"); diff --git a/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.h b/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.h index dbc4841599..8591228375 100644 --- a/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.h +++ b/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.h @@ -47,7 +47,6 @@ namespace AssetProcessor class ApplicationServer; class ConnectionManager; -class FolderWatchCallbackEx; class ControlRequestHandler; class ApplicationManagerBase @@ -192,9 +191,7 @@ protected: bool m_sourceControlReady = false; bool m_fullIdle = false; - AZStd::vector > m_folderWatches; FileWatcher m_fileWatcher; - AZStd::vector m_watchHandles; AssetProcessor::PlatformConfiguration* m_platformConfiguration = nullptr; AssetProcessor::AssetProcessorManager* m_assetProcessorManager = nullptr; AssetProcessor::AssetCatalog* m_assetCatalog = nullptr; diff --git a/Code/Tools/AssetProcessor/native/utilities/AssetBuilderInfo.h b/Code/Tools/AssetProcessor/native/utilities/AssetBuilderInfo.h index 5ace9e1aaf..20a1d808fd 100644 --- a/Code/Tools/AssetProcessor/native/utilities/AssetBuilderInfo.h +++ b/Code/Tools/AssetProcessor/native/utilities/AssetBuilderInfo.h @@ -23,7 +23,6 @@ #include #include -class FolderWatchCallbackEx; class QCoreApplication; namespace AssetProcessor From 484e27c109a1f8107730a897f0f23362b912cfb0 Mon Sep 17 00:00:00 2001 From: Chris Burel Date: Mon, 13 Dec 2021 09:02:03 -0800 Subject: [PATCH 304/948] Use AZStd::equal to implement path comparison Signed-off-by: Chris Burel --- .../native/FileWatcher/FileWatcher.cpp | 49 +++++++++---------- 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.cpp b/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.cpp index c1c1a29d74..f802bdbada 100644 --- a/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.cpp +++ b/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.cpp @@ -13,46 +13,43 @@ //! IsSubfolder(folderA, folderB) //! returns whether folderA is a subfolder of folderB -//! assumptions: absolute paths, case insensitive +//! assumptions: absolute paths static bool IsSubfolder(const QString& folderA, const QString& folderB) { // lets avoid allocating or messing with memory - this is a MAJOR hotspot as it is called for any file change even in the cache! - int sizeB = folderB.length(); - int sizeA = folderA.length(); - - if (sizeA <= sizeB) + if (folderA.length() <= folderB.length()) { return false; } - QChar slash1 = QChar('\\'); - QChar slash2 = QChar('/'); - int posA = 0; + using AZStd::begin; + using AZStd::end; - // A is going to be the longer one, so use B: - for (int idx = 0; idx < sizeB; ++idx) + constexpr auto isSlash = [](const QChar c) constexpr { - QChar charAtA = folderA.at(posA); - QChar charAtB = folderB.at(idx); + return c == AZ::IO::WindowsPathSeparator || c == AZ::IO::PosixPathSeparator; + }; - if ((charAtB == slash1) || (charAtB == slash2)) + const auto firstPathSeparator = AZStd::find_if(begin(folderB), end(folderB), [&isSlash](const QChar c) + { + return isSlash(c); + }); + + // Follow the convention used by AZ::IO::Path, and use a case-sensitive comparison on Posix paths + const bool useCaseSensitiveCompare = (firstPathSeparator == end(folderB)) ? true : (*firstPathSeparator == AZ::IO::PosixPathSeparator); + + return AZStd::equal(begin(folderB), end(folderB), begin(folderA), [isSlash, useCaseSensitiveCompare](const QChar charAtB, const QChar charAtA) + { + if (isSlash(charAtA)) { - if ((charAtA != slash1) && (charAtA != slash2)) - { - return false; - } - ++posA; + return isSlash(charAtB); } - else + if (useCaseSensitiveCompare) { - if (charAtA.toLower() != charAtB.toLower()) - { - return false; - } - ++posA; + return charAtA == charAtB; } - } - return true; + return charAtA.toLower() == charAtB.toLower(); + }); } ////////////////////////////////////////////////////////////////////////// From 2bc1d8620e5dc7260a043c7ac89141125930de3f Mon Sep 17 00:00:00 2001 From: Chris Burel Date: Mon, 20 Dec 2021 08:13:45 -0800 Subject: [PATCH 305/948] Rename file to adhere to PAL conventions Signed-off-by: Chris Burel --- .../Platform/Windows/assetprocessor_windows_files.cmake | 2 +- .../{FileWatcher_win.cpp => FileWatcher_windows.cpp} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename Code/Tools/AssetProcessor/Platform/Windows/native/FileWatcher/{FileWatcher_win.cpp => FileWatcher_windows.cpp} (100%) diff --git a/Code/Tools/AssetProcessor/Platform/Windows/assetprocessor_windows_files.cmake b/Code/Tools/AssetProcessor/Platform/Windows/assetprocessor_windows_files.cmake index 2bd9fa6470..96dd7434c1 100644 --- a/Code/Tools/AssetProcessor/Platform/Windows/assetprocessor_windows_files.cmake +++ b/Code/Tools/AssetProcessor/Platform/Windows/assetprocessor_windows_files.cmake @@ -8,7 +8,7 @@ set(FILES native/FileWatcher/FileWatcher_platform.h - native/FileWatcher/FileWatcher_win.cpp + native/FileWatcher/FileWatcher_windows.cpp native/FileWatcher/FileWatcher_windows.h native/resource.h ) diff --git a/Code/Tools/AssetProcessor/Platform/Windows/native/FileWatcher/FileWatcher_win.cpp b/Code/Tools/AssetProcessor/Platform/Windows/native/FileWatcher/FileWatcher_windows.cpp similarity index 100% rename from Code/Tools/AssetProcessor/Platform/Windows/native/FileWatcher/FileWatcher_win.cpp rename to Code/Tools/AssetProcessor/Platform/Windows/native/FileWatcher/FileWatcher_windows.cpp From 648a21ab5c310860f9dcf8415aa4f105c5bf982a Mon Sep 17 00:00:00 2001 From: Chris Burel Date: Tue, 4 Jan 2022 16:11:45 -0800 Subject: [PATCH 306/948] [Linux] Correct handling of new dirs added to non-recursive watch roots Signed-off-by: Chris Burel --- .../native/FileWatcher/FileWatcher_linux.cpp | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.cpp b/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.cpp index 7d38372e18..4ca41c0cb9 100644 --- a/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.cpp +++ b/Code/Tools/AssetProcessor/Platform/Linux/native/FileWatcher/FileWatcher_linux.cpp @@ -176,10 +176,25 @@ void FileWatcher::WatchFolderLoop() if (event->mask & (IN_CREATE | IN_MOVED_TO)) { - if (event->mask & IN_ISDIR /*&& m_recursive*/) + if (event->mask & IN_ISDIR) { - // New Directory, add it to the watch - m_platformImpl->AddWatchFolder(pathStr, true); + // New Directory, see if it should be added to the watched directories + // It is only added if it is a child of a recursively watched directory + const auto found = AZStd::find_if(begin(m_folderWatchRoots), end(m_folderWatchRoots), [this, event](const WatchRoot& watchRoot) + { + return watchRoot.m_directory == m_platformImpl->m_handleToFolderMap[event->wd]; + }); + + // If the path is not in m_folderWatchRoots, it must + // be a new subdirectory of a subdirectory of some + // other root that is being watched recursively. + // Maintain the recursive nature of that root. + const bool shouldAddFolder = (found == end(m_folderWatchRoots)) ? true : found->m_recursive; + + if (shouldAddFolder) + { + m_platformImpl->AddWatchFolder(pathStr, true); + } } else { From 41c0fb2b02a285c2682785d8ae22e54a652a1f0a Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Tue, 4 Jan 2022 17:41:58 -0800 Subject: [PATCH 307/948] Address some review feedback Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp | 2 +- Code/Framework/AzCore/AzCore/DOM/DomUtils.h | 2 +- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 244 +++++++++++------- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 38 +-- .../AzCore/AzCore/DOM/DomValueWriter.cpp | 4 +- .../AzCore/Tests/DOM/DomValueBenchmarks.cpp | 4 +- .../AzCore/Tests/DOM/DomValueTests.cpp | 46 ++-- 7 files changed, 201 insertions(+), 139 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp b/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp index d65497e194..73c4bd2d76 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp @@ -22,7 +22,7 @@ namespace AZ::Dom::Utils return backend.ReadFromBufferInPlace(string.data(), string.size(), visitor); } - AZ::Outcome WriteToValue(Backend::WriteCallback writeCallback) + AZ::Outcome WriteToValue(const Backend::WriteCallback& writeCallback) { Value value; AZStd::unique_ptr writer = value.GetWriteHandler(); diff --git a/Code/Framework/AzCore/AzCore/DOM/DomUtils.h b/Code/Framework/AzCore/AzCore/DOM/DomUtils.h index f03e5b66b8..ebe4273b48 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomUtils.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomUtils.h @@ -16,5 +16,5 @@ namespace AZ::Dom::Utils Visitor::Result ReadFromString(Backend& backend, AZStd::string_view string, AZ::Dom::Lifetime lifetime, Visitor& visitor); Visitor::Result ReadFromStringInPlace(Backend& backend, AZStd::string& string, Visitor& visitor); - AZ::Outcome WriteToValue(Backend::WriteCallback writeCallback); + AZ::Outcome WriteToValue(const Backend::WriteCallback& writeCallback); } // namespace AZ::Dom::Utils diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index 7401a5ac98..8c002b7091 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -12,22 +12,22 @@ namespace AZ::Dom { - template - AZStd::shared_ptr& CheckCopyOnWrite(AZStd::shared_ptr& refCountedPointer) + namespace Internal { - if (refCountedPointer.use_count() == 1) + template + AZStd::shared_ptr& CheckCopyOnWrite(AZStd::shared_ptr& refCountedPointer) { - return refCountedPointer; - } - else - { - refCountedPointer = AZStd::allocate_shared(StdValueAllocator(), *refCountedPointer); - return refCountedPointer; + if (refCountedPointer.use_count() == 1) + { + return refCountedPointer; + } + else + { + refCountedPointer = AZStd::allocate_shared(StdValueAllocator(), *refCountedPointer); + return refCountedPointer; + } } - } - namespace Internal - { template constexpr size_t GetTypeIndexInternal(size_t index = 0); @@ -288,107 +288,173 @@ namespace AZ::Dom Type Dom::Value::GetType() const { - switch (m_value.index()) - { - case GetTypeIndex(): - return Type::Null; - case GetTypeIndex(): - return Type::Int64; - case GetTypeIndex(): - return Type::Uint64; - case GetTypeIndex(): - return Type::Double; - case GetTypeIndex(): - return Type::Bool; - case GetTypeIndex(): - case GetTypeIndex(): - case GetTypeIndex(): - return Type::String; - case GetTypeIndex(): - return Type::Object; - case GetTypeIndex(): - return Type::Array; - case GetTypeIndex(): - return Type::Node; - case GetTypeIndex>(): - return Type::Opaque; - } - AZ_Assert(false, "AZ::Dom::Value::GetType: m_value has an unexpected type"); - return Type::Null; + return AZStd::visit( + [](auto&& value) -> Type + { + using CurrentType = AZStd::decay_t; + if constexpr (AZStd::is_same_v) + { + return Type::Null; + } + else if constexpr (AZStd::is_same_v) + { + return Type::Int64; + } + else if constexpr (AZStd::is_same_v) + { + return Type::Uint64; + } + else if constexpr (AZStd::is_same_v) + { + return Type::Double; + } + else if constexpr (AZStd::is_same_v) + { + return Type::Bool; + } + else if constexpr (AZStd::is_same_v) + { + return Type::String; + } + else if constexpr (AZStd::is_same_v) + { + return Type::String; + } + else if constexpr (AZStd::is_same_v) + { + return Type::String; + } + else if constexpr (AZStd::is_same_v) + { + return Type::Object; + } + else if constexpr (AZStd::is_same_v) + { + return Type::Array; + } + else if constexpr (AZStd::is_same_v) + { + return Type::Node; + } + else if constexpr (AZStd::is_same_v) + { + return Type::Opaque; + } + else + { + static_assert(false, "AZ::Dom::Value::GetType: m_value has an unexpected type"); + } + }, + m_value); } bool Value::IsNull() const { - return GetType() == Type::Null; + return AZStd::holds_alternative(m_value); } bool Value::IsFalse() const { - return IsBool() && !AZStd::get(m_value); + const bool* value = AZStd::get_if(&m_value); + return value != nullptr ? !(*value) : false; } bool Value::IsTrue() const { - return IsBool() && AZStd::get(m_value); + const bool* value = AZStd::get_if(&m_value); + return value != nullptr ? *value : false; } bool Value::IsBool() const { - return GetType() == Type::Bool; + return AZStd::holds_alternative(m_value); } bool Value::IsNode() const { - return GetType() == Type::Node; + return AZStd::holds_alternative(m_value); } bool Value::IsObject() const { - return GetType() == Type::Object; + return AZStd::holds_alternative(m_value); } bool Value::IsArray() const { - return GetType() == Type::Array; + return AZStd::holds_alternative(m_value); } bool Value::IsOpaqueValue() const { - return GetType() == Type::Opaque; + return AZStd::holds_alternative(m_value); } bool Value::IsNumber() const { - switch (GetType()) - { - case Type::Int64: - [[fallthrough]]; - case Type::Uint64: - [[fallthrough]]; - case Type::Double: - return true; - } - return false; + return AZStd::visit( + [](auto&& value) -> bool + { + using CurrentType = AZStd::decay_t; + if constexpr (AZStd::is_same_v) + { + return true; + } + else if constexpr (AZStd::is_same_v) + { + return true; + } + else if constexpr (AZStd::is_same_v) + { + return true; + } + else + { + return false; + } + }, + m_value); } bool Value::IsInt() const { - return GetType() == Type::Int64; + return AZStd::holds_alternative(m_value); } bool Value::IsUint() const { - return GetType() == Type::Uint64; + return AZStd::holds_alternative(m_value); } bool Value::IsDouble() const { - return GetType() == Type::Double; + return AZStd::holds_alternative(m_value); } bool Value::IsString() const { - return GetType() == Type::String; + return AZStd::visit( + [](auto&& value) -> bool + { + using CurrentType = AZStd::decay_t; + if constexpr (AZStd::is_same_v) + { + return true; + } + else if constexpr (AZStd::is_same_v) + { + return true; + } + else if constexpr (AZStd::is_same_v) + { + return true; + } + else + { + return false; + } + }, + m_value); } Value& Value::SetObject() @@ -406,7 +472,7 @@ namespace AZ::Dom Node& Value::GetNodeInternal() { AZ_Assert(GetType() == Type::Node, "AZ::Dom::Value: attempted to retrieve a node from a non-node value"); - return *CheckCopyOnWrite(AZStd::get(m_value)); + return *Internal::CheckCopyOnWrite(AZStd::get(m_value)); } const Object::ContainerType& Value::GetObjectInternal() const @@ -433,11 +499,11 @@ namespace AZ::Dom "AZ::Dom::Value: attempted to retrieve an object from a value that isn't an object or a node"); if (type == Type::Object) { - return CheckCopyOnWrite(AZStd::get(m_value))->m_values; + return Internal::CheckCopyOnWrite(AZStd::get(m_value))->m_values; } else { - return CheckCopyOnWrite(AZStd::get(m_value))->GetProperties(); + return Internal::CheckCopyOnWrite(AZStd::get(m_value))->GetProperties(); } } @@ -465,11 +531,11 @@ namespace AZ::Dom "AZ::Dom::Value: attempted to retrieve an array from a value that isn't an array or node"); if (type == Type::Array) { - return CheckCopyOnWrite(AZStd::get(m_value))->m_values; + return Internal::CheckCopyOnWrite(AZStd::get(m_value))->m_values; } else { - return CheckCopyOnWrite(AZStd::get(m_value))->GetChildren(); + return Internal::CheckCopyOnWrite(AZStd::get(m_value))->GetChildren(); } } @@ -698,22 +764,22 @@ namespace AZ::Dom return *this; } - size_t Value::Size() const + size_t Value::ArraySize() const { return GetArrayInternal().size(); } - size_t Value::Capacity() const + size_t Value::ArrayCapacity() const { return GetArrayInternal().capacity(); } - bool Value::Empty() const + bool Value::IsArrayEmpty() const { return GetArrayInternal().empty(); } - void Value::Clear() + void Value::ClearArray() { GetArrayInternal().clear(); } @@ -728,43 +794,43 @@ namespace AZ::Dom return GetArrayInternal()[index]; } - Value& Value::MutableAt(size_t index) + Value& Value::MutableArrayAt(size_t index) { return operator[](index); } - const Value& Value::At(size_t index) const + const Value& Value::ArrayAt(size_t index) const { return operator[](index); } - Array::ConstIterator Value::Begin() const + Array::ConstIterator Value::ArrayBegin() const { return GetArrayInternal().begin(); } - Array::ConstIterator Value::End() const + Array::ConstIterator Value::ArrayEnd() const { return GetArrayInternal().end(); } - Array::Iterator Value::Begin() + Array::Iterator Value::ArrayBegin() { return GetArrayInternal().begin(); } - Array::Iterator Value::End() + Array::Iterator Value::ArrayEnd() { return GetArrayInternal().end(); } - Value& Value::Reserve(size_t newCapacity) + Value& Value::ArrayReserve(size_t newCapacity) { GetArrayInternal().reserve(newCapacity); return *this; } - Value& Value::PushBack(Value value) + Value& Value::ArrayPushBack(Value value) { Array::ContainerType& array = GetArrayInternal(); array.reserve((array.size() / Array::ReserveIncrement + 1) * Array::ReserveIncrement); @@ -772,18 +838,18 @@ namespace AZ::Dom return *this; } - Value& Value::PopBack() + Value& Value::ArrayPopBack() { GetArrayInternal().pop_back(); return *this; } - Array::Iterator Value::Erase(Array::ConstIterator pos) + Array::Iterator Value::ArrayErase(Array::ConstIterator pos) { return GetArrayInternal().erase(pos); } - Array::Iterator Value::Erase(Array::ConstIterator first, Array::ConstIterator last) + Array::Iterator Value::ArrayErase(Array::ConstIterator first, Array::ConstIterator last) { return GetArrayInternal().erase(first, last); } @@ -1007,13 +1073,6 @@ namespace AZ::Dom void Value::SetString(AZStd::string_view value) { - if (value.size() <= ShortStringSize) - { - ShortStringType buffer; - buffer.resize_no_construct(value.size()); - memcpy(buffer.data(), value.data(), value.size()); - m_value = buffer; - } m_value = value; } @@ -1021,7 +1080,10 @@ namespace AZ::Dom { if (value.size() <= ShortStringSize) { - SetString(value); + ShortStringType buffer; + buffer.resize_no_construct(value.size()); + memcpy(buffer.data(), value.data(), value.size()); + m_value = buffer; } else { @@ -1035,9 +1097,9 @@ namespace AZ::Dom return *AZStd::get(m_value); } - void Value::SetOpaqueValue(const AZStd::any& value) + void Value::SetOpaqueValue(AZStd::any value) { - m_value = AZStd::allocate_shared(StdValueAllocator(), value); + m_value = AZStd::allocate_shared(StdValueAllocator(), AZStd::move(value)); } void Value::SetNull() diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index b73da92d23..d67947dd0a 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -103,9 +103,9 @@ namespace AZ::Dom { public: Node() = default; + Node(const Node&) = default; + Node(Node&&) = default; explicit Node(AZ::Name name); - explicit Node(const Node&) = default; - explicit Node(Node&&) = default; Node& operator=(const Node&) = default; Node& operator=(Node&&) = default; @@ -174,7 +174,7 @@ namespace AZ::Dom double, // Bool bool, - // StringType + // String AZStd::string_view, SharedStringType, ShortStringType, @@ -280,28 +280,28 @@ namespace AZ::Dom // Array API (also used by Node)... Value& SetArray(); - size_t Size() const; - size_t Capacity() const; - bool Empty() const; - void Clear(); + size_t ArraySize() const; + size_t ArrayCapacity() const; + bool IsArrayEmpty() const; + void ClearArray(); Value& operator[](size_t index); const Value& operator[](size_t index) const; - Value& MutableAt(size_t index); - const Value& At(size_t index) const; + Value& MutableArrayAt(size_t index); + const Value& ArrayAt(size_t index) const; - Array::ConstIterator Begin() const; - Array::ConstIterator End() const; - Array::Iterator Begin(); - Array::Iterator End(); + Array::ConstIterator ArrayBegin() const; + Array::ConstIterator ArrayEnd() const; + Array::Iterator ArrayBegin(); + Array::Iterator ArrayEnd(); - Value& Reserve(size_t newCapacity); - Value& PushBack(Value value); - Value& PopBack(); + Value& ArrayReserve(size_t newCapacity); + Value& ArrayPushBack(Value value); + Value& ArrayPopBack(); - Array::Iterator Erase(Array::ConstIterator pos); - Array::Iterator Erase(Array::ConstIterator first, Array::ConstIterator last); + Array::Iterator ArrayErase(Array::ConstIterator pos); + Array::Iterator ArrayErase(Array::ConstIterator first, Array::ConstIterator last); Array::ContainerType& GetMutableArray(); const Array::ContainerType& GetArray() const; @@ -365,7 +365,7 @@ namespace AZ::Dom //! serialize an opaque type into a DOM value instead, as serializers //! and other systems will have no means of dealing with fully arbitrary //! values. - void SetOpaqueValue(const AZStd::any&); + void SetOpaqueValue(AZStd::any); // Null API... void SetNull(); diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp index 210d1fa123..433e650d04 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValueWriter.cpp @@ -129,7 +129,7 @@ namespace AZ::Dom AZStd::string::format("AZ::Dom::ValueWriter: %s called from within a different container type", endMethodName)); } - if (static_cast(buffer.m_attributes.size()) != attributeCount) + if (aznumeric_cast(buffer.m_attributes.size()) != attributeCount) { return VisitorFailure( VisitorErrorCode::InternalError, @@ -138,7 +138,7 @@ namespace AZ::Dom buffer.m_attributes.size())); } - if (static_cast(buffer.m_elements.size()) != elementCount) + if (aznumeric_cast(buffer.m_elements.size()) != elementCount) { return VisitorFailure( VisitorErrorCode::InternalError, diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp index 12684c64bc..74eb78be00 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp @@ -77,7 +77,7 @@ namespace AZ::Dom::Benchmark Value array(Type::Array); for (int i = 0; i < entryCount; ++i) { - array.PushBack(createEntry(i)); + array.ArrayPushBack(createEntry(i)); } return array; }; @@ -152,7 +152,7 @@ namespace AZ::Dom::Benchmark for (auto _ : state) { Value copy = original; - copy["entries"]["Key0"].PushBack(42); + copy["entries"]["Key0"].ArrayPushBack(42); TakeAndDiscardWithoutTimingDtor(AZStd::move(copy), state); } diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp index b88ab746b9..3cbd532b13 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp @@ -55,7 +55,7 @@ namespace AZ::Dom::Tests m_value.SetArray(); EXPECT_TRUE(m_value.IsArray()); - EXPECT_EQ(m_value.Size(), 0); + EXPECT_EQ(m_value.ArraySize(), 0); PerformValueChecks(); } @@ -66,8 +66,8 @@ namespace AZ::Dom::Tests for (int i = 0; i < 5; ++i) { - m_value.PushBack(Value(i)); - EXPECT_EQ(m_value.Size(), i + 1); + m_value.ArrayPushBack(Value(i)); + EXPECT_EQ(m_value.ArraySize(), i + 1); EXPECT_EQ(m_value[i].GetInt32(), i); } @@ -82,15 +82,15 @@ namespace AZ::Dom::Tests Value nestedArray(Type::Array); for (int i = 0; i < 5; ++i) { - nestedArray.PushBack(Value(i)); + nestedArray.ArrayPushBack(Value(i)); } - m_value.PushBack(AZStd::move(nestedArray)); + m_value.ArrayPushBack(AZStd::move(nestedArray)); } - EXPECT_EQ(m_value.Size(), 5); + EXPECT_EQ(m_value.ArraySize(), 5); for (int i = 0; i < 3; ++i) { - EXPECT_EQ(m_value[i].Size(), 5); + EXPECT_EQ(m_value[i].ArraySize(), 5); for (int j = 0; j < 5; ++j) { EXPECT_EQ(m_value[i][j].GetInt32(), j); @@ -154,7 +154,7 @@ namespace AZ::Dom::Tests m_value.SetNode("Test"); EXPECT_EQ(m_value.GetNodeName(), AZ::Name("Test")); EXPECT_EQ(m_value.MemberCount(), 0); - EXPECT_EQ(m_value.Size(), 0); + EXPECT_EQ(m_value.ArraySize(), 0); PerformValueChecks(); } @@ -165,8 +165,8 @@ namespace AZ::Dom::Tests for (int i = 0; i < 10; ++i) { - m_value.PushBack(Value(i)); - EXPECT_EQ(m_value.Size(), i + 1); + m_value.ArrayPushBack(Value(i)); + EXPECT_EQ(m_value.ArraySize(), i + 1); EXPECT_EQ(m_value[i].GetInt32(), i); if (i < 5) @@ -196,10 +196,10 @@ namespace AZ::Dom::Tests childNode.AddMember("foo", i); childNode.AddMember("bar", Value("test", false)); - m_value.PushBack(childNode); + m_value.ArrayPushBack(childNode); } - EXPECT_EQ(m_value.Size(), 5); + EXPECT_EQ(m_value.ArraySize(), 5); for (int i = 0; i < 5; ++i) { const Value& childNode = m_value[i]; @@ -334,30 +334,30 @@ namespace AZ::Dom::Tests TEST_F(DomValueTests, CopyOnWrite_Array) { Value v1(Type::Array); - v1.PushBack(1); - v1.PushBack(2); + v1.ArrayPushBack(1); + v1.ArrayPushBack(2); Value nestedArray(Type::Array); - v1.PushBack(nestedArray); + v1.ArrayPushBack(nestedArray); Value v2 = v1; EXPECT_EQ(&v1.GetArray(), &v2.GetArray()); - EXPECT_EQ(&v1.At(2).GetArray(), &v2.At(2).GetArray()); + EXPECT_EQ(&v1.ArrayAt(2).GetArray(), &v2.ArrayAt(2).GetArray()); v2[0] = 0; EXPECT_NE(&v1.GetArray(), &v2.GetArray()); - EXPECT_EQ(&v1.At(2).GetArray(), &v2.At(2).GetArray()); + EXPECT_EQ(&v1.ArrayAt(2).GetArray(), &v2.ArrayAt(2).GetArray()); - v2[2].PushBack(42); + v2[2].ArrayPushBack(42); EXPECT_NE(&v1.GetArray(), &v2.GetArray()); - EXPECT_NE(&v1.At(2).GetArray(), &v2.At(2).GetArray()); + EXPECT_NE(&v1.ArrayAt(2).GetArray(), &v2.ArrayAt(2).GetArray()); v2 = v1; EXPECT_EQ(&v1.GetArray(), &v2.GetArray()); - EXPECT_EQ(&v1.At(2).GetArray(), &v2.At(2).GetArray()); + EXPECT_EQ(&v1.ArrayAt(2).GetArray(), &v2.ArrayAt(2).GetArray()); } TEST_F(DomValueTests, CopyOnWrite_Node) @@ -365,8 +365,8 @@ namespace AZ::Dom::Tests Value v1; v1.SetNode("TopLevel"); - v1.PushBack(1); - v1.PushBack(2); + v1.ArrayPushBack(1); + v1.ArrayPushBack(2); v1["obj"].SetNode("Nested"); Value v2 = v1; @@ -378,7 +378,7 @@ namespace AZ::Dom::Tests EXPECT_NE(&v1.GetNode(), &v2.GetNode()); EXPECT_EQ(&v1["obj"].GetNode(), &v2["obj"].GetNode()); - v2["obj"].PushBack(42); + v2["obj"].ArrayPushBack(42); EXPECT_NE(&v1.GetNode(), &v2.GetNode()); EXPECT_NE(&v1["obj"].GetNode(), &v2["obj"].GetNode()); From 5eb6c2d24be1805dffce03e9ef773e9f5c69395d Mon Sep 17 00:00:00 2001 From: michabr <82236305+michabr@users.noreply.github.com> Date: Tue, 4 Jan 2022 18:13:44 -0800 Subject: [PATCH 308/948] Update UiCustomImageComponent to use Atom (#6628) Signed-off-by: abrmich --- Gems/LyShine/Code/Source/UiImageComponent.cpp | 10 +----- .../Code/Source/UiCustomImageComponent.cpp | 32 +++++++------------ 2 files changed, 12 insertions(+), 30 deletions(-) diff --git a/Gems/LyShine/Code/Source/UiImageComponent.cpp b/Gems/LyShine/Code/Source/UiImageComponent.cpp index 100bee6bf6..baf210a629 100644 --- a/Gems/LyShine/Code/Source/UiImageComponent.cpp +++ b/Gems/LyShine/Code/Source/UiImageComponent.cpp @@ -353,7 +353,6 @@ void UiImageComponent::SetOverrideSprite(ISprite* sprite, AZ::u32 cellIndex) //////////////////////////////////////////////////////////////////////////////////////////////////// void UiImageComponent::Render(LyShine::IRenderGraph* renderGraph) { - // get fade value (tracked by UiRenderer) and compute the desired alpha for the image float fade = renderGraph->GetAlphaFade(); float desiredAlpha = m_overrideAlpha * fade; @@ -376,9 +375,8 @@ void UiImageComponent::Render(LyShine::IRenderGraph* renderGraph) ImageType imageType = m_imageType; -#ifdef LYSHINE_ATOM_TODO // support default white texture // if there is no texture we will just use a white texture and want to stretch it - const bool spriteOrTextureIsNull = sprite == nullptr || sprite->GetTexture() == nullptr; + const bool spriteOrTextureIsNull = sprite == nullptr || sprite->GetImage() == nullptr; // Zero texture size may occur even if the UiImageComponent has a valid non-zero-sized texture, // because a canvas can be requested to Render() before the texture asset is done loading. @@ -399,12 +397,6 @@ void UiImageComponent::Render(LyShine::IRenderGraph* renderGraph) { imageType = ImageType::Stretched; } -#else - if (sprite == nullptr) - { - imageType = ImageType::Stretched; - } -#endif switch (imageType) { diff --git a/Gems/LyShineExamples/Code/Source/UiCustomImageComponent.cpp b/Gems/LyShineExamples/Code/Source/UiCustomImageComponent.cpp index 09ea375923..542e18b98c 100644 --- a/Gems/LyShineExamples/Code/Source/UiCustomImageComponent.cpp +++ b/Gems/LyShineExamples/Code/Source/UiCustomImageComponent.cpp @@ -72,36 +72,25 @@ namespace LyShineExamples } //////////////////////////////////////////////////////////////////////////////////////////////////// - void UiCustomImageComponent::Render([[maybe_unused]] LyShine::IRenderGraph* renderGraph) + void UiCustomImageComponent::Render(LyShine::IRenderGraph* renderGraph) { -#ifdef LYSHINE_ATOM_TODO // [GHI #3568] Convert draws to use Atom // get fade value (tracked by UiRenderer) and compute the desired alpha for the image float fade = renderGraph->GetAlphaFade(); float desiredAlpha = m_overrideAlpha * fade; uint8 desiredPackedAlpha = static_cast(desiredAlpha * 255.0f); - // if desired alpha is zero then no need to do any more - if (desiredPackedAlpha == 0) - { - return; - } - - ISprite* sprite = (m_overrideSprite) ? m_overrideSprite : m_sprite; - ITexture* texture = (sprite) ? sprite->GetTexture() : nullptr; - - if (!texture) - { - // if there is no texture we will just use a white texture - // TODO: Get a default atom texture here when possible - //texture = ???->EF_GetTextureByID(???->GetWhiteTextureId()); - } - if (m_isRenderCacheDirty) { RenderToCache(renderGraph); m_isRenderCacheDirty = false; } + // if desired alpha is zero then no need to do any more + if (desiredPackedAlpha == 0) + { + return; + } + // Render cache is now valid - render using the cache // If the fade value has changed we need to update the alpha values in the vertex colors but we do @@ -109,7 +98,7 @@ namespace LyShineExamples if (m_cachedPrimitive.m_vertices[0].color.a != desiredPackedAlpha) { // go through all the cached vertices and update the alpha values - UCol desiredPackedColor = m_cachedPrimitive.m_vertices[0].color; + LyShine::UCol desiredPackedColor = m_cachedPrimitive.m_vertices[0].color; desiredPackedColor.a = desiredPackedAlpha; for (int i = 0; i < m_cachedPrimitive.m_numVertices; ++i) { @@ -117,11 +106,12 @@ namespace LyShineExamples } } + ISprite* sprite = (m_overrideSprite) ? m_overrideSprite : m_sprite; + AZ::Data::Instance image = sprite->GetImage(); bool isTextureSRGB = false; bool isTexturePremultipliedAlpha = false; // we are not rendering from a render target with alpha in it LyShine::BlendMode blendMode = LyShine::BlendMode::Normal; - renderGraph->AddPrimitive(&m_cachedPrimitive, texture, m_clamp, isTextureSRGB, isTexturePremultipliedAlpha, blendMode); -#endif + renderGraph->AddPrimitive(&m_cachedPrimitive, image, m_clamp, isTextureSRGB, isTexturePremultipliedAlpha, blendMode); } //////////////////////////////////////////////////////////////////////////////////////////////////// From 40ca1dcbf90a16bae76553f7f184a58d7e5a950b Mon Sep 17 00:00:00 2001 From: Benjamin Jillich <43751992+amzn-jillich@users.noreply.github.com> Date: Wed, 5 Jan 2022 09:10:12 +0100 Subject: [PATCH 309/948] EMotion FX: Extendable pose data and pose debug visualization (#6639) * Added debug draw function to the pose class for sharable and easy-to-use pose debug visualization that includes pose data debug rendering. * Extended the pose data factory with the ability to add pose data types from outside of the EMFX SDK and external gems. * In order to get access to the pose data factory, it got added to the EMFX manager. Signed-off-by: Benjamin Jillich --- .../EMotionFX/Source/EMotionFXManager.cpp | 7 +++- .../Code/EMotionFX/Source/EMotionFXManager.h | 7 ++++ Gems/EMotionFX/Code/EMotionFX/Source/Pose.cpp | 36 ++++++++++++++++++- Gems/EMotionFX/Code/EMotionFX/Source/Pose.h | 14 +++++--- .../Code/EMotionFX/Source/PoseData.h | 4 ++- .../Code/EMotionFX/Source/PoseDataFactory.cpp | 21 +++++++---- .../Code/EMotionFX/Source/PoseDataFactory.h | 13 ++++++- 7 files changed, 86 insertions(+), 16 deletions(-) diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/EMotionFXManager.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/EMotionFXManager.cpp index 4ecd1c0117..864c193a9a 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/EMotionFXManager.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/EMotionFXManager.cpp @@ -6,7 +6,6 @@ * */ -// include the required headers #include "EMotionFXConfig.h" #include "EMotionFXManager.h" #include "Importer/Importer.h" @@ -29,6 +28,7 @@ #include #include #include +#include #include namespace EMotionFX @@ -76,6 +76,7 @@ namespace EMotionFX gEMFX.Get()->SetRecorder (Recorder::Create()); gEMFX.Get()->SetMotionInstancePool (MotionInstancePool::Create()); gEMFX.Get()->SetDebugDraw (aznew DebugDraw()); + gEMFX.Get()->SetPoseDataFactory (aznew PoseDataFactory()); gEMFX.Get()->SetGlobalSimulationSpeed (1.0f); // set the number of threads @@ -124,6 +125,7 @@ namespace EMotionFX m_recorder = nullptr; m_motionInstancePool = nullptr; m_debugDraw = nullptr; + m_poseDataFactory = nullptr; m_unitType = MCore::Distance::UNITTYPE_METERS; m_globalSimulationSpeed = 1.0f; m_isInEditorMode = false; @@ -170,6 +172,9 @@ namespace EMotionFX delete m_debugDraw; m_debugDraw = nullptr; + delete m_poseDataFactory; + m_poseDataFactory = nullptr; + m_renderActorSettings.reset(); m_eventManager->Destroy(); diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/EMotionFXManager.h b/Gems/EMotionFX/Code/EMotionFX/Source/EMotionFXManager.h index 4d55143b2f..7276516739 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/EMotionFXManager.h +++ b/Gems/EMotionFX/Code/EMotionFX/Source/EMotionFXManager.h @@ -37,6 +37,7 @@ namespace EMotionFX class MotionInstancePool; class EventDataFactory; class DebugDraw; + class PoseDataFactory; // versions #define EMFX_HIGHVERSION 4 @@ -188,6 +189,8 @@ namespace EMotionFX */ MCORE_INLINE DebugDraw* GetDebugDraw() const { return m_debugDraw; } + MCORE_INLINE PoseDataFactory* GetPoseDataFactory() const { return m_poseDataFactory; } + /** * Get the render actor settings * @result A pointer to global render actor settings. @@ -357,6 +360,7 @@ namespace EMotionFX EventManager* m_eventManager; /**< The motion event manager. */ SoftSkinManager* m_softSkinManager; /**< The softskin manager. */ AnimGraphManager* m_animGraphManager; /**< The animgraph manager. */ + PoseDataFactory* m_poseDataFactory; Recorder* m_recorder; /**< The recorder. */ MotionInstancePool* m_motionInstancePool; /**< The motion instance pool. */ DebugDraw* m_debugDraw; /**< The debug drawing system. */ @@ -433,6 +437,8 @@ namespace EMotionFX */ void SetMotionInstancePool(MotionInstancePool* pool); + void SetPoseDataFactory(PoseDataFactory* poseDataFactory) { m_poseDataFactory = poseDataFactory; } + /** * Set the number of threads to use. * @param numThreads The number of threads to use internally. This must be a value of 1 or above. @@ -520,5 +526,6 @@ namespace EMotionFX MCORE_INLINE Recorder& GetRecorder() { return *GetEMotionFX().GetRecorder(); } /**< Get the recorder. */ MCORE_INLINE MotionInstancePool& GetMotionInstancePool() { return *GetEMotionFX().GetMotionInstancePool(); } /**< Get the motion instance pool. */ MCORE_INLINE DebugDraw& GetDebugDraw() { return *GetEMotionFX().GetDebugDraw(); } /**< Get the debug drawing. */ + MCORE_INLINE PoseDataFactory& GetPoseDataFactory() { return *GetEMotionFX().GetPoseDataFactory(); } MCORE_INLINE AZ::Render::RenderActorSettings& GetRenderActorSettings() { return *GetEMotionFX().GetRenderActorSettings(); }/**< Get the render actor settings. */ } // namespace EMotionFX diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/Pose.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/Pose.cpp index e2bff677ad..232bdacfd1 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/Pose.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/Pose.cpp @@ -1428,4 +1428,38 @@ namespace EMotionFX GetEMotionFX().GetThreadData(m_actorInstance->GetThreadIndex())->GetPosePool().FreePose(tempPose); } -} // namespace EMotionFX + + void Pose::DebugDraw(AzFramework::DebugDisplayRequests& debugDisplay, const AZ::Color& color, bool drawPoseDatas) const + { + debugDisplay.SetColor(color); + debugDisplay.DepthTestOff(); + + const Skeleton* skeleton = m_actorInstance->GetActor()->GetSkeleton(); + const size_t numEnabledJoints = m_actorInstance->GetNumEnabledNodes(); + for (size_t i = 0; i < numEnabledJoints; ++i) + { + const size_t jointIndex = m_actorInstance->GetEnabledNode(i); + const size_t parentIndex = skeleton->GetNode(jointIndex)->GetParentIndex(); + if (parentIndex != InvalidIndex) + { + const AZ::Vector3 startPos = GetWorldSpaceTransform(jointIndex).m_position; + const AZ::Vector3 endPos = GetWorldSpaceTransform(parentIndex).m_position; + + debugDisplay.DrawSolidCylinder(/*center=*/(startPos + endPos) * 0.5f, + /*direction=*/(endPos - startPos).GetNormalizedSafe(), + /*radius=*/0.005f, + /*height=*/(endPos - startPos).GetLength(), + /*drawShaded=*/false); + } + } + + if (drawPoseDatas) + { + for (const auto& poseDataItem : m_poseDatas) + { + PoseData* poseData = poseDataItem.second.get(); + poseData->DebugDraw(debugDisplay, color); + } + } + } +} // namespace EMotionFX diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/Pose.h b/Gems/EMotionFX/Code/EMotionFX/Source/Pose.h index b7844276be..451e855150 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/Pose.h +++ b/Gems/EMotionFX/Code/EMotionFX/Source/Pose.h @@ -10,10 +10,10 @@ #include #include +#include #include #include - namespace EMotionFX { // forward declarations @@ -25,10 +25,6 @@ namespace EMotionFX class Skeleton; class MotionLinkData; - /** - * - * - */ class EMFX_API Pose { MCORE_MEMORYOBJECTCATEGORY(Pose, EMFX_DEFAULT_ALIGNMENT, EMFX_MEMCATEGORY_POSE); @@ -192,6 +188,14 @@ namespace EMotionFX template T* GetAndPreparePoseData(ActorInstance* linkToActorInstance) { return azdynamic_cast(GetAndPreparePoseData(azrtti_typeid(), linkToActorInstance)); } + /** + * Draw debug visualization for the given pose. + * @param[in] debugDisplay Debug display request bus to spawn the render commands. + * @param[in] color The color the skeletal pose should be in. + * @param[in] drawPoseDatas Draw the pose data debug visualizations (e.g. joint velocities) along with the actual skeletal pose. [Default = false] + */ + void DebugDraw(AzFramework::DebugDisplayRequests& debugDisplay, const AZ::Color& color, bool drawPoseDatas = false) const; + private: mutable AZStd::vector m_localSpaceTransforms; mutable AZStd::vector m_modelSpaceTransforms; diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/PoseData.h b/Gems/EMotionFX/Code/EMotionFX/Source/PoseData.h index 31c22a3839..69e8800c0a 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/PoseData.h +++ b/Gems/EMotionFX/Code/EMotionFX/Source/PoseData.h @@ -12,9 +12,9 @@ #include #include #include +#include #include - namespace EMotionFX { class Actor; @@ -40,6 +40,8 @@ namespace EMotionFX virtual void Blend(const Pose* destPose, float weight) = 0; + virtual void DebugDraw([[maybe_unused]] AzFramework::DebugDisplayRequests& debugDisplay, [[maybe_unused]] const AZ::Color& color) const {} + bool IsUsed() const { return m_isUsed; } void SetIsUsed(bool isUsed) { m_isUsed = isUsed; } diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/PoseDataFactory.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/PoseDataFactory.cpp index c1c2627c8d..857cc7da7e 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/PoseDataFactory.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/PoseDataFactory.cpp @@ -8,13 +8,20 @@ #include #include +#include #include #include #include - namespace EMotionFX { + AZ_CLASS_ALLOCATOR_IMPL(PoseDataFactory, PoseAllocator, 0) + + PoseDataFactory::PoseDataFactory() + { + AddPoseDataType(azrtti_typeid()); + } + PoseData* PoseDataFactory::Create(Pose* pose, const AZ::TypeId& type) { AZ::SerializeContext* context = nullptr; @@ -34,13 +41,13 @@ namespace EMotionFX return result; } - const AZStd::unordered_set& PoseDataFactory::GetTypeIds() + void PoseDataFactory::AddPoseDataType(const AZ::TypeId& poseDataType) { - static AZStd::unordered_set typeIds = - { - azrtti_typeid() - }; + m_poseDataTypeIds.emplace(poseDataType); + } - return typeIds; + const AZStd::unordered_set& PoseDataFactory::GetTypeIds() const + { + return m_poseDataTypeIds; } } // namespace EMotionFX diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/PoseDataFactory.h b/Gems/EMotionFX/Code/EMotionFX/Source/PoseDataFactory.h index 31bc3e0d3f..624f0aeebf 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/PoseDataFactory.h +++ b/Gems/EMotionFX/Code/EMotionFX/Source/PoseDataFactory.h @@ -25,7 +25,18 @@ namespace EMotionFX class EMFX_API PoseDataFactory { public: + AZ_RTTI(PoseDataFactory, "{F10014A0-2B6A-44E5-BA53-0E11ED566701}") + AZ_CLASS_ALLOCATOR_DECL + + PoseDataFactory(); + virtual ~PoseDataFactory() = default; + static PoseData* Create(Pose* pose, const AZ::TypeId& type); - static const AZStd::unordered_set& GetTypeIds(); + + void AddPoseDataType(const AZ::TypeId& poseDataType); + const AZStd::unordered_set& GetTypeIds() const; + + private: + AZStd::unordered_set m_poseDataTypeIds; }; } // namespace EMotionFX From 4695d36ea5fc5b60a4bf4edb7649ca7cbce3fb1d Mon Sep 17 00:00:00 2001 From: tjmgd <92784061+tjmgd@users.noreply.github.com> Date: Wed, 5 Jan 2022 08:54:34 +0000 Subject: [PATCH 310/948] Fix: Blend node applies both poses at value 1 (#6292) Signed-off-by: T.J. McGrath-Daly Co-authored-by: Tobias Alexander Franke --- Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeBlendNNode.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeBlendNNode.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeBlendNNode.cpp index 7720822655..f4f96e6b93 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeBlendNNode.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/BlendTreeBlendNNode.cpp @@ -224,6 +224,11 @@ namespace EMotionFX poseIndexB = poseIndexA; *outWeight = 0.0f; } + else if ((*outWeight > 1.0f - MCore::Math::epsilon)) + { + poseIndexA = poseIndexB; + *outWeight = 0.0f; + } // Search complete: the input weight is between m_paramWeights[i] and m_paramWeights[i - 1] // Calculate the blend weight and get the nodes and then return From 21d73033b7bd22a7c73bafa97bc082f46389df43 Mon Sep 17 00:00:00 2001 From: Benjamin Jillich <43751992+amzn-jillich@users.noreply.github.com> Date: Wed, 5 Jan 2022 16:53:49 +0100 Subject: [PATCH 311/948] Atom: Frame counter string sometimes extends across the whole width of the viewport (#6689) When going into game mode or after initializing some system that takes a few seconds, the FPS counter showed really large numbers, extending across the whole with of the viewport. In this case, values show "inf" now. Signed-off-by: Benjamin Jillich --- .../AtomViewportDisplayInfoSystemComponent.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/Source/AtomViewportDisplayInfoSystemComponent.cpp b/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/Source/AtomViewportDisplayInfoSystemComponent.cpp index 91844c9b2f..0b11437620 100644 --- a/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/Source/AtomViewportDisplayInfoSystemComponent.cpp +++ b/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/Source/AtomViewportDisplayInfoSystemComponent.cpp @@ -285,13 +285,19 @@ namespace AZ::Render const double frameIntervalSeconds = m_fpsInterval.count(); + auto ClampedFloatDisplay = [](double value, const char* format) -> AZStd::string + { + constexpr float upperLimit = 10000.0f; + return value > upperLimit ? "inf" : AZStd::string::format(format, value); + }; + DrawLine( AZStd::string::format( - "FPS %.1f [%.0f..%.0f], %.1fms/frame, avg over %.1fs", - averageFPS, - minFPS, - maxFPS, - averageFrameMs, + "FPS %s [%s..%s], %sms/frame, avg over %.1fs", + ClampedFloatDisplay(averageFPS, "%.1f").c_str(), + ClampedFloatDisplay(minFPS, "%.0f").c_str(), + ClampedFloatDisplay(maxFPS, "%.0f").c_str(), + ClampedFloatDisplay(averageFrameMs, "%.1f").c_str(), frameIntervalSeconds), AZ::Colors::Yellow); } From c548fd7682b2223647410d4e6e18931f4f11877d Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 5 Jan 2022 08:15:08 -0800 Subject: [PATCH 312/948] Death test relies on an exception from ocurring, that exception is an access violation, which could not happen (i.e. the memory could be valid for the process) (#6683) The test didnt have to be a death test. Also handled the situation better in the code to be able to continue in that scenario (useful for release configurations)" Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Serialization/Json/RegistrationContext.h | 5 ++--- .../Json/JsonRegistrationContextTests.cpp | 16 ++++++---------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Serialization/Json/RegistrationContext.h b/Code/Framework/AzCore/AzCore/Serialization/Json/RegistrationContext.h index dd10e2bff6..202efd3749 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/Json/RegistrationContext.h +++ b/Code/Framework/AzCore/AzCore/Serialization/Json/RegistrationContext.h @@ -45,9 +45,8 @@ namespace AZ } else { - SerializerMap::const_iterator serializerIter = m_jsonSerializers.find(typeId); - AZ_Assert(serializerIter != m_jsonSerializers.end(), "Attempting to unregister a serializer that has not been registered yet with typeid %s", typeId.ToString().c_str()); - m_jsonSerializers.erase(serializerIter); + [[maybe_unused]] size_t erased = m_jsonSerializers.erase(typeId); + AZ_Assert(erased == 1, "Attempting to unregister a serializer that has not been registered yet with typeid %s", typeId.ToString().c_str()); return SerializerBuilder(this, m_jsonSerializers.end()); } } diff --git a/Code/Framework/AzCore/Tests/Serialization/Json/JsonRegistrationContextTests.cpp b/Code/Framework/AzCore/Tests/Serialization/Json/JsonRegistrationContextTests.cpp index 9d4af1def5..9b44f10e89 100644 --- a/Code/Framework/AzCore/Tests/Serialization/Json/JsonRegistrationContextTests.cpp +++ b/Code/Framework/AzCore/Tests/Serialization/Json/JsonRegistrationContextTests.cpp @@ -327,17 +327,13 @@ namespace JsonSerializationTests SerializerWithOneType::Unreflect(m_jsonRegistrationContext.get()); } -#if GTEST_HAS_DEATH_TEST - using JsonSerializationDeathTests = JsonRegistrationContextTests; - TEST_F(JsonSerializationDeathTests, DoubleUnregisterSerializer_Asserts) + TEST_F(JsonRegistrationContextTests, DoubleUnregisterSerializer_Asserts) { - ASSERT_DEATH({ - SerializerWithOneType::Reflect(m_jsonRegistrationContext.get()); - SerializerWithOneType::Unreflect(m_jsonRegistrationContext.get()); - SerializerWithOneType::Unreflect(m_jsonRegistrationContext.get()); - }, ".*" - ); + SerializerWithOneType::Reflect(m_jsonRegistrationContext.get()); + SerializerWithOneType::Unreflect(m_jsonRegistrationContext.get()); + AZ_TEST_START_ASSERTTEST; + SerializerWithOneType::Unreflect(m_jsonRegistrationContext.get()); + AZ_TEST_STOP_ASSERTTEST(1); } -#endif // GTEST_HAS_DEATH_TEST } //namespace JsonSerializationTests From e3bf4311eb1a0c02e5cccc4b01666c1796f069e1 Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Wed, 5 Jan 2022 08:22:47 -0800 Subject: [PATCH 313/948] bugfix: update attenuation when light intensity changed for mode Automatic (#6499) REF: https://github.com/o3de/o3de/issues/6128 Signed-off-by: Michael Pollind --- .../Code/Source/CoreLights/AreaLightComponentController.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/AreaLightComponentController.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/AreaLightComponentController.cpp index 7668477690..d67548c3e9 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/AreaLightComponentController.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/AreaLightComponentController.cpp @@ -261,6 +261,11 @@ namespace AZ::Render m_lightShapeDelegate->SetPhotometricUnit(m_configuration.m_intensityMode); m_lightShapeDelegate->SetIntensity(m_configuration.m_intensity); } + + if (m_configuration.m_attenuationRadiusMode == LightAttenuationRadiusMode::Automatic) + { + AttenuationRadiusChanged(); + } } void AreaLightComponentController::ChromaChanged() From 4ce6909aafc4d25c535233666385542e75c11076 Mon Sep 17 00:00:00 2001 From: SWMasterson Date: Wed, 5 Jan 2022 09:03:28 -0800 Subject: [PATCH 314/948] Move, convert, and rename Lucy level to Hermanubis in AutomatedTesting (#6627) Signed-off-by: Sean Masterson --- .../Graphics/hermanubis/hermanubis.prefab | 705 +++++++++++++ .../Levels/Graphics/hermanubis/tags.txt | 12 + .../hermanubis_high/hermanubis_high.prefab | 943 ++++++++++++++++++ .../Levels/Graphics/hermanubis_high/tags.txt | 12 + .../Hermanubis_Curvature.tif} | 0 .../Objects/Hermanubis/Hermanubis_High.fbx | 3 + .../Hermanubis_Normal.png} | 0 .../Hermanubis_Stone_BaseColor.png} | 0 .../Hermanubis_ao.tif} | 0 .../Hermanubis_brass.material} | 26 +- .../Hermanubis_brass_cavity.tif} | 0 .../Hermanubis_bronze_BaseColor.png} | 0 .../Hermanubis_bronze_Metallic.png} | 0 .../Hermanubis_bronze_Roughness.png} | 0 .../Hermanubis_convexity.tif} | 0 .../Objects/Hermanubis/Hermanubis_low.fbx | 3 + .../Hermanubis_stone.material} | 20 +- .../Hermanubis_thickness.tif} | 0 .../Assets/Objects/Lucy/Lucy_High.fbx | 3 - .../Assets/Objects/Lucy/Lucy_low.fbx | 3 - 20 files changed, 1698 insertions(+), 32 deletions(-) create mode 100644 AutomatedTesting/Levels/Graphics/hermanubis/hermanubis.prefab create mode 100644 AutomatedTesting/Levels/Graphics/hermanubis/tags.txt create mode 100644 AutomatedTesting/Levels/Graphics/hermanubis_high/hermanubis_high.prefab create mode 100644 AutomatedTesting/Levels/Graphics/hermanubis_high/tags.txt rename Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/{Lucy/Lucy_Curvature.tif => Hermanubis/Hermanubis_Curvature.tif} (100%) create mode 100644 Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_High.fbx rename Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/{Lucy/Lucy_Normal.png => Hermanubis/Hermanubis_Normal.png} (100%) rename Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/{Lucy/Lucy_Stone_BaseColor.png => Hermanubis/Hermanubis_Stone_BaseColor.png} (100%) rename Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/{Lucy/Lucy_ao.tif => Hermanubis/Hermanubis_ao.tif} (100%) rename Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/{Lucy/lucy_brass.material => Hermanubis/Hermanubis_brass.material} (59%) rename Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/{Lucy/Lucy_brass_cavity.tif => Hermanubis/Hermanubis_brass_cavity.tif} (100%) rename Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/{Lucy/Lucy_bronze_BaseColor.png => Hermanubis/Hermanubis_bronze_BaseColor.png} (100%) rename Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/{Lucy/Lucy_bronze_Metallic.png => Hermanubis/Hermanubis_bronze_Metallic.png} (100%) rename Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/{Lucy/Lucy_bronze_Roughness.png => Hermanubis/Hermanubis_bronze_Roughness.png} (100%) rename Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/{Lucy/Lucy_convexity.tif => Hermanubis/Hermanubis_convexity.tif} (100%) create mode 100644 Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_low.fbx rename Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/{Lucy/lucy_stone.material => Hermanubis/Hermanubis_stone.material} (77%) rename Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/{Lucy/Lucy_thickness.tif => Hermanubis/Hermanubis_thickness.tif} (100%) delete mode 100644 Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_High.fbx delete mode 100644 Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_low.fbx diff --git a/AutomatedTesting/Levels/Graphics/hermanubis/hermanubis.prefab b/AutomatedTesting/Levels/Graphics/hermanubis/hermanubis.prefab new file mode 100644 index 0000000000..2234b02cfe --- /dev/null +++ b/AutomatedTesting/Levels/Graphics/hermanubis/hermanubis.prefab @@ -0,0 +1,705 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "Hermanubis", + "Components": { + "Component_[10182366347512475253]": { + "$type": "EditorPrefabComponent", + "Id": 10182366347512475253 + }, + "Component_[12917798267488243668]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12917798267488243668 + }, + "Component_[3261249813163778338]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3261249813163778338 + }, + "Component_[3837204912784440039]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 3837204912784440039 + }, + "Component_[4272963378099646759]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 4272963378099646759, + "Parent Entity": "" + }, + "Component_[4848458548047175816]": { + "$type": "EditorVisibilityComponent", + "Id": 4848458548047175816 + }, + "Component_[5787060997243919943]": { + "$type": "EditorInspectorComponent", + "Id": 5787060997243919943 + }, + "Component_[7804170251266531779]": { + "$type": "EditorLockComponent", + "Id": 7804170251266531779 + }, + "Component_[7874177159288365422]": { + "$type": "EditorEntitySortComponent", + "Id": 7874177159288365422 + }, + "Component_[8018146290632383969]": { + "$type": "EditorEntityIconComponent", + "Id": 8018146290632383969 + }, + "Component_[8452360690590857075]": { + "$type": "SelectionComponent", + "Id": 8452360690590857075 + } + } + }, + "Entities": { + "Entity_[250006174949]": { + "Id": "Entity_[250006174949]", + "Name": "WorldOrigin", + "Components": { + "Component_[13379444112629774116]": { + "$type": "EditorEntityIconComponent", + "Id": 13379444112629774116 + }, + "Component_[13797113876161133062]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 13797113876161133062, + "Parent Entity": "ContainerEntity" + }, + "Component_[16382506042739704306]": { + "$type": "EditorInspectorComponent", + "Id": 16382506042739704306, + "ComponentOrderEntryArray": [ + { + "ComponentId": 13797113876161133062 + }, + { + "ComponentId": 8816319458242680670, + "SortIndex": 1 + } + ] + }, + "Component_[2147729086581105478]": { + "$type": "EditorOnlyEntityComponent", + "Id": 2147729086581105478 + }, + "Component_[2433100672102773575]": { + "$type": "SelectionComponent", + "Id": 2433100672102773575 + }, + "Component_[4832829387489613630]": { + "$type": "EditorVisibilityComponent", + "Id": 4832829387489613630 + }, + "Component_[5585931842723227683]": { + "$type": "EditorEntitySortComponent", + "Id": 5585931842723227683, + "Child Entity Order": [ + "Entity_[254301142245]" + ] + }, + "Component_[7088004383223117498]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 7088004383223117498 + }, + "Component_[7856264459806503732]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7856264459806503732 + }, + "Component_[8816319458242680670]": { + "$type": "AZ::Render::EditorGridComponent", + "Id": 8816319458242680670 + }, + "Component_[930042309700959235]": { + "$type": "EditorLockComponent", + "Id": 930042309700959235 + } + } + }, + "Entity_[254301142245]": { + "Id": "Entity_[254301142245]", + "Name": "GlobalSkylight", + "Components": { + "Component_[10076500561520682485]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 10076500561520682485, + "Parent Entity": "Entity_[250006174949]" + }, + "Component_[12626877995248630950]": { + "$type": "EditorInspectorComponent", + "Id": 12626877995248630950, + "ComponentOrderEntryArray": [ + { + "ComponentId": 10076500561520682485 + }, + { + "ComponentId": 8158442301445120126, + "SortIndex": 1 + }, + { + "ComponentId": 7260006984216245935, + "SortIndex": 2 + } + ] + }, + "Component_[13040837632921717329]": { + "$type": "SelectionComponent", + "Id": 13040837632921717329 + }, + "Component_[1390505494369101864]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1390505494369101864 + }, + "Component_[6733278858932131836]": { + "$type": "EditorVisibilityComponent", + "Id": 6733278858932131836 + }, + "Component_[7260006984216245935]": { + "$type": "AZ::Render::EditorImageBasedLightComponent", + "Id": 7260006984216245935, + "Controller": { + "Configuration": { + "diffuseImageAsset": { + "assetId": { + "guid": "{3B78EA69-7CF0-56A7-A49A-110B88412666}", + "subId": 3000 + }, + "assetHint": "lightingpresets/greenwich_park_02_4k_iblskyboxcm_ibldiffuse.exr.streamingimage" + }, + "specularImageAsset": { + "assetId": { + "guid": "{3B78EA69-7CF0-56A7-A49A-110B88412666}", + "subId": 2000 + }, + "assetHint": "lightingpresets/greenwich_park_02_4k_iblskyboxcm_iblspecular.exr.streamingimage" + } + } + } + }, + "Component_[7944006745008331817]": { + "$type": "EditorEntitySortComponent", + "Id": 7944006745008331817 + }, + "Component_[8158442301445120126]": { + "$type": "AZ::Render::EditorHDRiSkyboxComponent", + "Id": 8158442301445120126, + "Controller": { + "Configuration": { + "CubemapAsset": { + "assetId": { + "guid": "{3B78EA69-7CF0-56A7-A49A-110B88412666}", + "subId": 1000 + }, + "assetHint": "lightingpresets/greenwich_park_02_4k_iblskyboxcm.exr.streamingimage" + } + } + } + }, + "Component_[8255370213772594097]": { + "$type": "EditorOnlyEntityComponent", + "Id": 8255370213772594097 + }, + "Component_[8551180373364097938]": { + "$type": "EditorLockComponent", + "Id": 8551180373364097938 + }, + "Component_[8852330656608249928]": { + "$type": "EditorPendingCompositionComponent", + "Id": 8852330656608249928 + }, + "Component_[8913694496991926693]": { + "$type": "EditorEntityIconComponent", + "Id": 8913694496991926693 + } + } + }, + "Entity_[258596109541]": { + "Id": "Entity_[258596109541]", + "Name": "Hermanubis_stone", + "Components": { + "Component_[1026780512255775175]": { + "$type": "EditorEntityIconComponent", + "Id": 1026780512255775175 + }, + "Component_[10882452951986489612]": { + "$type": "SelectionComponent", + "Id": 10882452951986489612 + }, + "Component_[12454042755417175050]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 12454042755417175050, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{1F650917-AA74-5107-9C49-648C957B33DA}", + "subId": 275904906 + }, + "assetHint": "materialeditor/viewportmodels/hermanubis.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[13691807045809495479]": { + "$type": "EditorMaterialComponent", + "Id": 13691807045809495479, + "Controller": { + "Configuration": { + "materials": { + "{}": { + "MaterialAsset": { + "assetId": { + "guid": "{FF6412B6-F86E-54C8-835C-04F08190D81B}" + }, + "assetHint": "objects/hermanubis/hermanubis_stone.azmaterial" + } + } + } + } + }, + "materialSlotsByLodEnabled": true + }, + "Component_[14490373655742304057]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14490373655742304057 + }, + "Component_[15248132570755287431]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 15248132570755287431 + }, + "Component_[16950375358457415777]": { + "$type": "EditorVisibilityComponent", + "Id": 16950375358457415777 + }, + "Component_[17852268252813268496]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 17852268252813268496, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 1.1189539432525635, + 0.0, + 0.0 + ] + } + }, + "Component_[3867610358542973898]": { + "$type": "EditorEntitySortComponent", + "Id": 3867610358542973898 + }, + "Component_[7717372065847089412]": { + "$type": "EditorOnlyEntityComponent", + "Id": 7717372065847089412 + }, + "Component_[7783943040473764331]": { + "$type": "EditorInspectorComponent", + "Id": 7783943040473764331, + "ComponentOrderEntryArray": [ + { + "ComponentId": 17852268252813268496 + }, + { + "ComponentId": 12454042755417175050, + "SortIndex": 1 + }, + { + "ComponentId": 13691807045809495479, + "SortIndex": 2 + } + ] + }, + "Component_[833407121913837256]": { + "$type": "EditorLockComponent", + "Id": 833407121913837256 + } + } + }, + "Entity_[262891076837]": { + "Id": "Entity_[262891076837]", + "Name": "Hermanubis_brass", + "Components": { + "Component_[1026780512255775175]": { + "$type": "EditorEntityIconComponent", + "Id": 1026780512255775175 + }, + "Component_[10882452951986489612]": { + "$type": "SelectionComponent", + "Id": 10882452951986489612 + }, + "Component_[12454042755417175050]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 12454042755417175050, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{1F650917-AA74-5107-9C49-648C957B33DA}", + "subId": 275904906 + }, + "assetHint": "materialeditor/viewportmodels/hermanubis.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[13691807045809495479]": { + "$type": "EditorMaterialComponent", + "Id": 13691807045809495479, + "Controller": { + "Configuration": { + "materials": { + "{}": { + "MaterialAsset": { + "assetId": { + "guid": "{B3AC2305-1DE6-54AA-AAD5-5E77C75E5BB5}" + }, + "assetHint": "objects/hermanubis/hermanubis_brass.azmaterial" + } + } + } + } + }, + "materialSlotsByLodEnabled": true + }, + "Component_[14490373655742304057]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14490373655742304057 + }, + "Component_[15248132570755287431]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 15248132570755287431 + }, + "Component_[16950375358457415777]": { + "$type": "EditorVisibilityComponent", + "Id": 16950375358457415777 + }, + "Component_[17852268252813268496]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 17852268252813268496, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -1.4824472665786743, + -0.034557100385427475, + 0.0 + ] + } + }, + "Component_[3867610358542973898]": { + "$type": "EditorEntitySortComponent", + "Id": 3867610358542973898 + }, + "Component_[7717372065847089412]": { + "$type": "EditorOnlyEntityComponent", + "Id": 7717372065847089412 + }, + "Component_[7783943040473764331]": { + "$type": "EditorInspectorComponent", + "Id": 7783943040473764331, + "ComponentOrderEntryArray": [ + { + "ComponentId": 17852268252813268496 + }, + { + "ComponentId": 12454042755417175050, + "SortIndex": 1 + }, + { + "ComponentId": 13691807045809495479, + "SortIndex": 2 + } + ] + }, + "Component_[833407121913837256]": { + "$type": "EditorLockComponent", + "Id": 833407121913837256 + } + } + }, + "Entity_[267186044133]": { + "Id": "Entity_[267186044133]", + "Name": "SphereLight", + "Components": { + "Component_[10922228943444131599]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 10922228943444131599 + }, + "Component_[11625534306113165068]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11625534306113165068, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 0.2636711895465851, + 2.2845842838287354, + 0.22468790411949158 + ] + } + }, + "Component_[12372418243816154216]": { + "$type": "EditorSphereShapeComponent", + "Id": 12372418243816154216, + "ShapeColor": [ + 0.3289234936237335, + 0.7307698130607605, + 0.14859239757061005, + 1.0 + ] + }, + "Component_[12579170654872581897]": { + "$type": "EditorLockComponent", + "Id": 12579170654872581897 + }, + "Component_[12844637542561882557]": { + "$type": "EditorOnlyEntityComponent", + "Id": 12844637542561882557 + }, + "Component_[13087890528096920855]": { + "$type": "EditorInspectorComponent", + "Id": 13087890528096920855, + "ComponentOrderEntryArray": [ + { + "ComponentId": 11625534306113165068 + }, + { + "ComponentId": 13427905514841050195, + "SortIndex": 1 + }, + { + "ComponentId": 12372418243816154216, + "SortIndex": 2 + } + ] + }, + "Component_[13427905514841050195]": { + "$type": "AZ::Render::EditorAreaLightComponent", + "Id": 13427905514841050195, + "Controller": { + "Configuration": { + "LightType": 1, + "Color": [ + 0.3289234936237335, + 0.7307698130607605, + 0.14859239757061005 + ], + "IntensityMode": 1, + "Intensity": 676.7677001953125, + "AttenuationRadius": 226.51287841796875 + } + } + }, + "Component_[15364092815744365073]": { + "$type": "SelectionComponent", + "Id": 15364092815744365073 + }, + "Component_[2481373975540551564]": { + "$type": "EditorPendingCompositionComponent", + "Id": 2481373975540551564 + }, + "Component_[4101167782224846352]": { + "$type": "EditorEntityIconComponent", + "Id": 4101167782224846352 + }, + "Component_[8664715119660216219]": { + "$type": "EditorEntitySortComponent", + "Id": 8664715119660216219 + }, + "Component_[8952093761729701957]": { + "$type": "EditorVisibilityComponent", + "Id": 8952093761729701957, + "VisibilityFlag": false + } + } + }, + "Entity_[275775978725]": { + "Id": "Entity_[275775978725]", + "Name": "TubeLight", + "Components": { + "Component_[10922228943444131599]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 10922228943444131599, + "DisabledComponents": [ + { + "$type": "EditorSphereShapeComponent", + "Id": 12372418243816154216, + "ShapeColor": [ + 0.3289234936237335, + 0.7307698130607605, + 0.14859239757061005, + 1.0 + ] + } + ] + }, + "Component_[11625534306113165068]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11625534306113165068, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -4.275930881500244, + 0.5104026794433594, + 2.3807857036590576 + ], + "Rotate": [ + 270.0043029785156, + 0.16617189347743988, + 268.51611328125 + ] + } + }, + "Component_[12579170654872581897]": { + "$type": "EditorLockComponent", + "Id": 12579170654872581897 + }, + "Component_[12844637542561882557]": { + "$type": "EditorOnlyEntityComponent", + "Id": 12844637542561882557 + }, + "Component_[13087890528096920855]": { + "$type": "EditorInspectorComponent", + "Id": 13087890528096920855, + "ComponentOrderEntryArray": [ + { + "ComponentId": 11625534306113165068 + }, + { + "ComponentId": 13427905514841050195, + "SortIndex": 1 + }, + { + "ComponentId": 12372418243816154216, + "SortIndex": 2 + }, + { + "ComponentId": 2193911499802409037, + "SortIndex": 3 + } + ] + }, + "Component_[13427905514841050195]": { + "$type": "AZ::Render::EditorAreaLightComponent", + "Id": 13427905514841050195, + "Controller": { + "Configuration": { + "LightType": 3, + "Color": [ + 0.8521705865859985, + 0.7865872979164124, + 0.6079347133636475 + ], + "IntensityMode": 1, + "Intensity": 10000.0, + "AttenuationRadius": 21608.193359375 + } + } + }, + "Component_[15364092815744365073]": { + "$type": "SelectionComponent", + "Id": 15364092815744365073 + }, + "Component_[2193911499802409037]": { + "$type": "EditorCapsuleShapeComponent", + "Id": 2193911499802409037, + "ShapeColor": [ + 0.8521705865859985, + 0.7865872979164124, + 0.6079347133636475, + 1.0 + ], + "CapsuleShape": { + "Configuration": { + "Height": 5.0, + "Radius": 0.10000000149011612 + } + } + }, + "Component_[2481373975540551564]": { + "$type": "EditorPendingCompositionComponent", + "Id": 2481373975540551564 + }, + "Component_[4101167782224846352]": { + "$type": "EditorEntityIconComponent", + "Id": 4101167782224846352 + }, + "Component_[8664715119660216219]": { + "$type": "EditorEntitySortComponent", + "Id": 8664715119660216219 + }, + "Component_[8952093761729701957]": { + "$type": "EditorVisibilityComponent", + "Id": 8952093761729701957, + "VisibilityFlag": false + } + } + }, + "Entity_[482743502241]": { + "Id": "Entity_[482743502241]", + "Name": "Camera1", + "Components": { + "Component_[10672707967016183310]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 10672707967016183310 + }, + "Component_[13520081755303040361]": { + "$type": "EditorLockComponent", + "Id": 13520081755303040361 + }, + "Component_[13650522584195762912]": { + "$type": "SelectionComponent", + "Id": 13650522584195762912 + }, + "Component_[14204465933176839167]": { + "$type": "EditorOnlyEntityComponent", + "Id": 14204465933176839167 + }, + "Component_[14509697511269710983]": { + "$type": "EditorEntitySortComponent", + "Id": 14509697511269710983 + }, + "Component_[271930369355383880]": { + "$type": "EditorEntityIconComponent", + "Id": 271930369355383880 + }, + "Component_[5015186380056948439]": { + "$type": "EditorInspectorComponent", + "Id": 5015186380056948439 + }, + "Component_[6297637832938894772]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6297637832938894772, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -0.0018702250672504306, + 2.9982283115386963, + 3.0017592906951904 + ], + "Rotate": [ + 20.080352783203125, + -0.020488755777478218, + 179.92381286621094 + ] + } + }, + "Component_[6611378759823339947]": { + "$type": "EditorPendingCompositionComponent", + "Id": 6611378759823339947 + }, + "Component_[8475839846509409509]": { + "$type": "{CA11DA46-29FF-4083-B5F6-E02C3A8C3A3D} EditorCameraComponent", + "Id": 8475839846509409509, + "Controller": { + "Configuration": { + "Field of View": 90.00020599365234, + "EditorEntityId": 478448534945 + } + } + }, + "Component_[9659542522325095386]": { + "$type": "EditorVisibilityComponent", + "Id": 9659542522325095386 + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/Graphics/hermanubis/tags.txt b/AutomatedTesting/Levels/Graphics/hermanubis/tags.txt new file mode 100644 index 0000000000..0d6c1880e7 --- /dev/null +++ b/AutomatedTesting/Levels/Graphics/hermanubis/tags.txt @@ -0,0 +1,12 @@ +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 diff --git a/AutomatedTesting/Levels/Graphics/hermanubis_high/hermanubis_high.prefab b/AutomatedTesting/Levels/Graphics/hermanubis_high/hermanubis_high.prefab new file mode 100644 index 0000000000..3378a0c144 --- /dev/null +++ b/AutomatedTesting/Levels/Graphics/hermanubis_high/hermanubis_high.prefab @@ -0,0 +1,943 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "hermanubis_high", + "Components": { + "Component_[10182366347512475253]": { + "$type": "EditorPrefabComponent", + "Id": 10182366347512475253 + }, + "Component_[12917798267488243668]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12917798267488243668 + }, + "Component_[3261249813163778338]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3261249813163778338 + }, + "Component_[3837204912784440039]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 3837204912784440039 + }, + "Component_[4272963378099646759]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 4272963378099646759, + "Parent Entity": "" + }, + "Component_[4848458548047175816]": { + "$type": "EditorVisibilityComponent", + "Id": 4848458548047175816 + }, + "Component_[5787060997243919943]": { + "$type": "EditorInspectorComponent", + "Id": 5787060997243919943 + }, + "Component_[7804170251266531779]": { + "$type": "EditorLockComponent", + "Id": 7804170251266531779 + }, + "Component_[7874177159288365422]": { + "$type": "EditorEntitySortComponent", + "Id": 7874177159288365422, + "Child Entity Order": [ + "Entity_[243647107259]", + "Entity_[247179151093]", + "Entity_[262891076837]", + "Entity_[242884183797]", + "Entity_[258596109541]", + "Entity_[267186044133]", + "Entity_[275775978725]", + "Entity_[250006174949]" + ] + }, + "Component_[8018146290632383969]": { + "$type": "EditorEntityIconComponent", + "Id": 8018146290632383969 + }, + "Component_[8452360690590857075]": { + "$type": "SelectionComponent", + "Id": 8452360690590857075 + } + } + }, + "Entities": { + "Entity_[242884183797]": { + "Id": "Entity_[242884183797]", + "Name": "Hermanubis_stone", + "Components": { + "Component_[1026780512255775175]": { + "$type": "EditorEntityIconComponent", + "Id": 1026780512255775175 + }, + "Component_[10882452951986489612]": { + "$type": "SelectionComponent", + "Id": 10882452951986489612 + }, + "Component_[12454042755417175050]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 12454042755417175050, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{35A45F31-F1C1-5076-8B51-FF599E2EEBAA}", + "subId": 274433667 + }, + "assetHint": "objects/hermanubis/hermanubis_high.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[13691807045809495479]": { + "$type": "EditorMaterialComponent", + "Id": 13691807045809495479, + "Controller": { + "Configuration": { + "materials": { + "{}": { + "MaterialAsset": { + "assetId": { + "guid": "{A78EA2FC-688B-5E3A-A7F6-DB413D11D4CF}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_matte.azmaterial" + } + } + } + } + }, + "materialSlotsByLodEnabled": true + }, + "Component_[14490373655742304057]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14490373655742304057 + }, + "Component_[15248132570755287431]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 15248132570755287431 + }, + "Component_[16950375358457415777]": { + "$type": "EditorVisibilityComponent", + "Id": 16950375358457415777 + }, + "Component_[17852268252813268496]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 17852268252813268496, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 3.810185432434082, + 0.0, + 0.0 + ] + } + }, + "Component_[3867610358542973898]": { + "$type": "EditorEntitySortComponent", + "Id": 3867610358542973898 + }, + "Component_[7717372065847089412]": { + "$type": "EditorOnlyEntityComponent", + "Id": 7717372065847089412 + }, + "Component_[7783943040473764331]": { + "$type": "EditorInspectorComponent", + "Id": 7783943040473764331, + "ComponentOrderEntryArray": [ + { + "ComponentId": 17852268252813268496 + }, + { + "ComponentId": 12454042755417175050, + "SortIndex": 1 + }, + { + "ComponentId": 13691807045809495479, + "SortIndex": 2 + } + ] + }, + "Component_[833407121913837256]": { + "$type": "EditorLockComponent", + "Id": 833407121913837256 + } + } + }, + "Entity_[243647107259]": { + "Id": "Entity_[243647107259]", + "Name": "Camera1", + "Components": { + "Component_[11276153162797125616]": { + "$type": "GenericComponentWrapper", + "Id": 11276153162797125616, + "m_template": { + "$type": "FlyCameraInputComponent" + } + }, + "Component_[11484120648160206262]": { + "$type": "EditorLockComponent", + "Id": 11484120648160206262 + }, + "Component_[14251459960897306807]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 14251459960897306807, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -0.10533800721168518, + -4.001697063446045, + 3.061025619506836 + ], + "Rotate": [ + -19.998117446899414, + 0.01881762035191059, + -0.051706261932849884 + ], + "Scale": [ + 0.9999998807907104, + 1.0, + 1.0 + ] + } + }, + "Component_[149351061984148634]": { + "$type": "EditorOnlyEntityComponent", + "Id": 149351061984148634 + }, + "Component_[15121925351155689107]": { + "$type": "{CA11DA46-29FF-4083-B5F6-E02C3A8C3A3D} EditorCameraComponent", + "Id": 15121925351155689107, + "Controller": { + "Configuration": { + "EditorEntityId": 243647107259 + } + } + }, + "Component_[15327903729148812780]": { + "$type": "EditorPendingCompositionComponent", + "Id": 15327903729148812780 + }, + "Component_[17667820301809320373]": { + "$type": "EditorEntityIconComponent", + "Id": 17667820301809320373 + }, + "Component_[17708351813187009272]": { + "$type": "EditorVisibilityComponent", + "Id": 17708351813187009272 + }, + "Component_[17941668830905411554]": { + "$type": "SelectionComponent", + "Id": 17941668830905411554 + }, + "Component_[48451466091772435]": { + "$type": "EditorEntitySortComponent", + "Id": 48451466091772435 + }, + "Component_[6163614082436403601]": { + "$type": "EditorInspectorComponent", + "Id": 6163614082436403601, + "ComponentOrderEntryArray": [ + { + "ComponentId": 14251459960897306807 + }, + { + "ComponentId": 15121925351155689107, + "SortIndex": 1 + }, + { + "ComponentId": 11935019334576395684, + "SortIndex": 2 + } + ] + }, + "Component_[8660334631968180943]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 8660334631968180943 + } + } + }, + "Entity_[247179151093]": { + "Id": "Entity_[247179151093]", + "Name": "Hermanubis_brass", + "Components": { + "Component_[1026780512255775175]": { + "$type": "EditorEntityIconComponent", + "Id": 1026780512255775175 + }, + "Component_[10882452951986489612]": { + "$type": "SelectionComponent", + "Id": 10882452951986489612 + }, + "Component_[12454042755417175050]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 12454042755417175050, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{35A45F31-F1C1-5076-8B51-FF599E2EEBAA}", + "subId": 274433667 + }, + "assetHint": "objects/hermanubis/hermanubis_high.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[13691807045809495479]": { + "$type": "EditorMaterialComponent", + "Id": 13691807045809495479, + "Controller": { + "Configuration": { + "materials": { + "{}": { + "MaterialAsset": { + "assetId": { + "guid": "{80E0F2A7-1EE4-597F-80EF-985C65BCE2EB}" + }, + "assetHint": "materials/presets/pbr/metal_brass.azmaterial" + } + } + } + } + }, + "materialSlotsByLodEnabled": true + }, + "Component_[14490373655742304057]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14490373655742304057 + }, + "Component_[15248132570755287431]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 15248132570755287431 + }, + "Component_[16950375358457415777]": { + "$type": "EditorVisibilityComponent", + "Id": 16950375358457415777 + }, + "Component_[17852268252813268496]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 17852268252813268496, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -4.019397258758545, + -0.034557100385427475, + 0.0 + ] + } + }, + "Component_[3867610358542973898]": { + "$type": "EditorEntitySortComponent", + "Id": 3867610358542973898 + }, + "Component_[7717372065847089412]": { + "$type": "EditorOnlyEntityComponent", + "Id": 7717372065847089412 + }, + "Component_[7783943040473764331]": { + "$type": "EditorInspectorComponent", + "Id": 7783943040473764331, + "ComponentOrderEntryArray": [ + { + "ComponentId": 17852268252813268496 + }, + { + "ComponentId": 12454042755417175050, + "SortIndex": 1 + }, + { + "ComponentId": 13691807045809495479, + "SortIndex": 2 + } + ] + }, + "Component_[833407121913837256]": { + "$type": "EditorLockComponent", + "Id": 833407121913837256 + } + } + }, + "Entity_[250006174949]": { + "Id": "Entity_[250006174949]", + "Name": "WorldOrigin", + "Components": { + "Component_[13379444112629774116]": { + "$type": "EditorEntityIconComponent", + "Id": 13379444112629774116 + }, + "Component_[13797113876161133062]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 13797113876161133062, + "Parent Entity": "ContainerEntity" + }, + "Component_[16382506042739704306]": { + "$type": "EditorInspectorComponent", + "Id": 16382506042739704306, + "ComponentOrderEntryArray": [ + { + "ComponentId": 13797113876161133062 + }, + { + "ComponentId": 8816319458242680670, + "SortIndex": 1 + } + ] + }, + "Component_[2147729086581105478]": { + "$type": "EditorOnlyEntityComponent", + "Id": 2147729086581105478 + }, + "Component_[2433100672102773575]": { + "$type": "SelectionComponent", + "Id": 2433100672102773575 + }, + "Component_[4832829387489613630]": { + "$type": "EditorVisibilityComponent", + "Id": 4832829387489613630 + }, + "Component_[5585931842723227683]": { + "$type": "EditorEntitySortComponent", + "Id": 5585931842723227683, + "Child Entity Order": [ + "Entity_[254301142245]" + ] + }, + "Component_[7088004383223117498]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 7088004383223117498 + }, + "Component_[7856264459806503732]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7856264459806503732 + }, + "Component_[8816319458242680670]": { + "$type": "AZ::Render::EditorGridComponent", + "Id": 8816319458242680670 + }, + "Component_[930042309700959235]": { + "$type": "EditorLockComponent", + "Id": 930042309700959235 + } + } + }, + "Entity_[254301142245]": { + "Id": "Entity_[254301142245]", + "Name": "GlobalSkylight", + "Components": { + "Component_[10076500561520682485]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 10076500561520682485, + "Parent Entity": "Entity_[250006174949]" + }, + "Component_[12626877995248630950]": { + "$type": "EditorInspectorComponent", + "Id": 12626877995248630950, + "ComponentOrderEntryArray": [ + { + "ComponentId": 10076500561520682485 + }, + { + "ComponentId": 8158442301445120126, + "SortIndex": 1 + }, + { + "ComponentId": 7260006984216245935, + "SortIndex": 2 + } + ] + }, + "Component_[13040837632921717329]": { + "$type": "SelectionComponent", + "Id": 13040837632921717329 + }, + "Component_[1390505494369101864]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1390505494369101864 + }, + "Component_[6733278858932131836]": { + "$type": "EditorVisibilityComponent", + "Id": 6733278858932131836 + }, + "Component_[7260006984216245935]": { + "$type": "AZ::Render::EditorImageBasedLightComponent", + "Id": 7260006984216245935, + "Controller": { + "Configuration": { + "diffuseImageAsset": { + "assetId": { + "guid": "{3B78EA69-7CF0-56A7-A49A-110B88412666}", + "subId": 3000 + }, + "assetHint": "lightingpresets/greenwich_park_02_4k_iblskyboxcm_ibldiffuse.exr.streamingimage" + }, + "specularImageAsset": { + "assetId": { + "guid": "{3B78EA69-7CF0-56A7-A49A-110B88412666}", + "subId": 2000 + }, + "assetHint": "lightingpresets/greenwich_park_02_4k_iblskyboxcm_iblspecular.exr.streamingimage" + } + } + } + }, + "Component_[7944006745008331817]": { + "$type": "EditorEntitySortComponent", + "Id": 7944006745008331817 + }, + "Component_[8158442301445120126]": { + "$type": "AZ::Render::EditorHDRiSkyboxComponent", + "Id": 8158442301445120126, + "Controller": { + "Configuration": { + "CubemapAsset": { + "assetId": { + "guid": "{3B78EA69-7CF0-56A7-A49A-110B88412666}", + "subId": 1000 + }, + "assetHint": "lightingpresets/greenwich_park_02_4k_iblskyboxcm.exr.streamingimage" + } + } + } + }, + "Component_[8255370213772594097]": { + "$type": "EditorOnlyEntityComponent", + "Id": 8255370213772594097 + }, + "Component_[8551180373364097938]": { + "$type": "EditorLockComponent", + "Id": 8551180373364097938 + }, + "Component_[8852330656608249928]": { + "$type": "EditorPendingCompositionComponent", + "Id": 8852330656608249928 + }, + "Component_[8913694496991926693]": { + "$type": "EditorEntityIconComponent", + "Id": 8913694496991926693 + } + } + }, + "Entity_[258596109541]": { + "Id": "Entity_[258596109541]", + "Name": "Hermanubis_stone", + "Components": { + "Component_[1026780512255775175]": { + "$type": "EditorEntityIconComponent", + "Id": 1026780512255775175 + }, + "Component_[10882452951986489612]": { + "$type": "SelectionComponent", + "Id": 10882452951986489612 + }, + "Component_[12454042755417175050]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 12454042755417175050, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{35A45F31-F1C1-5076-8B51-FF599E2EEBAA}", + "subId": 274433667 + }, + "assetHint": "objects/hermanubis/hermanubis_high.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[13691807045809495479]": { + "$type": "EditorMaterialComponent", + "Id": 13691807045809495479, + "Controller": { + "Configuration": { + "materials": { + "{}": { + "MaterialAsset": { + "assetId": { + "guid": "{B7C712DC-4839-58BB-B522-A4F120084CF5}" + }, + "assetHint": "materials/presets/pbr/metal_chrome.azmaterial" + } + } + } + } + }, + "materialSlotsByLodEnabled": true + }, + "Component_[14490373655742304057]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14490373655742304057 + }, + "Component_[15248132570755287431]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 15248132570755287431 + }, + "Component_[16950375358457415777]": { + "$type": "EditorVisibilityComponent", + "Id": 16950375358457415777 + }, + "Component_[17852268252813268496]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 17852268252813268496, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 1.1189539432525635, + 0.0, + 0.0 + ] + } + }, + "Component_[3867610358542973898]": { + "$type": "EditorEntitySortComponent", + "Id": 3867610358542973898 + }, + "Component_[7717372065847089412]": { + "$type": "EditorOnlyEntityComponent", + "Id": 7717372065847089412 + }, + "Component_[7783943040473764331]": { + "$type": "EditorInspectorComponent", + "Id": 7783943040473764331, + "ComponentOrderEntryArray": [ + { + "ComponentId": 17852268252813268496 + }, + { + "ComponentId": 12454042755417175050, + "SortIndex": 1 + }, + { + "ComponentId": 13691807045809495479, + "SortIndex": 2 + } + ] + }, + "Component_[833407121913837256]": { + "$type": "EditorLockComponent", + "Id": 833407121913837256 + } + } + }, + "Entity_[262891076837]": { + "Id": "Entity_[262891076837]", + "Name": "Hermanubis_brass", + "Components": { + "Component_[1026780512255775175]": { + "$type": "EditorEntityIconComponent", + "Id": 1026780512255775175 + }, + "Component_[10882452951986489612]": { + "$type": "SelectionComponent", + "Id": 10882452951986489612 + }, + "Component_[12454042755417175050]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 12454042755417175050, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{35A45F31-F1C1-5076-8B51-FF599E2EEBAA}", + "subId": 274433667 + }, + "assetHint": "objects/hermanubis/hermanubis_high.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[13691807045809495479]": { + "$type": "EditorMaterialComponent", + "Id": 13691807045809495479, + "Controller": { + "Configuration": { + "materials": { + "{}": { + "MaterialAsset": { + "assetId": { + "guid": "{CAF50181-3384-5DF2-9304-C6E48E83C72D}" + }, + "assetHint": "materials/presets/pbr/metal_chrome_polished.azmaterial" + } + } + } + } + }, + "materialSlotsByLodEnabled": true + }, + "Component_[14490373655742304057]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14490373655742304057 + }, + "Component_[15248132570755287431]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 15248132570755287431 + }, + "Component_[16950375358457415777]": { + "$type": "EditorVisibilityComponent", + "Id": 16950375358457415777 + }, + "Component_[17852268252813268496]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 17852268252813268496, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -1.4824472665786743, + -0.034557100385427475, + 0.0 + ] + } + }, + "Component_[3867610358542973898]": { + "$type": "EditorEntitySortComponent", + "Id": 3867610358542973898 + }, + "Component_[7717372065847089412]": { + "$type": "EditorOnlyEntityComponent", + "Id": 7717372065847089412 + }, + "Component_[7783943040473764331]": { + "$type": "EditorInspectorComponent", + "Id": 7783943040473764331, + "ComponentOrderEntryArray": [ + { + "ComponentId": 17852268252813268496 + }, + { + "ComponentId": 12454042755417175050, + "SortIndex": 1 + }, + { + "ComponentId": 13691807045809495479, + "SortIndex": 2 + } + ] + }, + "Component_[833407121913837256]": { + "$type": "EditorLockComponent", + "Id": 833407121913837256 + } + } + }, + "Entity_[267186044133]": { + "Id": "Entity_[267186044133]", + "Name": "SphereLight", + "Components": { + "Component_[10922228943444131599]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 10922228943444131599 + }, + "Component_[11625534306113165068]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11625534306113165068, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 0.2636711895465851, + 2.2845842838287354, + 0.22468790411949158 + ] + } + }, + "Component_[12372418243816154216]": { + "$type": "EditorSphereShapeComponent", + "Id": 12372418243816154216, + "ShapeColor": [ + 0.3289234936237335, + 0.7307698130607605, + 0.14859239757061005, + 1.0 + ] + }, + "Component_[12579170654872581897]": { + "$type": "EditorLockComponent", + "Id": 12579170654872581897 + }, + "Component_[12844637542561882557]": { + "$type": "EditorOnlyEntityComponent", + "Id": 12844637542561882557 + }, + "Component_[13087890528096920855]": { + "$type": "EditorInspectorComponent", + "Id": 13087890528096920855, + "ComponentOrderEntryArray": [ + { + "ComponentId": 11625534306113165068 + }, + { + "ComponentId": 13427905514841050195, + "SortIndex": 1 + }, + { + "ComponentId": 12372418243816154216, + "SortIndex": 2 + } + ] + }, + "Component_[13427905514841050195]": { + "$type": "AZ::Render::EditorAreaLightComponent", + "Id": 13427905514841050195, + "Controller": { + "Configuration": { + "LightType": 1, + "Color": [ + 0.3289234936237335, + 0.7307698130607605, + 0.14859239757061005 + ], + "IntensityMode": 1, + "Intensity": 676.7677001953125, + "AttenuationRadius": 226.51287841796875 + } + } + }, + "Component_[15364092815744365073]": { + "$type": "SelectionComponent", + "Id": 15364092815744365073 + }, + "Component_[2481373975540551564]": { + "$type": "EditorPendingCompositionComponent", + "Id": 2481373975540551564 + }, + "Component_[4101167782224846352]": { + "$type": "EditorEntityIconComponent", + "Id": 4101167782224846352 + }, + "Component_[8664715119660216219]": { + "$type": "EditorEntitySortComponent", + "Id": 8664715119660216219 + }, + "Component_[8952093761729701957]": { + "$type": "EditorVisibilityComponent", + "Id": 8952093761729701957, + "VisibilityFlag": false + } + } + }, + "Entity_[275775978725]": { + "Id": "Entity_[275775978725]", + "Name": "TubeLight", + "Components": { + "Component_[10922228943444131599]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 10922228943444131599, + "DisabledComponents": [ + { + "$type": "EditorSphereShapeComponent", + "Id": 12372418243816154216, + "ShapeColor": [ + 0.3289234936237335, + 0.7307698130607605, + 0.14859239757061005, + 1.0 + ] + } + ] + }, + "Component_[11625534306113165068]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 11625534306113165068, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + -4.275930881500244, + 0.5104026794433594, + 2.3807857036590576 + ], + "Rotate": [ + 270.0043029785156, + 0.16617189347743988, + 268.51611328125 + ] + } + }, + "Component_[12579170654872581897]": { + "$type": "EditorLockComponent", + "Id": 12579170654872581897 + }, + "Component_[12844637542561882557]": { + "$type": "EditorOnlyEntityComponent", + "Id": 12844637542561882557 + }, + "Component_[13087890528096920855]": { + "$type": "EditorInspectorComponent", + "Id": 13087890528096920855, + "ComponentOrderEntryArray": [ + { + "ComponentId": 11625534306113165068 + }, + { + "ComponentId": 13427905514841050195, + "SortIndex": 1 + }, + { + "ComponentId": 12372418243816154216, + "SortIndex": 2 + }, + { + "ComponentId": 2193911499802409037, + "SortIndex": 3 + } + ] + }, + "Component_[13427905514841050195]": { + "$type": "AZ::Render::EditorAreaLightComponent", + "Id": 13427905514841050195, + "Controller": { + "Configuration": { + "LightType": 3, + "Color": [ + 0.8521705865859985, + 0.7865872979164124, + 0.6079347133636475 + ], + "IntensityMode": 1, + "Intensity": 10000.0, + "AttenuationRadius": 21608.193359375 + } + } + }, + "Component_[15364092815744365073]": { + "$type": "SelectionComponent", + "Id": 15364092815744365073 + }, + "Component_[2193911499802409037]": { + "$type": "EditorCapsuleShapeComponent", + "Id": 2193911499802409037, + "ShapeColor": [ + 0.8521705865859985, + 0.7865872979164124, + 0.6079347133636475, + 1.0 + ], + "CapsuleShape": { + "Configuration": { + "Height": 5.0, + "Radius": 0.10000000149011612 + } + } + }, + "Component_[2481373975540551564]": { + "$type": "EditorPendingCompositionComponent", + "Id": 2481373975540551564 + }, + "Component_[4101167782224846352]": { + "$type": "EditorEntityIconComponent", + "Id": 4101167782224846352 + }, + "Component_[8664715119660216219]": { + "$type": "EditorEntitySortComponent", + "Id": 8664715119660216219 + }, + "Component_[8952093761729701957]": { + "$type": "EditorVisibilityComponent", + "Id": 8952093761729701957, + "VisibilityFlag": false + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/Graphics/hermanubis_high/tags.txt b/AutomatedTesting/Levels/Graphics/hermanubis_high/tags.txt new file mode 100644 index 0000000000..0d6c1880e7 --- /dev/null +++ b/AutomatedTesting/Levels/Graphics/hermanubis_high/tags.txt @@ -0,0 +1,12 @@ +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 diff --git a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_Curvature.tif b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_Curvature.tif similarity index 100% rename from Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_Curvature.tif rename to Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_Curvature.tif diff --git a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_High.fbx b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_High.fbx new file mode 100644 index 0000000000..0625c89874 --- /dev/null +++ b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_High.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d72cec207a7677ba027eac72f41285907237e04a45ebacf64341de86fc6f022d +size 159115308 diff --git a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_Normal.png b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_Normal.png similarity index 100% rename from Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_Normal.png rename to Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_Normal.png diff --git a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_Stone_BaseColor.png b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_Stone_BaseColor.png similarity index 100% rename from Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_Stone_BaseColor.png rename to Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_Stone_BaseColor.png diff --git a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_ao.tif b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_ao.tif similarity index 100% rename from Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_ao.tif rename to Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_ao.tif diff --git a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/lucy_brass.material b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_brass.material similarity index 59% rename from Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/lucy_brass.material rename to Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_brass.material index 6e490cb0b1..4ad325b086 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/lucy_brass.material +++ b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_brass.material @@ -1,39 +1,33 @@ { "description": "", - "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "Materials/Presets/PBR/metal_brass.material", - "propertyLayoutVersion": 3, + "materialType": "Materials/Types/StandardPBR.materialtype", + "materialTypeVersion": 4, "properties": { - "occlusion": { - "diffuseTextureMap": "Objects/Lucy/Lucy_ao.tif", - "diffuseTextureMapUv": "Unwrapped" - }, "baseColor": { - "color": [ - 0.6745098233222961, - 0.48627451062202456, - 0.19607843458652497, - 1.0 - ], "factor": 1.0, "textureBlendMode": "Lerp", - "textureMap": "Objects/Lucy/Lucy_bronze_BaseColor.png", + "textureMap": "Hermanubis_bronze_BaseColor.png", "textureMapUv": "Unwrapped" }, "general": { "applySpecularAA": true }, "metallic": { - "textureMap": "Objects/Lucy/Lucy_bronze_Metallic.png", + "textureMap": "Hermanubis_bronze_Metallic.png", "textureMapUv": "Unwrapped" }, "normal": { "flipY": true, - "textureMap": "Objects/Lucy/Lucy_Normal.png", + "textureMap": "Hermanubis_Normal.png", "textureMapUv": "Unwrapped" }, + "occlusion": { + "diffuseTextureMap": "Hermanubis_ao.tif", + "diffuseTextureMapUv": "Unwrapped" + }, "roughness": { - "textureMap": "Objects/Lucy/Lucy_bronze_Roughness.png", + "textureMap": "Hermanubis_bronze_Roughness.png", "textureMapUv": "Unwrapped", "upperBound": 0.6767677068710327 } diff --git a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_brass_cavity.tif b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_brass_cavity.tif similarity index 100% rename from Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_brass_cavity.tif rename to Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_brass_cavity.tif diff --git a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_bronze_BaseColor.png b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_bronze_BaseColor.png similarity index 100% rename from Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_bronze_BaseColor.png rename to Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_bronze_BaseColor.png diff --git a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_bronze_Metallic.png b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_bronze_Metallic.png similarity index 100% rename from Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_bronze_Metallic.png rename to Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_bronze_Metallic.png diff --git a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_bronze_Roughness.png b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_bronze_Roughness.png similarity index 100% rename from Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_bronze_Roughness.png rename to Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_bronze_Roughness.png diff --git a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_convexity.tif b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_convexity.tif similarity index 100% rename from Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_convexity.tif rename to Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_convexity.tif diff --git a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_low.fbx b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_low.fbx new file mode 100644 index 0000000000..79960433dd --- /dev/null +++ b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_low.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4c9d1030b9467b58d640fbedf1bc58ab9a5f7d68811b2452dd8d60114287b731 +size 12410812 diff --git a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/lucy_stone.material b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_stone.material similarity index 77% rename from Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/lucy_stone.material rename to Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_stone.material index a0e54d9d0e..1ba59a50c5 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/lucy_stone.material +++ b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_stone.material @@ -1,13 +1,9 @@ { "description": "", - "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "Materials/Presets/PBR/metal_brass.material", - "propertyLayoutVersion": 3, + "materialType": "Materials/Types/StandardPBR.materialtype", + "materialTypeVersion": 4, "properties": { - "occlusion": { - "diffuseTextureMap": "Objects/Lucy/Lucy_ao.tif", - "diffuseTextureMapUv": "Unwrapped" - }, "baseColor": { "color": [ 1.0, @@ -17,7 +13,7 @@ ], "factor": 1.0, "textureBlendMode": "Lerp", - "textureMap": "Objects/Lucy/Lucy_Stone_BaseColor.png", + "textureMap": "Hermanubis_Stone_BaseColor.png", "textureMapUv": "Unwrapped" }, "clearCoat": { @@ -39,13 +35,17 @@ }, "normal": { "flipY": true, - "textureMap": "Objects/Lucy/Lucy_Normal.png", + "textureMap": "Hermanubis_Normal.png", "textureMapUv": "Unwrapped" }, + "occlusion": { + "diffuseTextureMap": "Hermanubis_ao.tif", + "diffuseTextureMapUv": "Unwrapped" + }, "roughness": { "factor": 1.0, - "lowerBound": 0.15000000596046449, - "textureMap": "Objects/Lucy/Lucy_bronze_Roughness.png", + "lowerBound": 0.15000000596046448, + "textureMap": "Hermanubis_bronze_Roughness.png", "textureMapUv": "Unwrapped", "upperBound": 0.7300000190734863 } diff --git a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_thickness.tif b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_thickness.tif similarity index 100% rename from Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_thickness.tif rename to Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Hermanubis/Hermanubis_thickness.tif diff --git a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_High.fbx b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_High.fbx deleted file mode 100644 index b87971bf6d..0000000000 --- a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_High.fbx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:00e19e317613be5420fd78bac1159e66d1c4deeb1f32cd4fc8c20b1ea3a5ead1 -size 153114272 diff --git a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_low.fbx b/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_low.fbx deleted file mode 100644 index 46f5d1cfbd..0000000000 --- a/Gems/AtomLyIntegration/CommonFeatures/Assets/Objects/Lucy/Lucy_low.fbx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6a4a65d139a6088dd4ac34f3ba3f6a7a98b8fe9545150ee7d9879fbc2a55d8d4 -size 9022128 From 05da6aaa67423cb0afd9957f92488288f7816b5c Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 5 Jan 2022 09:26:08 -0800 Subject: [PATCH 315/948] Removes unnecessary loop (#6684) Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- cmake/AzAutoGen.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cmake/AzAutoGen.py b/cmake/AzAutoGen.py index 19b9711325..782419a6f2 100755 --- a/cmake/AzAutoGen.py +++ b/cmake/AzAutoGen.py @@ -287,8 +287,7 @@ def ProcessExpansionRule(sourceFiles, templateFiles, templateCache, outputDir, p else: # Process all matches in one batch # Due to the lack of wildcards in the output file, we've determined we'll glob all matching input files into the template conversion - for filename in fnmatch.filter(sourceFiles, inputFiles): - dataInputFiles = [os.path.abspath(file) for file in fnmatch.filter(sourceFiles, inputFiles)] + dataInputFiles = [os.path.abspath(file) for file in fnmatch.filter(sourceFiles, inputFiles)] outputFileAbsolute = outputFile.replace("$path", ComputeOutputPath(dataInputFiles, projectDir, outputDir)) outputFileAbsolute = SanitizePath(outputFileAbsolute) ProcessTemplateConversion(dataInputSet, dataInputFiles, templateFile, outputFileAbsolute, templateCache, dryrun, verbose) From 1d0cd46cb7b727384b84bc201a98461df84689ea Mon Sep 17 00:00:00 2001 From: Shirang Jia Date: Wed, 5 Jan 2022 09:54:52 -0800 Subject: [PATCH 316/948] Escape % for windows batch in palSh (#6688) Signed-off-by: Shirang Jia --- scripts/build/Jenkins/Jenkinsfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/build/Jenkins/Jenkinsfile b/scripts/build/Jenkins/Jenkinsfile index ec40840fa6..570c553444 100644 --- a/scripts/build/Jenkins/Jenkinsfile +++ b/scripts/build/Jenkins/Jenkinsfile @@ -42,10 +42,11 @@ def palSh(cmd, lbl = '', winSlashReplacement = true) { if (env.IS_UNIX) { sh label: lbl, script: cmd - } else if (winSlashReplacement) { - bat label: lbl, - script: cmd.replace('/','\\') } else { + if (winSlashReplacement) { + cmd = cmd.replace('/','\\') + } + cmd = cmd.replace('%', '%%') bat label: lbl, script: cmd } From 783a04b88092045fe0a78c07e9b16a24188c4cbc Mon Sep 17 00:00:00 2001 From: sphrose <82213493+sphrose@users.noreply.github.com> Date: Wed, 5 Jan 2022 18:00:07 +0000 Subject: [PATCH 317/948] 3495 Preferences panel update: fix richtext elision and allow html links Signed-off-by: sphrose <82213493+sphrose@users.noreply.github.com> --- Code/Editor/EditorPreferencesPageAWS.cpp | 2 +- .../Components/Widgets/ElidingLabel.cpp | 60 ++++++++++++++++++- .../UI/PropertyEditor/PropertyRowWidget.cpp | 1 + 3 files changed, 61 insertions(+), 2 deletions(-) diff --git a/Code/Editor/EditorPreferencesPageAWS.cpp b/Code/Editor/EditorPreferencesPageAWS.cpp index 68a9d6889f..9279dce7bc 100644 --- a/Code/Editor/EditorPreferencesPageAWS.cpp +++ b/Code/Editor/EditorPreferencesPageAWS.cpp @@ -28,7 +28,7 @@ void CEditorPreferencesPage_AWS::Reflect(AZ::SerializeContext& serialize) if (editContext) { editContext->Class("Options", "") - ->DataElement(AZ::Edit::UIHandlers::CheckBox, &UsageOptions::m_awsAttributionEnabled, "Allow O3DE to send information about your use of AWS Core Gem to AWS", + ->DataElement(AZ::Edit::UIHandlers::CheckBox, &UsageOptions::m_awsAttributionEnabled, "Allow O3DE to send information about your use of AWS Core Gem to AWS", ""); editContext->Class("AWS Preferences", "AWS Preferences") diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/ElidingLabel.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/ElidingLabel.cpp index 8ef69c4b56..8daa183b80 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/ElidingLabel.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/ElidingLabel.cpp @@ -12,6 +12,8 @@ #include #include #include +#include +#include namespace AzQtComponents { @@ -35,6 +37,7 @@ namespace AzQtComponents m_text = text; m_metricsLabel->setText(m_text); + m_elidedText.clear(); elide(); updateGeometry(); @@ -65,7 +68,62 @@ namespace AzQtComponents void ElidingLabel::elide() { ensurePolished(); - m_elidedText = fontMetrics().elidedText(m_text, m_elideMode, TextRect().width()); + + if (Qt::mightBeRichText(m_text)) + { + // If RichText tags are elided using fontMetrics.elidedText(), they will break. + // A TextDocument is used to produce elided text that takes this into account. + const QString ellipsis("..."); + const int maxLineWidth = TextRect().width(); + + QTextDocument doc; + doc.setHtml(m_text); + doc.setDefaultFont(font()); + doc.setDocumentMargin(0.0); + + // Turn off wrapping so the document uses a single line. + QTextOption option = doc.defaultTextOption(); + option.setWrapMode(QTextOption::WrapMode::NoWrap); + doc.setDefaultTextOption(option); + doc.adjustSize(); + + if (doc.size().width() <= maxLineWidth) + { + m_elidedText = m_text; + } + else + { + QTextCursor textCursor(&doc); + textCursor.movePosition(QTextCursor::End); + + int ellipsisWidth = 0; + + // At the moment only ElideRight and ElideNone are ever used. This will need expanding if other elision modes are used. + if (m_elideMode == Qt::ElideRight) + { + ellipsisWidth = fontMetrics().horizontalAdvance(ellipsis); + } + + // Move the cursor back until the text fits or the start of the text is reached. + while (doc.size().width() + ellipsisWidth > maxLineWidth && !textCursor.atStart()) + { + textCursor.deletePreviousChar(); + doc.adjustSize(); + } + + if (m_elideMode == Qt::ElideRight) + { + textCursor.insertText(ellipsis); + } + + m_elidedText = doc.toHtml(); + } + } + else + { + m_elidedText = fontMetrics().elidedText(m_text, m_elideMode, TextRect().width()); + } + QLabel::setText(m_elidedText); if (m_elidedText != m_text) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.cpp index bb2d2851ca..e895456151 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.cpp @@ -421,6 +421,7 @@ namespace AzToolsFramework { QString label{ text }; m_nameLabel->setText(label); + m_nameLabel->setOpenExternalLinks(true); m_nameLabel->setVisible(!label.isEmpty()); // setting the stretches to 0 in case of an empty label really hides the label (i.e. even the reserved space) m_mainLayout->setStretch(0, label.isEmpty() ? 0 : LabelColumnStretch); From 8ed3da5b7f9916474e3e1de2188d23093bf68549 Mon Sep 17 00:00:00 2001 From: mrieggeramzn Date: Wed, 5 Jan 2022 10:24:53 -0800 Subject: [PATCH 318/948] Adding header file Signed-off-by: mrieggeramzn --- .../AzToolsFramework/UI/PropertyEditor/PropertyIntCtrlCommon.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyIntCtrlCommon.h b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyIntCtrlCommon.h index 504e3fd0dc..ed428eeac5 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyIntCtrlCommon.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyIntCtrlCommon.h @@ -14,6 +14,7 @@ #include #include #include +#include namespace AzToolsFramework { From 89067fe667d481f43628f9fd0431aa3d94e92bbf Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 5 Jan 2022 10:40:03 -0800 Subject: [PATCH 319/948] Memory/benchmarks (#5896) * initial version ported from an old implementation Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * simplification of code Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Fixes a recursive loop Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Removing commented code of different options for getting memory usage of a process Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * PR comment (NULL->nullptr) Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Adds mulit-threaded tests Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Improving runtime and making the whole duration manageable Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Fixes Linux build Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Fixes for mac Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Fixes for HeapSchema to get a default block if none is passed Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Adds recording functionality (disabled) and a benchmark that can run recordings Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Removes Heap allocator from being possible to use as a SystemAllocator since it doesnt allow dynamic allocating (only works with pre-allocated blocks) Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * WIP trying to use SystemAllocator instead of raw reads Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Makes the recorded benchmark more stable Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * More stability changes, improvement on type usage within the benchmark, cleanup of unstable stats Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Adds benchmark files for Android Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Fixes Linux nounity build Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * PR comments Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Death test relies on an exception from ocurring, that exception is an access violation, which could not happen (i.e. the memory could be valid for the process) The test didnt have to be a death test. Also handled the situation better in the code to be able to continue in that scenario (useful for release configurations)" Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzCore/AzCore/Memory/AllocatorBase.cpp | 163 ++++- .../AzCore/AzCore/Memory/HeapSchema.cpp | 12 +- .../AzCore/AzCore/Memory/HeapSchema.h | 14 +- .../AzCore/AzCore/Memory/SystemAllocator.cpp | 16 - Code/Framework/AzCore/CMakeLists.txt | 5 + .../Memory/AllocatorBenchmarkRecordings.bin | 3 + .../Tests/Memory/AllocatorBenchmarks.cpp | 591 ++++++++++++++++++ .../AzCore/Tests/Memory/HphaSchema.cpp | 88 --- .../Memory/AllocatorBenchmarks_Android.cpp | 31 + .../Android/platform_android_files.cmake | 1 + .../Memory/AllocatorBenchmarks_Linux.cpp | 31 + .../Platform/Linux/platform_linux_files.cmake | 1 + .../Tests/Memory/AllocatorBenchmarks_Mac.cpp | 31 + .../Platform/Mac/platform_mac_files.cmake | 1 + .../Memory/AllocatorBenchmarks_Windows.cpp | 40 ++ .../Windows/platform_windows_files.cmake | 1 + .../AzCore/Tests/azcoretests_files.cmake | 1 + 17 files changed, 904 insertions(+), 126 deletions(-) create mode 100644 Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarkRecordings.bin create mode 100644 Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp create mode 100644 Code/Framework/AzCore/Tests/Platform/Android/Tests/Memory/AllocatorBenchmarks_Android.cpp create mode 100644 Code/Framework/AzCore/Tests/Platform/Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp create mode 100644 Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp create mode 100644 Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp diff --git a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp index 5c510f67c1..c2bf9fe45c 100644 --- a/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/AllocatorBase.cpp @@ -6,8 +6,155 @@ * */ -#include #include +#include + +#define RECORDING_ENABLED 0 + +#if RECORDING_ENABLED + +#include +#include +#include +#include + +namespace +{ + class DebugAllocator + { + public: + using pointer_type = void*; + using size_type = AZStd::size_t; + using difference_type = AZStd::ptrdiff_t; + using allow_memory_leaks = AZStd::false_type; ///< Regular allocators should not leak. + + AZ_FORCE_INLINE pointer_type allocate(size_t byteSize, size_t alignment, int = 0) + { + return AZ_OS_MALLOC(byteSize, alignment); + } + AZ_FORCE_INLINE size_type resize(pointer_type, size_type) + { + return 0; + } + AZ_FORCE_INLINE void deallocate(pointer_type ptr, size_type, size_type) + { + AZ_OS_FREE(ptr); + } + }; + + #pragma pack(push, 1) + struct alignas(1) AllocatorOperation + { + enum OperationType : size_t + { + ALLOCATE, + DEALLOCATE + }; + OperationType m_type: 1; + size_t m_size : 28; // Can represent up to 256Mb requests + size_t m_alignment : 7; // Can represent up to 128 alignment + size_t m_recordId : 28; // Can represent up to 256M simultaneous requests, we reuse ids + }; + #pragma pack(pop) + static_assert(sizeof(AllocatorOperation) == 8); + + static AZStd::mutex s_operationsMutex = {}; + + static constexpr size_t s_maxNumberOfAllocationsToRecord = 16384; + static size_t s_numberOfAllocationsRecorded = 0; + static constexpr size_t s_allocationOperationCount = 5 * 1024; + static AZStd::array s_operations = {}; + static uint64_t s_operationCounter = 0; + + static unsigned int s_nextRecordId = 1; + using AllocatorOperationByAddress = AZStd::unordered_map, DebugAllocator>; + static AllocatorOperationByAddress s_allocatorOperationByAddress; + using AvailableRecordIds = AZStd::vector; + AvailableRecordIds s_availableRecordIds; + + void RecordAllocatorOperation(AllocatorOperation::OperationType type, void* ptr, size_t size = 0, size_t alignment = 0) + { + AZStd::scoped_lock lock(s_operationsMutex); + if (s_operationCounter == s_allocationOperationCount) + { + AZ::IO::SystemFile file; + int mode = AZ::IO::SystemFile::OpenMode::SF_OPEN_APPEND | AZ::IO::SystemFile::OpenMode::SF_OPEN_WRITE_ONLY; + if (!file.Exists("memoryrecordings.bin")) + { + mode |= AZ::IO::SystemFile::OpenMode::SF_OPEN_CREATE; + } + file.Open("memoryrecordings.bin", mode); + if (file.IsOpen()) + { + file.Write(&s_operations, sizeof(AllocatorOperation) * s_allocationOperationCount); + file.Close(); + } + s_operationCounter = 0; + } + AllocatorOperation& operation = s_operations[s_operationCounter++]; + operation.m_type = type; + if (type == AllocatorOperation::OperationType::ALLOCATE) + { + if (s_numberOfAllocationsRecorded > s_maxNumberOfAllocationsToRecord) + { + // reached limit of allocations, dont record anymore + --s_operationCounter; + return; + } + ++s_numberOfAllocationsRecorded; + operation.m_size = size; + operation.m_alignment = alignment; + unsigned int recordId = 0; + if (!s_availableRecordIds.empty()) + { + recordId = s_availableRecordIds.back(); + s_availableRecordIds.pop_back(); + } + else + { + recordId = s_nextRecordId; + ++s_nextRecordId; + } + operation.m_recordId = recordId; + auto it = s_allocatorOperationByAddress.emplace(ptr, operation); + if (!it.second) + { + // double alloc or resize, leave the current record and return the id + operation = it.first->second; + s_availableRecordIds.emplace_back(recordId); + } + } + else + { + if (ptr == nullptr) + { + // common scenario, just record the operation + operation.m_size = 0; + operation.m_alignment = 0; + operation.m_recordId = 0; // recordId = 0 will flag this case + } + else + { + auto it = s_allocatorOperationByAddress.find(ptr); + if (it != s_allocatorOperationByAddress.end()) + { + operation.m_size = it->second.m_size; + operation.m_alignment = it->second.m_alignment; + operation.m_recordId = it->second.m_recordId; + s_availableRecordIds.push_back(it->second.m_recordId); + s_allocatorOperationByAddress.erase(it); + } + else + { + // just dont record this operation + --s_operationCounter; + } + } + } + + } +} +#endif namespace AZ { @@ -150,6 +297,10 @@ namespace AZ records->RegisterAllocation(ptr, byteSize, alignment, name, fileName, lineNum, suppressStackRecord + 1); } } + +#if RECORDING_ENABLED + RecordAllocatorOperation(AllocatorOperation::ALLOCATE, ptr, byteSize, alignment); +#endif } void AllocatorBase::ProfileDeallocation(void* ptr, size_t byteSize, size_t alignment, Debug::AllocationInfo* info) @@ -162,6 +313,9 @@ namespace AZ records->UnregisterAllocation(ptr, byteSize, alignment, info); } } +#if RECORDING_ENABLED + RecordAllocatorOperation(AllocatorOperation::DEALLOCATE, ptr, byteSize, alignment); +#endif } void AllocatorBase::ProfileReallocationBegin([[maybe_unused]] void* ptr, [[maybe_unused]] size_t newSize) @@ -176,6 +330,10 @@ namespace AZ ProfileDeallocation(ptr, 0, 0, &info); ProfileAllocation(newPtr, newSize, newAlignment, info.m_name, info.m_fileName, info.m_lineNum, 0); } +#if RECORDING_ENABLED + RecordAllocatorOperation(AllocatorOperation::DEALLOCATE, ptr); + RecordAllocatorOperation(AllocatorOperation::ALLOCATE, newPtr, newSize, newAlignment); +#endif } void AllocatorBase::ProfileReallocation(void* ptr, void* newPtr, size_t newSize, size_t newAlignment) @@ -193,6 +351,9 @@ namespace AZ records->ResizeAllocation(ptr, newSize); } } +#if RECORDING_ENABLED + RecordAllocatorOperation(AllocatorOperation::ALLOCATE, ptr, newSize); +#endif } bool AllocatorBase::OnOutOfMemory(size_t byteSize, size_t alignment, int flags, const char* name, const char* fileName, int lineNum) diff --git a/Code/Framework/AzCore/AzCore/Memory/HeapSchema.cpp b/Code/Framework/AzCore/AzCore/Memory/HeapSchema.cpp index aceafa1b28..1f0fc59a97 100644 --- a/Code/Framework/AzCore/AzCore/Memory/HeapSchema.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/HeapSchema.cpp @@ -115,6 +115,7 @@ namespace AZ m_ownMemoryBlock[i] = false; } + AZ_Assert(m_desc.m_numMemoryBlocks > 0, "At least one memory block is required"); for (int i = 0; i < m_desc.m_numMemoryBlocks; ++i) { if (m_desc.m_memoryBlocks[i] == nullptr) // Allocate memory block if requested! @@ -131,17 +132,6 @@ namespace AZ m_capacity += m_desc.m_memoryBlocksByteSize[i]; } - - if (m_desc.m_numMemoryBlocks == 0) - { - // Create default memory space if we can to serve for default allocations - m_memSpaces[0] = AZDLMalloc::create_mspace(0, m_desc.m_isMultithreadAlloc); - if (m_memSpaces[0]) - { - AZDLMalloc::mspace_az_set_expandable(m_memSpaces[0], true); - m_capacity = Platform::GetHeapCapacity(); - } - } } HeapSchema::~HeapSchema() diff --git a/Code/Framework/AzCore/AzCore/Memory/HeapSchema.h b/Code/Framework/AzCore/AzCore/Memory/HeapSchema.h index f72ae31057..3a7716a127 100644 --- a/Code/Framework/AzCore/AzCore/Memory/HeapSchema.h +++ b/Code/Framework/AzCore/AzCore/Memory/HeapSchema.h @@ -32,17 +32,11 @@ namespace AZ */ struct Descriptor { - Descriptor() - : m_numMemoryBlocks(0) - , m_isMultithreadAlloc(true) - {} - - static const int m_memoryBlockAlignment = 64 * 1024; static const int m_maxNumBlocks = 5; - int m_numMemoryBlocks; ///< Number of memory blocks to use. - void* m_memoryBlocks[m_maxNumBlocks]; ///< Pointers to provided memory blocks or NULL if you want the system to allocate them for you with the System Allocator. - size_t m_memoryBlocksByteSize[m_maxNumBlocks]; ///< Sizes of different memory blocks, if m_memoryBlock is 0 the block will be allocated for you with the System Allocator. - bool m_isMultithreadAlloc; ///< Set to true to enable multi threading safe allocation. + int m_numMemoryBlocks = 1; ///< Number of memory blocks to use. + void* m_memoryBlocks[m_maxNumBlocks] = {}; ///< Pointers to provided memory blocks or NULL if you want the system to allocate them for you with the System Allocator. + size_t m_memoryBlocksByteSize[m_maxNumBlocks] = {4 * 1024}; ///< Sizes of different memory blocks, if m_memoryBlock is 0 the block will be allocated for you with the System Allocator. + bool m_isMultithreadAlloc = true; ///< Set to true to enable multi threading safe allocation. }; HeapSchema(const Descriptor& desc); diff --git a/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp b/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp index 15cf5de8bc..41099f7a38 100644 --- a/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/SystemAllocator.cpp @@ -18,7 +18,6 @@ #define AZCORE_SYSTEM_ALLOCATOR_HPHA 1 #define AZCORE_SYSTEM_ALLOCATOR_MALLOC 2 -#define AZCORE_SYSTEM_ALLOCATOR_HEAP 3 #if !defined(AZCORE_SYSTEM_ALLOCATOR) // define the default @@ -29,8 +28,6 @@ #include #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC #include -#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP - #include #else #error "Invalid allocator selected for SystemAllocator" #endif @@ -44,8 +41,6 @@ namespace AZ static AZStd::aligned_storage::value>::type g_systemSchema; #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC static AZStd::aligned_storage::value>::type g_systemSchema; -#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP - static AZStd::aligned_storage::value>::type g_systemSchema; #endif ////////////////////////////////////////////////////////////////////////// @@ -118,11 +113,6 @@ namespace AZ heapDesc.m_systemChunkSize = desc.m_heap.m_systemChunkSize; #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC MallocSchema::Descriptor heapDesc; -#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP - HeapSchema::Descriptor heapDesc; - memcpy(heapDesc.m_memoryBlocks, desc.m_heap.m_memoryBlocks, sizeof(heapDesc.m_memoryBlocks)); - memcpy(heapDesc.m_memoryBlocksByteSize, desc.m_heap.m_memoryBlocksByteSize, sizeof(heapDesc.m_memoryBlocksByteSize)); - heapDesc.m_numMemoryBlocks = desc.m_heap.m_numMemoryBlocks; #endif if (&AllocatorInstance::Get() == this) // if we are the system allocator { @@ -132,8 +122,6 @@ namespace AZ m_allocator = new (&g_systemSchema) HphaSchema(heapDesc); #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC m_allocator = new (&g_systemSchema) MallocSchema(heapDesc); -#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP - m_allocator = new (&g_systemSchema) HeapSchema(heapDesc); #endif g_isSystemSchemaUsed = true; isReady = true; @@ -149,8 +137,6 @@ namespace AZ m_allocator = azcreate(HphaSchema, (heapDesc), SystemAllocator); #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC m_allocator = azcreate(MallocSchema, (heapDesc), SystemAllocator); -#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP - m_allocator = azcreate(HeapSchema, (heapDesc), SystemAllocator); #endif if (m_allocator == nullptr) { @@ -186,8 +172,6 @@ namespace AZ static_cast(m_allocator)->~HphaSchema(); #elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_MALLOC static_cast(m_allocator)->~MallocSchema(); -#elif AZCORE_SYSTEM_ALLOCATOR == AZCORE_SYSTEM_ALLOCATOR_HEAP - static_cast(m_allocator)->~HeapSchema(); #endif g_isSystemSchemaUsed = false; } diff --git a/Code/Framework/AzCore/CMakeLists.txt b/Code/Framework/AzCore/CMakeLists.txt index 96ed838ccc..838142f0df 100644 --- a/Code/Framework/AzCore/CMakeLists.txt +++ b/Code/Framework/AzCore/CMakeLists.txt @@ -146,6 +146,11 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) PROPERTY COMPILE_DEFINITIONS VALUES AZCORETEST_DLL_NAME=\"$\" ) + ly_add_target_files( + TARGETS AzCore.Tests + FILES ${CMAKE_CURRENT_SOURCE_DIR}/Tests/Memory/AllocatorBenchmarkRecordings.bin + OUTPUT_SUBDIRECTORY Tests/AzCore/Memory + ) endif() diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarkRecordings.bin b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarkRecordings.bin new file mode 100644 index 0000000000..ec5de82e83 --- /dev/null +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarkRecordings.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:281ba03e79ecba90b313a0b17bdba87c57d76b504b6e38d579b5eabd995902cc +size 245760 diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp new file mode 100644 index 0000000000..bc477e41dc --- /dev/null +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -0,0 +1,591 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#if defined(HAVE_BENCHMARK) + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +namespace Benchmark +{ + namespace Platform + { + size_t GetProcessMemoryUsageBytes(); + size_t GetMemorySize(void* memory); + } + + ///

+ /// Test allocator wrapper that redirects the calls to the passed TAllocator by using AZ::AllocatorInstance. + /// It also creates/destroys the TAllocator type (to reflect what happens at runtime) + /// + /// Allocator type to wrap + template + class TestAllocatorWrapper + { + public: + static void SetUp() + { + AZ::AllocatorInstance::Create(); + } + + static void TearDown() + { + AZ::AllocatorInstance::Destroy(); + } + + static void* Allocate(size_t byteSize, size_t alignment) + { + return AZ::AllocatorInstance::Get().Allocate(byteSize, alignment); + } + + static void DeAllocate(void* ptr, size_t byteSize = 0) + { + AZ::AllocatorInstance::Get().DeAllocate(ptr, byteSize); + } + + static void* ReAllocate(void* ptr, size_t newSize, size_t newAlignment) + { + return AZ::AllocatorInstance::Get().ReAllocate(ptr, newSize, newAlignment); + } + + static size_t Resize(void* ptr, size_t newSize) + { + return AZ::AllocatorInstance::Get().Resize(ptr, newSize); + } + + static void GarbageCollect() + { + AZ::AllocatorInstance::Get().GarbageCollect(); + } + + static size_t NumAllocatedBytes() + { + return AZ::AllocatorInstance::Get().NumAllocatedBytes() + + AZ::AllocatorInstance::Get().GetUnAllocatedMemory(); + } + + static size_t GetSize(void* ptr) + { + return AZ::AllocatorInstance::Get().AllocationSize(ptr); + } + }; + + /// + /// Basic allocator used as a baseline. This allocator is the most basic allocation possible with the OS (AZ_OS_MALLOC). + /// MallocSchema cannot be used here because it has extra logic that we don't want to use as a baseline. + /// + class RawMallocAllocator {}; + + template<> + class TestAllocatorWrapper + { + public: + TestAllocatorWrapper() + { + s_numAllocatedBytes = 0; + } + + static void SetUp() + { + s_numAllocatedBytes = 0; + } + + static void TearDown() + { + } + + // IAllocatorAllocate + static void* Allocate(size_t byteSize, size_t) + { + s_numAllocatedBytes += byteSize; + // Don't pass an alignment since we wont be able to get the memory size without also passing the alignment + return AZ_OS_MALLOC(byteSize, 1); + } + + static void DeAllocate(void* ptr, size_t = 0) + { + s_numAllocatedBytes -= Platform::GetMemorySize(ptr); + AZ_OS_FREE(ptr); + } + + static void* ReAllocate(void* ptr, size_t newSize, size_t) + { + s_numAllocatedBytes -= Platform::GetMemorySize(ptr); + AZ_OS_FREE(ptr); + + s_numAllocatedBytes += newSize; + return AZ_OS_MALLOC(newSize, 1); + } + + static size_t Resize(void* ptr, size_t newSize) + { + AZ_UNUSED(ptr); + AZ_UNUSED(newSize); + + return 0; + } + + static void GarbageCollect() {} + + static size_t NumAllocatedBytes() + { + return s_numAllocatedBytes; + } + + static size_t GetSize(void* ptr) + { + return Platform::GetMemorySize(ptr); + } + + private: + static size_t s_numAllocatedBytes; + }; + + size_t TestAllocatorWrapper::s_numAllocatedBytes = 0; + + // Some allocator are not fully declared, those we simply setup from the schema + class MallocSchemaAllocator : public AZ::SimpleSchemaAllocator + { + public: + AZ_TYPE_INFO(MallocSchemaAllocator, "{3E68224F-E676-402C-8276-CE4B49C05E89}"); + + MallocSchemaAllocator() + : AZ::SimpleSchemaAllocator("MallocSchemaAllocator", "") + {} + }; + + // We use both this HphaSchemaAllocator and the SystemAllocator configured with Hpha because the SystemAllocator + // has extra things + class HphaSchemaAllocator : public AZ::SimpleSchemaAllocator + { + public: + AZ_TYPE_INFO(HphaSchemaAllocator, "{6563AB4B-A68E-4499-8C98-D61D640D1F7F}"); + + HphaSchemaAllocator() + : AZ::SimpleSchemaAllocator("TestHphaSchemaAllocator", "") + {} + }; + + // For the SystemAllocator we inherit so we have a different stack. The SystemAllocator is used globally so we dont want + // to get that data affecting the benchmark + class TestSystemAllocator : public AZ::SystemAllocator + { + public: + AZ_TYPE_INFO(TestSystemAllocator, "{360D4DAA-D65D-4D5C-A6FA-1A4C5261C35C}"); + + TestSystemAllocator() + : AZ::SystemAllocator() + { + } + }; + + // Allocated bytes reported by the allocator + static const char* s_counterAllocatorMemory = "Allocator_Memory"; + + // Allocated bytes as counted by the benchmark + static const char* s_counterBenchmarkMemory = "Benchmark_Memory"; + + enum AllocationSize + { + SMALL, + BIG, + MIXED, + COUNT + }; + + static const size_t s_kiloByte = 1024; + static const size_t s_megaByte = s_kiloByte * s_kiloByte; + using AllocationSizeArray = AZStd::array; + static const AZStd::array s_allocationSizes = { + /* SMALL */ AllocationSizeArray{ 2, 16, 20, 59, 100, 128, 160, 250, 300, 512 }, + /* BIG */ AllocationSizeArray{ 513, s_kiloByte, 2 * s_kiloByte, 4 * s_kiloByte, 10 * s_kiloByte, 64 * s_kiloByte, 128 * s_kiloByte, 200 * s_kiloByte, s_megaByte, 2 * s_megaByte }, + /* MIXED */ AllocationSizeArray{ 2, s_kiloByte, 59, 4 * s_kiloByte, 128, 200 * s_kiloByte, 250, s_megaByte, 512, 2 * s_megaByte } + }; + + template + class AllocatorBenchmarkFixture + : public ::benchmark::Fixture + { + protected: + using TestAllocatorType = TestAllocatorWrapper; + + virtual void internalSetUp(const ::benchmark::State& state) + { + if (state.thread_index == 0) // Only setup in the first thread + { + TestAllocatorType::SetUp(); + + m_allocations.resize(state.threads); + for (auto& perThreadAllocations : m_allocations) + { + perThreadAllocations.resize(state.range(0), nullptr); + } + } + } + + virtual void internalTearDown(const ::benchmark::State& state) + { + if (state.thread_index == 0) // Only setup in the first thread + { + m_allocations.clear(); + m_allocations.shrink_to_fit(); + + TestAllocatorType::TearDown(); + } + } + + AZStd::vector& GetPerThreadAllocations(size_t threadIndex) + { + return m_allocations[threadIndex]; + } + + public: + void SetUp(const ::benchmark::State& state) override + { + internalSetUp(state); + } + void SetUp(::benchmark::State& state) override + { + internalSetUp(state); + } + + void TearDown(const ::benchmark::State& state) override + { + internalTearDown(state); + } + void TearDown(::benchmark::State& state) override + { + internalTearDown(state); + } + + private: + AZStd::vector> m_allocations; + }; + + template + class AllocationBenchmarkFixture + : public AllocatorBenchmarkFixture + { + using base = AllocatorBenchmarkFixture; + using TestAllocatorType = typename base::TestAllocatorType; + + public: + void Benchmark(benchmark::State& state) + { + for (auto _ : state) + { + state.PauseTiming(); + + AZStd::vector& perThreadAllocations = base::GetPerThreadAllocations(state.thread_index); + const size_t numberOfAllocations = perThreadAllocations.size(); + size_t totalAllocationSize = 0; + for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) + { + const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; + const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; + totalAllocationSize += allocationSize; + + state.ResumeTiming(); + perThreadAllocations[allocationIndex] = TestAllocatorType::Allocate(allocationSize, 0); + state.PauseTiming(); + } + + state.counters[s_counterAllocatorMemory] = benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); + state.counters[s_counterBenchmarkMemory] = benchmark::Counter(static_cast(totalAllocationSize), benchmark::Counter::kDefaults); + + for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) + { + const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; + const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; + TestAllocatorType::DeAllocate(perThreadAllocations[allocationIndex], allocationSize); + perThreadAllocations[allocationIndex] = nullptr; + } + TestAllocatorType::GarbageCollect(); + + state.SetItemsProcessed(numberOfAllocations); + } + } + }; + + template + class DeAllocationBenchmarkFixture + : public AllocatorBenchmarkFixture + { + using base = AllocatorBenchmarkFixture; + using TestAllocatorType = typename base::TestAllocatorType; + + public: + void Benchmark(benchmark::State& state) + { + for (auto _ : state) + { + state.PauseTiming(); + AZStd::vector& perThreadAllocations = base::GetPerThreadAllocations(state.thread_index); + + const size_t numberOfAllocations = perThreadAllocations.size(); + size_t totalAllocationSize = 0; + for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) + { + const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; + const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; + totalAllocationSize += allocationSize; + perThreadAllocations[allocationIndex] = TestAllocatorType::Allocate(allocationSize, 0); + } + + for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) + { + const AllocationSizeArray& allocationArray = s_allocationSizes[TAllocationSize]; + const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; + state.ResumeTiming(); + TestAllocatorType::DeAllocate(perThreadAllocations[allocationIndex], allocationSize); + state.PauseTiming(); + perThreadAllocations[allocationIndex] = nullptr; + } + + state.counters[s_counterAllocatorMemory] = benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); + state.counters[s_counterBenchmarkMemory] = benchmark::Counter(static_cast(totalAllocationSize), benchmark::Counter::kDefaults); + + state.SetItemsProcessed(numberOfAllocations); + + TestAllocatorType::GarbageCollect(); + } + } + }; + + template + class RecordedAllocationBenchmarkFixture : public ::benchmark::Fixture + { + using TestAllocatorType = TestAllocatorWrapper; + + virtual void internalSetUp() + { + TestAllocatorType::SetUp(); + } + + void internalTearDown() + { + TestAllocatorType::TearDown(); + } + + #pragma pack(push, 1) + struct alignas(1) AllocatorOperation + { + enum OperationType : size_t + { + ALLOCATE, + DEALLOCATE + }; + OperationType m_type : 1; + size_t m_size : 28; // Can represent up to 256Mb requests + size_t m_alignment : 7; // Can represent up to 128 alignment + size_t m_recordId : 28; // Can represent up to 256M simultaneous requests, we reuse ids + }; + #pragma pack(pop) + static_assert(sizeof(AllocatorOperation) == 8); + + public: + void SetUp(const ::benchmark::State&) override + { + internalSetUp(); + } + void SetUp(::benchmark::State&) override + { + internalSetUp(); + } + + void TearDown(const ::benchmark::State&) override + { + internalTearDown(); + } + void TearDown(::benchmark::State&) override + { + internalTearDown(); + } + + void Benchmark(benchmark::State& state) + { + for (auto _ : state) + { + state.PauseTiming(); + + AZStd::unordered_map pointerRemapping; + constexpr size_t allocationOperationCount = 5 * 1024; + AZStd::array m_operations = {}; + [[maybe_unused]] const size_t operationSize = sizeof(AllocatorOperation); + + size_t totalAllocationSize = 0; + size_t itemsProcessed = 0; + + for (size_t i = 0; i < 100; ++i) // play the recording multiple times to get a good stable sample, this way we can keep a smaller recording + { + AZ::IO::SystemFile file; + AZ::IO::FixedMaxPathString filePath = AZ::Utils::GetExecutableDirectory(); + filePath += "/Tests/AzCore/Memory/AllocatorBenchmarkRecordings.bin"; + if (!file.Open(filePath.c_str(), AZ::IO::SystemFile::OpenMode::SF_OPEN_READ_ONLY)) + { + return; + } + size_t elementsRead = + file.Read(sizeof(AllocatorOperation) * allocationOperationCount, &m_operations) / sizeof(AllocatorOperation); + itemsProcessed += elementsRead; + + while (elementsRead > 0) + { + for (size_t operationIndex = 0; operationIndex < elementsRead; ++operationIndex) + { + const AllocatorOperation& operation = m_operations[operationIndex]; + if (operation.m_type == AllocatorOperation::ALLOCATE) + { + const auto it = pointerRemapping.emplace(operation.m_recordId, nullptr); + if (it.second) // otherwise already allocated + { + state.ResumeTiming(); + void* ptr = TestAllocatorType::Allocate(operation.m_size, operation.m_alignment); + state.PauseTiming(); + totalAllocationSize += operation.m_size; + it.first->second = ptr; + } + else + { + // Doing a resize, dont account for this memory change, this operation is rare and we dont have + // the size of the previous allocation + state.ResumeTiming(); + TestAllocatorType::Resize(it.first->second, operation.m_size); + state.PauseTiming(); + } + } + else // AllocatorOperation::DEALLOCATE: + { + if (operation.m_recordId) + { + const auto ptrIt = pointerRemapping.find(operation.m_recordId); + if (ptrIt != pointerRemapping.end()) + { + totalAllocationSize -= operation.m_size; + state.ResumeTiming(); + TestAllocatorType::DeAllocate( + ptrIt->second, + /*operation.m_size*/ 0); // size is not correct after a resize, a 0 size deals with it + state.PauseTiming(); + pointerRemapping.erase(ptrIt); + } + } + else // deallocate(nullptr) are recorded + { + // Just to account of the call of deallocate(nullptr); + state.ResumeTiming(); + TestAllocatorType::DeAllocate(nullptr, /*operation.m_size*/ 0); + state.PauseTiming(); + } + } + } + + elementsRead = + file.Read(sizeof(AllocatorOperation) * allocationOperationCount, &m_operations) / sizeof(AllocatorOperation); + itemsProcessed += elementsRead; + } + file.Close(); + + // Deallocate the remainder (since we stopped the recording middle-game)(there are leaks as well) + for (const auto& pointerMapping : pointerRemapping) + { + state.ResumeTiming(); + TestAllocatorType::DeAllocate(pointerMapping.second); + state.PauseTiming(); + } + itemsProcessed += pointerRemapping.size(); + pointerRemapping.clear(); + } + + state.counters[s_counterAllocatorMemory] = benchmark::Counter(static_cast(TestAllocatorType::NumAllocatedBytes()), benchmark::Counter::kDefaults); + state.counters[s_counterBenchmarkMemory] = benchmark::Counter(static_cast(totalAllocationSize), benchmark::Counter::kDefaults); + + state.SetItemsProcessed(itemsProcessed); + + TestAllocatorType::GarbageCollect(); + } + } + }; + + // For non-threaded ranges, run 100, 400, 1600 amounts + static void RunRanges(benchmark::internal::Benchmark* b) + { + for (int i = 0; i < 6; i += 2) + { + b->Arg((1 << i) * 100); + } + } + static void RecordedRunRanges(benchmark::internal::Benchmark* b) + { + b->Iterations(1); + } + + // For threaded ranges, run just 200, multi-threaded will already multiply by thread + static void ThreadedRunRanges(benchmark::internal::Benchmark* b) + { + b->Arg(100); + } + + // Test under and over-subscription of threads vs the amount of CPUs available + static const unsigned int MaxThreadRange = 2 * AZStd::thread::hardware_concurrency(); + +#define BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME, ...) \ + BENCHMARK_TEMPLATE_DEFINE_F(FIXTURE, TESTNAME, __VA_ARGS__)(benchmark::State& state) { Benchmark(state); } \ + BENCHMARK_REGISTER_F(FIXTURE, TESTNAME) + + // We test small/big/mixed allocations in single-threaded environments. For multi-threaded environments, we test mixed since + // the multi threaded fixture will run multiple passes (1, 2, 4, ... until 2*hardware_concurrency) +#define BM_REGISTER_SIZE_FIXTURES(FIXTURE, TESTNAME, ALLOCATORTYPE) \ + BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_SMALL, ALLOCATORTYPE, SMALL)->Apply(RunRanges); \ + BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_BIG, ALLOCATORTYPE, BIG)->Apply(RunRanges); \ + BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_MIXED, ALLOCATORTYPE, MIXED)->Apply(RunRanges); \ + BM_REGISTER_TEMPLATE(FIXTURE, TESTNAME##_MIXED_THREADED, ALLOCATORTYPE, MIXED)->ThreadRange(2, MaxThreadRange)->Apply(ThreadedRunRanges); + +#define BM_REGISTER_ALLOCATOR(TESTNAME, ALLOCATORTYPE) \ + namespace BM_##TESTNAME \ + { \ + BM_REGISTER_SIZE_FIXTURES(AllocationBenchmarkFixture, TESTNAME, ALLOCATORTYPE); \ + BM_REGISTER_SIZE_FIXTURES(DeAllocationBenchmarkFixture, TESTNAME, ALLOCATORTYPE); \ + BM_REGISTER_TEMPLATE(RecordedAllocationBenchmarkFixture, TESTNAME, ALLOCATORTYPE)->Apply(RecordedRunRanges); \ + } + + /// Warm up benchmark used to prepare the OS for allocations. Most OS keep allocations for a process somehow + /// reserved. So the first allocations run always get a bigger impact in a process. This warm up allocator runs + /// all the benchmarks and is just used for the the next allocators to report more consistent results. + BM_REGISTER_ALLOCATOR(WarmUpAllocator, RawMallocAllocator); + + BM_REGISTER_ALLOCATOR(RawMallocAllocator, RawMallocAllocator); + BM_REGISTER_ALLOCATOR(MallocSchemaAllocator, MallocSchemaAllocator); + BM_REGISTER_ALLOCATOR(HphaSchemaAllocator, HphaSchemaAllocator); + BM_REGISTER_ALLOCATOR(SystemAllocator, TestSystemAllocator); + + //BM_REGISTER_ALLOCATOR(BestFitExternalMapAllocator, BestFitExternalMapAllocator); // Requires to pre-allocate blocks and cannot work as a general-purpose allocator + //BM_REGISTER_ALLOCATOR(HeapSchemaAllocator, TestHeapSchemaAllocator); // Requires to pre-allocate blocks and cannot work as a general-purpose allocator + //BM_REGISTER_SCHEMA(PoolSchema); // Requires special alignment requests while allocating + +#undef BM_REGISTER_ALLOCATOR +#undef BM_REGISTER_SIZE_FIXTURES +#undef BM_REGISTER_TEMPLATE + +} // Benchmark + +#endif // HAVE_BENCHMARK diff --git a/Code/Framework/AzCore/Tests/Memory/HphaSchema.cpp b/Code/Framework/AzCore/Tests/Memory/HphaSchema.cpp index 85dd79931d..08b84416e6 100644 --- a/Code/Framework/AzCore/Tests/Memory/HphaSchema.cpp +++ b/Code/Framework/AzCore/Tests/Memory/HphaSchema.cpp @@ -10,10 +10,6 @@ #include #include -#if defined(HAVE_BENCHMARK) -#include -#endif // HAVE_BENCHMARK - class HphaSchema_TestAllocator : public AZ::SimpleSchemaAllocator { @@ -112,87 +108,3 @@ namespace UnitTest HphaSchemaTestFixture, ::testing::ValuesIn(s_mixedInstancesParameters)); } - - -#if defined(HAVE_BENCHMARK) -namespace Benchmark -{ - class HphaSchemaBenchmarkFixture - : public ::benchmark::Fixture - { - void internalSetUp() - { - AZ::AllocatorInstance::Create(); - } - - void internalTearDown() - { - AZ::AllocatorInstance::Destroy(); - } - - public: - void SetUp(const benchmark::State&) override - { - internalSetUp(); - } - void SetUp(benchmark::State&) override - { - internalSetUp(); - } - void TearDown(const benchmark::State&) override - { - internalTearDown(); - } - void TearDown(benchmark::State&) override - { - internalTearDown(); - } - - static void BM_Allocations(benchmark::State& state, const AllocationSizeArray& allocationArray) - { - AZStd::vector allocations; - while (state.KeepRunning()) - { - state.PauseTiming(); - const size_t allocationIndex = allocations.size(); - const size_t allocationSize = allocationArray[allocationIndex % allocationArray.size()]; - - state.ResumeTiming(); - void* allocation = AZ::AllocatorInstance::Get().Allocate(allocationSize, 0); - - state.PauseTiming(); - allocations.emplace_back(allocation); - - state.ResumeTiming(); - } - - const size_t numberOfAllocations = allocations.size(); - state.SetItemsProcessed(numberOfAllocations); - - for (size_t allocationIndex = 0; allocationIndex < numberOfAllocations; ++allocationIndex) - { - AZ::AllocatorInstance::Get().DeAllocate(allocations[allocationIndex], allocationArray[allocationIndex % allocationArray.size()]); - } - AZ::AllocatorInstance::Get().GarbageCollect(); - } - }; - - // Small allocations, these are allocations that are going to end up in buckets in the HphaSchema - BENCHMARK_F(HphaSchemaBenchmarkFixture, SmallAllocations)(benchmark::State& state) - { - BM_Allocations(state, s_smallAllocationSizes); - } - - BENCHMARK_F(HphaSchemaBenchmarkFixture, BigAllocations)(benchmark::State& state) - { - BM_Allocations(state, s_bigAllocationSizes); - } - - BENCHMARK_F(HphaSchemaBenchmarkFixture, MixedAllocations)(benchmark::State& state) - { - BM_Allocations(state, s_mixedAllocationSizes); - } - - -} // Benchmark -#endif // HAVE_BENCHMARK diff --git a/Code/Framework/AzCore/Tests/Platform/Android/Tests/Memory/AllocatorBenchmarks_Android.cpp b/Code/Framework/AzCore/Tests/Platform/Android/Tests/Memory/AllocatorBenchmarks_Android.cpp new file mode 100644 index 0000000000..636d5519d8 --- /dev/null +++ b/Code/Framework/AzCore/Tests/Platform/Android/Tests/Memory/AllocatorBenchmarks_Android.cpp @@ -0,0 +1,31 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include + +#include +#include + +namespace Benchmark +{ + namespace Platform + { + size_t GetProcessMemoryUsageBytes() + { + struct rusage rusage; + getrusage(RUSAGE_SELF, &rusage); + return rusage.ru_maxrss * 1024L; + } + + size_t GetMemorySize(void* memory) + { + return memory ? malloc_usable_size(memory) : 0; + } + } +} diff --git a/Code/Framework/AzCore/Tests/Platform/Android/platform_android_files.cmake b/Code/Framework/AzCore/Tests/Platform/Android/platform_android_files.cmake index ed54a84dbf..3ad1bd3185 100644 --- a/Code/Framework/AzCore/Tests/Platform/Android/platform_android_files.cmake +++ b/Code/Framework/AzCore/Tests/Platform/Android/platform_android_files.cmake @@ -8,4 +8,5 @@ set(FILES Tests/UtilsTests_Android.cpp + Tests/Memory/AllocatorBenchmarks_Android.cpp ) diff --git a/Code/Framework/AzCore/Tests/Platform/Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp b/Code/Framework/AzCore/Tests/Platform/Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp new file mode 100644 index 0000000000..636d5519d8 --- /dev/null +++ b/Code/Framework/AzCore/Tests/Platform/Linux/Tests/Memory/AllocatorBenchmarks_Linux.cpp @@ -0,0 +1,31 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include + +#include +#include + +namespace Benchmark +{ + namespace Platform + { + size_t GetProcessMemoryUsageBytes() + { + struct rusage rusage; + getrusage(RUSAGE_SELF, &rusage); + return rusage.ru_maxrss * 1024L; + } + + size_t GetMemorySize(void* memory) + { + return memory ? malloc_usable_size(memory) : 0; + } + } +} diff --git a/Code/Framework/AzCore/Tests/Platform/Linux/platform_linux_files.cmake b/Code/Framework/AzCore/Tests/Platform/Linux/platform_linux_files.cmake index 844b621e05..953dbb7791 100644 --- a/Code/Framework/AzCore/Tests/Platform/Linux/platform_linux_files.cmake +++ b/Code/Framework/AzCore/Tests/Platform/Linux/platform_linux_files.cmake @@ -9,4 +9,5 @@ set(FILES Tests/UtilsTests_Linux.cpp ../Common/UnixLike/Tests/UtilsTests_UnixLike.cpp + Tests/Memory/AllocatorBenchmarks_Linux.cpp ) diff --git a/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp b/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp new file mode 100644 index 0000000000..932252985a --- /dev/null +++ b/Code/Framework/AzCore/Tests/Platform/Mac/Tests/Memory/AllocatorBenchmarks_Mac.cpp @@ -0,0 +1,31 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include + +#include +#include + +namespace Benchmark +{ + namespace Platform + { + size_t GetProcessMemoryUsageBytes() + { + struct rusage rusage; + getrusage(RUSAGE_SELF, &rusage); + return rusage.ru_maxrss; + } + + size_t GetMemorySize(void* memory) + { + return memory ? malloc_size(memory) : 0; + } + } +} diff --git a/Code/Framework/AzCore/Tests/Platform/Mac/platform_mac_files.cmake b/Code/Framework/AzCore/Tests/Platform/Mac/platform_mac_files.cmake index 93d2daf2b8..14e39d47f4 100644 --- a/Code/Framework/AzCore/Tests/Platform/Mac/platform_mac_files.cmake +++ b/Code/Framework/AzCore/Tests/Platform/Mac/platform_mac_files.cmake @@ -9,4 +9,5 @@ set(FILES ../Common/Apple/Tests/UtilsTests_Apple.cpp ../Common/UnixLike/Tests/UtilsTests_UnixLike.cpp + Tests/Memory/AllocatorBenchmarks_Mac.cpp ) diff --git a/Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp b/Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp new file mode 100644 index 0000000000..e9571a7e5b --- /dev/null +++ b/Code/Framework/AzCore/Tests/Platform/Windows/Tests/Memory/AllocatorBenchmarks_Windows.cpp @@ -0,0 +1,40 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include + +#include +#include + +namespace Benchmark +{ + namespace Platform + { + size_t GetProcessMemoryUsageBytes() + { + EmptyWorkingSet(GetCurrentProcess()); + + size_t memoryUsage = 0; + MEMORY_BASIC_INFORMATION mbi = { 0 }; + unsigned char* pEndRegion = nullptr; + while (sizeof(mbi) == VirtualQuery(pEndRegion, &mbi, sizeof(mbi))) { + pEndRegion += mbi.RegionSize; + if ((mbi.AllocationProtect & PAGE_READWRITE) && (mbi.State & MEM_COMMIT)) { + memoryUsage += mbi.RegionSize; + } + } + return memoryUsage; + } + + size_t GetMemorySize(void* memory) + { + return memory ? _aligned_msize(memory, 1, 0) : 0; + } + } +} diff --git a/Code/Framework/AzCore/Tests/Platform/Windows/platform_windows_files.cmake b/Code/Framework/AzCore/Tests/Platform/Windows/platform_windows_files.cmake index 0a96dad34e..97b12b28e6 100644 --- a/Code/Framework/AzCore/Tests/Platform/Windows/platform_windows_files.cmake +++ b/Code/Framework/AzCore/Tests/Platform/Windows/platform_windows_files.cmake @@ -9,6 +9,7 @@ set(FILES ../Common/WinAPI/Tests/UtilsTests_WinAPI.cpp Tests/IO/Streamer/StorageDriveTests_Windows.cpp + Tests/Memory/AllocatorBenchmarks_Windows.cpp Tests/Memory/OverrunDetectionAllocator_Windows.cpp Tests/Serialization_Windows.cpp ) diff --git a/Code/Framework/AzCore/Tests/azcoretests_files.cmake b/Code/Framework/AzCore/Tests/azcoretests_files.cmake index 98f268b61a..3777071168 100644 --- a/Code/Framework/AzCore/Tests/azcoretests_files.cmake +++ b/Code/Framework/AzCore/Tests/azcoretests_files.cmake @@ -170,6 +170,7 @@ set(FILES Math/Vector3Tests.cpp Math/Vector4PerformanceTests.cpp Math/Vector4Tests.cpp + Memory/AllocatorBenchmarks.cpp Memory/AllocatorManager.cpp Memory/HphaSchema.cpp Memory/HphaSchemaErrorDetection.cpp From 31e51f8c3abd1614550f73cf43c8ab267611d498 Mon Sep 17 00:00:00 2001 From: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> Date: Wed, 5 Jan 2022 10:47:23 -0800 Subject: [PATCH 320/948] Minor updates to the Spawnable Entity Aliases in response to PR feedback. Signed-off-by: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> --- .../Tests/Spawnable/SpawnableEntitiesManagerTests.cpp | 8 +++++--- .../Entity/PrefabEditorEntityOwnershipService.cpp | 3 +-- .../Prefab/Spawnable/PrefabProcessorContext.cpp | 3 +++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Code/Framework/AzFramework/Tests/Spawnable/SpawnableEntitiesManagerTests.cpp b/Code/Framework/AzFramework/Tests/Spawnable/SpawnableEntitiesManagerTests.cpp index 1a483a7851..50365ff2ff 100644 --- a/Code/Framework/AzFramework/Tests/Spawnable/SpawnableEntitiesManagerTests.cpp +++ b/Code/Framework/AzFramework/Tests/Spawnable/SpawnableEntitiesManagerTests.cpp @@ -101,6 +101,8 @@ namespace UnitTest class SpawnableEntitiesManagerTest : public AllocatorsFixture { public: + constexpr static AZ::u64 EntityIdStartId = 40; + void SetUp() override { AllocatorsFixture::SetUp(); @@ -156,7 +158,7 @@ namespace UnitTest { auto entry = AZStd::make_unique(); entry->AddComponent(aznew SourceSpawnableComponent()); - entry->SetId(AZ::EntityId(40 + i)); + entry->SetId(AZ::EntityId(EntityIdStartId + i)); entities.push_back(AZStd::move(entry)); } } @@ -175,13 +177,13 @@ namespace UnitTest auto entry = AZStd::make_unique(); if (i != 0) { - entry->AddComponent(aznew TargetSpawnableComponent(AZ::EntityId(40 + i - 1))); + entry->AddComponent(aznew TargetSpawnableComponent(AZ::EntityId(EntityIdStartId + i - 1))); } else { entry->AddComponent(aznew TargetSpawnableComponent()); } - entry->SetId(AZ::EntityId(40 + i)); + entry->SetId(AZ::EntityId(EntityIdStartId + i)); entities.push_back(AZStd::move(entry)); } } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp index 3d962ade67..418d176daa 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp @@ -415,8 +415,7 @@ namespace AzToolsFramework { // Construct the runtime entities and products bool readyToCreateRootSpawnable = m_playInEditorData.m_assetsCache.IsActivated(); - if (!readyToCreateRootSpawnable && - !m_playInEditorData.m_assetsCache.Activate(Prefab::PrefabConversionUtils::PlayInEditor)) + if (!readyToCreateRootSpawnable && !m_playInEditorData.m_assetsCache.Activate(Prefab::PrefabConversionUtils::PlayInEditor)) { AZ_Error("Prefab", false, "Failed to create a prefab processing stack from key '%.*s'.", AZ_STRING_ARG(Prefab::PrefabConversionUtils::PlayInEditor)); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp index 2e8da9f9a1..fd8ce43836 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp @@ -38,6 +38,7 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils if (!m_prefabNames.contains(name)) { m_prefabNames.emplace(AZStd::move(name)); + // If currently iterating add to pending queue to avoid invalidating the container that's being iterated over. PrefabContainer& container = m_isIterating ? m_pendingPrefabAdditions : m_prefabs; container.push_back(AZStd::move(document)); return true; @@ -47,6 +48,8 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils void PrefabProcessorContext::ListPrefabs(const AZStd::function& callback) { + // Enable iterating state so the prefab container doesn't get invalided. Enabling this flag will cause new prefabs + // to be stored in a temporary buffer that can be moved into the regular prefab container after iterating. m_isIterating = true; for (PrefabDocument& document : m_prefabs) { From 2296cf228c42158c0c01a6a6ea5d45f9ebe2d257 Mon Sep 17 00:00:00 2001 From: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> Date: Wed, 5 Jan 2022 13:00:14 -0600 Subject: [PATCH 321/948] Removing custom teardown for closing O3DE applications, and adding to list of LY_PROCESSES to close with test Signed-off-by: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> --- .../Gem/PythonTests/automatedtesting_shared/base.py | 2 +- .../editor/EditorScripts/Menus_FileMenuOptions.py | 5 ----- .../PythonTests/editor/TestSuite_Main_Optimized.py | 6 +++--- .../Gem/PythonTests/editor/TestSuite_Periodic.py | 11 ++--------- .../ly_test_tools/o3de/editor_test_utils.py | 2 +- 5 files changed, 7 insertions(+), 19 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/base.py b/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/base.py index 0441f8a1dc..4db959b23e 100755 --- a/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/base.py +++ b/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/base.py @@ -182,7 +182,7 @@ class TestAutomationBase: @staticmethod def _kill_ly_processes(include_asset_processor=True): LY_PROCESSES = [ - 'Editor', 'Profiler', 'RemoteConsole', 'AutomatedTesting.ServerLauncher' + 'Editor', 'Profiler', 'RemoteConsole', 'AutomatedTesting.ServerLauncher', 'o3de' ] AP_PROCESSES = [ 'AssetProcessor', 'AssetProcessorBatch', 'AssetBuilder', 'CrySCompileServer', diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py index c319535c05..cade2125e2 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py @@ -26,8 +26,6 @@ def Menus_FileMenuOptions_Work(): :return: None """ - import azlmbr.legacy.general as general - import editor_python_test_tools.hydra_editor_utils as hydra import editor_python_test_tools.pyside_utils as pyside_utils from editor_python_test_tools.utils import Report @@ -66,9 +64,6 @@ def Menus_FileMenuOptions_Work(): ) Report.result(menu_action_triggered, action_triggered) - # Wait a few seconds for Project Settings dialogs to load so teardown can properly close them - general.idle_wait(2.0) - if __name__ == "__main__": diff --git a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main_Optimized.py b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main_Optimized.py index 7364cd8bc9..058c309652 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main_Optimized.py +++ b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main_Optimized.py @@ -24,11 +24,11 @@ class TestAutomationNoAutoTestMode(EditorTestSuite): class test_AssetPicker_UI_UX(EditorSharedTest): from .EditorScripts import AssetPicker_UI_UX as test_module - class test_BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD(EditorSingleTest): + class test_BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD(EditorSharedTest): from .EditorScripts import BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD as test_module class test_BasicEditorWorkflows_LevelEntityComponentCRUD(EditorSingleTest): - # Custom teardown to remove slice asset created during test + # Custom teardown to remove level created during test def teardown(self, request, workspace, editor, editor_test_results, launcher_platform): file_system.delete([os.path.join(workspace.paths.engine_root(), "AutomatedTesting", "Levels", "tmp_level")], True, True) @@ -39,7 +39,7 @@ class TestAutomationNoAutoTestMode(EditorTestSuite): # Disable null renderer use_null_renderer = False - # Custom teardown to remove slice asset created during test + # Custom teardown to remove level created during test def teardown(self, request, workspace, editor, editor_test_results, launcher_platform): file_system.delete([os.path.join(workspace.paths.engine_root(), "AutomatedTesting", "Levels", "tmp_level")], True, True) diff --git a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Periodic.py b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Periodic.py index f8a054d517..282276250f 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Periodic.py +++ b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Periodic.py @@ -26,13 +26,6 @@ def remove_test_level(request, workspace, project): request.addfinalizer(teardown) -@pytest.fixture -def kill_external_tools(request): - def teardown(): - process_utils.kill_processes_named("o3de.exe") - request.addfinalizer(teardown) - - @pytest.mark.SUITE_periodic @pytest.mark.parametrize("launcher_platform", ['windows_editor']) @pytest.mark.parametrize("project", ["AutomatedTesting"]) @@ -40,7 +33,7 @@ class TestAutomation(TestAutomationBase): def test_AssetBrowser_SearchFiltering(self, request, workspace, editor, launcher_platform): from .EditorScripts import AssetBrowser_SearchFiltering as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False) + self._run_test(request, workspace, editor, test_module, batch_mode=False, use_null_renderer=False) def test_AssetBrowser_TreeNavigation(self, request, workspace, editor, launcher_platform): from .EditorScripts import AssetBrowser_TreeNavigation as test_module @@ -58,7 +51,7 @@ class TestAutomation(TestAutomationBase): from .EditorScripts import InputBindings_Add_Remove_Input_Events as test_module self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False) - def test_Menus_FileMenuOptions_Work(self, request, workspace, editor, launcher_platform, kill_external_tools): + def test_Menus_FileMenuOptions_Work(self, request, workspace, editor, launcher_platform): from .EditorScripts import Menus_FileMenuOptions as test_module self._run_test(request, workspace, editor, test_module, batch_mode=False) diff --git a/Tools/LyTestTools/ly_test_tools/o3de/editor_test_utils.py b/Tools/LyTestTools/ly_test_tools/o3de/editor_test_utils.py index 9f1e01342c..dd0bede4b8 100644 --- a/Tools/LyTestTools/ly_test_tools/o3de/editor_test_utils.py +++ b/Tools/LyTestTools/ly_test_tools/o3de/editor_test_utils.py @@ -24,7 +24,7 @@ def kill_all_ly_processes(include_asset_processor: bool = True) -> None: :return: None """ LY_PROCESSES = [ - 'Editor', 'Profiler', 'RemoteConsole', + 'Editor', 'Profiler', 'RemoteConsole', 'o3de' ] AP_PROCESSES = [ 'AssetProcessor', 'AssetProcessorBatch', 'AssetBuilder' From acc6248ec98ef8cd24ea057f679d90ca6be812e5 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Wed, 5 Jan 2022 11:31:09 -0800 Subject: [PATCH 322/948] Move deep comparison / copy to utils Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp | 148 +++++++++++++++++ Code/Framework/AzCore/AzCore/DOM/DomUtils.h | 3 + Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 155 +++--------------- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 13 +- .../AzCore/Tests/DOM/DomValueBenchmarks.cpp | 3 +- .../AzCore/Tests/DOM/DomValueTests.cpp | 6 +- 6 files changed, 186 insertions(+), 142 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp b/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp index 73c4bd2d76..c604373296 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp @@ -33,4 +33,152 @@ namespace AZ::Dom::Utils } return AZ::Success(AZStd::move(value)); } + + bool DeepCompareIsEqual(const Value& lhs, const Value& rhs) + { + const Value::ValueType& lhsValue = lhs.GetInternalValue(); + const Value::ValueType& rhsValue = rhs.GetInternalValue(); + + if (lhs.IsString() && rhs.IsString()) + { + // If we both hold the same ref counted string we don't need to do a full comparison + if (AZStd::holds_alternative(lhsValue) && lhsValue == rhsValue) + { + return true; + } + return lhs.GetString() == rhs.GetString(); + } + + return AZStd::visit( + [&](auto&& ourValue) -> bool + { + using Alternative = AZStd::decay_t; + + if constexpr (AZStd::is_same_v) + { + if (!rhs.IsObject()) + { + return false; + } + auto&& theirValue = AZStd::get>(rhsValue); + if (ourValue == theirValue) + { + return true; + } + + const Object::ContainerType& ourValues = ourValue->GetValues(); + const Object::ContainerType& theirValues = theirValue->GetValues(); + + if (ourValues.size() != theirValues.size()) + { + return false; + } + + for (size_t i = 0; i < ourValues.size(); ++i) + { + const Object::EntryType& lhsChild = ourValues[i]; + const Object::EntryType& rhsChild = theirValues[i]; + if (lhsChild.first != rhsChild.first || !DeepCompareIsEqual(lhsChild.second, rhsChild.second)) + { + return false; + } + } + + return true; + } + else if constexpr (AZStd::is_same_v) + { + if (!rhs.IsArray()) + { + return false; + } + auto&& theirValue = AZStd::get>(rhsValue); + if (ourValue == theirValue) + { + return true; + } + + const Array::ContainerType& ourValues = ourValue->GetValues(); + const Array::ContainerType& theirValues = theirValue->GetValues(); + + if (ourValues.size() != theirValues.size()) + { + return false; + } + + for (size_t i = 0; i < ourValues.size(); ++i) + { + const Value& lhsChild = ourValues[i]; + const Value& rhsChild = theirValues[i]; + if (!DeepCompareIsEqual(lhsChild, rhsChild)) + { + return false; + } + } + + return true; + } + else if constexpr (AZStd::is_same_v) + { + if (!rhs.IsNode()) + { + return false; + } + auto&& theirValue = AZStd::get>(rhsValue); + if (ourValue == theirValue) + { + return true; + } + + const Node& ourNode = *ourValue; + const Node& theirNode = *theirValue; + + const Object::ContainerType& ourProperties = ourNode.GetProperties(); + const Object::ContainerType& theirProperties = theirNode.GetProperties(); + + if (ourProperties.size() != theirProperties.size()) + { + return false; + } + + for (size_t i = 0; i < ourProperties.size(); ++i) + { + const Object::EntryType& lhsChild = ourProperties[i]; + const Object::EntryType& rhsChild = theirProperties[i]; + if (lhsChild.first != rhsChild.first || !DeepCompareIsEqual(lhsChild.second, rhsChild.second)) + { + return false; + } + } + + const Array::ContainerType& ourChildren = ourNode.GetChildren(); + const Array::ContainerType& theirChildren = theirNode.GetChildren(); + + for (size_t i = 0; i < ourChildren.size(); ++i) + { + const Value& lhsChild = ourChildren[i]; + const Value& rhsChild = theirChildren[i]; + if (!DeepCompareIsEqual(lhsChild, rhsChild)) + { + return false; + } + } + + return true; + } + else + { + return lhs == rhs; + } + }, + lhsValue); + } + + Value DeepCopy(const Value& value, bool copyStrings) + { + Value copiedValue; + AZStd::unique_ptr writer = copiedValue.GetWriteHandler(); + value.Accept(*writer, copyStrings); + return copiedValue; + } } // namespace AZ::Dom::Utils diff --git a/Code/Framework/AzCore/AzCore/DOM/DomUtils.h b/Code/Framework/AzCore/AzCore/DOM/DomUtils.h index ebe4273b48..5403b93714 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomUtils.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomUtils.h @@ -17,4 +17,7 @@ namespace AZ::Dom::Utils Visitor::Result ReadFromStringInPlace(Backend& backend, AZStd::string& string, Visitor& visitor); AZ::Outcome WriteToValue(const Backend::WriteCallback& writeCallback); + + bool DeepCompareIsEqual(const Value& lhs, const Value& rhs); + Value DeepCopy(const Value& value, bool copyStrings = true); } // namespace AZ::Dom::Utils diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index 8c002b7091..af6d86d699 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -67,6 +67,16 @@ namespace AZ::Dom return Internal::ExtractTypeArgs::GetTypeIndex(); } + const Array::ContainerType& Array::GetValues() const + { + return m_values; + } + + const Object::ContainerType& Object::GetValues() const + { + return m_values; + } + Node::Node(AZ::Name name) : m_name(AZStd::move(name)) { @@ -130,8 +140,8 @@ namespace AZ::Dom } } - Value::Value(const AZStd::any& value) - : m_value(AZStd::allocate_shared(StdValueAllocator(), value)) + Value::Value(AZStd::any opaqueValue) + : m_value(AZStd::allocate_shared(StdValueAllocator(), AZStd::move(opaqueValue))) { } @@ -660,7 +670,9 @@ namespace AZ::Dom Value& Value::AddMember(KeyType name, const Value& value) { Object::ContainerType& object = GetObjectInternal(); - object.reserve((object.size() / Object::ReserveIncrement + 1) * Object::ReserveIncrement); + // Reserve in ReserveIncremenet chunks instead of the default vector doubling strategy + // Profiling has found that this is an aggregate performance gain for typical workflows + object.reserve(AZ_SIZE_ALIGN_UP(object.size() + 1, Object::ReserveIncrement)); if (auto memberIt = FindMutableMember(name); memberIt != object.end()) { memberIt->second = value; @@ -833,7 +845,9 @@ namespace AZ::Dom Value& Value::ArrayPushBack(Value value) { Array::ContainerType& array = GetArrayInternal(); - array.reserve((array.size() / Array::ReserveIncrement + 1) * Array::ReserveIncrement); + // Reserve in ReserveIncremenet chunks instead of the default vector doubling strategy + // Profiling has found that this is an aggregate performance gain for typical workflows + array.reserve(AZ_SIZE_ALIGN_UP(array.size() + 1, Array::ReserveIncrement)); array.push_back(AZStd::move(value)); return *this; } @@ -1231,137 +1245,8 @@ namespace AZ::Dom return AZStd::make_unique(*this); } - bool Value::DeepCompareIsEqual(const Value& other) const - { - if (IsString() && other.IsString()) - { - // If we both hold the same ref counted string we don't need to do a full comparison - if (AZStd::holds_alternative(m_value) && m_value == other.m_value) - { - return true; - } - return GetString() == other.GetString(); - } - - if (m_value.index() != other.m_value.index()) - { - return false; - } - - return AZStd::visit( - [&](auto&& ourValue) -> bool - { - using Alternative = AZStd::decay_t; - auto&& theirValue = AZStd::get>(other.m_value); - - if constexpr (AZStd::is_same_v) - { - return true; - } - else if constexpr (AZStd::is_same_v) - { - if (ourValue == theirValue) - { - return true; - } - - if (ourValue->m_values.size() != theirValue->m_values.size()) - { - return false; - } - - for (size_t i = 0; i < ourValue->m_values.size(); ++i) - { - const Object::EntryType& lhs = ourValue->m_values[i]; - const Object::EntryType& rhs = theirValue->m_values[i]; - if (lhs.first != rhs.first || !lhs.second.DeepCompareIsEqual(rhs.second)) - { - return false; - } - } - - return true; - } - else if constexpr (AZStd::is_same_v) - { - if (ourValue == theirValue) - { - return true; - } - - if (ourValue->m_values.size() != theirValue->m_values.size()) - { - return false; - } - - for (size_t i = 0; i < ourValue->m_values.size(); ++i) - { - const Value& lhs = ourValue->m_values[i]; - const Value& rhs = theirValue->m_values[i]; - if (!lhs.DeepCompareIsEqual(rhs)) - { - return false; - } - } - - return true; - } - else if constexpr (AZStd::is_same_v) - { - if (ourValue == theirValue) - { - return true; - } - - const Node& ourNode = *ourValue; - const Node& theirNode = *theirValue; - - const Object::ContainerType& ourProperties = ourNode.GetProperties(); - const Object::ContainerType& theirProperties = theirNode.GetProperties(); - - if (ourProperties.size() != theirProperties.size()) - { - return false; - } - - for (size_t i = 0; i < ourProperties.size(); ++i) - { - const Object::EntryType& lhs = ourProperties[i]; - const Object::EntryType& rhs = theirProperties[i]; - if (lhs.first != rhs.first || !lhs.second.DeepCompareIsEqual(rhs.second)) - { - return false; - } - } - - const Array::ContainerType& ourChildren = ourNode.GetChildren(); - const Array::ContainerType& theirChildren = theirNode.GetChildren(); - - for (size_t i = 0; i < ourChildren.size(); ++i) - { - const Value& lhs = ourChildren[i]; - const Value& rhs = theirChildren[i]; - if (!lhs.DeepCompareIsEqual(rhs)) - { - return false; - } - } - - return true; - } - else - { - return ourValue == theirValue; - } - }, - m_value); - } - - Value Value::DeepCopy(bool copyStrings) const + const Value::ValueType& Value::GetInternalValue() const { - Value newValue; - AZStd::unique_ptr writer = newValue.GetWriteHandler(); - Accept(*writer, copyStrings); - return newValue; + return m_value; } } // namespace AZ::Dom diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index d67947dd0a..a6990fcbce 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -67,6 +67,9 @@ namespace AZ::Dom using Iterator = ContainerType::iterator; using ConstIterator = ContainerType::const_iterator; static constexpr const size_t ReserveIncrement = 4; + static_assert((ReserveIncrement & (ReserveIncrement - 1)) == 0, "ReserveIncremenet must be a power of 2"); + + const ContainerType& GetValues() const; private: ContainerType m_values; @@ -86,6 +89,9 @@ namespace AZ::Dom using Iterator = ContainerType::iterator; using ConstIterator = ContainerType::const_iterator; static constexpr const size_t ReserveIncrement = 8; + static_assert((ReserveIncrement & (ReserveIncrement - 1)) == 0, "ReserveIncremenet must be a power of 2"); + + const ContainerType& GetValues() const; private: ContainerType m_values; @@ -374,8 +380,9 @@ namespace AZ::Dom Visitor::Result Accept(Visitor& visitor, bool copyStrings) const; AZStd::unique_ptr GetWriteHandler(); - bool DeepCompareIsEqual(const Value& other) const; - Value DeepCopy(bool copyStrings = true) const; + //! Gets the internal value of this Value. Note that this value's types may not correspond one-to-one with the Type enumeration, + //! as internally the same type might have different storage mechanisms. Where possible, prefer using the typed API. + const ValueType& GetInternalValue() const; private: const Node& GetNodeInternal() const; @@ -385,7 +392,7 @@ namespace AZ::Dom const Array::ContainerType& GetArrayInternal() const; Array::ContainerType& GetArrayInternal(); - explicit Value(const AZStd::any& opaqueValue); + explicit Value(AZStd::any opaqueValue); static_assert( sizeof(ValueType) == sizeof(ShortStringType) + sizeof(size_t), "ValueType should have no members larger than ShortStringType"); diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp index 74eb78be00..b20091b232 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp @@ -7,6 +7,7 @@ */ #include +#include #include #include #include @@ -171,7 +172,7 @@ namespace AZ::Dom::Benchmark for (auto _ : state) { - Value copy = original.DeepCopy(); + Value copy = Utils::DeepCopy(original); TakeAndDiscardWithoutTimingDtor(AZStd::move(copy), state); } diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp index 3cbd532b13..a98eb307a2 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp @@ -41,10 +41,10 @@ namespace AZ::Dom::Tests { Value shallowCopy = m_value; EXPECT_EQ(m_value, shallowCopy); - EXPECT_TRUE(m_value.DeepCompareIsEqual(shallowCopy)); + EXPECT_TRUE(Utils::DeepCompareIsEqual(m_value, shallowCopy)); - Value deepCopy = m_value.DeepCopy(); - EXPECT_TRUE(m_value.DeepCompareIsEqual(deepCopy)); + Value deepCopy = Utils::DeepCopy(m_value); + EXPECT_TRUE(Utils::DeepCompareIsEqual(m_value, deepCopy)); } Value m_value; From 233349ffe3117bb7da54af3404660c7c1126224c Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Wed, 5 Jan 2022 13:35:09 -0600 Subject: [PATCH 323/948] Removed unused Editor code from EditMode/Geometry/Include/LightmapCompiler Signed-off-by: Chris Galvan --- Code/Editor/EditMode/DeepSelection.cpp | 138 ---- Code/Editor/EditMode/DeepSelection.h | 87 --- Code/Editor/Geometry/TriMesh.cpp | 587 ------------------ Code/Editor/Geometry/TriMesh.h | 238 ------- Code/Editor/Include/HitContext.h | 4 - .../Include/IAnimationCompressionManager.h | 20 - Code/Editor/Include/IAssetItem.h | 433 ------------- Code/Editor/Include/IAssetItemDatabase.h | 259 -------- Code/Editor/Include/IAssetViewer.h | 46 -- Code/Editor/Include/IFileUtil.h | 3 - .../SimpleTriangleRasterizer.cpp | 506 --------------- .../SimpleTriangleRasterizer.h | 181 ------ Code/Editor/Objects/ObjectManager.cpp | 1 - Code/Editor/Util/FileUtil.cpp | 102 --- Code/Editor/Util/FileUtil.h | 6 - Code/Editor/Util/FileUtil_impl.cpp | 5 - Code/Editor/Util/FileUtil_impl.h | 3 - Code/Editor/editor_lib_files.cmake | 9 - 18 files changed, 2628 deletions(-) delete mode 100644 Code/Editor/EditMode/DeepSelection.cpp delete mode 100644 Code/Editor/EditMode/DeepSelection.h delete mode 100644 Code/Editor/Geometry/TriMesh.cpp delete mode 100644 Code/Editor/Geometry/TriMesh.h delete mode 100644 Code/Editor/Include/IAnimationCompressionManager.h delete mode 100644 Code/Editor/Include/IAssetItem.h delete mode 100644 Code/Editor/Include/IAssetItemDatabase.h delete mode 100644 Code/Editor/Include/IAssetViewer.h delete mode 100644 Code/Editor/LightmapCompiler/SimpleTriangleRasterizer.cpp delete mode 100644 Code/Editor/LightmapCompiler/SimpleTriangleRasterizer.h diff --git a/Code/Editor/EditMode/DeepSelection.cpp b/Code/Editor/EditMode/DeepSelection.cpp deleted file mode 100644 index 3e232a230c..0000000000 --- a/Code/Editor/EditMode/DeepSelection.cpp +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include "EditorDefs.h" - -#include "DeepSelection.h" - -// Editor -#include "Objects/BaseObject.h" - - -//! Functor for sorting selected objects on deep selection mode. -struct NearDistance -{ - NearDistance(){} - bool operator()(const CDeepSelection::RayHitObject& lhs, const CDeepSelection::RayHitObject& rhs) const - { - return lhs.distance < rhs.distance; - } -}; - -//----------------------------------------------------------------------------- -CDeepSelection::CDeepSelection() - : m_Mode(DSM_NONE) - , m_previousMode(DSM_NONE) - , m_CandidateObjectCount(0) - , m_CurrentSelectedPos(-1) -{ - m_LastPickPoint = QPoint(-1, -1); -} - -//----------------------------------------------------------------------------- -CDeepSelection::~CDeepSelection() -{ -} - -//----------------------------------------------------------------------------- -void CDeepSelection::Reset(bool bResetLastPick) -{ - for (int i = 0; i < m_CandidateObjectCount; ++i) - { - m_RayHitObjects[i].object->ClearFlags(OBJFLAG_NO_HITTEST); - } - - m_CandidateObjectCount = 0; - m_CurrentSelectedPos = -1; - - m_RayHitObjects.clear(); - - if (bResetLastPick) - { - m_LastPickPoint = QPoint(-1, -1); - } -} - -//----------------------------------------------------------------------------- -void CDeepSelection::AddObject(float distance, CBaseObject* pObj) -{ - m_RayHitObjects.push_back(RayHitObject(distance, pObj)); -} - -//----------------------------------------------------------------------------- -bool CDeepSelection::OnCycling (const QPoint& pt) -{ - QPoint diff = m_LastPickPoint - pt; - LONG epsilon = 2; - m_LastPickPoint = pt; - - if (abs(diff.x()) < epsilon && abs(diff.y()) < epsilon) - { - return true; - } - else - { - return false; - } -} - -//----------------------------------------------------------------------------- -void CDeepSelection::ExcludeHitTest(int except) -{ - int nExcept = except % m_CandidateObjectCount; - - for (int i = 0; i < m_CandidateObjectCount; ++i) - { - m_RayHitObjects[i].object->SetFlags(OBJFLAG_NO_HITTEST); - } - - m_RayHitObjects[nExcept].object->ClearFlags(OBJFLAG_NO_HITTEST); -} - -//----------------------------------------------------------------------------- -int CDeepSelection::CollectCandidate(float fMinDistance, float fRange) -{ - m_CandidateObjectCount = 0; - - if (!m_RayHitObjects.empty()) - { - std::sort(m_RayHitObjects.begin(), m_RayHitObjects.end(), NearDistance()); - - for (std::vector::iterator itr = m_RayHitObjects.begin(); - itr != m_RayHitObjects.end(); ++itr) - { - if (itr->distance - fMinDistance < fRange) - { - ++m_CandidateObjectCount; - } - else - { - break; - } - } - } - - return m_CandidateObjectCount; -} - -//----------------------------------------------------------------------------- -CBaseObject* CDeepSelection::GetCandidateObject(int index) -{ - m_CurrentSelectedPos = index % m_CandidateObjectCount; - - return m_RayHitObjects[m_CurrentSelectedPos].object; -} - -//----------------------------------------------------------------------------- -//! -void CDeepSelection::SetMode(EDeepSelectionMode mode) -{ - m_previousMode = m_Mode; - m_Mode = mode; -} diff --git a/Code/Editor/EditMode/DeepSelection.h b/Code/Editor/EditMode/DeepSelection.h deleted file mode 100644 index b6f652abc5..0000000000 --- a/Code/Editor/EditMode/DeepSelection.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -// Description : Deep Selection Header - - -#ifndef CRYINCLUDE_EDITOR_EDITMODE_DEEPSELECTION_H -#define CRYINCLUDE_EDITOR_EDITMODE_DEEPSELECTION_H -#pragma once - -class CBaseObject; - -//! Deep Selection -//! Additional output information of HitContext on using "deep selection mode". -//! At the deep selection mode, it supports second selection pass for easy -//! selection on crowded area with two different method. -//! One is to show pop menu of candidate objects list. Another is the cyclic -//! selection on pick clicking. -class CDeepSelection - : public _i_reference_target_t -{ -public: - //! Deep Selection Mode Definition - enum EDeepSelectionMode - { - DSM_NONE = 0, // Not using deep selection. - DSM_POP = 1, // Deep selection mode with pop context menu. - DSM_CYCLE = 2 // Deep selection mode with cyclic selection on each clinking same point. - }; - - //! Subclass for container of the selected object with hit distance. - struct RayHitObject - { - RayHitObject(float dist, CBaseObject* pObj) - : distance(dist) - , object(pObj) - { - } - - float distance; - CBaseObject* object; - }; - - //! Constructor - CDeepSelection(); - virtual ~CDeepSelection(); - - void Reset(bool bResetLastPick = false); - void AddObject(float distance, CBaseObject* pObj); - //! Check if clicking point is same position with last position, - //! to decide whether to continue cycling mode. - bool OnCycling (const QPoint& pt); - //! All objects in list are excluded for hitting test except one, current selection. - void ExcludeHitTest(int except); - void SetMode(EDeepSelectionMode mode); - inline EDeepSelectionMode GetMode() const { return m_Mode; } - inline EDeepSelectionMode GetPreviousMode() const { return m_previousMode; } - //! Collect object in the deep selection range. The distance from the minimum - //! distance is less than deep selection range. - int CollectCandidate(float fMinDistance, float fRange); - //! Return the candidate object in index position, then it is to be current - //! selection position. - CBaseObject* GetCandidateObject(int index); - //! Return the current selection position that is update in "GetCandidateObject" - //! function call. - inline int GetCurrentSelectPos() const { return m_CurrentSelectedPos; } - //! Return the number of objects in the deep selection range. - inline int GetCandidateObjectCount() const { return m_CandidateObjectCount; } - -private: - //! Current mode - EDeepSelectionMode m_Mode; - EDeepSelectionMode m_previousMode; - //! Last picking point to check whether cyclic selection continue. - QPoint m_LastPickPoint; - //! List of the selected objects with ray hitting - std::vector m_RayHitObjects; - int m_CandidateObjectCount; - int m_CurrentSelectedPos; -}; -#endif // CRYINCLUDE_EDITOR_EDITMODE_DEEPSELECTION_H diff --git a/Code/Editor/Geometry/TriMesh.cpp b/Code/Editor/Geometry/TriMesh.cpp deleted file mode 100644 index efc201095d..0000000000 --- a/Code/Editor/Geometry/TriMesh.cpp +++ /dev/null @@ -1,587 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include "EditorDefs.h" - -#include "TriMesh.h" - -// Editor -#include "Util/fastlib.h" -#include "Objects/SubObjSelection.h" - - -////////////////////////////////////////////////////////////////////////// -CTriMesh::CTriMesh() -{ - pFaces = nullptr; - pVertices = nullptr; - pWSVertices = nullptr; - pUV = nullptr; - pColors = nullptr; - pEdges = nullptr; - pWeights = nullptr; - - nFacesCount = 0; - nVertCount = 0; - nUVCount = 0; - nEdgeCount = 0; - - selectionType = SO_ELEM_NONE; - - memset(m_streamSize, 0, sizeof(m_streamSize)); - memset(m_streamSel, 0, sizeof(m_streamSel)); - streamSelMask = 0; - - m_streamSel[VERTICES] = &vertSel; - m_streamSel[EDGES] = &edgeSel; - m_streamSel[FACES] = &faceSel; -} - -////////////////////////////////////////////////////////////////////////// -CTriMesh::~CTriMesh() -{ - free(pFaces); - free(pEdges); - free(pVertices); - free(pUV); - free(pColors); - free(pWSVertices); - free(pWeights); -} - -// Set stream size. -void CTriMesh::ReallocStream(int stream, int nNewCount) -{ - assert(stream >= 0 && stream < LAST_STREAM); - if (stream < 0 || stream >= LAST_STREAM) - { - return; - } - if (m_streamSize[stream] == nNewCount) - { - return; // Stream already have required size. - } - void* pStream = nullptr; - int nElementSize = 0; - GetStreamInfo(stream, pStream, nElementSize); - pStream = ReAllocElements(pStream, nNewCount, nElementSize); - m_streamSize[stream] = nNewCount; - - switch (stream) - { - case VERTICES: - pVertices = (CTriVertex*)pStream; - nVertCount = nNewCount; - vertSel.resize(nNewCount); - break; - case FACES: - pFaces = (CTriFace*)pStream; - nFacesCount = nNewCount; - faceSel.resize(nNewCount); - break; - case EDGES: - pEdges = (CTriEdge*)pStream; - nEdgeCount = nNewCount; - edgeSel.resize(nNewCount); - break; - case TEXCOORDS: - pUV = (SMeshTexCoord*)pStream; - nUVCount = nNewCount; - break; - case COLORS: - pColors = (SMeshColor*)pStream; - break; - case WEIGHTS: - pWeights = (float*)pStream; - break; - case LINES: - pLines = (CTriLine*)pStream; - break; - case WS_POSITIONS: - pWSVertices = (Vec3*)pStream; - break; - default: - assert(0); // unknown stream. - } - m_streamSize[stream] = nNewCount; -} - -// Set stream size. -void CTriMesh::GetStreamInfo(int stream, void*& pStream, int& nElementSize) const -{ - assert(stream >= 0 && stream < LAST_STREAM); - switch (stream) - { - case VERTICES: - pStream = pVertices; - nElementSize = sizeof(CTriVertex); - break; - case FACES: - pStream = pFaces; - nElementSize = sizeof(CTriFace); - break; - case EDGES: - pStream = pEdges; - nElementSize = sizeof(CTriEdge); - break; - case TEXCOORDS: - pStream = pUV; - nElementSize = sizeof(SMeshTexCoord); - break; - case COLORS: - pStream = pColors; - nElementSize = sizeof(SMeshColor); - break; - case WEIGHTS: - pStream = pWeights; - nElementSize = sizeof(float); - break; - case LINES: - pStream = pLines; - nElementSize = sizeof(CTriLine); - break; - case WS_POSITIONS: - pStream = pWSVertices; - nElementSize = sizeof(Vec3); - break; - default: - assert(0); // unknown stream. - } -} - -////////////////////////////////////////////////////////////////////////// -void* CTriMesh::ReAllocElements(void* old_ptr, int new_elem_num, int size_of_element) -{ - return realloc(old_ptr, new_elem_num * size_of_element); -} - -///////////////////////////////////////////////////////////////////////////////////// -inline int FindVertexInHash(const Vec3& vPosToFind, const CTriVertex* pVectors, std::vector& hash, float fEpsilon) -{ - for (uint32 i = 0; i < hash.size(); i++) - { - const Vec3& v0 = pVectors[hash[i]].pos; - const Vec3& v1 = vPosToFind; - if (fabsf(v0.y - v1.y) < fEpsilon && fabsf(v0.x - v1.x) < fEpsilon && fabsf(v0.z - v1.z) < fEpsilon) - { - return hash[i]; - } - } - return -1; -} - -///////////////////////////////////////////////////////////////////////////////////// -inline int FindTexCoordInHash(const SMeshTexCoord& coordToFind, const SMeshTexCoord* pCoords, std::vector& hash, float fEpsilon) -{ - for (uint32 i = 0; i < hash.size(); i++) - { - const SMeshTexCoord& t0 = pCoords[hash[i]]; - const SMeshTexCoord& t1 = coordToFind; - - if (t0.IsEquivalent(t1, fEpsilon)) - { - return hash[i]; - } - } - return -1; -} - - -////////////////////////////////////////////////////////////////////////// -void CTriMesh::SharePositions() -{ - float fEpsilon = 0.0001f; - float fHashScale = 256.0f / MAX(bbox.GetSize().GetLength(), fEpsilon); - std::vector arrHashTable[256]; - - CTriVertex* pNewVerts = new CTriVertex[GetVertexCount()]; - SMeshColor* pNewColors = nullptr; - if (pColors) - { - pNewColors = new SMeshColor[GetVertexCount()]; - } - - int nLastIndex = 0; - for (int f = 0; f < GetFacesCount(); f++) - { - CTriFace& face = pFaces[f]; - for (int i = 0; i < 3; i++) - { - const Vec3& v = pVertices[face.v[i]].pos; - uint8 nHash = static_cast(RoundFloatToInt((v.x + v.y + v.z) * fHashScale)); - - int find = FindVertexInHash(v, pNewVerts, arrHashTable[nHash], fEpsilon); - if (find < 0) - { - pNewVerts[nLastIndex] = pVertices[face.v[i]]; - if (pColors) - { - pNewColors[nLastIndex] = pColors[face.v[i]]; - } - face.v[i] = nLastIndex; - // Reserve some space already. - arrHashTable[nHash].reserve(100); - arrHashTable[nHash].push_back(nLastIndex); - nLastIndex++; - } - else - { - face.v[i] = find; - } - } - } - - SetVertexCount(nLastIndex); - memcpy(pVertices, pNewVerts, nLastIndex * sizeof(CTriVertex)); - delete []pNewVerts; - - if (pColors) - { - SetColorsCount(nLastIndex); - memcpy(pColors, pNewColors, nLastIndex * sizeof(SMeshColor)); - delete []pNewColors; - } -} - -////////////////////////////////////////////////////////////////////////// -void CTriMesh::ShareUV() -{ - float fEpsilon = 0.0001f; - float fHashScale = 256.0f; - std::vector arrHashTable[256]; - - SMeshTexCoord* pNewUV = new SMeshTexCoord[GetUVCount()]; - - int nLastIndex = 0; - for (int f = 0; f < GetFacesCount(); f++) - { - CTriFace& face = pFaces[f]; - for (int i = 0; i < 3; i++) - { - const Vec2 uv = pUV[face.uv[i]].GetUV(); - uint8 nHash = static_cast(RoundFloatToInt((uv.x + uv.y) * fHashScale)); - - int find = FindTexCoordInHash(pUV[face.uv[i]], pNewUV, arrHashTable[nHash], fEpsilon); - if (find < 0) - { - pNewUV[nLastIndex] = pUV[face.uv[i]]; - face.uv[i] = nLastIndex; - arrHashTable[nHash].reserve(100); - arrHashTable[nHash].push_back(nLastIndex); - nLastIndex++; - } - else - { - face.uv[i] = find; - } - } - } - - SetUVCount(nLastIndex); - memcpy(pUV, pNewUV, nLastIndex * sizeof(SMeshTexCoord)); - delete []pNewUV; -} - -////////////////////////////////////////////////////////////////////////// -void CTriMesh::CalcFaceNormals() -{ - for (int i = 0; i < nFacesCount; i++) - { - CTriFace& face = pFaces[i]; - Vec3 p1 = pVertices[face.v[0]].pos; - Vec3 p2 = pVertices[face.v[1]].pos; - Vec3 p3 = pVertices[face.v[2]].pos; - face.normal = (p2 - p1).Cross(p3 - p1); - face.normal.Normalize(); - } -} - -#define TEX_EPS 0.001f -#define VER_EPS 0.001f - -////////////////////////////////////////////////////////////////////////// -void CTriMesh::CopyStream(CTriMesh& fromMesh, int stream) -{ - void* pTrgStream = nullptr; - void* pSrcStream = nullptr; - int nElemSize = 0; - fromMesh.GetStreamInfo(stream, pSrcStream, nElemSize); - if (pSrcStream) - { - ReallocStream(stream, fromMesh.GetStreamSize(stream)); - GetStreamInfo(stream, pTrgStream, nElemSize); - memcpy(pTrgStream, pSrcStream, nElemSize * fromMesh.GetStreamSize(stream)); - } -} - -////////////////////////////////////////////////////////////////////////// -void CTriMesh::Copy(CTriMesh& fromMesh, int nCopyFlags) -{ - streamSelMask = fromMesh.streamSelMask; - - if (nCopyFlags & COPY_VERTICES) - { - CopyStream(fromMesh, VERTICES); - } - if (nCopyFlags & COPY_FACES) - { - CopyStream(fromMesh, FACES); - } - if (nCopyFlags & COPY_EDGES) - { - CopyStream(fromMesh, EDGES); - } - if (nCopyFlags & COPY_TEXCOORDS) - { - CopyStream(fromMesh, TEXCOORDS); - } - if (nCopyFlags & COPY_COLORS) - { - CopyStream(fromMesh, COLORS); - } - if (nCopyFlags & COPY_WEIGHTS) - { - CopyStream(fromMesh, WEIGHTS); - } - if (nCopyFlags & COPY_LINES) - { - CopyStream(fromMesh, LINES); - } - - if (nCopyFlags & COPY_VERT_SEL) - { - vertSel = fromMesh.vertSel; - } - if (nCopyFlags & COPY_EDGE_SEL) - { - edgeSel = fromMesh.edgeSel; - } - if (nCopyFlags & COPY_FACE_SEL) - { - faceSel = fromMesh.faceSel; - } -} - -////////////////////////////////////////////////////////////////////////// -void CTriMesh::UpdateEdges() -{ - SetEdgeCount(GetFacesCount() * 3); - - std::map edgemap; - - int nEdges = 0; - for (int i = 0; i < GetFacesCount(); i++) - { - CTriFace& face = pFaces[i]; - for (int j = 0; j < 3; j++) - { - int v0 = j; - int v1 = (j != 2) ? j + 1 : 0; - CTriEdge edge; - edge.flags = 0; - - // First vertex index must always be smaller. - if (face.v[v0] < face.v[v1]) - { - edge.v[0] = face.v[v0]; - edge.v[1] = face.v[v1]; - } - else - { - edge.v[0] = face.v[v1]; - edge.v[1] = face.v[v0]; - } - edge.face[0] = i; - edge.face[1] = -1; - int nedge = stl::find_in_map(edgemap, edge, -1); - if (nedge >= 0) - { - // Assign this face as a second member of the edge. - if (pEdges[nedge].face[1] < 0) - { - pEdges[nedge].face[1] = i; - } - - face.edge[j] = nedge; - } - else - { - edgemap[edge] = nEdges; - pEdges[nEdges] = edge; - face.edge[j] = nEdges; - nEdges++; - } - } - } - - SetEdgeCount(nEdges); -} - -////////////////////////////////////////////////////////////////////////// -void CTriMesh::SoftSelection(const SSubObjSelOptions& options) -{ - int i; - int nVerts = GetVertexCount(); - CTriVertex* pVerts = pVertices; - - for (i = 0; i < nVerts; i++) - { - if (pWeights[i] == 1.0f) - { - const Vec3& vp = pVerts[i].pos; - for (int j = 0; j < nVerts; j++) - { - if (pWeights[j] != 1.0f) - { - if (vp.IsEquivalent(pVerts[j].pos, options.fSoftSelFalloff)) - { - float fDist = vp.GetDistance(pVerts[j].pos); - if (fDist < options.fSoftSelFalloff) - { - float fWeight = 1.0f - (fDist / options.fSoftSelFalloff); - if (fWeight > pWeights[j]) - { - pWeights[j] = fWeight; - } - } - } - } - } - } - } -} - -////////////////////////////////////////////////////////////////////////// -bool CTriMesh::UpdateSelection() -{ - bool bAnySelected = false; - if (selectionType == SO_ELEM_VERTEX) - { - for (int i = 0; i < GetVertexCount(); i++) - { - if (vertSel[i]) - { - bAnySelected = true; - pWeights[i] = 1.0f; - } - else - { - pWeights[i] = 0; - } - } - } - if (selectionType == SO_ELEM_EDGE) - { - // Clear weights. - for (int i = 0; i < GetVertexCount(); i++) - { - pWeights[i] = 0; - } - - for (int i = 0; i < GetEdgeCount(); i++) - { - if (edgeSel[i]) - { - bAnySelected = true; - CTriEdge& edge = pEdges[i]; - for (int j = 0; j < 2; j++) - { - pWeights[edge.v[j]] = 1.0f; - } - } - } - } - else if (selectionType == SO_ELEM_FACE) - { - // Clear weights. - for (int i = 0; i < GetVertexCount(); i++) - { - pWeights[i] = 0; - } - - for (int i = 0; i < GetFacesCount(); i++) - { - if (faceSel[i]) - { - bAnySelected = true; - CTriFace& face = pFaces[i]; - for (int j = 0; j < 3; j++) - { - pWeights[face.v[j]] = 1.0f; - } - } - } - } - return bAnySelected; -} - - -////////////////////////////////////////////////////////////////////////// -bool CTriMesh::ClearSelection() -{ - bool bWasSelected = false; - // Remove all selections. - int i; - for (i = 0; i < GetVertexCount(); i++) - { - pWeights[i] = 0; - } - streamSelMask = 0; - for (int ii = 0; ii < LAST_STREAM; ii++) - { - if (m_streamSel[ii] && !m_streamSel[ii]->is_zero()) - { - bWasSelected = true; - m_streamSel[ii]->clear(); - } - } - return bWasSelected; -} - -////////////////////////////////////////////////////////////////////////// -void CTriMesh::GetEdgesByVertex(MeshElementsArray& inVertices, MeshElementsArray& outEdges) -{ - // Brute force algorithm using binary search. - // for every edge check if edge vertex is inside inVertices array. - std::sort(inVertices.begin(), inVertices.end()); - for (int i = 0; i < GetEdgeCount(); i++) - { - if (stl::binary_find(inVertices.begin(), inVertices.end(), static_cast(pEdges[i].v[0])) != inVertices.end()) - { - outEdges.push_back(i); - } - else if (stl::binary_find(inVertices.begin(), inVertices.end(), static_cast(pEdges[i].v[1])) != inVertices.end()) - { - outEdges.push_back(i); - } - } -} - -////////////////////////////////////////////////////////////////////////// -void CTriMesh::GetFacesByVertex(MeshElementsArray& inVertices, MeshElementsArray& outFaces) -{ - // Brute force algorithm using binary search. - // for every face check if face vertex is inside inVertices array. - std::sort(inVertices.begin(), inVertices.end()); - for (int i = 0; i < GetFacesCount(); i++) - { - if (stl::binary_find(inVertices.begin(), inVertices.end(), static_cast(pFaces[i].v[0])) != inVertices.end()) - { - outFaces.push_back(i); - } - else if (stl::binary_find(inVertices.begin(), inVertices.end(), static_cast(pFaces[i].v[1])) != inVertices.end()) - { - outFaces.push_back(i); - } - else if (stl::binary_find(inVertices.begin(), inVertices.end(), static_cast(pFaces[i].v[2])) != inVertices.end()) - { - outFaces.push_back(i); - } - } -} diff --git a/Code/Editor/Geometry/TriMesh.h b/Code/Editor/Geometry/TriMesh.h deleted file mode 100644 index a6c58b8f9d..0000000000 --- a/Code/Editor/Geometry/TriMesh.h +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_GEOMETRY_TRIMESH_H -#define CRYINCLUDE_EDITOR_GEOMETRY_TRIMESH_H -#pragma once - -#include -#include "Util/bitarray.h" - -struct SSubObjSelOptions; - -typedef std::vector MeshElementsArray; - -////////////////////////////////////////////////////////////////////////// -// Vertex used in the TriMesh. -////////////////////////////////////////////////////////////////////////// -struct CTriVertex -{ - Vec3 pos; - //float weight; // Selection weight in 0-1 range. -}; - -////////////////////////////////////////////////////////////////////////// -// Triangle face used by the Triangle mesh. -////////////////////////////////////////////////////////////////////////// -struct CTriFace -{ - uint32 v[3]; // Indices to vertices array. - uint32 uv[3]; // Indices to texture coordinates array. - Vec3 n[3]; // Vertex normals at face vertices. - Vec3 normal; // Face normal. - uint32 edge[3]; // Indices to the face edges. - unsigned char MatID; // Index of face sub material. - unsigned char flags; // see ETriMeshFlags -}; - -////////////////////////////////////////////////////////////////////////// -// Mesh edge. -////////////////////////////////////////////////////////////////////////// -struct CTriEdge -{ - uint32 v[2]; // Indices to edge vertices. - int face[2]; // Indices to edge faces (-1 if no face). - uint32 flags; // see ETriMeshFlags - - CTriEdge() {} - bool operator==(const CTriEdge& edge) const - { - if ((v[0] == edge.v[0] && v[1] == edge.v[1]) || - (v[0] == edge.v[1] && v[1] == edge.v[0])) - { - return true; - } - return false; - } - bool operator!=(const CTriEdge& edge) const { return !(*this == edge); } - bool operator<(const CTriEdge& edge) const { return (*(uint64*)v < *(uint64*)edge.v); } - bool operator>(const CTriEdge& edge) const { return (*(uint64*)v > *(uint64*)edge.v); } -}; - -////////////////////////////////////////////////////////////////////////// -// Mesh line. -////////////////////////////////////////////////////////////////////////// -struct CTriLine -{ - uint32 v[2]; // Indices to edge vertices. - - CTriLine() {} - bool operator==(const CTriLine& edge) const - { - if ((v[0] == edge.v[0] && v[1] == edge.v[1]) || - (v[0] == edge.v[1] && v[1] == edge.v[0])) - { - return true; - } - return false; - } - bool operator!=(const CTriLine& edge) const { return !(*this == edge); } - bool operator<(const CTriLine& edge) const { return (*(uint64*)v < *(uint64*)edge.v); } - bool operator>(const CTriLine& edge) const { return (*(uint64*)v > *(uint64*)edge.v); } -}; - -////////////////////////////////////////////////////////////////////////// -struct CTriMeshPoly -{ - std::vector v; // Indices to vertices array. - std::vector uv; // Indices to texture coordinates array. - std::vector n; // Vertex normals at face vertices. - Vec3 normal; // Polygon normal. - uint32 edge[3]; // Indices to the face edges. - unsigned char MatID; // Index of face sub material. - unsigned char flags; // optional flags. -}; - -////////////////////////////////////////////////////////////////////////// -// CTriMesh is used in the Editor as a general purpose editable triangle mesh. -////////////////////////////////////////////////////////////////////////// -class CTriMesh -{ -public: - enum EStream - { - VERTICES, - FACES, - EDGES, - TEXCOORDS, - COLORS, - WEIGHTS, - LINES, - WS_POSITIONS, - LAST_STREAM, - }; - enum ECopyFlags - { - COPY_VERTICES = BIT(1), - COPY_FACES = BIT(2), - COPY_EDGES = BIT(3), - COPY_TEXCOORDS = BIT(4), - COPY_COLORS = BIT(5), - COPY_VERT_SEL = BIT(6), - COPY_EDGE_SEL = BIT(7), - COPY_FACE_SEL = BIT(8), - COPY_WEIGHTS = BIT(9), - COPY_LINES = BIT(10), - COPY_ALL = 0xFFFF, - }; - // geometry data - CTriFace* pFaces; - CTriEdge* pEdges; - CTriVertex* pVertices; - SMeshTexCoord* pUV; - SMeshColor* pColors; // If allocated same size as pVerts array. - Vec3* pWSVertices; // World space vertices. - float* pWeights; - CTriLine* pLines; - - int nFacesCount; - int nVertCount; - int nUVCount; - int nEdgeCount; - int nLinesCount; - - AABB bbox; - - ////////////////////////////////////////////////////////////////////////// - // Selections. - ////////////////////////////////////////////////////////////////////////// - CBitArray vertSel; - CBitArray edgeSel; - CBitArray faceSel; - // Every bit of the selection mask correspond to a stream, if bit is set this stream have some elements selected - int streamSelMask; - - // Selection element type. - // see ESubObjElementType - int selectionType; - - ////////////////////////////////////////////////////////////////////////// - // Vertices of the front facing triangles. - CBitArray frontFacingVerts; - - ////////////////////////////////////////////////////////////////////////// - // Functions. - ////////////////////////////////////////////////////////////////////////// - CTriMesh(); - ~CTriMesh(); - - int GetFacesCount() const { return nFacesCount; } - int GetVertexCount() const { return nVertCount; } - int GetUVCount() const { return nUVCount; } - int GetEdgeCount() const { return nEdgeCount; } - int GetLinesCount() const { return nLinesCount; } - - ////////////////////////////////////////////////////////////////////////// - void SetFacesCount(int nNewCount) { ReallocStream(FACES, nNewCount); } - void SetVertexCount(int nNewCount) - { - ReallocStream(VERTICES, nNewCount); - if (pColors) - { - ReallocStream(COLORS, nNewCount); - } - ReallocStream(WEIGHTS, nNewCount); - } - void SetColorsCount(int nNewCount) { ReallocStream(COLORS, nNewCount); } - void SetUVCount(int nNewCount) { ReallocStream(TEXCOORDS, nNewCount); } - void SetEdgeCount(int nNewCount) { ReallocStream(EDGES, nNewCount); } - void SetLinesCount(int nNewCount) { ReallocStream(LINES, nNewCount); } - - void ReallocStream(int stream, int nNewCount); - void GetStreamInfo(int stream, void*& pStream, int& nElementSize) const; - int GetStreamSize(int stream) const { return m_streamSize[stream]; }; - - // Calculate per face normal. - void CalcFaceNormals(); - - ////////////////////////////////////////////////////////////////////////// - // Welding functions. - ////////////////////////////////////////////////////////////////////////// - void SharePositions(); - void ShareUV(); - ////////////////////////////////////////////////////////////////////////// - // Recreate edges of the mesh. - void UpdateEdges(); - - void Copy(CTriMesh& fromMesh, int nCopyFlags = COPY_ALL); - - ////////////////////////////////////////////////////////////////////////// - // Sub-object selection specific methods. - ////////////////////////////////////////////////////////////////////////// - // Return true if something is selected. - bool UpdateSelection(); - // Clear all selections, return true if something was selected. - bool ClearSelection(); - void SoftSelection(const SSubObjSelOptions& options); - CBitArray* GetStreamSelection(int nStream) { return m_streamSel[nStream]; }; - // Returns true if specified stream have any selected elements. - bool StreamHaveSelection(int nStream) { return streamSelMask & (1 << nStream); } - void GetEdgesByVertex(MeshElementsArray& inVertices, MeshElementsArray& outEdges); - void GetFacesByVertex(MeshElementsArray& inVertices, MeshElementsArray& outFaces); - -private: - void* ReAllocElements(void* old_ptr, int new_elem_num, int size_of_element); - void CopyStream(CTriMesh& fromMesh, int stream); - - // For internal use. - int m_streamSize[LAST_STREAM]; - CBitArray* m_streamSel[LAST_STREAM]; -}; - -#endif // CRYINCLUDE_EDITOR_GEOMETRY_TRIMESH_H diff --git a/Code/Editor/Include/HitContext.h b/Code/Editor/Include/HitContext.h index ceff0adb22..b49117bb60 100644 --- a/Code/Editor/Include/HitContext.h +++ b/Code/Editor/Include/HitContext.h @@ -17,7 +17,6 @@ class CGizmo; class CBaseObject; struct IDisplayViewport; -class CDeepSelection; struct AABB; #include @@ -105,8 +104,6 @@ struct HitContext CBaseObject* object; //! gizmo object that have been hit. CGizmo* gizmo; - //! for deep selection mode - CDeepSelection* pDeepSelection; //! For linking tool const char* name; //! true if this hit was from the object icon @@ -131,7 +128,6 @@ struct HitContext bIgnoreAxis = false; bOnlyGizmo = false; bUseSelectionHelpers = false; - pDeepSelection = 0; name = nullptr; iconHit = false; } diff --git a/Code/Editor/Include/IAnimationCompressionManager.h b/Code/Editor/Include/IAnimationCompressionManager.h deleted file mode 100644 index 64cebf620a..0000000000 --- a/Code/Editor/Include/IAnimationCompressionManager.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_INCLUDE_IANIMATIONCOMPRESSIONMANAGER_H -#define CRYINCLUDE_EDITOR_INCLUDE_IANIMATIONCOMPRESSIONMANAGER_H -#pragma once - -struct IAnimationCompressionManager -{ - virtual bool IsEnabled() const = 0; - virtual void UpdateLocalAnimations() = 0; -}; - -#endif // CRYINCLUDE_EDITOR_INCLUDE_IANIMATIONCOMPRESSIONMANAGER_H diff --git a/Code/Editor/Include/IAssetItem.h b/Code/Editor/Include/IAssetItem.h deleted file mode 100644 index ff80331af5..0000000000 --- a/Code/Editor/Include/IAssetItem.h +++ /dev/null @@ -1,433 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * 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 : Standard interface for asset display in the asset browser, -// this header should be used to create plugins. -// The method Release of this interface should NOT be called. -// Instead, the FreeData from the database (from IAssetItemDatabase) should -// be used as it will safely release all the items from the database. -// It is still possible to call the release method, but this is not the -// recomended method, specially for usage outside of the plugins because there -// is no guarantee that a the asset will be properly removed from the database -// manager. - -#ifndef CRYINCLUDE_EDITOR_INCLUDE_IASSETITEM_H -#define CRYINCLUDE_EDITOR_INCLUDE_IASSETITEM_H -#pragma once - -struct IAssetItemDatabase; - -namespace AssetViewer -{ - // Used in GetAssetFieldValue for each asset type to check if field name is the right one - inline bool IsFieldName(const char* pIncomingFieldName, const char* pFieldName) - { - return !strncmp(pIncomingFieldName, pFieldName, strlen(pIncomingFieldName)); - } -} - -// Description: -// This interface allows the programmer to extend asset display types visible in the asset browser. -struct IAssetItem - : public IUnknown -{ - DEFINE_UUID(0x04F20346, 0x2EC3, 0x43f2, 0xBD, 0xA1, 0x2C, 0x0B, 0x97, 0x76, 0xF3, 0x84); - - // The supported asset flags - enum EAssetFlags - { - // asset is visible in the database for filtering and sorting (not asset view control related) - eFlag_Visible = BIT(0), - // the asset is loaded - eFlag_Loaded = BIT(1), - // the asset is loaded - eFlag_Cached = BIT(2), - // the asset is selected in a selection set - eFlag_Selected = BIT(3), - // this asset is invalid, no thumb is shown/available - eFlag_Invalid = BIT(4), - // this asset has some errors/warnings, in the asset browser it will show some blinking/red elements - // and the user can check out the errors. Error text will be fetched using GetAssetFieldValue( "errors", &someStringVar ) - eFlag_HasErrors = BIT(5), - // this flag is set when the asset is rendering its contents using GDI, and not the engine's rendering capabilities - // (this flags is used as hint for the preview tool, which will use a double-buffer canvas if this flag is set, - // and send a memory HDC to the OnBeginPreview method, for drawing of the asset) - eFlag_UseGdiRendering = BIT(6), - // set if this asset is draggable into the render viewports, and can be created there - eFlag_CanBeDraggedInViewports = BIT(7), - // set if this asset can be moved after creation, otherwise the asset instance will just be created where user clicked - eFlag_CanBeMovedAfterDroppedIntoViewport = BIT(8), - // the asset thumbnail image is loaded - eFlag_ThumbnailLoaded = BIT(9), - // the asset thumbnail image is loaded - eFlag_UsedInLevel = BIT(10) - }; - - // Asset field name and field values map - typedef std::map < QString/*fieldName*/, QString/*value*/ > TAssetFieldValuesMap; - // Dependency category names and corresponding files map, example: "Textures"=>{ "foam.dds","water.dds","normal.dds" } - typedef std::map < QString/*dependencyCategory*/, std::set/*dependency filenames*/ > TAssetDependenciesMap; - - virtual ~IAssetItem() { - } - - // Description: - // Get the hash number/key used for database thumbnail and info records management - virtual uint32 GetHash() const = 0; - // Description: - // Set the hash number/key used for database thumbnail and info records management - virtual void SetHash(uint32 hash) = 0; - // Description: - // Get the owner database for this asset - // Return Value: - // The owner database for this asset - // See Also: - // SetOwnerDatabase() - virtual IAssetItemDatabase* GetOwnerDatabase() const = 0; - // Description: - // Set the owner database for this asset - // Arguments: - // piOwnerDisplayDatabase - the owner database - // See Also: - // GetOwnerDatabase() - virtual void SetOwnerDatabase(IAssetItemDatabase* pOwnerDisplayDatabase) = 0; - // Description: - // Get the asset's dependency files / objects - // Return Value: - // The vector with filenames which this asset is dependent upon, ex.: ["Textures"].(vector of textures) - virtual const TAssetDependenciesMap& GetDependencies() const = 0; - // Description: - // Set the file size of this asset in bytes - // Arguments: - // aSize - size of the file in bytes - // See Also: - // GetFileSize() - virtual void SetFileSize(quint64 aSize) = 0; - // Description: - // Get the file size of this asset in bytes - // Return Value: - // The file size of this asset in bytes - // See Also: - // SetFileSize() - virtual quint64 GetFileSize() const = 0; - // Description: - // Set asset filename (extension included and no path) - // Arguments: - // pName - the asset filename (extension included and no path) - // See Also: - // GetFilename() - virtual void SetFilename(const char* pName) = 0; - // Description: - // Get asset filename (extension included and no path) - // Return Value: - // The asset filename (extension included and no path) - // See Also: - // SetFilename() - virtual QString GetFilename() const = 0; - // Description: - // Set the asset's relative path - // Arguments: - // pName - file's relative path - // See Also: - // GetRelativePath() - virtual void SetRelativePath(const char* pName) = 0; - // Description: - // Get the asset's relative path - // Return Value: - // The asset's relative path - // See Also: - // SetRelativePath() - virtual QString GetRelativePath() const = 0; - // Description: - // Set the file extension ( dot(s) must be included ) - // Arguments: - // pExt - the file's extension - // See Also: - // GetFileExtension() - virtual void SetFileExtension(const char* pExt) = 0; - // Description: - // Get the file extension ( dot(s) included ) - // Return Value: - // The file extension ( dot(s) included ) - // See Also: - // SetFileExtension() - virtual QString GetFileExtension() const = 0; - // Description: - // Get the asset flags, with values from IAssetItem::EAssetFlags - // Return Value: - // The asset flags, with values from IAssetItem::EAssetFlags - // See Also: - // SetFlags(), SetFlag(), IsFlagSet() - virtual UINT GetFlags() const = 0; - // Description: - // Set the asset flags - // Arguments: - // aFlags - flags, OR-ed values from IAssetItem::EAssetFlags - // See Also: - // GetFlags(), SetFlag(), IsFlagSet() - virtual void SetFlags(UINT aFlags) = 0; - // Description: - // Set/clear a single flag bit for the asset - // Arguments: - // aFlag - the flag to set/clear, with values from IAssetItem::EAssetFlags - // See Also: - // GetFlags(), SetFlags(), IsFlagSet() - virtual void SetFlag(EAssetFlags aFlag, bool bSet = true) = 0; - // Description: - // Check if a specified flag is set - // Arguments: - // aFlag - the flag to check, with values from IAssetItem::EAssetFlags - // Return Value: - // True if the flag is set - // See Also: - // GetFlags(), SetFlags(), SetFlag() - virtual bool IsFlagSet(EAssetFlags aFlag) const = 0; - // Description: - // Set this asset's index; used in sorting, selections, and to know where an asset is in the current list - // Arguments: - // aIndex - the asset's index - // See Also: - // GetIndex() - virtual void SetIndex(UINT aIndex) = 0; - // Description: - // Get the asset's index in the current list - // Return Value: - // The asset's index in the current list - // See Also: - // SetIndex() - virtual UINT GetIndex() const = 0; - // Description: - // Get the asset's field raw data value into a user location, you must check the field's type ( from asset item's owner database ) - // before using this function and send the correct pointer to destination according to the type ( int8, float32, string, etc. ) - // Arguments: - // pFieldName - the asset field name to query the value for - // pDest - the destination variable address, must be the same type as the field type - // Return Value: - // True if the asset field name is found and the value is returned correctly - // See Also: - // SetAssetFieldValue() - virtual QVariant GetAssetFieldValue(const char* pFieldName) const = 0; - // Description: - // Set the asset's field raw data value from a user location, you must check the field's type ( from asset item's owner database ) - // before using this function and send the correct pointer to source according to the type ( int8, float32, string, etc. ) - // Arguments: - // pFieldName - the asset field name to set the value for - // pSrc - the source variable address, must be the same type as the field type - // Return Value: - // True if the asset field name is found and the value is set correctly - // See Also: - // GetAssetFieldValue() - virtual bool SetAssetFieldValue(const char* pFieldName, void* pSrc) = 0; - // Description: - // Get the drawing rectangle for the asset's thumb ( absolute viewer canvas location ) - // Arguments: - // rstDrawingRectangle - destination location to set with the asset's thumbnail rectangle location - // See Also: - // SetDrawingRectangle() - virtual void GetDrawingRectangle(QRect& rstDrawingRectangle) const = 0; - // Description: - // Set the drawing rectangle for the asset's thumb ( absolute viewer canvas location ) - // Arguments: - // crstDrawingRectangle - source to set the asset's thumbnail rectangle - // See Also: - // GetDrawingRectangle() - virtual void SetDrawingRectangle(const QRect& crstDrawingRectangle) = 0; - // Description: - // Checks if the given 2D point is inside the asset's thumb rectangle - // Arguments: - // nX - mouse pointer position on X axis, relative to the asset viewer control - // nY - mouse pointer position on Y axis, relative to the asset viewer control - // Return Value: - // True if the given 2D point is inside the asset's thumb rectangle - // See Also: - // HitTest(CRect) - virtual bool HitTest(int nX, int nY) const = 0; - // Description: - // Checks if the given rectangle intersects the asset thumb's rectangle - // Arguments: - // nX - mouse pointer position on X axis, relative to the asset viewer control - // nY - mouse pointer position on Y axis, relative to the asset viewer control - // Return Value: - // True if the given rectangle intersects the asset thumb's rectangle - // See Also: - // HitTest(int nX,int nY) - virtual bool HitTest(const QRect& roTestRect) const = 0; - // Description: - // When user drags this asset item into a viewport, this method is called when the dragging operation ends - // and the mouse button is released, for the asset to return an instance of the asset object to be placed in the level - // Arguments: - // aX - instance's X position component in world coordinates - // aY - instance's Y position component in world coordinates - // aZ - instance's Z position component in world coordinates - // Return Value: - // The newly created asset instance (Example: BrushObject*) - // See Also: - // MoveInstanceInViewport() - virtual void* CreateInstanceInViewport(float aX, float aY, float aZ) = 0; - // Description: - // When the mouse button is released after level object creation, the user now can move the mouse - // and move the asset instance in the 3D world - // Arguments: - // pDraggedObject - the actual entity or brush object (CBaseObject* usually) to be moved around with the mouse - // returned by the CreateInstanceInViewport() - // aNewX - the new X world coordinates of the asset instance - // aNewY - the new Y world coordinates of the asset instance - // aNewZ - the new Z world coordinates of the asset instance - // Return Value: - // True if asset instance was moved properly - // See Also: - // CreateInstanceInViewport() - virtual bool MoveInstanceInViewport(const void* pDraggedObject, float aNewX, float aNewY, float aNewZ) = 0; - // Description: - // This will be called when the user presses ESCAPE key when dragging the asset in the viewport, you must delete the given object - // because the creation was aborted - // Arguments: - // pDraggedObject - the asset instance to be deleted ( you must cast to the needed type, and delete it properly ) - // See Also: - // CreateInstanceInViewport() - virtual void AbortCreateInstanceInViewport(const void* pDraggedObject) = 0; - // Description: - // This method is used to cache/load asset's data, so it can be previewed/rendered - // Return Value: - // True if the asset was successfully cached - // See Also: - // UnCache() - virtual bool Cache() = 0; - // Description: - // This method is used to force cache/load asset's data, so it can be previewed/rendered - // Return Value: - // True if the asset was successfully forced cached - // See Also: - // UnCache(), Cache() - virtual bool ForceCache() = 0; - // Description: - // This method is used to load the thumbnail image of the asset - // Return Value: - // True if thumb loaded ok - // See Also: - // UnloadThumbnail() - virtual bool LoadThumbnail() = 0; - // Description: - // This method is used to unload the thumbnail image of the asset - // See Also: - // LoadThumbnail() - virtual void UnloadThumbnail() = 0; - // Description: - // This is called when the asset starts to be previewed in full detail, so here you can load the whole asset, in fine detail - // ( textures are fully loaded, models etc. ). It is called once, when the Preview dialog is shown - // Arguments: - // hPreviewWnd - the window handle of the quick preview dialog - // hMemDC - the memory DC used to render assets that can render themselves in the DC, otherwise they will render in the dialog's HWND - // See Also: - // OnEndPreview(), GetCustomPreviewPanelHeader() - virtual void OnBeginPreview(QWidget* hPreviewWnd) = 0; - // Description: - // Called when the Preview dialog is closed, you may release the detail asset data here - // See Also: - // OnBeginPreview(), GetCustomPreviewPanelHeader() - virtual void OnEndPreview() = 0; - // Description: - // If the asset has a special preview panel with utility controls, to be placed at the top of the Preview window, it can return an child dialog window - // otherwise it can return nullptr, if no panel is available - // Arguments: - // pParentWnd - a valid CDialog*, or nullptr - // Return Value: - // A valid child dialog window handle, if this asset wants to have a custom panel in the top side of the Asset Preview window, - // otherwise it can return nullptr, if no panel is available - // See Also: - // OnBeginPreview(), OnEndPreview() - virtual QWidget* GetCustomPreviewPanelHeader(QWidget* pParentWnd) = 0; - virtual QWidget* GetCustomPreviewPanelFooter(QWidget* pParentWnd) = 0; - // Description: - // Used when dragging/rotate/zoom a model, or other asset that can support preview - // Arguments: - // hRenderWindow - the rendering window handle - // rstViewport - the viewport rectangle - // aMouseX - the render window relative mouse pointer X coordinate - // aMouseY - the render window relative mouse pointer Y coordinate - // aMouseDeltaX - the X coordinate delta between two mouse movements - // aMouseDeltaY - the Y coordinate delta between two mouse movements - // aMouseWheelDelta - the mouse wheel scroll delta/step - // aKeyFlags - the key flags, see WM_LBUTTONUP - // See Also: - // OnPreviewRenderKeyEvent() - virtual void PreviewRender( - QWidget* hRenderWindow, - const QRect& rstViewport, - int aMouseX = 0, int aMouseY = 0, - int aMouseDeltaX = 0, int aMouseDeltaY = 0, - int aMouseWheelDelta = 0, UINT aKeyFlags = 0) = 0; - // Description: - // This is called when the user manipulates the assets in interactive render and a key is pressed ( with down or up state ) - // Arguments: - // bKeyDown - true if this is a WM_KEYDOWN event, else it is a WM_KEYUP event - // aChar - the char/key code pressed/released - // aKeyFlags - the key flags, compatible with WM_KEYDOWN/UP events - // See Also: - // InteractiveRender() - virtual void OnPreviewRenderKeyEvent(bool bKeyDown, UINT aChar, UINT aKeyFlags) = 0; - // Description: - // Called when user clicked once on the thumb image - // Arguments: - // point - mouse coordinates relative to the thumbnail rectangle - // aKeyFlags - the key flags, see WM_LBUTTONDOWN - // See Also: - // OnThumbDblClick() - virtual void OnThumbClick(const QPoint& point, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers) = 0; - // Description: - // Called when user double clicked on the thumb image - // Arguments: - // point - mouse coordinates relative to the thumbnail rectangle - // aKeyFlags - the key flags, see WM_LBUTTONDOWN - // See Also: - // OnThumbClick() - //! called when user clicked twice on the thumb image - virtual void OnThumbDblClick(const QPoint& point, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers) = 0; - // Description: - // Draw the cached thumb bitmap only, if any, no other kind of rendering - // Arguments: - // hDC - the destination DC, where to draw the thumb - // rRect - the destination rectangle - // Return Value: - // True if drawing of the thumbnail was done OK - // See Also: - // Render() - virtual bool DrawThumbImage(QPainter* painter, const QRect& rRect) = 0; - // Description: - // Writes asset info to a XML node. - // This is needed to save cached info as a persistent XML file for the next run of the editor. - // Arguments: - // node - An XML node to contain the info - // See Also: - // FromXML() - virtual void ToXML(XmlNodeRef& node) const = 0; - // Description: - // Gets asset info from a XML node. - // This is needed to get the asset info from previous runs of the editor without re-caching it. - // Arguments: - // node - An XML node that contains info for this asset - // See Also: - // ToXML() - virtual void FromXML(const XmlNodeRef& node) = 0; - - // From IUnknown - virtual HRESULT STDMETHODCALLTYPE QueryInterface([[maybe_unused]] const IID& riid, [[maybe_unused]] void** ppvObject) - { - return E_NOINTERFACE; - }; - virtual ULONG STDMETHODCALLTYPE AddRef() - { - return 0; - }; - virtual ULONG STDMETHODCALLTYPE Release() - { - return 0; - }; -}; -#endif // CRYINCLUDE_EDITOR_INCLUDE_IASSETITEM_H diff --git a/Code/Editor/Include/IAssetItemDatabase.h b/Code/Editor/Include/IAssetItemDatabase.h deleted file mode 100644 index 39fd60e8c6..0000000000 --- a/Code/Editor/Include/IAssetItemDatabase.h +++ /dev/null @@ -1,259 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * 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 : Standard interface for asset database creators used to -// create an asset plugin for the asset browser -// The category of the plugin must be Asset Item DB - - -#ifndef CRYINCLUDE_EDITOR_INCLUDE_IASSETITEMDATABASE_H -#define CRYINCLUDE_EDITOR_INCLUDE_IASSETITEMDATABASE_H -#pragma once -struct IAssetItem; -struct IAssetViewer; - -class QString; -class QStringList; - -// Description: -// This struct keeps the info, filter and sorting settings for an asset field -struct SAssetField -{ - // the condition for the current filter on the field - enum EAssetFilterCondition - { - eCondition_Any = 0, - // string conditions - // this also supports '*' and '?' as wildcards inside text - eCondition_Contains, - // this filter will search the target for at least one of the words specified - // ( ex: filter: "water car moon" , field value : "the_great_moon.dds", this will pass the test - // it also supports '*' and '?' as wildcards inside words text - eCondition_ContainsOneOfTheWords, - eCondition_StartsWith, - eCondition_EndsWith, - // string & numerical conditions - eCondition_Equal, - eCondition_Greater, - eCondition_Less, - eCondition_GreaterOrEqual, - eCondition_LessOrEqual, - eCondition_Not, - eCondition_InsideRange - }; - - // the asset field type - enum EAssetFieldType - { - eType_None = 0, - eType_Bool, - eType_Int8, - eType_Int16, - eType_Int32, - eType_Int64, - eType_Float, - eType_Double, - eType_String - }; - - // used when a field can have different specific values - typedef QStringList TFieldEnumValues; - - SAssetField( - const char* pFieldName = "", - const char* pDisplayName = "Unnamed field", - EAssetFieldType aFieldType = eType_None, - UINT aColumnWidth = 50, - bool bVisibleInUI = true, - bool bReadOnly = true) - { - m_fieldName = pFieldName; - m_displayName = pDisplayName; - m_fieldType = aFieldType; - m_filterCondition = eCondition_Equal; - m_bUseEnumValues = false; - m_bReadOnly = bReadOnly; - m_listColumnWidth = aColumnWidth; - m_bFieldVisibleInUI = bVisibleInUI; - m_bPostFilter = false; - - SetupEnumValues(); - } - - void SetupEnumValues() - { - m_bUseEnumValues = true; - - if (m_fieldType == eType_Bool) - { - m_enumValues.clear(); - m_enumValues.push_back("Yes"); - m_enumValues.push_back("No"); - } - } - - // the field's display name, used in UI - QString m_displayName, - // the field internal name, used in C++ code - m_fieldName, - // the current filter value, if its empty "" then no filter is applied - m_filterValue, - // the field's max value, valid when the field's filter condition is eAssertFilterCondition_InsideRange - m_maxFilterValue, - // the name of the database holding this field, used in Asset Browser preset editor, if its "" then the field - // is common to all current databases - m_parentDatabaseName; - // is this field visible in the UI ? - bool m_bFieldVisibleInUI, - // if true, then you cannot modify this field of an asset item, only use it - m_bReadOnly, - // this field filter is applied after the other filters - m_bPostFilter; - // the field data type - EAssetFieldType m_fieldType; - // the filter's condition - EAssetFilterCondition m_filterCondition; - // use the enum list values to choose a value for the field ? - bool m_bUseEnumValues; - // this map is used when asset field has m_bUseEnumValues on true, - // choose a value for the field from this list in the UI - TFieldEnumValues m_enumValues; - // recommended list column width - unsigned int m_listColumnWidth; -}; - -struct SFieldFiltersPreset -{ - QString presetName2; - QStringList checkedDatabaseNames; - bool bUsedInLevel; - std::vector fields; -}; - -// Description: -// This interface allows the programmer to extend asset display types -// visible in the asset browser. -struct IAssetItemDatabase - : public IUnknown -{ - DEFINE_UUID(0xFB09B039, 0x1D9D, 0x4057, 0xA5, 0xF0, 0xAA, 0x3C, 0x7B, 0x97, 0xAE, 0xA8) - - typedef std::vector TAssetFields; - typedef std::map < QString/*field name*/, SAssetField > TAssetFieldFiltersMap; - typedef std::map < QString/*asset filename*/, IAssetItem* > TFilenameAssetMap; - typedef AZStd::function MetaDataChangeListener; - - // Description: - // Refresh the database by scanning the folders/paks for files, does not load the files, only filename and filesize are fetched - virtual void Refresh() = 0; - // Description: - // Fills the asset meta data from the loaded xml meta data DB. - // Arguments: - // db - the database XML node from where to cache the info - virtual void PrecacheFieldsInfoFromFileDB(const XmlNodeRef& db) = 0; - // Description: - // Return all assets loaded/scanned by this database - // Return Value: - // The assets map reference (filename-asset) - virtual TFilenameAssetMap& GetAssets() = 0; - // Description: - // Get an asset item by its filename - // Return Value: - // A single asset from the database given the filename - virtual IAssetItem* GetAsset(const char* pAssetFilename) = 0; - // Description: - // Return the asset fields this database's items support - // Return Value: - // The asset fields vector reference - virtual TAssetFields& GetAssetFields() = 0; - // Description: - // Return an asset field object pointer by the field internal name - // Arguments: - // pFieldName - the internal field's name (ex: "filename", "relativepath") - // Return Value: - // The asset field object pointer - virtual SAssetField* GetAssetFieldByName(const char* pFieldName) = 0; - // Description: - // Get the database name - // Return Value: - // Returns the database name, ex: "Textures" - virtual const char* GetDatabaseName() const = 0; - // Description: - // Get the database supported file name extension(s) - // Return Value: - // Returns the supported extensions, separated by comma, ex: "tga,bmp,dds" - virtual const char* GetSupportedExtensions() const = 0; - // Description: - // Free the database internal data structures - virtual void FreeData() = 0; - // Description: - // Apply filters to this database which will set/unset the IAssetItem::eAssetFlag_Visible of each asset, based - // on the given field filters - // Arguments: - // rFieldFilters - a reference to the field filters map (fieldname-field) - // See Also: - // ClearFilters() - virtual void ApplyFilters(const TAssetFieldFiltersMap& rFieldFilters) = 0; - // Description: - // Clear the current filters, by setting the IAssetItem::eAssetFlag_Visible of each asset to true - // See Also: - // ApplyFilters() - virtual void ClearFilters() = 0; - virtual QWidget* CreateDbFilterDialog(QWidget* pParent, IAssetViewer* pViewerCtrl) = 0; - virtual void UpdateDbFilterDialogUI(QWidget* pDlg) = 0; - virtual void OnAssetBrowserOpen() = 0; - virtual void OnAssetBrowserClose() = 0; - // Description: - // Gets the filename for saving new cached asset info. - // Return Value: - // A file name to save new transactions to the persistent asset info DB - // See Also: - // CAssetInfoFileDB, IAssetItem::ToXML(), IAssetItem::FromXML() - virtual const char* GetTransactionFilename() const = 0; - // Description: - // Adds a callback to be called when the meta data of this asset changed. - // Arguments: - // callBack - A functor to be added - // Return Value: - // True if successful, false otherwise. - // See Also: - // RemoveMetaDataChangeListener() - virtual bool AddMetaDataChangeListener(MetaDataChangeListener callBack) = 0; - // Description: - // Removes a callback from the list of meta data change listeners. - // Arguments: - // callBack - A functor to be removed - // Return Value: - // True if successful, false otherwise. - // See Also: - // AddMetaDataCHangeListener() - virtual bool RemoveMetaDataChangeListener(MetaDataChangeListener callBack) = 0; - // Description: - // The method that should be called when the meta data of an asset item changes to notify all listeners - // Arguments: - // pAssetItem - An asset item whose meta data have changed - // See Also: - // AddMetaDataCHangeListener(), RemoveMetaDataChangeListener() - virtual void OnMetaDataChange(const IAssetItem* pAssetItem) = 0; - - //! from IUnknown - virtual HRESULT STDMETHODCALLTYPE QueryInterface([[maybe_unused]] REFIID riid, [[maybe_unused]] void** ppvObject) - { - return E_NOINTERFACE; - }; - virtual ULONG STDMETHODCALLTYPE AddRef() - { - return 0; - }; - virtual ULONG STDMETHODCALLTYPE Release() - { - return 0; - }; -}; -#endif // CRYINCLUDE_EDITOR_INCLUDE_IASSETITEMDATABASE_H diff --git a/Code/Editor/Include/IAssetViewer.h b/Code/Editor/Include/IAssetViewer.h deleted file mode 100644 index 488ee8e508..0000000000 --- a/Code/Editor/Include/IAssetViewer.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -// Description : This file declares a control which objective is to display -// multiple assets allowing selection and preview of such things -// It also handles scrolling and changes in the thumbnail display size - - -#ifndef CRYINCLUDE_EDITOR_INCLUDE_IASSETVIEWER_H -#define CRYINCLUDE_EDITOR_INCLUDE_IASSETVIEWER_H -#pragma once -#include "IObservable.h" -#include "IAssetItemDatabase.h" - -struct IAssetItem; -struct IAssetItemDatabase; - -// Description: -// Observer for the asset viewer events -struct IAssetViewerObserver -{ - virtual void OnChangeStatusBarInfo(UINT nSelectedItems, UINT nVisibleItems, UINT nTotalItems) {}; - virtual void OnSelectionChanged() {}; - virtual void OnChangedPreviewedAsset(IAssetItem* pAsset) {}; - virtual void OnAssetDblClick(IAssetItem* pAsset) {}; - virtual void OnAssetFilterChanged() {}; -}; - -// Description: -// The asset viewer interface for the asset database plugins to use -struct IAssetViewer -{ - DEFINE_OBSERVABLE_PURE_METHODS(IAssetViewerObserver); - - virtual HWND GetRenderWindow() = 0; - virtual void ApplyFilters(const IAssetItemDatabase::TAssetFieldFiltersMap& rFieldFilters) = 0; - virtual const IAssetItemDatabase::TAssetFieldFiltersMap& GetCurrentFilters() = 0; - virtual void ClearFilters() = 0; -}; -#endif // CRYINCLUDE_EDITOR_INCLUDE_IASSETVIEWER_H diff --git a/Code/Editor/Include/IFileUtil.h b/Code/Editor/Include/IFileUtil.h index 036a0bc5ee..ea2fe1f1a3 100644 --- a/Code/Editor/Include/IFileUtil.h +++ b/Code/Editor/Include/IFileUtil.h @@ -116,9 +116,6 @@ struct IFileUtil virtual bool ExtractFile(QString& file, bool bMsgBoxAskForExtraction = true, const char* pDestinationFilename = nullptr) = 0; virtual void EditTextureFile(const char* txtureFile, bool bUseGameFolder) = 0; - //! dcc filename calculation and extraction sub-routines - virtual bool CalculateDccFilename(const QString& assetFilename, QString& dccFilename) = 0; - //! Reformat filter string for (MFC) CFileDialog style file filtering virtual void FormatFilterString(QString& filter) = 0; diff --git a/Code/Editor/LightmapCompiler/SimpleTriangleRasterizer.cpp b/Code/Editor/LightmapCompiler/SimpleTriangleRasterizer.cpp deleted file mode 100644 index 736465cac1..0000000000 --- a/Code/Editor/LightmapCompiler/SimpleTriangleRasterizer.cpp +++ /dev/null @@ -1,506 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include "EditorDefs.h" - -#include "SimpleTriangleRasterizer.h" - -#include - -#if !defined FLT_MAX -#define FLT_MAX 3.402823466e+38F -#endif - -void CSimpleTriangleRasterizer::lambertHorizlineConservative(float fx1, float fx2, int yy, IRasterizeSink* inpSink) -{ - int x1 = (int)floorf(fx1 + 0.25f), x2 = (int)floorf(fx2 + .75f); - - if (x1 < m_iMinX) - { - x1 = m_iMinX; - } - if (x2 > m_iMaxX + 1) - { - x2 = m_iMaxX + 1; - } - if (x1 > m_iMaxX + 1) - { - x1 = m_iMaxX + 1; - } - if (x2 < m_iMinX) - { - x2 = m_iMinX; - } - - - inpSink->Line(fx1, fx2, x1, x2, yy); -} - -void CSimpleTriangleRasterizer::lambertHorizlineSubpixelCorrect(float fx1, float fx2, int yy, IRasterizeSink* inpSink) -{ - int x1 = (int)floorf(fx1 + 0.5f), x2 = (int)floorf(fx2 + 0.5f); - // int x1=(int)floorf(fx1*1023.f/1024.f+1.f),x2=(int)floorf(fx2*1023.f/1024.f+1.f); - - if (x1 < m_iMinX) - { - x1 = m_iMinX; - } - if (x2 > m_iMaxX) - { - x2 = m_iMaxX; - } - if (x1 > m_iMaxX) - { - x1 = m_iMaxX; - } - if (x2 < m_iMinX) - { - x2 = m_iMinX; - } - - inpSink->Line(fx1, fx2, x1, x2, yy); -} - -// optimizable -void CSimpleTriangleRasterizer::CopyAndSortY(const float infX[3], const float infY[3], float outfX[3], float outfY[3]) -{ - outfX[0] = infX[0]; - outfY[0] = infY[0]; - outfX[1] = infX[1]; - outfY[1] = infY[1]; - outfX[2] = infX[2]; - outfY[2] = infY[2]; - - // Sort the coordinates, so that (x[1], y[1]) becomes the highest coord - float tmp; - - if (outfY[0] > outfY[1]) - { - if (outfY[1] > outfY[2]) - { - tmp = outfY[0]; - outfY[0] = outfY[1]; - outfY[1] = tmp; - tmp = outfX[0]; - outfX[0] = outfX[1]; - outfX[1] = tmp; - tmp = outfY[1]; - outfY[1] = outfY[2]; - outfY[2] = tmp; - tmp = outfX[1]; - outfX[1] = outfX[2]; - outfX[2] = tmp; - - if (outfY[0] > outfY[1]) - { - tmp = outfY[0]; - outfY[0] = outfY[1]; - outfY[1] = tmp; - tmp = outfX[0]; - outfX[0] = outfX[1]; - outfX[1] = tmp; - } - } - else - { - tmp = outfY[0]; - outfY[0] = outfY[1]; - outfY[1] = tmp; - tmp = outfX[0]; - outfX[0] = outfX[1]; - outfX[1] = tmp; - - if (outfY[1] > outfY[2]) - { - tmp = outfY[1]; - outfY[1] = outfY[2]; - outfY[2] = tmp; - tmp = outfX[1]; - outfX[1] = outfX[2]; - outfX[2] = tmp; - } - } - } - else - { - if (outfY[1] > outfY[2]) - { - tmp = outfY[1]; - outfY[1] = outfY[2]; - outfY[2] = tmp; - tmp = outfX[1]; - outfX[1] = outfX[2]; - outfX[2] = tmp; - - if (outfY[0] > outfY[1]) - { - tmp = outfY[0]; - outfY[0] = outfY[1]; - outfY[1] = tmp; - tmp = outfX[0]; - outfX[0] = outfX[1]; - outfX[1] = tmp; - } - } - } -} - -void CSimpleTriangleRasterizer::CallbackFillRectConservative(float _x[3], float _y[3], IRasterizeSink* inpSink) -{ - inpSink->Triangle(m_iMinY); - - float fMinX = (std::min)(_x[0], (std::min)(_x[1], _x[2])); - float fMaxX = (std::max)(_x[0], (std::max)(_x[1], _x[2])); - float fMinY = (std::min)(_y[0], (std::min)(_y[1], _y[2])); - float fMaxY = (std::max)(_y[0], (std::max)(_y[1], _y[2])); - - int iMinX = (std::max)(m_iMinX, (int)floorf(fMinX)); - int iMaxX = (std::min)(m_iMaxX + 1, (int)ceilf(fMaxX)); - int iMinY = (std::max)(m_iMinY, (int)floorf(fMinY)); - int iMaxY = (std::min)(m_iMaxY + 1, (int)ceilf(fMaxY)); - - for (int y = iMinY; y < iMaxY; y++) - { - inpSink->Line(fMinX, fMaxX, iMinX, iMaxX, y); - } -} - - - - -void CSimpleTriangleRasterizer::CallbackFillConservative(float _x[3], float _y[3], IRasterizeSink* inpSink) -{ - float x[3], y[3]; - - CopyAndSortY(_x, _y, x, y); - - // Calculate interpolation steps - float fX1toX2step = 0.0f; - float fX1toX3step = 0.0f; - float fX2toX3step = 0.0f; - if (fabsf(y[1] - y[0]) > FLT_EPSILON) - { - fX1toX2step = (x[1] - x[0]) / (float)(y[1] - y[0]); - } - if (fabsf(y[2] - y[0]) > FLT_EPSILON) - { - fX1toX3step = (x[2] - x[0]) / (float)(y[2] - y[0]); - } - if (fabsf(y[2] - y[1]) > FLT_EPSILON) - { - fX2toX3step = (x[2] - x[1]) / (float)(y[2] - y[1]); - } - - float fX1toX2 = x[0], fX1toX3 = x[0], fX2toX3 = x[1]; - bool bFirstLine = true; - bool bTriangleCallDone = false; - - // Go through the scanlines of the triangle - int yy = (int)floorf(y[0]); // was floor - - for (; yy <= (int)floorf(y[2]); yy++) - // for(yy=m_iMinY; yy<=m_iMaxY; yy++) // juhu - { - float fSubPixelYStart = 0.0f, fSubPixelYEnd = 1.0f; - float start, end; - - // first line - if (bFirstLine) - { - fSubPixelYStart = y[0] - floorf(y[0]); - start = x[0]; - end = x[0]; - bFirstLine = false; - } - else - { - // top part without middle corner line - if (yy <= (int)floorf(y[1])) - { - start = (std::min)(fX1toX2, fX1toX3); - end = (std::max)(fX1toX2, fX1toX3); - } - else - { - start = (std::min)(fX2toX3, fX1toX3); - end = (std::max)(fX2toX3, fX1toX3); - } - } - - // middle corner line - if (yy == (int)floorf(y[1])) - { - fSubPixelYEnd = y[1] - floorf(y[1]); - - fX1toX3 += fX1toX3step * (fSubPixelYEnd - fSubPixelYStart); - start = (std::min)(start, fX1toX3); - end = (std::max)(end, fX1toX3); - start = (std::min)(start, x[1]); - end = (std::max)(end, x[1]); - - fSubPixelYStart = fSubPixelYEnd; - fSubPixelYEnd = 1.0f; - } - - // last line - if (yy == (int)floorf(y[2])) - { - start = (std::min)(start, x[2]); - end = (std::max)(end, x[2]); - } - else - { - // top part without middle corner line - if (yy < (int)floorf(y[1])) - { - fX1toX2 += fX1toX2step * (fSubPixelYEnd - fSubPixelYStart); - start = (std::min)(start, fX1toX2); - end = (std::max)(end, fX1toX2); - } - else - { - fX2toX3 += fX2toX3step * (fSubPixelYEnd - fSubPixelYStart); - start = (std::min)(start, fX2toX3); - end = (std::max)(end, fX2toX3); - } - - fX1toX3 += fX1toX3step * (fSubPixelYEnd - fSubPixelYStart); - start = (std::min)(start, fX1toX3); - end = (std::max)(end, fX1toX3); - } - - if (yy >= m_iMinY && yy <= m_iMaxY) - { - if (!bTriangleCallDone) - { - inpSink->Triangle(yy); - bTriangleCallDone = true; - } - - lambertHorizlineConservative(start, end, yy, inpSink); - } - } -} - - - -void CSimpleTriangleRasterizer::CallbackFillSubpixelCorrect(float _x[3], float _y[3], IRasterizeSink* inpSink) -{ - float x[3], y[3]; - - CopyAndSortY(_x, _y, x, y); - - if (fabs(y[0] - floorf(y[0])) < FLT_EPSILON) - { - y[0] -= FLT_EPSILON; - } - - // Calculate interpolation steps - float fX1toX2step = 0.0f; - float fX1toX3step = 0.0f; - float fX2toX3step = 0.0f; - if (fabsf(y[1] - y[0]) > FLT_EPSILON) - { - fX1toX2step = (x[1] - x[0]) / (y[1] - y[0]); - } - if (fabsf(y[2] - y[0]) > FLT_EPSILON) - { - fX1toX3step = (x[2] - x[0]) / (y[2] - y[0]); - } - if (fabsf(y[2] - y[1]) > FLT_EPSILON) - { - fX2toX3step = (x[2] - x[1]) / (y[2] - y[1]); - } - - float fX1toX2 = x[0], fX1toX3 = x[0], fX2toX3 = x[1]; - bool bFirstLine = true; - bool bTriangleCallDone = false; - - y[0] -= 0.5f; - y[1] -= 0.5f; - y[2] -= 0.5f; - // y[0]=y[0]*1023.f/1024.f+1.f; - // y[1]=y[1]*1023.f/1024.f+1.f; - // y[2]=y[2]*1023.f/1024.f+1.f; - - for (int yy = (int)floorf(y[0]); yy <= (int)floorf(y[2]); yy++) - { - float fSubPixelYStart = 0.0f, fSubPixelYEnd = 1.0f; - float start, end; - - // first line - if (bFirstLine) - { - fSubPixelYStart = y[0] - floorf(y[0]); - start = x[0]; - end = x[0]; - bFirstLine = false; - } - else - { - // top part without middle corner line - if (yy <= (int)floorf(y[1])) - { - start = (std::min)(fX1toX2, fX1toX3); - end = (std::max)(fX1toX2, fX1toX3); - } - else - { - start = (std::min)(fX2toX3, fX1toX3); - end = (std::max)(fX2toX3, fX1toX3); - } - } - - // middle corner line - if (yy == (int)floorf(y[1])) - { - fSubPixelYEnd = y[1] - floorf(y[1]); - - fX1toX3 += fX1toX3step * (fSubPixelYEnd - fSubPixelYStart); - - fSubPixelYStart = fSubPixelYEnd; - fSubPixelYEnd = 1.0f; - } - - // last line - if (yy != (int)floorf(y[2])) - { - // top part without middle corner line - if (yy < (int)floorf(y[1])) - { - fX1toX2 += fX1toX2step * (fSubPixelYEnd - fSubPixelYStart); - } - else - { - fX2toX3 += fX2toX3step * (fSubPixelYEnd - fSubPixelYStart); - } - - fX1toX3 += fX1toX3step * (fSubPixelYEnd - fSubPixelYStart); - } - - if (start != end) - { - if (yy >= m_iMinY && yy <= m_iMaxY) - { - if (!bTriangleCallDone) - { - inpSink->Triangle(yy); - bTriangleCallDone = true; - } - - lambertHorizlineSubpixelCorrect(start, end, yy, inpSink); - } - } - } -} - - - - -// shrink triangle by n pixel, optimizable -void CSimpleTriangleRasterizer::ShrinkTriangle(float inoutfX[3], float inoutfY[3], float infAmount) -{ - float fX[3] = { inoutfX[0], inoutfX[1], inoutfX[2] }; - float fY[3] = { inoutfY[0], inoutfY[1], inoutfY[2] }; - - /* - // move edge to opposing vertex - float dx,dy,fLength; - - for(int a=0;a<3;a++) - { - int b=a+1;if(b>=3)b=0; - int c=b+1;if(c>=3)c=0; - - dx=fX[a]-(fX[b]+fX[c])*0.5f; - dy=fY[a]-(fY[b]+fY[c])*0.5f; - fLength=(float)sqrt(dx*dx+dy*dy); - if(fLength>1.0f) - { - dx/=fLength;dy/=fLength; - inoutfX[b]+=dx;inoutfY[b]+=dy; - inoutfX[c]+=dx;inoutfY[c]+=dy; - } - } - */ - - /* - // move vertex to opposing edge - float dx,dy,fLength; - - for(int a=0;a<3;a++) - { - int b=a+1;if(b>=3)b=0; - int c=b+1;if(c>=3)c=0; - - dx=fX[a]-(fX[b]+fX[c])*0.5f; - dy=fY[a]-(fY[b]+fY[c])*0.5f; - fLength=(float)sqrt(dx*dx+dy*dy); - if(fLength>1.0f) - { - dx/=fLength;dy/=fLength; - inoutfX[a]-=dx;inoutfY[a]-=dy; - } - } - */ - - // move vertex to get edges shifted perpendicular for 1 unit - for (int a = 0; a < 3; a++) - { - float dx1, dy1, dx2, dy2, fLength; - - int b = a + 1; - if (b >= 3) - { - b = 0; - } - int c = b + 1; - if (c >= 3) - { - c = 0; - } - - dx1 = fX[b] - fX[a]; - dy1 = fY[b] - fY[a]; - fLength = (float)sqrt(dx1 * dx1 + dy1 * dy1); - if (infAmount > 0) - { - if (fLength < infAmount) - { - continue; - } - } - if (fLength == 0.0f) - { - continue; - } - dx1 /= fLength; - dy1 /= fLength; - - dx2 = fX[c] - fX[a]; - dy2 = fY[c] - fY[a]; - fLength = (float)sqrt(dx2 * dx2 + dy2 * dy2); - if (infAmount > 0) - { - if (fLength < infAmount) - { - continue; - } - } - if (fLength == 0.0f) - { - continue; - } - dx2 /= fLength; - dy2 /= fLength; - - inoutfX[a] += (dx1 + dx2) * infAmount; - inoutfY[a] += (dy1 + dy2) * infAmount; - } -} diff --git a/Code/Editor/LightmapCompiler/SimpleTriangleRasterizer.h b/Code/Editor/LightmapCompiler/SimpleTriangleRasterizer.h deleted file mode 100644 index bcfdd7b6da..0000000000 --- a/Code/Editor/LightmapCompiler/SimpleTriangleRasterizer.h +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_LIGHTMAPCOMPILER_SIMPLETRIANGLERASTERIZER_H -#define CRYINCLUDE_EDITOR_LIGHTMAPCOMPILER_SIMPLETRIANGLERASTERIZER_H -#pragma once - -class CSimpleTriangleRasterizer -{ -public: - - class IRasterizeSink - { - public: - - //! is called once per triangel for the first possible visible line - //! /param iniStartY - virtual void Triangle([[maybe_unused]] const int iniStartY) - { - } - - //! callback function - //! /param infXLeft included - not clipped against left and reight border - //! /param infXRight excluded - not clipped against left and reight border - //! /param iniXLeft included - //! /param iniXRight excluded - //! /param iniY - virtual void Line(const float infXLeft, const float infXRight, - const int iniXLeft, const int iniXRight, const int iniY) = 0; - }; - - typedef unsigned long DWORD; - - // ----------------------------------------------------- - - //! implementation sink sample - class CDWORDFlatFill - : public IRasterizeSink - { - public: - - //! constructor - CDWORDFlatFill(DWORD* inpBuffer, const DWORD indwPitchInPixels, DWORD indwValue) - { - m_dwValue = indwValue; - m_pBuffer = inpBuffer; - m_dwPitchInPixels = indwPitchInPixels; - } - - virtual void Triangle(const int iniY) - { - m_pBufferLine = &m_pBuffer[iniY * m_dwPitchInPixels]; - } - - virtual void Line([[maybe_unused]] const float infXLeft, [[maybe_unused]] const float infXRight, - const int iniLeft, const int iniRight, [[maybe_unused]] const int iniY) - { - DWORD* mem = &m_pBufferLine[iniLeft]; - - for (int x = iniLeft; x < iniRight; x++) - { - *mem++ = m_dwValue; - } - - m_pBufferLine += m_dwPitchInPixels; - } - - private: - DWORD m_dwValue; //!< fill value - DWORD* m_pBufferLine; //!< to get rid of the multiplication per line - - DWORD m_dwPitchInPixels; //!< in DWORDS, not in Bytes - DWORD* m_pBuffer; //!< pointer to the buffer - }; - - // ----------------------------------------------------- - - //! constructor - //! /param iniWidth excluded - //! /param iniHeight excluded - CSimpleTriangleRasterizer(const int iniWidth, const int iniHeight) - { - m_iMinX = 0; - m_iMinY = 0; - m_iMaxX = iniWidth - 1; - m_iMaxY = iniHeight - 1; - } - /* - //! constructor - //! /param iniMinX included - //! /param iniMinY included - //! /param iniMaxX included - //! /param iniMaxY included - CSimpleTriangleRasterizer( const int iniMinX, const int iniMinY, const int iniMaxX, const int iniMaxY ) - { - m_iMinX=iniMinX; - m_iMinY=iniMinY; - m_iMaxX=iniMaxX; - m_iMaxY=iniMaxY; - } - */ - //! simple triangle filler with clipping (optimizable), not subpixel correct - //! /param pBuffer pointer o the color buffer - //! /param indwWidth width of the color buffer - //! /param indwHeight height of the color buffer - //! /param x array of the x coordiantes of the three vertices - //! /param y array of the x coordiantes of the three vertices - //! /param indwValue value of the triangle - void DWORDFlatFill(DWORD* inpBuffer, const DWORD indwPitchInPixels, float x[3], float y[3], DWORD indwValue, bool inbConservative) - { - CDWORDFlatFill pix(inpBuffer, indwPitchInPixels, indwValue); - - if (inbConservative) - { - CallbackFillConservative(x, y, &pix); - } - else - { - CallbackFillSubpixelCorrect(x, y, &pix); - } - } - - // Rectangle around triangle - more stable - use for debugging purpose - void CallbackFillRectConservative(float x[3], float y[3], IRasterizeSink * inpSink); - - - //! subpixel correct triangle filler (conservative or not conservative) - //! \param pBuffer pointe to the DWORD - //! \param indwWidth width of the buffer pBuffer pointes to - //! \param indwHeight height of the buffer pBuffer pointes to - //! \param x array of the x coordiantes of the three vertices - //! \param y array of the x coordiantes of the three vertices - //! \param inpSink pointer to the sink interface (is called per triangle and per triangle line) - void CallbackFillConservative(float x[3], float y[3], IRasterizeSink * inpSink); - - //! subpixel correct triangle filler (conservative or not conservative) - //! \param pBuffer pointe to the DWORD - //! \param indwWidth width of the buffer pBuffer pointes to - //! \param indwHeight height of the buffer pBuffer pointes to - //! \param x array of the x coordiantes of the three vertices - //! \param y array of the x coordiantes of the three vertices - //! \param inpSink pointer to the sink interface (is called per triangle and per triangle line) - void CallbackFillSubpixelCorrect(float x[3], float y[3], IRasterizeSink * inpSink); - - //! - //! /param inoutfX - //! /param inoutfY - //! /param infAmount could be positive or negative - static void ShrinkTriangle(float inoutfX[3], float inoutfY[3], float infAmount); - -private: - - // Clipping Rect; - - int m_iMinX; //!< minimum x value included - int m_iMinY; //!< minimum y value included - int m_iMaxX; //!< maximum x value included - int m_iMaxY; //!< maximum x value included - - void lambertHorizlineConservative(float fx1, float fx2, int y, IRasterizeSink* inpSink); - void lambertHorizlineSubpixelCorrect(float fx1, float fx2, int y, IRasterizeSink* inpSink); - void CopyAndSortY(const float infX[3], const float infY[3], float outfX[3], float outfY[3]); -}; - - -// extension ideas: -// * callback with coverage mask (possible non ordered sampling) -// * z-buffer behaviour -// * gouraud shading -// * texture mapping with nearest/bicubic/bilinear filter -// * further primitives: thick line, ellipse -// * build a template version -// * - -#endif // CRYINCLUDE_EDITOR_LIGHTMAPCOMPILER_SIMPLETRIANGLERASTERIZER_H diff --git a/Code/Editor/Objects/ObjectManager.cpp b/Code/Editor/Objects/ObjectManager.cpp index 1dea6ece7f..06233d4dd2 100644 --- a/Code/Editor/Objects/ObjectManager.cpp +++ b/Code/Editor/Objects/ObjectManager.cpp @@ -26,7 +26,6 @@ #include "Util/Image.h" #include "ObjectManagerLegacyUndo.h" #include "Include/HitContext.h" -#include "EditMode/DeepSelection.h" #include "Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.h" #include diff --git a/Code/Editor/Util/FileUtil.cpp b/Code/Editor/Util/FileUtil.cpp index 182a122ea8..ce2d399dcc 100644 --- a/Code/Editor/Util/FileUtil.cpp +++ b/Code/Editor/Util/FileUtil.cpp @@ -42,8 +42,6 @@ #include "CheckOutDialog.h" #include "ISourceControl.h" #include "Dialogs/Generic/UserOptions.h" -#include "IAssetItem.h" -#include "IAssetItemDatabase.h" #include "Include/IObjectManager.h" #include "UsedResources.h" #include "Objects/BaseObject.h" @@ -223,106 +221,6 @@ void CFileUtil::EditTextureFile(const char* textureFile, [[maybe_unused]] bool b } } - -////////////////////////////////////////////////////////////////////////// -bool CFileUtil::CalculateDccFilename(const QString& assetFilename, QString& dccFilename) -{ - if (ExtractDccFilenameFromAssetDatabase(assetFilename, dccFilename)) - { - return true; - } - - if (ExtractDccFilenameUsingNamingConventions(assetFilename, dccFilename)) - { - return true; - } - - GetIEditor()->GetEnv()->pLog->LogError("Failed to find psd file for texture: '%s'", assetFilename.toUtf8().data()); - return false; -} - -////////////////////////////////////////////////////////////////////////// -bool CFileUtil::ExtractDccFilenameFromAssetDatabase(const QString& assetFilename, QString& dccFilename) -{ - IAssetItemDatabase* pCurrentDatabaseInterface = nullptr; - std::vector assetDatabasePlugins; - IEditorClassFactory* pClassFactory = GetIEditor()->GetClassFactory(); - pClassFactory->GetClassesByCategory("Asset Item DB", assetDatabasePlugins); - - for (size_t i = 0; i < assetDatabasePlugins.size(); ++i) - { - if (assetDatabasePlugins[i]->QueryInterface(__az_uuidof(IAssetItemDatabase), (void**)&pCurrentDatabaseInterface) == S_OK) - { - if (!pCurrentDatabaseInterface) - { - continue; - } - - QString assetDatabaseDccFilename; - IAssetItem* pAssetItem = pCurrentDatabaseInterface->GetAsset(assetFilename.toUtf8().data()); - if (pAssetItem) - { - if ((pAssetItem->GetFlags() & IAssetItem::eFlag_Cached)) - { - QVariant v = pAssetItem->GetAssetFieldValue("dccfilename"); - assetDatabaseDccFilename = v.toString(); - if (!v.isNull()) - { - dccFilename = assetDatabaseDccFilename; - dccFilename = Path::GetRelativePath(dccFilename, false); - - uint32 attr = CFileUtil::GetAttributes(dccFilename.toUtf8().data()); - - if (CFileUtil::FileExists(dccFilename)) - { - return true; - } - else if (GetIEditor()->IsSourceControlAvailable() && (attr & SCC_FILE_ATTRIBUTE_MANAGED)) - { - return CFileUtil::GetLatestFromSourceControl(dccFilename.toUtf8().data()); - } - } - } - } - } - } - return false; -} - -////////////////////////////////////////////////////////////////////////// -bool CFileUtil::ExtractDccFilenameUsingNamingConventions(const QString& assetFilename, QString& dccFilename) -{ - //else to try find it by naming conventions - QString tempStr = assetFilename; - int foundSplit = -1; - if ((foundSplit = tempStr.lastIndexOf('.')) > 0) - { - QString first = tempStr.mid(0, foundSplit); - tempStr = first + ".psd"; - } - if (CFileUtil::FileExists(tempStr)) - { - dccFilename = tempStr; - return true; - } - - //else try to find it by replacing post fix _ with .psd - tempStr = assetFilename; - foundSplit = -1; - if ((foundSplit = tempStr.lastIndexOf('_')) > 0) - { - QString first = tempStr.mid(0, foundSplit); - tempStr = first + ".psd"; - } - if (CFileUtil::FileExists(tempStr)) - { - dccFilename = tempStr; - return true; - } - - return false; -} - ////////////////////////////////////////////////////////////////////////// void CFileUtil::FormatFilterString(QString& filter) { diff --git a/Code/Editor/Util/FileUtil.h b/Code/Editor/Util/FileUtil.h index fc0fc942fe..a4ff5009a2 100644 --- a/Code/Editor/Util/FileUtil.h +++ b/Code/Editor/Util/FileUtil.h @@ -29,9 +29,6 @@ public: static void EditTextFile(const char* txtFile, int line = 0, IFileUtil::ETextFileType fileType = IFileUtil::FILE_TYPE_SCRIPT); static void EditTextureFile(const char* txtureFile, bool bUseGameFolder); - //! dcc filename calculation and extraction sub-routines - static bool CalculateDccFilename(const QString& assetFilename, QString& dccFilename); - //! Reformat filter string for (MFC) CFileDialog style file filtering static void FormatFilterString(QString& filter); @@ -155,9 +152,6 @@ private: // Keep this variant of this method private! pIsSelected is captured in a lambda, and so requires menu use exec() and never use show() static void PopulateQMenu(QWidget* caller, QMenu* menu, AZStd::string_view fullGamePath, bool* pIsSelected); - - static bool ExtractDccFilenameFromAssetDatabase(const QString& assetFilename, QString& dccFilename); - static bool ExtractDccFilenameUsingNamingConventions(const QString& assetFilename, QString& dccFilename); }; class CAutoRestorePrimaryCDRoot diff --git a/Code/Editor/Util/FileUtil_impl.cpp b/Code/Editor/Util/FileUtil_impl.cpp index 28090d28d5..31e3532f33 100644 --- a/Code/Editor/Util/FileUtil_impl.cpp +++ b/Code/Editor/Util/FileUtil_impl.cpp @@ -30,11 +30,6 @@ void CFileUtil_impl::EditTextureFile(const char* txtureFile, bool bUseGameFolder CFileUtil::EditTextureFile(txtureFile, bUseGameFolder); } -bool CFileUtil_impl::CalculateDccFilename(const QString& assetFilename, QString& dccFilename) -{ - return CFileUtil::CalculateDccFilename(assetFilename, dccFilename); -} - void CFileUtil_impl::FormatFilterString(QString& filter) { CFileUtil::FormatFilterString(filter); diff --git a/Code/Editor/Util/FileUtil_impl.h b/Code/Editor/Util/FileUtil_impl.h index aa8d0bf3b5..3c8e138dab 100644 --- a/Code/Editor/Util/FileUtil_impl.h +++ b/Code/Editor/Util/FileUtil_impl.h @@ -39,9 +39,6 @@ public: bool ExtractFile(QString& file, bool bMsgBoxAskForExtraction = true, const char* pDestinationFilename = nullptr) override; void EditTextureFile(const char* txtureFile, bool bUseGameFolder) override; - //! dcc filename calculation and extraction sub-routines - bool CalculateDccFilename(const QString& assetFilename, QString& dccFilename) override; - //! Reformat filter string for (MFC) CFileDialog style file filtering void FormatFilterString(QString& filter) override; diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index a018333925..c81a326aff 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -269,9 +269,6 @@ set(FILES LevelTreeModel.h Include/Command.h Include/HitContext.h - Include/IAnimationCompressionManager.h - Include/IAssetItem.h - Include/IAssetItemDatabase.h Include/ICommandManager.h Include/IConsoleConnectivity.h Include/IDataBaseItem.h @@ -457,18 +454,14 @@ set(FILES GameResourcesExporter.cpp GameExporter.h GameResourcesExporter.h - Geometry/TriMesh.cpp - Geometry/TriMesh.h AboutDialog.h AboutDialog.ui DocMultiArchive.h - EditMode/DeepSelection.h FBXExporterDialog.h FileTypeUtils.h GridUtils.h IObservable.h IPostRenderer.h - LightmapCompiler/SimpleTriangleRasterizer.h ToolBox.h TrackViewNewSequenceDialog.h UndoConfigSpec.h @@ -559,11 +552,9 @@ set(FILES AboutDialog.cpp ErrorReportTableModel.h ErrorReportTableModel.cpp - EditMode/DeepSelection.cpp FBXExporterDialog.cpp FBXExporterDialog.ui FileTypeUtils.cpp - LightmapCompiler/SimpleTriangleRasterizer.cpp ToolBox.cpp TrackViewNewSequenceDialog.cpp TrackViewNewSequenceDialog.ui From f71efa8b9bde2b48e04f8e88e57db45cceca4d27 Mon Sep 17 00:00:00 2001 From: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> Date: Wed, 5 Jan 2022 14:16:35 -0600 Subject: [PATCH 324/948] Updating KillAllLyProcesses tests to expect o3de.exe process Signed-off-by: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> --- Tools/LyTestTools/tests/unit/test_editor_test_utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Tools/LyTestTools/tests/unit/test_editor_test_utils.py b/Tools/LyTestTools/tests/unit/test_editor_test_utils.py index cd361d9e8a..849fa5c391 100644 --- a/Tools/LyTestTools/tests/unit/test_editor_test_utils.py +++ b/Tools/LyTestTools/tests/unit/test_editor_test_utils.py @@ -17,14 +17,15 @@ class TestEditorTestUtils(unittest.TestCase): @mock.patch('ly_test_tools.environment.process_utils.kill_processes_named') def test_KillAllLyProcesses_IncludeAP_CallsCorrectly(self, mock_kill_processes_named): - process_list = ['Editor', 'Profiler', 'RemoteConsole', 'AssetProcessor', 'AssetProcessorBatch', 'AssetBuilder'] + process_list = ['Editor', 'Profiler', 'RemoteConsole', 'o3de', 'AssetProcessor', 'AssetProcessorBatch', + 'AssetBuilder'] editor_test_utils.kill_all_ly_processes(include_asset_processor=True) mock_kill_processes_named.assert_called_once_with(process_list, ignore_extensions=True) @mock.patch('ly_test_tools.environment.process_utils.kill_processes_named') def test_KillAllLyProcesses_NotIncludeAP_CallsCorrectly(self, mock_kill_processes_named): - process_list = ['Editor', 'Profiler', 'RemoteConsole'] + process_list = ['Editor', 'Profiler', 'RemoteConsole', 'o3de'] ap_process_list = ['AssetProcessor', 'AssetProcessorBatch', 'AssetBuilder'] editor_test_utils.kill_all_ly_processes(include_asset_processor=False) From 9c85cd19a77fde4da716ad7a97ccd4f92ed0f5dc Mon Sep 17 00:00:00 2001 From: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> Date: Wed, 5 Jan 2022 14:17:01 -0600 Subject: [PATCH 325/948] Skipping Docking test due to unknown Jenkins failure Signed-off-by: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> --- .../Gem/PythonTests/editor/TestSuite_Main_Optimized.py | 1 + 1 file changed, 1 insertion(+) diff --git a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main_Optimized.py b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main_Optimized.py index 058c309652..7e07d125fd 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main_Optimized.py +++ b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main_Optimized.py @@ -66,6 +66,7 @@ class TestAutomationAutoTestMode(EditorTestSuite): class test_ComponentCRUD_Add_Delete_Components(EditorSharedTest): from .EditorScripts import ComponentCRUD_Add_Delete_Components as test_module + @pytest.mark.skip("Passes locally, fails on Jenkins") class test_Docking_BasicDockedTools(EditorSharedTest): from .EditorScripts import Docking_BasicDockedTools as test_module From 55fb63da48bae2efeb76478480b09e0e1b8d70e3 Mon Sep 17 00:00:00 2001 From: Roman <69218254+amzn-rhhong@users.noreply.github.com> Date: Wed, 5 Jan 2022 12:54:41 -0800 Subject: [PATCH 326/948] Debug render aabb now include node, mesh and static aabb. (#6685) Signed-off-by: rhhong --- .../Code/Source/AtomActorDebugDraw.cpp | 46 +++++++++++++++++-- .../Code/Source/AtomActorDebugDraw.h | 8 +++- .../Source/RenderPlugin/RenderOptions.cpp | 2 + .../Rendering/RenderActorSettings.h | 9 +++- 4 files changed, 59 insertions(+), 6 deletions(-) diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorDebugDraw.cpp b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorDebugDraw.cpp index 421e5828b1..21f9f69f7c 100644 --- a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorDebugDraw.cpp +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorDebugDraw.cpp @@ -63,7 +63,10 @@ namespace AZ::Render // Render aabb if (renderFlags[EMotionFX::ActorRenderFlag::RENDER_AABB]) { - RenderAABB(instance, renderActorSettings.m_staticAABBColor); + RenderAABB(instance, + renderActorSettings.m_enabledNodeBasedAabb, renderActorSettings.m_nodeAABBColor, + renderActorSettings.m_enabledMeshBasedAabb, renderActorSettings.m_meshAABBColor, + renderActorSettings.m_enabledStaticBasedAabb, renderActorSettings.m_staticAABBColor); } // Render simple line skeleton @@ -201,11 +204,46 @@ namespace AZ::Render return AzFramework::DebugDisplayRequestBus::FindFirstHandler(debugDisplayBus); } - void AtomActorDebugDraw::RenderAABB(EMotionFX::ActorInstance* instance, const AZ::Color& aabbColor) + void AtomActorDebugDraw::RenderAABB(EMotionFX::ActorInstance* instance, + bool enableNodeAabb, + const AZ::Color& nodeAabbColor, + bool enableMeshAabb, + const AZ::Color& meshAabbColor, + bool enableStaticAabb, + const AZ::Color& staticAabbColor) { RPI::AuxGeomDrawPtr auxGeom = m_auxGeomFeatureProcessor->GetDrawQueue(); - const AZ::Aabb& aabb = instance->GetAabb(); - auxGeom->DrawAabb(aabb, aabbColor, RPI::AuxGeomDraw::DrawStyle::Line); + + if (enableNodeAabb) + { + AZ::Aabb aabb; + instance->CalcNodeBasedAabb(&aabb); + if (aabb.IsValid()) + { + auxGeom->DrawAabb(aabb, nodeAabbColor, RPI::AuxGeomDraw::DrawStyle::Line); + } + } + + if (enableMeshAabb) + { + AZ::Aabb aabb; + const size_t lodLevel = instance->GetLODLevel(); + instance->CalcMeshBasedAabb(lodLevel, &aabb); + if (aabb.IsValid()) + { + auxGeom->DrawAabb(aabb, meshAabbColor, RPI::AuxGeomDraw::DrawStyle::Line); + } + } + + if (enableStaticAabb) + { + AZ::Aabb aabb; + instance->CalcStaticBasedAabb(&aabb); + if (aabb.IsValid()) + { + auxGeom->DrawAabb(aabb, staticAabbColor, RPI::AuxGeomDraw::DrawStyle::Line); + } + } } void AtomActorDebugDraw::RenderLineSkeleton(EMotionFX::ActorInstance* instance, const AZ::Color& skeletonColor) diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorDebugDraw.h b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorDebugDraw.h index 3c0258cfef..8e985fdbc6 100644 --- a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorDebugDraw.h +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorDebugDraw.h @@ -49,7 +49,13 @@ namespace AZ::Render void PrepareForMesh(EMotionFX::Mesh* mesh, const AZ::Transform& worldTM); AzFramework::DebugDisplayRequests* GetDebugDisplay(AzFramework::ViewportId viewportId); - void RenderAABB(EMotionFX::ActorInstance* instance, const AZ::Color& aabbColor); + void RenderAABB(EMotionFX::ActorInstance* instance, + bool enableNodeAabb, + const AZ::Color& nodeAabbColor, + bool enableMeshAabb, + const AZ::Color& meshAabbColor, + bool enableStaticAabb, + const AZ::Color& staticAabbColor); void RenderLineSkeleton(EMotionFX::ActorInstance* instance, const AZ::Color& skeletonColor); void RenderSkeleton(EMotionFX::ActorInstance* instance, const AZ::Color& skeletonColor); void RenderEMFXDebugDraw(EMotionFX::ActorInstance* instance); diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderOptions.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderOptions.cpp index 241412c6c8..cc344db488 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderOptions.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderOptions.cpp @@ -1071,6 +1071,8 @@ namespace EMStudio settings.m_mirroredBitangentsColor = m_mirroredBitangentsColor; settings.m_bitangentsColor = m_bitangentsColor; settings.m_wireframeColor = m_wireframeColor; + settings.m_nodeAABBColor = m_nodeAABBColor; + settings.m_meshAABBColor = m_meshAABBColor; settings.m_staticAABBColor = m_staticAABBColor; settings.m_skeletonColor = m_skeletonColor; settings.m_lineSkeletonColor = m_lineSkeletonColor; diff --git a/Gems/EMotionFX/Code/Source/Integration/Rendering/RenderActorSettings.h b/Gems/EMotionFX/Code/Source/Integration/Rendering/RenderActorSettings.h index 0260d1aae5..8663b768c8 100644 --- a/Gems/EMotionFX/Code/Source/Integration/Rendering/RenderActorSettings.h +++ b/Gems/EMotionFX/Code/Source/Integration/Rendering/RenderActorSettings.h @@ -28,6 +28,10 @@ namespace AZ::Render float m_wireframeScale = 1.0f; float m_nodeOrientationScale = 1.0f; + bool m_enabledNodeBasedAabb = true; + bool m_enabledMeshBasedAabb = true; + bool m_enabledStaticBasedAabb = true; + AZ::Color m_hitDetectionColliderColor{0.44f, 0.44f, 0.44f, 1.0f}; AZ::Color m_selectedHitDetectionColliderColor{ 0.3f, 0.56f, 0.88f, 1.0f }; AZ::Color m_ragdollColliderColor{ 0.44f, 0.44f, 0.44f, 1.0f }; @@ -44,9 +48,12 @@ namespace AZ::Render AZ::Color m_mirroredBitangentsColor{ 1.0f, 1.0f, 0.0f, 1.0f }; AZ::Color m_bitangentsColor{ 1.0f, 1.0f, 1.0f, 1.0f }; AZ::Color m_wireframeColor{ 0.0f, 0.0f, 0.0f, 1.0f }; - AZ::Color m_staticAABBColor{ 0.0f, 0.7f, 0.7f, 1.0f }; AZ::Color m_lineSkeletonColor{ 0.33333f, 1.0f, 0.0f, 1.0f }; AZ::Color m_skeletonColor{ 0.19f, 0.58f, 0.19f, 1.0f }; AZ::Color m_jointNameColor{ 1.0f, 1.0f, 1.0f, 1.0f }; + + AZ::Color m_nodeAABBColor{ 1.0f, 0.0f, 0.0f, 1.0f }; + AZ::Color m_meshAABBColor{ 0.0f, 0.0f, 0.7f, 1.0f }; + AZ::Color m_staticAABBColor{ 0.0f, 0.7f, 0.7f, 1.0f }; }; } // namespace AZ::Render From d347a9d2c034dea3878ce357060b7e040bee6885 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Wed, 5 Jan 2022 12:56:22 -0800 Subject: [PATCH 327/948] Fix Linux build (a static_assert unfortunately fires for Clang) Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index af6d86d699..824b38e47b 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -352,7 +352,7 @@ namespace AZ::Dom } else { - static_assert(false, "AZ::Dom::Value::GetType: m_value has an unexpected type"); + AZ_Assert(false, "AZ::Dom::Value::GetType: m_value has an unexpected type"); } }, m_value); From 6c3d5c434ebf166f3632f8a4e8257d0f8d09f440 Mon Sep 17 00:00:00 2001 From: Allen Jackson <23512001+jackalbe@users.noreply.github.com> Date: Wed, 5 Jan 2022 16:08:58 -0600 Subject: [PATCH 328/948] {lyn8865} Adding DataTypes::ScriptProcessorFallbackLogic (#6396) * {lyn8865} Adding DataTypes::ScriptProcessorFallbackLogic - Give the user an option how to handle fallback logic for script rules Signed-off-by: Allen Jackson <23512001+jackalbe@users.noreply.github.com> * the new code found an error in a Python script... it seems to work! Signed-off-by: Allen Jackson <23512001+jackalbe@users.noreply.github.com> * fixing up the regression test Signed-off-by: Jackson <23512001+jackalbe@users.noreply.github.com> * dump version number Signed-off-by: Allen Jackson <23512001+jackalbe@users.noreply.github.com> --- .../python_builder.py | 2 +- .../TestAssets/test_chunks_builder.py | 2 +- .../DataTypes/Rules/IScriptProcessorRule.h | 8 ++ .../Behaviors/ScriptProcessorRuleBehavior.cpp | 26 ++++++- .../Behaviors/ScriptProcessorRuleBehavior.h | 2 +- .../SceneData/Rules/ScriptProcessorRule.cpp | 17 ++++- .../SceneData/Rules/ScriptProcessorRule.h | 3 + .../SceneManifest/SceneManifestRuleTests.cpp | 75 +++++++++++++++++++ 8 files changed, 126 insertions(+), 9 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/fbx_tests/assets/TwoSceneFiles_OneWithPythonOneWithout_PythonOnlyRunsOnFirstScene/python_builder.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/fbx_tests/assets/TwoSceneFiles_OneWithPythonOneWithout_PythonOnlyRunsOnFirstScene/python_builder.py index 7ad5894a86..a9759e3d33 100644 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/fbx_tests/assets/TwoSceneFiles_OneWithPythonOneWithout_PythonOnlyRunsOnFirstScene/python_builder.py +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/fbx_tests/assets/TwoSceneFiles_OneWithPythonOneWithout_PythonOnlyRunsOnFirstScene/python_builder.py @@ -23,7 +23,7 @@ def output_test_data(scene): # Just write something to the file, but the filename is the main information # used for the test. f.write(f"scene.sourceFilename: {scene.sourceFilename}\n") - return True + return '' mySceneJobHandler = None diff --git a/AutomatedTesting/TestAssets/test_chunks_builder.py b/AutomatedTesting/TestAssets/test_chunks_builder.py index 2fd1ad9db9..b18902a34c 100755 --- a/AutomatedTesting/TestAssets/test_chunks_builder.py +++ b/AutomatedTesting/TestAssets/test_chunks_builder.py @@ -28,7 +28,7 @@ def update_manifest(scene): meshGroup = sceneManifest.add_mesh_group(chunkName) meshGroup['id'] = '{' + str(uuid.uuid5(uuid.NAMESPACE_DNS, scene.sourceFilename + chunkName)) + '}' sceneManifest.mesh_group_add_comment(meshGroup, 'auto generated by test_chunks_builder') - sceneManifest.mesh_group_set_origin(meshGroup, None, 0, 0, 0, 1.0) + sceneManifest.mesh_group_add_advanced_coordinate_system(meshGroup) for meshIndex in range(len(chunkNameList)): if (activeMeshIndex == meshIndex): sceneManifest.mesh_group_select_node(meshGroup, chunkNameList[meshIndex]) diff --git a/Code/Tools/SceneAPI/SceneCore/DataTypes/Rules/IScriptProcessorRule.h b/Code/Tools/SceneAPI/SceneCore/DataTypes/Rules/IScriptProcessorRule.h index 36be5f61d3..2b2abae561 100644 --- a/Code/Tools/SceneAPI/SceneCore/DataTypes/Rules/IScriptProcessorRule.h +++ b/Code/Tools/SceneAPI/SceneCore/DataTypes/Rules/IScriptProcessorRule.h @@ -17,6 +17,12 @@ namespace AZ { namespace DataTypes { + enum class ScriptProcessorFallbackLogic + { + FailBuild, // this will log error & fail the build + ContinueBuild // this will log the errors but continue the build logic + }; + class IScriptProcessorRule : public IRule { @@ -26,6 +32,8 @@ namespace AZ virtual ~IScriptProcessorRule() override = default; virtual const AZStd::string& GetScriptFilename() const = 0; + + virtual ScriptProcessorFallbackLogic GetScriptProcessorFallbackLogic() const = 0; }; } // DataTypes } // SceneAPI diff --git a/Code/Tools/SceneAPI/SceneData/Behaviors/ScriptProcessorRuleBehavior.cpp b/Code/Tools/SceneAPI/SceneData/Behaviors/ScriptProcessorRuleBehavior.cpp index 8d413b6038..6046bfa620 100644 --- a/Code/Tools/SceneAPI/SceneData/Behaviors/ScriptProcessorRuleBehavior.cpp +++ b/Code/Tools/SceneAPI/SceneData/Behaviors/ScriptProcessorRuleBehavior.cpp @@ -173,10 +173,13 @@ namespace AZ::SceneAPI::Behaviors UnloadPython(); } - bool ScriptProcessorRuleBehavior::LoadPython(const AZ::SceneAPI::Containers::Scene& scene, AZStd::string& scriptPath) + bool ScriptProcessorRuleBehavior::LoadPython(const AZ::SceneAPI::Containers::Scene& scene, AZStd::string& scriptPath, Events::ProcessingResult& fallbackResult) { + using namespace AZ::SceneAPI; + + fallbackResult = Events::ProcessingResult::Failure; int scriptDiscoveryAttempts = 0; - const AZ::SceneAPI::Containers::SceneManifest& manifest = scene.GetManifest(); + const Containers::SceneManifest& manifest = scene.GetManifest(); auto view = Containers::MakeDerivedFilterView(manifest.GetValueStorage()); for (const auto& scriptItem : view) { @@ -188,6 +191,8 @@ namespace AZ::SceneAPI::Behaviors } ++scriptDiscoveryAttempts; + fallbackResult = (scriptItem.GetScriptProcessorFallbackLogic() == DataTypes::ScriptProcessorFallbackLogic::ContinueBuild) ? + Events::ProcessingResult::Ignored : Events::ProcessingResult::Failure; // check for file exist via absolute path if (!IO::FileIOBase::GetInstance()->Exists(scriptFilename.c_str())) @@ -301,7 +306,8 @@ namespace AZ::SceneAPI::Behaviors } }; - if (LoadPython(context.GetScene(), scriptPath)) + [[maybe_unused]] Events::ProcessingResult fallbackResult; + if (LoadPython(context.GetScene(), scriptPath, fallbackResult)) { EditorPythonConsoleNotificationHandler logger; m_editorPythonEventsInterface->ExecuteWithLock(executeCallback); @@ -333,8 +339,9 @@ namespace AZ::SceneAPI::Behaviors return Events::ProcessingResult::Ignored; } + Events::ProcessingResult fallbackResult; AZStd::string scriptPath; - if (LoadPython(scene, scriptPath)) + if (LoadPython(scene, scriptPath, fallbackResult)) { AZStd::string manifestUpdate; auto executeCallback = [&scene, &manifestUpdate, &scriptPath]() @@ -349,6 +356,12 @@ namespace AZ::SceneAPI::Behaviors EditorPythonConsoleNotificationHandler logger; m_editorPythonEventsInterface->ExecuteWithLock(executeCallback); + // if the returned scene manifest is empty then ignore the script update + if (manifestUpdate.empty()) + { + return Events::ProcessingResult::Ignored; + } + EntityUtilityBus::Broadcast(&EntityUtilityBus::Events::ResetEntityContext); AZ::Interface::Get()->RemoveAllTemplates(); @@ -364,6 +377,11 @@ namespace AZ::SceneAPI::Behaviors } return Events::ProcessingResult::Success; } + else + { + // if the manifest was not updated by the script, then return back the fallback result + return fallbackResult; + } } return Events::ProcessingResult::Ignored; } diff --git a/Code/Tools/SceneAPI/SceneData/Behaviors/ScriptProcessorRuleBehavior.h b/Code/Tools/SceneAPI/SceneData/Behaviors/ScriptProcessorRuleBehavior.h index a9ddf88df9..8903a8f257 100644 --- a/Code/Tools/SceneAPI/SceneData/Behaviors/ScriptProcessorRuleBehavior.h +++ b/Code/Tools/SceneAPI/SceneData/Behaviors/ScriptProcessorRuleBehavior.h @@ -54,7 +54,7 @@ namespace AZ::SceneAPI::Behaviors SCENE_DATA_API void GetManifestDependencyPaths(AZStd::vector& paths) override; protected: - bool LoadPython(const AZ::SceneAPI::Containers::Scene& scene, AZStd::string& scriptPath); + bool LoadPython(const AZ::SceneAPI::Containers::Scene& scene, AZStd::string& scriptPath, Events::ProcessingResult& fallbackResult); void UnloadPython(); bool DoPrepareForExport(Events::PreExportEventContext& context); diff --git a/Code/Tools/SceneAPI/SceneData/Rules/ScriptProcessorRule.cpp b/Code/Tools/SceneAPI/SceneData/Rules/ScriptProcessorRule.cpp index 5893764eb1..15c8c1b7f3 100644 --- a/Code/Tools/SceneAPI/SceneData/Rules/ScriptProcessorRule.cpp +++ b/Code/Tools/SceneAPI/SceneData/Rules/ScriptProcessorRule.cpp @@ -14,6 +14,9 @@ namespace AZ { + // Enum types must have a TypeId tied to it in order for the reflection to succeed. + AZ_TYPE_INFO_SPECIALIZE(SceneAPI::DataTypes::ScriptProcessorFallbackLogic, "{3DCABF3D-E8EF-43E7-B3C7-373E05825F60}"); + namespace SceneAPI { namespace SceneData @@ -23,13 +26,23 @@ namespace AZ return m_scriptFilename; } + DataTypes::ScriptProcessorFallbackLogic ScriptProcessorRule::GetScriptProcessorFallbackLogic() const + { + return m_fallbackLogic; + } + void ScriptProcessorRule::Reflect(AZ::ReflectContext* context) { AZ::SerializeContext* serializeContext = azrtti_cast(context); if (serializeContext) { - serializeContext->Class()->Version(1) - ->Field("scriptFilename", &ScriptProcessorRule::m_scriptFilename); + serializeContext->Class()->Version(2) + ->Field("scriptFilename", &ScriptProcessorRule::m_scriptFilename) + ->Field("fallbackLogic", &ScriptProcessorRule::m_fallbackLogic); + + serializeContext->Enum() + ->Value("FailBuild", DataTypes::ScriptProcessorFallbackLogic::FailBuild) + ->Value("ContinueBuild", DataTypes::ScriptProcessorFallbackLogic::ContinueBuild); AZ::EditContext* editContext = serializeContext->GetEditContext(); if (editContext) diff --git a/Code/Tools/SceneAPI/SceneData/Rules/ScriptProcessorRule.h b/Code/Tools/SceneAPI/SceneData/Rules/ScriptProcessorRule.h index ad5e1de063..80cb670f9f 100644 --- a/Code/Tools/SceneAPI/SceneData/Rules/ScriptProcessorRule.h +++ b/Code/Tools/SceneAPI/SceneData/Rules/ScriptProcessorRule.h @@ -35,10 +35,13 @@ namespace AZ m_scriptFilename = AZStd::move(scriptFilename); } + DataTypes::ScriptProcessorFallbackLogic GetScriptProcessorFallbackLogic() const override; + static void Reflect(ReflectContext* context); protected: AZStd::string m_scriptFilename; + DataTypes::ScriptProcessorFallbackLogic m_fallbackLogic = DataTypes::ScriptProcessorFallbackLogic::FailBuild; }; } // SceneData } // SceneAPI diff --git a/Code/Tools/SceneAPI/SceneData/Tests/SceneManifest/SceneManifestRuleTests.cpp b/Code/Tools/SceneAPI/SceneData/Tests/SceneManifest/SceneManifestRuleTests.cpp index e0d5cca484..2bbbc1054a 100644 --- a/Code/Tools/SceneAPI/SceneData/Tests/SceneManifest/SceneManifestRuleTests.cpp +++ b/Code/Tools/SceneAPI/SceneData/Tests/SceneManifest/SceneManifestRuleTests.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -271,5 +272,79 @@ namespace AZ auto update = scriptProcessorRuleBehavior.UpdateManifest(scene, AssetImportRequest::Update, AssetImportRequest::Generic); EXPECT_EQ(update, ProcessingResult::Ignored); } + + TEST_F(SceneManifest_JSON, ScriptProcessorRule_DefaultFallbackLogic_Works) + { + using namespace AZ::SceneAPI; + + constexpr const char* defaultJson = { R"JSON( + { + "values": [ + { + "$type": "ScriptProcessorRule", + "scriptFilename": "foo.py" + } + ] + })JSON" }; + + auto scene = Containers::Scene("mock"); + auto result = scene.GetManifest().LoadFromString(defaultJson, m_serializeContext.get(), m_jsonRegistrationContext.get()); + EXPECT_TRUE(result.IsSuccess()); + EXPECT_FALSE(scene.GetManifest().IsEmpty()); + ASSERT_EQ(scene.GetManifest().GetEntryCount(), 1); + + auto view = Containers::MakeDerivedFilterView(scene.GetManifest().GetValueStorage()); + EXPECT_EQ(view.begin()->GetScriptProcessorFallbackLogic(), DataTypes::ScriptProcessorFallbackLogic::FailBuild); + } + + TEST_F(SceneManifest_JSON, ScriptProcessorRule_ExplicitFallbackLogic_Works) + { + using namespace AZ::SceneAPI; + + constexpr const char* fallbackLogicJson = { R"JSON( + { + "values": [ + { + "$type": "ScriptProcessorRule", + "scriptFilename": "foo.py", + "fallbackLogic": "FailBuild" + } + ] + })JSON" }; + + auto scene = Containers::Scene("mock"); + auto result = scene.GetManifest().LoadFromString(fallbackLogicJson, m_serializeContext.get(), m_jsonRegistrationContext.get()); + EXPECT_TRUE(result.IsSuccess()); + EXPECT_FALSE(scene.GetManifest().IsEmpty()); + ASSERT_EQ(scene.GetManifest().GetEntryCount(), 1); + + auto view = Containers::MakeDerivedFilterView(scene.GetManifest().GetValueStorage()); + EXPECT_EQ(view.begin()->GetScriptProcessorFallbackLogic(), DataTypes::ScriptProcessorFallbackLogic::FailBuild); + } + + TEST_F(SceneManifest_JSON, ScriptProcessorRule_ContinueBuildFallbackLogic_Works) + { + using namespace AZ::SceneAPI; + + constexpr const char* fallbackLogicJson = { R"JSON( + { + "values": [ + { + "$type": "ScriptProcessorRule", + "scriptFilename": "foo.py", + "fallbackLogic": "ContinueBuild" + } + ] + })JSON" }; + + auto scene = Containers::Scene("mock"); + auto result = scene.GetManifest().LoadFromString(fallbackLogicJson, m_serializeContext.get(), m_jsonRegistrationContext.get()); + EXPECT_TRUE(result.IsSuccess()); + EXPECT_FALSE(scene.GetManifest().IsEmpty()); + ASSERT_EQ(scene.GetManifest().GetEntryCount(), 1); + + auto view = Containers::MakeDerivedFilterView(scene.GetManifest().GetValueStorage()); + EXPECT_EQ(view.begin()->GetScriptProcessorFallbackLogic(), DataTypes::ScriptProcessorFallbackLogic::ContinueBuild); + } } } From af6af93dffe2764ccf5160436e64931775cc18ce Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 5 Jan 2022 14:23:32 -0800 Subject: [PATCH 329/948] Fixes Linux builds Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzCore/AzCore/Memory/BestFitExternalMapSchema.cpp | 4 ++-- Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.cpp b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.cpp index 9561d1019c..5029e6349f 100644 --- a/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/BestFitExternalMapSchema.cpp @@ -133,13 +133,13 @@ namespace AZ BestFitExternalMapSchema::size_type BestFitExternalMapSchema::Resize(pointer_type, size_type) { - AZ_Assert(false, AZ_FUNCTION_SIGNATURE " unsupported"); + AZ_Assert(false, "%s unsupported", AZ_FUNCTION_SIGNATURE); return 0; } BestFitExternalMapSchema::pointer_type BestFitExternalMapSchema::ReAllocate(pointer_type, size_type, size_type) { - AZ_Assert(false, AZ_FUNCTION_SIGNATURE " unsupported"); + AZ_Assert(false, "%s unsupported", AZ_FUNCTION_SIGNATURE); return nullptr; } diff --git a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp index 0599038006..e027b03a49 100644 --- a/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/Memory/AllocatorBenchmarks.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include From 6ae8c6343194e58712eb620958ee9021555bdcab Mon Sep 17 00:00:00 2001 From: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> Date: Wed, 5 Jan 2022 16:27:21 -0600 Subject: [PATCH 330/948] Re-enabling Periodic suite for testing on Jenkins Signed-off-by: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> --- .../Gem/PythonTests/editor/CMakeLists.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/AutomatedTesting/Gem/PythonTests/editor/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/editor/CMakeLists.txt index 1fc71da972..a43b3647f9 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/editor/CMakeLists.txt @@ -50,4 +50,17 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_ Editor ) + ly_add_pytest( + NAME AutomatedTesting::EditorTests_Periodic + TEST_SUITE periodic + TEST_SERIAL + PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Periodic.py + RUNTIME_DEPENDENCIES + Legacy::Editor + AZ::AssetProcessor + AutomatedTesting.Assets + COMPONENT + Editor + ) + endif() From 7d9f9f99e657af79cbe6000ccadfa79272c4410f Mon Sep 17 00:00:00 2001 From: mrieggeramzn Date: Wed, 5 Jan 2022 14:50:03 -0800 Subject: [PATCH 331/948] fix unit test Signed-off-by: mrieggeramzn --- .../Tests/PropertyIntCtrlCommonTests.h | 29 +++++++++---------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/Code/Framework/AzToolsFramework/Tests/PropertyIntCtrlCommonTests.h b/Code/Framework/AzToolsFramework/Tests/PropertyIntCtrlCommonTests.h index 712eeb99b7..d4f0c8d705 100644 --- a/Code/Framework/AzToolsFramework/Tests/PropertyIntCtrlCommonTests.h +++ b/Code/Framework/AzToolsFramework/Tests/PropertyIntCtrlCommonTests.h @@ -12,6 +12,7 @@ #include #include "IntegerPrimtitiveTestConfig.h" #include +#include #include namespace UnitTest @@ -83,18 +84,6 @@ namespace UnitTest widget->setMaximum(widget->maximum() - 1); } - static std::string GetToolTipStringAtLimits() - { - if constexpr (std::is_signed::value) - { - return "[-INF, INF]"; - } - else - { - return "[0, INF]"; - } - } - void PropertyCtrlHandlersCreated() { using ::testing::Ne; @@ -125,15 +114,19 @@ namespace UnitTest auto& widget = m_widget; auto& handler = m_handler; QString tooltip; - std::string expected; + std::stringstream expected; // Retrieve the tooltip string for this widget auto success = handler->ModifyTooltip(widget, tooltip); - expected = GetToolTipStringAtLimits(); + + const QString minString = QLocale().toString(widget->minimum()); + const QString maxString = QLocale().toString(widget->maximum()); + + expected << "[" << minString.toStdString() << ", " << maxString.toStdString() << "]"; // Expect the operation to be successful and a valid limit tooltip string generated EXPECT_TRUE(success); - EXPECT_STREQ(tooltip.toStdString().c_str(), expected.c_str()); + EXPECT_STREQ(tooltip.toStdString().c_str(), expected.str().c_str()); } void HandlerMinMaxLessLimit_ModifyHandler_ExpectSuccessAndValidLessLimitToolTipString() @@ -149,7 +142,11 @@ namespace UnitTest // Retrieve the tooltip string for this widget auto success = handler->ModifyTooltip(widget, tooltip); - expected << "[" << widget->minimum() << ", " << widget->maximum() << "]"; + + const QString minString = QLocale().toString(widget->minimum()); + const QString maxString = QLocale().toString(widget->maximum()); + + expected << "[" << minString.toStdString() << ", " << maxString.toStdString() << "]"; // Expect the operation to be successful and a valid less than limit tooltip string generated EXPECT_TRUE(success); From 01c5fb78178eeefd74172ba0556461dcc5c6b0b2 Mon Sep 17 00:00:00 2001 From: michabr <82236305+michabr@users.noreply.github.com> Date: Wed, 5 Jan 2022 15:27:52 -0800 Subject: [PATCH 332/948] Add clamp mode to Draw2d (#6630) Signed-off-by: abrmich --- Gems/LyShine/Code/Include/LyShine/Draw2d.h | 11 ++++++++++- Gems/LyShine/Code/Source/Draw2d.cpp | 22 +++++++++++++++++----- Gems/LyShine/Code/Source/LyShine.cpp | 10 ++++++++-- 3 files changed, 35 insertions(+), 8 deletions(-) diff --git a/Gems/LyShine/Code/Include/LyShine/Draw2d.h b/Gems/LyShine/Code/Include/LyShine/Draw2d.h index 881479bd23..f92c6ce2e1 100644 --- a/Gems/LyShine/Code/Include/LyShine/Draw2d.h +++ b/Gems/LyShine/Code/Include/LyShine/Draw2d.h @@ -50,6 +50,7 @@ public: // types { AZ::Vector3 color = AZ::Vector3(1.0f, 1.0f, 1.0f); Rounding pixelRounding = Rounding::Nearest; + bool m_clamp = false; RenderState m_renderState; }; @@ -145,6 +146,7 @@ public: // member functions virtual void DrawQuad(AZ::Data::Instance image, VertexPosColUV* verts, Rounding pixelRounding = Rounding::Nearest, + bool clamp = false, const RenderState& renderState = RenderState{}); //! Draw a line @@ -257,6 +259,8 @@ protected: // types and constants { AZ::RHI::ShaderInputImageIndex m_imageInputIndex; AZ::RHI::ShaderInputConstantIndex m_viewProjInputIndex; + AZ::RPI::ShaderVariantId m_shaderOptionsClamp; + AZ::RPI::ShaderVariantId m_shaderOptionsWrap; }; class DeferredPrimitive @@ -281,6 +285,7 @@ protected: // types and constants AZ::Vector2 m_texCoords[4]; uint32 m_packedColors[4]; AZ::Data::Instance m_image; + bool m_clamp; RenderState m_renderState; }; @@ -455,11 +460,12 @@ public: // member functions //! See IDraw2d:DrawQuad for parameter descriptions void DrawQuad(AZ::Data::Instance image, CDraw2d::VertexPosColUV* verts, IDraw2d::Rounding pixelRounding = IDraw2d::Rounding::Nearest, + bool clamp = false, const CDraw2d::RenderState& renderState = CDraw2d::RenderState{}) { if (m_draw2d) { - m_draw2d->DrawQuad(image, verts, pixelRounding, renderState); + m_draw2d->DrawQuad(image, verts, pixelRounding, clamp, renderState); } } @@ -545,6 +551,9 @@ public: // member functions //! Set the base state (that blend mode etc is combined with) used for images, default is GS_NODEPTHTEST. void SetImageDepthState(const AZ::RHI::DepthState& depthState) { m_imageOptions.m_renderState.m_depthState = depthState; } + //! Set image clamp mode + void SetImageClamp(bool clamp) { m_imageOptions.m_clamp = clamp; } + //! Set the text font. void SetTextFont(AZStd::string_view fontName) { m_textOptions.fontName = fontName; } diff --git a/Gems/LyShine/Code/Source/Draw2d.cpp b/Gems/LyShine/Code/Source/Draw2d.cpp index 6b6356aa4f..917c1bb168 100644 --- a/Gems/LyShine/Code/Source/Draw2d.cpp +++ b/Gems/LyShine/Code/Source/Draw2d.cpp @@ -103,10 +103,7 @@ void CDraw2d::OnBootstrapSceneReady(AZ::RPI::Scene* bootstrapScene) LyShinePassRequestBus::EventResult(uiCanvasPass, sceneId, &LyShinePassRequestBus::Events::GetUiCanvasPass); m_dynamicDraw = AZ::RPI::DynamicDrawInterface::Get()->CreateDynamicDrawContext(); - AZ::RPI::ShaderOptionList shaderOptions; - shaderOptions.push_back(AZ::RPI::ShaderOption(AZ::Name("o_useColorChannels"), AZ::Name("true"))); - shaderOptions.push_back(AZ::RPI::ShaderOption(AZ::Name("o_clamp"), AZ::Name("false"))); - m_dynamicDraw->InitShaderWithVariant(shader, &shaderOptions); + m_dynamicDraw->InitShader(shader); m_dynamicDraw->InitVertexFormat( { {"POSITION", AZ::RHI::Format::R32G32B32_FLOAT}, {"COLOR", AZ::RHI::Format::B8G8R8A8_UNORM}, @@ -136,6 +133,16 @@ void CDraw2d::OnBootstrapSceneReady(AZ::RPI::Scene* bootstrapScene) m_shaderData.m_viewProjInputIndex = layout->FindShaderInputConstantIndex(AZ::Name(worldToProjIndexName)); AZ_Error("Draw2d", m_shaderData.m_viewProjInputIndex.IsValid(), "Failed to find shader input constant %s.", worldToProjIndexName); + + // Cache shader variants that will be used + AZ::RPI::ShaderOptionList shaderOptionsClamp; + shaderOptionsClamp.push_back(AZ::RPI::ShaderOption(AZ::Name("o_clamp"), AZ::Name("true"))); + shaderOptionsClamp.push_back(AZ::RPI::ShaderOption(AZ::Name("o_useColorChannels"), AZ::Name("true"))); + m_shaderData.m_shaderOptionsClamp = m_dynamicDraw->UseShaderVariant(shaderOptionsClamp); + AZ::RPI::ShaderOptionList shaderOptionsWrap; + shaderOptionsWrap.push_back(AZ::RPI::ShaderOption(AZ::Name("o_clamp"), AZ::Name("false"))); + shaderOptionsWrap.push_back(AZ::RPI::ShaderOption(AZ::Name("o_useColorChannels"), AZ::Name("true"))); + m_shaderData.m_shaderOptionsWrap = m_dynamicDraw->UseShaderVariant(shaderOptionsWrap); } //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -181,6 +188,8 @@ void CDraw2d::DrawImage(AZ::Data::Instance image, AZ::Vector2 po quad.m_image = image; + quad.m_clamp = actualImageOptions->m_clamp; + // add the blendMode flags to the base state quad.m_renderState = actualImageOptions->m_renderState; @@ -206,7 +215,7 @@ void CDraw2d::DrawImageAligned(AZ::Data::Instance image, AZ::Vec //////////////////////////////////////////////////////////////////////////////////////////////////// void CDraw2d::DrawQuad(AZ::Data::Instance image, VertexPosColUV* verts, Rounding pixelRounding, - const CDraw2d::RenderState& renderState) + bool clamp, const CDraw2d::RenderState& renderState) { // define quad DeferredQuad quad; @@ -217,6 +226,7 @@ void CDraw2d::DrawQuad(AZ::Data::Instance image, VertexPosColUV* quad.m_packedColors[i] = PackARGB8888(verts[i].color); } quad.m_image = image; + quad.m_clamp = clamp; // add the blendMode flags to the base state quad.m_renderState = renderState; @@ -766,6 +776,8 @@ void CDraw2d::DeferredQuad::Draw(AZ::RHI::Ptr dynam vertices[i].st = Vec2(m_texCoords[j].GetX(), m_texCoords[j].GetY()); } + dynamicDraw->SetShaderVariant(m_clamp ? shaderData.m_shaderOptionsClamp : shaderData.m_shaderOptionsWrap); + // Set up per draw SRG AZ::Data::Instance drawSrg = dynamicDraw->NewDrawSrg(); diff --git a/Gems/LyShine/Code/Source/LyShine.cpp b/Gems/LyShine/Code/Source/LyShine.cpp index d19bc3f92d..683d72f4ab 100644 --- a/Gems/LyShine/Code/Source/LyShine.cpp +++ b/Gems/LyShine/Code/Source/LyShine.cpp @@ -668,7 +668,7 @@ void CLyShine::LoadUiCursor() { if (!m_cursorImagePathToLoad.empty()) { - m_uiCursorTexture = CDraw2d::LoadTexture(m_cursorImagePathToLoad); // LYSHINE_ATOM_TODO - add clamp option to draw2d and set cursor to clamp + m_uiCursorTexture = CDraw2d::LoadTexture(m_cursorImagePathToLoad); m_cursorImagePathToLoad.clear(); } } @@ -691,7 +691,13 @@ void CLyShine::RenderUiCursor() AZ::RHI::Size cursorSize = m_uiCursorTexture->GetDescriptor().m_size; const AZ::Vector2 dimensions(aznumeric_cast(cursorSize.m_width), aznumeric_cast(cursorSize.m_height)); - m_draw2d->DrawImage(m_uiCursorTexture, position, dimensions); + CDraw2d::ImageOptions imageOptions; + imageOptions.m_clamp = true; + const float opacity = 1.0f; + const float rotation = 0.0f; + const AZ::Vector2* pivotPoint = nullptr; + const AZ::Vector2* minMaxTexCoords = nullptr; + m_draw2d->DrawImage(m_uiCursorTexture, position, dimensions, opacity, rotation, pivotPoint, minMaxTexCoords, &imageOptions); } #ifndef _RELEASE From ee6709a85c0b32ab8737cb13af0b0fc696c594d7 Mon Sep 17 00:00:00 2001 From: Sean Masterson Date: Wed, 5 Jan 2022 15:47:11 -0800 Subject: [PATCH 333/948] Move and convert ShadowTest level and include object files Signed-off-by: Sean Masterson --- .../Graphics/ShadowTest/ShadowTest.prefab | 566 ++++++++++++++++++ .../Levels/Graphics/ShadowTest/tags.txt | 12 + .../Objects/ShaderBall_simple.fbx | 3 + AutomatedTesting/Objects/bunny.fbx | 3 + AutomatedTesting/Objects/cone.fbx | 3 + AutomatedTesting/Objects/cube.fbx | 3 + AutomatedTesting/Objects/cylinder.fbx | 3 + AutomatedTesting/Objects/plane.fbx | 3 + AutomatedTesting/Objects/suzanne.fbx | 3 + 9 files changed, 599 insertions(+) create mode 100644 AutomatedTesting/Levels/Graphics/ShadowTest/ShadowTest.prefab create mode 100644 AutomatedTesting/Levels/Graphics/ShadowTest/tags.txt create mode 100644 AutomatedTesting/Objects/ShaderBall_simple.fbx create mode 100644 AutomatedTesting/Objects/bunny.fbx create mode 100644 AutomatedTesting/Objects/cone.fbx create mode 100644 AutomatedTesting/Objects/cube.fbx create mode 100644 AutomatedTesting/Objects/cylinder.fbx create mode 100644 AutomatedTesting/Objects/plane.fbx create mode 100644 AutomatedTesting/Objects/suzanne.fbx diff --git a/AutomatedTesting/Levels/Graphics/ShadowTest/ShadowTest.prefab b/AutomatedTesting/Levels/Graphics/ShadowTest/ShadowTest.prefab new file mode 100644 index 0000000000..86d16328e9 --- /dev/null +++ b/AutomatedTesting/Levels/Graphics/ShadowTest/ShadowTest.prefab @@ -0,0 +1,566 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "ShadowTest", + "Components": { + "Component_[10182366347512475253]": { + "$type": "EditorPrefabComponent", + "Id": 10182366347512475253 + }, + "Component_[12917798267488243668]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12917798267488243668 + }, + "Component_[3261249813163778338]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3261249813163778338 + }, + "Component_[3837204912784440039]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 3837204912784440039 + }, + "Component_[4272963378099646759]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 4272963378099646759, + "Parent Entity": "" + }, + "Component_[4848458548047175816]": { + "$type": "EditorVisibilityComponent", + "Id": 4848458548047175816 + }, + "Component_[5787060997243919943]": { + "$type": "EditorInspectorComponent", + "Id": 5787060997243919943 + }, + "Component_[7804170251266531779]": { + "$type": "EditorLockComponent", + "Id": 7804170251266531779 + }, + "Component_[7874177159288365422]": { + "$type": "EditorEntitySortComponent", + "Id": 7874177159288365422 + }, + "Component_[8018146290632383969]": { + "$type": "EditorEntityIconComponent", + "Id": 8018146290632383969 + }, + "Component_[8452360690590857075]": { + "$type": "SelectionComponent", + "Id": 8452360690590857075 + } + } + }, + "Entities": { + "Entity_[232650527119]": { + "Id": "Entity_[232650527119]", + "Name": "DirectionalLight", + "Components": { + "Component_[10660156197505313227]": { + "$type": "EditorLockComponent", + "Id": 10660156197505313227 + }, + "Component_[14184823757717157844]": { + "$type": "EditorInspectorComponent", + "Id": 14184823757717157844, + "ComponentOrderEntryArray": [ + { + "ComponentId": 9854879901259791898 + }, + { + "ComponentId": 3968519938187714949, + "SortIndex": 1 + } + ] + }, + "Component_[1495573908681275492]": { + "$type": "EditorEntitySortComponent", + "Id": 1495573908681275492 + }, + "Component_[15580233403487968826]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 15580233403487968826 + }, + "Component_[3968519938187714949]": { + "$type": "AZ::Render::EditorDirectionalLightComponent", + "Id": 3968519938187714949, + "Controller": { + "Configuration": { + "Intensity": 0.0, + "CameraEntityId": "", + "ShadowmapSize": "Size2048" + } + } + }, + "Component_[4961040003466069196]": { + "$type": "EditorEntityIconComponent", + "Id": 4961040003466069196 + }, + "Component_[7824884165323036147]": { + "$type": "EditorVisibilityComponent", + "Id": 7824884165323036147 + }, + "Component_[8741866916946672319]": { + "$type": "EditorPendingCompositionComponent", + "Id": 8741866916946672319 + }, + "Component_[9288966876314965560]": { + "$type": "EditorOnlyEntityComponent", + "Id": 9288966876314965560 + }, + "Component_[9313163355156975968]": { + "$type": "SelectionComponent", + "Id": 9313163355156975968 + }, + "Component_[9854879901259791898]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 9854879901259791898, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 0.0, + 0.0, + 2.0 + ], + "Rotate": [ + -32.05662536621094, + -26.103206634521484, + 47.54806137084961 + ] + } + } + } + }, + "Entity_[260824893221]": { + "Id": "Entity_[260824893221]", + "Name": "SpotLight", + "Components": { + "Component_[16098295228434057928]": { + "$type": "EditorDiskShapeComponent", + "Id": 16098295228434057928, + "ShapeColor": [ + 1.0, + 1.0, + 1.0, + 1.0 + ], + "DiskShape": { + "Configuration": { + "Radius": 0.0 + } + } + }, + "Component_[16175995808158769171]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 16175995808158769171, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 0.6417449712753296, + 1.3211734294891357, + 3.022759199142456 + ], + "Rotate": [ + 243.31329345703125, + 0.0, + 0.0 + ] + } + }, + "Component_[17136787899581093377]": { + "$type": "EditorEntitySortComponent", + "Id": 17136787899581093377 + }, + "Component_[17938027566627202610]": { + "$type": "EditorPendingCompositionComponent", + "Id": 17938027566627202610 + }, + "Component_[190081405128299223]": { + "$type": "SelectionComponent", + "Id": 190081405128299223 + }, + "Component_[2181418147135573579]": { + "$type": "EditorEntityIconComponent", + "Id": 2181418147135573579 + }, + "Component_[2564149706319215342]": { + "$type": "EditorOnlyEntityComponent", + "Id": 2564149706319215342 + }, + "Component_[3716169383940064541]": { + "$type": "EditorInspectorComponent", + "Id": 3716169383940064541, + "ComponentOrderEntryArray": [ + { + "ComponentId": 16175995808158769171 + }, + { + "ComponentId": 16665800442781289114, + "SortIndex": 1 + } + ] + }, + "Component_[4143676462074671972]": { + "$type": "AZ::Render::EditorAreaLightComponent", + "Id": 4143676462074671972, + "Controller": { + "Configuration": { + "LightType": 2, + "AttenuationRadius": 31.62277603149414, + "EnableShutters": true, + "InnerShutterAngleDegrees": 22.5, + "OuterShutterAngleDegrees": 27.5, + "Enable Shadow": true, + "Shadowmap Max Size": "Size2048", + "Filtering Sample Count": 32 + } + } + }, + "Component_[6706371214647538019]": { + "$type": "EditorVisibilityComponent", + "Id": 6706371214647538019 + }, + "Component_[7493944209625718550]": { + "$type": "EditorLockComponent", + "Id": 7493944209625718550 + }, + "Component_[7614113482082939165]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 7614113482082939165 + } + } + }, + "Entity_[269117486973]": { + "Id": "Entity_[269117486973]", + "Name": "Floor", + "Components": { + "Component_[10562678944594915756]": { + "$type": "EditorEntitySortComponent", + "Id": 10562678944594915756 + }, + "Component_[1175452962278157526]": { + "$type": "EditorEntityIconComponent", + "Id": 1175452962278157526 + }, + "Component_[13598353801231166887]": { + "$type": "EditorPendingCompositionComponent", + "Id": 13598353801231166887 + }, + "Component_[13735087293504923475]": { + "$type": "SelectionComponent", + "Id": 13735087293504923475 + }, + "Component_[13888244442459268363]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 13888244442459268363, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{E65E9ED3-3E38-5ABA-9E22-95E34DA4C3AE}", + "subId": 280178048 + }, + "assetHint": "objects/plane.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[1525720357937234014]": { + "$type": "EditorMaterialComponent", + "Id": 1525720357937234014, + "materialSlotsByLodEnabled": true + }, + "Component_[16568998871680422442]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 16568998871680422442 + }, + "Component_[2147751093058990131]": { + "$type": "EditorInspectorComponent", + "Id": 2147751093058990131, + "ComponentOrderEntryArray": [ + { + "ComponentId": 3266761149114817871 + }, + { + "ComponentId": 13888244442459268363, + "SortIndex": 1 + }, + { + "ComponentId": 1525720357937234014, + "SortIndex": 2 + } + ] + }, + "Component_[3266761149114817871]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3266761149114817871, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Scale": [ + 100.0, + 100.0, + 100.0 + ], + "UniformScale": 100.0 + } + }, + "Component_[4625895382416898670]": { + "$type": "EditorVisibilityComponent", + "Id": 4625895382416898670 + }, + "Component_[4856699190357614535]": { + "$type": "EditorLockComponent", + "Id": 4856699190357614535 + }, + "Component_[6466465153982575739]": { + "$type": "EditorOnlyEntityComponent", + "Id": 6466465153982575739 + } + } + }, + "Entity_[282757803856]": { + "Id": "Entity_[282757803856]", + "Name": "Cube", + "Components": { + "Component_[11189870094752260272]": { + "$type": "EditorEntitySortComponent", + "Id": 11189870094752260272 + }, + "Component_[11909086967677513257]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 11909086967677513257, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{593006BE-FE73-5A4B-A0A6-06C02EFFE458}", + "subId": 285127096 + }, + "loadBehavior": "PreLoad", + "assetHint": "objects/cube.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[1443341568598731610]": { + "$type": "EditorVisibilityComponent", + "Id": 1443341568598731610 + }, + "Component_[18339772707807258951]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 18339772707807258951, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 0.6083869934082031, + 3.137901782989502, + 0.5876787900924683 + ] + } + }, + "Component_[2447207272572065708]": { + "$type": "EditorEntityIconComponent", + "Id": 2447207272572065708 + }, + "Component_[3281906807632213471]": { + "$type": "SelectionComponent", + "Id": 3281906807632213471 + }, + "Component_[3412442673858204671]": { + "$type": "EditorPendingCompositionComponent", + "Id": 3412442673858204671 + }, + "Component_[5382641380294287889]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5382641380294287889 + }, + "Component_[7221534636342494619]": { + "$type": "EditorInspectorComponent", + "Id": 7221534636342494619, + "ComponentOrderEntryArray": [ + { + "ComponentId": 18339772707807258951 + }, + { + "ComponentId": 11909086967677513257, + "SortIndex": 1 + } + ] + }, + "Component_[7701217952253676487]": { + "$type": "EditorLockComponent", + "Id": 7701217952253676487 + }, + "Component_[7758436981023123121]": { + "$type": "EditorOnlyEntityComponent", + "Id": 7758436981023123121 + } + } + }, + "Entity_[372196702077]": { + "Id": "Entity_[372196702077]", + "Name": "Bunny", + "Components": { + "Component_[11345914745205508221]": { + "$type": "EditorEntityIconComponent", + "Id": 11345914745205508221 + }, + "Component_[11507863983962969790]": { + "$type": "EditorMaterialComponent", + "Id": 11507863983962969790, + "materialSlotsByLodEnabled": true + }, + "Component_[1342998773562921470]": { + "$type": "EditorPendingCompositionComponent", + "Id": 1342998773562921470 + }, + "Component_[14975835087235718844]": { + "$type": "EditorInspectorComponent", + "Id": 14975835087235718844, + "ComponentOrderEntryArray": [ + { + "ComponentId": 5012565883129470759 + }, + { + "ComponentId": 7975043234993822905, + "SortIndex": 1 + }, + { + "ComponentId": 11507863983962969790, + "SortIndex": 2 + } + ] + }, + "Component_[16460806723667032929]": { + "$type": "EditorOnlyEntityComponent", + "Id": 16460806723667032929 + }, + "Component_[18225690044585951363]": { + "$type": "EditorLockComponent", + "Id": 18225690044585951363 + }, + "Component_[18314752491697618927]": { + "$type": "EditorEntitySortComponent", + "Id": 18314752491697618927 + }, + "Component_[2431610550789583502]": { + "$type": "EditorVisibilityComponent", + "Id": 2431610550789583502 + }, + "Component_[5012565883129470759]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 5012565883129470759, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 0.0, + 0.0, + 0.20401419699192047 + ] + } + }, + "Component_[7975043234993822905]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 7975043234993822905, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{0C6BBB76-4EC2-583A-B8C6-1A4C4FD1FE9D}", + "subId": 283109893 + }, + "assetHint": "objects/bunny.azmodel" + }, + "LodOverride": 255 + } + } + }, + "Component_[8510666363380501112]": { + "$type": "SelectionComponent", + "Id": 8510666363380501112 + }, + "Component_[9639060480533776634]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 9639060480533776634 + } + } + }, + "Entity_[670308843764]": { + "Id": "Entity_[670308843764]", + "Name": "Camera1", + "Components": { + "Component_[12951260100632682169]": { + "$type": "GenericComponentWrapper", + "Id": 12951260100632682169, + "m_template": { + "$type": "FlyCameraInputComponent" + } + }, + "Component_[14180723329646459524]": { + "$type": "EditorPendingCompositionComponent", + "Id": 14180723329646459524 + }, + "Component_[14996469885773917977]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 14996469885773917977, + "Parent Entity": "ContainerEntity", + "Transform Data": { + "Translate": [ + 4.563776969909668, + 0.7667046785354614, + 3.000542640686035 + ], + "Rotate": [ + -9.740042686462402, + -20.20942497253418, + 63.57760238647461 + ] + } + }, + "Component_[17638492356673689530]": { + "$type": "EditorInspectorComponent", + "Id": 17638492356673689530 + }, + "Component_[2421853983468750254]": { + "$type": "{CA11DA46-29FF-4083-B5F6-E02C3A8C3A3D} EditorCameraComponent", + "Id": 2421853983468750254, + "Controller": { + "Configuration": { + "Field of View": 90.00020599365234, + "EditorEntityId": 666013876468 + } + } + }, + "Component_[2572028619185965684]": { + "$type": "EditorEntityIconComponent", + "Id": 2572028619185965684 + }, + "Component_[2782900516907042776]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 2782900516907042776 + }, + "Component_[2849166119438883669]": { + "$type": "EditorVisibilityComponent", + "Id": 2849166119438883669 + }, + "Component_[4618311795498613781]": { + "$type": "EditorOnlyEntityComponent", + "Id": 4618311795498613781 + }, + "Component_[5402004894214413002]": { + "$type": "EditorEntitySortComponent", + "Id": 5402004894214413002 + }, + "Component_[6111028576371006514]": { + "$type": "SelectionComponent", + "Id": 6111028576371006514 + }, + "Component_[8203141294643544464]": { + "$type": "EditorLockComponent", + "Id": 8203141294643544464 + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/Graphics/ShadowTest/tags.txt b/AutomatedTesting/Levels/Graphics/ShadowTest/tags.txt new file mode 100644 index 0000000000..0d6c1880e7 --- /dev/null +++ b/AutomatedTesting/Levels/Graphics/ShadowTest/tags.txt @@ -0,0 +1,12 @@ +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 diff --git a/AutomatedTesting/Objects/ShaderBall_simple.fbx b/AutomatedTesting/Objects/ShaderBall_simple.fbx new file mode 100644 index 0000000000..50b7b8f44d --- /dev/null +++ b/AutomatedTesting/Objects/ShaderBall_simple.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f5f7a86a693878c10f91783955cc72535bf7d7c495163087a4c1982f228d27f0 +size 2145248 diff --git a/AutomatedTesting/Objects/bunny.fbx b/AutomatedTesting/Objects/bunny.fbx new file mode 100644 index 0000000000..f0a16349f7 --- /dev/null +++ b/AutomatedTesting/Objects/bunny.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ef71257b240a7e704731806f8cd4b966af5d3c60f22881f9c6a6320180ee71a4 +size 2496384 diff --git a/AutomatedTesting/Objects/cone.fbx b/AutomatedTesting/Objects/cone.fbx new file mode 100644 index 0000000000..081b8b119d --- /dev/null +++ b/AutomatedTesting/Objects/cone.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:531b6473b314259504ab595e4983838b5866035ef4d70cedaf4cc9c7d9e65c3a +size 24512 diff --git a/AutomatedTesting/Objects/cube.fbx b/AutomatedTesting/Objects/cube.fbx new file mode 100644 index 0000000000..616c7b4ff3 --- /dev/null +++ b/AutomatedTesting/Objects/cube.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e32877eab35459499c73ff093df898f93bf3e7379de25eef6875d693be9bec81 +size 18015 diff --git a/AutomatedTesting/Objects/cylinder.fbx b/AutomatedTesting/Objects/cylinder.fbx new file mode 100644 index 0000000000..18ab200b4c --- /dev/null +++ b/AutomatedTesting/Objects/cylinder.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2949a50eec079a7d43a1d92e056c580ef625ee39e00e91cc25318319e37dcd3b +size 115689 diff --git a/AutomatedTesting/Objects/plane.fbx b/AutomatedTesting/Objects/plane.fbx new file mode 100644 index 0000000000..b274bfa282 --- /dev/null +++ b/AutomatedTesting/Objects/plane.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0a1f8d75dcd85e8b4aa57f6c0c81af0300ff96915ba3c2b591095c215d5e1d8c +size 12072 diff --git a/AutomatedTesting/Objects/suzanne.fbx b/AutomatedTesting/Objects/suzanne.fbx new file mode 100644 index 0000000000..171a6d21e9 --- /dev/null +++ b/AutomatedTesting/Objects/suzanne.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e3bcfac5de831c269dac58e7d73d1dc61eb8d9f6d8a241f5c029537b6bcdf166 +size 1088304 From 0bcb514c27299df1f09c8cdfe8e6e94247ff2f89 Mon Sep 17 00:00:00 2001 From: mrieggeramzn Date: Wed, 5 Jan 2022 15:56:53 -0800 Subject: [PATCH 334/948] removing qlocale.h compile issue Signed-off-by: mrieggeramzn --- .../AzToolsFramework/Tests/PropertyIntCtrlCommonTests.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Code/Framework/AzToolsFramework/Tests/PropertyIntCtrlCommonTests.h b/Code/Framework/AzToolsFramework/Tests/PropertyIntCtrlCommonTests.h index d4f0c8d705..1bd6f72a19 100644 --- a/Code/Framework/AzToolsFramework/Tests/PropertyIntCtrlCommonTests.h +++ b/Code/Framework/AzToolsFramework/Tests/PropertyIntCtrlCommonTests.h @@ -12,7 +12,6 @@ #include #include "IntegerPrimtitiveTestConfig.h" #include -#include #include namespace UnitTest From 09fd52ef73e199137bb1a38abcba7cd1242604a6 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 5 Jan 2022 16:07:52 -0800 Subject: [PATCH 335/948] AzCore Math tests produce errors that need to be disabled in debug (#6678) * Tests produce errors that need to be disabled in debug Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * PR suggestion Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Code/Framework/AzCore/AzCore/Math/Plane.inl | 8 +++----- Code/Framework/AzCore/Tests/Math/MathTest.h | 19 +++++++++++++++++++ .../AzCore/Tests/Math/PlaneTests.cpp | 11 ++++++++++- Code/Framework/AzCore/Tests/ScriptMath.cpp | 8 ++++++++ .../AzCore/Tests/azcoretests_files.cmake | 1 + 5 files changed, 41 insertions(+), 6 deletions(-) create mode 100644 Code/Framework/AzCore/Tests/Math/MathTest.h diff --git a/Code/Framework/AzCore/AzCore/Math/Plane.inl b/Code/Framework/AzCore/AzCore/Math/Plane.inl index 795ee8b4bc..22c449dc6f 100644 --- a/Code/Framework/AzCore/AzCore/Math/Plane.inl +++ b/Code/Framework/AzCore/AzCore/Math/Plane.inl @@ -26,7 +26,6 @@ namespace AZ AZ_MATH_INLINE Plane Plane::CreateFromNormalAndDistance(const Vector3& normal, float dist) { - AZ_MATH_ASSERT(normal.IsNormalized(), "This normal is not normalized"); Plane result; result.Set(normal, dist); return result; @@ -35,7 +34,6 @@ namespace AZ AZ_MATH_INLINE Plane Plane::CreateFromCoefficients(const float a, const float b, const float c, const float d) { - AZ_MATH_ASSERT(Vector3(a, b, c).IsNormalized(), "This normal is notormalized"); Plane result; result.Set(a, b, c, d); return result; @@ -68,21 +66,21 @@ namespace AZ AZ_MATH_INLINE void Plane::Set(const Vector3& normal, float d) { - AZ_MATH_ASSERT(normal.IsNormalized(), "This normal is notormalized"); + AZ_MATH_ASSERT(normal.IsNormalized(), "This normal is not normalized"); m_plane.Set(normal, d); } AZ_MATH_INLINE void Plane::Set(float a, float b, float c, float d) { - AZ_MATH_ASSERT(Vector3(a, b, c).IsNormalized(), "This normal is notormalized"); + AZ_MATH_ASSERT(Vector3(a, b, c).IsNormalized(), "This normal is not normalized"); m_plane.Set(a, b, c, d); } AZ_MATH_INLINE void Plane::SetNormal(const Vector3& normal) { - AZ_MATH_ASSERT(normal.IsNormalized(), "This normal is notormalized"); + AZ_MATH_ASSERT(normal.IsNormalized(), "This normal is not normalized"); m_plane.SetX(normal.GetX()); m_plane.SetY(normal.GetY()); m_plane.SetZ(normal.GetZ()); diff --git a/Code/Framework/AzCore/Tests/Math/MathTest.h b/Code/Framework/AzCore/Tests/Math/MathTest.h new file mode 100644 index 0000000000..783c08a553 --- /dev/null +++ b/Code/Framework/AzCore/Tests/Math/MathTest.h @@ -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 + * + */ + +#pragma once + +#include + +#if AZ_DEBUG_BUILD + #define AZ_MATH_TEST_START_TRACE_SUPPRESSION AZ_TEST_START_TRACE_SUPPRESSION + #define AZ_MATH_TEST_STOP_TRACE_SUPPRESSION(x) AZ_TEST_STOP_TRACE_SUPPRESSION(x) +#else + #define AZ_MATH_TEST_START_TRACE_SUPPRESSION + #define AZ_MATH_TEST_STOP_TRACE_SUPPRESSION(x) +#endif diff --git a/Code/Framework/AzCore/Tests/Math/PlaneTests.cpp b/Code/Framework/AzCore/Tests/Math/PlaneTests.cpp index 016a7ec6e2..398c1320ed 100644 --- a/Code/Framework/AzCore/Tests/Math/PlaneTests.cpp +++ b/Code/Framework/AzCore/Tests/Math/PlaneTests.cpp @@ -12,6 +12,7 @@ #include #include #include +#include using namespace AZ; @@ -47,7 +48,9 @@ namespace UnitTest TEST(MATH_Plane, TestSet) { Plane pl; + AZ_MATH_TEST_START_TRACE_SUPPRESSION; pl.Set(12.0f, 13.0f, 14.0f, 15.0f); + AZ_MATH_TEST_STOP_TRACE_SUPPRESSION(1); AZ_TEST_ASSERT_FLOAT_CLOSE(pl.GetDistance(), 15.0f); AZ_TEST_ASSERT_FLOAT_CLOSE(pl.GetNormal().GetX(), 12.0f); AZ_TEST_ASSERT_FLOAT_CLOSE(pl.GetNormal().GetY(), 13.0f); @@ -57,7 +60,9 @@ namespace UnitTest TEST(MATH_Plane, TestSetVector3) { Plane pl; + AZ_MATH_TEST_START_TRACE_SUPPRESSION; pl.Set(Vector3(22.0f, 23.0f, 24.0f), 25.0f); + AZ_MATH_TEST_STOP_TRACE_SUPPRESSION(1); AZ_TEST_ASSERT_FLOAT_CLOSE(pl.GetDistance(), 25.0f); AZ_TEST_ASSERT_FLOAT_CLOSE(pl.GetNormal().GetX(), 22.0f); AZ_TEST_ASSERT_FLOAT_CLOSE(pl.GetNormal().GetY(), 23.0f); @@ -177,17 +182,21 @@ namespace UnitTest pl.Set(1.0f, 0.0f, 0.0f, 0.0f); AZ_TEST_ASSERT(pl.IsFinite()); const float infinity = std::numeric_limits::infinity(); + AZ_MATH_TEST_START_TRACE_SUPPRESSION; pl.Set(infinity, infinity, infinity, infinity); + AZ_MATH_TEST_STOP_TRACE_SUPPRESSION(1); AZ_TEST_ASSERT(!pl.IsFinite()); } TEST(MATH_Plane, CreateFromVectorCoefficients_IsEquivalentToCreateFromCoefficients) { + AZ_MATH_TEST_START_TRACE_SUPPRESSION; Plane planeFromCoefficients = Plane::CreateFromCoefficients(1.0, 2.0, 3.0, 4.0); - + AZ_MATH_TEST_STOP_TRACE_SUPPRESSION(1); Vector4 coefficients(1.0, 2.0, 3.0, 4.0); Plane planeFromVectorCoefficients = Plane::CreateFromVectorCoefficients(coefficients); + EXPECT_EQ(planeFromVectorCoefficients, planeFromCoefficients); } } diff --git a/Code/Framework/AzCore/Tests/ScriptMath.cpp b/Code/Framework/AzCore/Tests/ScriptMath.cpp index 35541c5eec..927ea4a3cd 100644 --- a/Code/Framework/AzCore/Tests/ScriptMath.cpp +++ b/Code/Framework/AzCore/Tests/ScriptMath.cpp @@ -15,6 +15,8 @@ #include #include +#include + using namespace AZ; namespace UnitTest @@ -1409,13 +1411,17 @@ namespace UnitTest script->Execute("AZTestAssertFloatClose(pl:GetNormal().y,-1)"); script->Execute("AZTestAssertFloatClose(pl:GetNormal().z,0)"); + AZ_MATH_TEST_START_TRACE_SUPPRESSION; script->Execute("pl:Set(12, 13, 14, 15)"); + AZ_MATH_TEST_STOP_TRACE_SUPPRESSION(1); script->Execute("AZTestAssertFloatClose(pl:GetDistance(), 15)"); script->Execute("AZTestAssertFloatClose(pl:GetNormal().x, 12)"); script->Execute("AZTestAssertFloatClose(pl:GetNormal().y, 13)"); script->Execute("AZTestAssertFloatClose(pl:GetNormal().z, 14)"); + AZ_MATH_TEST_START_TRACE_SUPPRESSION; script->Execute("pl:Set(Vector3(22, 23, 24), 25)"); + AZ_MATH_TEST_STOP_TRACE_SUPPRESSION(1); script->Execute("AZTestAssertFloatClose(pl:GetDistance(), 25)"); script->Execute("AZTestAssertFloatClose(pl:GetNormal().x, 22)"); script->Execute("AZTestAssertFloatClose(pl:GetNormal().y, 23)"); @@ -1493,7 +1499,9 @@ namespace UnitTest script->Execute("pl:Set(1, 0, 0, 0)"); script->Execute("AZTestAssert(pl:IsFinite())"); + AZ_MATH_TEST_START_TRACE_SUPPRESSION; script->Execute("pl:Set(math.huge, math.huge, math.huge, math.huge)"); + AZ_MATH_TEST_STOP_TRACE_SUPPRESSION(1); script->Execute("AZTestAssert( not pl:IsFinite())"); } diff --git a/Code/Framework/AzCore/Tests/azcoretests_files.cmake b/Code/Framework/AzCore/Tests/azcoretests_files.cmake index 3777071168..834e3431b6 100644 --- a/Code/Framework/AzCore/Tests/azcoretests_files.cmake +++ b/Code/Framework/AzCore/Tests/azcoretests_files.cmake @@ -148,6 +148,7 @@ set(FILES Math/Matrix4x4PerformanceTests.cpp Math/Matrix4x4Tests.cpp Math/MatrixUtilsTests.cpp + Math/MathTest.h Math/MathTestData.h Math/ObbPerformanceTests.cpp Math/ObbTests.cpp From d378544bbc813d87db5b0a897e6024a914d72aae Mon Sep 17 00:00:00 2001 From: evanchia Date: Wed, 5 Jan 2022 17:06:44 -0800 Subject: [PATCH 336/948] Fixing crash log name bugs in test tools Signed-off-by: evanchia --- .../_internal/pytest_plugin/test_tools_fixtures.py | 2 +- .../ly_test_tools/o3de/editor_test_utils.py | 11 ++++++++++- .../LyTestTools/tests/unit/test_editor_test_utils.py | 12 +++++++++--- Tools/LyTestTools/tests/unit/test_fixtures.py | 11 +++++------ 4 files changed, 25 insertions(+), 11 deletions(-) diff --git a/Tools/LyTestTools/ly_test_tools/_internal/pytest_plugin/test_tools_fixtures.py b/Tools/LyTestTools/ly_test_tools/_internal/pytest_plugin/test_tools_fixtures.py index af29064766..1c17d6d519 100755 --- a/Tools/LyTestTools/ly_test_tools/_internal/pytest_plugin/test_tools_fixtures.py +++ b/Tools/LyTestTools/ly_test_tools/_internal/pytest_plugin/test_tools_fixtures.py @@ -413,7 +413,7 @@ def crash_log_watchdog(request, workspace): def _crash_log_watchdog(request, workspace, raise_on_crash): """Separate implementation to call directly during unit tests""" - error_log = os.path.join(workspace.paths.project_log(), 'error.log') + error_log = workspace.paths.crash_log() crash_log_watchdog = ly_test_tools.environment.watchdog.CrashLogWatchdog( error_log, raise_on_condition=raise_on_crash) diff --git a/Tools/LyTestTools/ly_test_tools/o3de/editor_test_utils.py b/Tools/LyTestTools/ly_test_tools/o3de/editor_test_utils.py index 9f1e01342c..54ac67f56e 100644 --- a/Tools/LyTestTools/ly_test_tools/o3de/editor_test_utils.py +++ b/Tools/LyTestTools/ly_test_tools/o3de/editor_test_utils.py @@ -10,6 +10,7 @@ from __future__ import annotations import os import time import logging +import re import ly_test_tools.environment.process_utils as process_utils import ly_test_tools.environment.waiter as waiter @@ -71,7 +72,15 @@ def retrieve_crash_output(run_id: int, workspace: AbstractWorkspaceManager, time :return str: The contents of the editor crash file (error.log) """ crash_info = "-- No crash log available --" - crash_log = os.path.join(retrieve_log_path(run_id, workspace), 'error.log') + error_log_regex = "" + log_path = retrieve_log_path(run_id, workspace) + # Gather all of the files in the log directory + dir_files = [f for f in os.listdir(log_path) if os.path.isfile(os.path.join(log_path, f))] + for file_name in dir_files: + # Search for all .log files with either "crash" or "error" because they could be renamed + if ("error" in file_name.lower() or "crash" in file_name.lower()) and (file_name.endswith(".log")): + crash_log = os.path.join(log_path, file_name) + break try: waiter.wait_for(lambda: os.path.exists(crash_log), timeout=timeout) except AssertionError: diff --git a/Tools/LyTestTools/tests/unit/test_editor_test_utils.py b/Tools/LyTestTools/tests/unit/test_editor_test_utils.py index cd361d9e8a..f7678c44c0 100644 --- a/Tools/LyTestTools/tests/unit/test_editor_test_utils.py +++ b/Tools/LyTestTools/tests/unit/test_editor_test_utils.py @@ -59,22 +59,28 @@ class TestEditorTestUtils(unittest.TestCase): assert expected == editor_test_utils.retrieve_log_path(0, mock_workspace) + @mock.patch('os.listdir') @mock.patch('ly_test_tools.o3de.editor_test_utils.retrieve_log_path') + @mock.patch('os.path.isfile', mock.MagicMock()) @mock.patch('ly_test_tools.environment.waiter.wait_for', mock.MagicMock()) - def test_RetrieveCrashOutput_CrashLogExists_ReturnsLogInfo(self, mock_retrieve_log_path): - mock_retrieve_log_path.return_value = 'mock_log_path' + def test_RetrieveCrashOutput_CrashLogExists_ReturnsLogInfo(self, mock_retrieve_log_path, mock_listdir): + mock_retrieve_log_path.return_value = 'mock_path' mock_workspace = mock.MagicMock() mock_log = 'mock crash info' + mock_listdir.return_value = ['mock_error_log.log'] with mock.patch('builtins.open', mock.mock_open(read_data=mock_log)) as mock_file: assert mock_log == editor_test_utils.retrieve_crash_output(0, mock_workspace, 0) + @mock.patch('os.listdir') @mock.patch('ly_test_tools.o3de.editor_test_utils.retrieve_log_path') + @mock.patch('os.path.isfile', mock.MagicMock()) @mock.patch('ly_test_tools.environment.waiter.wait_for', mock.MagicMock()) - def test_RetrieveCrashOutput_CrashLogNotExists_ReturnsError(self, mock_retrieve_log_path): + def test_RetrieveCrashOutput_CrashLogNotExists_ReturnsError(self, mock_retrieve_log_path, mock_listdir): mock_retrieve_log_path.return_value = 'mock_log_path' mock_workspace = mock.MagicMock() error_message = "No crash log available" + mock_listdir.return_value = ['mock_file.log'] assert error_message in editor_test_utils.retrieve_crash_output(0, mock_workspace, 0) diff --git a/Tools/LyTestTools/tests/unit/test_fixtures.py b/Tools/LyTestTools/tests/unit/test_fixtures.py index 32dc204bd2..eb36cf6998 100755 --- a/Tools/LyTestTools/tests/unit/test_fixtures.py +++ b/Tools/LyTestTools/tests/unit/test_fixtures.py @@ -323,20 +323,19 @@ class TestFixtures(object): @mock.patch('ly_test_tools.environment.watchdog.CrashLogWatchdog') def test_CrashLogWatchdog_Instantiates_CreatesWatchdog(self, under_test): mock_workspace = mock.MagicMock() - mock_path = 'C:/foo' - mock_workspace.paths.project_log.return_value = mock_path + mock_workspace.paths.crash_log.return_value = mock.MagicMock() mock_request = mock.MagicMock() mock_request.addfinalizer = mock.MagicMock() mock_raise_on_crash = mock.MagicMock() mock_watchdog = test_tools_fixtures._crash_log_watchdog(mock_request, mock_workspace, mock_raise_on_crash) - under_test.assert_called_once_with(os.path.join(mock_path, 'error.log'), raise_on_condition=mock_raise_on_crash) + under_test.assert_called_once_with(mock_workspace.paths.crash_log.return_value, raise_on_condition=mock_raise_on_crash) @mock.patch('ly_test_tools.environment.watchdog.CrashLogWatchdog.start') def test_CrashLogWatchdog_Instantiates_StartsThread(self, under_test): mock_workspace = mock.MagicMock() mock_path = 'C:/foo' - mock_workspace.paths.project_log.return_value = mock_path + mock_workspace.paths.crash_log.return_value = mock_path mock_request = mock.MagicMock() mock_request.addfinalizer = mock.MagicMock() mock_raise_on_crash = mock.MagicMock() @@ -348,7 +347,7 @@ class TestFixtures(object): def test_CrashLogWatchdog_Instantiates_AddsTeardown(self): mock_workspace = mock.MagicMock() mock_path = 'C:/foo' - mock_workspace.paths.project_log.return_value = mock_path + mock_workspace.paths.crash_log.return_value = mock_path mock_request = mock.MagicMock() mock_request.addfinalizer = mock.MagicMock() mock_raise_on_crash = mock.MagicMock() @@ -361,7 +360,7 @@ class TestFixtures(object): def test_CrashLogWatchdog_Teardown_CallsStop(self, mock_stop): mock_workspace = mock.MagicMock() mock_path = 'C:/foo' - mock_workspace.paths.project_log.return_value = mock_path + mock_workspace.paths.crash_log.return_value = mock_path mock_request = mock.MagicMock() mock_request.addfinalizer = mock.MagicMock() mock_raise_condition = mock.MagicMock() From 52ab5a1c0fb5f0744df0c879844ca3512b48109d Mon Sep 17 00:00:00 2001 From: evanchia Date: Wed, 5 Jan 2022 17:10:18 -0800 Subject: [PATCH 337/948] removing unused import Signed-off-by: evanchia --- Tools/LyTestTools/ly_test_tools/o3de/editor_test_utils.py | 1 - 1 file changed, 1 deletion(-) diff --git a/Tools/LyTestTools/ly_test_tools/o3de/editor_test_utils.py b/Tools/LyTestTools/ly_test_tools/o3de/editor_test_utils.py index 54ac67f56e..69c6eda2ee 100644 --- a/Tools/LyTestTools/ly_test_tools/o3de/editor_test_utils.py +++ b/Tools/LyTestTools/ly_test_tools/o3de/editor_test_utils.py @@ -10,7 +10,6 @@ from __future__ import annotations import os import time import logging -import re import ly_test_tools.environment.process_utils as process_utils import ly_test_tools.environment.waiter as waiter From e2a960e44296fe4a1a844abf1f90df2260cc91cd Mon Sep 17 00:00:00 2001 From: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> Date: Wed, 5 Jan 2022 17:21:15 -0800 Subject: [PATCH 338/948] Fixed a sync issue when a PrefaDOM was taken from a PrefabDocument. When a PrefabDOM was taken from a PrefabDocument the Instance would continue to have the data from the original Prefab, which means they'd no longer be in sync as the Prefab would be empty. This was fixed by resetting the Instance so they're both clear. Signed-off-by: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> --- .../Prefab/Spawnable/PrefabDocument.cpp | 10 ++++++++-- .../Prefab/Spawnable/PrefabProcessorContext.cpp | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp index c0eb5257b0..04fdea30d2 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp @@ -16,7 +16,7 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils : m_name(AZStd::move(name)) , m_instance(AZStd::make_unique()) { - m_instance->SetTemplateSourcePath(AZ::IO::Path("InMemory") / name); + m_instance->SetTemplateSourcePath(AZ::IO::Path("InMemory") / m_name); } bool PrefabDocument::SetPrefabDom(const PrefabDom& prefab) @@ -64,8 +64,14 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils { if (m_isDirty) { - m_isDirty = !PrefabDomUtils::StoreInstanceInPrefabDom(*m_instance, m_dom); + [[maybe_unused]] bool storedSuccessfully = PrefabDomUtils::StoreInstanceInPrefabDom(*m_instance, m_dom); + AZ_Assert(storedSuccessfully, "Failed to store Instance '%s' to PrefabDom.", m_name.c_str()); + m_isDirty = false; } + // After the PrefabDom is moved an empty PrefabDom is left behind. This should be reflected in the Instance, + // so reset it so it's empty as well. + m_instance->Reset(); + m_instance->SetTemplateSourcePath(AZ::IO::Path("InMemory") / m_name); return AZStd::move(m_dom); } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp index fd8ce43836..12625712b7 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabProcessorContext.cpp @@ -245,7 +245,7 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils AZ::Data::Asset(target->m_spawnable.GetId(), azrtti_typeid()), alias.m_tag, sourceIndex, targetIndex, alias.m_aliasType, alias.m_loadBehavior == EntityAliasSpawnableLoadBehavior::QueueLoad); - + // Register the dependency between the two spawnables. RegisterProductAssetDependency(source->m_spawnable.GetId(), target->m_spawnable.GetId(), loadBehavior); From 5f9a4a5eed421480094884b2b78ac309d2d77fde Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Wed, 5 Jan 2022 17:21:55 -0800 Subject: [PATCH 339/948] docstring clarification and addressing review comments Signed-off-by: Scott Murray --- .../editor_entity_utils.py | 95 +++++++++++-------- 1 file changed, 56 insertions(+), 39 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py index 4dd7ec1446..d354c4ece6 100644 --- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py @@ -22,7 +22,7 @@ import azlmbr.legacy.general as general from editor_python_test_tools.utils import Report -class Entity_Type(Enum): +class EditorEntityType(Enum): GAME = azlmbr.entity.EntityType().Game LEVEL = azlmbr.entity.EntityType().Level @@ -39,7 +39,7 @@ class EditorComponent: def __init__(self, type_id: uuid): self.type_id = type_id self.id = None - self.property_tree = None + self.property_tree_editor = None def get_component_name(self) -> str: """ @@ -52,7 +52,7 @@ class EditorComponent: def get_property_tree(self, force_get: bool = False): """ - Used to get the property tree object of component that has following functions associated with it: + Used to get and cache the property tree editor of component that has following functions associated with it: 1. prop_tree.is_container(path) 2. prop_tree.get_container_count(path) 3. prop_tree.reset_container(path) @@ -60,32 +60,36 @@ class EditorComponent: 5. prop_tree.remove_container_item(path, key) 6. prop_tree.update_container_item(path, key, value) 7. prop_tree.get_container_item(path, key) - :param force_get: Force a fresh property tree to be returned rather than using an existing self.property_tree - :return: Property tree object of a component + :param force_get: Force a fresh property tree editor rather than the cached self.property_tree_editor + :return: Property tree editor of the component """ - if (not force_get) and (self.property_tree is not None): - return self.property_tree + if (not force_get) and (self.property_tree_editor is not None): + return self.property_tree_editor build_prop_tree_outcome = editor.EditorComponentAPIBus( bus.Broadcast, "BuildComponentPropertyTreeEditor", self.id ) assert ( build_prop_tree_outcome.IsSuccess() - ), f"Failure: Could not build property tree of component: '{self.get_component_name()}'" + ), f"Failure: Could not build property tree editor of component: '{self.get_component_name()}'" prop_tree = build_prop_tree_outcome.GetValue() Report.info(prop_tree.build_paths_list()) - self.property_tree = prop_tree - return self.property_tree + self.property_tree_editor = prop_tree + return self.property_tree_editor def is_property_container(self, component_property_path: str) -> bool: """ - Used to determine if a component property is a container. Containers are similar to a dictionary with int keys. + Used to determine if a component property is a container. + Containers are a collection of same typed values that can expand/shrink to contain more or less. + There are two types of containers; indexed and associative. + Indexed containers use integer key and are something like a linked list + Associative containers utilize keys of the same type which could be any supported type. :param component_property_path: String of component property. (e.g. 'Settings|Visible') :return: Boolean True if the property is a container False if it is not. """ - if self.property_tree is None: + if self.property_tree_editor is None: self.get_property_tree() - result = self.property_tree.is_container(component_property_path) + result = self.property_tree_editor.is_container(component_property_path) if not result: Report.info(f"{self.get_component_name()}: '{component_property_path}' is not a container") return result @@ -99,7 +103,7 @@ class EditorComponent: assert ( self.is_property_container(component_property_path) ), f"Failure: '{component_property_path}' is not a property container" - container_count_outcome = self.property_tree.get_container_count(component_property_path) + container_count_outcome = self.property_tree_editor.get_container_count(component_property_path) assert ( container_count_outcome.IsSuccess() ), f"Failure: get_container_count did not return success for '{component_property_path}'" @@ -107,21 +111,22 @@ class EditorComponent: def reset_container(self, component_property_path: str): """ - Used to rest a container to empty + Used to reset a container to empty :param component_property_path: String of component property. (e.g. 'Settings|Visible') :return: None """ assert ( self.is_property_container(component_property_path) ), f"Failure: '{component_property_path}' is not a property container" - reset_outcome = self.property_tree.reset_container(component_property_path) + reset_outcome = self.property_tree_editor.reset_container(component_property_path) assert ( reset_outcome.IsSuccess() ), f"Failure: could not reset_container on '{component_property_path}'" def append_container_item(self, component_property_path: str, value: any): """ - Used to append a container item without providing an index key. + Used to append a value to an indexed container item without providing an index key. + Append will fail on an associative container :param component_property_path: String of component property. (e.g. 'Settings|Visible') :param value: Value to be set :return: None @@ -129,38 +134,44 @@ class EditorComponent: assert ( self.is_property_container(component_property_path) ), f"Failure: '{component_property_path}' is not a property container" - append_outcome = self.property_tree.append_container_item(component_property_path, value) + append_outcome = self.property_tree_editor.append_container_item(component_property_path, value) assert ( append_outcome.IsSuccess() ), f"Failure: could not append_container_item to '{component_property_path}'" def add_container_item(self, component_property_path: str, key: any, value: any): """ - Used to add a container item at a specified key. In practice key should be an integer index. + Used to add a container item at a specified key. + There are two types of containers; indexed and associative. + Indexed containers use integer key. + Associative containers utilize keys of the same type which could be any supported type. :param component_property_path: String of component property. (e.g. 'Settings|Visible') - :param key: Zero index integer key, although this could be any unique unused key value + :param key: Zero index integer key or any supported type for associative container :param value: Value to be set :return: None """ assert ( self.is_property_container(component_property_path) ), f"Failure: '{component_property_path}' is not a property container" - add_outcome = self.property_tree.add_container_item(component_property_path, key, value) + add_outcome = self.property_tree_editor.add_container_item(component_property_path, key, value) assert ( add_outcome.IsSuccess() ), f"Failure: could not add_container_item '{key}' to '{component_property_path}'" def get_container_item(self, component_property_path: str, key: any) -> any: """ - Used to retrieve a container item value at the specified key. In practice key should be an integer index. + Used to retrieve a container item value at the specified key. + There are two types of containers; indexed and associative. + Indexed containers use integer key. + Associative containers utilize keys of the same type which could be any supported type. :param component_property_path: String of component property. (e.g. 'Settings|Visible') - :param key: Zero index integer key + :param key: Zero index integer key or any supported type for associative container :return: Value stored at the key specified """ assert ( self.is_property_container(component_property_path) ), f"Failure: '{component_property_path}' is not a property container" - get_outcome = self.property_tree.get_container_item(component_property_path, key) + get_outcome = self.property_tree_editor.get_container_item(component_property_path, key) assert ( get_outcome.IsSuccess() ), f"Failure: could not get a value for {self.get_component_name()}: '{component_property_path}' [{key}]" @@ -168,31 +179,37 @@ class EditorComponent: def remove_container_item(self, component_property_path: str, key: any): """ - Used to remove a container item value at the specified key. In practice key should be an integer index. + Used to remove a container item value at the specified key. + There are two types of containers; indexed and associative. + Indexed containers use integer key. + Associative containers utilize keys of the same type which could be any supported type. :param component_property_path: String of component property. (e.g. 'Settings|Visible') - :param key: Zero index integer key + :param key: Zero index integer key or any supported type for associative container :return: None """ assert ( self.is_property_container(component_property_path) ), f"Failure: '{component_property_path}' is not a property container" - remove_outcome = self.property_tree.remove_container_item(component_property_path, key) + remove_outcome = self.property_tree_editor.remove_container_item(component_property_path, key) assert ( remove_outcome.IsSuccess() ), f"Failure: could not remove_container_item '{key}' from '{component_property_path}'" def update_container_item(self, component_property_path: str, key: any, value: any): """ - Used to update a container item at a specified key. In practice key should be an integer index. + Used to update a container item at a specified key. + There are two types of containers; indexed and associative. + Indexed containers use integer key. + Associative containers utilize keys of the same type which could be any supported type. :param component_property_path: String of component property. (e.g. 'Settings|Visible') - :param key: Zero index integer key + :param key: Zero index integer key or any supported type for associative container :param value: Value to be set :return: None """ assert ( self.is_property_container(component_property_path) ), f"Failure: '{component_property_path}' is not a property container" - update_outcome = self.property_tree.update_container_item(component_property_path, key, value) + update_outcome = self.property_tree_editor.update_container_item(component_property_path, key, value) assert ( update_outcome.IsSuccess() ), f"Failure: could not update '{key}' in '{component_property_path}'" @@ -252,7 +269,7 @@ class EditorComponent: editor.EditorComponentAPIBus(bus.Broadcast, "DisableComponents", [self.id]) @staticmethod - def get_type_ids(component_names: list, entity_type: Entity_Type = Entity_Type.GAME) -> list: + def get_type_ids(component_names: list, entity_type: EditorEntityType = EditorEntityType.GAME) -> list: """ Used to get type ids of given components list :param component_names: List of components to get type ids @@ -426,7 +443,7 @@ class EditorEntity: :return: List of newly added components to the entity """ components = [] - type_ids = EditorComponent.get_type_ids(component_names, Entity_Type.GAME) + type_ids = EditorComponent.get_type_ids(component_names, EditorEntityType.GAME) for type_id in type_ids: new_comp = EditorComponent(type_id) add_component_outcome = editor.EditorComponentAPIBus( @@ -454,7 +471,7 @@ class EditorEntity: :param component_names: List of component names to remove :return: None """ - type_ids = EditorComponent.get_type_ids(component_names, Entity_Type.GAME) + type_ids = EditorComponent.get_type_ids(component_names, EditorEntityType.GAME) for type_id in type_ids: remove_outcome = editor.EditorComponentAPIBus(bus.Broadcast, "RemoveComponents", self.id, [type_id]) assert ( @@ -468,7 +485,7 @@ class EditorEntity: :return: List of Entity Component objects of given component name """ component_list = [] - type_ids = EditorComponent.get_type_ids(component_names, Entity_Type.GAME) + type_ids = EditorComponent.get_type_ids(component_names, EditorEntityType.GAME) for type_id in type_ids: component = EditorComponent(type_id) get_component_of_type_outcome = editor.EditorComponentAPIBus( @@ -488,7 +505,7 @@ class EditorEntity: :param component_name: Name of component to check for :return: True, if entity has specified component. Else, False """ - type_ids = EditorComponent.get_type_ids([component_name], Entity_Type.GAME) + type_ids = EditorComponent.get_type_ids([component_name], EditorEntityType.GAME) return editor.EditorComponentAPIBus(bus.Broadcast, "HasComponentOfType", self.id, type_ids[0]) def get_start_status(self) -> int: @@ -690,7 +707,7 @@ class EditorLevelEntity: :return: List of newly added components to the level """ components = [] - type_ids = EditorComponent.get_type_ids(component_names, Entity_Type.LEVEL) + type_ids = EditorComponent.get_type_ids(component_names, EditorEntityType.LEVEL) for type_id in type_ids: new_comp = EditorComponent(type_id) add_component_outcome = editor.EditorLevelComponentAPIBus( @@ -711,7 +728,7 @@ class EditorLevelEntity: :return: List of Level Component objects of given component name """ component_list = [] - type_ids = EditorComponent.get_type_ids(component_names, Entity_Type.LEVEL) + type_ids = EditorComponent.get_type_ids(component_names, EditorEntityType.LEVEL) for type_id in type_ids: component = EditorComponent(type_id) get_component_of_type_outcome = editor.EditorLevelComponentAPIBus( @@ -732,7 +749,7 @@ class EditorLevelEntity: :param component_name: Name of component to check for :return: True, if level has specified component. Else, False """ - type_ids = EditorComponent.get_type_ids([component_name], Entity_Type.LEVEL) + type_ids = EditorComponent.get_type_ids([component_name], EditorEntityType.LEVEL) return editor.EditorLevelComponentAPIBus(bus.Broadcast, "HasComponentOfType", type_ids[0]) @staticmethod @@ -742,5 +759,5 @@ class EditorLevelEntity: :param component_name: Name of component to check for :return: integer count of occurences of level component attached to level or zero if none are present """ - type_ids = EditorComponent.get_type_ids([component_name], Entity_Type.LEVEL) + type_ids = EditorComponent.get_type_ids([component_name], EditorEntityType.LEVEL) return editor.EditorLevelComponentAPIBus(bus.Broadcast, "CountComponentsOfType", type_ids[0]) From da0a10bb4cde930c7266bbb24d2cd6f5f7dedfbf Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Wed, 5 Jan 2022 19:04:55 -0800 Subject: [PATCH 340/948] fix for edit SC action in entity context menu (#6686) * on demand reflect az events when they are the return value of ebuses Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> * fix crash and functionality for edit sc editor context menu action Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp | 6 ++++-- Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp index 9bbdddfedb..1b5e97ba36 100644 --- a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp @@ -265,11 +265,13 @@ namespace ScriptCanvasEditor action = entityMenu->addAction(QString("%1").arg(QString(displayName.c_str()))); - QObject::connect(action, &QAction::triggered, [assetId] + QObject::connect(action, &QAction::triggered, [assetInfo] { AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); + SourceHandle sourceHandle(nullptr, assetInfo.m_assetId.m_guid, ""); + CompleteDescriptionInPlace(sourceHandle); GeneralRequestBus::Broadcast(&GeneralRequests::OpenScriptCanvasAsset - , SourceHandle(nullptr, assetId.m_guid, "") + , sourceHandle , Tracker::ScriptCanvasFileState::UNMODIFIED, -1); }); } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 6222d902da..1176df61dc 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -1139,7 +1139,7 @@ namespace ScriptCanvasEditor auto loadedGraphOutcome = LoadFromFile(fileAssetId.Path().c_str()); if (!loadedGraphOutcome.IsSuccess()) { - return AZ::Failure(AZStd::string("Failed to load graph at %s", fileAssetId.Path().c_str())); + return AZ::Failure(AZStd::string::format("Failed to load graph at %s", fileAssetId.Path().c_str())); } auto loadedGraph = loadedGraphOutcome.TakeValue(); From 23293a13c14b90402c9aee42dedfbf53cb3b0934 Mon Sep 17 00:00:00 2001 From: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> Date: Wed, 5 Jan 2022 21:51:42 -0700 Subject: [PATCH 341/948] Improved DiffuseProbeGrid blending around the edges of the volume Signed-off-by: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> --- .../DiffuseComposite.azsl | 2 +- .../diffuseprobegridrender.azshader | Bin 240003 -> 219075 bytes ...fuseprobegridrender_dx12_0.azshadervariant | Bin 32631 -> 30575 bytes ...fuseprobegridrender_null_0.azshadervariant | Bin 589 -> 589 bytes ...seprobegridrender_vulkan_0.azshadervariant | Bin 24581 -> 24081 bytes .../DiffuseProbeGrid.cpp | 22 ++++++++++++++---- .../DiffuseProbeGrid.h | 5 +++- 7 files changed, 23 insertions(+), 6 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseComposite.azsl b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseComposite.azsl index 9aa169beea..e3237e59a2 100644 --- a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseComposite.azsl +++ b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseComposite.azsl @@ -150,7 +150,7 @@ PSOutput MainPS(VSOutput IN, in uint sampleIndex : SV_SampleIndex) float4 encodedNormal = PassSrg::m_normal.Load(screenCoords, sampleIndex); float3 normal = DecodeNormalSignedOctahedron(encodedNormal.rgb); float4 albedo = PassSrg::m_albedo.Load(screenCoords, sampleIndex); - float probeIrradianceBlendWeight = PassSrg::m_downsampledProbeIrradiance.Load(probeIrradianceCoords, sampleIndex).a; + float probeIrradianceBlendWeight = saturate(PassSrg::m_downsampledProbeIrradiance.Load(probeIrradianceCoords, sampleIndex).a); float3 diffuse = float3(0.0f, 0.0f, 0.0f); if (probeIrradianceBlendWeight > 0.0f) diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridrender.azshader b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridrender.azshader index 781d7e26e514ab7a100ea668bd864c3b9ef1f0b9..1f045706254b0b0c859f4bc976030ea3b50a5844 100644 GIT binary patch delta 2922 zcmeHJeN0 z()sn48w~~n8#CU?+%=7hYP^p;v!My6&l07YtnF4mGf9@KJ z#vF?V54cDrwjZR~xOg?(rJWbMIMIb3iKesJkj%nr3Jd-qvqpa|dTMDGD%qr0ND>y; zP#MP>VJQZe5t+3gx3ad7jLHP0G5^JlY}G_Q2JWR+v{izYxyEJ9IkshzF3lP1y`cYF zzY}Qpi#4|IWemE(j-wewMq4`R6ASFPNl2_@Kw^`lGE*!@YzRRr^L#5azatBO$`!WC zO=N$>`TlKUgPvTn_m$A~7Q(O{z6L`6L@*M#@I!NE)-`oN6^~73KO34bY zd`!*(Dl3UeJzINVQR4A%VQ{s8b@%6>cL)|Jd<{_eFLE|%QqNpDP5zj;kBTjZzL)d8 zVRyBGUq$M-{7X6ybdV^WQ54~mkjbiVDAH~^zj+vZmj9zBqo~PEnEN1DuqB`N=%XJ2 z9PIFk23;E73C~AH?8~w|TyG&ccz6aj%}=qalRM@GEa`=1`016He(R|{^E%(!r}c5m zItO1KP=y?jFTXr@(m}mVq9ZZWG1HXYDI1@UQY$O%k;b=IhS@=#z z55~C*`eT@ROd9Tp3&E&>!lsy|R@t!Z+1Qb2Zrj&V9aC(_hDE!fS;Vk?Db)U5V>~w4 zxwAFYUm9P~f!O&?JDgS40lscc?gs-n6&guu7gy(QlxXv PTeDy6z2!fY_0it}yUs(O delta 6935 zcmeHLdrXs86z}=I7D^Q;C`gMHG>TImtuixBoY24)MCGNRa}KFe1t;R8^${JbqMM?V z$AO*9*F+7Qq5-Y)8Rr8tgR&tnXW}v+MJKwAOo@LjPT1{hiopf5#bsIl;ePktbIy0p zE%$eR-|y=x&-^Q1)uY6c4|Z)mqc%r~(*Zl;LuK+fefGjELym4K4w=#c99q6p07unX zzy^$(x(VfDBv^N4q+6`spvzv&tQLU?)0ve>sLtnx0Gg7-)Vh)L6V$t5vy2{9K!jJO z&3Ky5pkJP?TTJU8g9@wN62OF74+XCfiRk=RPD^{Aa4K`b)}wCtp;Cggd_&~&oVi)f zj3(#k7UJGpSyZIwJn$Xg5mem(;sHHEPtJ5&m8p3N9E>gLoAtH4WmGA`!Nwh6zKeKq@vvAJ9eLz*y>mUbn_C1JT*L1$Yb66N830|z)A z;&h7_BxSGGFHT*FoktZg3t^6qny!OHYW+vj>gLU}uH&+Im6)MXVRKDdug(NDTsl@q ziz%-ayv*Z;aS+(^T%SovzZ{oMQqvwOsLhK`?)2#SKI(LbbfM@b#B#6{&+~(%zx*`e z#{IQnG1TG#V{pfXOzDA&?Gfz-+MRebCF0Y5{8;q98RPc;8bfN62|@J53XFSq1l#yU4lk_{j=%NZ>Lg30?X7@uvE5!c62 zMh7S)~X?OD4 zHTSA4CLziTDrG`Z3ZE(#G&A`5ys$4Aj4l@7VgW7|@G>kw@O%hTDMjbPKF4(NxgC8aNaZ>EQBRMvsIFttOf+sGj;GzmHs^Fpu|1wpuf>*PwFSxZb)J`Bg zJc_?4tZSIjAQC3N&42FEgFy_N$n}vyY_NS_pT83JLLC7Dsc9n@KukqA3o5hDt={9m zswI%7hVjkYsi7`0fr$y2SCPrIg|^U-+28VZ4bC~|i;dxfXs?(HEQwIUU}`DlBC%+r z7}eovZ0Zvar8bXnd~hZRvky*Xi`qIUW5dt{&`{MiCd?EZV#_RSI2B%m)$DQTSPeFv z@~4DLVBgVT^x>Iyp90%{i8anQP|SvwMA&9`FL`~Q-I;6kq!FvTbTD#Bwy0!xot1*mQ^;vu)D=dN30f+ILwB^hnn^vJt3?v_K6F*@K2kHo8JsXsqlINgu0cgGVcb18QN=TvK~ z+XCC}3Kcd99M`uG9T!afZ#7RBOxY061yg-fj$aH@R^4kZYa^X)p#7Wjmz_v3;i@kR zSQ@CTV%UjSsDat#xju+s5Xf}AIGT1FR{diVSZi;6px8-no$!A_Ev+6Ud$jJ>LHFkg HEb@NE2SB|uTfG_i1uL>-z*K9#S5M;gr zu0p{HEroAm z=%^d;LkwR?VNppqsZvBC=n>PsP>>DsF`h7TlA=#DTzgA${zpIEelBf`o{tQTU7AQw zI9m&ynQ(5^Ge5V>p3HdLbh?c1n9b00PxW^2slN6?O9I8^aWq0`nh&Pgn{6hEr$M&XJ#vkzckFpC*u}*jmR# zl6waS^)|Lmd`l42<-TYj{9%uM=NfdJ`n`;V7D05le6^EHL3;8Yd>TJ9u|O>?4S$HA zp6rTGR^ZpNIlnonyt7MIJKXgq2p@e($MKZ9Ar?aQ+w_*h{zNO-!(C$)r13n5{EV$t zokRXrM1DDjw@E8m7O1_H`5l+gp|Mot6JZlpjO%1cKNY>kpL{Y(0 zO?V^DfveOT6q`(y8c(3~+c>6er6xUM(;klLdq}O(ifV-#>tQb#?=SLkg23xME*LT1 zD+u?!m%J|(qeq0;r96nTyB@y0dZiaVJvk>ck%~X$mw6x|Gl7ra>X(_s#vdwBOD5nG z(=rdwVf4nxiWqf{VlZn3ak6{1o^7y%Im$=bNli1!`pcv|CZ z@`4NI9$GJQ!L)tBICE*3v91L{4b8V^!5H>RYH%7pwJS3z4S!(4<*0;9OmNc@Zdaq( z>tV^7<+c}P-9qiQFw4iUuYR9fnKgEP_lfgM)htBj))r^_k@O>Ki?L?H+8X+BDM@#| zXTS6yAv0A3hLE{Sk$FUvnaJh{F2x!Tn;TCGOh-lfJt(uOQqu|GF_GSOf&QCTg<=%7N&2wMA|4uPh$MrZ)msL>RyuU97MK*vYhj zZm7-8$yT>s---2h(x=nuZ3JjZfP&x)ohW6)hslA2Riz?b;@6NG{4X-YmrnFhQ1HZ6 z3I&GfsTji$*D4rl#LWtx8gZ*aq}EgB8sH?dPv_w*p{1PDhLEHe;zi&@R?bj)0ZP$9 zg3NbAQw(^6)=q~L&X8UKirz|sOrjuy8;0F&2yMCx^(W#)16#F^!7SPX&-5P2r1}I~{ zOm(k;SjHI*=T9@zf4w#yYJIzW!d0OKO?Rk;g7=($&_4qd8i-SmB!1Oijst zQyTi^FrE6eP9TzUJ-a|p1L@rZoR*4a;0~Qvtt18kV-dS6Q4kTGl0?hy@MJgvrRjsO zzS}yP>YI68={JUHP-75)))pGUG(>CHF@@(NjPWnw#uMR^Is7{YXAW}|$oR9)y!JE@ zX-30&cFhT;{tpax6dIarEE>gG4rtAgz({U19xY9;E8JO;J5UP5|J53U0;6C5V4I1t zs@V%It|n*()I^$@=U0@JB5G2U_Yo^?dT?&EF!&5@XCY#zFN2I8f}XXtNr;VDRP}iN zV-#+Gt@!}Pu^|0F!l~1L6LPi9bJe|UUbbUVdT#_${`sy9XdR2-dm@H9L=Vzl6T2%Z zS&*2#E-u19E+R6GmMvR{jNcX5*FsW)qRK#=iBY>^ccp^Ac!}|QBg2!Uh4FELg5<>LG+K_#H|wa%(3}3*^yB>w ztN4t^yS?w~H`obpNzWV(vZIx4IGiLsW7n{cSO#xs zFQ)4qtVQ{E%7*dTTwv9-kWY#|Z0WAc<+SuwAi4!oh@QX+yCo&+R2k|?>!-0I6Zo^= zz=WRvb#i%4P0ZaZAOEeg1(RI$?>?b~Hv_!qugeVta^5V+x!1g40?n3YFdv!+`hdJO zKwgaG8Y0iOseaopiL~tU&lzh$gp5Uf8c+V@ZkKd@-&d(W>*EZ3zSn2D!AGNQ!~YnTjS!4$qtZ_ej4P7=sqEJSSay zLuim&NI#GE=TbJ0TUisX@O5;tQwCX{$B`5|pHHu~A59E*of)0!nV9Th(YukRO2jDFmN{Olcf6^}I$ygu zI+in7&XW0PQhGYl-k2ONJ^bgvc!G58|;$G_I(vzwm}-c!43wIT!ln3 zPHG6Uc--e<$U-!~GDXG-!eSzQqId63Ns3(W4}xqr;}9ej--8Q4YM)g#($&3`MCPN3!MlT_EUN!qJ`Sj@-RyGngX8L* zRgR-b;KRChF!2t2Xx?$aW1iA0$QTQ+yWFb3?&RYB)#@Adz|+piHpnLa-x^#+rytzdIBic3-l zww{0Pv-reVL5x?l08C*AhTla>7wJ(K;9hP!}&9`Rp7pcgXO94zXjx+``@Zr?XMV^dwT0%Wb* zZ8*yjT6R2`-+REicsyS{U0zd|F3;as+MVAgEN!XF1#4q4SR0Q?|Dy@q;*40j{u0y0 zvf0JOy`i?w>0+bXO<-_jLD8UPTO~6Fz=EPs*^9Nx`gLdLtBBpKZN4sG^nUm|+Q7^K zs?l!}9P|++3w#l)fuVcpgWUR*e;I7qTZtc(7Je9d?^NK`71_wf9jNPX!c76QeqLSw z{JIu-IBnD6AXc>!>-vc|ax}hCXiO%MXGG-R8Cq|7TB`)Q9{Y9oDfJV__3IsJ zH#oE>0@L62oBqKud%MwWX_$pwq6I_8(#gs4#u>YbO%5+Nt^Divl~s_FrMFWR&*>81 zsVc#VmE?Ra+@rb7qvf&3n67ZmV`omKOtUpZ$uRq4gmV6e41tZ=%R+jiBp`+`l<6B3 zTvU8-2&w^n&;p>2=)&P33=LsFQf1NL^w}r(wN?EWIb~YlLsTXSFn)uQxGn zHmiGyHS7mRC#NQX>m2$EHh8=Xvn+Ewm-=ee`XAV z_ArlL>6P(o*fwhyu+d;Gr5ELlHxH-Rfh}*KdbWE+nnThaK}2L?V0=VmOpv6UWccOD z(2>y{C8NP3qj~(VV9`!JSE|{|E8d`!b6Zo-`LNa*_-@aHUq)Erz7 zK{)W~3V!^+PXqXw1wU`W&9}A<9nRmQmcChrm=A*fQvav<#=!ND=KB+-V~SCmRq(jF zA(r(9C2TW2{r%$?X>4LTn@$0i79$^i4u@6bC~8|yl2J6eD7x%~B#Xx|4U+vcm&d|=Fip@8q)j$hdI6gb^qT+T zqk({=a5_SI))-mIgbW04+I6|fnW#RiIskKZog54ZbVakKrjAzuz?UOSCeHg7iFV(w zyhyjui^+0E^UzvHPf!TFJ*OaB9MCo!?Xx^%8Tf=EiYy5|W9kZb|0!`BrBz zfO~BJgGwM>1j(NnI)DLt{qC(W)JLmTU#vz8Ymo6`(GxeLZ@gDOOz3`2$=GAn5pCsz z1)7@k#al&Tkq{PQ+7amUBe+LI0W&4r`GDtmR~c38Dgu3s z7rg)Fx;Emw^eMINsNYTgLAouQ+<0<#vvtYv!%4qliibzZ?S z5%2BWR%_(C`#I-l?dN6z7%eIsgJV5ho%!P?gG!Sr@sh!D<9;y$a{K;RgdwA}CqoFY z_Rq6uz`r3>@5_%Y+LfX4w4XfJN`Au7n49|t2>&&55eUCb9^@i8)QJueAl(9g6-jnM z=|3_z85Nrbo15H4nM^6Qcofe?ix2%ex-j-K>1vs`M;^vAPr4fL<7)poKXhxpc##QBbhO)Ku9~%Zz=Sg>(y4SKdzJ>! zOa!Kis5b%+2M{d*qu2C)O4oYAAivBZKOZBHw|?Zr42>xYd18+I8Zi5Q)5X9z(=PyF z(|QC5Ey99&315YU8TNje2ZI-p>4f-282kdp^!WBHRf$05mNP_0CWAN*Y5l>|n&Ewv z2}I2;7WHia${P^{k_J+d5El-DAXsS^R%+TNHeT=q^iAL*j6W2@XpdGEK-g#s%vN`z zg38BCj@GYpA7tn`as@XAFEQt z4Ul-+7-ci6LdeH@E)Koq=@N;r=O3)MS>-t-le9&vBI$sM%{OnDX7_9q+Gat zuO-A>o?~PqZnH_(7J1o7&(J$b(5l^#pA&`+8$uTWf{w(An9fjRA&P#N1f}eT_BdkL zCk&y0UWgKg6Oo;v2tcRXNRT$T#h542!UYt49!39^1bG5V?T%p&7(!>jtz?|25ClnnHTem`IQy5^~C`_ZK&md0j z$njIlYbaf3fztXE*o`d*mivuwyBoGNDyGmH5zyt%?wVkTE0T8Kk3_voHo)* z9j6s~EJDaiE+w>dsWqXd71my#gj?yzNmDxqpICno=jh1EQY(Pf{kChgak&(UO98!C z!flB2TZh8!4U_OSm~gXyzs9(=H34PHr6en@8}b4OC~(m6u`c?W93bXBI2Tedx@||% zj)$Y?c7Q*z<`i(CN1Fzw4T+sO1Yf{t8oiuNQ^sNv*pHc;%T|41$=dUnl^Blj=MIEF zx8&&RV!voT{tx_|pytBUa*Ev*5uLPe(+Aot^DIiP#6$sJCiH%cPZ^ur^Uf(;!vi_j zJs*&HndE`peraZg-gN5--|BV0!pp?9{Qfr`)59H#N0WodX8z0G-pQUR7Pb2bvx(DZcdZ!>D_zSXm5<^61GxUaQx4oyPM%B(C(k(3hU|YQ6S?J0VrjDzlUFSM*N_MU$=LD!D zEE!?kkkG0L@b#6~orKQr7n#U8-=fcSNZejAtFa=xZ)UkXn;a|6z3m5+RmS;BY8e0n zNsfbWI3}(U_rK|H8}7~NK~8_b1li0|V1kP4E1R9`tXysaqQbnn`Z5zaJa4kpv>g%y zlJlsn?zFp2y5@1aVX@l{LUtEHKHMeeQg(KZFS926GNuc*-s@Rdk9rOxEuwu4AJ=br z1hC7gwuz||qX1iU^~?cDrO;LGF&(Wo&a-Z7#O3k1bF(+CyMynv%phw z(#M0NgaUY?WjE~m`E+Zk@dCbY&QI@-K3e$k*T#x#`F(DmuC1zQzBm7GAO*bz9D|Px zz67I3c&+dQhn^k-mZSy-fgFLl}x%X9E6DsTSRn*cEDe7pp+-n{H zI&K3xRt}a2nB<{7KRM{@=0=w5^?KVIF7B5aotZa3;P*K&nIpCsZM`Dh#7BtAJbqVu zeRk6Kdlf)_3C>;sGK5wL{|{770c0a$tI>Ag6Z5Q}8=sRJ7Xd7ur zi>t!z7DH|9H84MqRiMrRQ-lFi2tU-Q_NNFU79;Iegmc_rK1STSsHF5vzT){zpWJqq zB#)b_xhs#8P(~5gp6d(+t{q+o$lR7f;K$Hmw$;>N`JIdzZ{1bVx~{pfyAt+%0rSlB zgEr=GJ-8%9cx6fG$dX;^28nJ4DTQ>u*X%2^`|PW0xDKS{T!-qKY%s4to^9NKjtEVJI;fMnnPeeWc8Nwf{&`-oEKL$s=5=^;=G z0bq}I_%Li)bswPO!5NS#^X`AsDSXsf`RG#TL{HCXIl_TJ8oSM`2l*!d>y3QD448Wq>rH6~FV7q+*N#Tb)V6Yy&9i*m=Exto+ z|8VEsUr>Yp2yQ6@*!*B#= zXCM+o#c<91sUB*9$DsoY`us07?46^*dF+UzU2eOwCZ zOaYzoC)k<%C6Ls?Q~a}?pr=xq0dH~&9CzEEtuV4il#Jl#E^a&gm^ zrNM$&J8!4>&wc4ds%({L(0}^e=ew(E)-9zkqicGb3U-$ns&-@s_=q3 z4G^@(Li!$1-6o`pJBvf_hZKQQilDd?cp__*rg8zeu)lb>)^w}TT!lNWmz-Vpr>_B0 z)Itj9mtKIyv8%CVB>!4|^T5U@%6u@S=4iiCFvUqK*sd2k99;AOxUjSsw`96?9F5Ro z7LvyhS~_!Sf4X~DS1W>L-R@oUPk(~gD`YWKou1S4;bOpA;` z3P|xqC6&@_eMCfI&`#RM`^Gy99t0b1G5o^t0oc!tAvwe)@LxlmPCNoyNw)E)u5z!& zIK(0woxsPsDPsvLTE36i4lw&iU=B7Or9aBnnYbQNQPuO0ChoTl%LdyfSyW;76f**> zn=}=M2ier4w6PZ1ceu+#z#^x@x!E?cryKyrt|n+b>#ONSGRjMkQQS&!DbuayIAr8! zt(F=1p4A6v-8UT+2Qy!F`T{#{zHC_Ro{%+9r@N8WqdC8?PsOJZJPl0plUnp=AWmSp zm5C56{01Nzeq(+OqG5$fpVHd8RS2kF&TOuCYjk0OZNwZxs#A?dKt4A_%oGw-RGd3n zOe+Z)4mSK?uMw;{l&R_K zuQa&VU_2VaJ#I93e51Q&B594TEQzjR3Tl+`G4Y9;FI9h2**0;vXNnItR{v)DUS9*w z0F+mvqt=8eo_;8}4R+;1)wUeez)YCFujU&-$E*oY`TFxwb7o?qt!uDtw6ljr>3+|| z%}30~5`w1BrnPc2hN>V0jH&T}ZT0%c8)&mS=5=OMJ)`+bE!Y@1HEa5uS*sZmW78`+ zHiH+wjFRNYI=~A((#}e$Fh-j5=MPwMPo}2NFRMCn2s;7#UH8+Dkkp2t4fn4ocO?&P;N@_rkwKY~yH z(R%v*oYsFBxw-;vJ!P)(3vClaT_;;z=MaO`W`iSchIz*g3tyxc3hN4sU#OiQNI(BV zt;C;pjdS5;wAt(9W^YH#{(5oYZ*_BR3!o5{P7`TL_j@gCG-sD;w)4GgnH*kb!!V_q zBEMA2bg8_e-bU?j#|lW30&hN-(#ZzzJ%v-WXtGNqwbbX2y;fqq9hn_D=HAXeQ9aZ9 zmLtjCzFS^R62?myxH$%gDg|#%Ws5zy6m$~!gX0ksoMBX7N|Try8ztCeCKHC~{rzOe z!uo$-B*GqcAYQXkps^%rn9f|=C~!Q~m41Yf5wR!B+&iOnk2l4ahBMW%r`YY;!dXzKIkm3nf$>9-Y5edy2pk6~+GI~}Maj{+ z+yR8!7nNChZOeH5-79@xU)fdC^E!pthe)`ZQ7<057C0%?$*X^8?kl zR+0_B+)zj>2{j$sfvA_K$i4|0Wh2{H@Y+nE`UFA63pN67;7kx1cQlOdtio8QnamUG zFYx~))_idNBeC9sN8WdCSRXcpM#*4Ce|juqXBTem|Hh)T*vXT zq3XP_R@D+hLPf&Kb(@box%td?Tj_6$;8!UnV5{xl4@y5y-s5U z9ds0%Lee{IcP-J*OCr zL56Cbm>h5_0i{5JB4Qf^xloZ(3zk|h)vLGt)(KVczWe*$d;WxkoU_;3d+oK?UT6Jx zetn7g<4;Vr5JPf$uD|v5&FoOcN{rCdk?kGo>2)B6Y;(|bq2*_?3mX>%;Kwisg0LMG z)ff|Okab-L#sR|_;~+>lf6N!9)n6qSEkZQ`eeB$2C+t8hQ$cp{(w$XxaG5$ki2A*SnTQ8@}p_lfvKh5 zG<=t?AwT~hp~zz7)v*T{&RqyDt+Tlc|bQ~Yl>f-%K^!x zT+cG-%Je@MP@voy!3xlsD_W`;b}@8iP_dI&InJZMn5@!j%A_G zw|2q?rfCL^lJde4vOKMle=1xAuNwSf#npudzL5Ahl`BqC-jgiR2oa6!M6T zMky#Gx%kla%hy!vlPyfN@R9ss>)4~#l2=rk*8<3fYvdy|MW@Ae2z-sqZ zr!D-8-W##)cut26C7;X1b7JP}JS)l*z#QTmMLQHV?hcAW1Wo%oMEh61_N6@9PpP!m zLqzMXn>eT;|2#%FWEx9fusYXTv^cWU5f)-1FYZp2VkHAz{Y8sDDk{`5$Z@wkZ1%vI6XU-@I`s^n6WULh7^!L-%*1 z7W1yiqrD2GJ>zTtJV|>=r;Rs~e@>*0@wMwxX~TTluZh}+Q?Ub*S;N?qT~Uy|Q{>A= zNC?P6^rQVz&se~crxa!F63bKEh$*GuAF`LcS-!Mr=)`%s^~d>ATyb}DE~nEbx!V71 zq&@$j6m$*F)^$;zi|Qhwy0EE%MK+3VR|h+`;S08D>#WJT*FSr*&T2THsq)T=@Whw# z5yh{I92p4Z*GAggMB1-Iv>CTRx(XD(EwWN9qZkno!r|1kM#Y9OAB?r)T$n3~M9tF4 z4(GUoCmWh+EUnH;Vi5Q5CGHza-=CPZ&o?VMF)N8h1?E;!_nL)HnyF+F+2ohyljR@^MU;DM#ylHwt4jWO%*mH); zOalXpVwsB1oDCG;ko7dJkdw*yQtl&Dg=yF##+b~!1AG#{T@kLAfMXJ zAuX?$`Pz3BvCd%J>txzS7?;p2P0xq%+V8?&dKn!5z%}2iVnIdp_`_cu~4jd30)g9cp7nTu;M1WC0rmU8PR zz9QDRV5x}y8kxf*3FG5PaS`d_ftE~xw$lLX(bV#jyc-+? z;mKgv8%p04T%CrLOG?)gzM>SFqzV|5Ti-cFP&`Wd#a4G^*D#FxN`j>(kxB#e@EDql z#3=|t!vAVw#iio`)EDvgx%LyC6Kx%FS8@{4Ph=2x6QPT7PwtI&H?1 zJ}e^xdVNCUk`~%))5Ib3Neu0kBkgxb!JG8MMXWcNWuW7oiaziSLD~43R4d&)@~yIB z;@IVmoa5F3Fp_cNZUT%X?8&|ECRN9kp4KtQO8lha>oEGp@`;PI>D%5DtI*q^o9JzM z?LA%HXg9OP@u-z9Osse*vTMt|(t+CPJDc1Dkeovzpf+OWRJd|q!E~$g#-uVv2Uhxq zn4L{JQqYQL>;EZ9L&$$t3%G%iUU?Qwyw`Fbbz9zL(ihjSF1p2Cbj!lE*2=Zk>5i7L z#{wO{DcDy>*@aM>z)xDS(G*kxc_AHVv`>do%*w|4#xc5vwEZP%e6oe3fFaL=72xRy ztx&h8Njap-MhX*;^Wota)e5*Nk+@-^t1j8YNx;>}FJe_R`GLQB6tPOv{J?J9K6*wQ zEDeQL^JkF}O;r;YyN>(Ycf@y%2V9A7PAzMy#`v{oaP>NnbnZ~k)LcVe2=8^v6bHPm z8=sEjl5oQKE#Z>nD6buHJCcNw2x-cWBxa6x0BR3z>7%LVQ=A_RTcY)O!avYPD*Pj~ z5ifpAd{l}g4jQQMzaPM*P@7T%`%evQd}@4pW8c6)ZzyA9AHh zS9o}pA8>Lmu`LHrJdoCahX!AMXu!ViK%UWT9V&{jRhq#e7yeH2!lImiuC`f7k!N%z!3VhAtz8$(VE{&yE%OR(#ysnL_YhP#7LjtEck zf_WRj$Rdq$A~zf7AHQX5RBX)F6u)>$Oq5?jWYk{0jBssO`Co}IUnFtnUkm9Sa*cKoL@R## z{LAAB{x8QbPJC;BdHjk^&Psc&9k~4a=yh{2Mq-`6?d_6$k9XVN)vmC;y`5aHSkb&9 zsm@kWV%wi;Rp&X5o3aGo?!DC0{<3PM>)w-lLnDK|?JZ+Hg9E3V#zuM|+ANuveZ-1Bx^sOIXhR9*I?L%*ZNdjpzV;yL38mYh6@!{9`o+s_2XFh&* zx@X|U^q*h@YncC?%2rg(7t)VwbHjoV~r8`$mZbKs6A_vVz$I@Nr{b%@=1z~42g|Q*{YY3rVoyC zTRZ`d()iuSxt4CXzpQoqGWErR&fMcR6V%*| zHDygdxUIQ!eRaz&7aUbJ6W9*wZTwL9&U^U(NVvZn-mq161yWo5+_1en_h+|sL*T`vvGu-{Em;NJ7yQ3@QLh8AlukD zClX}eoH1FhT-o`!rtlMc1%tgf>1U~o`%;YKM}u9xd5h~bV=u^k$jlt8C~hGp-EAnk zFnG7?+&xo|r!@X(Ik{(Qw54EorqK0u@J~X>LBb^IC#tF6JHfh-oAJrk!43}Tfo&Ws z|CCak872NGVtKI8=w!?H`oa(?=agZ~NpE$;;jJANhM++`k`SQ)jJby|G$MuU4pZIz2_ z)eYxjEnyN5jj4_2CoWR8U&dcqdF7G~^|PNRL?ER?E0YXTM36lVwYQ5}zZ!y&Uo8kgx*X|JEBDKkPr-Pq5s{%%Q@*ck|kz!eQmz&c|(q>*Y0%3$^ZEQx-OK%F*Bl zTjx!6evzs$Uui5o!R*im4}>w8i(@c^oz<8iTzyc<^?fBbi9Uj*)%=5-_t%YCO!Q^HP$nv>S-SV6Z|5sK;yz}VHZ0Vh;lCHSa)_@O1Ls^ z9h-jQ4o#>n=2q|5U1Q5EpWflp6bJNdJ@Qvrf{kj@|J|Bt>1p;@V)lc~tgo20cm#IZ zNLfos*pv0AVUB9d&}@oj@rTezcuG1odR^(8Nc2F{BG1I69pO={CHq$INRgl+1v05U z+=b}fkEWtSz7HN1`Vp0N^C(V^;MXd%`>6$uM? zK1R^Z;0)p)qhJzfHbkVL2|~EKnO{asi||_uDI)US&6pHRTMB zJZTz(2h0Vqs{c~*Ns#Cnz}_CZKL1P@WBrDr{?OuwXdd|#Uv?gLcMDGyNhUDuRy&4(%C@^l3bktFot>4%mAP^$8UPF$ zPXy49ZiIcsI-`=#pk}B$1Tk$;rOH%69s=F5hwd0Og_5Y5S{o(?R=ylx`Rn_YZ*o?> zJ+taxmsY*Iv+8}vs(%lx`g8KLzcT2WXYtm0cyqvPl%rl(onKUT|p zSsf~tw?{qOD5w3=n^JAjuzs-2AiT^Vk!^HPVAL^es=}C!NX%cAnQv?2?EaDSecFPN zrUlXIyrgno$Fs#M+>){KrLUWpiblLc@zUkt-ooe%p{Pt4tQ798@CjD>wBkh@9;{0e z#iQqgmCa;vIcTrXbGOw*w0;eRpW;al*^S8^>Zfxt9O&+Hh>=^o3GX1X|a z`R4NQ+g$|J`=O9A(nP={munrvctsZoxAqFXn8q=$g-op56K-{oDF$LJpGRsjjki8{ zK4&ERoTW*0+zv@fGUOOWp%o3C4?AHNHdwN8eiPx|d6rw3cx zRaJODW2ePN4Ydt7+#70Y8*G$ok5Ipp+iPF3YweuKwMTQM_=Ka4UXrz0AQK(|?2p79 zwa>W{=g$?QvLLpOyiz~wk5=JRdO>m2_+`zmT+p82U+q)ZJ%1TS5i+-k(@L5q3r^Ti z$wD=J{(&smV1X>mQ!M5rV=+Hc5lIb5Y>gxpt{mZ>iknt51y5W zXCKeQb9V)0t}~Fy@B(Tx7yXa(rQ>x58S2{bX9P{QC@%87(>OV4rDXu$*>4k>lWDP5J;g#v{mE2@7X|Mj1^lP7PzgDp(G|& z`?uD+9eQ`@`4mrsQ)w5WMvTZ-AP50o-QdR;e(K<70)F1Y#eXiSyYKJ~hV$AMH6nui zoBXK}2jKG$Mtn_H9xDq<^?fi2uR5usWW2z5F-E^K z!NgwLWbXMY#B;-uHirbJ0T_o~`fy3}^HnM@-@_!AX3x^pb<%=$r3NHu$xjV))jG9I zqRoD5)oYP1GsdJv@>*ucS36Xehi({2!Lu=N_qMyla3c+h?<1ll zE^VAn`<<(uz^6P<)qWkQ4O}9LPcCC=zoOILDvnc3c;X@A{!-#Z9?A{A=4-!2w4X!W zUKI0xZ_0tDzSefXDyp(|Ie#rD9m~!6VtG*vdo?k(O4sqYrVc$ zX%=1kLb%cZoX)YD$aOPZZ7zdpg+-R9?wP|fvA}##VAd`{5kjlPup2l!lQss$xS&3V-l1j6Z@=)Zn zP}AHGx#^TQW8|;BEIf#4+4a$sgD62L{QG;dRH$}GA=`9FV*UcK;|INvNQ7SxL>&2^lsU znN46)Y3~s#^h7SfTNE9k{da03(;inFZct$Urqp~u0v0qKfSJWm)jU(HaaszXoKmwM zjQQxW(cc({USu-^f}%emLI0035zVOI<+53;!ORiU8jjV|VK??*^inG*ALFGuIPKyr z$|pNWS6dVJld@98S-~W=3;Cijc{RKzf&XCs)yu3uI#RDOtgOm99T<4iN8Rw$@(VwgarE_9s@M6~zwm$CWq6bw?3r}l zmu2P6W#DtXP4EiL=A(7<7UMDVP_O%e_7;%D25<)7;87Vk}VLhiJ3u2J$MN%BU(-=wWLb`!Vl{zE( zXECgwsYn1^11|NwF>AY&dl{*W<3{tn68OGs^TM!Y}A zlq#u6FR5I8XJXS$}_KWOjvwVe+h)b`S(b!(q3B&^gSEE;B<6&% zQaJG!=!S-;(X%nQdM)oBLaw90S6*1RlW&H>YMfH!2~1p1=rZxmhCKWY;1G!t9Gg-X zNNL~-Lggn*Wrm}|mSFUevdr;CsXmXi-a$kU!*DpH%ae*>K{CO~QLtBDq}brOkKp1c z$d(r?`aCyK(gH;EG}j_lhi5?DQm^G0LSlHDnBuB9;@wRV%;S(S<|29udtP1SauP;t`R{*FnTe{`rY-?L;pxF6g|R@bcTscA|tddJdGrG(QtAe$iOW!dJlK%Z4)c zXYPqSx6+*^Up+Lrs>7_`$!w@$-ouzbLn+hdp(C1DhjD;VJH zH2{rWap8eGl4H?F@Kw>#$x$iHoQ$QX*PX{@1wgrF1Ea5h6O{9f2k~rcwA?zU^H8tA zCN4BgN$bFv4Ln=&qu0{W@}-jzX_J(tjsoeV{BsqH@veqF^qE%L!#PaC>O|aM@JPSV z$B5%Y{O3vaGc3Qt@kJvW7z;dwt8t!pg%Wz4U4N*iu;J{(GU&2yY)={O3=~Fb0oJ{; zx?z@_ZhT^&wax+V2~AJ8)CYKs>EZBnaYbt;e>prh9F1dyDYZf~q<;NI8;gz2f=&Y& z*?A&b`$gk$&y*an%H8cQbDypP3LQY)FnxlZaVjo$)wg`||_36biGDl-Q!GFf~+eKkCu z@_NPvW^O>(Oi!nr$HjOJ6L-@&;Z7Vqd=lfBRS(j;xMsN9w>{imE~zHyrAJ)%qsF)59k-OfJ2f21MVKS16!SmBaKC-i+kHL z1uF*{SE}j{J?;x?lQ(o0-)*}V&o~_ih+wbhh+jmnthsVxgW{1k>OyE`5=ugULpQ&V)a@6~o8AhOT|?E> znX3Od@VC;B?6WDwQ+sXneR`1_+_|m z!^XZdYd-uLyyo=Ar_+Dp*{P@xICS2HkxFN%&BZRQl`jLJ?u!;9#yaDV+jjt$Pov+5 zIc_^8-15mxEDz=xwoDgA1*Axb`;#jkIY6M8)$6eyRr~Rgo>ui40q8YaW|zkDt7!hR zFFy8K`a{?Trs+oG-i@c3W@}*OJni0imiZLVE=6l|PMxjbr`@xV)e5wBUXpg8Ji;G< z^4|;&e+{kCRXG;J8i=0ZCW$*@6H?R^$!o{11lV=(Q6}F*AY{dS^p}OwEJNYc?jH;Z zM&92T@>~n6LU;mF9E|6@sLlz3#EfeHw!NB2c$1=w#JQJ5uFL*MPR1v%pr_UNMe%=$mrSsES6T9(DdnbEMwvS+L4 zy!?smO=y6BG=R!>oxxf)+?x&V*FPa!)f9+VF(zj(fGMOii^3qpNZ2xqYmxS%(<*x8 z4AVL=zr!?P#lTHY4CPSxy1 z(h6)Ig-B!VBhsEGReq~F=r|a`?YkE$? z7)Ihu>LKP9%xGM1yeZUVV_;E{ieMR3k_j15U*n-?tL=X}XFvYR{?%%SH?N;5^ zJJ~clIaoR`Ot*FRc;+ne;zcWX+noh@uVruoA~bYkaTsH5QCR3kW5D3(Heb>LTeZT& zlr5E&5MakI`(a8WWR!^L8B$dr4Z0hU z+g4cE;D;h3i0`*zBOx`Kzhz6JByx)+#mNQg;|V5rVMk6MChpL4O zopsFR0PL)nuV1abQ_HI5y4~VR0o~uQxWRS2?o*SgoVQT?ju+PosHJ!kQz6@IhpT^S(nm1;^>4Q`dIZ{zrZJ|K7MPH z-KCY|B0BzB5zBO5jo_vnt}?FG$@1juL(Te&Sqy7OflB(POrjq~s`OUdEp6#j(CH z3)^Pjx+6Rs#jK*JgqW1AC@I-vQVSFRbVj4JKP0pybVD(7(;748CKJ<*8;Zd{Fkg%Y z!#*@+h3+cTpm^P=A*TiCN_2FvYsl_`dZq9EFBctgXM`>}f}We0K1iVk3TADUC*Ww^ ztJsmqW=F#9M;>46Eq%6TsUE&_4lFIV?!Af?9xKo(`}q-Lmvo4J;y}3?QNSm^JVNui zY1{z(qhfIE@0s&^=W-ZkuK2p^?OHfn4}6_cx0?sFt1gY7`cD`)Cg;|4)~t zu*m13@@uQOi!W3!K35M%xNg)yKYNx1gu>oLRBQP;;L3uW0P6*DApHF*FGJXG)%`~! z^WS+JySHe$ncF3`lI$Kh7dOz-espq3Iye9!1$2=X)~_bg9M!t47NIBPK#$XWmxkI! z^{xO(g{wUwA(DBihb8j0hcu@P^2Ot12*tFC++4^R&jcpx?i$KVM=iG^UqP{4K}lxX z+9oj%Sb`Bf$lJG5V6-;9lm2FI_3DmfG)Y^&?`UdiKi>^w?jBUNLQlvG??F$Tr$_DL zYT4lG>Rwk}n$2!GW!+9ePPDvqk*gpav4@R9%XkN zgOfh`LZfJu`N2U1QVT5h)<9=32-v7Gr1#tNM@9h6qxSf~#W0ItwVG^;I}fqi5LHmT z*0{evRDJg6#Kt1VMq>!t)>&G@G_L^KV6>q) zeBTV;){H=3dFU9xg3JWpto@`M4r#p6a4~u+Ks7jWUbOyDki6||;X@@PPLA7ha&jP| z!x2v70Q!@%1vlZc;BIH7n#1#T-M8jYbEmJH1keYR3#4xvQD8T>txbNSQr?hT2&;^@ zjXI4(KVU^>_WfLwWnwkt6@oFZ%Y28<@6=ct9vc^%5G6@kBZ*Ipi%Mc6ocY5!|d`(2?=;Yh>RlRa)eqclWFm;R(D438AXR0y|w`|L{b0YrD87kbC#^AIKhSHO?;qWd#5hd=X< zO`D|csA03_ngmE<69U)hWjHowX*Mwinll@VSUEB{mfKQl&LaiXNgTV!3Ic5k*Tx3U zjVKH~(pB*IhqY*kM~~#eGrWX4CQ0KGe&-4pQrx~G7JdxgrSFCP|H^Cs>H_~7m;3p4 zox0V6t#dboJ4O9-xdCTSFgPy*2PcH_Kf~vVvCZMC9-F7D=U?tA^>3N~yeE@?ibuUx zzoHQ@F{_4W{uRul%bezJUX9ygVZi}-oeAt&KfB&K1u?>V_q&F?E(9Td{L9prnXW zCkgRW>J$f`f1pmGb=B+Bankyy2{-yDb~oSMoURmexeWMHkeJ*3oO<=!&Fb&VeEPMV z@$6H$t92O~c~)Owsz?p*!*`~(eSOGOEP#R{ag`KJcu+x!pgsV;H0zUjIR%rn#Y)#h{h?OGFgzcb?wk zcoCjVh!mwOO)=IYOdV!(8V0ksE@R6LJf^;Gab$q5RIb(b4OXx;dMNLp9cv^aiw1vs zEv>`DI3?C!m=opZ#3p{0?BGFD{ez|?oLS~?Z+8a1*~y}&Fb*>g9%ks5nvyIDnn;?s zbcFd;8S~b^O&r7X5EhBxf3M8sRvGiE)+d+m7ISA`#&5i-LCW6~LppTk*j)#hmHz?j CJlqHX diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridrender_null_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridrender_null_0.azshadervariant index 77bb34183936f274b4c8c2928fa299896c948bb7..7a90c7f3527ed732e34b54009bc1b661365655d5 100644 GIT binary patch delta 16 XcmX@ha+YO-D-%bZZdTV91_lNIGC~D4 delta 16 XcmX@ha+YO-D-%cUobJ8)3=9kaGxP;A diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridrender_vulkan_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridrender_vulkan_0.azshadervariant index 117f993f2808b36d1ebb8e9992312f0123a4bb29..4cbb76954dbaef688dfb2961b893a2156f11785a 100644 GIT binary patch delta 2089 zcmZ9NU1(HC6vt=o-Fx?LjGNeQ-0W`lBQ7?rA)hLW8VyqX0MW#xmO^pa>KZKBG$c}J z1y_(35&UT9LFhxJ2(9fyD_rP9wIzrks7R|IwhygTs1Jhag9TeG^#7l|cRS|5nVIuD zbMDNX`M4j<$&W6}i(91kD6#n7ons$gQ9I?9?9w-Fs~8nR3L)ZRGfK)5VUhSh%WA}N zL`*p9(|pl??A~)^(!bWc&-M?rUa(azk&|gPl&EA2A|l!mX+a~(?(d9RhF0{YW?Yp|{bLj2O@oT3YdQaq7{-)c%=yso*)G3QHWiqPf z-8{;cXgA7uf#teFK82L)Je5k*<^84dp}|!`Fwvem7wycrXbExXz3EEt;Qro&)$&9I zw!@XGuM5e_B3L8k+1as~iBh#R_0CMSJPD+GG^5s$v*qgaWM!t#J+T;#FlNWWsY-cf ztkHpAj)!sKi2gr?v(6hH@G>Yjb}Ob#yAzrW>?YLo^8nFLn|=yyPSy0&reCV-FXdIN z>v)Z+pcLzs*oI}0@rz_!P{=q7vQ~rH0ZSN+N09w^BpJ&CLm{IWtfmL6e=ySM=op>C zi3~4boTM4Yer8-a*`r1r+4FI=dT!0Ya7A-QAldVQxL9CjT)1kcE?gnm!Z@-<9LCoM zQ!{J?vctkavPK}xIilj#TBij&~_@$NCFGl$$WyDvjK3}x4xNaIEPwZEiaAHLWd zKoPI^F@-lLrrsJTzA^+tVe-@PGm-4Qkq|Po1=2uD6}~qcZU+%+!;z}b5|&|H={1^5=JyX(%w_5S(?1Dy0FCC!BO_RJ59*uHUFws)c{!@S+ncHF4*2ImAI6U2 z#&8G6;G>@svhjf76gSvw0b|z@jK@9L1B3DGPyZ-%BMuAiB7Oe~Dc0gC9xr|A9qD=d I#1ruU0N-NYxBvhE delta 2557 zcmb7_U1(fI6vyZ8?%nPt*`)18vwQa=O_nxFXtwpcv1wx^X(COtag#I;4ckq#i7T6J z*aRCXax3DKP?32k)USs^Di&hpf)CniUVN$)LGZx`D~ca4MZqc}QvCmC?~Ow!r~@;1 z&+nZ7%-lI=?!I=_czNBpGH8VIBQN!i%}n2sM~%UOwj+LDW{VJp5TaQe!pOEw_!Qyu zgH|CLL`dXwlZAn)@xp9r>13_ExO}QsC|74oE9L6E^S-eVu!ABZ0uaa0C(EVN`PzJ8 z0pZKVa%H5rT&k6emEqaph2nha$x;G;Zq8~Uj zyITgv^)sK6>3E`>r_9rS0P24^ZMi>Q@CQXu-blB_kvg&b{9>tRskpFMQD=%*Zx$i> zR{T*j1h0@^TZsq~P%E$Sz{Bv3`Z7jH?y|Zt9<{nuTtL3nw%9|X5j^uB6xd{+IwX?EG% zDbH0aoKthKSyc4>-=d=CzZ4bYko>g1u&P+Ms&JTL5td)3GDcYbnQF&qrMoc>s_~N` z$<1J!(IDSVXN*RblqO7?D=sa0H(+u38O*aqMC2XhI)wE6<3CcamWs7}J$uef`+3uD zfV&f&HFX&EMY{t%>Drv0e%@L7Y17X}o3*L?Y18k;b9voQn|^maxw7-c=`d_IUJ5o| z9x~2B#x*@g9obfm`CW#x-iYHxXIxCa-qLR42ad#31yq*FOmxo7%y_HyZ(^HujMH`A zj?QX2GEHZz1qgMax9xRJNTvyuj!f5iuf`pFnBdhD|`Ww>Vne=Nyvdu!Wy0ESb zy1KKPj%>4zOxMxR_10}o$fG9wTw_c&**6+vA(H)~u|}8O))AgR1nsHpNpsZyx6Z@fHW8(NX)Q4vp z-H&eJoR~oV=^Vh5jdmI%^K~COKN4Q&>S>X}2Y;=nu+z&Zy_}J=9K;i^p=z3YXq3CM znQ%V{Tccddo;SIJKKaz1AMp<_#N)1twLm59emt3THqU0h*=TdGOf?&Az9ZAj=Gja! zn`bkceM@2B-6p>vi8d@I~bBk6nc8!oKhJ za?>B7bAdigM*Au{7og1pyoSyVD!;SV`$fn0bGSA4de4ehd9)^xrTm#d$ZHJ}T)O!^BL%IBfdaJT~Dn+>s47=`x1qFfUVg3FindShaderInputConstantIndex(Name("m_modelToWorld")); - AZ::Matrix3x4 modelToWorld = AZ::Matrix3x4::CreateFromTransform(m_transform) * AZ::Matrix3x4::CreateScale(m_extents); + AZ::Matrix3x4 modelToWorld = AZ::Matrix3x4::CreateFromTransform(m_transform) * AZ::Matrix3x4::CreateScale(m_renderExtents); m_renderObjectSrg->SetConstant(constantIndex, modelToWorld); constantIndex = srgLayout->FindShaderInputConstantIndex(Name("m_modelToWorldInverse")); - AZ::Matrix3x4 modelToWorldInverse = AZ::Matrix3x4::CreateFromTransform(m_transform).GetInverseFull(); + AZ::Matrix3x4 modelToWorldInverse = modelToWorld.GetInverseFull(); m_renderObjectSrg->SetConstant(constantIndex, modelToWorldInverse); constantIndex = srgLayout->FindShaderInputConstantIndex(Name("m_obbHalfLengths")); diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.h b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.h index 6c3017fe33..a828fe4b96 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.h +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.h @@ -183,11 +183,14 @@ namespace AZ // extents of the probe grid AZ::Vector3 m_extents = AZ::Vector3(0.0f, 0.0f, 0.0f); + // expanded extents for rendering the volume + AZ::Vector3 m_renderExtents = AZ::Vector3(0.0f, 0.0f, 0.0f); + // probe grid OBB (world space), built from transform and extents AZ::Obb m_obbWs; // per-axis spacing of probes in the grid - AZ::Vector3 m_probeSpacing; + AZ::Vector3 m_probeSpacing = AZ::Vector3(0.0f, 0.0f, 0.0f); // per-axis number of probes in the grid uint32_t m_probeCountX = 0; From ada7c41a34031b3d50807d7f86b0bc50cce66b83 Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Wed, 15 Dec 2021 19:18:24 -0800 Subject: [PATCH 342/948] feature: add Exception Handler support for unix REF: https://github.com/o3de/o3de/issues/5886 Signed-off-by: Michael Pollind --- .../UnixLike/AzCore/Debug/Trace_UnixLike.cpp | 135 ++++++++++++------ Code/Legacy/CrySystem/SystemInit.cpp | 42 ------ 2 files changed, 95 insertions(+), 82 deletions(-) diff --git a/Code/Framework/AzCore/Platform/Common/UnixLike/AzCore/Debug/Trace_UnixLike.cpp b/Code/Framework/AzCore/Platform/Common/UnixLike/AzCore/Debug/Trace_UnixLike.cpp index 92a80b0d9a..b0ee4ea1e3 100644 --- a/Code/Framework/AzCore/Platform/Common/UnixLike/AzCore/Debug/Trace_UnixLike.cpp +++ b/Code/Framework/AzCore/Platform/Common/UnixLike/AzCore/Debug/Trace_UnixLike.cpp @@ -6,74 +6,129 @@ * */ +#include #include #include #include +#include #include #include -namespace AZ::Debug::Platform +namespace AZ::Debug { #if defined(AZ_ENABLE_DEBUG_TOOLS) - bool performDebuggerDetection() + void ExceptionHandler(int signal); +#endif + + constexpr int MaxMessageLength = 4096; + constexpr int MaxStackLines = 100; + + namespace Platform { - AZ::IO::SystemFile processStatusFile; - if (!processStatusFile.Open("/proc/self/status", AZ::IO::SystemFile::SF_OPEN_READ_ONLY)) +#if defined(AZ_ENABLE_DEBUG_TOOLS) + bool performDebuggerDetection() { + AZ::IO::SystemFile processStatusFile; + if (!processStatusFile.Open("/proc/self/status", AZ::IO::SystemFile::SF_OPEN_READ_ONLY)) + { + return false; + } + + char buffer[4096]; + AZ::IO::SystemFile::SizeType numRead = processStatusFile.Read(sizeof(buffer), buffer); + + const AZStd::string_view processStatusView(buffer, buffer + numRead); + constexpr AZStd::string_view tracerPidString = "TracerPid:"; + const size_t tracerPidOffset = processStatusView.find(tracerPidString); + if (tracerPidOffset == AZStd::string_view::npos) + { + return false; + } + for (size_t i = tracerPidOffset + tracerPidString.length(); i < numRead; ++i) + { + if (!::isspace(processStatusView[i])) + { + return processStatusView[i] != '0'; + } + } return false; } - char buffer[4096]; - AZ::IO::SystemFile::SizeType numRead = processStatusFile.Read(sizeof(buffer), buffer); + bool IsDebuggerPresent() + { + static bool s_detectionPerformed = false; + static bool s_debuggerDetected = false; + if (!s_detectionPerformed) + { + s_debuggerDetected = performDebuggerDetection(); + s_detectionPerformed = true; + } + return s_debuggerDetected; + } - const AZStd::string_view processStatusView(buffer, buffer + numRead); - constexpr AZStd::string_view tracerPidString = "TracerPid:"; - const size_t tracerPidOffset = processStatusView.find(tracerPidString); - if (tracerPidOffset == AZStd::string_view::npos) + bool AttachDebugger() { + // Not supported yet + AZ_Assert(false, "AttachDebugger() is not supported for Unix platform yet"); return false; } - for (size_t i = tracerPidOffset + tracerPidString.length(); i < numRead; ++i) + + void SignalHandler(int handler) + { + } + + void HandleExceptions(bool isEnabled) { - if (!::isspace(processStatusView[i])) + if (isEnabled) { - return processStatusView[i] != '0'; + signal(SIGSEGV, ExceptionHandler); + signal(SIGTRAP, ExceptionHandler); + signal(SIGILL, ExceptionHandler); + } + else + { + signal(SIGSEGV, SIG_DFL); + signal(SIGTRAP, SIG_DFL); + signal(SIGILL, SIG_DFL); } } - return false; - } - bool IsDebuggerPresent() - { - static bool s_detectionPerformed = false; - static bool s_debuggerDetected = false; - if (!s_detectionPerformed) + void DebugBreak() { - s_debuggerDetected = performDebuggerDetection(); - s_detectionPerformed = true; + raise(SIGINT); } - return s_debuggerDetected; - } +#endif // AZ_ENABLE_DEBUG_TOOLS - bool AttachDebugger() + void Terminate(int exitCode) + { + _exit(exitCode); + } + } // namespace Platform + +#if defined(AZ_ENABLE_DEBUG_TOOLS) + void ExceptionHandler(int signal) { - // Not supported yet - AZ_Assert(false, "AttachDebugger() is not supported for Unix platform yet"); - return false; - } + char message[MaxMessageLength]; + Debug::Trace::Instance().Output(nullptr, "==================================================================\n"); + azsnprintf(message, MaxMessageLength, "Error: signal %s: \n", strsignal(signal)); + Debug::Trace::Instance().Output(nullptr, message); - void HandleExceptions(bool) - {} + void* buffers[MaxStackLines]; + int numberBacktraceStrings = backtrace(buffers, MaxStackLines); + char** backtraceResults = backtrace_symbols(buffers, numberBacktraceStrings); + if (backtraceResults == nullptr) + { + Debug::Trace::Instance().Output(nullptr, "==================================================================\n"); + return; + } + for (int j = 0; j < numberBacktraceStrings; j++) + { + Debug::Trace::Instance().Output(nullptr, backtraceResults[j]); + } - void DebugBreak() - { - raise(SIGINT); + Debug::Trace::Instance().Output(nullptr, "==================================================================\n"); } -#endif // AZ_ENABLE_DEBUG_TOOLS +#endif - void Terminate(int exitCode) - { - _exit(exitCode); - } -} // namespace AZ::Debug::Platform +} // namespace AZ::Debug diff --git a/Code/Legacy/CrySystem/SystemInit.cpp b/Code/Legacy/CrySystem/SystemInit.cpp index 09bbc3773a..f3f9442322 100644 --- a/Code/Legacy/CrySystem/SystemInit.cpp +++ b/Code/Legacy/CrySystem/SystemInit.cpp @@ -115,43 +115,6 @@ extern LONG WINAPI CryEngineExceptionFilterWER(struct _EXCEPTION_POINTERS* pExce #include AZ_RESTRICTED_FILE(SystemInit_cpp) #endif -#if AZ_TRAIT_USE_CRY_SIGNAL_HANDLER - -#include -#include -void CryEngineSignalHandler(int signal) -{ - char resolvedPath[_MAX_PATH]; - - // it is assumed that @log@ points at the appropriate place (so for apple, to the user profile dir) - if (AZ::IO::FileIOBase::GetDirectInstance()->ResolvePath("@log@/crash.log", resolvedPath, _MAX_PATH)) - { - fprintf(stderr, "Crash Signal Handler - logged to %s\n", resolvedPath); - FILE* file = fopen(resolvedPath, "a"); - if (file) - { - char sTime[128]; - time_t ltime; - time(<ime); - struct tm* today = localtime(<ime); - strftime(sTime, 40, "<%Y-%m-%d %H:%M:%S> ", today); - fprintf(file, "%s: Error: signal %s:\n", sTime, strsignal(signal)); - fflush(file); - void* array[100]; - int s = backtrace(array, 100); - backtrace_symbols_fd(array, s, fileno(file)); - fclose(file); - CryLogAlways("Successfully recorded crash file: '%s'", resolvedPath); - abort(); - } - } - - CryLogAlways("Could not record crash file..."); - abort(); -} - -#endif // AZ_TRAIT_USE_CRY_SIGNAL_HANDLER - ////////////////////////////////////////////////////////////////////////// #define DEFAULT_LOG_FILENAME "@log@/Log.txt" @@ -697,11 +660,6 @@ public: ///////////////////////////////////////////////////////////////////////////////// bool CSystem::Init(const SSystemInitParams& startupParams) { -#if AZ_TRAIT_USE_CRY_SIGNAL_HANDLER - signal(SIGSEGV, CryEngineSignalHandler); - signal(SIGTRAP, CryEngineSignalHandler); - signal(SIGILL, CryEngineSignalHandler); -#endif // AZ_TRAIT_USE_CRY_SIGNAL_HANDLER // Temporary Fix for an issue accessing gEnv from this object instance. The gEnv is not resolving to the // global gEnv, instead its resolving an some uninitialized gEnv elsewhere (NULL). Since gEnv is From 833598d68fc737c82982b85608be387ad9922886 Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Thu, 16 Dec 2021 20:30:56 -0800 Subject: [PATCH 343/948] chore: remove signal handler Signed-off-by: Michael Pollind --- .../AzCore/Platform/Android/AzCore/AzCore_Traits_Android.h | 1 - .../Framework/AzCore/Platform/Linux/AzCore/AzCore_Traits_Linux.h | 1 - Code/Framework/AzCore/Platform/Mac/AzCore/AzCore_Traits_Mac.h | 1 - .../AzCore/Platform/Windows/AzCore/AzCore_Traits_Windows.h | 1 - Code/Framework/AzCore/Platform/iOS/AzCore/AzCore_Traits_iOS.h | 1 - 5 files changed, 5 deletions(-) diff --git a/Code/Framework/AzCore/Platform/Android/AzCore/AzCore_Traits_Android.h b/Code/Framework/AzCore/Platform/Android/AzCore/AzCore_Traits_Android.h index e8efce1133..e99f29e051 100644 --- a/Code/Framework/AzCore/Platform/Android/AzCore/AzCore_Traits_Android.h +++ b/Code/Framework/AzCore/Platform/Android/AzCore/AzCore_Traits_Android.h @@ -98,7 +98,6 @@ #define AZ_TRAIT_THREAD_HARDWARE_CONCURRENCY_RETURN_VALUE static_cast(sysconf(_SC_NPROCESSORS_ONLN)); #define AZ_TRAIT_UNITTEST_NON_PREALLOCATED_HPHA_TEST 0 #define AZ_TRAIT_UNITTEST_USE_TEST_RUNNER_ENVIRONMENT 1 -#define AZ_TRAIT_USE_CRY_SIGNAL_HANDLER 0 #define AZ_TRAIT_USE_POSIX_STRERROR_R 1 #define AZ_TRAIT_USE_SECURE_CRT_FUNCTIONS 0 #define AZ_TRAIT_USE_WINDOWS_FILE_API 0 diff --git a/Code/Framework/AzCore/Platform/Linux/AzCore/AzCore_Traits_Linux.h b/Code/Framework/AzCore/Platform/Linux/AzCore/AzCore_Traits_Linux.h index 59d5f3c5ed..e5e52995a1 100644 --- a/Code/Framework/AzCore/Platform/Linux/AzCore/AzCore_Traits_Linux.h +++ b/Code/Framework/AzCore/Platform/Linux/AzCore/AzCore_Traits_Linux.h @@ -98,7 +98,6 @@ #define AZ_TRAIT_THREAD_HARDWARE_CONCURRENCY_RETURN_VALUE static_cast(sysconf(_SC_NPROCESSORS_ONLN)); #define AZ_TRAIT_UNITTEST_NON_PREALLOCATED_HPHA_TEST 0 #define AZ_TRAIT_UNITTEST_USE_TEST_RUNNER_ENVIRONMENT 0 -#define AZ_TRAIT_USE_CRY_SIGNAL_HANDLER 1 #define AZ_TRAIT_USE_POSIX_STRERROR_R 1 #define AZ_TRAIT_USE_SECURE_CRT_FUNCTIONS 0 #define AZ_TRAIT_USE_WINDOWS_FILE_API 0 diff --git a/Code/Framework/AzCore/Platform/Mac/AzCore/AzCore_Traits_Mac.h b/Code/Framework/AzCore/Platform/Mac/AzCore/AzCore_Traits_Mac.h index 1a3d0663e1..9a6c76fe2d 100644 --- a/Code/Framework/AzCore/Platform/Mac/AzCore/AzCore_Traits_Mac.h +++ b/Code/Framework/AzCore/Platform/Mac/AzCore/AzCore_Traits_Mac.h @@ -98,7 +98,6 @@ #define AZ_TRAIT_THREAD_HARDWARE_CONCURRENCY_RETURN_VALUE static_cast(sysconf(_SC_NPROCESSORS_ONLN)); #define AZ_TRAIT_UNITTEST_NON_PREALLOCATED_HPHA_TEST 0 #define AZ_TRAIT_UNITTEST_USE_TEST_RUNNER_ENVIRONMENT 0 -#define AZ_TRAIT_USE_CRY_SIGNAL_HANDLER 1 #define AZ_TRAIT_USE_POSIX_STRERROR_R 1 #define AZ_TRAIT_USE_SECURE_CRT_FUNCTIONS 0 #define AZ_TRAIT_USE_WINDOWS_FILE_API 0 diff --git a/Code/Framework/AzCore/Platform/Windows/AzCore/AzCore_Traits_Windows.h b/Code/Framework/AzCore/Platform/Windows/AzCore/AzCore_Traits_Windows.h index 1a83aba267..71d6b395c5 100644 --- a/Code/Framework/AzCore/Platform/Windows/AzCore/AzCore_Traits_Windows.h +++ b/Code/Framework/AzCore/Platform/Windows/AzCore/AzCore_Traits_Windows.h @@ -98,7 +98,6 @@ #define AZ_TRAIT_THREAD_HARDWARE_CONCURRENCY_RETURN_VALUE INVALID_RETURN_VALUE #define AZ_TRAIT_UNITTEST_NON_PREALLOCATED_HPHA_TEST 1 #define AZ_TRAIT_UNITTEST_USE_TEST_RUNNER_ENVIRONMENT 0 -#define AZ_TRAIT_USE_CRY_SIGNAL_HANDLER 0 #define AZ_TRAIT_USE_POSIX_STRERROR_R 0 #define AZ_TRAIT_USE_SECURE_CRT_FUNCTIONS 1 #define AZ_TRAIT_USE_WINDOWS_FILE_API 1 diff --git a/Code/Framework/AzCore/Platform/iOS/AzCore/AzCore_Traits_iOS.h b/Code/Framework/AzCore/Platform/iOS/AzCore/AzCore_Traits_iOS.h index 7a75af71fb..11a0ba84e0 100644 --- a/Code/Framework/AzCore/Platform/iOS/AzCore/AzCore_Traits_iOS.h +++ b/Code/Framework/AzCore/Platform/iOS/AzCore/AzCore_Traits_iOS.h @@ -99,7 +99,6 @@ #define AZ_TRAIT_THREAD_HARDWARE_CONCURRENCY_RETURN_VALUE static_cast(sysconf(_SC_NPROCESSORS_ONLN)); #define AZ_TRAIT_UNITTEST_NON_PREALLOCATED_HPHA_TEST 0 #define AZ_TRAIT_UNITTEST_USE_TEST_RUNNER_ENVIRONMENT 0 -#define AZ_TRAIT_USE_CRY_SIGNAL_HANDLER 1 #define AZ_TRAIT_USE_POSIX_STRERROR_R 1 #define AZ_TRAIT_USE_SECURE_CRT_FUNCTIONS 0 #define AZ_TRAIT_USE_WINDOWS_FILE_API 0 From 21850aa73ea90c6846f2b47903d5ac1b6b916b05 Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Thu, 23 Dec 2021 15:09:29 -0800 Subject: [PATCH 344/948] chore: replace stack trace logic with StackRecorder Signed-off-by: Michael Pollind --- .../UnixLike/AzCore/Debug/Trace_UnixLike.cpp | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/Code/Framework/AzCore/Platform/Common/UnixLike/AzCore/Debug/Trace_UnixLike.cpp b/Code/Framework/AzCore/Platform/Common/UnixLike/AzCore/Debug/Trace_UnixLike.cpp index b0ee4ea1e3..67de4a3219 100644 --- a/Code/Framework/AzCore/Platform/Common/UnixLike/AzCore/Debug/Trace_UnixLike.cpp +++ b/Code/Framework/AzCore/Platform/Common/UnixLike/AzCore/Debug/Trace_UnixLike.cpp @@ -9,11 +9,9 @@ #include #include #include +#include -#include -#include #include -#include namespace AZ::Debug { @@ -114,19 +112,15 @@ namespace AZ::Debug azsnprintf(message, MaxMessageLength, "Error: signal %s: \n", strsignal(signal)); Debug::Trace::Instance().Output(nullptr, message); - void* buffers[MaxStackLines]; - int numberBacktraceStrings = backtrace(buffers, MaxStackLines); - char** backtraceResults = backtrace_symbols(buffers, numberBacktraceStrings); - if (backtraceResults == nullptr) - { - Debug::Trace::Instance().Output(nullptr, "==================================================================\n"); - return; - } - for (int j = 0; j < numberBacktraceStrings; j++) - { - Debug::Trace::Instance().Output(nullptr, backtraceResults[j]); + StackFrame frames[MaxStackLines]; + SymbolStorage::StackLine stackLines[MaxStackLines]; + SymbolStorage decoder; + const unsigned int numberOfFrames = StackRecorder::Record(frames, MaxStackLines); + decoder.DecodeFrames(frames, numberOfFrames, stackLines); + for(int i = 0; i < numberOfFrames; ++i) { + azsnprintf(message, MaxMessageLength, "%s \n", stackLines[i]); + Debug::Trace::Instance().Output(nullptr, message); } - Debug::Trace::Instance().Output(nullptr, "==================================================================\n"); } #endif From 39c09ba6f70fade423993b8d120b3fa66527ff60 Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Tue, 4 Jan 2022 21:10:56 -0800 Subject: [PATCH 345/948] chore: correct formatting and address comments Signed-off-by: Michael Pollind --- .../UnixLike/AzCore/Debug/Trace_UnixLike.cpp | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/Code/Framework/AzCore/Platform/Common/UnixLike/AzCore/Debug/Trace_UnixLike.cpp b/Code/Framework/AzCore/Platform/Common/UnixLike/AzCore/Debug/Trace_UnixLike.cpp index 67de4a3219..e1f1a0f801 100644 --- a/Code/Framework/AzCore/Platform/Common/UnixLike/AzCore/Debug/Trace_UnixLike.cpp +++ b/Code/Framework/AzCore/Platform/Common/UnixLike/AzCore/Debug/Trace_UnixLike.cpp @@ -6,10 +6,10 @@ * */ +#include #include #include #include -#include #include @@ -33,7 +33,7 @@ namespace AZ::Debug return false; } - char buffer[4096]; + char buffer[MaxMessageLength]; AZ::IO::SystemFile::SizeType numRead = processStatusFile.Read(sizeof(buffer), buffer); const AZStd::string_view processStatusView(buffer, buffer + numRead); @@ -72,10 +72,6 @@ namespace AZ::Debug return false; } - void SignalHandler(int handler) - { - } - void HandleExceptions(bool isEnabled) { if (isEnabled) @@ -108,20 +104,22 @@ namespace AZ::Debug void ExceptionHandler(int signal) { char message[MaxMessageLength]; - Debug::Trace::Instance().Output(nullptr, "==================================================================\n"); + // Trace::RawOutput + Debug::Trace::Instance().RawOutput(nullptr, "==================================================================\n"); azsnprintf(message, MaxMessageLength, "Error: signal %s: \n", strsignal(signal)); - Debug::Trace::Instance().Output(nullptr, message); + Debug::Trace::Instance().RawOutput(nullptr, message); StackFrame frames[MaxStackLines]; SymbolStorage::StackLine stackLines[MaxStackLines]; SymbolStorage decoder; const unsigned int numberOfFrames = StackRecorder::Record(frames, MaxStackLines); - decoder.DecodeFrames(frames, numberOfFrames, stackLines); - for(int i = 0; i < numberOfFrames; ++i) { + decoder.DecodeFrames(frames, numberOfFrames, stackLines); + for (int i = 0; i < numberOfFrames; ++i) + { azsnprintf(message, MaxMessageLength, "%s \n", stackLines[i]); - Debug::Trace::Instance().Output(nullptr, message); + Debug::Trace::Instance().RawOutput(nullptr, message); } - Debug::Trace::Instance().Output(nullptr, "==================================================================\n"); + Debug::Trace::Instance().RawOutput(nullptr, "==================================================================\n"); } #endif From 66985e3569c13ab7b640ef31667e25b18bccd668 Mon Sep 17 00:00:00 2001 From: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> Date: Thu, 6 Jan 2022 09:26:16 +0000 Subject: [PATCH 346/948] Updates to ViewportTitleDlg to better expose grid snapping visualization (#6700) * updates to ViewportTitleDlg to better expose grid snapping visualization Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * small typo fix Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * add escape handling for widget to be more consistent with other QMenu behavior Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * remove unneeded [[maybe_unused]] Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> --- Code/Editor/ViewportTitleDlg.cpp | 119 +++++++++++++++++++++---------- Code/Editor/ViewportTitleDlg.h | 11 +-- 2 files changed, 89 insertions(+), 41 deletions(-) diff --git a/Code/Editor/ViewportTitleDlg.cpp b/Code/Editor/ViewportTitleDlg.cpp index 888089fd72..90aa044d25 100644 --- a/Code/Editor/ViewportTitleDlg.cpp +++ b/Code/Editor/ViewportTitleDlg.cpp @@ -14,6 +14,7 @@ #include "ViewportTitleDlg.h" // Qt +#include #include #include @@ -43,6 +44,7 @@ #include #include #include +#include #include @@ -51,6 +53,8 @@ AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING #endif //! defined(Q_MOC_RUN) +static constexpr int MiniumOverflowMenuWidth = 200; + // CViewportTitleDlg dialog namespace @@ -257,21 +261,56 @@ void CViewportTitleDlg::SetupHelpersButton() void CViewportTitleDlg::SetupOverflowMenu() { - // Setup the overflow menu - QMenu* overFlowMenu = new QMenu(this); + // simple override of QMenu that does not respond to keyboard events + // note: this prevents the menu from being prematurely closed + class IgnoreKeyboardMenu : public QMenu + { + public: + IgnoreKeyboardMenu(QWidget *parent = nullptr) : QMenu(parent) + { + } - m_audioMuteAction = new QAction("Mute Audio", overFlowMenu); - connect(m_audioMuteAction, &QAction::triggered, this, &CViewportTitleDlg::OnBnClickedMuteAudio); - overFlowMenu->addAction(m_audioMuteAction); + private: + void keyPressEvent(QKeyEvent* event) override + { + // regular escape key handling + if (event->key() == Qt::Key_Escape) + { + QMenu::keyPressEvent(event); + } + } + }; - overFlowMenu->addSeparator(); + // setup the overflow menu + auto* overflowMenu = new IgnoreKeyboardMenu(this); + overflowMenu->setMinimumWidth(MiniumOverflowMenuWidth); - m_enableGridSnappingAction = new QAction("Enable Grid Snapping", overFlowMenu); - connect(m_enableGridSnappingAction, &QAction::triggered, this, &CViewportTitleDlg::OnGridSnappingToggled); - m_enableGridSnappingAction->setCheckable(true); - overFlowMenu->addAction(m_enableGridSnappingAction); + m_audioMuteAction = new QAction("Mute Audio", overflowMenu); + connect(m_audioMuteAction, &QAction::triggered, this, &CViewportTitleDlg::OnBnClickedMuteAudio); + overflowMenu->addAction(m_audioMuteAction); + + overflowMenu->addSeparator(); + + m_enableGridSnappingCheckBox = new QCheckBox("Enable Grid Snapping", overflowMenu); + AzQtComponents::CheckBox::applyToggleSwitchStyle(m_enableGridSnappingCheckBox); + auto gridSnappingWidgetAction = new QWidgetAction(overflowMenu); + gridSnappingWidgetAction->setDefaultWidget(m_enableGridSnappingCheckBox); + connect(m_enableGridSnappingCheckBox, &QCheckBox::stateChanged, this, &CViewportTitleDlg::OnGridSnappingToggled); + overflowMenu->addAction(gridSnappingWidgetAction); + + m_enableGridVisualizationCheckBox = new QCheckBox("Show Grid", overflowMenu); + AzQtComponents::CheckBox::applyToggleSwitchStyle(m_enableGridVisualizationCheckBox); + auto gridVisualizationWidgetAction = new QWidgetAction(overflowMenu); + gridVisualizationWidgetAction->setDefaultWidget(m_enableGridVisualizationCheckBox); + connect( + m_enableGridVisualizationCheckBox, &QCheckBox::stateChanged, + [](const int state) + { + SandboxEditor::SetShowingGrid(state == Qt::Checked); + }); + overflowMenu->addAction(gridVisualizationWidgetAction); - m_gridSizeActionWidget = new QWidgetAction(overFlowMenu); + m_gridSizeActionWidget = new QWidgetAction(overflowMenu); m_gridSpinBox = new AzQtComponents::DoubleSpinBox(); m_gridSpinBox->setValue(SandboxEditor::GridSnappingSize()); m_gridSpinBox->setMinimum(1e-2f); @@ -281,31 +320,33 @@ void CViewportTitleDlg::SetupOverflowMenu() m_gridSpinBox, QOverload::of(&AzQtComponents::DoubleSpinBox::valueChanged), this, &CViewportTitleDlg::OnGridSpinBoxChanged); m_gridSizeActionWidget->setDefaultWidget(m_gridSpinBox); - overFlowMenu->addAction(m_gridSizeActionWidget); + overflowMenu->addAction(m_gridSizeActionWidget); - overFlowMenu->addSeparator(); + overflowMenu->addSeparator(); - m_enableAngleSnappingAction = new QAction("Enable Angle Snapping", overFlowMenu); - connect(m_enableAngleSnappingAction, &QAction::triggered, this, &CViewportTitleDlg::OnAngleSnappingToggled); - m_enableAngleSnappingAction->setCheckable(true); - overFlowMenu->addAction(m_enableAngleSnappingAction); + m_enableAngleSnappingCheckBox = new QCheckBox("Enable Angle Snapping", overflowMenu); + AzQtComponents::CheckBox::applyToggleSwitchStyle(m_enableAngleSnappingCheckBox); + auto angleSnappingWidgetAction = new QWidgetAction(overflowMenu); + angleSnappingWidgetAction->setDefaultWidget(m_enableAngleSnappingCheckBox); + connect(m_enableAngleSnappingCheckBox, &QCheckBox::stateChanged, this, &CViewportTitleDlg::OnAngleSnappingToggled); + overflowMenu->addAction(angleSnappingWidgetAction); - m_angleSizeActionWidget = new QWidgetAction(overFlowMenu); + m_angleSizeActionWidget = new QWidgetAction(overflowMenu); m_angleSpinBox = new AzQtComponents::DoubleSpinBox(); m_angleSpinBox->setValue(SandboxEditor::AngleSnappingSize()); m_angleSpinBox->setMinimum(1e-2f); - m_angleSpinBox->setToolTip(tr("Angle Snapping")); + m_angleSpinBox->setToolTip(tr("Angle size")); QObject::connect( m_angleSpinBox, QOverload::of(&AzQtComponents::DoubleSpinBox::valueChanged), this, &CViewportTitleDlg::OnAngleSpinBoxChanged); m_angleSizeActionWidget->setDefaultWidget(m_angleSpinBox); - overFlowMenu->addAction(m_angleSizeActionWidget); + overflowMenu->addAction(m_angleSizeActionWidget); - m_ui->m_overflowBtn->setMenu(overFlowMenu); + m_ui->m_overflowBtn->setMenu(overflowMenu); m_ui->m_overflowBtn->setPopupMode(QToolButton::InstantPopup); - connect(overFlowMenu, &QMenu::aboutToShow, this, &CViewportTitleDlg::UpdateOverFlowMenuState); + connect(overflowMenu, &QMenu::aboutToShow, this, &CViewportTitleDlg::UpdateOverFlowMenuState); UpdateMuteActionText(); } @@ -982,43 +1023,49 @@ void CViewportTitleDlg::CheckForCameraSpeedUpdate() } } -void CViewportTitleDlg::OnGridSnappingToggled() +void CViewportTitleDlg::OnGridSnappingToggled(const int state) { - m_gridSizeActionWidget->setEnabled(m_enableGridSnappingAction->isChecked()); + m_gridSizeActionWidget->setEnabled(state == Qt::Checked); + m_enableGridVisualizationCheckBox->setEnabled(state == Qt::Checked); MainWindow::instance()->GetActionManager()->GetAction(AzToolsFramework::SnapToGrid)->trigger(); } -void CViewportTitleDlg::OnAngleSnappingToggled() +void CViewportTitleDlg::OnAngleSnappingToggled(const int state) { - m_angleSizeActionWidget->setEnabled(m_enableAngleSnappingAction->isChecked()); + m_angleSizeActionWidget->setEnabled(state == Qt::Checked); MainWindow::instance()->GetActionManager()->GetAction(AzToolsFramework::SnapAngle)->trigger(); } -void CViewportTitleDlg::OnGridSpinBoxChanged(double value) +void CViewportTitleDlg::OnGridSpinBoxChanged(const double value) { - SandboxEditor::SetGridSnappingSize(static_cast(value)); + SandboxEditor::SetGridSnappingSize(aznumeric_cast(value)); } -void CViewportTitleDlg::OnAngleSpinBoxChanged(double value) +void CViewportTitleDlg::OnAngleSpinBoxChanged(const double value) { - SandboxEditor::SetAngleSnappingSize(static_cast(value)); + SandboxEditor::SetAngleSnappingSize(aznumeric_cast(value)); } void CViewportTitleDlg::UpdateOverFlowMenuState() { - bool gridSnappingActive = MainWindow::instance()->GetActionManager()->GetAction(AzToolsFramework::SnapToGrid)->isChecked(); + const bool gridSnappingActive = MainWindow::instance()->GetActionManager()->GetAction(AzToolsFramework::SnapToGrid)->isChecked(); { - QSignalBlocker signalBlocker(m_enableGridSnappingAction); - m_enableGridSnappingAction->setChecked(gridSnappingActive); + QSignalBlocker signalBlocker(m_enableGridSnappingCheckBox); + m_enableGridSnappingCheckBox->setChecked(gridSnappingActive); } m_gridSizeActionWidget->setEnabled(gridSnappingActive); - bool angleSnappingActive = MainWindow::instance()->GetActionManager()->GetAction(AzToolsFramework::SnapAngle)->isChecked(); + const bool angleSnappingActive = MainWindow::instance()->GetActionManager()->GetAction(AzToolsFramework::SnapAngle)->isChecked(); { - QSignalBlocker signalBlocker(m_enableAngleSnappingAction); - m_enableAngleSnappingAction->setChecked(angleSnappingActive); + QSignalBlocker signalBlocker(m_enableAngleSnappingCheckBox); + m_enableAngleSnappingCheckBox->setChecked(angleSnappingActive); } m_angleSizeActionWidget->setEnabled(angleSnappingActive); + + { + QSignalBlocker signalBlocker(m_enableGridVisualizationCheckBox); + m_enableGridVisualizationCheckBox->setChecked(SandboxEditor::ShowingGrid()); + } } namespace diff --git a/Code/Editor/ViewportTitleDlg.h b/Code/Editor/ViewportTitleDlg.h index ba3dba858a..b8da7f20ea 100644 --- a/Code/Editor/ViewportTitleDlg.h +++ b/Code/Editor/ViewportTitleDlg.h @@ -140,8 +140,8 @@ protected: void CheckForCameraSpeedUpdate(); - void OnGridSnappingToggled(); - void OnAngleSnappingToggled(); + void OnGridSnappingToggled(int state); + void OnAngleSnappingToggled(int state); void OnGridSpinBoxChanged(double value); void OnAngleSpinBoxChanged(double value); @@ -160,8 +160,9 @@ protected: QAction* m_fullInformationAction = nullptr; QAction* m_compactInformationAction = nullptr; QAction* m_audioMuteAction = nullptr; - QAction* m_enableGridSnappingAction = nullptr; - QAction* m_enableAngleSnappingAction = nullptr; + QCheckBox* m_enableGridSnappingCheckBox = nullptr; + QCheckBox* m_enableGridVisualizationCheckBox = nullptr; + QCheckBox* m_enableAngleSnappingCheckBox = nullptr; QComboBox* m_cameraSpeed = nullptr; AzQtComponents::DoubleSpinBox* m_gridSpinBox = nullptr; AzQtComponents::DoubleSpinBox* m_angleSpinBox = nullptr; @@ -175,7 +176,7 @@ protected: namespace AzToolsFramework { - //! A component to reflect scriptable commands for the Editor + //! A component to reflect scriptable commands for the Editor. class ViewportTitleDlgPythonFuncsHandler : public AZ::Component { From 7af3bef84c7170b0d91f812a30a476ffb37a4107 Mon Sep 17 00:00:00 2001 From: "T.J. McGrath-Daly" Date: Fri, 15 Oct 2021 15:15:26 +0800 Subject: [PATCH 347/948] Model drag causes crash Signed-off-by: T.J. McGrath-Daly --- Gems/EMotionFX/Code/EMotionFX/Source/Actor.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/Actor.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/Actor.cpp index 861271fdb3..0c05da6981 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/Actor.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/Actor.cpp @@ -434,6 +434,17 @@ namespace EMotionFX m_morphSetups.resize(numLODs); AZStd::fill(begin(m_morphSetups), AZStd::next(begin(m_morphSetups), numLODs), nullptr); } + else + { + if (m_morphSetups.size() < numLODs) + { + AZ::u32 num = m_morphSetups.empty() ? 0 : (AZ::u32)m_morphSetups.size(); + for (AZ::u32 i = num; i < numLODs; ++i) + { + m_morphSetups.push_back(nullptr); + } + } + } } // removes all node meshes and stacks From dae82b38586bcb07eff683c432c662d03bfe902a Mon Sep 17 00:00:00 2001 From: "T.J. McGrath-Daly" Date: Fri, 16 Jul 2021 16:15:23 +0800 Subject: [PATCH 348/948] Fix: only files can be selected Signed-off-by: T.J. McGrath-Daly --- .../AssetImporter/AssetImporterManager/AssetImporterManager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Code/Editor/AssetImporter/AssetImporterManager/AssetImporterManager.cpp b/Code/Editor/AssetImporter/AssetImporterManager/AssetImporterManager.cpp index baa287e47f..73c3d6f9ed 100644 --- a/Code/Editor/AssetImporter/AssetImporterManager/AssetImporterManager.cpp +++ b/Code/Editor/AssetImporter/AssetImporterManager/AssetImporterManager.cpp @@ -191,6 +191,7 @@ void AssetImporterManager::OnBrowseDestinationFilePath(QLineEdit* destinationLin fileDialog.setViewMode(QFileDialog::List); fileDialog.setWindowModality(Qt::WindowModality::ApplicationModal); fileDialog.setWindowTitle(tr("Select import destination")); + fileDialog.setFileMode(QFileDialog::Directory); QSettings settings; QString currentDestination = settings.value(AssetImporterManagerPrivate::g_selectDestinationFilesPath).toString(); From 5231cb9b53b86d442effdbbfd46292b3f20732d5 Mon Sep 17 00:00:00 2001 From: "T.J. McGrath-Daly" Date: Fri, 15 Oct 2021 10:58:31 +0800 Subject: [PATCH 349/948] Shortcut keys issue Signed-off-by: T.J. McGrath-Daly --- .../Tools/EMotionStudio/EMStudioSDK/Source/MainWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/MainWindow.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/MainWindow.cpp index b75fb71060..952b3134b6 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/MainWindow.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/MainWindow.cpp @@ -532,7 +532,7 @@ namespace EMStudio QAction* characterLayoutAction = new QAction( "Character", this); - characterLayoutAction->setShortcut(Qt::Key_1 | Qt::AltModifier); + characterLayoutAction->setShortcut(Qt::Key_3 | Qt::AltModifier); m_shortcutManager->RegisterKeyboardShortcut(characterLayoutAction, layoutGroupName, false); connect(characterLayoutAction, &QAction::triggered, [this]{ m_applicationMode->setCurrentIndex(2); }); addAction(characterLayoutAction); From 14661af13f51028a5e92ed32ff59c01df2f1ebcd Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Thu, 6 Jan 2022 09:19:42 -0600 Subject: [PATCH 350/948] Terrain/mbalfour/misc bugfixes (#6712) * Bumped up terrain world limit to allow up to (and including) 4096 x 4096. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Changed loop calculations to handle floating-point math better. By looping on floating-point values, query resolutions of unstable values like "0.200000007" would sometimes cause the loop to go one more time than it should. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- .../Components/TerrainWorldComponent.cpp | 4 +-- .../TerrainWorldDebuggerComponent.cpp | 28 +++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Gems/Terrain/Code/Source/Components/TerrainWorldComponent.cpp b/Gems/Terrain/Code/Source/Components/TerrainWorldComponent.cpp index 8d6bf8e4b0..8b612b86ce 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainWorldComponent.cpp +++ b/Gems/Terrain/Code/Source/Components/TerrainWorldComponent.cpp @@ -139,8 +139,8 @@ namespace Terrain AZ::Outcome TerrainWorldConfig::DetermineMessage(float numSamples) { - const float maximumSamplesAllowed = 8.0f * 1024.0f * 1024.0f; - if (numSamples < maximumSamplesAllowed) + const float maximumSamplesAllowed = 16.0f * 1024.0f * 1024.0f; + if (numSamples <= maximumSamplesAllowed) { return AZ::Success(); } diff --git a/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.cpp b/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.cpp index 8daccd7d61..f3e0d59537 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.cpp +++ b/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.cpp @@ -339,17 +339,17 @@ namespace Terrain AZ::Aabb region = sector.m_aabb; region.SetMax(region.GetMax() + AZ::Vector3(gridResolution.GetX(), gridResolution.GetY(), 0.0f)); + // We need 4 vertices for each grid point in our sector to hold the _| shape. + const size_t numSamplesX = aznumeric_cast(ceil(region.GetExtents().GetX() / gridResolution.GetX())); + const size_t numSamplesY = aznumeric_cast(ceil(region.GetExtents().GetY() / gridResolution.GetY())); + sector.m_lineVertices.clear(); + sector.m_lineVertices.reserve(numSamplesX * numSamplesY * 4); + // This keeps track of the height from the previous point for the _ line. float previousHeight = 0.0f; // This keeps track of the heights from the previous row for the | line. - AZStd::vector rowHeights(aznumeric_cast(ceil(region.GetExtents().GetX() / gridResolution.GetX()))); - - // We need 4 vertices for each grid point in our sector to hold the _| shape. - const uint32_t numSamplesX = static_cast((region.GetMax().GetX() - region.GetMin().GetX()) / gridResolution.GetX()); - const uint32_t numSamplesY = static_cast((region.GetMax().GetY() - region.GetMin().GetY()) / gridResolution.GetY()); - sector.m_lineVertices.clear(); - sector.m_lineVertices.reserve(numSamplesX * numSamplesY * 4); + AZStd::vector rowHeights(numSamplesX); // For each terrain height value in the region, create the _| grid lines for that point and cache off the height value // for use with subsequent grid line calculations. @@ -376,21 +376,21 @@ namespace Terrain }; // This set of nested loops will get replaced with a call to ProcessHeightsFromRegion once the API exists. - uint32_t yIndex = 0; - for (float y = region.GetMin().GetY(); y < region.GetMax().GetY(); y += gridResolution.GetY()) + for (size_t yIndex = 0; yIndex < numSamplesY; yIndex++) { - uint32_t xIndex = 0; - for (float x = region.GetMin().GetX(); x < region.GetMax().GetX(); x += gridResolution.GetX()) + float y = region.GetMin().GetY() + (gridResolution.GetY() * yIndex); + for (size_t xIndex = 0; xIndex < numSamplesX; xIndex++) { + float x = region.GetMin().GetX() + (gridResolution.GetX() * xIndex); + float height = worldMinZ; bool terrainExists = false; AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( height, &AzFramework::Terrain::TerrainDataRequests::GetHeightFromFloats, x, y, AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT, &terrainExists); - ProcessHeightValue(xIndex, yIndex, AZ::Vector3(x, y, height), terrainExists); - xIndex++; + ProcessHeightValue( + aznumeric_cast(xIndex), aznumeric_cast(yIndex), AZ::Vector3(x, y, height), terrainExists); } - yIndex++; } } From 60b8292abffb39f0969c9c324e8a3c173b09d72e Mon Sep 17 00:00:00 2001 From: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> Date: Thu, 6 Jan 2022 10:12:15 -0600 Subject: [PATCH 351/948] Adding Docking and EditMenu tests to Periodic suite for Jenkins testing Signed-off-by: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> --- .../Gem/PythonTests/editor/TestSuite_Periodic.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Periodic.py b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Periodic.py index 282276250f..6e7bc413d3 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Periodic.py +++ b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Periodic.py @@ -47,10 +47,18 @@ class TestAutomation(TestAutomationBase): from .EditorScripts import ComponentCRUD_Add_Delete_Components as test_module self._run_test(request, workspace, editor, test_module, batch_mode=False) + def test_Docking_BasicDockedTools(self, request, workspace, editor, launcher_platform): + from .EditorScripts import Docking_BasicDockedTools as test_module + self._run_test(request, workspace, editor, test_module, batch_mode=False) + def test_InputBindings_Add_Remove_Input_Events(self, request, workspace, editor, launcher_platform): from .EditorScripts import InputBindings_Add_Remove_Input_Events as test_module self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False) + def test_Menus_EditMenuOptions_Work(self, request, workspace, editor, launcher_platform): + from .EditorScripts import Menus_EditMenuOptions as test_module + self._run_test(request, workspace, editor, test_module, batch_mode=False) + def test_Menus_FileMenuOptions_Work(self, request, workspace, editor, launcher_platform): from .EditorScripts import Menus_FileMenuOptions as test_module self._run_test(request, workspace, editor, test_module, batch_mode=False) From fee88cf5c6499812af04c125fb12b3d93330d1b7 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Thu, 6 Jan 2022 10:12:54 -0600 Subject: [PATCH 352/948] Removed legacy editor DatabaseLibrary code. Signed-off-by: Chris Galvan --- Code/Editor/BaseLibrary.cpp | 232 ----- Code/Editor/BaseLibrary.h | 129 --- Code/Editor/BaseLibraryItem.cpp | 261 ------ Code/Editor/BaseLibraryItem.h | 114 --- Code/Editor/BaseLibraryManager.cpp | 822 ------------------ Code/Editor/BaseLibraryManager.h | 226 ----- Code/Editor/ErrorRecorder.cpp | 1 - Code/Editor/ErrorRecorder.h | 2 + Code/Editor/ErrorReport.cpp | 29 - Code/Editor/ErrorReport.h | 10 +- Code/Editor/ErrorReportDialog.cpp | 4 - Code/Editor/ErrorReportTableModel.cpp | 6 +- Code/Editor/IEditor.h | 9 - Code/Editor/IEditorImpl.cpp | 17 - Code/Editor/IEditorImpl.h | 3 - Code/Editor/Include/IBaseLibraryManager.h | 143 --- Code/Editor/Include/IDataBaseItem.h | 92 -- Code/Editor/Include/IDataBaseLibrary.h | 118 --- Code/Editor/Include/IDataBaseManager.h | 134 --- Code/Editor/Include/IEditorMaterial.h | 20 - Code/Editor/Include/IEditorMaterialManager.h | 21 - Code/Editor/Include/IErrorReport.h | 4 - Code/Editor/Lib/Tests/IEditorMock.h | 3 - .../TrackView/TrackViewSequenceManager.cpp | 14 - .../TrackView/TrackViewSequenceManager.h | 4 - Code/Editor/Viewport.h | 3 - Code/Editor/editor_core_files.cmake | 7 - Code/Editor/editor_lib_files.cmake | 6 - 28 files changed, 4 insertions(+), 2430 deletions(-) delete mode 100644 Code/Editor/BaseLibrary.cpp delete mode 100644 Code/Editor/BaseLibrary.h delete mode 100644 Code/Editor/BaseLibraryItem.cpp delete mode 100644 Code/Editor/BaseLibraryItem.h delete mode 100644 Code/Editor/BaseLibraryManager.cpp delete mode 100644 Code/Editor/BaseLibraryManager.h delete mode 100644 Code/Editor/Include/IBaseLibraryManager.h delete mode 100644 Code/Editor/Include/IDataBaseItem.h delete mode 100644 Code/Editor/Include/IDataBaseLibrary.h delete mode 100644 Code/Editor/Include/IDataBaseManager.h delete mode 100644 Code/Editor/Include/IEditorMaterial.h delete mode 100644 Code/Editor/Include/IEditorMaterialManager.h diff --git a/Code/Editor/BaseLibrary.cpp b/Code/Editor/BaseLibrary.cpp deleted file mode 100644 index 15742bd254..0000000000 --- a/Code/Editor/BaseLibrary.cpp +++ /dev/null @@ -1,232 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include "EditorDefs.h" - -#include "BaseLibrary.h" -#include "BaseLibraryItem.h" -#include "Include/IBaseLibraryManager.h" -#include -#include - -////////////////////////////////////////////////////////////////////////// -// CBaseLibrary implementation. -////////////////////////////////////////////////////////////////////////// -CBaseLibrary::CBaseLibrary(IBaseLibraryManager* pManager) - : m_pManager(pManager) - , m_bModified(false) - , m_bLevelLib(false) - , m_bNewLibrary(true) -{ -} - -////////////////////////////////////////////////////////////////////////// -CBaseLibrary::~CBaseLibrary() -{ - m_items.clear(); -} - -////////////////////////////////////////////////////////////////////////// -IBaseLibraryManager* CBaseLibrary::GetManager() -{ - return m_pManager; -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibrary::RemoveAllItems() -{ - AddRef(); - for (int i = 0; i < m_items.size(); i++) - { - // Unregister item in case it was registered. It is ok if it wasn't. This is still safe to call. - m_pManager->UnregisterItem(m_items[i]); - // Clear library item. - m_items[i]->m_library = nullptr; - } - m_items.clear(); - Release(); -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibrary::SetName(const QString& name) -{ - //the fullname of the items in the library will be changed due to library's name change - //so we need unregistered them and register them after their name changed. - for (int i = 0; i < m_items.size(); i++) - { - m_pManager->UnregisterItem(m_items[i]); - } - - m_name = name; - - for (int i = 0; i < m_items.size(); i++) - { - m_pManager->RegisterItem(m_items[i]); - } - - SetModified(); -} - -////////////////////////////////////////////////////////////////////////// -const QString& CBaseLibrary::GetName() const -{ - return m_name; -} - -////////////////////////////////////////////////////////////////////////// -bool CBaseLibrary::Save() -{ - return true; -} - -////////////////////////////////////////////////////////////////////////// -bool CBaseLibrary::Load(const QString& filename) -{ - m_filename = filename; - SetModified(false); - m_bNewLibrary = false; - return true; -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibrary::SetModified(bool bModified) -{ - if (bModified != m_bModified) - { - m_bModified = bModified; - emit Modified(bModified); - } -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibrary::AddItem(IDataBaseItem* item, bool bRegister) -{ - - CBaseLibraryItem* pLibItem = (CBaseLibraryItem*)item; - // Check if item is already assigned to this library. - if (pLibItem->m_library != this) - { - pLibItem->m_library = this; - m_items.push_back(pLibItem); - SetModified(); - if (bRegister) - { - m_pManager->RegisterItem(pLibItem); - } - } -} - -////////////////////////////////////////////////////////////////////////// -IDataBaseItem* CBaseLibrary::GetItem(int index) -{ - assert(index >= 0 && index < m_items.size()); - return m_items[index]; -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibrary::RemoveItem(IDataBaseItem* item) -{ - - for (int i = 0; i < m_items.size(); i++) - { - if (m_items[i] == item) - { - // Unregister item in case it was registered. It is ok if it wasn't. This is still safe to call. - m_pManager->UnregisterItem(m_items[i]); - m_items.erase(m_items.begin() + i); - SetModified(); - break; - } - } -} - -////////////////////////////////////////////////////////////////////////// -IDataBaseItem* CBaseLibrary::FindItem(const QString& name) -{ - for (int i = 0; i < m_items.size(); i++) - { - if (QString::compare(m_items[i]->GetName(), name, Qt::CaseInsensitive) == 0) - { - return m_items[i]; - } - } - return nullptr; -} - -bool CBaseLibrary::AddLibraryToSourceControl(const QString& fullPathName) const -{ - IEditor* pEditor = GetIEditor(); - IFileUtil* pFileUtil = pEditor ? pEditor->GetFileUtil() : nullptr; - if (pFileUtil) - { - return pFileUtil->CheckoutFile(fullPathName.toUtf8().data(), nullptr); - } - - return false; -} - -bool CBaseLibrary::SaveLibrary(const char* name, bool saveEmptyLibrary) -{ - assert(name != nullptr); - if (name == nullptr) - { - CryFatalError("The library you are attempting to save has no name specified."); - return false; - } - - QString fileName(GetFilename()); - if (fileName.isEmpty() && !saveEmptyLibrary) - { - return false; - } - - fileName = Path::GamePathToFullPath(fileName); - - XmlNodeRef root = GetIEditor()->GetSystem()->CreateXmlNode(name); - Serialize(root, false); - bool bRes = XmlHelpers::SaveXmlNode(GetIEditor()->GetFileUtil(), root, fileName.toUtf8().data()); - if (m_bNewLibrary) - { - AddLibraryToSourceControl(fileName); - m_bNewLibrary = false; - } - if (!bRes) - { - QByteArray filenameUtf8 = fileName.toUtf8(); - AZStd::string strMessage = AZStd::string::format("The file %s is read-only and the save of the library couldn't be performed. Try to remove the \"read-only\" flag or check-out the file and then try again.", filenameUtf8.data()); - CryMessageBox(strMessage.c_str(), "Saving Error", MB_OK | MB_ICONWARNING); - } - return bRes; -} - -//CONFETTI BEGIN -void CBaseLibrary::ChangeItemOrder(CBaseLibraryItem* item, unsigned int newLocation) -{ - std::vector<_smart_ptr > temp; - for (unsigned int i = 0; i < m_items.size(); i++) - { - if (i == newLocation) - { - temp.push_back(_smart_ptr(item)); - } - if (m_items[i] != item) - { - temp.push_back(m_items[i]); - } - } - // If newLocation is greater than the original size, append the item to end of the list - if (newLocation >= m_items.size()) - { - temp.push_back(_smart_ptr(item)); - } - m_items = temp; -} -//CONFETTI END - -#include diff --git a/Code/Editor/BaseLibrary.h b/Code/Editor/BaseLibrary.h deleted file mode 100644 index 55079d3fde..0000000000 --- a/Code/Editor/BaseLibrary.h +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_BASELIBRARY_H -#define CRYINCLUDE_EDITOR_BASELIBRARY_H -#pragma once - -#if !defined(Q_MOC_RUN) -#include "Include/IDataBaseLibrary.h" -#include "Include/IBaseLibraryManager.h" -#include "Include/EditorCoreAPI.h" -#include "Util/TRefCountBase.h" - -#include -#endif - -// Ensure we don't try to dllimport when moc includes us -#if defined(Q_MOC_BUILD) && !defined(EDITOR_CORE) -#define EDITOR_CORE -#endif - -/** This a base class for all Libraries used by Editor. -*/ -class EDITOR_CORE_API CBaseLibrary - : public QObject - , public TRefCountBase -{ - Q_OBJECT - -public: - explicit CBaseLibrary(IBaseLibraryManager* pManager); - ~CBaseLibrary(); - - //! Set library name. - virtual void SetName(const QString& name); - //! Get library name. - const QString& GetName() const override; - - //! Set new filename for this library. - virtual bool SetFilename(const QString& filename, [[maybe_unused]] bool checkForUnique = true) { m_filename = filename.toLower(); return true; }; - const QString& GetFilename() const override { return m_filename; }; - - bool Save() override = 0; - bool Load(const QString& filename) override = 0; - void Serialize(XmlNodeRef& node, bool bLoading) override = 0; - - //! Mark library as modified. - void SetModified(bool bModified = true) override; - //! Check if library was modified. - bool IsModified() const override { return m_bModified; }; - - ////////////////////////////////////////////////////////////////////////// - // Working with items. - ////////////////////////////////////////////////////////////////////////// - //! Add a new prototype to library. - void AddItem(IDataBaseItem* item, bool bRegister = true) override; - //! Get number of known prototypes. - int GetItemCount() const override { return static_cast(m_items.size()); } - //! Get prototype by index. - IDataBaseItem* GetItem(int index) override; - - //! Delete item by pointer of item. - void RemoveItem(IDataBaseItem* item) override; - - //! Delete all items from library. - void RemoveAllItems() override; - - //! Find library item by name. - //! Using linear search. - IDataBaseItem* FindItem(const QString& name) override; - - //! Check if this library is local level library. - bool IsLevelLibrary() const override { return m_bLevelLib; }; - - //! Set library to be level library. - void SetLevelLibrary(bool bEnable) override { m_bLevelLib = bEnable; }; - - ////////////////////////////////////////////////////////////////////////// - //! Return manager for this library. - IBaseLibraryManager* GetManager() override; - - // Saves the library with the main tag defined by the parameter name - bool SaveLibrary(const char* name, bool saveEmptyLibrary = false); - - //CONFETTI BEGIN - // Used to change the library item order - void ChangeItemOrder(CBaseLibraryItem* item, unsigned int newLocation) override; - //CONFETTI END - -signals: - void Modified(bool bModified); - -private: - // Add the library to the source control - bool AddLibraryToSourceControl(const QString& fullPathName) const; - -protected: - - //! Name of the library. - QString m_name; - //! Filename of the library. - QString m_filename; - - //! Flag set when library was modified. - bool m_bModified; - - // Flag set when the library is just created and it's not yet saved for the first time. - bool m_bNewLibrary; - - //! Level library is saved within the level .ly file and is local for this level. - bool m_bLevelLib; - - ////////////////////////////////////////////////////////////////////////// - // Manager. - IBaseLibraryManager* m_pManager; - - AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING - // Array of all our library items. - std::vector<_smart_ptr > m_items; - AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING -}; - -#endif // CRYINCLUDE_EDITOR_BASELIBRARY_H diff --git a/Code/Editor/BaseLibraryItem.cpp b/Code/Editor/BaseLibraryItem.cpp deleted file mode 100644 index e3788bc3e4..0000000000 --- a/Code/Editor/BaseLibraryItem.cpp +++ /dev/null @@ -1,261 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include "EditorDefs.h" - -#include "BaseLibraryItem.h" -#include "BaseLibrary.h" -#include "BaseLibraryManager.h" -#include "Undo/IUndoObject.h" - -#include - -//undo object for multi-changes inside library item. such as set all variables to default values. -//For example: change particle emitter shape will lead to multiple variable changes -class CUndoBaseLibraryItem - : public IUndoObject -{ -public: - CUndoBaseLibraryItem(IBaseLibraryManager *libMgr, CBaseLibraryItem* libItem, bool ignoreChild) - : m_libMgr(libMgr) - { - assert(libItem); - assert(libMgr); - - m_itemPath = libItem->GetFullName(); - - //serialize the lib item to undo - m_undoCtx.node = GetIEditor()->GetSystem()->CreateXmlNode("Undo"); - m_undoCtx.bIgnoreChilds = ignoreChild; - m_undoCtx.bLoading = false; //saving - m_undoCtx.bUniqName = false; //don't generate new name - m_undoCtx.bCopyPaste = true; //so it won't override guid - m_undoCtx.bUndo = true; - libItem->Serialize(m_undoCtx); - - //evaluate size - XmlString xmlStr = m_undoCtx.node->getXML(); - m_size = sizeof(CUndoBaseLibraryItem); - m_size += static_cast(xmlStr.GetAllocatedMemory()); - m_size += m_itemPath.length(); - } - - -protected: - int GetSize() override - { - return m_size; - } - - void Undo(bool bUndo) override - { - //find the libItem - IDataBaseItem *libItem = m_libMgr->FindItemByName(m_itemPath); - if (libItem == nullptr) - { - //the undo stack is not reliable any more.. - assert(false); - return; - } - - //save for redo - if (bUndo) - { - m_redoCtx.node = GetIEditor()->GetSystem()->CreateXmlNode("Redo"); - m_redoCtx.bIgnoreChilds = m_undoCtx.bIgnoreChilds; - m_redoCtx.bLoading = false; //saving - m_redoCtx.bUniqName = false; - m_redoCtx.bCopyPaste = true; - m_redoCtx.bUndo = true; - libItem->Serialize(m_redoCtx); - - XmlString xmlStr = m_redoCtx.node->getXML(); - m_size += static_cast(xmlStr.GetAllocatedMemory()); - } - - //load previous saved data - m_undoCtx.bLoading = true; - libItem->Serialize(m_undoCtx); - } - - void Redo() override - { - //find the libItem - IDataBaseItem *libItem = m_libMgr->FindItemByName(m_itemPath); - if (libItem == nullptr || m_redoCtx.node == nullptr) - { - //the undo stack is not reliable any more.. - assert(false); - return; - } - - m_redoCtx.bLoading = true; - libItem->Serialize(m_redoCtx); - } - -private: - QString m_itemPath; - IDataBaseItem::SerializeContext m_undoCtx; //saved before operation - IDataBaseItem::SerializeContext m_redoCtx; //saved after operation so used for redo - IBaseLibraryManager* m_libMgr; - int m_size; -}; - -////////////////////////////////////////////////////////////////////////// -// CBaseLibraryItem implementation. -////////////////////////////////////////////////////////////////////////// -CBaseLibraryItem::CBaseLibraryItem() -{ - m_library = nullptr; - GenerateId(); - m_bModified = false; -} - -CBaseLibraryItem::~CBaseLibraryItem() -{ -} - -////////////////////////////////////////////////////////////////////////// -QString CBaseLibraryItem::GetFullName() const -{ - QString name; - if (m_library) - { - name = m_library->GetName() + "."; - } - name += m_name; - return name; -} - -////////////////////////////////////////////////////////////////////////// -QString CBaseLibraryItem::GetGroupName() -{ - QString str = GetName(); - int p = str.lastIndexOf('.'); - if (p >= 0) - { - return str.mid(0, p); - } - return ""; -} - -////////////////////////////////////////////////////////////////////////// -QString CBaseLibraryItem::GetShortName() -{ - QString str = GetName(); - int p = str.lastIndexOf('.'); - if (p >= 0) - { - return str.mid(p + 1); - } - p = str.lastIndexOf('/'); - if (p >= 0) - { - return str.mid(p + 1); - } - return str; -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryItem::SetName(const QString& name) -{ - assert(m_library); - if (name == m_name) - { - return; - } - QString oldName = GetFullName(); - m_name = name; - ((CBaseLibraryManager*)m_library->GetManager())->OnRenameItem(this, oldName); -} - -////////////////////////////////////////////////////////////////////////// -const QString& CBaseLibraryItem::GetName() const -{ - return m_name; -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryItem::GenerateId() -{ - GUID guid = AZ::Uuid::CreateRandom(); - SetGUID(guid); -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryItem::SetGUID(REFGUID guid) -{ - if (m_library) - { - ((CBaseLibraryManager*)m_library->GetManager())->RegisterItem(this, guid); - } - m_guid = guid; -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryItem::Serialize(SerializeContext& ctx) -{ - assert(m_library); - - XmlNodeRef node = ctx.node; - if (ctx.bLoading) - { - QString name = m_name; - // Loading - node->getAttr("Name", name); - - if (!ctx.bUniqName) - { - SetName(name); - } - else - { - SetName(GetLibrary()->GetManager()->MakeUniqueItemName(name)); - } - - if (!ctx.bCopyPaste) - { - GUID guid; - if (node->getAttr("Id", guid)) - { - SetGUID(guid); - } - } - } - else - { - // Saving. - node->setAttr("Name", m_name.toUtf8().data()); - node->setAttr("Id", m_guid); - node->setAttr("Library", GetLibrary()->GetName().toUtf8().data()); - } - m_bModified = false; -} - -////////////////////////////////////////////////////////////////////////// -IDataBaseLibrary* CBaseLibraryItem::GetLibrary() const -{ - return m_library; -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryItem::SetLibrary(CBaseLibrary* pLibrary) -{ - m_library = pLibrary; -} - -//! Mark library as modified. -void CBaseLibraryItem::SetModified(bool bModified) -{ - m_bModified = bModified; - if (m_bModified && m_library != nullptr) - { - m_library->SetModified(bModified); - } -} diff --git a/Code/Editor/BaseLibraryItem.h b/Code/Editor/BaseLibraryItem.h deleted file mode 100644 index 53cf0add2b..0000000000 --- a/Code/Editor/BaseLibraryItem.h +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_BASELIBRARYITEM_H -#define CRYINCLUDE_EDITOR_BASELIBRARYITEM_H -#pragma once - -#include "Include/IDataBaseItem.h" -#include "BaseLibrary.h" - -#include - -class CBaseLibrary; - -////////////////////////////////////////////////////////////////////////// -AZ_PUSH_DISABLE_DLL_EXPORT_BASECLASS_WARNING -/** Base class for all items contained in BaseLibraray. -*/ -class EDITOR_CORE_API CBaseLibraryItem - : public TRefCountBase -{ - AZ_POP_DISABLE_DLL_EXPORT_BASECLASS_WARNING -public: - CBaseLibraryItem(); - ~CBaseLibraryItem(); - - //! Set item name. - //! Its virtual, in case you want to override it in derrived item. - virtual void SetName(const QString& name); - //! Get item name. - const QString& GetName() const; - - //! Get full item name, including name of library. - //! Name formed by adding dot after name of library - //! eg. library Pickup and item PickupRL form full item name: "Pickups.PickupRL". - QString GetFullName() const; - - //! Get only nameof group from prototype. - QString GetGroupName(); - //! Get short name of prototype without group. - QString GetShortName(); - - //! Return Library this item are contained in. - //! Item can only be at one library. - IDataBaseLibrary* GetLibrary() const; - void SetLibrary(CBaseLibrary* pLibrary); - - ////////////////////////////////////////////////////////////////////////// - //! Serialize library item to archive. - virtual void Serialize(SerializeContext& ctx); - - ////////////////////////////////////////////////////////////////////////// - //! Generate new unique id for this item. - void GenerateId(); - //! Returns GUID of this material. - const GUID& GetGUID() const { return m_guid; } - - //! Mark library as modified. - void SetModified(bool bModified = true); - //! Check if library was modified. - bool IsModified() const { return m_bModified; }; - - //! Returns true if the item is registered, otherwise false - bool IsRegistered() const { return m_bRegistered; }; - - //! Validate item for errors. - virtual void Validate() {}; - - //! Get number of sub childs. - virtual int GetChildCount() const { return 0; } - //! Get sub child by index. - virtual CBaseLibraryItem* GetChild([[maybe_unused]] int index) const { return nullptr; } - - - ////////////////////////////////////////////////////////////////////////// - //! Gathers resources by this item. - virtual void GatherUsedResources([[maybe_unused]] CUsedResources& resources) {}; - - //! Get if stored item is enabled - virtual bool GetIsEnabled() { return true; }; - - - int IsParticleItem = -1; -protected: - void SetGUID(REFGUID guid); - friend class CBaseLibrary; - friend class CBaseLibraryManager; - // Name of this prototype. - QString m_name; - AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING - //! Reference to prototype library who contains this prototype. - _smart_ptr m_library; - AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING - - //! Every base library item have unique id. - GUID m_guid; - // True when item modified by editor. - bool m_bModified; - // True when item registered in manager. - bool m_bRegistered = false; -}; - -Q_DECLARE_METATYPE(CBaseLibraryItem*); - -TYPEDEF_AUTOPTR(CBaseLibraryItem); - - -#endif // CRYINCLUDE_EDITOR_BASELIBRARYITEM_H diff --git a/Code/Editor/BaseLibraryManager.cpp b/Code/Editor/BaseLibraryManager.cpp deleted file mode 100644 index 0e51a5238c..0000000000 --- a/Code/Editor/BaseLibraryManager.cpp +++ /dev/null @@ -1,822 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - - -#include "EditorDefs.h" - -#include "BaseLibraryManager.h" - -// Editor -#include "BaseLibraryItem.h" -#include "ErrorReport.h" -#include "Undo/IUndoObject.h" - -////////////////////////////////////////////////////////////////////////// -// CBaseLibraryManager implementation. -////////////////////////////////////////////////////////////////////////// -CBaseLibraryManager::CBaseLibraryManager() -{ - m_bUniqNameMap = false; - m_bUniqGuidMap = true; - GetIEditor()->RegisterNotifyListener(this); -} - -////////////////////////////////////////////////////////////////////////// -CBaseLibraryManager::~CBaseLibraryManager() -{ - ClearAll(); - GetIEditor()->UnregisterNotifyListener(this); -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::ClearAll() -{ - // Delete all items from all libraries. - for (int i = 0; i < m_libs.size(); i++) - { - m_libs[i]->RemoveAllItems(); - } - - // if we will not copy maps locally then destructors of the elements of - // the map will operate on the already invalid map object - // see: - // CBaseLibraryManager::UnregisterItem() - // CBaseLibraryManager::DeleteItem() - // CMaterial::~CMaterial() - - ItemsGUIDMap itemsGuidMap; - ItemsNameMap itemsNameMap; - - { - AZStd::lock_guard lock(m_itemsNameMapMutex); - std::swap(itemsGuidMap, m_itemsGuidMap); - std::swap(itemsNameMap, m_itemsNameMap); - - m_libs.clear(); - } -} - -////////////////////////////////////////////////////////////////////////// -IDataBaseLibrary* CBaseLibraryManager::FindLibrary(const QString& library) -{ - const int index = FindLibraryIndex(library); - return index == -1 ? nullptr : m_libs[index]; -} - -////////////////////////////////////////////////////////////////////////// -int CBaseLibraryManager::FindLibraryIndex(const QString& library) -{ - QString lib = library; - lib.replace('\\', '/'); - for (int i = 0; i < m_libs.size(); i++) - { - QString _lib = m_libs[i]->GetFilename(); - _lib.replace('\\', '/'); - if (QString::compare(lib, m_libs[i]->GetName(), Qt::CaseInsensitive) == 0 || QString::compare(lib, _lib, Qt::CaseInsensitive) == 0) - { - return i; - } - } - return -1; -} - -////////////////////////////////////////////////////////////////////////// -IDataBaseItem* CBaseLibraryManager::FindItem(REFGUID guid) const -{ - CBaseLibraryItem* pMtl = stl::find_in_map(m_itemsGuidMap, guid, nullptr); - return pMtl; -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::SplitFullItemName(const QString& fullItemName, QString& libraryName, QString& itemName) -{ - int p; - p = fullItemName.indexOf('.'); - if (p < 0 || !QString::compare(fullItemName.mid(p + 1), "mtl", Qt::CaseInsensitive)) - { - libraryName = ""; - itemName = fullItemName; - return; - } - libraryName = fullItemName.mid(0, p); - itemName = fullItemName.mid(p + 1); -} - -////////////////////////////////////////////////////////////////////////// -IDataBaseItem* CBaseLibraryManager::FindItemByName(const QString& fullItemName) -{ - AZStd::lock_guard lock(m_itemsNameMapMutex); - return stl::find_in_map(m_itemsNameMap, fullItemName, nullptr); -} - -////////////////////////////////////////////////////////////////////////// -IDataBaseItem* CBaseLibraryManager::LoadItemByName(const QString& fullItemName) -{ - QString libraryName, itemName; - SplitFullItemName(fullItemName, libraryName, itemName); - - if (!FindLibrary(libraryName)) - { - LoadLibrary(MakeFilename(libraryName)); - } - - return FindItemByName(fullItemName); -} - -////////////////////////////////////////////////////////////////////////// -IDataBaseItem* CBaseLibraryManager::FindItemByName(const char* fullItemName) -{ - return FindItemByName(QString(fullItemName)); -} - -////////////////////////////////////////////////////////////////////////// -IDataBaseItem* CBaseLibraryManager::LoadItemByName(const char* fullItemName) -{ - return LoadItemByName(QString(fullItemName)); -} - -////////////////////////////////////////////////////////////////////////// -IDataBaseItem* CBaseLibraryManager::CreateItem(IDataBaseLibrary* pLibrary) -{ - assert(pLibrary); - - // Add item to this library. - TSmartPtr pItem = MakeNewItem(); - pLibrary->AddItem(pItem); - return pItem; -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::DeleteItem(IDataBaseItem* pItem) -{ - assert(pItem); - - UnregisterItem((CBaseLibraryItem*)pItem); - if (pItem->GetLibrary()) - { - pItem->GetLibrary()->RemoveItem(pItem); - } -} - -////////////////////////////////////////////////////////////////////////// -IDataBaseLibrary* CBaseLibraryManager::LoadLibrary(const QString& inFilename, [[maybe_unused]] bool bReload) -{ - if (auto lib = FindLibrary(inFilename)) - { - return lib; - } - - TSmartPtr pLib = MakeNewLibrary(); - if (!pLib->Load(MakeFilename(inFilename))) - { - Error(QObject::tr("Failed to Load Item Library: %1").arg(inFilename).toUtf8().data()); - return nullptr; - } - - m_libs.push_back(pLib); - return pLib; -} - -////////////////////////////////////////////////////////////////////////// -int CBaseLibraryManager::GetModifiedLibraryCount() const -{ - int count = 0; - for (int i = 0; i < m_libs.size(); i++) - { - if (m_libs[i]->IsModified()) - { - count++; - } - } - return count; -} - -////////////////////////////////////////////////////////////////////////// -IDataBaseLibrary* CBaseLibraryManager::AddLibrary(const QString& library, bool bIsLevelLibrary, bool bIsLoading) -{ - // Make a filename from name of library. - QString filename = library; - - if (filename.indexOf(".xml") == -1) // if its already a filename, we don't do anything - { - filename.replace(' ', '_'); - if (!bIsLevelLibrary) - { - filename = MakeFilename(library); - } - else - { - // if its the level library it gets saved in the level and should not be concatenated with any other file name - filename = filename + ".xml"; - } - } - - IDataBaseLibrary* pBaseLib = FindLibrary(library); //library name - if (!pBaseLib) - { - pBaseLib = FindLibrary(filename); //library file name - } - if (pBaseLib) - { - return pBaseLib; - } - - CBaseLibrary* lib = MakeNewLibrary(); - lib->SetName(library); - lib->SetLevelLibrary(bIsLevelLibrary); - lib->SetFilename(filename, !bIsLoading); - // set modified to true, so even empty particle libraries get saved - lib->SetModified(true); - - m_libs.push_back(lib); - return lib; -} - -////////////////////////////////////////////////////////////////////////// -QString CBaseLibraryManager::MakeFilename(const QString& library) -{ - QString filename = library; - filename.replace(' ', '_'); - filename.replace(".xml", ""); - - // make it contain the canonical libs path: - Path::ConvertBackSlashToSlash(filename); - - QString LibsPath(GetLibsPath()); - Path::ConvertBackSlashToSlash(LibsPath); - - if (filename.left(LibsPath.length()).compare(LibsPath, Qt::CaseInsensitive) == 0) - { - filename = filename.mid(LibsPath.length()); - } - - return LibsPath + filename + ".xml"; -} - -////////////////////////////////////////////////////////////////////////// -bool CBaseLibraryManager::IsUniqueFilename(const QString& library) -{ - QString resultPath = MakeFilename(library); - CCryFile xmlFile; - // If we can find a file for the path - return !xmlFile.Open(resultPath.toUtf8().data(), "rb"); -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::DeleteLibrary(const QString& library, bool forceDeleteLevel) -{ - for (int i = 0; i < m_libs.size(); i++) - { - if (QString::compare(library, m_libs[i]->GetName(), Qt::CaseInsensitive) == 0) - { - CBaseLibrary* pLibrary = m_libs[i]; - // Check if not level library, they cannot be deleted. - if (!pLibrary->IsLevelLibrary() || forceDeleteLevel) - { - for (int j = 0; j < pLibrary->GetItemCount(); j++) - { - UnregisterItem((CBaseLibraryItem*)pLibrary->GetItem(j)); - } - pLibrary->RemoveAllItems(); - - if (pLibrary->IsLevelLibrary()) - { - m_pLevelLibrary = nullptr; - } - m_libs.erase(m_libs.begin() + i); - } - break; - } - } -} - -////////////////////////////////////////////////////////////////////////// -IDataBaseLibrary* CBaseLibraryManager::GetLibrary(int index) const -{ - assert(index >= 0 && index < m_libs.size()); - return m_libs[index]; -}; - -////////////////////////////////////////////////////////////////////////// -IDataBaseLibrary* CBaseLibraryManager::GetLevelLibrary() const -{ - IDataBaseLibrary* pLevelLib = nullptr; - - for (int i = 0; i < GetLibraryCount(); i++) - { - if (GetLibrary(i)->IsLevelLibrary()) - { - pLevelLib = GetLibrary(i); - break; - } - } - - - return pLevelLib; -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::SaveAllLibs() -{ - for (int i = 0; i < GetLibraryCount(); i++) - { - // Check if library is modified. - IDataBaseLibrary* pLibrary = GetLibrary(i); - - //Level library is saved when the level is saved - if (pLibrary->IsLevelLibrary()) - { - continue; - } - if (pLibrary->IsModified()) - { - if (pLibrary->Save()) - { - pLibrary->SetModified(false); - } - } - } -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::Serialize(XmlNodeRef& node, bool bLoading) -{ - static const char* const LEVEL_LIBRARY_TAG = "LevelLibrary"; - - QString rootNodeName = GetRootNodeName(); - if (bLoading) - { - XmlNodeRef libs = node->findChild(rootNodeName.toUtf8().data()); - if (libs) - { - for (int i = 0; i < libs->getChildCount(); i++) - { - // Load only library name. - XmlNodeRef libNode = libs->getChild(i); - if (strcmp(libNode->getTag(), LEVEL_LIBRARY_TAG) == 0) - { - if (!m_pLevelLibrary) - { - QString libName; - libNode->getAttr("Name", libName); - m_pLevelLibrary = static_cast(AddLibrary(libName, true)); - } - m_pLevelLibrary->Serialize(libNode, bLoading); - } - else - { - QString libName; - if (libNode->getAttr("Name", libName)) - { - // Load this library. - if (!FindLibrary(libName)) - { - LoadLibrary(MakeFilename(libName)); - } - } - } - } - } - } - else - { - // Save all libraries. - XmlNodeRef libs = node->newChild(rootNodeName.toUtf8().data()); - for (int i = 0; i < GetLibraryCount(); i++) - { - IDataBaseLibrary* pLib = GetLibrary(i); - if (pLib->IsLevelLibrary()) - { - // Level libraries are saved in in level. - XmlNodeRef libNode = libs->newChild(LEVEL_LIBRARY_TAG); - pLib->Serialize(libNode, bLoading); - } - else - { - // Save only library name. - XmlNodeRef libNode = libs->newChild("Library"); - libNode->setAttr("Name", pLib->GetName().toUtf8().data()); - } - } - SaveAllLibs(); - } -} - -////////////////////////////////////////////////////////////////////////// -QString CBaseLibraryManager::MakeUniqueItemName(const QString& srcName, const QString& libName) -{ - // unlikely we'll ever encounter more than 16 - std::vector possibleDuplicates; - possibleDuplicates.reserve(16); - - // search for strings in the database that might have a similar name (ignore case) - IDataBaseItemEnumerator* pEnum = GetItemEnumerator(); - for (IDataBaseItem* pItem = pEnum->GetFirst(); pItem != nullptr; pItem = pEnum->GetNext()) - { - //Check if the item is in the target library first. - IDataBaseLibrary* itemLibrary = pItem->GetLibrary(); - QString itemLibraryName; - if (itemLibrary) - { - itemLibraryName = itemLibrary->GetName(); - } - - // Item is not in the library so there cannot be a naming conflict. - if (!libName.isEmpty() && !itemLibraryName.isEmpty() && itemLibraryName != libName) - { - continue; - } - - const QString& name = pItem->GetName(); - if (name.startsWith(srcName, Qt::CaseInsensitive)) - { - possibleDuplicates.push_back(AZStd::string(name.toUtf8().data())); - } - } - pEnum->Release(); - - if (possibleDuplicates.empty()) - { - return srcName; - } - - std::sort(possibleDuplicates.begin(), possibleDuplicates.end(), [](const AZStd::string& strOne, const AZStd::string& strTwo) - { - // I can assume size sorting since if the length is different, either one of the two strings doesn't - // closely match the string we are trying to duplicate, or it's a bigger number (X1 vs X10) - if (strOne.size() != strTwo.size()) - { - return strOne.size() < strTwo.size(); - } - else - { - return azstricmp(strOne.c_str(), strTwo.c_str()) < 0; - } - } - ); - - int num = 0; - QString returnValue = srcName; - while (num < possibleDuplicates.size() && QString::compare(possibleDuplicates[num].c_str(), returnValue, Qt::CaseInsensitive) == 0) - { - returnValue = QStringLiteral("%1%2%3").arg(srcName).arg("_").arg(num); - ++num; - } - - return returnValue; -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::Validate() -{ - IDataBaseItemEnumerator* pEnum = GetItemEnumerator(); - for (IDataBaseItem* pItem = pEnum->GetFirst(); pItem != nullptr; pItem = pEnum->GetNext()) - { - pItem->Validate(); - } - pEnum->Release(); -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::RegisterItem(CBaseLibraryItem* pItem, REFGUID newGuid) -{ - assert(pItem); - - bool bNotify = false; - - if (m_bUniqGuidMap) - { - REFGUID oldGuid = pItem->GetGUID(); - if (!GuidUtil::IsEmpty(oldGuid)) - { - m_itemsGuidMap.erase(oldGuid); - } - if (GuidUtil::IsEmpty(newGuid)) - { - return; - } - CBaseLibraryItem* pOldItem = stl::find_in_map(m_itemsGuidMap, newGuid, nullptr); - if (!pOldItem) - { - pItem->m_guid = newGuid; - m_itemsGuidMap[newGuid] = pItem; - pItem->m_bRegistered = true; - bNotify = true; - } - else - { - if (pOldItem != pItem) - { - ReportDuplicateItem(pItem, pOldItem); - } - } - } - - if (m_bUniqNameMap) - { - QString fullName = pItem->GetFullName(); - if (!pItem->GetName().isEmpty()) - { - CBaseLibraryItem* pOldItem = static_cast(FindItemByName(fullName)); - if (!pOldItem) - { - AZStd::lock_guard lock(m_itemsNameMapMutex); - m_itemsNameMap[fullName] = pItem; - pItem->m_bRegistered = true; - bNotify = true; - } - else - { - if (pOldItem != pItem) - { - ReportDuplicateItem(pItem, pOldItem); - } - } - } - } - - // Notify listeners. - if (bNotify) - { - NotifyItemEvent(pItem, EDB_ITEM_EVENT_ADD); - } -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::RegisterItem(CBaseLibraryItem* pItem) -{ - assert(pItem); - - bool bNotify = false; - - if (m_bUniqGuidMap) - { - if (GuidUtil::IsEmpty(pItem->GetGUID())) - { - return; - } - CBaseLibraryItem* pOldItem = stl::find_in_map(m_itemsGuidMap, pItem->GetGUID(), nullptr); - if (!pOldItem) - { - m_itemsGuidMap[pItem->GetGUID()] = pItem; - pItem->m_bRegistered = true; - bNotify = true; - } - else - { - if (pOldItem != pItem) - { - ReportDuplicateItem(pItem, pOldItem); - } - } - } - - if (m_bUniqNameMap) - { - QString fullName = pItem->GetFullName(); - if (!fullName.isEmpty()) - { - CBaseLibraryItem* pOldItem = static_cast(FindItemByName(fullName)); - if (!pOldItem) - { - AZStd::lock_guard lock(m_itemsNameMapMutex); - m_itemsNameMap[fullName] = pItem; - pItem->m_bRegistered = true; - bNotify = true; - } - else - { - if (pOldItem != pItem) - { - ReportDuplicateItem(pItem, pOldItem); - } - } - } - } - - // Notify listeners. - if (bNotify) - { - NotifyItemEvent(pItem, EDB_ITEM_EVENT_ADD); - } -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::SetRegisteredFlag(CBaseLibraryItem* pItem, bool bFlag) -{ - pItem->m_bRegistered = bFlag; -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::ReportDuplicateItem(CBaseLibraryItem* pItem, CBaseLibraryItem* pOldItem) -{ - QString sLibName; - if (pOldItem->GetLibrary()) - { - sLibName = pOldItem->GetLibrary()->GetName(); - } - CErrorRecord err; - err.pItem = pItem; - err.error = QStringLiteral("Item %1 with duplicate GUID to loaded item %2 ignored").arg(pItem->GetFullName(), pOldItem->GetFullName()); - GetIEditor()->GetErrorReport()->ReportError(err); -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::UnregisterItem(CBaseLibraryItem* pItem) -{ - // Notify listeners. - NotifyItemEvent(pItem, EDB_ITEM_EVENT_DELETE); - - if (!pItem) - { - return; - } - - if (m_bUniqGuidMap) - { - m_itemsGuidMap.erase(pItem->GetGUID()); - } - if (m_bUniqNameMap && !pItem->GetFullName().isEmpty()) - { - AZStd::lock_guard lock(m_itemsNameMapMutex); - auto findIter = m_itemsNameMap.find(pItem->GetFullName()); - if (findIter != m_itemsNameMap.end()) - { - _smart_ptr item = findIter->second; - m_itemsNameMap.erase(findIter); - } - } - - pItem->m_bRegistered = false; -} - -////////////////////////////////////////////////////////////////////////// -QString CBaseLibraryManager::MakeFullItemName(IDataBaseLibrary* pLibrary, const QString& group, const QString& itemName) -{ - assert(pLibrary); - QString name = pLibrary->GetName() + "."; - if (!group.isEmpty()) - { - name += group + "."; - } - name += itemName; - return name; -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::GatherUsedResources(CUsedResources& resources) -{ - IDataBaseItemEnumerator* pEnum = GetItemEnumerator(); - for (IDataBaseItem* pItem = pEnum->GetFirst(); pItem != nullptr; pItem = pEnum->GetNext()) - { - pItem->GatherUsedResources(resources); - } - pEnum->Release(); -} - -////////////////////////////////////////////////////////////////////////// -IDataBaseItemEnumerator* CBaseLibraryManager::GetItemEnumerator() -{ - if (m_bUniqNameMap) - { - return new CDataBaseItemEnumerator(&m_itemsNameMap); - } - else - { - return new CDataBaseItemEnumerator(&m_itemsGuidMap); - } -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::OnEditorNotifyEvent(EEditorNotifyEvent event) -{ - switch (event) - { - case eNotify_OnBeginNewScene: - SetSelectedItem(nullptr); - ClearAll(); - break; - case eNotify_OnBeginSceneOpen: - SetSelectedItem(nullptr); - ClearAll(); - break; - case eNotify_OnCloseScene: - SetSelectedItem(nullptr); - ClearAll(); - break; - } -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::OnRenameItem(CBaseLibraryItem* pItem, const QString& oldName) -{ - m_itemsNameMapMutex.lock(); - if (!oldName.isEmpty()) - { - m_itemsNameMap.erase(oldName); - } - if (!pItem->GetFullName().isEmpty()) - { - m_itemsNameMap[pItem->GetFullName()] = pItem; - } - m_itemsNameMapMutex.unlock(); - - OnItemChanged(pItem); -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::AddListener(IDataBaseManagerListener* pListener) -{ - stl::push_back_unique(m_listeners, pListener); -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::RemoveListener(IDataBaseManagerListener* pListener) -{ - stl::find_and_erase(m_listeners, pListener); -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::NotifyItemEvent(IDataBaseItem* pItem, EDataBaseItemEvent event) -{ - // Notify listeners. - if (!m_listeners.empty()) - { - for (int i = 0; i < m_listeners.size(); i++) - { - m_listeners[i]->OnDataBaseItemEvent(pItem, event); - } - } -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::OnItemChanged(IDataBaseItem* pItem) -{ - NotifyItemEvent(pItem, EDB_ITEM_EVENT_CHANGED); -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::OnUpdateProperties(IDataBaseItem* pItem, bool bRefresh) -{ - NotifyItemEvent(pItem, bRefresh ? EDB_ITEM_EVENT_UPDATE_PROPERTIES - : EDB_ITEM_EVENT_UPDATE_PROPERTIES_NO_EDITOR_REFRESH); -} - -////////////////////////////////////////////////////////////////////////// -void CBaseLibraryManager::SetSelectedItem(IDataBaseItem* pItem) -{ - if (m_pSelectedItem == pItem) - { - return; - } - m_pSelectedItem = (CBaseLibraryItem*)pItem; - NotifyItemEvent(m_pSelectedItem, EDB_ITEM_EVENT_SELECTED); -} - -////////////////////////////////////////////////////////////////////////// -IDataBaseItem* CBaseLibraryManager::GetSelectedItem() const -{ - return m_pSelectedItem; -} - -////////////////////////////////////////////////////////////////////////// -IDataBaseItem* CBaseLibraryManager::GetSelectedParentItem() const -{ - return m_pSelectedParent; -} - -void CBaseLibraryManager::ChangeLibraryOrder(IDataBaseLibrary* lib, unsigned int newLocation) -{ - if (!lib || newLocation >= m_libs.size() || lib == m_libs[newLocation]) - { - return; - } - - for (int i = 0; i < m_libs.size(); i++) - { - if (lib == m_libs[i]) - { - _smart_ptr curLib = m_libs[i]; - m_libs.erase(m_libs.begin() + i); - m_libs.insert(m_libs.begin() + newLocation, curLib); - return; - } - } -} - -bool CBaseLibraryManager::SetLibraryName(CBaseLibrary* lib, const QString& name) -{ - // SetFilename will validate if the name is duplicate with exist libraries. - if (lib->SetFilename(MakeFilename(name))) - { - lib->SetName(name); - return true; - } - return false; -} diff --git a/Code/Editor/BaseLibraryManager.h b/Code/Editor/BaseLibraryManager.h deleted file mode 100644 index 118c7ef1f0..0000000000 --- a/Code/Editor/BaseLibraryManager.h +++ /dev/null @@ -1,226 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - - -#ifndef CRYINCLUDE_EDITOR_BASELIBRARYMANAGER_H -#define CRYINCLUDE_EDITOR_BASELIBRARYMANAGER_H -#pragma once - -#include "Include/IBaseLibraryManager.h" -#include "Include/IDataBaseItem.h" -#include "Include/IDataBaseLibrary.h" -#include "Include/IDataBaseManager.h" -#include "Util/TRefCountBase.h" -#include "Util/GuidUtil.h" -#include "BaseLibrary.h" -#include "Util/smartptr.h" -#include -#include - -AZ_PUSH_DISABLE_DLL_EXPORT_BASECLASS_WARNING -/** Manages all Libraries and Items. -*/ -class SANDBOX_API CBaseLibraryManager - : public IBaseLibraryManager -{ -AZ_POP_DISABLE_DLL_EXPORT_BASECLASS_WARNING -public: - CBaseLibraryManager(); - ~CBaseLibraryManager(); - - //! Clear all libraries. - void ClearAll() override; - - ////////////////////////////////////////////////////////////////////////// - // IDocListener implementation. - ////////////////////////////////////////////////////////////////////////// - void OnEditorNotifyEvent(EEditorNotifyEvent event) override; - - ////////////////////////////////////////////////////////////////////////// - // Library items. - ////////////////////////////////////////////////////////////////////////// - //! Make a new item in specified library. - IDataBaseItem* CreateItem(IDataBaseLibrary* pLibrary) override; - //! Delete item from library and manager. - void DeleteItem(IDataBaseItem* pItem) override; - - //! Find Item by its GUID. - IDataBaseItem* FindItem(REFGUID guid) const override; - IDataBaseItem* FindItemByName(const QString& fullItemName) override; - IDataBaseItem* LoadItemByName(const QString& fullItemName) override; - virtual IDataBaseItem* FindItemByName(const char* fullItemName); - virtual IDataBaseItem* LoadItemByName(const char* fullItemName); - - IDataBaseItemEnumerator* GetItemEnumerator() override; - - ////////////////////////////////////////////////////////////////////////// - // Set item currently selected. - void SetSelectedItem(IDataBaseItem* pItem) override; - // Get currently selected item. - IDataBaseItem* GetSelectedItem() const override; - IDataBaseItem* GetSelectedParentItem() const override; - - ////////////////////////////////////////////////////////////////////////// - // Libraries. - ////////////////////////////////////////////////////////////////////////// - //! Add Item library. - IDataBaseLibrary* AddLibrary(const QString& library, bool bIsLevelLibrary = false, bool bIsLoading = true) override; - void DeleteLibrary(const QString& library, bool forceDeleteLevel = false) override; - //! Get number of libraries. - int GetLibraryCount() const override { return static_cast(m_libs.size()); }; - //! Get number of modified libraries. - int GetModifiedLibraryCount() const override; - - //! Get Item library by index. - IDataBaseLibrary* GetLibrary(int index) const override; - - //! Get Level Item library. - IDataBaseLibrary* GetLevelLibrary() const override; - - //! Find Items Library by name. - IDataBaseLibrary* FindLibrary(const QString& library) override; - - //! Find Items Library's index by name. - int FindLibraryIndex(const QString& library) override; - - //! Load Items library. - IDataBaseLibrary* LoadLibrary(const QString& filename, bool bReload = false) override; - - //! Save all modified libraries. - void SaveAllLibs() override; - - //! Serialize property manager. - void Serialize(XmlNodeRef& node, bool bLoading) override; - - //! Export items to game. - void Export([[maybe_unused]] XmlNodeRef& node) override {}; - - //! Returns unique name base on input name. - QString MakeUniqueItemName(const QString& name, const QString& libName = "") override; - QString MakeFullItemName(IDataBaseLibrary* pLibrary, const QString& group, const QString& itemName) override; - - //! Root node where this library will be saved. - QString GetRootNodeName() override = 0; - //! Path to libraries in this manager. - QString GetLibsPath() override = 0; - - ////////////////////////////////////////////////////////////////////////// - //! Validate library items for errors. - void Validate() override; - - ////////////////////////////////////////////////////////////////////////// - void GatherUsedResources(CUsedResources& resources) override; - - void AddListener(IDataBaseManagerListener* pListener) override; - void RemoveListener(IDataBaseManagerListener* pListener) override; - - ////////////////////////////////////////////////////////////////////////// - void RegisterItem(CBaseLibraryItem* pItem, REFGUID newGuid) override; - void RegisterItem(CBaseLibraryItem* pItem) override; - void UnregisterItem(CBaseLibraryItem* pItem) override; - - // Only Used internally. - void OnRenameItem(CBaseLibraryItem* pItem, const QString& oldName) override; - - // Called by items to indicated that they have been modified. - // Sends item changed event to listeners. - void OnItemChanged(IDataBaseItem* pItem) override; - void OnUpdateProperties(IDataBaseItem* pItem, bool bRefresh) override; - - QString MakeFilename(const QString& library); - bool IsUniqueFilename(const QString& library) override; - - //CONFETTI BEGIN - // Used to change the library item order - void ChangeLibraryOrder(IDataBaseLibrary* lib, unsigned int newLocation) override; - - bool SetLibraryName(CBaseLibrary* lib, const QString& name) override; - -protected: - void SplitFullItemName(const QString& fullItemName, QString& libraryName, QString& itemName); - void NotifyItemEvent(IDataBaseItem* pItem, EDataBaseItemEvent event); - void SetRegisteredFlag(CBaseLibraryItem* pItem, bool bFlag); - - ////////////////////////////////////////////////////////////////////////// - // Must be overriden. - //! Makes a new Item. - virtual CBaseLibraryItem* MakeNewItem() = 0; - virtual CBaseLibrary* MakeNewLibrary() = 0; - ////////////////////////////////////////////////////////////////////////// - - virtual void ReportDuplicateItem(CBaseLibraryItem* pItem, CBaseLibraryItem* pOldItem); - -protected: - bool m_bUniqGuidMap; - bool m_bUniqNameMap; - - AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING - //! Array of all loaded entity items libraries. - std::vector<_smart_ptr > m_libs; - - // There is always one current level library. - TSmartPtr m_pLevelLibrary; - - // GUID to item map. - typedef std::map, guid_less_predicate> ItemsGUIDMap; - ItemsGUIDMap m_itemsGuidMap; - - // Case insensitive name to items map. - typedef std::map, stl::less_stricmp> ItemsNameMap; - ItemsNameMap m_itemsNameMap; - AZStd::mutex m_itemsNameMapMutex; - - std::vector m_listeners; - - // Currently selected item. - _smart_ptr m_pSelectedItem; - _smart_ptr m_pSelectedParent; - AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING -}; - -////////////////////////////////////////////////////////////////////////// -template -class CDataBaseItemEnumerator - : public IDataBaseItemEnumerator -{ - TMap* m_pMap; - typename TMap::iterator m_iterator; - -public: - CDataBaseItemEnumerator(TMap* pMap) - { - assert(pMap); - m_pMap = pMap; - m_iterator = m_pMap->begin(); - } - void Release() override { delete this; }; - IDataBaseItem* GetFirst() override - { - m_iterator = m_pMap->begin(); - if (m_iterator == m_pMap->end()) - { - return 0; - } - return m_iterator->second; - } - IDataBaseItem* GetNext() override - { - if (m_iterator != m_pMap->end()) - { - m_iterator++; - } - if (m_iterator == m_pMap->end()) - { - return 0; - } - return m_iterator->second; - } -}; - -#endif // CRYINCLUDE_EDITOR_BASELIBRARYMANAGER_H diff --git a/Code/Editor/ErrorRecorder.cpp b/Code/Editor/ErrorRecorder.cpp index 999dab323c..253e103527 100644 --- a/Code/Editor/ErrorRecorder.cpp +++ b/Code/Editor/ErrorRecorder.cpp @@ -7,7 +7,6 @@ */ #include "EditorDefs.h" #include "ErrorRecorder.h" -#include "BaseLibraryItem.h" #include "Include/IErrorReport.h" diff --git a/Code/Editor/ErrorRecorder.h b/Code/Editor/ErrorRecorder.h index e4b3706a16..beacc3f0e5 100644 --- a/Code/Editor/ErrorRecorder.h +++ b/Code/Editor/ErrorRecorder.h @@ -14,6 +14,8 @@ #define CRYINCLUDE_EDITOR_CORE_ERRORRECORDER_H #pragma once +#include "Include/EditorCoreAPI.h" + ////////////////////////////////////////////////////////////////////////// //! Automatic class to record and display error. class EDITOR_CORE_API CErrorsRecorder diff --git a/Code/Editor/ErrorReport.cpp b/Code/Editor/ErrorReport.cpp index 4fd7d41a96..f93ea7606d 100644 --- a/Code/Editor/ErrorReport.cpp +++ b/Code/Editor/ErrorReport.cpp @@ -67,24 +67,6 @@ QString CErrorRecord::GetErrorText() const { str += QString("\t "); } - if (pItem) - { - switch (pItem->GetType()) - { - case EDB_TYPE_MATERIAL: - str += QString("\t Material=\""); - break; - case EDB_TYPE_PARTICLE: - str += QString("\t Particle=\""); - break; - case EDB_TYPE_MUSIC: - str += QString("\t Music=\""); - break; - default: - str += QString("\t Item=\""); - } - str += pItem->GetFullName() + "\""; - } if (pObject) { str += QString("\t Object=\"") + pObject->GetName() + "\""; @@ -101,7 +83,6 @@ CErrorReport::CErrorReport() m_bImmediateMode = true; m_bShowErrors = true; m_pObject = nullptr; - m_pItem = nullptr; m_pParticle = nullptr; } @@ -140,10 +121,6 @@ void CErrorReport::ReportError(CErrorRecord& err) { err.pObject = m_pObject; } - else if (err.pItem == nullptr && m_pItem != nullptr) - { - err.pItem = m_pItem; - } m_errors.push_back(err); } bNoRecurse = false; @@ -255,12 +232,6 @@ void CErrorReport::SetCurrentValidatorObject(CBaseObject* pObject) m_pObject = pObject; } -////////////////////////////////////////////////////////////////////////// -void CErrorReport::SetCurrentValidatorItem(CBaseLibraryItem* pItem) -{ - m_pItem = pItem; -} - ////////////////////////////////////////////////////////////////////////// void CErrorReport::SetCurrentFile(const QString& file) { diff --git a/Code/Editor/ErrorReport.h b/Code/Editor/ErrorReport.h index 3b9a860301..7e2a57a421 100644 --- a/Code/Editor/ErrorReport.h +++ b/Code/Editor/ErrorReport.h @@ -17,7 +17,6 @@ // forward declarations. class CParticleItem; -#include "BaseLibraryItem.h" #include "Objects/BaseObject.h" #include "Include/IErrorReport.h" #include "ErrorRecorder.h" @@ -56,16 +55,13 @@ public: int count; //! Object that caused this error. _smart_ptr pObject; - //! Library Item that caused this error. - _smart_ptr pItem; int flags; CErrorRecord(CBaseObject* object, ESeverity _severity, const QString& _error, int _flags = 0, int _count = 0, - CBaseLibraryItem* item = 0, EValidatorModule _module = VALIDATOR_MODULE_EDITOR) + EValidatorModule _module = VALIDATOR_MODULE_EDITOR) : severity(_severity) , module(_module) , pObject(object) - , pItem(item) , flags(_flags) , count(_count) , error(_error) @@ -77,7 +73,6 @@ public: severity = ESEVERITY_WARNING; module = VALIDATOR_MODULE_EDITOR; pObject = 0; - pItem = 0; flags = 0; count = 0; } @@ -116,8 +111,6 @@ public: //! Assign current Object to which new reported warnings are assigned. void SetCurrentValidatorObject(CBaseObject* pObject); - //! Assign current Item to which new reported warnings are assigned. - void SetCurrentValidatorItem(CBaseLibraryItem* pItem); //! Assign current filename. void SetCurrentFile(const QString& file); @@ -127,7 +120,6 @@ private: bool m_bImmediateMode; bool m_bShowErrors; _smart_ptr m_pObject; - _smart_ptr m_pItem; CParticleItem* m_pParticle; QString m_currentFilename; }; diff --git a/Code/Editor/ErrorReportDialog.cpp b/Code/Editor/ErrorReportDialog.cpp index 2d551d6c8b..bbeede79ef 100644 --- a/Code/Editor/ErrorReportDialog.cpp +++ b/Code/Editor/ErrorReportDialog.cpp @@ -362,10 +362,6 @@ void CErrorReportDialog::CopyToClipboard() { str += QString::fromLatin1(" [Object: %1]").arg(pRecord->pObject->GetName()); } - if (pRecord->pItem) - { - str += QString::fromLatin1(" [Material: %1]").arg(pRecord->pItem->GetName()); - } str += QString::fromLatin1("\r\n"); } } diff --git a/Code/Editor/ErrorReportTableModel.cpp b/Code/Editor/ErrorReportTableModel.cpp index f5dce1a86d..923991bb62 100644 --- a/Code/Editor/ErrorReportTableModel.cpp +++ b/Code/Editor/ErrorReportTableModel.cpp @@ -149,11 +149,7 @@ QVariant CErrorReportTableModel::data(const CErrorRecord& record, int column, in case ColumnFile: return record.file; case ColumnObject: - if (record.pItem) - { - return record.pItem->GetFullName(); - } - else if (record.pObject) + if (record.pObject) { return record.pObject->GetName(); } diff --git a/Code/Editor/IEditor.h b/Code/Editor/IEditor.h index d2d4998187..c91ca62c5e 100644 --- a/Code/Editor/IEditor.h +++ b/Code/Editor/IEditor.h @@ -44,7 +44,6 @@ class CMusicManager; struct IEditorParticleManager; class CEAXPresetManager; class CErrorReport; -class CBaseLibraryItem; class ICommandManager; class CEditorCommandManager; class CHyperGraphManager; @@ -52,9 +51,7 @@ class CConsoleSynchronization; class CUIEnumsDatabase; struct ISourceControl; struct IEditorClassFactory; -struct IDataBaseItem; struct ITransformManipulator; -struct IDataBaseManager; class IFacialEditor; class CDialog; #if defined(AZ_PLATFORM_WINDOWS) @@ -82,8 +79,6 @@ struct IEventLoopHook; struct IErrorReport; // Vladimir@conffx struct IFileUtil; // Vladimir@conffx struct IEditorLog; // Vladimir@conffx -struct IEditorMaterialManager; // Vladimir@conffx -struct IBaseLibraryManager; // Vladimir@conffx struct IImageUtil; // Vladimir@conffx struct IEditorParticleUtils; // Leroy@conffx struct ILogFile; // Vladimir@conffx @@ -519,10 +514,6 @@ struct IEditor //! Get access to object manager. virtual struct IObjectManager* GetObjectManager() = 0; virtual CSettingsManager* GetSettingsManager() = 0; - //! Get DB manager that own items of specified type. - virtual IDataBaseManager* GetDBItemManager(EDataBaseItemType itemType) = 0; - virtual IBaseLibraryManager* GetMaterialManagerLibrary() = 0; // Vladimir@conffx - virtual IEditorMaterialManager* GetIEditorMaterialManager() = 0; // Vladimir@Conffx //! Returns IconManager. virtual IIconManager* GetIconManager() = 0; //! Get Music Manager. diff --git a/Code/Editor/IEditorImpl.cpp b/Code/Editor/IEditorImpl.cpp index 0846cf8a9e..38006c6fca 100644 --- a/Code/Editor/IEditorImpl.cpp +++ b/Code/Editor/IEditorImpl.cpp @@ -892,11 +892,6 @@ void CEditorImpl::CloseView(const GUID& classId) } } -IDataBaseManager* CEditorImpl::GetDBItemManager([[maybe_unused]] EDataBaseItemType itemType) -{ - return nullptr; -} - bool CEditorImpl::SelectColor(QColor& color, QWidget* parent) { const AZ::Color c = AzQtComponents::fromQColor(color); @@ -1624,18 +1619,6 @@ SEditorSettings* CEditorImpl::GetEditorSettings() return &gSettings; } -// Vladimir@Conffx -IBaseLibraryManager* CEditorImpl::GetMaterialManagerLibrary() -{ - return nullptr; -} - -// Vladimir@Conffx -IEditorMaterialManager* CEditorImpl::GetIEditorMaterialManager() -{ - return nullptr; -} - IImageUtil* CEditorImpl::GetImageUtil() { return m_pImageUtil; diff --git a/Code/Editor/IEditorImpl.h b/Code/Editor/IEditorImpl.h index d99b8ae802..7867912941 100644 --- a/Code/Editor/IEditorImpl.h +++ b/Code/Editor/IEditorImpl.h @@ -157,7 +157,6 @@ public: void LockSelection(bool bLock) override; bool IsSelectionLocked() override; - IDataBaseManager* GetDBItemManager(EDataBaseItemType itemType) override; CMusicManager* GetMusicManager() override { return m_pMusicManager; }; IEditorFileMonitor* GetFileMonitor() override; @@ -294,8 +293,6 @@ public: void RegisterObjectContextMenuExtension(TContextMenuExtensionFunc func) override; SSystemGlobalEnvironment* GetEnv() override; - IBaseLibraryManager* GetMaterialManagerLibrary() override; // Vladimir@Conffx - IEditorMaterialManager* GetIEditorMaterialManager() override; // Vladimir@Conffx IImageUtil* GetImageUtil() override; // Vladimir@conffx SEditorSettings* GetEditorSettings() override; ILogFile* GetLogFile() override { return m_pLogFile; } diff --git a/Code/Editor/Include/IBaseLibraryManager.h b/Code/Editor/Include/IBaseLibraryManager.h deleted file mode 100644 index 4116b573fa..0000000000 --- a/Code/Editor/Include/IBaseLibraryManager.h +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#ifndef CRYINCLUDE_EDITOR_INCLUDE_IBASELIBRARYMANAGER_H -#define CRYINCLUDE_EDITOR_INCLUDE_IBASELIBRARYMANAGER_H -#pragma once - -#include -#include "Include/IDataBaseItem.h" -#include "Include/IDataBaseLibrary.h" -#include "Include/IDataBaseManager.h" -#include "Util/TRefCountBase.h" - -class CBaseLibraryItem; -class CBaseLibrary; - -struct IBaseLibraryManager - : public TRefCountBase - , public IEditorNotifyListener -{ - //! Clear all libraries. - virtual void ClearAll() = 0; - - ////////////////////////////////////////////////////////////////////////// - // IDocListener implementation. - ////////////////////////////////////////////////////////////////////////// - virtual void OnEditorNotifyEvent(EEditorNotifyEvent event) = 0; - - ////////////////////////////////////////////////////////////////////////// - // Library items. - ////////////////////////////////////////////////////////////////////////// - //! Make a new item in specified library. - virtual IDataBaseItem* CreateItem(IDataBaseLibrary* pLibrary) = 0; - //! Delete item from library and manager. - virtual void DeleteItem(IDataBaseItem* pItem) = 0; - - //! Find Item by its GUID. - virtual IDataBaseItem* FindItem(REFGUID guid) const = 0; - virtual IDataBaseItem* FindItemByName(const QString& fullItemName) = 0; - virtual IDataBaseItem* LoadItemByName(const QString& fullItemName) = 0; - - virtual IDataBaseItemEnumerator* GetItemEnumerator() = 0; - - ////////////////////////////////////////////////////////////////////////// - // Set item currently selected. - virtual void SetSelectedItem(IDataBaseItem* pItem) = 0; - // Get currently selected item. - virtual IDataBaseItem* GetSelectedItem() const = 0; - virtual IDataBaseItem* GetSelectedParentItem() const = 0; - - ////////////////////////////////////////////////////////////////////////// - // Libraries. - ////////////////////////////////////////////////////////////////////////// - //! Add Item library. - virtual IDataBaseLibrary* AddLibrary(const QString& library, bool isLevelLibrary = false, bool bIsLoading = true) = 0; - virtual void DeleteLibrary(const QString& library, bool forceDeleteLevel = false) = 0; - //! Get number of libraries. - virtual int GetLibraryCount() const = 0; - //! Get number of modified libraries. - virtual int GetModifiedLibraryCount() const = 0; - - //! Get Item library by index. - virtual IDataBaseLibrary* GetLibrary(int index) const = 0; - - //! Get Level Item library. - virtual IDataBaseLibrary* GetLevelLibrary() const = 0; - - //! Find Items Library by name. - virtual IDataBaseLibrary* FindLibrary(const QString& library) = 0; - - //! Find the Library's index by name. - virtual int FindLibraryIndex(const QString& library) = 0; - - //! Load Items library. -#ifdef LoadLibrary -#undef LoadLibrary -#endif - virtual IDataBaseLibrary* LoadLibrary(const QString& filename, bool bReload = false) = 0; - - //! Save all modified libraries. - virtual void SaveAllLibs() = 0; - - //! Serialize property manager. - virtual void Serialize(XmlNodeRef& node, bool bLoading) = 0; - - //! Export items to game. - virtual void Export(XmlNodeRef& node) = 0; - - //! Returns unique name base on input name. - // Vera@conffx, add LibName parameter so we could make an unique name depends on input library. - // Arguments: - // - name: name of the item - // - libName: The library of the item. Given the library name, the function will return a unique name in the library - // Default value "": The function will ignore the library name and return a unique name in the manager - virtual QString MakeUniqueItemName(const QString& name, const QString& libName = "") = 0; - virtual QString MakeFullItemName(IDataBaseLibrary* pLibrary, const QString& group, const QString& itemName) = 0; - - //! Root node where this library will be saved. - virtual QString GetRootNodeName() = 0; - //! Path to libraries in this manager. - virtual QString GetLibsPath() = 0; - - ////////////////////////////////////////////////////////////////////////// - //! Validate library items for errors. - virtual void Validate() = 0; - - ////////////////////////////////////////////////////////////////////////// - virtual void GatherUsedResources(CUsedResources& resources) = 0; - - virtual void AddListener(IDataBaseManagerListener* pListener) = 0; - virtual void RemoveListener(IDataBaseManagerListener* pListener) = 0; - - ////////////////////////////////////////////////////////////////////////// - virtual void RegisterItem(CBaseLibraryItem* pItem, REFGUID newGuid) = 0; - virtual void RegisterItem(CBaseLibraryItem* pItem) = 0; - virtual void UnregisterItem(CBaseLibraryItem* pItem) = 0; - - // Only Used internally. - virtual void OnRenameItem(CBaseLibraryItem* pItem, const QString& oldName) = 0; - - // Called by items to indicated that they have been modified. - // Sends item changed event to listeners. - virtual void OnItemChanged(IDataBaseItem* pItem) = 0; - virtual void OnUpdateProperties(IDataBaseItem* pItem, bool bRefresh) = 0; - - //CONFETTI BEGIN - // Used to change the library item order - virtual void ChangeLibraryOrder(IDataBaseLibrary* lib, unsigned int newLocation) = 0; - // simplifies the library renaming process - virtual bool SetLibraryName(CBaseLibrary* lib, const QString& name) = 0; - - - //Check if the file name is unique. - //Params: library: library name. NOT the file path. - virtual bool IsUniqueFilename(const QString& library) = 0; - //CONFETTI END -}; - -#endif // CRYINCLUDE_EDITOR_INCLUDE_IBASELIBRARYMANAGER_H diff --git a/Code/Editor/Include/IDataBaseItem.h b/Code/Editor/Include/IDataBaseItem.h deleted file mode 100644 index 6be5f49c2d..0000000000 --- a/Code/Editor/Include/IDataBaseItem.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_INCLUDE_IDATABASEITEM_H -#define CRYINCLUDE_EDITOR_INCLUDE_IDATABASEITEM_H -#pragma once - -#include -#include - -struct IDataBaseLibrary; -class CUsedResources; - -////////////////////////////////////////////////////////////////////////// -/** Base class for all items contained in BaseLibraray. -*/ -struct IDataBaseItem -{ - struct SerializeContext - { - XmlNodeRef node; - bool bUndo; - bool bLoading; - bool bCopyPaste; - bool bIgnoreChilds; - bool bUniqName; - SerializeContext() - : node(0) - , bLoading(false) - , bCopyPaste(false) - , bIgnoreChilds(false) - , bUniqName(false) - , bUndo(false) {}; - SerializeContext(XmlNodeRef _node, bool bLoad) - : node(_node) - , bLoading(bLoad) - , bCopyPaste(false) - , bIgnoreChilds(false) - , bUniqName(false) - , bUndo(false) {}; - SerializeContext(const SerializeContext& ctx) - : node(ctx.node) - , bLoading(ctx.bLoading) - , bCopyPaste(ctx.bCopyPaste) - , bIgnoreChilds(ctx.bIgnoreChilds) - , bUniqName(ctx.bUniqName) - , bUndo(ctx.bUndo) {}; - }; - - virtual EDataBaseItemType GetType() const = 0; - - //! Return Library this item are contained in. - //! Item can only be at one library. - virtual IDataBaseLibrary* GetLibrary() const = 0; - - //! Change item name. - virtual void SetName(const QString& name) = 0; - //! Get item name. - virtual const QString& GetName() const = 0; - - //! Get full item name, including name of library. - //! Name formed by adding dot after name of library - //! eg. library Pickup and item PickupRL form full item name: "Pickups.PickupRL". - virtual QString GetFullName() const = 0; - - //! Get only nameof group from prototype. - virtual QString GetGroupName() = 0; - //! Get short name of prototype without group. - virtual QString GetShortName() = 0; - - //! Serialize library item to archive. - virtual void Serialize(SerializeContext& ctx) = 0; - - //! Generate new unique id for this item. - virtual void GenerateId() = 0; - //! Returns GUID of this material. - virtual const GUID& GetGUID() const = 0; - - //! Validate item for errors. - virtual void Validate() {}; - - //! Gathers resources by this item. - virtual void GatherUsedResources([[maybe_unused]] CUsedResources& resources) {}; -}; - -#endif // CRYINCLUDE_EDITOR_INCLUDE_IDATABASEITEM_H diff --git a/Code/Editor/Include/IDataBaseLibrary.h b/Code/Editor/Include/IDataBaseLibrary.h deleted file mode 100644 index 75437d93e2..0000000000 --- a/Code/Editor/Include/IDataBaseLibrary.h +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_INCLUDE_IDATABASELIBRARY_H -#define CRYINCLUDE_EDITOR_INCLUDE_IDATABASELIBRARY_H -#pragma once - - -struct IDataBaseManager; -struct IDataBaseItem; - -class QString; -class XmlNodeRef; - -////////////////////////////////////////////////////////////////////////// -// Description: -// Interface to access specific library of editor data base. -// Ex. Archetype library, Material Library. -// See Also: -// IDataBaseItem,IDataBaseManager -////////////////////////////////////////////////////////////////////////// -struct IDataBaseLibrary -{ - // Description: - // Return IDataBaseManager interface to the manager for items stored in this library. - virtual IDataBaseManager* GetManager() = 0; - - // Description: - // Return library name. - virtual const QString& GetName() const = 0; - - // Description: - // Return filename where this library is stored. - virtual const QString& GetFilename() const = 0; - - // Description: - // Save contents of library to file. - virtual bool Save() = 0; - - // Description: - // Load library from file. - // Arguments: - // filename - Full specified library filename (relative to root game folder). - virtual bool Load(const QString& filename) = 0; - - // Description: - // Serialize library parameters and items to/from XML node. - virtual void Serialize(XmlNodeRef& node, bool bLoading) = 0; - - // Description: - // Marks library as modified, indicates that some item in library was modified. - virtual void SetModified(bool bModified = true) = 0; - - // Description: - // Check if library parameters or any items where modified. - // If any item was modified library may need saving before closing editor. - virtual bool IsModified() const = 0; - - // Description: - // Check if this library is not shared and internal to current level. - virtual bool IsLevelLibrary() const = 0; - - // Description: - // Make this library accessible only from current Level. (not shared) - virtual void SetLevelLibrary(bool bEnable) = 0; - - // Description: - // Associate a new item with the library. - // Watch out if item was already in another library. - virtual void AddItem(IDataBaseItem* pItem, bool bRegister = true) = 0; - - // Description: - // Return number of items in library. - virtual int GetItemCount() const = 0; - - // Description: - // Get item by index. - // See Also: - // GetItemCount - // Arguments: - // index - Index from 0 to GetItemCount() - virtual IDataBaseItem* GetItem(int index) = 0; - - // Description: - // Remove item from library, does not destroy item, - // only unliks it from this library, to delete item use IDataBaseManager. - // See Also: - // AddItem - virtual void RemoveItem(IDataBaseItem* item) = 0; - - // Description: - // Remove all items from library, does not destroy items, - // only unliks them from this library, to delete item use IDataBaseManager. - // See Also: - // RemoveItem,AddItem - virtual void RemoveAllItems() = 0; - - // Description: - // Find item in library by name. - // This function usually uses linear search so it is not particularry fast. - // See Also: - // GetItem - virtual IDataBaseItem* FindItem(const QString& name) = 0; - - - //CONFETTI BEGIN - // Used to change the library item order - virtual void ChangeItemOrder(CBaseLibraryItem* item, unsigned int newLocation) = 0; - //CONFETTI END -}; - -#endif // CRYINCLUDE_EDITOR_INCLUDE_IDATABASELIBRARY_H diff --git a/Code/Editor/Include/IDataBaseManager.h b/Code/Editor/Include/IDataBaseManager.h deleted file mode 100644 index 3d701d51fc..0000000000 --- a/Code/Editor/Include/IDataBaseManager.h +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_INCLUDE_IDATABASEMANAGER_H -#define CRYINCLUDE_EDITOR_INCLUDE_IDATABASEMANAGER_H -#pragma once - -#include - -struct IDataBaseItem; -struct IDataBaseLibrary; -class CUsedResources; - -enum EDataBaseItemEvent -{ - EDB_ITEM_EVENT_ADD, - EDB_ITEM_EVENT_DELETE, - EDB_ITEM_EVENT_CHANGED, - EDB_ITEM_EVENT_SELECTED, - EDB_ITEM_EVENT_UPDATE_PROPERTIES, - EDB_ITEM_EVENT_UPDATE_PROPERTIES_NO_EDITOR_REFRESH -}; - -////////////////////////////////////////////////////////////////////////// -// Description: -// Callback class to intercept item creation and deletion events. -////////////////////////////////////////////////////////////////////////// -struct IDataBaseManagerListener -{ - virtual void OnDataBaseItemEvent(IDataBaseItem* pItem, EDataBaseItemEvent event) = 0; -}; - -////////////////////////////////////////////////////////////////////////// -// Description: -// his interface is used to enumerate al items registered to the database manager. -////////////////////////////////////////////////////////////////////////// -struct IDataBaseItemEnumerator -{ - virtual ~IDataBaseItemEnumerator() = default; - - virtual void Release() = 0; - virtual IDataBaseItem* GetFirst() = 0; - virtual IDataBaseItem* GetNext() = 0; -}; - -////////////////////////////////////////////////////////////////////////// -// -// Interface to the collection of all items or specific type -// in data base libraries. -// -////////////////////////////////////////////////////////////////////////// -struct IDataBaseManager -{ - //! Clear all libraries. - virtual void ClearAll() = 0; - - ////////////////////////////////////////////////////////////////////////// - // Library items. - ////////////////////////////////////////////////////////////////////////// - //! Make a new item in specified library. - virtual IDataBaseItem* CreateItem(IDataBaseLibrary* pLibrary) = 0; - //! Delete item from library and manager. - virtual void DeleteItem(IDataBaseItem* pItem) = 0; - - //! Find Item by its GUID. - virtual IDataBaseItem* FindItem(REFGUID guid) const = 0; - virtual IDataBaseItem* FindItemByName(const QString& fullItemName) = 0; - - virtual IDataBaseItemEnumerator* GetItemEnumerator() = 0; - - // Select one item in DB. - virtual void SetSelectedItem(IDataBaseItem* pItem) = 0; - - ////////////////////////////////////////////////////////////////////////// - // Libraries. - ////////////////////////////////////////////////////////////////////////// - //! Add Item library. Set isLevelLibrary to true if its the "level" library which gets saved inside the level - virtual IDataBaseLibrary* AddLibrary(const QString& library, bool isLevelLibrary = false, bool bIsLoading = true) = 0; - virtual void DeleteLibrary(const QString& library, bool forceDeleteLibrary = false) = 0; - //! Get number of libraries. - virtual int GetLibraryCount() const = 0; - //! Get Item library by index. - virtual IDataBaseLibrary* GetLibrary(int index) const = 0; - - //! Find Items Library by name. - virtual IDataBaseLibrary* FindLibrary(const QString& library) = 0; - - //! Load Items library. -#ifdef LoadLibrary -#undef LoadLibrary -#endif - virtual IDataBaseLibrary* LoadLibrary(const QString& filename, bool bReload = false) = 0; - - //! Save all modified libraries. - virtual void SaveAllLibs() = 0; - - //! Serialize property manager. - virtual void Serialize(XmlNodeRef& node, bool bLoading) = 0; - - //! Export items to game. - virtual void Export([[maybe_unused]] XmlNodeRef& node) {}; - - //! Returns unique name base on input name. - virtual QString MakeUniqueItemName(const QString& name, const QString& libName = "") = 0; - virtual QString MakeFullItemName(IDataBaseLibrary* pLibrary, const QString& group, const QString& itemName) = 0; - - //! Root node where this library will be saved. - virtual QString GetRootNodeName() = 0; - //! Path to libraries in this manager. - virtual QString GetLibsPath() = 0; - - ////////////////////////////////////////////////////////////////////////// - //! Validate library items for errors. - virtual void Validate() = 0; - - // Description: - // Collects names of all resource files used by managed items. - // Arguments: - // resources - Structure where all filenames are collected. - virtual void GatherUsedResources(CUsedResources& resources) = 0; - - ////////////////////////////////////////////////////////////////////////// - // Register listeners. - virtual void AddListener(IDataBaseManagerListener* pListener) = 0; - virtual void RemoveListener(IDataBaseManagerListener* pListener) = 0; -}; - -#endif // CRYINCLUDE_EDITOR_INCLUDE_IDATABASEMANAGER_H diff --git a/Code/Editor/Include/IEditorMaterial.h b/Code/Editor/Include/IEditorMaterial.h deleted file mode 100644 index 329b0ae53f..0000000000 --- a/Code/Editor/Include/IEditorMaterial.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#pragma once - - -#include "BaseLibraryItem.h" -#include - -struct IEditorMaterial - : public CBaseLibraryItem -{ - virtual int GetFlags() const = 0; - virtual IMaterial* GetMatInfo(bool bUseExistingEngineMaterial = false) = 0; - virtual void DisableHighlightForFrame() = 0; -}; diff --git a/Code/Editor/Include/IEditorMaterialManager.h b/Code/Editor/Include/IEditorMaterialManager.h deleted file mode 100644 index 6f71c5ddd1..0000000000 --- a/Code/Editor/Include/IEditorMaterialManager.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#ifndef CRYINCLUDE_EDITOR_MATERIAL_IEDITORMATERIALMANAGER_H -#define CRYINCLUDE_EDITOR_MATERIAL_IEDITORMATERIALMANAGER_H -#pragma once - -#include -#include - - -struct IEditorMaterialManager -{ - virtual void GotoMaterial(IMaterial* pMaterial) = 0; -}; - -#endif // CRYINCLUDE_EDITOR_MATERIAL_MATERIALMANAGER_H diff --git a/Code/Editor/Include/IErrorReport.h b/Code/Editor/Include/IErrorReport.h index 7bf00d6973..c409dbc7dd 100644 --- a/Code/Editor/Include/IErrorReport.h +++ b/Code/Editor/Include/IErrorReport.h @@ -14,7 +14,6 @@ // forward declarations. class CParticleItem; class CBaseObject; -class CBaseLibraryItem; class CErrorRecord; class QString; @@ -52,9 +51,6 @@ struct IErrorReport //! Assign current Object to which new reported warnings are assigned. virtual void SetCurrentValidatorObject(CBaseObject* pObject) = 0; - //! Assign current Item to which new reported warnings are assigned. - virtual void SetCurrentValidatorItem(CBaseLibraryItem* pItem) = 0; - //! Assign current filename. virtual void SetCurrentFile(const QString& file) = 0; }; diff --git a/Code/Editor/Lib/Tests/IEditorMock.h b/Code/Editor/Lib/Tests/IEditorMock.h index 590f98e6d7..aaee34c2c6 100644 --- a/Code/Editor/Lib/Tests/IEditorMock.h +++ b/Code/Editor/Lib/Tests/IEditorMock.h @@ -85,9 +85,6 @@ public: MOCK_METHOD0(IsSelectionLocked, bool()); MOCK_METHOD0(GetObjectManager, struct IObjectManager* ()); MOCK_METHOD0(GetSettingsManager, CSettingsManager* ()); - MOCK_METHOD1(GetDBItemManager, IDataBaseManager* (EDataBaseItemType)); - MOCK_METHOD0(GetMaterialManagerLibrary, IBaseLibraryManager* ()); - MOCK_METHOD0(GetIEditorMaterialManager, IEditorMaterialManager* ()); MOCK_METHOD0(GetIconManager, IIconManager* ()); MOCK_METHOD0(GetMusicManager, CMusicManager* ()); MOCK_METHOD2(GetTerrainElevation, float(float , float )); diff --git a/Code/Editor/TrackView/TrackViewSequenceManager.cpp b/Code/Editor/TrackView/TrackViewSequenceManager.cpp index d7c1e3c709..515af4df38 100644 --- a/Code/Editor/TrackView/TrackViewSequenceManager.cpp +++ b/Code/Editor/TrackView/TrackViewSequenceManager.cpp @@ -408,20 +408,6 @@ void CTrackViewSequenceManager::OnSequenceRemoved(CTrackViewSequence* sequence) } } -//////////////////////////////////////////////////////////////////////////// -void CTrackViewSequenceManager::OnDataBaseItemEvent([[maybe_unused]] IDataBaseItem* pItem, EDataBaseItemEvent event) -{ - if (event != EDataBaseItemEvent::EDB_ITEM_EVENT_ADD) - { - const size_t numSequences = m_sequences.size(); - - for (size_t i = 0; i < numSequences; ++i) - { - m_sequences[i]->UpdateDynamicParams(); - } - } -} - //////////////////////////////////////////////////////////////////////////// CTrackViewAnimNodeBundle CTrackViewSequenceManager::GetAllRelatedAnimNodes(const AZ::EntityId entityId) const { diff --git a/Code/Editor/TrackView/TrackViewSequenceManager.h b/Code/Editor/TrackView/TrackViewSequenceManager.h index 1474323dc6..6c65a7f1a9 100644 --- a/Code/Editor/TrackView/TrackViewSequenceManager.h +++ b/Code/Editor/TrackView/TrackViewSequenceManager.h @@ -13,13 +13,11 @@ #include "TrackViewSequence.h" -#include "IDataBaseManager.h" #include class CTrackViewSequenceManager : public IEditorNotifyListener - , public IDataBaseManagerListener , public ITrackViewSequenceManager , public AZ::EntitySystemBus::Handler { @@ -65,8 +63,6 @@ private: void OnSequenceAdded(CTrackViewSequence* pSequence); void OnSequenceRemoved(CTrackViewSequence* pSequence); - void OnDataBaseItemEvent(IDataBaseItem* pItem, EDataBaseItemEvent event) override; - // AZ::EntitySystemBus void OnEntityNameChanged(const AZ::EntityId& entityId, const AZStd::string& name) override; void OnEntityDestruction(const AZ::EntityId& entityId) override; diff --git a/Code/Editor/Viewport.h b/Code/Editor/Viewport.h index a71df6a9cd..1b0e5a4d93 100644 --- a/Code/Editor/Viewport.h +++ b/Code/Editor/Viewport.h @@ -46,7 +46,6 @@ struct HitContext; struct IRenderListener; class CImageEx; class QMenu; -struct IDataBaseItem; /** Type of viewport. */ @@ -230,8 +229,6 @@ public: // Drag and drop support on viewports. // To be overrided in derived classes. ////////////////////////////////////////////////////////////////////////// - virtual bool CanDrop([[maybe_unused]] const QPoint& point, [[maybe_unused]] IDataBaseItem* pItem) { return false; }; - virtual void Drop([[maybe_unused]] const QPoint& point, [[maybe_unused]] IDataBaseItem* pItem) {}; virtual void SetGlobalDropCallback(DropCallback dropCallback, void* dropCallbackCustom) { m_dropCallback = dropCallback; diff --git a/Code/Editor/editor_core_files.cmake b/Code/Editor/editor_core_files.cmake index 53dd8d79a5..1f0a5a3618 100644 --- a/Code/Editor/editor_core_files.cmake +++ b/Code/Editor/editor_core_files.cmake @@ -7,17 +7,12 @@ # set(FILES - BaseLibrary.h - BaseLibraryItem.h UsedResources.h UIEnumsDatabase.h Include/EditorCoreAPI.cpp Include/IErrorReport.h - Include/IBaseLibraryManager.h Include/IFileUtil.h Include/EditorCoreAPI.h - Include/IEditorMaterial.h - Include/IEditorMaterialManager.h Include/IImageUtil.h Controls/ReflectedPropertyControl/ReflectedPropertyCtrl.qrc Controls/ReflectedPropertyControl/ReflectedPropertyCtrl.cpp @@ -35,8 +30,6 @@ set(FILES Controls/QBitmapPreviewDialogImp.h Controls/QToolTipWidget.h Controls/QToolTipWidget.cpp - BaseLibraryItem.cpp - BaseLibrary.cpp UsedResources.cpp UIEnumsDatabase.cpp LyViewPaneNames.h diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index c81a326aff..59a1a91647 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -271,9 +271,6 @@ set(FILES Include/HitContext.h Include/ICommandManager.h Include/IConsoleConnectivity.h - Include/IDataBaseItem.h - Include/IDataBaseLibrary.h - Include/IDataBaseManager.h Include/IDisplayViewport.h Include/IEditorClassFactory.h Include/IEventLoopHook.h @@ -369,9 +366,6 @@ set(FILES ActionManager.h ShortcutDispatcher.cpp ShortcutDispatcher.h - BaseLibraryManager.cpp - BaseLibraryItem.h - BaseLibraryManager.h CheckOutDialog.cpp CheckOutDialog.h CheckOutDialog.ui From 353d4bb2bb7515c2ee4e05b175626abb2c16cbaf Mon Sep 17 00:00:00 2001 From: Allen Jackson <23512001+jackalbe@users.noreply.github.com> Date: Thu, 6 Jan 2022 11:47:04 -0600 Subject: [PATCH 353/948] {lyn8938} looks into the asset database to detect products (#6709) Signed-off-by: Allen Jackson <23512001+jackalbe@users.noreply.github.com> --- .../PythonAssetBuilder/AssetBuilder_test.py | 41 ++++++++++++++----- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/PythonAssetBuilder/AssetBuilder_test.py b/AutomatedTesting/Gem/PythonTests/PythonAssetBuilder/AssetBuilder_test.py index 45e633a979..cb2c445246 100644 --- a/AutomatedTesting/Gem/PythonTests/PythonAssetBuilder/AssetBuilder_test.py +++ b/AutomatedTesting/Gem/PythonTests/PythonAssetBuilder/AssetBuilder_test.py @@ -12,12 +12,36 @@ import sys import os import pytest import logging +import sqlite3 pytest.importorskip('ly_test_tools') import ly_test_tools.environment.file_system as file_system import ly_test_tools.log.log_monitor import ly_test_tools.environment.waiter as waiter +def detect_product(sql_connection, platform, target): + cur = sql_connection.cursor() + product_target = f'{platform}/{target}' + print(f'Detecting {product_target} in assetdb.sqlite') + hits = 0 + for row in cur.execute(f'select ProductID from Products where ProductName is "{product_target}"'): + hits = hits + 1 + assert hits == 1 + + +def find_products(cache_folder, platform): + con = sqlite3.connect(os.path.join(cache_folder, 'assetdb.sqlite')) + detect_product(con, platform, 'gem/pythontests/pythonassetbuilder/test_asset.mock_asset') + detect_product(con, platform, 'gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_z_positive_1.azmodel') + detect_product(con, platform, 'gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_z_negative_1.azmodel') + detect_product(con, platform, 'gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_y_positive_1.azmodel') + detect_product(con, platform, 'gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_y_negative_1.azmodel') + detect_product(con, platform, 'gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_x_positive_1.azmodel') + detect_product(con, platform, 'gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_x_negative_1.azmodel') + detect_product(con, platform, 'gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_center_1.azmodel') + con.close() + + @pytest.mark.SUITE_periodic @pytest.mark.parametrize('launcher_platform', ['windows_editor']) @pytest.mark.parametrize('project', ['AutomatedTesting']) @@ -25,16 +49,7 @@ import ly_test_tools.environment.waiter as waiter class TestPythonAssetProcessing(object): def test_DetectPythonCreatedAsset(self, request, editor, level, launcher_platform): unexpected_lines = [] - expected_lines = [ - 'Mock asset exists', - 'AssetId found for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_z_positive_1.azmodel) found', - 'AssetId found for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_z_negative_1.azmodel) found', - 'AssetId found for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_y_positive_1.azmodel) found', - 'AssetId found for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_y_negative_1.azmodel) found', - 'AssetId found for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_x_positive_1.azmodel) found', - 'AssetId found for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_x_negative_1.azmodel) found', - 'AssetId found for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_center_1.azmodel) found' - ] + expected_lines = [] timeout = 180 halt_on_unexpected = False test_directory = os.path.join(os.path.dirname(__file__)) @@ -50,3 +65,9 @@ class TestPythonAssetProcessing(object): exc=("Log file '{}' was never opened by another process.".format(editorlog_file)), interval=1) log_monitor.monitor_log_for_lines(expected_lines, unexpected_lines, halt_on_unexpected, timeout) + + cache_folder = editor.workspace.paths.cache() + platform = editor.workspace.asset_processor_platform + if platform == 'windows': + platform = 'pc' + find_products(cache_folder, platform) From e5c2d574fc06a377a6015b7d49f34dbc9806ffc9 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Thu, 6 Jan 2022 12:51:10 -0600 Subject: [PATCH 354/948] Added a missing include and forward declare Signed-off-by: Chris Galvan --- Code/Editor/Objects/EntityObject.h | 1 + Code/Editor/TrackView/TrackViewSequence.h | 1 + 2 files changed, 2 insertions(+) diff --git a/Code/Editor/Objects/EntityObject.h b/Code/Editor/Objects/EntityObject.h index c3e379bccc..c6b7e4ce2d 100644 --- a/Code/Editor/Objects/EntityObject.h +++ b/Code/Editor/Objects/EntityObject.h @@ -27,6 +27,7 @@ #define CLASS_ENVIRONMENT_LIGHT "EnvironmentLight" class CEntityObject; +class CSelectionGroup; class QMenu; /*! diff --git a/Code/Editor/TrackView/TrackViewSequence.h b/Code/Editor/TrackView/TrackViewSequence.h index a392ad00f9..8f686af0cb 100644 --- a/Code/Editor/TrackView/TrackViewSequence.h +++ b/Code/Editor/TrackView/TrackViewSequence.h @@ -11,6 +11,7 @@ #define CRYINCLUDE_EDITOR_TRACKVIEW_TRACKVIEWSEQUENCE_H #pragma once +#include #include "IMovieSystem.h" #include From 603967d61f62b09688d5f30c87edd86074452519 Mon Sep 17 00:00:00 2001 From: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> Date: Thu, 6 Jan 2022 11:04:54 -0800 Subject: [PATCH 355/948] Fixed build issues with Spawnable Entity Aliases. Signed-off-by: AMZN-koppersr <82230785+AMZN-koppersr@users.noreply.github.com> --- Gems/Multiplayer/Code/Tests/PrefabProcessingTests.cpp | 5 ++++- Gems/Prefab/PrefabBuilder/PrefabBuilderTests.cpp | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Gems/Multiplayer/Code/Tests/PrefabProcessingTests.cpp b/Gems/Multiplayer/Code/Tests/PrefabProcessingTests.cpp index 42a817987e..aef13fbfe2 100644 --- a/Gems/Multiplayer/Code/Tests/PrefabProcessingTests.cpp +++ b/Gems/Multiplayer/Code/Tests/PrefabProcessingTests.cpp @@ -57,6 +57,7 @@ namespace UnitTest TEST_F(PrefabProcessingTestFixture, NetworkPrefabProcessor_ProcessPrefabTwoEntities_NetEntityGoesToNetSpawnable) { using AzToolsFramework::Prefab::PrefabConversionUtils::PrefabProcessorContext; + using AzToolsFramework::Prefab::PrefabConversionUtils::PrefabDocument; AZStd::vector entities; @@ -74,7 +75,9 @@ namespace UnitTest // Add the prefab into the Prefab Processor Context const AZStd::string prefabName = "testPrefab"; PrefabProcessorContext prefabProcessorContext{AZ::Uuid::CreateRandom()}; - prefabProcessorContext.AddPrefab(prefabName, AZStd::move(prefabDom)); + PrefabDocument document(prefabName); + ASSERT_TRUE(document.SetPrefabDom(AZStd::move(prefabDom))); + prefabProcessorContext.AddPrefab(AZStd::move(document)); // Request NetworkPrefabProcessor to process the prefab Multiplayer::NetworkPrefabProcessor processor; diff --git a/Gems/Prefab/PrefabBuilder/PrefabBuilderTests.cpp b/Gems/Prefab/PrefabBuilder/PrefabBuilderTests.cpp index 2ed05b4dfe..5ee23a9e3c 100644 --- a/Gems/Prefab/PrefabBuilder/PrefabBuilderTests.cpp +++ b/Gems/Prefab/PrefabBuilder/PrefabBuilderTests.cpp @@ -106,7 +106,8 @@ namespace UnitTest AzToolsFramework::Prefab::PrefabDom prefabDom; prefabDom.CopyFrom(prefabSystemComponentInterface->FindTemplateDom(parentInstance->GetTemplateId()), prefabDom.GetAllocator(), false); - ASSERT_TRUE(prefabBuilderComponent.ProcessPrefab({AZ::Crc32("pc")}, "parent.prefab", "unused", AZ::Uuid(), prefabDom, jobProducts)); + ASSERT_TRUE(prefabBuilderComponent.ProcessPrefab( + { AZ::Crc32("pc") }, "parent.prefab", "unused", AZ::Uuid(), AZStd::move(prefabDom), jobProducts)); ASSERT_EQ(jobProducts.size(), 1); ASSERT_EQ(jobProducts[0].m_dependencies.size(), 1); From 7b172667cfe321982b7594bc70fe530bf60604a9 Mon Sep 17 00:00:00 2001 From: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> Date: Thu, 6 Jan 2022 13:13:00 -0600 Subject: [PATCH 356/948] Adding info lines for debugging File Menu tests and waits during drag and drop operations in Docking test Signed-off-by: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> --- .../editor/EditorScripts/Docking_BasicDockedTools.py | 9 ++++++--- .../editor/EditorScripts/Menus_EditMenuOptions.py | 1 + .../editor/EditorScripts/Menus_FileMenuOptions.py | 1 + .../editor/EditorScripts/Menus_ViewMenuOptions.py | 1 + 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Docking_BasicDockedTools.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Docking_BasicDockedTools.py index d83db7d90c..8734769225 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Docking_BasicDockedTools.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Docking_BasicDockedTools.py @@ -85,22 +85,25 @@ def Docking_BasicDockedTools(): # We drag/drop it over the viewport since it doesn't allow docking, so this will undock it render_overlay = editor_window.findChild(QtWidgets.QWidget, "renderOverlay") pyside_utils.drag_and_drop(entity_outliner, render_overlay) - + general.idle_wait(0.5) + # We need to grab a new reference to the Entity Outliner QDockWidget because when it gets moved - # to the floating window, its parent changes so the wrapped intance we had becomes invalid + # to the floating window, its parent changes so the wrapped instance we had becomes invalid entity_outliner = editor_window.findChild(QtWidgets.QDockWidget, "Entity Outliner") # Dock the Entity Inspector tabbed with the floating Entity Outliner entity_inspector = editor_window.findChild(QtWidgets.QDockWidget, "Entity Inspector") pyside_utils.drag_and_drop(entity_inspector, entity_outliner) + general.idle_wait(0.5) # We need to grab a new reference to the Entity Inspector QDockWidget because when it gets moved - # to the floating window, its parent changes so the wrapped intance we had becomes invalid + # to the floating window, its parent changes so the wrapped instance we had becomes invalid entity_inspector = editor_window.findChild(QtWidgets.QDockWidget, "Entity Inspector") # Dock the Console tabbed with the floating Entity Inspector console = editor_window.findChild(QtWidgets.QDockWidget, "Console") pyside_utils.drag_and_drop(console, entity_inspector) + general.idle_wait(0.5) # Check to ensure all the tools are parented to the same QStackedWidget def check_all_panes_tabbed(): diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_EditMenuOptions.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_EditMenuOptions.py index 7d72d76776..0536575893 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_EditMenuOptions.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_EditMenuOptions.py @@ -64,6 +64,7 @@ def Menus_EditMenuOptions_Work(): for option in edit_menu_options: try: action = pyside_utils.get_action_for_menu_path(editor_window, "Edit", *option) + Report.info(f"Triggering {action.iconText()}") action.trigger() action_triggered = True except Exception as e: diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py index cade2125e2..a4e702cbd1 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py @@ -53,6 +53,7 @@ def Menus_FileMenuOptions_Work(): for option in file_menu_options: try: action = pyside_utils.get_action_for_menu_path(editor_window, "File", *option) + Report.info(f"Triggering {action.iconText()}") action.trigger() action_triggered = True except Exception as e: diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_ViewMenuOptions.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_ViewMenuOptions.py index 2d92fdb97c..e2ee3e2a55 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_ViewMenuOptions.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_ViewMenuOptions.py @@ -52,6 +52,7 @@ def Menus_ViewMenuOptions_Work(): for option in view_menu_options: try: action = pyside_utils.get_action_for_menu_path(editor_window, "View", *option) + Report.info(f"Triggering {action.iconText()}") action.trigger() action_triggered = True except Exception as e: From 53e6f0f99f44430ccdc7bde0518fc3f8e11a4cd8 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Thu, 6 Jan 2022 13:27:44 -0600 Subject: [PATCH 357/948] Added another missing include Signed-off-by: Chris Galvan --- Code/Editor/ErrorReport.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Code/Editor/ErrorReport.h b/Code/Editor/ErrorReport.h index 7e2a57a421..a80bb36404 100644 --- a/Code/Editor/ErrorReport.h +++ b/Code/Editor/ErrorReport.h @@ -18,6 +18,7 @@ class CParticleItem; #include "Objects/BaseObject.h" +#include "Include/EditorCoreAPI.h" #include "Include/IErrorReport.h" #include "ErrorRecorder.h" From d3b36f18148744d477d751c628e647f11a3efd59 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Thu, 6 Jan 2022 13:55:52 -0600 Subject: [PATCH 358/948] Added a couple more missing includes Signed-off-by: Chris Galvan --- Code/Editor/ErrorReport.h | 3 +++ Code/Editor/Objects/ObjectLoader.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/Code/Editor/ErrorReport.h b/Code/Editor/ErrorReport.h index a80bb36404..98d230e383 100644 --- a/Code/Editor/ErrorReport.h +++ b/Code/Editor/ErrorReport.h @@ -17,6 +17,9 @@ // forward declarations. class CParticleItem; +#include +#include + #include "Objects/BaseObject.h" #include "Include/EditorCoreAPI.h" #include "Include/IErrorReport.h" diff --git a/Code/Editor/Objects/ObjectLoader.h b/Code/Editor/Objects/ObjectLoader.h index fc1014ad03..fa576fa983 100644 --- a/Code/Editor/Objects/ObjectLoader.h +++ b/Code/Editor/Objects/ObjectLoader.h @@ -13,6 +13,8 @@ #include "ErrorReport.h" #include +#include + class CErrorRecord; struct IObjectManager; From 741a9059f6540f44c252edeb5780c592efe18c9c Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 12:13:23 -0800 Subject: [PATCH 359/948] More packaging cleanup (#6728) Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../build/Platform/Android/build_config.json | 10 ---------- scripts/build/Platform/Android/pipeline.json | 3 --- scripts/build/Platform/Linux/pipeline.json | 3 --- scripts/build/Platform/Mac/build_config.json | 10 ---------- scripts/build/Platform/Mac/pipeline.json | 3 --- .../build/Platform/Windows/build_config.json | 20 ------------------- scripts/build/Platform/Windows/pipeline.json | 3 --- scripts/build/Platform/iOS/pipeline.json | 3 --- 8 files changed, 55 deletions(-) diff --git a/scripts/build/Platform/Android/build_config.json b/scripts/build/Platform/Android/build_config.json index 06fa1ffb5f..7a7e90c0b0 100644 --- a/scripts/build/Platform/Android/build_config.json +++ b/scripts/build/Platform/Android/build_config.json @@ -41,16 +41,6 @@ "CMAKE_BUILD_ARGS":"-j!NUMBER_OF_PROCESSORS!" } }, - "android_packaging_all": { - "TAGS": [ - "packaging" - ], - "COMMAND": "../Windows/python_windows.cmd", - "PARAMETERS": { - "SCRIPT_PATH": "scripts/build/package/package.py", - "SCRIPT_PARAMETERS": "--platform Android --type all" - } - }, "profile": { "TAGS":[ "weekly-build-metrics", diff --git a/scripts/build/Platform/Android/pipeline.json b/scripts/build/Platform/Android/pipeline.json index 230d5d3477..f0292f4501 100644 --- a/scripts/build/Platform/Android/pipeline.json +++ b/scripts/build/Platform/Android/pipeline.json @@ -12,9 +12,6 @@ "daily-pipeline-metrics": { "CLEAN_WORKSPACE": true }, - "packaging": { - "CLEAN_WORKSPACE": true - }, "nightly-clean": { "CLEAN_WORKSPACE": true } diff --git a/scripts/build/Platform/Linux/pipeline.json b/scripts/build/Platform/Linux/pipeline.json index d10e2886f2..e9667d312d 100644 --- a/scripts/build/Platform/Linux/pipeline.json +++ b/scripts/build/Platform/Linux/pipeline.json @@ -10,9 +10,6 @@ "daily-pipeline-metrics": { "CLEAN_WORKSPACE": true }, - "packaging": { - "CLEAN_WORKSPACE": true - }, "nightly-clean": { "CLEAN_WORKSPACE": true } diff --git a/scripts/build/Platform/Mac/build_config.json b/scripts/build/Platform/Mac/build_config.json index fb960a96fa..6ba264cdb2 100644 --- a/scripts/build/Platform/Mac/build_config.json +++ b/scripts/build/Platform/Mac/build_config.json @@ -153,16 +153,6 @@ "CMAKE_TARGET": "ALL_BUILD" } }, - "mac_packaging_all": { - "TAGS": [ - "packaging" - ], - "COMMAND": "python_mac.sh", - "PARAMETERS": { - "SCRIPT_PATH": "scripts/build/package/package.py", - "SCRIPT_PARAMETERS": "--platform Mac --type all" - } - }, "install_profile": { "TAGS": [], "COMMAND": "build_mac.sh", diff --git a/scripts/build/Platform/Mac/pipeline.json b/scripts/build/Platform/Mac/pipeline.json index e8cea0f06d..24f42a0c69 100644 --- a/scripts/build/Platform/Mac/pipeline.json +++ b/scripts/build/Platform/Mac/pipeline.json @@ -10,9 +10,6 @@ "daily-pipeline-metrics": { "CLEAN_WORKSPACE": true }, - "packaging": { - "CLEAN_WORKSPACE": true - }, "nightly-clean": { "CLEAN_WORKSPACE": true } diff --git a/scripts/build/Platform/Windows/build_config.json b/scripts/build/Platform/Windows/build_config.json index c591ca0eac..e3d5a4a3fc 100644 --- a/scripts/build/Platform/Windows/build_config.json +++ b/scripts/build/Platform/Windows/build_config.json @@ -59,26 +59,6 @@ "SCRIPT_PARAMETERS": "--platform=Windows --repository=%REPOSITORY_NAME% --jobname=%JOB_NAME% --jobnumber=%BUILD_NUMBER% --jobnode=%NODE_LABEL% --changelist=%CHANGE_ID%" } }, - "windows_packaging_all": { - "TAGS": [ - "packaging" - ], - "COMMAND": "python_windows.cmd", - "PARAMETERS": { - "SCRIPT_PATH": "scripts/build/package/package.py", - "SCRIPT_PARAMETERS": "--platform Windows --type all" - } - }, - "3rdParty_all": { - "TAGS": [ - "packaging" - ], - "COMMAND": "python_windows.cmd", - "PARAMETERS": { - "SCRIPT_PATH": "scripts/build/package/package.py", - "SCRIPT_PARAMETERS": "--platform 3rdParty --type 3rdParty_all" - } - }, "test_impact_analysis_profile": { "TAGS": [ ], diff --git a/scripts/build/Platform/Windows/pipeline.json b/scripts/build/Platform/Windows/pipeline.json index b18a1e8c63..28d8437408 100644 --- a/scripts/build/Platform/Windows/pipeline.json +++ b/scripts/build/Platform/Windows/pipeline.json @@ -10,9 +10,6 @@ "daily-pipeline-metrics": { "CLEAN_WORKSPACE": true }, - "packaging": { - "CLEAN_WORKSPACE": true - }, "nightly-clean": { "CLEAN_WORKSPACE": true } diff --git a/scripts/build/Platform/iOS/pipeline.json b/scripts/build/Platform/iOS/pipeline.json index a5e2ff710e..369152a7a4 100644 --- a/scripts/build/Platform/iOS/pipeline.json +++ b/scripts/build/Platform/iOS/pipeline.json @@ -10,9 +10,6 @@ "daily-pipeline-metrics": { "CLEAN_WORKSPACE": true }, - "packaging": { - "CLEAN_WORKSPACE": true - }, "nightly-clean": { "CLEAN_WORKSPACE": true } From ad9bcba6e283d0d935473dea04fe2894689b4001 Mon Sep 17 00:00:00 2001 From: Vincent Liu <5900509+onecent1101@users.noreply.github.com> Date: Thu, 6 Jan 2022 13:17:48 -0800 Subject: [PATCH 360/948] [Linux] Update to use AWSNativeSDK 1.9.50 (#6715) --- Gems/AWSCore/Code/Platform/Linux/AWSCore_Traits_Linux.h | 2 +- cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gems/AWSCore/Code/Platform/Linux/AWSCore_Traits_Linux.h b/Gems/AWSCore/Code/Platform/Linux/AWSCore_Traits_Linux.h index d7b1f32461..2cacfb0d34 100644 --- a/Gems/AWSCore/Code/Platform/Linux/AWSCore_Traits_Linux.h +++ b/Gems/AWSCore/Code/Platform/Linux/AWSCore_Traits_Linux.h @@ -7,4 +7,4 @@ */ #pragma once -#define AWSCORE_BACKWARD_INCOMPATIBLE_CHANGE 0 +#define AWSCORE_BACKWARD_INCOMPATIBLE_CHANGE 1 diff --git a/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake b/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake index 109ae75f38..f7bc2721ae 100644 --- a/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake +++ b/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake @@ -24,7 +24,7 @@ ly_associate_package(PACKAGE_NAME xxhash-0.7.4-rev1-multiplatform ly_associate_package(PACKAGE_NAME AWSGameLiftServerSDK-3.4.1-rev1-linux TARGETS AWSGameLiftServerSDK PACKAGE_HASH a8149a95bd100384af6ade97e2b21a56173740d921e6c3da8188cd51554d39af) ly_associate_package(PACKAGE_NAME tiff-4.2.0.15-rev3-linux TARGETS TIFF PACKAGE_HASH 2377f48b2ebc2d1628d9f65186c881544c92891312abe478a20d10b85877409a) ly_associate_package(PACKAGE_NAME freetype-2.10.4.16-linux TARGETS freetype PACKAGE_HASH 3f10c703d9001ecd2bb51a3bd003d3237c02d8f947ad0161c0252fdc54cbcf97) -ly_associate_package(PACKAGE_NAME AWSNativeSDK-1.7.167-rev6-linux TARGETS AWSNativeSDK PACKAGE_HASH 490291e4c8057975c3ab86feb971b8a38871c58bac5e5d86abdd1aeb7141eec4) +ly_associate_package(PACKAGE_NAME AWSNativeSDK-1.9.50-rev1-linux TARGETS AWSNativeSDK PACKAGE_HASH f30b6969c6732a7c1a23a59d205a150633a7f219dcb60d837b543888d2c63ea1) 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-rev5-linux TARGETS PhysX PACKAGE_HASH fa72365df409376aef02d1763194dc91d255bdfcb4e8febcfbb64d23a3e50b96) ly_associate_package(PACKAGE_NAME mcpp-2.7.2_az.2-rev1-linux TARGETS mcpp PACKAGE_HASH df7a998d0bc3fedf44b5bdebaf69ddad6033355b71a590e8642445ec77bc6c41) From f1c8fbe7c07fadb288466909877f8a445b04e469 Mon Sep 17 00:00:00 2001 From: mrieggeramzn Date: Thu, 6 Jan 2022 13:45:54 -0800 Subject: [PATCH 361/948] remove std and replace with az Signed-off-by: mrieggeramzn --- .../Tests/PropertyIntCtrlCommonTests.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Code/Framework/AzToolsFramework/Tests/PropertyIntCtrlCommonTests.h b/Code/Framework/AzToolsFramework/Tests/PropertyIntCtrlCommonTests.h index 1bd6f72a19..6710d4b7cd 100644 --- a/Code/Framework/AzToolsFramework/Tests/PropertyIntCtrlCommonTests.h +++ b/Code/Framework/AzToolsFramework/Tests/PropertyIntCtrlCommonTests.h @@ -113,19 +113,17 @@ namespace UnitTest auto& widget = m_widget; auto& handler = m_handler; QString tooltip; - std::stringstream expected; // Retrieve the tooltip string for this widget auto success = handler->ModifyTooltip(widget, tooltip); const QString minString = QLocale().toString(widget->minimum()); const QString maxString = QLocale().toString(widget->maximum()); - - expected << "[" << minString.toStdString() << ", " << maxString.toStdString() << "]"; + const AZStd::string expected = AZStd::string::format("[%d, %d]", minString.toStdString().c_str(), maxString.toStdString().c_str()); // Expect the operation to be successful and a valid limit tooltip string generated EXPECT_TRUE(success); - EXPECT_STREQ(tooltip.toStdString().c_str(), expected.str().c_str()); + EXPECT_STREQ(tooltip.toStdString().c_str(), expected.c_str()); } void HandlerMinMaxLessLimit_ModifyHandler_ExpectSuccessAndValidLessLimitToolTipString() @@ -134,7 +132,6 @@ namespace UnitTest auto& widget = m_widget; auto& handler = m_handler; QString tooltip; - std::stringstream expected; // That is not at the extremeties of the type range limit SetWidgetRangeToNonExtremeties(widget); @@ -145,11 +142,11 @@ namespace UnitTest const QString minString = QLocale().toString(widget->minimum()); const QString maxString = QLocale().toString(widget->maximum()); - expected << "[" << minString.toStdString() << ", " << maxString.toStdString() << "]"; + const AZStd::string expected = AZStd::string::format("[%d, %d]", minString.toStdString().c_str(), maxString.toStdString().c_str()); // Expect the operation to be successful and a valid less than limit tooltip string generated EXPECT_TRUE(success); - EXPECT_STREQ(tooltip.toStdString().c_str(), expected.str().c_str()); + EXPECT_STREQ(tooltip.toStdString().c_str(), expected.c_str()); } void EmitWidgetValueChanged() From 273d6e225aaf76436566cdfb56f53a6f1000e15b Mon Sep 17 00:00:00 2001 From: mrieggeramzn Date: Thu, 6 Jan 2022 14:00:33 -0800 Subject: [PATCH 362/948] Previous commit wasnt correct. Should be using a string not a int Signed-off-by: mrieggeramzn --- .../AzToolsFramework/Tests/PropertyIntCtrlCommonTests.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Code/Framework/AzToolsFramework/Tests/PropertyIntCtrlCommonTests.h b/Code/Framework/AzToolsFramework/Tests/PropertyIntCtrlCommonTests.h index 6710d4b7cd..b73e9e0a26 100644 --- a/Code/Framework/AzToolsFramework/Tests/PropertyIntCtrlCommonTests.h +++ b/Code/Framework/AzToolsFramework/Tests/PropertyIntCtrlCommonTests.h @@ -119,7 +119,7 @@ namespace UnitTest const QString minString = QLocale().toString(widget->minimum()); const QString maxString = QLocale().toString(widget->maximum()); - const AZStd::string expected = AZStd::string::format("[%d, %d]", minString.toStdString().c_str(), maxString.toStdString().c_str()); + const AZStd::string expected = AZStd::string::format("[%s, %s]", minString.toStdString().c_str(), maxString.toStdString().c_str()); // Expect the operation to be successful and a valid limit tooltip string generated EXPECT_TRUE(success); @@ -142,7 +142,7 @@ namespace UnitTest const QString minString = QLocale().toString(widget->minimum()); const QString maxString = QLocale().toString(widget->maximum()); - const AZStd::string expected = AZStd::string::format("[%d, %d]", minString.toStdString().c_str(), maxString.toStdString().c_str()); + const AZStd::string expected = AZStd::string::format("[%s, %s]", minString.toStdString().c_str(), maxString.toStdString().c_str()); // Expect the operation to be successful and a valid less than limit tooltip string generated EXPECT_TRUE(success); From 39edcd06e4cee7ad222e518a1a103c7e87e1608f Mon Sep 17 00:00:00 2001 From: Jeremy Ong Date: Thu, 6 Jan 2022 16:51:40 -0700 Subject: [PATCH 363/948] Add missing `precise` attribute to depth prepass output Commit 67689d48cc0f142eccd4856b0686277b49ca42d0 enforced precision in many vertex position outputs. This adds the attribute to the output of the z-prepass, needed to ensure proper depth testing in the forward passes. Signed-off-by: Jeremy Ong --- .../Feature/Common/Assets/Shaders/Depth/DepthPassCommon.azsli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/Depth/DepthPassCommon.azsli b/Gems/Atom/Feature/Common/Assets/Shaders/Depth/DepthPassCommon.azsli index f658dd13da..ba06dada74 100644 --- a/Gems/Atom/Feature/Common/Assets/Shaders/Depth/DepthPassCommon.azsli +++ b/Gems/Atom/Feature/Common/Assets/Shaders/Depth/DepthPassCommon.azsli @@ -17,7 +17,7 @@ struct VSInput struct VSDepthOutput { - float4 m_position : SV_Position; + precise float4 m_position : SV_Position; }; VSDepthOutput DepthPassVS(VSInput IN) From 54e0b8b7b5d7ad8a7c888ac82297e1284d883518 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 6 Jan 2022 16:16:48 -0800 Subject: [PATCH 364/948] Enabling mac tests (#6716) * Adds mac test job Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Points to sysctl properly to handle zsh Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Fixes some macos differences with Linux when reading the CTEST_RUN_FLAGS parameters Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * adding the test job to the profile pipe Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Disables some tests in Mac that are not passing Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * passes config to cli_test_driver and sets the right trait for the test (pytest instead of lytesttools) Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Set proper traits for AtomRHI Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Corrected AZ_TRAIT_UNIT_TEST_PERLINE_GRADIANT_GOLDEN_VALUES_7878 values for Mac Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Disables EMotionFX tests in Mac Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Removes debugging prints Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Removes filters that were meant just for Linux Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * quotes are re-quoted in the test_mac.sh script Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../AzTest/Platform/Mac/AzTest_Traits_Mac.h | 11 +++++--- .../Mac/ProjectManager_Test_Traits_Mac.h | 2 +- .../Mac/AtomRHITests_traits_mac.cmake | 2 +- scripts/build/Platform/Mac/build_config.json | 23 +++++++++++++--- scripts/build/Platform/Mac/build_mac.sh | 4 +-- scripts/build/Platform/Mac/test_mac.sh | 5 ++-- scripts/ctest/CMakeLists.txt | 26 +++++++++---------- scripts/ctest/ctest_driver_test.py | 9 ++++--- 8 files changed, 53 insertions(+), 29 deletions(-) diff --git a/Code/Framework/AzTest/AzTest/Platform/Mac/AzTest_Traits_Mac.h b/Code/Framework/AzTest/AzTest/Platform/Mac/AzTest_Traits_Mac.h index 4915fb9cab..23ea87cd1c 100644 --- a/Code/Framework/AzTest/AzTest/Platform/Mac/AzTest_Traits_Mac.h +++ b/Code/Framework/AzTest/AzTest/Platform/Mac/AzTest_Traits_Mac.h @@ -16,9 +16,12 @@ #define AZ_TRAIT_DISABLE_ASSET_JOB_PARALLEL_TESTS true #define AZ_TRAIT_DISABLE_ASSET_MANAGER_FLOOD_TEST true #define AZ_TRAIT_DISABLE_ASSETCONTAINERDISABLETEST true +#define AZ_TRAIT_DISABLE_FAILED_DLL_TESTS true +#define AZ_TRAIT_DISABLE_FAILED_MODULE_TESTS true +#define AZ_TRAIT_DISABLE_FAILED_EMOTION_FX_TESTS true // Golden perline gradiant values for random seed 7878 for this platform -#define AZ_TRAIT_UNIT_TEST_PERLINE_GRADIANT_GOLDEN_VALUES_7878 0.5000f, 0.5456f, 0.5138f, 0.4801f, \ - 0.4174f, 0.4942f, 0.5493f, 0.5431f, \ - 0.4984f, 0.5204f, 0.5526f, 0.5840f, \ - 0.5251f, 0.5029f, 0.6153f, 0.5802f, +#define AZ_TRAIT_UNIT_TEST_PERLINE_GRADIANT_GOLDEN_VALUES_7878 0.5000f, 0.5276f, 0.5341f, 0.4801f, \ + 0.5220f, 0.5162f, 0.4828f, 0.5431f, \ + 0.4799f, 0.4486f, 0.5054f, 0.4129f, \ + 0.6023f, 0.5029f, 0.4529f, 0.4428f, diff --git a/Code/Tools/ProjectManager/Platform/Mac/ProjectManager_Test_Traits_Mac.h b/Code/Tools/ProjectManager/Platform/Mac/ProjectManager_Test_Traits_Mac.h index 8d7fe068c2..3ebe7d8e44 100644 --- a/Code/Tools/ProjectManager/Platform/Mac/ProjectManager_Test_Traits_Mac.h +++ b/Code/Tools/ProjectManager/Platform/Mac/ProjectManager_Test_Traits_Mac.h @@ -8,4 +8,4 @@ #pragma once -#define AZ_TRAIT_DISABLE_FAILED_PROJECT_MANAGER_TESTS false +#define AZ_TRAIT_DISABLE_FAILED_PROJECT_MANAGER_TESTS true diff --git a/Gems/Atom/RHI/Code/Platform/Mac/AtomRHITests_traits_mac.cmake b/Gems/Atom/RHI/Code/Platform/Mac/AtomRHITests_traits_mac.cmake index 419331db3b..4645eb9444 100644 --- a/Gems/Atom/RHI/Code/Platform/Mac/AtomRHITests_traits_mac.cmake +++ b/Gems/Atom/RHI/Code/Platform/Mac/AtomRHITests_traits_mac.cmake @@ -6,6 +6,6 @@ # # -set(ATOM_RHI_TRAIT_BUILD_SUPPORTS_TEST TRUE) +set(ATOM_RHI_TRAIT_BUILD_SUPPORTS_TEST FALSE) set(ATOM_RHI_TRAIT_BUILD_SUPPORTS_EDIT TRUE) set(PAL_TRAIT_BUILD_RENDERDOC_SUPPORTED FALSE) diff --git a/scripts/build/Platform/Mac/build_config.json b/scripts/build/Platform/Mac/build_config.json index 6ba264cdb2..6147f70f0c 100644 --- a/scripts/build/Platform/Mac/build_config.json +++ b/scripts/build/Platform/Mac/build_config.json @@ -14,7 +14,8 @@ ], "steps": [ "profile", - "asset_profile" + "asset_profile", + "test_profile" ] }, "metrics": { @@ -89,6 +90,22 @@ "ASSET_PROCESSOR_PLATFORMS": "mac" } }, + "test_profile": { + "TAGS": [ + "daily-pipeline-metrics", + "weekly-build-metrics" + ], + "COMMAND": "build_test_mac.sh", + "PARAMETERS": { + "CONFIGURATION": "profile", + "OUTPUT_DIRECTORY": "build/mac", + "CMAKE_OPTIONS": "-G Xcode", + "CMAKE_LY_PROJECTS": "AutomatedTesting", + "CMAKE_TARGET": "ALL_BUILD", + "CTEST_OPTIONS": "-L (SUITE_smoke|SUITE_main) -LE (REQUIRES_gpu) --no-tests=error", + "TEST_RESULTS": "False" + } + }, "periodic_test_profile": { "TAGS": [ "nightly-incremental", @@ -102,7 +119,7 @@ "CMAKE_OPTIONS": "-G Xcode", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "TEST_SUITE_periodic", - "CTEST_OPTIONS": "-L \"(SUITE_periodic)\"", + "CTEST_OPTIONS": "-L (SUITE_periodic)", "TEST_RESULTS": "False" } }, @@ -119,7 +136,7 @@ "CMAKE_OPTIONS": "-G Xcode", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "TEST_SUITE_benchmark", - "CTEST_OPTIONS": "-L \"(SUITE_benchmark)\"", + "CTEST_OPTIONS": "-L (SUITE_benchmark)", "TEST_RESULTS": "False" } }, diff --git a/scripts/build/Platform/Mac/build_mac.sh b/scripts/build/Platform/Mac/build_mac.sh index 2ea5eeab8a..d6a66fc6c6 100755 --- a/scripts/build/Platform/Mac/build_mac.sh +++ b/scripts/build/Platform/Mac/build_mac.sh @@ -48,7 +48,7 @@ if [[ ! -z "$RUN_CONFIGURE" ]]; then echo "${CONFIGURE_CMD}" > ${LAST_CONFIGURE_CMD_FILE} fi -echo [ci_build] cmake --build . --target ${CMAKE_TARGET} --config ${CONFIGURATION} -j $(sysctl -n hw.ncpu) -- ${CMAKE_NATIVE_BUILD_ARGS} -cmake --build . --target ${CMAKE_TARGET} --config ${CONFIGURATION} -j $(sysctl -n hw.ncpu) -- ${CMAKE_NATIVE_BUILD_ARGS} +echo [ci_build] cmake --build . --target ${CMAKE_TARGET} --config ${CONFIGURATION} -j $(/usr/sbin/sysctl -n hw.ncpu) -- ${CMAKE_NATIVE_BUILD_ARGS} +cmake --build . --target ${CMAKE_TARGET} --config ${CONFIGURATION} -j $(/usr/sbin/sysctl -n hw.ncpu) -- ${CMAKE_NATIVE_BUILD_ARGS} popd diff --git a/scripts/build/Platform/Mac/test_mac.sh b/scripts/build/Platform/Mac/test_mac.sh index e398de3061..46dffab84d 100755 --- a/scripts/build/Platform/Mac/test_mac.sh +++ b/scripts/build/Platform/Mac/test_mac.sh @@ -19,8 +19,9 @@ fi pushd $OUTPUT_DIRECTORY # Find the CTEST_RUN_FLAGS from the CMakeCache.txt file, then replace the $ with the current configuration -IFS='=' read -ra CTEST_RUN_FLAGS <<< $(cmake -N -LA . | grep "CTEST_RUN_FLAGS:STRING") -CTEST_RUN_FLAGS=${CTEST_RUN_FLAGS[1]/$/${CONFIGURATION}} +CTEST_RUN_FLAGS=$(cmake -N -LA . | grep "CTEST_RUN_FLAGS:STRING") +CTEST_RUN_FLAGS=${CTEST_RUN_FLAGS/CTEST_RUN_FLAGS:STRING=/} +CTEST_RUN_FLAGS=${CTEST_RUN_FLAGS/$/${CONFIGURATION}} # Run ctest echo [ci_build] ctest ${CTEST_RUN_FLAGS} ${CTEST_OPTIONS} diff --git a/scripts/ctest/CMakeLists.txt b/scripts/ctest/CMakeLists.txt index 98ea21e938..064d27a9cf 100644 --- a/scripts/ctest/CMakeLists.txt +++ b/scripts/ctest/CMakeLists.txt @@ -17,7 +17,7 @@ endif() # Tests ################################################################################ -if(PAL_TRAIT_TEST_LYTESTTOOLS_SUPPORTED) +if(PAL_TRAIT_TEST_PYTEST_SUPPORTED) foreach(suite_name ${LY_TEST_GLOBAL_KNOWN_SUITE_NAMES}) ly_add_pytest( NAME pytest_sanity_${suite_name}_no_gpu @@ -32,16 +32,16 @@ if(PAL_TRAIT_TEST_LYTESTTOOLS_SUPPORTED) TEST_REQUIRES gpu ) endforeach() -endif() - -# add a custom test which makes sure that the test filtering works! - -ly_add_test( - NAME cli_test_driver - EXCLUDE_TEST_RUN_TARGET_FROM_IDE - TEST_COMMAND ${LY_PYTHON_CMD} ${CMAKE_CURRENT_LIST_DIR}/ctest_driver_test.py - -x ${CMAKE_CTEST_COMMAND} - --build-path ${CMAKE_BINARY_DIR} - TEST_LIBRARY pytest -) + # add a custom test which makes sure that the test filtering works! + ly_add_test( + NAME cli_test_driver + EXCLUDE_TEST_RUN_TARGET_FROM_IDE + TEST_COMMAND ${LY_PYTHON_CMD} ${CMAKE_CURRENT_LIST_DIR}/ctest_driver_test.py + -x ${CMAKE_CTEST_COMMAND} + --build-path ${CMAKE_BINARY_DIR} + --config $ + TEST_LIBRARY pytest + ) + +endif() \ No newline at end of file diff --git a/scripts/ctest/ctest_driver_test.py b/scripts/ctest/ctest_driver_test.py index 82d92ce098..b9a7283b25 100755 --- a/scripts/ctest/ctest_driver_test.py +++ b/scripts/ctest/ctest_driver_test.py @@ -15,10 +15,10 @@ import sys import argparse from ctest_driver import SUITES_AND_DESCRIPTIONS -def main(build_path, ctest_executable): +def main(build_path, ctest_executable, config): script_folder = os.path.dirname(__file__) # -N prevents tests from running, just lists them: - base_args = [sys.executable, os.path.join(script_folder,'ctest_driver.py'), "--build-path", build_path, '-N'] + base_args = [sys.executable, os.path.join(script_folder,'ctest_driver.py'), "--build-path", build_path, "--config", config, '-N'] if ctest_executable: base_args.append("--ctest-executable") base_args.append(ctest_executable) @@ -77,7 +77,10 @@ if __name__ == '__main__': parser.add_argument('-b', '--build-path', required=True, help="Path to a CMake build folder (generated by running cmake)") + parser.add_argument('-c', '--config', + required=True, + help="Configuration to run") args = parser.parse_args() - sys.exit(main(args.build_path, args.ctest_executable)) + sys.exit(main(args.build_path, args.ctest_executable, args.config)) From 7f4fe67f773f0e2508631f947f60a2e7cd9ee8a2 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Thu, 6 Jan 2022 16:35:36 -0800 Subject: [PATCH 365/948] Fix issues caused by SC editor component holding onto a live graph (#6734) Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../Code/Builder/ScriptCanvasBuilder.cpp | 10 ++++ .../Code/Builder/ScriptCanvasBuilder.h | 2 + .../EditorScriptCanvasComponent.cpp | 47 ++++++------------- .../Components/EditorScriptCanvasComponent.h | 2 +- 4 files changed, 28 insertions(+), 33 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp index d62ebb9c3a..fbacfd8c32 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.cpp @@ -246,6 +246,16 @@ namespace ScriptCanvasBuilder } } + void BuildVariableOverrides::SetHandlesToDescription() + { + m_source = m_source.Describe(); + + for (auto& dependency : m_dependencies) + { + dependency.SetHandlesToDescription(); + } + } + ScriptCanvas::RuntimeDataOverrides ConvertToRuntime(const BuildVariableOverrides& buildOverrides) { ScriptCanvas::RuntimeDataOverrides runtimeOverrides; diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.h b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.h index 6e8e176145..1770e48dfa 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.h +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilder.h @@ -38,6 +38,8 @@ namespace ScriptCanvasBuilder // use this to initialize the new data, and make sure they have a editor graph variable for proper editor display void PopulateFromParsedResults(ScriptCanvas::Grammar::AbstractCodeModelConstPtr abstractCodeModel, const ScriptCanvas::VariableData& variables); + void SetHandlesToDescription(); + // #functions2 provide an identifier for the node/variable in the source that caused the dependency. the root will not have one. ScriptCanvasEditor::SourceHandle m_source; diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp index 750097b428..f8f867d7e3 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorScriptCanvasComponent.cpp @@ -245,13 +245,13 @@ namespace ScriptCanvasEditor void EditorScriptCanvasComponent::OpenEditor([[maybe_unused]] const AZ::Data::AssetId& assetId, const AZ::Data::AssetType&) { AzToolsFramework::OpenViewPane(LyViewPane::ScriptCanvas); - + AZ::Outcome openOutcome = AZ::Failure(AZStd::string()); - + if (m_sourceHandle.IsDescriptionValid()) { GeneralRequestBus::BroadcastResult(openOutcome, &GeneralRequests::OpenScriptCanvasAsset, m_sourceHandle, Tracker::ScriptCanvasFileState::UNMODIFIED, -1); - + if (!openOutcome) { AZ_Warning("Script Canvas", openOutcome, "%s", openOutcome.GetError().data()); @@ -261,7 +261,7 @@ namespace ScriptCanvasEditor { AzToolsFramework::EntityIdList selectedEntityIds; AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult(selectedEntityIds, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities); - + // Going to bypass the multiple selected entities flow for right now. if (selectedEntityIds.size() == 1) { @@ -279,7 +279,7 @@ namespace ScriptCanvasEditor void EditorScriptCanvasComponent::InitializeSource(const SourceHandle& sourceHandle) { - m_sourceHandle = sourceHandle; + m_sourceHandle = sourceHandle.Describe(); } //========================================================================= @@ -345,6 +345,7 @@ namespace ScriptCanvasEditor } m_variableOverrides = parseOutcome.TakeValue(); + m_variableOverrides.SetHandlesToDescription(); m_runtimeDataIsValid = true; } @@ -373,13 +374,7 @@ namespace ScriptCanvasEditor void EditorScriptCanvasComponent::SetPrimaryAsset(const AZ::Data::AssetId& assetId) { m_sourceHandle = SourceHandle(nullptr, assetId.m_guid, {}); - - auto completeAsset = CompleteDescription(m_sourceHandle); - if (completeAsset) - { - m_sourceHandle = *completeAsset; - } - + CompleteDescriptionInPlace(m_sourceHandle); OnScriptCanvasAssetChanged(SourceChangeDescription::SelectionChanged); SetName(m_sourceHandle.Path().Filename().Native()); AzToolsFramework::ToolsApplicationEvents::Bus::Broadcast(&AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay, AzToolsFramework::Refresh_AttributesAndValues); @@ -399,7 +394,7 @@ namespace ScriptCanvasEditor OnScriptCanvasAssetChanged(SourceChangeDescription::SelectionChanged); return AZ::Edit::PropertyRefreshLevels::EntireTree; } - + void EditorScriptCanvasComponent::OnScriptCanvasAssetChanged(SourceChangeDescription changeDescription) { ScriptCanvas::GraphIdentifier newIdentifier = GetGraphIdentifier(); @@ -417,20 +412,11 @@ namespace ScriptCanvasEditor ClearVariables(); } + m_sourceHandle = m_previousHandle; + if (m_sourceHandle.IsDescriptionValid()) { - if (!m_sourceHandle.Get()) - { - if (auto loaded = LoadFromFile(m_sourceHandle.Path().c_str()); loaded.IsSuccess()) - { - m_sourceHandle = SourceHandle(loaded.TakeValue(), m_sourceHandle.Id(), m_sourceHandle.Path().c_str()); - } - } - - if (m_sourceHandle.Get()) - { - UpdatePropertyDisplay(m_sourceHandle); - } + UpdatePropertyDisplay(); } AzToolsFramework::ToolsApplicationNotificationBus::Broadcast(&AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay, AzToolsFramework::Refresh_EntireTree_NewContent); @@ -492,14 +478,11 @@ namespace ScriptCanvasEditor return ScriptCanvas::GraphIdentifier(m_sourceHandle.Id(), 0); } - void EditorScriptCanvasComponent::UpdatePropertyDisplay(const SourceHandle& sourceHandle) + void EditorScriptCanvasComponent::UpdatePropertyDisplay() { - if (sourceHandle.IsGraphValid()) - { - BuildGameEntityData(); - UpdateName(); - AzToolsFramework::ToolsApplicationNotificationBus::Broadcast(&AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay, AzToolsFramework::Refresh_EntireTree_NewContent); - } + BuildGameEntityData(); + UpdateName(); + AzToolsFramework::ToolsApplicationNotificationBus::Broadcast(&AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay, AzToolsFramework::Refresh_EntireTree_NewContent); } void EditorScriptCanvasComponent::ClearVariables() diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h index ca381445ea..b86df2d9c2 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorScriptCanvasComponent.h @@ -121,7 +121,7 @@ namespace ScriptCanvasEditor void UpdateName(); //===================================================================== - void UpdatePropertyDisplay(const SourceHandle& sourceHandle); + void UpdatePropertyDisplay(); //===================================================================== void BuildGameEntityData(); From 6a171d17697b8c6415967ca86a62e2d28fc2c308 Mon Sep 17 00:00:00 2001 From: Mike Chang Date: Thu, 6 Jan 2022 16:41:35 -0800 Subject: [PATCH 366/948] Windows installer build tag date fix (#6735) Makes the % string replacement optional in the palSh function Signed-off-by: Mike Chang --- scripts/build/Jenkins/Jenkinsfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/build/Jenkins/Jenkinsfile b/scripts/build/Jenkins/Jenkinsfile index 570c553444..51f89d7829 100644 --- a/scripts/build/Jenkins/Jenkinsfile +++ b/scripts/build/Jenkins/Jenkinsfile @@ -38,7 +38,7 @@ def pipelineParameters = [ booleanParam(defaultValue: false, description: 'Recreates the volume used for the workspace. The volume will be created out of a snapshot taken from main.', name: 'RECREATE_VOLUME') ] -def palSh(cmd, lbl = '', winSlashReplacement = true) { +def palSh(cmd, lbl = '', winSlashReplacement = true, winCharReplacement = true) { if (env.IS_UNIX) { sh label: lbl, script: cmd @@ -46,7 +46,9 @@ def palSh(cmd, lbl = '', winSlashReplacement = true) { if (winSlashReplacement) { cmd = cmd.replace('/','\\') } - cmd = cmd.replace('%', '%%') + if (winCharReplacement) { + cmd = cmd.replace('%', '%%') + } bat label: lbl, script: cmd } @@ -262,7 +264,7 @@ def CheckoutRepo(boolean disableSubmodules = false) { commitDateFmt = '%%cI' if (env.IS_UNIX) commitDateFmt = '%cI' - palSh("git show -s --format=${commitDateFmt} ${env.CHANGE_ID} > commitdate", 'Getting commit date') + palSh("git show -s --format=${commitDateFmt} ${env.CHANGE_ID} > commitdate", 'Getting commit date', winSlashReplacement=true, winCharReplacement=false) env.CHANGE_DATE = readFile file: 'commitdate' env.CHANGE_DATE = env.CHANGE_DATE.trim() palRm('commitdate') From e7f573d22a37321ecdd6de0578d527f0186115a6 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Thu, 6 Jan 2022 16:48:07 -0800 Subject: [PATCH 367/948] Make Value ctor explicit Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 30 ----------- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 51 +++++++++---------- .../AzCore/Tests/DOM/DomValueBenchmarks.cpp | 8 +-- .../AzCore/Tests/DOM/DomValueTests.cpp | 33 ++++++------ 4 files changed, 45 insertions(+), 77 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index 824b38e47b..f48586709d 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -969,16 +969,6 @@ namespace AZ::Dom m_value = value; } - int32_t Value::GetInt32() const - { - return aznumeric_cast(GetInt64()); - } - - void Value::SetInt32(int32_t value) - { - m_value = aznumeric_cast(value); - } - uint64_t Value::GetUint64() const { switch (m_value.index()) @@ -999,16 +989,6 @@ namespace AZ::Dom m_value = value; } - uint32_t Value::GetUint32() const - { - return aznumeric_cast(GetUint64()); - } - - void Value::SetUint32(uint32_t value) - { - m_value = aznumeric_cast(value); - } - bool Value::GetBool() const { if (IsBool()) @@ -1044,16 +1024,6 @@ namespace AZ::Dom m_value = value; } - float Value::GetFloat() const - { - return aznumeric_cast(GetDouble()); - } - - void Value::SetFloat(float value) - { - m_value = aznumeric_cast(value); - } - void Value::SetString(SharedStringType sharedString) { m_value = sharedString; diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index a6990fcbce..fa496e8dfc 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -198,28 +198,39 @@ namespace AZ::Dom Value(const Value&); Value(Value&&) noexcept; Value(AZStd::string_view stringView, bool copy); - Value(SharedStringType sharedString); - - Value(int8_t value); - Value(uint8_t value); - Value(int16_t value); - Value(uint16_t value); - Value(int32_t value); - Value(uint32_t value); - Value(int64_t value); - Value(uint64_t value); - Value(float value); - Value(double value); - Value(bool value); + explicit Value(const ValueType&); + explicit Value(ValueType&&); + explicit Value(SharedStringType sharedString); + + explicit Value(int8_t value); + explicit Value(uint8_t value); + explicit Value(int16_t value); + explicit Value(uint16_t value); + explicit Value(int32_t value); + explicit Value(uint32_t value); + explicit Value(int64_t value); + explicit Value(uint64_t value); + explicit Value(float value); + explicit Value(double value); + explicit Value(bool value); explicit Value(Type type); + template + explicit Value(T, AZStd::enable_if_t>* enabled = 0) = delete; + static Value FromOpaqueValue(const AZStd::any& value); // Equality / comparison / swap... Value& operator=(const Value&); Value& operator=(Value&&) noexcept; + template + Value& operator=(T value) + { + return operator=(Value(value)); + } + bool operator==(const Value& rhs) const; bool operator!=(const Value& rhs) const; @@ -330,22 +341,10 @@ namespace AZ::Dom // int API... int64_t GetInt64() const; void SetInt64(int64_t); - int32_t GetInt32() const; - void SetInt32(int32_t); - int16_t GetInt16() const; - void SetInt16(int16_t); - int8_t GetInt8() const; - void SetInt8(int8_t); // uint API... uint64_t GetUint64() const; void SetUint64(uint64_t); - uint32_t GetUint32() const; - void SetUint32(uint32_t); - uint16_t GetUint16() const; - void SetUint16(uint16_t); - uint8_t GetUint8() const; - void SetUint8(uint8_t); // bool API... bool GetBool() const; @@ -354,8 +353,6 @@ namespace AZ::Dom // double API... double GetDouble() const; void SetDouble(double); - float GetFloat() const; - void SetFloat(float); // String API... AZStd::string_view GetString() const; diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp index b20091b232..40b96e148b 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp @@ -66,9 +66,9 @@ namespace AZ::Dom::Benchmark { Value entry(Type::Object); entry.AddMember("string", createString(n)); - entry.AddMember("int", n); - entry.AddMember("double", static_cast(n) * 0.5); - entry.AddMember("bool", n % 2 == 0); + entry.AddMember("int", Value(n)); + entry.AddMember("double", Value(static_cast(n) * 0.5)); + entry.AddMember("bool", Value(n % 2 == 0)); entry.AddMember("null", Value(Type::Null)); return entry; }; @@ -153,7 +153,7 @@ namespace AZ::Dom::Benchmark for (auto _ : state) { Value copy = original; - copy["entries"]["Key0"].ArrayPushBack(42); + copy["entries"]["Key0"].ArrayPushBack(Value(42)); TakeAndDiscardWithoutTimingDtor(AZStd::move(copy), state); } diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp index a98eb307a2..10e9f29a44 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp @@ -68,7 +68,7 @@ namespace AZ::Dom::Tests { m_value.ArrayPushBack(Value(i)); EXPECT_EQ(m_value.ArraySize(), i + 1); - EXPECT_EQ(m_value[i].GetInt32(), i); + EXPECT_EQ(m_value[i].GetInt64(), i); } PerformValueChecks(); @@ -76,6 +76,7 @@ namespace AZ::Dom::Tests TEST_F(DomValueTests, NestedArrays) { + Value x(5); m_value.SetArray(); for (int j = 0; j < 5; ++j) { @@ -93,7 +94,7 @@ namespace AZ::Dom::Tests EXPECT_EQ(m_value[i].ArraySize(), 5); for (int j = 0; j < 5; ++j) { - EXPECT_EQ(m_value[i][j].GetInt32(), j); + EXPECT_EQ(m_value[i][j].GetInt64(), j); } } @@ -116,7 +117,7 @@ namespace AZ::Dom::Tests AZStd::string key = AZStd::string::format("Key%i", i); m_value.AddMember(key, Value(i)); EXPECT_EQ(m_value.MemberCount(), i + 1); - EXPECT_EQ(m_value[key].GetInt32(), i); + EXPECT_EQ(m_value[key].GetInt64(), i); } PerformValueChecks(); @@ -142,7 +143,7 @@ namespace AZ::Dom::Tests EXPECT_EQ(nestedObject.MemberCount(), 5); for (int i = 0; i < 5; ++i) { - EXPECT_EQ(nestedObject[AZStd::string::format("Key%i", i)].GetInt32(), i); + EXPECT_EQ(nestedObject[AZStd::string::format("Key%i", i)].GetInt64(), i); } } @@ -167,14 +168,14 @@ namespace AZ::Dom::Tests { m_value.ArrayPushBack(Value(i)); EXPECT_EQ(m_value.ArraySize(), i + 1); - EXPECT_EQ(m_value[i].GetInt32(), i); + EXPECT_EQ(m_value[i].GetInt64(), i); if (i < 5) { AZ::Name key = AZ::Name(AZStd::string::format("TwoTimes%i", i)); m_value.AddMember(key, Value(i * 2)); EXPECT_EQ(m_value.MemberCount(), i + 1); - EXPECT_EQ(m_value[key].GetInt32(), i * 2); + EXPECT_EQ(m_value[key].GetInt64(), i * 2); } } @@ -191,9 +192,9 @@ namespace AZ::Dom::Tests { Value childNode(Type::Node); childNode.SetNodeName(childNodeName); - childNode.SetNodeValue(i); + childNode.SetNodeValue(Value(i)); - childNode.AddMember("foo", i); + childNode.AddMember("foo", Value(i)); childNode.AddMember("bar", Value("test", false)); m_value.ArrayPushBack(childNode); @@ -204,8 +205,8 @@ namespace AZ::Dom::Tests { const Value& childNode = m_value[i]; EXPECT_EQ(childNode.GetNodeName(), childNodeName); - EXPECT_EQ(childNode.GetNodeValue().GetInt32(), i); - EXPECT_EQ(childNode["foo"].GetInt32(), i); + EXPECT_EQ(childNode.GetNodeValue().GetInt64(), i); + EXPECT_EQ(childNode["foo"].GetInt64(), i); EXPECT_EQ(childNode["bar"].GetString(), "test"); } @@ -334,8 +335,8 @@ namespace AZ::Dom::Tests TEST_F(DomValueTests, CopyOnWrite_Array) { Value v1(Type::Array); - v1.ArrayPushBack(1); - v1.ArrayPushBack(2); + v1.ArrayPushBack(Value(1)); + v1.ArrayPushBack(Value(2)); Value nestedArray(Type::Array); v1.ArrayPushBack(nestedArray); @@ -349,7 +350,7 @@ namespace AZ::Dom::Tests EXPECT_NE(&v1.GetArray(), &v2.GetArray()); EXPECT_EQ(&v1.ArrayAt(2).GetArray(), &v2.ArrayAt(2).GetArray()); - v2[2].ArrayPushBack(42); + v2[2].ArrayPushBack(Value(42)); EXPECT_NE(&v1.GetArray(), &v2.GetArray()); EXPECT_NE(&v1.ArrayAt(2).GetArray(), &v2.ArrayAt(2).GetArray()); @@ -365,8 +366,8 @@ namespace AZ::Dom::Tests Value v1; v1.SetNode("TopLevel"); - v1.ArrayPushBack(1); - v1.ArrayPushBack(2); + v1.ArrayPushBack(Value(1)); + v1.ArrayPushBack(Value(2)); v1["obj"].SetNode("Nested"); Value v2 = v1; @@ -378,7 +379,7 @@ namespace AZ::Dom::Tests EXPECT_NE(&v1.GetNode(), &v2.GetNode()); EXPECT_EQ(&v1["obj"].GetNode(), &v2["obj"].GetNode()); - v2["obj"].ArrayPushBack(42); + v2["obj"].ArrayPushBack(Value(42)); EXPECT_NE(&v1.GetNode(), &v2.GetNode()); EXPECT_NE(&v1["obj"].GetNode(), &v2["obj"].GetNode()); From 25924c3d384452e67775b2a4c11a84df09cf99d4 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Thu, 6 Jan 2022 16:54:57 -0800 Subject: [PATCH 368/948] Use more explicit operator= override Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index fa496e8dfc..23f4bd570f 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -225,10 +225,12 @@ namespace AZ::Dom Value& operator=(const Value&); Value& operator=(Value&&) noexcept; - template - Value& operator=(T value) + //! Assignment operator to allow forwarding types constructible via Value(T) to be assigned + template + auto operator=(T&& arg) + -> AZStd::enable_if_t, Value> && AZStd::is_constructible_v, Value&> { - return operator=(Value(value)); + return operator=(Value(AZStd::forward(arg))); } bool operator==(const Value& rhs) const; From 839bbd734aea320ebf383c6b390cf52a6d867f54 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Thu, 6 Jan 2022 16:55:24 -0800 Subject: [PATCH 369/948] Make operator== avoid implicit comparisons Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index f48586709d..6d944c9f45 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -262,21 +262,6 @@ namespace AZ::Dom { return GetString() == rhs.GetString(); } - else if (IsNumber() && rhs.IsNumber()) - { - if (IsInt()) - { - return GetInt64() == rhs.GetInt64(); - } - else if (IsUint()) - { - return GetUint64() == rhs.GetUint64(); - } - else - { - return GetDouble() == rhs.GetDouble(); - } - } else { return m_value == rhs.m_value; From 8668fac564d38fec00b142bc309ab405106257d7 Mon Sep 17 00:00:00 2001 From: Mikhail Naumov <82239319+AMZN-mnaumov@users.noreply.github.com> Date: Thu, 6 Jan 2022 19:09:27 -0600 Subject: [PATCH 370/948] Fixing character controller triggering collision on creation (#6546) * Fixing character controller triggering collision on creation Signed-off-by: Mikhail Naumov * PR feedback Signed-off-by: Mikhail Naumov --- Gems/PhysX/Code/Source/PhysXCharacters/API/CharacterUtils.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Gems/PhysX/Code/Source/PhysXCharacters/API/CharacterUtils.cpp b/Gems/PhysX/Code/Source/PhysXCharacters/API/CharacterUtils.cpp index f4cdd01889..1151c0ffff 100644 --- a/Gems/PhysX/Code/Source/PhysXCharacters/API/CharacterUtils.cpp +++ b/Gems/PhysX/Code/Source/PhysXCharacters/API/CharacterUtils.cpp @@ -73,6 +73,7 @@ namespace PhysX::Utils::Characters physx::PxMaterial* pxMaterial = static_cast(materials.front()->GetNativePointer()); controllerDesc.material = pxMaterial; + controllerDesc.position = PxMathConvertExtended(characterConfig.m_position); controllerDesc.slopeLimit = cosf(AZ::DegToRad(characterConfig.m_maximumSlopeAngle)); controllerDesc.stepOffset = characterConfig.m_stepHeight; controllerDesc.upDirection = characterConfig.m_upDirection.IsZero() From 2492c0a4f4db175268742fe9dcf4191d4ad44bea Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Thu, 6 Jan 2022 17:56:00 -0800 Subject: [PATCH 371/948] enum must be dereferenced with .value also added get_outcome.GetError() to pull more information from any get_container_item failures Signed-off-by: Scott Murray --- .../editor_python_test_tools/editor_entity_utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py index d354c4ece6..bf27ec06e0 100644 --- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py @@ -174,7 +174,9 @@ class EditorComponent: get_outcome = self.property_tree_editor.get_container_item(component_property_path, key) assert ( get_outcome.IsSuccess() - ), f"Failure: could not get a value for {self.get_component_name()}: '{component_property_path}' [{key}]" + ), ( + f"Failure: could not get a value for {self.get_component_name()}: '{component_property_path}' [{key}]. " + f"Error returned by get_container_item: {get_outcome.GetError()}") return get_outcome.GetValue() def remove_container_item(self, component_property_path: str, key: any): @@ -277,7 +279,7 @@ class EditorComponent: :return: List of type ids of given components. Type id is a UUID as provided by the ebus call """ type_ids = editor.EditorComponentAPIBus( - bus.Broadcast, "FindComponentTypeIdsByEntityType", component_names, entity_type) + bus.Broadcast, "FindComponentTypeIdsByEntityType", component_names, entity_type.value) return type_ids From 9cb7d05e6b105aef2467dbfdd1854a138224ddb3 Mon Sep 17 00:00:00 2001 From: Ken Pruiksma Date: Thu, 6 Jan 2022 22:50:16 -0600 Subject: [PATCH 372/948] Adding a temporarily exclusion for terrain gem materials and shaders when building on mac (#6739) * Adding a temporarily exclusion for terrain gem materials and shaders when building on mac. This is a short term fix until either: - there's a generic way to exclude assets based on platform - materialtype assets can directly exclude certain platforms (or ignore excluded shaders) - shader compiling for mac supports unbounded texture arrays. Signed-off-by: Ken Pruiksma * moving setreg to gem and contraining to the exact files that are problematic Signed-off-by: Ken Pruiksma --- .../Mac/AssetProcessorPlatformConfig.setreg | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Gems/Terrain/Registry/Platform/Mac/AssetProcessorPlatformConfig.setreg diff --git a/Gems/Terrain/Registry/Platform/Mac/AssetProcessorPlatformConfig.setreg b/Gems/Terrain/Registry/Platform/Mac/AssetProcessorPlatformConfig.setreg new file mode 100644 index 0000000000..ac0c854b19 --- /dev/null +++ b/Gems/Terrain/Registry/Platform/Mac/AssetProcessorPlatformConfig.setreg @@ -0,0 +1,16 @@ +{ + "Amazon": { + "AssetProcessor": { + "Settings": { + // The terrain shader doesn't work on mac due to unbounded arrays, so disable problematic materials and material types + // in the terrain gem to prevent dependencies from failing. + "Exclude Terrain DefaultPbrTerrain.material": { + "pattern": "^Materials/Terrain/DefaultPbrTerrain.material" + }, + "Exclude Terrain PbrTerrain.materialtype": { + "pattern": "^Materials/Terrain/PbrTerrain.materialtype" + } + } + } + } +} From 1a8b7aeb4891f103300cb770fe1537612f4adadb Mon Sep 17 00:00:00 2001 From: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> Date: Fri, 7 Jan 2022 09:37:33 +0000 Subject: [PATCH 373/948] Small workaround and fix to ensure line fade (alpha) displays correctly (#6733) Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> --- .../Manipulators/ManipulatorSnapping.cpp | 4 ++++ .../Code/Source/AtomDebugDisplayViewportInterface.cpp | 9 +-------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ManipulatorSnapping.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ManipulatorSnapping.cpp index 5bea383630..3b2f78ef2d 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ManipulatorSnapping.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ManipulatorSnapping.cpp @@ -184,6 +184,10 @@ namespace AzToolsFramework const float halfGridSquareCount = float(gridSquareCount) * 0.5f; const float halfGridSize = halfGridSquareCount * squareSize; const float fadeLineLength = cl_viewportFadeLineDistanceScale * squareSize; + + // ensure AuxGeomDraw::OpacityType::Translucent render state is set + debugDisplay.SetAlpha(0.5f); + for (size_t lineIndex = 0; lineIndex <= gridSquareCount; ++lineIndex) { const float lineOffset = -halfGridSize + (lineIndex * squareSize); diff --git a/Gems/AtomLyIntegration/AtomBridge/Code/Source/AtomDebugDisplayViewportInterface.cpp b/Gems/AtomLyIntegration/AtomBridge/Code/Source/AtomDebugDisplayViewportInterface.cpp index af91615283..352ffb6486 100644 --- a/Gems/AtomLyIntegration/AtomBridge/Code/Source/AtomDebugDisplayViewportInterface.cpp +++ b/Gems/AtomLyIntegration/AtomBridge/Code/Source/AtomDebugDisplayViewportInterface.cpp @@ -348,14 +348,7 @@ namespace AZ::AtomBridge void AtomDebugDisplayViewportInterface::SetAlpha(float a) { m_rendState.m_color.SetA(a); - if (a < 1.0f) - { - m_rendState.m_opacityType = AZ::RPI::AuxGeomDraw::OpacityType::Opaque; - } - else - { - m_rendState.m_opacityType = AZ::RPI::AuxGeomDraw::OpacityType::Translucent; - } + m_rendState.m_opacityType = a < 1.0f ? AZ::RPI::AuxGeomDraw::OpacityType::Translucent : AZ::RPI::AuxGeomDraw::OpacityType::Opaque; } void AtomDebugDisplayViewportInterface::DrawQuad( From 042ed3b877d373b7a54dbc2c66b22380faece137 Mon Sep 17 00:00:00 2001 From: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> Date: Fri, 7 Jan 2022 12:29:32 +0000 Subject: [PATCH 374/948] AssetBrowser SearchFilteringTest: Added delay when inserting a string to the search file. (#6036) * Added delay when inserting a string to the search file. Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * Added explanatory comment Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> --- .../editor/EditorScripts/AssetBrowser_SearchFiltering.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_SearchFiltering.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_SearchFiltering.py index 7366faafdc..b18bf65312 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_SearchFiltering.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_SearchFiltering.py @@ -98,7 +98,13 @@ def AssetBrowser_SearchFiltering(): # 3) Type the name of an asset in the search bar and make sure it is filtered to and selectable asset_browser = editor_window.findChild(QtWidgets.QDockWidget, "Asset Browser") search_bar = asset_browser.findChild(QtWidgets.QLineEdit, "textSearch") - search_bar.setText("cedar.fbx") + + # Add a small pause when typing in the search bar in order to check that the entries are updated properly + search_bar.setText("Cedar.f") + general.idle_wait(0.5) + search_bar.setText("Cedar.fbx") + general.idle_wait(0.5) + asset_browser_tree = asset_browser.findChild(QtWidgets.QTreeView, "m_assetBrowserTreeViewWidget") asset_browser_table = asset_browser.findChild(QtWidgets.QTreeView, "m_assetBrowserTableViewWidget") found = await pyside_utils.wait_for_condition(lambda: pyside_utils.find_child_by_pattern(asset_browser_table, "cedar.fbx"), 5.0) From 8503915cddcdfab7a0cc11325f15888472b8fa22 Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Fri, 7 Jan 2022 06:43:34 -0800 Subject: [PATCH 375/948] bugfix: correct mouseMove under AzToolsFrameworkHelper (#6493) * bugfix: correct mouseMove under AzToolsFrameworkHelper REF: https://github.com/o3de/o3de/issues/6481 Signed-off-by: Michael Pollind * chore: added unit test Signed-off-by: Michael Pollind * chore: address comments Signed-off-by: Michael Pollind * chore: correct fixture Signed-off-by: Michael Pollind * chore: tweak mouse move logic Signed-off-by: Michael Pollind * updates to track mouse/cursor position via events instead of using QCursor::pos() Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> * rename AzToolFrameworkTestHelperTest.cpp to AzToolsFrameworkTestHelpersTest.cpp Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> Co-authored-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com> --- .../UnitTest/AzToolsFrameworkTestHelpers.cpp | 29 ++++-- .../UnitTest/AzToolsFrameworkTestHelpers.h | 21 ++++- .../Tests/AzToolsFrameworkTestHelpersTest.cpp | 88 +++++++++++++++++++ .../Tests/aztoolsframeworktests_files.cmake | 1 + 4 files changed, 133 insertions(+), 6 deletions(-) create mode 100644 Code/Framework/AzToolsFramework/Tests/AzToolsFrameworkTestHelpersTest.cpp diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/AzToolsFrameworkTestHelpers.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/AzToolsFrameworkTestHelpers.cpp index 4f952a3edc..7f877facb6 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/AzToolsFrameworkTestHelpers.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/AzToolsFrameworkTestHelpers.cpp @@ -30,8 +30,7 @@ namespace UnitTest void MousePressAndMove( QWidget* widget, const QPoint& initialPositionWidget, const QPoint& mouseDelta, const Qt::MouseButton mouseButton) { - QPoint position = widget->mapToGlobal(initialPositionWidget); - QTest::mousePress(widget, mouseButton, Qt::NoModifier, position); + QTest::mousePress(widget, mouseButton, Qt::NoModifier, initialPositionWidget); MouseMove(widget, initialPositionWidget, mouseDelta, mouseButton); } @@ -45,14 +44,15 @@ namespace UnitTest // - https://lists.qt-project.org/pipermail/development/2019-July/036873.html void MouseMove(QWidget* widget, const QPoint& initialPositionWidget, const QPoint& mouseDelta, const Qt::MouseButton mouseButton) { - QPoint nextPosition = widget->mapToGlobal(initialPositionWidget + mouseDelta); + const QPoint nextLocalPosition = initialPositionWidget + mouseDelta; + const QPoint nextGlobalPosition = widget->mapToGlobal(nextLocalPosition); // ^1 To ensure a mouse move event is fired we must call the test mouse move function // and also send a mouse move event that matches. Each on their own do not appear to // work - please see the links above for more context. - QTest::mouseMove(widget, nextPosition); + QTest::mouseMove(widget, nextLocalPosition); QMouseEvent mouseMoveEvent( - QEvent::MouseMove, QPointF(nextPosition), QPointF(nextPosition), Qt::NoButton, mouseButton, Qt::NoModifier); + QEvent::MouseMove, QPointF(nextLocalPosition), QPointF(nextGlobalPosition), Qt::NoButton, mouseButton, Qt::NoModifier); QApplication::sendEvent(widget, &mouseMoveEvent); } @@ -157,6 +157,23 @@ namespace UnitTest return QWidget::event(event); } + MouseMoveDetector::MouseMoveDetector(QWidget* parent) + : QObject(parent) + { + } + + bool MouseMoveDetector::eventFilter(QObject* watched, QEvent* event) + { + if (const auto eventType = event->type(); eventType == QEvent::Type::MouseMove) + { + auto mouseEvent = static_cast(event); + m_mouseGlobalPosition = mouseEvent->globalPos(); + m_mouseLocalPosition = mouseEvent->pos(); + } + + return QObject::eventFilter(watched, event); + } + void TestEditorActions::Connect() { using AzToolsFramework::GetEntityContextId; @@ -571,3 +588,5 @@ namespace UnitTest sliceAssets.clear(); } } // namespace UnitTest + +#include diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/AzToolsFrameworkTestHelpers.h b/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/AzToolsFrameworkTestHelpers.h index 79a87391b4..2c60ca914c 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/AzToolsFrameworkTestHelpers.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/AzToolsFrameworkTestHelpers.h @@ -111,10 +111,29 @@ namespace UnitTest { Q_OBJECT public: - FocusInteractionWidget(QWidget* parent = nullptr) : QWidget(parent) {} + FocusInteractionWidget(QWidget* parent = nullptr) + : QWidget(parent) + { + } + bool event(QEvent* event) override; }; + /// Records mouse move events and stores the local and global position of the cursor. + /// @note To use, install as an event filter for the widget being interacted with + /// e.g. m_testWidget->installEventFilter(&m_mouseMoveDetector); + class MouseMoveDetector : public QObject + { + Q_OBJECT + public: + MouseMoveDetector(QWidget* parent = nullptr); + + bool eventFilter([[maybe_unused]] QObject* watched, QEvent* event) override; + + QPoint m_mouseGlobalPosition; + QPoint m_mouseLocalPosition; + }; + /// Stores actions registered for either normal mode (regular viewport) editing and /// component mode editing. class TestEditorActions diff --git a/Code/Framework/AzToolsFramework/Tests/AzToolsFrameworkTestHelpersTest.cpp b/Code/Framework/AzToolsFramework/Tests/AzToolsFrameworkTestHelpersTest.cpp new file mode 100644 index 0000000000..2a1254f2e9 --- /dev/null +++ b/Code/Framework/AzToolsFramework/Tests/AzToolsFrameworkTestHelpersTest.cpp @@ -0,0 +1,88 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include + +#include +#include + +namespace UnitTest +{ + class AzToolsFrameworkTestHelpersFixture : public AllocatorsTestFixture + { + public: + void SetUp() override + { + AllocatorsTestFixture::SetUp(); + + m_rootWidget = AZStd::make_unique(); + m_rootWidget->setFixedSize(0, 0); + m_rootWidget->setMouseTracking(true); + m_rootWidget->move(0, 0); // explicitly set the widget to be in the upper left corner + + m_mouseMoveDetector = AZStd::make_unique(); + m_rootWidget->installEventFilter(m_mouseMoveDetector.get()); + } + + void TearDown() override + { + m_rootWidget->removeEventFilter(m_mouseMoveDetector.get()); + m_rootWidget.reset(); + m_mouseMoveDetector.reset(); + + AllocatorsTestFixture::TearDown(); + } + + AZStd::unique_ptr m_rootWidget; + AZStd::unique_ptr m_mouseMoveDetector; + }; + + struct MouseMoveParams + { + QSize m_widgetSize; + QPoint m_widgetPosition; + QPoint m_localCursorPosition; + QPoint m_cursorDelta; + }; + + class MouseMoveAzToolsFrameworkTestHelperFixture + : public AzToolsFrameworkTestHelpersFixture + , public ::testing::WithParamInterface + { + }; + + TEST_P(MouseMoveAzToolsFrameworkTestHelperFixture, MouseMoveCorrectlyTransformsCursorPositionInGlobalAndLocalSpace) + { + // given + const MouseMoveParams mouseMoveParams = GetParam(); + m_rootWidget->move(mouseMoveParams.m_widgetPosition); + m_rootWidget->setFixedSize(mouseMoveParams.m_widgetSize); + + // when + MouseMove(m_rootWidget.get(), mouseMoveParams.m_localCursorPosition, mouseMoveParams.m_cursorDelta); + + // then + const QPoint mouseLocalPosition = m_mouseMoveDetector->m_mouseLocalPosition; + const QPoint mouseLocalPositionFromGlobal = m_rootWidget->mapFromGlobal(m_mouseMoveDetector->m_mouseGlobalPosition); + const QPoint expectedPosition = mouseMoveParams.m_localCursorPosition + mouseMoveParams.m_cursorDelta; + + using ::testing::Eq; + EXPECT_THAT(mouseLocalPosition.x(), Eq(expectedPosition.x())); + EXPECT_THAT(mouseLocalPosition.y(), Eq(expectedPosition.y())); + EXPECT_THAT(mouseLocalPositionFromGlobal.x(), Eq(expectedPosition.x())); + EXPECT_THAT(mouseLocalPositionFromGlobal.y(), Eq(expectedPosition.y())); + } + + INSTANTIATE_TEST_CASE_P( + All, + MouseMoveAzToolsFrameworkTestHelperFixture, + testing::Values( + MouseMoveParams{ QSize(100, 100), QPoint(0, 0), QPoint(0, 0), QPoint(10, 10) }, + MouseMoveParams{ QSize(100, 100), QPoint(100, 100), QPoint(0, 0), QPoint(10, 10) }, + MouseMoveParams{ QSize(100, 100), QPoint(20, 20), QPoint(50, 50), QPoint(20, 20) })); +} // namespace UnitTest diff --git a/Code/Framework/AzToolsFramework/Tests/aztoolsframeworktests_files.cmake b/Code/Framework/AzToolsFramework/Tests/aztoolsframeworktests_files.cmake index 9a1f61ab56..2631a84325 100644 --- a/Code/Framework/AzToolsFramework/Tests/aztoolsframeworktests_files.cmake +++ b/Code/Framework/AzToolsFramework/Tests/aztoolsframeworktests_files.cmake @@ -12,6 +12,7 @@ set(FILES AssetFileInfoListComparison.cpp AssetSeedManager.cpp AssetSystemMocks.h + AzToolsFrameworkTestHelpersTest.cpp BoundsTestComponent.cpp BoundsTestComponent.h ComponentAdapterTests.cpp From 90f710b8c2564547293487a53af0b474572a8481 Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Sun, 31 Oct 2021 09:48:06 -0700 Subject: [PATCH 376/948] feat: add cursor wrapped mode Signed-off-by: Michael Pollind --- Code/Editor/EditorViewportSettings.cpp | 11 ++ Code/Editor/EditorViewportSettings.h | 3 + .../test_ModularViewportCameraController.cpp | 4 +- .../Input/QtEventToAzInputMapper.cpp | 107 ++++++++++++++---- .../Input/QtEventToAzInputMapper.h | 19 +++- .../Source/Viewport/RenderViewportWidget.cpp | 4 +- 6 files changed, 121 insertions(+), 27 deletions(-) diff --git a/Code/Editor/EditorViewportSettings.cpp b/Code/Editor/EditorViewportSettings.cpp index e06b9696e1..5711d1c3d3 100644 --- a/Code/Editor/EditorViewportSettings.cpp +++ b/Code/Editor/EditorViewportSettings.cpp @@ -23,6 +23,7 @@ namespace SandboxEditor constexpr AZStd::string_view AngleSizeSetting = "/Amazon/Preferences/Editor/AngleSize"; constexpr AZStd::string_view ShowGridSetting = "/Amazon/Preferences/Editor/ShowGrid"; constexpr AZStd::string_view StickySelectSetting = "/Amazon/Preferences/Editor/StickySelect"; + constexpr AZStd::string_view ManipulatorMouseWrapSetting = "/Amazon/Preferences/Editor/Manipulator/MouseWrapping"; constexpr AZStd::string_view ManipulatorLineBoundWidthSetting = "/Amazon/Preferences/Editor/Manipulator/LineBoundWidth"; constexpr AZStd::string_view ManipulatorCircleBoundWidthSetting = "/Amazon/Preferences/Editor/Manipulator/CircleBoundWidth"; constexpr AZStd::string_view CameraTranslateSpeedSetting = "/Amazon/Preferences/Editor/Camera/TranslateSpeed"; @@ -186,6 +187,16 @@ namespace SandboxEditor AzToolsFramework::SetRegistry(ManipulatorLineBoundWidthSetting, lineBoundWidth); } + bool ManipulatorMouseWrap() + { + return aznumeric_cast(GetRegistry(ManipulatorMouseWrapSetting, false)); + } + + void SetManipulatorMouseWrap(bool wrapping) + { + SetRegistry(ManipulatorMouseWrapSetting, wrapping); + } + float ManipulatorCircleBoundWidth() { return aznumeric_cast(AzToolsFramework::GetRegistry(ManipulatorCircleBoundWidthSetting, 0.1)); diff --git a/Code/Editor/EditorViewportSettings.h b/Code/Editor/EditorViewportSettings.h index fe1253ed0c..975feff307 100644 --- a/Code/Editor/EditorViewportSettings.h +++ b/Code/Editor/EditorViewportSettings.h @@ -57,6 +57,9 @@ namespace SandboxEditor SANDBOX_API float ManipulatorLineBoundWidth(); SANDBOX_API void SetManipulatorLineBoundWidth(float lineBoundWidth); + SANDBOX_API bool ManipulatorMouseWrap(); + SANDBOX_API void SetManipulatorMouseWrap(bool wrapping); + SANDBOX_API float ManipulatorCircleBoundWidth(); SANDBOX_API void SetManipulatorCircleBoundWidth(float circleBoundWidth); diff --git a/Code/Editor/Lib/Tests/test_ModularViewportCameraController.cpp b/Code/Editor/Lib/Tests/test_ModularViewportCameraController.cpp index 67d89ad967..f2ee3c79aa 100644 --- a/Code/Editor/Lib/Tests/test_ModularViewportCameraController.cpp +++ b/Code/Editor/Lib/Tests/test_ModularViewportCameraController.cpp @@ -47,12 +47,12 @@ namespace UnitTest void ViewportMouseCursorRequestImpl::BeginCursorCapture() { - m_inputChannelMapper->SetCursorCaptureEnabled(true); + m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CURSOR_MODE_CAPTURED); } void ViewportMouseCursorRequestImpl::EndCursorCapture() { - m_inputChannelMapper->SetCursorCaptureEnabled(false); + m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CURSOR_MODE_NONE); } bool ViewportMouseCursorRequestImpl::IsMouseOver() const diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp index 066bdc1654..0b6df58c1a 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp @@ -241,25 +241,42 @@ namespace AzToolsFramework } } - void QtEventToAzInputMapper::SetCursorCaptureEnabled(bool enabled) + + void QtEventToAzInputMapper::SetCursorMode(QtEventToAzInputMapper::CursorInputMode mode) { - if (m_capturingCursor != enabled) + if(mode != m_cursorMode) { - m_capturingCursor = enabled; - - if (m_capturingCursor) + m_cursorMode = mode; + switch(m_cursorMode) { - m_mouseDevice->SetSystemCursorState(AzFramework::SystemCursorState::ConstrainedAndHidden); - qApp->setOverrideCursor(Qt::BlankCursor); - } - else - { - m_mouseDevice->SetSystemCursorState(AzFramework::SystemCursorState::UnconstrainedAndVisible); - qApp->restoreOverrideCursor(); + case CURSOR_MODE_CAPTURED: + qApp->setOverrideCursor(Qt::BlankCursor); + m_mouseDevice->SetSystemCursorState(AzFramework::SystemCursorState::ConstrainedAndHidden); + break; + case CURSOR_MODE_WRAPPED: + qApp->restoreOverrideCursor(); + m_mouseDevice->SetSystemCursorState(AzFramework::SystemCursorState::UnconstrainedAndVisible); + break; + case CURSOR_MODE_NONE: + qApp->restoreOverrideCursor(); + m_mouseDevice->SetSystemCursorState(AzFramework::SystemCursorState::UnconstrainedAndVisible); + break; } } } + void QtEventToAzInputMapper::SetCursorCaptureEnabled(bool enabled) + { + if (enabled) + { + SetCursorMode(CURSOR_MODE_CAPTURED); + } + else + { + SetCursorMode(CURSOR_MODE_NONE); + } + } + bool QtEventToAzInputMapper::eventFilter(QObject* object, QEvent* event) { // Abort if processing isn't enabled. @@ -436,25 +453,73 @@ namespace AzToolsFramework return QPoint{ denormalizedX, denormalizedY }; } + void wrapCursorX(const QRect& rect, QPoint& point) { + if (rect.left() < point.x()) + { + point.setX(rect.right() - 1); + } + else if (rect.right() > point.x()) + { + point.setX(rect.left() + 1); + } + } + + void wrapCursorY(const QRect& rect, QPoint& point) { + if (rect.top() < point.y()) + { + point.setY(rect.bottom() - 1); + } + else if (rect.bottom() > point.y()) + { + point.setY(rect.top() + 1); + } + } + + void QtEventToAzInputMapper::HandleMouseMoveEvent(const QPoint& globalCursorPosition) { const QPoint cursorDelta = globalCursorPosition - m_previousGlobalCursorPosition; + QScreen* screen = m_sourceWidget->screen(); + const QRect widgetRect(m_sourceWidget->mapToGlobal(QPoint(0,0)), m_sourceWidget->size()); m_mouseDevice->m_cursorPositionData2D->m_normalizedPosition = WidgetPositionToNormalizedPosition(m_sourceWidget->mapFromGlobal(globalCursorPosition)); m_mouseDevice->m_cursorPositionData2D->m_normalizedPositionDelta = WidgetPositionToNormalizedPosition(cursorDelta); - ProcessPendingMouseEvents(cursorDelta); - - if (m_capturingCursor) - { - // Reset our cursor position to the previous point - AzQtComponents::SetCursorPos(m_previousGlobalCursorPosition); - } - else + switch(m_cursorMode) { - m_previousGlobalCursorPosition = globalCursorPosition; + case CURSOR_MODE_CAPTURED: + AzQtComponents::SetCursorPos(m_previousGlobalCursorPosition); + break; + case CURSOR_MODE_WRAPPED_X: + QPoint screenPos(globalCursorPosition); + wrapCursorX(widgetRect, screenPos); + QCursor::setPos(screen, screenPos); + QPoint screenDelta = globalCursorPosition - screenPos; + m_previousGlobalCursorPosition = globalCursorPosition - screenDelta; + break; + case CURSOR_MODE_WRAPPED_Y: + QPoint screenPos(globalCursorPosition); + wrapCursorY(widgetRect, screenPos); + QCursor::setPos(screen, screenPos); + QPoint screenDelta = globalCursorPosition - screenPos; + m_previousGlobalCursorPosition = globalCursorPosition - screenDelta; + break; + case CURSOR_MODE_WRAPPED: + QPoint screenPos(globalCursorPosition); + wrapCursorX(widgetRect, screenPos); + wrapCursorY(widgetRect, screenPos); + QCursor::setPos(screen, screenPos); + QPoint screenDelta = globalCursorPosition - screenPos; + m_previousGlobalCursorPosition = globalCursorPosition - screenDelta; + break; + default: + m_previousGlobalCursorPosition = globalCursorPosition; + break; + + } + ProcessPendingMouseEvents(cursorDelta); } void QtEventToAzInputMapper::HandleKeyEvent(QKeyEvent* keyEvent) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.h index 373945d445..7ba4e21bd4 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.h @@ -41,6 +41,17 @@ namespace AzToolsFramework Q_OBJECT public: + enum CursorInputMode { + CURSOR_MODE_NONE, + CURSOR_MODE_CAPTURED, //< Sets whether or not the cursor should be constrained to the source widget and invisible. + //< Internally, this will reset the cursor position after each move event to ensure movement + //< events don't allow the cursor to escape. This can be used for typical camera controls + //< like a dolly or rotation, where mouse movement is important but cursor location is not. + CURSOR_MODE_WRAPPED, //< Flags whether the curser is going to wrap around the soruce widget. + CURSOR_MODE_WRAPPED_X, + CURSOR_MODE_WRAPPED_Y + }; + QtEventToAzInputMapper(QWidget* sourceWidget, int syntheticDeviceId = 0); ~QtEventToAzInputMapper() = default; @@ -56,8 +67,12 @@ namespace AzToolsFramework //! Internally, this will reset the cursor position after each move event to ensure movement //! events don't allow the cursor to escape. This can be used for typical camera controls //! like a dolly or rotation, where mouse movement is important but cursor location is not. + //! @deprecated Use #SetCursorMode() void SetCursorCaptureEnabled(bool enabled); + //! Set the cursor mode. + void SetCursorMode(QtEventToAzInputMapper::CursorInputMode mode); + void SetOverrideCursor(ViewportInteraction::CursorStyleOverride cursorStyleOverride); void ClearOverrideCursor(); @@ -176,8 +191,8 @@ namespace AzToolsFramework QWidget* m_sourceWidget; // Flags whether or not Qt events should currently be processed. bool m_enabled = true; - // Flags whether or not the cursor is being constrained to the source widget (for invisible mouse movement). - bool m_capturingCursor = false; + // Controls the cursor behavior. + QtEventToAzInputMapper::CursorInputMode m_cursorMode = CURSOR_MODE_NONE; // Flags whether the cursor has been overridden. bool m_overrideCursor = false; diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp index 505ff70122..cbede827e2 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp @@ -331,12 +331,12 @@ namespace AtomToolsFramework void RenderViewportWidget::BeginCursorCapture() { - m_inputChannelMapper->SetCursorCaptureEnabled(true); + m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CURSOR_MODE_CAPTURED); } void RenderViewportWidget::EndCursorCapture() { - m_inputChannelMapper->SetCursorCaptureEnabled(false); + m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CURSOR_MODE_NONE); } void RenderViewportWidget::SetOverrideCursor(AzToolsFramework::ViewportInteraction::CursorStyleOverride cursorStyleOverride) From fa809a76ca3804e95377c0776a40cf4004da90c8 Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Mon, 13 Dec 2021 07:28:28 -0800 Subject: [PATCH 377/948] chore: address changes - updated checkstyle - update enum CursorInputMode - minor refeactor to QtEventToAzInputMapper Signed-off-by: Michael Pollind --- Code/Editor/EditorViewportSettings.cpp | 10 +- Code/Editor/EditorViewportSettings.h | 4 +- .../test_ModularViewportCameraController.cpp | 4 +- .../Input/QtEventToAzInputMapper.cpp | 116 +++++++++--------- .../Input/QtEventToAzInputMapper.h | 14 +-- .../Source/Viewport/RenderViewportWidget.cpp | 4 +- 6 files changed, 74 insertions(+), 78 deletions(-) diff --git a/Code/Editor/EditorViewportSettings.cpp b/Code/Editor/EditorViewportSettings.cpp index 5711d1c3d3..883eb91863 100644 --- a/Code/Editor/EditorViewportSettings.cpp +++ b/Code/Editor/EditorViewportSettings.cpp @@ -23,7 +23,7 @@ namespace SandboxEditor constexpr AZStd::string_view AngleSizeSetting = "/Amazon/Preferences/Editor/AngleSize"; constexpr AZStd::string_view ShowGridSetting = "/Amazon/Preferences/Editor/ShowGrid"; constexpr AZStd::string_view StickySelectSetting = "/Amazon/Preferences/Editor/StickySelect"; - constexpr AZStd::string_view ManipulatorMouseWrapSetting = "/Amazon/Preferences/Editor/Manipulator/MouseWrapping"; + constexpr AZStd::string_view ViewportMouseWrapSetting = "/Amazon/Preferences/Editor/Manipulator/MouseWrapping"; constexpr AZStd::string_view ManipulatorLineBoundWidthSetting = "/Amazon/Preferences/Editor/Manipulator/LineBoundWidth"; constexpr AZStd::string_view ManipulatorCircleBoundWidthSetting = "/Amazon/Preferences/Editor/Manipulator/CircleBoundWidth"; constexpr AZStd::string_view CameraTranslateSpeedSetting = "/Amazon/Preferences/Editor/Camera/TranslateSpeed"; @@ -187,14 +187,14 @@ namespace SandboxEditor AzToolsFramework::SetRegistry(ManipulatorLineBoundWidthSetting, lineBoundWidth); } - bool ManipulatorMouseWrap() + bool ViewportMouseWrapSetting() { - return aznumeric_cast(GetRegistry(ManipulatorMouseWrapSetting, false)); + return aznumeric_cast(GetRegistry(ViewportMouseWrapSetting, false)); } - void SetManipulatorMouseWrap(bool wrapping) + void SetViewportMouseWrapSetting(bool wrapping) { - SetRegistry(ManipulatorMouseWrapSetting, wrapping); + SetRegistry(ViewportMouseWrapSetting, wrapping); } float ManipulatorCircleBoundWidth() diff --git a/Code/Editor/EditorViewportSettings.h b/Code/Editor/EditorViewportSettings.h index 975feff307..a27187bc55 100644 --- a/Code/Editor/EditorViewportSettings.h +++ b/Code/Editor/EditorViewportSettings.h @@ -57,8 +57,8 @@ namespace SandboxEditor SANDBOX_API float ManipulatorLineBoundWidth(); SANDBOX_API void SetManipulatorLineBoundWidth(float lineBoundWidth); - SANDBOX_API bool ManipulatorMouseWrap(); - SANDBOX_API void SetManipulatorMouseWrap(bool wrapping); + SANDBOX_API bool ViewportMouseWrapSetting(); + SANDBOX_API void SetViewportMouseWrapSetting(bool wrapping); SANDBOX_API float ManipulatorCircleBoundWidth(); SANDBOX_API void SetManipulatorCircleBoundWidth(float circleBoundWidth); diff --git a/Code/Editor/Lib/Tests/test_ModularViewportCameraController.cpp b/Code/Editor/Lib/Tests/test_ModularViewportCameraController.cpp index f2ee3c79aa..9bfd9d396e 100644 --- a/Code/Editor/Lib/Tests/test_ModularViewportCameraController.cpp +++ b/Code/Editor/Lib/Tests/test_ModularViewportCameraController.cpp @@ -47,12 +47,12 @@ namespace UnitTest void ViewportMouseCursorRequestImpl::BeginCursorCapture() { - m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CURSOR_MODE_CAPTURED); + m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CursorModeCaptured); } void ViewportMouseCursorRequestImpl::EndCursorCapture() { - m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CURSOR_MODE_NONE); + m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CursorModeNone); } bool ViewportMouseCursorRequestImpl::IsMouseOver() const diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp index 0b6df58c1a..77f297b98c 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp @@ -241,40 +241,32 @@ namespace AzToolsFramework } } - - void QtEventToAzInputMapper::SetCursorMode(QtEventToAzInputMapper::CursorInputMode mode) + void QtEventToAzInputMapper::SetCursorMode(QtEventToAzInputMapper::CursorInputMode mode) { - if(mode != m_cursorMode) + if (mode != m_cursorMode) { m_cursorMode = mode; - switch(m_cursorMode) + switch (m_cursorMode) { - case CURSOR_MODE_CAPTURED: - qApp->setOverrideCursor(Qt::BlankCursor); - m_mouseDevice->SetSystemCursorState(AzFramework::SystemCursorState::ConstrainedAndHidden); - break; - case CURSOR_MODE_WRAPPED: - qApp->restoreOverrideCursor(); - m_mouseDevice->SetSystemCursorState(AzFramework::SystemCursorState::UnconstrainedAndVisible); - break; - case CURSOR_MODE_NONE: - qApp->restoreOverrideCursor(); - m_mouseDevice->SetSystemCursorState(AzFramework::SystemCursorState::UnconstrainedAndVisible); - break; + case CursorInputMode::CursorModeCaptured: + qApp->setOverrideCursor(Qt::BlankCursor); + m_mouseDevice->SetSystemCursorState(AzFramework::SystemCursorState::ConstrainedAndHidden); + break; + case CursorInputMode::CursorModeWrapped: + qApp->restoreOverrideCursor(); + m_mouseDevice->SetSystemCursorState(AzFramework::SystemCursorState::UnconstrainedAndVisible); + break; + case CursorInputMode::CursorModeNone: + qApp->restoreOverrideCursor(); + m_mouseDevice->SetSystemCursorState(AzFramework::SystemCursorState::UnconstrainedAndVisible); + break; } } } void QtEventToAzInputMapper::SetCursorCaptureEnabled(bool enabled) { - if (enabled) - { - SetCursorMode(CURSOR_MODE_CAPTURED); - } - else - { - SetCursorMode(CURSOR_MODE_NONE); - } + SetCursorMode(enabled ? CursorInputMode::CursorModeCaptured : CursorInputMode::CursorModeNone); } bool QtEventToAzInputMapper::eventFilter(QObject* object, QEvent* event) @@ -453,71 +445,75 @@ namespace AzToolsFramework return QPoint{ denormalizedX, denormalizedY }; } - void wrapCursorX(const QRect& rect, QPoint& point) { - if (rect.left() < point.x()) + void wrapCursorX(const QRect& rect, QPoint& point) + { + if (rect.left() < point.x()) { point.setX(rect.right() - 1); } - else if (rect.right() > point.x()) + else if (rect.right() > point.x()) { point.setX(rect.left() + 1); } } - void wrapCursorY(const QRect& rect, QPoint& point) { - if (rect.top() < point.y()) + void wrapCursorY(const QRect& rect, QPoint& point) + { + if (rect.top() < point.y()) { point.setY(rect.bottom() - 1); } - else if (rect.bottom() > point.y()) + else if (rect.bottom() > point.y()) { point.setY(rect.top() + 1); } } - void QtEventToAzInputMapper::HandleMouseMoveEvent(const QPoint& globalCursorPosition) { const QPoint cursorDelta = globalCursorPosition - m_previousGlobalCursorPosition; QScreen* screen = m_sourceWidget->screen(); - const QRect widgetRect(m_sourceWidget->mapToGlobal(QPoint(0,0)), m_sourceWidget->size()); + const QRect widgetRect(m_sourceWidget->mapToGlobal(QPoint(0, 0)), m_sourceWidget->size()); m_mouseDevice->m_cursorPositionData2D->m_normalizedPosition = WidgetPositionToNormalizedPosition(m_sourceWidget->mapFromGlobal(globalCursorPosition)); m_mouseDevice->m_cursorPositionData2D->m_normalizedPositionDelta = WidgetPositionToNormalizedPosition(cursorDelta); - switch(m_cursorMode) + switch (m_cursorMode) { - case CURSOR_MODE_CAPTURED: - AzQtComponents::SetCursorPos(m_previousGlobalCursorPosition); - break; - case CURSOR_MODE_WRAPPED_X: - QPoint screenPos(globalCursorPosition); - wrapCursorX(widgetRect, screenPos); - QCursor::setPos(screen, screenPos); - QPoint screenDelta = globalCursorPosition - screenPos; - m_previousGlobalCursorPosition = globalCursorPosition - screenDelta; - break; - case CURSOR_MODE_WRAPPED_Y: - QPoint screenPos(globalCursorPosition); - wrapCursorY(widgetRect, screenPos); - QCursor::setPos(screen, screenPos); - QPoint screenDelta = globalCursorPosition - screenPos; - m_previousGlobalCursorPosition = globalCursorPosition - screenDelta; - break; - case CURSOR_MODE_WRAPPED: + case CursorInputMode::CursorModeCaptured: + AzQtComponents::SetCursorPos(m_previousGlobalCursorPosition); + break; + case CursorInputMode::CursorModeWrappedX: + case CursorInputMode::CursorModeWrappedY: + case CursorInputMode::CursorModeWrapped: + { QPoint screenPos(globalCursorPosition); - wrapCursorX(widgetRect, screenPos); - wrapCursorY(widgetRect, screenPos); + switch (m_cursorMode) + { + case CursorInputMode::CursorModeWrappedX: + wrapCursorX(widgetRect, screenPos); + break; + case CursorInputMode::CursorModeWrappedY: + wrapCursorY(widgetRect, screenPos); + break; + case CursorInputMode::CursorModeWrapped: + wrapCursorX(widgetRect, screenPos); + wrapCursorY(widgetRect, screenPos); + break; + default: + // this should never happen + AZ_Assert(false, "Invalid Curosr Mode: %i.", m_cursorMode); + break; + } QCursor::setPos(screen, screenPos); - QPoint screenDelta = globalCursorPosition - screenPos; + const QPoint screenDelta = globalCursorPosition - screenPos; m_previousGlobalCursorPosition = globalCursorPosition - screenDelta; - break; - default: - m_previousGlobalCursorPosition = globalCursorPosition; - break; - - + } + break; + default: + AZ_Assert(false, "Invalid Curosr Mode: %i.", m_cursorMode); + break; } ProcessPendingMouseEvents(cursorDelta); } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.h index 7ba4e21bd4..a6d9fdd753 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.h @@ -41,15 +41,15 @@ namespace AzToolsFramework Q_OBJECT public: - enum CursorInputMode { - CURSOR_MODE_NONE, - CURSOR_MODE_CAPTURED, //< Sets whether or not the cursor should be constrained to the source widget and invisible. + enum class CursorInputMode { + CursorModeNone, + CursorModeCaptured, //< Sets whether or not the cursor should be constrained to the source widget and invisible. //< Internally, this will reset the cursor position after each move event to ensure movement //< events don't allow the cursor to escape. This can be used for typical camera controls //< like a dolly or rotation, where mouse movement is important but cursor location is not. - CURSOR_MODE_WRAPPED, //< Flags whether the curser is going to wrap around the soruce widget. - CURSOR_MODE_WRAPPED_X, - CURSOR_MODE_WRAPPED_Y + CursorModeWrapped, //< Flags whether the curser is going to wrap around the soruce widget. + CursorModeWrappedX, + CursorModeWrappedY }; QtEventToAzInputMapper(QWidget* sourceWidget, int syntheticDeviceId = 0); @@ -192,7 +192,7 @@ namespace AzToolsFramework // Flags whether or not Qt events should currently be processed. bool m_enabled = true; // Controls the cursor behavior. - QtEventToAzInputMapper::CursorInputMode m_cursorMode = CURSOR_MODE_NONE; + QtEventToAzInputMapper::CursorInputMode m_cursorMode = CursorInputMode::CursorModeNone; // Flags whether the cursor has been overridden. bool m_overrideCursor = false; diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp index cbede827e2..ef23560d57 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp @@ -331,12 +331,12 @@ namespace AtomToolsFramework void RenderViewportWidget::BeginCursorCapture() { - m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CURSOR_MODE_CAPTURED); + m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CursorModeCaptured); } void RenderViewportWidget::EndCursorCapture() { - m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CURSOR_MODE_NONE); + m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CursorModeNone); } void RenderViewportWidget::SetOverrideCursor(AzToolsFramework::ViewportInteraction::CursorStyleOverride cursorStyleOverride) From 3a6f877a9f79157424d5a86d05f9f1b7a98d1585 Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Tue, 14 Dec 2021 23:05:13 -0800 Subject: [PATCH 378/948] chore: add first test Signed-off-by: Michael Pollind --- .../Input/QtEventToAzInputMapper.cpp | 8 ++--- .../Input/QtEventToAzInputMapperTests.cpp | 32 +++++++++++++++++++ 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp index 77f297b98c..7852a4a5d5 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp @@ -447,11 +447,11 @@ namespace AzToolsFramework void wrapCursorX(const QRect& rect, QPoint& point) { - if (rect.left() < point.x()) + if (point.x() < rect.left()) { point.setX(rect.right() - 1); } - else if (rect.right() > point.x()) + else if (point.x() > rect.right()) { point.setX(rect.left() + 1); } @@ -459,11 +459,11 @@ namespace AzToolsFramework void wrapCursorY(const QRect& rect, QPoint& point) { - if (rect.top() < point.y()) + if (point.y() < rect.top()) { point.setY(rect.bottom() - 1); } - else if (rect.bottom() > point.y()) + else if (point.y() > rect.bottom()) { point.setY(rect.top() + 1); } diff --git a/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp b/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp index 4c813a4bdd..e645c365e2 100644 --- a/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp +++ b/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp @@ -44,6 +44,10 @@ namespace UnitTest QObject::connect(m_inputChannelMapper.get(), &AzToolsFramework::QtEventToAzInputMapper::InputChannelUpdated, m_rootWidget.get(), [this]([[maybe_unused]] const AzFramework::InputChannel* inputChannel, QEvent* event) { + if(event == nullptr) { + return; + } + const QEvent::Type eventType = event->type(); if (eventType == QEvent::Type::MouseButtonPress || @@ -512,4 +516,32 @@ namespace UnitTest return info.param.m_az.GetName(); } ); + + TEST_F(QtEventToAzInputMapperFixture, MouseWrapMouseViewportQtEventToAzInputMapperFixture) + { + AzFramework::InputChannelNotificationBus::Handler::BusConnect(); + m_captureAzEvents = false; + + + const auto startPos = QPoint(WidgetSize.width() - 2, WidgetSize.height() / 2); + MouseMove(m_rootWidget.get(), startPos, QPoint(0,0)); + m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CursorInputMode::CursorModeWrappedX); + + const auto deltaPos = QPoint(200.0f, 0); + const auto expectedPosition = m_rootWidget->mapToGlobal(QPoint(200, WidgetSize.height() / 2)); + const int iterations = 50; + + for(float i = 0; i < iterations; i++) { + MouseMove(m_rootWidget.get(), m_rootWidget->mapFromGlobal(QCursor::pos()), (deltaPos / iterations)); + } + + QPointF endPosition = QCursor::pos(); + EXPECT_NEAR(endPosition.x(), expectedPosition.x(), 5.0f); + EXPECT_NEAR(endPosition.y(), expectedPosition.y(), 5.0f); + + // cleanup + m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CursorInputMode::CursorModeNone); + AzFramework::InputChannelNotificationBus::Handler::BusDisconnect(); + } + } // namespace UnitTest From 9e91c1872670c73cd1f3de98de616675ce9da8a5 Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Wed, 15 Dec 2021 13:32:24 -0800 Subject: [PATCH 379/948] chore: address changes add test cases Signed-off-by: Michael Pollind --- Code/Editor/EditorViewportSettings.cpp | 2 +- .../Input/QtEventToAzInputMapper.cpp | 14 +- .../Input/QtEventToAzInputMapper.h | 26 +-- .../Input/QtEventToAzInputMapperTests.cpp | 153 +++++++++++++++--- 4 files changed, 154 insertions(+), 41 deletions(-) diff --git a/Code/Editor/EditorViewportSettings.cpp b/Code/Editor/EditorViewportSettings.cpp index 883eb91863..7108beca5a 100644 --- a/Code/Editor/EditorViewportSettings.cpp +++ b/Code/Editor/EditorViewportSettings.cpp @@ -189,7 +189,7 @@ namespace SandboxEditor bool ViewportMouseWrapSetting() { - return aznumeric_cast(GetRegistry(ViewportMouseWrapSetting, false)); + return GetRegistry(ViewportMouseWrapSetting, false); } void SetViewportMouseWrapSetting(bool wrapping) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp index 7852a4a5d5..edd45a7200 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp @@ -241,7 +241,7 @@ namespace AzToolsFramework } } - void QtEventToAzInputMapper::SetCursorMode(QtEventToAzInputMapper::CursorInputMode mode) + void QtEventToAzInputMapper::SetCursorMode(AzToolsFramework::CursorInputMode mode) { if (mode != m_cursorMode) { @@ -445,7 +445,7 @@ namespace AzToolsFramework return QPoint{ denormalizedX, denormalizedY }; } - void wrapCursorX(const QRect& rect, QPoint& point) + void WrapCursorX(const QRect& rect, QPoint& point) { if (point.x() < rect.left()) { @@ -457,7 +457,7 @@ namespace AzToolsFramework } } - void wrapCursorY(const QRect& rect, QPoint& point) + void WrapCursorY(const QRect& rect, QPoint& point) { if (point.y() < rect.top()) { @@ -492,14 +492,14 @@ namespace AzToolsFramework switch (m_cursorMode) { case CursorInputMode::CursorModeWrappedX: - wrapCursorX(widgetRect, screenPos); + WrapCursorX(widgetRect, screenPos); break; case CursorInputMode::CursorModeWrappedY: - wrapCursorY(widgetRect, screenPos); + WrapCursorY(widgetRect, screenPos); break; case CursorInputMode::CursorModeWrapped: - wrapCursorX(widgetRect, screenPos); - wrapCursorY(widgetRect, screenPos); + WrapCursorX(widgetRect, screenPos); + WrapCursorY(widgetRect, screenPos); break; default: // this should never happen diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.h index a6d9fdd753..b84ac99c74 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.h @@ -32,6 +32,17 @@ class QWheelEvent; namespace AzToolsFramework { + enum class CursorInputMode { + CursorModeNone, + CursorModeCaptured, //!< Sets whether or not the cursor should be constrained to the source widget and invisible. + //!< Internally, this will reset the cursor position after each move event to ensure movement + //!< events don't allow the cursor to escape. This can be used for typical camera controls + //!< like a dolly or rotation, where mouse movement is important but cursor location is not. + CursorModeWrapped, //!< Flags whether the curser is going to wrap around the soruce widget. + CursorModeWrappedX, + CursorModeWrappedY + }; + //! Maps events from the Qt input system to synthetic InputChannels in AzFramework //! that can be used by AzFramework::ViewportControllers. class QtEventToAzInputMapper final @@ -41,17 +52,6 @@ namespace AzToolsFramework Q_OBJECT public: - enum class CursorInputMode { - CursorModeNone, - CursorModeCaptured, //< Sets whether or not the cursor should be constrained to the source widget and invisible. - //< Internally, this will reset the cursor position after each move event to ensure movement - //< events don't allow the cursor to escape. This can be used for typical camera controls - //< like a dolly or rotation, where mouse movement is important but cursor location is not. - CursorModeWrapped, //< Flags whether the curser is going to wrap around the soruce widget. - CursorModeWrappedX, - CursorModeWrappedY - }; - QtEventToAzInputMapper(QWidget* sourceWidget, int syntheticDeviceId = 0); ~QtEventToAzInputMapper() = default; @@ -71,7 +71,7 @@ namespace AzToolsFramework void SetCursorCaptureEnabled(bool enabled); //! Set the cursor mode. - void SetCursorMode(QtEventToAzInputMapper::CursorInputMode mode); + void SetCursorMode(AzToolsFramework::CursorInputMode mode); void SetOverrideCursor(ViewportInteraction::CursorStyleOverride cursorStyleOverride); void ClearOverrideCursor(); @@ -192,7 +192,7 @@ namespace AzToolsFramework // Flags whether or not Qt events should currently be processed. bool m_enabled = true; // Controls the cursor behavior. - QtEventToAzInputMapper::CursorInputMode m_cursorMode = CursorInputMode::CursorModeNone; + AzToolsFramework::CursorInputMode m_cursorMode = AzToolsFramework::CursorInputMode::CursorModeNone; // Flags whether the cursor has been overridden. bool m_overrideCursor = false; diff --git a/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp b/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp index e645c365e2..9af445850c 100644 --- a/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp +++ b/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp @@ -44,10 +44,10 @@ namespace UnitTest QObject::connect(m_inputChannelMapper.get(), &AzToolsFramework::QtEventToAzInputMapper::InputChannelUpdated, m_rootWidget.get(), [this]([[maybe_unused]] const AzFramework::InputChannel* inputChannel, QEvent* event) { - if(event == nullptr) { + if(event == nullptr) + { return; } - const QEvent::Type eventType = event->type(); if (eventType == QEvent::Type::MouseButtonPress || @@ -517,31 +517,144 @@ namespace UnitTest } ); - TEST_F(QtEventToAzInputMapperFixture, MouseWrapMouseViewportQtEventToAzInputMapperFixture) + struct MouseMoveParam + { + AzToolsFramework::CursorInputMode mode; + int iterations; + QPoint startPos; + QPoint deltaPos; + QPoint expectedPos; + const char* name; + }; + + class MoveMoveWrapParamQtEventToAzInputMapperFixture + : public QtEventToAzInputMapperFixture + , public ::testing::WithParamInterface { + }; + + TEST_P(MoveMoveWrapParamQtEventToAzInputMapperFixture, MouseMove_NoAzHandlers_VerifyMouseMovmentViewport) + { + // setup + const MouseMoveParam mouseMoveParam = GetParam(); + AzFramework::InputChannelNotificationBus::Handler::BusConnect(); m_captureAzEvents = false; + m_inputChannelMapper->SetCursorMode(mouseMoveParam.mode); + m_rootWidget->move(100, 100); - - const auto startPos = QPoint(WidgetSize.width() - 2, WidgetSize.height() / 2); - MouseMove(m_rootWidget.get(), startPos, QPoint(0,0)); - m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CursorInputMode::CursorModeWrappedX); - - const auto deltaPos = QPoint(200.0f, 0); - const auto expectedPosition = m_rootWidget->mapToGlobal(QPoint(200, WidgetSize.height() / 2)); - const int iterations = 50; - - for(float i = 0; i < iterations; i++) { - MouseMove(m_rootWidget.get(), m_rootWidget->mapFromGlobal(QCursor::pos()), (deltaPos / iterations)); + + MouseMove(m_rootWidget.get(), mouseMoveParam.startPos, QPoint(0,0)); + for(float i = 0; i < mouseMoveParam.iterations; i++) { + MouseMove(m_rootWidget.get(), m_rootWidget->mapFromGlobal(QCursor::pos()), (mouseMoveParam.deltaPos / mouseMoveParam.iterations)); } - - QPointF endPosition = QCursor::pos(); - EXPECT_NEAR(endPosition.x(), expectedPosition.x(), 5.0f); - EXPECT_NEAR(endPosition.y(), expectedPosition.y(), 5.0f); - + + QPointF endPosition = m_rootWidget->mapFromGlobal(QCursor::pos()); + EXPECT_NEAR(endPosition.x(), mouseMoveParam.expectedPos.x(), 1.0f); + EXPECT_NEAR(endPosition.y(), mouseMoveParam.expectedPos.y(), 1.0f); + // cleanup - m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CursorInputMode::CursorModeNone); + m_rootWidget->move(0, 0); + m_inputChannelMapper->SetCursorMode(AzToolsFramework::CursorInputMode::CursorModeNone); AzFramework::InputChannelNotificationBus::Handler::BusDisconnect(); } + INSTANTIATE_TEST_CASE_P(All, MoveMoveWrapParamQtEventToAzInputMapperFixture, + testing::Values( + // verify CursorModeWrappedX wrapping + MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeWrappedX, + 40, + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() - 20, QtEventToAzInputMapperFixture::WidgetSize.height()/2.0f), + QPoint(40, 0), + QPoint(20, QtEventToAzInputMapperFixture::WidgetSize.height()/2.0f), + "CursorModeWrappedX_Test_Right" + }, + MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeWrappedX, + 40, + QPoint(20, QtEventToAzInputMapperFixture::WidgetSize.height()/2.0f), + QPoint(-40, 0), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() - 20, QtEventToAzInputMapperFixture::WidgetSize.height()/2.0f), + "CursorModeWrappedX_Test_Left" + }, + MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeWrappedX, + 40, + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, 20.0f), + QPoint(0, -40), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, -20.0f), + "CursorModeWrappedX_Test_Top" + }, + MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeWrappedX, + 40, + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, QtEventToAzInputMapperFixture::WidgetSize.height() - 20), + QPoint(0, 40), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, QtEventToAzInputMapperFixture::WidgetSize.height() + 20), + "CursorModeWrappedX_Test_Bottom" + }, + + // verify CursorModeWrappedY wrapping + MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeWrappedY, + 40, + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() - 20, QtEventToAzInputMapperFixture::WidgetSize.height()/2.0f), + QPoint(40, 0), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() + 20, QtEventToAzInputMapperFixture::WidgetSize.height()/2.0f), + "CursorModeWrappedY_Test_Right" + }, + MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeWrappedY, + 40, + QPoint(20, QtEventToAzInputMapperFixture::WidgetSize.height()/2.0f), + QPoint(-40, 0), + QPoint(-20, QtEventToAzInputMapperFixture::WidgetSize.height()/2.0f), + "CursorModeWrappedY_Test_Left" + }, + MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeWrappedY, + 40, + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, 20.0f), + QPoint(0, -40), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, QtEventToAzInputMapperFixture::WidgetSize.height() - 20.0f), + "CursorModeWrappedY_Test_Top" + }, + MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeWrappedY, + 40, + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, QtEventToAzInputMapperFixture::WidgetSize.height() - 20), + QPoint(0, 40), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, 20), + "CursorModeWrappedY_Test_Bottom" + }, + + // verify CursorModeWrapped wrapping + MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeWrapped, + 40, + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() - 20, QtEventToAzInputMapperFixture::WidgetSize.height()/2.0f), + QPoint(40, 0), + QPoint(20, QtEventToAzInputMapperFixture::WidgetSize.height()/2.0f), + "CursorModeWrapped_Test_Right" + }, + MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeWrapped, + 40, + QPoint(20, QtEventToAzInputMapperFixture::WidgetSize.height()/2.0f), + QPoint(-40, 0), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() - 20, QtEventToAzInputMapperFixture::WidgetSize.height()/2.0f), + "CursorModeWrapped_Test_Left" + }, + MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeWrapped, + 40, + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, 20.0f), + QPoint(0, -40), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, QtEventToAzInputMapperFixture::WidgetSize.height() - 20.0f), + "CursorModeWrapped_Test_Top" + }, + MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeWrapped, + 40, + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, QtEventToAzInputMapperFixture::WidgetSize.height() - 20), + QPoint(0, 40), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, 20), + "CursorModeWrapped_Test_Bottom" + } + ), + [](const ::testing::TestParamInfo& info) + { + return info.param.name; + } + ); + } // namespace UnitTest From 1654ff052041567778624fd7078164533bc37f42 Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Thu, 16 Dec 2021 22:37:31 -0800 Subject: [PATCH 380/948] chore: correct test case MouseMove_NoAzHandlers_VerifyMouseMovementViewport Signed-off-by: Michael Pollind --- .../Input/QtEventToAzInputMapper.cpp | 3 ++ .../Input/QtEventToAzInputMapper.h | 4 +- .../Input/QtEventToAzInputMapperTests.cpp | 43 ++++++++++++++++--- 3 files changed, 42 insertions(+), 8 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp index edd45a7200..b660e87b56 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.cpp @@ -511,6 +511,9 @@ namespace AzToolsFramework m_previousGlobalCursorPosition = globalCursorPosition - screenDelta; } break; + case CursorInputMode::CursorModeNone: + m_previousGlobalCursorPosition = globalCursorPosition; + break; default: AZ_Assert(false, "Invalid Curosr Mode: %i.", m_cursorMode); break; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.h index b84ac99c74..67ef195363 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputMapper.h @@ -39,8 +39,8 @@ namespace AzToolsFramework //!< events don't allow the cursor to escape. This can be used for typical camera controls //!< like a dolly or rotation, where mouse movement is important but cursor location is not. CursorModeWrapped, //!< Flags whether the curser is going to wrap around the soruce widget. - CursorModeWrappedX, - CursorModeWrappedY + CursorModeWrappedX, //!< Flags whether the curser is going to wrap around the soruce widget only on the left and right side. + CursorModeWrappedY //!< Flags whether the curser is going to wrap around the soruce widget only on the top and bottom side. }; //! Maps events from the Qt input system to synthetic InputChannels in AzFramework diff --git a/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp b/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp index 9af445850c..0282812be7 100644 --- a/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp +++ b/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp @@ -533,23 +533,38 @@ namespace UnitTest { }; - TEST_P(MoveMoveWrapParamQtEventToAzInputMapperFixture, MouseMove_NoAzHandlers_VerifyMouseMovmentViewport) + TEST_P(MoveMoveWrapParamQtEventToAzInputMapperFixture, MouseMove_NoAzHandlers_VerifyMouseMovementViewport) { + //TODO: mouseMove is bugged mapToGlobal is called twice + auto mouseMoveFix = [](QWidget* wid, QPoint globalPos, QPoint deltaPos) + { + QPoint globalPosition = globalPos + deltaPos; + QPoint localPosition = wid->mapFromGlobal(globalPosition); + QTest::mouseMove(wid, localPosition); + QMouseEvent mouseMoveEvent(QEvent::MouseMove, localPosition, globalPosition, Qt::NoButton, Qt::NoButton, Qt::NoModifier); + QApplication::sendEvent(wid, &mouseMoveEvent); + }; + // setup const MouseMoveParam mouseMoveParam = GetParam(); AzFramework::InputChannelNotificationBus::Handler::BusConnect(); m_captureAzEvents = false; - m_inputChannelMapper->SetCursorMode(mouseMoveParam.mode); + m_rootWidget->move(100, 100); + mouseMoveFix(m_rootWidget.get(), m_rootWidget->mapToGlobal(mouseMoveParam.startPos), QPoint(0, 0)); + // given + m_inputChannelMapper->SetCursorMode(mouseMoveParam.mode); - MouseMove(m_rootWidget.get(), mouseMoveParam.startPos, QPoint(0,0)); - for(float i = 0; i < mouseMoveParam.iterations; i++) { - MouseMove(m_rootWidget.get(), m_rootWidget->mapFromGlobal(QCursor::pos()), (mouseMoveParam.deltaPos / mouseMoveParam.iterations)); + mouseMoveFix(m_rootWidget.get(), m_rootWidget->mapToGlobal(mouseMoveParam.startPos), QPoint(0, 0)); + for (float i = 0; i < mouseMoveParam.iterations; i++) + { + mouseMoveFix(m_rootWidget.get(), QCursor::pos(), (mouseMoveParam.deltaPos / mouseMoveParam.iterations)); } - QPointF endPosition = m_rootWidget->mapFromGlobal(QCursor::pos()); + // validate + QPoint endPosition = m_rootWidget->mapFromGlobal(QCursor::pos()); EXPECT_NEAR(endPosition.x(), mouseMoveParam.expectedPos.x(), 1.0f); EXPECT_NEAR(endPosition.y(), mouseMoveParam.expectedPos.y(), 1.0f); @@ -649,6 +664,22 @@ namespace UnitTest QPoint(0, 40), QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, 20), "CursorModeWrapped_Test_Bottom" + }, + // verify CursorModeCaptured + MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeCaptured, + 40, + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, QtEventToAzInputMapperFixture::WidgetSize.height() / 2.0f), + QPoint(0, 40), + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, QtEventToAzInputMapperFixture::WidgetSize.height() / 2.0f), + "CursorModeCaptured" + }, + // verify CursorModeNone + MouseMoveParam {AzToolsFramework::CursorInputMode::CursorModeNone, + 40, + QPoint(QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f, QtEventToAzInputMapperFixture::WidgetSize.height() / 2.0f), + QPoint(40.0f, 0), + QPoint((QtEventToAzInputMapperFixture::WidgetSize.width() / 2.0f) + 40.0f, (QtEventToAzInputMapperFixture::WidgetSize.height() / 2.0f)), + "CursorModeNone" } ), [](const ::testing::TestParamInfo& info) From 95c0c83642b2496f96418745b6c245ee50cf87b9 Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Sat, 18 Dec 2021 18:29:39 -0800 Subject: [PATCH 381/948] chore: remove unused setting and fixed compiling errors Signed-off-by: Michael Pollind --- Code/Editor/EditorViewportSettings.cpp | 11 ----------- Code/Editor/EditorViewportSettings.h | 3 --- .../Tests/test_ModularViewportCameraController.cpp | 4 ++-- .../Code/Source/Viewport/RenderViewportWidget.cpp | 4 ++-- 4 files changed, 4 insertions(+), 18 deletions(-) diff --git a/Code/Editor/EditorViewportSettings.cpp b/Code/Editor/EditorViewportSettings.cpp index 7108beca5a..e06b9696e1 100644 --- a/Code/Editor/EditorViewportSettings.cpp +++ b/Code/Editor/EditorViewportSettings.cpp @@ -23,7 +23,6 @@ namespace SandboxEditor constexpr AZStd::string_view AngleSizeSetting = "/Amazon/Preferences/Editor/AngleSize"; constexpr AZStd::string_view ShowGridSetting = "/Amazon/Preferences/Editor/ShowGrid"; constexpr AZStd::string_view StickySelectSetting = "/Amazon/Preferences/Editor/StickySelect"; - constexpr AZStd::string_view ViewportMouseWrapSetting = "/Amazon/Preferences/Editor/Manipulator/MouseWrapping"; constexpr AZStd::string_view ManipulatorLineBoundWidthSetting = "/Amazon/Preferences/Editor/Manipulator/LineBoundWidth"; constexpr AZStd::string_view ManipulatorCircleBoundWidthSetting = "/Amazon/Preferences/Editor/Manipulator/CircleBoundWidth"; constexpr AZStd::string_view CameraTranslateSpeedSetting = "/Amazon/Preferences/Editor/Camera/TranslateSpeed"; @@ -187,16 +186,6 @@ namespace SandboxEditor AzToolsFramework::SetRegistry(ManipulatorLineBoundWidthSetting, lineBoundWidth); } - bool ViewportMouseWrapSetting() - { - return GetRegistry(ViewportMouseWrapSetting, false); - } - - void SetViewportMouseWrapSetting(bool wrapping) - { - SetRegistry(ViewportMouseWrapSetting, wrapping); - } - float ManipulatorCircleBoundWidth() { return aznumeric_cast(AzToolsFramework::GetRegistry(ManipulatorCircleBoundWidthSetting, 0.1)); diff --git a/Code/Editor/EditorViewportSettings.h b/Code/Editor/EditorViewportSettings.h index a27187bc55..fe1253ed0c 100644 --- a/Code/Editor/EditorViewportSettings.h +++ b/Code/Editor/EditorViewportSettings.h @@ -57,9 +57,6 @@ namespace SandboxEditor SANDBOX_API float ManipulatorLineBoundWidth(); SANDBOX_API void SetManipulatorLineBoundWidth(float lineBoundWidth); - SANDBOX_API bool ViewportMouseWrapSetting(); - SANDBOX_API void SetViewportMouseWrapSetting(bool wrapping); - SANDBOX_API float ManipulatorCircleBoundWidth(); SANDBOX_API void SetManipulatorCircleBoundWidth(float circleBoundWidth); diff --git a/Code/Editor/Lib/Tests/test_ModularViewportCameraController.cpp b/Code/Editor/Lib/Tests/test_ModularViewportCameraController.cpp index 9bfd9d396e..5009c626e2 100644 --- a/Code/Editor/Lib/Tests/test_ModularViewportCameraController.cpp +++ b/Code/Editor/Lib/Tests/test_ModularViewportCameraController.cpp @@ -47,12 +47,12 @@ namespace UnitTest void ViewportMouseCursorRequestImpl::BeginCursorCapture() { - m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CursorModeCaptured); + m_inputChannelMapper->SetCursorMode(AzToolsFramework::CursorInputMode::CursorModeCaptured); } void ViewportMouseCursorRequestImpl::EndCursorCapture() { - m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CursorModeNone); + m_inputChannelMapper->SetCursorMode(AzToolsFramework::CursorInputMode::CursorModeNone); } bool ViewportMouseCursorRequestImpl::IsMouseOver() const diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp index ef23560d57..d6871a8795 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp @@ -331,12 +331,12 @@ namespace AtomToolsFramework void RenderViewportWidget::BeginCursorCapture() { - m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CursorModeCaptured); + m_inputChannelMapper->SetCursorMode(AzToolsFramework::CursorInputMode::CursorModeCaptured); } void RenderViewportWidget::EndCursorCapture() { - m_inputChannelMapper->SetCursorMode(AzToolsFramework::QtEventToAzInputMapper::CursorModeNone); + m_inputChannelMapper->SetCursorMode(AzToolsFramework::CursorInputMode::CursorModeNone); } void RenderViewportWidget::SetOverrideCursor(AzToolsFramework::ViewportInteraction::CursorStyleOverride cursorStyleOverride) From ed39c784c304c0cf9a374b297f3521f7f0787fc2 Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Sun, 19 Dec 2021 18:22:14 -0800 Subject: [PATCH 382/948] chore: add accumulated test for mouse position Signed-off-by: Michael Pollind --- .../Tests/Input/QtEventToAzInputMapperTests.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp b/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp index 0282812be7..5047c19044 100644 --- a/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp +++ b/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp @@ -100,6 +100,11 @@ namespace UnitTest m_azChannelEvents.push_back(AzEventInfo(inputChannel)); hasBeenConsumed = m_captureAzEvents; } + else if (inputChannelId == AzFramework::InputDeviceMouse::SystemCursorPosition) + { + m_azCursorPositions.push_back(*inputChannel.GetCustomData()); + hasBeenConsumed = m_captureAzEvents; + } } else if (AzFramework::InputDeviceKeyboard::IsKeyboardDevice(inputDeviceId)) { @@ -165,6 +170,7 @@ namespace UnitTest AZStd::vector m_signalEvents; AZStd::vector m_azChannelEvents; AZStd::vector m_azTextEvents; + AZStd::vector m_azCursorPositions; bool m_captureAzEvents{ false }; bool m_captureTextEvents{ false }; @@ -549,13 +555,14 @@ namespace UnitTest const MouseMoveParam mouseMoveParam = GetParam(); AzFramework::InputChannelNotificationBus::Handler::BusConnect(); - m_captureAzEvents = false; + m_captureAzEvents = true; m_rootWidget->move(100, 100); mouseMoveFix(m_rootWidget.get(), m_rootWidget->mapToGlobal(mouseMoveParam.startPos), QPoint(0, 0)); // given m_inputChannelMapper->SetCursorMode(mouseMoveParam.mode); + m_azCursorPositions.clear(); mouseMoveFix(m_rootWidget.get(), m_rootWidget->mapToGlobal(mouseMoveParam.startPos), QPoint(0, 0)); for (float i = 0; i < mouseMoveParam.iterations; i++) @@ -563,11 +570,19 @@ namespace UnitTest mouseMoveFix(m_rootWidget.get(), QCursor::pos(), (mouseMoveParam.deltaPos / mouseMoveParam.iterations)); } + AZ::Vector2 accumalatedPosition(0.0f,0.0f); + for(const auto& pos: m_azCursorPositions) { + accumalatedPosition += (pos.m_normalizedPositionDelta * AZ::Vector2(WidgetSize.width(), WidgetSize.height())); + } + // validate QPoint endPosition = m_rootWidget->mapFromGlobal(QCursor::pos()); EXPECT_NEAR(endPosition.x(), mouseMoveParam.expectedPos.x(), 1.0f); EXPECT_NEAR(endPosition.y(), mouseMoveParam.expectedPos.y(), 1.0f); + EXPECT_NEAR(accumalatedPosition.GetX(), mouseMoveParam.deltaPos.x(), 1.0f); + EXPECT_NEAR(accumalatedPosition.GetY(), mouseMoveParam.deltaPos.y(), 1.0f); + // cleanup m_rootWidget->move(0, 0); m_inputChannelMapper->SetCursorMode(AzToolsFramework::CursorInputMode::CursorModeNone); From f8734d7d067e12ca0755e4fd4f50798964ca58f5 Mon Sep 17 00:00:00 2001 From: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> Date: Fri, 7 Jan 2022 09:44:43 -0600 Subject: [PATCH 383/948] Finalizing update of Editor tests to utilize prefab system Signed-off-by: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> --- .../Gem/PythonTests/editor/CMakeLists.txt | 32 +------ .../EditorScripts/Docking_BasicDockedTools.py | 5 +- .../EditorScripts/Menus_EditMenuOptions.py | 5 +- .../EditorScripts/Menus_FileMenuOptions.py | 2 +- .../EditorScripts/Menus_ViewMenuOptions.py | 2 + .../Gem/PythonTests/editor/TestSuite_Main.py | 83 +++++++++++++------ .../editor/TestSuite_Main_Optimized.py | 83 ------------------- .../PythonTests/editor/TestSuite_Periodic.py | 68 --------------- .../PythonTests/editor/TestSuite_Sandbox.py | 27 ------ .../editor/TestSuite_Sandbox_Optimized.py | 26 ------ 10 files changed, 67 insertions(+), 266 deletions(-) delete mode 100644 AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main_Optimized.py delete mode 100644 AutomatedTesting/Gem/PythonTests/editor/TestSuite_Periodic.py delete mode 100644 AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox.py delete mode 100644 AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox_Optimized.py diff --git a/AutomatedTesting/Gem/PythonTests/editor/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/editor/CMakeLists.txt index a43b3647f9..b3f0d2da8e 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/editor/CMakeLists.txt @@ -9,10 +9,10 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_FOUNDATION_TEST_SUPPORTED) ly_add_pytest( - NAME AutomatedTesting::EditorTests_Main_Optimized + NAME AutomatedTesting::EditorTests_Main TEST_SUITE main TEST_SERIAL - PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Main_Optimized.py + PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Main.py PYTEST_MARKS "not REQUIRES_gpu" RUNTIME_DEPENDENCIES Legacy::Editor @@ -27,7 +27,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_ TEST_SUITE main TEST_SERIAL TEST_REQUIRES gpu - PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Main_Optimized.py + PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Main.py PYTEST_MARKS "REQUIRES_gpu" RUNTIME_DEPENDENCIES Legacy::Editor @@ -37,30 +37,4 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_ Editor ) - ly_add_pytest( - NAME AutomatedTesting::EditorTests_Sandbox_Optimized - TEST_SUITE sandbox - TEST_SERIAL - PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Sandbox_Optimized.py - RUNTIME_DEPENDENCIES - Legacy::Editor - AZ::AssetProcessor - AutomatedTesting.Assets - COMPONENT - Editor - ) - - ly_add_pytest( - NAME AutomatedTesting::EditorTests_Periodic - TEST_SUITE periodic - TEST_SERIAL - PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Periodic.py - RUNTIME_DEPENDENCIES - Legacy::Editor - AZ::AssetProcessor - AutomatedTesting.Assets - COMPONENT - Editor - ) - endif() diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Docking_BasicDockedTools.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Docking_BasicDockedTools.py index 8734769225..a5a94f06a5 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Docking_BasicDockedTools.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Docking_BasicDockedTools.py @@ -85,8 +85,7 @@ def Docking_BasicDockedTools(): # We drag/drop it over the viewport since it doesn't allow docking, so this will undock it render_overlay = editor_window.findChild(QtWidgets.QWidget, "renderOverlay") pyside_utils.drag_and_drop(entity_outliner, render_overlay) - general.idle_wait(0.5) - + # We need to grab a new reference to the Entity Outliner QDockWidget because when it gets moved # to the floating window, its parent changes so the wrapped instance we had becomes invalid entity_outliner = editor_window.findChild(QtWidgets.QDockWidget, "Entity Outliner") @@ -94,7 +93,6 @@ def Docking_BasicDockedTools(): # Dock the Entity Inspector tabbed with the floating Entity Outliner entity_inspector = editor_window.findChild(QtWidgets.QDockWidget, "Entity Inspector") pyside_utils.drag_and_drop(entity_inspector, entity_outliner) - general.idle_wait(0.5) # We need to grab a new reference to the Entity Inspector QDockWidget because when it gets moved # to the floating window, its parent changes so the wrapped instance we had becomes invalid @@ -103,7 +101,6 @@ def Docking_BasicDockedTools(): # Dock the Console tabbed with the floating Entity Inspector console = editor_window.findChild(QtWidgets.QDockWidget, "Console") pyside_utils.drag_and_drop(console, entity_inspector) - general.idle_wait(0.5) # Check to ensure all the tools are parented to the same QStackedWidget def check_all_panes_tabbed(): diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_EditMenuOptions.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_EditMenuOptions.py index 0536575893..ce85cf223f 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_EditMenuOptions.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_EditMenuOptions.py @@ -52,8 +52,9 @@ def Menus_EditMenuOptions_Work(): ("Editor Settings", "Global Preferences"), ("Editor Settings", "Editor Settings Manager"), ("Editor Settings", "Keyboard Customization", "Customize Keyboard"), - ("Editor Settings", "Keyboard Customization", "Export Keyboard Settings"), - ("Editor Settings", "Keyboard Customization", "Import Keyboard Settings"), + # The following menu options are temporarily disabled due to https://github.com/o3de/o3de/issues/6746 + #("Editor Settings", "Keyboard Customization", "Export Keyboard Settings"), + #("Editor Settings", "Keyboard Customization", "Import Keyboard Settings"), ] # 1) Open an existing simple level diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py index a4e702cbd1..4fcdc371e7 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_FileMenuOptions.py @@ -33,7 +33,7 @@ def Menus_FileMenuOptions_Work(): file_menu_options = [ ("New Level",), #("Open Level",), Temporarily disabled due to https://github.com/o3de/o3de/issues/6605 - ("Import",), + #("Import",), Temporarily disabled due to https://github.com/o3de/o3de/issues/6746 ("Save",), #("Save As",), Temporarily disabled due to https://github.com/o3de/o3de/issues/6605 ("Save Level Statistics",), diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_ViewMenuOptions.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_ViewMenuOptions.py index e2ee3e2a55..bb9ff15082 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_ViewMenuOptions.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_ViewMenuOptions.py @@ -33,6 +33,8 @@ def Menus_ViewMenuOptions_Work(): view_menu_options = [ ("Center on Selection",), ("Show Quick Access Bar",), + ("Layouts", "Component Entity Layout",), + ("Layouts", "Save Layout",), ("Viewport", "Configure Layout"), ("Viewport", "Go to Position"), ("Viewport", "Center on Selection"), diff --git a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main.py b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main.py index 949aab140d..3805ef15dd 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main.py +++ b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main.py @@ -7,46 +7,77 @@ SPDX-License-Identifier: Apache-2.0 OR MIT import os import pytest -import sys import ly_test_tools.environment.file_system as file_system +from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, EditorParallelTest, EditorTestSuite -sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared') -from base import TestAutomationBase +@pytest.mark.SUITE_main +@pytest.mark.parametrize("launcher_platform", ['windows_editor']) +@pytest.mark.parametrize("project", ["AutomatedTesting"]) +class TestAutomationNoAutoTestMode(EditorTestSuite): + + # Disable -autotest_mode and -BatchMode. Tests cannot run in -BatchMode due to UI interactions, and these tests + # interact with modal dialogs + global_extra_cmdline_args = [] + + class test_AssetPicker_UI_UX(EditorSharedTest): + from .EditorScripts import AssetPicker_UI_UX as test_module -@pytest.fixture -def remove_test_level(request, workspace, project): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", "tmp_level")], True, True) + class test_BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD(EditorSharedTest): + from .EditorScripts import BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD as test_module + + class test_BasicEditorWorkflows_LevelEntityComponentCRUD(EditorSingleTest): + # Custom teardown to remove level created during test + def teardown(self, request, workspace, editor, editor_test_results, launcher_platform): + file_system.delete([os.path.join(workspace.paths.engine_root(), "AutomatedTesting", "Levels", "tmp_level")], + True, True) + from .EditorScripts import BasicEditorWorkflows_LevelEntityComponentCRUD as test_module + + @pytest.mark.REQUIRES_gpu + class test_BasicEditorWorkflows_GPU_LevelEntityComponentCRUD(EditorSingleTest): + # Disable null renderer + use_null_renderer = False - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", "tmp_level")], True, True) + # Custom teardown to remove level created during test + def teardown(self, request, workspace, editor, editor_test_results, launcher_platform): + file_system.delete([os.path.join(workspace.paths.engine_root(), "AutomatedTesting", "Levels", "tmp_level")], + True, True) + from .EditorScripts import BasicEditorWorkflows_LevelEntityComponentCRUD as test_module - request.addfinalizer(teardown) + class test_InputBindings_Add_Remove_Input_Events(EditorSharedTest): + from .EditorScripts import InputBindings_Add_Remove_Input_Events as test_module @pytest.mark.SUITE_main @pytest.mark.parametrize("launcher_platform", ['windows_editor']) @pytest.mark.parametrize("project", ["AutomatedTesting"]) -class TestAutomation(TestAutomationBase): +class TestAutomationAutoTestMode(EditorTestSuite): - def test_BasicEditorWorkflows_LevelEntityComponentCRUD(self, request, workspace, editor, launcher_platform, - remove_test_level): - from .EditorScripts import BasicEditorWorkflows_LevelEntityComponentCRUD as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False) + # Enable only -autotest_mode for these tests. Tests cannot run in -BatchMode due to UI interactions + global_extra_cmdline_args = ["-autotest_mode"] - @pytest.mark.REQUIRES_gpu - def test_BasicEditorWorkflows_GPU_LevelEntityComponentCRUD(self, request, workspace, editor, launcher_platform, - remove_test_level): - from .EditorScripts import BasicEditorWorkflows_LevelEntityComponentCRUD as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False, - use_null_renderer=False) + class test_AssetBrowser_SearchFiltering(EditorSharedTest): + from .EditorScripts import AssetBrowser_SearchFiltering as test_module - def test_BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD(self, request, workspace, editor, - launcher_platform): - from .EditorScripts import BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False) + class test_AssetBrowser_TreeNavigation(EditorSharedTest): + from .EditorScripts import AssetBrowser_TreeNavigation as test_module - def test_EntityOutliner_EntityOrdering(self, request, workspace, editor, launcher_platform): + class test_ComponentCRUD_Add_Delete_Components(EditorSharedTest): + from .EditorScripts import ComponentCRUD_Add_Delete_Components as test_module + + @pytest.mark.skip("Passes locally/fails on Jenkins. https://github.com/o3de/o3de/issues/6747") + class test_Docking_BasicDockedTools(EditorSharedTest): + from .EditorScripts import Docking_BasicDockedTools as test_module + + class test_EntityOutliner_EntityOrdering(EditorSharedTest): from .EditorScripts import EntityOutliner_EntityOrdering as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False) + + class test_Menus_EditMenuOptions_Work(EditorSharedTest): + from .EditorScripts import Menus_EditMenuOptions as test_module + + class test_Menus_FileMenuOptions_Work(EditorSharedTest): + from .EditorScripts import Menus_FileMenuOptions as test_module + + class test_Menus_ViewMenuOptions_Work(EditorSharedTest): + from .EditorScripts import Menus_ViewMenuOptions as test_module diff --git a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main_Optimized.py b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main_Optimized.py deleted file mode 100644 index 7e07d125fd..0000000000 --- a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Main_Optimized.py +++ /dev/null @@ -1,83 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -import os -import pytest - -import ly_test_tools.environment.file_system as file_system -from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, EditorParallelTest, EditorTestSuite - - -@pytest.mark.SUITE_main -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -@pytest.mark.parametrize("project", ["AutomatedTesting"]) -class TestAutomationNoAutoTestMode(EditorTestSuite): - - # Disable -autotest_mode and -BatchMode. Tests cannot run in -BatchMode due to UI interactions, and these tests - # interact with modal dialogs - global_extra_cmdline_args = [] - - class test_AssetPicker_UI_UX(EditorSharedTest): - from .EditorScripts import AssetPicker_UI_UX as test_module - - class test_BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD(EditorSharedTest): - from .EditorScripts import BasicEditorWorkflows_ExistingLevel_EntityComponentCRUD as test_module - - class test_BasicEditorWorkflows_LevelEntityComponentCRUD(EditorSingleTest): - # Custom teardown to remove level created during test - def teardown(self, request, workspace, editor, editor_test_results, launcher_platform): - file_system.delete([os.path.join(workspace.paths.engine_root(), "AutomatedTesting", "Levels", "tmp_level")], - True, True) - from .EditorScripts import BasicEditorWorkflows_LevelEntityComponentCRUD as test_module - - @pytest.mark.REQUIRES_gpu - class test_BasicEditorWorkflows_GPU_LevelEntityComponentCRUD(EditorSingleTest): - # Disable null renderer - use_null_renderer = False - - # Custom teardown to remove level created during test - def teardown(self, request, workspace, editor, editor_test_results, launcher_platform): - file_system.delete([os.path.join(workspace.paths.engine_root(), "AutomatedTesting", "Levels", "tmp_level")], - True, True) - from .EditorScripts import BasicEditorWorkflows_LevelEntityComponentCRUD as test_module - - class test_InputBindings_Add_Remove_Input_Events(EditorSharedTest): - from .EditorScripts import InputBindings_Add_Remove_Input_Events as test_module - - -@pytest.mark.SUITE_main -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -@pytest.mark.parametrize("project", ["AutomatedTesting"]) -class TestAutomationAutoTestMode(EditorTestSuite): - - # Enable only -autotest_mode for these tests. Tests cannot run in -BatchMode due to UI interactions - global_extra_cmdline_args = ["-autotest_mode"] - - class test_AssetBrowser_SearchFiltering(EditorSharedTest): - from .EditorScripts import AssetBrowser_SearchFiltering as test_module - - class test_AssetBrowser_TreeNavigation(EditorSharedTest): - from .EditorScripts import AssetBrowser_TreeNavigation as test_module - - class test_ComponentCRUD_Add_Delete_Components(EditorSharedTest): - from .EditorScripts import ComponentCRUD_Add_Delete_Components as test_module - - @pytest.mark.skip("Passes locally, fails on Jenkins") - class test_Docking_BasicDockedTools(EditorSharedTest): - from .EditorScripts import Docking_BasicDockedTools as test_module - - class test_EntityOutliner_EntityOrdering(EditorSharedTest): - from .EditorScripts import EntityOutliner_EntityOrdering as test_module - - class test_Menus_EditMenuOptions_Work(EditorSharedTest): - from .EditorScripts import Menus_EditMenuOptions as test_module - - class test_Menus_FileMenuOptions_Work(EditorSharedTest): - from .EditorScripts import Menus_FileMenuOptions as test_module - - class test_Menus_ViewMenuOptions_Work(EditorSharedTest): - from .EditorScripts import Menus_ViewMenuOptions as test_module \ No newline at end of file diff --git a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Periodic.py b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Periodic.py deleted file mode 100644 index 6e7bc413d3..0000000000 --- a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Periodic.py +++ /dev/null @@ -1,68 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -import os -import pytest -import sys - -import ly_test_tools.environment.file_system as file_system -import ly_test_tools.environment.process_utils as process_utils - -sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared') -from base import TestAutomationBase - - -@pytest.fixture -def remove_test_level(request, workspace, project): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", "tmp_level")], True, True) - - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", "tmp_level")], True, True) - - request.addfinalizer(teardown) - - -@pytest.mark.SUITE_periodic -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -@pytest.mark.parametrize("project", ["AutomatedTesting"]) -class TestAutomation(TestAutomationBase): - - def test_AssetBrowser_SearchFiltering(self, request, workspace, editor, launcher_platform): - from .EditorScripts import AssetBrowser_SearchFiltering as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False, use_null_renderer=False) - - def test_AssetBrowser_TreeNavigation(self, request, workspace, editor, launcher_platform): - from .EditorScripts import AssetBrowser_TreeNavigation as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False) - - def test_AssetPicker_UI_UX(self, request, workspace, editor, launcher_platform): - from .EditorScripts import AssetPicker_UI_UX as test_module - self._run_test(request, workspace, editor, test_module, autotest_mode=False, batch_mode=False) - - def test_ComponentCRUD_Add_Delete_Components(self, request, workspace, editor, launcher_platform): - from .EditorScripts import ComponentCRUD_Add_Delete_Components as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False) - - def test_Docking_BasicDockedTools(self, request, workspace, editor, launcher_platform): - from .EditorScripts import Docking_BasicDockedTools as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False) - - def test_InputBindings_Add_Remove_Input_Events(self, request, workspace, editor, launcher_platform): - from .EditorScripts import InputBindings_Add_Remove_Input_Events as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False, autotest_mode=False) - - def test_Menus_EditMenuOptions_Work(self, request, workspace, editor, launcher_platform): - from .EditorScripts import Menus_EditMenuOptions as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False) - - def test_Menus_FileMenuOptions_Work(self, request, workspace, editor, launcher_platform): - from .EditorScripts import Menus_FileMenuOptions as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False) - - def test_Menus_ViewMenuOptions_Work(self, request, workspace, editor, launcher_platform): - from .EditorScripts import Menus_ViewMenuOptions as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False) diff --git a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox.py b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox.py deleted file mode 100644 index 98a6620d9c..0000000000 --- a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox.py +++ /dev/null @@ -1,27 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -import os -import pytest -import sys - -sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared') -from base import TestAutomationBase - - -@pytest.mark.SUITE_sandbox -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -@pytest.mark.parametrize("project", ["AutomatedTesting"]) -class TestAutomation(TestAutomationBase): - - def test_Menus_EditMenuOptions_Work(self, request, workspace, editor, launcher_platform): - from .EditorScripts import Menus_EditMenuOptions as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False) - - def test_Docking_BasicDockedTools(self, request, workspace, editor, launcher_platform): - from .EditorScripts import Docking_BasicDockedTools as test_module - self._run_test(request, workspace, editor, test_module, batch_mode=False) diff --git a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox_Optimized.py b/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox_Optimized.py deleted file mode 100644 index 4a472095ae..0000000000 --- a/AutomatedTesting/Gem/PythonTests/editor/TestSuite_Sandbox_Optimized.py +++ /dev/null @@ -1,26 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -import os -import pytest - -from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, EditorParallelTest, EditorTestSuite - - -@pytest.mark.SUITE_sandbox -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -@pytest.mark.parametrize("project", ["AutomatedTesting"]) -class TestAutomationAutoTestMode(EditorTestSuite): - - # Enable only -autotest_mode for these tests. Tests cannot run in -BatchMode due to UI interactions - global_extra_cmdline_args = ["-autotest_mode"] - - class test_Docking_BasicDockedTools(EditorSharedTest): - from .EditorScripts import Docking_BasicDockedTools as test_module - - class test_Menus_EditMenuOptions_Work(EditorSharedTest): - from .EditorScripts import Menus_EditMenuOptions as test_module From 8b9e3d2175bb7766e0e9e81f0bba310cafd14a90 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Fri, 7 Jan 2022 09:53:14 -0800 Subject: [PATCH 384/948] Simplify disabling Value ctor for pointer types Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomValue.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index 23f4bd570f..ecf8326525 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -216,8 +216,9 @@ namespace AZ::Dom explicit Value(Type type); + // Disable accidental calls to Value(bool) with pointer types template - explicit Value(T, AZStd::enable_if_t>* enabled = 0) = delete; + explicit Value(T*) = delete; static Value FromOpaqueValue(const AZStd::any& value); From 7123ed18beed40fbf91f5b0fc8a2cbbe0b86d9a7 Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Fri, 7 Jan 2022 12:12:09 -0600 Subject: [PATCH 385/948] Naive GetValues() implementation. (#6741) * Naive GetValues() implementation. Added the method itself, and the benchmarks which show that even the naive version is currently 10-50% faster than calling GetValue() for multiple values. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Added comments documenting why the const_cast is there. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Fixed link errors by creating new Shared.Tests lib. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Addressed PR feedback. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Fixed incorrect comparison. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- Gems/GradientSignal/Code/CMakeLists.txt | 22 +++ .../Ebuses/GradientRequestBus.h | 32 ++++ .../Include/GradientSignal/GradientSampler.h | 90 ++++++++++ .../Code/Tests/GradientSignalBenchmarks.cpp | 169 +++++++++++++----- .../Code/Tests/GradientSignalTestFixtures.cpp | 156 +++++++++++++++- .../Code/Tests/GradientSignalTestFixtures.h | 10 +- .../Code/Tests/GradientSignalTestMocks.cpp | 40 +++-- .../Code/Tests/GradientSignalTestMocks.h | 6 +- .../gradientsignal_editor_tests_files.cmake | 1 - .../gradientsignal_shared_tests_files.cmake | 14 ++ .../Code/gradientsignal_tests_files.cmake | 4 - 11 files changed, 466 insertions(+), 78 deletions(-) create mode 100644 Gems/GradientSignal/Code/gradientsignal_shared_tests_files.cmake diff --git a/Gems/GradientSignal/Code/CMakeLists.txt b/Gems/GradientSignal/Code/CMakeLists.txt index d1ac8cdacf..657a88db47 100644 --- a/Gems/GradientSignal/Code/CMakeLists.txt +++ b/Gems/GradientSignal/Code/CMakeLists.txt @@ -124,6 +124,26 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) Mocks ) + ly_add_target( + NAME GradientSignal.Tests.Static STATIC + NAMESPACE Gem + FILES_CMAKE + gradientsignal_shared_tests_files.cmake + INCLUDE_DIRECTORIES + PUBLIC + Tests + PRIVATE + . + Source + BUILD_DEPENDENCIES + PRIVATE + AZ::AzTest + AZ::AzTestShared + Gem::GradientSignal.Static + Gem::LmbrCentral + Gem::GradientSignal.Mocks + ) + ly_add_target( NAME GradientSignal.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} NAMESPACE Gem @@ -137,6 +157,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) PRIVATE AZ::AzTest AZ::AzTestShared + Gem::GradientSignal.Tests.Static Gem::GradientSignal.Static Gem::LmbrCentral Gem::GradientSignal.Mocks @@ -165,6 +186,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) PRIVATE AZ::AzTest AZ::AzTestShared + Gem::GradientSignal.Tests.Static Gem::GradientSignal.Static Gem::GradientSignal.Editor.Static Gem::LmbrCentral.Editor diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientRequestBus.h b/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientRequestBus.h index 1782972acf..d0fcabf746 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientRequestBus.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientRequestBus.h @@ -11,6 +11,8 @@ #include #include +#include + namespace GradientSignal { struct GradientSampleParams final @@ -49,6 +51,36 @@ namespace GradientSignal */ virtual float GetValue(const GradientSampleParams& sampleParams) const = 0; + /** + * Given a list of positions, generate values. Implementations of this need to be thread-safe without using locks, + * as it can get called from multiple threads simultaneously and has the potential to cause lock inversion deadlocks. + * \param positions The input list of positions to query. + * \param outValues The output list of values. This list is expected to be the same size as the positions list. + */ + virtual void GetValues(AZStd::array_view positions, AZStd::array_view outValues) const + { + // Reference implementation of GetValues for any gradients that don't have their own optimized implementations. + // This is 10%-60% faster than calling GetValue via EBus many times due to the per-call EBus overhead. + + AZ_Assert( + positions.size() == outValues.size(), "input and output lists are different sizes (%zu vs %zu).", + positions.size(), outValues.size()); + + if (positions.size() == outValues.size()) + { + GradientSampleParams sampleParams; + for (size_t index = 0; index < positions.size(); index++) + { + sampleParams.m_position = positions[index]; + + // The const_cast is necessary for now since array_view currently only supports const entries. + // If/when array_view is fixed to support non-const, or AZStd::span gets created, the const_cast can get removed. + auto& outValue = const_cast(outValues[index]); + outValue = GetValue(sampleParams); + } + } + } + /** * Call to check the hierarchy to see if a given entityId exists in the gradient signal chain */ diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h b/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h index 1dd7d44376..454be938a5 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h @@ -33,6 +33,7 @@ namespace GradientSignal static void Reflect(AZ::ReflectContext* context); inline float GetValue(const GradientSampleParams& sampleParams) const; + inline void GetValues(AZStd::array_view positions, AZStd::array_view outValues) const; bool IsEntityInHierarchy(const AZ::EntityId& entityId) const; @@ -145,4 +146,93 @@ namespace GradientSignal return output * m_opacity; } + + inline void GradientSampler::GetValues(AZStd::array_view positions, AZStd::array_view outValues) const + { + auto ClearOutputValues = [](AZStd::array_view outValues) + { + // If we don't have a valid gradient (or it is fully transparent), clear out all the output values. + for (size_t index = 0; index < outValues.size(); index++) + { + // The const_cast is necessary for now since array_view currently only supports const entries. + // If/when array_view is fixed to support non-const, or AZStd::span gets created, the const_cast can get removed. + auto& outValue = const_cast(outValues[index]); + outValue = 0.0f; + } + }; + + if (m_opacity <= 0.0f || !m_gradientId.IsValid()) + { + ClearOutputValues(outValues); + return; + } + + AZStd::vector transformedPositions; + bool useTransformedPositions = false; + + // apply transform if set + if (m_enableTransform && GradientSamplerUtil::AreTransformParamsSet(*this)) + { + AZ::Matrix3x4 matrix3x4; + matrix3x4.SetFromEulerDegrees(m_rotate); + matrix3x4.MultiplyByScale(m_scale); + matrix3x4.SetTranslation(m_translate); + + useTransformedPositions = true; + transformedPositions.resize(positions.size()); + for (size_t index = 0; index < positions.size(); index++) + { + transformedPositions[index] = matrix3x4 * positions[index]; + } + } + + { + // Block other threads from accessing the surface data bus while we are in GetValue (which may call into the SurfaceData bus). + // We lock our surface data mutex *before* checking / setting "isRequestInProgress" so that we prevent race conditions + // that create false detection of cyclic dependencies when multiple requests occur on different threads simultaneously. + // (One case where this was previously able to occur was in rapid updating of the Preview widget on the + // GradientSurfaceDataComponent in the Editor when moving the threshold sliders back and forth rapidly) + auto& surfaceDataContext = SurfaceData::SurfaceDataSystemRequestBus::GetOrCreateContext(false); + typename SurfaceData::SurfaceDataSystemRequestBus::Context::DispatchLockGuard scopeLock(surfaceDataContext.m_contextMutex); + + if (m_isRequestInProgress) + { + AZ_ErrorOnce("GradientSignal", !m_isRequestInProgress, "Detected cyclic dependences with gradient entity references"); + ClearOutputValues(outValues); + return; + } + else + { + m_isRequestInProgress = true; + + GradientRequestBus::Event( + m_gradientId, &GradientRequestBus::Events::GetValues, useTransformedPositions ? transformedPositions : positions, + outValues); + + m_isRequestInProgress = false; + } + } + + // Perform any post-fetch transformations on the gradient values (invert, levels, opacity). + for (size_t index = 0; index < outValues.size(); index++) + { + // The const_cast is necessary for now since array_view currently only supports const entries. + // If/when array_view is fixed to support non-const, or AZStd::span gets created, the const_cast can get removed. + auto& outValue = const_cast(outValues[index]); + + if (m_invertInput) + { + outValue = 1.0f - outValue; + } + + // apply levels if set + if (m_enableLevels && GradientSamplerUtil::AreLevelParamsSet(*this)) + { + outValue = GetLevels(outValue, m_inputMid, m_inputMin, m_inputMax, m_outputMin, m_outputMax); + } + + outValue = outValue * m_opacity; + } + } + } diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalBenchmarks.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalBenchmarks.cpp index dd179bd253..6383b627c1 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalBenchmarks.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalBenchmarks.cpp @@ -23,74 +23,145 @@ namespace UnitTest { - BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_ImageGradientGetValue)(benchmark::State& state) + BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_ImageGradientEBusGetValue)(benchmark::State& state) { - // Create the Image Gradient Component with some default sizes and parameters. - GradientSignal::ImageGradientConfig config; - const uint32_t imageSize = 4096; - const int32_t imageSeed = 12345; - config.m_imageAsset = ImageAssetMockAssetHandler::CreateImageAsset(imageSize, imageSize, imageSeed); - config.m_tilingX = 1.0f; - config.m_tilingY = 1.0f; - CreateComponent(m_testEntity.get(), config); - - // Create the Gradient Transform Component with some default parameters. - GradientSignal::GradientTransformConfig gradientTransformConfig; - gradientTransformConfig.m_wrappingType = GradientSignal::WrappingType::None; - CreateComponent(m_testEntity.get(), gradientTransformConfig); - - // Run the benchmark - RunGetValueBenchmark(state); + CreateTestImageGradient(m_testEntity.get()); + RunEBusGetValueBenchmark(state); } - BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_ImageGradientGetValue) + BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_ImageGradientEBusGetValue) ->Args({ 1024, 1024 }) ->Args({ 2048, 2048 }) ->Args({ 4096, 4096 }) ->Unit(::benchmark::kMillisecond); - BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_PerlinGradientGetValue)(benchmark::State& state) + BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_ImageGradientEBusGetValues)(benchmark::State& state) { - // Create the Perlin Gradient Component with some default sizes and parameters. - GradientSignal::PerlinGradientConfig config; - config.m_amplitude = 1.0f; - config.m_frequency = 1.1f; - config.m_octave = 4; - config.m_randomSeed = 12345; - CreateComponent(m_testEntity.get(), config); - - // Create the Gradient Transform Component with some default parameters. - GradientSignal::GradientTransformConfig gradientTransformConfig; - gradientTransformConfig.m_wrappingType = GradientSignal::WrappingType::None; - CreateComponent(m_testEntity.get(), gradientTransformConfig); - - // Run the benchmark - RunGetValueBenchmark(state); + CreateTestImageGradient(m_testEntity.get()); + RunEBusGetValuesBenchmark(state); } - BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_PerlinGradientGetValue) + BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_ImageGradientEBusGetValues) ->Args({ 1024, 1024 }) ->Args({ 2048, 2048 }) ->Args({ 4096, 4096 }) ->Unit(::benchmark::kMillisecond); - BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_RandomGradientGetValue)(benchmark::State& state) + BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_ImageGradientSamplerGetValue)(benchmark::State& state) { - // Create the Random Gradient Component with some default parameters. - GradientSignal::RandomGradientConfig config; - config.m_randomSeed = 12345; - CreateComponent(m_testEntity.get(), config); - - // Create the Gradient Transform Component with some default parameters. - GradientSignal::GradientTransformConfig gradientTransformConfig; - gradientTransformConfig.m_wrappingType = GradientSignal::WrappingType::None; - CreateComponent(m_testEntity.get(), gradientTransformConfig); - - // Run the benchmark - RunGetValueBenchmark(state); + CreateTestImageGradient(m_testEntity.get()); + RunSamplerGetValueBenchmark(state); } - BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_RandomGradientGetValue) + BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_ImageGradientSamplerGetValue) + ->Args({ 1024, 1024 }) + ->Args({ 2048, 2048 }) + ->Args({ 4096, 4096 }) + ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_ImageGradientSamplerGetValues)(benchmark::State& state) + { + CreateTestImageGradient(m_testEntity.get()); + RunSamplerGetValuesBenchmark(state); + } + + BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_ImageGradientSamplerGetValues) + ->Args({ 1024, 1024 }) + ->Args({ 2048, 2048 }) + ->Args({ 4096, 4096 }) + ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_PerlinGradientEBusGetValue)(benchmark::State& state) + { + CreateTestPerlinGradient(m_testEntity.get()); + RunEBusGetValueBenchmark(state); + } + + BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_PerlinGradientEBusGetValue) + ->Args({ 1024, 1024 }) + ->Args({ 2048, 2048 }) + ->Args({ 4096, 4096 }) + ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_PerlinGradientEBusGetValues)(benchmark::State& state) + { + CreateTestPerlinGradient(m_testEntity.get()); + RunEBusGetValuesBenchmark(state); + } + + BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_PerlinGradientEBusGetValues) + ->Args({ 1024, 1024 }) + ->Args({ 2048, 2048 }) + ->Args({ 4096, 4096 }) + ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_PerlinGradientSamplerGetValue)(benchmark::State& state) + { + CreateTestPerlinGradient(m_testEntity.get()); + RunSamplerGetValueBenchmark(state); + } + + BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_PerlinGradientSamplerGetValue) + ->Args({ 1024, 1024 }) + ->Args({ 2048, 2048 }) + ->Args({ 4096, 4096 }) + ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_PerlinGradientSamplerGetValues)(benchmark::State& state) + { + CreateTestPerlinGradient(m_testEntity.get()); + RunSamplerGetValuesBenchmark(state); + } + + BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_PerlinGradientSamplerGetValues) + ->Args({ 1024, 1024 }) + ->Args({ 2048, 2048 }) + ->Args({ 4096, 4096 }) + ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_RandomGradientEBusGetValue)(benchmark::State& state) + { + CreateTestRandomGradient(m_testEntity.get()); + RunEBusGetValueBenchmark(state); + } + + BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_RandomGradientEBusGetValue) + ->Args({ 1024, 1024 }) + ->Args({ 2048, 2048 }) + ->Args({ 4096, 4096 }) + ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_RandomGradientEBusGetValues)(benchmark::State& state) + { + CreateTestRandomGradient(m_testEntity.get()); + RunEBusGetValuesBenchmark(state); + } + + BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_RandomGradientEBusGetValues) + ->Args({ 1024, 1024 }) + ->Args({ 2048, 2048 }) + ->Args({ 4096, 4096 }) + ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_RandomGradientSamplerGetValue)(benchmark::State& state) + { + CreateTestRandomGradient(m_testEntity.get()); + RunSamplerGetValueBenchmark(state); + } + + BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_RandomGradientSamplerGetValue) + ->Args({ 1024, 1024 }) + ->Args({ 2048, 2048 }) + ->Args({ 4096, 4096 }) + ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_RandomGradientSamplerGetValues)(benchmark::State& state) + { + CreateTestRandomGradient(m_testEntity.get()); + RunSamplerGetValuesBenchmark(state); + } + + BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_RandomGradientSamplerGetValues) ->Args({ 1024, 1024 }) ->Args({ 2048, 2048 }) ->Args({ 4096, 4096 }) diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.cpp index bc9b39aae8..77568d3321 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.cpp @@ -9,6 +9,11 @@ #include +#include +#include +#include +#include + namespace UnitTest { void GradientSignalBaseFixture::SetupCoreSystems() @@ -86,8 +91,56 @@ namespace UnitTest m_testEntity.reset(); } - void GradientSignalBenchmarkFixture::RunGetValueBenchmark(benchmark::State& state) + void GradientSignalBenchmarkFixture::CreateTestImageGradient(AZ::Entity* entity) + { + // Create the Image Gradient Component with some default sizes and parameters. + GradientSignal::ImageGradientConfig config; + const uint32_t imageSize = 4096; + const int32_t imageSeed = 12345; + config.m_imageAsset = ImageAssetMockAssetHandler::CreateImageAsset(imageSize, imageSize, imageSeed); + config.m_tilingX = 1.0f; + config.m_tilingY = 1.0f; + CreateComponent(entity, config); + + // Create the Gradient Transform Component with some default parameters. + GradientSignal::GradientTransformConfig gradientTransformConfig; + gradientTransformConfig.m_wrappingType = GradientSignal::WrappingType::None; + CreateComponent(entity, gradientTransformConfig); + } + + void GradientSignalBenchmarkFixture::CreateTestPerlinGradient(AZ::Entity* entity) + { + // Create the Perlin Gradient Component with some default sizes and parameters. + GradientSignal::PerlinGradientConfig config; + config.m_amplitude = 1.0f; + config.m_frequency = 1.1f; + config.m_octave = 4; + config.m_randomSeed = 12345; + CreateComponent(entity, config); + + // Create the Gradient Transform Component with some default parameters. + GradientSignal::GradientTransformConfig gradientTransformConfig; + gradientTransformConfig.m_wrappingType = GradientSignal::WrappingType::None; + CreateComponent(entity, gradientTransformConfig); + } + + void GradientSignalBenchmarkFixture::CreateTestRandomGradient(AZ::Entity* entity) + { + // Create the Random Gradient Component with some default parameters. + GradientSignal::RandomGradientConfig config; + config.m_randomSeed = 12345; + CreateComponent(entity, config); + + // Create the Gradient Transform Component with some default parameters. + GradientSignal::GradientTransformConfig gradientTransformConfig; + gradientTransformConfig.m_wrappingType = GradientSignal::WrappingType::None; + CreateComponent(entity, gradientTransformConfig); + } + + void GradientSignalBenchmarkFixture::RunSamplerGetValueBenchmark(benchmark::State& state) { + AZ_PROFILE_FUNCTION(Entity); + // All components are created, so activate the entity ActivateEntity(m_testEntity.get()); @@ -115,6 +168,107 @@ namespace UnitTest } } + void GradientSignalBenchmarkFixture::RunSamplerGetValuesBenchmark(benchmark::State& state) + { + AZ_PROFILE_FUNCTION(Entity); + + // All components are created, so activate the entity + ActivateEntity(m_testEntity.get()); + + // Create a gradient sampler and run through a series of points to see if they match expectations. + GradientSignal::GradientSampler gradientSampler; + gradientSampler.m_gradientId = m_testEntity->GetId(); + + // Get the height and width ranges for querying from our benchmark parameters + float height = aznumeric_cast(state.range(0)); + float width = aznumeric_cast(state.range(1)); + int64_t totalQueryPoints = state.range(0) * state.range(1); + + // Call GetValues() for every height and width in our ranges. + for (auto _ : state) + { + // Set up our vector of query positions. + AZStd::vector positions(totalQueryPoints); + size_t index = 0; + for (float y = 0.0f; y < height; y += 1.0f) + { + for (float x = 0.0f; x < width; x += 1.0f) + { + positions[index++] = AZ::Vector3(x, y, 0.0f); + } + } + + // Query and get the results. + AZStd::vector results(totalQueryPoints); + gradientSampler.GetValues(positions, results); + } + } + + void GradientSignalBenchmarkFixture::RunEBusGetValueBenchmark(benchmark::State& state) + { + AZ_PROFILE_FUNCTION(Entity); + + // All components are created, so activate the entity + ActivateEntity(m_testEntity.get()); + + GradientSignal::GradientSampleParams params; + + // Get the height and width ranges for querying from our benchmark parameters + float height = aznumeric_cast(state.range(0)); + float width = aznumeric_cast(state.range(1)); + + // Call GetValue() for every height and width in our ranges. + for (auto _ : state) + { + for (float y = 0.0f; y < height; y += 1.0f) + { + for (float x = 0.0f; x < width; x += 1.0f) + { + float value = 0.0f; + params.m_position = AZ::Vector3(x, y, 0.0f); + GradientSignal::GradientRequestBus::EventResult( + value, m_testEntity->GetId(), &GradientSignal::GradientRequestBus::Events::GetValue, params); + benchmark::DoNotOptimize(value); + } + } + } + } + + void GradientSignalBenchmarkFixture::RunEBusGetValuesBenchmark(benchmark::State& state) + { + AZ_PROFILE_FUNCTION(Entity); + + // All components are created, so activate the entity + ActivateEntity(m_testEntity.get()); + + GradientSignal::GradientSampler gradientSampler; + gradientSampler.m_gradientId = m_testEntity->GetId(); + + // Get the height and width ranges for querying from our benchmark parameters + float height = aznumeric_cast(state.range(0)); + float width = aznumeric_cast(state.range(1)); + int64_t totalQueryPoints = state.range(0) * state.range(1); + + // Call GetValues() for every height and width in our ranges. + for (auto _ : state) + { + // Set up our vector of query positions. + AZStd::vector positions(totalQueryPoints); + size_t index = 0; + for (float y = 0.0f; y < height; y += 1.0f) + { + for (float x = 0.0f; x < width; x += 1.0f) + { + positions[index++] = AZ::Vector3(x, y, 0.0f); + } + } + + // Query and get the results. + AZStd::vector results(totalQueryPoints); + GradientSignal::GradientRequestBus::Event( + m_testEntity->GetId(), &GradientSignal::GradientRequestBus::Events::GetValues, positions, results); + } + } #endif } diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.h b/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.h index 5e05cba374..13ff69c82d 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.h +++ b/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.h @@ -97,7 +97,15 @@ namespace UnitTest void CreateTestEntity(float shapeHalfBounds); void DestroyTestEntity(); - void RunGetValueBenchmark(benchmark::State& state); + void CreateTestImageGradient(AZ::Entity* entity); + void CreateTestPerlinGradient(AZ::Entity* entity); + void CreateTestRandomGradient(AZ::Entity* entity); + + void RunSamplerGetValueBenchmark(benchmark::State& state); + void RunSamplerGetValuesBenchmark(benchmark::State& state); + + void RunEBusGetValueBenchmark(benchmark::State& state); + void RunEBusGetValuesBenchmark(benchmark::State& state); protected: void SetUp(const benchmark::State& state) override diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalTestMocks.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalTestMocks.cpp index ccbe17dee8..7ac6ef1ecc 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalTestMocks.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalTestMocks.cpp @@ -13,13 +13,14 @@ namespace UnitTest { AZ::Data::Asset ImageAssetMockAssetHandler::CreateImageAsset(AZ::u32 width, AZ::u32 height, AZ::s32 seed) { - GradientSignal::ImageAsset* imageData = - aznew GradientSignal::ImageAsset(AZ::Data::AssetId(AZ::Uuid::CreateRandom()), AZ::Data::AssetData::AssetStatus::Ready); - imageData->m_imageWidth = width; - imageData->m_imageHeight = height; - imageData->m_bytesPerPixel = 1; - imageData->m_imageFormat = ImageProcessingAtom::EPixelFormat::ePixelFormat_R8; - imageData->m_imageData.reserve(width * height); + auto imageAsset = AZ::Data::AssetManager::Instance().CreateAsset( + AZ::Data::AssetId(AZ::Uuid::CreateRandom()), AZ::Data::AssetLoadBehavior::Default); + + imageAsset->m_imageWidth = width; + imageAsset->m_imageHeight = height; + imageAsset->m_bytesPerPixel = 1; + imageAsset->m_imageFormat = ImageProcessingAtom::EPixelFormat::ePixelFormat_R8; + imageAsset->m_imageData.reserve(width * height); size_t value = 0; AZStd::hash_combine(value, seed); @@ -30,23 +31,24 @@ namespace UnitTest { AZStd::hash_combine(value, x); AZStd::hash_combine(value, y); - imageData->m_imageData.push_back(static_cast(value)); + imageAsset->m_imageData.push_back(static_cast(value)); } } - return AZ::Data::Asset(imageData, AZ::Data::AssetLoadBehavior::Default); + return imageAsset; } AZ::Data::Asset ImageAssetMockAssetHandler::CreateSpecificPixelImageAsset( AZ::u32 width, AZ::u32 height, AZ::u32 pixelX, AZ::u32 pixelY) { - GradientSignal::ImageAsset* imageData = - aznew GradientSignal::ImageAsset(AZ::Data::AssetId(AZ::Uuid::CreateRandom()), AZ::Data::AssetData::AssetStatus::Ready); - imageData->m_imageWidth = width; - imageData->m_imageHeight = height; - imageData->m_bytesPerPixel = 1; - imageData->m_imageFormat = ImageProcessingAtom::EPixelFormat::ePixelFormat_R8; - imageData->m_imageData.reserve(width * height); + auto imageAsset = AZ::Data::AssetManager::Instance().CreateAsset( + AZ::Data::AssetId(AZ::Uuid::CreateRandom()), AZ::Data::AssetLoadBehavior::Default); + + imageAsset->m_imageWidth = width; + imageAsset->m_imageHeight = height; + imageAsset->m_bytesPerPixel = 1; + imageAsset->m_imageFormat = ImageProcessingAtom::EPixelFormat::ePixelFormat_R8; + imageAsset->m_imageData.reserve(width * height); const AZ::u8 pixelValue = 255; @@ -57,16 +59,16 @@ namespace UnitTest { if ((x == static_cast(pixelX)) && (y == static_cast(pixelY))) { - imageData->m_imageData.push_back(pixelValue); + imageAsset->m_imageData.push_back(pixelValue); } else { - imageData->m_imageData.push_back(0); + imageAsset->m_imageData.push_back(0); } } } - return AZ::Data::Asset(imageData, AZ::Data::AssetLoadBehavior::Default); + return imageAsset; } } diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalTestMocks.h b/Gems/GradientSignal/Code/Tests/GradientSignalTestMocks.h index 1d83a5eb55..30f262d9b4 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalTestMocks.h +++ b/Gems/GradientSignal/Code/Tests/GradientSignalTestMocks.h @@ -47,10 +47,10 @@ namespace UnitTest static AZ::Data::Asset CreateSpecificPixelImageAsset( AZ::u32 width, AZ::u32 height, AZ::u32 pixelX, AZ::u32 pixelY); - AZ::Data::AssetPtr CreateAsset( - [[maybe_unused]] const AZ::Data::AssetId& id, [[maybe_unused]] const AZ::Data::AssetType& type) override + AZ::Data::AssetPtr CreateAsset(const AZ::Data::AssetId& id, [[maybe_unused]] const AZ::Data::AssetType& type) override { - return AZ::Data::AssetPtr(); + // For our mock handler, always mark our assets as immediately ready. + return aznew GradientSignal::ImageAsset(id, AZ::Data::AssetData::AssetStatus::Ready); } void DestroyAsset(AZ::Data::AssetPtr ptr) override diff --git a/Gems/GradientSignal/Code/gradientsignal_editor_tests_files.cmake b/Gems/GradientSignal/Code/gradientsignal_editor_tests_files.cmake index 8172591afa..5a3a75602b 100644 --- a/Gems/GradientSignal/Code/gradientsignal_editor_tests_files.cmake +++ b/Gems/GradientSignal/Code/gradientsignal_editor_tests_files.cmake @@ -7,6 +7,5 @@ # set(FILES - Tests/GradientSignalTestFixtures.cpp Tests/EditorGradientSignalPreviewTests.cpp ) diff --git a/Gems/GradientSignal/Code/gradientsignal_shared_tests_files.cmake b/Gems/GradientSignal/Code/gradientsignal_shared_tests_files.cmake new file mode 100644 index 0000000000..7d867b0a33 --- /dev/null +++ b/Gems/GradientSignal/Code/gradientsignal_shared_tests_files.cmake @@ -0,0 +1,14 @@ +# +# Copyright (c) Contributors to the Open 3D Engine Project. +# For complete copyright and license terms please see the LICENSE at the root of this distribution. +# +# SPDX-License-Identifier: Apache-2.0 OR MIT +# +# + +set(FILES + Tests/GradientSignalTestFixtures.cpp + Tests/GradientSignalTestFixtures.h + Tests/GradientSignalTestMocks.cpp + Tests/GradientSignalTestMocks.h +) diff --git a/Gems/GradientSignal/Code/gradientsignal_tests_files.cmake b/Gems/GradientSignal/Code/gradientsignal_tests_files.cmake index 8e081e5711..eb799811b7 100644 --- a/Gems/GradientSignal/Code/gradientsignal_tests_files.cmake +++ b/Gems/GradientSignal/Code/gradientsignal_tests_files.cmake @@ -13,10 +13,6 @@ set(FILES Tests/GradientSignalServicesTests.cpp Tests/GradientSignalSurfaceTests.cpp Tests/GradientSignalTransformTests.cpp - Tests/GradientSignalTestFixtures.cpp - Tests/GradientSignalTestFixtures.h - Tests/GradientSignalTestMocks.cpp - Tests/GradientSignalTestMocks.h Tests/GradientSignalTest.cpp Tests/ImageAssetTests.cpp ) From 67a89c6cd0c1dc4c581b64ff9a147ea6406fa99d Mon Sep 17 00:00:00 2001 From: Junbo Liang <68558268+junbo75@users.noreply.github.com> Date: Fri, 7 Jan 2022 10:51:08 -0800 Subject: [PATCH 386/948] Fix an issue where npm is not found (#6706) Signed-off-by: Junbo Liang <68558268+junbo75@users.noreply.github.com> --- scripts/build/Platform/Linux/deploy_cdk_applications.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/scripts/build/Platform/Linux/deploy_cdk_applications.sh b/scripts/build/Platform/Linux/deploy_cdk_applications.sh index 97668ee70c..9a0a31397e 100755 --- a/scripts/build/Platform/Linux/deploy_cdk_applications.sh +++ b/scripts/build/Platform/Linux/deploy_cdk_applications.sh @@ -7,9 +7,6 @@ # # Deploy the CDK applications for AWS gems (Linux only) -# Prerequisites: -# 1) Node.js is installed -# 2) Node.js version >= 10.13.0, except for versions 13.0.0 - 13.6.0. A version in active long-term support is recommended. SOURCE_DIRECTORY=$(dirname "$0") PATH=$SOURCE_DIRECTORY/python:$PATH @@ -70,12 +67,12 @@ echo [cdk_installation] Install the current version of nodejs nvm install node echo [cdk_installation] Install the latest version of CDK -if ! sudo npm uninstall -g aws-cdk; +if ! npm uninstall -g aws-cdk; then echo [cdk_bootstrap] Failed to uninstall the current version of CDK exit 1 fi -if ! sudo npm install -g aws-cdk@latest; +if ! npm install -g aws-cdk@latest; then echo [cdk_bootstrap] Failed to install the latest version of CDK exit 1 From 641f7be041b0671a12340ae678608cbb757ff7ec Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Fri, 7 Jan 2022 14:24:53 -0600 Subject: [PATCH 387/948] Removed more unused Editor code and images Signed-off-by: Chris Galvan --- Code/Editor/EditorViewportWidget.cpp | 3 - Code/Editor/IEditor.h | 1 - Code/Editor/Include/IConsoleConnectivity.h | 85 ------------------- Code/Editor/Include/IFacialEditor.h | 43 ---------- Code/Editor/Include/IRenderListener.h | 29 ------- Code/Editor/Include/ITextureDatabaseUpdater.h | 38 --------- Code/Editor/MainWindow.qrc | 1 - Code/Editor/Resource.h | 2 - Code/Editor/TimeOfDay/main-00.png | 3 - Code/Editor/TimeOfDay/main-01.png | 3 - Code/Editor/TimeOfDay/main-02.png | 3 - Code/Editor/TimeOfDay/main-03.png | 3 - Code/Editor/TimeOfDay/main-04.png | 3 - Code/Editor/TimeOfDay/main-05.png | 3 - Code/Editor/TimeOfDay/main-06.png | 3 - Code/Editor/TimeOfDay/main-07.png | 3 - Code/Editor/TimeOfDay/main-08.png | 3 - Code/Editor/TimeOfDay/main-09.png | 3 - Code/Editor/TimeOfDay/main-10.png | 3 - Code/Editor/TimeOfDay/main-11.png | 3 - Code/Editor/TimeOfDay/main-12.png | 3 - Code/Editor/Viewport.cpp | 68 --------------- Code/Editor/Viewport.h | 13 --- Code/Editor/editor_lib_files.cmake | 3 - Code/Editor/water.png | 3 - 25 files changed, 328 deletions(-) delete mode 100644 Code/Editor/Include/IConsoleConnectivity.h delete mode 100644 Code/Editor/Include/IFacialEditor.h delete mode 100644 Code/Editor/Include/IRenderListener.h delete mode 100644 Code/Editor/Include/ITextureDatabaseUpdater.h delete mode 100644 Code/Editor/TimeOfDay/main-00.png delete mode 100644 Code/Editor/TimeOfDay/main-01.png delete mode 100644 Code/Editor/TimeOfDay/main-02.png delete mode 100644 Code/Editor/TimeOfDay/main-03.png delete mode 100644 Code/Editor/TimeOfDay/main-04.png delete mode 100644 Code/Editor/TimeOfDay/main-05.png delete mode 100644 Code/Editor/TimeOfDay/main-06.png delete mode 100644 Code/Editor/TimeOfDay/main-07.png delete mode 100644 Code/Editor/TimeOfDay/main-08.png delete mode 100644 Code/Editor/TimeOfDay/main-09.png delete mode 100644 Code/Editor/TimeOfDay/main-10.png delete mode 100644 Code/Editor/TimeOfDay/main-11.png delete mode 100644 Code/Editor/TimeOfDay/main-12.png delete mode 100644 Code/Editor/water.png diff --git a/Code/Editor/EditorViewportWidget.cpp b/Code/Editor/EditorViewportWidget.cpp index 754ea84544..828812fb7e 100644 --- a/Code/Editor/EditorViewportWidget.cpp +++ b/Code/Editor/EditorViewportWidget.cpp @@ -454,9 +454,6 @@ void EditorViewportWidget::Update() // Render { - // TODO: Move out this logic to a controller and refactor to work with Atom - ProcessRenderLisneters(m_displayContext); - m_displayContext.Flush2D(); // Post Render Callback diff --git a/Code/Editor/IEditor.h b/Code/Editor/IEditor.h index c91ca62c5e..90f1b63f55 100644 --- a/Code/Editor/IEditor.h +++ b/Code/Editor/IEditor.h @@ -52,7 +52,6 @@ class CUIEnumsDatabase; struct ISourceControl; struct IEditorClassFactory; struct ITransformManipulator; -class IFacialEditor; class CDialog; #if defined(AZ_PLATFORM_WINDOWS) class C3DConnexionDriver; diff --git a/Code/Editor/Include/IConsoleConnectivity.h b/Code/Editor/Include/IConsoleConnectivity.h deleted file mode 100644 index 0f5e9bf35c..0000000000 --- a/Code/Editor/Include/IConsoleConnectivity.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -// Description : Standard interface for console connectivity plugins. - - -#ifndef CRYINCLUDE_EDITOR_INCLUDE_ICONSOLECONNECTIVITY_H -#define CRYINCLUDE_EDITOR_INCLUDE_ICONSOLECONNECTIVITY_H -#pragma once - - -////////////////////////////////////////////////////////////////////////// -// Description -// This interface provide access to the console connectivity -// functionality. -////////////////////////////////////////////////////////////////////////// -struct IConsoleConnectivity - : public IUnknown -{ - DEFINE_UUID(0x4DAA85E1, 0x8498, 0x402f, 0x9B, 0x85, 0x7F, 0x62, 0x9D, 0x76, 0x79, 0x8A); - - ////////////////////////////////////////////////////////////////////////// - //TODO: Must add the useful interface here. - ////////////////////////////////////////////////////////////////////////// - - // Description: - // Checks if a development console is connected to the development PC. - // See Also: - // Arguments: - // Nothing - // Return: - // bool - true if it is connected, false otherwise. - virtual bool IsConnectedToConsole() = 0; - - // Description: - // Send a file from the specified local filename to the console platform creating the full path - // as required so it can copy to the remote filename. - // See Also: - // Nothing - // Arguments: - // szLocalFileName - is the local filename from which you want to copy the file. - // szRemoteFilename - is the full path and filename to where you want to copy the file. - // Return: - // bool - true if the copy succeeded, false otherwise. - virtual bool SendFile(const char* szLocalFileName, const char* szRemoteFilename) = 0; - - // Description: - // Notifies to the console that a file has been changed, typically uploaded. - // This will be usually called after a SendFile (see above) call, so that the - // system running on the console may decide what to do with this new file. - // Typically the system will have to load or reloads this new file. - // See Also: - // SendFile - // Arguments: - // szRemoteFilename - is the full path and filename in the console of the changed - // file. - // Return: - // bool - true if succeeded sending the notification, false otherwise. - virtual bool NotifyFileChange(const char* szRemoteFilename) = 0; - - - // Description: - // Gets the the title IP for the connected console . - // Arguments: - // dwConsoleAddressPlaceholder - is the pointer to the placeholder of the variable - // which will contain the title IP of the console. - // Return: - // bool - true if dwConsoleAddressPlaceholder now contains the IP address, else false. - virtual bool GetConsoleAddress(DWORD* dwConsoleAddressPlaceholder) = 0; - ////////////////////////////////////////////////////////////////////////// - // IUnknown - ////////////////////////////////////////////////////////////////////////// - virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject) { return E_NOINTERFACE; }; - virtual ULONG STDMETHODCALLTYPE AddRef() { return 0; }; - virtual ULONG STDMETHODCALLTYPE Release() { return 0; }; - ////////////////////////////////////////////////////////////////////////// -}; - -#endif // CRYINCLUDE_EDITOR_INCLUDE_ICONSOLECONNECTIVITY_H diff --git a/Code/Editor/Include/IFacialEditor.h b/Code/Editor/Include/IFacialEditor.h deleted file mode 100644 index 5dfa9ab03f..0000000000 --- a/Code/Editor/Include/IFacialEditor.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_INCLUDE_IFACIALEDITOR_H -#define CRYINCLUDE_EDITOR_INCLUDE_IFACIALEDITOR_H -#pragma once - - -class IFacialEditor -{ -public: - enum EyeType - { - EYE_LEFT, - EYE_RIGHT - }; - - virtual int GetNumMorphTargets() const = 0; - virtual const char* GetMorphTargetName(int index) const = 0; - virtual void PreviewEffector(int index, float value) = 0; - virtual void ClearAllPreviewEffectors() = 0; - virtual void SetForcedNeckRotation(const Quat& rotation) = 0; - virtual void SetForcedEyeRotation(const Quat& rotation, EyeType eye) = 0; - virtual int GetJoystickCount() const = 0; - virtual const char* GetJoystickName(int joystickIndex) const = 0; - virtual void SetJoystickPosition(int joystickIndex, float x, float y) = 0; - virtual void GetJoystickPosition(int joystickIndex, float& x, float& y) const = 0; - virtual void LoadJoystickFile(const char* filename) = 0; - virtual void LoadCharacter(const char* filename) = 0; - virtual void LoadSequence(const char* filename) = 0; - virtual void SetVideoFrameResolution(int width, int height, int bpp) = 0; - virtual int GetVideoFramePitch() = 0; - virtual void* GetVideoFrameBits() = 0; - virtual void ShowVideoFramePane() = 0; -}; - -#endif // CRYINCLUDE_EDITOR_INCLUDE_IFACIALEDITOR_H diff --git a/Code/Editor/Include/IRenderListener.h b/Code/Editor/Include/IRenderListener.h deleted file mode 100644 index 892a42b701..0000000000 --- a/Code/Editor/Include/IRenderListener.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -// Description : Interface for rendering custom 3D elements in the main -// render viewport. Particularly usefull for debug geometries. - - -#ifndef CRYINCLUDE_EDITOR_INCLUDE_IRENDERLISTENER_H -#define CRYINCLUDE_EDITOR_INCLUDE_IRENDERLISTENER_H -#pragma once - - -struct DisplayContext; - -struct IRenderListener - : public IUnknown -{ - DEFINE_UUID(0x8D52F857, 0x1027, 0x4346, 0xAC, 0x7B, 0xF6, 0x20, 0xDA, 0x7C, 0xCE, 0x42) - - virtual void Render(DisplayContext& rDisplayContext) = 0; -}; - -#endif // CRYINCLUDE_EDITOR_INCLUDE_IRENDERLISTENER_H diff --git a/Code/Editor/Include/ITextureDatabaseUpdater.h b/Code/Editor/Include/ITextureDatabaseUpdater.h deleted file mode 100644 index 4482135b47..0000000000 --- a/Code/Editor/Include/ITextureDatabaseUpdater.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -// Description : This file declares the interface used by the texture viewer -// and (implemented first implemented by the Texture Database Creator) to -// syncronize their threads. A thread interace could be useful there. - -#ifndef CRYINCLUDE_EDITOR_INCLUDE_ITEXTUREDATABASEUPDATER_H -#define CRYINCLUDE_EDITOR_INCLUDE_ITEXTUREDATABASEUPDATER_H -#pragma once - - -class CTextureDatabaseItem; - -struct ITextureDatabaseUpdater -{ -public: - ////////////////////////////////////////////////////////////////////////// - // Thread control - virtual void NotifyShutDown() = 0; - virtual void Lock() = 0; - virtual void Unlock() = 0; - virtual void WaitForThread() = 0; - ////////////////////////////////////////////////////////////////////////// - - ////////////////////////////////////////////////////////////////////////// - // Data access - virtual CTextureDatabaseItem* GetItem(const char* szAddItem) = 0; - ////////////////////////////////////////////////////////////////////////// -}; - -#endif // CRYINCLUDE_EDITOR_INCLUDE_ITEXTUREDATABASEUPDATER_H diff --git a/Code/Editor/MainWindow.qrc b/Code/Editor/MainWindow.qrc index 4506a4a2a8..c68e05ef41 100644 --- a/Code/Editor/MainWindow.qrc +++ b/Code/Editor/MainWindow.qrc @@ -166,7 +166,6 @@ arhitype_tree_01.png arhitype_tree_02.png arhitype_tree_03.png - water.png bmp00005_00.png bmp00005_01.png bmp00005_02.png diff --git a/Code/Editor/Resource.h b/Code/Editor/Resource.h index 432f07a531..ef72bfc9be 100644 --- a/Code/Editor/Resource.h +++ b/Code/Editor/Resource.h @@ -196,7 +196,6 @@ #define ID_FILE_EXPORT_TERRAINAREA 33904 #define ID_FILE_EXPORT_TERRAINAREAWITHOBJECTS 33910 #define ID_FILE_EXPORT_SELECTEDOBJECTS 33911 -#define ID_TERRAIN_TIMEOFDAY 33912 #define ID_SPLINE_PREVIOUS_KEY 33916 #define ID_SPLINE_NEXT_KEY 33917 #define ID_SPLINE_FLATTEN_ALL 33918 @@ -290,7 +289,6 @@ #define ID_TV_TRACKS_TOOLBAR_LAST 35183 // for up to 100 "Add Tracks..." dynamically added Track View Track buttons #define ID_OPEN_TERRAIN_EDITOR 36007 #define ID_OPEN_UICANVASEDITOR 36010 -#define ID_TERRAIN_TIMEOFDAYBUTTON 36011 #define ID_OPEN_TERRAINTEXTURE_EDITOR 36012 #define ID_SKINS_REFRESH 36014 #define ID_FILE_GENERATETERRAIN 36016 diff --git a/Code/Editor/TimeOfDay/main-00.png b/Code/Editor/TimeOfDay/main-00.png deleted file mode 100644 index 2c44fec541..0000000000 --- a/Code/Editor/TimeOfDay/main-00.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5201dbba6c8114914ed680b04b72a5e18e22c0519a514bcccdc7ae8d32670b4e -size 993 diff --git a/Code/Editor/TimeOfDay/main-01.png b/Code/Editor/TimeOfDay/main-01.png deleted file mode 100644 index 5cc1bf33d8..0000000000 --- a/Code/Editor/TimeOfDay/main-01.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:48a7250ad41c5e298079ddd13910b58baca2ef592defcc162ccc9df542d28905 -size 981 diff --git a/Code/Editor/TimeOfDay/main-02.png b/Code/Editor/TimeOfDay/main-02.png deleted file mode 100644 index b7d90648a3..0000000000 --- a/Code/Editor/TimeOfDay/main-02.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:98b9e9abcc54b4f3e6903ad74bb50f364bfe4c8cd9fedc9653a6603d64a1ee0a -size 838 diff --git a/Code/Editor/TimeOfDay/main-03.png b/Code/Editor/TimeOfDay/main-03.png deleted file mode 100644 index e073dbf60b..0000000000 --- a/Code/Editor/TimeOfDay/main-03.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1199c834fc8de69f9d7c76e8c7fbd84e9b92713b9f07b513137085e5089432cb -size 857 diff --git a/Code/Editor/TimeOfDay/main-04.png b/Code/Editor/TimeOfDay/main-04.png deleted file mode 100644 index 6049dbfe18..0000000000 --- a/Code/Editor/TimeOfDay/main-04.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:79b44be1dbe5518e06dc8c8823d00462136d39ffe60a32ef4f64dc0712654d33 -size 646 diff --git a/Code/Editor/TimeOfDay/main-05.png b/Code/Editor/TimeOfDay/main-05.png deleted file mode 100644 index 054419f39a..0000000000 --- a/Code/Editor/TimeOfDay/main-05.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6ea7450c1a278570e2a1dba3a8b4d7d4e5f0d054e8371139ebdb5220c405d355 -size 537 diff --git a/Code/Editor/TimeOfDay/main-06.png b/Code/Editor/TimeOfDay/main-06.png deleted file mode 100644 index 35f8afdae2..0000000000 --- a/Code/Editor/TimeOfDay/main-06.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bc73f0720f2ff877aff5c6646938b7fc509a69d92e766fecb9fa010eecadee7b -size 606 diff --git a/Code/Editor/TimeOfDay/main-07.png b/Code/Editor/TimeOfDay/main-07.png deleted file mode 100644 index aca9597355..0000000000 --- a/Code/Editor/TimeOfDay/main-07.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e63519ed54fc19a4b4a2a38cb2c5f148b7404ac614d4aab039b71fee64cd7425 -size 569 diff --git a/Code/Editor/TimeOfDay/main-08.png b/Code/Editor/TimeOfDay/main-08.png deleted file mode 100644 index abeb114fc2..0000000000 --- a/Code/Editor/TimeOfDay/main-08.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8742cad4b8f8f5bba59abb9cc028db84de222ed8b393398f6837fea16bb4a1d8 -size 563 diff --git a/Code/Editor/TimeOfDay/main-09.png b/Code/Editor/TimeOfDay/main-09.png deleted file mode 100644 index cc77b8c9e2..0000000000 --- a/Code/Editor/TimeOfDay/main-09.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ef85628301b4edc4f858f0988e4f072772be3feb92d27a2ec33b72a27bcee7ff -size 583 diff --git a/Code/Editor/TimeOfDay/main-10.png b/Code/Editor/TimeOfDay/main-10.png deleted file mode 100644 index dc463c6497..0000000000 --- a/Code/Editor/TimeOfDay/main-10.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d17bfbdee6d37566b241adf64241ef47b62145aaac3e9e8f9691d1fb866b5fcb -size 717 diff --git a/Code/Editor/TimeOfDay/main-11.png b/Code/Editor/TimeOfDay/main-11.png deleted file mode 100644 index d686ab18c8..0000000000 --- a/Code/Editor/TimeOfDay/main-11.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:98b629abf927bcea41d8857b1761d12a37836471d7106b2f5210337c0ace0d9c -size 1103 diff --git a/Code/Editor/TimeOfDay/main-12.png b/Code/Editor/TimeOfDay/main-12.png deleted file mode 100644 index 069510ab24..0000000000 --- a/Code/Editor/TimeOfDay/main-12.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e949111b33e28834995807cab30ecb58d988a81a2d58fa166117962c85b8e149 -size 849 diff --git a/Code/Editor/Viewport.cpp b/Code/Editor/Viewport.cpp index 437dcead3b..dcf86abb02 100644 --- a/Code/Editor/Viewport.cpp +++ b/Code/Editor/Viewport.cpp @@ -30,7 +30,6 @@ #include "Objects/ObjectManager.h" #include "Util/3DConnexionDriver.h" #include "PluginManager.h" -#include "Include/IRenderListener.h" #include "GameEngine.h" #include "Settings.h" @@ -227,61 +226,6 @@ void QtViewport::GetDimensions(int* pWidth, int* pHeight) const } } -////////////////////////////////////////////////////////////////////////// -void QtViewport::RegisterRenderListener(IRenderListener* piListener) -{ -#ifdef _DEBUG - size_t nCount(0); - size_t nTotal(0); - - nTotal = m_cRenderListeners.size(); - for (nCount = 0; nCount < nTotal; ++nCount) - { - if (m_cRenderListeners[nCount] == piListener) - { - assert(!"Registered the same RenderListener multiple times."); - break; - } - } -#endif //_DEBUG - m_cRenderListeners.push_back(piListener); -} - -////////////////////////////////////////////////////////////////////////// -bool QtViewport::UnregisterRenderListener(IRenderListener* piListener) -{ - size_t nCount(0); - size_t nTotal(0); - - nTotal = m_cRenderListeners.size(); - for (nCount = 0; nCount < nTotal; ++nCount) - { - if (m_cRenderListeners[nCount] == piListener) - { - m_cRenderListeners.erase(m_cRenderListeners.begin() + nCount); - return true; - } - } - return false; -} - -////////////////////////////////////////////////////////////////////////// -bool QtViewport::IsRenderListenerRegistered(IRenderListener* piListener) -{ - size_t nCount(0); - size_t nTotal(0); - - nTotal = m_cRenderListeners.size(); - for (nCount = 0; nCount < nTotal; ++nCount) - { - if (m_cRenderListeners[nCount] == piListener) - { - return true; - } - } - return false; -} - ////////////////////////////////////////////////////////////////////////// void QtViewport::AddPostRenderer(IPostRenderer* pPostRenderer) { @@ -1164,18 +1108,6 @@ bool QtViewport::GetAdvancedSelectModeFlag() return m_bAdvancedSelectMode; } -////////////////////////////////////////////////////////////////////////// -void QtViewport::ProcessRenderLisneters(DisplayContext& rstDisplayContext) -{ - size_t nCount(0); - size_t nTotal(0); - - nTotal = m_cRenderListeners.size(); - for (nCount = 0; nCount < nTotal; ++nCount) - { - m_cRenderListeners[nCount]->Render(rstDisplayContext); - } -} ////////////////////////////////////////////////////////////////////////// #if defined(AZ_PLATFORM_WINDOWS) // Note: Both CreateAnglesYPR and CreateOrientationYPR were copied verbatim from Cry_Camera.h which has been removed. diff --git a/Code/Editor/Viewport.h b/Code/Editor/Viewport.h index 1b0e5a4d93..d992eb4cb0 100644 --- a/Code/Editor/Viewport.h +++ b/Code/Editor/Viewport.h @@ -43,7 +43,6 @@ class CLayoutViewPane; class CViewManager; class CBaseObjectsCache; struct HitContext; -struct IRenderListener; class CImageEx; class QMenu; @@ -104,10 +103,6 @@ public: //! Access to view manager. CViewManager* GetViewManager() const { return m_viewManager; }; - virtual void RegisterRenderListener(IRenderListener* piListener) = 0; - virtual bool UnregisterRenderListener(IRenderListener* piListener) = 0; - virtual bool IsRenderListenerRegistered(IRenderListener* piListener) = 0; - virtual void AddPostRenderer(IPostRenderer* pPostRenderer) = 0; virtual bool RemovePostRenderer(IPostRenderer* pPostRenderer) = 0; @@ -477,10 +472,6 @@ public: void ResetCursor() override; void SetSupplementaryCursorStr(const QString& str) override; - void RegisterRenderListener(IRenderListener* piListener) override; - bool UnregisterRenderListener(IRenderListener* piListener) override; - bool IsRenderListenerRegistered(IRenderListener* piListener) override; - void AddPostRenderer(IPostRenderer* pPostRenderer) override; bool RemovePostRenderer(IPostRenderer* pPostRenderer) override; @@ -508,8 +499,6 @@ protected: void setRenderOverlayVisible(bool); bool isRenderOverlayVisible() const; - void ProcessRenderLisneters(DisplayContext& rstDisplayContext); - void mousePressEvent(QMouseEvent* event) override; void mouseReleaseEvent(QMouseEvent* event) override; void mouseDoubleClickEvent(QMouseEvent* event) override; @@ -597,8 +586,6 @@ protected: // Same construction matrix is shared by all viewports. Matrix34 m_constructionMatrix[LAST_COORD_SYSTEM]; - std::vector m_cRenderListeners; - typedef std::vector<_smart_ptr > PostRenderers; PostRenderers m_postRenderers; AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index 59a1a91647..345a8e15e1 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -270,7 +270,6 @@ set(FILES Include/Command.h Include/HitContext.h Include/ICommandManager.h - Include/IConsoleConnectivity.h Include/IDisplayViewport.h Include/IEditorClassFactory.h Include/IEventLoopHook.h @@ -282,9 +281,7 @@ set(FILES Include/IObjectManager.h Include/IPlugin.h Include/IPreferencesPage.h - Include/IRenderListener.h Include/ISourceControl.h - Include/ITextureDatabaseUpdater.h Include/ITransformManipulator.h Include/IViewPane.h Include/ObjectEvent.h diff --git a/Code/Editor/water.png b/Code/Editor/water.png deleted file mode 100644 index 342dee81e3..0000000000 --- a/Code/Editor/water.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4abde33fa9c29e927e403e275979536e7defbb6476eb375e85f847396645953f -size 41419 From 8510bdbfa756100b98a0db6f6f726c03e067f5dc Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Fri, 7 Jan 2022 14:27:43 -0600 Subject: [PATCH 388/948] (Draft) WIP adding pixel retrieval API to StreamingImageAsset Signed-off-by: Chris Galvan --- .../Code/Source/Processing/Utils.cpp | 4 + .../RPI.Reflect/Image/StreamingImageAsset.h | 4 + .../RPI.Reflect/Image/StreamingImageAsset.cpp | 129 ++++++++++++++++++ Gems/GradientSignal/Code/CMakeLists.txt | 1 + .../Components/ImageGradientComponent.h | 4 + .../Code/Include/GradientSignal/ImageAsset.h | 3 +- .../GradientSignal/Code/Source/ImageAsset.cpp | 28 ++-- 7 files changed, 157 insertions(+), 16 deletions(-) diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/Utils.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/Utils.cpp index 20e1b18e77..44539ad33c 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/Utils.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/Utils.cpp @@ -242,6 +242,10 @@ namespace ImageProcessingAtom } } + // Should we actually put the GetSubImagePixelValue API in this Utils file instead, since it already has + // some conversion logic, and has the helper method for retrieving an entire image (LoadImageFromImageAsset) + // whereas this is a helper for retrieving a specific pixel from the image? + IImageObjectPtr LoadImageFromImageAsset(const AZ::Data::Asset& imageAsset) { if (!imageAsset.IsReady()) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h index 73af8370cb..1db2a63b1c 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h @@ -85,6 +85,10 @@ namespace AZ //! Get image data for specified mip and slice. It may return empty array if its mipchain assets are not loaded AZStd::array_view GetSubImageData(uint32_t mip, uint32_t slice); + //! Get image pixel value for specified mip and slice + template + T GetSubImagePixelValue(uint32_t mip, uint32_t slice, uint32_t x, uint32_t y, uint32_t componentIndex = 0); + //! Returns streaming image pool asset id of the pool that will be used to create the streaming image. const Data::AssetId& GetPoolAssetId() const; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index 59f359e474..f1d9b1782b 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -13,6 +13,95 @@ namespace AZ { + namespace Internal + { + template + float RetrieveFloatValue(const AZ::u8* mem, size_t index) + { + AZ_Assert(false, "Unsupported pixel format"); + } + + template + AZ::u32 RetrieveUintValue(const AZ::u8* mem, size_t index) + { + AZ_Assert(false, "Unsupported pixel format"); + } + + template <> + float RetrieveFloatValue([[maybe_unused]] const AZ::u8* mem, [[maybe_unused]] size_t index) + { + return 0.0f; + } + + template <> + AZ::u32 RetrieveUintValue([[maybe_unused]] const AZ::u8* mem, [[maybe_unused]] size_t index) + { + return 0; + } + + template <> + AZ::u32 RetrieveUintValue(const AZ::u8* mem, size_t index) + { + return mem[index] / static_cast(std::numeric_limits::max()); + } + + template <> + AZ::u32 RetrieveUintValue(const AZ::u8* mem, size_t index) + { + // 16 bits per channel + auto actualMem = reinterpret_cast(mem); + actualMem += index; + + return *actualMem / static_cast(std::numeric_limits::max()); + } + + template <> + AZ::u32 RetrieveUintValue(const AZ::u8* mem, size_t index) + { + // 32 bits per channel + auto actualMem = reinterpret_cast(mem); + actualMem += index; + + return *actualMem / static_cast(std::numeric_limits::max()); + } + + template <> + float RetrieveFloatValue(const AZ::u8* mem, size_t index) + { + // 32 bits per channel + auto actualMem = reinterpret_cast(mem); + actualMem += index; + + return *actualMem; + } + + float RetrieveFloatValue(const AZ::u8* mem, size_t index, AZ::RHI::Format format) + { + switch (format) + { + case AZ::RHI::Format::R32_FLOAT: + return RetrieveFloatValue(mem, index); + default: + return RetrieveFloatValue(mem, index); + } + } + + AZ::u32 RetrieveUintValue(const AZ::u8* mem, size_t index, AZ::RHI::Format format) + { + switch (format) + { + case AZ::RHI::Format::R8_UNORM: + return RetrieveUintValue(mem, index); + case AZ::RHI::Format::R16_UNORM: + return RetrieveUintValue(mem, index); + case AZ::RHI::Format::R32_UINT: + return RetrieveUintValue(mem, index); + default: + return RetrieveUintValue(mem, index); + } + } + } + namespace RPI { const char* StreamingImageAsset::DisplayName = "StreamingImage"; @@ -124,5 +213,45 @@ namespace AZ return mipChainAsset->GetSubImageData(mip - mipChain.m_mipOffset, slice); } + + template<> + float StreamingImageAsset::GetSubImagePixelValue(uint32_t mip, uint32_t slice, uint32_t x, uint32_t y, uint32_t componentIndex) + { + // TODO: Use the component index + (void)componentIndex; + + auto imageData = GetSubImageData(mip, slice); + + if (!imageData.empty()) + { + const AZ::RHI::ImageDescriptor imageDescriptor = GetImageDescriptor(); + auto width = imageDescriptor.m_size.m_width; + size_t index = (y * width) + x; + + return Internal::RetrieveFloatValue(imageData.data(), index, imageDescriptor.m_format); + } + + return 0.0f; + } + + template<> + AZ::u32 StreamingImageAsset::GetSubImagePixelValue(uint32_t mip, uint32_t slice, uint32_t x, uint32_t y, uint32_t componentIndex) + { + // TODO: Use the component index + (void)componentIndex; + + auto imageData = GetSubImageData(mip, slice); + + if (!imageData.empty()) + { + const AZ::RHI::ImageDescriptor imageDescriptor = GetImageDescriptor(); + auto width = imageDescriptor.m_size.m_width; + size_t index = (y * width) + x; + + return Internal::RetrieveUintValue(imageData.data(), index, imageDescriptor.m_format); + } + + return 0; + } } } diff --git a/Gems/GradientSignal/Code/CMakeLists.txt b/Gems/GradientSignal/Code/CMakeLists.txt index 657a88db47..fda04ceb82 100644 --- a/Gems/GradientSignal/Code/CMakeLists.txt +++ b/Gems/GradientSignal/Code/CMakeLists.txt @@ -21,6 +21,7 @@ ly_add_target( AZ::AzCore AZ::AtomCore AZ::AzFramework + Gem::Atom_RPI.Public Gem::SurfaceData Gem::ImageProcessingAtom.Headers Gem::LmbrCentral diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h index 8214436f83..bbb22a061d 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h @@ -10,6 +10,9 @@ #include #include + +#include + #include #include #include @@ -33,6 +36,7 @@ namespace GradientSignal AZ_RTTI(ImageGradientConfig, "{1BDB5DA4-A4A8-452B-BE6D-6BD451D4E7CD}", AZ::ComponentConfig); static void Reflect(AZ::ReflectContext* context); AZ::Data::Asset m_imageAsset = { AZ::Data::AssetLoadBehavior::QueueLoad }; + AZ::Data::Asset m_streamingImageAsset = { AZ::Data::AssetLoadBehavior::QueueLoad }; float m_tilingX = 1.0f; float m_tilingY = 1.0f; }; diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/ImageAsset.h b/Gems/GradientSignal/Code/Include/GradientSignal/ImageAsset.h index 4ffab0b4b4..811d74082d 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/ImageAsset.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/ImageAsset.h @@ -12,6 +12,7 @@ #include #include #include +#include namespace AZ { @@ -61,6 +62,6 @@ namespace GradientSignal } }; - float GetValueFromImageAsset(const AZ::Data::Asset& imageAsset, const AZ::Vector3& uvw, float tilingX, float tilingY, float defaultValue); + float GetValueFromImageAsset(const AZ::Data::Asset& imageAsset, const AZ::Vector3& uvw, float tilingX, float tilingY, float defaultValue); } // namespace GradientSignal diff --git a/Gems/GradientSignal/Code/Source/ImageAsset.cpp b/Gems/GradientSignal/Code/Source/ImageAsset.cpp index 7e73dc32d6..afa233e5cb 100644 --- a/Gems/GradientSignal/Code/Source/ImageAsset.cpp +++ b/Gems/GradientSignal/Code/Source/ImageAsset.cpp @@ -20,6 +20,7 @@ namespace { + // Could (should) move these RetrieveValue helper methods over to where our new API lives template float RetrieveValue(const AZ::u8* mem, size_t index) { @@ -151,17 +152,17 @@ namespace GradientSignal return true; } - float GetValueFromImageAsset(const AZ::Data::Asset& imageAsset, const AZ::Vector3& uvw, float tilingX, float tilingY, float defaultValue) + float GetValueFromImageAsset(const AZ::Data::Asset& imageAsset, const AZ::Vector3& uvw, float tilingX, float tilingY, float defaultValue) { if (imageAsset.IsReady()) { - const auto& image = imageAsset.Get(); - AZStd::size_t imageSize = image->m_imageWidth * image->m_imageHeight * - static_cast(image->m_bytesPerPixel); + const AZ::RHI::ImageDescriptor imageDescriptor = imageAsset->GetImageDescriptor(); + auto width = imageDescriptor.m_size.m_width; + auto height = imageDescriptor.m_size.m_height; - if (image->m_imageWidth > 0 && - image->m_imageHeight > 0 && - image->m_imageData.size() == imageSize) + if (width > 0 + && height > 0 + ) { // When "rasterizing" from uvs, a range of 0-1 has slightly different meanings depending on the sampler state. // For repeating states (Unbounded/None, Repeat), a uv value of 1 should wrap around back to our 0th pixel. @@ -184,8 +185,8 @@ namespace GradientSignal // A 16x16 pixel image and tilingX = tilingY = 1 maps the uv range of 0-1 to 0-16 pixels. // A 16x16 pixel image and tilingX = tilingY = 1.5 maps the uv range of 0-1 to 0-24 pixels. - const AZ::Vector3 tiledDimensions((image->m_imageWidth * tilingX), - (image->m_imageHeight * tilingY), + const AZ::Vector3 tiledDimensions((width * tilingX), + (height * tilingY), 0.0f); // Convert from uv space back to pixel space @@ -194,13 +195,10 @@ namespace GradientSignal // UVs outside the 0-1 range are treated as infinitely tiling, so that we behave the same as the // other gradient generators. As mentioned above, if clamping is desired, we expect it to be applied // outside of this function. - size_t x = static_cast(pixelLookup.GetX()) % image->m_imageWidth; - size_t y = static_cast(pixelLookup.GetY()) % image->m_imageHeight; + uint32_t x = static_cast(pixelLookup.GetX()) % width; + uint32_t y = static_cast(pixelLookup.GetY()) % height; - // Flip the y because images are stored in reverse of our world axes - size_t index = ((image->m_imageHeight - 1) - y) * image->m_imageWidth + x; - - return RetrieveValue(image->m_imageData.data(), index, image->m_imageFormat); + return imageAsset->GetSubImagePixelValue(0, 0, x, y, 0); } } From b04cecc34dd9ace183fab95b97e393c3212de272 Mon Sep 17 00:00:00 2001 From: michabr <82236305+michabr@users.noreply.github.com> Date: Fri, 7 Jan 2022 14:28:38 -0800 Subject: [PATCH 389/948] Move Draw2d interface back to IDraw2d (#6730) * Move Draw2d interface back to IDraw2d Signed-off-by: abrmich * Fix compile error for gems using LyShine Signed-off-by: abrmich --- Gems/LyShine/Code/CMakeLists.txt | 3 + Gems/LyShine/Code/Include/LyShine/Draw2d.h | 363 +------------- Gems/LyShine/Code/Include/LyShine/IDraw2d.h | 457 ++++++++++++++++++ Gems/LyShine/Code/Source/LyShineDebug.cpp | 26 +- .../LyShine/Code/Source/UiCanvasComponent.cpp | 4 +- Gems/LyShine/Code/Source/UiCanvasComponent.h | 4 +- Gems/LyShine/Code/Source/UiCanvasManager.cpp | 6 +- Gems/LyShine/Code/Source/UiRenderer.cpp | 2 +- 8 files changed, 502 insertions(+), 363 deletions(-) diff --git a/Gems/LyShine/Code/CMakeLists.txt b/Gems/LyShine/Code/CMakeLists.txt index 77aaa681e0..4f2c4e90a7 100644 --- a/Gems/LyShine/Code/CMakeLists.txt +++ b/Gems/LyShine/Code/CMakeLists.txt @@ -47,6 +47,9 @@ ly_add_target( Gem::LyShine.Static Legacy::CryCommon Gem::LmbrCentral + PUBLIC + Gem::Atom_RHI.Reflect + Gem::Atom_RPI.Public RUNTIME_DEPENDENCIES Gem::LmbrCentral Gem::TextureAtlas diff --git a/Gems/LyShine/Code/Include/LyShine/Draw2d.h b/Gems/LyShine/Code/Include/LyShine/Draw2d.h index f92c6ce2e1..d138f41b03 100644 --- a/Gems/LyShine/Code/Include/LyShine/Draw2d.h +++ b/Gems/LyShine/Code/Include/LyShine/Draw2d.h @@ -8,13 +8,10 @@ #pragma once #include -#include -#include #include #include #include -#include #include //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -23,69 +20,11 @@ //! The CDraw2d class implements the IDraw2d interface for drawing 2D images, shapes and text. //! Positions and sizes are specified in pixels in the associated 2D viewport. class CDraw2d - : public IDraw2d // [LYSHINE_ATOM_TODO][GHI #3573] Make Draw2d work better as an API + : public IDraw2d , public AZ::Render::Bootstrap::NotificationBus::Handler { public: // types - struct RenderState - { - RenderState() - { - m_blendState.m_enable = true; - m_blendState.m_blendSource = AZ::RHI::BlendFactor::AlphaSource; - m_blendState.m_blendDest = AZ::RHI::BlendFactor::AlphaSourceInverse; - - m_depthState.m_enable = false; - } - - AZ::RHI::TargetBlendState m_blendState; - AZ::RHI::DepthState m_depthState; - }; - - //! Struct used to pass additional image options. - // - //! If this is not passed then the defaults are used - struct ImageOptions - { - AZ::Vector3 color = AZ::Vector3(1.0f, 1.0f, 1.0f); - Rounding pixelRounding = Rounding::Nearest; - bool m_clamp = false; - RenderState m_renderState; - }; - - //! Struct used to pass additional text options - mostly ones that do not change from call to call. - // - //! If this is not passed then the defaults below are used - struct TextOptions - { - AZStd::string fontName; //!< default is "default" - unsigned int effectIndex; //!< default is 0 - AZ::Vector3 color; //!< default is (1,1,1) - HAlign horizontalAlignment; //!< default is HAlign::Left - VAlign verticalAlignment; //!< default is VAlign::Top - AZ::Vector2 dropShadowOffset; //!< default is (0,0), zero offset means no drop shadow is drawn - AZ::Color dropShadowColor; //!< default is (0,0,0,0), zero alpha means no drop shadow is drawn - float rotation; //!< default is 0 - bool depthTestEnabled; //!< default is false - }; - - //! Used to pass in arrays of vertices (e.g. to DrawQuad) - struct VertexPosColUV - { - VertexPosColUV() {} - VertexPosColUV(const AZ::Vector2& inPos, const AZ::Color& inColor, const AZ::Vector2& inUV) - { - position = inPos; - color = inColor; - uv = inUV; - } - - AZ::Vector2 position; //!< 2D position of vertex - AZ::Color color; //!< Float color - AZ::Vector2 uv; //!< Texture coordinate - }; - public: // member functions //! Constructor, constructed by the LyShine class @@ -116,7 +55,7 @@ public: // member functions //! \param imageOptions Optional struct specifying options that tend to be the same from call to call void DrawImage(AZ::Data::Instance image, AZ::Vector2 position, AZ::Vector2 size, float opacity = 1.0f, float rotation = 0.0f, const AZ::Vector2* pivotPoint = nullptr, const AZ::Vector2* minMaxTexCoords = nullptr, - ImageOptions* imageOptions = nullptr); + ImageOptions* imageOptions = nullptr) override; //! Draw a textured quad where the position specifies the point specified by the alignment. // @@ -135,7 +74,7 @@ public: // member functions void DrawImageAligned(AZ::Data::Instance image, AZ::Vector2 position, AZ::Vector2 size, HAlign horizontalAlignment, VAlign verticalAlignment, float opacity = 1.0f, float rotation = 0.0f, const AZ::Vector2* minMaxTexCoords = nullptr, - ImageOptions* imageOptions = nullptr); + ImageOptions* imageOptions = nullptr) override; //! Draw a textured quad where the position, color and uv of each point is specified explicitly // @@ -143,11 +82,11 @@ public: // member functions //! \param verts An array of 4 vertices, in clockwise order (e.g. top left, top right, bottom right, bottom left) //! \param pixelRounding Whether and how to round pixel coordinates //! \param renderState Blend mode and depth state - virtual void DrawQuad(AZ::Data::Instance image, + void DrawQuad(AZ::Data::Instance image, VertexPosColUV* verts, Rounding pixelRounding = Rounding::Nearest, bool clamp = false, - const RenderState& renderState = RenderState{}); + const RenderState& renderState = RenderState{}) override; //! Draw a line // @@ -156,9 +95,9 @@ public: // member functions //! \param color The color of the line //! \param pixelRounding Whether and how to round pixel coordinates //! \param renderState Blend mode and depth state - virtual void DrawLine(AZ::Vector2 start, AZ::Vector2 end, AZ::Color color, + void DrawLine(AZ::Vector2 start, AZ::Vector2 end, AZ::Color color, IDraw2d::Rounding pixelRounding = IDraw2d::Rounding::Nearest, - const RenderState& renderState = RenderState{}); + const RenderState& renderState = RenderState{}) override; //! Draw a line with a texture so it can be dotted or dashed // @@ -166,10 +105,10 @@ public: // member functions //! \param verts An array of 2 vertices for the start and end points of the line //! \param pixelRounding Whether and how to round pixel coordinates //! \param renderState Blend mode and depth state - virtual void DrawLineTextured(AZ::Data::Instance image, + void DrawLineTextured(AZ::Data::Instance image, VertexPosColUV* verts, IDraw2d::Rounding pixelRounding = IDraw2d::Rounding::Nearest, - const RenderState& renderState = RenderState{}); + const RenderState& renderState = RenderState{}) override; //! Draw a text string. Only supports ASCII text. // //! The font and effect used to render the text are specified in the textOptions structure @@ -179,7 +118,7 @@ public: // member functions //! \param opacity The opacity (alpha value) to use to draw the text //! \param textOptions Pointer to an options struct. If null the default options are used void DrawText(const char* textString, AZ::Vector2 position, float pointSize, - float opacity = 1.0f, TextOptions* textOptions = nullptr); + float opacity = 1.0f, TextOptions* textOptions = nullptr) override; //! Draw a rectangular outline with a texture // @@ -194,43 +133,43 @@ public: // member functions AZ::Vector2 rightVec, AZ::Vector2 downVec, AZ::Color color, - uint32_t lineThickness = 0); + uint32_t lineThickness = 0) override; //! Get the width and height (in pixels) that would be used to draw the given text string. // //! Pass the same parameter values that would be used to draw the string - AZ::Vector2 GetTextSize(const char* textString, float pointSize, TextOptions* textOptions = nullptr); + AZ::Vector2 GetTextSize(const char* textString, float pointSize, TextOptions* textOptions = nullptr) override; //! Get the width of the rendering viewport (in pixels). - float GetViewportWidth() const; + float GetViewportWidth() const override; //! Get the height of the rendering viewport (in pixels). - float GetViewportHeight() const; + float GetViewportHeight() const override; //! Get dpi scale factor - float GetViewportDpiScalingFactor() const; + float GetViewportDpiScalingFactor() const override; //! Get the default values that would be used if no image options were passed in // //! This is a convenient way to initialize the imageOptions struct - virtual const ImageOptions& GetDefaultImageOptions() const; + const ImageOptions& GetDefaultImageOptions() const override; //! Get the default values that would be used if no text options were passed in // //! This is a convenient way to initialize the textOptions struct - virtual const TextOptions& GetDefaultTextOptions() const; + const TextOptions& GetDefaultTextOptions() const override; //! Render the primitives that have been deferred - void RenderDeferredPrimitives(); + void RenderDeferredPrimitives() override; //! Specify whether to defer future primitives or render them right away - void SetDeferPrimitives(bool deferPrimitives); + void SetDeferPrimitives(bool deferPrimitives) override; //! Return whether future primitives will be deferred or rendered right away - bool GetDeferPrimitives(); + bool GetDeferPrimitives() override; //! Set sort key offset for following draws. - void SetSortKey(int64_t key); + void SetSortKey(int64_t key) override; private: @@ -378,263 +317,3 @@ protected: // attributes AZ::RHI::Ptr m_dynamicDraw; Draw2dShaderData m_shaderData; }; - -//////////////////////////////////////////////////////////////////////////////////////////////////// -//! Helper class for using the IDraw2d interface -//! -//! The Draw2dHelper class is an inline wrapper that provides the convenience feature of -//! automatically setting member options structures to their defaults and providing set functions. -class Draw2dHelper -{ -public: // member functions - - //! Start a section of 2D drawing function calls that will render to the default viewport - Draw2dHelper(bool deferCalls = false) - { - InitCommon(nullptr, deferCalls); - } - - //! Start a section of 2D drawing function calls that will render to the viewport - //! associated with the specified Draw2d object - Draw2dHelper(CDraw2d* draw2d, bool deferCalls = false) - { - InitCommon(draw2d, deferCalls); - } - - void InitCommon(CDraw2d* draw2d, bool deferCalls) - { - m_draw2d = draw2d; - - if (!m_draw2d) - { - // Set to default which is the game's draw 2d object - m_draw2d = GetDefaultDraw2d(); - } - - if (m_draw2d) - { - m_previousDeferCalls = m_draw2d->GetDeferPrimitives(); - m_draw2d->SetDeferPrimitives(deferCalls); - m_imageOptions = m_draw2d->GetDefaultImageOptions(); - m_textOptions = m_draw2d->GetDefaultTextOptions(); - } - } - - //! End a section of 2D drawing function calls. - ~Draw2dHelper() - { - if (m_draw2d) - { - m_draw2d->SetDeferPrimitives(m_previousDeferCalls); - } - } - - //! Draw a textured quad, optional rotation is counter-clockwise in degrees. - // - //! See IDraw2d:DrawImage for parameter descriptions - void DrawImage(AZ::Data::Instance image, AZ::Vector2 position, AZ::Vector2 size, float opacity = 1.0f, - float rotation = 0.0f, const AZ::Vector2* pivotPoint = nullptr, const AZ::Vector2* minMaxTexCoords = nullptr) - { - if (m_draw2d) - { - m_draw2d->DrawImage(image, position, size, opacity, rotation, pivotPoint, minMaxTexCoords, &m_imageOptions); - } - } - - //! Draw a textured quad where the position specifies the point specified by the alignment. - // - //! See IDraw2d:DrawImageAligned for parameter descriptions - void DrawImageAligned(AZ::Data::Instance image, AZ::Vector2 position, AZ::Vector2 size, - IDraw2d::HAlign horizontalAlignment, IDraw2d::VAlign verticalAlignment, - float opacity = 1.0f, float rotation = 0.0f, const AZ::Vector2* minMaxTexCoords = nullptr) - { - if (m_draw2d) - { - m_draw2d->DrawImageAligned(image, position, size, horizontalAlignment, verticalAlignment, - opacity, rotation, minMaxTexCoords, &m_imageOptions); - } - } - - //! Draw a textured quad where the position, color and uv of each point is specified explicitly - // - //! See IDraw2d:DrawQuad for parameter descriptions - void DrawQuad(AZ::Data::Instance image, CDraw2d::VertexPosColUV* verts, - IDraw2d::Rounding pixelRounding = IDraw2d::Rounding::Nearest, - bool clamp = false, - const CDraw2d::RenderState& renderState = CDraw2d::RenderState{}) - { - if (m_draw2d) - { - m_draw2d->DrawQuad(image, verts, pixelRounding, clamp, renderState); - } - } - - //! Draw a line - // - //! See IDraw2d:DrawLine for parameter descriptions - void DrawLine(AZ::Vector2 start, AZ::Vector2 end, AZ::Color color, - IDraw2d::Rounding pixelRounding = IDraw2d::Rounding::Nearest, - const CDraw2d::RenderState& renderState = CDraw2d::RenderState{}) - { - if (m_draw2d) - { - m_draw2d->DrawLine(start, end, color, pixelRounding, renderState); - } - } - - //! Draw a line with a texture so it can be dotted or dashed - // - //! See IDraw2d:DrawLineTextured for parameter descriptions - void DrawLineTextured(AZ::Data::Instance image, CDraw2d::VertexPosColUV* verts, - IDraw2d::Rounding pixelRounding = IDraw2d::Rounding::Nearest, - const CDraw2d::RenderState& renderState = CDraw2d::RenderState{}) - { - if (m_draw2d) - { - m_draw2d->DrawLineTextured(image, verts, pixelRounding, renderState); - } - } - - //! Draw a rect outline with a texture - // - //! See IDraw2d:DrawRectOutlineTextured for parameter descriptions - void DrawRectOutlineTextured(AZ::Data::Instance image, - UiTransformInterface::RectPoints points, - AZ::Vector2 rightVec, - AZ::Vector2 downVec, - AZ::Color color, - uint32_t lineThickness = 0) - { - if (m_draw2d) - { - m_draw2d->DrawRectOutlineTextured(image, points, rightVec, downVec, color, lineThickness); - } - } - - //! Draw a text string. Only supports ASCII text. - // - //! See IDraw2d:DrawText for parameter descriptions - void DrawText(const char* textString, AZ::Vector2 position, float pointSize, float opacity = 1.0f) - { - if (m_draw2d) - { - m_draw2d->DrawText(textString, position, pointSize, opacity, &m_textOptions); - } - } - - //! Get the width and height (in pixels) that would be used to draw the given text string. - // - //! See IDraw2d:GetTextSize for parameter descriptions - AZ::Vector2 GetTextSize(const char* textString, float pointSize) - { - if (m_draw2d) - { - return m_draw2d->GetTextSize(textString, pointSize, &m_textOptions); - } - else - { - return AZ::Vector2(0, 0); - } - } - - // State management - - //! Set the blend mode used for images, default is GS_BLSRC_SRCALPHA|GS_BLDST_ONEMINUSSRCALPHA. - void SetImageBlendMode(const AZ::RHI::TargetBlendState& blendState) { m_imageOptions.m_renderState.m_blendState = blendState; } - - //! Set the color used for DrawImage and other image drawing. - void SetImageColor(AZ::Vector3 color) { m_imageOptions.color = color; } - - //! Set whether images are rounded to have the points on exact pixel boundaries. - void SetImagePixelRounding(IDraw2d::Rounding round) { m_imageOptions.pixelRounding = round; } - - //! Set the base state (that blend mode etc is combined with) used for images, default is GS_NODEPTHTEST. - void SetImageDepthState(const AZ::RHI::DepthState& depthState) { m_imageOptions.m_renderState.m_depthState = depthState; } - - //! Set image clamp mode - void SetImageClamp(bool clamp) { m_imageOptions.m_clamp = clamp; } - - //! Set the text font. - void SetTextFont(AZStd::string_view fontName) { m_textOptions.fontName = fontName; } - - //! Set the text font effect index. - void SetTextEffectIndex(unsigned int effectIndex) { m_textOptions.effectIndex = effectIndex; } - - //! Set the text color. - void SetTextColor(AZ::Vector3 color) { m_textOptions.color = color; } - - //! Set the text alignment. - void SetTextAlignment(IDraw2d::HAlign horizontalAlignment, IDraw2d::VAlign verticalAlignment) - { - m_textOptions.horizontalAlignment = horizontalAlignment; - m_textOptions.verticalAlignment = verticalAlignment; - } - - //! Set a drop shadow for text drawing. An alpha of zero disables drop shadow. - void SetTextDropShadow(AZ::Vector2 offset, AZ::Color color) - { - m_textOptions.dropShadowOffset = offset; - m_textOptions.dropShadowColor = color; - } - - //! Set a rotation for the text. The text rotates around its position (taking into account alignment). - void SetTextRotation(float rotation) - { - m_textOptions.rotation = rotation; - } - - //! Set wheter to enable depth test for the text - void SetTextDepthTestEnabled(bool enabled) - { - m_textOptions.depthTestEnabled = enabled; - } - -public: // static member functions - - //! Helper to get the default IDraw2d interface - static CDraw2d* GetDefaultDraw2d() - { - if (gEnv && gEnv->pLyShine) // [LYSHINE_ATOM_TODO][GHI #3569] Remove LyShine global interface pointer from legacy global environment - { - IDraw2d* draw2d = gEnv->pLyShine->GetDraw2d(); - return reinterpret_cast(draw2d); - } - - return nullptr; - } - - //! Round the X and Y coordinates of a point using the given rounding policy - template - static T RoundXY(T value, IDraw2d::Rounding roundingType) - { - T result = value; - - switch (roundingType) - { - case IDraw2d::Rounding::None: - // nothing to do - break; - case IDraw2d::Rounding::Nearest: - result.SetX(floor(value.GetX() + 0.5f)); - result.SetY(floor(value.GetY() + 0.5f)); - break; - case IDraw2d::Rounding::Down: - result.SetX(floor(value.GetX())); - result.SetY(floor(value.GetY())); - break; - case IDraw2d::Rounding::Up: - result.SetX(ceil(value.GetX())); - result.SetY(ceil(value.GetY())); - break; - } - - return result; - } - -protected: // attributes - - CDraw2d::ImageOptions m_imageOptions; //!< image options are stored locally and updated by member functions - CDraw2d::TextOptions m_textOptions; //!< text options are stored locally and updated by member functions - CDraw2d* m_draw2d; - bool m_previousDeferCalls; -}; diff --git a/Gems/LyShine/Code/Include/LyShine/IDraw2d.h b/Gems/LyShine/Code/Include/LyShine/IDraw2d.h index 3bfa3a1c14..620b8c23c9 100644 --- a/Gems/LyShine/Code/Include/LyShine/IDraw2d.h +++ b/Gems/LyShine/Code/Include/LyShine/IDraw2d.h @@ -11,6 +11,10 @@ #include #include #include +#include +#include +#include +#include //////////////////////////////////////////////////////////////////////////////////////////////////// //! Class for 2D drawing in screen space @@ -55,8 +59,461 @@ public: // types MAX_TEXT_STRING_LENGTH = 1024, }; + struct RenderState + { + RenderState() + { + m_blendState.m_enable = true; + m_blendState.m_blendSource = AZ::RHI::BlendFactor::AlphaSource; + m_blendState.m_blendDest = AZ::RHI::BlendFactor::AlphaSourceInverse; + + m_depthState.m_enable = false; + } + + AZ::RHI::TargetBlendState m_blendState; + AZ::RHI::DepthState m_depthState; + }; + + //! Struct used to pass additional image options. + // + //! If this is not passed then the defaults are used + struct ImageOptions + { + AZ::Vector3 color = AZ::Vector3(1.0f, 1.0f, 1.0f); + Rounding pixelRounding = Rounding::Nearest; + bool m_clamp = false; + RenderState m_renderState; + }; + + //! Struct used to pass additional text options - mostly ones that do not change from call to call. + // + //! If this is not passed then the defaults below are used + struct TextOptions + { + AZStd::string fontName; //!< default is "default" + unsigned int effectIndex; //!< default is 0 + AZ::Vector3 color; //!< default is (1,1,1) + HAlign horizontalAlignment; //!< default is HAlign::Left + VAlign verticalAlignment; //!< default is VAlign::Top + AZ::Vector2 dropShadowOffset; //!< default is (0,0), zero offset means no drop shadow is drawn + AZ::Color dropShadowColor; //!< default is (0,0,0,0), zero alpha means no drop shadow is drawn + float rotation; //!< default is 0 + bool depthTestEnabled; //!< default is false + }; + + //! Used to pass in arrays of vertices (e.g. to DrawQuad) + struct VertexPosColUV + { + VertexPosColUV() {} + VertexPosColUV(const AZ::Vector2& inPos, const AZ::Color& inColor, const AZ::Vector2& inUV) + { + position = inPos; + color = inColor; + uv = inUV; + } + + AZ::Vector2 position; //!< 2D position of vertex + AZ::Color color; //!< Float color + AZ::Vector2 uv; //!< Texture coordinate + }; + public: // member functions //! Implement virtual destructor just for safety. virtual ~IDraw2d() {} + + //! Draw a textured quad with the top left corner at the given position. + // + //! The image is drawn with the color specified by SetShapeColor and the opacity + //! passed as an argument. + //! If rotation is non-zero then the quad is rotated. If the pivot point is + //! provided then the points of the quad are rotated about that point, otherwise + //! they are rotated about the top left corner of the quad. + //! \param texId The texture ID returned by ITexture::GetTextureID() + //! \param position Position of the top left corner of the quad (before rotation) in pixels + //! \param size The width and height of the quad. Use texture width and height to avoid minification, + //! magnification or stretching (assuming the minMaxTexCoords are left to the default) + //! \param opacity The alpha value used when blending + //! \param rotation Angle of rotation in degrees counter-clockwise + //! \param pivotPoint The point about which the quad is rotated + //! \param minMaxTexCoords An optional two component array. The first component is the UV coord for the top left + //! point of the quad and the second is the UV coord of the bottom right point of the quad + //! \param imageOptions Optional struct specifying options that tend to be the same from call to call + virtual void DrawImage(AZ::Data::Instance image, AZ::Vector2 position, AZ::Vector2 size, float opacity = 1.0f, + float rotation = 0.0f, const AZ::Vector2* pivotPoint = nullptr, const AZ::Vector2* minMaxTexCoords = nullptr, + ImageOptions* imageOptions = nullptr) = 0; + + //! Draw a textured quad where the position specifies the point specified by the alignment. + // + //! Rotation is always around the position. + //! \param texId The texture ID returned by ITexture::GetTextureID() + //! \param position Position align point of the quad (before rotation) in pixels + //! \param size The width and height of the quad. Use texture width and height to avoid minification, + //! magnification or stretching (assuming the minMaxTexCoords are left to the default) + //! \param horizontalAlignment Specifies how the quad is horizontally aligned to the given position + //! \param verticalAlignment Specifies how the quad is vertically aligned to the given position + //! \param opacity The alpha value used when blending + //! \param rotation Angle of rotation in degrees counter-clockwise + //! \param minMaxTexCoords An optional two component array. The first component is the UV coord for the top left + //! point of the quad and the second is the UV coord of the bottom right point of the quad + //! \param imageOptions Optional struct specifying options that tend to be the same from call to call + virtual void DrawImageAligned(AZ::Data::Instance image, AZ::Vector2 position, AZ::Vector2 size, + HAlign horizontalAlignment, VAlign verticalAlignment, + float opacity = 1.0f, float rotation = 0.0f, const AZ::Vector2* minMaxTexCoords = nullptr, + ImageOptions* imageOptions = nullptr) = 0; + + //! Draw a textured quad where the position, color and uv of each point is specified explicitly + // + //! \param texId The texture ID returned by ITexture::GetTextureID() + //! \param verts An array of 4 vertices, in clockwise order (e.g. top left, top right, bottom right, bottom left) + //! \param pixelRounding Whether and how to round pixel coordinates + //! \param renderState Blend mode and depth state + virtual void DrawQuad(AZ::Data::Instance image, + VertexPosColUV* verts, + Rounding pixelRounding = Rounding::Nearest, + bool clamp = false, + const RenderState& renderState = RenderState{}) = 0; + + //! Draw a line + // + //! \param start The start position + //! \param end The end position + //! \param color The color of the line + //! \param pixelRounding Whether and how to round pixel coordinates + //! \param renderState Blend mode and depth state + virtual void DrawLine(AZ::Vector2 start, AZ::Vector2 end, AZ::Color color, + IDraw2d::Rounding pixelRounding = IDraw2d::Rounding::Nearest, + const RenderState& renderState = RenderState{}) = 0; + + //! Draw a line with a texture so it can be dotted or dashed + // + //! \param texId The texture ID returned by ITexture::GetTextureID() + //! \param verts An array of 2 vertices for the start and end points of the line + //! \param pixelRounding Whether and how to round pixel coordinates + //! \param renderState Blend mode and depth state + virtual void DrawLineTextured(AZ::Data::Instance image, + VertexPosColUV* verts, + IDraw2d::Rounding pixelRounding = IDraw2d::Rounding::Nearest, + const RenderState& renderState = RenderState{}) = 0; + //! Draw a text string. Only supports ASCII text. + // + //! The font and effect used to render the text are specified in the textOptions structure + //! \param textString A null terminated ASCII text string. May contain \n characters + //! \param position Position of the text in pixels. Alignment values in textOptions affect actual position + //! \param pointSize The size of the font to use + //! \param opacity The opacity (alpha value) to use to draw the text + //! \param textOptions Pointer to an options struct. If null the default options are used + virtual void DrawText(const char* textString, AZ::Vector2 position, float pointSize, + float opacity = 1.0f, TextOptions* textOptions = nullptr) = 0; + + //! Draw a rectangular outline with a texture + // + //! \param image The texture to be used for drawing the outline + //! \param points The rect's vertices (top left, top right, bottom right, bottom left) + //! \param rightVec Right vector. Specified because the rect's width/height could be 0 + //! \param downVec Down vector. Specified because the rect's width/height could be 0 + //! \param color The color of the outline + //! \param lineThickness The thickness in pixels of the outline. If 0, it will be based on image height + virtual void DrawRectOutlineTextured(AZ::Data::Instance image, + UiTransformInterface::RectPoints points, + AZ::Vector2 rightVec, + AZ::Vector2 downVec, + AZ::Color color, + uint32_t lineThickness = 0) = 0; + + //! Get the width and height (in pixels) that would be used to draw the given text string. + // + //! Pass the same parameter values that would be used to draw the string + virtual AZ::Vector2 GetTextSize(const char* textString, float pointSize, TextOptions* textOptions = nullptr) = 0; + + //! Get the width of the rendering viewport (in pixels). + virtual float GetViewportWidth() const = 0; + + //! Get the height of the rendering viewport (in pixels). + virtual float GetViewportHeight() const = 0; + + //! Get dpi scale factor + virtual float GetViewportDpiScalingFactor() const = 0; + + //! Get the default values that would be used if no image options were passed in + // + //! This is a convenient way to initialize the imageOptions struct + virtual const ImageOptions& GetDefaultImageOptions() const = 0; + + //! Get the default values that would be used if no text options were passed in + // + //! This is a convenient way to initialize the textOptions struct + virtual const TextOptions& GetDefaultTextOptions() const = 0; + + //! Render the primitives that have been deferred + virtual void RenderDeferredPrimitives() = 0; + + //! Specify whether to defer future primitives or render them right away + virtual void SetDeferPrimitives(bool deferPrimitives) = 0; + + //! Return whether future primitives will be deferred or rendered right away + virtual bool GetDeferPrimitives() = 0; + + //! Set sort key offset for following draws. + virtual void SetSortKey(int64_t key) = 0; +}; + +//////////////////////////////////////////////////////////////////////////////////////////////////// +//! Helper class for using the IDraw2d interface +//! +//! The Draw2dHelper class is an inline wrapper that provides the convenience feature of +//! automatically setting member options structures to their defaults and providing set functions. +class Draw2dHelper +{ +public: // member functions + + //! Start a section of 2D drawing function calls that will render to the default viewport + Draw2dHelper(bool deferCalls = false) + { + InitCommon(nullptr, deferCalls); + } + + //! Start a section of 2D drawing function calls that will render to the viewport + //! associated with the specified Draw2d object + Draw2dHelper(IDraw2d* draw2d, bool deferCalls = false) + { + InitCommon(draw2d, deferCalls); + } + + void InitCommon(IDraw2d* draw2d, bool deferCalls) + { + m_draw2d = draw2d; + + if (!m_draw2d) + { + // Set to default which is the game's draw 2d object + m_draw2d = GetDefaultDraw2d(); + } + + if (m_draw2d) + { + m_previousDeferCalls = m_draw2d->GetDeferPrimitives(); + m_draw2d->SetDeferPrimitives(deferCalls); + m_imageOptions = m_draw2d->GetDefaultImageOptions(); + m_textOptions = m_draw2d->GetDefaultTextOptions(); + } + } + + //! End a section of 2D drawing function calls. + ~Draw2dHelper() + { + if (m_draw2d) + { + m_draw2d->SetDeferPrimitives(m_previousDeferCalls); + } + } + + //! Draw a textured quad, optional rotation is counter-clockwise in degrees. + // + //! See IDraw2d:DrawImage for parameter descriptions + void DrawImage(AZ::Data::Instance image, AZ::Vector2 position, AZ::Vector2 size, float opacity = 1.0f, + float rotation = 0.0f, const AZ::Vector2* pivotPoint = nullptr, const AZ::Vector2* minMaxTexCoords = nullptr) + { + if (m_draw2d) + { + m_draw2d->DrawImage(image, position, size, opacity, rotation, pivotPoint, minMaxTexCoords, &m_imageOptions); + } + } + + //! Draw a textured quad where the position specifies the point specified by the alignment. + // + //! See IDraw2d:DrawImageAligned for parameter descriptions + void DrawImageAligned(AZ::Data::Instance image, AZ::Vector2 position, AZ::Vector2 size, + IDraw2d::HAlign horizontalAlignment, IDraw2d::VAlign verticalAlignment, + float opacity = 1.0f, float rotation = 0.0f, const AZ::Vector2* minMaxTexCoords = nullptr) + { + if (m_draw2d) + { + m_draw2d->DrawImageAligned(image, position, size, horizontalAlignment, verticalAlignment, + opacity, rotation, minMaxTexCoords, &m_imageOptions); + } + } + + //! Draw a textured quad where the position, color and uv of each point is specified explicitly + // + //! See IDraw2d:DrawQuad for parameter descriptions + void DrawQuad(AZ::Data::Instance image, IDraw2d::VertexPosColUV* verts, + IDraw2d::Rounding pixelRounding = IDraw2d::Rounding::Nearest, + bool clamp = false, + const IDraw2d::RenderState& renderState = IDraw2d::RenderState{}) + { + if (m_draw2d) + { + m_draw2d->DrawQuad(image, verts, pixelRounding, clamp, renderState); + } + } + + //! Draw a line + // + //! See IDraw2d:DrawLine for parameter descriptions + void DrawLine(AZ::Vector2 start, AZ::Vector2 end, AZ::Color color, + IDraw2d::Rounding pixelRounding = IDraw2d::Rounding::Nearest, + const IDraw2d::RenderState& renderState = IDraw2d::RenderState{}) + { + if (m_draw2d) + { + m_draw2d->DrawLine(start, end, color, pixelRounding, renderState); + } + } + + //! Draw a line with a texture so it can be dotted or dashed + // + //! See IDraw2d:DrawLineTextured for parameter descriptions + void DrawLineTextured(AZ::Data::Instance image, IDraw2d::VertexPosColUV* verts, + IDraw2d::Rounding pixelRounding = IDraw2d::Rounding::Nearest, + const IDraw2d::RenderState& renderState = IDraw2d::RenderState{}) + { + if (m_draw2d) + { + m_draw2d->DrawLineTextured(image, verts, pixelRounding, renderState); + } + } + + //! Draw a rect outline with a texture + // + //! See IDraw2d:DrawRectOutlineTextured for parameter descriptions + void DrawRectOutlineTextured(AZ::Data::Instance image, + UiTransformInterface::RectPoints points, + AZ::Vector2 rightVec, + AZ::Vector2 downVec, + AZ::Color color, + uint32_t lineThickness = 0) + { + if (m_draw2d) + { + m_draw2d->DrawRectOutlineTextured(image, points, rightVec, downVec, color, lineThickness); + } + } + + //! Draw a text string. Only supports ASCII text. + // + //! See IDraw2d:DrawText for parameter descriptions + void DrawText(const char* textString, AZ::Vector2 position, float pointSize, float opacity = 1.0f) + { + if (m_draw2d) + { + m_draw2d->DrawText(textString, position, pointSize, opacity, &m_textOptions); + } + } + + //! Get the width and height (in pixels) that would be used to draw the given text string. + // + //! See IDraw2d:GetTextSize for parameter descriptions + AZ::Vector2 GetTextSize(const char* textString, float pointSize) + { + if (m_draw2d) + { + return m_draw2d->GetTextSize(textString, pointSize, &m_textOptions); + } + else + { + return AZ::Vector2(0, 0); + } + } + + // State management + + //! Set the blend mode used for images, default is GS_BLSRC_SRCALPHA|GS_BLDST_ONEMINUSSRCALPHA. + void SetImageBlendMode(const AZ::RHI::TargetBlendState& blendState) { m_imageOptions.m_renderState.m_blendState = blendState; } + + //! Set the color used for DrawImage and other image drawing. + void SetImageColor(AZ::Vector3 color) { m_imageOptions.color = color; } + + //! Set whether images are rounded to have the points on exact pixel boundaries. + void SetImagePixelRounding(IDraw2d::Rounding round) { m_imageOptions.pixelRounding = round; } + + //! Set the base state (that blend mode etc is combined with) used for images, default is GS_NODEPTHTEST. + void SetImageDepthState(const AZ::RHI::DepthState& depthState) { m_imageOptions.m_renderState.m_depthState = depthState; } + + //! Set image clamp mode + void SetImageClamp(bool clamp) { m_imageOptions.m_clamp = clamp; } + + //! Set the text font. + void SetTextFont(AZStd::string_view fontName) { m_textOptions.fontName = fontName; } + + //! Set the text font effect index. + void SetTextEffectIndex(unsigned int effectIndex) { m_textOptions.effectIndex = effectIndex; } + + //! Set the text color. + void SetTextColor(AZ::Vector3 color) { m_textOptions.color = color; } + + //! Set the text alignment. + void SetTextAlignment(IDraw2d::HAlign horizontalAlignment, IDraw2d::VAlign verticalAlignment) + { + m_textOptions.horizontalAlignment = horizontalAlignment; + m_textOptions.verticalAlignment = verticalAlignment; + } + + //! Set a drop shadow for text drawing. An alpha of zero disables drop shadow. + void SetTextDropShadow(AZ::Vector2 offset, AZ::Color color) + { + m_textOptions.dropShadowOffset = offset; + m_textOptions.dropShadowColor = color; + } + + //! Set a rotation for the text. The text rotates around its position (taking into account alignment). + void SetTextRotation(float rotation) + { + m_textOptions.rotation = rotation; + } + + //! Set wheter to enable depth test for the text + void SetTextDepthTestEnabled(bool enabled) + { + m_textOptions.depthTestEnabled = enabled; + } + +public: // static member functions + + //! Helper to get the default IDraw2d interface + static IDraw2d* GetDefaultDraw2d() + { + if (gEnv && gEnv->pLyShine) // [LYSHINE_ATOM_TODO][GHI #3569] Remove LyShine global interface pointer from legacy global environment + { + IDraw2d* draw2d = gEnv->pLyShine->GetDraw2d(); + return reinterpret_cast(draw2d); + } + + return nullptr; + } + + //! Round the X and Y coordinates of a point using the given rounding policy + template + static T RoundXY(T value, IDraw2d::Rounding roundingType) + { + T result = value; + + switch (roundingType) + { + case IDraw2d::Rounding::None: + // nothing to do + break; + case IDraw2d::Rounding::Nearest: + result.SetX(floor(value.GetX() + 0.5f)); + result.SetY(floor(value.GetY() + 0.5f)); + break; + case IDraw2d::Rounding::Down: + result.SetX(floor(value.GetX())); + result.SetY(floor(value.GetY())); + break; + case IDraw2d::Rounding::Up: + result.SetX(ceil(value.GetX())); + result.SetY(ceil(value.GetY())); + break; + } + + return result; + } + +protected: // attributes + + IDraw2d::ImageOptions m_imageOptions; //!< image options are stored locally and updated by member functions + IDraw2d::TextOptions m_textOptions; //!< text options are stored locally and updated by member functions + IDraw2d* m_draw2d; + bool m_previousDeferCalls; }; diff --git a/Gems/LyShine/Code/Source/LyShineDebug.cpp b/Gems/LyShine/Code/Source/LyShineDebug.cpp index 7762b1403b..bb57e70857 100644 --- a/Gems/LyShine/Code/Source/LyShineDebug.cpp +++ b/Gems/LyShine/Code/Source/LyShineDebug.cpp @@ -375,7 +375,7 @@ static void DebugDrawColoredBox(AZ::Vector2 pos, AZ::Vector2 size, AZ::Color col IDraw2d::HAlign horizontalAlignment = IDraw2d::HAlign::Left, IDraw2d::VAlign verticalAlignment = IDraw2d::VAlign::Top) { - CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); + IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); CDraw2d::ImageOptions imageOptions = draw2d->GetDefaultImageOptions(); imageOptions.color = color.GetAsVector3(); @@ -390,7 +390,7 @@ static void DebugDrawColoredBox(AZ::Vector2 pos, AZ::Vector2 size, AZ::Color col static void DebugDrawStringWithSizeBox(AZStd::string_view font, unsigned int effectIndex, const char* sizeString, const char* testString, AZ::Vector2 pos, float spacing, float size) { - CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); + IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); CDraw2d::TextOptions textOptions = draw2d->GetDefaultTextOptions(); if (!font.empty()) @@ -424,7 +424,7 @@ static void DebugDrawStringWithSizeBox(AZStd::string_view font, unsigned int eff #if !defined(_RELEASE) static void DebugDraw2dFontSizes(AZStd::string_view font, unsigned int effectIndex) { - CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); + IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); float xOffset = 20.0f; float yOffset = 20.0f; @@ -546,7 +546,7 @@ static void DebugDrawAlignedTextWithOriginBox(AZ::Vector2 pos, #if !defined(_RELEASE) static void DebugDraw2dFontAlignment() { - CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); + IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); float w = draw2d->GetViewportWidth(); float yPos = 20; @@ -613,7 +613,7 @@ static void DebugDraw2dFontAlignment() #if !defined(_RELEASE) static AZ::Vector2 DebugDrawFontColorTestBox(AZ::Vector2 pos, const char* string, AZ::Vector3 color, float opacity) { - CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); + IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); float pointSize = 32.0f; const float spacing = 6.0f; @@ -648,7 +648,7 @@ static AZ::Vector2 DebugDrawFontColorTestBox(AZ::Vector2 pos, const char* string #if !defined(_RELEASE) static void DebugDraw2dFontColorAndOpacity() { - CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); + IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); AZ::Vector2 size; AZ::Vector2 pos(20.0f, 20.0f); @@ -686,7 +686,7 @@ static void DebugDraw2dFontColorAndOpacity() #if !defined(_RELEASE) static void DebugDraw2dImageRotations() { - CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); + IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); AZ::Data::Instance texture = GetMonoTestTexture(); @@ -738,7 +738,7 @@ static void DebugDraw2dImageRotations() #if !defined(_RELEASE) static void DebugDraw2dImageColor() { - CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); + IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); AZ::Data::Instance texture = GetMonoAlphaTestTexture(); @@ -774,7 +774,7 @@ static void DebugDraw2dImageColor() #if !defined(_RELEASE) static void DebugDraw2dImageBlendMode() { - CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); + IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); auto whiteTexture = AZ::RPI::ImageSystemInterface::Get()->GetSystemImage(AZ::RPI::SystemImage::White); @@ -841,7 +841,7 @@ static void DebugDraw2dImageBlendMode() #if !defined(_RELEASE) static void DebugDraw2dImageUVs() { - CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); + IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); AZ::Data::Instance texture = GetColorTestTexture(); @@ -890,7 +890,7 @@ static void DebugDraw2dImageUVs() #if !defined(_RELEASE) static void DebugDraw2dImagePixelRounding() { - CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); + IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); AZ::Data::Instance texture = GetColorTestTexture(); @@ -931,7 +931,7 @@ static void DebugDraw2dImagePixelRounding() #if !defined(_RELEASE) static void DebugDraw2dLineBasic() { - CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); + IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); CDraw2d::ImageOptions imageOptions = draw2d->GetDefaultImageOptions(); @@ -1422,7 +1422,7 @@ void LyShineDebug::RenderDebug() #if !defined(_RELEASE) #ifndef EXCLUDE_DOCUMENTATION_PURPOSE - CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); + IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); if (!draw2d) { return; diff --git a/Gems/LyShine/Code/Source/UiCanvasComponent.cpp b/Gems/LyShine/Code/Source/UiCanvasComponent.cpp index 78b9c71f8e..0a21f92119 100644 --- a/Gems/LyShine/Code/Source/UiCanvasComponent.cpp +++ b/Gems/LyShine/Code/Source/UiCanvasComponent.cpp @@ -2122,13 +2122,13 @@ void UiCanvasComponent::DebugReportDrawCalls(AZ::IO::HandleType fileHandle, LySh } //////////////////////////////////////////////////////////////////////////////////////////////////// -void UiCanvasComponent::DebugDisplayElemBounds(CDraw2d* draw2d) const +void UiCanvasComponent::DebugDisplayElemBounds(IDraw2d* draw2d) const { DebugDisplayChildElemBounds(draw2d, m_rootElement); } //////////////////////////////////////////////////////////////////////////////////////////////////// -void UiCanvasComponent::DebugDisplayChildElemBounds(CDraw2d* draw2d, const AZ::EntityId entity) const +void UiCanvasComponent::DebugDisplayChildElemBounds(IDraw2d* draw2d, const AZ::EntityId entity) const { AZ::u64 time = AZStd::GetTimeUTCMilliSecond(); uint32 fractionsOfOneSecond = time % 1000; diff --git a/Gems/LyShine/Code/Source/UiCanvasComponent.h b/Gems/LyShine/Code/Source/UiCanvasComponent.h index 79cb044af0..050773131f 100644 --- a/Gems/LyShine/Code/Source/UiCanvasComponent.h +++ b/Gems/LyShine/Code/Source/UiCanvasComponent.h @@ -292,8 +292,8 @@ public: // member functions void DebugReportDrawCalls(AZ::IO::HandleType fileHandle, LyShineDebug::DebugInfoDrawCallReport& reportInfo, void* context) const; - void DebugDisplayElemBounds(CDraw2d* draw2d) const; - void DebugDisplayChildElemBounds(CDraw2d* draw2d, const AZ::EntityId entity) const; + void DebugDisplayElemBounds(IDraw2d* draw2d) const; + void DebugDisplayChildElemBounds(IDraw2d* draw2d, const AZ::EntityId entity) const; #endif public: // static member functions diff --git a/Gems/LyShine/Code/Source/UiCanvasManager.cpp b/Gems/LyShine/Code/Source/UiCanvasManager.cpp index c6564f9b3a..70646246f0 100644 --- a/Gems/LyShine/Code/Source/UiCanvasManager.cpp +++ b/Gems/LyShine/Code/Source/UiCanvasManager.cpp @@ -997,7 +997,7 @@ void UiCanvasManager::DebugDisplayCanvasData(int setting) const { bool onlyShowEnabledCanvases = (setting == 2) ? true : false; - CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); + IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); float dpiScale = draw2d->GetViewportDpiScalingFactor(); float xOffset = 20.0f * dpiScale; @@ -1152,7 +1152,7 @@ void UiCanvasManager::DebugDisplayCanvasData(int setting) const //////////////////////////////////////////////////////////////////////////////////////////////////// void UiCanvasManager::DebugDisplayDrawCallData() const { - CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); + IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); float dpiScale = draw2d->GetViewportDpiScalingFactor(); float xOffset = 20.0f * dpiScale; @@ -1486,7 +1486,7 @@ void UiCanvasManager::DebugReportDrawCalls(const AZStd::string& name) const //////////////////////////////////////////////////////////////////////////////////////////////////// void UiCanvasManager::DebugDisplayElemBounds(int canvasIndexFilter) const { - CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); + IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); int canvasIndex = 0; for (auto canvas : m_loadedCanvases) diff --git a/Gems/LyShine/Code/Source/UiRenderer.cpp b/Gems/LyShine/Code/Source/UiRenderer.cpp index 64ec1bb485..acf17049ad 100644 --- a/Gems/LyShine/Code/Source/UiRenderer.cpp +++ b/Gems/LyShine/Code/Source/UiRenderer.cpp @@ -414,7 +414,7 @@ void UiRenderer::DebugDisplayTextureData(int recordingOption) return lhs.second > rhs.second; }); - CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); + IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); // setup to render lines of text for the debug display From 832c525f67a0ea24ad004066c0d556c8c449a9af Mon Sep 17 00:00:00 2001 From: nemerle <96597+nemerle@users.noreply.github.com> Date: Sat, 8 Jan 2022 23:22:04 +0100 Subject: [PATCH 390/948] Fix missing include file Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> --- .../Include/Atom/RPI.Public/Shader/ShaderVariantAsyncLoader.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/ShaderVariantAsyncLoader.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/ShaderVariantAsyncLoader.h index 838cdd2256..60417adf36 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/ShaderVariantAsyncLoader.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/ShaderVariantAsyncLoader.h @@ -15,6 +15,7 @@ #include #include #include +#include namespace AZ { From c65a903c7dc8ae5ce441df130f26e735534dd6bd Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Sat, 8 Jan 2022 21:01:29 -0800 Subject: [PATCH 391/948] chore: fix unit test Signed-off-by: Michael Pollind --- .../Input/QtEventToAzInputMapperTests.cpp | 26 ++++++------------- 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp b/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp index 5047c19044..d7ab896462 100644 --- a/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp +++ b/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp @@ -541,15 +541,6 @@ namespace UnitTest TEST_P(MoveMoveWrapParamQtEventToAzInputMapperFixture, MouseMove_NoAzHandlers_VerifyMouseMovementViewport) { - //TODO: mouseMove is bugged mapToGlobal is called twice - auto mouseMoveFix = [](QWidget* wid, QPoint globalPos, QPoint deltaPos) - { - QPoint globalPosition = globalPos + deltaPos; - QPoint localPosition = wid->mapFromGlobal(globalPosition); - QTest::mouseMove(wid, localPosition); - QMouseEvent mouseMoveEvent(QEvent::MouseMove, localPosition, globalPosition, Qt::NoButton, Qt::NoButton, Qt::NoModifier); - QApplication::sendEvent(wid, &mouseMoveEvent); - }; // setup const MouseMoveParam mouseMoveParam = GetParam(); @@ -558,30 +549,29 @@ namespace UnitTest m_captureAzEvents = true; m_rootWidget->move(100, 100); - mouseMoveFix(m_rootWidget.get(), m_rootWidget->mapToGlobal(mouseMoveParam.startPos), QPoint(0, 0)); + QScreen* screen = m_rootWidget->screen(); + MouseMove(m_rootWidget.get(), mouseMoveParam.startPos, QPoint(0, 0)); // given m_inputChannelMapper->SetCursorMode(mouseMoveParam.mode); m_azCursorPositions.clear(); - - mouseMoveFix(m_rootWidget.get(), m_rootWidget->mapToGlobal(mouseMoveParam.startPos), QPoint(0, 0)); for (float i = 0; i < mouseMoveParam.iterations; i++) { - mouseMoveFix(m_rootWidget.get(), QCursor::pos(), (mouseMoveParam.deltaPos / mouseMoveParam.iterations)); + MouseMove(m_rootWidget.get(), m_rootWidget->mapFromGlobal(QCursor::pos(screen)), (mouseMoveParam.deltaPos / mouseMoveParam.iterations)); } - AZ::Vector2 accumalatedPosition(0.0f,0.0f); + AZ::Vector2 accumulatedPosition(0.0f,0.0f); for(const auto& pos: m_azCursorPositions) { - accumalatedPosition += (pos.m_normalizedPositionDelta * AZ::Vector2(WidgetSize.width(), WidgetSize.height())); + accumulatedPosition += (pos.m_normalizedPositionDelta * AZ::Vector2(WidgetSize.width(), WidgetSize.height())); } // validate - QPoint endPosition = m_rootWidget->mapFromGlobal(QCursor::pos()); + const QPoint endPosition = m_rootWidget->mapFromGlobal(QCursor::pos(screen)); EXPECT_NEAR(endPosition.x(), mouseMoveParam.expectedPos.x(), 1.0f); EXPECT_NEAR(endPosition.y(), mouseMoveParam.expectedPos.y(), 1.0f); - EXPECT_NEAR(accumalatedPosition.GetX(), mouseMoveParam.deltaPos.x(), 1.0f); - EXPECT_NEAR(accumalatedPosition.GetY(), mouseMoveParam.deltaPos.y(), 1.0f); + EXPECT_NEAR(accumulatedPosition.GetX(), mouseMoveParam.deltaPos.x(), 1.0f); + EXPECT_NEAR(accumulatedPosition.GetY(), mouseMoveParam.deltaPos.y(), 1.0f); // cleanup m_rootWidget->move(0, 0); From 57e4fb9b393a9f37a6c31e4d65a87cff49de2aa7 Mon Sep 17 00:00:00 2001 From: moraaar Date: Mon, 10 Jan 2022 09:05:35 +0000 Subject: [PATCH 392/948] Fixed script canvas component asset not being found (#6727) Script canvas component has the member m_sourceData (that points to the script canvas asset) that internally has data, id and path. Path is serialized as the absolute path of the pc that is saving the level. So when another pc loads the same level it cannot find the script canvas asset. The function CompleteDescription takes a look at the id and takes the path from the asset catalog, but at the moment it's doing an early return because id and path are not empty (but path is the value serialized from other user saving the level). By removing the early return condition then it it will resolve by using id, looking into the catalog and getting the real path. This fix makes several physics automated tests that relied on script canvas to work. Signed-off-by: moraaar moraaar@amazon.com --- Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp index 2cd2dda89e..363f477fbf 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorUtils.cpp @@ -33,11 +33,6 @@ namespace ScriptCanvasEditor { AZStd::optional CompleteDescription(const SourceHandle& source) { - if (source.IsDescriptionValid()) - { - return source; - } - AzToolsFramework::AssetSystemRequestBus::Events* assetSystem = AzToolsFramework::AssetSystemRequestBus::FindFirstHandler(); if (assetSystem) { From afc531d4c3ad1e7a413df68a7a22d7717a7b6a2a Mon Sep 17 00:00:00 2001 From: Benjamin Jillich <43751992+amzn-jillich@users.noreply.github.com> Date: Mon, 10 Jan 2022 10:22:02 +0100 Subject: [PATCH 393/948] Fixes VS2022 error C5233: explicit lambda capture 'isSlash' is not used (#6745) Signed-off-by: Benjamin Jillich --- Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.cpp b/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.cpp index f802bdbada..993e7f2760 100644 --- a/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.cpp +++ b/Code/Tools/AssetProcessor/native/FileWatcher/FileWatcher.cpp @@ -25,7 +25,7 @@ static bool IsSubfolder(const QString& folderA, const QString& folderB) using AZStd::begin; using AZStd::end; - constexpr auto isSlash = [](const QChar c) constexpr + auto isSlash = [](const QChar c) constexpr { return c == AZ::IO::WindowsPathSeparator || c == AZ::IO::PosixPathSeparator; }; From 7c88f20e1e6bf4b24ea6c0631cccc20867c024bb Mon Sep 17 00:00:00 2001 From: John Jones-Steele <82226755+jjjoness@users.noreply.github.com> Date: Mon, 10 Jan 2022 11:49:22 +0000 Subject: [PATCH 394/948] Spinboxes now correct when rounding. (#6748) * Spinboxes now correct when rounding. Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com> * Changes from PR Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com> * Fixed tests after change to rounding in spinbox Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com> --- .../Components/Widgets/SpinBox.cpp | 2 +- .../AzQtComponents/Tests/AzQtComponentTests.cpp | 16 ++++++++++++++++ .../AzQtComponents/Utilities/Conversions.cpp | 16 ++++++++++++---- .../AzQtComponents/Utilities/Conversions.h | 2 +- .../AzToolsFramework/Tests/SpinBoxTests.cpp | 8 ++++---- 5 files changed, 34 insertions(+), 10 deletions(-) diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SpinBox.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SpinBox.cpp index 8ace8d0f40..e9f484ee11 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SpinBox.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SpinBox.cpp @@ -1460,7 +1460,7 @@ QString DoubleSpinBox::stringValue(double value, bool truncated) const numDecimals = 0; } - return toString(value, numDecimals, locale(), isGroupSeparatorShown()); + return toString(value, numDecimals, locale(), isGroupSeparatorShown(), true); } void DoubleSpinBox::updateToolTip(double value) diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Tests/AzQtComponentTests.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Tests/AzQtComponentTests.cpp index 3c911c8acc..d87b238250 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Tests/AzQtComponentTests.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Tests/AzQtComponentTests.cpp @@ -9,6 +9,8 @@ #include #include #include +#include +#include // Environments subclass from AZ::Test::ITestEnvironment class AzQtComponentsTestEnvironment : public AZ::Test::ITestEnvironment @@ -34,3 +36,17 @@ protected: }; AZ_UNIT_TEST_HOOK(new AzQtComponentsTestEnvironment); + +TEST(AzQtComponents, ToStringReturnsTruncatedString) +{ + double testVal = 1.2399999; + QString result = AzQtComponents::toString(testVal, 3, QLocale(), false, false); + EXPECT_TRUE(result == "1.239"); +} + +TEST(AzQtComponents, ToStringReturnsRoundedString) +{ + double testVal = 1.2399999; + QString result = AzQtComponents::toString(testVal, 3, QLocale(), false, true); + EXPECT_TRUE(result == "1.24"); +} diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Utilities/Conversions.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Utilities/Conversions.cpp index bef41bb487..542bfaf7c8 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Utilities/Conversions.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Utilities/Conversions.cpp @@ -39,15 +39,23 @@ namespace AzQtComponents return AZ::Color(static_cast(rgb.redF()), static_cast(rgb.greenF()), static_cast(rgb.blueF()), static_cast(rgb.alphaF())); } - QString toString(double value, int numDecimals, const QLocale& locale, bool showGroupSeparator) + QString toString(double value, int numDecimals, const QLocale& locale, bool showGroupSeparator, bool round) { const QChar decimalPoint = locale.decimalPoint(); const QChar zeroDigit = locale.zeroDigit(); const int numToStringDecimals = AZStd::max(numDecimals, 20); + QString retValue; - // We want to truncate, not round. toString will round, so we add extra decimal places to the formatting - // so we can remove the last values - QString retValue = locale.toString(value, 'f', (numDecimals > 0) ? numToStringDecimals : 0); + // If we want to truncate, not round, we add extra decimal places to the formatting + // so we can remove the last values otherwise we allow rounding + if (round) + { + retValue = locale.toString(value, 'f', (numDecimals > 0) ? numDecimals : 0); + } + else + { + retValue = locale.toString(value, 'f', (numDecimals > 0) ? numToStringDecimals : 0); + } // Handle special cases when we have decimals in our value if (numDecimals > 0) diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Utilities/Conversions.h b/Code/Framework/AzQtComponents/AzQtComponents/Utilities/Conversions.h index 84e874fc5a..29988545f7 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Utilities/Conversions.h +++ b/Code/Framework/AzQtComponents/AzQtComponents/Utilities/Conversions.h @@ -22,7 +22,7 @@ namespace AzQtComponents AZ_QT_COMPONENTS_API AZ::Color fromQColor(const QColor& color); - AZ_QT_COMPONENTS_API QString toString(double value, int numDecimals, const QLocale& locale, bool showGroupSeparator = false); + AZ_QT_COMPONENTS_API QString toString(double value, int numDecimals, const QLocale& locale, bool showGroupSeparator = false, bool round = false); // Maintained for backwards compile compatibility inline QColor ToQColor(const AZ::Color& color) diff --git a/Code/Framework/AzToolsFramework/Tests/SpinBoxTests.cpp b/Code/Framework/AzToolsFramework/Tests/SpinBoxTests.cpp index 2d524cbcf4..f885240fde 100644 --- a/Code/Framework/AzToolsFramework/Tests/SpinBoxTests.cpp +++ b/Code/Framework/AzToolsFramework/Tests/SpinBoxTests.cpp @@ -275,7 +275,7 @@ namespace UnitTest QString testString = "0" + QString(testLocale.decimalPoint()) + "9999999"; QString value = setupTruncationTest(testString); - testString = "0" + QString(testLocale.decimalPoint()) + "999"; + testString = "1" + QString(testLocale.decimalPoint()) + "0"; EXPECT_TRUE(value == testString); } @@ -295,19 +295,19 @@ namespace UnitTest QString testString = "0" + QString(testLocale.decimalPoint()) + "12395"; QString value = setupTruncationTest(testString); - testString = "0" + QString(testLocale.decimalPoint()) + "123"; + testString = "0" + QString(testLocale.decimalPoint()) + "124"; EXPECT_TRUE(value == testString); testString = "0" + QString(testLocale.decimalPoint()) + "94496"; value = setupTruncationTest(testString); - testString = "0" + QString(testLocale.decimalPoint()) + "944"; + testString = "0" + QString(testLocale.decimalPoint()) + "945"; EXPECT_TRUE(value == testString); testString = "0" + QString(testLocale.decimalPoint()) + "0009999"; value = setupTruncationTest(testString); - testString = "0" + QString(testLocale.decimalPoint()) + "0"; + testString = "0" + QString(testLocale.decimalPoint()) + "001"; EXPECT_TRUE(value == testString); } From 098005afbce28facfcaf23673d07b8ba343ab366 Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Mon, 10 Jan 2022 10:03:31 -0600 Subject: [PATCH 395/948] AZStd::basic_string improvements (#6438) * AZStd::basic_string improvements The AZStd::basic_string class has a better implementation of the Short String Optimization, which increases the amount of characters that can be stored in a `basic_string` from 15 characters to 22 characters(not-including null-terminating characters). For a `basic_string` on Windows the amount of characters that can be stored increases from 7 to 10. Using `basic_string` on Unix platforms SSO character amount from 3 to 4 characters. An additional benefit is that the size of the AZStd::basic_string class has been reduced from 40 bytes to 32 bytes when using the AZStd::allocator. When using a stateless allocator with no non static data members such as AZStd::stateless_allocator, the size of the AZStd::basic_string is 24 bytes. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Corrected comments and updated type alias to usings for AZStd::basic_string Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Added Benchmarks for the basic_string and basic_fixed_string class The benchmarks currently measure the speed of the `assign` overloads. A benchmark has also been added to compare the speed swapping two `basic_string` instances by 3 memcpy vs 3 pointer swap operations Speed up string operation when in the iterator overload cases of the `assign`, `append`, `insert` and `replace` function. The code was always performing the logic to copy over a string that is overlapping, without actually checking if the string was overlapping in the first place. Added an `az_builtin_is_constant_evaluated` macro that allows use of the C++20 `std::is_constant_evaluated` feature to determine if an operation is being performed at compile time vs run time. That macro is being used to speed up the char_trait operations at run time, by using the faster standard library functions. For example char_traits::move now uses "memmove" at runtime, instead of a for loop. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Simplified string logic in AWSMetricsServiceApiTest. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- Code/Framework/AzCore/AzCore/PlatformDef.h | 76 + .../AzCore/AzCore/std/allocator_stateless.cpp | 10 +- .../AzCore/AzCore/std/allocator_stateless.h | 6 +- .../AzCore/std/containers/compressed_pair.h | 17 +- .../AzCore/std/containers/compressed_pair.inl | 4 +- .../AzCore/AzCore/std/string/fixed_string.h | 20 - .../AzCore/AzCore/std/string/fixed_string.inl | 415 +++-- .../AzCore/AzCore/std/string/string.h | 1488 +++++++++-------- .../AzCore/AzCore/std/string/string_view.h | 154 +- .../VisualStudio/AzCore/Natvis/azcore.natvis | 53 +- Code/Framework/AzCore/Tests/AZStd/String.cpp | 914 ++++++---- .../AWSAttributionServiceApiTest.cpp | 9 +- .../Code/Tests/AWSMetricsServiceApiTest.cpp | 7 +- .../Code/Tests/AnimGraphEventTests.cpp | 2 +- .../Code/Tests/AnimGraphRefCountTests.cpp | 2 +- 15 files changed, 1860 insertions(+), 1317 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/PlatformDef.h b/Code/Framework/AzCore/AzCore/PlatformDef.h index 8d28d27959..7f00f7e90e 100644 --- a/Code/Framework/AzCore/AzCore/PlatformDef.h +++ b/Code/Framework/AzCore/AzCore/PlatformDef.h @@ -149,3 +149,79 @@ #if !defined(AZ_COMMAND_LINE_LEN) # define AZ_COMMAND_LINE_LEN 2048 #endif + +#include +#include +#include +#include +#include + +// First check if the feature if is_constant_evaluated is available via the feature test macro +// https://en.cppreference.com/w/User:D41D8CD98F/feature_testing_macros#C.2B.2B20 +#if __cpp_lib_is_constant_evaluated + #define az_builtin_is_constant_evaluated() std::is_constant_evaluated() +#endif + +// Next check if there is a __builtin_is_constant_evaluated that can be used +// This works on MSVC 19.28+ toolsets when using C++17, as well as +// clang 9.0.0+ when using C++17. +// Finally it works on gcc 9.0+ when using C++17 +#if !defined(az_builtin_is_constant_evaluated) + #if defined(__has_builtin) + #if __has_builtin(__builtin_is_constant_evaluated) + #define az_builtin_is_constant_evaluated() __builtin_is_constant_evaluated() + #define az_has_builtin_is_constant_evaluated() true + #endif + #elif AZ_COMPILER_MSVC >= 1928 + #define az_builtin_is_constant_evaluated() __builtin_is_constant_evaluated() + #define az_has_builtin_is_constant_evaluated() true + #elif AZ_COMPILER_GCC + #define az_builtin_is_constant_evaluated() __builtin_is_constant_evaluated() + #define az_has_builtin_is_constant_evaluated() true + #endif +#endif + +// In this case no support for the determining whether an operation is occuring +// at compile time is supported so assume that evaluation is always occuring at compile time +// in order to make sure the "safe" operation is being performed +#if !defined(az_builtin_is_constant_evaluated) + namespace AZ::Internal + { + constexpr bool builtin_is_constant_evaluated() + { + return true; + } + } + #define az_builtin_is_constant_evaluated() AZ::Internal::builtin_is_constant_evaluated() + #define az_has_builtin_is_constant_evaluated() false +#endif + +// define builtin functions used by char_traits class for efficient compile time and runtime +// operations +#if defined(__has_builtin) + #if __has_builtin(__builtin_memcpy) + #define az_has_builtin_memcpy true + #endif + #if __has_builtin(__builtin_wmemcpy) + #define az_has_builtin_wmemcpy true + #endif + #if __has_builtin(__builtin_memmove) + #define az_has_builtin_memmove true + #endif + #if __has_builtin(__builtin_wmemmove) + #define az_has_builtin_wmemmove true + #endif +#endif + +#if !defined(az_has_builtin_memcpy) + #define az_has_builtin_memcpy false +#endif +#if !defined(az_has_builtin_wmemcpy) + #define az_has_builtin_wmemcpy false +#endif +#if !defined(az_has_builtin_memmove) + #define az_has_builtin_memmove false +#endif +#if !defined(az_has_builtin_wmemmove) + #define az_has_builtin_wmemmove false +#endif diff --git a/Code/Framework/AzCore/AzCore/std/allocator_stateless.cpp b/Code/Framework/AzCore/AzCore/std/allocator_stateless.cpp index 5806cc485c..baf650a560 100644 --- a/Code/Framework/AzCore/AzCore/std/allocator_stateless.cpp +++ b/Code/Framework/AzCore/AzCore/std/allocator_stateless.cpp @@ -11,17 +11,17 @@ namespace AZStd { - stateless_allocator::stateless_allocator(const char* name) - : m_name(name) {} + stateless_allocator::stateless_allocator() = default; + stateless_allocator::stateless_allocator(const char*) + {} const char* stateless_allocator::get_name() const { - return m_name; + return "AZStd::stateless_allocator"; } - void stateless_allocator::set_name(const char* name) + void stateless_allocator::set_name(const char*) { - m_name = name; } auto stateless_allocator::allocate(size_type byteSize) -> pointer_type diff --git a/Code/Framework/AzCore/AzCore/std/allocator_stateless.h b/Code/Framework/AzCore/AzCore/std/allocator_stateless.h index b73c680c32..6b78aca53d 100644 --- a/Code/Framework/AzCore/AzCore/std/allocator_stateless.h +++ b/Code/Framework/AzCore/AzCore/std/allocator_stateless.h @@ -26,7 +26,8 @@ namespace AZStd using difference_type = ptrdiff_t; using allow_memory_leaks = AZStd::true_type; - stateless_allocator(const char* name = "AZStd::stateless_allocator"); + stateless_allocator(); + explicit stateless_allocator(const char*); // Stateless allocator does not store a name stateless_allocator(const stateless_allocator& rhs) = default; stateless_allocator& operator=(const stateless_allocator& rhs) = default; @@ -51,9 +52,6 @@ namespace AZStd bool is_lock_free(); bool is_stale_read_allowed(); bool is_delayed_recycling(); - - private: - const char* m_name; }; bool operator==(const stateless_allocator& left, const stateless_allocator& right); diff --git a/Code/Framework/AzCore/AzCore/std/containers/compressed_pair.h b/Code/Framework/AzCore/AzCore/std/containers/compressed_pair.h index 066ec7be5e..c79ddf11ee 100644 --- a/Code/Framework/AzCore/AzCore/std/containers/compressed_pair.h +++ b/Code/Framework/AzCore/AzCore/std/containers/compressed_pair.h @@ -8,6 +8,7 @@ #pragma once #include +#include #include /* Microsoft C++ ABI puts 1 byte of padding between each empty base class when multiple inheritance is being used @@ -20,7 +21,7 @@ #if defined(AZ_COMPILER_MSVC) #define AZSTD_COMPRESSED_PAIR_EMPTY_BASE_OPTIMIZATION __declspec(empty_bases) #else -#define AZSTD_COMPRESSED_PAIR_EMPTY_BASE_OPTIMIZATION +#define AZSTD_COMPRESSED_PAIR_EMPTY_BASE_OPTIMIZATION #endif namespace AZStd @@ -97,16 +98,14 @@ namespace AZStd using second_base_value_type = typename second_base_type::value_type; public: - // First template argument is a placeholder argument of void as MSVC examines the types - // of a templated function to determine if they are the same template - // Due to the "template compressed_pair(skip_element_tag, T&&)" - // constructor below, the default constructor template types needs to be distinguished from it - template ::value - && AZStd::is_default_constructible::value>> + // First template argument is used to perform a substitution into AZStd::enable_if_t + // so that SFINAE can trigger + template + && AZStd::is_default_constructible_v, Unused>> constexpr compressed_pair(); - template , compressed_pair>::value, bool> = true> + template , compressed_pair>, bool> = true> constexpr explicit compressed_pair(T&& firstElement); template diff --git a/Code/Framework/AzCore/AzCore/std/containers/compressed_pair.inl b/Code/Framework/AzCore/AzCore/std/containers/compressed_pair.inl index 9fb5eb87fb..8e585a1467 100644 --- a/Code/Framework/AzCore/AzCore/std/containers/compressed_pair.inl +++ b/Code/Framework/AzCore/AzCore/std/containers/compressed_pair.inl @@ -75,7 +75,7 @@ namespace AZStd } template - template , compressed_pair>::value, bool>> + template , compressed_pair>, bool>> inline constexpr compressed_pair::compressed_pair(T&& firstElement) : first_base_type{ AZStd::forward(firstElement) } , second_base_type{} @@ -117,7 +117,7 @@ namespace AZStd { return static_cast(*this).get(); } - + template inline constexpr auto compressed_pair::second() -> second_base_value_type& { diff --git a/Code/Framework/AzCore/AzCore/std/string/fixed_string.h b/Code/Framework/AzCore/AzCore/std/string/fixed_string.h index a8e0f96988..ea841bc4ca 100644 --- a/Code/Framework/AzCore/AzCore/std/string/fixed_string.h +++ b/Code/Framework/AzCore/AzCore/std/string/fixed_string.h @@ -343,26 +343,6 @@ namespace AZStd static decltype(auto) format(const wchar_t* format, ...); protected: - template - constexpr auto append_iter(InputIt first, InputIt last) - -> enable_if_t && !is_convertible_v, basic_fixed_string&>; - - template - constexpr auto construct_iter(InputIt first, InputIt last) - -> enable_if_t && !is_convertible_v>; - - template - constexpr auto assign_iter(InputIt first, InputIt last) - -> enable_if_t && !is_convertible_v, basic_fixed_string&>; - - template - constexpr auto insert_iter(const_iterator insertPos, InputIt first, InputIt last) - -> enable_if_t && !is_convertible_v, iterator>; - - template - constexpr auto replace_iter(const_iterator first, const_iterator last, InputIt first2, InputIt last2) - -> enable_if_t && !is_convertible_v, basic_fixed_string&>; - constexpr auto fits_in_capacity(size_type newSize) -> bool; inline static constexpr size_type Capacity = MaxElementCount; // current storage reserved for string not including null-terminator diff --git a/Code/Framework/AzCore/AzCore/std/string/fixed_string.inl b/Code/Framework/AzCore/AzCore/std/string/fixed_string.inl index 8b973d3b2c..15d2acf7a1 100644 --- a/Code/Framework/AzCore/AzCore/std/string/fixed_string.inl +++ b/Code/Framework/AzCore/AzCore/std/string/fixed_string.inl @@ -62,14 +62,7 @@ namespace AZStd template inline constexpr basic_fixed_string::basic_fixed_string(InputIt first, InputIt last) { // construct from [first, last) - if (first == last) - { - Traits::assign(m_buffer[0], Element()); // terminate - } - else - { - construct_iter(first, last); - } + assign(first, last); } // #7 @@ -98,8 +91,7 @@ namespace AZStd template inline constexpr basic_fixed_string::basic_fixed_string(const T& convertibleToView) { - AZStd::basic_string_view view = convertibleToView; - assign(view.begin(), view.end()); + assign(convertibleToView); } // #11 @@ -313,15 +305,7 @@ namespace AZStd if (count > 0 && fits_in_capacity(num)) { pointer data = m_buffer; - // make room and append new stuff using assign - if (count == 1) - { - Traits::assign(*(data + m_size), ch); - } - else - { - Traits::assign(data + m_size, count, ch); - } + Traits::assign(data + m_size, count, ch); m_size = static_cast(num); Traits::assign(data[num], Element()); // terminate } @@ -332,13 +316,47 @@ namespace AZStd template inline constexpr auto basic_fixed_string::append(InputIt first, InputIt last) -> enable_if_t && !is_convertible_v, basic_fixed_string&> - { // append [first, last) - return append_iter(first, last); + { + if constexpr (Internal::satisfies_contiguous_iterator_concept_v + && is_same_v::value_type, value_type>) + { + return append(AZStd::to_address(first), AZStd::distance(first, last)); + } + else if constexpr (Internal::is_forward_iterator_v) + { + // Input Iterator pointer type doesn't match the const_pointer type + // So the elements need to be appended one by one into the buffer + size_type newSize = m_size + AZStd::distance(first, last); + if (fits_in_capacity(newSize)) + { + for (size_t updateIndex = m_size; first != last; ++first, ++updateIndex) + { + Traits::assign(m_buffer[updateIndex], static_cast(*first)); + } + m_size = static_cast(newSize); + Traits::assign(m_buffer[newSize], Element()); // terminate + } + return *this; + } + else + { + // input iterator that aren't forward iterators can only be used in a single pass + // algorithm. Therefore AZStd::distance can't be used + // So the input is copied into a local string and then delegated + // to use the (const_pointer, size_type) overload + basic_fixed_string inputCopy; + for (; first != last; ++first) + { + inputCopy.push_back(static_cast(*first)); + } + + return append(inputCopy.c_str(), inputCopy.size()); + } } template inline constexpr auto basic_fixed_string::append(AZStd::initializer_list ilist) -> basic_fixed_string& - { // append [first, last) - return append_iter(ilist.begin(), ilist.end()); + { + return append(ilist.begin(), ilist.size()); } template @@ -420,18 +438,10 @@ namespace AZStd inline constexpr auto basic_fixed_string::assign(size_type count, Element ch) -> basic_fixed_string& { // assign count * ch - AZSTD_CONTAINER_ASSERT(count != npos, "result is too long!"); if (fits_in_capacity(count)) { // make room and assign new stuff pointer data = m_buffer; - if (count == 1) - { - Traits::assign(*(data), ch); - } - else - { - Traits::assign(data, count, ch); - } + Traits::assign(data, count, ch); m_size = static_cast(count); Traits::assign(data[count], Element()); // terminate } @@ -443,12 +453,46 @@ namespace AZStd inline constexpr auto basic_fixed_string::assign(InputIt first, InputIt last) -> enable_if_t && !is_convertible_v, basic_fixed_string&> { - return assign_iter(first, last); + if constexpr (Internal::satisfies_contiguous_iterator_concept_v + && is_same_v::value_type, value_type>) + { + return assign(AZStd::to_address(first), AZStd::distance(first, last)); + } + else if constexpr (Internal::is_forward_iterator_v) + { + // Input Iterator pointer type doesn't match the const_pointer type + // So the elements need to be assigned one by one into the buffer + size_type newSize = AZStd::distance(first, last); + if (fits_in_capacity(newSize)) + { + for (size_t updateIndex = 0; first != last; ++first, ++updateIndex) + { + Traits::assign(m_buffer[updateIndex], static_cast(*first)); + } + m_size = static_cast(newSize); + Traits::assign(m_buffer[newSize], Element()); // terminate + } + return *this; + } + else + { + // input iterator that aren't forward iterators can only be used in a single pass + // algorithm. Therefore AZStd::distance can't be used + // So the input is copied into a local string and then delegated + // to use the (const_pointer, size_type) overload + basic_fixed_string inputCopy; + for (; first != last; ++first) + { + inputCopy.push_back(static_cast(*first)); + } + + return assign(inputCopy.c_str(), inputCopy.size()); + } } template inline constexpr auto basic_fixed_string::assign(AZStd::initializer_list ilist) -> basic_fixed_string& { - return assign_iter(ilist.begin(), ilist.end()); + return assign(ilist.begin(), ilist.size()); } template @@ -536,14 +580,7 @@ namespace AZStd pointer data = m_buffer; // make room and insert new stuff Traits::copy_backward(data + offset + count, data + offset, m_size - offset); // empty out hole - if (count == 1) - { - Traits::assign(*(data + offset), ch); - } - else - { - Traits::assign(data + offset, count, ch); - } + Traits::assign(data + offset, count, ch); m_size = static_cast(num); Traits::assign(data[num], Element()); // terminate } @@ -582,14 +619,51 @@ namespace AZStd inline constexpr auto basic_fixed_string::insert(const_iterator insertPos, InputIt first, InputIt last)-> enable_if_t && !is_convertible_v, iterator> { // insert [_First, _Last) at _Where - return insert_iter(insertPos, first, last); + size_type insertOffset = AZStd::distance(cbegin(), insertPos); + if constexpr (Internal::satisfies_contiguous_iterator_concept_v + && is_same_v::value_type, value_type>) + { + insert(insertOffset, AZStd::to_address(first), AZStd::distance(first, last)); + } + else if constexpr (Internal::is_forward_iterator_v) + { + // Input Iterator pointer type doesn't match the const_pointer type + // So the elements need to be inserted one by one into the buffer + size_type count = AZStd::distance(first, last); + size_type newSize = m_size + count; + if (fits_in_capacity(newSize)) + { + Traits::copy_backward(m_buffer + insertOffset + count, m_buffer + insertOffset, m_size - insertOffset); // empty out hole + for (size_t updateIndex = insertOffset; first != last; ++first, ++updateIndex) + { + Traits::assign(m_buffer[updateIndex], static_cast(*first)); + } + m_size = static_cast(newSize); + Traits::assign(m_buffer[newSize], Element()); // terminate + } + } + else + { + // input iterator that aren't forward iterators can only be used in a single pass + // algorithm. Therefore AZStd::distance can't be used + // So the input is copied into a local string and then delegated + // to use the (const_pointer, size_type) overload + basic_fixed_string inputCopy; + for (; first != last; ++first) + { + inputCopy.push_back(static_cast(*first)); + } + + insert(insertOffset, inputCopy.c_str(), inputCopy.size()); + } + return begin() + insertOffset; } template inline constexpr auto basic_fixed_string::insert(const_iterator insertPos, AZStd::initializer_list ilist) -> iterator { // insert [_First, _Last) at _Where - return insert_iter(insertPos, ilist.begin(), ilist.end()); + return insert(insertPos, ilist.begin(), ilist.end()); } template @@ -604,7 +678,7 @@ namespace AZStd { // move elements down pointer data = m_buffer; - Traits::copy(data + offset, data + offset + count, m_size - offset - count); + Traits::move(data + offset, data + offset + count, m_size - offset - count); m_size = static_cast(m_size - count); Traits::assign(data[m_size], Element()); // terminate } @@ -643,7 +717,7 @@ namespace AZStd const basic_fixed_string& rhs) -> basic_fixed_string& { // replace [offset, offset + count) with rhs - return replace(offset, count, rhs, size_type(0), npos); + return replace(offset, count, rhs.c_str(), rhs.size()); } template @@ -651,56 +725,7 @@ namespace AZStd const basic_fixed_string& rhs, size_type rhsOffset, size_type rhsCount) -> basic_fixed_string& { // replace [offset, offset + count) with rhs [rhsOffset, rhsOffset + rhsCount) - AZSTD_CONTAINER_ASSERT(m_size >= offset && rhs.m_size >= rhsOffset, "Invalid offsets"); - if (m_size - offset < count) - { - count = m_size - offset; // trim count to size - } - size_type num = rhs.m_size - rhsOffset; - if (num < rhsCount) - { - rhsCount = num; // trim rhsCount to size - } - AZSTD_CONTAINER_ASSERT(npos - rhsCount > m_size - count, "Result is too long"); - - size_type nm = m_size - count - offset; // length of preserved tail - size_type newSize = m_size + rhsCount - count; - if (fits_in_capacity(newSize)) - { - pointer data = m_buffer; - const_pointer rhsData = rhs.m_buffer; - - if (this != &rhs) - { // no overlap, just move down and copy in new stuff - Traits::copy_backward(data + offset + rhsCount, data + offset + count, nm); // empty hole - Traits::copy(data + offset, rhsData + rhsOffset, rhsCount); // fill hole - } - else if (rhsCount <= count) - { // hole doesn't get larger, just copy in substring - Traits::copy(data + offset, data + rhsOffset, rhsCount); // fill hole - Traits::copy_backward(data + offset + rhsCount, data + offset + count, nm); // move tail down - } - else if (rhsOffset <= offset) - { // hole gets larger, substring begins before hole - Traits::copy_backward(data + offset + rhsCount, data + offset + count, nm); // move tail down - Traits::copy(data + offset, data + rhsOffset, rhsCount); // fill hole - } - else if (offset + count <= rhsOffset) - { // hole gets larger, substring begins after hole - Traits::copy_backward(data + offset + rhsCount, data + offset + count, nm); // move tail down - Traits::copy(data + offset, data + (rhsOffset + rhsCount - count), rhsCount); // fill hole - } - else - { // hole gets larger, substring begins in hole - Traits::copy(data + offset, data + rhsOffset, count); // fill old hole - Traits::copy_backward(data + offset + rhsCount, data + offset + count, nm); // move tail down - Traits::copy(data + offset + count, data + rhsOffset + rhsCount, rhsCount - count); // fill rest of new hole - } - - m_size = static_cast(newSize); - Traits::assign(data[newSize], Element()); // terminate - } - return *this; + return replace(offset, count, rhs.c_str() + rhsOffset, AZStd::min(rhsCount, rhs.size() - rhsOffset)); } template template @@ -720,35 +745,83 @@ namespace AZStd pointer data = m_buffer; // replace [offset, offset + count) with [ptr, ptr + ptrCount) AZSTD_CONTAINER_ASSERT(m_size >= offset, "Invalid offset"); - if (m_size - offset < count) - { - count = m_size - offset; // trim _N0 to size - } - AZSTD_CONTAINER_ASSERT(npos - ptrCount > m_size - count, "Result too long"); + // Make sure count is within is no larger than the distance from the offset + // to the end of this string + count = AZStd::min(count, m_size - offset); - size_type nm = m_size - count - offset; - if (ptrCount < count) - { - Traits::copy(data + offset + ptrCount, data + offset + count, nm); // smaller hole, move tail up - } - size_type num = m_size + ptrCount - count; - if ((0 != ptrCount || 0 != count) && fits_in_capacity(num)) + size_type newSize = m_size + ptrCount - count; + if (fits_in_capacity(newSize)) { - data = m_buffer; - // make room and rearrange - if (count < ptrCount) + // The code assumes that compile time evaluation will not need to deal with overlapping input + size_type charsAfterCountToMove = m_size - count - offset; + if (az_builtin_is_constant_evaluated() || !((ptr >= data + offset && ptr < data + offset + count) + || (ptr + ptrCount > data + offset && ptr + ptrCount <= data + offset + count))) { - Traits::copy_backward(data + offset + ptrCount, data + offset + count, nm); // move tail down + // Ex1. this = "ABCDEFG", offset = 1, count = 4 + // Input string is "CDE" + // First the text post offset + count is moved to right after the input string will be copied + // "ABCDFG" + // ^^^ + // Next the input string is copied into the buffer + // "ACDEFG" + // + // Ex2. this = "ABCDEFG", offset = 1, count = 2 + // Input string is "CDE" + // Performing the same two steps above, the string transform as follows + // "ABCDEFG" -> "ABCDDEFG" -> "ACDEDEFG" + // ^^^ + if (count != ptrCount) + { + Traits::move(data + offset + ptrCount, data + offset + count, charsAfterCountToMove); + } + if (ptrCount > 0) + { + // Copy bytes up to the minimum of this string count and input string count + Traits::copy(data + offset, ptr, ptrCount); + } } - - if (ptrCount > 0) + else { - Traits::copy(data + offset, ptr, ptrCount); // fill hole + // Overlap checks for fixed_string only needs to check between this string + // [offset, offset + count) due to fixed_string never moving memory + // + // Ex. this = "ABCDEFG", offset = 1, count=4 + // substring is "CDE" + // The text from offset 1 for 4 chars "BCDE": should be replaced with "CDE" + // making a whole for the bytes results in output = "ABCDFG" + // Afterwards output = "ACDEFG" + // The input string overlaps with this string in this case + // So the string is copied piecewise + if (ptrCount <= count) + { // hole doesn't get larger, just copy in substring + Traits::move(data + offset, ptr, ptrCount); // fill hole + Traits::copy(data + offset + ptrCount, data + offset + count, charsAfterCountToMove); // move tail down + } + else + { + if (ptr <= data + offset) + { // hole gets larger, substring begins before hole + Traits::copy_backward(data + offset + ptrCount, data + offset + count, charsAfterCountToMove); // move tail down + Traits::copy(data + offset, ptr, ptrCount); // fill hole + } + else if (data + offset + count <= ptr) + { // hole gets larger, substring begins after hole + Traits::copy_backward(data + offset + ptrCount, data + offset + count, charsAfterCountToMove); // move tail down + Traits::copy(data + offset, ptr + (ptrCount - count), ptrCount); // fill hole + } + else + { // hole gets larger, substring begins in hole + Traits::copy(data + offset, ptr, count); // fill old hole + Traits::copy_backward(data + offset + ptrCount, data + offset + count, charsAfterCountToMove); // move tail down + Traits::copy(data + offset + count, ptr + ptrCount, ptrCount - count); // fill rest of new hole + } + } } - - m_size = static_cast(num); - Traits::assign(data[num], Element()); // terminate } + + m_size = static_cast(newSize); + Traits::assign(data[newSize], Element()); // terminate + return *this; } @@ -793,14 +866,7 @@ namespace AZStd { Traits::copy_backward(data + offset + num, data + offset + count, nm); // move tail down } - if (count == 1) - { - Traits::assign(*(data + offset), ch); - } - else - { - Traits::assign(data + offset, num, ch); - } + Traits::assign(data + offset, num, ch); m_size = static_cast(numToGrow); Traits::assign(data[numToGrow], Element()); // terminate } @@ -851,15 +917,54 @@ namespace AZStd template template inline constexpr auto basic_fixed_string::replace(const_iterator first, const_iterator last, - InputIt first2, InputIt last2) -> enable_if_t && !is_convertible_v, basic_fixed_string&> - { // replace [first, last) with [first2,last2) - return replace_iter(first, last, first2, last2); + InputIt replaceFirst, InputIt replaceLast) -> enable_if_t && !is_convertible_v, basic_fixed_string&> + { // replace [first, last) with [replaceFirst,replaceLast) + if constexpr (Internal::satisfies_contiguous_iterator_concept_v + && is_same_v::value_type, value_type>) + { + return replace(first, last, AZStd::to_address(replaceFirst), AZStd::distance(replaceFirst, replaceLast)); + } + else if constexpr (Internal::is_forward_iterator_v) + { + // Input Iterator pointer type doesn't match the const_pointer type + // So the elements need to be appended one by one into the buffer + + size_type insertOffset = AZStd::distance(cbegin(), first); + size_type postInsertOffset = AZStd::distance(cbegin(), last); + size_type count = AZStd::distance(replaceFirst, replaceLast); + size_type newSize = m_size + count - AZStd::distance(first, last); + if (fits_in_capacity(newSize)) + { + Traits::move(first + count, last, m_size - postInsertOffset); // empty out hole + for (size_t updateIndex = insertOffset; replaceFirst != replaceLast; ++replaceFirst, ++updateIndex) + { + Traits::assign(m_buffer[updateIndex], static_cast(*replaceFirst)); + } + m_size = static_cast(newSize); + Traits::assign(m_buffer[newSize], Element()); // terminate + } + return *this; + } + else + { + // input iterator that aren't forward iterators can only be used in a single pass + // algorithm. Therefore AZStd::distance can't be used + // So the input is copied into a local string and then delegated + // to use the (const_pointer, size_type) overload + basic_fixed_string inputCopy; + for (; replaceFirst != replaceLast; ++replaceFirst) + { + inputCopy.push_back(static_cast(*replaceFirst)); + } + + return replace(first, last, inputCopy.c_str(), inputCopy.size()); + } } template inline constexpr auto basic_fixed_string::replace(const_iterator first, const_iterator last, AZStd::initializer_list ilist) -> basic_fixed_string& - { // replace [first, last) with [first2,last2) - return replace_iter(first, last, ilist.begin(), ilist.end()); + { + return replace(first, last, ilist.begin(), ilist.end()); } template @@ -1411,54 +1516,6 @@ namespace AZStd return result; } - template - template - inline constexpr auto basic_fixed_string::construct_iter(InputIt first, InputIt last) - -> enable_if_t && !is_convertible_v> - { - // initialize from [first, last), input iterators - for (; first != last; ++first) - { - append((size_type)1, (Element)* first); - } - } - - template - template - inline constexpr auto basic_fixed_string::append_iter(InputIt first, InputIt last) - -> enable_if_t && !is_convertible_v, basic_fixed_string&> - { // append [first, last), input iterators - return replace(end(), end(), first, last); - } - - template - template - inline constexpr auto basic_fixed_string::assign_iter(InputIt first, InputIt last) - -> enable_if_t && !is_convertible_v, basic_fixed_string&> - { - return replace(begin(), end(), first, last); - } - - template - template - inline constexpr auto basic_fixed_string::insert_iter(const_iterator insertPos, InputIt first, - InputIt last) -> enable_if_t && !is_convertible_v, iterator> - { // insert [first, last) at insertPos, input iterators - difference_type offset = insertPos - cbegin(); - replace(insertPos, insertPos, first, last); - return iterator(m_buffer + offset); - } - - template - template - inline constexpr auto basic_fixed_string::replace_iter(const_iterator first, const_iterator last, - InputIt first2, InputIt last2) -> enable_if_t && !is_convertible_v, basic_fixed_string&> - { // replace [first, last) with [first2, last2), input iterators - basic_fixed_string rhs(first2, last2); - replace(first, last, rhs); - return *this; - } - template inline constexpr auto basic_fixed_string::fits_in_capacity(size_type newSize)-> bool { diff --git a/Code/Framework/AzCore/AzCore/std/string/string.h b/Code/Framework/AzCore/AzCore/std/string/string.h index e107c4657d..7dd6dd7065 100644 --- a/Code/Framework/AzCore/AzCore/std/string/string.h +++ b/Code/Framework/AzCore/AzCore/std/string/string.h @@ -5,24 +5,43 @@ * SPDX-License-Identifier: Apache-2.0 OR MIT * */ -#ifndef AZSTD_STRING_H -#define AZSTD_STRING_H +#pragma once #include #include #include #include +#include #include #include #include #include #include -#include #include #include +namespace AZStd::StringInternal +{ + template + struct Padding + { + AZ::u8 m_padding[ElementSize - 1]; + }; + + template + struct Padding + {}; +} + +#if defined(HAVE_BENCHMARK) +namespace Benchmark +{ + class StringBenchmarkFixture; +} +#endif + namespace AZStd { /** @@ -35,130 +54,95 @@ namespace AZStd : public Debug::checked_container_base #endif { - typedef basic_string this_type; + using this_type = basic_string; public: - typedef Element* pointer; - typedef const Element* const_pointer; + using pointer = Element*; + using const_pointer = const Element*; - typedef Element& reference; - typedef const Element& const_reference; - typedef typename Allocator::difference_type difference_type; - typedef typename Allocator::size_type size_type; + using reference = Element&; + using const_reference = const Element&; + using difference_type = typename Allocator::difference_type; + using size_type = typename Allocator::size_type; - typedef pointer iterator_impl; - typedef const_pointer const_iterator_impl; + using iterator_impl = pointer; + using const_iterator_impl = const_pointer; #ifdef AZSTD_HAS_CHECKED_ITERATORS - typedef Debug::checked_randomaccess_iterator iterator; - typedef Debug::checked_randomaccess_iterator const_iterator; + using iterator = Debug::checked_randomaccess_iterator; + using const_iterator = Debug::checked_randomaccess_iterator; #else - typedef iterator_impl iterator; - typedef const_iterator_impl const_iterator; + using iterator = iterator_impl; + using const_iterator = const_iterator_impl; #endif - typedef AZStd::reverse_iterator reverse_iterator; - typedef AZStd::reverse_iterator const_reverse_iterator; - typedef Element value_type; - typedef Traits traits_type; - typedef Allocator allocator_type; + using reverse_iterator = AZStd::reverse_iterator; + using const_reverse_iterator = AZStd::reverse_iterator; + using value_type = Element; + using traits_type = Traits; + using allocator_type = Allocator; // AZSTD extension. /** * \brief Allocation node type. Common for all AZStd containers. * In vectors case we allocate always "sizeof(node_type)*capacity" block. */ - typedef value_type node_type; + using node_type = value_type; - static const size_type npos = size_type(-1); + inline static constexpr size_type npos = size_type(-1); inline basic_string(const Allocator& alloc = Allocator()) - : m_size(0) - , m_capacity(SSO_BUF_SIZE - 1) - , m_allocator(alloc) + : m_storage{ skip_element_tag{}, alloc } { - Traits::assign(m_buffer[0], Element()); + Traits::assign(m_storage.first().GetData()[0], Element()); } inline basic_string(const_pointer ptr, size_type count, const Allocator& alloc = Allocator()) - : m_size(0) - , m_capacity(SSO_BUF_SIZE - 1) - , m_allocator(alloc) + : m_storage{ skip_element_tag{}, alloc } { // construct from [ptr, ptr + count) assign(ptr, count); } inline basic_string(const_pointer ptr, const Allocator& alloc = Allocator()) - : m_size(0) - , m_capacity(SSO_BUF_SIZE - 1) - , m_allocator(alloc) + : m_storage{ skip_element_tag{}, alloc } { // construct from [ptr, ) assign(ptr); } inline basic_string(size_type count, Element ch, const Allocator& alloc = Allocator()) - : m_size(0) - , m_capacity(SSO_BUF_SIZE - 1) - , m_allocator(alloc) + : m_storage{ skip_element_tag{}, alloc } { // construct from count * ch assign(count, ch); } - template - inline basic_string(InputIterator first, InputIterator last, const Allocator& alloc = Allocator()) - : m_size(0) - , m_capacity(SSO_BUF_SIZE - 1) - , m_allocator(alloc) + template && !is_convertible_v>> + inline basic_string(InputIt first, InputIt last, const Allocator& alloc = Allocator()) + : m_storage{ skip_element_tag{}, alloc } { // construct from [first, last) - if (first == last) - { - Traits::assign(m_buffer[0], Element()); // terminate - } - else - { - construct_iter(first, last, is_integral()); - } + assign(first, last); } inline basic_string(const_pointer first, const_pointer last) - : m_size(0) - , m_capacity(SSO_BUF_SIZE - 1) { // construct from [first, last), const pointers - assign(&*first, last - first); + assign(first, last - first); } - //inline basic_string(const_iterator _First, const_iterator _Last) - // : m_size(0) - // , m_capacity(SSO_BUF_SIZE-1) - //{ // construct from [_First, _Last), const_iterators - // if (first != last) - // assign(&*first, last - first); - //} - inline basic_string(const this_type& rhs) - : m_size(0) - , m_capacity(SSO_BUF_SIZE - 1) - , m_allocator(rhs.m_allocator) + : m_storage{ skip_element_tag{}, rhs.m_storage.second() } { assign(rhs, 0, npos); } inline basic_string(this_type&& rhs) - : m_size(0) - , m_capacity(SSO_BUF_SIZE - 1) - , m_allocator(AZStd::move(rhs.m_allocator)) + : m_storage{ skip_element_tag{}, AZStd::move(rhs.m_storage.second()) } { assign(AZStd::forward(rhs)); } inline basic_string(const this_type& rhs, size_type rhsOffset, size_type count = npos) - : m_size(0) - , m_capacity(SSO_BUF_SIZE - 1) { // construct from rhs [rhsOffset, rhsOffset + count) assign(rhs, rhsOffset, count); } inline basic_string(const this_type& rhs, size_type rhsOffset, size_type count, const Allocator& alloc) - : m_size(0) - , m_capacity(SSO_BUF_SIZE - 1) - , m_allocator(alloc) + : m_storage{ skip_element_tag{}, alloc } { // construct from rhs [rhsOffset, rhsOffset + count) with allocator assign(rhs, rhsOffset, count); } @@ -174,7 +158,7 @@ namespace AZStd inline ~basic_string() { // destroy the string - deallocate_memory(m_data, 0, typename allocator_type::allow_memory_leaks()); + deallocate_memory(m_storage.first().GetData(), 0, typename allocator_type::allow_memory_leaks()); } operator AZStd::basic_string_view() const @@ -182,12 +166,12 @@ namespace AZStd return AZStd::basic_string_view(data(), size()); } - inline iterator begin() { return iterator(AZSTD_CHECKED_ITERATOR(iterator_impl, SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer)); } - inline const_iterator begin() const { return const_iterator(AZSTD_CHECKED_ITERATOR(const_iterator_impl, SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer)); } - inline const_iterator cbegin() const { return const_iterator(AZSTD_CHECKED_ITERATOR(const_iterator_impl, SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer)); } - inline iterator end() { return iterator(AZSTD_CHECKED_ITERATOR(iterator_impl, (SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer) + m_size)); } - inline const_iterator end() const { return const_iterator(AZSTD_CHECKED_ITERATOR(const_iterator_impl, (SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer) + m_size)); } - inline const_iterator cend() const { return const_iterator(AZSTD_CHECKED_ITERATOR(const_iterator_impl, (SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer) + m_size)); } + inline iterator begin() { return iterator(AZSTD_CHECKED_ITERATOR(iterator_impl, m_storage.first().GetData())); } + inline const_iterator begin() const { return const_iterator(AZSTD_CHECKED_ITERATOR(const_iterator_impl, m_storage.first().GetData())); } + inline const_iterator cbegin() const { return const_iterator(AZSTD_CHECKED_ITERATOR(const_iterator_impl, m_storage.first().GetData())); } + inline iterator end() { return iterator(AZSTD_CHECKED_ITERATOR(iterator_impl, (m_storage.first().GetData()) + m_storage.first().GetSize())); } + inline const_iterator end() const { return const_iterator(AZSTD_CHECKED_ITERATOR(const_iterator_impl, (m_storage.first().GetData()) + m_storage.first().GetSize())); } + inline const_iterator cend() const { return const_iterator(AZSTD_CHECKED_ITERATOR(const_iterator_impl, (m_storage.first().GetData()) + m_storage.first().GetSize())); } inline reverse_iterator rbegin() { return reverse_iterator(end()); } inline const_reverse_iterator rbegin() const { return const_reverse_iterator(end()); } inline const_reverse_iterator crbegin() const { return const_reverse_iterator(end()); } @@ -196,7 +180,7 @@ namespace AZStd inline const_reverse_iterator crend() const { return const_reverse_iterator(begin()); } inline this_type& operator=(const this_type& rhs) { return assign(rhs); } - inline this_type& operator=(this_type&& rhs) { return assign(AZStd::forward(rhs)); } + inline this_type& operator=(this_type&& rhs) { return assign(AZStd::move(rhs)); } inline this_type& operator=(AZStd::basic_string_view view) { return assign(view); } inline this_type& operator=(const_pointer ptr) { return assign(ptr); } inline this_type& operator=(Element ch) { return assign(1, ch); } @@ -208,21 +192,18 @@ namespace AZStd this_type& append(const this_type& rhs, size_type rhsOffset, size_type count) { // append rhs [rhsOffset, rhsOffset + count) AZSTD_CONTAINER_ASSERT(rhs.size() >= rhsOffset, "Invalid offset!"); - size_type num = rhs.m_size - rhsOffset; - if (num < count) - { - count = num; // trim count to size - } - AZSTD_CONTAINER_ASSERT(npos - m_size > count && m_size + count >= m_size, "result is too long!"); - num = m_size + count; - if (count > 0 && grow(num)) + count = AZStd::min(count, rhs.size() - rhsOffset); + + size_type oldSize = size(); + size_type newSize = oldSize + count; + if (count > 0 && grow(newSize)) { - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - const_pointer rhsData = SSO_BUF_SIZE <= rhs.m_capacity ? rhs.m_data : rhs.m_buffer; + pointer data = m_storage.first().GetData(); + const_pointer rhsData = rhs.data(); // make room and append new stuff - Traits::copy(data + m_size /*, m_capacity - m_size*/, rhsData + rhsOffset, count); - m_size = num; - Traits::assign(data[num], Element()); // terminate + Traits::copy(data + oldSize, rhsData + rhsOffset, count); + m_storage.first().SetSize(newSize); + Traits::assign(data[newSize], Element()); // terminate } return *this; } @@ -230,20 +211,21 @@ namespace AZStd this_type& append(const_pointer ptr, size_type count) { // append [ptr, ptr + count) - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - if (ptr != 0 && ptr >= data && (data + m_size) > ptr) + pointer data = m_storage.first().GetData(); + if (ptr != nullptr && ptr >= data && (data + size()) > ptr) { return append(*this, ptr - data, count); // substring } - AZSTD_CONTAINER_ASSERT(npos - m_size > count && m_size + count >= m_size, "result is too long!"); - size_type num = m_size + count; - if (count > 0 && grow(num)) + AZSTD_CONTAINER_ASSERT(npos - size() > count && size() + count >= size(), "result is too long!"); + size_type oldSize = size(); + size_type newSize = oldSize + count; + if (count > 0 && grow(newSize)) { // make room and append new stuff - data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - Traits::copy(data + m_size /*, m_capacity - m_size*/, ptr, count); - m_size = num; - Traits::assign(data[num], Element()); // terminate + data = m_storage.first().GetData(); + Traits::copy(data + oldSize , ptr, count); + m_storage.first().SetSize(newSize); + Traits::assign(data[newSize], Element()); // terminate } return *this; } @@ -252,30 +234,60 @@ namespace AZStd this_type& append(size_type count, Element ch) { // append count * ch - AZSTD_CONTAINER_ASSERT(npos - m_size > count, "result is too long"); - size_type num = m_size + count; + AZSTD_CONTAINER_ASSERT(npos - size() > count, "result is too long"); + size_type num = size() + count; if (count > 0 && grow(num)) { - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + pointer data = m_storage.first().GetData(); // make room and append new stuff using assign - if (count == 1) - { - Traits::assign(*(data + m_size), ch); - } - else - { - Traits::assign(data + m_size, count, ch); - } - m_size = num; + Traits::assign(data + size(), count, ch); + m_storage.first().SetSize(num); Traits::assign(data[num], Element()); // terminate } return *this; } - template - inline this_type& append(InputIterator first, InputIterator last) + template + inline auto append(InputIt first, InputIt last) + -> enable_if_t && !is_convertible_v, this_type&> { // append [first, last) - return append_iter(first, last, AZStd::is_integral()); + if constexpr (Internal::satisfies_contiguous_iterator_concept_v + && is_same_v::value_type, value_type>) + { + return append(AZStd::to_address(first), AZStd::distance(first, last)); + } + else if constexpr (Internal::is_forward_iterator_v) + { + // Input Iterator pointer type doesn't match the const_pointer type + // So the elements need to be appended one by one into the buffer + size_type oldSize = size(); + size_type newSize = oldSize + AZStd::distance(first, last); + if (grow(newSize)) + { + pointer buffer = data(); + for (size_t updateIndex = oldSize; first != last; ++first, ++updateIndex) + { + Traits::assign(buffer[updateIndex], static_cast(*first)); + } + m_storage.first().SetSize(newSize); + Traits::assign(buffer[newSize], Element()); // terminate + } + return *this; + } + else + { + // input iterator that aren't forward iterators can only be used in a single pass + // algorithm. Therefore AZStd::distance can't be used + // So the input is copied into a local string and then delegated + // to use the (const_pointer, size_type) overload + basic_string inputCopy; + for (; first != last; ++first) + { + inputCopy.push_back(static_cast(*first)); + } + + return append(inputCopy.c_str(), inputCopy.size()); + } } inline this_type& append(const_pointer first, const_pointer last) @@ -283,11 +295,6 @@ namespace AZStd return replace(end(), end(), first, last); } - //inline this_type& append(const_iterator first, const_iterator last) - //{ // append [first, last), const_iterators - // return replace(end(), end(), first, last); - //} - inline this_type& assign(const this_type& rhs) { return assign(rhs, 0, npos); @@ -302,27 +309,34 @@ namespace AZStd { if (this != &rhs) { - if (SSO_BUF_SIZE <= m_capacity) + deallocate_memory(m_storage.first().GetData(), 0, typename allocator_type::allow_memory_leaks()); + + m_storage.first().SetCapacity(rhs.capacity()); + + pointer data = m_storage.first().GetData(); + pointer rhsData = rhs.data(); + // Memmove the right hand side string data if it is using the short string optimization + // Otherwise set the pointer to the right hand side + if (rhs.m_storage.first().ShortStringOptimizationActive()) { - deallocate_memory(m_data, 0, typename allocator_type::allow_memory_leaks()); + Traits::move(data, rhsData, rhs.size() + 1); // string + null-terminator } + else + { + m_storage.first().SetData(rhsData); + } + m_storage.first().SetSize(rhs.size()); + m_storage.second() = rhs.m_storage.second(); - Traits::move(m_buffer, rhs.m_buffer, sizeof(m_buffer)); - m_size = rhs.m_size; - m_capacity = rhs.m_capacity; - m_allocator = rhs.m_allocator; - - rhs.m_data = nullptr; - rhs.m_size = 0; - rhs.m_capacity = SSO_BUF_SIZE - 1; + rhs.leak_and_reset(); } return *this; } this_type& assign(const this_type& rhs, size_type rhsOffset, size_type count) { // assign rhs [rhsOffset, rhsOffset + count) - AZSTD_CONTAINER_ASSERT(rhs.m_size >= rhsOffset, "Invalid offset"); - size_type num = rhs.m_size - rhsOffset; + AZSTD_CONTAINER_ASSERT(rhs.size() >= rhsOffset, "Invalid offset"); + size_type num = rhs.size() - rhsOffset; if (count < num) { num = count; // trim num to size @@ -334,10 +348,10 @@ namespace AZStd } else if (grow(num)) { // make room and assign new stuff - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - const_pointer rhsData = SSO_BUF_SIZE <= rhs.m_capacity ? rhs.m_data : rhs.m_buffer; - Traits::copy(data /*, m_capacity*/, rhsData + rhsOffset, num); - m_size = num; + pointer data = m_storage.first().GetData(); + const_pointer rhsData = rhs.data(); + Traits::copy(data, rhsData + rhsOffset, num); + m_storage.first().SetSize(num); Traits::assign(data[num], Element()); // terminate } return *this; @@ -345,20 +359,20 @@ namespace AZStd this_type& assign(const_pointer ptr, size_type count) { // assign [ptr, ptr + count) - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - if (ptr != 0 && ptr >= data && (data + m_size) > ptr) + pointer data = m_storage.first().GetData(); + if (ptr != nullptr && ptr >= data && (data + size()) > ptr) { return assign(*this, ptr - data, count); // substring } if (grow(count)) { // make room and assign new stuff - data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + data = m_storage.first().GetData(); if (count > 0) { Traits::copy(data, ptr, count); } - m_size = count; + m_storage.first().SetSize(count); Traits::assign(data[count], Element()); // terminate } return *this; @@ -367,109 +381,132 @@ namespace AZStd this_type& assign(size_type count, Element ch) { // assign count * ch - AZSTD_CONTAINER_ASSERT(count != npos, "result is too long!"); if (grow(count)) { // make room and assign new stuff - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - if (count == 1) + pointer data = m_storage.first().GetData(); + Traits::assign(data, count, ch); + m_storage.first().SetSize(count); + Traits::assign(data[count], Element()); // terminate + } + return *this; + } + + template + auto assign(InputIt first, InputIt last) + -> enable_if_t && !is_convertible_v, this_type&> + { + if constexpr (Internal::satisfies_contiguous_iterator_concept_v + && is_same_v::value_type, value_type>) + { + return assign(AZStd::to_address(first), AZStd::distance(first, last)); + } + else if constexpr (Internal::is_forward_iterator_v) + { + // forward iterator pointer type doesn't match the const_pointer type + // So the elements need to be assigned one by one into the buffer + size_type newSize = AZStd::distance(first, last); + if (grow(newSize)) { - Traits::assign(*(data), ch); + pointer buffer = data(); + for (size_t updateIndex = 0; first != last; ++first, ++updateIndex) + { + Traits::assign(buffer[updateIndex], static_cast(*first)); + } + m_storage.first().SetSize(newSize); + Traits::assign(buffer[newSize], Element()); // terminate } - else + return *this; + } + else + { + // input iterator that aren't forward iterators can only be used in a single pass + // algorithm. Therefore AZStd::distance can't be used + // So the input is copied into a local string and then delegated + // to use the (const_pointer, size_type) overload + basic_string inputCopy; + for (; first != last; ++first) { - Traits::assign(data, count, ch); + inputCopy.push_back(static_cast(*first)); } - m_size = count; - Traits::assign(data[count], Element()); // terminate + + return assign(inputCopy.c_str(), inputCopy.size()); } - return *this; } - - template - inline this_type& assign(InputIterator first, InputIterator last) { return assign_iter(first, last, AZStd::is_integral()); } - inline this_type& assign(const_pointer first, const_pointer last) { return replace(begin(), end(), first, last); } - inline this_type& insert(size_type offset, const this_type& rhs) { return insert(offset, rhs, 0, npos); } + inline this_type& insert(size_type offset, const this_type& rhs) { return insert(offset, rhs, 0, npos); } this_type& insert(size_type offset, const this_type& rhs, size_type rhsOffset, size_type count) { // insert rhs [rhsOffset, rhsOffset + count) at offset - AZSTD_CONTAINER_ASSERT(m_size >= offset && rhs.m_size >= rhsOffset, "Invalid offset(s)"); - size_type num = rhs.m_size - rhsOffset; + AZSTD_CONTAINER_ASSERT(size() >= offset && rhs.size() >= rhsOffset, "Invalid offset(s)"); + size_type num = rhs.size() - rhsOffset; if (num < count) { count = num; // trim _Count to size } - AZSTD_CONTAINER_ASSERT(npos - m_size > count, "Result is too long"); - num = m_size + count; + AZSTD_CONTAINER_ASSERT(npos - size() > count, "Result is too long"); + num = size() + count; if (count > 0 && grow(num)) { - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + pointer data = m_storage.first().GetData(); // make room and insert new stuff - Traits::move(data + offset + count /*, m_capacity - offset - count*/, data + offset, m_size - offset); // empty out hole + Traits::move(data + offset + count, data + offset, size() - offset); // empty out hole if (this == &rhs) { - Traits::move(data + offset /*, m_capacity - offset*/, data + (offset < rhsOffset ? rhsOffset + count : rhsOffset), count); // substring + Traits::move(data + offset, data + (offset < rhsOffset ? rhsOffset + count : rhsOffset), count); // substring } else { - const_pointer rhsData = SSO_BUF_SIZE <= rhs.m_capacity ? rhs.m_data : rhs.m_buffer; - Traits::copy(data + offset /*, m_capacity - offset*/, rhsData + rhsOffset, count); // fill hole + const_pointer rhsData = rhs.data(); + Traits::copy(data + offset, rhsData + rhsOffset, count); // fill hole } - m_size = num; + m_storage.first().SetSize(num); Traits::assign(data[num], Element()); // terminate } return (*this); } - this_type& insert(size_type offset, const_pointer ptr, size_type count) + this_type& insert(size_type offset, const_pointer ptr, size_type count) { // insert [ptr, ptr + count) at offset - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - if (ptr != 0 && ptr >= data && (data + m_size) > ptr) + pointer data = m_storage.first().GetData(); + if (ptr != nullptr && ptr >= data && (data + size()) > ptr) { - return insert(offset, *this, ptr - data, count); // substring + return insert(offset, *this, ptr - data, count); // substring } - AZSTD_CONTAINER_ASSERT(m_size >= offset, "Invalid offset"); - AZSTD_CONTAINER_ASSERT(npos - m_size > count, "Result is too long"); - size_type num = m_size + count; + AZSTD_CONTAINER_ASSERT(size() >= offset, "Invalid offset"); + AZSTD_CONTAINER_ASSERT(npos - size() > count, "Result is too long"); + size_type num = size() + count; if (count > 0 && grow(num)) { // make room and insert new stuff - data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - Traits::move(data + offset + count /*, m_capacity - offset - count*/, data + offset, m_size - offset); // empty out hole - Traits::copy(data + offset /*, m_capacity - offset*/, ptr, count); // fill hole - m_size = num; + data = m_storage.first().GetData(); + Traits::move(data + offset + count, data + offset, size() - offset); // empty out hole + Traits::copy(data + offset, ptr, count); // fill hole + m_storage.first().SetSize(num); Traits::assign(data[num], Element()); // terminate } return *this; } - inline this_type& insert(size_type offset, const_pointer ptr) { return insert(offset, ptr, Traits::length(ptr)); } + inline this_type& insert(size_type offset, const_pointer ptr) { return insert(offset, ptr, Traits::length(ptr)); } this_type& insert(size_type offset, size_type count, Element ch) { // insert count * ch at offset - AZSTD_CONTAINER_ASSERT(m_size >= offset, "Invalid offset"); - AZSTD_CONTAINER_ASSERT(npos - m_size > count, "Result is too long"); - size_type num = m_size + count; + AZSTD_CONTAINER_ASSERT(size() >= offset, "Invalid offset"); + AZSTD_CONTAINER_ASSERT(npos - size() > count, "Result is too long"); + size_type num = size() + count; if (count > 0 && grow(num)) { - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + pointer data = m_storage.first().GetData(); // make room and insert new stuff - Traits::move(data + offset + count /*, m_capacity - offset - count*/, data + offset, m_size - offset); // empty out hole - if (count == 1) - { - Traits::assign(*(data + offset), ch); - } - else - { - Traits::assign(data + offset, count, ch); - } - m_size = num; + Traits::move(data + offset + count, data + offset, size() - offset); // empty out hole + Traits::assign(data + offset, count, ch); + m_storage.first().SetSize(num); Traits::assign(data[num], Element()); // terminate } return *this; } - inline iterator insert(const_iterator insertPos) { return insert(insertPos, Element()); } + inline iterator insert(const_iterator insertPos) { return insert(insertPos, Element()); } iterator insert(const_iterator insertPos, Element ch) { @@ -479,54 +516,89 @@ namespace AZStd const_pointer insertPosPtr = insertPos; #endif - const_pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + const_pointer data = m_storage.first().GetData(); size_type offset = insertPosPtr - data; insert(offset, 1, ch); return iterator(AZSTD_CHECKED_ITERATOR(iterator_impl, data + offset)); } - void insert(const_iterator insertPos, size_type count, Element ch) + iterator insert(const_iterator insertPos, size_type count, Element ch) { // insert count * elem at insertPos #ifdef AZSTD_HAS_CHECKED_ITERATORS const_pointer insertPosPtr = insertPos.get_iterator(); #else const_pointer insertPosPtr = insertPos; #endif - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + pointer data = m_storage.first().GetData(); size_type offset = insertPosPtr - data; insert(offset, count, ch); + return begin() + offset; } - template - inline void insert(const_iterator insertPos, InputIterator first, InputIterator last) + template + auto insert(const_iterator insertPos, InputIt first, InputIt last) + -> enable_if_t && !is_convertible_v, iterator> { // insert [_First, _Last) at _Where - insert_iter(insertPos, first, last, is_integral()); - } + size_type insertOffset = AZStd::distance(cbegin(), insertPos); + if constexpr (Internal::satisfies_contiguous_iterator_concept_v + && is_same_v::value_type, value_type>) + { + insert(insertOffset, AZStd::to_address(first), AZStd::distance(first, last)); + } + else if constexpr (Internal::is_forward_iterator_v) + { + // Input Iterator pointer type doesn't match the const_pointer type + // So the elements need to be inserted one by one into the buffer + size_type count = AZStd::distance(first, last); + size_type oldSize = size(); + size_type newSize = oldSize + count; + if (grow(newSize)) + { + pointer buffer = m_storage.first().GetData(); + Traits::copy_backward(buffer + insertOffset + count, buffer + insertOffset, oldSize - insertOffset); // empty out hole + for (size_t updateIndex = insertOffset; first != last; ++first, ++updateIndex) + { + Traits::assign(buffer[updateIndex], static_cast(*first)); + } + m_storage.first().SetSize(newSize); + Traits::assign(buffer[newSize], Element()); // terminate + } + } + else + { + // input iterator that aren't forward iterators can only be used in a single pass + // algorithm. Therefore AZStd::distance can't be used + // So the input is copied into a local string and then delegated + // to use the (const_pointer, size_type) overload + basic_string inputCopy; + for (; first != last; ++first) + { + inputCopy.push_back(static_cast(*first)); + } - inline void insert(const_iterator insertPos, const_pointer first, const_pointer last) - { // insert [first, last) at insertPos, const pointers - replace(insertPos, insertPos, first, last); + insert(insertOffset, inputCopy.c_str(), inputCopy.size()); + } + return begin() + insertOffset; } - this_type& erase(size_type offset = 0, size_type count = npos) { // erase elements [offset, offset + count) - AZSTD_CONTAINER_ASSERT(m_size >= offset, "Invalid offset"); - if (m_size - offset < count) + AZSTD_CONTAINER_ASSERT(size() >= offset, "Invalid offset"); + if (size() - offset < count) { - count = m_size - offset; // trim count + count = size() - offset; // trim count } if (count > 0) { // move elements down - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + pointer data = m_storage.first().GetData(); #ifdef AZSTD_HAS_CHECKED_ITERATORS orphan_range(data + offset, data + offset + count); #endif - Traits::move(data + offset /*, m_capacity - offset*/, data + offset + count, m_size - offset - count); - m_size = m_size - count; - Traits::assign(data[m_size], Element()); // terminate - } + Traits::move(data + offset, data + offset + count, size() - offset - count); + m_storage.first().SetSize(size() - count); + Traits::assign(data[size()], Element()); // terminate + } return *this; } @@ -538,10 +610,10 @@ namespace AZStd const_pointer erasePtr = erasePos; #endif // erase element at insertPos - const_pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + const_pointer data = m_storage.first().GetData(); size_type count = erasePtr - data; erase(count, 1); - data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + data = m_storage.first().GetData(); return iterator(AZSTD_CHECKED_ITERATOR(iterator_impl, data + count)); } @@ -554,159 +626,152 @@ namespace AZStd const_pointer firstPtr = first; const_pointer lastPtr = last; #endif - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + pointer data = m_storage.first().GetData(); size_type count = firstPtr - data; erase(count, lastPtr - firstPtr); - data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + data = m_storage.first().GetData(); return iterator(AZSTD_CHECKED_ITERATOR(iterator_impl, data + count)); } - inline void clear() { erase(begin(), end()); } - inline this_type& replace(size_type offset, size_type count, const this_type& rhs) + inline void clear() { erase(begin(), end()); } + this_type& replace(size_type offset, size_type count, const this_type& rhs) { - // replace [offset, offset + count) with rhs - return replace(offset, count, rhs, 0, npos); + return replace(offset, count, rhs.c_str(), rhs.size()); } this_type& replace(size_type offset, size_type count, const this_type& rhs, size_type rhsOffset, size_type rhsCount) { - // replace [offset, offset + count) with rhs [rhsOffset, rhsOffset + rhsCount) - AZSTD_CONTAINER_ASSERT(m_size >= offset && rhs.m_size >= rhsOffset, "Invalid offsets"); - if (m_size - offset < count) - { - count = m_size - offset; // trim count to size - } - size_type num = rhs.m_size - rhsOffset; - if (num < rhsCount) - { - rhsCount = num; // trim rhsCount to size - } - AZSTD_CONTAINER_ASSERT(npos - rhsCount > m_size - count, "Result is too long"); - - size_type nm = m_size - count - offset; // length of preserved tail - size_type newSize = m_size + rhsCount - count; - if (m_size < newSize) - { - grow(newSize); - } - - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - const_pointer rhsData = SSO_BUF_SIZE <= rhs.m_capacity ? rhs.m_data : rhs.m_buffer; - -#ifdef AZSTD_HAS_CHECKED_ITERATORS - orphan_range(data + offset, data + offset + count); -#endif - if (this != &rhs) - { // no overlap, just move down and copy in new stuff - Traits::move(data + offset + rhsCount /*, m_capacity - offset - rhsCount*/, data + offset + count, nm); // empty hole - Traits::copy(data + offset /*, m_capacity - offset*/, rhsData + rhsOffset, rhsCount); // fill hole - } - else if (rhsCount <= count) - { // hole doesn't get larger, just copy in substring - Traits::move(data + offset /*, m_capacity - offset*/, data + rhsOffset, rhsCount); // fill hole - Traits::move(data + offset + rhsCount /*, m_capacity - offset - rhsCount*/, data + offset + count, nm); // move tail down - } - else if (rhsOffset <= offset) - { // hole gets larger, substring begins before hole - Traits::move(data + offset + rhsCount /*, m_capacity - offset - rhsCount*/, data + offset + count, nm); // move tail down - Traits::move(data + offset /*, m_capacity - offset*/, data + rhsOffset, rhsCount); // fill hole - } - else if (offset + count <= rhsOffset) - { // hole gets larger, substring begins after hole - Traits::move(data + offset + rhsCount /*, m_capacity - offset - rhsCount*/, data + offset + count, nm); // move tail down - Traits::move(data + offset /*, m_capacity - offset*/, data + (rhsOffset + rhsCount - count), rhsCount); // fill hole - } - else - { // hole gets larger, substring begins in hole - Traits::move(data + offset /*, m_capacity - offset*/, data + rhsOffset, count); // fill old hole - Traits::move(data + offset + rhsCount /*, m_capacity - offset - rhsCount*/, data + offset + count, nm); // move tail down - Traits::move(data + offset + count /*, m_capacity - offset - count*/, data + rhsOffset + rhsCount, rhsCount - count); // fill rest of new hole - } - - m_size = newSize; - Traits::assign(data[newSize], Element()); // terminate - return (*this); + return replace(offset, count, rhs.c_str() + rhsOffset, AZStd::min(rhsCount, rhs.size() - rhsOffset)); } this_type& replace(size_type offset, size_type count, const_pointer ptr, size_type ptrCount) { - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; // replace [offset, offset + count) with [ptr, ptr + ptrCount) - if (ptr != 0 && ptr >= data && (data + m_size) > ptr) - { - return (replace(offset, count, *this, ptr - data, ptrCount)); // substring, replace carefully - } - AZSTD_CONTAINER_ASSERT(m_size >= offset, "Invalid offset"); - if (m_size - offset < count) - { - count = m_size - offset; // trim _N0 to size + AZSTD_CONTAINER_ASSERT(size() >= offset, "Invalid offset"); + // Make sure count is within is no larger than the distance from the offset + // to the end of this string + count = AZStd::min(count, size() - offset); + + size_type newSize = size() + ptrCount - count; + size_type charsAfterCountToMove = size() - count - offset; + pointer inputStringCopy{}; + + if (pointer thisBuffer = m_storage.first().GetData(); + (ptr >= thisBuffer && ptr < thisBuffer + size()) + || (ptr + ptrCount > thisBuffer && ptr + ptrCount <= thisBuffer + size())) + { + // Overlap checks for tring needs if the input pointer is anywhere within the string + // even if it is outside of the range of [offset, offset + count) as a growing + // the string buffer could cause a realloc to occur + if (!fits_in_capacity(newSize)) + { + // If the input string is a sub-string and it would cause + // this string to need to re-allocated as it doesn't fit in the capacity + // Then the input string is needs to be copied into a local buffer + inputStringCopy = reinterpret_cast(get_allocator().allocate(ptrCount * sizeof(value_type), alignof(value_type))); + Traits::copy(inputStringCopy, ptr, ptrCount); + // Updated the input string pointer to point to the local buffer + ptr = inputStringCopy; + // Now this string buffer can now be safely resized and the non-overlapping string logic below can be used + } + else + { + // overlapping string in-place logic + // Ex. this = "ABCDEFG", offset = 1, count=4 + // substring is "CDE" + // The text from offset 1 for 4 chars "BCDE": should be replaced with "CDE" + // making a whole for the bytes results in output = "ABCDFG" + // Afterwards output = "ACDEFG" + // The input string overlaps with this string in this case + // So the string is copied piecewise + if (ptrCount <= count) + { // hole doesn't get larger, just copy in substring + Traits::move(thisBuffer + offset, ptr, ptrCount); // fill hole + Traits::copy(thisBuffer + offset + ptrCount, thisBuffer + offset + count, charsAfterCountToMove); // move tail down + } + else + { + if (ptr <= thisBuffer + offset) + { // hole gets larger, substring begins before hole + Traits::copy_backward(thisBuffer + offset + ptrCount, thisBuffer + offset + count, charsAfterCountToMove); // move tail down + Traits::copy(thisBuffer + offset, ptr, ptrCount); // fill hole + } + else if (thisBuffer + offset + count <= ptr) + { // hole gets larger, substring begins after hole + Traits::copy_backward(thisBuffer + offset + ptrCount, thisBuffer + offset + count, charsAfterCountToMove); // move tail down + Traits::copy(thisBuffer + offset, ptr + (ptrCount - count), ptrCount); // fill hole + } + else + { // hole gets larger, substring begins in hole + Traits::copy(thisBuffer + offset, ptr, count); // fill old hole + Traits::copy_backward(thisBuffer + offset + ptrCount, thisBuffer + offset + count, charsAfterCountToMove); // move tail down + Traits::copy(thisBuffer + offset + count, ptr + ptrCount, ptrCount - count); // fill rest of new hole + } + } + m_storage.first().SetSize(newSize); + Traits::assign(thisBuffer[newSize], Element()); // terminate + return *this; + } } - AZSTD_CONTAINER_ASSERT(npos - ptrCount > m_size - count, "Result too long"); -#ifdef AZSTD_HAS_CHECKED_ITERATORS - orphan_range(data + offset, data + offset + count); -#endif - size_type nm = m_size - count - offset; - if (ptrCount < count) - { - Traits::move(data + offset + ptrCount, data + offset + count, nm); // smaller hole, move tail up - } - size_type num = m_size + ptrCount - count; - if ((0 < ptrCount || 0 < count) && grow(num)) + // input string doesn't overlap, so this string can be re-allocated safely + if (grow(newSize)) { - data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - // make room and rearrange - if (count < ptrCount) + // Need to regrab the memory address for the storage buffer + // in case the grow re-allocated memory + pointer thisBuffer = m_storage.first().GetData(); + if (count != ptrCount) { - Traits::move(data + offset + ptrCount /*, m_capacity - offset - ptrCount*/, data + offset + count, nm); // move tail down + Traits::move(thisBuffer + offset + ptrCount, thisBuffer + offset + count, charsAfterCountToMove); } if (ptrCount > 0) { - Traits::copy(data + offset /*, m_capacity - offset*/, ptr, ptrCount); // fill hole + // Copy bytes up to the minimum of this string count and input string count + Traits::copy(thisBuffer + offset, ptr, ptrCount); } + // input string doesn't overlap, so this string can be re-allocated safely + m_storage.first().SetSize(newSize); + Traits::assign(thisBuffer[newSize], Element()); // terminate + } - m_size = num; - Traits::assign(data[num], Element()); // terminate + // If a local string was allocated, then de-allocate its memory + if (inputStringCopy != nullptr) + { + get_allocator().deallocate(inputStringCopy, 0, alignof(value_type)); } + return *this; } inline this_type& replace(size_type offset, size_type count, const_pointer ptr) { return replace(offset, count, ptr, Traits::length(ptr)); } this_type& replace(size_type offset, size_type count, size_type num, Element ch) { // replace [offset, offset + count) with num * ch - AZSTD_CONTAINER_ASSERT(m_size > offset, "Invalid offset"); - if (m_size - offset < count) + AZSTD_CONTAINER_ASSERT(size() > offset, "Invalid offset"); + if (size() - offset < count) { - count = m_size - offset; // trim count to size + count = size() - offset; // trim count to size } - AZSTD_CONTAINER_ASSERT(npos - num > m_size - count, "Result is too long"); - size_type nm = m_size - count - offset; + AZSTD_CONTAINER_ASSERT(npos - num > size() - count, "Result is too long"); + size_type nm = size() - count - offset; - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + pointer data = m_storage.first().GetData(); #ifdef AZSTD_HAS_CHECKED_ITERATORS orphan_range(data + offset, data + offset + count); #endif if (num < count) { - Traits::move(data + offset + num /*, m_capacity - offset - num*/, data + offset + count, nm); // smaller hole, move tail up + Traits::move(data + offset + num, data + offset + count, nm); // smaller hole, move tail up } - size_type numToGrow = m_size + num - count; + size_type numToGrow = size() + num - count; if ((0 < num || 0 < count) && grow(numToGrow)) { // make room and rearrange - data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + data = m_storage.first().GetData(); if (count < num) { - Traits::move(data + offset + num /*, m_capacity - offset - num*/, data + offset + count, nm); // move tail down + Traits::move(data + offset + num, data + offset + count, nm); // move tail down } - if (count == 1) - { - Traits::assign(*(data + offset), ch); - } - else - { - Traits::assign(data + offset, num, ch); - } - m_size = numToGrow; + Traits::assign(data + offset, num, ch); + m_storage.first().SetSize(numToGrow); Traits::assign(data[numToGrow], Element()); // terminate } return *this; @@ -722,7 +787,7 @@ namespace AZStd const_pointer firstPtr = first; const_pointer lastPtr = last; #endif - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + pointer data = m_storage.first().GetData(); return replace(firstPtr - data, lastPtr - firstPtr, rhs); } @@ -735,7 +800,7 @@ namespace AZStd const_pointer firstPtr = first; const_pointer lastPtr = last; #endif - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + pointer data = m_storage.first().GetData(); return replace(firstPtr - data, lastPtr - firstPtr, ptr, count); } @@ -748,7 +813,7 @@ namespace AZStd const_pointer firstPtr = first; const_pointer lastPtr = last; #endif - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + pointer data = m_storage.first().GetData(); return replace(firstPtr - data, lastPtr - firstPtr, ptr); } @@ -761,113 +826,133 @@ namespace AZStd const_pointer firstPtr = first; const_pointer lastPtr = last; #endif - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + pointer data = m_storage.first().GetData(); return replace(firstPtr - data, lastPtr - firstPtr, count, ch); } - template - inline this_type& replace(const_iterator first, const_iterator last, InputIterator first2, InputIterator last2) - { // replace [first, last) with [first2,last2) - return replace_iter(first, last, first2, last2, is_integral()); - } - - this_type& replace(const_iterator first, const_iterator last, const_pointer first2, const_pointer last2) + template + inline auto replace(const_iterator first, const_iterator last, InputIt replaceFirst, InputIt replaceLast) + -> enable_if_t && !is_convertible_v, this_type&> { -#ifdef AZSTD_HAS_CHECKED_ITERATORS - const_pointer first1 = first.get_iterator(); - const_pointer last1 = last.get_iterator(); -#else - const_pointer first1 = first; - const_pointer last1 = last; -#endif - // replace [first, last) with [first2, last2), const pointers - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - if (first2 == last2) + if constexpr (Internal::satisfies_contiguous_iterator_concept_v + && is_same_v::value_type, value_type>) { - erase(first1 - data, last1 - first1); + return replace(first, last, AZStd::to_address(replaceFirst), AZStd::distance(replaceFirst, replaceLast)); + } + else if constexpr (Internal::is_forward_iterator_v) + { + // Input Iterator pointer type doesn't match the const_pointer type + // So the elements need to be appended one by one into the buffer + + size_type insertOffset = AZStd::distance(cbegin(), first); + size_type postInsertOffset = AZStd::distance(cbegin(), last); + size_type count = AZStd::distance(replaceFirst, replaceLast); + size_type oldSize = size(); + size_type newSize = oldSize + count - AZStd::distance(first, last); + if (grow(newSize)) + { + pointer buffer = data(); + Traits::move(first + count, last, oldSize - postInsertOffset); // empty out hole + for (size_t updateIndex = insertOffset; replaceFirst != replaceLast; ++replaceFirst, ++updateIndex) + { + Traits::assign(buffer[updateIndex], static_cast(*replaceFirst)); + } + m_storage.first().SetSize(newSize); + Traits::assign(buffer[newSize], Element()); // terminate + } + return *this; } else { - replace(first1 - data, last1 - first1, &*first2, last2 - first2); + // input iterator that aren't forward iterators can only be used in a single pass + // algorithm. Therefore AZStd::distance can't be used + // So the input is copied into a local string and then delegated + // to use the (const_pointer, size_type) overload + basic_string inputCopy; + for (; replaceFirst != replaceLast; ++replaceFirst) + { + inputCopy.push_back(static_cast(*replaceFirst)); + } + + return replace(first, last, inputCopy.c_str(), inputCopy.size()); } - return *this; } inline reference at(size_type offset) { // subscript mutable sequence with checking - AZSTD_CONTAINER_ASSERT(m_size > offset, "Invalid offset"); - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + AZSTD_CONTAINER_ASSERT(size() > offset, "Invalid offset"); + pointer data = m_storage.first().GetData(); return data[offset]; } inline const_reference at(size_type offset) const { // subscript nonmutable sequence with checking - AZSTD_CONTAINER_ASSERT(m_size > offset, "Invalid offset"); - const_pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + AZSTD_CONTAINER_ASSERT(size() > offset, "Invalid offset"); + const_pointer data = m_storage.first().GetData(); return data[offset]; } inline reference operator[](size_type offset) { // subscript mutable sequence with checking - AZSTD_CONTAINER_ASSERT(m_size > offset, "Invalid offset"); - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + AZSTD_CONTAINER_ASSERT(size() > offset, "Invalid offset"); + pointer data = m_storage.first().GetData(); return data[offset]; } inline const_reference operator[](size_type offset) const { // subscript nonmutable sequence with checking - AZSTD_CONTAINER_ASSERT(m_size > offset, "Invalid offset"); - const_pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + AZSTD_CONTAINER_ASSERT(size() > offset, "Invalid offset"); + const_pointer data = m_storage.first().GetData(); return data[offset]; } inline reference front() { - AZSTD_CONTAINER_ASSERT(m_size != 0, "AZStd::string::front - string is empty!"); - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + AZSTD_CONTAINER_ASSERT(size() != 0, "AZStd::string::front - string is empty!"); + pointer data = m_storage.first().GetData(); return data[0]; } inline const_reference front() const { - AZSTD_CONTAINER_ASSERT(m_size != 0, "AZStd::string::front - string is empty!"); - const_pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + AZSTD_CONTAINER_ASSERT(size() != 0, "AZStd::string::front - string is empty!"); + const_pointer data = m_storage.first().GetData(); return data[0]; } inline reference back() { - AZSTD_CONTAINER_ASSERT(m_size != 0, "AZStd::string::back - string is empty!"); - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - return data[m_size - 1]; + AZSTD_CONTAINER_ASSERT(size() != 0, "AZStd::string::back - string is empty!"); + pointer data = m_storage.first().GetData(); + return data[size() - 1]; } inline const_reference back() const { - AZSTD_CONTAINER_ASSERT(m_size != 0, "AZStd::string::back - string is empty!"); - const_pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - return data[m_size - 1]; + AZSTD_CONTAINER_ASSERT(size() != 0, "AZStd::string::back - string is empty!"); + const_pointer data = m_storage.first().GetData(); + return data[size() - 1]; } inline void push_back(Element ch) { - const_pointer end = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - end += m_size; + const_pointer end = data(); + end += size(); insert(end, ch); } - inline const_pointer c_str() const { return (SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer); } - inline size_type length() const { return m_size; } - inline size_type size() const { return m_size; } - inline size_type capacity() const { return m_capacity; } + inline const_pointer c_str() const { return (data()); } + inline size_type length() const { return m_storage.first().GetSize(); } + inline size_type size() const { return m_storage.first().GetSize(); } + inline size_type capacity() const { return m_storage.first().GetCapacity(); } inline size_type max_size() const { // return maximum possible length of sequence - return AZStd::allocator_traits::max_size(m_allocator) / sizeof(value_type); + return AZStd::allocator_traits::max_size(m_storage.second()) / sizeof(value_type); } inline void resize(size_type newSize) @@ -877,58 +962,58 @@ namespace AZStd inline void resize_no_construct(size_type newSize) { - if (newSize <= m_size) + if (newSize <= size()) { erase(newSize); } else { reserve(newSize); - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - m_size = newSize; - Traits::assign(data[m_size], Element()); // terminate + pointer data = m_storage.first().GetData(); + m_storage.first().SetSize(newSize); + Traits::assign(data[newSize], Element()); // terminate } } inline void resize(size_type newSize, Element ch) { // determine new length, padding with ch elements as needed - if (newSize <= m_size) + if (newSize <= size()) { erase(newSize); } else { - append(newSize - m_size, ch); + append(newSize - size(), ch); } } void reserve(size_type newCapacity = 0) { // determine new minimum length of allocated storage - if (m_size <= newCapacity && m_capacity != newCapacity) + if (size() <= newCapacity && capacity() != newCapacity) { // change reservation - size_type size = m_size; + size_type curSize = size(); if (grow(newCapacity)) { - m_size = size; - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - Traits::assign(data[size], Element()); // terminate + m_storage.first().SetSize(curSize); + pointer data = m_storage.first().GetData(); + Traits::assign(data[curSize], Element()); // terminate } } } - inline bool empty() const { return (m_size == 0); } - size_type copy(Element* dest /*, size_type destSize */, size_type count, size_type offset = 0) const + inline bool empty() const { return size() == 0; } + size_type copy(Element* dest, size_type count, size_type offset = 0) const { // copy [offset, offset + count) to [dest, dest + count) // assume there is enough space in _Ptr - AZSTD_CONTAINER_ASSERT(m_size >= offset, "Invalid offset"); - if (m_size - offset < count) + AZSTD_CONTAINER_ASSERT(size() >= offset, "Invalid offset"); + if (size() - offset < count) { - count = m_size - offset; + count = size() - offset; } - const_pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - Traits::copy(dest /*, destSize*/, data + offset, count); + const_pointer data = m_storage.first().GetData(); + Traits::copy(dest, data + offset, count); return count; } @@ -939,19 +1024,10 @@ namespace AZStd return; } - if (m_allocator == rhs.m_allocator) + if (m_storage.second() == rhs.m_storage.second()) { - // same allocator, swap control information -#ifdef AZSTD_HAS_CHECKED_ITERATORS - swap_all(rhs); -#endif - Element temp[SSO_BUF_SIZE]; - ::memcpy(temp, rhs.m_buffer, sizeof(m_buffer)); - ::memcpy(rhs.m_buffer, m_buffer, sizeof(m_buffer)); - ::memcpy(m_buffer, temp, sizeof(m_buffer)); - - AZStd::swap(m_size, rhs.m_size); - AZStd::swap(m_capacity, rhs.m_capacity); + // same allocator, swap storage + m_storage.first().swap(rhs.m_storage.first()); } else { @@ -980,174 +1056,76 @@ namespace AZStd inline size_type find(const this_type& rhs, size_type offset = 0) const { - const_pointer rhsData = SSO_BUF_SIZE <= rhs.m_capacity ? rhs.m_data : rhs.m_buffer; - return find(rhsData, offset, rhs.m_size); + const_pointer rhsData = rhs.data(); + return find(rhsData, offset, rhs.size()); } size_type find(const_pointer ptr, size_type offset, size_type count) const { - AZ_Assert(ptr != NULL, "Invalid input!"); - - // look for [ptr, ptr + count) beginning at or after offset - if (count == 0 && offset <= m_size) - { - return offset; // null string always matches (if inside string) - } - size_type nm; - if (offset < m_size && count <= (nm = m_size - offset)) - { // room for match, look for it - const_pointer uptr, vptr; - const_pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - for (nm -= count - 1, vptr = data + offset; (uptr = Traits::find(vptr, nm, *ptr)) != 0; nm -= uptr - vptr + 1, vptr = uptr + 1) - { - if (Traits::compare(uptr, ptr, count) == 0) - { - return (uptr - data); // found a match - } - } - } - - return (npos); // no match + return StringInternal::find(data(), size(), ptr, offset, count, npos); } inline size_type find(const_pointer ptr, size_type offset = 0) const { return find(ptr, offset, Traits::length(ptr)); } inline size_type find(Element ch, size_type offset = 0) const { return find((const_pointer) & ch, offset, 1); } inline size_type rfind(const this_type& rhs, size_type offset = npos) const { - const_pointer rhsData = SSO_BUF_SIZE <= rhs.m_capacity ? rhs.m_data : rhs.m_buffer; - return rfind(rhsData, offset, rhs.m_size); + const_pointer rhsData = rhs.data(); + return rfind(rhsData, offset, rhs.size()); } size_type rfind(const_pointer ptr, size_type offset, size_type count) const - { // look for [ptr, ptr + count) beginning before offset - if (count == 0) - { - return (offset < m_size ? offset : m_size); // null always matches - } - if (count <= m_size) - { // room for match, look for it - const_pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - const_pointer uptr = data + (offset < m_size - count ? offset : m_size - count); - for (;; --uptr) - { - if (Traits::eq(*uptr, *ptr) && Traits::compare(uptr, ptr, count) == 0) - { - return (uptr - data); // found a match - } - else if (uptr == data) - { - break; // at beginning, no more chance for match - } - } - } - - return npos; // no match + { + return StringInternal::rfind(data(), size(), ptr, offset, count, npos); } inline size_type rfind(const_pointer ptr, size_type offset = npos) const { return rfind(ptr, offset, Traits::length(ptr)); } inline size_type rfind(Element ch, size_type offset = npos) const { return rfind((const_pointer) & ch, offset, 1); } inline size_type find_first_of(const this_type& rhs, size_type offset = 0) const { - const_pointer rhsData = SSO_BUF_SIZE <= rhs.m_capacity ? rhs.m_data : rhs.m_buffer; - return find_first_of(rhsData, offset, rhs.m_size); + const_pointer rhsData = rhs.data(); + return find_first_of(rhsData, offset, rhs.size()); } size_type find_first_of(const_pointer ptr, size_type offset, size_type count) const - { // look for one of [ptr, ptr + count) at or after offset - if (0 < count && offset < m_size) - { // room for match, look for it - const_pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - const Element* const vptr = data + m_size; - for (const_pointer uptr = data + offset; uptr < vptr; ++uptr) - { - if (Traits::find(ptr, count, *uptr) != 0) - { - return uptr - data; // found a match - } - } - } - return npos; // no match + { + return StringInternal::find_first_of(data(), size(), ptr, offset, count, npos); } inline size_type find_first_of(const_pointer ptr, size_type offset = 0) const { return find_first_of(ptr, offset, Traits::length(ptr)); } inline size_type find_first_of(Element ch, size_type offset = 0) const { return find((const_pointer) & ch, offset, 1); } inline size_type find_last_of(const this_type& rhs, size_type offset = npos) const { - const_pointer rhsData = SSO_BUF_SIZE <= rhs.m_capacity ? rhs.m_data : rhs.m_buffer; - return find_last_of(rhsData, offset, rhs.m_size); + const_pointer rhsData = rhs.data(); + return find_last_of(rhsData, offset, rhs.size()); } size_type find_last_of(const_pointer ptr, size_type offset, size_type count) const - { // look for one of [ptr, ptr + count) before offset - if (0 < count && 0 < m_size) - { - const_pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - for (const_pointer uptr = data + (offset < m_size ? offset : m_size - 1);; --uptr) - { - if (Traits::find(ptr, count, *uptr) != 0) - { - return uptr - data; // found a match - } - else if (uptr == data) - { - break; // at beginning, no more chance for match - } - } - } - - return npos; // no match + { + return StringInternal::find_last_of(data(), size(), ptr, offset, count, npos); } inline size_type find_last_of(const_pointer ptr, size_type offset = npos) const { return find_last_of(ptr, offset, Traits::length(ptr)); } inline size_type find_last_of(Element ch, size_type offset = npos) const { return rfind((const_pointer) & ch, offset, 1); } inline size_type find_first_not_of(const this_type& rhs, size_type offset = 0) const { // look for none of rhs at or after offset - const_pointer rhsData = SSO_BUF_SIZE <= rhs.m_capacity ? rhs.m_data : rhs.m_buffer; - return find_first_not_of(rhsData, offset, rhs.m_size); + const_pointer rhsData = rhs.data(); + return find_first_not_of(rhsData, offset, rhs.size()); } size_type find_first_not_of(const_pointer ptr, size_type offset, size_type count) const { - // look for none of [ptr, ptr + count) at or after offset - if (offset < m_size) - { // room for match, look for it - const_pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - const Element* const vptr = data + m_size; - for (const_pointer uptr = data + offset; uptr < vptr; ++uptr) - { - if (Traits::find(ptr, count, *uptr) == 0) - { - return uptr - data; - } - } - } - return npos; + return StringInternal::find_first_not_of(data(), size(), ptr, offset, count, npos); } inline size_type find_first_not_of(const_pointer ptr, size_type offset = 0) const { return find_first_not_of(ptr, offset, Traits::length(ptr)); } inline size_type find_first_not_of(Element ch, size_type offset = 0) const { return find_first_not_of((const_pointer) & ch, offset, 1); } inline size_type find_last_not_of(const this_type& rhs, size_type offset = npos) const { // look for none of rhs before offset - const_pointer rhsData = SSO_BUF_SIZE <= rhs.m_capacity ? rhs.m_data : rhs.m_buffer; - return find_last_not_of(rhsData, offset, rhs.m_size); + const_pointer rhsData = rhs.data(); + return find_last_not_of(rhsData, offset, rhs.size()); } size_type find_last_not_of(const_pointer ptr, size_type offset, size_type count) const - { // look for none of [ptr, ptr + count) before offset - if (0 < m_size) - { - const_pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - for (const_pointer uptr = data + (offset < m_size ? offset : m_size - 1);; --uptr) - { - if (Traits::find(ptr, count, *uptr) == 0) - { - return uptr - data; - } - else if (uptr == data) - { - break; - } - } - } - return npos; + { + return StringInternal::find_last_not_of(data(), size(), ptr, offset, count, npos); } inline size_type find_last_not_of(const_pointer ptr, size_type offset = npos) const { return find_last_not_of(ptr, offset, Traits::length(ptr)); } @@ -1161,8 +1139,8 @@ namespace AZStd inline int compare(const this_type& rhs) const { - const_pointer rhsData = SSO_BUF_SIZE <= rhs.m_capacity ? rhs.m_data : rhs.m_buffer; - return compare(0, m_size, rhsData, rhs.m_size); + const_pointer rhsData = rhs.data(); + return compare(0, size(), rhsData, rhs.size()); } inline int compare(size_type offset, size_type count, const this_type& rhs) const @@ -1173,26 +1151,26 @@ namespace AZStd int compare(size_type offset, size_type count, const this_type& rhs, size_type rhsOffset, size_type rhsCount) const { // compare [offset, offset + count) with rhs [rhsOffset, rhsOffset + rhsCount) - AZSTD_CONTAINER_ASSERT(rhs.m_size >= rhsOffset, "Invalid offset"); - if (rhs.m_size - rhsOffset < rhsCount) + AZSTD_CONTAINER_ASSERT(rhs.size() >= rhsOffset, "Invalid offset"); + if (rhs.size() - rhsOffset < rhsCount) { - rhsCount = rhs.m_size - rhsOffset; // trim rhsCount to size + rhsCount = rhs.size() - rhsOffset; // trim rhsCount to size } - const_pointer rhsData = SSO_BUF_SIZE <= rhs.m_capacity ? rhs.m_data : rhs.m_buffer; + const_pointer rhsData = rhs.data(); return compare(offset, count, rhsData + rhsOffset, rhsCount); } - inline int compare(const_pointer ptr) const { return compare(0, m_size, ptr, Traits::length(ptr)); } + inline int compare(const_pointer ptr) const { return compare(0, size(), ptr, Traits::length(ptr)); } inline int compare(size_type offset, size_type count, const_pointer ptr) const { return compare(offset, count, ptr, Traits::length(ptr)); } int compare(size_type offset, size_type count, const_pointer ptr, size_type ptrCount) const { // compare [offset, offset + _N0) with [_Ptr, _Ptr + _Count) - AZSTD_CONTAINER_ASSERT(m_size >= offset, "Invalid offset"); - if (m_size - offset < count) + AZSTD_CONTAINER_ASSERT(size() >= offset, "Invalid offset"); + if (size() - offset < count) { - count = m_size - offset; // trim count to size + count = size() - offset; // trim count to size } - const_pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + const_pointer data = m_storage.first().GetData(); size_type ans = Traits::compare(data + offset, ptr, count < ptrCount ? count : ptrCount); return (ans != 0 ? (int)ans : count < ptrCount ? -1 : count == ptrCount ? 0 : +1); } @@ -1231,11 +1209,11 @@ namespace AZStd inline void pop_back() { - if (m_size > 0) + if (!empty()) { - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - --m_size; - Traits::assign(data[m_size], Element()); // terminate + pointer data = m_storage.first().GetData(); + m_storage.first().SetSize(m_storage.first().GetSize() - 1); + Traits::assign(data[size()], Element()); // terminate } } @@ -1245,39 +1223,35 @@ namespace AZStd * @{ */ /// TR1 Extension. Return pointer to the vector data. The vector data is guaranteed to be stored as an array. - inline pointer data() { return (SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer); } - inline const_pointer data() const { return (SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer); } + inline pointer data() { return m_storage.first().GetData(); } + inline const_pointer data() const { return m_storage.first().GetData(); } /// /// The only difference from the standard is that we return the allocator instance, not a copy. - inline allocator_type& get_allocator() { return m_allocator; } - inline const allocator_type& get_allocator() const { return m_allocator; } + inline allocator_type& get_allocator() { return m_storage.second(); } + inline const allocator_type& get_allocator() const { return m_storage.second(); } /// Set the vector allocator. If different than then current all elements will be reallocated. void set_allocator(const allocator_type& allocator) { - if (m_allocator != allocator) + if (m_storage.second() != allocator) { - if (m_size > 0 && SSO_BUF_SIZE <= m_capacity) + if (!empty() && !m_storage.first().ShortStringOptimizationActive()) { allocator_type newAllocator = allocator; - pointer data = m_data; + pointer data = m_storage.first().GetData(); - pointer newData = reinterpret_cast(newAllocator.allocate(sizeof(node_type) * (m_capacity + 1), alignment_of::value)); + pointer newData = reinterpret_cast(newAllocator.allocate(sizeof(node_type) * (capacity() + 1), alignof(node_type))); - Traits::copy(newData, data, m_size + 1); // copy elements and terminator + Traits::copy(newData, data, size() + 1); // copy elements and terminator // Free memory (if needed). deallocate_memory(data, 0, typename allocator_type::allow_memory_leaks()); - m_allocator = newAllocator; - -#ifdef AZSTD_HAS_CHECKED_ITERATORS - orphan_all(); -#endif + m_storage.second() = newAllocator; } else { - m_allocator = allocator; + m_storage.second() = allocator; } } } @@ -1296,12 +1270,12 @@ namespace AZStd #else pointer iterPtr = iter; #endif - const_pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - if (iterPtr < data || iterPtr > (data + m_size)) + const_pointer data = m_storage.first().GetData(); + if (iterPtr < data || iterPtr > (data + size())) { return isf_none; } - else if (iterPtr == (data + m_size)) + else if (iterPtr == (data + size())) { return isf_valid; } @@ -1316,12 +1290,12 @@ namespace AZStd #else const_pointer iterPtr = iter; #endif - const_pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - if (iterPtr < data || iterPtr > (data + m_size)) + const_pointer data = m_storage.first().GetData(); + if (iterPtr < data || iterPtr > (data + size())) { return isf_none; } - else if (iterPtr == (data + m_size)) + else if (iterPtr == (data + size())) { return isf_valid; } @@ -1337,86 +1311,74 @@ namespace AZStd * \note This function is added to the vector for consistency. In the vector case we have only one allocation, and if the allocator allows memory leaks * it can just leave deallocate function empty, which performance wise will be the same. For more complex containers this will make big difference. */ - void leak_and_reset() + void leak_and_reset() { - m_size = 0; - m_capacity = SSO_BUF_SIZE - 1; - Traits::assign(m_buffer[0], Element()); - -#ifdef AZSTD_HAS_CHECKED_ITERATORS - orphan_all(); -#endif + m_storage.first() = {}; } /** * Set the capacity, if necessary it will erase elements at the end of the container to match the new capacity. */ - void set_capacity(size_type numElements) + void set_capacity(size_type numElements) { // sets the new capacity of the vector, can be smaller than size() - if (m_capacity != numElements) + if (capacity() != numElements) { - if (numElements < SSO_BUF_SIZE) + if (numElements < ShortStringData::Capacity) { - if (m_capacity >= SSO_BUF_SIZE) + if (!m_storage.first().ShortStringOptimizationActive()) { // copy any leftovers to small buffer and deallocate - pointer ptr = m_data; - numElements = numElements < m_size ? numElements : m_size; + pointer ptr = m_storage.first().GetData(); + numElements = numElements < size() ? numElements : size(); + m_storage.first().SetCapacity(ShortStringData::Capacity); if (0 < numElements) { - Traits::copy(m_buffer /*, SSO_BUF_SIZE*/, ptr, numElements); + Traits::copy(m_storage.first().GetData(), ptr, numElements); } - deallocate_memory(ptr, 0, typename allocator_type::allow_memory_leaks()); - m_capacity = SSO_BUF_SIZE - 1; + // deallocate_memory functione examines the current + // m_storage short string optimization state was changed to true + // by the SetCapacity call above. Therefore m_storage.second().deallocate + // is used directly + m_storage.second().deallocate(ptr, 0, alignof(node_type)); } - m_size = numElements; - Traits::assign(m_buffer[numElements], Element()); // terminate + m_storage.first().SetSize(numElements); + Traits::assign(m_storage.first().GetData()[numElements], Element()); // terminate } else { size_type expandedSize = 0; - if (m_capacity >= SSO_BUF_SIZE) + if (!m_storage.first().ShortStringOptimizationActive()) { - expandedSize = m_allocator.resize(m_data, sizeof(node_type) * (numElements + 1)); + expandedSize = m_storage.second().resize(m_storage.first().GetData(), sizeof(node_type) * (numElements + 1)); // our memory managers allocate on 8+ bytes boundary and our node type should be less than that in general, otherwise // we need to take care when we compute the size on deallocate. AZ_Assert(expandedSize % sizeof(node_type) == 0, "Expanded size not a multiply of node type. This should not happen"); size_type expandedCapacity = expandedSize / sizeof(node_type); if (expandedCapacity > numElements) { - m_capacity = expandedCapacity - 1; + m_storage.first().SetCapacity(expandedCapacity - 1); return; } } - pointer newData = reinterpret_cast(m_allocator.allocate(sizeof(node_type) * (numElements + 1), alignment_of::value)); - AZSTD_CONTAINER_ASSERT(newData != 0, "AZStd::string allocation failed!"); + pointer newData = reinterpret_cast(m_storage.second().allocate(sizeof(node_type) * (numElements + 1), alignof(node_type))); + AZSTD_CONTAINER_ASSERT(newData != nullptr, "AZStd::string allocation failed!"); - size_type newSize = numElements < m_size ? numElements : m_size; - const_pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + size_type newSize = numElements < m_storage.first().GetSize() ? numElements : m_storage.first().GetSize(); + pointer data = m_storage.first().GetData(); if (newSize > 0) { - Traits::copy(newData /*, newSize + 1*/, data, newSize); // copy existing elements - } - if (m_capacity >= SSO_BUF_SIZE) - { - deallocate_memory(m_data, expandedSize, typename allocator_type::allow_memory_leaks()); + Traits::copy(newData, data, newSize); // copy existing elements } + deallocate_memory(data, expandedSize, typename allocator_type::allow_memory_leaks()); - m_data = newData; - m_capacity = numElements; - m_size = newSize; - Traits::assign(m_data[newSize], Element()); // terminate + Traits::assign(newData[newSize], Element()); // terminate + m_storage.first().SetCapacity(numElements); + m_storage.first().SetData(newData); + m_storage.first().SetSize(newSize); } - -#ifdef AZSTD_HAS_CHECKED_ITERATORS - // when we move data in the buffer we don't really need to make invalid all iterators, but it's - // very important that we are consistent, so people don't have different behavior when they have - // short strings - orphan_all(); -#endif } } @@ -1521,9 +1483,9 @@ namespace AZStd } }; -// Clang supports compile-time check for printf-like signatures -// On MSVC, *only* if /analyze flag is enabled(defines _PREFAST_) we can also do a compile-time check -// For not affecting final release binary size, we don't use the templated version on Release configuration either + // Clang supports compile-time check for printf-like signatures + // On MSVC, *only* if /analyze flag is enabled(defines _PREFAST_) we can also do a compile-time check + // For not affecting final release binary size, we don't use the templated version on Release configuration either #if AZ_COMPILER_CLANG || defined(_PREFAST_) || defined(_RELEASE) # if AZ_COMPILER_CLANG # define FORMAT_FUNC __attribute__((format(printf, 1, 2))) @@ -1597,137 +1559,70 @@ namespace AZStd template inline basic_string(const basic_string& rhs) - : m_size(0) - , m_capacity(SSO_BUF_SIZE - 1) { assign(rhs.c_str()); } template inline this_type& operator=(const basic_string& rhs) { return assign(rhs.c_str()); } template - inline this_type& append(const basic_string& rhs) { return append(rhs.c_str()); } + inline this_type& append(const basic_string& rhs) { return append(rhs.c_str()); } template inline this_type& insert(size_type offset, const basic_string& rhs) { return insert(offset, rhs.c_str()); } template inline this_type& replace(size_type offset, size_type count, const basic_string& rhs) { return replace(offset, count, rhs.c_str()); } template - inline int compare(const basic_string& rhs) { return compare(rhs.c_str()); } + inline int compare(const basic_string& rhs) { return compare(rhs.c_str()); } // @} protected: - enum - { // length of internal buffer, [1, 16] - SSO_BUF_SIZE = 16 / sizeof (Element) < 1 ? 1 : 16 / sizeof(Element) - }; enum { // roundup mask for allocated buffers, [0, 15] - _ALLOC_MASK = sizeof (Element) <= 1 ? 15 : sizeof (Element) <= 2 ? 7 : sizeof (Element) <= 4 ? 3 : sizeof (Element) <= 8 ? 1 : 0 + _ALLOC_MASK = sizeof(Element) <= 1 ? 15 + : sizeof(Element) <= 2 ? 7 + : sizeof(Element) <= 4 ? 3 + : sizeof(Element) <= 8 ? 1 : 0 }; - template - inline this_type& append_iter(InputIterator count, InputIterator ch, const true_type& /* is_integral */) - { // append count * ch - return append((size_type)count, (Element)ch); - } - - template - inline void construct_iter(InputIterator count, InputIterator ch, const true_type& /* is_integral */) - { // initialize from count * ch - assign((size_type)count, (Element)ch); - } - - template - inline void construct_iter(InputIterator first, InputIterator last, const false_type& /*, const input_iterator_tag&*/) - { - // initialize from [first, last), input iterators - // \todo use insert ? - for (; first != last; ++first) - { - append((size_type)1, (Element) * first); - } - } - - - template - inline this_type& append_iter(InputIterator first, InputIterator last, const false_type& /* !is_integral */) - { // append [first, last), input iterators - return replace(end(), end(), first, last); - } - - - template - inline this_type& assign_iter(InputIterator count, InputIterator ch, const true_type&) { return assign((size_type)count, (Element)ch); } - template - inline this_type& assign_iter(InputIterator first, InputIterator last, const false_type&){ return replace(begin(), end(), first, last); } - - template - inline void insert_iter(const_iterator insertPos, InputIterator count, InputIterator ch, const true_type& /* is_integral() */) - { // insert count * ch at insertPos - insert(insertPos, (size_type)count, (Element)ch); - } - - template - inline void insert_iter(const_iterator insertPos, InputIterator first, InputIterator last, const false_type& /* is_integral() */) - { // insert [first, last) at insertPos, input iterators - replace(insertPos, insertPos, first, last); - } - - - template - inline this_type& replace_iter(const_iterator first, const_iterator last, InputIterator count, InputIterator ch, const true_type& /* is_intergral */) - { // replace [first, last) with count * ch - return replace(first, last, (size_type)count, (Element)ch); - } - - template - inline this_type& replace_iter(const_iterator first, const_iterator last, InputIterator first2, InputIterator last2, const false_type& /* !is_intergral */) - { // replace [first, last) with [first2, last2), input iterators - this_type rhs(first2, last2); - replace(first, last, rhs); - return *this; - } - void copy(size_type newSize, size_type oldLength) { size_type newCapacity = newSize | _ALLOC_MASK; - if (newCapacity / 3 < m_capacity / 2) + size_type currentCapacity = capacity(); + if (newCapacity / 3 < currentCapacity / 2) { - newCapacity = m_capacity + m_capacity / 2; // grow exponentially if possible + newCapacity = currentCapacity + currentCapacity / 2; // grow exponentially if possible } - if (newCapacity >= SSO_BUF_SIZE) + if (newCapacity >= ShortStringData::Capacity) { size_type expandedSize = 0; - if (m_capacity >= SSO_BUF_SIZE) + if (!m_storage.first().ShortStringOptimizationActive()) { - expandedSize = m_allocator.resize(m_data, sizeof(node_type) * (newCapacity + 1)); + expandedSize = m_storage.second().resize(m_storage.first().GetData(), sizeof(node_type) * (newCapacity + 1)); // our memory managers allocate on 8+ bytes boundary and our node type should be less than that in general, otherwise // we need to take care when we compute the size on deallocate. - AZ_Assert(expandedSize % sizeof(node_type) == 0, "Expanded size not a multiply of node type. This should not happen"); + AZ_Assert(expandedSize % sizeof(node_type) == 0, "Expanded size not a multiple of node type. This should not happen"); size_type expandedCapacity = expandedSize / sizeof(node_type); if (expandedCapacity > newCapacity) { - m_capacity = expandedCapacity - 1; + m_storage.first().SetCapacity(expandedCapacity - 1); return; } } - pointer newData = reinterpret_cast(m_allocator.allocate(sizeof(node_type) * (newCapacity + 1), alignment_of::value)); - AZSTD_CONTAINER_ASSERT(newData != 0, "AZStd::string allocation failed!"); + pointer newData = reinterpret_cast(m_storage.second().allocate(sizeof(node_type) * (newCapacity + 1), alignof(node_type))); + AZSTD_CONTAINER_ASSERT(newData != nullptr, "AZStd::string allocation failed!"); if (newData) { - const_pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; + pointer data = m_storage.first().GetData(); if (0 < oldLength) { - Traits::copy(newData /*, newSize + 1*/, data, oldLength); // copy existing elements - } - if (m_capacity >= SSO_BUF_SIZE) - { - deallocate_memory(m_data, expandedSize, typename allocator_type::allow_memory_leaks()); + Traits::copy(newData, data, oldLength); // copy existing elements } + deallocate_memory(data, expandedSize, typename allocator_type::allow_memory_leaks()); - m_data = newData; - m_capacity = newCapacity; - Traits::assign(m_data[newSize], Element()); // terminate + Traits::assign(newData[oldLength], Element()); // terminate + m_storage.first().SetCapacity(newCapacity); + m_storage.first().SetSize(oldLength); + m_storage.first().SetData(newData); } } } @@ -1735,40 +1630,209 @@ namespace AZStd bool grow(size_type newSize) { // ensure buffer is big enough, trim to size if _Trim is true - if (m_capacity < newSize) + if (capacity() < newSize) { - copy(newSize, m_size); // reallocate to grow + copy(newSize, size()); // reallocate to grow } else if (newSize == 0) { - pointer data = SSO_BUF_SIZE <= m_capacity ? m_data : m_buffer; - m_size = 0; + pointer data = m_storage.first().GetData(); + m_storage.first().SetSize(0); Traits::assign(data[0], Element()); // terminate } return (0 < newSize); // return true only if more work to do } + bool fits_in_capacity(size_type newSize) + { + return newSize <= capacity(); + } + inline void deallocate_memory(pointer, size_type, const true_type& /* allocator::allow_memory_leaks */) {} inline void deallocate_memory(pointer data, size_type expandedSize, const false_type& /* !allocator::allow_memory_leaks */) { - if (m_capacity >= SSO_BUF_SIZE) + if (!m_storage.first().ShortStringOptimizationActive()) { - size_type byteSize = (expandedSize == 0) ? (sizeof(node_type) * (m_capacity + 1)) : expandedSize; - m_allocator.deallocate(data, byteSize, alignment_of::value); + size_type byteSize = (expandedSize == 0) ? (sizeof(node_type) * (m_storage.first().GetCapacity() + 1)) : expandedSize; + m_storage.second().deallocate(data, byteSize, alignof(node_type)); } } - union //Storage + //! Assuming 64-bit for pointer and size_t size + //! The offset and sizes of each structure are marked below + + //! dynamically allocated data + struct AllocatedStringData { - Element m_buffer[SSO_BUF_SIZE]; //< small buffer used for small string optimization - pointer m_data; //< dynamically allocated data + AllocatedStringData() + { + m_capacity = 0; + m_ssoActive = false; + } + // bit offset: 0, bits: 64 + pointer m_data{}; + + // bit offset: 64, bit: 64 + size_type m_size{}; + + // Use all but the top bit of a size_t for the string capacity + // This allows the short string optimization to be used + // with no additional space at the cost of cutting the max_size in half + // to 2^63-1 + // offset: 128, bits: 63 + size_type m_capacity : AZStd::numeric_limits::digits - 1; + + // bit offset: 191, bits: 1 + size_type m_ssoActive : 1; + + // Total size 192 bits(24 bytes) }; - size_type m_size; // current length of string - size_type m_capacity; // current storage reserved for string - allocator_type m_allocator; + static_assert(sizeof(AllocatedStringData) <= 24, "The AllocatedStringData structure" + " should be an 8-byte pointer, 8 byte size, 63-bit capacity and 1-bit SSO flag for" + " a total of 24 bytes"); + + //! small buffer used for small string optimization + struct ShortStringData + { + //! The size can be stored within 7 bits since the buffer will be no larger + //! than 23 bytes(22 characters + 1 null-terminating character) + inline static constexpr size_type BufferMaxSize = sizeof(AllocatedStringData) - sizeof(AZ::u8); + static_assert(sizeof(Element) < BufferMaxSize, "The size of Element type must be less than the size of " + " the AllocatedStringData struct in order to use it with the basic_string class"); + inline static constexpr size_type BufferCapacityPlusNull = BufferMaxSize / sizeof(Element); + + inline static constexpr size_type Capacity = BufferCapacityPlusNull - 1; + + ShortStringData() + { + // Make sure the short string buffer is null-terminated + m_buffer[0] = Element{}; + m_size = 0; + m_ssoActive = true; + } + + // bit offset: 0, bits: 184 + Element m_buffer[BufferCapacityPlusNull]; + + // Padding to make sure for Element types with a size >1 + // such as wchar_t, that the `m_size` member starts at the bit 164 + // NOTE: Uses the anonymous struct extension + // supported by MSVC, Clang and GCC + // Takes advantage of the empty base optimization + // to have the StringInternal::Padding struct + // take 0 bytes when the Element type is 1-byte type like `char` + // When C++20 support is added, this can be changed to use [[no_unique_address]] + struct + : StringInternal::Padding + { + + // bit offset: 184, bits: 7 + AZ::u8 m_size : AZStd::numeric_limits::digits - 1; + + // bit offset: 191, bits: 1 + AZ::u8 m_ssoActive : 1; + }; + // Total size 192 bits(24 bytes) + }; + + struct PointerAlignedData + { + uintptr_t m_alignedValues[sizeof(ShortStringData) / sizeof(uintptr_t)]; + }; + + static_assert(sizeof(AllocatedStringData) == sizeof(ShortStringData) && "Short string struct must be the same size" + " as the regular allocated string struct"); + + static_assert(sizeof(PointerAlignedData) == sizeof(ShortStringData) && "Pointer aligned struct must be the same size" + " as the short string struct "); + + // The top-bit in the last byte of the AllocatedStringData and ShortStringData is used to determine if the short string optimization is being used + union Storage + { + Storage() {}; + + bool ShortStringOptimizationActive() const + { + return m_shortData.m_ssoActive; + } + const_pointer GetData() const + { + return ShortStringOptimizationActive() ? m_shortData.m_buffer + : reinterpret_cast(m_shortData).m_data; + } + pointer GetData() + { + return ShortStringOptimizationActive() ? m_shortData.m_buffer + : reinterpret_cast(m_shortData).m_data; + } + void SetData(pointer address) + { + if (!ShortStringOptimizationActive()) + { + reinterpret_cast(m_shortData).m_data = address; + } + else + { + AZSTD_CONTAINER_ASSERT(false, "Programming Error: string class is invoking SetData when the Short Optimization" + " is active. Make sure SetCapacity() is invoked" + " before calling this function."); + } + } + size_type GetSize() const + { + return ShortStringOptimizationActive() ? m_shortData.m_size + : reinterpret_cast(m_shortData).m_size; + } + void SetSize(size_type size) + { + if (ShortStringOptimizationActive()) + { + m_shortData.m_size = size; + } + else + { + reinterpret_cast(m_shortData).m_size = size; + } + } + size_type GetCapacity() const + { + return ShortStringOptimizationActive() ? m_shortData.Capacity + : reinterpret_cast(m_shortData).m_capacity; + } + void SetCapacity(size_type capacity) + { + if (capacity <= ShortStringData::Capacity) + { + m_shortData.m_ssoActive = true; + } + else + { + m_shortData.m_ssoActive = false; + reinterpret_cast(m_shortData).m_capacity = capacity; + } + } + void swap(Storage& rhs) + { + // Use pointer sized swaps to swap the string storage + AZStd::aligned_storage_for_t tempStorage; + ::memcpy(&tempStorage, this, sizeof(Storage)); + ::memcpy(this, &rhs, sizeof(Storage)); + ::memcpy(&rhs, &tempStorage, sizeof(Storage)); + } + private: + ShortStringData m_shortData{}; + AllocatedStringData m_allocatedData; + PointerAlignedData m_pointerData; + }; + + AZStd::compressed_pair m_storage; + +#if defined(HAVE_BENCHMARK) + friend class Benchmark::StringBenchmarkFixture; +#endif #ifdef AZSTD_HAS_CHECKED_ITERATORS void orphan_range(pointer first, pointer last) const @@ -1809,18 +1873,7 @@ namespace AZStd }; template - const typename basic_string::size_type basic_string::npos; - - // basic_string implements a performant swap - /*template - class move_operation_category > - { - public: - typedef swap_move_tag move_cat; - };*/ - - template - inline void swap(basic_string& left, basic_string& right) + inline void swap(basic_string& left, basic_string& right) { left.swap(right); } @@ -2027,6 +2080,3 @@ namespace AZStd }; } // namespace AZStd - -#endif // AZSTD_STRING_H -#pragma once diff --git a/Code/Framework/AzCore/AzCore/std/string/string_view.h b/Code/Framework/AzCore/AzCore/std/string/string_view.h index 30e61f95ce..841044dd16 100644 --- a/Code/Framework/AzCore/AzCore/std/string/string_view.h +++ b/Code/Framework/AzCore/AzCore/std/string/string_view.h @@ -280,18 +280,36 @@ namespace AZStd static constexpr char_type* assign(char_type* dest, size_t count, char_type ch) noexcept { AZ_Assert(dest, "Invalid input!"); - for (char_type* iter = dest; count; --count, ++iter) + + if constexpr (AZStd::is_same_v) { - assign(*iter, ch); + // Use builtin_memset if available for char type + if (az_builtin_is_constant_evaluated()) + { + for (char_type* iter = dest; count; --count, ++iter) + { + assign(*iter, ch); + } + } + else + { + ::memset(dest, ch, count); + } + } + else + { + for (char_type* iter = dest; count; --count, ++iter) + { + assign(*iter, ch); + } } + return dest; } static constexpr bool eq(char_type left, char_type right) noexcept { return left == right; } static constexpr bool lt(char_type left, char_type right) noexcept { return left < right; } static constexpr int compare(const char_type* s1, const char_type* s2, size_t count) noexcept { - // Regression in VS2017 15.8 and 15.9 where __builtin_memcmp fails in valid checks in constexpr evaluation -#if !defined(AZ_COMPILER_MSVC) || AZ_COMPILER_MSVC < 1915 || AZ_COMPILER_MSVC > 1916 if constexpr (AZStd::is_same_v) { return __builtin_memcmp(s1, s2, count); @@ -301,7 +319,6 @@ namespace AZStd return __builtin_wmemcmp(s1, s2, count); } else -#endif { for (; count; --count, ++s1, ++s2) { @@ -339,10 +356,6 @@ namespace AZStd } static constexpr const char_type* find(const char_type* s, size_t count, const char_type& ch) noexcept { - // There is a bug with the __builtin_char_memchr intrinsic in Visual Studio 2017 15.8.x and 15.9.x - // It reads in one more additional character than the value of count. - // This is probably due to assuming null-termination -#if !defined(AZ_COMPILER_MSVC) || AZ_COMPILER_MSVC < 1915 || AZ_COMPILER_MSVC > 1916 if constexpr (AZStd::is_same_v) { return __builtin_char_memchr(s, ch, count); @@ -353,7 +366,6 @@ namespace AZStd } else -#endif { for (; count; --count, ++s) { @@ -368,64 +380,112 @@ namespace AZStd static constexpr char_type* move(char_type* dest, const char_type* src, size_t count) noexcept { AZ_Assert(dest != nullptr && src != nullptr, "Invalid input!"); - if (count == 0) + if (count == 0 || src == dest) { return dest; } - char_type* result = dest; - // The less than(<), greater than(>) and other variants(<=, >=) - // Cannot be compare pointers within a constexpr due to the potential for undefined behavior - // per the bullet linked in the C++ standard at http://eel.is/c++draft/expr.compound#expr.rel-5 - // Now clang and gcc compilers allow the use of this relation operators in a constexpr, but - // msvc is not so forgiving - // So a workaround of iterating the src pointer, checking for equality with the dest pointer - // is used to check for overlap - auto should_copy_forward = [](const char_type* dest1, const char_type* src2, size_t count2) constexpr -> bool - { - bool dest_less_than_src{ true }; - for(const char_type* src_iter = src2; src_iter != src2 + count2; ++src_iter) + + #if az_has_builtin_memmove + __builtin_memmove(dest, src, count * sizeof(char_type)); + #else + auto NonBuiltinMove = [](char_type* dest1, const char_type* src1, size_t count1) constexpr + -> char_type* + { + if (az_builtin_is_constant_evaluated()) { - if (src_iter == dest1) + // The less than(<), greater than(>) and other variants(<=, >=) + // Cannot be compare pointers within a constexpr due to the potential for undefined behavior + // per the bullet linked in the C++ standard at http://eel.is/c++draft/expr.compound#expr.rel-5 + // Now clang and gcc compilers allow the use of this relation operators in a constexpr, but + // msvc is not so forgiving + // So a workaround of iterating the src pointer, checking for equality with the dest pointer + // is used to check for overlap + auto should_copy_forward = [](const char_type* dest2, const char_type* src2, size_t count2) constexpr -> bool + { + bool dest_less_than_src{ true }; + for (const char_type* src_iter = src2; src_iter != src2 + count2; ++src_iter) + { + if (src_iter == dest2) + { + dest_less_than_src = false; + break; + } + } + return dest_less_than_src; + }; + + if (should_copy_forward(dest1, src1, count1)) { - dest_less_than_src = false; - break; + copy(dest1, src1, count1); + } + else + { + copy_backward(dest1, src1, count1); } } - return dest_less_than_src; - }; + else + { + // Use the faster ::memmove operation at runtime + ::memmove(dest1, src1, count1 * sizeof(char_type)); + } - if (should_copy_forward(dest, src, count)) - { - copy(dest, src, count); - } - else - { - copy_backward(dest, src, count); - } + return dest1; + }; + NonBuiltinMove(dest, src, count); + #endif - return result; + return dest; } static constexpr char_type* copy(char_type* dest, const char_type* src, size_t count) noexcept { AZ_Assert(dest != nullptr && src != nullptr, "Invalid input!"); - char_type* result = dest; - for(; count; --count, ++dest, ++src) + + #if az_has_builtin_memcpy + __builtin_memcpy(dest, src, count * sizeof(char_type)); + #else + auto NonBuiltinCopy = [](char_type* dest1, const char_type* src1, size_t count1) constexpr + -> char_type* { - assign(*dest, *src); - } - return result; + if (az_builtin_is_constant_evaluated()) + { + for (; count1; --count1, ++dest1, ++src1) + { + assign(*dest1, *src1); + } + } + else + { + ::memcpy(dest1, src1, count1 * sizeof(char_type)); + } + return dest1; + }; + NonBuiltinCopy(dest, src, count); + #endif + + return dest; } // Extension for constexpr workarounds: Addresses of a string literal cannot be compared at compile time and MSVC and clang will just refuse to compile the constexpr // Adding a copy_backwards overload that always copies backwards. - static constexpr char_type* copy_backward(char_type* dest, const char_type*src, size_t count) noexcept + static constexpr char_type* copy_backward(char_type* dest, const char_type* src, size_t count) noexcept { char_type* result = dest; - dest += count; - src += count; - for (; count; --count) + #if az_has_builtin_memmove + __builtin_memmove(dest, src, count * sizeof(char_type)); + #else + if (az_builtin_is_constant_evaluated()) + { + dest += count; + src += count; + for (; count; --count) + { + assign(*--dest, *--src); + } + } + else { - assign(*--dest, *--src); + ::memmove(dest, src, count); } + #endif return result; } diff --git a/Code/Framework/AzCore/Platform/Common/VisualStudio/AzCore/Natvis/azcore.natvis b/Code/Framework/AzCore/Platform/Common/VisualStudio/AzCore/Natvis/azcore.natvis index 3730b8a4f9..dca82e2439 100644 --- a/Code/Framework/AzCore/Platform/Common/VisualStudio/AzCore/Natvis/azcore.natvis +++ b/Code/Framework/AzCore/Platform/Common/VisualStudio/AzCore/Natvis/azcore.natvis @@ -10,6 +10,13 @@ + + {m_element} + + + {$T1} is empty + + reverse_iterator base() {m_current} @@ -388,35 +395,41 @@ - - {m_buffer,s} - {m_data,s} - m_buffer,s - m_data,s + + {((AZStd::compressed_pair_element<AZStd::basic_string<char,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_shortData.m_buffer,s} + {((AZStd::compressed_pair_element<AZStd::basic_string<char,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_allocatedData.m_data,s} + ((AZStd::compressed_pair_element<AZStd::basic_string<char,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_shortData.m_buffer,s + ((AZStd::compressed_pair_element<AZStd::basic_string<char,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_allocatedData.m_data,s - m_size - m_capacity + (size_t)((AZStd::compressed_pair_element<AZStd::basic_string<char,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_shortData.m_size + ((AZStd::compressed_pair_element<AZStd::basic_string<char,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_allocatedData.m_size + ((AZStd::compressed_pair_element<AZStd::basic_string<char,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_shortData.Capacity + ((AZStd::compressed_pair_element<AZStd::basic_string<char,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_allocatedData.m_capacity - m_size - m_buffer - m_data + ((AZStd::compressed_pair_element<AZStd::basic_string<char,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_shortData.m_size,u + ((AZStd::compressed_pair_element<AZStd::basic_string<char,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_allocatedData.m_size + ((AZStd::compressed_pair_element<AZStd::basic_string<char,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_shortData.m_buffer + ((AZStd::compressed_pair_element<AZStd::basic_string<char,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_allocatedData.m_data - {m_buffer,su} - {m_data,su} - m_buffer,su - m_data,su - - m_size - m_capacity + {((AZStd::compressed_pair_element<AZStd::basic_string<wchar_t,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_shortData.m_buffer,su} + {((AZStd::compressed_pair_element<AZStd::basic_string<wchar_t,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_allocatedData.m_data,su} + ((AZStd::compressed_pair_element<AZStd::basic_string<wchar_t,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_shortData.m_buffer,su + ((AZStd::compressed_pair_element<AZStd::basic_string<wchar_t,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_allocatedData.m_data,su + + (size_t)((AZStd::compressed_pair_element<AZStd::basic_string<wchar_t,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_shortData.m_size + ((AZStd::compressed_pair_element<AZStd::basic_string<wchar_t,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_allocatedData.m_size + ((AZStd::compressed_pair_element<AZStd::basic_string<wchar_t,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_shortData.Capacity + ((AZStd::compressed_pair_element<AZStd::basic_string<wchar_t,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_allocatedData.m_capacity - m_size - m_buffer - m_data + ((AZStd::compressed_pair_element<AZStd::basic_string<wchar_t,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_shortData.m_size,u + ((AZStd::compressed_pair_element<AZStd::basic_string<wchar_t,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_allocatedData.m_size + ((AZStd::compressed_pair_element<AZStd::basic_string<wchar_t,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_shortData.m_buffer + ((AZStd::compressed_pair_element<AZStd::basic_string<wchar_t,$T1,$T2>::Storage,0,0>&)m_storage).m_element.m_allocatedData.m_data diff --git a/Code/Framework/AzCore/Tests/AZStd/String.cpp b/Code/Framework/AzCore/Tests/AZStd/String.cpp index 356310a94d..0f84ad0970 100644 --- a/Code/Framework/AzCore/Tests/AZStd/String.cpp +++ b/Code/Framework/AzCore/Tests/AZStd/String.cpp @@ -8,11 +8,11 @@ #include "UserTypes.h" #include -#include #include #include #include #include +#include #include #include #include @@ -21,13 +21,10 @@ #include // we need this for AZ_TEST_FLOAT compare -#include #include #include #include -using namespace AZStd; - // Because of the SSO (small string optimization) we always shoule have capacity != 0 and data != 0 #define AZ_TEST_VALIDATE_EMPTY_STRING(_String) \ EXPECT_TRUE(_String.validate()); \ @@ -81,8 +78,6 @@ namespace UnitTest va_end(mark); } -#if !AZ_UNIT_TEST_SKIP_STD_STRING_TESTS - TEST(StringC, VSNPrintf) { char buffer32[32]; @@ -168,75 +163,75 @@ namespace UnitTest { const char* sChar = "SSO string"; // 10 characters const char* sCharLong = "This is a long string test that will allocate"; // 45 characters - array aChar = { + AZStd::array aChar = { { 'a', 'b', 'c', 'd', 'e', 'f' } }; // short string (should use SSO) - string str1; + AZStd::string str1; AZ_TEST_VALIDATE_EMPTY_STRING(str1); // short char* - string str2(sChar); + AZStd::string str2(sChar); AZ_TEST_VALIDATE_STRING(str2, 10); - string str2_1(""); + AZStd::string str2_1(""); AZ_TEST_VALIDATE_EMPTY_STRING(str2_1); - string str3(sChar, 5); + AZStd::string str3(sChar, 5); AZ_TEST_VALIDATE_STRING(str3, 5); // long char* - string str4(sCharLong); + AZStd::string str4(sCharLong); AZ_TEST_VALIDATE_STRING(str4, 45); - string str5(sCharLong, 35); + AZStd::string str5(sCharLong, 35); AZ_TEST_VALIDATE_STRING(str5, 35); // element - string str6(13, 'a'); + AZStd::string str6(13, 'a'); AZ_TEST_VALIDATE_STRING(str6, 13); - string str6_1(0, 'a'); + AZStd::string str6_1(0, 'a'); AZ_TEST_VALIDATE_EMPTY_STRING(str6_1); - string str7(aChar.begin(), aChar.end()); + AZStd::string str7(aChar.begin(), aChar.end()); AZ_TEST_VALIDATE_STRING(str7, 6); - string str7_1(aChar.begin(), aChar.begin()); + AZStd::string str7_1(aChar.begin(), aChar.begin()); AZ_TEST_VALIDATE_EMPTY_STRING(str7_1); - string str8(sChar, sChar + 3); + AZStd::string str8(sChar, sChar + 3); AZ_TEST_VALIDATE_STRING(str8, 3); - string str8_1(sChar, sChar); + AZStd::string str8_1(sChar, sChar); AZ_TEST_VALIDATE_EMPTY_STRING(str8_1); // - string str9(str2); + AZStd::string str9(str2); AZ_TEST_VALIDATE_STRING(str9, 10); - string str9_1(str1); + AZStd::string str9_1(str1); AZ_TEST_VALIDATE_EMPTY_STRING(str9_1); - string str10(str2, 4); + AZStd::string str10(str2, 4); AZ_TEST_VALIDATE_STRING(str10, 6); - string str11(str2, 4, 3); + AZStd::string str11(str2, 4, 3); AZ_TEST_VALIDATE_STRING(str11, 3); - string str12(sChar); - string large = sCharLong; + AZStd::string str12(sChar); + AZStd::string large = sCharLong; // move ctor - string strSm = AZStd::move(str12); + AZStd::string strSm = AZStd::move(str12); AZ_TEST_VALIDATE_STRING(strSm, 10); AZ_TEST_VALIDATE_EMPTY_STRING(str12); - string strLg(AZStd::move(large)); + AZStd::string strLg(AZStd::move(large)); AZ_TEST_VALIDATE_STRING(strLg, 45); AZ_TEST_VALIDATE_EMPTY_STRING(large); - string strEmpty(AZStd::move(str1)); + AZStd::string strEmpty(AZStd::move(str1)); AZ_TEST_VALIDATE_EMPTY_STRING(strEmpty); AZ_TEST_VALIDATE_EMPTY_STRING(str1); @@ -369,7 +364,7 @@ namespace UnitTest AZ_TEST_VALIDATE_STRING(str2, 28); AZ_TEST_ASSERT(str2[0] == 'b'); - str2.erase(str2.begin(), next(str2.begin(), 4)); + str2.erase(str2.begin(), AZStd::next(str2.begin(), 4)); AZ_TEST_VALIDATE_STRING(str2, 24); AZ_TEST_ASSERT(str2[0] == 'f'); @@ -400,33 +395,33 @@ namespace UnitTest AZ_TEST_ASSERT(str2[3] == 'g'); AZ_TEST_ASSERT(str2[4] == 'g'); - str2.replace(str2.begin(), next(str2.begin(), str1.length()), str1); + str2.replace(str2.begin(), AZStd::next(str2.begin(), str1.length()), str1); AZ_TEST_VALIDATE_STRING(str2, 24); AZ_TEST_ASSERT(str2[0] == 'a'); AZ_TEST_ASSERT(str2[1] == 'b'); - str2.replace(str2.begin(), next(str2.begin(), 10), sChar); + str2.replace(str2.begin(), AZStd::next(str2.begin(), 10), sChar); AZ_TEST_VALIDATE_STRING(str2, 24); AZ_TEST_ASSERT(str2[0] == 'S'); AZ_TEST_ASSERT(str2[1] == 'S'); - str2.replace(str2.begin(), next(str2.begin(), 3), sChar, 3); + str2.replace(str2.begin(), AZStd::next(str2.begin(), 3), sChar, 3); AZ_TEST_VALIDATE_STRING(str2, 24); AZ_TEST_ASSERT(str2[0] == 'S'); AZ_TEST_ASSERT(str2[1] == 'S'); AZ_TEST_ASSERT(str2[2] == 'O'); - str2.replace(str2.begin(), next(str2.begin(), 2), 2, 'h'); + str2.replace(str2.begin(), AZStd::next(str2.begin(), 2), 2, 'h'); AZ_TEST_VALIDATE_STRING(str2, 24); AZ_TEST_ASSERT(str2[0] == 'h'); AZ_TEST_ASSERT(str2[1] == 'h'); - str2.replace(str2.begin(), next(str2.begin(), 2), aChar.begin(), next(aChar.begin(), 2)); + str2.replace(str2.begin(), AZStd::next(str2.begin(), 2), aChar.begin(), AZStd::next(aChar.begin(), 2)); AZ_TEST_VALIDATE_STRING(str2, 24); AZ_TEST_ASSERT(str2[0] == 'a'); AZ_TEST_ASSERT(str2[1] == 'b'); - str2.replace(str2.begin(), next(str2.begin(), 2), sChar, sChar + 5); + str2.replace(str2.begin(), AZStd::next(str2.begin(), 2), sChar, sChar + 5); AZ_TEST_VALIDATE_STRING(str2, 27); AZ_TEST_ASSERT(str2[0] == 'S'); AZ_TEST_ASSERT(str2[1] == 'S'); @@ -489,7 +484,7 @@ namespace UnitTest AZ_TEST_ASSERT(pos == 2); pos = str1.find('Z'); - AZ_TEST_ASSERT(pos == string::npos); + AZ_TEST_ASSERT(pos == AZStd::string::npos); pos = str1.rfind(str2); AZ_TEST_ASSERT(pos == 12); @@ -510,7 +505,7 @@ namespace UnitTest AZ_TEST_ASSERT(pos == 12); pos = str1.rfind('Z'); - AZ_TEST_ASSERT(pos == string::npos); + AZ_TEST_ASSERT(pos == AZStd::string::npos); pos = str1.find_first_of(str2); AZ_TEST_ASSERT(pos == 2); @@ -535,7 +530,7 @@ namespace UnitTest AZ_TEST_ASSERT(pos == 12); pos = str1.find_first_of('Z'); - AZ_TEST_ASSERT(pos == string::npos); + AZ_TEST_ASSERT(pos == AZStd::string::npos); pos = str1.find_last_of(str2); AZ_TEST_ASSERT(pos == 14); @@ -550,7 +545,7 @@ namespace UnitTest AZ_TEST_ASSERT(pos == 12); pos = str1.find_last_of('Z'); - AZ_TEST_ASSERT(pos == string::npos); + AZ_TEST_ASSERT(pos == AZStd::string::npos); pos = str1.find_first_not_of(str2, 3); AZ_TEST_ASSERT(pos == 5); @@ -559,13 +554,13 @@ namespace UnitTest AZ_TEST_ASSERT(pos == 0); pos = str1.find_last_not_of(sChar); - AZ_TEST_ASSERT(pos == string::npos); + AZ_TEST_ASSERT(pos == AZStd::string::npos); pos = str1.find_last_not_of('Z'); AZ_TEST_ASSERT(pos == 19); - string sub = str1.substr(0, 10); + AZStd::string sub = str1.substr(0, 10); AZ_TEST_VALIDATE_STRING(sub, 10); AZ_TEST_ASSERT(sub[0] == 'S'); AZ_TEST_ASSERT(sub[9] == 'g'); @@ -594,13 +589,13 @@ namespace UnitTest using iteratorType = char; auto testValue = str4; - reverse_iterator rend = testValue.rend(); - reverse_iterator crend1 = testValue.rend(); - reverse_iterator crend2 = testValue.crend(); + AZStd::reverse_iterator rend = testValue.rend(); + AZStd::reverse_iterator crend1 = testValue.rend(); + AZStd::reverse_iterator crend2 = testValue.crend(); - reverse_iterator rbegin = testValue.rbegin(); - reverse_iterator crbegin1 = testValue.rbegin(); - reverse_iterator crbegin2 = testValue.crbegin(); + AZStd::reverse_iterator rbegin = testValue.rbegin(); + AZStd::reverse_iterator crbegin1 = testValue.rbegin(); + AZStd::reverse_iterator crbegin2 = testValue.crbegin(); AZ_TEST_ASSERT(rend == crend1); AZ_TEST_ASSERT(crend1 == crend2); @@ -630,128 +625,128 @@ namespace UnitTest TEST_F(String, Algorithms) { - string str = string::format("%s %d", "BlaBla", 5); + AZStd::string str = AZStd::string::format("%s %d", "BlaBla", 5); AZ_TEST_VALIDATE_STRING(str, 8); - wstring wstr = wstring::format(L"%ls %d", L"BlaBla", 5); + AZStd::wstring wstr = AZStd::wstring::format(L"%ls %d", L"BlaBla", 5); AZ_TEST_VALIDATE_WSTRING(wstr, 8); - to_lower(str.begin(), str.end()); + AZStd::to_lower(str.begin(), str.end()); AZ_TEST_ASSERT(str[0] == 'b'); AZ_TEST_ASSERT(str[3] == 'b'); - to_upper(str.begin(), str.end()); + AZStd::to_upper(str.begin(), str.end()); AZ_TEST_ASSERT(str[1] == 'L'); AZ_TEST_ASSERT(str[2] == 'A'); - string intStr("10"); + AZStd::string intStr("10"); int ival = AZStd::stoi(intStr); AZ_TEST_ASSERT(ival == 10); - wstring wintStr(L"10"); + AZStd::wstring wintStr(L"10"); ival = AZStd::stoi(wintStr); AZ_TEST_ASSERT(ival == 10); - string floatStr("2.32"); + AZStd::string floatStr("2.32"); float fval = AZStd::stof(floatStr); AZ_TEST_ASSERT_FLOAT_CLOSE(fval, 2.32f); - wstring wfloatStr(L"2.32"); + AZStd::wstring wfloatStr(L"2.32"); fval = AZStd::stof(wfloatStr); AZ_TEST_ASSERT_FLOAT_CLOSE(fval, 2.32f); - to_string(intStr, 20); + AZStd::to_string(intStr, 20); AZ_TEST_ASSERT(intStr == "20"); - AZ_TEST_ASSERT(to_string(static_cast(20)) == "20"); - AZ_TEST_ASSERT(to_string(static_cast(20)) == "20"); - AZ_TEST_ASSERT(to_string(static_cast(20)) == "20"); - AZ_TEST_ASSERT(to_string(static_cast(20)) == "20"); - AZ_TEST_ASSERT(to_string(static_cast(20)) == "20"); - AZ_TEST_ASSERT(to_string(static_cast(20)) == "20"); + EXPECT_EQ("20", AZStd::to_string(static_cast(20))); + EXPECT_EQ("20", AZStd::to_string(static_cast(20))); + EXPECT_EQ("20", AZStd::to_string(static_cast(20))); + EXPECT_EQ("20", AZStd::to_string(static_cast(20))); + EXPECT_EQ("20", AZStd::to_string(static_cast(20))); + EXPECT_EQ("20", AZStd::to_string(static_cast(20))); // wstring to string - string str1; - to_string(str1, wstr); + AZStd::string str1; + AZStd::to_string(str1, wstr); AZ_TEST_ASSERT(str1 == "BlaBla 5"); EXPECT_EQ(8, to_string_length(wstr)); - str1 = string::format("%ls", wstr.c_str()); + str1 = AZStd::string::format("%ls", wstr.c_str()); AZ_TEST_ASSERT(str1 == "BlaBla 5"); // string to wstring - wstring wstr1; - to_wstring(wstr1, str); + AZStd::wstring wstr1; + AZStd::to_wstring(wstr1, str); AZ_TEST_ASSERT(wstr1 == L"BLABLA 5"); - wstr1 = wstring::format(L"%hs", str.c_str()); + wstr1 = AZStd::wstring::format(L"%hs", str.c_str()); AZ_TEST_ASSERT(wstr1 == L"BLABLA 5"); // wstring to char buffer char strBuffer[9]; - to_string(strBuffer, 9, wstr1.c_str()); + AZStd::to_string(strBuffer, 9, wstr1.c_str()); AZ_TEST_ASSERT(0 == azstricmp(strBuffer, "BLABLA 5")); EXPECT_EQ(8, to_string_length(wstr1)); // wstring to char with unicode - wstring ws1InfinityEscaped = L"Infinity: \u221E"; // escaped + AZStd::wstring ws1InfinityEscaped = L"Infinity: \u221E"; // escaped EXPECT_EQ(13, to_string_length(ws1InfinityEscaped)); // wchar_t buffer to char buffer wchar_t wstrBuffer[9] = L"BLABLA 5"; memset(strBuffer, 0, AZ_ARRAY_SIZE(strBuffer)); - to_string(strBuffer, 9, wstrBuffer); + AZStd::to_string(strBuffer, 9, wstrBuffer); AZ_TEST_ASSERT(0 == azstricmp(strBuffer, "BLABLA 5")); // string to wchar_t buffer memset(wstrBuffer, 0, AZ_ARRAY_SIZE(wstrBuffer)); - to_wstring(wstrBuffer, 9, str1.c_str()); + AZStd::to_wstring(wstrBuffer, 9, str1.c_str()); AZ_TEST_ASSERT(0 == azwcsicmp(wstrBuffer, L"BlaBla 5")); // char buffer to wchar_t buffer memset(wstrBuffer, L' ', AZ_ARRAY_SIZE(wstrBuffer)); // to check that the null terminator is properly placed - to_wstring(wstrBuffer, 9, strBuffer); + AZStd::to_wstring(wstrBuffer, 9, strBuffer); AZ_TEST_ASSERT(0 == azwcsicmp(wstrBuffer, L"BLABLA 5")); // wchar UTF16/UTF32 to/from Utf8 wstr1 = L"this is a \u20AC \u00A3 test"; // that's a euro and a pound sterling AZStd::to_string(str, wstr1); - wstring wstr2; + AZStd::wstring wstr2; AZStd::to_wstring(wstr2, str); AZ_TEST_ASSERT(wstr1 == wstr2); // tokenize - vector tokens; - tokenize(string("one, two, three"), string(", "), tokens); + AZStd::vector tokens; + AZStd::tokenize(AZStd::string("one, two, three"), AZStd::string(", "), tokens); AZ_TEST_ASSERT(tokens.size() == 3); AZ_TEST_ASSERT(tokens[0] == "one"); AZ_TEST_ASSERT(tokens[1] == "two"); AZ_TEST_ASSERT(tokens[2] == "three"); - tokenize(string("one, ,, two, ,, three"), string(", "), tokens); + AZStd::tokenize(AZStd::string("one, ,, two, ,, three"), AZStd::string(", "), tokens); AZ_TEST_ASSERT(tokens.size() == 3); AZ_TEST_ASSERT(tokens[0] == "one"); AZ_TEST_ASSERT(tokens[1] == "two"); AZ_TEST_ASSERT(tokens[2] == "three"); - tokenize(string("thequickbrownfox"), string("ABC"), tokens); + AZStd::tokenize(AZStd::string("thequickbrownfox"), AZStd::string("ABC"), tokens); AZ_TEST_ASSERT(tokens.size() == 1); AZ_TEST_ASSERT(tokens[0] == "thequickbrownfox"); - tokenize(string(""), string(""), tokens); + AZStd::tokenize(AZStd::string{}, AZStd::string{}, tokens); AZ_TEST_ASSERT(tokens.empty()); - tokenize(string("ABC"), string("ABC"), tokens); + AZStd::tokenize(AZStd::string("ABC"), AZStd::string("ABC"), tokens); AZ_TEST_ASSERT(tokens.empty()); - tokenize(string(" foo bar "), string(" "), tokens); + AZStd::tokenize(AZStd::string(" foo bar "), AZStd::string(" "), tokens); AZ_TEST_ASSERT(tokens.size() == 2); AZ_TEST_ASSERT(tokens[0] == "foo"); AZ_TEST_ASSERT(tokens[1] == "bar"); - tokenize_keep_empty(string(" foo , bar "), string(","), tokens); + AZStd::tokenize_keep_empty(AZStd::string(" foo , bar "), AZStd::string(","), tokens); AZ_TEST_ASSERT(tokens.size() == 2); AZ_TEST_ASSERT(tokens[0] == " foo "); AZ_TEST_ASSERT(tokens[1] == " bar "); // Sort - AZStd::vector toSort; + AZStd::vector toSort; toSort.push_back("z2"); toSort.push_back("z100"); toSort.push_back("z1"); @@ -761,39 +756,39 @@ namespace UnitTest AZ_TEST_ASSERT(toSort[2] == "z2"); // Natural sort - AZ_TEST_ASSERT(alphanum_comp("", "") == 0); - AZ_TEST_ASSERT(alphanum_comp("", "a") < 0); - AZ_TEST_ASSERT(alphanum_comp("a", "") > 0); - AZ_TEST_ASSERT(alphanum_comp("a", "a") == 0); - AZ_TEST_ASSERT(alphanum_comp("", "9") < 0); - AZ_TEST_ASSERT(alphanum_comp("9", "") > 0); - AZ_TEST_ASSERT(alphanum_comp("1", "1") == 0); - AZ_TEST_ASSERT(alphanum_comp("1", "2") < 0); - AZ_TEST_ASSERT(alphanum_comp("3", "2") > 0); - AZ_TEST_ASSERT(alphanum_comp("a1", "a1") == 0); - AZ_TEST_ASSERT(alphanum_comp("a1", "a2") < 0); - AZ_TEST_ASSERT(alphanum_comp("a2", "a1") > 0); - AZ_TEST_ASSERT(alphanum_comp("a1a2", "a1a3") < 0); - AZ_TEST_ASSERT(alphanum_comp("a1a2", "a1a0") > 0); - AZ_TEST_ASSERT(alphanum_comp("134", "122") > 0); - AZ_TEST_ASSERT(alphanum_comp("12a3", "12a3") == 0); - AZ_TEST_ASSERT(alphanum_comp("12a1", "12a0") > 0); - AZ_TEST_ASSERT(alphanum_comp("12a1", "12a2") < 0); - AZ_TEST_ASSERT(alphanum_comp("a", "aa") < 0); - AZ_TEST_ASSERT(alphanum_comp("aaa", "aa") > 0); - AZ_TEST_ASSERT(alphanum_comp("Alpha 2", "Alpha 2") == 0); - AZ_TEST_ASSERT(alphanum_comp("Alpha 2", "Alpha 2A") < 0); - AZ_TEST_ASSERT(alphanum_comp("Alpha 2 B", "Alpha 2") > 0); - string strA("Alpha 2"); - AZ_TEST_ASSERT(alphanum_comp(strA, "Alpha 2") == 0); - AZ_TEST_ASSERT(alphanum_comp(strA, "Alpha 2A") < 0); - AZ_TEST_ASSERT(alphanum_comp("Alpha 2 B", strA) > 0); - AZ_TEST_ASSERT(alphanum_comp(strA, strdup("Alpha 2")) == 0); - AZ_TEST_ASSERT(alphanum_comp(strA, strdup("Alpha 2A")) < 0); - AZ_TEST_ASSERT(alphanum_comp(strdup("Alpha 2 B"), strA) > 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("", "") == 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("", "a") < 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("a", "") > 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("a", "a") == 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("", "9") < 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("9", "") > 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("1", "1") == 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("1", "2") < 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("3", "2") > 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("a1", "a1") == 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("a1", "a2") < 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("a2", "a1") > 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("a1a2", "a1a3") < 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("a1a2", "a1a0") > 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("134", "122") > 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("12a3", "12a3") == 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("12a1", "12a0") > 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("12a1", "12a2") < 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("a", "aa") < 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("aaa", "aa") > 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("Alpha 2", "Alpha 2") == 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("Alpha 2", "Alpha 2A") < 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("Alpha 2 B", "Alpha 2") > 0); + AZStd::string strA("Alpha 2"); + AZ_TEST_ASSERT(AZStd::alphanum_comp(strA, "Alpha 2") == 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp(strA, "Alpha 2A") < 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp("Alpha 2 B", strA) > 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp(strA, strdup("Alpha 2")) == 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp(strA, strdup("Alpha 2A")) < 0); + AZ_TEST_ASSERT(AZStd::alphanum_comp(strdup("Alpha 2 B"), strA) > 0); // show usage of the comparison functor with a set - using StringSetType = set>; + using StringSetType = AZStd::set>; StringSetType s; s.insert("Xiph Xlater 58"); s.insert("Xiph Xlater 5000"); @@ -879,7 +874,7 @@ namespace UnitTest AZ_TEST_ASSERT(*setIt++ == "Xiph Xlater 10000"); // show usage of comparison functor with a map - using StringIntMapType = map>; + using StringIntMapType = AZStd::map>; StringIntMapType m; m["z1.doc"] = 1; m["z10.doc"] = 2; @@ -931,13 +926,13 @@ namespace UnitTest AZ_TEST_ASSERT((mapIt++)->second == 5); // show usage of comparison functor with an STL algorithm on a vector - vector v; + AZStd::vector v; // vector contents are reversed sorted contents of the old set - AZStd::copy(s.rbegin(), s.rend(), back_inserter(v)); + AZStd::copy(s.rbegin(), s.rend(), AZStd::back_inserter(v)); // now sort the vector with the algorithm - AZStd::sort(v.begin(), v.end(), alphanum_less()); + AZStd::sort(v.begin(), v.end(), AZStd::alphanum_less()); // check values - vector::const_iterator vecIt = v.begin(); + AZStd::vector::const_iterator vecIt = v.begin(); AZ_TEST_ASSERT(*vecIt++ == "10X Radonius"); AZ_TEST_ASSERT(*vecIt++ == "20X Radonius"); AZ_TEST_ASSERT(*vecIt++ == "20X Radonius Prime"); @@ -988,52 +983,52 @@ namespace UnitTest TEST_F(Regex, Regex_IPAddressSubnetPattern_Success) { // Error case for LY-43888 - regex txt_regex("^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(/([0-9]|[1-2][0-9]|3[0-2]))?$"); - string sample_input("10.85.22.92/24"); - bool match = regex_match(sample_input, txt_regex); + AZStd::regex txt_regex("^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(/([0-9]|[1-2][0-9]|3[0-2]))?$"); + AZStd::string sample_input("10.85.22.92/24"); + bool match = AZStd::regex_match(sample_input, txt_regex); AZ_TEST_ASSERT(match); } TEST_F(Regex, MatchConstChar) { //regex - AZ_TEST_ASSERT(regex_match("subject", regex("(sub)(.*)"))); + AZ_TEST_ASSERT(AZStd::regex_match("subject", AZStd::regex("(sub)(.*)"))); } TEST_F(Regex, MatchString) { - string reStr("subject"); - regex re("(sub)(.*)"); - AZ_TEST_ASSERT(regex_match(reStr, re)); - AZ_TEST_ASSERT(regex_match(reStr.begin(), reStr.end(), re)) + AZStd::string reStr("subject"); + AZStd::regex re("(sub)(.*)"); + AZ_TEST_ASSERT(AZStd::regex_match(reStr, re)); + AZ_TEST_ASSERT(AZStd::regex_match(reStr.begin(), reStr.end(), re)) } TEST_F(Regex, CMatch) { - regex re("(sub)(.*)"); - cmatch cm; // same as match_results cm; - regex_match("subject", cm, re); + AZStd::regex re("(sub)(.*)"); + AZStd::cmatch cm; // same as match_results cm; + AZStd::regex_match("subject", cm, re); AZ_TEST_ASSERT(cm.size() == 3); } TEST_F(Regex, SMatch) { - string reStr("subject"); - regex re("(sub)(.*)"); - smatch sm; // same as std::match_results sm; - regex_match(reStr, sm, re); + AZStd::string reStr("subject"); + AZStd::regex re("(sub)(.*)"); + AZStd::smatch sm; // same as std::match_results sm; + AZStd::regex_match(reStr, sm, re); AZ_TEST_ASSERT(sm.size() == 3); - regex_match(reStr.cbegin(), reStr.cend(), sm, re); + AZStd::regex_match(reStr.cbegin(), reStr.cend(), sm, re); AZ_TEST_ASSERT(sm.size() == 3); } TEST_F(Regex, CMatchWithFlags) { - regex re("(sub)(.*)"); - cmatch cm; // same as match_results cm; + AZStd::regex re("(sub)(.*)"); + AZStd::cmatch cm; // same as match_results cm; // using explicit flags: - regex_match("subject", cm, re, regex_constants::match_default); + AZStd::regex_match("subject", cm, re, AZStd::regex_constants::match_default); AZ_TEST_ASSERT(cm[0] == "subject"); AZ_TEST_ASSERT(cm[1] == "sub"); AZ_TEST_ASSERT(cm[2] == "ject"); @@ -1042,18 +1037,18 @@ namespace UnitTest TEST_F(Regex, PatternMatchFiles) { // Simple regular expression matching - string fnames[] = { "foo.txt", "bar.txt", "baz.dat", "zoidberg" }; - regex txt_regex("[a-z]+\\.txt"); + AZStd::string fnames[] = { "foo.txt", "bar.txt", "baz.dat", "zoidberg" }; + AZStd::regex txt_regex("[a-z]+\\.txt"); for (size_t i = 0; i < AZ_ARRAY_SIZE(fnames); ++i) { if (i < 2) { - AZ_TEST_ASSERT(regex_match(fnames[i], txt_regex) == true); + AZ_TEST_ASSERT(AZStd::regex_match(fnames[i], txt_regex) == true); } else { - AZ_TEST_ASSERT(regex_match(fnames[i], txt_regex) == false); + AZ_TEST_ASSERT(AZStd::regex_match(fnames[i], txt_regex) == false); } } } @@ -1061,13 +1056,13 @@ namespace UnitTest TEST_F(Regex, PatternWithSingleCaptureGroup) { // Extraction of a sub-match - string fnames[] = { "foo.txt", "bar.txt", "baz.dat", "zoidberg" }; - regex base_regex("([a-z]+)\\.txt"); - smatch base_match; + AZStd::string fnames[] = { "foo.txt", "bar.txt", "baz.dat", "zoidberg" }; + AZStd::regex base_regex("([a-z]+)\\.txt"); + AZStd::smatch base_match; for (size_t i = 0; i < AZ_ARRAY_SIZE(fnames); ++i) { - if (regex_match(fnames[i], base_match, base_regex)) + if (AZStd::regex_match(fnames[i], base_match, base_regex)) { AZ_TEST_ASSERT(base_match.size() == 2); AZ_TEST_ASSERT(base_match[1] == "foo" || base_match[1] == "bar") @@ -1078,12 +1073,12 @@ namespace UnitTest TEST_F(Regex, PatternWithMultipleCaptureGroups) { // Extraction of several sub-matches - string fnames[] = { "foo.txt", "bar.txt", "baz.dat", "zoidberg" }; - regex pieces_regex("([a-z]+)\\.([a-z]+)"); - smatch pieces_match; + AZStd::string fnames[] = { "foo.txt", "bar.txt", "baz.dat", "zoidberg" }; + AZStd::regex pieces_regex("([a-z]+)\\.([a-z]+)"); + AZStd::smatch pieces_match; for (size_t i = 0; i < AZ_ARRAY_SIZE(fnames); ++i) { - if (regex_match(fnames[i], pieces_match, pieces_regex)) + if (AZStd::regex_match(fnames[i], pieces_match, pieces_regex)) { AZ_TEST_ASSERT(pieces_match.size() == 3); AZ_TEST_ASSERT(pieces_match[0] == "foo.txt" || pieces_match[0] == "bar.txt" || pieces_match[0] == "baz.dat"); @@ -1096,40 +1091,40 @@ namespace UnitTest TEST_F(Regex, WideCharTests) { //wchar_t - AZ_TEST_ASSERT(regex_match(L"subject", wregex(L"(sub)(.*)"))); - wstring reWStr(L"subject"); - wregex reW(L"(sub)(.*)"); - AZ_TEST_ASSERT(regex_match(reWStr, reW)); - AZ_TEST_ASSERT(regex_match(reWStr.begin(), reWStr.end(), reW)) + AZ_TEST_ASSERT(AZStd::regex_match(L"subject", AZStd::wregex(L"(sub)(.*)"))); + AZStd::wstring reWStr(L"subject"); + AZStd::wregex reW(L"(sub)(.*)"); + AZ_TEST_ASSERT(AZStd::regex_match(reWStr, reW)); + AZ_TEST_ASSERT(AZStd::regex_match(reWStr.begin(), reWStr.end(), reW)) } TEST_F(Regex, LongPatterns) { // test construction and destruction of a regex with a pattern long enough to require reallocation of buffers - regex longerThan16(".*\\/Presets\\/GeomCache\\/.*", regex::flag_type::icase | regex::flag_type::ECMAScript); - regex longerThan32(".*\\/Presets\\/GeomCache\\/Whatever\\/Much\\/Test\\/Very\\/Memory\\/.*", regex::flag_type::icase); + AZStd::regex longerThan16(".*\\/Presets\\/GeomCache\\/.*", AZStd::regex::flag_type::icase | AZStd::regex::flag_type::ECMAScript); + AZStd::regex longerThan32(".*\\/Presets\\/GeomCache\\/Whatever\\/Much\\/Test\\/Very\\/Memory\\/.*", AZStd::regex::flag_type::icase); } TEST_F(Regex, SmileyFaceParseRegression) { - regex smiley(":)"); + AZStd::regex smiley(":)"); EXPECT_TRUE(smiley.Empty()); EXPECT_TRUE(smiley.GetError() != nullptr); - EXPECT_FALSE(regex_match("wut", smiley)); - EXPECT_FALSE(regex_match(":)", smiley)); + EXPECT_FALSE(AZStd::regex_match("wut", smiley)); + EXPECT_FALSE(AZStd::regex_match(":)", smiley)); } TEST_F(Regex, ParseFailure) { - regex failed(")))/?!\\$"); + AZStd::regex failed(")))/?!\\$"); EXPECT_FALSE(failed.Valid()); - regex other = AZStd::move(failed); + AZStd::regex other = AZStd::move(failed); EXPECT_FALSE(other.Valid()); - regex other2; + AZStd::regex other2; other2.swap(other); EXPECT_TRUE(other.Empty()); EXPECT_TRUE(other.GetError() == nullptr); @@ -1139,69 +1134,69 @@ namespace UnitTest TEST_F(String, ConstString) { - string_view cstr1; - AZ_TEST_ASSERT(cstr1.data()==nullptr); - AZ_TEST_ASSERT(cstr1.size() == 0); - AZ_TEST_ASSERT(cstr1.length() == 0); - AZ_TEST_ASSERT(cstr1.begin() == cstr1.end()); - AZ_TEST_ASSERT(cstr1 == string_view()); - AZ_TEST_ASSERT(cstr1.empty()); - - string_view cstr2("Test"); - AZ_TEST_ASSERT(cstr2.data() != nullptr); - AZ_TEST_ASSERT(cstr2.size() == 4); - AZ_TEST_ASSERT(cstr2.length() == 4); - AZ_TEST_ASSERT(cstr2.begin() != cstr2.end()); - AZ_TEST_ASSERT(cstr2 != cstr1); - AZ_TEST_ASSERT(cstr2 == string_view("Test")); - AZ_TEST_ASSERT(cstr2 == "Test"); - AZ_TEST_ASSERT(cstr2 != "test"); - AZ_TEST_ASSERT(cstr2[2] == 's'); - AZ_TEST_ASSERT(cstr2.at(2) == 's'); + AZStd::string_view cstr1; + EXPECT_EQ(nullptr, cstr1.data()); + EXPECT_EQ(0, cstr1.size()); + EXPECT_EQ(0, cstr1.length()); + EXPECT_EQ(cstr1.begin(), cstr1.end()); + EXPECT_EQ(cstr1, AZStd::string_view()); + EXPECT_TRUE(cstr1.empty()); + + AZStd::string_view cstr2("Test"); + EXPECT_NE(nullptr, cstr2.data()); + EXPECT_EQ(4, cstr2.size()); + EXPECT_EQ(4, cstr2.length()); + EXPECT_NE(cstr2.begin(), cstr2.end()); + EXPECT_NE(cstr2, cstr1); + EXPECT_EQ(cstr2, AZStd::string_view("Test")); + EXPECT_EQ(cstr2, "Test"); + EXPECT_NE(cstr2, "test"); + EXPECT_EQ(cstr2[2], 's'); + EXPECT_EQ(cstr2.at(2), 's'); AZ_TEST_START_TRACE_SUPPRESSION; - AZ_TEST_ASSERT(cstr2.at(7) == 0); + EXPECT_EQ(0, cstr2.at(7)); AZ_TEST_STOP_TRACE_SUPPRESSION(1); - AZ_TEST_ASSERT(!cstr2.empty()); - AZ_TEST_ASSERT(cstr2.data() == string("Test")); - AZ_TEST_ASSERT((string)cstr2 == string("Test")); + EXPECT_FALSE(cstr2.empty()); + EXPECT_EQ(cstr2.data(), AZStd::string("Test")); + EXPECT_EQ(cstr2, AZStd::string("Test")); - string_view cstr3 = cstr2; - AZ_TEST_ASSERT(cstr3 == cstr2); + AZStd::string_view cstr3 = cstr2; + EXPECT_EQ(cstr3, cstr2); cstr3.swap(cstr1); - AZ_TEST_ASSERT(cstr3 == string_view()); - AZ_TEST_ASSERT(cstr1 == cstr2); + EXPECT_EQ(cstr3, AZStd::string_view()); + EXPECT_EQ(cstr1, cstr2); cstr1 = {}; - AZ_TEST_ASSERT(cstr1 == string_view()); - AZ_TEST_ASSERT(cstr1.size() == 0); - AZ_TEST_ASSERT(cstr1.length() == 0); + EXPECT_EQ(cstr1, AZStd::string_view()); + EXPECT_EQ(0, cstr1.size()); + EXPECT_EQ(0, cstr1.length()); AZStd::string str1("Test"); - AZ_TEST_ASSERT(cstr2 == str1); + EXPECT_EQ(cstr2, str1); cstr1 = str1; - AZ_TEST_ASSERT(cstr1 == cstr2); + EXPECT_EQ(cstr1, cstr2); // check hashing - AZStd::hash h; + AZStd::hash h; AZStd::size_t value = h(cstr1); - AZ_TEST_ASSERT(value != 0); + EXPECT_NE(0, value); // testing empty string AZStd::string emptyString; - string_view cstr4; + AZStd::string_view cstr4; cstr4 = emptyString; - AZ_TEST_ASSERT(cstr4.data() != nullptr); - AZ_TEST_ASSERT(cstr4.size() == 0); - AZ_TEST_ASSERT(cstr4.length() == 0); - AZ_TEST_ASSERT(cstr4.begin() == cstr4.end()); - AZ_TEST_ASSERT(cstr4.empty()); + EXPECT_NE(nullptr, cstr4.data()); + EXPECT_EQ(0, cstr4.size()); + EXPECT_EQ(0, cstr4.length()); + EXPECT_EQ(cstr4.begin(), cstr4.end()); + EXPECT_TRUE(cstr4.empty()); } TEST_F(String, StringViewModifierTest) { - string_view emptyView1; - string_view view2("Needle in Haystack"); + AZStd::string_view emptyView1; + AZStd::string_view view2("Needle in Haystack"); // front EXPECT_EQ('N', view2.front()); @@ -1209,7 +1204,7 @@ namespace UnitTest EXPECT_EQ('k', view2.back()); AZStd::string findStr("Hay"); - string_view view3(findStr); + AZStd::string_view view3(findStr); // copy const size_t destBufferSize = 32; @@ -1223,17 +1218,17 @@ namespace UnitTest AZ_TEST_STOP_TRACE_SUPPRESSION(1); // substr - string_view subView2 = view2.substr(10); + AZStd::string_view subView2 = view2.substr(10); EXPECT_EQ("Haystack", subView2); AZ_TEST_START_TRACE_SUPPRESSION; - [[maybe_unused]] string_view assertSubView = view2.substr(view2.size() + 1); + [[maybe_unused]] AZStd::string_view assertSubView = view2.substr(view2.size() + 1); AZ_TEST_STOP_TRACE_SUPPRESSION(1); // compare AZStd::size_t compareResult = view2.compare(1, view2.size() - 1, dest, copyResult); EXPECT_EQ(0, compareResult); - string_view compareView = "Stackhay in Needle"; + AZStd::string_view compareView = "Stackhay in Needle"; compareResult = compareView.compare(view2); EXPECT_NE(0, compareResult); @@ -1252,7 +1247,7 @@ namespace UnitTest EXPECT_EQ(10, findResult); findResult = compareView.find("Random String"); - EXPECT_EQ(string_view::npos, findResult); + EXPECT_EQ(AZStd::string_view::npos, findResult); findResult = view3.find('y', 2); EXPECT_EQ(2, findResult); @@ -1262,13 +1257,13 @@ namespace UnitTest EXPECT_EQ(1, rfindResult); rfindResult = emptyView1.rfind(""); - EXPECT_EQ(string_view::npos, rfindResult); + EXPECT_EQ(AZStd::string_view::npos, rfindResult); rfindResult = view2.rfind("z"); - EXPECT_EQ(string_view::npos, rfindResult); + EXPECT_EQ(AZStd::string_view::npos, rfindResult); // find_first_of - string_view repeatString = "abcdefabcfedghiabcdef"; + AZStd::string_view repeatString = "abcdefabcfedghiabcdef"; AZStd::size_t findFirstOfResult = repeatString.find_first_of('f'); EXPECT_EQ(5, findFirstOfResult); @@ -1281,7 +1276,7 @@ namespace UnitTest AZStd::string notFoundStr = "zzz"; AZStd::string foundStr = "ghi"; findFirstOfResult = repeatString.find_first_of(notFoundStr); - EXPECT_EQ(string_view::npos, findFirstOfResult); + EXPECT_EQ(AZStd::string_view::npos, findFirstOfResult); findFirstOfResult = repeatString.find_first_of(foundStr); EXPECT_EQ(12, findFirstOfResult); @@ -1297,7 +1292,7 @@ namespace UnitTest EXPECT_EQ(3, findLastOfResult); findLastOfResult = repeatString.find_last_of(notFoundStr); - EXPECT_EQ(string_view::npos, findLastOfResult); + EXPECT_EQ(AZStd::string_view::npos, findLastOfResult); findLastOfResult = repeatString.find_last_of(foundStr); EXPECT_EQ(14, findLastOfResult); @@ -1335,12 +1330,12 @@ namespace UnitTest EXPECT_EQ(11, findLastNotOfResult); // remove_prefix - string_view prefixRemovalView = view2; + AZStd::string_view prefixRemovalView = view2; prefixRemovalView.remove_prefix(6); EXPECT_EQ(" in Haystack", prefixRemovalView); // remove_suffix - string_view suffixRemovalView = view2; + AZStd::string_view suffixRemovalView = view2; suffixRemovalView.remove_suffix(8); EXPECT_EQ("Needle in ", suffixRemovalView); @@ -1365,10 +1360,10 @@ namespace UnitTest TEST_F(String, StringViewCmpOperatorTest) { - string_view view1("The quick brown fox jumped over the lazy dog"); - string_view view2("Needle in Haystack"); - string_view emptyBeaverView; - string_view superEmptyBeaverView(""); + AZStd::string_view view1("The quick brown fox jumped over the lazy dog"); + AZStd::string_view view2("Needle in Haystack"); + AZStd::string_view emptyBeaverView; + AZStd::string_view superEmptyBeaverView(""); EXPECT_EQ("", emptyBeaverView); EXPECT_EQ("", superEmptyBeaverView); @@ -1378,13 +1373,13 @@ namespace UnitTest EXPECT_EQ(view2, "Needle in Haystack"); EXPECT_NE(view2, "Needle in Hayqueue"); - string_view compareView(view2); + AZStd::string_view compareView(view2); EXPECT_EQ(view2, compareView); EXPECT_NE(view2, view1); AZStd::string compareStr("Busy Beaver"); - string_view notBeaverView("Lumber Beaver"); - string_view beaverView("Busy Beaver"); + AZStd::string_view notBeaverView("Lumber Beaver"); + AZStd::string_view beaverView("Busy Beaver"); EXPECT_EQ(compareStr, beaverView); EXPECT_NE(compareStr, notBeaverView); @@ -1528,8 +1523,8 @@ namespace UnitTest TYPED_TEST_CASE(BasicStringViewConstexprFixture, StringViewElementTypes); TYPED_TEST(BasicStringViewConstexprFixture, StringView_DefaultConstructorsIsConstexpr) { - constexpr basic_string_view defaultView1; - constexpr basic_string_view defaultView2; + constexpr AZStd::basic_string_view defaultView1; + constexpr AZStd::basic_string_view defaultView2; static_assert(defaultView1 == defaultView2, "string_view constructor should be constexpr"); } @@ -1549,7 +1544,7 @@ namespace UnitTest return {}; }(); - constexpr basic_string_view charTView1(compileTimeString); + constexpr AZStd::basic_string_view charTView1(compileTimeString); static_assert(charTView1.size() == 10, "string_view constructor should be constexpr"); // non-null terminated compile time string constexpr const TypeParam* compileTimeString2 = []() constexpr -> const TypeParam* @@ -1565,7 +1560,7 @@ namespace UnitTest return {}; }(); - constexpr basic_string_view charTViewWithLength(compileTimeString2, 7); + constexpr AZStd::basic_string_view charTViewWithLength(compileTimeString2, 7); static_assert(charTViewWithLength.size() == 7, "string_view constructor should be constexpr"); } @@ -1585,8 +1580,8 @@ namespace UnitTest return {}; }(); - constexpr basic_string_view copyView1(compileTimeString); - constexpr basic_string_view copyView2(copyView1); + constexpr AZStd::basic_string_view copyView1(compileTimeString); + constexpr AZStd::basic_string_view copyView2(copyView1); static_assert(copyView1 == copyView2, "string_view constructor should be constexpr"); } @@ -1606,8 +1601,8 @@ namespace UnitTest return {}; }(); - constexpr basic_string_view assignView1(compileTimeString1); - auto assignment_test_func = [](basic_string_view sourceView) constexpr -> basic_string_view + constexpr AZStd::basic_string_view assignView1(compileTimeString1); + auto assignment_test_func = [](AZStd::basic_string_view sourceView) constexpr -> AZStd::basic_string_view { constexpr const TypeParam* const compileTimeString2 = []() constexpr-> const TypeParam* { @@ -1622,7 +1617,7 @@ namespace UnitTest return {}; }(); - basic_string_view assignView2(compileTimeString2); + AZStd::basic_string_view assignView2(compileTimeString2); assignView2 = sourceView; return assignView2; }; @@ -1646,15 +1641,15 @@ namespace UnitTest return {}; }(); - constexpr basic_string_view iteratorView(compileTimeString1); - constexpr typename basic_string_view::iterator beginIt = iteratorView.begin(); - constexpr typename basic_string_view::const_iterator cbeginIt = iteratorView.cbegin(); - constexpr typename basic_string_view::iterator endIt = iteratorView.end(); - constexpr typename basic_string_view::const_iterator cendIt = iteratorView.cend(); - constexpr typename basic_string_view::reverse_iterator rbeginIt = iteratorView.rbegin(); - constexpr typename basic_string_view::const_reverse_iterator crbeginIt = iteratorView.crbegin(); - constexpr typename basic_string_view::reverse_iterator rendIt = iteratorView.rend(); - constexpr typename basic_string_view::const_reverse_iterator crendIt = iteratorView.crend(); + constexpr AZStd::basic_string_view iteratorView(compileTimeString1); + constexpr typename AZStd::basic_string_view::iterator beginIt = iteratorView.begin(); + constexpr typename AZStd::basic_string_view::const_iterator cbeginIt = iteratorView.cbegin(); + constexpr typename AZStd::basic_string_view::iterator endIt = iteratorView.end(); + constexpr typename AZStd::basic_string_view::const_iterator cendIt = iteratorView.cend(); + constexpr typename AZStd::basic_string_view::reverse_iterator rbeginIt = iteratorView.rbegin(); + constexpr typename AZStd::basic_string_view::const_reverse_iterator crbeginIt = iteratorView.crbegin(); + constexpr typename AZStd::basic_string_view::reverse_iterator rendIt = iteratorView.rend(); + constexpr typename AZStd::basic_string_view::const_reverse_iterator crendIt = iteratorView.crend(); static_assert(beginIt != endIt, "begin and iterators should be different"); static_assert(cbeginIt != cendIt, "begin and iterators should be different"); static_assert(rbeginIt != rendIt, "begin and iterators should be different"); @@ -1679,7 +1674,7 @@ namespace UnitTest return {}; }(); - constexpr basic_string_view elementView1(compileTimeString1); + constexpr AZStd::basic_string_view elementView1(compileTimeString1); static_assert(elementView1[4] == 'o', "character at index 4 in string_view should be 'o'"); static_assert(elementView1.at(5) == 'W', "character at index 5 in string_view should be 'W'"); } @@ -1700,7 +1695,7 @@ namespace UnitTest return {}; }(); - constexpr basic_string_view elementView1(compileTimeString1); + constexpr AZStd::basic_string_view elementView1(compileTimeString1); static_assert(elementView1.front() == 'H', "Fourth character in string_view should be 'H'"); static_assert(elementView1.back() == 'd', "Fifth character in string_view should be 'd'"); } @@ -1734,8 +1729,8 @@ namespace UnitTest return {}; }(); - static constexpr basic_string_view elementView1(compileTimeString1); - static constexpr basic_string_view elementView2(compileTimeString2); + static constexpr AZStd::basic_string_view elementView1(compileTimeString1); + static constexpr AZStd::basic_string_view elementView2(compileTimeString2); static_assert(elementView1.data(), "string_view.data() should be non-nullptr"); static_assert(elementView2.data(), "string_view.data() should be non-nullptr"); } @@ -1756,7 +1751,7 @@ namespace UnitTest return {}; }(); - constexpr basic_string_view sizeView1(compileTimeString1); + constexpr AZStd::basic_string_view sizeView1(compileTimeString1); static_assert(sizeView1.size() == sizeView1.length(), "string_views size and length function should return the same value"); static_assert(!sizeView1.empty(), "string_views should not be empty"); static_assert(sizeView1.max_size() != 0, "string_views max_size should be greater than 0"); @@ -1770,21 +1765,21 @@ namespace UnitTest { return "HelloWorld"; }; - constexpr basic_string_view modifierView("HelloWorld"); + constexpr AZStd::basic_string_view modifierView("HelloWorld"); // A constexpr lambda is used to evaluate non constexpr string_view instances' member functions which // have been marked as constexpr at compile time // The google test function being run is not a constexpr function and therefore will evaulate // non-constexpr string_view variables at runtime. This would cause static_assert to state // that the expression is evaluated at runtime - auto remove_prefix_test_func = [](basic_string_view sourceView) constexpr -> basic_string_view + auto remove_prefix_test_func = [](AZStd::basic_string_view sourceView) constexpr -> AZStd::basic_string_view { - basic_string_view lstripView(sourceView); + AZStd::basic_string_view lstripView(sourceView); lstripView.remove_prefix(5); return lstripView; }; - auto remove_suffix_test_func = [](basic_string_view sourceView) constexpr -> basic_string_view + auto remove_suffix_test_func = [](AZStd::basic_string_view sourceView) constexpr -> AZStd::basic_string_view { - basic_string_view rstripView(sourceView); + AZStd::basic_string_view rstripView(sourceView); rstripView.remove_suffix(5); return rstripView; }; @@ -1801,8 +1796,8 @@ namespace UnitTest return "HelloWorld"; }; constexpr const TypeParam* compileTimeString1 = MakeCompileTimeString1();; - constexpr basic_string_view fullView(compileTimeString1); - auto substr_test_func = [](basic_string_view sourceView) constexpr -> basic_string_view + constexpr AZStd::basic_string_view fullView(compileTimeString1); + auto substr_test_func = [](AZStd::basic_string_view sourceView) constexpr -> AZStd::basic_string_view { return sourceView.substr(3, 5); }; @@ -1818,7 +1813,7 @@ namespace UnitTest return "elloGovernor"; }; constexpr const TypeParam* compileTimeString1 = MakeCompileTimeString1(); - constexpr basic_string_view withView(compileTimeString1); + constexpr AZStd::basic_string_view withView(compileTimeString1); static_assert(withView.starts_with("ello"), "string_view should start with \"ello\""); // Regression in VS2017 15.8 and 15.9 where __builtin_memcmp fails in valid checks #if AZ_COMPILER_MSVC < 1915 && AZ_COMPILER_MSVC > 1916 @@ -1854,9 +1849,9 @@ namespace UnitTest TYPED_TEST(BasicStringViewConstexprFixture, StringView_FindOperationsAreConstexpr) { constexpr const TypeParam* compileTimeString1 = MakeCompileTimeString1; - constexpr basic_string_view quickFoxView(compileTimeString1); + constexpr AZStd::basic_string_view quickFoxView(compileTimeString1); constexpr const TypeParam* searchString = MakeSearchString; - constexpr basic_string_view searchView(searchString); + constexpr AZStd::basic_string_view searchView(searchString); constexpr const TypeParam* testString1 = MakeTestString1; constexpr const TypeParam* testString2 = MakeTestString2; @@ -1893,10 +1888,10 @@ namespace UnitTest static_assert(quickFoxView.find_last_of('o') == 42, "string_view find_last_of should result in index 42"); static_assert(quickFoxView.find_last_of(testString6) == 40, "string_view find_last_of should result in index 40"); static_assert(quickFoxView.find_last_of(testString7, 31) == 29, "string_view find_last_of should result in index 29"); - static_assert(quickFoxView.find_last_of(testString8, basic_string_view::npos, 1) == 7, "string_view find_last_of should result in index 7"); + static_assert(quickFoxView.find_last_of(testString8, AZStd::basic_string_view::npos, 1) == 7, "string_view find_last_of should result in index 7"); // find_first_not_of test - constexpr basic_string_view firstNotOfView(testString9); + constexpr AZStd::basic_string_view firstNotOfView(testString9); static_assert(quickFoxView.find_first_not_of(firstNotOfView) == 4, "string_view find_first_not_of should result in index 0"); static_assert(quickFoxView.find_first_not_of('t') == 1, "string_view find_first_not_of should result in index 1"); static_assert(quickFoxView.find_first_not_of(testString9) == 4, "string_view find_first_not_of should result in index 4"); @@ -1904,12 +1899,12 @@ namespace UnitTest static_assert(quickFoxView.find_first_not_of(testString9, 0, 1) == 1, "string_view find_first_not_of should result in index 1"); // find_last_not_of test - constexpr basic_string_view lastNotOfView(testString10); + constexpr AZStd::basic_string_view lastNotOfView(testString10); static_assert(quickFoxView.find_last_not_of(lastNotOfView) == 39, "string_view find_last_not_of should result in index 39"); static_assert(quickFoxView.find_last_not_of('g') == 42, "string_view find_last_not_of should result in index 42"); static_assert(quickFoxView.find_last_not_of(testString10) == 39, "string_view find_last_not_of should result in index 39"); static_assert(quickFoxView.find_last_not_of(testString10, 27) == 24, "string_view find_last_not_of should result in index 24"); - static_assert(quickFoxView.find_last_not_of(testString10, basic_string_view::npos, 1) == 43, "string_view find_last_not_of should result in index 43"); + static_assert(quickFoxView.find_last_not_of(testString10, AZStd::basic_string_view::npos, 1) == 43, "string_view find_last_not_of should result in index 43"); } TEST_F(String, StringView_CompareIsConstexpr) @@ -1925,8 +1920,8 @@ namespace UnitTest }; constexpr const TypeParam* compileTimeString1 = ThisTestMakeCompileTimeString1(); constexpr const TypeParam* compileTimeString2 = MakeCompileTimeString2(); - constexpr basic_string_view lhsView(compileTimeString1); - constexpr basic_string_view rhsView(compileTimeString2); + constexpr AZStd::basic_string_view lhsView(compileTimeString1); + constexpr AZStd::basic_string_view rhsView(compileTimeString2); static_assert(lhsView.compare(rhsView) > 0, R"("HelloWorld" > "HelloPearl")"); static_assert(lhsView.compare(0, 5, rhsView) < 0, R"("Hello" < HelloPearl")"); static_assert(lhsView.compare(2, 3, rhsView, 2, 3) == 0, R"("llo" == llo")"); @@ -1943,7 +1938,7 @@ namespace UnitTest return "HelloWorld"; }; constexpr const TypeParam* compileTimeString1 = TestMakeCompileTimeString1(); - constexpr basic_string_view compareView(compileTimeString1); + constexpr AZStd::basic_string_view compareView(compileTimeString1); static_assert(compareView == "HelloWorld", "string_view operator== comparison has failed"); static_assert(compareView != "MadWorld", "string_view operator!= comparison has failed"); static_assert(compareView < "JelloWorld", "string_view operator< comparison has failed"); @@ -1954,7 +1949,7 @@ namespace UnitTest TYPED_TEST(BasicStringViewConstexprFixture, StringView_SwapIsConstexpr) { - auto swap_test_func = []() constexpr -> basic_string_view + auto swap_test_func = []() constexpr -> AZStd::basic_string_view { constexpr auto ThisTestMakeCompileTimeString1 = []() constexpr -> const TypeParam* { @@ -1980,8 +1975,8 @@ namespace UnitTest }; constexpr const TypeParam* compileTimeString1 = ThisTestMakeCompileTimeString1(); constexpr const TypeParam* compileTimeString2 = MakeCompileTimeString2(); - basic_string_view lhsView(compileTimeString1); - basic_string_view rhsView(compileTimeString2); + AZStd::basic_string_view lhsView(compileTimeString1); + AZStd::basic_string_view rhsView(compileTimeString2); lhsView.swap(rhsView); return lhsView; }; @@ -2014,13 +2009,14 @@ namespace UnitTest } }; constexpr const TypeParam* compileTimeString1 = ThisTestMakeCompileTimeString1(); - constexpr basic_string_view hashView(compileTimeString1); - constexpr size_t compileHash = AZStd::hash>{}(hashView); + constexpr AZStd::basic_string_view hashView(compileTimeString1); + constexpr size_t compileHash = AZStd::hash>{}(hashView); static_assert(compileHash != 0, "Hash of \"HelloWorld\" should not be 0"); } TEST_F(String, StringView_UserLiteralsSucceed) { + using namespace AZStd::string_view_literals; constexpr auto charView{ "Test"_sv }; constexpr auto wcharView{ L"Super Test"_sv }; static_assert(charView == "Test", "char string literal should be \"Test\""); @@ -2291,21 +2287,21 @@ namespace UnitTest { AZStd::fixed_string<32> filter1; AZStd::string testValue{ "test" }; - EXPECT_FALSE(wildcard_match(filter1, testValue)); + EXPECT_FALSE(AZStd::wildcard_match(filter1, testValue)); } TEST_F(String, WildcardMatch_EmptyFilterWithEmptyValue_Succeeds) { AZStd::fixed_string<32> filter1; AZStd::fixed_string<32> emptyValue; - EXPECT_TRUE(wildcard_match(filter1, emptyValue)); + EXPECT_TRUE(AZStd::wildcard_match(filter1, emptyValue)); } TEST_F(String, WildcardMatch_AsteriskOnlyFilterWithEmptyValue_Succeeds) { const char* filter1{ "*" }; const char* filter2{ "**" }; const char* emptyValue{ "" }; - EXPECT_TRUE(wildcard_match(filter1, emptyValue)); - EXPECT_TRUE(wildcard_match(filter2, emptyValue)); + EXPECT_TRUE(AZStd::wildcard_match(filter1, emptyValue)); + EXPECT_TRUE(AZStd::wildcard_match(filter2, emptyValue)); } TEST_F(String, WildcardMatch_AsteriskQuestionMarkFilterWithEmptyValue_Failes) { @@ -2313,60 +2309,60 @@ namespace UnitTest const char* filter1{ "*?" }; const char* filter2{ "?*" }; const char* emptyValue{ "" }; - EXPECT_FALSE(wildcard_match(filter1, emptyValue)); - EXPECT_FALSE(wildcard_match(filter2, emptyValue)); + EXPECT_FALSE(AZStd::wildcard_match(filter1, emptyValue)); + EXPECT_FALSE(AZStd::wildcard_match(filter2, emptyValue)); } TEST_F(String, WildcardMatch_DotValue_Succeeds) { const char* filter1{ "?" }; const char* dotValue{ "." }; - EXPECT_TRUE(wildcard_match(filter1, dotValue)); + EXPECT_TRUE(AZStd::wildcard_match(filter1, dotValue)); } TEST_F(String, WildcardMatch_DoubleDotValue_Succeeds) { const char* filter1{ "??" }; const char* dotValue{ ".." }; - EXPECT_TRUE(wildcard_match(filter1, dotValue)); + EXPECT_TRUE(AZStd::wildcard_match(filter1, dotValue)); } TEST_F(String, WildcardMatch_GlobFilters_Succeeds) { const char* filter1{ "*" }; const char* filter2{ "*?" }; const char* filter3{ "?*" }; - EXPECT_TRUE(wildcard_match(filter1, "Hello")); - EXPECT_TRUE(wildcard_match(filter1, "?")); - EXPECT_TRUE(wildcard_match(filter1, "*")); - EXPECT_TRUE(wildcard_match(filter1, "Q")); + EXPECT_TRUE(AZStd::wildcard_match(filter1, "Hello")); + EXPECT_TRUE(AZStd::wildcard_match(filter1, "?")); + EXPECT_TRUE(AZStd::wildcard_match(filter1, "*")); + EXPECT_TRUE(AZStd::wildcard_match(filter1, "Q")); - EXPECT_TRUE(wildcard_match(filter2, "Hello")); - EXPECT_TRUE(wildcard_match(filter2, "?")); - EXPECT_TRUE(wildcard_match(filter2, "*")); - EXPECT_TRUE(wildcard_match(filter2, "Q")); + EXPECT_TRUE(AZStd::wildcard_match(filter2, "Hello")); + EXPECT_TRUE(AZStd::wildcard_match(filter2, "?")); + EXPECT_TRUE(AZStd::wildcard_match(filter2, "*")); + EXPECT_TRUE(AZStd::wildcard_match(filter2, "Q")); - EXPECT_TRUE(wildcard_match(filter3, "Hello")); - EXPECT_TRUE(wildcard_match(filter3, "?")); - EXPECT_TRUE(wildcard_match(filter3, "*")); - EXPECT_TRUE(wildcard_match(filter3, "Q")); + EXPECT_TRUE(AZStd::wildcard_match(filter3, "Hello")); + EXPECT_TRUE(AZStd::wildcard_match(filter3, "?")); + EXPECT_TRUE(AZStd::wildcard_match(filter3, "*")); + EXPECT_TRUE(AZStd::wildcard_match(filter3, "Q")); } TEST_F(String, WildcardMatch_NormalString_Succeeds) { constexpr AZStd::string_view jpgFilter{ "**/*.jpg" }; - EXPECT_FALSE(wildcard_match(jpgFilter, "Test.jpg")); - EXPECT_FALSE(wildcard_match(jpgFilter, "Test.jpfg")); - EXPECT_TRUE(wildcard_match(jpgFilter, "Images/Other.jpg")); - EXPECT_FALSE(wildcard_match(jpgFilter, "Pictures/Other.gif")); + EXPECT_FALSE(AZStd::wildcard_match(jpgFilter, "Test.jpg")); + EXPECT_FALSE(AZStd::wildcard_match(jpgFilter, "Test.jpfg")); + EXPECT_TRUE(AZStd::wildcard_match(jpgFilter, "Images/Other.jpg")); + EXPECT_FALSE(AZStd::wildcard_match(jpgFilter, "Pictures/Other.gif")); constexpr AZStd::string_view tempDirFilter{ "temp/*" }; - EXPECT_TRUE(wildcard_match(tempDirFilter, "temp/")); - EXPECT_TRUE(wildcard_match(tempDirFilter, "temp/f")); - EXPECT_FALSE(wildcard_match(tempDirFilter, "tem1/")); + EXPECT_TRUE(AZStd::wildcard_match(tempDirFilter, "temp/")); + EXPECT_TRUE(AZStd::wildcard_match(tempDirFilter, "temp/f")); + EXPECT_FALSE(AZStd::wildcard_match(tempDirFilter, "tem1/")); constexpr AZStd::string_view xmlFilter{ "test.xml" }; - EXPECT_TRUE(wildcard_match(xmlFilter, "Test.xml")); - EXPECT_TRUE(wildcard_match(xmlFilter, "test.xml")); - EXPECT_FALSE(wildcard_match(xmlFilter, "test.xmlschema")); - EXPECT_FALSE(wildcard_match(xmlFilter, "Xtest.xml")); + EXPECT_TRUE(AZStd::wildcard_match(xmlFilter, "Test.xml")); + EXPECT_TRUE(AZStd::wildcard_match(xmlFilter, "test.xml")); + EXPECT_FALSE(AZStd::wildcard_match(xmlFilter, "test.xmlschema")); + EXPECT_FALSE(AZStd::wildcard_match(xmlFilter, "Xtest.xml")); } TEST_F(String, WildcardMatchCase_CanBeCompileTimeEvaluated_Succeeds) @@ -2424,6 +2420,31 @@ namespace UnitTest EXPECT_EQ("oWord", eraseIfTest); } + TEST_F(String, StringWithStatelessAllocator_HasSizeOf_PointerPlus2IntTypes_Compiles) + { + // The expected size of a basic_string with a stateless allocator + // Is the size of the pointer (used for storing the memory address of the string) + // + the size of the string "size" member used to store the size of the string + // + the size of the string "capacity" member used to store the capacity of the string + size_t constexpr ExpectedBasicStringSize = sizeof(void*) + 2 * sizeof(size_t); + using StringStatelessAllocator = AZStd::basic_string, AZStd::stateless_allocator>; + static_assert(ExpectedBasicStringSize == sizeof(StringStatelessAllocator), + "Stateless allocator is counting against the size of the basic_string class" + " A change has made to break the empty base optimization of the basic_string class"); + } + + TEST_F(String, StringWithStatefulAllocator_HasSizeOf_PointerPlus2IntTypesPlusAllocator_Compiles) + { + // The expected size of a basic_string with a stateless allocator + // Is the size of the pointer (used for storing the memory address of the string) + // + the size of the string "size" member used to store the size of the string + // + the size of the string "capacity" member used to store the capacity of the string + size_t constexpr ExpectedBasicStringSize = sizeof(void*) + 2 * sizeof(size_t) + sizeof(AZStd::allocator); + static_assert(ExpectedBasicStringSize == sizeof(AZStd::string), + "Using Stateful allocator with basic_string class should result in a 32-byte string class" + " on 64-bit platforms "); + } + template class ImmutableStringFunctionsFixture : public ScopedAllocatorSetupFixture @@ -2473,5 +2494,296 @@ namespace UnitTest EXPECT_EQ(str, formatted); } -#endif // AZ_UNIT_TEST_SKIP_STD_STRING_TESTS } + +#if defined(HAVE_BENCHMARK) +namespace Benchmark +{ + class StringBenchmarkFixture + : public ::UnitTest::AllocatorsBenchmarkFixture + { + protected: + template + void SwapStringViaMemcpy(AZStd::basic_string& left, + AZStd::basic_string& right) + { + // Test Swapping the storage container for the string class + // Use aligned_storage to prevent constructors from slowing operation + AZStd::aligned_storage_for_t tempStorage; + ::memcpy(&tempStorage, &left.m_storage.first(), sizeof(left.m_storage.first())); + ::memcpy(&left.m_storage.first(), &right.m_storage.first(), sizeof(right.m_storage.first())); + ::memcpy(&right.m_storage.first(), &tempStorage, sizeof(tempStorage)); + } + + + template + void SwapStringViaPointerSizedSwaps(AZStd::basic_string& left, + AZStd::basic_string& right) + { + using String = AZStd::basic_string; + using PointerAlignedData = typename String::PointerAlignedData; + // Use pointer sized swaps to swap the string storage + auto& leftAlignedPointers = reinterpret_cast(left.m_storage.first()); + auto& rightAlignedPointers = reinterpret_cast(right.m_storage.first()); + constexpr size_t alignedPointerCount{ AZStd::size(PointerAlignedData{}.m_alignedValues) }; + for (size_t i = 0; i < alignedPointerCount; ++i) + { + AZStd::swap(leftAlignedPointers.m_alignedValues[i], rightAlignedPointers.m_alignedValues[i]); + } + } + }; + + BENCHMARK_F(StringBenchmarkFixture, BM_StringPointerSwapShortString)(benchmark::State& state) + { + AZStd::string test1{ "foo bar"}; + AZStd::string test2{ "bar foo" }; + for (auto _ : state) + { + SwapStringViaPointerSizedSwaps(test1, test2); + } + } + + BENCHMARK_F(StringBenchmarkFixture, BM_StringPointerSwapLongString)(benchmark::State& state) + { + AZStd::string test1{ "The brown quick wolf jumped over the hyperactive cat" }; + AZStd::string test2{ "The quick brown fox jumped over the lazy dog" }; + for (auto _ : state) + { + SwapStringViaPointerSizedSwaps(test1, test2); + } + } + + BENCHMARK_F(StringBenchmarkFixture, BM_StringMemcpySwapShortString)(benchmark::State& state) + { + AZStd::string test1{ "foo bar" }; + AZStd::string test2{ "bar foo" }; + for (auto _ : state) + { + SwapStringViaMemcpy(test1, test2); + } + } + + BENCHMARK_F(StringBenchmarkFixture, BM_StringMemcpySwapLongString)(benchmark::State& state) + { + AZStd::string test1{ "The brown quick wolf jumped over the hyperactive cat" }; + AZStd::string test2{ "The quick brown fox jumped over the lazy dog" }; + for (auto _ : state) + { + SwapStringViaMemcpy(test1, test2); + } + } + + template + class StringTemplateBenchmarkFixture + : public ::UnitTest::AllocatorsBenchmarkFixture + {}; + + // AZStd::string assign benchmarks + BENCHMARK_TEMPLATE_DEFINE_F(StringTemplateBenchmarkFixture, BM_StringAssignConstPointer_NullDelimited, AZStd::string)(benchmark::State& state) + { + AZStd::string sourceString(state.range(0), 'a'); + const char* sourceAddress = sourceString.c_str(); + + for (auto _ : state) + { + AZStd::string assignString; + assignString.assign(sourceAddress); + } + } + + BENCHMARK_REGISTER_F(StringTemplateBenchmarkFixture, BM_StringAssignConstPointer_NullDelimited) + ->RangeMultiplier(2)->Range(8, 32); + + BENCHMARK_TEMPLATE_DEFINE_F(StringTemplateBenchmarkFixture, BM_StringAssignConstPointer_WithSize, AZStd::string)(benchmark::State& state) + { + AZStd::string sourceString(state.range(0), 'a'); + const char* sourceAddress = sourceString.c_str(); + const size_t sourceSize = sourceString.size(); + + for (auto _ : state) + { + AZStd::string assignString; + assignString.assign(sourceAddress, sourceSize); + } + } + + BENCHMARK_REGISTER_F(StringTemplateBenchmarkFixture, BM_StringAssignConstPointer_WithSize) + ->RangeMultiplier(2)->Range(8, 32); + + BENCHMARK_TEMPLATE_DEFINE_F(StringTemplateBenchmarkFixture, BM_StringAssignFromIterators, AZStd::string)(benchmark::State& state) + { + AZStd::string sourceString(state.range(0), 'a'); + auto sourceBegin = sourceString.begin(); + auto sourceEnd = sourceString.end(); + + for (auto _ : state) + { + AZStd::string assignString; + assignString.assign(sourceBegin, sourceEnd); + } + } + + BENCHMARK_REGISTER_F(StringTemplateBenchmarkFixture, BM_StringAssignFromIterators) + ->RangeMultiplier(2)->Range(8, 32); + + BENCHMARK_TEMPLATE_DEFINE_F(StringTemplateBenchmarkFixture, BM_StringAssignFromStringView, AZStd::string)(benchmark::State& state) + { + AZStd::string sourceString(state.range(0), 'a'); + AZStd::string_view sourceView(sourceString); + + for (auto _ : state) + { + AZStd::string assignString; + assignString.assign(sourceView); + } + } + + BENCHMARK_REGISTER_F(StringTemplateBenchmarkFixture, BM_StringAssignFromStringView) + ->RangeMultiplier(2)->Range(8, 32); + + BENCHMARK_TEMPLATE_DEFINE_F(StringTemplateBenchmarkFixture, BM_StringAssignFromString_LValue, AZStd::string)(benchmark::State& state) + { + AZStd::string sourceString(state.range(0), 'a'); + + for (auto _ : state) + { + AZStd::string assignString; + assignString.assign(sourceString); + } + } + + BENCHMARK_REGISTER_F(StringTemplateBenchmarkFixture, BM_StringAssignFromString_LValue) + ->RangeMultiplier(2)->Range(8, 32); + + BENCHMARK_TEMPLATE_DEFINE_F(StringTemplateBenchmarkFixture, BM_StringAssignFromString_RValue, AZStd::string)(benchmark::State& state) + { + AZStd::string sourceString(state.range(0), 'a'); + + for (auto _ : state) + { + AZStd::string assignString; + assignString.assign(AZStd::move(sourceString)); + } + } + + BENCHMARK_REGISTER_F(StringTemplateBenchmarkFixture, BM_StringAssignFromString_RValue) + ->RangeMultiplier(2)->Range(8, 32); + + BENCHMARK_TEMPLATE_DEFINE_F(StringTemplateBenchmarkFixture, BM_StringAssignFromSingleCharacter, AZStd::string)(benchmark::State& state) + { + for (auto _ : state) + { + AZStd::string assignString; + assignString.assign(state.range(0), 'a'); + } + } + + BENCHMARK_REGISTER_F(StringTemplateBenchmarkFixture, BM_StringAssignFromSingleCharacter) + ->RangeMultiplier(2)->Range(8, 32); + + // AZStd::fixed_string assign benchmarks + // NOTE: This is a copy-and-paste of above because Google Benchmark doesn't support real templated benchmarks like Googletest + // https://github.com/google/benchmark/issues/541 + BENCHMARK_TEMPLATE_DEFINE_F(StringTemplateBenchmarkFixture, BM_FixedStringAssignConstPointer_NullDelimited, AZStd::fixed_string<1024>)(benchmark::State& state) + { + AZStd::fixed_string<1024> sourceString(state.range(0), 'a'); + const char* sourceAddress = sourceString.c_str(); + + for (auto _ : state) + { + AZStd::fixed_string<1024> assignString; + assignString.assign(sourceAddress); + } + } + + BENCHMARK_REGISTER_F(StringTemplateBenchmarkFixture, BM_FixedStringAssignConstPointer_NullDelimited) + ->RangeMultiplier(2)->Range(8, 32); + + BENCHMARK_TEMPLATE_DEFINE_F(StringTemplateBenchmarkFixture, BM_FixedStringAssignConstPointer_WithSize, AZStd::fixed_string<1024>)(benchmark::State& state) + { + AZStd::fixed_string<1024> sourceString(state.range(0), 'a'); + const char* sourceAddress = sourceString.c_str(); + const size_t sourceSize = sourceString.size(); + + for (auto _ : state) + { + AZStd::fixed_string<1024> assignString; + assignString.assign(sourceAddress, sourceSize); + } + } + + BENCHMARK_REGISTER_F(StringTemplateBenchmarkFixture, BM_FixedStringAssignConstPointer_WithSize) + ->RangeMultiplier(2)->Range(8, 32); + + BENCHMARK_TEMPLATE_DEFINE_F(StringTemplateBenchmarkFixture, BM_FixedStringAssignFromIterators, AZStd::fixed_string<1024>)(benchmark::State& state) + { + AZStd::fixed_string<1024> sourceString(state.range(0), 'a'); + auto sourceBegin = sourceString.begin(); + auto sourceEnd = sourceString.end(); + + for (auto _ : state) + { + AZStd::fixed_string<1024> assignString; + assignString.assign(sourceBegin, sourceEnd); + } + } + + BENCHMARK_REGISTER_F(StringTemplateBenchmarkFixture, BM_FixedStringAssignFromIterators) + ->RangeMultiplier(2)->Range(8, 32); + + BENCHMARK_TEMPLATE_DEFINE_F(StringTemplateBenchmarkFixture, BM_FixedStringAssignFromStringView, AZStd::fixed_string<1024>)(benchmark::State& state) + { + AZStd::fixed_string<1024> sourceString(state.range(0), 'a'); + AZStd::string_view sourceView(sourceString); + + for (auto _ : state) + { + AZStd::fixed_string<1024> assignString; + assignString.assign(sourceView); + } + } + + BENCHMARK_REGISTER_F(StringTemplateBenchmarkFixture, BM_FixedStringAssignFromStringView) + ->RangeMultiplier(2)->Range(8, 32); + + BENCHMARK_TEMPLATE_DEFINE_F(StringTemplateBenchmarkFixture, BM_FixedStringAssignFromString_LValue, AZStd::fixed_string<1024>)(benchmark::State& state) + { + AZStd::fixed_string<1024> sourceString(state.range(0), 'a'); + + for (auto _ : state) + { + AZStd::fixed_string<1024> assignString; + assignString.assign(sourceString); + } + } + + BENCHMARK_REGISTER_F(StringTemplateBenchmarkFixture, BM_FixedStringAssignFromString_LValue) + ->RangeMultiplier(2)->Range(8, 32); + + BENCHMARK_TEMPLATE_DEFINE_F(StringTemplateBenchmarkFixture, BM_FixedStringAssignFromString_RValue, AZStd::fixed_string<1024>)(benchmark::State& state) + { + AZStd::fixed_string<1024> sourceString(state.range(0), 'a'); + + for (auto _ : state) + { + AZStd::fixed_string<1024> assignString; + assignString.assign(AZStd::move(sourceString)); + } + } + + BENCHMARK_REGISTER_F(StringTemplateBenchmarkFixture, BM_FixedStringAssignFromString_RValue) + ->RangeMultiplier(2)->Range(8, 32); + + BENCHMARK_TEMPLATE_DEFINE_F(StringTemplateBenchmarkFixture, BM_FixedStringAssignFromSingleCharacter, AZStd::fixed_string<1024>)(benchmark::State& state) + { + for (auto _ : state) + { + AZStd::fixed_string<1024> assignString; + assignString.assign(state.range(0), 'a'); + } + } + + BENCHMARK_REGISTER_F(StringTemplateBenchmarkFixture, BM_FixedStringAssignFromSingleCharacter) + ->RangeMultiplier(2)->Range(8, 32); +} +#endif diff --git a/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSAttributionServiceApiTest.cpp b/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSAttributionServiceApiTest.cpp index 7ce0290ea3..e17d5c1fbf 100644 --- a/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSAttributionServiceApiTest.cpp +++ b/Gems/AWSCore/Code/Tests/Editor/Attribution/AWSAttributionServiceApiTest.cpp @@ -72,12 +72,11 @@ namespace AWSCoreUnitTest AWSCore::RequestBuilder requestBuilder{}; EXPECT_TRUE(request.parameters.BuildRequest(requestBuilder)); std::shared_ptr bodyContent = requestBuilder.GetBodyContent(); - EXPECT_TRUE(bodyContent != nullptr); + EXPECT_NE(nullptr, bodyContent); - AZStd::string bodyString; std::istreambuf_iterator eos; - bodyString = AZStd::string{ std::istreambuf_iterator(*bodyContent), eos }; - AZ_Printf("AWSAttributionServiceApiTest", bodyString.c_str()); - EXPECT_TRUE(bodyString.find(AZStd::string::format("{\"%s\":\"1.1\"", AwsAttributionAttributeKeyVersion)) != AZStd::string::npos); + AZStd::string bodyString{ std::istreambuf_iterator(*bodyContent), eos }; + AZ_Printf("AWSAttributionServiceApiTest", "%s", bodyString.c_str()); + EXPECT_TRUE(bodyString.contains(AZStd::string::format("{\"%s\":\"1.1\"", AwsAttributionAttributeKeyVersion))); } } diff --git a/Gems/AWSMetrics/Code/Tests/AWSMetricsServiceApiTest.cpp b/Gems/AWSMetrics/Code/Tests/AWSMetricsServiceApiTest.cpp index 8844e727b6..b7e7527b20 100644 --- a/Gems/AWSMetrics/Code/Tests/AWSMetricsServiceApiTest.cpp +++ b/Gems/AWSMetrics/Code/Tests/AWSMetricsServiceApiTest.cpp @@ -100,11 +100,10 @@ namespace AWSMetrics AWSCore::RequestBuilder requestBuilder{}; EXPECT_TRUE(request.parameters.BuildRequest(requestBuilder)); std::shared_ptr bodyContent = requestBuilder.GetBodyContent(); - EXPECT_TRUE(bodyContent != nullptr); + ASSERT_NE(nullptr, bodyContent); - AZStd::string bodyString; std::istreambuf_iterator eos; - bodyString = AZStd::string{ std::istreambuf_iterator(*bodyContent), eos }; - EXPECT_TRUE(bodyString.find(AZStd::string::format("{\"%s\":[{\"event_timestamp\":", AwsMetricsRequestParameterKeyEvents)) != AZStd::string::npos); + AZStd::string bodyString{ std::istreambuf_iterator(*bodyContent), eos }; + EXPECT_TRUE(bodyString.contains(AZStd::string::format("{\"%s\":[{\"event_timestamp\":", AwsMetricsRequestParameterKeyEvents))); } } diff --git a/Gems/EMotionFX/Code/Tests/AnimGraphEventTests.cpp b/Gems/EMotionFX/Code/Tests/AnimGraphEventTests.cpp index bd3fa10b24..11865674c8 100644 --- a/Gems/EMotionFX/Code/Tests/AnimGraphEventTests.cpp +++ b/Gems/EMotionFX/Code/Tests/AnimGraphEventTests.cpp @@ -49,7 +49,7 @@ namespace EMotionFX for (int i = 0; i < params.m_numStates; ++i) { AnimGraphNode* state = aznew AnimGraphMotionNode(); - state->SetName(AZStd::string(1, startChar + i).c_str()); + state->SetName(AZStd::string(1, static_cast(startChar + i)).c_str()); m_rootStateMachine->AddChildNode(state); AddTransitionWithTimeCondition(prevState, state, /*blendTime*/params.m_transitionBlendTime, /*countDownTime*/params.m_conditionCountDownTime); prevState = state; diff --git a/Gems/EMotionFX/Code/Tests/AnimGraphRefCountTests.cpp b/Gems/EMotionFX/Code/Tests/AnimGraphRefCountTests.cpp index 54f945d95f..c4e6462fff 100644 --- a/Gems/EMotionFX/Code/Tests/AnimGraphRefCountTests.cpp +++ b/Gems/EMotionFX/Code/Tests/AnimGraphRefCountTests.cpp @@ -90,7 +90,7 @@ namespace EMotionFX for (int i = 0; i < param.m_numStates; ++i) { AnimGraphBindPoseNode* state = aznew AnimGraphBindPoseNode(); - state->SetName(AZStd::string(1, startChar + i).c_str()); + state->SetName(AZStd::string(1, static_cast(startChar + i)).c_str()); m_rootStateMachine->AddChildNode(state); AddTransitionWithTimeCondition(prevState, state, /*blendTime*/param.m_blendTime, /*countDownTime*/param.m_countDownTime); prevState = state; From 93996bfb3fc97de17f9127686114ac4fece3fb55 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 10 Jan 2022 09:59:35 -0800 Subject: [PATCH 396/948] Moves LmbrCentral Test targets into a different folder to prevent MSB8028 (#6742) * Moves Test targets into a different folder to prevent MSB8028 Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * Simplifies an if that was affecting the whole file Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Gems/LmbrCentral/Code/CMakeLists.txt | 73 +---------------- Gems/LmbrCentral/Code/Tests/CMakeLists.txt | 79 +++++++++++++++++++ .../lmbrcentral_editor_tests_files.cmake | 28 +++++++ .../{ => Tests}/lmbrcentral_mocks_files.cmake | 2 +- .../Code/Tests/lmbrcentral_tests_files.cmake | 32 ++++++++ .../Code/lmbrcentral_editor_tests_files.cmake | 28 ------- .../Code/lmbrcentral_tests_files.cmake | 29 ------- 7 files changed, 141 insertions(+), 130 deletions(-) create mode 100644 Gems/LmbrCentral/Code/Tests/CMakeLists.txt create mode 100644 Gems/LmbrCentral/Code/Tests/lmbrcentral_editor_tests_files.cmake rename Gems/LmbrCentral/Code/{ => Tests}/lmbrcentral_mocks_files.cmake (83%) create mode 100644 Gems/LmbrCentral/Code/Tests/lmbrcentral_tests_files.cmake delete mode 100644 Gems/LmbrCentral/Code/lmbrcentral_editor_tests_files.cmake delete mode 100644 Gems/LmbrCentral/Code/lmbrcentral_tests_files.cmake diff --git a/Gems/LmbrCentral/Code/CMakeLists.txt b/Gems/LmbrCentral/Code/CMakeLists.txt index 2df0bd0632..4401d3b752 100644 --- a/Gems/LmbrCentral/Code/CMakeLists.txt +++ b/Gems/LmbrCentral/Code/CMakeLists.txt @@ -121,75 +121,4 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) endif() -################################################################################ -# Tests -################################################################################ -if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) - ly_add_target( - NAME LmbrCentral.Mocks HEADERONLY - NAMESPACE Gem - FILES_CMAKE - lmbrcentral_mocks_files.cmake - INCLUDE_DIRECTORIES - INTERFACE - Mocks - ) - - ly_add_target( - NAME LmbrCentral.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} - NAMESPACE Gem - FILES_CMAKE - lmbrcentral_tests_files.cmake - lmbrcentral_shared_files.cmake - INCLUDE_DIRECTORIES - PRIVATE - Source - Tests - BUILD_DEPENDENCIES - PRIVATE - AZ::AzTest - AZ::AzTestShared - Legacy::CryCommon - AZ::AzFramework - Gem::LmbrCentral.Static - Gem::LmbrCentral.Mocks - ) - ly_add_googletest( - NAME Gem::LmbrCentral.Tests - ) - - if (PAL_TRAIT_BUILD_HOST_TOOLS) - ly_add_target( - NAME LmbrCentral.Editor.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} - NAMESPACE Gem - FILES_CMAKE - lmbrcentral_editor_tests_files.cmake - INCLUDE_DIRECTORIES - PRIVATE - . - Source - Tests - COMPILE_DEFINITIONS - PRIVATE - LMBR_CENTRAL_EDITOR - BUILD_DEPENDENCIES - PRIVATE - 3rdParty::Qt::Gui - 3rdParty::Qt::Widgets - Legacy::CryCommon - Legacy::Editor.Headers - AZ::AzTest - AZ::AzCore - AZ::AzTestShared - AZ::AzToolsFramework - AZ::AzToolsFrameworkTestCommon - AZ::AssetBuilderSDK - AZ::AzManipulatorTestFramework.Static - Gem::LmbrCentral.Static - Gem::LmbrCentral.Editor.Static - ) - ly_add_googletest( - NAME Gem::LmbrCentral.Editor.Tests - ) - endif() -endif() +add_subdirectory(Tests) diff --git a/Gems/LmbrCentral/Code/Tests/CMakeLists.txt b/Gems/LmbrCentral/Code/Tests/CMakeLists.txt new file mode 100644 index 0000000000..52928cc5db --- /dev/null +++ b/Gems/LmbrCentral/Code/Tests/CMakeLists.txt @@ -0,0 +1,79 @@ +# +# Copyright (c) Contributors to the Open 3D Engine Project. +# For complete copyright and license terms please see the LICENSE at the root of this distribution. +# +# SPDX-License-Identifier: Apache-2.0 OR MIT +# +# + +if(NOT PAL_TRAIT_BUILD_TESTS_SUPPORTED) + return() +endif() + +ly_add_target( + NAME LmbrCentral.Mocks HEADERONLY + NAMESPACE Gem + FILES_CMAKE + lmbrcentral_mocks_files.cmake + INCLUDE_DIRECTORIES + INTERFACE + ../Mocks +) + +ly_add_target( + NAME LmbrCentral.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} + NAMESPACE Gem + FILES_CMAKE + lmbrcentral_tests_files.cmake + INCLUDE_DIRECTORIES + PRIVATE + ../Source + . + BUILD_DEPENDENCIES + PRIVATE + AZ::AzTest + AZ::AzTestShared + Legacy::CryCommon + AZ::AzFramework + Gem::LmbrCentral.Static + Gem::LmbrCentral.Mocks +) +ly_add_googletest( + NAME Gem::LmbrCentral.Tests +) + +if (PAL_TRAIT_BUILD_HOST_TOOLS) + ly_add_target( + NAME LmbrCentral.Editor.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} + NAMESPACE Gem + FILES_CMAKE + lmbrcentral_editor_tests_files.cmake + INCLUDE_DIRECTORIES + PRIVATE + .. + ../Source + . + COMPILE_DEFINITIONS + PRIVATE + LMBR_CENTRAL_EDITOR + BUILD_DEPENDENCIES + PRIVATE + 3rdParty::Qt::Gui + 3rdParty::Qt::Widgets + Legacy::CryCommon + Legacy::Editor.Headers + AZ::AzTest + AZ::AzCore + AZ::AzTestShared + AZ::AzToolsFramework + AZ::AzToolsFrameworkTestCommon + AZ::AssetBuilderSDK + AZ::AzManipulatorTestFramework.Static + Gem::LmbrCentral.Static + Gem::LmbrCentral.Editor.Static + ) + ly_add_googletest( + NAME Gem::LmbrCentral.Editor.Tests + ) +endif() + diff --git a/Gems/LmbrCentral/Code/Tests/lmbrcentral_editor_tests_files.cmake b/Gems/LmbrCentral/Code/Tests/lmbrcentral_editor_tests_files.cmake new file mode 100644 index 0000000000..72a26c2884 --- /dev/null +++ b/Gems/LmbrCentral/Code/Tests/lmbrcentral_editor_tests_files.cmake @@ -0,0 +1,28 @@ +# +# Copyright (c) Contributors to the Open 3D Engine Project. +# 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 + LmbrCentralEditorTest.cpp + LmbrCentralReflectionTest.h + LmbrCentralReflectionTest.cpp + EditorBoxShapeComponentTests.cpp + EditorSphereShapeComponentTests.cpp + EditorCapsuleShapeComponentTests.cpp + EditorCompoundShapeComponentTests.cpp + EditorCylinderShapeComponentTests.cpp + EditorPolygonPrismShapeComponentTests.cpp + EditorTubeShapeComponentTests.cpp + SpawnerComponentTest.cpp + Builders/CopyDependencyBuilderTest.cpp + Builders/SliceBuilderTests.cpp + Builders/LevelBuilderTest.cpp + Builders/LuaBuilderTests.cpp + Builders/SeedBuilderTests.cpp + ../Source/LmbrCentral.cpp + ../Source/LmbrCentralEditor.cpp +) diff --git a/Gems/LmbrCentral/Code/lmbrcentral_mocks_files.cmake b/Gems/LmbrCentral/Code/Tests/lmbrcentral_mocks_files.cmake similarity index 83% rename from Gems/LmbrCentral/Code/lmbrcentral_mocks_files.cmake rename to Gems/LmbrCentral/Code/Tests/lmbrcentral_mocks_files.cmake index c3a5cca3f8..1e510747f2 100644 --- a/Gems/LmbrCentral/Code/lmbrcentral_mocks_files.cmake +++ b/Gems/LmbrCentral/Code/Tests/lmbrcentral_mocks_files.cmake @@ -7,5 +7,5 @@ # set(FILES - Mocks/LmbrCentral/Shape/MockShapes.h + ../Mocks/LmbrCentral/Shape/MockShapes.h ) diff --git a/Gems/LmbrCentral/Code/Tests/lmbrcentral_tests_files.cmake b/Gems/LmbrCentral/Code/Tests/lmbrcentral_tests_files.cmake new file mode 100644 index 0000000000..1555ff53d8 --- /dev/null +++ b/Gems/LmbrCentral/Code/Tests/lmbrcentral_tests_files.cmake @@ -0,0 +1,32 @@ +# +# Copyright (c) Contributors to the Open 3D Engine Project. +# 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 + AudioComponentTests.cpp + AxisAlignedBoxShapeTest.cpp + BoxShapeTest.cpp + BundlingSystemComponentTests.cpp + SphereShapeTest.cpp + CylinderShapeTest.cpp + CapsuleShapeTest.cpp + PolygonPrismShapeTest.cpp + QuadShapeTest.cpp + TubeShapeTest.cpp + LmbrCentralReflectionTest.h + LmbrCentralReflectionTest.cpp + LmbrCentralTest.cpp + ShapeGeometryUtilTest.cpp + SpawnerComponentTest.cpp + SplineComponentTests.cpp + DiskShapeTest.cpp + ReferenceShapeTests.cpp + ../Source/LmbrCentral.cpp + ../Source/Ai/NavigationComponent.cpp + ../Source/Scripting/SpawnerComponent.cpp + ../Source/Shape/TubeShape.cpp +) diff --git a/Gems/LmbrCentral/Code/lmbrcentral_editor_tests_files.cmake b/Gems/LmbrCentral/Code/lmbrcentral_editor_tests_files.cmake deleted file mode 100644 index afba79e566..0000000000 --- a/Gems/LmbrCentral/Code/lmbrcentral_editor_tests_files.cmake +++ /dev/null @@ -1,28 +0,0 @@ -# -# Copyright (c) Contributors to the Open 3D Engine Project. -# For complete copyright and license terms please see the LICENSE at the root of this distribution. -# -# SPDX-License-Identifier: Apache-2.0 OR MIT -# -# - -set(FILES - Tests/LmbrCentralEditorTest.cpp - Tests/LmbrCentralReflectionTest.h - Tests/LmbrCentralReflectionTest.cpp - Tests/EditorBoxShapeComponentTests.cpp - Tests/EditorSphereShapeComponentTests.cpp - Tests/EditorCapsuleShapeComponentTests.cpp - Tests/EditorCompoundShapeComponentTests.cpp - Tests/EditorCylinderShapeComponentTests.cpp - Tests/EditorPolygonPrismShapeComponentTests.cpp - Tests/EditorTubeShapeComponentTests.cpp - Tests/SpawnerComponentTest.cpp - Tests/Builders/CopyDependencyBuilderTest.cpp - Tests/Builders/SliceBuilderTests.cpp - Tests/Builders/LevelBuilderTest.cpp - Tests/Builders/LuaBuilderTests.cpp - Tests/Builders/SeedBuilderTests.cpp - Source/LmbrCentral.cpp - Source/LmbrCentralEditor.cpp -) diff --git a/Gems/LmbrCentral/Code/lmbrcentral_tests_files.cmake b/Gems/LmbrCentral/Code/lmbrcentral_tests_files.cmake deleted file mode 100644 index 97e5d87829..0000000000 --- a/Gems/LmbrCentral/Code/lmbrcentral_tests_files.cmake +++ /dev/null @@ -1,29 +0,0 @@ -# -# Copyright (c) Contributors to the Open 3D Engine Project. -# For complete copyright and license terms please see the LICENSE at the root of this distribution. -# -# SPDX-License-Identifier: Apache-2.0 OR MIT -# -# - -set(FILES - Tests/AudioComponentTests.cpp - Tests/AxisAlignedBoxShapeTest.cpp - Tests/BoxShapeTest.cpp - Tests/BundlingSystemComponentTests.cpp - Tests/SphereShapeTest.cpp - Tests/CylinderShapeTest.cpp - Tests/CapsuleShapeTest.cpp - Tests/PolygonPrismShapeTest.cpp - Tests/QuadShapeTest.cpp - Tests/TubeShapeTest.cpp - Tests/LmbrCentralReflectionTest.h - Tests/LmbrCentralReflectionTest.cpp - Tests/LmbrCentralTest.cpp - Tests/ShapeGeometryUtilTest.cpp - Tests/SpawnerComponentTest.cpp - Tests/SplineComponentTests.cpp - Tests/DiskShapeTest.cpp - Tests/ReferenceShapeTests.cpp - Source/LmbrCentral.cpp -) From 0f7e55cf59c633249a6e83a675a4334598856044 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 10 Jan 2022 10:00:29 -0800 Subject: [PATCH 397/948] Some fixes for paths with spaces (#6757) * Some fixes for paths with spaces Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * PR comments Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../tests/run_python_tests.bat | 59 ------------------- cmake/CommandExecution.cmake | 10 ++-- .../runtime_dependencies_common.cmake.in | 6 +- .../Linux/runtime_dependencies_linux.cmake.in | 4 +- cmake/Platform/Mac/InstallUtils_mac.cmake.in | 58 +++++++++--------- .../Mac/runtime_dependencies_mac.cmake.in | 50 ++++++++-------- python/python.cmd | 3 +- scripts/build/Platform/Linux/build_linux.sh | 2 +- scripts/build/Platform/Mac/build_mac.sh | 2 +- .../build/Platform/Windows/build_windows.cmd | 5 +- scripts/build/ci_build.py | 2 +- 11 files changed, 71 insertions(+), 130 deletions(-) delete mode 100644 Code/Tools/PythonBindingsExample/tests/run_python_tests.bat diff --git a/Code/Tools/PythonBindingsExample/tests/run_python_tests.bat b/Code/Tools/PythonBindingsExample/tests/run_python_tests.bat deleted file mode 100644 index 216f2dd0da..0000000000 --- a/Code/Tools/PythonBindingsExample/tests/run_python_tests.bat +++ /dev/null @@ -1,59 +0,0 @@ -@echo off - -REM -REM Copyright (c) Contributors to the Open 3D Engine Project. -REM For complete copyright and license terms please see the LICENSE at the root of this distribution. -REM -REM SPDX-License-Identifier: Apache-2.0 OR MIT -REM -REM - -PUSHD "%~dp0" - -SET CWD="%~dp0" -SET EXEPATH141="../../../../Bin64vc141/PythonBindingsExample.exe" -SET EXEPATH142="../../../../Bin64vc142/PythonBindingsExample.exe" -SET EXEPATH="" - -IF EXIST %EXEPATH141% ( - SET EXEPATH=%EXEPATH141% -) ELSE ( - IF EXIST %EXEPATH142% ( - SET EXEPATH=%EXEPATH142% - ) ELSE ( - ECHO PythonBindingsExample.exe not found. - ) -) -IF /I %EXEPATH% EQU "" ( - ECHO [FAILED] Could not run tests since a build of PythonBindingsExample.exe is missing - GOTO exit_app -) - -ECHO Testing basics of tool Python bindings in %CWD% - -%EXEPATH% --file test_hello_tool.py -IF %ERRORLEVEL% EQU 0 ( - ECHO [WORKED] test_hello_tool.py -) ELSE ( - ECHO [FAILED] test_hello_tool.py with %ERRORLEVEL% - GOTO exit_app -) - -%EXEPATH% --file test_framework.py --arg entity -IF %ERRORLEVEL% EQU 0 ( - ECHO [WORKED] test_framework.py --arg entity -) ELSE ( - ECHO [FAILED] test_framework.py --arg entity with %ERRORLEVEL% - GOTO exit_app -) - -%EXEPATH% --file test_framework.py --arg math -IF %ERRORLEVEL% EQU 0 ( - ECHO [WORKED] test_framework.py --arg math -) ELSE ( - ECHO [FAILED] test_framework.py --arg math with %ERRORLEVEL% - GOTO exit_app -) - -:exit_app -POPD diff --git a/cmake/CommandExecution.cmake b/cmake/CommandExecution.cmake index 91f043ee9f..a8c21a22a2 100644 --- a/cmake/CommandExecution.cmake +++ b/cmake/CommandExecution.cmake @@ -38,13 +38,13 @@ endif() # Check for timestamp if(LY_TIMESTAMP_REFERENCE) - if(NOT EXISTS ${LY_TIMESTAMP_REFERENCE}) + if(NOT EXISTS "${LY_TIMESTAMP_REFERENCE}") message(FATAL_ERROR "File LY_TIMESTAMP_REFERENCE=${LY_TIMESTAMP_REFERENCE} does not exists") endif() if(NOT LY_TIMESTAMP_FILE) - set(LY_TIMESTAMP_FILE ${LY_TIMESTAMP_REFERENCE}.stamp) + set(LY_TIMESTAMP_FILE "${LY_TIMESTAMP_REFERENCE}.stamp") endif() - if(EXISTS ${LY_TIMESTAMP_FILE} AND NOT ${LY_TIMESTAMP_REFERENCE} IS_NEWER_THAN ${LY_TIMESTAMP_FILE}) + if(EXISTS "${LY_TIMESTAMP_FILE}" AND NOT "${LY_TIMESTAMP_REFERENCE}" IS_NEWER_THAN "${LY_TIMESTAMP_FILE}") # Stamp newer, nothing to do return() endif() @@ -52,7 +52,7 @@ endif() if(LY_LOCK_FILE) # Lock the file - file(LOCK ${LY_LOCK_FILE} TIMEOUT 1200 RESULT_VARIABLE lock_result) + file(LOCK "${LY_LOCK_FILE}" TIMEOUT 1200 RESULT_VARIABLE lock_result) if(NOT ${lock_result} EQUAL 0) message(FATAL_ERROR "Lock failure ${lock_result}") endif() @@ -83,5 +83,5 @@ endif() if(LY_TIMESTAMP_REFERENCE) # Touch the timestamp file - file(TOUCH ${LY_TIMESTAMP_FILE}) + file(TOUCH "${LY_TIMESTAMP_FILE}") endif() diff --git a/cmake/Platform/Common/runtime_dependencies_common.cmake.in b/cmake/Platform/Common/runtime_dependencies_common.cmake.in index 8717710a3b..a2c3e26ed0 100644 --- a/cmake/Platform/Common/runtime_dependencies_common.cmake.in +++ b/cmake/Platform/Common/runtime_dependencies_common.cmake.in @@ -13,7 +13,7 @@ function(ly_copy source_file target_directory) cmake_path(APPEND target_file "${target_directory}" "${target_filename}") cmake_path(COMPARE "${source_file}" EQUAL "${target_file}" same_location) if(NOT ${same_location}) - file(LOCK ${target_file}.lock GUARD FUNCTION TIMEOUT 300) + file(LOCK "${target_file}.lock" GUARD FUNCTION TIMEOUT 300) file(SIZE "${source_file}" source_file_size) if(EXISTS "${target_file}") file(SIZE "${target_file}" target_file_size) @@ -24,11 +24,11 @@ function(ly_copy source_file target_directory) message(STATUS "Copying \"${source_file}\" to \"${target_directory}\"...") file(MAKE_DIRECTORY "${full_target_directory}") file(COPY "${source_file}" DESTINATION "${target_directory}" FILE_PERMISSIONS @LY_COPY_PERMISSIONS@ FOLLOW_SYMLINK_CHAIN) - file(TOUCH_NOCREATE ${target_file}) + file(TOUCH_NOCREATE "${target_file}") endif() endif() endfunction() @LY_COPY_COMMANDS@ -file(TOUCH @STAMP_OUTPUT_FILE@) +file(TOUCH "@STAMP_OUTPUT_FILE@") diff --git a/cmake/Platform/Linux/runtime_dependencies_linux.cmake.in b/cmake/Platform/Linux/runtime_dependencies_linux.cmake.in index 16445ef8d9..e5d56d1b56 100644 --- a/cmake/Platform/Linux/runtime_dependencies_linux.cmake.in +++ b/cmake/Platform/Linux/runtime_dependencies_linux.cmake.in @@ -14,7 +14,7 @@ function(ly_copy source_file target_directory) cmake_path(APPEND target_file "${target_directory}" "${target_filename}") cmake_path(COMPARE "${source_file}" EQUAL "${target_file}" same_location) if(NOT ${same_location}) - file(LOCK ${target_file}.lock GUARD FUNCTION TIMEOUT 300) + file(LOCK "${target_file}.lock" GUARD FUNCTION TIMEOUT 300) file(SIZE "${source_file}" source_file_size) if(EXISTS "${target_file}") file(SIZE "${target_file}" target_file_size) @@ -39,4 +39,4 @@ endfunction() @LY_COPY_COMMANDS@ -file(TOUCH @STAMP_OUTPUT_FILE@) +file(TOUCH "@STAMP_OUTPUT_FILE@") diff --git a/cmake/Platform/Mac/InstallUtils_mac.cmake.in b/cmake/Platform/Mac/InstallUtils_mac.cmake.in index 89ce4a59f2..3db9903e48 100644 --- a/cmake/Platform/Mac/InstallUtils_mac.cmake.in +++ b/cmake/Platform/Mac/InstallUtils_mac.cmake.in @@ -31,36 +31,36 @@ endfunction() function(fixup_python_framework framework_path) file(REMOVE_RECURSE - ${framework_path}/Versions/Current - ${framework_path}/Versions/@LY_PYTHON_VERSION_MAJOR_MINOR@/Headers - ${framework_path}/Versions/@LY_PYTHON_VERSION_MAJOR_MINOR@/lib/Python - ${framework_path}/Versions/@LY_PYTHON_VERSION_MAJOR_MINOR@/lib/python@LY_PYTHON_VERSION_MAJOR_MINOR@/test - ${framework_path}/Versions/@LY_PYTHON_VERSION_MAJOR_MINOR@/lib/python@LY_PYTHON_VERSION_MAJOR_MINOR@/site-packages/scipy/io/tests - ${framework_path}/Python - ${framework_path}/Resources - ${framework_path}/Headers + "${framework_path}/Versions/Current" + "${framework_path}/Versions/@LY_PYTHON_VERSION_MAJOR_MINOR@/Headers" + "${framework_path}/Versions/@LY_PYTHON_VERSION_MAJOR_MINOR@/lib/Python" + "${framework_path}/Versions/@LY_PYTHON_VERSION_MAJOR_MINOR@/lib/python@LY_PYTHON_VERSION_MAJOR_MINOR@/test" + "${framework_path}/Versions/@LY_PYTHON_VERSION_MAJOR_MINOR@/lib/python@LY_PYTHON_VERSION_MAJOR_MINOR@/site-packages/scipy/io/tests" + "${framework_path}/Python" + "${framework_path}/Resources" + "${framework_path}/Headers" ) file(GLOB_RECURSE exe_file_list "${framework_path}/**/*.exe") if(exe_file_list) - file(REMOVE_RECURSE ${exe_file_list}) + file(REMOVE_RECURSE "${exe_file_list}") endif() - execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink include/python@LY_PYTHON_VERSION_MAJOR_MINOR@m Headers - WORKING_DIRECTORY ${framework_path}/Versions/@LY_PYTHON_VERSION_MAJOR_MINOR@ + execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink include/python@LY_PYTHON_VERSION_MAJOR_MINOR@m Headers + WORKING_DIRECTORY "${framework_path}/Versions/@LY_PYTHON_VERSION_MAJOR_MINOR@" ) - execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink @LY_PYTHON_VERSION_MAJOR_MINOR@ Current - WORKING_DIRECTORY ${framework_path}/Versions/ + execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink @LY_PYTHON_VERSION_MAJOR_MINOR@ Current + WORKING_DIRECTORY "${framework_path}/Versions/" ) - execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink Versions/Current/Python Python - WORKING_DIRECTORY ${framework_path} + execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink Versions/Current/Python Python + WORKING_DIRECTORY "${framework_path}" ) - execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink Versions/Current/Headers Headers - WORKING_DIRECTORY ${framework_path} + execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink Versions/Current/Headers Headers + WORKING_DIRECTORY "${framework_path}" ) - execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink Versions/Current/Resources Resources - WORKING_DIRECTORY ${framework_path} + execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink Versions/Current/Resources Resources + WORKING_DIRECTORY "${framework_path}" ) - file(CHMOD ${framework_path}/Versions/Current/Python + file(CHMOD "${framework_path}/Versions/Current/Python" PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE ) @@ -72,7 +72,7 @@ function(codesign_file file entitlement_file) return() endif() - if(EXISTS ${entitlement_file}) + if(EXISTS "${entitlement_file}") execute_process(COMMAND "/usr/bin/codesign" "--force" "--sign" "@LY_CODE_SIGN_IDENTITY@" "--deep" "-o" "runtime" "--timestamp" "--entitlements" "${entitlement_file}" "${file}" TIMEOUT 300 @@ -108,8 +108,8 @@ function(codesign_python_framework_binaries framework_path) "${framework_path}/Versions/@LY_PYTHON_VERSION_MAJOR_MINOR@/Resources/**") foreach(file ${files}) - if(NOT EXISTS ${file}) - file(REMOVE ${file}) + if(NOT EXISTS "${file}") + file(REMOVE "${file}") continue() endif() cmake_path(SET path_var "${file}") @@ -164,16 +164,16 @@ function(ly_copy source_file target_directory) endfunction() function(ly_download_and_codesign_sdk_python) - execute_process(COMMAND ${CMAKE_COMMAND} -DPAL_PLATFORM_NAME=Mac -DLY_3RDPARTY_PATH=${CMAKE_INSTALL_PREFIX}/python -P ${CMAKE_INSTALL_PREFIX}/python/get_python.cmake - WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX} + execute_process(COMMAND "${CMAKE_COMMAND}" -DPAL_PLATFORM_NAME=Mac "-DLY_3RDPARTY_PATH=${CMAKE_INSTALL_PREFIX}/python" -P "${CMAKE_INSTALL_PREFIX}/python/get_python.cmake" + WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}" ) - fixup_python_framework(${CMAKE_INSTALL_PREFIX}/python/runtime/@LY_PYTHON_PACKAGE_NAME@/Python.framework) - codesign_python_framework_binaries(${CMAKE_INSTALL_PREFIX}/python/runtime/@LY_PYTHON_PACKAGE_NAME@/Python.framework) - codesign_file(${CMAKE_INSTALL_PREFIX}/python/runtime/@LY_PYTHON_PACKAGE_NAME@/Python.framework @LY_ROOT_FOLDER@/python/Platform/Mac/PythonEntitlements.plist) + fixup_python_framework("${CMAKE_INSTALL_PREFIX}/python/runtime/@LY_PYTHON_PACKAGE_NAME@/Python.framework") + codesign_python_framework_binaries("${CMAKE_INSTALL_PREFIX}/python/runtime/@LY_PYTHON_PACKAGE_NAME@/Python.framework") + codesign_file("${CMAKE_INSTALL_PREFIX}/python/runtime/@LY_PYTHON_PACKAGE_NAME@/Python.framework" "@LY_ROOT_FOLDER@/python/Platform/Mac/PythonEntitlements.plist") endfunction() function(ly_codesign_sdk) - codesign_file(${LY_INSTALL_PATH_ORIGINAL}/O3DE_SDK.app "none") + codesign_file("${LY_INSTALL_PATH_ORIGINAL}/O3DE_SDK.app" "none") endfunction() diff --git a/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in b/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in index 892a90640f..51e6e5830c 100644 --- a/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in +++ b/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in @@ -127,7 +127,7 @@ function(ly_copy source_file target_directory) if(NOT is_framework) # if it is a bundle, there is no contention about the files in the destination, each bundle target will copy everything # we dont want these files to invalidate the bundle and cause a new signature - file(LOCK ${target_file}.lock GUARD FUNCTION TIMEOUT 300) + file(LOCK "${target_file}.lock" GUARD FUNCTION TIMEOUT 300) file(SIZE "${source_file}" source_file_size) if(EXISTS "${target_file}") file(SIZE "${target_file}" target_file_size) @@ -176,35 +176,35 @@ if(@target_file_dir@ MATCHES ".app/Contents/MacOS") message(STATUS "Fixing ${bundle_path}/Contents/Frameworks/Python.framework...") list(APPEND fixup_bundle_ignore Python python3.7m python3.7) file(REMOVE_RECURSE - ${bundle_path}/Contents/Frameworks/Python.framework/Versions/Current - ${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/Headers - ${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/lib/Python - ${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/test - ${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scipy/io/tests - ${bundle_path}/Contents/Frameworks/Python.framework/Python - ${bundle_path}/Contents/Frameworks/Python.framework/Resources - ${bundle_path}/Contents/Frameworks/Python.framework/Headers + "${bundle_path}/Contents/Frameworks/Python.framework/Versions/Current" + "${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/Headers" + "${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/lib/Python" + "${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/test" + "${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scipy/io/tests" + "${bundle_path}/Contents/Frameworks/Python.framework/Python" + "${bundle_path}/Contents/Frameworks/Python.framework/Resources" + "${bundle_path}/Contents/Frameworks/Python.framework/Headers" ) file(GLOB_RECURSE exe_file_list "${bundle_path}/Contents/Frameworks/Python.framework/**/*.exe") if(exe_file_list) - file(REMOVE_RECURSE ${exe_file_list}) + file(REMOVE_RECURSE "${exe_file_list}") endif() - execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink include/python3.7m Headers - WORKING_DIRECTORY ${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7 + execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink include/python3.7m Headers + WORKING_DIRECTORY "${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7" ) - execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink 3.7 Current - WORKING_DIRECTORY ${bundle_path}/Contents/Frameworks/Python.framework/Versions/ + execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink 3.7 Current + WORKING_DIRECTORY "${bundle_path}/Contents/Frameworks/Python.framework/Versions/" ) - execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink Versions/Current/Python Python - WORKING_DIRECTORY ${bundle_path}/Contents/Frameworks/Python.framework + execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink Versions/Current/Python Python + WORKING_DIRECTORY "${bundle_path}/Contents/Frameworks/Python.framework" ) - execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink Versions/Current/Headers Headers - WORKING_DIRECTORY ${bundle_path}/Contents/Frameworks/Python.framework + execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink Versions/Current/Headers Headers + WORKING_DIRECTORY "${bundle_path}/Contents/Frameworks/Python.framework" ) - execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink Versions/Current/Resources Resources - WORKING_DIRECTORY ${bundle_path}/Contents/Frameworks/Python.framework + execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink Versions/Current/Resources Resources + WORKING_DIRECTORY "${bundle_path}/Contents/Frameworks/Python.framework" ) - file(CHMOD ${bundle_path}/Contents/Frameworks/Python.framework/Versions/Current/Python + file(CHMOD "${bundle_path}/Contents/Frameworks/Python.framework/Versions/Current/Python" PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE ) endif() @@ -215,8 +215,8 @@ if(@target_file_dir@ MATCHES ".app/Contents/MacOS") file(TOUCH "${fixup_timestamp_file}") # fixup bundle ends up removing the rpath of dxc (despite we exclude it) - if(EXISTS ${bundle_path}/Contents/MacOS/Builders/DirectXShaderCompiler/bin/dxc-3.7) - execute_process(COMMAND ${LY_INSTALL_NAME_TOOL} -add_rpath @executable_path/../lib ${bundle_path}/Contents/MacOS/Builders/DirectXShaderCompiler/bin/dxc-3.7) + if(EXISTS "${bundle_path}/Contents/MacOS/Builders/DirectXShaderCompiler/bin/dxc-3.7") + execute_process(COMMAND $"{LY_INSTALL_NAME_TOOL}" -add_rpath @executable_path/../lib ${bundle_path}/Contents/MacOS/Builders/DirectXShaderCompiler/bin/dxc-3.7) endif() # misplaced .DS_Store files can cause signing to fail @@ -226,7 +226,7 @@ if(@target_file_dir@ MATCHES ".app/Contents/MacOS") "${bundle_path/}**/*.cstemp" ) if(remove_file_list) - file(REMOVE_RECURSE ${remove_file_list}) + file(REMOVE_RECURSE "${remove_file_list}") endif() endif() @@ -235,7 +235,7 @@ else() # Non-bundle case if(depends_on_python) # RPATH fix python - execute_process(COMMAND ${LY_INSTALL_NAME_TOOL} -change @rpath/Python @rpath/Python.framework/Versions/Current/Python @target_file@) + execute_process(COMMAND "${LY_INSTALL_NAME_TOOL}" -change @rpath/Python @rpath/Python.framework/Versions/Current/Python "@target_file@") endif() endif() diff --git a/python/python.cmd b/python/python.cmd index 70c79e6789..28138fd699 100644 --- a/python/python.cmd +++ b/python/python.cmd @@ -21,7 +21,8 @@ SET PYTHONHOME=%CMD_DIR%\runtime\python-3.7.10-rev2-windows\python IF EXIST "%PYTHONHOME%" GOTO PYTHONHOME_EXISTS -ECHO Could not find Python for Windows in %CMD_DIR%\.. +ECHO Python not found in %CMD_DIR% +ECHO Try running %CMD_DIR%\get_python.bat first. exit /B 1 :PYTHONHOME_EXISTS diff --git a/scripts/build/Platform/Linux/build_linux.sh b/scripts/build/Platform/Linux/build_linux.sh index 2f33827c5b..ce84ec1749 100755 --- a/scripts/build/Platform/Linux/build_linux.sh +++ b/scripts/build/Platform/Linux/build_linux.sh @@ -17,7 +17,7 @@ SOURCE_DIRECTORY=${PWD} pushd $OUTPUT_DIRECTORY LAST_CONFIGURE_CMD_FILE=ci_last_configure_cmd.txt -CONFIGURE_CMD="cmake ${SOURCE_DIRECTORY} ${CMAKE_OPTIONS} ${EXTRA_CMAKE_OPTIONS}" +CONFIGURE_CMD="cmake '${SOURCE_DIRECTORY}' ${CMAKE_OPTIONS} ${EXTRA_CMAKE_OPTIONS}" if [[ -n "$CMAKE_LY_PROJECTS" ]]; then CONFIGURE_CMD="${CONFIGURE_CMD} -DLY_PROJECTS='${CMAKE_LY_PROJECTS}'" fi diff --git a/scripts/build/Platform/Mac/build_mac.sh b/scripts/build/Platform/Mac/build_mac.sh index d6a66fc6c6..e0cb1ba889 100755 --- a/scripts/build/Platform/Mac/build_mac.sh +++ b/scripts/build/Platform/Mac/build_mac.sh @@ -17,7 +17,7 @@ SOURCE_DIRECTORY=${PWD} pushd $OUTPUT_DIRECTORY LAST_CONFIGURE_CMD_FILE=ci_last_configure_cmd.txt -CONFIGURE_CMD="cmake ${SOURCE_DIRECTORY} ${CMAKE_OPTIONS} ${EXTRA_CMAKE_OPTIONS}" +CONFIGURE_CMD="cmake '${SOURCE_DIRECTORY}' ${CMAKE_OPTIONS} ${EXTRA_CMAKE_OPTIONS}" if [[ -n "$CMAKE_LY_PROJECTS" ]]; then CONFIGURE_CMD="${CONFIGURE_CMD} -DLY_PROJECTS='${CMAKE_LY_PROJECTS}'" fi diff --git a/scripts/build/Platform/Windows/build_windows.cmd b/scripts/build/Platform/Windows/build_windows.cmd index 9e9b124adb..798550370f 100644 --- a/scripts/build/Platform/Windows/build_windows.cmd +++ b/scripts/build/Platform/Windows/build_windows.cmd @@ -8,8 +8,7 @@ REM REM SETLOCAL EnableDelayedExpansion - -CALL %~dp0env_windows.cmd +CALL "%~dp0env_windows.cmd" IF NOT EXIST "%OUTPUT_DIRECTORY%" ( MKDIR %OUTPUT_DIRECTORY%. @@ -29,7 +28,7 @@ REM Compute half the amount of processors so some jobs can run SET /a HALF_PROCESSORS = NUMBER_OF_PROCESSORS / 2 SET LAST_CONFIGURE_CMD_FILE=ci_last_configure_cmd.txt -SET CONFIGURE_CMD=cmake %SOURCE_DIRECTORY% %CMAKE_OPTIONS% %EXTRA_CMAKE_OPTIONS% +SET CONFIGURE_CMD=cmake "%SOURCE_DIRECTORY%" %CMAKE_OPTIONS% %EXTRA_CMAKE_OPTIONS% IF NOT "%CMAKE_LY_PROJECTS%"=="" ( SET CONFIGURE_CMD=!CONFIGURE_CMD! -DLY_PROJECTS="%CMAKE_LY_PROJECTS%" ) diff --git a/scripts/build/ci_build.py b/scripts/build/ci_build.py index c35a5e9dbf..78978349c3 100755 --- a/scripts/build/ci_build.py +++ b/scripts/build/ci_build.py @@ -88,7 +88,7 @@ def build(build_config_filename, build_platform, build_type): env_params[v] = build_params[v] print(' {} = {} {}'.format(v, env_params[v], '(environment override)' if existing_param else '')) print('--------------------------------------------------------------------------------', flush=True) - process_return = subprocess.run(build_cmd_path, cwd=cwd_dir, env=env_params) + process_return = subprocess.run([build_cmd_path], cwd=cwd_dir, env=env_params) print('--------------------------------------------------------------------------------') if process_return.returncode != 0: print('[ci_build] FAIL: Command {} returned {}'.format(build_cmd_path, process_return.returncode), flush=True) From 5c0ba0253d25a9a12f91d23e36a0dc10f95de0c7 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Mon, 10 Jan 2022 10:01:17 -0800 Subject: [PATCH 398/948] git.ignore cleanup (#6760) Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .gitignore | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 9012ec7576..2820d1e1c1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,18 +2,14 @@ .vs/ .vscode/ __pycache__ -AssetProcessorTemp/** [Bb]uild/ [Oo]ut/** CMakeUserPresets.json [Cc]ache/ /[Ii]nstall/ -Editor/EditorEventLog.xml -Editor/EditorLayout.xml **/*egg-info/** **/*egg-link **/[Rr]estricted -UserSettings.xml [Uu]ser/ FrameCapture/** .DS_Store @@ -22,9 +18,6 @@ client*.cfg server*.cfg .mayaSwatches/ _savebackup/ -#Output folder for test results when running Automated Tests -TestResults/** *.swatches /imgui.ini -/scripts/project_manager/logs/ -/AutomatedTesting/Gem/PythonTests/scripting/TestResults + From e4c04c1915c05aad3e1305f2b6aeac015de9131e Mon Sep 17 00:00:00 2001 From: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> Date: Mon, 10 Jan 2022 12:03:32 -0600 Subject: [PATCH 399/948] Removing redundant Editor test Signed-off-by: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> --- .../Gem/PythonTests/smoke/CMakeLists.txt | 13 -- .../smoke/Editor_NewExistingLevels_Works.py | 143 ------------------ .../test_Editor_NewExistingLevels_Works.py | 34 ----- 3 files changed, 190 deletions(-) delete mode 100644 AutomatedTesting/Gem/PythonTests/smoke/Editor_NewExistingLevels_Works.py delete mode 100644 AutomatedTesting/Gem/PythonTests/smoke/test_Editor_NewExistingLevels_Works.py diff --git a/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt index 5d0808adb6..69d411536f 100644 --- a/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt @@ -31,19 +31,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) Smoke ) - ly_add_pytest( - NAME AutomatedTesting::EditorTestWithGPU - TEST_REQUIRES gpu - PATH ${CMAKE_CURRENT_LIST_DIR}/test_Editor_NewExistingLevels_Works.py - TIMEOUT 100 - RUNTIME_DEPENDENCIES - AZ::AssetProcessor - AZ::PythonBindingsExample - Legacy::Editor - AutomatedTesting.GameLauncher - AutomatedTesting.Assets - ) - ly_add_pytest( NAME AutomatedTesting::GameLauncherWithGPU TEST_SUITE sandbox diff --git a/AutomatedTesting/Gem/PythonTests/smoke/Editor_NewExistingLevels_Works.py b/AutomatedTesting/Gem/PythonTests/smoke/Editor_NewExistingLevels_Works.py deleted file mode 100644 index 71956488fc..0000000000 --- a/AutomatedTesting/Gem/PythonTests/smoke/Editor_NewExistingLevels_Works.py +++ /dev/null @@ -1,143 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT - - -Test Case Title: Create Test for UI apps- Editor -""" - - -class Tests(): - level_created = ("Level created", "Failed to create level") - entity_found = ("New Entity created in level", "Failed to create New Entity in level") - mesh_added = ("Mesh Component added", "Failed to add Mesh Component") - enter_game_mode = ("Game Mode successfully entered", "Failed to enter in Game Mode") - exit_game_mode = ("Game Mode successfully exited", "Failed to exit in Game Mode") - level_opened = ("Level opened successfully", "Failed to open level") - level_exported = ("Level exported successfully", "Failed to export level") - mesh_removed = ("Mesh Component removed", "Failed to remove Mesh Component") - entity_deleted = ("Entity deleted", "Failed to delete Entity") - level_edits_present = ("Level edits persist after saving", "Failed to save level edits after saving") - - -def Editor_NewExistingLevels_Works(): - """ - Summary: Perform the below operations on Editor - - 1) Launch & Close editor - 2) Create new level - 3) Saving and loading levels - 4) Level edits persist after saving - 5) Export Level - 6) Can switch to play mode (ctrl+g) and exit that - 7) Run editor python bindings test - 8) Create an Entity - 9) Delete an Entity - 10) Add a component to an Entity - - Expected Behavior: - All operations succeed and do not cause a crash - - Test Steps: - 1) Launch editor and Create a new level - 2) Create a new entity - 3) Add Mesh component - 4) Verify enter/exit game mode - 5) Save, Load and Export level - 6) Remove Mesh component - 7) Delete entity - 8) Open an existing level - 9) Create a new entity in an existing level - 10) Save, Load and Export an existing level and close editor - - Note: - - This test file must be called from the O3DE Editor command terminal - - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. - - :return: None - """ - - import os - import editor_python_test_tools.hydra_editor_utils as hydra - from editor_python_test_tools.utils import TestHelper as helper - from editor_python_test_tools.utils import Report - import azlmbr.bus as bus - import azlmbr.editor as editor - import azlmbr.legacy.general as general - import azlmbr.math as math - - # 1) Launch editor and Create a new level - helper.init_idle() - test_level_name = "temp_level" - general.create_level_no_prompt(test_level_name, 128, 1, 128, False) - helper.wait_for_condition(lambda: general.get_current_level_name() == test_level_name, 2.0) - Report.result(Tests.level_created, general.get_current_level_name() == test_level_name) - - # 2) Create a new entity - entity_position = math.Vector3(200.0, 200.0, 38.0) - new_entity = hydra.Entity("Entity1") - new_entity.create_entity(entity_position, []) - test_entity = hydra.find_entity_by_name("Entity1") - Report.result(Tests.entity_found, test_entity.IsValid()) - - # 3) Add Mesh component - new_entity.add_component("Mesh") - Report.result(Tests.mesh_added, hydra.has_components(new_entity.id, ["Mesh"])) - - # 4) Verify enter/exit game mode - helper.enter_game_mode(Tests.enter_game_mode) - helper.exit_game_mode(Tests.exit_game_mode) - - # 5) Save, Load and Export level - # Save Level - general.save_level() - # Open Level - general.open_level(test_level_name) - Report.result(Tests.level_opened, general.get_current_level_name() == test_level_name) - # Export Level - general.export_to_engine() - level_pak_file = os.path.join("AutomatedTesting", "Levels", test_level_name, "level.pak") - Report.result(Tests.level_exported, os.path.exists(level_pak_file)) - - # 6) Remove Mesh component - new_entity.remove_component("Mesh") - Report.result(Tests.mesh_removed, not hydra.has_components(new_entity.id, ["Mesh"])) - - # 7) Delete entity - editor.ToolsApplicationRequestBus(bus.Broadcast, "DeleteEntityById", new_entity.id) - test_entity = hydra.find_entity_by_name("Entity1") - Report.result(Tests.entity_deleted, len(test_entity) == 0) - - # 8) Open an existing level - general.open_level(test_level_name) - Report.result(Tests.level_opened, general.get_current_level_name() == test_level_name) - - # 9) Create a new entity in an existing level - entity_position = math.Vector3(200.0, 200.0, 38.0) - new_entity_2 = hydra.Entity("Entity2") - new_entity_2.create_entity(entity_position, []) - test_entity = hydra.find_entity_by_name("Entity2") - Report.result(Tests.entity_found, test_entity.IsValid()) - - # 10) Save, Load and Export an existing level - # Save Level - general.save_level() - # Open Level - general.open_level(test_level_name) - Report.result(Tests.level_opened, general.get_current_level_name() == test_level_name) - entity_id = hydra.find_entity_by_name(new_entity_2.name) - Report.result(Tests.level_edits_present, entity_id == new_entity_2.id) - # Export Level - general.export_to_engine() - level_pak_file = os.path.join("AutomatedTesting", "Levels", test_level_name, "level.pak") - Report.result(Tests.level_exported, os.path.exists(level_pak_file)) - - -if __name__ == "__main__": - - from editor_python_test_tools.utils import Report - - Report.start_test(Editor_NewExistingLevels_Works) diff --git a/AutomatedTesting/Gem/PythonTests/smoke/test_Editor_NewExistingLevels_Works.py b/AutomatedTesting/Gem/PythonTests/smoke/test_Editor_NewExistingLevels_Works.py deleted file mode 100644 index 5caf7744c4..0000000000 --- a/AutomatedTesting/Gem/PythonTests/smoke/test_Editor_NewExistingLevels_Works.py +++ /dev/null @@ -1,34 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT - - -Test should run in both gpu and non gpu -""" - -import pytest -import os -from automatedtesting_shared.base import TestAutomationBase - -import ly_test_tools -import ly_test_tools.environment.file_system as file_system - - -@pytest.mark.SUITE_smoke -@pytest.mark.skipif(not ly_test_tools.WINDOWS, reason="Only succeeds on windows https://github.com/o3de/o3de/issues/5539") -@pytest.mark.parametrize("launcher_platform", ["windows_editor"]) -@pytest.mark.parametrize("project", ["AutomatedTesting"]) -@pytest.mark.parametrize("level", ["temp_level"]) -class TestAutomation(TestAutomationBase): - def test_Editor_NewExistingLevels_Works(self, request, workspace, editor, level, project, launcher_platform): - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - request.addfinalizer(teardown) - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - from . import Editor_NewExistingLevels_Works as test_module - - self._run_test(request, workspace, editor, test_module, enable_prefab_system=False) From 5aa7d56f1a75a0f3bdc0fef569d0f421a868d1da Mon Sep 17 00:00:00 2001 From: LesaelR <89800757+LesaelR@users.noreply.github.com> Date: Mon, 10 Jan 2022 10:15:43 -0800 Subject: [PATCH 400/948] LYN-8935 Bundle Mode Test Update (#6606) * Updating Bundle_Mode_Tests to replace level.pak for .spawnable Signed-off-by: Rosario Cox * Removing old TestDependenciesLevel files and replacing for TestDepencenciesLevel.prefab Signed-off-by: Rosario Cox * Adding missing file Signed-off-by: Rosario Cox --- .../bundle_mode_tests.py | 5 +- .../LevelData/Environment.xml | 14 - .../LevelData/TerrainTexture.xml | 7 - .../LevelData/TimeOfDay.xml | 356 ----------- .../LevelData/VegetationMap.dat | 3 - .../TestDependenciesLevel/TerrainTexture.pak | 3 - .../TestDependenciesLevel.ly | 3 - .../TestDependenciesLevel.prefab | 555 ++++++++++++++++++ .../Levels/TestDependenciesLevel/filelist.xml | 6 - .../Levels/TestDependenciesLevel/level.pak | 3 - 10 files changed, 557 insertions(+), 398 deletions(-) delete mode 100644 AutomatedTesting/Levels/TestDependenciesLevel/LevelData/Environment.xml delete mode 100644 AutomatedTesting/Levels/TestDependenciesLevel/LevelData/TerrainTexture.xml delete mode 100644 AutomatedTesting/Levels/TestDependenciesLevel/LevelData/TimeOfDay.xml delete mode 100644 AutomatedTesting/Levels/TestDependenciesLevel/LevelData/VegetationMap.dat delete mode 100644 AutomatedTesting/Levels/TestDependenciesLevel/TerrainTexture.pak delete mode 100644 AutomatedTesting/Levels/TestDependenciesLevel/TestDependenciesLevel.ly create mode 100644 AutomatedTesting/Levels/TestDependenciesLevel/TestDependenciesLevel.prefab delete mode 100644 AutomatedTesting/Levels/TestDependenciesLevel/filelist.xml delete mode 100644 AutomatedTesting/Levels/TestDependenciesLevel/level.pak diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/bundle_mode_tests.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/bundle_mode_tests.py index af92bb1773..b2252567b6 100644 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/bundle_mode_tests.py +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/bundle_mode_tests.py @@ -23,12 +23,11 @@ from ..ap_fixtures.timeout_option_fixture import timeout_option_fixture as timeo @pytest.mark.SUITE_periodic @pytest.mark.parametrize('launcher_platform', ['windows_editor']) @pytest.mark.parametrize('project', ['AutomatedTesting']) -@pytest.mark.parametrize('level', ['auto_test']) +@pytest.mark.parametrize('level', ['TestDependenciesLevel']) class TestBundleMode(object): def test_bundle_mode_with_levels_mounts_bundles_correctly(self, request, editor, level, launcher_platform, asset_processor, workspace, bundler_batch_helper): - level_pak = os.path.join("levels", level, "level.pak") - + level_pak = os.path.join("levels", level, "TestDependenciesLevel.spawnable") bundles_folder = os.path.join(workspace.paths.project(), "Bundles") bundle_request_path = os.path.join(bundles_folder, "bundle.pak") bundle_result_path = os.path.join(bundles_folder, diff --git a/AutomatedTesting/Levels/TestDependenciesLevel/LevelData/Environment.xml b/AutomatedTesting/Levels/TestDependenciesLevel/LevelData/Environment.xml deleted file mode 100644 index 4ba36f66ae..0000000000 --- a/AutomatedTesting/Levels/TestDependenciesLevel/LevelData/Environment.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/AutomatedTesting/Levels/TestDependenciesLevel/LevelData/TerrainTexture.xml b/AutomatedTesting/Levels/TestDependenciesLevel/LevelData/TerrainTexture.xml deleted file mode 100644 index f43df05b22..0000000000 --- a/AutomatedTesting/Levels/TestDependenciesLevel/LevelData/TerrainTexture.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/AutomatedTesting/Levels/TestDependenciesLevel/LevelData/TimeOfDay.xml b/AutomatedTesting/Levels/TestDependenciesLevel/LevelData/TimeOfDay.xml deleted file mode 100644 index c5b404318e..0000000000 --- a/AutomatedTesting/Levels/TestDependenciesLevel/LevelData/TimeOfDay.xml +++ /dev/null @@ -1,356 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/AutomatedTesting/Levels/TestDependenciesLevel/LevelData/VegetationMap.dat b/AutomatedTesting/Levels/TestDependenciesLevel/LevelData/VegetationMap.dat deleted file mode 100644 index dce5631cd0..0000000000 --- a/AutomatedTesting/Levels/TestDependenciesLevel/LevelData/VegetationMap.dat +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0e6a5435c928079b27796f6b202bbc2623e7e454244ddc099a3cadf33b7cb9e9 -size 63 diff --git a/AutomatedTesting/Levels/TestDependenciesLevel/TerrainTexture.pak b/AutomatedTesting/Levels/TestDependenciesLevel/TerrainTexture.pak deleted file mode 100644 index fe3604a050..0000000000 --- a/AutomatedTesting/Levels/TestDependenciesLevel/TerrainTexture.pak +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8739c76e681f900923b900c9df0ef75cf421d39cabb54650c4b9ad19b6a76d85 -size 22 diff --git a/AutomatedTesting/Levels/TestDependenciesLevel/TestDependenciesLevel.ly b/AutomatedTesting/Levels/TestDependenciesLevel/TestDependenciesLevel.ly deleted file mode 100644 index 95cc91cd6b..0000000000 --- a/AutomatedTesting/Levels/TestDependenciesLevel/TestDependenciesLevel.ly +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:825828fe7c183e765315f933a8b1eb25283739d34d62cb84c34e2dcb56591d6e -size 12415 diff --git a/AutomatedTesting/Levels/TestDependenciesLevel/TestDependenciesLevel.prefab b/AutomatedTesting/Levels/TestDependenciesLevel/TestDependenciesLevel.prefab new file mode 100644 index 0000000000..cf30cb178c --- /dev/null +++ b/AutomatedTesting/Levels/TestDependenciesLevel/TestDependenciesLevel.prefab @@ -0,0 +1,555 @@ +{ + "ContainerEntity": { + "Id": "Entity_[1146574390643]", + "Name": "Level", + "Components": { + "Component_[10641544592923449938]": { + "$type": "EditorInspectorComponent", + "Id": 10641544592923449938 + }, + "Component_[12039882709170782873]": { + "$type": "EditorOnlyEntityComponent", + "Id": 12039882709170782873 + }, + "Component_[12265484671603697631]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12265484671603697631 + }, + "Component_[14126657869720434043]": { + "$type": "EditorEntitySortComponent", + "Id": 14126657869720434043, + "Child Entity Order": [ + "Entity_[1176639161715]" + ] + }, + "Component_[15230859088967841193]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 15230859088967841193, + "Parent Entity": "" + }, + "Component_[16239496886950819870]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 16239496886950819870 + }, + "Component_[5688118765544765547]": { + "$type": "EditorEntityIconComponent", + "Id": 5688118765544765547 + }, + "Component_[6545738857812235305]": { + "$type": "SelectionComponent", + "Id": 6545738857812235305 + }, + "Component_[7247035804068349658]": { + "$type": "EditorPrefabComponent", + "Id": 7247035804068349658 + }, + "Component_[9307224322037797205]": { + "$type": "EditorLockComponent", + "Id": 9307224322037797205 + }, + "Component_[9562516168917670048]": { + "$type": "EditorVisibilityComponent", + "Id": 9562516168917670048 + } + } + }, + "Entities": { + "Entity_[1155164325235]": { + "Id": "Entity_[1155164325235]", + "Name": "Sun", + "Components": { + "Component_[10440557478882592717]": { + "$type": "SelectionComponent", + "Id": 10440557478882592717 + }, + "Component_[13620450453324765907]": { + "$type": "EditorLockComponent", + "Id": 13620450453324765907 + }, + "Component_[2134313378593666258]": { + "$type": "EditorInspectorComponent", + "Id": 2134313378593666258 + }, + "Component_[234010807770404186]": { + "$type": "EditorVisibilityComponent", + "Id": 234010807770404186 + }, + "Component_[2970359110423865725]": { + "$type": "EditorEntityIconComponent", + "Id": 2970359110423865725 + }, + "Component_[3722854130373041803]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3722854130373041803 + }, + "Component_[5992533738676323195]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5992533738676323195 + }, + "Component_[7378860763541895402]": { + "$type": "AZ::Render::EditorDirectionalLightComponent", + "Id": 7378860763541895402, + "Controller": { + "Configuration": { + "Intensity": 1.0, + "CameraEntityId": "", + "ShadowFilterMethod": 1 + } + } + }, + "Component_[7892834440890947578]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 7892834440890947578, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + 0.0, + 0.0, + 13.487043380737305 + ], + "Rotate": [ + -76.13099670410156, + -0.847000002861023, + -15.8100004196167 + ] + } + }, + "Component_[8599729549570828259]": { + "$type": "EditorEntitySortComponent", + "Id": 8599729549570828259 + }, + "Component_[952797371922080273]": { + "$type": "EditorPendingCompositionComponent", + "Id": 952797371922080273 + } + } + }, + "Entity_[1159459292531]": { + "Id": "Entity_[1159459292531]", + "Name": "Ground", + "Components": { + "Component_[11701138785793981042]": { + "$type": "SelectionComponent", + "Id": 11701138785793981042 + }, + "Component_[12260880513256986252]": { + "$type": "EditorEntityIconComponent", + "Id": 12260880513256986252 + }, + "Component_[13711420870643673468]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13711420870643673468 + }, + "Component_[138002849734991713]": { + "$type": "EditorOnlyEntityComponent", + "Id": 138002849734991713 + }, + "Component_[16578565737331764849]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 16578565737331764849, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[16919232076966545697]": { + "$type": "EditorInspectorComponent", + "Id": 16919232076966545697 + }, + "Component_[5182430712893438093]": { + "$type": "EditorMaterialComponent", + "Id": 5182430712893438093 + }, + "Component_[5675108321710651991]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 5675108321710651991, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{0CD745C0-6AA8-569A-A68A-73A3270986C4}", + "subId": 277889906 + }, + "assetHint": "objects/groudplane/groundplane_512x512m.azmodel" + } + } + } + }, + "Component_[5681893399601237518]": { + "$type": "EditorEntitySortComponent", + "Id": 5681893399601237518 + }, + "Component_[592692962543397545]": { + "$type": "EditorPendingCompositionComponent", + "Id": 592692962543397545 + }, + "Component_[7090012899106946164]": { + "$type": "EditorLockComponent", + "Id": 7090012899106946164 + }, + "Component_[9410832619875640998]": { + "$type": "EditorVisibilityComponent", + "Id": 9410832619875640998 + } + } + }, + "Entity_[1163754259827]": { + "Id": "Entity_[1163754259827]", + "Name": "Camera", + "Components": { + "Component_[11895140916889160460]": { + "$type": "EditorEntityIconComponent", + "Id": 11895140916889160460 + }, + "Component_[16880285896855930892]": { + "$type": "{CA11DA46-29FF-4083-B5F6-E02C3A8C3A3D} EditorCameraComponent", + "Id": 16880285896855930892, + "Controller": { + "Configuration": { + "Field of View": 55.0, + "EditorEntityId": 3342481886060234850 + } + } + }, + "Component_[17187464423780271193]": { + "$type": "EditorLockComponent", + "Id": 17187464423780271193 + }, + "Component_[17495696818315413311]": { + "$type": "EditorEntitySortComponent", + "Id": 17495696818315413311 + }, + "Component_[18086214374043522055]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 18086214374043522055, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + -2.3000001907348633, + -3.9368600845336914, + 1.0 + ], + "Rotate": [ + -2.050307512283325, + 1.9552897214889526, + -43.623355865478516 + ] + } + }, + "Component_[18387556550380114975]": { + "$type": "SelectionComponent", + "Id": 18387556550380114975 + }, + "Component_[2654521436129313160]": { + "$type": "EditorVisibilityComponent", + "Id": 2654521436129313160 + }, + "Component_[5265045084611556958]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5265045084611556958 + }, + "Component_[7169798125182238623]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7169798125182238623 + }, + "Component_[7255796294953281766]": { + "$type": "GenericComponentWrapper", + "Id": 7255796294953281766, + "m_template": { + "$type": "FlyCameraInputComponent" + } + }, + "Component_[8866210352157164042]": { + "$type": "EditorInspectorComponent", + "Id": 8866210352157164042 + }, + "Component_[9129253381063760879]": { + "$type": "EditorOnlyEntityComponent", + "Id": 9129253381063760879 + } + } + }, + "Entity_[1168049227123]": { + "Id": "Entity_[1168049227123]", + "Name": "Grid", + "Components": { + "Component_[11443347433215807130]": { + "$type": "EditorEntityIconComponent", + "Id": 11443347433215807130 + }, + "Component_[11779275529534764488]": { + "$type": "SelectionComponent", + "Id": 11779275529534764488 + }, + "Component_[14249419413039427459]": { + "$type": "EditorInspectorComponent", + "Id": 14249419413039427459 + }, + "Component_[15448581635946161318]": { + "$type": "AZ::Render::EditorGridComponent", + "Id": 15448581635946161318, + "Controller": { + "Configuration": { + "primarySpacing": 4.0, + "primaryColor": [ + 0.501960813999176, + 0.501960813999176, + 0.501960813999176 + ], + "secondarySpacing": 0.5, + "secondaryColor": [ + 0.250980406999588, + 0.250980406999588, + 0.250980406999588 + ] + } + } + }, + "Component_[1843303322527297409]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1843303322527297409 + }, + "Component_[380249072065273654]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 380249072065273654, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[7476660583684339787]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7476660583684339787 + }, + "Component_[7557626501215118375]": { + "$type": "EditorEntitySortComponent", + "Id": 7557626501215118375 + }, + "Component_[7984048488947365511]": { + "$type": "EditorVisibilityComponent", + "Id": 7984048488947365511 + }, + "Component_[8118181039276487398]": { + "$type": "EditorOnlyEntityComponent", + "Id": 8118181039276487398 + }, + "Component_[9189909764215270515]": { + "$type": "EditorLockComponent", + "Id": 9189909764215270515 + } + } + }, + "Entity_[1172344194419]": { + "Id": "Entity_[1172344194419]", + "Name": "Shader Ball", + "Components": { + "Component_[10789351944715265527]": { + "$type": "EditorOnlyEntityComponent", + "Id": 10789351944715265527 + }, + "Component_[12037033284781049225]": { + "$type": "EditorEntitySortComponent", + "Id": 12037033284781049225 + }, + "Component_[13759153306105970079]": { + "$type": "EditorPendingCompositionComponent", + "Id": 13759153306105970079 + }, + "Component_[14135560884830586279]": { + "$type": "EditorInspectorComponent", + "Id": 14135560884830586279 + }, + "Component_[16247165675903986673]": { + "$type": "EditorVisibilityComponent", + "Id": 16247165675903986673 + }, + "Component_[18082433625958885247]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 18082433625958885247 + }, + "Component_[6472623349872972660]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6472623349872972660, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Rotate": [ + 0.0, + 0.10000000149011612, + 180.0 + ] + } + }, + "Component_[6495255223970673916]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 6495255223970673916, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{FD340C30-755C-5911-92A3-19A3F7A77931}", + "subId": 281415304 + }, + "assetHint": "objects/shaderball/shaderball_default_1m.azmodel" + } + } + } + }, + "Component_[8056625192494070973]": { + "$type": "SelectionComponent", + "Id": 8056625192494070973 + }, + "Component_[8550141614185782969]": { + "$type": "EditorEntityIconComponent", + "Id": 8550141614185782969 + }, + "Component_[9439770997198325425]": { + "$type": "EditorLockComponent", + "Id": 9439770997198325425 + } + } + }, + "Entity_[1176639161715]": { + "Id": "Entity_[1176639161715]", + "Name": "Atom Default Environment", + "Components": { + "Component_[10757302973393310045]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 10757302973393310045, + "Parent Entity": "Entity_[1146574390643]" + }, + "Component_[14505817420424255464]": { + "$type": "EditorInspectorComponent", + "Id": 14505817420424255464, + "ComponentOrderEntryArray": [ + { + "ComponentId": 10757302973393310045 + } + ] + }, + "Component_[14988041764659020032]": { + "$type": "EditorLockComponent", + "Id": 14988041764659020032 + }, + "Component_[15808690248755038124]": { + "$type": "SelectionComponent", + "Id": 15808690248755038124 + }, + "Component_[15900837685796817138]": { + "$type": "EditorVisibilityComponent", + "Id": 15900837685796817138 + }, + "Component_[3298767348226484884]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3298767348226484884 + }, + "Component_[4076975109609220594]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4076975109609220594 + }, + "Component_[5679760548946028854]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5679760548946028854 + }, + "Component_[5855590796136709437]": { + "$type": "EditorEntitySortComponent", + "Id": 5855590796136709437, + "Child Entity Order": [ + "Entity_[1155164325235]", + "Entity_[1180934129011]", + "Entity_[1172344194419]", + "Entity_[1168049227123]", + "Entity_[1163754259827]", + "Entity_[1159459292531]" + ] + }, + "Component_[9277695270015777859]": { + "$type": "EditorEntityIconComponent", + "Id": 9277695270015777859 + } + } + }, + "Entity_[1180934129011]": { + "Id": "Entity_[1180934129011]", + "Name": "Global Sky", + "Components": { + "Component_[11231930600558681245]": { + "$type": "AZ::Render::EditorHDRiSkyboxComponent", + "Id": 11231930600558681245, + "Controller": { + "Configuration": { + "CubemapAsset": { + "assetId": { + "guid": "{215E47FD-D181-5832-B1AB-91673ABF6399}", + "subId": 1000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_skyboxcm.exr.streamingimage" + } + } + } + }, + "Component_[11980494120202836095]": { + "$type": "SelectionComponent", + "Id": 11980494120202836095 + }, + "Component_[1428633914413949476]": { + "$type": "EditorLockComponent", + "Id": 1428633914413949476 + }, + "Component_[14936200426671614999]": { + "$type": "AZ::Render::EditorImageBasedLightComponent", + "Id": 14936200426671614999, + "Controller": { + "Configuration": { + "diffuseImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 3000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_ibldiffuse.exr.streamingimage" + }, + "specularImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 2000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_iblspecular.exr.streamingimage" + } + } + } + }, + "Component_[14994774102579326069]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 14994774102579326069 + }, + "Component_[15417479889044493340]": { + "$type": "EditorPendingCompositionComponent", + "Id": 15417479889044493340 + }, + "Component_[15826613364991382688]": { + "$type": "EditorEntitySortComponent", + "Id": 15826613364991382688 + }, + "Component_[1665003113283562343]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1665003113283562343 + }, + "Component_[3704934735944502280]": { + "$type": "EditorEntityIconComponent", + "Id": 3704934735944502280 + }, + "Component_[5698542331457326479]": { + "$type": "EditorVisibilityComponent", + "Id": 5698542331457326479 + }, + "Component_[6644513399057217122]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6644513399057217122, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[931091830724002070]": { + "$type": "EditorInspectorComponent", + "Id": 931091830724002070 + } + } + } + }, + "Instances": { + "Instance_[425258647110]": { + "Source": "assets/simple_pot_fbx.procprefab" + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/TestDependenciesLevel/filelist.xml b/AutomatedTesting/Levels/TestDependenciesLevel/filelist.xml deleted file mode 100644 index b5164a4aee..0000000000 --- a/AutomatedTesting/Levels/TestDependenciesLevel/filelist.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/AutomatedTesting/Levels/TestDependenciesLevel/level.pak b/AutomatedTesting/Levels/TestDependenciesLevel/level.pak deleted file mode 100644 index dfba7fb4e3..0000000000 --- a/AutomatedTesting/Levels/TestDependenciesLevel/level.pak +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2611b691998640a0e802461f47b5b876f6832fbece62d34cc25da53e135e1c38 -size 44525 From 8e2e2d96c50bca2a9210f13df1fdd910193e80be Mon Sep 17 00:00:00 2001 From: LesaelR <89800757+LesaelR@users.noreply.github.com> Date: Mon, 10 Jan 2022 10:15:51 -0800 Subject: [PATCH 401/948] Updating asset_bundler_batch_tests to Prefab/Spawnables instead of Level.pak (#6679) * Replaced TestDependenciesLevel's level.pak for TestDependenciesLevel.prefab to fix asset_bundler_batch_tests failure Updated asset_bundler_batch_tests to reflect the update. Signed-off-by: Rosario Cox * Missed one of the .spawnables changes Signed-off-by: Rosario Cox --- .../asset_processor_tests/asset_bundler_batch_tests.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_bundler_batch_tests.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_bundler_batch_tests.py index f5e5642573..f64427f6df 100755 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_bundler_batch_tests.py +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_bundler_batch_tests.py @@ -108,7 +108,7 @@ class TestsAssetBundlerBatch_WindowsAndMac(object): """ helper = bundler_batch_helper seed_list = os.path.join(workspace.paths.engine_root(), "Assets", "Engine", "SeedAssetList.seed") # Engine seed list - asset = r"levels\testdependencieslevel\level.pak" + asset = r"levels\testdependencieslevel\testdependencieslevel.spawnable" # Create Asset list helper.call_assetLists( @@ -191,7 +191,7 @@ class TestsAssetBundlerBatch_WindowsAndMac(object): """ helper = bundler_batch_helper seed_list = os.path.join(workspace.paths.engine_root(), "Assets", "Engine", "SeedAssetList.seed") # Engine seed list - asset = r"levels\testdependencieslevel\level.pak" + asset = r"levels\testdependencieslevel\testdependencieslevel.spawnable" # Useful bundle locations / names (2 for comparing contents) # fmt:off @@ -924,7 +924,7 @@ class TestsAssetBundlerBatch_WindowsAndMac(object): # Create a seed file helper.call_seeds( seedListFile=helper["seed_list_file"], - addSeed=r"levels\testdependencieslevel\level.pak", + addSeed=r"levels\testdependencieslevel\testdependencieslevel.spawnable", platform="pc", ) @@ -947,9 +947,9 @@ class TestsAssetBundlerBatch_WindowsAndMac(object): # Specifying platform but not "add" or "remove" should fail result, _ = helper.call_assetLists( assetListFile=helper["asset_info_file_request"], + allowOverwrites="", seedListFile=helper["seed_list_file"], platform="pc", - allowOverwrites="", ) assert result, "Overwriting with override threw an error" @@ -982,7 +982,7 @@ class TestsAssetBundlerBatch_WindowsAndMac(object): request.addfinalizer(lambda: fs.delete([bundle_result_path], True, False)) bundles_folder = os.path.join(workspace.paths.project(), "Bundles") - level_pak = r"levels\testdependencieslevel\level.pak" + level_pak = r"levels\testdependencieslevel\testdependencieslevel.spawnable" bundle_request_path = os.path.join(bundles_folder, "bundle.pak") bundle_result_path = os.path.join(bundles_folder, helper.platform_file_name("bundle.pak", workspace.asset_processor_platform)) From df7a2fbd9d8e07f2d6786c1927eeddab2f05513e Mon Sep 17 00:00:00 2001 From: michabr <82236305+michabr@users.noreply.github.com> Date: Mon, 10 Jan 2022 12:11:15 -0800 Subject: [PATCH 402/948] Add better error handling for failed loading of the LyShine shader (#6761) Signed-off-by: abrmich --- .../DynamicDraw/DynamicDrawContext.cpp | 6 ++- Gems/LyShine/Code/Source/Draw2d.cpp | 49 +++++++++++-------- Gems/LyShine/Code/Source/UiRenderer.cpp | 4 +- 3 files changed, 35 insertions(+), 24 deletions(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/DynamicDraw/DynamicDrawContext.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/DynamicDraw/DynamicDrawContext.cpp index 3b3473a2da..47791d3002 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/DynamicDraw/DynamicDrawContext.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/DynamicDraw/DynamicDrawContext.cpp @@ -141,6 +141,7 @@ namespace AZ void DynamicDrawContext::InitVertexFormat(const AZStd::vector& vertexChannels) { AZ_Assert(!m_initialized, "Can't call InitVertexFormat after context was initialized (EndInit was called)"); + AZ_Assert(m_pipelineState, "Can't call InitVertexFormat before InitShader is called with a valid shader"); m_perVertexDataSize = 0; RHI::InputStreamLayoutBuilder layoutBuilder; @@ -150,7 +151,10 @@ namespace AZ bufferBuilder->Channel(channel.m_channel, channel.m_format); m_perVertexDataSize += RHI::GetFormatSize(channel.m_format); } - m_pipelineState->InputStreamLayout() = layoutBuilder.End(); + if (m_pipelineState) + { + m_pipelineState->InputStreamLayout() = layoutBuilder.End(); + } } void DynamicDrawContext::InitDrawListTag(RHI::DrawListTag drawListTag) diff --git a/Gems/LyShine/Code/Source/Draw2d.cpp b/Gems/LyShine/Code/Source/Draw2d.cpp index 917c1bb168..2838ed4877 100644 --- a/Gems/LyShine/Code/Source/Draw2d.cpp +++ b/Gems/LyShine/Code/Source/Draw2d.cpp @@ -122,27 +122,34 @@ void CDraw2d::OnBootstrapSceneReady(AZ::RPI::Scene* bootstrapScene) } m_dynamicDraw->EndInit(); - // Cache draw srg input indices for later use - static const char textureIndexName[] = "m_texture"; - static const char worldToProjIndexName[] = "m_worldToProj"; - AZ::Data::Instance drawSrg = m_dynamicDraw->NewDrawSrg(); - const AZ::RHI::ShaderResourceGroupLayout* layout = drawSrg->GetLayout(); - m_shaderData.m_imageInputIndex = layout->FindShaderInputImageIndex(AZ::Name(textureIndexName)); - AZ_Error("Draw2d", m_shaderData.m_imageInputIndex.IsValid(), "Failed to find shader input constant %s.", - textureIndexName); - m_shaderData.m_viewProjInputIndex = layout->FindShaderInputConstantIndex(AZ::Name(worldToProjIndexName)); - AZ_Error("Draw2d", m_shaderData.m_viewProjInputIndex.IsValid(), "Failed to find shader input constant %s.", - worldToProjIndexName); - - // Cache shader variants that will be used - AZ::RPI::ShaderOptionList shaderOptionsClamp; - shaderOptionsClamp.push_back(AZ::RPI::ShaderOption(AZ::Name("o_clamp"), AZ::Name("true"))); - shaderOptionsClamp.push_back(AZ::RPI::ShaderOption(AZ::Name("o_useColorChannels"), AZ::Name("true"))); - m_shaderData.m_shaderOptionsClamp = m_dynamicDraw->UseShaderVariant(shaderOptionsClamp); - AZ::RPI::ShaderOptionList shaderOptionsWrap; - shaderOptionsWrap.push_back(AZ::RPI::ShaderOption(AZ::Name("o_clamp"), AZ::Name("false"))); - shaderOptionsWrap.push_back(AZ::RPI::ShaderOption(AZ::Name("o_useColorChannels"), AZ::Name("true"))); - m_shaderData.m_shaderOptionsWrap = m_dynamicDraw->UseShaderVariant(shaderOptionsWrap); + // Check that the dynamic draw context has been initialized appropriately + if (m_dynamicDraw->IsReady()) + { + // Cache draw srg input indices for later use + static const char textureIndexName[] = "m_texture"; + static const char worldToProjIndexName[] = "m_worldToProj"; + AZ::Data::Instance drawSrg = m_dynamicDraw->NewDrawSrg(); + if (drawSrg) + { + const AZ::RHI::ShaderResourceGroupLayout* layout = drawSrg->GetLayout(); + m_shaderData.m_imageInputIndex = layout->FindShaderInputImageIndex(AZ::Name(textureIndexName)); + AZ_Error("Draw2d", m_shaderData.m_imageInputIndex.IsValid(), "Failed to find shader input constant %s.", + textureIndexName); + m_shaderData.m_viewProjInputIndex = layout->FindShaderInputConstantIndex(AZ::Name(worldToProjIndexName)); + AZ_Error("Draw2d", m_shaderData.m_viewProjInputIndex.IsValid(), "Failed to find shader input constant %s.", + worldToProjIndexName); + } + + // Cache shader variants that will be used + AZ::RPI::ShaderOptionList shaderOptionsClamp; + shaderOptionsClamp.push_back(AZ::RPI::ShaderOption(AZ::Name("o_clamp"), AZ::Name("true"))); + shaderOptionsClamp.push_back(AZ::RPI::ShaderOption(AZ::Name("o_useColorChannels"), AZ::Name("true"))); + m_shaderData.m_shaderOptionsClamp = m_dynamicDraw->UseShaderVariant(shaderOptionsClamp); + AZ::RPI::ShaderOptionList shaderOptionsWrap; + shaderOptionsWrap.push_back(AZ::RPI::ShaderOption(AZ::Name("o_clamp"), AZ::Name("false"))); + shaderOptionsWrap.push_back(AZ::RPI::ShaderOption(AZ::Name("o_useColorChannels"), AZ::Name("true"))); + m_shaderData.m_shaderOptionsWrap = m_dynamicDraw->UseShaderVariant(shaderOptionsWrap); + } } //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/Gems/LyShine/Code/Source/UiRenderer.cpp b/Gems/LyShine/Code/Source/UiRenderer.cpp index acf17049ad..3b835dec92 100644 --- a/Gems/LyShine/Code/Source/UiRenderer.cpp +++ b/Gems/LyShine/Code/Source/UiRenderer.cpp @@ -76,7 +76,7 @@ void UiRenderer::OnBootstrapSceneReady(AZ::RPI::Scene* bootstrapScene) // Create a dynamic draw context for UI Canvas drawing for the scene m_dynamicDraw = CreateDynamicDrawContext(uiShader); - if (m_dynamicDraw) + if (m_dynamicDraw && m_dynamicDraw->IsReady()) { // Cache shader data such as input indices for later use CacheShaderData(m_dynamicDraw); @@ -85,7 +85,7 @@ void UiRenderer::OnBootstrapSceneReady(AZ::RPI::Scene* bootstrapScene) } else { - AZ_Error(LogName, false, "Failed to create a dynamic draw context for LyShine. \ + AZ_Error(LogName, false, "Failed to create or initialize a dynamic draw context for LyShine. \ This can happen if the LyShine pass hasn't been added to the main render pipeline."); } } From 10497fe92c89486dd8ccd0a391aef624ed5abac3 Mon Sep 17 00:00:00 2001 From: Sergey Pereslavtsev Date: Mon, 10 Jan 2022 20:43:33 +0000 Subject: [PATCH 403/948] LYN-9183 Fix Terrain Heightfield Collider component to list physics materials from the library Signed-off-by: Sergey Pereslavtsev --- .../TerrainPhysicsColliderComponent.cpp | 15 +++++++++++++++ .../Components/TerrainPhysicsColliderComponent.h | 1 + 2 files changed, 16 insertions(+) diff --git a/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp b/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp index 8c2c0e80b6..916dd800e2 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp +++ b/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp @@ -17,6 +17,7 @@ #include #include +#include #include namespace Terrain @@ -43,11 +44,25 @@ namespace Terrain AZ::Edit::UIHandlers::ComboBox, &TerrainPhysicsSurfaceMaterialMapping::m_surfaceTag, "Surface Tag", "Surface type to map to a physics material.") ->DataElement(AZ::Edit::UIHandlers::Default, &TerrainPhysicsSurfaceMaterialMapping::m_materialId, "Material ID", "") + ->ElementAttribute(Physics::Attributes::MaterialLibraryAssetId, &TerrainPhysicsSurfaceMaterialMapping::GetMaterialLibraryId) ->Attribute(AZ::Edit::Attributes::AutoExpand, true) ->Attribute(AZ::Edit::Attributes::ShowProductAssetFileName, true); } } } + + AZ::Data::AssetId TerrainPhysicsSurfaceMaterialMapping::GetMaterialLibraryId() + { + if (auto* physicsSystem = AZ::Interface::Get()) + { + if (const auto* physicsConfiguration = physicsSystem->GetConfiguration()) + { + return physicsConfiguration->m_materialLibraryAsset.GetId(); + } + } + return {}; + } + void TerrainPhysicsColliderConfig::Reflect(AZ::ReflectContext* context) { TerrainPhysicsSurfaceMaterialMapping::Reflect(context); diff --git a/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.h b/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.h index 1a7fbf9c72..284bc74d88 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.h +++ b/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.h @@ -33,6 +33,7 @@ namespace Terrain AZ_CLASS_ALLOCATOR(TerrainPhysicsSurfaceMaterialMapping, AZ::SystemAllocator, 0); AZ_RTTI(TerrainPhysicsSurfaceMaterialMapping, "{A88B5289-DFCD-4564-8395-E2177DFE5B18}"); static void Reflect(AZ::ReflectContext* context); + static AZ::Data::AssetId GetMaterialLibraryId(); SurfaceData::SurfaceTag m_surfaceTag; Physics::MaterialId m_materialId; From 18ea4ba6a8c2646b074f236eb03feab3ec037777 Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Mon, 10 Jan 2022 15:21:04 -0600 Subject: [PATCH 404/948] Added a CriticalAssetsCompiled Lifecycle event (#6469) The CriticalAssetsCompiled event can be handled to detect when the AssetProcessor has finished processing Critical Assets Also with the new event, an audit has been performed over all the locations where the AssetCatalogEventBus OnCatalogLoaded event was being handle to make sure it was the proper event to use. If the handler was actually examing the enumerating over the full catalog or querying all assets within the catalog, then it was a proper use. For handlers that were interested in a particular asset it was not Moreover added implementations of `OnCatalogAssetChanged` and `OnCatalogAssetAdded` to the FileTagComponent and the MaterialViewportComponent. Any applications which uses the AtomToolsApplication class(MaterialEditor, AtomSampleViewerStandalone, ShaderMangementConsole) now signals a "CriticalAssetsCompiled" lifecycle event as well as loads the "assetcatalog.xml" if it exists. The Launcher application signals the "CrticalAssetsCompiled" event and reloads the "assetcatalog.xml" for the ${project}.GameLauncher and ${project}.ServerLauncher in Launcher.cpp Finally the Editor signals the "CriticalAssetsCompiled" and reloads the "assetcatalog.xml" in CryEdit.cpp resolves #6093 Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- Code/Editor/CryEdit.cpp | 23 ++++- .../AzFramework/FileTag/FileTagComponent.cpp | 33 +++++-- .../AzFramework/FileTag/FileTagComponent.h | 2 + .../Spawnable/SpawnableSystemComponent.cpp | 38 ++++---- .../Spawnable/SpawnableSystemComponent.h | 10 +- Code/LauncherUnified/Launcher.cpp | 96 ++++++++++++------- .../SerializeContextTools/SliceConverter.cpp | 4 - .../Code/Source/BootstrapSystemComponent.cpp | 2 +- .../Atom/RPI.Public/RPISystemInterface.h | 3 +- .../Application/AtomToolsApplication.cpp | 19 +++- .../Viewport/MaterialViewportComponent.cpp | 53 +++++++++- .../Viewport/MaterialViewportComponent.h | 3 + .../EditorCommonFeaturesSystemComponent.cpp | 20 ++-- .../EditorCommonFeaturesSystemComponent.h | 5 +- .../Editor/MultiplayerEditorConnection.cpp | 2 +- .../NetworkEntity/NetworkSpawnableLibrary.cpp | 18 ++-- .../NetworkEntity/NetworkSpawnableLibrary.h | 6 +- Gems/PhysX/Code/Source/System/PhysXSystem.cpp | 4 +- Registry/application_lifecycle_events.setreg | 3 +- 19 files changed, 232 insertions(+), 112 deletions(-) diff --git a/Code/Editor/CryEdit.cpp b/Code/Editor/CryEdit.cpp index 77099761c1..1c4e22b99e 100644 --- a/Code/Editor/CryEdit.cpp +++ b/Code/Editor/CryEdit.cpp @@ -1352,8 +1352,27 @@ void CCryEditApp::CompileCriticalAssets() const } } assetsInQueueNotifcation.BusDisconnect(); - CCryEditApp::OutputStartupMessage(QString("Asset Processor is now ready.")); + // Signal the "CriticalAssetsCompiled" lifecycle event + // Also reload the "assetcatalog.xml" if it exists + if (auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr) + { + AZ::ComponentApplicationLifecycle::SignalEvent(*settingsRegistry, "CriticalAssetsCompiled", R"({})"); + // Reload the assetcatalog.xml at this point again + // Start Monitoring Asset changes over the network and load the AssetCatalog + auto LoadCatalog = [settingsRegistry](AZ::Data::AssetCatalogRequests* assetCatalogRequests) + { + if (AZ::IO::FixedMaxPath assetCatalogPath; + settingsRegistry->Get(assetCatalogPath.Native(), AZ::SettingsRegistryMergeUtils::FilePathKey_CacheRootFolder)) + { + assetCatalogPath /= "assetcatalog.xml"; + assetCatalogRequests->LoadCatalog(assetCatalogPath.c_str()); + } + }; + AZ::Data::AssetCatalogRequestBus::Broadcast(AZStd::move(LoadCatalog)); + } + + CCryEditApp::OutputStartupMessage(QString("Asset Processor is now ready.")); } bool CCryEditApp::ConnectToAssetProcessor() const @@ -1669,7 +1688,7 @@ bool CCryEditApp::InitInstance() return false; } - if (AZ::SettingsRegistryInterface* settingsRegistry = AZ::SettingsRegistry::Get()) + if (auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr) { AZ::ComponentApplicationLifecycle::SignalEvent(*settingsRegistry, "LegacySystemInterfaceCreated", R"({})"); } diff --git a/Code/Framework/AzFramework/AzFramework/FileTag/FileTagComponent.cpp b/Code/Framework/AzFramework/AzFramework/FileTag/FileTagComponent.cpp index 1d09500415..f4831d1f8b 100644 --- a/Code/Framework/AzFramework/AzFramework/FileTag/FileTagComponent.cpp +++ b/Code/Framework/AzFramework/AzFramework/FileTag/FileTagComponent.cpp @@ -97,19 +97,38 @@ namespace AzFramework AZStd::vector registeredAssetPaths; AZ::Data::AssetCatalogRequestBus::BroadcastResult(registeredAssetPaths, &AZ::Data::AssetCatalogRequests::GetRegisteredAssetPaths); - const char* dependencyXmlPattern = "*_dependencies.xml"; + constexpr const char* dependencyXmlPattern = "_dependencies.xml"; for (const AZStd::string& assetPath : registeredAssetPaths) { - if (!AZStd::wildcard_match(dependencyXmlPattern, assetPath.c_str())) + if (assetPath.ends_with(dependencyXmlPattern)) { - continue; + AZ_VerifyError("ExcludeFileComponent", m_excludeFileQueryManager.get()->LoadEngineDependencies(assetPath), + "Failed to add assets referenced from %s to the blocked list", assetPath.c_str()); } + } + } - if (!m_excludeFileQueryManager.get()->LoadEngineDependencies(assetPath)) - { - AZ_Error("ExcludeFileComponent", false, "Failed to add assets referenced from %s to the blocked list", assetPath.c_str()); - } + void ExcludeFileComponent::OnCatalogAssetChanged(const AZ::Data::AssetId& assetId) + { + // Reload any modified "_dependencies.xml" files + AZ::IO::Path assetPath; + auto GetAssetPath = [&assetId, &assetPath](AZ::Data::AssetCatalogRequests* assetCatalogRequests) + { + assetPath = assetCatalogRequests->GetAssetPathById(assetId); + }; + + AZ::Data::AssetCatalogRequestBus::Broadcast(AZStd::move(GetAssetPath)); + constexpr const char* dependencyXmlPattern = "_dependencies.xml"; + if (assetPath.Native().ends_with(dependencyXmlPattern)) + { + AZ_VerifyError("ExcludeFileComponent", m_excludeFileQueryManager.get()->LoadEngineDependencies(assetPath.Native()), + "Failed to add assets referenced from %s to the blocked list", assetPath.c_str()); } } + + void ExcludeFileComponent::OnCatalogAssetAdded(const AZ::Data::AssetId& assetId) + { + OnCatalogAssetChanged(assetId); + } } } diff --git a/Code/Framework/AzFramework/AzFramework/FileTag/FileTagComponent.h b/Code/Framework/AzFramework/AzFramework/FileTag/FileTagComponent.h index d53e4e7a89..1bd0f46aa0 100644 --- a/Code/Framework/AzFramework/AzFramework/FileTag/FileTagComponent.h +++ b/Code/Framework/AzFramework/AzFramework/FileTag/FileTagComponent.h @@ -65,6 +65,8 @@ namespace AzFramework void Deactivate() override; void OnCatalogLoaded(const char* catalogFile) override; + void OnCatalogAssetChanged(const AZ::Data::AssetId& assetId) override; + void OnCatalogAssetAdded(const AZ::Data::AssetId& assetId) override; static void Reflect(AZ::ReflectContext* context); diff --git a/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableSystemComponent.cpp b/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableSystemComponent.cpp index 6ca2f3a53a..4ba9c45a98 100644 --- a/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableSystemComponent.cpp +++ b/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableSystemComponent.cpp @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -61,15 +62,6 @@ namespace AzFramework m_entitiesManager.ProcessQueue(SpawnableEntitiesManager::CommandQueuePriority::High); } - void SpawnableSystemComponent::OnCatalogLoaded([[maybe_unused]] const char* catalogFile) - { - if (!m_catalogAvailable) - { - m_catalogAvailable = true; - LoadRootSpawnableFromSettingsRegistry(); - } - } - uint64_t SpawnableSystemComponent::AssignRootSpawnable(AZ::Data::Asset rootSpawnable) { uint32_t generation = 0; @@ -157,20 +149,29 @@ namespace AzFramework // Register with AssetDatabase AZ_Assert(AZ::Data::AssetManager::IsReady(), "Spawnables can't be registered because the Asset Manager is not ready yet."); AZ::Data::AssetManager::Instance().RegisterHandler(&m_assetHandler, AZ::AzTypeInfo::Uuid()); - + // Register with AssetCatalog AZ::Data::AssetCatalogRequestBus::Broadcast( &AZ::Data::AssetCatalogRequestBus::Events::EnableCatalogForAsset, AZ::AzTypeInfo::Uuid()); AZ::Data::AssetCatalogRequestBus::Broadcast( &AZ::Data::AssetCatalogRequestBus::Events::AddExtension, Spawnable::FileExtension); - AssetCatalogEventBus::Handler::BusConnect(); + // Register for the CriticalAssetsCompiled lifecycle event to trigger the loading of the root spawnable + auto settingsRegistry = AZ::SettingsRegistry::Get(); + AZ_Assert(settingsRegistry, "Unable to change root spawnable callback because Settings Registry is not available."); + + auto LifecycleCallback = [this](AZStd::string_view, AZ::SettingsRegistryInterface::Type) + { + LoadRootSpawnableFromSettingsRegistry(); + }; + AZ::ComponentApplicationLifecycle::RegisterHandler(*settingsRegistry, m_criticalAssetsHandler, + AZStd::move(LifecycleCallback), "CriticalAssetsCompiled"); + + RootSpawnableNotificationBus::Handler::BusConnect(); AZ::TickBus::Handler::BusConnect(); - auto registry = AZ::SettingsRegistry::Get(); - AZ_Assert(registry, "Unable to change root spawnable callback because Settings Registry is not available."); - m_registryChangeHandler = registry->RegisterNotifier([this](AZStd::string_view path, AZ::SettingsRegistryInterface::Type /*type*/) + m_registryChangeHandler = settingsRegistry->RegisterNotifier([this](AZStd::string_view path, AZ::SettingsRegistryInterface::Type /*type*/) { if (path.starts_with(RootSpawnableRegistryKey)) { @@ -187,13 +188,14 @@ namespace AzFramework AZ::TickBus::Handler::BusDisconnect(); RootSpawnableNotificationBus::Handler::BusDisconnect(); - AssetCatalogEventBus::Handler::BusDisconnect(); + // Unregister Lifecycle event handler + m_criticalAssetsHandler = {}; - if (m_catalogAvailable) + if (m_rootSpawnableId.IsValid()) { ReleaseRootSpawnable(); - // The SpawnalbleSystemComponent needs to guarantee there's no more processing left to do by the + // The SpawnableSystemComponent needs to guarantee there's no more processing left to do by the // entity manager before it can safely destroy it on shutdown, but also to make sure that are no // more calls to the callback registered to the root spawnable as that accesses this component. m_rootSpawnableContainer.Clear(); @@ -210,8 +212,6 @@ namespace AzFramework void SpawnableSystemComponent::LoadRootSpawnableFromSettingsRegistry() { - AZ_Assert(m_catalogAvailable, "Attempting to load root spawnable while the catalog is not available yet."); - auto registry = AZ::SettingsRegistry::Get(); AZ_Assert(registry, "Unable to check for root spawnable because the Settings Registry is not available."); diff --git a/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableSystemComponent.h b/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableSystemComponent.h index ecd2a9b728..712cd1529d 100644 --- a/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableSystemComponent.h +++ b/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableSystemComponent.h @@ -12,7 +12,6 @@ #include #include #include -#include #include #include #include @@ -25,7 +24,6 @@ namespace AzFramework : public AZ::Component , public AZ::TickBus::Handler , public AZ::SystemTickBus::Handler - , public AssetCatalogEventBus::Handler , public RootSpawnableInterface::Registrar , public RootSpawnableNotificationBus::Handler { @@ -63,12 +61,6 @@ namespace AzFramework void OnSystemTick() override; - // - // AssetCatalogEventBus - // - - void OnCatalogLoaded(const char* catalogFile) override; - // // RootSpawnableInterface // @@ -97,6 +89,6 @@ namespace AzFramework AZ::SettingsRegistryInterface::NotifyEventHandler m_registryChangeHandler; AZ::Data::AssetId m_rootSpawnableId; - bool m_catalogAvailable{ false }; + AZ::SettingsRegistryInterface::NotifyEventHandler m_criticalAssetsHandler; }; } // namespace AzFramework diff --git a/Code/LauncherUnified/Launcher.cpp b/Code/LauncherUnified/Launcher.cpp index ed01a67f39..9dfd6213c4 100644 --- a/Code/LauncherUnified/Launcher.cpp +++ b/Code/LauncherUnified/Launcher.cpp @@ -229,33 +229,65 @@ namespace O3DELauncher void CreateRemoteFileIO(); - bool ConnectToAssetProcessor() + // This function make sure the launcher has signaled the "CriticalAssetsCompiled" + // lifecycle event as well as to load the "assetcatalog.xml" file if it exists + void CompileCriticalAssets() { - bool connectedToAssetProcessor{}; - // When the AssetProcessor is already launched it should take less than a second to perform a connection - // but when the AssetProcessor needs to be launch it could take up to 15 seconds to have the AssetProcessor initialize - // and able to negotiate a connection when running a debug build - // and to negotiate a connection - // Setting the connectTimeout to 3 seconds if not set within the settings registry - - AzFramework::AssetSystem::ConnectionSettings connectionSettings; - AzFramework::AssetSystem::ReadConnectionSettingsFromSettingsRegistry(connectionSettings); - - connectionSettings.m_launchAssetProcessorOnFailedConnection = true; - connectionSettings.m_connectionIdentifier = AzFramework::AssetSystem::ConnectionIdentifiers::Game; - connectionSettings.m_loggingCallback = []([[maybe_unused]] AZStd::string_view logData) + if (auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr) { - AZ_TracePrintf("Launcher", "%.*s", aznumeric_cast(logData.size()), logData.data()); - }; - - AzFramework::AssetSystemRequestBus::BroadcastResult(connectedToAssetProcessor, &AzFramework::AssetSystemRequestBus::Events::EstablishAssetProcessorConnection, connectionSettings); + AZ::ComponentApplicationLifecycle::SignalEvent(*settingsRegistry, "CriticalAssetsCompiled", R"({})"); + // Reload the assetcatalog.xml at this point again + // Start Monitoring Asset changes over the network and load the AssetCatalog + auto LoadCatalog = [settingsRegistry](AZ::Data::AssetCatalogRequests* assetCatalogRequests) + { + if (AZ::IO::FixedMaxPath assetCatalogPath; + settingsRegistry->Get(assetCatalogPath.Native(), AZ::SettingsRegistryMergeUtils::FilePathKey_CacheRootFolder)) + { + assetCatalogPath /= "assetcatalog.xml"; + assetCatalogRequests->LoadCatalog(assetCatalogPath.c_str()); + } + }; + AZ::Data::AssetCatalogRequestBus::Broadcast(AZStd::move(LoadCatalog)); + } + } - if (connectedToAssetProcessor) + // If the connect option is false, this function will return true + // to make sure the Launcher passes the connected to AP check + // If REMOTE_ASSET_PROCESSOR is not defined, then the launcher doesn't need + // to connect to the AssetProcessor and therefore this function returns true + bool ConnectToAssetProcessor([[maybe_unused]] bool connect) + { + bool connectedToAssetProcessor = true; +#if defined(REMOTE_ASSET_PROCESSOR) + if (connect) { - AZ_TracePrintf("Launcher", "Connected to Asset Processor\n"); - CreateRemoteFileIO(); + // When the AssetProcessor is already launched it should take less than a second to perform a connection + // but when the AssetProcessor needs to be launch it could take up to 15 seconds to have the AssetProcessor initialize + // and able to negotiate a connection when running a debug build + // and to negotiate a connection + // Setting the connectTimeout to 3 seconds if not set within the settings registry + + AzFramework::AssetSystem::ConnectionSettings connectionSettings; + AzFramework::AssetSystem::ReadConnectionSettingsFromSettingsRegistry(connectionSettings); + + connectionSettings.m_launchAssetProcessorOnFailedConnection = true; + connectionSettings.m_connectionIdentifier = AzFramework::AssetSystem::ConnectionIdentifiers::Game; + connectionSettings.m_loggingCallback = []([[maybe_unused]] AZStd::string_view logData) + { + AZ_TracePrintf("Launcher", "%.*s", aznumeric_cast(logData.size()), logData.data()); + }; + + AzFramework::AssetSystemRequestBus::BroadcastResult(connectedToAssetProcessor, &AzFramework::AssetSystemRequestBus::Events::EstablishAssetProcessorConnection, connectionSettings); + + if (connectedToAssetProcessor) + { + AZ_TracePrintf("Launcher", "Connected to Asset Processor\n"); + CreateRemoteFileIO(); + } } +#endif + CompileCriticalAssets(); return connectedToAssetProcessor; } @@ -403,25 +435,21 @@ namespace O3DELauncher gameApplication.Start({}, gameApplicationStartupParams); -#if defined(REMOTE_ASSET_PROCESSOR) - bool allowedEngineConnection = !systemInitParams.bToolMode && !systemInitParams.bTestMode && bg_ConnectToAssetProcessor; //connect to the asset processor using the bootstrap values - if (allowedEngineConnection) + const bool allowedEngineConnection = !systemInitParams.bToolMode && !systemInitParams.bTestMode && bg_ConnectToAssetProcessor; + if (!ConnectToAssetProcessor(allowedEngineConnection)) { - if (!ConnectToAssetProcessor()) + AZ::s64 waitForConnect{}; + AZ::SettingsRegistryMergeUtils::PlatformGet(*settingsRegistry, waitForConnect, + AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey, "wait_for_connect"); + if (waitForConnect != 0) { - AZ::s64 waitForConnect{}; - AZ::SettingsRegistryMergeUtils::PlatformGet(*settingsRegistry, waitForConnect, - AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey, "wait_for_connect"); - if (waitForConnect != 0) - { - AZ_Error("Launcher", false, "Failed to connect to AssetProcessor."); - return ReturnCode::ErrAssetProccessor; - } + AZ_Error("Launcher", false, "Failed to connect to AssetProcessor."); + return ReturnCode::ErrAssetProccessor; } } -#endif + AZ_Assert(AZ::AllocatorInstance::IsReady(), "System allocator was not created or creation failed."); //Initialize the Debug trace instance to create necessary environment variables AZ::Debug::Trace::Instance().Init(); diff --git a/Code/Tools/SerializeContextTools/SliceConverter.cpp b/Code/Tools/SerializeContextTools/SliceConverter.cpp index d0528a9cad..cfb1998f48 100644 --- a/Code/Tools/SerializeContextTools/SliceConverter.cpp +++ b/Code/Tools/SerializeContextTools/SliceConverter.cpp @@ -79,10 +79,6 @@ namespace AZ return false; } - // Load the asset catalog so that we can find any nested assets successfully. We also need to tick the tick bus - // so that the OnCatalogLoaded event gets processed now, instead of during application shutdown. - application.Tick(); - AZStd::string logggingScratchBuffer; SetupLogging(logggingScratchBuffer, convertSettings.m_reporting, *commandLine); diff --git a/Gems/Atom/Bootstrap/Code/Source/BootstrapSystemComponent.cpp b/Gems/Atom/Bootstrap/Code/Source/BootstrapSystemComponent.cpp index 84fc58718c..ef03a839d7 100644 --- a/Gems/Atom/Bootstrap/Code/Source/BootstrapSystemComponent.cpp +++ b/Gems/Atom/Bootstrap/Code/Source/BootstrapSystemComponent.cpp @@ -155,7 +155,7 @@ namespace AZ { Initialize(); }, - "LegacySystemInterfaceCreated"); + "CriticalAssetsCompiled"); } } diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/RPISystemInterface.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/RPISystemInterface.h index 3f30d498cf..693185b6d2 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/RPISystemInterface.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/RPISystemInterface.h @@ -34,8 +34,7 @@ namespace AZ RPISystemInterface() = default; virtual ~RPISystemInterface() = default; - //! Pre-load some system assets. This should be called once the asset catalog is ready and before create any RPI instances. - //! Note: can't rely on the AzFramework::AssetCatalogEventBus's OnCatalogLoaded since the order of calling handlers is undefined. + //! Pre-load some system assets. This should be called once Critical Asset have compiled ready and before create any RPI instances. virtual void InitializeSystemAssets() = 0; //! Was the RPI system initialized properly diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Application/AtomToolsApplication.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Application/AtomToolsApplication.cpp index ec365d7a6a..02248fffd4 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Application/AtomToolsApplication.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Application/AtomToolsApplication.cpp @@ -12,6 +12,7 @@ #include #include +#include #include #include #include @@ -295,10 +296,24 @@ namespace AtomToolsFramework QMessageBox::critical( activeWindow(), QString("Failed to compile critical assets"), QString("Failed to compile the following critical assets:\n%1\n%2") - .arg(failedAssets.join(",\n")) - .arg("Make sure this is an Atom project.")); + .arg(failedAssets.join(",\n")) + .arg("Make sure this is an Atom project.")); ExitMainLoop(); } + + AZ::ComponentApplicationLifecycle::SignalEvent(*m_settingsRegistry, "CriticalAssetsCompiled", R"({})"); + // Reload the assetcatalog.xml at this point again + // Start Monitoring Asset changes over the network and load the AssetCatalog + auto LoadCatalog = [settingsRegistry = m_settingsRegistry.get()](AZ::Data::AssetCatalogRequests* assetCatalogRequests) + { + if (AZ::IO::FixedMaxPath assetCatalogPath; + settingsRegistry->Get(assetCatalogPath.Native(), AZ::SettingsRegistryMergeUtils::FilePathKey_CacheRootFolder)) + { + assetCatalogPath /= "assetcatalog.xml"; + assetCatalogRequests->LoadCatalog(assetCatalogPath.c_str()); + } + }; + AZ::Data::AssetCatalogRequestBus::Broadcast(AZStd::move(LoadCatalog)); } void AtomToolsApplication::SaveSettings() diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportComponent.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportComponent.cpp index 35f5067cd0..9cf714b40e 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportComponent.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportComponent.cpp @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include @@ -165,12 +165,12 @@ namespace MaterialEditor // AssetCatalogRequestBus::EnumerateAssets can lead to deadlocked) AZ::Data::AssetCatalogRequests::AssetEnumerationCB enumerateCB = [this]([[maybe_unused]] const AZ::Data::AssetId id, const AZ::Data::AssetInfo& info) { - if (AzFramework::StringFunc::EndsWith(info.m_relativePath.c_str(), ".lightingpreset.azasset")) + if (AZ::StringFunc::EndsWith(info.m_relativePath.c_str(), ".lightingpreset.azasset")) { m_lightingPresetAssets[info.m_assetId] = { info.m_assetId, info.m_assetType }; AZ::Data::AssetBus::MultiHandler::BusConnect(info.m_assetId); } - else if (AzFramework::StringFunc::EndsWith(info.m_relativePath.c_str(), ".modelpreset.azasset")) + else if (AZ::StringFunc::EndsWith(info.m_relativePath.c_str(), ".modelpreset.azasset")) { m_modelPresetAssets[info.m_assetId] = { info.m_assetId, info.m_assetType }; AZ::Data::AssetBus::MultiHandler::BusConnect(info.m_assetId); @@ -429,4 +429,51 @@ namespace MaterialEditor ReloadContent(); }); } + + void MaterialViewportComponent::OnCatalogAssetChanged(const AZ::Data::AssetId& assetId) + { + auto ReloadLightingAndModelPresets = [this, &assetId](AZ::Data::AssetCatalogRequests* assetCatalogRequests) + { + AZ::Data::AssetInfo assetInfo = assetCatalogRequests->GetAssetInfoById(assetId); + AZ::Data::Asset* modifiedPresetAsset{}; + if (AZ::StringFunc::EndsWith(assetInfo.m_relativePath.c_str(), ".lightingpreset.azasset")) + { + m_lightingPresetAssets[assetInfo.m_assetId] = { assetInfo.m_assetId, assetInfo.m_assetType }; + AZ::Data::AssetBus::MultiHandler::BusConnect(assetInfo.m_assetId); + modifiedPresetAsset = &m_lightingPresetAssets[assetInfo.m_assetId]; + } + else if (AzFramework::StringFunc::EndsWith(assetInfo.m_relativePath.c_str(), ".modelpreset.azasset")) + { + m_modelPresetAssets[assetInfo.m_assetId] = { assetInfo.m_assetId, assetInfo.m_assetType }; + AZ::Data::AssetBus::MultiHandler::BusConnect(assetInfo.m_assetId); + modifiedPresetAsset = &m_modelPresetAssets[assetInfo.m_assetId]; + } + + // Queue a load on the changed asset + if (modifiedPresetAsset != nullptr) + { + modifiedPresetAsset->QueueLoad(); + } + }; + AZ::Data::AssetCatalogRequestBus::Broadcast(AZStd::move(ReloadLightingAndModelPresets)); + } + + void MaterialViewportComponent::OnCatalogAssetAdded(const AZ::Data::AssetId& assetId) + { + OnCatalogAssetChanged(assetId); + } + + void MaterialViewportComponent::OnCatalogAssetRemoved(const AZ::Data::AssetId& assetId, const AZ::Data::AssetInfo& assetInfo) + { + if (AZ::StringFunc::EndsWith(assetInfo.m_relativePath.c_str(), ".lightingpreset.azasset")) + { + AZ::Data::AssetBus::MultiHandler::BusDisconnect(assetInfo.m_assetId); + m_lightingPresetAssets.erase(assetId); + } + if (AZ::StringFunc::EndsWith(assetInfo.m_relativePath.c_str(), ".modelpreset.azasset")) + { + AZ::Data::AssetBus::MultiHandler::BusDisconnect(assetInfo.m_assetId); + m_modelPresetAssets.erase(assetId); + } + } } diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportComponent.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportComponent.h index 07385d842d..68668bd804 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportComponent.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportComponent.h @@ -95,6 +95,9 @@ namespace MaterialEditor //////////////////////////////////////////////////////////////////////// // AzFramework::AssetCatalogEventBus::Handler overrides ... void OnCatalogLoaded(const char* catalogFile) override; + void OnCatalogAssetChanged(const AZ::Data::AssetId& assetId) override; + void OnCatalogAssetAdded(const AZ::Data::AssetId& assetId) override; + void OnCatalogAssetRemoved(const AZ::Data::AssetId& assetId, const AZ::Data::AssetInfo& assetInfo) override; //////////////////////////////////////////////////////////////////////// AZStd::unordered_map> m_lightingPresetAssets; diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/EditorCommonFeaturesSystemComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/EditorCommonFeaturesSystemComponent.cpp index 2bf428bd2d..0250640d65 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/EditorCommonFeaturesSystemComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/EditorCommonFeaturesSystemComponent.cpp @@ -6,6 +6,7 @@ * */ +#include #include #include #include @@ -88,14 +89,22 @@ namespace AZ AzToolsFramework::EditorLevelNotificationBus::Handler::BusConnect(); AzToolsFramework::AssetBrowser::PreviewerRequestBus::Handler::BusConnect(); - AzFramework::AssetCatalogEventBus::Handler::BusConnect(); + if (auto settingsRegistry{ AZ::SettingsRegistry::Get() }; settingsRegistry != nullptr) + { + auto LifecycleCallback = [this](AZStd::string_view, AZ::SettingsRegistryInterface::Type) + { + SetupThumbnails(); + }; + AZ::ComponentApplicationLifecycle::RegisterHandler(*settingsRegistry, m_criticalAssetsHandler, + AZStd::move(LifecycleCallback), "CriticalAssetsCompiled"); + } AzFramework::ApplicationLifecycleEvents::Bus::Handler::BusConnect(); } void EditorCommonFeaturesSystemComponent::Deactivate() { AzFramework::ApplicationLifecycleEvents::Bus::Handler::BusDisconnect(); - AzFramework::AssetCatalogEventBus::Handler::BusDisconnect(); + m_criticalAssetsHandler = {}; AzToolsFramework::EditorLevelNotificationBus::Handler::BusDisconnect(); AzToolsFramework::AssetBrowser::PreviewerRequestBus::Handler::BusDisconnect(); @@ -192,13 +201,6 @@ namespace AZ } } - void EditorCommonFeaturesSystemComponent::OnCatalogLoaded([[maybe_unused]] const char* catalogFile) - { - AZ::TickBus::QueueFunction([this](){ - SetupThumbnails(); - }); - } - const AzToolsFramework::AssetBrowser::PreviewerFactory* EditorCommonFeaturesSystemComponent::GetPreviewerFactory( const AzToolsFramework::AssetBrowser::AssetBrowserEntry* entry) const { diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/EditorCommonFeaturesSystemComponent.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/EditorCommonFeaturesSystemComponent.h index 82bb93a808..dff9e68814 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/EditorCommonFeaturesSystemComponent.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/EditorCommonFeaturesSystemComponent.h @@ -28,7 +28,6 @@ namespace AZ , public AzToolsFramework::EditorLevelNotificationBus::Handler , public AzToolsFramework::SliceEditorEntityOwnershipServiceNotificationBus::Handler , public AzToolsFramework::AssetBrowser::PreviewerRequestBus::Handler - , public AzFramework::AssetCatalogEventBus::Handler , public AzFramework::ApplicationLifecycleEvents::Bus::Handler { public: @@ -58,9 +57,6 @@ namespace AZ const AZ::Data::AssetId&, AZ::SliceComponent::SliceInstanceAddress&, const AzFramework::SliceInstantiationTicket&) override; void OnSliceInstantiationFailed(const AZ::Data::AssetId&, const AzFramework::SliceInstantiationTicket&) override; - // AzFramework::AssetCatalogEventBus::Handler overrides ... - void OnCatalogLoaded(const char* catalogFile) override; - // AzToolsFramework::AssetBrowser::PreviewerRequestBus::Handler overrides... const AzToolsFramework::AssetBrowser::PreviewerFactory* GetPreviewerFactory( const AzToolsFramework::AssetBrowser::AssetBrowserEntry* entry) const override; @@ -80,6 +76,7 @@ namespace AZ AZStd::unique_ptr m_thumbnailRenderer; AZStd::unique_ptr m_previewerFactory; + AZ::SettingsRegistryInterface::NotifyEventHandler m_criticalAssetsHandler; }; } // namespace Render } // namespace AZ diff --git a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp index f112098eae..c8c1ed15bd 100644 --- a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp +++ b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp @@ -58,7 +58,7 @@ namespace Multiplayer { ActivateDedicatedEditorServer(); }, - "LegacySystemInterfaceCreated"); + "CriticalAssetsCompiled"); } } } diff --git a/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.cpp b/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.cpp index ba8836b6e6..f60778dbb4 100644 --- a/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.cpp +++ b/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.cpp @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -17,12 +18,20 @@ namespace Multiplayer NetworkSpawnableLibrary::NetworkSpawnableLibrary() { AZ::Interface::Register(this); - AzFramework::AssetCatalogEventBus::Handler::BusConnect(); + if (auto settingsRegistry{ AZ::SettingsRegistry::Get() }; settingsRegistry != nullptr) + { + auto LifecycleCallback = [this](AZStd::string_view, AZ::SettingsRegistryInterface::Type) + { + BuildSpawnablesList(); + }; + AZ::ComponentApplicationLifecycle::RegisterHandler(*settingsRegistry, m_criticalAssetsHandler, + AZStd::move(LifecycleCallback), "CriticalAssetsCompiled"); + } } NetworkSpawnableLibrary::~NetworkSpawnableLibrary() { - AzFramework::AssetCatalogEventBus::Handler::BusDisconnect(); + m_criticalAssetsHandler = {}; AZ::Interface::Unregister(this); } @@ -50,11 +59,6 @@ namespace Multiplayer m_spawnablesReverseLookup[id] = name; } - void NetworkSpawnableLibrary::OnCatalogLoaded([[maybe_unused]] const char* catalogFile) - { - BuildSpawnablesList(); - } - AZ::Name NetworkSpawnableLibrary::GetSpawnableNameFromAssetId(AZ::Data::AssetId assetId) { if (assetId.IsValid()) diff --git a/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.h b/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.h index 1cec63f81d..0fc3ae07cc 100644 --- a/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.h +++ b/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.h @@ -9,14 +9,13 @@ #pragma once #include -#include +#include namespace Multiplayer { /// Implementation of the network prefab library interface. class NetworkSpawnableLibrary final : public INetworkSpawnableLibrary - , private AzFramework::AssetCatalogEventBus::Handler { public: AZ_RTTI(NetworkSpawnableLibrary, "{65E15F33-E893-49C2-A8E2-B6A8A6EF31E0}", INetworkSpawnableLibrary); @@ -30,11 +29,10 @@ namespace Multiplayer AZ::Name GetSpawnableNameFromAssetId(AZ::Data::AssetId assetId) override; AZ::Data::AssetId GetAssetIdByName(AZ::Name name) override; - /// AssetCatalogEventBus overrides. - void OnCatalogLoaded(const char* catalogFile) override; private: AZStd::unordered_map m_spawnables; AZStd::unordered_map m_spawnablesReverseLookup; + AZ::SettingsRegistryInterface::NotifyEventHandler m_criticalAssetsHandler; }; } diff --git a/Gems/PhysX/Code/Source/System/PhysXSystem.cpp b/Gems/PhysX/Code/Source/System/PhysXSystem.cpp index 168adc8910..39c0dfc686 100644 --- a/Gems/PhysX/Code/Source/System/PhysXSystem.cpp +++ b/Gems/PhysX/Code/Source/System/PhysXSystem.cpp @@ -103,15 +103,13 @@ namespace PhysX if (auto* settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr) { - // Automatically register the event if it's not registered, because - // this system is initialized before the settings registry has loaded the event list. AZ::ComponentApplicationLifecycle::RegisterHandler( *settingsRegistry, m_componentApplicationLifecycleHandler, [this]([[maybe_unused]] AZStd::string_view path, [[maybe_unused]] AZ::SettingsRegistryInterface::Type type) { InitializeMaterialLibrary(); }, - "LegacySystemInterfaceCreated"); // LegacySystemInterfaceCreated is signaled after critical assets have been processed + "CriticalAssetsCompiled"); } m_state = State::Initialized; diff --git a/Registry/application_lifecycle_events.setreg b/Registry/application_lifecycle_events.setreg index 0d9cd0f170..c52c93c0c0 100644 --- a/Registry/application_lifecycle_events.setreg +++ b/Registry/application_lifecycle_events.setreg @@ -23,7 +23,8 @@ "GemsUnloaded": {}, "FileIOAvailable": {}, "FileIOUnavailable": {}, - "LegacySystemInterfaceCreated": {} + "LegacySystemInterfaceCreated": {}, + "CriticalAssetsCompiled": {} } } } From 3cac520280a586e38292f6906947b143ac9147e7 Mon Sep 17 00:00:00 2001 From: nemerle <96597+nemerle@users.noreply.github.com> Date: Tue, 11 Jan 2022 00:47:00 +0100 Subject: [PATCH 405/948] Fix non-unity windows build Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> --- Code/Framework/AzCore/Tests/TestCatalog.h | 1 + Gems/Blast/Code/Include/Blast/BlastSystemBus.h | 1 + Gems/Blast/Code/Source/Family/BlastFamilyImpl.cpp | 1 + .../Code/Source/Components/TerrainPhysicsColliderComponent.cpp | 2 ++ 4 files changed, 5 insertions(+) diff --git a/Code/Framework/AzCore/Tests/TestCatalog.h b/Code/Framework/AzCore/Tests/TestCatalog.h index 9a1fb9b5e6..bbcd952f78 100644 --- a/Code/Framework/AzCore/Tests/TestCatalog.h +++ b/Code/Framework/AzCore/Tests/TestCatalog.h @@ -11,6 +11,7 @@ #include #include #include +#include namespace UnitTest { diff --git a/Gems/Blast/Code/Include/Blast/BlastSystemBus.h b/Gems/Blast/Code/Include/Blast/BlastSystemBus.h index 95ffd75057..bda684181a 100644 --- a/Gems/Blast/Code/Include/Blast/BlastSystemBus.h +++ b/Gems/Blast/Code/Include/Blast/BlastSystemBus.h @@ -8,6 +8,7 @@ #pragma once #include +#include #include #include diff --git a/Gems/Blast/Code/Source/Family/BlastFamilyImpl.cpp b/Gems/Blast/Code/Source/Family/BlastFamilyImpl.cpp index 56c785b310..70e7c28bac 100644 --- a/Gems/Blast/Code/Source/Family/BlastFamilyImpl.cpp +++ b/Gems/Blast/Code/Source/Family/BlastFamilyImpl.cpp @@ -10,6 +10,7 @@ #include #include +#include #include #include #include diff --git a/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp b/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp index 8c2c0e80b6..fccbedd8fa 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp +++ b/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp @@ -6,12 +6,14 @@ * */ + #include #include #include #include #include +#include #include #include #include From 7b6ce50fe87c8306bc6b3ab1b65e4ddbdaf463be Mon Sep 17 00:00:00 2001 From: nemerle <96597+nemerle@users.noreply.github.com> Date: Tue, 11 Jan 2022 00:52:21 +0100 Subject: [PATCH 406/948] Remove un-needed `Requests` namespace use Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> --- Code/Framework/AzCore/AzCore/IO/Streamer/FileRequest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/FileRequest.cpp b/Code/Framework/AzCore/AzCore/IO/Streamer/FileRequest.cpp index 90014578ea..13c01b2efc 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/FileRequest.cpp +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/FileRequest.cpp @@ -139,7 +139,7 @@ namespace AZ::IO::Requests { } - Requests::ReportData::ReportData(ReportType reportType) + ReportData::ReportData(ReportType reportType) : m_reportType(reportType) { } From bcc83aaaf2473ff1ee8fd9f9629e830df48ae222 Mon Sep 17 00:00:00 2001 From: evanchia Date: Mon, 10 Jan 2022 16:04:21 -0800 Subject: [PATCH 407/948] Found actual issue where the logs were being routed to the artifact folder Signed-off-by: evanchia --- .../LyTestTools/ly_test_tools/o3de/editor_test.py | 13 +++++++++++-- .../ly_test_tools/o3de/editor_test_utils.py | 14 ++++---------- .../tests/unit/test_editor_test_utils.py | 7 +++++-- .../tests/unit/test_o3de_editor_test.py | 13 +++++++++++++ 4 files changed, 33 insertions(+), 14 deletions(-) diff --git a/Tools/LyTestTools/ly_test_tools/o3de/editor_test.py b/Tools/LyTestTools/ly_test_tools/o3de/editor_test.py index fd2157d1cc..c97298573e 100644 --- a/Tools/LyTestTools/ly_test_tools/o3de/editor_test.py +++ b/Tools/LyTestTools/ly_test_tools/o3de/editor_test.py @@ -771,7 +771,8 @@ class EditorTestSuite(): output = editor.get_output() return_code = editor.get_returncode() editor_log_content = editor_utils.retrieve_editor_log_content(run_id, log_name, workspace) - + # Save the editor log + workspace.artifact_manager.save_artifact(os.path.join(editor_utils.retrieve_log_path(), log_name)) if return_code == 0: test_result = Result.Pass.create(test_spec, output, editor_log_content) else: @@ -779,6 +780,9 @@ class EditorTestSuite(): if has_crashed: test_result = Result.Crash.create(test_spec, output, return_code, editor_utils.retrieve_crash_output (run_id, workspace, self._TIMEOUT_CRASH_LOG), None) + # Save the crash log + crash_file_name = os.path.basename(workspace.paths.crash_log()) + workspace.artifact_manager.save_artifact(os.path.join(editor_utils.retrieve_log_path(), crash_file_name)) editor_utils.cycle_crash_report(run_id, workspace) else: test_result = Result.Fail.create(test_spec, output, editor_log_content) @@ -842,7 +846,8 @@ class EditorTestSuite(): output = editor.get_output() return_code = editor.get_returncode() editor_log_content = editor_utils.retrieve_editor_log_content(run_id, log_name, workspace) - + # Save the editor log + workspace.artifact_manager.save_artifact(os.path.join(editor_utils.retrieve_log_path(), log_name)) if return_code == 0: # No need to scrap the output, as all the tests have passed for test_spec in test_spec_list: @@ -863,6 +868,10 @@ class EditorTestSuite(): # The first test with "Unknown" result (no data in output) is likely the one that crashed crash_error = editor_utils.retrieve_crash_output(run_id, workspace, self._TIMEOUT_CRASH_LOG) + # Save the crash log + crash_file_name = os.path.basename(workspace.paths.crash_log()) + workspace.artifact_manager.save_artifact( + os.path.join(editor_utils.retrieve_log_path(), crash_file_name)) editor_utils.cycle_crash_report(run_id, workspace) results[test_spec_name] = Result.Crash.create(result.test_spec, output, return_code, crash_error, result.editor_log) diff --git a/Tools/LyTestTools/ly_test_tools/o3de/editor_test_utils.py b/Tools/LyTestTools/ly_test_tools/o3de/editor_test_utils.py index 69c6eda2ee..246fba16aa 100644 --- a/Tools/LyTestTools/ly_test_tools/o3de/editor_test_utils.py +++ b/Tools/LyTestTools/ly_test_tools/o3de/editor_test_utils.py @@ -71,15 +71,9 @@ def retrieve_crash_output(run_id: int, workspace: AbstractWorkspaceManager, time :return str: The contents of the editor crash file (error.log) """ crash_info = "-- No crash log available --" - error_log_regex = "" - log_path = retrieve_log_path(run_id, workspace) - # Gather all of the files in the log directory - dir_files = [f for f in os.listdir(log_path) if os.path.isfile(os.path.join(log_path, f))] - for file_name in dir_files: - # Search for all .log files with either "crash" or "error" because they could be renamed - if ("error" in file_name.lower() or "crash" in file_name.lower()) and (file_name.endswith(".log")): - crash_log = os.path.join(log_path, file_name) - break + # Grab the file name of the crash log which can be different depending on platform + crash_file_name = os.path.basename(workspace.paths.crash_log()) + crash_log = os.path.join(retrieve_log_path(run_id, workspace), crash_file_name) try: waiter.wait_for(lambda: os.path.exists(crash_log), timeout=timeout) except AssertionError: @@ -100,7 +94,7 @@ def cycle_crash_report(run_id: int, workspace: AbstractWorkspaceManager) -> None :param workspace: Workspace fixture """ log_path = retrieve_log_path(run_id, workspace) - files_to_cycle = ['error.log', 'error.dmp'] + files_to_cycle = ['crash.log', 'error.log', 'error.dmp'] for filename in files_to_cycle: filepath = os.path.join(log_path, filename) name, ext = os.path.splitext(filename) diff --git a/Tools/LyTestTools/tests/unit/test_editor_test_utils.py b/Tools/LyTestTools/tests/unit/test_editor_test_utils.py index f7678c44c0..6e2ec59721 100644 --- a/Tools/LyTestTools/tests/unit/test_editor_test_utils.py +++ b/Tools/LyTestTools/tests/unit/test_editor_test_utils.py @@ -61,6 +61,8 @@ class TestEditorTestUtils(unittest.TestCase): @mock.patch('os.listdir') @mock.patch('ly_test_tools.o3de.editor_test_utils.retrieve_log_path') + @mock.patch('os.path.join', mock.MagicMock()) + @mock.patch('os.path.basename', mock.MagicMock()) @mock.patch('os.path.isfile', mock.MagicMock()) @mock.patch('ly_test_tools.environment.waiter.wait_for', mock.MagicMock()) def test_RetrieveCrashOutput_CrashLogExists_ReturnsLogInfo(self, mock_retrieve_log_path, mock_listdir): @@ -79,6 +81,7 @@ class TestEditorTestUtils(unittest.TestCase): def test_RetrieveCrashOutput_CrashLogNotExists_ReturnsError(self, mock_retrieve_log_path, mock_listdir): mock_retrieve_log_path.return_value = 'mock_log_path' mock_workspace = mock.MagicMock() + mock_workspace.paths.crash_log.return_value = 'mock_file.log' error_message = "No crash log available" mock_listdir.return_value = ['mock_file.log'] @@ -91,7 +94,7 @@ class TestEditorTestUtils(unittest.TestCase): @mock.patch('os.path.exists') def test_CycleCrashReport_DmpExists_NamedCorrectly(self, mock_exists, mock_retrieve_log_path, mock_strftime, mock_rename): - mock_exists.side_effect = [False, True] + mock_exists.side_effect = [False, False, True] mock_retrieve_log_path.return_value = 'mock_log_path' mock_workspace = mock.MagicMock() mock_strftime.return_value = 'mock_strftime' @@ -107,7 +110,7 @@ class TestEditorTestUtils(unittest.TestCase): @mock.patch('os.path.exists') def test_CycleCrashReport_LogExists_NamedCorrectly(self, mock_exists, mock_retrieve_log_path, mock_strftime, mock_rename): - mock_exists.side_effect = [True, False] + mock_exists.side_effect = [False, True, False] mock_retrieve_log_path.return_value = 'mock_log_path' mock_workspace = mock.MagicMock() mock_strftime.return_value = 'mock_strftime' diff --git a/Tools/LyTestTools/tests/unit/test_o3de_editor_test.py b/Tools/LyTestTools/tests/unit/test_o3de_editor_test.py index 2b6ae5b471..054159cd16 100644 --- a/Tools/LyTestTools/tests/unit/test_o3de_editor_test.py +++ b/Tools/LyTestTools/tests/unit/test_o3de_editor_test.py @@ -589,6 +589,7 @@ class TestRunningTests(unittest.TestCase): @mock.patch('ly_test_tools.o3de.editor_test_utils.retrieve_log_path') @mock.patch('ly_test_tools.o3de.editor_test_utils.get_testcase_module_filepath') @mock.patch('ly_test_tools.o3de.editor_test_utils.cycle_crash_report') + @mock.patch('os.path.join', mock.MagicMock()) def test_ExecEditorTest_TestSucceeds_ReturnsPass(self, mock_cycle_crash, mock_get_testcase_filepath, mock_retrieve_log, mock_retrieve_editor_log, mock_get_output_results, mock_create): @@ -616,6 +617,7 @@ class TestRunningTests(unittest.TestCase): @mock.patch('ly_test_tools.o3de.editor_test_utils.retrieve_log_path') @mock.patch('ly_test_tools.o3de.editor_test_utils.get_testcase_module_filepath') @mock.patch('ly_test_tools.o3de.editor_test_utils.cycle_crash_report') + @mock.patch('os.path.join', mock.MagicMock()) def test_ExecEditorTest_TestFails_ReturnsFail(self, mock_cycle_crash, mock_get_testcase_filepath, mock_retrieve_log, mock_retrieve_editor_log, mock_get_output_results, mock_create): @@ -644,6 +646,8 @@ class TestRunningTests(unittest.TestCase): @mock.patch('ly_test_tools.o3de.editor_test_utils.retrieve_log_path') @mock.patch('ly_test_tools.o3de.editor_test_utils.get_testcase_module_filepath') @mock.patch('ly_test_tools.o3de.editor_test_utils.cycle_crash_report') + @mock.patch('os.path.join', mock.MagicMock()) + @mock.patch('os.path.basename', mock.MagicMock()) def test_ExecEditorTest_TestCrashes_ReturnsCrash(self, mock_cycle_crash, mock_get_testcase_filepath, mock_retrieve_log, mock_retrieve_editor_log, mock_get_output_results, mock_retrieve_crash, mock_create): @@ -699,10 +703,14 @@ class TestRunningTests(unittest.TestCase): @mock.patch('ly_test_tools.o3de.editor_test_utils.retrieve_log_path') @mock.patch('ly_test_tools.o3de.editor_test_utils.get_testcase_module_filepath') @mock.patch('ly_test_tools.o3de.editor_test_utils.cycle_crash_report') + @mock.patch('os.path.join', mock.MagicMock()) def test_ExecEditorMultitest_AllTestsPass_ReturnsPasses(self, mock_cycle_crash, mock_get_testcase_filepath, mock_retrieve_log, mock_retrieve_editor_log, mock_create): mock_test_suite = ly_test_tools.o3de.editor_test.EditorTestSuite() mock_workspace = mock.MagicMock() + mock_artifact_manager = mock.MagicMock() + mock_artifact_manager.save_artifact.return_value = mock.MagicMock() + mock_workspace.artifact_manager = mock_artifact_manager mock_workspace.paths.engine_root.return_value = "" mock_editor = mock.MagicMock() mock_editor.get_returncode.return_value = 0 @@ -727,6 +735,7 @@ class TestRunningTests(unittest.TestCase): @mock.patch('ly_test_tools.o3de.editor_test_utils.retrieve_log_path') @mock.patch('ly_test_tools.o3de.editor_test_utils.get_testcase_module_filepath') @mock.patch('ly_test_tools.o3de.editor_test_utils.cycle_crash_report') + @mock.patch('os.path.join', mock.MagicMock()) def test_ExecEditorMultitest_OneFailure_CallsCorrectFunc(self, mock_cycle_crash, mock_get_testcase_filepath, mock_retrieve_log, mock_retrieve_editor_log, mock_get_results): mock_test_suite = ly_test_tools.o3de.editor_test.EditorTestSuite() @@ -752,6 +761,8 @@ class TestRunningTests(unittest.TestCase): @mock.patch('ly_test_tools.o3de.editor_test_utils.retrieve_log_path') @mock.patch('ly_test_tools.o3de.editor_test_utils.get_testcase_module_filepath') @mock.patch('ly_test_tools.o3de.editor_test_utils.cycle_crash_report') + @mock.patch('os.path.join', mock.MagicMock()) + @mock.patch('os.path.basename', mock.MagicMock()) def test_ExecEditorMultitest_OneCrash_ReportsOnUnknownResult(self, mock_cycle_crash, mock_get_testcase_filepath, mock_retrieve_log, mock_retrieve_editor_log, mock_get_results, mock_retrieve_crash, mock_create): @@ -787,6 +798,8 @@ class TestRunningTests(unittest.TestCase): @mock.patch('ly_test_tools.o3de.editor_test_utils.retrieve_log_path') @mock.patch('ly_test_tools.o3de.editor_test_utils.get_testcase_module_filepath') @mock.patch('ly_test_tools.o3de.editor_test_utils.cycle_crash_report') + @mock.patch('os.path.join', mock.MagicMock()) + @mock.patch('os.path.basename', mock.MagicMock()) def test_ExecEditorMultitest_ManyUnknown_ReportsUnknownResults(self, mock_cycle_crash, mock_get_testcase_filepath, mock_retrieve_log, mock_retrieve_editor_log, mock_get_results, mock_retrieve_crash, mock_create): From ba9731bec60e084ec5675073ee6dfc3e5daac396 Mon Sep 17 00:00:00 2001 From: evanchia Date: Mon, 10 Jan 2022 16:13:14 -0800 Subject: [PATCH 408/948] added missing params Signed-off-by: evanchia --- Tools/LyTestTools/ly_test_tools/o3de/editor_test.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Tools/LyTestTools/ly_test_tools/o3de/editor_test.py b/Tools/LyTestTools/ly_test_tools/o3de/editor_test.py index c97298573e..eaa285a81e 100644 --- a/Tools/LyTestTools/ly_test_tools/o3de/editor_test.py +++ b/Tools/LyTestTools/ly_test_tools/o3de/editor_test.py @@ -772,7 +772,7 @@ class EditorTestSuite(): return_code = editor.get_returncode() editor_log_content = editor_utils.retrieve_editor_log_content(run_id, log_name, workspace) # Save the editor log - workspace.artifact_manager.save_artifact(os.path.join(editor_utils.retrieve_log_path(), log_name)) + workspace.artifact_manager.save_artifact(os.path.join(editor_utils.retrieve_log_path(run_id, workspace), log_name)) if return_code == 0: test_result = Result.Pass.create(test_spec, output, editor_log_content) else: @@ -782,7 +782,7 @@ class EditorTestSuite(): (run_id, workspace, self._TIMEOUT_CRASH_LOG), None) # Save the crash log crash_file_name = os.path.basename(workspace.paths.crash_log()) - workspace.artifact_manager.save_artifact(os.path.join(editor_utils.retrieve_log_path(), crash_file_name)) + workspace.artifact_manager.save_artifact(os.path.join(editor_utils.retrieve_log_path(run_id, workspace), crash_file_name)) editor_utils.cycle_crash_report(run_id, workspace) else: test_result = Result.Fail.create(test_spec, output, editor_log_content) @@ -847,7 +847,7 @@ class EditorTestSuite(): return_code = editor.get_returncode() editor_log_content = editor_utils.retrieve_editor_log_content(run_id, log_name, workspace) # Save the editor log - workspace.artifact_manager.save_artifact(os.path.join(editor_utils.retrieve_log_path(), log_name)) + workspace.artifact_manager.save_artifact(os.path.join(editor_utils.retrieve_log_path(run_id, workspace), log_name)) if return_code == 0: # No need to scrap the output, as all the tests have passed for test_spec in test_spec_list: @@ -871,7 +871,7 @@ class EditorTestSuite(): # Save the crash log crash_file_name = os.path.basename(workspace.paths.crash_log()) workspace.artifact_manager.save_artifact( - os.path.join(editor_utils.retrieve_log_path(), crash_file_name)) + os.path.join(editor_utils.retrieve_log_path(run_id, workspace), crash_file_name)) editor_utils.cycle_crash_report(run_id, workspace) results[test_spec_name] = Result.Crash.create(result.test_spec, output, return_code, crash_error, result.editor_log) From 8fd6d534b3a7fc486315f7ab7c22578ae38f31d4 Mon Sep 17 00:00:00 2001 From: evanchia Date: Mon, 10 Jan 2022 16:27:07 -0800 Subject: [PATCH 409/948] forgot to change editor command line string Signed-off-by: evanchia --- Tools/LyTestTools/ly_test_tools/o3de/editor_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tools/LyTestTools/ly_test_tools/o3de/editor_test.py b/Tools/LyTestTools/ly_test_tools/o3de/editor_test.py index eaa285a81e..8bd4fbe29a 100644 --- a/Tools/LyTestTools/ly_test_tools/o3de/editor_test.py +++ b/Tools/LyTestTools/ly_test_tools/o3de/editor_test.py @@ -762,7 +762,7 @@ class EditorTestSuite(): cmdline = [ "--runpythontest", test_filename, "-logfile", f"@log@/{log_name}", - "-project-log-path", ly_test_tools._internal.pytest_plugin.output_path] + test_cmdline_args + "-project-log-path", editor_utils.retrieve_log_path(run_id, workspace)] + test_cmdline_args editor.args.extend(cmdline) editor.start(backupFiles = False, launch_ap = False, configure_settings=False) @@ -834,7 +834,7 @@ class EditorTestSuite(): cmdline = [ "--runpythontest", test_filenames_str, "-logfile", f"@log@/{log_name}", - "-project-log-path", ly_test_tools._internal.pytest_plugin.output_path] + test_cmdline_args + "-project-log-path", editor_utils.retrieve_log_path(run_id, workspace)] + test_cmdline_args editor.args.extend(cmdline) editor.start(backupFiles = False, launch_ap = False, configure_settings=False) From d3a99235aaa997688baebf3a1432090714f16765 Mon Sep 17 00:00:00 2001 From: srikappa-amzn <82230713+srikappa-amzn@users.noreply.github.com> Date: Mon, 10 Jan 2022 17:01:50 -0800 Subject: [PATCH 410/948] Fix undo for create editor entity (#6785) * Avoid undoing twice when undo is hit for CreateNewEditorEntity Signed-off-by: srikappa-amzn <82230713+srikappa-amzn@users.noreply.github.com> * Moved an assert immediately after entity creation Signed-off-by: srikappa-amzn <82230713+srikappa-amzn@users.noreply.github.com> --- .../Entity/EditorEntityContextComponent.cpp | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityContextComponent.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityContextComponent.cpp index 90657132ca..470ca8b9ea 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityContextComponent.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityContextComponent.cpp @@ -226,7 +226,15 @@ namespace AzToolsFramework AZ::EntityId EditorEntityContextComponent::CreateNewEditorEntity(const char* name) { AZ::Entity* entity = CreateEntity(name); - FinalizeEditorEntity(entity); + AZ_Assert(entity != nullptr, "Entity with name %s couldn't be created.", name); + if (m_isLegacySliceService) + { + FinalizeEditorEntity(entity); + } + else + { + EditorEntityContextNotificationBus::Broadcast(&EditorEntityContextNotification::OnEditorEntityCreated, entity->GetId()); + } return entity->GetId(); } @@ -253,8 +261,16 @@ namespace AzToolsFramework return AZ::EntityId(); } entity = aznew AZ::Entity(entityId, name); + AZ_Assert(entity != nullptr, "Entity with name %s couldn't be created.", name); AddEntity(entity); - FinalizeEditorEntity(entity); + if (m_isLegacySliceService) + { + FinalizeEditorEntity(entity); + } + else + { + EditorEntityContextNotificationBus::Broadcast(&EditorEntityContextNotification::OnEditorEntityCreated, entity->GetId()); + } return entity->GetId(); } From f09055af42af18dc75f709753da33940ae9c21f5 Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Mon, 10 Jan 2022 19:11:00 -0600 Subject: [PATCH 411/948] Fixed CMake use with Android NDK 23 (#6460) * Fixed CMake use with Android NDK 23 This was done by only setting the `ANDROID_ARM_MODE` if the ANDROID_ABI starts with `armeabi`. The Android arm mode setting can't be used using non-`armeabi` ABIs. In O3DE we default to `arm64-v8a` `ANDROID_ABI` So `ANDROID_ARM_MODE` must not be set. The CMake [Android-Determine.cmake](https://gitlab.kitware.com/cmake/cmake/-/blob/master/Modules/Platform/Android-Determine.cmake#L573-585) which is used to detect platform-wide information when the CMAKE_SYSTEM_NAME is set to android, enforces that if the `CMAKE_ANDROID_ARCH_ABI` doesn't start with `armeabi`, then it will fatal error if the CMAKE_ANDROID_ARM_MODE option is set. In Android NDK 21 the `ANDROID_ARM_MODE` variable is used to set the CMAKE_ANDROID_ARM_MODE variable if the [ANDROID_ABI](https://android.googlesource.com/platform/ndk/+/refs/tags/ndk-r21e/build/cmake/android.toolchain.cmake#700) starts with `armeabi`. This meant when using Android NDK 21, the CMake Android-Determine.cmake module would succeed, due to the CMAKE_ANDROID_ARM_MODE not being set. In Android NDK 23 the `ANDROID_ARM_MODE` now will set the `CMAKE_ANDROID_ARM_MODE` variable to `TRUE` if it isn't defined. Added an `--extra-cmake-configure-args` option to the `generate_android_project.py` script which can be used to append user specified CMake arguments to the cmake configure step (`cmake -B -S -DCMAKE_TOOLCHAIN_FILE= `) Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Updated the O3DE Android toolchain wrapper to fatal error if the 64-bit arm ABI isn't used. Also removed the unneccessary setting of the ANDROID_ARM_MODE and ANDROID_ARM_NEON option option now that the armeabi cannot be specified as an ABI. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- cmake/Platform/Android/Toolchain_android.cmake | 9 ++++----- cmake/Tools/Platform/Android/android_support.py | 9 ++++++++- .../Tools/Platform/Android/generate_android_project.py | 6 +++++- scripts/build/Platform/Android/build_config.json | 10 +++++----- 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/cmake/Platform/Android/Toolchain_android.cmake b/cmake/Platform/Android/Toolchain_android.cmake index b5c4a56fd6..75ff4554fd 100644 --- a/cmake/Platform/Android/Toolchain_android.cmake +++ b/cmake/Platform/Android/Toolchain_android.cmake @@ -31,11 +31,10 @@ endif() if(NOT ANDROID_ABI) set(ANDROID_ABI arm64-v8a) endif() -if(NOT ANDROID_ARM_MODE) - set(ANDROID_ARM_MODE arm) -endif() -if(NOT ANDROID_ARM_NEON) - set(ANDROID_ARM_NEON FALSE) + +# Only the 64-bit ANDROID ABIs arm supported +if(NOT ANDROID_ABI MATCHES "^arm64-") + message(FATAL_ERROR "Only the 64-bit ANDROID_ABI's are supported. arm64-v8a can be used if not set") endif() if(NOT ANDROID_NATIVE_API_LEVEL) set(ANDROID_NATIVE_API_LEVEL 21) diff --git a/cmake/Tools/Platform/Android/android_support.py b/cmake/Tools/Platform/Android/android_support.py index f52cc2736c..657ef3b3e4 100755 --- a/cmake/Tools/Platform/Android/android_support.py +++ b/cmake/Tools/Platform/Android/android_support.py @@ -471,7 +471,8 @@ class AndroidProjectGenerator(object): def __init__(self, engine_root, build_dir, android_sdk_path, build_tool, android_sdk_platform, android_native_api_level, android_ndk, project_path, third_party_path, cmake_version, override_cmake_path, override_gradle_path, gradle_version, gradle_plugin_version, - override_ninja_path, include_assets_in_apk, asset_mode, asset_type, signing_config, native_build_path, vulkan_validation_path, is_test_project=False, + override_ninja_path, include_assets_in_apk, asset_mode, asset_type, signing_config, native_build_path, vulkan_validation_path, + extra_cmake_configure_args, is_test_project=False, overwrite_existing=True, unity_build_enabled=False): """ Initialize the object with all the required parameters needed to create an Android Project. The parameters should be verified before initializing this object @@ -497,6 +498,7 @@ class AndroidProjectGenerator(object): :param signing_config: Optional signing configuration arguments :param native_build_path: Override the native build staging path in gradle :param vulkan_validation_path: Override the path to where the Vulkan Validation Layers libraries are (required when using NDK r23+) + :param extra_cmake_configure_args Additional arguments to supply cmake when configuring a project :param is_test_project: Flag to indicate if this is a unit test runner project. (If true, project_path, asset_mode, asset_type, and include_assets_in_apk are ignored) :param overwrite_existing: Flag to overwrite existing project files when being generated, or skip if they already exist. """ @@ -539,6 +541,8 @@ class AndroidProjectGenerator(object): self.vulkan_validation_path = vulkan_validation_path + self.extra_cmake_configure_args = extra_cmake_configure_args + self.asset_mode = asset_mode self.asset_type = asset_type @@ -844,6 +848,9 @@ class AndroidProjectGenerator(object): if self.override_ninja_path: cmake_argument_list.append(f'"-DCMAKE_MAKE_PROGRAM={common.normalize_path_for_settings(self.override_ninja_path)}"') + if self.extra_cmake_configure_args: + cmake_argument_list.extend(map(json.dumps, self.extra_cmake_configure_args)) + # Query the project_path from the project.json file project_name = common.read_project_name_from_project_json(self.project_path) # Prepare the config-specific section to place the cmake argument list in the build.gradle for the app diff --git a/cmake/Tools/Platform/Android/generate_android_project.py b/cmake/Tools/Platform/Android/generate_android_project.py index fe0d787d38..5e414e7738 100755 --- a/cmake/Tools/Platform/Android/generate_android_project.py +++ b/cmake/Tools/Platform/Android/generate_android_project.py @@ -227,6 +227,9 @@ def main(args): help='Override path to where the Vulkan Validation Layers libraries are. Required for use with NDK r23+', default=None, required=False) + parser.add_argument('--extra-cmake-configure-args', + help='Extra arguments to supply to the cmake configure step', + nargs='*') # Asset Options parser.add_argument(INCLUDE_APK_ASSETS_ARGUMENT_NAME, @@ -415,7 +418,8 @@ def main(args): overwrite_existing=parsed_args.overwrite_existing, unity_build_enabled=parsed_args.enable_unity_build, native_build_path=parsed_args.native_build_path, - vulkan_validation_path=parsed_args.vulkan_validation_path) + vulkan_validation_path=parsed_args.vulkan_validation_path, + extra_cmake_configure_args=parsed_args.extra_cmake_configure_args) generator.execute() diff --git a/scripts/build/Platform/Android/build_config.json b/scripts/build/Platform/Android/build_config.json index 7a7e90c0b0..c505d8e940 100644 --- a/scripts/build/Platform/Android/build_config.json +++ b/scripts/build/Platform/Android/build_config.json @@ -35,7 +35,7 @@ "PARAMETERS": { "CONFIGURATION":"debug", "OUTPUT_DIRECTORY":"build\\android", - "CMAKE_OPTIONS":"-G \"Ninja Multi-Config\" -DCMAKE_TOOLCHAIN_FILE=cmake\\Platform\\Android\\Toolchain_android.cmake -DANDROID_ABI=arm64-v8a -DANDROID_ARM_MODE=arm -DANDROID_ARM_NEON=FALSE -DANDROID_NATIVE_API_LEVEL=21 -DLY_NDK_DIR=\"!LY_NDK_DIR!\"", + "CMAKE_OPTIONS":"-G \"Ninja Multi-Config\" -DCMAKE_TOOLCHAIN_FILE=cmake\\Platform\\Android\\Toolchain_android.cmake -DANDROID_NATIVE_API_LEVEL=21 -DLY_NDK_DIR=\"!LY_NDK_DIR!\"", "CMAKE_LY_PROJECTS":"AutomatedTesting", "CMAKE_TARGET":"all", "CMAKE_BUILD_ARGS":"-j!NUMBER_OF_PROCESSORS!" @@ -50,7 +50,7 @@ "PARAMETERS": { "CONFIGURATION":"profile", "OUTPUT_DIRECTORY":"build\\android", - "CMAKE_OPTIONS":"-G \"Ninja Multi-Config\" -DCMAKE_TOOLCHAIN_FILE=cmake\\Platform\\Android\\Toolchain_android.cmake -DANDROID_ABI=arm64-v8a -DANDROID_ARM_MODE=arm -DANDROID_ARM_NEON=FALSE -DANDROID_NATIVE_API_LEVEL=21 -DLY_NDK_DIR=\"!LY_NDK_DIR!\"", + "CMAKE_OPTIONS":"-G \"Ninja Multi-Config\" -DCMAKE_TOOLCHAIN_FILE=cmake\\Platform\\Android\\Toolchain_android.cmake -DANDROID_NATIVE_API_LEVEL=21 -DLY_NDK_DIR=\"!LY_NDK_DIR!\"", "CMAKE_LY_PROJECTS":"AutomatedTesting", "CMAKE_TARGET":"all", "CMAKE_BUILD_ARGS":"-j!NUMBER_OF_PROCESSORS!" @@ -66,7 +66,7 @@ "PARAMETERS": { "CONFIGURATION":"profile", "OUTPUT_DIRECTORY":"build\\android", - "CMAKE_OPTIONS":"-G \"Ninja Multi-Config\" -DCMAKE_TOOLCHAIN_FILE=cmake\\Platform\\Android\\Toolchain_android.cmake -DANDROID_ABI=arm64-v8a -DANDROID_ARM_MODE=arm -DANDROID_ARM_NEON=FALSE -DANDROID_NATIVE_API_LEVEL=21 -DLY_NDK_DIR=\"!LY_NDK_DIR!\" -DLY_UNITY_BUILD=FALSE", + "CMAKE_OPTIONS":"-G \"Ninja Multi-Config\" -DCMAKE_TOOLCHAIN_FILE=cmake\\Platform\\Android\\Toolchain_android.cmake -DANDROID_NATIVE_API_LEVEL=21 -DLY_NDK_DIR=\"!LY_NDK_DIR!\" -DLY_UNITY_BUILD=FALSE", "CMAKE_LY_PROJECTS":"AutomatedTesting", "CMAKE_TARGET":"all", "CMAKE_BUILD_ARGS":"-j!NUMBER_OF_PROCESSORS!" @@ -102,7 +102,7 @@ "PARAMETERS": { "CONFIGURATION":"release", "OUTPUT_DIRECTORY":"build\\android", - "CMAKE_OPTIONS":"-G \"Ninja Multi-Config\" -DCMAKE_TOOLCHAIN_FILE=cmake\\Platform\\Android\\Toolchain_android.cmake -DANDROID_ABI=arm64-v8a -DANDROID_ARM_MODE=arm -DANDROID_ARM_NEON=FALSE -DANDROID_NATIVE_API_LEVEL=21 -DLY_NDK_DIR=\"!LY_NDK_DIR!\"", + "CMAKE_OPTIONS":"-G \"Ninja Multi-Config\" -DCMAKE_TOOLCHAIN_FILE=cmake\\Platform\\Android\\Toolchain_android.cmake -DANDROID_NATIVE_API_LEVEL=21 -DLY_NDK_DIR=\"!LY_NDK_DIR!\"", "CMAKE_LY_PROJECTS":"AutomatedTesting", "CMAKE_TARGET":"all", "CMAKE_BUILD_ARGS":"-j!NUMBER_OF_PROCESSORS!" @@ -118,7 +118,7 @@ "PARAMETERS": { "CONFIGURATION":"release", "OUTPUT_DIRECTORY":"build\\mono_android", - "CMAKE_OPTIONS":"-G \"Ninja Multi-Config\" -DCMAKE_TOOLCHAIN_FILE=cmake\\Platform\\Android\\Toolchain_android.cmake -DANDROID_ABI=arm64-v8a -DANDROID_ARM_MODE=arm -DANDROID_ARM_NEON=FALSE -DANDROID_NATIVE_API_LEVEL=21 -DLY_NDK_DIR=\"!LY_NDK_DIR!\" -DLY_MONOLITHIC_GAME=TRUE", + "CMAKE_OPTIONS":"-G \"Ninja Multi-Config\" -DCMAKE_TOOLCHAIN_FILE=cmake\\Platform\\Android\\Toolchain_android.cmake -DANDROID_NATIVE_API_LEVEL=21 -DLY_NDK_DIR=\"!LY_NDK_DIR!\" -DLY_MONOLITHIC_GAME=TRUE", "CMAKE_LY_PROJECTS":"AutomatedTesting", "CMAKE_TARGET":"all", "CMAKE_BUILD_ARGS":"-j!NUMBER_OF_PROCESSORS!" From 0e0ca7585ce348d5079f34eae371d97295cf6d61 Mon Sep 17 00:00:00 2001 From: sphrose <82213493+sphrose@users.noreply.github.com> Date: Tue, 11 Jan 2022 11:32:17 +0000 Subject: [PATCH 412/948] change default input color space to SRGB Signed-off-by: sphrose <82213493+sphrose@users.noreply.github.com> --- .../Source/Utils/EditorLightingPreset.cpp | 2 +- .../Include/Atom/RPI.Edit/Common/ColorUtils.h | 2 ++ .../Source/RPI.Edit/Common/ColorUtils.cpp | 21 +++++++++++++------ .../DynamicProperty/DynamicProperty.cpp | 2 +- .../CoreLights/EditorAreaLightComponent.cpp | 2 +- .../EditorDirectionalLightComponent.cpp | 2 +- 6 files changed, 21 insertions(+), 10 deletions(-) diff --git a/Gems/Atom/Feature/Common/Code/Source/Utils/EditorLightingPreset.cpp b/Gems/Atom/Feature/Common/Code/Source/Utils/EditorLightingPreset.cpp index e2a99668eb..120eaa84dc 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Utils/EditorLightingPreset.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/Utils/EditorLightingPreset.cpp @@ -72,7 +72,7 @@ namespace AZ ->Attribute(AZ::Edit::Attributes::AutoExpand, true) ->DataElement(AZ::Edit::UIHandlers::Default, &LightConfig::m_direction, "Direction", "") ->DataElement(Edit::UIHandlers::Color, &LightConfig::m_color, "Color", "Color of the light") - ->Attribute("ColorEditorConfiguration", AZ::RPI::ColorUtils::GetLinearRgbEditorConfig()) + ->Attribute("ColorEditorConfiguration", AZ::RPI::ColorUtils::GetRgbEditorConfig()) ->DataElement(Edit::UIHandlers::Default, &LightConfig::m_intensity, "Intensity", "Intensity of the light in the set photometric unit.") ->ClassElement(AZ::Edit::ClassElements::Group, "Shadow") diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Common/ColorUtils.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Common/ColorUtils.h index 393cae6ca2..38b6a0bb80 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Common/ColorUtils.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Common/ColorUtils.h @@ -19,6 +19,8 @@ namespace AZ //[GFX TODO][ATOM-4462] Replace this to use data driven color management system //! Return a ColorEditorConfiguration for editing a Linear sRGB color in sRGB space. AzToolsFramework::ColorEditorConfiguration GetLinearRgbEditorConfig(); + //! Return a ColorEditorConfiguration for editing a sRGB color in sRGB space. + AzToolsFramework::ColorEditorConfiguration GetRgbEditorConfig(); } // namespace PropertyColorConfigs } // namespace RPI diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Common/ColorUtils.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Common/ColorUtils.cpp index a6baa38a72..df88a530b9 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Common/ColorUtils.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Common/ColorUtils.cpp @@ -14,14 +14,14 @@ namespace AZ { namespace ColorUtils { + enum ColorSpace : uint32_t + { + LinearSRGB, + SRGB + }; + AzToolsFramework::ColorEditorConfiguration GetLinearRgbEditorConfig() { - enum ColorSpace : uint32_t - { - LinearSRGB, - SRGB - }; - AzToolsFramework::ColorEditorConfiguration configuration; configuration.m_colorPickerDialogConfiguration = AzQtComponents::ColorPicker::Configuration::RGB; @@ -59,6 +59,15 @@ namespace AZ return configuration; } + AzToolsFramework::ColorEditorConfiguration GetRgbEditorConfig() + { + AzToolsFramework::ColorEditorConfiguration configuration = GetLinearRgbEditorConfig(); + + configuration.m_propertyColorSpaceId = ColorSpace::SRGB; + + return configuration; + } + } // namespace ColorPropertyEditorConfigurations } // namespace RPI } // namespace AZ diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/DynamicProperty/DynamicProperty.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/DynamicProperty/DynamicProperty.cpp index 2054858726..d4599b68b7 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/DynamicProperty/DynamicProperty.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/DynamicProperty/DynamicProperty.cpp @@ -160,7 +160,7 @@ namespace AtomToolsFramework ApplyRangeEditDataAttributes(); break; case DynamicPropertyType::Color: - AddEditDataAttribute(AZ_CRC("ColorEditorConfiguration", 0xc8b9510e), AZ::RPI::ColorUtils::GetLinearRgbEditorConfig()); + AddEditDataAttribute(AZ_CRC("ColorEditorConfiguration", 0xc8b9510e), AZ::RPI::ColorUtils::GetRgbEditorConfig()); break; case DynamicPropertyType::Enum: m_editData.m_elementId = AZ::Edit::UIHandlers::ComboBox; diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorAreaLightComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorAreaLightComponent.cpp index 02c9f77436..d15862451a 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorAreaLightComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorAreaLightComponent.cpp @@ -75,7 +75,7 @@ namespace AZ ->DataElement(Edit::UIHandlers::Color, &AreaLightComponentConfig::m_color, "Color", "Color of the light") ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) ->Attribute(Edit::Attributes::Visibility, &AreaLightComponentConfig::LightTypeIsSelected) - ->Attribute("ColorEditorConfiguration", RPI::ColorUtils::GetLinearRgbEditorConfig()) + ->Attribute("ColorEditorConfiguration", RPI::ColorUtils::GetRgbEditorConfig()) ->DataElement(Edit::UIHandlers::ComboBox, &AreaLightComponentConfig::m_intensityMode, "Intensity mode", "Allows specifying which photometric unit to work in.") ->Attribute(AZ::Edit::Attributes::EnumValues, &AreaLightComponentConfig::GetValidPhotometricUnits) ->Attribute(Edit::Attributes::Visibility, &AreaLightComponentConfig::LightTypeIsSelected) diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorDirectionalLightComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorDirectionalLightComponent.cpp index 2b1510b861..1759b830d2 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorDirectionalLightComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorDirectionalLightComponent.cpp @@ -59,7 +59,7 @@ namespace AZ ->ClassElement(Edit::ClassElements::EditorData, "") ->DataElement(Edit::UIHandlers::Color, &DirectionalLightComponentConfig::m_color, "Color", "Color of the light") ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) - ->Attribute("ColorEditorConfiguration", AZ::RPI::ColorUtils::GetLinearRgbEditorConfig()) + ->Attribute("ColorEditorConfiguration", AZ::RPI::ColorUtils::GetRgbEditorConfig()) ->DataElement(Edit::UIHandlers::ComboBox, &DirectionalLightComponentConfig::m_intensityMode, "Intensity mode", "Allows specifying light values in lux or Ev100") ->EnumAttribute(PhotometricUnit::Lux, "Lux") ->EnumAttribute(PhotometricUnit::Ev100Illuminance, "Ev100") From 2e577a8b14ddbd4b67ceed5311e8caf509b821df Mon Sep 17 00:00:00 2001 From: Sergey Pereslavtsev Date: Tue, 11 Jan 2022 12:11:51 +0000 Subject: [PATCH 413/948] PR feedback Signed-off-by: Sergey Pereslavtsev --- .../Source/Components/TerrainPhysicsColliderComponent.cpp | 2 +- .../Code/Source/Components/TerrainPhysicsColliderComponent.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp b/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp index 916dd800e2..c51728a5c3 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp +++ b/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp @@ -53,7 +53,7 @@ namespace Terrain AZ::Data::AssetId TerrainPhysicsSurfaceMaterialMapping::GetMaterialLibraryId() { - if (auto* physicsSystem = AZ::Interface::Get()) + if (const auto* physicsSystem = AZ::Interface::Get()) { if (const auto* physicsConfiguration = physicsSystem->GetConfiguration()) { diff --git a/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.h b/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.h index 284bc74d88..8a70f282d0 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.h +++ b/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.h @@ -33,10 +33,12 @@ namespace Terrain AZ_CLASS_ALLOCATOR(TerrainPhysicsSurfaceMaterialMapping, AZ::SystemAllocator, 0); AZ_RTTI(TerrainPhysicsSurfaceMaterialMapping, "{A88B5289-DFCD-4564-8395-E2177DFE5B18}"); static void Reflect(AZ::ReflectContext* context); - static AZ::Data::AssetId GetMaterialLibraryId(); SurfaceData::SurfaceTag m_surfaceTag; Physics::MaterialId m_materialId; + + private: + static AZ::Data::AssetId GetMaterialLibraryId(); }; class TerrainPhysicsColliderConfig From 71732c1f4539914b4ff8533deeb4b31c7ddca0a7 Mon Sep 17 00:00:00 2001 From: windbagjacket Date: Tue, 11 Jan 2022 13:21:12 +0000 Subject: [PATCH 414/948] Adding ray tracing toggle to mesh component UI Adding ray tracing toggle to mesh component UI Signed-off-by: windbagjacket --- .../CommonFeatures/Code/Source/Mesh/EditorMeshComponent.cpp | 3 +++ .../Code/Source/Mesh/MeshComponentController.cpp | 4 +++- .../CommonFeatures/Code/Source/Mesh/MeshComponentController.h | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/EditorMeshComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/EditorMeshComponent.cpp index c89546264a..423145f838 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/EditorMeshComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/EditorMeshComponent.cpp @@ -79,6 +79,9 @@ namespace AZ ->DataElement(AZ::Edit::UIHandlers::CheckBox, &MeshComponentConfig::m_useForwardPassIblSpecular, "Use Forward Pass IBL Specular", "Renders IBL specular reflections in the forward pass, using only the most influential probe (based on the position of the entity) and the global IBL cubemap. Can reduce rendering costs, but only recommended for static objects that are affected by at most one reflection probe.") ->Attribute(AZ::Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) + ->DataElement(AZ::Edit::UIHandlers::CheckBox, &MeshComponentConfig::m_isRayTracingEnabled, "Use ray tracing", + "Includes this mesh in ray tracing calculations.") + ->Attribute(AZ::Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::EntireTree) ->DataElement(AZ::Edit::UIHandlers::ComboBox, &MeshComponentConfig::m_lodType, "Lod Type", "Lod Method.") ->EnumAttribute(RPI::Cullable::LodType::Default, "Default") ->EnumAttribute(RPI::Cullable::LodType::ScreenCoverage, "Screen Coverage") diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp index 517ba90f89..b08670113b 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp @@ -76,6 +76,7 @@ namespace AZ ->Field("SortKey", &MeshComponentConfig::m_sortKey) ->Field("ExcludeFromReflectionCubeMaps", &MeshComponentConfig::m_excludeFromReflectionCubeMaps) ->Field("UseForwardPassIBLSpecular", &MeshComponentConfig::m_useForwardPassIblSpecular) + ->Field("IsRayTracingEnabled", &MeshComponentConfig::m_isRayTracingEnabled) ->Field("LodType", &MeshComponentConfig::m_lodType) ->Field("LodOverride", &MeshComponentConfig::m_lodOverride) ->Field("MinimumScreenCoverage", &MeshComponentConfig::m_minimumScreenCoverage) @@ -382,6 +383,7 @@ namespace AZ meshDescriptor.m_modelAsset = m_configuration.m_modelAsset; meshDescriptor.m_useForwardPassIblSpecular = m_configuration.m_useForwardPassIblSpecular; meshDescriptor.m_requiresCloneCallback = RequiresCloning; + meshDescriptor.m_isRayTracingEnabled = m_configuration.m_isRayTracingEnabled; m_meshHandle = m_meshFeatureProcessor->AcquireMesh(meshDescriptor, materials); m_meshFeatureProcessor->ConnectModelChangeEventHandler(m_meshHandle, m_changeEventHandler); @@ -392,7 +394,7 @@ namespace AZ m_meshFeatureProcessor->SetMeshLodConfiguration(m_meshHandle, GetMeshLodConfiguration()); m_meshFeatureProcessor->SetExcludeFromReflectionCubeMaps(m_meshHandle, m_configuration.m_excludeFromReflectionCubeMaps); m_meshFeatureProcessor->SetVisible(m_meshHandle, m_isVisible); - + m_meshFeatureProcessor->SetRayTracingEnabled(m_meshHandle, meshDescriptor.m_isRayTracingEnabled); // [GFX TODO] This should happen automatically. m_changeEventHandler should be passed to AcquireMesh // If the model instance or asset already exists, announce a model change to let others know it's loaded. HandleModelChange(m_meshFeatureProcessor->GetModel(m_meshHandle)); diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.h index 6b0731fbf7..4d09b0b7b6 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.h @@ -50,7 +50,7 @@ namespace AZ RHI::DrawItemSortKey m_sortKey = 0; bool m_excludeFromReflectionCubeMaps = false; bool m_useForwardPassIblSpecular = false; - + bool m_isRayTracingEnabled = true; RPI::Cullable::LodType m_lodType = RPI::Cullable::LodType::Default; RPI::Cullable::LodOverride m_lodOverride = aznumeric_cast(0); float m_minimumScreenCoverage = 1.0f / 1080.0f; From 751caf5f7ccdddcf16f3ba63cbf1d21349ce3191 Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Tue, 11 Jan 2022 10:01:02 -0600 Subject: [PATCH 415/948] Updated the Windows ScopedAutoTempDirectory creation logic to use a Uuid. (#6789) Previously it was using `GetTickCount()` for the creation of the directory which can collide if0 there are multiple processes creating a temporary directory via teh ScopedAutoTempDirectory constructor. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- .../ScopedAutoTempDirectory_Windows.cpp | 66 +++++++------------ 1 file changed, 25 insertions(+), 41 deletions(-) diff --git a/Code/Framework/AzTest/AzTest/Platform/Windows/ScopedAutoTempDirectory_Windows.cpp b/Code/Framework/AzTest/AzTest/Platform/Windows/ScopedAutoTempDirectory_Windows.cpp index fcda5d351a..b5314eda14 100644 --- a/Code/Framework/AzTest/AzTest/Platform/Windows/ScopedAutoTempDirectory_Windows.cpp +++ b/Code/Framework/AzTest/AzTest/Platform/Windows/ScopedAutoTempDirectory_Windows.cpp @@ -8,57 +8,41 @@ #include +#include #include #include #include -#include +#include -namespace AZ +namespace AZ::Test { - namespace Test + ScopedAutoTempDirectory::ScopedAutoTempDirectory() { - ScopedAutoTempDirectory::ScopedAutoTempDirectory() - { - constexpr const DWORD bufferSize = static_cast(AZ::IO::MaxPathLength); + using UuidString = AZStd::fixed_string; + constexpr DWORD bufferSize = static_cast(AZ::IO::MaxPathLength); - char tempDir[bufferSize] = {0}; - GetTempPathA(bufferSize, tempDir); + wchar_t tempDirW[AZ::IO::MaxPathLength]{}; + GetTempPathW(bufferSize, tempDirW); - char workingTempPathBuffer[bufferSize] = {'\0'}; + AZ::IO::FixedMaxPath tempDirectoryRoot; + AZStd::to_string(tempDirectoryRoot.Native(), tempDirW); - int maxAttempts = 2000; // Prevent an infinite loop by setting an arbitrary maximum attempts at finding an available temp folder name - while (maxAttempts > 0) + constexpr int MaxAttempts = 255; + for (int i = 0; i < MaxAttempts; ++i) + { + AZ::IO::FixedMaxPath testPath = tempDirectoryRoot / + AZ::IO::FixedMaxPathString::format("UnitTest-%s", + AZ::Uuid::CreateRandom().ToString().c_str()); + // Try to create the temp directory if it doesn't exist + if (!AZ::IO::SystemFile::Exists(testPath.c_str()) && AZ::IO::SystemFile::CreateDir(testPath.c_str())) { - // Use the system's tick count to base the folder name - ULONGLONG currentTick = GetTickCount64(); - azsnprintf(workingTempPathBuffer, bufferSize, "%sUnitTest-%X", tempDir, aznumeric_cast(currentTick)); - - // Check if the requested directory name is available and re-generate if it already exists - bool exists = AZ::IO::SystemFile::Exists(workingTempPathBuffer); - if (exists) - { - Sleep(1); - maxAttempts--; - continue; - } + azstrncpy(AZStd::data(m_tempDirectory), AZStd::size(m_tempDirectory), + testPath.c_str(), testPath.Native().size()); break; } - - AZ_Error("AzTest", maxAttempts > 0, "Unable to determine a temp directory"); - - if (maxAttempts > 0) - { - // Create the temp directory and track it for deletion - bool tempDirectoryCreated = AZ::IO::SystemFile::CreateDir(workingTempPathBuffer); - if (tempDirectoryCreated) - { - azstrncpy(m_tempDirectory, AZ::IO::MaxPathLength, workingTempPathBuffer, AZ::IO::MaxPathLength); - } - else - { - AZ_Error("AzTest", false, "Unable to create temp directory %s", workingTempPathBuffer); - } - } } - } // Test -} // AZ + + AZ_Error("AzTest", m_tempDirectory[0] != '\0', "Unable to create temp path within directory %s after %d attempts", + tempDirectoryRoot.c_str(), MaxAttempts); + } +} // AZ::Test From df511c1ae863f0854eff9fabaf04d4c0d21299dd Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Tue, 11 Jan 2022 10:05:05 -0600 Subject: [PATCH 416/948] Fixed tab order for default input focus on new level dialog Signed-off-by: Chris Galvan --- Code/Editor/NewLevelDialog.cpp | 1 - Code/Editor/NewLevelDialog.ui | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Code/Editor/NewLevelDialog.cpp b/Code/Editor/NewLevelDialog.cpp index c773acdb6f..a97eb30f57 100644 --- a/Code/Editor/NewLevelDialog.cpp +++ b/Code/Editor/NewLevelDialog.cpp @@ -115,7 +115,6 @@ CNewLevelDialog::~CNewLevelDialog() void CNewLevelDialog::OnStartup() { UpdateData(false); - setFocus(); } void CNewLevelDialog::UpdateData(bool fromUi) diff --git a/Code/Editor/NewLevelDialog.ui b/Code/Editor/NewLevelDialog.ui index 14227fbb53..93a88dc897 100644 --- a/Code/Editor/NewLevelDialog.ui +++ b/Code/Editor/NewLevelDialog.ui @@ -133,6 +133,9 @@ 1 + + LEVEL + From 708eabe5de5205dbfb4fa016c40f6cc7e7f23d12 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Tue, 11 Jan 2022 10:32:03 -0600 Subject: [PATCH 417/948] Removed comment question Signed-off-by: Chris Galvan --- .../ImageProcessingAtom/Code/Source/Processing/Utils.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/Utils.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/Utils.cpp index 44539ad33c..20e1b18e77 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/Utils.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/Utils.cpp @@ -242,10 +242,6 @@ namespace ImageProcessingAtom } } - // Should we actually put the GetSubImagePixelValue API in this Utils file instead, since it already has - // some conversion logic, and has the helper method for retrieving an entire image (LoadImageFromImageAsset) - // whereas this is a helper for retrieving a specific pixel from the image? - IImageObjectPtr LoadImageFromImageAsset(const AZ::Data::Asset& imageAsset) { if (!imageAsset.IsReady()) From 16bad281aeeda76b8d097c486f0154767fe5f635 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Tue, 11 Jan 2022 10:40:59 -0600 Subject: [PATCH 418/948] Changed GetSubImagePixelValue parameter order so x,y are first Signed-off-by: Chris Galvan --- .../Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h | 2 +- .../RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp | 4 ++-- Gems/GradientSignal/Code/Source/ImageAsset.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h index 1db2a63b1c..bdb68601a9 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h @@ -87,7 +87,7 @@ namespace AZ //! Get image pixel value for specified mip and slice template - T GetSubImagePixelValue(uint32_t mip, uint32_t slice, uint32_t x, uint32_t y, uint32_t componentIndex = 0); + T GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); //! Returns streaming image pool asset id of the pool that will be used to create the streaming image. const Data::AssetId& GetPoolAssetId() const; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index f1d9b1782b..37f0e04116 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -215,7 +215,7 @@ namespace AZ } template<> - float StreamingImageAsset::GetSubImagePixelValue(uint32_t mip, uint32_t slice, uint32_t x, uint32_t y, uint32_t componentIndex) + float StreamingImageAsset::GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) { // TODO: Use the component index (void)componentIndex; @@ -235,7 +235,7 @@ namespace AZ } template<> - AZ::u32 StreamingImageAsset::GetSubImagePixelValue(uint32_t mip, uint32_t slice, uint32_t x, uint32_t y, uint32_t componentIndex) + AZ::u32 StreamingImageAsset::GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) { // TODO: Use the component index (void)componentIndex; diff --git a/Gems/GradientSignal/Code/Source/ImageAsset.cpp b/Gems/GradientSignal/Code/Source/ImageAsset.cpp index afa233e5cb..e88a574768 100644 --- a/Gems/GradientSignal/Code/Source/ImageAsset.cpp +++ b/Gems/GradientSignal/Code/Source/ImageAsset.cpp @@ -198,7 +198,7 @@ namespace GradientSignal uint32_t x = static_cast(pixelLookup.GetX()) % width; uint32_t y = static_cast(pixelLookup.GetY()) % height; - return imageAsset->GetSubImagePixelValue(0, 0, x, y, 0); + return imageAsset->GetSubImagePixelValue(x, y); } } From 384e8aa863aa8f16b871f650a7b85c1046a30c38 Mon Sep 17 00:00:00 2001 From: smurly Date: Tue, 11 Jan 2022 09:47:04 -0800 Subject: [PATCH 419/948] Move Material Editor Basic test from sandbox to main suite (#6794) * moving material editor test from sandbox to main suite Signed-off-by: Scott Murray * define TEST_DIRECTORY and add logging Signed-off-by: Scott Murray --- .../Gem/PythonTests/Atom/TestSuite_Main.py | 78 +++++++++++++++++++ .../Gem/PythonTests/Atom/TestSuite_Sandbox.py | 71 ----------------- .../Atom/atom_utils/material_editor_utils.py | 7 ++ .../hydra_AtomMaterialEditor_BasicTests.py | 5 ++ 4 files changed, 90 insertions(+), 71 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main.py b/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main.py index 905722d103..7051b9983c 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main.py @@ -4,10 +4,18 @@ For complete copyright and license terms please see the LICENSE at the root of t SPDX-License-Identifier: Apache-2.0 OR MIT """ +import logging +import os import pytest +import ly_test_tools.environment.file_system as file_system +import editor_python_test_tools.hydra_test_utils as hydra + from ly_test_tools.o3de.editor_test import EditorSharedTest, EditorTestSuite +logger = logging.getLogger(__name__) +TEST_DIRECTORY = os.path.join(os.path.dirname(__file__), "tests") + @pytest.mark.parametrize("project", ["AutomatedTesting"]) @pytest.mark.parametrize("launcher_platform", ['windows_editor']) @@ -114,3 +122,73 @@ class TestAutomation(EditorTestSuite): class ShaderAssetBuilder_RecompilesShaderAsChainOfDependenciesChanges(EditorSharedTest): from Atom.tests import hydra_ShaderAssetBuilder_RecompilesShaderAsChainOfDependenciesChanges as test_module + + +@pytest.mark.parametrize("project", ["AutomatedTesting"]) +@pytest.mark.parametrize("launcher_platform", ['windows_generic']) +class TestMaterialEditorBasicTests(object): + @pytest.fixture(autouse=True) + def setup_teardown(self, request, workspace, project): + def delete_files(): + file_system.delete( + [ + os.path.join(workspace.paths.project(), "Materials", "test_material.material"), + os.path.join(workspace.paths.project(), "Materials", "test_material_1.material"), + os.path.join(workspace.paths.project(), "Materials", "test_material_2.material"), + ], + True, + True, + ) + # Cleanup our newly created materials + delete_files() + + def teardown(): + # Cleanup our newly created materials + delete_files() + + request.addfinalizer(teardown) + + @pytest.mark.parametrize("exe_file_name", ["MaterialEditor"]) + @pytest.mark.test_case_id("C34448113") # Creating a New Asset. + @pytest.mark.test_case_id("C34448114") # Opening an Existing Asset. + @pytest.mark.test_case_id("C34448115") # Closing Selected Material. + @pytest.mark.test_case_id("C34448116") # Closing All Materials. + @pytest.mark.test_case_id("C34448117") # Closing all but Selected Material. + @pytest.mark.test_case_id("C34448118") # Saving Material. + @pytest.mark.test_case_id("C34448119") # Saving as a New Material. + @pytest.mark.test_case_id("C34448120") # Saving as a Child Material. + @pytest.mark.test_case_id("C34448121") # Saving all Open Materials. + def test_MaterialEditorBasicTests( + self, request, workspace, project, launcher_platform, generic_launcher, exe_file_name): + + expected_lines = [ + "Material opened: True", + "Test asset doesn't exist initially: True", + "New asset created: True", + "New Material opened: True", + "Material closed: True", + "All documents closed: True", + "Close All Except Selected worked as expected: True", + "Actual Document saved with changes: True", + "Document saved as copy is saved with changes: True", + "Document saved as child is saved with changes: True", + "Save All worked as expected: True", + ] + unexpected_lines = [ + "Traceback (most recent call last):" + ] + + hydra.launch_and_validate_results( + request, + TEST_DIRECTORY, + generic_launcher, + "hydra_AtomMaterialEditor_BasicTests.py", + run_python="--runpython", + timeout=43, + expected_lines=expected_lines, + unexpected_lines=unexpected_lines, + halt_on_unexpected=True, + null_renderer=True, + log_file_name="MaterialEditor.log", + enable_prefab_system=False, + ) diff --git a/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Sandbox.py b/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Sandbox.py index 29f90e6807..c9182070f6 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Sandbox.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Sandbox.py @@ -83,77 +83,6 @@ class TestAtomEditorComponentsMain(object): ) -@pytest.mark.parametrize("project", ["AutomatedTesting"]) -@pytest.mark.parametrize("launcher_platform", ['windows_generic']) -@pytest.mark.system -class TestMaterialEditorBasicTests(object): - @pytest.fixture(autouse=True) - def setup_teardown(self, request, workspace, project): - def delete_files(): - file_system.delete( - [ - os.path.join(workspace.paths.project(), "Materials", "test_material.material"), - os.path.join(workspace.paths.project(), "Materials", "test_material_1.material"), - os.path.join(workspace.paths.project(), "Materials", "test_material_2.material"), - ], - True, - True, - ) - # Cleanup our newly created materials - delete_files() - - def teardown(): - # Cleanup our newly created materials - delete_files() - - request.addfinalizer(teardown) - - @pytest.mark.parametrize("exe_file_name", ["MaterialEditor"]) - @pytest.mark.test_case_id("C34448113") # Creating a New Asset. - @pytest.mark.test_case_id("C34448114") # Opening an Existing Asset. - @pytest.mark.test_case_id("C34448115") # Closing Selected Material. - @pytest.mark.test_case_id("C34448116") # Closing All Materials. - @pytest.mark.test_case_id("C34448117") # Closing all but Selected Material. - @pytest.mark.test_case_id("C34448118") # Saving Material. - @pytest.mark.test_case_id("C34448119") # Saving as a New Material. - @pytest.mark.test_case_id("C34448120") # Saving as a Child Material. - @pytest.mark.test_case_id("C34448121") # Saving all Open Materials. - def test_MaterialEditorBasicTests( - self, request, workspace, project, launcher_platform, generic_launcher, exe_file_name): - - expected_lines = [ - "Material opened: True", - "Test asset doesn't exist initially: True", - "New asset created: True", - "New Material opened: True", - "Material closed: True", - "All documents closed: True", - "Close All Except Selected worked as expected: True", - "Actual Document saved with changes: True", - "Document saved as copy is saved with changes: True", - "Document saved as child is saved with changes: True", - "Save All worked as expected: True", - ] - unexpected_lines = [ - "Traceback (most recent call last):" - ] - - hydra.launch_and_validate_results( - request, - TEST_DIRECTORY, - generic_launcher, - "hydra_AtomMaterialEditor_BasicTests.py", - run_python="--runpython", - timeout=120, - expected_lines=expected_lines, - unexpected_lines=unexpected_lines, - halt_on_unexpected=True, - null_renderer=True, - log_file_name="MaterialEditor.log", - enable_prefab_system=False, - ) - - @pytest.mark.parametrize("project", ["AutomatedTesting"]) @pytest.mark.parametrize("launcher_platform", ['windows_editor']) class TestAutomation(EditorTestSuite): diff --git a/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/material_editor_utils.py b/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/material_editor_utils.py index b21c74de19..f7ff970541 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/material_editor_utils.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/material_editor_utils.py @@ -162,6 +162,13 @@ def select_model_config(configname): azlmbr.materialeditor.MaterialViewportRequestBus(azlmbr.bus.Broadcast, "SelectModelPresetByName", configname) +def destroy_main_window(): + """ + Closes the Material Editor window + """ + azlmbr.atomtools.AtomToolsMainWindowFactoryRequestBus(azlmbr.bus.Broadcast, "DestroyMainWindow") + + def wait_for_condition(function, timeout_in_seconds=1.0): # type: (function, float) -> bool """ diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomMaterialEditor_BasicTests.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomMaterialEditor_BasicTests.py index 9f8f6c44b2..baad02318d 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomMaterialEditor_BasicTests.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomMaterialEditor_BasicTests.py @@ -186,6 +186,11 @@ def run(): material_editor.set_property(document2_id, property2_name, initial_color) material_editor.save_all() material_editor.close_all_documents() + material_editor.wait_for_condition(lambda: + (not material_editor.is_open(document1_id)) and + (not material_editor.is_open(document2_id)) and + (not material_editor.is_open(document3_id)), 2.0) + material_editor.destroy_main_window() if __name__ == "__main__": From d09da902d660fa164620b1c72ef981a635adadbe Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Tue, 11 Jan 2022 11:26:44 -0800 Subject: [PATCH 420/948] Fixed test materials since all the "lucy" stuff was renamed to "hermanubis". Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../SkinTestCases/001_lucy_regression_test.material | 8 ++++---- .../SkinTestCases/002_wrinkle_regression_test.material | 4 ++-- .../101_DetailMaps_LucyBaseNoDetailMaps.material | 8 ++++---- .../StandardPbrTestCases/102_DetailMaps_All.material | 10 +++++----- .../105_DetailMaps_BlendMaskUsingDetailUVs.material | 8 ++++---- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Gems/Atom/TestData/TestData/Materials/SkinTestCases/001_lucy_regression_test.material b/Gems/Atom/TestData/TestData/Materials/SkinTestCases/001_lucy_regression_test.material index bafb047be9..e6c032b0f9 100644 --- a/Gems/Atom/TestData/TestData/Materials/SkinTestCases/001_lucy_regression_test.material +++ b/Gems/Atom/TestData/TestData/Materials/SkinTestCases/001_lucy_regression_test.material @@ -11,7 +11,7 @@ 0.29372090101242068, 1.0 ], - "textureMap": "Objects/Lucy/Lucy_bronze_BaseColor.png", + "textureMap": "Objects/Hermanubis/Hermanubis_bronze_BaseColor.png", "useTexture": false }, "detailLayerGroup": { @@ -30,14 +30,14 @@ }, "normal": { "flipY": true, - "textureMap": "Objects/Lucy/Lucy_Normal.png" + "textureMap": "Objects/Hermanubis/Hermanubis_Normal.png" }, "subsurfaceScattering": { "enableSubsurfaceScattering": true, - "influenceMap": "Objects/Lucy/Lucy_thickness.tif", + "influenceMap": "Objects/Hermanubis/Hermanubis_thickness.tif", "scatterDistance": 15.0, "subsurfaceScatterFactor": 0.4300000071525574, - "thicknessMap": "Objects/Lucy/Lucy_thickness.tif", + "thicknessMap": "Objects/Hermanubis/Hermanubis_thickness.tif", "transmissionAttenuation": 15.0, "transmissionDistortion": 0.3499999940395355, "transmissionMode": "ThickObject", diff --git a/Gems/Atom/TestData/TestData/Materials/SkinTestCases/002_wrinkle_regression_test.material b/Gems/Atom/TestData/TestData/Materials/SkinTestCases/002_wrinkle_regression_test.material index 78f597b14f..9b955ddb1d 100644 --- a/Gems/Atom/TestData/TestData/Materials/SkinTestCases/002_wrinkle_regression_test.material +++ b/Gems/Atom/TestData/TestData/Materials/SkinTestCases/002_wrinkle_regression_test.material @@ -29,14 +29,14 @@ }, "normal": { "flipY": true, - "textureMap": "Objects/Lucy/Lucy_Normal.png" + "textureMap": "Objects/Hermanubis/Hermanubis_Normal.png" }, "subsurfaceScattering": { "enableSubsurfaceScattering": true, "influenceMap": "TestData/Textures/checker8x8_gray_512.png", "scatterDistance": 15.0, "subsurfaceScatterFactor": 0.4300000071525574, - "thicknessMap": "Objects/Lucy/Lucy_thickness.tif", + "thicknessMap": "Objects/Hermanubis/Hermanubis_thickness.tif", "transmissionAttenuation": 15.0, "transmissionDistortion": 0.3499999940395355, "transmissionMode": "ThickObject", diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/101_DetailMaps_LucyBaseNoDetailMaps.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/101_DetailMaps_LucyBaseNoDetailMaps.material index 6d77be5a49..82192bac41 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/101_DetailMaps_LucyBaseNoDetailMaps.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/101_DetailMaps_LucyBaseNoDetailMaps.material @@ -5,7 +5,7 @@ "propertyLayoutVersion": 3, "properties": { "baseColor": { - "textureMap": "Objects/Lucy/Lucy_bronze_BaseColor.png", + "textureMap": "Objects/Hermanubis/Hermanubis_bronze_BaseColor.png", "textureMapUv": "Unwrapped" }, "detailUV": { @@ -15,16 +15,16 @@ ] }, "metallic": { - "textureMap": "Objects/Lucy/Lucy_bronze_Metallic.png", + "textureMap": "Objects/Hermanubis/Hermanubis_bronze_Metallic.png", "textureMapUv": "Unwrapped" }, "normal": { "flipY": true, - "textureMap": "Objects/Lucy/Lucy_Normal.png", + "textureMap": "Objects/Hermanubis/Hermanubis_Normal.png", "textureMapUv": "Unwrapped" }, "roughness": { - "textureMap": "Objects/Lucy/Lucy_bronze_Roughness.png", + "textureMap": "Objects/Hermanubis/Hermanubis_bronze_Roughness.png", "textureMapUv": "Unwrapped" } } diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/102_DetailMaps_All.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/102_DetailMaps_All.material index 1a29f392c8..dd31d00db0 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/102_DetailMaps_All.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/102_DetailMaps_All.material @@ -5,12 +5,12 @@ "propertyLayoutVersion": 3, "properties": { "baseColor": { - "textureMap": "Objects/Lucy/Lucy_bronze_BaseColor.png", + "textureMap": "Objects/Hermanubis/Hermanubis_bronze_BaseColor.png", "textureMapUv": "Unwrapped" }, "detailLayerGroup": { "baseColorDetailMap": "TestData/Textures/cc0/Concrete019_1K_Color.jpg", - "blendDetailMask": "Objects/Lucy/Lucy_ao.tif", + "blendDetailMask": "Objects/Hermanubis/Hermanubis_ao.tif", "blendDetailMaskUv": "Unwrapped", "enableBaseColor": true, "enableDetailLayer": true, @@ -26,16 +26,16 @@ "scale": 10.0 }, "metallic": { - "textureMap": "Objects/Lucy/Lucy_bronze_Metallic.png", + "textureMap": "Objects/Hermanubis/Hermanubis_bronze_Metallic.png", "textureMapUv": "Unwrapped" }, "normal": { "flipY": true, - "textureMap": "Objects/Lucy/Lucy_Normal.png", + "textureMap": "Objects/Hermanubis/Hermanubis_Normal.png", "textureMapUv": "Unwrapped" }, "roughness": { - "textureMap": "Objects/Lucy/Lucy_bronze_Roughness.png", + "textureMap": "Objects/Hermanubis/Hermanubis_bronze_Roughness.png", "textureMapUv": "Unwrapped" } } diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/105_DetailMaps_BlendMaskUsingDetailUVs.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/105_DetailMaps_BlendMaskUsingDetailUVs.material index a69b72b623..6964342447 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/105_DetailMaps_BlendMaskUsingDetailUVs.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/105_DetailMaps_BlendMaskUsingDetailUVs.material @@ -5,7 +5,7 @@ "propertyLayoutVersion": 3, "properties": { "baseColor": { - "textureMap": "Objects/Lucy/Lucy_bronze_BaseColor.png", + "textureMap": "Objects/Hermanubis/Hermanubis_bronze_BaseColor.png", "textureMapUv": "Unwrapped" }, "detailLayerGroup": { @@ -25,16 +25,16 @@ "scale": 10.0 }, "metallic": { - "textureMap": "Objects/Lucy/Lucy_bronze_Metallic.png", + "textureMap": "Objects/Hermanubis/Hermanubis_bronze_Metallic.png", "textureMapUv": "Unwrapped" }, "normal": { "flipY": true, - "textureMap": "Objects/Lucy/Lucy_Normal.png", + "textureMap": "Objects/Hermanubis/Hermanubis_Normal.png", "textureMapUv": "Unwrapped" }, "roughness": { - "textureMap": "Objects/Lucy/Lucy_bronze_Roughness.png", + "textureMap": "Objects/Hermanubis/Hermanubis_bronze_Roughness.png", "textureMapUv": "Unwrapped" } } From 48a90e0668feb42328d775b5b57f4df48eb1b6b3 Mon Sep 17 00:00:00 2001 From: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> Date: Tue, 11 Jan 2022 13:37:55 -0600 Subject: [PATCH 421/948] Adding wait_for_condition checks for level save/export, and extending wait for slice creation test Signed-off-by: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> --- .../EditorScripts/DynamicSliceInstanceSpawner_Embedded_E2E.py | 3 ++- .../EditorScripts/DynamicSliceInstanceSpawner_External_E2E.py | 3 ++- .../dyn_veg/EditorScripts/LayerBlender_E2E_Editor.py | 3 ++- .../SpawnerSlices_SliceCreationAndVisibilityToggleWorks.py | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_Embedded_E2E.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_Embedded_E2E.py index 86035bfbae..b4650c782e 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_Embedded_E2E.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_Embedded_E2E.py @@ -110,7 +110,8 @@ def DynamicSliceInstanceSpawner_Embedded_E2E(): general.save_level() general.export_to_engine() pak_path = os.path.join(paths.products, "levels", lvl_name, "level.pak") - Report.result(Tests.saved_and_exported, os.path.exists(pak_path)) + success = helper.wait_for_condition(lambda: os.path.exists(pak_path), 10.0) + Report.result(Tests.saved_and_exported, success) if __name__ == "__main__": diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_External_E2E.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_External_E2E.py index 2353095849..a5e7e90ce2 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_External_E2E.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_External_E2E.py @@ -132,7 +132,8 @@ def DynamicSliceInstanceSpawner_External_E2E(): general.save_level() general.export_to_engine() pak_path = os.path.join(paths.products, "levels", lvl_name, "level.pak") - Report.result(Tests.saved_and_exported, os.path.exists(pak_path)) + success = helper.wait_for_condition(lambda: os.path.exists(pak_path), 10.0) + Report.result(Tests.saved_and_exported, success) if __name__ == "__main__": diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerBlender_E2E_Editor.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerBlender_E2E_Editor.py index f2c7faae8a..6b5a80ee8e 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerBlender_E2E_Editor.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerBlender_E2E_Editor.py @@ -156,7 +156,8 @@ def LayerBlender_E2E_Editor(): general.save_level() general.export_to_engine() pak_path = os.path.join(paths.products, "levels", lvl_name, "level.pak") - Report.result(Tests.saved_and_exported, os.path.exists(pak_path)) + success = helper.wait_for_condition(lambda: os.path.exists(pak_path), 10.0) + Report.result(Tests.saved_and_exported, success) if __name__ == "__main__": diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SpawnerSlices_SliceCreationAndVisibilityToggleWorks.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SpawnerSlices_SliceCreationAndVisibilityToggleWorks.py index c36d1b5bc9..fc55080cec 100644 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SpawnerSlices_SliceCreationAndVisibilityToggleWorks.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SpawnerSlices_SliceCreationAndVisibilityToggleWorks.py @@ -73,7 +73,7 @@ def SpawnerSlices_SliceCreationAndVisibilityToggleWorks(): slice.SliceRequestBus(bus.Broadcast, "CreateNewSlice", veg_1.id, slice_path) # 2.3) Verify if the slice has been created successfully - spawner_slice_success = helper.wait_for_condition(lambda: path_is_valid_asset(slice_path), 5.0) + spawner_slice_success = helper.wait_for_condition(lambda: path_is_valid_asset(slice_path), 10.0) Report.result(Tests.spawner_slice_created, spawner_slice_success) # 3) C2627904: Hiding a slice containing the component clears any visuals from the Viewport From f03c2885f0347aaa2d64a03e51d63727e84b2de2 Mon Sep 17 00:00:00 2001 From: SWMasterson Date: Tue, 11 Jan 2022 12:21:45 -0800 Subject: [PATCH 422/948] Moving AutomatedTesting Atom levels into the Graphics subfolder (#6791) Signed-off-by: Sean Masterson --- .../PbrMaterialChart/PbrMaterialChart.prefab | 88 +++++++++---------- .../PbrMaterialChart/materials/basic.material | 0 .../materials/basic_m00_r00.material | 0 .../materials/basic_m00_r01.material | 0 .../materials/basic_m00_r02.material | 0 .../materials/basic_m00_r03.material | 0 .../materials/basic_m00_r04.material | 0 .../materials/basic_m00_r05.material | 0 .../materials/basic_m00_r06.material | 0 .../materials/basic_m00_r07.material | 0 .../materials/basic_m00_r08.material | 0 .../materials/basic_m00_r09.material | 0 .../materials/basic_m00_r10.material | 0 .../materials/basic_m10_r00.material | 0 .../materials/basic_m10_r01.material | 0 .../materials/basic_m10_r02.material | 0 .../materials/basic_m10_r03.material | 0 .../materials/basic_m10_r04.material | 0 .../materials/basic_m10_r05.material | 0 .../materials/basic_m10_r06.material | 0 .../materials/basic_m10_r07.material | 0 .../materials/basic_m10_r08.material | 0 .../materials/basic_m10_r09.material | 0 .../materials/basic_m10_r10.material | 0 .../{ => Graphics}/PbrMaterialChart/tags.txt | 0 .../{ => Graphics}/Sponza/Sponza.prefab | 0 .../Levels/{ => Graphics}/Sponza/tags.txt | 0 .../macbeth_shaderballs.prefab | 0 .../macbeth_shaderballs/tags.txt | 0 29 files changed, 44 insertions(+), 44 deletions(-) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/PbrMaterialChart.prefab (97%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m00_r00.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m00_r01.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m00_r02.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m00_r03.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m00_r04.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m00_r05.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m00_r06.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m00_r07.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m00_r08.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m00_r09.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m00_r10.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m10_r00.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m10_r01.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m10_r02.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m10_r03.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m10_r04.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m10_r05.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m10_r06.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m10_r07.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m10_r08.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m10_r09.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/materials/basic_m10_r10.material (100%) rename AutomatedTesting/Levels/{ => Graphics}/PbrMaterialChart/tags.txt (100%) rename AutomatedTesting/Levels/{ => Graphics}/Sponza/Sponza.prefab (100%) rename AutomatedTesting/Levels/{ => Graphics}/Sponza/tags.txt (100%) rename AutomatedTesting/Levels/{ => Graphics}/macbeth_shaderballs/macbeth_shaderballs.prefab (100%) rename AutomatedTesting/Levels/{ => Graphics}/macbeth_shaderballs/tags.txt (100%) diff --git a/AutomatedTesting/Levels/PbrMaterialChart/PbrMaterialChart.prefab b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/PbrMaterialChart.prefab similarity index 97% rename from AutomatedTesting/Levels/PbrMaterialChart/PbrMaterialChart.prefab rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/PbrMaterialChart.prefab index faa93597de..2c0ee5cb1a 100644 --- a/AutomatedTesting/Levels/PbrMaterialChart/PbrMaterialChart.prefab +++ b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/PbrMaterialChart.prefab @@ -1474,9 +1474,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{1FD47684-2E9E-5525-BBCA-251795F9033C}" + "guid": "{12B5A321-3D64-5DF6-9E15-D8F447229EC1}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m00_r00.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m00_r00.azmaterial" } } } @@ -1569,9 +1569,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{B5660D78-818E-5273-AF3D-EC8189E2E6CB}" + "guid": "{EB8B9C49-D6F4-5098-AC97-543381E2554A}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m00_r01.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m00_r01.azmaterial" } } } @@ -1824,9 +1824,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{512443BD-9511-5F13-A84A-3ED5DB9E9B5A}" + "guid": "{CAA9CAFC-8A48-5406-BE26-448E5AA1A5B0}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m00_r02.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m00_r02.azmaterial" } } } @@ -1926,9 +1926,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{E28A5CC5-4B8B-5B90-877A-3D92C75DC75A}" + "guid": "{2F338C0B-EF86-5AC4-AEE6-28A26BB9E97E}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m00_r03.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m00_r03.azmaterial" } } } @@ -2028,9 +2028,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{1495BCCF-3F96-5D0B-8176-228DB22CEC82}" + "guid": "{9BF4E656-0D4F-5746-A256-32740742712B}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m00_r04.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m00_r04.azmaterial" } } } @@ -2130,9 +2130,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{40494612-0ABF-55B5-9C56-E968763FCFDE}" + "guid": "{850398D7-386A-56C6-AEB2-95E4F64368B1}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m00_r05.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m00_r05.azmaterial" } } } @@ -2232,9 +2232,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{76CF9D4A-009F-5494-83AB-6E3D4D1B4A36}" + "guid": "{74784C2A-A713-5C6A-8B3D-B66CAE3DD055}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m00_r06.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m00_r06.azmaterial" } } } @@ -2334,9 +2334,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{8431B792-E6CC-51DD-B82E-F3E4A12FCB4A}" + "guid": "{4F9F91F7-7E22-5A14-856D-194CC258E70D}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m00_r07.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m00_r07.azmaterial" } } } @@ -2436,9 +2436,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{4B1F29FF-7971-5524-AA1B-0DC2392A33C4}" + "guid": "{842AE870-802B-5934-997F-0965F960ECB9}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m00_r08.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m00_r08.azmaterial" } } } @@ -2538,9 +2538,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{785BE6DE-C0EB-5B47-9438-4F9ECFC34A96}" + "guid": "{0184CF10-E675-5C33-B1B9-009C383AB463}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m00_r09.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m00_r09.azmaterial" } } } @@ -2640,9 +2640,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{C40DE9AE-6756-57E7-B3B4-FB0542B5CD0F}" + "guid": "{6DDA0761-C165-58CC-B45E-03C29F0CF598}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m00_r10.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m00_r10.azmaterial" } } } @@ -2896,9 +2896,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{251C4C29-4ECD-5763-AF4F-20675EAC048B}" + "guid": "{101AB53A-3B3E-5ACF-841C-65DB2BFBF305}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m10_r04.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m10_r04.azmaterial" } } } @@ -2998,9 +2998,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{02D082C4-5032-57CC-A081-BC4D8518BCF0}" + "guid": "{B82B96D6-7511-5E22-A36E-FFF682B3236B}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m10_r05.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m10_r05.azmaterial" } } } @@ -3100,9 +3100,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{FA9D8842-95B2-5371-8352-CBEEEAABE676}" + "guid": "{DBED5292-3E17-5038-9974-80A8BB1F79E8}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m10_r06.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m10_r06.azmaterial" } } } @@ -3202,9 +3202,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{522A9626-FF4C-561A-A44A-64B68F7274D2}" + "guid": "{25F07733-365C-5826-AEE3-E92FBE807555}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m10_r07.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m10_r07.azmaterial" } } } @@ -3304,9 +3304,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{06DDFD66-D7F5-5D55-8972-6D61276E88F6}" + "guid": "{C9A7B916-CF71-5A34-B9B9-54FE8CB058DC}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m10_r00.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m10_r00.azmaterial" } } } @@ -3399,9 +3399,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{060EF1B7-1029-5227-B03B-1415C74E9D65}" + "guid": "{85C8DFC5-358D-579D-B922-14FA1B401571}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m10_r08.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m10_r08.azmaterial" } } } @@ -3501,9 +3501,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{7B7BC6F8-150A-518F-816E-2F7DBE786461}" + "guid": "{51924281-7A06-5654-B783-A4F5759063ED}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m10_r01.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m10_r01.azmaterial" } } } @@ -3603,9 +3603,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{270881B6-21E9-509D-A6CD-1046674FB0BE}" + "guid": "{7877F64E-26E3-558C-B6D9-B609ED6E43BF}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m10_r09.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m10_r09.azmaterial" } } } @@ -3705,9 +3705,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{C0538953-C56E-5C1A-BBE2-E6BE04764C20}" + "guid": "{6CC3C6B9-EE05-5A77-A12D-7085D93D89DB}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m10_r02.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m10_r02.azmaterial" } } } @@ -3874,9 +3874,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{5EA26E09-E3D6-5181-8E7A-F2E98A24247C}" + "guid": "{E6E15876-EEF3-555D-BD80-1B9D5A7ECC7D}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m10_r10.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m10_r10.azmaterial" } } } @@ -3976,9 +3976,9 @@ "{}": { "MaterialAsset": { "assetId": { - "guid": "{E1A5D708-7A49-5CCA-81C3-4CB337C47703}" + "guid": "{83179EEC-BAC7-5D39-9788-37D33E9584B1}" }, - "assetHint": "levels/pbrmaterialchart/materials/basic_m10_r03.azmaterial" + "assetHint": "levels/graphics/pbrmaterialchart/materials/basic_m10_r03.azmaterial" } } } diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r00.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r00.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r00.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r00.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r01.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r01.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r01.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r01.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r02.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r02.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r02.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r02.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r03.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r03.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r03.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r03.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r04.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r04.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r04.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r04.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r05.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r05.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r05.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r05.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r06.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r06.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r06.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r06.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r07.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r07.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r07.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r07.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r08.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r08.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r08.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r08.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r09.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r09.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r09.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r09.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r10.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r10.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m00_r10.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r10.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r00.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r00.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r00.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r00.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r01.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r01.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r01.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r01.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r02.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r02.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r02.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r02.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r03.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r03.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r03.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r03.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r04.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r04.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r04.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r04.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r05.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r05.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r05.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r05.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r06.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r06.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r06.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r06.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r07.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r07.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r07.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r07.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r08.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r08.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r08.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r08.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r09.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r09.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r09.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r09.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r10.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r10.material similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/materials/basic_m10_r10.material rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r10.material diff --git a/AutomatedTesting/Levels/PbrMaterialChart/tags.txt b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/tags.txt similarity index 100% rename from AutomatedTesting/Levels/PbrMaterialChart/tags.txt rename to AutomatedTesting/Levels/Graphics/PbrMaterialChart/tags.txt diff --git a/AutomatedTesting/Levels/Sponza/Sponza.prefab b/AutomatedTesting/Levels/Graphics/Sponza/Sponza.prefab similarity index 100% rename from AutomatedTesting/Levels/Sponza/Sponza.prefab rename to AutomatedTesting/Levels/Graphics/Sponza/Sponza.prefab diff --git a/AutomatedTesting/Levels/Sponza/tags.txt b/AutomatedTesting/Levels/Graphics/Sponza/tags.txt similarity index 100% rename from AutomatedTesting/Levels/Sponza/tags.txt rename to AutomatedTesting/Levels/Graphics/Sponza/tags.txt diff --git a/AutomatedTesting/Levels/macbeth_shaderballs/macbeth_shaderballs.prefab b/AutomatedTesting/Levels/Graphics/macbeth_shaderballs/macbeth_shaderballs.prefab similarity index 100% rename from AutomatedTesting/Levels/macbeth_shaderballs/macbeth_shaderballs.prefab rename to AutomatedTesting/Levels/Graphics/macbeth_shaderballs/macbeth_shaderballs.prefab diff --git a/AutomatedTesting/Levels/macbeth_shaderballs/tags.txt b/AutomatedTesting/Levels/Graphics/macbeth_shaderballs/tags.txt similarity index 100% rename from AutomatedTesting/Levels/macbeth_shaderballs/tags.txt rename to AutomatedTesting/Levels/Graphics/macbeth_shaderballs/tags.txt From faf3255ea64ccd6524e7be0f048bfa6721a7eacd Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Tue, 11 Jan 2022 14:27:09 -0800 Subject: [PATCH 423/948] Renamed more files from "lucy" to "hermanubis" Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- ...sion_test.material => 001_hermanubis_regression_test.material} | 0 ...tailMaps.material => 101_DetailMaps_BaseNoDetailMaps.material} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename Gems/Atom/TestData/TestData/Materials/SkinTestCases/{001_lucy_regression_test.material => 001_hermanubis_regression_test.material} (100%) rename Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/{101_DetailMaps_LucyBaseNoDetailMaps.material => 101_DetailMaps_BaseNoDetailMaps.material} (100%) diff --git a/Gems/Atom/TestData/TestData/Materials/SkinTestCases/001_lucy_regression_test.material b/Gems/Atom/TestData/TestData/Materials/SkinTestCases/001_hermanubis_regression_test.material similarity index 100% rename from Gems/Atom/TestData/TestData/Materials/SkinTestCases/001_lucy_regression_test.material rename to Gems/Atom/TestData/TestData/Materials/SkinTestCases/001_hermanubis_regression_test.material diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/101_DetailMaps_LucyBaseNoDetailMaps.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/101_DetailMaps_BaseNoDetailMaps.material similarity index 100% rename from Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/101_DetailMaps_LucyBaseNoDetailMaps.material rename to Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/101_DetailMaps_BaseNoDetailMaps.material From 5cd8b0e1724eb93ad5c85cf2c34b414d9059ba75 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Tue, 11 Jan 2022 14:55:44 -0800 Subject: [PATCH 424/948] Renamed more files from "lucy" to "hermanubis" Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../StandardPbrTestCases/103_DetailMaps_BaseColor.material | 2 +- .../StandardPbrTestCases/104_DetailMaps_Normal.material | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/103_DetailMaps_BaseColor.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/103_DetailMaps_BaseColor.material index 5bddeaa7e5..eda8ef12de 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/103_DetailMaps_BaseColor.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/103_DetailMaps_BaseColor.material @@ -1,7 +1,7 @@ { "description": "", "materialType": "Materials/Types/EnhancedPBR.materialtype", - "parentMaterial": "TestData/Materials/StandardPbrTestCases/101_DetailMaps_LucyBaseNoDetailMaps.material", + "parentMaterial": "TestData/Materials/StandardPbrTestCases/101_DetailMaps_BaseNoDetailMaps.material", "propertyLayoutVersion": 3, "properties": { "detailLayerGroup": { diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/104_DetailMaps_Normal.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/104_DetailMaps_Normal.material index 4c64a696d2..291f0fc828 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/104_DetailMaps_Normal.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/104_DetailMaps_Normal.material @@ -1,7 +1,7 @@ { "description": "", "materialType": "Materials/Types/EnhancedPBR.materialtype", - "parentMaterial": "TestData/Materials/StandardPbrTestCases/101_DetailMaps_LucyBaseNoDetailMaps.material", + "parentMaterial": "TestData/Materials/StandardPbrTestCases/101_DetailMaps_BaseNoDetailMaps.material", "propertyLayoutVersion": 3, "properties": { "detailLayerGroup": { From 5dc97e7e4b5e9272f4940628833315007a060c8b Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Tue, 11 Jan 2022 16:34:22 -0800 Subject: [PATCH 425/948] Fix Prefab instance assets not preloading PrefabCatchmentProcessor::ProcessPrefab was no longer updating the ProcessedObjectStore's referenced object list, this change exposes the referenced asset list in the new PrefabDocument API and uses them to update the referenced asset list. Signed-off-by: Nicholas Van Sickle --- .../Prefab/Spawnable/PrefabCatchmentProcessor.cpp | 1 + .../Prefab/Spawnable/PrefabDocument.cpp | 12 +++++++++++- .../Prefab/Spawnable/PrefabDocument.h | 4 ++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.cpp index 40cd52cac8..a5ca034c36 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.cpp @@ -64,6 +64,7 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils AZStd::move(uniqueName), context.GetSourceUuid(), AZStd::move(serializer)); AZ_Assert(spawnable, "Failed to create a new spawnable."); + object.GetReferencedAssets() = prefab.GetReferencedAssets(); Instance& instance = prefab.GetInstance(); // Resolve entity aliases that store PrefabDOM information to use the spawnable instead. This is done before the entities are // moved from the instance as they'd otherwise can't be found. diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp index 04fdea30d2..230c2226cd 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp @@ -124,12 +124,22 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils return *m_instance; } + AZStd::vector>& PrefabDocument::GetReferencedAssets() + { + return m_referencedAssets; + } + + const AZStd::vector>& PrefabDocument::GetReferencedAssets() const + { + return m_referencedAssets; + } + bool PrefabDocument::ConstructInstanceFromPrefabDom(const PrefabDom& prefab) { using namespace AzToolsFramework::Prefab; m_instance->Reset(); - if (PrefabDomUtils::LoadInstanceFromPrefabDom(*m_instance, prefab, PrefabDomUtils::LoadFlags::AssignRandomEntityId)) + if (PrefabDomUtils::LoadInstanceFromPrefabDom(*m_instance, prefab, m_referencedAssets, PrefabDomUtils::LoadFlags::AssignRandomEntityId)) { return true; } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h index 215daf7f71..661dba5edf 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h @@ -53,12 +53,16 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils AzToolsFramework::Prefab::Instance& GetInstance(); const AzToolsFramework::Prefab::Instance& GetInstance() const; + AZStd::vector>& GetReferencedAssets(); + const AZStd::vector>& GetReferencedAssets() const; + private: bool ConstructInstanceFromPrefabDom(const PrefabDom& prefab); mutable PrefabDom m_dom; AZStd::unique_ptr m_instance; AZStd::string m_name; + AZStd::vector> m_referencedAssets; mutable bool m_isDirty{ false }; }; } // namespace AzToolsFramework::Prefab::PrefabConversionUtils From 2e19b703ef00e4f1bc94a904901c83f2e6fa3e3e Mon Sep 17 00:00:00 2001 From: nemerle <96597+nemerle@users.noreply.github.com> Date: Wed, 12 Jan 2022 01:37:02 +0100 Subject: [PATCH 426/948] fix release build Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> --- Gems/AudioSystem/Code/Source/Engine/ATLEntities.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gems/AudioSystem/Code/Source/Engine/ATLEntities.cpp b/Gems/AudioSystem/Code/Source/Engine/ATLEntities.cpp index 45a95a71d7..f799e8e69f 100644 --- a/Gems/AudioSystem/Code/Source/Engine/ATLEntities.cpp +++ b/Gems/AudioSystem/Code/Source/Engine/ATLEntities.cpp @@ -286,7 +286,9 @@ namespace Audio return sResult; } - CATLAudioFileEntry::CATLAudioFileEntry(const char * const filePath, IATLAudioFileEntryData * const implData) + +#endif // !AUDIO_RELEASE + CATLAudioFileEntry::CATLAudioFileEntry(const char* const filePath, IATLAudioFileEntryData* const implData) : m_filePath(filePath) , m_fileSize(0) , m_useCount(0) @@ -299,6 +301,4 @@ namespace Audio } CATLAudioFileEntry::~CATLAudioFileEntry() = default; - -#endif // !AUDIO_RELEASE } // namespace Audio From 07e6b54ca5c76c95524563c8873a2948934b7f67 Mon Sep 17 00:00:00 2001 From: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com> Date: Tue, 11 Jan 2022 16:49:16 -0800 Subject: [PATCH 427/948] Fix names display index and scripting dev gem (#6822) * Fix input/output params not being zero-based * Expose missing Dump Database developer command * Fix issue where developer gem name is not the same as the target * Let the user specify folder to write to Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com> --- .../Code/Editor/Nodes/NodeDisplayUtils.cpp | 77 +++++++------------ .../Code/Editor/Source/TSGenerateAction.cpp | 23 ++++++ Gems/ScriptCanvasDeveloper/gem.json | 2 +- 3 files changed, 52 insertions(+), 50 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp b/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp index 31d012fd4a..60eaba24f8 100644 --- a/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Nodes/NodeDisplayUtils.cpp @@ -376,60 +376,60 @@ namespace ScriptCanvasEditor::Nodes int paramIndex = 0; int outputIndex = 0; + int slotIndex = 0; auto busId = methodNode->GetBusSlotId(); for (const auto& slot : methodNode->GetSlots()) { GraphCanvas::TranslationKey slotKey = key; - int& index = (slot.IsData() && slot.IsInput()) ? paramIndex : outputIndex; + int& inputOutputIndex = slot.IsInput() ? paramIndex : outputIndex; + const bool isBusIdSlot = + methodNode->HasBusID() && busId == slot.GetId() && slot.GetDescriptor() == ScriptCanvas::SlotDescriptors::DataIn(); if (slot.IsVisible()) { - AZ::EntityId graphCanvasSlotId = DisplayScriptCanvasSlot(graphCanvasNodeId, slot, index); + AZ::EntityId graphCanvasSlotId = DisplayScriptCanvasSlot(graphCanvasNodeId, slot, slotIndex); details.m_name = slot.GetName(); details.m_tooltip = slot.GetToolTip(); - if (methodNode->HasBusID() && busId == slot.GetId() && slot.GetDescriptor() == ScriptCanvas::SlotDescriptors::DataIn()) + if (isBusIdSlot) { key = ::Translation::GlobalKeys::EBusSenderIDKey; - GraphCanvas::TranslationRequestBus::BroadcastResult(details, &GraphCanvas::TranslationRequests::GetDetails, key + ".details", details); + GraphCanvas::TranslationRequestBus::BroadcastResult( + details, &GraphCanvas::TranslationRequests::GetDetails, key + ".details", details); } - else + else if (slot.IsData()) { - - - if (slot.IsData()) + key.clear(); + key << context << className << "methods" << updatedMethodName; + if (slot.IsInput()) { - key.clear(); - key << context << className << "methods" << updatedMethodName; - if (slot.IsData() && slot.IsInput()) - { - key << "params"; - } - else - { - key << "results"; - } - key << index; - - GraphCanvas::TranslationRequestBus::BroadcastResult(details, &GraphCanvas::TranslationRequests::GetDetails, key + ".details", details); + key << "params"; } - - if (slot.IsData()) - { - index++; + else + { + key << "results"; } + key << inputOutputIndex; + + GraphCanvas::TranslationRequestBus::BroadcastResult( + details, &GraphCanvas::TranslationRequests::GetDetails, key + ".details", details); } - GraphCanvas::SlotRequestBus::Event(graphCanvasSlotId, &GraphCanvas::SlotRequests::SetDetails, details.m_name, details.m_tooltip); + GraphCanvas::SlotRequestBus::Event( + graphCanvasSlotId, &GraphCanvas::SlotRequests::SetDetails, details.m_name, details.m_tooltip); UpdateSlotDatumLabel(graphCanvasNodeId, slot.GetId(), details.m_name); - } - ++index; + ++slotIndex; + + if (!isBusIdSlot && slot.IsData()) + { + ++inputOutputIndex; + } } // Set the name @@ -485,9 +485,6 @@ namespace ScriptCanvasEditor::Nodes AZStd::vector< ScriptCanvas::SlotId > scriptCanvasSlots = busNode->GetNonEventSlotIds(); - int paramIndex = 0; - int outputIndex = 0; - for (const auto& slotId : scriptCanvasSlots) { ScriptCanvas::Slot* slot = busNode->GetSlot(slotId); @@ -501,8 +498,6 @@ namespace ScriptCanvasEditor::Nodes if (slot->IsVisible()) { - int& index = (slot->IsData() && slot->IsInput()) ? paramIndex : outputIndex; - AZ::EntityId gcSlotId = DisplayScriptCanvasSlot(graphCanvasNodeId, (*slot), group); if (busNode->IsIDRequired() && slot->GetDescriptor() == ScriptCanvas::SlotDescriptors::DataIn()) @@ -516,8 +511,6 @@ namespace ScriptCanvasEditor::Nodes GraphCanvas::SlotRequestBus::Event(gcSlotId, &GraphCanvas::SlotRequests::SetDetails, details.m_name, details.m_tooltip); } - - ++index; } } @@ -615,17 +608,12 @@ namespace ScriptCanvasEditor::Nodes *graphCanvasUserData = azEventNode->GetEntityId(); } - int paramIndex = 0; - int outputIndex = 0; - for (const ScriptCanvas::Slot& slot: azEventNode->GetSlots()) { GraphCanvas::SlotGroup group = GraphCanvas::SlotGroups::Invalid; if (slot.IsVisible()) { - int& index = (slot.IsData() && slot.IsInput()) ? paramIndex : outputIndex; - AZ::EntityId gcSlotId = DisplayScriptCanvasSlot(graphCanvasNodeId, slot, group); GraphCanvas::TranslationKey key; @@ -636,8 +624,6 @@ namespace ScriptCanvasEditor::Nodes GraphCanvas::SlotRequestBus::Event(gcSlotId, &GraphCanvas::SlotRequests::SetName, details.m_name); GraphCanvas::SlotRequestBus::Event(gcSlotId, &GraphCanvas::SlotRequests::SetTooltip, details.m_tooltip);; - - ++index; } } @@ -703,9 +689,6 @@ namespace ScriptCanvasEditor::Nodes AZStd::vector< ScriptCanvas::SlotId > scriptCanvasSlots = busNode->GetNonEventSlotIds(); - int paramIndex = 0; - int outputIndex = 0; - for (const auto& slotId : scriptCanvasSlots) { ScriptCanvas::Slot* slot = busNode->GetSlot(slotId); @@ -719,8 +702,6 @@ namespace ScriptCanvasEditor::Nodes if (slot->IsVisible()) { - int& index = (slot->IsData() && slot->IsInput()) ? paramIndex : outputIndex; - AZ::EntityId gcSlotId = DisplayScriptCanvasSlot(graphCanvasNodeId, (*slot), group); if (busNode->IsIDRequired() && slot->GetDescriptor() == ScriptCanvas::SlotDescriptors::DataIn()) @@ -731,8 +712,6 @@ namespace ScriptCanvasEditor::Nodes GraphCanvas::TranslationRequestBus::BroadcastResult(details, &GraphCanvas::TranslationRequests::GetDetails, key, details); GraphCanvas::SlotRequestBus::Event(gcSlotId, &GraphCanvas::SlotRequests::SetDetails, details.m_name, details.m_tooltip); } - - ++index; } } diff --git a/Gems/ScriptCanvasDeveloper/Code/Editor/Source/TSGenerateAction.cpp b/Gems/ScriptCanvasDeveloper/Code/Editor/Source/TSGenerateAction.cpp index 56168f6f56..75cf7e5392 100644 --- a/Gems/ScriptCanvasDeveloper/Code/Editor/Source/TSGenerateAction.cpp +++ b/Gems/ScriptCanvasDeveloper/Code/Editor/Source/TSGenerateAction.cpp @@ -11,6 +11,9 @@ #include #include #include +#include +#include +#include #endif #include @@ -34,6 +37,26 @@ namespace ScriptCanvasDeveloperEditor qAction->setShortcut(QAction::tr("Ctrl+Alt+R", "Developer|Reload Text")); QObject::connect(qAction, &QAction::triggered, [mainWindow]() { ReloadText(mainWindow); }); + qAction = mainMenu->addAction(QAction::tr("Dump Translation Database")); + qAction->setAutoRepeat(false); + qAction->setShortcut(QAction::tr("Ctrl+Alt+L", "Developer|Dump Translation Database")); + QObject::connect( + qAction, &QAction::triggered, + [mainWindow]() + { + QString defaultPath = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation); + QString directory = QFileDialog::getExistingDirectory(mainWindow, + QObject::tr("Select output folder for sc_translation.log file"), defaultPath); + if (!directory.isEmpty()) + { + const QString path = QDir::toNativeSeparators(directory + "/sc_translation.log"); + GraphCanvas::TranslationRequestBus::Broadcast(&GraphCanvas::TranslationRequests::DumpDatabase, path.toUtf8().constData()); + QMessageBox::information( + mainWindow, QObject::tr("Finished writing translation database"), + QObject::tr("Translation database written to:
%1").arg(path)); + } + }); + } return qAction; diff --git a/Gems/ScriptCanvasDeveloper/gem.json b/Gems/ScriptCanvasDeveloper/gem.json index 51aed9d9fa..fe1fdea0fc 100644 --- a/Gems/ScriptCanvasDeveloper/gem.json +++ b/Gems/ScriptCanvasDeveloper/gem.json @@ -1,5 +1,5 @@ { - "gem_name": "ScriptCanvasDeveloperGem", + "gem_name": "ScriptCanvasDeveloper", "display_name": "Script Canvas Developer", "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", From 73419387c5235eba97ab11f194e6c1049c43f981 Mon Sep 17 00:00:00 2001 From: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com> Date: Tue, 11 Jan 2022 16:49:59 -0800 Subject: [PATCH 428/948] Check engines_path in get_registered (#6828) Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com> --- scripts/o3de/o3de/manifest.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/o3de/o3de/manifest.py b/scripts/o3de/o3de/manifest.py index 7392637c99..a334109e6a 100644 --- a/scripts/o3de/o3de/manifest.py +++ b/scripts/o3de/o3de/manifest.py @@ -624,6 +624,9 @@ def get_registered(engine_name: str = None, this_engines_name = engine_json_data['engine_name'] if this_engines_name == engine_name: return engine_path + engines_path = json_data.get('engines_path', {}) + if engine_name in engines_path: + return pathlib.Path(engines_path[engine_name]).resolve() elif isinstance(project_name, str): projects = get_all_projects() From 13bc91aa77880b46760e088e7ed3f0adfaad8b16 Mon Sep 17 00:00:00 2001 From: srikappa-amzn <82230713+srikappa-amzn@users.noreply.github.com> Date: Tue, 11 Jan 2022 16:53:46 -0800 Subject: [PATCH 429/948] Split editor entity activation from PrefabSystemComponent (#6787) * Split editor entity activation from PrefabSystemComponent Signed-off-by: srikappa-amzn <82230713+srikappa-amzn@users.noreply.github.com> * Fixed a small typo Signed-off-by: srikappa-amzn <82230713+srikappa-amzn@users.noreply.github.com> * Pass entity activation callback during prefab instantiation for failing tests Signed-off-by: srikappa-amzn <82230713+srikappa-amzn@users.noreply.github.com> --- .../PrefabEditorEntityOwnershipService.cpp | 8 ++- .../Prefab/PrefabSystemComponent.cpp | 12 +++-- .../Prefab/PrefabSystemComponent.h | 10 +++- .../Prefab/PrefabSystemComponentInterface.h | 11 ++++- .../Tests/Prefab/PrefabUndoLinkTests.cpp | 49 ++++++++++++++++--- .../Tests/Prefab/PrefabUndoTests.cpp | 9 +++- 6 files changed, 81 insertions(+), 18 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp index 418d176daa..4a1198fdfe 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp @@ -349,8 +349,12 @@ namespace AzToolsFramework instanceToParentUnder = *m_rootInstance; } - AZStd::unique_ptr instantiatedPrefabInstance = - m_prefabSystemComponent->InstantiatePrefab(filePath, instanceToParentUnder); + AZStd::unique_ptr instantiatedPrefabInstance = m_prefabSystemComponent->InstantiatePrefab( + filePath, instanceToParentUnder, + [this](const EntityList& entities) + { + HandleEntitiesAdded(entities); + }); if (instantiatedPrefabInstance) { diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponent.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponent.cpp index 9936e466c3..98e0144f22 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponent.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponent.cpp @@ -277,7 +277,7 @@ namespace AzToolsFramework } AZStd::unique_ptr PrefabSystemComponent::InstantiatePrefab( - AZ::IO::PathView filePath, InstanceOptionalReference parent) + AZ::IO::PathView filePath, InstanceOptionalReference parent, const InstantiatedEntitiesCallback& instantiatedEntitiesCallback) { // Retrieve the template id for the source prefab filepath Prefab::TemplateId templateId = GetTemplateIdFromFilePath(filePath); @@ -297,11 +297,11 @@ namespace AzToolsFramework return nullptr; } - return InstantiatePrefab(templateId, parent); + return InstantiatePrefab(templateId, parent, instantiatedEntitiesCallback); } AZStd::unique_ptr PrefabSystemComponent::InstantiatePrefab( - TemplateId templateId, InstanceOptionalReference parent) + TemplateId templateId, InstanceOptionalReference parent, const InstantiatedEntitiesCallback& instantiatedEntitiesCallback) { TemplateReference instantiatingTemplate = FindTemplate(templateId); @@ -324,8 +324,10 @@ namespace AzToolsFramework return nullptr; } - AzToolsFramework::EditorEntityContextRequestBus::Broadcast( - &AzToolsFramework::EditorEntityContextRequests::HandleEntitiesAdded, newEntities); + if (instantiatedEntitiesCallback) + { + instantiatedEntitiesCallback(newEntities); + } return newInstance; } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponent.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponent.h index d71065f8fc..b547e9bdd2 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponent.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponent.h @@ -124,19 +124,25 @@ namespace AzToolsFramework * Generates a new Prefab Instance based on the Template whose source is stored in filepath. * @param filePath The path to the prefab source file containing the template being instantiated. * @param parent Reference of the target instance the instantiated instance will be placed under. + * @param instantiatedEntitiesCallback An optional callback that can be used to modify the instantiated entities. * @return A unique_ptr to the newly instantiated instance. Null if operation failed. */ AZStd::unique_ptr InstantiatePrefab( - AZ::IO::PathView filePath, InstanceOptionalReference parent = AZStd::nullopt) override; + AZ::IO::PathView filePath, + InstanceOptionalReference parent = AZStd::nullopt, + const InstantiatedEntitiesCallback& instantiatedEntitiesCallback = {}) override; /** * Generates a new Prefab Instance based on the Template referenced by templateId. * @param templateId The id of the template being instantiated. * @param parent Reference of the target instance the instantiated instance will be placed under. + * @param instantiatedEntitiesCallback An optional callback that can be used to modify the instantiated entities. * @return A unique_ptr to the newly instantiated instance. Null if operation failed. */ AZStd::unique_ptr InstantiatePrefab( - TemplateId templateId, InstanceOptionalReference parent = AZStd::nullopt) override; + TemplateId templateId, + InstanceOptionalReference parent = AZStd::nullopt, + const InstantiatedEntitiesCallback& instantiatedEntitiesCallback = {}) override; /** * Add a new Link into Prefab System Component and create a unique id for it. diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponentInterface.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponentInterface.h index ce75930cb6..d39e868ef4 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponentInterface.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponentInterface.h @@ -27,6 +27,9 @@ namespace AzToolsFramework class PrefabSystemComponentInterface { public: + + using InstantiatedEntitiesCallback = AZStd::function&)>; + AZ_RTTI(PrefabSystemComponentInterface, "{8E95A029-67F9-4F74-895F-DDBFE29516A0}"); virtual TemplateReference FindTemplate(TemplateId id) = 0; @@ -70,9 +73,13 @@ namespace AzToolsFramework virtual void PropagateTemplateChanges(TemplateId templateId, InstanceOptionalConstReference instanceToExclude = AZStd::nullopt) = 0; virtual AZStd::unique_ptr InstantiatePrefab( - AZ::IO::PathView filePath, InstanceOptionalReference parent = AZStd::nullopt) = 0; + AZ::IO::PathView filePath, + InstanceOptionalReference parent = AZStd::nullopt, + const InstantiatedEntitiesCallback& instantiatedEntitiesCallback = {}) = 0; virtual AZStd::unique_ptr InstantiatePrefab( - TemplateId templateId, InstanceOptionalReference parent = AZStd::nullopt) = 0; + TemplateId templateId, + InstanceOptionalReference parent = AZStd::nullopt, + const InstantiatedEntitiesCallback& instantiatedEntitiesCallback = {}) = 0; virtual AZStd::unique_ptr CreatePrefab(const AZStd::vector& entities, AZStd::vector>&& instancesToConsume, AZ::IO::PathView filePath, AZStd::unique_ptr containerEntity = nullptr, InstanceOptionalReference parent = AZStd::nullopt, diff --git a/Code/Framework/AzToolsFramework/Tests/Prefab/PrefabUndoLinkTests.cpp b/Code/Framework/AzToolsFramework/Tests/Prefab/PrefabUndoLinkTests.cpp index 8fafe1f177..442894c101 100644 --- a/Code/Framework/AzToolsFramework/Tests/Prefab/PrefabUndoLinkTests.cpp +++ b/Code/Framework/AzToolsFramework/Tests/Prefab/PrefabUndoLinkTests.cpp @@ -170,7 +170,14 @@ namespace UnitTest m_instanceUpdateExecutorInterface->UpdateTemplateInstancesInQueue(); //instantiate a new nested instance - nestedInstance = m_prefabSystemComponent->InstantiatePrefab(nestedTemplateId); + nestedInstance = m_prefabSystemComponent->InstantiatePrefab( + nestedTemplateId, AZStd::nullopt, + [](const AzToolsFramework::EntityList& entities) + { + AzToolsFramework::EditorEntityContextRequestBus::Broadcast( + &AzToolsFramework::EditorEntityContextRequests::HandleEntitiesAdded, entities); + }); + nestedContainerEntityId = nestedInstance->GetContainerEntityId(); AZ::ComponentApplicationBus::BroadcastResult(nestedContainerEntity, &AZ::ComponentApplicationBus::Events::FindEntity, nestedContainerEntityId); ASSERT_TRUE(nestedContainerEntity); @@ -198,7 +205,13 @@ namespace UnitTest LinkId linkId = undoInstanceLinkNode.GetLinkId(); - rootInstance = m_prefabSystemComponent->InstantiatePrefab(rootTemplateId); + rootInstance = m_prefabSystemComponent->InstantiatePrefab( + rootTemplateId, AZStd::nullopt, + [](const AzToolsFramework::EntityList& entities) + { + AzToolsFramework::EditorEntityContextRequestBus::Broadcast( + &AzToolsFramework::EditorEntityContextRequests::HandleEntitiesAdded, entities); + }); aliases = rootInstance->GetNestedInstanceAliases(nestedTemplateId); //verify the link was created @@ -228,7 +241,13 @@ namespace UnitTest m_instanceUpdateExecutorInterface->UpdateTemplateInstancesInQueue(); //verify the update worked - rootInstance = m_prefabSystemComponent->InstantiatePrefab(rootTemplateId); + rootInstance = m_prefabSystemComponent->InstantiatePrefab( + rootTemplateId, AZStd::nullopt, + [](const AzToolsFramework::EntityList& entities) + { + AzToolsFramework::EditorEntityContextRequestBus::Broadcast( + &AzToolsFramework::EditorEntityContextRequests::HandleEntitiesAdded, entities); + }); aliases = rootInstance->GetNestedInstanceAliases(nestedTemplateId); nestedInstanceRef = rootInstance->FindNestedInstance(aliases[0]); nestedContainerEntityId = nestedInstanceRef->get().GetContainerEntityId(); @@ -244,7 +263,13 @@ namespace UnitTest m_instanceUpdateExecutorInterface->UpdateTemplateInstancesInQueue(); //verify the undo update worked - rootInstance = m_prefabSystemComponent->InstantiatePrefab(rootTemplateId); + rootInstance = m_prefabSystemComponent->InstantiatePrefab( + rootTemplateId, AZStd::nullopt, + [](const AzToolsFramework::EntityList& entities) + { + AzToolsFramework::EditorEntityContextRequestBus::Broadcast( + &AzToolsFramework::EditorEntityContextRequests::HandleEntitiesAdded, entities); + }); aliases = rootInstance->GetNestedInstanceAliases(nestedTemplateId); nestedInstanceRef = rootInstance->FindNestedInstance(aliases[0]); nestedContainerEntityId = nestedInstanceRef->get().GetContainerEntityId(); @@ -259,7 +284,13 @@ namespace UnitTest undoLinkUpdateNode.Redo(); m_instanceUpdateExecutorInterface->UpdateTemplateInstancesInQueue(); - rootInstance = m_prefabSystemComponent->InstantiatePrefab(rootTemplateId); + rootInstance = m_prefabSystemComponent->InstantiatePrefab( + rootTemplateId, AZStd::nullopt, + [](const AzToolsFramework::EntityList& entities) + { + AzToolsFramework::EditorEntityContextRequestBus::Broadcast( + &AzToolsFramework::EditorEntityContextRequests::HandleEntitiesAdded, entities); + }); aliases = rootInstance->GetNestedInstanceAliases(nestedTemplateId); nestedInstanceRef = rootInstance->FindNestedInstance(aliases[0]); nestedContainerEntityId = nestedInstanceRef->get().GetContainerEntityId(); @@ -287,7 +318,13 @@ namespace UnitTest m_instanceUpdateExecutorInterface->UpdateTemplateInstancesInQueue(); //verify the update worked - rootInstance = m_prefabSystemComponent->InstantiatePrefab(rootTemplateId); + rootInstance = m_prefabSystemComponent->InstantiatePrefab( + rootTemplateId, AZStd::nullopt, + [](const AzToolsFramework::EntityList& entities) + { + AzToolsFramework::EditorEntityContextRequestBus::Broadcast( + &AzToolsFramework::EditorEntityContextRequests::HandleEntitiesAdded, entities); + }); aliases = rootInstance->GetNestedInstanceAliases(nestedTemplateId); nestedInstanceRef = rootInstance->FindNestedInstance(aliases[0]); nestedContainerEntityId = nestedInstanceRef->get().GetContainerEntityId(); diff --git a/Code/Framework/AzToolsFramework/Tests/Prefab/PrefabUndoTests.cpp b/Code/Framework/AzToolsFramework/Tests/Prefab/PrefabUndoTests.cpp index 5c68b30e8f..cfba41696c 100644 --- a/Code/Framework/AzToolsFramework/Tests/Prefab/PrefabUndoTests.cpp +++ b/Code/Framework/AzToolsFramework/Tests/Prefab/PrefabUndoTests.cpp @@ -79,7 +79,14 @@ namespace UnitTest // verify template updated correctly //instantiate second instance for checking if propogation works - AZStd::unique_ptr secondInstance = m_prefabSystemComponent->InstantiatePrefab(templateId); + AZStd::unique_ptr secondInstance = m_prefabSystemComponent->InstantiatePrefab( + templateId, AZStd::nullopt, + [](const AzToolsFramework::EntityList& entities) + { + AzToolsFramework::EditorEntityContextRequestBus::Broadcast( + &AzToolsFramework::EditorEntityContextRequests::HandleEntitiesAdded, entities); + }); + ASSERT_TRUE(secondInstance); ValidateInstanceEntitiesActive(*secondInstance); From b9787fb2b3141aced65e7d00676b35a6e7ea52de Mon Sep 17 00:00:00 2001 From: Vincent Liu <5900509+onecent1101@users.noreply.github.com> Date: Tue, 11 Jan 2022 17:24:33 -0800 Subject: [PATCH 430/948] [Mac] Update to use AWSNativeSDK 1.9.50 (#6797) --- Gems/AWSCore/Code/Platform/Mac/AWSCore_Traits_Mac.h | 2 +- cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gems/AWSCore/Code/Platform/Mac/AWSCore_Traits_Mac.h b/Gems/AWSCore/Code/Platform/Mac/AWSCore_Traits_Mac.h index d7b1f32461..2cacfb0d34 100644 --- a/Gems/AWSCore/Code/Platform/Mac/AWSCore_Traits_Mac.h +++ b/Gems/AWSCore/Code/Platform/Mac/AWSCore_Traits_Mac.h @@ -7,4 +7,4 @@ */ #pragma once -#define AWSCORE_BACKWARD_INCOMPATIBLE_CHANGE 0 +#define AWSCORE_BACKWARD_INCOMPATIBLE_CHANGE 1 diff --git a/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake b/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake index 35a6b87c6c..ea324a5cb7 100644 --- a/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake +++ b/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake @@ -25,7 +25,7 @@ ly_associate_package(PACKAGE_NAME DirectXShaderCompilerDxc-1.6.2104-o3de-rev3-ma ly_associate_package(PACKAGE_NAME SPIRVCross-2021.04.29-rev1-mac TARGETS SPIRVCross PACKAGE_HASH 78c6376ed2fd195b9b1f5fb2b56e5267a32c3aa21fb399e905308de470eb4515) ly_associate_package(PACKAGE_NAME tiff-4.2.0.15-rev3-mac TARGETS TIFF PACKAGE_HASH c2615ccdadcc0e1d6c5ed61e5965c4d3a82193d206591b79b805c3b3ff35a4bf) ly_associate_package(PACKAGE_NAME freetype-2.10.4.16-mac TARGETS freetype PACKAGE_HASH f159b346ac3251fb29cb8dd5f805c99b0015ed7fdb3887f656945ca701a61d0d) -ly_associate_package(PACKAGE_NAME AWSNativeSDK-1.7.167-rev6-mac TARGETS AWSNativeSDK PACKAGE_HASH 9b058376dec042ace98e198e902b399739adeb9e9398a6c210171fb530164577) +ly_associate_package(PACKAGE_NAME AWSNativeSDK-1.9.50-rev1-mac TARGETS AWSNativeSDK PACKAGE_HASH 6c27a49376870c606144e4639e15867f9db7e4a1ee5f1a726f152d3bd8459966) ly_associate_package(PACKAGE_NAME Lua-5.3.5-rev6-mac TARGETS Lua PACKAGE_HASH b9079fd35634774c9269028447562c6b712dbc83b9c64975c095fd423ff04c08) ly_associate_package(PACKAGE_NAME PhysX-4.1.2.29882248-rev5-mac TARGETS PhysX PACKAGE_HASH 83940b3876115db82cd8ffcb9e902278e75846d6ad94a41e135b155cee1ee186) ly_associate_package(PACKAGE_NAME mcpp-2.7.2_az.2-rev1-mac TARGETS mcpp PACKAGE_HASH be9558905c9c49179ef3d7d84f0a5472415acdf7fe2d76eb060d9431723ddf2e) From acec79fe2e3404e31262aa13362eced3eb3ec9b5 Mon Sep 17 00:00:00 2001 From: tjmgd <92784061+tjmgd@users.noreply.github.com> Date: Wed, 12 Jan 2022 11:57:54 +0000 Subject: [PATCH 431/948] Node name change cursor missing (#6721) Signed-off-by: T.J. McGrath-Daly --- .../Editor/PropertyWidgets/AnimGraphNodeNameHandler.cpp | 6 ++++++ .../Editor/PropertyWidgets/AnimGraphNodeNameHandler.h | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/AnimGraphNodeNameHandler.cpp b/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/AnimGraphNodeNameHandler.cpp index 754acdaf1c..854825b45c 100644 --- a/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/AnimGraphNodeNameHandler.cpp +++ b/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/AnimGraphNodeNameHandler.cpp @@ -38,6 +38,12 @@ namespace EMotionFX m_node = node; } + void AnimGraphNodeNameLineEdit::focusInEvent([[maybe_unused]] QFocusEvent* event) + { + selectAll(); + QLineEdit::focusInEvent(event); + } + //--------------------------------------------------------------------------------------------------------------------------------------------------------- AnimGraphNodeNameHandler::AnimGraphNodeNameHandler() diff --git a/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/AnimGraphNodeNameHandler.h b/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/AnimGraphNodeNameHandler.h index ad6f0116ca..8da69f7437 100644 --- a/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/AnimGraphNodeNameHandler.h +++ b/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/AnimGraphNodeNameHandler.h @@ -29,7 +29,8 @@ namespace EMotionFX ~AnimGraphNodeNameLineEdit() = default; void SetNode(AnimGraphNode* node); - + private: + void focusInEvent(QFocusEvent* event) override; private: AnimGraphNode* m_node; }; From f51c845cbb57c1d46c587ecbd318cd3bb9ee9aac Mon Sep 17 00:00:00 2001 From: tjmgd <92784061+tjmgd@users.noreply.github.com> Date: Wed, 12 Jan 2022 13:42:12 +0000 Subject: [PATCH 432/948] Fix: AnimAudioComponentRequestBus canvas script function failure (#6658) Signed-off-by: T.J. McGrath-Daly Co-authored-by: Tobias Alexander Franke --- .../Code/Source/Integration/Components/AnimAudioComponent.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Gems/EMotionFX/Code/Source/Integration/Components/AnimAudioComponent.cpp b/Gems/EMotionFX/Code/Source/Integration/Components/AnimAudioComponent.cpp index eac3705300..7cfea90ae2 100644 --- a/Gems/EMotionFX/Code/Source/Integration/Components/AnimAudioComponent.cpp +++ b/Gems/EMotionFX/Code/Source/Integration/Components/AnimAudioComponent.cpp @@ -405,6 +405,7 @@ namespace EMotionFX ActorNotificationBus::Handler::BusConnect(GetEntityId()); AnimAudioComponentNotificationBus::Handler::BusConnect(GetEntityId()); + AnimAudioComponentRequestBus::Handler::BusConnect(GetEntityId()); } void AnimAudioComponent::Deactivate() @@ -421,6 +422,7 @@ namespace EMotionFX ActorNotificationBus::Handler::BusDisconnect(GetEntityId()); AnimAudioComponentNotificationBus::Handler::BusDisconnect(GetEntityId()); + AnimAudioComponentRequestBus::Handler::BusDisconnect(GetEntityId()); } void AnimAudioComponent::OnTick(float deltaTime, AZ::ScriptTimePoint time) From ffa9cc3a66e7a6df95b18b19d3542370c6eed307 Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Wed, 12 Jan 2022 08:46:10 -0600 Subject: [PATCH 433/948] Unit tests and benchmarks for GetValues() (#6823) * Benchmarks and tests for Image and Constant GetValues Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Verify GetValues for Perlin and Random Gradients Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Standardized the assert format for GetValues(). Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * More GetValues unit tests and test cleanup Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Fixed typos Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * GetValues() unit tests for surface gradients. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Benchmarks for ShapeAreaFalloff Gradient Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Added benchmarks for all remaining gradients and cleaned up the helper methods. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Renamed class for better report formatting. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Added missing Mocks dependencies for the Editor tests. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- Gems/GradientSignal/Code/CMakeLists.txt | 3 + .../Ebuses/GradientRequestBus.h | 27 +- .../Include/GradientSignal/GradientSampler.h | 4 +- .../Code/Tests/GradientSignalBenchmarks.cpp | 389 ++++++++++----- .../Tests/GradientSignalGetValuesTests.cpp | 182 +++++++ .../Code/Tests/GradientSignalImageTests.cpp | 1 - .../Tests/GradientSignalReferencesTests.cpp | 16 +- .../Tests/GradientSignalServicesTests.cpp | 9 +- .../Code/Tests/GradientSignalTestFixtures.cpp | 444 ++++++++++++------ .../Code/Tests/GradientSignalTestFixtures.h | 59 ++- .../Code/gradientsignal_tests_files.cmake | 1 + .../Source/Shape/ReferenceShapeComponent.cpp | 16 +- .../TerrainHeightGradientListComponent.cpp | 2 +- .../Components/AreaBlenderComponent.cpp | 10 +- 14 files changed, 842 insertions(+), 321 deletions(-) create mode 100644 Gems/GradientSignal/Code/Tests/GradientSignalGetValuesTests.cpp diff --git a/Gems/GradientSignal/Code/CMakeLists.txt b/Gems/GradientSignal/Code/CMakeLists.txt index 657a88db47..d4cf666630 100644 --- a/Gems/GradientSignal/Code/CMakeLists.txt +++ b/Gems/GradientSignal/Code/CMakeLists.txt @@ -141,6 +141,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) AZ::AzTestShared Gem::GradientSignal.Static Gem::LmbrCentral + Gem::LmbrCentral.Mocks Gem::GradientSignal.Mocks ) @@ -160,6 +161,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) Gem::GradientSignal.Tests.Static Gem::GradientSignal.Static Gem::LmbrCentral + Gem::LmbrCentral.Mocks Gem::GradientSignal.Mocks ) ly_add_googletest( @@ -190,6 +192,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) Gem::GradientSignal.Static Gem::GradientSignal.Editor.Static Gem::LmbrCentral.Editor + Gem::LmbrCentral.Mocks ) ly_add_googletest( NAME Gem::GradientSignal.Editor.Tests diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientRequestBus.h b/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientRequestBus.h index d0fcabf746..3a215c5b5d 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientRequestBus.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientRequestBus.h @@ -62,22 +62,21 @@ namespace GradientSignal // Reference implementation of GetValues for any gradients that don't have their own optimized implementations. // This is 10%-60% faster than calling GetValue via EBus many times due to the per-call EBus overhead. - AZ_Assert( - positions.size() == outValues.size(), "input and output lists are different sizes (%zu vs %zu).", - positions.size(), outValues.size()); + if (positions.size() != outValues.size()) + { + AZ_Assert(false, "input and output lists are different sizes (%zu vs %zu).", positions.size(), outValues.size()); + return; + } - if (positions.size() == outValues.size()) + GradientSampleParams sampleParams; + for (size_t index = 0; index < positions.size(); index++) { - GradientSampleParams sampleParams; - for (size_t index = 0; index < positions.size(); index++) - { - sampleParams.m_position = positions[index]; - - // The const_cast is necessary for now since array_view currently only supports const entries. - // If/when array_view is fixed to support non-const, or AZStd::span gets created, the const_cast can get removed. - auto& outValue = const_cast(outValues[index]); - outValue = GetValue(sampleParams); - } + sampleParams.m_position = positions[index]; + + // The const_cast is necessary for now since array_view currently only supports const entries. + // If/when array_view is fixed to support non-const, or AZStd::span gets created, the const_cast can get removed. + auto& outValue = const_cast(outValues[index]); + outValue = GetValue(sampleParams); } } diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h b/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h index 454be938a5..a2e1849590 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h @@ -120,7 +120,7 @@ namespace GradientSignal if (m_isRequestInProgress) { - AZ_ErrorOnce("GradientSignal", !m_isRequestInProgress, "Detected cyclic dependences with gradient entity references"); + AZ_ErrorOnce("GradientSignal", !m_isRequestInProgress, "Detected cyclic dependencies with gradient entity references"); } else { @@ -197,7 +197,7 @@ namespace GradientSignal if (m_isRequestInProgress) { - AZ_ErrorOnce("GradientSignal", !m_isRequestInProgress, "Detected cyclic dependences with gradient entity references"); + AZ_ErrorOnce("GradientSignal", !m_isRequestInProgress, "Detected cyclic dependencies with gradient entity references"); ClearOutputValues(outValues); return; } diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalBenchmarks.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalBenchmarks.cpp index 6383b627c1..bd4ccf5205 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalBenchmarks.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalBenchmarks.cpp @@ -16,162 +16,337 @@ #include #include -#include -#include -#include -#include - namespace UnitTest { - BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_ImageGradientEBusGetValue)(benchmark::State& state) + class GradientGetValues : public GradientSignalBenchmarkFixture { - CreateTestImageGradient(m_testEntity.get()); - RunEBusGetValueBenchmark(state); - } - - BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_ImageGradientEBusGetValue) - ->Args({ 1024, 1024 }) - ->Args({ 2048, 2048 }) - ->Args({ 4096, 4096 }) + public: + // We use an enum to list out the different types of GetValue() benchmarks to run so that way we can condense our test cases + // to just take the value in as a benchmark argument and switch on it. Otherwise, we would need to write a different benchmark + // function for each test case for each gradient. + enum GetValuePermutation : int64_t + { + EBUS_GET_VALUE, + EBUS_GET_VALUES, + SAMPLER_GET_VALUE, + SAMPLER_GET_VALUES, + }; + + // Create an arbitrary size shape for creating our gradients for benchmark runs. + const float TestShapeHalfBounds = 128.0f; + + void FillQueryPositions(AZStd::vector& positions, float height, float width) + { + size_t index = 0; + for (float y = 0.0f; y < height; y += 1.0f) + { + for (float x = 0.0f; x < width; x += 1.0f) + { + positions[index++] = AZ::Vector3(x, y, 0.0f); + } + } + } + + void RunEBusGetValueBenchmark(benchmark::State& state, const AZ::EntityId& gradientId, int64_t queryRange) + { + AZ_PROFILE_FUNCTION(Entity); + + GradientSignal::GradientSampleParams params; + + // Get the height and width ranges for querying from our benchmark parameters + const float height = aznumeric_cast(queryRange); + const float width = aznumeric_cast(queryRange); + + // Call GetValue() on the EBus for every height and width in our ranges. + for (auto _ : state) + { + for (float y = 0.0f; y < height; y += 1.0f) + { + for (float x = 0.0f; x < width; x += 1.0f) + { + float value = 0.0f; + params.m_position = AZ::Vector3(x, y, 0.0f); + GradientSignal::GradientRequestBus::EventResult( + value, gradientId, &GradientSignal::GradientRequestBus::Events::GetValue, params); + benchmark::DoNotOptimize(value); + } + } + } + } + + void RunEBusGetValuesBenchmark(benchmark::State& state, const AZ::EntityId& gradientId, int64_t queryRange) + { + AZ_PROFILE_FUNCTION(Entity); + + // Get the height and width ranges for querying from our benchmark parameters + float height = aznumeric_cast(queryRange); + float width = aznumeric_cast(queryRange); + int64_t totalQueryPoints = queryRange * queryRange; + + // Call GetValues() for every height and width in our ranges. + for (auto _ : state) + { + // Set up our vector of query positions. This is done inside the benchmark timing since we're counting the work to create + // each query position in the single GetValue() call benchmarks, and will make the timing more directly comparable. + AZStd::vector positions(totalQueryPoints); + FillQueryPositions(positions, height, width); + + // Query and get the results. + AZStd::vector results(totalQueryPoints); + GradientSignal::GradientRequestBus::Event( + gradientId, &GradientSignal::GradientRequestBus::Events::GetValues, positions, results); + } + } + + void RunSamplerGetValueBenchmark(benchmark::State& state, const AZ::EntityId& gradientId, int64_t queryRange) + { + AZ_PROFILE_FUNCTION(Entity); + + // Create a gradient sampler to use for querying our gradient. + GradientSignal::GradientSampler gradientSampler; + gradientSampler.m_gradientId = gradientId; + + // Get the height and width ranges for querying from our benchmark parameters + const float height = aznumeric_cast(queryRange); + const float width = aznumeric_cast(queryRange); + + // Call GetValue() through the GradientSampler for every height and width in our ranges. + for (auto _ : state) + { + for (float y = 0.0f; y < height; y += 1.0f) + { + for (float x = 0.0f; x < width; x += 1.0f) + { + GradientSignal::GradientSampleParams params; + params.m_position = AZ::Vector3(x, y, 0.0f); + float value = gradientSampler.GetValue(params); + benchmark::DoNotOptimize(value); + } + } + } + } + + void RunSamplerGetValuesBenchmark(benchmark::State& state, const AZ::EntityId& gradientId, int64_t queryRange) + { + AZ_PROFILE_FUNCTION(Entity); + + // Create a gradient sampler to use for querying our gradient. + GradientSignal::GradientSampler gradientSampler; + gradientSampler.m_gradientId = gradientId; + + // Get the height and width ranges for querying from our benchmark parameters + const float height = aznumeric_cast(queryRange); + const float width = aznumeric_cast(queryRange); + const int64_t totalQueryPoints = queryRange * queryRange; + + // Call GetValues() through the GradientSampler for every height and width in our ranges. + for (auto _ : state) + { + // Set up our vector of query positions. This is done inside the benchmark timing since we're counting the work to create + // each query position in the single GetValue() call benchmarks, and will make the timing more directly comparable. + AZStd::vector positions(totalQueryPoints); + FillQueryPositions(positions, height, width); + + // Query and get the results. + AZStd::vector results(totalQueryPoints); + gradientSampler.GetValues(positions, results); + } + } + + void RunGetValueOrGetValuesBenchmark(benchmark::State& state, const AZ::EntityId& gradientId) + { + switch (state.range(0)) + { + case GetValuePermutation::EBUS_GET_VALUE: + RunEBusGetValueBenchmark(state, gradientId, state.range(1)); + break; + case GetValuePermutation::EBUS_GET_VALUES: + RunEBusGetValuesBenchmark(state, gradientId, state.range(1)); + break; + case GetValuePermutation::SAMPLER_GET_VALUE: + RunSamplerGetValueBenchmark(state, gradientId, state.range(1)); + break; + case GetValuePermutation::SAMPLER_GET_VALUES: + RunSamplerGetValuesBenchmark(state, gradientId, state.range(1)); + break; + default: + AZ_Assert(false, "Benchmark permutation type not supported."); + } + } + }; + +// Because there's no good way to label different enums in the output results (they just appear as integer values), we work around it by +// registering one set of benchmark runs for each enum value and use ArgNames() to give it a friendly name in the results. +#define GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(Fixture, Func) \ + BENCHMARK_REGISTER_F(Fixture, Func) \ + ->Args({ GradientGetValues::GetValuePermutation::EBUS_GET_VALUE, 1024 }) \ + ->Args({ GradientGetValues::GetValuePermutation::EBUS_GET_VALUE, 2048 }) \ + ->Args({ GradientGetValues::GetValuePermutation::EBUS_GET_VALUE, 4096 }) \ + ->ArgNames({ "EbusGetValue", "size" }) \ + ->Unit(::benchmark::kMillisecond); \ + BENCHMARK_REGISTER_F(Fixture, Func) \ + ->Args({ GradientGetValues::GetValuePermutation::EBUS_GET_VALUES, 1024 }) \ + ->Args({ GradientGetValues::GetValuePermutation::EBUS_GET_VALUES, 2048 }) \ + ->Args({ GradientGetValues::GetValuePermutation::EBUS_GET_VALUES, 4096 }) \ + ->ArgNames({ "EbusGetValues", "size" }) \ + ->Unit(::benchmark::kMillisecond); \ + BENCHMARK_REGISTER_F(Fixture, Func) \ + ->Args({ GradientGetValues::GetValuePermutation::SAMPLER_GET_VALUE, 1024 }) \ + ->Args({ GradientGetValues::GetValuePermutation::SAMPLER_GET_VALUE, 2048 }) \ + ->Args({ GradientGetValues::GetValuePermutation::SAMPLER_GET_VALUE, 4096 }) \ + ->ArgNames({ "SamplerGetValue", "size" }) \ + ->Unit(::benchmark::kMillisecond); \ + BENCHMARK_REGISTER_F(Fixture, Func) \ + ->Args({ GradientGetValues::GetValuePermutation::SAMPLER_GET_VALUES, 1024 }) \ + ->Args({ GradientGetValues::GetValuePermutation::SAMPLER_GET_VALUES, 2048 }) \ + ->Args({ GradientGetValues::GetValuePermutation::SAMPLER_GET_VALUES, 4096 }) \ + ->ArgNames({ "SamplerGetValues", "size" }) \ ->Unit(::benchmark::kMillisecond); - BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_ImageGradientEBusGetValues)(benchmark::State& state) + // -------------------------------------------------------------------------------------- + // Base Gradients + + BENCHMARK_DEFINE_F(GradientGetValues, BM_ConstantGradient)(benchmark::State& state) { - CreateTestImageGradient(m_testEntity.get()); - RunEBusGetValuesBenchmark(state); + auto entity = BuildTestConstantGradient(TestShapeHalfBounds); + RunGetValueOrGetValuesBenchmark(state, entity->GetId()); } - BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_ImageGradientEBusGetValues) - ->Args({ 1024, 1024 }) - ->Args({ 2048, 2048 }) - ->Args({ 4096, 4096 }) - ->Unit(::benchmark::kMillisecond); - - BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_ImageGradientSamplerGetValue)(benchmark::State& state) + BENCHMARK_DEFINE_F(GradientGetValues, BM_ImageGradient)(benchmark::State& state) { - CreateTestImageGradient(m_testEntity.get()); - RunSamplerGetValueBenchmark(state); + auto entity = BuildTestImageGradient(TestShapeHalfBounds); + RunGetValueOrGetValuesBenchmark(state, entity->GetId()); } - BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_ImageGradientSamplerGetValue) - ->Args({ 1024, 1024 }) - ->Args({ 2048, 2048 }) - ->Args({ 4096, 4096 }) - ->Unit(::benchmark::kMillisecond); - BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_ImageGradientSamplerGetValues)(benchmark::State& state) + BENCHMARK_DEFINE_F(GradientGetValues, BM_PerlinGradient)(benchmark::State& state) { - CreateTestImageGradient(m_testEntity.get()); - RunSamplerGetValuesBenchmark(state); + auto entity = BuildTestPerlinGradient(TestShapeHalfBounds); + RunGetValueOrGetValuesBenchmark(state, entity->GetId()); } - BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_ImageGradientSamplerGetValues) - ->Args({ 1024, 1024 }) - ->Args({ 2048, 2048 }) - ->Args({ 4096, 4096 }) - ->Unit(::benchmark::kMillisecond); - - BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_PerlinGradientEBusGetValue)(benchmark::State& state) + BENCHMARK_DEFINE_F(GradientGetValues, BM_RandomGradient)(benchmark::State& state) { - CreateTestPerlinGradient(m_testEntity.get()); - RunEBusGetValueBenchmark(state); + auto entity = BuildTestRandomGradient(TestShapeHalfBounds); + RunGetValueOrGetValuesBenchmark(state, entity->GetId()); } - BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_PerlinGradientEBusGetValue) - ->Args({ 1024, 1024 }) - ->Args({ 2048, 2048 }) - ->Args({ 4096, 4096 }) - ->Unit(::benchmark::kMillisecond); - - BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_PerlinGradientEBusGetValues)(benchmark::State& state) + BENCHMARK_DEFINE_F(GradientGetValues, BM_ShapeAreaFalloffGradient)(benchmark::State& state) { - CreateTestPerlinGradient(m_testEntity.get()); - RunEBusGetValuesBenchmark(state); + auto entity = BuildTestShapeAreaFalloffGradient(TestShapeHalfBounds); + RunGetValueOrGetValuesBenchmark(state, entity->GetId()); } - BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_PerlinGradientEBusGetValues) - ->Args({ 1024, 1024 }) - ->Args({ 2048, 2048 }) - ->Args({ 4096, 4096 }) - ->Unit(::benchmark::kMillisecond); + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(GradientGetValues, BM_ConstantGradient); + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(GradientGetValues, BM_ImageGradient); + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(GradientGetValues, BM_PerlinGradient); + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(GradientGetValues, BM_RandomGradient); + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(GradientGetValues, BM_ShapeAreaFalloffGradient); + + // -------------------------------------------------------------------------------------- + // Gradient Modifiers - BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_PerlinGradientSamplerGetValue)(benchmark::State& state) + BENCHMARK_DEFINE_F(GradientGetValues, BM_DitherGradient)(benchmark::State& state) { - CreateTestPerlinGradient(m_testEntity.get()); - RunSamplerGetValueBenchmark(state); + auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); + auto entity = BuildTestDitherGradient(TestShapeHalfBounds, baseEntity->GetId()); + RunGetValueOrGetValuesBenchmark(state, entity->GetId()); } - BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_PerlinGradientSamplerGetValue) - ->Args({ 1024, 1024 }) - ->Args({ 2048, 2048 }) - ->Args({ 4096, 4096 }) - ->Unit(::benchmark::kMillisecond); - - BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_PerlinGradientSamplerGetValues)(benchmark::State& state) + BENCHMARK_DEFINE_F(GradientGetValues, BM_InvertGradient)(benchmark::State& state) { - CreateTestPerlinGradient(m_testEntity.get()); - RunSamplerGetValuesBenchmark(state); + auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); + auto entity = BuildTestDitherGradient(TestShapeHalfBounds, baseEntity->GetId()); + RunGetValueOrGetValuesBenchmark(state, entity->GetId()); } - BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_PerlinGradientSamplerGetValues) - ->Args({ 1024, 1024 }) - ->Args({ 2048, 2048 }) - ->Args({ 4096, 4096 }) - ->Unit(::benchmark::kMillisecond); + BENCHMARK_DEFINE_F(GradientGetValues, BM_LevelsGradient)(benchmark::State& state) + { + auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); + auto entity = BuildTestLevelsGradient(TestShapeHalfBounds, baseEntity->GetId()); + RunGetValueOrGetValuesBenchmark(state, entity->GetId()); + } - BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_RandomGradientEBusGetValue)(benchmark::State& state) + BENCHMARK_DEFINE_F(GradientGetValues, BM_MixedGradient)(benchmark::State& state) { - CreateTestRandomGradient(m_testEntity.get()); - RunEBusGetValueBenchmark(state); + auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); + auto mixedEntity = BuildTestConstantGradient(TestShapeHalfBounds); + auto entity = BuildTestMixedGradient(TestShapeHalfBounds, baseEntity->GetId(), mixedEntity->GetId()); + RunGetValueOrGetValuesBenchmark(state, entity->GetId()); } - BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_RandomGradientEBusGetValue) - ->Args({ 1024, 1024 }) - ->Args({ 2048, 2048 }) - ->Args({ 4096, 4096 }) - ->Unit(::benchmark::kMillisecond); + BENCHMARK_DEFINE_F(GradientGetValues, BM_PosterizeGradient)(benchmark::State& state) + { + auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); + auto entity = BuildTestPosterizeGradient(TestShapeHalfBounds, baseEntity->GetId()); + RunGetValueOrGetValuesBenchmark(state, entity->GetId()); + } - BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_RandomGradientEBusGetValues)(benchmark::State& state) + BENCHMARK_DEFINE_F(GradientGetValues, BM_ReferenceGradient)(benchmark::State& state) { - CreateTestRandomGradient(m_testEntity.get()); - RunEBusGetValuesBenchmark(state); + auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); + auto entity = BuildTestReferenceGradient(TestShapeHalfBounds, baseEntity->GetId()); + RunGetValueOrGetValuesBenchmark(state, entity->GetId()); } - BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_RandomGradientEBusGetValues) - ->Args({ 1024, 1024 }) - ->Args({ 2048, 2048 }) - ->Args({ 4096, 4096 }) - ->Unit(::benchmark::kMillisecond); + BENCHMARK_DEFINE_F(GradientGetValues, BM_SmoothStepGradient)(benchmark::State& state) + { + auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); + auto entity = BuildTestSmoothStepGradient(TestShapeHalfBounds, baseEntity->GetId()); + RunGetValueOrGetValuesBenchmark(state, entity->GetId()); + } - BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_RandomGradientSamplerGetValue)(benchmark::State& state) + BENCHMARK_DEFINE_F(GradientGetValues, BM_ThresholdGradient)(benchmark::State& state) { - CreateTestRandomGradient(m_testEntity.get()); - RunSamplerGetValueBenchmark(state); + auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); + auto entity = BuildTestThresholdGradient(TestShapeHalfBounds, baseEntity->GetId()); + RunGetValueOrGetValuesBenchmark(state, entity->GetId()); } - BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_RandomGradientSamplerGetValue) - ->Args({ 1024, 1024 }) - ->Args({ 2048, 2048 }) - ->Args({ 4096, 4096 }) - ->Unit(::benchmark::kMillisecond); + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(GradientGetValues, BM_DitherGradient); + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(GradientGetValues, BM_InvertGradient); + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(GradientGetValues, BM_LevelsGradient); + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(GradientGetValues, BM_MixedGradient); + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(GradientGetValues, BM_PosterizeGradient); + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(GradientGetValues, BM_ReferenceGradient); + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(GradientGetValues, BM_SmoothStepGradient); + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(GradientGetValues, BM_ThresholdGradient); + + // -------------------------------------------------------------------------------------- + // Surface Gradients - BENCHMARK_DEFINE_F(GradientSignalBenchmarkFixture, BM_RandomGradientSamplerGetValues)(benchmark::State& state) + BENCHMARK_DEFINE_F(GradientGetValues, BM_SurfaceAltitudeGradient)(benchmark::State& state) { - CreateTestRandomGradient(m_testEntity.get()); - RunSamplerGetValuesBenchmark(state); + auto mockSurfaceDataSystem = + CreateMockSurfaceDataSystem(AZ::Aabb::CreateFromMinMax(AZ::Vector3(-TestShapeHalfBounds), AZ::Vector3(TestShapeHalfBounds))); + + auto entity = BuildTestSurfaceAltitudeGradient(TestShapeHalfBounds); + RunGetValueOrGetValuesBenchmark(state, entity->GetId()); } - BENCHMARK_REGISTER_F(GradientSignalBenchmarkFixture, BM_RandomGradientSamplerGetValues) - ->Args({ 1024, 1024 }) - ->Args({ 2048, 2048 }) - ->Args({ 4096, 4096 }) - ->Unit(::benchmark::kMillisecond); + BENCHMARK_DEFINE_F(GradientGetValues, BM_SurfaceMaskGradient)(benchmark::State& state) + { + auto mockSurfaceDataSystem = + CreateMockSurfaceDataSystem(AZ::Aabb::CreateFromMinMax(AZ::Vector3(-TestShapeHalfBounds), AZ::Vector3(TestShapeHalfBounds))); -#endif + auto entity = BuildTestSurfaceMaskGradient(TestShapeHalfBounds); + RunGetValueOrGetValuesBenchmark(state, entity->GetId()); + } + BENCHMARK_DEFINE_F(GradientGetValues, BM_SurfaceSlopeGradient)(benchmark::State& state) + { + auto mockSurfaceDataSystem = + CreateMockSurfaceDataSystem(AZ::Aabb::CreateFromMinMax(AZ::Vector3(-TestShapeHalfBounds), AZ::Vector3(TestShapeHalfBounds))); + auto entity = BuildTestSurfaceSlopeGradient(TestShapeHalfBounds); + RunGetValueOrGetValuesBenchmark(state, entity->GetId()); + } + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(GradientGetValues, BM_SurfaceAltitudeGradient); + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(GradientGetValues, BM_SurfaceMaskGradient); + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(GradientGetValues, BM_SurfaceSlopeGradient); +#endif } diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalGetValuesTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalGetValuesTests.cpp new file mode 100644 index 0000000000..5504fa5b45 --- /dev/null +++ b/Gems/GradientSignal/Code/Tests/GradientSignalGetValuesTests.cpp @@ -0,0 +1,182 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + + +#include +#include + +namespace UnitTest +{ + struct GradientSignalGetValuesTestsFixture + : public GradientSignalTest + { + // Create an arbitrary size shape for comparing values within. It should be large enough that we detect any value anomalies + // but small enough that the tests run quickly. + const float TestShapeHalfBounds = 128.0f; + + void CompareGetValueAndGetValues(AZ::EntityId gradientEntityId) + { + // Create a gradient sampler and run through a series of points to see if they match expectations. + + const AZ::Aabb queryRegion = AZ::Aabb::CreateFromMinMax(AZ::Vector3(-TestShapeHalfBounds), AZ::Vector3(TestShapeHalfBounds)); + const AZ::Vector2 stepSize(1.0f, 1.0f); + + GradientSignal::GradientSampler gradientSampler; + gradientSampler.m_gradientId = gradientEntityId; + + const size_t numSamplesX = aznumeric_cast(ceil(queryRegion.GetExtents().GetX() / stepSize.GetX())); + const size_t numSamplesY = aznumeric_cast(ceil(queryRegion.GetExtents().GetY() / stepSize.GetY())); + + // Build up the list of positions to query. + AZStd::vector positions(numSamplesX * numSamplesY); + size_t index = 0; + for (size_t yIndex = 0; yIndex < numSamplesY; yIndex++) + { + float y = queryRegion.GetMin().GetY() + (stepSize.GetY() * yIndex); + for (size_t xIndex = 0; xIndex < numSamplesX; xIndex++) + { + float x = queryRegion.GetMin().GetX() + (stepSize.GetX() * xIndex); + positions[index++] = AZ::Vector3(x, y, 0.0f); + } + } + + // Get the results from GetValues + AZStd::vector results(numSamplesX * numSamplesY); + gradientSampler.GetValues(positions, results); + + // For each position, call GetValue and verify that the values match. + for (size_t positionIndex = 0; positionIndex < positions.size(); positionIndex++) + { + GradientSignal::GradientSampleParams params; + params.m_position = positions[positionIndex]; + float value = gradientSampler.GetValue(params); + + // We use ASSERT_EQ instead of EXPECT_EQ because if one value doesn't match, they probably all won't, so there's no reason + // to keep running and printing failures for every value. + ASSERT_EQ(value, results[positionIndex]); + } + } + }; + + TEST_F(GradientSignalGetValuesTestsFixture, ImageGradientComponent_VerifyGetValueAndGetValuesMatch) + { + auto entity = BuildTestImageGradient(TestShapeHalfBounds); + CompareGetValueAndGetValues(entity->GetId()); + } + + TEST_F(GradientSignalGetValuesTestsFixture, PerlinGradientComponent_VerifyGetValueAndGetValuesMatch) + { + auto entity = BuildTestPerlinGradient(TestShapeHalfBounds); + CompareGetValueAndGetValues(entity->GetId()); + } + + TEST_F(GradientSignalGetValuesTestsFixture, RandomGradientComponent_VerifyGetValueAndGetValuesMatch) + { + auto entity = BuildTestRandomGradient(TestShapeHalfBounds); + CompareGetValueAndGetValues(entity->GetId()); + } + + TEST_F(GradientSignalGetValuesTestsFixture, ConstantGradientComponent_VerifyGetValueAndGetValuesMatch) + { + auto entity = BuildTestConstantGradient(TestShapeHalfBounds); + CompareGetValueAndGetValues(entity->GetId()); + } + + TEST_F(GradientSignalGetValuesTestsFixture, ShapeAreaFalloffGradientComponent_VerifyGetValueAndGetValuesMatch) + { + auto entity = BuildTestShapeAreaFalloffGradient(TestShapeHalfBounds); + CompareGetValueAndGetValues(entity->GetId()); + } + + TEST_F(GradientSignalGetValuesTestsFixture, DitherGradientComponent_VerifyGetValueAndGetValuesMatch) + { + auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); + + auto entity = BuildTestDitherGradient(TestShapeHalfBounds, baseEntity->GetId()); + CompareGetValueAndGetValues(entity->GetId()); + } + + TEST_F(GradientSignalGetValuesTestsFixture, InvertGradientComponent_VerifyGetValueAndGetValuesMatch) + { + auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); + auto entity = BuildTestInvertGradient(TestShapeHalfBounds, baseEntity->GetId()); + CompareGetValueAndGetValues(entity->GetId()); + } + + TEST_F(GradientSignalGetValuesTestsFixture, LevelsGradientComponent_VerifyGetValueAndGetValuesMatch) + { + auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); + auto entity = BuildTestLevelsGradient(TestShapeHalfBounds, baseEntity->GetId()); + CompareGetValueAndGetValues(entity->GetId()); + } + + TEST_F(GradientSignalGetValuesTestsFixture, MixedGradientComponent_VerifyGetValueAndGetValuesMatch) + { + auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); + auto mixedEntity = BuildTestConstantGradient(TestShapeHalfBounds); + auto entity = BuildTestMixedGradient(TestShapeHalfBounds, baseEntity->GetId(), mixedEntity->GetId()); + CompareGetValueAndGetValues(entity->GetId()); + } + + TEST_F(GradientSignalGetValuesTestsFixture, PosterizeGradientComponent_VerifyGetValueAndGetValuesMatch) + { + auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); + auto entity = BuildTestPosterizeGradient(TestShapeHalfBounds, baseEntity->GetId()); + CompareGetValueAndGetValues(entity->GetId()); + } + + TEST_F(GradientSignalGetValuesTestsFixture, ReferenceGradientComponent_VerifyGetValueAndGetValuesMatch) + { + auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); + auto entity = BuildTestReferenceGradient(TestShapeHalfBounds, baseEntity->GetId()); + CompareGetValueAndGetValues(entity->GetId()); + } + + TEST_F(GradientSignalGetValuesTestsFixture, SmoothStepGradientComponent_VerifyGetValueAndGetValuesMatch) + { + auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); + auto entity = BuildTestSmoothStepGradient(TestShapeHalfBounds, baseEntity->GetId()); + CompareGetValueAndGetValues(entity->GetId()); + } + + TEST_F(GradientSignalGetValuesTestsFixture, ThresholdGradientComponent_VerifyGetValueAndGetValuesMatch) + { + auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); + auto entity = BuildTestThresholdGradient(TestShapeHalfBounds, baseEntity->GetId()); + CompareGetValueAndGetValues(entity->GetId()); + } + + TEST_F(GradientSignalGetValuesTestsFixture, SurfaceAltitudeGradientComponent_VerifyGetValueAndGetValuesMatch) + { + auto mockSurfaceDataSystem = + CreateMockSurfaceDataSystem(AZ::Aabb::CreateFromMinMax(AZ::Vector3(-TestShapeHalfBounds), AZ::Vector3(TestShapeHalfBounds))); + + auto entity = BuildTestSurfaceAltitudeGradient(TestShapeHalfBounds); + CompareGetValueAndGetValues(entity->GetId()); + } + + TEST_F(GradientSignalGetValuesTestsFixture, SurfaceMaskGradientComponent_VerifyGetValueAndGetValuesMatch) + { + auto mockSurfaceDataSystem = + CreateMockSurfaceDataSystem(AZ::Aabb::CreateFromMinMax(AZ::Vector3(-TestShapeHalfBounds), AZ::Vector3(TestShapeHalfBounds))); + + auto entity = BuildTestSurfaceMaskGradient(TestShapeHalfBounds); + CompareGetValueAndGetValues(entity->GetId()); + } + + TEST_F(GradientSignalGetValuesTestsFixture, SurfaceSlopeGradientComponent_VerifyGetValueAndGetValuesMatch) + { + auto mockSurfaceDataSystem = + CreateMockSurfaceDataSystem(AZ::Aabb::CreateFromMinMax(AZ::Vector3(-TestShapeHalfBounds), AZ::Vector3(TestShapeHalfBounds))); + + auto entity = BuildTestSurfaceSlopeGradient(TestShapeHalfBounds); + CompareGetValueAndGetValues(entity->GetId()); + } +} + + diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalImageTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalImageTests.cpp index e99bf1de5b..5cd3c7edf6 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalImageTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalImageTests.cpp @@ -417,7 +417,6 @@ namespace UnitTest TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); } } - } diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalReferencesTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalReferencesTests.cpp index 32cd483c81..cc91c58fce 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalReferencesTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalReferencesTests.cpp @@ -371,12 +371,9 @@ namespace UnitTest const AZ::EntityId id = mockReference->GetId(); MockGradientArrayRequestsBus mockGradientRequestsBus(id, inputData, dataSize); - GradientSignal::ReferenceGradientConfig config; - config.m_gradientSampler.m_gradientId = mockReference->GetId(); - - auto entity = CreateEntity(); - CreateComponent(entity.get(), config); - ActivateEntity(entity.get()); + // Create a reference gradient with an arbitrary box shape on it. + const float HalfBounds = 64.0f; + auto entity = BuildTestReferenceGradient(HalfBounds, mockReference->GetId()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); } @@ -385,10 +382,9 @@ namespace UnitTest { // Verify that gradient references can validate and disconnect cyclic connections - auto constantGradientEntity = CreateEntity(); - GradientSignal::ConstantGradientConfig constantGradientConfig; - CreateComponent(constantGradientEntity.get(), constantGradientConfig); - ActivateEntity(constantGradientEntity.get()); + // Create a constant gradient with an arbitrary box shape on it. + const float HalfBounds = 64.0f; + auto constantGradientEntity = BuildTestConstantGradient(HalfBounds); // Verify cyclic reference test passes when pointing to gradient generator entity auto referenceGradientEntity1 = CreateEntity(); diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp index dd81c14a09..ec770f038d 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp @@ -212,12 +212,9 @@ namespace UnitTest const AZ::EntityId id = entityMock->GetId(); UnitTest::MockGradientArrayRequestsBus mockGradientRequestsBus(id, inputData, dataSize); - GradientSignal::InvertGradientConfig config; - config.m_gradientSampler.m_gradientId = entityMock->GetId(); - - auto entity = CreateEntity(); - CreateComponent(entity.get(), config); - ActivateEntity(entity.get()); + // Create the entity with an arbitrarily-sized box. + const float HalfBounds = 64.0f; + auto entity = BuildTestInvertGradient(HalfBounds, entityMock->GetId()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); } diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.cpp index 77568d3321..154e9032b2 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.cpp @@ -9,10 +9,30 @@ #include +#include #include + +// Base gradient components +#include #include #include #include +#include + +// Gradient modifier components +#include +#include +#include +#include +#include +#include +#include +#include + +// Gradient surface data components +#include +#include +#include namespace UnitTest { @@ -32,12 +52,18 @@ namespace UnitTest AZ::Data::AssetManager::Create(desc); m_mockHandler = new ImageAssetMockAssetHandler(); AZ::Data::AssetManager::Instance().RegisterHandler(m_mockHandler, azrtti_typeid()); + + m_mockShapeHandlers = new AZStd::vector>>(); } void GradientSignalBaseFixture::TearDownCoreSystems() { + // Clear any mock shape handlers that we've created for our test entities. + delete m_mockShapeHandlers; + AZ::Data::AssetManager::Instance().UnregisterHandler(m_mockHandler); delete m_mockHandler; // delete after removing from the asset manager + AzFramework::LegacyAssetEventBus::ClearQueuedEvents(); AZ::Data::AssetManager::Destroy(); AZ::AllocatorInstance::Destroy(); @@ -47,229 +73,357 @@ namespace UnitTest m_systemEntity = nullptr; } - void GradientSignalTest::TestFixedDataSampler(const AZStd::vector& expectedOutput, int size, AZ::EntityId gradientEntityId) + AZStd::unique_ptr> GradientSignalBaseFixture::CreateMockShape( + const AZ::Aabb& spawnerBox, const AZ::EntityId& shapeEntityId) { - GradientSignal::GradientSampler gradientSampler; - gradientSampler.m_gradientId = gradientEntityId; + AZStd::unique_ptr> mockShape = + AZStd::make_unique>(shapeEntityId); - for (int y = 0; y < size; ++y) - { - for (int x = 0; x < size; ++x) - { - GradientSignal::GradientSampleParams params; - params.m_position = AZ::Vector3(static_cast(x), static_cast(y), 0.0f); + ON_CALL(*mockShape, GetEncompassingAabb).WillByDefault(testing::Return(spawnerBox)); + ON_CALL(*mockShape, GetTransformAndLocalBounds) + .WillByDefault( + [spawnerBox](AZ::Transform& transform, AZ::Aabb& bounds) + { + transform = AZ::Transform::CreateTranslation(spawnerBox.GetCenter()); + bounds = spawnerBox.GetTranslated(-spawnerBox.GetCenter()); + }); + ON_CALL(*mockShape, IsPointInside) + .WillByDefault( + [spawnerBox](const AZ::Vector3& point) -> bool + { + return spawnerBox.Contains(point); + }); - const int index = y * size + x; - float actualValue = gradientSampler.GetValue(params); - float expectedValue = expectedOutput[index]; + return mockShape; + } - EXPECT_NEAR(actualValue, expectedValue, 0.01f); + AZStd::unique_ptr GradientSignalBaseFixture::CreateMockSurfaceDataSystem(const AZ::Aabb& spawnerBox) + { + SurfaceData::SurfacePoint point; + AZStd::unique_ptr mockSurfaceDataSystem = AZStd::make_unique(); + + // Give the mock surface data a bunch of fake point values to return. + for (float y = spawnerBox.GetMin().GetY(); y < spawnerBox.GetMax().GetY(); y+= 1.0f) + { + for (float x = spawnerBox.GetMin().GetX(); x < spawnerBox.GetMax().GetX(); x += 1.0f) + { + // Use our x distance into the spawnerBox as an arbitrary percentage value that we'll use to calculate + // our other arbitrary values below. + float arbitraryPercentage = AZStd::abs(x / spawnerBox.GetExtents().GetX()); + + // Create a position that's between min and max Z of the box. + point.m_position = AZ::Vector3(x, y, AZ::Lerp(spawnerBox.GetMin().GetZ(), spawnerBox.GetMax().GetZ(), arbitraryPercentage)); + // Create an arbitrary normal value. + point.m_normal = point.m_position.GetNormalized(); + // Create an arbitrary surface value. + point.m_masks[AZ_CRC_CE("test_mask")] = arbitraryPercentage; + + mockSurfaceDataSystem->m_GetSurfacePoints[AZStd::make_pair(x, y)] = { { point } }; } } + + return mockSurfaceDataSystem; } -#ifdef HAVE_BENCHMARK - void GradientSignalBenchmarkFixture::CreateTestEntity(float shapeHalfBounds) + AZStd::unique_ptr GradientSignalBaseFixture::CreateTestEntity(float shapeHalfBounds) { // Create the base entity - m_testEntity = CreateEntity(); + AZStd::unique_ptr testEntity = CreateEntity(); // Create a mock Shape component that describes the bounds that we're using to map our gradient into world space. - CreateComponent(m_testEntity.get()); - MockShapeComponentHandler mockShapeHandler(m_testEntity->GetId()); - mockShapeHandler.m_GetLocalBounds = AZ::Aabb::CreateCenterRadius(AZ::Vector3(shapeHalfBounds), shapeHalfBounds); - - // Create a mock Transform component that locates our gradient in the center of our desired mock Shape. - MockTransformHandler mockTransformHandler; - mockTransformHandler.m_GetLocalTMOutput = AZ::Transform::CreateTranslation(AZ::Vector3(shapeHalfBounds)); - mockTransformHandler.m_GetWorldTMOutput = AZ::Transform::CreateTranslation(AZ::Vector3(shapeHalfBounds)); - mockTransformHandler.BusConnect(m_testEntity->GetId()); + CreateComponent(testEntity.get()); + + // Create and keep a reference to a mock shape handler that will respond to shape requests for the mock shape. + auto mockShapeHandler = + CreateMockShape(AZ::Aabb::CreateCenterRadius(AZ::Vector3(shapeHalfBounds), shapeHalfBounds), testEntity->GetId()); + m_mockShapeHandlers->push_back(AZStd::move(mockShapeHandler)); + + // Create a transform that locates our gradient in the center of our desired mock Shape. + auto transform = CreateComponent(testEntity.get()); + transform->SetLocalTM(AZ::Transform::CreateTranslation(AZ::Vector3(shapeHalfBounds))); + transform->SetWorldTM(AZ::Transform::CreateTranslation(AZ::Vector3(shapeHalfBounds))); + + return testEntity; } - void GradientSignalBenchmarkFixture::DestroyTestEntity() + AZStd::unique_ptr GradientSignalBaseFixture::BuildTestConstantGradient(float shapeHalfBounds) { - m_testEntity.reset(); + // Create a Constant Gradient Component with arbitrary parameters. + auto entity = CreateTestEntity(shapeHalfBounds); + GradientSignal::ConstantGradientConfig config; + config.m_value = 0.75f; + CreateComponent(entity.get(), config); + + ActivateEntity(entity.get()); + return entity; } - void GradientSignalBenchmarkFixture::CreateTestImageGradient(AZ::Entity* entity) + AZStd::unique_ptr GradientSignalBaseFixture::BuildTestImageGradient(float shapeHalfBounds) { - // Create the Image Gradient Component with some default sizes and parameters. + // Create an Image Gradient Component with arbitrary sizes and parameters. + auto entity = CreateTestEntity(shapeHalfBounds); GradientSignal::ImageGradientConfig config; const uint32_t imageSize = 4096; const int32_t imageSeed = 12345; config.m_imageAsset = ImageAssetMockAssetHandler::CreateImageAsset(imageSize, imageSize, imageSeed); config.m_tilingX = 1.0f; config.m_tilingY = 1.0f; - CreateComponent(entity, config); + CreateComponent(entity.get(), config); - // Create the Gradient Transform Component with some default parameters. + // Create a Gradient Transform Component with arbitrary parameters. GradientSignal::GradientTransformConfig gradientTransformConfig; gradientTransformConfig.m_wrappingType = GradientSignal::WrappingType::None; - CreateComponent(entity, gradientTransformConfig); + CreateComponent(entity.get(), gradientTransformConfig); + + ActivateEntity(entity.get()); + return entity; } - void GradientSignalBenchmarkFixture::CreateTestPerlinGradient(AZ::Entity* entity) + AZStd::unique_ptr GradientSignalBaseFixture::BuildTestPerlinGradient(float shapeHalfBounds) { - // Create the Perlin Gradient Component with some default sizes and parameters. + // Create a Perlin Gradient Component with arbitrary parameters. + auto entity = CreateTestEntity(shapeHalfBounds); GradientSignal::PerlinGradientConfig config; config.m_amplitude = 1.0f; config.m_frequency = 1.1f; config.m_octave = 4; config.m_randomSeed = 12345; - CreateComponent(entity, config); + CreateComponent(entity.get(), config); - // Create the Gradient Transform Component with some default parameters. + // Create a Gradient Transform Component with arbitrary parameters. GradientSignal::GradientTransformConfig gradientTransformConfig; gradientTransformConfig.m_wrappingType = GradientSignal::WrappingType::None; - CreateComponent(entity, gradientTransformConfig); + CreateComponent(entity.get(), gradientTransformConfig); + + ActivateEntity(entity.get()); + return entity; } - void GradientSignalBenchmarkFixture::CreateTestRandomGradient(AZ::Entity* entity) + AZStd::unique_ptr GradientSignalBaseFixture::BuildTestRandomGradient(float shapeHalfBounds) { - // Create the Random Gradient Component with some default parameters. + // Create a Random Gradient Component with arbitrary parameters. + auto entity = CreateTestEntity(shapeHalfBounds); GradientSignal::RandomGradientConfig config; config.m_randomSeed = 12345; - CreateComponent(entity, config); + CreateComponent(entity.get(), config); - // Create the Gradient Transform Component with some default parameters. + // Create a Gradient Transform Component with arbitrary parameters. GradientSignal::GradientTransformConfig gradientTransformConfig; gradientTransformConfig.m_wrappingType = GradientSignal::WrappingType::None; - CreateComponent(entity, gradientTransformConfig); + CreateComponent(entity.get(), gradientTransformConfig); + + ActivateEntity(entity.get()); + return entity; } - void GradientSignalBenchmarkFixture::RunSamplerGetValueBenchmark(benchmark::State& state) + AZStd::unique_ptr GradientSignalBaseFixture::BuildTestShapeAreaFalloffGradient(float shapeHalfBounds) { - AZ_PROFILE_FUNCTION(Entity); - - // All components are created, so activate the entity - ActivateEntity(m_testEntity.get()); + // Create a Shape Area Falloff Gradient Component with arbitrary parameters. + auto entity = CreateTestEntity(shapeHalfBounds); + GradientSignal::ShapeAreaFalloffGradientConfig config; + config.m_shapeEntityId = entity->GetId(); + config.m_falloffWidth = 16.0f; + config.m_falloffType = GradientSignal::FalloffType::InnerOuter; + CreateComponent(entity.get(), config); + + ActivateEntity(entity.get()); + return entity; + } - // Create a gradient sampler and run through a series of points to see if they match expectations. - GradientSignal::GradientSampler gradientSampler; - gradientSampler.m_gradientId = m_testEntity->GetId(); + AZStd::unique_ptr GradientSignalBaseFixture::BuildTestDitherGradient( + float shapeHalfBounds, const AZ::EntityId& inputGradientId) + { + // Create a Dither Gradient Component with arbitrary parameters. + auto entity = CreateTestEntity(shapeHalfBounds); + GradientSignal::DitherGradientConfig config; + config.m_gradientSampler.m_gradientId = inputGradientId; + config.m_useSystemPointsPerUnit = false; + config.m_pointsPerUnit = 1.0f; + config.m_patternOffset = AZ::Vector3::CreateZero(); + config.m_patternType = GradientSignal::DitherGradientConfig::BayerPatternType::PATTERN_SIZE_4x4; + CreateComponent(entity.get(), config); + + ActivateEntity(entity.get()); + return entity; + } - // Get the height and width ranges for querying from our benchmark parameters - float height = aznumeric_cast(state.range(0)); - float width = aznumeric_cast(state.range(1)); + AZStd::unique_ptr GradientSignalBaseFixture::BuildTestInvertGradient( + float shapeHalfBounds, const AZ::EntityId& inputGradientId) + { + // Create an Invert Gradient Component. + auto entity = CreateTestEntity(shapeHalfBounds); + GradientSignal::InvertGradientConfig config; + config.m_gradientSampler.m_gradientId = inputGradientId; + CreateComponent(entity.get(), config); + + ActivateEntity(entity.get()); + return entity; + } - // Call GetValue() for every height and width in our ranges. - for (auto _ : state) - { - for (float y = 0.0f; y < height; y += 1.0f) - { - for (float x = 0.0f; x < width; x += 1.0f) - { - GradientSignal::GradientSampleParams params; - params.m_position = AZ::Vector3(x, y, 0.0f); - float value = gradientSampler.GetValue(params); - benchmark::DoNotOptimize(value); - } - } - } + AZStd::unique_ptr GradientSignalBaseFixture::BuildTestLevelsGradient( + float shapeHalfBounds, const AZ::EntityId& inputGradientId) + { + // Create a Levels Gradient Component with arbitrary parameters. + auto entity = CreateTestEntity(shapeHalfBounds); + GradientSignal::LevelsGradientConfig config; + config.m_gradientSampler.m_gradientId = inputGradientId; + config.m_inputMin = 0.1f; + config.m_inputMid = 0.3f; + config.m_inputMax = 0.9f; + config.m_outputMin = 0.0f; + config.m_outputMax = 1.0f; + CreateComponent(entity.get(), config); + + ActivateEntity(entity.get()); + return entity; } - void GradientSignalBenchmarkFixture::RunSamplerGetValuesBenchmark(benchmark::State& state) + AZStd::unique_ptr GradientSignalBaseFixture::BuildTestMixedGradient( + float shapeHalfBounds, const AZ::EntityId& baseGradientId, const AZ::EntityId& mixedGradientId) { - AZ_PROFILE_FUNCTION(Entity); + // Create a Mixed Gradient Component that mixes two input gradients together in arbitrary ways. + auto entity = CreateTestEntity(shapeHalfBounds); + GradientSignal::MixedGradientConfig config; - // All components are created, so activate the entity - ActivateEntity(m_testEntity.get()); + GradientSignal::MixedGradientLayer layer; + layer.m_enabled = true; - // Create a gradient sampler and run through a series of points to see if they match expectations. - GradientSignal::GradientSampler gradientSampler; - gradientSampler.m_gradientId = m_testEntity->GetId(); + layer.m_operation = GradientSignal::MixedGradientLayer::MixingOperation::Initialize; + layer.m_gradientSampler.m_gradientId = baseGradientId; + layer.m_gradientSampler.m_opacity = 1.0f; + config.m_layers.push_back(layer); - // Get the height and width ranges for querying from our benchmark parameters - float height = aznumeric_cast(state.range(0)); - float width = aznumeric_cast(state.range(1)); - int64_t totalQueryPoints = state.range(0) * state.range(1); + layer.m_operation = GradientSignal::MixedGradientLayer::MixingOperation::Overlay; + layer.m_gradientSampler.m_gradientId = mixedGradientId; + layer.m_gradientSampler.m_opacity = 0.75f; + config.m_layers.push_back(layer); - // Call GetValues() for every height and width in our ranges. - for (auto _ : state) - { - // Set up our vector of query positions. - AZStd::vector positions(totalQueryPoints); - size_t index = 0; - for (float y = 0.0f; y < height; y += 1.0f) - { - for (float x = 0.0f; x < width; x += 1.0f) - { - positions[index++] = AZ::Vector3(x, y, 0.0f); - } - } + CreateComponent(entity.get(), config); - // Query and get the results. - AZStd::vector results(totalQueryPoints); - gradientSampler.GetValues(positions, results); - } + ActivateEntity(entity.get()); + return entity; } - void GradientSignalBenchmarkFixture::RunEBusGetValueBenchmark(benchmark::State& state) + AZStd::unique_ptr GradientSignalBaseFixture::BuildTestPosterizeGradient( + float shapeHalfBounds, const AZ::EntityId& inputGradientId) { - AZ_PROFILE_FUNCTION(Entity); + // Create a Posterize Gradient Component with arbitrary parameters. + auto entity = CreateTestEntity(shapeHalfBounds); + GradientSignal::PosterizeGradientConfig config; + config.m_gradientSampler.m_gradientId = inputGradientId; + config.m_mode = GradientSignal::PosterizeGradientConfig::ModeType::Ps; + config.m_bands = 5; + CreateComponent(entity.get(), config); + + ActivateEntity(entity.get()); + return entity; + } - // All components are created, so activate the entity - ActivateEntity(m_testEntity.get()); + AZStd::unique_ptr GradientSignalBaseFixture::BuildTestReferenceGradient( + float shapeHalfBounds, const AZ::EntityId& inputGradientId) + { + // Create a Reference Gradient Component. + auto entity = CreateTestEntity(shapeHalfBounds); + GradientSignal::ReferenceGradientConfig config; + config.m_gradientSampler.m_gradientId = inputGradientId; + config.m_gradientSampler.m_ownerEntityId = entity->GetId(); + CreateComponent(entity.get(), config); + + ActivateEntity(entity.get()); + return entity; + } - GradientSignal::GradientSampleParams params; + AZStd::unique_ptr GradientSignalBaseFixture::BuildTestSmoothStepGradient( + float shapeHalfBounds, const AZ::EntityId& inputGradientId) + { + // Create a Smooth Step Gradient Component with arbitrary parameters. + auto entity = CreateTestEntity(shapeHalfBounds); + GradientSignal::SmoothStepGradientConfig config; + config.m_gradientSampler.m_gradientId = inputGradientId; + config.m_smoothStep.m_falloffMidpoint = 0.75f; + config.m_smoothStep.m_falloffRange = 0.125f; + config.m_smoothStep.m_falloffStrength = 0.25f; + CreateComponent(entity.get(), config); + + ActivateEntity(entity.get()); + return entity; + } - // Get the height and width ranges for querying from our benchmark parameters - float height = aznumeric_cast(state.range(0)); - float width = aznumeric_cast(state.range(1)); + AZStd::unique_ptr GradientSignalBaseFixture::BuildTestThresholdGradient( + float shapeHalfBounds, const AZ::EntityId& inputGradientId) + { + // Create a Threshold Gradient Component with arbitrary parameters. + auto entity = CreateTestEntity(shapeHalfBounds); + GradientSignal::ThresholdGradientConfig config; + config.m_gradientSampler.m_gradientId = inputGradientId; + config.m_threshold = 0.75f; + CreateComponent(entity.get(), config); + + ActivateEntity(entity.get()); + return entity; + } - // Call GetValue() for every height and width in our ranges. - for (auto _ : state) - { - for (float y = 0.0f; y < height; y += 1.0f) - { - for (float x = 0.0f; x < width; x += 1.0f) - { - float value = 0.0f; - params.m_position = AZ::Vector3(x, y, 0.0f); - GradientSignal::GradientRequestBus::EventResult( - value, m_testEntity->GetId(), &GradientSignal::GradientRequestBus::Events::GetValue, params); - benchmark::DoNotOptimize(value); - } - } - } + AZStd::unique_ptr GradientSignalBaseFixture::BuildTestSurfaceAltitudeGradient(float shapeHalfBounds) + { + // Create a Surface Altitude Gradient Component with arbitrary parameters. + auto entity = CreateTestEntity(shapeHalfBounds); + GradientSignal::SurfaceAltitudeGradientConfig config; + config.m_altitudeMin = -5.0f; + config.m_altitudeMax = 15.0f; + CreateComponent(entity.get(), config); + + ActivateEntity(entity.get()); + return entity; } - void GradientSignalBenchmarkFixture::RunEBusGetValuesBenchmark(benchmark::State& state) + AZStd::unique_ptr GradientSignalBaseFixture::BuildTestSurfaceMaskGradient(float shapeHalfBounds) { - AZ_PROFILE_FUNCTION(Entity); + // Create a Surface Mask Gradient Component with arbitrary parameters. + auto entity = CreateTestEntity(shapeHalfBounds); + GradientSignal::SurfaceMaskGradientConfig config; + config.m_surfaceTagList.push_back(AZ_CRC_CE("test_mask")); + CreateComponent(entity.get(), config); + + ActivateEntity(entity.get()); + return entity; + } - // All components are created, so activate the entity - ActivateEntity(m_testEntity.get()); + AZStd::unique_ptr GradientSignalBaseFixture::BuildTestSurfaceSlopeGradient(float shapeHalfBounds) + { + // Create a Surface Slope Gradient Component with arbitrary parameters. + auto entity = CreateTestEntity(shapeHalfBounds); + GradientSignal::SurfaceSlopeGradientConfig config; + config.m_slopeMin = 5.0f; + config.m_slopeMax = 50.0f; + config.m_rampType = GradientSignal::SurfaceSlopeGradientConfig::RampType::SMOOTH_STEP; + config.m_smoothStep.m_falloffMidpoint = 0.75f; + config.m_smoothStep.m_falloffRange = 0.125f; + config.m_smoothStep.m_falloffStrength = 0.25f; + CreateComponent(entity.get(), config); + + ActivateEntity(entity.get()); + return entity; + } + void GradientSignalTest::TestFixedDataSampler(const AZStd::vector& expectedOutput, int size, AZ::EntityId gradientEntityId) + { GradientSignal::GradientSampler gradientSampler; - gradientSampler.m_gradientId = m_testEntity->GetId(); - - // Get the height and width ranges for querying from our benchmark parameters - float height = aznumeric_cast(state.range(0)); - float width = aznumeric_cast(state.range(1)); - int64_t totalQueryPoints = state.range(0) * state.range(1); + gradientSampler.m_gradientId = gradientEntityId; - // Call GetValues() for every height and width in our ranges. - for (auto _ : state) + for (int y = 0; y < size; ++y) { - // Set up our vector of query positions. - AZStd::vector positions(totalQueryPoints); - size_t index = 0; - for (float y = 0.0f; y < height; y += 1.0f) + for (int x = 0; x < size; ++x) { - for (float x = 0.0f; x < width; x += 1.0f) - { - positions[index++] = AZ::Vector3(x, y, 0.0f); - } - } + GradientSignal::GradientSampleParams params; + params.m_position = AZ::Vector3(static_cast(x), static_cast(y), 0.0f); + + const int index = y * size + x; + float actualValue = gradientSampler.GetValue(params); + float expectedValue = expectedOutput[index]; - // Query and get the results. - AZStd::vector results(totalQueryPoints); - GradientSignal::GradientRequestBus::Event( - m_testEntity->GetId(), &GradientSignal::GradientRequestBus::Events::GetValues, positions, results); + EXPECT_NEAR(actualValue, expectedValue, 0.01f); + } } } -#endif - } diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.h b/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.h index 13ff69c82d..478f1c1d92 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.h +++ b/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.h @@ -8,6 +8,7 @@ #pragma once #include +#include namespace UnitTest { @@ -30,22 +31,56 @@ namespace UnitTest } template - AZ::Component* CreateComponent(AZ::Entity* entity, const Configuration& config) + Component* CreateComponent(AZ::Entity* entity, const Configuration& config) { m_app->RegisterComponentDescriptor(Component::CreateDescriptor()); return entity->CreateComponent(config); } template - AZ::Component* CreateComponent(AZ::Entity* entity) + Component* CreateComponent(AZ::Entity* entity) { m_app->RegisterComponentDescriptor(Component::CreateDescriptor()); return entity->CreateComponent(); } + // Create a mock shape that will respond to the shape bus with proper responses for the given input box. + AZStd::unique_ptr> CreateMockShape( + const AZ::Aabb& spawnerBox, const AZ::EntityId& shapeEntityId); + + // Create a mock SurfaceDataSystem that will respond to requests for surface points with mock responses for points inside + // the given input box. + AZStd::unique_ptr CreateMockSurfaceDataSystem(const AZ::Aabb& spawnerBox); + + // Create an entity with a mock shape and a transform. It won't be activated yet though, because we expect a gradient component + // to also get added to it first before activation. + AZStd::unique_ptr CreateTestEntity(float shapeHalfBounds); + + // Create and activate an entity with a gradient component of the requested type, initialized with test data. + AZStd::unique_ptr BuildTestConstantGradient(float shapeHalfBounds); + AZStd::unique_ptr BuildTestImageGradient(float shapeHalfBounds); + AZStd::unique_ptr BuildTestPerlinGradient(float shapeHalfBounds); + AZStd::unique_ptr BuildTestRandomGradient(float shapeHalfBounds); + AZStd::unique_ptr BuildTestShapeAreaFalloffGradient(float shapeHalfBounds); + + AZStd::unique_ptr BuildTestDitherGradient(float shapeHalfBounds, const AZ::EntityId& inputGradientId); + AZStd::unique_ptr BuildTestInvertGradient(float shapeHalfBounds, const AZ::EntityId& inputGradientId); + AZStd::unique_ptr BuildTestLevelsGradient(float shapeHalfBounds, const AZ::EntityId& inputGradientId); + AZStd::unique_ptr BuildTestMixedGradient( + float shapeHalfBounds, const AZ::EntityId& baseGradientId, const AZ::EntityId& mixedGradientId); + AZStd::unique_ptr BuildTestPosterizeGradient(float shapeHalfBounds, const AZ::EntityId& inputGradientId); + AZStd::unique_ptr BuildTestReferenceGradient(float shapeHalfBounds, const AZ::EntityId& inputGradientId); + AZStd::unique_ptr BuildTestSmoothStepGradient(float shapeHalfBounds, const AZ::EntityId& inputGradientId); + AZStd::unique_ptr BuildTestThresholdGradient(float shapeHalfBounds, const AZ::EntityId& inputGradientId); + + AZStd::unique_ptr BuildTestSurfaceAltitudeGradient(float shapeHalfBounds); + AZStd::unique_ptr BuildTestSurfaceMaskGradient(float shapeHalfBounds); + AZStd::unique_ptr BuildTestSurfaceSlopeGradient(float shapeHalfBounds); + AZStd::unique_ptr m_app; AZ::Entity* m_systemEntity = nullptr; ImageAssetMockAssetHandler* m_mockHandler = nullptr; + AZStd::vector>>* m_mockShapeHandlers = nullptr; }; struct GradientSignalTest @@ -80,33 +115,15 @@ namespace UnitTest AZ::Debug::TraceMessageBus::Handler::BusConnect(); UnitTest::AllocatorsBenchmarkFixture::SetUp(state); SetupCoreSystems(); - - // Create a default test entity with bounds of 256 m x 256 m x 256 m. - const float shapeHalfBounds = 128.0f; - CreateTestEntity(shapeHalfBounds); } void internalTearDown(const benchmark::State& state) { - DestroyTestEntity(); TearDownCoreSystems(); UnitTest::AllocatorsBenchmarkFixture::TearDown(state); AZ::Debug::TraceMessageBus::Handler::BusDisconnect(); } - void CreateTestEntity(float shapeHalfBounds); - void DestroyTestEntity(); - - void CreateTestImageGradient(AZ::Entity* entity); - void CreateTestPerlinGradient(AZ::Entity* entity); - void CreateTestRandomGradient(AZ::Entity* entity); - - void RunSamplerGetValueBenchmark(benchmark::State& state); - void RunSamplerGetValuesBenchmark(benchmark::State& state); - - void RunEBusGetValueBenchmark(benchmark::State& state); - void RunEBusGetValuesBenchmark(benchmark::State& state); - protected: void SetUp(const benchmark::State& state) override { @@ -125,8 +142,6 @@ namespace UnitTest { internalTearDown(state); } - - AZStd::unique_ptr m_testEntity; }; #endif } diff --git a/Gems/GradientSignal/Code/gradientsignal_tests_files.cmake b/Gems/GradientSignal/Code/gradientsignal_tests_files.cmake index eb799811b7..814347c395 100644 --- a/Gems/GradientSignal/Code/gradientsignal_tests_files.cmake +++ b/Gems/GradientSignal/Code/gradientsignal_tests_files.cmake @@ -8,6 +8,7 @@ set(FILES Tests/GradientSignalBenchmarks.cpp + Tests/GradientSignalGetValuesTests.cpp Tests/GradientSignalImageTests.cpp Tests/GradientSignalReferencesTests.cpp Tests/GradientSignalServicesTests.cpp diff --git a/Gems/LmbrCentral/Code/Source/Shape/ReferenceShapeComponent.cpp b/Gems/LmbrCentral/Code/Source/Shape/ReferenceShapeComponent.cpp index 7ed79fe3a3..1fc4bb5107 100644 --- a/Gems/LmbrCentral/Code/Source/Shape/ReferenceShapeComponent.cpp +++ b/Gems/LmbrCentral/Code/Source/Shape/ReferenceShapeComponent.cpp @@ -190,7 +190,7 @@ namespace LmbrCentral { AZ::Crc32 result = {}; - AZ_WarningOnce("Vegetation", !m_isRequestInProgress, "Detected cyclic dependences with vegetation entity references"); + AZ_WarningOnce("Shape", !m_isRequestInProgress, "Detected cyclic dependencies with shape entity references"); if (AllowRequest()) { m_isRequestInProgress = true; @@ -205,7 +205,7 @@ namespace LmbrCentral { AZ::Aabb result = AZ::Aabb::CreateNull(); - AZ_WarningOnce("Vegetation", !m_isRequestInProgress, "Detected cyclic dependences with vegetation entity references"); + AZ_WarningOnce("Shape", !m_isRequestInProgress, "Detected cyclic dependencies with shape entity references"); if (AllowRequest()) { m_isRequestInProgress = true; @@ -221,7 +221,7 @@ namespace LmbrCentral transform = AZ::Transform::CreateIdentity(); bounds = AZ::Aabb::CreateNull(); - AZ_WarningOnce("Vegetation", !m_isRequestInProgress, "Detected cyclic dependences with vegetation entity references"); + AZ_WarningOnce("Shape", !m_isRequestInProgress, "Detected cyclic dependencies with shape entity references"); if (AllowRequest()) { m_isRequestInProgress = true; @@ -234,7 +234,7 @@ namespace LmbrCentral { bool result = false; - AZ_WarningOnce("Vegetation", !m_isRequestInProgress, "Detected cyclic dependences with vegetation entity references"); + AZ_WarningOnce("Shape", !m_isRequestInProgress, "Detected cyclic dependencies with shape entity references"); if (AllowRequest()) { m_isRequestInProgress = true; @@ -249,7 +249,7 @@ namespace LmbrCentral { float result = FLT_MAX; - AZ_WarningOnce("Vegetation", !m_isRequestInProgress, "Detected cyclic dependences with vegetation entity references"); + AZ_WarningOnce("Shape", !m_isRequestInProgress, "Detected cyclic dependencies with shape entity references"); if (AllowRequest()) { m_isRequestInProgress = true; @@ -264,7 +264,7 @@ namespace LmbrCentral { float result = FLT_MAX; - AZ_WarningOnce("Vegetation", !m_isRequestInProgress, "Detected cyclic dependences with vegetation entity references"); + AZ_WarningOnce("Shape", !m_isRequestInProgress, "Detected cyclic dependencies with shape entity references"); if (AllowRequest()) { m_isRequestInProgress = true; @@ -279,7 +279,7 @@ namespace LmbrCentral { AZ::Vector3 result = AZ::Vector3::CreateZero(); - AZ_WarningOnce("Vegetation", !m_isRequestInProgress, "Detected cyclic dependences with vegetation entity references"); + AZ_WarningOnce("Shape", !m_isRequestInProgress, "Detected cyclic dependencies with shape entity references"); if (AllowRequest()) { m_isRequestInProgress = true; @@ -294,7 +294,7 @@ namespace LmbrCentral { bool result = false; - AZ_WarningOnce("Vegetation", !m_isRequestInProgress, "Detected cyclic dependences with vegetation entity references"); + AZ_WarningOnce("Shape", !m_isRequestInProgress, "Detected cyclic dependencies with shape entity references"); if (AllowRequest()) { m_isRequestInProgress = true; diff --git a/Gems/Terrain/Code/Source/Components/TerrainHeightGradientListComponent.cpp b/Gems/Terrain/Code/Source/Components/TerrainHeightGradientListComponent.cpp index 108ae70632..b9055375d4 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainHeightGradientListComponent.cpp +++ b/Gems/Terrain/Code/Source/Components/TerrainHeightGradientListComponent.cpp @@ -160,7 +160,7 @@ namespace Terrain { float maxSample = 0.0f; terrainExists = false; - AZ_WarningOnce("Terrain", !m_isRequestInProgress, "Detected cyclic dependences with terrain height entity references"); + AZ_WarningOnce("Terrain", !m_isRequestInProgress, "Detected cyclic dependencies with terrain height entity references"); if (!m_isRequestInProgress) { m_isRequestInProgress = true; diff --git a/Gems/Vegetation/Code/Source/Components/AreaBlenderComponent.cpp b/Gems/Vegetation/Code/Source/Components/AreaBlenderComponent.cpp index 8bf48de58e..2025ed059f 100644 --- a/Gems/Vegetation/Code/Source/Components/AreaBlenderComponent.cpp +++ b/Gems/Vegetation/Code/Source/Components/AreaBlenderComponent.cpp @@ -224,7 +224,7 @@ namespace Vegetation bool result = true; - AZ_WarningOnce("Vegetation", !m_isRequestInProgress, "Detected cyclic dependences with vegetation entity references"); + AZ_WarningOnce("Vegetation", !m_isRequestInProgress, "Detected cyclic dependencies with vegetation entity references"); if (!m_isRequestInProgress) { m_isRequestInProgress = true; @@ -264,7 +264,7 @@ namespace Vegetation return; } - AZ_WarningOnce("Vegetation", !m_isRequestInProgress, "Detected cyclic dependences with vegetation entity references"); + AZ_WarningOnce("Vegetation", !m_isRequestInProgress, "Detected cyclic dependencies with vegetation entity references"); if (!m_isRequestInProgress) { m_isRequestInProgress = true; @@ -295,7 +295,7 @@ namespace Vegetation { AZ_PROFILE_FUNCTION(Entity); - AZ_WarningOnce("Vegetation", !m_isRequestInProgress, "Detected cyclic dependences with vegetation entity references"); + AZ_WarningOnce("Vegetation", !m_isRequestInProgress, "Detected cyclic dependencies with vegetation entity references"); if (!m_isRequestInProgress) { m_isRequestInProgress = true; @@ -320,7 +320,7 @@ namespace Vegetation LmbrCentral::ShapeComponentRequestsBus::EventResult(bounds, GetEntityId(), &LmbrCentral::ShapeComponentRequestsBus::Events::GetEncompassingAabb); } - AZ_WarningOnce("Vegetation", !m_isRequestInProgress, "Detected cyclic dependences with vegetation entity references"); + AZ_WarningOnce("Vegetation", !m_isRequestInProgress, "Detected cyclic dependencies with vegetation entity references"); if (!m_isRequestInProgress) { m_isRequestInProgress = true; @@ -344,7 +344,7 @@ namespace Vegetation AZ::u32 count = 0; - AZ_WarningOnce("Vegetation", !m_isRequestInProgress, "Detected cyclic dependences with vegetation entity references"); + AZ_WarningOnce("Vegetation", !m_isRequestInProgress, "Detected cyclic dependencies with vegetation entity references"); if (!m_isRequestInProgress) { m_isRequestInProgress = true; From a690c76ad4716233f726f60277f72636eebaf295 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Wed, 12 Jan 2022 08:54:22 -0800 Subject: [PATCH 434/948] Fixed depth clipping artifacts for parallax PDO. (#6837) The "precise" keyword was recently added to several shader inputs, but one was missed. This led to inconsistency between the depth and forward passes which resulted in artifacts when parallax pixel depth offset was in use. See https://github.com/o3de/o3de/pull/6536 Testing: I used AtomSampleViewer to make a local baseline of all screenshots in _fulltestsuite_.bv.lua. The only change was to the parallax test cases, which were a clear improvement. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../Assets/Materials/Types/StandardPBR_DepthPass_WithPS.azsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_DepthPass_WithPS.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_DepthPass_WithPS.azsl index 264542cd0a..04fd104407 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_DepthPass_WithPS.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_DepthPass_WithPS.azsl @@ -63,7 +63,7 @@ VSDepthOutput MainVS(VSInput IN) struct PSDepthOutput { - float m_depth : SV_Depth; + precise float m_depth : SV_Depth; }; PSDepthOutput MainPS(VSDepthOutput IN, bool isFrontFace : SV_IsFrontFace) From e31fa88c0093219fd3db6bda1918f88d572ebd46 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Wed, 12 Jan 2022 11:13:40 -0600 Subject: [PATCH 435/948] Removed unused legacy show icons option Signed-off-by: Chris Galvan --- .../EditorPreferencesPageViewportGeneral.cpp | 10 -- .../EditorPreferencesPageViewportGeneral.h | 2 - Code/Editor/EditorViewportWidget.cpp | 2 - Code/Editor/Objects/BaseObject.cpp | 151 ------------------ Code/Editor/Objects/BaseObject.h | 10 -- .../Objects/ComponentEntityObject.cpp | 91 ----------- .../Objects/ComponentEntityObject.h | 2 - Code/Editor/Settings.cpp | 7 - Code/Editor/Settings.h | 7 - 9 files changed, 282 deletions(-) diff --git a/Code/Editor/EditorPreferencesPageViewportGeneral.cpp b/Code/Editor/EditorPreferencesPageViewportGeneral.cpp index 77560e24f8..f33cc3f725 100644 --- a/Code/Editor/EditorPreferencesPageViewportGeneral.cpp +++ b/Code/Editor/EditorPreferencesPageViewportGeneral.cpp @@ -41,8 +41,6 @@ void CEditorPreferencesPage_ViewportGeneral::Reflect(AZ::SerializeContext& seria ->Field("ShowBBoxes", &Display::m_showBBoxes) ->Field("DrawEntityLabels", &Display::m_drawEntityLabels) ->Field("ShowTriggerBounds", &Display::m_showTriggerBounds) - ->Field("ShowIcons", &Display::m_showIcons) - ->Field("DistanceScaleIcons", &Display::m_distanceScaleIcons) ->Field("ShowFrozenHelpers", &Display::m_showFrozenHelpers) ->Field("FillSelectedShapes", &Display::m_fillSelectedShapes) ->Field("ShowGridGuide", &Display::m_showGridGuide) @@ -118,10 +116,6 @@ void CEditorPreferencesPage_ViewportGeneral::Reflect(AZ::SerializeContext& seria AZ::Edit::UIHandlers::CheckBox, &Display::m_drawEntityLabels, "Always Draw Entity Labels", "Always Draw Entity Labels") ->DataElement( AZ::Edit::UIHandlers::CheckBox, &Display::m_showTriggerBounds, "Always Show Trigger Bounds", "Always Show Trigger Bounds") - ->DataElement(AZ::Edit::UIHandlers::CheckBox, &Display::m_showIcons, "Show Object Icons", "Show Object Icons") - ->DataElement( - AZ::Edit::UIHandlers::CheckBox, &Display::m_distanceScaleIcons, "Scale Object Icons with Distance", - "Scale Object Icons with Distance") ->DataElement( AZ::Edit::UIHandlers::CheckBox, &Display::m_showFrozenHelpers, "Show Helpers of Frozen Objects", "Show Helpers of Frozen Objects") @@ -244,8 +238,6 @@ void CEditorPreferencesPage_ViewportGeneral::OnApply() } gSettings.viewports.bDrawEntityLabels = m_display.m_drawEntityLabels; gSettings.viewports.bShowTriggerBounds = m_display.m_showTriggerBounds; - gSettings.viewports.bShowIcons = m_display.m_showIcons; - gSettings.viewports.bDistanceScaleIcons = m_display.m_distanceScaleIcons; gSettings.viewports.nShowFrozenHelpers = m_display.m_showFrozenHelpers; gSettings.viewports.bFillSelectedShapes = m_display.m_fillSelectedShapes; gSettings.viewports.bShowGridGuide = m_display.m_showGridGuide; @@ -300,8 +292,6 @@ void CEditorPreferencesPage_ViewportGeneral::InitializeSettings() m_display.m_showBBoxes = (ds->GetRenderFlags() & RENDER_FLAG_BBOX) == RENDER_FLAG_BBOX; m_display.m_drawEntityLabels = gSettings.viewports.bDrawEntityLabels; m_display.m_showTriggerBounds = gSettings.viewports.bShowTriggerBounds; - m_display.m_showIcons = gSettings.viewports.bShowIcons; - m_display.m_distanceScaleIcons = gSettings.viewports.bDistanceScaleIcons; m_display.m_showFrozenHelpers = gSettings.viewports.nShowFrozenHelpers; m_display.m_fillSelectedShapes = gSettings.viewports.bFillSelectedShapes; m_display.m_showGridGuide = gSettings.viewports.bShowGridGuide; diff --git a/Code/Editor/EditorPreferencesPageViewportGeneral.h b/Code/Editor/EditorPreferencesPageViewportGeneral.h index be89cc6df4..2d2a207d6c 100644 --- a/Code/Editor/EditorPreferencesPageViewportGeneral.h +++ b/Code/Editor/EditorPreferencesPageViewportGeneral.h @@ -62,8 +62,6 @@ private: bool m_showBBoxes; bool m_drawEntityLabels; bool m_showTriggerBounds; - bool m_showIcons; - bool m_distanceScaleIcons; bool m_showFrozenHelpers; bool m_fillSelectedShapes; bool m_showGridGuide; diff --git a/Code/Editor/EditorViewportWidget.cpp b/Code/Editor/EditorViewportWidget.cpp index 828812fb7e..e9a57dba4f 100644 --- a/Code/Editor/EditorViewportWidget.cpp +++ b/Code/Editor/EditorViewportWidget.cpp @@ -1027,8 +1027,6 @@ void EditorViewportWidget::OnTitleMenu(QMenu* menu) AZ::ViewportHelpers::AddCheckbox(menu, tr("Show Safe Frame"), &gSettings.viewports.bShowSafeFrame); AZ::ViewportHelpers::AddCheckbox(menu, tr("Show Construction Plane"), &gSettings.snap.constructPlaneDisplay); AZ::ViewportHelpers::AddCheckbox(menu, tr("Show Trigger Bounds"), &gSettings.viewports.bShowTriggerBounds); - AZ::ViewportHelpers::AddCheckbox(menu, tr("Show Icons"), &gSettings.viewports.bShowIcons, &gSettings.viewports.bShowSizeBasedIcons); - AZ::ViewportHelpers::AddCheckbox(menu, tr("Show Size-based Icons"), &gSettings.viewports.bShowSizeBasedIcons, &gSettings.viewports.bShowIcons); AZ::ViewportHelpers::AddCheckbox(menu, tr("Show Helpers of Frozen Objects"), &gSettings.viewports.nShowFrozenHelpers); if (!m_predefinedAspectRatios.IsEmpty()) diff --git a/Code/Editor/Objects/BaseObject.cpp b/Code/Editor/Objects/BaseObject.cpp index 86840789dd..5ae68eaad7 100644 --- a/Code/Editor/Objects/BaseObject.cpp +++ b/Code/Editor/Objects/BaseObject.cpp @@ -761,72 +761,6 @@ void CBaseObject::SetModified(bool) { } -void CBaseObject::DrawDefault(DisplayContext& dc, const QColor& labelColor) -{ - Vec3 wp = GetWorldPos(); - - bool bDisplaySelectionHelper = false; - if (!CanBeDrawn(dc, bDisplaySelectionHelper)) - { - return; - } - - // Draw link between parent and child. - if (dc.flags & DISPLAY_LINKS) - { - if (GetParent()) - { - dc.DrawLine(GetParentAttachPointWorldTM().GetTranslation(), wp, IsFrozen() ? kLinkColorGray : kLinkColorParent, IsFrozen() ? kLinkColorGray : kLinkColorChild); - } - size_t nChildCount = GetChildCount(); - for (size_t i = 0; i < nChildCount; ++i) - { - const CBaseObject* pChild = GetChild(i); - dc.DrawLine(pChild->GetParentAttachPointWorldTM().GetTranslation(), pChild->GetWorldPos(), pChild->IsFrozen() ? kLinkColorGray : kLinkColorParent, pChild->IsFrozen() ? kLinkColorGray : kLinkColorChild); - } - } - - // Draw Bounding box - if (dc.flags & DISPLAY_BBOX) - { - AABB box; - GetBoundBox(box); - dc.SetColor(Vec3(1, 1, 1)); - dc.DrawWireBox(box.min, box.max); - } - - if (IsHighlighted()) - { - DrawHighlight(dc); - } - - if (IsSelected()) - { - DrawArea(dc); - - CSelectionGroup* pSelection = GetObjectManager()->GetSelection(); - - // If the number of selected object is over 2, the merged boundbox should be used to render the measurement axis. - if (!pSelection || (pSelection && pSelection->GetCount() == 1)) - { - DrawDimensions(dc); - } - } - - if (bDisplaySelectionHelper) - { - DrawSelectionHelper(dc, wp, labelColor, 1.0f); - } - else if (!(dc.flags & DISPLAY_HIDENAMES)) - { - DrawLabel(dc, wp, labelColor); - } - - SetDrawTextureIconProperties(dc, wp); - DrawTextureIcon(dc, wp); - DrawWarningIcons(dc, wp); -} - ////////////////////////////////////////////////////////////////////////// void CBaseObject::DrawDimensions(DisplayContext&, AABB*) { @@ -850,91 +784,6 @@ void CBaseObject::DrawSelectionHelper(DisplayContext& dc, const Vec3& pos, const dc.SetState(nPrevState); } -////////////////////////////////////////////////////////////////////////// -void CBaseObject::SetDrawTextureIconProperties(DisplayContext& dc, const Vec3& pos, float alpha, int texIconFlags) -{ - if (gSettings.viewports.bShowIcons || gSettings.viewports.bShowSizeBasedIcons) - { - if (IsHighlighted()) - { - dc.SetColor(QColor(255, 120, 0), 0.8f * alpha); - } - else if (IsSelected()) - { - dc.SetSelectedColor(alpha); - } - else if (IsFrozen()) - { - dc.SetFreezeColor(); - } - else - { - dc.SetColor(QColor(255, 255, 255), alpha); - } - - m_vDrawIconPos = pos; - - int nIconFlags = texIconFlags; - if (CheckFlags(OBJFLAG_SHOW_ICONONTOP)) - { - Vec3 objectPos = GetWorldPos(); - - AABB box; - GetBoundBox(box); - m_vDrawIconPos.z = (m_vDrawIconPos.z - objectPos.z) + box.max.z; - nIconFlags |= DisplayContext::TEXICON_ALIGN_BOTTOM; - } - m_nIconFlags = nIconFlags; - } -} - -////////////////////////////////////////////////////////////////////////// -void CBaseObject::DrawTextureIcon(DisplayContext& dc, [[maybe_unused]] const Vec3& pos, [[maybe_unused]] float alpha) -{ - if (m_nTextureIcon && (gSettings.viewports.bShowIcons || gSettings.viewports.bShowSizeBasedIcons)) - { - dc.DrawTextureLabel(GetTextureIconDrawPos(), OBJECT_TEXTURE_ICON_SIZEX, OBJECT_TEXTURE_ICON_SIZEY, GetTextureIcon(), GetTextureIconFlags()); - } -} - -////////////////////////////////////////////////////////////////////////// -void CBaseObject::DrawWarningIcons(DisplayContext& dc, const Vec3&) -{ - if (gSettings.viewports.bShowIcons || gSettings.viewports.bShowSizeBasedIcons) - { - const int warningIconSizeX = OBJECT_TEXTURE_ICON_SIZEX / 2; - const int warningIconSizeY = OBJECT_TEXTURE_ICON_SIZEY / 2; - - const int iconOffsetX = m_nTextureIcon ? (-OBJECT_TEXTURE_ICON_SIZEX / 2) : 0; - const int iconOffsetY = m_nTextureIcon ? (-OBJECT_TEXTURE_ICON_SIZEY / 2) : 0; - - if (gSettings.viewports.bShowScaleWarnings) - { - const EScaleWarningLevel scaleWarningLevel = GetScaleWarningLevel(); - - if (scaleWarningLevel != eScaleWarningLevel_None) - { - dc.SetColor(QColor(255, scaleWarningLevel == eScaleWarningLevel_RescaledNonUniform ? 50 : 255, 50), 1.0f); - dc.DrawTextureLabel(GetTextureIconDrawPos(), warningIconSizeX, warningIconSizeY, - GetIEditor()->GetIconManager()->GetIconTexture(eIcon_ScaleWarning), GetTextureIconFlags(), - -warningIconSizeX / 2, iconOffsetX - (warningIconSizeY / 2)); - } - } - - if (gSettings.viewports.bShowRotationWarnings) - { - const ERotationWarningLevel rotationWarningLevel = GetRotationWarningLevel(); - if (rotationWarningLevel != eRotationWarningLevel_None) - { - dc.SetColor(QColor(255, rotationWarningLevel == eRotationWarningLevel_RotatedNonRectangular ? 50 : 255, 50), 1.0f); - dc.DrawTextureLabel(GetTextureIconDrawPos(), warningIconSizeX, warningIconSizeY, - GetIEditor()->GetIconManager()->GetIconTexture(eIcon_RotationWarning), GetTextureIconFlags(), - warningIconSizeX / 2, iconOffsetY - (warningIconSizeY / 2)); - } - } - } -} - ////////////////////////////////////////////////////////////////////////// void CBaseObject::DrawLabel(DisplayContext& dc, const Vec3& pos, const QColor& lC, float alpha, float size) { diff --git a/Code/Editor/Objects/BaseObject.h b/Code/Editor/Objects/BaseObject.h index f78755e81d..fea248c7f7 100644 --- a/Code/Editor/Objects/BaseObject.h +++ b/Code/Editor/Objects/BaseObject.h @@ -398,9 +398,6 @@ public: // Interface to be implemented in plugins. ////////////////////////////////////////////////////////////////////////// - //! Draw object to specified viewport. - virtual void Display([[maybe_unused]] DisplayContext& disp) {} - //! Perform intersection testing of this object. //! Return true if was hit. virtual bool HitTest([[maybe_unused]] HitContext& hc) { return false; }; @@ -529,8 +526,6 @@ protected: void ResolveParent(CBaseObject* object); void SetColor(const QColor& color); - //! Draw default object items. - virtual void DrawDefault(DisplayContext& dc, const QColor& labelColor = QColor(255, 255, 255)); //! Draw object label. void DrawLabel(DisplayContext& dc, const Vec3& pos, const QColor& labelColor = QColor(255, 255, 255), float alpha = 1.0f, float size = 1.f); //! Draw 3D Axis at object position. @@ -539,10 +534,6 @@ protected: void DrawArea(DisplayContext& dc); //! Draw selection helper. void DrawSelectionHelper(DisplayContext& dc, const Vec3& pos, const QColor& labelColor = QColor(255, 255, 255), float alpha = 1.0f); - //! Draw helper icon. - virtual void DrawTextureIcon(DisplayContext& dc, const Vec3& pos, float alpha = 1.0f); - //! Draw warning icons - virtual void DrawWarningIcons(DisplayContext& dc, const Vec3& pos); //! Check if dimension's figures can be displayed before draw them. virtual void DrawDimensions(DisplayContext& dc, AABB* pMergedBoundBox = nullptr); @@ -575,7 +566,6 @@ protected: //! Only used by ObjectManager. bool IsPotentiallyVisible() const; - void SetDrawTextureIconProperties(DisplayContext& dc, const Vec3& pos, float alpha = 1.0f, int texIconFlags = 0); const Vec3& GetTextureIconDrawPos(){ return m_vDrawIconPos; }; int GetTextureIconFlags(){ return m_nIconFlags; }; diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.cpp index fbb700723b..a70c200417 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.cpp +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.cpp @@ -723,97 +723,6 @@ CComponentEntityObject* CComponentEntityObject::FindObjectForEntity(AZ::EntityId return nullptr; } -void CComponentEntityObject::Display(DisplayContext& dc) -{ - if (!(dc.flags & DISPLAY_2D)) - { - m_entityIconVisible = false; - } - - bool displaySelectionHelper = false; - if (!CanBeDrawn(dc, displaySelectionHelper)) - { - return; - } - - DrawDefault(dc); - - bool showIcons = m_hasIcon; - if (showIcons) - { - SEditorSettings* editorSettings = GetIEditor()->GetEditorSettings(); - if (!editorSettings->viewports.bShowIcons && !editorSettings->viewports.bShowSizeBasedIcons) - { - showIcons = false; - } - } - - if (m_entityId.IsValid()) - { - // Draw link to parent if this or the parent object are selected. - { - AZ::EntityId parentId; - EBUS_EVENT_ID_RESULT(parentId, m_entityId, AZ::TransformBus, GetParentId); - if (parentId.IsValid()) - { - bool isParentVisible = false; - AzToolsFramework::EditorEntityInfoRequestBus::EventResult(isParentVisible, parentId, &AzToolsFramework::EditorEntityInfoRequestBus::Events::IsVisible); - - CComponentEntityObject* parentObject = CComponentEntityObject::FindObjectForEntity(parentId); - if (isParentVisible && (IsSelected() || (parentObject && parentObject->IsSelected()))) - { - const QColor kLinkColorParent(0, 255, 255); - const QColor kLinkColorChild(0, 0, 255); - - AZ::Vector3 parentTranslation; - EBUS_EVENT_ID_RESULT(parentTranslation, parentId, AZ::TransformBus, GetWorldTranslation); - dc.DrawLine(AZVec3ToLYVec3(parentTranslation), GetWorldTM().GetTranslation(), kLinkColorParent, kLinkColorChild); - } - } - } - - // Don't draw icons if we have an ancestor in the same location that has an icon - makes sure - // ancestor icons draw on top and are able to be selected over children. Also check if a descendant - // is selected at the same location. In cases of entity hierarchies where numerous ancestors have - // no position offset, we need this so the ancestors don't draw over us when we're selected - if (showIcons) - { - if ((dc.flags & DISPLAY_2D) || - IsSelected() || - IsAncestorIconDrawingAtSameLocation() || - IsDescendantSelectedAtSameLocation()) - { - showIcons = false; - } - } - - // Allow components to override in-editor visualization. - { - const AzFramework::DisplayContextRequestGuard displayContextGuard(dc); - - AzFramework::DebugDisplayRequestBus::BusPtr debugDisplayBus; - AzFramework::DebugDisplayRequestBus::Bind( - debugDisplayBus, AzFramework::g_defaultSceneEntityDebugDisplayId); - AZ_Assert(debugDisplayBus, "Invalid DebugDisplayRequestBus."); - - AzFramework::DebugDisplayRequests* debugDisplay = - AzFramework::DebugDisplayRequestBus::FindFirstHandler(debugDisplayBus); - - AzFramework::EntityDebugDisplayEventBus::Event( - m_entityId, &AzFramework::EntityDebugDisplayEvents::DisplayEntityViewport, - AzFramework::ViewportInfo{ dc.GetView()->asCViewport()->GetViewportId() }, - *debugDisplay); - } - } -} - -void CComponentEntityObject::DrawDefault(DisplayContext& dc, const QColor& labelColor) -{ - CEntityObject::DrawDefault(dc, labelColor); - - DrawAccent(dc); -} - bool CComponentEntityObject::IsIsolated() const { return m_isIsolated; diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.h b/Code/Editor/Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.h index 7ccea8da84..62209965a5 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.h +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.h @@ -55,7 +55,6 @@ public: bool SetRotation(const Quat& rotate, int flags) override; bool SetScale(const Vec3& scale, int flags) override; void InvalidateTM(int nWhyFlags) override; - void Display(DisplayContext& disp) override; bool HitTest(HitContext& hc) override; void GetLocalBounds(AABB& box) override; void GetBoundBox(AABB& box) override; @@ -69,7 +68,6 @@ public: void DetachThis(bool bKeepPos = true) override; XmlNodeRef Export(const QString& levelPath, XmlNodeRef& xmlNode) override; void DeleteEntity() override; - void DrawDefault(DisplayContext& dc, const QColor& labelColor = QColor(255, 255, 255)) override; bool IsIsolated() const override; bool IsSelected() const override; diff --git a/Code/Editor/Settings.cpp b/Code/Editor/Settings.cpp index acb48c3545..8561e6dba3 100644 --- a/Code/Editor/Settings.cpp +++ b/Code/Editor/Settings.cpp @@ -142,9 +142,6 @@ SEditorSettings::SEditorSettings() viewports.bShowMeshStatsOnMouseOver = false; viewports.bDrawEntityLabels = false; viewports.bShowTriggerBounds = false; - viewports.bShowIcons = true; - viewports.bDistanceScaleIcons = true; - viewports.bShowSizeBasedIcons = false; viewports.nShowFrozenHelpers = true; viewports.bFillSelectedShapes = false; viewports.nTopMapTextureResolution = 512; @@ -534,8 +531,6 @@ void SEditorSettings::Save(bool isEditorClosing) SaveValue("Settings", "ShowMeshStatsOnMouseOver", viewports.bShowMeshStatsOnMouseOver); SaveValue("Settings", "DrawEntityLabels", viewports.bDrawEntityLabels); SaveValue("Settings", "ShowTriggerBounds", viewports.bShowTriggerBounds); - SaveValue("Settings", "ShowIcons", viewports.bShowIcons); - SaveValue("Settings", "ShowSizeBasedIcons", viewports.bShowSizeBasedIcons); SaveValue("Settings", "ShowFrozenHelpers", viewports.nShowFrozenHelpers); SaveValue("Settings", "FillSelectedShapes", viewports.bFillSelectedShapes); SaveValue("Settings", "MapTextureResolution", viewports.nTopMapTextureResolution); @@ -736,8 +731,6 @@ void SEditorSettings::Load() LoadValue("Settings", "ShowMeshStatsOnMouseOver", viewports.bShowMeshStatsOnMouseOver); LoadValue("Settings", "DrawEntityLabels", viewports.bDrawEntityLabels); LoadValue("Settings", "ShowTriggerBounds", viewports.bShowTriggerBounds); - LoadValue("Settings", "ShowIcons", viewports.bShowIcons); - LoadValue("Settings", "ShowSizeBasedIcons", viewports.bShowSizeBasedIcons); LoadValue("Settings", "ShowFrozenHelpers", viewports.nShowFrozenHelpers); LoadValue("Settings", "FillSelectedShapes", viewports.bFillSelectedShapes); LoadValue("Settings", "MapTextureResolution", viewports.nTopMapTextureResolution); diff --git a/Code/Editor/Settings.h b/Code/Editor/Settings.h index 9276d9b715..0ebb70501d 100644 --- a/Code/Editor/Settings.h +++ b/Code/Editor/Settings.h @@ -136,13 +136,6 @@ struct SViewportsSettings bool bDrawEntityLabels; //! Show Trigger bounds. bool bShowTriggerBounds; - //! Show Icons in viewport. - bool bShowIcons; - //! Scale icons with distance, so they aren't a fixed size no matter how far away you are - bool bDistanceScaleIcons; - - //! Show Size-based Icons in viewport. - bool bShowSizeBasedIcons; //! Show Helpers in viewport for frozen objects. int nShowFrozenHelpers; From bd65da39d0033b504d7da196e86cd9e5a30ec337 Mon Sep 17 00:00:00 2001 From: lsemp3d <58790905+lsemp3d@users.noreply.github.com> Date: Wed, 12 Jan 2022 10:20:04 -0800 Subject: [PATCH 436/948] Updated node subtitle Signed-off-by: lsemp3d <58790905+lsemp3d@users.noreply.github.com> --- .../EBus/Senders/UiFlipbookAnimationBus.names | 75 ++++++++++++------- 1 file changed, 50 insertions(+), 25 deletions(-) diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/EBus/Senders/UiFlipbookAnimationBus.names b/Gems/ScriptCanvas/Assets/TranslationAssets/EBus/Senders/UiFlipbookAnimationBus.names index c0f62a816b..e869048b0c 100644 --- a/Gems/ScriptCanvas/Assets/TranslationAssets/EBus/Senders/UiFlipbookAnimationBus.names +++ b/Gems/ScriptCanvas/Assets/TranslationAssets/EBus/Senders/UiFlipbookAnimationBus.names @@ -21,7 +21,8 @@ }, "details": { "name": "Get Loop Type", - "tooltip": "Gets the type of looping behavior for the animation" + "tooltip": "Gets the type of looping behavior for the animation", + "subtitle": "UI Flipbook" }, "results": [ { @@ -44,7 +45,8 @@ }, "details": { "name": "Get Reverse Delay", - "tooltip": "Gets the delay (in seconds) before playing the reverse loop sequence (PingPong loop types only)" + "tooltip": "Gets the delay (in seconds) before playing the reverse loop sequence (PingPong loop types only)", + "subtitle": "UI Flipbook" }, "results": [ { @@ -67,7 +69,8 @@ }, "details": { "name": "Set Is Auto Play Enabled", - "tooltip": "Sets whether the animation will begin playing as soon as the element is activated" + "tooltip": "Sets whether the animation will begin playing as soon as the element is activated", + "subtitle": "UI Flipbook" }, "params": [ { @@ -91,7 +94,8 @@ }, "details": { "name": "Set Current Frame", - "tooltip": "Sets the frame to immediately display for the animation" + "tooltip": "Sets the frame to immediately display for the animation", + "subtitle": "UI Flipbook" }, "params": [ { @@ -115,7 +119,8 @@ }, "details": { "name": "Get Loop Start Frame", - "tooltip": "Gets the first frame that is displayed within an animation loop. Applicable only when the \"Loop Type\" is set to anything other than \"None\"" + "tooltip": "Gets the first frame that is displayed within an animation loop. Applicable only when the \"Loop Type\" is set to anything other than \"None\"", + "subtitle": "UI Flipbook" }, "results": [ { @@ -138,7 +143,8 @@ }, "details": { "name": "Set Loop Type", - "tooltip": "Sets the type of looping behavior for this animation" + "tooltip": "Sets the type of looping behavior for this animation", + "subtitle": "UI Flipbook" }, "params": [ { @@ -162,7 +168,8 @@ }, "details": { "name": "Get Start Delay", - "tooltip": "Gets the delay (in seconds) before playing the flipbook (applied only once during playback)" + "tooltip": "Gets the delay (in seconds) before playing the flipbook (applied only once during playback)", + "subtitle": "UI Flipbook" }, "results": [ { @@ -185,7 +192,8 @@ }, "details": { "name": "Set Start Delay", - "tooltip": "Sets the delay (in seconds) before playing the flipbook (applied only once during playback)" + "tooltip": "Sets the delay (in seconds) before playing the flipbook (applied only once during playback)", + "subtitle": "UI Flipbook" }, "params": [ { @@ -209,7 +217,8 @@ }, "details": { "name": "Get Current Frame", - "tooltip": "Gets the frame of the animation currently displayed" + "tooltip": "Gets the frame of the animation currently displayed", + "subtitle": "UI Flipbook" }, "results": [ { @@ -232,7 +241,8 @@ }, "details": { "name": "Get Framerate", - "tooltip": "Gets the speed used to determine when to transition to the next frame. Framerate is defined relative to unit of time, specified by FramerateUnits" + "tooltip": "Gets the speed used to determine when to transition to the next frame. Framerate is defined relative to unit of time, specified by FramerateUnits", + "subtitle": "UI Flipbook" }, "results": [ { @@ -255,7 +265,8 @@ }, "details": { "name": "Set Loop Delay", - "tooltip": "Sets the delay (in seconds) before playing the loop sequence" + "tooltip": "Sets the delay (in seconds) before playing the loop sequence", + "subtitle": "UI Flipbook" }, "params": [ { @@ -279,7 +290,8 @@ }, "details": { "name": "Get Start Frame", - "tooltip": "Gets the first frame to display when starting the animation" + "tooltip": "Gets the first frame to display when starting the animation", + "subtitle": "UI Flipbook" }, "results": [ { @@ -302,7 +314,8 @@ }, "details": { "name": "Set Framerate Unit", - "tooltip": "Sets the framerate unit (0 = Frames per second, 1 = Seconds per frame)" + "tooltip": "Sets the framerate unit (0 = Frames per second, 1 = Seconds per frame)", + "subtitle": "UI Flipbook" }, "params": [ { @@ -326,7 +339,8 @@ }, "details": { "name": "Is Playing", - "tooltip": "Returns whether the animation is currently playing" + "tooltip": "Returns whether the animation is currently playing", + "subtitle": "UI Flipbook" }, "results": [ { @@ -349,7 +363,8 @@ }, "details": { "name": "Set End Frame", - "tooltip": "Sets the last frame to display for the animation" + "tooltip": "Sets the last frame to display for the animation", + "subtitle": "UI Flipbook" }, "params": [ { @@ -373,7 +388,8 @@ }, "details": { "name": "Set Loop Start Frame", - "tooltip": "Sets the first frame that is displayed within an animation loop. Applicable only when the \"Loop Type\" is set to anything other than \"None\"" + "tooltip": "Sets the first frame that is displayed within an animation loop. Applicable only when the \"Loop Type\" is set to anything other than \"None\"", + "subtitle": "UI Flipbook" }, "params": [ { @@ -397,7 +413,8 @@ }, "details": { "name": "Set Reverse Delay", - "tooltip": "Sets the delay (in seconds) before playing the reverse loop sequence (PingPong loop types only)" + "tooltip": "Sets the delay (in seconds) before playing the reverse loop sequence (PingPong loop types only)", + "subtitle": "UI Flipbook" }, "params": [ { @@ -421,7 +438,8 @@ }, "details": { "name": "Stop", - "tooltip": "Ends the animation" + "tooltip": "Ends the animation", + "subtitle": "UI Flipbook" } }, { @@ -436,7 +454,8 @@ }, "details": { "name": "Set Framerate", - "tooltip": "Sets the speed used to determine when to transition to the next frame. Framerate is defined relative to unit of time, specified by FramerateUnits" + "tooltip": "Sets the speed used to determine when to transition to the next frame. Framerate is defined relative to unit of time, specified by FramerateUnits", + "subtitle": "UI Flipbook" }, "params": [ { @@ -460,7 +479,8 @@ }, "details": { "name": "Is Auto Play Enabled", - "tooltip": "Returns whether the animation will begin playing as soon as the element is activated" + "tooltip": "Returns whether the animation will begin playing as soon as the element is activated", + "subtitle": "UI Flipbook" }, "results": [ { @@ -483,7 +503,8 @@ }, "details": { "name": "Start", - "tooltip": "Begins playing the flipbook animation" + "tooltip": "Begins playing the flipbook animation", + "subtitle": "UI Flipbook" } }, { @@ -498,7 +519,8 @@ }, "details": { "name": "Set Start Frame", - "tooltip": "Sets the first frame to display when starting the animation" + "tooltip": "Sets the first frame to display when starting the animation", + "subtitle": "UI Flipbook" }, "params": [ { @@ -522,7 +544,8 @@ }, "details": { "name": "Get End Frame", - "tooltip": "Gets the last frame to display for the animation" + "tooltip": "Gets the last frame to display for the animation", + "subtitle": "UI Flipbook" }, "results": [ { @@ -545,7 +568,8 @@ }, "details": { "name": "Get Framerate Unit", - "tooltip": "Gets the framerate unit (0 = Frames per second, 1 = Seconds per frame)" + "tooltip": "Gets the framerate unit (0 = Frames per second, 1 = Seconds per frame)", + "subtitle": "UI Flipbook" }, "results": [ { @@ -568,7 +592,8 @@ }, "details": { "name": "Get Loop Delay", - "tooltip": "Gets the delay (in seconds) before playing the loop sequence" + "tooltip": "Gets the delay (in seconds) before playing the loop sequence", + "subtitle": "UI Flipbook" }, "results": [ { From 010e8a5df1a1c10f42de01f25d071a68cdcdb381 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Wed, 12 Jan 2022 12:28:52 -0600 Subject: [PATCH 437/948] Reverted changes to image gradient asset (will put in separate PR) Signed-off-by: Chris Galvan --- Gems/GradientSignal/Code/CMakeLists.txt | 1 - .../Components/ImageGradientComponent.h | 3 -- .../Code/Include/GradientSignal/ImageAsset.h | 3 +- .../GradientSignal/Code/Source/ImageAsset.cpp | 28 ++++++++++--------- 4 files changed, 16 insertions(+), 19 deletions(-) diff --git a/Gems/GradientSignal/Code/CMakeLists.txt b/Gems/GradientSignal/Code/CMakeLists.txt index 08d6c82926..d4cf666630 100644 --- a/Gems/GradientSignal/Code/CMakeLists.txt +++ b/Gems/GradientSignal/Code/CMakeLists.txt @@ -21,7 +21,6 @@ ly_add_target( AZ::AzCore AZ::AtomCore AZ::AzFramework - Gem::Atom_RPI.Public Gem::SurfaceData Gem::ImageProcessingAtom.Headers Gem::LmbrCentral diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h index bbb22a061d..85aa33137b 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h @@ -11,8 +11,6 @@ #include #include -#include - #include #include #include @@ -36,7 +34,6 @@ namespace GradientSignal AZ_RTTI(ImageGradientConfig, "{1BDB5DA4-A4A8-452B-BE6D-6BD451D4E7CD}", AZ::ComponentConfig); static void Reflect(AZ::ReflectContext* context); AZ::Data::Asset m_imageAsset = { AZ::Data::AssetLoadBehavior::QueueLoad }; - AZ::Data::Asset m_streamingImageAsset = { AZ::Data::AssetLoadBehavior::QueueLoad }; float m_tilingX = 1.0f; float m_tilingY = 1.0f; }; diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/ImageAsset.h b/Gems/GradientSignal/Code/Include/GradientSignal/ImageAsset.h index 811d74082d..4ffab0b4b4 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/ImageAsset.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/ImageAsset.h @@ -12,7 +12,6 @@ #include #include #include -#include namespace AZ { @@ -62,6 +61,6 @@ namespace GradientSignal } }; - float GetValueFromImageAsset(const AZ::Data::Asset& imageAsset, const AZ::Vector3& uvw, float tilingX, float tilingY, float defaultValue); + float GetValueFromImageAsset(const AZ::Data::Asset& imageAsset, const AZ::Vector3& uvw, float tilingX, float tilingY, float defaultValue); } // namespace GradientSignal diff --git a/Gems/GradientSignal/Code/Source/ImageAsset.cpp b/Gems/GradientSignal/Code/Source/ImageAsset.cpp index e88a574768..95d32fced1 100644 --- a/Gems/GradientSignal/Code/Source/ImageAsset.cpp +++ b/Gems/GradientSignal/Code/Source/ImageAsset.cpp @@ -20,7 +20,6 @@ namespace { - // Could (should) move these RetrieveValue helper methods over to where our new API lives template float RetrieveValue(const AZ::u8* mem, size_t index) { @@ -152,17 +151,17 @@ namespace GradientSignal return true; } - float GetValueFromImageAsset(const AZ::Data::Asset& imageAsset, const AZ::Vector3& uvw, float tilingX, float tilingY, float defaultValue) + float GetValueFromImageAsset(const AZ::Data::Asset& imageAsset, const AZ::Vector3& uvw, float tilingX, float tilingY, float defaultValue) { if (imageAsset.IsReady()) { - const AZ::RHI::ImageDescriptor imageDescriptor = imageAsset->GetImageDescriptor(); - auto width = imageDescriptor.m_size.m_width; - auto height = imageDescriptor.m_size.m_height; + const auto& image = imageAsset.Get(); + AZStd::size_t imageSize = image->m_imageWidth * image->m_imageHeight * + static_cast(image->m_bytesPerPixel); - if (width > 0 - && height > 0 - ) + if (image->m_imageWidth > 0 && + image->m_imageHeight > 0 && + image->m_imageData.size() == imageSize) { // When "rasterizing" from uvs, a range of 0-1 has slightly different meanings depending on the sampler state. // For repeating states (Unbounded/None, Repeat), a uv value of 1 should wrap around back to our 0th pixel. @@ -185,8 +184,8 @@ namespace GradientSignal // A 16x16 pixel image and tilingX = tilingY = 1 maps the uv range of 0-1 to 0-16 pixels. // A 16x16 pixel image and tilingX = tilingY = 1.5 maps the uv range of 0-1 to 0-24 pixels. - const AZ::Vector3 tiledDimensions((width * tilingX), - (height * tilingY), + const AZ::Vector3 tiledDimensions((image->m_imageWidth * tilingX), + (image->m_imageHeight * tilingY), 0.0f); // Convert from uv space back to pixel space @@ -195,10 +194,13 @@ namespace GradientSignal // UVs outside the 0-1 range are treated as infinitely tiling, so that we behave the same as the // other gradient generators. As mentioned above, if clamping is desired, we expect it to be applied // outside of this function. - uint32_t x = static_cast(pixelLookup.GetX()) % width; - uint32_t y = static_cast(pixelLookup.GetY()) % height; + size_t x = static_cast(pixelLookup.GetX()) % image->m_imageWidth; + size_t y = static_cast(pixelLookup.GetY()) % image->m_imageHeight; - return imageAsset->GetSubImagePixelValue(x, y); + // Flip the y because images are stored in reverse of our world axes + size_t index = ((image->m_imageHeight - 1) - y) * image->m_imageWidth + x; + + return RetrieveValue(image->m_imageData.data(), index, image->m_imageFormat); } } From 830c55dd7c3e0597bbba2479143ef44b45508b9a Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Wed, 12 Jan 2022 12:30:48 -0600 Subject: [PATCH 438/948] Reverted two other small changes I missed Signed-off-by: Chris Galvan --- .../Include/GradientSignal/Components/ImageGradientComponent.h | 1 - Gems/GradientSignal/Code/Source/ImageAsset.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h index 85aa33137b..8214436f83 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h @@ -10,7 +10,6 @@ #include #include - #include #include #include diff --git a/Gems/GradientSignal/Code/Source/ImageAsset.cpp b/Gems/GradientSignal/Code/Source/ImageAsset.cpp index 95d32fced1..7e73dc32d6 100644 --- a/Gems/GradientSignal/Code/Source/ImageAsset.cpp +++ b/Gems/GradientSignal/Code/Source/ImageAsset.cpp @@ -184,7 +184,7 @@ namespace GradientSignal // A 16x16 pixel image and tilingX = tilingY = 1 maps the uv range of 0-1 to 0-16 pixels. // A 16x16 pixel image and tilingX = tilingY = 1.5 maps the uv range of 0-1 to 0-24 pixels. - const AZ::Vector3 tiledDimensions((image->m_imageWidth * tilingX), + const AZ::Vector3 tiledDimensions((image->m_imageWidth * tilingX), (image->m_imageHeight * tilingY), 0.0f); From 5b195cb028781c8738da4d9e7ff587f0f940c0aa Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Wed, 12 Jan 2022 12:33:36 -0600 Subject: [PATCH 439/948] Removed some unused variables Signed-off-by: Chris Galvan --- Code/Editor/Objects/BaseObject.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Code/Editor/Objects/BaseObject.cpp b/Code/Editor/Objects/BaseObject.cpp index 5ae68eaad7..c14547407b 100644 --- a/Code/Editor/Objects/BaseObject.cpp +++ b/Code/Editor/Objects/BaseObject.cpp @@ -36,12 +36,6 @@ // To use the Andrew's algorithm in order to make convex hull from the points, this header is needed. #include "Util/GeometryUtil.h" -namespace { - QColor kLinkColorParent = QColor(0, 255, 255); - QColor kLinkColorChild = QColor(0, 0, 255); - QColor kLinkColorGray = QColor(128, 128, 128); -} - extern CObjectManager* g_pObjectManager; ////////////////////////////////////////////////////////////////////////// From b772d7b3e8abd15acaf1db40d5a79357927f014d Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Wed, 12 Jan 2022 11:10:34 -0800 Subject: [PATCH 440/948] Removing multiplayer script canvas translation files from the scriptcanvas gem; these will eventually move into AutomatedTesting project once repopulated (if needed). Signed-off-by: Gene Walters --- ...orityToAutonomousNoParamsNotifyEvent.names | 50 -- .../AuthorityToAutonomousNotifyEvent.names | 56 --- ...AuthorityToClientNoParamsNotifyEvent.names | 50 -- .../AuthorityToClientNotifyEvent.names | 56 --- ...nomousToAuthorityNoParamsNotifyEvent.names | 50 -- .../AutonomousToAuthorityNotifyEvent.names | 56 --- .../ServerToAuthorityNoParamNotifyEvent.names | 50 -- .../ServerToAuthorityNotifyEvent.names | 56 --- .../Classes/NetworkTestPlayerComponent.names | 438 ------------------ ...tworkTestPlayerComponentNetworkInput.names | 129 ------ 10 files changed, 991 deletions(-) delete mode 100644 Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToAutonomousNoParamsNotifyEvent.names delete mode 100644 Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToAutonomousNotifyEvent.names delete mode 100644 Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToClientNoParamsNotifyEvent.names delete mode 100644 Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToClientNotifyEvent.names delete mode 100644 Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AutonomousToAuthorityNoParamsNotifyEvent.names delete mode 100644 Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AutonomousToAuthorityNotifyEvent.names delete mode 100644 Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/ServerToAuthorityNoParamNotifyEvent.names delete mode 100644 Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/ServerToAuthorityNotifyEvent.names delete mode 100644 Gems/ScriptCanvas/Assets/TranslationAssets/Classes/NetworkTestPlayerComponent.names delete mode 100644 Gems/ScriptCanvas/Assets/TranslationAssets/Classes/NetworkTestPlayerComponentNetworkInput.names diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToAutonomousNoParamsNotifyEvent.names b/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToAutonomousNoParamsNotifyEvent.names deleted file mode 100644 index 216212ca4a..0000000000 --- a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToAutonomousNoParamsNotifyEvent.names +++ /dev/null @@ -1,50 +0,0 @@ -{ - "entries": [ - { - "base": "AuthorityToAutonomousNoParams Notify Event", - "context": "AZEventHandler", - "variant": "", - "details": { - "name": "Authority To Autonomous No Params Notify Event" - }, - "slots": [ - { - "base": "AuthorityToAutonomousNoParams Notify Event", - "details": { - "name": "AuthorityToAutonomousNoParams Notify Event" - } - }, - { - "base": "Connect", - "details": { - "name": "Connect" - } - }, - { - "base": "Disconnect", - "details": { - "name": "Disconnect" - } - }, - { - "base": "On Connected", - "details": { - "name": "On Connected" - } - }, - { - "base": "On Disconnected", - "details": { - "name": "On Disconnected" - } - }, - { - "base": "OnEvent", - "details": { - "name": "OnEvent" - } - } - ] - } - ] -} \ No newline at end of file diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToAutonomousNotifyEvent.names b/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToAutonomousNotifyEvent.names deleted file mode 100644 index 50c0ec6013..0000000000 --- a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToAutonomousNotifyEvent.names +++ /dev/null @@ -1,56 +0,0 @@ -{ - "entries": [ - { - "base": "AuthorityToAutonomous Notify Event", - "context": "AZEventHandler", - "variant": "", - "details": { - "name": "Authority To Autonomous Notify Event" - }, - "slots": [ - { - "base": "someFloat", - "details": { - "name": "someFloat" - } - }, - { - "base": "AuthorityToAutonomous Notify Event", - "details": { - "name": "AuthorityToAutonomous Notify Event" - } - }, - { - "base": "Connect", - "details": { - "name": "Connect" - } - }, - { - "base": "Disconnect", - "details": { - "name": "Disconnect" - } - }, - { - "base": "On Connected", - "details": { - "name": "On Connected" - } - }, - { - "base": "On Disconnected", - "details": { - "name": "On Disconnected" - } - }, - { - "base": "OnEvent", - "details": { - "name": "OnEvent" - } - } - ] - } - ] -} \ No newline at end of file diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToClientNoParamsNotifyEvent.names b/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToClientNoParamsNotifyEvent.names deleted file mode 100644 index bf5b975d63..0000000000 --- a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToClientNoParamsNotifyEvent.names +++ /dev/null @@ -1,50 +0,0 @@ -{ - "entries": [ - { - "base": "AuthorityToClientNoParams Notify Event", - "context": "AZEventHandler", - "variant": "", - "details": { - "name": "Authority To Client No Params Notify Event" - }, - "slots": [ - { - "base": "AuthorityToClientNoParams Notify Event", - "details": { - "name": "AuthorityToClientNoParams Notify Event" - } - }, - { - "base": "Connect", - "details": { - "name": "Connect" - } - }, - { - "base": "Disconnect", - "details": { - "name": "Disconnect" - } - }, - { - "base": "On Connected", - "details": { - "name": "On Connected" - } - }, - { - "base": "On Disconnected", - "details": { - "name": "On Disconnected" - } - }, - { - "base": "OnEvent", - "details": { - "name": "OnEvent" - } - } - ] - } - ] -} \ No newline at end of file diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToClientNotifyEvent.names b/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToClientNotifyEvent.names deleted file mode 100644 index d3ba2e9299..0000000000 --- a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AuthorityToClientNotifyEvent.names +++ /dev/null @@ -1,56 +0,0 @@ -{ - "entries": [ - { - "base": "AuthorityToClient Notify Event", - "context": "AZEventHandler", - "variant": "", - "details": { - "name": "Authority To Client Notify Event" - }, - "slots": [ - { - "base": "someFloat", - "details": { - "name": "someFloat" - } - }, - { - "base": "AuthorityToClient Notify Event", - "details": { - "name": "AuthorityToClient Notify Event" - } - }, - { - "base": "Connect", - "details": { - "name": "Connect" - } - }, - { - "base": "Disconnect", - "details": { - "name": "Disconnect" - } - }, - { - "base": "On Connected", - "details": { - "name": "On Connected" - } - }, - { - "base": "On Disconnected", - "details": { - "name": "On Disconnected" - } - }, - { - "base": "OnEvent", - "details": { - "name": "OnEvent" - } - } - ] - } - ] -} \ No newline at end of file diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AutonomousToAuthorityNoParamsNotifyEvent.names b/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AutonomousToAuthorityNoParamsNotifyEvent.names deleted file mode 100644 index ba5f7aec0c..0000000000 --- a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AutonomousToAuthorityNoParamsNotifyEvent.names +++ /dev/null @@ -1,50 +0,0 @@ -{ - "entries": [ - { - "base": "AutonomousToAuthorityNoParams Notify Event", - "context": "AZEventHandler", - "variant": "", - "details": { - "name": "Autonomous To Authority No Params Notify Event" - }, - "slots": [ - { - "base": "AutonomousToAuthorityNoParams Notify Event", - "details": { - "name": "AutonomousToAuthorityNoParams Notify Event" - } - }, - { - "base": "Connect", - "details": { - "name": "Connect" - } - }, - { - "base": "Disconnect", - "details": { - "name": "Disconnect" - } - }, - { - "base": "On Connected", - "details": { - "name": "On Connected" - } - }, - { - "base": "On Disconnected", - "details": { - "name": "On Disconnected" - } - }, - { - "base": "OnEvent", - "details": { - "name": "OnEvent" - } - } - ] - } - ] -} \ No newline at end of file diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AutonomousToAuthorityNotifyEvent.names b/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AutonomousToAuthorityNotifyEvent.names deleted file mode 100644 index 73566d177e..0000000000 --- a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/AutonomousToAuthorityNotifyEvent.names +++ /dev/null @@ -1,56 +0,0 @@ -{ - "entries": [ - { - "base": "AutonomousToAuthority Notify Event", - "context": "AZEventHandler", - "variant": "", - "details": { - "name": "Autonomous To Authority Notify Event" - }, - "slots": [ - { - "base": "someFloat", - "details": { - "name": "someFloat" - } - }, - { - "base": "AutonomousToAuthority Notify Event", - "details": { - "name": "AutonomousToAuthority Notify Event" - } - }, - { - "base": "Connect", - "details": { - "name": "Connect" - } - }, - { - "base": "Disconnect", - "details": { - "name": "Disconnect" - } - }, - { - "base": "On Connected", - "details": { - "name": "On Connected" - } - }, - { - "base": "On Disconnected", - "details": { - "name": "On Disconnected" - } - }, - { - "base": "OnEvent", - "details": { - "name": "OnEvent" - } - } - ] - } - ] -} \ No newline at end of file diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/ServerToAuthorityNoParamNotifyEvent.names b/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/ServerToAuthorityNoParamNotifyEvent.names deleted file mode 100644 index b6694211cd..0000000000 --- a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/ServerToAuthorityNoParamNotifyEvent.names +++ /dev/null @@ -1,50 +0,0 @@ -{ - "entries": [ - { - "base": "ServerToAuthorityNoParam Notify Event", - "context": "AZEventHandler", - "variant": "", - "details": { - "name": "Server To Authority No Param Notify Event" - }, - "slots": [ - { - "base": "ServerToAuthorityNoParam Notify Event", - "details": { - "name": "ServerToAuthorityNoParam Notify Event" - } - }, - { - "base": "Connect", - "details": { - "name": "Connect" - } - }, - { - "base": "Disconnect", - "details": { - "name": "Disconnect" - } - }, - { - "base": "On Connected", - "details": { - "name": "On Connected" - } - }, - { - "base": "On Disconnected", - "details": { - "name": "On Disconnected" - } - }, - { - "base": "OnEvent", - "details": { - "name": "OnEvent" - } - } - ] - } - ] -} \ No newline at end of file diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/ServerToAuthorityNotifyEvent.names b/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/ServerToAuthorityNotifyEvent.names deleted file mode 100644 index 71ab303260..0000000000 --- a/Gems/ScriptCanvas/Assets/TranslationAssets/AZEvents/ServerToAuthorityNotifyEvent.names +++ /dev/null @@ -1,56 +0,0 @@ -{ - "entries": [ - { - "base": "ServerToAuthority Notify Event", - "context": "AZEventHandler", - "variant": "", - "details": { - "name": "Server To Authority Notify Event" - }, - "slots": [ - { - "base": "someFloat", - "details": { - "name": "someFloat" - } - }, - { - "base": "ServerToAuthority Notify Event", - "details": { - "name": "ServerToAuthority Notify Event" - } - }, - { - "base": "Connect", - "details": { - "name": "Connect" - } - }, - { - "base": "Disconnect", - "details": { - "name": "Disconnect" - } - }, - { - "base": "On Connected", - "details": { - "name": "On Connected" - } - }, - { - "base": "On Disconnected", - "details": { - "name": "On Disconnected" - } - }, - { - "base": "OnEvent", - "details": { - "name": "OnEvent" - } - } - ] - } - ] -} \ No newline at end of file diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/Classes/NetworkTestPlayerComponent.names b/Gems/ScriptCanvas/Assets/TranslationAssets/Classes/NetworkTestPlayerComponent.names deleted file mode 100644 index 22636e0453..0000000000 --- a/Gems/ScriptCanvas/Assets/TranslationAssets/Classes/NetworkTestPlayerComponent.names +++ /dev/null @@ -1,438 +0,0 @@ -{ - "entries": [ - { - "base": "NetworkTestPlayerComponent", - "context": "BehaviorClass", - "variant": "", - "details": { - "name": "Network Test Player Component" - }, - "methods": [ - { - "base": "AutonomousToAuthority", - "context": "NetworkTestPlayerComponent", - "entry": { - "name": "In", - "tooltip": "When signaled, this will invoke Autonomous To Authority" - }, - "exit": { - "name": "Out", - "tooltip": "Signaled after Autonomous To Authority is invoked" - }, - "details": { - "name": "Autonomous To Authority" - }, - "params": [ - { - "typeid": "{CA5E5C37-98A6-04D2-E15C-1B4BFEE4C7DD}", - "details": { - "name": "Network Test Player Component" - } - }, - { - "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", - "details": { - "name": "float" - } - } - ] - }, - { - "base": "ServerToAuthority", - "context": "NetworkTestPlayerComponent", - "entry": { - "name": "In", - "tooltip": "When signaled, this will invoke Server To Authority" - }, - "exit": { - "name": "Out", - "tooltip": "Signaled after Server To Authority is invoked" - }, - "details": { - "name": "Server To Authority" - }, - "params": [ - { - "typeid": "{CA5E5C37-98A6-04D2-E15C-1B4BFEE4C7DD}", - "details": { - "name": "Network Test Player Component" - } - }, - { - "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", - "details": { - "name": "float" - } - } - ] - }, - { - "base": "AutonomousToAuthorityByEntityId", - "context": "NetworkTestPlayerComponent", - "entry": { - "name": "In", - "tooltip": "When signaled, this will invoke Autonomous To Authority By Entity Id" - }, - "exit": { - "name": "Out", - "tooltip": "Signaled after Autonomous To Authority By Entity Id is invoked" - }, - "details": { - "name": "Autonomous To Authority By Entity Id" - }, - "params": [ - { - "typeid": "{6383F1D3-BB27-4E6B-A49A-6409B2059EAA}", - "details": { - "name": "Source", - "tooltip": "The Source containing the NetworkTestPlayerComponentController" - } - }, - { - "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", - "details": { - "name": "some Float" - } - } - ] - }, - { - "base": "ServerToAuthorityByEntityId", - "context": "NetworkTestPlayerComponent", - "entry": { - "name": "In", - "tooltip": "When signaled, this will invoke Server To Authority By Entity Id" - }, - "exit": { - "name": "Out", - "tooltip": "Signaled after Server To Authority By Entity Id is invoked" - }, - "details": { - "name": "Server To Authority By Entity Id" - }, - "params": [ - { - "typeid": "{6383F1D3-BB27-4E6B-A49A-6409B2059EAA}", - "details": { - "name": "Source", - "tooltip": "The Source containing the NetworkTestPlayerComponentController" - } - }, - { - "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", - "details": { - "name": "some Float" - } - } - ] - }, - { - "base": "AutonomousToAuthorityNoParams", - "context": "NetworkTestPlayerComponent", - "entry": { - "name": "In", - "tooltip": "When signaled, this will invoke Autonomous To Authority No Params" - }, - "exit": { - "name": "Out", - "tooltip": "Signaled after Autonomous To Authority No Params is invoked" - }, - "details": { - "name": "Autonomous To Authority No Params" - }, - "params": [ - { - "typeid": "{CA5E5C37-98A6-04D2-E15C-1B4BFEE4C7DD}", - "details": { - "name": "Network Test Player Component" - } - } - ] - }, - { - "base": "AuthorityToAutonomous", - "context": "NetworkTestPlayerComponent", - "entry": { - "name": "In", - "tooltip": "When signaled, this will invoke Authority To Autonomous" - }, - "exit": { - "name": "Out", - "tooltip": "Signaled after Authority To Autonomous is invoked" - }, - "details": { - "name": "Authority To Autonomous" - }, - "params": [ - { - "typeid": "{CA5E5C37-98A6-04D2-E15C-1B4BFEE4C7DD}", - "details": { - "name": "Network Test Player Component" - } - }, - { - "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", - "details": { - "name": "float" - } - } - ] - }, - { - "base": "AuthorityToClientNoParams", - "context": "NetworkTestPlayerComponent", - "entry": { - "name": "In", - "tooltip": "When signaled, this will invoke Authority To Client No Params" - }, - "exit": { - "name": "Out", - "tooltip": "Signaled after Authority To Client No Params is invoked" - }, - "details": { - "name": "Authority To Client No Params" - }, - "params": [ - { - "typeid": "{CA5E5C37-98A6-04D2-E15C-1B4BFEE4C7DD}", - "details": { - "name": "Network Test Player Component" - } - } - ] - }, - { - "base": "AuthorityToClientByEntityId", - "context": "NetworkTestPlayerComponent", - "entry": { - "name": "In", - "tooltip": "When signaled, this will invoke Authority To Client By Entity Id" - }, - "exit": { - "name": "Out", - "tooltip": "Signaled after Authority To Client By Entity Id is invoked" - }, - "details": { - "name": "Authority To Client By Entity Id" - }, - "params": [ - { - "typeid": "{6383F1D3-BB27-4E6B-A49A-6409B2059EAA}", - "details": { - "name": "Source", - "tooltip": "The Source containing the NetworkTestPlayerComponentController" - } - }, - { - "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", - "details": { - "name": "some Float" - } - } - ] - }, - { - "base": "AuthorityToClient", - "context": "NetworkTestPlayerComponent", - "entry": { - "name": "In", - "tooltip": "When signaled, this will invoke Authority To Client" - }, - "exit": { - "name": "Out", - "tooltip": "Signaled after Authority To Client is invoked" - }, - "details": { - "name": "Authority To Client" - }, - "params": [ - { - "typeid": "{CA5E5C37-98A6-04D2-E15C-1B4BFEE4C7DD}", - "details": { - "name": "Network Test Player Component" - } - }, - { - "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", - "details": { - "name": "float" - } - } - ] - }, - { - "base": "AuthorityToAutonomousNoParams", - "context": "NetworkTestPlayerComponent", - "entry": { - "name": "In", - "tooltip": "When signaled, this will invoke Authority To Autonomous No Params" - }, - "exit": { - "name": "Out", - "tooltip": "Signaled after Authority To Autonomous No Params is invoked" - }, - "details": { - "name": "Authority To Autonomous No Params" - }, - "params": [ - { - "typeid": "{CA5E5C37-98A6-04D2-E15C-1B4BFEE4C7DD}", - "details": { - "name": "Network Test Player Component" - } - } - ] - }, - { - "base": "ServerToAuthorityNoParamByEntityId", - "context": "NetworkTestPlayerComponent", - "entry": { - "name": "In", - "tooltip": "When signaled, this will invoke Server To Authority No Param By Entity Id" - }, - "exit": { - "name": "Out", - "tooltip": "Signaled after Server To Authority No Param By Entity Id is invoked" - }, - "details": { - "name": "Server To Authority No Param By Entity Id" - }, - "params": [ - { - "typeid": "{6383F1D3-BB27-4E6B-A49A-6409B2059EAA}", - "details": { - "name": "Source", - "tooltip": "The Source containing the NetworkTestPlayerComponentController" - } - } - ] - }, - { - "base": "AuthorityToClientNoParamsByEntityId", - "context": "NetworkTestPlayerComponent", - "entry": { - "name": "In", - "tooltip": "When signaled, this will invoke Authority To Client No Params By Entity Id" - }, - "exit": { - "name": "Out", - "tooltip": "Signaled after Authority To Client No Params By Entity Id is invoked" - }, - "details": { - "name": "Authority To Client No Params By Entity Id" - }, - "params": [ - { - "typeid": "{6383F1D3-BB27-4E6B-A49A-6409B2059EAA}", - "details": { - "name": "Source", - "tooltip": "The Source containing the NetworkTestPlayerComponentController" - } - } - ] - }, - { - "base": "AuthorityToAutonomousByEntityId", - "context": "NetworkTestPlayerComponent", - "entry": { - "name": "In", - "tooltip": "When signaled, this will invoke Authority To Autonomous By Entity Id" - }, - "exit": { - "name": "Out", - "tooltip": "Signaled after Authority To Autonomous By Entity Id is invoked" - }, - "details": { - "name": "Authority To Autonomous By Entity Id" - }, - "params": [ - { - "typeid": "{6383F1D3-BB27-4E6B-A49A-6409B2059EAA}", - "details": { - "name": "Source", - "tooltip": "The Source containing the NetworkTestPlayerComponentController" - } - }, - { - "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", - "details": { - "name": "some Float" - } - } - ] - }, - { - "base": "AutonomousToAuthorityNoParamsByEntityId", - "context": "NetworkTestPlayerComponent", - "entry": { - "name": "In", - "tooltip": "When signaled, this will invoke Autonomous To Authority No Params By Entity Id" - }, - "exit": { - "name": "Out", - "tooltip": "Signaled after Autonomous To Authority No Params By Entity Id is invoked" - }, - "details": { - "name": "Autonomous To Authority No Params By Entity Id" - }, - "params": [ - { - "typeid": "{6383F1D3-BB27-4E6B-A49A-6409B2059EAA}", - "details": { - "name": "Source", - "tooltip": "The Source containing the NetworkTestPlayerComponentController" - } - } - ] - }, - { - "base": "AuthorityToAutonomousNoParamsByEntityId", - "context": "NetworkTestPlayerComponent", - "entry": { - "name": "In", - "tooltip": "When signaled, this will invoke Authority To Autonomous No Params By Entity Id" - }, - "exit": { - "name": "Out", - "tooltip": "Signaled after Authority To Autonomous No Params By Entity Id is invoked" - }, - "details": { - "name": "Authority To Autonomous No Params By Entity Id" - }, - "params": [ - { - "typeid": "{6383F1D3-BB27-4E6B-A49A-6409B2059EAA}", - "details": { - "name": "Source", - "tooltip": "The Source containing the NetworkTestPlayerComponentController" - } - } - ] - }, - { - "base": "ServerToAuthorityNoParam", - "context": "NetworkTestPlayerComponent", - "entry": { - "name": "In", - "tooltip": "When signaled, this will invoke Server To Authority No Param" - }, - "exit": { - "name": "Out", - "tooltip": "Signaled after Server To Authority No Param is invoked" - }, - "details": { - "name": "Server To Authority No Param" - }, - "params": [ - { - "typeid": "{CA5E5C37-98A6-04D2-E15C-1B4BFEE4C7DD}", - "details": { - "name": "Network Test Player Component" - } - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/Classes/NetworkTestPlayerComponentNetworkInput.names b/Gems/ScriptCanvas/Assets/TranslationAssets/Classes/NetworkTestPlayerComponentNetworkInput.names deleted file mode 100644 index d8c016db0f..0000000000 --- a/Gems/ScriptCanvas/Assets/TranslationAssets/Classes/NetworkTestPlayerComponentNetworkInput.names +++ /dev/null @@ -1,129 +0,0 @@ -{ - "entries": [ - { - "base": "NetworkTestPlayerComponentNetworkInput", - "context": "BehaviorClass", - "variant": "", - "details": { - "name": "Network Test Player Component Network Input" - }, - "methods": [ - { - "base": "CreateFromValues", - "context": "NetworkTestPlayerComponentNetworkInput", - "entry": { - "name": "In", - "tooltip": "When signaled, this will invoke Create From Values" - }, - "exit": { - "name": "Out", - "tooltip": "Signaled after Create From Values is invoked" - }, - "details": { - "name": "Create From Values" - }, - "params": [ - { - "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", - "details": { - "name": "left Right" - } - } - ], - "results": [ - { - "typeid": "{12A1776B-61F6-4E5F-356A-AD718A62051F}", - "details": { - "name": "Network Test Player Component Network Input" - } - } - ] - }, - { - "base": "GetFwdBack", - "details": { - "name": "Get Fwd Back" - }, - "params": [ - { - "typeid": "{12A1776B-61F6-4E5F-356A-AD718A62051F}", - "details": { - "name": "Network Test Player Component Network Input" - } - } - ], - "results": [ - { - "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", - "details": { - "name": "Fwd Back" - } - } - ] - }, - { - "base": "SetFwdBack", - "details": { - "name": "Set Fwd Back" - }, - "params": [ - { - "typeid": "{12A1776B-61F6-4E5F-356A-AD718A62051F}", - "details": { - "name": "Network Test Player Component Network Input" - } - }, - { - "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", - "details": { - "name": "Fwd Back" - } - } - ] - }, - { - "base": "GetLeftRight", - "details": { - "name": "Get Left Right" - }, - "params": [ - { - "typeid": "{12A1776B-61F6-4E5F-356A-AD718A62051F}", - "details": { - "name": "Network Test Player Component Network Input" - } - } - ], - "results": [ - { - "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", - "details": { - "name": "Left Right" - } - } - ] - }, - { - "base": "SetLeftRight", - "details": { - "name": "Set Left Right" - }, - "params": [ - { - "typeid": "{12A1776B-61F6-4E5F-356A-AD718A62051F}", - "details": { - "name": "Network Test Player Component Network Input" - } - }, - { - "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", - "details": { - "name": "Left Right" - } - } - ] - } - ] - } - ] -} \ No newline at end of file From 561ff40c8154c335ad435086923a20aefa66a2d5 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Wed, 12 Jan 2022 11:13:10 -0800 Subject: [PATCH 441/948] Creating a new multiplayer component which we'll assign to a networked level entity (as opposed to a network player). Signed-off-by: Gene Walters --- ...workTestLevelEntityComponent.AutoComponent.xml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestLevelEntityComponent.AutoComponent.xml diff --git a/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestLevelEntityComponent.AutoComponent.xml b/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestLevelEntityComponent.AutoComponent.xml new file mode 100644 index 0000000000..2fd196a2f6 --- /dev/null +++ b/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestLevelEntityComponent.AutoComponent.xml @@ -0,0 +1,15 @@ + + + + + + + + + From ee3196d64a9d31929951ad60134b22dbe4b1db02 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Wed, 12 Jan 2022 11:31:45 -0800 Subject: [PATCH 442/948] Removed an RPC that's now being used inside the NetLevelEntity autocomponent Signed-off-by: Gene Walters --- .../Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml b/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml index 251d2b25af..b4dd35d741 100644 --- a/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml +++ b/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml @@ -29,8 +29,6 @@ - - From 068244b1bb28191758637028864505c2b727b890 Mon Sep 17 00:00:00 2001 From: amzn-sj Date: Wed, 12 Jan 2022 12:00:33 -0800 Subject: [PATCH 443/948] Remove quotes around list of paths (#6857) Signed-off-by: amzn-sj --- cmake/Platform/Mac/runtime_dependencies_mac.cmake.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in b/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in index 51e6e5830c..c27bf1fde4 100644 --- a/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in +++ b/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in @@ -187,7 +187,7 @@ if(@target_file_dir@ MATCHES ".app/Contents/MacOS") ) file(GLOB_RECURSE exe_file_list "${bundle_path}/Contents/Frameworks/Python.framework/**/*.exe") if(exe_file_list) - file(REMOVE_RECURSE "${exe_file_list}") + file(REMOVE_RECURSE ${exe_file_list}) endif() execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink include/python3.7m Headers WORKING_DIRECTORY "${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7" From 5dc442fcb0f2946cd104849b9bc814be134b9426 Mon Sep 17 00:00:00 2001 From: amzn-sj Date: Wed, 12 Jan 2022 12:07:57 -0800 Subject: [PATCH 444/948] [Terrain] First pass of the ProcessList and ProcessRegion APIs for retrieving surface data (#6729) * [Terrain] First pass of the ProcessList and ProcessRegion APIs for retrieving surface data Signed-off-by: amzn-sj * Add a couple of more tests. The expected values were plugged in based on the values generated by the brute force approach. Signed-off-by: amzn-sj * Move some declarations out of loops since they can be reused. Signed-off-by: amzn-sj * Update all the per position callbacks to pass SurfacePoint refs. Construct only one SurfacePoint object outside the loop which can be reused. Signed-off-by: amzn-sj * Update tests to use the new per position callbacks Signed-off-by: amzn-sj * Add ProcessRegion functions to the terrain benchmark. Signed-off-by: amzn-sj * Change C style static casts to aznumeric_cast. Add maybe_unused to unused params in benchmarks. Signed-off-by: amzn-sj * Update the ProcessList API functions to use array_view instead of a vector. This includes some additional changes to satisfy build dependencies. Signed-off-by: amzn-sj * Add ProcessList API functions to benchmarks Signed-off-by: amzn-sj * Update the ProcessList API functions to take Vector2 as input positions Signed-off-by: amzn-sj * Revert changes to AtomCore library split. Add partial implementation of span(mostly just copied over from array_view) to AzCore std containers. Signed-off-by: amzn-sj * Adding some const/non-const overloads that were missing in span Signed-off-by: amzn-sj * Move input position list generation to a function Signed-off-by: amzn-sj * Bring back Vector3 version of ProcessList functions. Rename Vector2 version to follow similar pattern as the Get functions. Signed-off-by: amzn-sj * Split span.h into .h/.inl files Signed-off-by: amzn-sj * Add [mayby_unused] for unused parameters to fix build errors Signed-off-by: amzn-sj --- .../AzCore/AzCore/std/azstd_files.cmake | 2 + .../AzCore/AzCore/std/containers/span.h | 137 ++++++++ .../AzCore/AzCore/std/containers/span.inl | 150 ++++++++ .../Terrain/TerrainDataRequestBus.h | 50 +++ .../Mocks/Terrain/MockTerrainDataRequestBus.h | 24 ++ .../Source/TerrainSystem/TerrainSystem.cpp | 274 +++++++++++++-- .../Code/Source/TerrainSystem/TerrainSystem.h | 47 +++ .../Code/Tests/TerrainSystemBenchmarks.cpp | 262 ++++++++++++++ Gems/Terrain/Code/Tests/TerrainSystemTest.cpp | 330 ++++++++++++++++++ 9 files changed, 1247 insertions(+), 29 deletions(-) create mode 100644 Code/Framework/AzCore/AzCore/std/containers/span.h create mode 100644 Code/Framework/AzCore/AzCore/std/containers/span.inl diff --git a/Code/Framework/AzCore/AzCore/std/azstd_files.cmake b/Code/Framework/AzCore/AzCore/std/azstd_files.cmake index 2746489f8c..d516a56295 100644 --- a/Code/Framework/AzCore/AzCore/std/azstd_files.cmake +++ b/Code/Framework/AzCore/AzCore/std/azstd_files.cmake @@ -64,6 +64,8 @@ set(FILES containers/rbtree.h containers/ring_buffer.h containers/set.h + containers/span.h + containers/span.inl containers/stack.h containers/unordered_map.h containers/unordered_set.h diff --git a/Code/Framework/AzCore/AzCore/std/containers/span.h b/Code/Framework/AzCore/AzCore/std/containers/span.h new file mode 100644 index 0000000000..8f68e921d8 --- /dev/null +++ b/Code/Framework/AzCore/AzCore/std/containers/span.h @@ -0,0 +1,137 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ +#pragma once + +#include +#include +#include + +namespace AZStd +{ + /** + * First pass partial implementation of span copied over from array_view. It + * returns non-const iterator/pointers. first(), last(), and subspan() + * are yet to be implemented. It does not maintain storage for the data, + * but just holds pointers to mark the beginning and end of the array. + * It can be conveniently constructed from a variety of other container + * types like array, vector, and fixed_vector. + * + * Example: + * Given "void Func(AZStd::span a) {...}" you can call... + * - Func({1,2,3}); + * - AZStd::array a = {1,2,3}; + * Func(a); + * - AZStd::vector v = {1,2,3}; + * Func(v); + * - AZStd::fixed_vector fv = {1,2,3}; + * Func(fv); + * + * Since the span does not copy and store any data, it is only valid as long as the data used to create it is valid. + */ + template + class span final + { + public: + using value_type = Element; + + using pointer = value_type*; + using const_pointer = const value_type*; + + using reference = value_type&; + using const_reference = const value_type&; + + using size_type = AZStd::size_t; + using difference_type = AZStd::ptrdiff_t; + + using iterator = value_type*; + using const_iterator = const value_type*; + using reverse_iterator = AZStd::reverse_iterator; + using const_reverse_iterator = AZStd::reverse_iterator; + + constexpr span(); + + ~span() = default; + + constexpr span(pointer s, size_type length); + + constexpr span(pointer first, const_pointer last); + + // We explicitly delete this constructor because it's too easy to accidentally + // create a span to just the first element instead of an entire array. + constexpr span(const_pointer s) = delete; + + template + constexpr span(AZStd::array& data); + + constexpr span(AZStd::vector& data); + + template + constexpr span(AZStd::fixed_vector& data); + + template + constexpr span(const AZStd::array& data); + + constexpr span(const AZStd::vector& data); + + template + constexpr span(const AZStd::fixed_vector& data); + + constexpr span(const span&) = default; + + constexpr span(span&& other); + + constexpr span& operator=(const span& other) = default; + + constexpr span& operator=(span&& other); + + constexpr size_type size() const; + + constexpr bool empty() const; + + constexpr pointer data(); + constexpr const_pointer data() const; + + constexpr const_reference operator[](size_type index) const; + constexpr reference operator[](size_type index); + + constexpr void erase(); + + constexpr iterator begin(); + constexpr iterator end(); + constexpr const_iterator begin() const; + constexpr const_iterator end() const; + + constexpr const_iterator cbegin() const; + constexpr const_iterator cend() const; + + constexpr reverse_iterator rbegin(); + constexpr reverse_iterator rend(); + constexpr const_reverse_iterator rbegin() const; + constexpr const_reverse_iterator rend() const; + + constexpr const_reverse_iterator crbegin() const; + constexpr const_reverse_iterator crend() const; + + friend bool operator==(span lhs, span rhs) + { + return lhs.m_begin == rhs.m_begin && lhs.m_end == rhs.m_end; + } + + friend bool operator!=(span lhs, span rhs) { return !(lhs == rhs); } + friend bool operator< (span lhs, span rhs) { return lhs.m_begin < rhs.m_begin || lhs.m_begin == rhs.m_begin && lhs.m_end < rhs.m_end; } + friend bool operator> (span lhs, span rhs) { return lhs.m_begin > rhs.m_begin || lhs.m_begin == rhs.m_begin && lhs.m_end > rhs.m_end; } + friend bool operator<=(span lhs, span rhs) { return lhs == rhs || lhs < rhs; } + friend bool operator>=(span lhs, span rhs) { return lhs == rhs || lhs > rhs; } + + private: + pointer m_begin; + pointer m_end; + }; +} // namespace AZStd + +#include diff --git a/Code/Framework/AzCore/AzCore/std/containers/span.inl b/Code/Framework/AzCore/AzCore/std/containers/span.inl new file mode 100644 index 0000000000..c33e4a7227 --- /dev/null +++ b/Code/Framework/AzCore/AzCore/std/containers/span.inl @@ -0,0 +1,150 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * 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 AZStd +{ + template + inline constexpr span::span() + : m_begin(nullptr) + , m_end(nullptr) + { } + + template + inline constexpr span::span(pointer s, size_type length) + : m_begin(s) + , m_end(m_begin + length) + { + if (length == 0) erase(); + } + + template + inline constexpr span::span(pointer first, const_pointer last) + : m_begin(first) + , m_end(last) + { } + + template + template + inline constexpr span::span(AZStd::array& data) + : m_begin(data.data()) + , m_end(m_begin + data.size()) + { } + + template + inline constexpr span::span(AZStd::vector& data) + : m_begin(data.data()) + , m_end(m_begin + data.size()) + { } + + template + template + inline constexpr span::span(AZStd::fixed_vector& data) + : m_begin(data.data()) + , m_end(m_begin + data.size()) + { } + + template + template + inline constexpr span::span(const AZStd::array& data) + : m_begin(data.data()) + , m_end(m_begin + data.size()) + { } + + template + inline constexpr span::span(const AZStd::vector& data) + : m_begin(data.data()) + , m_end(m_begin + data.size()) + { } + + template + template + inline constexpr span::span(const AZStd::fixed_vector& data) + : m_begin(data.data()) + , m_end(m_begin + data.size()) + { } + + template + inline constexpr span::span(span&& other) + : span(other.m_begin, other.m_end) + { +#if AZ_DEBUG_BUILD // Clearing the original pointers isn't necessary, but is good for debugging + other.m_begin = nullptr; + other.m_end = nullptr; +#endif + } + + template + inline constexpr AZStd::size_t span::size() const { return m_end - m_begin; } + + template + inline constexpr bool span::empty() const { return m_end == m_begin; } + + template + inline constexpr Element* span::data() { return m_begin; } + + template + inline constexpr const Element* span::data() const { return m_begin; } + + template + inline constexpr span& span::operator=(span&& other) + { + m_begin = other.m_begin; + m_end = other.m_end; +#if AZ_DEBUG_BUILD // Clearing the original pointers isn't necessary, but is good for debugging + other.m_begin = nullptr; + other.m_end = nullptr; +#endif + return *this; + } + + template + inline constexpr const Element& span::operator[](AZStd::size_t index) const + { + AZ_Assert(index < size(), "index value is out of range"); + return m_begin[index]; + } + + template + inline constexpr Element& span::operator[](AZStd::size_t index) + { + AZ_Assert(index < size(), "index value is out of range"); + return m_begin[index]; + } + + template + inline constexpr void span::erase() { m_begin = m_end = nullptr; } + + template + inline constexpr Element* span::begin() { return m_begin; } + template + inline constexpr Element* span::end() { return m_end; } + template + inline constexpr const Element* span::begin() const { return m_begin; } + template + inline constexpr const Element* span::end() const { return m_end; } + + template + inline constexpr const Element* span::cbegin() const { return m_begin; } + template + inline constexpr const Element* span::cend() const { return m_end; } + + template + inline constexpr AZStd::reverse_iterator span::rbegin() { return AZStd::reverse_iterator(m_end); } + template + inline constexpr AZStd::reverse_iterator span::rend() { return AZStd::reverse_iterator(m_begin); } + template + inline constexpr AZStd::reverse_iterator span::rbegin() const { return AZStd::reverse_iterator(m_end); } + template + inline constexpr AZStd::reverse_iterator span::rend() const { return AZStd::reverse_iterator(m_begin); } + + template + inline constexpr AZStd::reverse_iterator span::crbegin() const { return AZStd::reverse_iterator(cend()); } + template + inline constexpr AZStd::reverse_iterator span::crend() const { return AZStd::reverse_iterator(cbegin()); } +} // namespace AZStd diff --git a/Code/Framework/AzFramework/AzFramework/Terrain/TerrainDataRequestBus.h b/Code/Framework/AzFramework/AzFramework/Terrain/TerrainDataRequestBus.h index 2572a07494..0d16bf3460 100644 --- a/Code/Framework/AzFramework/AzFramework/Terrain/TerrainDataRequestBus.h +++ b/Code/Framework/AzFramework/AzFramework/Terrain/TerrainDataRequestBus.h @@ -11,12 +11,15 @@ #include #include #include +#include #include namespace AzFramework { namespace Terrain { + typedef AZStd::function SurfacePointRegionFillCallback; + typedef AZStd::function SurfacePointListFillCallback; //! Shared interface for terrain system implementations class TerrainDataRequests @@ -131,6 +134,53 @@ namespace AzFramework Sampler sampleFilter = Sampler::DEFAULT, bool* terrainExistsPtr = nullptr) const = 0; + //! Given a list of XY coordinates, call the provided callback function with surface data corresponding to each + //! XY coordinate in the list. + virtual void ProcessHeightsFromList(const AZStd::span& inPositions, + SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const = 0; + virtual void ProcessNormalsFromList(const AZStd::span& inPositions, + SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const = 0; + virtual void ProcessSurfaceWeightsFromList(const AZStd::span& inPositions, + SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const = 0; + virtual void ProcessSurfacePointsFromList(const AZStd::span& inPositions, + SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const = 0; + virtual void ProcessHeightsFromListOfVector2(const AZStd::span& inPositions, + SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const = 0; + virtual void ProcessNormalsFromListOfVector2(const AZStd::span& inPositions, + SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const = 0; + virtual void ProcessSurfaceWeightsFromListOfVector2(const AZStd::span& inPositions, + SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const = 0; + virtual void ProcessSurfacePointsFromListOfVector2(const AZStd::span& inPositions, + SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const = 0; + + //! Given a region(aabb) and a step size, call the provided callback function with surface data corresponding to the + //! coordinates in the region. + virtual void ProcessHeightsFromRegion(const AZ::Aabb& inRegion, + const AZ::Vector2& stepSize, + SurfacePointRegionFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const = 0; + virtual void ProcessNormalsFromRegion(const AZ::Aabb& inRegion, + const AZ::Vector2& stepSize, + SurfacePointRegionFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const = 0; + virtual void ProcessSurfaceWeightsFromRegion(const AZ::Aabb& inRegion, + const AZ::Vector2& stepSize, + SurfacePointRegionFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const = 0; + virtual void ProcessSurfacePointsFromRegion(const AZ::Aabb& inRegion, + const AZ::Vector2& stepSize, + SurfacePointRegionFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const = 0; + + private: // Private variations of the GetSurfacePoint API exposed to BehaviorContext that returns a value instead of // using an "out" parameter. The "out" parameter is useful for reusing memory allocated in SurfacePoint when diff --git a/Code/Framework/AzFramework/Tests/Mocks/Terrain/MockTerrainDataRequestBus.h b/Code/Framework/AzFramework/Tests/Mocks/Terrain/MockTerrainDataRequestBus.h index dbce11d639..f3a6cc07b3 100644 --- a/Code/Framework/AzFramework/Tests/Mocks/Terrain/MockTerrainDataRequestBus.h +++ b/Code/Framework/AzFramework/Tests/Mocks/Terrain/MockTerrainDataRequestBus.h @@ -76,5 +76,29 @@ namespace UnitTest GetSurfacePointFromVector2, void(const AZ::Vector2&, AzFramework::SurfaceData::SurfacePoint&, Sampler, bool*)); MOCK_CONST_METHOD5( GetSurfacePointFromFloats, void(float, float, AzFramework::SurfaceData::SurfacePoint&, Sampler, bool*)); + MOCK_CONST_METHOD3( + ProcessHeightsFromList, void(const AZStd::span&, AzFramework::Terrain::SurfacePointListFillCallback, Sampler)); + MOCK_CONST_METHOD3( + ProcessNormalsFromList, void(const AZStd::span&, AzFramework::Terrain::SurfacePointListFillCallback, Sampler)); + MOCK_CONST_METHOD3( + ProcessSurfaceWeightsFromList, void(const AZStd::span&, AzFramework::Terrain::SurfacePointListFillCallback, Sampler)); + MOCK_CONST_METHOD3( + ProcessSurfacePointsFromList, void(const AZStd::span&, AzFramework::Terrain::SurfacePointListFillCallback, Sampler)); + MOCK_CONST_METHOD3( + ProcessHeightsFromListOfVector2, void(const AZStd::span&, AzFramework::Terrain::SurfacePointListFillCallback, Sampler)); + MOCK_CONST_METHOD3( + ProcessNormalsFromListOfVector2, void(const AZStd::span&, AzFramework::Terrain::SurfacePointListFillCallback, Sampler)); + MOCK_CONST_METHOD3( + ProcessSurfaceWeightsFromListOfVector2, void(const AZStd::span&, AzFramework::Terrain::SurfacePointListFillCallback, Sampler)); + MOCK_CONST_METHOD3( + ProcessSurfacePointsFromListOfVector2, void(const AZStd::span&, AzFramework::Terrain::SurfacePointListFillCallback, Sampler)); + MOCK_CONST_METHOD4( + ProcessHeightsFromRegion, void(const AZ::Aabb&, const AZ::Vector2&, AzFramework::Terrain::SurfacePointRegionFillCallback, Sampler)); + MOCK_CONST_METHOD4( + ProcessNormalsFromRegion, void(const AZ::Aabb&, const AZ::Vector2&, AzFramework::Terrain::SurfacePointRegionFillCallback, Sampler)); + MOCK_CONST_METHOD4( + ProcessSurfaceWeightsFromRegion, void(const AZ::Aabb&, const AZ::Vector2&, AzFramework::Terrain::SurfacePointRegionFillCallback, Sampler)); + MOCK_CONST_METHOD4( + ProcessSurfacePointsFromRegion, void(const AZ::Aabb&, const AZ::Vector2&, AzFramework::Terrain::SurfacePointRegionFillCallback, Sampler)); }; } // namespace UnitTest diff --git a/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.cpp b/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.cpp index 7c8b6021af..2ecd13b5ad 100644 --- a/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.cpp +++ b/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.cpp @@ -530,40 +530,201 @@ const char* TerrainSystem::GetMaxSurfaceName( return ""; } -/* +void TerrainSystem::ProcessHeightsFromList( + const AZStd::span& inPositions, + AzFramework::Terrain::SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter) const +{ + if (!perPositionCallback) + { + return; + } -void TerrainSystem::ProcessHeightsFromRegion(const AZ::Aabb& inRegion, const AZ::Vector2 stepSize, Sampler sampleFilter, SurfacePointRegionFillCallback perPositionCallback, TerrainDataReadyCallback onComplete) + AzFramework::SurfaceData::SurfacePoint surfacePoint; + for (const auto& position : inPositions) + { + bool terrainExists = false; + surfacePoint.m_position = position; + surfacePoint.m_position.SetZ(GetHeight(position, sampleFilter, &terrainExists)); + perPositionCallback(surfacePoint, terrainExists); + } +} + +void TerrainSystem::ProcessNormalsFromList( + const AZStd::span& inPositions, + AzFramework::Terrain::SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter) const { - // Don't bother processing if we don't have a callback if (!perPositionCallback) { return; } - uint32_t numSamplesX = static_cast((inRegion.GetMax().GetX() - inRegion.GetMin().GetX()) / stepSize.GetX()); - uint32_t numSamplesY = static_cast((inRegion.GetMax().GetY() - inRegion.GetMin().GetY()) / stepSize.GetY()); + AzFramework::SurfaceData::SurfacePoint surfacePoint; + for (const auto& position : inPositions) + { + bool terrainExists = false; + surfacePoint.m_position = position; + surfacePoint.m_normal = GetNormal(position, sampleFilter, &terrainExists); + perPositionCallback(surfacePoint, terrainExists); + } +} + +void TerrainSystem::ProcessSurfaceWeightsFromList( + const AZStd::span& inPositions, + AzFramework::Terrain::SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter) const +{ + if (!perPositionCallback) + { + return; + } - for (uint32_t y = 0; y < numSamplesY; y++) + AzFramework::SurfaceData::SurfacePoint surfacePoint; + for (const auto& position : inPositions) { - for (uint32_t x = 0; x < numSamplesX; x++) - { - float fx = (float)(inRegion.GetMin().GetX() + (x * stepSize.GetX())); - float fy = (float)(inRegion.GetMin().GetY() + (y * stepSize.GetY())); + bool terrainExists = false; + surfacePoint.m_position = position; + GetSurfaceWeights(position, surfacePoint.m_surfaceTags, sampleFilter, &terrainExists); + perPositionCallback(surfacePoint, terrainExists); + } +} - SurfaceData::SurfacePoint surfacePoint; - GetHeight(AZ::Vector3(fx, fy, 0.0f), sampleFilter, surfacePoint.m_position); - perPositionCallback(surfacePoint, x, y); - } +void TerrainSystem::ProcessSurfacePointsFromList( + const AZStd::span& inPositions, + AzFramework::Terrain::SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter) const +{ + if (!perPositionCallback) + { + return; + } + + AzFramework::SurfaceData::SurfacePoint surfacePoint; + for (const auto& position : inPositions) + { + bool terrainExists = false; + surfacePoint.m_position = position; + GetSurfacePoint(position, surfacePoint, sampleFilter, &terrainExists); + perPositionCallback(surfacePoint, terrainExists); + } +} + +void TerrainSystem::ProcessHeightsFromListOfVector2( + const AZStd::span& inPositions, + AzFramework::Terrain::SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter) const +{ + if (!perPositionCallback) + { + return; + } + + AzFramework::SurfaceData::SurfacePoint surfacePoint; + for (const auto& position : inPositions) + { + bool terrainExists = false; + surfacePoint.m_position.Set(position.GetX(), position.GetY(), 0.0f); + surfacePoint.m_position.SetZ(GetHeightFromVector2(position, sampleFilter, &terrainExists)); + perPositionCallback(surfacePoint, terrainExists); + } +} + +void TerrainSystem::ProcessNormalsFromListOfVector2( + const AZStd::span& inPositions, + AzFramework::Terrain::SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter) const +{ + if (!perPositionCallback) + { + return; + } + + AzFramework::SurfaceData::SurfacePoint surfacePoint; + for (const auto& position : inPositions) + { + bool terrainExists = false; + surfacePoint.m_position.Set(position.GetX(), position.GetY(), 0.0f); + surfacePoint.m_normal = GetNormalFromVector2(position, sampleFilter, &terrainExists); + perPositionCallback(surfacePoint, terrainExists); + } +} + +void TerrainSystem::ProcessSurfaceWeightsFromListOfVector2( + const AZStd::span& inPositions, + AzFramework::Terrain::SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter) const +{ + if (!perPositionCallback) + { + return; + } + + AzFramework::SurfaceData::SurfacePoint surfacePoint; + for (const auto& position : inPositions) + { + bool terrainExists = false; + surfacePoint.m_position.Set(position.GetX(), position.GetY(), 0.0f); + GetSurfaceWeightsFromVector2(position, surfacePoint.m_surfaceTags, sampleFilter, &terrainExists); + perPositionCallback(surfacePoint, terrainExists); + } +} + +void TerrainSystem::ProcessSurfacePointsFromListOfVector2( + const AZStd::span& inPositions, + AzFramework::Terrain::SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter) const +{ + if (!perPositionCallback) + { + return; } - if (onComplete) + AzFramework::SurfaceData::SurfacePoint surfacePoint; + for (const auto& position : inPositions) { - onComplete(); + bool terrainExists = false; + surfacePoint.m_position.Set(position.GetX(), position.GetY(), 0.0f); + GetSurfacePointFromVector2(position, surfacePoint, sampleFilter, &terrainExists); + perPositionCallback(surfacePoint, terrainExists); } } +void TerrainSystem::ProcessHeightsFromRegion( + const AZ::Aabb& inRegion, + const AZ::Vector2& stepSize, + AzFramework::Terrain::SurfacePointRegionFillCallback perPositionCallback, + Sampler sampleFilter) const +{ + // Don't bother processing if we don't have a callback + if (!perPositionCallback) + { + return; + } + + const size_t numSamplesX = aznumeric_cast(ceil(inRegion.GetExtents().GetX() / stepSize.GetX())); + const size_t numSamplesY = aznumeric_cast(ceil(inRegion.GetExtents().GetY() / stepSize.GetY())); + + AzFramework::SurfaceData::SurfacePoint surfacePoint; + for (size_t y = 0; y < numSamplesY; y++) + { + float fy = aznumeric_cast(inRegion.GetMin().GetY() + (y * stepSize.GetY())); + for (size_t x = 0; x < numSamplesX; x++) + { + bool terrainExists = false; + float fx = aznumeric_cast(inRegion.GetMin().GetX() + (x * stepSize.GetX())); + surfacePoint.m_position.Set(fx, fy, 0.0f); + surfacePoint.m_position.SetZ(GetHeight(surfacePoint.m_position, sampleFilter, &terrainExists)); + perPositionCallback(x, y, surfacePoint, terrainExists); + } + } +} -void TerrainSystem::ProcessSurfacePointsFromRegion(const AZ::Aabb& inRegion, const AZ::Vector2 stepSize, Sampler sampleFilter, SurfacePointRegionFillCallback perPositionCallback, TerrainDataReadyCallback onComplete) +void TerrainSystem::ProcessNormalsFromRegion( + const AZ::Aabb& inRegion, + const AZ::Vector2& stepSize, + AzFramework::Terrain::SurfacePointRegionFillCallback perPositionCallback, + Sampler sampleFilter) const { // Don't bother processing if we don't have a callback if (!perPositionCallback) @@ -571,28 +732,83 @@ void TerrainSystem::ProcessSurfacePointsFromRegion(const AZ::Aabb& inRegion, con return; } - uint32_t numSamplesX = static_cast((inRegion.GetMax().GetX() - inRegion.GetMin().GetX()) / stepSize.GetX()); - uint32_t numSamplesY = static_cast((inRegion.GetMax().GetY() - inRegion.GetMin().GetY()) / stepSize.GetY()); + const size_t numSamplesX = aznumeric_cast(ceil(inRegion.GetExtents().GetX() / stepSize.GetX())); + const size_t numSamplesY = aznumeric_cast(ceil(inRegion.GetExtents().GetY() / stepSize.GetY())); - for (uint32_t y = 0; y < numSamplesY; y++) + AzFramework::SurfaceData::SurfacePoint surfacePoint; + for (size_t y = 0; y < numSamplesY; y++) { - for (uint32_t x = 0; x < numSamplesX; x++) + float fy = aznumeric_cast(inRegion.GetMin().GetY() + (y * stepSize.GetY())); + for (size_t x = 0; x < numSamplesX; x++) { - float fx = (float)(inRegion.GetMin().GetX() + (x * stepSize.GetX())); - float fy = (float)(inRegion.GetMin().GetY() + (y * stepSize.GetY())); + bool terrainExists = false; + float fx = aznumeric_cast(inRegion.GetMin().GetX() + (x * stepSize.GetX())); + surfacePoint.m_position.Set(fx, fy, 0.0f); + surfacePoint.m_normal = GetNormal(surfacePoint.m_position, sampleFilter, &terrainExists); + perPositionCallback(x, y, surfacePoint, terrainExists); + } + } +} + +void TerrainSystem::ProcessSurfaceWeightsFromRegion( + const AZ::Aabb& inRegion, + const AZ::Vector2& stepSize, + AzFramework::Terrain::SurfacePointRegionFillCallback perPositionCallback, + Sampler sampleFilter) const +{ + // Don't bother processing if we don't have a callback + if (!perPositionCallback) + { + return; + } + + const size_t numSamplesX = aznumeric_cast(ceil(inRegion.GetExtents().GetX() / stepSize.GetX())); + const size_t numSamplesY = aznumeric_cast(ceil(inRegion.GetExtents().GetY() / stepSize.GetY())); - SurfaceData::SurfacePoint surfacePoint; - GetSurfacePoint(AZ::Vector3(fx, fy, inRegion.GetMin().GetZ()), sampleFilter, surfacePoint); - perPositionCallback(surfacePoint, x, y); + AzFramework::SurfaceData::SurfacePoint surfacePoint; + for (size_t y = 0; y < numSamplesY; y++) + { + float fy = aznumeric_cast(inRegion.GetMin().GetY() + (y * stepSize.GetY())); + for (size_t x = 0; x < numSamplesX; x++) + { + bool terrainExists = false; + float fx = aznumeric_cast(inRegion.GetMin().GetX() + (x * stepSize.GetX())); + surfacePoint.m_position.Set(fx, fy, 0.0f); + GetSurfaceWeights(surfacePoint.m_position, surfacePoint.m_surfaceTags, sampleFilter, &terrainExists); + perPositionCallback(x, y, surfacePoint, terrainExists); } } +} - if (onComplete) +void TerrainSystem::ProcessSurfacePointsFromRegion( + const AZ::Aabb& inRegion, + const AZ::Vector2& stepSize, + AzFramework::Terrain::SurfacePointRegionFillCallback perPositionCallback, + Sampler sampleFilter) const +{ + // Don't bother processing if we don't have a callback + if (!perPositionCallback) { - onComplete(); + return; + } + + const size_t numSamplesX = aznumeric_cast(ceil(inRegion.GetExtents().GetX() / stepSize.GetX())); + const size_t numSamplesY = aznumeric_cast(ceil(inRegion.GetExtents().GetY() / stepSize.GetY())); + + AzFramework::SurfaceData::SurfacePoint surfacePoint; + for (size_t y = 0; y < numSamplesY; y++) + { + float fy = aznumeric_cast(inRegion.GetMin().GetY() + (y * stepSize.GetY())); + for (size_t x = 0; x < numSamplesX; x++) + { + bool terrainExists = false; + float fx = aznumeric_cast(inRegion.GetMin().GetX() + (x * stepSize.GetX())); + surfacePoint.m_position.Set(fx, fy, 0.0f); + GetSurfacePoint(surfacePoint.m_position, surfacePoint, sampleFilter, &terrainExists); + perPositionCallback(x, y, surfacePoint, terrainExists); + } } } -*/ void TerrainSystem::RegisterArea(AZ::EntityId areaId) { diff --git a/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.h b/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.h index d7267476ed..7c6e0cd91e 100644 --- a/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.h +++ b/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.h @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -135,6 +136,52 @@ namespace Terrain Sampler sampleFilter = Sampler::DEFAULT, bool* terrainExistsPtr = nullptr) const override; + //! Given a list of XY coordinates, call the provided callback function with surface data corresponding to each + //! XY coordinate in the list. + virtual void ProcessHeightsFromList(const AZStd::span& inPositions, + AzFramework::Terrain::SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const override; + virtual void ProcessNormalsFromList(const AZStd::span& inPositions, + AzFramework::Terrain::SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const override; + virtual void ProcessSurfaceWeightsFromList(const AZStd::span& inPositions, + AzFramework::Terrain::SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const override; + virtual void ProcessSurfacePointsFromList(const AZStd::span& inPositions, + AzFramework::Terrain::SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const override; + virtual void ProcessHeightsFromListOfVector2(const AZStd::span& inPositions, + AzFramework::Terrain::SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const override; + virtual void ProcessNormalsFromListOfVector2(const AZStd::span& inPositions, + AzFramework::Terrain::SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const override; + virtual void ProcessSurfaceWeightsFromListOfVector2(const AZStd::span& inPositions, + AzFramework::Terrain::SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const override; + virtual void ProcessSurfacePointsFromListOfVector2(const AZStd::span& inPositions, + AzFramework::Terrain::SurfacePointListFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const override; + + //! Given a region(aabb) and a step size, call the provided callback function with surface data corresponding to the + //! coordinates in the region. + virtual void ProcessHeightsFromRegion(const AZ::Aabb& inRegion, + const AZ::Vector2& stepSize, + AzFramework::Terrain::SurfacePointRegionFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const override; + virtual void ProcessNormalsFromRegion(const AZ::Aabb& inRegion, + const AZ::Vector2& stepSize, + AzFramework::Terrain::SurfacePointRegionFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const override; + virtual void ProcessSurfaceWeightsFromRegion(const AZ::Aabb& inRegion, + const AZ::Vector2& stepSize, + AzFramework::Terrain::SurfacePointRegionFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const override; + virtual void ProcessSurfacePointsFromRegion(const AZ::Aabb& inRegion, + const AZ::Vector2& stepSize, + AzFramework::Terrain::SurfacePointRegionFillCallback perPositionCallback, + Sampler sampleFilter = Sampler::DEFAULT) const override; + private: void ClampPosition(float x, float y, AZ::Vector2& outPosition, AZ::Vector2& normalizedDelta) const; diff --git a/Gems/Terrain/Code/Tests/TerrainSystemBenchmarks.cpp b/Gems/Terrain/Code/Tests/TerrainSystemBenchmarks.cpp index 3d0cb5222e..85dd5dc0c4 100644 --- a/Gems/Terrain/Code/Tests/TerrainSystemBenchmarks.cpp +++ b/Gems/Terrain/Code/Tests/TerrainSystemBenchmarks.cpp @@ -281,6 +281,22 @@ namespace UnitTest surfaceGradientShapeRequests.clear(); } + void GenerateInputPositionsList(const AZ::Vector2& queryResolution, const AZ::Aabb& worldBounds, AZStd::vector& positions) + { + const size_t numSamplesX = aznumeric_cast(ceil(worldBounds.GetExtents().GetX() / queryResolution.GetX())); + const size_t numSamplesY = aznumeric_cast(ceil(worldBounds.GetExtents().GetY() / queryResolution.GetY())); + + for (size_t y = 0; y < numSamplesY; y++) + { + float fy = aznumeric_cast(worldBounds.GetMin().GetY() + (y * queryResolution.GetY())); + for (size_t x = 0; x < numSamplesX; x++) + { + float fx = aznumeric_cast(worldBounds.GetMin().GetX() + (x * queryResolution.GetX())); + positions.emplace_back(fx, fy, 0.0f); + } + } + } + protected: AZStd::unique_ptr m_app; }; @@ -322,6 +338,72 @@ namespace UnitTest ->Args({ 4096, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) ->Unit(::benchmark::kMillisecond); + BENCHMARK_DEFINE_F(TerrainSystemBenchmarkFixture, BM_ProcessHeightsRegion)(benchmark::State& state) + { + // Run the benchmark + RunTerrainApiBenchmark( + state, + []([[maybe_unused]] const AZ::Vector2& queryResolution, const AZ::Aabb& worldBounds, + AzFramework::Terrain::TerrainDataRequests::Sampler sampler) + { + auto perPositionCallback = []([[maybe_unused]] size_t xIndex, [[maybe_unused]] size_t yIndex, + const AzFramework::SurfaceData::SurfacePoint& surfacePoint, [[maybe_unused]] bool terrainExists) + { + benchmark::DoNotOptimize(surfacePoint.m_position.GetZ()); + }; + + AzFramework::Terrain::TerrainDataRequestBus::Broadcast( + &AzFramework::Terrain::TerrainDataRequests::ProcessHeightsFromRegion, worldBounds, queryResolution, perPositionCallback, sampler); + } + ); + } + + BENCHMARK_REGISTER_F(TerrainSystemBenchmarkFixture, BM_ProcessHeightsRegion) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 4096, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 4096, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 4096, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(TerrainSystemBenchmarkFixture, BM_ProcessHeightsList)(benchmark::State& state) + { + // Run the benchmark + RunTerrainApiBenchmark( + state, + [this]([[maybe_unused]] const AZ::Vector2& queryResolution, const AZ::Aabb& worldBounds, + AzFramework::Terrain::TerrainDataRequests::Sampler sampler) + { + AZStd::vector inPositions; + GenerateInputPositionsList(queryResolution, worldBounds, inPositions); + + auto perPositionCallback = [](const AzFramework::SurfaceData::SurfacePoint& surfacePoint, [[maybe_unused]] bool terrainExists) + { + benchmark::DoNotOptimize(surfacePoint.m_position.GetZ()); + }; + + AzFramework::Terrain::TerrainDataRequestBus::Broadcast( + &AzFramework::Terrain::TerrainDataRequests::ProcessHeightsFromList, inPositions, perPositionCallback, sampler); + } + ); + } + + BENCHMARK_REGISTER_F(TerrainSystemBenchmarkFixture, BM_ProcessHeightsList) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 4096, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 4096, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 4096, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Unit(::benchmark::kMillisecond); + BENCHMARK_DEFINE_F(TerrainSystemBenchmarkFixture, BM_GetNormal)(benchmark::State& state) { // Run the benchmark @@ -353,6 +435,66 @@ namespace UnitTest ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) ->Unit(::benchmark::kMillisecond); + BENCHMARK_DEFINE_F(TerrainSystemBenchmarkFixture, BM_ProcessNormalsRegion)(benchmark::State& state) + { + // Run the benchmark + RunTerrainApiBenchmark( + state, + []([[maybe_unused]] const AZ::Vector2& queryResolution, const AZ::Aabb& worldBounds, + AzFramework::Terrain::TerrainDataRequests::Sampler sampler) + { + auto perPositionCallback = []([[maybe_unused]] size_t xIndex, [[maybe_unused]] size_t yIndex, + const AzFramework::SurfaceData::SurfacePoint& surfacePoint, [[maybe_unused]] bool terrainExists) + { + benchmark::DoNotOptimize(surfacePoint.m_normal); + }; + + AzFramework::Terrain::TerrainDataRequestBus::Broadcast( + &AzFramework::Terrain::TerrainDataRequests::ProcessNormalsFromRegion, worldBounds, queryResolution, perPositionCallback, sampler); + } + ); + } + + BENCHMARK_REGISTER_F(TerrainSystemBenchmarkFixture, BM_ProcessNormalsRegion) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(TerrainSystemBenchmarkFixture, BM_ProcessNormalsList)(benchmark::State& state) + { + // Run the benchmark + RunTerrainApiBenchmark( + state, + [this]([[maybe_unused]] const AZ::Vector2& queryResolution, const AZ::Aabb& worldBounds, + AzFramework::Terrain::TerrainDataRequests::Sampler sampler) + { + AZStd::vector inPositions; + GenerateInputPositionsList(queryResolution, worldBounds, inPositions); + + auto perPositionCallback = [](const AzFramework::SurfaceData::SurfacePoint& surfacePoint, [[maybe_unused]] bool terrainExists) + { + benchmark::DoNotOptimize(surfacePoint.m_normal); + }; + + AzFramework::Terrain::TerrainDataRequestBus::Broadcast( + &AzFramework::Terrain::TerrainDataRequests::ProcessNormalsFromList, inPositions, perPositionCallback, sampler); + } + ); + } + + BENCHMARK_REGISTER_F(TerrainSystemBenchmarkFixture, BM_ProcessNormalsList) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Unit(::benchmark::kMillisecond); + BENCHMARK_DEFINE_F(TerrainSystemBenchmarkFixture, BM_GetSurfaceWeights)(benchmark::State& state) { // Run the benchmark @@ -385,6 +527,66 @@ namespace UnitTest ->Args({ 2048, 4, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) ->Unit(::benchmark::kMillisecond); + BENCHMARK_DEFINE_F(TerrainSystemBenchmarkFixture, BM_ProcessSurfaceWeightsRegion)(benchmark::State& state) + { + // Run the benchmark + RunTerrainApiBenchmark( + state, + []([[maybe_unused]] const AZ::Vector2& queryResolution, const AZ::Aabb& worldBounds, + AzFramework::Terrain::TerrainDataRequests::Sampler sampler) + { + auto perPositionCallback = []([[maybe_unused]] size_t xIndex, [[maybe_unused]] size_t yIndex, + const AzFramework::SurfaceData::SurfacePoint& surfacePoint, [[maybe_unused]] bool terrainExists) + { + benchmark::DoNotOptimize(surfacePoint.m_surfaceTags); + }; + + AzFramework::Terrain::TerrainDataRequestBus::Broadcast( + &AzFramework::Terrain::TerrainDataRequests::ProcessSurfaceWeightsFromRegion, worldBounds, queryResolution, perPositionCallback, sampler); + } + ); + } + + BENCHMARK_REGISTER_F(TerrainSystemBenchmarkFixture, BM_ProcessSurfaceWeightsRegion) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 1024, 2, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 2, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 1024, 4, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 4, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(TerrainSystemBenchmarkFixture, BM_ProcessSurfaceWeightsList)(benchmark::State& state) + { + // Run the benchmark + RunTerrainApiBenchmark( + state, + [this]([[maybe_unused]] const AZ::Vector2& queryResolution, const AZ::Aabb& worldBounds, + AzFramework::Terrain::TerrainDataRequests::Sampler sampler) + { + AZStd::vector inPositions; + GenerateInputPositionsList(queryResolution, worldBounds, inPositions); + + auto perPositionCallback = [](const AzFramework::SurfaceData::SurfacePoint& surfacePoint, [[maybe_unused]] bool terrainExists) + { + benchmark::DoNotOptimize(surfacePoint.m_surfaceTags); + }; + + AzFramework::Terrain::TerrainDataRequestBus::Broadcast( + &AzFramework::Terrain::TerrainDataRequests::ProcessSurfaceWeightsFromList, inPositions, perPositionCallback, sampler); + } + ); + } + + BENCHMARK_REGISTER_F(TerrainSystemBenchmarkFixture, BM_ProcessSurfaceWeightsList) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 1024, 2, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 2, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 1024, 4, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 4, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Unit(::benchmark::kMillisecond); + BENCHMARK_DEFINE_F(TerrainSystemBenchmarkFixture, BM_GetSurfacePoints)(benchmark::State& state) { // Run the benchmark @@ -416,6 +618,66 @@ namespace UnitTest ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(TerrainSystemBenchmarkFixture, BM_ProcessSurfacePointsRegion)(benchmark::State& state) + { + // Run the benchmark + RunTerrainApiBenchmark( + state, + []([[maybe_unused]] const AZ::Vector2& queryResolution, const AZ::Aabb& worldBounds, + AzFramework::Terrain::TerrainDataRequests::Sampler sampler) + { + auto perPositionCallback = []([[maybe_unused]] size_t xIndex, [[maybe_unused]] size_t yIndex, + const AzFramework::SurfaceData::SurfacePoint& surfacePoint, [[maybe_unused]] bool terrainExists) + { + benchmark::DoNotOptimize(surfacePoint); + }; + + AzFramework::Terrain::TerrainDataRequestBus::Broadcast( + &AzFramework::Terrain::TerrainDataRequests::ProcessSurfacePointsFromRegion, worldBounds, queryResolution, perPositionCallback, sampler); + } + ); + } + + BENCHMARK_REGISTER_F(TerrainSystemBenchmarkFixture, BM_ProcessSurfacePointsRegion) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Unit(::benchmark::kMillisecond); + + BENCHMARK_DEFINE_F(TerrainSystemBenchmarkFixture, BM_ProcessSurfacePointsList)(benchmark::State& state) + { + // Run the benchmark + RunTerrainApiBenchmark( + state, + [this]([[maybe_unused]] const AZ::Vector2& queryResolution, const AZ::Aabb& worldBounds, + AzFramework::Terrain::TerrainDataRequests::Sampler sampler) + { + AZStd::vector inPositions; + GenerateInputPositionsList(queryResolution, worldBounds, inPositions); + + auto perPositionCallback = [](const AzFramework::SurfaceData::SurfacePoint& surfacePoint, [[maybe_unused]] bool terrainExists) + { + benchmark::DoNotOptimize(surfacePoint); + }; + + AzFramework::Terrain::TerrainDataRequestBus::Broadcast( + &AzFramework::Terrain::TerrainDataRequests::ProcessSurfacePointsFromList, inPositions, perPositionCallback, sampler); + } + ); + } + + BENCHMARK_REGISTER_F(TerrainSystemBenchmarkFixture, BM_ProcessSurfacePointsList) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR) }) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::CLAMP) }) + ->Args({ 1024, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Args({ 2048, 1, static_cast(AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT) }) + ->Unit(::benchmark::kMillisecond); #endif } diff --git a/Gems/Terrain/Code/Tests/TerrainSystemTest.cpp b/Gems/Terrain/Code/Tests/TerrainSystemTest.cpp index e5434c0a1d..a5798a3dad 100644 --- a/Gems/Terrain/Code/Tests/TerrainSystemTest.cpp +++ b/Gems/Terrain/Code/Tests/TerrainSystemTest.cpp @@ -41,6 +41,28 @@ namespace UnitTest float m_expectedHeight = 0.0f; }; + struct NormalTestPoint + { + AZ::Vector2 m_testLocation = AZ::Vector2::CreateZero(); + AZ::Vector3 m_expectedNormal = AZ::Vector3::CreateZero(); + }; + + struct HeightTestRegionPoints + { + size_t m_xIndex; + size_t m_yIndex; + float m_expectedHeight; + AZ::Vector2 m_testLocation = AZ::Vector2::CreateZero(); + }; + + struct NormalTestRegionPoints + { + size_t m_xIndex; + size_t m_yIndex; + AZ::Vector3 m_expectedNormal = AZ::Vector3::CreateZero(); + AZ::Vector2 m_testLocation = AZ::Vector2::CreateZero(); + }; + AZ::ComponentApplication m_app; AZStd::unique_ptr> m_boxShapeRequests; @@ -572,4 +594,312 @@ namespace UnitTest EXPECT_EQ(tagWeight.m_surfaceType, tagWeight1.m_surfaceType); EXPECT_NEAR(tagWeight.m_weight, tagWeight1.m_weight, 0.01f); } + + TEST_F(TerrainSystemTest, TerrainProcessHeightsFromListWithBilinearSamplers) + { + // This repeats the same test as TerrainHeightQueriesWithBilinearSamplersUseQueryGridToInterpolate + // The difference is that it tests the ProcessHeightsFromList variation. + + const AZ::Aabb spawnerBox = AZ::Aabb::CreateFromMinMaxValues(-10.0f, -10.0f, -5.0f, 10.0f, 10.0f, 15.0f); + const float amplitudeMeters = 10.0f; + const float frequencyMeters = 1.0f; + auto entity = CreateAndActivateMockTerrainLayerSpawner( + spawnerBox, + [amplitudeMeters, frequencyMeters](AZ::Vector3& position, bool& terrainExists) + { + // Our generated height will be X + Y. + float expectedHeight = position.GetX() + position.GetY(); + + // If either X or Y aren't evenly divisible by the query frequency, add a scaled value to our generated height. + // This will show up as an unexpected height "spike" if it gets used in any bilinear filter queries. + float unexpectedVariance = + amplitudeMeters * (fmodf(position.GetX(), frequencyMeters) + fmodf(position.GetY(), frequencyMeters)); + position.SetZ(expectedHeight + unexpectedVariance); + terrainExists = true; + }); + + // Create and activate the terrain system with our testing defaults for world bounds, and a query resolution at 1 meter intervals. + const AZ::Vector2 queryResolution(frequencyMeters); + auto terrainSystem = CreateAndActivateTerrainSystem(queryResolution); + + // Test some points and verify that the results are the expected bilinear filtered result, + // whether they're in positive or negative space. + // (Z contains the the expected result for convenience). + const HeightTestPoint testPoints[] = { + + // Queries directly on grid points. These should return values of X + Y. + { AZ::Vector2(0.0f, 0.0f), 0.0f }, // Should return a height of 0 + 0 + { AZ::Vector2(1.0f, 0.0f), 1.0f }, // Should return a height of 1 + 0 + { AZ::Vector2(0.0f, 1.0f), 1.0f }, // Should return a height of 0 + 1 + { AZ::Vector2(1.0f, 1.0f), 2.0f }, // Should return a height of 1 + 1 + { AZ::Vector2(3.0f, 5.0f), 8.0f }, // Should return a height of 3 + 5 + + { AZ::Vector2(-1.0f, 0.0f), -1.0f }, // Should return a height of -1 + 0 + { AZ::Vector2(0.0f, -1.0f), -1.0f }, // Should return a height of 0 + -1 + { AZ::Vector2(-1.0f, -1.0f), -2.0f }, // Should return a height of -1 + -1 + { AZ::Vector2(-3.0f, -5.0f), -8.0f }, // Should return a height of -3 + -5 + + // Queries that are on a grid edge (one axis on the grid, the other somewhere in-between). + // These should just be a linear interpolation of the points, so it should still be X + Y. + + { AZ::Vector2(0.25f, 0.0f), 0.25f }, // Should return a height of -0.25 + 0 + { AZ::Vector2(3.75f, 0.0f), 3.75f }, // Should return a height of -3.75 + 0 + { AZ::Vector2(0.0f, 0.25f), 0.25f }, // Should return a height of 0 + -0.25 + { AZ::Vector2(0.0f, 3.75f), 3.75f }, // Should return a height of 0 + -3.75 + + { AZ::Vector2(2.0f, 3.75f), 5.75f }, // Should return a height of -2 + -3.75 + { AZ::Vector2(2.25f, 4.0f), 6.25f }, // Should return a height of -2.25 + -4 + + { AZ::Vector2(-0.25f, 0.0f), -0.25f }, // Should return a height of -0.25 + 0 + { AZ::Vector2(-3.75f, 0.0f), -3.75f }, // Should return a height of -3.75 + 0 + { AZ::Vector2(0.0f, -0.25f), -0.25f }, // Should return a height of 0 + -0.25 + { AZ::Vector2(0.0f, -3.75f), -3.75f }, // Should return a height of 0 + -3.75 + + { AZ::Vector2(-2.0f, -3.75f), -5.75f }, // Should return a height of -2 + -3.75 + { AZ::Vector2(-2.25f, -4.0f), -6.25f }, // Should return a height of -2.25 + -4 + + // Queries inside a grid square (both axes are in-between grid points) + // This is a full bilinear interpolation, but because we're using X + Y for our heights, the interpolated values + // should *still* be X + Y assuming the points were sampled correctly from the grid points. + + { AZ::Vector2(3.25f, 5.25f), 8.5f }, // Should return a height of 3.25 + 5.25 + { AZ::Vector2(7.71f, 9.74f), 17.45f }, // Should return a height of 7.71 + 9.74 + + { AZ::Vector2(-3.25f, -5.25f), -8.5f }, // Should return a height of -3.25 + -5.25 + { AZ::Vector2(-7.71f, -9.74f), -17.45f }, // Should return a height of -7.71 + -9.74 + }; + + auto perPositionCallback = [&testPoints](const AzFramework::SurfaceData::SurfacePoint& surfacePoint, [[maybe_unused]] bool terrainExists){ + bool found = false; + for (auto& testPoint : testPoints) + { + if (testPoint.m_testLocation.GetX() == surfacePoint.m_position.GetX() && testPoint.m_testLocation.GetY() == surfacePoint.m_position.GetY()) + { + constexpr float epsilon = 0.0001f; + EXPECT_NEAR(surfacePoint.m_position.GetZ(), testPoint.m_expectedHeight, epsilon); + found = true; + break; + } + } + EXPECT_EQ(found, true); + }; + + AZStd::vector inPositions; + for (auto& testPoint : testPoints) + { + AZ::Vector3 position(testPoint.m_testLocation.GetX(), testPoint.m_testLocation.GetY(), 0.0f); + inPositions.push_back(position); + } + + terrainSystem->ProcessHeightsFromList(inPositions, perPositionCallback, AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR); + } + + TEST_F(TerrainSystemTest, TerrainProcessNormalsFromListWithBilinearSamplers) + { + // Similar to TerrainProcessHeightsFromListWithBilinearSamplers but for normals + + const AZ::Aabb spawnerBox = AZ::Aabb::CreateFromMinMaxValues(-10.0f, -10.0f, -5.0f, 10.0f, 10.0f, 15.0f); + const float amplitudeMeters = 10.0f; + const float frequencyMeters = 1.0f; + auto entity = CreateAndActivateMockTerrainLayerSpawner( + spawnerBox, + [amplitudeMeters, frequencyMeters](AZ::Vector3& position, bool& terrainExists) + { + // Our generated height will be X + Y. + float expectedHeight = position.GetX() + position.GetY(); + + // If either X or Y aren't evenly divisible by the query frequency, add a scaled value to our generated height. + // This will show up as an unexpected height "spike" if it gets used in any bilinear filter queries. + float unexpectedVariance = + amplitudeMeters * (fmodf(position.GetX(), frequencyMeters) + fmodf(position.GetY(), frequencyMeters)); + position.SetZ(expectedHeight + unexpectedVariance); + terrainExists = true; + }); + + // Create and activate the terrain system with our testing defaults for world bounds, and a query resolution at 1 meter intervals. + const AZ::Vector2 queryResolution(frequencyMeters); + auto terrainSystem = CreateAndActivateTerrainSystem(queryResolution); + + const NormalTestPoint testPoints[] = { + + { AZ::Vector2(0.0f, 0.0f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + { AZ::Vector2(1.0f, 0.0f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + { AZ::Vector2(0.0f, 1.0f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + { AZ::Vector2(1.0f, 1.0f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + { AZ::Vector2(3.0f, 5.0f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + + { AZ::Vector2(-1.0f, 0.0f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + { AZ::Vector2(0.0f, -1.0f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + { AZ::Vector2(-1.0f, -1.0f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + { AZ::Vector2(-3.0f, -5.0f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + + { AZ::Vector2(0.25f, 0.0f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + { AZ::Vector2(3.75f, 0.0f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + { AZ::Vector2(0.0f, 0.25f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + { AZ::Vector2(0.0f, 3.75f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + + { AZ::Vector2(2.0f, 3.75f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + { AZ::Vector2(2.25f, 4.0f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + + { AZ::Vector2(-0.25f, 0.0f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + { AZ::Vector2(-3.75f, 0.0f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + { AZ::Vector2(0.0f, -0.25f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + { AZ::Vector2(0.0f, -3.75f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + + { AZ::Vector2(-2.0f, -3.75f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + { AZ::Vector2(-2.25f, -4.0f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + + { AZ::Vector2(3.25f, 5.25f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + { AZ::Vector2(7.71f, 9.74f), AZ::Vector3(-0.0292f, 0.9991f, 0.0292f) }, + + { AZ::Vector2(-3.25f, -5.25f), AZ::Vector3(-0.5773f, -0.5773f, 0.5773f) }, + { AZ::Vector2(-7.71f, -9.74f), AZ::Vector3(-0.0366f, -0.9986f, 0.0366f) }, + }; + + auto perPositionCallback = [&testPoints](const AzFramework::SurfaceData::SurfacePoint& surfacePoint, [[maybe_unused]] bool terrainExists){ + bool found = false; + for (auto& testPoint : testPoints) + { + if (testPoint.m_testLocation.GetX() == surfacePoint.m_position.GetX() && testPoint.m_testLocation.GetY() == surfacePoint.m_position.GetY()) + { + constexpr float epsilon = 0.0001f; + EXPECT_NEAR(surfacePoint.m_normal.GetX(), testPoint.m_expectedNormal.GetX(), epsilon); + EXPECT_NEAR(surfacePoint.m_normal.GetY(), testPoint.m_expectedNormal.GetY(), epsilon); + EXPECT_NEAR(surfacePoint.m_normal.GetZ(), testPoint.m_expectedNormal.GetZ(), epsilon); + found = true; + break; + } + } + EXPECT_EQ(found, true); + }; + + AZStd::vector inPositions; + for (auto& testPoint : testPoints) + { + AZ::Vector3 position(testPoint.m_testLocation.GetX(), testPoint.m_testLocation.GetY(), 0.0f); + inPositions.push_back(position); + } + + terrainSystem->ProcessNormalsFromList(inPositions, perPositionCallback, AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR); + } + + TEST_F(TerrainSystemTest, TerrainProcessHeightsFromRegionWithBilinearSamplers) + { + // This repeats the same test as TerrainHeightQueriesWithBilinearSamplersUseQueryGridToInterpolate + // The difference is that it tests the ProcessHeightsFromList variation. + + const AZ::Aabb spawnerBox = AZ::Aabb::CreateFromMinMaxValues(-10.0f, -10.0f, -5.0f, 10.0f, 10.0f, 15.0f); + const float amplitudeMeters = 10.0f; + const float frequencyMeters = 1.0f; + auto entity = CreateAndActivateMockTerrainLayerSpawner( + spawnerBox, + [amplitudeMeters, frequencyMeters](AZ::Vector3& position, bool& terrainExists) + { + // Our generated height will be X + Y. + float expectedHeight = position.GetX() + position.GetY(); + + // If either X or Y aren't evenly divisible by the query frequency, add a scaled value to our generated height. + // This will show up as an unexpected height "spike" if it gets used in any bilinear filter queries. + float unexpectedVariance = + amplitudeMeters * (fmodf(position.GetX(), frequencyMeters) + fmodf(position.GetY(), frequencyMeters)); + position.SetZ(expectedHeight + unexpectedVariance); + terrainExists = true; + }); + + // Create and activate the terrain system with our testing defaults for world bounds, and a query resolution at 1 meter intervals. + const AZ::Vector2 queryResolution(frequencyMeters); + auto terrainSystem = CreateAndActivateTerrainSystem(queryResolution); + + const AZ::Aabb testRegionBox = AZ::Aabb::CreateFromMinMaxValues(-1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 1.0f); + const AZ::Vector2 stepSize(1.0f); + + const HeightTestRegionPoints testPoints[] = { + { 0, 0, -2.0f, AZ::Vector2(-1.0f, -1.0f) }, + { 1, 0, -1.0f, AZ::Vector2(0.0f, -1.0f) }, + { 0, 1, -1.0f, AZ::Vector2(-1.0f, 0.0f) }, + { 1, 1, 0.0f, AZ::Vector2(0.0f, 0.0f) }, + }; + + auto perPositionCallback = [&testPoints](size_t xIndex, size_t yIndex, + const AzFramework::SurfaceData::SurfacePoint& surfacePoint, [[maybe_unused]] bool terrainExists) + { + bool found = false; + for (auto& testPoint : testPoints) + { + if (testPoint.m_xIndex == xIndex && testPoint.m_yIndex == yIndex + && testPoint.m_testLocation.GetX() == surfacePoint.m_position.GetX() + && testPoint.m_testLocation.GetY() == surfacePoint.m_position.GetY()) + { + constexpr float epsilon = 0.0001f; + EXPECT_NEAR(surfacePoint.m_position.GetZ(), testPoint.m_expectedHeight, epsilon); + found = true; + break; + } + } + EXPECT_EQ(found, true); + }; + + terrainSystem->ProcessHeightsFromRegion(testRegionBox, stepSize, perPositionCallback, AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR); + } + + TEST_F(TerrainSystemTest, TerrainProcessNormalsFromRegionWithBilinearSamplers) + { + // This repeats the same test as TerrainHeightQueriesWithBilinearSamplersUseQueryGridToInterpolate + // The difference is that it tests the ProcessHeightsFromList variation. + + const AZ::Aabb spawnerBox = AZ::Aabb::CreateFromMinMaxValues(-10.0f, -10.0f, -5.0f, 10.0f, 10.0f, 15.0f); + const float amplitudeMeters = 10.0f; + const float frequencyMeters = 1.0f; + auto entity = CreateAndActivateMockTerrainLayerSpawner( + spawnerBox, + [amplitudeMeters, frequencyMeters](AZ::Vector3& position, bool& terrainExists) + { + // Our generated height will be X + Y. + float expectedHeight = position.GetX() + position.GetY(); + + // If either X or Y aren't evenly divisible by the query frequency, add a scaled value to our generated height. + // This will show up as an unexpected height "spike" if it gets used in any bilinear filter queries. + float unexpectedVariance = + amplitudeMeters * (fmodf(position.GetX(), frequencyMeters) + fmodf(position.GetY(), frequencyMeters)); + position.SetZ(expectedHeight + unexpectedVariance); + terrainExists = true; + }); + + // Create and activate the terrain system with our testing defaults for world bounds, and a query resolution at 1 meter intervals. + const AZ::Vector2 queryResolution(frequencyMeters); + auto terrainSystem = CreateAndActivateTerrainSystem(queryResolution); + + const AZ::Aabb testRegionBox = AZ::Aabb::CreateFromMinMaxValues(-1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 1.0f); + const AZ::Vector2 stepSize(1.0f); + + const NormalTestRegionPoints testPoints[] = { + { 0, 0, AZ::Vector3(-0.5773f, -0.5773f, 0.5773f), AZ::Vector2(-1.0f, -1.0f) }, + { 1, 0, AZ::Vector3(-0.5773f, -0.5773f, 0.5773f), AZ::Vector2(0.0f, -1.0f) }, + { 0, 1, AZ::Vector3(-0.5773f, -0.5773f, 0.5773f), AZ::Vector2(-1.0f, 0.0f) }, + { 1, 1, AZ::Vector3(-0.5773f, -0.5773f, 0.5773f), AZ::Vector2(0.0f, 0.0f) }, + }; + + auto perPositionCallback = [&testPoints](size_t xIndex, size_t yIndex, + const AzFramework::SurfaceData::SurfacePoint& surfacePoint, [[maybe_unused]] bool terrainExists) + { + bool found = false; + for (auto& testPoint : testPoints) + { + if (testPoint.m_xIndex == xIndex && testPoint.m_yIndex == yIndex + && testPoint.m_testLocation.GetX() == surfacePoint.m_position.GetX() + && testPoint.m_testLocation.GetY() == surfacePoint.m_position.GetY()) + { + constexpr float epsilon = 0.0001f; + EXPECT_NEAR(surfacePoint.m_normal.GetX(), testPoint.m_expectedNormal.GetX(), epsilon); + EXPECT_NEAR(surfacePoint.m_normal.GetY(), testPoint.m_expectedNormal.GetY(), epsilon); + EXPECT_NEAR(surfacePoint.m_normal.GetZ(), testPoint.m_expectedNormal.GetZ(), epsilon); + found = true; + break; + } + } + EXPECT_EQ(found, true); + }; + + terrainSystem->ProcessNormalsFromRegion(testRegionBox, stepSize, perPositionCallback, AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR); + } } // namespace UnitTest From 3b84049a1d12409d0cfa7bffcd5a059cc592915f Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Wed, 12 Jan 2022 12:18:06 -0800 Subject: [PATCH 445/948] Adding NetworkTestLevelEntityComponent to cmake for compilation Signed-off-by: Gene Walters --- AutomatedTesting/Gem/Code/automatedtesting_files.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/AutomatedTesting/Gem/Code/automatedtesting_files.cmake b/AutomatedTesting/Gem/Code/automatedtesting_files.cmake index eb619104a4..1f6dbbd772 100644 --- a/AutomatedTesting/Gem/Code/automatedtesting_files.cmake +++ b/AutomatedTesting/Gem/Code/automatedtesting_files.cmake @@ -12,4 +12,5 @@ set(FILES Source/AutomatedTestingSystemComponent.cpp Source/AutomatedTestingSystemComponent.h Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml + Source/AutoGen/NetworkTestLevelEntityComponent.AutoComponent.xml ) From 4e811d5af8383844889ed45f903b8650319c0d08 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Wed, 12 Jan 2022 12:19:59 -0800 Subject: [PATCH 446/948] Small update: adding the component type to a warning in order to help debug what component is failing Signed-off-by: Gene Walters --- Code/Framework/AzCore/AzCore/Component/Component.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Component/Component.cpp b/Code/Framework/AzCore/AzCore/Component/Component.cpp index c9829c6dd8..c11e4ef69f 100644 --- a/Code/Framework/AzCore/AzCore/Component/Component.cpp +++ b/Code/Framework/AzCore/AzCore/Component/Component.cpp @@ -49,7 +49,7 @@ namespace AZ return m_entity->GetId(); } - AZ_Warning("System", false, "Can't get component %p entity ID as it is not attached to an entity yet!", this); + AZ_Warning("System", false, "Can't get component (type: %s, addr: %p) entity ID as it is not attached to an entity yet!", RTTI_GetTypeName(), this); return EntityId(); } @@ -60,7 +60,7 @@ namespace AZ return NamedEntityId(m_entity->GetId(), m_entity->GetName()); } - AZ_Warning("System", false, "Can't get component %p entity ID as it is not attached to an entity yet!", this); + AZ_Warning("System", false, "Can't get component (type: %s, addr: %p) entity ID as it is not attached to an entity yet!", RTTI_GetTypeName(), this); return NamedEntityId(); } From a635e935e3893ad974e92a52fe4c71a115f1a325 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Wed, 12 Jan 2022 12:20:46 -0800 Subject: [PATCH 447/948] minor typo fix on code warning Signed-off-by: Gene Walters --- Code/Framework/AzCore/AzCore/Component/Entity.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Framework/AzCore/AzCore/Component/Entity.cpp b/Code/Framework/AzCore/AzCore/Component/Entity.cpp index c5cda98f2c..db9ead93ad 100644 --- a/Code/Framework/AzCore/AzCore/Component/Entity.cpp +++ b/Code/Framework/AzCore/AzCore/Component/Entity.cpp @@ -230,7 +230,7 @@ namespace AZ EBUS_EVENT_ID(m_id, EntityBus, OnEntityDeactivated, m_id); EBUS_EVENT(EntitySystemBus, OnEntityDeactivated, m_id); - AZ_Assert(m_state == State::Active, "Component should be in Active state to br Deactivated!"); + AZ_Assert(m_state == State::Active, "Component should be in Active state to be Deactivated!"); SetState(State::Deactivating); for (ComponentArrayType::reverse_iterator it = m_components.rbegin(); it != m_components.rend(); ++it) From 49a0c78013391ca62424560a05a59434ff30c8f9 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Wed, 12 Jan 2022 12:33:28 -0800 Subject: [PATCH 448/948] Check if transform component is attached to an entity before sending out notifications that rely upon having an entity; this stops runtime warnings when calling GetEntityId() Signed-off-by: Gene Walters --- .../Components/TransformComponent.cpp | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.cpp b/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.cpp index 809f664a10..e4e0ea08b2 100644 --- a/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.cpp +++ b/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.cpp @@ -585,21 +585,25 @@ namespace AzFramework EBUS_EVENT_PTR(m_notificationBus, AZ::TransformNotificationBus, OnParentChanged, oldParent, parentId); m_parentChangedEvent.Signal(oldParent, parentId); - if (oldParent != parentId) // Don't send removal notification while activating. + // Check if we're attached to an entity; the following notifications rely upon having a valid entity id + if (m_entity != nullptr) { - EBUS_EVENT_ID(oldParent, AZ::TransformNotificationBus, OnChildRemoved, GetEntityId()); - auto oldParentTransform = AZ::TransformBus::FindFirstHandler(oldParent); - if (oldParentTransform) + if (oldParent != parentId) // Don't send removal notification while activating. { - oldParentTransform->NotifyChildChangedEvent(AZ::ChildChangeType::Removed, GetEntityId()); + EBUS_EVENT_ID(oldParent, AZ::TransformNotificationBus, OnChildRemoved, GetEntityId()); + auto oldParentTransform = AZ::TransformBus::FindFirstHandler(oldParent); + if (oldParentTransform) + { + oldParentTransform->NotifyChildChangedEvent(AZ::ChildChangeType::Removed, GetEntityId()); + } } - } - EBUS_EVENT_ID(parentId, AZ::TransformNotificationBus, OnChildAdded, GetEntityId()); - auto newParentTransform = AZ::TransformBus::FindFirstHandler(parentId); - if (newParentTransform) - { - newParentTransform->NotifyChildChangedEvent(AZ::ChildChangeType::Added, GetEntityId()); + EBUS_EVENT_ID(parentId, AZ::TransformNotificationBus, OnChildAdded, GetEntityId()); + auto newParentTransform = AZ::TransformBus::FindFirstHandler(parentId); + if (newParentTransform) + { + newParentTransform->NotifyChildChangedEvent(AZ::ChildChangeType::Added, GetEntityId()); + } } } From ffde76208154d9e6c20f44f1d151eff82e763e9e Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Wed, 12 Jan 2022 12:43:39 -0800 Subject: [PATCH 449/948] Minor comment tweak, and code readability Signed-off-by: Gene Walters --- .../Code/Source/Editor/MultiplayerEditorConnection.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp index c8c1ed15bd..3ae4eb6444 100644 --- a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp +++ b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp @@ -100,8 +100,8 @@ namespace Multiplayer { // Editor Server Init is intended for non-release targets m_byteStream.Write(packet.GetAssetData().GetSize(), reinterpret_cast(packet.ModifyAssetData().GetBuffer())); - - // In case if this is the last update, process the byteStream buffer. Otherwise more packets are expected + + // If this is the last update then process the byteStream buffer. Otherwise more packets are expected if (packet.GetLastUpdate()) { // This is the last expected packet @@ -150,9 +150,8 @@ namespace Multiplayer AZ::Interface::Get()->BuildSpawnablesList(); // Load the level via the root spawnable that was registered - const AZ::CVarFixedString loadLevelString = "LoadLevel Root.spawnable"; const auto console = AZ::Interface::Get(); - console->PerformCommand(loadLevelString.c_str()); + console->PerformCommand("LoadLevel Root.spawnable"); // Setup the normal multiplayer connection AZ::Interface::Get()->InitializeMultiplayer(MultiplayerAgentType::DedicatedServer); From aebf93d8824a8b1d8b8e31d7a808161b21357dd8 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Wed, 12 Jan 2022 13:13:52 -0800 Subject: [PATCH 450/948] fixing a typo in docstring Signed-off-by: Scott Murray --- .../editor_python_test_tools/editor_entity_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py index bf27ec06e0..c3398406ab 100644 --- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py @@ -264,7 +264,7 @@ class EditorComponent: def disable_component(self): """ Used to disable the component using its id value. - Deprecation warning! Use set_enable(False) instead as this method is in deprecation + Deprecation warning! Use set_enabled(False) instead as this method is in deprecation :return: None """ warnings.warn("disable_component is deprecated, use set_enabled(False) instead.", DeprecationWarning) From 74e40551957548935201d5a935c5a66c9d520310 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Wed, 12 Jan 2022 15:23:06 -0800 Subject: [PATCH 451/948] Fix Prefab instance assets not preloading (#6834) PrefabCatchmentProcessor::ProcessPrefab was no longer updating the ProcessedObjectStore's referenced object list, this change exposes the referenced asset list in the new PrefabDocument API and uses them to update the referenced asset list. Signed-off-by: Nicholas Van Sickle --- .../Prefab/Spawnable/PrefabCatchmentProcessor.cpp | 1 + .../Prefab/Spawnable/PrefabDocument.cpp | 12 +++++++++++- .../Prefab/Spawnable/PrefabDocument.h | 4 ++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.cpp index 40cd52cac8..a5ca034c36 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabCatchmentProcessor.cpp @@ -64,6 +64,7 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils AZStd::move(uniqueName), context.GetSourceUuid(), AZStd::move(serializer)); AZ_Assert(spawnable, "Failed to create a new spawnable."); + object.GetReferencedAssets() = prefab.GetReferencedAssets(); Instance& instance = prefab.GetInstance(); // Resolve entity aliases that store PrefabDOM information to use the spawnable instead. This is done before the entities are // moved from the instance as they'd otherwise can't be found. diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp index 04fdea30d2..230c2226cd 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.cpp @@ -124,12 +124,22 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils return *m_instance; } + AZStd::vector>& PrefabDocument::GetReferencedAssets() + { + return m_referencedAssets; + } + + const AZStd::vector>& PrefabDocument::GetReferencedAssets() const + { + return m_referencedAssets; + } + bool PrefabDocument::ConstructInstanceFromPrefabDom(const PrefabDom& prefab) { using namespace AzToolsFramework::Prefab; m_instance->Reset(); - if (PrefabDomUtils::LoadInstanceFromPrefabDom(*m_instance, prefab, PrefabDomUtils::LoadFlags::AssignRandomEntityId)) + if (PrefabDomUtils::LoadInstanceFromPrefabDom(*m_instance, prefab, m_referencedAssets, PrefabDomUtils::LoadFlags::AssignRandomEntityId)) { return true; } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h index 215daf7f71..661dba5edf 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/PrefabDocument.h @@ -53,12 +53,16 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils AzToolsFramework::Prefab::Instance& GetInstance(); const AzToolsFramework::Prefab::Instance& GetInstance() const; + AZStd::vector>& GetReferencedAssets(); + const AZStd::vector>& GetReferencedAssets() const; + private: bool ConstructInstanceFromPrefabDom(const PrefabDom& prefab); mutable PrefabDom m_dom; AZStd::unique_ptr m_instance; AZStd::string m_name; + AZStd::vector> m_referencedAssets; mutable bool m_isDirty{ false }; }; } // namespace AzToolsFramework::Prefab::PrefabConversionUtils From 4e755cc258645d29cc286e5ec52b623486e1ca0e Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Wed, 12 Jan 2022 16:21:40 -0800 Subject: [PATCH 452/948] Add variable, datum sanity for user added slots Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../ConnectionFilters/DataConnectionFilters.h | 4 ++-- .../DataConnectionComponent.cpp | 4 ++-- .../Slots/Data/DataSlotComponent.cpp | 11 +++++---- .../Components/Slots/Data/DataSlotComponent.h | 4 ++-- .../Components/Slots/Data/DataSlotBus.h | 4 ++-- .../GraphCanvas/Editor/GraphModelBus.h | 9 +++---- .../SlotContextMenuActions.cpp | 10 ++++---- .../GraphModel/Code/Tests/MockGraphCanvas.cpp | 4 ++-- Gems/GraphModel/Code/Tests/MockGraphCanvas.h | 4 ++-- .../Code/Editor/Components/EditorGraph.cpp | 24 ++++++++++--------- .../ScriptCanvas/Components/EditorGraph.h | 8 +++---- .../View/Windows/ScriptCanvasContextMenus.cpp | 2 +- .../Asset/RuntimeAssetHandler.cpp | 8 ++++++- .../Code/Include/ScriptCanvas/Core/Node.cpp | 4 ++-- .../Code/Include/ScriptCanvas/Core/Node.h | 2 +- .../Code/Include/ScriptCanvas/Core/Slot.cpp | 11 +++++---- .../Code/Include/ScriptCanvas/Core/Slot.h | 4 ++-- .../Grammar/AbstractCodeModel.cpp | 10 ++++---- .../GraphVariableManagerComponent.cpp | 2 +- 19 files changed, 70 insertions(+), 59 deletions(-) diff --git a/Gems/GraphCanvas/Code/Include/GraphCanvas/Components/Connections/ConnectionFilters/DataConnectionFilters.h b/Gems/GraphCanvas/Code/Include/GraphCanvas/Components/Connections/ConnectionFilters/DataConnectionFilters.h index c7721e284d..452b6e744a 100644 --- a/Gems/GraphCanvas/Code/Include/GraphCanvas/Components/Connections/ConnectionFilters/DataConnectionFilters.h +++ b/Gems/GraphCanvas/Code/Include/GraphCanvas/Components/Connections/ConnectionFilters/DataConnectionFilters.h @@ -97,7 +97,7 @@ namespace GraphCanvas // Only want to try to convert to references when we have no connections if (!hasConnections) { - DataSlotRequestBus::EventResult(acceptConnection, sourceEndpoint.GetSlotId(), &DataSlotRequests::CanConvertToReference); + DataSlotRequestBus::EventResult(acceptConnection, sourceEndpoint.GetSlotId(), &DataSlotRequests::CanConvertToReference, false); } } else if (targetType == DataSlotType::Value) @@ -115,7 +115,7 @@ namespace GraphCanvas // Only want to try to convert to references when we have no connections if (!hasConnections) { - DataSlotRequestBus::EventResult(acceptConnection, targetEndpoint.GetSlotId(), &DataSlotRequests::CanConvertToReference); + DataSlotRequestBus::EventResult(acceptConnection, targetEndpoint.GetSlotId(), &DataSlotRequests::CanConvertToReference, false); } } else if (sourceType == DataSlotType::Value) diff --git a/Gems/GraphCanvas/Code/Source/Components/Connections/DataConnections/DataConnectionComponent.cpp b/Gems/GraphCanvas/Code/Source/Components/Connections/DataConnections/DataConnectionComponent.cpp index f4ec0bfa1d..46e6f25978 100644 --- a/Gems/GraphCanvas/Code/Source/Components/Connections/DataConnections/DataConnectionComponent.cpp +++ b/Gems/GraphCanvas/Code/Source/Components/Connections/DataConnections/DataConnectionComponent.cpp @@ -92,7 +92,7 @@ namespace GraphCanvas } else if (sourceSlotType == DataSlotType::Reference) { - DataSlotRequestBus::EventResult(converted, GetTargetSlotId(), &DataSlotRequests::ConvertToReference); + DataSlotRequestBus::EventResult(converted, GetTargetSlotId(), &DataSlotRequests::ConvertToReference, false); } } else if (m_dragContext == DragContext::MoveSource) @@ -103,7 +103,7 @@ namespace GraphCanvas } else if (targetSlotType == DataSlotType::Reference) { - DataSlotRequestBus::EventResult(converted, GetSourceSlotId(), &DataSlotRequests::ConvertToReference); + DataSlotRequestBus::EventResult(converted, GetSourceSlotId(), &DataSlotRequests::ConvertToReference, false); } } else if (m_dragContext == DragContext::TryConnection) diff --git a/Gems/GraphCanvas/Code/Source/Components/Slots/Data/DataSlotComponent.cpp b/Gems/GraphCanvas/Code/Source/Components/Slots/Data/DataSlotComponent.cpp index db62b29de5..7eb9187123 100644 --- a/Gems/GraphCanvas/Code/Source/Components/Slots/Data/DataSlotComponent.cpp +++ b/Gems/GraphCanvas/Code/Source/Components/Slots/Data/DataSlotComponent.cpp @@ -294,9 +294,9 @@ namespace GraphCanvas } } - bool DataSlotComponent::ConvertToReference() + bool DataSlotComponent::ConvertToReference(bool isNewSlot) { - if (CanConvertToReference()) + if (CanConvertToReference(isNewSlot)) { AZ::EntityId nodeId = GetNode(); GraphId graphId; @@ -307,7 +307,7 @@ namespace GraphCanvas ScopedGraphUndoBlocker undoBlocker(graphId); bool convertedToReference = false; - GraphModelRequestBus::EventResult(convertedToReference, graphId, &GraphModelRequests::ConvertSlotToReference, Endpoint(nodeId, GetEntityId())); + GraphModelRequestBus::EventResult(convertedToReference, graphId, &GraphModelRequests::ConvertSlotToReference, Endpoint(nodeId, GetEntityId()), isNewSlot); if (convertedToReference) { @@ -326,8 +326,9 @@ namespace GraphCanvas return m_dataSlotType == DataSlotType::Reference; } - bool DataSlotComponent::CanConvertToReference() const + bool DataSlotComponent::CanConvertToReference([[maybe_unused]] bool isNewSlot) const { + // #sc_user_slot_variable_ux make sure this can be converted to reference, or created as one bool canToggleReference = false; if (m_canConvertSlotTypes && DataSlotUtils::IsValueDataSlotType(m_dataSlotType) && !HasConnections()) @@ -336,7 +337,7 @@ namespace GraphCanvas GraphId graphId; SceneMemberRequestBus::EventResult(graphId, nodeId, &SceneMemberRequests::GetScene); - GraphModelRequestBus::EventResult(canToggleReference, graphId, &GraphModelRequests::CanConvertSlotToReference, Endpoint(nodeId, GetEntityId())); + GraphModelRequestBus::EventResult(canToggleReference, graphId, &GraphModelRequests::CanConvertSlotToReference, Endpoint(nodeId, GetEntityId()), isNewSlot); } return canToggleReference; diff --git a/Gems/GraphCanvas/Code/Source/Components/Slots/Data/DataSlotComponent.h b/Gems/GraphCanvas/Code/Source/Components/Slots/Data/DataSlotComponent.h index fb76c2c80e..5bd35d9f34 100644 --- a/Gems/GraphCanvas/Code/Source/Components/Slots/Data/DataSlotComponent.h +++ b/Gems/GraphCanvas/Code/Source/Components/Slots/Data/DataSlotComponent.h @@ -47,8 +47,8 @@ namespace GraphCanvas //// // DataSlotRequestBus - bool ConvertToReference() override; - bool CanConvertToReference() const override; + bool ConvertToReference(bool isNewSlot = false) override; + bool CanConvertToReference(bool isNewSlot = false) const override; bool ConvertToValue() override; bool CanConvertToValue() const override; diff --git a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Components/Slots/Data/DataSlotBus.h b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Components/Slots/Data/DataSlotBus.h index 3d007dda91..fbdae8a971 100644 --- a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Components/Slots/Data/DataSlotBus.h +++ b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Components/Slots/Data/DataSlotBus.h @@ -70,8 +70,8 @@ namespace GraphCanvas static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; using BusIdType = AZ::EntityId; - virtual bool ConvertToReference() = 0; - virtual bool CanConvertToReference() const = 0; + virtual bool ConvertToReference(bool isNewSlot = false) = 0; + virtual bool CanConvertToReference(bool isNewSlot = false) const = 0; virtual bool ConvertToValue() = 0; virtual bool CanConvertToValue() const = 0; diff --git a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Editor/GraphModelBus.h b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Editor/GraphModelBus.h index 769cdb2a10..23aa612dd5 100644 --- a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Editor/GraphModelBus.h +++ b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Editor/GraphModelBus.h @@ -125,12 +125,12 @@ namespace GraphCanvas return false; } - virtual bool ConvertSlotToReference([[maybe_unused]] const Endpoint& endpoint) + virtual bool ConvertSlotToReference([[maybe_unused]] const Endpoint& endpoint, [[maybe_unused]] bool isNewSlot) { return false; } - virtual bool CanConvertSlotToReference([[maybe_unused]] const Endpoint& endpoint) + virtual bool CanConvertSlotToReference([[maybe_unused]] const Endpoint& endpoint, [[maybe_unused]] bool isNewSlot) { return false; } @@ -145,12 +145,13 @@ namespace GraphCanvas return false; } - virtual bool CanPromoteToVariable([[maybe_unused]] const Endpoint& endpoint) const + virtual bool CanPromoteToVariable([[maybe_unused]] const Endpoint& endpoint, [[maybe_unused]] bool isNewSlot = false) const { return false; } - virtual bool PromoteToVariableAction([[maybe_unused]] const Endpoint& endpoint) + virtual bool PromoteToVariableAction([[maybe_unused]] const Endpoint& endpoint + , [[maybe_unused]] bool isNewSlot) { return false; } diff --git a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/SlotMenuActions/SlotContextMenuActions.cpp b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/SlotMenuActions/SlotContextMenuActions.cpp index a255c97120..38e97f90cc 100644 --- a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/SlotMenuActions/SlotContextMenuActions.cpp +++ b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Widgets/EditorContextMenu/ContextMenuActions/SlotMenuActions/SlotContextMenuActions.cpp @@ -258,7 +258,7 @@ namespace GraphCanvas if (DataSlotUtils::IsValueDataSlotType(dataSlotType)) { setText("Convert to Reference"); - DataSlotRequestBus::EventResult(canToggleState, targetId, &DataSlotRequests::CanConvertToReference); + DataSlotRequestBus::EventResult(canToggleState, targetId, &DataSlotRequests::CanConvertToReference, false); } else { @@ -291,7 +291,7 @@ namespace GraphCanvas if (DataSlotUtils::IsValueDataSlotType(dataSlotType)) { - DataSlotRequestBus::EventResult(toggledState, targetId, &DataSlotRequests::ConvertToReference); + DataSlotRequestBus::EventResult(toggledState, targetId, &DataSlotRequests::ConvertToReference, false); } else { @@ -345,14 +345,14 @@ namespace GraphCanvas if (DataSlotUtils::IsValueDataSlotType(dataSlotType)) { - DataSlotRequestBus::EventResult(enableAction, targetId, &DataSlotRequests::CanConvertToReference); + DataSlotRequestBus::EventResult(enableAction, targetId, &DataSlotRequests::CanConvertToReference, false); if (enableAction) { Endpoint endpoint; SlotRequestBus::EventResult(endpoint, targetId, &SlotRequests::GetEndpoint); - GraphModelRequestBus::EventResult(enableAction, graphId, &GraphModelRequests::CanPromoteToVariable, endpoint); + GraphModelRequestBus::EventResult(enableAction, graphId, &GraphModelRequests::CanPromoteToVariable, endpoint, false); } } } @@ -371,7 +371,7 @@ namespace GraphCanvas SlotRequestBus::EventResult(endpoint, targetId, &SlotRequests::GetEndpoint); bool promotedElement = false; - GraphModelRequestBus::EventResult(promotedElement, graphId, &GraphModelRequests::PromoteToVariableAction, endpoint); + GraphModelRequestBus::EventResult(promotedElement, graphId, &GraphModelRequests::PromoteToVariableAction, endpoint, false); if (promotedElement) { diff --git a/Gems/GraphModel/Code/Tests/MockGraphCanvas.cpp b/Gems/GraphModel/Code/Tests/MockGraphCanvas.cpp index 91a25d6a30..525386a1a3 100644 --- a/Gems/GraphModel/Code/Tests/MockGraphCanvas.cpp +++ b/Gems/GraphModel/Code/Tests/MockGraphCanvas.cpp @@ -94,12 +94,12 @@ namespace MockGraphCanvasServices GraphCanvas::DataSlotRequestBus::Handler::BusDisconnect(); } - bool MockDataSlotComponent::ConvertToReference() + bool MockDataSlotComponent::ConvertToReference([[maybe_unused]] bool isNewSlot = false) { return false; } - bool MockDataSlotComponent::CanConvertToReference() const + bool MockDataSlotComponent::CanConvertToReference([[maybe_unused]] bool isNewSlot = false) const { return false; } diff --git a/Gems/GraphModel/Code/Tests/MockGraphCanvas.h b/Gems/GraphModel/Code/Tests/MockGraphCanvas.h index c7865e769e..00bd80aa02 100644 --- a/Gems/GraphModel/Code/Tests/MockGraphCanvas.h +++ b/Gems/GraphModel/Code/Tests/MockGraphCanvas.h @@ -72,8 +72,8 @@ namespace MockGraphCanvasServices void Deactivate() override; // GraphCanvas::DataSlotRequestBus overrides ... - bool ConvertToReference() override; - bool CanConvertToReference() const override; + bool ConvertToReference(bool isNewSlot = false) override; + bool CanConvertToReference(bool isNewSlot = false) const override; bool ConvertToValue() override; bool CanConvertToValue() const override; bool IsUserSlot() const override; diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp index d713bc09a6..342273cb2e 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp @@ -667,7 +667,8 @@ namespace ScriptCanvasEditor } // Now that the slot has a valid type/name, we can actually promote it to a variable - if (PromoteToVariableAction(endpoint) /*&& slot->IsVariableReference()*/) + // #sc_user_slot_variable_ux add a value indicating that the slot is new + if (PromoteToVariableAction(endpoint, true)) { ScriptCanvas::GraphVariable* variable = slot->GetVariable(); @@ -2081,20 +2082,20 @@ namespace ScriptCanvasEditor return false; } - bool Graph::ConvertSlotToReference(const GraphCanvas::Endpoint& endpoint) + bool Graph::ConvertSlotToReference(const GraphCanvas::Endpoint& endpoint, bool isNewSlot) { ScriptCanvas::Endpoint scEndpoint = ConvertToScriptCanvasEndpoint(endpoint); ScriptCanvas::Node* canvasNode = FindNode(scEndpoint.GetNodeId()); if (canvasNode) { - return canvasNode->ConvertSlotToReference(scEndpoint.GetSlotId()); + return canvasNode->ConvertSlotToReference(scEndpoint.GetSlotId(), isNewSlot); } return false; } - bool Graph::CanConvertSlotToReference(const GraphCanvas::Endpoint& endpoint) + bool Graph::CanConvertSlotToReference(const GraphCanvas::Endpoint& endpoint, bool isNewSlot) { ScriptCanvas::Endpoint scEndpoint = ConvertToScriptCanvasEndpoint(endpoint); ScriptCanvas::Node* canvasNode = FindNode(scEndpoint.GetNodeId()); @@ -2104,7 +2105,7 @@ namespace ScriptCanvasEditor ScriptCanvas::Slot* slot = canvasNode->GetSlot(scEndpoint.GetSlotId()); if (slot) { - return slot->CanConvertToReference(); + return slot->CanConvertToReference(isNewSlot); } } @@ -2170,7 +2171,7 @@ namespace ScriptCanvasEditor return handledEvent; } - bool Graph::CanPromoteToVariable(const GraphCanvas::Endpoint& endpoint) const + bool Graph::CanPromoteToVariable(const GraphCanvas::Endpoint& endpoint, [[maybe_unused]] bool isNewSlot) const { ScriptCanvas::Endpoint scriptCanvasEndpoint = ConvertToScriptCanvasEndpoint(endpoint); auto activeSlot = FindSlot(scriptCanvasEndpoint); @@ -2189,8 +2190,9 @@ namespace ScriptCanvasEditor return false; } - bool Graph::PromoteToVariableAction(const GraphCanvas::Endpoint& endpoint) + bool Graph::PromoteToVariableAction(const GraphCanvas::Endpoint& endpoint, bool isNewSlot) { + // #sc_user_slot_variable_ux make the fix here...rework is user added or something ScriptCanvas::Endpoint scriptCanvasEndpoint = ConvertToScriptCanvasEndpoint(endpoint); auto activeNode = FindNode(scriptCanvasEndpoint.GetNodeId()); @@ -2282,12 +2284,12 @@ namespace ScriptCanvasEditor AZ::Outcome addOutcome; - // #functions2 slot<->variable re-use the activeDatum, send the pointer (actually, all of the source slot information, and make a special conversion) + // #sc_user_slot_variable_ux re-use the activeDatum, send the pointer (actually, all of the source slot information, and make a special conversion) ScriptCanvas::GraphVariableManagerRequestBus::EventResult(addOutcome, GetScriptCanvasId(), &ScriptCanvas::GraphVariableManagerRequests::AddVariable, variableName, variableDatum, true); if (addOutcome.IsSuccess()) { - GraphCanvas::DataSlotRequestBus::Event(endpoint.GetSlotId(), &GraphCanvas::DataSlotRequests::ConvertToReference); + GraphCanvas::DataSlotRequestBus::Event(endpoint.GetSlotId(), &GraphCanvas::DataSlotRequests::ConvertToReference, isNewSlot); activeSlot->SetVariableReference(addOutcome.GetValue()); @@ -2319,7 +2321,7 @@ namespace ScriptCanvasEditor { if (!targetSlot->IsVariableReference()) { - GraphCanvas::DataSlotRequestBus::Event(referenceTarget.GetSlotId(), &GraphCanvas::DataSlotRequests::ConvertToReference); + GraphCanvas::DataSlotRequestBus::Event(referenceTarget.GetSlotId(), &GraphCanvas::DataSlotRequests::ConvertToReference, false); } if (targetSlot->IsVariableReference()) @@ -2884,7 +2886,7 @@ namespace ScriptCanvasEditor for (auto graphCanvasEndpoint : referencableEndpoints) { - GraphCanvas::DataSlotRequestBus::Event(graphCanvasEndpoint.GetSlotId(), &GraphCanvas::DataSlotRequests::ConvertToReference); + GraphCanvas::DataSlotRequestBus::Event(graphCanvasEndpoint.GetSlotId(), &GraphCanvas::DataSlotRequests::ConvertToReference, false); ScriptCanvas::Endpoint scriptCanvasEndpoint = ConvertToScriptCanvasEndpoint(graphCanvasEndpoint); diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h index 9157aaeac9..ba7ff6abaf 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h @@ -175,12 +175,12 @@ namespace ScriptCanvasEditor void RemoveSlot(const GraphCanvas::Endpoint& endpoint) override; bool IsSlotRemovable(const GraphCanvas::Endpoint& endpoint) const override; - bool ConvertSlotToReference(const GraphCanvas::Endpoint& endpoint) override; - bool CanConvertSlotToReference(const GraphCanvas::Endpoint& endpoint) override; + bool ConvertSlotToReference(const GraphCanvas::Endpoint& endpoint, bool isNewSlot = false) override; + bool CanConvertSlotToReference(const GraphCanvas::Endpoint& endpoint, bool isNewSlot = false) override; GraphCanvas::CanHandleMimeEventOutcome CanHandleReferenceMimeEvent(const GraphCanvas::Endpoint& endpoint, const QMimeData* mimeData) override; bool HandleReferenceMimeEvent(const GraphCanvas::Endpoint& endpoint, const QMimeData* mimeData) override; - bool CanPromoteToVariable(const GraphCanvas::Endpoint& endpoint) const override; - bool PromoteToVariableAction(const GraphCanvas::Endpoint& endpoint) override; + bool CanPromoteToVariable(const GraphCanvas::Endpoint& endpoint, bool isNewSlot = false) const override; + bool PromoteToVariableAction(const GraphCanvas::Endpoint& endpoint, bool isNewSlot = false) override; bool SynchronizeReferences(const GraphCanvas::Endpoint& sourceEndpoint, const GraphCanvas::Endpoint& targetEndpoint) override; bool ConvertSlotToValue(const GraphCanvas::Endpoint& endpoint) override; diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/ScriptCanvasContextMenus.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/ScriptCanvasContextMenus.cpp index 6402a24b3a..662cec7195 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/ScriptCanvasContextMenus.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/ScriptCanvasContextMenus.cpp @@ -516,7 +516,7 @@ namespace ScriptCanvasEditor GraphCanvas::SlotRequestBus::EventResult(endpoint, slotId2, &GraphCanvas::SlotRequests::GetEndpoint); bool promotedElement = false; - GraphCanvas::GraphModelRequestBus::EventResult(promotedElement, graphId2, &GraphCanvas::GraphModelRequests::PromoteToVariableAction, endpoint); + GraphCanvas::GraphModelRequestBus::EventResult(promotedElement, graphId2, &GraphCanvas::GraphModelRequests::PromoteToVariableAction, endpoint, false); if (promotedElement) { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAssetHandler.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAssetHandler.cpp index 0b94fb370a..a18caf4b87 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAssetHandler.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Asset/RuntimeAssetHandler.cpp @@ -100,12 +100,18 @@ namespace ScriptCanvas { RuntimeAsset* runtimeAsset = asset.GetAs(); AZ_Assert(runtimeAsset, "This should be a Script Canvas runtime asset, as this is the only type we process!"); + if (runtimeAsset && m_serializeContext) { stream->Seek(0U, AZ::IO::GenericStream::ST_SEEK_BEGIN); - bool loadSuccess = AZ::Utils::LoadObjectFromStreamInPlace(*stream, runtimeAsset->m_runtimeData, m_serializeContext, AZ::ObjectStream::FilterDescriptor(assetLoadFilterCB)); + const bool loadSuccess = AZ::Utils::LoadObjectFromStreamInPlace(*stream, runtimeAsset->m_runtimeData + , m_serializeContext, AZ::ObjectStream::FilterDescriptor(assetLoadFilterCB)); + AZ_Error("ScriptCanvas", loadSuccess, "ScriptCanvas failed to load runtime asset: %s - %s" + , asset.GetHint().c_str(), asset.GetId().ToString().c_str()); + return loadSuccess ? AZ::Data::AssetHandler::LoadResult::LoadComplete : AZ::Data::AssetHandler::LoadResult::Error; } + return AZ::Data::AssetHandler::LoadResult::Error; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Node.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Node.cpp index c4143e7295..6cf9da1510 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Node.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Node.cpp @@ -2577,11 +2577,11 @@ namespace ScriptCanvas } } - bool Node::ConvertSlotToReference(const SlotId& slotId) + bool Node::ConvertSlotToReference(const SlotId& slotId, bool isNewSlot) { Slot* slot = GetSlot(slotId); - if (slot && slot->ConvertToReference()) + if (slot && slot->ConvertToReference(isNewSlot)) { InitializeVariableReference((*slot), {}); return true; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Node.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Node.h index 97916c8af6..f8b4ca7264 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Node.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Node.h @@ -498,7 +498,7 @@ namespace ScriptCanvas void SanityCheckDynamicDisplay(); void SanityCheckDynamicDisplay(ExploredDynamicGroupCache& exploredGroupCache); - bool ConvertSlotToReference(const SlotId& slotId); + bool ConvertSlotToReference(const SlotId& slotId, bool isNewSlot = false); bool ConvertSlotToValue(const SlotId& slotId); NamedEndpoint CreateNamedEndpoint(SlotId slotId) const; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Slot.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Slot.cpp index 44d2367156..6aef61b12f 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Slot.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Slot.cpp @@ -460,14 +460,15 @@ namespace ScriptCanvas && GetDataType() != Data::Type::BehaviorContextObject(GraphScopedVariableId::TYPEINFO_Uuid()); } - bool Slot::CanConvertToReference() const - { - return !m_isUserAdded && CanConvertTypes() && !m_isVariableReference && !m_node->HasConnectedNodes((*this)); + bool Slot::CanConvertToReference(bool isNewSlot) const + { + // #sc_user_slot_variable_ux make sure this can be converted to reference, or created as one + return (!m_isUserAdded || isNewSlot) && CanConvertTypes() && !m_isVariableReference && !m_node->HasConnectedNodes((*this)); } - bool Slot::ConvertToReference() + bool Slot::ConvertToReference(bool isNewSlot) { - if (CanConvertToReference()) + if (CanConvertToReference(isNewSlot)) { m_isVariableReference = true; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Slot.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Slot.h index b182af7c67..5649c3e34c 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Slot.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Slot.h @@ -147,8 +147,8 @@ namespace ScriptCanvas bool CanConvertToValue() const; bool ConvertToValue(); - bool CanConvertToReference() const; - bool ConvertToReference(); + bool CanConvertToReference(bool isNewSlot = false) const; + bool ConvertToReference(bool isNewSlot = false); void SetVariableReference(const VariableId& variableId); const VariableId& GetVariableReference() const; GraphVariable* GetVariable() const; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp index 829a1098dc..299718fd0f 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp @@ -237,7 +237,7 @@ namespace ScriptCanvas if (auto datum = variablePair.second.GetDatum()) { - // #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 + // #sc_user_slot_variable_ux 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)); } @@ -248,7 +248,7 @@ namespace ScriptCanvas auto datum = sourceVariable->GetDatum(); AZ_Assert(datum != nullptr, "the datum must be valid"); - // #functions2 slot<->variable check to verify if it is a member variable + // #sc_user_slot_variable_ux check to verify if it is a member variable auto variable = sourceVariable->GetScope() == VariableFlags::Scope::Graph ? AddMemberVariable(*datum, sourceVariable->GetVariableName(), sourceVariable->GetVariableId()) : AddVariable(*datum, sourceVariable->GetVariableName(), sourceVariable->GetVariableId()); @@ -1671,7 +1671,7 @@ namespace ScriptCanvas if (returnValue.second->m_source->m_sourceSlotId == slot->GetId()) { - // #functions2 slot<->variable determine if the root or the function call should be passed in here...the slot/node lead to the user call on the thread, but it may not even be created yet + // #sc_user_slot_variable_ux determine if the root or the function call should be passed in here...the slot/node lead to the user call on the thread, but it may not even be created yet return AZStd::make_pair(root, returnValue.second->m_source); } } @@ -4644,7 +4644,7 @@ namespace ScriptCanvas void AbstractCodeModel::ParseNodelingVariables(const Node& node, NodelingType nodelingType) { - // #functions2 slot<->variable adjust once datums are more coordinated + // #sc_user_slot_variable_ux adjust once datums are more coordinated auto createVariablesSlots = [&](AZStd::unordered_map& variablesBySlots, const AZStd::vector& slots, bool slotHasDatum) { for (const auto& slot : slots) @@ -4660,7 +4660,7 @@ namespace ScriptCanvas return; } - // #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 + // #sc_user_slot_variable_ux consider getting all variables from the UX variable manager, or from the ACM and looking them up in the variable manager for ordering // auto iter = m_sourceVariableByDatum.find(variableDatum); // if (iter == m_sourceVariableByDatum.end()) // { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariableManagerComponent.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariableManagerComponent.cpp index 58e8be0c37..81383bf747 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariableManagerComponent.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariableManagerComponent.cpp @@ -220,7 +220,7 @@ namespace ScriptCanvas return AZ::Success(newId); } - // #functions2 slot<->variable add this to the graph, using the old datum + // #sc_user_slot_variable_ux add this to the graph, using the old datum AZ::Outcome GraphVariableManagerComponent::AddVariable(AZStd::string_view name, const Datum& value, bool functionScope) { if (FindVariable(name)) From 073994e8e75d1ec3ffafe84a16d1613962b42b34 Mon Sep 17 00:00:00 2001 From: amzn-sj Date: Wed, 12 Jan 2022 17:34:34 -0800 Subject: [PATCH 453/948] Remove quotes around list (#6864) Signed-off-by: amzn-sj --- cmake/Platform/Mac/InstallUtils_mac.cmake.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Platform/Mac/InstallUtils_mac.cmake.in b/cmake/Platform/Mac/InstallUtils_mac.cmake.in index 3db9903e48..9be6338752 100644 --- a/cmake/Platform/Mac/InstallUtils_mac.cmake.in +++ b/cmake/Platform/Mac/InstallUtils_mac.cmake.in @@ -43,7 +43,7 @@ function(fixup_python_framework framework_path) file(GLOB_RECURSE exe_file_list "${framework_path}/**/*.exe") if(exe_file_list) - file(REMOVE_RECURSE "${exe_file_list}") + file(REMOVE_RECURSE ${exe_file_list}) endif() execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink include/python@LY_PYTHON_VERSION_MAJOR_MINOR@m Headers WORKING_DIRECTORY "${framework_path}/Versions/@LY_PYTHON_VERSION_MAJOR_MINOR@" From fabb2b186c4d3f0b9cd2aa49a1233977fa796e12 Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Wed, 12 Jan 2022 20:52:57 -0800 Subject: [PATCH 454/948] chore: disable mouse move test Signed-off-by: Michael Pollind --- .../Tests/Input/QtEventToAzInputMapperTests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp b/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp index d7ab896462..31193f6f05 100644 --- a/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp +++ b/Code/Framework/AzToolsFramework/Tests/Input/QtEventToAzInputMapperTests.cpp @@ -539,7 +539,7 @@ namespace UnitTest { }; - TEST_P(MoveMoveWrapParamQtEventToAzInputMapperFixture, MouseMove_NoAzHandlers_VerifyMouseMovementViewport) + TEST_P(MoveMoveWrapParamQtEventToAzInputMapperFixture, DISABLED_MouseMove_NoAzHandlers_VerifyMouseMovementViewport) { // setup From e224fc2ee5ec2a12e75a10acae268b7b38ae3a32 Mon Sep 17 00:00:00 2001 From: Roman <69218254+amzn-rhhong@users.noreply.github.com> Date: Wed, 12 Jan 2022 22:39:56 -0800 Subject: [PATCH 455/948] Bugfix - ViewportInteractionImp connected to the wrong id in RenderViewportWidget (#6867) Signed-off-by: rhhong --- .../Code/Source/Viewport/RenderViewportWidget.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp index 505ff70122..b15cf53427 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp @@ -68,6 +68,7 @@ namespace AtomToolsFramework { return false; } + const AzFramework::ViewportId newId = m_viewportContext->GetId(); SetControllerList(AZStd::make_shared()); @@ -78,14 +79,14 @@ namespace AtomToolsFramework m_viewportInteractionImpl = AZStd::make_unique(m_defaultCamera); m_viewportInteractionImpl->m_deviceScalingFactorFn = [this] { return aznumeric_cast(devicePixelRatioF()); }; m_viewportInteractionImpl->m_screenSizeFn = [this] { return AzFramework::ScreenSize(width(), height()); }; - m_viewportInteractionImpl->Connect(id); + m_viewportInteractionImpl->Connect(newId); AzToolsFramework::ViewportInteraction::ViewportMouseCursorRequestBus::Handler::BusConnect(GetId()); AzFramework::InputChannelEventListener::Connect(); AZ::TickBus::Handler::BusConnect(); AzFramework::WindowRequestBus::Handler::BusConnect(params.windowHandle); - m_inputChannelMapper = new AzToolsFramework::QtEventToAzInputMapper(this, id); + m_inputChannelMapper = new AzToolsFramework::QtEventToAzInputMapper(this, newId); // Forward input events to our controller list. QObject::connect(m_inputChannelMapper, &AzToolsFramework::QtEventToAzInputMapper::InputChannelUpdated, this, From ff0df4b8b6e66286c12391522c4814cc7f8864f7 Mon Sep 17 00:00:00 2001 From: Andre Mitchell <47983418+BytesOfPiDev@users.noreply.github.com> Date: Thu, 13 Jan 2022 03:36:19 -0500 Subject: [PATCH 456/948] Update behavior reflection of EMotionFX's MotionEvent to use nullptr instead of empty lambdas. (#6617) Signed-off-by: Andre Mitchell --- .../Integration/System/SystemComponent.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/Gems/EMotionFX/Code/Source/Integration/System/SystemComponent.cpp b/Gems/EMotionFX/Code/Source/Integration/System/SystemComponent.cpp index 15037793f1..08607c330d 100644 --- a/Gems/EMotionFX/Code/Source/Integration/System/SystemComponent.cpp +++ b/Gems/EMotionFX/Code/Source/Integration/System/SystemComponent.cpp @@ -400,17 +400,16 @@ namespace EMotionFX behaviorContext->EBus("SystemNotificationBus") ; - // In order for a property to be displayed in ScriptCanvas. Both a setter and a getter are necessary(both must be non-null). - // This is being worked on in dragon branch, once this is complete the dummy lambda functions can be removed. + // In order for a property to be displayed in ScriptCanvas. behaviorContext->Class("MotionEvent") - ->Property("entityId", BehaviorValueGetter(&MotionEvent::m_entityId), [](MotionEvent*, const AZ::EntityId&) {}) - ->Property("parameter", BehaviorValueGetter(&MotionEvent::m_parameter), [](MotionEvent*, const char*) {}) - ->Property("eventType", BehaviorValueGetter(&MotionEvent::m_eventType), [](MotionEvent*, const AZ::u32&) {}) - ->Property("eventTypeName", BehaviorValueGetter(&MotionEvent::m_eventTypeName), [](MotionEvent*, const char*) {}) - ->Property("time", BehaviorValueGetter(&MotionEvent::m_time), [](MotionEvent*, const float&) {}) - ->Property("globalWeight", BehaviorValueGetter(&MotionEvent::m_globalWeight), [](MotionEvent*, const float&) {}) - ->Property("localWeight", BehaviorValueGetter(&MotionEvent::m_localWeight), [](MotionEvent*, const float&) {}) - ->Property("isEventStart", BehaviorValueGetter(&MotionEvent::m_isEventStart), [](MotionEvent*, const bool&) {}) + ->Property("entityId", BehaviorValueGetter(&MotionEvent::m_entityId), nullptr) + ->Property("parameter", BehaviorValueGetter(&MotionEvent::m_parameter), nullptr) + ->Property("eventType", BehaviorValueGetter(&MotionEvent::m_eventType), nullptr) + ->Property("eventTypeName", BehaviorValueGetter(&MotionEvent::m_eventTypeName), nullptr) + ->Property("time", BehaviorValueGetter(&MotionEvent::m_time), nullptr) + ->Property("globalWeight", BehaviorValueGetter(&MotionEvent::m_globalWeight), nullptr) + ->Property("localWeight", BehaviorValueGetter(&MotionEvent::m_localWeight), nullptr) + ->Property("isEventStart", BehaviorValueGetter(&MotionEvent::m_isEventStart), nullptr) ; behaviorContext->EBus("ActorNotificationBus") From 6d1a2382e872c74cf51e34127ab4e9573305b1dd Mon Sep 17 00:00:00 2001 From: tjmgd <92784061+tjmgd@users.noreply.github.com> Date: Thu, 13 Jan 2022 13:56:38 +0000 Subject: [PATCH 457/948] Bug hide window (#5939) * [lyn3736] adding init files to module paths (#5111) * fixing class names in PYI files Signed-off-by: jackalbe <23512001+jackalbe@users.noreply.github.com> Signed-off-by: T.J. McGrath-Daly * Fixed crash when typing asset name and clicking browse (#5495) Signed-off-by: T.J. McGrath-Daly * Fixed bug involving inappropriate window Signed-off-by: T.J. McGrath-Daly Co-authored-by: Allen Jackson <23512001+jackalbe@users.noreply.github.com> Co-authored-by: AMZN-AlexOteiza <82234181+AMZN-AlexOteiza@users.noreply.github.com> --- Gems/AudioSystem/Code/Source/Editor/QConnectionsWidget.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Gems/AudioSystem/Code/Source/Editor/QConnectionsWidget.cpp b/Gems/AudioSystem/Code/Source/Editor/QConnectionsWidget.cpp index d827f657b8..f8414e25e4 100644 --- a/Gems/AudioSystem/Code/Source/Editor/QConnectionsWidget.cpp +++ b/Gems/AudioSystem/Code/Source/Editor/QConnectionsWidget.cpp @@ -33,6 +33,7 @@ namespace AudioControls { setupUi(this); + m_connectionPropertiesFrame->setHidden(true); m_connectionList->viewport()->installEventFilter(this); m_connectionList->installEventFilter(this); From fed1278fe64e8a435b1c19ba8092b18a98fa9eb1 Mon Sep 17 00:00:00 2001 From: amzn-mike <80125227+amzn-mike@users.noreply.github.com> Date: Thu, 13 Jan 2022 08:56:24 -0600 Subject: [PATCH 458/948] AP: product dependency optimization (#6619) * Initial pass at optimizing product path dependency resolution Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Add version of StripAssetPlatform that doesn't allocate or copy strings. Re-add missing test and fix up compile errors. Add benchmark test Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Change UpdateProductDependencies to directly call s_InsertProductDependencyQuery.BindAndStep Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Add test for same filename on multiple platforms Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Rework search logic to keep track of the source of a search path (source vs product) and keep track of which search matches which dependency to avoid doing another search through every product later on Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Clean up code, expand test Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Fix paths not being lowercased by SanitizeForDatabase. Fix UpdateProductDependencies not updating existing dependencies Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Add test for duplicate dependency matches. Fix saving duplicates Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Clean up code Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Separate test into test and benchmark versions Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Cleanup include Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Fix includes, switch hardcoded job manager setup to use JobManagerComponent instead Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Replaced wildcard_match with PathView::Match. Changed StripAssetPlatformNoCopy to use TokenizeNext. Removed Environment Create/Destroy calls. Made ScopedAllocatorFixture a base class of ScopedAllocatorSetupFixture Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Add AZ Environment create/destroy on AP test environment Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Add missing asserts on database functions Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Fix incorrect usage of StripAssetPlatformNoCopy Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Fix source/product dependency type being ignored. Removed need for unordered_set for list of resolved dependencies. Updated unit tests Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Better variable names Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Remove testing code Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> * Fix missing includes and namespaces Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com> --- .../AzCore/AzCore/UnitTest/TestTypes.h | 38 +- .../assetprocessor_test_files.cmake | 1 + .../native/AssetDatabase/AssetDatabase.cpp | 84 ++-- .../native/AssetManager/AssetCatalog.cpp | 4 +- .../AssetManager/PathDependencyManager.cpp | 187 +++++---- .../AssetManager/PathDependencyManager.h | 23 +- .../AssetManager/assetProcessorManager.cpp | 138 ++++--- .../native/tests/BaseAssetProcessorTest.h | 2 + .../tests/PathDependencyManagerTests.cpp | 362 ++++++++++++++++-- .../AssetProcessorManagerTest.cpp | 79 +++- .../assetmanager/AssetProcessorManagerTest.h | 11 +- .../utilities/PlatformConfiguration.cpp | 14 +- .../native/utilities/assetUtils.cpp | 28 +- .../native/utilities/assetUtils.h | 6 +- 14 files changed, 741 insertions(+), 236 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/UnitTest/TestTypes.h b/Code/Framework/AzCore/AzCore/UnitTest/TestTypes.h index afa6898944..0b1d7caefe 100644 --- a/Code/Framework/AzCore/AzCore/UnitTest/TestTypes.h +++ b/Code/Framework/AzCore/AzCore/UnitTest/TestTypes.h @@ -71,18 +71,35 @@ namespace UnitTest }; /** - * RAII wrapper of AllocatorBase. - * The benefit of using this wrapper instead of AllocatorsTestFixture is that SetUp/TearDown of the allocator is managed - * on construction/destruction, allowing member variables of derived classes to exist as value (and do heap allocation). - */ - class ScopedAllocatorSetupFixture + * RAII wrapper of AllocatorBase. + * The benefit of using this wrapper instead of AllocatorsTestFixture is that SetUp/TearDown of the allocator is managed + * on construction/destruction, allowing member variables of derived classes to exist as value (and do heap allocation). + */ + class ScopedAllocatorFixture : AllocatorsBase + { + public: + ScopedAllocatorFixture() + { + SetupAllocator(); + } + explicit ScopedAllocatorFixture(const AZ::SystemAllocator::Descriptor& allocatorDesc) + { + SetupAllocator(allocatorDesc); + } + ~ScopedAllocatorFixture() override + { + TeardownAllocator(); + } + }; + + // Like ScopedAllocatorFixture, but includes the Test base class + class ScopedAllocatorSetupFixture : public ::testing::Test - , AllocatorsBase + , public ScopedAllocatorFixture { public: - ScopedAllocatorSetupFixture() { SetupAllocator(); } - explicit ScopedAllocatorSetupFixture(const AZ::SystemAllocator::Descriptor& allocatorDesc) { SetupAllocator(allocatorDesc); } - ~ScopedAllocatorSetupFixture() { TeardownAllocator(); } + ScopedAllocatorSetupFixture() = default; + explicit ScopedAllocatorSetupFixture(const AZ::SystemAllocator::Descriptor& allocatorDesc) : ScopedAllocatorFixture(allocatorDesc){} }; /** @@ -114,6 +131,7 @@ namespace UnitTest using AllocatorsFixture = AllocatorsTestFixture; #if defined(HAVE_BENCHMARK) + /** * Helper class to handle the boiler plate of setting up a benchmark fixture that uses the system allocators * If you wish to do additional setup and tear down be sure to call the base class SetUp first and TearDown @@ -218,7 +236,7 @@ namespace UnitTest static constexpr bool sHasPadding = size < alignment; AZStd::enable_if mPadding; }; - + template int CreationCounter::s_count = 0; template diff --git a/Code/Tools/AssetProcessor/assetprocessor_test_files.cmake b/Code/Tools/AssetProcessor/assetprocessor_test_files.cmake index 2c4c53642c..a7a46ad62c 100644 --- a/Code/Tools/AssetProcessor/assetprocessor_test_files.cmake +++ b/Code/Tools/AssetProcessor/assetprocessor_test_files.cmake @@ -48,6 +48,7 @@ set(FILES native/tests/InternalBuilders/SettingsRegistryBuilderTests.cpp native/tests/MissingDependencyScannerTests.cpp native/tests/SourceFileRelocatorTests.cpp + native/tests/PathDependencyManagerTests.cpp native/tests/AssetProcessorMessagesTests.cpp native/unittests/AssetProcessingStateDataUnitTests.cpp native/unittests/AssetProcessingStateDataUnitTests.h diff --git a/Code/Tools/AssetProcessor/native/AssetDatabase/AssetDatabase.cpp b/Code/Tools/AssetProcessor/native/AssetDatabase/AssetDatabase.cpp index cf33e559ac..5edf4e1d53 100644 --- a/Code/Tools/AssetProcessor/native/AssetDatabase/AssetDatabase.cpp +++ b/Code/Tools/AssetProcessor/native/AssetDatabase/AssetDatabase.cpp @@ -172,7 +172,7 @@ namespace AssetProcessor static const char* CREATEINDEX_BUILDERGUID_SOURCE_SOURCEDEPENDENCY_STATEMENT = "CREATE INDEX IF NOT EXISTS BuilderGuid_Source_SourceDependency ON SourceDependency (BuilderGuid, Source);"; static const char* CREATEINDEX_TYPEOFDEPENDENCY_SOURCEDEPENDENCY = "AssetProcessor::CreateIndexTypeOfDependency_SourceDependency"; - static const char* CREATEINDEX_TYPEOFDEPENDENCY_SOURCEDEPENDENCY_STATEMENT = + static const char* CREATEINDEX_TYPEOFDEPENDENCY_SOURCEDEPENDENCY_STATEMENT = "CREATE INDEX IF NOT EXISTS TypeOfDependency_SourceDependency ON SourceDependency (TypeOfDependency);"; static const char* CREATEINDEX_SCANFOLDERS_SOURCES_SCANFOLDER = "AssetProcesser::CreateIndexScanFoldersSourcesScanFolder"; @@ -611,7 +611,7 @@ namespace AssetProcessor SqlParam(":missingDependencyString"), SqlParam(":lastScanTime"), SqlParam(":scanTimeSecondsSinceEpoch")); - + static const auto s_DeleteMissingProductDependencyByProductIdQuery = MakeSqlQuery( DELETE_MISSING_PRODUCT_DEPENDENCY_BY_PRODUCTID, @@ -643,7 +643,7 @@ namespace AssetProcessor SqlParam(":analysisFingerprint")); static const char* INSERT_COLUMN_ANALYSISFINGERPRINT = "AssetProcessor::AddColumnAnalysisFingerprint"; - static const char* INSERT_COLUMN_ANALYSISFINGERPRINT_STATEMENT = + static const char* INSERT_COLUMN_ANALYSISFINGERPRINT_STATEMENT = "ALTER TABLE Sources " "ADD AnalysisFingerprint TEXT NOT NULL collate nocase default('');"; @@ -653,7 +653,7 @@ namespace AssetProcessor "ADD TypeOfDependency INTEGER NOT NULL DEFAULT 0;"; static const char* INSERT_COLUMN_FILE_MODTIME = "AssetProcessor::AddFiles_ModTime"; - static const char* INSERT_COLUMN_FILE_MODTIME_STATEMENT = + static const char* INSERT_COLUMN_FILE_MODTIME_STATEMENT = "ALTER TABLE Files " "ADD ModTime INTEGER NOT NULL DEFAULT 0;"; @@ -673,7 +673,7 @@ namespace AssetProcessor "ADD UnresolvedDependencyType INTEGER NOT NULL DEFAULT 0;"; static const char* INSERT_COLUMN_PRODUCTDEPENDENCY_PLATFORM = "AssetProcessor::AddProductDependency_Platform"; - static const char* INSERT_COLUMN_PRODUCTDEPENDENCY_PLATFORM_STATEMENT = + static const char* INSERT_COLUMN_PRODUCTDEPENDENCY_PLATFORM_STATEMENT = "ALTER TABLE ProductDependencies " "ADD Platform TEXT NOT NULL collate nocase default('');"; @@ -721,7 +721,7 @@ namespace AssetProcessor SqlParam(":isfolder"), SqlParam(":modtime"), SqlParam(":hash")); - + static const char* UPDATE_FILE = "AssetProcessor::UpdateFile"; static const char* UPDATE_FILE_STATEMENT = "UPDATE Files SET " @@ -961,7 +961,7 @@ namespace AssetProcessor AZ_TracePrintf(AssetProcessor::ConsoleChannel, "Upgraded Asset Database to version %i (AddedTypeOfDependencyIndex)\n", foundVersion) } } - + if (foundVersion == AssetDatabase::DatabaseVersion::AddedTypeOfDependencyIndex) { if (m_databaseConnection->ExecuteOneOffStatement(INSERT_COLUMN_PRODUCTDEPENDENCY_PLATFORM)) @@ -1178,7 +1178,7 @@ namespace AssetProcessor AddStatement(m_databaseConnection, s_InsertJobQuery); AddStatement(m_databaseConnection, s_UpdateJobQuery); AddStatement(m_databaseConnection, s_DeleteJobQuery); - + // --------------------------------------------------------------------------------------------- // Builder Info Table // --------------------------------------------------------------------------------------------- @@ -1207,7 +1207,7 @@ namespace AssetProcessor m_databaseConnection->AddStatement(CREATE_SOURCE_DEPENDENCY_TABLE, CREATE_SOURCE_DEPENDENCY_TABLE_STATEMENT); m_databaseConnection->AddStatement(INSERT_COLUMN_SOURCEDEPENDENCY_TYPEOFDEPENDENCY, INSERT_COLUMN_SOURCEDEPENDENCY_TYPEOFDEPENDENCY_STATEMENT); m_databaseConnection->AddStatement(INSERT_COLUMNS_SOURCEDEPENDENCY_FROM_ASSETID, INSERT_COLUMNS_SOURCEDEPENDENCY_FROM_ASSETID_STATEMENT); - + m_createStatements.push_back(CREATE_SOURCE_DEPENDENCY_TABLE); AddStatement(m_databaseConnection, s_InsertSourceDependencyQuery); @@ -1242,7 +1242,7 @@ namespace AssetProcessor AddStatement(m_databaseConnection, s_InsertProductDependencyQuery); AddStatement(m_databaseConnection, s_UpdateProductDependencyQuery); AddStatement(m_databaseConnection, s_DeleteProductDependencyByProductIdQuery); - + // --------------------------------------------------------------------------------------------- // Missing Product Dependency table // --------------------------------------------------------------------------------------------- @@ -1253,7 +1253,7 @@ namespace AssetProcessor AddStatement(m_databaseConnection, s_InsertMissingProductDependencyQuery); AddStatement(m_databaseConnection, s_UpdateMissingProductDependencyQuery); AddStatement(m_databaseConnection, s_DeleteMissingProductDependencyByProductIdQuery); - + // --------------------------------------------------------------------------------------------- // Files table // --------------------------------------------------------------------------------------------- @@ -1344,7 +1344,7 @@ namespace AssetProcessor bool AssetDatabaseConnection::GetScanFolderByScanFolderID(AZ::s64 scanfolderID, ScanFolderDatabaseEntry& entry) { bool found = false; - QueryScanFolderByScanFolderID( scanfolderID, + QueryScanFolderByScanFolderID( scanfolderID, [&](ScanFolderDatabaseEntry& scanFolderEntry) { entry = scanFolderEntry; @@ -1357,7 +1357,7 @@ namespace AssetProcessor bool AssetDatabaseConnection::GetScanFolderBySourceID(AZ::s64 sourceID, ScanFolderDatabaseEntry& entry) { bool found = false; - QueryScanFolderBySourceID( sourceID, + QueryScanFolderBySourceID( sourceID, [&](ScanFolderDatabaseEntry& scanFolderEntry) { entry = scanFolderEntry; @@ -1370,7 +1370,7 @@ namespace AssetProcessor bool AssetDatabaseConnection::GetScanFolderByJobID(AZ::s64 jobID, ScanFolderDatabaseEntry& entry) { bool found = false; - QueryScanFolderByJobID( jobID, + QueryScanFolderByJobID( jobID, [&](ScanFolderDatabaseEntry& scanFolderEntry) { entry = scanFolderEntry; @@ -1383,7 +1383,7 @@ namespace AssetProcessor bool AssetDatabaseConnection::GetScanFolderByProductID(AZ::s64 productID, ScanFolderDatabaseEntry& entry) { bool found = false; - QueryScanFolderByProductID( productID, + QueryScanFolderByProductID( productID, [&](ScanFolderDatabaseEntry& scanFolderEntry) { entry = scanFolderEntry; @@ -2105,7 +2105,7 @@ namespace AssetProcessor bool AssetDatabaseConnection::GetProductsLikeProductName(QString likeProductName, LikeType likeType, ProductDatabaseEntryContainer& container, AZ::Uuid builderGuid, QString jobKey, QString platform, JobStatus status) { bool found = false; - + if (likeProductName.isEmpty()) { return false; @@ -2198,7 +2198,7 @@ namespace AssetProcessor bool AssetDatabaseConnection::GetProductByJobIDSubId(AZ::s64 jobID, AZ::u32 subID, AzToolsFramework::AssetDatabase::ProductDatabaseEntry& result) { bool found = false; - QueryProductByJobIDSubID(jobID, subID, + QueryProductByJobIDSubID(jobID, subID, [&](ProductDatabaseEntry& resultFromDB) { found = true; @@ -2312,13 +2312,19 @@ namespace AssetProcessor { return false; } - - bool succeeded = true; + + ScopedTransaction transaction(m_databaseConnection); + for (auto& entry : container) { - succeeded &= SetProduct(entry); + if(!SetProduct(entry)) + { + return false; + } } - return succeeded; + + transaction.Commit(); + return true; } //! Clear the products for a given source. This removes the entry entirely, not just sets it to empty. @@ -2407,7 +2413,7 @@ namespace AssetProcessor if(!platform.isEmpty()) { AZStd::string platformStr = platform.toUtf8().constData(); - + if (!s_DeleteProductsBySourceidPlatformQuery.BindAndStep(*m_databaseConnection, sourceID, platformStr.c_str())) { return false; @@ -2521,7 +2527,7 @@ namespace AssetProcessor { succeeded = succeeded && RemoveSourceFileDependency(entry); } - + if (succeeded) { transaction.Commit(); @@ -2577,7 +2583,7 @@ namespace AssetProcessor } bool AssetDatabaseConnection::GetDependsOnSourceBySource( - const char* source, + const char* source, AzToolsFramework::AssetDatabase::SourceFileDependencyEntry::TypeOfDependency typeOfDependency, AzToolsFramework::AssetDatabase::SourceFileDependencyEntryContainer& container) { @@ -2596,7 +2602,7 @@ namespace AssetProcessor bool AssetDatabaseConnection::GetSourceFileDependencyBySourceDependencyId(AZ::s64 sourceDependencyId, SourceFileDependencyEntry& sourceDependencyEntry) { bool found = false; - QuerySourceDependencyBySourceDependencyId(sourceDependencyId, + QuerySourceDependencyBySourceDependencyId(sourceDependencyId, [&](SourceFileDependencyEntry& entry) { found = true; @@ -2624,7 +2630,7 @@ namespace AssetProcessor return false; } - + if (creatingNew) { AZ::s64 rowID = m_databaseConnection->GetLastRowID(); @@ -2958,9 +2964,25 @@ namespace AssetProcessor for(auto& entry : container) { - if(!SetProductDependency(entry)) + if(entry.m_productDependencyID == InvalidEntryId) { - return false; + if (!s_InsertProductDependencyQuery.BindAndStep( + *m_databaseConnection, entry.m_productPK, entry.m_dependencySourceGuid, entry.m_dependencySubID, + entry.m_dependencyFlags.to_ullong(), entry.m_platform.c_str(), entry.m_unresolvedPath.c_str(), + entry.m_dependencyType, entry.m_fromAssetId)) + { + return false; + } + } + else + { + if(!s_UpdateProductDependencyQuery.BindAndStep( + *m_databaseConnection, entry.m_productPK, entry.m_dependencySourceGuid, entry.m_dependencySubID, + entry.m_dependencyFlags.to_ullong(), entry.m_platform.c_str(), entry.m_unresolvedPath.c_str(), + entry.m_productDependencyID, entry.m_dependencyType, entry.m_fromAssetId)) + { + return false; + } } } @@ -2989,7 +3011,7 @@ namespace AssetProcessor } // now insert the new ones since we know there's no collisions: - + for (auto& entry : container) { @@ -3109,7 +3131,7 @@ namespace AssetProcessor } Statement* statement = autoFinal.Get(); - + if (statement->Step() == Statement::SqlError) { AZ_Warning(LOG_NAME, false, "Failed to write the new source into the database. %s", entry.m_fileName.c_str()); @@ -3126,7 +3148,7 @@ namespace AssetProcessor return UpdateFile(entry, entryAlreadyExists); } - bool AssetDatabaseConnection::UpdateFile(FileDatabaseEntry& entry, bool& entryAlreadyExists) + bool AssetDatabaseConnection::UpdateFile(FileDatabaseEntry& entry, bool& entryAlreadyExists) { entryAlreadyExists = false; diff --git a/Code/Tools/AssetProcessor/native/AssetManager/AssetCatalog.cpp b/Code/Tools/AssetProcessor/native/AssetManager/AssetCatalog.cpp index d7cdd30be8..bda5eb7842 100644 --- a/Code/Tools/AssetProcessor/native/AssetManager/AssetCatalog.cpp +++ b/Code/Tools/AssetProcessor/native/AssetManager/AssetCatalog.cpp @@ -480,12 +480,12 @@ namespace AssetProcessor AZ::Data::AssetId assetId(combined.m_sourceGuid, combined.m_subID); // relative file path is gotten by removing the platform and game from the product name - QString relativeProductPath = AssetUtilities::StripAssetPlatform(combined.m_productName); + AZStd::string_view relativeProductPath = AssetUtilities::StripAssetPlatformNoCopy(combined.m_productName); QString fullProductPath = m_cacheRoot.absoluteFilePath(combined.m_productName.c_str()); AZ::Data::AssetInfo info; info.m_assetType = combined.m_assetType; - info.m_relativePath = relativeProductPath.toUtf8().data(); + info.m_relativePath = relativeProductPath; info.m_assetId = assetId; info.m_sizeBytes = AZ::IO::SystemFile::Length(fullProductPath.toUtf8().constData()); diff --git a/Code/Tools/AssetProcessor/native/AssetManager/PathDependencyManager.cpp b/Code/Tools/AssetProcessor/native/AssetManager/PathDependencyManager.cpp index dc10dc2237..6dddfd62d3 100644 --- a/Code/Tools/AssetProcessor/native/AssetManager/PathDependencyManager.cpp +++ b/Code/Tools/AssetProcessor/native/AssetManager/PathDependencyManager.cpp @@ -9,18 +9,24 @@ #include "PathDependencyManager.h" #include #include +#include #include #include #include +#include namespace AssetProcessor { void SanitizeForDatabase(AZStd::string& str) { - // Not calling normalize because wildcards should be preserved. AZStd::to_lower(str.begin(), str.end()); - AZStd::replace(str.begin(), str.end(), AZ_WRONG_DATABASE_SEPARATOR, AZ_CORRECT_DATABASE_SEPARATOR); - AzFramework::StringFunc::Replace(str, AZ_DOUBLE_CORRECT_DATABASE_SEPARATOR, AZ_CORRECT_DATABASE_SEPARATOR_STRING); + + // Not calling normalize because wildcards should be preserved. + if (AZ::StringFunc::Contains(str, AZ_WRONG_DATABASE_SEPARATOR, true)) + { + AZStd::replace(str.begin(), str.end(), AZ_WRONG_DATABASE_SEPARATOR, AZ_CORRECT_DATABASE_SEPARATOR); + AzFramework::StringFunc::Replace(str, AZ_DOUBLE_CORRECT_DATABASE_SEPARATOR, AZ_CORRECT_DATABASE_SEPARATOR_STRING); + } } PathDependencyManager::PathDependencyManager(AZStd::shared_ptr stateData, PlatformConfiguration* platformConfig) @@ -29,7 +35,97 @@ namespace AssetProcessor } - void PathDependencyManager::SaveUnresolvedDependenciesToDatabase(AssetBuilderSDK::ProductPathDependencySet& unresolvedDependencies, const AzToolsFramework::AssetDatabase::ProductDatabaseEntry& productEntry, const AZStd::string& platform) + void PathDependencyManager::QueueSourceForDependencyResolution(const AzToolsFramework::AssetDatabase::SourceDatabaseEntry& sourceEntry) + { + m_queuedForResolve.push_back(sourceEntry); + } + + void PathDependencyManager::ProcessQueuedDependencyResolves() + { + if (m_queuedForResolve.empty()) + { + return; + } + + auto queuedForResolve = m_queuedForResolve; + m_queuedForResolve.clear(); + + // Grab every product from the database and map to Source PK -> [products] + AZStd::unordered_map> productMap; + m_stateData->QueryCombined([&productMap](const AzToolsFramework::AssetDatabase::CombinedDatabaseEntry& entry) + { + productMap[entry.m_sourcePK].push_back(entry); + return true; + }); + + // Build up a list of all the paths we need to search for: products + 2 variations of the source path + AZStd::vector searches; + + for (const auto& entry : queuedForResolve) + { + // Search for each product + for (const auto& productEntry : productMap[entry.m_sourceID]) + { + const AZStd::string& productName = productEntry.m_productName; + + // strip path of the / + AZStd::string_view result = AssetUtilities::StripAssetPlatformNoCopy(productName); + searches.emplace_back(result, false, &entry, &productEntry); + } + + // Search for the source path + AZStd::string sourceNameWithScanFolder = + ToScanFolderPrefixedPath(aznumeric_cast(entry.m_scanFolderPK), entry.m_sourceName.c_str()); + AZStd::string sanitizedSourceName = entry.m_sourceName; + + SanitizeForDatabase(sourceNameWithScanFolder); + SanitizeForDatabase(sanitizedSourceName); + + searches.emplace_back(sourceNameWithScanFolder, true, &entry, nullptr); + searches.emplace_back(sanitizedSourceName, true, &entry, nullptr); + } + + AzToolsFramework::AssetDatabase::ProductDependencyDatabaseEntryContainer unresolvedDependencies; + m_stateData->GetUnresolvedProductDependencies(unresolvedDependencies); + + AZStd::recursive_mutex mapMutex; + // Map of Map of Product Dependency>> + AZStd::unordered_map>> sourceIdToMatchedSearchDependencies; + + // For every search path we created, we're going to see if it matches up against any of the unresolved dependencies + AZ::parallel_for_each( + searches.begin(), searches.end(), + [&sourceIdToMatchedSearchDependencies, &mapMutex, &unresolvedDependencies](const SearchEntry& search) + { + AZStd::unordered_set matches; + for (const auto& entry: unresolvedDependencies) + { + AZ::IO::PathView searchPath(search.m_path); + + if(((entry.m_dependencyType == AzToolsFramework::AssetDatabase::ProductDependencyDatabaseEntry::ProductDep_SourceFile && search.m_isSourcePath) + || (entry.m_dependencyType == AzToolsFramework::AssetDatabase::ProductDependencyDatabaseEntry::ProductDep_ProductFile && !search.m_isSourcePath)) + && searchPath.Match(entry.m_unresolvedPath)) + { + matches.insert(entry); + } + } + + if (!matches.empty()) + { + AZStd::scoped_lock lock(mapMutex); + auto& productDependencyDatabaseEntries = sourceIdToMatchedSearchDependencies[search.m_sourceEntry->m_sourceID][&search]; + productDependencyDatabaseEntries.insert(matches.begin(), matches.end()); + } + }); + + for (const auto& entry : queuedForResolve) + { + RetryDeferredDependencies(entry, sourceIdToMatchedSearchDependencies[entry.m_sourceID], productMap[entry.m_sourceID]); + } + } + + void PathDependencyManager::SaveUnresolvedDependenciesToDatabase(AssetBuilderSDK::ProductPathDependencySet& unresolvedDependencies, + const AzToolsFramework::AssetDatabase::ProductDatabaseEntry& productEntry, const AZStd::string& platform) { using namespace AzToolsFramework::AssetDatabase; @@ -206,9 +302,9 @@ namespace AssetProcessor } void PathDependencyManager::SaveResolvedDependencies(const AzToolsFramework::AssetDatabase::SourceDatabaseEntry& sourceEntry, const MapSet& exclusionMaps, const AZStd::string& sourceNameWithScanFolder, - const AZStd::vector& dependencyEntries, + const AZStd::unordered_set& dependencyEntries, AZStd::string_view matchedPath, bool isSourceDependency, const AzToolsFramework::AssetDatabase::ProductDatabaseEntryContainer& matchedProducts, - AzToolsFramework::AssetDatabase::ProductDependencyDatabaseEntryContainer& dependencyContainer) const + AZStd::vector& dependencyContainer) const { for (const auto& productDependencyDatabaseEntry : dependencyEntries) { @@ -267,8 +363,7 @@ namespace AssetProcessor } // All checks passed, this is a valid dependency we need to save to the db - dependencyContainer.push_back(); - auto& entry = dependencyContainer.back(); + AzToolsFramework::AssetDatabase::ProductDependencyDatabaseEntry entry; entry.m_productDependencyID = dependencyId; entry.m_productPK = productDependencyDatabaseEntry.m_productPK; @@ -276,62 +371,30 @@ namespace AssetProcessor entry.m_dependencySubID = matchedProduct.m_subID; entry.m_platform = productDependencyDatabaseEntry.m_platform; + dependencyContainer.push_back(AZStd::move(entry)); + // If there's more than 1 product, reset the ID so further products create new db entries dependencyId = AzToolsFramework::AssetDatabase::InvalidEntryId; } } } - void PathDependencyManager::RetryDeferredDependencies(const AzToolsFramework::AssetDatabase::SourceDatabaseEntry& sourceEntry) + void PathDependencyManager::RetryDeferredDependencies(const AzToolsFramework::AssetDatabase::SourceDatabaseEntry& sourceEntry, + const AZStd::unordered_map>& matches, + const AZStd::vector& products) { MapSet exclusionMaps = PopulateExclusionMaps(); - // Gather a list of all the products this source file produced - AzToolsFramework::AssetDatabase::ProductDatabaseEntryContainer products; - if (!m_stateData->GetProductsBySourceName(sourceEntry.m_sourceName.c_str(), products)) - { - AZ_TracePrintf(AssetProcessor::ConsoleChannel, "Source %s did not have any products. Skipping dependency processing.\n", sourceEntry.m_sourceName.c_str()); - return; - } - - AZStd::unordered_map> map; - - // Build up a list of all the paths we need to search for: products + 2 variations of the source path - AZStd::vector searchPaths; - - for (const auto& productEntry : products) - { - const AZStd::string& productName = productEntry.m_productName; - - // strip path of the / - AZStd::string strippedPath = AssetUtilities::StripAssetPlatform(productName).toUtf8().constData(); - SanitizeForDatabase(strippedPath); - - searchPaths.push_back(strippedPath); - } - AZStd::string sourceNameWithScanFolder = ToScanFolderPrefixedPath(aznumeric_cast(sourceEntry.m_scanFolderPK), sourceEntry.m_sourceName.c_str()); - AZStd::string sanitizedSourceName = sourceEntry.m_sourceName; - SanitizeForDatabase(sourceNameWithScanFolder); - SanitizeForDatabase(sanitizedSourceName); - - searchPaths.push_back(sourceNameWithScanFolder); - searchPaths.push_back(sanitizedSourceName); - - m_stateData->QueryProductDependenciesUnresolvedAdvanced(searchPaths, [&map](AzToolsFramework::AssetDatabase::ProductDependencyDatabaseEntry& entry, const AZStd::string& matchedPath) - { - map[matchedPath].push_back(AZStd::move(entry)); - return true; - }); - AzToolsFramework::AssetDatabase::ProductDependencyDatabaseEntryContainer dependencyContainer; + AzToolsFramework::AssetDatabase::ProductDependencyDatabaseEntryContainer dependencyVector; // Go through all the matched dependencies - for (const auto& pair : map) + for (const auto& pair : matches) { - AZStd::string_view matchedPath = pair.first; - const bool isSourceDependency = matchedPath == sanitizedSourceName || matchedPath == sourceNameWithScanFolder; + const SearchEntry* searchEntry = pair.first; + const bool isSourceDependency = searchEntry->m_isSourcePath; AzToolsFramework::AssetDatabase::ProductDatabaseEntryContainer matchedProducts; @@ -342,34 +405,24 @@ namespace AssetProcessor } else { - for (const auto& productEntry : products) - { - const AZStd::string& productName = productEntry.m_productName; - - // strip path of the leading asset platform / - AZStd::string strippedPath = AssetUtilities::StripAssetPlatform(productName).toUtf8().constData(); - SanitizeForDatabase(strippedPath); - - if (strippedPath == matchedPath) - { - matchedProducts.push_back(productEntry); - } - } + matchedProducts.push_back(*searchEntry->m_productEntry); } // Go through each dependency we're resolving and create a db entry for each product that resolved it (wildcard/source dependencies will generally create more than 1) - SaveResolvedDependencies(sourceEntry, exclusionMaps, sourceNameWithScanFolder, pair.second, matchedPath, isSourceDependency, matchedProducts, dependencyContainer); + SaveResolvedDependencies( + sourceEntry, exclusionMaps, sourceNameWithScanFolder, pair.second, searchEntry->m_path, isSourceDependency, matchedProducts, + dependencyVector); } - // Save everything to the db - if (!m_stateData->UpdateProductDependencies(dependencyContainer)) + // Save everything to the db, this will update matched non-wildcard dependencies and add new records for wildcard matches + if (!m_stateData->UpdateProductDependencies(dependencyVector)) { AZ_Error("PathDependencyManager", false, "Failed to update product dependencies"); } else { // Send a notification for each dependency that has been resolved - NotifyResolvedDependencies(dependencyContainer); + NotifyResolvedDependencies(dependencyVector); } } @@ -460,7 +513,7 @@ namespace AssetProcessor if (isExactDependency) { // Search for products in the cache platform folder - // Example: If a path dependency is "test1.asset" in AutomatedTesting on PC, this would search + // Example: If a path dependency is "test1.asset" in AutomatedTesting on PC, this would search // "AutomatedTesting/Cache/pc/test1.asset" m_stateData->GetProductsByProductName(productNameWithPlatform, productInfoContainer); diff --git a/Code/Tools/AssetProcessor/native/AssetManager/PathDependencyManager.h b/Code/Tools/AssetProcessor/native/AssetManager/PathDependencyManager.h index 3a207ec6a9..763ee2cd74 100644 --- a/Code/Tools/AssetProcessor/native/AssetManager/PathDependencyManager.h +++ b/Code/Tools/AssetProcessor/native/AssetManager/PathDependencyManager.h @@ -39,9 +39,27 @@ namespace AssetProcessor PathDependencyManager(AZStd::shared_ptr stateData, PlatformConfiguration* platformConfig); + void QueueSourceForDependencyResolution(const AzToolsFramework::AssetDatabase::SourceDatabaseEntry& sourceEntry); + + void ProcessQueuedDependencyResolves(); + + struct SearchEntry + { + SearchEntry(AZStd::string path, bool isSourcePath, const AzToolsFramework::AssetDatabase::SourceDatabaseEntry* sourceEntry, const AzToolsFramework::AssetDatabase::ProductDatabaseEntry* productEntry) + : m_path(std::move(path)), + m_isSourcePath(isSourcePath), + m_sourceEntry(sourceEntry), + m_productEntry(productEntry) {} + + AZStd::string m_path; + bool m_isSourcePath; + const AzToolsFramework::AssetDatabase::SourceDatabaseEntry* m_sourceEntry = nullptr; + const AzToolsFramework::AssetDatabase::ProductDatabaseEntry* m_productEntry = nullptr; + }; + /// This function is responsible for looking up existing, unresolved dependencies that the current asset satisfies. /// These can be dependencies on either the source asset or one of the product assets - void RetryDeferredDependencies(const AzToolsFramework::AssetDatabase::SourceDatabaseEntry& sourceEntry); + void RetryDeferredDependencies(const AzToolsFramework::AssetDatabase::SourceDatabaseEntry& sourceEntry, const AZStd::unordered_map>& matches, const AZStd::vector& products); /// This function is responsible for taking the path dependencies output by the current asset and trying to resolve them to AssetIds /// This does not look for dependencies that the current asset satisfies. @@ -66,7 +84,7 @@ namespace AssetProcessor MapSet PopulateExclusionMaps() const; void NotifyResolvedDependencies(const AzToolsFramework::AssetDatabase::ProductDependencyDatabaseEntryContainer& dependencyContainer) const; - void SaveResolvedDependencies(const AzToolsFramework::AssetDatabase::SourceDatabaseEntry& sourceEntry, const MapSet& exclusionMaps, const AZStd::string& sourceNameWithScanFolder, const AZStd::vector& dependencyEntries, AZStd::string_view matchedPath, bool isSourceDependency, const AzToolsFramework::AssetDatabase::ProductDatabaseEntryContainer& matchedProducts, AzToolsFramework::AssetDatabase::ProductDependencyDatabaseEntryContainer& dependencyContainer) const; + void SaveResolvedDependencies(const AzToolsFramework::AssetDatabase::SourceDatabaseEntry& sourceEntry, const MapSet& exclusionMaps, const AZStd::string& sourceNameWithScanFolder, const AZStd::unordered_set& dependencyEntries, AZStd::string_view matchedPath, bool isSourceDependency, const AzToolsFramework::AssetDatabase::ProductDatabaseEntryContainer& matchedProducts, AZStd::vector& dependencyContainer) const; static DependencyProductMap& SelectMap(MapSet& mapSet, bool wildcard, AzToolsFramework::AssetDatabase::ProductDependencyDatabaseEntry::DependencyType type); /// Returns false if a path contains wildcards, true otherwise @@ -93,5 +111,6 @@ namespace AssetProcessor AZStd::shared_ptr m_stateData; PlatformConfiguration* m_platformConfig{}; DependencyResolvedCallback m_dependencyResolvedCallback{}; + AZStd::vector m_queuedForResolve; }; } // namespace AssetProcessor diff --git a/Code/Tools/AssetProcessor/native/AssetManager/assetProcessorManager.cpp b/Code/Tools/AssetProcessor/native/AssetManager/assetProcessorManager.cpp index 8867f2379f..beb82dfcab 100644 --- a/Code/Tools/AssetProcessor/native/AssetManager/assetProcessorManager.cpp +++ b/Code/Tools/AssetProcessor/native/AssetManager/assetProcessorManager.cpp @@ -48,7 +48,7 @@ namespace AssetProcessor // note that this is not the first time we're opening the database - the main thread also opens it before this happens, // which allows it to upgrade it and check it for errors. If we get here, it means the database is already good to go. - m_stateData->OpenDatabase(); + m_stateData->OpenDatabase(); MigrateScanFolders(); @@ -70,7 +70,7 @@ namespace AssetProcessor m_excludedFolderCache = AZStd::make_unique(m_platformConfig); PopulateJobStateCache(); - + AssetProcessor::ProcessingJobInfoBus::Handler::BusConnect(); } @@ -126,7 +126,7 @@ namespace AssetProcessor { // capture scanning stats: AssetProcessor::StatsCapture::BeginCaptureStat("AssetScanning"); - + // Ensure that the source file list is populated before a scan begins m_sourceFilesInDatabase.clear(); m_fileModTimes.clear(); @@ -155,11 +155,11 @@ namespace AssetProcessor QString scanFolderPath; QString relativeToScanFolderPath = QString::fromUtf8(entry.m_fileName.c_str()); - + for (int i = 0; i < m_platformConfig->GetScanFolderCount(); ++i) { const auto& scanFolderInfo = m_platformConfig->GetScanFolderAt(i); - + if (scanFolderInfo.ScanFolderID() == entry.m_scanFolderPK) { scanFolderPath = scanFolderInfo.ScanPath(); @@ -181,7 +181,7 @@ namespace AssetProcessor { m_isCurrentlyScanning = false; AssetProcessor::StatsCapture::EndCaptureStat("AssetScanning"); - + // we cannot invoke this immediately - the scanner might be done, but we aren't actually ready until we've processed all remaining messages: QMetaObject::invokeMethod(this, "CheckMissingFiles", Qt::QueuedConnection); } @@ -216,7 +216,7 @@ namespace AssetProcessor else { QString statKey = QString("ProcessJob,%1,%2,%3").arg(jobEntry.m_databaseSourceName).arg(jobEntry.m_jobKey).arg(jobEntry.m_platformInfo.m_identifier.c_str()); - + if (status == JobStatus::InProgress) { //update to in progress status @@ -232,7 +232,7 @@ namespace AssetProcessor // without going thru the RC. // as such, all the code in this block should be crafted to work regardless of whether its double called. AssetProcessor::StatsCapture::EndCaptureStat(statKey.toUtf8().constData()); - + m_jobRunKeyToJobInfoMap.erase(jobEntry.m_jobRunKey); Q_EMIT SourceFinished(sourceUUID, legacySourceUUID); Q_EMIT JobComplete(jobEntry, status); @@ -308,7 +308,7 @@ namespace AssetProcessor //! A network request came in, Given a Job Run Key (from the above Job Request), asking for the actual log for that job. GetAbsoluteAssetDatabaseLocationResponse AssetProcessorManager::ProcessGetAbsoluteAssetDatabaseLocationRequest(MessageData messageData) - { + { GetAbsoluteAssetDatabaseLocationResponse response; AzToolsFramework::AssetDatabase::AssetDatabaseRequestsBus::Broadcast(&AzToolsFramework::AssetDatabase::AssetDatabaseRequests::GetAssetDatabaseLocation, response.m_absoluteAssetDatabaseLocation); @@ -525,7 +525,7 @@ namespace AssetProcessor { foundOne = true; return true; - }, + }, AZ::Uuid::CreateNull(), nullptr, platform.toUtf8().constData(), @@ -750,7 +750,7 @@ namespace AssetProcessor } OnJobStatusChanged(jobEntry, JobStatus::Failed); - + // note that we always print out the failed job status here in both batch and GUI mode. AZ_TracePrintf(AssetProcessor::ConsoleChannel, "Failed %s, (%s)... \n", jobEntry.m_pathRelativeToWatchFolder.toUtf8().constData(), @@ -868,7 +868,7 @@ namespace AssetProcessor && AzFramework::StringFunc::Equal(job.m_platform.c_str(), itProcessedAsset->m_entry.m_platformInfo.m_identifier.c_str())) { // If we are here it implies that for the same source file we have another job that outputs the same product. - // This is usually the case when two builders process the same source file and outputs the same product file. + // This is usually the case when two builders process the same source file and outputs the same product file. remove = true; AZStd::string consoleMsg = AZStd::string::format("Failing Job (source : %s , jobkey %s) because another job (source : %s , jobkey : %s ) outputted the same product %s.\n", itProcessedAsset->m_entry.m_pathRelativeToWatchFolder.toUtf8().constData(), itProcessedAsset->m_entry.m_jobKey.toUtf8().data(), source.m_sourceName.c_str(), job.m_jobKey.c_str(), newProductName.toUtf8().constData()); @@ -1128,7 +1128,7 @@ namespace AssetProcessor QString fullProductPath = m_cacheRootDir.absoluteFilePath(productName); // Strip the from the front of a relative product path - QString relativeProductPath = AssetUtilities::StripAssetPlatform(priorProduct.m_productName); + AZStd::string_view relativeProductPath = AssetUtilities::StripAssetPlatformNoCopy(priorProduct.m_productName); AZ::Data::AssetId assetId(source.m_sourceGuid, priorProduct.m_subID); @@ -1137,7 +1137,7 @@ namespace AssetProcessor AZ::Data::AssetId legacyAssetId(priorProduct.m_legacyGuid, 0); AZ::Data::AssetId legacySourceAssetId(AssetUtilities::CreateSafeSourceUUIDFromName(source.m_sourceName.c_str(), false), priorProduct.m_subID); - AssetNotificationMessage message(relativeProductPath.toUtf8().constData(), AssetNotificationMessage::AssetRemoved, priorProduct.m_assetType, processedAsset.m_entry.m_platformInfo.m_identifier.c_str()); + AssetNotificationMessage message(relativeProductPath, AssetNotificationMessage::AssetRemoved, priorProduct.m_assetType, processedAsset.m_entry.m_platformInfo.m_identifier.c_str()); message.m_assetId = assetId; if (legacyAssetId != assetId) @@ -1271,7 +1271,7 @@ namespace AssetProcessor [&](AzToolsFramework::AssetDatabase::ProductDependencyDatabaseEntry& dependencyEntry) { return dependencyEntry.m_dependencySubID == pair.first.m_subID - && dependencyEntry.m_dependencySourceGuid == source.m_sourceGuid; + && dependencyEntry.m_dependencySourceGuid == source.m_sourceGuid; }); if (conflictItr != dependencySet.end()) @@ -1312,14 +1312,14 @@ namespace AssetProcessor // relative file path is gotten by removing the platform and game from the product name // Strip the from the front of a relative product path - QString relativeProductPath = AssetUtilities::StripAssetPlatform(productName.toUtf8().constData()); + AZStd::string relativeProductPath = AssetUtilities::StripAssetPlatform(productName.toUtf8().constData()).toUtf8().constData(); - AssetNotificationMessage message(relativeProductPath.toUtf8().constData(), AssetNotificationMessage::AssetChanged, newProduct.m_assetType, processedAsset.m_entry.m_platformInfo.m_identifier.c_str()); + AssetNotificationMessage message(relativeProductPath, AssetNotificationMessage::AssetChanged, newProduct.m_assetType, processedAsset.m_entry.m_platformInfo.m_identifier.c_str()); AZ::Data::AssetId assetId(source.m_sourceGuid, newProduct.m_subID); AZ::Data::AssetId legacyAssetId(newProduct.m_legacyGuid, 0); AZ::Data::AssetId legacySourceAssetId(AssetUtilities::CreateSafeSourceUUIDFromName(source.m_sourceName.c_str(), false), newProduct.m_subID); - message.m_data = relativeProductPath.toUtf8().data(); + message.m_data = relativeProductPath; message.m_sizeBytes = QFileInfo(fullProductPath).size(); message.m_assetId = assetId; @@ -1350,7 +1350,7 @@ namespace AssetProcessor } Q_EMIT AssetMessage( message); - + AddKnownFoldersRecursivelyForFile(fullProductPath, m_cacheRootDir.absolutePath()); } @@ -1497,7 +1497,7 @@ namespace AssetProcessor // Record the modtime for the metadata file so we don't re-analyze this change again next time AP starts up QFileInfo metadataFileInfo(originalName); auto* scanFolder = m_platformConfig->GetScanFolderForFile(originalName); - + if (scanFolder) { QString databaseName; @@ -1534,7 +1534,7 @@ namespace AssetProcessor for (const QString& absolutePath : absoluteSourcePathList) { // we need to check if its already in the "active files" (things that we are looking over) - // or if its in the "currently being examined" list. The latter is likely to be the smaller list, + // or if its in the "currently being examined" list. The latter is likely to be the smaller list, // so we check it first. Both of those are absolute paths, so we convert to absolute path before // searching those lists: if (m_filesToExamine.find(absolutePath) != m_filesToExamine.end()) @@ -1633,9 +1633,6 @@ namespace AssetProcessor } } - // Strip the from the front of a relative product path - QString relativePath = AssetUtilities::StripAssetPlatform(relativeProductFile.toUtf8().constData()); - //set the fingerprint on the job that made this product for (auto& job : jobs) { @@ -1678,7 +1675,7 @@ namespace AssetProcessor } QString fullProductPath = m_cacheRootDir.absoluteFilePath(product.m_productName.c_str()); - QString relativeProductPath(AssetUtilities::StripAssetPlatform(product.m_productName)); + AZStd::string_view relativeProductPath = AssetUtilities::StripAssetPlatformNoCopy(product.m_productName); QFileInfo productFileInfo(fullProductPath); if (productFileInfo.exists()) { @@ -1725,7 +1722,7 @@ namespace AssetProcessor AZ::Data::AssetId legacyAssetId(product.m_legacyGuid, 0); AZ::Data::AssetId legacySourceAssetId(AssetUtilities::CreateSafeSourceUUIDFromName(source.m_sourceName.c_str(), false), product.m_subID); - AssetNotificationMessage message(relativeProductPath.toUtf8().constData(), AssetNotificationMessage::AssetRemoved, product.m_assetType, job.m_platform.c_str()); + AssetNotificationMessage message(relativeProductPath, AssetNotificationMessage::AssetRemoved, product.m_assetType, job.m_platform.c_str()); message.m_assetId = assetId; if (legacyAssetId != assetId) @@ -1759,7 +1756,7 @@ namespace AssetProcessor // and no overrides exist for it. // we must delete its products. using namespace AzToolsFramework::AssetDatabase; - + // If we fail to delete a product, the deletion event gets requeued // To avoid retrying forever, we keep track of the time of the first deletion failure and only retry // if less than this amount of time has passed. @@ -1832,7 +1829,7 @@ namespace AssetProcessor { return; } - + // Check if this file causes any file types to be re-evaluated CheckMetaDataRealFiles(normalizedPath); @@ -2046,7 +2043,7 @@ namespace AssetProcessor AZ_TracePrintf(AssetProcessor::DebugChannel, "Non-processed file: %s\n", databaseSourceFile.toUtf8().constData()); ++m_numSourcesNotHandledByAnyBuilder; - + // Record the modtime for the file so we know we've already processed it QString absolutePath = QDir(scanFolder->ScanPath()).absoluteFilePath(normalizedPath); @@ -2114,7 +2111,7 @@ namespace AssetProcessor // Check whether another job emitted this job as a job dependency and if true, queue the dependent job source file also JobDesc jobDesc(jobDetails.m_jobEntry.m_databaseSourceName.toUtf8().data(), jobDetails.m_jobEntry.m_jobKey.toUtf8().data(), jobDetails.m_jobEntry.m_platformInfo.m_identifier); - + shouldProcessAsset = true; QFileInfo file(jobDetails.m_jobEntry.GetAbsoluteSourcePath()); QDateTime dateTime(file.lastModified()); @@ -2347,7 +2344,7 @@ namespace AssetProcessor } QString canonicalRootDir = AssetUtilities::NormalizeFilePath(m_cacheRootDir.canonicalPath()); - + FileExamineContainer swapped; m_filesToExamine.swap(swapped); // makes it okay to call CheckSource(...) @@ -2470,7 +2467,7 @@ namespace AssetProcessor AZ_TracePrintf(AssetProcessor::DebugChannel, "ProcessFilesToExamineQueue: Unable to find the relative path.\n"); continue; } - + const ScanFolderInfo* scanFolderInfo = m_platformConfig->GetScanFolderForFile(normalizedPath); relativePathToFile = databasePathToFile; @@ -2494,9 +2491,9 @@ namespace AssetProcessor QString::fromUtf8(jobInfo.m_watchFolder.c_str()), relativePathToFile, databasePathToFile, - jobInfo.m_builderGuid, - *platformFromInfo, - jobInfo.m_jobKey.c_str(), 0, GenerateNewJobRunKey(), + jobInfo.m_builderGuid, + *platformFromInfo, + jobInfo.m_jobKey.c_str(), 0, GenerateNewJobRunKey(), AZ::Uuid::CreateNull()); job.m_autoFail = true; @@ -2597,7 +2594,7 @@ namespace AssetProcessor { // on the other hand, if we found a file it means that a deleted file revealed a file that // was previously overridden by it. - // Because the deleted file may have "revealed" a file with different case, + // Because the deleted file may have "revealed" a file with different case, // we have to actually correct its case here. This is rare, so it should be reasonable // to call the expensive function to discover correct case. QString pathRelativeToScanFolder; @@ -2674,6 +2671,7 @@ namespace AssetProcessor AZ_TracePrintf(ConsoleChannel, "Builder optimization: %i / %i files required full analysis, %i sources found but not processed by anyone\n", m_numSourcesNeedingFullAnalysis, m_numTotalSourcesFound, m_numSourcesNotHandledByAnyBuilder); } + m_pathDependencyManager->ProcessQueuedDependencyResolves(); QTimer::singleShot(20, this, SLOT(RemoveEmptyFolders())); } else @@ -2739,7 +2737,7 @@ namespace AssetProcessor } // over here we also want to invalidate the metafiles on disk map if it COULD Be a metafile - // note that there is no reason to do an expensive exacting computation here, it will be + // note that there is no reason to do an expensive exacting computation here, it will be // done later and cached when m_cachedMetaFilesExistMap is set to false, we just need to // know if its POSSIBLE that its a metafile, cheaply. // if its a metafile match, then invalidate the metafile table. @@ -2752,7 +2750,7 @@ namespace AssetProcessor m_metaFilesWhichActuallyExistOnDisk.clear(); // invalidate the map, force a recompuation later. } } - + } m_AssetProcessorIsBusy = true; @@ -2927,7 +2925,7 @@ namespace AssetProcessor } AZ::u64 fileHash = AssetUtilities::GetFileHash(fileInfo.m_filePath.toUtf8().constData()); - + if(fileHash != databaseHashValue) { // File contents have changed @@ -3149,7 +3147,7 @@ namespace AssetProcessor { AddMetadataFilesForFingerprinting(kvp.first.c_str(), job.m_fingerprintFiles); } - + // Check the current builder jobs with the previous ones in the database: job.m_jobEntry.m_computedFingerprint = AssetUtilities::GenerateFingerprint(job); JobIndentifier jobIndentifier(JobDesc(job.m_jobEntry.m_databaseSourceName.toUtf8().data(), job.m_jobEntry.m_jobKey.toUtf8().data(), job.m_jobEntry.m_platformInfo.m_identifier), job.m_jobEntry.m_builderGuid); @@ -3208,7 +3206,7 @@ namespace AssetProcessor { // If the database knows about the job than it implies that AP has processed it sucessfully at least once // and therefore the dependent job should not cause the job which depends on it to be processed again. - // If however we find a dependent job which is not known to AP then we know this job needs to be processed + // If however we find a dependent job which is not known to AP then we know this job needs to be processed // after all the dependent jobs have completed at least once. AzToolsFramework::AssetDatabase::JobDatabaseEntryContainer jobs; @@ -3238,7 +3236,7 @@ namespace AssetProcessor } else if(sourceFileDependency.m_sourceDependencyType != AssetBuilderSDK::SourceFileDependency::SourceFileDependencyType::Wildcards) { - AZ_TracePrintf(AssetProcessor::ConsoleChannel, "UpdateJobDependency: Failed to find builder dependency for %s job (%s, %s, %s)\n", + AZ_TracePrintf(AssetProcessor::ConsoleChannel, "UpdateJobDependency: Failed to find builder dependency for %s job (%s, %s, %s)\n", job.m_jobEntry.GetAbsoluteSourcePath().toUtf8().constData(), jobDependencyInternal->m_jobDependency.m_sourceFile.m_sourceFileDependencyPath.c_str(), jobDependencyInternal->m_jobDependency.m_jobKey.c_str(), @@ -3262,7 +3260,7 @@ namespace AssetProcessor ++jobDependencySlot; } - // sorting job dependencies as they can effect the fingerprint of the job + // sorting job dependencies as they can effect the fingerprint of the job AZStd::sort(job.m_jobDependencyList.begin(), job.m_jobDependencyList.end(), [](const AssetProcessor::JobDependencyInternal& lhs, const AssetProcessor::JobDependencyInternal& rhs) { @@ -3289,7 +3287,7 @@ namespace AssetProcessor for (const JobDependencyInternal& jobDependencyInternal : job.m_jobDependencyList) { // Loop over all the builderUuid and check whether the corresponding entry exists in the jobsFingerprint map. - // If an entry exists, it implies than we have already send the job over to the RCController + // If an entry exists, it implies than we have already send the job over to the RCController for (auto builderIter = jobDependencyInternal.m_builderUuidList.begin(); builderIter != jobDependencyInternal.m_builderUuidList.end(); ++builderIter) { JobIndentifier jobIdentifier(JobDesc(jobDependencyInternal.m_jobDependency.m_sourceFile.m_sourceFileDependencyPath, @@ -3299,7 +3297,7 @@ namespace AssetProcessor auto jobFound = m_jobFingerprintMap.find(jobIdentifier); if (jobFound == m_jobFingerprintMap.end()) { - // Job cannot be processed, since one of its dependent job hasn't been fingerprinted + // Job cannot be processed, since one of its dependent job hasn't been fingerprinted return false; } } @@ -3317,7 +3315,7 @@ namespace AssetProcessor // and call the CreateJobs function on the builder. // it bundles the results up in a JobToProcessEntry struct, while it is doing this: JobToProcessEntry entry; - + AZ::Uuid sourceUUID = AssetUtilities::CreateSafeSourceUUIDFromName(databasePathToFile.toUtf8().constData()); // first, we put the source UUID in the map so that its present for any other queries: @@ -3375,14 +3373,14 @@ namespace AssetProcessor builderInfo.m_createJobFunction(createJobsRequest, createJobsResponse); AssetProcessor::StatsCapture::EndCaptureStat(statKey.toUtf8().constData()); } - + AssetProcessor::SetThreadLocalJobId(0); bool isBuilderMissingFingerprint = (createJobsResponse.m_result == AssetBuilderSDK::CreateJobsResultCode::Success && !createJobsResponse.m_createJobOutputs.empty() && !createJobsResponse.m_createJobOutputs[0].m_additionalFingerprintInfo.empty() && builderInfo.m_analysisFingerprint.empty()); - + if (createJobsResponse.m_result == AssetBuilderSDK::CreateJobsResultCode::Failed || isBuilderMissingFingerprint) { AZ_TracePrintf(AssetProcessor::ConsoleChannel, "Createjobs Failed: %s.\n", normalizedPath.toUtf8().constData()); @@ -3393,7 +3391,7 @@ namespace AssetProcessor char resolvedBuffer[AZ_MAX_PATH_LEN] = { 0 }; AZ::IO::FileIOBase::GetInstance()->ResolvePath(fullPathToLogFile.c_str(), resolvedBuffer, AZ_MAX_PATH_LEN); - + JobDetails jobdetail; jobdetail.m_jobEntry = JobEntry( scanFolder->ScanPath(), @@ -3486,9 +3484,9 @@ namespace AssetProcessor scanFolder->ScanPath(), actualRelativePath, databasePathToFile, - builderInfo.m_busId, - *infoForPlatform, - jobDescriptor.m_jobKey.c_str(), 0, GenerateNewJobRunKey(), + builderInfo.m_busId, + *infoForPlatform, + jobDescriptor.m_jobKey.c_str(), 0, GenerateNewJobRunKey(), sourceUUID); newJob.m_jobEntry.m_checkExclusiveLock = jobDescriptor.m_checkExclusiveLock; newJob.m_jobParam = AZStd::move(jobDescriptor.m_jobParameters); @@ -3506,7 +3504,7 @@ namespace AssetProcessor newJob.m_jobDependencyList.push_back(JobDependencyInternal(jobDependency)); ++numJobDependencies; } - + // note that until analysis completes, the jobId is not set and neither is the destination pat JobDesc jobDesc(newJob.m_jobEntry.m_databaseSourceName.toUtf8().data(), newJob.m_jobEntry.m_jobKey.toUtf8().data(), newJob.m_jobEntry.m_platformInfo.m_identifier); m_jobDescToBuilderUuidMap[jobDesc].insert(builderInfo.m_busId); @@ -3515,7 +3513,7 @@ namespace AssetProcessor JobIndentifier jobIdentifier(jobDesc, builderInfo.m_busId); { AZStd::lock_guard lock(AssetProcessor::ProcessingJobInfoBus::GetOrCreateContext().m_contextMutex); - m_jobFingerprintMap.erase(jobIdentifier); + m_jobFingerprintMap.erase(jobIdentifier); } entry.m_jobsToAnalyze.push_back(AZStd::move(newJob)); @@ -3578,7 +3576,7 @@ namespace AssetProcessor // instead of a UUID, a path has been provided, prepare and use that. We need to turn it into a database path QString encodedFileData = QString::fromUtf8(sourceDependency.m_sourceFileDependencyPath.c_str()); encodedFileData = AssetUtilities::NormalizeFilePath(encodedFileData); - + if (sourceDependency.m_sourceDependencyType == AssetBuilderSDK::SourceFileDependency::SourceFileDependencyType::Wildcards) { int wildcardIndex = encodedFileData.indexOf("*"); @@ -3653,7 +3651,7 @@ namespace AssetProcessor } // Convert to relative paths - for (auto dependencyItr = resolvedDependencyList.begin(); dependencyItr != resolvedDependencyList.end();) + for (auto dependencyItr = resolvedDependencyList.begin(); dependencyItr != resolvedDependencyList.end();) { QString relativePath, scanFolder; if (m_platformConfig->ConvertToRelativePath(*dependencyItr, relativePath, scanFolder)) @@ -3705,7 +3703,7 @@ namespace AssetProcessor return (!resultDatabaseSourceName.isEmpty()); } - + void AssetProcessorManager::UpdateSourceFileDependenciesDatabase(JobToProcessEntry& entry) { using namespace AzToolsFramework::AssetDatabase; @@ -3738,7 +3736,7 @@ namespace AssetProcessor QString resolvedDatabaseName; if (!ResolveSourceFileDependencyPath(sourceDependency.second, resolvedDatabaseName,resolvedDependencyList)) { - // ResolveDependencyPath should only fail in a data error, otherwise it always outputs something, + // ResolveDependencyPath should only fail in a data error, otherwise it always outputs something, // even if that something starts with the placeholder. continue; } @@ -3759,7 +3757,7 @@ namespace AssetProcessor SourceFileDependencyEntry newDependencyEntry( sourceDependency.first, entry.m_sourceFileInfo.m_databasePath.toUtf8().constData(), - resolvedDatabaseName.toUtf8().constData(), + resolvedDatabaseName.toUtf8().constData(), sourceDependency.second.m_sourceDependencyType == AssetBuilderSDK::SourceFileDependency::SourceFileDependencyType::Wildcards ? SourceFileDependencyEntry::DEP_SourceLikeMatch : SourceFileDependencyEntry::DEP_SourceToSource, !sourceDependency.second.m_sourceFileDependencyUUID.IsNull()); // If the UUID is null, then record that this dependency came from a (resolved) path newDependencies.push_back(AZStd::move(newDependencyEntry)); @@ -3803,7 +3801,7 @@ namespace AssetProcessor } // get all the old dependencies and remove them. This function is comprehensive on all dependencies - // for a given source file so we can just eliminate all of them from that same source file and replace + // for a given source file so we can just eliminate all of them from that same source file and replace // them with all of the new ones for the given source file: AZStd::unordered_set oldDependencies; m_stateData->QueryDependsOnSourceBySourceDependency( @@ -4018,7 +4016,7 @@ namespace AssetProcessor result.m_watchFolder = QString::fromUtf8(scanFolder.m_scanFolder.c_str()); result.m_sourceRelativeToWatchFolder = result.m_sourceDatabaseName; - { + { // this scope exists to restrict the duration of the below lock. AZStd::lock_guard lock(m_sourceUUIDToSourceInfoMapMutex); m_sourceUUIDToSourceInfoMap.insert(AZStd::make_pair(sourceUuid, result)); @@ -4045,9 +4043,9 @@ namespace AssetProcessor auto jobPair = m_jobsToProcess.insert(AZStd::move(jobDetail)); if (!jobPair.second) { - // if we are here it means that this job was already found in the jobs to process list + // if we are here it means that this job was already found in the jobs to process list // and therefore insert failed, we will try to update the iterator manually here. - // Note that if insert fails the original object is not destroyed and therefore we can use move again. + // Note that if insert fails the original object is not destroyed and therefore we can use move again. // we just replaced a job, so we have to decrement its count. UpdateAnalysisTrackerForFile(jobPair.first->m_jobEntry, AnalysisTrackerUpdateType::JobFinished); @@ -4068,7 +4066,7 @@ namespace AssetProcessor QSet absoluteSourceFilePathQueue; QString databasePath; QString scanFolder; - + auto callbackFunction = [this, &absoluteSourceFilePathQueue](SourceFileDependencyEntry& entry) { QString relativeDatabaseName = QString::fromUtf8(entry.m_source.c_str()); @@ -4111,7 +4109,7 @@ namespace AssetProcessor sourceDatabaseEntry.m_sourceName = relativeSourceFilePath.toUtf8().constData(); sourceDatabaseEntry.m_sourceGuid = AssetUtilities::CreateSafeSourceUUIDFromName(sourceDatabaseEntry.m_sourceName.c_str()); - + if (!m_stateData->SetSource(sourceDatabaseEntry)) { AZ_Error(AssetProcessor::ConsoleChannel, false, "Failed to add source to the database!!!"); @@ -4260,7 +4258,7 @@ namespace AssetProcessor { AZ_TracePrintf(DebugChannel, "Builder %s analysis fingerprint changed. Files assigned to it will be re-analyzed.\n", priorBuilderUUID.ToString().c_str()); } - + if (builderIsDirty) { m_anyBuilderChange = true; @@ -4414,7 +4412,7 @@ namespace AssetProcessor source.m_analysisFingerprint.append(builderFP.ToString()); } - m_pathDependencyManager->RetryDeferredDependencies(source); + m_pathDependencyManager->QueueSourceForDependencyResolution(source); m_stateData->SetSource(source); databaseSourceName = source.m_sourceName.c_str(); @@ -4593,7 +4591,7 @@ namespace AssetProcessor { continue; } - + QString firstMatchingFile = m_platformConfig->FindFirstMatchingFile(dep); if (firstMatchingFile.isEmpty()) { @@ -4787,7 +4785,7 @@ namespace AssetProcessor assetIter->m_entry.m_sourceFileUUID); jobdetail.m_autoFail = true; jobdetail.m_critical = true; - jobdetail.m_priority = INT_MAX; // front of the queue. + jobdetail.m_priority = INT_MAX; // front of the queue. jobdetail.m_scanFolder = m_platformConfig->GetScanFolderForFile(assetIter->m_entry.GetAbsoluteSourcePath()); // the new lines make it easier to copy and paste the file names. jobdetail.m_jobParam[AZ_CRC(AutoFailReasonKey)] = autoFailReason; @@ -4859,6 +4857,6 @@ namespace AssetProcessor return filesFound; } - + } // namespace AssetProcessor diff --git a/Code/Tools/AssetProcessor/native/tests/BaseAssetProcessorTest.h b/Code/Tools/AssetProcessor/native/tests/BaseAssetProcessorTest.h index 71d3fa0f6d..be7e78d097 100644 --- a/Code/Tools/AssetProcessor/native/tests/BaseAssetProcessorTest.h +++ b/Code/Tools/AssetProcessor/native/tests/BaseAssetProcessorTest.h @@ -40,12 +40,14 @@ protected: void SetupEnvironment() override { // Setup code + AZ::Environment::Create(nullptr); qInstallMessageHandler(UnitTestMessageHandler); } void TeardownEnvironment() override { qInstallMessageHandler(nullptr); + AZ::Environment::Destroy(); } private: diff --git a/Code/Tools/AssetProcessor/native/tests/PathDependencyManagerTests.cpp b/Code/Tools/AssetProcessor/native/tests/PathDependencyManagerTests.cpp index b20d373307..1d6e92e47e 100644 --- a/Code/Tools/AssetProcessor/native/tests/PathDependencyManagerTests.cpp +++ b/Code/Tools/AssetProcessor/native/tests/PathDependencyManagerTests.cpp @@ -12,13 +12,23 @@ #include "AzToolsFramework/API/AssetDatabaseBus.h" #include "AssetDatabase/AssetDatabase.h" #include +#include +#include +#include +#include namespace UnitTests { class MockDatabaseLocationListener : public AzToolsFramework::AssetDatabase::AssetDatabaseRequests::Bus::Handler { public: - MOCK_METHOD1(GetAssetDatabaseLocation, bool(AZStd::string&)); + bool GetAssetDatabaseLocation(AZStd::string& location) override + { + location = m_databaseLocation; + return true; + } + + AZStd::string m_databaseLocation; }; namespace Util @@ -38,25 +48,45 @@ namespace UnitTests } } - struct PathDependencyDeletionTest - : UnitTest::ScopedAllocatorSetupFixture - , UnitTest::TraceBusRedirector + struct PathDependencyBase + : UnitTest::TraceBusRedirector { - void SetUp() override; - void TearDown() override; + void Init(); + void Destroy(); QTemporaryDir m_tempDir; AZStd::string m_databaseLocation; - ::testing::NiceMock m_databaseLocationListener; + MockDatabaseLocationListener m_databaseLocationListener; AZStd::shared_ptr m_stateData; AZStd::unique_ptr m_platformConfig; + AZStd::unique_ptr m_serializeContext; + AZ::Entity* m_jobManagerEntity{}; + AZ::ComponentDescriptor* m_descriptor{}; }; - void PathDependencyDeletionTest::SetUp() + struct PathDependencyDeletionTest + : UnitTest::ScopedAllocatorSetupFixture + , PathDependencyBase + { + void SetUp() override + { + PathDependencyBase::Init(); + } + + void TearDown() override + { + PathDependencyBase::Destroy(); + } + }; + + void PathDependencyBase::Init() { using namespace ::testing; using namespace AzToolsFramework::AssetDatabase; + ::UnitTest::TestRunner::Instance().m_suppressAsserts = false; + ::UnitTest::TestRunner::Instance().m_suppressErrors = false; + BusConnect(); QDir tempPath(m_tempDir.path()); @@ -68,21 +98,39 @@ namespace UnitTests // ":memory:" databases are one-instance-only, and even if another connection is opened to ":memory:" it would // not share with others created using ":memory:" and get a unique database instead. m_databaseLocation = tempPath.absoluteFilePath("test_database.sqlite").toUtf8().constData(); - - ON_CALL(m_databaseLocationListener, GetAssetDatabaseLocation(_)) - .WillByDefault( - DoAll( // set the 0th argument ref (string) to the database location and return true. - SetArgReferee<0>(m_databaseLocation), - Return(true))); + m_databaseLocationListener.m_databaseLocation = m_databaseLocation; m_stateData = AZStd::shared_ptr(new AssetProcessor::AssetDatabaseConnection()); m_stateData->OpenDatabase(); m_platformConfig = AZStd::make_unique(); + + AZ::AllocatorInstance::Create(); + AZ::AllocatorInstance::Create(); + + m_serializeContext = AZStd::make_unique(); + m_descriptor = AZ::JobManagerComponent::CreateDescriptor(); + m_descriptor->Reflect(m_serializeContext.get()); + + m_jobManagerEntity = aznew AZ::Entity{}; + m_jobManagerEntity->CreateComponent(); + m_jobManagerEntity->Init(); + m_jobManagerEntity->Activate(); } - void PathDependencyDeletionTest::TearDown() + void PathDependencyBase::Destroy() { + m_stateData = nullptr; + m_platformConfig = nullptr; + + m_jobManagerEntity->Deactivate(); + delete m_jobManagerEntity; + + delete m_descriptor; + + AZ::AllocatorInstance::Destroy(); + AZ::AllocatorInstance::Destroy(); + BusDisconnect(); } @@ -91,7 +139,7 @@ namespace UnitTests using namespace AzToolsFramework::AssetDatabase; // Add a product to the db with an unmet dependency - ScanFolderDatabaseEntry scanFolder("folder", "test", "test", ""); + ScanFolderDatabaseEntry scanFolder("folder", "test", "test", 0); m_stateData->SetScanFolder(scanFolder); SourceDatabaseEntry source1, source2; @@ -110,7 +158,8 @@ namespace UnitTests Util::CreateSourceJobAndProduct(m_stateData.get(), scanFolder.m_scanFolderID, source2, job2, product2, "source2.txt", "product2.jpg"); - manager.RetryDeferredDependencies(source2); + manager.QueueSourceForDependencyResolution(source2); + manager.ProcessQueuedDependencyResolves(); } TEST_F(PathDependencyDeletionTest, ExistingSourceWithUnmetDependency_RemovedFromDB_DependentProductCreatedWithoutError) @@ -118,7 +167,7 @@ namespace UnitTests using namespace AzToolsFramework::AssetDatabase; // Add a product to the db with an unmet dependency - ScanFolderDatabaseEntry scanFolder("folder", "test", "test", ""); + ScanFolderDatabaseEntry scanFolder("folder", "test", "test", 0); m_stateData->SetScanFolder(scanFolder); SourceDatabaseEntry source1, source2; @@ -137,7 +186,8 @@ namespace UnitTests Util::CreateSourceJobAndProduct(m_stateData.get(), scanFolder.m_scanFolderID, source2, job2, product2, "source2.txt", "product2.jpg"); - manager.RetryDeferredDependencies(source2); + manager.QueueSourceForDependencyResolution(source2); + manager.ProcessQueuedDependencyResolves(); } TEST_F(PathDependencyDeletionTest, NewSourceWithUnmetDependency_RemovedFromDB_DependentSourceCreatedWithoutError) @@ -147,7 +197,7 @@ namespace UnitTests AssetProcessor::PathDependencyManager manager(m_stateData, m_platformConfig.get()); // Add a product to the db with an unmet dependency - ScanFolderDatabaseEntry scanFolder("folder", "test", "test", ""); + ScanFolderDatabaseEntry scanFolder("folder", "test", "test", 0); m_stateData->SetScanFolder(scanFolder); SourceDatabaseEntry source1, source2; @@ -166,7 +216,8 @@ namespace UnitTests Util::CreateSourceJobAndProduct(m_stateData.get(), scanFolder.m_scanFolderID, source2, job2, product2, "source2.txt", "product2.jpg"); - manager.RetryDeferredDependencies(source2); + manager.QueueSourceForDependencyResolution(source2); + manager.ProcessQueuedDependencyResolves(); } TEST_F(PathDependencyDeletionTest, NewSourceWithUnmetDependency_RemovedFromDB_DependentProductCreatedWithoutError) @@ -176,7 +227,7 @@ namespace UnitTests AssetProcessor::PathDependencyManager manager(m_stateData, m_platformConfig.get()); // Add a product to the db with an unmet dependency - ScanFolderDatabaseEntry scanFolder("folder", "test", "test", ""); + ScanFolderDatabaseEntry scanFolder("folder", "test", "test", 0); m_stateData->SetScanFolder(scanFolder); SourceDatabaseEntry source1, source2; @@ -195,7 +246,8 @@ namespace UnitTests Util::CreateSourceJobAndProduct(m_stateData.get(), scanFolder.m_scanFolderID, source2, job2, product2, "source2.txt", "product2.jpg"); - manager.RetryDeferredDependencies(source2); + manager.QueueSourceForDependencyResolution(source2); + manager.ProcessQueuedDependencyResolves(); } TEST_F(PathDependencyDeletionTest, NewSourceWithUnmetDependency_Wildcard_RemovedFromDB_DependentSourceCreatedWithoutError) @@ -205,7 +257,7 @@ namespace UnitTests AssetProcessor::PathDependencyManager manager(m_stateData, m_platformConfig.get()); // Add a product to the db with an unmet dependency - ScanFolderDatabaseEntry scanFolder("folder", "test", "test", ""); + ScanFolderDatabaseEntry scanFolder("folder", "test", "test", 0); m_stateData->SetScanFolder(scanFolder); SourceDatabaseEntry source1, source2; @@ -224,6 +276,266 @@ namespace UnitTests Util::CreateSourceJobAndProduct(m_stateData.get(), scanFolder.m_scanFolderID, source2, job2, product2, "source2.txt", "product2.jpg"); - manager.RetryDeferredDependencies(source2); + manager.QueueSourceForDependencyResolution(source2); + manager.ProcessQueuedDependencyResolves(); + } + + using PathDependencyTests = PathDependencyDeletionTest; + + TEST_F(PathDependencyTests, SourceAndProductHaveSameName_SourceFileDependency_MatchesSource) + { + using namespace AzToolsFramework::AssetDatabase; + + AssetProcessor::PathDependencyManager manager(m_stateData, m_platformConfig.get()); + + ScanFolderDatabaseEntry scanFolder("folder", "test", "test", 0); + m_stateData->SetScanFolder(scanFolder); + + SourceDatabaseEntry source1, source2; + JobDatabaseEntry job1, job2; + ProductDatabaseEntry product1, product2, product3; + + Util::CreateSourceJobAndProduct( + m_stateData.get(), scanFolder.m_scanFolderID, source1, job1, product1, "source1.txt", "product1.jpg"); + + AssetBuilderSDK::ProductPathDependencySet set; + set.insert(AssetBuilderSDK::ProductPathDependency("*.xml", AssetBuilderSDK::ProductPathDependencyType::SourceFile)); + + manager.SaveUnresolvedDependenciesToDatabase(set, product1, "pc"); + + Util::CreateSourceJobAndProduct( + m_stateData.get(), scanFolder.m_scanFolderID, source2, job2, product2, "source2.xml", "source2.xml"); + + // Create a 2nd product for this source + product3 = ProductDatabaseEntry{ job2.m_jobID, product2.m_subID + 1, "source2.txt", AZ::Data::AssetType::CreateRandom() }; + ASSERT_TRUE(m_stateData->SetProduct(product3)); + + manager.QueueSourceForDependencyResolution(source2); + manager.ProcessQueuedDependencyResolves(); + + ProductDependencyDatabaseEntryContainer productDependencies; + m_stateData->GetProductDependencies(productDependencies); + + EXPECT_EQ(productDependencies.size(), 3); + } + + TEST_F(PathDependencyTests, SourceAndProductHaveSameName_ProductFileDependency_MatchesProduct) + { + using namespace AzToolsFramework::AssetDatabase; + + AssetProcessor::PathDependencyManager manager(m_stateData, m_platformConfig.get()); + + ScanFolderDatabaseEntry scanFolder("folder", "test", "test", 0); + m_stateData->SetScanFolder(scanFolder); + + SourceDatabaseEntry source1, source2; + JobDatabaseEntry job1, job2; + ProductDatabaseEntry product1, product2, product3; + + Util::CreateSourceJobAndProduct( + m_stateData.get(), scanFolder.m_scanFolderID, source1, job1, product1, "source1.txt", "product1.jpg"); + + AssetBuilderSDK::ProductPathDependencySet set; + set.insert(AssetBuilderSDK::ProductPathDependency("*.xml", AssetBuilderSDK::ProductPathDependencyType::ProductFile)); + + manager.SaveUnresolvedDependenciesToDatabase(set, product1, "pc"); + + Util::CreateSourceJobAndProduct( + m_stateData.get(), scanFolder.m_scanFolderID, source2, job2, product2, "source2.xml", "source2.xml"); + + // Create a 2nd product for this source + product3 = ProductDatabaseEntry{job2.m_jobID, product2.m_subID + 1, "source2.txt", AZ::Data::AssetType::CreateRandom()}; + ASSERT_TRUE(m_stateData->SetProduct(product3)); + + manager.QueueSourceForDependencyResolution(source2); + manager.ProcessQueuedDependencyResolves(); + + ProductDependencyDatabaseEntryContainer productDependencies; + m_stateData->GetProductDependencies(productDependencies); + + EXPECT_EQ(productDependencies.size(), 2); } + + struct PathDependencyBenchmarks + : UnitTest::ScopedAllocatorFixture + , PathDependencyBase + { + static inline constexpr int NumTestDependencies = 4; // Must be a multiple of 4 + static inline constexpr int NumTestProducts = 2; // Must be a multiple of 2 + + AzToolsFramework::AssetDatabase::ProductDatabaseEntryContainer m_products; + AzToolsFramework::AssetDatabase::SourceDatabaseEntry m_source1, m_source2, m_source4; + AzToolsFramework::AssetDatabase::JobDatabaseEntry m_job1, m_job2, m_job4; + AzToolsFramework::AssetDatabase::ProductDatabaseEntry m_product1, m_product2, m_product4; + AzToolsFramework::AssetDatabase::ProductDependencyDatabaseEntryContainer m_dependencies; + + void SetupTestData() + { + using namespace AzToolsFramework::AssetDatabase; + + ScanFolderDatabaseEntry scanFolder("folder", "test", "test", 0); + ASSERT_TRUE(m_stateData->SetScanFolder(scanFolder)); + + Util::CreateSourceJobAndProduct( + m_stateData.get(), scanFolder.m_scanFolderID, m_source1, m_job1, m_product1, "source1.txt", "product1.jpg"); + + Util::CreateSourceJobAndProduct( + m_stateData.get(), scanFolder.m_scanFolderID, m_source4, m_job4, m_product4, "source4.txt", "product4.jpg"); + + for (int i = 0; i < NumTestDependencies / 2; ++i) + { + m_dependencies.emplace_back( + m_product1.m_productID, AZ::Uuid::CreateNull(), 0, 0, "pc", 0, + AZStd::string::format("folder/folder2/%d_*2.jpg", i).c_str()); + ++i; + m_dependencies.emplace_back( + m_product1.m_productID, AZ::Uuid::CreateNull(), 0, 0, "mac", 0, + AZStd::string::format("folder/folder2/%d_*2.jpg", i).c_str()); + } + + for (int i = 0; i < NumTestDependencies / 2; ++i) + { + m_dependencies.emplace_back( + m_product4.m_productID, AZ::Uuid::CreateNull(), 0, 0, "pc", 0, + AZStd::string::format("folder/folder2/%d_*2.jpg", i).c_str()); + ++i; + m_dependencies.emplace_back( + m_product4.m_productID, AZ::Uuid::CreateNull(), 0, 0, "mac", 0, + AZStd::string::format("folder/folder2/%d_*2.jpg", i).c_str()); + } + + ASSERT_TRUE(m_stateData->SetProductDependencies(m_dependencies)); + + Util::CreateSourceJobAndProduct( + m_stateData.get(), scanFolder.m_scanFolderID, m_source2, m_job2, m_product2, "source2.txt", "product2.jpg"); + + auto job3 = JobDatabaseEntry( + m_source2.m_sourceID, "jobkey", 1111, "mac", AZ::Uuid::CreateRandom(), AzToolsFramework::AssetSystem::JobStatus::Completed, + 4444); + ASSERT_TRUE(m_stateData->SetJob(job3)); + + for (int i = 0; i < NumTestProducts; ++i) + { + m_products.emplace_back( + m_job2.m_jobID, i, AZStd::string::format("pc/folder/folder2/%d_product2.jpg", i).c_str(), + AZ::Data::AssetType::CreateRandom()); + ++i; + m_products.emplace_back( + job3.m_jobID, i, AZStd::string::format("mac/folder/folder2/%d_product2.jpg", i).c_str(), + AZ::Data::AssetType::CreateRandom()); + } + + ASSERT_TRUE(m_stateData->SetProducts(m_products)); + } + + void DoTest() + { + AssetProcessor::PathDependencyManager manager(m_stateData, m_platformConfig.get()); + + manager.QueueSourceForDependencyResolution(m_source2); + manager.ProcessQueuedDependencyResolves(); + } + + void VerifyResult() + { + using namespace AzToolsFramework::AssetDatabase; + + ProductDependencyDatabaseEntryContainer productDependencies; + m_stateData->GetProductDependencies(productDependencies); + + for (int i = 0; i < NumTestDependencies / 2 && i < NumTestProducts; ++i) + { + const auto& product = m_products[i]; + int found = 0; + + for (const auto& unresolvedProductDependency : productDependencies) + { + if (unresolvedProductDependency.m_dependencySourceGuid == m_source2.m_sourceGuid && + unresolvedProductDependency.m_dependencySubID == product.m_subID && + unresolvedProductDependency.m_productPK == m_product1.m_productID) + { + ++found; + } + + if (unresolvedProductDependency.m_dependencySourceGuid == m_source2.m_sourceGuid && + unresolvedProductDependency.m_dependencySubID == product.m_subID && + unresolvedProductDependency.m_productPK == m_product4.m_productID) + { + ++found; + } + + if (found == 2) + break; + } + + EXPECT_TRUE(found == 2) << product.m_productName.c_str() << " was not found"; + } + + EXPECT_EQ(productDependencies.size(), NumTestDependencies * 2); + } + }; + + // For some reason, BENCHMARK_F doesn't seem to call the destructor + // So we'll wrap the class and handle the new/delete ourselves + struct PathDependencyBenchmarksWrapperClass : public ::benchmark::Fixture + { + void SetUp([[maybe_unused]] const benchmark::State& st) override + { + m_benchmarks = new PathDependencyBenchmarks(); + m_benchmarks->Init(); + m_benchmarks->SetupTestData(); + } + + void SetUp([[maybe_unused]] benchmark::State& st) override + { + m_benchmarks = new PathDependencyBenchmarks(); + m_benchmarks->Init(); + m_benchmarks->SetupTestData(); + } + + void TearDown([[maybe_unused]] benchmark::State& st) override + { + m_benchmarks->Destroy(); + delete m_benchmarks; + } + + void TearDown([[maybe_unused]] const benchmark::State& st) override + { + m_benchmarks->Destroy(); + delete m_benchmarks; + } + + PathDependencyBenchmarks* m_benchmarks = {}; + }; + + struct PathDependencyTestValidation + : PathDependencyBenchmarks, ::testing::Test + { + void SetUp() override + { + PathDependencyBase::Init(); + } + void TearDown() override + { + PathDependencyBase::Destroy(); + } + }; + + TEST_F(PathDependencyTestValidation, DeferredWildcardDependencyResolution) + { + SetupTestData(); + DoTest(); + VerifyResult(); + } + + BENCHMARK_F(PathDependencyBenchmarksWrapperClass, BM_DeferredWildcardDependencyResolution)(benchmark::State& state) + { + for (auto _ : state) + { + m_benchmarks->m_stateData->SetProductDependencies(m_benchmarks->m_dependencies); + + m_benchmarks->DoTest(); + } + } + } diff --git a/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.cpp b/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.cpp index 58f76f8da6..0908d0fdb9 100644 --- a/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.cpp +++ b/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.cpp @@ -15,6 +15,10 @@ #include #include +#include +#include +#include +#include using namespace AssetProcessor; @@ -26,6 +30,7 @@ public: friend class GTEST_TEST_CLASS_NAME_(MultiplatformPathDependencyTest, AssetProcessed_Impl_MultiplatformDependencies); friend class GTEST_TEST_CLASS_NAME_(MultiplatformPathDependencyTest, AssetProcessed_Impl_MultiplatformDependencies_DeferredResolution); + friend class GTEST_TEST_CLASS_NAME_(MultiplatformPathDependencyTest, SameFilenameForAllPlatforms); friend class GTEST_TEST_CLASS_NAME_(MultiplatformPathDependencyTest, AssetProcessed_Impl_MultiplatformDependencies_SourcePath); @@ -176,8 +181,21 @@ void AssetProcessorManagerTest::SetUp() AssetProcessorTest::SetUp(); + AZ::AllocatorInstance::Create(); + AZ::AllocatorInstance::Create(); + m_data = AZStd::make_unique(); + m_data->m_serializeContext = AZStd::make_unique(); + + m_data->m_descriptor = AZ::JobManagerComponent::CreateDescriptor(); + m_data->m_descriptor->Reflect(m_data->m_serializeContext.get()); + + m_data->m_jobManagerEntity = aznew AZ::Entity{}; + m_data->m_jobManagerEntity->CreateComponent(); + m_data->m_jobManagerEntity->Init(); + m_data->m_jobManagerEntity->Activate(); + m_config.reset(new AssetProcessor::PlatformConfiguration()); m_mockApplicationManager.reset(new AssetProcessor::MockApplicationManager()); @@ -256,6 +274,10 @@ void AssetProcessorManagerTest::SetUp() void AssetProcessorManagerTest::TearDown() { + m_data->m_jobManagerEntity->Deactivate(); + delete m_data->m_jobManagerEntity; + delete m_data->m_descriptor; + m_data = nullptr; QObject::disconnect(m_idleConnection); @@ -271,6 +293,9 @@ void AssetProcessorManagerTest::TearDown() m_qApp.reset(); m_scopeDir.reset(); + AZ::AllocatorInstance::Destroy(); + AZ::AllocatorInstance::Destroy(); + AssetProcessor::AssetProcessorTest::TearDown(); } @@ -1270,7 +1295,8 @@ TEST_F(AbsolutePathProductDependencyTest, AbsolutePathProductDependency_RetryDef AZ::Data::AssetType::CreateNull()); m_assetProcessorManager->m_stateData->SetProduct(matchingProductForDependency); - m_assetProcessorManager->m_pathDependencyManager->RetryDeferredDependencies(matchingSource); + m_assetProcessorManager->m_pathDependencyManager->QueueSourceForDependencyResolution(matchingSource); + m_assetProcessorManager->m_pathDependencyManager->ProcessQueuedDependencyResolves(); // The product dependency ID shouldn't change when it goes from unresolved to resolved. AZStd::vector resolvedProductDependencies; @@ -1405,6 +1431,7 @@ bool PathDependencyTest::ProcessAsset(TestAsset& asset, const OutputAssetSet& ou // tell the APM that the asset has been processed and allow it to bubble through its event queue: m_isIdling = false; m_assetProcessorManager->AssetProcessed(capturedDetails[jobSet].m_jobEntry, processJobResponse); + m_assetProcessorManager->CheckForIdle(); jobSet++; } @@ -2646,6 +2673,44 @@ TEST_F(MultiplatformPathDependencyTest, AssetProcessed_Impl_MultiplatformDepende ASSERT_NE(SearchDependencies(dependencyContainer, asset1.m_products[0]), SearchDependencies(dependencyContainer, asset1.m_products[1])); } +TEST_F(MultiplatformPathDependencyTest, SameFilenameForAllPlatforms) +{ + TestAsset asset2("asset2"); + bool result = ProcessAsset( + asset2, { { ".output" }, { ".output" } }, { { "*1.output", AssetBuilderSDK::ProductPathDependencyType::ProductFile } }, "subfolder1/", + ".txt"); + + ASSERT_TRUE(result); + + TestAsset asset1("asset1"); + result = ProcessAsset(asset1, { { ".output" }, { ".output" } }, {}); + + ASSERT_TRUE(result); + + AssetDatabaseConnection* sharedConnection = m_assetProcessorManager->m_stateData.get(); + ASSERT_TRUE(sharedConnection); + + AzToolsFramework::AssetDatabase::ProductDependencyDatabaseEntryContainer dependencyContainer; + + sharedConnection->GetProductDependencies(dependencyContainer); + int resolvedCount = 0; + int unresolvedCount = 0; + for (const auto& dep : dependencyContainer) + { + if (dep.m_unresolvedPath.empty()) + { + resolvedCount++; + } + else + { + unresolvedCount++; + } + } + ASSERT_EQ(resolvedCount, 2); + ASSERT_EQ(unresolvedCount, 2); + VerifyDependencies(dependencyContainer, { asset1.m_products[0], asset1.m_products[1] }, { "*1.output", "*1.output" }); +} + TEST_F(MultiplatformPathDependencyTest, AssetProcessed_Impl_MultiplatformDependencies_SourcePath) { // One product will be pc, one will be console (order is non-deterministic) @@ -4185,7 +4250,7 @@ TEST_F(LockedFileTest, DeleteFile_LockedProduct_DeleteFails) auto theFile = m_data->m_absolutePath[1].toUtf8(); const char* theFileString = theFile.constData(); auto [sourcePath, productPath] = *m_data->m_productPaths.find(theFileString); - + { QFile file(theFileString); file.remove(); @@ -4257,7 +4322,7 @@ TEST_F(LockedFileTest, DeleteFile_LockedProduct_DeletesWhenReleased) EXPECT_FALSE(QFile::exists(productPath)); EXPECT_EQ(m_data->m_deletedSources.size(), 1); - + EXPECT_GT(m_deleteCounter, 1); // Make sure the AP tried more than once to delete the file m_errorAbsorber->ExpectAsserts(0); } @@ -5364,7 +5429,7 @@ AZStd::vector WildcardSourceDependencyTest::FileAddedTest(const Q void WildcardSourceDependencyTest::SetUp() { AssetProcessorManagerTest::SetUp(); - + QDir tempPath(m_tempDir.path()); // Add a non-recursive scan folder. Only files directly inside of this folder should be picked up, subfolders are ignored @@ -5454,7 +5519,7 @@ TEST_F(WildcardSourceDependencyTest, Relative_Broad) { // Expect all files except for the 2 invalid ones (e and f) AZStd::vector resolvedPaths; - + ASSERT_TRUE(Test("*.foo", resolvedPaths)); ASSERT_THAT(resolvedPaths, ::testing::UnorderedElementsAre("a.foo", "b.foo", "folder/one/c.foo", "folder/one/d.foo", "1a.foo", "1b.foo")); } @@ -5585,7 +5650,7 @@ TEST_F(WildcardSourceDependencyTest, Relative_CacheFolder) { AZStd::vector resolvedPaths; QDir tempPath(m_tempDir.path()); - + ASSERT_TRUE(Test("*cache.foo", resolvedPaths)); ASSERT_THAT(resolvedPaths, ::testing::UnorderedElementsAre()); } @@ -5635,7 +5700,7 @@ TEST_F(WildcardSourceDependencyTest, FilesRemovedAfterInitialCache) ASSERT_EQ(excludedFolders.size(), 3); } - + m_fileStateCache->SignalDeleteEvent(tempPath.absoluteFilePath("subfolder2/redirected/folder/two/ignored")); const auto& excludedFolders = excludedFolderCacheInterface->GetExcludedFolders(); diff --git a/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.h b/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.h index 7bbef41f44..c532b08016 100644 --- a/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.h +++ b/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.h @@ -23,6 +23,8 @@ #include #include +#include +#include #include #include #include "resourcecompiler/rccontroller.h" @@ -39,7 +41,7 @@ class AssetProcessorManagerTest : public AssetProcessor::AssetProcessorTest { public: - + AssetProcessorManagerTest(); virtual ~AssetProcessorManagerTest() @@ -67,16 +69,19 @@ protected: { AZStd::string m_databaseLocation; ::testing::NiceMock m_databaseLocationListener; + AZ::Entity* m_jobManagerEntity{}; + AZ::ComponentDescriptor* m_descriptor{}; + AZStd::unique_ptr m_serializeContext; }; AZStd::unique_ptr m_data; - + private: int m_argc; char** m_argv; AZStd::unique_ptr m_scopeDir; - AZStd::unique_ptr m_qApp; + AZStd::unique_ptr m_qApp; }; struct AbsolutePathProductDependencyTest diff --git a/Code/Tools/AssetProcessor/native/utilities/PlatformConfiguration.cpp b/Code/Tools/AssetProcessor/native/utilities/PlatformConfiguration.cpp index 7543e9ec8b..c62d822171 100644 --- a/Code/Tools/AssetProcessor/native/utilities/PlatformConfiguration.cpp +++ b/Code/Tools/AssetProcessor/native/utilities/PlatformConfiguration.cpp @@ -51,7 +51,7 @@ namespace AssetProcessor case AZ::SettingsRegistryInterface::VisitAction::Begin: { // Only continue traversal if the path is exactly the AssetProcessorSettingsKey (which indicates the start of traversal) - // or if a "Platform *" object and it's children are being traversed + // or if a "Platform *" object and it's children are being traversed if (jsonPath == AssetProcessorSettingsKey) { return AZ::SettingsRegistryInterface::VisitResponse::Continue; @@ -631,7 +631,7 @@ namespace AssetProcessor for (const AssetBuilderSDK::PlatformInfo& platform : m_enabledPlatforms) { AZStd::string_view currentRCParams = assetRecognizer.m_defaultParams; - // The "/Amazon/AssetProcessor/Settings/RC */" entry will be queried + // The "/Amazon/AssetProcessor/Settings/RC */" entry will be queried AZ::IO::Path overrideParamsKey = AZ::IO::Path(AZ::IO::PosixPathSeparator); overrideParamsKey /= path; overrideParamsKey /= platform.m_identifier; @@ -644,7 +644,7 @@ namespace AssetProcessor } else { - // otherwise check for tags associated with the platform + // otherwise check for tags associated with the platform for (const AZStd::string& tag : platform.m_tags) { overrideParamsKey.ReplaceFilename(AZ::IO::PathView(tag)); @@ -1416,6 +1416,8 @@ namespace AssetProcessor return QString(); } + auto* fileStateInterface = AZ::Interface::Get(); + for (int pathIdx = 0; pathIdx < m_scanFolders.size(); ++pathIdx) { AssetProcessor::ScanFolderInfo scanFolderInfo = m_scanFolders[pathIdx]; @@ -1430,7 +1432,7 @@ namespace AssetProcessor QDir rooted(scanFolderInfo.ScanPath()); QString absolutePath = rooted.absoluteFilePath(tempRelativeName); AssetProcessor::FileStateInfo fileStateInfo; - auto* fileStateInterface = AZ::Interface::Get(); + if (fileStateInterface) { if (fileStateInterface->GetFileInfo(absolutePath, &fileStateInfo)) @@ -1499,7 +1501,7 @@ namespace AssetProcessor QRegExp nameMatch{ posixRelativeName, Qt::CaseInsensitive, QRegExp::Wildcard }; AZStd::stack dirs; dirs.push(sourceFolderDir.absolutePath()); - + while (!dirs.empty()) { QString absolutePath = dirs.top(); @@ -1528,7 +1530,7 @@ namespace AssetProcessor continue; } } - + QString pathMatch{ sourceFolderDir.relativeFilePath(dirIterator.filePath()) }; if (nameMatch.exactMatch(pathMatch)) { diff --git a/Code/Tools/AssetProcessor/native/utilities/assetUtils.cpp b/Code/Tools/AssetProcessor/native/utilities/assetUtils.cpp index 6bcd0dec01..a6cbfd8077 100644 --- a/Code/Tools/AssetProcessor/native/utilities/assetUtils.cpp +++ b/Code/Tools/AssetProcessor/native/utilities/assetUtils.cpp @@ -131,7 +131,7 @@ namespace AssetUtilsInternal } } } while (!timer.hasExpired(waitTimeInSeconds * 1000)); //We will keep retrying until the timer has expired the inputted timeout - + // once we're done, regardless of success or failure, we 'unlock' those files for further process. // if we failed, also re-trigger them to rebuild (the bool param at the end of the ebus call) QString normalized = AssetUtilities::NormalizeFilePath(outputFile); @@ -870,23 +870,27 @@ namespace AssetUtilities return true; } - QString StripAssetPlatform(AZStd::string_view relativeProductPath) + AZStd::string_view StripAssetPlatformNoCopy(AZStd::string_view relativeProductPath) { // Skip over the assetPlatform path segment if it is matches one of the platform defaults // Otherwise return the path unchanged - AZStd::string_view strippedProductPath{ relativeProductPath }; - if (AZStd::optional pathSegment = AZ::StringFunc::TokenizeNext(strippedProductPath, AZ_CORRECT_AND_WRONG_FILESYSTEM_SEPARATOR); - pathSegment.has_value()) + + AZStd::string_view originalPath = relativeProductPath; + AZStd::optional firstPathSegment = AZ::StringFunc::TokenizeNext(relativeProductPath, AZ_CORRECT_AND_WRONG_FILESYSTEM_SEPARATOR); + + if (firstPathSegment && AzFramework::PlatformHelper::GetPlatformIdFromName(*firstPathSegment) != AzFramework::PlatformId::Invalid) { - AZ::IO::FixedMaxPathString assetPlatformSegmentLower{ *pathSegment }; - AZStd::to_lower(assetPlatformSegmentLower.begin(), assetPlatformSegmentLower.end()); - if (AzFramework::PlatformHelper::GetPlatformIdFromName(assetPlatformSegmentLower) != AzFramework::PlatformId::Invalid) - { - return QString::fromUtf8(strippedProductPath.data(), aznumeric_cast(strippedProductPath.size())); - } + return relativeProductPath; } - return QString::fromUtf8(relativeProductPath.data(), aznumeric_cast(relativeProductPath.size())); + return originalPath; + } + + QString StripAssetPlatform(AZStd::string_view relativeProductPath) + { + AZStd::string_view result = StripAssetPlatformNoCopy(relativeProductPath); + + return QString::fromUtf8(result.data(), aznumeric_cast(result.size())); } QString NormalizeFilePath(const QString& filePath) diff --git a/Code/Tools/AssetProcessor/native/utilities/assetUtils.h b/Code/Tools/AssetProcessor/native/utilities/assetUtils.h index 46ec5d6145..18cf5422de 100644 --- a/Code/Tools/AssetProcessor/native/utilities/assetUtils.h +++ b/Code/Tools/AssetProcessor/native/utilities/assetUtils.h @@ -145,7 +145,7 @@ namespace AssetUtilities //! Strips the first "asset platform" from the first path segment of a relative product path //! This is meant for removing the asset platform for paths such as "pc/MyAssetFolder/MyAsset.asset" //! Therefore the result here becomes "MyAssetFolder/MyAsset" - //! + //! //! Similarly invoking this function on relative path that begins with the "server" platform //! "server/AssetFolder/Server.asset2" -> "AssetFolder/Server.asset2" //! This function does not strip an asset platform from anywhere, but the first path segment @@ -153,6 +153,10 @@ namespace AssetUtilities //! would return a copy of the relative path QString StripAssetPlatform(AZStd::string_view relativeProductPath); + //! Same as StripAssetPlatform, but does not perform any string copies + //! The return result is only valid for as long as the original input is valid + AZStd::string_view StripAssetPlatformNoCopy(AZStd::string_view relativeProductPath); + //! Converts all slashes to forward slashes, removes double slashes, //! replaces all indirections such as '.' or '..' as appropriate. //! On windows, the drive letter (if present) is converted to uppercase. From 1ed81ae973df283765def13b6f86cdbf5ec6ee52 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Thu, 13 Jan 2022 10:27:19 -0600 Subject: [PATCH 459/948] Added API for retrieving region of streaming image asset pixel values Signed-off-by: Chris Galvan --- .../RPI.Reflect/Image/StreamingImageAsset.h | 5 +- .../RPI.Reflect/Image/StreamingImageAsset.cpp | 48 +++++++++++++++---- 2 files changed, 42 insertions(+), 11 deletions(-) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h index bdb68601a9..e934ac8bcf 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h @@ -85,10 +85,13 @@ namespace AZ //! Get image data for specified mip and slice. It may return empty array if its mipchain assets are not loaded AZStd::array_view GetSubImageData(uint32_t mip, uint32_t slice); - //! Get image pixel value for specified mip and slice + //! Get single image pixel value for specified mip and slice template T GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); + //! Retrieve a region of image pixel values (float) for specified mip and slice + void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); + //! Returns streaming image pool asset id of the pool that will be used to create the streaming image. const Data::AssetId& GetPoolAssetId() const; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index 37f0e04116..e005fb7f9e 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -18,13 +18,19 @@ namespace AZ template float RetrieveFloatValue(const AZ::u8* mem, size_t index) { - AZ_Assert(false, "Unsupported pixel format"); + static_assert(false, "Unsupported pixel format"); } template AZ::u32 RetrieveUintValue(const AZ::u8* mem, size_t index) { - AZ_Assert(false, "Unsupported pixel format"); + static_assert(false, "Unsupported pixel format"); + } + + template + AZ::s32 RetrieveIntValue(const AZ::u8* mem, size_t index) + { + static_assert(false, "Unsupported pixel format"); } template <> @@ -216,6 +222,22 @@ namespace AZ template<> float StreamingImageAsset::GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) + { + AZStd::vector values; + auto position = AZStd::make_pair(x, y); + + GetSubImagePixelValues(position, position, values, componentIndex, mip, slice); + + if (values.size() == 1) + { + return values[0]; + } + + return 0.0f; + } + + template<> + AZ::u32 StreamingImageAsset::GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) { // TODO: Use the component index (void)componentIndex; @@ -228,14 +250,13 @@ namespace AZ auto width = imageDescriptor.m_size.m_width; size_t index = (y * width) + x; - return Internal::RetrieveFloatValue(imageData.data(), index, imageDescriptor.m_format); + return Internal::RetrieveUintValue(imageData.data(), index, imageDescriptor.m_format); } - return 0.0f; + return 0; } - template<> - AZ::u32 StreamingImageAsset::GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) + void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) { // TODO: Use the component index (void)componentIndex; @@ -246,12 +267,19 @@ namespace AZ { const AZ::RHI::ImageDescriptor imageDescriptor = GetImageDescriptor(); auto width = imageDescriptor.m_size.m_width; - size_t index = (y * width) + x; - return Internal::RetrieveUintValue(imageData.data(), index, imageDescriptor.m_format); + size_t outValuesIndex = 0; + for (uint32_t x = topLeft.first; x < bottomRight.first; ++x) + { + for (uint32_t y = topLeft.second; y < bottomRight.second; ++y) + { + size_t imageDataIndex = (y * width) + x; + + auto& outValue = const_cast(outValues[outValuesIndex++]); + outValue = Internal::RetrieveFloatValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); + } + } } - - return 0; } } } From 3f0bd9285372e41b3634b26aa9b342da9a527913 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Thu, 13 Jan 2022 10:28:58 -0600 Subject: [PATCH 460/948] Removed some unused EditorUtils functions Signed-off-by: Chris Galvan --- Code/Editor/Util/EditorUtils.cpp | 17 -- Code/Editor/Util/EditorUtils.h | 165 ------------------ .../Editor/Animation/Util/UiEditorUtils.cpp | 17 -- 3 files changed, 199 deletions(-) diff --git a/Code/Editor/Util/EditorUtils.cpp b/Code/Editor/Util/EditorUtils.cpp index adae34773a..47264a51ab 100644 --- a/Code/Editor/Util/EditorUtils.cpp +++ b/Code/Editor/Util/EditorUtils.cpp @@ -176,23 +176,6 @@ QString TrimTrailingZeros(QString str) return str; } -////////////////////////////////////////////////////////////////////////// -// This function is supposed to format float in user-friendly way, -// omitting the exponent notation. -// -// Why not using printf? Its formatting rules has following drawbacks: -// %g - will use exponent for small numbers; -// %.Nf - doesn't allow to control total amount of significant numbers, -// which exposes limited precision during binary-to-decimal fraction -// conversion. -////////////////////////////////////////////////////////////////////////// -void FormatFloatForUI(QString& str, int significantDigits, double value) -{ - str = TrimTrailingZeros(QString::number(value, 'f', significantDigits)); - return; -} -//////////////////////////////////////////////////////////////////////////- - ////////////////////////////////////////////////////////////////////////// QColor ColorLinearToGamma(ColorF col) { diff --git a/Code/Editor/Util/EditorUtils.h b/Code/Editor/Util/EditorUtils.h index e950d75012..5a69633d0f 100644 --- a/Code/Editor/Util/EditorUtils.h +++ b/Code/Editor/Util/EditorUtils.h @@ -212,22 +212,6 @@ namespace XmlHelpers ////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// -// Drag Drop helper functions -////////////////////////////////////////////////////////////////////////// -namespace EditorDragDropHelpers -{ - inline QString GetAnimationNameClipboardFormat() - { - return QStringLiteral("application/x-animation-browser-copy"); - } - - inline QString GetFragmentClipboardFormat() - { - return QStringLiteral("application/x-preview-fragment-properties"); - } -} - ////////////////////////////////////////////////////////////////////////// /*! @@ -292,116 +276,6 @@ public: } }; - -////////////////////////////////////////////////////////////////////////// -// -// Convert String representation of color to RGB integer value. -// -////////////////////////////////////////////////////////////////////////// -inline QColor String2Color(const QString& val) -{ - unsigned int r = 0, g = 0, b = 0; - int res = 0; - res = azsscanf(val.toUtf8().data(), "R:%d,G:%d,B:%d", &r, &g, &b); - if (res != 3) - { - res = azsscanf(val.toUtf8().data(), "R:%d G:%d B:%d", &r, &g, &b); - } - if (res != 3) - { - res = azsscanf(val.toUtf8().data(), "%d,%d,%d", &r, &g, &b); - } - if (res != 3) - { - res = azsscanf(val.toUtf8().data(), "%d %d %d", &r, &g, &b); - } - if (res != 3) - { - azsscanf(val.toUtf8().data(), "%x", &r); - return r; - } - - return QColor(r, g, b); -} - -// Converts QColor to Vector. -inline Vec3 Rgb2Vec(const QColor& color) -{ - return Vec3(aznumeric_cast(color.redF()), aznumeric_cast(color.greenF()), aznumeric_cast(color.blueF())); -} - -// Converts QColor to ColorF. -inline ColorF Rgb2ColorF(const QColor& color) -{ - return ColorF(aznumeric_cast(color.redF()), aznumeric_cast(color.greenF()), aznumeric_cast(color.blueF()), 1.0f); -} - -// Converts QColor to Vector. -inline QColor Vec2Rgb(const Vec3& color) -{ - return QColor(aznumeric_cast(color.x * 255), aznumeric_cast(color.y * 255), aznumeric_cast(color.z * 255)); -} - -// Converts ColorF to QColor. -inline QColor ColorF2Rgb(const ColorF& color) -{ - return QColor(aznumeric_cast(color.r * 255), aznumeric_cast(color.g * 255), aznumeric_cast(color.b * 255)); -} - -////////////////////////////////////////////////////////////////////////// -// Tokenize string. -////////////////////////////////////////////////////////////////////////// -inline QString TokenizeString(const QString& s, LPCSTR pszTokens, int& iStart) -{ - assert(iStart >= 0); - - QByteArray str = s.toUtf8(); - - if (pszTokens == nullptr) - { - return str; - } - - auto pszPlace = str.begin() + iStart; - auto pszEnd = str.end(); - if (pszPlace < pszEnd) - { - int nIncluding = (int)strspn(pszPlace, pszTokens); - ; - - if ((pszPlace + nIncluding) < pszEnd) - { - pszPlace += nIncluding; - int nExcluding = (int)strcspn(pszPlace, pszTokens); - - int iFrom = iStart + nIncluding; - int nUntil = nExcluding; - iStart = iFrom + nUntil + 1; - - return (str.mid(iFrom, nUntil)); - } - } - - // return empty string, done tokenizing - iStart = -1; - return ""; -} - -// This template function will join strings from a vector into a single string, using a separator char -template -inline void JoinStrings(const QList& rStrings, QString& rDestStr, char aSeparator = ',') -{ - for (size_t i = 0, iCount = rStrings.size(); i < iCount; ++i) - { - rDestStr += rStrings[i]; - - if (i < iCount - 1) - { - rDestStr += aSeparator; - } - } -} - // This function will split a string containing separated strings, into a vector of strings // better version of TokenizeString inline void SplitString(const QString& rSrcStr, QStringList& rDestStrings, char aSeparator = ',') @@ -435,45 +309,6 @@ inline void SplitString(const QString& rSrcStr, QStringList& rDestStrings, char } } -// Format unsigned number to string with 1000s separator -inline QString FormatWithThousandsSeperator(const unsigned int number) -{ - QString string; - - string = QString::number(number); - - for (int p = string.length() - 3; p > 0; p -= 3) - { - string.insert(p, ','); - } - - return string; -} - - -void FormatFloatForUI(QString& str, int significantDigits, double value); - -////////////////////////////////////////////////////////////////////////// -// Simply sub string searching case insensitive. -////////////////////////////////////////////////////////////////////////// -inline const char* strstri(const char* pString, const char* pSubstring) -{ - int i, j, k; - for (i = 0; pString[i]; i++) - { - for (j = i, k = 0; tolower(pString[j]) == tolower(pSubstring[k]); j++, k++) - { - if (!pSubstring[k + 1]) - { - return (pString + i); - } - } - } - - return nullptr; -} - - inline bool CheckVirtualKey(Qt::MouseButton button) { return (qApp->property("pressedMouseButtons").toInt() & button) != 0; diff --git a/Gems/LyShine/Code/Editor/Animation/Util/UiEditorUtils.cpp b/Gems/LyShine/Code/Editor/Animation/Util/UiEditorUtils.cpp index 41f7300002..85270df355 100644 --- a/Gems/LyShine/Code/Editor/Animation/Util/UiEditorUtils.cpp +++ b/Gems/LyShine/Code/Editor/Animation/Util/UiEditorUtils.cpp @@ -92,23 +92,6 @@ QString TrimTrailingZeros(QString str) return str; } -////////////////////////////////////////////////////////////////////////// -// This function is supposed to format float in user-friendly way, -// omitting the exponent notation. -// -// Why not using printf? Its formatting rules has following drawbacks: -// %g - will use exponent for small numbers; -// %.Nf - doesn't allow to control total amount of significant numbers, -// which exposes limited precision during binary-to-decimal fraction -// conversion. -////////////////////////////////////////////////////////////////////////// -void FormatFloatForUI(QString& str, int significantDigits, double value) -{ - str = TrimTrailingZeros(QString::number(value, 'f', significantDigits)); - return; -} -//////////////////////////////////////////////////////////////////////////- - ////////////////////////////////////////////////////////////////////////// QColor ColorLinearToGamma(ColorF col) { From 2048d8c05c7e34d6ad5823640ab29ed4a5498449 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Thu, 13 Jan 2022 11:38:16 -0600 Subject: [PATCH 461/948] Added region-based APIs for uint and int Signed-off-by: Chris Galvan --- .../RPI.Reflect/Image/StreamingImageAsset.h | 9 ++ .../RPI.Reflect/Image/StreamingImageAsset.cpp | 109 +++++++++++++++--- 2 files changed, 101 insertions(+), 17 deletions(-) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h index e934ac8bcf..f4dc891ff2 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h @@ -92,6 +92,12 @@ namespace AZ //! Retrieve a region of image pixel values (float) for specified mip and slice void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); + //! Retrieve a region of image pixel values (uint) for specified mip and slice + void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); + + //! Retrieve a region of image pixel values (int) for specified mip and slice + void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); + //! Returns streaming image pool asset id of the pool that will be used to create the streaming image. const Data::AssetId& GetPoolAssetId() const; @@ -134,6 +140,9 @@ namespace AZ uint32_t m_totalImageDataSize = 0; StreamingImageFlags m_flags = StreamingImageFlags::None; + + template + T GetSubImagePixelValueInternal(uint32_t x, uint32_t y, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); }; } } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index e005fb7f9e..e21dd1f2c5 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -45,6 +45,12 @@ namespace AZ return 0; } + template <> + AZ::s32 RetrieveIntValue([[maybe_unused]] const AZ::u8* mem, [[maybe_unused]] size_t index) + { + return 0; + } + template <> AZ::u32 RetrieveUintValue(const AZ::u8* mem, size_t index) { @@ -56,19 +62,27 @@ namespace AZ { // 16 bits per channel auto actualMem = reinterpret_cast(mem); - actualMem += index; - return *actualMem / static_cast(std::numeric_limits::max()); + return actualMem[index] / static_cast(std::numeric_limits::max()); } template <> - AZ::u32 RetrieveUintValue(const AZ::u8* mem, size_t index) + AZ::s32 RetrieveIntValue(const AZ::u8* mem, size_t index) + { + // 16 bits per channel + auto actualMem = reinterpret_cast(mem); + + return actualMem[index] / static_cast(std::numeric_limits::max()); + } + + template <> + float RetrieveFloatValue(const AZ::u8* mem, size_t index) { // 32 bits per channel - auto actualMem = reinterpret_cast(mem); + auto actualMem = reinterpret_cast(mem); actualMem += index; - return *actualMem / static_cast(std::numeric_limits::max()); + return *actualMem; } template <> @@ -85,6 +99,8 @@ namespace AZ { switch (format) { + case AZ::RHI::Format::R32_UINT: + return RetrieveFloatValue(mem, index); case AZ::RHI::Format::R32_FLOAT: return RetrieveFloatValue(mem, index); default: @@ -100,12 +116,21 @@ namespace AZ return RetrieveUintValue(mem, index); case AZ::RHI::Format::R16_UNORM: return RetrieveUintValue(mem, index); - case AZ::RHI::Format::R32_UINT: - return RetrieveUintValue(mem, index); default: return RetrieveUintValue(mem, index); } } + + AZ::s32 RetrieveIntValue(const AZ::u8* mem, size_t index, AZ::RHI::Format format) + { + switch (format) + { + case AZ::RHI::Format::R16_SINT: + return RetrieveIntValue(mem, index); + default: + return RetrieveIntValue(mem, index); + } + } } namespace RPI @@ -220,10 +245,10 @@ namespace AZ return mipChainAsset->GetSubImageData(mip - mipChain.m_mipOffset, slice); } - template<> - float StreamingImageAsset::GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) + template + T StreamingImageAsset::GetSubImagePixelValueInternal(uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) { - AZStd::vector values; + AZStd::vector values; auto position = AZStd::make_pair(x, y); GetSubImagePixelValues(position, position, values, componentIndex, mip, slice); @@ -233,11 +258,28 @@ namespace AZ return values[0]; } - return 0.0f; + return aznumeric_cast(0); + } + + template<> + float StreamingImageAsset::GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) + { + return GetSubImagePixelValueInternal(x, y, componentIndex, mip, slice); } template<> AZ::u32 StreamingImageAsset::GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) + { + return GetSubImagePixelValueInternal(x, y, componentIndex, mip, slice); + } + + template<> + AZ::s32 StreamingImageAsset::GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) + { + return GetSubImagePixelValueInternal(x, y, componentIndex, mip, slice); + } + + void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) { // TODO: Use the component index (void)componentIndex; @@ -248,15 +290,48 @@ namespace AZ { const AZ::RHI::ImageDescriptor imageDescriptor = GetImageDescriptor(); auto width = imageDescriptor.m_size.m_width; - size_t index = (y * width) + x; - return Internal::RetrieveUintValue(imageData.data(), index, imageDescriptor.m_format); + size_t outValuesIndex = 0; + for (uint32_t x = topLeft.first; x < bottomRight.first; ++x) + { + for (uint32_t y = topLeft.second; y < bottomRight.second; ++y) + { + size_t imageDataIndex = (y * width) + x; + + auto& outValue = const_cast(outValues[outValuesIndex++]); + outValue = Internal::RetrieveFloatValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); + } + } } + } - return 0; + void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) + { + // TODO: Use the component index + (void)componentIndex; + + auto imageData = GetSubImageData(mip, slice); + + if (!imageData.empty()) + { + const AZ::RHI::ImageDescriptor imageDescriptor = GetImageDescriptor(); + auto width = imageDescriptor.m_size.m_width; + + size_t outValuesIndex = 0; + for (uint32_t x = topLeft.first; x < bottomRight.first; ++x) + { + for (uint32_t y = topLeft.second; y < bottomRight.second; ++y) + { + size_t imageDataIndex = (y * width) + x; + + auto& outValue = const_cast(outValues[outValuesIndex++]); + outValue = Internal::RetrieveUintValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); + } + } + } } - void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) + void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) { // TODO: Use the component index (void)componentIndex; @@ -275,8 +350,8 @@ namespace AZ { size_t imageDataIndex = (y * width) + x; - auto& outValue = const_cast(outValues[outValuesIndex++]); - outValue = Internal::RetrieveFloatValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); + auto& outValue = const_cast(outValues[outValuesIndex++]); + outValue = Internal::RetrieveIntValue(imageData.data(), imageDataIndex, imageDescriptor.m_format); } } } From 62e7483b0e7a025369c09fcd92bcf326ea71a131 Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Thu, 13 Jan 2022 14:44:59 -0600 Subject: [PATCH 462/948] Switched GradientSignal to use GemTestEnvironment. (#6886) This allows actual Shape components to be used instead of MockShapes, which is important for the benchmarks to get accurate results as Mocks are extremely expensive. It also removes a lot of unnecessary mock handling and test setup code. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- .../EditorGradientSignalPreviewTests.cpp | 38 +++-- .../Code/Tests/GradientSignalImageTests.cpp | 31 ++-- .../Tests/GradientSignalReferencesTests.cpp | 38 ++--- .../Tests/GradientSignalServicesTests.cpp | 10 +- .../Code/Tests/GradientSignalSurfaceTests.cpp | 10 +- .../Code/Tests/GradientSignalTest.cpp | 47 +++--- .../Code/Tests/GradientSignalTestFixtures.cpp | 134 ++++++++---------- .../Code/Tests/GradientSignalTestFixtures.h | 84 +++++------ .../Code/Tests/ImageAssetTests.cpp | 21 +-- 9 files changed, 193 insertions(+), 220 deletions(-) diff --git a/Gems/GradientSignal/Code/Tests/EditorGradientSignalPreviewTests.cpp b/Gems/GradientSignal/Code/Tests/EditorGradientSignalPreviewTests.cpp index e8bd9f2dff..83892f1c69 100644 --- a/Gems/GradientSignal/Code/Tests/EditorGradientSignalPreviewTests.cpp +++ b/Gems/GradientSignal/Code/Tests/EditorGradientSignalPreviewTests.cpp @@ -29,21 +29,34 @@ namespace UnitTest { GradientSignalTest::SetUp(); - // Set up job manager with two threads so that we can run and test the preview job logic. - AZ::JobManagerDesc desc; - AZ::JobManagerThreadDesc threadDesc; - desc.m_workerThreads.push_back(threadDesc); - desc.m_workerThreads.push_back(threadDesc); - m_jobManager = aznew AZ::JobManager(desc); - m_jobContext = aznew AZ::JobContext(*m_jobManager); - AZ::JobContext::SetGlobalContext(m_jobContext); + auto globalContext = AZ::JobContext::GetGlobalContext(); + if (globalContext) + { + AZ_Assert( + globalContext->GetJobManager().GetNumWorkerThreads() >= 2, + "Job Manager previously started by test environment with too few threads for this test."); + } + else + { + // Set up job manager with two threads so that we can run and test the preview job logic. + AZ::JobManagerDesc desc; + AZ::JobManagerThreadDesc threadDesc; + desc.m_workerThreads.push_back(threadDesc); + desc.m_workerThreads.push_back(threadDesc); + m_jobManager = aznew AZ::JobManager(desc); + m_jobContext = aznew AZ::JobContext(*m_jobManager); + AZ::JobContext::SetGlobalContext(m_jobContext); + } } void TearDown() override { - AZ::JobContext::SetGlobalContext(nullptr); - delete m_jobContext; - delete m_jobManager; + if (m_jobContext) + { + AZ::JobContext::SetGlobalContext(nullptr); + delete m_jobContext; + delete m_jobManager; + } GradientSignalTest::TearDown(); } @@ -180,4 +193,5 @@ namespace UnitTest } } -AZ_UNIT_TEST_HOOK(DEFAULT_UNIT_TEST_ENV); +// This uses a custom test hook so that we can load LmbrCentral and use Shape components in our unit tests. +AZ_UNIT_TEST_HOOK(new UnitTest::GradientSignalTestEnvironment); diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalImageTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalImageTests.cpp index 5cd3c7edf6..8ec190000d 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalImageTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalImageTests.cpp @@ -14,10 +14,13 @@ #include #include #include +#include #include #include +#include + namespace UnitTest { struct GradientSignalImageTestsFixture @@ -89,23 +92,21 @@ namespace UnitTest test.m_imageSize, test.m_imageSize, static_cast(test.m_pixel.GetX()), static_cast(test.m_pixel.GetY())); config.m_tilingX = test.m_tiling; config.m_tilingY = test.m_tiling; - CreateComponent(entity.get(), config); + entity->CreateComponent(config); // Create the Gradient Transform Component. GradientSignal::GradientTransformConfig gradientTransformConfig; gradientTransformConfig.m_wrappingType = test.m_wrappingType; - CreateComponent(entity.get(), gradientTransformConfig); + entity->CreateComponent(gradientTransformConfig); - // Create a mock Shape component that describes the bounds that we're using to map our ImageGradient into world space. - CreateComponent(entity.get()); - MockShapeComponentHandler mockShapeHandler(entity->GetId()); - mockShapeHandler.m_GetLocalBounds = AZ::Aabb::CreateCenterRadius(AZ::Vector3(shapeHalfBounds), shapeHalfBounds); + LmbrCentral::BoxShapeConfig boxConfig(AZ::Vector3(shapeHalfBounds * 2.0f)); + auto boxComponent = entity->CreateComponent(LmbrCentral::AxisAlignedBoxShapeComponentTypeId); + boxComponent->SetConfiguration(boxConfig); - // Create a mock Transform component that locates our ImageGradient in the center of our desired mock Shape. - MockTransformHandler mockTransformHandler; - mockTransformHandler.m_GetLocalTMOutput = AZ::Transform::CreateTranslation(AZ::Vector3(shapeHalfBounds)); - mockTransformHandler.m_GetWorldTMOutput = AZ::Transform::CreateTranslation(AZ::Vector3(shapeHalfBounds)); - mockTransformHandler.BusConnect(entity->GetId()); + // Create a transform that locates our gradient in the center of our desired mock Shape. + auto transform = entity->CreateComponent(); + transform->SetLocalTM(AZ::Transform::CreateTranslation(AZ::Vector3(shapeHalfBounds))); + transform->SetWorldTM(AZ::Transform::CreateTranslation(AZ::Vector3(shapeHalfBounds))); // All components are created, so activate the entity ActivateEntity(entity.get()); @@ -365,7 +366,7 @@ namespace UnitTest mockShapeTransformHandler.BusConnect(mockShape->GetId()); // Create the mock shape that maps our 3x3 image to a 3x3 sample space in the world. - CreateComponent(mockShape.get()); + mockShape->CreateComponent(); MockShapeComponentHandler mockShapeComponentHandler(mockShape->GetId()); // Create a 2x2 box shape (shapes are inclusive, so that's 3x3 sampling space), so that each pixel in the image directly maps to 1 meter in the box. mockShapeComponentHandler.m_GetEncompassingAabb = AZ::Aabb::CreateFromMinMax(AZ::Vector3(0.0f), AZ::Vector3(2.0f)); @@ -379,7 +380,7 @@ namespace UnitTest // Create an ImageGradient with a 3x3 asset with the center pixel set. GradientSignal::ImageGradientConfig gradientConfig; gradientConfig.m_imageAsset = ImageAssetMockAssetHandler::CreateSpecificPixelImageAsset(3, 3, 1, 1); - CreateComponent(entity.get(), gradientConfig); + entity->CreateComponent(gradientConfig); // Create the test GradientTransform GradientSignal::GradientTransformConfig config; @@ -400,7 +401,7 @@ namespace UnitTest config.m_overrideRotate = false; config.m_overrideScale = false; config.m_is3d = false; - CreateComponent(entity.get(), config); + entity->CreateComponent(config); // Set up the transform on the gradient entity. MockTransformHandler mockTransformHandler; @@ -409,7 +410,7 @@ namespace UnitTest mockTransformHandler.BusConnect(entity->GetId()); // Put a default shape on our gradient entity. This is only used for previews, so it doesn't matter what it gets set to. - CreateComponent(entity.get()); + entity->CreateComponent(); MockShapeComponentHandler mockShapeHandler(entity->GetId()); ActivateEntity(entity.get()); diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalReferencesTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalReferencesTests.cpp index cc91c58fce..72bdfa202e 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalReferencesTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalReferencesTests.cpp @@ -55,7 +55,7 @@ namespace UnitTest config.m_layers.push_back(layer); auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); @@ -88,7 +88,7 @@ namespace UnitTest config.m_smoothStep.m_falloffStrength = falloffStrength; auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); @@ -391,7 +391,7 @@ namespace UnitTest GradientSignal::ReferenceGradientConfig referenceGradientConfig1; referenceGradientConfig1.m_gradientSampler.m_ownerEntityId = referenceGradientEntity1->GetId(); referenceGradientConfig1.m_gradientSampler.m_gradientId = constantGradientEntity->GetId(); - CreateComponent(referenceGradientEntity1.get(), referenceGradientConfig1); + referenceGradientEntity1->CreateComponent(referenceGradientConfig1); ActivateEntity(referenceGradientEntity1.get()); EXPECT_TRUE(referenceGradientConfig1.m_gradientSampler.ValidateGradientEntityId()); @@ -400,7 +400,7 @@ namespace UnitTest GradientSignal::ReferenceGradientConfig referenceGradientConfig2; referenceGradientConfig2.m_gradientSampler.m_ownerEntityId = referenceGradientEntity2->GetId(); referenceGradientConfig2.m_gradientSampler.m_gradientId = referenceGradientEntity1->GetId(); - CreateComponent(referenceGradientEntity2.get(), referenceGradientConfig2); + referenceGradientEntity2->CreateComponent(referenceGradientConfig2); ActivateEntity(referenceGradientEntity2.get()); EXPECT_TRUE(referenceGradientConfig2.m_gradientSampler.ValidateGradientEntityId()); @@ -409,7 +409,7 @@ namespace UnitTest GradientSignal::ReferenceGradientConfig referenceGradientConfig3; referenceGradientConfig3.m_gradientSampler.m_ownerEntityId = referenceGradientEntity3->GetId(); referenceGradientConfig3.m_gradientSampler.m_gradientId = referenceGradientEntity3->GetId(); - CreateComponent(referenceGradientEntity3.get(), referenceGradientConfig3); + referenceGradientEntity3->CreateComponent(referenceGradientConfig3); ActivateEntity(referenceGradientEntity3.get()); EXPECT_FALSE(referenceGradientConfig3.m_gradientSampler.ValidateGradientEntityId()); EXPECT_EQ(referenceGradientConfig3.m_gradientSampler.m_gradientId, AZ::EntityId()); @@ -422,19 +422,19 @@ namespace UnitTest GradientSignal::ReferenceGradientConfig referenceGradientConfig4; referenceGradientConfig4.m_gradientSampler.m_ownerEntityId = referenceGradientEntity4->GetId(); referenceGradientConfig4.m_gradientSampler.m_gradientId = referenceGradientEntity5->GetId(); - CreateComponent(referenceGradientEntity4.get(), referenceGradientConfig4); + referenceGradientEntity4->CreateComponent(referenceGradientConfig4); ActivateEntity(referenceGradientEntity4.get()); GradientSignal::ReferenceGradientConfig referenceGradientConfig5; referenceGradientConfig5.m_gradientSampler.m_ownerEntityId = referenceGradientEntity5->GetId(); referenceGradientConfig5.m_gradientSampler.m_gradientId = referenceGradientEntity6->GetId(); - CreateComponent(referenceGradientEntity5.get(), referenceGradientConfig5); + referenceGradientEntity5->CreateComponent(referenceGradientConfig5); ActivateEntity(referenceGradientEntity5.get()); GradientSignal::ReferenceGradientConfig referenceGradientConfig6; referenceGradientConfig6.m_gradientSampler.m_ownerEntityId = referenceGradientEntity6->GetId(); referenceGradientConfig6.m_gradientSampler.m_gradientId = referenceGradientEntity4->GetId(); - CreateComponent(referenceGradientEntity6.get(), referenceGradientConfig6); + referenceGradientEntity6->CreateComponent(referenceGradientConfig6); ActivateEntity(referenceGradientEntity6.get()); EXPECT_FALSE(referenceGradientConfig6.m_gradientSampler.ValidateGradientEntityId()); @@ -456,7 +456,7 @@ namespace UnitTest // Create an AABB from -1 to 1, so points at coorindates 0 and 1 fall on it, but any points at coordinate 2 won't. auto entityShape = CreateEntity(); - CreateComponent(entityShape.get()); + entityShape->CreateComponent(); MockShapeComponentHandler mockShapeComponentHandler(entityShape->GetId()); mockShapeComponentHandler.m_GetEncompassingAabb = AZ::Aabb::CreateFromMinMax(AZ::Vector3(-1.0f), AZ::Vector3(1.0f)); @@ -466,7 +466,7 @@ namespace UnitTest config.m_falloffType = GradientSignal::FalloffType::Outer; auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); @@ -481,7 +481,7 @@ namespace UnitTest // Create our test shape from -1 to 0, so we have a corner directly on (0, 0). auto entityShape = CreateEntity(); - CreateComponent(entityShape.get()); + entityShape->CreateComponent(); MockShapeComponentHandler mockShapeComponentHandler(entityShape->GetId()); mockShapeComponentHandler.m_GetEncompassingAabb = AZ::Aabb::CreateFromMinMax(AZ::Vector3(-1.0f), AZ::Vector3(0.0f)); @@ -512,7 +512,7 @@ namespace UnitTest } auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); @@ -533,7 +533,7 @@ namespace UnitTest // We're pinning a shape, so the bounding box of (0, 0, 0) - (10, 10, 10) will be the one that applies. auto entityShape = CreateEntity(); - CreateComponent(entityShape.get()); + entityShape->CreateComponent(); MockShapeComponentHandler mockShapeComponentHandler(entityShape->GetId()); mockShapeComponentHandler.m_GetEncompassingAabb = AZ::Aabb::CreateFromMinMax(AZ::Vector3::CreateZero(), AZ::Vector3(10.0f)); @@ -551,7 +551,7 @@ namespace UnitTest config.m_altitudeMax = 24.0f; auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); @@ -584,7 +584,7 @@ namespace UnitTest config.m_altitudeMax = 10.0f; auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); @@ -612,7 +612,7 @@ namespace UnitTest config.m_altitudeMax = 15.0f; auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); @@ -649,7 +649,7 @@ namespace UnitTest config.m_altitudeMax = 15.0f; auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); @@ -684,7 +684,7 @@ namespace UnitTest config.m_surfaceTagList.push_back(AZ_CRC("test_mask", 0x7a16e9ff)); auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); @@ -711,7 +711,7 @@ namespace UnitTest config.m_surfaceTagList.push_back(AZ_CRC("test_mask", 0x7a16e9ff)); auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp index ec770f038d..449719af67 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp @@ -31,7 +31,7 @@ namespace UnitTest config.m_value = expectedOutput; auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); GradientSignal::GradientSampler gradientSampler; @@ -75,7 +75,7 @@ namespace UnitTest config.m_gradientSampler.m_gradientId = entityMock->GetId(); auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); @@ -109,7 +109,7 @@ namespace UnitTest config.m_gradientSampler.m_gradientId = entityMock->GetId(); auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); @@ -147,7 +147,7 @@ namespace UnitTest config.m_gradientSampler.m_gradientId = entityMock->GetId(); auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); @@ -185,7 +185,7 @@ namespace UnitTest config.m_gradientSampler.m_gradientId = entityMock->GetId(); auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalSurfaceTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalSurfaceTests.cpp index 702965c0de..a716fc79b8 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalSurfaceTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalSurfaceTests.cpp @@ -44,11 +44,9 @@ namespace UnitTest // This lets our component register with surfaceData successfully. MockSurfaceDataSystem mockSurfaceDataSystem; - // Create a mock shape entity in case we want to use it. + // Create a mock shape entity in case our gradient test uses shape constraints. // The mock shape is a cube that goes from -0.5 to 0.5 in space. - auto mockShapeEntity = CreateEntity(); - CreateComponent(mockShapeEntity.get()); - MockShapeComponentHandler mockShapeHandler(mockShapeEntity->GetId()); + auto mockShapeEntity = CreateTestEntity(0.5f); ActivateEntity(mockShapeEntity.get()); // For ease of testing, use a constant gradient as our input gradient. @@ -76,8 +74,8 @@ namespace UnitTest // Create the test entity with the GradientSurfaceData component and the required gradient dependency auto entity = CreateEntity(); - CreateComponent(entity.get(), constantGradientConfig); - CreateComponent(entity.get(), config); + entity->CreateComponent(constantGradientConfig); + entity->CreateComponent(config); ActivateEntity(entity.get()); // Get our registered modifier handle (and verify that it's valid) diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalTest.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalTest.cpp index adc35e6738..13e535e072 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalTest.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalTest.cpp @@ -27,14 +27,12 @@ namespace UnitTest void TestLevelsGradientComponent(int dataSize, const AZStd::vector& inputData, const AZStd::vector& expectedOutput, float inputMin, float inputMid, float inputMax, float outputMin, float outputMax) { - auto entityMock = CreateEntity(); + auto entityMock = CreateTestEntity(1.0f); const AZ::EntityId id = entityMock->GetId(); UnitTest::MockGradientArrayRequestsBus mockGradientRequestsBus(id, inputData, dataSize); GradientSignal::GradientTransformConfig gradientTransformConfig; - CreateComponent(entityMock.get(), gradientTransformConfig); - CreateComponent(entityMock.get()); - MockShapeComponentHandler mockShapeHandler(entityMock->GetId()); + entityMock->CreateComponent(gradientTransformConfig); ActivateEntity(entityMock.get()); @@ -47,7 +45,7 @@ namespace UnitTest config.m_outputMax = outputMax; auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); @@ -56,14 +54,12 @@ namespace UnitTest void TestPosterizeGradientComponent(int dataSize, const AZStd::vector& inputData, const AZStd::vector& expectedOutput, GradientSignal::PosterizeGradientConfig::ModeType posterizeMode, int bands) { - auto entityMock = CreateEntity(); + auto entityMock = CreateTestEntity(0.5f); const AZ::EntityId id = entityMock->GetId(); UnitTest::MockGradientArrayRequestsBus mockGradientRequestsBus(id, inputData, dataSize); GradientSignal::GradientTransformConfig gradientTransformConfig; - CreateComponent(entityMock.get(), gradientTransformConfig); - CreateComponent(entityMock.get()); - MockShapeComponentHandler mockShapeHandler(entityMock->GetId()); + entityMock->CreateComponent(gradientTransformConfig); ActivateEntity(entityMock.get()); @@ -73,7 +69,7 @@ namespace UnitTest config.m_bands = bands; auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); @@ -82,14 +78,12 @@ namespace UnitTest void TestSmoothStepGradientComponent(int dataSize, const AZStd::vector& inputData, const AZStd::vector& expectedOutput, float midpoint, float range, float softness) { - auto entityMock = CreateEntity(); + auto entityMock = CreateTestEntity(0.5f); const AZ::EntityId id = entityMock->GetId(); UnitTest::MockGradientArrayRequestsBus mockGradientRequestsBus(id, inputData, dataSize); GradientSignal::GradientTransformConfig gradientTransformConfig; - CreateComponent(entityMock.get(), gradientTransformConfig); - CreateComponent(entityMock.get()); - MockShapeComponentHandler mockShapeHandler(entityMock->GetId()); + entityMock->CreateComponent(gradientTransformConfig); ActivateEntity(entityMock.get()); @@ -100,7 +94,7 @@ namespace UnitTest config.m_smoothStep.m_falloffStrength = softness; auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); @@ -108,14 +102,12 @@ namespace UnitTest void TestThresholdGradientComponent(int dataSize, const AZStd::vector& inputData, const AZStd::vector& expectedOutput, float threshold) { - auto entityMock = CreateEntity(); + auto entityMock = CreateTestEntity(0.5f); const AZ::EntityId id = entityMock->GetId(); UnitTest::MockGradientArrayRequestsBus mockGradientRequestsBus(id, inputData, dataSize); GradientSignal::GradientTransformConfig gradientTransformConfig; - CreateComponent(entityMock.get(), gradientTransformConfig); - CreateComponent(entityMock.get()); - MockShapeComponentHandler mockShapeHandler(entityMock->GetId()); + entityMock->CreateComponent(gradientTransformConfig); ActivateEntity(entityMock.get()); @@ -124,7 +116,7 @@ namespace UnitTest config.m_threshold = threshold; auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); @@ -167,11 +159,11 @@ namespace UnitTest AZStd::vector expectedOutput = { AZ_TRAIT_UNIT_TEST_PERLINE_GRADIANT_GOLDEN_VALUES_7878 }; auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); GradientSignal::GradientTransformConfig gradientTransformConfig; - CreateComponent(entity.get(), gradientTransformConfig); - CreateComponent(entity.get()); + entity->CreateComponent(gradientTransformConfig); + entity->CreateComponent(); MockShapeComponentHandler mockShapeHandler(entity->GetId()); ActivateEntity(entity.get()); @@ -197,11 +189,11 @@ namespace UnitTest config.m_randomSeed = 5656; auto entity = CreateEntity(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); GradientSignal::GradientTransformConfig gradientTransformConfig; - CreateComponent(entity.get(), gradientTransformConfig); - CreateComponent(entity.get()); + entity->CreateComponent(gradientTransformConfig); + entity->CreateComponent(); MockShapeComponentHandler mockShapeHandler(entity->GetId()); ActivateEntity(entity.get()); @@ -546,4 +538,5 @@ namespace UnitTest } } -AZ_UNIT_TEST_HOOK(DEFAULT_UNIT_TEST_ENV); +// This uses custom test / benchmark hooks so that we can load LmbrCentral and use Shape components in our unit tests and benchmarks. +AZ_UNIT_TEST_HOOK(new UnitTest::GradientSignalTestEnvironment, UnitTest::GradientSignalBenchmarkEnvironment); diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.cpp index 154e9032b2..d81370f6a8 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.cpp @@ -10,7 +10,9 @@ #include #include +#include #include +#include // Base gradient components #include @@ -36,65 +38,48 @@ namespace UnitTest { - void GradientSignalBaseFixture::SetupCoreSystems() + void GradientSignalTestEnvironment::AddGemsAndComponents() { - m_app = AZStd::make_unique(); - ASSERT_TRUE(m_app != nullptr); - - AZ::ComponentApplication::Descriptor componentAppDesc; - - m_systemEntity = m_app->Create(componentAppDesc); - ASSERT_TRUE(m_systemEntity != nullptr); - m_app->AddEntity(m_systemEntity); + AddDynamicModulePaths({ "LmbrCentral" }); + + AddComponentDescriptors({ + AzFramework::TransformComponent::CreateDescriptor(), + + GradientSignal::ConstantGradientComponent::CreateDescriptor(), + GradientSignal::DitherGradientComponent::CreateDescriptor(), + GradientSignal::GradientSurfaceDataComponent::CreateDescriptor(), + GradientSignal::GradientTransformComponent::CreateDescriptor(), + GradientSignal::ImageGradientComponent::CreateDescriptor(), + GradientSignal::InvertGradientComponent::CreateDescriptor(), + GradientSignal::LevelsGradientComponent::CreateDescriptor(), + GradientSignal::MixedGradientComponent::CreateDescriptor(), + GradientSignal::PerlinGradientComponent::CreateDescriptor(), + GradientSignal::PosterizeGradientComponent::CreateDescriptor(), + GradientSignal::RandomGradientComponent::CreateDescriptor(), + GradientSignal::ReferenceGradientComponent::CreateDescriptor(), + GradientSignal::ShapeAreaFalloffGradientComponent::CreateDescriptor(), + GradientSignal::SmoothStepGradientComponent::CreateDescriptor(), + GradientSignal::SurfaceAltitudeGradientComponent::CreateDescriptor(), + GradientSignal::SurfaceMaskGradientComponent::CreateDescriptor(), + GradientSignal::SurfaceSlopeGradientComponent::CreateDescriptor(), + GradientSignal::ThresholdGradientComponent::CreateDescriptor(), + + MockShapeComponent::CreateDescriptor(), + }); + } - AZ::AllocatorInstance::Create(); - AZ::Data::AssetManager::Descriptor desc; - AZ::Data::AssetManager::Create(desc); - m_mockHandler = new ImageAssetMockAssetHandler(); + void GradientSignalBaseFixture::SetupCoreSystems() + { + m_mockHandler = new UnitTest::ImageAssetMockAssetHandler(); AZ::Data::AssetManager::Instance().RegisterHandler(m_mockHandler, azrtti_typeid()); - - m_mockShapeHandlers = new AZStd::vector>>(); } void GradientSignalBaseFixture::TearDownCoreSystems() { - // Clear any mock shape handlers that we've created for our test entities. - delete m_mockShapeHandlers; - AZ::Data::AssetManager::Instance().UnregisterHandler(m_mockHandler); delete m_mockHandler; // delete after removing from the asset manager AzFramework::LegacyAssetEventBus::ClearQueuedEvents(); - AZ::Data::AssetManager::Destroy(); - AZ::AllocatorInstance::Destroy(); - - m_app->Destroy(); - m_app.reset(); - m_systemEntity = nullptr; - } - - AZStd::unique_ptr> GradientSignalBaseFixture::CreateMockShape( - const AZ::Aabb& spawnerBox, const AZ::EntityId& shapeEntityId) - { - AZStd::unique_ptr> mockShape = - AZStd::make_unique>(shapeEntityId); - - ON_CALL(*mockShape, GetEncompassingAabb).WillByDefault(testing::Return(spawnerBox)); - ON_CALL(*mockShape, GetTransformAndLocalBounds) - .WillByDefault( - [spawnerBox](AZ::Transform& transform, AZ::Aabb& bounds) - { - transform = AZ::Transform::CreateTranslation(spawnerBox.GetCenter()); - bounds = spawnerBox.GetTranslated(-spawnerBox.GetCenter()); - }); - ON_CALL(*mockShape, IsPointInside) - .WillByDefault( - [spawnerBox](const AZ::Vector3& point) -> bool - { - return spawnerBox.Contains(point); - }); - - return mockShape; } AZStd::unique_ptr GradientSignalBaseFixture::CreateMockSurfaceDataSystem(const AZ::Aabb& spawnerBox) @@ -130,16 +115,12 @@ namespace UnitTest // Create the base entity AZStd::unique_ptr testEntity = CreateEntity(); - // Create a mock Shape component that describes the bounds that we're using to map our gradient into world space. - CreateComponent(testEntity.get()); - - // Create and keep a reference to a mock shape handler that will respond to shape requests for the mock shape. - auto mockShapeHandler = - CreateMockShape(AZ::Aabb::CreateCenterRadius(AZ::Vector3(shapeHalfBounds), shapeHalfBounds), testEntity->GetId()); - m_mockShapeHandlers->push_back(AZStd::move(mockShapeHandler)); + LmbrCentral::BoxShapeConfig boxConfig(AZ::Vector3(shapeHalfBounds * 2.0f)); + auto boxComponent = testEntity->CreateComponent(LmbrCentral::AxisAlignedBoxShapeComponentTypeId); + boxComponent->SetConfiguration(boxConfig); // Create a transform that locates our gradient in the center of our desired mock Shape. - auto transform = CreateComponent(testEntity.get()); + auto transform = testEntity->CreateComponent(); transform->SetLocalTM(AZ::Transform::CreateTranslation(AZ::Vector3(shapeHalfBounds))); transform->SetWorldTM(AZ::Transform::CreateTranslation(AZ::Vector3(shapeHalfBounds))); @@ -152,7 +133,7 @@ namespace UnitTest auto entity = CreateTestEntity(shapeHalfBounds); GradientSignal::ConstantGradientConfig config; config.m_value = 0.75f; - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); return entity; @@ -168,12 +149,12 @@ namespace UnitTest config.m_imageAsset = ImageAssetMockAssetHandler::CreateImageAsset(imageSize, imageSize, imageSeed); config.m_tilingX = 1.0f; config.m_tilingY = 1.0f; - CreateComponent(entity.get(), config); + entity->CreateComponent(config); // Create a Gradient Transform Component with arbitrary parameters. GradientSignal::GradientTransformConfig gradientTransformConfig; gradientTransformConfig.m_wrappingType = GradientSignal::WrappingType::None; - CreateComponent(entity.get(), gradientTransformConfig); + entity->CreateComponent(gradientTransformConfig); ActivateEntity(entity.get()); return entity; @@ -188,12 +169,12 @@ namespace UnitTest config.m_frequency = 1.1f; config.m_octave = 4; config.m_randomSeed = 12345; - CreateComponent(entity.get(), config); + entity->CreateComponent(config); // Create a Gradient Transform Component with arbitrary parameters. GradientSignal::GradientTransformConfig gradientTransformConfig; gradientTransformConfig.m_wrappingType = GradientSignal::WrappingType::None; - CreateComponent(entity.get(), gradientTransformConfig); + entity->CreateComponent(gradientTransformConfig); ActivateEntity(entity.get()); return entity; @@ -205,12 +186,12 @@ namespace UnitTest auto entity = CreateTestEntity(shapeHalfBounds); GradientSignal::RandomGradientConfig config; config.m_randomSeed = 12345; - CreateComponent(entity.get(), config); + entity->CreateComponent(config); // Create a Gradient Transform Component with arbitrary parameters. GradientSignal::GradientTransformConfig gradientTransformConfig; gradientTransformConfig.m_wrappingType = GradientSignal::WrappingType::None; - CreateComponent(entity.get(), gradientTransformConfig); + entity->CreateComponent(gradientTransformConfig); ActivateEntity(entity.get()); return entity; @@ -224,7 +205,7 @@ namespace UnitTest config.m_shapeEntityId = entity->GetId(); config.m_falloffWidth = 16.0f; config.m_falloffType = GradientSignal::FalloffType::InnerOuter; - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); return entity; @@ -238,10 +219,11 @@ namespace UnitTest GradientSignal::DitherGradientConfig config; config.m_gradientSampler.m_gradientId = inputGradientId; config.m_useSystemPointsPerUnit = false; - config.m_pointsPerUnit = 1.0f; + // Use a number other than 1.0f for pointsPerUnit to ensure the dither math is getting exercised properly. + config.m_pointsPerUnit = 0.25f; config.m_patternOffset = AZ::Vector3::CreateZero(); config.m_patternType = GradientSignal::DitherGradientConfig::BayerPatternType::PATTERN_SIZE_4x4; - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); return entity; @@ -254,7 +236,7 @@ namespace UnitTest auto entity = CreateTestEntity(shapeHalfBounds); GradientSignal::InvertGradientConfig config; config.m_gradientSampler.m_gradientId = inputGradientId; - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); return entity; @@ -272,7 +254,7 @@ namespace UnitTest config.m_inputMax = 0.9f; config.m_outputMin = 0.0f; config.m_outputMax = 1.0f; - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); return entity; @@ -298,7 +280,7 @@ namespace UnitTest layer.m_gradientSampler.m_opacity = 0.75f; config.m_layers.push_back(layer); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); return entity; @@ -313,7 +295,7 @@ namespace UnitTest config.m_gradientSampler.m_gradientId = inputGradientId; config.m_mode = GradientSignal::PosterizeGradientConfig::ModeType::Ps; config.m_bands = 5; - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); return entity; @@ -327,7 +309,7 @@ namespace UnitTest GradientSignal::ReferenceGradientConfig config; config.m_gradientSampler.m_gradientId = inputGradientId; config.m_gradientSampler.m_ownerEntityId = entity->GetId(); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); return entity; @@ -343,7 +325,7 @@ namespace UnitTest config.m_smoothStep.m_falloffMidpoint = 0.75f; config.m_smoothStep.m_falloffRange = 0.125f; config.m_smoothStep.m_falloffStrength = 0.25f; - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); return entity; @@ -357,7 +339,7 @@ namespace UnitTest GradientSignal::ThresholdGradientConfig config; config.m_gradientSampler.m_gradientId = inputGradientId; config.m_threshold = 0.75f; - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); return entity; @@ -370,7 +352,7 @@ namespace UnitTest GradientSignal::SurfaceAltitudeGradientConfig config; config.m_altitudeMin = -5.0f; config.m_altitudeMax = 15.0f; - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); return entity; @@ -382,7 +364,7 @@ namespace UnitTest auto entity = CreateTestEntity(shapeHalfBounds); GradientSignal::SurfaceMaskGradientConfig config; config.m_surfaceTagList.push_back(AZ_CRC_CE("test_mask")); - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); return entity; @@ -399,7 +381,7 @@ namespace UnitTest config.m_smoothStep.m_falloffMidpoint = 0.75f; config.m_smoothStep.m_falloffRange = 0.125f; config.m_smoothStep.m_falloffStrength = 0.25f; - CreateComponent(entity.get(), config); + entity->CreateComponent(config); ActivateEntity(entity.get()); return entity; diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.h b/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.h index 478f1c1d92..5fda88ea27 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.h +++ b/Gems/GradientSignal/Code/Tests/GradientSignalTestFixtures.h @@ -9,9 +9,39 @@ #include #include +#include namespace UnitTest { + // The GradientSignal unit tests need to use the GemTestEnvironment to load the LmbrCentral Gem so that Shape components can be used + // in the unit tests and benchmarks. + class GradientSignalTestEnvironment + : public AZ::Test::GemTestEnvironment + { + public: + void AddGemsAndComponents() override; + }; + +#ifdef HAVE_BENCHMARK + //! The Benchmark environment is used for one time setup and tear down of shared resources + class GradientSignalBenchmarkEnvironment + : public AZ::Test::BenchmarkEnvironmentBase + , public GradientSignalTestEnvironment + + { + protected: + void SetUpBenchmark() override + { + SetupEnvironment(); + } + + void TearDownBenchmark() override + { + TeardownEnvironment(); + } + }; +#endif + // Base test fixture used for GradientSignal unit tests and benchmark tests class GradientSignalBaseFixture { @@ -30,24 +60,6 @@ namespace UnitTest entity->Activate(); } - template - Component* CreateComponent(AZ::Entity* entity, const Configuration& config) - { - m_app->RegisterComponentDescriptor(Component::CreateDescriptor()); - return entity->CreateComponent(config); - } - - template - Component* CreateComponent(AZ::Entity* entity) - { - m_app->RegisterComponentDescriptor(Component::CreateDescriptor()); - return entity->CreateComponent(); - } - - // Create a mock shape that will respond to the shape bus with proper responses for the given input box. - AZStd::unique_ptr> CreateMockShape( - const AZ::Aabb& spawnerBox, const AZ::EntityId& shapeEntityId); - // Create a mock SurfaceDataSystem that will respond to requests for surface points with mock responses for points inside // the given input box. AZStd::unique_ptr CreateMockSurfaceDataSystem(const AZ::Aabb& spawnerBox); @@ -77,27 +89,22 @@ namespace UnitTest AZStd::unique_ptr BuildTestSurfaceMaskGradient(float shapeHalfBounds); AZStd::unique_ptr BuildTestSurfaceSlopeGradient(float shapeHalfBounds); - AZStd::unique_ptr m_app; - AZ::Entity* m_systemEntity = nullptr; - ImageAssetMockAssetHandler* m_mockHandler = nullptr; - AZStd::vector>>* m_mockShapeHandlers = nullptr; + UnitTest::ImageAssetMockAssetHandler* m_mockHandler = nullptr; }; struct GradientSignalTest : public GradientSignalBaseFixture - , public UnitTest::AllocatorsTestFixture + , public ::testing::Test { protected: void SetUp() override { - UnitTest::AllocatorsTestFixture::SetUp(); SetupCoreSystems(); } void TearDown() override { TearDownCoreSystems(); - UnitTest::AllocatorsTestFixture::TearDown(); } void TestFixedDataSampler(const AZStd::vector& expectedOutput, int size, AZ::EntityId gradientEntityId); @@ -106,41 +113,36 @@ namespace UnitTest #ifdef HAVE_BENCHMARK class GradientSignalBenchmarkFixture : public GradientSignalBaseFixture - , public UnitTest::AllocatorsBenchmarkFixture - , public UnitTest::TraceBusRedirector + , public ::benchmark::Fixture { public: - void internalSetUp(const benchmark::State& state) + void internalSetUp() { - AZ::Debug::TraceMessageBus::Handler::BusConnect(); - UnitTest::AllocatorsBenchmarkFixture::SetUp(state); SetupCoreSystems(); } - void internalTearDown(const benchmark::State& state) + void internalTearDown() { TearDownCoreSystems(); - UnitTest::AllocatorsBenchmarkFixture::TearDown(state); - AZ::Debug::TraceMessageBus::Handler::BusDisconnect(); } protected: - void SetUp(const benchmark::State& state) override + void SetUp([[maybe_unused]] const benchmark::State& state) override { - internalSetUp(state); + internalSetUp(); } - void SetUp(benchmark::State& state) override + void SetUp([[maybe_unused]] benchmark::State& state) override { - internalSetUp(state); + internalSetUp(); } - void TearDown(const benchmark::State& state) override + void TearDown([[maybe_unused]] const benchmark::State& state) override { - internalTearDown(state); + internalTearDown(); } - void TearDown(benchmark::State& state) override + void TearDown([[maybe_unused]] benchmark::State& state) override { - internalTearDown(state); + internalTearDown(); } }; #endif diff --git a/Gems/GradientSignal/Code/Tests/ImageAssetTests.cpp b/Gems/GradientSignal/Code/Tests/ImageAssetTests.cpp index 0111f10c3a..7b1c260d45 100644 --- a/Gems/GradientSignal/Code/Tests/ImageAssetTests.cpp +++ b/Gems/GradientSignal/Code/Tests/ImageAssetTests.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include @@ -64,26 +65,8 @@ namespace } } - class ImageAssetTest - : public ::testing::Test + class ImageAssetTest : public ::testing::Test { - protected: - AZ::ComponentApplication m_app; - AZ::Entity* m_systemEntity = nullptr; - - void SetUp() override - { - AZ::ComponentApplication::Descriptor appDesc; - appDesc.m_memoryBlocksByteSize = 128 * 1024 * 1024; - m_systemEntity = m_app.Create(appDesc); - m_app.AddEntity(m_systemEntity); - } - - void TearDown() override - { - m_app.Destroy(); - m_systemEntity = nullptr; - } }; #if AZ_TRAIT_DISABLE_FAILED_GRADIENT_SIGNAL_TESTS From 79431f5e5fbec10608e0de865c6474b0bead2c32 Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Thu, 13 Jan 2022 14:50:54 -0600 Subject: [PATCH 463/948] First batch of GetValues() overrides (#6852) * Benchmarks and tests for Image and Constant GetValues Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Verify GetValues for Perlin and Random Gradients Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Standardized the assert format for GetValues(). Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * More GetValues unit tests and test cleanup Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Fixed typos Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * GetValues() unit tests for surface gradients. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Benchmarks for ShapeAreaFalloff Gradient Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Added benchmarks for all remaining gradients and cleaned up the helper methods. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Renamed class for better report formatting. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Added missing Mocks dependencies for the Editor tests. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * First batch of specific GetValues() overrides. Each one is measurably faster than the generic version. Also, in ShapeAreaFalloffGradient, I optimized and simplified the logic a bit, so GetValue() is marginally faster too. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- .../Components/ConstantGradientComponent.h | 1 + .../Components/ImageGradientComponent.h | 1 + .../Components/PerlinGradientComponent.h | 1 + .../Components/RandomGradientComponent.h | 3 + .../ShapeAreaFalloffGradientComponent.h | 1 + .../Components/ConstantGradientComponent.cpp | 16 +++++ .../Components/ImageGradientComponent.cpp | 33 +++++++++ .../Components/PerlinGradientComponent.cpp | 34 ++++++++++ .../Components/RandomGradientComponent.cpp | 67 +++++++++++++++---- .../ShapeAreaFalloffGradientComponent.cpp | 59 +++++++++++++--- 10 files changed, 195 insertions(+), 21 deletions(-) diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ConstantGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ConstantGradientComponent.h index cb27914b8a..af896f0933 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ConstantGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ConstantGradientComponent.h @@ -62,6 +62,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; + void GetValues(AZStd::array_view positions, AZStd::array_view outValues) const override; protected: ////////////////////////////////////////////////////////////////////////// diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h index 8214436f83..9fc98124cb 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h @@ -69,6 +69,7 @@ namespace GradientSignal // GradientRequestBus overrides... float GetValue(const GradientSampleParams& sampleParams) const override; + void GetValues(AZStd::array_view positions, AZStd::array_view outValues) const override; // AZ::Data::AssetBus overrides... void OnAssetReady(AZ::Data::Asset asset) override; diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/PerlinGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/PerlinGradientComponent.h index ef171f5319..1b39f7f17b 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/PerlinGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/PerlinGradientComponent.h @@ -70,6 +70,7 @@ namespace GradientSignal // GradientRequestBus overrides... float GetValue(const GradientSampleParams& sampleParams) const override; + void GetValues(AZStd::array_view positions, AZStd::array_view outValues) const override; private: PerlinGradientConfig m_configuration; diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/RandomGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/RandomGradientComponent.h index b0dbd964a0..274442a2c0 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/RandomGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/RandomGradientComponent.h @@ -61,6 +61,7 @@ namespace GradientSignal // GradientRequestBus overrides... float GetValue(const GradientSampleParams& sampleParams) const override; + void GetValues(AZStd::array_view positions, AZStd::array_view outValues) const override; private: RandomGradientConfig m_configuration; @@ -73,5 +74,7 @@ namespace GradientSignal // RandomGradientRequestBus overrides... int GetRandomSeed() const override; void SetRandomSeed(int seed) override; + + float GetRandomValue(const AZ::Vector3& position, AZStd::size_t seed) const; }; } diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ShapeAreaFalloffGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ShapeAreaFalloffGradientComponent.h index d7c2344fd2..df86c38069 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ShapeAreaFalloffGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ShapeAreaFalloffGradientComponent.h @@ -69,6 +69,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; + void GetValues(AZStd::array_view positions, AZStd::array_view outValues) const override; protected: ////////////////////////////////////////////////////////////////////////// diff --git a/Gems/GradientSignal/Code/Source/Components/ConstantGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ConstantGradientComponent.cpp index 86e8a5abc6..2b1487f75e 100644 --- a/Gems/GradientSignal/Code/Source/Components/ConstantGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ConstantGradientComponent.cpp @@ -134,6 +134,22 @@ namespace GradientSignal return m_configuration.m_value; } + void ConstantGradientComponent::GetValues( + [[maybe_unused]] AZStd::array_view positions, AZStd::array_view outValues) const + { + if (positions.size() != outValues.size()) + { + AZ_Assert(false, "input and output lists are different sizes (%zu vs %zu).", positions.size(), outValues.size()); + return; + } + + for (auto& outValue : outValues) + { + float& writableOutValue = const_cast(outValue); + writableOutValue = m_configuration.m_value; + } + } + float ConstantGradientComponent::GetConstantValue() const { return m_configuration.m_value; diff --git a/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp index 269bfbc2df..06a3674188 100644 --- a/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp @@ -219,6 +219,39 @@ namespace GradientSignal return 0.0f; } + void ImageGradientComponent::GetValues(AZStd::array_view positions, AZStd::array_view outValues) const + { + if (positions.size() != outValues.size()) + { + AZ_Assert(false, "input and output lists are different sizes (%zu vs %zu).", positions.size(), outValues.size()); + return; + } + + AZ::Vector3 uvw; + bool wasPointRejected = false; + + AZStd::shared_lock imageLock(m_imageMutex); + + for (size_t index = 0; index < positions.size(); index++) + { + // The const_cast is necessary for now since array_view currently only supports const entries. + // If/when array_view is fixed to support non-const, or AZStd::span gets created, the const_cast can get removed. + auto& outValue = const_cast(outValues[index]); + + m_gradientTransform.TransformPositionToUVWNormalized(positions[index], uvw, wasPointRejected); + + if (!wasPointRejected) + { + outValue = GetValueFromImageAsset( + m_configuration.m_imageAsset, uvw, m_configuration.m_tilingX, m_configuration.m_tilingY, 0.0f); + } + else + { + outValue = 0.0f; + } + } + } + AZStd::string ImageGradientComponent::GetImageAssetPath() const { AZStd::string assetPathString; diff --git a/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp index 3096afa3dc..667d8c30a7 100644 --- a/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp @@ -203,6 +203,40 @@ namespace GradientSignal return 0.0f; } + void PerlinGradientComponent::GetValues(AZStd::array_view positions, AZStd::array_view outValues) const + { + if (positions.size() != outValues.size()) + { + AZ_Assert(false, "input and output lists are different sizes (%zu vs %zu).", positions.size(), outValues.size()); + return; + } + + AZ::Vector3 uvw; + bool wasPointRejected = false; + + AZStd::shared_lock lock(m_transformMutex); + + for (size_t index = 0; index < positions.size(); index++) + { + // The const_cast is necessary for now since array_view currently only supports const entries. + // If/when array_view is fixed to support non-const, or AZStd::span gets created, the const_cast can get removed. + auto& outValue = const_cast(outValues[index]); + + m_gradientTransform.TransformPositionToUVW(positions[index], uvw, wasPointRejected); + + if (!wasPointRejected) + { + outValue = m_perlinImprovedNoise->GenerateOctaveNoise( + uvw.GetX(), uvw.GetY(), uvw.GetZ(), m_configuration.m_octave, m_configuration.m_amplitude, + m_configuration.m_frequency); + } + else + { + outValue = 0.0f; + } + } + } + int PerlinGradientComponent::GetRandomSeed() const { return m_configuration.m_randomSeed; diff --git a/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp index 1b6753560c..ae51bdd4ac 100644 --- a/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp @@ -145,6 +145,22 @@ namespace GradientSignal m_gradientTransform = newTransform; } + float RandomGradientComponent::GetRandomValue(const AZ::Vector3& position, AZStd::size_t seed) const + { + // generating stable pseudo-random noise from a position based hash + float x = position.GetX(); + float y = position.GetY(); + AZStd::size_t result = 0; + + AZStd::hash_combine(result, x * seed + y); + AZStd::hash_combine(result, y * seed + x); + AZStd::hash_combine(result, x * y * seed); + + // always returns [0.0,1.0] + return static_cast(result % std::numeric_limits::max()) / static_cast(std::numeric_limits::max()); + } + + float RandomGradientComponent::GetValue(const GradientSampleParams& sampleParams) const { @@ -158,23 +174,50 @@ namespace GradientSignal if (!wasPointRejected) { - //generating stable pseudo-random noise from a position based hash - float x = uvw.GetX(); - float y = uvw.GetY(); - AZStd::size_t result = 0; - const AZStd::size_t seed = m_configuration.m_randomSeed + AZStd::size_t(2); // Add 2 to avoid seeds 0 and 1, which can create strange patterns with this particular algorithm - - AZStd::hash_combine(result, x * seed + y); - AZStd::hash_combine(result, y * seed + x); - AZStd::hash_combine(result, x * y * seed); - - //always returns [0.0,1.0] - return static_cast(result % std::numeric_limits::max()) / static_cast(std::numeric_limits::max()); + const AZStd::size_t seed = m_configuration.m_randomSeed + + AZStd::size_t(2); // Add 2 to avoid seeds 0 and 1, which can create strange patterns with this particular algorithm + + return GetRandomValue(uvw, seed); } return 0.0f; } + void RandomGradientComponent::GetValues(AZStd::array_view positions, AZStd::array_view outValues) const + { + if (positions.size() != outValues.size()) + { + AZ_Assert(false, "input and output lists are different sizes (%zu vs %zu).", positions.size(), outValues.size()); + return; + } + + AZ::Vector3 uvw; + bool wasPointRejected = false; + const AZStd::size_t seed = m_configuration.m_randomSeed + + AZStd::size_t(2); // Add 2 to avoid seeds 0 and 1, which can create strange patterns with this particular algorithm + + AZStd::shared_lock lock(m_transformMutex); + + for (size_t index = 0; index < positions.size(); index++) + { + // The const_cast is necessary for now since array_view currently only supports const entries. + // If/when array_view is fixed to support non-const, or AZStd::span gets created, the const_cast can get removed. + auto& outValue = const_cast(outValues[index]); + + m_gradientTransform.TransformPositionToUVW(positions[index], uvw, wasPointRejected); + + if (!wasPointRejected) + { + outValue = GetRandomValue(uvw, seed); + } + else + { + outValue = 0.0f; + } + } + } + + int RandomGradientComponent::GetRandomSeed() const { return m_configuration.m_randomSeed; diff --git a/Gems/GradientSignal/Code/Source/Components/ShapeAreaFalloffGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ShapeAreaFalloffGradientComponent.cpp index 9e1a250900..f2416f4fb6 100644 --- a/Gems/GradientSignal/Code/Source/Components/ShapeAreaFalloffGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ShapeAreaFalloffGradientComponent.cpp @@ -157,21 +157,62 @@ namespace GradientSignal float ShapeAreaFalloffGradientComponent::GetValue(const GradientSampleParams& sampleParams) const { - AZ_PROFILE_FUNCTION(Entity); - float distance = 0.0f; LmbrCentral::ShapeComponentRequestsBus::EventResult(distance, m_configuration.m_shapeEntityId, &LmbrCentral::ShapeComponentRequestsBus::Events::DistanceFromPoint, sampleParams.m_position); - // In the special case of 0 falloff, make sure that all points inside the shape (0 distance) return - // 1.0, and all points outside the shape return 0. - if (m_configuration.m_falloffWidth == 0.0f) + // Since this is outer falloff, distance should give us values from 1.0 at the minimum distance to 0.0 at the maximum distance. + // The statement is written specifically to handle the 0 falloff case as well. For 0 falloff, all points inside the shape + // (0 distance) return 1.0, and all points outside the shape return 0. This works because division by 0 gives infinity, which gets + // clamped by the GetMax() to 0. However, if distance == 0, it would give us NaN, so we have the separate conditional check to + // handle that case and clamp to 1.0. + return (distance <= 0.0f) ? 1.0f : AZ::GetMax(1.0f - (distance / m_configuration.m_falloffWidth), 0.0f); + } + + void ShapeAreaFalloffGradientComponent::GetValues(AZStd::array_view positions, AZStd::array_view outValues) const + { + if (positions.size() != outValues.size()) { - return (distance > 0.0f) ? 0.0f : 1.0f; + AZ_Assert(false, "input and output lists are different sizes (%zu vs %zu).", positions.size(), outValues.size()); + return; } - // Since this is outer falloff, distance should give us values from 1.0 at the minimum distance - // to 0.0 at the maximum distance. - return GetRatio(m_configuration.m_falloffWidth, 0.0f, distance); + bool shapeConnected = false; + const float falloffWidth = m_configuration.m_falloffWidth; + + LmbrCentral::ShapeComponentRequestsBus::Event( + m_configuration.m_shapeEntityId, + [falloffWidth, positions, &outValues, &shapeConnected](LmbrCentral::ShapeComponentRequestsBus::Events* shapeRequests) + { + shapeConnected = true; + + for (size_t index = 0; index < positions.size(); index++) + { + // The const_cast is necessary for now since array_view currently only supports const entries. + // If/when array_view is fixed to support non-const, or AZStd::span gets created, the const_cast can get removed. + auto& outValue = const_cast(outValues[index]); + + float distance = shapeRequests->DistanceFromPoint(positions[index]); + + // Since this is outer falloff, distance should give us values from 1.0 at the minimum distance to 0.0 at the maximum + // distance. The statement is written specifically to handle the 0 falloff case as well. For 0 falloff, all points + // inside the shape (0 distance) return 1.0, and all points outside the shape return 0. This works because division by 0 + // gives infinity, which gets clamped by the GetMax() to 0. However, if distance == 0, it would give us NaN, so we have + // the separate conditional check to handle that case and clamp to 1.0. + outValue = (distance <= 0.0f) ? 1.0f : AZ::GetMax(1.0f - (distance / falloffWidth), 0.0f); + } + }); + + // If there's no shape, there's no falloff. + if (!shapeConnected) + { + for (size_t index = 0; index < positions.size(); index++) + { + // The const_cast is necessary for now since array_view currently only supports const entries. + // If/when array_view is fixed to support non-const, or AZStd::span gets created, the const_cast can get removed. + auto& outValue = const_cast(outValues[index]); + outValue = 1.0f; + } + } } AZ::EntityId ShapeAreaFalloffGradientComponent::GetShapeEntityId() const From 34d74857f5e940b8e18a971e7b053fb6805c48b2 Mon Sep 17 00:00:00 2001 From: Scott Romero <24445312+AMZN-ScottR@users.noreply.github.com> Date: Thu, 13 Jan 2022 12:55:36 -0800 Subject: [PATCH 464/948] [development] fix for a possible MSVC compiler bug (#6870) Replaced a variable with the name "interface" to avoid conflict with MSVC keyword Signed-off-by: AMZN-ScottR <24445312+AMZN-ScottR@users.noreply.github.com> --- .../AssetProcessor/native/tests/SourceFileRelocatorTests.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Code/Tools/AssetProcessor/native/tests/SourceFileRelocatorTests.cpp b/Code/Tools/AssetProcessor/native/tests/SourceFileRelocatorTests.cpp index d7801abb3d..8d52ba23bd 100644 --- a/Code/Tools/AssetProcessor/native/tests/SourceFileRelocatorTests.cpp +++ b/Code/Tools/AssetProcessor/native/tests/SourceFileRelocatorTests.cpp @@ -793,9 +793,9 @@ namespace UnitTests TEST_F(SourceFileRelocatorTest, TestInterface) { - auto* interface = AZ::Interface::Get(); + auto* sourceFileRelocator = AZ::Interface::Get(); - ASSERT_NE(interface, nullptr); + ASSERT_NE(sourceFileRelocator, nullptr); } TEST_F(SourceFileRelocatorTest, Move_Real_Succeeds) From 193f529b9c8469930252b20d9fd15bd2bbc9bf60 Mon Sep 17 00:00:00 2001 From: michabr <82236305+michabr@users.noreply.github.com> Date: Thu, 13 Jan 2022 12:56:34 -0800 Subject: [PATCH 465/948] Add an LyShine client API target (#6829) * Reduce the need to link with LyShine static lib in other gems Signed-off-by: abrmich * Add UiBasics.Builders to VirtualGamepad.Builders alias Signed-off-by: abrmich * Add UiBasics to LyShine gem's metadata Signed-off-by: abrmich * Change include to a forward declaration Signed-off-by: abrmich --- Gems/GameStateSamples/Code/CMakeLists.txt | 2 +- Gems/LyShine/Code/CMakeLists.txt | 19 ++++---- Gems/LyShine/Code/Editor/GuideHelpers.cpp | 2 +- .../Code/Editor/ViewportCanvasBackground.cpp | 2 +- .../Code/Editor/ViewportDragInteraction.h | 2 +- Gems/LyShine/Code/Editor/ViewportHelpers.h | 2 +- Gems/LyShine/Code/Editor/ViewportIcon.cpp | 12 ++--- Gems/LyShine/Code/Editor/ViewportIcon.h | 2 +- Gems/LyShine/Code/Editor/ViewportWidget.cpp | 2 +- Gems/LyShine/Code/Include/LyShine/IDraw2d.h | 44 +++++++++++++++++++ Gems/LyShine/Code/Include/LyShine/ILyShine.h | 9 ++++ Gems/LyShine/Code/Source/Draw2d.cpp | 38 +--------------- .../Code/{Include/LyShine => Source}/Draw2d.h | 3 -- Gems/LyShine/Code/Source/LyShine.cpp | 10 ++++- Gems/LyShine/Code/Source/LyShine.h | 1 + Gems/LyShine/Code/Source/LyShineDebug.cpp | 22 +++++----- .../LyShine/Code/Source/UiCanvasComponent.cpp | 2 +- Gems/LyShine/Code/Source/UiCanvasManager.cpp | 6 +-- Gems/LyShine/Code/Source/UiFaderComponent.cpp | 2 +- Gems/LyShine/Code/Source/UiImageComponent.cpp | 2 +- .../Code/Source/UiImageSequenceComponent.cpp | 2 +- Gems/LyShine/Code/Source/UiMaskComponent.cpp | 2 +- Gems/LyShine/Code/Source/UiRenderer.cpp | 4 +- Gems/LyShine/Code/Source/UiTextComponent.cpp | 10 ++--- Gems/LyShine/Code/lyshine_static_files.cmake | 4 +- Gems/LyShine/gem.json | 3 +- Gems/LyShineExamples/Code/CMakeLists.txt | 4 +- .../Code/Source/UiCustomImageComponent.cpp | 2 +- Gems/MessagePopup/Code/CMakeLists.txt | 4 +- Gems/UiBasics/CMakeLists.txt | 1 + Gems/VirtualGamepad/Code/CMakeLists.txt | 4 +- 31 files changed, 125 insertions(+), 99 deletions(-) rename Gems/LyShine/Code/{Include/LyShine => Source}/Draw2d.h (98%) diff --git a/Gems/GameStateSamples/Code/CMakeLists.txt b/Gems/GameStateSamples/Code/CMakeLists.txt index 5d1d180de0..a07bef6a06 100644 --- a/Gems/GameStateSamples/Code/CMakeLists.txt +++ b/Gems/GameStateSamples/Code/CMakeLists.txt @@ -21,7 +21,7 @@ ly_add_target( INTERFACE Gem::GameState Gem::LocalUser - Gem::LyShine.Static + Gem::LyShine.Clients.API Gem::SaveData.Static Gem::MessagePopup.Static Legacy::CryCommon diff --git a/Gems/LyShine/Code/CMakeLists.txt b/Gems/LyShine/Code/CMakeLists.txt index 4f2c4e90a7..2b550b0e36 100644 --- a/Gems/LyShine/Code/CMakeLists.txt +++ b/Gems/LyShine/Code/CMakeLists.txt @@ -58,10 +58,13 @@ ly_add_target( # by default, load the above "Gem::LyShine" module in Client and Server applications: ly_create_alias(NAME LyShine.Clients NAMESPACE Gem TARGETS Gem::LyShine) ly_create_alias(NAME LyShine.Servers NAMESPACE Gem TARGETS Gem::LyShine) +# create an alias for other gems to depend on an LyShine public API (may be converted to a target in the future): +ly_create_alias(NAME LyShine.Clients.API NAMESPACE Gem TARGETS Gem::LyShine.Clients) +ly_create_alias(NAME LyShine.Servers.API NAMESPACE Gem TARGETS Gem::LyShine.Servers) if (PAL_TRAIT_BUILD_HOST_TOOLS) ly_add_target( - NAME LyShine.Editor.Static STATIC + NAME LyShine.Tools.Static STATIC NAMESPACE Gem AUTOMOC AUTOUIC @@ -73,7 +76,6 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) . Source Editor - PUBLIC Include BUILD_DEPENDENCIES PRIVATE @@ -100,7 +102,7 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) ) ly_add_target( - NAME LyShine.Editor GEM_MODULE + NAME LyShine.Tools GEM_MODULE NAMESPACE Gem FILES_CMAKE lyshine_common_module_files.cmake @@ -112,18 +114,18 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) . Source Editor - PUBLIC Include BUILD_DEPENDENCIES PRIVATE Legacy::CryCommon AZ::AzToolsFramework - Gem::LyShine.Editor.Static + Gem::LyShine.Tools.Static Gem::LmbrCentral.Editor Gem::TextureAtlas.Editor RUNTIME_DEPENDENCIES Gem::LmbrCentral.Editor Gem::TextureAtlas.Editor + Gem::UiBasics.Tools ) # by naming this target LyShine.Builders it ensures that it is loaded @@ -179,10 +181,9 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) Gem::LyShine.Builders.Static Gem::LmbrCentral.Editor Gem::TextureAtlas.Editor + RUNTIME_DEPENDENCIES + Gem::UiBasics.Builders ) - - # by default, load the above "Gem::LyShine.Editor" module in dev tools: - ly_create_alias(NAME LyShine.Tools NAMESPACE Gem TARGETS Gem::LyShine.Editor) endif() ################################################################################ @@ -241,7 +242,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) AZ::AzTest Legacy::CryCommon AZ::AssetBuilderSDK - Gem::LyShine.Editor.Static + Gem::LyShine.Tools.Static Gem::LyShine.Builders.Static Gem::LmbrCentral.Editor Gem::TextureAtlas diff --git a/Gems/LyShine/Code/Editor/GuideHelpers.cpp b/Gems/LyShine/Code/Editor/GuideHelpers.cpp index eb5966568e..b6d7acc57a 100644 --- a/Gems/LyShine/Code/Editor/GuideHelpers.cpp +++ b/Gems/LyShine/Code/Editor/GuideHelpers.cpp @@ -173,7 +173,7 @@ namespace GuideHelpers // the line is drawn as the inverse of the background color AZ::Color guideColor(1.0f, 1.0f, 1.0f, 1.0f); - CDraw2d::RenderState renderState; + IDraw2d::RenderState renderState; renderState.m_blendState.m_blendSource = AZ::RHI::BlendFactor::ColorDestInverse; renderState.m_blendState.m_blendDest = AZ::RHI::BlendFactor::Zero; diff --git a/Gems/LyShine/Code/Editor/ViewportCanvasBackground.cpp b/Gems/LyShine/Code/Editor/ViewportCanvasBackground.cpp index 668c4e8024..b1961de0a1 100644 --- a/Gems/LyShine/Code/Editor/ViewportCanvasBackground.cpp +++ b/Gems/LyShine/Code/Editor/ViewportCanvasBackground.cpp @@ -50,7 +50,7 @@ void ViewportCanvasBackground::Draw(Draw2dHelper& draw2d, const AZ::Vector2& can // now draw the same as Stretched but with UV's adjusted const AZ::Vector2 uvs[4] = { AZ::Vector2(0, 0), AZ::Vector2(uvScale.GetX(), 0), AZ::Vector2(uvScale.GetX(), uvScale.GetY()), AZ::Vector2(0, uvScale.GetY()) }; AZ::Color colorWhite(1.0f, 1.0f, 1.0f, 1.0f); - CDraw2d::VertexPosColUV verts[4]; + IDraw2d::VertexPosColUV verts[4]; for (int i = 0; i < 4; ++i) { verts[i].position = positions[i]; diff --git a/Gems/LyShine/Code/Editor/ViewportDragInteraction.h b/Gems/LyShine/Code/Editor/ViewportDragInteraction.h index 3b26b66308..6b48fc0133 100644 --- a/Gems/LyShine/Code/Editor/ViewportDragInteraction.h +++ b/Gems/LyShine/Code/Editor/ViewportDragInteraction.h @@ -8,7 +8,7 @@ #pragma once #include -#include +#include //! Abstract base class for drag interactions in the UI Editor viewport window. class ViewportDragInteraction diff --git a/Gems/LyShine/Code/Editor/ViewportHelpers.h b/Gems/LyShine/Code/Editor/ViewportHelpers.h index 8068f4af65..f2722fb6b8 100644 --- a/Gems/LyShine/Code/Editor/ViewportHelpers.h +++ b/Gems/LyShine/Code/Editor/ViewportHelpers.h @@ -7,7 +7,7 @@ */ #pragma once -#include +#include namespace ViewportHelpers { diff --git a/Gems/LyShine/Code/Editor/ViewportIcon.cpp b/Gems/LyShine/Code/Editor/ViewportIcon.cpp index 3f0fdfaba0..33f2f40ffe 100644 --- a/Gems/LyShine/Code/Editor/ViewportIcon.cpp +++ b/Gems/LyShine/Code/Editor/ViewportIcon.cpp @@ -6,7 +6,7 @@ * */ #include "EditorCommon.h" -#include +#include #include #include @@ -15,7 +15,7 @@ float ViewportIcon::m_dpiScaleFactor = 1.0f; ViewportIcon::ViewportIcon(const char* textureFilename) { - m_image = CDraw2d::LoadTexture(textureFilename); + m_image = Draw2dHelper::LoadTexture(textureFilename); } ViewportIcon::~ViewportIcon() @@ -48,7 +48,7 @@ void ViewportIcon::DrawImageAligned(Draw2dHelper& draw2d, AZ::Vector2& pivot, fl opacity); } -void ViewportIcon::DrawImageTiled(Draw2dHelper& draw2d, CDraw2d::VertexPosColUV* verts) +void ViewportIcon::DrawImageTiled(Draw2dHelper& draw2d, IDraw2d::VertexPosColUV* verts) { // Use default blending and rounding modes IDraw2d::Rounding rounding = IDraw2d::Rounding::Nearest; @@ -63,7 +63,7 @@ void ViewportIcon::DrawAxisAlignedBoundingBox(Draw2dHelper& draw2d, AZ::Vector2 float endTexCoordU = fabsf((bound1.GetX() - bound0.GetX()) * pixelLengthForDottedLineTexture); float endTexCoordV = fabsf((bound1.GetY() - bound0.GetY()) * pixelLengthForDottedLineTexture); - CDraw2d::VertexPosColUV verts[2]; + IDraw2d::VertexPosColUV verts[2]; { verts[0].color = dottedColor; verts[1].color = dottedColor; @@ -158,7 +158,7 @@ void ViewportIcon::Draw(Draw2dHelper& draw2d, AZ::Vector2 anchorPos, const AZ::M AZ::Matrix4x4 moveFromPivotSpaceMat = AZ::Matrix4x4::CreateTranslation(pivot3); AZ::Matrix4x4 newTransform = transform * moveFromPivotSpaceMat * rotMat * moveToPivotSpaceMat; - CDraw2d::VertexPosColUV verts[4]; + IDraw2d::VertexPosColUV verts[4]; // points are a clockwise quad static const AZ::Vector2 uvs[4] = { AZ::Vector2(0.0f, 0.0f), AZ::Vector2(1.0f, 0.0f), AZ::Vector2(1.0f, 1.0f), AZ::Vector2(0.0f, 1.0f) @@ -251,7 +251,7 @@ void ViewportIcon::DrawDistanceLine(Draw2dHelper& draw2d, AZ::Vector2 start, AZ: const float pixelLengthForDottedLineTexture = 8.0f; float endTexCoordU = length / pixelLengthForDottedLineTexture; - CDraw2d::VertexPosColUV verts[2]; + IDraw2d::VertexPosColUV verts[2]; verts[0].position = start; verts[0].color = dottedColor; diff --git a/Gems/LyShine/Code/Editor/ViewportIcon.h b/Gems/LyShine/Code/Editor/ViewportIcon.h index f815b244e9..fadd829bcf 100644 --- a/Gems/LyShine/Code/Editor/ViewportIcon.h +++ b/Gems/LyShine/Code/Editor/ViewportIcon.h @@ -20,7 +20,7 @@ public: void DrawImageAligned(Draw2dHelper& draw2d, AZ::Vector2& pivot, float opacity); - void DrawImageTiled(Draw2dHelper& draw2d, CDraw2d::VertexPosColUV* verts); + void DrawImageTiled(Draw2dHelper& draw2d, IDraw2d::VertexPosColUV* verts); void Draw(Draw2dHelper& draw2d, AZ::Vector2 anchorPos, const AZ::Matrix4x4& transform, float iconRot = 0.0f, AZ::Color color = AZ::Color(1.0f, 1.0f, 1.0f, 1.0f)) const; diff --git a/Gems/LyShine/Code/Editor/ViewportWidget.cpp b/Gems/LyShine/Code/Editor/ViewportWidget.cpp index 993f57aeeb..b481e9cbf1 100644 --- a/Gems/LyShine/Code/Editor/ViewportWidget.cpp +++ b/Gems/LyShine/Code/Editor/ViewportWidget.cpp @@ -16,7 +16,6 @@ #include #include -#include #include "LyShine.h" #include "UiRenderer.h" @@ -27,6 +26,7 @@ #include "RulerWidget.h" #include "CanvasHelpers.h" #include "AssetDropHelpers.h" +#include "Draw2d.h" #include "QtHelpers.h" #include diff --git a/Gems/LyShine/Code/Include/LyShine/IDraw2d.h b/Gems/LyShine/Code/Include/LyShine/IDraw2d.h index 620b8c23c9..77dc5ac601 100644 --- a/Gems/LyShine/Code/Include/LyShine/IDraw2d.h +++ b/Gems/LyShine/Code/Include/LyShine/IDraw2d.h @@ -482,6 +482,50 @@ public: // static member functions return nullptr; } + //! Helper to load a texture + static AZ::Data::Instance LoadTexture(const AZStd::string& pathName) + { + if (gEnv && gEnv->pLyShine) // [LYSHINE_ATOM_TODO][GHI #3569] Remove LyShine global interface pointer from legacy global environment + { + return gEnv->pLyShine->LoadTexture(pathName); + } + + return nullptr; + } + + //! Given a position and size and an alignment return the top left corner of the aligned quad + static AZ::Vector2 Align(AZ::Vector2 position, AZ::Vector2 size, IDraw2d::HAlign horizontalAlignment, IDraw2d::VAlign verticalAlignment) + { + AZ::Vector2 result = AZ::Vector2::CreateZero(); + switch (horizontalAlignment) + { + case IDraw2d::HAlign::Left: + result.SetX(position.GetX()); + break; + case IDraw2d::HAlign::Center: + result.SetX(position.GetX() - size.GetX() * 0.5f); + break; + case IDraw2d::HAlign::Right: + result.SetX(position.GetX() - size.GetX()); + break; + } + + switch (verticalAlignment) + { + case IDraw2d::VAlign::Top: + result.SetY(position.GetY()); + break; + case IDraw2d::VAlign::Center: + result.SetY(position.GetY() - size.GetY() * 0.5f); + break; + case IDraw2d::VAlign::Bottom: + result.SetY(position.GetY() - size.GetY()); + break; + } + + return result; + } + //! Round the X and Y coordinates of a point using the given rounding policy template static T RoundXY(T value, IDraw2d::Rounding roundingType) diff --git a/Gems/LyShine/Code/Include/LyShine/ILyShine.h b/Gems/LyShine/Code/Include/LyShine/ILyShine.h index 7832497d8c..71ca6ec074 100644 --- a/Gems/LyShine/Code/Include/LyShine/ILyShine.h +++ b/Gems/LyShine/Code/Include/LyShine/ILyShine.h @@ -9,12 +9,18 @@ #include #include +#include class IDraw2d; class ISprite; struct IUiAnimationSystem; class UiEntityContext; +namespace AZ::RPI +{ + class Image; +} + // The following ifdef block is the standard way of creating macros which make exporting // from a DLL simpler. All files within this DLL are compiled with the LYSHINE_EXPORTS // symbol defined in the StdAfx.h. this symbol should not be defined on any project @@ -82,6 +88,9 @@ public: //! Check if a sprite's texture asset exists. The .sprite sidecar file is optional and is not checked virtual bool DoesSpriteTextureAssetExist(const AZStd::string& pathname) = 0; + //! Load an image asset by texture pathname + virtual AZ::Data::Instance LoadTexture(const AZStd::string& pathName) = 0; + //! Perform post-initialization (script system will be available) virtual void PostInit() = 0; diff --git a/Gems/LyShine/Code/Source/Draw2d.cpp b/Gems/LyShine/Code/Source/Draw2d.cpp index 2838ed4877..ff8c7f1c6d 100644 --- a/Gems/LyShine/Code/Source/Draw2d.cpp +++ b/Gems/LyShine/Code/Source/Draw2d.cpp @@ -6,7 +6,7 @@ * */ -#include +#include "Draw2d.h" #include #include "LyShinePassDataBus.h" @@ -215,7 +215,7 @@ void CDraw2d::DrawImageAligned(AZ::Data::Instance image, AZ::Vec HAlign horizontalAlignment, VAlign verticalAlignment, float opacity, float rotation, const AZ::Vector2* minMaxTexCoords, ImageOptions* imageOptions) { - AZ::Vector2 alignedPosition = Align(position, size, horizontalAlignment, verticalAlignment); + AZ::Vector2 alignedPosition = Draw2dHelper::Align(position, size, horizontalAlignment, verticalAlignment); DrawImage(image, alignedPosition, size, opacity, rotation, &position, minMaxTexCoords, imageOptions); } @@ -524,40 +524,6 @@ void CDraw2d::SetSortKey(int64_t key) // PUBLIC STATIC FUNCTIONS //////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////// -AZ::Vector2 CDraw2d::Align(AZ::Vector2 position, AZ::Vector2 size, - HAlign horizontalAlignment, VAlign verticalAlignment) -{ - AZ::Vector2 result = AZ::Vector2::CreateZero(); - switch (horizontalAlignment) - { - case HAlign::Left: - result.SetX(position.GetX()); - break; - case HAlign::Center: - result.SetX(position.GetX() - size.GetX() * 0.5f); - break; - case HAlign::Right: - result.SetX(position.GetX() - size.GetX()); - break; - } - - switch (verticalAlignment) - { - case VAlign::Top: - result.SetY(position.GetY()); - break; - case VAlign::Center: - result.SetY(position.GetY() - size.GetY() * 0.5f); - break; - case VAlign::Bottom: - result.SetY(position.GetY() - size.GetY()); - break; - } - - return result; -} - //////////////////////////////////////////////////////////////////////////////////////////////////// AZ::Data::Instance CDraw2d::LoadTexture(const AZStd::string& pathName) { diff --git a/Gems/LyShine/Code/Include/LyShine/Draw2d.h b/Gems/LyShine/Code/Source/Draw2d.h similarity index 98% rename from Gems/LyShine/Code/Include/LyShine/Draw2d.h rename to Gems/LyShine/Code/Source/Draw2d.h index d138f41b03..6d400c6b55 100644 --- a/Gems/LyShine/Code/Include/LyShine/Draw2d.h +++ b/Gems/LyShine/Code/Source/Draw2d.h @@ -180,9 +180,6 @@ private: public: // static member functions - //! Given a position and size and an alignment return the top left corner of the aligned quad - static AZ::Vector2 Align(AZ::Vector2 position, AZ::Vector2 size, HAlign horizontalAlignment, VAlign verticalAlignment); - //! Helper to load a texture static AZ::Data::Instance LoadTexture(const AZStd::string& pathName); diff --git a/Gems/LyShine/Code/Source/LyShine.cpp b/Gems/LyShine/Code/Source/LyShine.cpp index 683d72f4ab..5a704329ef 100644 --- a/Gems/LyShine/Code/Source/LyShine.cpp +++ b/Gems/LyShine/Code/Source/LyShine.cpp @@ -43,11 +43,11 @@ #include "Sprite.h" #include "UiSerialize.h" #include "UiRenderer.h" +#include "Draw2d.h" #include #include #include -#include #if defined(LYSHINE_INTERNAL_UNIT_TEST) #include "TextMarkup.h" @@ -355,6 +355,12 @@ bool CLyShine::DoesSpriteTextureAssetExist(const AZStd::string& pathname) return CSprite::DoesSpriteTextureAssetExist(pathname); } +//////////////////////////////////////////////////////////////////////////////////////////////////// +AZ::Data::Instance CLyShine::LoadTexture(const AZStd::string& pathname) +{ + return CDraw2d::LoadTexture(pathname); +} + //////////////////////////////////////////////////////////////////////////////////////////////////// void CLyShine::PostInit() { @@ -691,7 +697,7 @@ void CLyShine::RenderUiCursor() AZ::RHI::Size cursorSize = m_uiCursorTexture->GetDescriptor().m_size; const AZ::Vector2 dimensions(aznumeric_cast(cursorSize.m_width), aznumeric_cast(cursorSize.m_height)); - CDraw2d::ImageOptions imageOptions; + IDraw2d::ImageOptions imageOptions; imageOptions.m_clamp = true; const float opacity = 1.0f; const float rotation = 0.0f; diff --git a/Gems/LyShine/Code/Source/LyShine.h b/Gems/LyShine/Code/Source/LyShine.h index 82f902a9f8..eab52258c1 100644 --- a/Gems/LyShine/Code/Source/LyShine.h +++ b/Gems/LyShine/Code/Source/LyShine.h @@ -72,6 +72,7 @@ public: ISprite* LoadSprite(const AZStd::string& pathname) override; ISprite* CreateSprite(const AZStd::string& renderTargetName) override; bool DoesSpriteTextureAssetExist(const AZStd::string& pathname) override; + AZ::Data::Instance LoadTexture(const AZStd::string& pathname) override; void PostInit() override; diff --git a/Gems/LyShine/Code/Source/LyShineDebug.cpp b/Gems/LyShine/Code/Source/LyShineDebug.cpp index bb57e70857..7e99652f45 100644 --- a/Gems/LyShine/Code/Source/LyShineDebug.cpp +++ b/Gems/LyShine/Code/Source/LyShineDebug.cpp @@ -7,7 +7,7 @@ */ #include "LyShineDebug.h" #include "IConsole.h" -#include +#include #include @@ -377,7 +377,7 @@ static void DebugDrawColoredBox(AZ::Vector2 pos, AZ::Vector2 size, AZ::Color col { IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); - CDraw2d::ImageOptions imageOptions = draw2d->GetDefaultImageOptions(); + IDraw2d::ImageOptions imageOptions = draw2d->GetDefaultImageOptions(); imageOptions.color = color.GetAsVector3(); auto whiteTexture = AZ::RPI::ImageSystemInterface::Get()->GetSystemImage(AZ::RPI::SystemImage::White); draw2d->DrawImageAligned(whiteTexture, pos, size, horizontalAlignment, verticalAlignment, @@ -392,7 +392,7 @@ static void DebugDrawStringWithSizeBox(AZStd::string_view font, unsigned int eff { IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); - CDraw2d::TextOptions textOptions = draw2d->GetDefaultTextOptions(); + IDraw2d::TextOptions textOptions = draw2d->GetDefaultTextOptions(); if (!font.empty()) { textOptions.fontName = font; @@ -618,7 +618,7 @@ static AZ::Vector2 DebugDrawFontColorTestBox(AZ::Vector2 pos, const char* string float pointSize = 32.0f; const float spacing = 6.0f; - CDraw2d::TextOptions textOptions = draw2d->GetDefaultTextOptions(); + IDraw2d::TextOptions textOptions = draw2d->GetDefaultTextOptions(); textOptions.effectIndex = 1; // no drop shadow baked in textOptions.color = color; @@ -742,7 +742,7 @@ static void DebugDraw2dImageColor() AZ::Data::Instance texture = GetMonoAlphaTestTexture(); - CDraw2d::ImageOptions imageOptions = draw2d->GetDefaultImageOptions(); + IDraw2d::ImageOptions imageOptions = draw2d->GetDefaultImageOptions(); draw2d->DrawText( "Testing image colors, image is black and white, top row is opacity=1, bottom row is opacity = 0.5", @@ -780,7 +780,7 @@ static void DebugDraw2dImageBlendMode() AZ::Data::Instance texture = GetColorAlphaTestTexture(); - CDraw2d::ImageOptions imageOptions = draw2d->GetDefaultImageOptions(); + IDraw2d::ImageOptions imageOptions = draw2d->GetDefaultImageOptions(); draw2d->DrawText("Testing blend modes, src blend changes across x-axis, dst blend changes across y axis", AZ::Vector2(20, 20), 16); @@ -801,7 +801,7 @@ static void DebugDraw2dImageBlendMode() AZ::Vector2 pos(xStart + xSpacing * srcIndex, yStart + ySpacing * dstIndex); // first draw a background with varying color and alpha - CDraw2d::VertexPosColUV verts[4] = + IDraw2d::VertexPosColUV verts[4] = { { // top left AZ::Vector2(pos.GetX(), pos.GetY()), @@ -828,7 +828,7 @@ static void DebugDraw2dImageBlendMode() // Draw the image with this color - CDraw2d::RenderState renderState; + IDraw2d::RenderState renderState; renderState.m_blendState.m_blendSource = g_srcBlendModes[srcIndex]; renderState.m_blendState.m_blendDest = g_dstBlendModes[dstIndex]; draw2d->DrawImage(texture, pos, size, 1.0f, 0.0f, 0, 0, &imageOptions); @@ -845,7 +845,7 @@ static void DebugDraw2dImageUVs() AZ::Data::Instance texture = GetColorTestTexture(); - CDraw2d::ImageOptions imageOptions = draw2d->GetDefaultImageOptions(); + IDraw2d::ImageOptions imageOptions = draw2d->GetDefaultImageOptions(); draw2d->DrawText( "Testing DrawImage with minMaxTexCoords. Full image, top left quadrant, middle section, full flipped", @@ -894,7 +894,7 @@ static void DebugDraw2dImagePixelRounding() AZ::Data::Instance texture = GetColorTestTexture(); - CDraw2d::ImageOptions imageOptions = draw2d->GetDefaultImageOptions(); + IDraw2d::ImageOptions imageOptions = draw2d->GetDefaultImageOptions(); draw2d->DrawText("Testing DrawImage pixel rounding options", AZ::Vector2(20, 20), 16); @@ -933,7 +933,7 @@ static void DebugDraw2dLineBasic() { IDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); - CDraw2d::ImageOptions imageOptions = draw2d->GetDefaultImageOptions(); + IDraw2d::ImageOptions imageOptions = draw2d->GetDefaultImageOptions(); draw2d->DrawText("Testing DrawLine", AZ::Vector2(20, 20), 16); diff --git a/Gems/LyShine/Code/Source/UiCanvasComponent.cpp b/Gems/LyShine/Code/Source/UiCanvasComponent.cpp index 0a21f92119..ea6e3681a3 100644 --- a/Gems/LyShine/Code/Source/UiCanvasComponent.cpp +++ b/Gems/LyShine/Code/Source/UiCanvasComponent.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include diff --git a/Gems/LyShine/Code/Source/UiCanvasManager.cpp b/Gems/LyShine/Code/Source/UiCanvasManager.cpp index 70646246f0..fc373f17f6 100644 --- a/Gems/LyShine/Code/Source/UiCanvasManager.cpp +++ b/Gems/LyShine/Code/Source/UiCanvasManager.cpp @@ -6,7 +6,7 @@ * */ #include "UiCanvasManager.h" -#include +#include #include "UiCanvasFileObject.h" #include "UiCanvasComponent.h" @@ -1020,7 +1020,7 @@ void UiCanvasManager::DebugDisplayCanvasData(int setting) const // local function to write a line of text (with a background rect) and increment Y offset AZStd::function WriteLine = [&](const char* buffer, const AZ::Vector3& color) { - CDraw2d::TextOptions textOptions = draw2d->GetDefaultTextOptions(); + IDraw2d::TextOptions textOptions = draw2d->GetDefaultTextOptions(); textOptions.color = color; AZ::Vector2 textSize = draw2d->GetTextSize(buffer, fontSize, &textOptions); AZ::Vector2 rectTopLeft = AZ::Vector2(xOffset - 2, yOffset); @@ -1174,7 +1174,7 @@ void UiCanvasManager::DebugDisplayDrawCallData() const // local function to write a line of text (with a background rect) and increment Y offset AZStd::function WriteLine = [&](const char* buffer, const AZ::Vector3& color) { - CDraw2d::TextOptions textOptions = draw2d->GetDefaultTextOptions(); + IDraw2d::TextOptions textOptions = draw2d->GetDefaultTextOptions(); textOptions.color = color; AZ::Vector2 textSize = draw2d->GetTextSize(buffer, fontSize, &textOptions); AZ::Vector2 rectTopLeft = AZ::Vector2(xOffset - 2, yOffset); diff --git a/Gems/LyShine/Code/Source/UiFaderComponent.cpp b/Gems/LyShine/Code/Source/UiFaderComponent.cpp index e1f5153e99..e84e5162b5 100644 --- a/Gems/LyShine/Code/Source/UiFaderComponent.cpp +++ b/Gems/LyShine/Code/Source/UiFaderComponent.cpp @@ -7,7 +7,7 @@ */ #include "UiFaderComponent.h" #include "RenderGraph.h" -#include +#include #include #include diff --git a/Gems/LyShine/Code/Source/UiImageComponent.cpp b/Gems/LyShine/Code/Source/UiImageComponent.cpp index baf210a629..a8b4210d6b 100644 --- a/Gems/LyShine/Code/Source/UiImageComponent.cpp +++ b/Gems/LyShine/Code/Source/UiImageComponent.cpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include #include diff --git a/Gems/LyShine/Code/Source/UiImageSequenceComponent.cpp b/Gems/LyShine/Code/Source/UiImageSequenceComponent.cpp index 4e7d22d96a..3559dc6306 100644 --- a/Gems/LyShine/Code/Source/UiImageSequenceComponent.cpp +++ b/Gems/LyShine/Code/Source/UiImageSequenceComponent.cpp @@ -9,7 +9,7 @@ #include "Sprite.h" #include "RenderGraph.h" -#include +#include #include #include #include diff --git a/Gems/LyShine/Code/Source/UiMaskComponent.cpp b/Gems/LyShine/Code/Source/UiMaskComponent.cpp index 09975d1351..67ba8ee0fb 100644 --- a/Gems/LyShine/Code/Source/UiMaskComponent.cpp +++ b/Gems/LyShine/Code/Source/UiMaskComponent.cpp @@ -6,7 +6,7 @@ * */ #include "UiMaskComponent.h" -#include +#include #include #include diff --git a/Gems/LyShine/Code/Source/UiRenderer.cpp b/Gems/LyShine/Code/Source/UiRenderer.cpp index 3b835dec92..a9c56ece90 100644 --- a/Gems/LyShine/Code/Source/UiRenderer.cpp +++ b/Gems/LyShine/Code/Source/UiRenderer.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include //////////////////////////////////////////////////////////////////////////////////////////////////// // PUBLIC MEMBER FUNCTIONS @@ -449,7 +449,7 @@ void UiRenderer::DebugDisplayTextureData(int recordingOption) // local function to write a line of text (with a background rect) and increment Y offset AZStd::function WriteLine = [&](const char* buffer, const AZ::Vector3& color) { - CDraw2d::TextOptions textOptions = draw2d->GetDefaultTextOptions(); + IDraw2d::TextOptions textOptions = draw2d->GetDefaultTextOptions(); textOptions.color = color; AZ::Vector2 textSize = draw2d->GetTextSize(buffer, fontSize, &textOptions); AZ::Vector2 rectTopLeft = AZ::Vector2(xOffset - 2, yOffset); diff --git a/Gems/LyShine/Code/Source/UiTextComponent.cpp b/Gems/LyShine/Code/Source/UiTextComponent.cpp index 01cfd49e99..aa0235470a 100644 --- a/Gems/LyShine/Code/Source/UiTextComponent.cpp +++ b/Gems/LyShine/Code/Source/UiTextComponent.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include @@ -1105,7 +1105,7 @@ UiTextComponent::InlineImage::InlineImage(const AZStd::string& texturePathname, else { // Load the texture - m_texture = CDraw2d::LoadTexture(m_filepath); + m_texture = Draw2dHelper::LoadTexture(m_filepath); if (m_texture) { AZ::RHI::Size size = m_texture->GetDescriptor().m_size; @@ -1157,7 +1157,7 @@ bool UiTextComponent::InlineImage::OnAtlasUnloaded(const TextureAtlasNamespace:: else { // Load the texture - m_texture = CDraw2d::LoadTexture(m_filepath); + m_texture = Draw2dHelper::LoadTexture(m_filepath); } return true; } @@ -2675,7 +2675,7 @@ void UiTextComponent::GetClickableTextRects(UiClickableTextInterface::ClickableT } else { - alignedPosition = CDraw2d::Align(pos, drawBatchLine.lineSize, m_textHAlignment, IDraw2d::VAlign::Top); // y is already aligned + alignedPosition = Draw2dHelper::Align(pos, drawBatchLine.lineSize, m_textHAlignment, IDraw2d::VAlign::Top); // y is already aligned } alignedPosition.SetY(alignedPosition.GetY() + newlinePosYIncrement); @@ -4043,7 +4043,7 @@ void UiTextComponent::RenderDrawBatchLines( } else { - alignedPosition = CDraw2d::Align(pos, drawBatchLine.lineSize, m_textHAlignment, IDraw2d::VAlign::Top); // y is already aligned + alignedPosition = Draw2dHelper::Align(pos, drawBatchLine.lineSize, m_textHAlignment, IDraw2d::VAlign::Top); // y is already aligned } alignedPosition.SetY(alignedPosition.GetY() + newlinePosYIncrement); diff --git a/Gems/LyShine/Code/lyshine_static_files.cmake b/Gems/LyShine/Code/lyshine_static_files.cmake index 1adbe1b796..925658e756 100644 --- a/Gems/LyShine/Code/lyshine_static_files.cmake +++ b/Gems/LyShine/Code/lyshine_static_files.cmake @@ -7,8 +7,6 @@ # set(FILES - Source/Draw2d.cpp - Include/LyShine/Draw2d.h Include/LyShine/IDraw2d.h Include/LyShine/IRenderGraph.h Include/LyShine/ISprite.h @@ -88,6 +86,8 @@ set(FILES Include/LyShine/Bus/World/UiCanvasOnMeshBus.h Include/LyShine/Bus/World/UiCanvasRefBus.h Include/LyShine/Bus/Tools/UiSystemToolsBus.h + Source/Draw2d.cpp + Source/Draw2d.h Source/LyShine.cpp Source/LyShine.h Source/LyShinePassDataBus.h diff --git a/Gems/LyShine/gem.json b/Gems/LyShine/gem.json index f3c3fc2c67..8dcac6404a 100644 --- a/Gems/LyShine/gem.json +++ b/Gems/LyShine/gem.json @@ -24,6 +24,7 @@ "Atom_Bootstrap", "AtomFont", "TextureAtlas", - "AtomToolsFramework" + "AtomToolsFramework", + "UiBasics" ] } diff --git a/Gems/LyShineExamples/Code/CMakeLists.txt b/Gems/LyShineExamples/Code/CMakeLists.txt index 6e8f53d5cd..40032d6342 100644 --- a/Gems/LyShineExamples/Code/CMakeLists.txt +++ b/Gems/LyShineExamples/Code/CMakeLists.txt @@ -21,7 +21,7 @@ ly_add_target( Gem::LmbrCentral PUBLIC Legacy::CryCommon - Gem::LyShine.Static + Gem::LyShine.Clients.API ) ly_add_target( @@ -42,7 +42,7 @@ ly_add_target( # if enabled, LyShineExamples is used by all kinds of applications, however, the dependency to LmbrCentral is different # per application type -ly_create_alias(NAME LyShineExamples.Builders NAMESPACE Gem TARGETS Gem::LyShineExamples Gem::LmbrCentral.Editor) +ly_create_alias(NAME LyShineExamples.Builders NAMESPACE Gem TARGETS Gem::LyShineExamples Gem::UiBasics.Builders Gem::LmbrCentral.Editor) ly_create_alias(NAME LyShineExamples.Tools NAMESPACE Gem TARGETS Gem::LyShineExamples Gem::LmbrCentral.Editor) ly_create_alias(NAME LyShineExamples.Clients NAMESPACE Gem TARGETS Gem::LyShineExamples Gem::LmbrCentral) ly_create_alias(NAME LyShineExamples.Servers NAMESPACE Gem TARGETS Gem::LyShineExamples Gem::LmbrCentral) diff --git a/Gems/LyShineExamples/Code/Source/UiCustomImageComponent.cpp b/Gems/LyShineExamples/Code/Source/UiCustomImageComponent.cpp index 542e18b98c..e8b0e4370a 100644 --- a/Gems/LyShineExamples/Code/Source/UiCustomImageComponent.cpp +++ b/Gems/LyShineExamples/Code/Source/UiCustomImageComponent.cpp @@ -14,7 +14,7 @@ #include #include -#include +#include #include #include #include diff --git a/Gems/MessagePopup/Code/CMakeLists.txt b/Gems/MessagePopup/Code/CMakeLists.txt index 51ec1a3bd1..2ed9c71632 100644 --- a/Gems/MessagePopup/Code/CMakeLists.txt +++ b/Gems/MessagePopup/Code/CMakeLists.txt @@ -19,7 +19,7 @@ ly_add_target( BUILD_DEPENDENCIES PUBLIC Legacy::CryCommon - Gem::LyShine + Gem::LyShine.Clients.API ) ly_add_target( @@ -39,4 +39,4 @@ ly_add_target( # MessagePopup is used only in client applications ly_create_alias(NAME MessagePopup.Clients NAMESPACE Gem TARGETS Gem::MessagePopup) - +ly_create_alias(NAME MessagePopup.Builders NAMESPACE Gem TARGETS Gem::UiBasics.Builders) diff --git a/Gems/UiBasics/CMakeLists.txt b/Gems/UiBasics/CMakeLists.txt index 8d71bd08c7..9c3cf01d26 100644 --- a/Gems/UiBasics/CMakeLists.txt +++ b/Gems/UiBasics/CMakeLists.txt @@ -9,4 +9,5 @@ # This will export its "SourcePaths" to the generated "cmake_dependencies..assetbuilder.setreg" if(PAL_TRAIT_BUILD_HOST_TOOLS) ly_create_alias(NAME UiBasics.Builders NAMESPACE Gem) + ly_create_alias(NAME UiBasics.Tools NAMESPACE Gem) endif() diff --git a/Gems/VirtualGamepad/Code/CMakeLists.txt b/Gems/VirtualGamepad/Code/CMakeLists.txt index d32834633f..6700004a30 100644 --- a/Gems/VirtualGamepad/Code/CMakeLists.txt +++ b/Gems/VirtualGamepad/Code/CMakeLists.txt @@ -21,7 +21,7 @@ ly_add_target( AZ::AzCore AZ::AzFramework Legacy::CryCommon - Gem::LyShine + Gem::LyShine.Clients.API ) ly_add_target( @@ -42,4 +42,4 @@ ly_add_target( # the virtual gamepad is needed everywhere except servers: ly_create_alias(NAME VirtualGamepad.Clients NAMESPACE Gem TARGETS Gem::VirtualGamepad) ly_create_alias(NAME VirtualGamepad.Tools NAMESPACE Gem TARGETS Gem::VirtualGamepad) -ly_create_alias(NAME VirtualGamepad.Builders NAMESPACE Gem TARGETS Gem::VirtualGamepad) +ly_create_alias(NAME VirtualGamepad.Builders NAMESPACE Gem TARGETS Gem::VirtualGamepad Gem::UiBasics.Builders) From 13d6451b6a806e23aa00e664a90d5c7a4d272381 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Thu, 13 Jan 2022 13:24:48 -0800 Subject: [PATCH 466/948] update parser and unit tests to respect the new way slots are added to user function nodes Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../Grammar/AbstractCodeModel.cpp | 70 +- ...nitTest_PromotedUserVariables.scriptcanvas | 858 +++++++++++++ ...PromotedUserVariablesFunction.scriptcanvas | 1100 +++++++++++++++++ .../Tests/ScriptCanvas_RuntimeInterpreted.cpp | 5 + 4 files changed, 2012 insertions(+), 21 deletions(-) create mode 100644 Gems/ScriptCanvasTesting/Assets/ScriptCanvas/UnitTests/LY_SC_UnitTest_PromotedUserVariables.scriptcanvas create mode 100644 Gems/ScriptCanvasTesting/Assets/ScriptCanvas/UnitTests/LY_SC_UnitTest_PromotedUserVariablesFunction.scriptcanvas diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp index 299718fd0f..b2194e1bd0 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp @@ -240,7 +240,6 @@ namespace ScriptCanvas // #sc_user_slot_variable_ux 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) @@ -1714,6 +1713,7 @@ namespace ScriptCanvas auto iter = m_inputVariableByNodelingInSlot.find(input); if (iter != m_inputVariableByNodelingInSlot.end()) { + // #sc_user_slot_variable_ux don't add variable name if not necessary VariablePtr variable = iter->second; const Slot* slot = iter->first; variable->m_name = call->ModScope()->AddVariableName(slot->GetName()); @@ -4644,35 +4644,59 @@ namespace ScriptCanvas void AbstractCodeModel::ParseNodelingVariables(const Node& node, NodelingType nodelingType) { - // #sc_user_slot_variable_ux adjust once datums are more coordinated - auto createVariablesSlots = [&](AZStd::unordered_map& variablesBySlots, const AZStd::vector& slots, bool slotHasDatum) + // This function accounts for all the ways users have been able to introduce input/output data in their SC function definitions. + // They have been able to create slots, variables, or both. This function reads the datums to create the correct ACM + // variable per required SC user variable. It uses slots as the key, and checks datums in the SC variable list for possible + // matches. + auto createVariablesSlots = [&](AZStd::unordered_map& variablesBySlots, const AZStd::vector& slots, bool errorOnMissingDatum) { for (const auto& slot : slots) { auto variable = AZStd::make_shared(); + auto variableDatum = slot->FindDatum(); + bool initializeDatum = true; - if (slotHasDatum) + if (variableDatum) { - auto variableDatum = slot->FindDatum(); - if (!variableDatum) - { - AddError(nullptr, aznew Internal::ParseError(node.GetEntityId(), AZStd::string::format("Datum missing from Slot %s on Node %s", slot->GetName().data(), node.GetNodeName().c_str()))); - return; - } + initializeDatum = false; + } + else if (errorOnMissingDatum) + { + AddError(nullptr, aznew Internal::ParseError(node.GetEntityId(), AZStd::string::format("Datum missing from Slot %s on Node %s", slot->GetName().data(), node.GetNodeName().c_str()))); + return; + } + + // find the other variable + auto iter = m_sourceVariableByDatum.find(variableDatum); + if (iter != m_sourceVariableByDatum.end()) + { + initializeDatum = false; + } + else if (!variableDatum && errorOnMissingDatum) + { + AddError(nullptr, aznew Internal::ParseError(node.GetEntityId(), AZStd::string::format("Datum missing from Slot %s on Node %s", slot->GetName().data(), node.GetNodeName().c_str()))); + return; + } - // #sc_user_slot_variable_ux consider getting all variables from the UX variable manager, or from the ACM and looking them up in the variable manager for ordering -// auto iter = m_sourceVariableByDatum.find(variableDatum); -// if (iter == m_sourceVariableByDatum.end()) -// { -// AddError(nullptr, aznew Internal::ParseError(node.GetEntityId(), AZStd::string::format("Datum missing from Slot %s on Node %s", slot->GetName().data(), node.GetNodeName().c_str()))); -// return; -// } -// variable->m_sourceVariableId = iter->second->GetVariableId(); + VariablePtr premadeVariable = iter != m_sourceVariableByDatum.end() + ? AZStd::const_pointer_cast(FindVariable(iter->second->GetVariableId())) + : VariablePtr(); + + if (premadeVariable) + { + initializeDatum = false; + variable = premadeVariable; + } + + variable->m_sourceSlotId = slot->GetId(); + + if (!premadeVariable && variableDatum) + { variable->m_datum = *variableDatum; } - else + + if (initializeDatum) { - // make a new datum and a source slot id and all that variable->m_datum.SetType(slot->GetDataType()); } @@ -4680,7 +4704,11 @@ namespace ScriptCanvas variable->m_sourceSlotId = slot->GetId(); variable->m_isFromFunctionDefinitionSlot = true; variablesBySlots.insert({ slot, variable }); - m_variables.push_back(variable); + + if (!premadeVariable) + { + m_variables.push_back(variable); + } } }; diff --git a/Gems/ScriptCanvasTesting/Assets/ScriptCanvas/UnitTests/LY_SC_UnitTest_PromotedUserVariables.scriptcanvas b/Gems/ScriptCanvasTesting/Assets/ScriptCanvas/UnitTests/LY_SC_UnitTest_PromotedUserVariables.scriptcanvas new file mode 100644 index 0000000000..6ac83f4b62 --- /dev/null +++ b/Gems/ScriptCanvasTesting/Assets/ScriptCanvas/UnitTests/LY_SC_UnitTest_PromotedUserVariables.scriptcanvas @@ -0,0 +1,858 @@ +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "ScriptCanvasData", + "ClassData": { + "m_scriptCanvas": { + "Id": { + "id": 8475300026301128284 + }, + "Name": "Script Canvas Graph", + "Components": { + "Component_[11907165653188402756]": { + "$type": "EditorGraphVariableManagerComponent", + "Id": 11907165653188402756 + }, + "Component_[3578973614457412392]": { + "$type": "{4D755CA9-AB92-462C-B24F-0B3376F19967} Graph", + "Id": 3578973614457412392, + "m_graphData": { + "m_nodes": [ + { + "Id": { + "id": 16019084446641 + }, + "Name": "SC-Node(Start)", + "Components": { + "Component_[1767232296153779726]": { + "$type": "Start", + "Id": 1767232296153779726, + "Slots": [ + { + "id": { + "m_id": "{635D7286-4B19-44D4-8F5E-1B4A0CF85C9E}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "toolTip": "Signaled when the entity that owns this graph is fully activated.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ] + } + } + }, + { + "Id": { + "id": 7910364941488 + }, + "Name": "SC-Node(Mark Complete)", + "Components": { + "Component_[1885955816756801547]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 1885955816756801547, + "Slots": [ + { + "isVisibile": false, + "id": { + "m_id": "{31ABE549-E2E3-440E-884C-9F7FD4185C1D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "EntityId: 0", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{4FFA1776-D933-4475-BB3C-5BD7FAD47E2B}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Report", + "toolTip": "additional notes for the test report", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{F8687B16-9C64-4B5E-B000-035D9B3712EF}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{0E8012D1-A36B-4BCC-86C9-7D4F93816923}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 1 + }, + "isNullPointer": false, + "$type": "EntityId", + "value": { + "id": 4276206253 + } + }, + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "", + "label": "Report" + } + ], + "methodType": 2, + "methodName": "Mark Complete", + "className": "Unit Testing", + "inputSlots": [ + { + "m_id": "{31ABE549-E2E3-440E-884C-9F7FD4185C1D}" + }, + { + "m_id": "{4FFA1776-D933-4475-BB3C-5BD7FAD47E2B}" + } + ], + "prettyClassName": "Unit Testing" + } + } + }, + { + "Id": { + "id": 16611789933489 + }, + "Name": "SC-Node(Expect Equal)", + "Components": { + "Component_[6935885723653735789]": { + "$type": "MethodOverloaded", + "Id": 6935885723653735789, + "Slots": [ + { + "isVisibile": false, + "id": { + "m_id": "{E2AB1183-3D7C-479C-88D5-8C90042F9D3F}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "EntityId: 0", + "DisplayDataType": { + "m_type": 1 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{8D954D4E-D65E-47E4-8979-BAE900582B38}" + }, + "DynamicTypeOverride": 1, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "OverloadContract" + } + ], + "slotName": "Candidate", + "toolTip": "left of ==", + "DisplayDataType": { + "m_type": 3 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{17DA7626-AA06-4574-8F27-9DE230F03639}" + }, + "DynamicTypeOverride": 1, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "OverloadContract" + } + ], + "slotName": "Reference", + "toolTip": "right of ==", + "DisplayDataType": { + "m_type": 3 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{B442C3D0-F6F5-4689-982B-67CDF723D505}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Report", + "toolTip": "additional notes for the test report", + "DisplayDataType": { + "m_type": 5 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{33531BA3-2152-4F66-BFDA-CEAC2EB631C7}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{A8A9AB24-E5B2-4947-85CC-F87AD9F97FEB}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 1 + }, + "isNullPointer": false, + "$type": "EntityId", + "value": { + "id": 4276206253 + } + }, + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0, + "label": "Candidate" + }, + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 7.0, + "label": "Reference" + }, + { + "scriptCanvasType": { + "m_type": 5 + }, + "isNullPointer": false, + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "value": "", + "label": "Report" + } + ], + "methodType": 2, + "methodName": "Expect Equal", + "className": "Unit Testing", + "inputSlots": [ + { + "m_id": "{E2AB1183-3D7C-479C-88D5-8C90042F9D3F}" + }, + { + "m_id": "{8D954D4E-D65E-47E4-8979-BAE900582B38}" + }, + { + "m_id": "{17DA7626-AA06-4574-8F27-9DE230F03639}" + }, + { + "m_id": "{B442C3D0-F6F5-4689-982B-67CDF723D505}" + } + ], + "orderedInputSlotIds": [ + { + "m_id": "{E2AB1183-3D7C-479C-88D5-8C90042F9D3F}" + }, + { + "m_id": "{8D954D4E-D65E-47E4-8979-BAE900582B38}" + }, + { + "m_id": "{17DA7626-AA06-4574-8F27-9DE230F03639}" + }, + { + "m_id": "{B442C3D0-F6F5-4689-982B-67CDF723D505}" + } + ], + "outputSlotIds": [ + {} + ] + } + } + }, + { + "Id": { + "id": 15443558828977 + }, + "Name": "FunctionCallNode", + "Components": { + "Component_[9383725529787702808]": { + "$type": "FunctionCallNode", + "Id": 9383725529787702808, + "Slots": [ + { + "id": { + "m_id": "{32BD3CC0-AA44-4B1F-966D-4FF1561E4BC5}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "IncrementNumber", + "DisplayGroup": { + "Value": 921414446 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{EBE31443-CFB9-41B1-8DBA-127DB07A405A}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "IncrementMe", + "DisplayGroup": { + "Value": 921414446 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{7FDF8233-D26E-4EBE-9D68-1074FD9B9999}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "DisplayGroup": { + "Value": 921414446 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{3A29CBC7-A727-4DBD-8319-0D31D299A9F0}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Incremented", + "DisplayDataType": { + "m_type": 3 + }, + "DisplayGroup": { + "Value": 2732307328 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 6.0, + "label": "IncrementMe" + } + ], + "m_sourceId": "{5F36B80D-9546-478E-AD33-BF4AFEC8FF01}", + "m_asset": { + "assetId": { + "guid": "{35A24A1D-57B7-5B0A-89C9-8BBA7657ECA5}", + "subId": 3756448882 + }, + "assetHint": "scriptcanvas/unittests/ly_sc_unittest_promoteduservariablesfunction.scriptcanvas_fn_compiled" + }, + "m_slotExecutionMap": { + "ins": [ + { + "_slotId": { + "m_id": "{32BD3CC0-AA44-4B1F-966D-4FF1561E4BC5}" + }, + "_inputs": [ + { + "_slotId": { + "m_id": "{EBE31443-CFB9-41B1-8DBA-127DB07A405A}" + }, + "_interfaceSourceId": { + "m_id": "{55F1434B-40C1-40AA-91C8-A65D6F2AFDC3}" + } + } + ], + "_outs": [ + { + "_slotId": { + "m_id": "{7FDF8233-D26E-4EBE-9D68-1074FD9B9999}" + }, + "_name": "Out", + "_outputs": [ + { + "_slotId": { + "m_id": "{3A29CBC7-A727-4DBD-8319-0D31D299A9F0}" + }, + "_interfaceSourceId": { + "m_id": "{81088CD0-BC45-4EB8-A823-DE442BF0541C}" + } + } + ], + "_interfaceSourceId": "{E9A0BF28-5910-4B0B-B82F-6519BCC1A33A}" + } + ], + "_parsedName": "IncrementNumber_scvm", + "_interfaceSourceId": "{5F36B80D-9546-478E-AD33-BF4AFEC8FF01}" + } + ] + }, + "m_slotExecutionMapSourceInterface": { + "ins": [ + { + "displayName": "IncrementNumber", + "parsedName": "IncrementNumber_scvm", + "inputs": [ + { + "displayName": "IncrementMe", + "parsedName": "IncrementMe_scvm_1", + "datum": { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0 + }, + "sourceID": { + "m_id": "{55F1434B-40C1-40AA-91C8-A65D6F2AFDC3}" + } + } + ], + "outs": [ + { + "displayName": "Out", + "parsedName": "Out", + "outputs": [ + { + "displayName": "Incremented", + "parsedName": "Incremented_scvm_1", + "type": { + "m_type": 3 + }, + "sourceID": { + "m_id": "{81088CD0-BC45-4EB8-A823-DE442BF0541C}" + } + } + ], + "sourceID": "{E9A0BF28-5910-4B0B-B82F-6519BCC1A33A}" + } + ], + "isPure": true, + "sourceID": "{5F36B80D-9546-478E-AD33-BF4AFEC8FF01}" + } + ], + "outKeys": [ + { + "Value": 3119148441 + } + ], + "namespacePath": [ + "scriptcanvas", + "unittests", + "ly_sc_unittest_promoteduservariablesfunction_vm" + ] + } + } + } + } + ], + "m_connections": [ + { + "Id": { + "id": 16482940914609 + }, + "Name": "srcEndpoint=(On Graph Start: Out), destEndpoint=(Function Call Node: IncrementNumber)", + "Components": { + "Component_[1325606044371455697]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 1325606044371455697, + "sourceEndpoint": { + "nodeId": { + "id": 16019084446641 + }, + "slotId": { + "m_id": "{635D7286-4B19-44D4-8F5E-1B4A0CF85C9E}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 15443558828977 + }, + "slotId": { + "m_id": "{32BD3CC0-AA44-4B1F-966D-4FF1561E4BC5}" + } + } + } + } + }, + { + "Id": { + "id": 17672646855601 + }, + "Name": "srcEndpoint=(Function Call Node: Out), destEndpoint=(Expect Equal: In)", + "Components": { + "Component_[553888750995224414]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 553888750995224414, + "sourceEndpoint": { + "nodeId": { + "id": 15443558828977 + }, + "slotId": { + "m_id": "{7FDF8233-D26E-4EBE-9D68-1074FD9B9999}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 16611789933489 + }, + "slotId": { + "m_id": "{33531BA3-2152-4F66-BFDA-CEAC2EB631C7}" + } + } + } + } + }, + { + "Id": { + "id": 18003359337393 + }, + "Name": "srcEndpoint=(Function Call Node: Incremented), destEndpoint=(Expect Equal: Candidate)", + "Components": { + "Component_[6929789752232921563]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 6929789752232921563, + "sourceEndpoint": { + "nodeId": { + "id": 15443558828977 + }, + "slotId": { + "m_id": "{3A29CBC7-A727-4DBD-8319-0D31D299A9F0}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 16611789933489 + }, + "slotId": { + "m_id": "{8D954D4E-D65E-47E4-8979-BAE900582B38}" + } + } + } + } + }, + { + "Id": { + "id": 8902502386864 + }, + "Name": "srcEndpoint=(Expect Equal: Out), destEndpoint=(Mark Complete: In)", + "Components": { + "Component_[11962156650601495433]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 11962156650601495433, + "sourceEndpoint": { + "nodeId": { + "id": 16611789933489 + }, + "slotId": { + "m_id": "{A8A9AB24-E5B2-4947-85CC-F87AD9F97FEB}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 7910364941488 + }, + "slotId": { + "m_id": "{F8687B16-9C64-4B5E-B000-035D9B3712EF}" + } + } + } + } + } + ] + }, + "m_assetType": "{1D497BC7-F97F-0000-80C2-359B6A010000}", + "versionData": { + "_grammarVersion": 1, + "_runtimeVersion": 1, + "_fileVersion": 1 + }, + "GraphCanvasData": [ + { + "Key": { + "id": 7910364941488 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 620.0, + 320.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{69405A2B-8669-41A0-9660-74C8ECCE8B84}" + } + } + } + }, + { + "Key": { + "id": 15443558828977 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 100.0, + 100.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{61B5E23D-2C56-4183-9606-AC0A4B788B7E}" + } + } + } + }, + { + "Key": { + "id": 16019084446641 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "TimeNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + -80.0, + 60.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{A7B4E93B-07A1-43DC-BE07-4DC5A1D64352}" + } + } + } + }, + { + "Key": { + "id": 16611789933489 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 300.0, + 300.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{5EDF60ED-BF05-4AC4-85D9-5988FFE7C2A7}" + } + } + } + }, + { + "Key": { + "id": 8475300026301128284 + }, + "Value": { + "ComponentData": { + "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { + "$type": "SceneComponentSaveData" + } + } + } + } + ], + "StatisticsHelper": { + "InstanceCounter": [ + { + "Key": 4053150093067829293, + "Value": 1 + }, + { + "Key": 4199610336680704683, + "Value": 1 + }, + { + "Key": 6740857896271713458, + "Value": 1 + }, + { + "Key": 10204019744198319120, + "Value": 1 + } + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/Gems/ScriptCanvasTesting/Assets/ScriptCanvas/UnitTests/LY_SC_UnitTest_PromotedUserVariablesFunction.scriptcanvas b/Gems/ScriptCanvasTesting/Assets/ScriptCanvas/UnitTests/LY_SC_UnitTest_PromotedUserVariablesFunction.scriptcanvas new file mode 100644 index 0000000000..0fe5b1a730 --- /dev/null +++ b/Gems/ScriptCanvasTesting/Assets/ScriptCanvas/UnitTests/LY_SC_UnitTest_PromotedUserVariablesFunction.scriptcanvas @@ -0,0 +1,1100 @@ +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "ScriptCanvasData", + "ClassData": { + "m_scriptCanvas": { + "Id": { + "id": 8918912361393065975 + }, + "Name": "Script Canvas Graph", + "Components": { + "Component_[14098532328271403379]": { + "$type": "EditorGraphVariableManagerComponent", + "Id": 14098532328271403379, + "m_variableData": { + "m_nameVariableMap": [ + { + "Key": { + "m_id": "{55F1434B-40C1-40AA-91C8-A65D6F2AFDC3}" + }, + "Value": { + "Datum": { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0 + }, + "VariableId": { + "m_id": "{55F1434B-40C1-40AA-91C8-A65D6F2AFDC3}" + }, + "VariableName": "IncrementMe", + "Scope": 1 + } + }, + { + "Key": { + "m_id": "{71AAA826-F605-4EA7-8445-76CBCE253BE0}" + }, + "Value": { + "Datum": { + "scriptCanvasType": { + "m_type": 0 + }, + "isNullPointer": false, + "$type": "bool", + "value": false + }, + "VariableId": { + "m_id": "{71AAA826-F605-4EA7-8445-76CBCE253BE0}" + }, + "VariableName": "OnlyOne", + "Scope": 1 + } + }, + { + "Key": { + "m_id": "{793CF8BD-AF82-484E-AFD3-54EA328D9663}" + }, + "Value": { + "Datum": { + "scriptCanvasType": { + "m_type": 0 + }, + "isNullPointer": false, + "$type": "bool", + "value": false, + "label": "alsoTwo" + }, + "VariableId": { + "m_id": "{793CF8BD-AF82-484E-AFD3-54EA328D9663}" + }, + "VariableName": "alsoTwo", + "Scope": 1 + } + }, + { + "Key": { + "m_id": "{81088CD0-BC45-4EB8-A823-DE442BF0541C}" + }, + "Value": { + "Datum": { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0, + "label": "Incremented" + }, + "VariableId": { + "m_id": "{81088CD0-BC45-4EB8-A823-DE442BF0541C}" + }, + "VariableName": "Incremented", + "Scope": 1 + } + } + ] + } + }, + "Component_[2840022707551160176]": { + "$type": "{4D755CA9-AB92-462C-B24F-0B3376F19967} Graph", + "Id": 2840022707551160176, + "m_graphData": { + "m_nodes": [ + { + "Id": { + "id": 7454919658417 + }, + "Name": "SC Node(SetVariable)", + "Components": { + "Component_[13386694676262750118]": { + "$type": "SetVariableNode", + "Id": 13386694676262750118, + "Slots": [ + { + "id": { + "m_id": "{22483279-E500-40D5-A61B-2C78DAC3319A}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "When signaled sends the variable referenced by this node to a Data Output slot", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{17296A41-81F9-444D-BA2E-B8DAD7C62B10}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "toolTip": "Signaled after the referenced variable has been pushed to the Data Output slot", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{8D9CBBAD-5F75-4397-8139-B7FE79C48DFD}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Number", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{A21214FF-8D17-48B1-9A29-E805230F8942}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Number", + "DisplayDataType": { + "m_type": 3 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0, + "label": "Number" + } + ], + "m_variableId": { + "m_id": "{81088CD0-BC45-4EB8-A823-DE442BF0541C}" + }, + "m_variableDataInSlotId": { + "m_id": "{8D9CBBAD-5F75-4397-8139-B7FE79C48DFD}" + }, + "m_variableDataOutSlotId": { + "m_id": "{A21214FF-8D17-48B1-9A29-E805230F8942}" + } + } + } + }, + { + "Id": { + "id": 3946110127280 + }, + "Name": "SC Node(GetVariable)", + "Components": { + "Component_[14162979093169706711]": { + "$type": "GetVariableNode", + "Id": 14162979093169706711, + "Slots": [ + { + "id": { + "m_id": "{D0D0EC9C-927F-42DB-AD22-412F374326CD}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "When signaled sends the property referenced by this node to a Data Output slot", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{484C5712-DB44-4A98-8199-11E47AC3D837}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "toolTip": "Signaled after the referenced property has been pushed to the Data Output slot", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{71712AB8-E5BC-42EC-A07E-733D0D36F830}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Number", + "DisplayDataType": { + "m_type": 3 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "m_variableId": { + "m_id": "{55F1434B-40C1-40AA-91C8-A65D6F2AFDC3}" + }, + "m_variableDataOutSlotId": { + "m_id": "{71712AB8-E5BC-42EC-A07E-733D0D36F830}" + } + } + } + }, + { + "Id": { + "id": 5620968623025 + }, + "Name": "SC-Node(FunctionDefinitionNode)", + "Components": { + "Component_[15563419574622171620]": { + "$type": "FunctionDefinitionNode", + "Id": 15563419574622171620, + "Slots": [ + { + "id": { + "m_id": "{8362D954-5F68-4DAB-94B3-1EFA2B2774FB}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "DisplayGroupConnectedSlotLimitContract", + "limit": 1, + "displayGroup": "NodelingSlotDisplayGroup", + "errorMessage": "Execution nodes can only be connected to either the Input or Output, and not both at the same time." + }, + { + "$type": "DisallowReentrantExecutionContract" + } + ], + "slotName": " ", + "DisplayGroup": { + "Value": 3992535411 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "isVisibile": false, + "id": { + "m_id": "{8F6E144D-A6A4-4A5D-8D47-D4FB5E165EAC}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "DisplayGroupConnectedSlotLimitContract", + "limit": 1, + "displayGroup": "NodelingSlotDisplayGroup", + "errorMessage": "Execution nodes can only be connected to either the Input or Output, and not both at the same time." + } + ], + "slotName": " ", + "DisplayGroup": { + "Value": 3992535411 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{67EC591D-BB4D-4D92-8FBE-617561EFD79D}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Incremented", + "DisplayDataType": { + "m_type": 3 + }, + "DisplayGroup": { + "Value": 452080683 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1, + "IsReference": true, + "VariableReference": { + "m_id": "{81088CD0-BC45-4EB8-A823-DE442BF0541C}" + }, + "IsUserAdded": true + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0, + "label": "Incremented" + } + ], + "m_displayName": "Out", + "m_identifier": "{E9A0BF28-5910-4B0B-B82F-6519BCC1A33A}", + "m_isExecutionEntry": false + } + } + }, + { + "Id": { + "id": 4731910392753 + }, + "Name": "SC-Node(FunctionDefinitionNode)", + "Components": { + "Component_[18278450953448842587]": { + "$type": "FunctionDefinitionNode", + "Id": 18278450953448842587, + "Slots": [ + { + "isVisibile": false, + "id": { + "m_id": "{52C8B76A-CC38-4358-9971-02B6F7E05030}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "DisplayGroupConnectedSlotLimitContract", + "limit": 1, + "displayGroup": "NodelingSlotDisplayGroup", + "errorMessage": "Execution nodes can only be connected to either the Input or Output, and not both at the same time." + }, + { + "$type": "DisallowReentrantExecutionContract" + } + ], + "slotName": " ", + "DisplayGroup": { + "Value": 3992535411 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{4C0849D0-627F-41BA-A8EE-A201074D5E52}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "DisplayGroupConnectedSlotLimitContract", + "limit": 1, + "displayGroup": "NodelingSlotDisplayGroup", + "errorMessage": "Execution nodes can only be connected to either the Input or Output, and not both at the same time." + } + ], + "slotName": " ", + "DisplayGroup": { + "Value": 3992535411 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{CFDCE169-7DE0-4DD9-A599-F0EA7360CF8A}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "IncrementMe", + "DisplayDataType": { + "m_type": 3 + }, + "DisplayGroup": { + "Value": 452080683 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1, + "IsReference": true, + "VariableReference": { + "m_id": "{55F1434B-40C1-40AA-91C8-A65D6F2AFDC3}" + }, + "IsUserAdded": true + } + ], + "m_displayName": "IncrementNumber", + "m_identifier": "{5F36B80D-9546-478E-AD33-BF4AFEC8FF01}" + } + } + }, + { + "Id": { + "id": 8502891678641 + }, + "Name": "SC-Node(OperatorAdd)", + "Components": { + "Component_[6948954108967528756]": { + "$type": "OperatorAdd", + "Id": 6948954108967528756, + "Slots": [ + { + "id": { + "m_id": "{4546CCB4-B493-435F-BAEC-B76996DBDC8F}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{52C93C3F-A8DC-47E5-98A6-5B6A15C83F92}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{9D5A6AF3-99FE-4449-83DD-261AF2107F36}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "MathOperatorContract", + "NativeTypes": [ + { + "m_type": 3 + }, + { + "m_type": 6 + }, + { + "m_type": 8 + }, + { + "m_type": 9 + }, + { + "m_type": 10 + }, + { + "m_type": 11 + }, + { + "m_type": 12 + }, + { + "m_type": 14 + }, + { + "m_type": 15 + } + ] + } + ], + "slotName": "Number", + "toolTip": "An operand to use in performing the specified Operation", + "DisplayDataType": { + "m_type": 3 + }, + "DisplayGroup": { + "Value": 1114760223 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DynamicGroup": { + "Value": 1114760223 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{440FC98B-34B5-418A-9000-6E8B6BFBFDC7}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "MathOperatorContract", + "NativeTypes": [ + { + "m_type": 3 + }, + { + "m_type": 6 + }, + { + "m_type": 8 + }, + { + "m_type": 9 + }, + { + "m_type": 10 + }, + { + "m_type": 11 + }, + { + "m_type": 12 + }, + { + "m_type": 14 + }, + { + "m_type": 15 + } + ] + } + ], + "slotName": "Number", + "toolTip": "An operand to use in performing the specified Operation", + "DisplayDataType": { + "m_type": 3 + }, + "DisplayGroup": { + "Value": 1114760223 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DynamicGroup": { + "Value": 1114760223 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{A0113449-B8EA-441F-871E-A34F10A281AF}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + { + "$type": "MathOperatorContract", + "NativeTypes": [ + { + "m_type": 3 + }, + { + "m_type": 6 + }, + { + "m_type": 8 + }, + { + "m_type": 9 + }, + { + "m_type": 10 + }, + { + "m_type": 11 + }, + { + "m_type": 12 + }, + { + "m_type": 14 + }, + { + "m_type": 15 + } + ] + } + ], + "slotName": "Result", + "toolTip": "The result of the specified operation", + "DisplayDataType": { + "m_type": 3 + }, + "DisplayGroup": { + "Value": 1114760223 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DynamicGroup": { + "Value": 1114760223 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0, + "label": "Number" + }, + { + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 1.0, + "label": "Number" + } + ] + } + } + } + ], + "m_connections": [ + { + "Id": { + "id": 11118526761905 + }, + "Name": "srcEndpoint=(Add (+): Result), destEndpoint=(Set Variable: Number)", + "Components": { + "Component_[4894099700298815938]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 4894099700298815938, + "sourceEndpoint": { + "nodeId": { + "id": 8502891678641 + }, + "slotId": { + "m_id": "{A0113449-B8EA-441F-871E-A34F10A281AF}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 7454919658417 + }, + "slotId": { + "m_id": "{8D9CBBAD-5F75-4397-8139-B7FE79C48DFD}" + } + } + } + } + }, + { + "Id": { + "id": 11466419112881 + }, + "Name": "srcEndpoint=(Add (+): Out), destEndpoint=(Set Variable: In)", + "Components": { + "Component_[17374411643043616824]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 17374411643043616824, + "sourceEndpoint": { + "nodeId": { + "id": 8502891678641 + }, + "slotId": { + "m_id": "{52C93C3F-A8DC-47E5-98A6-5B6A15C83F92}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 7454919658417 + }, + "slotId": { + "m_id": "{22483279-E500-40D5-A61B-2C78DAC3319A}" + } + } + } + } + }, + { + "Id": { + "id": 11857261136817 + }, + "Name": "srcEndpoint=(Set Variable: Out), destEndpoint=(New Output: )", + "Components": { + "Component_[13113299305621275439]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 13113299305621275439, + "sourceEndpoint": { + "nodeId": { + "id": 7454919658417 + }, + "slotId": { + "m_id": "{17296A41-81F9-444D-BA2E-B8DAD7C62B10}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 5620968623025 + }, + "slotId": { + "m_id": "{8362D954-5F68-4DAB-94B3-1EFA2B2774FB}" + } + } + } + } + }, + { + "Id": { + "id": 4817988488368 + }, + "Name": "srcEndpoint=(IncrementNumber: ), destEndpoint=(Get Variable: In)", + "Components": { + "Component_[2259136399829712910]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 2259136399829712910, + "sourceEndpoint": { + "nodeId": { + "id": 4731910392753 + }, + "slotId": { + "m_id": "{4C0849D0-627F-41BA-A8EE-A201074D5E52}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 3946110127280 + }, + "slotId": { + "m_id": "{D0D0EC9C-927F-42DB-AD22-412F374326CD}" + } + } + } + } + }, + { + "Id": { + "id": 5084276460720 + }, + "Name": "srcEndpoint=(Get Variable: Number), destEndpoint=(Add (+): Number)", + "Components": { + "Component_[10085458428308435370]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 10085458428308435370, + "sourceEndpoint": { + "nodeId": { + "id": 3946110127280 + }, + "slotId": { + "m_id": "{71712AB8-E5BC-42EC-A07E-733D0D36F830}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 8502891678641 + }, + "slotId": { + "m_id": "{9D5A6AF3-99FE-4449-83DD-261AF2107F36}" + } + } + } + } + }, + { + "Id": { + "id": 5423578877104 + }, + "Name": "srcEndpoint=(Get Variable: Out), destEndpoint=(Add (+): In)", + "Components": { + "Component_[4574112699302556330]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 4574112699302556330, + "sourceEndpoint": { + "nodeId": { + "id": 3946110127280 + }, + "slotId": { + "m_id": "{484C5712-DB44-4A98-8199-11E47AC3D837}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 8502891678641 + }, + "slotId": { + "m_id": "{4546CCB4-B493-435F-BAEC-B76996DBDC8F}" + } + } + } + } + } + ] + }, + "m_assetType": "{003738F8-FA01-0000-7300-000000000000}", + "versionData": { + "_grammarVersion": 1, + "_runtimeVersion": 1, + "_fileVersion": 1 + }, + "m_variableCounter": 4, + "GraphCanvasData": [ + { + "Key": { + "id": 3946110127280 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "GetVariableNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 140.0, + -140.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".getVariable" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{D085EC42-2893-4FFF-BF65-5A7BDBAA7CC7}" + } + } + } + }, + { + "Key": { + "id": 4731910392753 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "NodelingTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + -260.0, + -240.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".nodeling" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{DF821D33-9967-4B89-BA06-C2B8116DF1AB}" + } + } + } + }, + { + "Key": { + "id": 5620968623025 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "NodelingTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 640.0, + 160.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".nodeling" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{462CEE46-FA16-4DE3-B00C-236F49976D74}" + } + } + } + }, + { + "Key": { + "id": 7454919658417 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "SetVariableNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 660.0, + -160.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".setVariable" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{54BBBFA0-B4C7-4FA4-BE92-51E9FA1A422B}" + } + } + } + }, + { + "Key": { + "id": 8502891678641 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MathNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 320.0, + 60.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{AE983459-5498-46B7-A50B-7DF0A9D9886D}" + } + } + } + }, + { + "Key": { + "id": 8918912361393065975 + }, + "Value": { + "ComponentData": { + "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { + "$type": "SceneComponentSaveData", + "ViewParams": { + "Scale": 0.85, + "AnchorX": -196.4705810546875, + "AnchorY": -303.5294189453125 + } + } + } + } + } + ], + "StatisticsHelper": { + "InstanceCounter": [ + { + "Key": 1244476766431948410, + "Value": 1 + }, + { + "Key": 7011818094993955847, + "Value": 2 + }, + { + "Key": 8876278780785933991, + "Value": 1 + }, + { + "Key": 11663418749378679464, + "Value": 1 + } + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_RuntimeInterpreted.cpp b/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_RuntimeInterpreted.cpp index 9d75d3ed9d..3d88f014ff 100644 --- a/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_RuntimeInterpreted.cpp +++ b/Gems/ScriptCanvasTesting/Code/Tests/ScriptCanvas_RuntimeInterpreted.cpp @@ -935,3 +935,8 @@ TEST_F(ScriptCanvasTestFixture, InterpretedExecutionOutPerformance) { RunUnitTestGraph("LY_SC_UnitTest_ExecutionOutPerformance", ExecutionMode::Interpreted); } + +TEST_F(ScriptCanvasTestFixture, PromotedUserVariables) +{ + RunUnitTestGraph("LY_SC_UnitTest_PromotedUserVariables", ExecutionMode::Interpreted); +} From 42c523b27512f3697be50be637b18c400d9cec57 Mon Sep 17 00:00:00 2001 From: Vincent Liu <5900509+onecent1101@users.noreply.github.com> Date: Thu, 13 Jan 2022 16:07:44 -0800 Subject: [PATCH 467/948] Add SetEnv and UnSetEnv for environment variable to util (#6884) * Add SetEnv and UnSetEnv for environment variable to util * Move utils to AzTest * enable for ios and android * fix wrong file path --- .../Android/platform_android_files.cmake | 1 + .../AzTest/Utils_Unimplemented.cpp | 25 +++++++++++++++++++ .../Common/UnixLike/AzTest/Utils_UnixLike.cpp | 25 +++++++++++++++++++ .../Common/WinAPI/AzTest/Utils_WinAPI.cpp | 25 +++++++++++++++++++ .../Platform/Linux/platform_linux_files.cmake | 1 + .../Platform/Mac/platform_mac_files.cmake | 1 + .../Windows/platform_windows_files.cmake | 1 + .../Platform/iOS/platform_ios_files.cmake | 1 + Code/Framework/AzTest/AzTest/Utils.h | 13 ++++++++++ 9 files changed, 93 insertions(+) create mode 100644 Code/Framework/AzTest/AzTest/Platform/Common/Unimplemented/AzTest/Utils_Unimplemented.cpp create mode 100644 Code/Framework/AzTest/AzTest/Platform/Common/UnixLike/AzTest/Utils_UnixLike.cpp create mode 100644 Code/Framework/AzTest/AzTest/Platform/Common/WinAPI/AzTest/Utils_WinAPI.cpp diff --git a/Code/Framework/AzTest/AzTest/Platform/Android/platform_android_files.cmake b/Code/Framework/AzTest/AzTest/Platform/Android/platform_android_files.cmake index e0f47c8fa6..83ae97fa20 100644 --- a/Code/Framework/AzTest/AzTest/Platform/Android/platform_android_files.cmake +++ b/Code/Framework/AzTest/AzTest/Platform/Android/platform_android_files.cmake @@ -8,6 +8,7 @@ set(FILES ../Common/UnixLike/AzTest/ColorizedOutput_UnixLike.cpp + ../Common/UnixLike/AzTest/Utils_UnixLike.cpp ScopedAutoTempDirectory_Android.cpp Platform_Android.cpp AzTest_Traits_Platform.h diff --git a/Code/Framework/AzTest/AzTest/Platform/Common/Unimplemented/AzTest/Utils_Unimplemented.cpp b/Code/Framework/AzTest/AzTest/Platform/Common/Unimplemented/AzTest/Utils_Unimplemented.cpp new file mode 100644 index 0000000000..0f91ea1020 --- /dev/null +++ b/Code/Framework/AzTest/AzTest/Platform/Common/Unimplemented/AzTest/Utils_Unimplemented.cpp @@ -0,0 +1,25 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include + +namespace AZ +{ + namespace Test + { + bool SetEnv([[maybe_unused]] const char* envname, [[maybe_unused]] const char* envvalue, [[maybe_unused]] bool overwrite) + { + return false; + } + + bool UnsetEnv([[maybe_unused]] const char* envname) + { + return false; + } + } // namespace Test +} // namespace AZ diff --git a/Code/Framework/AzTest/AzTest/Platform/Common/UnixLike/AzTest/Utils_UnixLike.cpp b/Code/Framework/AzTest/AzTest/Platform/Common/UnixLike/AzTest/Utils_UnixLike.cpp new file mode 100644 index 0000000000..8efdb5d082 --- /dev/null +++ b/Code/Framework/AzTest/AzTest/Platform/Common/UnixLike/AzTest/Utils_UnixLike.cpp @@ -0,0 +1,25 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include + +namespace AZ +{ + namespace Test + { + bool SetEnv(const char* envname, const char* envvalue, bool overwrite) + { + return setenv(envname, envvalue, overwrite) != -1; + } + + bool UnsetEnv(const char* envname) + { + return unsetenv(envname) != -1; + } + } +} diff --git a/Code/Framework/AzTest/AzTest/Platform/Common/WinAPI/AzTest/Utils_WinAPI.cpp b/Code/Framework/AzTest/AzTest/Platform/Common/WinAPI/AzTest/Utils_WinAPI.cpp new file mode 100644 index 0000000000..a06cbf7ffe --- /dev/null +++ b/Code/Framework/AzTest/AzTest/Platform/Common/WinAPI/AzTest/Utils_WinAPI.cpp @@ -0,0 +1,25 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include + +namespace AZ +{ + namespace Test + { + bool SetEnv(const char* envname, const char* envvalue, [[maybe_unused]] bool overwrite) + { + return _putenv_s(envname, envvalue); + } + + bool UnsetEnv(const char* envname) + { + return SetEnv(envname, "", 1); + } + } +} diff --git a/Code/Framework/AzTest/AzTest/Platform/Linux/platform_linux_files.cmake b/Code/Framework/AzTest/AzTest/Platform/Linux/platform_linux_files.cmake index 68ca9332c7..9c6692b409 100644 --- a/Code/Framework/AzTest/AzTest/Platform/Linux/platform_linux_files.cmake +++ b/Code/Framework/AzTest/AzTest/Platform/Linux/platform_linux_files.cmake @@ -9,6 +9,7 @@ set(FILES ../Common/UnixLike/AzTest/ColorizedOutput_UnixLike.cpp ../Common/UnixLike/AzTest/ScopedAutoTempDirectory_UnixLike.cpp + ../Common/UnixLike/AzTest/Utils_UnixLike.cpp Platform_Linux.cpp AzTest_Traits_Platform.h AzTest_Traits_Linux.h diff --git a/Code/Framework/AzTest/AzTest/Platform/Mac/platform_mac_files.cmake b/Code/Framework/AzTest/AzTest/Platform/Mac/platform_mac_files.cmake index 3cbe35792c..cb641e2113 100644 --- a/Code/Framework/AzTest/AzTest/Platform/Mac/platform_mac_files.cmake +++ b/Code/Framework/AzTest/AzTest/Platform/Mac/platform_mac_files.cmake @@ -9,6 +9,7 @@ set(FILES ../Common/UnixLike/AzTest/ColorizedOutput_UnixLike.cpp ../Common/UnixLike/AzTest/ScopedAutoTempDirectory_UnixLike.cpp + ../Common/UnixLike/AzTest/Utils_UnixLike.cpp Platform_Mac.cpp AzTest_Traits_Platform.h AzTest_Traits_Mac.h diff --git a/Code/Framework/AzTest/AzTest/Platform/Windows/platform_windows_files.cmake b/Code/Framework/AzTest/AzTest/Platform/Windows/platform_windows_files.cmake index 656b28a373..4730b383a2 100644 --- a/Code/Framework/AzTest/AzTest/Platform/Windows/platform_windows_files.cmake +++ b/Code/Framework/AzTest/AzTest/Platform/Windows/platform_windows_files.cmake @@ -8,6 +8,7 @@ set(FILES ../Common/WinAPI/AzTest/ColorizedOutput_WinAPI.cpp + ../Common/WinAPI/AzTest/Utils_WinAPI.cpp Platform_Windows.cpp ScopedAutoTempDirectory_Windows.cpp AzTest_Traits_Platform.h diff --git a/Code/Framework/AzTest/AzTest/Platform/iOS/platform_ios_files.cmake b/Code/Framework/AzTest/AzTest/Platform/iOS/platform_ios_files.cmake index 64bbc27bc1..81875f71e5 100644 --- a/Code/Framework/AzTest/AzTest/Platform/iOS/platform_ios_files.cmake +++ b/Code/Framework/AzTest/AzTest/Platform/iOS/platform_ios_files.cmake @@ -9,6 +9,7 @@ set(FILES ../Common/UnixLike/AzTest/ColorizedOutput_UnixLike.cpp ../Common/Unimplemented/AzTest/ScopedAutoTempDirectory_Unimplemented.cpp + ../Common/UnixLike/AzTest/Utils_UnixLike.cpp Platform_iOS.cpp AzTest_Traits_Platform.h AzTest_Traits_iOS.h diff --git a/Code/Framework/AzTest/AzTest/Utils.h b/Code/Framework/AzTest/AzTest/Utils.h index 2778e163b3..e3b45e97f2 100644 --- a/Code/Framework/AzTest/AzTest/Utils.h +++ b/Code/Framework/AzTest/AzTest/Utils.h @@ -55,6 +55,19 @@ namespace AZ // Returns the path to the engine's root by cdup from the current execution path until engine.txt is found AZStd::string GetEngineRootPath(); + //! Create or modify environment variable. + //! @param envname The environment variable name + //! @param envvalue The environment variable name + //! @param overwrite If name does exist in the environment, then its value is changed to value if overwrite is nonzero; + //! if overwrite is zero, then the value of name is not changed + //! @returns Return true if successful, otherwise false + bool SetEnv(const char* envname, const char* envvalue, bool overwrite); + + //! Remove environment variable. + //! @param envname The environment variable name + //! @returns Return true if successful, otherwise false + bool UnsetEnv(const char* envname); + //! Provides a scoped object that will create a temporary operating-system specific folder on creation, and delete it and //! its contents on destruction. This class is only available on host platforms (Windows, Mac, and Linux) class ScopedAutoTempDirectory From 22cee244c19d2cb721840128cb11a64451d58800 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Thu, 13 Jan 2022 17:30:02 -0800 Subject: [PATCH 468/948] remove a ability to reset reference, do not display reference box on user added data slots Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp index 342273cb2e..0e158d3e08 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp @@ -1142,7 +1142,7 @@ namespace ScriptCanvasEditor { if (slot->IsVariableReference()) { - return true; + return !slot->IsUserAdded(); } else { @@ -1254,7 +1254,7 @@ namespace ScriptCanvasEditor return nullptr; } - if (slot->IsVariableReference()) + if (slot->IsVariableReference() && !slot->IsUserAdded()) { ScriptCanvasVariableReferenceDataInterface* dataInterface = aznew ScriptCanvasVariableReferenceDataInterface(&m_variableDataModel, GetScriptCanvasId(), scriptCanvasNodeId, scriptCanvasSlotId); GraphCanvas::NodePropertyDisplay* dataDisplay = nullptr; From 1431afb51a08535a0ceabc22f11a55c0e5f5bb93 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Thu, 13 Jan 2022 18:26:39 -0800 Subject: [PATCH 469/948] remove a ability to change type on user added slots Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 1176df61dc..573a3f6e57 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -3873,7 +3873,9 @@ namespace ScriptCanvasEditor contextMenu.AddMenuAction(aznew ConvertReferenceToVariableNodeAction(&contextMenu)); contextMenu.AddMenuAction(aznew ExposeSlotMenuAction(&contextMenu)); contextMenu.AddMenuAction(aznew CreateAzEventHandlerSlotMenuAction(&contextMenu)); - contextMenu.AddMenuAction(aznew SetDataSlotTypeMenuAction(&contextMenu)); + + // disabling until references can be changed + // contextMenu.AddMenuAction(aznew SetDataSlotTypeMenuAction(&contextMenu)); return HandleContextMenu(contextMenu, slotId, screenPoint, scenePoint); } From 5c603882b348bdf220eda73e90c2491217744079 Mon Sep 17 00:00:00 2001 From: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> Date: Thu, 13 Jan 2022 19:57:22 -0700 Subject: [PATCH 470/948] Changed the Shader instanceId to the combined assetId and supervariant index Signed-off-by: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> --- .../Include/Atom/RPI.Public/Shader/Shader.h | 5 --- .../Code/Source/RPI.Public/Shader/Shader.cpp | 44 ++++++++++--------- 2 files changed, 24 insertions(+), 25 deletions(-) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/Shader.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/Shader.h index 92b67c3a7a..be20d89d65 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/Shader.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/Shader.h @@ -136,11 +136,6 @@ namespace AZ //! This tag corresponds to the ShaderAsset object's DrawListName. RHI::DrawListTag GetDrawListTag() const; - //! Changes the supervariant of the shader to the specified supervariantIndex. - //! [GFX TODO][ATOM-15813]: this can be removed when the shader InstanceDatabase can support multiple shader - //! instances with different supervariants. - void ChangeSupervariant(SupervariantIndex supervariantIndex); - private: explicit Shader(const SupervariantIndex& supervariantIndex) : m_supervariantIndex(supervariantIndex){}; Shader() = delete; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader.cpp index b1ae460af6..3830d8ee42 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader.cpp @@ -25,21 +25,34 @@ namespace AZ Data::Instance Shader::FindOrCreate(const Data::Asset& shaderAsset, const Name& supervariantName) { auto anySupervariantName = AZStd::any(supervariantName); - Data::Instance shaderInstance = Data::InstanceDatabase::Instance().FindOrCreate( - Data::InstanceId::CreateFromAssetId(shaderAsset.GetId()), shaderAsset, &anySupervariantName); - if (shaderInstance) + // retrieve the supervariant index from the shader asset + SupervariantIndex supervariantIndex = shaderAsset->GetSupervariantIndex(supervariantName); + if (!supervariantIndex.IsValid()) { - // [GFX TODO][ATOM-15813] Change InstanceDatabase to support multiple instances with different supervariants. - // At this time we do not support multiple supervariants loaded for a shader asset simultaneously, so if this shader - // is referring to the wrong supervariant we need to change it to the correct one. - SupervariantIndex supervariantIndex = shaderAsset->GetSupervariantIndex(supervariantName); - if (supervariantIndex.IsValid() && shaderInstance->GetSupervariantIndex() != supervariantIndex) - { - shaderInstance->ChangeSupervariant(supervariantIndex); - } + AZ_Error("Shader", false, "Supervariant with name %s, was not found in shader %s", supervariantName.GetCStr(), shaderAsset->GetName().GetCStr()); + return nullptr; } + // create the InstanceId from the combined assetId and supervariantIndex + const Data::AssetId& assetId = shaderAsset.GetId(); + uint32_t shaderSupervariantIndex = supervariantIndex.GetIndex(); + + const uint32_t instanceIdDataSize = sizeof(assetId.m_guid) + sizeof(assetId.m_subId) + sizeof(shaderSupervariantIndex); + uint8_t instanceIdData[instanceIdDataSize]; + uint8_t* instanceIdDataPtr = instanceIdData; + + memcpy(instanceIdDataPtr, &assetId.m_guid, sizeof(assetId.m_guid)); + instanceIdDataPtr += sizeof(assetId.m_guid); + memcpy(instanceIdDataPtr, &assetId.m_subId, sizeof(assetId.m_subId)); + instanceIdDataPtr += sizeof(assetId.m_subId); + memcpy(instanceIdDataPtr, &shaderSupervariantIndex, sizeof(shaderSupervariantIndex)); + + Data::InstanceId instanceId = Data::InstanceId::CreateData(instanceIdData, instanceIdDataSize); + + // retrieve the shader instance from the Instance database + Data::Instance shaderInstance = Data::InstanceDatabase::Instance().FindOrCreate(instanceId, shaderAsset, &anySupervariantName); + return shaderInstance; } @@ -478,14 +491,5 @@ namespace AZ return m_drawListTag; } - void Shader::ChangeSupervariant(SupervariantIndex supervariantIndex) - { - if (supervariantIndex != m_supervariantIndex) - { - m_supervariantIndex = supervariantIndex; - Init(*m_asset); - } - } - } // namespace RPI } // namespace AZ From a43cd9531328d006f8487f449555318750712115 Mon Sep 17 00:00:00 2001 From: moraaar Date: Fri, 14 Jan 2022 10:01:38 +0000 Subject: [PATCH 471/948] Fixed physics periodic tests on linux platform (#6881) - Fixed path separators, now levels will be correctly opened in linux. - Fixed casing of physics paths. - Fixed casing of files inside levels Joints_HingeNoLimitsConstrained and RigidBody_KinematicModeWorks. - Resaved a level that still used old test ids in its name but the python tests didn't match. Linux: Start 21: AutomatedTesting::PhysicsTests_Periodic.periodic::TEST_RUN 8/11 Test #21: AutomatedTesting::PhysicsTests_Periodic.periodic::TEST_RUN .................. Passed 609.87 sec Windows: Start 21: AutomatedTesting::PhysicsTests_Periodic.periodic::TEST_RUN 8/13 Test #21: AutomatedTesting::PhysicsTests_Periodic.periodic::TEST_RUN ....................... Passed 810.59 sec Signed-off-by: moraaar --- ...ameCollisionGroupSameCustomLayerCollide.py | 2 +- ...tipleForcesInSameComponentCombineForces.py | 2 +- ...DefaultLibraryUpdatedAcrossLevels_after.py | 4 +- ...efaultLibraryUpdatedAcrossLevels_before.py | 2 +- .../Material_LibraryUpdatedAcrossLevels.py | 6 +- ...iptCanvas_SpawnEntityWithPhysComponents.py | 2 +- .../Joints_HingeNoLimitsConstrained.ly | 4 +- .../0/0.ly | 3 + .../0/filelist.xml | 6 + .../0/level.pak | 3 + .../tags.txt | 0 .../terraintexture.pak | 0 .../1/1.ly | 3 + .../1/filelist.xml | 6 + .../1/level.pak | 3 + .../tags.txt | 0 .../terraintexture.pak | 0 ...5_Material_LibraryUpdatedAcrossLevels_0.ly | 3 - .../filelist.xml | 6 - .../level.pak | 3 - .../leveldata/Environment.xml | 14 - .../leveldata/GameTokens.xml | 5 - .../leveldata/TerrainTexture.xml | 7 - .../leveldata/TimeOfDay.xml | 356 ------------------ .../leveldata/VegetationMap.dat | 3 - .../terrain/terrain.pxheightfield | 3 - ...5_Material_LibraryUpdatedAcrossLevels_1.ly | 3 - .../filelist.xml | 6 - .../level.pak | 3 - .../leveldata/Environment.xml | 14 - .../leveldata/GameTokens.xml | 5 - .../leveldata/TerrainTexture.xml | 7 - .../leveldata/TimeOfDay.xml | 356 ------------------ .../leveldata/VegetationMap.dat | 3 - .../terrain/terrain.pxheightfield | 3 - .../RigidBody_KinematicModeWorks.ly | 4 +- 36 files changed, 36 insertions(+), 814 deletions(-) create mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/0/0.ly create mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/0/filelist.xml create mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/0/level.pak rename AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/{C15425935_Material_LibraryUpdatedAcrossLevels_0 => 0}/tags.txt (100%) rename AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/{C15425935_Material_LibraryUpdatedAcrossLevels_0 => 0}/terraintexture.pak (100%) create mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/1/1.ly create mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/1/filelist.xml create mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/1/level.pak rename AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/{C15425935_Material_LibraryUpdatedAcrossLevels_1 => 1}/tags.txt (100%) rename AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/{C15425935_Material_LibraryUpdatedAcrossLevels_1 => 1}/terraintexture.pak (100%) delete mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/C15425935_Material_LibraryUpdatedAcrossLevels_0.ly delete mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/filelist.xml delete mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/level.pak delete mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/Environment.xml delete mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/GameTokens.xml delete mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/TerrainTexture.xml delete mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/TimeOfDay.xml delete mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/VegetationMap.dat delete mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/terrain/terrain.pxheightfield delete mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/C15425935_Material_LibraryUpdatedAcrossLevels_1.ly delete mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/filelist.xml delete mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/level.pak delete mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/Environment.xml delete mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/GameTokens.xml delete mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/TerrainTexture.xml delete mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/TimeOfDay.xml delete mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/VegetationMap.dat delete mode 100644 AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/terrain/terrain.pxheightfield diff --git a/AutomatedTesting/Gem/PythonTests/Physics/tests/collider/Collider_SameCollisionGroupSameCustomLayerCollide.py b/AutomatedTesting/Gem/PythonTests/Physics/tests/collider/Collider_SameCollisionGroupSameCustomLayerCollide.py index 2e40c0b557..8e8fccd725 100644 --- a/AutomatedTesting/Gem/PythonTests/Physics/tests/collider/Collider_SameCollisionGroupSameCustomLayerCollide.py +++ b/AutomatedTesting/Gem/PythonTests/Physics/tests/collider/Collider_SameCollisionGroupSameCustomLayerCollide.py @@ -127,7 +127,7 @@ def Collider_SameCollisionGroupSameCustomLayerCollide(): # Main Script # 1) Load the level helper.init_idle() - helper.open_level("physics", "Collider_SameCollisionGroupSameCustomLayerCollide") + helper.open_level("Physics", "Collider_SameCollisionGroupSameCustomLayerCollide") # 2) Enter Game Mode helper.enter_game_mode(Tests.enter_game_mode) diff --git a/AutomatedTesting/Gem/PythonTests/Physics/tests/force_region/ForceRegion_MultipleForcesInSameComponentCombineForces.py b/AutomatedTesting/Gem/PythonTests/Physics/tests/force_region/ForceRegion_MultipleForcesInSameComponentCombineForces.py index 7307f3a2fb..e5f6e236cf 100644 --- a/AutomatedTesting/Gem/PythonTests/Physics/tests/force_region/ForceRegion_MultipleForcesInSameComponentCombineForces.py +++ b/AutomatedTesting/Gem/PythonTests/Physics/tests/force_region/ForceRegion_MultipleForcesInSameComponentCombineForces.py @@ -162,7 +162,7 @@ def ForceRegion_MultipleForcesInSameComponentCombineForces(): helper.init_idle() # 1) Load Level - helper.open_level("physics", "ForceRegion_MultipleForcesInSameComponentCombineForces") + helper.open_level("Physics", "ForceRegion_MultipleForcesInSameComponentCombineForces") # 2) Enter Game Mode helper.enter_game_mode(Tests.enter_game_mode) diff --git a/AutomatedTesting/Gem/PythonTests/Physics/tests/material/Material_DefaultLibraryUpdatedAcrossLevels_after.py b/AutomatedTesting/Gem/PythonTests/Physics/tests/material/Material_DefaultLibraryUpdatedAcrossLevels_after.py index 1f8cfae498..41ccc8f2dd 100644 --- a/AutomatedTesting/Gem/PythonTests/Physics/tests/material/Material_DefaultLibraryUpdatedAcrossLevels_after.py +++ b/AutomatedTesting/Gem/PythonTests/Physics/tests/material/Material_DefaultLibraryUpdatedAcrossLevels_after.py @@ -229,8 +229,8 @@ def Material_DefaultLibraryUpdatedAcrossLevels_after(): for test in test_list: # 1) Open the correct level is open helper.open_level( - "physics", - f"Material_DefaultLibraryUpdatedAcrossLevels\\{test.level}" + "Physics", + os.path.join("Material_DefaultLibraryUpdatedAcrossLevels", str(test.level)) ) # 2) Enter Game Mode diff --git a/AutomatedTesting/Gem/PythonTests/Physics/tests/material/Material_DefaultLibraryUpdatedAcrossLevels_before.py b/AutomatedTesting/Gem/PythonTests/Physics/tests/material/Material_DefaultLibraryUpdatedAcrossLevels_before.py index 15db5808e2..d86a016be1 100644 --- a/AutomatedTesting/Gem/PythonTests/Physics/tests/material/Material_DefaultLibraryUpdatedAcrossLevels_before.py +++ b/AutomatedTesting/Gem/PythonTests/Physics/tests/material/Material_DefaultLibraryUpdatedAcrossLevels_before.py @@ -189,7 +189,7 @@ def Material_DefaultLibraryUpdatedAcrossLevels_before(): # 1) Open the correct level is open helper.open_level( "Physics", - f"Material_DefaultLibraryUpdatedAcrossLevels\\{test.level}" + os.path.join("Material_DefaultLibraryUpdatedAcrossLevels", str(test.level)) ) # 2) Enter Game Mode diff --git a/AutomatedTesting/Gem/PythonTests/Physics/tests/material/Material_LibraryUpdatedAcrossLevels.py b/AutomatedTesting/Gem/PythonTests/Physics/tests/material/Material_LibraryUpdatedAcrossLevels.py index 0b647361f6..6eebfe60bc 100644 --- a/AutomatedTesting/Gem/PythonTests/Physics/tests/material/Material_LibraryUpdatedAcrossLevels.py +++ b/AutomatedTesting/Gem/PythonTests/Physics/tests/material/Material_LibraryUpdatedAcrossLevels.py @@ -252,10 +252,8 @@ def Material_LibraryUpdatedAcrossLevels(): for test in test_list: # 1) Open the correct level for the test helper.open_level( - "physics", - "Material_LibraryUpdatedAcrossLevels\\Material_LibraryUpdatedAcrossLevels_{}".format( - test.level_index - ), + "Physics", + os.path.join("Material_LibraryUpdatedAcrossLevels", str(test.level_index)) ) # 2) Open Game Mode diff --git a/AutomatedTesting/Gem/PythonTests/Physics/tests/script_canvas/ScriptCanvas_SpawnEntityWithPhysComponents.py b/AutomatedTesting/Gem/PythonTests/Physics/tests/script_canvas/ScriptCanvas_SpawnEntityWithPhysComponents.py index 5862b7586b..e6e29063d6 100644 --- a/AutomatedTesting/Gem/PythonTests/Physics/tests/script_canvas/ScriptCanvas_SpawnEntityWithPhysComponents.py +++ b/AutomatedTesting/Gem/PythonTests/Physics/tests/script_canvas/ScriptCanvas_SpawnEntityWithPhysComponents.py @@ -106,7 +106,7 @@ def ScriptCanvas_SpawnEntityWithPhysComponents(): # Main Script helper.init_idle() # 1) Open Level - helper.open_level("physics", "ScriptCanvas_SpawnEntityWithPhysComponents") + helper.open_level("Physics", "ScriptCanvas_SpawnEntityWithPhysComponents") # 2) Enter Game Mode helper.enter_game_mode(Tests.enter_game_mode) diff --git a/AutomatedTesting/Levels/Physics/Joints_HingeNoLimitsConstrained/Joints_HingeNoLimitsConstrained.ly b/AutomatedTesting/Levels/Physics/Joints_HingeNoLimitsConstrained/Joints_HingeNoLimitsConstrained.ly index 9babf84ba4..18b503bab5 100644 --- a/AutomatedTesting/Levels/Physics/Joints_HingeNoLimitsConstrained/Joints_HingeNoLimitsConstrained.ly +++ b/AutomatedTesting/Levels/Physics/Joints_HingeNoLimitsConstrained/Joints_HingeNoLimitsConstrained.ly @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:60276c07b45a734e4f71d695278167ea61e884f8b513906168c9642078ad5954 -size 6045 +oid sha256:0d004c329a7c5044a8fe05b6dbbf9b19de29c60acec75f13fdbc344a55aab8c7 +size 6404 diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/0/0.ly b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/0/0.ly new file mode 100644 index 0000000000..b908d29eab --- /dev/null +++ b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/0/0.ly @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e89946c224d2e765931e8ba8e33133ac24651af321a404016d9a9ea8c323db6c +size 8563 diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/0/filelist.xml b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/0/filelist.xml new file mode 100644 index 0000000000..bb94b733b3 --- /dev/null +++ b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/0/filelist.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/0/level.pak b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/0/level.pak new file mode 100644 index 0000000000..614e41c4b2 --- /dev/null +++ b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/0/level.pak @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2a46437ba86135567d87d43af0c4d499bf3cfe321721dbaf6e3cda8e49427ee1 +size 40212 diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/tags.txt b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/0/tags.txt similarity index 100% rename from AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/tags.txt rename to AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/0/tags.txt diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/terraintexture.pak b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/0/terraintexture.pak similarity index 100% rename from AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/terraintexture.pak rename to AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/0/terraintexture.pak diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/1/1.ly b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/1/1.ly new file mode 100644 index 0000000000..216426fc2a --- /dev/null +++ b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/1/1.ly @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:95996da3902d885060e700c573d13144bab246b930dfeedaed6066c13c879b11 +size 8737 diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/1/filelist.xml b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/1/filelist.xml new file mode 100644 index 0000000000..5f5b4928fc --- /dev/null +++ b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/1/filelist.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/1/level.pak b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/1/level.pak new file mode 100644 index 0000000000..d920770374 --- /dev/null +++ b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/1/level.pak @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:894dfd4ab92aa4d1d6003aebf82cf7ff854a8b3684e010234e073879f88b64e5 +size 40210 diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/tags.txt b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/1/tags.txt similarity index 100% rename from AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/tags.txt rename to AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/1/tags.txt diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/terraintexture.pak b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/1/terraintexture.pak similarity index 100% rename from AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/terraintexture.pak rename to AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/1/terraintexture.pak diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/C15425935_Material_LibraryUpdatedAcrossLevels_0.ly b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/C15425935_Material_LibraryUpdatedAcrossLevels_0.ly deleted file mode 100644 index a5953fc44b..0000000000 --- a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/C15425935_Material_LibraryUpdatedAcrossLevels_0.ly +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:969b77ee335d2a04524a27c765dd2f2bdee048661f3ff7be0766ba69d18d5842 -size 10409 diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/filelist.xml b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/filelist.xml deleted file mode 100644 index 9a78b1bfd5..0000000000 --- a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/filelist.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/level.pak b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/level.pak deleted file mode 100644 index 8e6b3b29cb..0000000000 --- a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/level.pak +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:547d7fdfcd959569b69d78eb6f63c7c19fc90840d69ca2d46eca8a3e82b8db75 -size 39337 diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/Environment.xml b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/Environment.xml deleted file mode 100644 index 4ba36f66ae..0000000000 --- a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/Environment.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/GameTokens.xml b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/GameTokens.xml deleted file mode 100644 index 668a4583bd..0000000000 --- a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/GameTokens.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/TerrainTexture.xml b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/TerrainTexture.xml deleted file mode 100644 index f43df05b22..0000000000 --- a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/TerrainTexture.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/TimeOfDay.xml b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/TimeOfDay.xml deleted file mode 100644 index 456d609b8a..0000000000 --- a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/TimeOfDay.xml +++ /dev/null @@ -1,356 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/VegetationMap.dat b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/VegetationMap.dat deleted file mode 100644 index dce5631cd0..0000000000 --- a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/leveldata/VegetationMap.dat +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0e6a5435c928079b27796f6b202bbc2623e7e454244ddc099a3cadf33b7cb9e9 -size 63 diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/terrain/terrain.pxheightfield b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/terrain/terrain.pxheightfield deleted file mode 100644 index 011356e521..0000000000 --- a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_0/terrain/terrain.pxheightfield +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:19096597087688692a225c1955f73d22c46354995fca1df8dff107a90c2f17a2 -size 4202594 diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/C15425935_Material_LibraryUpdatedAcrossLevels_1.ly b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/C15425935_Material_LibraryUpdatedAcrossLevels_1.ly deleted file mode 100644 index 9f48f08a1b..0000000000 --- a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/C15425935_Material_LibraryUpdatedAcrossLevels_1.ly +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:29f752c141514cb4b50aea07e6b63de5c8f43149ddac37722e9ddb8b5f4a667d -size 9495 diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/filelist.xml b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/filelist.xml deleted file mode 100644 index 9a78b1bfd5..0000000000 --- a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/filelist.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/level.pak b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/level.pak deleted file mode 100644 index 8e6b3b29cb..0000000000 --- a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/level.pak +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:547d7fdfcd959569b69d78eb6f63c7c19fc90840d69ca2d46eca8a3e82b8db75 -size 39337 diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/Environment.xml b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/Environment.xml deleted file mode 100644 index 4ba36f66ae..0000000000 --- a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/Environment.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/GameTokens.xml b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/GameTokens.xml deleted file mode 100644 index 668a4583bd..0000000000 --- a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/GameTokens.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/TerrainTexture.xml b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/TerrainTexture.xml deleted file mode 100644 index f43df05b22..0000000000 --- a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/TerrainTexture.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/TimeOfDay.xml b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/TimeOfDay.xml deleted file mode 100644 index 456d609b8a..0000000000 --- a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/TimeOfDay.xml +++ /dev/null @@ -1,356 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/VegetationMap.dat b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/VegetationMap.dat deleted file mode 100644 index dce5631cd0..0000000000 --- a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/leveldata/VegetationMap.dat +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0e6a5435c928079b27796f6b202bbc2623e7e454244ddc099a3cadf33b7cb9e9 -size 63 diff --git a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/terrain/terrain.pxheightfield b/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/terrain/terrain.pxheightfield deleted file mode 100644 index 011356e521..0000000000 --- a/AutomatedTesting/Levels/Physics/Material_LibraryUpdatedAcrossLevels/C15425935_Material_LibraryUpdatedAcrossLevels_1/terrain/terrain.pxheightfield +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:19096597087688692a225c1955f73d22c46354995fca1df8dff107a90c2f17a2 -size 4202594 diff --git a/AutomatedTesting/Levels/Physics/RigidBody_KinematicModeWorks/RigidBody_KinematicModeWorks.ly b/AutomatedTesting/Levels/Physics/RigidBody_KinematicModeWorks/RigidBody_KinematicModeWorks.ly index d6052ffa7c..a4b28a9e96 100644 --- a/AutomatedTesting/Levels/Physics/RigidBody_KinematicModeWorks/RigidBody_KinematicModeWorks.ly +++ b/AutomatedTesting/Levels/Physics/RigidBody_KinematicModeWorks/RigidBody_KinematicModeWorks.ly @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cb97ada674d123c67d7a32eb65e81fa66472cf51f748054c4a4297649f2a0f40 -size 5568 +oid sha256:0f645243fb623258ed4b063c5a18ea414560496f97d7234782ca97884e0ed8f0 +size 5961 From 5c52df721142fb23bb316ef6704cb3ef360116c9 Mon Sep 17 00:00:00 2001 From: windbagjacket Date: Fri, 14 Jan 2022 10:48:13 +0000 Subject: [PATCH 472/948] Change property refresh to ValuesOnly instead of EntireTree Signed-off-by: windbagjacket --- .../CommonFeatures/Code/Source/Mesh/EditorMeshComponent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/EditorMeshComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/EditorMeshComponent.cpp index 423145f838..5c8d2d6116 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/EditorMeshComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/EditorMeshComponent.cpp @@ -81,7 +81,7 @@ namespace AZ ->Attribute(AZ::Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) ->DataElement(AZ::Edit::UIHandlers::CheckBox, &MeshComponentConfig::m_isRayTracingEnabled, "Use ray tracing", "Includes this mesh in ray tracing calculations.") - ->Attribute(AZ::Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::EntireTree) + ->Attribute(AZ::Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) ->DataElement(AZ::Edit::UIHandlers::ComboBox, &MeshComponentConfig::m_lodType, "Lod Type", "Lod Method.") ->EnumAttribute(RPI::Cullable::LodType::Default, "Default") ->EnumAttribute(RPI::Cullable::LodType::ScreenCoverage, "Screen Coverage") From 56837f48d9c75e3f5e0a8b3e7fa560b0e71287f7 Mon Sep 17 00:00:00 2001 From: sphrose <82213493+sphrose@users.noreply.github.com> Date: Fri, 14 Jan 2022 16:29:00 +0000 Subject: [PATCH 473/948] Remove error state when user attempts to save empty script event. Signed-off-by: sphrose <82213493+sphrose@users.noreply.github.com> --- .../Code/Include/ScriptEvents/ScriptEventDefinition.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Gems/ScriptEvents/Code/Include/ScriptEvents/ScriptEventDefinition.cpp b/Gems/ScriptEvents/Code/Include/ScriptEvents/ScriptEventDefinition.cpp index e6c40cf789..3a6a411611 100644 --- a/Gems/ScriptEvents/Code/Include/ScriptEvents/ScriptEventDefinition.cpp +++ b/Gems/ScriptEvents/Code/Include/ScriptEvents/ScriptEventDefinition.cpp @@ -131,10 +131,7 @@ namespace ScriptEvents return AZ::Failure(AZStd::string::format("%s, invalid name specified, event name must only have alpha numeric characters, may not start with a number and may not have white space", name.c_str())); } - if (m_methods.empty()) - { - return AZ::Failure(AZStd::string::format("Script Events (%s) must provide at least one event otherwise they are unusable, be sure to add an event before saving.", name.c_str())); - } + AZ_Warning("Script Events", !m_methods.empty(), AZStd::string::format("Script Events (%s) must provide at least one event, otherwise they are unusable.", name.c_str()).c_str()); // Validate each method AZStd::string methodName; From e1572ce5c9615d8b4ecaa5ee8b8409f2fcb7944b Mon Sep 17 00:00:00 2001 From: AMZN-stankowi <4838196+AMZN-stankowi@users.noreply.github.com> Date: Fri, 14 Jan 2022 08:49:42 -0800 Subject: [PATCH 474/948] Updating assimp to the v12 packages (#6861) Signed-off-by: AMZN-stankowi <4838196+AMZN-stankowi@users.noreply.github.com> --- cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake | 2 +- cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake | 2 +- cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake b/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake index f7bc2721ae..f1e8fdc950 100644 --- a/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake +++ b/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake @@ -8,7 +8,6 @@ # shared by other platforms: ly_associate_package(PACKAGE_NAME ilmbase-2.3.0-rev4-multiplatform TARGETS ilmbase PACKAGE_HASH 97547fdf1fbc4d81b8ccf382261f8c25514ed3b3c4f8fd493f0a4fa873bba348) -ly_associate_package(PACKAGE_NAME assimp-5.0.1-rev11-multiplatform TARGETS assimplib PACKAGE_HASH 1a9113788b893ef4a2ee63ac01eb71b981a92894a5a51175703fa225f5804dec) ly_associate_package(PACKAGE_NAME md5-2.0-multiplatform TARGETS md5 PACKAGE_HASH 29e52ad22c78051551f78a40c2709594f0378762ae03b417adca3f4b700affdf) ly_associate_package(PACKAGE_NAME RapidJSON-1.1.0-rev1-multiplatform TARGETS RapidJSON PACKAGE_HASH 2f5e26ecf86c3b7a262753e7da69ac59928e78e9534361f3d00c1ad5879e4023) ly_associate_package(PACKAGE_NAME RapidXML-1.13-rev1-multiplatform TARGETS RapidXML PACKAGE_HASH 4b7b5651e47cfd019b6b295cc17bb147b65e53073eaab4a0c0d20a37ab74a246) @@ -21,6 +20,7 @@ ly_associate_package(PACKAGE_NAME glad-2.0.0-beta-rev2-multiplatform ly_associate_package(PACKAGE_NAME xxhash-0.7.4-rev1-multiplatform TARGETS xxhash PACKAGE_HASH e81f3e6c4065975833996dd1fcffe46c3cf0f9e3a4207ec5f4a1b564ba75861e) # platform-specific: +ly_associate_package(PACKAGE_NAME assimp-5.0.1-rev12-linux TARGETS assimplib PACKAGE_HASH 49d32e11c594e58a9079972ad63570dd895ac61e6148e428b9c39a62feb676ee) ly_associate_package(PACKAGE_NAME AWSGameLiftServerSDK-3.4.1-rev1-linux TARGETS AWSGameLiftServerSDK PACKAGE_HASH a8149a95bd100384af6ade97e2b21a56173740d921e6c3da8188cd51554d39af) ly_associate_package(PACKAGE_NAME tiff-4.2.0.15-rev3-linux TARGETS TIFF PACKAGE_HASH 2377f48b2ebc2d1628d9f65186c881544c92891312abe478a20d10b85877409a) ly_associate_package(PACKAGE_NAME freetype-2.10.4.16-linux TARGETS freetype PACKAGE_HASH 3f10c703d9001ecd2bb51a3bd003d3237c02d8f947ad0161c0252fdc54cbcf97) diff --git a/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake b/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake index ea324a5cb7..575a2dd70e 100644 --- a/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake +++ b/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake @@ -8,7 +8,6 @@ # shared by other platforms: ly_associate_package(PACKAGE_NAME ilmbase-2.3.0-rev4-multiplatform TARGETS ilmbase PACKAGE_HASH 97547fdf1fbc4d81b8ccf382261f8c25514ed3b3c4f8fd493f0a4fa873bba348) -ly_associate_package(PACKAGE_NAME assimp-5.0.1-rev11-multiplatform TARGETS assimplib PACKAGE_HASH 1a9113788b893ef4a2ee63ac01eb71b981a92894a5a51175703fa225f5804dec) ly_associate_package(PACKAGE_NAME md5-2.0-multiplatform TARGETS md5 PACKAGE_HASH 29e52ad22c78051551f78a40c2709594f0378762ae03b417adca3f4b700affdf) ly_associate_package(PACKAGE_NAME RapidJSON-1.1.0-rev1-multiplatform TARGETS RapidJSON PACKAGE_HASH 2f5e26ecf86c3b7a262753e7da69ac59928e78e9534361f3d00c1ad5879e4023) ly_associate_package(PACKAGE_NAME RapidXML-1.13-rev1-multiplatform TARGETS RapidXML PACKAGE_HASH 4b7b5651e47cfd019b6b295cc17bb147b65e53073eaab4a0c0d20a37ab74a246) @@ -21,6 +20,7 @@ ly_associate_package(PACKAGE_NAME glad-2.0.0-beta-rev2-multiplatform ly_associate_package(PACKAGE_NAME xxhash-0.7.4-rev1-multiplatform TARGETS xxhash PACKAGE_HASH e81f3e6c4065975833996dd1fcffe46c3cf0f9e3a4207ec5f4a1b564ba75861e) # platform-specific: +ly_associate_package(PACKAGE_NAME assimp-5.0.1-rev12-mac TARGETS assimplib PACKAGE_HASH 12db03817553f607bee0d65b690bcaae748014f3ed9266b70384f463bc98c9d1) ly_associate_package(PACKAGE_NAME DirectXShaderCompilerDxc-1.6.2104-o3de-rev3-mac TARGETS DirectXShaderCompilerDxc PACKAGE_HASH 3f77367dbb0342136ec4ebbd44bc1fedf7198089a0f83c5631248530769b2be6) ly_associate_package(PACKAGE_NAME SPIRVCross-2021.04.29-rev1-mac TARGETS SPIRVCross PACKAGE_HASH 78c6376ed2fd195b9b1f5fb2b56e5267a32c3aa21fb399e905308de470eb4515) ly_associate_package(PACKAGE_NAME tiff-4.2.0.15-rev3-mac TARGETS TIFF PACKAGE_HASH c2615ccdadcc0e1d6c5ed61e5965c4d3a82193d206591b79b805c3b3ff35a4bf) diff --git a/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake b/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake index 5441bcd76f..7fd07927cc 100644 --- a/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake +++ b/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake @@ -8,7 +8,6 @@ # shared by other platforms: ly_associate_package(PACKAGE_NAME ilmbase-2.3.0-rev4-multiplatform TARGETS ilmbase PACKAGE_HASH 97547fdf1fbc4d81b8ccf382261f8c25514ed3b3c4f8fd493f0a4fa873bba348) -ly_associate_package(PACKAGE_NAME assimp-5.0.1-rev11-multiplatform TARGETS assimplib PACKAGE_HASH 1a9113788b893ef4a2ee63ac01eb71b981a92894a5a51175703fa225f5804dec) ly_associate_package(PACKAGE_NAME md5-2.0-multiplatform TARGETS md5 PACKAGE_HASH 29e52ad22c78051551f78a40c2709594f0378762ae03b417adca3f4b700affdf) ly_associate_package(PACKAGE_NAME RapidJSON-1.1.0-rev1-multiplatform TARGETS RapidJSON PACKAGE_HASH 2f5e26ecf86c3b7a262753e7da69ac59928e78e9534361f3d00c1ad5879e4023) ly_associate_package(PACKAGE_NAME RapidXML-1.13-rev1-multiplatform TARGETS RapidXML PACKAGE_HASH 4b7b5651e47cfd019b6b295cc17bb147b65e53073eaab4a0c0d20a37ab74a246) @@ -21,6 +20,7 @@ ly_associate_package(PACKAGE_NAME glad-2.0.0-beta-rev2-multiplatform ly_associate_package(PACKAGE_NAME xxhash-0.7.4-rev1-multiplatform TARGETS xxhash PACKAGE_HASH e81f3e6c4065975833996dd1fcffe46c3cf0f9e3a4207ec5f4a1b564ba75861e) # platform-specific: +ly_associate_package(PACKAGE_NAME assimp-5.0.1-rev12-windows TARGETS assimplib PACKAGE_HASH 5273b7661a7a247bb18e8bc928d25c9cd1bd8ce9dfcc56c50742bac8fa02f0f2) ly_associate_package(PACKAGE_NAME AWSGameLiftServerSDK-3.4.1-rev1-windows TARGETS AWSGameLiftServerSDK PACKAGE_HASH a0586b006e4def65cc25f388de17dc475e417dc1e6f9d96749777c88aa8271b0) ly_associate_package(PACKAGE_NAME DirectXShaderCompilerDxc-1.6.2104-o3de-rev3-windows TARGETS DirectXShaderCompilerDxc PACKAGE_HASH 803e10b94006b834cbbdd30f562a8ddf04174c2cb6956c8399ec164ef8418d1f) ly_associate_package(PACKAGE_NAME SPIRVCross-2021.04.29-rev1-windows TARGETS SPIRVCross PACKAGE_HASH 7d601ea9d625b1d509d38bd132a1f433d7e895b16adab76bac6103567a7a6817) From 4392c8963c66786d9db2164fb3d7384dc2e7a6f9 Mon Sep 17 00:00:00 2001 From: Chris Burel Date: Fri, 14 Jan 2022 09:00:26 -0800 Subject: [PATCH 475/948] [Linux] Prefer higher versioned clang compilers to lower versions (#6824) If the user does not specify which compiler to use via cache variables in the CMake invocation, we perform a search for which version to use. Previously this was done using a glob search on some pre-defined paths, and then sorting the results using `list(SORT ... COMPARE NATURAL)`. Sorting in this manner results in lower versions being moved to the head of the list. The first result in the list was then used. Consequently, if the user has `clang-11` and `clang-12` installed, `clang-11` was chosen. This reverses the sort order so that the highest installed version is chosen. Signed-off-by: Chris Burel --- cmake/Platform/Linux/CompilerSettings_linux.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Platform/Linux/CompilerSettings_linux.cmake b/cmake/Platform/Linux/CompilerSettings_linux.cmake index 9bb629c53b..a1a632e957 100644 --- a/cmake/Platform/Linux/CompilerSettings_linux.cmake +++ b/cmake/Platform/Linux/CompilerSettings_linux.cmake @@ -19,7 +19,7 @@ if(NOT CMAKE_C_COMPILER AND NOT CMAKE_CXX_COMPILER AND NOT "$ENV{CC}" AND NOT "$ file(GLOB clang_versions ${path_search}) if(clang_versions) # Find and pick the highest installed version - list(SORT clang_versions COMPARE NATURAL) + list(SORT clang_versions COMPARE NATURAL ORDER DESCENDING) list(GET clang_versions 0 clang_higher_version_path) string(REGEX MATCH "clang-([0-9.]*)" clang_higher_version ${clang_higher_version_path}) if(CMAKE_MATCH_1) From 7474c5480e5ed3435d078efa75fb260f6f162296 Mon Sep 17 00:00:00 2001 From: windbagjacket Date: Fri, 14 Jan 2022 17:07:13 +0000 Subject: [PATCH 476/948] Adding ray tracing toggle to behavior context so it can be used with scripting. Signed-off-by: windbagjacket --- .../Atom/Feature/Mesh/MeshFeatureProcessor.h | 1 + .../Mesh/MeshFeatureProcessorInterface.h | 2 ++ .../Code/Mocks/MockMeshFeatureProcessor.h | 1 + .../Code/Source/Mesh/MeshFeatureProcessor.cpp | 13 +++++++++++ .../CommonFeatures/Mesh/MeshComponentBus.h | 3 +++ .../Source/Mesh/MeshComponentController.cpp | 22 +++++++++++++++++++ .../Source/Mesh/MeshComponentController.h | 3 +++ .../Code/Source/AtomActorInstance.cpp | 20 ++++++++++++++++- .../Code/Source/AtomActorInstance.h | 2 ++ Gems/Vegetation/Code/Tests/VegetationMocks.h | 9 ++++++++ 10 files changed, 75 insertions(+), 1 deletion(-) diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Mesh/MeshFeatureProcessor.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Mesh/MeshFeatureProcessor.h index 23cd76ca20..92e9c1e88a 100644 --- a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Mesh/MeshFeatureProcessor.h +++ b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Mesh/MeshFeatureProcessor.h @@ -176,6 +176,7 @@ namespace AZ void SetExcludeFromReflectionCubeMaps(const MeshHandle& meshHandle, bool excludeFromReflectionCubeMaps) override; void SetRayTracingEnabled(const MeshHandle& meshHandle, bool rayTracingEnabled) override; + bool GetRayTracingEnabled(const MeshHandle& meshHandle) const override; void SetVisible(const MeshHandle& meshHandle, bool visible) override; void SetUseForwardPassIblSpecular(const MeshHandle& meshHandle, bool useForwardPassIblSpecular) override; diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Mesh/MeshFeatureProcessorInterface.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Mesh/MeshFeatureProcessorInterface.h index 356b1936ca..f616c06e92 100644 --- a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Mesh/MeshFeatureProcessorInterface.h +++ b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Mesh/MeshFeatureProcessorInterface.h @@ -105,6 +105,8 @@ namespace AZ virtual void SetExcludeFromReflectionCubeMaps(const MeshHandle& meshHandle, bool excludeFromReflectionCubeMaps) = 0; //! Sets the option to exclude this mesh from raytracing virtual void SetRayTracingEnabled(const MeshHandle& meshHandle, bool rayTracingEnabled) = 0; + //! Gets whether this mesh is excluded from raytracing + virtual bool GetRayTracingEnabled(const MeshHandle& meshHandle) const = 0; //! Sets the mesh as visible or hidden. When the mesh is hidden it will not be rendered by the feature processor. virtual void SetVisible(const MeshHandle& meshHandle, bool visible) = 0; //! Sets the mesh to render IBL specular in the forward pass. diff --git a/Gems/Atom/Feature/Common/Code/Mocks/MockMeshFeatureProcessor.h b/Gems/Atom/Feature/Common/Code/Mocks/MockMeshFeatureProcessor.h index 2c818d3c9b..af1e23aa19 100644 --- a/Gems/Atom/Feature/Common/Code/Mocks/MockMeshFeatureProcessor.h +++ b/Gems/Atom/Feature/Common/Code/Mocks/MockMeshFeatureProcessor.h @@ -38,6 +38,7 @@ namespace UnitTest MOCK_METHOD2(AcquireMesh, MeshHandle (const AZ::Render::MeshHandleDescriptor&, const AZ::Render::MaterialAssignmentMap&)); MOCK_METHOD2(AcquireMesh, MeshHandle (const AZ::Render::MeshHandleDescriptor&, const AZ::Data::Instance&)); MOCK_METHOD2(SetRayTracingEnabled, void (const MeshHandle&, bool)); + MOCK_CONST_METHOD1(GetRayTracingEnabled, bool(const MeshHandle&)); MOCK_METHOD2(SetVisible, void (const MeshHandle&, bool)); MOCK_METHOD2(SetUseForwardPassIblSpecular, void (const MeshHandle&, bool)); }; diff --git a/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp index dfb2b3fe6b..6b9a3fc698 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp @@ -435,6 +435,19 @@ namespace AZ } } + bool MeshFeatureProcessor::GetRayTracingEnabled(const MeshHandle& meshHandle) const + { + if (meshHandle.IsValid()) + { + return meshHandle->m_descriptor.m_isRayTracingEnabled; + } + else + { + AZ_Assert(false, "Invalid mesh handle"); + return false; + } + } + void MeshFeatureProcessor::SetVisible(const MeshHandle& meshHandle, bool visible) { if (meshHandle.IsValid()) diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/Mesh/MeshComponentBus.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/Mesh/MeshComponentBus.h index cc9c78d356..989cbcffb2 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/Mesh/MeshComponentBus.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/Mesh/MeshComponentBus.h @@ -51,6 +51,9 @@ namespace AZ virtual void SetVisibility(bool visible) = 0; virtual bool GetVisibility() const = 0; + virtual void SetRayTracingEnabled(bool enabled) = 0; + virtual bool GetRayTracingEnabled() const = 0; + virtual AZ::Aabb GetWorldBounds() = 0; virtual AZ::Aabb GetLocalBounds() = 0; diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp index b08670113b..a68ad24adf 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp @@ -182,6 +182,8 @@ namespace AZ ->Event("GetMinimumScreenCoverage", &MeshComponentRequestBus::Events::GetMinimumScreenCoverage) ->Event("SetQualityDecayRate", &MeshComponentRequestBus::Events::SetQualityDecayRate) ->Event("GetQualityDecayRate", &MeshComponentRequestBus::Events::GetQualityDecayRate) + ->Event("SetRayTracingEnabled", &MeshComponentRequestBus::Events::SetRayTracingEnabled) + ->Event("GetRayTracingEnabled", &MeshComponentRequestBus::Events::GetRayTracingEnabled) ->VirtualProperty("ModelAssetId", "GetModelAssetId", "SetModelAssetId") ->VirtualProperty("ModelAssetPath", "GetModelAssetPath", "SetModelAssetPath") ->VirtualProperty("SortKey", "GetSortKey", "SetSortKey") @@ -189,6 +191,7 @@ namespace AZ ->VirtualProperty("LodOverride", "GetLodOverride", "SetLodOverride") ->VirtualProperty("MinimumScreenCoverage", "GetMinimumScreenCoverage", "SetMinimumScreenCoverage") ->VirtualProperty("QualityDecayRate", "GetQualityDecayRate", "SetQualityDecayRate") + ->VirtualProperty("RayTracingEnabled", "GetRayTracingEnabled", "SetRayTracingEnabled") ; behaviorContext->EBus("MeshComponentNotificationBus") @@ -561,6 +564,25 @@ namespace AZ return m_isVisible; } + void MeshComponentController::SetRayTracingEnabled(bool enabled) + { + if (m_meshHandle.IsValid() && m_meshFeatureProcessor) + { + m_meshFeatureProcessor->SetRayTracingEnabled(m_meshHandle, enabled); + m_configuration.m_isRayTracingEnabled = enabled; + } + } + + bool MeshComponentController::GetRayTracingEnabled() const + { + if (m_meshHandle.IsValid() && m_meshFeatureProcessor) + { + return m_meshFeatureProcessor->GetRayTracingEnabled(m_meshHandle); + } + + return false; + } + Aabb MeshComponentController::GetWorldBounds() { if (const AZ::Aabb localBounds = GetLocalBounds(); localBounds.IsValid()) diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.h index 4d09b0b7b6..76cf6a1b39 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.h @@ -116,6 +116,9 @@ namespace AZ void SetVisibility(bool visible) override; bool GetVisibility() const override; + void SetRayTracingEnabled(bool enabled) override; + bool GetRayTracingEnabled() const override; + // BoundsRequestBus and MeshComponentRequestBus overrides ... AZ::Aabb GetWorldBounds() override; AZ::Aabb GetLocalBounds() override; diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.cpp b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.cpp index 58b3d8b56e..bb467b2259 100644 --- a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.cpp +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.cpp @@ -376,7 +376,25 @@ namespace AZ::Render bool AtomActorInstance::GetVisibility() const { - return IsVisible(); + return IsVisible(); + } + + void AtomActorInstance::SetRayTracingEnabled(bool enabled) + { + if (m_meshHandle->IsValid() && m_meshFeatureProcessor) + { + m_meshFeatureProcessor->SetRayTracingEnabled(*m_meshHandle, enabled); + } + } + + bool AtomActorInstance::GetRayTracingEnabled() const + { + if (m_meshHandle->IsValid() && m_meshFeatureProcessor) + { + return m_meshFeatureProcessor->GetRayTracingEnabled(*m_meshHandle); + } + + return false; } AZ::u32 AtomActorInstance::GetJointCount() diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.h b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.h index 7f646466a5..73d428216c 100644 --- a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.h +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.h @@ -152,6 +152,8 @@ namespace AZ float GetQualityDecayRate() const override; void SetVisibility(bool visible) override; bool GetVisibility() const override; + void SetRayTracingEnabled(bool enabled) override; + bool GetRayTracingEnabled() const override; // GetWorldBounds/GetLocalBounds already overridden by BoundsRequestBus::Handler ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/Gems/Vegetation/Code/Tests/VegetationMocks.h b/Gems/Vegetation/Code/Tests/VegetationMocks.h index ece0833433..3361afa177 100644 --- a/Gems/Vegetation/Code/Tests/VegetationMocks.h +++ b/Gems/Vegetation/Code/Tests/VegetationMocks.h @@ -444,6 +444,15 @@ namespace UnitTest m_GetVisibilityOutput = visibility; } + void SetRayTracingEnabled([[maybe_unused]] bool enabled) override + { + } + + bool GetRayTracingEnabled() const override + { + return false; + } + AZ::Data::AssetId m_assetIdOutput; void SetModelAssetId(AZ::Data::AssetId modelAssetId) override { From b62d130475b81e9936f89c5123d1436b4c3dfb1a Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Fri, 14 Jan 2022 11:32:29 -0600 Subject: [PATCH 477/948] Updated AnimNode registration in LyShine and Maestro to register to a member variable map (#6786) * Updated the Maestro MovieSystem and LyShine AnimationSystem to register Anim Nodes and Anim Params into a member variable map Previously the registration was occuring in a global variable map inside of Movie.cpp and UiAnimationSystem.cpp Rolled back the changes to update the CUiAnimNode and CAnimParamType to use the stateless allocator in their m_name string member. This was only needed because those types were used in global memory. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Updated the AZStd::hash specializations for basic_string and basic_fixed_string to be transparent. This allows hashing of types that aren't basic_string or basic_fixed_string using the hash specializations for those types without needing to create an instance of those types. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Adding call to disable saving of the UserSettings.xml in the DisplaySettingsPythonBindingsFixture to avoid race condition running the test in parallel Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- .../test_DisplaySettingsPythonBindings.cpp | 5 + .../AzCore/AzCore/std/string/fixed_string.inl | 3 +- .../AzCore/AzCore/std/string/string.h | 5 +- Code/Legacy/CryCommon/IMovieSystem.h | 5 +- .../Styling/SelectorImplementations.h | 2 +- Gems/LyShine/Code/Source/Animation/AnimNode.h | 3 +- .../Source/Animation/UiAnimationSystem.cpp | 141 ++++------ .../Code/Source/Animation/UiAnimationSystem.h | 22 +- Gems/LyShine/Code/Source/LyShine.cpp | 2 - .../Code/Source/Cinematics/AnimPostFXNode.cpp | 3 +- Gems/Maestro/Code/Source/Cinematics/Movie.cpp | 265 ++++++++---------- Gems/Maestro/Code/Source/Cinematics/Movie.h | 20 +- .../Code/Source/TextureAtlasImpl.h | 2 +- 13 files changed, 234 insertions(+), 244 deletions(-) diff --git a/Code/Editor/Lib/Tests/test_DisplaySettingsPythonBindings.cpp b/Code/Editor/Lib/Tests/test_DisplaySettingsPythonBindings.cpp index fd65634d4e..b73cb039ea 100644 --- a/Code/Editor/Lib/Tests/test_DisplaySettingsPythonBindings.cpp +++ b/Code/Editor/Lib/Tests/test_DisplaySettingsPythonBindings.cpp @@ -35,6 +35,11 @@ namespace DisplaySettingsPythonBindingsUnitTests m_app.Start(appDesc); m_app.RegisterComponentDescriptor(AzToolsFramework::DisplaySettingsPythonFuncsHandler::CreateDescriptor()); + + // Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is + // shared across the whole engine, if multiple tests are run in parallel, the saving could cause a crash + // in the unit tests. + AZ::UserSettingsComponentRequestBus::Broadcast(&AZ::UserSettingsComponentRequests::DisableSaveOnFinalize); } void TearDown() override diff --git a/Code/Framework/AzCore/AzCore/std/string/fixed_string.inl b/Code/Framework/AzCore/AzCore/std/string/fixed_string.inl index 15d2acf7a1..a1c95b7ba2 100644 --- a/Code/Framework/AzCore/AzCore/std/string/fixed_string.inl +++ b/Code/Framework/AzCore/AzCore/std/string/fixed_string.inl @@ -1760,7 +1760,8 @@ namespace AZStd template struct hash> { - inline constexpr size_t operator()(const basic_fixed_string& value) const + using is_transparent = void; + inline constexpr size_t operator()(const basic_string_view& value) const { return hash_string(value.begin(), value.length()); } diff --git a/Code/Framework/AzCore/AzCore/std/string/string.h b/Code/Framework/AzCore/AzCore/std/string/string.h index 7dd6dd7065..56afd16226 100644 --- a/Code/Framework/AzCore/AzCore/std/string/string.h +++ b/Code/Framework/AzCore/AzCore/std/string/string.h @@ -2071,9 +2071,8 @@ namespace AZStd template struct hash< basic_string< Element, Traits, Allocator> > { - typedef basic_string< Element, Traits, Allocator> argument_type; - typedef AZStd::size_t result_type; - inline result_type operator()(const argument_type& value) const + using is_transparent = void; + inline constexpr size_t operator()(const basic_string_view& value) const { return hash_string(value.begin(), value.length()); } diff --git a/Code/Legacy/CryCommon/IMovieSystem.h b/Code/Legacy/CryCommon/IMovieSystem.h index 79c000bfca..a55d764afa 100644 --- a/Code/Legacy/CryCommon/IMovieSystem.h +++ b/Code/Legacy/CryCommon/IMovieSystem.h @@ -13,7 +13,6 @@ #include #include #include -#include #include #include @@ -184,7 +183,7 @@ public: private: AnimParamType m_type; - AZStd::basic_string, AZStd::stateless_allocator> m_name; + AZStd::string m_name; }; namespace AZStd @@ -620,7 +619,7 @@ public: , valueType(_valueType) , flags(_flags) {}; - AZStd::basic_string, AZStd::stateless_allocator> name; // parameter name. + AZStd::string name; // parameter name. CAnimParamType paramType; // parameter id. AnimValueType valueType; // value type, defines type of track to use for animating this parameter. ESupportedParamFlags flags; // combination of flags from ESupportedParamFlags. diff --git a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Styling/SelectorImplementations.h b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Styling/SelectorImplementations.h index 1c65bf1915..eac9abdec8 100644 --- a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Styling/SelectorImplementations.h +++ b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Styling/SelectorImplementations.h @@ -79,7 +79,7 @@ namespace GraphCanvas private: AZStd::string m_value; - AZStd::hash::result_type m_hash; + size_t m_hash; friend class BasicSelectorEventHandler; }; diff --git a/Gems/LyShine/Code/Source/Animation/AnimNode.h b/Gems/LyShine/Code/Source/Animation/AnimNode.h index 4d139e99ca..0076276204 100644 --- a/Gems/LyShine/Code/Source/Animation/AnimNode.h +++ b/Gems/LyShine/Code/Source/Animation/AnimNode.h @@ -13,7 +13,6 @@ #include #include "UiAnimationSystem.h" -#include /*! @@ -40,7 +39,7 @@ public: , valueType(_valueType) , flags(_flags) {}; - AZStd::basic_string, AZStd::stateless_allocator> name; // parameter name. + AZStd::string name; // parameter name. CUiAnimParamType paramType; // parameter id. EUiAnimValue valueType; // value type, defines type of track to use for animating this parameter. ESupportedParamFlags flags; // combination of flags from ESupportedParamFlags. diff --git a/Gems/LyShine/Code/Source/Animation/UiAnimationSystem.cpp b/Gems/LyShine/Code/Source/Animation/UiAnimationSystem.cpp index c8818836d6..06e7110fe2 100644 --- a/Gems/LyShine/Code/Source/Animation/UiAnimationSystem.cpp +++ b/Gems/LyShine/Code/Source/Animation/UiAnimationSystem.cpp @@ -14,77 +14,59 @@ #include "UiAnimSerialize.h" #include -#include #include #include -#include #include #include #include ////////////////////////////////////////////////////////////////////////// -namespace -{ - using UiAnimParamSystemString = AZStd::basic_string, AZStd::stateless_allocator>; - template > - using UiAnimSystemOrderedMap = AZStd::map; - template , typename EqualKey = AZStd::equal_to> - using UiAnimSystemUnorderedMap = AZStd::unordered_map; -} // Serialization for anim nodes & param types -#define REGISTER_NODE_TYPE(name) assert(!g_animNodeEnumToStringMap.contains(eUiAnimNodeType_ ## name)); \ - g_animNodeEnumToStringMap[eUiAnimNodeType_ ## name] = AZ_STRINGIZE(name); \ - g_animNodeStringToEnumMap[UiAnimParamSystemString(AZ_STRINGIZE(name))] = eUiAnimNodeType_ ## name; - -#define REGISTER_PARAM_TYPE(name) assert(!g_animParamEnumToStringMap.contains(eUiAnimParamType_ ## name)); \ - g_animParamEnumToStringMap[eUiAnimParamType_ ## name] = AZ_STRINGIZE(name); \ - g_animParamStringToEnumMap[UiAnimParamSystemString(AZ_STRINGIZE(name))] = eUiAnimParamType_ ## name; - -namespace -{ - UiAnimSystemUnorderedMap g_animNodeEnumToStringMap; - UiAnimSystemOrderedMap> g_animNodeStringToEnumMap; - - UiAnimSystemUnorderedMap g_animParamEnumToStringMap; - UiAnimSystemOrderedMap> g_animParamStringToEnumMap; - - // If you get an assert in this function, it means two node types have the same enum value. - void RegisterNodeTypes() - { - REGISTER_NODE_TYPE(Entity) - REGISTER_NODE_TYPE(Director) - REGISTER_NODE_TYPE(Camera) - REGISTER_NODE_TYPE(CVar) - REGISTER_NODE_TYPE(ScriptVar) - REGISTER_NODE_TYPE(Material) - REGISTER_NODE_TYPE(Event) - REGISTER_NODE_TYPE(Group) - REGISTER_NODE_TYPE(Layer) - REGISTER_NODE_TYPE(Comment) - REGISTER_NODE_TYPE(RadialBlur) - REGISTER_NODE_TYPE(ColorCorrection) - REGISTER_NODE_TYPE(DepthOfField) - REGISTER_NODE_TYPE(ScreenFader) - REGISTER_NODE_TYPE(Light) - REGISTER_NODE_TYPE(HDRSetup) - REGISTER_NODE_TYPE(ShadowSetup) - REGISTER_NODE_TYPE(Alembic) - REGISTER_NODE_TYPE(GeomCache) - REGISTER_NODE_TYPE(Environment) - REGISTER_NODE_TYPE(ScreenDropsSetup) - REGISTER_NODE_TYPE(AzEntity) - } - - // If you get an assert in this function, it means two param types have the same enum value. - void RegisterParamTypes() - { - REGISTER_PARAM_TYPE(Event) - REGISTER_PARAM_TYPE(Float) - REGISTER_PARAM_TYPE(TrackEvent) - REGISTER_PARAM_TYPE(AzComponentField) - } +#define REGISTER_NODE_TYPE(name) assert(!m_animNodeEnumToStringMap.contains(eUiAnimNodeType_ ## name)); \ + m_animNodeEnumToStringMap[eUiAnimNodeType_ ## name] = AZ_STRINGIZE(name); \ + m_animNodeStringToEnumMap[UiAnimParamSystemString(AZ_STRINGIZE(name))] = eUiAnimNodeType_ ## name; + +#define REGISTER_PARAM_TYPE(name) assert(!m_animParamEnumToStringMap.contains(eUiAnimParamType_ ## name)); \ + m_animParamEnumToStringMap[eUiAnimParamType_ ## name] = AZ_STRINGIZE(name); \ + m_animParamStringToEnumMap[UiAnimParamSystemString(AZ_STRINGIZE(name))] = eUiAnimParamType_ ## name; + + +// If you get an assert in this function, it means two node types have the same enum value. +void UiAnimationSystem::RegisterNodeTypes() +{ + REGISTER_NODE_TYPE(Entity) + REGISTER_NODE_TYPE(Director) + REGISTER_NODE_TYPE(Camera) + REGISTER_NODE_TYPE(CVar) + REGISTER_NODE_TYPE(ScriptVar) + REGISTER_NODE_TYPE(Material) + REGISTER_NODE_TYPE(Event) + REGISTER_NODE_TYPE(Group) + REGISTER_NODE_TYPE(Layer) + REGISTER_NODE_TYPE(Comment) + REGISTER_NODE_TYPE(RadialBlur) + REGISTER_NODE_TYPE(ColorCorrection) + REGISTER_NODE_TYPE(DepthOfField) + REGISTER_NODE_TYPE(ScreenFader) + REGISTER_NODE_TYPE(Light) + REGISTER_NODE_TYPE(HDRSetup) + REGISTER_NODE_TYPE(ShadowSetup) + REGISTER_NODE_TYPE(Alembic) + REGISTER_NODE_TYPE(GeomCache) + REGISTER_NODE_TYPE(Environment) + REGISTER_NODE_TYPE(ScreenDropsSetup) + REGISTER_NODE_TYPE(AzEntity) +} + +// If you get an assert in this function, it means two param types have the same enum value. +void UiAnimationSystem::RegisterParamTypes() +{ + REGISTER_PARAM_TYPE(Event) + REGISTER_PARAM_TYPE(Float) + REGISTER_PARAM_TYPE(TrackEvent) + REGISTER_PARAM_TYPE(AzComponentField) } ////////////////////////////////////////////////////////////////////////// @@ -98,6 +80,10 @@ UiAnimationSystem::UiAnimationSystem() m_lastUpdateTime = AZ::Time::ZeroTimeUs; m_nextSequenceId = 1; + + DoNodeStaticInitialisation(); + RegisterNodeTypes(); + RegisterParamTypes(); } ////////////////////////////////////////////////////////////////////////// @@ -1173,16 +1159,16 @@ void UiAnimationSystem::SerializeNodeType(EUiAnimNodeType& animNodeType, XmlNode XmlString nodeTypeString; if (xmlNode->getAttr(kType, nodeTypeString)) { - assert(g_animNodeStringToEnumMap.find(nodeTypeString.c_str()) != g_animNodeStringToEnumMap.end()); - animNodeType = stl::find_in_map(g_animNodeStringToEnumMap, nodeTypeString.c_str(), eUiAnimNodeType_Invalid); + assert(m_animNodeStringToEnumMap.contains(nodeTypeString.c_str())); + animNodeType = stl::find_in_map(m_animNodeStringToEnumMap, nodeTypeString.c_str(), eUiAnimNodeType_Invalid); } } } else { const char* pTypeString = "Invalid"; - assert(g_animNodeEnumToStringMap.find(animNodeType) != g_animNodeEnumToStringMap.end()); - pTypeString = g_animNodeEnumToStringMap[animNodeType].c_str(); + assert(m_animNodeEnumToStringMap.find(animNodeType) != m_animNodeEnumToStringMap.end()); + pTypeString = m_animNodeEnumToStringMap[animNodeType].c_str(); xmlNode->setAttr(kType, pTypeString); } } @@ -1242,8 +1228,8 @@ void UiAnimationSystem::SerializeParamType(CUiAnimParamType& animParamType, XmlN } else { - assert(g_animParamStringToEnumMap.find(paramTypeString.c_str()) != g_animParamStringToEnumMap.end()); - animParamType.m_type = stl::find_in_map(g_animParamStringToEnumMap, paramTypeString.c_str(), eUiAnimParamType_Invalid); + assert(m_animParamStringToEnumMap.contains(paramTypeString.c_str())); + animParamType.m_type = stl::find_in_map(m_animParamStringToEnumMap, paramTypeString.c_str(), eUiAnimParamType_Invalid); } } } @@ -1265,8 +1251,8 @@ void UiAnimationSystem::SerializeParamType(CUiAnimParamType& animParamType, XmlN } else { - assert(g_animParamEnumToStringMap.find(animParamType.m_type) != g_animParamEnumToStringMap.end()); - pTypeString = g_animParamEnumToStringMap[animParamType.m_type].c_str(); + assert(m_animParamEnumToStringMap.find(animParamType.m_type) != m_animParamEnumToStringMap.end()); + pTypeString = m_animParamEnumToStringMap[animParamType.m_type].c_str(); } xmlNode->setAttr(kParamType, pTypeString); @@ -1332,9 +1318,9 @@ const char* UiAnimationSystem::GetParamTypeName(const CUiAnimParamType& animPara } else { - if (g_animParamEnumToStringMap.find(animParamType.m_type) != g_animParamEnumToStringMap.end()) + if (m_animParamEnumToStringMap.find(animParamType.m_type) != m_animParamEnumToStringMap.end()) { - return g_animParamEnumToStringMap[animParamType.m_type].c_str(); + return m_animParamEnumToStringMap[animParamType.m_type].c_str(); } } @@ -1346,15 +1332,6 @@ void UiAnimationSystem::OnCameraCut() { } -////////////////////////////////////////////////////////////////////////// -void UiAnimationSystem::StaticInitialize() -{ - DoNodeStaticInitialisation(); - - RegisterNodeTypes(); - RegisterParamTypes(); -} - ////////////////////////////////////////////////////////////////////////// void UiAnimationSystem::Reflect(AZ::SerializeContext* serializeContext) { @@ -1380,13 +1357,13 @@ void UiAnimationSystem::Reflect(AZ::SerializeContext* serializeContext) ////////////////////////////////////////////////////////////////////////// EUiAnimNodeType UiAnimationSystem::GetNodeTypeFromString(const char* pString) const { - return stl::find_in_map(g_animNodeStringToEnumMap, pString, eUiAnimNodeType_Invalid); + return stl::find_in_map(m_animNodeStringToEnumMap, pString, eUiAnimNodeType_Invalid); } ////////////////////////////////////////////////////////////////////////// CUiAnimParamType UiAnimationSystem::GetParamTypeFromString(const char* pString) const { - const EUiAnimParamType paramType = stl::find_in_map(g_animParamStringToEnumMap, pString, eUiAnimParamType_Invalid); + const EUiAnimParamType paramType = stl::find_in_map(m_animParamStringToEnumMap, pString, eUiAnimParamType_Invalid); if (paramType != eUiAnimParamType_Invalid) { diff --git a/Gems/LyShine/Code/Source/Animation/UiAnimationSystem.h b/Gems/LyShine/Code/Source/Animation/UiAnimationSystem.h index cd51cd51d0..6c710205fa 100644 --- a/Gems/LyShine/Code/Source/Animation/UiAnimationSystem.h +++ b/Gems/LyShine/Code/Source/Animation/UiAnimationSystem.h @@ -14,6 +14,8 @@ #include #include +#include + struct PlayingUIAnimSequence { //! Sequence playing @@ -134,12 +136,10 @@ public: void SerializeParamType(CUiAnimParamType& animParamType, XmlNodeRef& xmlNode, bool bLoading, const uint version) override; void SerializeParamData(UiAnimParamData& animParamData, XmlNodeRef& xmlNode, bool bLoading) override; - static const char* GetParamTypeName(const CUiAnimParamType& animParamType); + const char* GetParamTypeName(const CUiAnimParamType& animParamType); void OnCameraCut(); - static void StaticInitialize(); - static void Reflect(AZ::SerializeContext* serializeContext); void NotifyTrackEventListeners(const char* eventName, const char* valueName, IUiAnimSequence* pSequence) override; @@ -187,5 +187,21 @@ private: // A sequence which turned on the early animation update last time uint32 m_nextSequenceId; + + using UiAnimParamSystemString = AZStd::string; + template > + using UiAnimSystemOrderedMap = AZStd::map; + template , typename EqualKey = AZStd::equal_to<>> + using UiAnimSystemUnorderedMap = AZStd::unordered_map; + + UiAnimSystemUnorderedMap m_animNodeEnumToStringMap; + UiAnimSystemOrderedMap m_animNodeStringToEnumMap; + + UiAnimSystemUnorderedMap m_animParamEnumToStringMap; + UiAnimSystemOrderedMap m_animParamStringToEnumMap; + + void RegisterNodeTypes(); + void RegisterParamTypes(); + void ShowPlayedSequencesDebug(); }; diff --git a/Gems/LyShine/Code/Source/LyShine.cpp b/Gems/LyShine/Code/Source/LyShine.cpp index 5a704329ef..b362ed2106 100644 --- a/Gems/LyShine/Code/Source/LyShine.cpp +++ b/Gems/LyShine/Code/Source/LyShine.cpp @@ -156,8 +156,6 @@ CLyShine::CLyShine([[maybe_unused]] ISystem* system) UiElementComponent::Initialize(); UiCanvasComponent::Initialize(); - UiAnimationSystem::StaticInitialize(); - AzFramework::InputChannelEventListener::Connect(); AzFramework::InputTextEventListener::Connect(); UiCursorBus::Handler::BusConnect(); diff --git a/Gems/Maestro/Code/Source/Cinematics/AnimPostFXNode.cpp b/Gems/Maestro/Code/Source/Cinematics/AnimPostFXNode.cpp index b535033351..7e32301b71 100644 --- a/Gems/Maestro/Code/Source/Cinematics/AnimPostFXNode.cpp +++ b/Gems/Maestro/Code/Source/Cinematics/AnimPostFXNode.cpp @@ -8,7 +8,6 @@ #include -#include #include "AnimPostFXNode.h" #include "AnimSplineTrack.h" #include "CompoundSplineTrack.h" @@ -39,7 +38,7 @@ public: virtual void GetDefault(bool& val) const = 0; virtual void GetDefault(Vec4& val) const = 0; - AZStd::basic_string, AZStd::stateless_allocator> m_name; + AZStd::string m_name; protected: virtual ~CControlParamBase(){} diff --git a/Gems/Maestro/Code/Source/Cinematics/Movie.cpp b/Gems/Maestro/Code/Source/Cinematics/Movie.cpp index dc0782f982..51be8a4c24 100644 --- a/Gems/Maestro/Code/Source/Cinematics/Movie.cpp +++ b/Gems/Maestro/Code/Source/Cinematics/Movie.cpp @@ -7,7 +7,6 @@ */ #include -#include #include #include #include @@ -28,7 +27,6 @@ #include "LayerNode.h" #include "ShadowsSetupNode.h" -#include #include #include @@ -74,136 +72,117 @@ static SMovieSequenceAutoComplete s_movieSequenceAutoComplete; #endif ////////////////////////////////////////////////////////////////////////// -namespace -{ - using AnimParamSystemString = AZStd::basic_string, AZStd::stateless_allocator>; - - template > - using AnimSystemOrderedMap = AZStd::map; - template , typename EqualKey = AZStd::equal_to> - using AnimSystemUnorderedMap = AZStd::unordered_map; -} - // Serialization for anim nodes & param types -#define REGISTER_NODE_TYPE(name) assert(!g_animNodeEnumToStringMap.contains(AnimNodeType::name)); \ - g_animNodeEnumToStringMap[AnimNodeType::name] = AZ_STRINGIZE(name); \ - g_animNodeStringToEnumMap[AnimParamSystemString(AZ_STRINGIZE(name))] = AnimNodeType::name; - -#define REGISTER_PARAM_TYPE(name) assert(!g_animParamEnumToStringMap.contains(AnimParamType::name)); \ - g_animParamEnumToStringMap[AnimParamType::name] = AZ_STRINGIZE(name); \ - g_animParamStringToEnumMap[AnimParamSystemString(AZ_STRINGIZE(name))] = AnimParamType::name; - -namespace -{ - AnimSystemUnorderedMap g_animNodeEnumToStringMap; - AnimSystemOrderedMap> g_animNodeStringToEnumMap; - - AnimSystemUnorderedMap g_animParamEnumToStringMap; - AnimSystemOrderedMap> g_animParamStringToEnumMap; - - // If you get an assert in this function, it means two node types have the same enum value. - void RegisterNodeTypes() - { - REGISTER_NODE_TYPE(Entity) - REGISTER_NODE_TYPE(Director) - REGISTER_NODE_TYPE(Camera) - REGISTER_NODE_TYPE(CVar) - REGISTER_NODE_TYPE(ScriptVar) - REGISTER_NODE_TYPE(Material) - REGISTER_NODE_TYPE(Event) - REGISTER_NODE_TYPE(Group) - REGISTER_NODE_TYPE(Layer) - REGISTER_NODE_TYPE(Comment) - REGISTER_NODE_TYPE(RadialBlur) - REGISTER_NODE_TYPE(ColorCorrection) - REGISTER_NODE_TYPE(DepthOfField) - REGISTER_NODE_TYPE(ScreenFader) - REGISTER_NODE_TYPE(Light) - REGISTER_NODE_TYPE(ShadowSetup) - REGISTER_NODE_TYPE(Alembic) - REGISTER_NODE_TYPE(GeomCache) - REGISTER_NODE_TYPE(Environment) - REGISTER_NODE_TYPE(AzEntity) - REGISTER_NODE_TYPE(Component) - } - - // If you get an assert in this function, it means two param types have the same enum value. - void RegisterParamTypes() - { - REGISTER_PARAM_TYPE(FOV) - REGISTER_PARAM_TYPE(Position) - REGISTER_PARAM_TYPE(Rotation) - REGISTER_PARAM_TYPE(Scale) - REGISTER_PARAM_TYPE(Event) - REGISTER_PARAM_TYPE(Visibility) - REGISTER_PARAM_TYPE(Camera) - REGISTER_PARAM_TYPE(Animation) - REGISTER_PARAM_TYPE(Sound) - REGISTER_PARAM_TYPE(Sequence) - REGISTER_PARAM_TYPE(Console) - REGISTER_PARAM_TYPE(Music) ///@deprecated in 1.11, left in for legacy serialization - REGISTER_PARAM_TYPE(Float) - REGISTER_PARAM_TYPE(LookAt) - REGISTER_PARAM_TYPE(TrackEvent) - REGISTER_PARAM_TYPE(ShakeAmplitudeA) - REGISTER_PARAM_TYPE(ShakeAmplitudeB) - REGISTER_PARAM_TYPE(ShakeFrequencyA) - REGISTER_PARAM_TYPE(ShakeFrequencyB) - REGISTER_PARAM_TYPE(ShakeMultiplier) - REGISTER_PARAM_TYPE(ShakeNoise) - REGISTER_PARAM_TYPE(ShakeWorking) - REGISTER_PARAM_TYPE(ShakeAmpAMult) - REGISTER_PARAM_TYPE(ShakeAmpBMult) - REGISTER_PARAM_TYPE(ShakeFreqAMult) - REGISTER_PARAM_TYPE(ShakeFreqBMult) - REGISTER_PARAM_TYPE(DepthOfField) - REGISTER_PARAM_TYPE(FocusDistance) - REGISTER_PARAM_TYPE(FocusRange) - REGISTER_PARAM_TYPE(BlurAmount) - REGISTER_PARAM_TYPE(Capture) - REGISTER_PARAM_TYPE(TransformNoise) - REGISTER_PARAM_TYPE(TimeWarp) - REGISTER_PARAM_TYPE(FixedTimeStep) - REGISTER_PARAM_TYPE(NearZ) - REGISTER_PARAM_TYPE(Goto) - REGISTER_PARAM_TYPE(PositionX) - REGISTER_PARAM_TYPE(PositionY) - REGISTER_PARAM_TYPE(PositionZ) - REGISTER_PARAM_TYPE(RotationX) - REGISTER_PARAM_TYPE(RotationY) - REGISTER_PARAM_TYPE(RotationZ) - REGISTER_PARAM_TYPE(ScaleX) - REGISTER_PARAM_TYPE(ScaleY) - REGISTER_PARAM_TYPE(ScaleZ) - REGISTER_PARAM_TYPE(ColorR) - REGISTER_PARAM_TYPE(ColorG) - REGISTER_PARAM_TYPE(ColorB) - REGISTER_PARAM_TYPE(CommentText) - REGISTER_PARAM_TYPE(ScreenFader) - REGISTER_PARAM_TYPE(LightDiffuse) - REGISTER_PARAM_TYPE(LightRadius) - REGISTER_PARAM_TYPE(LightDiffuseMult) - REGISTER_PARAM_TYPE(LightHDRDynamic) - REGISTER_PARAM_TYPE(LightSpecularMult) - REGISTER_PARAM_TYPE(LightSpecPercentage) - REGISTER_PARAM_TYPE(MaterialDiffuse) - REGISTER_PARAM_TYPE(MaterialSpecular) - REGISTER_PARAM_TYPE(MaterialEmissive) - REGISTER_PARAM_TYPE(MaterialEmissiveIntensity) - REGISTER_PARAM_TYPE(MaterialOpacity) - REGISTER_PARAM_TYPE(MaterialSmoothness) - REGISTER_PARAM_TYPE(TimeRanges) - REGISTER_PARAM_TYPE(Physics) - REGISTER_PARAM_TYPE(GSMCache) - REGISTER_PARAM_TYPE(ShutterSpeed) - REGISTER_PARAM_TYPE(Physicalize) - REGISTER_PARAM_TYPE(PhysicsDriven) - REGISTER_PARAM_TYPE(SunLongitude) - REGISTER_PARAM_TYPE(SunLatitude) - REGISTER_PARAM_TYPE(MoonLongitude) - REGISTER_PARAM_TYPE(MoonLatitude) - REGISTER_PARAM_TYPE(ProceduralEyes) - } +#define REGISTER_NODE_TYPE(name) assert(!m_animNodeEnumToStringMap.contains(AnimNodeType::name)); \ + m_animNodeEnumToStringMap[AnimNodeType::name] = AZ_STRINGIZE(name); \ + m_animNodeStringToEnumMap[AnimParamSystemString(AZ_STRINGIZE(name))] = AnimNodeType::name; + +#define REGISTER_PARAM_TYPE(name) assert(!m_animParamEnumToStringMap.contains(AnimParamType::name)); \ + m_animParamEnumToStringMap[AnimParamType::name] = AZ_STRINGIZE(name); \ + m_animParamStringToEnumMap[AnimParamSystemString(AZ_STRINGIZE(name))] = AnimParamType::name; + +// If you get an assert in this function, it means two node types have the same enum value. +void CMovieSystem::RegisterNodeTypes() +{ + REGISTER_NODE_TYPE(Entity) + REGISTER_NODE_TYPE(Director) + REGISTER_NODE_TYPE(Camera) + REGISTER_NODE_TYPE(CVar) + REGISTER_NODE_TYPE(ScriptVar) + REGISTER_NODE_TYPE(Material) + REGISTER_NODE_TYPE(Event) + REGISTER_NODE_TYPE(Group) + REGISTER_NODE_TYPE(Layer) + REGISTER_NODE_TYPE(Comment) + REGISTER_NODE_TYPE(RadialBlur) + REGISTER_NODE_TYPE(ColorCorrection) + REGISTER_NODE_TYPE(DepthOfField) + REGISTER_NODE_TYPE(ScreenFader) + REGISTER_NODE_TYPE(Light) + REGISTER_NODE_TYPE(ShadowSetup) + REGISTER_NODE_TYPE(Alembic) + REGISTER_NODE_TYPE(GeomCache) + REGISTER_NODE_TYPE(Environment) + REGISTER_NODE_TYPE(AzEntity) + REGISTER_NODE_TYPE(Component) +} + +// If you get an assert in this function, it means two param types have the same enum value. +void CMovieSystem::RegisterParamTypes() +{ + REGISTER_PARAM_TYPE(FOV) + REGISTER_PARAM_TYPE(Position) + REGISTER_PARAM_TYPE(Rotation) + REGISTER_PARAM_TYPE(Scale) + REGISTER_PARAM_TYPE(Event) + REGISTER_PARAM_TYPE(Visibility) + REGISTER_PARAM_TYPE(Camera) + REGISTER_PARAM_TYPE(Animation) + REGISTER_PARAM_TYPE(Sound) + REGISTER_PARAM_TYPE(Sequence) + REGISTER_PARAM_TYPE(Console) + REGISTER_PARAM_TYPE(Music) ///@deprecated in 1.11, left in for legacy serialization + REGISTER_PARAM_TYPE(Float) + REGISTER_PARAM_TYPE(LookAt) + REGISTER_PARAM_TYPE(TrackEvent) + REGISTER_PARAM_TYPE(ShakeAmplitudeA) + REGISTER_PARAM_TYPE(ShakeAmplitudeB) + REGISTER_PARAM_TYPE(ShakeFrequencyA) + REGISTER_PARAM_TYPE(ShakeFrequencyB) + REGISTER_PARAM_TYPE(ShakeMultiplier) + REGISTER_PARAM_TYPE(ShakeNoise) + REGISTER_PARAM_TYPE(ShakeWorking) + REGISTER_PARAM_TYPE(ShakeAmpAMult) + REGISTER_PARAM_TYPE(ShakeAmpBMult) + REGISTER_PARAM_TYPE(ShakeFreqAMult) + REGISTER_PARAM_TYPE(ShakeFreqBMult) + REGISTER_PARAM_TYPE(DepthOfField) + REGISTER_PARAM_TYPE(FocusDistance) + REGISTER_PARAM_TYPE(FocusRange) + REGISTER_PARAM_TYPE(BlurAmount) + REGISTER_PARAM_TYPE(Capture) + REGISTER_PARAM_TYPE(TransformNoise) + REGISTER_PARAM_TYPE(TimeWarp) + REGISTER_PARAM_TYPE(FixedTimeStep) + REGISTER_PARAM_TYPE(NearZ) + REGISTER_PARAM_TYPE(Goto) + REGISTER_PARAM_TYPE(PositionX) + REGISTER_PARAM_TYPE(PositionY) + REGISTER_PARAM_TYPE(PositionZ) + REGISTER_PARAM_TYPE(RotationX) + REGISTER_PARAM_TYPE(RotationY) + REGISTER_PARAM_TYPE(RotationZ) + REGISTER_PARAM_TYPE(ScaleX) + REGISTER_PARAM_TYPE(ScaleY) + REGISTER_PARAM_TYPE(ScaleZ) + REGISTER_PARAM_TYPE(ColorR) + REGISTER_PARAM_TYPE(ColorG) + REGISTER_PARAM_TYPE(ColorB) + REGISTER_PARAM_TYPE(CommentText) + REGISTER_PARAM_TYPE(ScreenFader) + REGISTER_PARAM_TYPE(LightDiffuse) + REGISTER_PARAM_TYPE(LightRadius) + REGISTER_PARAM_TYPE(LightDiffuseMult) + REGISTER_PARAM_TYPE(LightHDRDynamic) + REGISTER_PARAM_TYPE(LightSpecularMult) + REGISTER_PARAM_TYPE(LightSpecPercentage) + REGISTER_PARAM_TYPE(MaterialDiffuse) + REGISTER_PARAM_TYPE(MaterialSpecular) + REGISTER_PARAM_TYPE(MaterialEmissive) + REGISTER_PARAM_TYPE(MaterialEmissiveIntensity) + REGISTER_PARAM_TYPE(MaterialOpacity) + REGISTER_PARAM_TYPE(MaterialSmoothness) + REGISTER_PARAM_TYPE(TimeRanges) + REGISTER_PARAM_TYPE(Physics) + REGISTER_PARAM_TYPE(GSMCache) + REGISTER_PARAM_TYPE(ShutterSpeed) + REGISTER_PARAM_TYPE(Physicalize) + REGISTER_PARAM_TYPE(PhysicsDriven) + REGISTER_PARAM_TYPE(SunLongitude) + REGISTER_PARAM_TYPE(SunLatitude) + REGISTER_PARAM_TYPE(MoonLongitude) + REGISTER_PARAM_TYPE(MoonLatitude) + REGISTER_PARAM_TYPE(ProceduralEyes) } namespace Internal @@ -1666,16 +1645,16 @@ void CMovieSystem::SerializeNodeType(AnimNodeType& animNodeType, XmlNodeRef& xml XmlString nodeTypeString; if (xmlNode->getAttr(kType, nodeTypeString)) { - assert(g_animNodeStringToEnumMap.find(nodeTypeString.c_str()) != g_animNodeStringToEnumMap.end()); - animNodeType = stl::find_in_map(g_animNodeStringToEnumMap, nodeTypeString.c_str(), AnimNodeType::Invalid); + assert(m_animNodeStringToEnumMap.find(nodeTypeString.c_str()) != m_animNodeStringToEnumMap.end()); + animNodeType = stl::find_in_map(m_animNodeStringToEnumMap, nodeTypeString.c_str(), AnimNodeType::Invalid); } } } else { const char* pTypeString = "Invalid"; - assert(g_animNodeEnumToStringMap.find(animNodeType) != g_animNodeEnumToStringMap.end()); - pTypeString = g_animNodeEnumToStringMap[animNodeType].c_str(); + assert(m_animNodeEnumToStringMap.find(animNodeType) != m_animNodeEnumToStringMap.end()); + pTypeString = m_animNodeEnumToStringMap[animNodeType].c_str(); xmlNode->setAttr(kType, pTypeString); } } @@ -1744,8 +1723,8 @@ void CMovieSystem::LoadParamTypeFromXml(CAnimParamType& animParamType, const Xml animParamType.m_name = virtualPropertyValue; } - assert(g_animParamStringToEnumMap.find(paramTypeString.c_str()) != g_animParamStringToEnumMap.end()); - animParamType.m_type = stl::find_in_map(g_animParamStringToEnumMap, paramTypeString.c_str(), AnimParamType::Invalid); + assert(m_animParamStringToEnumMap.find(paramTypeString.c_str()) != m_animParamStringToEnumMap.end()); + animParamType.m_type = stl::find_in_map(m_animParamStringToEnumMap, paramTypeString.c_str(), AnimParamType::Invalid); } } } @@ -1775,8 +1754,8 @@ void CMovieSystem::SaveParamTypeToXml(const CAnimParamType& animParamType, XmlNo xmlNode->setAttr(CAnimParamTypeXmlNames::kVirtualPropertyName, animParamType.m_name.c_str()); } - assert(g_animParamEnumToStringMap.find(animParamType.m_type) != g_animParamEnumToStringMap.end()); - pTypeString = g_animParamEnumToStringMap[animParamType.m_type].c_str(); + assert(m_animParamEnumToStringMap.find(animParamType.m_type) != m_animParamEnumToStringMap.end()); + pTypeString = m_animParamEnumToStringMap[animParamType.m_type].c_str(); } xmlNode->setAttr(kParamType, pTypeString); @@ -1809,9 +1788,9 @@ const char* CMovieSystem::GetParamTypeName(const CAnimParamType& animParamType) } else { - if (g_animParamEnumToStringMap.find(animParamType.m_type) != g_animParamEnumToStringMap.end()) + if (m_animParamEnumToStringMap.contains(animParamType.m_type)) { - return g_animParamEnumToStringMap[animParamType.m_type].c_str(); + return m_animParamEnumToStringMap[animParamType.m_type].c_str(); } } @@ -1973,13 +1952,13 @@ void CLightAnimWrapper::RemoveCachedLightAnim(const char* name) ////////////////////////////////////////////////////////////////////////// AnimNodeType CMovieSystem::GetNodeTypeFromString(const char* pString) const { - return stl::find_in_map(g_animNodeStringToEnumMap, pString, AnimNodeType::Invalid); + return stl::find_in_map(m_animNodeStringToEnumMap, pString, AnimNodeType::Invalid); } ////////////////////////////////////////////////////////////////////////// CAnimParamType CMovieSystem::GetParamTypeFromString(const char* pString) const { - const AnimParamType paramType = stl::find_in_map(g_animParamStringToEnumMap, pString, AnimParamType::Invalid); + const AnimParamType paramType = stl::find_in_map(m_animParamStringToEnumMap, pString, AnimParamType::Invalid); if (paramType != AnimParamType::Invalid) { diff --git a/Gems/Maestro/Code/Source/Cinematics/Movie.h b/Gems/Maestro/Code/Source/Cinematics/Movie.h index ab2c2e649b..4af2b55ced 100644 --- a/Gems/Maestro/Code/Source/Cinematics/Movie.h +++ b/Gems/Maestro/Code/Source/Cinematics/Movie.h @@ -18,6 +18,7 @@ #include #include +#include #include "IMovieSystem.h" #include "IShader.h" @@ -192,7 +193,7 @@ public: void SaveParamTypeToXml(const CAnimParamType& animParamType, XmlNodeRef& xmlNode) override; void SerializeParamType(CAnimParamType& animParamType, XmlNodeRef& xmlNode, bool bLoading, const uint version) override; - static const char* GetParamTypeName(const CAnimParamType& animParamType); + const char* GetParamTypeName(const CAnimParamType& animParamType); void OnCameraCut(); @@ -290,6 +291,23 @@ private: void ShowPlayedSequencesDebug(); + + using AnimParamSystemString = AZStd::string; + + template > + using AnimSystemOrderedMap = AZStd::map; + template , typename EqualKey = AZStd::equal_to<>> + using AnimSystemUnorderedMap = AZStd::unordered_map; + + AnimSystemUnorderedMap m_animNodeEnumToStringMap; + AnimSystemOrderedMap m_animNodeStringToEnumMap; + + AnimSystemUnorderedMap m_animParamEnumToStringMap; + AnimSystemOrderedMap m_animParamStringToEnumMap; + + void RegisterNodeTypes(); + void RegisterParamTypes(); + public: static float m_mov_cameraPrecacheTime; #if !defined(_RELEASE) diff --git a/Gems/TextureAtlas/Code/Source/TextureAtlasImpl.h b/Gems/TextureAtlas/Code/Source/TextureAtlasImpl.h index ce2f4826da..bb0ed650e5 100644 --- a/Gems/TextureAtlas/Code/Source/TextureAtlasImpl.h +++ b/Gems/TextureAtlas/Code/Source/TextureAtlasImpl.h @@ -33,7 +33,7 @@ namespace TextureAtlasNamespace struct hash_case_insensitive : public AZStd::hash { AZ_TYPE_INFO(hash_case_insensitive, "{FE0F4349-D80D-4286-8874-733966A32B29}"); - inline result_type operator()(const AZStd::string& value) const + inline size_t operator()(const AZStd::string& value) const { AZStd::string lowerStr = value; AZStd::to_lower(lowerStr.begin(), lowerStr.end()); From f87e1f6906d1ccdb4485d6e6e1237101128b68fd Mon Sep 17 00:00:00 2001 From: LesaelR <89800757+LesaelR@users.noreply.github.com> Date: Fri, 14 Jan 2022 09:48:46 -0800 Subject: [PATCH 478/948] Disabling BundleMode, AssetBundler, and MissingDependency tests on Linux. (#6888) Signed-off-by: Rosario Cox --- .../asset_processor_tests/CMakeLists.txt | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/CMakeLists.txt index e37a5ed99b..5839093473 100644 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/CMakeLists.txt @@ -93,15 +93,19 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) ) ly_add_pytest( - NAME AssetPipelineTests.AssetBundler - PATH ${CMAKE_CURRENT_LIST_DIR}/asset_bundler_batch_tests.py + NAME AssetPipelineTests.AssetBuilder + PATH ${CMAKE_CURRENT_LIST_DIR}/asset_builder_tests.py EXCLUDE_TEST_RUN_TARGET_FROM_IDE TEST_SERIAL TEST_SUITE periodic RUNTIME_DEPENDENCIES AZ::AssetProcessor - AZ::AssetBundlerBatch ) + + set(SUPPORTED_PLATFORMS "Windows" "Mac") + if (NOT "${PAL_PLATFORM_NAME}" IN_LIST SUPPORTED_PLATFORMS) + return() + endif() ly_add_pytest( NAME AssetPipelineTests.BundleMode @@ -117,16 +121,16 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) ) ly_add_pytest( - NAME AssetPipelineTests.AssetBuilder - PATH ${CMAKE_CURRENT_LIST_DIR}/asset_builder_tests.py + NAME AssetPipelineTests.AssetBundler + PATH ${CMAKE_CURRENT_LIST_DIR}/asset_bundler_batch_tests.py EXCLUDE_TEST_RUN_TARGET_FROM_IDE TEST_SERIAL TEST_SUITE periodic RUNTIME_DEPENDENCIES AZ::AssetProcessor + AZ::AssetBundlerBatch ) - ly_add_pytest( NAME AssetPipelineTests.MissingDependency PATH ${CMAKE_CURRENT_LIST_DIR}/missing_dependency_tests.py @@ -136,5 +140,5 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) RUNTIME_DEPENDENCIES AZ::AssetProcessorBatch ) - + endif() From 02ce4659c4312c11c6210f5745b2a592650012c0 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Fri, 14 Jan 2022 09:58:54 -0800 Subject: [PATCH 479/948] remove comment Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp index 0e158d3e08..92045b505f 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp @@ -674,7 +674,6 @@ namespace ScriptCanvasEditor if (variable) { - // functions 2.0 set variable scope to function if (variable->GetScope() != ScriptCanvas::VariableFlags::Scope::Function) { variable->SetScope(ScriptCanvas::VariableFlags::Scope::Function); From 641e76eca9f2c0b7f4d5bf1f83d6b8b884d9ecc5 Mon Sep 17 00:00:00 2001 From: amzn-sj Date: Fri, 14 Jan 2022 10:09:14 -0800 Subject: [PATCH 480/948] Convert the loops using the Get* functions in Terrain physics and debugger components to use the new ProcessRegion* functions. Signed-off-by: amzn-sj --- .../TerrainPhysicsColliderComponent.cpp | 80 ++++++++----------- .../TerrainWorldDebuggerComponent.cpp | 37 +++------ 2 files changed, 45 insertions(+), 72 deletions(-) diff --git a/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp b/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp index c51728a5c3..4a8b4680b3 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp +++ b/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp @@ -284,21 +284,14 @@ namespace Terrain heights.clear(); heights.reserve(gridWidth * gridHeight); - for (int32_t row = 0; row < gridHeight; row++) + auto perPositionHeightCallback = [&heights, worldCenterZ] + ([[maybe_unused]] size_t xIndex, [[maybe_unused]] size_t yIndex, const AzFramework::SurfaceData::SurfacePoint& surfacePoint, [[maybe_unused]] bool terrainExists) { - const float y = row * gridResolution.GetY() + worldSize.GetMin().GetY(); - for (int32_t col = 0; col < gridWidth; col++) - { - const float x = col * gridResolution.GetX() + worldSize.GetMin().GetX(); - float height = 0.0f; - - AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( - height, &AzFramework::Terrain::TerrainDataRequests::GetHeightFromFloats, x, y, - AzFramework::Terrain::TerrainDataRequests::Sampler::DEFAULT, nullptr); + heights.emplace_back(surfacePoint.m_position.GetZ() - worldCenterZ); + }; - heights.emplace_back(height - worldCenterZ); - } - } + AzFramework::Terrain::TerrainDataRequestBus::Broadcast(&AzFramework::Terrain::TerrainDataRequests::ProcessHeightsFromRegion, + worldSize, gridResolution, perPositionHeightCallback, AzFramework::Terrain::TerrainDataRequests::Sampler::DEFAULT); } uint8_t TerrainPhysicsColliderComponent::GetMaterialIdIndex(const Physics::MaterialId& materialId, const AZStd::vector& materialList) const @@ -350,42 +343,37 @@ namespace Terrain AZStd::vector materialList = GetMaterialList(); - for (int32_t row = 0; row < gridHeight; row++) + auto perPositionCallback = [&heightMaterials, &materialList, this, worldCenterZ, worldHeightBoundsMin, worldHeightBoundsMax] + (size_t xIndex, size_t yIndex, const AzFramework::SurfaceData::SurfacePoint& surfacePoint, bool terrainExists) { - const float y = row * gridResolution.GetY() + worldSize.GetMin().GetY(); - for (int32_t col = 0; col < gridWidth; col++) + float height = surfacePoint.m_position.GetZ(); + + // Any heights that fall outside the range of our bounding box will get turned into holes. + if ((height < worldHeightBoundsMin) || (height > worldHeightBoundsMax)) { - const float x = col * gridResolution.GetX() + worldSize.GetMin().GetX(); - float height = 0.0f; - - bool terrainExists = true; - AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( - height, &AzFramework::Terrain::TerrainDataRequests::GetHeightFromFloats, x, y, - AzFramework::Terrain::TerrainDataRequests::Sampler::DEFAULT, &terrainExists); - - // Any heights that fall outside the range of our bounding box will get turned into holes. - if ((height < worldHeightBoundsMin) || (height > worldHeightBoundsMax)) - { - height = worldHeightBoundsMin; - terrainExists = false; - } - - // Find the best surface tag at this point. - AzFramework::SurfaceData::SurfaceTagWeight surfaceWeight; - AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( - surfaceWeight, &AzFramework::Terrain::TerrainDataRequests::GetMaxSurfaceWeightFromFloats, x, y, - AzFramework::Terrain::TerrainDataRequests::Sampler::DEFAULT, nullptr); - - Physics::HeightMaterialPoint point; - point.m_height = height - worldCenterZ; - point.m_quadMeshType = terrainExists ? Physics::QuadMeshType::SubdivideUpperLeftToBottomRight : Physics::QuadMeshType::Hole; - - Physics::MaterialId materialId = FindMaterialIdForSurfaceTag(surfaceWeight.m_surfaceType); - point.m_materialIndex = GetMaterialIdIndex(materialId, materialList); - - heightMaterials.emplace_back(point); + height = worldHeightBoundsMin; + terrainExists = false; } - } + + // Find the best surface tag at this point. + // We want the MaxSurfaceWeight. The ProcessSurfacePoints callback has surface weights sorted. + // So, we pick the value at the front of the list. + AzFramework::SurfaceData::SurfaceTagWeight surfaceWeight; + if (!surfacePoint.m_surfaceTags.empty()) + { + surfaceWeight = *surfacePoint.m_surfaceTags.begin(); + } + + Physics::HeightMaterialPoint point; + point.m_height = height - worldCenterZ; + point.m_quadMeshType = terrainExists ? Physics::QuadMeshType::SubdivideUpperLeftToBottomRight : Physics::QuadMeshType::Hole; + Physics::MaterialId materialId = FindMaterialIdForSurfaceTag(surfaceWeight.m_surfaceType); + point.m_materialIndex = GetMaterialIdIndex(materialId, materialList); + heightMaterials.emplace_back(point); + }; + + AzFramework::Terrain::TerrainDataRequestBus::Broadcast(&AzFramework::Terrain::TerrainDataRequests::ProcessSurfacePointsFromRegion, + worldSize, gridResolution, perPositionCallback, AzFramework::Terrain::TerrainDataRequests::Sampler::DEFAULT); } AZ::Vector2 TerrainPhysicsColliderComponent::GetHeightfieldGridSpacing() const diff --git a/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.cpp b/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.cpp index f3e0d59537..46be621307 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.cpp +++ b/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.cpp @@ -354,44 +354,29 @@ namespace Terrain // For each terrain height value in the region, create the _| grid lines for that point and cache off the height value // for use with subsequent grid line calculations. auto ProcessHeightValue = [gridResolution, &previousHeight, &rowHeights, §or] - (uint32_t xIndex, uint32_t yIndex, const AZ::Vector3& position, [[maybe_unused]] bool terrainExists) + (uint32_t xIndex, uint32_t yIndex, const AzFramework::SurfaceData::SurfacePoint& surfacePoint, [[maybe_unused]] bool terrainExists) { // Don't add any vertices for the first column or first row. These grid lines will be handled by an adjacent sector, if // there is one. if ((xIndex > 0) && (yIndex > 0)) { - float x = position.GetX() - gridResolution.GetX(); - float y = position.GetY() - gridResolution.GetY(); + float x = surfacePoint.m_position.GetX() - gridResolution.GetX(); + float y = surfacePoint.m_position.GetY() - gridResolution.GetY(); - sector.m_lineVertices.emplace_back(AZ::Vector3(x, position.GetY(), previousHeight)); - sector.m_lineVertices.emplace_back(position); + sector.m_lineVertices.emplace_back(AZ::Vector3(x, surfacePoint.m_position.GetY(), previousHeight)); + sector.m_lineVertices.emplace_back(surfacePoint.m_position); - sector.m_lineVertices.emplace_back(AZ::Vector3(position.GetX(), y, rowHeights[xIndex])); - sector.m_lineVertices.emplace_back(position); + sector.m_lineVertices.emplace_back(AZ::Vector3(surfacePoint.m_position.GetX(), y, rowHeights[xIndex])); + sector.m_lineVertices.emplace_back(surfacePoint.m_position); } // Save off the heights so that we can use them to draw subsequent columns and rows. - previousHeight = position.GetZ(); - rowHeights[xIndex] = position.GetZ(); + previousHeight = surfacePoint.m_position.GetZ(); + rowHeights[xIndex] = surfacePoint.m_position.GetZ(); }; - // This set of nested loops will get replaced with a call to ProcessHeightsFromRegion once the API exists. - for (size_t yIndex = 0; yIndex < numSamplesY; yIndex++) - { - float y = region.GetMin().GetY() + (gridResolution.GetY() * yIndex); - for (size_t xIndex = 0; xIndex < numSamplesX; xIndex++) - { - float x = region.GetMin().GetX() + (gridResolution.GetX() * xIndex); - - float height = worldMinZ; - bool terrainExists = false; - AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( - height, &AzFramework::Terrain::TerrainDataRequests::GetHeightFromFloats, x, y, - AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT, &terrainExists); - ProcessHeightValue( - aznumeric_cast(xIndex), aznumeric_cast(yIndex), AZ::Vector3(x, y, height), terrainExists); - } - } + AzFramework::Terrain::TerrainDataRequestBus::Broadcast(&AzFramework::Terrain::TerrainDataRequests::ProcessHeightsFromRegion, + region, gridResolution, ProcessHeightValue, AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT); } void TerrainWorldDebuggerComponent::OnTerrainDataChanged(const AZ::Aabb& dirtyRegion, TerrainDataChangedMask dataChangedMask) From c778606c89e795ff885f5a732eaecd3b8946ba98 Mon Sep 17 00:00:00 2001 From: AMZN-byrcolin <68035668+byrcolin@users.noreply.github.com> Date: Fri, 14 Jan 2022 10:27:20 -0800 Subject: [PATCH 481/948] Templates restricted (#6498) * Templates/Restricted upgrade/fixes: Fixed template storage format: templates now only store true relative paths and no longer save "origin" paths and "optional" has been removed, it was never used. Upgraded all templates to new standard Template system now correctly handles child objects: Child objects no longer have to specify restricted they inherit from parent Restricted now operates at the object level and makes no assumptions about parent Restricted templates can now be combined and seperated on creation ly_get_list_relative_filename has been deprecated for o3de_pal_dir All Gems/Projects/Templates updated to use new code Signed-off-by: byrcolin --- AutomatedTesting/CMakeLists.txt | 1 - AutomatedTesting/Gem/CMakeLists.txt | 7 +- AutomatedTesting/Gem/Code/CMakeLists.txt | 2 +- .../Gem/PythonCoverage/CMakeLists.txt | 4 + .../Gem/PythonCoverage/Code/CMakeLists.txt | 2 +- AutomatedTesting/Gem/PythonCoverage/gem.json | 6 +- .../Gem/PythonTests/Blast/CMakeLists.txt | 2 +- .../Gem/PythonTests/CMakeLists.txt | 2 +- .../Gem/PythonTests/WhiteBox/CMakeLists.txt | 2 +- AutomatedTesting/Gem/Sponza/gem.json | 11 +- AutomatedTesting/Gem/gem.json | 14 +- AutomatedTesting/project.json | 9 +- CMakeLists.txt | 69 +- Code/Editor/CMakeLists.txt | 2 +- Code/Framework/AzCore/CMakeLists.txt | 10 +- Code/Framework/AzFramework/CMakeLists.txt | 12 +- Code/Framework/AzNetworking/CMakeLists.txt | 4 +- Code/Framework/AzQtComponents/CMakeLists.txt | 2 +- Code/Framework/AzTest/CMakeLists.txt | 8 +- Code/Framework/GridMate/CMakeLists.txt | 6 +- Code/LauncherUnified/CMakeLists.txt | 2 +- Code/LauncherUnified/launcher_generator.cmake | 2 +- Code/Legacy/CryCommon/CMakeLists.txt | 2 +- Code/Legacy/CrySystem/CMakeLists.txt | 2 +- Code/Tools/AWSNativeSDKInit/CMakeLists.txt | 4 +- .../AssetBuilderSDK/CMakeLists.txt | 2 +- Code/Tools/AzTestRunner/CMakeLists.txt | 2 +- Code/Tools/CrashHandler/CMakeLists.txt | 2 +- Code/Tools/LuaIDE/CMakeLists.txt | 4 +- .../ProjectManager/Source/PythonBindings.cpp | 2 +- Code/Tools/RemoteConsole/CMakeLists.txt | 2 +- Code/Tools/SceneAPI/SceneData/CMakeLists.txt | 2 +- Code/Tools/TestImpactFramework/CMakeLists.txt | 4 +- .../Runtime/Code/CMakeLists.txt | 4 +- Gems/AWSClientAuth/CMakeLists.txt | 4 + Gems/AWSClientAuth/Code/CMakeLists.txt | 2 +- Gems/AWSClientAuth/gem.json | 4 +- Gems/AWSCore/CMakeLists.txt | 4 + Gems/AWSCore/Code/CMakeLists.txt | 4 +- Gems/AWSCore/gem.json | 8 +- Gems/AWSGameLift/gem.json | 5 +- Gems/AWSMetrics/gem.json | 4 +- Gems/Achievements/CMakeLists.txt | 4 + Gems/Achievements/Code/CMakeLists.txt | 6 +- Gems/Achievements/gem.json | 1 + Gems/AssetValidation/gem.json | 1 + Gems/Atom/Asset/CMakeLists.txt | 10 - .../Asset/ImageProcessingAtom/CMakeLists.txt | 4 + .../ImageProcessingAtom/Code/CMakeLists.txt | 6 +- Gems/Atom/Asset/ImageProcessingAtom/gem.json | 2 + Gems/Atom/Asset/Shader/CMakeLists.txt | 4 + Gems/Atom/Asset/Shader/Code/CMakeLists.txt | 6 +- Gems/Atom/Asset/Shader/gem.json | 8 +- Gems/Atom/Bootstrap/CMakeLists.txt | 4 + Gems/Atom/Bootstrap/Code/CMakeLists.txt | 2 +- Gems/Atom/Bootstrap/gem.json | 2 + Gems/Atom/CMakeLists.txt | 10 +- Gems/Atom/Component/CMakeLists.txt | 9 - .../Atom/Component/DebugCamera/CMakeLists.txt | 4 + Gems/Atom/Component/DebugCamera/gem.json | 2 + Gems/Atom/Feature/CMakeLists.txt | 9 - Gems/Atom/Feature/Common/CMakeLists.txt | 4 + Gems/Atom/Feature/Common/Code/CMakeLists.txt | 4 +- Gems/Atom/Feature/Common/gem.json | 2 + Gems/Atom/RHI/CMakeLists.txt | 8 +- Gems/Atom/RHI/Code/CMakeLists.txt | 4 +- Gems/Atom/RHI/DX12/CMakeLists.txt | 4 + Gems/Atom/RHI/DX12/Code/CMakeLists.txt | 6 +- Gems/Atom/RHI/DX12/gem.json | 2 + Gems/Atom/RHI/Metal/CMakeLists.txt | 4 + Gems/Atom/RHI/Metal/Code/CMakeLists.txt | 4 +- Gems/Atom/RHI/Metal/gem.json | 2 + Gems/Atom/RHI/Null/CMakeLists.txt | 4 + Gems/Atom/RHI/Null/Code/CMakeLists.txt | 4 +- Gems/Atom/RHI/Null/gem.json | 2 + Gems/Atom/RHI/Vulkan/CMakeLists.txt | 4 + Gems/Atom/RHI/Vulkan/Code/CMakeLists.txt | 4 +- Gems/Atom/RHI/Vulkan/gem.json | 2 + Gems/Atom/RHI/gem.json | 7 + Gems/Atom/RPI/CMakeLists.txt | 4 + Gems/Atom/RPI/Code/CMakeLists.txt | 6 +- Gems/Atom/RPI/gem.json | 4 +- .../Tools/AtomToolsFramework/CMakeLists.txt | 4 + .../AtomToolsFramework/Code/CMakeLists.txt | 2 +- Gems/Atom/Tools/AtomToolsFramework/gem.json | 2 + Gems/Atom/Tools/CMakeLists.txt | 2 - Gems/Atom/Tools/MaterialEditor/CMakeLists.txt | 4 + .../Tools/MaterialEditor/Code/CMakeLists.txt | 2 +- Gems/Atom/Tools/MaterialEditor/gem.json | 2 + .../Code/CMakeLists.txt | 2 +- Gems/Atom/Utils/Code/CMakeLists.txt | 5 +- Gems/Atom/gem.json | 12 + Gems/AtomContent/CMakeLists.txt | 2 - Gems/AtomContent/ReferenceMaterials/gem.json | 10 +- Gems/AtomContent/Sponza/gem.json | 5 +- Gems/AtomContent/gem.json | 9 +- .../AtomBridge/CMakeLists.txt | 4 + .../AtomBridge/Code/CMakeLists.txt | 2 +- Gems/AtomLyIntegration/AtomBridge/gem.json | 2 + .../AtomLyIntegration/AtomFont/CMakeLists.txt | 4 + .../AtomFont/Code/CMakeLists.txt | 2 +- Gems/AtomLyIntegration/AtomFont/gem.json | 2 + .../AtomLyIntegration/AtomImGuiTools/gem.json | 2 + .../AtomViewportDisplayIcons/gem.json | 2 + .../AtomViewportDisplayInfo/gem.json | 2 + Gems/AtomLyIntegration/CMakeLists.txt | 9 - .../CommonFeatures/CMakeLists.txt | 4 + .../CommonFeatures/Code/CMakeLists.txt | 4 +- .../AtomLyIntegration/CommonFeatures/gem.json | 2 + Gems/AtomLyIntegration/EMotionFXAtom/gem.json | 2 + Gems/AtomLyIntegration/ImguiAtom/gem.json | 2 + .../TechnicalArt/CMakeLists.txt | 9 - .../DccScriptingInterface/CMakeLists.txt | 1 - .../DccScriptingInterface/gem.json | 4 +- Gems/AtomLyIntegration/gem.json | 12 + Gems/AtomTressFX/gem.json | 5 +- Gems/AudioEngineWwise/CMakeLists.txt | 4 + Gems/AudioEngineWwise/Code/CMakeLists.txt | 4 +- Gems/AudioEngineWwise/gem.json | 1 + Gems/AudioSystem/CMakeLists.txt | 4 + Gems/AudioSystem/Code/CMakeLists.txt | 4 +- Gems/AudioSystem/gem.json | 1 + Gems/BarrierInput/gem.json | 2 + Gems/Blast/CMakeLists.txt | 4 + Gems/Blast/Code/CMakeLists.txt | 2 +- Gems/Blast/gem.json | 1 + Gems/Camera/gem.json | 1 + Gems/CameraFramework/gem.json | 1 + Gems/CertificateManager/gem.json | 1 + Gems/CrashReporting/CMakeLists.txt | 4 + Gems/CrashReporting/Code/CMakeLists.txt | 2 +- Gems/CrashReporting/gem.json | 1 + Gems/CustomAssetExample/gem.json | 1 + Gems/DebugDraw/gem.json | 1 + Gems/DevTextures/gem.json | 1 + Gems/EMotionFX/CMakeLists.txt | 4 + Gems/EMotionFX/Code/CMakeLists.txt | 7 +- Gems/EMotionFX/gem.json | 1 + Gems/EditorPythonBindings/gem.json | 1 + Gems/ExpressionEvaluation/gem.json | 1 + Gems/FastNoise/gem.json | 1 + Gems/GameState/gem.json | 1 + Gems/GameStateSamples/CMakeLists.txt | 4 + Gems/GameStateSamples/Code/CMakeLists.txt | 2 +- Gems/GameStateSamples/gem.json | 1 + Gems/Gestures/gem.json | 1 + Gems/GradientSignal/gem.json | 1 + Gems/GraphCanvas/gem.json | 1 + Gems/GraphModel/gem.json | 1 + Gems/HttpRequestor/CMakeLists.txt | 4 + Gems/HttpRequestor/Code/CMakeLists.txt | 2 +- Gems/HttpRequestor/gem.json | 1 + Gems/ImGui/CMakeLists.txt | 4 + Gems/ImGui/Code/CMakeLists.txt | 2 +- Gems/ImGui/gem.json | 1 + Gems/InAppPurchases/CMakeLists.txt | 4 + Gems/InAppPurchases/Code/CMakeLists.txt | 2 +- Gems/InAppPurchases/gem.json | 1 + Gems/LandscapeCanvas/gem.json | 1 + Gems/LmbrCentral/CMakeLists.txt | 4 + Gems/LmbrCentral/Code/CMakeLists.txt | 4 +- Gems/LmbrCentral/gem.json | 1 + Gems/LocalUser/CMakeLists.txt | 4 + Gems/LocalUser/Code/CMakeLists.txt | 2 +- Gems/LocalUser/gem.json | 1 + Gems/LyShine/CMakeLists.txt | 4 + Gems/LyShine/Code/CMakeLists.txt | 4 +- Gems/LyShine/gem.json | 1 + Gems/LyShineExamples/gem.json | 1 + Gems/Maestro/gem.json | 1 + Gems/MessagePopup/gem.json | 1 + Gems/Metastream/CMakeLists.txt | 4 + Gems/Metastream/Code/CMakeLists.txt | 4 +- Gems/Metastream/gem.json | 1 + Gems/Microphone/CMakeLists.txt | 4 + Gems/Microphone/Code/CMakeLists.txt | 2 +- Gems/Microphone/gem.json | 1 + Gems/Multiplayer/CMakeLists.txt | 4 + Gems/Multiplayer/Code/CMakeLists.txt | 2 + Gems/Multiplayer/gem.json | 2 + Gems/MultiplayerCompression/gem.json | 1 + Gems/NvCloth/CMakeLists.txt | 4 + Gems/NvCloth/Code/CMakeLists.txt | 2 +- Gems/NvCloth/gem.json | 3 +- Gems/PhysX/CMakeLists.txt | 4 + Gems/PhysX/Code/CMakeLists.txt | 2 +- Gems/PhysXDebug/CMakeLists.txt | 4 + Gems/PhysXDebug/Code/CMakeLists.txt | 6 +- Gems/PhysXDebug/gem.json | 1 + Gems/Prefab/PrefabBuilder/gem.json | 1 + Gems/Presence/CMakeLists.txt | 4 + Gems/Presence/Code/CMakeLists.txt | 2 +- Gems/Presence/gem.json | 1 + Gems/PrimitiveAssets/gem.json | 1 + Gems/Profiler/gem.json | 1 + Gems/PythonAssetBuilder/gem.json | 1 + Gems/QtForPython/Code/CMakeLists.txt | 2 +- Gems/QtForPython/gem.json | 1 + Gems/SaveData/CMakeLists.txt | 4 + Gems/SaveData/Code/CMakeLists.txt | 2 +- Gems/SaveData/gem.json | 1 + Gems/SceneLoggingExample/gem.json | 1 + Gems/SceneProcessing/gem.json | 1 + Gems/ScriptCanvas/gem.json | 1 + Gems/ScriptCanvasDeveloper/gem.json | 1 + Gems/ScriptCanvasPhysics/gem.json | 1 + Gems/ScriptCanvasTesting/gem.json | 1 + Gems/ScriptEvents/gem.json | 1 + Gems/ScriptedEntityTweener/gem.json | 1 + Gems/SliceFavorites/gem.json | 5 + Gems/StartingPointCamera/gem.json | 1 + Gems/StartingPointInput/gem.json | 1 + Gems/StartingPointMovement/gem.json | 1 + Gems/SurfaceData/gem.json | 1 + Gems/Terrain/gem.json | 1 + Gems/TestAssetBuilder/gem.json | 1 + Gems/TextureAtlas/gem.json | 1 + Gems/TickBusOrderViewer/gem.json | 1 + Gems/Twitch/CMakeLists.txt | 4 + Gems/Twitch/Code/CMakeLists.txt | 4 +- Gems/Twitch/gem.json | 4 +- Gems/UiBasics/gem.json | 1 + Gems/Vegetation/gem.json | 1 + Gems/VideoPlaybackFramework/gem.json | 1 + Gems/VirtualGamepad/gem.json | 1 + Gems/WhiteBox/CMakeLists.txt | 4 + Gems/WhiteBox/Code/CMakeLists.txt | 4 +- Gems/WhiteBox/gem.json | 1 + Templates/AssetGem/Template/gem.json | 15 +- Templates/AssetGem/template.json | 32 +- Templates/CppToolGem/Template/gem.json | 15 +- Templates/CppToolGem/template.json | 262 ++---- Templates/DefaultGem/Template/CMakeLists.txt | 9 +- .../DefaultGem/Template/Code/CMakeLists.txt | 4 +- Templates/DefaultGem/Template/gem.json | 14 +- Templates/DefaultGem/template.json | 250 ++---- .../DefaultProject/Template/CMakeLists.txt | 1 - .../{Code => Gem}/${NameLower}_files.cmake | 0 .../${NameLower}_shared_files.cmake | 0 .../Template/Gem}/CMakeLists.txt | 11 +- .../Include/${Name}/${Name}Bus.h | 2 +- .../Android/${NameLower}_android_files.cmake | 0 .../${NameLower}_shared_android_files.cmake | 0 .../Platform/Android/PAL_android.cmake | 0 .../Linux/${NameLower}_linux_files.cmake | 0 .../${NameLower}_shared_linux_files.cmake | 0 .../Platform/Linux/PAL_linux.cmake | 0 .../Platform/Mac/${NameLower}_mac_files.cmake | 0 .../Mac/${NameLower}_shared_mac_files.cmake | 0 .../{Code => Gem}/Platform/Mac/PAL_mac.cmake | 0 .../${NameLower}_shared_windows_files.cmake | 0 .../Windows/${NameLower}_windows_files.cmake | 0 .../Platform/Windows/PAL_windows.cmake | 0 .../Platform/iOS/${NameLower}_ios_files.cmake | 0 .../iOS/${NameLower}_shared_ios_files.cmake | 0 .../{Code => Gem}/Platform/iOS/PAL_ios.cmake | 0 .../{Code => Gem}/Source/${Name}Module.cpp | 0 .../Source/${Name}SystemComponent.cpp | 2 +- .../Source/${Name}SystemComponent.h | 0 .../Template/{Code => Gem}/enabled_gems.cmake | 0 .../DefaultProject/Template/Gem/gem.json | 21 + .../DefaultProject/Template/project.json | 7 +- Templates/DefaultProject/template.json | 542 ++++-------- Templates/GemRepo/Template/gem.json | 22 +- Templates/GemRepo/template.json | 18 +- .../MinimalProject/Template/CMakeLists.txt | 1 - .../{Code => Gem}/${NameLower}_files.cmake | 0 .../${NameLower}_shared_files.cmake | 0 .../Template/Gem}/CMakeLists.txt | 11 +- .../Include/${Name}/${Name}Bus.h | 0 .../Android/${NameLower}_android_files.cmake | 0 .../${NameLower}_shared_android_files.cmake | 0 .../Platform/Android/PAL_android.cmake | 0 .../Linux/${NameLower}_linux_files.cmake | 0 .../${NameLower}_shared_linux_files.cmake | 0 .../Platform/Linux/PAL_linux.cmake | 0 .../Platform/Mac/${NameLower}_mac_files.cmake | 0 .../Mac/${NameLower}_shared_mac_files.cmake | 0 .../{Code => Gem}/Platform/Mac/PAL_mac.cmake | 0 .../${NameLower}_shared_windows_files.cmake | 0 .../Windows/${NameLower}_windows_files.cmake | 0 .../Platform/Windows/PAL_windows.cmake | 0 .../Platform/iOS/${NameLower}_ios_files.cmake | 0 .../iOS/${NameLower}_shared_ios_files.cmake | 0 .../{Code => Gem}/Platform/iOS/PAL_ios.cmake | 0 .../{Code => Gem}/Source/${Name}Module.cpp | 0 .../Source/${Name}SystemComponent.cpp | 0 .../Source/${Name}SystemComponent.h | 0 .../Template/{Code => Gem}/enabled_gems.cmake | 0 .../MinimalProject/Template/Gem/gem.json | 21 + .../Template/cmake/CompilerSettings.cmake | 4 +- .../Linux/CompilerSettings_linux.cmake | 4 +- .../MinimalProject/Template/project.json | 6 +- Templates/MinimalProject/template.json | 523 ++++------- Templates/PythonToolGem/Template/gem.json | 6 +- Templates/PythonToolGem/template.json | 162 ++-- cmake/3rdParty.cmake | 6 +- cmake/3rdParty/BuiltInPackages.cmake | 4 +- cmake/3rdPartyPackages.cmake | 3 +- cmake/Configurations.cmake | 2 +- cmake/FileUtil.cmake | 21 +- cmake/Install.cmake | 4 +- cmake/LYTestWrappers.cmake | 2 +- cmake/LYWrappers.cmake | 2 +- cmake/PAL.cmake | 323 +++++-- cmake/PALTools.cmake | 4 +- cmake/Packaging.cmake | 2 +- cmake/Projects.cmake | 22 +- cmake/RuntimeDependencies.cmake | 2 +- engine.json | 2 +- scripts/o3de/CMakeLists.txt | 2 +- scripts/o3de/o3de/disable_gem.py | 6 - scripts/o3de/o3de/download.py | 5 - scripts/o3de/o3de/enable_gem.py | 6 - scripts/o3de/o3de/engine_template.py | 831 ++++++++++-------- scripts/o3de/o3de/get_registration.py | 6 - scripts/o3de/o3de/manifest.py | 471 +++++----- scripts/o3de/o3de/print_registration.py | 135 +-- scripts/o3de/o3de/register.py | 7 +- scripts/o3de/tests/unit_test_enable_gem.py | 11 +- .../o3de/tests/unit_test_engine_template.py | 56 +- .../o3de/tests/unit_test_gem_properties.py | 9 +- scripts/o3de/tests/unit_test_manifest.py | 64 +- .../tests/unit_test_print_registration.py | 19 +- 324 files changed, 2357 insertions(+), 2434 deletions(-) delete mode 100644 Gems/Atom/Asset/CMakeLists.txt delete mode 100644 Gems/Atom/Component/CMakeLists.txt delete mode 100644 Gems/Atom/Feature/CMakeLists.txt delete mode 100644 Gems/AtomLyIntegration/TechnicalArt/CMakeLists.txt rename Templates/DefaultProject/Template/{Code => Gem}/${NameLower}_files.cmake (100%) rename Templates/DefaultProject/Template/{Code => Gem}/${NameLower}_shared_files.cmake (100%) rename Templates/{MinimalProject/Template/Code => DefaultProject/Template/Gem}/CMakeLists.txt (87%) rename Templates/DefaultProject/Template/{Code => Gem}/Include/${Name}/${Name}Bus.h (99%) rename Templates/DefaultProject/Template/{Code => Gem}/Platform/Android/${NameLower}_android_files.cmake (100%) rename Templates/DefaultProject/Template/{Code => Gem}/Platform/Android/${NameLower}_shared_android_files.cmake (100%) rename Templates/DefaultProject/Template/{Code => Gem}/Platform/Android/PAL_android.cmake (100%) rename Templates/DefaultProject/Template/{Code => Gem}/Platform/Linux/${NameLower}_linux_files.cmake (100%) rename Templates/DefaultProject/Template/{Code => Gem}/Platform/Linux/${NameLower}_shared_linux_files.cmake (100%) rename Templates/DefaultProject/Template/{Code => Gem}/Platform/Linux/PAL_linux.cmake (100%) rename Templates/DefaultProject/Template/{Code => Gem}/Platform/Mac/${NameLower}_mac_files.cmake (100%) rename Templates/DefaultProject/Template/{Code => Gem}/Platform/Mac/${NameLower}_shared_mac_files.cmake (100%) rename Templates/DefaultProject/Template/{Code => Gem}/Platform/Mac/PAL_mac.cmake (100%) rename Templates/DefaultProject/Template/{Code => Gem}/Platform/Windows/${NameLower}_shared_windows_files.cmake (100%) rename Templates/DefaultProject/Template/{Code => Gem}/Platform/Windows/${NameLower}_windows_files.cmake (100%) rename Templates/DefaultProject/Template/{Code => Gem}/Platform/Windows/PAL_windows.cmake (100%) rename Templates/DefaultProject/Template/{Code => Gem}/Platform/iOS/${NameLower}_ios_files.cmake (100%) rename Templates/DefaultProject/Template/{Code => Gem}/Platform/iOS/${NameLower}_shared_ios_files.cmake (100%) rename Templates/DefaultProject/Template/{Code => Gem}/Platform/iOS/PAL_ios.cmake (100%) rename Templates/DefaultProject/Template/{Code => Gem}/Source/${Name}Module.cpp (100%) rename Templates/DefaultProject/Template/{Code => Gem}/Source/${Name}SystemComponent.cpp (99%) rename Templates/DefaultProject/Template/{Code => Gem}/Source/${Name}SystemComponent.h (100%) rename Templates/DefaultProject/Template/{Code => Gem}/enabled_gems.cmake (100%) create mode 100644 Templates/DefaultProject/Template/Gem/gem.json rename Templates/MinimalProject/Template/{Code => Gem}/${NameLower}_files.cmake (100%) rename Templates/MinimalProject/Template/{Code => Gem}/${NameLower}_shared_files.cmake (100%) rename Templates/{DefaultProject/Template/Code => MinimalProject/Template/Gem}/CMakeLists.txt (87%) rename Templates/MinimalProject/Template/{Code => Gem}/Include/${Name}/${Name}Bus.h (100%) rename Templates/MinimalProject/Template/{Code => Gem}/Platform/Android/${NameLower}_android_files.cmake (100%) rename Templates/MinimalProject/Template/{Code => Gem}/Platform/Android/${NameLower}_shared_android_files.cmake (100%) rename Templates/MinimalProject/Template/{Code => Gem}/Platform/Android/PAL_android.cmake (100%) rename Templates/MinimalProject/Template/{Code => Gem}/Platform/Linux/${NameLower}_linux_files.cmake (100%) rename Templates/MinimalProject/Template/{Code => Gem}/Platform/Linux/${NameLower}_shared_linux_files.cmake (100%) rename Templates/MinimalProject/Template/{Code => Gem}/Platform/Linux/PAL_linux.cmake (100%) rename Templates/MinimalProject/Template/{Code => Gem}/Platform/Mac/${NameLower}_mac_files.cmake (100%) rename Templates/MinimalProject/Template/{Code => Gem}/Platform/Mac/${NameLower}_shared_mac_files.cmake (100%) rename Templates/MinimalProject/Template/{Code => Gem}/Platform/Mac/PAL_mac.cmake (100%) rename Templates/MinimalProject/Template/{Code => Gem}/Platform/Windows/${NameLower}_shared_windows_files.cmake (100%) rename Templates/MinimalProject/Template/{Code => Gem}/Platform/Windows/${NameLower}_windows_files.cmake (100%) rename Templates/MinimalProject/Template/{Code => Gem}/Platform/Windows/PAL_windows.cmake (100%) rename Templates/MinimalProject/Template/{Code => Gem}/Platform/iOS/${NameLower}_ios_files.cmake (100%) rename Templates/MinimalProject/Template/{Code => Gem}/Platform/iOS/${NameLower}_shared_ios_files.cmake (100%) rename Templates/MinimalProject/Template/{Code => Gem}/Platform/iOS/PAL_ios.cmake (100%) rename Templates/MinimalProject/Template/{Code => Gem}/Source/${Name}Module.cpp (100%) rename Templates/MinimalProject/Template/{Code => Gem}/Source/${Name}SystemComponent.cpp (100%) rename Templates/MinimalProject/Template/{Code => Gem}/Source/${Name}SystemComponent.h (100%) rename Templates/MinimalProject/Template/{Code => Gem}/enabled_gems.cmake (100%) create mode 100644 Templates/MinimalProject/Template/Gem/gem.json diff --git a/AutomatedTesting/CMakeLists.txt b/AutomatedTesting/CMakeLists.txt index 1c5382ba4b..9621c0accb 100644 --- a/AutomatedTesting/CMakeLists.txt +++ b/AutomatedTesting/CMakeLists.txt @@ -27,5 +27,4 @@ else() set_property(GLOBAL APPEND PROPERTY LY_PROJECTS_TARGET_NAME ${project_target_name}) - add_subdirectory(Gem) endif() \ No newline at end of file diff --git a/AutomatedTesting/Gem/CMakeLists.txt b/AutomatedTesting/Gem/CMakeLists.txt index 7a411544ec..e3d8a4087a 100644 --- a/AutomatedTesting/Gem/CMakeLists.txt +++ b/AutomatedTesting/Gem/CMakeLists.txt @@ -6,6 +6,9 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) -add_subdirectory(PythonTests) -add_subdirectory(PythonCoverage) +add_subdirectory(PythonTests) \ No newline at end of file diff --git a/AutomatedTesting/Gem/Code/CMakeLists.txt b/AutomatedTesting/Gem/Code/CMakeLists.txt index 8808507765..1a88d6e69a 100644 --- a/AutomatedTesting/Gem/Code/CMakeLists.txt +++ b/AutomatedTesting/Gem/Code/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) ly_add_target( NAME AutomatedTesting ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE} diff --git a/AutomatedTesting/Gem/PythonCoverage/CMakeLists.txt b/AutomatedTesting/Gem/PythonCoverage/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/AutomatedTesting/Gem/PythonCoverage/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonCoverage/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/AutomatedTesting/Gem/PythonCoverage/Code/CMakeLists.txt b/AutomatedTesting/Gem/PythonCoverage/Code/CMakeLists.txt index a865ccc49f..ea6db88c1c 100644 --- a/AutomatedTesting/Gem/PythonCoverage/Code/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonCoverage/Code/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${o3de_gem_restricted_path} ${o3de_gem_path} ${o3de_gem_name}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) include(${pal_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) if(PAL_TRAIT_PYTHONCOVERAGE_SUPPORTED) diff --git a/AutomatedTesting/Gem/PythonCoverage/gem.json b/AutomatedTesting/Gem/PythonCoverage/gem.json index b99ce0daad..681696d78e 100644 --- a/AutomatedTesting/Gem/PythonCoverage/gem.json +++ b/AutomatedTesting/Gem/PythonCoverage/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Tool", "summary": "A tool for generating gem coverage for Python tests.", "canonical_tags": [ @@ -13,5 +14,8 @@ "PythonCoverage" ], "icon_path": "preview.png", - "requirements": "" + "requirements": "", + "documentation_url": "", + "dependencies": [ + ] } diff --git a/AutomatedTesting/Gem/PythonTests/Blast/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/Blast/CMakeLists.txt index aea2562e0b..64effb5b4c 100644 --- a/AutomatedTesting/Gem/PythonTests/Blast/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/Blast/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) include(${pal_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) # for PAL_TRAIT_BLAST Traits diff --git a/AutomatedTesting/Gem/PythonTests/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/CMakeLists.txt index 800f347359..26c03e78c2 100644 --- a/AutomatedTesting/Gem/PythonTests/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/CMakeLists.txt @@ -10,7 +10,7 @@ # Automated Tests ################################################################################ -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) include(${pal_dir}/PAL_traits_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) diff --git a/AutomatedTesting/Gem/PythonTests/WhiteBox/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/WhiteBox/CMakeLists.txt index 733e8edf29..d4554ee84b 100644 --- a/AutomatedTesting/Gem/PythonTests/WhiteBox/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/WhiteBox/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) include(${pal_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) # for PAL_TRAIT_WHITEBOX Traits diff --git a/AutomatedTesting/Gem/Sponza/gem.json b/AutomatedTesting/Gem/Sponza/gem.json index 68749cd5f4..f36b22a805 100644 --- a/AutomatedTesting/Gem/Sponza/gem.json +++ b/AutomatedTesting/Gem/Sponza/gem.json @@ -4,14 +4,19 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Asset", "summary": "A standard test scene for Global Illumination (forked from crytek sponza scene)", "canonical_tags": [ - "Gem" + "Gem", + "Asset" ], "user_tags": [ - "Assets" + "Sponza" ], + "icon_path": "preview.png", "requirements": "", - "dependencies": [] + "documentation_url": "", + "dependencies": [ + ] } diff --git a/AutomatedTesting/Gem/gem.json b/AutomatedTesting/Gem/gem.json index df197df09d..90a0c8cb01 100644 --- a/AutomatedTesting/Gem/gem.json +++ b/AutomatedTesting/Gem/gem.json @@ -3,13 +3,21 @@ "display_name": "AutomatedTesting", "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", - "origin": "Amazon Web Services, Inc.", + "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "Project Gem for customizing the AutomatedTesting project functionality.", "canonical_tags": [ "Gem" ], - "user_tags": [], + "user_tags": [ + "AutomatedTesting" + ], "icon_path": "preview.png", - "requirements": "" + "requirements": "", + "documentation_url": "", + "dependencies": [], + "external_subdirectories": [ + "PythonCoverage" + ] } diff --git a/AutomatedTesting/project.json b/AutomatedTesting/project.json index fc14645d2b..5a4b303570 100644 --- a/AutomatedTesting/project.json +++ b/AutomatedTesting/project.json @@ -5,12 +5,15 @@ "modules": [], "project_id": "{D816AFAE-4BB7-4FEF-88F4-E2B786DCF29D}", "android_settings": { - "package_name": "com.lumberyard.yourgame", + "package_name": "org.o3de.automatedtesting", "version_number": 1, "version_name": "1.0.0", "orientation": "landscape" }, "engine": "o3de", "display_name": "AutomatedTesting", - "icon_path": "preview.png" -} + "icon_path": "preview.png", + "external_subdirectories": [ + "Gem" + ] +} \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index f61a9561e8..c81581fe0f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,21 +49,56 @@ include(cmake/O3DEJson.cmake) # Subdirectory processing ################################################################################ +# this function is building up the LY_EXTERNAL_SUBDIRS global property +function(add_engine_gem_json_external_subdirectories gem_path) + set(gem_json_path ${gem_path}/gem.json) + if(EXISTS ${gem_json_path}) + read_json_external_subdirs(gem_external_subdirs ${gem_path}/gem.json) + foreach(gem_external_subdir ${gem_external_subdirs}) + file(REAL_PATH ${gem_external_subdir} real_external_subdir BASE_DIRECTORY ${gem_path}) + set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS ${real_external_subdir}) + add_engine_gem_json_external_subdirectories(${real_external_subdir}) + endforeach() + endif() +endfunction() + function(add_engine_json_external_subdirectories) - read_json_external_subdirs(external_subdis ${LY_ROOT_FOLDER}/engine.json) - foreach(external_subdir ${external_subdis}) - file(REAL_PATH ${external_subdir} real_external_subdir BASE_DIRECTORY ${LY_ROOT_FOLDER}) - list(APPEND engine_external_subdirs ${real_external_subdir}) + read_json_external_subdirs(engine_external_subdirs ${LY_ROOT_FOLDER}/engine.json) + foreach(engine_external_subdir ${engine_external_subdirs}) + file(REAL_PATH ${engine_external_subdir} real_external_subdir BASE_DIRECTORY ${LY_ROOT_FOLDER}) + set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS ${real_external_subdir}) + add_engine_gem_json_external_subdirectories(${real_external_subdir}) endforeach() +endfunction() - set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS ${engine_external_subdirs}) +function(add_subdirectory_on_externalsubdirs) + get_property(external_subdirs GLOBAL PROPERTY LY_EXTERNAL_SUBDIRS) + list(APPEND LY_EXTERNAL_SUBDIRS ${external_subdirs}) + # Loop over the additional external subdirectories and invoke add_subdirectory on them + foreach(external_directory ${LY_EXTERNAL_SUBDIRS}) + # Hash the external_directory name and append it to the Binary Directory section of add_subdirectory + # This is to deal with potential situations where multiple external directories has the same last directory name + # For example if D:/Company1/RayTracingGem and F:/Company2/Path/RayTracingGem were both added as a subdirectory + file(REAL_PATH ${external_directory} full_directory_path) + string(SHA256 full_directory_hash ${full_directory_path}) + # Truncate the full_directory_hash down to 8 characters to avoid hitting the Windows 260 character path limit + # when the external subdirectory contains relative paths of significant length + string(SUBSTRING ${full_directory_hash} 0 8 full_directory_hash) + # Use the last directory as the suffix path to use for the Binary Directory + get_filename_component(directory_name ${external_directory} NAME) + add_subdirectory(${external_directory} ${CMAKE_BINARY_DIR}/External/${directory_name}-${full_directory_hash}) + endforeach() endfunction() # Add the projects first so the Launcher can find them include(cmake/Projects.cmake) if(NOT INSTALLED_ENGINE) - + # Add external subdirectories listed in the engine.json. LY_EXTERNAL_SUBDIRS is a cache variable so the user can add extra + # external subdirectories. This should go before adding the rest of the targets so the targets are availbe to the launcher. + add_engine_json_external_subdirectories() + add_subdirectory_on_externalsubdirs() + # Add the rest of the targets add_subdirectory(Assets) add_subdirectory(Code) @@ -73,31 +108,11 @@ if(NOT INSTALLED_ENGINE) add_subdirectory(Templates) add_subdirectory(Tools) - # Add external subdirectories listed in the engine.json. LY_EXTERNAL_SUBDIRS is a cache variable so the user can add extra - # external subdirectories - add_engine_json_external_subdirectories() else() ly_find_o3de_packages() + add_subdirectory_on_externalsubdirs() endif() -get_property(external_subdirs GLOBAL PROPERTY LY_EXTERNAL_SUBDIRS) -list(APPEND LY_EXTERNAL_SUBDIRS ${external_subdirs}) - -# Loop over the additional external subdirectories and invoke add_subdirectory on them -foreach(external_directory ${LY_EXTERNAL_SUBDIRS}) - # Hash the extenal_directory name and append it to the Binary Directory section of add_subdirectory - # This is to deal with potential situations where multiple external directories has the same last directory name - # For example if D:/Company1/RayTracingGem and F:/Company2/Path/RayTracingGem were both added as a subdirectory - file(REAL_PATH ${external_directory} full_directory_path) - string(SHA256 full_directory_hash ${full_directory_path}) - # Truncate the full_directory_hash down to 8 characters to avoid hitting the Windows 260 character path limit - # when the external subdirectory contains relative paths of significant length - string(SUBSTRING ${full_directory_hash} 0 8 full_directory_hash) - # Use the last directory as the suffix path to use for the Binary Directory - get_filename_component(directory_name ${external_directory} NAME) - add_subdirectory(${external_directory} ${CMAKE_BINARY_DIR}/External/${directory_name}-${full_directory_hash}) -endforeach() - ################################################################################ # Post-processing ################################################################################ diff --git a/Code/Editor/CMakeLists.txt b/Code/Editor/CMakeLists.txt index 3358b49dce..9d74f8e3a2 100644 --- a/Code/Editor/CMakeLists.txt +++ b/Code/Editor/CMakeLists.txt @@ -63,7 +63,7 @@ ly_add_target( set(pal_cmake_files "") foreach(enabled_platform ${LY_PAL_TOOLS_ENABLED}) string(TOLOWER ${enabled_platform} enabled_platform_lowercase) - ly_get_list_relative_pal_filename(pal_cmake_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${enabled_platform}) + o3de_pal_dir(pal_cmake_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${enabled_platform} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) list(APPEND pal_cmake_files ${pal_cmake_dir}/editor_lib_${enabled_platform_lowercase}_files.cmake) endforeach() diff --git a/Code/Framework/AzCore/CMakeLists.txt b/Code/Framework/AzCore/CMakeLists.txt index 838142f0df..01f4086a18 100644 --- a/Code/Framework/AzCore/CMakeLists.txt +++ b/Code/Framework/AzCore/CMakeLists.txt @@ -9,8 +9,8 @@ # TODO: would like to be able to build from this path, however, the whole setup is done at the workspace's root # we also dont want to drop cmake output files everywhere. -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) -ly_get_list_relative_pal_filename(common_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/Common) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) +set(common_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/Common) if(PAL_TRAIT_PROF_PIX_SUPPORTED) set(LY_PIX_ENABLED OFF CACHE BOOL "Enables PIX profiler integration.") @@ -110,15 +110,15 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) AZ::AzTest ) - ly_get_list_relative_pal_filename(pal_test_dir ${CMAKE_CURRENT_LIST_DIR}/Tests/Platform/${PAL_PLATFORM_NAME}) + o3de_pal_dir(pal_tests_dir ${CMAKE_CURRENT_LIST_DIR}/Tests/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) ly_add_target( NAME AzCore.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} NAMESPACE AZ FILES_CMAKE Tests/azcoretests_files.cmake - ${pal_test_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake + ${pal_tests_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake PLATFORM_INCLUDE_FILES - ${pal_test_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake + ${pal_tests_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake INCLUDE_DIRECTORIES PRIVATE Tests diff --git a/Code/Framework/AzFramework/CMakeLists.txt b/Code/Framework/AzFramework/CMakeLists.txt index 9f30d23a19..bd7af2724e 100644 --- a/Code/Framework/AzFramework/CMakeLists.txt +++ b/Code/Framework/AzFramework/CMakeLists.txt @@ -8,8 +8,8 @@ include(AzFramework/feature_options.cmake) -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) -ly_get_list_relative_pal_filename(common_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/Common) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) +set(common_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/Common) ly_add_target( NAME AzFramework STATIC @@ -44,7 +44,7 @@ ly_add_source_properties( if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) - ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Tests/Platform/${PAL_PLATFORM_NAME}) + o3de_pal_dir(test_pal_dir ${CMAKE_CURRENT_LIST_DIR}/Tests/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) ly_add_target( NAME AzFrameworkTestShared STATIC @@ -86,11 +86,11 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) NAMESPACE AZ FILES_CMAKE Tests/frameworktests_files.cmake - ${pal_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake + ${test_pal_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake INCLUDE_DIRECTORIES PRIVATE Tests - ${pal_dir} + ${test_pal_dir} BUILD_DEPENDENCIES PRIVATE AZ::AzFramework @@ -104,7 +104,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) NAME AZ::AzFramework.Tests ) - include(${pal_dir}/platform_specific_test_targets.cmake) + include(${test_pal_dir}/platform_specific_test_targets.cmake) endif() diff --git a/Code/Framework/AzNetworking/CMakeLists.txt b/Code/Framework/AzNetworking/CMakeLists.txt index a0a3871201..ba2eecd023 100644 --- a/Code/Framework/AzNetworking/CMakeLists.txt +++ b/Code/Framework/AzNetworking/CMakeLists.txt @@ -6,8 +6,8 @@ # # -ly_get_list_relative_pal_filename(common_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/Common) -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) +set(common_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/Common) ly_add_target( NAME AzNetworking STATIC diff --git a/Code/Framework/AzQtComponents/CMakeLists.txt b/Code/Framework/AzQtComponents/CMakeLists.txt index a24b68bcd7..76850e196b 100644 --- a/Code/Framework/AzQtComponents/CMakeLists.txt +++ b/Code/Framework/AzQtComponents/CMakeLists.txt @@ -10,7 +10,7 @@ if(NOT PAL_TRAIT_BUILD_HOST_TOOLS) return() endif() -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) ly_add_target( NAME AzQtComponents SHARED diff --git a/Code/Framework/AzTest/CMakeLists.txt b/Code/Framework/AzTest/CMakeLists.txt index 95e444a1e9..2edc80f893 100644 --- a/Code/Framework/AzTest/CMakeLists.txt +++ b/Code/Framework/AzTest/CMakeLists.txt @@ -7,18 +7,18 @@ # if(NOT LY_MONOLITHIC_GAME) - ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/AzTest/Platform/${PAL_PLATFORM_NAME}) + o3de_pal_dir(pal_aztest_dir ${CMAKE_CURRENT_LIST_DIR}/AzTest/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) ly_add_target( NAME AzTest STATIC NAMESPACE AZ FILES_CMAKE AzTest/aztest_files.cmake - ${pal_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake + ${pal_aztest_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake INCLUDE_DIRECTORIES PUBLIC . - ${pal_dir} + ${pal_aztest_dir} BUILD_DEPENDENCIES PUBLIC 3rdParty::googletest::GMock @@ -26,6 +26,6 @@ if(NOT LY_MONOLITHIC_GAME) 3rdParty::GoogleBenchmark AZ::AzCore PLATFORM_INCLUDE_FILES - ${pal_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake + ${pal_aztest_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake ) endif() diff --git a/Code/Framework/GridMate/CMakeLists.txt b/Code/Framework/GridMate/CMakeLists.txt index 0da878081d..07c2f8b4a8 100644 --- a/Code/Framework/GridMate/CMakeLists.txt +++ b/Code/Framework/GridMate/CMakeLists.txt @@ -6,8 +6,8 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) -ly_get_list_relative_pal_filename(common_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/Common) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) +set(common_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/Common) ly_add_target( NAME GridMate STATIC @@ -41,7 +41,7 @@ ly_add_source_properties( ################################################################################ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) - ly_get_list_relative_pal_filename(pal_test_dir ${CMAKE_CURRENT_LIST_DIR}/Tests/Platform/${PAL_PLATFORM_NAME}) + o3de_pal_dir(pal_test_dir ${CMAKE_CURRENT_LIST_DIR}/Tests/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) ly_add_target( NAME GridMate.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} NAMESPACE AZ diff --git a/Code/LauncherUnified/CMakeLists.txt b/Code/LauncherUnified/CMakeLists.txt index 845c2cd6c7..8097570462 100644 --- a/Code/LauncherUnified/CMakeLists.txt +++ b/Code/LauncherUnified/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) include(${pal_dir}/LauncherUnified_traits_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) diff --git a/Code/LauncherUnified/launcher_generator.cmake b/Code/LauncherUnified/launcher_generator.cmake index 550a67bc49..70bcf776af 100644 --- a/Code/LauncherUnified/launcher_generator.cmake +++ b/Code/LauncherUnified/launcher_generator.cmake @@ -201,7 +201,7 @@ function(ly_delayed_generate_static_modules_inl) foreach(game_gem_dependency ${all_game_gem_dependencies}) # Sometimes, a gem's Client variant may be an interface library - # which dependes on multiple gem targets. The interface libraries + # which depends on multiple gem targets. The interface libraries # should be skipped; the real dependencies of the interface will be processed if(TARGET ${game_gem_dependency}) get_target_property(target_type ${game_gem_dependency} TYPE) diff --git a/Code/Legacy/CryCommon/CMakeLists.txt b/Code/Legacy/CryCommon/CMakeLists.txt index 1556c6a099..629f26d217 100644 --- a/Code/Legacy/CryCommon/CMakeLists.txt +++ b/Code/Legacy/CryCommon/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) ly_add_target( NAME CryCommon STATIC diff --git a/Code/Legacy/CrySystem/CMakeLists.txt b/Code/Legacy/CrySystem/CMakeLists.txt index ebfc866f4a..3153205b69 100644 --- a/Code/Legacy/CrySystem/CMakeLists.txt +++ b/Code/Legacy/CrySystem/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) add_subdirectory(XML) diff --git a/Code/Tools/AWSNativeSDKInit/CMakeLists.txt b/Code/Tools/AWSNativeSDKInit/CMakeLists.txt index 57ee31d30d..04f61eb924 100644 --- a/Code/Tools/AWSNativeSDKInit/CMakeLists.txt +++ b/Code/Tools/AWSNativeSDKInit/CMakeLists.txt @@ -6,14 +6,14 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/source/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) ly_add_target( NAME AWSNativeSDKInit STATIC NAMESPACE AZ FILES_CMAKE aws_native_sdk_init_files.cmake - ${pal_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake + ${pal_source_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake INCLUDE_DIRECTORIES PUBLIC include diff --git a/Code/Tools/AssetProcessor/AssetBuilderSDK/CMakeLists.txt b/Code/Tools/AssetProcessor/AssetBuilderSDK/CMakeLists.txt index bfbcc35663..f32d55844e 100644 --- a/Code/Tools/AssetProcessor/AssetBuilderSDK/CMakeLists.txt +++ b/Code/Tools/AssetProcessor/AssetBuilderSDK/CMakeLists.txt @@ -11,7 +11,7 @@ ly_get_pal_tool_dirs(pal_tool_dirs ${CMAKE_CURRENT_LIST_DIR}/AssetBuilderSDK/Pla set(pal_files "") foreach(enabled_platform ${LY_PAL_TOOLS_ENABLED}) string(TOLOWER ${enabled_platform} enabled_platform_lowercase) - ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/AssetBuilderSDK/Platform/${enabled_platform}) + o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/AssetBuilderSDK/Platform/${enabled_platform} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) list(APPEND pal_files ${pal_dir}/assetbuildersdk_${enabled_platform_lowercase}_files.cmake) endforeach() diff --git a/Code/Tools/AzTestRunner/CMakeLists.txt b/Code/Tools/AzTestRunner/CMakeLists.txt index 5f3bb829a8..2bd74fa1a1 100644 --- a/Code/Tools/AzTestRunner/CMakeLists.txt +++ b/Code/Tools/AzTestRunner/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) include(${pal_dir}/platform_traits_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) diff --git a/Code/Tools/CrashHandler/CMakeLists.txt b/Code/Tools/CrashHandler/CMakeLists.txt index 259a7d2891..db50741326 100644 --- a/Code/Tools/CrashHandler/CMakeLists.txt +++ b/Code/Tools/CrashHandler/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) include(${pal_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) diff --git a/Code/Tools/LuaIDE/CMakeLists.txt b/Code/Tools/LuaIDE/CMakeLists.txt index 98c8d7f04b..58e0fe505a 100644 --- a/Code/Tools/LuaIDE/CMakeLists.txt +++ b/Code/Tools/LuaIDE/CMakeLists.txt @@ -10,6 +10,8 @@ if(NOT PAL_TRAIT_BUILD_HOST_TOOLS) return() endif() +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) + ly_add_target( NAME LuaIDE APPLICATION NAMESPACE AZ @@ -18,7 +20,7 @@ ly_add_target( AUTORCC FILES_CMAKE lua_ide_files.cmake - Platform/${PAL_PLATFORM_NAME}/lua_ide_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake + ${pal_dir}/lua_ide_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake INCLUDE_DIRECTORIES PRIVATE . diff --git a/Code/Tools/ProjectManager/Source/PythonBindings.cpp b/Code/Tools/ProjectManager/Source/PythonBindings.cpp index 35bdfe0031..7c436a3a70 100644 --- a/Code/Tools/ProjectManager/Source/PythonBindings.cpp +++ b/Code/Tools/ProjectManager/Source/PythonBindings.cpp @@ -1221,7 +1221,7 @@ namespace O3DE::ProjectManager auto result = ExecuteWithLockErrorHandling( [&] { - for (auto repoUri : m_manifest.attr("get_repos")()) + for (auto repoUri : m_manifest.attr("get_manifest_repos")()) { gemRepos.push_back(GetGemRepoInfo(repoUri)); } diff --git a/Code/Tools/RemoteConsole/CMakeLists.txt b/Code/Tools/RemoteConsole/CMakeLists.txt index d2685b2aea..b9a08650b6 100644 --- a/Code/Tools/RemoteConsole/CMakeLists.txt +++ b/Code/Tools/RemoteConsole/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) ly_add_target( NAME RemoteConsoleCore STATIC diff --git a/Code/Tools/SceneAPI/SceneData/CMakeLists.txt b/Code/Tools/SceneAPI/SceneData/CMakeLists.txt index 5507ada2b9..0d4ef4a5df 100644 --- a/Code/Tools/SceneAPI/SceneData/CMakeLists.txt +++ b/Code/Tools/SceneAPI/SceneData/CMakeLists.txt @@ -10,7 +10,7 @@ if (NOT PAL_TRAIT_BUILD_HOST_TOOLS) return() endif() -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) ly_add_target( NAME SceneData SHARED diff --git a/Code/Tools/TestImpactFramework/CMakeLists.txt b/Code/Tools/TestImpactFramework/CMakeLists.txt index 1cdf02d101..15d93b1a70 100644 --- a/Code/Tools/TestImpactFramework/CMakeLists.txt +++ b/Code/Tools/TestImpactFramework/CMakeLists.txt @@ -6,9 +6,9 @@ # # -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) -include(${pal_source_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) +include(${pal_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) if(PAL_TRAIT_TEST_IMPACT_FRAMEWORK_SUPPORTED) add_subdirectory(Runtime) diff --git a/Code/Tools/TestImpactFramework/Runtime/Code/CMakeLists.txt b/Code/Tools/TestImpactFramework/Runtime/Code/CMakeLists.txt index 0b8432642a..f3262a26af 100644 --- a/Code/Tools/TestImpactFramework/Runtime/Code/CMakeLists.txt +++ b/Code/Tools/TestImpactFramework/Runtime/Code/CMakeLists.txt @@ -6,8 +6,8 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) -ly_get_list_relative_pal_filename(common_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) +set(common_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) ly_add_target( NAME TestImpact.Runtime.Static STATIC diff --git a/Gems/AWSClientAuth/CMakeLists.txt b/Gems/AWSClientAuth/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/AWSClientAuth/CMakeLists.txt +++ b/Gems/AWSClientAuth/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/AWSClientAuth/Code/CMakeLists.txt b/Gems/AWSClientAuth/Code/CMakeLists.txt index 1f0c119f5a..ac9d221f07 100644 --- a/Gems/AWSClientAuth/Code/CMakeLists.txt +++ b/Gems/AWSClientAuth/Code/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) ly_add_target( NAME AWSClientAuth.Static STATIC diff --git a/Gems/AWSClientAuth/gem.json b/Gems/AWSClientAuth/gem.json index 9c7188f103..d6729cee99 100644 --- a/Gems/AWSClientAuth/gem.json +++ b/Gems/AWSClientAuth/gem.json @@ -3,7 +3,8 @@ "display_name": "AWS Client Authorization", "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", - "origin": "Amazon Web Services, Inc.", + "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "AWS Client Auth provides client authentication and AWS authorization solution.", "canonical_tags": [ @@ -15,6 +16,7 @@ "SDK" ], "icon_path": "preview.png", + "requirements": "", "documentation_url": "https://o3de.org/docs/user-guide/gems/reference/aws/aws-client-auth/", "dependencies": [ "AWSCore", diff --git a/Gems/AWSCore/CMakeLists.txt b/Gems/AWSCore/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/AWSCore/CMakeLists.txt +++ b/Gems/AWSCore/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/AWSCore/Code/CMakeLists.txt b/Gems/AWSCore/Code/CMakeLists.txt index 877696e26c..3911aefce6 100644 --- a/Gems/AWSCore/Code/CMakeLists.txt +++ b/Gems/AWSCore/Code/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) ly_add_target( NAME AWSCore.Static STATIC @@ -61,7 +61,7 @@ ly_create_alias( if (PAL_TRAIT_BUILD_HOST_TOOLS) - include(${CMAKE_CURRENT_SOURCE_DIR}/Platform/${PAL_PLATFORM_NAME}/PAL_traits_editor_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) + include(${pal_dir}/PAL_traits_editor_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) ly_add_target( NAME AWSCore.Editor.Static STATIC diff --git a/Gems/AWSCore/gem.json b/Gems/AWSCore/gem.json index 3bced07e8d..3bc8e6f77c 100644 --- a/Gems/AWSCore/gem.json +++ b/Gems/AWSCore/gem.json @@ -3,7 +3,8 @@ "display_name": "AWS Core", "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", - "origin": "Amazon Web Services, Inc.", + "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The AWS Core Gem provides basic shared AWS functionality such as AWS SDK initialization and client configuration, and is automatically added when selecting any AWS feature Gem.", "canonical_tags": [ @@ -15,5 +16,8 @@ "SDK" ], "icon_path": "preview.png", - "documentation_url": "https://o3de.org/docs/user-guide/gems/reference/aws/aws-core/" + "requirements": "", + "documentation_url": "https://o3de.org/docs/user-guide/gems/reference/aws/aws-core/", + "dependencies": [ + ] } diff --git a/Gems/AWSGameLift/gem.json b/Gems/AWSGameLift/gem.json index 1ac65c4526..e1b80cb9fe 100644 --- a/Gems/AWSGameLift/gem.json +++ b/Gems/AWSGameLift/gem.json @@ -3,7 +3,8 @@ "display_name": "AWS GameLift", "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", - "origin": "Amazon Web Services, Inc.", + "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The AWS GameLift Gem provides a framework to extend O3DE networking layer to work with GameLift resources via GameLift server and client SDK.", "canonical_tags": [ @@ -12,7 +13,7 @@ "user_tags": [ "AWS", "Framework", - "Network", + "Network", "SDK" ], "icon_path": "preview.png", diff --git a/Gems/AWSMetrics/gem.json b/Gems/AWSMetrics/gem.json index 054c3624c4..bd462edec3 100644 --- a/Gems/AWSMetrics/gem.json +++ b/Gems/AWSMetrics/gem.json @@ -3,7 +3,8 @@ "display_name": "AWS Metrics", "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", - "origin": "Amazon Web Services, Inc.", + "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The AWS Metrics Gem provides a solution for AWS metrics submission and analytics.", "canonical_tags": [ @@ -15,6 +16,7 @@ "SDK" ], "icon_path": "preview.png", + "requirements": "", "documentation_url": "https://o3de.org/docs/user-guide/gems/reference/aws/aws-metrics/", "dependencies": [ "AWSCore" diff --git a/Gems/Achievements/CMakeLists.txt b/Gems/Achievements/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/Achievements/CMakeLists.txt +++ b/Gems/Achievements/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/Achievements/Code/CMakeLists.txt b/Gems/Achievements/Code/CMakeLists.txt index 2d00ac2fb2..5ac43e9736 100644 --- a/Gems/Achievements/Code/CMakeLists.txt +++ b/Gems/Achievements/Code/CMakeLists.txt @@ -6,16 +6,16 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_SOURCE_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) ly_add_target( NAME Achievements.Static STATIC NAMESPACE Gem PLATFORM_INCLUDE_FILES - ${pal_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake + ${pal_source_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake FILES_CMAKE achievements_files.cmake - ${pal_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake + ${pal_source_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake INCLUDE_DIRECTORIES PUBLIC Include diff --git a/Gems/Achievements/gem.json b/Gems/Achievements/gem.json index 8180584500..5fc83aefe2 100644 --- a/Gems/Achievements/gem.json +++ b/Gems/Achievements/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Achievements Gem provides a target platform agnostic interface for retrieving achievement details and unlocking achievements.", "canonical_tags": [ diff --git a/Gems/AssetValidation/gem.json b/Gems/AssetValidation/gem.json index 55cdffb9f3..de1d36ffb4 100644 --- a/Gems/AssetValidation/gem.json +++ b/Gems/AssetValidation/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Asset Validation Gem provides seed-related commands to ensure assets have valid seeds for asset bundling.", "canonical_tags": [ diff --git a/Gems/Atom/Asset/CMakeLists.txt b/Gems/Atom/Asset/CMakeLists.txt deleted file mode 100644 index 3ed20148a2..0000000000 --- a/Gems/Atom/Asset/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -# -# Copyright (c) Contributors to the Open 3D Engine Project. -# For complete copyright and license terms please see the LICENSE at the root of this distribution. -# -# SPDX-License-Identifier: Apache-2.0 OR MIT -# -# - -add_subdirectory(ImageProcessingAtom) -add_subdirectory(Shader) diff --git a/Gems/Atom/Asset/ImageProcessingAtom/CMakeLists.txt b/Gems/Atom/Asset/ImageProcessingAtom/CMakeLists.txt index 54543a000a..92079d35be 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/CMakeLists.txt +++ b/Gems/Atom/Asset/ImageProcessingAtom/CMakeLists.txt @@ -7,4 +7,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/CMakeLists.txt b/Gems/Atom/Asset/ImageProcessingAtom/Code/CMakeLists.txt index 982ec43715..74876994f6 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/CMakeLists.txt +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/CMakeLists.txt @@ -26,15 +26,15 @@ set(pal_tools_include_dirs) foreach(enabled_platform ${LY_PAL_TOOLS_ENABLED}) string(TOLOWER ${enabled_platform} enabled_platform_lowercase) - ly_get_list_relative_pal_filename(pal_tools_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${enabled_platform}) + o3de_pal_dir(pal_tools_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${enabled_platform} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) list(APPEND pal_tools_include_dirs ${pal_tools_source_dir}) list(APPEND platform_tools_files ${pal_tools_source_dir}/pal_tools_${enabled_platform_lowercase}.cmake) list(APPEND pal_tools_include_files ${pal_tools_source_dir}/pal_tools_${enabled_platform_lowercase}_files.cmake) endforeach() -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) -ly_get_list_relative_pal_filename(common_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) +set(common_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) ly_add_target( NAME ImageProcessingAtom.Editor.Static STATIC diff --git a/Gems/Atom/Asset/ImageProcessingAtom/gem.json b/Gems/Atom/Asset/ImageProcessingAtom/gem.json index 4fd437d298..c2af4b7e7e 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/gem.json +++ b/Gems/Atom/Asset/ImageProcessingAtom/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "", "canonical_tags": [ @@ -11,6 +12,7 @@ ], "user_tags": [], "requirements": "", + "documentation_url": "", "dependencies": [ "Atom_RPI", "Atom_RHI", diff --git a/Gems/Atom/Asset/Shader/CMakeLists.txt b/Gems/Atom/Asset/Shader/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/Atom/Asset/Shader/CMakeLists.txt +++ b/Gems/Atom/Asset/Shader/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/Atom/Asset/Shader/Code/CMakeLists.txt b/Gems/Atom/Asset/Shader/Code/CMakeLists.txt index ed5aa45bbf..9ebd5e6d2d 100644 --- a/Gems/Atom/Asset/Shader/Code/CMakeLists.txt +++ b/Gems/Atom/Asset/Shader/Code/CMakeLists.txt @@ -10,8 +10,8 @@ if(NOT PAL_TRAIT_BUILD_HOST_TOOLS) return() endif() -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) -ly_get_list_relative_pal_filename(common_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) +set(common_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) include(${pal_source_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) #for PAL_TRAIT_BUILD_ATOM_ASSET_SHADER_SUPPORTED @@ -71,7 +71,7 @@ ly_add_target( set(builder_tools_include_files) foreach(enabled_platform ${LY_PAL_TOOLS_ENABLED}) string(TOLOWER ${enabled_platform} enabled_platform_lowercase) - ly_get_list_relative_pal_filename(builder_tools_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${enabled_platform}) + o3de_pal_dir(builder_tools_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${enabled_platform} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) list(APPEND builder_tools_include_files ${builder_tools_source_dir}/platform_builders_${enabled_platform_lowercase}.cmake) endforeach() diff --git a/Gems/Atom/Asset/Shader/gem.json b/Gems/Atom/Asset/Shader/gem.json index 9f59c65f78..8b4ba4fb0d 100644 --- a/Gems/Atom/Asset/Shader/gem.json +++ b/Gems/Atom/Asset/Shader/gem.json @@ -4,13 +4,17 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", - "summary": "", + "summary": "Atom Shader Builder", "canonical_tags": [ "Gem" ], - "user_tags": [], + "user_tags": [ + "AtomShader" + ], "requirements": "", + "documentation_url": "", "dependencies": [ "Atom_RHI", "Atom_RPI" diff --git a/Gems/Atom/Bootstrap/CMakeLists.txt b/Gems/Atom/Bootstrap/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/Atom/Bootstrap/CMakeLists.txt +++ b/Gems/Atom/Bootstrap/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/Atom/Bootstrap/Code/CMakeLists.txt b/Gems/Atom/Bootstrap/Code/CMakeLists.txt index fd9df96124..0ba8d17865 100644 --- a/Gems/Atom/Bootstrap/Code/CMakeLists.txt +++ b/Gems/Atom/Bootstrap/Code/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) ly_add_target( NAME Atom_Bootstrap.Headers HEADERONLY diff --git a/Gems/Atom/Bootstrap/gem.json b/Gems/Atom/Bootstrap/gem.json index df615366da..543efe0f34 100644 --- a/Gems/Atom/Bootstrap/gem.json +++ b/Gems/Atom/Bootstrap/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "", "canonical_tags": [ @@ -11,6 +12,7 @@ ], "user_tags": [], "requirements": "", + "documentation_url": "", "dependencies": [ "Atom_RPI" ] diff --git a/Gems/Atom/CMakeLists.txt b/Gems/Atom/CMakeLists.txt index a71afa64e0..b5dd311e5a 100644 --- a/Gems/Atom/CMakeLists.txt +++ b/Gems/Atom/CMakeLists.txt @@ -6,12 +6,10 @@ # # -add_subdirectory(Asset) -add_subdirectory(Bootstrap) -add_subdirectory(Component) -add_subdirectory(Feature) -add_subdirectory(RHI) -add_subdirectory(RPI) +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Tools) add_subdirectory(Utils) diff --git a/Gems/Atom/Component/CMakeLists.txt b/Gems/Atom/Component/CMakeLists.txt deleted file mode 100644 index 8b867b8c67..0000000000 --- a/Gems/Atom/Component/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright (c) Contributors to the Open 3D Engine Project. -# For complete copyright and license terms please see the LICENSE at the root of this distribution. -# -# SPDX-License-Identifier: Apache-2.0 OR MIT -# -# - -add_subdirectory(DebugCamera) diff --git a/Gems/Atom/Component/DebugCamera/CMakeLists.txt b/Gems/Atom/Component/DebugCamera/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/Atom/Component/DebugCamera/CMakeLists.txt +++ b/Gems/Atom/Component/DebugCamera/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/Atom/Component/DebugCamera/gem.json b/Gems/Atom/Component/DebugCamera/gem.json index 8eab74f41d..74d88a21b6 100644 --- a/Gems/Atom/Component/DebugCamera/gem.json +++ b/Gems/Atom/Component/DebugCamera/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "", "canonical_tags": [ @@ -11,6 +12,7 @@ ], "user_tags": [], "requirements": "", + "documentation_url": "", "dependencies": [ "Atom_RPI" ] diff --git a/Gems/Atom/Feature/CMakeLists.txt b/Gems/Atom/Feature/CMakeLists.txt deleted file mode 100644 index 32d654d5c4..0000000000 --- a/Gems/Atom/Feature/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright (c) Contributors to the Open 3D Engine Project. -# For complete copyright and license terms please see the LICENSE at the root of this distribution. -# -# SPDX-License-Identifier: Apache-2.0 OR MIT -# -# - -add_subdirectory(Common) diff --git a/Gems/Atom/Feature/Common/CMakeLists.txt b/Gems/Atom/Feature/Common/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/Atom/Feature/Common/CMakeLists.txt +++ b/Gems/Atom/Feature/Common/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/Atom/Feature/Common/Code/CMakeLists.txt b/Gems/Atom/Feature/Common/Code/CMakeLists.txt index db9ac8560f..a832c46539 100644 --- a/Gems/Atom/Feature/Common/Code/CMakeLists.txt +++ b/Gems/Atom/Feature/Common/Code/CMakeLists.txt @@ -6,8 +6,8 @@ # # -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) -ly_get_list_relative_pal_filename(common_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) +set(common_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) ly_add_target( NAME Atom_Feature_Common.Static STATIC diff --git a/Gems/Atom/Feature/Common/gem.json b/Gems/Atom/Feature/Common/gem.json index 84ab07a9f9..f4c936dc4a 100644 --- a/Gems/Atom/Feature/Common/gem.json +++ b/Gems/Atom/Feature/Common/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "", "canonical_tags": [ @@ -11,6 +12,7 @@ ], "user_tags": [], "requirements": "", + "documentation_url": "", "dependencies": [ "Atom_RPI", "Atom", diff --git a/Gems/Atom/RHI/CMakeLists.txt b/Gems/Atom/RHI/CMakeLists.txt index 074f6acfd7..5812828c1a 100644 --- a/Gems/Atom/RHI/CMakeLists.txt +++ b/Gems/Atom/RHI/CMakeLists.txt @@ -6,10 +6,10 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + ly_add_external_target_path(${CMAKE_CURRENT_LIST_DIR}/3rdParty) add_subdirectory(Code) -add_subdirectory(DX12) -add_subdirectory(Metal) -add_subdirectory(Vulkan) -add_subdirectory(Null) diff --git a/Gems/Atom/RHI/Code/CMakeLists.txt b/Gems/Atom/RHI/Code/CMakeLists.txt index 5238985feb..fe9db107a8 100644 --- a/Gems/Atom/RHI/Code/CMakeLists.txt +++ b/Gems/Atom/RHI/Code/CMakeLists.txt @@ -6,8 +6,8 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) include(${pal_dir}/AtomRHITests_traits_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) diff --git a/Gems/Atom/RHI/DX12/CMakeLists.txt b/Gems/Atom/RHI/DX12/CMakeLists.txt index 51912a5ff0..5812828c1a 100644 --- a/Gems/Atom/RHI/DX12/CMakeLists.txt +++ b/Gems/Atom/RHI/DX12/CMakeLists.txt @@ -6,6 +6,10 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + ly_add_external_target_path(${CMAKE_CURRENT_LIST_DIR}/3rdParty) add_subdirectory(Code) diff --git a/Gems/Atom/RHI/DX12/Code/CMakeLists.txt b/Gems/Atom/RHI/DX12/Code/CMakeLists.txt index 975b838ffa..95118c60a7 100644 --- a/Gems/Atom/RHI/DX12/Code/CMakeLists.txt +++ b/Gems/Atom/RHI/DX12/Code/CMakeLists.txt @@ -6,8 +6,8 @@ # # -ly_get_list_relative_pal_filename(pal_include_dir ${CMAKE_CURRENT_LIST_DIR}/Include/Platform/${PAL_PLATFORM_NAME}) -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_include_dir ${CMAKE_CURRENT_LIST_DIR}/Include/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) include(${pal_source_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) # PAL_TRAIT_ATOM_RHI_DX12_SUPPORTED @@ -23,7 +23,7 @@ set(pal_builder_tools_files) set(pal_builder_tools_includes) foreach(enabled_platform ${LY_PAL_TOOLS_ENABLED}) string(TOLOWER ${enabled_platform} enabled_platform_lowercase) - ly_get_list_relative_pal_filename(pal_builder_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${enabled_platform}) + o3de_pal_dir(pal_builder_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${enabled_platform} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) list(APPEND pal_builder_tools_includes ${pal_builder_source_dir}) list(APPEND pal_builder_tools_files ${pal_builder_source_dir}/platform_builders_${enabled_platform_lowercase}_tools_files.cmake) endforeach() diff --git a/Gems/Atom/RHI/DX12/gem.json b/Gems/Atom/RHI/DX12/gem.json index 868acd43db..803ae4f4d0 100644 --- a/Gems/Atom/RHI/DX12/gem.json +++ b/Gems/Atom/RHI/DX12/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "", "canonical_tags": [ @@ -11,6 +12,7 @@ ], "user_tags": [], "requirements": "", + "documentation_url": "", "dependencies": [ "Atom_RHI" ] diff --git a/Gems/Atom/RHI/Metal/CMakeLists.txt b/Gems/Atom/RHI/Metal/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/Atom/RHI/Metal/CMakeLists.txt +++ b/Gems/Atom/RHI/Metal/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/Atom/RHI/Metal/Code/CMakeLists.txt b/Gems/Atom/RHI/Metal/Code/CMakeLists.txt index 11876e0a30..3df00a30e0 100644 --- a/Gems/Atom/RHI/Metal/Code/CMakeLists.txt +++ b/Gems/Atom/RHI/Metal/Code/CMakeLists.txt @@ -6,8 +6,8 @@ # # -ly_get_list_relative_pal_filename(pal_include_dir ${CMAKE_CURRENT_LIST_DIR}/Include/Platform/${PAL_PLATFORM_NAME}) -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_include_dir ${CMAKE_CURRENT_LIST_DIR}/Include/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) include(${pal_source_dir}/PAL2_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) diff --git a/Gems/Atom/RHI/Metal/gem.json b/Gems/Atom/RHI/Metal/gem.json index 6e983ba505..0257048bd3 100644 --- a/Gems/Atom/RHI/Metal/gem.json +++ b/Gems/Atom/RHI/Metal/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "", "canonical_tags": [ @@ -11,6 +12,7 @@ ], "user_tags": [], "requirements": "", + "documentation_url": "", "dependencies": [ "Atom_RHI" ] diff --git a/Gems/Atom/RHI/Null/CMakeLists.txt b/Gems/Atom/RHI/Null/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/Atom/RHI/Null/CMakeLists.txt +++ b/Gems/Atom/RHI/Null/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/Atom/RHI/Null/Code/CMakeLists.txt b/Gems/Atom/RHI/Null/Code/CMakeLists.txt index 71df9f696f..081edd4c44 100644 --- a/Gems/Atom/RHI/Null/Code/CMakeLists.txt +++ b/Gems/Atom/RHI/Null/Code/CMakeLists.txt @@ -6,8 +6,8 @@ # # -ly_get_list_relative_pal_filename(pal_include_dir ${CMAKE_CURRENT_LIST_DIR}/Include/Platform/${PAL_PLATFORM_NAME}) -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_include_dir ${CMAKE_CURRENT_LIST_DIR}/Include/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) ly_add_target( diff --git a/Gems/Atom/RHI/Null/gem.json b/Gems/Atom/RHI/Null/gem.json index e9f22c5fcb..1ea2eb4cb0 100644 --- a/Gems/Atom/RHI/Null/gem.json +++ b/Gems/Atom/RHI/Null/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "", "canonical_tags": [ @@ -11,6 +12,7 @@ ], "user_tags": [], "requirements": "", + "documentation_url": "", "dependencies": [ "Atom_RHI" ] diff --git a/Gems/Atom/RHI/Vulkan/CMakeLists.txt b/Gems/Atom/RHI/Vulkan/CMakeLists.txt index 51912a5ff0..5812828c1a 100644 --- a/Gems/Atom/RHI/Vulkan/CMakeLists.txt +++ b/Gems/Atom/RHI/Vulkan/CMakeLists.txt @@ -6,6 +6,10 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + ly_add_external_target_path(${CMAKE_CURRENT_LIST_DIR}/3rdParty) add_subdirectory(Code) diff --git a/Gems/Atom/RHI/Vulkan/Code/CMakeLists.txt b/Gems/Atom/RHI/Vulkan/Code/CMakeLists.txt index fb13d1fddb..674e5aff9e 100644 --- a/Gems/Atom/RHI/Vulkan/Code/CMakeLists.txt +++ b/Gems/Atom/RHI/Vulkan/Code/CMakeLists.txt @@ -6,8 +6,8 @@ # # -ly_get_list_relative_pal_filename(pal_include_dir ${CMAKE_CURRENT_LIST_DIR}/Include/Platform/${PAL_PLATFORM_NAME}) -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_include_dir ${CMAKE_CURRENT_LIST_DIR}/Include/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) include(${pal_source_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) # PAL_TRAIT_ATOM_RHI_VULKAN_SUPPORTED / PAL_TRAIT_ATOM_RHI_VULKAN_TARGETS_ALREADY_DEFINED diff --git a/Gems/Atom/RHI/Vulkan/gem.json b/Gems/Atom/RHI/Vulkan/gem.json index 1dfeb9eafa..508ad85c75 100644 --- a/Gems/Atom/RHI/Vulkan/gem.json +++ b/Gems/Atom/RHI/Vulkan/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "", "canonical_tags": [ @@ -11,6 +12,7 @@ ], "user_tags": [], "requirements": "", + "documentation_url": "", "dependencies": [ "Atom_RHI" ] diff --git a/Gems/Atom/RHI/gem.json b/Gems/Atom/RHI/gem.json index de46c312ad..858a64fc17 100644 --- a/Gems/Atom/RHI/gem.json +++ b/Gems/Atom/RHI/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "", "canonical_tags": [ @@ -11,6 +12,12 @@ ], "user_tags": [], "requirements": "", + "external_subdirectories": [ + "DX12", + "Metal", + "Null", + "Vulkan" + ], "dependencies": [ "Atom_RHI_DX12", "Atom_RHI_Metal", diff --git a/Gems/Atom/RPI/CMakeLists.txt b/Gems/Atom/RPI/CMakeLists.txt index 6d148328ec..2c2cee5804 100644 --- a/Gems/Atom/RPI/CMakeLists.txt +++ b/Gems/Atom/RPI/CMakeLists.txt @@ -6,6 +6,10 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) add_subdirectory(Tools) diff --git a/Gems/Atom/RPI/Code/CMakeLists.txt b/Gems/Atom/RPI/Code/CMakeLists.txt index f0459a23c2..dcdad13c10 100644 --- a/Gems/Atom/RPI/Code/CMakeLists.txt +++ b/Gems/Atom/RPI/Code/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) #for PAL_TRAIT_BUILD_ATOM_RPI_ASSETS_SUPPORTED and PAL_TRAIT_BUILD_ATOM_RPI_MASKED_OCCLUSION_CULLING_SUPPORTED include(${pal_source_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) @@ -176,8 +176,8 @@ endif() if(PAL_TRAIT_BUILD_HOST_TOOLS) - ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) - ly_get_list_relative_pal_filename(common_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) + o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) + set(common_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) if(NOT PAL_TRAIT_BUILD_ATOM_RPI_ASSETS_SUPPORTED) diff --git a/Gems/Atom/RPI/gem.json b/Gems/Atom/RPI/gem.json index 885f150508..0acef5179b 100644 --- a/Gems/Atom/RPI/gem.json +++ b/Gems/Atom/RPI/gem.json @@ -1,16 +1,18 @@ { "gem_name": "Atom_RPI", "display_name": "Atom API", - "summary": "", "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", + "summary": "", "canonical_tags": [ "Gem" ], "user_tags": [], "requirements": "", + "documentation_url": "", "dependencies": [ "Atom_RHI" ] diff --git a/Gems/Atom/Tools/AtomToolsFramework/CMakeLists.txt b/Gems/Atom/Tools/AtomToolsFramework/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/CMakeLists.txt +++ b/Gems/Atom/Tools/AtomToolsFramework/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/CMakeLists.txt b/Gems/Atom/Tools/AtomToolsFramework/Code/CMakeLists.txt index e7e8208722..0fc896e88a 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/CMakeLists.txt +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/CMakeLists.txt @@ -10,7 +10,7 @@ if(NOT PAL_TRAIT_BUILD_HOST_TOOLS) return() endif() -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) ly_add_target( NAME AtomToolsFramework.Static STATIC diff --git a/Gems/Atom/Tools/AtomToolsFramework/gem.json b/Gems/Atom/Tools/AtomToolsFramework/gem.json index de2a9e06f2..6e5a7b311a 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/gem.json +++ b/Gems/Atom/Tools/AtomToolsFramework/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "", "canonical_tags": [ @@ -11,6 +12,7 @@ ], "user_tags": [], "requirements": "", + "documentation_url": "", "dependencies": [ "Atom_RPI", "Atom_RHI", diff --git a/Gems/Atom/Tools/CMakeLists.txt b/Gems/Atom/Tools/CMakeLists.txt index 653babd0b3..82a803bdef 100644 --- a/Gems/Atom/Tools/CMakeLists.txt +++ b/Gems/Atom/Tools/CMakeLists.txt @@ -6,6 +6,4 @@ # # -add_subdirectory(AtomToolsFramework) -add_subdirectory(MaterialEditor) add_subdirectory(ShaderManagementConsole) diff --git a/Gems/Atom/Tools/MaterialEditor/CMakeLists.txt b/Gems/Atom/Tools/MaterialEditor/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/Atom/Tools/MaterialEditor/CMakeLists.txt +++ b/Gems/Atom/Tools/MaterialEditor/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/Atom/Tools/MaterialEditor/Code/CMakeLists.txt b/Gems/Atom/Tools/MaterialEditor/Code/CMakeLists.txt index 99beb721d6..1d9295f9b3 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/CMakeLists.txt +++ b/Gems/Atom/Tools/MaterialEditor/Code/CMakeLists.txt @@ -10,7 +10,7 @@ if(NOT PAL_TRAIT_BUILD_HOST_TOOLS) return() endif() -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) include(${pal_source_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) # PAL_TRAIT_ATOM_MATERIAL_EDITOR_APPLICATION_SUPPORTED diff --git a/Gems/Atom/Tools/MaterialEditor/gem.json b/Gems/Atom/Tools/MaterialEditor/gem.json index 807e3fa65f..463553c27d 100644 --- a/Gems/Atom/Tools/MaterialEditor/gem.json +++ b/Gems/Atom/Tools/MaterialEditor/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Tool", "summary": "Editor for creating, modifying, and previewing materials", "canonical_tags": [ @@ -11,6 +12,7 @@ ], "user_tags": [], "requirements": "", + "documentation_url": "", "dependencies": [ "AtomToolsFramework", "Atom_RPI", diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/CMakeLists.txt b/Gems/Atom/Tools/ShaderManagementConsole/Code/CMakeLists.txt index d384378b09..3f7788418a 100644 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/CMakeLists.txt +++ b/Gems/Atom/Tools/ShaderManagementConsole/Code/CMakeLists.txt @@ -10,7 +10,7 @@ if(NOT PAL_TRAIT_BUILD_HOST_TOOLS) return() endif() -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) include(${pal_source_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) # PAL_TRAIT_ATOM_SHADER_MANAGEMENT_CONSOLE_APPLICATION_SUPPORTED diff --git a/Gems/Atom/Utils/Code/CMakeLists.txt b/Gems/Atom/Utils/Code/CMakeLists.txt index 90d7ce501b..a657262f2d 100644 --- a/Gems/Atom/Utils/Code/CMakeLists.txt +++ b/Gems/Atom/Utils/Code/CMakeLists.txt @@ -6,8 +6,6 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) - ly_add_target( NAME Atom_Utils.Static STATIC NAMESPACE Gem @@ -52,6 +50,9 @@ endif() # Tests ################################################################################ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) + + o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) + ly_add_target( NAME Atom_Utils.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} NAMESPACE Gem diff --git a/Gems/Atom/gem.json b/Gems/Atom/gem.json index 0f409ad993..ee6a617ee7 100644 --- a/Gems/Atom/gem.json +++ b/Gems/Atom/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Atom Renderer Gem provides Atom Renderer and its associated tools (such as Material Editor), utilites, libraries, and interfaces.", "canonical_tags": [ @@ -15,6 +16,17 @@ ], "requirements": "", "documentation_url": "https://o3de.org/docs/user-guide/gems/reference/rendering/atom/atom/", + "external_subdirectories": [ + "Asset/ImageProcessingAtom", + "Asset/Shader", + "Bootstrap", + "Component/DebugCamera", + "Feature/Common", + "RHI", + "RPI", + "Tools/AtomToolsFramework", + "Tools/MaterialEditor" + ], "dependencies": [ "Atom_Feature_Common", "AtomShader", diff --git a/Gems/AtomContent/CMakeLists.txt b/Gems/AtomContent/CMakeLists.txt index ee06f07bc3..29477608b9 100644 --- a/Gems/AtomContent/CMakeLists.txt +++ b/Gems/AtomContent/CMakeLists.txt @@ -5,8 +5,6 @@ # SPDX-License-Identifier: Apache-2.0 OR MIT # # -add_subdirectory(ReferenceMaterials) -add_subdirectory(Sponza) if(PAL_TRAIT_BUILD_HOST_TOOLS) ly_create_alias(NAME AtomContent.Builders NAMESPACE Gem TARGETS Gem::AtomContent_ReferenceMaterials.Builders Gem::AtomContent_Sponza.Builders) diff --git a/Gems/AtomContent/ReferenceMaterials/gem.json b/Gems/AtomContent/ReferenceMaterials/gem.json index b75b01e1ae..49a488b9d3 100644 --- a/Gems/AtomContent/ReferenceMaterials/gem.json +++ b/Gems/AtomContent/ReferenceMaterials/gem.json @@ -2,7 +2,9 @@ "gem_name": "ReferenceMaterials", "display_name": "PBR Reference Materials", "license": "Code, text, data files: Apache-2.0 Or MIT, assets/content/images: CC BY 4.0", - "origin": "https://github.com/aws-lumberyard-dev/o3de.git", + "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", + "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Asset", "summary": "Atom Asset Gem with a library of reference materials for StandardPBR (and others in the future)", "canonical_tags": [ @@ -14,6 +16,8 @@ "Materials" ], "icon_path": "preview.png", - "dependencies": [], - "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt" + "requirements": "", + "documentation_url": "", + "dependencies": [ + ] } diff --git a/Gems/AtomContent/Sponza/gem.json b/Gems/AtomContent/Sponza/gem.json index 68749cd5f4..f15d57a4d1 100644 --- a/Gems/AtomContent/Sponza/gem.json +++ b/Gems/AtomContent/Sponza/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Asset", "summary": "A standard test scene for Global Illumination (forked from crytek sponza scene)", "canonical_tags": [ @@ -13,5 +14,7 @@ "Assets" ], "requirements": "", - "dependencies": [] + "documentation_url": "", + "dependencies": [ + ] } diff --git a/Gems/AtomContent/gem.json b/Gems/AtomContent/gem.json index 400e897a3b..9be15f7da8 100644 --- a/Gems/AtomContent/gem.json +++ b/Gems/AtomContent/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Asset", "summary": "The Atom Content Gem provides assets for Atom Renderer and a modified version of the Pixar Look Development Studio.", "canonical_tags": [ @@ -17,7 +18,11 @@ "requirements": "", "documentation_url": "https://o3de.org/docs/user-guide/gems/reference/rendering/atom/atom-content/", "dependencies": [ - "ReferenceMaterials", - "Sponza" + "Sponza", + "ReferenceMaterials" + ], + "external_subdirectories": [ + "Sponza", + "ReferenceMaterials" ] } diff --git a/Gems/AtomLyIntegration/AtomBridge/CMakeLists.txt b/Gems/AtomLyIntegration/AtomBridge/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/AtomLyIntegration/AtomBridge/CMakeLists.txt +++ b/Gems/AtomLyIntegration/AtomBridge/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/AtomLyIntegration/AtomBridge/Code/CMakeLists.txt b/Gems/AtomLyIntegration/AtomBridge/Code/CMakeLists.txt index 67f28767e0..fa3669d7c2 100644 --- a/Gems/AtomLyIntegration/AtomBridge/Code/CMakeLists.txt +++ b/Gems/AtomLyIntegration/AtomBridge/Code/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) ly_add_target( NAME Atom_AtomBridge.Static STATIC diff --git a/Gems/AtomLyIntegration/AtomBridge/gem.json b/Gems/AtomLyIntegration/AtomBridge/gem.json index e8ca413023..5a8512c90d 100644 --- a/Gems/AtomLyIntegration/AtomBridge/gem.json +++ b/Gems/AtomLyIntegration/AtomBridge/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "", "canonical_tags": [ @@ -11,6 +12,7 @@ ], "user_tags": [], "requirements": "", + "documentation_url": "", "dependencies": [ "Atom_RPI", "Atom_Bootstrap", diff --git a/Gems/AtomLyIntegration/AtomFont/CMakeLists.txt b/Gems/AtomLyIntegration/AtomFont/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/AtomLyIntegration/AtomFont/CMakeLists.txt +++ b/Gems/AtomLyIntegration/AtomFont/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/AtomLyIntegration/AtomFont/Code/CMakeLists.txt b/Gems/AtomLyIntegration/AtomFont/Code/CMakeLists.txt index 6567736f02..79d97e797d 100644 --- a/Gems/AtomLyIntegration/AtomFont/Code/CMakeLists.txt +++ b/Gems/AtomLyIntegration/AtomFont/Code/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) ly_add_target( NAME AtomFont ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE} diff --git a/Gems/AtomLyIntegration/AtomFont/gem.json b/Gems/AtomLyIntegration/AtomFont/gem.json index 8907ec0979..d979509059 100644 --- a/Gems/AtomLyIntegration/AtomFont/gem.json +++ b/Gems/AtomLyIntegration/AtomFont/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "", "canonical_tags": [ @@ -11,6 +12,7 @@ ], "user_tags": [], "requirements": "", + "documentation_url": "", "dependencies": [ "Atom_RHI", "Atom_RPI", diff --git a/Gems/AtomLyIntegration/AtomImGuiTools/gem.json b/Gems/AtomLyIntegration/AtomImGuiTools/gem.json index e188ba0cb8..205120f6f0 100644 --- a/Gems/AtomLyIntegration/AtomImGuiTools/gem.json +++ b/Gems/AtomLyIntegration/AtomImGuiTools/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Tool", "summary": "", "canonical_tags": [ @@ -14,6 +15,7 @@ "Rendering" ], "requirements": "", + "documentation_url": "", "dependencies": [ "ImguiAtom", "Atom" diff --git a/Gems/AtomLyIntegration/AtomViewportDisplayIcons/gem.json b/Gems/AtomLyIntegration/AtomViewportDisplayIcons/gem.json index 5a0763e0da..cff957c1f1 100644 --- a/Gems/AtomLyIntegration/AtomViewportDisplayIcons/gem.json +++ b/Gems/AtomLyIntegration/AtomViewportDisplayIcons/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "", "canonical_tags": [ @@ -11,6 +12,7 @@ ], "user_tags": [], "requirements": "", + "documentation_url": "", "dependencies": [ "Atom_RHI", "Atom_RPI", diff --git a/Gems/AtomLyIntegration/AtomViewportDisplayInfo/gem.json b/Gems/AtomLyIntegration/AtomViewportDisplayInfo/gem.json index 639d93d301..a2bc92c76d 100644 --- a/Gems/AtomLyIntegration/AtomViewportDisplayInfo/gem.json +++ b/Gems/AtomLyIntegration/AtomViewportDisplayInfo/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "", "canonical_tags": [ @@ -11,6 +12,7 @@ ], "user_tags": [], "requirements": "", + "documentation_url": "", "dependencies": [ "Atom_RHI", "Atom_RPI" diff --git a/Gems/AtomLyIntegration/CMakeLists.txt b/Gems/AtomLyIntegration/CMakeLists.txt index 4ab976d68f..25d7356b01 100644 --- a/Gems/AtomLyIntegration/CMakeLists.txt +++ b/Gems/AtomLyIntegration/CMakeLists.txt @@ -6,13 +6,4 @@ # # -add_subdirectory(CommonFeatures) -add_subdirectory(ImguiAtom) -add_subdirectory(AtomImGuiTools) -add_subdirectory(EMotionFXAtom) -add_subdirectory(AtomFont) -add_subdirectory(TechnicalArt) -add_subdirectory(AtomBridge) -add_subdirectory(AtomViewportDisplayInfo) -add_subdirectory(AtomViewportDisplayIcons) diff --git a/Gems/AtomLyIntegration/CommonFeatures/CMakeLists.txt b/Gems/AtomLyIntegration/CommonFeatures/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/CMakeLists.txt +++ b/Gems/AtomLyIntegration/CommonFeatures/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/CMakeLists.txt b/Gems/AtomLyIntegration/CommonFeatures/Code/CMakeLists.txt index 7b685ece13..3234db2292 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/CMakeLists.txt +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/CMakeLists.txt @@ -6,8 +6,8 @@ # # -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) -ly_get_list_relative_pal_filename(common_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) +set(common_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) ly_add_target( NAME AtomLyIntegration_CommonFeatures.Public HEADERONLY diff --git a/Gems/AtomLyIntegration/CommonFeatures/gem.json b/Gems/AtomLyIntegration/CommonFeatures/gem.json index 6fa8938332..a06f607fab 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/gem.json +++ b/Gems/AtomLyIntegration/CommonFeatures/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "", "canonical_tags": [ @@ -11,6 +12,7 @@ ], "user_tags": [], "requirements": "", + "documentation_url": "", "dependencies": [ "Atom_Feature_Common", "LmbrCentral", diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/gem.json b/Gems/AtomLyIntegration/EMotionFXAtom/gem.json index 3514d4c1b9..8bea93da91 100644 --- a/Gems/AtomLyIntegration/EMotionFXAtom/gem.json +++ b/Gems/AtomLyIntegration/EMotionFXAtom/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "", "canonical_tags": [ @@ -11,6 +12,7 @@ ], "user_tags": [], "requirements": "", + "documentation_url": "", "dependencies": [ "EMotionFX", "Atom", diff --git a/Gems/AtomLyIntegration/ImguiAtom/gem.json b/Gems/AtomLyIntegration/ImguiAtom/gem.json index fa611d8224..4c65d80e33 100644 --- a/Gems/AtomLyIntegration/ImguiAtom/gem.json +++ b/Gems/AtomLyIntegration/ImguiAtom/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "", "canonical_tags": [ @@ -11,6 +12,7 @@ ], "user_tags": [], "requirements": "", + "documentation_url": "", "dependencies": [ "ImGui", "Atom_Feature_Common" diff --git a/Gems/AtomLyIntegration/TechnicalArt/CMakeLists.txt b/Gems/AtomLyIntegration/TechnicalArt/CMakeLists.txt deleted file mode 100644 index 4fc1e5241d..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright (c) Contributors to the Open 3D Engine Project. -# For complete copyright and license terms please see the LICENSE at the root of this distribution. -# -# SPDX-License-Identifier: Apache-2.0 OR MIT -# -# - -add_subdirectory(DccScriptingInterface) diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/CMakeLists.txt b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/CMakeLists.txt index 5780172755..f26d18b90e 100644 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/CMakeLists.txt +++ b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/CMakeLists.txt @@ -6,5 +6,4 @@ # # -add_subdirectory(Code) update_pip_requirements(${CMAKE_CURRENT_LIST_DIR}/requirements.txt DccScriptingInterface) diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/gem.json b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/gem.json index 4cc6fff169..7786a8adf4 100644 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/gem.json +++ b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/gem.json @@ -1,11 +1,12 @@ { "gem_name": "DccScriptingInterface", "display_name": "Atom DccScriptingInterface (DCCsi)", - "summary": "A python framework for working with various DCC tools and workflows.", "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", + "summary": "A python framework for working with various DCC tools and workflows.", "canonical_tags": [ "Gem" ], @@ -16,5 +17,6 @@ "Creation" ], "requirements": "", + "documentation_url": "", "dependencies": [] } diff --git a/Gems/AtomLyIntegration/gem.json b/Gems/AtomLyIntegration/gem.json index d9e526aee0..c491126269 100644 --- a/Gems/AtomLyIntegration/gem.json +++ b/Gems/AtomLyIntegration/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Atom O3DE Integration Gem provides components, libraries, and functionality to support and integrate Atom Renderer in Open 3D Engine.", "canonical_tags": [ @@ -25,5 +26,16 @@ "CommonFeaturesAtom", "EMotionFX_Atom", "ImguiAtom" + ], + "external_subdirectories": [ + "AtomBridge", + "AtomFont", + "AtomImGuiTools", + "AtomViewportDisplayIcons", + "AtomViewportDisplayInfo", + "CommonFeatures", + "EMotionFXAtom", + "ImguiAtom", + "TechnicalArt/DccScriptingInterface" ] } diff --git a/Gems/AtomTressFX/gem.json b/Gems/AtomTressFX/gem.json index b7588ea374..1bd619a418 100644 --- a/Gems/AtomTressFX/gem.json +++ b/Gems/AtomTressFX/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "Atom TressFX Gem provides a cutting edge hair and fur simulation and rendering in Atom enhancing the AMD TressFX 4.1. The open source TressFX can be found here: https://github.com/GPUOpen-Effects/TressFX", "canonical_tags": [ @@ -15,5 +16,7 @@ "Animation" ], "requirements": "", - "documentation_url": "https://o3de.org/docs/user-guide/gems/reference/rendering/amd/atom-tressfx/" + "documentation_url": "https://o3de.org/docs/user-guide/gems/reference/rendering/amd/atom-tressfx/", + "dependencies": [ + ] } diff --git a/Gems/AudioEngineWwise/CMakeLists.txt b/Gems/AudioEngineWwise/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/AudioEngineWwise/CMakeLists.txt +++ b/Gems/AudioEngineWwise/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/AudioEngineWwise/Code/CMakeLists.txt b/Gems/AudioEngineWwise/Code/CMakeLists.txt index 33c80bc31c..02d4f1e6c8 100644 --- a/Gems/AudioEngineWwise/Code/CMakeLists.txt +++ b/Gems/AudioEngineWwise/Code/CMakeLists.txt @@ -6,8 +6,8 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) -ly_get_list_relative_pal_filename(common_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/Common) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) +set(common_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/Common) include(${pal_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) #for PAL_TRAIT_AUDIO_ENGINE_WWISE Traits diff --git a/Gems/AudioEngineWwise/gem.json b/Gems/AudioEngineWwise/gem.json index 2b0af30d40..f0d8c73be2 100644 --- a/Gems/AudioEngineWwise/gem.json +++ b/Gems/AudioEngineWwise/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Wwise Audio Engine Gem provides support for Audiokinetic Wave Works Interactive Sound Engine (Wwise).", "canonical_tags": [ diff --git a/Gems/AudioSystem/CMakeLists.txt b/Gems/AudioSystem/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/AudioSystem/CMakeLists.txt +++ b/Gems/AudioSystem/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/AudioSystem/Code/CMakeLists.txt b/Gems/AudioSystem/Code/CMakeLists.txt index 17dbd91878..e5778e9152 100644 --- a/Gems/AudioSystem/Code/CMakeLists.txt +++ b/Gems/AudioSystem/Code/CMakeLists.txt @@ -10,7 +10,7 @@ set(AUDIOSYSTEM_COMPILEDEFINITIONS $,AUDIO_RELEASE,ENABLE_AUDIO_LOGGING> ) -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) ly_add_target( NAME AudioSystem.Static STATIC @@ -65,7 +65,7 @@ ly_create_alias(NAME AudioSystem.Clients NAMESPACE Gem TARGETS Gem::AudioSystem # Tests ################################################################################ if (PAL_TRAIT_BUILD_TESTS_SUPPORTED) - ly_get_list_relative_pal_filename(common_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/Common) + set(common_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/Common) ly_add_target( NAME AudioSystem.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} NAMESPACE Gem diff --git a/Gems/AudioSystem/gem.json b/Gems/AudioSystem/gem.json index ed028068a1..be618ee44e 100644 --- a/Gems/AudioSystem/gem.json +++ b/Gems/AudioSystem/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Audio System Gem provides the Audio Translation Layer (ATL) and Audio Controls Editor, which add support for audio in Open 3D Engine.", "canonical_tags": [ diff --git a/Gems/BarrierInput/gem.json b/Gems/BarrierInput/gem.json index 72d6398550..e8dcf0d93c 100644 --- a/Gems/BarrierInput/gem.json +++ b/Gems/BarrierInput/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Barrier Input Gem allows the Open 3D Engine to function as a Barrier client so that it can receive input from a remote Barrier server.", "canonical_tags": [ @@ -16,6 +17,7 @@ ], "icon_path": "preview.png", "requirements": "", + "documentation_url": "", "dependencies": [ "Atom_RPI" ] diff --git a/Gems/Blast/CMakeLists.txt b/Gems/Blast/CMakeLists.txt index 7c478ef2b2..e2fe57d8cc 100644 --- a/Gems/Blast/CMakeLists.txt +++ b/Gems/Blast/CMakeLists.txt @@ -6,5 +6,9 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/Blast/Code/CMakeLists.txt b/Gems/Blast/Code/CMakeLists.txt index d3555b2855..7f478054b8 100644 --- a/Gems/Blast/Code/CMakeLists.txt +++ b/Gems/Blast/Code/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) include(${pal_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) # for PAL_TRAIT_BLAST Traits diff --git a/Gems/Blast/gem.json b/Gems/Blast/gem.json index 761eb04761..dc90c587d7 100644 --- a/Gems/Blast/gem.json +++ b/Gems/Blast/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The NVIDIA Blast Gem provides tools to author fractured mesh assets in Houdini, and functionality to create realistic destruction simulations in Open 3D Engine.", "canonical_tags": [ diff --git a/Gems/Camera/gem.json b/Gems/Camera/gem.json index 4cf0747c7b..c6367d4663 100644 --- a/Gems/Camera/gem.json +++ b/Gems/Camera/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Camera Gem provides a basic camera component that defines a frustum for runtime rendering.", "canonical_tags": [ diff --git a/Gems/CameraFramework/gem.json b/Gems/CameraFramework/gem.json index d24014be61..0803fd7522 100644 --- a/Gems/CameraFramework/gem.json +++ b/Gems/CameraFramework/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Camera Framework Gem provides a base for implementing more complex camera systems.", "canonical_tags": [ diff --git a/Gems/CertificateManager/gem.json b/Gems/CertificateManager/gem.json index 11ea14ea5e..c582e932be 100644 --- a/Gems/CertificateManager/gem.json +++ b/Gems/CertificateManager/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Certificate Manager Gem provides access to authentication files for secure game connections from Amazon S3, files on disk, and other 3rd party sources.", "canonical_tags": [ diff --git a/Gems/CrashReporting/CMakeLists.txt b/Gems/CrashReporting/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/CrashReporting/CMakeLists.txt +++ b/Gems/CrashReporting/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/CrashReporting/Code/CMakeLists.txt b/Gems/CrashReporting/Code/CMakeLists.txt index 8bcb143d1c..7d7b2c76da 100644 --- a/Gems/CrashReporting/Code/CMakeLists.txt +++ b/Gems/CrashReporting/Code/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) include(${pal_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) diff --git a/Gems/CrashReporting/gem.json b/Gems/CrashReporting/gem.json index b8c75548a4..1651bad7b8 100644 --- a/Gems/CrashReporting/gem.json +++ b/Gems/CrashReporting/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Crash Reporting Gem provides support for external crash reporting for Open 3D Engine projects.", "canonical_tags": [ diff --git a/Gems/CustomAssetExample/gem.json b/Gems/CustomAssetExample/gem.json index 89492ee6ea..ba1030b280 100644 --- a/Gems/CustomAssetExample/gem.json +++ b/Gems/CustomAssetExample/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Custom Asset Example Gem provides example code for creating a custom asset for Open 3D Engine's asset pipeline.", "canonical_tags": [ diff --git a/Gems/DebugDraw/gem.json b/Gems/DebugDraw/gem.json index 58eff5f87a..e140d642b8 100644 --- a/Gems/DebugDraw/gem.json +++ b/Gems/DebugDraw/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Debug Draw Gem provides Editor and runtime debug visualization features for Open 3D Engine.", "canonical_tags": [ diff --git a/Gems/DevTextures/gem.json b/Gems/DevTextures/gem.json index 00cafbd6fb..f8c436887d 100644 --- a/Gems/DevTextures/gem.json +++ b/Gems/DevTextures/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Asset", "summary": "The Dev Textures Gem provides a collection of general purpose texture assets useful for prototypes and preproduction.", "canonical_tags": [ diff --git a/Gems/EMotionFX/CMakeLists.txt b/Gems/EMotionFX/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/EMotionFX/CMakeLists.txt +++ b/Gems/EMotionFX/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/EMotionFX/Code/CMakeLists.txt b/Gems/EMotionFX/Code/CMakeLists.txt index 67d0ba6d85..bd90e589c9 100644 --- a/Gems/EMotionFX/Code/CMakeLists.txt +++ b/Gems/EMotionFX/Code/CMakeLists.txt @@ -6,10 +6,9 @@ # # -ly_get_list_relative_pal_filename(core_pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) - -ly_get_list_relative_pal_filename(editor_pal_dir ${CMAKE_CURRENT_LIST_DIR}/Editor/Platform/${PAL_PLATFORM_NAME}) -ly_get_list_relative_pal_filename(editor_common_dir ${CMAKE_CURRENT_LIST_DIR}/Editor/Platform/Common) +o3de_pal_dir(core_pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) +o3de_pal_dir(editor_pal_dir ${CMAKE_CURRENT_LIST_DIR}/Editor/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) +set(editor_common_dir ${CMAKE_CURRENT_LIST_DIR}/Editor/Platform/Common) ly_add_target( NAME EMotionFXStaticLib STATIC diff --git a/Gems/EMotionFX/gem.json b/Gems/EMotionFX/gem.json index ed80517af1..c07c8368c2 100644 --- a/Gems/EMotionFX/gem.json +++ b/Gems/EMotionFX/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The EMotion FX Animation Gem provides Open 3D Engine's animation system for rigged actors and includes Animation Editor, a tool for creating animated behaviors, simulated objects, and colliders for rigged actors.", "canonical_tags": [ diff --git a/Gems/EditorPythonBindings/gem.json b/Gems/EditorPythonBindings/gem.json index 475483f13b..a5ee9f5631 100644 --- a/Gems/EditorPythonBindings/gem.json +++ b/Gems/EditorPythonBindings/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Tool", "summary": "The Editor Python Bindings Gem provides Python commands for Open 3D Engine Editor functions.", "canonical_tags": [ diff --git a/Gems/ExpressionEvaluation/gem.json b/Gems/ExpressionEvaluation/gem.json index cd712f4da9..667eebbcb5 100644 --- a/Gems/ExpressionEvaluation/gem.json +++ b/Gems/ExpressionEvaluation/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Expression Evaluation Gem provides a method for parsing and executing string expressions in Open 3D Engine.", "canonical_tags": [ diff --git a/Gems/FastNoise/gem.json b/Gems/FastNoise/gem.json index d8dfb878b4..a9c0f1f42d 100644 --- a/Gems/FastNoise/gem.json +++ b/Gems/FastNoise/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The FastNoise Gradient Gem uses the third-party, open source FastNoise library to provide a variety of high-performance noise generation algorithms.", "canonical_tags": [ diff --git a/Gems/GameState/gem.json b/Gems/GameState/gem.json index fe3a338997..d3e2d76c5a 100644 --- a/Gems/GameState/gem.json +++ b/Gems/GameState/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Game State Gem provides a generic framework to determine and manage game states and game state transitions in Open 3D Engine.", "canonical_tags": [ diff --git a/Gems/GameStateSamples/CMakeLists.txt b/Gems/GameStateSamples/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/GameStateSamples/CMakeLists.txt +++ b/Gems/GameStateSamples/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/GameStateSamples/Code/CMakeLists.txt b/Gems/GameStateSamples/Code/CMakeLists.txt index a07bef6a06..939b2ce1bd 100644 --- a/Gems/GameStateSamples/Code/CMakeLists.txt +++ b/Gems/GameStateSamples/Code/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(include_pal_dir ${CMAKE_CURRENT_LIST_DIR}/Include/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(include_pal_dir ${CMAKE_CURRENT_LIST_DIR}/Include/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) ly_add_target( NAME GameStateSamples.Headers HEADERONLY diff --git a/Gems/GameStateSamples/gem.json b/Gems/GameStateSamples/gem.json index 80018ff1a8..94556ee677 100644 --- a/Gems/GameStateSamples/gem.json +++ b/Gems/GameStateSamples/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Game State Samples Gem provides a set of sample game states (built on top of the Game State Gem), including primary user selection, main menu, level loading, level running, and level paused.", "canonical_tags": [ diff --git a/Gems/Gestures/gem.json b/Gems/Gestures/gem.json index 8efd389d53..c0609c8d54 100644 --- a/Gems/Gestures/gem.json +++ b/Gems/Gestures/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Gestures Gem provides detection for common gesture-based input actions on iOS and Android devices.", "canonical_tags": [ diff --git a/Gems/GradientSignal/gem.json b/Gems/GradientSignal/gem.json index aac4c652c5..f0136ef104 100644 --- a/Gems/GradientSignal/gem.json +++ b/Gems/GradientSignal/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Gradient Signal Gem provides a number of components for generating, modifying, and mixing gradient signals.", "canonical_tags": [ diff --git a/Gems/GraphCanvas/gem.json b/Gems/GraphCanvas/gem.json index 4762cfef35..c2038f4645 100644 --- a/Gems/GraphCanvas/gem.json +++ b/Gems/GraphCanvas/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Tool", "summary": "The Graph Canvas Gem provides a C++ framework for creating custom graphical node based editors for Open 3D Engine.", "canonical_tags": [ diff --git a/Gems/GraphModel/gem.json b/Gems/GraphModel/gem.json index ad6b592430..ece520278b 100644 --- a/Gems/GraphModel/gem.json +++ b/Gems/GraphModel/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Graph Model Gem provides a generic node graph data model framework for Open 3D Engine.", "canonical_tags": [ diff --git a/Gems/HttpRequestor/CMakeLists.txt b/Gems/HttpRequestor/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/HttpRequestor/CMakeLists.txt +++ b/Gems/HttpRequestor/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/HttpRequestor/Code/CMakeLists.txt b/Gems/HttpRequestor/Code/CMakeLists.txt index 831eb52231..4ebca5518c 100644 --- a/Gems/HttpRequestor/Code/CMakeLists.txt +++ b/Gems/HttpRequestor/Code/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(source_pal_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(source_pal_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) ly_add_target( NAME HttpRequestor.Static STATIC diff --git a/Gems/HttpRequestor/gem.json b/Gems/HttpRequestor/gem.json index 582bfa0071..a8e111ac63 100644 --- a/Gems/HttpRequestor/gem.json +++ b/Gems/HttpRequestor/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The HTTP Requestor Gem provides functionality to make asynchronous HTTP/HTTPS requests and return data through a user-provided call back function.", "canonical_tags": [ diff --git a/Gems/ImGui/CMakeLists.txt b/Gems/ImGui/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/ImGui/CMakeLists.txt +++ b/Gems/ImGui/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/ImGui/Code/CMakeLists.txt b/Gems/ImGui/Code/CMakeLists.txt index e345e3d546..c293065636 100644 --- a/Gems/ImGui/Code/CMakeLists.txt +++ b/Gems/ImGui/Code/CMakeLists.txt @@ -8,7 +8,7 @@ set(config_base_defines $,IMGUI_DISABLED,IMGUI_ENABLED>) -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) # This library is the 3rdParty imgui that is in the Gem's External ly_add_target( diff --git a/Gems/ImGui/gem.json b/Gems/ImGui/gem.json index dfc12f64b4..0ed889f693 100644 --- a/Gems/ImGui/gem.json +++ b/Gems/ImGui/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Tool", "summary": "The Immediate Mode GUI Gem provides the 3rdParty library IMGUI which can be used to create run time immediate mode overlays for debugging and profiling information in Open 3D Engine.", "canonical_tags": [ diff --git a/Gems/InAppPurchases/CMakeLists.txt b/Gems/InAppPurchases/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/InAppPurchases/CMakeLists.txt +++ b/Gems/InAppPurchases/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/InAppPurchases/Code/CMakeLists.txt b/Gems/InAppPurchases/Code/CMakeLists.txt index 99fc937919..e7b34296d1 100644 --- a/Gems/InAppPurchases/Code/CMakeLists.txt +++ b/Gems/InAppPurchases/Code/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) ly_add_target( NAME InAppPurchases.Static STATIC diff --git a/Gems/InAppPurchases/gem.json b/Gems/InAppPurchases/gem.json index 21febbfeca..0b3d2e65e4 100644 --- a/Gems/InAppPurchases/gem.json +++ b/Gems/InAppPurchases/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The In-App Purchases Gem provides functionality for in app purchases for iOS and Android.", "canonical_tags": [ diff --git a/Gems/LandscapeCanvas/gem.json b/Gems/LandscapeCanvas/gem.json index 8653da40e1..f1e326efce 100644 --- a/Gems/LandscapeCanvas/gem.json +++ b/Gems/LandscapeCanvas/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Tool", "summary": "The Landscape Canvas Gem provides the Landscape Canvas editor, a node-based graph tool for authoring workflows to populate landscape with dynamic vegetation.", "canonical_tags": [ diff --git a/Gems/LmbrCentral/CMakeLists.txt b/Gems/LmbrCentral/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/LmbrCentral/CMakeLists.txt +++ b/Gems/LmbrCentral/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/LmbrCentral/Code/CMakeLists.txt b/Gems/LmbrCentral/Code/CMakeLists.txt index 4401d3b752..a4c94a7b40 100644 --- a/Gems/LmbrCentral/Code/CMakeLists.txt +++ b/Gems/LmbrCentral/Code/CMakeLists.txt @@ -6,8 +6,8 @@ # # -ly_get_list_relative_pal_filename(common_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/Common) -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) +set(common_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/Common) ly_add_target( NAME LmbrCentral.Static STATIC diff --git a/Gems/LmbrCentral/gem.json b/Gems/LmbrCentral/gem.json index a0a6ea813f..4eea28d26e 100644 --- a/Gems/LmbrCentral/gem.json +++ b/Gems/LmbrCentral/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The O3DE Core (LmbrCentral) Gem provides required code and assets for running Open 3D Engine Editor.", "canonical_tags": [ diff --git a/Gems/LocalUser/CMakeLists.txt b/Gems/LocalUser/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/LocalUser/CMakeLists.txt +++ b/Gems/LocalUser/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/LocalUser/Code/CMakeLists.txt b/Gems/LocalUser/Code/CMakeLists.txt index 055cfe6c7c..ce937e9dc5 100644 --- a/Gems/LocalUser/Code/CMakeLists.txt +++ b/Gems/LocalUser/Code/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) ly_add_target( NAME LocalUser.Static STATIC diff --git a/Gems/LocalUser/gem.json b/Gems/LocalUser/gem.json index 5199b4f777..04f2145956 100644 --- a/Gems/LocalUser/gem.json +++ b/Gems/LocalUser/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Local User Gem provides functionality for mapping local user ids to local player slots and managing local user profiles.", "canonical_tags": [ diff --git a/Gems/LyShine/CMakeLists.txt b/Gems/LyShine/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/LyShine/CMakeLists.txt +++ b/Gems/LyShine/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/LyShine/Code/CMakeLists.txt b/Gems/LyShine/Code/CMakeLists.txt index 2b550b0e36..76d7742ddf 100644 --- a/Gems/LyShine/Code/CMakeLists.txt +++ b/Gems/LyShine/Code/CMakeLists.txt @@ -6,8 +6,8 @@ # # -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) -ly_get_list_relative_pal_filename(common_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) +set(common_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) ly_add_target( NAME LyShine.Static STATIC diff --git a/Gems/LyShine/gem.json b/Gems/LyShine/gem.json index 8dcac6404a..7ebb733b0f 100644 --- a/Gems/LyShine/gem.json +++ b/Gems/LyShine/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The LyShine Gem provides the runtime UI system and creation tools for Open 3D Engine projects.", "canonical_tags": [ diff --git a/Gems/LyShineExamples/gem.json b/Gems/LyShineExamples/gem.json index 74d2b6fe51..c91e9b819e 100644 --- a/Gems/LyShineExamples/gem.json +++ b/Gems/LyShineExamples/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Asset", "summary": "The LyShine Examples Gem provides example code and assets for LyShine, the runtime UI system and editor for Open 3D Engine projects.", "canonical_tags": [ diff --git a/Gems/Maestro/gem.json b/Gems/Maestro/gem.json index d8f884e271..95aa43c179 100644 --- a/Gems/Maestro/gem.json +++ b/Gems/Maestro/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Maestro Cinematics Gem provides Track View, Open 3D Engine's animated sequence and cinematics editor.", "canonical_tags": [ diff --git a/Gems/MessagePopup/gem.json b/Gems/MessagePopup/gem.json index fb44dd93a5..5e1b4843b0 100644 --- a/Gems/MessagePopup/gem.json +++ b/Gems/MessagePopup/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Message Popup Gem provides an example implementation of popup messages using LyShine in Open 3D Engine.", "canonical_tags": [ diff --git a/Gems/Metastream/CMakeLists.txt b/Gems/Metastream/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/Metastream/CMakeLists.txt +++ b/Gems/Metastream/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/Metastream/Code/CMakeLists.txt b/Gems/Metastream/Code/CMakeLists.txt index a032fc34ff..f1652058ac 100644 --- a/Gems/Metastream/Code/CMakeLists.txt +++ b/Gems/Metastream/Code/CMakeLists.txt @@ -6,8 +6,8 @@ # # -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) -ly_get_list_relative_pal_filename(common_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) +set(common_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) ly_add_target( NAME Metastream.Static STATIC diff --git a/Gems/Metastream/gem.json b/Gems/Metastream/gem.json index 309f16b221..9a37a0a8ee 100644 --- a/Gems/Metastream/gem.json +++ b/Gems/Metastream/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Metastream Gem provides functionality for an HTTP server that allows broadcasters to customize game streams with overlays of statistics and event data from a game session.", "canonical_tags": [ diff --git a/Gems/Microphone/CMakeLists.txt b/Gems/Microphone/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/Microphone/CMakeLists.txt +++ b/Gems/Microphone/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/Microphone/Code/CMakeLists.txt b/Gems/Microphone/Code/CMakeLists.txt index 5b40521f6a..873d05e98d 100644 --- a/Gems/Microphone/Code/CMakeLists.txt +++ b/Gems/Microphone/Code/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) ly_add_target( NAME Microphone.Static STATIC diff --git a/Gems/Microphone/gem.json b/Gems/Microphone/gem.json index 6e57bec854..6a5b415a22 100644 --- a/Gems/Microphone/gem.json +++ b/Gems/Microphone/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Microphone Gem provides support for audio input through microphones.", "canonical_tags": [ diff --git a/Gems/Multiplayer/CMakeLists.txt b/Gems/Multiplayer/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/Multiplayer/CMakeLists.txt +++ b/Gems/Multiplayer/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/Multiplayer/Code/CMakeLists.txt b/Gems/Multiplayer/Code/CMakeLists.txt index afe40408ab..66085476e5 100644 --- a/Gems/Multiplayer/Code/CMakeLists.txt +++ b/Gems/Multiplayer/Code/CMakeLists.txt @@ -6,6 +6,8 @@ # # +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) + ly_add_target( NAME Multiplayer.Static STATIC NAMESPACE Gem diff --git a/Gems/Multiplayer/gem.json b/Gems/Multiplayer/gem.json index f895c78c5d..2b412084af 100644 --- a/Gems/Multiplayer/gem.json +++ b/Gems/Multiplayer/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Multiplayer Gem provides a public API for multiplayer functionality such as connecting and hosting.", "canonical_tags": [ @@ -16,6 +17,7 @@ ], "icon_path": "preview.png", "requirements": "", + "documentation_url": "", "dependencies": [ "CertificateManager", "Atom_Feature_Common", diff --git a/Gems/MultiplayerCompression/gem.json b/Gems/MultiplayerCompression/gem.json index 98156cc404..a9cf3fa460 100644 --- a/Gems/MultiplayerCompression/gem.json +++ b/Gems/MultiplayerCompression/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Multiplayer Compression Gem provides an open source Compressor for use with AzNetworking's transport layer.", "canonical_tags": [ diff --git a/Gems/NvCloth/CMakeLists.txt b/Gems/NvCloth/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/NvCloth/CMakeLists.txt +++ b/Gems/NvCloth/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/NvCloth/Code/CMakeLists.txt b/Gems/NvCloth/Code/CMakeLists.txt index 5b5bba9d8b..76f5bcfeb8 100644 --- a/Gems/NvCloth/Code/CMakeLists.txt +++ b/Gems/NvCloth/Code/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) include(${pal_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) #for PAL_TRAIT_NVCLOTH Traits diff --git a/Gems/NvCloth/gem.json b/Gems/NvCloth/gem.json index 86a70b9373..9494d65e82 100644 --- a/Gems/NvCloth/gem.json +++ b/Gems/NvCloth/gem.json @@ -2,8 +2,9 @@ "gem_name": "NvCloth", "display_name": "NVIDIA Cloth (NvCloth)", "license": "Apache-2.0 Or MIT", - "origin": "Open 3D Engine - o3de.org", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", + "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The NVIDIA Cloth Gem provides functionality to create fast, realistic cloth simulation with the NVIDIA Cloth library.", "canonical_tags": [ diff --git a/Gems/PhysX/CMakeLists.txt b/Gems/PhysX/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/PhysX/CMakeLists.txt +++ b/Gems/PhysX/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/PhysX/Code/CMakeLists.txt b/Gems/PhysX/Code/CMakeLists.txt index f045d6b00d..1cad877542 100644 --- a/Gems/PhysX/Code/CMakeLists.txt +++ b/Gems/PhysX/Code/CMakeLists.txt @@ -8,7 +8,7 @@ add_subdirectory(NumericalMethods) -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) include(${pal_source_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) # for PAL_TRAIT_PHYSX_SUPPORTED set(LY_PHYSX_ENABLE_RUNNING_BENCHMARKS OFF CACHE BOOL "Adds a target to allow running of the physx benchmarks.") diff --git a/Gems/PhysXDebug/CMakeLists.txt b/Gems/PhysXDebug/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/PhysXDebug/CMakeLists.txt +++ b/Gems/PhysXDebug/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/PhysXDebug/Code/CMakeLists.txt b/Gems/PhysXDebug/Code/CMakeLists.txt index 3ddec9d105..0886f2bf34 100644 --- a/Gems/PhysXDebug/Code/CMakeLists.txt +++ b/Gems/PhysXDebug/Code/CMakeLists.txt @@ -6,7 +6,11 @@ # # -ly_get_list_relative_pal_filename(physx_pal_source_dir ${LY_ROOT_FOLDER}/Gems/PhysX/Code/Source/Platform/${PAL_PLATFORM_NAME}) +# This gem relies on the PhysX gem +o3de_find_gem("PhysX" physx_gem_path) +set(physx_gem_json ${physx_gem_path}/gem.json) +o3de_restricted_path(${physx_gem_json} physx_gem_restricted_path physx_gem_parent_relative_path) +o3de_pal_dir(physx_pal_source_dir ${physx_gem_path}/Code/Source/Platform/${PAL_PLATFORM_NAME} ${physx_gem_restricted_path} ${physx_gem_path} ${physx_gem_parent_relative_path}) include(${physx_pal_source_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) # for PAL_TRAIT_PHYSX_SUPPORTED diff --git a/Gems/PhysXDebug/gem.json b/Gems/PhysXDebug/gem.json index 2d9f4dc24d..1087eefad4 100644 --- a/Gems/PhysXDebug/gem.json +++ b/Gems/PhysXDebug/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Tool", "summary": "The PhysX Debug Gem provides debugging functionality and visualizations for NVIDIA PhysX in Open 3D Engine.", "canonical_tags": [ diff --git a/Gems/Prefab/PrefabBuilder/gem.json b/Gems/Prefab/PrefabBuilder/gem.json index 2233a7235e..1c0dcd9a72 100644 --- a/Gems/Prefab/PrefabBuilder/gem.json +++ b/Gems/Prefab/PrefabBuilder/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Prefab Builder Gem provides an Asset Processor module for prefabs, which are complex assets built by combining smaller entities.", "canonical_tags": [ diff --git a/Gems/Presence/CMakeLists.txt b/Gems/Presence/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/Presence/CMakeLists.txt +++ b/Gems/Presence/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/Presence/Code/CMakeLists.txt b/Gems/Presence/Code/CMakeLists.txt index c1c807d432..cc84771201 100644 --- a/Gems/Presence/Code/CMakeLists.txt +++ b/Gems/Presence/Code/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) ly_add_target( NAME Presence.Headers HEADERONLY diff --git a/Gems/Presence/gem.json b/Gems/Presence/gem.json index 624af2e62d..48d9dd5ef0 100644 --- a/Gems/Presence/gem.json +++ b/Gems/Presence/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Presence Gem provides a target platform agnostic interface for Presence services.", "canonical_tags": [ diff --git a/Gems/PrimitiveAssets/gem.json b/Gems/PrimitiveAssets/gem.json index 0e4c4689dc..7669477220 100644 --- a/Gems/PrimitiveAssets/gem.json +++ b/Gems/PrimitiveAssets/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Asset", "summary": "The Primitive Assets Gem provides primitive shape mesh assets with physics enabled.", "canonical_tags": [ diff --git a/Gems/Profiler/gem.json b/Gems/Profiler/gem.json index b160bc4b3c..40478deae1 100644 --- a/Gems/Profiler/gem.json +++ b/Gems/Profiler/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "A collection of utilities for capturing performance data", "canonical_tags": [ diff --git a/Gems/PythonAssetBuilder/gem.json b/Gems/PythonAssetBuilder/gem.json index 8046104f03..54fbb949f9 100644 --- a/Gems/PythonAssetBuilder/gem.json +++ b/Gems/PythonAssetBuilder/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Python Asset Builder Gem provides functionality to implement custom asset builders in Python for Asset Processor.", "canonical_tags": [ diff --git a/Gems/QtForPython/Code/CMakeLists.txt b/Gems/QtForPython/Code/CMakeLists.txt index da763978a6..d63c71492d 100644 --- a/Gems/QtForPython/Code/CMakeLists.txt +++ b/Gems/QtForPython/Code/CMakeLists.txt @@ -9,7 +9,7 @@ if(NOT PAL_TRAIT_BUILD_HOST_TOOLS) return() endif() -ly_get_list_relative_pal_filename(common_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) +set(common_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) include(${CMAKE_CURRENT_SOURCE_DIR}/Source/Platform/${PAL_PLATFORM_NAME}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) diff --git a/Gems/QtForPython/gem.json b/Gems/QtForPython/gem.json index 17d3a26f21..63805a5bc7 100644 --- a/Gems/QtForPython/gem.json +++ b/Gems/QtForPython/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Tool", "summary": "The Qt for Python Gem provides the PySide2 Python libraries to manage Qt widgets.", "canonical_tags": [ diff --git a/Gems/SaveData/CMakeLists.txt b/Gems/SaveData/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/SaveData/CMakeLists.txt +++ b/Gems/SaveData/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/SaveData/Code/CMakeLists.txt b/Gems/SaveData/Code/CMakeLists.txt index 38d145f8e5..5d4eb361cc 100644 --- a/Gems/SaveData/Code/CMakeLists.txt +++ b/Gems/SaveData/Code/CMakeLists.txt @@ -6,7 +6,7 @@ # # -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) ly_add_target( NAME SaveData.Static STATIC diff --git a/Gems/SaveData/gem.json b/Gems/SaveData/gem.json index 1ee5a54cec..3a686242d7 100644 --- a/Gems/SaveData/gem.json +++ b/Gems/SaveData/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Save Data Gem provides a platform independent API to save and load persistent user data in Open 3D Engine projects.", "canonical_tags": [ diff --git a/Gems/SceneLoggingExample/gem.json b/Gems/SceneLoggingExample/gem.json index ad950f3992..dc6b5179b6 100644 --- a/Gems/SceneLoggingExample/gem.json +++ b/Gems/SceneLoggingExample/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Asset", "summary": "The Scene Logging Example Gem demonstrates the basics of extending the Open 3D Engine Scene API by adding additional logging to the pipeline.", "canonical_tags": [ diff --git a/Gems/SceneProcessing/gem.json b/Gems/SceneProcessing/gem.json index 576460d0a9..3689c2500a 100644 --- a/Gems/SceneProcessing/gem.json +++ b/Gems/SceneProcessing/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Tool", "summary": "The Scene Processing Gem provides Scene Settings, a tool you can use to specify the default settings for processing asset files for actors, meshes, motions, and PhysX.", "canonical_tags": [ diff --git a/Gems/ScriptCanvas/gem.json b/Gems/ScriptCanvas/gem.json index fc8a504917..ace6bca50c 100644 --- a/Gems/ScriptCanvas/gem.json +++ b/Gems/ScriptCanvas/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Tool", "summary": "The Script Canvas Gem provides Open 3D Engine's visual scripting environment, Script Canvas.", "canonical_tags": [ diff --git a/Gems/ScriptCanvasDeveloper/gem.json b/Gems/ScriptCanvasDeveloper/gem.json index fe1fdea0fc..c7e23dab9a 100644 --- a/Gems/ScriptCanvasDeveloper/gem.json +++ b/Gems/ScriptCanvasDeveloper/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Tool", "summary": "The Script Canvas Developer Gem provides a suite of utility features for the development and debugging of Script Canvas systems.", "canonical_tags": [ diff --git a/Gems/ScriptCanvasPhysics/gem.json b/Gems/ScriptCanvasPhysics/gem.json index 2e35e85c46..fdf83fe479 100644 --- a/Gems/ScriptCanvasPhysics/gem.json +++ b/Gems/ScriptCanvasPhysics/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Script Canvas Physics Gem provides Script Canvas nodes for physics scene queries such as raycasts.", "canonical_tags": [ diff --git a/Gems/ScriptCanvasTesting/gem.json b/Gems/ScriptCanvasTesting/gem.json index 5cb718e674..f62ec46fd4 100644 --- a/Gems/ScriptCanvasTesting/gem.json +++ b/Gems/ScriptCanvasTesting/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Tool", "summary": "The Script Canvas Testing Gem provides a framework for testing for and with Script Canvas.", "canonical_tags": [ diff --git a/Gems/ScriptEvents/gem.json b/Gems/ScriptEvents/gem.json index 5640e08489..c9391da996 100644 --- a/Gems/ScriptEvents/gem.json +++ b/Gems/ScriptEvents/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Script Events Gem provides a framework for creating event assets usable from any scripting solution in Open 3D Engine.", "canonical_tags": [ diff --git a/Gems/ScriptedEntityTweener/gem.json b/Gems/ScriptedEntityTweener/gem.json index 477345093c..bf7eec470f 100644 --- a/Gems/ScriptedEntityTweener/gem.json +++ b/Gems/ScriptedEntityTweener/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Tool", "summary": "The Scripted Entity Tweener Gem provides a script driven animation system for Open 3D Engine projects.", "canonical_tags": [ diff --git a/Gems/SliceFavorites/gem.json b/Gems/SliceFavorites/gem.json index c4536dc042..bbb873b20b 100644 --- a/Gems/SliceFavorites/gem.json +++ b/Gems/SliceFavorites/gem.json @@ -4,13 +4,18 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "Add the ability to favorite a slice to allow easy access and instantiation", + "canonical_tags": [ + "Gem" + ], "user_tags": [ "Editor", "Slices" ], "icon_path": "preview.png", "requirements": "", + "documentation_url": "", "dependencies": [] } diff --git a/Gems/StartingPointCamera/gem.json b/Gems/StartingPointCamera/gem.json index 1033770022..1a736d6e74 100644 --- a/Gems/StartingPointCamera/gem.json +++ b/Gems/StartingPointCamera/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Starting Point Camera Gem provides the behaviors used with the Camera Framework Gem to define a camera rig.", "canonical_tags": [ diff --git a/Gems/StartingPointInput/gem.json b/Gems/StartingPointInput/gem.json index ee1655b794..77a683658d 100644 --- a/Gems/StartingPointInput/gem.json +++ b/Gems/StartingPointInput/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Starting Point Input Gem provides functionality to map low-level input events to high-level actions.", "canonical_tags": [ diff --git a/Gems/StartingPointMovement/gem.json b/Gems/StartingPointMovement/gem.json index 188d8483bc..a9941098fa 100644 --- a/Gems/StartingPointMovement/gem.json +++ b/Gems/StartingPointMovement/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Starting Point Movement Gem provides a series of Lua scripts that listen and respond to input events and trigger transform operations such as translation and rotation.", "canonical_tags": [ diff --git a/Gems/SurfaceData/gem.json b/Gems/SurfaceData/gem.json index d16254040f..10100e3b90 100644 --- a/Gems/SurfaceData/gem.json +++ b/Gems/SurfaceData/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Surface Data Gem provides functionality to emit signals or tags from surfaces such as meshes and terrain.", "canonical_tags": [ diff --git a/Gems/Terrain/gem.json b/Gems/Terrain/gem.json index 0ca470c4d3..f038eb4d90 100644 --- a/Gems/Terrain/gem.json +++ b/Gems/Terrain/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "summary": "The Terrain Gem is an experimental terrain system. The terrain system maps height, color, and surface data to regions of the world, provides gradient-based and shape-based authoring tools and workflows, includes specialized rendering for efficient display, and integrates with physics for physical simulation.", "canonical_tags": [ "Gem" diff --git a/Gems/TestAssetBuilder/gem.json b/Gems/TestAssetBuilder/gem.json index 68ed706499..96c3bb4ffb 100644 --- a/Gems/TestAssetBuilder/gem.json +++ b/Gems/TestAssetBuilder/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Test Asset Builder Gem is used to feature test Asset Processor.", "canonical_tags": [ diff --git a/Gems/TextureAtlas/gem.json b/Gems/TextureAtlas/gem.json index 142f0fb082..970982fb48 100644 --- a/Gems/TextureAtlas/gem.json +++ b/Gems/TextureAtlas/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Texture Atlas Gem provides the formatting for texture atlases from 2D textures for LyShine.", "canonical_tags": [ diff --git a/Gems/TickBusOrderViewer/gem.json b/Gems/TickBusOrderViewer/gem.json index a6a6fd23ac..78b4d96c5c 100644 --- a/Gems/TickBusOrderViewer/gem.json +++ b/Gems/TickBusOrderViewer/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Tool", "summary": "The Tick Bus Order Viewer Gem provides a console variable that displays the order of runtime tick events.", "canonical_tags": [ diff --git a/Gems/Twitch/CMakeLists.txt b/Gems/Twitch/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/Twitch/CMakeLists.txt +++ b/Gems/Twitch/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/Twitch/Code/CMakeLists.txt b/Gems/Twitch/Code/CMakeLists.txt index 80c74e5bd4..75b18627cf 100644 --- a/Gems/Twitch/Code/CMakeLists.txt +++ b/Gems/Twitch/Code/CMakeLists.txt @@ -6,8 +6,8 @@ # # -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) -ly_get_list_relative_pal_filename(common_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) +set(common_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/Common) ly_add_target( NAME Twitch.Static STATIC diff --git a/Gems/Twitch/gem.json b/Gems/Twitch/gem.json index 42ec1b971e..70386e057f 100644 --- a/Gems/Twitch/gem.json +++ b/Gems/Twitch/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Twitch Gem provides access to the Twitch API v5 SDK including social functions, channels, and other APIs.", "canonical_tags": [ @@ -12,7 +13,8 @@ "user_tags": [ "Network", "SDK", - "Multiplayer" + "Multiplayer", + "Twitch" ], "icon_path": "preview.png", "requirements": "", diff --git a/Gems/UiBasics/gem.json b/Gems/UiBasics/gem.json index bb2416c235..4734aef779 100644 --- a/Gems/UiBasics/gem.json +++ b/Gems/UiBasics/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Asset", "summary": "The UI Basics Gem provides a collection of basic UI prefabs such as image, text, and button, that can be used with LyShine, the Open 3D Engine runtime User Interface system and editor.", "canonical_tags": [ diff --git a/Gems/Vegetation/gem.json b/Gems/Vegetation/gem.json index 75416933f0..8dfd3b3a59 100644 --- a/Gems/Vegetation/gem.json +++ b/Gems/Vegetation/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Vegetation Gem provides tools to place natural-looking vegetation in Open 3D Engine.", "canonical_tags": [ diff --git a/Gems/VideoPlaybackFramework/gem.json b/Gems/VideoPlaybackFramework/gem.json index 381738ab4b..9115148c50 100644 --- a/Gems/VideoPlaybackFramework/gem.json +++ b/Gems/VideoPlaybackFramework/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Video Playback Framework Gem provides the interface to play back video.", "canonical_tags": [ diff --git a/Gems/VirtualGamepad/gem.json b/Gems/VirtualGamepad/gem.json index 637776ac85..a2a669bb11 100644 --- a/Gems/VirtualGamepad/gem.json +++ b/Gems/VirtualGamepad/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "The Virtual Gamepad Gem provides controls that emulate a gamepad on touch screen devices.", "canonical_tags": [ diff --git a/Gems/WhiteBox/CMakeLists.txt b/Gems/WhiteBox/CMakeLists.txt index 2bb380fae3..50f9e78c74 100644 --- a/Gems/WhiteBox/CMakeLists.txt +++ b/Gems/WhiteBox/CMakeLists.txt @@ -6,4 +6,8 @@ # # +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + add_subdirectory(Code) diff --git a/Gems/WhiteBox/Code/CMakeLists.txt b/Gems/WhiteBox/Code/CMakeLists.txt index bfc4eb724a..91536503ac 100644 --- a/Gems/WhiteBox/Code/CMakeLists.txt +++ b/Gems/WhiteBox/Code/CMakeLists.txt @@ -6,8 +6,8 @@ # # -ly_get_list_relative_pal_filename(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME}) -ly_get_list_relative_pal_filename(common_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/Common) +o3de_pal_dir(pal_source_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) +set(common_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/Common) include(${pal_source_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) diff --git a/Gems/WhiteBox/gem.json b/Gems/WhiteBox/gem.json index 2d173e9a6b..18a3022b74 100644 --- a/Gems/WhiteBox/gem.json +++ b/Gems/WhiteBox/gem.json @@ -4,6 +4,7 @@ "license": "Apache-2.0 Or MIT", "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Tool", "summary": "The White Box Gem provides White Box rapid design components for Open 3D Engine.", "canonical_tags": [ diff --git a/Templates/AssetGem/Template/gem.json b/Templates/AssetGem/Template/gem.json index 2a02362256..b04ecf9dd8 100644 --- a/Templates/AssetGem/Template/gem.json +++ b/Templates/AssetGem/Template/gem.json @@ -1,18 +1,21 @@ { "gem_name": "${Name}", "display_name": "${Name}", - "license": "What license ${Name} uses goes here: i.e. Apache-2.0 Or MIT", - "license_url": "", - "origin": "The primary repo for ${Name} goes here: i.e. http://www.mydomain.com", + "license": "What license ${Name} uses goes here: i.e. Apache-2.0 or MIT", + "license_url": "Link to the license web site goes here: i.e. https://opensource.org/licenses/Apache-2.0 Or https://opensource.org/licenses/MIT", + "origin": "The name of the originator goes here. i.e. XYZ Inc.", + "origin_url": "The primary repo for ${Name} goes here: i.e. http://www.mydomain.com", "type": "Asset", - "summary": "A short description of ${Name}.", + "summary": "A short description of ${Name} goes here.", "canonical_tags": [ "Gem" ], "user_tags": [ - "Assets", "${Name}" ], "icon_path": "preview.png", - "requirements": "" + "requirements": "Notice of any requirements ${Name} has goes here. i.e. This requires X other gem", + "documentation_url": "Link to any documentation of ${Name} goes here: i.e. https://o3de.org/docs/user-guide/gems/reference/design/white-box/", + "dependencies": [ + ] } diff --git a/Templates/AssetGem/template.json b/Templates/AssetGem/template.json index e858dc526d..2f390f2077 100644 --- a/Templates/AssetGem/template.json +++ b/Templates/AssetGem/template.json @@ -1,10 +1,17 @@ { "template_name": "AssetGem", - "origin": "The primary repo for AssetGem goes here: i.e. http://www.mydomain.com", - "license": "What license AssetGem uses goes here: i.e. https://opensource.org/licenses/MIT", - "display_name": "AssetGem", - "summary": "A short description of AssetGem template.", - "canonical_tags": [], + "template_restricted_platform_relative_path": "Templates/AssetGem", + "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", + "license": "Apache-2.0 or MIT", + "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", + "display_name": "Asset Gem Template", + "summary": "Use this gem template to create the minimal gem needed for adding asset(s).", + "canonical_tags": [ + "Template", + "Gem", + "Asset" + ], "user_tags": [ "AssetGem" ], @@ -12,27 +19,20 @@ "copyFiles": [ { "file": "CMakeLists.txt", - "origin": "CMakeLists.txt", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "gem.json", - "origin": "gem.json", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "preview.png", - "origin": "preview.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false } ], "createDirectories": [ { - "dir": "Assets", - "origin": "Assets" + "dir": "Assets" } ] } diff --git a/Templates/CppToolGem/Template/gem.json b/Templates/CppToolGem/Template/gem.json index 079b7152ff..05be122226 100644 --- a/Templates/CppToolGem/Template/gem.json +++ b/Templates/CppToolGem/Template/gem.json @@ -1,11 +1,12 @@ { "gem_name": "${Name}", "display_name": "${Name}", - "license": "What license ${Name} uses goes here: i.e. Apache-2.0 Or MIT", - "license_url": "", - "origin": "The primary repo for ${Name} goes here: i.e. http://www.mydomain.com", + "license": "What license ${Name} uses goes here: i.e. Apache-2.0 or MIT", + "license_url": "Link to the license web site goes here: i.e. https://opensource.org/licenses/Apache-2.0 Or https://opensource.org/licenses/MIT", + "origin": "The name of the originator goes here. i.e. XYZ Inc.", + "origin_url": "The primary repo for ${Name} goes here: i.e. http://www.mydomain.com", "type": "Code", - "summary": "A short description of ${Name}.", + "summary": "A short description of ${Name} goes here.", "canonical_tags": [ "Gem" ], @@ -13,6 +14,8 @@ "${Name}" ], "icon_path": "preview.png", - "requirements": "", - "restricted_name": "gems" + "requirements": "Notice of any requirements ${Name} has goes here. i.e. This requires X other gem", + "documentation_url": "Link to any documentation of ${Name} goes here: i.e. https://o3de.org/docs/user-guide/gems/reference/design/white-box/", + "dependencies": [ + ] } diff --git a/Templates/CppToolGem/template.json b/Templates/CppToolGem/template.json index b516dbaec3..16874326ef 100644 --- a/Templates/CppToolGem/template.json +++ b/Templates/CppToolGem/template.json @@ -1,10 +1,16 @@ { "template_name": "CppToolGem", - "origin": "The primary repo for CppToolGem goes here: i.e. http://www.mydomain.com", - "license": "What license CppToolGem uses goes here: i.e. https://opensource.org/licenses/MIT", + "template_restricted_platform_relative_path": "Templates/CppToolGem", + "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", + "license": "Apache-2.0 or MIT", + "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "display_name": "CppToolGem", "summary": "A gem template for a custom tool in C++ that gets registered with the Editor.", - "canonical_tags": [], + "canonical_tags": [ + "Template", + "Gem" + ], "user_tags": [ "CppToolGem" ], @@ -12,371 +18,255 @@ "copyFiles": [ { "file": "CMakeLists.txt", - "origin": "CMakeLists.txt", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Code/${NameLower}_editor_files.cmake", - "origin": "Code/${NameLower}_editor_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/${NameLower}_editor_shared_files.cmake", - "origin": "Code/${NameLower}_editor_shared_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/${NameLower}_editor_tests_files.cmake", - "origin": "Code/${NameLower}_editor_tests_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/${NameLower}_files.cmake", - "origin": "Code/${NameLower}_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/${NameLower}_shared_files.cmake", - "origin": "Code/${NameLower}_shared_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/${NameLower}_tests_files.cmake", - "origin": "Code/${NameLower}_tests_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/CMakeLists.txt", - "origin": "Code/CMakeLists.txt", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Include/${Name}/${Name}Bus.h", - "origin": "Code/Include/${Name}/${Name}Bus.h", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Android/${NameLower}_android_files.cmake", - "origin": "Code/Platform/Android/${NameLower}_android_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Android/${NameLower}_shared_android_files.cmake", - "origin": "Code/Platform/Android/${NameLower}_shared_android_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Android/PAL_android.cmake", - "origin": "Code/Platform/Android/PAL_android.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Linux/${NameLower}_linux_files.cmake", - "origin": "Code/Platform/Linux/${NameLower}_linux_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Linux/${NameLower}_shared_linux_files.cmake", - "origin": "Code/Platform/Linux/${NameLower}_shared_linux_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Linux/PAL_linux.cmake", - "origin": "Code/Platform/Linux/PAL_linux.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Mac/${NameLower}_mac_files.cmake", - "origin": "Code/Platform/Mac/${NameLower}_mac_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Mac/${NameLower}_shared_mac_files.cmake", - "origin": "Code/Platform/Mac/${NameLower}_shared_mac_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Mac/PAL_mac.cmake", - "origin": "Code/Platform/Mac/PAL_mac.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Windows/${NameLower}_shared_windows_files.cmake", - "origin": "Code/Platform/Windows/${NameLower}_shared_windows_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Windows/${NameLower}_windows_files.cmake", - "origin": "Code/Platform/Windows/${NameLower}_windows_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Windows/PAL_windows.cmake", - "origin": "Code/Platform/Windows/PAL_windows.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/iOS/${NameLower}_ios_files.cmake", - "origin": "Code/Platform/iOS/${NameLower}_ios_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/iOS/${NameLower}_shared_ios_files.cmake", - "origin": "Code/Platform/iOS/${NameLower}_shared_ios_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/iOS/PAL_ios.cmake", - "origin": "Code/Platform/iOS/PAL_ios.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}.qrc", - "origin": "Code/Source/${Name}.qrc", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}EditorModule.cpp", - "origin": "Code/Source/${Name}EditorModule.cpp", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}EditorSystemComponent.cpp", - "origin": "Code/Source/${Name}EditorSystemComponent.cpp", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}EditorSystemComponent.h", - "origin": "Code/Source/${Name}EditorSystemComponent.h", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}Module.cpp", - "origin": "Code/Source/${Name}Module.cpp", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}ModuleInterface.h", - "origin": "Code/Source/${Name}ModuleInterface.h", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}SystemComponent.cpp", - "origin": "Code/Source/${Name}SystemComponent.cpp", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}SystemComponent.h", - "origin": "Code/Source/${Name}SystemComponent.h", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}Widget.cpp", - "origin": "Code/Source/${Name}Widget.cpp", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}Widget.h", - "origin": "Code/Source/${Name}Widget.h", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/toolbar_icon.svg", - "origin": "Code/Source/toolbar_icon.svg", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Code/Tests/${Name}EditorTest.cpp", - "origin": "Code/Tests/${Name}EditorTest.cpp", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Code/Tests/${Name}Test.cpp", - "origin": "Code/Tests/${Name}Test.cpp", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/Android/android_gem.cmake", - "origin": "Platform/Android/android_gem.cmake", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/Android/android_gem.json", - "origin": "Platform/Android/android_gem.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/Linux/linux_gem.cmake", - "origin": "Platform/Linux/linux_gem.cmake", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/Linux/linux_gem.json", - "origin": "Platform/Linux/linux_gem.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/Mac/mac_gem.cmake", - "origin": "Platform/Mac/mac_gem.cmake", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/Mac/mac_gem.json", - "origin": "Platform/Mac/mac_gem.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/Windows/windows_gem.cmake", - "origin": "Platform/Windows/windows_gem.cmake", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/Windows/windows_gem.json", - "origin": "Platform/Windows/windows_gem.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/iOS/ios_gem.cmake", - "origin": "Platform/iOS/ios_gem.cmake", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/iOS/ios_gem.json", - "origin": "Platform/iOS/ios_gem.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "gem.json", - "origin": "gem.json", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "preview.png", - "origin": "preview.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false } ], "createDirectories": [ { - "dir": "Assets", - "origin": "Assets" + "dir": "Assets" }, { - "dir": "Code", - "origin": "Code" + "dir": "Code" }, { - "dir": "Code/Include", - "origin": "Code/Include" + "dir": "Code/Include" }, { - "dir": "Code/Include/${Name}", - "origin": "Code/Include/${Name}" + "dir": "Code/Include/${Name}" }, { - "dir": "Code/Platform", - "origin": "Code/Platform" + "dir": "Code/Platform" }, { - "dir": "Code/Platform/Android", - "origin": "Code/Platform/Android" + "dir": "Code/Platform/Android" }, { - "dir": "Code/Platform/Linux", - "origin": "Code/Platform/Linux" + "dir": "Code/Platform/Linux" }, { - "dir": "Code/Platform/Mac", - "origin": "Code/Platform/Mac" + "dir": "Code/Platform/Mac" }, { - "dir": "Code/Platform/Windows", - "origin": "Code/Platform/Windows" + "dir": "Code/Platform/Windows" }, { - "dir": "Code/Platform/iOS", - "origin": "Code/Platform/iOS" + "dir": "Code/Platform/iOS" }, { - "dir": "Code/Source", - "origin": "Code/Source" + "dir": "Code/Source" }, { - "dir": "Code/Tests", - "origin": "Code/Tests" + "dir": "Code/Tests" }, { - "dir": "Platform", - "origin": "Platform" + "dir": "Platform" }, { - "dir": "Platform/Android", - "origin": "Platform/Android" + "dir": "Platform/Android" }, { - "dir": "Platform/Linux", - "origin": "Platform/Linux" + "dir": "Platform/Linux" }, { - "dir": "Platform/Mac", - "origin": "Platform/Mac" + "dir": "Platform/Mac" }, { - "dir": "Platform/Windows", - "origin": "Platform/Windows" + "dir": "Platform/Windows" }, { - "dir": "Platform/iOS", - "origin": "Platform/iOS" + "dir": "Platform/iOS" } ] } diff --git a/Templates/DefaultGem/Template/CMakeLists.txt b/Templates/DefaultGem/Template/CMakeLists.txt index b19ea2edce..f4c55dd1a5 100644 --- a/Templates/DefaultGem/Template/CMakeLists.txt +++ b/Templates/DefaultGem/Template/CMakeLists.txt @@ -6,12 +6,11 @@ # # {END_LICENSE} -set(o3de_gem_path ${CMAKE_CURRENT_LIST_DIR}) -set(o3de_gem_json ${o3de_gem_path}/gem.json) -o3de_read_json_key(o3de_gem_name ${o3de_gem_json} "gem_name") -o3de_restricted_path(${o3de_gem_json} o3de_gem_restricted_path) +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} "${o3de_gem_restricted_path}" ${o3de_gem_path} ${o3de_gem_name}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) # Now that we have the platform abstraction layer (PAL) folder for this folder, thats where we will find the # project cmake for this platform. diff --git a/Templates/DefaultGem/Template/Code/CMakeLists.txt b/Templates/DefaultGem/Template/Code/CMakeLists.txt index f462e7f2d4..c5ff305b2a 100644 --- a/Templates/DefaultGem/Template/Code/CMakeLists.txt +++ b/Templates/DefaultGem/Template/Code/CMakeLists.txt @@ -8,11 +8,11 @@ # Currently we are in the Code folder: ${CMAKE_CURRENT_LIST_DIR} # Get the platform specific folder ${pal_dir} for the current folder: ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} -# Note: ly_get_list_relative_pal_filename will take care of the details for us, as this may be a restricted platform +# Note: o3de_pal_dir will take care of the details for us, as this may be a restricted platform # in which case it will see if that platform is present here or in the restricted folder. # i.e. It could here in our gem : Gems/${Name}/Code/Platform/ or # //Gems/${Name}/Code -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${o3de_gem_restricted_path} ${o3de_gem_path} ${o3de_gem_name}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${o3de_gem_restricted_path} ${o3de_gem_path} ${o3de_gem_name}) # Now that we have the platform abstraction layer (PAL) folder for this folder, thats where we will find the # traits for this platform. Traits for a platform are defines for things like whether or not something in this gem diff --git a/Templates/DefaultGem/Template/gem.json b/Templates/DefaultGem/Template/gem.json index d4ff637bee..05be122226 100644 --- a/Templates/DefaultGem/Template/gem.json +++ b/Templates/DefaultGem/Template/gem.json @@ -1,11 +1,12 @@ { "gem_name": "${Name}", "display_name": "${Name}", - "license": "What license ${Name} uses goes here: i.e. Apache-2.0 Or MIT", - "license_url": "", - "origin": "The primary repo for ${Name} goes here: i.e. http://www.mydomain.com", + "license": "What license ${Name} uses goes here: i.e. Apache-2.0 or MIT", + "license_url": "Link to the license web site goes here: i.e. https://opensource.org/licenses/Apache-2.0 Or https://opensource.org/licenses/MIT", + "origin": "The name of the originator goes here. i.e. XYZ Inc.", + "origin_url": "The primary repo for ${Name} goes here: i.e. http://www.mydomain.com", "type": "Code", - "summary": "A short description of ${Name}.", + "summary": "A short description of ${Name} goes here.", "canonical_tags": [ "Gem" ], @@ -13,5 +14,8 @@ "${Name}" ], "icon_path": "preview.png", - "requirements": "" + "requirements": "Notice of any requirements ${Name} has goes here. i.e. This requires X other gem", + "documentation_url": "Link to any documentation of ${Name} goes here: i.e. https://o3de.org/docs/user-guide/gems/reference/design/white-box/", + "dependencies": [ + ] } diff --git a/Templates/DefaultGem/template.json b/Templates/DefaultGem/template.json index e24632d6a0..e5dc570cbe 100644 --- a/Templates/DefaultGem/template.json +++ b/Templates/DefaultGem/template.json @@ -1,12 +1,16 @@ { "template_name": "DefaultGem", + "template_restricted_platform_relative_path": "Templates/DefaultGem", "restricted_name": "o3de", - "restricted_platform_relative_path": "Templates", - "origin": "The primary repo for DefaultGem goes here: i.e. http://www.mydomain.com", - "license": "What license DefaultGem uses goes here: i.e. https://opensource.org/licenses/MIT", - "display_name": "DefaultGem", - "summary": "A short description of DefaultGem.", - "canonical_tags": [], + "restricted_platform_relative_path": "Templates/DefaultGem", + "license": "Apache-2.0 or MIT", + "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", + "display_name": "Default Gem Template", + "summary": "This is the gem template that will be used if no gem template is specified during gem creation.", + "canonical_tags": [ + "Template", + "Gem" + ], "user_tags": [ "DefaultGem" ], @@ -14,347 +18,239 @@ "copyFiles": [ { "file": "CMakeLists.txt", - "origin": "CMakeLists.txt", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/${NameLower}_editor_files.cmake", - "origin": "Code/${NameLower}_editor_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/${NameLower}_editor_shared_files.cmake", - "origin": "Code/${NameLower}_editor_shared_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/${NameLower}_editor_tests_files.cmake", - "origin": "Code/${NameLower}_editor_tests_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/${NameLower}_files.cmake", - "origin": "Code/${NameLower}_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/${NameLower}_shared_files.cmake", - "origin": "Code/${NameLower}_shared_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/${NameLower}_tests_files.cmake", - "origin": "Code/${NameLower}_tests_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/CMakeLists.txt", - "origin": "Code/CMakeLists.txt", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Include/${Name}/${Name}Bus.h", - "origin": "Code/Include/${Name}/${Name}Bus.h", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Android/${NameLower}_android_files.cmake", - "origin": "Code/Platform/Android/${NameLower}_android_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Android/${NameLower}_shared_android_files.cmake", - "origin": "Code/Platform/Android/${NameLower}_shared_android_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Android/PAL_android.cmake", - "origin": "Code/Platform/Android/PAL_android.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Linux/${NameLower}_linux_files.cmake", - "origin": "Code/Platform/Linux/${NameLower}_linux_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Linux/${NameLower}_shared_linux_files.cmake", - "origin": "Code/Platform/Linux/${NameLower}_shared_linux_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Linux/PAL_linux.cmake", - "origin": "Code/Platform/Linux/PAL_linux.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Mac/${NameLower}_mac_files.cmake", - "origin": "Code/Platform/Mac/${NameLower}_mac_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Mac/${NameLower}_shared_mac_files.cmake", - "origin": "Code/Platform/Mac/${NameLower}_shared_mac_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Mac/PAL_mac.cmake", - "origin": "Code/Platform/Mac/PAL_mac.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Windows/${NameLower}_shared_windows_files.cmake", - "origin": "Code/Platform/Windows/${NameLower}_shared_windows_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Windows/${NameLower}_windows_files.cmake", - "origin": "Code/Platform/Windows/${NameLower}_windows_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Windows/PAL_windows.cmake", - "origin": "Code/Platform/Windows/PAL_windows.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/iOS/${NameLower}_ios_files.cmake", - "origin": "Code/Platform/iOS/${NameLower}_ios_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/iOS/${NameLower}_shared_ios_files.cmake", - "origin": "Code/Platform/iOS/${NameLower}_shared_ios_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/iOS/PAL_ios.cmake", - "origin": "Code/Platform/iOS/PAL_ios.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}EditorModule.cpp", - "origin": "Code/Source/${Name}EditorModule.cpp", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}EditorSystemComponent.cpp", - "origin": "Code/Source/${Name}EditorSystemComponent.cpp", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}EditorSystemComponent.h", - "origin": "Code/Source/${Name}EditorSystemComponent.h", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}Module.cpp", - "origin": "Code/Source/${Name}Module.cpp", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}ModuleInterface.h", - "origin": "Code/Source/${Name}ModuleInterface.h", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}SystemComponent.cpp", - "origin": "Code/Source/${Name}SystemComponent.cpp", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}SystemComponent.h", - "origin": "Code/Source/${Name}SystemComponent.h", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Tests/${Name}EditorTest.cpp", - "origin": "Code/Tests/${Name}EditorTest.cpp", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Tests/${Name}Test.cpp", - "origin": "Code/Tests/${Name}Test.cpp", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Platform/Android/android_gem.cmake", - "origin": "Platform/Android/android_gem.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Platform/Android/android_gem.json", - "origin": "Platform/Android/android_gem.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/Linux/linux_gem.cmake", - "origin": "Platform/Linux/linux_gem.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Platform/Linux/linux_gem.json", - "origin": "Platform/Linux/linux_gem.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/Mac/mac_gem.cmake", - "origin": "Platform/Mac/mac_gem.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Platform/Mac/mac_gem.json", - "origin": "Platform/Mac/mac_gem.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/Windows/windows_gem.cmake", - "origin": "Platform/Windows/windows_gem.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Platform/Windows/windows_gem.json", - "origin": "Platform/Windows/windows_gem.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/iOS/ios_gem.cmake", - "origin": "Platform/iOS/ios_gem.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Platform/iOS/ios_gem.json", - "origin": "Platform/iOS/ios_gem.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "gem.json", - "origin": "gem.json", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "preview.png", - "origin": "preview.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false } ], "createDirectories": [ { - "dir": "Assets", - "origin": "Assets" + "dir": "Assets" }, { - "dir": "Code", - "origin": "Code" + "dir": "Code" }, { - "dir": "Code/Include", - "origin": "Code/Include" + "dir": "Code/Include" }, { - "dir": "Code/Include/${Name}", - "origin": "Code/Include/${Name}" + "dir": "Code/Include/${Name}" }, { - "dir": "Code/Platform", - "origin": "Code/Platform" + "dir": "Code/Platform" }, { - "dir": "Code/Platform/Android", - "origin": "Code/Platform/Android" + "dir": "Code/Platform/Android" }, { - "dir": "Code/Platform/Linux", - "origin": "Code/Platform/Linux" + "dir": "Code/Platform/Linux" }, { - "dir": "Code/Platform/Mac", - "origin": "Code/Platform/Mac" + "dir": "Code/Platform/Mac" }, { - "dir": "Code/Platform/Windows", - "origin": "Code/Platform/Windows" + "dir": "Code/Platform/Windows" }, { - "dir": "Code/Platform/iOS", - "origin": "Code/Platform/iOS" + "dir": "Code/Platform/iOS" }, { - "dir": "Code/Source", - "origin": "Code/Source" + "dir": "Code/Source" }, { - "dir": "Code/Tests", - "origin": "Code/Tests" + "dir": "Code/Tests" }, { - "dir": "Platform", - "origin": "Platform" + "dir": "Platform" }, { - "dir": "Platform/Android", - "origin": "Platform/Android" + "dir": "Platform/Android" }, { - "dir": "Platform/Linux", - "origin": "Platform/Linux" + "dir": "Platform/Linux" }, { - "dir": "Platform/Mac", - "origin": "Platform/Mac" + "dir": "Platform/Mac" }, { - "dir": "Platform/Windows", - "origin": "Platform/Windows" + "dir": "Platform/Windows" }, { - "dir": "Platform/iOS", - "origin": "Platform/iOS" + "dir": "Platform/iOS" } ] } diff --git a/Templates/DefaultProject/Template/CMakeLists.txt b/Templates/DefaultProject/Template/CMakeLists.txt index ae4bb662a3..420a92948d 100644 --- a/Templates/DefaultProject/Template/CMakeLists.txt +++ b/Templates/DefaultProject/Template/CMakeLists.txt @@ -29,5 +29,4 @@ else() set_property(GLOBAL APPEND PROPERTY LY_PROJECTS_TARGET_NAME ${project_target_name}) - add_subdirectory(Code) endif() diff --git a/Templates/DefaultProject/Template/Code/${NameLower}_files.cmake b/Templates/DefaultProject/Template/Gem/${NameLower}_files.cmake similarity index 100% rename from Templates/DefaultProject/Template/Code/${NameLower}_files.cmake rename to Templates/DefaultProject/Template/Gem/${NameLower}_files.cmake diff --git a/Templates/DefaultProject/Template/Code/${NameLower}_shared_files.cmake b/Templates/DefaultProject/Template/Gem/${NameLower}_shared_files.cmake similarity index 100% rename from Templates/DefaultProject/Template/Code/${NameLower}_shared_files.cmake rename to Templates/DefaultProject/Template/Gem/${NameLower}_shared_files.cmake diff --git a/Templates/MinimalProject/Template/Code/CMakeLists.txt b/Templates/DefaultProject/Template/Gem/CMakeLists.txt similarity index 87% rename from Templates/MinimalProject/Template/Code/CMakeLists.txt rename to Templates/DefaultProject/Template/Gem/CMakeLists.txt index 5e646c0704..fc3eab6535 100644 --- a/Templates/MinimalProject/Template/Code/CMakeLists.txt +++ b/Templates/DefaultProject/Template/Gem/CMakeLists.txt @@ -6,13 +6,17 @@ # # {END_LICENSE} +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + # Currently we are in the ${Name}/Code folder: ${CMAKE_CURRENT_LIST_DIR} # Get the platform specific folder ${pal_dir} for the current folder: ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} -# Note: ly_get_list_relative_pal_filename will take care of the details for us, as this may be a restricted platform +# Note: o3de_pal_dir will take care of the details for us, as this may be a restricted platform # in which case it will see if that platform is present here or in the restricted folder. -# i.e. It could here : ${Name}/Code/Platform/ or +# i.e. It could here : ${Name}/Code/Platform/ or # //${Name}/Code -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${o3de_project_restricted_path} ${o3de_project_path} ${o3de_project_name}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) # Now that we have the platform abstraction layer (PAL) folder for this folder, thats where we will find the # traits for this platform. Traits for a platform are defines for things like whether or not something in this project @@ -71,7 +75,6 @@ ly_create_alias(NAME ${Name}.Servers NAMESPACE Gem TARGETS Gem::${Name}) # Enable the specified list of gems from GEM_FILE or GEMS list for this specific project: ly_enable_gems(PROJECT_NAME ${Name} GEM_FILE enabled_gems.cmake) - if(PAL_TRAIT_BUILD_SERVER_SUPPORTED) # this property causes it to actually make a ServerLauncher. # if you don't want a Server application, you can remove this and the diff --git a/Templates/DefaultProject/Template/Code/Include/${Name}/${Name}Bus.h b/Templates/DefaultProject/Template/Gem/Include/${Name}/${Name}Bus.h similarity index 99% rename from Templates/DefaultProject/Template/Code/Include/${Name}/${Name}Bus.h rename to Templates/DefaultProject/Template/Gem/Include/${Name}/${Name}Bus.h index d09bb2b009..d72b5785c3 100644 --- a/Templates/DefaultProject/Template/Code/Include/${Name}/${Name}Bus.h +++ b/Templates/DefaultProject/Template/Gem/Include/${Name}/${Name}Bus.h @@ -22,7 +22,7 @@ namespace ${SanitizedCppName} virtual ~${SanitizedCppName}Requests() = default; // Put your public methods here }; - + class ${SanitizedCppName}BusTraits : public AZ::EBusTraits { diff --git a/Templates/DefaultProject/Template/Code/Platform/Android/${NameLower}_android_files.cmake b/Templates/DefaultProject/Template/Gem/Platform/Android/${NameLower}_android_files.cmake similarity index 100% rename from Templates/DefaultProject/Template/Code/Platform/Android/${NameLower}_android_files.cmake rename to Templates/DefaultProject/Template/Gem/Platform/Android/${NameLower}_android_files.cmake diff --git a/Templates/DefaultProject/Template/Code/Platform/Android/${NameLower}_shared_android_files.cmake b/Templates/DefaultProject/Template/Gem/Platform/Android/${NameLower}_shared_android_files.cmake similarity index 100% rename from Templates/DefaultProject/Template/Code/Platform/Android/${NameLower}_shared_android_files.cmake rename to Templates/DefaultProject/Template/Gem/Platform/Android/${NameLower}_shared_android_files.cmake diff --git a/Templates/DefaultProject/Template/Code/Platform/Android/PAL_android.cmake b/Templates/DefaultProject/Template/Gem/Platform/Android/PAL_android.cmake similarity index 100% rename from Templates/DefaultProject/Template/Code/Platform/Android/PAL_android.cmake rename to Templates/DefaultProject/Template/Gem/Platform/Android/PAL_android.cmake diff --git a/Templates/DefaultProject/Template/Code/Platform/Linux/${NameLower}_linux_files.cmake b/Templates/DefaultProject/Template/Gem/Platform/Linux/${NameLower}_linux_files.cmake similarity index 100% rename from Templates/DefaultProject/Template/Code/Platform/Linux/${NameLower}_linux_files.cmake rename to Templates/DefaultProject/Template/Gem/Platform/Linux/${NameLower}_linux_files.cmake diff --git a/Templates/DefaultProject/Template/Code/Platform/Linux/${NameLower}_shared_linux_files.cmake b/Templates/DefaultProject/Template/Gem/Platform/Linux/${NameLower}_shared_linux_files.cmake similarity index 100% rename from Templates/DefaultProject/Template/Code/Platform/Linux/${NameLower}_shared_linux_files.cmake rename to Templates/DefaultProject/Template/Gem/Platform/Linux/${NameLower}_shared_linux_files.cmake diff --git a/Templates/DefaultProject/Template/Code/Platform/Linux/PAL_linux.cmake b/Templates/DefaultProject/Template/Gem/Platform/Linux/PAL_linux.cmake similarity index 100% rename from Templates/DefaultProject/Template/Code/Platform/Linux/PAL_linux.cmake rename to Templates/DefaultProject/Template/Gem/Platform/Linux/PAL_linux.cmake diff --git a/Templates/DefaultProject/Template/Code/Platform/Mac/${NameLower}_mac_files.cmake b/Templates/DefaultProject/Template/Gem/Platform/Mac/${NameLower}_mac_files.cmake similarity index 100% rename from Templates/DefaultProject/Template/Code/Platform/Mac/${NameLower}_mac_files.cmake rename to Templates/DefaultProject/Template/Gem/Platform/Mac/${NameLower}_mac_files.cmake diff --git a/Templates/DefaultProject/Template/Code/Platform/Mac/${NameLower}_shared_mac_files.cmake b/Templates/DefaultProject/Template/Gem/Platform/Mac/${NameLower}_shared_mac_files.cmake similarity index 100% rename from Templates/DefaultProject/Template/Code/Platform/Mac/${NameLower}_shared_mac_files.cmake rename to Templates/DefaultProject/Template/Gem/Platform/Mac/${NameLower}_shared_mac_files.cmake diff --git a/Templates/DefaultProject/Template/Code/Platform/Mac/PAL_mac.cmake b/Templates/DefaultProject/Template/Gem/Platform/Mac/PAL_mac.cmake similarity index 100% rename from Templates/DefaultProject/Template/Code/Platform/Mac/PAL_mac.cmake rename to Templates/DefaultProject/Template/Gem/Platform/Mac/PAL_mac.cmake diff --git a/Templates/DefaultProject/Template/Code/Platform/Windows/${NameLower}_shared_windows_files.cmake b/Templates/DefaultProject/Template/Gem/Platform/Windows/${NameLower}_shared_windows_files.cmake similarity index 100% rename from Templates/DefaultProject/Template/Code/Platform/Windows/${NameLower}_shared_windows_files.cmake rename to Templates/DefaultProject/Template/Gem/Platform/Windows/${NameLower}_shared_windows_files.cmake diff --git a/Templates/DefaultProject/Template/Code/Platform/Windows/${NameLower}_windows_files.cmake b/Templates/DefaultProject/Template/Gem/Platform/Windows/${NameLower}_windows_files.cmake similarity index 100% rename from Templates/DefaultProject/Template/Code/Platform/Windows/${NameLower}_windows_files.cmake rename to Templates/DefaultProject/Template/Gem/Platform/Windows/${NameLower}_windows_files.cmake diff --git a/Templates/DefaultProject/Template/Code/Platform/Windows/PAL_windows.cmake b/Templates/DefaultProject/Template/Gem/Platform/Windows/PAL_windows.cmake similarity index 100% rename from Templates/DefaultProject/Template/Code/Platform/Windows/PAL_windows.cmake rename to Templates/DefaultProject/Template/Gem/Platform/Windows/PAL_windows.cmake diff --git a/Templates/DefaultProject/Template/Code/Platform/iOS/${NameLower}_ios_files.cmake b/Templates/DefaultProject/Template/Gem/Platform/iOS/${NameLower}_ios_files.cmake similarity index 100% rename from Templates/DefaultProject/Template/Code/Platform/iOS/${NameLower}_ios_files.cmake rename to Templates/DefaultProject/Template/Gem/Platform/iOS/${NameLower}_ios_files.cmake diff --git a/Templates/DefaultProject/Template/Code/Platform/iOS/${NameLower}_shared_ios_files.cmake b/Templates/DefaultProject/Template/Gem/Platform/iOS/${NameLower}_shared_ios_files.cmake similarity index 100% rename from Templates/DefaultProject/Template/Code/Platform/iOS/${NameLower}_shared_ios_files.cmake rename to Templates/DefaultProject/Template/Gem/Platform/iOS/${NameLower}_shared_ios_files.cmake diff --git a/Templates/DefaultProject/Template/Code/Platform/iOS/PAL_ios.cmake b/Templates/DefaultProject/Template/Gem/Platform/iOS/PAL_ios.cmake similarity index 100% rename from Templates/DefaultProject/Template/Code/Platform/iOS/PAL_ios.cmake rename to Templates/DefaultProject/Template/Gem/Platform/iOS/PAL_ios.cmake diff --git a/Templates/DefaultProject/Template/Code/Source/${Name}Module.cpp b/Templates/DefaultProject/Template/Gem/Source/${Name}Module.cpp similarity index 100% rename from Templates/DefaultProject/Template/Code/Source/${Name}Module.cpp rename to Templates/DefaultProject/Template/Gem/Source/${Name}Module.cpp diff --git a/Templates/DefaultProject/Template/Code/Source/${Name}SystemComponent.cpp b/Templates/DefaultProject/Template/Gem/Source/${Name}SystemComponent.cpp similarity index 99% rename from Templates/DefaultProject/Template/Code/Source/${Name}SystemComponent.cpp rename to Templates/DefaultProject/Template/Gem/Source/${Name}SystemComponent.cpp index cfb6ae3c42..487391c716 100644 --- a/Templates/DefaultProject/Template/Code/Source/${Name}SystemComponent.cpp +++ b/Templates/DefaultProject/Template/Gem/Source/${Name}SystemComponent.cpp @@ -52,7 +52,7 @@ namespace ${SanitizedCppName} void ${SanitizedCppName}SystemComponent::GetDependentServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& dependent) { } - + ${SanitizedCppName}SystemComponent::${SanitizedCppName}SystemComponent() { if (${SanitizedCppName}Interface::Get() == nullptr) diff --git a/Templates/DefaultProject/Template/Code/Source/${Name}SystemComponent.h b/Templates/DefaultProject/Template/Gem/Source/${Name}SystemComponent.h similarity index 100% rename from Templates/DefaultProject/Template/Code/Source/${Name}SystemComponent.h rename to Templates/DefaultProject/Template/Gem/Source/${Name}SystemComponent.h diff --git a/Templates/DefaultProject/Template/Code/enabled_gems.cmake b/Templates/DefaultProject/Template/Gem/enabled_gems.cmake similarity index 100% rename from Templates/DefaultProject/Template/Code/enabled_gems.cmake rename to Templates/DefaultProject/Template/Gem/enabled_gems.cmake diff --git a/Templates/DefaultProject/Template/Gem/gem.json b/Templates/DefaultProject/Template/Gem/gem.json new file mode 100644 index 0000000000..b60f512006 --- /dev/null +++ b/Templates/DefaultProject/Template/Gem/gem.json @@ -0,0 +1,21 @@ +{ + "gem_name": "${Name}", + "display_name": "${Name}", + "license": "What license ${Name} uses goes here: i.e. Apache-2.0 or MIT", + "license_url": "Link to the license web site goes here: i.e. https://opensource.org/licenses/Apache-2.0 Or https://opensource.org/licenses/MIT", + "origin": "The name of the originator goes here. i.e. XYZ Inc.", + "origin_url": "The primary repo for ${Name} goes here: i.e. http://www.mydomain.com", + "type": "", + "summary": "A short description of ${Name}.", + "canonical_tags": [ + "Gem" + ], + "user_tags": [ + "${Name}" + ], + "icon_path": "preview.png", + "requirements": "", + "documentation_url": "", + "dependencies": [ + ] +} diff --git a/Templates/DefaultProject/Template/project.json b/Templates/DefaultProject/Template/project.json index f8d4643ce9..6d1875fcaa 100644 --- a/Templates/DefaultProject/Template/project.json +++ b/Templates/DefaultProject/Template/project.json @@ -2,7 +2,7 @@ "project_name": "${Name}", "project_id": "${ProjectId}", "origin": "The primary repo for ${Name} goes here: i.e. http://www.mydomain.com", - "license": "What license ${Name} uses goes here: i.e. https://opensource.org/licenses/MIT", + "license": "What license ${Name} uses goes here: i.e. https://opensource.org/licenses/Apache-2.0 Or https://opensource.org/licenses/MIT etc.", "display_name": "${Name}", "summary": "A short description of ${Name}.", "canonical_tags": [ @@ -13,5 +13,8 @@ ], "icon_path": "preview.png", "engine": "o3de", - "external_subdirectories": [] + "external_subdirectories": [ + "Gem" + ], + "restricted": "${Name}" } diff --git a/Templates/DefaultProject/template.json b/Templates/DefaultProject/template.json index fcffafcb34..203e1ec4ef 100644 --- a/Templates/DefaultProject/template.json +++ b/Templates/DefaultProject/template.json @@ -1,12 +1,18 @@ { "template_name": "DefaultProject", + "template_restricted_platform_relative_path": "Templates/DefaultProject", "restricted_name": "o3de", - "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": "Standard", - "summary": "This template has everything you need to build a full online 3D game or application.", - "canonical_tags": [], + "restricted_platform_relative_path": "Templates/DefaultProject", + "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", + "license": "Apache-2.0 or MIT", + "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", + "display_name": "Default Project Template", + "summary": "This is the project template that will be used if no project template is specified during project creation.", + "canonical_tags": [ + "Template", + "Project" + ], "user_tags": [ "DefaultProject" ], @@ -14,657 +20,459 @@ "copyFiles": [ { "file": ".gitignore", - "origin": ".gitignore", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "CMakeLists.txt", - "origin": "CMakeLists.txt", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { - "file": "Code/${NameLower}_files.cmake", - "origin": "Code/${NameLower}_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "cmake/EngineFinder.cmake", + "isTemplated": true }, { - "file": "Code/${NameLower}_shared_files.cmake", - "origin": "Code/${NameLower}_shared_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "cmake/CompilerSettings.cmake", + "isTemplated": false }, { - "file": "Code/CMakeLists.txt", - "origin": "Code/CMakeLists.txt", - "isTemplated": true, - "isOptional": false + "file": "cmake/Platform/Linux/CompilerSettings_linux.cmake", + "isTemplated": false }, { - "file": "Code/Include/${Name}/${Name}Bus.h", - "origin": "Code/Include/${Name}/${Name}Bus.h", - "isTemplated": true, - "isOptional": false + "file": "Config/default_aws_resource_mappings.json", + "isTemplated": false }, { - "file": "Code/Platform/Android/${NameLower}_android_files.cmake", - "origin": "Code/Platform/Android/${NameLower}_android_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Config/shader_global_build_options.json", + "isTemplated": false }, { - "file": "Code/Platform/Android/${NameLower}_shared_android_files.cmake", - "origin": "Code/Platform/Android/${NameLower}_shared_android_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/${NameLower}_files.cmake", + "isTemplated": true }, { - "file": "Code/Platform/Android/PAL_android.cmake", - "origin": "Code/Platform/Android/PAL_android.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/${NameLower}_shared_files.cmake", + "isTemplated": true }, { - "file": "Code/Platform/Linux/${NameLower}_linux_files.cmake", - "origin": "Code/Platform/Linux/${NameLower}_linux_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/CMakeLists.txt", + "isTemplated": true }, { - "file": "Code/Platform/Linux/${NameLower}_shared_linux_files.cmake", - "origin": "Code/Platform/Linux/${NameLower}_shared_linux_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Include/${Name}/${Name}Bus.h", + "isTemplated": true }, { - "file": "Code/Platform/Linux/PAL_linux.cmake", - "origin": "Code/Platform/Linux/PAL_linux.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Android/${NameLower}_android_files.cmake", + "isTemplated": false }, { - "file": "Code/Platform/Mac/${NameLower}_mac_files.cmake", - "origin": "Code/Platform/Mac/${NameLower}_mac_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Android/${NameLower}_shared_android_files.cmake", + "isTemplated": false }, { - "file": "Code/Platform/Mac/${NameLower}_shared_mac_files.cmake", - "origin": "Code/Platform/Mac/${NameLower}_shared_mac_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Android/PAL_android.cmake", + "isTemplated": true }, { - "file": "Code/Platform/Mac/PAL_mac.cmake", - "origin": "Code/Platform/Mac/PAL_mac.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Linux/${NameLower}_linux_files.cmake", + "isTemplated": false }, { - "file": "Code/Platform/Windows/${NameLower}_shared_windows_files.cmake", - "origin": "Code/Platform/Windows/${NameLower}_shared_windows_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Linux/${NameLower}_shared_linux_files.cmake", + "isTemplated": false }, { - "file": "Code/Platform/Windows/${NameLower}_windows_files.cmake", - "origin": "Code/Platform/Windows/${NameLower}_windows_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Linux/PAL_linux.cmake", + "isTemplated": true }, { - "file": "Code/Platform/Windows/PAL_windows.cmake", - "origin": "Code/Platform/Windows/PAL_windows.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Mac/${NameLower}_mac_files.cmake", + "isTemplated": false }, { - "file": "Code/Platform/iOS/${NameLower}_ios_files.cmake", - "origin": "Code/Platform/iOS/${NameLower}_ios_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Mac/${NameLower}_shared_mac_files.cmake", + "isTemplated": false }, { - "file": "Code/Platform/iOS/${NameLower}_shared_ios_files.cmake", - "origin": "Code/Platform/iOS/${NameLower}_shared_ios_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Mac/PAL_mac.cmake", + "isTemplated": true }, { - "file": "Code/Platform/iOS/PAL_ios.cmake", - "origin": "Code/Platform/iOS/PAL_ios.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Windows/${NameLower}_shared_windows_files.cmake", + "isTemplated": false }, { - "file": "Code/Source/${Name}Module.cpp", - "origin": "Code/Source/${Name}Module.cpp", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Windows/${NameLower}_windows_files.cmake", + "isTemplated": false }, { - "file": "Code/Source/${Name}SystemComponent.cpp", - "origin": "Code/Source/${Name}SystemComponent.cpp", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Windows/PAL_windows.cmake", + "isTemplated": true }, { - "file": "Code/Source/${Name}SystemComponent.h", - "origin": "Code/Source/${Name}SystemComponent.h", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/iOS/${NameLower}_ios_files.cmake", + "isTemplated": false }, { - "file": "Code/enabled_gems.cmake", - "origin": "Code/enabled_gems.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/iOS/${NameLower}_shared_ios_files.cmake", + "isTemplated": false }, { - "file": "Code/gem.json", - "origin": "Code/gem.json", - "isTemplated": true, - "isOptional": true + "file": "Gem/Platform/iOS/PAL_ios.cmake", + "isTemplated": true }, { - "file": "Config/shader_global_build_options.json", - "origin": "Config/shader_global_build_options.json", - "isTemplated": false, - "isOptional": false + "file": "Gem/Source/${Name}Module.cpp", + "isTemplated": true }, { - "file": "Config/default_aws_resource_mappings.json", - "origin": "Config/default_aws_resource_mappings.json", - "isTemplated": false, - "isOptional": false + "file": "Gem/Source/${Name}SystemComponent.cpp", + "isTemplated": true }, { - "file": "cmake/EngineFinder.cmake", - "origin": "cmake/EngineFinder.cmake", - "isTemplated": false, - "isOptional": false + "file": "Gem/Source/${Name}SystemComponent.h", + "isTemplated": true }, { - "file": "cmake/CompilerSettings.cmake", - "origin": "cmake/CompilerSettings.cmake", - "isTemplated": false, - "isOptional": false + "file": "Gem/enabled_gems.cmake", + "isTemplated": true }, { - "file": "cmake/Platform/Linux/CompilerSettings_linux.cmake", - "origin": "cmake/Platform/Linux/CompilerSettings_linux.cmake", - "isTemplated": false, - "isOptional": false + "file": "Gem/gem.json", + "isTemplated": true }, { "file": "Platform/Android/android_project.cmake", - "origin": "Platform/Android/android_project.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": false }, { "file": "Platform/Android/android_project.json", - "origin": "Platform/Android/android_project.json", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Platform/Linux/linux_project.cmake", - "origin": "Platform/Linux/linux_project.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": false }, { "file": "Platform/Linux/linux_project.json", - "origin": "Platform/Linux/linux_project.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/Mac/mac_project.cmake", - "origin": "Platform/Mac/mac_project.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": false }, { "file": "Platform/Mac/mac_project.json", - "origin": "Platform/Mac/mac_project.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/Windows/windows_project.cmake", - "origin": "Platform/Windows/windows_project.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": false }, { "file": "Platform/Windows/windows_project.json", - "origin": "Platform/Windows/windows_project.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/iOS/ios_project.cmake", - "origin": "Platform/iOS/ios_project.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": false }, { "file": "Platform/iOS/ios_project.json", - "origin": "Platform/iOS/ios_project.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Registry/assets_scan_folders.setreg", - "origin": "Registry/assets_scan_folders.setreg", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Registry/awscoreconfiguration.setreg", - "origin": "Registry/awscoreconfiguration.setreg", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { - "file": "Resources/LegacyLogoLauncher.bmp", - "origin": "Resources/LegacyLogoLauncher.bmp", - "isTemplated": false, - "isOptional": false + "file": "Resources/GameSDK.ico", + "isTemplated": false }, { - "file": "Resources/GameSDK.ico", - "origin": "Resources/GameSDK.ico", - "isTemplated": false, - "isOptional": false + "file": "Resources/LegacyLogoLauncher.bmp", + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/Contents.json", - "origin": "Resources/Platform/Mac/Images.xcassets/Contents.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/Contents.json", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/Contents.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { - "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128_2x.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128_2x.png", - "isTemplated": false, - "isOptional": false + "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128.png", + "isTemplated": false }, { - "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128.png", - "isTemplated": false, - "isOptional": false + "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128_2x.png", + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_16.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_16.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_16_2x.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_16_2x.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { - "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256_2x.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256_2x.png", - "isTemplated": false, - "isOptional": false + "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256.png", + "isTemplated": false }, { - "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256.png", - "isTemplated": false, - "isOptional": false + "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256_2x.png", + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_32.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_32.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_32_2x.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_32_2x.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_512.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_512.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_512_2x.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_512_2x.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/Mac/Info.plist", - "origin": "Resources/Platform/Mac/Info.plist", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Resources/Platform/iOS/Images.xcassets/Contents.json", - "origin": "Resources/Platform/iOS/Images.xcassets/Contents.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/Contents.json", - "origin": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/Contents.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1024x768.png", - "origin": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1024x768.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1536x2048.png", - "origin": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1536x2048.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage2048x1536.png", - "origin": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage2048x1536.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage768x1024.png", - "origin": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage768x1024.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x1136.png", - "origin": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x1136.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x960.png", - "origin": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x960.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/Contents.json", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/Contents.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadAppIcon152x152.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadAppIcon152x152.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadAppIcon76x76.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadAppIcon76x76.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadProAppIcon167x167.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadProAppIcon167x167.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSettingsIcon29x29.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSettingsIcon29x29.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSettingsIcon58x58.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSettingsIcon58x58.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSpotlightIcon40x40.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSpotlightIcon40x40.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSpotlightIcon80x80.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSpotlightIcon80x80.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneAppIcon120x120.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneAppIcon120x120.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneAppIcon180x180.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneAppIcon180x180.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSettingsIcon58x58.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSettingsIcon58x58.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSettingsIcon87x87.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSettingsIcon87x87.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSpotlightIcon120x120.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSpotlightIcon120x120.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSpotlightIcon80x80.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSpotlightIcon80x80.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Info.plist", - "origin": "Resources/Platform/iOS/Info.plist", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "ShaderLib/README.md", - "origin": "ShaderLib/README.md", - "isTemplated": false, - "isOptional": true + "isTemplated": false }, { "file": "ShaderLib/scenesrg.srgi", - "origin": "ShaderLib/scenesrg.srgi", - "isTemplated": true, - "isOptional": false + "isTemplated": false }, { "file": "ShaderLib/viewsrg.srgi", - "origin": "ShaderLib/viewsrg.srgi", - "isTemplated": true, - "isOptional": false + "isTemplated": false }, { "file": "autoexec.cfg", - "origin": "autoexec.cfg", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "game.cfg", - "origin": "game.cfg", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "preview.png", - "origin": "preview.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "project.json", - "origin": "project.json", - "isTemplated": true, - "isOptional": false + "isTemplated": true } ], "createDirectories": [ { - "dir": "Assets", - "origin": "Assets" + "dir": "Assets" + }, + { + "dir": "cmake" + }, + { + "dir": "cmake/Platform" + }, + { + "dir": "cmake/Platform/Linux" }, { - "dir": "Code", - "origin": "Code" + "dir": "Config" }, { - "dir": "Code/Include", - "origin": "Code/Include" + "dir": "Gem" }, { - "dir": "Code/Include/${Name}", - "origin": "Code/Include/${Name}" + "dir": "Gem/Include" }, { - "dir": "Code/Platform", - "origin": "Code/Platform" + "dir": "Gem/Include/${Name}" }, { - "dir": "Code/Platform/Android", - "origin": "Code/Platform/Android" + "dir": "Gem/Platform" }, { - "dir": "Code/Platform/Linux", - "origin": "Code/Platform/Linux" + "dir": "Gem/Platform/Android" }, { - "dir": "Code/Platform/Mac", - "origin": "Code/Platform/Mac" + "dir": "Gem/Platform/Linux" }, { - "dir": "Code/Platform/Windows", - "origin": "Code/Platform/Windows" + "dir": "Gem/Platform/Mac" }, { - "dir": "Code/Platform/iOS", - "origin": "Code/Platform/iOS" + "dir": "Gem/Platform/Windows" }, { - "dir": "Code/Source", - "origin": "Code/Source" + "dir": "Gem/Platform/iOS" }, { - "dir": "Config", - "origin": "Config" + "dir": "Gem/Source" }, { - "dir": "Platform", - "origin": "Platform" + "dir": "Platform" }, { - "dir": "Platform/Android", - "origin": "Platform/Android" + "dir": "Platform/Android" }, { - "dir": "Platform/Linux", - "origin": "Platform/Linux" + "dir": "Platform/Linux" }, { - "dir": "Platform/Mac", - "origin": "Platform/Mac" + "dir": "Platform/Mac" }, { - "dir": "Platform/Windows", - "origin": "Platform/Windows" + "dir": "Platform/Windows" }, { - "dir": "Platform/iOS", - "origin": "Platform/iOS" + "dir": "Platform/iOS" }, { - "dir": "Registry", - "origin": "Registry" + "dir": "Registry" }, { - "dir": "Resources", - "origin": "Resources" + "dir": "Resources" }, { - "dir": "Resources/Platform", - "origin": "Resources/Platform" + "dir": "Resources/Platform" }, { - "dir": "Resources/Platform/Mac", - "origin": "Resources/Platform/Mac" + "dir": "Resources/Platform/Mac" }, { - "dir": "Resources/Platform/Mac/Images.xcassets", - "origin": "Resources/Platform/Mac/Images.xcassets" + "dir": "Resources/Platform/Mac/Images.xcassets" }, { - "dir": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset" + "dir": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset" }, { - "dir": "Resources/Platform/iOS", - "origin": "Resources/Platform/iOS" + "dir": "Resources/Platform/iOS" }, { - "dir": "Resources/Platform/iOS/Images.xcassets", - "origin": "Resources/Platform/iOS/Images.xcassets" + "dir": "Resources/Platform/iOS/Images.xcassets" }, { - "dir": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage", - "origin": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage" + "dir": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage" }, { - "dir": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset" + "dir": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset" }, { - "dir": "ShaderLib", - "origin": "ShaderLib" + "dir": "ShaderLib" }, { - "dir": "Shaders", - "origin": "Shaders" + "dir": "Shaders" }, { - "dir": "Shaders/ShaderResourceGroups", - "origin": "Shaders/ShaderResourceGroups" + "dir": "Shaders/ShaderResourceGroups" } ] } diff --git a/Templates/GemRepo/Template/gem.json b/Templates/GemRepo/Template/gem.json index 292681b2b5..7ba555a127 100644 --- a/Templates/GemRepo/Template/gem.json +++ b/Templates/GemRepo/Template/gem.json @@ -1,19 +1,23 @@ { - "gem_name": "${Name}Gem", - "display_name": "${Name}Gem", - "license": "What license ${Name}Gem uses goes here: i.e. Apache-2.0 Or MIT", - "license_url": "", - "origin": "The primary repo for ${Name}Gem goes here: i.e. http://www.mydomain.com", - "summary": "A short description of ${Name}Gem which is zipped up in an archive named gem.zip in the root of the Gem Repo. Though not required, it is recommended that the sha256 of the gem.zip file should be placed in the sha256 field of this gem.json so the download can be verified.", + "gem_name": "${Name}", + "display_name": "${Name}", + "license": "What license ${Name} uses goes here: i.e. Apache-2.0 or MIT", + "license_url": "Link to the license web site goes here: i.e. https://opensource.org/licenses/Apache-2.0 Or https://opensource.org/licenses/MIT", + "origin": "The name of the originator goes here. i.e. XYZ Inc.", + "origin_url": "The primary repo for ${Name} goes here: i.e. http://www.mydomain.com", + "type": "Code", + "summary": "A short description of ${Name} which is zipped up in an archive named gem.zip in the root of the Gem Repo. Though not required, it is recommended that the sha256 of the gem.zip file be placed in the sha256 field of this gem.json so the download can be verified.", "origin_uri": "${RepoURI}/gem.zip", "sha256": "", - "type": "Code", "canonical_tags": [ "Gem" ], "user_tags": [ - "${Name}Gem" + "${Name}" ], "icon_path": "preview.png", - "requirements": "" + "requirements": "", + "documentation_url": "", + "dependencies": [ + ] } diff --git a/Templates/GemRepo/template.json b/Templates/GemRepo/template.json index 88123a9dae..ca042329be 100644 --- a/Templates/GemRepo/template.json +++ b/Templates/GemRepo/template.json @@ -1,10 +1,14 @@ { "template_name": "GemRepo", - "origin": "The primary repo for GemRepo goes here: i.e. http://www.mydomain.com", - "license": "What license GemRepo uses goes here: i.e. https://opensource.org/licenses/MIT", + "origin_url": "https://github.com/o3de/o3de", + "license": "Apache-2.0 or MIT", + "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "display_name": "GemRepo", "summary": "A Gem Repository that contains a single Gem.", - "canonical_tags": [], + "canonical_tags": [ + "Gem", + "Repo" + ], "user_tags": [ "GemRepo" ], @@ -12,15 +16,11 @@ "copyFiles": [ { "file": "gem.json", - "origin": "gem.json", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "repo.json", - "origin": "repo.json", - "isTemplated": true, - "isOptional": false + "isTemplated": true } ], "createDirectories": [] diff --git a/Templates/MinimalProject/Template/CMakeLists.txt b/Templates/MinimalProject/Template/CMakeLists.txt index ae4bb662a3..420a92948d 100644 --- a/Templates/MinimalProject/Template/CMakeLists.txt +++ b/Templates/MinimalProject/Template/CMakeLists.txt @@ -29,5 +29,4 @@ else() set_property(GLOBAL APPEND PROPERTY LY_PROJECTS_TARGET_NAME ${project_target_name}) - add_subdirectory(Code) endif() diff --git a/Templates/MinimalProject/Template/Code/${NameLower}_files.cmake b/Templates/MinimalProject/Template/Gem/${NameLower}_files.cmake similarity index 100% rename from Templates/MinimalProject/Template/Code/${NameLower}_files.cmake rename to Templates/MinimalProject/Template/Gem/${NameLower}_files.cmake diff --git a/Templates/MinimalProject/Template/Code/${NameLower}_shared_files.cmake b/Templates/MinimalProject/Template/Gem/${NameLower}_shared_files.cmake similarity index 100% rename from Templates/MinimalProject/Template/Code/${NameLower}_shared_files.cmake rename to Templates/MinimalProject/Template/Gem/${NameLower}_shared_files.cmake diff --git a/Templates/DefaultProject/Template/Code/CMakeLists.txt b/Templates/MinimalProject/Template/Gem/CMakeLists.txt similarity index 87% rename from Templates/DefaultProject/Template/Code/CMakeLists.txt rename to Templates/MinimalProject/Template/Gem/CMakeLists.txt index 7bbb9a0852..6b1dcf9172 100644 --- a/Templates/DefaultProject/Template/Code/CMakeLists.txt +++ b/Templates/MinimalProject/Template/Gem/CMakeLists.txt @@ -6,13 +6,17 @@ # # {END_LICENSE} +set(gem_path ${CMAKE_CURRENT_LIST_DIR}) +set(gem_json ${gem_path}/gem.json) +o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) + # Currently we are in the ${Name}/Code folder: ${CMAKE_CURRENT_LIST_DIR} # Get the platform specific folder ${pal_dir} for the current folder: ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} -# Note: ly_get_list_relative_pal_filename will take care of the details for us, as this may be a restricted platform +# Note: o3de_pal_dir will take care of the details for us, as this may be a restricted platform # in which case it will see if that platform is present here or in the restricted folder. -# i.e. It could here : ${Name}/Code/Platform/ or +# i.e. It could here : ${Name}/Code/Platform/ or # //${Name}/Code -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${o3de_project_restricted_path} ${o3de_project_path} ${o3de_project_name}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_parent_relative_path}) # Now that we have the platform abstraction layer (PAL) folder for this folder, thats where we will find the # traits for this platform. Traits for a platform are defines for things like whether or not something in this project @@ -71,6 +75,7 @@ ly_create_alias(NAME ${Name}.Servers NAMESPACE Gem TARGETS Gem::${Name}) # Enable the specified list of gems from GEM_FILE or GEMS list for this specific project: ly_enable_gems(PROJECT_NAME ${Name} GEM_FILE enabled_gems.cmake) + if(PAL_TRAIT_BUILD_SERVER_SUPPORTED) # this property causes it to actually make a ServerLauncher. # if you don't want a Server application, you can remove this and the diff --git a/Templates/MinimalProject/Template/Code/Include/${Name}/${Name}Bus.h b/Templates/MinimalProject/Template/Gem/Include/${Name}/${Name}Bus.h similarity index 100% rename from Templates/MinimalProject/Template/Code/Include/${Name}/${Name}Bus.h rename to Templates/MinimalProject/Template/Gem/Include/${Name}/${Name}Bus.h diff --git a/Templates/MinimalProject/Template/Code/Platform/Android/${NameLower}_android_files.cmake b/Templates/MinimalProject/Template/Gem/Platform/Android/${NameLower}_android_files.cmake similarity index 100% rename from Templates/MinimalProject/Template/Code/Platform/Android/${NameLower}_android_files.cmake rename to Templates/MinimalProject/Template/Gem/Platform/Android/${NameLower}_android_files.cmake diff --git a/Templates/MinimalProject/Template/Code/Platform/Android/${NameLower}_shared_android_files.cmake b/Templates/MinimalProject/Template/Gem/Platform/Android/${NameLower}_shared_android_files.cmake similarity index 100% rename from Templates/MinimalProject/Template/Code/Platform/Android/${NameLower}_shared_android_files.cmake rename to Templates/MinimalProject/Template/Gem/Platform/Android/${NameLower}_shared_android_files.cmake diff --git a/Templates/MinimalProject/Template/Code/Platform/Android/PAL_android.cmake b/Templates/MinimalProject/Template/Gem/Platform/Android/PAL_android.cmake similarity index 100% rename from Templates/MinimalProject/Template/Code/Platform/Android/PAL_android.cmake rename to Templates/MinimalProject/Template/Gem/Platform/Android/PAL_android.cmake diff --git a/Templates/MinimalProject/Template/Code/Platform/Linux/${NameLower}_linux_files.cmake b/Templates/MinimalProject/Template/Gem/Platform/Linux/${NameLower}_linux_files.cmake similarity index 100% rename from Templates/MinimalProject/Template/Code/Platform/Linux/${NameLower}_linux_files.cmake rename to Templates/MinimalProject/Template/Gem/Platform/Linux/${NameLower}_linux_files.cmake diff --git a/Templates/MinimalProject/Template/Code/Platform/Linux/${NameLower}_shared_linux_files.cmake b/Templates/MinimalProject/Template/Gem/Platform/Linux/${NameLower}_shared_linux_files.cmake similarity index 100% rename from Templates/MinimalProject/Template/Code/Platform/Linux/${NameLower}_shared_linux_files.cmake rename to Templates/MinimalProject/Template/Gem/Platform/Linux/${NameLower}_shared_linux_files.cmake diff --git a/Templates/MinimalProject/Template/Code/Platform/Linux/PAL_linux.cmake b/Templates/MinimalProject/Template/Gem/Platform/Linux/PAL_linux.cmake similarity index 100% rename from Templates/MinimalProject/Template/Code/Platform/Linux/PAL_linux.cmake rename to Templates/MinimalProject/Template/Gem/Platform/Linux/PAL_linux.cmake diff --git a/Templates/MinimalProject/Template/Code/Platform/Mac/${NameLower}_mac_files.cmake b/Templates/MinimalProject/Template/Gem/Platform/Mac/${NameLower}_mac_files.cmake similarity index 100% rename from Templates/MinimalProject/Template/Code/Platform/Mac/${NameLower}_mac_files.cmake rename to Templates/MinimalProject/Template/Gem/Platform/Mac/${NameLower}_mac_files.cmake diff --git a/Templates/MinimalProject/Template/Code/Platform/Mac/${NameLower}_shared_mac_files.cmake b/Templates/MinimalProject/Template/Gem/Platform/Mac/${NameLower}_shared_mac_files.cmake similarity index 100% rename from Templates/MinimalProject/Template/Code/Platform/Mac/${NameLower}_shared_mac_files.cmake rename to Templates/MinimalProject/Template/Gem/Platform/Mac/${NameLower}_shared_mac_files.cmake diff --git a/Templates/MinimalProject/Template/Code/Platform/Mac/PAL_mac.cmake b/Templates/MinimalProject/Template/Gem/Platform/Mac/PAL_mac.cmake similarity index 100% rename from Templates/MinimalProject/Template/Code/Platform/Mac/PAL_mac.cmake rename to Templates/MinimalProject/Template/Gem/Platform/Mac/PAL_mac.cmake diff --git a/Templates/MinimalProject/Template/Code/Platform/Windows/${NameLower}_shared_windows_files.cmake b/Templates/MinimalProject/Template/Gem/Platform/Windows/${NameLower}_shared_windows_files.cmake similarity index 100% rename from Templates/MinimalProject/Template/Code/Platform/Windows/${NameLower}_shared_windows_files.cmake rename to Templates/MinimalProject/Template/Gem/Platform/Windows/${NameLower}_shared_windows_files.cmake diff --git a/Templates/MinimalProject/Template/Code/Platform/Windows/${NameLower}_windows_files.cmake b/Templates/MinimalProject/Template/Gem/Platform/Windows/${NameLower}_windows_files.cmake similarity index 100% rename from Templates/MinimalProject/Template/Code/Platform/Windows/${NameLower}_windows_files.cmake rename to Templates/MinimalProject/Template/Gem/Platform/Windows/${NameLower}_windows_files.cmake diff --git a/Templates/MinimalProject/Template/Code/Platform/Windows/PAL_windows.cmake b/Templates/MinimalProject/Template/Gem/Platform/Windows/PAL_windows.cmake similarity index 100% rename from Templates/MinimalProject/Template/Code/Platform/Windows/PAL_windows.cmake rename to Templates/MinimalProject/Template/Gem/Platform/Windows/PAL_windows.cmake diff --git a/Templates/MinimalProject/Template/Code/Platform/iOS/${NameLower}_ios_files.cmake b/Templates/MinimalProject/Template/Gem/Platform/iOS/${NameLower}_ios_files.cmake similarity index 100% rename from Templates/MinimalProject/Template/Code/Platform/iOS/${NameLower}_ios_files.cmake rename to Templates/MinimalProject/Template/Gem/Platform/iOS/${NameLower}_ios_files.cmake diff --git a/Templates/MinimalProject/Template/Code/Platform/iOS/${NameLower}_shared_ios_files.cmake b/Templates/MinimalProject/Template/Gem/Platform/iOS/${NameLower}_shared_ios_files.cmake similarity index 100% rename from Templates/MinimalProject/Template/Code/Platform/iOS/${NameLower}_shared_ios_files.cmake rename to Templates/MinimalProject/Template/Gem/Platform/iOS/${NameLower}_shared_ios_files.cmake diff --git a/Templates/MinimalProject/Template/Code/Platform/iOS/PAL_ios.cmake b/Templates/MinimalProject/Template/Gem/Platform/iOS/PAL_ios.cmake similarity index 100% rename from Templates/MinimalProject/Template/Code/Platform/iOS/PAL_ios.cmake rename to Templates/MinimalProject/Template/Gem/Platform/iOS/PAL_ios.cmake diff --git a/Templates/MinimalProject/Template/Code/Source/${Name}Module.cpp b/Templates/MinimalProject/Template/Gem/Source/${Name}Module.cpp similarity index 100% rename from Templates/MinimalProject/Template/Code/Source/${Name}Module.cpp rename to Templates/MinimalProject/Template/Gem/Source/${Name}Module.cpp diff --git a/Templates/MinimalProject/Template/Code/Source/${Name}SystemComponent.cpp b/Templates/MinimalProject/Template/Gem/Source/${Name}SystemComponent.cpp similarity index 100% rename from Templates/MinimalProject/Template/Code/Source/${Name}SystemComponent.cpp rename to Templates/MinimalProject/Template/Gem/Source/${Name}SystemComponent.cpp diff --git a/Templates/MinimalProject/Template/Code/Source/${Name}SystemComponent.h b/Templates/MinimalProject/Template/Gem/Source/${Name}SystemComponent.h similarity index 100% rename from Templates/MinimalProject/Template/Code/Source/${Name}SystemComponent.h rename to Templates/MinimalProject/Template/Gem/Source/${Name}SystemComponent.h diff --git a/Templates/MinimalProject/Template/Code/enabled_gems.cmake b/Templates/MinimalProject/Template/Gem/enabled_gems.cmake similarity index 100% rename from Templates/MinimalProject/Template/Code/enabled_gems.cmake rename to Templates/MinimalProject/Template/Gem/enabled_gems.cmake diff --git a/Templates/MinimalProject/Template/Gem/gem.json b/Templates/MinimalProject/Template/Gem/gem.json new file mode 100644 index 0000000000..b60f512006 --- /dev/null +++ b/Templates/MinimalProject/Template/Gem/gem.json @@ -0,0 +1,21 @@ +{ + "gem_name": "${Name}", + "display_name": "${Name}", + "license": "What license ${Name} uses goes here: i.e. Apache-2.0 or MIT", + "license_url": "Link to the license web site goes here: i.e. https://opensource.org/licenses/Apache-2.0 Or https://opensource.org/licenses/MIT", + "origin": "The name of the originator goes here. i.e. XYZ Inc.", + "origin_url": "The primary repo for ${Name} goes here: i.e. http://www.mydomain.com", + "type": "", + "summary": "A short description of ${Name}.", + "canonical_tags": [ + "Gem" + ], + "user_tags": [ + "${Name}" + ], + "icon_path": "preview.png", + "requirements": "", + "documentation_url": "", + "dependencies": [ + ] +} diff --git a/Templates/MinimalProject/Template/cmake/CompilerSettings.cmake b/Templates/MinimalProject/Template/cmake/CompilerSettings.cmake index 60bda1d45b..4efaecd60f 100644 --- a/Templates/MinimalProject/Template/cmake/CompilerSettings.cmake +++ b/Templates/MinimalProject/Template/cmake/CompilerSettings.cmake @@ -1,10 +1,10 @@ -# +# {BEGIN_LICENSE} # Copyright (c) Contributors to the Open 3D Engine Project. # For complete copyright and license terms please see the LICENSE at the root of this distribution. # # SPDX-License-Identifier: Apache-2.0 OR MIT # -# +# {END_LICENSE} # File to tweak compiler settings before compiler detection happens (before project() is called) # We dont have PAL enabled at this point, so we can only use pure-CMake variables diff --git a/Templates/MinimalProject/Template/cmake/Platform/Linux/CompilerSettings_linux.cmake b/Templates/MinimalProject/Template/cmake/Platform/Linux/CompilerSettings_linux.cmake index 9bb629c53b..386117873f 100644 --- a/Templates/MinimalProject/Template/cmake/Platform/Linux/CompilerSettings_linux.cmake +++ b/Templates/MinimalProject/Template/cmake/Platform/Linux/CompilerSettings_linux.cmake @@ -1,10 +1,10 @@ -# +# {BEGIN_LICENSE} # Copyright (c) Contributors to the Open 3D Engine Project. # For complete copyright and license terms please see the LICENSE at the root of this distribution. # # SPDX-License-Identifier: Apache-2.0 OR MIT # -# +# {END_LICENSE} if(NOT CMAKE_C_COMPILER AND NOT CMAKE_CXX_COMPILER AND NOT "$ENV{CC}" AND NOT "$ENV{CXX}") set(path_search diff --git a/Templates/MinimalProject/Template/project.json b/Templates/MinimalProject/Template/project.json index f8d4643ce9..a303186a64 100644 --- a/Templates/MinimalProject/Template/project.json +++ b/Templates/MinimalProject/Template/project.json @@ -2,7 +2,7 @@ "project_name": "${Name}", "project_id": "${ProjectId}", "origin": "The primary repo for ${Name} goes here: i.e. http://www.mydomain.com", - "license": "What license ${Name} uses goes here: i.e. https://opensource.org/licenses/MIT", + "license": "What license ${Name} uses goes here: i.e. https://opensource.org/licenses/Apache-2.0 Or https://opensource.org/licenses/MIT etc.", "display_name": "${Name}", "summary": "A short description of ${Name}.", "canonical_tags": [ @@ -13,5 +13,7 @@ ], "icon_path": "preview.png", "engine": "o3de", - "external_subdirectories": [] + "external_subdirectories": [ + "Gem" + ] } diff --git a/Templates/MinimalProject/template.json b/Templates/MinimalProject/template.json index 7d6a4f9b94..4cc3031ff5 100644 --- a/Templates/MinimalProject/template.json +++ b/Templates/MinimalProject/template.json @@ -1,10 +1,18 @@ { "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": "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": [], + "template_restricted_platform_relative_path": "Templates/MinimalProject", + "restricted_name": "o3de", + "restricted_platform_relative_path": "Templates/MinimalProject", + "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", + "license": "Apache-2.0 or MIT", + "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", + "display_name": "Minimal Project Template", + "summary": "Use this project template to create project that is the absolute minimum needed to get started in O3DE.", + "canonical_tags": [ + "Template", + "Project" + ], "user_tags": [ "MinimalProject" ], @@ -12,645 +20,454 @@ "copyFiles": [ { "file": ".gitignore", - "origin": ".gitignore", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "CMakeLists.txt", - "origin": "CMakeLists.txt", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { - "file": "Code/${NameLower}_files.cmake", - "origin": "Code/${NameLower}_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "cmake/EngineFinder.cmake", + "isTemplated": false }, { - "file": "Code/${NameLower}_shared_files.cmake", - "origin": "Code/${NameLower}_shared_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "cmake/CompilerSettings.cmake", + "isTemplated": false }, { - "file": "Code/CMakeLists.txt", - "origin": "Code/CMakeLists.txt", - "isTemplated": true, - "isOptional": false + "file": "cmake/Platform/Linux/CompilerSettings_linux.cmake", + "isTemplated": false }, { - "file": "Code/Include/${Name}/${Name}Bus.h", - "origin": "Code/Include/${Name}/${Name}Bus.h", - "isTemplated": true, - "isOptional": false + "file": "Config/shader_global_build_options.json", + "isTemplated": false }, { - "file": "Code/Platform/Android/${NameLower}_android_files.cmake", - "origin": "Code/Platform/Android/${NameLower}_android_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/${NameLower}_files.cmake", + "isTemplated": true }, { - "file": "Code/Platform/Android/${NameLower}_shared_android_files.cmake", - "origin": "Code/Platform/Android/${NameLower}_shared_android_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/${NameLower}_shared_files.cmake", + "isTemplated": true }, { - "file": "Code/Platform/Android/PAL_android.cmake", - "origin": "Code/Platform/Android/PAL_android.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/CMakeLists.txt", + "isTemplated": true }, { - "file": "Code/Platform/Linux/${NameLower}_linux_files.cmake", - "origin": "Code/Platform/Linux/${NameLower}_linux_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Include/${Name}/${Name}Bus.h", + "isTemplated": true }, { - "file": "Code/Platform/Linux/${NameLower}_shared_linux_files.cmake", - "origin": "Code/Platform/Linux/${NameLower}_shared_linux_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Android/${NameLower}_android_files.cmake", + "isTemplated": true }, { - "file": "Code/Platform/Linux/PAL_linux.cmake", - "origin": "Code/Platform/Linux/PAL_linux.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Android/${NameLower}_shared_android_files.cmake", + "isTemplated": true }, { - "file": "Code/Platform/Mac/${NameLower}_mac_files.cmake", - "origin": "Code/Platform/Mac/${NameLower}_mac_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Android/PAL_android.cmake", + "isTemplated": true }, { - "file": "Code/Platform/Mac/${NameLower}_shared_mac_files.cmake", - "origin": "Code/Platform/Mac/${NameLower}_shared_mac_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Linux/${NameLower}_linux_files.cmake", + "isTemplated": true }, { - "file": "Code/Platform/Mac/PAL_mac.cmake", - "origin": "Code/Platform/Mac/PAL_mac.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Linux/${NameLower}_shared_linux_files.cmake", + "isTemplated": true }, { - "file": "Code/Platform/Windows/${NameLower}_shared_windows_files.cmake", - "origin": "Code/Platform/Windows/${NameLower}_shared_windows_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Linux/PAL_linux.cmake", + "isTemplated": true }, { - "file": "Code/Platform/Windows/${NameLower}_windows_files.cmake", - "origin": "Code/Platform/Windows/${NameLower}_windows_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Mac/${NameLower}_mac_files.cmake", + "isTemplated": true }, { - "file": "Code/Platform/Windows/PAL_windows.cmake", - "origin": "Code/Platform/Windows/PAL_windows.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Mac/${NameLower}_shared_mac_files.cmake", + "isTemplated": true }, { - "file": "Code/Platform/iOS/${NameLower}_ios_files.cmake", - "origin": "Code/Platform/iOS/${NameLower}_ios_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Mac/PAL_mac.cmake", + "isTemplated": true }, { - "file": "Code/Platform/iOS/${NameLower}_shared_ios_files.cmake", - "origin": "Code/Platform/iOS/${NameLower}_shared_ios_files.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Windows/${NameLower}_shared_windows_files.cmake", + "isTemplated": true }, { - "file": "Code/Platform/iOS/PAL_ios.cmake", - "origin": "Code/Platform/iOS/PAL_ios.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Windows/${NameLower}_windows_files.cmake", + "isTemplated": true }, { - "file": "Code/Source/${Name}Module.cpp", - "origin": "Code/Source/${Name}Module.cpp", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/Windows/PAL_windows.cmake", + "isTemplated": true }, { - "file": "Code/Source/${Name}SystemComponent.cpp", - "origin": "Code/Source/${Name}SystemComponent.cpp", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/iOS/${NameLower}_ios_files.cmake", + "isTemplated": true }, { - "file": "Code/Source/${Name}SystemComponent.h", - "origin": "Code/Source/${Name}SystemComponent.h", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/iOS/${NameLower}_shared_ios_files.cmake", + "isTemplated": true }, { - "file": "Code/enabled_gems.cmake", - "origin": "Code/enabled_gems.cmake", - "isTemplated": true, - "isOptional": false + "file": "Gem/Platform/iOS/PAL_ios.cmake", + "isTemplated": true }, { - "file": "Code/gem.json", - "origin": "Code/gem.json", - "isTemplated": true, - "isOptional": true + "file": "Gem/Source/${Name}Module.cpp", + "isTemplated": true }, { - "file": "Config/shader_global_build_options.json", - "origin": "Config/shader_global_build_options.json", - "isTemplated": false, - "isOptional": false + "file": "Gem/Source/${Name}SystemComponent.cpp", + "isTemplated": true }, { - "file": "cmake/EngineFinder.cmake", - "origin": "cmake/EngineFinder.cmake", - "isTemplated": false, - "isOptional": false + "file": "Gem/Source/${Name}SystemComponent.h", + "isTemplated": true }, { - "file": "cmake/CompilerSettings.cmake", - "origin": "cmake/CompilerSettings.cmake", - "isTemplated": false, - "isOptional": false + "file": "Gem/enabled_gems.cmake", + "isTemplated": true }, { - "file": "cmake/Platform/Linux/CompilerSettings_linux.cmake", - "origin": "cmake/Platform/Linux/CompilerSettings_linux.cmake", - "isTemplated": false, - "isOptional": false + "file": "Gem/gem.json", + "isTemplated": true }, { "file": "Platform/Android/android_project.cmake", - "origin": "Platform/Android/android_project.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Platform/Android/android_project.json", - "origin": "Platform/Android/android_project.json", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Platform/Linux/linux_project.cmake", - "origin": "Platform/Linux/linux_project.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Platform/Linux/linux_project.json", - "origin": "Platform/Linux/linux_project.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/Mac/mac_project.cmake", - "origin": "Platform/Mac/mac_project.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Platform/Mac/mac_project.json", - "origin": "Platform/Mac/mac_project.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/Windows/windows_project.cmake", - "origin": "Platform/Windows/windows_project.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Platform/Windows/windows_project.json", - "origin": "Platform/Windows/windows_project.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Platform/iOS/ios_project.cmake", - "origin": "Platform/iOS/ios_project.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Platform/iOS/ios_project.json", - "origin": "Platform/iOS/ios_project.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Registry/assets_scan_folders.setreg", - "origin": "Registry/assets_scan_folders.setreg", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Resources/LegacyLogoLauncher.bmp", - "origin": "Resources/LegacyLogoLauncher.bmp", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/GameSDK.ico", - "origin": "Resources/GameSDK.ico", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/Contents.json", - "origin": "Resources/Platform/Mac/Images.xcassets/Contents.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/Contents.json", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/Contents.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128_2x.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128_2x.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_128.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_16.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_16.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_16_2x.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_16_2x.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256_2x.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256_2x.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_256.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_32.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_32.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_32_2x.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_32_2x.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_512.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_512.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_512_2x.png", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset/icon_512_2x.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/Mac/Info.plist", - "origin": "Resources/Platform/Mac/Info.plist", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Resources/Platform/iOS/Images.xcassets/Contents.json", - "origin": "Resources/Platform/iOS/Images.xcassets/Contents.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/Contents.json", - "origin": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/Contents.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1024x768.png", - "origin": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1024x768.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1536x2048.png", - "origin": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage1536x2048.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage2048x1536.png", - "origin": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage2048x1536.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage768x1024.png", - "origin": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPadLaunchImage768x1024.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x1136.png", - "origin": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x1136.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x960.png", - "origin": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage/iPhoneLaunchImage640x960.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/Contents.json", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/Contents.json", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadAppIcon152x152.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadAppIcon152x152.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadAppIcon76x76.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadAppIcon76x76.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadProAppIcon167x167.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadProAppIcon167x167.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSettingsIcon29x29.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSettingsIcon29x29.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSettingsIcon58x58.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSettingsIcon58x58.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSpotlightIcon40x40.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSpotlightIcon40x40.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSpotlightIcon80x80.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPadSpotlightIcon80x80.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneAppIcon120x120.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneAppIcon120x120.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneAppIcon180x180.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneAppIcon180x180.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSettingsIcon58x58.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSettingsIcon58x58.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSettingsIcon87x87.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSettingsIcon87x87.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSpotlightIcon120x120.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSpotlightIcon120x120.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSpotlightIcon80x80.png", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset/iPhoneSpotlightIcon80x80.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Resources/Platform/iOS/Info.plist", - "origin": "Resources/Platform/iOS/Info.plist", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "ShaderLib/README.md", - "origin": "ShaderLib/README.md", - "isTemplated": false, - "isOptional": true + "isTemplated": false }, { "file": "ShaderLib/scenesrg.srgi", - "origin": "ShaderLib/scenesrg.srgi", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "ShaderLib/viewsrg.srgi", - "origin": "ShaderLib/viewsrg.srgi", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "autoexec.cfg", - "origin": "autoexec.cfg", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "game.cfg", - "origin": "game.cfg", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "preview.png", - "origin": "preview.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "project.json", - "origin": "project.json", - "isTemplated": true, - "isOptional": false + "isTemplated": true } ], "createDirectories": [ { - "dir": "Assets", - "origin": "Assets" + "dir": "Assets" + }, + { + "dir": "cmake" + }, + { + "dir": "cmake/Platform" + }, + { + "dir": "cmake/Platform/Linux" + }, + { + "dir": "Config" }, { - "dir": "Code", - "origin": "Code" + "dir": "Gem" }, { - "dir": "Code/Include", - "origin": "Code/Include" + "dir": "Gem/Include" }, { - "dir": "Code/Include/${Name}", - "origin": "Code/Include/${Name}" + "dir": "Gem/Include/${Name}" }, { - "dir": "Code/Platform", - "origin": "Code/Platform" + "dir": "Gem/Platform" }, { - "dir": "Code/Platform/Android", - "origin": "Code/Platform/Android" + "dir": "Gem/Platform/Android" }, { - "dir": "Code/Platform/Linux", - "origin": "Code/Platform/Linux" + "dir": "Gem/Platform/Linux" }, { - "dir": "Code/Platform/Mac", - "origin": "Code/Platform/Mac" + "dir": "Gem/Platform/Mac" }, { - "dir": "Code/Platform/Windows", - "origin": "Code/Platform/Windows" + "dir": "Gem/Platform/Windows" }, { - "dir": "Code/Platform/iOS", - "origin": "Code/Platform/iOS" + "dir": "Gem/Platform/iOS" }, { - "dir": "Code/Source", - "origin": "Code/Source" + "dir": "Gem/Source" }, { - "dir": "Config", - "origin": "Config" + "dir": "Config" }, { - "dir": "Platform", - "origin": "Platform" + "dir": "Platform" }, { - "dir": "Platform/Android", - "origin": "Platform/Android" + "dir": "Platform/Android" }, { - "dir": "Platform/Linux", - "origin": "Platform/Linux" + "dir": "Platform/Linux" }, { - "dir": "Platform/Mac", - "origin": "Platform/Mac" + "dir": "Platform/Mac" }, { - "dir": "Platform/Windows", - "origin": "Platform/Windows" + "dir": "Platform/Windows" }, { - "dir": "Platform/iOS", - "origin": "Platform/iOS" + "dir": "Platform/iOS" }, { - "dir": "Registry", - "origin": "Registry" + "dir": "Registry" }, { - "dir": "Resources", - "origin": "Resources" + "dir": "Resources" }, { - "dir": "Resources/Platform", - "origin": "Resources/Platform" + "dir": "Resources/Platform" }, { - "dir": "Resources/Platform/Mac", - "origin": "Resources/Platform/Mac" + "dir": "Resources/Platform/Mac" }, { - "dir": "Resources/Platform/Mac/Images.xcassets", - "origin": "Resources/Platform/Mac/Images.xcassets" + "dir": "Resources/Platform/Mac/Images.xcassets" }, { - "dir": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset", - "origin": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset" + "dir": "Resources/Platform/Mac/Images.xcassets/TestDPAppIcon.appiconset" }, { - "dir": "Resources/Platform/iOS", - "origin": "Resources/Platform/iOS" + "dir": "Resources/Platform/iOS" }, { - "dir": "Resources/Platform/iOS/Images.xcassets", - "origin": "Resources/Platform/iOS/Images.xcassets" + "dir": "Resources/Platform/iOS/Images.xcassets" }, { - "dir": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage", - "origin": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage" + "dir": "Resources/Platform/iOS/Images.xcassets/LaunchImage.launchimage" }, { - "dir": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset", - "origin": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset" + "dir": "Resources/Platform/iOS/Images.xcassets/TestDPAppIcon.appiconset" }, { - "dir": "ShaderLib", - "origin": "ShaderLib" + "dir": "ShaderLib" }, { - "dir": "Shaders", - "origin": "Shaders" + "dir": "Shaders" }, { - "dir": "Shaders/ShaderResourceGroups", - "origin": "Shaders/ShaderResourceGroups" + "dir": "Shaders/ShaderResourceGroups" } ] } diff --git a/Templates/PythonToolGem/Template/gem.json b/Templates/PythonToolGem/Template/gem.json index 84f5b65a3e..3164c7b5b8 100644 --- a/Templates/PythonToolGem/Template/gem.json +++ b/Templates/PythonToolGem/Template/gem.json @@ -2,8 +2,9 @@ "gem_name": "${Name}", "display_name": "${Name}", "license": "What license ${Name} uses goes here: i.e. Apache-2.0 Or MIT", - "license_url": "", - "origin": "The primary repo for ${Name} goes here: i.e. http://www.mydomain.com", + "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", + "origin": "The name of the originator goes here. i.e. XYZ Inc.", + "origin_url": "The primary repo for ${Name} goes here: i.e. http://www.mydomain.com", "type": "Code", "summary": "A short description of ${Name}.", "canonical_tags": [ @@ -14,6 +15,7 @@ ], "icon_path": "preview.png", "requirements": "", + "documentation_url": "", "dependencies": [ "QtForPython" ] diff --git a/Templates/PythonToolGem/template.json b/Templates/PythonToolGem/template.json index 6dc68de3fc..3af74eb49f 100644 --- a/Templates/PythonToolGem/template.json +++ b/Templates/PythonToolGem/template.json @@ -1,12 +1,18 @@ { "template_name": "PythonToolGem", + "template_restricted_platform_relative_path": "Templates/PythonToolGem", "restricted_name": "o3de", - "restricted_platform_relative_path": "Templates", - "origin": "The primary repo for PythonToolGem goes here: i.e. http://www.mydomain.com", - "license": "What license PythonToolGem uses goes here: i.e. https://opensource.org/licenses/MIT", + "restricted_platform_relative_path": "Templates/PythonToolGem", + "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", + "license": "Apache-2.0 or MIT", + "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "display_name": "PythonToolGem", "summary": "A gem template for a custom tool in Python that gets registered with the Editor.", - "canonical_tags": [], + "canonical_tags": [ + "Python", + "Gem" + ], "user_tags": [ "PythonToolGem" ], @@ -14,221 +20,153 @@ "copyFiles": [ { "file": ".gitignore", - "origin": ".gitignore", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "CMakeLists.txt", - "origin": "CMakeLists.txt", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/${NameLower}_editor_files.cmake", - "origin": "Code/${NameLower}_editor_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/${NameLower}_editor_shared_files.cmake", - "origin": "Code/${NameLower}_editor_shared_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/${NameLower}_editor_tests_files.cmake", - "origin": "Code/${NameLower}_editor_tests_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/CMakeLists.txt", - "origin": "Code/CMakeLists.txt", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Include/${Name}/${Name}Bus.h", - "origin": "Code/Include/${Name}/${Name}Bus.h", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Linux/${NameLower}_linux_files.cmake", - "origin": "Code/Platform/Linux/${NameLower}_linux_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Linux/${NameLower}_shared_linux_files.cmake", - "origin": "Code/Platform/Linux/${NameLower}_shared_linux_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Linux/PAL_linux.cmake", - "origin": "Code/Platform/Linux/PAL_linux.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Mac/${NameLower}_mac_files.cmake", - "origin": "Code/Platform/Mac/${NameLower}_mac_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Mac/${NameLower}_shared_mac_files.cmake", - "origin": "Code/Platform/Mac/${NameLower}_shared_mac_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Mac/PAL_mac.cmake", - "origin": "Code/Platform/Mac/PAL_mac.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Windows/${NameLower}_shared_windows_files.cmake", - "origin": "Code/Platform/Windows/${NameLower}_shared_windows_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Windows/${NameLower}_windows_files.cmake", - "origin": "Code/Platform/Windows/${NameLower}_windows_files.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Platform/Windows/PAL_windows.cmake", - "origin": "Code/Platform/Windows/PAL_windows.cmake", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}.qrc", - "origin": "Code/Source/${Name}.qrc", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}EditorModule.cpp", - "origin": "Code/Source/${Name}EditorModule.cpp", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}EditorSystemComponent.cpp", - "origin": "Code/Source/${Name}EditorSystemComponent.cpp", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}EditorSystemComponent.h", - "origin": "Code/Source/${Name}EditorSystemComponent.h", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/${Name}ModuleInterface.h", - "origin": "Code/Source/${Name}ModuleInterface.h", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Code/Source/toolbar_icon.svg", - "origin": "Code/Source/toolbar_icon.svg", - "isTemplated": false, - "isOptional": false + "isTemplated": false }, { "file": "Code/Tests/${Name}EditorTest.cpp", - "origin": "Code/Tests/${Name}EditorTest.cpp", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Editor/Scripts/__init__.py", - "origin": "Editor/Scripts/__init__.py", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Editor/Scripts/bootstrap.py", - "origin": "Editor/Scripts/bootstrap.py", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "Editor/Scripts/${NameLower}_dialog.py", - "origin": "Editor/Scripts/${NameLower}_dialog.py", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "gem.json", - "origin": "gem.json", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "preview.png", - "origin": "preview.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false } ], "createDirectories": [ { - "dir": "Assets", - "origin": "Assets" + "dir": "Assets" }, { - "dir": "Code", - "origin": "Code" + "dir": "Code" }, { - "dir": "Editor", - "origin": "Editor" + "dir": "Editor" }, { - "dir": "Editor/Scripts", - "origin": "Editor/Scripts" + "dir": "Editor/Scripts" }, { - "dir": "Code/Include", - "origin": "Code/Include" + "dir": "Code/Include" }, { - "dir": "Code/Include/${Name}", - "origin": "Code/Include/${Name}" + "dir": "Code/Include/${Name}" }, { - "dir": "Code/Platform", - "origin": "Code/Platform" + "dir": "Code/Platform" }, { - "dir": "Code/Platform/Linux", - "origin": "Code/Platform/Linux" + "dir": "Code/Platform/Linux" }, { - "dir": "Code/Platform/Mac", - "origin": "Code/Platform/Mac" + "dir": "Code/Platform/Mac" }, { - "dir": "Code/Platform/Windows", - "origin": "Code/Platform/Windows" + "dir": "Code/Platform/Windows" }, { - "dir": "Code/Source", - "origin": "Code/Source" + "dir": "Code/Source" }, { - "dir": "Code/Tests", - "origin": "Code/Tests" + "dir": "Code/Tests" } ] } diff --git a/cmake/3rdParty.cmake b/cmake/3rdParty.cmake index 7d98c3ea3e..1bea5f4f67 100644 --- a/cmake/3rdParty.cmake +++ b/cmake/3rdParty.cmake @@ -186,7 +186,7 @@ function(ly_add_external_target) endif() # Check if there is a pal file - ly_get_absolute_pal_filename(pal_file ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}/${ly_add_external_target_PACKAGE}_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) + o3de_pal_dir(pal_file ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}/${ly_add_external_target_PACKAGE}_${PAL_PLATFORM_NAME_LOWERCASE}.cmake ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) if(NOT EXISTS ${pal_file}) set(pal_file ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}/${ly_add_external_target_PACKAGE}_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) endif() @@ -357,12 +357,12 @@ endfunction() # Add the 3rdParty folder to find the modules list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/3rdParty) -ly_get_absolute_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/3rdParty/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/3rdParty/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) list(APPEND CMAKE_MODULE_PATH ${pal_dir}) if(NOT INSTALLED_ENGINE) # Add the 3rdParty cmake files to the IDE ly_include_cmake_file_list(cmake/3rdParty/cmake_files.cmake) - ly_get_absolute_pal_filename(pal_3rdparty_dir ${CMAKE_CURRENT_SOURCE_DIR}/cmake/3rdParty/Platform/${PAL_PLATFORM_NAME}) + o3de_pal_dir(pal_3rdparty_dir ${CMAKE_CURRENT_SOURCE_DIR}/cmake/3rdParty/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) ly_include_cmake_file_list(${pal_3rdparty_dir}/cmake_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake) endif() diff --git a/cmake/3rdParty/BuiltInPackages.cmake b/cmake/3rdParty/BuiltInPackages.cmake index 743e2e983e..e81cfffe01 100644 --- a/cmake/3rdParty/BuiltInPackages.cmake +++ b/cmake/3rdParty/BuiltInPackages.cmake @@ -12,9 +12,9 @@ # cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake #include the platform-specific 3rd party packages. -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) -set(LY_PAL_PACKAGE_FILE_NAME ${CMAKE_CURRENT_LIST_DIR}/${pal_dir}/BuiltInPackages_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) +set(LY_PAL_PACKAGE_FILE_NAME ${pal_dir}/BuiltInPackages_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) include(${LY_PAL_PACKAGE_FILE_NAME}) # add the above file to the ALLFILES list, so that they show up in IDEs diff --git a/cmake/3rdPartyPackages.cmake b/cmake/3rdPartyPackages.cmake index a3f15bdb22..f9a72672c0 100644 --- a/cmake/3rdPartyPackages.cmake +++ b/cmake/3rdPartyPackages.cmake @@ -614,7 +614,7 @@ endfunction() # and ensure the path to the package root is added to the find_package search paths. # For example # ly_associate_package(TARGETS zlib PACKAGE_NAME zlib-1.2.8-multiplatform PACKAGE_HASH e6f34b8ac16acf881e3d666ef9fd0c1aee94c3f69283fb6524d35d6f858eebbb) -# - this waill cause it to automatically download and activate this package if it finds a target that +# - this will cause it to automatically download and activate this package if it finds a target that # depends on '3rdParty::zlib' in its runtime or its build time dependency list. # - note that '3rdParty' is implied, do not specify it in the TARGETS list. function(ly_associate_package) @@ -684,6 +684,7 @@ endmacro() # is associated with a package, as above. If it is, it makes sure that the package # is brought into scope (and if necessary, downloaded.) macro(ly_download_associated_package find_library_name) + unset(package_name) ly_get_package_association(${find_library_name} package_name) if (package_name) # it is an associated package. diff --git a/cmake/Configurations.cmake b/cmake/Configurations.cmake index 51dee2f07b..709c81e3d2 100644 --- a/cmake/Configurations.cmake +++ b/cmake/Configurations.cmake @@ -189,5 +189,5 @@ foreach(conf IN LISTS CMAKE_CONFIGURATION_TYPES) endforeach() # flags are defined per platform, follow platform files under Platform//Configurations_.cmake -ly_get_absolute_pal_filename(pal_dir ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) include(${pal_dir}/Configurations_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) diff --git a/cmake/FileUtil.cmake b/cmake/FileUtil.cmake index 4607e14452..5721cf452c 100644 --- a/cmake/FileUtil.cmake +++ b/cmake/FileUtil.cmake @@ -26,8 +26,16 @@ function(ly_include_cmake_file_list file) include(${file}) get_filename_component(file_path "${file}" PATH) if(file_path) - list(TRANSFORM FILES PREPEND ${file_path}/) + foreach(f ${FILES}) + cmake_path(IS_RELATIVE f is_relative) + if(is_relative) + string(PREPEND f ${file_path}/) + endif() + list(APPEND TRANSFORMED_FILES ${f}) + endforeach() + set(FILES ${TRANSFORMED_FILES}) endif() + foreach(f ${FILES}) get_filename_component(absolute_path ${f} ABSOLUTE) if(NOT EXISTS ${absolute_path}) @@ -41,12 +49,19 @@ function(ly_include_cmake_file_list file) list(APPEND UNITY_AUTO_EXCLUSIONS ${f}) endif() endif() - endforeach() + list(APPEND FILES ${file}) # Add the _files.cmake to the list so it shows in the IDE if(file_path) - list(TRANSFORM SKIP_UNITY_BUILD_INCLUSION_FILES PREPEND ${file_path}/) + foreach(f ${SKIP_UNITY_BUILD_INCLUSION_FILES}) + cmake_path(IS_RELATIVE f is_relative) + if(is_relative) + string(PREPEND f ${file_path}/) + endif() + list(APPEND SKIP_UNITY_BUILD_INCLUSION_TRANSFORMED_FILES ${f}) + endforeach() + set(SKIP_UNITY_BUILD_INCLUSION_FILES ${SKIP_UNITY_BUILD_INCLUSION_TRANSFORMED_FILES}) endif() # Check if there are any files to exclude from unity groupings diff --git a/cmake/Install.cmake b/cmake/Install.cmake index b558590b9e..55f56b05e8 100644 --- a/cmake/Install.cmake +++ b/cmake/Install.cmake @@ -30,7 +30,7 @@ function(ly_install) install(CODE "endif()\n" ALL_COMPONENTS) else() install(${ARGN}) - endif() + endif() endfunction() @@ -195,6 +195,6 @@ function(ly_install_run_script SCRIPT) endfunction() if(LY_INSTALL_ENABLED) - ly_get_absolute_pal_filename(pal_dir ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Platform/${PAL_PLATFORM_NAME}) + o3de_pal_dir(pal_dir ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) include(${pal_dir}/Install_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) endif() diff --git a/cmake/LYTestWrappers.cmake b/cmake/LYTestWrappers.cmake index 03146b6045..9f4cd41a47 100644 --- a/cmake/LYTestWrappers.cmake +++ b/cmake/LYTestWrappers.cmake @@ -141,7 +141,7 @@ function(ly_add_test) set(wrapper_file ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}/LYTestWrappers_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) if(NOT EXISTS ${wrapper_file}) - ly_get_absolute_pal_filename(wrapper_file ${wrapper_file}) + o3de_pal_dir(wrapper_file ${wrapper_file} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) endif() include(${wrapper_file}) diff --git a/cmake/LYWrappers.cmake b/cmake/LYWrappers.cmake index d4bf1d7423..a2f4359fd5 100644 --- a/cmake/LYWrappers.cmake +++ b/cmake/LYWrappers.cmake @@ -11,7 +11,7 @@ set(LY_UNITY_BUILD ON CACHE BOOL "UNITY builds") include(CMakeFindDependencyMacro) include(cmake/LyAutoGen.cmake) -ly_get_absolute_pal_filename(pal_dir ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) include(${pal_dir}/LYWrappers_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) # Not all platforms support unity builds diff --git a/cmake/PAL.cmake b/cmake/PAL.cmake index 67ed17b6d4..d0d1ad5396 100644 --- a/cmake/PAL.cmake +++ b/cmake/PAL.cmake @@ -15,67 +15,205 @@ # PAL_PLATFORM_NAME_LOWERCASE: name of the platform in lower case (part of filenames) # -file(GLOB detection_files "cmake/Platform/*/PALDetection_*.cmake") -foreach(detection_file ${detection_files}) - include(${detection_file}) -endforeach() +#! o3de_get_home_path: returns the home path +# +# \arg:o3de_manifest_path returns the path of the manifest +function(o3de_get_home_path o3de_home_path) + # The o3de_manifest.json is in the home directory / .o3de folder + file(TO_CMAKE_PATH "$ENV{USERPROFILE}" home_path) # Windows + if(NOT EXISTS ${home_path}) + file(TO_CMAKE_PATH "$ENV{HOME}" home_path) # Unix + if (NOT EXISTS ${home_path}) + message(FATAL_ERROR "o3de Home path not found") + endif() + endif() + set(${o3de_home_path} ${home_path} PARENT_SCOPE) +endfunction() +#! o3de_get_manifest_path: returns the path to the manifest +# +# \arg:o3de_manifest_path returns the path of the manifest +function(o3de_get_manifest_path o3de_manifest_path) + # The o3de_manifest.json is in the home directory / .o3de folder + o3de_get_home_path(o3de_home_path) + set(${o3de_manifest_path} ${o3de_home_path}/.o3de/o3de_manifest.json PARENT_SCOPE) +endfunction() -#! o3de_restricted_id: Reads the "restricted" key from the o3de manifest +#! o3de_read_manifest: returns the contents of the manifest # -# \arg:o3de_json_file name of the o3de json file to read the "restricted_name" key from -# \arg:restricted returns the restricted association element from an o3de json, otherwise engine 'o3de' is assumed -# \arg:o3de_json_file name of the o3de json file -function(o3de_restricted_id o3de_json_file restricted) - ly_file_read(${o3de_json_file} json_data) - string(JSON restricted_entry ERROR_VARIABLE json_error GET ${json_data} "restricted_name") +# \arg:restricted_subdirs returns the restricted elements from the manifest +function(o3de_read_manifest o3de_manifest_json_data) + #get the manifest path + o3de_get_manifest_path(o3de_manifest_path) + if(EXISTS ${o3de_manifest_path}) + ly_file_read(${o3de_manifest_path} json_data) + set(${o3de_manifest_json_data} ${json_data} PARENT_SCOPE) + endif() +endfunction() + +#! o3de_recurse_gems: returns the gem paths +# +# \arg:object json path +# \arg:gems returns the gems from the external subdirectory elements from the manifest +function(o3de_recurse_gems object_json_path gems) + get_filename_component(object_json_parent_path ${object_json_path} DIRECTORY) + ly_file_read(${object_json_path} json_data) + string(JSON external_subdirectories_count ERROR_VARIABLE json_error LENGTH ${json_data} "external_subdirectories") + if(NOT json_error) + if(external_subdirectories_count GREATER 0) + math(EXPR external_subdirectories_range "${external_subdirectories_count}-1") + foreach(external_subdirectories_index RANGE ${external_subdirectories_range}) + string(JSON external_subdirectories_entry ERROR_VARIABLE json_error GET ${json_data} "external_subdirectories" "${external_subdirectories_index}") + cmake_path(IS_RELATIVE external_subdirectories_entry is_relative) + if(${is_relative}) + cmake_path(ABSOLUTE_PATH external_subdirectories_entry BASE_DIRECTORY ${object_json_parent_path} NORMALIZE OUTPUT_VARIABLE external_subdirectories_entry) + endif() + if(EXISTS ${external_subdirectories_entry}/gem.json) + list(APPEND gem_entries ${external_subdirectories_entry}) + o3de_recurse_gems(${external_subdirectories_entry}/gem.json gem_entries) + endif() + endforeach() + endif() + endif() + set(${gems} ${gem_entries} PARENT_SCOPE) +endfunction() + +#! o3de_find_gem: returns the gem path +# +# \arg:gem_name the gem name to find +# \arg:the path of the gem +function(o3de_find_gem gem_name gem_path) + o3de_get_manifest_path(manifest_path) + if(EXISTS ${manifest_path}) + o3de_recurse_gems(${manifest_path} gems) + endif() + o3de_recurse_gems(${LY_ROOT_FOLDER}/engine.json gems) + foreach(gem ${gems}) + ly_file_read(${gem}/gem.json json_data) + string(JSON gem_json_name ERROR_VARIABLE json_error GET ${json_data} "gem_name") + if(gem_json_name STREQUAL gem_name) + set(${gem_path} ${gem} PARENT_SCOPE) + return() + endif() + endforeach() +endfunction() + +#! o3de_manifest_restricted: returns the manifests restricted paths +# +# \arg:restricted returns the restricted elements from the manifest +function(o3de_manifest_restricted restricted) + #read the manifest + o3de_read_manifest(o3de_manifest_json_data) + string(JSON restricted_count ERROR_VARIABLE json_error LENGTH ${o3de_manifest_json_data} "restricted") if(json_error) # Restricted fields can never be a requirement so no warning is issued return() endif() - if(restricted_entry) - set(${restricted} ${restricted_entry} PARENT_SCOPE) + if(restricted_count GREATER 0) + math(EXPR restricted_range "${restricted_count}-1") + foreach(restricted_index RANGE ${restricted_range}) + string(JSON restricted_entry ERROR_VARIABLE json_error GET ${o3de_manifest_json_data} "restricted" "${restricted_index}") + list(APPEND restricted_entries ${restricted_entry}) + endforeach() endif() + set(${restricted} ${restricted_entries} PARENT_SCOPE) endfunction() -#! o3de_find_restricted_folder: +#! o3de_json_restricted: returns the restricted element from a json # -# \arg:restricted_path returns the path of the o3de restricted folder with name restricted_name -# \arg:restricted_name name of the restricted -function(o3de_find_restricted_folder restricted_name restricted_path) - # Read the restricted path from engine.json if one EXISTS - ly_file_read(${LY_ROOT_FOLDER}/engine.json engine_json_data) - string(JSON restricted_subdirs_count ERROR_VARIABLE engine_json_error LENGTH ${engine_json_data} "restricted") - if(restricted_subdirs_count GREATER 0) - string(JSON restricted_subdir ERROR_VARIABLE engine_json_error GET ${engine_json_data} "restricted" "0") - set(${restricted_path} ${restricted_subdir} PARENT_SCOPE) +# \arg:restricted returns the restricted element of the json +function(o3de_json_restricted json_path restricted) + if(EXISTS ${json_path}) + ly_file_read(${json_path} json_data) + string(JSON restricted_entry ERROR_VARIABLE json_error GET ${json_data} "restricted") + if(json_error) + # Restricted fields can never be a requirement so no warning is issued + return() + endif() + set(${restricted} ${restricted_entry} PARENT_SCOPE) + endif() +endfunction() + +#! o3de_restricted_id: determines the restricted object for this json +# +# Find this objects restricted name. If the object has a "restricted" element +# If it does not have one it inherits its parents "restricted" element if it has one +# If the parent does not have one it inherits its parents parent "restricted" element is it has one and so on... +# We stop looking if the object or parent is in the manifest, as the manifest only has top level objects +# which means they have no children. +# +# \arg:o3de_json_file name of the o3de json file to read the "restricted" key from +# \arg:restricted returns the restricted association element from an o3de json, otherwise its doesnt change anything +# \arg:o3de_json_file name of the o3de json file +function(o3de_restricted_id o3de_json_file restricted parent_relative_path) + # read the passed in o3de json and see if "restricted" is set + o3de_json_restricted(${o3de_json_file} restricted_name) + if(restricted_name) + set(${parent_relative_path} "" PARENT_SCOPE) + set(${restricted} ${restricted_name} PARENT_SCOPE) return() endif() + # This object did not have a "restricted" set, now we must look at the parent + # Stop if this is a top level object + o3de_manifest_restricted(manifest_restricted_paths) + get_filename_component(o3de_json_file_parent ${o3de_json_file} DIRECTORY) + get_filename_component(relative_path ${o3de_json_file_parent} NAME) + get_filename_component(o3de_json_file_parent ${o3de_json_file_parent} DIRECTORY) + if(${o3de_json_file_parent} IN_LIST manifest_restricted_paths) + set(${parent_relative_path} "" PARENT_SCOPE) + set(${restricted} "" PARENT_SCOPE) + return() + endif() - file(TO_CMAKE_PATH "$ENV{USERPROFILE}" home_directory) # Windows - if(NOT EXISTS ${home_directory}) - file(TO_CMAKE_PATH "$ENV{HOME}" home_directory) # Unix - if (NOT EXISTS ${home_directory}) - return() + string(LENGTH ${o3de_json_file_parent} parent_len) + while(parent_len) + if(EXISTS ${o3de_json_file_parent}/engine.json) + o3de_json_restricted(${o3de_json_file_parent}/engine.json restricted_name) + if(restricted_name) + set(${parent_relative_path} ${relative_path} PARENT_SCOPE) + set(${restricted} ${restricted_name} PARENT_SCOPE) + return() + endif() + endif() + if(EXISTS ${o3de_json_file_parent}/project.json) + o3de_json_restricted(${o3de_json_file_parent}/project.json restricted_name) + if(restricted_name) + set(${parent_relative_path} ${relative_path} PARENT_SCOPE) + set(${restricted} ${restricted_name} PARENT_SCOPE) + return() + endif() + endif() + if(EXISTS ${o3de_json_file_parent}/gem.json) + o3de_json_restricted(${o3de_json_file_parent}/gem.json restricted_name) + if(restricted_name) + set(${parent_relative_path} ${relative_path} PARENT_SCOPE) + set(${restricted} ${restricted_name} PARENT_SCOPE) + return() + endif() endif() - endif() - # Examine the o3de manifest file for the list of restricted directories - set(o3de_manifest_path ${home_directory}/.o3de/o3de_manifest.json) - if(EXISTS ${o3de_manifest_path}) - ly_file_read(${o3de_manifest_path} o3de_manifest_json_data) - string(JSON restricted_subdirs_count ERROR_VARIABLE engine_json_error LENGTH ${o3de_manifest_json_data} "restricted") - if(restricted_subdirs_count GREATER 0) - math(EXPR restricted_subdirs_range "${restricted_subdirs_count}-1") - foreach(restricted_subdir_index RANGE ${restricted_subdirs_range}) - string(JSON restricted_subdir ERROR_VARIABLE engine_json_error GET ${o3de_manifest_json_data} "restricted" "${restricted_subdir_index}") - list(APPEND restricted_subdirs ${restricted_subdir}) - endforeach() + if(${o3de_json_file_parent} IN_LIST manifest_restricted_paths) + set(${parent_relative_path} "" PARENT_SCOPE) + set(${restricted} "" PARENT_SCOPE) + return() endif() - endif() + + get_filename_component(parent ${o3de_json_file_parent} NAME) + string(PREPEND relative_path ${parent}/) + get_filename_component(o3de_json_file_parent ${o3de_json_file_parent} DIRECTORY) + string(LENGTH ${o3de_json_file_parent} parent_len) + endwhile() +endfunction() + +#! o3de_find_restricted_folder: +# +# \arg:restricted_path returns the path of the o3de restricted folder using the restricted_name +# \arg:restricted_name name of the restricted +function(o3de_find_restricted_folder restricted_name restricted_path) + o3de_manifest_restricted(restricted_entries) # Iterate over the restricted directories from the manifest file - foreach(restricted_entry ${restricted_subdirs}) + foreach(restricted_entry ${restricted_entries}) set(restricted_json_file ${restricted_entry}/restricted.json) ly_file_read(${restricted_json_file} restricted_json) string(JSON this_restricted_name ERROR_VARIABLE json_error GET ${restricted_json} "restricted_name") @@ -95,30 +233,30 @@ endfunction() # # \arg:o3de_json_file json file to read restricted id from # \arg:restricted_name name of the restricted object -function(o3de_restricted_path o3de_json_file restricted_path) - o3de_restricted_id(${o3de_json_file} restricted_name) +function(o3de_restricted_path o3de_json_file restricted_path parent_relative_path) + o3de_restricted_id(${o3de_json_file} restricted_name parent_relative) + set(${parent_relative_path} ${parent_relative} PARENT_SCOPE) if(restricted_name) o3de_find_restricted_folder(${restricted_name} restricted_folder) if(restricted_folder) set(${restricted_path} ${restricted_folder} PARENT_SCOPE) + else() + get_filename_component(o3de_json_file_parent ${o3de_json_file} DIRECTORY) + set(${restricted_path} ${o3de_json_file_parent}/restricted PARENT_SCOPE) endif() endif() endfunction() -#! read_engine_restricted_path: Locates the restricted path within the engine from a json file -# -# \arg:output_restricted_path returns the path of the o3de restricted folder with name restricted_name -function(read_engine_restricted_path output_restricted_path) - # Set manifest path to path in the user home directory - set(manifest_path ${LY_ROOT_FOLDER}/engine.json) - if(EXISTS ${manifest_path}) - o3de_restricted_path(${manifest_path} read_restricted_path) - set(${output_restricted_path} ${read_restricted_path} PARENT_SCOPE) - endif() -endfunction() +# detect open platforms +file(GLOB detection_files "cmake/Platform/*/PALDetection_*.cmake") +foreach(detection_file ${detection_files}) + include(${detection_file}) +endforeach() -read_engine_restricted_path(O3DE_ENGINE_RESTRICTED_PATH) +# set the O3DE_ENGINE_RESTRICTED_PATH +o3de_restricted_path(${LY_ROOT_FOLDER}/engine.json O3DE_ENGINE_RESTRICTED_PATH engine_has_no_parent) +# detect platforms in the restricted path file(GLOB detection_files ${O3DE_ENGINE_RESTRICTED_PATH}/*/cmake/PALDetection_*.cmake) foreach(detection_file ${detection_files}) include(${detection_file}) @@ -146,21 +284,16 @@ foreach(pal_restricted_file ${pal_restricted_files}) string(TOLOWER ${platform} platform_lower) list(APPEND PAL_RESTRICTED_PLATFORMS ${platform_lower}) endforeach() +list(REMOVE_DUPLICATES PAL_RESTRICTED_PLATFORMS) + ly_set(PAL_RESTRICTED_PLATFORMS ${PAL_RESTRICTED_PLATFORMS}) function(ly_get_absolute_pal_filename out_name in_name) - set(full_name ${in_name}) + message(DEPRECATION "ly_get_list_relative_pal_filename is being deprecated, change your code to use o3de_pal_dir instead.") + # parent relative path is optional if(${ARGC} GREATER 4) - # The object name is used to resolve ambiguities when a PAL directory is requested from - # two different external subdirectory root paths - # Such as if a PAL directory for two root object paths with same relative structure was requested to be Palified - # i.e /Platform//IO and /Platform//IO - # Normally the restricted PAL path for both gems would be "//IO". - # The object name can be used to make this path unique - # "///IO" for gem 1 and - # "///IO" for gem 2 - set(object_name ${ARGV4}) + set(parent_relative_path ${ARGV4}) endif() # The Default object path for path is the LY_ROOT_FOLDER @@ -170,14 +303,30 @@ function(ly_get_absolute_pal_filename out_name in_name) cmake_path(SET object_path NORMALIZE ${ARGV3}) endif() - # The Default restricted object path is the result of the read_engine_restricted_path function + # The default restricted object path is O3DE_ENGINE_RESTRICTED_PATH cmake_path(SET object_restricted_path NORMALIZE "${O3DE_ENGINE_RESTRICTED_PATH}") if(${ARGC} GREATER 2) # The user has supplied an object restricted path cmake_path(SET object_restricted_path NORMALIZE ${ARGV2}) endif() - # The input path must exist in order to form a PAL path + if(${ARGC} GREATER 4) + o3de_pal_dir(abs_name ${in_name} ${object_restricted_path} ${object_path} ${parent_relative_path}) + else() + o3de_pal_dir(abs_name ${in_name} ${object_restricted_path} ${object_path}) + endif() + set(${out_name} ${abs_name} PARENT_SCOPE) +endfunction() + +function(o3de_pal_dir out_name in_name object_restricted_path object_path) #parent_relative_path) + set(full_name ${in_name}) + + # parent relative path is optional + if(${ARGC} GREATER 4) + set(parent_relative_path ${ARGV4}) + endif() + + # The input path must not exist in order to form a restricted PAL path if (NOT EXISTS ${full_name}) # if the file is not in the object path then we cannot determine a PAL file for it cmake_path(IS_PREFIX object_path ${full_name} is_input_path_in_root) @@ -222,7 +371,7 @@ function(ly_get_absolute_pal_filename out_name in_name) if(NOT EXISTS ${candidate_PAL_path}) string(TOLOWER ${candidate_platform_name} candidate_platform_name_lower) if("${candidate_platform_name_lower}" IN_LIST PAL_RESTRICTED_PLATFORMS) - cmake_path(APPEND object_restricted_path ${candidate_platform_name} ${object_name} + cmake_path(APPEND object_restricted_path ${candidate_platform_name} ${parent_relative_path} ${pre_platform_paths} OUTPUT_VARIABLE candidate_PAL_path) endif() endif() @@ -236,17 +385,43 @@ function(ly_get_absolute_pal_filename out_name in_name) endfunction() function(ly_get_list_relative_pal_filename out_name in_name) - ly_get_absolute_pal_filename(abs_name ${in_name} ${ARGN}) + message(DEPRECATION "ly_get_list_relative_pal_filename is being deprecated, change your code to use o3de_pal_dir instead.") + + # parent relative path is optional + if(${ARGC} GREATER 4) + set(parent_relative_path ${ARGV4}) + endif() + + # The Default object path for path is the LY_ROOT_FOLDER + cmake_path(SET object_path NORMALIZE "${LY_ROOT_FOLDER}") + if(${ARGC} GREATER 3) + # The user has supplied an object restricted path, the object path for consideration + cmake_path(SET object_path NORMALIZE ${ARGV3}) + endif() + + # The default restricted object path is O3DE_ENGINE_RESTRICTED_PATH + cmake_path(SET object_restricted_path NORMALIZE "${O3DE_ENGINE_RESTRICTED_PATH}") + if(${ARGC} GREATER 2) + # The user has supplied an object restricted path + cmake_path(SET object_restricted_path NORMALIZE ${ARGV2}) + endif() + + if(${ARGC} GREATER 4) + o3de_pal_dir(abs_name ${in_name} ${object_restricted_path} ${object_path} ${parent_relative_path}) + else() + o3de_pal_dir(abs_name ${in_name} ${object_restricted_path} ${object_path}) + endif() + cmake_path(RELATIVE_PATH abs_name BASE_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} OUTPUT_VARIABLE relative_name) set(${out_name} ${relative_name} PARENT_SCOPE) endfunction() -ly_get_absolute_pal_filename(pal_dir ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_cmake_dir ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) -ly_include_cmake_file_list(${pal_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake) +ly_include_cmake_file_list(${pal_cmake_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake) -include(${pal_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) -include(${pal_dir}/Toolchain_${PAL_PLATFORM_NAME_LOWERCASE}.cmake OPTIONAL) +include(${pal_cmake_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) +include(${pal_cmake_dir}/Toolchain_${PAL_PLATFORM_NAME_LOWERCASE}.cmake OPTIONAL) set(LY_DISABLE_TEST_MODULES FALSE CACHE BOOL "Option to forcibly disable the inclusion of test targets in the build") diff --git a/cmake/PALTools.cmake b/cmake/PALTools.cmake index 2204abf5ae..88e827f9c2 100644 --- a/cmake/PALTools.cmake +++ b/cmake/PALTools.cmake @@ -35,14 +35,14 @@ ly_set(LY_PAL_TOOLS_DEFINES ${LY_PAL_TOOLS_DEFINES}) # Include files to the CMakeFiles project foreach(enabled_platform ${LY_PAL_TOOLS_ENABLED}) string(TOLOWER ${enabled_platform} enabled_platform_lowercase) - ly_get_absolute_pal_filename(pal_dir ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Platform/${enabled_platform}) + o3de_pal_dir(pal_dir ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Platform/${enabled_platform}) ly_include_cmake_file_list(${pal_dir}/pal_tools_${enabled_platform_lowercase}_files.cmake) endforeach() function(ly_get_pal_tool_dirs out_list pal_path) set(pal_paths "") foreach(platform ${LY_PAL_TOOLS_ENABLED}) - ly_get_absolute_pal_filename(path ${pal_path}/${platform}) + o3d_pal_dir(path ${pal_path}/${platform} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) list(APPEND pal_paths ${path}) endforeach() set(${out_list} ${pal_paths} PARENT_SCOPE) diff --git a/cmake/Packaging.cmake b/cmake/Packaging.cmake index ecef5261b1..81409369dc 100644 --- a/cmake/Packaging.cmake +++ b/cmake/Packaging.cmake @@ -73,7 +73,7 @@ set(CPACK_PROJECT_CONFIG_FILE ${CPACK_SOURCE_DIR}/PackagingConfig.cmake) set(CPACK_AUTO_GEN_TAG ${LY_INSTALLER_AUTO_GEN_TAG}) # attempt to apply platform specific settings -ly_get_absolute_pal_filename(pal_dir ${CPACK_SOURCE_DIR}/Platform/${PAL_HOST_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CPACK_SOURCE_DIR}/Platform/${PAL_HOST_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) include(${pal_dir}/Packaging_${PAL_HOST_PLATFORM_NAME_LOWERCASE}.cmake) # if we get here and the generator hasn't been set, then a non fatal error occurred disabling packaging support diff --git a/cmake/Projects.cmake b/cmake/Projects.cmake index 13161c9e0f..c6aa6c382a 100644 --- a/cmake/Projects.cmake +++ b/cmake/Projects.cmake @@ -118,17 +118,27 @@ function(ly_generate_project_build_path_setreg project_real_path) file(GENERATE OUTPUT ${project_user_build_path_setreg_file} CONTENT ${project_build_path_setreg_content}) endfunction() +function(add_gem_json_external_subdirectories gem_path) + set(gem_json_path ${gem_path}/gem.json) + if(EXISTS ${gem_json_path}) + read_json_external_subdirs(gem_external_subdirs ${gem_path}/gem.json) + foreach(gem_external_subdir ${gem_external_subdirs}) + file(REAL_PATH ${gem_external_subdir} real_external_subdir BASE_DIRECTORY ${gem_path}) + set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS ${real_external_subdir}) + add_gem_json_external_subdirectories(${real_external_subdir}) + endforeach() + endif() +endfunction() function(add_project_json_external_subdirectories project_path) set(project_json_path ${project_path}/project.json) if(EXISTS ${project_json_path}) - read_json_external_subdirs(external_subdirs ${project_path}/project.json) - foreach(external_subdir ${external_subdirs}) - file(REAL_PATH ${external_subdir} real_external_subdir BASE_DIRECTORY ${project_path}) - list(APPEND project_external_subdirs ${real_external_subdir}) + read_json_external_subdirs(project_external_subdirs ${project_path}/project.json) + foreach(project_external_subdir ${project_external_subdirs}) + file(REAL_PATH ${project_external_subdir} real_external_subdir BASE_DIRECTORY ${project_path}) + set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS ${real_external_subdir}) + add_gem_json_external_subdirectories(${real_external_subdir}) endforeach() - - set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS ${project_external_subdirs}) endif() endfunction() diff --git a/cmake/RuntimeDependencies.cmake b/cmake/RuntimeDependencies.cmake index 9cc7315b08..d36789791f 100644 --- a/cmake/RuntimeDependencies.cmake +++ b/cmake/RuntimeDependencies.cmake @@ -6,6 +6,6 @@ # # -ly_get_absolute_pal_filename(pal_dir ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) include(${pal_dir}/RuntimeDependencies_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) diff --git a/engine.json b/engine.json index 737ac24fea..51b6738001 100644 --- a/engine.json +++ b/engine.json @@ -1,6 +1,6 @@ { "engine_name": "o3de", - "restricted_name": "o3de", + "restricted": "o3de", "FileVersion": 1, "O3DEVersion": "0.0.0.0", "O3DECopyrightYear": 2021, diff --git a/scripts/o3de/CMakeLists.txt b/scripts/o3de/CMakeLists.txt index 79836305c0..fced0f7727 100644 --- a/scripts/o3de/CMakeLists.txt +++ b/scripts/o3de/CMakeLists.txt @@ -8,7 +8,7 @@ add_subdirectory(tests) -ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${O3DE_ENGINE_RESTRICTED_PATH} ${LY_ROOT_FOLDER}) include(${pal_dir}/o3de_install_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) ly_install_files(FILES ../o3de.py diff --git a/scripts/o3de/o3de/disable_gem.py b/scripts/o3de/o3de/disable_gem.py index 0b0e465d12..eecc765d32 100644 --- a/scripts/o3de/o3de/disable_gem.py +++ b/scripts/o3de/o3de/disable_gem.py @@ -98,9 +98,6 @@ def disable_gem_in_project(gem_name: str = None, def _run_disable_gem_in_project(args: argparse) -> int: - if args.override_home_folder: - manifest.override_home_folder = args.override_home_folder - return disable_gem_in_project(args.gem_name, args.gem_path, args.project_name, @@ -133,9 +130,6 @@ def add_parser_args(parser): help='The cmake enabled gem file in which gem names are to be removed from.' 'If not specified it will assume ') - parser.add_argument('-ohf', '--override-home-folder', type=pathlib.Path, required=False, - help='By default the home folder is the user folder, override it to this folder.') - parser.set_defaults(func=_run_disable_gem_in_project) diff --git a/scripts/o3de/o3de/download.py b/scripts/o3de/o3de/download.py index 8e28561e50..a7d5b56440 100644 --- a/scripts/o3de/o3de/download.py +++ b/scripts/o3de/o3de/download.py @@ -277,9 +277,6 @@ def is_o3de_restricted_update_available(restricted_name: str, local_last_updated return is_o3de_object_update_available(restricted_name, 'restricted_name', local_last_updated) def _run_download(args: argparse) -> int: - if args.override_home_folder: - manifest.override_home_folder = args.override_home_folder - if args.engine_name: return download_engine(args.engine_name, args.dest_path, @@ -331,8 +328,6 @@ def add_parser_args(parser): parser.add_argument('-f', '--force', action='store_true', required=False, default=False, help = 'Force overwrite the current object') - parser.add_argument('-ohf', '--override-home-folder', type=str, required=False, - help='By default the home folder is the user folder, override it to this folder.') parser.set_defaults(func=_run_download) diff --git a/scripts/o3de/o3de/enable_gem.py b/scripts/o3de/o3de/enable_gem.py index fc4dc6e9cf..ea79f6c73f 100644 --- a/scripts/o3de/o3de/enable_gem.py +++ b/scripts/o3de/o3de/enable_gem.py @@ -115,9 +115,6 @@ def enable_gem_in_project(gem_name: str = None, def _run_enable_gem_in_project(args: argparse) -> int: - if args.override_home_folder: - manifest.override_home_folder = args.override_home_folder - return enable_gem_in_project(args.gem_name, args.gem_path, args.project_name, @@ -150,9 +147,6 @@ def add_parser_args(parser): help='The cmake enabled_gem file in which the gem names are specified.' 'If not specified it will assume enabled_gems.cmake') - parser.add_argument('-ohf', '--override-home-folder', type=pathlib.Path, required=False, - help='By default the home folder is the user folder, override it to this folder.') - parser.set_defaults(func=_run_enable_gem_in_project) diff --git a/scripts/o3de/o3de/engine_template.py b/scripts/o3de/o3de/engine_template.py index 6b2e098cf0..d9993fb5d0 100755 --- a/scripts/o3de/o3de/engine_template.py +++ b/scripts/o3de/o3de/engine_template.py @@ -80,10 +80,20 @@ restricted_platforms = { 'Provo', 'Salem', 'Jasper', - 'Paris' + 'Paris', + 'Xenia', + 'Lancaster' } -template_file_name = 'template.json' +O3DE_LICENSE_TEXT = \ + """'# {BEGIN_LICENSE} +# Copyright (c) Contributors to the Open 3D Engine Project. +# For complete copyright and license terms please see the LICENSE at the root of this distribution. +# +# SPDX-License-Identifier: Apache-2.0 OR MIT +# {END_LICENSE} +""" + this_script_parent = pathlib.Path(os.path.dirname(os.path.realpath(__file__))) @@ -165,7 +175,8 @@ def _execute_template_json(json_data: dict, destination_path: pathlib.Path, template_path: pathlib.Path, replacements: list, - keep_license_text: bool = False) -> None: + keep_license_text: bool = False, + keep_restricted_in_instance: bool = False) -> None: # create dirs first # for each createDirectory entry, transform the folder name for create_directory in json_data['createDirectories']: @@ -174,6 +185,18 @@ def _execute_template_json(json_data: dict, # transform the folder name new_dir = _transform(new_dir.as_posix(), replacements, keep_license_text) + new_dir = pathlib.Path(new_dir) + + if not keep_restricted_in_instance and 'Platform' in new_dir.parts: + try: + # the name of the Platform should follow the '/Platform/' + pattern = r'/Platform/(?P[^/:*?\"<>|\r\n]+/?)' + found_platform = re.search(pattern, new_dir.as_posix()).group('Platform') + found_platform = found_platform.replace('/', '') + if found_platform in restricted_platforms: + continue + except Exception as e: + pass # create the folder os.makedirs(new_dir, exist_ok=True) @@ -184,16 +207,23 @@ def _execute_template_json(json_data: dict, # construct the input file name in_file = template_path / 'Template' / copy_file['file'] - # the file can be marked as optional, if it is and it does not exist skip - if copy_file['isOptional'] and copy_file['isOptional'] == 'true': - if not os.path.isfile(in_file): - continue - # construct the output file name out_file = destination_path / copy_file['file'] # transform the output file name out_file = _transform(out_file.as_posix(), replacements, keep_license_text) + out_file = pathlib.Path(out_file) + + if not keep_restricted_in_instance and 'Platform' in out_file.parts: + try: + # the name of the Platform should follow the '/Platform/' + pattern = r'/Platform/(?P[^/:*?\"<>|\r\n]+/?)' + found_platform = re.search(pattern, out_file.as_posix()).group('Platform') + found_platform = found_platform.replace('/', '') + if found_platform in restricted_platforms: + continue + except Exception as e: + pass # if for some reason the output folder for this file was not created above do it now os.makedirs(os.path.dirname(out_file), exist_ok=True) @@ -205,18 +235,20 @@ def _execute_template_json(json_data: dict, shutil.copy(in_file, out_file) -def _execute_restricted_template_json(json_data: dict, +def _execute_restricted_template_json(template_json_data: dict, + json_data: dict, restricted_platform: str, destination_name, - template_name, destination_path: pathlib.Path, destination_restricted_path: pathlib.Path, + template_path: pathlib.Path, template_restricted_path: pathlib.Path, destination_restricted_platform_relative_path: pathlib.Path, template_restricted_platform_relative_path: pathlib.Path, replacements: list, keep_restricted_in_instance: bool = False, keep_license_text: bool = False) -> None: + # if we are not keeping restricted in instance make restricted.json if not present if not keep_restricted_in_instance: restricted_json = destination_restricted_path / 'restricted.json' @@ -227,50 +259,96 @@ def _execute_restricted_template_json(json_data: dict, restricted_json_data.update({"restricted_name": destination_name}) s.write(json.dumps(restricted_json_data, indent=4) + '\n') + ################################################################################### + # for each createDirectories in the template copy any entries in the json_data that are for this platform + for create_directory in template_json_data['createDirectories']: + new_dir = pathlib.Path(create_directory['dir']) + if not keep_restricted_in_instance and 'Platform' in new_dir.parts: + try: + # the name of the Platform should follow the '/Platform/' + pattern = r'/Platform/(?P[^/:*?\"<>|\r\n]+/?)' + found_platform = re.search(pattern, new_dir.as_posix()).group('Platform') + except Exception as e: + pass + else: + found_platform = found_platform.replace('/', '') + if found_platform == restricted_platform: + create_dirs = [] + if 'createDirectories' in json_data.keys(): + create_dirs = json_data['createDirectories'] + create_dirs.append(create_directory) + json_data.update({'createDirectories': create_dirs}) + + # for each copyFiles in the template copy any entries in the json_data that are for this platform + for copy_file in template_json_data['copyFiles']: + new_file = pathlib.Path(copy_file['file']) + if not keep_restricted_in_instance and 'Platform' in new_file.parts: + try: + # the name of the Platform should follow the '/Platform/' + pattern = r'/Platform/(?P[^/:*?\"<>|\r\n]+/?)' + found_platform = re.search(pattern, new_file.as_posix()).group('Platform') + except Exception as e: + pass + else: + found_platform = found_platform.replace('/', '') + if found_platform == restricted_platform: + copy_files = [] + if 'copyFiles' in json_data.keys(): + copy_files = json_data['copyFiles'] + copy_files.append(copy_file) + json_data.update({'copyFiles': copy_files}) + + ################################################################################### + + # every entry is saved in its combined location, so if not keep_restricted_in_instance + # then we need to palify into the restricted folder + # create dirs first # for each createDirectory entry, transform the folder name - for create_directory in json_data['createDirectories']: - # construct the new folder name - new_dir = destination_restricted_path / restricted_platform / destination_restricted_platform_relative_path\ - / destination_name / create_directory['dir'] - if keep_restricted_in_instance: - new_dir = destination_path / create_directory['origin'] + if 'createDirectories' in json_data: + for create_directory in json_data['createDirectories']: + # construct the new folder name + if keep_restricted_in_instance: + new_dir = destination_path / create_directory['dir'] + else: + pal_dir = create_directory['dir'].replace(f'Platform/{restricted_platform}','') + new_dir = destination_restricted_path / restricted_platform / destination_restricted_platform_relative_path / pal_dir - # transform the folder name - new_dir = _transform(new_dir.as_posix(), replacements, keep_license_text) + # transform the folder name + new_dir = _transform(new_dir.as_posix(), replacements, keep_license_text) - # create the folder - os.makedirs(new_dir, exist_ok=True) + # create the folder + os.makedirs(new_dir, exist_ok=True) # for each copyFiles entry, _transformCopy the templated source file into a concrete instance file or # regular copy if not templated - for copy_file in json_data['copyFiles']: - # construct the input file name - in_file = template_restricted_path / restricted_platform / template_restricted_platform_relative_path\ - / template_name / 'Template' / copy_file['file'] + if 'copyFiles' in json_data: + for copy_file in json_data['copyFiles']: + # construct the input file name + if template_restricted_path: + pal_file = copy_file['file'].replace(f'Platform/{restricted_platform}/', '') + in_file = template_restricted_path / restricted_platform / template_restricted_platform_relative_path / 'Template' / pal_file + else: + in_file = template_path / 'Template' / copy_file['file'] - # the file can be marked as optional, if it is and it does not exist skip - if copy_file['isOptional'] and copy_file['isOptional'] == 'true': - if not os.path.isfile(in_file): - continue + # construct the output file name + if keep_restricted_in_instance: + out_file = destination_path / copy_file['file'] + else: + pal_file = copy_file['file'].replace(f'Platform/{restricted_platform}/', '') + out_file = destination_restricted_path / restricted_platform / destination_restricted_platform_relative_path / pal_file - # construct the output file name - out_file = destination_restricted_path / restricted_platform / destination_restricted_platform_relative_path\ - / destination_name / copy_file['file'] - if keep_restricted_in_instance: - out_file = destination_path / copy_file['origin'] + # transform the output file name + out_file = _transform(out_file.as_posix(), replacements, keep_license_text) - # transform the output file name - out_file = _transform(out_file.as_posix(), replacements, keep_license_text) - - # if for some reason the output folder for this file was not created above do it now - os.makedirs(os.path.dirname(out_file), exist_ok=True) + # if for some reason the output folder for this file was not created above do it now + os.makedirs(os.path.dirname(out_file), exist_ok=True) - # if templated _transformCopy the file, if not just copy it - if copy_file['isTemplated']: - _transform_copy(in_file, out_file, replacements, keep_license_text) - else: - shutil.copy(in_file, out_file) + # if templated _transformCopy the file, if not just copy it + if copy_file['isTemplated']: + _transform_copy(in_file, out_file, replacements, keep_license_text) + else: + shutil.copy(in_file, out_file) def _instantiate_template(template_json_data: dict, @@ -309,46 +387,51 @@ def _instantiate_template(template_json_data: dict, :return: 0 for success or non 0 failure code """ # execute the template json + # this will filter out any restricted platforms in the template _execute_template_json(template_json_data, destination_path, template_path, replacements, - keep_license_text) + keep_license_text, + keep_restricted_in_instance) - # execute restricted platform jsons if any - if template_restricted_path: - for restricted_platform in os.listdir(template_restricted_path): - if os.path.isfile(restricted_platform): - continue + # we execute the jason data again if there are any restricted platforms in the main template and + # execute any restricted platform jsons if separate + + for restricted_platform in restricted_platforms: + restricted_json_data = {} + if template_restricted_path: template_restricted_platform = template_restricted_path / restricted_platform - template_restricted_platform_path_rel = template_restricted_platform / template_restricted_platform_relative_path / template_name - platform_json = template_restricted_platform_path_rel / template_file_name + template_restricted_platform_path_rel = template_restricted_platform / template_restricted_platform_relative_path + platform_json = template_restricted_platform_path_rel / 'template.json' if os.path.isfile(platform_json): if not validation.valid_o3de_template_json(platform_json): logger.error(f'Template json {platform_json} is invalid.') return 1 - # load the template json and execute it + # load the template json with open(platform_json, 'r') as s: try: - json_data = json.load(s) + restricted_json_data = json.load(s) except json.JSONDecodeError as e: logger.error(f'Failed to load {platform_json}: ' + str(e)) return 1 - else: - _execute_restricted_template_json(json_data, - restricted_platform, - destination_name, - template_name, - destination_path, - destination_restricted_path, - template_restricted_path, - destination_restricted_platform_relative_path, - template_restricted_platform_relative_path, - replacements, - keep_restricted_in_instance, - keep_license_text) + + # execute for this restricted platform + _execute_restricted_template_json(template_json_data, + restricted_json_data, + restricted_platform, + destination_name, + destination_path, + destination_restricted_path, + template_path, + template_restricted_path, + destination_restricted_platform_relative_path, + template_restricted_platform_relative_path, + replacements, + keep_restricted_in_instance, + keep_license_text) return 0 @@ -365,7 +448,8 @@ def create_template(source_path: pathlib.Path, keep_restricted_in_template: bool = False, keep_license_text: bool = False, replace: list = None, - force: bool = False) -> int: + force: bool = False, + no_register: bool = False) -> int: """ Create a template from a source directory using replacement @@ -391,6 +475,7 @@ def create_template(source_path: pathlib.Path, this controls if you want to keep the license text from the template in the new instance. It is false by default because most people will not want license text in their instances. :param force Overrides existing files even if they exist + :param no_register: whether or not after completion that the new object is registered :return: 0 for success or non 0 failure code """ @@ -401,15 +486,19 @@ def create_template(source_path: pathlib.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 specified, source_name defaults to the last component of the source_path if not source_name: source_name = os.path.basename(source_path) sanitized_source_name = utils.sanitize_identifier_for_cpp(source_name) # if no template path, use default_templates_folder path if not template_path: + logger.info(f'Template path empty. Using source name {source_name}') + template_path = source_name + # if the template_path is not an absolute path, then it default to relative from the default template folder + if not template_path.is_absolute(): default_templates_folder = manifest.get_registered(default_folder='templates') template_path = default_templates_folder / source_name logger.info(f'Template path empty. Using default templates folder {template_path}') @@ -423,7 +512,8 @@ 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') + 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 @@ -434,69 +524,61 @@ def create_template(source_path: pathlib.Path, logger.error(f'Template path cannot be a restricted name. {template_name}') return 1 + # if the source restricted name was given and no source restricted path, look up the restricted name to fill + # in the path if source_restricted_name and not source_restricted_path: source_restricted_path = manifest.get_registered(restricted_name=source_restricted_name) - # source_restricted_path + # if we have a source restricted path, make sure its a real restricted object if source_restricted_path: - if not os.path.isabs(source_restricted_path): - engine_json = manifest.get_this_engine_path() / 'engine.json' - if not validation.valid_o3de_engine_json(engine_json): - logger.error(f"Engine json {engine_json} is not valid.") - return 1 - with open(engine_json) as s: - try: - engine_json_data = json.load(s) - except json.JSONDecodeError as e: - logger.error(f"Failed to read engine json {engine_json}: {str(e)}") - return 1 - try: - engine_restricted = engine_json_data['restricted_name'] - except KeyError as e: - logger.error(f"Engine json {engine_json} restricted not found.") - return 1 - engine_restricted_folder = manifest.get_registered(restricted_name=engine_restricted) - new_source_restricted_path = engine_restricted_folder / source_restricted_path - logger.info(f'Source restricted path {source_restricted_path} not a full path. We must assume this engines' - f' restricted folder {new_source_restricted_path}') - if not os.path.isdir(source_restricted_path): + if not source_restricted_path.is_dir(): logger.error(f'Source restricted path {source_restricted_path} is not a folder.') return 1 + restricted_json = source_restricted_path / 'restricted.json' + if not validation.valid_o3de_restricted_json(restricted_json): + logger.error(f"Restricted json {restricted_json} is not valid.") + return 1 + with open(restricted_json, 'r') as s: + try: + restricted_json_data = json.load(s) + except json.JSONDecodeError as e: + logger.error(f'Failed to load {restricted_json}: ' + str(e)) + return 1 + try: + source_restricted_name = restricted_json_data['restricted_name'] + except KeyError as e: + logger.error(f'Failed to read restricted_name from {restricted_json}') + return 1 + # if the template restricted name was given and no template restricted path, look up the restricted name to fill + # in the path if template_restricted_name and not template_restricted_path: template_restricted_path = manifest.get_registered(restricted_name=template_restricted_name) + # if we dont have a template restricted name then set it to the templates name if not template_restricted_name: template_restricted_name = template_name - # template_restricted_path + # if we have a template restricted path, it must either not exist yet or must be a restricted object already if template_restricted_path: - if not os.path.isabs(template_restricted_path): - default_templates_restricted_folder = manifest.get_registered(restricted_name='templates') - new_template_restricted_path = default_templates_restricted_folder / template_restricted_path - logger.info(f'Template restricted path {template_restricted_path} not a full path. We must assume the' - f' default templates restricted folder {new_template_restricted_path}') - template_restricted_path = new_template_restricted_path - - if os.path.isdir(template_restricted_path): + if template_restricted_path.is_dir(): # see if this is already a restricted path, if it is get the "restricted_name" from the restricted json # so we can set "restricted_name" to it for this template restricted_json = template_restricted_path / 'restricted.json' - if os.path.isfile(restricted_json): - if not validation.valid_o3de_restricted_json(restricted_json): - logger.error(f'{restricted_json} is not valid.') + if not validation.valid_o3de_restricted_json(restricted_json): + logger.error(f'{restricted_json} is not valid.') + return 1 + with open(restricted_json, 'r') as s: + try: + restricted_json_data = json.load(s) + except json.JSONDecodeError as e: + logger.error(f'Failed to load {restricted_json}: ' + str(e)) + return 1 + try: + template_restricted_name = restricted_json_data['restricted_name'] + except KeyError as e: + logger.error(f'Failed to read restricted_name from {restricted_json}') return 1 - with open(restricted_json, 'r') as s: - try: - restricted_json_data = json.load(s) - except json.JSONDecodeError as e: - logger.error(f'Failed to load {restricted_json}: ' + str(e)) - return 1 - try: - template_restricted_name = restricted_json_data['restricted_name'] - except KeyError as e: - logger.error(f'Failed to read restricted_name from {restricted_json}') - return 1 else: os.makedirs(template_restricted_path, exist_ok=True) @@ -610,36 +692,7 @@ def create_template(source_path: pathlib.Path, else: return False, t_data - def _transform_into_template_restricted_filename(s_data: object, - platform: str) -> (bool, object): - """ - Internal function to transform a restricted platform file name into restricted template file name - :param s_data: the input data, this could be file data or file name data - :return: bool: whether or not the returned data MAY need to be transformed to instantiate it - t_data: potentially transformed data 0 for success or non 0 failure code - """ - # copy the src data to the transformed data, then operate only on transformed data - t_data = s_data - - # run all the replacements - for replacement in replacements: - t_data = t_data.replace(replacement[0], replacement[1]) - - # the name of the Platform should follow the '/Platform/{platform}' - t_data = t_data.replace(f"Platform/{platform}", '') - - # we want to send back the transformed data and whether or not this file - # may require transformation when instantiated. So if the input data is not the - # same as the output, then we transformed it which means there may be a transformation - # needed to instance it. - if s_data != t_data: - return True, t_data - else: - return False, t_data - - def _transform_restricted_into_copyfiles_and_createdirs(source_path: pathlib.Path, - restricted_platform: str, - root_abs: pathlib.Path, + def _transform_restricted_into_copyfiles_and_createdirs(root_abs: pathlib.Path, path_abs: pathlib.Path = None) -> None: """ Internal function recursively called to transform any paths files into copyfiles and create dirs relative to @@ -657,70 +710,49 @@ def create_template(source_path: pathlib.Path, # create the absolute entry by joining the path_abs and the entry entry_abs = path_abs / entry + # report what file we are processing so we have a good idea if it breaks on what file it broke on + logger.info(f'Processing file: {entry_abs}') + # create the relative entry by removing the root_abs try: entry_rel = entry_abs.relative_to(root_abs) except ValueError as err: - logger.warning(f'Unable to create relative path: {str(err)}') + logger.fatal(f'Unable to create relative path: {str(err)}') - # report what file we are processing so we have a good idea if it breaks on what file it broke on - logger.info(f'Processing file: {entry_abs}') - - # this is a restricted file, so we need to transform it, unpalify it - # restricted///some/folders/ -> - # /some/folders/Platform// - # - # C:/repo/Lumberyard/restricted/Jasper/TestDP/CMakeLists.txt -> - # C:/repo/Lumberyard/TestDP/Platform/Jasper/CMakeLists.txt - # - _, origin_entry_rel = _transform_into_template(entry_rel.as_posix()) - components = list(origin_entry_rel.parts) - num_components = len(components) - - # see how far along the source path the restricted folder matches - # then hopefully there is a Platform folder, warn if there isn't - before = [] - after = [] - relative = '' - - if os.path.isdir(entry_abs): - for x in range(0, num_components): - relative += f'{components[x]}/' - if os.path.isdir(f'{source_path}/{relative}'): - before.append(components[x]) - else: - after.append(components[x]) - else: - for x in range(0, num_components - 1): - relative += f'{components[x]}/' - if os.path.isdir(f'{source_path}/{relative}'): - before.append(components[x]) - else: - after.append(components[x]) - - after.append(components[num_components - 1]) - - before.append("Platform") - warn_if_not_platform = source_path / pathlib.Path(*before) - before.append(restricted_platform) - before.extend(after) - - origin_entry_rel = pathlib.Path(*before) - - if not os.path.isdir(warn_if_not_platform): - logger.warning( - f'{entry_abs} -> {origin_entry_rel}: Other Platforms not found in {warn_if_not_platform}') - - destination_entry_rel = origin_entry_rel - destination_entry_abs = template_path / 'Template' / origin_entry_rel + # templatize the entry relative into the destination entry relative + _, destination_entry_rel = _transform_into_template(entry_rel.as_posix()) + destination_entry_rel = pathlib.Path(destination_entry_rel) # clean up any relative leading slashes - if origin_entry_rel.as_posix().startswith('/'): - origin_entry_rel = pathlib.Path(origin_entry_rel.as_posix().lstrip('/')) if destination_entry_rel.as_posix().startswith('/'): destination_entry_rel = pathlib.Path(destination_entry_rel.as_posix().lstrip('/')) + if isinstance(destination_entry_rel, pathlib.Path): + destination_entry_rel = destination_entry_rel.as_posix() - # make sure the dst folder may or may not exist yet, make sure it does exist before we transform + if template_restricted_path: + destination_entry_abs = template_restricted_path / restricted_platform / template_restricted_platform_relative_path / 'Template' / destination_entry_rel + destination_entry_rel = pathlib.Path(destination_entry_rel) + first = True + for component in destination_entry_rel.parts: + if first: + first = False + result = pathlib.Path(component) / 'Platform' / restricted_platform + else: + result = result / component + destination_entry_rel = result.as_posix() + else: + destination_entry_rel = pathlib.Path(destination_entry_rel) + first = True + for component in destination_entry_rel.parts: + if first: + first = False + result = pathlib.Path(component) / 'Platform' / restricted_platform + else: + result = result / component + destination_entry_rel = result.as_posix() + destination_entry_abs = template_path / 'Template' / destination_entry_rel + + # the destination folder may or may not exist yet, make sure it does exist before we transform # data into it os.makedirs(os.path.dirname(destination_entry_abs), exist_ok=True) @@ -730,8 +762,8 @@ def create_template(source_path: pathlib.Path, if os.path.isfile(entry_abs): # if this file is a known binary file, there is no transformation needed and just copy it - # if not a known binary file open it and try to transform the data. if it is an unknown binary - # type it will throw and we catch copy + # if not a known binary file open it and try to transform the data. + # if it is an unknown binary type it will throw and we catch copy # if we had no known binary type it would still work, but much slower name, ext = os.path.splitext(entry) if ext in binary_file_ext: @@ -743,7 +775,7 @@ def create_template(source_path: pathlib.Path, source_data = s.read() templated, source_data = _transform_into_template(source_data, _is_cpp_file(entry_abs)) - # if the file type is a file that we expect to fins license header and we don't find any + # if the file type is a file that we expect to find a license header and we don't find any # warn that the we didn't find the license info, this makes it easy to make sure we didn't # miss any files we want to have license info in. if keep_license_text and ext in expect_license_info_ext: @@ -761,19 +793,26 @@ def create_template(source_path: pathlib.Path, shutil.copy(entry_abs, destination_entry_abs) pass - copy_files.append({ - "file": destination_entry_rel, - "origin": origin_entry_rel, - "isTemplated": templated, - "isOptional": False - }) + if keep_restricted_in_template: + copy_files.append({ + "file": destination_entry_rel, + "isTemplated": templated + }) + else: + restricted_platform_entries[restricted_platform]['copyFiles'].append({ + "file": destination_entry_rel, + "isTemplated": templated + }) else: - create_dirs.append({ - "dir": destination_entry_rel, - "origin": origin_entry_rel - }) - _transform_restricted_into_copyfiles_and_createdirs(source_path, restricted_platform, root_abs, - entry_abs) + if keep_restricted_in_template: + create_dirs.append({ + "dir": destination_entry_rel + }) + else: + restricted_platform_entries[restricted_platform]['createDirs'].append({ + "dir": destination_entry_rel + }) + _transform_restricted_into_copyfiles_and_createdirs(root_abs, entry_abs) def _transform_dir_into_copyfiles_and_createdirs(root_abs: pathlib.Path, path_abs: pathlib.Path = None) -> None: @@ -793,18 +832,21 @@ def create_template(source_path: pathlib.Path, # create the absolute entry by joining the path_abs and the entry entry_abs = path_abs / entry + # report what file we are processing so we have a good idea if it breaks on what file it broke on + logger.info(f'Processing file: {entry_abs}') + # create the relative entry by removing the root_abs - entry_rel = entry_abs try: - entry_rel = entry_abs.relative_to(root_abs) + entry_rel = entry_abs.relative_to(root_abs).as_posix() except ValueError as err: - logger.warning(f'Unable to create relative path: {str(err)}') + logger.fatal(f'Unable to create relative path: {str(err)}') - # report what file we are processing so we have a good idea if it breaks on what file it broke on - logger.info(f'Processing file: {entry_abs}') + # templatize the entry relative into the origin entry relative + _, destination_entry_rel = _transform_into_template(entry_rel) + destination_entry_rel = pathlib.Path(destination_entry_rel) - # see if the entry is a platform file, if it is then we save its copyfile data in a platform specific list - # then at the end we can save the restricted ones separately + # see if the entry is a restricted platform file, if it is then we save its copyfile data in a + # platform specific list then at the end we can save the restricted ones separately found_platform = '' platform = False if not keep_restricted_in_template and 'Platform' in entry_abs.parts: @@ -812,7 +854,7 @@ def create_template(source_path: pathlib.Path, try: # the name of the Platform should follow the '/Platform/' pattern = r'/Platform/(?P[^/:*?\"<>|\r\n]+/?)' - found_platform = re.search(pattern, entry_abs).group('Platform') + found_platform = re.search(pattern, entry_abs.as_posix()).group('Platform') found_platform = found_platform.replace('/', '') except Exception as e: pass @@ -831,30 +873,35 @@ def create_template(source_path: pathlib.Path, # Now if we found a platform and still have a found_platform which is a restricted platform # then transform the entry relative name into a dst relative entry name and dst abs entry. # if not then create a normal relative and abs dst entry name - _, origin_entry_rel = _transform_into_template(entry_rel.as_posix()) if platform and found_platform in restricted_platforms: # if we don't have a template restricted path and we found restricted files... warn and skip # the file/dir if not template_restricted_path: - logger.warning("Restricted platform files found!!! {entry_rel}, {found_platform}") + logger.warning("Restricted platform file found!!! {destination_entry_rel}, {found_platform}") continue - _, destination_entry_rel = _transform_into_template_restricted_filename(entry_rel, found_platform) - destination_entry_abs = template_restricted_path / found_platform\ - / template_restricted_platform_relative_path / template_name / 'Template'\ - / destination_entry_rel + + # run all the replacements + for replacement in replacements: + destination_entry_rel = destination_entry_rel.replace(replacement[0], replacement[1]) + + # the name of the Platform should follow the '/Platform/{found_platform}' + destination_entry_rel = destination_entry_rel.replace(f"Platform/{found_platform}", '') + destination_entry_rel = destination_entry_rel.lstrip('/') + + # construct the absolute entry from the relative + if template_restricted_platform_relative_path: + destination_entry_abs = template_restricted_path / found_platform / template_restricted_platform_relative_path / template_name / 'Template' / destination_entry_rel + else: + destination_entry_abs = template_restricted_path / found_platform / 'Template' / destination_entry_rel else: - destination_entry_rel = origin_entry_rel + # construct the absolute entry from the relative destination_entry_abs = template_path / 'Template' / destination_entry_rel # clean up any relative leading slashes - if isinstance(origin_entry_rel, pathlib.Path): - origin_entry_rel = origin_entry_rel.as_posix() - if origin_entry_rel.startswith('/'): - origin_entry_rel = pathlib.Path(origin_entry_rel.lstrip('/')) if isinstance(destination_entry_rel, pathlib.Path): destination_entry_rel = destination_entry_rel.as_posix() if destination_entry_rel.startswith('/'): - destination_entry_rel = pathlib.Path(destination_entry_rel.lstrip('/')) + destination_entry_rel = destination_entry_rel.lstrip('/') # make sure the dst folder may or may not exist yet, make sure it does exist before we transform # data into it @@ -902,29 +949,23 @@ def create_template(source_path: pathlib.Path, if platform and found_platform in restricted_platforms: restricted_platform_entries[found_platform]['copyFiles'].append({ "file": destination_entry_rel, - "origin": origin_entry_rel, - "isTemplated": templated, - "isOptional": False + "isTemplated": templated }) else: copy_files.append({ "file": destination_entry_rel, - "origin": origin_entry_rel, - "isTemplated": templated, - "isOptional": False + "isTemplated": templated }) else: # if the folder was for a restricted platform add the entry to the restricted platform, otherwise add it # to the non restricted if platform and found_platform in restricted_platforms: restricted_platform_entries[found_platform]['createDirs'].append({ - "dir": destination_entry_rel, - "origin": origin_entry_rel + "dir": destination_entry_rel }) else: create_dirs.append({ - "dir": destination_entry_rel, - "origin": origin_entry_rel + "dir": destination_entry_rel }) # recurse using the same root and this folder @@ -937,11 +978,11 @@ def create_template(source_path: pathlib.Path, # when we run the transformation any restricted platforms entries we find will go in here restricted_platform_entries = {} - # Every project will have a unrestricted folder which is src_path_abs which MAY have restricted files in it, and - # each project MAY have a restricted folder which will only have restricted files in them. The process is the + # Every template will have a unrestricted folder which is src_path_abs which MAY have restricted files in it, and + # each template MAY have a restricted folder which will only have restricted files in them. The process is the # same for all of them and the result will be a separation of all restricted files from unrestricted files. We do - # this by running the transformation first over the src path abs and then on each restricted folder for this project - # we find. This will effectively combine all sources then separates all the restricted. + # this by running the transformation first over the src path abs and then on each restricted folder for this + # template we find. This will effectively combine all sources then separates all the restricted. # run the transformation on the src, which may or may not have restricted files _transform_dir_into_copyfiles_and_createdirs(source_path) @@ -950,11 +991,12 @@ def create_template(source_path: pathlib.Path, # run the transformation on each src restricted folder if source_restricted_path: for restricted_platform in os.listdir(source_restricted_path): - restricted_platform_src_path_abs = source_restricted_path / restricted_platform\ - / source_restricted_platform_relative_path / source_name + restricted_platform_src_path_abs = source_restricted_path / restricted_platform \ + / source_restricted_platform_relative_path if os.path.isdir(restricted_platform_src_path_abs): - _transform_restricted_into_copyfiles_and_createdirs(source_path, restricted_platform, - restricted_platform_src_path_abs) + if restricted_platform not in restricted_platform_entries: + restricted_platform_entries.update({restricted_platform: {'copyFiles': [], 'createDirs': []}}) + _transform_restricted_into_copyfiles_and_createdirs(restricted_platform_src_path_abs) # sort copy_files.sort(key=lambda x: x['file']) @@ -972,39 +1014,47 @@ def create_template(source_path: pathlib.Path, json_data.update({'canonical_tags': []}) json_data.update({'user_tags': [f"{template_name}"]}) json_data.update({'icon_path': "preview.png"}) - if template_restricted_path: + if not keep_restricted_in_template and template_restricted_path: json_data.update({'restricted_name': template_restricted_name}) if template_restricted_platform_relative_path != '': - json_data.update({'template_restricted_platform_relative_path': template_restricted_platform_relative_path}) + json_data.update({'template_restricted_platform_relative_path': template_restricted_platform_relative_path.as_posix()}) json_data.update({'copyFiles': copy_files}) json_data.update({'createDirectories': create_dirs}) - json_name = template_path / template_file_name + json_name = template_path / source_restricted_platform_relative_path / 'template.json' with json_name.open('w') as s: s.write(json.dumps(json_data, indent=4) + '\n') # copy the default preview.png preview_png_src = this_script_parent / 'resources' / 'preview.png' - preview_png_dst = template_path / 'Template' / 'preview.png' + preview_png_dst = template_path / 'preview.png' if not os.path.isfile(preview_png_dst): shutil.copy(preview_png_src, preview_png_dst) # if no restricted template path was given and restricted platform files were found - if not template_restricted_path and len(restricted_platform_entries): + if not keep_restricted_in_template and not template_restricted_path and len(restricted_platform_entries): logger.info(f'Restricted platform files found!!! and no template restricted path was found...') - if template_restricted_path: + if not keep_restricted_in_template and template_restricted_path: + json_name = template_restricted_path / 'restricted.json' + if not json_name.is_file(): + json_data = {} + json_data.update({'restricted_name': template_restricted_name}) + os.makedirs(os.path.dirname(json_name), exist_ok=True) + + with json_name.open('w') as s: + s.write(json.dumps(json_data, indent=4) + '\n') + # now write out each restricted platform template json separately for restricted_platform in restricted_platform_entries: - restricted_template_path = template_restricted_path / restricted_platform\ - / template_restricted_platform_relative_path / template_name - + restricted_template_path = template_restricted_path / restricted_platform / template_restricted_platform_relative_path # sort restricted_platform_entries[restricted_platform]['copyFiles'].sort(key=lambda x: x['file']) restricted_platform_entries[restricted_platform]['createDirs'].sort(key=lambda x: x['dir']) json_data = {} + json_data.update({'restricted_name': template_name}) json_data.update({'template_name': template_name}) json_data.update( {'origin': f'The primary repo for {template_name} goes here: i.e. http://www.mydomain.com'}) @@ -1012,23 +1062,25 @@ def create_template(source_path: pathlib.Path, {'license': f'What license {template_name} uses goes here: i.e. https://opensource.org/licenses/MIT'}) json_data.update({'display_name': template_name}) json_data.update({'summary': f"A short description of {template_name}."}) - json_data.update({'canonical_tags': []}) + json_data.update({'canonical_tags': [f'{restricted_platform}']}) json_data.update({'user_tags': [f'{template_name}']}) - json_data.update({'icon_path': "preview.png"}) json_data.update({'copyFiles': restricted_platform_entries[restricted_platform]['copyFiles']}) json_data.update({'createDirectories': restricted_platform_entries[restricted_platform]['createDirs']}) - json_name = restricted_template_path / template_file_name + json_name = restricted_template_path / 'template.json' os.makedirs(os.path.dirname(json_name), exist_ok=True) with json_name.open('w') as s: s.write(json.dumps(json_data, indent=4) + '\n') - preview_png_dst = restricted_template_path / 'Template' /' preview.png' - if not os.path.isfile(preview_png_dst): - shutil.copy(preview_png_src, preview_png_dst) + # Register the restricted + if not no_register: + if register.register(restricted_path=template_restricted_path): + logger.error(f'Failed to register the restricted {template_restricted_path}.') + return 1 - return 0 + # Register the template + return register.register(template_path=template_path) if not no_register else 0 def create_from_template(destination_path: pathlib.Path, @@ -1044,7 +1096,8 @@ def create_from_template(destination_path: pathlib.Path, keep_restricted_in_instance: bool = False, keep_license_text: bool = False, replace: list = None, - force: bool = False) -> int: + force: bool = False, + no_register: bool = False) -> int: """ Generic template instantiation for non o3de object templates. This function makes NO assumptions! Assumptions are made only for specializations like create_project or create_gem etc... So this function @@ -1251,17 +1304,18 @@ def create_from_template(destination_path: pathlib.Path, # destination restricted path elif destination_restricted_path: - if os.path.isabs(destination_restricted_path): + if not os.path.isabs(destination_restricted_path): restricted_default_path = manifest.get_registered(default_folder='restricted') - new_destination_restricted_path = restricted_default_path / destination_restricted_path + new_destination_restricted_path = restricted_default_path / "Templates" / destination_restricted_path logger.info(f'{destination_restricted_path} is not a full path, making it relative' f' to default restricted path = {new_destination_restricted_path}') destination_restricted_path = new_destination_restricted_path - elif template_restricted_path: - restricted_default_path = manifest.get_registered(restricted_name='restricted') - logger.info(f'--destination-restricted-path is not specified, using default restricted path / destination name' - f' = {restricted_default_path}') - destination_restricted_path = restricted_default_path + else: + restricted_default_path = manifest.get_registered(default_folder='restricted') + new_destination_restricted_path = restricted_default_path / "Templates" / destination_name + logger.info(f'--destination-restricted-path is not specified, using default restricted path' + f' / Templates / destination name = {new_destination_restricted_path}') + destination_restricted_path = new_destination_restricted_path # destination restricted relative if not destination_restricted_platform_relative_path: @@ -1306,7 +1360,7 @@ def create_from_template(destination_path: pathlib.Path, if destination_restricted_path: os.makedirs(destination_restricted_path, exist_ok=True) - # read the restricted_name from the destination restricted.json + # write the restricted_name to the destination restricted.json restricted_json = destination_restricted_path / 'restricted.json' if not os.path.isfile(restricted_json): with open(restricted_json, 'w') as s: @@ -1314,6 +1368,12 @@ def create_from_template(destination_path: pathlib.Path, restricted_json_data.update({'restricted_name': destination_name}) s.write(json.dumps(restricted_json_data, indent=4) + '\n') + # Register the restricted + if not no_register: + if register.register(restricted_path=destination_restricted_path): + logger.error(f'Failed to register the restricted {destination_restricted_path}.') + return 1 + logger.warning(f'Instantiation successful. NOTE: This is a generic instantiation of the template. If this' f' was a template of an o3de object like a project, gem, template, etc. then the create-project' f' or create-gem command can be used to register the object type via its project.json or gem.json, etc.' @@ -1364,6 +1424,7 @@ def create_project(project_path: pathlib.Path, Ex. ${Name},TestGem,${Player},TestGemPlayer This will cause all references to ${Name} be replaced by TestGem, and all ${Player} replaced by 'TestGemPlayer' :param force Overrides existing files even if they exist + :param no_register: whether or not after completion that the new object is registered :param system_component_class_id: optionally specify a uuid for the system component class, default is random uuid :param editor_system_component_class_id: optionally specify a uuid for the editor system component class, default is random uuid @@ -1422,12 +1483,10 @@ def create_project(project_path: pathlib.Path, # see if the template itself specifies a restricted name if not template_restricted_name and not template_restricted_path: try: - template_json_restricted_name = template_json_data['restricted_name'] + template_restricted_name = template_json_data['restricted_name'] except KeyError as e: # the template json doesn't have a 'restricted_name' element warn and use it logger.info(f'The template does not specify a "restricted_name".') - else: - template_restricted_name = template_json_restricted_name # if no restricted name or path we continue on as if there is no template restricted files. if template_restricted_name or template_restricted_path: @@ -1523,8 +1582,13 @@ def create_project(project_path: pathlib.Path, if not project_path: logger.error('Project path cannot be empty.') return 1 - project_path = project_path.resolve() + if not os.path.isabs(project_path): + default_projects_folder = manifest.get_registered(default_folder='projects') + new_project_path = default_projects_folder / project_path + logger.info(f'Project Path {project_path} is not a full path, we must assume its relative' + f' to default projects path = {new_project_path}') + project_path = new_project_path if not force and project_path.is_dir() and len(list(project_path.iterdir())): logger.error(f'Project path {project_path} already exists and is not empty.') return 1 @@ -1536,7 +1600,8 @@ def create_project(project_path: pathlib.Path, project_name = os.path.basename(project_path) if not utils.validate_identifier(project_name): - logger.error(f'Project name must be fewer than 64 characters, contain only alphanumeric, "_" or "-" characters, and start with a letter. {project_name}') + logger.error( + f'Project name must be fewer than 64 characters, contain only alphanumeric, "_" or "-" characters, and start with a letter. {project_name}') return 1 # project name cannot be the same as a restricted platform name @@ -1546,21 +1611,19 @@ def create_project(project_path: pathlib.Path, # project restricted name if project_restricted_name and not project_restricted_path: - project_restricted_path = manifest.get_registered(restricted_name=project_restricted_name) + gem_restricted_path = manifest.get_registered(restricted_name=project_restricted_name) + if not gem_restricted_path: + logger.error(f'Project Restricted Name {project_restricted_name} cannot be found.') + return 1 # project restricted path - elif project_restricted_path: + if project_restricted_path: if not os.path.isabs(project_restricted_path): - default_projects_restricted_folder = manifest.get_registered(restricted_name='projects') - new_project_restricted_path = default_projects_restricted_folder/ project_restricted_path - logger.info(f'Project restricted path {project_restricted_path} is not a full path, we must assume its' - f' relative to default projects restricted path = {new_project_restricted_path}') - project_restricted_path = new_project_restricted_path - elif template_restricted_path: - project_restricted_default_path = manifest.get_registered(restricted_name='projects') - logger.info(f'--project-restricted-path is not specified, using default project restricted path / project name' - f' = {project_restricted_default_path}') - project_restricted_path = project_restricted_default_path + logger.error(f'Project Restricted Path {project_restricted_path} is not an absolute path.') + return 1 + # neither put it in the default restricted projects + else: + project_restricted_path = manifest.get_o3de_restricted_folder() / 'Projects' / project_name # project restricted relative path if not project_restricted_platform_relative_path: @@ -1639,7 +1702,7 @@ def create_project(project_path: pathlib.Path, os.makedirs(project_restricted_path, exist_ok=True) # read the restricted_name from the projects restricted.json - restricted_json = project_restricted_path / 'restricted.json' + restricted_json = project_restricted_path / 'restricted.json' if os.path.isfile(restricted_json): if not validation.valid_o3de_restricted_json(restricted_json): logger.error(f'Restricted json {restricted_json} is not valid.') @@ -1663,7 +1726,8 @@ def create_project(project_path: pathlib.Path, logger.error(f'Failed to read "restricted_name" from restricted json {restricted_json}.') return 1 - # set the "restricted_name": "restricted_name" element of the project.json + # set the "restricted": element of the project.json + project_json = project_path / 'project.json' if not validation.valid_o3de_project_json(project_json): logger.error(f'Project json {project_json} is not valid.') return 1 @@ -1675,7 +1739,7 @@ def create_project(project_path: pathlib.Path, logger.error(f'Failed to load project json {project_json}.') return 1 - project_json_data.update({"restricted_name": restricted_name}) + project_json_data.update({"restricted": restricted_name}) os.unlink(project_json) with open(project_json, 'w') as s: try: @@ -1684,20 +1748,11 @@ def create_project(project_path: pathlib.Path, logger.error(f'Failed to write project json {project_json}.') return 1 - for restricted_platform in restricted_platforms: - restricted_project = project_restricted_path / restricted_platform / project_name - os.makedirs(restricted_project, exist_ok=True) - cmakelists_file_name = restricted_project/ 'CMakeLists.txt' - if not os.path.isfile(cmakelists_file_name): - with open(cmakelists_file_name, 'w') as d: - if keep_license_text: - d.write('# {BEGIN_LICENSE}\n') - d.write('# Copyright (c) Contributors to the Open 3D Engine Project.\n') - d.write('# For complete copyright and license terms please see the LICENSE at the root of this distribution.\n') - d.write('#\n') - d.write('# SPDX-License-Identifier: Apache-2.0 OR MIT\n') - d.write('# {END_LICENSE}\n') - + # Register the restricted + if not no_register: + if register.register(restricted_path=project_restricted_path): + logger.error(f'Failed to register the restricted {project_restricted_path}.') + return 1 # Register the project with the either o3de_manifest.json or engine.json # and set the project.json "engine" field to match the @@ -1906,10 +1961,15 @@ def create_gem(gem_path: pathlib.Path, if not gem_path: logger.error('Gem path cannot be empty.') return 1 - gem_path = gem_path.resolve() + if not os.path.isabs(gem_path): + default_gems_folder = manifest.get_registered(default_folder='gems') + new_gem_path = default_gems_folder / gem_path + logger.info(f'Gem Path {gem_path} is not a full path, we must assume its relative' + f' to default gems path = {new_gem_path}') + gem_path = new_gem_path if not force and gem_path.is_dir() and len(list(gem_path.iterdir())): - logger.error(f'Gem path {gem_path} already exists and is not empty.') + logger.error(f'Gem path {gem_path} already exists.') return 1 else: os.makedirs(gem_path, exist_ok=force) @@ -1930,22 +1990,18 @@ def create_gem(gem_path: pathlib.Path, # gem restricted name if gem_restricted_name and not gem_restricted_path: gem_restricted_path = manifest.get_registered(restricted_name=gem_restricted_name) + if not gem_restricted_path: + logger.error(f'Gem Restricted Name {gem_restricted_name} cannot be found.') + return 1 # gem restricted path - elif gem_restricted_path: + if gem_restricted_path: if not os.path.isabs(gem_restricted_path): - gem_restricted_default_path = manifest.get_registered(restricted_name='gems') - if gem_restricted_default_path: - new_gem_restricted_path = gem_restricted_default_path / gem_restricted_path - logger.info(f'Gem restricted path {gem_restricted_path} is not a full path, we must assume its' - f' relative to default gems restricted path = {new_gem_restricted_path}') - gem_restricted_path = new_gem_restricted_path + logger.error(f'Gem Restricted Path {gem_restricted_path} is not an absolute path.') + return 1 + # neither put it in the default restricted gems else: - gem_restricted_default_path = manifest.get_registered(restricted_name='gems') - if gem_restricted_default_path: - logger.info(f'--gem-restricted-path is not specified, using default / ' - f' = {gem_restricted_default_path}') - gem_restricted_path = gem_restricted_default_path / gem_name + gem_restricted_path = manifest.get_o3de_restricted_folder() / "Gems" / gem_name # gem restricted relative if not gem_restricted_platform_relative_path: @@ -2035,47 +2091,49 @@ def create_gem(gem_path: pathlib.Path, logger.error(f'Failed to load restricted json {restricted_json}.') return 1 + try: + restricted_name = restricted_json_data["restricted_name"] + except KeyError as e: + logger.error(f'Failed to read "restricted_name" from restricted json {restricted_json}.') + return 1 + + # set the "restricted_name": element of the gem.json + gem_json = gem_path / 'gem.json' + if not validation.valid_o3de_gem_json(gem_json): + logger.error(f'Gem json {gem_json} is not valid.') + return 1 + + with open(gem_json, 'r') as s: try: - restricted_name = restricted_json_data["restricted_name"] - except KeyError as e: - logger.error(f'Failed to read "restricted_name" from restricted json {restricted_json}.') + gem_json_data = json.load(s) + except json.JSONDecodeError as e: + logger.error(f'Failed to load gem json {gem_json}.') return 1 - # set the "restricted_name": "restricted_name" element of the gem.json - gem_json = gem_path / 'gem.json' - if not validation.valid_o3de_gem_json(gem_json): - logger.error(f'Gem json {gem_json} is not valid.') + gem_json_data.update({"restricted": restricted_name}) + os.unlink(gem_json) + with open(gem_json, 'w') as s: + try: + s.write(json.dumps(gem_json_data, indent=4) + '\n') + except OSError as e: + logger.error(f'Failed to write project json {gem_json}.') + return 1 + ''' + for restricted_platform in restricted_platforms: + restricted_gem = gem_restricted_path / restricted_platform / gem_name + os.makedirs(restricted_gem, exist_ok=True) + cmakelists_file_name = restricted_gem / 'CMakeLists.txt' + if not os.path.isfile(cmakelists_file_name): + with open(cmakelists_file_name, 'w') as d: + if keep_license_text: + d.write(O3DE_LICENSE_TEXT) + ''' + # Register the restricted + if not no_register: + if register.register(restricted_path=gem_restricted_path): + logger.error(f'Failed to register the restricted {gem_restricted_path}.') return 1 - with open(gem_json, 'r') as s: - try: - gem_json_data = json.load(s) - except json.JSONDecodeError as e: - logger.error(f'Failed to load gem json {gem_json}.') - return 1 - - gem_json_data.update({"restricted_name": restricted_name}) - os.unlink(gem_json) - with open(gem_json, 'w') as s: - try: - s.write(json.dumps(gem_json_data, indent=4) + '\n') - except OSError as e: - logger.error(f'Failed to write project json {gem_json}.') - return 1 - - for restricted_platform in restricted_platforms: - restricted_gem = gem_restricted_path / restricted_platform/ gem_name - os.makedirs(restricted_gem, exist_ok=True) - cmakelists_file_name = restricted_gem / 'CMakeLists.txt' - if not os.path.isfile(cmakelists_file_name): - with open(cmakelists_file_name, 'w') as d: - if keep_license_text: - d.write('# {BEGIN_LICENSE}\n') - d.write('# Copyright (c) Contributors to the Open 3D Engine Project.\n') - d.write('# For complete copyright and license terms please see the LICENSE at the root of this distribution.\n') - d.write('#\n') - d.write('# SPDX-License-Identifier: Apache-2.0 OR MIT\n') - d.write('# {END_LICENSE}\n') # Register the gem with the either o3de_manifest.json, engine.json or project.json based on the gem path return register.register(gem_path=gem_path) if not no_register else 0 @@ -2093,7 +2151,8 @@ def _run_create_template(args: argparse) -> int: args.keep_restricted_in_template, args.keep_license_text, args.replace, - args.force) + args.force, + args.no_register) def _run_create_from_template(args: argparse) -> int: @@ -2110,7 +2169,8 @@ def _run_create_from_template(args: argparse) -> int: args.keep_restricted_in_instance, args.keep_license_text, args.replace, - args.force) + args.force, + args.no_register) def _run_create_project(args: argparse) -> int: @@ -2166,7 +2226,6 @@ def add_args(subparsers) -> None: call add_args and execute: python o3de.py create-gem --gem-path TestGem :param subparsers: the caller instantiates subparsers and passes it in here """ - # turn a directory into a template create_template_subparser = subparsers.add_parser('create-template') @@ -2242,7 +2301,10 @@ def add_args(subparsers) -> None: ' Note: is automatically ${NameLower}' ' Note: is automatically ${NameUpper}') create_template_subparser.add_argument('-f', '--force', action='store_true', default=False, - help='Copies to new template directory even if it exist.') + help='Copies to new template directory even if it exist.') + create_template_subparser.add_argument('--no-register', action='store_true', default=False, + help='If the template is created successfully, it will not register the' + ' template with the global or engine manifest file.') create_template_subparser.set_defaults(func=_run_create_template) # create from template @@ -2268,11 +2330,11 @@ def add_args(subparsers) -> None: ' resolve the --template-path.') create_from_template_subparser.add_argument('-dn', '--destination-name', type=str, - help='The name to use when substituting the ${Name} placeholder in instantiated template,' - ' must be alphanumeric, ' - ' and can contain _ and - characters.' - ' If no name is provided, will use last component of destination path.' - ' Ex. New_Gem') + help='The name to use when substituting the ${Name} placeholder in instantiated template,' + ' must be alphanumeric, ' + ' and can contain _ and - characters.' + ' If no name is provided, will use last component of destination path.' + ' Ex. New_Gem') group = create_from_template_subparser.add_mutually_exclusive_group(required=False) group.add_argument('-drp', '--destination-restricted-path', type=pathlib.Path, required=False, @@ -2293,7 +2355,8 @@ def add_args(subparsers) -> None: help='The name of the registered restricted path to read from if any. If supplied this will' ' resolve the --template-restricted-path.') - create_from_template_subparser.add_argument('-drprp', '--destination-restricted-platform-relative-path', type=pathlib.Path, + create_from_template_subparser.add_argument('-drprp', '--destination-restricted-platform-relative-path', + type=pathlib.Path, required=False, default=None, help='Any path to append to the --destination-restricted-path/' @@ -2301,7 +2364,8 @@ def add_args(subparsers) -> None: ' --destination-restricted-path C:/instance' ' --destination-restricted-platform-relative-path some/folder' ' => C:/instance//some/folder/') - create_from_template_subparser.add_argument('-trprp', '--template-restricted-platform-relative-path', type=pathlib.Path, + create_from_template_subparser.add_argument('-trprp', '--template-restricted-platform-relative-path', + type=pathlib.Path, required=False, default=None, help='Any path to append to the --template-restricted-path/' @@ -2329,7 +2393,10 @@ def add_args(subparsers) -> None: ' Note: ${NameLower} is automatically ' ' Note: ${NameUpper} is automatically ') create_from_template_subparser.add_argument('-f', '--force', action='store_true', default=False, - help='Copies over instantiated template directory even if it exist.') + help='Copies over instantiated template directory even if it exist.') + create_from_template_subparser.add_argument('--no-register', action='store_true', default=False, + help='If the project template is instantiated successfully, it will not register the' + ' project with the global or engine manifest file.') create_from_template_subparser.set_defaults(func=_run_create_from_template) # creation of a project from a template (like create from template but makes project assumptions) @@ -2430,10 +2497,10 @@ def add_args(subparsers) -> None: help='The str id you want to associate with the project, default is a random uuid' ' Ex. {b60c92eb-3139-454b-a917-a9d3c5819594}') create_project_subparser.add_argument('-f', '--force', action='store_true', default=False, - help='Copies over instantiated template directory even if it exist.') + help='Copies over instantiated template directory even if it exist.') create_project_subparser.add_argument('--no-register', action='store_true', default=False, - help='If the project template is instantiated successfully, it will not register the' - ' project with the global or engine manifest file.') + help='If the project template is instantiated successfully, it will not register the' + ' project with the global or engine manifest file.') create_project_subparser.set_defaults(func=_run_create_project) # creation of a gem from a template (like create from template but makes gem assumptions) @@ -2445,11 +2512,11 @@ def add_args(subparsers) -> None: create_gem_subparser.add_argument('-gp', '--gem-path', type=pathlib.Path, required=True, help='The gem path, can be absolute or relative to the current working directory') create_gem_subparser.add_argument('-gn', '--gem-name', type=str, - help='The name to use when substituting the ${Name} placeholder for the gem,' - ' must be alphanumeric, ' - ' and can contain _ and - characters.' - ' If no name is provided, will use last component of gem path.' - ' Ex. New_Gem') + help='The name to use when substituting the ${Name} placeholder for the gem,' + ' must be alphanumeric, ' + ' and can contain _ and - characters.' + ' If no name is provided, will use last component of gem path.' + ' Ex. New_Gem') group = create_gem_subparser.add_mutually_exclusive_group(required=False) group.add_argument('-tp', '--template-path', type=pathlib.Path, required=False, @@ -2529,7 +2596,7 @@ def add_args(subparsers) -> None: help='The uuid you want to associate with the gem module,' ' default is a random uuid Ex. {b60c92eb-3139-454b-a917-a9d3c5819594}') create_gem_subparser.add_argument('-f', '--force', action='store_true', default=False, - help='Copies over instantiated template directory even if it exist.') + help='Copies over instantiated template directory even if it exist.') create_gem_subparser.add_argument('--no-register', action='store_true', default=False, help='If the gem template is instantiated successfully, it will not register the' ' gem with the global, project or engine manifest file.') diff --git a/scripts/o3de/o3de/get_registration.py b/scripts/o3de/o3de/get_registration.py index d64056e8b2..1271d56804 100644 --- a/scripts/o3de/o3de/get_registration.py +++ b/scripts/o3de/o3de/get_registration.py @@ -14,9 +14,6 @@ from o3de import manifest def _run_get_registered(args: argparse) -> int: - if args.override_home_folder: - manifest.override_home_folder = args.override_home_folder - registered_path = manifest.get_registered(args.engine_name, args.project_name, args.gem_name, @@ -55,9 +52,6 @@ def add_parser_args(parser): group.add_argument('-rsn', '--restricted-name', type=str, required=False, help='Restricted name.') - parser.add_argument('-ohf', '--override-home-folder', type=str, required=False, - help='By default the home folder is the user folder, override it to this folder.') - parser.set_defaults(func=_run_get_registered) diff --git a/scripts/o3de/o3de/manifest.py b/scripts/o3de/o3de/manifest.py index a334109e6a..88e6ae8229 100644 --- a/scripts/o3de/o3de/manifest.py +++ b/scripts/o3de/o3de/manifest.py @@ -22,18 +22,13 @@ logger = logging.getLogger('o3de.manifest') logging.basicConfig(format=utils.LOG_FORMAT) # Directory methods -override_home_folder = None - def get_this_engine_path() -> pathlib.Path: return pathlib.Path(os.path.realpath(__file__)).parents[3].resolve() def get_home_folder() -> pathlib.Path: - if override_home_folder: - return pathlib.Path(override_home_folder).resolve() - else: - return pathlib.Path(os.path.expanduser("~")).resolve() + return pathlib.Path(os.path.expanduser("~")).resolve() def get_o3de_folder() -> pathlib.Path: @@ -42,12 +37,6 @@ def get_o3de_folder() -> pathlib.Path: return o3de_folder -def get_o3de_user_folder() -> pathlib.Path: - o3de_user_folder = get_home_folder() / 'O3DE' - o3de_user_folder.mkdir(parents=True, exist_ok=True) - return o3de_user_folder - - def get_o3de_registry_folder() -> pathlib.Path: registry_folder = get_o3de_folder() / 'Registry' registry_folder.mkdir(parents=True, exist_ok=True) @@ -73,19 +62,19 @@ def get_o3de_engines_folder() -> pathlib.Path: def get_o3de_projects_folder() -> pathlib.Path: - projects_folder = get_o3de_user_folder() / 'Projects' + projects_folder = get_o3de_folder() / 'Projects' projects_folder.mkdir(parents=True, exist_ok=True) return projects_folder def get_o3de_gems_folder() -> pathlib.Path: - gems_folder = get_o3de_user_folder() / 'Gems' + gems_folder = get_o3de_folder() / 'Gems' gems_folder.mkdir(parents=True, exist_ok=True) return gems_folder def get_o3de_templates_folder() -> pathlib.Path: - templates_folder = get_o3de_user_folder() / 'Templates' + templates_folder = get_o3de_folder() / 'Templates' templates_folder.mkdir(parents=True, exist_ok=True) return templates_folder @@ -117,6 +106,10 @@ def get_default_o3de_manifest_json_data() -> dict: username = os.path.split(get_home_folder())[-1] o3de_folder = get_o3de_folder() + default_registry_folder = get_o3de_registry_folder() + default_cache_folder = get_o3de_cache_folder() + default_downloads_folder = get_o3de_download_folder() + default_logs_folder = get_o3de_logs_folder() default_engines_folder = get_o3de_engines_folder() default_projects_folder = get_o3de_projects_folder() default_gems_folder = get_o3de_gems_folder() @@ -124,12 +117,20 @@ def get_default_o3de_manifest_json_data() -> dict: default_restricted_folder = get_o3de_restricted_folder() default_third_party_folder = get_o3de_third_party_folder() - default_projects_restricted_folder = default_projects_folder / 'Restricted' - default_projects_restricted_folder.mkdir(parents=True, exist_ok=True) - default_gems_restricted_folder = default_gems_folder / 'Restricted' - default_gems_restricted_folder.mkdir(parents=True, exist_ok=True) - default_templates_restricted_folder = default_templates_folder / 'Restricted' - default_templates_restricted_folder.mkdir(parents=True, exist_ok=True) + default_restricted_projects_folder = default_restricted_folder / 'Projects' + default_restricted_projects_folder.mkdir(parents=True, exist_ok=True) + default_restricted_gems_folder = default_restricted_folder / 'Gems' + default_restricted_gems_folder.mkdir(parents=True, exist_ok=True) + default_restricted_engine_folder = default_restricted_folder / 'Engines' / 'o3de' + default_restricted_engine_folder.mkdir(parents=True, exist_ok=True) + default_restricted_templates_folder = default_restricted_folder / 'Templates' + default_restricted_templates_folder.mkdir(parents=True, exist_ok=True) + default_restricted_engine_folder_json = default_restricted_engine_folder / 'restricted.json' + if not default_restricted_engine_folder_json.is_file(): + with default_restricted_engine_folder_json.open('w') as s: + restricted_json_data = {} + restricted_json_data.update({'restricted_name': 'o3de'}) + s.write(json.dumps(restricted_json_data, indent=4) + '\n') json_data = {} json_data.update({'o3de_manifest_name': f'{username}'}) @@ -140,45 +141,14 @@ def get_default_o3de_manifest_json_data() -> dict: json_data.update({'default_templates_folder': default_templates_folder.as_posix()}) json_data.update({'default_restricted_folder': default_restricted_folder.as_posix()}) json_data.update({'default_third_party_folder': default_third_party_folder.as_posix()}) - - json_data.update({'engines': []}) json_data.update({'projects': []}) json_data.update({'external_subdirectories': []}) json_data.update({'templates': []}) - json_data.update({'restricted': []}) + json_data.update({'restricted': [default_restricted_engine_folder.as_posix()]}) json_data.update({'repos': []}) - - default_restricted_folder_json = default_restricted_folder / 'restricted.json' - if not default_restricted_folder_json.is_file(): - with default_restricted_folder_json.open('w') as s: - restricted_json_data = {} - restricted_json_data.update({'restricted_name': 'o3de'}) - s.write(json.dumps(restricted_json_data, indent=4) + '\n') - - default_projects_restricted_folder_json = default_projects_restricted_folder / 'restricted.json' - if not default_projects_restricted_folder_json.is_file(): - with default_projects_restricted_folder_json.open('w') as s: - restricted_json_data = {} - restricted_json_data.update({'restricted_name': 'projects'}) - s.write(json.dumps(restricted_json_data, indent=4) + '\n') - - default_gems_restricted_folder_json = default_gems_restricted_folder / 'restricted.json' - if not default_gems_restricted_folder_json.is_file(): - with default_gems_restricted_folder_json.open('w') as s: - restricted_json_data = {} - restricted_json_data.update({'restricted_name': 'gems'}) - s.write(json.dumps(restricted_json_data, indent=4) + '\n') - - default_templates_restricted_folder_json = default_templates_restricted_folder / 'restricted.json' - if not default_templates_restricted_folder_json.is_file(): - with default_templates_restricted_folder_json.open('w') as s: - restricted_json_data = {} - restricted_json_data.update({'restricted_name': 'templates'}) - s.write(json.dumps(restricted_json_data, indent=4) + '\n') - + json_data.update({'engines': []}) return json_data - def get_o3de_manifest() -> pathlib.Path: manifest_path = get_o3de_folder() / 'o3de_manifest.json' if not manifest_path.is_file(): @@ -229,12 +199,12 @@ def save_o3de_manifest(json_data: dict, manifest_path: pathlib.Path = None) -> b return False -def get_gems_from_subdirectories(external_subdirs: list) -> list: - """ +def get_gems_from_external_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 subdir_files: + for name in files: if name == 'gem.json': return True return False @@ -250,7 +220,8 @@ def get_gems_from_subdirectories(external_subdirs: list) -> list: return gem_directories -def get_engines() -> list: +# Data query methods +def get_manifest_engines() -> list: json_data = load_o3de_manifest() engine_list = json_data['engines'] if 'engines' in json_data else [] # Convert each engine dict entry into a string entry @@ -259,31 +230,31 @@ def get_engines() -> list: engine_list)) -def get_projects() -> list: +def get_manifest_projects() -> list: json_data = load_o3de_manifest() return json_data['projects'] if 'projects' in json_data else [] -def get_gems() -> list: - return get_gems_from_subdirectories(get_external_subdirectories()) +def get_manifest_gems() -> list: + return get_gems_from_external_subdirectories(get_manifest_external_subdirectories()) -def get_external_subdirectories() -> list: +def get_manifest_external_subdirectories() -> list: json_data = load_o3de_manifest() return json_data['external_subdirectories'] if 'external_subdirectories' in json_data else [] -def get_templates() -> list: +def get_manifest_templates() -> list: json_data = load_o3de_manifest() return json_data['templates'] if 'templates' in json_data else [] -def get_restricted() -> list: +def get_manifest_restricted() -> list: json_data = load_o3de_manifest() return json_data['restricted'] if 'restricted' in json_data else [] -def get_repos() -> list: +def get_manifest_repos() -> list: json_data = load_o3de_manifest() return json_data['repos'] if 'repos' in json_data else [] @@ -299,7 +270,7 @@ def get_engine_projects() -> list: def get_engine_gems() -> list: - return get_gems_from_subdirectories(get_engine_external_subdirectories()) + return get_gems_from_external_subdirectories(get_engine_external_subdirectories()) def get_engine_external_subdirectories() -> list: @@ -320,23 +291,9 @@ def get_engine_templates() -> list: return [] -def get_engine_restricted() -> list: - engine_path = get_this_engine_path() - engine_object = get_engine_json_data(engine_path=engine_path) - if engine_object: - return list(map(lambda rel_path: (pathlib.Path(engine_path) / rel_path).as_posix(), - engine_object['restricted'])) if 'restricted' in engine_object else [] - return [] - - # project.json queries -def get_project_engine_name(project_path: pathlib.Path) -> str or None: - project_object = get_project_json_data(project_path=project_path) - return project_object.get('engine', None) if project_object else None - - def get_project_gems(project_path: pathlib.Path) -> list: - return get_gems_from_subdirectories(get_project_external_subdirectories(project_path)) + return get_gems_from_external_subdirectories(get_project_external_subdirectories(project_path)) def get_project_external_subdirectories(project_path: pathlib.Path) -> list: @@ -355,74 +312,95 @@ def get_project_templates(project_path: pathlib.Path) -> list: return [] -def get_project_restricted(project_path: pathlib.Path) -> list: - project_object = get_project_json_data(project_path=project_path) - if project_object: - return list(map(lambda rel_path: (pathlib.Path(project_path) / rel_path).as_posix(), - project_object['restricted'])) if 'restricted' in project_object else [] +# gem.json queries +def get_gem_gems(gem_path: pathlib.Path) -> list: + return get_gems_from_external_subdirectories(get_gem_external_subdirectories(gem_path)) + + +def get_gem_external_subdirectories(gem_path: pathlib.Path) -> list: + gem_object = get_gem_json_data(gem_path=gem_path) + if gem_object: + return list(map(lambda rel_path: (pathlib.Path(gem_path) / rel_path).as_posix(), + gem_object[ + 'external_subdirectories'])) if 'external_subdirectories' in gem_object else [] + return [] + + +def get_gem_templates(gem_path: pathlib.Path) -> list: + gem_object = get_gem_json_data(gem_path=gem_path) + if gem_object: + return list(map(lambda rel_path: (pathlib.Path(gem_path) / rel_path).as_posix(), + gem_object['templates'])) if 'templates' in gem_object else [] return [] # Combined manifest queries def get_all_projects() -> list: - projects_data = get_projects() + projects_data = get_manifest_projects() projects_data.extend(get_engine_projects()) # Remove duplicates from the list return list(dict.fromkeys(projects_data)) def get_all_gems(project_path: pathlib.Path = None) -> list: - gems_data = get_gems() - gems_data.extend(get_engine_gems()) - if project_path: - gems_data.extend(get_project_gems(project_path)) - return list(dict.fromkeys(gems_data)) + return get_gems_from_external_subdirectories(get_all_external_subdirectories(project_path)) def get_all_external_subdirectories(project_path: pathlib.Path = None) -> list: - external_subdirectories_data = get_external_subdirectories() + external_subdirectories_data = get_manifest_external_subdirectories() external_subdirectories_data.extend(get_engine_external_subdirectories()) if project_path: external_subdirectories_data.extend(get_project_external_subdirectories(project_path)) + + def descend_gems(gem_path: pathlib.Path): + new_external_subdirectories_data = get_gem_external_subdirectories(gem_path) + external_subdirectories_data.extend(new_external_subdirectories_data) + new_gems_data = get_gems_from_external_subdirectories(new_external_subdirectories_data) + for new_gem in new_gems_data: + descend_gems(new_gem) + + gems_data = get_gems_from_external_subdirectories(external_subdirectories_data) + for gem in gems_data: + descend_gems(gem) + + # Remove duplicates from the list return list(dict.fromkeys(external_subdirectories_data)) def get_all_templates(project_path: pathlib.Path = None) -> list: - templates_data = get_templates() + templates_data = get_manifest_templates() templates_data.extend(get_engine_templates()) if project_path: templates_data.extend(get_project_templates(project_path)) - return list(dict.fromkeys(templates_data)) + gems_data = get_all_gems(project_path) + for gem_path in gems_data: + templates_data.extend(get_gem_templates(gem_path)) -def get_all_restricted(project_path: pathlib.Path = None) -> list: - restricted_data = get_restricted() - restricted_data.extend(get_engine_restricted()) - if project_path: - restricted_data.extend(get_project_restricted(project_path)) - return list(dict.fromkeys(restricted_data)) + # Remove duplicates from the list + return list(dict.fromkeys(templates_data)) # Template functions -def get_templates_for_project_creation(): +def get_templates_for_project_creation(project_path: pathlib.Path = None) -> list: project_templates = [] - for template_path in get_all_templates(): + for template_path in get_all_templates(project_path): template_path = pathlib.Path(template_path) - template_json_path = pathlib.Path(template_path) / 'template.json' + template_json_path = template_path / 'template.json' if not validation.valid_o3de_template_json(template_json_path): continue - project_json_path = template_path / 'Template' / 'project.json' if validation.valid_o3de_project_json(project_json_path): project_templates.append(template_path) + return project_templates -def get_templates_for_gem_creation(): +def get_templates_for_gem_creation(project_path: pathlib.Path = None) -> list: gem_templates = [] - for template_path in get_all_templates(): + for template_path in get_all_templates(project_path): template_path = pathlib.Path(template_path) - template_json_path = pathlib.Path(template_path) / 'template.json' + template_json_path = template_path / 'template.json' if not validation.valid_o3de_template_json(template_json_path): continue @@ -432,72 +410,55 @@ def get_templates_for_gem_creation(): return gem_templates -def get_templates_for_generic_creation(): # temporary until we have a better way to do this... maybe template_type element - def filter_project_and_gem_templates_out(template_path, - templates_for_project_creation = get_templates_for_project_creation(), - templates_for_gem_creation = get_templates_for_gem_creation()): +def get_templates_for_generic_creation(project_path: pathlib.Path = None) -> list: + generic_templates = [] + for template_path in get_all_templates(project_path): template_path = pathlib.Path(template_path) - return template_path not in templates_for_project_creation and template_path not in templates_for_gem_creation + template_json_path = template_path / 'template.json' + if not validation.valid_o3de_template_json(template_json_path): + continue + gem_json_path = template_path / 'Template' / 'gem.json' + project_json_path = template_path / 'Template' / 'project.json' + if not validation.valid_o3de_gem_json(gem_json_path) and\ + not validation.valid_o3de_project_json(project_json_path): + generic_templates.append(template_path) - return list(filter(filter_project_and_gem_templates_out, get_all_templates())) + return generic_templates -def get_json_file_path(object_typename: str, - object_path: str or pathlib.Path) -> pathlib.Path: - if not object_typename or not object_path: - logger.error('Must specify an object typename and object path.') +def get_engine_json_data(engine_name: str = None, + engine_path: str or pathlib.Path = None) -> dict or None: + if not engine_name and not engine_path: + logger.error('Must specify either a Engine name or Engine Path.') return None - object_path = pathlib.Path(object_path).resolve() - return object_path / f'{object_typename}.json' - + if engine_name and not engine_path: + engine_path = get_registered(engine_name=engine_name) -def get_json_data_file(object_json: pathlib.Path, - object_typename: str, - object_validator: callable) -> dict or None: - if not object_typename: - logger.error('Missing object typename.') + if not engine_path: + logger.error(f'Engine Path {engine_path} has not been registered.') return None - if not object_json or not object_json.is_file(): - logger.error(f'Invalid {object_typename} json {object_json} supplied or file missing.') + engine_path = pathlib.Path(engine_path).resolve() + engine_json = engine_path / 'engine.json' + if not engine_json.is_file(): + logger.error(f'Engine json {engine_json} is not present.') return None - - if not object_validator or not object_validator(object_json): - logger.error(f'{object_typename} json {object_json} is not valid or could not be validated.') + if not validation.valid_o3de_engine_json(engine_json): + logger.error(f'Engine json {engine_json} is not valid.') return None - with object_json.open('r') as f: + with engine_json.open('r') as f: try: - object_json_data = json.load(f) + engine_json_data = json.load(f) except json.JSONDecodeError as e: - logger.warning(f'{object_json} failed to load: {e}') + logger.warning(f'{engine_json} failed to load: {str(e)}') else: - return object_json_data + return engine_json_data return None -def get_json_data(object_typename: str, - object_path: str or pathlib.Path, - object_validator: callable) -> dict or None: - object_json = get_json_file_path(object_typename, object_path) - - return get_json_data_file(object_json, object_typename, object_validator) - - -def get_engine_json_data(engine_name: str = None, - engine_path: str or pathlib.Path = None) -> dict or None: - if not engine_name and not engine_path: - logger.error('Must specify either a Engine name or Engine Path.') - return None - - if engine_name and not engine_path: - engine_path = get_registered(engine_name=engine_name) - - return get_json_data('engine', engine_path, validation.valid_o3de_engine_json) - - def get_project_json_data(project_name: str = None, project_path: str or pathlib.Path = None) -> dict or None: if not project_name and not project_path: @@ -507,7 +468,28 @@ def get_project_json_data(project_name: str = None, if project_name and not project_path: project_path = get_registered(project_name=project_name) - return get_json_data('project', project_path, validation.valid_o3de_project_json) + if not project_path: + logger.error(f'Project Path {project_path} has not been registered.') + return None + + project_path = pathlib.Path(project_path).resolve() + project_json = project_path / 'project.json' + if not project_json.is_file(): + logger.error(f'Project json {project_json} is not present.') + return None + if not validation.valid_o3de_project_json(project_json): + logger.error(f'Project json {project_json} is not valid.') + return None + + with project_json.open('r') as f: + try: + project_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warning(f'{project_json} failed to load: {str(e)}') + else: + return project_json_data + + return None def get_gem_json_data(gem_name: str = None, gem_path: str or pathlib.Path = None, @@ -519,10 +501,28 @@ def get_gem_json_data(gem_name: str = None, gem_path: str or pathlib.Path = None if gem_name and not gem_path: gem_path = get_registered(gem_name=gem_name, project_path=project_path) - if pathlib.Path(gem_path).is_file(): - return get_json_data_file(gem_path, 'gem', validation.valid_o3de_gem_json) - else: - return get_json_data('gem', gem_path, validation.valid_o3de_gem_json) + if not gem_path: + logger.error(f'Gem Path {gem_path} has not been registered.') + return None + + gem_path = pathlib.Path(gem_path).resolve() + gem_json = gem_path / 'gem.json' + if not gem_json.is_file(): + logger.error(f'Gem json {gem_json} is not present.') + return None + if not validation.valid_o3de_gem_json(gem_json): + logger.error(f'Gem json {gem_json} is not valid.') + return None + + with gem_json.open('r') as f: + try: + gem_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warning(f'{gem_json} failed to load: {str(e)}') + else: + return gem_json_data + + return None def get_template_json_data(template_name: str = None, template_path: str or pathlib.Path = None, @@ -534,7 +534,28 @@ def get_template_json_data(template_name: str = None, template_path: str or path if template_name and not template_path: template_path = get_registered(template_name=template_name, project_path=project_path) - return get_json_data('template', template_path, validation.valid_o3de_template_json) + if not template_path: + logger.error(f'Template Path {template_path} has not been registered.') + return None + + template_path = pathlib.Path(template_path).resolve() + template_json = template_path / 'template.json' + if not template_json.is_file(): + logger.error(f'Template json {template_json} is not present.') + return None + if not validation.valid_o3de_template_json(template_json): + logger.error(f'Template json {template_json} is not valid.') + return None + + with template_json.open('r') as f: + try: + template_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warning(f'{template_json} failed to load: {str(e)}') + else: + return template_json_data + + return None def get_restricted_json_data(restricted_name: str = None, restricted_path: str or pathlib.Path = None, @@ -546,26 +567,28 @@ def get_restricted_json_data(restricted_name: str = None, restricted_path: str o if restricted_name and not restricted_path: restricted_path = get_registered(restricted_name=restricted_name, project_path=project_path) - return get_json_data('restricted', restricted_path, validation.valid_o3de_restricted_json) - - -def get_repo_json_data(repo_uri: str) -> dict or None: - if not repo_uri: - logger.error('Must specify a Repo Uri.') + if not restricted_path: + logger.error(f'Restricted Path {restricted_path} has not been registered.') return None - repo_json = get_repo_path(repo_uri=repo_uri) - - return get_json_data_file(repo_json, "Repo", validation.valid_o3de_repo_json) - + restricted_path = pathlib.Path(restricted_path).resolve() + restricted_json = restricted_path / 'restricted.json' + if not restricted_json.is_file(): + logger.error(f'Restricted json {restricted_json} is not present.') + return None + if not validation.valid_o3de_restricted_json(restricted_json): + logger.error(f'Restricted json {restricted_json} is not valid.') + return None -def get_repo_path(repo_uri: str, cache_folder: str or pathlib.Path = None) -> pathlib.Path: - if not cache_folder: - cache_folder = get_o3de_cache_folder() + with restricted_json.open('r') as f: + try: + restricted_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warning(f'{restricted_json} failed to load: {str(e)}') + else: + return restricted_json_data - repo_manifest = f'{repo_uri}/repo.json' - repo_sha256 = hashlib.sha256(repo_manifest.encode()) - return cache_folder / str(repo_sha256.hexdigest() + '.json') + return None def get_registered(engine_name: str = None, @@ -604,7 +627,7 @@ def get_registered(engine_name: str = None, # check global first then this engine if isinstance(engine_name, str): - engines = get_engines() + engines = get_manifest_engines() for engine in engines: if isinstance(engine, dict): engine_path = pathlib.Path(engine['path']).resolve() @@ -633,72 +656,60 @@ def get_registered(engine_name: str = None, for project_path in projects: project_path = pathlib.Path(project_path).resolve() project_json = project_path / 'project.json' - if not pathlib.Path(project_json).is_file(): - logger.warning(f'{project_json} does not exist') - else: - with project_json.open('r') as f: - try: - project_json_data = json.load(f) - except json.JSONDecodeError as e: - logger.warning(f'{project_json} failed to load: {str(e)}') - else: - this_projects_name = project_json_data['project_name'] - if this_projects_name == project_name: - return project_path + with project_json.open('r') as f: + try: + project_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warning(f'{project_json} failed to load: {str(e)}') + else: + this_projects_name = project_json_data['project_name'] + if this_projects_name == project_name: + return project_path elif isinstance(gem_name, str): gems = get_all_gems(project_path) for gem_path in gems: gem_path = pathlib.Path(gem_path).resolve() gem_json = gem_path / 'gem.json' - if not pathlib.Path(gem_json).is_file(): - logger.warning(f'{gem_json} does not exist') - else: - with gem_json.open('r') as f: - try: - gem_json_data = json.load(f) - except json.JSONDecodeError as e: - logger.warning(f'{gem_json} failed to load: {str(e)}') - else: - this_gems_name = gem_json_data['gem_name'] - if this_gems_name == gem_name: - return gem_path + with gem_json.open('r') as f: + try: + gem_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warning(f'{gem_json} failed to load: {str(e)}') + else: + this_gems_name = gem_json_data['gem_name'] + if this_gems_name == gem_name: + return gem_path elif isinstance(template_name, str): templates = get_all_templates(project_path) for template_path in templates: template_path = pathlib.Path(template_path).resolve() template_json = template_path / 'template.json' - if not pathlib.Path(template_json).is_file(): - logger.warning(f'{template_json} does not exist') - else: - with template_json.open('r') as f: - try: - template_json_data = json.load(f) - except json.JSONDecodeError as e: - logger.warning(f'{template_path} failed to load: {str(e)}') - else: - this_templates_name = template_json_data['template_name'] - if this_templates_name == template_name: - return template_path + with template_json.open('r') as f: + try: + template_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warning(f'{template_path} failed to load: {str(e)}') + else: + this_templates_name = template_json_data['template_name'] + if this_templates_name == template_name: + return template_path elif isinstance(restricted_name, str): - restricted = get_all_restricted(project_path) + restricted = get_manifest_restricted() for restricted_path in restricted: restricted_path = pathlib.Path(restricted_path).resolve() restricted_json = restricted_path / 'restricted.json' - if not pathlib.Path(restricted_json).is_file(): - logger.warning(f'{restricted_json} does not exist') - else: - with restricted_json.open('r') as f: - try: - restricted_json_data = json.load(f) - except json.JSONDecodeError as e: - logger.warning(f'{restricted_json} failed to load: {str(e)}') - else: - this_restricted_name = restricted_json_data['restricted_name'] - if this_restricted_name == restricted_name: - return restricted_path + with restricted_json.open('r') as f: + try: + restricted_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warning(f'{restricted_json} failed to load: {str(e)}') + else: + this_restricted_name = restricted_json_data['restricted_name'] + if this_restricted_name == restricted_name: + return restricted_path elif isinstance(default_folder, str): if default_folder == 'engines': @@ -720,7 +731,9 @@ def get_registered(engine_name: str = None, elif isinstance(repo_name, str): cache_folder = get_o3de_cache_folder() for repo_uri in json_data['repos']: - cache_file = get_repo_path(repo_uri=repo_uri, cache_folder=cache_folder) + repo_uri = pathlib.Path(repo_uri).resolve() + repo_sha256 = hashlib.sha256(repo_uri.encode()) + cache_file = cache_folder / str(repo_sha256.hexdigest() + '.json') if cache_file.is_file(): repo = pathlib.Path(cache_file).resolve() with repo.open('r') as f: diff --git a/scripts/o3de/o3de/print_registration.py b/scripts/o3de/o3de/print_registration.py index 77e098d0ba..2bd3202ca0 100644 --- a/scripts/o3de/o3de/print_registration.py +++ b/scripts/o3de/o3de/print_registration.py @@ -39,69 +39,68 @@ def get_project_path(project_path: pathlib.Path, project_name: str) -> pathlib.P return project_path -def print_this_engine(verbose: int) -> int: +def print_this_engine(verbose: int = 0) -> int: this_engine_path = manifest.get_this_engine_path() print(f'This Engine:\n{json.dumps(str(this_engine_path), indent=4)}') if verbose > 0: return print_manifest_json_data([this_engine_path], 'This Engine', - manifest.get_engine_json_data, 'engine_path') + manifest.get_engine_json_data, 'engine_path') return 0 -def print_engines(verbose: int) -> None: - engines_data = manifest.get_engines() +def print_engines(verbose: int = 0) -> int: + engines_data = manifest.get_manifest_engines() print(f'Engine Paths:\n{json.dumps(engines_data, indent=4)}') if verbose > 0: return print_manifest_json_data(engines_data, 'Engine Jsons', - manifest.get_engine_json_data, 'engine_path') + manifest.get_engine_json_data, 'engine_path') return 0 -def print_projects(verbose: int) -> int: - projects_data = manifest.get_projects() +def print_projects(verbose: int = 0) -> int: + projects_data = manifest.get_all_projects() print(f'Project Paths:\n{json.dumps(projects_data, indent=4)}') if verbose > 0: return print_manifest_json_data(projects_data, 'Project Jsons', - manifest.get_project_json_data, 'project_path') + manifest.get_project_json_data, 'project_path') return 0 -def print_gems(verbose: int) -> int: - gems_data = manifest.get_gems() +def print_gems(verbose: int = 0) -> int: + gems_data = manifest.get_all_gems() print(f'Gem Paths:\n{json.dumps(gems_data, indent=4)}') if verbose > 0: return print_manifest_json_data(gems_data, 'Gem Jsons', - manifest.get_gem_json_data, 'gem_path') + manifest.get_gem_json_data, 'gem_path') return 0 -def print_external_subdirectories(verbose: int) -> int: - external_subdirs_data = manifest.get_external_subdirectories() +def print_external_subdirectories(verbose: int = 0) -> int: + external_subdirs_data = manifest.get_all_external_subdirectories() print(f'External Subdirectories:\n{json.dumps(external_subdirs_data, indent=4)}') return 0 - def print_templates(verbose: int) -> int: - templates_data = manifest.get_templates() + templates_data = manifest.get_all_templates() print(f'Template Paths:\n{json.dumps(templates_data, indent=4)}') if verbose > 0: return print_manifest_json_data(templates_data, 'Template Jsons', - manifest.get_template_json_data, 'template_path') + manifest.get_template_json_data, 'template_path') return 0 def print_restricted(verbose: int) -> int: - restricted_data = manifest.get_restricted() + restricted_data = manifest.get_manifest_restricted() print(f'Restricted Paths:\n{json.dumps(restricted_data, indent=4)}') if verbose > 0: return print_manifest_json_data(restricted_data, 'Restricted Jsons', - manifest.get_restricted_json_data, 'restricted_path') + manifest.get_restricted_json_data, 'restricted_path') return 0 @@ -112,7 +111,7 @@ def print_engine_projects(verbose: int) -> int: if verbose > 0: return print_manifest_json_data(engine_projects_data, 'Project Jsons', - manifest.get_project_json_data, 'project_path') + manifest.get_project_json_data, 'project_path') return 0 @@ -122,7 +121,7 @@ def print_engine_gems(verbose: int) -> int: if verbose > 0: return print_manifest_json_data(engine_gems_data, 'Gem Jsons', - manifest.get_gem_json_data, 'gem_path') + manifest.get_gem_json_data, 'gem_path') return 0 @@ -132,17 +131,7 @@ def print_engine_templates(verbose: int) -> int: if verbose > 0: return print_manifest_json_data(engine_templates_data, 'Template Jsons', - manifest.get_template_json_data, 'template_path') - return 0 - - -def print_engine_restricted(verbose: int) -> int: - engine_restricted_data = manifest.get_engine_restricted() - print(f'Restricted Paths:\n{json.dumps(engine_restricted_data, indent=4)}') - - if verbose > 0: - return print_manifest_json_data(engine_restricted_data, 'Restricted Jsons', - manifest.get_restricted_json_data, 'restricted_path') + manifest.get_template_json_data, 'template_path') return 0 @@ -153,21 +142,6 @@ def print_engine_external_subdirectories(verbose: int) -> int: # Project output methods -def print_project_engine_name(verbose: int, project_path: pathlib.Path, project_name: str) -> int: - project_path = get_project_path(project_path, project_name) - if not project_path: - return 1 - - engine_name = manifest.get_project_engine_name(project_path) - if engine_name: - print(f'Project\'s engine name:\n{engine_name}') - return 0 - - if verbose > 0: - logger.info(f'project.json at path "{project_path}" contains no registered "engine" field') - return 1 - - def print_project_gems(verbose: int, project_path: pathlib.Path, project_name: str) -> int: project_path = get_project_path(project_path, project_name) if not project_path: @@ -178,7 +152,7 @@ def print_project_gems(verbose: int, project_path: pathlib.Path, project_name: s if verbose > 0: return print_manifest_json_data(project_gems_data, 'Gems Jsons', - manifest.get_gem_json_data, 'gem_path') + manifest.get_gem_json_data, 'gem_path') return 0 @@ -201,20 +175,7 @@ def print_project_templates(verbose: int, project_path: pathlib.Path, project_na print(f'Template Paths:\n{json.dumps(project_templates_data, indent=4)}') if verbose > 0: return print_manifest_json_data(project_templates_data, 'Template Jsons', - manifest.get_template_json_data, 'template_path') - return 0 - - -def print_project_restricted(verbose: int, project_path: pathlib.Path, project_name: str) -> int: - project_path = get_project_path(project_path, project_name) - if not project_path: - return 1 - - project_restricted_data = manifest.get_project_restricted(project_path) - print(f'Restricted Paths:\n{json.dumps(project_restricted_data, indent=4)}') - if verbose > 0: - return print_manifest_json_data(project_restricted_data, 'Restricted Jsons', - manifest.get_restricted_json_data, 'restricted_path') + manifest.get_template_json_data, 'template_path') return 0 @@ -224,12 +185,12 @@ def print_all_projects(verbose: int) -> int: if verbose > 0: return print_manifest_json_data(all_projects_data, 'Project Jsons', - manifest.get_project_json_data, 'project_path') + manifest.get_project_json_data, 'project_path') return 0 def print_all_gems(verbose: int, project_path: pathlib.Path = None, project_name: str = None) -> int: - all_gems = manifest.get_gems() + all_gems = manifest.get_manifest_gems() all_gems.extend(manifest.get_engine_gems()) # If a project path or project name is supplied query the gems from that project, otherwise query the gems from @@ -245,12 +206,12 @@ def print_all_gems(verbose: int, project_path: pathlib.Path = None, project_name if verbose > 0: return print_manifest_json_data(all_gems, 'Gem Jsons', - manifest.get_gem_json_data, 'gem_path') + manifest.get_gem_json_data, 'gem_path') return 0 def print_all_external_subdirectories(verbose: int, project_path: pathlib.Path = None, project_name: str = None) -> int: - all_external_subdirectories = manifest.get_external_subdirectories() + all_external_subdirectories = manifest.get_manifest_external_subdirectories() all_external_subdirectories.extend(manifest.get_engine_external_subdirectories()) # If a project path or project name is supplied query the external subdirectories from that project, @@ -267,7 +228,7 @@ def print_all_external_subdirectories(verbose: int, project_path: pathlib.Path = def print_all_templates(verbose: int, project_path: pathlib.Path = None, project_name: str = None) -> int: - all_templates = manifest.get_templates() + all_templates = manifest.get_manifest_templates() all_templates.extend(manifest.get_engine_templates()) # If a project path or project name is supplied query the templates from that project, @@ -283,31 +244,9 @@ def print_all_templates(verbose: int, project_path: pathlib.Path = None, project if verbose > 0: return print_manifest_json_data(all_templates, 'Template Jsons', - manifest.get_template_json_data, 'template_path') - return 0 - - -def print_all_restricted(verbose: int, project_path: pathlib.Path = None, project_name: str = None) -> int: - all_restricted = manifest.get_restricted() - all_restricted.extend(manifest.get_engine_restricted()) - - # If a project path or project name is supplied query the restricted from that project, - # otherwise query the restricted from all projects - project_path = get_project_path(project_path, project_name) if project_path or project_name else None - projects = [project_path] if project_path else manifest.get_all_projects() - for project in projects: - all_restricted.extend(manifest.get_project_restricted(project)) - - # Filter out duplicates - all_restricted = list(dict.fromkeys(all_restricted)) - print(f'Restricted Paths:\n{json.dumps(all_restricted, indent=4)}') - - if verbose > 0: - return print_manifest_json_data(all_restricted, 'Restricted Jsons', - manifest.get_restricted_json_data, 'restricted_path') + manifest.get_template_json_data, 'template_path') return 0 - def print_manifest_json_data(uri_json_data: list, print_prefix: str, get_json_func: callable, get_json_data_kw: str) -> int: print('\n') @@ -351,7 +290,7 @@ def print_repos_data(repos_data: dict) -> int: def print_repos(verbose: int) -> int: - repos_data = manifest.get_repos() + repos_data = manifest.get_manifest_repos() print(json.dumps(repos_data, indent=4)) if verbose > 0: @@ -370,16 +309,13 @@ def register_show(verbose: int, project_path: pathlib.Path = None, project_name: result = print_all_projects(verbose) or result result = print_all_gems(verbose, project_path, project_name) or result result = print_all_templates(verbose, project_path, project_name) or result - result = print_all_restricted(verbose, project_path, project_name) or result + result = print_restricted(verbose) or result result = print_repos(verbose) or result return result def _run_register_show(args: argparse) -> int: - if args.override_home_folder: - manifest.override_home_folder = args.override_home_folder - if args.this_engine: return print_this_engine(args.verbose) elif args.engines: @@ -393,7 +329,7 @@ def _run_register_show(args: argparse) -> int: elif args.templates: return print_templates(args.verbose) elif args.repos: - return register_show_repos(args.verbose) + return print_repos(args.verbose) elif args.restricted: return print_restricted(args.verbose) @@ -405,8 +341,6 @@ def _run_register_show(args: argparse) -> int: return print_engine_external_subdirectories(args.verbose) elif args.engine_templates: return print_engine_templates(args.verbose) - elif args.engine_restricted: - return print_engine_restricted(args.verbose) elif args.project_gems: return print_project_gems(args.verbose, args.project_path, args.project_name) @@ -414,8 +348,6 @@ def _run_register_show(args: argparse) -> int: return print_project_external_subdirectories(args.verbose, args.project_path, args.project_name) elif args.project_templates: return print_project_templates(args.verbose, args.project_path, args.project_name) - elif args.project_restricted: - return print_project_restricted(args.verbose, args.project_path, args.project_name) elif args.project_engine_name: return print_project_engine_name(args.verbose, args.project_path, args.project_name) @@ -427,8 +359,6 @@ def _run_register_show(args: argparse) -> int: return print_all_external_subdirectories(args.verbose, args.project_path, args.project_name) elif args.all_templates: return print_all_templates(args.verbose, args.project_path, args.project_name) - elif args.all_restricted: - return print_all_restricted(args.verbose, args.project_path, args.project_name) else: return register_show(args.verbose, args.project_path, args.project_name) @@ -538,9 +468,6 @@ def add_parser_args(parser): project_group.add_argument('-pn', '--project-name', type=str, help='The name of a project.') - parser.add_argument('-ohf', '--override-home-folder', type=str, required=False, - help='By default the home folder is the user folder, override it to this folder.') - parser.set_defaults(func=_run_register_show) diff --git a/scripts/o3de/o3de/register.py b/scripts/o3de/o3de/register.py index a175104997..926c413521 100644 --- a/scripts/o3de/o3de/register.py +++ b/scripts/o3de/o3de/register.py @@ -490,7 +490,7 @@ def register_repo(json_data: dict, repo_sha256 = hashlib.sha256(url.encode()) cache_file = manifest.get_o3de_cache_folder() / str(repo_sha256.hexdigest() + '.json') - result = utils.download_file(parsed_uri, cache_file, True) + result = utils.download_file(url, cache_file, True) if result == 0: json_data.setdefault('repos', []).insert(0, repo_uri) @@ -793,9 +793,6 @@ def register(engine_path: pathlib.Path = None, def _run_register(args: argparse) -> int: - if args.override_home_folder: - manifest.override_home_folder = args.override_home_folder - if args.update: remove_invalid_o3de_objects() return repo.refresh_repos() @@ -891,8 +888,6 @@ def add_parser_args(parser): default=False, help='Refresh the repo cache.') - parser.add_argument('-ohf', '--override-home-folder', type=pathlib.Path, required=False, - help='By default the home folder is the user folder, override it to this folder.') parser.add_argument('-r', '--remove', action='store_true', required=False, default=False, help='Remove entry.') diff --git a/scripts/o3de/tests/unit_test_enable_gem.py b/scripts/o3de/tests/unit_test_enable_gem.py index c765f74731..8067fc329d 100644 --- a/scripts/o3de/tests/unit_test_enable_gem.py +++ b/scripts/o3de/tests/unit_test_enable_gem.py @@ -42,8 +42,10 @@ TEST_GEM_JSON_PAYLOAD = ''' { "gem_name": "TestGem", "display_name": "TestGem", - "license": "What license TestGem uses goes here: i.e. https://opensource.org/licenses/MIT", - "origin": "The primary repo for TestGem goes here: i.e. http://www.mydomain.com", + "license": "Apache-2.0 Or MIT", + "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", + "origin": "Open 3D Engine - o3de.org", + "origin_url": "https://github.com/o3de/o3de", "type": "Code", "summary": "A short description of TestGem.", "canonical_tags": [ @@ -53,7 +55,10 @@ TEST_GEM_JSON_PAYLOAD = ''' "TestGem" ], "icon_path": "preview.png", - "requirements": "" + "requirements": "Any requirement goes here.", + "documentation_url": "The link to the documentation goes here.", + "dependencies": [ + ] } ''' diff --git a/scripts/o3de/tests/unit_test_engine_template.py b/scripts/o3de/tests/unit_test_engine_template.py index ed1c8258d3..da23ee11f1 100755 --- a/scripts/o3de/tests/unit_test_engine_template.py +++ b/scripts/o3de/tests/unit_test_engine_template.py @@ -93,37 +93,28 @@ TEST_TEMPLATE_JSON_CONTENTS = """\ "copyFiles": [ { "file": "Code/Include/${Name}/${Name}Bus.h", - "origin": "Code/Include/${Name}/${Name}Bus.h", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { - "file": "Code/Include/Platform/Salem/${Name}Bus.h", - "origin": "Code/Include/Platform/Salem/${Name}Bus.h", - "isTemplated": true, - "isOptional": false + "file": "Code/Include/Platform/Windows/${Name}Bus.h", + "isTemplated": true } ], "createDirectories": [ { - "dir": "Code", - "origin": "Code" + "dir": "Code" }, { - "dir": "Code/Include", - "origin": "Code/Include" + "dir": "Code/Include" }, { - "dir": "Code/Include/${Name}", - "origin": "Code/Include/${Name}" + "dir": "Code/Include/${Name}" }, { - "dir": "Code/Include/Platform", - "origin": "Code/Include/Platform" + "dir": "Code/Include/Platform" }, { - "dir": "Code/Include/Platform/Salem", - "origin": "Code/Include/Platform/Salem" + "dir": "Code/Include/Platform/Windows" } ] } @@ -174,10 +165,10 @@ def test_create_template(tmpdir, with gem_bus_file.open('w') as s: s.write(concrete_contents) - engine_gem_code_include_platform_salem = template_source_path / 'Code/Include/Platform/Salem' - engine_gem_code_include_platform_salem.mkdir(parents=True, exist_ok=True) + engine_gem_code_include_platform_windows = template_source_path / 'Code/Include/Platform/Windows' + engine_gem_code_include_platform_windows.mkdir(parents=True, exist_ok=True) - restricted_gem_bus_file = engine_gem_code_include_platform_salem / 'TestTemplateBus.h' + restricted_gem_bus_file = engine_gem_code_include_platform_windows / 'TestTemplateBus.h' with restricted_gem_bus_file.open('w') as s: s.write(concrete_contents) @@ -209,9 +200,9 @@ def test_create_template(tmpdir, else: assert s_data == templated_contents_without_license - platform_template_folder = engine_root / 'Salem/Templates' + platform_template_folder = engine_root / 'Windows/Templates' - new_platform_default_name_bus_file = template_content_folder / 'Code/Include/Platform/Salem/${Name}Bus.h' + new_platform_default_name_bus_file = template_content_folder / 'Code/Include/Platform/Windows/${Name}Bus.h' assert new_platform_default_name_bus_file.is_file() with new_platform_default_name_bus_file.open('r') as s: s_data = s.read() @@ -255,7 +246,7 @@ class TestCreateTemplate: s.write(templated_contents) template_content_folder = template_default_folder / 'Template' - platform_default_name_bus_dir = template_content_folder / 'Code/Include/Platform/Salem' + platform_default_name_bus_dir = template_content_folder / 'Code/Include/Platform/Windows' platform_default_name_bus_dir.mkdir(parents=True, exist_ok=True) platform_default_name_bus_file = platform_default_name_bus_dir / '${Name}Bus.h' @@ -263,10 +254,13 @@ class TestCreateTemplate: s.write(templated_contents) template_dest_path = engine_root / instantiated_name - # Skip registeration in test + # Skip registration in test with patch('uuid.uuid4', return_value=uuid.uuid5(uuid.NAMESPACE_DNS, instantiated_name)) as uuid4_mock: - result = create_from_template_func(template_dest_path, template_path=template_default_folder, force=True, - keep_license_text=keep_license_text, **create_from_template_kwargs) + result = create_from_template_func(template_dest_path, + template_path=template_default_folder, + keep_license_text=keep_license_text, + force=True, + **create_from_template_kwargs) if expect_failure: assert result != 0 else: @@ -281,7 +275,7 @@ class TestCreateTemplate: s_data = s.read() assert s_data == concrete_contents - platform_test_bus_folder = test_folder / 'Code/Include/Platform/Salem' + platform_test_bus_folder = test_folder / 'Code/Include/Platform/Windows' assert platform_test_bus_folder.is_dir() platform_default_name_bus_file = platform_test_bus_folder / f'{instantiated_name}Bus.h' @@ -338,9 +332,7 @@ class TestCreateTemplate: template_json_dict.setdefault('copyFiles', []).append( { "file": "project.json", - "origin": "project.json", - "isTemplated": True, - "isOptional": False + "isTemplated": True }) # Convert the python dictionary back into a json string template_json_contents = json.dumps(template_json_dict, indent=4) @@ -376,9 +368,7 @@ class TestCreateTemplate: template_json_dict.setdefault('copyFiles', []).append( { "file": "gem.json", - "origin": "gem.json", - "isTemplated": True, - "isOptional": False + "isTemplated": True }) #Convert dict back to string template_json_contents = json.dumps(template_json_dict, indent=4) diff --git a/scripts/o3de/tests/unit_test_gem_properties.py b/scripts/o3de/tests/unit_test_gem_properties.py index dee5811b65..6358917852 100644 --- a/scripts/o3de/tests/unit_test_gem_properties.py +++ b/scripts/o3de/tests/unit_test_gem_properties.py @@ -18,10 +18,9 @@ TEST_GEM_JSON_PAYLOAD = ''' { "gem_name": "TestGem", "display_name": "TestGem", - "license": "MIT", - "license_url": "https://opensource.org/licenses/MIT", + "license": "Apache-2.0 or MIT", + "license_url": "https://github.com/o3de/o3de/blob/development/LICENSE.txt", "origin": "The primary repo for TestGem goes here: i.e. http://www.mydomain.com", - "type": "Code", "summary": "A short description of TestGem.", "canonical_tags": [ "Gem" @@ -31,7 +30,9 @@ TEST_GEM_JSON_PAYLOAD = ''' ], "icon_path": "preview.png", "requirements": "", - "documentation_url": "https://o3de.org/docs/" + "documentation_url": "https://o3de.org/docs/", + "dependencies": [ + ] } ''' diff --git a/scripts/o3de/tests/unit_test_manifest.py b/scripts/o3de/tests/unit_test_manifest.py index ad4809dc1d..c7d7a7573b 100644 --- a/scripts/o3de/tests/unit_test_manifest.py +++ b/scripts/o3de/tests/unit_test_manifest.py @@ -22,7 +22,7 @@ from o3de import manifest ]) class TestGetTemplatesForCreation: @staticmethod - def get_templates() -> list: + def get_manifest_templates() -> list: return [] @staticmethod @@ -40,20 +40,24 @@ class TestGetTemplatesForCreation: ) def test_get_templates_for_generic_creation(self, valid_project_json_paths, valid_gem_json_paths, expected_template_paths): - def validate_project_json(template_path) -> bool: - return pathlib.Path(template_path) in valid_project_json_paths + def validate_project_json(project_json_path) -> bool: + return pathlib.Path(project_json_path) in valid_project_json_paths - def validate_gem_json(template_path) -> bool: - return pathlib.Path(template_path) in valid_gem_json_paths + def validate_gem_json(gem_json_path) -> bool: + return pathlib.Path(gem_json_path) in valid_gem_json_paths - with patch('o3de.manifest.get_templates', side_effect=self.get_templates) as get_templates_patch, \ + with patch('o3de.manifest.get_manifest_templates', side_effect=self.get_manifest_templates)\ + as get_manifest_templates_patch, \ patch('o3de.manifest.get_project_templates', side_effect=self.get_project_templates)\ as get_project_templates_patch, \ patch('o3de.manifest.get_engine_templates', side_effect=self.get_engine_templates)\ as get_engine_templates_patch, \ - patch('o3de.validation.valid_o3de_template_json', return_value=True) as validate_template_json,\ - patch('o3de.validation.valid_o3de_project_json', side_effect=validate_project_json) as validate_project_json,\ - patch('o3de.validation.valid_o3de_gem_json', side_effect=validate_gem_json) as validate_gem_json: + patch('o3de.validation.valid_o3de_template_json', return_value=True) \ + as validate_template_json,\ + patch('o3de.validation.valid_o3de_project_json', side_effect=validate_project_json) \ + as validate_project_json,\ + patch('o3de.validation.valid_o3de_gem_json', side_effect=validate_gem_json) \ + as validate_gem_json: templates = manifest.get_templates_for_generic_creation() assert templates == expected_template_paths @@ -64,21 +68,24 @@ class TestGetTemplatesForCreation: ) def test_get_templates_for_gem_creation(self, valid_project_json_paths, valid_gem_json_paths, expected_template_paths): - def validate_project_json(template_path) -> bool: - return pathlib.Path(template_path) in valid_project_json_paths + def validate_project_json(project_json_path) -> bool: + return pathlib.Path(project_json_path) in valid_project_json_paths - def validate_gem_json(template_path) -> bool: - return pathlib.Path(template_path) in valid_gem_json_paths + def validate_gem_json(gem_json_path) -> bool: + return pathlib.Path(gem_json_path) in valid_gem_json_paths - with patch('o3de.manifest.get_templates', side_effect=self.get_templates) as get_templates_patch, \ + with patch('o3de.manifest.get_manifest_templates', side_effect=self.get_manifest_templates)\ + as get_manifest_templates_patch, \ patch('o3de.manifest.get_project_templates', side_effect=self.get_project_templates) \ as get_project_templates_patch, \ patch('o3de.manifest.get_engine_templates', side_effect=self.get_engine_templates) \ as get_engine_templates_patch, \ - patch('o3de.validation.valid_o3de_template_json', return_value=True) as validate_template_json, \ - patch('o3de.validation.valid_o3de_project_json', - side_effect=validate_project_json) as validate_project_json, \ - patch('o3de.validation.valid_o3de_gem_json', side_effect=validate_gem_json) as validate_gem_json: + patch('o3de.validation.valid_o3de_template_json', return_value=True) \ + as validate_template_json, \ + patch('o3de.validation.valid_o3de_project_json', side_effect=validate_project_json) \ + as validate_project_json, \ + patch('o3de.validation.valid_o3de_gem_json', side_effect=validate_gem_json) \ + as validate_gem_json: templates = manifest.get_templates_for_project_creation() assert templates == expected_template_paths @@ -89,20 +96,23 @@ class TestGetTemplatesForCreation: ) def test_get_templates_for_project_creation(self, valid_project_json_paths, valid_gem_json_paths, expected_template_paths): - def validate_project_json(template_path) -> bool: - return pathlib.Path(template_path) in valid_project_json_paths + def validate_project_json(project_json_path) -> bool: + return pathlib.Path(project_json_path) in valid_project_json_paths - def validate_gem_json(template_path) -> bool: - return pathlib.Path(template_path) in valid_gem_json_paths + def validate_gem_json(gem_json_path) -> bool: + return pathlib.Path(gem_json_path) in valid_gem_json_paths - with patch('o3de.manifest.get_templates', side_effect=self.get_templates) as get_templates_patch, \ + with patch('o3de.manifest.get_manifest_templates', side_effect=self.get_manifest_templates) \ + as get_manifest_templates_patch, \ patch('o3de.manifest.get_project_templates', side_effect=self.get_project_templates) \ as get_project_templates_patch, \ patch('o3de.manifest.get_engine_templates', side_effect=self.get_engine_templates) \ as get_engine_templates_patch, \ - patch('o3de.validation.valid_o3de_template_json', return_value=True) as validate_template_json, \ - patch('o3de.validation.valid_o3de_project_json', - side_effect=validate_project_json) as validate_project_json, \ - patch('o3de.validation.valid_o3de_gem_json', side_effect=validate_gem_json) as validate_gem_json: + patch('o3de.validation.valid_o3de_template_json', return_value=True) \ + as validate_template_json, \ + patch('o3de.validation.valid_o3de_project_json', side_effect=validate_project_json) \ + as validate_project_json, \ + patch('o3de.validation.valid_o3de_gem_json', side_effect=validate_gem_json) \ + as validate_gem_json: templates = manifest.get_templates_for_gem_creation() assert templates == expected_template_paths \ No newline at end of file diff --git a/scripts/o3de/tests/unit_test_print_registration.py b/scripts/o3de/tests/unit_test_print_registration.py index 7e3e75edcd..d01434c99f 100644 --- a/scripts/o3de/tests/unit_test_print_registration.py +++ b/scripts/o3de/tests/unit_test_print_registration.py @@ -90,27 +90,20 @@ TEST_TEMPLATE_JSON_PAYLOAD = ''' "copyFiles": [ { "file": "CMakeLists.txt", - "origin": "CMakeLists.txt", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "gem.json", - "origin": "gem.json", - "isTemplated": true, - "isOptional": false + "isTemplated": true }, { "file": "preview.png", - "origin": "preview.png", - "isTemplated": false, - "isOptional": false + "isTemplated": false } ], "createDirectories": [ { - "dir": "Assets", - "origin": "Assets" + "dir": "Assets" } ] } @@ -277,13 +270,9 @@ class TestPrintRegistration: # Patch the manifest.py function to locate gem.json files in external subdirectories # to just return a fake path to a single test gem - def get_gems_from_subdirectories(external_subdirs: list) -> list: - return ["D:/TestGem"] - with patch('o3de.manifest.load_o3de_manifest', side_effect=self.load_manifest_json) as load_manifest_patch, \ patch('o3de.manifest.get_gem_json_data', side_effect=self.get_gem_json_data) as get_json_patch, \ patch('o3de.manifest.get_project_json_data', side_effect=self.get_project_json_data) as get_project_json_patch, \ - patch('o3de.manifest.get_gems_from_subdirectories', side_effect=get_gems_from_subdirectories) as get_gems_from_subdirs_patch, \ patch('o3de.print_registration.get_project_path', return_value=project_path) as get_project_path_patch: result = print_registration._run_register_show(test_args) assert result == 0 From 284ae60139eef1c69cd8981048dc77c4bd26631a Mon Sep 17 00:00:00 2001 From: moudgils <47460854+moudgils@users.noreply.github.com> Date: Fri, 14 Jan 2022 10:34:57 -0800 Subject: [PATCH 482/948] Add missing 'precise' keyword for Vertex shaders (#6902) Signed-off-by: moudgils <47460854+moudgils@users.noreply.github.com> --- .../Assets/Materials/Types/EnhancedPBR_DepthPass_WithPS.azsl | 4 ++-- .../Assets/Materials/Types/EnhancedPBR_ForwardPass.azsl | 2 +- Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl | 2 +- .../Types/StandardMultilayerPBR_DepthPass_WithPS.azsl | 4 ++-- .../Materials/Types/StandardMultilayerPBR_ForwardPass.azsl | 2 +- .../TestData/Materials/Types/AutoBrick_ForwardPass.azsl | 2 +- .../TestData/Materials/Types/MinimalPBR_ForwardPass.azsl | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_DepthPass_WithPS.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_DepthPass_WithPS.azsl index f2564cf10c..08642decc0 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_DepthPass_WithPS.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_DepthPass_WithPS.azsl @@ -28,7 +28,7 @@ struct VSInput struct VSDepthOutput { - float4 m_position : SV_Position; + precise linear centroid float4 m_position : SV_Position; float2 m_uv[UvSetCount] : UV1; // only used for parallax depth calculation @@ -62,7 +62,7 @@ VSDepthOutput MainVS(VSInput IN) struct PSDepthOutput { - float m_depth : SV_Depth; + precise float m_depth : SV_Depth; }; PSDepthOutput MainPS(VSDepthOutput IN, bool isFrontFace : SV_IsFrontFace) 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 0f9771e480..4b37f67930 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_ForwardPass.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_ForwardPass.azsl @@ -67,7 +67,7 @@ struct VSInput struct VSOutput { // Base fields (required by the template azsli file)... - float4 m_position : SV_Position; + precise linear centroid float4 m_position : SV_Position; float3 m_normal: NORMAL; float3 m_tangent : TANGENT; float3 m_bitangent : BITANGENT; diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl index 523353f8fa..00dee50c93 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl @@ -86,7 +86,7 @@ struct VSInput struct VSOutput { // Base fields (required by the template azsli file)... - float4 m_position : SV_Position; + precise linear centroid float4 m_position : SV_Position; float3 m_normal: NORMAL; float3 m_tangent : TANGENT; float3 m_bitangent : BITANGENT; diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_DepthPass_WithPS.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_DepthPass_WithPS.azsl index 39597e2bdd..7875457489 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_DepthPass_WithPS.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_DepthPass_WithPS.azsl @@ -41,7 +41,7 @@ struct VSInput struct VSDepthOutput { - float4 m_position : SV_Position; + precise linear centroid float4 m_position : SV_Position; float2 m_uv[UvSetCount] : UV1; // only used for parallax depth calculation @@ -88,7 +88,7 @@ VSDepthOutput MainVS(VSInput IN) struct PSDepthOutput { - float m_depth : SV_Depth; + precise float m_depth : SV_Depth; }; PSDepthOutput MainPS(VSDepthOutput IN, bool isFrontFace : SV_IsFrontFace) diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_ForwardPass.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_ForwardPass.azsl index 8f58c6dd33..5b05e48d3b 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_ForwardPass.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_ForwardPass.azsl @@ -80,7 +80,7 @@ struct VSInput struct VSOutput { // Base fields (required by the template azsli file)... - float4 m_position : SV_Position; + precise linear centroid float4 m_position : SV_Position; float3 m_normal: NORMAL; float3 m_tangent : TANGENT; float3 m_bitangent : BITANGENT; diff --git a/Gems/Atom/TestData/TestData/Materials/Types/AutoBrick_ForwardPass.azsl b/Gems/Atom/TestData/TestData/Materials/Types/AutoBrick_ForwardPass.azsl index 2dbba46d8b..05ce5f4774 100644 --- a/Gems/Atom/TestData/TestData/Materials/Types/AutoBrick_ForwardPass.azsl +++ b/Gems/Atom/TestData/TestData/Materials/Types/AutoBrick_ForwardPass.azsl @@ -28,7 +28,7 @@ struct VSInput struct VSOutput { - float4 m_position : SV_Position; + precise linear centroid float4 m_position : SV_Position; float3 m_normal: NORMAL; float3 m_tangent : TANGENT; float3 m_bitangent : BITANGENT; diff --git a/Gems/Atom/TestData/TestData/Materials/Types/MinimalPBR_ForwardPass.azsl b/Gems/Atom/TestData/TestData/Materials/Types/MinimalPBR_ForwardPass.azsl index 2f6f038e4b..fe9e4099d0 100644 --- a/Gems/Atom/TestData/TestData/Materials/Types/MinimalPBR_ForwardPass.azsl +++ b/Gems/Atom/TestData/TestData/Materials/Types/MinimalPBR_ForwardPass.azsl @@ -33,7 +33,7 @@ struct VSInput struct VSOutput { - float4 m_position : SV_Position; + precise linear centroid float4 m_position : SV_Position; float3 m_normal: NORMAL; float3 m_tangent : TANGENT; float3 m_bitangent : BITANGENT; From bbfe740cc9c9eb1772aa35f76a1ba0a98606f9c7 Mon Sep 17 00:00:00 2001 From: allisaurus <34254888+allisaurus@users.noreply.github.com> Date: Fri, 14 Jan 2022 10:52:32 -0800 Subject: [PATCH 483/948] Disable flaky HttpRequestor test (#6866) Signed-off-by: allisaurus <34254888+allisaurus@users.noreply.github.com> --- Gems/HttpRequestor/Code/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Gems/HttpRequestor/Code/CMakeLists.txt b/Gems/HttpRequestor/Code/CMakeLists.txt index 4ebca5518c..56d3527e24 100644 --- a/Gems/HttpRequestor/Code/CMakeLists.txt +++ b/Gems/HttpRequestor/Code/CMakeLists.txt @@ -71,5 +71,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) ) ly_add_googletest( NAME Gem::HttpRequestor.Tests + TEST_SUITE sandbox ) endif() From 7680d1f9d0ea0b2ac2a5f073ba5329f8b7080033 Mon Sep 17 00:00:00 2001 From: Scott Romero <24445312+AMZN-ScottR@users.noreply.github.com> Date: Fri, 14 Jan 2022 11:28:21 -0800 Subject: [PATCH 484/948] [development] fixed issue with dangling budget pointers if the budget tracker is torn down and rebuilt (#6801) Signed-off-by: AMZN-ScottR 24445312+AMZN-ScottR@users.noreply.github.com --- .../AzCore/Component/ComponentApplication.cpp | 10 +++++---- Code/Framework/AzCore/AzCore/Debug/Budget.h | 16 +++++++++----- .../AzCore/AzCore/Debug/BudgetTracker.cpp | 22 +++++++++++++------ .../AzCore/AzCore/Debug/BudgetTracker.h | 4 ++-- 4 files changed, 33 insertions(+), 19 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp b/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp index 693b2f1648..72b6e807d2 100644 --- a/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp +++ b/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp @@ -565,10 +565,6 @@ namespace AZ m_entityActivatedEvent.DisconnectAllHandlers(); m_entityDeactivatedEvent.DisconnectAllHandlers(); -#if !defined(_RELEASE) - m_budgetTracker.Reset(); -#endif - DestroyAllocator(); } @@ -758,6 +754,12 @@ namespace AZ static_cast(m_settingsRegistry.get())->ClearNotifiers(); static_cast(m_settingsRegistry.get())->ClearMergeEvents(); +#if !defined(_RELEASE) + // the budget tracker must be cleaned up prior to module unloading to ensure + // budgets initialized cross boundary are freed properly + m_budgetTracker.Reset(); +#endif + // Uninit and unload any dynamic modules. m_moduleManager->UnloadModules(); ComponentApplicationLifecycle::SignalEvent(*m_settingsRegistry, "GemsUnloaded", R"({})"); diff --git a/Code/Framework/AzCore/AzCore/Debug/Budget.h b/Code/Framework/AzCore/AzCore/Debug/Budget.h index 4646ef8b2c..c909302886 100644 --- a/Code/Framework/AzCore/AzCore/Debug/Budget.h +++ b/Code/Framework/AzCore/AzCore/Debug/Budget.h @@ -62,12 +62,16 @@ namespace AZ::Debug // // Anywhere the budget is used, the budget must be declared (either in a header or in the source file itself) // AZ_DECLARE_BUDGET(AzCore); -#define AZ_DEFINE_BUDGET(name) \ - ::AZ::Debug::Budget* AZ_BUDGET_GETTER(name)() \ - { \ - constexpr static uint32_t crc = AZ_CRC_CE(#name); \ - static ::AZ::Debug::Budget* budget = ::AZ::Debug::BudgetTracker::GetBudgetFromEnvironment(#name, crc); \ - return budget; \ +#define AZ_DEFINE_BUDGET(name) \ + ::AZ::Debug::Budget* AZ_BUDGET_GETTER(name)() \ + { \ + static ::AZ::Debug::Budget* budget = nullptr; \ + if (budget == nullptr) \ + { \ + constexpr static uint32_t crc = AZ_CRC_CE(#name); \ + ::AZ::Debug::BudgetTracker::GetBudgetFromEnvironment(budget, #name, crc); \ + } \ + return budget; \ } #endif diff --git a/Code/Framework/AzCore/AzCore/Debug/BudgetTracker.cpp b/Code/Framework/AzCore/AzCore/Debug/BudgetTracker.cpp index 2dac9a566e..faadbfc31a 100644 --- a/Code/Framework/AzCore/AzCore/Debug/BudgetTracker.cpp +++ b/Code/Framework/AzCore/AzCore/Debug/BudgetTracker.cpp @@ -13,23 +13,24 @@ #include #include #include +#include #include namespace AZ::Debug { struct BudgetTracker::BudgetTrackerImpl { - AZStd::unordered_map m_budgets; + AZStd::unordered_map m_budgets; + AZStd::unordered_set m_externalBudgetRefs; }; - Budget* BudgetTracker::GetBudgetFromEnvironment(const char* budgetName, uint32_t crc) + void BudgetTracker::GetBudgetFromEnvironment(Budget*& extBudgetRef, const char* budgetName, uint32_t crc) { BudgetTracker* tracker = Interface::Get(); if (tracker) { - return &tracker->GetBudget(budgetName, crc); + tracker->GetBudget(extBudgetRef, budgetName, crc); } - return nullptr; } BudgetTracker::~BudgetTracker() @@ -54,17 +55,24 @@ namespace AZ::Debug if (m_impl) { Interface::Unregister(this); + + for (auto budgetRef : m_impl->m_externalBudgetRefs) + { + *budgetRef = nullptr; + } + delete m_impl; m_impl = nullptr; } } - Budget& BudgetTracker::GetBudget(const char* budgetName, uint32_t crc) + void BudgetTracker::GetBudget(Budget*& extBudgetRef, const char* budgetName, uint32_t crc) { AZStd::scoped_lock lock{ m_mutex }; - auto it = m_impl->m_budgets.try_emplace(budgetName, budgetName, crc).first; + m_impl->m_externalBudgetRefs.insert(&extBudgetRef); - return it->second; + auto iter = m_impl->m_budgets.try_emplace(budgetName, budgetName, crc).first; + extBudgetRef = &iter->second; } } // namespace AZ::Debug diff --git a/Code/Framework/AzCore/AzCore/Debug/BudgetTracker.h b/Code/Framework/AzCore/AzCore/Debug/BudgetTracker.h index 34d8510349..69e8185746 100644 --- a/Code/Framework/AzCore/AzCore/Debug/BudgetTracker.h +++ b/Code/Framework/AzCore/AzCore/Debug/BudgetTracker.h @@ -20,7 +20,7 @@ namespace AZ::Debug { public: AZ_TYPE_INFO(BudgetTracker, "{E14A746D-BFFE-4C02-90FB-4699B79864A5}"); - static Budget* GetBudgetFromEnvironment(const char* budgetName, uint32_t crc); + static void GetBudgetFromEnvironment(Budget*& extBudgetRef, const char* budgetName, uint32_t crc); ~BudgetTracker(); @@ -28,7 +28,7 @@ namespace AZ::Debug bool Init(); void Reset(); - Budget& GetBudget(const char* budgetName, uint32_t crc); + void GetBudget(Budget*& extBudgetRef, const char* budgetName, uint32_t crc); private: struct BudgetTrackerImpl; From c403fa3db6d3dc8653c8f5908b6cbb908636c2c7 Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Fri, 14 Jan 2022 13:30:45 -0600 Subject: [PATCH 485/948] More GetValues() overrides (#6896) * Benchmarks and tests for Image and Constant GetValues Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Verify GetValues for Perlin and Random Gradients Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Standardized the assert format for GetValues(). Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * More GetValues unit tests and test cleanup Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Fixed typos Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * GetValues() unit tests for surface gradients. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Benchmarks for ShapeAreaFalloff Gradient Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Added benchmarks for all remaining gradients and cleaned up the helper methods. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Renamed class for better report formatting. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Added missing Mocks dependencies for the Editor tests. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * First batch of specific GetValues() overrides. Each one is measurably faster than the generic version. Also, in ShapeAreaFalloffGradient, I optimized and simplified the logic a bit, so GetValue() is marginally faster too. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Change GetValues() to use span and add more overrides. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Convert GetValues() to use AZStd::span and added more overrides. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Add missing include. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * PR feedback - switch to fill Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Fixed the logic and added unit tests and comments. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- .../AzCore/AzCore/std/containers/span.h | 2 +- .../AzCore/AzCore/std/containers/span.inl | 2 +- Gems/GradientSignal/Code/CMakeLists.txt | 5 - .../Components/ConstantGradientComponent.h | 2 +- .../Components/DitherGradientComponent.h | 8 + .../Components/ImageGradientComponent.h | 2 +- .../Components/InvertGradientComponent.h | 1 + .../Components/LevelsGradientComponent.h | 1 + .../Components/PerlinGradientComponent.h | 2 +- .../Components/RandomGradientComponent.h | 2 +- .../ShapeAreaFalloffGradientComponent.h | 2 +- .../Ebuses/GradientRequestBus.h | 11 +- .../Include/GradientSignal/GradientSampler.h | 20 +-- .../Code/Include/GradientSignal/Util.h | 60 ++++++-- .../Components/ConstantGradientComponent.cpp | 8 +- .../Components/DitherGradientComponent.cpp | 144 +++++++++++------- .../Components/ImageGradientComponent.cpp | 10 +- .../Components/InvertGradientComponent.cpp | 15 ++ .../Components/LevelsGradientComponent.cpp | 17 ++- .../Components/PerlinGradientComponent.cpp | 10 +- .../Components/RandomGradientComponent.cpp | 10 +- .../ShapeAreaFalloffGradientComponent.cpp | 13 +- .../Tests/GradientSignalGetValuesTests.cpp | 6 +- .../Tests/GradientSignalServicesTests.cpp | 126 +++++++++++++++ 24 files changed, 333 insertions(+), 146 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/std/containers/span.h b/Code/Framework/AzCore/AzCore/std/containers/span.h index 8f68e921d8..5bb51bf481 100644 --- a/Code/Framework/AzCore/AzCore/std/containers/span.h +++ b/Code/Framework/AzCore/AzCore/std/containers/span.h @@ -59,7 +59,7 @@ namespace AZStd constexpr span(pointer s, size_type length); - constexpr span(pointer first, const_pointer last); + constexpr span(pointer first, pointer last); // We explicitly delete this constructor because it's too easy to accidentally // create a span to just the first element instead of an entire array. diff --git a/Code/Framework/AzCore/AzCore/std/containers/span.inl b/Code/Framework/AzCore/AzCore/std/containers/span.inl index c33e4a7227..01bab9a5a4 100644 --- a/Code/Framework/AzCore/AzCore/std/containers/span.inl +++ b/Code/Framework/AzCore/AzCore/std/containers/span.inl @@ -24,7 +24,7 @@ namespace AZStd } template - inline constexpr span::span(pointer first, const_pointer last) + inline constexpr span::span(pointer first, pointer last) : m_begin(first) , m_end(last) { } diff --git a/Gems/GradientSignal/Code/CMakeLists.txt b/Gems/GradientSignal/Code/CMakeLists.txt index d4cf666630..d2d8f8c696 100644 --- a/Gems/GradientSignal/Code/CMakeLists.txt +++ b/Gems/GradientSignal/Code/CMakeLists.txt @@ -19,7 +19,6 @@ ly_add_target( BUILD_DEPENDENCIES PUBLIC AZ::AzCore - AZ::AtomCore AZ::AzFramework Gem::SurfaceData Gem::ImageProcessingAtom.Headers @@ -41,7 +40,6 @@ ly_add_target( Gem::LmbrCentral PUBLIC AZ::AzCore - AZ::AtomCore Gem::GradientSignal.Static Gem::ImageProcessingAtom.Headers # Atom/ImageProcessing/PixelFormats.h is part of a header in Includes RUNTIME_DEPENDENCIES @@ -73,7 +71,6 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) PUBLIC 3rdParty::Qt::Widgets AZ::AzCore - AZ::AtomCore AZ::AzFramework AZ::AzToolsFramework AZ::AssetBuilderSDK @@ -97,8 +94,6 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) PRIVATE Gem::GradientSignal.Editor.Static Gem::LmbrCentral.Editor - PUBLIC - AZ::AtomCore RUNTIME_DEPENDENCIES Gem::LmbrCentral.Editor ) diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ConstantGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ConstantGradientComponent.h index af896f0933..1ed06a976a 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ConstantGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ConstantGradientComponent.h @@ -62,7 +62,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; - void GetValues(AZStd::array_view positions, AZStd::array_view outValues) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; protected: ////////////////////////////////////////////////////////////////////////// diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/DitherGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/DitherGradientComponent.h index ed12ec2ff7..add6de06cf 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/DitherGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/DitherGradientComponent.h @@ -77,6 +77,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; bool IsEntityInHierarchy(const AZ::EntityId& entityId) const override; ////////////////////////////////////////////////////////////////////////// @@ -102,6 +103,13 @@ namespace GradientSignal GradientSampler& GetGradientSampler() override; private: + static int ScaledPositionToPatternIndex(const AZ::Vector3& scaledPosition, int patternSize); + static float GetDitherValue4x4(const AZ::Vector3& scaledPosition); + static float GetDitherValue8x8(const AZ::Vector3& scaledPosition); + + float GetCalculatedPointsPerUnit() const; + float GetDitherValue(const AZ::Vector3& scaledPosition, float value) const; + DitherGradientConfig m_configuration; LmbrCentral::DependencyMonitor m_dependencyMonitor; }; diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h index 9fc98124cb..79d42ec478 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h @@ -69,7 +69,7 @@ namespace GradientSignal // GradientRequestBus overrides... float GetValue(const GradientSampleParams& sampleParams) const override; - void GetValues(AZStd::array_view positions, AZStd::array_view outValues) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; // AZ::Data::AssetBus overrides... void OnAssetReady(AZ::Data::Asset asset) override; diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/InvertGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/InvertGradientComponent.h index 79dbea975b..a370286b0b 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/InvertGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/InvertGradientComponent.h @@ -64,6 +64,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; bool IsEntityInHierarchy(const AZ::EntityId& entityId) const override; protected: diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/LevelsGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/LevelsGradientComponent.h index 5e70adfe32..093f84ef3a 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/LevelsGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/LevelsGradientComponent.h @@ -69,6 +69,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; bool IsEntityInHierarchy(const AZ::EntityId& entityId) const override; protected: diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/PerlinGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/PerlinGradientComponent.h index 1b39f7f17b..19f3fe7294 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/PerlinGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/PerlinGradientComponent.h @@ -70,7 +70,7 @@ namespace GradientSignal // GradientRequestBus overrides... float GetValue(const GradientSampleParams& sampleParams) const override; - void GetValues(AZStd::array_view positions, AZStd::array_view outValues) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; private: PerlinGradientConfig m_configuration; diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/RandomGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/RandomGradientComponent.h index 274442a2c0..328fed5118 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/RandomGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/RandomGradientComponent.h @@ -61,7 +61,7 @@ namespace GradientSignal // GradientRequestBus overrides... float GetValue(const GradientSampleParams& sampleParams) const override; - void GetValues(AZStd::array_view positions, AZStd::array_view outValues) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; private: RandomGradientConfig m_configuration; diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ShapeAreaFalloffGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ShapeAreaFalloffGradientComponent.h index df86c38069..27b2da58a3 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ShapeAreaFalloffGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ShapeAreaFalloffGradientComponent.h @@ -69,7 +69,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; - void GetValues(AZStd::array_view positions, AZStd::array_view outValues) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; protected: ////////////////////////////////////////////////////////////////////////// diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientRequestBus.h b/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientRequestBus.h index 3a215c5b5d..45b5a173a3 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientRequestBus.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientRequestBus.h @@ -10,8 +10,7 @@ #include #include #include - -#include +#include namespace GradientSignal { @@ -57,7 +56,7 @@ namespace GradientSignal * \param positions The input list of positions to query. * \param outValues The output list of values. This list is expected to be the same size as the positions list. */ - virtual void GetValues(AZStd::array_view positions, AZStd::array_view outValues) const + virtual void GetValues(AZStd::span positions, AZStd::span outValues) const { // Reference implementation of GetValues for any gradients that don't have their own optimized implementations. // This is 10%-60% faster than calling GetValue via EBus many times due to the per-call EBus overhead. @@ -72,11 +71,7 @@ namespace GradientSignal for (size_t index = 0; index < positions.size(); index++) { sampleParams.m_position = positions[index]; - - // The const_cast is necessary for now since array_view currently only supports const entries. - // If/when array_view is fixed to support non-const, or AZStd::span gets created, the const_cast can get removed. - auto& outValue = const_cast(outValues[index]); - outValue = GetValue(sampleParams); + outValues[index] = GetValue(sampleParams); } } diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h b/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h index a2e1849590..c9aa7f680c 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h @@ -33,7 +33,7 @@ namespace GradientSignal static void Reflect(AZ::ReflectContext* context); inline float GetValue(const GradientSampleParams& sampleParams) const; - inline void GetValues(AZStd::array_view positions, AZStd::array_view outValues) const; + inline void GetValues(AZStd::span positions, AZStd::span outValues) const; bool IsEntityInHierarchy(const AZ::EntityId& entityId) const; @@ -147,18 +147,12 @@ namespace GradientSignal return output * m_opacity; } - inline void GradientSampler::GetValues(AZStd::array_view positions, AZStd::array_view outValues) const + inline void GradientSampler::GetValues(AZStd::span positions, AZStd::span outValues) const { - auto ClearOutputValues = [](AZStd::array_view outValues) + auto ClearOutputValues = [](AZStd::span outValues) { // If we don't have a valid gradient (or it is fully transparent), clear out all the output values. - for (size_t index = 0; index < outValues.size(); index++) - { - // The const_cast is necessary for now since array_view currently only supports const entries. - // If/when array_view is fixed to support non-const, or AZStd::span gets created, the const_cast can get removed. - auto& outValue = const_cast(outValues[index]); - outValue = 0.0f; - } + memset(outValues.data(), 0, outValues.size() * sizeof(float)); }; if (m_opacity <= 0.0f || !m_gradientId.IsValid()) @@ -214,12 +208,8 @@ namespace GradientSignal } // Perform any post-fetch transformations on the gradient values (invert, levels, opacity). - for (size_t index = 0; index < outValues.size(); index++) + for (auto& outValue : outValues) { - // The const_cast is necessary for now since array_view currently only supports const entries. - // If/when array_view is fixed to support non-const, or AZStd::span gets created, the const_cast can get removed. - auto& outValue = const_cast(outValues[index]); - if (m_invertInput) { outValue = 1.0f - outValue; diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Util.h b/Gems/GradientSignal/Code/Include/GradientSignal/Util.h index fa1791c053..f91c5d54f1 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Util.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Util.h @@ -7,11 +7,12 @@ */ #pragma once +#include #include #include -#include #include #include +#include #include #include @@ -53,28 +54,61 @@ namespace GradientSignal inline float GetLevels(float input, float inputMid, float inputMin, float inputMax, float outputMin, float outputMax) { - input = AZ::GetClamp(input, 0.0f, 1.0f); - inputMid = AZ::GetClamp(inputMid, 0.01f, 10.0f); // Clamp the midpoint to a non-zero value so that it's always safe to divide by it. + inputMid = AZ::GetClamp(inputMid, 0.01f, 10.0f); // Clamp the midpoint to a non-zero value so that it's always safe to divide by it. inputMin = AZ::GetClamp(inputMin, 0.0f, 1.0f); inputMax = AZ::GetClamp(inputMax, 0.0f, 1.0f); outputMin = AZ::GetClamp(outputMin, 0.0f, 1.0f); outputMax = AZ::GetClamp(outputMax, 0.0f, 1.0f); - float inputCorrected = 0.0f; if (inputMin == inputMax) { - inputCorrected = (input <= inputMin) ? 0.0f : 1.0f; - } - else - { - const float inputRemapped = AZ::GetMin(AZ::GetMax(input - inputMin, 0.0f) / (inputMax - inputMin), 1.0f); - // Note: Some paint programs map the midpoint using 1/mid where low values are dark and high values are light, - // others do the reverse and use mid directly, so low values are light and high values are dark. We've chosen to - // align with 1/mid since it appears to be the more prevalent of the two approaches. - inputCorrected = powf(inputRemapped, 1.0f / inputMid); + return (AZ::GetClamp(input, 0.0f, 1.0f) <= inputMin) ? outputMin : outputMax; } + const float inputMidReciprocal = 1.0f / inputMid; + const float inputExtentsReciprocal = 1.0f / (inputMax - inputMin); + + const float inputRemapped = + AZ::GetMin(AZ::GetMax(AZ::GetClamp(input, 0.0f, 1.0f) - inputMin, 0.0f) * inputExtentsReciprocal, 1.0f); + + // Note: Some paint programs map the midpoint using 1/mid where low values are dark and high values are light, + // others do the reverse and use mid directly, so low values are light and high values are dark. We've chosen to + // align with 1/mid since it appears to be the more prevalent of the two approaches. + const float inputCorrected = powf(inputRemapped, inputMidReciprocal); + return AZ::Lerp(outputMin, outputMax, inputCorrected); } + inline void GetLevels(AZStd::span inOutValues, float inputMid, float inputMin, float inputMax, float outputMin, float outputMax) + { + inputMid = AZ::GetClamp(inputMid, 0.01f, 10.0f); // Clamp the midpoint to a non-zero value so that it's always safe to divide by it. + inputMin = AZ::GetClamp(inputMin, 0.0f, 1.0f); + inputMax = AZ::GetClamp(inputMax, 0.0f, 1.0f); + outputMin = AZ::GetClamp(outputMin, 0.0f, 1.0f); + outputMax = AZ::GetClamp(outputMax, 0.0f, 1.0f); + + if (inputMin == inputMax) + { + for (auto& inOutValue : inOutValues) + { + inOutValue = (AZ::GetClamp(inOutValue, 0.0f, 1.0f) <= inputMin) ? outputMin : outputMax; + } + } + + const float inputMidReciprocal = 1.0f / inputMid; + const float inputExtentsReciprocal = 1.0f / (inputMax - inputMin); + + for (auto& inOutValue : inOutValues) + { + const float inputRemapped = + AZ::GetMin(AZ::GetMax(AZ::GetClamp(inOutValue, 0.0f, 1.0f) - inputMin, 0.0f) * inputExtentsReciprocal, 1.0f); + + // Note: Some paint programs map the midpoint using 1/mid where low values are dark and high values are light, + // others do the reverse and use mid directly, so low values are light and high values are dark. We've chosen to + // align with 1/mid since it appears to be the more prevalent of the two approaches. + const float inputCorrected = powf(inputRemapped, inputMidReciprocal); + + inOutValue = AZ::Lerp(outputMin, outputMax, inputCorrected); + } + } } // namespace GradientSignal diff --git a/Gems/GradientSignal/Code/Source/Components/ConstantGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ConstantGradientComponent.cpp index 2b1487f75e..ac81f616c6 100644 --- a/Gems/GradientSignal/Code/Source/Components/ConstantGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ConstantGradientComponent.cpp @@ -135,7 +135,7 @@ namespace GradientSignal } void ConstantGradientComponent::GetValues( - [[maybe_unused]] AZStd::array_view positions, AZStd::array_view outValues) const + [[maybe_unused]] AZStd::span positions, AZStd::span outValues) const { if (positions.size() != outValues.size()) { @@ -143,11 +143,7 @@ namespace GradientSignal return; } - for (auto& outValue : outValues) - { - float& writableOutValue = const_cast(outValue); - writableOutValue = m_configuration.m_value; - } + AZStd::fill(outValues.begin(), outValues.end(), m_configuration.m_value); } float ConstantGradientComponent::GetConstantValue() const diff --git a/Gems/GradientSignal/Code/Source/Components/DitherGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/DitherGradientComponent.cpp index c7845a41a6..1b320afeb9 100644 --- a/Gems/GradientSignal/Code/Source/Components/DitherGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/DitherGradientComponent.cpp @@ -174,90 +174,122 @@ namespace GradientSignal return false; } - int PositionToMatrixIndex(float position, int patternSize) + int DitherGradientComponent::ScaledPositionToPatternIndex(const AZ::Vector3& scaledPosition, int patternSize) { - int result = static_cast(std::floor(fmod(position, static_cast(patternSize)))); + // The input position is expected to be scaled up so that each integer value is a unique point in our dither pattern, and + // the fractional value is just the amount within the point. The output is the specific index into an NxN pattern to use + // for the dither comparison value. - if (result < 0) - { - result += patternSize; - } + // Get the floor before casting to int because we want fractional negative values to go "down" to the next negative value. + AZ::Vector3 flooredScaledPosition = scaledPosition.GetFloor(); + + // For a pattern of 4, we want our indices to go 0, 1, 2, 3, 0, 1, 2, 3, etc. However, we want it continuous across + // negative and positive positions so we can't just use mod with abs(). Instead, we use a double-mod which gives us + // a result that's continuous across all coordinate space. + const int x = ((static_cast(flooredScaledPosition.GetX()) % patternSize) + patternSize) % patternSize; + const int y = ((static_cast(flooredScaledPosition.GetY()) % patternSize) + patternSize) % patternSize; - return result; + return (patternSize * y + x); } - float GetDitherValue4x4(const AZ::Vector3& position) + float DitherGradientComponent::GetDitherValue4x4(const AZ::Vector3& scaledPosition) { - const int patternSize = 4; - const int patternSizeSq = patternSize * patternSize; - const int indexMatrix[patternSizeSq] = { - 0, 8, 2, 10, - 12, 4, 14, 6, - 3, 11, 1, 9, - 15, 7, 13, 5 }; - - const int x = PositionToMatrixIndex(position.GetX(), patternSize); - const int y = PositionToMatrixIndex(position.GetY(), patternSize); - - return indexMatrix[patternSize * y + x] / static_cast(patternSizeSq); + constexpr int patternSize = 4; + constexpr float indexMatrix[] = { + 0.0f / 16.0f, 8.0f / 16.0f, 2.0f / 16.0f, 10.0f / 16.0f, + 12.0f / 16.0f, 4.0f / 16.0f, 14.0f / 16.0f, 6.0f / 16.0f, + 3.0f / 16.0f, 11.0f / 16.0f, 1.0f / 16.0f, 9.0f / 16.0f, + 15.0f / 16.0f, 7.0f / 16.0f, 13.0f / 16.0f, 5.0f / 16.0f }; + + return indexMatrix[ScaledPositionToPatternIndex(scaledPosition, patternSize)]; } - float GetDitherValue8x8(const AZ::Vector3& position) + float DitherGradientComponent::GetDitherValue8x8(const AZ::Vector3& scaledPosition) { - const int patternSize = 8; - const int patternSizeSq = patternSize * patternSize; - const int indexMatrix[patternSizeSq] = { - 0, 32, 8, 40, 2, 34, 10, 42, - 48, 16, 56, 24, 50, 18, 58, 26, - 12, 44, 4, 36, 14, 46, 6, 38, - 60, 28, 52, 20, 62, 30, 54, 22, - 3, 35, 11, 43, 1, 33, 9, 41, - 51, 19, 59, 27, 49, 17, 57, 25, - 15, 47, 7, 39, 13, 45, 5, 37, - 63, 31, 55, 23, 61, 29, 53, 21 }; - - const int x = PositionToMatrixIndex(position.GetX(), patternSize); - const int y = PositionToMatrixIndex(position.GetY(), patternSize); - - return indexMatrix[patternSize * y + x] / static_cast(patternSizeSq); + constexpr int patternSize = 8; + constexpr float indexMatrix[] = { + 0.0f / 64.0f, 32.0f / 64.0f, 8.0f / 64.0f, 40.0f / 64.0f, 2.0f / 64.0f, 34.0f / 64.0f, 10.0f / 64.0f, 42.0f / 64.0f, + 48.0f / 64.0f, 16.0f / 64.0f, 56.0f / 64.0f, 24.0f / 64.0f, 50.0f / 64.0f, 18.0f / 64.0f, 58.0f / 64.0f, 26.0f / 64.0f, + 12.0f / 64.0f, 44.0f / 64.0f, 4.0f / 64.0f, 36.0f / 64.0f, 14.0f / 64.0f, 46.0f / 64.0f, 6.0f / 64.0f, 38.0f / 64.0f, + 60.0f / 64.0f, 28.0f / 64.0f, 52.0f / 64.0f, 20.0f / 64.0f, 62.0f / 64.0f, 30.0f / 64.0f, 54.0f / 64.0f, 22.0f / 64.0f, + 3.0f / 64.0f, 35.0f / 64.0f, 11.0f / 64.0f, 43.0f / 64.0f, 1.0f / 64.0f, 33.0f / 64.0f, 9.0f / 64.0f, 41.0f / 64.0f, + 51.0f / 64.0f, 19.0f / 64.0f, 59.0f / 64.0f, 27.0f / 64.0f, 49.0f / 64.0f, 17.0f / 64.0f, 57.0f / 64.0f, 25.0f / 64.0f, + 15.0f / 64.0f, 47.0f / 64.0f, 7.0f / 64.0f, 39.0f / 64.0f, 13.0f / 64.0f, 45.0f / 64.0f, 5.0f / 64.0f, 37.0f / 64.0f, + 63.0f / 64.0f, 31.0f / 64.0f, 55.0f / 64.0f, 23.0f / 64.0f, 61.0f / 64.0f, 29.0f / 64.0f, 53.0f / 64.0f, 21.0f / 64.0f + }; + + return indexMatrix[ScaledPositionToPatternIndex(scaledPosition, patternSize)]; } - float DitherGradientComponent::GetValue(const GradientSampleParams& sampleParams) const + float DitherGradientComponent::GetCalculatedPointsPerUnit() const { - AZ_PROFILE_FUNCTION(Entity); - - const AZ::Vector3& coordinate = sampleParams.m_position; - float pointsPerUnit = m_configuration.m_pointsPerUnit; if (m_configuration.m_useSystemPointsPerUnit) { SectorDataRequestBus::Broadcast(&SectorDataRequestBus::Events::GetPointsPerMeter, pointsPerUnit); } - pointsPerUnit = AZ::GetMax(pointsPerUnit, 0.0001f); - - auto scaledCoordinate = coordinate * pointsPerUnit; - auto x = std::floor(scaledCoordinate.GetX()) / pointsPerUnit; - auto y = std::floor(scaledCoordinate.GetY()) / pointsPerUnit; - auto z = std::floor(scaledCoordinate.GetZ()) / pointsPerUnit; - AZ::Vector3 flooredCoordinate(x, y, z); - - GradientSampleParams adjustedSampleParams = sampleParams; - adjustedSampleParams.m_position = flooredCoordinate; - float value = m_configuration.m_gradientSampler.GetValue(adjustedSampleParams); + return AZ::GetMax(pointsPerUnit, 0.0001f); + } + float DitherGradientComponent::GetDitherValue(const AZ::Vector3& scaledPosition, float value) const + { float d = 0.0f; switch (m_configuration.m_patternType) { default: case DitherGradientConfig::BayerPatternType::PATTERN_SIZE_4x4: - d = GetDitherValue4x4((scaledCoordinate) + m_configuration.m_patternOffset); + d = GetDitherValue4x4(scaledPosition + m_configuration.m_patternOffset); break; case DitherGradientConfig::BayerPatternType::PATTERN_SIZE_8x8: - d = GetDitherValue8x8((scaledCoordinate) + m_configuration.m_patternOffset); + d = GetDitherValue8x8(scaledPosition + m_configuration.m_patternOffset); break; } - return value > d ? 1.0f : 0.0f; + return (value > d) ? 1.0f : 0.0f; + } + + float DitherGradientComponent::GetValue(const GradientSampleParams& sampleParams) const + { + const AZ::Vector3& coordinate = sampleParams.m_position; + + const float pointsPerUnit = GetCalculatedPointsPerUnit(); + + AZ::Vector3 scaledCoordinate = coordinate * pointsPerUnit; + AZ::Vector3 flooredCoordinate = scaledCoordinate.GetFloor() / pointsPerUnit; + + GradientSampleParams adjustedSampleParams = sampleParams; + adjustedSampleParams.m_position = flooredCoordinate; + float value = m_configuration.m_gradientSampler.GetValue(adjustedSampleParams); + + return GetDitherValue(scaledCoordinate, value); + } + + void DitherGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const + { + if (positions.size() != outValues.size()) + { + AZ_Assert(false, "input and output lists are different sizes (%zu vs %zu).", positions.size(), outValues.size()); + return; + } + + const float pointsPerUnit = GetCalculatedPointsPerUnit(); + + // Create the entire set of floored coordinates to use in the gradient value lookups. + AZStd::vector flooredCoordinates(positions.size()); + for (size_t index = 0; index < positions.size(); index++) + { + AZ::Vector3 scaledCoordinate = positions[index] * pointsPerUnit; + flooredCoordinates[index] = scaledCoordinate.GetFloor() / pointsPerUnit; + } + + m_configuration.m_gradientSampler.GetValues(flooredCoordinates, outValues); + + // For each gradient value, turn it into a 0 or 1 based on the location and the dither pattern. + for (size_t index = 0; index < positions.size(); index++) + { + AZ::Vector3 scaledCoordinate = positions[index] * pointsPerUnit; + outValues[index] = GetDitherValue(scaledCoordinate, outValues[index]); + } } bool DitherGradientComponent::IsEntityInHierarchy(const AZ::EntityId& entityId) const diff --git a/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp index 06a3674188..d948f6269e 100644 --- a/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp @@ -219,7 +219,7 @@ namespace GradientSignal return 0.0f; } - void ImageGradientComponent::GetValues(AZStd::array_view positions, AZStd::array_view outValues) const + void ImageGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const { if (positions.size() != outValues.size()) { @@ -234,20 +234,16 @@ namespace GradientSignal for (size_t index = 0; index < positions.size(); index++) { - // The const_cast is necessary for now since array_view currently only supports const entries. - // If/when array_view is fixed to support non-const, or AZStd::span gets created, the const_cast can get removed. - auto& outValue = const_cast(outValues[index]); - m_gradientTransform.TransformPositionToUVWNormalized(positions[index], uvw, wasPointRejected); if (!wasPointRejected) { - outValue = GetValueFromImageAsset( + outValues[index] = GetValueFromImageAsset( m_configuration.m_imageAsset, uvw, m_configuration.m_tilingX, m_configuration.m_tilingY, 0.0f); } else { - outValue = 0.0f; + outValues[index] = 0.0f; } } } diff --git a/Gems/GradientSignal/Code/Source/Components/InvertGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/InvertGradientComponent.cpp index 678f3b363c..aef5cc7a52 100644 --- a/Gems/GradientSignal/Code/Source/Components/InvertGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/InvertGradientComponent.cpp @@ -137,6 +137,21 @@ namespace GradientSignal return output; } + void InvertGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const + { + if (positions.size() != outValues.size()) + { + AZ_Assert(false, "input and output lists are different sizes (%zu vs %zu).", positions.size(), outValues.size()); + return; + } + + m_configuration.m_gradientSampler.GetValues(positions, outValues); + for (auto& outValue : outValues) + { + outValue = 1.0f - AZ::GetClamp(outValue, 0.0f, 1.0f); + } + } + bool InvertGradientComponent::IsEntityInHierarchy(const AZ::EntityId& entityId) const { return m_configuration.m_gradientSampler.IsEntityInHierarchy(entityId); diff --git a/Gems/GradientSignal/Code/Source/Components/LevelsGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/LevelsGradientComponent.cpp index b2958c590c..25f6a34614 100644 --- a/Gems/GradientSignal/Code/Source/Components/LevelsGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/LevelsGradientComponent.cpp @@ -172,8 +172,6 @@ namespace GradientSignal float LevelsGradientComponent::GetValue(const GradientSampleParams& sampleParams) const { - AZ_PROFILE_FUNCTION(Entity); - float output = 0.0f; output = GetLevels( @@ -187,6 +185,21 @@ namespace GradientSignal return output; } + void LevelsGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const + { + if (positions.size() != outValues.size()) + { + AZ_Assert(false, "input and output lists are different sizes (%zu vs %zu).", positions.size(), outValues.size()); + return; + } + + m_configuration.m_gradientSampler.GetValues(positions, outValues); + + GetLevels(outValues, + m_configuration.m_inputMid, m_configuration.m_inputMin, m_configuration.m_inputMax, + m_configuration.m_outputMin, m_configuration.m_outputMax); + } + bool LevelsGradientComponent::IsEntityInHierarchy(const AZ::EntityId& entityId) const { return m_configuration.m_gradientSampler.IsEntityInHierarchy(entityId); diff --git a/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp index 667d8c30a7..e3dfaf2161 100644 --- a/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp @@ -203,7 +203,7 @@ namespace GradientSignal return 0.0f; } - void PerlinGradientComponent::GetValues(AZStd::array_view positions, AZStd::array_view outValues) const + void PerlinGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const { if (positions.size() != outValues.size()) { @@ -218,21 +218,17 @@ namespace GradientSignal for (size_t index = 0; index < positions.size(); index++) { - // The const_cast is necessary for now since array_view currently only supports const entries. - // If/when array_view is fixed to support non-const, or AZStd::span gets created, the const_cast can get removed. - auto& outValue = const_cast(outValues[index]); - m_gradientTransform.TransformPositionToUVW(positions[index], uvw, wasPointRejected); if (!wasPointRejected) { - outValue = m_perlinImprovedNoise->GenerateOctaveNoise( + outValues[index] = m_perlinImprovedNoise->GenerateOctaveNoise( uvw.GetX(), uvw.GetY(), uvw.GetZ(), m_configuration.m_octave, m_configuration.m_amplitude, m_configuration.m_frequency); } else { - outValue = 0.0f; + outValues[index] = 0.0f; } } } diff --git a/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp index ae51bdd4ac..0f4ece38a1 100644 --- a/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp @@ -183,7 +183,7 @@ namespace GradientSignal return 0.0f; } - void RandomGradientComponent::GetValues(AZStd::array_view positions, AZStd::array_view outValues) const + void RandomGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const { if (positions.size() != outValues.size()) { @@ -200,19 +200,15 @@ namespace GradientSignal for (size_t index = 0; index < positions.size(); index++) { - // The const_cast is necessary for now since array_view currently only supports const entries. - // If/when array_view is fixed to support non-const, or AZStd::span gets created, the const_cast can get removed. - auto& outValue = const_cast(outValues[index]); - m_gradientTransform.TransformPositionToUVW(positions[index], uvw, wasPointRejected); if (!wasPointRejected) { - outValue = GetRandomValue(uvw, seed); + outValues[index] = GetRandomValue(uvw, seed); } else { - outValue = 0.0f; + outValues[index] = 0.0f; } } } diff --git a/Gems/GradientSignal/Code/Source/Components/ShapeAreaFalloffGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ShapeAreaFalloffGradientComponent.cpp index f2416f4fb6..77b7f1a428 100644 --- a/Gems/GradientSignal/Code/Source/Components/ShapeAreaFalloffGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ShapeAreaFalloffGradientComponent.cpp @@ -168,7 +168,7 @@ namespace GradientSignal return (distance <= 0.0f) ? 1.0f : AZ::GetMax(1.0f - (distance / m_configuration.m_falloffWidth), 0.0f); } - void ShapeAreaFalloffGradientComponent::GetValues(AZStd::array_view positions, AZStd::array_view outValues) const + void ShapeAreaFalloffGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const { if (positions.size() != outValues.size()) { @@ -187,10 +187,6 @@ namespace GradientSignal for (size_t index = 0; index < positions.size(); index++) { - // The const_cast is necessary for now since array_view currently only supports const entries. - // If/when array_view is fixed to support non-const, or AZStd::span gets created, the const_cast can get removed. - auto& outValue = const_cast(outValues[index]); - float distance = shapeRequests->DistanceFromPoint(positions[index]); // Since this is outer falloff, distance should give us values from 1.0 at the minimum distance to 0.0 at the maximum @@ -198,18 +194,15 @@ namespace GradientSignal // inside the shape (0 distance) return 1.0, and all points outside the shape return 0. This works because division by 0 // gives infinity, which gets clamped by the GetMax() to 0. However, if distance == 0, it would give us NaN, so we have // the separate conditional check to handle that case and clamp to 1.0. - outValue = (distance <= 0.0f) ? 1.0f : AZ::GetMax(1.0f - (distance / falloffWidth), 0.0f); + outValues[index] = (distance <= 0.0f) ? 1.0f : AZ::GetMax(1.0f - (distance / falloffWidth), 0.0f); } }); // If there's no shape, there's no falloff. if (!shapeConnected) { - for (size_t index = 0; index < positions.size(); index++) + for (auto& outValue : outValues) { - // The const_cast is necessary for now since array_view currently only supports const entries. - // If/when array_view is fixed to support non-const, or AZStd::span gets created, the const_cast can get removed. - auto& outValue = const_cast(outValues[index]); outValue = 1.0f; } } diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalGetValuesTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalGetValuesTests.cpp index 5504fa5b45..6c4ebcc4c0 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalGetValuesTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalGetValuesTests.cpp @@ -56,9 +56,9 @@ namespace UnitTest params.m_position = positions[positionIndex]; float value = gradientSampler.GetValue(params); - // We use ASSERT_EQ instead of EXPECT_EQ because if one value doesn't match, they probably all won't, so there's no reason - // to keep running and printing failures for every value. - ASSERT_EQ(value, results[positionIndex]); + // We use ASSERT_NEAR instead of EXPECT_NEAR because if one value doesn't match, they probably all won't, so there's no + // reason to keep running and printing failures for every value. + ASSERT_NEAR(value, results[positionIndex], 0.000001f); } } }; diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp index 449719af67..830c578b9b 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalServicesTests.cpp @@ -10,6 +10,8 @@ #include +#include + #include #include #include @@ -81,6 +83,130 @@ namespace UnitTest TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); } + TEST_F(GradientSignalServicesTestsFixture, DitherGradientComponent_4x4At50Pct_CrossingZero) + { + // With a 4x4 gradient filled with 8/16 (0.5), verify that the resulting dithered output + // is an expected checkerboard pattern with 8 of 16 pixels filled. The pattern offset is + // shifted -2 in the X direction so that the lookups go from [-2, 2) to verify that the + // pattern remains consistent across negative and positive coordinates. + + constexpr int dataSize = 4; + + AZStd::vector inputData(dataSize * dataSize, 8.0f / 16.0f); + AZStd::vector expectedOutput = { + 1.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 1.0f, + 1.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 1.0f, + }; + + auto entityMock = CreateEntity(); + const AZ::EntityId id = entityMock->GetId(); + UnitTest::MockGradientArrayRequestsBus mockGradientRequestsBus(id, inputData, dataSize); + + GradientSignal::DitherGradientConfig config; + config.m_useSystemPointsPerUnit = false; + config.m_pointsPerUnit = 1.0f; + config.m_patternOffset = AZ::Vector3(-2.0f, 0.0f, 0.0f); + config.m_patternType = GradientSignal::DitherGradientConfig::BayerPatternType::PATTERN_SIZE_4x4; + config.m_gradientSampler.m_gradientId = entityMock->GetId(); + + auto entity = CreateEntity(); + entity->CreateComponent(config); + ActivateEntity(entity.get()); + + TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); + } + + TEST_F(GradientSignalServicesTestsFixture, DitherGradientComponent_4x4At50Pct_MorePointsPerUnit) + { + // With a 4x4 gradient filled with 8/16 (0.5), and 1/2 point per unit, if we query a 4x4 region, + // we should get a checkerboard in 2x2 blocks of the same value because it takes 2 units before the value changes. + + constexpr int dataSize = 4; + + AZStd::vector inputData(dataSize * dataSize, 8.0f / 16.0f); + AZStd::vector expectedOutput = { + 1.0f, 1.0f, 0.0f, 0.0f, + 1.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 1.0f, + 0.0f, 0.0f, 1.0f, 1.0f, + }; + + auto entityMock = CreateEntity(); + const AZ::EntityId id = entityMock->GetId(); + UnitTest::MockGradientArrayRequestsBus mockGradientRequestsBus(id, inputData, dataSize); + + GradientSignal::DitherGradientConfig config; + config.m_useSystemPointsPerUnit = false; + config.m_pointsPerUnit = 0.5f; + config.m_patternOffset = AZ::Vector3::CreateZero(); + config.m_patternType = GradientSignal::DitherGradientConfig::BayerPatternType::PATTERN_SIZE_4x4; + config.m_gradientSampler.m_gradientId = entityMock->GetId(); + + auto entity = CreateEntity(); + entity->CreateComponent(config); + ActivateEntity(entity.get()); + + TestFixedDataSampler(expectedOutput, dataSize, entity->GetId()); + } + + TEST_F(GradientSignalServicesTestsFixture, DitherGradientComponent_4x4At50Pct_MorePointsAndCrossingZero) + { + // With a 4x4 gradient filled with 8/16 (0.5), and 2 points per unit, verify that querying + // from -1 to 1 produces a constant checkerboard pattern of results as it crosses the 0 boundary. + // Our expected results are a consistent checkerboard pattern, but with 2x2 blocks of the same value because we're + // querying at 2x the point density (i.e. querying 4 points per unit) to ensure that fractional position lookups work too. + + float expectedValues[] = { + 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, + 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, + 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, + 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, + 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, + 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, + }; + + // Create a 50% constant gradient. + GradientSignal::ConstantGradientConfig constantConfig; + constantConfig.m_value = 8.0f / 16.0f; + auto constantGradientEntity = CreateEntity(); + constantGradientEntity->CreateComponent(constantConfig); + ActivateEntity(constantGradientEntity.get()); + + GradientSignal::DitherGradientConfig config; + config.m_useSystemPointsPerUnit = false; + config.m_pointsPerUnit = 2.0f; + config.m_patternOffset = AZ::Vector3::CreateZero(); + config.m_patternType = GradientSignal::DitherGradientConfig::BayerPatternType::PATTERN_SIZE_4x4; + config.m_gradientSampler.m_gradientId = constantGradientEntity->GetId(); + + auto entity = CreateEntity(); + entity->CreateComponent(config); + ActivateEntity(entity.get()); + + // Run through [-1, 1) at 1/4 intervals and make sure we get our expected checkerboard. This is testing both that + // we have a consistent pattern across the 0 boundary and that fractional position lookups work correctly + GradientSignal::GradientSampler gradientSampler; + gradientSampler.m_gradientId = entity->GetId(); + int expectedValueIndex = 0; + for (float y = -1.0f; y < 1.0f; y += 0.25f) + { + for (float x = -1.0f; x < 1.0f; x += 0.25f) + { + GradientSignal::GradientSampleParams params; + params.m_position = AZ::Vector3(x, y, 0.0f); + + float actualValue = gradientSampler.GetValue(params); + float expectedValue = expectedValues[expectedValueIndex++]; + + EXPECT_NEAR(actualValue, expectedValue, 0.01f); + } + } + } + TEST_F(GradientSignalServicesTestsFixture, DitherGradientComponent_4x4At31Pct) { // With a 4x4 gradient filled with 5/16 (0.3125), verify that the resulting dithered output From c8e5bcc901c989c12c3e485df9427d0546d8d7ac Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Fri, 14 Jan 2022 12:01:32 -0800 Subject: [PATCH 486/948] Dont allow spawning netbound entities by default, we first need to initialize multiplayer and know our network agent type (dedicated-server/client-server/client). This will stop the editor playmode (which doesn't init multiplayer until it connects to the server) from spawning netbound entities Signed-off-by: Gene Walters --- Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.h b/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.h index dd2e7956ca..47238cc729 100644 --- a/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.h +++ b/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.h @@ -184,7 +184,7 @@ namespace Multiplayer double m_serverSendAccumulator = 0.0; float m_renderBlendFactor = 0.0f; float m_tickFactor = 0.0f; - bool m_spawnNetboundEntities = true; + bool m_spawnNetboundEntities = false; #if !defined(AZ_RELEASE_BUILD) MultiplayerEditorConnection m_editorConnectionListener; From d95e157f480c92086ac38a79f6ae764ae0f1f3d8 Mon Sep 17 00:00:00 2001 From: moudgils <47460854+moudgils@users.noreply.github.com> Date: Fri, 14 Jan 2022 12:24:58 -0800 Subject: [PATCH 487/948] Different Pso cache per vendor/driver (#6893) * Support to add a different PSO cache per vendor/driver version. Also added support to have a differnt cache for Warp Signed-off-by: moudgils <47460854+moudgils@users.noreply.github.com> * Added a way to reset PSO cache for everyone Signed-off-by: moudgils <47460854+moudgils@users.noreply.github.com> * Fix tabbing for one line which is failing validation Signed-off-by: moudgils <47460854+moudgils@users.noreply.github.com> --- .../Atom/RHI.Reflect/PhysicalDeviceDescriptor.h | 3 ++- Gems/Atom/RHI/Code/Include/Atom/RHI/FrameScheduler.h | 12 ++++++++---- Gems/Atom/RHI/Code/Include/Atom/RHI/RHISystem.h | 3 +++ .../RHI/Code/Include/Atom/RHI/RHISystemInterface.h | 3 +++ Gems/Atom/RHI/Code/Source/RHI/RHISystem.cpp | 6 ++++++ .../Source/Platform/Windows/RHI/Device_Windows.cpp | 5 ++++- .../RHI/DX12/Code/Source/RHI/PipelineLibrary.cpp | 10 ++++------ .../RPI/Code/Source/RPI.Public/Shader/Shader.cpp | 12 ++++++++++-- 8 files changed, 40 insertions(+), 14 deletions(-) diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/PhysicalDeviceDescriptor.h b/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/PhysicalDeviceDescriptor.h index ac79ff0521..4d78d24ca8 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/PhysicalDeviceDescriptor.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/PhysicalDeviceDescriptor.h @@ -28,7 +28,8 @@ namespace AZ (AMD, 0x1002), (Qualcomm, 0x5143), (Samsung, 0x1099), - (ARM, 0x13B5) + (ARM, 0x13B5), + (Warp, 0x1414) ); void ReflectVendorIdEnums(ReflectContext* context); diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/FrameScheduler.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/FrameScheduler.h index eb2b0b5b0c..47cf7709db 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/FrameScheduler.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/FrameScheduler.h @@ -164,23 +164,27 @@ namespace AZ //! it will defer to the platform for parallel dispatch support. void Execute(JobPolicy jobPolicy); - /// Returns the timing statistics for the previous frame. + //! Returns the timing statistics for the previous frame. const TransientAttachmentStatistics* GetTransientAttachmentStatistics() const; - /// Returns current CPU frame to frame time in milliseconds. + //! Returns current CPU frame to frame time in milliseconds. double GetCpuFrameTime() const; - /// Returns memory statistics for the previous frame. + //! Returns memory statistics for the previous frame. const MemoryStatistics* GetMemoryStatistics() const; - /// Returns the implicit root scope id. + //! Returns the implicit root scope id. ScopeId GetRootScopeId() const; + //! Returns the descriptor which has information on the properties of a TransientAttachmentPool. const TransientAttachmentPoolDescriptor* GetTransientAttachmentPoolDescriptor() const; //! Adds a RayTracingShaderTable to be built this frame void QueueRayTracingShaderTableForBuild(RayTracingShaderTable* rayTracingShaderTable); + //! Returns PhysicalDeviceDescriptor which can be used to extract vendor/driver information + const PhysicalDeviceDescriptor& GetPhysicalDeviceDescriptor(); + private: const ScopeId m_rootScopeId{"Root"}; diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/RHISystem.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/RHISystem.h index 6d416b77fc..c2a3162025 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/RHISystem.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/RHISystem.h @@ -53,6 +53,7 @@ namespace AZ const RHI::TransientAttachmentPoolDescriptor* GetTransientAttachmentPoolDescriptor() const override; ConstPtr GetPlatformLimitsDescriptor() const override; void QueueRayTracingShaderTableForBuild(RayTracingShaderTable* rayTracingShaderTable) override; + const PhysicalDeviceDescriptor& GetPhysicalDeviceDescriptor() override; ////////////////////////////////////////////////////////////////////////// private: @@ -65,6 +66,8 @@ namespace AZ RHI::Ptr m_pipelineStateCache; RHI::FrameScheduler m_frameScheduler; RHI::FrameSchedulerCompileRequest m_compileRequest; + PhysicalDeviceDescriptor m_physicalDeviceDescriptor; + }; } // namespace RPI } // namespace AZ diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/RHISystemInterface.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/RHISystemInterface.h index 19ba1cb762..66f6b2bcde 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/RHISystemInterface.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/RHISystemInterface.h @@ -26,6 +26,7 @@ namespace AZ class PipelineState; class PipelineStateCache; class PlatformLimitsDescriptor; + class PhysicalDeviceDescriptor; class RayTracingShaderTable; struct FrameSchedulerCompileRequest; struct TransientAttachmentStatistics; @@ -65,6 +66,8 @@ namespace AZ virtual ConstPtr GetPlatformLimitsDescriptor() const = 0; virtual void QueueRayTracingShaderTableForBuild(RayTracingShaderTable* rayTracingShaderTable) = 0; + + virtual const PhysicalDeviceDescriptor& GetPhysicalDeviceDescriptor() = 0; }; //! This bus exists to give RHI samples the ability to slot in scopes manually diff --git a/Gems/Atom/RHI/Code/Source/RHI/RHISystem.cpp b/Gems/Atom/RHI/Code/Source/RHI/RHISystem.cpp index e7515bbf6e..3ec0cfeb93 100644 --- a/Gems/Atom/RHI/Code/Source/RHI/RHISystem.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI/RHISystem.cpp @@ -165,6 +165,7 @@ namespace AZ RHI::Ptr device = RHI::Factory::Get().CreateDevice(); if (device->Init(*physicalDeviceFound) == RHI::ResultCode::Success) { + m_physicalDeviceDescriptor = physicalDeviceFound->GetDescriptor(); PlatformLimitsDescriptor::Create(); return device; } @@ -279,5 +280,10 @@ namespace AZ { m_frameScheduler.QueueRayTracingShaderTableForBuild(rayTracingShaderTable); } + + const PhysicalDeviceDescriptor& RHISystem::GetPhysicalDeviceDescriptor() + { + return m_physicalDeviceDescriptor; + } } //namespace RPI } //namespace AZ diff --git a/Gems/Atom/RHI/DX12/Code/Source/Platform/Windows/RHI/Device_Windows.cpp b/Gems/Atom/RHI/DX12/Code/Source/Platform/Windows/RHI/Device_Windows.cpp index f6ed3be692..a2ed31ff84 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/Platform/Windows/RHI/Device_Windows.cpp +++ b/Gems/Atom/RHI/DX12/Code/Source/Platform/Windows/RHI/Device_Windows.cpp @@ -157,7 +157,10 @@ namespace AZ disabledMessages.push_back(D3D12_MESSAGE_ID_COPY_DESCRIPTORS_INVALID_RANGES); } - // [GFX TODO][ATOM-4712] - Fix PipelineLibrary Loading. These warnings were silenced for a release and need to be fixed properly. + // We disable these warnings as the our current implementation of Pipeline Library will trigger these warnings unknowingly. For example + // it will always first try to load a pso from pipelinelibrary triggering D3D12_MESSAGE_ID_LOADPIPELINE_NAMENOTFOUND (for the first time) before storing the PSO in a library. + // Similarly when we merge multiple pipeline libraries (in multiple threads) we may trigger D3D12_MESSAGE_ID_STOREPIPELINE_DUPLICATENAME as it is possible to save + // a PSO already saved in the main library. #if defined (AZ_DX12_USE_PIPELINE_LIBRARY) disabledMessages.push_back(D3D12_MESSAGE_ID_LOADPIPELINE_NAMENOTFOUND); disabledMessages.push_back(D3D12_MESSAGE_ID_STOREPIPELINE_DUPLICATENAME); diff --git a/Gems/Atom/RHI/DX12/Code/Source/RHI/PipelineLibrary.cpp b/Gems/Atom/RHI/DX12/Code/Source/RHI/PipelineLibrary.cpp index 63625fde72..ae3053f446 100644 --- a/Gems/Atom/RHI/DX12/Code/Source/RHI/PipelineLibrary.cpp +++ b/Gems/Atom/RHI/DX12/Code/Source/RHI/PipelineLibrary.cpp @@ -50,10 +50,9 @@ namespace AZ bool shouldCreateLibFromSerializedData = true; if (RHI::Factory::Get().IsRenderDocModuleLoaded() || - RHI::Factory::Get().IsPixModuleLoaded() || - RHI::Factory::Get().UsingWarpDevice()) + RHI::Factory::Get().IsPixModuleLoaded()) { - // CreatePipelineLibrary api does not function properly if Renderdoc, Pix or Warp is enabled + // CreatePipelineLibrary api does not function properly if Renderdoc or Pix is enabled shouldCreateLibFromSerializedData = false; } @@ -218,10 +217,9 @@ namespace AZ RHI::ResultCode PipelineLibrary::MergeIntoInternal([[maybe_unused]] AZStd::array_view pipelineLibraries) { if (RHI::Factory::Get().IsRenderDocModuleLoaded() || - RHI::Factory::Get().IsPixModuleLoaded() || - RHI::Factory::Get().UsingWarpDevice()) + RHI::Factory::Get().IsPixModuleLoaded()) { - // StorePipeline api does not function properly if RenderDoc, Pix or Warp is enabled + // StorePipeline api does not function properly if RenderDoc or Pix is enabled return RHI::ResultCode::Fail; } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader.cpp index b1ae460af6..92c2e30594 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader.cpp @@ -17,6 +17,7 @@ #include +#define PSOCacheVersion 0 // Bump this if you want to reset PSO cache for everyone namespace AZ { @@ -85,10 +86,17 @@ namespace AZ AZStd::string uuidString; assetId.m_guid.ToString(uuidString, false, false); + RHI::RHISystemInterface* rhiSystem = RHI::RHISystemInterface::Get(); + RHI::PhysicalDeviceDescriptor physicalDeviceDesc = rhiSystem->GetPhysicalDeviceDescriptor(); + char pipelineLibraryPathTemp[AZ_MAX_PATH_LEN]; azsnprintf( - pipelineLibraryPathTemp, AZ_MAX_PATH_LEN, "@user@/Atom/PipelineStateCache/%s/%s_%s_%d.bin", platformName.GetCStr(), - shaderName.GetCStr(), uuidString.data(), assetId.m_subId); + pipelineLibraryPathTemp, AZ_MAX_PATH_LEN, "@user@/Atom/PipelineStateCache_%s_%i_%i _Ver_%i/%s/%s_%s_%d.bin", + ToString(physicalDeviceDesc.m_vendorId).data(), physicalDeviceDesc.m_deviceId, physicalDeviceDesc.m_driverVersion, PSOCacheVersion, + platformName.GetCStr(), + shaderName.GetCStr(), + uuidString.data(), + assetId.m_subId); fileIOBase->ResolvePath(pipelineLibraryPathTemp, pipelineLibraryPath, pipelineLibraryPathLength); return true; From aa18deef5d70f2468a67df535de4e64fcd799ff3 Mon Sep 17 00:00:00 2001 From: Adi Bar-Lev <82479970+Adi-Amazon@users.noreply.github.com> Date: Fri, 14 Jan 2022 15:26:41 -0500 Subject: [PATCH 488/948] AtomTressFX - fixing crash bug for prefab (#6892) - The crash happens due to attempt to get an instance of the hair dynamic data before it was initialized. Signed-off-by: Adi Bar-Lev <82479970+Adi-Amazon@users.noreply.github.com> --- .../Code/Rendering/HairRenderObject.cpp | 16 +++++++++++++--- .../Code/Rendering/HairRenderObject.h | 10 ++++++++-- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/Gems/AtomTressFX/Code/Rendering/HairRenderObject.cpp b/Gems/AtomTressFX/Code/Rendering/HairRenderObject.cpp index fe167cae8b..472a610016 100644 --- a/Gems/AtomTressFX/Code/Rendering/HairRenderObject.cpp +++ b/Gems/AtomTressFX/Code/Rendering/HairRenderObject.cpp @@ -213,6 +213,8 @@ namespace AZ Data::Instance rasterShader, uint32_t vertexCount, uint32_t strandsCount ) { + m_initialized = false; + AZ_Assert(vertexCount <= std::numeric_limits().max(), "Hair vertex count exceeds uint32_t size."); // Create the dynamic shared buffers Srg. @@ -608,8 +610,16 @@ namespace AZ // First, Directly loading from the asset stored in the render settings. if (pRenderSettings) { - m_baseAlbedo = RPI::StreamingImage::FindOrCreate(pRenderSettings->m_baseAlbedoAsset); - m_strandAlbedo = RPI::StreamingImage::FindOrCreate(pRenderSettings->m_strandAlbedoAsset); + if (pRenderSettings->m_baseAlbedoAsset) + { + pRenderSettings->m_baseAlbedoAsset.BlockUntilLoadComplete(); + m_baseAlbedo = RPI::StreamingImage::FindOrCreate(pRenderSettings->m_baseAlbedoAsset); + } + if (pRenderSettings->m_strandAlbedoAsset) + { + pRenderSettings->m_strandAlbedoAsset.BlockUntilLoadComplete(); + m_strandAlbedo = RPI::StreamingImage::FindOrCreate(pRenderSettings->m_strandAlbedoAsset); + } } // Fallback using the texture name stored in the render settings. @@ -1142,7 +1152,7 @@ namespace AZ if (!renderMaterialSrg || !simSrg) { - AZ_Error("Hair Gem", false, "Failed to get thre hair material Srg for the raster pass."); + AZ_Error("Hair Gem", false, "Failed to get the hair material Srg for the raster pass."); return false; } // No need to compile the simSrg since it was compiled already by the Compute pass this frame diff --git a/Gems/AtomTressFX/Code/Rendering/HairRenderObject.h b/Gems/AtomTressFX/Code/Rendering/HairRenderObject.h index 817ebd89fa..564272e6f0 100644 --- a/Gems/AtomTressFX/Code/Rendering/HairRenderObject.h +++ b/Gems/AtomTressFX/Code/Rendering/HairRenderObject.h @@ -110,8 +110,14 @@ namespace AZ PrepareSrgDescriptors(m_dynamicBuffersDescriptors, vertexCount, strandsCount); } - Data::Instance GetSimSrgForCompute() { return m_simSrgForCompute; } - Data::Instance GetSimSrgForRaster() { return m_simSrgForRaster; } + Data::Instance GetSimSrgForCompute() + { + return m_initialized ? m_simSrgForCompute : nullptr; + } + + Data::Instance GetSimSrgForRaster() + { + return m_initialized ? m_simSrgForRaster : nullptr; } bool IsInitialized() { return m_initialized; } From 295c836ed81839cc13695df1e2c6b6bf13b06adb Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Fri, 14 Jan 2022 12:46:08 -0800 Subject: [PATCH 489/948] clean up comments, add set type action in disabled form Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- .../Source/Components/Slots/Data/DataSlotComponent.cpp | 1 - Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp | 3 --- Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp | 8 ++++++-- Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Slot.cpp | 1 - .../Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp | 6 +++--- .../Variable/GraphVariableManagerComponent.cpp | 1 - 6 files changed, 9 insertions(+), 11 deletions(-) diff --git a/Gems/GraphCanvas/Code/Source/Components/Slots/Data/DataSlotComponent.cpp b/Gems/GraphCanvas/Code/Source/Components/Slots/Data/DataSlotComponent.cpp index 7eb9187123..c053c37fbc 100644 --- a/Gems/GraphCanvas/Code/Source/Components/Slots/Data/DataSlotComponent.cpp +++ b/Gems/GraphCanvas/Code/Source/Components/Slots/Data/DataSlotComponent.cpp @@ -328,7 +328,6 @@ namespace GraphCanvas bool DataSlotComponent::CanConvertToReference([[maybe_unused]] bool isNewSlot) const { - // #sc_user_slot_variable_ux make sure this can be converted to reference, or created as one bool canToggleReference = false; if (m_canConvertSlotTypes && DataSlotUtils::IsValueDataSlotType(m_dataSlotType) && !HasConnections()) diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp index 92045b505f..510962cf4b 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp @@ -667,7 +667,6 @@ namespace ScriptCanvasEditor } // Now that the slot has a valid type/name, we can actually promote it to a variable - // #sc_user_slot_variable_ux add a value indicating that the slot is new if (PromoteToVariableAction(endpoint, true)) { ScriptCanvas::GraphVariable* variable = slot->GetVariable(); @@ -2191,7 +2190,6 @@ namespace ScriptCanvasEditor bool Graph::PromoteToVariableAction(const GraphCanvas::Endpoint& endpoint, bool isNewSlot) { - // #sc_user_slot_variable_ux make the fix here...rework is user added or something ScriptCanvas::Endpoint scriptCanvasEndpoint = ConvertToScriptCanvasEndpoint(endpoint); auto activeNode = FindNode(scriptCanvasEndpoint.GetNodeId()); @@ -2283,7 +2281,6 @@ namespace ScriptCanvasEditor AZ::Outcome addOutcome; - // #sc_user_slot_variable_ux re-use the activeDatum, send the pointer (actually, all of the source slot information, and make a special conversion) ScriptCanvas::GraphVariableManagerRequestBus::EventResult(addOutcome, GetScriptCanvasId(), &ScriptCanvas::GraphVariableManagerRequests::AddVariable, variableName, variableDatum, true); if (addOutcome.IsSuccess()) diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index 573a3f6e57..b5b4fc7787 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -3874,8 +3874,12 @@ namespace ScriptCanvasEditor contextMenu.AddMenuAction(aznew ExposeSlotMenuAction(&contextMenu)); contextMenu.AddMenuAction(aznew CreateAzEventHandlerSlotMenuAction(&contextMenu)); - // disabling until references can be changed - // contextMenu.AddMenuAction(aznew SetDataSlotTypeMenuAction(&contextMenu)); + auto setSlotTypeAction = aznew SetDataSlotTypeMenuAction(&contextMenu); + // Changing slot type is disabled temporarily because now that that user data slots are correctly coordinated with their reference + // variables, their type cannot be changed. The next change will allow all variables to change their type post creation, and then + // that will allow this action to be enabled. + setSlotTypeAction->setEnabled(false); + contextMenu.AddMenuAction(setSlotTypeAction); return HandleContextMenu(contextMenu, slotId, screenPoint, scenePoint); } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Slot.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Slot.cpp index 6aef61b12f..4bdd0daae6 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Slot.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Slot.cpp @@ -462,7 +462,6 @@ namespace ScriptCanvas bool Slot::CanConvertToReference(bool isNewSlot) const { - // #sc_user_slot_variable_ux make sure this can be converted to reference, or created as one return (!m_isUserAdded || isNewSlot) && CanConvertTypes() && !m_isVariableReference && !m_node->HasConnectedNodes((*this)); } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp index b2194e1bd0..345dc1ebda 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp @@ -237,7 +237,7 @@ namespace ScriptCanvas if (auto datum = variablePair.second.GetDatum()) { - // #sc_user_slot_variable_ux consider getting all variables from the UX variable manager, or from the ACM and looking them up in the variable manager for ordering + // #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)); } } @@ -247,7 +247,7 @@ namespace ScriptCanvas auto datum = sourceVariable->GetDatum(); AZ_Assert(datum != nullptr, "the datum must be valid"); - // #sc_user_slot_variable_ux check to verify if it is a member variable + // #functions2 slot<->variable check to verify if it is a member variable auto variable = sourceVariable->GetScope() == VariableFlags::Scope::Graph ? AddMemberVariable(*datum, sourceVariable->GetVariableName(), sourceVariable->GetVariableId()) : AddVariable(*datum, sourceVariable->GetVariableName(), sourceVariable->GetVariableId()); @@ -1670,7 +1670,7 @@ namespace ScriptCanvas if (returnValue.second->m_source->m_sourceSlotId == slot->GetId()) { - // #sc_user_slot_variable_ux determine if the root or the function call should be passed in here...the slot/node lead to the user call on the thread, but it may not even be created yet + // #functions2 slot<->variable determine if the root or the function call should be passed in here...the slot/node lead to the user call on the thread, but it may not even be created yet return AZStd::make_pair(root, returnValue.second->m_source); } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariableManagerComponent.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariableManagerComponent.cpp index 81383bf747..0bd1b2c5a4 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariableManagerComponent.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Variable/GraphVariableManagerComponent.cpp @@ -220,7 +220,6 @@ namespace ScriptCanvas return AZ::Success(newId); } - // #sc_user_slot_variable_ux add this to the graph, using the old datum AZ::Outcome GraphVariableManagerComponent::AddVariable(AZStd::string_view name, const Datum& value, bool functionScope) { if (FindVariable(name)) From c9ee1f7871b5875de19b943df05d7a705f0ce7ef Mon Sep 17 00:00:00 2001 From: Qing Tao <55564570+VickyAtAZ@users.noreply.github.com> Date: Fri, 14 Jan 2022 13:31:13 -0800 Subject: [PATCH 490/948] ATOM-17132 Image builder failed to build some images after preset was fixed (#6900) The issue was because the preset reload was only happened in CreateJobs but not ProcessJobs. But these two functions might be called from different AssetBuilder. The fix is to add preset reload for Processjobs too. There was another change to add debug device name for streaming image. Signed-off-by: Qing Tao <55564570+VickyAtAZ@users.noreply.github.com> --- .../BuilderSettings/TextureSettings.cpp | 8 +++++ .../Code/Source/ImageBuilderComponent.cpp | 34 +++++++++++++++++-- .../RPI.Public/Image/StreamingImage.cpp | 12 ++++--- 3 files changed, 47 insertions(+), 7 deletions(-) diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/BuilderSettings/TextureSettings.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/BuilderSettings/TextureSettings.cpp index 29d9b21775..4772a94ffa 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/BuilderSettings/TextureSettings.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/BuilderSettings/TextureSettings.cpp @@ -226,6 +226,14 @@ namespace ImageProcessingAtom MultiplatformTextureSettings settings; PlatformNameList platformsList = BuilderSettingManager::Instance()->GetPlatformList(); PresetName suggestedPreset = BuilderSettingManager::Instance()->GetSuggestedPreset(imageFilepath); + + // If the suggested preset doesn't exist (or was failed to be loaded), return empty texture settings + if (BuilderSettingManager::Instance()->GetPreset(suggestedPreset) == nullptr) + { + AZ_Error("Image Processing", false, "Failed to find suggested preset [%s]", suggestedPreset.GetCStr()); + return settings; + } + for (PlatformName& platform : platformsList) { TextureSettings textureSettings; diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageBuilderComponent.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageBuilderComponent.cpp index 5e021a3fdd..55a6c1ea8f 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageBuilderComponent.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageBuilderComponent.cpp @@ -241,8 +241,7 @@ namespace ImageProcessingAtom // Reload preset if it was changed ImageProcessingAtom::BuilderSettingManager::Instance()->ReloadPreset(presetName); - AZStd::string_view filePath; - auto presetSettings = BuilderSettingManager::Instance()->GetPreset(presetName, /*default platform*/"", &filePath); + auto presetSettings = BuilderSettingManager::Instance()->GetPreset(presetName, /*default platform*/""); AssetBuilderSDK::SourceFileDependency sourceFileDependency; sourceFileDependency.m_sourceDependencyType = AssetBuilderSDK::SourceFileDependency::SourceFileDependencyType::Absolute; @@ -274,6 +273,32 @@ namespace ImageProcessingAtom } } + void ReloadPresetIfNeeded(PresetName presetName) + { + // Reload preset if it was changed + ImageProcessingAtom::BuilderSettingManager::Instance()->ReloadPreset(presetName); + + auto presetSettings = BuilderSettingManager::Instance()->GetPreset(presetName, /*default platform*/""); + + if (presetSettings) + { + // handle special case here + // Cubemap setting may reference some other presets + if (presetSettings->m_cubemapSetting) + { + if (presetSettings->m_cubemapSetting->m_generateIBLDiffuse && !presetSettings->m_cubemapSetting->m_iblDiffusePreset.IsEmpty()) + { + ImageProcessingAtom::BuilderSettingManager::Instance()->ReloadPreset(presetSettings->m_cubemapSetting->m_iblDiffusePreset); + } + + if (presetSettings->m_cubemapSetting->m_generateIBLSpecular && !presetSettings->m_cubemapSetting->m_iblSpecularPreset.IsEmpty()) + { + ImageProcessingAtom::BuilderSettingManager::Instance()->ReloadPreset(presetSettings->m_cubemapSetting->m_iblSpecularPreset); + } + } + } + } + // this happens early on in the file scanning pass // this function should consistently always create the same jobs, and should do no checking whether the job is up to date or not - just be consistent. void ImageBuilderWorker::CreateJobs(const AssetBuilderSDK::CreateJobsRequest& request, AssetBuilderSDK::CreateJobsResponse& response) @@ -336,6 +361,11 @@ namespace ImageProcessingAtom // Do conversion and get exported file's path if (needConversion) { + + // Handles preset changes + auto presetName = GetImagePreset(request.m_fullPath); + ReloadPresetIfNeeded(presetName); + AZ_TracePrintf(AssetBuilderSDK::InfoWindow, "Performing image conversion: %s\n", request.m_fullPath.c_str()); ImageConvertProcess* process = CreateImageConvertProcess(request.m_fullPath, request.m_tempDirPath, request.m_jobDescription.GetPlatformIdentifier(), response.m_outputProducts); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Image/StreamingImage.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Image/StreamingImage.cpp index fb03d109a2..49cd52f212 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Image/StreamingImage.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Image/StreamingImage.cpp @@ -143,11 +143,6 @@ namespace AZ RHI::ResultCode resultCode = RHI::ResultCode::Success; const ImageMipChainAsset& mipChainTailAsset = imageAsset.GetTailMipChain(); - -#ifdef AZ_RPI_STREAMING_IMAGE_DEBUG_LOG - m_image->SetName(Name(imageAsset.GetHint().c_str())); - AZ_TracePrintf("StreamingImage", "Init image [%s]\n", m_image->GetName().data()); -#endif { RHI::StreamingImageInitRequest initRequest; @@ -193,6 +188,13 @@ namespace AZ m_rhiPool = rhiPool; m_pool = pool; m_pool->AttachImage(this); + + // Set rhi image name + m_image->SetName(Name(m_imageAsset.GetHint())); + +#ifdef AZ_RPI_STREAMING_IMAGE_DEBUG_LOG + AZ_TracePrintf("StreamingImage", "Init image [%s]\n", m_image->GetName().data()); +#endif #if defined (AZ_RPI_STREAMING_IMAGE_HOT_RELOADING) BusConnect(imageAsset.GetId()); From e4bd28f636d9421bb1807bac8c1586afa26afe37 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Fri, 14 Jan 2022 13:48:37 -0800 Subject: [PATCH 491/948] Update NetworkSpawnableLibrary to only hold onto network.spawnables (instead of all spawnables) Signed-off-by: Gene Walters --- .../Source/NetworkEntity/NetworkSpawnableLibrary.cpp | 4 ++-- .../Code/Source/NetworkEntity/NetworkSpawnableLibrary.h | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.cpp b/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.cpp index f60778dbb4..7fb7bfdc39 100644 --- a/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.cpp +++ b/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.cpp @@ -10,7 +10,6 @@ #include #include #include -#include #include namespace Multiplayer @@ -42,7 +41,8 @@ namespace Multiplayer auto enumerateCallback = [this](const AZ::Data::AssetId id, const AZ::Data::AssetInfo& info) { - if (info.m_assetType == AZ::AzTypeInfo::Uuid()) + if (info.m_assetType == AZ::AzTypeInfo::Uuid() && + info.m_relativePath.ends_with(".network.spawnable")) { ProcessSpawnableAsset(info.m_relativePath, id); } diff --git a/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.h b/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.h index 0fc3ae07cc..db22ccf9de 100644 --- a/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.h +++ b/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.h @@ -22,13 +22,16 @@ namespace Multiplayer NetworkSpawnableLibrary(); ~NetworkSpawnableLibrary(); - - /// INetworkSpawnableLibrary overrides. + + //! INetworkSpawnableLibrary overrides. + //! @{ + // Iterates over all assets (on-disk and in-memory) and stores any spawnables that are "network.spawnables" + // This allows us to look up network spawnable assets by name or id for later use void BuildSpawnablesList() override; void ProcessSpawnableAsset(const AZStd::string& relativePath, AZ::Data::AssetId id) override; AZ::Name GetSpawnableNameFromAssetId(AZ::Data::AssetId assetId) override; AZ::Data::AssetId GetAssetIdByName(AZ::Name name) override; - + //! @} private: AZStd::unordered_map m_spawnables; From 3d17f9648f1b9f0431cf390f003cc64cace2003a Mon Sep 17 00:00:00 2001 From: jromnoa <80134229+jromnoa@users.noreply.github.com> Date: Fri, 14 Jan 2022 14:08:29 -0800 Subject: [PATCH 492/948] removes the old log lines test for the Light component, test will be re-added as a return codes test in the p1 test tasks Signed-off-by: jromnoa <80134229+jromnoa@users.noreply.github.com> --- .../Gem/PythonTests/Atom/TestSuite_Sandbox.py | 69 +----- ...dra_AtomEditorComponents_LightComponent.py | 213 ------------------ 2 files changed, 1 insertion(+), 281 deletions(-) delete mode 100644 AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_LightComponent.py diff --git a/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Sandbox.py b/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Sandbox.py index c9182070f6..bd0477a1db 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Sandbox.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Sandbox.py @@ -9,87 +9,20 @@ import os import pytest -import ly_test_tools.environment.file_system as file_system -import editor_python_test_tools.hydra_test_utils as hydra from ly_test_tools.o3de.editor_test import EditorSharedTest, EditorTestSuite -from Atom.atom_utils.atom_constants import LIGHT_TYPES logger = logging.getLogger(__name__) TEST_DIRECTORY = os.path.join(os.path.dirname(__file__), "tests") -@pytest.mark.parametrize("project", ["AutomatedTesting"]) -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -@pytest.mark.parametrize("level", ["auto_test"]) -class TestAtomEditorComponentsMain(object): - """Holds tests for Atom components.""" - - @pytest.mark.test_case_id("C34525095") - def test_AtomEditorComponents_LightComponent( - self, request, editor, workspace, project, launcher_platform, level): - """ - Please review the hydra script run by this test for more specific test info. - Tests that the Light component has the expected property options available to it. - """ - cfg_args = [level] - - expected_lines = [ - "light_entity Entity successfully created", - "Entity has a Light component", - "light_entity_test: Component added to the entity: True", - f"light_entity_test: Property value is {LIGHT_TYPES['sphere']} which matches {LIGHT_TYPES['sphere']}", - "Controller|Configuration|Shadows|Enable shadow set to True", - "light_entity Controller|Configuration|Shadows|Shadowmap size: SUCCESS", - "Controller|Configuration|Shadows|Shadow filter method set to 1", # PCF - "Controller|Configuration|Shadows|Filtering sample count set to 4", - "Controller|Configuration|Shadows|Filtering sample count set to 64", - "Controller|Configuration|Shadows|Shadow filter method set to 2", # ESM - "Controller|Configuration|Shadows|ESM exponent set to 50.0", - "Controller|Configuration|Shadows|ESM exponent set to 5000.0", - "Controller|Configuration|Shadows|Shadow filter method set to 3", # ESM+PCF - f"light_entity_test: Property value is {LIGHT_TYPES['spot_disk']} which matches {LIGHT_TYPES['spot_disk']}", - f"light_entity_test: Property value is {LIGHT_TYPES['capsule']} which matches {LIGHT_TYPES['capsule']}", - f"light_entity_test: Property value is {LIGHT_TYPES['quad']} which matches {LIGHT_TYPES['quad']}", - "light_entity Controller|Configuration|Fast approximation: SUCCESS", - "light_entity Controller|Configuration|Both directions: SUCCESS", - f"light_entity_test: Property value is {LIGHT_TYPES['polygon']} which matches {LIGHT_TYPES['polygon']}", - f"light_entity_test: Property value is {LIGHT_TYPES['simple_point']} " - f"which matches {LIGHT_TYPES['simple_point']}", - "Controller|Configuration|Attenuation radius|Mode set to 0", - "Controller|Configuration|Attenuation radius|Radius set to 100.0", - f"light_entity_test: Property value is {LIGHT_TYPES['simple_spot']} " - f"which matches {LIGHT_TYPES['simple_spot']}", - "Controller|Configuration|Shutters|Outer angle set to 45.0", - "Controller|Configuration|Shutters|Outer angle set to 90.0", - "light_entity_test: Component added to the entity: True", - "Light component test (non-GPU) completed.", - ] - - unexpected_lines = ["Traceback (most recent call last):"] - - hydra.launch_and_validate_results( - request, - TEST_DIRECTORY, - editor, - "hydra_AtomEditorComponents_LightComponent.py", - timeout=120, - expected_lines=expected_lines, - unexpected_lines=unexpected_lines, - halt_on_unexpected=True, - null_renderer=True, - cfg_args=cfg_args, - enable_prefab_system=False, - ) - - @pytest.mark.parametrize("project", ["AutomatedTesting"]) @pytest.mark.parametrize("launcher_platform", ['windows_editor']) class TestAutomation(EditorTestSuite): enable_prefab_system = False - #this test is intermittently timing out without ever having executed. sandboxing while we investigate cause. + # this test is intermittently timing out without ever having executed. sandboxing while we investigate cause. @pytest.mark.test_case_id("C36525660") class AtomEditorComponents_DisplayMapperAdded(EditorSharedTest): from Atom.tests import hydra_AtomEditorComponents_DisplayMapperAdded as test_module diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_LightComponent.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_LightComponent.py deleted file mode 100644 index 7ecdc6859b..0000000000 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomEditorComponents_LightComponent.py +++ /dev/null @@ -1,213 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -import os -import sys - -import azlmbr.bus as bus -import azlmbr.editor as editor -import azlmbr.math as math -import azlmbr.paths -import azlmbr.legacy.general as general - -sys.path.append(os.path.join(azlmbr.paths.projectroot, "Gem", "PythonTests")) - -import editor_python_test_tools.hydra_editor_utils as hydra -from Atom.atom_utils.atom_constants import LIGHT_TYPES - -LIGHT_TYPE_PROPERTY = 'Controller|Configuration|Light type' -SPHERE_AND_SPOT_DISK_LIGHT_PROPERTIES = [ - ("Controller|Configuration|Shadows|Enable shadow", True), - ("Controller|Configuration|Shadows|Shadowmap size", 0), # 256 - ("Controller|Configuration|Shadows|Shadowmap size", 1), # 512 - ("Controller|Configuration|Shadows|Shadowmap size", 2), # 1024 - ("Controller|Configuration|Shadows|Shadowmap size", 3), # 2048 - ("Controller|Configuration|Shadows|Shadow filter method", 1), # PCF - ("Controller|Configuration|Shadows|Filtering sample count", 4.0), - ("Controller|Configuration|Shadows|Filtering sample count", 64.0), - ("Controller|Configuration|Shadows|Shadow filter method", 2), # ECM - ("Controller|Configuration|Shadows|ESM exponent", 50), - ("Controller|Configuration|Shadows|ESM exponent", 5000), - ("Controller|Configuration|Shadows|Shadow filter method", 3), # ESM+PCF -] -QUAD_LIGHT_PROPERTIES = [ - ("Controller|Configuration|Both directions", True), - ("Controller|Configuration|Fast approximation", True), -] -SIMPLE_POINT_LIGHT_PROPERTIES = [ - ("Controller|Configuration|Attenuation radius|Mode", 0), - ("Controller|Configuration|Attenuation radius|Radius", 100.0), -] -SIMPLE_SPOT_LIGHT_PROPERTIES = [ - ("Controller|Configuration|Shutters|Inner angle", 45.0), - ("Controller|Configuration|Shutters|Outer angle", 90.0), -] - - -def verify_required_component_property_value(entity_name, component, property_path, expected_property_value): - """ - Compares the property value of component against the expected_property_value. - :param entity_name: name of the entity to use (for test verification purposes). - :param component: component to check on a given entity for its current property value. - :param property_path: the path to the property inside the component. - :param expected_property_value: The value expected from the value inside property_path. - :return: None, but prints to general.log() which the test uses to verify against. - """ - property_value = editor.EditorComponentAPIBus( - bus.Broadcast, "GetComponentProperty", component, property_path).GetValue() - general.log(f"{entity_name}_test: Property value is {property_value} " - f"which matches {expected_property_value}") - - -def run(): - """ - Test Case - Light Component - 1. Creates a "light_entity" Entity and attaches a "Light" component to it. - 2. Updates the Light component to each light type option from the LIGHT_TYPES constant. - 3. The test will check the Editor log to ensure each light type was selected. - 4. Prints the string "Light component test (non-GPU) completed" after completion. - - Tests will fail immediately if any of these log lines are found: - 1. Trace::Assert - 2. Trace::Error - 3. Traceback (most recent call last): - - :return: None - """ - # Create a "light_entity" entity with "Light" component. - light_entity_name = "light_entity" - light_component = "Light" - light_entity = hydra.Entity(light_entity_name) - light_entity.create_entity(math.Vector3(-1.0, -2.0, 3.0), [light_component]) - general.log( - f"{light_entity_name}_test: Component added to the entity: " - f"{hydra.has_components(light_entity.id, [light_component])}") - - # Populate the light_component_id_pair value so that it can be used to select all Light component options. - light_component_id_pair = None - component_type_id_list = azlmbr.editor.EditorComponentAPIBus( - azlmbr.bus.Broadcast, 'FindComponentTypeIdsByEntityType', [light_component], 0) - if len(component_type_id_list) < 1: - general.log(f"ERROR: A component class with name {light_component} doesn't exist") - light_component_id_pair = None - elif len(component_type_id_list) > 1: - general.log(f"ERROR: Found more than one component classes with same name: {light_component}") - light_component_id_pair = None - entity_component_id_pair = azlmbr.editor.EditorComponentAPIBus( - azlmbr.bus.Broadcast, 'GetComponentOfType', light_entity.id, component_type_id_list[0]) - if entity_component_id_pair.IsSuccess(): - light_component_id_pair = entity_component_id_pair.GetValue() - - # Test each Light component option can be selected and it's properties updated. - # Point (sphere) light type checks. - light_type_property_test( - light_type=LIGHT_TYPES['sphere'], - light_properties=SPHERE_AND_SPOT_DISK_LIGHT_PROPERTIES, - light_component_id_pair=light_component_id_pair, - light_entity_name=light_entity_name, - light_entity=light_entity - ) - - # Spot (disk) light type checks. - light_type_property_test( - light_type=LIGHT_TYPES['spot_disk'], - light_properties=SPHERE_AND_SPOT_DISK_LIGHT_PROPERTIES, - light_component_id_pair=light_component_id_pair, - light_entity_name=light_entity_name, - light_entity=light_entity - ) - - # Capsule light type checks. - azlmbr.editor.EditorComponentAPIBus( - azlmbr.bus.Broadcast, - 'SetComponentProperty', - light_component_id_pair, - LIGHT_TYPE_PROPERTY, - LIGHT_TYPES['capsule'] - ) - verify_required_component_property_value( - entity_name=light_entity_name, - component=light_entity.components[0], - property_path=LIGHT_TYPE_PROPERTY, - expected_property_value=LIGHT_TYPES['capsule'] - ) - - # Quad light type checks. - light_type_property_test( - light_type=LIGHT_TYPES['quad'], - light_properties=QUAD_LIGHT_PROPERTIES, - light_component_id_pair=light_component_id_pair, - light_entity_name=light_entity_name, - light_entity=light_entity - ) - - # Polygon light type checks. - azlmbr.editor.EditorComponentAPIBus( - azlmbr.bus.Broadcast, - 'SetComponentProperty', - light_component_id_pair, - LIGHT_TYPE_PROPERTY, - LIGHT_TYPES['polygon'] - ) - verify_required_component_property_value( - entity_name=light_entity_name, - component=light_entity.components[0], - property_path=LIGHT_TYPE_PROPERTY, - expected_property_value=LIGHT_TYPES['polygon'] - ) - - # Point (simple punctual) light type checks. - light_type_property_test( - light_type=LIGHT_TYPES['simple_point'], - light_properties=SIMPLE_POINT_LIGHT_PROPERTIES, - light_component_id_pair=light_component_id_pair, - light_entity_name=light_entity_name, - light_entity=light_entity - ) - - # Spot (simple punctual) light type checks. - light_type_property_test( - light_type=LIGHT_TYPES['simple_spot'], - light_properties=SIMPLE_SPOT_LIGHT_PROPERTIES, - light_component_id_pair=light_component_id_pair, - light_entity_name=light_entity_name, - light_entity=light_entity - ) - - general.log("Light component test (non-GPU) completed.") - - -def light_type_property_test(light_type, light_properties, light_component_id_pair, light_entity_name, light_entity): - """ - Updates the current light type and modifies its properties, then verifies they are accurate to what was set. - :param light_type: The type of light to update, must match a value in LIGHT_TYPES - :param light_properties: List of tuples detailing properties to modify with update values. - :param light_component_id_pair: Entity + component ID pair for updating the light component on a given entity. - :param light_entity_name: the name of the Entity holding the light component. - :param light_entity: the Entity object containing the light component. - :return: None - """ - azlmbr.editor.EditorComponentAPIBus( - azlmbr.bus.Broadcast, - 'SetComponentProperty', - light_component_id_pair, - LIGHT_TYPE_PROPERTY, - light_type - ) - verify_required_component_property_value( - entity_name=light_entity_name, - component=light_entity.components[0], - property_path=LIGHT_TYPE_PROPERTY, - expected_property_value=light_type - ) - - for light_property in light_properties: - light_entity.get_set_test(0, light_property[0], light_property[1]) - - -if __name__ == "__main__": - run() From 588527064019a15f81c8626a80db7ada0b472e49 Mon Sep 17 00:00:00 2001 From: Vincent Liu <5900509+onecent1101@users.noreply.github.com> Date: Fri, 14 Jan 2022 14:36:15 -0800 Subject: [PATCH 493/948] [iOS] Update to use AWSNativeSDK 1.9.50 (#6890) Signed-off-by: onecent1101 --- Gems/AWSCore/Code/Platform/iOS/AWSCore_Traits_iOS.h | 2 +- cmake/3rdParty/Platform/iOS/BuiltInPackages_ios.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gems/AWSCore/Code/Platform/iOS/AWSCore_Traits_iOS.h b/Gems/AWSCore/Code/Platform/iOS/AWSCore_Traits_iOS.h index d7b1f32461..2cacfb0d34 100644 --- a/Gems/AWSCore/Code/Platform/iOS/AWSCore_Traits_iOS.h +++ b/Gems/AWSCore/Code/Platform/iOS/AWSCore_Traits_iOS.h @@ -7,4 +7,4 @@ */ #pragma once -#define AWSCORE_BACKWARD_INCOMPATIBLE_CHANGE 0 +#define AWSCORE_BACKWARD_INCOMPATIBLE_CHANGE 1 diff --git a/cmake/3rdParty/Platform/iOS/BuiltInPackages_ios.cmake b/cmake/3rdParty/Platform/iOS/BuiltInPackages_ios.cmake index d8dd7e8134..4b99efc9d0 100644 --- a/cmake/3rdParty/Platform/iOS/BuiltInPackages_ios.cmake +++ b/cmake/3rdParty/Platform/iOS/BuiltInPackages_ios.cmake @@ -18,7 +18,7 @@ ly_associate_package(PACKAGE_NAME glad-2.0.0-beta-rev2-multiplatform TARGETS gla # platform-specific: ly_associate_package(PACKAGE_NAME tiff-4.2.0.15-rev3-ios TARGETS TIFF PACKAGE_HASH e9067e88649fb6e93a926d9ed38621a9fae360a2e6f6eb24ebca63c1bc7761ea) ly_associate_package(PACKAGE_NAME freetype-2.10.4.16-ios TARGETS freetype PACKAGE_HASH 3ac3c35e056ae4baec2e40caa023d76a7a3320895ef172b6655e9261b0dc2e29) -ly_associate_package(PACKAGE_NAME AWSNativeSDK-1.7.167-rev4-ios TARGETS AWSNativeSDK PACKAGE_HASH d10e7496ca705577032821011beaf9f2507689f23817bfa0ed4d2a2758afcd02) +ly_associate_package(PACKAGE_NAME AWSNativeSDK-1.9.50-rev1-ios TARGETS AWSNativeSDK PACKAGE_HASH c3c9478c259ecb569fb2ce6fcfa733647adc3b6bd2854e8eff9de64bcd18c745) ly_associate_package(PACKAGE_NAME Lua-5.3.5-rev5-ios TARGETS Lua PACKAGE_HASH c2d3c4e67046c293049292317a7d60fdb8f23effeea7136aefaef667163e5ffe) ly_associate_package(PACKAGE_NAME PhysX-4.1.2.29882248-rev5-ios TARGETS PhysX PACKAGE_HASH 4a5e38b385837248590018eb133444b4e440190414e6756191200a10c8fa5615) ly_associate_package(PACKAGE_NAME mikkelsen-1.0.0.4-ios TARGETS mikkelsen PACKAGE_HASH 976aaa3ccd8582346132a10af253822ccc5d5bcc9ea5ba44d27848f65ee88a8a) From a6feef3563a6731c15ecb4090855027a0aae26b8 Mon Sep 17 00:00:00 2001 From: Guthrie Adams Date: Fri, 14 Jan 2022 16:51:46 -0600 Subject: [PATCH 494/948] Atom Tools: Created base class for document-based applications Moving some duplicated code to a common base class Signed-off-by: Guthrie Adams --- .../Document/AtomToolsDocumentApplication.h | 28 ++++++++++++++++ .../Document/AtomToolsDocumentApplication.cpp | 33 +++++++++++++++++++ .../Code/atomtoolsframework_files.cmake | 2 ++ .../Code/Source/MaterialEditorApplication.cpp | 18 +--------- .../Code/Source/MaterialEditorApplication.h | 13 +++----- .../ShaderManagementConsoleApplication.cpp | 19 +---------- .../ShaderManagementConsoleApplication.h | 13 +++----- 7 files changed, 75 insertions(+), 51 deletions(-) create mode 100644 Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Document/AtomToolsDocumentApplication.h create mode 100644 Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocumentApplication.cpp diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Document/AtomToolsDocumentApplication.h b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Document/AtomToolsDocumentApplication.h new file mode 100644 index 0000000000..7b9327337c --- /dev/null +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Document/AtomToolsDocumentApplication.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include + +namespace AtomToolsFramework +{ + class AtomToolsDocumentApplication + : public AtomToolsApplication + { + public: + AZ_TYPE_INFO(AtomToolsDocumentApplication, "{F4B43677-EB95-4CBB-8B8E-9EF4247E6F0D}"); + + using Base = AtomToolsApplication; + + AtomToolsDocumentApplication(int* argc, char*** argv); + + // AtomToolsApplication overrides... + void ProcessCommandLine(const AZ::CommandLine& commandLine) override; + }; +} // namespace AtomToolsFramework diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocumentApplication.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocumentApplication.cpp new file mode 100644 index 0000000000..beb414bb6c --- /dev/null +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocumentApplication.cpp @@ -0,0 +1,33 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include + +namespace AtomToolsFramework +{ + AtomToolsDocumentApplication::AtomToolsDocumentApplication(int* argc, char*** argv) + : Base(argc, argv) + { + } + + void AtomToolsDocumentApplication::ProcessCommandLine(const AZ::CommandLine& commandLine) + { + // Process command line options for opening documents on startup + size_t openDocumentCount = commandLine.GetNumMiscValues(); + for (size_t openDocumentIndex = 0; openDocumentIndex < openDocumentCount; ++openDocumentIndex) + { + const AZStd::string openDocumentPath = commandLine.GetMiscValue(openDocumentIndex); + + AZ_Printf(GetBuildTargetName().c_str(), "Opening document: %s", openDocumentPath.c_str()); + AtomToolsDocumentSystemRequestBus::Broadcast(&AtomToolsDocumentSystemRequestBus::Events::OpenDocument, openDocumentPath); + } + + Base::ProcessCommandLine(commandLine); + } +} // namespace AtomToolsFramework diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/atomtoolsframework_files.cmake b/Gems/Atom/Tools/AtomToolsFramework/Code/atomtoolsframework_files.cmake index 3ddcc05245..4f0e0d34e7 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/atomtoolsframework_files.cmake +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/atomtoolsframework_files.cmake @@ -12,6 +12,7 @@ set(FILES Include/AtomToolsFramework/Communication/LocalSocket.h Include/AtomToolsFramework/Debug/TraceRecorder.h Include/AtomToolsFramework/Document/AtomToolsDocument.h + Include/AtomToolsFramework/Document/AtomToolsDocumentApplication.h Include/AtomToolsFramework/Document/AtomToolsDocumentMainWindow.h Include/AtomToolsFramework/Document/AtomToolsDocumentSystemSettings.h Include/AtomToolsFramework/Document/AtomToolsDocumentSystemRequestBus.h @@ -40,6 +41,7 @@ set(FILES Source/Communication/LocalSocket.cpp Source/Debug/TraceRecorder.cpp Source/Document/AtomToolsDocument.cpp + Source/Document/AtomToolsDocumentApplication.cpp Source/Document/AtomToolsDocumentMainWindow.cpp Source/Document/AtomToolsDocumentSystemSettings.cpp Source/Document/AtomToolsDocumentSystemComponent.cpp diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/MaterialEditorApplication.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/MaterialEditorApplication.cpp index cec882cabb..15a5ff1715 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/MaterialEditorApplication.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/MaterialEditorApplication.cpp @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include @@ -37,7 +36,7 @@ namespace MaterialEditor } MaterialEditorApplication::MaterialEditorApplication(int* argc, char*** argv) - : AtomToolsApplication(argc, argv) + : Base(argc, argv) { QApplication::setApplicationName("O3DE Material Editor"); @@ -58,19 +57,4 @@ namespace MaterialEditor { return AZStd::vector({ "passes/", "config/", "MaterialEditor/" }); } - - void MaterialEditorApplication::ProcessCommandLine(const AZ::CommandLine& commandLine) - { - // Process command line options for opening one or more material documents on startup - size_t openDocumentCount = commandLine.GetNumMiscValues(); - for (size_t openDocumentIndex = 0; openDocumentIndex < openDocumentCount; ++openDocumentIndex) - { - const AZStd::string openDocumentPath = commandLine.GetMiscValue(openDocumentIndex); - - AZ_Printf(GetBuildTargetName().c_str(), "Opening document: %s", openDocumentPath.c_str()); - AtomToolsFramework::AtomToolsDocumentSystemRequestBus::Broadcast(&AtomToolsFramework::AtomToolsDocumentSystemRequestBus::Events::OpenDocument, openDocumentPath); - } - - Base::ProcessCommandLine(commandLine); - } } // namespace MaterialEditor diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/MaterialEditorApplication.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/MaterialEditorApplication.h index e91bce48f0..bf2e6f6ca1 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/MaterialEditorApplication.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/MaterialEditorApplication.h @@ -8,30 +8,27 @@ #pragma once -#include -#include +#include namespace MaterialEditor { class MaterialThumbnailRenderer; class MaterialEditorApplication - : public AtomToolsFramework::AtomToolsApplication + : public AtomToolsFramework::AtomToolsDocumentApplication { public: AZ_TYPE_INFO(MaterialEditor::MaterialEditorApplication, "{30F90CA5-1253-49B5-8143-19CEE37E22BB}"); - using Base = AtomToolsFramework::AtomToolsApplication; + using Base = AtomToolsFramework::AtomToolsDocumentApplication; MaterialEditorApplication(int* argc, char*** argv); - ////////////////////////////////////////////////////////////////////////// - // AzFramework::Application + // AzFramework::Application overrides... void CreateStaticModules(AZStd::vector& outModules) override; const char* GetCurrentConfigurationName() const override; - private: - void ProcessCommandLine(const AZ::CommandLine& commandLine) override; + // AtomToolsFramework::AtomToolsApplication overrides... AZStd::string GetBuildTargetName() const override; AZStd::vector GetCriticalAssetFilters() const override; }; diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/ShaderManagementConsoleApplication.cpp b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/ShaderManagementConsoleApplication.cpp index 3d07a0de15..a242716b52 100644 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/ShaderManagementConsoleApplication.cpp +++ b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/ShaderManagementConsoleApplication.cpp @@ -8,7 +8,6 @@ #include #include -#include #include #include #include @@ -36,7 +35,7 @@ namespace ShaderManagementConsole } ShaderManagementConsoleApplication::ShaderManagementConsoleApplication(int* argc, char*** argv) - : AtomToolsApplication(argc, argv) + : Base(argc, argv) { QApplication::setApplicationName("O3DE Shader Management Console"); @@ -56,20 +55,4 @@ namespace ShaderManagementConsole { return AZStd::vector({ "passes/", "config/" }); } - - void ShaderManagementConsoleApplication::ProcessCommandLine(const AZ::CommandLine& commandLine) - { - // Process command line options for opening one or more documents on startup - size_t openDocumentCount = commandLine.GetNumMiscValues(); - for (size_t openDocumentIndex = 0; openDocumentIndex < openDocumentCount; ++openDocumentIndex) - { - const AZStd::string openDocumentPath = commandLine.GetMiscValue(openDocumentIndex); - - AZ_Printf(GetBuildTargetName().c_str(), "Opening document: %s", openDocumentPath.c_str()); - AtomToolsFramework::AtomToolsDocumentSystemRequestBus::Broadcast( - &AtomToolsFramework::AtomToolsDocumentSystemRequestBus::Events::OpenDocument, openDocumentPath); - } - - Base::ProcessCommandLine(commandLine); - } } // namespace ShaderManagementConsole diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/ShaderManagementConsoleApplication.h b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/ShaderManagementConsoleApplication.h index 6596429577..6b0365e6bd 100644 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/ShaderManagementConsoleApplication.h +++ b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/ShaderManagementConsoleApplication.h @@ -8,28 +8,25 @@ #pragma once -#include -#include +#include namespace ShaderManagementConsole { class ShaderManagementConsoleApplication - : public AtomToolsFramework::AtomToolsApplication + : public AtomToolsFramework::AtomToolsDocumentApplication { public: AZ_TYPE_INFO(ShaderManagementConsole::ShaderManagementConsoleApplication, "{A31B1AEB-4DA3-49CD-884A-CC998FF7546F}"); - using Base = AtomToolsFramework::AtomToolsApplication; + using Base = AtomToolsFramework::AtomToolsDocumentApplication; ShaderManagementConsoleApplication(int* argc, char*** argv); - ////////////////////////////////////////////////////////////////////////// - // AzFramework::Application + // AzFramework::Application overrides... void CreateStaticModules(AZStd::vector& outModules) override; const char* GetCurrentConfigurationName() const override; - private: - void ProcessCommandLine(const AZ::CommandLine& commandLine); + // AtomToolsFramework::AtomToolsApplication overrides... AZStd::string GetBuildTargetName() const override; AZStd::vector GetCriticalAssetFilters() const override; }; From c15d3f35bf37fb4fd5f49f33350d34557f1a9c49 Mon Sep 17 00:00:00 2001 From: carlitosan <82187351+carlitosan@users.noreply.github.com> Date: Fri, 14 Jan 2022 14:57:35 -0800 Subject: [PATCH 495/948] fix release build errors Signed-off-by: carlitosan <82187351+carlitosan@users.noreply.github.com> --- Gems/GraphModel/Code/Tests/MockGraphCanvas.cpp | 4 ++-- .../Source/AutomationActions/DynamicSlotFullCreation.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gems/GraphModel/Code/Tests/MockGraphCanvas.cpp b/Gems/GraphModel/Code/Tests/MockGraphCanvas.cpp index 525386a1a3..5face707c3 100644 --- a/Gems/GraphModel/Code/Tests/MockGraphCanvas.cpp +++ b/Gems/GraphModel/Code/Tests/MockGraphCanvas.cpp @@ -94,12 +94,12 @@ namespace MockGraphCanvasServices GraphCanvas::DataSlotRequestBus::Handler::BusDisconnect(); } - bool MockDataSlotComponent::ConvertToReference([[maybe_unused]] bool isNewSlot = false) + bool MockDataSlotComponent::ConvertToReference([[maybe_unused]] bool isNewSlot) { return false; } - bool MockDataSlotComponent::CanConvertToReference([[maybe_unused]] bool isNewSlot = false) const + bool MockDataSlotComponent::CanConvertToReference([[maybe_unused]] bool isNewSlot) const { return false; } diff --git a/Gems/ScriptCanvasDeveloper/Code/Editor/Source/AutomationActions/DynamicSlotFullCreation.cpp b/Gems/ScriptCanvasDeveloper/Code/Editor/Source/AutomationActions/DynamicSlotFullCreation.cpp index 090622646a..c71219cc8c 100644 --- a/Gems/ScriptCanvasDeveloper/Code/Editor/Source/AutomationActions/DynamicSlotFullCreation.cpp +++ b/Gems/ScriptCanvasDeveloper/Code/Editor/Source/AutomationActions/DynamicSlotFullCreation.cpp @@ -295,11 +295,11 @@ namespace ScriptCanvasDeveloperEditor GraphCanvas::Endpoint endpoint = ConvertToGraphCanvasEndpoint(slot->GetEndpoint()); bool canConvertToReference = false; - GraphCanvas::DataSlotRequestBus::EventResult(canConvertToReference, endpoint.GetSlotId(), &GraphCanvas::DataSlotRequests::CanConvertToReference); + GraphCanvas::DataSlotRequestBus::EventResult(canConvertToReference, endpoint.GetSlotId(), &GraphCanvas::DataSlotRequests::CanConvertToReference, false); if (canConvertToReference) { - GraphCanvas::DataSlotRequestBus::Event(endpoint.GetSlotId(), &GraphCanvas::DataSlotRequests::ConvertToReference); + GraphCanvas::DataSlotRequestBus::Event(endpoint.GetSlotId(), &GraphCanvas::DataSlotRequests::ConvertToReference, false); } } From 75a582972c7d2263dd4cac1ef684de12b7be575e Mon Sep 17 00:00:00 2001 From: Guthrie Adams Date: Fri, 14 Jan 2022 18:27:11 -0600 Subject: [PATCH 496/948] Atom Tools: added function to get the number of active documents Signed-off-by: Guthrie Adams --- .../Document/AtomToolsDocumentSystemRequestBus.h | 3 +++ .../Source/Document/AtomToolsDocumentSystemComponent.cpp | 6 ++++++ .../Code/Source/Document/AtomToolsDocumentSystemComponent.h | 1 + 3 files changed, 10 insertions(+) diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Document/AtomToolsDocumentSystemRequestBus.h b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Document/AtomToolsDocumentSystemRequestBus.h index f751915a9a..b12cf5e580 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Document/AtomToolsDocumentSystemRequestBus.h +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Document/AtomToolsDocumentSystemRequestBus.h @@ -71,6 +71,9 @@ namespace AtomToolsFramework //! Save all documents virtual bool SaveAllDocuments() = 0; + + //! Get number of allocated documents + virtual AZ::u32 GetDocumentCount() const = 0; }; using AtomToolsDocumentSystemRequestBus = AZ::EBus; diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocumentSystemComponent.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocumentSystemComponent.cpp index 3b27c9cd0f..d554c68451 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocumentSystemComponent.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocumentSystemComponent.cpp @@ -69,6 +69,7 @@ namespace AtomToolsFramework ->Event("SaveDocumentAsCopy", &AtomToolsDocumentSystemRequestBus::Events::SaveDocumentAsCopy) ->Event("SaveDocumentAsChild", &AtomToolsDocumentSystemRequestBus::Events::SaveDocumentAsChild) ->Event("SaveAllDocuments", &AtomToolsDocumentSystemRequestBus::Events::SaveAllDocuments) + ->Event("GetDocumentCount", &AtomToolsDocumentSystemRequestBus::Events::GetDocumentCount) ; behaviorContext->EBus("AtomToolsDocumentRequestBus") @@ -457,6 +458,11 @@ namespace AtomToolsFramework return result; } + AZ::u32 AtomToolsDocumentSystemComponent::GetDocumentCount() const + { + return aznumeric_cast(m_documentMap.size()); + } + AZ::Uuid AtomToolsDocumentSystemComponent::OpenDocumentImpl(AZStd::string_view sourcePath, bool checkIfAlreadyOpen) { AZStd::string requestedPath = sourcePath; diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocumentSystemComponent.h b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocumentSystemComponent.h index 532271974c..58470e3582 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocumentSystemComponent.h +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocumentSystemComponent.h @@ -74,6 +74,7 @@ namespace AtomToolsFramework bool SaveDocumentAsCopy(const AZ::Uuid& documentId, AZStd::string_view targetPath) override; bool SaveDocumentAsChild(const AZ::Uuid& documentId, AZStd::string_view targetPath) override; bool SaveAllDocuments() override; + AZ::u32 GetDocumentCount() const override; //////////////////////////////////////////////////////////////////////// AZ::Uuid OpenDocumentImpl(AZStd::string_view sourcePath, bool checkIfAlreadyOpen); From 1ef868437a67ec87057df8b87cedb16907df84ee Mon Sep 17 00:00:00 2001 From: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> Date: Fri, 14 Jan 2022 17:28:14 -0700 Subject: [PATCH 497/948] Added supervariantIndex check in Shader::OnShaderVariantAssetReady Signed-off-by: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> --- .../Include/Atom/RPI.Reflect/Shader/ShaderVariantAsset.h | 1 + Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader.cpp | 6 ++++++ .../Code/Source/RPI.Reflect/Shader/ShaderVariantAsset.cpp | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderVariantAsset.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderVariantAsset.h index 5146ae370a..b65d9837f7 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderVariantAsset.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderVariantAsset.h @@ -50,6 +50,7 @@ namespace AZ RPI::ShaderVariantStableId GetStableId() const { return m_stableId; } const ShaderVariantId& GetShaderVariantId() const { return m_shaderVariantId; } + uint32_t GetSupervariantIndex() const; //! Returns the shader stage function associated with the provided stage enum value. const RHI::ShaderStageFunction* GetShaderStageFunction(RHI::ShaderStage shaderStage) const; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader.cpp index 3830d8ee42..ed9d3430d9 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader.cpp @@ -253,6 +253,12 @@ namespace AZ AZ_Assert(shaderVariantAsset, "Reloaded ShaderVariantAsset is null"); const ShaderVariantStableId stableId = shaderVariantAsset->GetStableId(); + // check the supervariantIndex of the ShaderVariantAsset to make sure it matches the supervariantIndex of this shader instance + if (shaderVariantAsset->GetSupervariantIndex() != m_supervariantIndex.GetIndex()) + { + return; + } + // We make a copy of the updated variant because OnShaderVariantReinitialized must not be called inside // m_variantCacheMutex or deadlocks may occur. // Or if there is an error, we leave this object in its default state to indicate there was an error. diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderVariantAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderVariantAsset.cpp index ec1a65a6d5..f9f046ac8a 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderVariantAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderVariantAsset.cpp @@ -65,6 +65,11 @@ namespace AZ return m_buildTimestamp; } + uint32_t ShaderVariantAsset::GetSupervariantIndex() const + { + return (m_assetId.m_subId >> SupervariantIndexBitPosition) & SupervariantIndexMaxValue; + } + const RHI::ShaderStageFunction* ShaderVariantAsset::GetShaderStageFunction(RHI::ShaderStage shaderStage) const { return m_functionsByStage[static_cast(shaderStage)].get(); From 6ac1211ae92889e0d8c8c72a2bdc18df1c2bfd24 Mon Sep 17 00:00:00 2001 From: amzn-sj Date: Fri, 14 Jan 2022 16:40:08 -0800 Subject: [PATCH 498/948] Add unit tests for ProcessSurfaceWeightsFromRegion and ProcessSurfacePointsFromRegion. Signed-off-by: amzn-sj --- Gems/Terrain/Code/Tests/TerrainSystemTest.cpp | 164 ++++++++++++++++++ 1 file changed, 164 insertions(+) diff --git a/Gems/Terrain/Code/Tests/TerrainSystemTest.cpp b/Gems/Terrain/Code/Tests/TerrainSystemTest.cpp index a5798a3dad..2eebc1b824 100644 --- a/Gems/Terrain/Code/Tests/TerrainSystemTest.cpp +++ b/Gems/Terrain/Code/Tests/TerrainSystemTest.cpp @@ -902,4 +902,168 @@ namespace UnitTest terrainSystem->ProcessNormalsFromRegion(testRegionBox, stepSize, perPositionCallback, AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR); } + + TEST_F(TerrainSystemTest, TerrainProcessSurfaceWeightsFromRegion) + { + const AZ::Aabb spawnerBox = AZ::Aabb::CreateFromMinMaxValues(-10.0f, -10.0f, -5.0f, 10.0f, 10.0f, 15.0f); + auto entity = CreateAndActivateMockTerrainLayerSpawner( + spawnerBox, + [](AZ::Vector3& position, bool& terrainExists) + { + position.SetZ(1.0f); + terrainExists = true; + }); + + // Create and activate the terrain system with our testing defaults for world bounds, and a query resolution at 1 meter intervals. + const AZ::Vector2 queryResolution(1.0f); + auto terrainSystem = CreateAndActivateTerrainSystem(queryResolution); + + const AZ::Aabb testRegionBox = AZ::Aabb::CreateFromMinMaxValues(-3.0f, -3.0f, -1.0f, 3.0f, 3.0f, 1.0f); + const AZ::Vector2 stepSize(1.0f); + + const SurfaceData::SurfaceTag tag1 = SurfaceData::SurfaceTag("tag1"); + const SurfaceData::SurfaceTag tag2 = SurfaceData::SurfaceTag("tag2"); + const SurfaceData::SurfaceTag tag3 = SurfaceData::SurfaceTag("tag3"); + + AzFramework::SurfaceData::SurfaceTagWeight tagWeight1; + tagWeight1.m_surfaceType = tag1; + tagWeight1.m_weight = 1.0f; + + AzFramework::SurfaceData::SurfaceTagWeight tagWeight2; + tagWeight2.m_surfaceType = tag2; + tagWeight2.m_weight = 0.7f; + + AzFramework::SurfaceData::SurfaceTagWeight tagWeight3; + tagWeight3.m_surfaceType = tag3; + tagWeight3.m_weight = 0.3f; + + NiceMock mockSurfaceRequests(entity->GetId()); + ON_CALL(mockSurfaceRequests, GetSurfaceWeights).WillByDefault( + [&tagWeight1, &tagWeight2, &tagWeight3](const AZ::Vector3& position, AzFramework::SurfaceData::SurfaceTagWeightList& surfaceWeights) + { + surfaceWeights.clear(); + float absYPos = fabsf(position.GetY()); + if (absYPos < 1.0f) + { + surfaceWeights.push_back(tagWeight1); + } + else if(absYPos < 2.0f) + { + surfaceWeights.push_back(tagWeight2); + } + else + { + surfaceWeights.push_back(tagWeight3); + } + } + ); + + auto perPositionCallback = [&tagWeight1, &tagWeight2, &tagWeight3](size_t xIndex, size_t yIndex, + const AzFramework::SurfaceData::SurfacePoint& surfacePoint, [[maybe_unused]] bool terrainExists) + { + constexpr float epsilon = 0.0001f; + float absYPos = fabsf(surfacePoint.m_position.GetY()); + if (absYPos < 1.0f) + { + EXPECT_EQ(surfacePoint.m_surfaceTags[0].m_surfaceType, tagWeight1.m_surfaceType); + EXPECT_NEAR(surfacePoint.m_surfaceTags[0].m_weight, tagWeight1.m_weight, epsilon); + } + else if(absYPos < 2.0f) + { + EXPECT_EQ(surfacePoint.m_surfaceTags[0].m_surfaceType, tagWeight2.m_surfaceType); + EXPECT_NEAR(surfacePoint.m_surfaceTags[0].m_weight, tagWeight2.m_weight, epsilon); + } + else + { + EXPECT_EQ(surfacePoint.m_surfaceTags[0].m_surfaceType, tagWeight3.m_surfaceType); + EXPECT_NEAR(surfacePoint.m_surfaceTags[0].m_weight, tagWeight3.m_weight, epsilon); + } + }; + + terrainSystem->ProcessSurfaceWeightsFromRegion(testRegionBox, stepSize, perPositionCallback, AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR); + } + + TEST_F(TerrainSystemTest, TerrainProcessSurfacePointsFromRegion) + { + const AZ::Aabb spawnerBox = AZ::Aabb::CreateFromMinMaxValues(-10.0f, -10.0f, -5.0f, 10.0f, 10.0f, 15.0f); + auto entity = CreateAndActivateMockTerrainLayerSpawner( + spawnerBox, + [](AZ::Vector3& position, bool& terrainExists) + { + position.SetZ(position.GetX() + position.GetY()); + terrainExists = true; + }); + + // Create and activate the terrain system with our testing defaults for world bounds, and a query resolution at 1 meter intervals. + const AZ::Vector2 queryResolution(1.0f); + auto terrainSystem = CreateAndActivateTerrainSystem(queryResolution); + + const AZ::Aabb testRegionBox = AZ::Aabb::CreateFromMinMaxValues(-3.0f, -3.0f, -1.0f, 3.0f, 3.0f, 1.0f); + const AZ::Vector2 stepSize(1.0f); + + const SurfaceData::SurfaceTag tag1 = SurfaceData::SurfaceTag("tag1"); + const SurfaceData::SurfaceTag tag2 = SurfaceData::SurfaceTag("tag2"); + const SurfaceData::SurfaceTag tag3 = SurfaceData::SurfaceTag("tag3"); + + AzFramework::SurfaceData::SurfaceTagWeight tagWeight1; + tagWeight1.m_surfaceType = tag1; + tagWeight1.m_weight = 1.0f; + + AzFramework::SurfaceData::SurfaceTagWeight tagWeight2; + tagWeight2.m_surfaceType = tag2; + tagWeight2.m_weight = 0.7f; + + AzFramework::SurfaceData::SurfaceTagWeight tagWeight3; + tagWeight3.m_surfaceType = tag3; + tagWeight3.m_weight = 0.3f; + + NiceMock mockSurfaceRequests(entity->GetId()); + ON_CALL(mockSurfaceRequests, GetSurfaceWeights).WillByDefault( + [&tagWeight1, &tagWeight2, &tagWeight3](const AZ::Vector3& position, AzFramework::SurfaceData::SurfaceTagWeightList& surfaceWeights) + { + surfaceWeights.clear(); + float absYPos = fabsf(position.GetY()); + if (absYPos < 1.0f) + { + surfaceWeights.push_back(tagWeight1); + } + else if(absYPos < 2.0f) + { + surfaceWeights.push_back(tagWeight2); + } + else + { + surfaceWeights.push_back(tagWeight3); + } + } + ); + + auto perPositionCallback = [&tagWeight1, &tagWeight2, &tagWeight3](size_t xIndex, size_t yIndex, + const AzFramework::SurfaceData::SurfacePoint& surfacePoint, [[maybe_unused]] bool terrainExists) + { + constexpr float epsilon = 0.0001f; + float expectedHeight = surfacePoint.m_position.GetX() + surfacePoint.m_position.GetY(); + + EXPECT_NEAR(surfacePoint.m_position.GetZ(), expectedHeight, epsilon); + + float absYPos = fabsf(surfacePoint.m_position.GetY()); + if (absYPos < 1.0f) + { + EXPECT_EQ(surfacePoint.m_surfaceTags[0].m_surfaceType, tagWeight1.m_surfaceType); + EXPECT_NEAR(surfacePoint.m_surfaceTags[0].m_weight, tagWeight1.m_weight, epsilon); + } + else if(absYPos < 2.0f) + { + EXPECT_EQ(surfacePoint.m_surfaceTags[0].m_surfaceType, tagWeight2.m_surfaceType); + EXPECT_NEAR(surfacePoint.m_surfaceTags[0].m_weight, tagWeight2.m_weight, epsilon); + } + else + { + EXPECT_EQ(surfacePoint.m_surfaceTags[0].m_surfaceType, tagWeight3.m_surfaceType); + EXPECT_NEAR(surfacePoint.m_surfaceTags[0].m_weight, tagWeight3.m_weight, epsilon); + } + }; + + terrainSystem->ProcessSurfacePointsFromRegion(testRegionBox, stepSize, perPositionCallback, AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT); + } } // namespace UnitTest From b87e6896e6784e35220365f9441313c3c4304a8b Mon Sep 17 00:00:00 2001 From: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com> Date: Fri, 14 Jan 2022 16:43:01 -0800 Subject: [PATCH 499/948] ScreenToWorld and WorldToScreen Camera functionality (#6903) Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com> --- .../AzFramework/Components/CameraBus.h | 26 ++++ .../Component/DebugCamera/CameraComponent.h | 4 + .../Code/Source/CameraComponent.cpp | 26 +++- Gems/Camera/Code/Source/CameraComponent.cpp | 4 + .../Code/Source/CameraComponentController.cpp | 63 ++++++++ .../Code/Source/CameraComponentController.h | 7 + .../EBus/Senders/CameraRequestBus.names | 134 +++++++++++++++++- ...hysXWorld_RayCastFromScreenWithGroup.names | 88 ++++++++++++ .../Code/Source/WorldNodes.h | 39 +++++ 9 files changed, 389 insertions(+), 2 deletions(-) create mode 100644 Gems/ScriptCanvas/Assets/TranslationAssets/Nodes/PhysXWorld_RayCastFromScreenWithGroup.names diff --git a/Code/Framework/AzFramework/AzFramework/Components/CameraBus.h b/Code/Framework/AzFramework/AzFramework/Components/CameraBus.h index e20578e939..964bf664a0 100644 --- a/Code/Framework/AzFramework/AzFramework/Components/CameraBus.h +++ b/Code/Framework/AzFramework/AzFramework/Components/CameraBus.h @@ -129,6 +129,32 @@ namespace Camera GetFrustumHeight() }; } + + //! Unprojects a position in screen space pixel coordinates to world space. + //! With a depth of zero, the position returned will be on the near clip plane of the camera + //! in world space. + //! @param screenPosition The absolute screen position + //! @param depth The depth offset into the world relative to the near clip plane of the camera + //! @return the position in world space + virtual AZ::Vector3 ScreenToWorld(const AZ::Vector2& screenPosition, float depth) = 0; + + //! Unprojects a position in screen space normalized device coordinates to world space. + //! With a depth of zero, the position returned will be on the near clip plane of the camera + //! in world space. + //! @param screenNdcPosition The normalized device coordinates in the range [0,1] + //! @param depth The depth offset into the world relative to the near clip plane of the camera + //! @return the position in world space + virtual AZ::Vector3 ScreenNdcToWorld(const AZ::Vector2& screenNdcPosition, float depth) = 0; + + //! Projects a position in world space to screen space for the given camera. + //! @param worldPosition The world position + //! @return The absolute screen position + virtual AZ::Vector2 WorldToScreen(const AZ::Vector3& worldPosition) = 0; + + //! Projects a position in world space to screen space normalized device coordinates. + //! @param worldPosition The world position + //! @return The normalized device coordinates in the range [0,1] + virtual AZ::Vector2 WorldToScreenNdc(const AZ::Vector3& worldPosition) = 0; }; using CameraRequestBus = AZ::EBus; diff --git a/Gems/Atom/Component/DebugCamera/Code/Include/Atom/Component/DebugCamera/CameraComponent.h b/Gems/Atom/Component/DebugCamera/Code/Include/Atom/Component/DebugCamera/CameraComponent.h index fb9c543bca..47254bcdc5 100644 --- a/Gems/Atom/Component/DebugCamera/Code/Include/Atom/Component/DebugCamera/CameraComponent.h +++ b/Gems/Atom/Component/DebugCamera/Code/Include/Atom/Component/DebugCamera/CameraComponent.h @@ -104,6 +104,10 @@ namespace AZ void SetOrthographicHalfWidth(float halfWidth) override; void MakeActiveView() override; bool IsActiveView() override; + AZ::Vector3 ScreenToWorld(const AZ::Vector2& screenPosition, float depth) override; + AZ::Vector3 ScreenNdcToWorld(const AZ::Vector2& screenPosition, float depth) override; + AZ::Vector2 WorldToScreen(const AZ::Vector3& worldPosition) override; + AZ::Vector2 WorldToScreenNdc(const AZ::Vector3& worldPosition) override; // RPI::WindowContextNotificationBus overrides... void OnViewportResized(uint32_t width, uint32_t height) override; diff --git a/Gems/Atom/Component/DebugCamera/Code/Source/CameraComponent.cpp b/Gems/Atom/Component/DebugCamera/Code/Source/CameraComponent.cpp index f3123e2b38..c4420dc417 100644 --- a/Gems/Atom/Component/DebugCamera/Code/Source/CameraComponent.cpp +++ b/Gems/Atom/Component/DebugCamera/Code/Source/CameraComponent.cpp @@ -245,7 +245,7 @@ namespace AZ AZ_Assert(false, "DebugCamera does not support orthographic projection"); } - void CameraComponent::MakeActiveView() + void CameraComponent::MakeActiveView() { // do nothing } @@ -255,6 +255,30 @@ namespace AZ return false; } + AZ::Vector3 CameraComponent::ScreenToWorld([[maybe_unused]] const AZ::Vector2& screenPosition, [[maybe_unused]] float depth) + { + // not implemented + return AZ::Vector3::CreateZero(); + } + + AZ::Vector3 CameraComponent::ScreenNdcToWorld([[maybe_unused]] const AZ::Vector2& screenPosition, [[maybe_unused]] float depth) + { + // not implemented + return AZ::Vector3::CreateZero(); + } + + AZ::Vector2 CameraComponent::WorldToScreen([[maybe_unused]] const AZ::Vector3& worldPosition) + { + // not implemented + return AZ::Vector2::CreateZero(); + } + + AZ::Vector2 CameraComponent::WorldToScreenNdc([[maybe_unused]] const AZ::Vector3& worldPosition) + { + // not implemented + return AZ::Vector2::CreateZero(); + } + void CameraComponent::OnViewportResized(uint32_t width, uint32_t height) { AZ_UNUSED(width); diff --git a/Gems/Camera/Code/Source/CameraComponent.cpp b/Gems/Camera/Code/Source/CameraComponent.cpp index 960f13a082..290691bbbe 100644 --- a/Gems/Camera/Code/Source/CameraComponent.cpp +++ b/Gems/Camera/Code/Source/CameraComponent.cpp @@ -106,6 +106,10 @@ namespace Camera ->Event("SetOrthographic", &CameraRequestBus::Events::SetOrthographic) ->Event("GetOrthographicHalfWidth", &CameraRequestBus::Events::GetOrthographicHalfWidth) ->Event("SetOrthographicHalfWidth", &CameraRequestBus::Events::SetOrthographicHalfWidth) + ->Event("ScreenToWorld", &CameraRequestBus::Events::ScreenToWorld) + ->Event("ScreenNdcToWorld", &CameraRequestBus::Events::ScreenNdcToWorld) + ->Event("WorldToScreen", &CameraRequestBus::Events::WorldToScreen) + ->Event("WorldToScreenNdc", &CameraRequestBus::Events::WorldToScreenNdc) ->VirtualProperty("FieldOfView","GetFovDegrees","SetFovDegrees") ->VirtualProperty("NearClipDistance", "GetNearClipDistance", "SetNearClipDistance") ->VirtualProperty("FarClipDistance", "GetFarClipDistance", "SetFarClipDistance") diff --git a/Gems/Camera/Code/Source/CameraComponentController.cpp b/Gems/Camera/Code/Source/CameraComponentController.cpp index 5b2e26b897..dfb2810fe2 100644 --- a/Gems/Camera/Code/Source/CameraComponentController.cpp +++ b/Gems/Camera/Code/Source/CameraComponentController.cpp @@ -10,12 +10,15 @@ #include "CameraViewRegistrationBus.h" #include +#include #include #include #include #include +#include + namespace Camera { void CameraComponentConfig::Reflect(AZ::ReflectContext* context) @@ -412,6 +415,66 @@ namespace Camera return m_isActiveView; } + namespace Util + { + AZ::Vector3 GetWorldPosition(const AZ::Vector3& origin, float depth, const AzFramework::CameraState& cameraState) + { + if (depth == 0.f) + { + return origin; + } + else + { + const AZ::Vector3 rayDirection = cameraState.m_orthographic ? cameraState.m_forward : (origin - cameraState.m_position); + return origin + (rayDirection.GetNormalized() * depth); + } + } + } + + AZ::Vector3 CameraComponentController::ScreenToWorld(const AZ::Vector2& screenPosition, float depth) + { + const AzFramework::ScreenPoint point{ static_cast(screenPosition.GetX()), static_cast(screenPosition.GetY()) }; + const AzFramework::CameraState& cameraState = GetCameraState(); + const AZ::Vector3 origin = AzFramework::ScreenToWorld(point, cameraState); + return Util::GetWorldPosition(origin, depth, cameraState); + } + + AZ::Vector3 CameraComponentController::ScreenNdcToWorld(const AZ::Vector2& screenNdcPosition, float depth) + { + const AzFramework::CameraState& cameraState = GetCameraState(); + const AZ::Vector3 origin = AzFramework::ScreenNdcToWorld(screenNdcPosition, AzFramework::InverseCameraView(cameraState), AzFramework::InverseCameraProjection(cameraState)); + return Util::GetWorldPosition(origin, depth, cameraState); + } + + AZ::Vector2 CameraComponentController::WorldToScreenNdc(const AZ::Vector3& worldPosition) + { + const AzFramework::CameraState& cameraState = GetCameraState(); + const AZ::Vector3 screenPosition = AzFramework::WorldToScreenNdc(worldPosition, AzFramework::CameraView(cameraState), AzFramework::CameraProjection(cameraState)); + return AZ::Vector3ToVector2(screenPosition); + } + + AZ::Vector2 CameraComponentController::WorldToScreen(const AZ::Vector3& worldPosition) + { + const AzFramework::ScreenPoint& point = AzFramework::WorldToScreen(worldPosition, GetCameraState()); + return AZ::Vector2(static_cast(point.m_x), static_cast(point.m_y)); + } + + AzFramework::CameraState CameraComponentController::GetCameraState() + { + auto viewportContext = GetViewportContext(); + if (!m_atomCamera || ! viewportContext) + { + return AzFramework::CameraState(); + } + + auto windowSize = viewportContext->GetViewportSize(); + auto viewportSize = AzFramework::Vector2FromScreenSize(AzFramework::ScreenSize(windowSize.m_width, windowSize.m_height)); + + AzFramework::CameraState cameraState = AzFramework::CreateDefaultCamera(m_atomCamera->GetCameraTransform(), viewportSize); + AzFramework::SetCameraClippingVolumeFromPerspectiveFovMatrixRH(cameraState, m_atomCamera->GetViewToClipMatrix()); + return cameraState; + } + void CameraComponentController::OnTransformChanged([[maybe_unused]] const AZ::Transform& local, const AZ::Transform& world) { if (m_updatingTransformFromEntity) diff --git a/Gems/Camera/Code/Source/CameraComponentController.h b/Gems/Camera/Code/Source/CameraComponentController.h index 09af7529dc..265ffaa0e9 100644 --- a/Gems/Camera/Code/Source/CameraComponentController.h +++ b/Gems/Camera/Code/Source/CameraComponentController.h @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -110,6 +111,11 @@ namespace Camera void MakeActiveView() override; bool IsActiveView() override; + AZ::Vector3 ScreenToWorld(const AZ::Vector2& screenPosition, float depth) override; + AZ::Vector3 ScreenNdcToWorld(const AZ::Vector2& screenNdcPosition, float depth) override; + AZ::Vector2 WorldToScreen(const AZ::Vector3& worldPosition) override; + AZ::Vector2 WorldToScreenNdc(const AZ::Vector3& worldPosition) override; + // AZ::TransformNotificationBus::Handler interface void OnTransformChanged(const AZ::Transform& local, const AZ::Transform& world) override; @@ -127,6 +133,7 @@ namespace Camera void DeactivateAtomView(); void UpdateCamera(); void SetupAtomAuxGeom(AZ::RPI::ViewportContextPtr viewportContext); + AzFramework::CameraState GetCameraState(); CameraComponentConfig m_config; AZ::EntityId m_entityId; diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/EBus/Senders/CameraRequestBus.names b/Gems/ScriptCanvas/Assets/TranslationAssets/EBus/Senders/CameraRequestBus.names index 6c0112bfc2..ad2127c2a1 100644 --- a/Gems/ScriptCanvas/Assets/TranslationAssets/EBus/Senders/CameraRequestBus.names +++ b/Gems/ScriptCanvas/Assets/TranslationAssets/EBus/Senders/CameraRequestBus.names @@ -31,6 +31,66 @@ } ] }, + { + "base": "WorldToScreen", + "entry": { + "name": "In", + "tooltip": "When signaled, this will invoke World To Screen" + }, + "exit": { + "name": "Out", + "tooltip": "Signaled after World To Screen is invoked" + }, + "details": { + "name": "World To Screen" + }, + "params": [ + { + "typeid": "{8379EB7D-01FA-4538-B64B-A6543B4BE73D}", + "details": { + "name": "World Position" + } + } + ], + "results": [ + { + "typeid": "{3D80F623-C85C-4741-90D0-E4E66164E6BF}", + "details": { + "name": "Screen Position" + } + } + ] + }, + { + "base": "WorldToScreenNdc", + "entry": { + "name": "In", + "tooltip": "When signaled, this will invoke World To Screen Ndc" + }, + "exit": { + "name": "Out", + "tooltip": "Signaled after World To Screen Ndc is invoked" + }, + "details": { + "name": "World To Screen NDC" + }, + "params": [ + { + "typeid": "{8379EB7D-01FA-4538-B64B-A6543B4BE73D}", + "details": { + "name": "World Position" + } + } + ], + "results": [ + { + "typeid": "{3D80F623-C85C-4741-90D0-E4E66164E6BF}", + "details": { + "name": "Screen NDC Position" + } + } + ] + }, { "base": "GetFov", "entry": { @@ -53,6 +113,78 @@ } ] }, + { + "base": "ScreenToWorld", + "entry": { + "name": "In", + "tooltip": "When signaled, this will invoke Screen To World" + }, + "exit": { + "name": "Out", + "tooltip": "Signaled after Screen To World is invoked" + }, + "details": { + "name": "Screen To World" + }, + "params": [ + { + "typeid": "{3D80F623-C85C-4741-90D0-E4E66164E6BF}", + "details": { + "name": "Screen Position" + } + }, + { + "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", + "details": { + "name": "Depth" + } + } + ], + "results": [ + { + "typeid": "{8379EB7D-01FA-4538-B64B-A6543B4BE73D}", + "details": { + "name": "World Position" + } + } + ] + }, + { + "base": "ScreenNdcToWorld", + "entry": { + "name": "In", + "tooltip": "When signaled, this will invoke Screen Ndc To World" + }, + "exit": { + "name": "Out", + "tooltip": "Signaled after Screen Ndc To World is invoked" + }, + "details": { + "name": "Screen NDC To World" + }, + "params": [ + { + "typeid": "{3D80F623-C85C-4741-90D0-E4E66164E6BF}", + "details": { + "name": "Screen NDC Position" + } + }, + { + "typeid": "{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}", + "details": { + "name": "Depth" + } + } + ], + "results": [ + { + "typeid": "{8379EB7D-01FA-4538-B64B-A6543B4BE73D}", + "details": { + "name": "World Position" + } + } + ] + }, { "base": "SetFovRadians", "entry": { @@ -356,4 +488,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/Gems/ScriptCanvas/Assets/TranslationAssets/Nodes/PhysXWorld_RayCastFromScreenWithGroup.names b/Gems/ScriptCanvas/Assets/TranslationAssets/Nodes/PhysXWorld_RayCastFromScreenWithGroup.names new file mode 100644 index 0000000000..447866ae44 --- /dev/null +++ b/Gems/ScriptCanvas/Assets/TranslationAssets/Nodes/PhysXWorld_RayCastFromScreenWithGroup.names @@ -0,0 +1,88 @@ +{ + "entries": [ + { + "base": "{B164D87F-6620-5A1D-A2BC-CC09BA18C9B1}", + "context": "ScriptCanvas::Node", + "variant": "", + "details": { + "name": "Ray Cast From Screen With Group", + "category": "PhysX/World", + "tooltip": "Returns the first entity hit by a ray cast from the provided absolute 2D screen position." + }, + "slots": [ + { + "base": "Input_In_0", + "details": { + "name": "In" + } + }, + { + "base": "Output_Out_0", + "details": { + "name": "Out" + } + }, + { + "base": "DataInput_Screen Position_0", + "details": { + "name": "Screen Position" + } + }, + { + "base": "DataInput_Distance_1", + "details": { + "name": "Distance" + } + }, + { + "base": "DataInput_Collision group_2", + "details": { + "name": "Collision group" + } + }, + { + "base": "DataInput_Ignore_3", + "details": { + "name": "Ignore" + } + }, + { + "base": "DataOutput_Object hit_0", + "details": { + "name": "Object hit" + } + }, + { + "base": "DataOutput_Position_1", + "details": { + "name": "Position" + } + }, + { + "base": "DataOutput_Normal_2", + "details": { + "name": "Normal" + } + }, + { + "base": "DataOutput_Distance_3", + "details": { + "name": "Distance" + } + }, + { + "base": "DataOutput_EntityId_4", + "details": { + "name": "EntityId" + } + }, + { + "base": "DataOutput_Surface_5", + "details": { + "name": "Surface" + } + } + ] + } + ] +} \ No newline at end of file diff --git a/Gems/ScriptCanvasPhysics/Code/Source/WorldNodes.h b/Gems/ScriptCanvasPhysics/Code/Source/WorldNodes.h index 96a15a9d29..1b03bd1851 100644 --- a/Gems/ScriptCanvasPhysics/Code/Source/WorldNodes.h +++ b/Gems/ScriptCanvasPhysics/Code/Source/WorldNodes.h @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -120,6 +121,43 @@ namespace ScriptCanvasPhysics "EntityId", "Surface"); + AZ_INLINE Result RayCastFromScreenWithGroup( + const AZ::Vector2& screenPosition, + float distance, + const AZStd::string& collisionGroup, + AZ::EntityId ignore) + { + AZ::EntityId camera; + Camera::CameraSystemRequestBus::BroadcastResult(camera, &Camera::CameraSystemRequestBus::Events::GetActiveCamera); + if (camera.IsValid()) + { + AZ::Vector3 origin = AZ::Vector3::CreateZero(); + Camera::CameraRequestBus::EventResult(origin, camera, &Camera::CameraRequestBus::Events::ScreenToWorld, screenPosition, 0.f); + AZ::Vector3 offset = AZ::Vector3::CreateZero(); + Camera::CameraRequestBus::EventResult(offset, camera, &Camera::CameraRequestBus::Events::ScreenToWorld, screenPosition, 1.f); + const AZ::Vector3 direction = (offset - origin).GetNormalized(); + return RayCastWorldSpaceWithGroup(origin, direction, distance, collisionGroup, ignore); + } + + // fallback in the rare case there is no active camera + return AZStd::make_tuple(false, AZ::Vector3::CreateZero(), AZ::Vector3::CreateZero(), 0.0f, AZ::EntityId(), AZ::Crc32()); + } + + SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(RayCastFromScreenWithGroup, + k_categoryName, + "{8F98A766-A93F-4DA7-B281-482C3DB20649}", + "Returns the first entity hit by a ray cast from the provided absolute 2D screen position.", + "Screen Position", + "Distance", + "Collision group", + "Ignore", + "Object hit", + "Position", + "Normal", + "Distance", + "EntityId", + "Surface"); + AZ_INLINE Result RayCastLocalSpaceWithGroup(const AZ::EntityId& fromEntityId, const AZ::Vector3& direction, float distance, @@ -389,6 +427,7 @@ namespace ScriptCanvasPhysics Date: Fri, 14 Jan 2022 16:59:26 -0800 Subject: [PATCH 500/948] Update TerrainPhysicsColliderTests to add mocks for the ProcessRegion functions since the TerrainPhysicsColliderComponent now uses the ProcessRegion functions Signed-off-by: amzn-sj --- .../Tests/TerrainPhysicsColliderTests.cpp | 96 ++++++++++++++++--- 1 file changed, 84 insertions(+), 12 deletions(-) diff --git a/Gems/Terrain/Code/Tests/TerrainPhysicsColliderTests.cpp b/Gems/Terrain/Code/Tests/TerrainPhysicsColliderTests.cpp index 340acfbaac..859e618983 100644 --- a/Gems/Terrain/Code/Tests/TerrainPhysicsColliderTests.cpp +++ b/Gems/Terrain/Code/Tests/TerrainPhysicsColliderTests.cpp @@ -238,6 +238,33 @@ TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderGetHeightsRetu AZ::Vector2 mockHeightResolution = AZ::Vector2(1.0f); NiceMock terrainListener; ON_CALL(terrainListener, GetTerrainHeightQueryResolution).WillByDefault(Return(mockHeightResolution)); + ON_CALL(terrainListener, ProcessHeightsFromRegion).WillByDefault( + [](const AZ::Aabb& inRegion, const AZ::Vector2& stepSize, + AzFramework::Terrain::SurfacePointRegionFillCallback perPositionCallback, + AzFramework::Terrain::TerrainDataRequests::Sampler sampleFilter) + { + if (!perPositionCallback) + { + return; + } + + const size_t numSamplesX = aznumeric_cast(ceil(inRegion.GetExtents().GetX() / stepSize.GetX())); + const size_t numSamplesY = aznumeric_cast(ceil(inRegion.GetExtents().GetY() / stepSize.GetY())); + + AzFramework::SurfaceData::SurfacePoint surfacePoint; + for (size_t y = 0; y < numSamplesY; y++) + { + float fy = aznumeric_cast(inRegion.GetMin().GetY() + (y * stepSize.GetY())); + for (size_t x = 0; x < numSamplesX; x++) + { + bool terrainExists = false; + float fx = aznumeric_cast(inRegion.GetMin().GetX() + (x * stepSize.GetX())); + surfacePoint.m_position.Set(fx, fy, 0.0f); + perPositionCallback(x, y, surfacePoint, terrainExists); + } + } + } + ); int32_t cols, rows; Physics::HeightfieldProviderRequestsBus::Event( @@ -271,8 +298,34 @@ TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderReturnsRelativ AZ::Vector2 mockHeightResolution = AZ::Vector2(1.0f); NiceMock terrainListener; - ON_CALL(terrainListener, GetHeightFromFloats).WillByDefault(Return(mockHeight)); ON_CALL(terrainListener, GetTerrainHeightQueryResolution).WillByDefault(Return(mockHeightResolution)); + ON_CALL(terrainListener, ProcessHeightsFromRegion).WillByDefault( + [mockHeight](const AZ::Aabb& inRegion, const AZ::Vector2& stepSize, + AzFramework::Terrain::SurfacePointRegionFillCallback perPositionCallback, + AzFramework::Terrain::TerrainDataRequests::Sampler sampleFilter) + { + if (!perPositionCallback) + { + return; + } + + const size_t numSamplesX = aznumeric_cast(ceil(inRegion.GetExtents().GetX() / stepSize.GetX())); + const size_t numSamplesY = aznumeric_cast(ceil(inRegion.GetExtents().GetY() / stepSize.GetY())); + + AzFramework::SurfaceData::SurfacePoint surfacePoint; + for (size_t y = 0; y < numSamplesY; y++) + { + float fy = aznumeric_cast(inRegion.GetMin().GetY() + (y * stepSize.GetY())); + for (size_t x = 0; x < numSamplesX; x++) + { + bool terrainExists = false; + float fx = aznumeric_cast(inRegion.GetMin().GetX() + (x * stepSize.GetX())); + surfacePoint.m_position.Set(fx, fy, mockHeight); + perPositionCallback(x, y, surfacePoint, terrainExists); + } + } + } + ); // Just return the bounds as setup. This is equivalent to the box being at the origin. NiceMock boxShape(m_entity->GetId()); @@ -416,20 +469,39 @@ TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderGetHeightsAndM NiceMock terrainListener; ON_CALL(terrainListener, GetTerrainHeightQueryResolution).WillByDefault(Return(mockHeightResolution)); - ON_CALL(terrainListener, GetHeightFromFloats).WillByDefault(Return(mockHeight)); - ON_CALL(terrainListener, GetMaxSurfaceWeightFromFloats) - .WillByDefault( - [return1, return2]( - [[maybe_unused]] float x, [[maybe_unused]] float y, - [[maybe_unused]] AzFramework::Terrain::TerrainDataRequests::Sampler sampleFilter, [[maybe_unused]] bool* terrainExistsPtr) + ON_CALL(terrainListener, ProcessSurfacePointsFromRegion).WillByDefault( + [mockHeight, return1, return2](const AZ::Aabb& inRegion, const AZ::Vector2& stepSize, + AzFramework::Terrain::SurfacePointRegionFillCallback perPositionCallback, + AzFramework::Terrain::TerrainDataRequests::Sampler sampleFilter) + { + if (!perPositionCallback) + { + return; + } + + const size_t numSamplesX = aznumeric_cast(ceil(inRegion.GetExtents().GetX() / stepSize.GetX())); + const size_t numSamplesY = aznumeric_cast(ceil(inRegion.GetExtents().GetY() / stepSize.GetY())); + + AzFramework::SurfaceData::SurfacePoint surfacePoint; + for (size_t y = 0; y < numSamplesY; y++) { - // return tag1 for the first half of the rows, tag2 for the rest. - if (y < 128.0) + float fy = aznumeric_cast(inRegion.GetMin().GetY() + (y * stepSize.GetY())); + for (size_t x = 0; x < numSamplesX; x++) { - return return1; + surfacePoint.m_surfaceTags.clear(); + bool terrainExists = false; + float fx = aznumeric_cast(inRegion.GetMin().GetX() + (x * stepSize.GetX())); + surfacePoint.m_position.Set(fx, fy, mockHeight); + if (fy < 128.0) + { + surfacePoint.m_surfaceTags.push_back(return1); + } + surfacePoint.m_surfaceTags.push_back(return2); + perPositionCallback(x, y, surfacePoint, terrainExists); } - return return2; - }); + } + } + ); AZStd::vector heightsAndMaterials; From 76ff7aec29ad67f11f0dc84e47702cc8757dcdd2 Mon Sep 17 00:00:00 2001 From: amzn-sj Date: Fri, 14 Jan 2022 17:41:18 -0800 Subject: [PATCH 501/948] Fix type (#6919) Signed-off-by: amzn-sj --- cmake/Platform/Mac/runtime_dependencies_mac.cmake.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in b/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in index c27bf1fde4..fff816cb3e 100644 --- a/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in +++ b/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in @@ -216,7 +216,7 @@ if(@target_file_dir@ MATCHES ".app/Contents/MacOS") # fixup bundle ends up removing the rpath of dxc (despite we exclude it) if(EXISTS "${bundle_path}/Contents/MacOS/Builders/DirectXShaderCompiler/bin/dxc-3.7") - execute_process(COMMAND $"{LY_INSTALL_NAME_TOOL}" -add_rpath @executable_path/../lib ${bundle_path}/Contents/MacOS/Builders/DirectXShaderCompiler/bin/dxc-3.7) + execute_process(COMMAND "${LY_INSTALL_NAME_TOOL}" -add_rpath @executable_path/../lib ${bundle_path}/Contents/MacOS/Builders/DirectXShaderCompiler/bin/dxc-3.7) endif() # misplaced .DS_Store files can cause signing to fail From 646443cfe56c2dde2d466aa8bc38743fa09c506b Mon Sep 17 00:00:00 2001 From: Roddie Kieley Date: Sat, 15 Jan 2022 14:15:27 -0330 Subject: [PATCH 502/948] issue5299: Resolved via change to not disable custom window decorations. Signed-off-by: Roddie Kieley --- .../Platform/Linux/source/utils/GUIApplicationManager_Linux.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Tools/AssetBundler/Platform/Linux/source/utils/GUIApplicationManager_Linux.cpp b/Code/Tools/AssetBundler/Platform/Linux/source/utils/GUIApplicationManager_Linux.cpp index 04f579cc66..5c2ac13d0e 100644 --- a/Code/Tools/AssetBundler/Platform/Linux/source/utils/GUIApplicationManager_Linux.cpp +++ b/Code/Tools/AssetBundler/Platform/Linux/source/utils/GUIApplicationManager_Linux.cpp @@ -12,6 +12,6 @@ namespace Platform { AzQtComponents::WindowDecorationWrapper::Option GetWindowDecorationWrapperOption() { - return AzQtComponents::WindowDecorationWrapper::OptionDisabled; + return AzQtComponents::WindowDecorationWrapper::OptionNone; } } \ No newline at end of file From f05ca0897e0a180123ebb172a5d7bf23ad8eeda1 Mon Sep 17 00:00:00 2001 From: amzn-sj Date: Sat, 15 Jan 2022 14:26:58 -0800 Subject: [PATCH 503/948] Fix some warnings and remove an unused function parameter Signed-off-by: amzn-sj --- .../Source/Components/TerrainPhysicsColliderComponent.cpp | 2 +- .../Source/Components/TerrainWorldDebuggerComponent.cpp | 6 +++--- .../Code/Source/Components/TerrainWorldDebuggerComponent.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp b/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp index 4a8b4680b3..c74a478dad 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp +++ b/Gems/Terrain/Code/Source/Components/TerrainPhysicsColliderComponent.cpp @@ -344,7 +344,7 @@ namespace Terrain AZStd::vector materialList = GetMaterialList(); auto perPositionCallback = [&heightMaterials, &materialList, this, worldCenterZ, worldHeightBoundsMin, worldHeightBoundsMax] - (size_t xIndex, size_t yIndex, const AzFramework::SurfaceData::SurfacePoint& surfacePoint, bool terrainExists) + ([[maybe_unused]] size_t xIndex, [[maybe_unused]] size_t yIndex, const AzFramework::SurfaceData::SurfacePoint& surfacePoint, bool terrainExists) { float height = surfacePoint.m_position.GetZ(); diff --git a/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.cpp b/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.cpp index 46be621307..f684727d33 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.cpp +++ b/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.cpp @@ -297,7 +297,7 @@ namespace Terrain { if (sector.m_isDirty) { - RebuildSectorWireframe(sector, heightDataResolution, worldMinZ); + RebuildSectorWireframe(sector, heightDataResolution); } if (!sector.m_lineVertices.empty()) @@ -317,7 +317,7 @@ namespace Terrain } - void TerrainWorldDebuggerComponent::RebuildSectorWireframe(WireframeSector& sector, const AZ::Vector2& gridResolution, float worldMinZ) + void TerrainWorldDebuggerComponent::RebuildSectorWireframe(WireframeSector& sector, const AZ::Vector2& gridResolution) { if (!sector.m_isDirty) { @@ -354,7 +354,7 @@ namespace Terrain // For each terrain height value in the region, create the _| grid lines for that point and cache off the height value // for use with subsequent grid line calculations. auto ProcessHeightValue = [gridResolution, &previousHeight, &rowHeights, §or] - (uint32_t xIndex, uint32_t yIndex, const AzFramework::SurfaceData::SurfacePoint& surfacePoint, [[maybe_unused]] bool terrainExists) + (size_t xIndex, size_t yIndex, const AzFramework::SurfaceData::SurfacePoint& surfacePoint, [[maybe_unused]] bool terrainExists) { // Don't add any vertices for the first column or first row. These grid lines will be handled by an adjacent sector, if // there is one. diff --git a/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.h b/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.h index f3bcead8c3..cb308effe6 100644 --- a/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.h +++ b/Gems/Terrain/Code/Source/Components/TerrainWorldDebuggerComponent.h @@ -93,7 +93,7 @@ namespace Terrain bool m_isDirty{ true }; }; - void RebuildSectorWireframe(WireframeSector& sector, const AZ::Vector2& gridResolution, float worldMinZ); + void RebuildSectorWireframe(WireframeSector& sector, const AZ::Vector2& gridResolution); void MarkDirtySectors(const AZ::Aabb& dirtyRegion); void DrawWorldBounds(AzFramework::DebugDisplayRequests& debugDisplay); void DrawWireframe(const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay); From ced7d1ef542f1e1fe58c7c0577151db7aea0461e Mon Sep 17 00:00:00 2001 From: Guthrie Adams Date: Mon, 17 Jan 2022 01:29:23 -0600 Subject: [PATCH 504/948] Atom Tools: Bind exit function for python tests Signed-off-by: Guthrie Adams --- .../Application/AtomToolsApplication.h | 1 + .../Code/Source/Application/AtomToolsApplication.cpp | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Application/AtomToolsApplication.h b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Application/AtomToolsApplication.h index 9eaacbfa4f..35d8302b49 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Application/AtomToolsApplication.h +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Application/AtomToolsApplication.h @@ -111,6 +111,7 @@ namespace AtomToolsFramework virtual void ProcessCommandLine(const AZ::CommandLine& commandLine); static void PyIdleWaitFrames(uint32_t frames); + static void PyExit(); AzToolsFramework::TraceLogger m_traceLogger; diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Application/AtomToolsApplication.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Application/AtomToolsApplication.cpp index 02248fffd4..5d17e758f9 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Application/AtomToolsApplication.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Application/AtomToolsApplication.cpp @@ -130,10 +130,13 @@ namespace AtomToolsFramework ->Attribute(AZ::Script::Attributes::Category, "Editor") ->Attribute(AZ::Script::Attributes::Module, "atomtools.general"); }; - // The reflection here is based on patterns in CryEditPythonHandler::Reflect + addGeneral(behaviorContext->Method( "idle_wait_frames", &AtomToolsApplication::PyIdleWaitFrames, nullptr, "Waits idling for a frames. Primarily used for auto-testing.")); + addGeneral(behaviorContext->Method( + "exit", &AtomToolsApplication::PyExit, nullptr, + "Exit application. Primarily used for auto-testing.")); } } @@ -564,4 +567,9 @@ namespace AtomToolsFramework Ticker ticker(&loop, frames); loop.exec(); } + + void AtomToolsApplication::PyExit() + { + AzFramework::ApplicationRequests::Bus::Broadcast(&AzFramework::ApplicationRequests::ExitMainLoop); + } } // namespace AtomToolsFramework From 1cfa4a9bd5677bd65d39353d0e69f23edfb5eb22 Mon Sep 17 00:00:00 2001 From: windbagjacket Date: Mon, 17 Jan 2022 10:00:07 +0000 Subject: [PATCH 505/948] Removed tab usage. Signed-off-by: windbagjacket --- .../EMotionFXAtom/Code/Source/AtomActorInstance.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.cpp b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.cpp index bb467b2259..742031c84f 100644 --- a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.cpp +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.cpp @@ -376,7 +376,7 @@ namespace AZ::Render bool AtomActorInstance::GetVisibility() const { - return IsVisible(); + return IsVisible(); } void AtomActorInstance::SetRayTracingEnabled(bool enabled) From aac28f73aaf9ff72232aafeaa589fcb0437a7cc8 Mon Sep 17 00:00:00 2001 From: Bindless-Chicken <1039134+Bindless-Chicken@users.noreply.github.com> Date: Mon, 17 Jan 2022 14:25:50 +0000 Subject: [PATCH 506/948] Fix missing ImGui::End in multiplayer windows Signed-off-by: Bindless-Chicken <1039134+Bindless-Chicken@users.noreply.github.com> --- .../Code/Source/Debug/MultiplayerDebugSystemComponent.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Gems/Multiplayer/Code/Source/Debug/MultiplayerDebugSystemComponent.cpp b/Gems/Multiplayer/Code/Source/Debug/MultiplayerDebugSystemComponent.cpp index 4ff78d3815..4266072d20 100644 --- a/Gems/Multiplayer/Code/Source/Debug/MultiplayerDebugSystemComponent.cpp +++ b/Gems/Multiplayer/Code/Source/Debug/MultiplayerDebugSystemComponent.cpp @@ -386,7 +386,6 @@ namespace Multiplayer } ImGui::NewLine(); } - ImGui::End(); } void DrawMultiplayerStats() @@ -437,7 +436,6 @@ namespace Multiplayer ImGui::EndTable(); ImGui::NewLine(); } - ImGui::End(); } void MultiplayerDebugSystemComponent::OnImGuiUpdate() @@ -448,6 +446,7 @@ namespace Multiplayer { DrawNetworkingStats(); } + ImGui::End(); } if (m_displayMultiplayerStats) @@ -456,6 +455,7 @@ namespace Multiplayer { DrawMultiplayerStats(); } + ImGui::End(); } if (m_displayPerEntityStats) @@ -473,6 +473,7 @@ namespace Multiplayer m_reporter->OnImGuiUpdate(); } } + ImGui::End(); } if (m_displayHierarchyDebugger) @@ -489,6 +490,7 @@ namespace Multiplayer m_hierarchyDebugger->OnImGuiUpdate(); } } + ImGui::End(); } else { From 0b9dc78d67d1ddea29b4fae29bd75c0335dee9ae Mon Sep 17 00:00:00 2001 From: John Jones-Steele <82226755+jjjoness@users.noreply.github.com> Date: Mon, 17 Jan 2022 17:58:19 +0000 Subject: [PATCH 507/948] Fixed problem with inputting numbers in sliders (#6859) * Fixed problem with inputting numbers in sliders Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com> * Changes from PR Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com> * Missed removing pragma optimize Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com> --- .../AzQtComponents/Components/Widgets/Slider.cpp | 3 +-- .../AzQtComponents/Components/Widgets/SliderCombo.cpp | 10 +++++----- .../AzQtComponents/Components/Widgets/SliderCombo.h | 1 - 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/Slider.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/Slider.cpp index 14ac2010bc..f50b9c36ec 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/Slider.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/Slider.cpp @@ -870,8 +870,7 @@ void SliderDouble::setCurveMidpoint(double midpoint) QString SliderDouble::hoverValueText(int sliderValue) const { - // maybe format this, max number of digits? - QString valueText = locale().toString(calculateRealSliderValue(sliderValue), 'f', m_decimals); + QString valueText = toString(calculateRealSliderValue(sliderValue), m_decimals, locale(), false, true); return QStringLiteral("%1").arg(valueText); } diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SliderCombo.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SliderCombo.cpp index 6333d28365..9d289e5d44 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SliderCombo.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SliderCombo.cpp @@ -14,6 +14,7 @@ #include #include +#include namespace AzQtComponents { @@ -254,11 +255,12 @@ SliderDoubleCombo::~SliderDoubleCombo() { } +bool m_fromSlider{ false }; + void SliderDoubleCombo::setValueSlider(double value) { const bool doEmit = m_value != value; m_value = value; - updateSpinBox(); updateSlider(); @@ -267,6 +269,8 @@ void SliderDoubleCombo::setValueSlider(double value) // We don't want to update the slider from setValue as this // causes rounding errors in the tooltip hint. m_fromSlider = true; + QTimer::singleShot( 10, []() { m_fromSlider = false; }); + Q_EMIT valueChanged(); } } @@ -286,10 +290,6 @@ void SliderDoubleCombo::setValue(double value) Q_EMIT valueChanged(); } } - else - { - m_fromSlider = false; - } } SliderDouble* SliderDoubleCombo::slider() const diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SliderCombo.h b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SliderCombo.h index 05d0f7b51b..be6c86b520 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SliderCombo.h +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SliderCombo.h @@ -237,6 +237,5 @@ namespace AzQtComponents double m_softMinimum = 0.0; double m_softMaximum = 100.0; double m_value = 0.0; - bool m_fromSlider{ false }; }; } // namespace AzQtComponents From 2b103ce445fb09ad955af4a44128132d58e5a48b Mon Sep 17 00:00:00 2001 From: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> Date: Mon, 17 Jan 2022 16:52:30 -0700 Subject: [PATCH 508/948] Added support for supervariants to the PrecompiledShaderBuilder Signed-off-by: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> --- .../AzslShaderBuilderSystemComponent.cpp | 2 +- .../Editor/PrecompiledShaderBuilder.cpp | 67 ++++++++++-------- ...seProbeGridBlendDistance.precompiledshader | 31 +++++---- ...ProbeGridBlendIrradiance.precompiledshader | 31 +++++---- ...beGridBorderUpdateColumn.precompiledshader | 33 +++++---- ...ProbeGridBorderUpdateRow.precompiledshader | 37 +++++----- ...eProbeGridClassification.precompiledshader | 31 +++++---- ...ffuseProbeGridRayTracing.precompiledshader | 38 ++++++----- ...GridRayTracingClosestHit.precompiledshader | 35 ++++++---- ...eProbeGridRayTracingMiss.precompiledshader | 33 +++++---- ...ffuseProbeGridRelocation.precompiledshader | 35 ++++++---- .../DiffuseProbeGridRender.precompiledshader | 35 ++++++---- .../Shader/PrecompiledShaderAssetSourceData.h | 27 ++++++-- .../RPI.Reflect/Shader/ShaderAssetCreator.h | 15 +++- .../PrecompiledShaderAssetSourceData.cpp | 28 ++++++-- .../RPI.Reflect/Shader/ShaderAssetCreator.cpp | 68 ++++++++++++------- 16 files changed, 340 insertions(+), 206 deletions(-) diff --git a/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslShaderBuilderSystemComponent.cpp b/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslShaderBuilderSystemComponent.cpp index cc80b38b85..eae4e804e0 100644 --- a/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslShaderBuilderSystemComponent.cpp +++ b/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslShaderBuilderSystemComponent.cpp @@ -120,7 +120,7 @@ namespace AZ // Register Precompiled Shader Builder AssetBuilderSDK::AssetBuilderDesc precompiledShaderBuilderDescriptor; precompiledShaderBuilderDescriptor.m_name = "Precompiled Shader Builder"; - precompiledShaderBuilderDescriptor.m_version = 10; // ATOM-15472 + precompiledShaderBuilderDescriptor.m_version = 11; // ATOM-15740 precompiledShaderBuilderDescriptor.m_patterns.push_back(AssetBuilderSDK::AssetBuilderPattern(AZStd::string::format("*.%s", AZ::PrecompiledShaderBuilder::Extension), AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard)); precompiledShaderBuilderDescriptor.m_busId = azrtti_typeid(); precompiledShaderBuilderDescriptor.m_createJobFunction = AZStd::bind(&PrecompiledShaderBuilder::CreateJobs, &m_precompiledShaderBuilder, AZStd::placeholders::_1, AZStd::placeholders::_2); diff --git a/Gems/Atom/Asset/Shader/Code/Source/Editor/PrecompiledShaderBuilder.cpp b/Gems/Atom/Asset/Shader/Code/Source/Editor/PrecompiledShaderBuilder.cpp index 2abee4d297..05b4ff309b 100644 --- a/Gems/Atom/Asset/Shader/Code/Source/Editor/PrecompiledShaderBuilder.cpp +++ b/Gems/Atom/Asset/Shader/Code/Source/Editor/PrecompiledShaderBuilder.cpp @@ -68,20 +68,23 @@ namespace AZ { AZStd::vector jobDependencyList; - // setup dependencies on the root azshadervariant asset file names - for (const auto& rootShaderVariantAsset : precompiledShaderAsset.m_rootShaderVariantAssets) + // setup dependencies on the root azshadervariant asset file names, for each supervariant + for (const auto& supervariant : precompiledShaderAsset.m_supervariants) { - AZStd::string rootShaderVariantAssetPath = RPI::AssetUtils::ResolvePathReference(request.m_sourceFile.c_str(), rootShaderVariantAsset->m_rootShaderVariantAssetFileName); - AssetBuilderSDK::SourceFileDependency sourceDependency; - sourceDependency.m_sourceFileDependencyPath = rootShaderVariantAssetPath; - response.m_sourceFileDependencyList.push_back(sourceDependency); - - AssetBuilderSDK::JobDependency jobDependency; - jobDependency.m_jobKey = "azshadervariant"; - jobDependency.m_platformIdentifier = platformInfo.m_identifier; - jobDependency.m_type = AssetBuilderSDK::JobDependencyType::Order; - jobDependency.m_sourceFile = sourceDependency; - jobDependencyList.push_back(jobDependency); + for (const auto& rootShaderVariantAsset : supervariant->m_rootShaderVariantAssets) + { + AZStd::string rootShaderVariantAssetPath = RPI::AssetUtils::ResolvePathReference(request.m_sourceFile.c_str(), rootShaderVariantAsset->m_rootShaderVariantAssetFileName); + AssetBuilderSDK::SourceFileDependency sourceDependency; + sourceDependency.m_sourceFileDependencyPath = rootShaderVariantAssetPath; + response.m_sourceFileDependencyList.push_back(sourceDependency); + + AssetBuilderSDK::JobDependency jobDependency; + jobDependency.m_jobKey = "azshadervariant"; + jobDependency.m_platformIdentifier = platformInfo.m_identifier; + jobDependency.m_type = AssetBuilderSDK::JobDependencyType::Order; + jobDependency.m_sourceFile = sourceDependency; + jobDependencyList.push_back(jobDependency); + } } AssetBuilderSDK::JobDescriptor job; @@ -137,33 +140,37 @@ namespace AZ AssetBuilderSDK::JobProduct jobProduct; - // load the variant product assets + // load the variant product assets, for each supervariant // these are the dependency root variant asset products that were processed prior to running this job - RPI::ShaderAssetCreator::ShaderRootVariantAssets rootVariantProductAssets; - for (AZStd::unique_ptr& rootShaderVariantAsset : precompiledShaderAsset.m_rootShaderVariantAssets) + RPI::ShaderAssetCreator::ShaderSupervariants supervariants; + for (const auto& supervariant : precompiledShaderAsset.m_supervariants) { - // retrieve the variant asset - auto assetOutcome = RPI::AssetUtils::LoadAsset(request.m_fullPath, rootShaderVariantAsset->m_rootShaderVariantAssetFileName, 0); - if (!assetOutcome) + RPI::ShaderAssetCreator::ShaderRootVariantAssets rootVariantProductAssets; + for (const auto& rootShaderVariantAsset : supervariant->m_rootShaderVariantAssets) { - AZ_Error(PrecompiledShaderBuilderName, false, "Failed to retrieve Variant asset for file [%s]", rootShaderVariantAsset->m_rootShaderVariantAssetFileName.c_str()); - return; - } + // retrieve the variant asset + auto assetOutcome = RPI::AssetUtils::LoadAsset(request.m_fullPath, rootShaderVariantAsset->m_rootShaderVariantAssetFileName, 0); + if (!assetOutcome) + { + AZ_Error(PrecompiledShaderBuilderName, false, "Failed to retrieve Variant asset for file [%s]", rootShaderVariantAsset->m_rootShaderVariantAssetFileName.c_str()); + return; + } - rootVariantProductAssets.push_back(AZStd::make_pair(RHI::APIType{ rootShaderVariantAsset->m_apiName.GetCStr() }, assetOutcome.GetValue())); + rootVariantProductAssets.push_back(AZStd::make_pair(RHI::APIType{ rootShaderVariantAsset->m_apiName.GetCStr() }, assetOutcome.GetValue())); + + AssetBuilderSDK::ProductDependency productDependency; + productDependency.m_dependencyId = assetOutcome.GetValue().GetId(); + productDependency.m_flags = AZ::Data::ProductDependencyInfo::CreateFlags(AZ::Data::AssetLoadBehavior::PreLoad); + jobProduct.m_dependencies.push_back(productDependency); + } - AssetBuilderSDK::ProductDependency productDependency; - productDependency.m_dependencyId = assetOutcome.GetValue().GetId(); - productDependency.m_flags = AZ::Data::ProductDependencyInfo::CreateFlags(AZ::Data::AssetLoadBehavior::PreLoad); - jobProduct.m_dependencies.push_back(productDependency); + supervariants.push_back({ supervariant->m_name, rootVariantProductAssets }); } // use the ShaderAssetCreator to clone the shader asset, which will update the embedded Srg and Variant asset UUIDs // Note that the Srg and Variant assets do not have embedded asset references and are processed with the RC Copy functionality RPI::ShaderAssetCreator shaderAssetCreator; - shaderAssetCreator.Clone(Uuid::CreateRandom(), - *shaderAsset, - rootVariantProductAssets); + shaderAssetCreator.Clone(Uuid::CreateRandom(), *shaderAsset, supervariants); Data::Asset outputShaderAsset; if (!shaderAssetCreator.End(outputShaderAsset)) diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistance.precompiledshader b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistance.precompiledshader index be1d87ff3e..81d6bde5f0 100644 --- a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistance.precompiledshader +++ b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistance.precompiledshader @@ -7,21 +7,28 @@ "ShaderAssetFileName": "diffuseprobegridblenddistance.azshader", "PlatformIdentifiers": [ - "pc", "linux" + "pc", + "linux" ], - "RootShaderVariantAssets": + "Supervariants": [ { - "APIName": "dx12", - "RootShaderVariantAssetFileName": "diffuseprobegridblenddistance_dx12_0.azshadervariant" - }, - { - "APIName": "vulkan", - "RootShaderVariantAssetFileName": "diffuseprobegridblenddistance_vulkan_0.azshadervariant" - }, - { - "APIName": "null", - "RootShaderVariantAssetFileName": "diffuseprobegridblenddistance_null_0.azshadervariant" + "Name": "", + "RootShaderVariantAssets": + [ + { + "APIName": "dx12", + "RootShaderVariantAssetFileName": "diffuseprobegridblenddistance_dx12_0.azshadervariant" + }, + { + "APIName": "vulkan", + "RootShaderVariantAssetFileName": "diffuseprobegridblenddistance_vulkan_0.azshadervariant" + }, + { + "APIName": "null", + "RootShaderVariantAssetFileName": "diffuseprobegridblenddistance_null_0.azshadervariant" + } + ] } ] } diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiance.precompiledshader b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiance.precompiledshader index 92fb12d5cc..9fa8e27461 100644 --- a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiance.precompiledshader +++ b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiance.precompiledshader @@ -7,21 +7,28 @@ "ShaderAssetFileName": "diffuseprobegridblendirradiance.azshader", "PlatformIdentifiers": [ - "pc", "linux" + "pc", + "linux" ], - "RootShaderVariantAssets": + "Supervariants": [ { - "APIName": "dx12", - "RootShaderVariantAssetFileName": "diffuseprobegridblendirradiance_dx12_0.azshadervariant" - }, - { - "APIName": "vulkan", - "RootShaderVariantAssetFileName": "diffuseprobegridblendirradiance_vulkan_0.azshadervariant" - }, - { - "APIName": "null", - "RootShaderVariantAssetFileName": "diffuseprobegridblendirradiance_null_0.azshadervariant" + "Name": "", + "RootShaderVariantAssets": + [ + { + "APIName": "dx12", + "RootShaderVariantAssetFileName": "diffuseprobegridblendirradiance_dx12_0.azshadervariant" + }, + { + "APIName": "vulkan", + "RootShaderVariantAssetFileName": "diffuseprobegridblendirradiance_vulkan_0.azshadervariant" + }, + { + "APIName": "null", + "RootShaderVariantAssetFileName": "diffuseprobegridblendirradiance_null_0.azshadervariant" + } + ] } ] } diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdateColumn.precompiledshader b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdateColumn.precompiledshader index 8de77320f0..f2363bd5ee 100644 --- a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdateColumn.precompiledshader +++ b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdateColumn.precompiledshader @@ -5,23 +5,30 @@ "ClassData": { "ShaderAssetFileName": "diffuseprobegridborderupdatecolumn.azshader", - "PlatformIdentifiers": + "PlatformIdentifiers": [ - "pc", "linux" + "pc", + "linux" ], - "RootShaderVariantAssets": + "Supervariants": [ { - "APIName": "dx12", - "RootShaderVariantAssetFileName": "diffuseprobegridborderupdatecolumn_dx12_0.azshadervariant" - }, - { - "APIName": "vulkan", - "RootShaderVariantAssetFileName": "diffuseprobegridborderupdatecolumn_vulkan_0.azshadervariant" - }, - { - "APIName": "null", - "RootShaderVariantAssetFileName": "diffuseprobegridborderupdatecolumn_null_0.azshadervariant" + "Name": "", + "RootShaderVariantAssets": + [ + { + "APIName": "dx12", + "RootShaderVariantAssetFileName": "diffuseprobegridborderupdatecolumn_dx12_0.azshadervariant" + }, + { + "APIName": "vulkan", + "RootShaderVariantAssetFileName": "diffuseprobegridborderupdatecolumn_vulkan_0.azshadervariant" + }, + { + "APIName": "null", + "RootShaderVariantAssetFileName": "diffuseprobegridborderupdatecolumn_null_0.azshadervariant" + } + ] } ] } diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdateRow.precompiledshader b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdateRow.precompiledshader index 274dae91af..d87cc47a38 100644 --- a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdateRow.precompiledshader +++ b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdateRow.precompiledshader @@ -2,26 +2,31 @@ "Type": "JsonSerialization", "Version": 1, "ClassName": "PrecompiledShaderAssetSourceData", - "ClassData": - { + "ClassData": { "ShaderAssetFileName": "diffuseprobegridborderupdaterow.azshader", - "PlatformIdentifiers": - [ - "pc", "linux" + "PlatformIdentifiers": [ + "pc", + "linux" ], - "RootShaderVariantAssets": + "Supervariants": [ { - "APIName": "dx12", - "RootShaderVariantAssetFileName": "diffuseprobegridborderupdaterow_dx12_0.azshadervariant" - }, - { - "APIName": "vulkan", - "RootShaderVariantAssetFileName": "diffuseprobegridborderupdaterow_vulkan_0.azshadervariant" - }, - { - "APIName": "null", - "RootShaderVariantAssetFileName": "diffuseprobegridborderupdaterow_null_0.azshadervariant" + "Name": "", + "RootShaderVariantAssets": + [ + { + "APIName": "dx12", + "RootShaderVariantAssetFileName": "diffuseprobegridborderupdaterow_dx12_0.azshadervariant" + }, + { + "APIName": "vulkan", + "RootShaderVariantAssetFileName": "diffuseprobegridborderupdaterow_vulkan_0.azshadervariant" + }, + { + "APIName": "null", + "RootShaderVariantAssetFileName": "diffuseprobegridborderupdaterow_null_0.azshadervariant" + } + ] } ] } diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridClassification.precompiledshader b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridClassification.precompiledshader index 85f75e6364..66671fd7bc 100644 --- a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridClassification.precompiledshader +++ b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridClassification.precompiledshader @@ -7,21 +7,28 @@ "ShaderAssetFileName": "diffuseprobegridclassification.azshader", "PlatformIdentifiers": [ - "pc", "linux" + "pc", + "linux" ], - "RootShaderVariantAssets": + "Supervariants": [ { - "APIName": "dx12", - "RootShaderVariantAssetFileName": "diffuseprobegridclassification_dx12_0.azshadervariant" - }, - { - "APIName": "vulkan", - "RootShaderVariantAssetFileName": "diffuseprobegridclassification_vulkan_0.azshadervariant" - }, - { - "APIName": "null", - "RootShaderVariantAssetFileName": "diffuseprobegridclassification_null_0.azshadervariant" + "Name": "", + "RootShaderVariantAssets": + [ + { + "APIName": "dx12", + "RootShaderVariantAssetFileName": "diffuseprobegridclassification_dx12_0.azshadervariant" + }, + { + "APIName": "vulkan", + "RootShaderVariantAssetFileName": "diffuseprobegridclassification_vulkan_0.azshadervariant" + }, + { + "APIName": "null", + "RootShaderVariantAssetFileName": "diffuseprobegridclassification_null_0.azshadervariant" + } + ] } ] } diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridRayTracing.precompiledshader b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridRayTracing.precompiledshader index 88aa115b63..7b156ca7e5 100644 --- a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridRayTracing.precompiledshader +++ b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridRayTracing.precompiledshader @@ -2,27 +2,33 @@ "Type": "JsonSerialization", "Version": 1, "ClassName": "PrecompiledShaderAssetSourceData", - "ClassData": + "ClassData": { "ShaderAssetFileName": "diffuseprobegridraytracing.azshader", - "PlatformIdentifiers": - [ - "pc", "linux" + "PlatformIdentifiers": [ + "pc", + "linux" ], - "RootShaderVariantAssets": + "Supervariants": [ { - "APIName": "dx12", - "RootShaderVariantAssetFileName": "diffuseprobegridraytracing_dx12_0.azshadervariant" - }, - { - "APIName": "vulkan", - "RootShaderVariantAssetFileName": "diffuseprobegridraytracing_vulkan_0.azshadervariant" - }, - { - "APIName": "null", - "RootShaderVariantAssetFileName": "diffuseprobegridraytracing_null_0.azshadervariant" + "Name": "", + "RootShaderVariantAssets": + [ + { + "APIName": "dx12", + "RootShaderVariantAssetFileName": "diffuseprobegridraytracing_dx12_0.azshadervariant" + }, + { + "APIName": "vulkan", + "RootShaderVariantAssetFileName": "diffuseprobegridraytracing_vulkan_0.azshadervariant" + }, + { + "APIName": "null", + "RootShaderVariantAssetFileName": "diffuseprobegridraytracing_null_0.azshadervariant" + } + ] } ] } -} +} \ No newline at end of file diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridRayTracingClosestHit.precompiledshader b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridRayTracingClosestHit.precompiledshader index 948fc793ab..d19eb4baf1 100644 --- a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridRayTracingClosestHit.precompiledshader +++ b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridRayTracingClosestHit.precompiledshader @@ -2,27 +2,34 @@ "Type": "JsonSerialization", "Version": 1, "ClassName": "PrecompiledShaderAssetSourceData", - "ClassData": + "ClassData": { "ShaderAssetFileName": "diffuseprobegridraytracingclosesthit.azshader", "PlatformIdentifiers": [ - "pc", "linux" + "pc", + "linux" ], - "RootShaderVariantAssets": + "Supervariants": [ { - "APIName": "dx12", - "RootShaderVariantAssetFileName": "diffuseprobegridraytracingclosesthit_dx12_0.azshadervariant" - }, - { - "APIName": "vulkan", - "RootShaderVariantAssetFileName": "diffuseprobegridraytracingclosesthit_vulkan_0.azshadervariant" - }, - { - "APIName": "null", - "RootShaderVariantAssetFileName": "diffuseprobegridraytracingclosesthit_null_0.azshadervariant" + "Name": "", + "RootShaderVariantAssets": + [ + { + "APIName": "dx12", + "RootShaderVariantAssetFileName": "diffuseprobegridraytracingclosesthit_dx12_0.azshadervariant" + }, + { + "APIName": "vulkan", + "RootShaderVariantAssetFileName": "diffuseprobegridraytracingclosesthit_vulkan_0.azshadervariant" + }, + { + "APIName": "null", + "RootShaderVariantAssetFileName": "diffuseprobegridraytracingclosesthit_null_0.azshadervariant" + } + ] } ] } -} +} \ No newline at end of file diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridRayTracingMiss.precompiledshader b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridRayTracingMiss.precompiledshader index dec0e244b1..d30783db14 100644 --- a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridRayTracingMiss.precompiledshader +++ b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridRayTracingMiss.precompiledshader @@ -2,26 +2,33 @@ "Type": "JsonSerialization", "Version": 1, "ClassName": "PrecompiledShaderAssetSourceData", - "ClassData": + "ClassData": { "ShaderAssetFileName": "diffuseprobegridraytracingmiss.azshader", "PlatformIdentifiers": [ - "pc", "linux" + "pc", + "linux" ], - "RootShaderVariantAssets": + "Supervariants": [ { - "APIName": "dx12", - "RootShaderVariantAssetFileName": "diffuseprobegridraytracingmiss_dx12_0.azshadervariant" - }, - { - "APIName": "vulkan", - "RootShaderVariantAssetFileName": "diffuseprobegridraytracingmiss_vulkan_0.azshadervariant" - }, - { - "APIName": "null", - "RootShaderVariantAssetFileName": "diffuseprobegridraytracingmiss_null_0.azshadervariant" + "Name": "", + "RootShaderVariantAssets": + [ + { + "APIName": "dx12", + "RootShaderVariantAssetFileName": "diffuseprobegridraytracingmiss_dx12_0.azshadervariant" + }, + { + "APIName": "vulkan", + "RootShaderVariantAssetFileName": "diffuseprobegridraytracingmiss_vulkan_0.azshadervariant" + }, + { + "APIName": "null", + "RootShaderVariantAssetFileName": "diffuseprobegridraytracingmiss_null_0.azshadervariant" + } + ] } ] } diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridRelocation.precompiledshader b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridRelocation.precompiledshader index e09a29a7e8..56b487ceb6 100644 --- a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridRelocation.precompiledshader +++ b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridRelocation.precompiledshader @@ -2,27 +2,34 @@ "Type": "JsonSerialization", "Version": 1, "ClassName": "PrecompiledShaderAssetSourceData", - "ClassData": + "ClassData": { "ShaderAssetFileName": "diffuseprobegridrelocation.azshader", "PlatformIdentifiers": [ - "pc", "linux" + "pc", + "linux" ], - "RootShaderVariantAssets": + "Supervariants": [ { - "APIName": "dx12", - "RootShaderVariantAssetFileName": "diffuseprobegridrelocation_dx12_0.azshadervariant" - }, - { - "APIName": "vulkan", - "RootShaderVariantAssetFileName": "diffuseprobegridrelocation_vulkan_0.azshadervariant" - }, - { - "APIName": "null", - "RootShaderVariantAssetFileName": "diffuseprobegridrelocation_null_0.azshadervariant" + "Name": "", + "RootShaderVariantAssets": + [ + { + "APIName": "dx12", + "RootShaderVariantAssetFileName": "diffuseprobegridrelocation_dx12_0.azshadervariant" + }, + { + "APIName": "vulkan", + "RootShaderVariantAssetFileName": "diffuseprobegridrelocation_vulkan_0.azshadervariant" + }, + { + "APIName": "null", + "RootShaderVariantAssetFileName": "diffuseprobegridrelocation_null_0.azshadervariant" + } + ] } ] } -} +} \ No newline at end of file diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridRender.precompiledshader b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridRender.precompiledshader index 279deaaa29..97c58091a2 100644 --- a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridRender.precompiledshader +++ b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridRender.precompiledshader @@ -7,22 +7,29 @@ "ShaderAssetFileName": "diffuseprobegridrender.azshader", "PlatformIdentifiers": [ - "pc", "linux" + "pc", + "linux" ], - "RootShaderVariantAssets": + "Supervariants": [ { - "APIName": "dx12", - "RootShaderVariantAssetFileName": "diffuseprobegridrender_dx12_0.azshadervariant" - }, - { - "APIName": "vulkan", - "RootShaderVariantAssetFileName": "diffuseprobegridrender_vulkan_0.azshadervariant" - }, - { - "APIName": "null", - "RootShaderVariantAssetFileName": "diffuseprobegridrender_null_0.azshadervariant" - } + "Name": "", + "RootShaderVariantAssets": + [ + { + "APIName": "dx12", + "RootShaderVariantAssetFileName": "diffuseprobegridrender_dx12_0.azshadervariant" + }, + { + "APIName": "vulkan", + "RootShaderVariantAssetFileName": "diffuseprobegridrender_vulkan_0.azshadervariant" + }, + { + "APIName": "null", + "RootShaderVariantAssetFileName": "diffuseprobegridrender_null_0.azshadervariant" + } + ] + } ] } -} +} \ No newline at end of file diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/PrecompiledShaderAssetSourceData.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/PrecompiledShaderAssetSourceData.h index ce5a4c8a7a..956367c126 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/PrecompiledShaderAssetSourceData.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/PrecompiledShaderAssetSourceData.h @@ -17,14 +17,14 @@ namespace AZ namespace RPI { - //! This asset contains is loaded from a Json file and contains information about + //! This asset is loaded from a Json file and contains information about //! precompiled shader variants and their associated API name. - struct RootShaderVariantAssetSourceData final + struct PrecompiledRootShaderVariantAssetSourceData final : public Data::AssetData { public: - AZ_RTTI(RootShaderVariantAssetSourceData, "{661EF8A7-7BAC-41B6-AD5C-C7249B2390AD}"); - AZ_CLASS_ALLOCATOR(RootShaderVariantAssetSourceData, SystemAllocator, 0); + AZ_RTTI(PrecompiledRootShaderVariantAssetSourceData, "{661EF8A7-7BAC-41B6-AD5C-C7249B2390AD}"); + AZ_CLASS_ALLOCATOR(PrecompiledRootShaderVariantAssetSourceData, SystemAllocator, 0); static void Reflect(ReflectContext* context); @@ -32,7 +32,22 @@ namespace AZ AZStd::string m_rootShaderVariantAssetFileName; }; - //! This asset contains is loaded from a Json file and contains information about + //! This asset is loaded from a Json file and contains information about + //! precompiled shader supervariants + struct PrecompiledSupervariantSourceData final + : public Data::AssetData + { + public: + AZ_RTTI(PrecompiledSupervariantSourceData, "{630BDF15-CE7C-4E2C-882E-4F7AF09C8BB6}"); + AZ_CLASS_ALLOCATOR(PrecompiledSupervariantSourceData, SystemAllocator, 0); + + static void Reflect(ReflectContext* context); + + AZ::Name m_name; + AZStd::vector> m_rootShaderVariantAssets; + }; + + //! This asset is loaded from a Json file and contains information about //! precompiled shader assets. struct PrecompiledShaderAssetSourceData final : public Data::AssetData @@ -45,7 +60,7 @@ namespace AZ AZStd::string m_shaderAssetFileName; AZStd::vector m_platformIdentifiers; - AZStd::vector> m_rootShaderVariantAssets; + AZStd::vector> m_supervariants; }; } // namespace RPI } // namespace AZ diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderAssetCreator.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderAssetCreator.h index 22854a4559..d0c9729948 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderAssetCreator.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderAssetCreator.h @@ -75,11 +75,20 @@ namespace AZ bool End(Data::Asset& shaderAsset); - //! Clones an existing ShaderAsset nd replaces the referenced Srg and Variant assets - using ShaderRootVariantAssets = AZStd::vector>>; + //! Clones an existing ShaderAsset and replaces the ShaderVariant assets + using ShaderRootVariantAssetPair = AZStd::pair>; + using ShaderRootVariantAssets = AZStd::vector; + + struct ShaderSupervariant + { + AZ::Name m_name; + ShaderRootVariantAssets m_rootVariantAssets; + }; + using ShaderSupervariants = AZStd::vector; + void Clone(const Data::AssetId& assetId, const ShaderAsset& sourceShaderAsset, - const ShaderRootVariantAssets& rootVariantAssets); + const ShaderSupervariants& supervariants); private: diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/PrecompiledShaderAssetSourceData.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/PrecompiledShaderAssetSourceData.cpp index a7a9344d6e..62fb904b37 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/PrecompiledShaderAssetSourceData.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/PrecompiledShaderAssetSourceData.cpp @@ -14,29 +14,43 @@ namespace AZ { namespace RPI { - void RootShaderVariantAssetSourceData::Reflect(ReflectContext* context) + void PrecompiledRootShaderVariantAssetSourceData::Reflect(ReflectContext* context) { if (auto* serializeContext = azrtti_cast(context)) { - serializeContext->Class() + serializeContext->Class() ->Version(0) - ->Field("APIName", &RootShaderVariantAssetSourceData::m_apiName) - ->Field("RootShaderVariantAssetFileName", &RootShaderVariantAssetSourceData::m_rootShaderVariantAssetFileName) + ->Field("APIName", &PrecompiledRootShaderVariantAssetSourceData::m_apiName) + ->Field("RootShaderVariantAssetFileName", &PrecompiledRootShaderVariantAssetSourceData::m_rootShaderVariantAssetFileName) + ; + } + } + + void PrecompiledSupervariantSourceData::Reflect(ReflectContext* context) + { + PrecompiledRootShaderVariantAssetSourceData::Reflect(context); + + if (auto* serializeContext = azrtti_cast(context)) + { + serializeContext->Class() + ->Version(0) + ->Field("Name", &PrecompiledSupervariantSourceData::m_name) + ->Field("RootShaderVariantAssets", &PrecompiledSupervariantSourceData::m_rootShaderVariantAssets) ; } } void PrecompiledShaderAssetSourceData::Reflect(ReflectContext* context) { - RootShaderVariantAssetSourceData::Reflect(context); + PrecompiledSupervariantSourceData::Reflect(context); if (auto* serializeContext = azrtti_cast(context)) { serializeContext->Class() - ->Version(1) // ATOM-15472 + ->Version(2) // ATOM-15740 ->Field("ShaderAssetFileName", &PrecompiledShaderAssetSourceData::m_shaderAssetFileName) ->Field("PlatformIdentifiers", &PrecompiledShaderAssetSourceData::m_platformIdentifiers) - ->Field("RootShaderVariantAssets", &PrecompiledShaderAssetSourceData::m_rootShaderVariantAssets) + ->Field("Supervariants", &PrecompiledShaderAssetSourceData::m_supervariants) ; } } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderAssetCreator.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderAssetCreator.cpp index 5df37aa211..e56561b400 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderAssetCreator.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderAssetCreator.cpp @@ -382,7 +382,7 @@ namespace AZ return EndCommon(shaderAsset); } - void ShaderAssetCreator::Clone(const Data::AssetId& assetId, const ShaderAsset& sourceShaderAsset, [[maybe_unused]] const ShaderRootVariantAssets& rootVariantAssets) + void ShaderAssetCreator::Clone(const Data::AssetId& assetId, const ShaderAsset& sourceShaderAsset, [[maybe_unused]] const ShaderSupervariants& supervariants) { BeginCommon(assetId); @@ -392,38 +392,60 @@ namespace AZ m_asset->m_shaderOptionGroupLayout = sourceShaderAsset.m_shaderOptionGroupLayout; m_asset->m_buildTimestamp = sourceShaderAsset.m_buildTimestamp; - // copy root variant assets + // copy the perAPIShaderData for (auto& perAPIShaderData : sourceShaderAsset.m_perAPIShaderData) { - // find the matching ShaderVariantAsset - AZ::Data::Asset foundVariantAsset; - for (const auto& variantAsset : rootVariantAssets) + if (perAPIShaderData.m_supervariants.empty()) { - if (variantAsset.first == perAPIShaderData.m_APIType) - { - foundVariantAsset = variantAsset.second; - break; - } + ReportWarning("Attempting to clone a shader asset that has no supervariants for API [%d]", perAPIShaderData.m_APIType); + continue; } - - if (!foundVariantAsset) + + if (perAPIShaderData.m_supervariants.size() != supervariants.size()) { - ReportWarning("Failed to find variant asset for API [%d]", perAPIShaderData.m_APIType); + ReportError("Incorrect number of supervariants provided to ShaderAssetCreator::Clone"); + return; } - + m_asset->m_perAPIShaderData.push_back(perAPIShaderData); - if (m_asset->m_perAPIShaderData.back().m_supervariants.empty()) - { - ReportWarning("Attempting to clone a shader asset that has no supervariants for API [%d]", perAPIShaderData.m_APIType); - } - else + + // set the supervariants for this API + for (auto& supervariant : m_asset->m_perAPIShaderData.back().m_supervariants) { - // currently we only support one supervariant when cloning - // [GFX TODO][ATOM-15740] Support multiple supervariants in ShaderAssetCreator::Clone - m_asset->m_perAPIShaderData.back().m_supervariants[0].m_rootShaderVariantAsset = foundVariantAsset; + // find the matching Supervariant by name from the incoming list + ShaderSupervariants::const_iterator itFoundSuperVariant = AZStd::find_if( + supervariants.begin(), + supervariants.end(), + [&supervariant](const ShaderSupervariant& shaderSupervariant) + { + return supervariant.m_name == shaderSupervariant.m_name; + }); + + if (itFoundSuperVariant == supervariants.end()) + { + ReportError("Failed to find supervariant [%s]", supervariant.m_name.GetCStr()); + return; + } + + // find the matching ShaderVariantAsset for this API + ShaderRootVariantAssets::const_iterator itFoundRootShaderVariantAsset = AZStd::find_if( + itFoundSuperVariant->m_rootVariantAssets.begin(), + itFoundSuperVariant->m_rootVariantAssets.end(), + [&perAPIShaderData](const ShaderRootVariantAssetPair& rootShaderVariantAsset) + { + return perAPIShaderData.m_APIType == rootShaderVariantAsset.first; + }); + + if (itFoundRootShaderVariantAsset == itFoundSuperVariant->m_rootVariantAssets.end()) + { + ReportWarning("Failed to find root shader variant asset for API [%d] Supervariant [%s]", perAPIShaderData.m_APIType, supervariant.m_name.GetCStr()); + } + else + { + supervariant.m_rootShaderVariantAsset = itFoundRootShaderVariantAsset->second; + } } } - } } // namespace RPI } // namespace AZ From 392d08e2f0272c3bbe62207124e6664fb4c77a4e Mon Sep 17 00:00:00 2001 From: amzn-sj Date: Mon, 17 Jan 2022 17:09:30 -0800 Subject: [PATCH 509/948] Update Terrain renderer code to use the ProcessRegion API functions instead of the Get* functions Signed-off-by: amzn-sj --- .../TerrainDetailMaterialManager.cpp | 76 ++++++++++--------- .../TerrainFeatureProcessor.cpp | 37 ++++----- 2 files changed, 60 insertions(+), 53 deletions(-) diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainDetailMaterialManager.cpp b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainDetailMaterialManager.cpp index 2bc9e42bff..1f43b476a1 100644 --- a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainDetailMaterialManager.cpp +++ b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainDetailMaterialManager.cpp @@ -751,50 +751,56 @@ namespace Terrain pixels.resize((quadrantWorldArea.m_max.m_x - quadrantWorldArea.m_min.m_x) * (quadrantWorldArea.m_max.m_y - quadrantWorldArea.m_min.m_y)); uint32_t index = 0; - for (int yPos = quadrantWorldArea.m_min.m_y; yPos < quadrantWorldArea.m_max.m_y; ++yPos) + auto perPositionCallback = [this, &pixels, &index]( + [[maybe_unused]] size_t xIndex, [[maybe_unused]] size_t yIndex, + const AzFramework::SurfaceData::SurfacePoint& surfacePoint, + [[maybe_unused]] bool terrainExists) { - for (int xPos = quadrantWorldArea.m_min.m_x; xPos < quadrantWorldArea.m_max.m_x; ++xPos) + // Store the top two surface weights in the texture with m_blend storing the relative weight. + bool isFirstMaterial = true; + float firstWeight = 0.0f; + AZ::Vector2 position(surfacePoint.m_position.GetX(), surfacePoint.m_position.GetY()); + for (const auto& surfaceTagWeight : surfacePoint.m_surfaceTags) { - AZ::Vector2 position = AZ::Vector2(xPos * DetailTextureScale, yPos * DetailTextureScale); - AzFramework::SurfaceData::SurfaceTagWeightList surfaceWeights; - AzFramework::Terrain::TerrainDataRequestBus::Broadcast(&AzFramework::Terrain::TerrainDataRequests::GetSurfaceWeightsFromVector2, position, surfaceWeights, AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT, nullptr); - - // Store the top two surface weights in the texture with m_blend storing the relative weight. - bool isFirstMaterial = true; - float firstWeight = 0.0f; - for (const auto& surfaceTagWeight : surfaceWeights) + if (surfaceTagWeight.m_weight > 0.0f) { - if (surfaceTagWeight.m_weight > 0.0f) + AZ::Crc32 surfaceType = surfaceTagWeight.m_surfaceType; + uint16_t materialId = GetDetailMaterialForSurfaceTypeAndPosition(surfaceType, position); + if (materialId != m_detailMaterials.NoFreeSlot && materialId < 255) { - AZ::Crc32 surfaceType = surfaceTagWeight.m_surfaceType; - uint16_t materialId = GetDetailMaterialForSurfaceTypeAndPosition(surfaceType, position); - if (materialId != m_detailMaterials.NoFreeSlot && materialId < 255) + if (isFirstMaterial) { - if (isFirstMaterial) - { - pixels.at(index).m_material1 = aznumeric_cast(materialId); - firstWeight = surfaceTagWeight.m_weight; - // m_blend only needs to be calculated is material 2 is found, otherwise the initial value of 0 is correct. - isFirstMaterial = false; - } - else - { - pixels.at(index).m_material2 = aznumeric_cast(materialId); - float totalWeight = firstWeight + surfaceTagWeight.m_weight; - float blendWeight = 1.0f - (firstWeight / totalWeight); - pixels.at(index).m_blend = aznumeric_cast(AZStd::round(blendWeight * 255.0f)); - break; - } + pixels.at(index).m_material1 = aznumeric_cast(materialId); + firstWeight = surfaceTagWeight.m_weight; + // m_blend only needs to be calculated is material 2 is found, otherwise the initial value of 0 is correct. + isFirstMaterial = false; + } + else + { + pixels.at(index).m_material2 = aznumeric_cast(materialId); + float totalWeight = firstWeight + surfaceTagWeight.m_weight; + float blendWeight = 1.0f - (firstWeight / totalWeight); + pixels.at(index).m_blend = aznumeric_cast(AZStd::round(blendWeight * 255.0f)); + break; } - } - else - { - break; // since the list is ordered, no other materials are in the list with positive weights. } } - ++index; + else + { + break; // since the list is ordered, no other materials are in the list with positive weights. + } } - } + ++index; + }; + + AZ::Vector3 worldMin(quadrantWorldArea.m_min.m_x * DetailTextureScale, quadrantWorldArea.m_min.m_y * DetailTextureScale, 0.0f); + AZ::Vector3 worldMax(quadrantWorldArea.m_max.m_x * DetailTextureScale, quadrantWorldArea.m_max.m_y * DetailTextureScale, 0.0f); + AZ::Vector2 stepSize(DetailTextureScale); + AZ::Aabb region; + region.Set(worldMin, worldMax); + + AzFramework::Terrain::TerrainDataRequestBus::Broadcast(&AzFramework::Terrain::TerrainDataRequests::ProcessSurfaceWeightsFromRegion, + region, stepSize, perPositionCallback, AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT); const int32_t left = quadrantTextureArea.m_min.m_x; const int32_t top = quadrantTextureArea.m_min.m_y; diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainFeatureProcessor.cpp b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainFeatureProcessor.cpp index 351c34308a..ebc8a16fcb 100644 --- a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainFeatureProcessor.cpp +++ b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainFeatureProcessor.cpp @@ -226,25 +226,26 @@ namespace Terrain auto& surfaceDataContext = SurfaceData::SurfaceDataSystemRequestBus::GetOrCreateContext(false); typename SurfaceData::SurfaceDataSystemRequestBus::Context::DispatchLockGuard scopeLock(surfaceDataContext.m_contextMutex); - for (int32_t y = yStart; y < yEnd; y++) + auto perPositionCallback = [this, &pixels] + ([[maybe_unused]] size_t xIndex, [[maybe_unused]] size_t yIndex, + const AzFramework::SurfaceData::SurfacePoint& surfacePoint, + [[maybe_unused]] bool terrainExists) { - for (int32_t x = xStart; x < xEnd; x++) - { - bool terrainExists = true; - float terrainHeight = 0.0f; - float xPos = x * m_sampleSpacing; - float yPos = y * m_sampleSpacing; - AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( - terrainHeight, &AzFramework::Terrain::TerrainDataRequests::GetHeightFromFloats, - xPos, yPos, AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT, &terrainExists); - - const float clampedHeight = AZ::GetClamp((terrainHeight - m_terrainBounds.GetMin().GetZ()) / m_terrainBounds.GetExtents().GetZ(), 0.0f, 1.0f); - const float expandedHeight = AZStd::roundf(clampedHeight * AZStd::numeric_limits::max()); - const uint16_t uint16Height = aznumeric_cast(expandedHeight); - - pixels.push_back(uint16Height); - } - } + const float clampedHeight = AZ::GetClamp((surfacePoint.m_position.GetZ() - m_terrainBounds.GetMin().GetZ()) / m_terrainBounds.GetExtents().GetZ(), 0.0f, 1.0f); + const float expandedHeight = AZStd::roundf(clampedHeight * AZStd::numeric_limits::max()); + const uint16_t uint16Height = aznumeric_cast(expandedHeight); + + pixels.push_back(uint16Height); + }; + + AZ::Vector2 stepSize(m_sampleSpacing); + AZ::Vector3 maxBound( + m_dirtyRegion.GetMax().GetX() + m_sampleSpacing, m_dirtyRegion.GetMax().GetY() + m_sampleSpacing, 0.0f); + AZ::Aabb region; + region.Set(m_dirtyRegion.GetMin(), maxBound); + AzFramework::Terrain::TerrainDataRequestBus::Broadcast( + &AzFramework::Terrain::TerrainDataRequests::ProcessHeightsFromRegion, + region, stepSize, perPositionCallback,AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT); } if (m_heightmapImage) From c1bbe3806db1cb4dea1eea710a1c9fbd8ef2bb67 Mon Sep 17 00:00:00 2001 From: Ignacio Martinez <82394219+AMZN-Igarri@users.noreply.github.com> Date: Tue, 18 Jan 2022 13:29:06 +0100 Subject: [PATCH 510/948] Asset Browser Search Entries Highlight (#6133) * Adding hilight to search entries Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * Delegate Cleanup Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * delegate cleanup Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * General cleanup Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * reformatting file Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * Updated Comments Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * Abstracted richText functions Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * Extracting highlighting behavior Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * Added highlighter to the entity outliner Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * Addressed Code Review Comments Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * Switched to static functions Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * changed variable name Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * Removed unused variable Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * Apply changes to the Entity Outliner Model Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * Removed duplicated line Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> --- .../AzAssetBrowser/AzAssetBrowserWindow.cpp | 4 ++ .../UI/Outliner/OutlinerListModel.cpp | 22 ++------ .../AssetBrowser/AssetBrowserFilterModel.cpp | 5 ++ .../AssetBrowser/AssetBrowserFilterModel.h | 4 +- .../AssetBrowser/AssetBrowserModel.cpp | 16 ++++++ .../AssetBrowser/AssetBrowserModel.h | 9 ++- .../AssetBrowser/Search/Filter.cpp | 5 ++ .../AssetBrowser/Search/Filter.h | 1 + .../Views/AssetBrowserTableView.cpp | 1 + .../AssetBrowser/Views/EntryDelegate.cpp | 27 +++++++-- .../AssetBrowser/Views/EntryDelegate.h | 3 +- .../Editor/RichTextHighlighter.cpp | 55 +++++++++++++++++++ .../Editor/RichTextHighlighter.h | 36 ++++++++++++ .../UI/Outliner/EntityOutlinerListModel.cpp | 30 +--------- .../aztoolsframework_files.cmake | 2 + 15 files changed, 167 insertions(+), 53 deletions(-) create mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/Editor/RichTextHighlighter.cpp create mode 100644 Code/Framework/AzToolsFramework/AzToolsFramework/Editor/RichTextHighlighter.h diff --git a/Code/Editor/AzAssetBrowser/AzAssetBrowserWindow.cpp b/Code/Editor/AzAssetBrowser/AzAssetBrowserWindow.cpp index bcaaa02b67..a7faea36f6 100644 --- a/Code/Editor/AzAssetBrowser/AzAssetBrowserWindow.cpp +++ b/Code/Editor/AzAssetBrowser/AzAssetBrowserWindow.cpp @@ -17,6 +17,7 @@ #include #include #include +#include // AzQtComponents #include @@ -83,6 +84,9 @@ AzAssetBrowserWindow::AzAssetBrowserWindow(QWidget* parent) m_ui->m_assetBrowserTableViewWidget->setVisible(false); m_ui->m_toggleDisplayViewBtn->setVisible(false); m_ui->m_searchWidget->SetFilterInputInterval(AZStd::chrono::milliseconds(250)); + + m_assetBrowserModel->SetFilterModel(m_filterModel.data()); + if (ed_useNewAssetBrowserTableView) { m_ui->m_toggleDisplayViewBtn->setVisible(true); diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerListModel.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerListModel.cpp index 08d79adcf5..1c361b050d 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerListModel.cpp +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerListModel.cpp @@ -53,6 +53,7 @@ #include #include #include +#include #include "OutlinerDisplayOptionsMenu.h" #include "OutlinerSortFilterProxyModel.hxx" @@ -252,17 +253,7 @@ QVariant OutlinerListModel::dataForName(const QModelIndex& index, int role) cons if (s_paintingName && !m_filterString.empty()) { // highlight characters in filter - int highlightTextIndex = 0; - do - { - highlightTextIndex = label.lastIndexOf(QString(m_filterString.c_str()), highlightTextIndex - 1, Qt::CaseInsensitive); - if (highlightTextIndex >= 0) - { - const QString BACKGROUND_COLOR{ "#707070" }; - label.insert(static_cast(highlightTextIndex + m_filterString.length()), ""); - label.insert(highlightTextIndex, ""); - } - } while(highlightTextIndex > 0); + label = AzToolsFramework::RichTextHighlighter::HighlightText(label, m_filterString.c_str()); } return label; } @@ -2609,16 +2600,11 @@ void OutlinerItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem& optionV4.widget->style()->drawControl(QStyle::CE_ItemViewItem, &optionV4, painter); // Now we setup a Text Document so it can draw the rich text - QTextDocument textDoc; - textDoc.setDefaultFont(optionV4.font); - textDoc.setDefaultStyleSheet("body {color: white}"); - textDoc.setHtml("" + entityNameRichText + ""); int verticalOffset = GetEntityNameVerticalOffset(entityId); painter->translate(textRect.topLeft() + QPoint(0, verticalOffset)); - textDoc.setTextWidth(textRect.width()); - textDoc.drawContents(painter, QRectF(0, 0, textRect.width(), textRect.height())); - painter->restore(); + AzToolsFramework::RichTextHighlighter::PaintHighlightedRichText(entityNameRichText, painter, optionV4, textRect); + OutlinerListModel::s_paintingName = false; } else diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserFilterModel.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserFilterModel.cpp index c6772ea2d7..21229e5570 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserFilterModel.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserFilterModel.cpp @@ -68,6 +68,11 @@ namespace AzToolsFramework } } + QSharedPointer AssetBrowserFilterModel::GetStringFilter() const + { + return m_stringFilter; + } + bool AssetBrowserFilterModel::filterAcceptsRow(int source_row, const QModelIndex& source_parent) const { //get the source idx, if invalid early out diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserFilterModel.h b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserFilterModel.h index 5d3ad0e1b0..cafe694ad6 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserFilterModel.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserFilterModel.h @@ -48,7 +48,7 @@ namespace AzToolsFramework // AssetBrowserComponentNotificationBus ////////////////////////////////////////////////////////////////////////// void OnAssetBrowserComponentReady() override; - + QSharedPointer GetStringFilter() const; Q_SIGNALS: void filterChanged(); ////////////////////////////////////////////////////////////////////////// @@ -70,7 +70,7 @@ namespace AzToolsFramework //Asset source name match filter FilterConstType m_filter; AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") // 4251: class '...' needs to have dll-interface to be used by clients of class '...' - QWeakPointer m_stringFilter; + QSharedPointer m_stringFilter; QWeakPointer m_assetTypeFilter; QCollator m_collator; // cache the collator as its somewhat expensive to constantly create and destroy one. AZ_POP_DISABLE_WARNING diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserModel.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserModel.cpp index f0e1520aab..fd05543097 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserModel.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserModel.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") // 'QRegularExpression::d': class 'QExplicitlySharedDataPointer' needs to have dll-interface to be used by clients of class 'QRegularExpression' @@ -268,6 +269,21 @@ namespace AzToolsFramework m_rootEntry = rootEntry; } + AssetBrowserFilterModel* AssetBrowserModel::GetFilterModel() + { + return m_filterModel; + } + + const AssetBrowserFilterModel* AssetBrowserModel::GetFilterModel() const + { + return m_filterModel; + } + + void AssetBrowser::AssetBrowserModel::SetFilterModel(AssetBrowserFilterModel* filterModel) + { + m_filterModel = filterModel; + } + QModelIndex AssetBrowserModel::parent(const QModelIndex& child) const { if (!child.isValid()) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserModel.h b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserModel.h index c46b73417c..2905844a23 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserModel.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetBrowserModel.h @@ -35,6 +35,7 @@ namespace AzToolsFramework class AssetBrowserEntry; class RootAssetBrowserEntry; class AssetEntryChangeset; + class AssetBrowserFilterModel; class AssetBrowserModel : public QAbstractItemModel @@ -75,7 +76,7 @@ namespace AzToolsFramework void EndAddEntry(AssetBrowserEntry* parent) override; void BeginRemoveEntry(AssetBrowserEntry* entry) override; void EndRemoveEntry() override; - + ////////////////////////////////////////////////////////////////////////// // TickBus ////////////////////////////////////////////////////////////////////////// @@ -84,10 +85,16 @@ namespace AzToolsFramework AZStd::shared_ptr GetRootEntry() const; void SetRootEntry(AZStd::shared_ptr rootEntry); + AssetBrowserFilterModel* GetFilterModel(); + const AssetBrowserFilterModel* GetFilterModel() const; + void SetFilterModel(AssetBrowserFilterModel* filterModel); + static void SourceIndexesToAssetIds(const QModelIndexList& indexes, AZStd::vector& assetIds); static void SourceIndexesToAssetDatabaseEntries(const QModelIndexList& indexes, AZStd::vector& entries); private: + //Non owning pointer + AssetBrowserFilterModel* m_filterModel = nullptr; AZStd::shared_ptr m_rootEntry; bool m_loaded; bool m_addingEntry; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/Filter.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/Filter.cpp index d617638632..4ec26d4c3d 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/Filter.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/Filter.cpp @@ -229,6 +229,11 @@ namespace AzToolsFramework Q_EMIT updatedSignal(); } + QString StringFilter::GetFilterString() const + { + return m_filterString; + } + QString StringFilter::GetNameInternal() const { return m_filterString; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/Filter.h b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/Filter.h index 94f47e0599..1d93d4d0cf 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/Filter.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/Filter.h @@ -106,6 +106,7 @@ namespace AzToolsFramework ~StringFilter() override = default; void SetFilterString(const QString& filterString); + QString GetFilterString() const; protected: QString GetNameInternal() const override; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/AssetBrowserTableView.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/AssetBrowserTableView.cpp index cfcac579ff..a913009da0 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/AssetBrowserTableView.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/AssetBrowserTableView.cpp @@ -66,6 +66,7 @@ namespace AzToolsFramework m_tableModel = qobject_cast(model); AZ_Assert(m_tableModel, "Expecting AssetBrowserTableModel"); m_sourceFilterModel = qobject_cast(m_tableModel->sourceModel()); + m_delegate->Init(); AzQtComponents::TableView::setModel(model); connect(m_tableModel, &AssetBrowserTableModel::layoutChanged, this, &AssetBrowserTableView::layoutChangedSlot); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/EntryDelegate.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/EntryDelegate.cpp index 8b58791e68..8e69d5f788 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/EntryDelegate.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/EntryDelegate.cpp @@ -9,12 +9,16 @@ #include #include #include +#include #include #include #include #include +#include #include +#include + AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // 4251: class 'QScopedPointer' needs to have dll-interface to be used by clients of class 'QBrush' // 4800: 'uint': forcing value to bool 'true' or 'false' (performance warning) #include @@ -160,13 +164,20 @@ namespace AzToolsFramework LoadBranchPixMaps(); } + void SearchEntryDelegate::Init() + { + AssetBrowserModel* assetBrowserModel; + AssetBrowserComponentRequestBus::BroadcastResult(assetBrowserModel, &AssetBrowserComponentRequests::GetAssetBrowserModel); + AZ_Assert(assetBrowserModel, "Failed to get filebrowser model"); + m_assetBrowserFilerModel = assetBrowserModel->GetFilterModel(); + } + void SearchEntryDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const { auto data = index.data(AssetBrowserModel::Roles::EntryRole); if (data.canConvert()) { bool isEnabled = (option.state & QStyle::State_Enabled) != 0; - bool isSelected = (option.state & QStyle::State_Selected) != 0; QStyle* style = option.widget ? option.widget->style() : QApplication::style(); @@ -265,13 +276,21 @@ namespace AzToolsFramework remainingRect.adjust(thumbX, 0, 0, 0); // bump it to the right by the size of the thumbnail remainingRect.adjust(EntrySpacingLeftPixels, 0, 0, 0); // bump it to the right by the spacing. } + QString displayString = index.column() == aznumeric_cast(AssetBrowserEntry::Column::Name) ? qvariant_cast(entry->data(aznumeric_cast(AssetBrowserEntry::Column::Name))) : qvariant_cast(entry->data(aznumeric_cast(AssetBrowserEntry::Column::Path))); - style->drawItemText( - painter, remainingRect, option.displayAlignment, actualPalette, isEnabled, displayString, - isSelected ? QPalette::HighlightedText : QPalette::Text); + QStyleOptionViewItem optionV4{ option }; + initStyleOption(&optionV4, index); + optionV4.state &= ~(QStyle::State_HasFocus | QStyle::State_Selected); + + if (m_assetBrowserFilerModel && m_assetBrowserFilerModel->GetStringFilter() + && !m_assetBrowserFilerModel->GetStringFilter()->GetFilterString().isEmpty()) + { + displayString = RichTextHighlighter::HighlightText(displayString, m_assetBrowserFilerModel->GetStringFilter()->GetFilterString()); + } + RichTextHighlighter::PaintHighlightedRichText(displayString, painter, optionV4, remainingRect); } } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/EntryDelegate.h b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/EntryDelegate.h index ac68c19248..7c7d919f2d 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/EntryDelegate.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/EntryDelegate.h @@ -70,7 +70,7 @@ namespace AzToolsFramework Q_OBJECT public: explicit SearchEntryDelegate(QWidget* parent = nullptr); - + void Init(); void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const override; private: @@ -78,6 +78,7 @@ namespace AzToolsFramework void DrawBranchPixMap(EntryBranchType branchType, QPainter* painter, const QPoint& point, const QSize& size) const; private: + AssetBrowserFilterModel* m_assetBrowserFilerModel; QMap m_branchIcons; }; } // namespace AssetBrowser diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Editor/RichTextHighlighter.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Editor/RichTextHighlighter.cpp new file mode 100644 index 0000000000..8b28298c3d --- /dev/null +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Editor/RichTextHighlighter.cpp @@ -0,0 +1,55 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include "RichTextHighlighter.h" + +namespace AzToolsFramework +{ + + QString RichTextHighlighter::HighlightText(const QString& displayString, const QString& matchingSubstring) + { + QString highlightedString = displayString; + int highlightTextIndex = 0; + do + { + highlightTextIndex = highlightedString.lastIndexOf(matchingSubstring, highlightTextIndex - 1, Qt::CaseInsensitive); + if (highlightTextIndex >= 0) + { + const QString backgroundColor{ "#707070" }; + highlightedString.insert(static_cast(highlightTextIndex + matchingSubstring.length()), ""); + highlightedString.insert(highlightTextIndex, ""); + } + } while (highlightTextIndex > 0); + + return highlightedString; + } + + void RichTextHighlighter::PaintHighlightedRichText(const QString& highlightedString,QPainter* painter, QStyleOptionViewItem option, QRect availableRect) + { + painter->save(); + painter->setRenderHint(QPainter::Antialiasing); + + // Now we setup a Text Document so it can draw the rich text + QTextDocument textDoc; + textDoc.setDefaultFont(option.font); + if (option.state & QStyle::State_Enabled) + { + textDoc.setDefaultStyleSheet("body {color: white}"); + } + else + { + textDoc.setDefaultStyleSheet("body {color: #7C7C7C}"); + } + textDoc.setHtml("" + highlightedString + ""); + painter->translate(availableRect.topLeft()); + textDoc.setTextWidth(availableRect.width()); + textDoc.drawContents(painter, QRectF(0, 0, availableRect.width(), availableRect.height())); + + painter->restore(); + } +} // namespace AzToolsFramework diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Editor/RichTextHighlighter.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Editor/RichTextHighlighter.h new file mode 100644 index 0000000000..b5c1859497 --- /dev/null +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Editor/RichTextHighlighter.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include +#include +#include +#include + +AZ_PUSH_DISABLE_WARNING(4251 4800,"-Wunknown-warning-option") // 4251: class 'QScopedPointer' needs to have dll-interface to be used + // by clients of class 'QBrush' 4800: 'uint': forcing value to bool 'true' or 'false' (performance warning) +#include +AZ_POP_DISABLE_WARNING + +namespace AzToolsFramework +{ + //! @class RichTextHighlighter + //! @brief Highlights a given string given a matching substring. + class RichTextHighlighter + { + public: + AZ_CLASS_ALLOCATOR(RichTextHighlighter, AZ::SystemAllocator, 0); + RichTextHighlighter() = delete; + + static QString HighlightText(const QString& displayString, const QString& matchingSubstring); + static void PaintHighlightedRichText(const QString& highlightedString,QPainter* painter, QStyleOptionViewItem option, QRect availableRect); + + }; +} // namespace AzToolsFramework diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerListModel.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerListModel.cpp index 056f16c52f..e0060e2b42 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerListModel.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerListModel.cpp @@ -66,6 +66,7 @@ #include #include #include +#include //////////////////////////////////////////////////////////////////////////// // EntityOutlinerListModel @@ -259,17 +260,7 @@ namespace AzToolsFramework if (s_paintingName && !m_filterString.empty()) { // highlight characters in filter - int highlightTextIndex = 0; - do - { - highlightTextIndex = label.lastIndexOf(QString(m_filterString.c_str()), highlightTextIndex - 1, Qt::CaseInsensitive); - if (highlightTextIndex >= 0) - { - const QString BACKGROUND_COLOR{ "#707070" }; - label.insert(highlightTextIndex + static_cast(m_filterString.length()), ""); - label.insert(highlightTextIndex, ""); - } - } while(highlightTextIndex > 0); + label = AzToolsFramework::RichTextHighlighter::HighlightText(label, m_filterString.c_str()); } return label; } @@ -2375,23 +2366,8 @@ namespace AzToolsFramework optionV4.text.clear(); optionV4.widget->style()->drawControl(QStyle::CE_ItemViewItem, &optionV4, painter); - // Now we setup a Text Document so it can draw the rich text - QTextDocument textDoc; - textDoc.setDefaultFont(optionV4.font); - if (option.state & QStyle::State_Enabled) - { - textDoc.setDefaultStyleSheet("body {color: white}"); - } - else - { - textDoc.setDefaultStyleSheet("body {color: #7C7C7C}"); - } - textDoc.setHtml("" + entityNameRichText + ""); - painter->translate(textRect.topLeft()); - textDoc.setTextWidth(textRect.width()); - textDoc.drawContents(painter, QRectF(0, 0, textRect.width(), textRect.height())); + AzToolsFramework::RichTextHighlighter::PaintHighlightedRichText(entityNameRichText, painter, optionV4, textRect); - painter->restore(); EntityOutlinerListModel::s_paintingName = false; } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake index 05c07afecd..0d7bf05211 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake @@ -123,6 +123,8 @@ set(FILES ContainerEntity/ContainerEntitySystemComponent.h Editor/EditorContextMenuBus.h Editor/EditorSettingsAPIBus.h + Editor/RichTextHighlighter.h + Editor/RichTextHighlighter.cpp Entity/EditorEntityStartStatus.h Entity/EditorEntityAPIBus.h Entity/EditorEntityContextComponent.cpp From e166479bb7c77e0d0ebc391ff9bc9d2835ebb5eb Mon Sep 17 00:00:00 2001 From: Ignacio Martinez <82394219+AMZN-Igarri@users.noreply.github.com> Date: Tue, 18 Jan 2022 16:47:27 +0100 Subject: [PATCH 511/948] Fixed Camera angle on switch levels (#6954) Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> --- Code/Editor/EditorViewportWidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Editor/EditorViewportWidget.cpp b/Code/Editor/EditorViewportWidget.cpp index e9a57dba4f..a8180bcace 100644 --- a/Code/Editor/EditorViewportWidget.cpp +++ b/Code/Editor/EditorViewportWidget.cpp @@ -582,11 +582,11 @@ void EditorViewportWidget::OnEditorNotifyEvent(EEditorNotifyEvent event) case eNotify_OnCloseScene: m_renderViewport->SetScene(nullptr); - SetDefaultCamera(); break; case eNotify_OnEndSceneOpen: UpdateScene(); + SetDefaultCamera(); break; case eNotify_OnBeginNewScene: From 338eecd9e687815a56bca750a3f830e22a944976 Mon Sep 17 00:00:00 2001 From: moraaar Date: Tue, 18 Jan 2022 16:00:28 +0000 Subject: [PATCH 512/948] Blast memory allocator must allocate with 16 byte aligment (#6968) From Blast allocator documentation "Allocates size bytes of memory, which must be 16-byte aligned." https://gameworksdocs.nvidia.com/Blast/1.1/api_docs/files/class_nv_1_1_blast_1_1_allocator_callback.html Fixes #5162 Signed-off-by: moraaar moraaar@amazon.com --- Gems/Blast/Code/Source/Components/BlastSystemComponent.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Gems/Blast/Code/Source/Components/BlastSystemComponent.h b/Gems/Blast/Code/Source/Components/BlastSystemComponent.h index 8f6c200870..a3d4b200bc 100644 --- a/Gems/Blast/Code/Source/Components/BlastSystemComponent.h +++ b/Gems/Blast/Code/Source/Components/BlastSystemComponent.h @@ -100,11 +100,14 @@ namespace Blast class AZBlastAllocatorCallback : public Nv::Blast::AllocatorCallback { public: + // Blast requires 16-byte alignment + static const size_t alignment = 16; + void* allocate( size_t size, const char* typeName, [[maybe_unused]] const char* filename, [[maybe_unused]] int line) override { - return azmalloc_4(size, 0, AZ::SystemAllocator, typeName); + return azmalloc_4(size, alignment, AZ::SystemAllocator, typeName); } void deallocate(void* ptr) override From 27d256679ac7fb2d820afb0be5f678e11ac6dee3 Mon Sep 17 00:00:00 2001 From: Nicholas Lawson <70027408+lawsonamzn@users.noreply.github.com> Date: Tue, 18 Jan 2022 08:16:25 -0800 Subject: [PATCH 513/948] Update the package of Pybind11 that o3de points at to be the latest version (#6898) Signed-off-by: lawsonamzn <70027408+lawsonamzn@users.noreply.github.com> --- cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake | 2 +- cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake | 2 +- cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake b/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake index f1e8fdc950..d174f935e2 100644 --- a/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake +++ b/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake @@ -11,7 +11,7 @@ ly_associate_package(PACKAGE_NAME ilmbase-2.3.0-rev4-multiplatform ly_associate_package(PACKAGE_NAME md5-2.0-multiplatform TARGETS md5 PACKAGE_HASH 29e52ad22c78051551f78a40c2709594f0378762ae03b417adca3f4b700affdf) ly_associate_package(PACKAGE_NAME RapidJSON-1.1.0-rev1-multiplatform TARGETS RapidJSON PACKAGE_HASH 2f5e26ecf86c3b7a262753e7da69ac59928e78e9534361f3d00c1ad5879e4023) ly_associate_package(PACKAGE_NAME RapidXML-1.13-rev1-multiplatform TARGETS RapidXML PACKAGE_HASH 4b7b5651e47cfd019b6b295cc17bb147b65e53073eaab4a0c0d20a37ab74a246) -ly_associate_package(PACKAGE_NAME pybind11-2.4.3-rev2-multiplatform TARGETS pybind11 PACKAGE_HASH d8012f907b6c54ac990b899a0788280857e7c93a9595405a28114b48c354eb1b) +ly_associate_package(PACKAGE_NAME pybind11-2.4.3-rev3-multiplatform TARGETS pybind11 PACKAGE_HASH dccb5546607b8b31cd207033aaf24ab044ce6e188a9f12411236a010f9e0c4ff) ly_associate_package(PACKAGE_NAME cityhash-1.1-multiplatform TARGETS cityhash PACKAGE_HASH 0ace9e6f0b2438c5837510032d2d4109125845c0efd7d807f4561ec905512dd2) ly_associate_package(PACKAGE_NAME expat-2.1.0-multiplatform TARGETS expat PACKAGE_HASH 452256acd1fd699cef24162575b3524fccfb712f5321c83f1df1ce878de5b418) ly_associate_package(PACKAGE_NAME zstd-1.35-multiplatform TARGETS zstd PACKAGE_HASH 45d466c435f1095898578eedde85acf1fd27190e7ea99aeaa9acfd2f09e12665) diff --git a/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake b/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake index 575a2dd70e..95f7c89930 100644 --- a/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake +++ b/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake @@ -11,7 +11,7 @@ ly_associate_package(PACKAGE_NAME ilmbase-2.3.0-rev4-multiplatform ly_associate_package(PACKAGE_NAME md5-2.0-multiplatform TARGETS md5 PACKAGE_HASH 29e52ad22c78051551f78a40c2709594f0378762ae03b417adca3f4b700affdf) ly_associate_package(PACKAGE_NAME RapidJSON-1.1.0-rev1-multiplatform TARGETS RapidJSON PACKAGE_HASH 2f5e26ecf86c3b7a262753e7da69ac59928e78e9534361f3d00c1ad5879e4023) ly_associate_package(PACKAGE_NAME RapidXML-1.13-rev1-multiplatform TARGETS RapidXML PACKAGE_HASH 4b7b5651e47cfd019b6b295cc17bb147b65e53073eaab4a0c0d20a37ab74a246) -ly_associate_package(PACKAGE_NAME pybind11-2.4.3-rev2-multiplatform TARGETS pybind11 PACKAGE_HASH d8012f907b6c54ac990b899a0788280857e7c93a9595405a28114b48c354eb1b) +ly_associate_package(PACKAGE_NAME pybind11-2.4.3-rev3-multiplatform TARGETS pybind11 PACKAGE_HASH dccb5546607b8b31cd207033aaf24ab044ce6e188a9f12411236a010f9e0c4ff) ly_associate_package(PACKAGE_NAME cityhash-1.1-multiplatform TARGETS cityhash PACKAGE_HASH 0ace9e6f0b2438c5837510032d2d4109125845c0efd7d807f4561ec905512dd2) ly_associate_package(PACKAGE_NAME expat-2.1.0-multiplatform TARGETS expat PACKAGE_HASH 452256acd1fd699cef24162575b3524fccfb712f5321c83f1df1ce878de5b418) ly_associate_package(PACKAGE_NAME zstd-1.35-multiplatform TARGETS zstd PACKAGE_HASH 45d466c435f1095898578eedde85acf1fd27190e7ea99aeaa9acfd2f09e12665) diff --git a/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake b/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake index 7fd07927cc..1f7cb8d28f 100644 --- a/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake +++ b/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake @@ -11,7 +11,7 @@ ly_associate_package(PACKAGE_NAME ilmbase-2.3.0-rev4-multiplatform ly_associate_package(PACKAGE_NAME md5-2.0-multiplatform TARGETS md5 PACKAGE_HASH 29e52ad22c78051551f78a40c2709594f0378762ae03b417adca3f4b700affdf) ly_associate_package(PACKAGE_NAME RapidJSON-1.1.0-rev1-multiplatform TARGETS RapidJSON PACKAGE_HASH 2f5e26ecf86c3b7a262753e7da69ac59928e78e9534361f3d00c1ad5879e4023) ly_associate_package(PACKAGE_NAME RapidXML-1.13-rev1-multiplatform TARGETS RapidXML PACKAGE_HASH 4b7b5651e47cfd019b6b295cc17bb147b65e53073eaab4a0c0d20a37ab74a246) -ly_associate_package(PACKAGE_NAME pybind11-2.4.3-rev2-multiplatform TARGETS pybind11 PACKAGE_HASH d8012f907b6c54ac990b899a0788280857e7c93a9595405a28114b48c354eb1b) +ly_associate_package(PACKAGE_NAME pybind11-2.4.3-rev3-multiplatform TARGETS pybind11 PACKAGE_HASH dccb5546607b8b31cd207033aaf24ab044ce6e188a9f12411236a010f9e0c4ff) ly_associate_package(PACKAGE_NAME cityhash-1.1-multiplatform TARGETS cityhash PACKAGE_HASH 0ace9e6f0b2438c5837510032d2d4109125845c0efd7d807f4561ec905512dd2) ly_associate_package(PACKAGE_NAME expat-2.1.0-multiplatform TARGETS expat PACKAGE_HASH 452256acd1fd699cef24162575b3524fccfb712f5321c83f1df1ce878de5b418) ly_associate_package(PACKAGE_NAME zstd-1.35-multiplatform TARGETS zstd PACKAGE_HASH 45d466c435f1095898578eedde85acf1fd27190e7ea99aeaa9acfd2f09e12665) From 74623bb1d7c56f5a91ccaa40b8b1de1538aaa462 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Tue, 18 Jan 2022 10:21:54 -0600 Subject: [PATCH 514/948] Removed some more unused Editor code and images Signed-off-by: Chris Galvan --- .../PropertyGenericCtrl.cpp | 1 - Code/Editor/CrtDebug.cpp | 170 ------- Code/Editor/CryEdit.cpp | 16 - Code/Editor/CryEdit.h | 1 - Code/Editor/CryEditDoc.cpp | 26 +- Code/Editor/CryEditDoc.h | 3 - Code/Editor/CryEditLiveCreate.rc | 213 -------- Code/Editor/DimensionsDialog.cpp | 71 --- Code/Editor/DimensionsDialog.h | 47 -- Code/Editor/DimensionsDialog.ui | 120 ----- Code/Editor/GameEngine.cpp | 2 - Code/Editor/MainWindow.qrc | 30 -- Code/Editor/NewLevelDialog.cpp | 3 - Code/Editor/NewTerrainDialog.cpp | 168 ------- Code/Editor/NewTerrainDialog.h | 71 --- Code/Editor/NewTerrainDialog.ui | 112 ----- Code/Editor/PakManagerDlg.qrc | 6 - Code/Editor/PakManagerDlg.ui | 202 -------- Code/Editor/SelectEAXPresetDlg.cpp | 67 --- Code/Editor/SelectEAXPresetDlg.h | 43 -- Code/Editor/SelectEAXPresetDlg.ui | 67 --- Code/Editor/SurfaceTypeValidator.cpp | 23 - Code/Editor/SurfaceTypeValidator.h | 24 - Code/Editor/UndoViewPosition.cpp | 67 --- Code/Editor/UndoViewPosition.h | 36 -- Code/Editor/UndoViewRotation.cpp | 78 --- Code/Editor/UndoViewRotation.h | 39 -- Code/Editor/UserMessageDefines.h | 60 --- Code/Editor/ViewPane.cpp | 1 - Code/Editor/WipFeatureManager.cpp | 454 ------------------ Code/Editor/WipFeatureManager.h | 162 ------- Code/Editor/WipFeaturesDlg.cpp | 239 --------- Code/Editor/WipFeaturesDlg.h | 58 --- Code/Editor/WipFeaturesDlg.qrc | 5 - Code/Editor/WipFeaturesDlg.ui | 184 ------- Code/Editor/arhitype_tree_00.png | 3 - Code/Editor/arhitype_tree_01.png | 3 - Code/Editor/arhitype_tree_02.png | 3 - Code/Editor/arhitype_tree_03.png | 3 - Code/Editor/bmp00005_00.png | 3 - Code/Editor/bmp00005_01.png | 3 - Code/Editor/bmp00005_02.png | 3 - Code/Editor/bmp00005_03.png | 3 - Code/Editor/bmp00005_04.png | 3 - Code/Editor/bmp00005_05.png | 3 - Code/Editor/bmp00005_06.png | 3 - Code/Editor/bmp00005_07.png | 3 - Code/Editor/bmp00005_08.png | 3 - Code/Editor/bmp00005_09.png | 3 - Code/Editor/bmp00006_00.png | 3 - Code/Editor/bmp00006_01.png | 3 - Code/Editor/bmp00006_02.png | 3 - Code/Editor/bmp00006_03.png | 3 - Code/Editor/bmp00006_04.png | 3 - Code/Editor/bmp00006_05.png | 3 - Code/Editor/bmp00006_06.png | 3 - Code/Editor/bmp00006_07.png | 3 - Code/Editor/editor_lib_files.cmake | 20 - Code/Editor/particles_tree_00.png | 3 - Code/Editor/particles_tree_01.png | 3 - Code/Editor/particles_tree_02.png | 3 - Code/Editor/particles_tree_03.png | 3 - Code/Editor/particles_tree_04.png | 3 - Code/Editor/particles_tree_05.png | 3 - Code/Editor/particles_tree_06.png | 3 - Code/Editor/particles_tree_07.png | 3 - 66 files changed, 1 insertion(+), 2978 deletions(-) delete mode 100644 Code/Editor/CrtDebug.cpp delete mode 100644 Code/Editor/CryEditLiveCreate.rc delete mode 100644 Code/Editor/DimensionsDialog.cpp delete mode 100644 Code/Editor/DimensionsDialog.h delete mode 100644 Code/Editor/DimensionsDialog.ui delete mode 100644 Code/Editor/NewTerrainDialog.cpp delete mode 100644 Code/Editor/NewTerrainDialog.h delete mode 100644 Code/Editor/NewTerrainDialog.ui delete mode 100644 Code/Editor/PakManagerDlg.qrc delete mode 100644 Code/Editor/PakManagerDlg.ui delete mode 100644 Code/Editor/SelectEAXPresetDlg.cpp delete mode 100644 Code/Editor/SelectEAXPresetDlg.h delete mode 100644 Code/Editor/SelectEAXPresetDlg.ui delete mode 100644 Code/Editor/SurfaceTypeValidator.cpp delete mode 100644 Code/Editor/SurfaceTypeValidator.h delete mode 100644 Code/Editor/UndoViewPosition.cpp delete mode 100644 Code/Editor/UndoViewPosition.h delete mode 100644 Code/Editor/UndoViewRotation.cpp delete mode 100644 Code/Editor/UndoViewRotation.h delete mode 100644 Code/Editor/UserMessageDefines.h delete mode 100644 Code/Editor/WipFeatureManager.cpp delete mode 100644 Code/Editor/WipFeatureManager.h delete mode 100644 Code/Editor/WipFeaturesDlg.cpp delete mode 100644 Code/Editor/WipFeaturesDlg.h delete mode 100644 Code/Editor/WipFeaturesDlg.qrc delete mode 100644 Code/Editor/WipFeaturesDlg.ui delete mode 100644 Code/Editor/arhitype_tree_00.png delete mode 100644 Code/Editor/arhitype_tree_01.png delete mode 100644 Code/Editor/arhitype_tree_02.png delete mode 100644 Code/Editor/arhitype_tree_03.png delete mode 100644 Code/Editor/bmp00005_00.png delete mode 100644 Code/Editor/bmp00005_01.png delete mode 100644 Code/Editor/bmp00005_02.png delete mode 100644 Code/Editor/bmp00005_03.png delete mode 100644 Code/Editor/bmp00005_04.png delete mode 100644 Code/Editor/bmp00005_05.png delete mode 100644 Code/Editor/bmp00005_06.png delete mode 100644 Code/Editor/bmp00005_07.png delete mode 100644 Code/Editor/bmp00005_08.png delete mode 100644 Code/Editor/bmp00005_09.png delete mode 100644 Code/Editor/bmp00006_00.png delete mode 100644 Code/Editor/bmp00006_01.png delete mode 100644 Code/Editor/bmp00006_02.png delete mode 100644 Code/Editor/bmp00006_03.png delete mode 100644 Code/Editor/bmp00006_04.png delete mode 100644 Code/Editor/bmp00006_05.png delete mode 100644 Code/Editor/bmp00006_06.png delete mode 100644 Code/Editor/bmp00006_07.png delete mode 100644 Code/Editor/particles_tree_00.png delete mode 100644 Code/Editor/particles_tree_01.png delete mode 100644 Code/Editor/particles_tree_02.png delete mode 100644 Code/Editor/particles_tree_03.png delete mode 100644 Code/Editor/particles_tree_04.png delete mode 100644 Code/Editor/particles_tree_05.png delete mode 100644 Code/Editor/particles_tree_06.png delete mode 100644 Code/Editor/particles_tree_07.png diff --git a/Code/Editor/Controls/ReflectedPropertyControl/PropertyGenericCtrl.cpp b/Code/Editor/Controls/ReflectedPropertyControl/PropertyGenericCtrl.cpp index 8ff83dd894..9609fb5014 100644 --- a/Code/Editor/Controls/ReflectedPropertyControl/PropertyGenericCtrl.cpp +++ b/Code/Editor/Controls/ReflectedPropertyControl/PropertyGenericCtrl.cpp @@ -24,7 +24,6 @@ // Editor #include "SelectLightAnimationDialog.h" #include "SelectSequenceDialog.h" -#include "SelectEAXPresetDlg.h" #include "QtViewPaneManager.h" AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING diff --git a/Code/Editor/CrtDebug.cpp b/Code/Editor/CrtDebug.cpp deleted file mode 100644 index f9335373da..0000000000 --- a/Code/Editor/CrtDebug.cpp +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include "EditorDefs.h" - - -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// - -//#ifdef _CRTDBG_MAP_ALLOC -#ifdef CRTDBG_MAP_ALLOC -#pragma pack (push,1) -#define nNoMansLandSize 4 -typedef struct MyCrtMemBlockHeader -{ - struct MyCrtMemBlockHeader* pBlockHeaderNext; - struct MyCrtMemBlockHeader* pBlockHeaderPrev; - char* szFileName; - int nLine; - size_t nDataSize; - int nBlockUse; - long lRequest; - unsigned char gap[nNoMansLandSize]; - /* followed by: - * unsigned char data[nDataSize]; - * unsigned char anotherGap[nNoMansLandSize]; - */ -} MyCrtMemBlockHeader; -#pragma pack (pop) - -#define pbData(pblock) ((unsigned char*)((MyCrtMemBlockHeader*)pblock + 1)) -#define pHdr(pbData) (((MyCrtMemBlockHeader*)pbData) - 1) - - -void crtdebug(const char* s, ...) -{ - char str[32768]; - va_list arg_ptr; - va_start(arg_ptr, s); - vsprintf(str, s, arg_ptr); - va_end(arg_ptr); - - FILE* l = nullptr; - azfopen(&l, "crtdump.txt", "a+t"); - if (l) - { - fprintf(l, "%s", str); - fclose(l); - } -} - -int crtAllocHook(int nAllocType, void* pvData, - size_t nSize, int nBlockUse, long lRequest, - const unsigned char* szFileName, int nLine) -{ - if (nBlockUse == _CRT_BLOCK) - { - return TRUE; - } - - static int total_cnt = 0; - static int total_mem = 0; - if (nAllocType == _HOOK_ALLOC) - { - //total_mem += nSize; - //total_cnt++; - //_CrtMemState mem_state; - //_CrtMemCheckpoint( &mem_state ); - //total_cnt = mem_state.lCounts[_NORMAL_BLOCK]; - //total_mem = mem_state.lTotalCount; - if ((total_cnt & 0xF) == 0) - { - //_CrtCheckMemory(); - } - - total_cnt++; - total_mem += nSize; - - //crtdebug( " Alloc %d,size=%d,in: %s %d (total size=%d,num=%d)\n",lRequest,nSize,szFileName,nLine,total_mem,total_cnt ); - crtdebug("Size=%d, [Total=%d,N=%d] [%s:%d]\n", nSize, total_mem, total_cnt, szFileName, nLine); - } - else if (nAllocType == _HOOK_FREE) - { - MyCrtMemBlockHeader* pHead; - pHead = pHdr(pvData); - - total_cnt--; - total_mem -= pHead->nDataSize; - - crtdebug("Size=%d, [Total=%d,N=%d] [%s:%d]\n", pHead->nDataSize, total_mem, total_cnt, pHead->szFileName, pHead->nLine); - //crtdebug( " Free size=%d,in: %s %d (total size=%d,num=%d)\n",pHead->nDataSize,pHead->szFileName,pHead->nLine,total_mem,total_cnt ); - //total_mem -= nSize; - //total_cnt--; - } - return TRUE; -} - -int crtReportHook(int nRptType, char* szMsg, int* retVal) -{ - static int gl_num_asserts = 0; - if (gl_num_asserts != 0) - { - return TRUE; - } - gl_num_asserts++; - switch (nRptType) - { - case _CRT_WARN: - crtdebug(" %s\n", szMsg); - break; - case _CRT_ERROR: - crtdebug(" %s\n", szMsg); - break; - case _CRT_ASSERT: - crtdebug(" %s\n", szMsg); - break; - } - gl_num_asserts--; - return TRUE; -} - -void InitCrt() -{ - FILE* l = nullptr; - azfopen(&l, "crtdump.txt", "w"); - if (l) - { - fclose(l); - } - - //_CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_DEBUG ); - //_CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_DEBUG ); - //_CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_DEBUG ); - - _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_WNDW); - _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_WNDW); - _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_WNDW); - - //_CrtSetDbgFlag( _CRTDBG_CHECK_ALWAYS_DF|_CRTDBG_CHECK_CRT_DF|_CRTDBG_LEAK_CHECK_DF|_CRTDBG_DELAY_FREE_MEM_DF | _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) ); - //_CrtSetDbgFlag( _CRTDBG_CHECK_CRT_DF|_CRTDBG_LEAK_CHECK_DF/*|_CRTDBG_DELAY_FREE_MEM_DF*/ | _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) ); - int flags = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); - flags &= ~_CRTDBG_DELAY_FREE_MEM_DF | _CRTDBG_LEAK_CHECK_DF | _CRTDBG_CHECK_CRT_DF; - - _CrtSetDbgFlag(flags); - - _CrtSetAllocHook (crtAllocHook); - _CrtSetReportHook(crtReportHook); -} - -void DoneCrt() -{ - //_CrtCheckMemory(); - //_CrtDumpMemoryLeaks(); -} - -// Autoinit CRT. -//struct __autoinit_crt { __autoinit_crt() { InitCrt(); }; ~__autoinit_crt() { DoneCrt(); } } __autoinit_crt_var; -#endif - - -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// diff --git a/Code/Editor/CryEdit.cpp b/Code/Editor/CryEdit.cpp index 1c4e22b99e..3beaf4d438 100644 --- a/Code/Editor/CryEdit.cpp +++ b/Code/Editor/CryEdit.cpp @@ -124,9 +124,6 @@ AZ_POP_DISABLE_WARNING #include "ScopedVariableSetter.h" #include "Util/3DConnexionDriver.h" - -#include "DimensionsDialog.h" - #include "Util/AutoDirectoryRestoreFileDialog.h" #include "Util/EditorAutoLevelLoadTest.h" #include "AboutDialog.h" @@ -1806,12 +1803,6 @@ bool CCryEditApp::InitInstance() InitLevel(cmdInfo); }); -#ifdef USE_WIP_FEATURES_MANAGER - // load the WIP features file - CWipFeatureManager::Instance()->EnableManager(!cmdInfo.m_bDeveloperMode); - CWipFeatureManager::Init(); -#endif - if (!m_bConsoleMode && !m_bPreviewMode) { GetIEditor()->UpdateViews(); @@ -2142,13 +2133,6 @@ int CCryEditApp::ExitInstance(int exitCode) } qobject_cast(qApp)->UnloadSettings(); - #ifdef USE_WIP_FEATURES_MANAGER - // - // close wip features manager - // - CWipFeatureManager::Shutdown(); - #endif - if (IsInRegularEditorMode()) { if (GetIEditor()) diff --git a/Code/Editor/CryEdit.h b/Code/Editor/CryEdit.h index 97fcde8f34..48f362003c 100644 --- a/Code/Editor/CryEdit.h +++ b/Code/Editor/CryEdit.h @@ -14,7 +14,6 @@ #if !defined(Q_MOC_RUN) #include #include -#include "WipFeatureManager.h" #include "CryEditDoc.h" #include "ViewPane.h" diff --git a/Code/Editor/CryEditDoc.cpp b/Code/Editor/CryEditDoc.cpp index 3bcba4d5e0..9d93fd5f5b 100644 --- a/Code/Editor/CryEditDoc.cpp +++ b/Code/Editor/CryEditDoc.cpp @@ -45,7 +45,6 @@ #include "ActionManager.h" #include "Include/IObjectManager.h" #include "ErrorReportDialog.h" -#include "SurfaceTypeValidator.h" #include "Util/AutoLogTime.h" #include "CheckOutDialog.h" #include "GameExporter.h" @@ -99,8 +98,7 @@ namespace Internal // CCryEditDoc construction/destruction CCryEditDoc::CCryEditDoc() - : doc_validate_surface_types(nullptr) - , m_modifiedModuleFlags(eModifiedNothing) + : m_modifiedModuleFlags(eModifiedNothing) { //////////////////////////////////////////////////////////////////////// // Set member variables to initial values @@ -120,7 +118,6 @@ CCryEditDoc::CCryEditDoc() GetIEditor()->SetDocument(this); CLogFile::WriteLine("Document created"); - RegisterConsoleVariables(); MainWindow::instance()->GetActionManager()->RegisterActionHandler(ID_FILE_SAVE_AS, this, &CCryEditDoc::OnFileSaveAs); bool isPrefabSystemEnabled = false; @@ -459,8 +456,6 @@ void CCryEditDoc::Load(TDocMultiArchive& arrXmlAr, const QString& szFilename) } } - CSurfaceTypeValidator().Validate(); - LogLoadTime(GetTickCount() - t0); // Loaded with success, remove event from log file GetIEditor()->GetSettingsManager()->UnregisterEvent(loadEvent); @@ -1910,25 +1905,6 @@ void CCryEditDoc::SetDocumentReady(bool bReady) m_bDocumentReady = bReady; } -void CCryEditDoc::RegisterConsoleVariables() -{ - doc_validate_surface_types = gEnv->pConsole->GetCVar("doc_validate_surface_types"); - - if (!doc_validate_surface_types) - { - doc_validate_surface_types = REGISTER_INT_CB("doc_validate_surface_types", 0, 0, - "Flag indicating whether icons are displayed on the animation graph.\n" - "Default is 1.\n", - OnValidateSurfaceTypesChanged); - } -} - -void CCryEditDoc::OnValidateSurfaceTypesChanged(ICVar*) -{ - CErrorsRecorder errorsRecorder(GetIEditor()); - CSurfaceTypeValidator().Validate(); -} - void CCryEditDoc::OnStartLevelResourceList() { // after loading another level we clear the RFOM_Level list, the first time the list should be empty diff --git a/Code/Editor/CryEditDoc.h b/Code/Editor/CryEditDoc.h index f7e97d308e..5d20bddf45 100644 --- a/Code/Editor/CryEditDoc.h +++ b/Code/Editor/CryEditDoc.h @@ -176,9 +176,7 @@ protected: virtual void OnFileSaveAs(); //! called immediately after saving the level. void AfterSave(); - void RegisterConsoleVariables(); void OnStartLevelResourceList(); - static void OnValidateSurfaceTypesChanged(ICVar*); QString GetCryIndexPath(const char* levelFilePath) const; @@ -194,7 +192,6 @@ protected: XmlNodeRef m_environmentTemplate; std::list m_listeners; bool m_bDocumentReady = false; - ICVar* doc_validate_surface_types = nullptr; int m_modifiedModuleFlags; // On construction, it assumes loaded levels have already been exported. Can be a big fat lie, though. // The right way would require us to save to the level folder the export status of the level. diff --git a/Code/Editor/CryEditLiveCreate.rc b/Code/Editor/CryEditLiveCreate.rc deleted file mode 100644 index 3dac96d682..0000000000 --- a/Code/Editor/CryEditLiveCreate.rc +++ /dev/null @@ -1,213 +0,0 @@ -ÿþ// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winres.h" -#include "resource.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (United States) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -2 TEXTINCLUDE -BEGIN - "#include ""winres.h""\r\n" - "#include ""resource.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -IDR_MENU_LIVECREATE MENU -BEGIN - POPUP "&File" - BEGIN - MENUITEM "Save settings", ID_FILE_SAVESETTINGS - MENUITEM "Close", ID_FILE_CLOSE_LIVECREATE_VIEW - END - POPUP "&View" - BEGIN - MENUITEM "LiveCreate Logger", ID_VIEW_LIVECREATELOGGER, CHECKED - MENUITEM "LiveCreate Profile Editor", ID_VIEW_LIVECREATEPROFILEEDITOR, CHECKED - MENUITEM "LiveCreate File Sync Settings", ID_VIEW_LIVECREATEFILESYNCSETTINGS, CHECKED - END -END - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_LIVECREATE_PICKER DIALOGEX 0, 0, 316, 259 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Select game build directory" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - DEFPUSHBUTTON "OK",IDOK,200,238,50,14 - PUSHBUTTON "Cancel",IDCANCEL,259,238,50,14 - CONTROL "",IDC_DIRECTORY_TREE,"SysTreeView32",TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_SHOWSELALWAYS | WS_BORDER | WS_HSCROLL | WS_TABSTOP,7,7,302,227 -END - -IDD_LIVECREATE_ADD_TARGETS DIALOGEX 0, 0, 500, 400 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Discover LiveCreate targets" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - PUSHBUTTON "Refresh",IDC_REFRESH,8,8,70,18 - PUSHBUTTON "Add custom...",IDC_BUTTON_ADD_PEER,82,8,70,18 - CONTROL "Use wider search (broadcast)",IDC_CHECK_ENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,233,12,200,10 - CONTROL "",IDC_LIST_PEERS,"XTPReport",WS_TABSTOP,8,32,484,342,WS_EX_STATICEDGE - DEFPUSHBUTTON "Use selected",IDOK,180,379,70,18 - PUSHBUTTON "Cancel",IDCANCEL,259,379,70,18 - PUSHBUTTON "Add by IP...",IDC_BUTTON_ADD_MATERIAL,157,8,70,18 -END - -IDD_LIVECREATE_PEER_LIST DIALOGEX 0, 0, 395, 213 -STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_SYSMENU -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - LTEXT "Peers:",IDC_STATIC,17,27,22,8 - PUSHBUTTON "Add...",IDC_BUTTON_ADD_PEER,56,24,56,16 - PUSHBUTTON "Edit...",IDC_BUTTON_EDIT_PEER,116,24,56,16 - PUSHBUTTON "Remove",IDC_BUTTON_DELETE_PEER,176,24,52,16 - DEFPUSHBUTTON "Start All",IDC_BUTTON_START_ALL,4,4,48,16 - PUSHBUTTON "Reset All",IDC_BUTTON_RESET_ALL,176,4,52,16 - PUSHBUTTON "Force Sync All",IDC_BUTTON_FORCE_SYNC_ALL,56,4,56,16 - PUSHBUTTON "Clean All",IDC_BUTTON_CLEAN_ALL,232,4,52,16 - PUSHBUTTON "Screenshot All",IDC_BUTTON_SCREENSHOT_ALL,116,4,56,16 - CONTROL "",IDC_LIST_PEERS,"XTPReport",WS_TABSTOP,4,44,386,164,WS_EX_STATICEDGE - CHECKBOX "LiveCreate",IDC_BUTTON_ENABLE_LIVECREATE,288,4,52,36,BS_PUSHLIKE | BS_MULTILINE - CHECKBOX "Sync\nCamera",IDC_BUTTON_CAMERA_SYNC,345,4,52,36,BS_PUSHLIKE | BS_MULTILINE - PUSHBUTTON "Discover",IDC_BUTTON_DISCOVER_PEERS,232,24,52,16 -END - -IDD_IDD_LIVECREATE_SETTINGS_PANEL DIALOGEX 0, 0, 156, 204 -STYLE DS_SETFONT | WS_CHILD -FONT 8, "MS Shell Dlg 2", 400, 0, 0x1 -BEGIN - PUSHBUTTON "Add targets...",IDC_BUTTON_DISCOVER_PEERS,4,4,80,16 -END - -IDD_LIVECREATE_EDIT_CONNECTION DIALOGEX 0, 0, 288, 183 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "LiveCreate host settings" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - DEFPUSHBUTTON "OK",IDOK,158,154,58,20 - PUSHBUTTON "Cancel",IDCANCEL,221,154,58,20 - LTEXT "Name:",IDC_STATIC,16,46,22,8 - EDITTEXT IDC_EDIT_TARGET_NAME,44,44,100,14,ES_AUTOHSCROLL - LTEXT "IP:",IDC_STATIC,152,46,10,8 - CONTROL "",IDC_TARGET_IPADDRESS,"SysIPAddress32",WS_TABSTOP,168,44,100,15 - LTEXT "Platform:",IDC_STATIC,8,26,30,8 - LTEXT "Build path (automatic):",IDC_STATIC,19,120,74,8 - PUSHBUTTON "Test IP",IDC_BUTTON_TEST_CONNECTION,168,60,100,16 - COMBOBOX IDC_COMBO_PLATFORM,44,24,100,88,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Resovle name to IP",IDC_BUTTON_REFRESH_IP,44,60,100,16 - CONTROL "Enable this peer",IDC_CHECK_ENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,8,67,10 - GROUPBOX "Build settings",IDC_STATIC,7,80,272,71 - LTEXT "Build executable:",IDC_STATIC,19,92,56,8 - PUSHBUTTON "...",IDC_BUTTON_PICK_GAME_DIRECTORY,249,104,22,14 - EDITTEXT IDC_EDIT_BUILD_ROOT_PATH,20,104,226,14,ES_AUTOHSCROLL - EDITTEXT IDC_EDIT_BUILD_EXECUTABLE,20,131,249,14,ES_AUTOHSCROLL -END - -IDD_LIVECREATE_TASK_WAIT DIALOGEX 0, 0, 238, 41 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Dialog" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - PUSHBUTTON "Cancel",IDCANCEL,94,20,50,14 - LTEXT "Static",IDC_TASK_PROGRESS_TEXT,7,7,224,8 -END - -IDD_LIVECREATE_ADD_BY_IP DIALOGEX 0, 0, 137, 75 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Add LiveCreate by IP" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - DEFPUSHBUTTON "OK",IDOK,7,48,58,20 - PUSHBUTTON "Cancel",IDCANCEL,71,48,58,20 - LTEXT "IP:",-1,9,12,10,8 - EDITTEXT IDC_TARGET_IPADDRESS,25,10,100,15,WS_TABSTOP - PUSHBUTTON "Test IP",IDC_BUTTON_TEST_CONNECTION,25,27,100,16 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_LIVECREATE_ADD_TARGETS, DIALOG - BEGIN - END - - IDD_LIVECREATE_EDIT_CONNECTION, DIALOG - BEGIN - END - - IDD_LIVECREATE_TASK_WAIT, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 231 - TOPMARGIN, 7 - BOTTOMMARGIN, 34 - END - - IDD_LIVECREATE_ADD_BY_IP, DIALOG - BEGIN - END -END -#endif // APSTUDIO_INVOKED - -#endif // English (United States) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED \ No newline at end of file diff --git a/Code/Editor/DimensionsDialog.cpp b/Code/Editor/DimensionsDialog.cpp deleted file mode 100644 index 6c8e6a616b..0000000000 --- a/Code/Editor/DimensionsDialog.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include "EditorDefs.h" - -#include "DimensionsDialog.h" - -// Qt -#include - -AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING -#include -AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING - - - -///////////////////////////////////////////////////////////////////////////// -CDimensionsDialog::CDimensionsDialog(QWidget* pParent /*=nullptr*/) - : QDialog(pParent) - , m_group(new QButtonGroup(this)) - , ui(new Ui::CDimensionsDialog) -{ - ui->setupUi(this); - - setWindowTitle(tr("Generate Terrain Texture")); - - m_group->addButton(ui->Dim512, 512); - m_group->addButton(ui->Dim1024, 1024); - m_group->addButton(ui->Dim2048, 2048); - m_group->addButton(ui->Dim4096, 4096); - m_group->addButton(ui->Dim8192, 8192); - m_group->addButton(ui->Dim16384, 16384); -} - - -////////////////////////////////////////////////////////////////////////// -CDimensionsDialog::~CDimensionsDialog() -{ -} - -////////////////////////////////////////////////////////////////////////// -void CDimensionsDialog::SetDimensions(unsigned int iWidth) -{ - //////////////////////////////////////////////////////////////////////// - // Select a dimension option button in the dialog - //////////////////////////////////////////////////////////////////////// - - QAbstractButton* button = m_group->button(iWidth); - assert(button); - - button->setChecked(true); -} - -UINT CDimensionsDialog::GetDimensions() -{ - //////////////////////////////////////////////////////////////////////// - // Get the currently selected dimension option button in the dialog - //////////////////////////////////////////////////////////////////////// - - assert(m_group->checkedId() != -1); - - return m_group->checkedId(); -} - -#include diff --git a/Code/Editor/DimensionsDialog.h b/Code/Editor/DimensionsDialog.h deleted file mode 100644 index b94c58bf95..0000000000 --- a/Code/Editor/DimensionsDialog.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#pragma once -#ifndef CRYINCLUDE_EDITOR_DIMENSIONSDIALOG_H -#define CRYINCLUDE_EDITOR_DIMENSIONSDIALOG_H - -#if !defined(Q_MOC_RUN) -#include - -#include -#endif - -class QButtonGroup; - -namespace Ui { - class CDimensionsDialog; -} - -class CDimensionsDialog - : public QDialog -{ - Q_OBJECT - -public: - CDimensionsDialog(QWidget* pParent = nullptr); // standard constructor - ~CDimensionsDialog(); - - UINT GetDimensions(); - void SetDimensions(unsigned int iWidth); - -protected: - void UpdateData(bool fromUi = true); // DDX/DDV support - -private: - QButtonGroup* m_group; - - QScopedPointer ui; -}; - -#endif // CRYINCLUDE_EDITOR_DIMENSIONSDIALOG_H diff --git a/Code/Editor/DimensionsDialog.ui b/Code/Editor/DimensionsDialog.ui deleted file mode 100644 index 316a060c92..0000000000 --- a/Code/Editor/DimensionsDialog.ui +++ /dev/null @@ -1,120 +0,0 @@ - - - CDimensionsDialog - - - - 0 - 0 - 465 - 237 - - - - Qt::StrongFocus - - - - - - Texture Dimensions (Texture Dimensions divided by Terrain Size = Texels per meter) - - - - - - Qt::StrongFocus - - - 512 x 512 - - - true - - - - - - - Qt::StrongFocus - - - 1024 x 1024 - - - - - - - Qt::StrongFocus - - - 2048 x 2048 - - - - - - - Qt::StrongFocus - - - 4096 x 4096 - - - - - - - Qt::StrongFocus - - - 8192 x 8192 - - - - - - - Qt::StrongFocus - - - 16384 x 16384 - - - - - - - - - - Qt::StrongFocus - - - QDialogButtonBox::Ok - - - - - - - - - buttonBox - accepted() - CDimensionsDialog - accept() - - - 77 - 294 - - - 7 - 296 - - - - - diff --git a/Code/Editor/GameEngine.cpp b/Code/Editor/GameEngine.cpp index db4c587f54..9786dcf1b8 100644 --- a/Code/Editor/GameEngine.cpp +++ b/Code/Editor/GameEngine.cpp @@ -42,8 +42,6 @@ #include "ViewManager.h" #include "AnimationContext.h" -#include "UndoViewPosition.h" -#include "UndoViewRotation.h" #include "MainWindow.h" #include "Include/IObjectManager.h" #include "ActionManager.h" diff --git a/Code/Editor/MainWindow.qrc b/Code/Editor/MainWindow.qrc index c68e05ef41..57afc596bb 100644 --- a/Code/Editor/MainWindow.qrc +++ b/Code/Editor/MainWindow.qrc @@ -154,36 +154,6 @@ res/error_report_warning.svg res/error_report_comment.svg res/error_report_helper.svg - particles_tree_00.png - particles_tree_01.png - particles_tree_02.png - particles_tree_03.png - particles_tree_04.png - particles_tree_05.png - particles_tree_06.png - particles_tree_07.png - arhitype_tree_00.png - arhitype_tree_01.png - arhitype_tree_02.png - arhitype_tree_03.png - bmp00005_00.png - bmp00005_01.png - bmp00005_02.png - bmp00005_03.png - bmp00005_04.png - bmp00005_05.png - bmp00005_06.png - bmp00005_07.png - bmp00005_08.png - bmp00005_09.png - bmp00006_00.png - bmp00006_01.png - bmp00006_02.png - bmp00006_03.png - bmp00006_04.png - bmp00006_05.png - bmp00006_06.png - bmp00006_07.png res/arr_addkey.cur diff --git a/Code/Editor/NewLevelDialog.cpp b/Code/Editor/NewLevelDialog.cpp index a97eb30f57..b22d9dbaf3 100644 --- a/Code/Editor/NewLevelDialog.cpp +++ b/Code/Editor/NewLevelDialog.cpp @@ -18,9 +18,6 @@ #include #include -// Editor -#include "NewTerrainDialog.h" - AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING #include AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING diff --git a/Code/Editor/NewTerrainDialog.cpp b/Code/Editor/NewTerrainDialog.cpp deleted file mode 100644 index 0e66482eb4..0000000000 --- a/Code/Editor/NewTerrainDialog.cpp +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -// NewTerrainDialog.cpp : implementation file -// - -#include "EditorDefs.h" - -#include "NewTerrainDialog.h" - - -AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") -#include -AZ_POP_DISABLE_WARNING - - - -CNewTerrainDialog::CNewTerrainDialog(QWidget* pParent /*=nullptr*/) - : QDialog(pParent) - , m_terrainResolutionIndex(0) - , m_terrainUnitsIndex(0) - , m_bUpdate(false) - , ui(new Ui::CNewTerrainDialog) - , m_initialized(false) -{ - ui->setupUi(this); - - setWindowTitle(tr("Terrain options")); - - // Default is 1024x1024, and m_terrainResolution holds an index to the combo box - m_terrainResolutionIndex = 3; - - connect(ui->TERRAIN_RESOLUTION, SIGNAL(activated(int)), this, SLOT(OnComboBoxSelectionTerrainResolution())); - connect(ui->TERRAIN_UNITS, SIGNAL(activated(int)), this, SLOT(OnComboBoxSelectionTerrainUnits())); -} - - -CNewTerrainDialog::~CNewTerrainDialog() -{ -} - - -void CNewTerrainDialog::UpdateData(bool fromUi) -{ - if (fromUi) - { - m_terrainResolutionIndex = ui->TERRAIN_RESOLUTION->currentIndex(); - m_terrainUnitsIndex = ui->TERRAIN_UNITS->currentIndex(); - } - else - { - ui->TERRAIN_RESOLUTION->setCurrentIndex(m_terrainResolutionIndex); - ui->TERRAIN_UNITS->setCurrentIndex(m_terrainUnitsIndex); - } -} - - -void CNewTerrainDialog::OnInitDialog() -{ - // Initialize terrain values. - int resolution = Ui::START_TERRAIN_RESOLUTION; - - // Fill terrain resolution combo box - for (int i = 0; i < 6; i++) - { - ui->TERRAIN_RESOLUTION->addItem(QString("%1x%1").arg(resolution)); - resolution *= 2; - } - - UpdateTerrainUnits(); - UpdateTerrainInfo(); - - // Save data. - UpdateData(false); -} - - -void CNewTerrainDialog::UpdateTerrainUnits() -{ - uint32 terrainRes = GetTerrainResolution(); - int size = terrainRes * GetTerrainUnits(); - int maxUnit = IntegerLog2(Ui::MAXIMUM_TERRAIN_RESOLUTION / terrainRes); - int units = Ui::START_TERRAIN_UNITS; - - ui->TERRAIN_UNITS->clear(); - for (int i = 0; i <= maxUnit; i++) - { - ui->TERRAIN_UNITS->addItem(QString::number(units)); - units *= 2; - } - if (size > Ui::MAXIMUM_TERRAIN_RESOLUTION) - { - m_terrainUnitsIndex = 0; - } - ui->TERRAIN_UNITS->setCurrentText(QString::number(m_terrainUnitsIndex)); -} - - -void CNewTerrainDialog::UpdateTerrainInfo() -{ - int sizeX = GetTerrainResolution() * GetTerrainUnits(); - int sizeY = GetTerrainResolution() * GetTerrainUnits(); - - QString str; - if (sizeX >= 1000) - { - str = tr("Terrain Size: %1 x %2 Kilometers").arg((float)sizeX / 1000.0f, 0, 'f', 3).arg((float)sizeY / 1000.0f, 0, 'f', 3); - } - else if (sizeX > 0) - { - str = tr("Terrain Size: %1 x %2 Meters").arg(sizeX).arg(sizeY); - } - else - { - str = tr("Level will have no terrain"); - } - - ui->TERRAIN_INFO->setText(str); -} - - -int CNewTerrainDialog::GetTerrainResolution() const -{ - // convert combo box index into resolution value - return Ui::START_TERRAIN_RESOLUTION * (1 << m_terrainResolutionIndex); -} - - -int CNewTerrainDialog::GetTerrainUnits() const -{ - // convert combo box index into units value - return Ui::START_TERRAIN_UNITS * (1 << m_terrainUnitsIndex); -} - - -void CNewTerrainDialog::OnComboBoxSelectionTerrainResolution() -{ - UpdateData(); - - UpdateTerrainUnits(); - - UpdateTerrainInfo(); -} - - -void CNewTerrainDialog::OnComboBoxSelectionTerrainUnits() -{ - UpdateData(); - - UpdateTerrainInfo(); -} - - -void CNewTerrainDialog::showEvent(QShowEvent* event) -{ - if (!m_initialized) - { - OnInitDialog(); - m_initialized = true; - } - QDialog::showEvent(event); -} - -#include diff --git a/Code/Editor/NewTerrainDialog.h b/Code/Editor/NewTerrainDialog.h deleted file mode 100644 index 8905a8c123..0000000000 --- a/Code/Editor/NewTerrainDialog.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#pragma once -#ifndef CRYINCLUDE_EDITOR_NEWTERRAINDIALOG_H -#define CRYINCLUDE_EDITOR_NEWTERRAINDIALOG_H - -#if !defined(Q_MOC_RUN) -#include - -#include - -#include -#endif - -namespace Ui -{ - class CNewTerrainDialog; - - enum TerrainDialogConstants - { - START_TERRAIN_RESOLUTION_POWER_OF_TWO = 7, - START_TERRAIN_RESOLUTION = 1 << START_TERRAIN_RESOLUTION_POWER_OF_TWO, - MAXIMUM_TERRAIN_POWER_OF_TWO = 16, - MAXIMUM_TERRAIN_RESOLUTION = 1 << MAXIMUM_TERRAIN_POWER_OF_TWO, - POWER_OFFSET = (MAXIMUM_TERRAIN_POWER_OF_TWO - START_TERRAIN_RESOLUTION_POWER_OF_TWO), - START_TERRAIN_UNITS = 1 - }; -} - -class CNewTerrainDialog - : public QDialog -{ - Q_OBJECT - -public: - CNewTerrainDialog(QWidget* pParent = nullptr); // standard constructor - ~CNewTerrainDialog(); - - int GetTerrainResolution() const; - int GetTerrainUnits() const; - - void IsResize(bool bIsResize); - - -protected: - void UpdateData(bool fromUi = true); - void OnInitDialog(); - - void UpdateTerrainUnits(); - void UpdateTerrainInfo(); - - void showEvent(QShowEvent* event) override; - -protected slots: - void OnComboBoxSelectionTerrainResolution(); - void OnComboBoxSelectionTerrainUnits(); - -public: - int m_terrainResolutionIndex; - int m_terrainUnitsIndex; - bool m_bUpdate; - - QScopedPointer ui; - bool m_initialized; -}; -#endif // CRYINCLUDE_EDITOR_NEWTERRAINDIALOG_H diff --git a/Code/Editor/NewTerrainDialog.ui b/Code/Editor/NewTerrainDialog.ui deleted file mode 100644 index 977db11918..0000000000 --- a/Code/Editor/NewTerrainDialog.ui +++ /dev/null @@ -1,112 +0,0 @@ - - - CNewTerrainDialog - - - - 0 - 0 - 292 - 160 - - - - false - - - - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - QFormLayout::AllNonFixedFieldsGrow - - - - - Heightmap Resolution: - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - TERRAIN_RESOLUTION - - - - - - - - - - Meters Per Texel: - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - TERRAIN_UNITS - - - - - - - - - - Terrain Size: 32x32 Km - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - - - - - - - buttonBox - accepted() - CNewTerrainDialog - accept() - - - 164 - 176 - - - 169 - 1 - - - - - buttonBox - rejected() - CNewTerrainDialog - reject() - - - 245 - 172 - - - 247 - -1 - - - - - diff --git a/Code/Editor/PakManagerDlg.qrc b/Code/Editor/PakManagerDlg.qrc deleted file mode 100644 index bea8f8aafd..0000000000 --- a/Code/Editor/PakManagerDlg.qrc +++ /dev/null @@ -1,6 +0,0 @@ - - - res/pakmanager_file.png - res/pakmanager_folder.png - - diff --git a/Code/Editor/PakManagerDlg.ui b/Code/Editor/PakManagerDlg.ui deleted file mode 100644 index 087e5379da..0000000000 --- a/Code/Editor/PakManagerDlg.ui +++ /dev/null @@ -1,202 +0,0 @@ - - - CPakManagerDlg - - - - 0 - 0 - 661 - 494 - - - - - - - - - - 0 - 45 - - - - Open PAK... - - - - - - - - 0 - 45 - - - - Create PAK... - - - - - - - - 0 - 45 - - - - Add files... - - - - - - - - 0 - 45 - - - - Add folder... - - - - - - - - 0 - 45 - - - - Extract... - - - - - - - - 0 - 45 - - - - Delete entries - - - - - - - - 0 - 45 - - - - &Close - - - - - - - - - - - Path: - - - - - - - - 0 - 0 - - - - QFrame::Panel - - - QFrame::Sunken - - - <none> - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - - - - QFrame::Box - - - Qt::ScrollBarAlwaysOn - - - QAbstractItemView::NoEditTriggers - - - QAbstractItemView::SelectItems - - - 120 - - - false - - - - Filename - - - - - Size - - - - - Modified - - - - - - - - Ready - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - - Qt::AlignCenter - - - - - - - - - - diff --git a/Code/Editor/SelectEAXPresetDlg.cpp b/Code/Editor/SelectEAXPresetDlg.cpp deleted file mode 100644 index 733de8b9cf..0000000000 --- a/Code/Editor/SelectEAXPresetDlg.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include "EditorDefs.h" - -#include "SelectEAXPresetDlg.h" - -AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING -#include "ui_SelectEAXPresetDlg.h" -AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING - - -CSelectEAXPresetDlg::CSelectEAXPresetDlg(QWidget* pParent) - : QDialog(pParent) - , m_ui(new Ui_CSelectEAXPresetDlg) -{ - m_ui->setupUi(this); -} - -CSelectEAXPresetDlg::~CSelectEAXPresetDlg() -{ -} - -void CSelectEAXPresetDlg::SetCurrPreset(const QString& sPreset) -{ - QAbstractListModel* model = Model(); - if (!model) - { - return; - } - - QModelIndexList indexes = model->match(QModelIndex(), Qt::DisplayRole, sPreset, 1, Qt::MatchExactly); - - if (!indexes.isEmpty()) - { - m_ui->listView->setCurrentIndex(indexes.at(0)); - } -} - -QString CSelectEAXPresetDlg::GetCurrPreset() const -{ - if (m_ui->listView->currentIndex().isValid()) - { - return m_ui->listView->currentIndex().data().toString(); - } - // EXCEPTION: OCX Property Pages should return false - return QString(); -} - - -void CSelectEAXPresetDlg::SetModel(QAbstractListModel* model) -{ - m_ui->listView->setModel(model); -} - -QAbstractListModel* CSelectEAXPresetDlg::Model() const -{ - return static_cast(m_ui->listView->model()); -} - -#include "moc_SelectEAXPresetDlg.cpp" diff --git a/Code/Editor/SelectEAXPresetDlg.h b/Code/Editor/SelectEAXPresetDlg.h deleted file mode 100644 index 9943585987..0000000000 --- a/Code/Editor/SelectEAXPresetDlg.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#pragma once - -// CSelectEAXPresetDlg dialog -#ifndef CRYINCLUDE_EDITOR_SELECTEAXPRESETDLG_H -#define CRYINCLUDE_EDITOR_SELECTEAXPRESETDLG_H - -#if !defined(Q_MOC_RUN) -#include -#endif - -class QAbstractListModel; -class Ui_CSelectEAXPresetDlg; - -class CSelectEAXPresetDlg - : public QDialog -{ - Q_OBJECT - -public: - CSelectEAXPresetDlg(QWidget* pParent = nullptr); // standard constructor - ~CSelectEAXPresetDlg(); - - void SetCurrPreset(const QString& sPreset); - QString GetCurrPreset() const; - -protected: - void SetModel(QAbstractListModel* model); - QAbstractListModel* Model() const; - -private: - Ui_CSelectEAXPresetDlg* m_ui; -}; - -#endif // CRYINCLUDE_EDITOR_SELECTEAXPRESETDLG_H diff --git a/Code/Editor/SelectEAXPresetDlg.ui b/Code/Editor/SelectEAXPresetDlg.ui deleted file mode 100644 index 3177b66c38..0000000000 --- a/Code/Editor/SelectEAXPresetDlg.ui +++ /dev/null @@ -1,67 +0,0 @@ - - - CSelectEAXPresetDlg - - - - 0 - 0 - 197 - 233 - - - - Select Preset... - - - - - - - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - listView - - - - - buttonBox - accepted() - CSelectEAXPresetDlg - accept() - - - 51 - 207 - - - 49 - 199 - - - - - buttonBox - rejected() - CSelectEAXPresetDlg - reject() - - - 148 - 213 - - - 131 - 199 - - - - - diff --git a/Code/Editor/SurfaceTypeValidator.cpp b/Code/Editor/SurfaceTypeValidator.cpp deleted file mode 100644 index 9f246cd453..0000000000 --- a/Code/Editor/SurfaceTypeValidator.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include "EditorDefs.h" - -#include "SurfaceTypeValidator.h" - -// Editor -#include "Include/IObjectManager.h" -#include "Objects/BaseObject.h" -#include "ErrorReport.h" - - -void CSurfaceTypeValidator::Validate() -{ -} - diff --git a/Code/Editor/SurfaceTypeValidator.h b/Code/Editor/SurfaceTypeValidator.h deleted file mode 100644 index 6b1a3fbed7..0000000000 --- a/Code/Editor/SurfaceTypeValidator.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_SURFACETYPEVALIDATOR_H -#define CRYINCLUDE_EDITOR_SURFACETYPEVALIDATOR_H -#pragma once - - - -class CSurfaceTypeValidator -{ -public: - void Validate(); - -private: -}; - -#endif // CRYINCLUDE_EDITOR_SURFACETYPEVALIDATOR_H diff --git a/Code/Editor/UndoViewPosition.cpp b/Code/Editor/UndoViewPosition.cpp deleted file mode 100644 index 1934d255d3..0000000000 --- a/Code/Editor/UndoViewPosition.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -// Description : Undo for Python function (PySetCurrentViewPosition) - - -#include "EditorDefs.h" - -#include "UndoViewPosition.h" - -// Editor -#include "ViewManager.h" - -CUndoViewPosition::CUndoViewPosition(const QString& pUndoDescription) -{ - m_undoDescription = pUndoDescription; - - CViewport* pRenderViewport = GetIEditor()->GetViewManager()->GetGameViewport(); - if (pRenderViewport) - { - Matrix34 tm = pRenderViewport->GetViewTM(); - m_undo = tm.GetTranslation(); - } -} - -int CUndoViewPosition::GetSize() -{ - return sizeof(*this); -} - -QString CUndoViewPosition::GetDescription() -{ - return m_undoDescription; -} - -void CUndoViewPosition::Undo(bool bUndo) -{ - CViewport* pRenderViewport = GetIEditor()->GetViewManager()->GetGameViewport(); - if (pRenderViewport) - { - Matrix34 tm = pRenderViewport->GetViewTM(); - if (bUndo) - { - m_redo = tm.GetTranslation(); - } - - tm.SetTranslation(m_undo); - pRenderViewport->SetViewTM(tm); - } -} - -void CUndoViewPosition::Redo() -{ - CViewport* pRenderViewport = GetIEditor()->GetViewManager()->GetGameViewport(); - if (pRenderViewport) - { - Matrix34 tm = pRenderViewport->GetViewTM(); - tm.SetTranslation(m_redo); - pRenderViewport->SetViewTM(tm); - } -} diff --git a/Code/Editor/UndoViewPosition.h b/Code/Editor/UndoViewPosition.h deleted file mode 100644 index e0c6c145e8..0000000000 --- a/Code/Editor/UndoViewPosition.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 - * - */ - - -// Description : Undo for Python function (PySetCurrentViewPosition) - -#ifndef CRYINCLUDE_EDITOR_UNDOVIEWPOSITION_H -#define CRYINCLUDE_EDITOR_UNDOVIEWPOSITION_H -#pragma once - -#include "Undo/IUndoObject.h" - -class CUndoViewPosition - : public IUndoObject -{ -public: - CUndoViewPosition(const QString& pUndoDescription = "Set Current View Position"); - -protected: - int GetSize(); - QString GetDescription(); - void Undo(bool bUndo); - void Redo(); - -private: - Vec3 m_undo; - Vec3 m_redo; - QString m_undoDescription; -}; - -#endif // CRYINCLUDE_EDITOR_UNDOVIEWPOSITION_H diff --git a/Code/Editor/UndoViewRotation.cpp b/Code/Editor/UndoViewRotation.cpp deleted file mode 100644 index a305641d3b..0000000000 --- a/Code/Editor/UndoViewRotation.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -// Description : Undo for Python function (PySetCurrentViewPosition) - - -#include "EditorDefs.h" - -#include "UndoViewRotation.h" - -// Editor -#include "ViewManager.h" - -#include -#include -#include -#include - -Ang3 CUndoViewRotation::GetActiveCameraRotation() -{ - AZ::Transform activeCameraTm = AZ::Transform::CreateIdentity(); - Camera::ActiveCameraRequestBus::BroadcastResult( - activeCameraTm, - &Camera::ActiveCameraRequestBus::Events::GetActiveCameraTransform - ); - const AZ::Matrix3x4 cameraMatrix = AZ::Matrix3x4::CreateFromTransform(activeCameraTm); - const Matrix33 cameraMatrixCry = AZMatrix3x3ToLYMatrix3x3(AZ::Matrix3x3::CreateFromMatrix3x4(cameraMatrix)); - return RAD2DEG(Ang3::GetAnglesXYZ(cameraMatrixCry)); -} - -CUndoViewRotation::CUndoViewRotation(const QString& pUndoDescription) -{ - m_undoDescription = pUndoDescription; - m_undo = GetActiveCameraRotation(); -} - -int CUndoViewRotation::GetSize() -{ - return sizeof(*this); -} - -QString CUndoViewRotation::GetDescription() -{ - return m_undoDescription; -} - -void CUndoViewRotation::Undo(bool bUndo) -{ - CViewport* pRenderViewport = GetIEditor()->GetViewManager()->GetGameViewport(); - if (pRenderViewport) - { - if (bUndo) - { - m_redo = GetActiveCameraRotation(); - } - - Matrix34 tm = pRenderViewport->GetViewTM(); - tm.SetRotationXYZ(Ang3(DEG2RAD(m_undo.x), DEG2RAD(m_undo.y), DEG2RAD(m_undo.z)), tm.GetTranslation()); - pRenderViewport->SetViewTM(tm); - } -} - -void CUndoViewRotation::Redo() -{ - CViewport* pRenderViewport = GetIEditor()->GetViewManager()->GetGameViewport(); - if (pRenderViewport) - { - Matrix34 tm = pRenderViewport->GetViewTM(); - tm.SetRotationXYZ(Ang3(DEG2RAD(m_redo.x), DEG2RAD(m_redo.y), DEG2RAD(m_redo.z)), tm.GetTranslation()); - pRenderViewport->SetViewTM(tm); - } -} diff --git a/Code/Editor/UndoViewRotation.h b/Code/Editor/UndoViewRotation.h deleted file mode 100644 index 2e086a3f05..0000000000 --- a/Code/Editor/UndoViewRotation.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -// Description : Undo for Python function (PySetCurrentViewRotation) - - -#ifndef CRYINCLUDE_EDITOR_UNDOVIEWROTATION_H -#define CRYINCLUDE_EDITOR_UNDOVIEWROTATION_H -#pragma once -#include "Undo/IUndoObject.h" - - -class CUndoViewRotation - : public IUndoObject -{ -public: - CUndoViewRotation(const QString& pUndoDescription = "Set Current View Rotation"); - -protected: - int GetSize(); - QString GetDescription(); - void Undo(bool bUndo); - void Redo(); - -private: - static Ang3 GetActiveCameraRotation(); - - Ang3 m_undo; - Ang3 m_redo; - QString m_undoDescription; -}; - -#endif // CRYINCLUDE_EDITOR_UNDOVIEWROTATION_H diff --git a/Code/Editor/UserMessageDefines.h b/Code/Editor/UserMessageDefines.h deleted file mode 100644 index 0b13d2819f..0000000000 --- a/Code/Editor/UserMessageDefines.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_USERMESSAGEDEFINES_H -#define CRYINCLUDE_EDITOR_USERMESSAGEDEFINES_H -#pragma once - - -enum ESandboxUserMessages -{ - // InPlaceComboBox - WM_USER_ON_SELECTION_CANCEL = WM_USER + 1, - WM_USER_ON_SELECTION_OK, - WM_USER_ON_NEW_SELECTION, - WM_USER_ON_EDITCHANGE, - WM_USER_ON_OPENDROPDOWN, - WM_USER_ON_EDITKEYDOWN, - WM_USER_ON_EDITCLICK, - // ACListWnd - ENAC_UPDATE, - // EditWithButton - WM_USER_EDITWITHBUTTON_CLICKED, - // FillSliderCtrl - WMU_FS_CHANGED, - WMU_FS_LBUTTONDOWN, - WMU_FS_LBUTTONUP, - FLM_EDITTEXTCHANGED, - FLM_FILTERTEXTCHANGED, - // NumberCtrlEdit - WMU_LBUTTONDOWN, - WMU_LBUTTONUP, - WM_ONWINDOWFOCUSCHANGES, - // SelectObjectDialog - IDT_TIMER_0, - IDT_TIMER_1, - // LensFlareEditor - WM_FLAREEDITOR_UPDATETREECONTROL, - // EquipPackDialog - UM_EQUIPLIST_CHECKSTATECHANGE, - // MaterialSender/MatEditMainDlg - WM_MATEDITPICK, - // GridMapWindow - WM_USER_ON_DBL_CLICK, - // LMCompDialog - WM_UPDATE_LIGHTMAP_GENERATION_PROGRESS, - WM_UPDATE_LIGHTMAP_GENERATION_MEMUSAGE, - WM_UPDATE_LIGHTMAP_GENERATION_MEMUSAGE_STATIC, - WM_UPDATE_GLM_NAME_EDIT, - // Viewport - WM_VIEWPORT_ON_TITLE_CHANGE, - // VisualLogControls - UWM_BUTTON_CLICKED, -}; -#endif // CRYINCLUDE_EDITOR_USERMESSAGEDEFINES_H diff --git a/Code/Editor/ViewPane.cpp b/Code/Editor/ViewPane.cpp index 421db8394e..e3494a4049 100644 --- a/Code/Editor/ViewPane.cpp +++ b/Code/Editor/ViewPane.cpp @@ -38,7 +38,6 @@ #include "Viewport.h" #include "LayoutConfigDialog.h" #include "TopRendererWnd.h" -#include "UserMessageDefines.h" #include "MainWindow.h" #include "QtViewPaneManager.h" #include "EditorViewportWidget.h" diff --git a/Code/Editor/WipFeatureManager.cpp b/Code/Editor/WipFeatureManager.cpp deleted file mode 100644 index 4fb9ed1d93..0000000000 --- a/Code/Editor/WipFeatureManager.cpp +++ /dev/null @@ -1,454 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include "EditorDefs.h" - -#include "WipFeatureManager.h" - -#ifdef USE_WIP_FEATURES_MANAGER -#include "WipFeaturesDlg.h" - -#if defined(AZ_PLATFORM_WINDOWS) -const char* CWipFeatureManager::kWipFeaturesFilename = "@user@\\Editor\\UI\\WipFeatures.xml"; -#else -const char* CWipFeatureManager::kWipFeaturesFilename = "@user@/Editor/UI/WipFeatures.xml"; -#endif -CWipFeatureManager* CWipFeatureManager::s_pInstance = nullptr; - -static void WipFeatureVarChange(ICVar* pVar) -{ - QString strParams = pVar->GetString(); - QStringList params; - - SplitString(strParams, params, ' '); - - if (strParams == "edit") - { - static CWipFeaturesDlg dlg; - - dlg.show(); - - return; - } - - if (params.size() >= 2) - { - QString featName = params[0].trimmed(); - QString attr = params[1].trimmed(); - - if (featName.isEmpty()) - { - return; - } - - int id = featName.toInt(); - - // if all features - if (featName == "*") - { - if (attr == "enable") - { - CWipFeatureManager::Instance()->EnableAllFeatures(true); - } - else - if (attr == "disable") - { - CWipFeatureManager::Instance()->EnableAllFeatures(false); - } - else - if (attr == "hide") - { - CWipFeatureManager::Instance()->ShowAllFeatures(false); - } - else - if (attr == "show") - { - CWipFeatureManager::Instance()->ShowAllFeatures(true); - } - else - if (attr == "safemode") - { - CWipFeatureManager::Instance()->SetAllFeaturesSafeMode(true); - } - else - if (attr == "fullmode") - { - CWipFeatureManager::Instance()->SetAllFeaturesSafeMode(false); - } - else - { - CWipFeatureManager::Instance()->SetAllFeaturesParams(attr.toUtf8().data()); - } - - return; - } - - if (attr == "enable") - { - CWipFeatureManager::Instance()->EnableFeature(id, true); - } - else - if (attr == "disable") - { - CWipFeatureManager::Instance()->EnableFeature(id, false); - } - else - if (attr == "hide") - { - CWipFeatureManager::Instance()->ShowFeature(id, false); - } - else - if (attr == "show") - { - CWipFeatureManager::Instance()->ShowFeature(id, true); - } - else - if (attr == "safemode") - { - CWipFeatureManager::Instance()->SetFeatureSafeMode(id, true); - } - else - if (attr == "fullmode") - { - CWipFeatureManager::Instance()->SetFeatureSafeMode(id, false); - } - else - { - CWipFeatureManager::Instance()->SetFeatureParams(id, attr.toUtf8().data()); - } - } -} - -CWipFeatureManager::CWipFeatureManager() -{ - m_bEnabled = true; -} - -CWipFeatureManager::~CWipFeatureManager() -{ -} - -bool CWipFeatureManager::Init(bool bLoadXml) -{ - if (!gEnv) - { - return false; - } - - IConsole* pConsole = gEnv->pConsole; - - if (!pConsole) - { - return false; - } - - REGISTER_CVAR2_CB("e_wipfeature", (const char**)&CWipFeatureManager::Instance()->m_consoleCmdParams, "", VF_ALWAYSONCHANGE | VF_CHEAT, "wipfeature enable|disable|hide|show|safemode|fullmode", WipFeatureVarChange); - - if (bLoadXml) - { - CWipFeatureManager::Instance()->Load(); - } - - return true; -} - -void CWipFeatureManager::Shutdown() -{ - CWipFeatureManager::Instance()->Save(); - delete s_pInstance; - s_pInstance = nullptr; -} - -bool CWipFeatureManager::Load(const char* pFilename, bool bClearExisting) -{ - if (!GetISystem()) - { - return false; - } - - XmlNodeRef root = GetISystem()->LoadXmlFromFile(pFilename); - - if (!root) - { - return false; - } - - if (bClearExisting) - { - m_features.clear(); - } - - Log("Loading WIP features file: '%s'...", pFilename); - - for (size_t i = 0, iCount = root->getChildCount(); i < iCount; ++i) - { - SWipFeatureInfo wf; - XmlNodeRef node = root->getChild(static_cast(i)); - XmlString str; - - node->getAttr("id", wf.m_id); - node->getAttr("displayName", str); - wf.m_displayName = str; - node->getAttr("visible", wf.m_bVisible); - node->getAttr("enabled", wf.m_bEnabled); - node->getAttr("safeMode", wf.m_bSafeMode); - node->getAttr("params", str); - wf.m_params = str; - wf.m_bLoadedFromXml = true; - - TWipFeatures::iterator iter = m_features.find(wf.m_id); - - if (iter == m_features.end()) - { - m_features[wf.m_id] = wf; - } - else - { - m_features[wf.m_id].m_bVisible = wf.m_bVisible; - m_features[wf.m_id].m_bEnabled = wf.m_bEnabled; - m_features[wf.m_id].m_bSafeMode = wf.m_bSafeMode; - m_features[wf.m_id].m_params = wf.m_params; - } - } - - Log("Loaded %d WIP features.", m_features.size()); - - return true; -} - -bool CWipFeatureManager::Save(const char* pFilename) -{ - if (!gEnv) - { - return false; - } - - if (!GetISystem()) - { - return false; - } - - ISystem* pISystem = GetISystem(); - - XmlNodeRef root = pISystem->CreateXmlNode("features"); - - for (TWipFeatures::iterator iter = m_features.begin(), iterEnd = m_features.end(); iter != iterEnd; ++iter) - { - SWipFeatureInfo& wf = iter->second; - XmlNodeRef node = root->createNode("feature"); - - node->setAttr("id", wf.m_id); - node->setAttr("displayName", wf.m_displayName.c_str()); - node->setAttr("visible", wf.m_bVisible); - node->setAttr("enabled", wf.m_bEnabled); - node->setAttr("safeMode", wf.m_bSafeMode); - node->setAttr("params", wf.m_params.c_str()); - - root->addChild(node); - } - - root->saveToFile(pFilename); - - return true; -} - -int CWipFeatureManager::RegisterFeature(const char* pDisplayName, bool bVisible, bool bEnabled, bool bSafeMode, const char* pParams, bool bSaveToXml) -{ - int aMaxId = -1; - - for (TWipFeatures::iterator iter = m_features.begin(), iterEnd = m_features.end(); iter != iterEnd; ++iter) - { - if (iter->first > aMaxId) - { - aMaxId = iter->first; - } - } - - ++aMaxId; - SetFeature(aMaxId, pDisplayName, bVisible, bEnabled, bSafeMode, pParams, bSaveToXml); - - return aMaxId; -} - -void CWipFeatureManager::SetFeature(int aFeatureId, const char* pDisplayName, bool bVisible, bool bEnabled, bool bSafeMode, const char* pParams, bool bSaveToXml) -{ - m_features[aFeatureId].m_id = aFeatureId; - m_features[aFeatureId].m_displayName = pDisplayName; - m_features[aFeatureId].m_bVisible = bVisible; - m_features[aFeatureId].m_bEnabled = bEnabled; - m_features[aFeatureId].m_bSafeMode = bSafeMode; - m_features[aFeatureId].m_bSaveToXml = bSaveToXml; - m_features[aFeatureId].m_params = pParams; - - if (m_features[aFeatureId].m_pfnUpdateFeature) - { - m_features[aFeatureId].m_pfnUpdateFeature(aFeatureId, &bVisible, &bEnabled, &bSafeMode, pParams); - } -} - -void CWipFeatureManager::SetDefaultFeatureStates(int aFeatureId, const char* pDisplayName, bool bVisible, bool bEnabled, bool bSafeMode, const char* pParams) -{ - TWipFeatures::iterator iter = m_features.find(aFeatureId); - - // set feature if not existing - if (iter == m_features.end() || (iter != m_features.end() && !iter->second.m_bLoadedFromXml)) - { - m_features[aFeatureId].m_id = aFeatureId; - m_features[aFeatureId].m_displayName = pDisplayName; - m_features[aFeatureId].m_bVisible = bVisible; - m_features[aFeatureId].m_bEnabled = bEnabled; - m_features[aFeatureId].m_bSafeMode = bSafeMode; - m_features[aFeatureId].m_params = pParams; - } - else - if (iter != m_features.end() && iter->second.m_bLoadedFromXml) - { - m_features[aFeatureId].m_id = aFeatureId; - m_features[aFeatureId].m_displayName = pDisplayName; - } - - if (m_features[aFeatureId].m_pfnUpdateFeature) - { - m_features[aFeatureId].m_pfnUpdateFeature(aFeatureId, &bVisible, &bEnabled, &bSafeMode, pParams); - } -} - -bool CWipFeatureManager::IsFeatureVisible(int aFeatureId) -{ - return m_features[aFeatureId].m_bVisible || !m_bEnabled; -} - -bool CWipFeatureManager::IsFeatureEnabled(int aFeatureId) -{ - return m_features[aFeatureId].m_bEnabled || !m_bEnabled; -} - -bool CWipFeatureManager::IsFeatureInSafeMode(int aFeatureId) -{ - if (!m_bEnabled) - { - return false; - } - - return m_features[aFeatureId].m_bSafeMode; -} - -const char* CWipFeatureManager::GetFeatureParams(int aFeatureId) -{ - return m_features[aFeatureId].m_params.c_str(); -} - -void CWipFeatureManager::ShowFeature(int aFeatureId, bool bShow) -{ - m_features[aFeatureId].m_bVisible = bShow; - - if (m_features[aFeatureId].m_pfnUpdateFeature) - { - m_features[aFeatureId].m_pfnUpdateFeature(aFeatureId, &bShow, nullptr, nullptr, nullptr); - } -} - -void CWipFeatureManager::EnableFeature(int aFeatureId, bool bEnable) -{ - m_features[aFeatureId].m_bEnabled = bEnable; - - if (m_features[aFeatureId].m_pfnUpdateFeature) - { - m_features[aFeatureId].m_pfnUpdateFeature(aFeatureId, nullptr, &bEnable, nullptr, nullptr); - } -} - -void CWipFeatureManager::SetFeatureSafeMode(int aFeatureId, bool bSafeMode) -{ - m_features[aFeatureId].m_bSafeMode = bSafeMode; - - if (m_features[aFeatureId].m_pfnUpdateFeature) - { - m_features[aFeatureId].m_pfnUpdateFeature(aFeatureId, nullptr, nullptr, &bSafeMode, nullptr); - } -} - -void CWipFeatureManager::SetFeatureParams(int aFeatureId, const char* pParams) -{ - m_features[aFeatureId].m_params = pParams; - - if (m_features[aFeatureId].m_pfnUpdateFeature) - { - m_features[aFeatureId].m_pfnUpdateFeature(aFeatureId, nullptr, nullptr, nullptr, pParams); - } -} - -void CWipFeatureManager::ShowAllFeatures(bool bShow) -{ - for (TWipFeatures::iterator iter = m_features.begin(), iterEnd = m_features.end(); iter != iterEnd; ++iter) - { - iter->second.m_bVisible = bShow; - - if (iter->second.m_pfnUpdateFeature) - { - iter->second.m_pfnUpdateFeature(iter->first, &bShow, nullptr, nullptr, nullptr); - } - } -} - -void CWipFeatureManager::EnableAllFeatures(bool bEnable) -{ - for (TWipFeatures::iterator iter = m_features.begin(), iterEnd = m_features.end(); iter != iterEnd; ++iter) - { - iter->second.m_bEnabled = bEnable; - - if (iter->second.m_pfnUpdateFeature) - { - iter->second.m_pfnUpdateFeature(iter->first, nullptr, &bEnable, nullptr, nullptr); - } - } -} - -void CWipFeatureManager::SetAllFeaturesSafeMode(bool bSafeMode) -{ - for (TWipFeatures::iterator iter = m_features.begin(), iterEnd = m_features.end(); iter != iterEnd; ++iter) - { - iter->second.m_bSafeMode = bSafeMode; - - if (iter->second.m_pfnUpdateFeature) - { - iter->second.m_pfnUpdateFeature(iter->first, nullptr, nullptr, &bSafeMode, nullptr); - } - } -} - -void CWipFeatureManager::SetAllFeaturesParams(const char* pParams) -{ - for (TWipFeatures::iterator iter = m_features.begin(), iterEnd = m_features.end(); iter != iterEnd; ++iter) - { - iter->second.m_params = pParams; - - if (iter->second.m_pfnUpdateFeature) - { - iter->second.m_pfnUpdateFeature(iter->first, nullptr, nullptr, nullptr, pParams); - } - } -} - -void CWipFeatureManager::EnableManager(bool bEnable) -{ - m_bEnabled = bEnable; -} - -void CWipFeatureManager::SetFeatureUpdateCallback(int aFeatureId, TWipFeatureUpdateCallback pfnUpdate) -{ - m_features[aFeatureId].m_pfnUpdateFeature = pfnUpdate; -} - -AZStd::map& CWipFeatureManager::GetFeatures() -{ - return m_features; -} - -#endif diff --git a/Code/Editor/WipFeatureManager.h b/Code/Editor/WipFeatureManager.h deleted file mode 100644 index cd20f6d591..0000000000 --- a/Code/Editor/WipFeatureManager.h +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#ifndef CRYINCLUDE_EDITOR_WIPFEATUREMANAGER_H -#define CRYINCLUDE_EDITOR_WIPFEATUREMANAGER_H -#pragma once - -#include -#include - -/* - This class is used to control work in progress features at runtime, so QA can test even if the end user will not see those features - You can use the console command: e_wipfeature enable|disable|hide|show|safemode|fullmode - ****************************************************************************************************************************************** - *** GOOD TO KNOW: "e_wipfeature edit" console command will display the WIP dialog and you can control the features from there - ****************************************************************************************************************************************** -*/ - -// undef this define to spot all wip feature usages within the editor at compile time -#define USE_WIP_FEATURES_MANAGER - -#ifdef USE_WIP_FEATURES_MANAGER - -// use this to register new wip features, usage from inside functions -// @param id is the numeric unique id of the feature, its good to have all feature ids in an enum in one file -// @param bVisible is the feature visible by default -// @param bEnabled is the feature enabled (usually visual enable like non-grayed) by default -// @param bSafeMode is the feature operating in some sort of safe mode (the safe mode behavior defined by the feature itself) -// @param pTWipFeatureUpdateCallback callback of type TWipFeatureUpdateCallback for when a feature state (visible,enabled and so on) was modified -#define REGISTER_WIP_FEATURE(id, bVisible, bEnabled, bSafeMode, pTWipFeatureUpdateCallback) \ - static CWipFeatureManager::CWipFeatureRegisterer s_wipFeatureRegisterer_##id(id, ""#id, bVisible, bEnabled, bSafeMode, pTWipFeatureUpdateCallback); - -#define IS_WIP_FEATURE_VISIBLE(id) CWipFeatureManager::Instance()->IsFeatureVisible(id) -#define IS_WIP_FEATURE_ENABLED(id) CWipFeatureManager::Instance()->IsFeatureEnabled(id) -#define IS_WIP_FEATURE_SAFEMODE(id) CWipFeatureManager::Instance()->IsFeatureInSafeMode(id) - -// The feature manager singleton itself -class CWipFeatureManager -{ -public: - - static const char* kWipFeaturesFilename; - - // Used to register a callback function to update the state of features whitin the editor - // pbVisible, pbEnabled, pbSafeMode, pParams - if the pointer is nullptr, then that attribute was not changed - typedef void (* TWipFeatureUpdateCallback)(int aFeatureId, const bool* const pbVisible, const bool* const pbEnabled, const bool* const pbSafeMode, const char* pParams); - - // wip feature registerer auto create object, used for static auto feature creation with the REGISTER_WIP_FEATURE macro - class CWipFeatureRegisterer - { - public: - - CWipFeatureRegisterer(int id, const char* pDisplayName, bool bVisible, bool bEnabled, bool bSafeMode, TWipFeatureUpdateCallback pTWipFeatureUpdateCallback) - { - CWipFeatureManager::Instance()->SetFeatureUpdateCallback(id, pTWipFeatureUpdateCallback); - CWipFeatureManager::Instance()->SetDefaultFeatureStates(id, pDisplayName, bVisible, bEnabled, bSafeMode); - } - }; - - struct SWipFeatureInfo - { - SWipFeatureInfo() - : m_id(0) - , m_displayName("") - , m_bVisible(true) - , m_bEnabled(true) - , m_bSafeMode(false) - , m_pfnUpdateFeature(nullptr) - , m_bLoadedFromXml(false) - {} - - int m_id; - AZStd::string m_displayName, m_params; - bool m_bVisible, m_bEnabled, m_bSafeMode, - // if true, this feature will be saved into the xml file when Save(...) will be called - m_bSaveToXml, m_bLoadedFromXml; - TWipFeatureUpdateCallback m_pfnUpdateFeature; - }; - - typedef AZStd::map TWipFeatures; - -private: - - CWipFeatureManager(); - ~CWipFeatureManager(); - - static CWipFeatureManager* s_pInstance; - -public: - - static CWipFeatureManager* Instance() - { - if (!s_pInstance) - { - s_pInstance = new CWipFeatureManager(); - AZ_Assert(s_pInstance, "Could not construct CWipFeatureManager"); - } - - return s_pInstance; - } - - static bool Init(bool bLoadXml = true); - static void Shutdown(); - - bool Load(const char* pFilename = kWipFeaturesFilename, bool bClearExisting = true); - bool Save(const char* pFilename = kWipFeaturesFilename); - - // Register a new feature - // @return a new feature ID - int RegisterFeature(const char* pDisplayName, bool bVisible, bool bEnabled, bool bSafeMode, const char* pParams = "", bool bSaveToXml = true); - // Set an existing feature - void SetFeature(int aFeatureId, const char* pDisplayName, bool bVisible, bool bEnabled, bool bSafeMode, const char* pParams = "", bool bSaveToXml = true); - // Create a new feature, but it will take into account the existing feature info from the loaded XML file, with persistent settings, if any - void SetDefaultFeatureStates(int aFeatureId, const char* pDisplayName, bool bVisible, bool bEnabled, bool bSafeMode, const char* pParams = ""); - bool IsFeatureVisible(int aFeatureId); - bool IsFeatureEnabled(int aFeatureId); - bool IsFeatureInSafeMode(int aFeatureId); - const char* GetFeatureParams(int aFeatureId); - - void ShowFeature(int aFeatureId, bool bShow = true); - void EnableFeature(int aFeatureId, bool bEnable = true); - void SetFeatureSafeMode(int aFeatureId, bool bSafeMode); - void SetFeatureParams(int aFeatureId, const char* pParams); - - void ShowAllFeatures(bool bShow = true); - void EnableAllFeatures(bool bEnable = true); - void SetAllFeaturesSafeMode(bool bSafeMode); - void SetAllFeaturesParams(const char* pParams); - - // if manager is disabled, then all queries about feature enable/visible/fullmode states will return true always - void EnableManager(bool bEnable = true); - - void SetFeatureUpdateCallback(int aFeatureId, TWipFeatureUpdateCallback pfnUpdate); - TWipFeatures& GetFeatures(); - -private: - - static const int kMaxWipCmdSize = 200; - - TWipFeatures m_features; - char m_consoleCmdParams[kMaxWipCmdSize]; - bool m_bEnabled; -}; - -#else - -// -// no WIP feature manager in production build -// -#define REGISTER_WIP_FEATURE -#define IS_WIP_FEATURE_VISIBLE(id) true -#define IS_WIP_FEATURE_ENABLED(id) true -#define IS_WIP_FEATURE_SAFEMODE(id) true - -#endif //USE_WIP_FEATURES_MANAGER -#endif // CRYINCLUDE_EDITOR_WIPFEATUREMANAGER_H diff --git a/Code/Editor/WipFeaturesDlg.cpp b/Code/Editor/WipFeaturesDlg.cpp deleted file mode 100644 index bc4372d7fb..0000000000 --- a/Code/Editor/WipFeaturesDlg.cpp +++ /dev/null @@ -1,239 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#include "EditorDefs.h" - -#include "WipFeatureManager.h" - -#include "WipFeaturesDlg.h" - -// Qt -#include - -AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING -#include "ui_WipFeaturesDlg.h" -AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING - -#ifdef USE_WIP_FEATURES_MANAGER - -// CWipFeaturesDlg dialog - -class WipFeaturesModel - : public QAbstractTableModel -{ -public: - WipFeaturesModel(QObject* parent = nullptr) - : QAbstractTableModel(parent) - { - } - - int rowCount(const QModelIndex& parent = QModelIndex()) const override - { - return parent.isValid() ? 0 : static_cast(CWipFeatureManager::Instance()->GetFeatures().size()); - } - - int columnCount(const QModelIndex& parent = QModelIndex()) const override - { - return parent.isValid() ? 0 : 5; - } - - QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override - { - if (orientation != Qt::Horizontal || section >= columnCount()) - { - return QVariant(); - } - - - switch (role) - { - case Qt::TextAlignmentRole: - return section == 0 ? Qt::AlignLeft : Qt::AlignCenter; - case Qt::DisplayRole: - switch (section) - { - case 0: - return tr("Name"); - case 1: - return tr("Id"); - case 2: - return tr("Visible"); - case 3: - return tr("Enabled"); - case 4: - return tr("SafeMode"); - default: - return QVariant(); - } - default: - return QVariant(); - } - } - - bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override - { - if (!index.isValid() || index.column() >= columnCount(index.parent()) || index.row() >= rowCount(index.parent())) - { - return false; - } - - if (role != Qt::EditRole || !value.canConvert()) - { - return false; - } - - auto it = CWipFeatureManager::Instance()->GetFeatures().begin(); - std::advance(it, index.row()); - - auto id = it->first; - - switch (index.column()) - { - case 2: - CWipFeatureManager::Instance()->ShowFeature(id, value.toBool()); - break; - case 3: - CWipFeatureManager::Instance()->EnableFeature(id, value.toBool()); - break; - case 4: - CWipFeatureManager::Instance()->SetFeatureSafeMode(id, value.toBool()); - break; - default: - return false; - } - - emit dataChanged(index, index); - return true; - } - - QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override - { - if (!index.isValid() || index.column() >= columnCount(index.parent()) || index.row() >= rowCount(index.parent())) - { - return QVariant(); - } - - if (role == Qt::TextAlignmentRole) - { - return headerData(index.column(), Qt::Horizontal, role); - } - - if (role != Qt::DisplayRole) - { - return QVariant(); - } - - auto it = CWipFeatureManager::Instance()->GetFeatures().begin(); - std::advance(it, index.row()); - - auto feature = it->second; - - switch (index.column()) - { - case 0: - return QString(feature.m_displayName.c_str()); - case 1: - return feature.m_id; - case 2: - return feature.m_bVisible ? tr("X") : QString(); - case 3: - return feature.m_bEnabled ? tr("X") : QString(); - case 4: - return feature.m_bSafeMode ? tr("X") : QString(); - default: - return QVariant(); - } - } -}; - -CWipFeaturesDlg::CWipFeaturesDlg(QWidget* pParent /*=nullptr*/) - : QDialog(pParent) - , m_ui(new Ui::WipFeaturesDlg) -{ - m_ui->setupUi(this); - setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); - setFixedSize(size()); - - OnInitDialog(); - - connect(m_ui->buttonShow, &QPushButton::clicked, this, &CWipFeaturesDlg::OnBnClickedButtonShow); - connect(m_ui->buttonHide, &QPushButton::clicked, this, &CWipFeaturesDlg::OnBnClickedButtonHide); - connect(m_ui->buttonEnable, &QPushButton::clicked, this, &CWipFeaturesDlg::OnBnClickedButtonEnable); - connect(m_ui->buttonDisable, &QPushButton::clicked, this, &CWipFeaturesDlg::OnBnClickedButtonDisable); - connect(m_ui->buttonSafeMode, &QPushButton::clicked, this, &CWipFeaturesDlg::OnBnClickedButtonSafemode); - connect(m_ui->buttonNormalMode, &QPushButton::clicked, this, &CWipFeaturesDlg::OnBnClickedButtonNormalmode); -} - -CWipFeaturesDlg::~CWipFeaturesDlg() -{ -} - -// CWipFeaturesDlg message handlers - -void CWipFeaturesDlg::OnInitDialog() -{ - m_ui->m_lstFeatures->setModel(new WipFeaturesModel(this)); - m_ui->m_lstFeatures->horizontalHeader()->resizeSection(0, 300); - m_ui->m_lstFeatures->horizontalHeader()->resizeSection(1, 70); - m_ui->m_lstFeatures->horizontalHeader()->resizeSection(2, 70); - m_ui->m_lstFeatures->horizontalHeader()->resizeSection(3, 70); - m_ui->m_lstFeatures->horizontalHeader()->resizeSection(4, 70); -} - -void CWipFeaturesDlg::OnBnClickedButtonShow() -{ - for (auto index : m_ui->m_lstFeatures->selectionModel()->selectedRows()) - { - m_ui->m_lstFeatures->model()->setData(index.sibling(index.row(), 2), true); - } -} - -void CWipFeaturesDlg::OnBnClickedButtonHide() -{ - for (auto index : m_ui->m_lstFeatures->selectionModel()->selectedRows()) - { - m_ui->m_lstFeatures->model()->setData(index.sibling(index.row(), 2), false); - } -} - -void CWipFeaturesDlg::OnBnClickedButtonEnable() -{ - for (auto index : m_ui->m_lstFeatures->selectionModel()->selectedRows()) - { - m_ui->m_lstFeatures->model()->setData(index.sibling(index.row(), 3), true); - } -} - -void CWipFeaturesDlg::OnBnClickedButtonDisable() -{ - for (auto index : m_ui->m_lstFeatures->selectionModel()->selectedRows()) - { - m_ui->m_lstFeatures->model()->setData(index.sibling(index.row(), 3), false); - } -} - -void CWipFeaturesDlg::OnBnClickedButtonSafemode() -{ - for (auto index : m_ui->m_lstFeatures->selectionModel()->selectedRows()) - { - m_ui->m_lstFeatures->model()->setData(index.sibling(index.row(), 4), true); - } -} - -void CWipFeaturesDlg::OnBnClickedButtonNormalmode() -{ - for (auto index : m_ui->m_lstFeatures->selectionModel()->selectedRows()) - { - m_ui->m_lstFeatures->model()->setData(index.sibling(index.row(), 4), false); - } -} - -#include - -#endif // USE_WIP_FEATURES_MANAGER diff --git a/Code/Editor/WipFeaturesDlg.h b/Code/Editor/WipFeaturesDlg.h deleted file mode 100644 index 28f4f43958..0000000000 --- a/Code/Editor/WipFeaturesDlg.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - - -#pragma once -#ifndef CRYINCLUDE_EDITOR_WIPFEATURESDLG_H -#define CRYINCLUDE_EDITOR_WIPFEATURESDLG_H - -#if !defined(Q_MOC_RUN) -#include -#endif - -#ifdef USE_WIP_FEATURES_MANAGER - -// CWipFeaturesDlg dialog - -namespace Ui -{ - class WipFeaturesDlg; -} - -class CWipFeaturesDlg - : public QDialog -{ - Q_OBJECT -public: - CWipFeaturesDlg(QWidget* pParent = nullptr); // standard constructor - virtual ~CWipFeaturesDlg(); - -private: - void OnInitDialog(); - void OnBnClickedButtonShow(); - void OnBnClickedButtonHide(); - void OnBnClickedButtonEnable(); - void OnBnClickedButtonDisable(); - void OnBnClickedButtonSafemode(); - void OnBnClickedButtonNormalmode(); - -private: - QScopedPointer m_ui; -}; - -#else - -class CWipFeaturesDlg - : public QDialog -{ - Q_OBJECT -}; - -#endif // USE_WIP_FEATURES_MANAGER - -#endif // CRYINCLUDE_EDITOR_WIPFEATURESDLG_H diff --git a/Code/Editor/WipFeaturesDlg.qrc b/Code/Editor/WipFeaturesDlg.qrc deleted file mode 100644 index 1205b1063e..0000000000 --- a/Code/Editor/WipFeaturesDlg.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - res/work_in_progress_icon.png - - diff --git a/Code/Editor/WipFeaturesDlg.ui b/Code/Editor/WipFeaturesDlg.ui deleted file mode 100644 index b4bf95e2c5..0000000000 --- a/Code/Editor/WipFeaturesDlg.ui +++ /dev/null @@ -1,184 +0,0 @@ - - - WipFeaturesDlg - - - - 0 - 0 - 620 - 342 - - - - Work in Progress Features - - - - - - Work in progress features: - - - - - - Qt::ScrollBarAlwaysOff - - - QAbstractItemView::SelectRows - - - true - - - false - - - 19 - - - - - - - Show - - - - - - - Hide - - - - - - - Qt::Horizontal - - - QSizePolicy::Ignored - - - - 74 - 20 - - - - - - - - Enable - - - - - - - Disable - - - - - - - Qt::Horizontal - - - QSizePolicy::Ignored - - - - 74 - 20 - - - - - - - - Normal Mode - - - - - - - Safe Mode - - - - - - - - - - - 64 - 64 - - - - - 64 - 64 - - - - :/res/work_in_progress_icon.png - - - - - - - - 0 - 0 - - - - NOTE:<br/>The states of the WIP features will be saved in the Editor/UI/WipFeatures.xml file when the editor exits successfuly - - - true - - - - - - - QDialogButtonBox::Close - - - - - - - - - - - buttonBox - rejected() - WipFeaturesDlg - close() - - - 647 - 339 - - - 674 - 314 - - - - - diff --git a/Code/Editor/arhitype_tree_00.png b/Code/Editor/arhitype_tree_00.png deleted file mode 100644 index 274b2b0667..0000000000 --- a/Code/Editor/arhitype_tree_00.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b9cc3783ba8ccc940e89039455f2a8617a67520400ce74c9ce4c3d16d942ead8 -size 208 diff --git a/Code/Editor/arhitype_tree_01.png b/Code/Editor/arhitype_tree_01.png deleted file mode 100644 index 274b2b0667..0000000000 --- a/Code/Editor/arhitype_tree_01.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b9cc3783ba8ccc940e89039455f2a8617a67520400ce74c9ce4c3d16d942ead8 -size 208 diff --git a/Code/Editor/arhitype_tree_02.png b/Code/Editor/arhitype_tree_02.png deleted file mode 100644 index f29a502de1..0000000000 --- a/Code/Editor/arhitype_tree_02.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1f8b26d30e8c00514648cf72bb80fe8be3f665eb7473b6565b31a4b078816bfd -size 208 diff --git a/Code/Editor/arhitype_tree_03.png b/Code/Editor/arhitype_tree_03.png deleted file mode 100644 index f29a502de1..0000000000 --- a/Code/Editor/arhitype_tree_03.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1f8b26d30e8c00514648cf72bb80fe8be3f665eb7473b6565b31a4b078816bfd -size 208 diff --git a/Code/Editor/bmp00005_00.png b/Code/Editor/bmp00005_00.png deleted file mode 100644 index 345abfaf01..0000000000 --- a/Code/Editor/bmp00005_00.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5e4a0284f8d3b2625c3f27d6505b19a0babb7af0825f08b4e08f40e647d10873 -size 388 diff --git a/Code/Editor/bmp00005_01.png b/Code/Editor/bmp00005_01.png deleted file mode 100644 index abeba83277..0000000000 --- a/Code/Editor/bmp00005_01.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:43f64ba8198c197f2dd91f00947df808fa41274411934d3d1f81e3eb44f78e7a -size 532 diff --git a/Code/Editor/bmp00005_02.png b/Code/Editor/bmp00005_02.png deleted file mode 100644 index 45439597e2..0000000000 --- a/Code/Editor/bmp00005_02.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:556929870bb8c26fe8ebf4e94536e74c2eb1084e6f566007ec3a5f2e6303fa53 -size 392 diff --git a/Code/Editor/bmp00005_03.png b/Code/Editor/bmp00005_03.png deleted file mode 100644 index b67ec062ff..0000000000 --- a/Code/Editor/bmp00005_03.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:239843fcd5a08e260106ee6eb3f69d3606321267e94df1e64ab25573d14980e1 -size 486 diff --git a/Code/Editor/bmp00005_04.png b/Code/Editor/bmp00005_04.png deleted file mode 100644 index 565730be66..0000000000 --- a/Code/Editor/bmp00005_04.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:98baf372c91fe63c423237a2a3ae5a043a4da41095698035ce86fd13f2051e44 -size 514 diff --git a/Code/Editor/bmp00005_05.png b/Code/Editor/bmp00005_05.png deleted file mode 100644 index 232c374515..0000000000 --- a/Code/Editor/bmp00005_05.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a570ae986b5f0b7e573094a7e75a8cfcc42f88b4766c47785bab26a9e8b1c2bb -size 239 diff --git a/Code/Editor/bmp00005_06.png b/Code/Editor/bmp00005_06.png deleted file mode 100644 index 3de6336a89..0000000000 --- a/Code/Editor/bmp00005_06.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4c527f2b8c883c73aebba0b5f0df6215f73b7259db61b13fa5ff7aa7b96a7b9b -size 779 diff --git a/Code/Editor/bmp00005_07.png b/Code/Editor/bmp00005_07.png deleted file mode 100644 index a813c0ad0b..0000000000 --- a/Code/Editor/bmp00005_07.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8f7f84cb48b2f9031b3a23abeddaed95d54601de33c58057d6677073b3e083aa -size 501 diff --git a/Code/Editor/bmp00005_08.png b/Code/Editor/bmp00005_08.png deleted file mode 100644 index b9f98ffe1c..0000000000 --- a/Code/Editor/bmp00005_08.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:804491b4251adfe017f8c52e00324dd74f00ebec445eedd947dea9356865cd56 -size 682 diff --git a/Code/Editor/bmp00005_09.png b/Code/Editor/bmp00005_09.png deleted file mode 100644 index 8650cc6a9e..0000000000 --- a/Code/Editor/bmp00005_09.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ecf6333b6b402e1834f3047b13e58e4f80e17a8eed3750017219b5694d1b6f67 -size 625 diff --git a/Code/Editor/bmp00006_00.png b/Code/Editor/bmp00006_00.png deleted file mode 100644 index c48f7ede09..0000000000 --- a/Code/Editor/bmp00006_00.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:70724fdada9cecd5a8d7ee5211ee713accc8f9642415e5dd93b6d621ed7273cf -size 139 diff --git a/Code/Editor/bmp00006_01.png b/Code/Editor/bmp00006_01.png deleted file mode 100644 index 7fb55bc8a5..0000000000 --- a/Code/Editor/bmp00006_01.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3d12de5789fb345c5ffe4b76246ec0ba4d7972fb14d15db3f36886f3beaed3ff -size 166 diff --git a/Code/Editor/bmp00006_02.png b/Code/Editor/bmp00006_02.png deleted file mode 100644 index 7b1ab690a3..0000000000 --- a/Code/Editor/bmp00006_02.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fffdbe9b4e1630f4158c4a00985e713ddb6fae50bc71e8c100255bab04054c0a -size 235 diff --git a/Code/Editor/bmp00006_03.png b/Code/Editor/bmp00006_03.png deleted file mode 100644 index 4829767efd..0000000000 --- a/Code/Editor/bmp00006_03.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d5e4092107dbc45863abe1cbecb30c48135e17155b5a85afa07a4a90b3eb1221 -size 274 diff --git a/Code/Editor/bmp00006_04.png b/Code/Editor/bmp00006_04.png deleted file mode 100644 index dc809b8a65..0000000000 --- a/Code/Editor/bmp00006_04.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bc454d6cf883b78ae4cc32bfe4a81a6d5ee64e5e1bade9f2069e7e1b405ad9b1 -size 373 diff --git a/Code/Editor/bmp00006_05.png b/Code/Editor/bmp00006_05.png deleted file mode 100644 index 2f3c67fff6..0000000000 --- a/Code/Editor/bmp00006_05.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:359236f395259b21b75f8f3fa250dfeea9ef82b9d541c7344954cf93db5c9d47 -size 616 diff --git a/Code/Editor/bmp00006_06.png b/Code/Editor/bmp00006_06.png deleted file mode 100644 index 86c43264ea..0000000000 --- a/Code/Editor/bmp00006_06.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bc8e5dd88bb78f4f63ba8618e2bf0c1fd74d2dbdcf48261cfa57883c476619fe -size 1101 diff --git a/Code/Editor/bmp00006_07.png b/Code/Editor/bmp00006_07.png deleted file mode 100644 index 067b20a5fb..0000000000 --- a/Code/Editor/bmp00006_07.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1fbfb749ecfec92f461979d15642dfb940cc7895db3d27c47d040b0a7e2a1ae4 -size 1288 diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index 345a8e15e1..5d45bbd853 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -347,7 +347,6 @@ set(FILES MainStatusBar.cpp MainStatusBar.h MainStatusBarItems.h - CrtDebug.cpp CryEdit.rc CryEditDoc.cpp CryEditDoc.h @@ -358,7 +357,6 @@ set(FILES LogFile.cpp LogFile.h Resource.h - UserMessageDefines.h ActionManager.cpp ActionManager.h ShortcutDispatcher.cpp @@ -397,9 +395,6 @@ set(FILES ResizeResolutionDialog.cpp ResizeResolutionDialog.h ResizeResolutionDialog.ui - SelectEAXPresetDlg.cpp - SelectEAXPresetDlg.h - SelectEAXPresetDlg.ui SelectLightAnimationDialog.cpp SelectLightAnimationDialog.h SelectSequenceDialog.cpp @@ -421,9 +416,6 @@ set(FILES IconListDialog.ui UndoDropDown.cpp UndoDropDown.h - DimensionsDialog.cpp - DimensionsDialog.h - DimensionsDialog.ui NewLevelDialog.cpp NewLevelDialog.h NewLevelDialog.ui @@ -456,12 +448,7 @@ set(FILES ToolBox.h TrackViewNewSequenceDialog.h UndoConfigSpec.h - UndoViewPosition.h - UndoViewRotation.h Util/GeometryUtil.h - WipFeaturesDlg.h - WipFeaturesDlg.ui - WipFeaturesDlg.qrc LevelIndependentFileMan.cpp LevelIndependentFileMan.h LogFileImpl.cpp @@ -550,11 +537,6 @@ set(FILES TrackViewNewSequenceDialog.cpp TrackViewNewSequenceDialog.ui UndoConfigSpec.cpp - UndoViewPosition.cpp - UndoViewRotation.cpp - WipFeatureManager.cpp - WipFeatureManager.h - WipFeaturesDlg.cpp Dialogs/ErrorsDlg.cpp Dialogs/ErrorsDlg.h Dialogs/ErrorsDlg.ui @@ -571,8 +553,6 @@ set(FILES ProcessInfo.cpp ProcessInfo.h Report.h - SurfaceTypeValidator.cpp - SurfaceTypeValidator.h TrackView/AtomOutputFrameCapture.cpp TrackView/AtomOutputFrameCapture.h TrackView/TrackViewDialog.qrc diff --git a/Code/Editor/particles_tree_00.png b/Code/Editor/particles_tree_00.png deleted file mode 100644 index 274b2b0667..0000000000 --- a/Code/Editor/particles_tree_00.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b9cc3783ba8ccc940e89039455f2a8617a67520400ce74c9ce4c3d16d942ead8 -size 208 diff --git a/Code/Editor/particles_tree_01.png b/Code/Editor/particles_tree_01.png deleted file mode 100644 index 274b2b0667..0000000000 --- a/Code/Editor/particles_tree_01.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b9cc3783ba8ccc940e89039455f2a8617a67520400ce74c9ce4c3d16d942ead8 -size 208 diff --git a/Code/Editor/particles_tree_02.png b/Code/Editor/particles_tree_02.png deleted file mode 100644 index 96f4bec585..0000000000 --- a/Code/Editor/particles_tree_02.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:19b1ee36ba28ede080ef34bd13d37a8b579ad8e106089cd1b800b15aef1b58df -size 252 diff --git a/Code/Editor/particles_tree_03.png b/Code/Editor/particles_tree_03.png deleted file mode 100644 index 3ead10b3b4..0000000000 --- a/Code/Editor/particles_tree_03.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9e6ef5e26d5d1566f51824c3bfa0ed3d2653cb49e38111aaf0572590b2fd15be -size 261 diff --git a/Code/Editor/particles_tree_04.png b/Code/Editor/particles_tree_04.png deleted file mode 100644 index 0920a2667d..0000000000 --- a/Code/Editor/particles_tree_04.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:acbeaa97474bd203ac35bf87fdea49d8b3d60f18db62d64dd47c3b1b50e54816 -size 303 diff --git a/Code/Editor/particles_tree_05.png b/Code/Editor/particles_tree_05.png deleted file mode 100644 index 0a4ce61ba0..0000000000 --- a/Code/Editor/particles_tree_05.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d92fc6ec4afc582ff5d019f5b26c48e3dbe6c5f3c753271d7918cd5ca95b8b32 -size 254 diff --git a/Code/Editor/particles_tree_06.png b/Code/Editor/particles_tree_06.png deleted file mode 100644 index e0ab042cb3..0000000000 --- a/Code/Editor/particles_tree_06.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:02066aed1d53c3ffc53c0f844a88ba8870b6c2c9c846c47ef6443c21ce4b7d0c -size 224 diff --git a/Code/Editor/particles_tree_07.png b/Code/Editor/particles_tree_07.png deleted file mode 100644 index 2ab767a7e9..0000000000 --- a/Code/Editor/particles_tree_07.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:67668cc830b553605d2f9ccad57f2fcd422da6a7515cfc4e9af0f43aa8591543 -size 213 From 2a9990ead3da2a82ca9d113eaee6f272a9c11ad7 Mon Sep 17 00:00:00 2001 From: amzn-phist <52085794+amzn-phist@users.noreply.github.com> Date: Tue, 18 Jan 2022 10:27:06 -0600 Subject: [PATCH 515/948] Fix engine template issue (#6927) * fix get_enabled_gem_cmake_file to work with "Dem" or "Code" or "Gem/Code" folder in a project fix o3de_restricted_path to make the past paramter optional Signed-off-by: byrcolin * Fix resolution of variables in `cmake_path(COMPARE)` calls in PAL.cmake The documentation for `cmake_path(COMPARE)` states that parameters marked as [](https://cmake.org/cmake/help/latest/command/cmake_path.html#conventions) are string literals. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Co-authored-by: byrcolin Co-authored-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- cmake/PAL.cmake | 35 ++++++++++++++++++++--------------- scripts/o3de/o3de/cmake.py | 28 ++++++++++++++++++---------- 2 files changed, 38 insertions(+), 25 deletions(-) diff --git a/cmake/PAL.cmake b/cmake/PAL.cmake index d0d1ad5396..ef431ff92a 100644 --- a/cmake/PAL.cmake +++ b/cmake/PAL.cmake @@ -157,17 +157,17 @@ function(o3de_restricted_id o3de_json_file restricted parent_relative_path) # This object did not have a "restricted" set, now we must look at the parent # Stop if this is a top level object o3de_manifest_restricted(manifest_restricted_paths) - get_filename_component(o3de_json_file_parent ${o3de_json_file} DIRECTORY) - get_filename_component(relative_path ${o3de_json_file_parent} NAME) - get_filename_component(o3de_json_file_parent ${o3de_json_file_parent} DIRECTORY) + cmake_path(GET o3de_json_file PARENT_PATH o3de_json_file_parent) + cmake_path(GET o3de_json_file_parent FILENAME relative_path) + cmake_path(GET o3de_json_file_parent PARENT_PATH o3de_json_file_parent) if(${o3de_json_file_parent} IN_LIST manifest_restricted_paths) set(${parent_relative_path} "" PARENT_SCOPE) set(${restricted} "" PARENT_SCOPE) return() endif() - string(LENGTH ${o3de_json_file_parent} parent_len) - while(parent_len) + set(is_prev_path_segment TRUE) + while(is_prev_path_segment) if(EXISTS ${o3de_json_file_parent}/engine.json) o3de_json_restricted(${o3de_json_file_parent}/engine.json restricted_name) if(restricted_name) @@ -199,10 +199,12 @@ function(o3de_restricted_id o3de_json_file restricted parent_relative_path) return() endif() - get_filename_component(parent ${o3de_json_file_parent} NAME) - string(PREPEND relative_path ${parent}/) - get_filename_component(o3de_json_file_parent ${o3de_json_file_parent} DIRECTORY) - string(LENGTH ${o3de_json_file_parent} parent_len) + # Remove one path segment from the end of the o3de json candidate path + cmake_path(GET o3de_json_file_parent PARENT_PATH parent_path) + cmake_path(GET o3de_json_file_parent FILENAME path_segment) + cmake_path(COMPARE "${o3de_json_file_parent}" NOT_EQUAL "${parent_path}" is_prev_path_segment) + cmake_path(SET o3de_json_file_parent "${parent_path}") + cmake_path(SET relative_path "${path_segment}/${relative_path}") endwhile() endfunction() @@ -232,10 +234,13 @@ endfunction() #! o3de_restricted_path: # # \arg:o3de_json_file json file to read restricted id from -# \arg:restricted_name name of the restricted object -function(o3de_restricted_path o3de_json_file restricted_path parent_relative_path) +# \arg:restricted_path output path of the restricted object +# \arg:parent_relative_path optional output of the path relative to the parent +function(o3de_restricted_path o3de_json_file restricted_path) #parent_relative_path o3de_restricted_id(${o3de_json_file} restricted_name parent_relative) - set(${parent_relative_path} ${parent_relative} PARENT_SCOPE) + if(${ARGC} GREATER 2) + set(${ARGV2} ${parent_relative} PARENT_SCOPE) + endif() if(restricted_name) o3de_find_restricted_folder(${restricted_name} restricted_folder) if(restricted_folder) @@ -254,7 +259,7 @@ foreach(detection_file ${detection_files}) endforeach() # set the O3DE_ENGINE_RESTRICTED_PATH -o3de_restricted_path(${LY_ROOT_FOLDER}/engine.json O3DE_ENGINE_RESTRICTED_PATH engine_has_no_parent) +o3de_restricted_path(${LY_ROOT_FOLDER}/engine.json O3DE_ENGINE_RESTRICTED_PATH) # detect platforms in the restricted path file(GLOB detection_files ${O3DE_ENGINE_RESTRICTED_PATH}/*/cmake/PALDetection_*.cmake) @@ -338,7 +343,7 @@ function(o3de_pal_dir out_name in_name object_restricted_path object_path) #pare cmake_path(GET current_object_path PARENT_PATH parent_path) cmake_path(GET current_object_path FILENAME path_segment) list(PREPEND path_segments_visited ${path_segment}) - cmake_path(COMPARE current_object_path NOT_EQUAL parent_path is_prev_path_segment) + cmake_path(COMPARE "${current_object_path}" NOT_EQUAL "${parent_path}" is_prev_path_segment) cmake_path(SET current_object_path "${parent_path}") set(is_prev_path_segment TRUE) @@ -346,7 +351,7 @@ function(o3de_pal_dir out_name in_name object_restricted_path object_path) #pare # Remove one path segment from the end of the current_object_path and prepend it to the list path_segments cmake_path(GET current_object_path PARENT_PATH parent_path) cmake_path(GET current_object_path FILENAME path_segment) - cmake_path(COMPARE current_object_path NOT_EQUAL parent_path is_prev_path_segment) + cmake_path(COMPARE "${current_object_path}" NOT_EQUAL "${parent_path}" is_prev_path_segment) cmake_path(SET current_object_path "${parent_path}") # The Path is in a PAL structure # Decompose the path into sections before "Platform" and after "Platform" diff --git a/scripts/o3de/o3de/cmake.py b/scripts/o3de/o3de/cmake.py index ec970d06f4..7a820a9677 100644 --- a/scripts/o3de/o3de/cmake.py +++ b/scripts/o3de/o3de/cmake.py @@ -235,14 +235,22 @@ def get_enabled_gem_cmake_file(project_name: str = None, enable_gem_filename = "enabled_gems.cmake" if platform == 'Common': - project_code_dir = project_path / 'Gem/Code' - if project_code_dir.is_dir(): - dependencies_file_path = project_code_dir / enable_gem_filename - return dependencies_file_path.resolve() - return (project_path / 'Code' / enable_gem_filename).resolve() + possible_project_enable_gem_filename_paths = [ + pathlib.Path(project_path / 'Gem' / enable_gem_filename), + pathlib.Path(project_path / 'Gem/Code' / enable_gem_filename), + pathlib.Path(project_path / 'Code' / enable_gem_filename) + ] + for possible_project_enable_gem_filename_path in possible_project_enable_gem_filename_paths: + if possible_project_enable_gem_filename_path.is_file(): + return possible_project_enable_gem_filename_path.resolve() + return possible_project_enable_gem_filename_paths[0].resolve() else: - project_code_dir = project_path / 'Gem/Code/Platform' / platform - if project_code_dir.is_dir(): - dependencies_file_path = project_code_dir / enable_gem_filename - return dependencies_file_path.resolve() - return (project_path / 'Code/Platform' / platform / enable_gem_filename).resolve() + possible_project_platform_enable_gem_filename_paths = [ + pathlib.Path(project_path / 'Gem/Platform' / platform / enable_gem_filename), + pathlib.Path(project_path / 'Gem/Code/Platform' / platform / enable_gem_filename), + pathlib.Path(project_path / 'Code/Platform' / platform / enable_gem_filename) + ] + for possible_project_platform_enable_gem_filename_path in possible_project_platform_enable_gem_filename_paths: + if possible_project_platform_enable_gem_filename_path.is_file(): + return possible_project_platform_enable_gem_filename_path.resolve() + return possible_project_platform_enable_gem_filename_paths[0].resolve() From 9f25c9f6774fcb2bc92f6a5b23f227efb9c5905f Mon Sep 17 00:00:00 2001 From: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> Date: Tue, 18 Jan 2022 11:54:29 -0600 Subject: [PATCH 516/948] Skipping ShapeIntersectionFilter test Signed-off-by: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> --- .../PythonTests/largeworlds/dyn_veg/TestSuite_Main_Optimized.py | 1 + 1 file changed, 1 insertion(+) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Main_Optimized.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Main_Optimized.py index 5b1e504442..af1c187817 100644 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Main_Optimized.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Main_Optimized.py @@ -131,6 +131,7 @@ class TestAutomation_PrefabNotEnabled(EditorTestSuite): class test_ShapeIntersectionFilter_InstancesPlantInAssignedShape(EditorParallelTest): from .EditorScripts import ShapeIntersectionFilter_InstancesPlantInAssignedShape as test_module + @pytest.mark.skip("https://github.com/o3de/o3de/issues/6973") class test_ShapeIntersectionFilter_FilterStageToggle(EditorParallelTest): from .EditorScripts import ShapeIntersectionFilter_FilterStageToggle as test_module From 7694a29fa1f4cd4d4872d8c1ccc1fc83ea9cdc63 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Tue, 18 Jan 2022 10:16:33 -0800 Subject: [PATCH 517/948] Material Editor tests for window pane function Signed-off-by: Scott Murray --- .../Gem/PythonTests/Atom/TestSuite_Main.py | 4 +++- .../Atom/atom_utils/material_editor_utils.py | 4 ++-- .../hydra_AtomMaterialEditor_BasicTests.py | 24 +++++++++++++++++++ 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main.py b/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main.py index 7051b9983c..f1e66ac492 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/TestSuite_Main.py @@ -173,9 +173,11 @@ class TestMaterialEditorBasicTests(object): "Document saved as copy is saved with changes: True", "Document saved as child is saved with changes: True", "Save All worked as expected: True", + "P1: Asset Browser visibility working as expected: True", + "P1: Inspector visibility working as expected: True", ] unexpected_lines = [ - "Traceback (most recent call last):" + # Including any lines in unexpected_lines will cause the test to run for the duration of the timeout ] hydra.launch_and_validate_results( diff --git a/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/material_editor_utils.py b/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/material_editor_utils.py index f7ff970541..96eeb4279e 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/material_editor_utils.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/atom_utils/material_editor_utils.py @@ -125,11 +125,11 @@ def is_pane_visible(pane_name): """ :return: bool """ - return atomtools.AtomToolsWindowRequestBus(bus.Broadcast, "IsDockWidgetVisible", pane_name) + return atomtools.AtomToolsMainWindowRequestBus(bus.Broadcast, "IsDockWidgetVisible", pane_name) def set_pane_visibility(pane_name, value): - atomtools.AtomToolsWindowRequestBus(bus.Broadcast, "SetDockWidgetVisible", pane_name, value) + atomtools.AtomToolsMainWindowRequestBus(bus.Broadcast, "SetDockWidgetVisible", pane_name, value) def select_lighting_config(config_name): diff --git a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomMaterialEditor_BasicTests.py b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomMaterialEditor_BasicTests.py index baad02318d..bd00a84919 100644 --- a/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomMaterialEditor_BasicTests.py +++ b/AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_AtomMaterialEditor_BasicTests.py @@ -36,6 +36,19 @@ MATERIAL_TYPE_PATH = os.path.join( CACHE_FILE_EXTENSION = ".azmaterial" +def verify_pane_visibility(pane_name: str): + """ + print log lines indicating Material Editor pane visibility function + :param pane_name: Name of the pane to be tested + """ + initial_value = material_editor.is_pane_visible(pane_name) + material_editor.set_pane_visibility(pane_name, not initial_value) + result = (material_editor.is_pane_visible(pane_name) is not initial_value) + material_editor.set_pane_visibility(pane_name, initial_value) + result = result and (initial_value is material_editor.is_pane_visible(pane_name)) + print(f"P1: {pane_name} visibility working as expected: {result}") + + def run(): """ Summary: @@ -49,9 +62,12 @@ def run(): 7. Saving as a New Material 8. Saving as a Child Material 9. Saving all Open Materials + 10. Verify Asset Browser pane visibility + 11. Verify Material Inspector pane visibility Expected Result: All the above functions work as expected in Material Editor. + Pane visibility functions as expected :return: None """ @@ -186,6 +202,14 @@ def run(): material_editor.set_property(document2_id, property2_name, initial_color) material_editor.save_all() material_editor.close_all_documents() + + # 10) Verify Asset Browser pane visibility + verify_pane_visibility("Asset Browser") + + # 11) Verify Material Inspector pane visibility + verify_pane_visibility("Inspector") + + # Confirm documents closed and exit Material Editor material_editor.wait_for_condition(lambda: (not material_editor.is_open(document1_id)) and (not material_editor.is_open(document2_id)) and From 786d6b5f85e7c1f5bf1f9ce8d24a0571c8d06ba1 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Tue, 18 Jan 2022 10:22:31 -0800 Subject: [PATCH 518/948] minor code readability tweak Signed-off-by: Gene Walters --- .../Code/Source/NetworkEntity/NetworkEntityManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkEntityManager.cpp b/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkEntityManager.cpp index fa524d464a..0a6aeea8a8 100644 --- a/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkEntityManager.cpp +++ b/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkEntityManager.cpp @@ -542,7 +542,7 @@ namespace Multiplayer optionalArgs.m_preInsertionCallback = [netSpawnableName, rootTransform = transform] (AzFramework::EntitySpawnTicket::Id, AzFramework::SpawnableEntityContainerView entities) { - bool shouldUpdateTransform = (rootTransform.IsClose(AZ::Transform::Identity()) == false); + const bool shouldUpdateTransform = !rootTransform.IsClose(AZ::Transform::Identity()); for (uint32_t netEntityIndex = 0, entitiesSize = aznumeric_cast(entities.size()); netEntityIndex < entitiesSize; ++netEntityIndex) From 626b16dbaeeb40594303fa49ad473d37684eb9b1 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Tue, 18 Jan 2022 10:27:10 -0800 Subject: [PATCH 519/948] Updating NetworkingSpawnableLibrary to only store network spawnables, instead of all spawnables Signed-off-by: Gene Walters --- .../Code/Source/NetworkEntity/NetworkSpawnableLibrary.cpp | 4 ++-- .../Code/Source/NetworkEntity/NetworkSpawnableLibrary.h | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.cpp b/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.cpp index f60778dbb4..7fb7bfdc39 100644 --- a/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.cpp +++ b/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.cpp @@ -10,7 +10,6 @@ #include #include #include -#include #include namespace Multiplayer @@ -42,7 +41,8 @@ namespace Multiplayer auto enumerateCallback = [this](const AZ::Data::AssetId id, const AZ::Data::AssetInfo& info) { - if (info.m_assetType == AZ::AzTypeInfo::Uuid()) + if (info.m_assetType == AZ::AzTypeInfo::Uuid() && + info.m_relativePath.ends_with(".network.spawnable")) { ProcessSpawnableAsset(info.m_relativePath, id); } diff --git a/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.h b/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.h index 0fc3ae07cc..469086f4cb 100644 --- a/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.h +++ b/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.h @@ -23,12 +23,15 @@ namespace Multiplayer NetworkSpawnableLibrary(); ~NetworkSpawnableLibrary(); - /// INetworkSpawnableLibrary overrides. + //! INetworkSpawnableLibrary overrides. + //! @{ + // Iterates over all assets (on-disk and in-memory) and stores any spawnables that are "network.spawnables" + // This allows us to look up network spawnable assets by name or id for later use void BuildSpawnablesList() override; void ProcessSpawnableAsset(const AZStd::string& relativePath, AZ::Data::AssetId id) override; AZ::Name GetSpawnableNameFromAssetId(AZ::Data::AssetId assetId) override; AZ::Data::AssetId GetAssetIdByName(AZ::Name name) override; - + //! @} private: AZStd::unordered_map m_spawnables; From c5b128bec422a9ac716ac4f9164b204daabd29c3 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Fri, 17 Dec 2021 00:46:40 -0800 Subject: [PATCH 520/948] First pass at reworking and formalizing the way deferred material asset baking works. The feature basically works but needs more testing. Before, the material builder was loading the MaterialTypeAsset and doing some processing with it, but was avoiding declaring job dependencies that would cause reprocessing lots of assets when a shader or .materialtype file changes. Reading the asset data isn't safe when not declaring a job dependency (or when declaring a weak job dependency like OrderOnce which is the case here). This caused to several known bugs. The main change here is it no longer loads the MaterialTypeAsset at all; all other changes flow from there. The biggest changes (when deferred material processing is enabled) are ... 1) MaterialSourceData no longer loads MaterialTypeAsset. All it really needs is to determine whether a string is an image file reference or an enum value, which is easy to do by just looking for the "." for the extension. 2) MaterialAssetCreator no longer produces a finalized material asset. It no longer uses MaterialAssetCreatorCommon because that only produces a non-finalized MaterialAsset, which has very different needs for the SetPropertyValue function. (We could consider merging MaterialAssetCreatorCommon into MaterialTypeAssetCreator since that's the only subclass at this point). And it doesn't do any validation against the properties layout since that can be done at runtime. 3) Moved processing of enum property values from MaterialSourceData to MaterialAsset::Finalize (this was the only thing being done in the builder that actually needed to read the material type asset data). Also... - Updated the MaterialAsset class mostly to clarify and formalize the two different modes it can be in: whether it is finalized or not. - Merged the separate "IncludeMaterialPropertyNames" registry settings from MaterialConverterSystemComponent and MaterialBuilder into one "FinalizeMaterialAssets" setting used for both. - Removed MaterialSourceData::ApplyVersionUpdates. Now the flow of data is the same regardless of whether the materials are finalized by the AP or at runtime. Version updates are always applied on the MaterialAsset. - Added a validation check to MaterialTypeAssetCreator ensuring that once a property is renamed, the old name can never be used again for a new property. This assumption was already made previously, but not formalized, in that Material::FindPropertyIndex does not expect every caller to provide a version number for the material property name, also the material asset's list of raw property names was never versioned. The only way for this to be a safe assumption is to prevent reuse of old names. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../MaterialConverterSystemComponent.cpp | 8 +- .../MaterialConverterSystemComponent.h | 6 - .../RPI.Edit/Material/MaterialConverterBus.h | 4 - .../RPI.Edit/Material/MaterialSourceData.h | 21 +- .../Atom/RPI.Edit/Material/MaterialUtils.h | 5 + .../Atom/RPI.Reflect/Material/MaterialAsset.h | 53 +++-- .../Material/MaterialAssetCreator.h | 19 +- .../Material/MaterialPropertyValue.h | 4 + .../RPI.Builders/Material/MaterialBuilder.cpp | 62 ++--- .../Model/MaterialAssetBuilderComponent.cpp | 25 ++- .../RPI.Edit/Material/MaterialSourceData.cpp | 212 ++++++++---------- .../RPI.Edit/Material/MaterialUtils.cpp | 15 ++ .../RPI.Reflect/Material/MaterialAsset.cpp | 135 +++++++---- .../Material/MaterialAssetCreator.cpp | 115 +++------- .../Material/MaterialTypeAssetCreator.cpp | 15 ++ .../Material/MaterialVersionUpdate.cpp | 12 +- .../Code/Source/Document/MaterialDocument.cpp | 6 - 17 files changed, 362 insertions(+), 355 deletions(-) diff --git a/Gems/Atom/Feature/Common/Code/Source/Material/MaterialConverterSystemComponent.cpp b/Gems/Atom/Feature/Common/Code/Source/Material/MaterialConverterSystemComponent.cpp index fd1c836b96..d5096d7a0b 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Material/MaterialConverterSystemComponent.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/Material/MaterialConverterSystemComponent.cpp @@ -28,8 +28,7 @@ namespace AZ serializeContext->Class() ->Version(2) ->Field("Enable", &MaterialConverterSettings::m_enable) - ->Field("DefaultMaterial", &MaterialConverterSettings::m_defaultMaterial) - ->Field("IncludeMaterialPropertyNames", &MaterialConverterSettings::m_includeMaterialPropertyNames); + ->Field("DefaultMaterial", &MaterialConverterSettings::m_defaultMaterial); } } @@ -70,11 +69,6 @@ namespace AZ return m_settings.m_enable; } - bool MaterialConverterSystemComponent::ShouldIncludeMaterialPropertyNames() const - { - return m_settings.m_includeMaterialPropertyNames; - } - bool MaterialConverterSystemComponent::ConvertMaterial( const AZ::SceneAPI::DataTypes::IMaterialData& materialData, RPI::MaterialSourceData& sourceData) { diff --git a/Gems/Atom/Feature/Common/Code/Source/Material/MaterialConverterSystemComponent.h b/Gems/Atom/Feature/Common/Code/Source/Material/MaterialConverterSystemComponent.h index 150529b474..7d95024759 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Material/MaterialConverterSystemComponent.h +++ b/Gems/Atom/Feature/Common/Code/Source/Material/MaterialConverterSystemComponent.h @@ -26,11 +26,6 @@ namespace AZ bool m_enable = true; AZStd::string m_defaultMaterial; - //! Sets whether to include material property names when generating material assets. If this - //! setting is true, material property name resolution and validation is deferred into load - //! time rather than at build time, allowing to break some dependencies (e.g. fbx files will no - //! longer need to be dependent on materialtype files). - bool m_includeMaterialPropertyNames = true; }; //! Atom's implementation of converting SceneAPI data into Atom's default material: StandardPBR @@ -50,7 +45,6 @@ namespace AZ // MaterialConverterBus overrides ... bool IsEnabled() const override; - bool ShouldIncludeMaterialPropertyNames() const override; bool ConvertMaterial(const AZ::SceneAPI::DataTypes::IMaterialData& materialData, RPI::MaterialSourceData& out) override; AZStd::string GetMaterialTypePath() const override; AZStd::string GetDefaultMaterialPath() const override; diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialConverterBus.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialConverterBus.h index 1807fca15e..8052fc4feb 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialConverterBus.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialConverterBus.h @@ -32,10 +32,6 @@ namespace AZ virtual bool IsEnabled() const = 0; - //! Returns true if material property names should be included in azmaterials. This allows unlinking of dependencies for some - //! file types to materialtype files (e.g. fbx). - virtual bool ShouldIncludeMaterialPropertyNames() const = 0; - //! Converts data from a IMaterialData object to an Atom MaterialSourceData. //! Only works when IsEnabled() is true. //! @return true if the MaterialSourceData output was populated with converted material data. diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialSourceData.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialSourceData.h index 53d3072370..a5fb0214e6 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialSourceData.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialSourceData.h @@ -33,6 +33,12 @@ namespace AZ class MaterialAsset; class MaterialAssetCreator; + enum MaterialAssetProcessingMode + { + PreBake, //!< all material asset processing is done in the Asset Processor, producing a finalized material asset + DeferredBake //!< some material asset processing is deferred, and the material asset is finalized at runtime after loading + }; + //! This is a simple data structure for serializing in/out material source files. class MaterialSourceData final { @@ -72,35 +78,28 @@ namespace AZ UpdatesApplied }; - //! Checks the material type version and potentially applies a series of property changes (most common are simple property renames) - //! based on the MaterialTypeAsset's version update procedure. - //! @param materialSourceFilePath Indicates the path of the .material file that the MaterialSourceData represents. Used for resolving file-relative paths. - ApplyVersionUpdatesResult ApplyVersionUpdates(AZStd::string_view materialSourceFilePath = ""); - //! Creates a MaterialAsset from the MaterialSourceData content. //! @param assetId ID for the MaterialAsset //! @param materialSourceFilePath Indicates the path of the .material file that the MaterialSourceData represents. Used for //! resolving file-relative paths. + //! @param processingMode Indicates whether to finalize the material asset using data from the MaterialTypeAsset. //! @param elevateWarnings Indicates whether to treat warnings as errors - //! @param includeMaterialPropertyNames Indicates whether to save material property names into the material asset file Outcome> CreateMaterialAsset( Data::AssetId assetId, - AZStd::string_view materialSourceFilePath = "", - bool elevateWarnings = true, - bool includeMaterialPropertyNames = true) const; + AZStd::string_view materialSourceFilePath, + MaterialAssetProcessingMode processingMode, + bool elevateWarnings = true) const; //! Creates a MaterialAsset from the MaterialSourceData content. //! @param assetId ID for the MaterialAsset //! @param materialSourceFilePath Indicates the path of the .material file that the MaterialSourceData represents. Used for //! resolving file-relative paths. //! @param elevateWarnings Indicates whether to treat warnings as errors - //! @param includeMaterialPropertyNames Indicates whether to save material property names into the material asset file //! @param sourceDependencies if not null, will be populated with a set of all of the loaded material and material type paths Outcome> CreateMaterialAssetFromSourceData( Data::AssetId assetId, AZStd::string_view materialSourceFilePath = "", bool elevateWarnings = true, - bool includeMaterialPropertyNames = true, AZStd::unordered_set* sourceDependencies = nullptr) const; private: diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialUtils.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialUtils.h index c1183c7aa1..2fb55e5f40 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialUtils.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialUtils.h @@ -64,6 +64,11 @@ namespace AZ void CheckForUnrecognizedJsonFields( const AZStd::string_view* acceptedFieldNames, uint32_t acceptedFieldNameCount, const rapidjson::Value& object, JsonDeserializerContext& context, JsonSerializationResult::ResultCode& result); + + //! Materials assets can either be finalized during asset-processing time or when materials are loaded at runtime. + //! Finalizing during asset processing reduces load times and obfuscates the material data. + //! Waiting to finalize at load time reduces dependencies on the material type data, resulting in fewer asset rebuilds and less time spent processing assets. + bool BuildersShouldFinalizeMaterialAssets(); } } } diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAsset.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAsset.h index 2a1de6debd..34e51b40af 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAsset.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAsset.h @@ -105,6 +105,16 @@ namespace AZ //! Returns a layout that includes a list of MaterialPropertyDescriptors for each material property. const MaterialPropertiesLayout* GetMaterialPropertiesLayout() const; + //! Returns whether the material's properties are fully processed or not. + //! If true, property values can be accessed through GetPropertyValues(). + //! If false, property values can be accessed through GetRawPropertyValues(). + bool IsFinalized() const; + + //! If the material asset is not finalized yet, this does the final processing of m_rawPropertyValues to + //! get the material asset ready to be used. + //! Note m_materialTypeAsset must be valid before this is called. + void Finalize(); + //! Returns the list of values for all properties in this material. //! The entries in this list align with the entries in the MaterialPropertiesLayout. Each AZStd::any is guaranteed //! to have a value of type that matches the corresponding MaterialPropertyDescriptor. @@ -112,16 +122,13 @@ namespace AZ //! //! Note that even though material source data files contain only override values and inherit the rest from //! their parent material, they all get flattened at build time so every MaterialAsset has the full set of values. - AZStd::array_view GetPropertyValues() const; + const AZStd::vector& GetPropertyValues() const; + + const AZStd::vector>& GetRawPropertyValues() const; private: bool PostLoadInit() override; - //! Realigns property value and name indices with MaterialProperiesLayout by using m_propertyNames. Property names not found in the - //! MaterialPropertiesLayout are discarded, while property names not included in m_propertyNames will use the default value - //! from m_materialTypeAsset. - void RealignPropertyValuesAndNames(); - //! Checks the material type version and potentially applies a series of property changes (most common are simple property renames) //! based on the MaterialTypeAsset's version update procedure. void ApplyVersionUpdates(); @@ -146,17 +153,33 @@ namespace AZ //! Holds values for each material property, used to initialize Material instances. //! This is indexed by MaterialPropertyIndex and aligns with entries in m_materialPropertiesLayout. AZStd::vector m_propertyValues; - //! This is used to realign m_propertyValues as well as itself with MaterialPropertiesLayout when not empty. - //! If empty, this implies that m_propertyValues is aligned with the entries in m_materialPropertiesLayout. - AZStd::vector m_propertyNames; - //! The materialTypeVersion this materialAsset was based of. If the versions do not match at runtime when a - //! materialTypeAsset is loaded, an update will be performed on m_propertyNames if populated. + //! The MaterialAsset can be created in a "half-baked" state where minimal processing has been done because it does + //! not yet have access to the MaterialTypeAsset. In that case, this list will be populated with values copied from + //! the source .material file with little or no validation or other processing, and the m_propertyValues list will be empty. + //! Once a MaterialTypeAsset is available, Finalize() must be called to finish processing these values into the + //! final m_propertyValues list. + //! Note that the content of this list will remain after finalizing in order to support hot-reload of the MaterialTypeAsset. + //! The reason we use a vector instead of a map is to ensure inherited property values are applied in the right order; + //! if the material has a parent, and that parent uses an older material type version with renamed properties, then + //! m_rawPropertyValues could be holding two values for the same property under different names. The auto-rename process + //! can't be applied until the MaterialTypeAsset is available, so we have to keep the properties in the same order they + //! were originally encountered. + AZStd::vector> m_rawPropertyValues; + + //! Tracks whether Finalize() has been called, meaning m_propertyValues is populated with data matching the material type's property layout. + bool m_isFinalized = false; + + //! Tracks whether the MaterialAsset was already in a finalized state when it was loaded. + //! (This value is intentionally not serialized) + bool m_wasPreFinalized = false; + + //! The materialTypeVersion this materialAsset was based off. If the versions do not match at runtime when a + //! materialTypeAsset is loaded, automatic updates will be attempted at runtime. Note this is not needed to + //! determine which updates to apply, but simply as an optimization to ignore the update procedure when the + //! version numbers match. (We determine which updates to apply by simply checking the property name, and not + //! allowing the same name to ever be used for two different properties, see MaterialTypeAssetCreator::ValidateMaterialVersion) uint32_t m_materialTypeVersion = 1; - - //! A flag to determine if m_propertyValues needs to be aligned with MaterialPropertiesLayout. Set to true whenever - //! m_materialTypeAsset is reinitializing. - bool m_isDirty = true; }; diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAssetCreator.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAssetCreator.h index 862d98ce0c..b7b1f9705f 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAssetCreator.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAssetCreator.h @@ -9,7 +9,6 @@ #include #include -#include namespace AZ { @@ -19,21 +18,21 @@ namespace AZ //! The MaterialAsset will be based on a MaterialTypeAsset or another MaterialAsset. //! Either way, the base provides the necessary data to define the layout //! and behavior of the material. The MaterialAsset only provides property value overrides. - class MaterialAssetCreator + //! Note however that the MaterialTypeAsset does not have to be loaded and available yet; + //! only the AssetId is required. The resulting MaterialAsset will be in a non-finalized state; + //! it must be finalized afterwards when the MaterialTypeAsset is available before it can be used. + class MaterialAssetCreator : public AssetCreator - , public MaterialAssetCreatorCommon { public: friend class MaterialSourceData; - - void Begin(const Data::AssetId& assetId, MaterialAsset& parentMaterial, bool includeMaterialPropertyNames = true); - void Begin(const Data::AssetId& assetId, MaterialTypeAsset& materialType, bool includeMaterialPropertyNames = true); + + void Begin(const Data::AssetId& assetId, const Data::Asset& materialType); bool End(Data::Asset& result); - private: - void PopulatePropertyNameList(); - - const MaterialPropertiesLayout* m_materialPropertiesLayout = nullptr; + void SetMaterialTypeVersion(uint32_t version); + + void SetPropertyValue(const Name& name, const MaterialPropertyValue& value); }; } // namespace RPI } // namespace AZ diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialPropertyValue.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialPropertyValue.h index 718615eb9f..79dda1d80a 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialPropertyValue.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialPropertyValue.h @@ -30,6 +30,10 @@ namespace AZ { namespace RPI { + //! This is a variant data type that represents the value of a material property. + //! For convenience, it supports all the types necessary for *both* the runtime data (MaterialAsset) as well as .material file data (MaterialSourceData). + //! For example, Instance is exclusive to the runtime data and AZStd::string is primarily for image file paths in .material files. Most other + //! data types are relevant in both contexts. class MaterialPropertyValue final { public: diff --git a/Gems/Atom/RPI/Code/Source/RPI.Builders/Material/MaterialBuilder.cpp b/Gems/Atom/RPI/Code/Source/RPI.Builders/Material/MaterialBuilder.cpp index f11b2f94ac..1b5635a1c1 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Builders/Material/MaterialBuilder.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Builders/Material/MaterialBuilder.cpp @@ -43,17 +43,24 @@ namespace AZ const char* MaterialBuilder::JobKey = "Atom Material Builder"; + AZStd::string GetBuilderSettingsFingerprint() + { + return AZStd::string::format("[BuildersShouldFinalizeMaterialAssets=%d]", MaterialUtils::BuildersShouldFinalizeMaterialAssets()); + } + void MaterialBuilder::RegisterBuilder() { AssetBuilderSDK::AssetBuilderDesc materialBuilderDescriptor; materialBuilderDescriptor.m_name = JobKey; - materialBuilderDescriptor.m_version = 110; // Material version auto update feature + materialBuilderDescriptor.m_version = 111; // material dependency improvements materialBuilderDescriptor.m_patterns.push_back(AssetBuilderSDK::AssetBuilderPattern("*.material", AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard)); materialBuilderDescriptor.m_patterns.push_back(AssetBuilderSDK::AssetBuilderPattern("*.materialtype", AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard)); materialBuilderDescriptor.m_busId = azrtti_typeid(); materialBuilderDescriptor.m_createJobFunction = AZStd::bind(&MaterialBuilder::CreateJobs, this, AZStd::placeholders::_1, AZStd::placeholders::_2); materialBuilderDescriptor.m_processJobFunction = AZStd::bind(&MaterialBuilder::ProcessJob, this, AZStd::placeholders::_1, AZStd::placeholders::_2); + materialBuilderDescriptor.m_analysisFingerprint = GetBuilderSettingsFingerprint(); + BusConnect(materialBuilderDescriptor.m_busId); AssetBuilderSDK::AssetBuilderBus::Broadcast(&AssetBuilderSDK::AssetBuilderBus::Handler::RegisterBuilderInformation, materialBuilderDescriptor); @@ -63,7 +70,7 @@ namespace AZ { BusDisconnect(); } - + bool MaterialBuilder::ReportMaterialAssetWarningsAsErrors() const { bool warningsAsErrors = false; @@ -77,15 +84,18 @@ namespace AZ //! Adds all relevant dependencies for a referenced source file, considering that the path might be relative to the original file location or a full asset path. //! This will usually include multiple source dependencies and a single job dependency, but will include only source dependencies if the file is not found. //! Note the AssetBuilderSDK::JobDependency::m_platformIdentifier will not be set by this function. The calling code must set this value before passing back - //! to the AssetBuilderSDK::CreateJobsResponse. If isOrderedOnceForMaterialTypes is true and the dependency is a .materialtype file, the job dependency type - //! will be set to JobDependencyType::OrderOnce. - void AddPossibleDependencies(AZStd::string_view currentFilePath, - AZStd::string_view referencedParentPath, + //! to the AssetBuilderSDK::CreateJobsResponse. + void AddPossibleDependencies( + const AZStd::string& currentFilePath, + const AZStd::string& referencedParentPath, const char* jobKey, - AZStd::vector& jobDependencies, - bool isOrderedOnceForMaterialTypes = false) + AZStd::vector& jobDependencies) { bool dependencyFileFound = false; + + const bool currentFileIsMaterial = AzFramework::StringFunc::Path::IsExtension(currentFilePath.c_str(), MaterialSourceData::Extension); + const bool referencedFileIsMaterialType = AzFramework::StringFunc::Path::IsExtension(referencedParentPath.c_str(), MaterialTypeSourceData::Extension); + const bool ShouldFinalizeMaterialAssets = MaterialUtils::BuildersShouldFinalizeMaterialAssets(); AZStd::vector possibleDependencies = RPI::AssetUtils::GetPossibleDepenencyPaths(currentFilePath, referencedParentPath); for (auto& file : possibleDependencies) @@ -103,9 +113,15 @@ namespace AZ AssetBuilderSDK::JobDependency jobDependency; jobDependency.m_jobKey = jobKey; jobDependency.m_sourceFile.m_sourceFileDependencyPath = file; - - const bool isMaterialTypeFile = AzFramework::StringFunc::Path::IsExtension(file.c_str(), MaterialTypeSourceData::Extension); - jobDependency.m_type = (isMaterialTypeFile && isOrderedOnceForMaterialTypes) ? AssetBuilderSDK::JobDependencyType::OrderOnce : AssetBuilderSDK::JobDependencyType::Order; + jobDependency.m_type = AssetBuilderSDK::JobDependencyType::Order; + + // If we aren't finalizing material assets, then a normal job dependency isn't needed because the MaterialTypeAsset data won't be used. + // However, we do still need at least an OrderOnce dependency to ensure the Asset Processor knows about the material type asset so the builder can get it's AssetId. + // This can significantly reduce AP processing time when a material type or its shaders are edited. + if (currentFileIsMaterial && referencedFileIsMaterialType && !ShouldFinalizeMaterialAssets) + { + jobDependency.m_type = AssetBuilderSDK::JobDependencyType::OrderOnce; + } jobDependencies.push_back(jobDependency); } @@ -156,7 +172,8 @@ namespace AZ // We'll build up this one JobDescriptor and reuse it to register each of the platforms AssetBuilderSDK::JobDescriptor outputJobDescriptor; outputJobDescriptor.m_jobKey = JobKey; - + outputJobDescriptor.m_additionalFingerprintInfo = GetBuilderSettingsFingerprint(); + // Load the file so we can detect and report dependencies. // If the file is a .materialtype, report dependencies on the .shader files. // If the file is a .material, report a dependency on the .materialtype and parent .material file @@ -233,24 +250,12 @@ namespace AZ parentMaterialPath = materialTypePath; } - // If includeMaterialPropertyNames is false, then a job dependency is needed so the material builder can validate MaterialAsset properties - // against the MaterialTypeAsset at asset build time. - // If includeMaterialPropertyNames is true, the material properties will be validated at runtime when the material is loaded, so the job dependency - // is needed only for first-time processing to set up the initial MaterialAsset. This speeds up AP processing time when a materialtype file - // is edited (e.g. 10s when editing StandardPBR.materialtype on AtomTest project from 45s). - bool includeMaterialPropertyNames = true; - if (auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr) - { - settingsRegistry->Get(includeMaterialPropertyNames, "/O3DE/Atom/RPI/MaterialBuilder/IncludeMaterialPropertyNames"); - } - // Register dependency on the parent material source file so we can load it and use it's data to build this variant material. // Note, we don't need a direct dependency on the material type because the parent material will depend on it. AddPossibleDependencies(request.m_sourceFile, parentMaterialPath, JobKey, - outputJobDescriptor.m_jobDependencyList, - includeMaterialPropertyNames); + outputJobDescriptor.m_jobDependencyList); } } @@ -297,12 +302,9 @@ namespace AZ return {}; } - if (MaterialSourceData::ApplyVersionUpdatesResult::Failed == material.GetValue().ApplyVersionUpdates(materialSourceFilePath)) - { - return {}; - } + MaterialAssetProcessingMode processingMode = MaterialUtils::BuildersShouldFinalizeMaterialAssets() ? MaterialAssetProcessingMode::PreBake : MaterialAssetProcessingMode::DeferredBake; - auto materialAssetOutcome = material.GetValue().CreateMaterialAsset(Uuid::CreateRandom(), materialSourceFilePath, ReportMaterialAssetWarningsAsErrors()); + auto materialAssetOutcome = material.GetValue().CreateMaterialAsset(Uuid::CreateRandom(), materialSourceFilePath, processingMode, ReportMaterialAssetWarningsAsErrors()); if (!materialAssetOutcome.IsSuccess()) { return {}; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MaterialAssetBuilderComponent.cpp b/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MaterialAssetBuilderComponent.cpp index c83761cf8e..ef251b6848 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MaterialAssetBuilderComponent.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MaterialAssetBuilderComponent.cpp @@ -28,6 +28,7 @@ #include #include +#include #include #include @@ -44,7 +45,7 @@ namespace AZ if (auto* serialize = azrtti_cast(context)) { serialize->Class() - ->Version(5) // Set materialtype dependency to OrderOnce + ->Version(5) // <<<<< This probably is NOT the version number you want to bump. What you're looking for is MaterialAssetBuilderComponent::Reflect below ->Attribute(Edit::Attributes::SystemComponentTags, AZStd::vector({ AssetBuilderSDK::ComponentTags::AssetBuilder })); } } @@ -93,9 +94,11 @@ namespace AZ // material properties will be validated at runtime when the material is loaded, so the job dependency is needed only for // first-time processing to set up the initial MaterialAsset. This speeds up AP processing time when a materialtype file is // edited (e.g. 10s when editing StandardPBR.materialtype on AtomTest project from 45s). - bool includeMaterialPropertyNames = true; - RPI::MaterialConverterBus::BroadcastResult(includeMaterialPropertyNames, &RPI::MaterialConverterBus::Events::ShouldIncludeMaterialPropertyNames); - jobDependency.m_type = includeMaterialPropertyNames ? AssetBuilderSDK::JobDependencyType::OrderOnce : AssetBuilderSDK::JobDependencyType::Order; + + // If we aren't finalizing material assets, then a normal job dependency isn't needed because the MaterialTypeAsset data won't be used. + // However, we do still need at least an OrderOnce dependency to ensure the Asset Processor knows about the material type asset so the builder can get it's AssetId. + // This can significantly reduce AP processing time when a material type or its shaders are edited. + jobDependency.m_type = MaterialUtils::BuildersShouldFinalizeMaterialAssets() ? AssetBuilderSDK::JobDependencyType::OrderOnce : AssetBuilderSDK::JobDependencyType::Order; jobDependencyList.push_back(jobDependency); } @@ -108,10 +111,8 @@ namespace AZ bool conversionEnabled = false; RPI::MaterialConverterBus::BroadcastResult(conversionEnabled, &RPI::MaterialConverterBus::Events::IsEnabled); fingerprintInfo.insert(AZStd::string::format("[MaterialConverter enabled=%d]", conversionEnabled)); - - bool includeMaterialPropertyNames = true; - RPI::MaterialConverterBus::BroadcastResult(includeMaterialPropertyNames, &RPI::MaterialConverterBus::Events::ShouldIncludeMaterialPropertyNames); - fingerprintInfo.insert(AZStd::string::format("[MaterialConverter includeMaterialPropertyNames=%d]", includeMaterialPropertyNames)); + + fingerprintInfo.insert(AZStd::string::format("[BuildersShouldFinalizeMaterialAssets=%d]", MaterialUtils::BuildersShouldFinalizeMaterialAssets())); if (!conversionEnabled) { @@ -126,7 +127,7 @@ namespace AZ if (auto* serialize = azrtti_cast(context)) { serialize->Class() - ->Version(16); // Optional material conversion + ->Version(17); // Optional material conversion } } @@ -230,9 +231,9 @@ namespace AZ } } } + + MaterialAssetProcessingMode processingMode = MaterialUtils::BuildersShouldFinalizeMaterialAssets() ? MaterialAssetProcessingMode::PreBake : MaterialAssetProcessingMode::DeferredBake; - bool includeMaterialPropertyNames = true; - RPI::MaterialConverterBus::BroadcastResult(includeMaterialPropertyNames, &RPI::MaterialConverterBus::Events::ShouldIncludeMaterialPropertyNames); // Build material assets. for (auto& itr : materialSourceDataByUid) { @@ -240,7 +241,7 @@ namespace AZ Data::AssetId assetId(sourceSceneUuid, GetMaterialAssetSubId(materialUid)); auto materialSourceData = itr.second; - Outcome> result = materialSourceData.m_data.CreateMaterialAsset(assetId, "", false, includeMaterialPropertyNames); + Outcome> result = materialSourceData.m_data.CreateMaterialAsset(assetId, "", processingMode, false); if (result.IsSuccess()) { context.m_outputMaterialsByUid[materialUid] = { result.GetValue(), materialSourceData.m_name }; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp index 4351213c22..cd01544bfa 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp @@ -74,77 +74,49 @@ namespace AZ } } - MaterialSourceData::ApplyVersionUpdatesResult MaterialSourceData::ApplyVersionUpdates(AZStd::string_view materialSourceFilePath) + Outcome> MaterialSourceData::CreateMaterialAsset( + Data::AssetId assetId, AZStd::string_view materialSourceFilePath, MaterialAssetProcessingMode processingMode, bool elevateWarnings) const { - AZStd::string materialTypeFullPath = AssetUtils::ResolvePathReference(materialSourceFilePath, m_materialType); - auto materialTypeSourceDataOutcome = MaterialUtils::LoadMaterialTypeSourceData(materialTypeFullPath); - if (!materialTypeSourceDataOutcome.IsSuccess()) - { - return ApplyVersionUpdatesResult::Failed; - } - - MaterialTypeSourceData materialTypeSourceData = materialTypeSourceDataOutcome.TakeValue(); + MaterialAssetCreator materialAssetCreator; + materialAssetCreator.SetElevateWarnings(elevateWarnings); - if (m_materialTypeVersion == materialTypeSourceData.m_version) + Outcome materialTypeAssetId = AssetUtils::MakeAssetId(materialSourceFilePath, m_materialType, 0); + if (!materialTypeAssetId) { - return ApplyVersionUpdatesResult::NoUpdates; + return Failure(); } - bool changesWereApplied = false; - - // Note that the only kind of property update currently supported is rename... - - PropertyGroupMap newPropertyGroups; - for (auto& groupPair : m_properties) + Data::Asset materialTypeAsset; + + switch (processingMode) { - PropertyMap& propertyMap = groupPair.second; - - for (auto& propertyPair : propertyMap) + case MaterialAssetProcessingMode::DeferredBake: { - MaterialPropertyId propertyId{groupPair.first, propertyPair.first}; - - if (materialTypeSourceData.ApplyPropertyRenames(propertyId, m_materialTypeVersion)) + // Don't load the material type data, just create a reference to it + materialTypeAsset = Data::Asset{ materialTypeAssetId.GetValue(), azrtti_typeid(), m_materialType }; + break; + } + case MaterialAssetProcessingMode::PreBake: + { + // In this case we need to load the material type data in preparation for the material->Finalize() step below. + auto materialTypeAssetOutcome = AssetUtils::LoadAsset(materialTypeAssetId.GetValue()); + if (!materialTypeAssetOutcome) { - changesWereApplied = true; + return Failure(); } - - newPropertyGroups[propertyId.GetGroupName().GetStringView()][propertyId.GetPropertyName().GetStringView()] = propertyPair.second; + materialTypeAsset = materialTypeAssetOutcome.GetValue(); + break; } - } - - if (changesWereApplied) - { - m_properties = AZStd::move(newPropertyGroups); - - AZ_Warning( - "MaterialSourceData", false, - "This material is based on version '%u' of '%s', but the material type is now at version '%u'. " - "Automatic updates are available. Consider updating the .material source file: '%s'.", - m_materialTypeVersion, materialTypeFullPath.c_str(), materialTypeSourceData.m_version, materialSourceFilePath.data()); - } - - m_materialTypeVersion = materialTypeSourceData.m_version; - - return changesWereApplied ? ApplyVersionUpdatesResult::UpdatesApplied : ApplyVersionUpdatesResult::NoUpdates; - } - - Outcome> MaterialSourceData::CreateMaterialAsset( - Data::AssetId assetId, AZStd::string_view materialSourceFilePath, bool elevateWarnings, bool includeMaterialPropertyNames) const - { - MaterialAssetCreator materialAssetCreator; - materialAssetCreator.SetElevateWarnings(elevateWarnings); - - if (m_parentMaterial.empty()) - { - auto materialTypeAsset = AssetUtils::LoadAsset(materialSourceFilePath, m_materialType); - if (!materialTypeAsset.IsSuccess()) + default: { + AZ_Assert(false, "Unhandled MaterialAssetProcessingMode"); return Failure(); } - - materialAssetCreator.Begin(assetId, *materialTypeAsset.GetValue().Get(), includeMaterialPropertyNames); } - else + + materialAssetCreator.Begin(assetId, materialTypeAsset); + + if (!m_parentMaterial.empty()) { auto parentMaterialAsset = AssetUtils::LoadAsset(materialSourceFilePath, m_parentMaterial); if (!parentMaterialAsset.IsSuccess()) @@ -154,25 +126,53 @@ namespace AZ // Make sure the parent material has the same material type { - auto materialTypeIdOutcome = AssetUtils::MakeAssetId(materialSourceFilePath, m_materialType, 0); - if (!materialTypeIdOutcome.IsSuccess()) + Data::AssetId parentsMaterialTypeId = parentMaterialAsset.GetValue()->GetMaterialTypeAsset().GetId(); + + if (materialTypeAssetId.GetValue() != parentsMaterialTypeId) { + AZ_Error("MaterialSourceData", false, "This material and its parent material do not share the same material type."); return Failure(); } + } - Data::AssetId expectedMaterialTypeId = materialTypeIdOutcome.GetValue(); - Data::AssetId parentMaterialId = parentMaterialAsset.GetValue().GetId(); - // This will only be valid if the parent material is not a material type - Data::AssetId parentsMaterialTypeId = parentMaterialAsset.GetValue()->GetMaterialTypeAsset().GetId(); + // Inherit the parent's property values... + switch (processingMode) + { + case MaterialAssetProcessingMode::DeferredBake: + { + for (auto& property : parentMaterialAsset.GetValue()->GetRawPropertyValues()) + { + materialAssetCreator.SetPropertyValue(property.first, property.second); + } - if (expectedMaterialTypeId != parentMaterialId && expectedMaterialTypeId != parentsMaterialTypeId) + break; + } + case MaterialAssetProcessingMode::PreBake: { - AZ_Error("MaterialSourceData", false, "This material and its parent material do not share the same material type."); + const MaterialPropertiesLayout* propertiesLayout = parentMaterialAsset.GetValue()->GetMaterialPropertiesLayout(); + + if (parentMaterialAsset.GetValue()->GetPropertyValues().size() != propertiesLayout->GetPropertyCount()) + { + AZ_Assert(false, "The parent material should have been finalized with %zu properties but it has %zu. Something is out of sync.", + propertiesLayout->GetPropertyCount(), parentMaterialAsset.GetValue()->GetPropertyValues().size()); + return Failure(); + } + + for (size_t propertyIndex = 0; propertyIndex < propertiesLayout->GetPropertyCount(); ++propertyIndex) + { + materialAssetCreator.SetPropertyValue( + propertiesLayout->GetPropertyDescriptor(MaterialPropertyIndex{propertyIndex})->GetName(), + parentMaterialAsset.GetValue()->GetPropertyValues()[propertyIndex]); + } + + break; + } + default: + { + AZ_Assert(false, "Unhandled MaterialAssetProcessingMode"); return Failure(); } } - - materialAssetCreator.Begin(assetId, *parentMaterialAsset.GetValue().Get(), includeMaterialPropertyNames); } ApplyPropertiesToAssetCreator(materialAssetCreator, materialSourceFilePath); @@ -180,6 +180,11 @@ namespace AZ Data::Asset material; if (materialAssetCreator.End(material)) { + if (processingMode == MaterialAssetProcessingMode::PreBake) + { + material->Finalize(); + } + return Success(material); } else @@ -192,7 +197,6 @@ namespace AZ Data::AssetId assetId, AZStd::string_view materialSourceFilePath, bool elevateWarnings, - bool includeMaterialPropertyNames, AZStd::unordered_set* sourceDependencies) const { const auto materialTypeSourcePath = AssetUtils::ResolvePathReference(materialSourceFilePath, m_materialType); @@ -270,7 +274,7 @@ namespace AZ // Create the material asset from all the previously loaded source data MaterialAssetCreator materialAssetCreator; materialAssetCreator.SetElevateWarnings(elevateWarnings); - materialAssetCreator.Begin(assetId, *materialTypeAsset.GetValue().Get(), includeMaterialPropertyNames); + materialAssetCreator.Begin(assetId, materialTypeAsset.GetValue()); while (!parentSourceDataStack.empty()) { @@ -283,6 +287,13 @@ namespace AZ Data::Asset material; if (materialAssetCreator.End(material)) { + // Unlike CreateMaterialAsset(), we can always finalize the material here because we loaded created the MaterialTypeAsset from + // the source .materialtype file, so the necessary data is always available. + // (In case you are wondering why we don't use CreateMaterialAssetFromSourceData in MaterialBuilder: that would require a + // source dependency between the .materialtype and .material file, which would cause all .material files to rebuild when you + // edit the .materialtype; it's faster to not read the material type data at all ... until it's needed at runtime) + material->Finalize(); + if (sourceDependencies) { sourceDependencies->insert(dependencies.begin(), dependencies.end()); @@ -306,59 +317,26 @@ namespace AZ { materialAssetCreator.ReportWarning("Source data for material property value is invalid."); } - else + else if (property.second.m_value.Is() && AzFramework::StringFunc::Contains(property.second.m_value.GetValue(), ".")) { - MaterialPropertyIndex propertyIndex = - materialAssetCreator.m_materialPropertiesLayout->FindPropertyIndex(propertyId.GetFullName()); - if (propertyIndex.IsValid()) - { - const MaterialPropertyDescriptor* propertyDescriptor = - materialAssetCreator.m_materialPropertiesLayout->GetPropertyDescriptor(propertyIndex); - switch (propertyDescriptor->GetDataType()) - { - case MaterialPropertyDataType::Image: - { - Data::Asset imageAsset; - - MaterialUtils::GetImageAssetResult result = MaterialUtils::GetImageAssetReference( - imageAsset, materialSourceFilePath, property.second.m_value.GetValue()); - - if (result == MaterialUtils::GetImageAssetResult::Missing) - { - materialAssetCreator.ReportWarning( - "Material property '%s': Could not find the image '%s'", propertyId.GetFullName().GetCStr(), - property.second.m_value.GetValue().data()); - } + Data::Asset imageAsset; + + MaterialUtils::GetImageAssetResult result = MaterialUtils::GetImageAssetReference( + imageAsset, materialSourceFilePath, property.second.m_value.GetValue()); - imageAsset.SetAutoLoadBehavior(Data::AssetLoadBehavior::PreLoad); - materialAssetCreator.SetPropertyValue(propertyId.GetFullName(), imageAsset); - } - break; - case MaterialPropertyDataType::Enum: - { - AZ::Name enumName = AZ::Name(property.second.m_value.GetValue()); - uint32_t enumValue = propertyDescriptor->GetEnumValue(enumName); - if (enumValue == MaterialPropertyDescriptor::InvalidEnumValue) - { - materialAssetCreator.ReportError( - "Enum value '%s' couldn't be found in the 'enumValues' list", enumName.GetCStr()); - } - else - { - materialAssetCreator.SetPropertyValue(propertyId.GetFullName(), enumValue); - } - } - break; - default: - materialAssetCreator.SetPropertyValue(propertyId.GetFullName(), property.second.m_value); - break; - } - } - else + if (result == MaterialUtils::GetImageAssetResult::Missing) { materialAssetCreator.ReportWarning( - "Can not find property id '%s' in MaterialPropertyLayout", propertyId.GetFullName().GetStringView().data()); + "Material property '%s': Could not find the image '%s'", propertyId.GetFullName().GetCStr(), + property.second.m_value.GetValue().data()); } + + imageAsset.SetAutoLoadBehavior(Data::AssetLoadBehavior::PreLoad); + materialAssetCreator.SetPropertyValue(propertyId.GetFullName(), imageAsset); + } + else + { + materialAssetCreator.SetPropertyValue(propertyId.GetFullName(), property.second.m_value); } } } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialUtils.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialUtils.cpp index 7fff8d81bc..475c6ca219 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialUtils.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialUtils.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include @@ -135,6 +136,20 @@ namespace AZ } } } + + bool BuildersShouldFinalizeMaterialAssets() + { + // We default to the faster workflow for developers. Enable this registry setting when releasing the + // game for faster load times and obfuscation of material assets. + bool shouldFinalize = false; + + if (auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr) + { + settingsRegistry->Get(shouldFinalize, "/O3DE/Atom/RPI/MaterialBuilder/FinalizeMaterialAssets"); + } + + return shouldFinalize; + } } } } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp index 3c6947b83d..7962844736 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp @@ -33,11 +33,12 @@ namespace AZ if (auto* serializeContext = azrtti_cast(context)) { serializeContext->Class() - ->Version(11) // Material version update + ->Version(13) // added m_rawPropertyValues ->Field("materialTypeAsset", &MaterialAsset::m_materialTypeAsset) ->Field("materialTypeVersion", &MaterialAsset::m_materialTypeVersion) ->Field("propertyValues", &MaterialAsset::m_propertyValues) - ->Field("propertyNames", &MaterialAsset::m_propertyNames) + ->Field("rawPropertyValues", &MaterialAsset::m_rawPropertyValues) + ->Field("isFinalized", &MaterialAsset::m_isFinalized) ; } } @@ -102,32 +103,95 @@ namespace AZ { return m_materialTypeAsset->GetMaterialPropertiesLayout(); } + + bool MaterialAsset::IsFinalized() const + { + if (m_isFinalized) + { + AZ_Assert(GetMaterialPropertiesLayout() && m_propertyValues.size() == GetMaterialPropertiesLayout()->GetPropertyCount(), "MaterialAsset is marked as Finalized but does not have the right number of property values."); + } - AZStd::array_view MaterialAsset::GetPropertyValues() const + return m_isFinalized; + } + + void MaterialAsset::Finalize() { - // If property names are included, they are used to re-arrange the property value list to align with the - // MaterialPropertiesLayout. This realignment would be necessary if the material type is updated with - // a new property layout, and a corresponding material is not reprocessed by the AP and continues using the - // old property layout. - if (!m_propertyNames.empty()) + if (IsFinalized()) + { + return; + } + + const uint32_t materialTypeVersion = m_materialTypeAsset->GetVersion(); + if (m_materialTypeVersion < materialTypeVersion) + { + // It is possible that the material type has had some properties renamed or otherwise updated. If that's the case, + // and this material is still referencing the old property layout, we need to apply any auto updates to rename those + // properties before using them to realign the property values. + ApplyVersionUpdates(); + } + + const MaterialPropertiesLayout* propertyLayout = GetMaterialPropertiesLayout(); + + AZStd::vector finalizedPropertyValues(m_materialTypeAsset->GetDefaultPropertyValues().begin(), m_materialTypeAsset->GetDefaultPropertyValues().end()); + + for (const auto& [name, value] : m_rawPropertyValues) { - const uint32_t materialTypeVersion = m_materialTypeAsset->GetVersion(); - if (m_materialTypeVersion < materialTypeVersion) + const MaterialPropertyIndex propertyIndex = propertyLayout->FindPropertyIndex(name); + if (propertyIndex.IsValid()) { - // It is possible that the material type has had some properties renamed. If that's the case, and this material - // is still referencing the old property layout, we need to apply any auto updates to rename those properties - // before using them to realign the property values. - const_cast(this)->ApplyVersionUpdates(); - } + const MaterialPropertyDescriptor* propertyDescriptor = propertyLayout->GetPropertyDescriptor(propertyIndex); - if (m_isDirty) + if (value.Is() && propertyDescriptor->GetDataType() == MaterialPropertyDataType::Enum) + { + AZ::Name enumName = AZ::Name(value.GetValue()); + uint32_t enumValue = propertyDescriptor->GetEnumValue(enumName); + if (enumValue == MaterialPropertyDescriptor::InvalidEnumValue) + { + AZ_Error(s_debugTraceName, false, "Material property name \"%s\" has invalid enum value \"%s\".", name.GetCStr(), enumName.GetCStr()); + } + else + { + finalizedPropertyValues[propertyIndex.GetIndex()] = enumValue; + } + } + else if (value.Is() && propertyDescriptor->GetDataType() == MaterialPropertyDataType::Image) + { + // Here we assume that the material asset builder resolved any image source file paths to an ImageAsset reference. + // So the only way a string could be present is if it's an empty image path reference, meaning no image should be bound. + AZ_Assert(value.GetValue().empty(), "Material property '%s' references in image '%s'. Image file paths must be resolved by the material asset builder."); + + finalizedPropertyValues[propertyIndex.GetIndex()] = Data::Asset{}; + } + else + { + finalizedPropertyValues[propertyIndex.GetIndex()] = value; + } + } + else { - const_cast(this)->RealignPropertyValuesAndNames(); + AZ_Warning(s_debugTraceName, false, "Material property name \"%s\" is not found in the material properties layout and will not be used.", name.GetCStr()); } } + m_propertyValues.swap(finalizedPropertyValues); + + m_isFinalized = true; + } + + const AZStd::vector& MaterialAsset::GetPropertyValues() const + { + // This can't be done in MaterialAssetHandler::LoadAssetData because the MaterialTypeAsset isn't necessarily loaded at that point. + // And it can't be done in PostLoadInit() because that happens on the next frame which might be too late. So we finalize just-in-time + // when properties are accessed. + const_cast(this)->Finalize(); + return m_propertyValues; } + + const AZStd::vector>& MaterialAsset::GetRawPropertyValues() const + { + return m_rawPropertyValues; + } void MaterialAsset::SetReady() { @@ -173,34 +237,6 @@ namespace AZ } } - void MaterialAsset::RealignPropertyValuesAndNames() - { - const MaterialPropertiesLayout* propertyLayout = GetMaterialPropertiesLayout(); - AZStd::vector alignedPropertyValues(m_materialTypeAsset->GetDefaultPropertyValues().begin(), m_materialTypeAsset->GetDefaultPropertyValues().end()); - for (size_t i = 0; i < m_propertyNames.size(); ++i) - { - const MaterialPropertyIndex propertyIndex = propertyLayout->FindPropertyIndex(m_propertyNames[i]); - if (propertyIndex.IsValid()) - { - alignedPropertyValues[propertyIndex.GetIndex()] = m_propertyValues[i]; - } - else - { - AZ_Warning(s_debugTraceName, false, "Material property name \"%s\" is not found in the material properties layout and will not be used.", m_propertyNames[i].GetCStr()); - } - } - m_propertyValues.swap(alignedPropertyValues); - - const size_t propertyCount = propertyLayout->GetPropertyCount(); - m_propertyNames.resize(propertyCount); - for (size_t i = 0; i < propertyCount; ++i) - { - m_propertyNames[i] = propertyLayout->GetPropertyDescriptor(MaterialPropertyIndex{ i })->GetName(); - } - - m_isDirty = false; - } - void MaterialAsset::ApplyVersionUpdates() { if (m_materialTypeVersion == m_materialTypeAsset->GetVersion()) @@ -248,7 +284,13 @@ namespace AZ // This also covers the case where just the MaterialTypeAsset is reloaded and not the MaterialAsset. m_materialTypeAsset = newMaterialTypeAsset; - m_isDirty = true; + // If the material asset was not finalized on disk, then we clear the previously finalized property values to force re-finalize. + // This + if (!m_wasPreFinalized) + { + m_isFinalized = false; + m_propertyValues.clear(); + } // Notify interested parties that this MaterialAsset is changed and may require other data to reinitialize as well MaterialReloadNotificationBus::Event(GetId(), &MaterialReloadNotifications::OnMaterialAssetReinitialized, Data::Asset{this, AZ::Data::AssetLoadBehavior::PreLoad}); @@ -276,6 +318,7 @@ namespace AZ if (Base::LoadAssetData(asset, stream, assetLoadFilterCB) == Data::AssetHandler::LoadResult::LoadComplete) { asset.GetAs()->AssetInitBus::Handler::BusConnect(); + asset.GetAs()->m_wasPreFinalized = asset.GetAs()->m_isFinalized; return Data::AssetHandler::LoadResult::LoadComplete; } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAssetCreator.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAssetCreator.cpp index b62a91a98d..4bee663791 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAssetCreator.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAssetCreator.cpp @@ -16,89 +16,19 @@ namespace AZ { namespace RPI { - void MaterialAssetCreator::Begin(const Data::AssetId& assetId, MaterialAsset& parentMaterial, bool includeMaterialPropertyNames) - { - BeginCommon(assetId); - - if (ValidateIsReady()) - { - m_asset->m_materialTypeAsset = parentMaterial.m_materialTypeAsset; - m_asset->m_materialTypeVersion = m_asset->m_materialTypeAsset->GetVersion(); - - if (!m_asset->m_materialTypeAsset) - { - ReportError("MaterialTypeAsset is null"); - return; - } - - m_materialPropertiesLayout = m_asset->GetMaterialPropertiesLayout(); - if (!m_materialPropertiesLayout) - { - ReportError("MaterialPropertiesLayout is null"); - return; - } - if (includeMaterialPropertyNames) - { - PopulatePropertyNameList(); - } - - // Note we don't have to check the validity of these property values because the parent material's AssetCreator already did that. - m_asset->m_propertyValues.assign(parentMaterial.GetPropertyValues().begin(), parentMaterial.GetPropertyValues().end()); - - auto warningFunc = [this](const char* message) - { - ReportWarning("%s", message); - }; - auto errorFunc = [this](const char* message) - { - ReportError("%s", message); - }; - MaterialAssetCreatorCommon::OnBegin(m_materialPropertiesLayout, &(m_asset->m_propertyValues), warningFunc, errorFunc); - } - } - - void MaterialAssetCreator::Begin(const Data::AssetId& assetId, MaterialTypeAsset& materialType, bool includeMaterialPropertyNames) + void MaterialAssetCreator::Begin(const Data::AssetId& assetId, const Data::Asset& materialType) { BeginCommon(assetId); if (ValidateIsReady()) { - m_asset->m_materialTypeAsset = { &materialType, AZ::Data::AssetLoadBehavior::PreLoad }; + m_asset->m_materialTypeAsset = materialType; - if (!m_asset->m_materialTypeAsset) - { - ReportError("MaterialTypeAsset is null"); - return; - } - m_asset->m_materialTypeVersion = m_asset->m_materialTypeAsset->GetVersion(); + m_asset->m_materialTypeAsset.SetAutoLoadBehavior(AZ::Data::AssetLoadBehavior::PreLoad); - m_materialPropertiesLayout = m_asset->GetMaterialPropertiesLayout(); - if (includeMaterialPropertyNames) - { - PopulatePropertyNameList(); - } - - if (!m_materialPropertiesLayout) - { - ReportError("MaterialPropertiesLayout is null"); - return; - } - - // Note we don't have to check the validity of these property values because the parent material's AssetCreator already did that. - m_asset->m_propertyValues.assign(materialType.GetDefaultPropertyValues().begin(), materialType.GetDefaultPropertyValues().end()); - - auto warningFunc = [this](const char* message) - { - ReportWarning("%s", message); - }; - auto errorFunc = [this](const char* message) - { - ReportError("%s", message); - }; - MaterialAssetCreatorCommon::OnBegin(m_materialPropertiesLayout, &(m_asset->m_propertyValues), warningFunc, errorFunc); } } - + bool MaterialAssetCreator::End(Data::Asset& result) { if (!ValidateIsReady()) @@ -106,20 +36,39 @@ namespace AZ return false; } - m_materialPropertiesLayout = nullptr; - MaterialAssetCreatorCommon::OnEnd(); - m_asset->SetReady(); return EndCommon(result); } - - void MaterialAssetCreator::PopulatePropertyNameList() + + void MaterialAssetCreator::SetMaterialTypeVersion(uint32_t version) + { + if (ValidateIsReady()) + { + m_asset->m_materialTypeVersion = version; + } + } + + void MaterialAssetCreator::SetPropertyValue(const Name& name, const MaterialPropertyValue& value) { - for (int i = 0; i < m_materialPropertiesLayout->GetPropertyCount(); ++i) + if (ValidateIsReady()) { - MaterialPropertyIndex propertyIndex{ i }; - auto& propertyName = m_materialPropertiesLayout->GetPropertyDescriptor(propertyIndex)->GetName(); - m_asset->m_propertyNames.emplace_back(propertyName); + // Here we are careful to keep the properties in the same order they were encountered. When the MaterialAsset + // is later finalized with a MaterialTypeAsset, there could be a version update procedure that includes renamed + // properties. So it's possible that the same property could be encountered twice but with two different names. + // Preserving the original order will ensure that the later properties still overwrite the earlier ones even after + // renames have been applied. + + auto iter = AZStd::find_if(m_asset->m_rawPropertyValues.begin(), m_asset->m_rawPropertyValues.end(), [&name](const AZStd::pair& pair) + { + return pair.first == name; + }); + + if (iter != m_asset->m_rawPropertyValues.end()) + { + m_asset->m_rawPropertyValues.erase(iter); + } + + m_asset->m_rawPropertyValues.emplace_back(name, value); } } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialTypeAssetCreator.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialTypeAssetCreator.cpp index 46086dfecc..dd023c56b8 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialTypeAssetCreator.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialTypeAssetCreator.cpp @@ -122,6 +122,21 @@ namespace AZ return false; } + // We don't allow previously renamed property names to be reused for new properties. This would just complicate too many things, + // as every use of every property name (like in Material Component, or in scripts, for example) would have to have a version number + // associated with it, in order to know whether or which rename to apply. + for (size_t propertyIndex = 0; propertyIndex < m_asset->m_materialPropertiesLayout->GetPropertyCount(); ++propertyIndex) + { + Name originalPropertyName = m_asset->m_materialPropertiesLayout->GetPropertyDescriptor(MaterialPropertyIndex{propertyIndex})->GetName(); + Name newPropertyName = originalPropertyName; + if (versionUpdate.ApplyPropertyRenames(newPropertyName)) + { + ReportError("There was a material property named '%s' at material type version %d. This name cannot be reused for another property.", + originalPropertyName.GetCStr(), versionUpdate.GetVersion()); + return false; + } + } + prevVersion = versionUpdate.GetVersion(); } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialVersionUpdate.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialVersionUpdate.cpp index f5dfe9e80c..f12c865eee 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialVersionUpdate.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialVersionUpdate.cpp @@ -77,18 +77,14 @@ namespace AZ { bool changesWereApplied = false; - for (auto& propertyName : materialAsset.m_propertyNames) + for (auto& [name, value] : materialAsset.m_rawPropertyValues) { - for (const auto& action : m_actions) + if (ApplyPropertyRenames(name)) { - if (propertyName == action.m_fromPropertyId) - { - propertyName = action.m_toPropertyId; - changesWereApplied = true; - } + changesWereApplied = true; } } - + return changesWereApplied; } diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp index 97d8d5e354..93da118b5b 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp @@ -680,12 +680,6 @@ namespace MaterialEditor return false; } m_materialTypeSourceData = materialTypeOutcome.GetValue(); - - if (MaterialSourceData::ApplyVersionUpdatesResult::Failed == m_materialSourceData.ApplyVersionUpdates(m_absolutePath)) - { - AZ_Error("MaterialDocument", false, "Material source data could not be auto updated to the latest version of the material type: '%s'.", m_materialSourceData.m_materialType.c_str()); - return false; - } } else if (AzFramework::StringFunc::Path::IsExtension(m_absolutePath.c_str(), MaterialTypeSourceData::Extension)) { From a627cda5aeee1c7d2714045f5b58b51b57440393 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Fri, 17 Dec 2021 17:05:27 -0800 Subject: [PATCH 521/948] Got the unit tests working again. I made MaterialAsset::Finalize private so I could add some parameters specifically for MaterialAssetCreator to use. Now MaterialAssetCreator::Begin has an option to finalize the material or not. Moved MaterialAssetCreatorCommon::ValidateDataType to MaterialPropertyDescriptor as "ValidateMaterialPropertyDataType" so that MaterialAsset::Finalize could use it too Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../Atom/RPI.Edit/Material/MaterialUtils.h | 1 + .../Include/Atom/RPI.Reflect/AssetCreator.h | 1 + .../Atom/RPI.Reflect/Material/MaterialAsset.h | 12 +- .../Material/MaterialAssetCreator.h | 24 +- .../Material/MaterialAssetCreatorCommon.h | 6 - .../Material/MaterialPropertyDescriptor.h | 5 + .../RPI.Builders/Material/MaterialBuilder.cpp | 2 +- .../Model/MaterialAssetBuilderComponent.cpp | 2 +- .../RPI.Edit/Material/MaterialSourceData.cpp | 23 +- .../RPI.Edit/Material/MaterialUtils.cpp | 1 + .../RPI.Reflect/Material/MaterialAsset.cpp | 27 +- .../Material/MaterialAssetCreator.cpp | 34 ++- .../Material/MaterialAssetCreatorCommon.cpp | 54 +--- .../Material/MaterialPropertyDescriptor.cpp | 51 ++++ .../Material/LuaMaterialFunctorTests.cpp | 8 +- .../Tests/Material/MaterialAssetTests.cpp | 166 +++++++---- .../Tests/Material/MaterialFunctorTests.cpp | 2 +- .../Material/MaterialSourceDataTests.cpp | 282 ++++-------------- .../RPI/Code/Tests/Material/MaterialTests.cpp | 22 +- 19 files changed, 333 insertions(+), 390 deletions(-) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialUtils.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialUtils.h index 2fb55e5f40..2a992159b3 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialUtils.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialUtils.h @@ -69,6 +69,7 @@ namespace AZ //! Finalizing during asset processing reduces load times and obfuscates the material data. //! Waiting to finalize at load time reduces dependencies on the material type data, resulting in fewer asset rebuilds and less time spent processing assets. bool BuildersShouldFinalizeMaterialAssets(); + } } } diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/AssetCreator.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/AssetCreator.h index 79d43d0b8d..257abcc785 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/AssetCreator.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/AssetCreator.h @@ -28,6 +28,7 @@ namespace AZ // [GFX TODO] We need to iterate on this concept at some point. We may want to expose it through cvars or something // like that, or we may not need this at all. For now it's helpful for testing. void SetElevateWarnings(bool elevated); + bool GetElevateWarnings() const { return m_warningsElevated; } int GetErrorCount() const { return m_errorCount; } int GetWarningCount() const { return m_warningCount; } diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAsset.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAsset.h index 34e51b40af..736d7c5b53 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAsset.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAsset.h @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -110,11 +111,6 @@ namespace AZ //! If false, property values can be accessed through GetRawPropertyValues(). bool IsFinalized() const; - //! If the material asset is not finalized yet, this does the final processing of m_rawPropertyValues to - //! get the material asset ready to be used. - //! Note m_materialTypeAsset must be valid before this is called. - void Finalize(); - //! Returns the list of values for all properties in this material. //! The entries in this list align with the entries in the MaterialPropertiesLayout. Each AZStd::any is guaranteed //! to have a value of type that matches the corresponding MaterialPropertyDescriptor. @@ -129,6 +125,12 @@ namespace AZ private: bool PostLoadInit() override; + //! If the material asset is not finalized yet, this does the final processing of m_rawPropertyValues to + //! get the material asset ready to be used. + //! Note m_materialTypeAsset must be valid before this is called. + //! @param elevateWarnings Indicates whether to treat warnings as errors + void Finalize(AZStd::function reportWarning = nullptr, AZStd::function reportError = nullptr); + //! Checks the material type version and potentially applies a series of property changes (most common are simple property renames) //! based on the MaterialTypeAsset's version update procedure. void ApplyVersionUpdates(); diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAssetCreator.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAssetCreator.h index b7b1f9705f..74bd909e08 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAssetCreator.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAssetCreator.h @@ -9,30 +9,38 @@ #include #include +#include +#include namespace AZ { namespace RPI { //! Use a MaterialAssetCreator to create and configure a new MaterialAsset. - //! The MaterialAsset will be based on a MaterialTypeAsset or another MaterialAsset. - //! Either way, the base provides the necessary data to define the layout - //! and behavior of the material. The MaterialAsset only provides property value overrides. - //! Note however that the MaterialTypeAsset does not have to be loaded and available yet; - //! only the AssetId is required. The resulting MaterialAsset will be in a non-finalized state; - //! it must be finalized afterwards when the MaterialTypeAsset is available before it can be used. + //! + //! There are two options for how to create the MaterialAsset, whether it should be finalized now or deferred. + //! - Finalized now: This requires the MaterialTypeAsset to be fully populated so it can read the property layout. + //! - Deferred finalize: This only requires the MaterialTypeAsset to have a valid AssetId; the data inside will not be used. MaterialAsset::Finalize() + //! will need to be called later when the final MaterialTypeAsset is available, presumably after loading the MaterialAsset at runtime. class MaterialAssetCreator : public AssetCreator { public: friend class MaterialSourceData; - - void Begin(const Data::AssetId& assetId, const Data::Asset& materialType); + + void Begin(const Data::AssetId& assetId, const Data::Asset& materialType, bool shouldFinalize); bool End(Data::Asset& result); void SetMaterialTypeVersion(uint32_t version); void SetPropertyValue(const Name& name, const MaterialPropertyValue& value); + + void SetPropertyValue(const Name& name, const Data::Asset& imageAsset); + void SetPropertyValue(const Name& name, const Data::Asset& imageAsset); + void SetPropertyValue(const Name& name, const Data::Asset& imageAsset); + + private: + bool m_shouldFinalize = false; }; } // namespace RPI } // namespace AZ diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAssetCreatorCommon.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAssetCreatorCommon.h index 312739a0f0..c7fa9c2a4c 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAssetCreatorCommon.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAssetCreatorCommon.h @@ -52,12 +52,6 @@ namespace AZ private: bool PropertyCheck(TypeId typeId, const Name& name); - //! Returns the MaterialPropertyDataType value that corresponds to typeId - MaterialPropertyDataType GetMaterialPropertyDataType(TypeId typeId) const; - - //! Checks that the TypeId typeId matches the type expected by materialPropertyDescriptor - bool ValidateDataType(TypeId typeId, const Name& propertyName, const MaterialPropertyDescriptor* materialPropertyDescriptor); - const MaterialPropertiesLayout* m_propertyLayout = nullptr; //! Points to the m_propertyValues list in a MaterialAsset or MaterialTypeAsset AZStd::vector* m_propertyValues = nullptr; diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialPropertyDescriptor.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialPropertyDescriptor.h index 76bb2a6113..bd18c98780 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialPropertyDescriptor.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialPropertyDescriptor.h @@ -17,6 +17,8 @@ namespace AZ { namespace RPI { + class MaterialPropertyDescriptor; + struct MaterialPropertyIndexType { AZ_TYPE_INFO(MaterialPropertyIndexType, "{cfc09268-f3f1-4474-bd8f-f2c8de27c5f1}"); }; @@ -76,6 +78,9 @@ namespace AZ const char* ToString(MaterialPropertyDataType materialPropertyDataType); AZStd::string GetMaterialPropertyDataTypeString(AZ::TypeId typeId); + + //! Checks that the TypeId matches the type expected by materialPropertyDescriptor + bool ValidateMaterialPropertyDataType(TypeId typeId, const Name& propertyName, const MaterialPropertyDescriptor* materialPropertyDescriptor, AZStd::function onError); //! A material property is any data input to a material, like a bool, float, Vector, Image, Buffer, etc. //! This descriptor defines a single input property, including it's name ID, and how it maps diff --git a/Gems/Atom/RPI/Code/Source/RPI.Builders/Material/MaterialBuilder.cpp b/Gems/Atom/RPI/Code/Source/RPI.Builders/Material/MaterialBuilder.cpp index 1b5635a1c1..3aa8728e08 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Builders/Material/MaterialBuilder.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Builders/Material/MaterialBuilder.cpp @@ -52,7 +52,7 @@ namespace AZ { AssetBuilderSDK::AssetBuilderDesc materialBuilderDescriptor; materialBuilderDescriptor.m_name = JobKey; - materialBuilderDescriptor.m_version = 111; // material dependency improvements + materialBuilderDescriptor.m_version = 112; // material dependency improvements materialBuilderDescriptor.m_patterns.push_back(AssetBuilderSDK::AssetBuilderPattern("*.material", AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard)); materialBuilderDescriptor.m_patterns.push_back(AssetBuilderSDK::AssetBuilderPattern("*.materialtype", AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard)); materialBuilderDescriptor.m_busId = azrtti_typeid(); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MaterialAssetBuilderComponent.cpp b/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MaterialAssetBuilderComponent.cpp index ef251b6848..6f71fb70d4 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MaterialAssetBuilderComponent.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MaterialAssetBuilderComponent.cpp @@ -127,7 +127,7 @@ namespace AZ if (auto* serialize = azrtti_cast(context)) { serialize->Class() - ->Version(17); // Optional material conversion + ->Version(18); // material dependency improvements } } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp index cd01544bfa..23657f4871 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp @@ -114,7 +114,7 @@ namespace AZ } } - materialAssetCreator.Begin(assetId, materialTypeAsset); + materialAssetCreator.Begin(assetId, materialTypeAsset, processingMode == MaterialAssetProcessingMode::PreBake); if (!m_parentMaterial.empty()) { @@ -180,11 +180,6 @@ namespace AZ Data::Asset material; if (materialAssetCreator.End(material)) { - if (processingMode == MaterialAssetProcessingMode::PreBake) - { - material->Finalize(); - } - return Success(material); } else @@ -270,11 +265,18 @@ namespace AZ parentSourceAbsPath = AssetUtils::ResolvePathReference(parentSourceAbsPath, parentSourceRelPath); parentSourceDataStack.emplace_back(AZStd::move(parentSourceData)); } + + // Unlike CreateMaterialAsset(), we can always finalize the material here because we loaded created the MaterialTypeAsset from + // the source .materialtype file, so the necessary data is always available. + // (In case you are wondering why we don't use CreateMaterialAssetFromSourceData in MaterialBuilder: that would require a + // source dependency between the .materialtype and .material file, which would cause all .material files to rebuild when you + // edit the .materialtype; it's faster to not read the material type data at all ... until it's needed at runtime) + const bool finalize = true; // Create the material asset from all the previously loaded source data MaterialAssetCreator materialAssetCreator; materialAssetCreator.SetElevateWarnings(elevateWarnings); - materialAssetCreator.Begin(assetId, materialTypeAsset.GetValue()); + materialAssetCreator.Begin(assetId, materialTypeAsset.GetValue(), finalize); while (!parentSourceDataStack.empty()) { @@ -287,13 +289,6 @@ namespace AZ Data::Asset material; if (materialAssetCreator.End(material)) { - // Unlike CreateMaterialAsset(), we can always finalize the material here because we loaded created the MaterialTypeAsset from - // the source .materialtype file, so the necessary data is always available. - // (In case you are wondering why we don't use CreateMaterialAssetFromSourceData in MaterialBuilder: that would require a - // source dependency between the .materialtype and .material file, which would cause all .material files to rebuild when you - // edit the .materialtype; it's faster to not read the material type data at all ... until it's needed at runtime) - material->Finalize(); - if (sourceDependencies) { sourceDependencies->insert(dependencies.begin(), dependencies.end()); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialUtils.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialUtils.cpp index 475c6ca219..2fe30f632f 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialUtils.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialUtils.cpp @@ -150,6 +150,7 @@ namespace AZ return shouldFinalize; } + } } } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp index 7962844736..ce5847d12f 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp @@ -114,13 +114,29 @@ namespace AZ return m_isFinalized; } - void MaterialAsset::Finalize() + void MaterialAsset::Finalize(AZStd::function reportWarning, AZStd::function reportError) { if (IsFinalized()) { return; } + if (!reportWarning) + { + reportWarning = [](const char* message) + { + AZ_Warning(s_debugTraceName, false, "%s", message); + }; + } + + if (!reportError) + { + reportError = [](const char* message) + { + AZ_Error(s_debugTraceName, false, "%s", message); + }; + } + const uint32_t materialTypeVersion = m_materialTypeAsset->GetVersion(); if (m_materialTypeVersion < materialTypeVersion) { @@ -147,7 +163,7 @@ namespace AZ uint32_t enumValue = propertyDescriptor->GetEnumValue(enumName); if (enumValue == MaterialPropertyDescriptor::InvalidEnumValue) { - AZ_Error(s_debugTraceName, false, "Material property name \"%s\" has invalid enum value \"%s\".", name.GetCStr(), enumName.GetCStr()); + reportWarning(AZStd::string::format("Material property name \"%s\" has invalid enum value \"%s\".", name.GetCStr(), enumName.GetCStr()).c_str()); } else { @@ -164,12 +180,15 @@ namespace AZ } else { - finalizedPropertyValues[propertyIndex.GetIndex()] = value; + if (ValidateMaterialPropertyDataType(value.GetTypeId(), name, propertyDescriptor, reportError)) + { + finalizedPropertyValues[propertyIndex.GetIndex()] = value; + } } } else { - AZ_Warning(s_debugTraceName, false, "Material property name \"%s\" is not found in the material properties layout and will not be used.", name.GetCStr()); + reportWarning(AZStd::string::format("Material property name \"%s\" is not found in the material properties layout and will not be used.", name.GetCStr()).c_str()); } } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAssetCreator.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAssetCreator.cpp index 4bee663791..f05fb8d848 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAssetCreator.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAssetCreator.cpp @@ -16,16 +16,21 @@ namespace AZ { namespace RPI { - void MaterialAssetCreator::Begin(const Data::AssetId& assetId, const Data::Asset& materialType) + void MaterialAssetCreator::Begin(const Data::AssetId& assetId, const Data::Asset& materialType, bool shouldFinalize) { BeginCommon(assetId); if (ValidateIsReady()) { - m_asset->m_materialTypeAsset = materialType; + m_shouldFinalize = shouldFinalize; + m_asset->m_materialTypeAsset = materialType; m_asset->m_materialTypeAsset.SetAutoLoadBehavior(AZ::Data::AssetLoadBehavior::PreLoad); - + + if (shouldFinalize && !m_asset->m_materialTypeAsset) + { + ReportError("MaterialTypeAsset is null, the MaterialAsset cannot be finalized"); + } } } @@ -37,6 +42,14 @@ namespace AZ } m_asset->SetReady(); + + if (m_shouldFinalize) + { + m_asset->Finalize( + [this](const char* message) { ReportWarning("%s", message); }, + [this](const char* message) { ReportError("%s", message); }); + } + return EndCommon(result); } @@ -71,6 +84,21 @@ namespace AZ m_asset->m_rawPropertyValues.emplace_back(name, value); } } + + void MaterialAssetCreator::SetPropertyValue(const Name& name, const Data::Asset& imageAsset) + { + SetPropertyValue(name, MaterialPropertyValue{imageAsset}); + } + + void MaterialAssetCreator::SetPropertyValue(const Name& name, const Data::Asset& imageAsset) + { + SetPropertyValue(name, Data::Asset(imageAsset)); + } + + void MaterialAssetCreator::SetPropertyValue(const Name& name, const Data::Asset& imageAsset) + { + SetPropertyValue(name, Data::Asset(imageAsset)); + } } // namespace RPI } // namespace AZ diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAssetCreatorCommon.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAssetCreatorCommon.cpp index 1ba74ce0b9..4b2f163f7c 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAssetCreatorCommon.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAssetCreatorCommon.cpp @@ -7,6 +7,7 @@ */ #include +#include namespace AZ { @@ -32,57 +33,6 @@ namespace AZ m_reportError = nullptr; } - MaterialPropertyDataType MaterialAssetCreatorCommon::GetMaterialPropertyDataType(TypeId typeId) const - { - if (typeId == azrtti_typeid()) { return MaterialPropertyDataType::Bool; } - if (typeId == azrtti_typeid()) { return MaterialPropertyDataType::Int; } - if (typeId == azrtti_typeid()) { return MaterialPropertyDataType::UInt; } - if (typeId == azrtti_typeid()) { return MaterialPropertyDataType::Float; } - if (typeId == azrtti_typeid()) { return MaterialPropertyDataType::Vector2; } - if (typeId == azrtti_typeid()) { return MaterialPropertyDataType::Vector3; } - if (typeId == azrtti_typeid()) { return MaterialPropertyDataType::Vector4; } - if (typeId == azrtti_typeid()) { return MaterialPropertyDataType::Color; } - if (typeId == azrtti_typeid>()) { return MaterialPropertyDataType::Image; } - else - { - return MaterialPropertyDataType::Invalid; - } - } - - bool MaterialAssetCreatorCommon::ValidateDataType(TypeId typeId, const Name& propertyName, const MaterialPropertyDescriptor* materialPropertyDescriptor) - { - auto expectedDataType = materialPropertyDescriptor->GetDataType(); - auto actualDataType = GetMaterialPropertyDataType(typeId); - - if (expectedDataType == MaterialPropertyDataType::Enum) - { - if (actualDataType != MaterialPropertyDataType::UInt) - { - m_reportError( - AZStd::string::format("Material property '%s' is a Enum type, can only accept UInt value, input value is %s", - propertyName.GetCStr(), - ToString(actualDataType) - ).data()); - return false; - } - } - else - { - if (expectedDataType != actualDataType) - { - m_reportError( - AZStd::string::format("Material property '%s': Type mismatch. Expected %s but was %s", - propertyName.GetCStr(), - ToString(expectedDataType), - ToString(actualDataType) - ).data()); - return false; - } - } - - return true; - } - bool MaterialAssetCreatorCommon::PropertyCheck(TypeId typeId, const Name& name) { if (!m_reportWarning || !m_reportError) @@ -108,7 +58,7 @@ namespace AZ return false; } - if (!ValidateDataType(typeId, name, materialPropertyDescriptor)) + if (!ValidateMaterialPropertyDataType(typeId, name, materialPropertyDescriptor, m_reportError)) { return false; } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialPropertyDescriptor.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialPropertyDescriptor.cpp index 5d0a88a6d3..ddbb902761 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialPropertyDescriptor.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialPropertyDescriptor.cpp @@ -97,6 +97,57 @@ namespace AZ return AZStd::string::format("", typeId.ToString().c_str()); } } + + bool ValidateMaterialPropertyDataType(TypeId typeId, const Name& propertyName, const MaterialPropertyDescriptor* materialPropertyDescriptor, AZStd::function onError) + { + auto toMaterialPropertyDataType = [](TypeId typeId) + { + if (typeId == azrtti_typeid()) { return MaterialPropertyDataType::Bool; } + if (typeId == azrtti_typeid()) { return MaterialPropertyDataType::Int; } + if (typeId == azrtti_typeid()) { return MaterialPropertyDataType::UInt; } + if (typeId == azrtti_typeid()) { return MaterialPropertyDataType::Float; } + if (typeId == azrtti_typeid()) { return MaterialPropertyDataType::Vector2; } + if (typeId == azrtti_typeid()) { return MaterialPropertyDataType::Vector3; } + if (typeId == azrtti_typeid()) { return MaterialPropertyDataType::Vector4; } + if (typeId == azrtti_typeid()) { return MaterialPropertyDataType::Color; } + if (typeId == azrtti_typeid>()) { return MaterialPropertyDataType::Image; } + else + { + return MaterialPropertyDataType::Invalid; + } + }; + + auto expectedDataType = materialPropertyDescriptor->GetDataType(); + auto actualDataType = toMaterialPropertyDataType(typeId); + + if (expectedDataType == MaterialPropertyDataType::Enum) + { + if (actualDataType != MaterialPropertyDataType::UInt) + { + onError( + AZStd::string::format("Material property '%s' is a Enum type, can only accept UInt value, input value is %s", + propertyName.GetCStr(), + ToString(actualDataType) + ).data()); + return false; + } + } + else + { + if (expectedDataType != actualDataType) + { + onError( + AZStd::string::format("Material property '%s': Type mismatch. Expected %s but was %s", + propertyName.GetCStr(), + ToString(expectedDataType), + ToString(actualDataType) + ).data()); + return false; + } + } + + return true; + } void MaterialPropertyOutputId::Reflect(ReflectContext* context) { diff --git a/Gems/Atom/RPI/Code/Tests/Material/LuaMaterialFunctorTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/LuaMaterialFunctorTests.cpp index 2608ac3a9b..5016f8303e 100644 --- a/Gems/Atom/RPI/Code/Tests/Material/LuaMaterialFunctorTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Material/LuaMaterialFunctorTests.cpp @@ -112,7 +112,7 @@ namespace UnitTest Data::Asset materialAsset; MaterialAssetCreator materialCreator; - materialCreator.Begin(Uuid::CreateRandom(), *m_materialTypeAsset); + materialCreator.Begin(Uuid::CreateRandom(), m_materialTypeAsset, true); EXPECT_TRUE(materialCreator.End(materialAsset)); m_material = Material::Create(materialAsset); @@ -138,7 +138,7 @@ namespace UnitTest Data::Asset materialAsset; MaterialAssetCreator materialCreator; - materialCreator.Begin(Uuid::CreateRandom(), *m_materialTypeAsset); + materialCreator.Begin(Uuid::CreateRandom(),m_materialTypeAsset, true); EXPECT_TRUE(materialCreator.End(materialAsset)); m_material = Material::Create(materialAsset); @@ -165,7 +165,7 @@ namespace UnitTest Data::Asset materialAsset; MaterialAssetCreator materialCreator; - materialCreator.Begin(Uuid::CreateRandom(), *m_materialTypeAsset); + materialCreator.Begin(Uuid::CreateRandom(), m_materialTypeAsset, true); EXPECT_TRUE(materialCreator.End(materialAsset)); m_material = Material::Create(materialAsset); @@ -194,7 +194,7 @@ namespace UnitTest Data::Asset materialAsset; MaterialAssetCreator materialCreator; - materialCreator.Begin(Uuid::CreateRandom(), *m_materialTypeAsset); + materialCreator.Begin(Uuid::CreateRandom(), m_materialTypeAsset, true); EXPECT_TRUE(materialCreator.End(materialAsset)); m_material = Material::Create(materialAsset); diff --git a/Gems/Atom/RPI/Code/Tests/Material/MaterialAssetTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/MaterialAssetTests.cpp index 58a852f176..633953cecc 100644 --- a/Gems/Atom/RPI/Code/Tests/Material/MaterialAssetTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Material/MaterialAssetTests.cpp @@ -94,7 +94,7 @@ namespace UnitTest Data::AssetId assetId(Uuid::CreateRandom()); MaterialAssetCreator creator; - creator.Begin(assetId, *m_testMaterialTypeAsset); + creator.Begin(assetId, m_testMaterialTypeAsset, true); creator.SetPropertyValue(Name{ "MyFloat2" }, Vector2{ 0.1f, 0.2f }); creator.SetPropertyValue(Name{ "MyFloat3" }, Vector3{ 1.1f, 1.2f, 1.3f }); creator.SetPropertyValue(Name{ "MyFloat4" }, Vector4{ 2.1f, 2.2f, 2.3f, 2.4f }); @@ -129,7 +129,7 @@ namespace UnitTest Data::AssetId assetId(Uuid::CreateRandom()); MaterialAssetCreator creator; - creator.Begin(assetId, *m_testMaterialTypeAsset); + creator.Begin(assetId, m_testMaterialTypeAsset, true); creator.SetPropertyValue(Name{ "MyFloat" }, 3.14f); Data::Asset materialAsset; @@ -171,7 +171,7 @@ namespace UnitTest Data::Asset materialAsset; MaterialAssetCreator materialCreator; - materialCreator.Begin(Uuid::CreateRandom(), *emptyMaterialTypeAsset); + materialCreator.Begin(Uuid::CreateRandom(), emptyMaterialTypeAsset, true); EXPECT_TRUE(materialCreator.End(materialAsset)); EXPECT_EQ(emptyMaterialTypeAsset, materialAsset->GetMaterialTypeAsset()); EXPECT_EQ(materialAsset->GetPropertyValues().size(), 0); @@ -189,7 +189,7 @@ namespace UnitTest Data::AssetId assetId(Uuid::CreateRandom()); MaterialAssetCreator creator; - creator.Begin(assetId, *m_testMaterialTypeAsset); + creator.Begin(assetId, m_testMaterialTypeAsset, true); creator.SetPropertyValue(Name{ "MyImage" }, streamingImageAsset); Data::Asset materialAsset; @@ -231,8 +231,8 @@ namespace UnitTest Data::AssetId assetId(Uuid::CreateRandom()); MaterialAssetCreator creator; - const bool includePropertyNames = true; - creator.Begin(assetId, *testMaterialTypeAssetV1, includePropertyNames); + const bool shouldFinalize = false; + creator.Begin(assetId, testMaterialTypeAssetV1, shouldFinalize); creator.SetPropertyValue(Name{ "MyInt" }, 7); creator.SetPropertyValue(Name{ "MyUInt" }, 8u); creator.SetPropertyValue(Name{ "MyFloat" }, 9.0f); @@ -307,26 +307,68 @@ namespace UnitTest // We use local functions to easily start a new MaterialAssetCreator for each test case because // the AssetCreator would just skip subsequent operations after the first failure is detected. - auto expectCreatorError = [this](AZStd::function passBadInput) + auto expectCreatorError = [this](const char* expectedErrorMessage, AZStd::function passBadInput) { - MaterialAssetCreator creator; - creator.Begin(Uuid::CreateRandom(), *m_testMaterialTypeAsset); + // Test with finalizing enabled + { + MaterialAssetCreator creator; + creator.Begin(Uuid::CreateRandom(), m_testMaterialTypeAsset, true); + + ErrorMessageFinder errorMessageFinder; + errorMessageFinder.AddExpectedErrorMessage(expectedErrorMessage); + errorMessageFinder.AddIgnoredErrorMessage("Failed to build", true); + + passBadInput(creator); - AZ_TEST_START_ASSERTTEST; - passBadInput(creator); - AZ_TEST_STOP_ASSERTTEST(1); + Data::Asset materialAsset; + EXPECT_FALSE(creator.End(materialAsset)); + + errorMessageFinder.CheckExpectedErrorsFound(); + + EXPECT_TRUE(creator.GetErrorCount() > 0); + } + + // Test with finalizing disabled, so no validation occurs because the MaterialTypeAsset data is not used. + { + MaterialAssetCreator creator; + creator.Begin(Uuid::CreateRandom(), m_testMaterialTypeAsset, false); - EXPECT_EQ(1, creator.GetErrorCount()); + passBadInput(creator); + + Data::Asset materialAsset; + EXPECT_TRUE(creator.End(materialAsset)); + + EXPECT_EQ(creator.GetErrorCount(), 0); + } }; auto expectCreatorWarning = [this](AZStd::function passBadInput) { - MaterialAssetCreator creator; - creator.Begin(Uuid::CreateRandom(), *m_testMaterialTypeAsset); + // Test with finalizing enabled + { + MaterialAssetCreator creator; + creator.Begin(Uuid::CreateRandom(), m_testMaterialTypeAsset, true); + + passBadInput(creator); + + Data::Asset material; + creator.End(material); - passBadInput(creator); + EXPECT_EQ(1, creator.GetWarningCount()); + } + + // Test with finalizing disabled, so no validation occurs because the MaterialTypeAsset data is not used. + { + MaterialAssetCreator creator; + creator.Begin(Uuid::CreateRandom(), m_testMaterialTypeAsset, false); + + passBadInput(creator); + + Data::Asset material; + creator.End(material); - EXPECT_EQ(1, creator.GetWarningCount()); + EXPECT_EQ(0, creator.GetWarningCount()); + } }; // Invalid input ID @@ -343,55 +385,65 @@ namespace UnitTest // Test data type mismatches... - expectCreatorError([this](MaterialAssetCreator& creator) - { - creator.SetPropertyValue(Name{ "MyBool" }, m_testImageAsset); - }); + expectCreatorError("Type mismatch", + [this](MaterialAssetCreator& creator) + { + creator.SetPropertyValue(Name{ "MyBool" }, m_testImageAsset); + }); - expectCreatorError([](MaterialAssetCreator& creator) - { - creator.SetPropertyValue(Name{ "MyInt" }, 0.0f); - }); + expectCreatorError("Type mismatch", + [](MaterialAssetCreator& creator) + { + creator.SetPropertyValue(Name{ "MyInt" }, 0.0f); + }); - expectCreatorError([](MaterialAssetCreator& creator) - { - creator.SetPropertyValue(Name{ "MyUInt" }, -1); - }); + expectCreatorError("Type mismatch", + [](MaterialAssetCreator& creator) + { + creator.SetPropertyValue(Name{ "MyUInt" }, -1); + }); - expectCreatorError([](MaterialAssetCreator& creator) - { - creator.SetPropertyValue(Name{ "MyFloat" }, 10u); - }); + expectCreatorError("Type mismatch", + [](MaterialAssetCreator& creator) + { + creator.SetPropertyValue(Name{ "MyFloat" }, 10u); + }); - expectCreatorError([](MaterialAssetCreator& creator) - { - creator.SetPropertyValue(Name{ "MyFloat2" }, 1.0f); - }); + expectCreatorError("Type mismatch", + [](MaterialAssetCreator& creator) + { + creator.SetPropertyValue(Name{ "MyFloat2" }, 1.0f); + }); - expectCreatorError([](MaterialAssetCreator& creator) - { - creator.SetPropertyValue(Name{ "MyFloat3" }, AZ::Vector4{}); - }); + expectCreatorError("Type mismatch", + [](MaterialAssetCreator& creator) + { + creator.SetPropertyValue(Name{ "MyFloat3" }, AZ::Vector4{}); + }); - expectCreatorError([](MaterialAssetCreator& creator) - { - creator.SetPropertyValue(Name{ "MyFloat4" }, AZ::Vector3{}); - }); + expectCreatorError("Type mismatch", + [](MaterialAssetCreator& creator) + { + creator.SetPropertyValue(Name{ "MyFloat4" }, AZ::Vector3{}); + }); - expectCreatorError([](MaterialAssetCreator& creator) - { - creator.SetPropertyValue(Name{ "MyColor" }, MaterialPropertyValue(false)); - }); + expectCreatorError("Type mismatch", + [](MaterialAssetCreator& creator) + { + creator.SetPropertyValue(Name{ "MyColor" }, MaterialPropertyValue(false)); + }); - expectCreatorError([](MaterialAssetCreator& creator) - { - creator.SetPropertyValue(Name{ "MyImage" }, true); - }); + expectCreatorError("Type mismatch", + [](MaterialAssetCreator& creator) + { + creator.SetPropertyValue(Name{ "MyImage" }, true); + }); - expectCreatorError([](MaterialAssetCreator& creator) - { - creator.SetPropertyValue(Name{ "MyEnum" }, -1); - }); + expectCreatorError("can only accept UInt value", + [](MaterialAssetCreator& creator) + { + creator.SetPropertyValue(Name{ "MyEnum" }, -1); + }); } } diff --git a/Gems/Atom/RPI/Code/Tests/Material/MaterialFunctorTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/MaterialFunctorTests.cpp index ff5d24ff9a..3373646c6e 100644 --- a/Gems/Atom/RPI/Code/Tests/Material/MaterialFunctorTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Material/MaterialFunctorTests.cpp @@ -275,7 +275,7 @@ namespace UnitTest materialTypeCreator.End(m_testMaterialTypeAsset); MaterialAssetCreator materialCreator; - materialCreator.Begin(Uuid::CreateRandom(), *m_testMaterialTypeAsset); + materialCreator.Begin(Uuid::CreateRandom(), m_testMaterialTypeAsset, true); materialCreator.SetPropertyValue(registedPropertyName, 42); materialCreator.SetPropertyValue(unregistedPropertyName, 42); materialCreator.SetPropertyValue(unrelatedPropertyName, 42); diff --git a/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp index d4bf3e5eaa..73aeacf818 100644 --- a/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp @@ -175,7 +175,7 @@ namespace UnitTest AddProperty(sourceData, "general", "MyImage", AZStd::string("@exefolder@/Temp/test.streamingimage")); AddProperty(sourceData, "general", "MyEnum", AZStd::string("Enum1")); - auto materialAssetOutcome = sourceData.CreateMaterialAsset(Uuid::CreateRandom(), "", true); + auto materialAssetOutcome = sourceData.CreateMaterialAsset(Uuid::CreateRandom(), "", MaterialAssetProcessingMode::PreBake, true); EXPECT_TRUE(materialAssetOutcome.IsSuccess()); Data::Asset materialAsset = materialAssetOutcome.GetValue(); @@ -544,17 +544,17 @@ namespace UnitTest AddPropertyGroup(sourceDataLevel3, "general"); AddProperty(sourceDataLevel3, "general", "MyFloat", 3.5f); - auto materialAssetLevel1 = sourceDataLevel1.CreateMaterialAsset(Uuid::CreateRandom(), "", true); + auto materialAssetLevel1 = sourceDataLevel1.CreateMaterialAsset(Uuid::CreateRandom(), "", MaterialAssetProcessingMode::PreBake, true); EXPECT_TRUE(materialAssetLevel1.IsSuccess()); m_assetSystemStub.RegisterSourceInfo("level1.material", materialAssetLevel1.GetValue().GetId()); - auto materialAssetLevel2 = sourceDataLevel2.CreateMaterialAsset(Uuid::CreateRandom(), "", true); + auto materialAssetLevel2 = sourceDataLevel2.CreateMaterialAsset(Uuid::CreateRandom(), "", MaterialAssetProcessingMode::PreBake, true); EXPECT_TRUE(materialAssetLevel2.IsSuccess()); m_assetSystemStub.RegisterSourceInfo("level2.material", materialAssetLevel2.GetValue().GetId()); - auto materialAssetLevel3 = sourceDataLevel3.CreateMaterialAsset(Uuid::CreateRandom(), "", true); + auto materialAssetLevel3 = sourceDataLevel3.CreateMaterialAsset(Uuid::CreateRandom(), "", MaterialAssetProcessingMode::PreBake, true); EXPECT_TRUE(materialAssetLevel3.IsSuccess()); auto layout = m_testMaterialTypeAsset->GetMaterialPropertiesLayout(); @@ -604,18 +604,18 @@ namespace UnitTest sourceDataLevel3.m_materialType = "@exefolder@/Temp/otherBase.materialtype"; sourceDataLevel3.m_parentMaterial = "level2.material"; - auto materialAssetLevel1 = sourceDataLevel1.CreateMaterialAsset(Uuid::CreateRandom(), "", true); + auto materialAssetLevel1 = sourceDataLevel1.CreateMaterialAsset(Uuid::CreateRandom(), "", MaterialAssetProcessingMode::PreBake, true); EXPECT_TRUE(materialAssetLevel1.IsSuccess()); m_assetSystemStub.RegisterSourceInfo("level1.material", materialAssetLevel1.GetValue().GetId()); - auto materialAssetLevel2 = sourceDataLevel2.CreateMaterialAsset(Uuid::CreateRandom(), "", true); + auto materialAssetLevel2 = sourceDataLevel2.CreateMaterialAsset(Uuid::CreateRandom(), "", MaterialAssetProcessingMode::PreBake, true); EXPECT_TRUE(materialAssetLevel2.IsSuccess()); m_assetSystemStub.RegisterSourceInfo("level2.material", materialAssetLevel2.GetValue().GetId()); AZ_TEST_START_ASSERTTEST; - auto materialAssetLevel3 = sourceDataLevel3.CreateMaterialAsset(Uuid::CreateRandom(), "", true); + auto materialAssetLevel3 = sourceDataLevel3.CreateMaterialAsset(Uuid::CreateRandom(), "", MaterialAssetProcessingMode::PreBake, true); AZ_TEST_STOP_ASSERTTEST(1); EXPECT_FALSE(materialAssetLevel3.IsSuccess()); } @@ -625,7 +625,7 @@ namespace UnitTest // We use local functions to easily start a new MaterialAssetCreator for each test case because // the AssetCreator would just skip subsequent operations after the first failure is detected. - auto expectWarning = [](AZStd::function setOneBadInput, [[maybe_unused]] uint32_t expectedAsserts = 1) + auto expectWarning = [](const char* expectedErrorMessage, AZStd::function setOneBadInput, bool warningOccursBeforeFinalize = false) { MaterialSourceData sourceData; @@ -635,233 +635,69 @@ namespace UnitTest setOneBadInput(sourceData); - AZ_TEST_START_ASSERTTEST; - auto materialAssetOutcome = sourceData.CreateMaterialAsset(Uuid::CreateRandom(), "", true); - AZ_TEST_STOP_ASSERTTEST(expectedAsserts); // Usually just one for when End() is called + // Check with MaterialAssetProcessingMode::PreBake + { + ErrorMessageFinder errorFinder; + errorFinder.AddExpectedErrorMessage(expectedErrorMessage); + errorFinder.AddIgnoredErrorMessage("Failed to build", true); + auto materialAssetOutcome = sourceData.CreateMaterialAsset(Uuid::CreateRandom(), "", MaterialAssetProcessingMode::PreBake, true); + errorFinder.CheckExpectedErrorsFound(); - EXPECT_FALSE(materialAssetOutcome.IsSuccess()); + EXPECT_FALSE(materialAssetOutcome.IsSuccess()); + } + + // Check with MaterialAssetProcessingMode::DeferredBake, no validation occurs because the MaterialTypeAsset cannot be used and so the MaterialAsset is not finalized + if(!warningOccursBeforeFinalize) + { + auto materialAssetOutcome = sourceData.CreateMaterialAsset(Uuid::CreateRandom(), "", MaterialAssetProcessingMode::DeferredBake, true); + EXPECT_TRUE(materialAssetOutcome.IsSuccess()); + } }; // Test property does not exist... - expectWarning([](MaterialSourceData& materialSourceData) - { - AddProperty(materialSourceData, "general", "DoesNotExist", true); - }); + expectWarning("\"general.DoesNotExist\" is not found in the material properties layout", + [](MaterialSourceData& materialSourceData) + { + AddProperty(materialSourceData, "general", "DoesNotExist", true); + }); - expectWarning([](MaterialSourceData& materialSourceData) - { - AddProperty(materialSourceData, "general", "DoesNotExist", -10); - }); + expectWarning("\"general.DoesNotExist\" is not found in the material properties layout", + [](MaterialSourceData& materialSourceData) + { + AddProperty(materialSourceData, "general", "DoesNotExist", -10); + }); - expectWarning([](MaterialSourceData& materialSourceData) - { - AddProperty(materialSourceData, "general", "DoesNotExist", 25u); - }); + expectWarning("\"general.DoesNotExist\" is not found in the material properties layout", + [](MaterialSourceData& materialSourceData) + { + AddProperty(materialSourceData, "general", "DoesNotExist", 25u); + }); - expectWarning([](MaterialSourceData& materialSourceData) - { - AddProperty(materialSourceData, "general", "DoesNotExist", 1.5f); - }); + expectWarning("\"general.DoesNotExist\" is not found in the material properties layout", + [](MaterialSourceData& materialSourceData) + { + AddProperty(materialSourceData, "general", "DoesNotExist", 1.5f); + }); - expectWarning([](MaterialSourceData& materialSourceData) - { - AddProperty(materialSourceData, "general", "DoesNotExist", AZ::Color{ 0.1f, 0.2f, 0.3f, 0.4f }); - }); + expectWarning("\"general.DoesNotExist\" is not found in the material properties layout", + [](MaterialSourceData& materialSourceData) + { + AddProperty(materialSourceData, "general", "DoesNotExist", AZ::Color{ 0.1f, 0.2f, 0.3f, 0.4f }); + }); - expectWarning([](MaterialSourceData& materialSourceData) - { - AddProperty(materialSourceData, "general", "DoesNotExist", AZStd::string("@exefolder@/Temp/test.streamingimage")); - }); + expectWarning("\"general.DoesNotExist\" is not found in the material properties layout", + [](MaterialSourceData& materialSourceData) + { + AddProperty(materialSourceData, "general", "DoesNotExist", AZStd::string("@exefolder@/Temp/test.streamingimage")); + }); // Missing image reference - expectWarning([](MaterialSourceData& materialSourceData) - { - AddProperty(materialSourceData, "general", "MyImage", AZStd::string("doesNotExist.streamingimage")); - }); - } - - - TEST_F(MaterialSourceDataTests, Load_MaterialTypeVersionUpdate) - { - const AZStd::string inputJson = R"( - { - "materialType": "@exefolder@/Temp/test.materialtype", - "materialTypeVersion": 1, - "properties": { - "general": { - "testColorNameA": [0.1, 0.2, 0.3] - } - } - } - )"; - - MaterialSourceData material; - JsonTestResult loadResult = LoadTestDataFromJson(material, inputJson); - - EXPECT_EQ(AZ::JsonSerializationResult::Tasks::ReadField, loadResult.m_jsonResultCode.GetTask()); - EXPECT_EQ(AZ::JsonSerializationResult::Processing::Completed, loadResult.m_jsonResultCode.GetProcessing()); - - // Initially, the loaded material data will match the .material file exactly. This gives us the accurate representation of - // what's actually saved on disk. - - EXPECT_NE(material.m_properties["general"].find("testColorNameA"), material.m_properties["general"].end()); - EXPECT_EQ(material.m_properties["general"].find("testColorNameB"), material.m_properties["general"].end()); - EXPECT_EQ(material.m_properties["general"].find("testColorNameC"), material.m_properties["general"].end()); - EXPECT_EQ(material.m_properties["general"].find("MyColor"), material.m_properties["general"].end()); - - AZ::Color testColor = material.m_properties["general"]["testColorNameA"].m_value.GetValue(); - EXPECT_TRUE(AZ::Color(0.1f, 0.2f, 0.3f, 1.0f).IsClose(testColor, 0.01)); - - EXPECT_EQ(1, material.m_materialTypeVersion); - - // Then we force the material data to update to the latest material type version specification - ErrorMessageFinder warningFinder; // Note this finds errors and warnings, and we're looking for a warning. - warningFinder.AddExpectedErrorMessage("Automatic updates are available. Consider updating the .material source file"); - warningFinder.AddExpectedErrorMessage("This material is based on version '1'"); - warningFinder.AddExpectedErrorMessage("material type is now at version '10'"); - material.ApplyVersionUpdates(); - warningFinder.CheckExpectedErrorsFound(); - - // Now the material data should match the latest material type. - // Look for the property under the latest name in the material type, not the name used in the .material file. - - EXPECT_EQ(material.m_properties["general"].find("testColorNameA"), material.m_properties["general"].end()); - EXPECT_EQ(material.m_properties["general"].find("testColorNameB"), material.m_properties["general"].end()); - EXPECT_EQ(material.m_properties["general"].find("testColorNameC"), material.m_properties["general"].end()); - EXPECT_NE(material.m_properties["general"].find("MyColor"), material.m_properties["general"].end()); - - testColor = material.m_properties["general"]["MyColor"].m_value.GetValue(); - EXPECT_TRUE(AZ::Color(0.1f, 0.2f, 0.3f, 1.0f).IsClose(testColor, 0.01)); - - EXPECT_EQ(10, material.m_materialTypeVersion); - - // Calling ApplyVersionUpdates() again should not report the warning again, since the material has already been updated. - warningFinder.Reset(); - material.ApplyVersionUpdates(); - } - - TEST_F(MaterialSourceDataTests, Load_MaterialTypeVersionUpdate_MovePropertiesToAnotherGroup) - { - const AZStd::string inputJson = R"( - { - "materialType": "@exefolder@/Temp/test.materialtype", - "materialTypeVersion": 3, - "properties": { - "oldGroup": { - "MyFloat": 1.2, - "MyIntOldName": 5 - } - } - } - )"; - - MaterialSourceData material; - JsonTestResult loadResult = LoadTestDataFromJson(material, inputJson); - - EXPECT_EQ(AZ::JsonSerializationResult::Tasks::ReadField, loadResult.m_jsonResultCode.GetTask()); - EXPECT_EQ(AZ::JsonSerializationResult::Processing::Completed, loadResult.m_jsonResultCode.GetProcessing()); - - // Initially, the loaded material data will match the .material file exactly. This gives us the accurate representation of - // what's actually saved on disk. - - EXPECT_NE(material.m_properties["oldGroup"].find("MyFloat"), material.m_properties["oldGroup"].end()); - EXPECT_NE(material.m_properties["oldGroup"].find("MyIntOldName"), material.m_properties["oldGroup"].end()); - EXPECT_EQ(material.m_properties["general"].find("MyFloat"), material.m_properties["general"].end()); - EXPECT_EQ(material.m_properties["general"].find("MyInt"), material.m_properties["general"].end()); - - float myFloat = material.m_properties["oldGroup"]["MyFloat"].m_value.GetValue(); - EXPECT_EQ(myFloat, 1.2f); - - int32_t myInt = material.m_properties["oldGroup"]["MyIntOldName"].m_value.GetValue(); - EXPECT_EQ(myInt, 5); - - EXPECT_EQ(3, material.m_materialTypeVersion); - - // Then we force the material data to update to the latest material type version specification - ErrorMessageFinder warningFinder; // Note this finds errors and warnings, and we're looking for a warning. - warningFinder.AddExpectedErrorMessage("Automatic updates are available. Consider updating the .material source file"); - warningFinder.AddExpectedErrorMessage("This material is based on version '3'"); - warningFinder.AddExpectedErrorMessage("material type is now at version '10'"); - material.ApplyVersionUpdates(); - warningFinder.CheckExpectedErrorsFound(); - - // Now the material data should match the latest material type. - // Look for the property under the latest name in the material type, not the name used in the .material file. - - EXPECT_EQ(material.m_properties["oldGroup"].find("MyFloat"), material.m_properties["oldGroup"].end()); - EXPECT_EQ(material.m_properties["oldGroup"].find("MyIntOldName"), material.m_properties["oldGroup"].end()); - EXPECT_NE(material.m_properties["general"].find("MyFloat"), material.m_properties["general"].end()); - EXPECT_NE(material.m_properties["general"].find("MyInt"), material.m_properties["general"].end()); - - myFloat = material.m_properties["general"]["MyFloat"].m_value.GetValue(); - EXPECT_EQ(myFloat, 1.2f); - - myInt = material.m_properties["general"]["MyInt"].m_value.GetValue(); - EXPECT_EQ(myInt, 5); - - EXPECT_EQ(10, material.m_materialTypeVersion); - - // Calling ApplyVersionUpdates() again should not report the warning again, since the material has already been updated. - warningFinder.Reset(); - material.ApplyVersionUpdates(); - } - - TEST_F(MaterialSourceDataTests, Load_MaterialTypeVersionPartialUpdate) - { - // This case is similar to Load_MaterialTypeVersionUpdate but we start at a later - // version so only some of the version updates are applied. - - const AZStd::string inputJson = R"( - { - "materialType": "@exefolder@/Temp/test.materialtype", - "materialTypeVersion": 3, - "properties": { - "general": { - "testColorNameB": [0.1, 0.2, 0.3] - } - } - } - )"; - - MaterialSourceData material; - JsonTestResult loadResult = LoadTestDataFromJson(material, inputJson); - - EXPECT_EQ(AZ::JsonSerializationResult::Tasks::ReadField, loadResult.m_jsonResultCode.GetTask()); - EXPECT_EQ(AZ::JsonSerializationResult::Processing::Completed, loadResult.m_jsonResultCode.GetProcessing()); - - material.ApplyVersionUpdates(); - - AZ::Color testColor = material.m_properties["general"]["MyColor"].m_value.GetValue(); - EXPECT_TRUE(AZ::Color(0.1f, 0.2f, 0.3f, 1.0f).IsClose(testColor, 0.01)); - - EXPECT_EQ(10, material.m_materialTypeVersion); - } - - TEST_F(MaterialSourceDataTests, Load_Error_MaterialTypeVersionUpdateWithMismatchedVersion) - { - const AZStd::string inputJson = R"( - { - "materialType": "@exefolder@/Temp/test.materialtype", - "materialTypeVersion": 3, // At this version, the property should be testColorNameB not testColorNameA - "properties": { - "general": { - "testColorNameA": [0.1, 0.2, 0.3] - } - } - } - )"; - - MaterialSourceData material; - JsonTestResult loadResult = LoadTestDataFromJson(material, inputJson); - - loadResult.ContainsMessage("/properties/general/testColorNameA", "Property 'general.testColorNameA' not found in material type."); - - EXPECT_FALSE(material.m_properties["general"]["testColorNameA"].m_value.IsValid()); - - material.ApplyVersionUpdates(); - - EXPECT_FALSE(material.m_properties["general"]["MyColor"].m_value.IsValid()); + expectWarning("Could not find the image 'doesNotExist.streamingimage'", + [](MaterialSourceData& materialSourceData) + { + AddProperty(materialSourceData, "general", "MyImage", AZStd::string("doesNotExist.streamingimage")); + }, true); // In this case, the warning does happen even when the asset is not finalized, because the image path is checked earlier than that } } diff --git a/Gems/Atom/RPI/Code/Tests/Material/MaterialTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/MaterialTests.cpp index 477978875b..569f8f6df0 100644 --- a/Gems/Atom/RPI/Code/Tests/Material/MaterialTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Material/MaterialTests.cpp @@ -85,7 +85,7 @@ namespace UnitTest m_testImage = StreamingImage::FindOrCreate(m_testImageAsset); MaterialAssetCreator materialCreator; - materialCreator.Begin(Uuid::CreateRandom(), *m_testMaterialTypeAsset); + materialCreator.Begin(Uuid::CreateRandom(), m_testMaterialTypeAsset, true); materialCreator.SetPropertyValue(Name{ "MyFloat2" }, Vector2{ 0.1f, 0.2f }); materialCreator.SetPropertyValue(Name{ "MyFloat3" }, Vector3{ 1.1f, 1.2f, 1.3f }); materialCreator.SetPropertyValue(Name{ "MyFloat4" }, Vector4{ 2.1f, 2.2f, 2.3f, 2.4f }); @@ -289,7 +289,7 @@ namespace UnitTest materialTypeCreator.End(materialTypeAsset); MaterialAssetCreator materialAssetCreator; - materialAssetCreator.Begin(Uuid::CreateRandom(), *materialTypeAsset); + materialAssetCreator.Begin(Uuid::CreateRandom(), materialTypeAsset, true); materialAssetCreator.End(materialAsset); Data::Instance material = Material::FindOrCreate(materialAsset); @@ -341,7 +341,7 @@ namespace UnitTest Data::Asset materialAssetWithEmptyImage; MaterialAssetCreator materialCreator; - materialCreator.Begin(Uuid::CreateRandom(), *m_testMaterialTypeAsset); + materialCreator.Begin(Uuid::CreateRandom(), m_testMaterialTypeAsset, true); materialCreator.SetPropertyValue(Name{"MyFloat2"}, Vector2{0.1f, 0.2f}); materialCreator.SetPropertyValue(Name{"MyFloat3"}, Vector3{1.1f, 1.2f, 1.3f}); materialCreator.SetPropertyValue(Name{"MyFloat4"}, Vector4{2.1f, 2.2f, 2.3f, 2.4f}); @@ -379,7 +379,7 @@ namespace UnitTest Data::Asset emptyMaterialAsset; MaterialAssetCreator materialCreator; - materialCreator.Begin(Uuid::CreateRandom(), *emptyMaterialTypeAsset); + materialCreator.Begin(Uuid::CreateRandom(), emptyMaterialTypeAsset, true); EXPECT_TRUE(materialCreator.End(emptyMaterialAsset)); Data::Instance material = Material::FindOrCreate(emptyMaterialAsset); @@ -450,7 +450,7 @@ namespace UnitTest materialTypeCreator.End(m_testMaterialTypeAsset); MaterialAssetCreator materialAssetCreator; - materialAssetCreator.Begin(Uuid::CreateRandom(), *m_testMaterialTypeAsset); + materialAssetCreator.Begin(Uuid::CreateRandom(), m_testMaterialTypeAsset, true); materialAssetCreator.End(m_testMaterialAsset); Data::Instance material = Material::FindOrCreate(m_testMaterialAsset); @@ -521,7 +521,7 @@ namespace UnitTest materialTypeCreator.End(m_testMaterialTypeAsset); MaterialAssetCreator materialAssetCreator; - materialAssetCreator.Begin(Uuid::CreateRandom(), *m_testMaterialTypeAsset); + materialAssetCreator.Begin(Uuid::CreateRandom(), m_testMaterialTypeAsset, true); materialAssetCreator.End(m_testMaterialAsset); Data::Instance material = Material::FindOrCreate(m_testMaterialAsset); @@ -591,7 +591,7 @@ namespace UnitTest materialTypeCreator.End(m_testMaterialTypeAsset); MaterialAssetCreator materialAssetCreator; - materialAssetCreator.Begin(Uuid::CreateRandom(), *m_testMaterialTypeAsset); + materialAssetCreator.Begin(Uuid::CreateRandom(), m_testMaterialTypeAsset, true); materialAssetCreator.End(m_testMaterialAsset); Data::Instance material = Material::FindOrCreate(m_testMaterialAsset); @@ -655,7 +655,7 @@ namespace UnitTest materialTypeCreator.End(m_testMaterialTypeAsset); MaterialAssetCreator materialAssetCreator; - materialAssetCreator.Begin(Uuid::CreateRandom(), *m_testMaterialTypeAsset); + materialAssetCreator.Begin(Uuid::CreateRandom(), m_testMaterialTypeAsset, true); materialAssetCreator.End(m_testMaterialAsset); Data::Instance material = Material::FindOrCreate(m_testMaterialAsset); @@ -669,7 +669,7 @@ namespace UnitTest { Data::Asset materialAsset; MaterialAssetCreator materialCreator; - materialCreator.Begin(Uuid::CreateRandom(), *m_testMaterialTypeAsset); + materialCreator.Begin(Uuid::CreateRandom(), m_testMaterialTypeAsset, true); materialCreator.SetPropertyValue(Name{ "MyFloat2" }, Vector2{ 0.1f, 0.2f }); materialCreator.SetPropertyValue(Name{ "MyFloat3" }, Vector3{ 1.1f, 1.2f, 1.3f }); materialCreator.SetPropertyValue(Name{ "MyFloat4" }, Vector4{ 2.1f, 2.2f, 2.3f, 2.4f }); @@ -778,7 +778,7 @@ namespace UnitTest materialTypeCreator.End(materialTypeAsset); MaterialAssetCreator materialAssetCreator; - materialAssetCreator.Begin(Uuid::CreateRandom(), *materialTypeAsset); + materialAssetCreator.Begin(Uuid::CreateRandom(), materialTypeAsset, true); materialAssetCreator.End(materialAsset); Data::Instance material = Material::FindOrCreate(materialAsset); @@ -859,7 +859,7 @@ namespace UnitTest materialTypeCreator.End(m_testMaterialTypeAsset); MaterialAssetCreator materialCreator; - materialCreator.Begin(Uuid::CreateRandom(), *m_testMaterialTypeAsset); + materialCreator.Begin(Uuid::CreateRandom(), m_testMaterialTypeAsset, true); materialCreator.End(m_testMaterialAsset); Data::Instance material = Material::FindOrCreate(m_testMaterialAsset); From 1fa1eaad158fae98e0339411e3fead04a6b120c9 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Tue, 28 Dec 2021 17:51:43 -0800 Subject: [PATCH 522/948] Added unit tests for the new functionality. I found a mistake where MaterialAssetCreator needs to clear the raw data when configured to finalize the material asset. Since MaterialSourceData no longer relies on the material type source file at all, I was able to change MaterialSourceDataTest to avoid saving the source data to disk. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../Atom/RPI.Edit/Material/MaterialUtils.h | 1 - .../Atom/RPI.Reflect/Material/MaterialAsset.h | 1 - .../RPI.Edit/Material/MaterialUtils.cpp | 1 - .../Material/MaterialAssetCreator.cpp | 5 + .../Material/MaterialSourceDataTests.cpp | 248 ++++++++++++++++-- 5 files changed, 230 insertions(+), 26 deletions(-) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialUtils.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialUtils.h index 2a992159b3..2fb55e5f40 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialUtils.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialUtils.h @@ -69,7 +69,6 @@ namespace AZ //! Finalizing during asset processing reduces load times and obfuscates the material data. //! Waiting to finalize at load time reduces dependencies on the material type data, resulting in fewer asset rebuilds and less time spent processing assets. bool BuildersShouldFinalizeMaterialAssets(); - } } } diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAsset.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAsset.h index 736d7c5b53..4cc6608225 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAsset.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAsset.h @@ -15,7 +15,6 @@ #include #include #include -#include #include #include diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialUtils.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialUtils.cpp index 2fe30f632f..475c6ca219 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialUtils.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialUtils.cpp @@ -150,7 +150,6 @@ namespace AZ return shouldFinalize; } - } } } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAssetCreator.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAssetCreator.cpp index f05fb8d848..7d4ecf0b18 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAssetCreator.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAssetCreator.cpp @@ -48,6 +48,11 @@ namespace AZ m_asset->Finalize( [this](const char* message) { ReportWarning("%s", message); }, [this](const char* message) { ReportError("%s", message); }); + + // Finalize() doesn't clear the raw property data because that's the same function used at runtime, which does need to maintain the raw data + // to support hot reload. But here we are pre-baking with the assumption that AP build dependencies will keep the material type + // and material asset in sync, so we can discard the raw property data and just rely on the data in the material type asset. + m_asset->m_rawPropertyValues.clear(); } return EndCommon(result); diff --git a/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp index 73aeacf818..e4d3cc9768 100644 --- a/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -65,9 +66,29 @@ namespace UnitTest m_testShaderAsset = CreateTestShaderAsset(Uuid::CreateRandom(), m_testMaterialSrgLayout); m_assetSystemStub.RegisterSourceInfo("@exefolder@/Temp/test.shader", m_testShaderAsset.GetId()); - // The MaterialSourceData relies on both MaterialTypeSourceData and MaterialTypeAsset. We have to make sure the - // .materialtype file is present on disk, and that the MaterialTypeAsset is available through the asset database stub... + m_testMaterialTypeAsset = CreateTestMaterialTypeAsset(Uuid::CreateRandom()); + // Since this test doesn't actually instantiate a Material, it won't need to instantiate this ImageAsset, so all we + // need is an asset reference with a valid ID. + m_testImageAsset = Data::Asset{ Data::AssetId{Uuid::CreateRandom(), StreamingImageAsset::GetImageAssetSubId()}, azrtti_typeid() }; + + // Register the test assets with the AssetSystemStub so CreateMaterialAsset() can use AssetUtils. + m_assetSystemStub.RegisterSourceInfo("@exefolder@/Temp/test.materialtype", m_testMaterialTypeAsset.GetId()); + m_assetSystemStub.RegisterSourceInfo("@exefolder@/Temp/test.streamingimage", m_testImageAsset.GetId()); + } + + void TearDown() override + { + m_testMaterialTypeAsset.Reset(); + m_testMaterialSrgLayout = nullptr; + m_testShaderAsset.Reset(); + m_testImageAsset.Reset(); + + RPITestFixture::TearDown(); + } + + Data::Asset CreateTestMaterialTypeAsset(Data::AssetId assetId) + { const char* materialTypeJson = R"( { "version": 10, @@ -122,29 +143,10 @@ namespace UnitTest } )"; - AZ::Utils::WriteFile(materialTypeJson, "@exefolder@/Temp/test.materialtype"); MaterialTypeSourceData materialTypeSourceData; LoadTestDataFromJson(materialTypeSourceData, materialTypeJson); - m_testMaterialTypeAsset = materialTypeSourceData.CreateMaterialTypeAsset(Uuid::CreateRandom()).TakeValue(); - - // Since this test doesn't actually instantiate a Material, it won't need to instantiate this ImageAsset, so all we - // need is an asset reference with a valid ID. - m_testImageAsset = Data::Asset{ Data::AssetId{Uuid::CreateRandom(), StreamingImageAsset::GetImageAssetSubId()}, azrtti_typeid() }; - - // Register the test assets with the AssetSystemStub so CreateMaterialAsset() can use AssetUtils. - m_assetSystemStub.RegisterSourceInfo("@exefolder@/Temp/test.materialtype", m_testMaterialTypeAsset.GetId()); - m_assetSystemStub.RegisterSourceInfo("@exefolder@/Temp/test.streamingimage", m_testImageAsset.GetId()); - } - - void TearDown() override - { - m_testMaterialTypeAsset.Reset(); - m_testMaterialSrgLayout = nullptr; - m_testShaderAsset.Reset(); - m_testImageAsset.Reset(); - - RPITestFixture::TearDown(); + return materialTypeSourceData.CreateMaterialTypeAsset(assetId).TakeValue(); } }; @@ -180,7 +182,10 @@ namespace UnitTest Data::Asset materialAsset = materialAssetOutcome.GetValue(); - // The order here is based on the order in the MaterialTypeSourceData, as added to the the MaterialTypeAssetCreator. + EXPECT_TRUE(materialAsset->IsFinalized()); + EXPECT_EQ(0, materialAsset->GetRawPropertyValues().size()); // A pre-baked material has no need for the original raw property names and values + + // The order here is based on the order in the MaterialTypeSourceData, as added to the MaterialTypeAssetCreator. EXPECT_EQ(materialAsset->GetPropertyValues()[0].GetValue(), true); EXPECT_EQ(materialAsset->GetPropertyValues()[1].GetValue(), -10); EXPECT_EQ(materialAsset->GetPropertyValues()[2].GetValue(), 25u); @@ -192,6 +197,105 @@ namespace UnitTest EXPECT_EQ(materialAsset->GetPropertyValues()[8].GetValue>(), m_testImageAsset); EXPECT_EQ(materialAsset->GetPropertyValues()[9].GetValue(), 1u); } + + TEST_F(MaterialSourceDataTests, CreateMaterialAsset_DeferredBake) + { + // This test is similar to CreateMaterialAsset_BasicProperties but uses MaterialAssetProcessingMode::DeferredBake instead of PreBake. + + Data::AssetId materialTypeAssetId = Uuid::CreateRandom(); + + // This material type asset will be known by the asset system (stub) but doesn't exist in the AssetManager. + // This demonstrates that the CreateMaterialAsset does not attempt to access the MaterialTypeAsset data in MaterialAssetProcessingMode::DeferredBake. + m_assetSystemStub.RegisterSourceInfo("testDeferredBake.materialtype", materialTypeAssetId); + + MaterialSourceData sourceData; + + sourceData.m_materialType = "testDeferredBake.materialtype"; + AddPropertyGroup(sourceData, "general"); + AddProperty(sourceData, "general", "MyBool" , true); + AddProperty(sourceData, "general", "MyInt" , -10); + AddProperty(sourceData, "general", "MyUInt" , 25u); + AddProperty(sourceData, "general", "MyFloat" , 1.5f); + AddProperty(sourceData, "general", "MyColor" , AZ::Color{0.1f, 0.2f, 0.3f, 0.4f}); + AddProperty(sourceData, "general", "MyFloat2", AZ::Vector2(2.1f, 2.2f)); + AddProperty(sourceData, "general", "MyFloat3", AZ::Vector3(3.1f, 3.2f, 3.3f)); + AddProperty(sourceData, "general", "MyFloat4", AZ::Vector4(4.1f, 4.2f, 4.3f, 4.4f)); + AddProperty(sourceData, "general", "MyImage" , AZStd::string("@exefolder@/Temp/test.streamingimage")); + AddProperty(sourceData, "general", "MyEnum" , AZStd::string("Enum1")); + + auto materialAssetOutcome = sourceData.CreateMaterialAsset(Uuid::CreateRandom(), "", MaterialAssetProcessingMode::DeferredBake, true); + EXPECT_TRUE(materialAssetOutcome.IsSuccess()); + + Data::Asset materialAsset = materialAssetOutcome.GetValue(); + + EXPECT_FALSE(materialAsset->IsFinalized()); + // Note we avoid calling GetPropertyValues() because that will auto-finalize the material. We want to check its raw property values first. + + auto findRawPropertyValue = [materialAsset](const char* propertyId) + { + auto iter = AZStd::find_if(materialAsset->GetRawPropertyValues().begin(), materialAsset->GetRawPropertyValues().end(), [propertyId](const AZStd::pair& pair) + { + return pair.first == AZ::Name{propertyId}; + }); + + if (iter == materialAsset->GetRawPropertyValues().end()) + { + return MaterialPropertyValue{}; + } + else + { + return iter->second; + } + }; + + auto checkRawPropertyValues = [findRawPropertyValue, this]() + { + EXPECT_EQ(findRawPropertyValue("general.MyBool" ).GetValue(), true); + EXPECT_EQ(findRawPropertyValue("general.MyInt" ).GetValue(), -10); + EXPECT_EQ(findRawPropertyValue("general.MyUInt" ).GetValue(), 25u); + EXPECT_EQ(findRawPropertyValue("general.MyFloat" ).GetValue(), 1.5f); + EXPECT_EQ(findRawPropertyValue("general.MyFloat2").GetValue(), Vector2(2.1f, 2.2f)); + EXPECT_EQ(findRawPropertyValue("general.MyFloat3").GetValue(), Vector3(3.1f, 3.2f, 3.3f)); + EXPECT_EQ(findRawPropertyValue("general.MyFloat4").GetValue(), Vector4(4.1f, 4.2f, 4.3f, 4.4f)); + EXPECT_EQ(findRawPropertyValue("general.MyColor" ).GetValue(), Color(0.1f, 0.2f, 0.3f, 0.4f)); + EXPECT_EQ(findRawPropertyValue("general.MyImage" ).GetValue>(), m_testImageAsset); + // The raw value for an enum is the original string, not the numerical value, because the material type holds the necessary metadata to match the name to the value. + EXPECT_EQ(findRawPropertyValue("general.MyEnum" ).GetValue(), AZStd::string("Enum1")); + }; + + // We check the raw property values before the material type asset is even available + checkRawPropertyValues(); + + // Now we'll create the material type asset in memory so the material will have what it needs to finalize itself. + Data::Asset testMaterialTypeAsset = CreateTestMaterialTypeAsset(materialTypeAssetId); + + // The MaterialAsset is still holding an reference to an unloaded asset, so we run it through the serializer which causes the loaded MaterialAsset + // to have access to the testMaterialTypeAsset. This is similar to how the AP would save the MaterialAsset to the cache and the runtime would load it. + SerializeTester tester(GetSerializeContext()); + tester.SerializeOut(materialAsset.Get()); + materialAsset = tester.SerializeIn(Uuid::CreateRandom(), ObjectStream::FilterDescriptor{AZ::Data::AssetFilterNoAssetLoading}); + + // We check the raw property values again on the loaded data, showing that the same data is available in the original un-finalized state. + checkRawPropertyValues(); + + // The material will automatically finalize itself when the properties are accessed. + EXPECT_FALSE(materialAsset->IsFinalized()); + materialAsset->GetPropertyValues(); + EXPECT_TRUE(materialAsset->IsFinalized()); + + // Now all the property values should be available through the main GetPropertyValues() API. + EXPECT_EQ(materialAsset->GetPropertyValues()[0].GetValue(), true); + EXPECT_EQ(materialAsset->GetPropertyValues()[1].GetValue(), -10); + EXPECT_EQ(materialAsset->GetPropertyValues()[2].GetValue(), 25u); + EXPECT_EQ(materialAsset->GetPropertyValues()[3].GetValue(), 1.5f); + EXPECT_EQ(materialAsset->GetPropertyValues()[4].GetValue(), Vector2(2.1f, 2.2f)); + EXPECT_EQ(materialAsset->GetPropertyValues()[5].GetValue(), Vector3(3.1f, 3.2f, 3.3f)); + EXPECT_EQ(materialAsset->GetPropertyValues()[6].GetValue(), Vector4(4.1f, 4.2f, 4.3f, 4.4f)); + EXPECT_EQ(materialAsset->GetPropertyValues()[7].GetValue(), Color(0.1f, 0.2f, 0.3f, 0.4f)); + EXPECT_EQ(materialAsset->GetPropertyValues()[8].GetValue>(), m_testImageAsset); + EXPECT_EQ(materialAsset->GetPropertyValues()[9].GetValue(), 1u); + + } void CheckEqual(MaterialSourceData& a, MaterialSourceData& b) { @@ -546,16 +650,19 @@ namespace UnitTest auto materialAssetLevel1 = sourceDataLevel1.CreateMaterialAsset(Uuid::CreateRandom(), "", MaterialAssetProcessingMode::PreBake, true); EXPECT_TRUE(materialAssetLevel1.IsSuccess()); + EXPECT_TRUE(materialAssetLevel1.GetValue()->IsFinalized()); m_assetSystemStub.RegisterSourceInfo("level1.material", materialAssetLevel1.GetValue().GetId()); auto materialAssetLevel2 = sourceDataLevel2.CreateMaterialAsset(Uuid::CreateRandom(), "", MaterialAssetProcessingMode::PreBake, true); EXPECT_TRUE(materialAssetLevel2.IsSuccess()); + EXPECT_TRUE(materialAssetLevel2.GetValue()->IsFinalized()); m_assetSystemStub.RegisterSourceInfo("level2.material", materialAssetLevel2.GetValue().GetId()); auto materialAssetLevel3 = sourceDataLevel3.CreateMaterialAsset(Uuid::CreateRandom(), "", MaterialAssetProcessingMode::PreBake, true); EXPECT_TRUE(materialAssetLevel3.IsSuccess()); + EXPECT_TRUE(materialAssetLevel3.GetValue()->IsFinalized()); auto layout = m_testMaterialTypeAsset->GetMaterialPropertiesLayout(); MaterialPropertyIndex myFloat = layout->FindPropertyIndex(Name("general.MyFloat")); @@ -582,6 +689,101 @@ namespace UnitTest EXPECT_EQ(properties[myFloat2.GetIndex()].GetValue(), Vector2(4.1f, 4.2f)); EXPECT_EQ(properties[myColor.GetIndex()].GetValue(), Color(0.15f, 0.25f, 0.35f, 0.45f)); } + + TEST_F(MaterialSourceDataTests, CreateMaterialAsset_MultiLevelDataInheritance_DeferredBake) + { + // This test is similar to CreateMaterialAsset_MultiLevelDataInheritance but uses MaterialAssetProcessingMode::DeferredBake instead of PreBake. + + Data::AssetId materialTypeAssetId = Uuid::CreateRandom(); + + // This material type asset will be known by the asset system (stub) but doesn't exist in the AssetManager. + // This demonstrates that the CreateMaterialAsset does not attempt to access the MaterialTypeAsset data in MaterialAssetProcessingMode::DeferredBake. + m_assetSystemStub.RegisterSourceInfo("testDeferredBake.materialtype", materialTypeAssetId); + + MaterialSourceData sourceDataLevel1; + sourceDataLevel1.m_materialType = "testDeferredBake.materialtype"; + AddPropertyGroup(sourceDataLevel1, "general"); + AddProperty(sourceDataLevel1, "general", "MyFloat", 1.5f); + AddProperty(sourceDataLevel1, "general", "MyColor", AZ::Color{0.1f, 0.2f, 0.3f, 0.4f}); + + MaterialSourceData sourceDataLevel2; + sourceDataLevel2.m_materialType = "testDeferredBake.materialtype"; + sourceDataLevel2.m_parentMaterial = "level1.material"; + AddPropertyGroup(sourceDataLevel2, "general"); + AddProperty(sourceDataLevel2, "general", "MyColor", AZ::Color{0.15f, 0.25f, 0.35f, 0.45f}); + AddProperty(sourceDataLevel2, "general", "MyFloat2", AZ::Vector2{4.1f, 4.2f}); + + MaterialSourceData sourceDataLevel3; + sourceDataLevel3.m_materialType = "testDeferredBake.materialtype"; + sourceDataLevel3.m_parentMaterial = "level2.material"; + AddPropertyGroup(sourceDataLevel3, "general"); + AddProperty(sourceDataLevel3, "general", "MyFloat", 3.5f); + + auto materialAssetLevel1Result = sourceDataLevel1.CreateMaterialAsset(Uuid::CreateRandom(), "", MaterialAssetProcessingMode::DeferredBake, true); + EXPECT_TRUE(materialAssetLevel1Result.IsSuccess()); + Data::Asset materialAssetLevel1 = materialAssetLevel1Result.TakeValue(); + EXPECT_FALSE(materialAssetLevel1->IsFinalized()); + + m_assetSystemStub.RegisterSourceInfo("level1.material", materialAssetLevel1.GetId()); + + auto materialAssetLevel2Result = sourceDataLevel2.CreateMaterialAsset(Uuid::CreateRandom(), "", MaterialAssetProcessingMode::DeferredBake, true); + EXPECT_TRUE(materialAssetLevel2Result.IsSuccess()); + Data::Asset materialAssetLevel2 = materialAssetLevel2Result.TakeValue(); + EXPECT_FALSE(materialAssetLevel2->IsFinalized()); + + m_assetSystemStub.RegisterSourceInfo("level2.material", materialAssetLevel2.GetId()); + + auto materialAssetLevel3Result = sourceDataLevel3.CreateMaterialAsset(Uuid::CreateRandom(), "", MaterialAssetProcessingMode::DeferredBake, true); + EXPECT_TRUE(materialAssetLevel3Result.IsSuccess()); + Data::Asset materialAssetLevel3 = materialAssetLevel3Result.TakeValue(); + EXPECT_FALSE(materialAssetLevel3->IsFinalized()); + + // Now we'll create the material type asset in memory so the materials will have what they need to finalize. + Data::Asset testMaterialTypeAsset = CreateTestMaterialTypeAsset(materialTypeAssetId); + + auto layout = testMaterialTypeAsset->GetMaterialPropertiesLayout(); + MaterialPropertyIndex myFloat = layout->FindPropertyIndex(Name("general.MyFloat")); + MaterialPropertyIndex myFloat2 = layout->FindPropertyIndex(Name("general.MyFloat2")); + MaterialPropertyIndex myColor = layout->FindPropertyIndex(Name("general.MyColor")); + + + // The MaterialAsset is still holding an reference to an unloaded asset, so we run it through the serializer which causes the loaded MaterialAsset + // to have access to the testMaterialTypeAsset. This is similar to how the AP would save the MaterialAsset to the cache and the runtime would load it. + SerializeTester tester(GetSerializeContext()); + tester.SerializeOut(materialAssetLevel1.Get()); + materialAssetLevel1 = tester.SerializeIn(Uuid::CreateRandom(), ObjectStream::FilterDescriptor{AZ::Data::AssetFilterNoAssetLoading}); + tester.SerializeOut(materialAssetLevel2.Get()); + materialAssetLevel2 = tester.SerializeIn(Uuid::CreateRandom(), ObjectStream::FilterDescriptor{AZ::Data::AssetFilterNoAssetLoading}); + tester.SerializeOut(materialAssetLevel3.Get()); + materialAssetLevel3 = tester.SerializeIn(Uuid::CreateRandom(), ObjectStream::FilterDescriptor{AZ::Data::AssetFilterNoAssetLoading}); + + + // The properties will finalize automatically when we call GetPropertyValues()... + + AZStd::array_view properties; + + // Check level 1 properties + properties = materialAssetLevel1->GetPropertyValues(); + EXPECT_EQ(properties[myFloat.GetIndex()].GetValue(), 1.5f); + EXPECT_EQ(properties[myFloat2.GetIndex()].GetValue(), Vector2(0.0f, 0.0f)); + EXPECT_EQ(properties[myColor.GetIndex()].GetValue(), Color(0.1f, 0.2f, 0.3f, 0.4f)); + + // Check level 2 properties + properties = materialAssetLevel2->GetPropertyValues(); + EXPECT_EQ(properties[myFloat.GetIndex()].GetValue(), 1.5f); + EXPECT_EQ(properties[myFloat2.GetIndex()].GetValue(), Vector2(4.1f, 4.2f)); + EXPECT_EQ(properties[myColor.GetIndex()].GetValue(), Color(0.15f, 0.25f, 0.35f, 0.45f)); + + // Check level 3 properties + properties = materialAssetLevel3->GetPropertyValues(); + EXPECT_EQ(properties[myFloat.GetIndex()].GetValue(), 3.5f); + EXPECT_EQ(properties[myFloat2.GetIndex()].GetValue(), Vector2(4.1f, 4.2f)); + EXPECT_EQ(properties[myColor.GetIndex()].GetValue(), Color(0.15f, 0.25f, 0.35f, 0.45f)); + + EXPECT_TRUE(materialAssetLevel1->IsFinalized()); + EXPECT_TRUE(materialAssetLevel2->IsFinalized()); + EXPECT_TRUE(materialAssetLevel3->IsFinalized()); + } TEST_F(MaterialSourceDataTests, CreateMaterialAsset_MultiLevelDataInheritance_Error_MaterialTypesDontMatch) { From 4ade6bc88a2432a0073c2edf521d6c8ab5cf0716 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Tue, 28 Dec 2021 17:52:13 -0800 Subject: [PATCH 523/948] Fixed compile errors in Material Editor. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../MaterialEditor/Code/Source/Document/MaterialDocument.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp index 93da118b5b..641d586ea7 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp @@ -713,7 +713,7 @@ namespace MaterialEditor // Long term, the material document should not be concerned with assets at all. The viewport window should be the // only thing concerned with assets or instances. auto materialAssetResult = - m_materialSourceData.CreateMaterialAssetFromSourceData(Uuid::CreateRandom(), m_absolutePath, elevateWarnings, true, &m_sourceDependencies); + m_materialSourceData.CreateMaterialAssetFromSourceData(Uuid::CreateRandom(), m_absolutePath, elevateWarnings, &m_sourceDependencies); if (!materialAssetResult) { AZ_Error("MaterialDocument", false, "Material asset could not be created from source data: '%s'.", m_absolutePath.c_str()); @@ -753,7 +753,7 @@ namespace MaterialEditor } auto parentMaterialAssetResult = parentMaterialSourceData.CreateMaterialAssetFromSourceData( - parentMaterialAssetIdResult.GetValue(), m_materialSourceData.m_parentMaterial, true, true); + parentMaterialAssetIdResult.GetValue(), m_materialSourceData.m_parentMaterial, true); if (!parentMaterialAssetResult) { AZ_Error("MaterialDocument", false, "Material parent asset could not be created from source data: '%s'.", m_materialSourceData.m_parentMaterial.c_str()); From aafd34679af77484c949744964de6eb3fc6a4fb5 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Thu, 13 Jan 2022 12:48:32 -0800 Subject: [PATCH 524/948] Merged MaterialAssetCreatorCommon class into MaterialTypeAssetCreator because it is no longer needed for MaterialAssetCreator. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../Material/MaterialAssetCreatorCommon.h | 64 ------------- .../RPI.Reflect/Material/MaterialTypeAsset.h | 1 - .../Material/MaterialTypeAssetCreator.h | 14 ++- .../RPI.Builders/Material/MaterialBuilder.cpp | 6 +- .../Model/MaterialAssetBuilderComponent.cpp | 2 +- .../Material/MaterialAssetCreatorCommon.cpp | 93 ------------------- .../Material/MaterialTypeAssetCreator.cpp | 61 +++++++++--- .../RPI/Code/atom_rpi_reflect_files.cmake | 2 - 8 files changed, 63 insertions(+), 180 deletions(-) delete mode 100644 Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAssetCreatorCommon.h delete mode 100644 Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAssetCreatorCommon.cpp diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAssetCreatorCommon.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAssetCreatorCommon.h deleted file mode 100644 index c7fa9c2a4c..0000000000 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAssetCreatorCommon.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#pragma once - -#include -#include -#include -#include -#include - -// These classes are not directly referenced in this header only because the SetPropertyValue() -// function is templatized. But the API is still specific to these data types so we include them here. -#include -#include -#include -#include - -namespace AZ -{ - namespace RPI - { - class StreamingImageAsset; - class AttachmentImageAsset; - - //! Provides common functionality to both MaterialTypeAssetCreator and MaterialAssetCreator. - class MaterialAssetCreatorCommon - { - public: - void SetPropertyValue(const Name& name, const Data::Asset& imageAsset); - void SetPropertyValue(const Name& name, const Data::Asset& imageAsset); - void SetPropertyValue(const Name& name, const Data::Asset& imageAsset); - - //! Sets a property value using data in AZStd::variant-based MaterialPropertyValue. The contained data must match - //! the data type of the property. For type Image, the value must be a Data::Asset. - void SetPropertyValue(const Name& name, const MaterialPropertyValue& value); - - protected: - MaterialAssetCreatorCommon() = default; - - void OnBegin( - const MaterialPropertiesLayout* propertyLayout, - AZStd::vector* propertyValues, - const AZStd::function& warningFunc, - const AZStd::function& errorFunc); - void OnEnd(); - - private: - bool PropertyCheck(TypeId typeId, const Name& name); - - const MaterialPropertiesLayout* m_propertyLayout = nullptr; - //! Points to the m_propertyValues list in a MaterialAsset or MaterialTypeAsset - AZStd::vector* m_propertyValues = nullptr; - - AZStd::function m_reportWarning = nullptr; - AZStd::function m_reportError = nullptr; - }; - - } // namespace RPI -} // namespace AZ diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialTypeAsset.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialTypeAsset.h index f194d84263..9065b17254 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialTypeAsset.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialTypeAsset.h @@ -54,7 +54,6 @@ namespace AZ { friend class MaterialTypeAssetCreator; friend class MaterialTypeAssetHandler; - friend class MaterialAssetCreatorCommon; public: AZ_RTTI(MaterialTypeAsset, "{CD7803AB-9C4C-4A33-9A14-7412F1665464}", AZ::Data::AssetData); diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialTypeAssetCreator.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialTypeAssetCreator.h index 5e5f94da6d..6bd84b5546 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialTypeAssetCreator.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialTypeAssetCreator.h @@ -8,7 +8,6 @@ #pragma once #include -#include #include #include @@ -27,7 +26,6 @@ namespace AZ //! which provides the MaterialTypeAsset and default property values. class MaterialTypeAssetCreator : public AssetCreator - , public MaterialAssetCreatorCommon { public: //! Begin creating a MaterialTypeAsset @@ -71,6 +69,14 @@ namespace AZ //! Finishes creating a material property. void EndMaterialProperty(); + + void SetPropertyValue(const Name& name, const Data::Asset& imageAsset); + void SetPropertyValue(const Name& name, const Data::Asset& imageAsset); + void SetPropertyValue(const Name& name, const Data::Asset& imageAsset); + + //! Sets a property value using data in AZStd::variant-based MaterialPropertyValue. The contained data must match + //! the data type of the property. For type Image, the value must be a Data::Asset. + void SetPropertyValue(const Name& name, const MaterialPropertyValue& value); //! Adds a MaterialFunctor. //! Material functors provide custom logic and calculations to configure shaders, render states, and more.See MaterialFunctor.h for details. @@ -101,7 +107,9 @@ namespace AZ private: void AddMaterialProperty(MaterialPropertyDescriptor&& materialProperty); - + + bool PropertyCheck(TypeId typeId, const Name& name); + //! The material type holds references to shader assets that contain SRGs that are supposed to be the same across all passes in the material. //! This function searches for an SRG given a @bindingSlot. If a valid one is found it makes sure it is the same across all shaders //! and records in srgShaderIndexToUpdate the index of the ShaderAsset in the ShaderCollection where it was found. diff --git a/Gems/Atom/RPI/Code/Source/RPI.Builders/Material/MaterialBuilder.cpp b/Gems/Atom/RPI/Code/Source/RPI.Builders/Material/MaterialBuilder.cpp index 3aa8728e08..6e50e58dd3 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Builders/Material/MaterialBuilder.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Builders/Material/MaterialBuilder.cpp @@ -52,7 +52,7 @@ namespace AZ { AssetBuilderSDK::AssetBuilderDesc materialBuilderDescriptor; materialBuilderDescriptor.m_name = JobKey; - materialBuilderDescriptor.m_version = 112; // material dependency improvements + materialBuilderDescriptor.m_version = 113; // material dependency improvements materialBuilderDescriptor.m_patterns.push_back(AssetBuilderSDK::AssetBuilderPattern("*.material", AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard)); materialBuilderDescriptor.m_patterns.push_back(AssetBuilderSDK::AssetBuilderPattern("*.materialtype", AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard)); materialBuilderDescriptor.m_busId = azrtti_typeid(); @@ -95,7 +95,7 @@ namespace AZ const bool currentFileIsMaterial = AzFramework::StringFunc::Path::IsExtension(currentFilePath.c_str(), MaterialSourceData::Extension); const bool referencedFileIsMaterialType = AzFramework::StringFunc::Path::IsExtension(referencedParentPath.c_str(), MaterialTypeSourceData::Extension); - const bool ShouldFinalizeMaterialAssets = MaterialUtils::BuildersShouldFinalizeMaterialAssets(); + const bool shouldFinalizeMaterialAssets = MaterialUtils::BuildersShouldFinalizeMaterialAssets(); AZStd::vector possibleDependencies = RPI::AssetUtils::GetPossibleDepenencyPaths(currentFilePath, referencedParentPath); for (auto& file : possibleDependencies) @@ -118,7 +118,7 @@ namespace AZ // If we aren't finalizing material assets, then a normal job dependency isn't needed because the MaterialTypeAsset data won't be used. // However, we do still need at least an OrderOnce dependency to ensure the Asset Processor knows about the material type asset so the builder can get it's AssetId. // This can significantly reduce AP processing time when a material type or its shaders are edited. - if (currentFileIsMaterial && referencedFileIsMaterialType && !ShouldFinalizeMaterialAssets) + if (currentFileIsMaterial && referencedFileIsMaterialType && !shouldFinalizeMaterialAssets) { jobDependency.m_type = AssetBuilderSDK::JobDependencyType::OrderOnce; } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MaterialAssetBuilderComponent.cpp b/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MaterialAssetBuilderComponent.cpp index 6f71fb70d4..1cc1925564 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MaterialAssetBuilderComponent.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MaterialAssetBuilderComponent.cpp @@ -127,7 +127,7 @@ namespace AZ if (auto* serialize = azrtti_cast(context)) { serialize->Class() - ->Version(18); // material dependency improvements + ->Version(19); // material dependency improvements } } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAssetCreatorCommon.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAssetCreatorCommon.cpp deleted file mode 100644 index 4b2f163f7c..0000000000 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAssetCreatorCommon.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#include -#include - -namespace AZ -{ - namespace RPI - { - void MaterialAssetCreatorCommon::OnBegin( - const MaterialPropertiesLayout* propertyLayout, - AZStd::vector* propertyValues, - const AZStd::function& warningFunc, - const AZStd::function& errorFunc) - { - m_propertyLayout = propertyLayout; - m_propertyValues = propertyValues; - m_reportWarning = warningFunc; - m_reportError = errorFunc; - } - - void MaterialAssetCreatorCommon::OnEnd() - { - m_propertyLayout = nullptr; - m_propertyValues = nullptr; - m_reportWarning = nullptr; - m_reportError = nullptr; - } - - bool MaterialAssetCreatorCommon::PropertyCheck(TypeId typeId, const Name& name) - { - if (!m_reportWarning || !m_reportError) - { - AZ_Assert(false, "Call Begin() on the AssetCreator before using it."); - return false; - } - - MaterialPropertyIndex propertyIndex = m_propertyLayout->FindPropertyIndex(name); - if (!propertyIndex.IsValid()) - { - m_reportWarning( - AZStd::string::format("Material property '%s' not found", - name.GetCStr() - ).data()); - return false; - } - - const MaterialPropertyDescriptor* materialPropertyDescriptor = m_propertyLayout->GetPropertyDescriptor(propertyIndex); - if (!materialPropertyDescriptor) - { - m_reportError("A material property index was found but the property descriptor was null"); - return false; - } - - if (!ValidateMaterialPropertyDataType(typeId, name, materialPropertyDescriptor, m_reportError)) - { - return false; - } - - return true; - } - - void MaterialAssetCreatorCommon::SetPropertyValue(const Name& name, const Data::Asset& imageAsset) - { - return SetPropertyValue(name, MaterialPropertyValue(imageAsset)); - } - - void MaterialAssetCreatorCommon::SetPropertyValue(const Name& name, const MaterialPropertyValue& value) - { - if (PropertyCheck(value.GetTypeId(), name)) - { - MaterialPropertyIndex propertyIndex = m_propertyLayout->FindPropertyIndex(name); - (*m_propertyValues)[propertyIndex.GetIndex()] = value; - } - } - - void MaterialAssetCreatorCommon::SetPropertyValue(const Name& name, const Data::Asset& imageAsset) - { - SetPropertyValue(name, Data::Asset(imageAsset)); - } - - void MaterialAssetCreatorCommon::SetPropertyValue(const Name& name, const Data::Asset& imageAsset) - { - SetPropertyValue(name, Data::Asset(imageAsset)); - } - } // namespace RPI -} // namespace AZ diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialTypeAssetCreator.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialTypeAssetCreator.cpp index dd023c56b8..6746b57740 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialTypeAssetCreator.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialTypeAssetCreator.cpp @@ -22,17 +22,6 @@ namespace AZ { m_materialPropertiesLayout = aznew MaterialPropertiesLayout; m_asset->m_materialPropertiesLayout = m_materialPropertiesLayout; - - auto warningFunc = [this](const char* message) - { - ReportWarning("%s", message); - }; - auto errorFunc = [this](const char* message) - { - ReportError("%s", message); - }; - // Set empty for UV names as material type asset doesn't have overrides. - MaterialAssetCreatorCommon::OnBegin(m_materialPropertiesLayout, &(m_asset->m_propertyValues), warningFunc, errorFunc); } } @@ -48,8 +37,6 @@ namespace AZ m_materialShaderResourceGroupLayout = nullptr; m_materialPropertiesLayout = nullptr; - MaterialAssetCreatorCommon::OnEnd(); - return EndCommon(result); } @@ -499,6 +486,54 @@ namespace AZ m_wipMaterialProperty = MaterialPropertyDescriptor{}; } + + bool MaterialTypeAssetCreator::PropertyCheck(TypeId typeId, const Name& name) + { + MaterialPropertyIndex propertyIndex = m_materialPropertiesLayout->FindPropertyIndex(name); + if (!propertyIndex.IsValid()) + { + ReportWarning("Material property '%s' not found", name.GetCStr()); + return false; + } + + const MaterialPropertyDescriptor* materialPropertyDescriptor = m_materialPropertiesLayout->GetPropertyDescriptor(propertyIndex); + if (!materialPropertyDescriptor) + { + ReportError("A material property index was found but the property descriptor was null"); + return false; + } + + if (!ValidateMaterialPropertyDataType(typeId, name, materialPropertyDescriptor, [this](const char* message){ReportError("%s", message);})) + { + return false; + } + + return true; + } + + void MaterialTypeAssetCreator::SetPropertyValue(const Name& name, const Data::Asset& imageAsset) + { + return SetPropertyValue(name, MaterialPropertyValue(imageAsset)); + } + + void MaterialTypeAssetCreator::SetPropertyValue(const Name& name, const MaterialPropertyValue& value) + { + if (PropertyCheck(value.GetTypeId(), name)) + { + MaterialPropertyIndex propertyIndex = m_materialPropertiesLayout->FindPropertyIndex(name); + m_asset->m_propertyValues[propertyIndex.GetIndex()] = value; + } + } + + void MaterialTypeAssetCreator::SetPropertyValue(const Name& name, const Data::Asset& imageAsset) + { + SetPropertyValue(name, Data::Asset(imageAsset)); + } + + void MaterialTypeAssetCreator::SetPropertyValue(const Name& name, const Data::Asset& imageAsset) + { + SetPropertyValue(name, Data::Asset(imageAsset)); + } void MaterialTypeAssetCreator::AddMaterialFunctor(const Ptr& functor) { diff --git a/Gems/Atom/RPI/Code/atom_rpi_reflect_files.cmake b/Gems/Atom/RPI/Code/atom_rpi_reflect_files.cmake index df8f389c37..6e9cdfeb4e 100644 --- a/Gems/Atom/RPI/Code/atom_rpi_reflect_files.cmake +++ b/Gems/Atom/RPI/Code/atom_rpi_reflect_files.cmake @@ -51,7 +51,6 @@ set(FILES Include/Atom/RPI.Reflect/Image/StreamingImagePoolAssetCreator.h Include/Atom/RPI.Reflect/Material/LuaMaterialFunctor.h Include/Atom/RPI.Reflect/Material/MaterialAsset.h - Include/Atom/RPI.Reflect/Material/MaterialAssetCreatorCommon.h Include/Atom/RPI.Reflect/Material/MaterialAssetCreator.h Include/Atom/RPI.Reflect/Material/MaterialDynamicMetadata.h Include/Atom/RPI.Reflect/Material/MaterialPropertyDescriptor.h @@ -133,7 +132,6 @@ set(FILES Source/RPI.Reflect/Image/StreamingImagePoolAssetCreator.cpp Source/RPI.Reflect/Material/MaterialPropertyValue.cpp Source/RPI.Reflect/Material/MaterialAsset.cpp - Source/RPI.Reflect/Material/MaterialAssetCreatorCommon.cpp Source/RPI.Reflect/Material/MaterialAssetCreator.cpp Source/RPI.Reflect/Material/LuaMaterialFunctor.cpp Source/RPI.Reflect/Material/MaterialDynamicMetadata.cpp From 8084775d7adf384f96672e69fa227c81156e9262 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Thu, 13 Jan 2022 12:49:35 -0800 Subject: [PATCH 525/948] Updating code comments. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../Atom/RPI.Reflect/Material/MaterialAsset.h | 13 ++++++++++--- .../Source/RPI.Edit/Material/MaterialSourceData.cpp | 3 +++ .../Source/RPI.Reflect/Material/MaterialAsset.cpp | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAsset.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAsset.h index 4cc6608225..2a6c89a8fa 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAsset.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAsset.h @@ -34,8 +34,6 @@ namespace AZ class MaterialAssetHandler; //! MaterialAsset defines a single material, which can be used to create a Material instance for rendering at runtime. - //! It fetches MaterialTypeSourceData from the MaterialTypeAsset it owned. - //! //! Use a MaterialAssetCreator to create a MaterialAsset. class MaterialAsset : public AZ::Data::AssetData @@ -46,7 +44,6 @@ namespace AZ friend class MaterialVersionUpdate; friend class MaterialAssetCreator; friend class MaterialAssetHandler; - friend class MaterialAssetCreatorCommon; friend class UnitTest::MaterialTests; friend class UnitTest::MaterialAssetTests; @@ -117,8 +114,18 @@ namespace AZ //! //! Note that even though material source data files contain only override values and inherit the rest from //! their parent material, they all get flattened at build time so every MaterialAsset has the full set of values. + //! + //! Calling GetPropertyValues() will automatically finalize the material asset if it isn't finalized already. The + //! MaterialTypeAsset must be loaded and ready. const AZStd::vector& GetPropertyValues() const; + //! Returns the list of raw values for all properties in this material, as listed in the source .material file(s), before the material asset was Finalized. + //! + //! The MaterialAsset can be created in a "half-baked" state (see MaterialUtils::BuildersShouldFinalizeMaterialAssets) where + //! minimal processing has been done because it did not yet have access to the MaterialTypeAsset. In that case, the list will + //! be populated with values copied from the source .material file with little or no validation or other processing. It includes + //! all parent .material files, with properties listed in low-to-high priority order. + //! This list will be empty however if the asset was finalized at build-time. const AZStd::vector>& GetRawPropertyValues() const; private: diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp index 23657f4871..bc764ec7fb 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp @@ -312,6 +312,9 @@ namespace AZ { materialAssetCreator.ReportWarning("Source data for material property value is invalid."); } + // If the source value type is a string, there are two possible property types: Image and Enum. If there is a "." in + // the string (for the extension) we assume it's an Image and look up the referenced Asset. Otherwise, we can assume + // it's an Enum value and just preserve the original string. else if (property.second.m_value.Is() && AzFramework::StringFunc::Contains(property.second.m_value.GetValue(), ".")) { Data::Asset imageAsset; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp index ce5847d12f..a40fa77019 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp @@ -304,7 +304,7 @@ namespace AZ m_materialTypeAsset = newMaterialTypeAsset; // If the material asset was not finalized on disk, then we clear the previously finalized property values to force re-finalize. - // This + // This is necessary in case the property layout changed in some way. if (!m_wasPreFinalized) { m_isFinalized = false; From 2d6d14abf72d3db6fba0ab225e83bc23fb7e34ba Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Fri, 14 Jan 2022 10:49:17 -0800 Subject: [PATCH 526/948] Changed MaterialAsset::GetPropertyValues to not auto-finalize. Client code must call Finalize manually. It's better to avoid unexpected side-effects from a const getter function. In some cases it may be acceptable to do non-const things in a const function as long as it is only manipulating internal data, and the public facing API returns the same values as before. But in this case, the IsFinalized function is a public facing API that would have a different result after GetPropertyValues was called. I also updated a couple other minor things from code review feedback. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../RPI.Edit/Material/MaterialSourceData.h | 2 +- .../Atom/RPI.Reflect/Material/MaterialAsset.h | 11 ++++---- .../RPI.Builders/Material/MaterialBuilder.cpp | 2 +- .../Model/MaterialAssetBuilderComponent.cpp | 5 ++-- .../Source/RPI.Public/Material/Material.cpp | 2 ++ .../RPI.Reflect/Material/MaterialAsset.cpp | 5 +--- .../Tests/Material/MaterialAssetTests.cpp | 6 ++-- .../Material/MaterialSourceDataTests.cpp | 28 +++++++++++-------- 8 files changed, 34 insertions(+), 27 deletions(-) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialSourceData.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialSourceData.h index a5fb0214e6..0a9371f722 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialSourceData.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialSourceData.h @@ -33,7 +33,7 @@ namespace AZ class MaterialAsset; class MaterialAssetCreator; - enum MaterialAssetProcessingMode + enum class MaterialAssetProcessingMode { PreBake, //!< all material asset processing is done in the Asset Processor, producing a finalized material asset DeferredBake //!< some material asset processing is deferred, and the material asset is finalized at runtime after loading diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAsset.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAsset.h index 2a6c89a8fa..941fcd0fe9 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAsset.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAsset.h @@ -107,6 +107,11 @@ namespace AZ //! If false, property values can be accessed through GetRawPropertyValues(). bool IsFinalized() const; + //! If the material asset is not finalized yet, this does the final processing of the raw property values to + //! get the material asset ready to be used. + //! Note the MaterialTypeAsset must be valid before this is called. + void Finalize(AZStd::function reportWarning = nullptr, AZStd::function reportError = nullptr); + //! Returns the list of values for all properties in this material. //! The entries in this list align with the entries in the MaterialPropertiesLayout. Each AZStd::any is guaranteed //! to have a value of type that matches the corresponding MaterialPropertyDescriptor. @@ -131,12 +136,6 @@ namespace AZ private: bool PostLoadInit() override; - //! If the material asset is not finalized yet, this does the final processing of m_rawPropertyValues to - //! get the material asset ready to be used. - //! Note m_materialTypeAsset must be valid before this is called. - //! @param elevateWarnings Indicates whether to treat warnings as errors - void Finalize(AZStd::function reportWarning = nullptr, AZStd::function reportError = nullptr); - //! Checks the material type version and potentially applies a series of property changes (most common are simple property renames) //! based on the MaterialTypeAsset's version update procedure. void ApplyVersionUpdates(); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Builders/Material/MaterialBuilder.cpp b/Gems/Atom/RPI/Code/Source/RPI.Builders/Material/MaterialBuilder.cpp index 6e50e58dd3..cedbb1df6e 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Builders/Material/MaterialBuilder.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Builders/Material/MaterialBuilder.cpp @@ -52,7 +52,7 @@ namespace AZ { AssetBuilderSDK::AssetBuilderDesc materialBuilderDescriptor; materialBuilderDescriptor.m_name = JobKey; - materialBuilderDescriptor.m_version = 113; // material dependency improvements + materialBuilderDescriptor.m_version = 114; // material dependency improvements materialBuilderDescriptor.m_patterns.push_back(AssetBuilderSDK::AssetBuilderPattern("*.material", AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard)); materialBuilderDescriptor.m_patterns.push_back(AssetBuilderSDK::AssetBuilderPattern("*.materialtype", AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard)); materialBuilderDescriptor.m_busId = azrtti_typeid(); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MaterialAssetBuilderComponent.cpp b/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MaterialAssetBuilderComponent.cpp index 1cc1925564..a44b47ee6c 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MaterialAssetBuilderComponent.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MaterialAssetBuilderComponent.cpp @@ -45,7 +45,8 @@ namespace AZ if (auto* serialize = azrtti_cast(context)) { serialize->Class() - ->Version(5) // <<<<< This probably is NOT the version number you want to bump. What you're looking for is MaterialAssetBuilderComponent::Reflect below + ->Version(5) // <<<<< If you have made changes to material code and need to force scene files to be reprocessed, this probably is + // NOT the version number you want to bump . What you're looking for is MaterialAssetBuilderComponent::Reflect below. ->Attribute(Edit::Attributes::SystemComponentTags, AZStd::vector({ AssetBuilderSDK::ComponentTags::AssetBuilder })); } } @@ -127,7 +128,7 @@ namespace AZ if (auto* serialize = azrtti_cast(context)) { serialize->Class() - ->Version(19); // material dependency improvements + ->Version(20); // material dependency improvements } } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Material/Material.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Material/Material.cpp index 1f739c24f1..fe9dbef278 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Material/Material.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Material/Material.cpp @@ -62,6 +62,8 @@ namespace AZ m_materialAsset = { &materialAsset, AZ::Data::AssetLoadBehavior::PreLoad }; + m_materialAsset->Finalize(); + // Cache off pointers to some key data structures from the material type... auto srgLayout = m_materialAsset->GetMaterialSrgLayout(); if (srgLayout) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp index a40fa77019..569e2de81a 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp @@ -199,10 +199,7 @@ namespace AZ const AZStd::vector& MaterialAsset::GetPropertyValues() const { - // This can't be done in MaterialAssetHandler::LoadAssetData because the MaterialTypeAsset isn't necessarily loaded at that point. - // And it can't be done in PostLoadInit() because that happens on the next frame which might be too late. So we finalize just-in-time - // when properties are accessed. - const_cast(this)->Finalize(); + AZ_Error(s_debugTraceName, IsFinalized(), "MaterialAsset must be finalized before its property values can be accessed"); return m_propertyValues; } diff --git a/Gems/Atom/RPI/Code/Tests/Material/MaterialAssetTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/MaterialAssetTests.cpp index 633953cecc..fdb131d449 100644 --- a/Gems/Atom/RPI/Code/Tests/Material/MaterialAssetTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Material/MaterialAssetTests.cpp @@ -266,6 +266,10 @@ namespace UnitTest warningFinder.AddExpectedErrorMessage("Automatic updates are available. Consider updating the .material source file"); warningFinder.AddExpectedErrorMessage("This material is based on version '1'"); warningFinder.AddExpectedErrorMessage("material type is now at version '2'"); + + materialAsset->Finalize(); + + warningFinder.CheckExpectedErrorsFound(); // Even though this material was created using the old version of the material type, it's property values should get automatically // updated to align with the new property layout in the latest MaterialTypeAsset. @@ -273,8 +277,6 @@ namespace UnitTest EXPECT_EQ(2, myIntIndex.GetIndex()); EXPECT_EQ(7, materialAsset->GetPropertyValues()[myIntIndex.GetIndex()].GetValue()); - warningFinder.CheckExpectedErrorsFound(); - // Since the MaterialAsset has already been updated, and the warning reported once, we should not see the "consider updating" // warning reported again on subsequent property accesses. warningFinder.Reset(); diff --git a/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp index e4d3cc9768..29f0e7d101 100644 --- a/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp @@ -228,8 +228,13 @@ namespace UnitTest Data::Asset materialAsset = materialAssetOutcome.GetValue(); + ErrorMessageFinder expectNotFinalizedError("MaterialAsset must be finalized"); + EXPECT_FALSE(materialAsset->IsFinalized()); - // Note we avoid calling GetPropertyValues() because that will auto-finalize the material. We want to check its raw property values first. + + expectNotFinalizedError.ResetCounts(); + EXPECT_TRUE(materialAsset->GetPropertyValues().empty()); + expectNotFinalizedError.CheckExpectedErrorsFound(); auto findRawPropertyValue = [materialAsset](const char* propertyId) { @@ -275,12 +280,14 @@ namespace UnitTest tester.SerializeOut(materialAsset.Get()); materialAsset = tester.SerializeIn(Uuid::CreateRandom(), ObjectStream::FilterDescriptor{AZ::Data::AssetFilterNoAssetLoading}); - // We check the raw property values again on the loaded data, showing that the same data is available in the original un-finalized state. + // We check that everything is still in the original un-finalized state after going through the serialization process. + EXPECT_FALSE(materialAsset->IsFinalized()); checkRawPropertyValues(); + expectNotFinalizedError.ResetCounts(); + EXPECT_TRUE(materialAsset->GetPropertyValues().empty()); + expectNotFinalizedError.CheckExpectedErrorsFound(); - // The material will automatically finalize itself when the properties are accessed. - EXPECT_FALSE(materialAsset->IsFinalized()); - materialAsset->GetPropertyValues(); + materialAsset->Finalize(); EXPECT_TRUE(materialAsset->IsFinalized()); // Now all the property values should be available through the main GetPropertyValues() API. @@ -295,6 +302,8 @@ namespace UnitTest EXPECT_EQ(materialAsset->GetPropertyValues()[8].GetValue>(), m_testImageAsset); EXPECT_EQ(materialAsset->GetPropertyValues()[9].GetValue(), 1u); + // The raw property values are still available (because they are needed if a hot-reload of the MaterialTypeAsset occurs) + checkRawPropertyValues(); } void CheckEqual(MaterialSourceData& a, MaterialSourceData& b) @@ -757,8 +766,9 @@ namespace UnitTest tester.SerializeOut(materialAssetLevel3.Get()); materialAssetLevel3 = tester.SerializeIn(Uuid::CreateRandom(), ObjectStream::FilterDescriptor{AZ::Data::AssetFilterNoAssetLoading}); - - // The properties will finalize automatically when we call GetPropertyValues()... + materialAssetLevel1->Finalize(); + materialAssetLevel2->Finalize(); + materialAssetLevel3->Finalize(); AZStd::array_view properties; @@ -779,10 +789,6 @@ namespace UnitTest EXPECT_EQ(properties[myFloat.GetIndex()].GetValue(), 3.5f); EXPECT_EQ(properties[myFloat2.GetIndex()].GetValue(), Vector2(4.1f, 4.2f)); EXPECT_EQ(properties[myColor.GetIndex()].GetValue(), Color(0.15f, 0.25f, 0.35f, 0.45f)); - - EXPECT_TRUE(materialAssetLevel1->IsFinalized()); - EXPECT_TRUE(materialAssetLevel2->IsFinalized()); - EXPECT_TRUE(materialAssetLevel3->IsFinalized()); } TEST_F(MaterialSourceDataTests, CreateMaterialAsset_MultiLevelDataInheritance_Error_MaterialTypesDontMatch) From c24546a85d1ba0d190fac9e424e9e9b87a9fe6a5 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Fri, 14 Jan 2022 10:57:03 -0800 Subject: [PATCH 527/948] Fixed unused variable warning. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp index 569e2de81a..310c10c39b 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp @@ -123,7 +123,7 @@ namespace AZ if (!reportWarning) { - reportWarning = [](const char* message) + reportWarning = []([[maybe_unused]] const char* message) { AZ_Warning(s_debugTraceName, false, "%s", message); }; From 5c2e69d6d07b76f3fbc19d83a66ccab56f49854c Mon Sep 17 00:00:00 2001 From: Guthrie Adams Date: Tue, 18 Jan 2022 12:36:49 -0600 Subject: [PATCH 528/948] Atom Tools: move asset processor connection to fix thumbnails Thumbnails for the AtomLyIntegration common feature gem were no longer being rendered. The setup code was modified to initialize the thumbnail system after receiving a new event that critical assets finished compiling. This event was being sent and handled correctly in the main editor. This process was failing in other tools because the event was sent before systems were registered to listen for it. To resolve the problem, atom tools application now explicitly connects to the asset processor and processes critical assets after the base application StartCommon function is called. This ensures that the connection is established and the event gets sent after all of the system components have been activated. Signed-off-by: Guthrie Adams --- .../Application/AtomToolsApplication.h | 8 +------- .../Source/Application/AtomToolsApplication.cpp | 13 +++++++------ 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Application/AtomToolsApplication.h b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Application/AtomToolsApplication.h index 9eaacbfa4f..9449c62de1 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Application/AtomToolsApplication.h +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Application/AtomToolsApplication.h @@ -16,7 +16,6 @@ #include #include -#include #include #include @@ -34,7 +33,6 @@ namespace AtomToolsFramework : public AzFramework::Application , public AzQtComponents::AzQtApplication , protected AzToolsFramework::AssetDatabase::AssetDatabaseRequestsBus::Handler - , protected AzFramework::AssetSystemStatusBus::Handler , protected AzToolsFramework::EditorPythonConsoleNotificationBus::Handler , protected AZ::UserSettingsOwnerRequestBus::Handler , protected AtomToolsMainWindowNotificationBus::Handler @@ -77,11 +75,6 @@ namespace AtomToolsFramework void Destroy() override; ////////////////////////////////////////////////////////////////////////// - ////////////////////////////////////////////////////////////////////////// - // AzFramework::AssetSystemStatusBus::Handler overrides... - void AssetSystemAvailable() override; - ////////////////////////////////////////////////////////////////////////// - ////////////////////////////////////////////////////////////////////////// // AZ::ComponentApplication overrides... void QueryApplicationType(AZ::ApplicationTypeQuery& appType) const override; @@ -107,6 +100,7 @@ namespace AtomToolsFramework virtual void LoadSettings(); virtual void UnloadSettings(); + virtual void ConnectToAssetProcessor(); virtual void CompileCriticalAssets(); virtual void ProcessCommandLine(const AZ::CommandLine& commandLine); diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Application/AtomToolsApplication.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Application/AtomToolsApplication.cpp index 02248fffd4..791738a06e 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Application/AtomToolsApplication.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Application/AtomToolsApplication.cpp @@ -171,7 +171,6 @@ namespace AtomToolsFramework void AtomToolsApplication::StartCommon(AZ::Entity* systemEntity) { - AzFramework::AssetSystemStatusBus::Handler::BusConnect(); AzToolsFramework::EditorPythonConsoleNotificationBus::Handler::BusConnect(); Base::StartCommon(systemEntity); @@ -179,6 +178,8 @@ namespace AtomToolsFramework const bool clearLogFile = GetSettingOrDefault("/O3DE/AtomToolsFramework/Application/ClearLogOnStart", false); m_traceLogger.OpenLogFile(GetBuildTargetName() + ".log", clearLogFile); + ConnectToAssetProcessor(); + AzToolsFramework::AssetDatabase::AssetDatabaseRequestsBus::Handler::BusConnect(); AzToolsFramework::AssetBrowser::AssetDatabaseLocationNotificationBus::Broadcast( &AzToolsFramework::AssetBrowser::AssetDatabaseLocationNotifications::OnDatabaseInitialized); @@ -236,7 +237,7 @@ namespace AtomToolsFramework return AZStd::vector({}); } - void AtomToolsApplication::AssetSystemAvailable() + void AtomToolsApplication::ConnectToAssetProcessor() { bool connectedToAssetProcessor = false; @@ -245,18 +246,19 @@ namespace AtomToolsFramework // and able to negotiate a connection when running a debug build // and to negotiate a connection - auto targetName = GetBuildTargetName(); + const auto targetName = GetBuildTargetName(); AzFramework::AssetSystem::ConnectionSettings connectionSettings; AzFramework::AssetSystem::ReadConnectionSettingsFromSettingsRegistry(connectionSettings); connectionSettings.m_connectionDirection = AzFramework::AssetSystem::ConnectionSettings::ConnectionDirection::ConnectToAssetProcessor; - connectionSettings.m_connectionIdentifier = GetBuildTargetName(); + connectionSettings.m_connectionIdentifier = targetName; connectionSettings.m_loggingCallback = [targetName]([[maybe_unused]] AZStd::string_view logData) { AZ_UNUSED(targetName); // Prevent unused warning in release builds AZ_TracePrintf(targetName.c_str(), "%.*s", aznumeric_cast(logData.size()), logData.data()); }; + AzFramework::AssetSystemRequestBus::BroadcastResult( connectedToAssetProcessor, &AzFramework::AssetSystemRequestBus::Events::EstablishAssetProcessorConnection, connectionSettings); @@ -264,8 +266,6 @@ namespace AtomToolsFramework { CompileCriticalAssets(); } - - AzFramework::AssetSystemStatusBus::Handler::BusDisconnect(); } void AtomToolsApplication::CompileCriticalAssets() @@ -302,6 +302,7 @@ namespace AtomToolsFramework } AZ::ComponentApplicationLifecycle::SignalEvent(*m_settingsRegistry, "CriticalAssetsCompiled", R"({})"); + // Reload the assetcatalog.xml at this point again // Start Monitoring Asset changes over the network and load the AssetCatalog auto LoadCatalog = [settingsRegistry = m_settingsRegistry.get()](AZ::Data::AssetCatalogRequests* assetCatalogRequests) From 4af918a4a8895c553fe08264b96e05a1b65f3d28 Mon Sep 17 00:00:00 2001 From: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> Date: Tue, 18 Jan 2022 13:50:14 -0600 Subject: [PATCH 529/948] Skipping ShapeIntersectionFilter test (#6975) Signed-off-by: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> --- .../PythonTests/largeworlds/dyn_veg/TestSuite_Main_Optimized.py | 1 + 1 file changed, 1 insertion(+) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Main_Optimized.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Main_Optimized.py index 5b1e504442..af1c187817 100644 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Main_Optimized.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Main_Optimized.py @@ -131,6 +131,7 @@ class TestAutomation_PrefabNotEnabled(EditorTestSuite): class test_ShapeIntersectionFilter_InstancesPlantInAssignedShape(EditorParallelTest): from .EditorScripts import ShapeIntersectionFilter_InstancesPlantInAssignedShape as test_module + @pytest.mark.skip("https://github.com/o3de/o3de/issues/6973") class test_ShapeIntersectionFilter_FilterStageToggle(EditorParallelTest): from .EditorScripts import ShapeIntersectionFilter_FilterStageToggle as test_module From 2627b507d3081bf38248389b475e89e4192f0fd4 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Tue, 18 Jan 2022 12:01:19 -0800 Subject: [PATCH 530/948] Fixed unused variable warning Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp index 310c10c39b..0325c3ac38 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp @@ -131,7 +131,7 @@ namespace AZ if (!reportError) { - reportError = [](const char* message) + reportError = []([[maybe_unused]] const char* message) { AZ_Error(s_debugTraceName, false, "%s", message); }; From d9e636f77edf24f32985c48f7ecf638b53c90be0 Mon Sep 17 00:00:00 2001 From: AMZN-byrcolin <68035668+byrcolin@users.noreply.github.com> Date: Tue, 18 Jan 2022 12:12:55 -0800 Subject: [PATCH 531/948] fix edge case with deprecated pal functions (#6976) * fix edge case with deprecated pal functions Signed-off-by: byrcolin --- cmake/PAL.cmake | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/cmake/PAL.cmake b/cmake/PAL.cmake index ef431ff92a..0359408200 100644 --- a/cmake/PAL.cmake +++ b/cmake/PAL.cmake @@ -298,21 +298,27 @@ function(ly_get_absolute_pal_filename out_name in_name) # parent relative path is optional if(${ARGC} GREATER 4) - set(parent_relative_path ${ARGV4}) + if(ARGV4) + set(parent_relative_path ${ARGV4}) + endif() endif() # The Default object path for path is the LY_ROOT_FOLDER cmake_path(SET object_path NORMALIZE "${LY_ROOT_FOLDER}") if(${ARGC} GREATER 3) - # The user has supplied an object restricted path, the object path for consideration - cmake_path(SET object_path NORMALIZE ${ARGV3}) + if(ARGV3) + # The user has supplied an object restricted path, the object path for consideration + cmake_path(SET object_path NORMALIZE ${ARGV3}) + endif() endif() # The default restricted object path is O3DE_ENGINE_RESTRICTED_PATH cmake_path(SET object_restricted_path NORMALIZE "${O3DE_ENGINE_RESTRICTED_PATH}") if(${ARGC} GREATER 2) - # The user has supplied an object restricted path - cmake_path(SET object_restricted_path NORMALIZE ${ARGV2}) + if(ARGV3) + # The user has supplied an object restricted path + cmake_path(SET object_restricted_path NORMALIZE ${ARGV2}) + endif() endif() if(${ARGC} GREATER 4) @@ -394,27 +400,33 @@ function(ly_get_list_relative_pal_filename out_name in_name) # parent relative path is optional if(${ARGC} GREATER 4) - set(parent_relative_path ${ARGV4}) + if(ARGV4) + set(parent_relative_path ${ARGV4}) + endif() endif() # The Default object path for path is the LY_ROOT_FOLDER cmake_path(SET object_path NORMALIZE "${LY_ROOT_FOLDER}") if(${ARGC} GREATER 3) - # The user has supplied an object restricted path, the object path for consideration - cmake_path(SET object_path NORMALIZE ${ARGV3}) + if(ARGV3) + # The user has supplied an object restricted path, the object path for consideration + cmake_path(SET object_path NORMALIZE ${ARGV3}) + endif() endif() # The default restricted object path is O3DE_ENGINE_RESTRICTED_PATH cmake_path(SET object_restricted_path NORMALIZE "${O3DE_ENGINE_RESTRICTED_PATH}") if(${ARGC} GREATER 2) - # The user has supplied an object restricted path - cmake_path(SET object_restricted_path NORMALIZE ${ARGV2}) + if(ARGV2) + # The user has supplied an object restricted path + cmake_path(SET object_restricted_path NORMALIZE ${ARGV2}) + endif() endif() if(${ARGC} GREATER 4) - o3de_pal_dir(abs_name ${in_name} ${object_restricted_path} ${object_path} ${parent_relative_path}) + o3de_pal_dir(abs_name ${in_name} "${object_restricted_path}" "${object_path}" "${parent_relative_path}") else() - o3de_pal_dir(abs_name ${in_name} ${object_restricted_path} ${object_path}) + o3de_pal_dir(abs_name ${in_name} "${object_restricted_path}" "${object_path}") endif() cmake_path(RELATIVE_PATH abs_name BASE_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} OUTPUT_VARIABLE relative_name) From 3a3aa205451a41fc4e0ff3761cd98492d25688fa Mon Sep 17 00:00:00 2001 From: Scott Romero <24445312+AMZN-ScottR@users.noreply.github.com> Date: Tue, 18 Jan 2022 12:38:08 -0800 Subject: [PATCH 532/948] [development] added required runtime dependency Gem::PhysX.Editor to WhiteBox.Editor.Physics.Tests (#6871) Signed-off-by: AMZN-ScottR <24445312+AMZN-ScottR@users.noreply.github.com> --- Gems/WhiteBox/Code/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Gems/WhiteBox/Code/CMakeLists.txt b/Gems/WhiteBox/Code/CMakeLists.txt index 91536503ac..1a37a1ce34 100644 --- a/Gems/WhiteBox/Code/CMakeLists.txt +++ b/Gems/WhiteBox/Code/CMakeLists.txt @@ -198,6 +198,8 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) AZ::AzTestShared AZ::AzManipulatorTestFramework.Static Gem::WhiteBox.Editor.Static + RUNTIME_DEPENDENCIES + Gem::PhysX.Editor ) ly_add_googletest( From 4b9e53e623856b852720c7c22e14d5bcd237b183 Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Tue, 18 Jan 2022 15:05:17 -0600 Subject: [PATCH 533/948] Another batch of GetValues() overrides. (#6915) * Another batch of GetValues() overrides. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Added missing headers. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Addressed PR feedback. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- .../Components/MixedGradientComponent.h | 29 ++++++ .../Components/PosterizeGradientComponent.h | 34 +++++++ .../Components/ReferenceGradientComponent.h | 1 + .../Components/SmoothStepGradientComponent.h | 1 + .../SurfaceAltitudeGradientComponent.h | 19 +++- .../Components/SurfaceMaskGradientComponent.h | 16 ++++ .../SurfaceSlopeGradientComponent.h | 33 +++++++ .../Components/ThresholdGradientComponent.h | 1 + .../Include/GradientSignal/GradientSampler.h | 2 +- .../Code/Include/GradientSignal/SmoothStep.h | 38 ++++++-- .../Components/MixedGradientComponent.cpp | 94 +++++++++++-------- .../Components/PosterizeGradientComponent.cpp | 42 ++++----- .../Components/ReferenceGradientComponent.cpp | 15 ++- .../SmoothStepGradientComponent.cpp | 16 +++- .../SurfaceAltitudeGradientComponent.cpp | 42 +++++++-- .../SurfaceMaskGradientComponent.cpp | 48 ++++++++-- .../SurfaceSlopeGradientComponent.cpp | 58 +++++++----- .../Components/ThresholdGradientComponent.cpp | 17 +++- 18 files changed, 383 insertions(+), 123 deletions(-) diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/MixedGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/MixedGradientComponent.h index 9c9867cf1e..658118fca4 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/MixedGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/MixedGradientComponent.h @@ -99,6 +99,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; bool IsEntityInHierarchy(const AZ::EntityId& entityId) const override; protected: @@ -110,6 +111,34 @@ namespace GradientSignal MixedGradientLayer* GetLayer(int layerIndex) override; private: + static float PerformMixingOperation(MixedGradientLayer::MixingOperation operation, float prevValue, float currentUnpremultiplied) + { + switch (operation) + { + case MixedGradientLayer::MixingOperation::Initialize: + return currentUnpremultiplied; + case MixedGradientLayer::MixingOperation::Multiply: + return prevValue * currentUnpremultiplied; + case MixedGradientLayer::MixingOperation::Add: + return prevValue + currentUnpremultiplied; + case MixedGradientLayer::MixingOperation::Subtract: + return prevValue - currentUnpremultiplied; + case MixedGradientLayer::MixingOperation::Min: + return AZStd::min(prevValue, currentUnpremultiplied); + case MixedGradientLayer::MixingOperation::Max: + return AZStd::max(prevValue, currentUnpremultiplied); + case MixedGradientLayer::MixingOperation::Average: + return (prevValue + currentUnpremultiplied) / 2.0f; + case MixedGradientLayer::MixingOperation::Normal: + return currentUnpremultiplied; + case MixedGradientLayer::MixingOperation::Overlay: + return (prevValue >= 0.5f) ? (1.0f - (2.0f * (1.0f - prevValue) * (1.0f - currentUnpremultiplied))) + : (2.0f * prevValue * currentUnpremultiplied); + default: + return currentUnpremultiplied; + } + } + MixedGradientConfig m_configuration; LmbrCentral::DependencyMonitor m_dependencyMonitor; }; diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/PosterizeGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/PosterizeGradientComponent.h index 9b0714b449..bff49ac619 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/PosterizeGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/PosterizeGradientComponent.h @@ -73,6 +73,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; bool IsEntityInHierarchy(const AZ::EntityId& entityId) const override; protected: @@ -86,6 +87,39 @@ namespace GradientSignal GradientSampler& GetGradientSampler() override; private: + + static float PosterizeValue(float input, float bands, PosterizeGradientConfig::ModeType mode) + { + const float clampedInput = AZ::GetClamp(input, 0.0f, 1.0f); + float output = 0.0f; + + // "quantize" the input down to a number that goes from 0 to (bands-1) + const float band = AZ::GetMin(floorf(clampedInput * bands), bands - 1.0f); + + // Given our quantized band, produce the right output for that band range. + switch (mode) + { + default: + case PosterizeGradientConfig::ModeType::Floor: + // Floor: the output range should be the lowest value of each band, or (0 to bands-1) / bands + output = (band + 0.0f) / bands; + break; + case PosterizeGradientConfig::ModeType::Round: + // Round: the output range should be the midpoint of each band, or (0.5 to bands-0.5) / bands + output = (band + 0.5f) / bands; + break; + case PosterizeGradientConfig::ModeType::Ceiling: + // Ceiling: the output range should be the highest value of each band, or (1 to bands) / bands + output = (band + 1.0f) / bands; + break; + case PosterizeGradientConfig::ModeType::Ps: + // Ps: the output range should be equally distributed from 0-1, or (0 to bands-1) / (bands-1) + output = band / (bands - 1.0f); + break; + } + return AZ::GetMin(output, 1.0f); + } + PosterizeGradientConfig m_configuration; LmbrCentral::DependencyMonitor m_dependencyMonitor; }; diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ReferenceGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ReferenceGradientComponent.h index bf16b484fc..17c40865b3 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ReferenceGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ReferenceGradientComponent.h @@ -64,6 +64,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; bool IsEntityInHierarchy(const AZ::EntityId& entityId) const override; protected: diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/SmoothStepGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/SmoothStepGradientComponent.h index 85947175af..03f629ab1e 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/SmoothStepGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/SmoothStepGradientComponent.h @@ -71,6 +71,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; bool IsEntityInHierarchy(const AZ::EntityId& entityId) const override; protected: diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceAltitudeGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceAltitudeGradientComponent.h index 6ed841dafb..eb76fac292 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceAltitudeGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceAltitudeGradientComponent.h @@ -15,6 +15,7 @@ #include #include #include +#include namespace LmbrCentral { @@ -89,6 +90,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; protected: ////////////////////////////////////////////////////////////////////////// @@ -105,7 +107,22 @@ namespace GradientSignal void AddTag(AZStd::string tag) override; private: - mutable AZStd::recursive_mutex m_cacheMutex; + static float CalculateAltitudeRatio(const SurfaceData::SurfacePointList& points, float altitudeMin, float altitudeMax) + { + if (points.empty()) + { + return 0.0f; + } + + // GetSurfacePoints (which was used to populate the points list) always returns points in decreasing height order, so the + // first point in the list contains the highest altitude. + const float highestAltitude = points.front().m_position.GetZ(); + + // Turn the absolute altitude value into a 0-1 value by returning the % of the given altitude range that it falls at. + return GetRatio(altitudeMin, altitudeMax, highestAltitude); + } + + mutable AZStd::shared_mutex m_cacheMutex; SurfaceAltitudeGradientConfig m_configuration; LmbrCentral::DependencyMonitor m_dependencyMonitor; AZStd::atomic_bool m_dirty{ false }; diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceMaskGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceMaskGradientComponent.h index f5400719d0..3eafb8c115 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceMaskGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceMaskGradientComponent.h @@ -70,6 +70,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; protected: ////////////////////////////////////////////////////////////////////////// @@ -80,6 +81,21 @@ namespace GradientSignal void AddTag(AZStd::string tag) override; private: + static float GetMaxSurfaceWeight(const SurfaceData::SurfacePointList& points) + { + float result = 0.0f; + + for (const auto& point : points) + { + for (const auto& [maskId, weight] : point.m_masks) + { + result = AZ::GetMax(AZ::GetClamp(weight, 0.0f, 1.0f), result); + } + } + + return result; + } + SurfaceMaskGradientConfig m_configuration; LmbrCentral::DependencyMonitor m_dependencyMonitor; }; diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceSlopeGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceSlopeGradientComponent.h index b6805202f1..b464b6fb0f 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceSlopeGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceSlopeGradientComponent.h @@ -14,6 +14,7 @@ #include #include #include +#include namespace LmbrCentral { @@ -91,6 +92,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; protected: ////////////////////////////////////////////////////////////////////////// @@ -121,6 +123,37 @@ namespace GradientSignal void SetFallOffMidpoint(float midpoint) override; private: + float GetSlopeRatio(const SurfaceData::SurfacePointList& points, float angleMin, float angleMax) const + { + if (points.empty()) + { + return 0.0f; + } + + // Assuming our surface normal vector is actually normalized, we can get the slope + // by just grabbing the Z value. It's the same thing as normal.Dot(AZ::Vector3::CreateAxisZ()). + AZ_Assert( + points.front().m_normal.GetNormalized().IsClose(points.front().m_normal), + "Surface normals are expected to be normalized"); + const float slope = points.front().m_normal.GetZ(); + // Convert slope back to an angle so that we can lerp in "angular space", not "slope value space". + // (We want our 0-1 range to be linear across the range of angles) + const float slopeAngle = acosf(slope); + + switch (m_configuration.m_rampType) + { + case SurfaceSlopeGradientConfig::RampType::SMOOTH_STEP: + return m_configuration.m_smoothStep.GetSmoothedValue(GetRatio(angleMin, angleMax, slopeAngle)); + case SurfaceSlopeGradientConfig::RampType::LINEAR_RAMP_UP: + // For ramp up, linearly interpolate from min to max. + return GetRatio(angleMin, angleMax, slopeAngle); + case SurfaceSlopeGradientConfig::RampType::LINEAR_RAMP_DOWN: + default: + // For ramp down, linearly interpolate from max to min. + return GetRatio(angleMax, angleMin, slopeAngle); + } + } + SurfaceSlopeGradientConfig m_configuration; }; } diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ThresholdGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ThresholdGradientComponent.h index dbf211551c..96bc235ea8 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ThresholdGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ThresholdGradientComponent.h @@ -65,6 +65,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; bool IsEntityInHierarchy(const AZ::EntityId& entityId) const override; protected: diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h b/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h index c9aa7f680c..bf5c8d1ea0 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h @@ -152,7 +152,7 @@ namespace GradientSignal auto ClearOutputValues = [](AZStd::span outValues) { // If we don't have a valid gradient (or it is fully transparent), clear out all the output values. - memset(outValues.data(), 0, outValues.size() * sizeof(float)); + AZStd::fill(outValues.begin(), outValues.end(), 0.0f); }; if (m_opacity <= 0.0f || !m_gradientId.IsValid()) diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/SmoothStep.h b/Gems/GradientSignal/Code/Include/GradientSignal/SmoothStep.h index 0489fa4893..c8fc77ac60 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/SmoothStep.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/SmoothStep.h @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -26,29 +27,46 @@ namespace GradientSignal static void Reflect(AZ::ReflectContext* context); inline float GetSmoothedValue(float inputValue) const; + inline void GetSmoothedValues(AZStd::span inOutValues) const; float m_falloffMidpoint = 0.5f; float m_falloffRange = 0.5f; float m_falloffStrength = 0.25f; + + private: + inline float CalculateSmoothedValue(float min, float max, float valueFalloffStrength, float inputValue) const; }; - inline float SmoothStep::GetSmoothedValue(float inputValue) const + inline float SmoothStep::CalculateSmoothedValue(float min, float max, float valueFalloffStrength, float inputValue) const { - float output = 0.0f; - const float value = AZ::GetClamp(inputValue, 0.0f, 1.0f); - const float valueFalloffStrength = AZ::GetClamp(m_falloffStrength, 0.0f, 1.0f); - - float min = m_falloffMidpoint - m_falloffRange / 2.0f; - float max = m_falloffMidpoint + m_falloffRange / 2.0f; float result1 = GetRatio(min, min + valueFalloffStrength, value); result1 = GetSmoothStep(result1); float result2 = GetRatio(max - valueFalloffStrength, max, value); result2 = GetSmoothStep(result2); - output = result1 * (1.0f - result2); + return result1 * (1.0f - result2); + } + + inline float SmoothStep::GetSmoothedValue(float inputValue) const + { + const float min = m_falloffMidpoint - m_falloffRange / 2.0f; + const float max = m_falloffMidpoint + m_falloffRange / 2.0f; + const float valueFalloffStrength = AZ::GetClamp(m_falloffStrength, 0.0f, 1.0f); + + return CalculateSmoothedValue(min, max, valueFalloffStrength, inputValue); + } + + inline void SmoothStep::GetSmoothedValues(AZStd::span inOutValues) const + { + const float min = m_falloffMidpoint - m_falloffRange / 2.0f; + const float max = m_falloffMidpoint + m_falloffRange / 2.0f; + const float valueFalloffStrength = AZ::GetClamp(m_falloffStrength, 0.0f, 1.0f); - return output; + for (auto& inOutValue : inOutValues) + { + inOutValue = CalculateSmoothedValue(min, max, valueFalloffStrength, inOutValue); + } } -} +} // namespace GradientSignal diff --git a/Gems/GradientSignal/Code/Source/Components/MixedGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/MixedGradientComponent.cpp index e042188f8a..23bdd379fe 100644 --- a/Gems/GradientSignal/Code/Source/Components/MixedGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/MixedGradientComponent.cpp @@ -257,62 +257,80 @@ namespace GradientSignal float MixedGradientComponent::GetValue(const GradientSampleParams& sampleParams) const { - AZ_PROFILE_FUNCTION(Entity); - //accumulate the mixed/combined result of all layers and operations float result = 0.0f; - float operationResult = 0.0f; for (const auto& layer : m_configuration.m_layers) { // added check to prevent opacity of 0.0, which will bust when we unpremultiply the alpha out if (layer.m_enabled && layer.m_gradientSampler.m_opacity != 0.0f) { + // Precalculate the inverse opacity that we'll use for blending the current accumulated value with. + // In the one case of "Initialize" blending, force this value to 0 so that we erase any accumulated values. + const float inverseOpacity = (layer.m_operation == MixedGradientLayer::MixingOperation::Initialize) + ? 0.0f + : (1.0f - layer.m_gradientSampler.m_opacity); + // this includes leveling and opacity result, we need unpremultiplied opacity to combine properly float current = layer.m_gradientSampler.GetValue(sampleParams); // unpremultiplied alpha (we clamp the end result) - float currentUnpremultiplied = current / layer.m_gradientSampler.m_opacity; - switch (layer.m_operation) - { - default: - case MixedGradientLayer::MixingOperation::Initialize: - //reset the result of the mixed/combined layers to the current value - result = 0.0f; - operationResult = currentUnpremultiplied; - break; - case MixedGradientLayer::MixingOperation::Multiply: - operationResult = result * currentUnpremultiplied; - break; - case MixedGradientLayer::MixingOperation::Add: - operationResult = result + currentUnpremultiplied; - break; - case MixedGradientLayer::MixingOperation::Subtract: - operationResult = result - currentUnpremultiplied; - break; - case MixedGradientLayer::MixingOperation::Min: - operationResult = AZStd::min(currentUnpremultiplied, result); - break; - case MixedGradientLayer::MixingOperation::Max: - operationResult = AZStd::max(currentUnpremultiplied, result); - break; - case MixedGradientLayer::MixingOperation::Average: - operationResult = (result + currentUnpremultiplied) / 2.0f; - break; - case MixedGradientLayer::MixingOperation::Normal: - operationResult = currentUnpremultiplied; - break; - case MixedGradientLayer::MixingOperation::Overlay: - operationResult = (result >= 0.5f) ? (1.0f - (2.0f * (1.0f - result) * (1.0f - currentUnpremultiplied))) : (2.0f * result * currentUnpremultiplied); - break; - } + const float currentUnpremultiplied = current / layer.m_gradientSampler.m_opacity; + const float operationResult = PerformMixingOperation(layer.m_operation, result, currentUnpremultiplied); // blend layers (re-applying opacity, which is why we needed to use unpremultiplied) - result = (result * (1.0f - layer.m_gradientSampler.m_opacity)) + (operationResult * layer.m_gradientSampler.m_opacity); + result = (result * inverseOpacity) + (operationResult * layer.m_gradientSampler.m_opacity); } } return AZ::GetClamp(result, 0.0f, 1.0f); } + void MixedGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const + { + if (positions.size() != outValues.size()) + { + AZ_Assert(false, "input and output lists are different sizes (%zu vs %zu).", positions.size(), outValues.size()); + return; + } + + // Initialize all of our output data to 0.0f. Layer blends will combine with this, so we need it to have an initial value. + AZStd::fill(outValues.begin(), outValues.end(), 0.0f); + + AZStd::vector layerValues(positions.size()); + + // accumulate the mixed/combined result of all layers and operations + for (const auto& layer : m_configuration.m_layers) + { + // added check to prevent opacity of 0.0, which will bust when we unpremultiply the alpha out + if (layer.m_enabled && layer.m_gradientSampler.m_opacity != 0.0f) + { + // Precalculate the inverse opacity that we'll use for blending the current accumulated value with. + // In the one case of "Initialize" blending, force this value to 0 so that we erase any accumulated values. + const float inverseOpacity = (layer.m_operation == MixedGradientLayer::MixingOperation::Initialize) + ? 0.0f + : (1.0f - layer.m_gradientSampler.m_opacity); + + // this includes leveling and opacity result, we need unpremultiplied opacity to combine properly + layer.m_gradientSampler.GetValues(positions, layerValues); + + for (size_t index = 0; index < outValues.size(); index++) + { + // unpremultiplied alpha (we clamp the end result) + const float currentUnpremultiplied = layerValues[index] / layer.m_gradientSampler.m_opacity; + const float operationResult = PerformMixingOperation(layer.m_operation, outValues[index], currentUnpremultiplied); + // blend layers (re-applying opacity, which is why we needed to use unpremultiplied) + outValues[index] = (outValues[index] * inverseOpacity) + (operationResult * layer.m_gradientSampler.m_opacity); + } + } + } + + for (auto& outValue : outValues) + { + outValue = AZ::GetClamp(outValue, 0.0f, 1.0f); + } + } + + + bool MixedGradientComponent::IsEntityInHierarchy(const AZ::EntityId& entityId) const { for (const auto& layer : m_configuration.m_layers) diff --git a/Gems/GradientSignal/Code/Source/Components/PosterizeGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/PosterizeGradientComponent.cpp index 21d321df13..4616e080f1 100644 --- a/Gems/GradientSignal/Code/Source/Components/PosterizeGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/PosterizeGradientComponent.cpp @@ -151,34 +151,28 @@ namespace GradientSignal float PosterizeGradientComponent::GetValue(const GradientSampleParams& sampleParams) const { const float bands = AZ::GetMax(static_cast(m_configuration.m_bands), 2.0f); - const float input = AZ::GetClamp(m_configuration.m_gradientSampler.GetValue(sampleParams), 0.0f, 1.0f); - float output = 0.0f; + const float input = m_configuration.m_gradientSampler.GetValue(sampleParams); + return PosterizeValue(input, bands, m_configuration.m_mode); + } + + void PosterizeGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const + { + if (positions.size() != outValues.size()) + { + AZ_Assert(false, "input and output lists are different sizes (%zu vs %zu).", positions.size(), outValues.size()); + return; + } + + const float bands = AZ::GetMax(static_cast(m_configuration.m_bands), 2.0f); - // "quantize" the input down to a number that goes from 0 to (bands-1) - const float band = AZ::GetClamp(floorf(input * bands), 0.0f, bands - 1.0f); + // Fill in the outValues with all of the generated inupt gradient values. + m_configuration.m_gradientSampler.GetValues(positions, outValues); - // Given our quantized band, produce the right output for that band range. - switch (m_configuration.m_mode) + // Run through all the input values and posterize them. + for (auto& outValue : outValues) { - default: - case PosterizeGradientConfig::ModeType::Floor: - // Floor: the output range should be the lowest value of each band, or (0 to bands-1) / bands - output = (band + 0.0f) / bands; - break; - case PosterizeGradientConfig::ModeType::Round: - // Round: the output range should be the midpoint of each band, or (0.5 to bands-0.5) / bands - output = (band + 0.5f) / bands; - break; - case PosterizeGradientConfig::ModeType::Ceiling: - // Ceiling: the output range should be the highest value of each band, or (1 to bands) / bands - output = (band + 1.0f) / bands; - break; - case PosterizeGradientConfig::ModeType::Ps: - // Ps: the output range should be equally distributed from 0-1, or (0 to bands-1) / (bands-1) - output = band / (bands - 1.0f); - break; + outValue = PosterizeValue(outValue, bands, m_configuration.m_mode); } - return AZ::GetClamp(output, 0.0f, 1.0f); } bool PosterizeGradientComponent::IsEntityInHierarchy(const AZ::EntityId& entityId) const diff --git a/Gems/GradientSignal/Code/Source/Components/ReferenceGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ReferenceGradientComponent.cpp index ea304a7eed..e135401ff5 100644 --- a/Gems/GradientSignal/Code/Source/Components/ReferenceGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ReferenceGradientComponent.cpp @@ -131,13 +131,18 @@ namespace GradientSignal float ReferenceGradientComponent::GetValue(const GradientSampleParams& sampleParams) const { - AZ_PROFILE_FUNCTION(Entity); - - float output = 0.0f; + return m_configuration.m_gradientSampler.GetValue(sampleParams); + } - output = m_configuration.m_gradientSampler.GetValue(sampleParams); + void ReferenceGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const + { + if (positions.size() != outValues.size()) + { + AZ_Assert(false, "input and output lists are different sizes (%zu vs %zu).", positions.size(), outValues.size()); + return; + } - return output; + m_configuration.m_gradientSampler.GetValues(positions, outValues); } bool ReferenceGradientComponent::IsEntityInHierarchy(const AZ::EntityId& entityId) const diff --git a/Gems/GradientSignal/Code/Source/Components/SmoothStepGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/SmoothStepGradientComponent.cpp index 510ed41510..683f0a37fa 100644 --- a/Gems/GradientSignal/Code/Source/Components/SmoothStepGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/SmoothStepGradientComponent.cpp @@ -168,12 +168,20 @@ namespace GradientSignal float SmoothStepGradientComponent::GetValue(const GradientSampleParams& sampleParams) const { - float output = 0.0f; + const float value = m_configuration.m_gradientSampler.GetValue(sampleParams); + return m_configuration.m_smoothStep.GetSmoothedValue(value); + } - const float value = AZ::GetClamp(m_configuration.m_gradientSampler.GetValue(sampleParams), 0.0f, 1.0f); - output = m_configuration.m_smoothStep.GetSmoothedValue(value); + void SmoothStepGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const + { + if (positions.size() != outValues.size()) + { + AZ_Assert(false, "input and output lists are different sizes (%zu vs %zu).", positions.size(), outValues.size()); + return; + } - return output; + m_configuration.m_gradientSampler.GetValues(positions, outValues); + m_configuration.m_smoothStep.GetSmoothedValues(outValues); } bool SmoothStepGradientComponent::IsEntityInHierarchy(const AZ::EntityId& entityId) const diff --git a/Gems/GradientSignal/Code/Source/Components/SurfaceAltitudeGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/SurfaceAltitudeGradientComponent.cpp index 8b36182750..ee6c272e40 100644 --- a/Gems/GradientSignal/Code/Source/Components/SurfaceAltitudeGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/SurfaceAltitudeGradientComponent.cpp @@ -202,19 +202,49 @@ namespace GradientSignal float SurfaceAltitudeGradientComponent::GetValue(const GradientSampleParams& sampleParams) const { - AZStd::lock_guard lock(m_cacheMutex); + AZStd::shared_lock lock(m_cacheMutex); SurfaceData::SurfacePointList points; SurfaceData::SurfaceDataSystemRequestBus::Broadcast(&SurfaceData::SurfaceDataSystemRequestBus::Events::GetSurfacePoints, sampleParams.m_position, m_configuration.m_surfaceTagsToSample, points); - if (points.empty()) + return CalculateAltitudeRatio(points, m_configuration.m_altitudeMin, m_configuration.m_altitudeMax); + } + + void SurfaceAltitudeGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const + { + if (positions.size() != outValues.size()) { - return 0.0f; + AZ_Assert(false, "input and output lists are different sizes (%zu vs %zu).", positions.size(), outValues.size()); + return; } - const AZ::Vector3& position = points.front().m_position; - return GetRatio(m_configuration.m_altitudeMin, m_configuration.m_altitudeMax, position.GetZ()); + AZStd::shared_lock lock(m_cacheMutex); + bool valuesFound = false; + + // Rather than calling GetSurfacePoints on the EBus repeatedly in a loop, we instead pass a lambda into the EBus that contains + // the loop within it so that we can avoid the repeated EBus-calling overhead. + SurfaceData::SurfaceDataSystemRequestBus::Broadcast( + [this, positions, &outValues, &valuesFound](SurfaceData::SurfaceDataSystemRequestBus::Events* surfaceDataRequests) + { + // It's possible that there's nothing connected to the EBus, so keep track of the fact that we have valid results. + valuesFound = true; + SurfaceData::SurfacePointList points; + + // For each position, call GetSurfacePoints() and turn the height into a 0-1 value based on our min/max altitudes. + for (size_t index = 0; index < positions.size(); index++) + { + points.clear(); + surfaceDataRequests->GetSurfacePoints(positions[index], m_configuration.m_surfaceTagsToSample, points); + outValues[index] = CalculateAltitudeRatio(points, m_configuration.m_altitudeMin, m_configuration.m_altitudeMax); + } + }); + + if (!valuesFound) + { + // No surface data, so no output values. + AZStd::fill(outValues.begin(), outValues.end(), 0.0f); + } } void SurfaceAltitudeGradientComponent::OnCompositionChanged() @@ -246,7 +276,7 @@ namespace GradientSignal { AZ_PROFILE_FUNCTION(Entity); - AZStd::lock_guard lock(m_cacheMutex); + AZStd::unique_lock lock(m_cacheMutex); if (m_configuration.m_shapeEntityId.IsValid()) { diff --git a/Gems/GradientSignal/Code/Source/Components/SurfaceMaskGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/SurfaceMaskGradientComponent.cpp index df7a3f5787..f697050f56 100644 --- a/Gems/GradientSignal/Code/Source/Components/SurfaceMaskGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/SurfaceMaskGradientComponent.cpp @@ -161,8 +161,6 @@ namespace GradientSignal float SurfaceMaskGradientComponent::GetValue(const GradientSampleParams& params) const { - AZ_PROFILE_FUNCTION(Entity); - float result = 0.0f; if (!m_configuration.m_surfaceTagList.empty()) @@ -171,18 +169,50 @@ namespace GradientSignal SurfaceData::SurfaceDataSystemRequestBus::Broadcast(&SurfaceData::SurfaceDataSystemRequestBus::Events::GetSurfacePoints, params.m_position, m_configuration.m_surfaceTagList, points); - for (const auto& point : points) - { - for (const auto& maskPair : point.m_masks) - { - result = AZ::GetMax(AZ::GetClamp(maskPair.second, 0.0f, 1.0f), result); - } - } + result = GetMaxSurfaceWeight(points); } return result; } + void SurfaceMaskGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const + { + if (positions.size() != outValues.size()) + { + AZ_Assert(false, "input and output lists are different sizes (%zu vs %zu).", positions.size(), outValues.size()); + return; + } + + bool valuesFound = false; + + if (!m_configuration.m_surfaceTagList.empty()) + { + // Rather than calling GetSurfacePoints on the EBus repeatedly in a loop, we instead pass a lambda into the EBus that contains + // the loop within it so that we can avoid the repeated EBus-calling overhead. + SurfaceData::SurfaceDataSystemRequestBus::Broadcast( + [this, positions, &outValues, &valuesFound](SurfaceData::SurfaceDataSystemRequestBus::Events* surfaceDataRequests) + { + // It's possible that there's nothing connected to the EBus, so keep track of the fact that we have valid results. + valuesFound = true; + SurfaceData::SurfacePointList points; + + for (size_t index = 0; index < positions.size(); index++) + { + points.clear(); + surfaceDataRequests->GetSurfacePoints(positions[index], m_configuration.m_surfaceTagList, points); + outValues[index] = GetMaxSurfaceWeight(points); + } + }); + } + + if (!valuesFound) + { + // No surface tags, so no output values. + AZStd::fill(outValues.begin(), outValues.end(), 0.0f); + } + + } + size_t SurfaceMaskGradientComponent::GetNumTags() const { return m_configuration.GetNumTags(); diff --git a/Gems/GradientSignal/Code/Source/Components/SurfaceSlopeGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/SurfaceSlopeGradientComponent.cpp index 84e0b61a62..50105a862f 100644 --- a/Gems/GradientSignal/Code/Source/Components/SurfaceSlopeGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/SurfaceSlopeGradientComponent.cpp @@ -209,36 +209,50 @@ namespace GradientSignal SurfaceData::SurfaceDataSystemRequestBus::Broadcast(&SurfaceData::SurfaceDataSystemRequestBus::Events::GetSurfacePoints, sampleParams.m_position, m_configuration.m_surfaceTagsToSample, points); - if (points.empty()) + const float angleMin = AZ::DegToRad(AZ::GetClamp(m_configuration.m_slopeMin, 0.0f, 90.0f)); + const float angleMax = AZ::DegToRad(AZ::GetClamp(m_configuration.m_slopeMax, 0.0f, 90.0f)); + + return GetSlopeRatio(points, angleMin, angleMax); + } + + void SurfaceSlopeGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const + { + if (positions.size() != outValues.size()) { - return 0.0f; + AZ_Assert(false, "input and output lists are different sizes (%zu vs %zu).", positions.size(), outValues.size()); + return; } - // Assuming our surface normal vector is actually normalized, we can get the slope - // by just grabbing the Z value. It's the same thing as normal.Dot(AZ::Vector3::CreateAxisZ()). - AZ_Assert(points.front().m_normal.GetNormalized().IsClose(points.front().m_normal), "Surface normals are expected to be normalized"); - const float slope = points.front().m_normal.GetZ(); - // Convert slope back to an angle so that we can lerp in "angular space", not "slope value space". - // (We want our 0-1 range to be linear across the range of angles) - const float slopeAngle = acosf(slope); + bool valuesFound = false; - const float angleMin = AZ::DegToRad(AZ::GetClamp(m_configuration.m_slopeMin, 0.0f, 90.0f)); - const float angleMax = AZ::DegToRad(AZ::GetClamp(m_configuration.m_slopeMax, 0.0f, 90.0f)); - - switch (m_configuration.m_rampType) + // Rather than calling GetSurfacePoints on the EBus repeatedly in a loop, we instead pass a lambda into the EBus that contains + // the loop within it so that we can avoid the repeated EBus-calling overhead. + SurfaceData::SurfaceDataSystemRequestBus::Broadcast( + [this, positions, &outValues, &valuesFound](SurfaceData::SurfaceDataSystemRequestBus::Events* surfaceDataRequests) + { + // It's possible that there's nothing connected to the EBus, so keep track of the fact that we have valid results. + valuesFound = true; + SurfaceData::SurfacePointList points; + + const float angleMin = AZ::DegToRad(AZ::GetClamp(m_configuration.m_slopeMin, 0.0f, 90.0f)); + const float angleMax = AZ::DegToRad(AZ::GetClamp(m_configuration.m_slopeMax, 0.0f, 90.0f)); + + for (size_t index = 0; index < positions.size(); index++) + { + points.clear(); + surfaceDataRequests->GetSurfacePoints(positions[index], m_configuration.m_surfaceTagsToSample, points); + outValues[index] = GetSlopeRatio(points, angleMin, angleMax); + } + }); + + if (!valuesFound) { - case SurfaceSlopeGradientConfig::RampType::SMOOTH_STEP: - return m_configuration.m_smoothStep.GetSmoothedValue(GetRatio(angleMin, angleMax, slopeAngle)); - case SurfaceSlopeGradientConfig::RampType::LINEAR_RAMP_UP: - // For ramp up, linearly interpolate from min to max. - return GetRatio(angleMin, angleMax, slopeAngle); - case SurfaceSlopeGradientConfig::RampType::LINEAR_RAMP_DOWN: - default: - // For ramp down, linearly interpolate from max to min. - return GetRatio(angleMax, angleMin, slopeAngle); + // No surface tags, so no output values. + AZStd::fill(outValues.begin(), outValues.end(), 0.0f); } } + float SurfaceSlopeGradientComponent::GetSlopeMin() const { return m_configuration.m_slopeMin; diff --git a/Gems/GradientSignal/Code/Source/Components/ThresholdGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ThresholdGradientComponent.cpp index a47ebdebe6..5df579576d 100644 --- a/Gems/GradientSignal/Code/Source/Components/ThresholdGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ThresholdGradientComponent.cpp @@ -138,11 +138,22 @@ namespace GradientSignal float ThresholdGradientComponent::GetValue(const GradientSampleParams& sampleParams) const { - float output = 0.0f; + return (m_configuration.m_gradientSampler.GetValue(sampleParams) <= m_configuration.m_threshold) ? 0.0f : 1.0f; + } - output = m_configuration.m_gradientSampler.GetValue(sampleParams) <= m_configuration.m_threshold ? 0.0f : 1.0f; + void ThresholdGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const + { + if (positions.size() != outValues.size()) + { + AZ_Assert(false, "input and output lists are different sizes (%zu vs %zu).", positions.size(), outValues.size()); + return; + } - return output; + m_configuration.m_gradientSampler.GetValues(positions, outValues); + for (auto& outValue : outValues) + { + outValue = (outValue <= m_configuration.m_threshold) ? 0.0f : 1.0f; + } } bool ThresholdGradientComponent::IsEntityInHierarchy(const AZ::EntityId& entityId) const From 798f6ea5bbda00574531de8fce30b277cb42c727 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Tue, 18 Jan 2022 15:41:37 -0600 Subject: [PATCH 534/948] Added support for additional formats Signed-off-by: Chris Galvan --- .../RPI.Reflect/Image/StreamingImageAsset.cpp | 109 ++++++++---------- 1 file changed, 51 insertions(+), 58 deletions(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index e21dd1f2c5..4e664ad3e2 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -51,58 +51,29 @@ namespace AZ return 0; } - template <> - AZ::u32 RetrieveUintValue(const AZ::u8* mem, size_t index) - { - return mem[index] / static_cast(std::numeric_limits::max()); - } - - template <> - AZ::u32 RetrieveUintValue(const AZ::u8* mem, size_t index) - { - // 16 bits per channel - auto actualMem = reinterpret_cast(mem); - - return actualMem[index] / static_cast(std::numeric_limits::max()); - } - - template <> - AZ::s32 RetrieveIntValue(const AZ::u8* mem, size_t index) - { - // 16 bits per channel - auto actualMem = reinterpret_cast(mem); - - return actualMem[index] / static_cast(std::numeric_limits::max()); - } - - template <> - float RetrieveFloatValue(const AZ::u8* mem, size_t index) - { - // 32 bits per channel - auto actualMem = reinterpret_cast(mem); - actualMem += index; - - return *actualMem; - } - - template <> - float RetrieveFloatValue(const AZ::u8* mem, size_t index) - { - // 32 bits per channel - auto actualMem = reinterpret_cast(mem); - actualMem += index; - - return *actualMem; - } - float RetrieveFloatValue(const AZ::u8* mem, size_t index, AZ::RHI::Format format) { switch (format) { - case AZ::RHI::Format::R32_UINT: - return RetrieveFloatValue(mem, index); + case AZ::RHI::Format::R8_UNORM: + case AZ::RHI::Format::R8_SNORM: + case AZ::RHI::Format::A8_UNORM: + { + return mem[index] / static_cast(std::numeric_limits::max()); + } + case AZ::RHI::Format::R16_FLOAT: + case AZ::RHI::Format::D16_UNORM: + case AZ::RHI::Format::R16_UNORM: + case AZ::RHI::Format::R16_SNORM: + { + return mem[index] / static_cast(std::numeric_limits::max()); + } + case AZ::RHI::Format::D32_FLOAT: case AZ::RHI::Format::R32_FLOAT: - return RetrieveFloatValue(mem, index); + { + auto actualMem = reinterpret_cast(mem); + return actualMem[index]; + } default: return RetrieveFloatValue(mem, index); } @@ -112,10 +83,20 @@ namespace AZ { switch (format) { - case AZ::RHI::Format::R8_UNORM: - return RetrieveUintValue(mem, index); - case AZ::RHI::Format::R16_UNORM: - return RetrieveUintValue(mem, index); + case AZ::RHI::Format::R8_UINT: + { + return mem[index] / static_cast(std::numeric_limits::max()); + } + case AZ::RHI::Format::R16_UINT: + { + auto actualMem = reinterpret_cast(mem); + return actualMem[index] / static_cast(std::numeric_limits::max()); + } + case AZ::RHI::Format::R32_UINT: + { + auto actualMem = reinterpret_cast(mem); + return actualMem[index]; + } default: return RetrieveUintValue(mem, index); } @@ -125,8 +106,20 @@ namespace AZ { switch (format) { + case AZ::RHI::Format::R8_SINT: + { + return mem[index] / static_cast(std::numeric_limits::max()); + } case AZ::RHI::Format::R16_SINT: - return RetrieveIntValue(mem, index); + { + auto actualMem = reinterpret_cast(mem); + return actualMem[index] / static_cast(std::numeric_limits::max()); + } + case AZ::RHI::Format::R32_SINT: + { + auto actualMem = reinterpret_cast(mem); + return actualMem[index]; + } default: return RetrieveIntValue(mem, index); } @@ -292,9 +285,9 @@ namespace AZ auto width = imageDescriptor.m_size.m_width; size_t outValuesIndex = 0; - for (uint32_t x = topLeft.first; x < bottomRight.first; ++x) + for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) { - for (uint32_t y = topLeft.second; y < bottomRight.second; ++y) + for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) { size_t imageDataIndex = (y * width) + x; @@ -318,9 +311,9 @@ namespace AZ auto width = imageDescriptor.m_size.m_width; size_t outValuesIndex = 0; - for (uint32_t x = topLeft.first; x < bottomRight.first; ++x) + for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) { - for (uint32_t y = topLeft.second; y < bottomRight.second; ++y) + for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) { size_t imageDataIndex = (y * width) + x; @@ -344,9 +337,9 @@ namespace AZ auto width = imageDescriptor.m_size.m_width; size_t outValuesIndex = 0; - for (uint32_t x = topLeft.first; x < bottomRight.first; ++x) + for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) { - for (uint32_t y = topLeft.second; y < bottomRight.second; ++y) + for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) { size_t imageDataIndex = (y * width) + x; From 948d72e079eba67ca2b12e21e987ab2a373eab92 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Tue, 18 Jan 2022 16:22:25 -0600 Subject: [PATCH 535/948] Fixed logic error for iterating through the image data by region Signed-off-by: Chris Galvan --- .../Source/RPI.Reflect/Image/StreamingImageAsset.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index 4e664ad3e2..d9aa2f1c23 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -285,9 +285,9 @@ namespace AZ auto width = imageDescriptor.m_size.m_width; size_t outValuesIndex = 0; - for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) + for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) { - for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) + for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) { size_t imageDataIndex = (y * width) + x; @@ -311,9 +311,9 @@ namespace AZ auto width = imageDescriptor.m_size.m_width; size_t outValuesIndex = 0; - for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) + for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) { - for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) + for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) { size_t imageDataIndex = (y * width) + x; @@ -337,9 +337,9 @@ namespace AZ auto width = imageDescriptor.m_size.m_width; size_t outValuesIndex = 0; - for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) + for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) { - for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) + for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) { size_t imageDataIndex = (y * width) + x; From b09caa5e7576af98b060f339308f779c9af1b6d5 Mon Sep 17 00:00:00 2001 From: Guthrie Adams Date: Tue, 18 Jan 2022 17:14:49 -0600 Subject: [PATCH 536/948] Atom Tools: disabling auto load of unused gems in some atom tools Atom tools are set up to inherit and automatically load all of the gems used by the game project. This is a great simplification that saves us from having to manually update cmake settings for every game project to push dependencies to every tool. The tradeoff is that some dependencies will be added to certain tools that have no relevance whatsoever, potentially wasting initialization time, memory utilization, and some processing. This change follows an existing example to update a couple of tools to forego initializing unused gems. They can easily be reenabled as needed. Signed-off-by: Guthrie Adams --- .../Include/AtomToolsFramework/Util/Util.h | 2 +- .../Code/Source/Util/Util.cpp | 6 +- .../EditorMaterialSystemComponent.cpp | 2 +- Registry/gem_autoload.materialeditor.setreg | 69 +++++++++++++++++++ ...em_autoload.shadermanagementconsole.setreg | 69 +++++++++++++++++++ 5 files changed, 143 insertions(+), 5 deletions(-) create mode 100644 Registry/gem_autoload.materialeditor.setreg create mode 100644 Registry/gem_autoload.shadermanagementconsole.setreg diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Util/Util.h b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Util/Util.h index ab2b8b46c0..57355e4f56 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Util/Util.h +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Util/Util.h @@ -38,5 +38,5 @@ namespace AtomToolsFramework QFileInfo GetOpenFileInfo(const AZStd::vector& assetTypes); QFileInfo GetUniqueFileInfo(const QString& initialPath); QFileInfo GetDuplicationFileInfo(const QString& initialPath); - bool LaunchTool(const QString& baseName, const QString& extension, const QStringList& arguments); + bool LaunchTool(const QString& baseName, const QStringList& arguments); } // namespace AtomToolsFramework diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Util/Util.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Util/Util.cpp index b45ff3c12f..89a5407260 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Util/Util.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Util/Util.cpp @@ -168,13 +168,13 @@ namespace AtomToolsFramework return duplicateFileInfo; } - bool LaunchTool(const QString& baseName, const QString& extension, const QStringList& arguments) + bool LaunchTool(const QString& baseName, const QStringList& arguments) { AZ::IO::FixedMaxPath engineRoot = AZ::Utils::GetEnginePath(); AZ_Assert(!engineRoot.empty(), "Cannot query Engine Path"); - AZ::IO::FixedMaxPath launchPath = AZ::IO::FixedMaxPath(AZ::Utils::GetExecutableDirectory()) - / (baseName + extension).toUtf8().constData(); + AZ::IO::FixedMaxPath launchPath = + AZ::IO::FixedMaxPath(AZ::Utils::GetExecutableDirectory()) / (baseName + AZ_TRAIT_OS_EXECUTABLE_EXTENSION).toUtf8().constData(); return QProcess::startDetached(launchPath.c_str(), arguments, engineRoot.c_str()); } diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialSystemComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialSystemComponent.cpp index adaebfb889..e216606401 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialSystemComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialSystemComponent.cpp @@ -143,7 +143,7 @@ namespace AZ arguments.append(QString("--project-path=%1").arg(projectPath.c_str())); } - AtomToolsFramework::LaunchTool("MaterialEditor", AZ_TRAIT_OS_EXECUTABLE_EXTENSION, arguments); + AtomToolsFramework::LaunchTool("MaterialEditor", arguments); } void EditorMaterialSystemComponent::OpenMaterialInspector( diff --git a/Registry/gem_autoload.materialeditor.setreg b/Registry/gem_autoload.materialeditor.setreg new file mode 100644 index 0000000000..fd00ff05c7 --- /dev/null +++ b/Registry/gem_autoload.materialeditor.setreg @@ -0,0 +1,69 @@ +{ + "Amazon": { + "Gems": { + "ImGui.Editor": { + "AutoLoad": false + }, + "Gestures.Editor": { + "AutoLoad": false + }, + "GraphCanvas.Editor": { + "AutoLoad": false + }, + "GraphModel.Editor": { + "AutoLoad": false + }, + "PhysX.Editor": { + "AutoLoad": false + }, + "PhysXDebug.Editor": { + "AutoLoad": false + }, + "Blast.Editor": { + "AutoLoad": false + }, + "NVCloth.Editor": { + "AutoLoad": false + }, + "ScriptCanvas.Editor": { + "AutoLoad": false + }, + "ScriptCanvasPhysics": { + "AutoLoad": false + }, + "ScriptCanvasTesting.Editor": { + "AutoLoad": false + }, + "LandscapeCanvas.Editor": { + "AutoLoad": false + }, + "HttpRequestor.Editor": { + "AutoLoad": false + }, + "WhiteBox.Editor": { + "AutoLoad": false + }, + "PythonAssetBuilder.Editor": { + "AutoLoad": false + }, + "AWSCore": { + "AutoLoad": false + }, + "AWSCore.Editor": { + "AutoLoad": false + }, + "AWSClientAuth": { + "AutoLoad": false + }, + "AWSClientAuth.Editor": { + "AutoLoad": false + }, + "AWSMetrics": { + "AutoLoad": false + }, + "AWSMetrics.Editor": { + "AutoLoad": false + } + } + } +} diff --git a/Registry/gem_autoload.shadermanagementconsole.setreg b/Registry/gem_autoload.shadermanagementconsole.setreg new file mode 100644 index 0000000000..fd00ff05c7 --- /dev/null +++ b/Registry/gem_autoload.shadermanagementconsole.setreg @@ -0,0 +1,69 @@ +{ + "Amazon": { + "Gems": { + "ImGui.Editor": { + "AutoLoad": false + }, + "Gestures.Editor": { + "AutoLoad": false + }, + "GraphCanvas.Editor": { + "AutoLoad": false + }, + "GraphModel.Editor": { + "AutoLoad": false + }, + "PhysX.Editor": { + "AutoLoad": false + }, + "PhysXDebug.Editor": { + "AutoLoad": false + }, + "Blast.Editor": { + "AutoLoad": false + }, + "NVCloth.Editor": { + "AutoLoad": false + }, + "ScriptCanvas.Editor": { + "AutoLoad": false + }, + "ScriptCanvasPhysics": { + "AutoLoad": false + }, + "ScriptCanvasTesting.Editor": { + "AutoLoad": false + }, + "LandscapeCanvas.Editor": { + "AutoLoad": false + }, + "HttpRequestor.Editor": { + "AutoLoad": false + }, + "WhiteBox.Editor": { + "AutoLoad": false + }, + "PythonAssetBuilder.Editor": { + "AutoLoad": false + }, + "AWSCore": { + "AutoLoad": false + }, + "AWSCore.Editor": { + "AutoLoad": false + }, + "AWSClientAuth": { + "AutoLoad": false + }, + "AWSClientAuth.Editor": { + "AutoLoad": false + }, + "AWSMetrics": { + "AutoLoad": false + }, + "AWSMetrics.Editor": { + "AutoLoad": false + } + } + } +} From eb51cd4c06670380314c1a54a5b10a858749b354 Mon Sep 17 00:00:00 2001 From: Guthrie Adams Date: Tue, 18 Jan 2022 01:50:05 -0600 Subject: [PATCH 537/948] Atom Tools: moving custom asset browser code to common location Consolidated duplicate asset browser code from multiple tools into single class in atom tools framework Moved creation of asset browser and Python terminal windows into base main window class Fixed docked window orientations Added checks to asset browser to prevent crashes if tree state saver was null Signed-off-by: Guthrie Adams --- .../Views/AssetBrowserTreeView.cpp | 11 +- .../AssetBrowser/AtomToolsAssetBrowser.h} | 48 ++-- .../Window/AtomToolsMainWindow.h | 3 + .../AssetBrowser/AtomToolsAssetBrowser.cpp} | 211 +++++++++--------- .../AssetBrowser/AtomToolsAssetBrowser.qrc | 5 + .../AssetBrowser/AtomToolsAssetBrowser.ui} | 4 +- .../Code/Source/AssetBrowser/Icons/view.svg} | 0 .../Document/AtomToolsDocumentMainWindow.cpp | 2 + .../Source/Window/AtomToolsMainWindow.cpp | 6 + .../Code/atomtoolsframework_files.cmake | 4 + .../Code/Source/Window/MaterialEditor.qrc | 1 - .../Source/Window/MaterialEditorWindow.cpp | 36 ++- .../Code/Source/Window/MaterialEditorWindow.h | 5 +- .../Window/MaterialEditorWindowModule.cpp | 1 + .../Code/materialeditorwindow_files.cmake | 3 - .../Code/CMakeLists.txt | 1 - .../ShaderManagementConsoleBrowserWidget.h | 69 ------ .../ShaderManagementConsoleBrowserWidget.ui | 168 -------------- .../Window/ShaderManagementConsoleWindow.cpp | 19 +- .../Window/ShaderManagementConsoleWindow.h | 4 +- .../ShaderManagementConsoleWindowModule.cpp | 12 +- .../shadermanagementconsolewindow_files.cmake | 3 - 22 files changed, 210 insertions(+), 406 deletions(-) rename Gems/Atom/Tools/{MaterialEditor/Code/Source/Window/MaterialBrowserWidget.h => AtomToolsFramework/Code/Include/AtomToolsFramework/AssetBrowser/AtomToolsAssetBrowser.h} (54%) rename Gems/Atom/Tools/{MaterialEditor/Code/Source/Window/MaterialBrowserWidget.cpp => AtomToolsFramework/Code/Source/AssetBrowser/AtomToolsAssetBrowser.cpp} (56%) create mode 100644 Gems/Atom/Tools/AtomToolsFramework/Code/Source/AssetBrowser/AtomToolsAssetBrowser.qrc rename Gems/Atom/Tools/{MaterialEditor/Code/Source/Window/MaterialBrowserWidget.ui => AtomToolsFramework/Code/Source/AssetBrowser/AtomToolsAssetBrowser.ui} (98%) rename Gems/Atom/Tools/{MaterialEditor/Code/Source/Window/Icons/View.svg => AtomToolsFramework/Code/Source/AssetBrowser/Icons/view.svg} (100%) delete mode 100644 Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleBrowserWidget.h delete mode 100644 Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleBrowserWidget.ui diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/AssetBrowserTreeView.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/AssetBrowserTreeView.cpp index 146eab9073..93a153cc16 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/AssetBrowserTreeView.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/AssetBrowserTreeView.cpp @@ -230,7 +230,10 @@ namespace AzToolsFramework { QModelIndex curIndex = selectedIndexes[0]; m_expandToEntriesByDefault = true; - m_treeStateSaver->ApplySnapshot(); + if (m_treeStateSaver) + { + m_treeStateSaver->ApplySnapshot(); + } setCurrentIndex(curIndex); scrollTo(curIndex); @@ -240,8 +243,12 @@ namespace AzToolsFramework // Flag our default expansion state so that we expand down to source entries after filtering m_expandToEntriesByDefault = hasFilter; + // Then ask our state saver to apply its current snapshot again, falling back on asking us if entries should be expanded or not - m_treeStateSaver->ApplySnapshot(); + if (m_treeStateSaver) + { + m_treeStateSaver->ApplySnapshot(); + } // If we're filtering for a valid entry, select the first valid entry if (hasFilter && selectFirstValidEntry) diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialBrowserWidget.h b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/AssetBrowser/AtomToolsAssetBrowser.h similarity index 54% rename from Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialBrowserWidget.h rename to Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/AssetBrowser/AtomToolsAssetBrowser.h index 24a244bc3c..915387d7b1 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialBrowserWidget.h +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/AssetBrowser/AtomToolsAssetBrowser.h @@ -9,17 +9,14 @@ #pragma once #if !defined(Q_MOC_RUN) -#include #include #include -#include #include AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT #include #include AZ_POP_DISABLE_WARNING - #endif namespace AzToolsFramework @@ -27,49 +24,50 @@ namespace AzToolsFramework namespace AssetBrowser { class AssetBrowserFilterModel; - class CompositeFilter; - class AssetBrowserEntry; - class ProductAssetBrowserEntry; - class SourceAssetBrowserEntry; } -} +} // namespace AzToolsFramework namespace Ui { - class MaterialBrowserWidget; + class AtomToolsAssetBrowser; } -namespace MaterialEditor +namespace AtomToolsFramework { - //! Provides a tree view of all available materials and other assets exposed by the MaterialEditor. - class MaterialBrowserWidget + //! Extends the standard asset browser with custom filters and multiselect behavior + class AtomToolsAssetBrowser : public QWidget , protected AZ::TickBus::Handler - , protected AtomToolsFramework::AtomToolsDocumentNotificationBus::Handler { Q_OBJECT public: - MaterialBrowserWidget(QWidget* parent = nullptr); - ~MaterialBrowserWidget(); + AtomToolsAssetBrowser(QWidget* parent = nullptr); + ~AtomToolsAssetBrowser(); - private: - AzToolsFramework::AssetBrowser::FilterConstType CreateFilter() const; + void SetFilterState(const AZStd::string& category, const AZStd::string& displayName, bool enabled); + void SetOpenHandler(AZStd::function openHandler); + + void SelectEntries(const AZStd::string& absolutePath); void OpenSelectedEntries(); + void OpenOptionsMenu(); - // AtomToolsDocumentNotificationBus::Handler implementation - void OnDocumentOpened(const AZ::Uuid& documentId) override; + protected: + AzToolsFramework::AssetBrowser::FilterConstType CreateFilter() const; + void UpdateFilter(); + void UpdatePreview(); + void TogglePreview(); // AZ::TickBus::Handler void OnTick(float deltaTime, AZ::ScriptTimePoint time) override; - void OpenOptionsMenu(); - - QScopedPointer m_ui; + QScopedPointer m_ui; AzToolsFramework::AssetBrowser::AssetBrowserFilterModel* m_filterModel = nullptr; - //! if new asset is being created with this path it will automatically be selected + //! If an asset is opened with this path it will automatically be selected AZStd::string m_pathToSelect; - QByteArray m_materialBrowserState; + QByteArray m_browserState; + + AZStd::function m_openHandler; }; -} // namespace MaterialEditor +} // namespace AtomToolsFramework diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Window/AtomToolsMainWindow.h b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Window/AtomToolsMainWindow.h index fab6e2fb01..92218d2542 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Window/AtomToolsMainWindow.h +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Window/AtomToolsMainWindow.h @@ -8,6 +8,7 @@ #pragma once +#include #include #include #include @@ -53,6 +54,8 @@ namespace AtomToolsFramework QMenu* m_menuView = {}; QMenu* m_menuHelp = {}; + AtomToolsFramework::AtomToolsAssetBrowser* m_assetBrowser = {}; + AZStd::unordered_map m_dockWidgets; AZStd::unordered_map m_dockActions; }; diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialBrowserWidget.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/AssetBrowser/AtomToolsAssetBrowser.cpp similarity index 56% rename from Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialBrowserWidget.cpp rename to Gems/Atom/Tools/AtomToolsFramework/Code/Source/AssetBrowser/AtomToolsAssetBrowser.cpp index 4df76b4dac..4270cb87fe 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialBrowserWidget.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/AssetBrowser/AtomToolsAssetBrowser.cpp @@ -6,13 +6,9 @@ * */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include #include #include #include @@ -21,41 +17,32 @@ #include #include #include -#include -#include AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT #include -#include #include -#include -#include #include #include #include -#include AZ_POP_DISABLE_WARNING -namespace MaterialEditor +namespace AtomToolsFramework { - MaterialBrowserWidget::MaterialBrowserWidget(QWidget* parent) + AtomToolsAssetBrowser::AtomToolsAssetBrowser(QWidget* parent) : QWidget(parent) - , m_ui(new Ui::MaterialBrowserWidget) + , m_ui(new Ui::AtomToolsAssetBrowser) { using namespace AzToolsFramework::AssetBrowser; m_ui->setupUi(this); m_ui->m_searchWidget->Setup(true, true); - m_ui->m_searchWidget->SetFilterState("", AZ::RPI::StreamingImageAsset::Group, true); - m_ui->m_searchWidget->SetFilterState("", AZ::RPI::MaterialAsset::Group, true); m_ui->m_searchWidget->setMinimumSize(QSize(150, 0)); - m_ui->m_viewOptionButton->setIcon(QIcon(":/Icons/View.svg")); + + m_ui->m_viewOptionButton->setIcon(QIcon(":/Icons/view.svg")); m_ui->m_splitter->setSizes(QList() << 400 << 200); m_ui->m_splitter->setStretchFactor(0, 1); - connect(m_ui->m_viewOptionButton, &QPushButton::clicked, this, &MaterialBrowserWidget::OpenOptionsMenu); - // Get the asset browser model AssetBrowserModel* assetBrowserModel = nullptr; AssetBrowserComponentRequestBus::BroadcastResult(assetBrowserModel, &AssetBrowserComponentRequests::GetAssetBrowserModel); @@ -73,38 +60,82 @@ namespace MaterialEditor // Maintains the tree expansion state between runs m_ui->m_assetBrowserTreeViewWidget->SetName("AssetBrowserTreeView_main"); - connect(m_ui->m_searchWidget->GetFilter().data(), &AssetBrowserEntryFilter::updatedSignal, m_filterModel, &AssetBrowserFilterModel::filterUpdatedSlot); - connect(m_filterModel, &AssetBrowserFilterModel::filterChanged, this, [this]() + connect(m_filterModel, &AssetBrowserFilterModel::filterChanged, this, &AtomToolsAssetBrowser::UpdateFilter); + connect(m_ui->m_assetBrowserTreeViewWidget, &AssetBrowserTreeView::activated, this, &AtomToolsAssetBrowser::OpenSelectedEntries); + connect(m_ui->m_assetBrowserTreeViewWidget, &AssetBrowserTreeView::selectionChangedSignal, this, &AtomToolsAssetBrowser::UpdatePreview); + connect(m_ui->m_viewOptionButton, &QPushButton::clicked, this, &AtomToolsAssetBrowser::OpenOptionsMenu); + connect( + m_ui->m_searchWidget->GetFilter().data(), &AssetBrowserEntryFilter::updatedSignal, m_filterModel, + &AssetBrowserFilterModel::filterUpdatedSlot); + } + + AtomToolsAssetBrowser::~AtomToolsAssetBrowser() + { + // Maintains the tree expansion state between runs + m_ui->m_assetBrowserTreeViewWidget->SaveState(); + AZ::TickBus::Handler::BusDisconnect(); + } + + void AtomToolsAssetBrowser::SetFilterState(const AZStd::string& category, const AZStd::string& displayName, bool enabled) + { + m_ui->m_searchWidget->SetFilterState(category.c_str(), displayName.c_str(), enabled); + } + + void AtomToolsAssetBrowser::SetOpenHandler(AZStd::function openHandler) + { + m_openHandler = openHandler; + } + + void AtomToolsAssetBrowser::SelectEntries(const AZStd::string& absolutePath) + { + if (!absolutePath.empty()) { - const bool hasFilter = !m_ui->m_searchWidget->GetFilterString().isEmpty(); - constexpr bool selectFirstFilteredIndex = true; - m_ui->m_assetBrowserTreeViewWidget->UpdateAfterFilter(hasFilter, selectFirstFilteredIndex); - }); - connect(m_ui->m_assetBrowserTreeViewWidget, &AssetBrowserTreeView::activated, this, &MaterialBrowserWidget::OpenSelectedEntries); - connect(m_ui->m_assetBrowserTreeViewWidget, &AssetBrowserTreeView::selectionChangedSignal, [this]() { - const auto& selectedAssets = m_ui->m_assetBrowserTreeViewWidget->GetSelectedAssets(); - if (!selectedAssets.empty()) + // Selecting a new asset in the browser is not guaranteed to happen immediately. + // The asset browser model notifications are sent before the model is updated. + // Instead of relying on the notifications, queue the selection and process it on tick until this change occurs. + m_pathToSelect = absolutePath; + AzFramework::StringFunc::Path::Normalize(m_pathToSelect); + AZ::TickBus::Handler::BusConnect(); + } + } + + void AtomToolsAssetBrowser::OpenSelectedEntries() + { + const AZStd::vector entries = m_ui->m_assetBrowserTreeViewWidget->GetSelectedAssets(); + + const int multiSelectPromptThreshold = 10; + if (entries.size() >= multiSelectPromptThreshold) + { + QMessageBox::StandardButton result = QMessageBox::question( + QApplication::activeWindow(), + tr("Attemptng to open %1 files").arg(entries.size()), + tr("Would you like to open anyway?"), + QMessageBox::Yes | QMessageBox::No); + if (result == QMessageBox::No) { - m_ui->m_previewerFrame->Display(selectedAssets.front()); + return; } - else + } + + for (const AssetBrowserEntry* entry : entries) + { + if (entry && entry->GetEntryType() != AssetBrowserEntry::AssetEntryType::Folder && m_openHandler) { - m_ui->m_previewerFrame->Clear(); + m_openHandler(entry->GetFullPath().c_str()); } - }); - - AtomToolsFramework::AtomToolsDocumentNotificationBus::Handler::BusConnect(); + } } - MaterialBrowserWidget::~MaterialBrowserWidget() + void AtomToolsAssetBrowser::OpenOptionsMenu() { - // Maintains the tree expansion state between runs - m_ui->m_assetBrowserTreeViewWidget->SaveState(); - AtomToolsFramework::AtomToolsDocumentNotificationBus::Handler::BusDisconnect(); - AZ::TickBus::Handler::BusDisconnect(); + QMenu menu; + QAction* action = menu.addAction(tr("Show Asset Preview"), this, &AtomToolsAssetBrowser::TogglePreview); + action->setCheckable(true); + action->setChecked(m_ui->m_previewerFrame->isVisible()); + menu.exec(QCursor::pos()); } - AzToolsFramework::AssetBrowser::FilterConstType MaterialBrowserWidget::CreateFilter() const + AzToolsFramework::AssetBrowser::FilterConstType AtomToolsAssetBrowser::CreateFilter() const { using namespace AzToolsFramework::AssetBrowser; @@ -125,59 +156,42 @@ namespace MaterialEditor return finalFilter; } - void MaterialBrowserWidget::OpenSelectedEntries() + void AtomToolsAssetBrowser::UpdateFilter() { - const AZStd::vector entries = m_ui->m_assetBrowserTreeViewWidget->GetSelectedAssets(); + const bool hasFilter = !m_ui->m_searchWidget->GetFilterString().isEmpty(); + constexpr bool selectFirstFilteredIndex = true; + m_ui->m_assetBrowserTreeViewWidget->UpdateAfterFilter(hasFilter, selectFirstFilteredIndex); + } - const int multiSelectPromptThreshold = 10; - if (entries.size() >= multiSelectPromptThreshold) + void AtomToolsAssetBrowser::UpdatePreview() + { + const auto& selectedAssets = m_ui->m_assetBrowserTreeViewWidget->GetSelectedAssets(); + if (!selectedAssets.empty()) { - if (QMessageBox::question( - QApplication::activeWindow(), - QString("Attemptng to open %1 files").arg(entries.size()), - "Would you like to open anyway?", - QMessageBox::Yes | QMessageBox::No) == QMessageBox::No) - { - return; - } + m_ui->m_previewerFrame->Display(selectedAssets.front()); } - - for (const AssetBrowserEntry* entry : entries) + else { - if (entry) - { - if (AzFramework::StringFunc::Path::IsExtension(entry->GetFullPath().c_str(), AZ::RPI::MaterialSourceData::Extension)) - { - AtomToolsFramework::AtomToolsDocumentSystemRequestBus::Broadcast(&AtomToolsFramework::AtomToolsDocumentSystemRequestBus::Events::OpenDocument, entry->GetFullPath()); - } - else if (AzFramework::StringFunc::Path::IsExtension(entry->GetFullPath().c_str(), AZ::RPI::MaterialTypeSourceData::Extension)) - { - //ignore AZ::RPI::MaterialTypeSourceData::Extension - } - else - { - QDesktopServices::openUrl(QUrl::fromLocalFile(entry->GetFullPath().c_str())); - } - } + m_ui->m_previewerFrame->Clear(); } } - void MaterialBrowserWidget::OnDocumentOpened(const AZ::Uuid& documentId) + void AtomToolsAssetBrowser::TogglePreview() { - AZStd::string absolutePath; - AtomToolsFramework::AtomToolsDocumentRequestBus::EventResult(absolutePath, documentId, &AtomToolsFramework::AtomToolsDocumentRequestBus::Events::GetAbsolutePath); - if (!absolutePath.empty()) + const bool isPreviewFrameVisible = m_ui->m_previewerFrame->isVisible(); + m_ui->m_previewerFrame->setVisible(!isPreviewFrameVisible); + if (isPreviewFrameVisible) { - // Selecting a new asset in the browser is not guaranteed to happen immediately. - // The asset browser model notifications are sent before the model is updated. - // Instead of relying on the notifications, queue the selection and process it on tick until this change occurs. - m_pathToSelect = absolutePath; - AzFramework::StringFunc::Path::Normalize(m_pathToSelect); - AZ::TickBus::Handler::BusConnect(); + m_browserState = m_ui->m_splitter->saveState(); + m_ui->m_splitter->setSizes(QList({ 1, 0 })); + } + else + { + m_ui->m_splitter->restoreState(m_browserState); } } - void MaterialBrowserWidget::OnTick(float deltaTime, AZ::ScriptTimePoint time) + void AtomToolsAssetBrowser::OnTick(float deltaTime, AZ::ScriptTimePoint time) { AZ_UNUSED(time); AZ_UNUSED(deltaTime); @@ -188,7 +202,7 @@ namespace MaterialEditor AzToolsFramework::AssetBrowser::AssetBrowserViewRequestBus::Broadcast( &AzToolsFramework::AssetBrowser::AssetBrowserViewRequestBus::Events::SelectFileAtPath, m_pathToSelect); - // Iterate over the selected entries to verify if the selection was made + // Iterate over the selected entries to verify if the selection was made for (const AssetBrowserEntry* entry : m_ui->m_assetBrowserTreeViewWidget->GetSelectedAssets()) { if (entry) @@ -205,31 +219,6 @@ namespace MaterialEditor } } } +} // namespace AtomToolsFramework - void MaterialBrowserWidget::OpenOptionsMenu() - { - QMenu menu; - - QAction* action = new QAction("Show Asset Preview", this); - action->setCheckable(true); - action->setChecked(m_ui->m_previewerFrame->isVisible()); - connect(action, &QAction::triggered, [this]() { - bool isPreviewFrameVisible = m_ui->m_previewerFrame->isVisible(); - m_ui->m_previewerFrame->setVisible(!isPreviewFrameVisible); - if (isPreviewFrameVisible) - { - m_materialBrowserState = m_ui->m_splitter->saveState(); - m_ui->m_splitter->setSizes(QList({ 1, 0 })); - } - else - { - m_ui->m_splitter->restoreState(m_materialBrowserState); - } - }); - menu.addAction(action); - menu.exec(QCursor::pos()); - } - -} // namespace MaterialEditor - -#include +#include diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/AssetBrowser/AtomToolsAssetBrowser.qrc b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/AssetBrowser/AtomToolsAssetBrowser.qrc new file mode 100644 index 0000000000..c24968e78a --- /dev/null +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/AssetBrowser/AtomToolsAssetBrowser.qrc @@ -0,0 +1,5 @@ + + + Icons/view.svg + + diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialBrowserWidget.ui b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/AssetBrowser/AtomToolsAssetBrowser.ui similarity index 98% rename from Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialBrowserWidget.ui rename to Gems/Atom/Tools/AtomToolsFramework/Code/Source/AssetBrowser/AtomToolsAssetBrowser.ui index 9e5344bea2..9b68b3edc9 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialBrowserWidget.ui +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/AssetBrowser/AtomToolsAssetBrowser.ui @@ -1,7 +1,7 @@ - MaterialBrowserWidget - + AtomToolsAssetBrowser + 0 diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/Icons/View.svg b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/AssetBrowser/Icons/view.svg similarity index 100% rename from Gems/Atom/Tools/MaterialEditor/Code/Source/Window/Icons/View.svg rename to Gems/Atom/Tools/AtomToolsFramework/Code/Source/AssetBrowser/Icons/view.svg diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocumentMainWindow.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocumentMainWindow.cpp index 0d62adc9ee..e8be20097f 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocumentMainWindow.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Document/AtomToolsDocumentMainWindow.cpp @@ -414,6 +414,8 @@ namespace AtomToolsFramework m_actionPreviousTab->setEnabled(m_tabWidget->count() > 1); m_actionNextTab->setEnabled(m_tabWidget->count() > 1); + m_assetBrowser->SelectEntries(absolutePath); + activateWindow(); raise(); diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Window/AtomToolsMainWindow.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Window/AtomToolsMainWindow.cpp index f07fd9c536..6a30ffc421 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Window/AtomToolsMainWindow.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Window/AtomToolsMainWindow.cpp @@ -8,6 +8,7 @@ #include #include +#include #include #include @@ -40,6 +41,11 @@ namespace AtomToolsFramework centralWidget->setLayout(centralWidgetLayout); setCentralWidget(centralWidget); + m_assetBrowser = new AtomToolsFramework::AtomToolsAssetBrowser(this); + AddDockWidget("Asset Browser", m_assetBrowser, Qt::BottomDockWidgetArea, Qt::Horizontal); + AddDockWidget("Python Terminal", new AzToolsFramework::CScriptTermDialog, Qt::BottomDockWidgetArea, Qt::Horizontal); + SetDockWidgetVisible("Python Terminal", false); + AtomToolsMainWindowRequestBus::Handler::BusConnect(); } diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/atomtoolsframework_files.cmake b/Gems/Atom/Tools/AtomToolsFramework/Code/atomtoolsframework_files.cmake index 3ddcc05245..3de1bb65e2 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/atomtoolsframework_files.cmake +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/atomtoolsframework_files.cmake @@ -8,6 +8,7 @@ set(FILES Include/AtomToolsFramework/Application/AtomToolsApplication.h + Include/AtomToolsFramework/AssetBrowser/AtomToolsAssetBrowser.h Include/AtomToolsFramework/Communication/LocalServer.h Include/AtomToolsFramework/Communication/LocalSocket.h Include/AtomToolsFramework/Debug/TraceRecorder.h @@ -36,6 +37,9 @@ set(FILES Include/AtomToolsFramework/Window/AtomToolsMainWindowFactoryRequestBus.h Include/AtomToolsFramework/Window/AtomToolsMainWindowNotificationBus.h Source/Application/AtomToolsApplication.cpp + Source/AssetBrowser/AtomToolsAssetBrowser.cpp + Source/AssetBrowser/AtomToolsAssetBrowser.qrc + Source/AssetBrowser/AtomToolsAssetBrowser.ui Source/Communication/LocalServer.cpp Source/Communication/LocalSocket.cpp Source/Debug/TraceRecorder.cpp diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditor.qrc b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditor.qrc index 902201e792..73b55f2f39 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditor.qrc +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditor.qrc @@ -21,6 +21,5 @@ Icons/shadow.svg Icons/skybox.svg Icons/toneMapping.svg - Icons/View.svg diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.cpp index 0388af0134..44adda432d 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.cpp @@ -8,15 +8,16 @@ #include #include +#include +#include #include +#include #include #include #include -#include #include #include #include -#include #include #include #include @@ -27,14 +28,16 @@ AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnin #include #include #include +#include #include +#include #include AZ_POP_DISABLE_WARNING namespace MaterialEditor { MaterialEditorWindow::MaterialEditorWindow(QWidget* parent /* = 0 */) - : AtomToolsFramework::AtomToolsDocumentMainWindow(parent) + : Base(parent) { resize(1280, 1024); @@ -72,15 +75,30 @@ namespace MaterialEditor m_materialViewport->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); centralWidget()->layout()->addWidget(m_materialViewport); - AddDockWidget("Asset Browser", new MaterialBrowserWidget, Qt::BottomDockWidgetArea, Qt::Vertical); - AddDockWidget("Inspector", new MaterialInspector, Qt::RightDockWidgetArea, Qt::Horizontal); - AddDockWidget("Viewport Settings", new ViewportSettingsInspector, Qt::LeftDockWidgetArea, Qt::Horizontal); - AddDockWidget("Performance Monitor", new PerformanceMonitorWidget, Qt::RightDockWidgetArea, Qt::Horizontal); - AddDockWidget("Python Terminal", new AzToolsFramework::CScriptTermDialog, Qt::BottomDockWidgetArea, Qt::Horizontal); + m_assetBrowser->SetFilterState("", AZ::RPI::StreamingImageAsset::Group, true); + m_assetBrowser->SetFilterState("", AZ::RPI::MaterialAsset::Group, true); + m_assetBrowser->SetOpenHandler([](const AZStd::string& absolutePath) { + if (AzFramework::StringFunc::Path::IsExtension(absolutePath.c_str(), AZ::RPI::MaterialSourceData::Extension)) + { + AtomToolsFramework::AtomToolsDocumentSystemRequestBus::Broadcast( + &AtomToolsFramework::AtomToolsDocumentSystemRequestBus::Events::OpenDocument, absolutePath); + return; + } + + if (AzFramework::StringFunc::Path::IsExtension(absolutePath.c_str(), AZ::RPI::MaterialTypeSourceData::Extension)) + { + return; + } + + QDesktopServices::openUrl(QUrl::fromLocalFile(absolutePath.c_str())); + }); + + AddDockWidget("Inspector", new MaterialInspector, Qt::RightDockWidgetArea, Qt::Vertical); + AddDockWidget("Viewport Settings", new ViewportSettingsInspector, Qt::LeftDockWidgetArea, Qt::Vertical); + AddDockWidget("Performance Monitor", new PerformanceMonitorWidget, Qt::BottomDockWidgetArea, Qt::Horizontal); SetDockWidgetVisible("Viewport Settings", false); SetDockWidgetVisible("Performance Monitor", false); - SetDockWidgetVisible("Python Terminal", false); // Restore geometry and show the window mainWindowWrapper->showFromSettings(); diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.h index bed2aa34e4..8ad294c529 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.h @@ -21,7 +21,6 @@ namespace MaterialEditor { //! MaterialEditorWindow is the main class. Its responsibility is limited to initializing and connecting //! its panels, managing selection of assets, and performing high-level actions like saving. It contains... - //! 1) MaterialBrowser - The user browses for Material (.material) assets. //! 2) MaterialViewport - The user can see the selected Material applied to a model. //! 3) MaterialPropertyInspector - The user edits the properties of the selected Material. class MaterialEditorWindow @@ -48,7 +47,7 @@ namespace MaterialEditor void closeEvent(QCloseEvent* closeEvent) override; - MaterialViewportWidget* m_materialViewport = nullptr; - MaterialEditorToolBar* m_toolBar = nullptr; + MaterialViewportWidget* m_materialViewport = {}; + MaterialEditorToolBar* m_toolBar = {}; }; } // namespace MaterialEditor diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindowModule.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindowModule.cpp index c761c85556..1562d11647 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindowModule.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindowModule.cpp @@ -14,6 +14,7 @@ void InitMaterialEditorResources() //Must register qt resources from other modules Q_INIT_RESOURCE(MaterialEditor); Q_INIT_RESOURCE(InspectorWidget); + Q_INIT_RESOURCE(AtomToolsAssetBrowser); } namespace MaterialEditor diff --git a/Gems/Atom/Tools/MaterialEditor/Code/materialeditorwindow_files.cmake b/Gems/Atom/Tools/MaterialEditor/Code/materialeditorwindow_files.cmake index b814ad3f47..3d21e71294 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/materialeditorwindow_files.cmake +++ b/Gems/Atom/Tools/MaterialEditor/Code/materialeditorwindow_files.cmake @@ -15,9 +15,6 @@ set(FILES Source/Window/MaterialEditorWindow.cpp Source/Window/MaterialEditorWindowModule.cpp Source/Window/MaterialEditorWindowSettings.cpp - Source/Window/MaterialBrowserWidget.h - Source/Window/MaterialBrowserWidget.cpp - Source/Window/MaterialBrowserWidget.ui Source/Window/MaterialEditor.qrc Source/Window/MaterialEditor.qss Source/Window/MaterialEditorWindowComponent.h diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/CMakeLists.txt b/Gems/Atom/Tools/ShaderManagementConsole/Code/CMakeLists.txt index 3f7788418a..c5ceab5360 100644 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/CMakeLists.txt +++ b/Gems/Atom/Tools/ShaderManagementConsole/Code/CMakeLists.txt @@ -42,7 +42,6 @@ ly_add_target( NAME ShaderManagementConsole.Window STATIC NAMESPACE Gem AUTOMOC - AUTOUIC AUTORCC FILES_CMAKE shadermanagementconsolewindow_files.cmake diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleBrowserWidget.h b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleBrowserWidget.h deleted file mode 100644 index 73a2a24aa9..0000000000 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleBrowserWidget.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#pragma once - -#if !defined(Q_MOC_RUN) -#include -#include -#include -#include - -AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT -#include -AZ_POP_DISABLE_WARNING - -#endif - -namespace AzToolsFramework -{ - namespace AssetBrowser - { - class AssetBrowserFilterModel; - class CompositeFilter; - class AssetBrowserEntry; - class ProductAssetBrowserEntry; - class SourceAssetBrowserEntry; - } -} - -namespace Ui -{ - class ShaderManagementConsoleBrowserWidget; -} - -namespace ShaderManagementConsole -{ - //! Provides a tree view of all available assets - class ShaderManagementConsoleBrowserWidget - : public QWidget - , public AzToolsFramework::AssetBrowser::AssetBrowserModelNotificationBus::Handler - , public AtomToolsFramework::AtomToolsDocumentNotificationBus::Handler - { - Q_OBJECT - public: - ShaderManagementConsoleBrowserWidget(QWidget* parent = nullptr); - ~ShaderManagementConsoleBrowserWidget(); - - private: - AzToolsFramework::AssetBrowser::FilterConstType CreateFilter() const; - void OpenSelectedEntries(); - - QScopedPointer m_ui; - AzToolsFramework::AssetBrowser::AssetBrowserFilterModel* m_filterModel = nullptr; - - //! if new asset is being created with this path it will automatically be selected - AZStd::string m_pathToSelect; - - // AssetBrowserModelNotificationBus::Handler implementation - void EntryAdded(const AzToolsFramework::AssetBrowser::AssetBrowserEntry* entry) override; - - // AtomToolsFramework::AtomToolsDocumentNotificationBus::Handler implementation - void OnDocumentOpened(const AZ::Uuid& documentId) override; - }; -} // namespace ShaderManagementConsole diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleBrowserWidget.ui b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleBrowserWidget.ui deleted file mode 100644 index cf8a714273..0000000000 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleBrowserWidget.ui +++ /dev/null @@ -1,168 +0,0 @@ - - - ShaderManagementConsoleBrowserWidget - - - - 0 - 0 - 691 - 554 - - - - Asset Browser - - - - 0 - - - - - - 1 - 1 - - - - true - - - - - 0 - 0 - 671 - 534 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - 0 - 0 - - - - - - - - - - - 0 - 0 - - - - Qt::Horizontal - - - false - - - - - 0 - 0 - - - - vertical-align: top - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 1 - 0 - - - - QAbstractItemView::DragOnly - - - - - - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - - - - - - - - - - - AzToolsFramework::AssetBrowser::SearchWidget - QWidget -
AzToolsFramework/AssetBrowser/Search/SearchWidget.h
- 1 -
- - AzToolsFramework::AssetBrowser::AssetBrowserTreeView - QTreeView -
AzToolsFramework/AssetBrowser/Views/AssetBrowserTreeView.h
-
- - AzToolsFramework::AssetBrowser::PreviewerFrame - QFrame -
AzToolsFramework/AssetBrowser/Previewer/PreviewerFrame.h
- 1 -
-
- - -
diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindow.cpp b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindow.cpp index 29dafe99fe..8e8e047e83 100644 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindow.cpp +++ b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindow.cpp @@ -7,23 +7,25 @@ */ #include +#include #include #include #include -#include #include AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT +#include #include #include #include +#include #include AZ_POP_DISABLE_WARNING namespace ShaderManagementConsole { ShaderManagementConsoleWindow::ShaderManagementConsoleWindow(QWidget* parent /* = 0 */) - : AtomToolsFramework::AtomToolsDocumentMainWindow(parent) + : Base(parent) { resize(1280, 1024); @@ -41,10 +43,17 @@ namespace ShaderManagementConsole m_toolBar->setObjectName("ToolBar"); addToolBar(m_toolBar); - AddDockWidget("Asset Browser", new ShaderManagementConsoleBrowserWidget, Qt::BottomDockWidgetArea, Qt::Vertical); - AddDockWidget("Python Terminal", new AzToolsFramework::CScriptTermDialog, Qt::BottomDockWidgetArea, Qt::Horizontal); + m_assetBrowser->SetFilterState("", AZ::RPI::ShaderAsset::Group, true); + m_assetBrowser->SetOpenHandler([](const AZStd::string& absolutePath) { + if (AzFramework::StringFunc::Path::IsExtension(absolutePath.c_str(), AZ::RPI::ShaderVariantListSourceData::Extension)) + { + AtomToolsFramework::AtomToolsDocumentSystemRequestBus::Broadcast( + &AtomToolsFramework::AtomToolsDocumentSystemRequestBus::Events::OpenDocument, absolutePath); + return; + } - SetDockWidgetVisible("Python Terminal", false); + QDesktopServices::openUrl(QUrl::fromLocalFile(absolutePath.c_str())); + }); // Restore geometry and show the window mainWindowWrapper->showFromSettings(); diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindow.h b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindow.h index 3ba122674a..1c7479e526 100644 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindow.h +++ b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindow.h @@ -14,9 +14,7 @@ #include AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT -#include #include - #include AZ_POP_DISABLE_WARNING #endif @@ -40,6 +38,6 @@ namespace ShaderManagementConsole protected: QWidget* CreateDocumentTabView(const AZ::Uuid& documentId) override; - ShaderManagementConsoleToolBar* m_toolBar = nullptr; + ShaderManagementConsoleToolBar* m_toolBar = {}; }; } // namespace ShaderManagementConsole diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindowModule.cpp b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindowModule.cpp index 3db5b236d6..a13b873aee 100644 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindowModule.cpp +++ b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindowModule.cpp @@ -9,10 +9,20 @@ #include #include +void InitShaderManagementConsoleResources() +{ + // Must register qt resources from other modules + Q_INIT_RESOURCE(ShaderManagementConsole); + Q_INIT_RESOURCE(InspectorWidget); + Q_INIT_RESOURCE(AtomToolsAssetBrowser); +} + namespace ShaderManagementConsole { ShaderManagementConsoleWindowModule::ShaderManagementConsoleWindowModule() { + InitShaderManagementConsoleResources(); + // Push results of [MyComponent]::CreateDescriptor() into m_descriptors here. m_descriptors.insert(m_descriptors.end(), { ShaderManagementConsoleWindowComponent::CreateDescriptor(), @@ -25,4 +35,4 @@ namespace ShaderManagementConsole azrtti_typeid(), }; } -} +} // namespace ShaderManagementConsole diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/shadermanagementconsolewindow_files.cmake b/Gems/Atom/Tools/ShaderManagementConsole/Code/shadermanagementconsolewindow_files.cmake index 0d33d990a4..fb5cc0dad6 100644 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/shadermanagementconsolewindow_files.cmake +++ b/Gems/Atom/Tools/ShaderManagementConsole/Code/shadermanagementconsolewindow_files.cmake @@ -14,9 +14,6 @@ set(FILES Source/Window/ShaderManagementConsoleWindow.h Source/Window/ShaderManagementConsoleWindow.cpp Source/Window/ShaderManagementConsoleWindowModule.cpp - Source/Window/ShaderManagementConsoleBrowserWidget.h - Source/Window/ShaderManagementConsoleBrowserWidget.cpp - Source/Window/ShaderManagementConsoleBrowserWidget.ui Source/Window/ShaderManagementConsole.qrc Source/Window/ShaderManagementConsoleWindowComponent.h Source/Window/ShaderManagementConsoleWindowComponent.cpp From c262696056811660aa3e55cb6a83136232fb12fb Mon Sep 17 00:00:00 2001 From: abrmich Date: Tue, 18 Jan 2022 16:13:28 -0800 Subject: [PATCH 538/948] Move remaining two LyShine headers to the gem Signed-off-by: abrmich --- Code/Legacy/CryCommon/crycommon_files.cmake | 2 -- Code/Legacy/CrySystem/System.cpp | 3 --- Code/Legacy/CrySystem/XConsole.cpp | 5 ----- .../FontBuilderWorker/FontBuilderWorker.cpp | 4 ++-- .../Code/Tests/Builders/CopyDependencyBuilderTest.cpp | 2 -- .../LyShine/Code/Include}/LyShine/Bus/UiCursorBus.h | 0 .../LyShine/Code/Include}/LyShine/UiAssetTypes.h | 0 Gems/LyShine/Code/lyshine_static_files.cmake | 2 ++ 8 files changed, 4 insertions(+), 14 deletions(-) rename {Code/Legacy/CryCommon => Gems/LyShine/Code/Include}/LyShine/Bus/UiCursorBus.h (100%) rename {Code/Legacy/CryCommon => Gems/LyShine/Code/Include}/LyShine/UiAssetTypes.h (100%) diff --git a/Code/Legacy/CryCommon/crycommon_files.cmake b/Code/Legacy/CryCommon/crycommon_files.cmake index a4d87c207a..479f0ec879 100644 --- a/Code/Legacy/CryCommon/crycommon_files.cmake +++ b/Code/Legacy/CryCommon/crycommon_files.cmake @@ -100,8 +100,6 @@ set(FILES platform_impl.cpp Win32specific.h Win64specific.h - LyShine/UiAssetTypes.h - LyShine/Bus/UiCursorBus.h Maestro/Bus/EditorSequenceAgentComponentBus.h Maestro/Bus/EditorSequenceBus.h Maestro/Bus/EditorSequenceComponentBus.h diff --git a/Code/Legacy/CrySystem/System.cpp b/Code/Legacy/CrySystem/System.cpp index 7cf066f72e..0439b69efc 100644 --- a/Code/Legacy/CrySystem/System.cpp +++ b/Code/Legacy/CrySystem/System.cpp @@ -134,7 +134,6 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) #include -#include #include #include @@ -1374,7 +1373,6 @@ bool CSystem::HandleMessage([[maybe_unused]] HWND hWnd, UINT uMsg, WPARAM wParam // Fall through intended case WM_ENTERMENULOOP: { - UiCursorBus::Broadcast(&UiCursorInterface::IncrementVisibleCounter); return true; } case WM_CAPTURECHANGED: @@ -1392,7 +1390,6 @@ bool CSystem::HandleMessage([[maybe_unused]] HWND hWnd, UINT uMsg, WPARAM wParam // Fall through intended case WM_EXITMENULOOP: { - UiCursorBus::Broadcast(&UiCursorInterface::DecrementVisibleCounter); return (uMsg != WM_CAPTURECHANGED); } case WM_SYSKEYUP: diff --git a/Code/Legacy/CrySystem/XConsole.cpp b/Code/Legacy/CrySystem/XConsole.cpp index df82e34abe..e74b1e7c56 100644 --- a/Code/Legacy/CrySystem/XConsole.cpp +++ b/Code/Legacy/CrySystem/XConsole.cpp @@ -29,7 +29,6 @@ #include #include -#include //#define DEFENCE_CVAR_HASH_LOGGING // s should point to a buffer at least 65 chars long @@ -749,8 +748,6 @@ void CXConsole::ShowConsole(bool show, const int iRequestScrollMax) if (show && !m_bConsoleActive) { - UiCursorBus::Broadcast(&UiCursorBus::Events::IncrementVisibleCounter); - AzFramework::InputSystemCursorRequestBus::EventResult(m_previousSystemCursorState, AzFramework::InputDeviceMouse::Id, &AzFramework::InputSystemCursorRequests::GetSystemCursorState); @@ -760,8 +757,6 @@ void CXConsole::ShowConsole(bool show, const int iRequestScrollMax) } else if (!show && m_bConsoleActive) { - UiCursorBus::Broadcast(&UiCursorBus::Events::DecrementVisibleCounter); - AzFramework::InputSystemCursorRequestBus::Event(AzFramework::InputDeviceMouse::Id, &AzFramework::InputSystemCursorRequests::SetSystemCursorState, m_previousSystemCursorState); diff --git a/Gems/LmbrCentral/Code/Source/Builders/CopyDependencyBuilder/FontBuilderWorker/FontBuilderWorker.cpp b/Gems/LmbrCentral/Code/Source/Builders/CopyDependencyBuilder/FontBuilderWorker/FontBuilderWorker.cpp index 3fe399d05d..ccaa1700f9 100644 --- a/Gems/LmbrCentral/Code/Source/Builders/CopyDependencyBuilder/FontBuilderWorker/FontBuilderWorker.cpp +++ b/Gems/LmbrCentral/Code/Source/Builders/CopyDependencyBuilder/FontBuilderWorker/FontBuilderWorker.cpp @@ -9,7 +9,6 @@ #include "FontBuilderWorker.h" #include -#include #include #include @@ -52,7 +51,8 @@ namespace CopyDependencyBuilder if (fileExtension == "font" || fileExtension == "fontfamily") { - return azrtti_typeid(); + static AZ::Data::AssetType fontAssetType("{57767D37-0EBE-43BE-8F60-AB36D2056EF8}"); // form UiAssetTypes.h in the LyShine gem + return fontAssetType; } return AZ::Data::AssetType::CreateNull(); diff --git a/Gems/LmbrCentral/Code/Tests/Builders/CopyDependencyBuilderTest.cpp b/Gems/LmbrCentral/Code/Tests/Builders/CopyDependencyBuilderTest.cpp index 8b697f35f2..7767e4f239 100644 --- a/Gems/LmbrCentral/Code/Tests/Builders/CopyDependencyBuilderTest.cpp +++ b/Gems/LmbrCentral/Code/Tests/Builders/CopyDependencyBuilderTest.cpp @@ -19,8 +19,6 @@ #include #include -#include - #include #include #include diff --git a/Code/Legacy/CryCommon/LyShine/Bus/UiCursorBus.h b/Gems/LyShine/Code/Include/LyShine/Bus/UiCursorBus.h similarity index 100% rename from Code/Legacy/CryCommon/LyShine/Bus/UiCursorBus.h rename to Gems/LyShine/Code/Include/LyShine/Bus/UiCursorBus.h diff --git a/Code/Legacy/CryCommon/LyShine/UiAssetTypes.h b/Gems/LyShine/Code/Include/LyShine/UiAssetTypes.h similarity index 100% rename from Code/Legacy/CryCommon/LyShine/UiAssetTypes.h rename to Gems/LyShine/Code/Include/LyShine/UiAssetTypes.h diff --git a/Gems/LyShine/Code/lyshine_static_files.cmake b/Gems/LyShine/Code/lyshine_static_files.cmake index 925658e756..c1515f5978 100644 --- a/Gems/LyShine/Code/lyshine_static_files.cmake +++ b/Gems/LyShine/Code/lyshine_static_files.cmake @@ -11,6 +11,7 @@ set(FILES Include/LyShine/IRenderGraph.h Include/LyShine/ISprite.h Include/LyShine/ILyShine.h + Include/LyShine/UiAssetTypes.h Include/LyShine/UiBase.h Include/LyShine/UiLayoutCellBase.h Include/LyShine/UiSerializeHelpers.h @@ -26,6 +27,7 @@ set(FILES Include/LyShine/Bus/UiCanvasManagerBus.h Include/LyShine/Bus/UiCanvasUpdateNotificationBus.h Include/LyShine/Bus/UiCheckboxBus.h + Include/LyShine/Bus/UiCursorBus.h Include/LyShine/Bus/UiDraggableBus.h Include/LyShine/Bus/UiDropdownBus.h Include/LyShine/Bus/UiDropdownOptionBus.h From 54de15b0ecd555a481c24f569e382d8a1e514ad0 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Tue, 18 Jan 2022 16:34:58 -0800 Subject: [PATCH 539/948] Adding '.network.spawnable' as a network constant Signed-off-by: Gene Walters --- .../Code/Include/Multiplayer/MultiplayerConstants.h | 1 + .../Code/Source/NetworkEntity/NetworkSpawnableLibrary.cpp | 3 ++- .../Code/Source/Pipeline/NetworkPrefabProcessor.cpp | 3 ++- Gems/Multiplayer/Code/Tests/PrefabProcessingTests.cpp | 3 ++- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Gems/Multiplayer/Code/Include/Multiplayer/MultiplayerConstants.h b/Gems/Multiplayer/Code/Include/Multiplayer/MultiplayerConstants.h index 4471aa0c2b..3a4a9b1f58 100644 --- a/Gems/Multiplayer/Code/Include/Multiplayer/MultiplayerConstants.h +++ b/Gems/Multiplayer/Code/Include/Multiplayer/MultiplayerConstants.h @@ -20,6 +20,7 @@ namespace Multiplayer constexpr AZStd::string_view MpNetworkInterfaceName("MultiplayerNetworkInterface"); constexpr AZStd::string_view MpEditorInterfaceName("MultiplayerEditorNetworkInterface"); constexpr AZStd::string_view LocalHost("127.0.0.1"); + constexpr AZStd::string_view NetworkSpawnableFileExtension(".network.spawnable"); constexpr uint16_t DefaultServerPort = 33450; constexpr uint16_t DefaultServerEditorPort = 33451; diff --git a/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.cpp b/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.cpp index 7fb7bfdc39..e668d43267 100644 --- a/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.cpp +++ b/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.cpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace Multiplayer { @@ -42,7 +43,7 @@ namespace Multiplayer auto enumerateCallback = [this](const AZ::Data::AssetId id, const AZ::Data::AssetInfo& info) { if (info.m_assetType == AZ::AzTypeInfo::Uuid() && - info.m_relativePath.ends_with(".network.spawnable")) + info.m_relativePath.ends_with(NetworkSpawnableFileExtension)) { ProcessSpawnableAsset(info.m_relativePath, id); } diff --git a/Gems/Multiplayer/Code/Source/Pipeline/NetworkPrefabProcessor.cpp b/Gems/Multiplayer/Code/Source/Pipeline/NetworkPrefabProcessor.cpp index a797523bc0..9d6c47bb00 100644 --- a/Gems/Multiplayer/Code/Source/Pipeline/NetworkPrefabProcessor.cpp +++ b/Gems/Multiplayer/Code/Source/Pipeline/NetworkPrefabProcessor.cpp @@ -8,6 +8,7 @@ #include #include +#include #include #include @@ -95,7 +96,7 @@ namespace Multiplayer using namespace AzToolsFramework::Prefab; AZStd::string uniqueName = prefab.GetName(); - uniqueName += ".network.spawnable"; + uniqueName += NetworkSpawnableFileExtension; auto serializer = [serializationFormat](AZStd::vector& output, const ProcessedObjectStore& object) -> bool { AZ::IO::ByteContainerStream stream(&output); diff --git a/Gems/Multiplayer/Code/Tests/PrefabProcessingTests.cpp b/Gems/Multiplayer/Code/Tests/PrefabProcessingTests.cpp index aef13fbfe2..32be828686 100644 --- a/Gems/Multiplayer/Code/Tests/PrefabProcessingTests.cpp +++ b/Gems/Multiplayer/Code/Tests/PrefabProcessingTests.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include namespace UnitTest @@ -92,7 +93,7 @@ namespace UnitTest // Verify the name and the type of the spawnable asset const AZ::Data::AssetData& spawnableAsset = processedObjects[0].GetAsset(); - EXPECT_EQ(prefabName + ".network.spawnable", processedObjects[0].GetId()); + EXPECT_EQ(prefabName + Multiplayer::NetworkSpawnableFileExtension.data(), processedObjects[0].GetId()); EXPECT_EQ(spawnableAsset.GetType(), azrtti_typeid()); // Verify we have only the networked entity in the network spawnable and not the static one From 45429872d60d79c1daa8b7957e967cc2526e642a Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Tue, 18 Jan 2022 17:39:44 -0800 Subject: [PATCH 540/948] Switched back to making MaterialAsset::GetPropertyValues automatically finalize the material asset. I realized that it's too burdensome to expect client code to call Finalize on the MaterialAsset; every code that calls GetPropertyValues would have to call Finalize(). Instead of using const_cast in GetPropertyValues like I was doing before, I just changed GetPropertyValues to be a non-const function. There were a few places in Decal code I had to update to pass non-const MaterialAsset pointers. This isn't ideal, but I think it's better than the alternatives. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../Code/Source/Decals/DecalTextureArray.cpp | 6 +- .../Code/Source/Decals/DecalTextureArray.h | 2 +- .../DecalTextureArrayFeatureProcessor.cpp | 6 +- .../DecalTextureArrayFeatureProcessor.h | 2 +- .../Atom/RPI.Reflect/Material/MaterialAsset.h | 29 ++++----- .../RPI.Builders/Material/MaterialBuilder.cpp | 2 +- .../Model/MaterialAssetBuilderComponent.cpp | 2 +- .../Source/RPI.Public/Material/Material.cpp | 2 - .../RPI.Reflect/Material/MaterialAsset.cpp | 35 ++++++----- .../Material/MaterialAssetCreator.cpp | 2 + .../Tests/Material/MaterialAssetTests.cpp | 61 +++++++++++++++++-- .../Material/MaterialSourceDataTests.cpp | 41 +++++-------- 12 files changed, 118 insertions(+), 72 deletions(-) diff --git a/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArray.cpp b/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArray.cpp index 36a59bd07f..56ff1648d4 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArray.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArray.cpp @@ -49,7 +49,7 @@ namespace AZ } // Extract exactly which texture asset we need to load from the given material and map type (diffuse, normal, etc). - static AZ::Data::Asset GetStreamingImageAsset(const AZ::RPI::MaterialAsset& materialAsset, const AZ::Name& propertyName) + static AZ::Data::Asset GetStreamingImageAsset(AZ::RPI::MaterialAsset& materialAsset, const AZ::Name& propertyName) { if (!materialAsset.IsReady()) { @@ -84,7 +84,7 @@ namespace AZ static AZ::Data::Asset GetStreamingImageAsset(const AZ::Data::Asset materialAssetData, const AZ::Name& propertyName) { AZ_Assert(materialAssetData->IsReady(), "GetStreamingImageAsset() called with AssetData that is not ready."); - const AZ::RPI::MaterialAsset* materialAsset = materialAssetData.GetAs(); + AZ::RPI::MaterialAsset* materialAsset = materialAssetData.GetAs(); return GetStreamingImageAsset(*materialAsset, propertyName); } } @@ -141,7 +141,7 @@ namespace AZ return m_textureArrayPacked[mapType]; } - bool DecalTextureArray::IsValidDecalMaterial(const AZ::RPI::MaterialAsset& materialAsset) + bool DecalTextureArray::IsValidDecalMaterial(AZ::RPI::MaterialAsset& materialAsset) { return GetStreamingImageAsset(materialAsset, GetMapName(DecalMapType_Diffuse)).IsReady(); } diff --git a/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArray.h b/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArray.h index 97bd8b9cbe..39e66176fd 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArray.h +++ b/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArray.h @@ -57,7 +57,7 @@ namespace AZ // often different (BC5 for normals, BC7 for diffuse, etc) const Data::Instance& GetPackedTexture(const DecalMapType mapType) const; - static bool IsValidDecalMaterial(const RPI::MaterialAsset& materialAsset); + static bool IsValidDecalMaterial(RPI::MaterialAsset& materialAsset); private: diff --git a/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArrayFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArrayFeatureProcessor.cpp index 393104907a..c6b4d4e754 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArrayFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArrayFeatureProcessor.cpp @@ -25,7 +25,7 @@ namespace AZ { namespace { - static AZ::RHI::Size GetTextureSizeFromMaterialAsset(const AZ::RPI::MaterialAsset* materialAsset) + static AZ::RHI::Size GetTextureSizeFromMaterialAsset(AZ::RPI::MaterialAsset* materialAsset) { for (const auto& elem : materialAsset->GetPropertyValues()) { @@ -375,7 +375,7 @@ namespace AZ } } - AZStd::optional DecalTextureArrayFeatureProcessor::AddMaterialToTextureArrays(const AZ::RPI::MaterialAsset* materialAsset) + AZStd::optional DecalTextureArrayFeatureProcessor::AddMaterialToTextureArrays(AZ::RPI::MaterialAsset* materialAsset) { const RHI::Size textureSize = GetTextureSizeFromMaterialAsset(materialAsset); @@ -410,7 +410,7 @@ namespace AZ AZ_PROFILE_SCOPE(AzRender, "DecalTextureArrayFeatureProcessor: OnAssetReady"); const Data::AssetId& assetId = asset->GetId(); - const RPI::MaterialAsset* materialAsset = asset.GetAs(); + RPI::MaterialAsset* materialAsset = asset.GetAs(); const bool validDecalMaterial = materialAsset && DecalTextureArray::IsValidDecalMaterial(*materialAsset); if (validDecalMaterial) { diff --git a/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArrayFeatureProcessor.h b/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArrayFeatureProcessor.h index fd535bbe64..bdd1739ebb 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArrayFeatureProcessor.h +++ b/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArrayFeatureProcessor.h @@ -111,7 +111,7 @@ namespace AZ void CacheShaderIndices(); // This call could fail (returning nullopt) if we run out of texture arrays - AZStd::optional AddMaterialToTextureArrays(const AZ::RPI::MaterialAsset* materialAsset); + AZStd::optional AddMaterialToTextureArrays(AZ::RPI::MaterialAsset* materialAsset); int FindTextureArrayWithSize(const RHI::Size& size) const; void RemoveMaterialFromDecal(const uint16_t decalIndex); diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAsset.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAsset.h index 941fcd0fe9..b7cc51dcc4 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAsset.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialAsset.h @@ -102,16 +102,6 @@ namespace AZ //! Returns a layout that includes a list of MaterialPropertyDescriptors for each material property. const MaterialPropertiesLayout* GetMaterialPropertiesLayout() const; - //! Returns whether the material's properties are fully processed or not. - //! If true, property values can be accessed through GetPropertyValues(). - //! If false, property values can be accessed through GetRawPropertyValues(). - bool IsFinalized() const; - - //! If the material asset is not finalized yet, this does the final processing of the raw property values to - //! get the material asset ready to be used. - //! Note the MaterialTypeAsset must be valid before this is called. - void Finalize(AZStd::function reportWarning = nullptr, AZStd::function reportError = nullptr); - //! Returns the list of values for all properties in this material. //! The entries in this list align with the entries in the MaterialPropertiesLayout. Each AZStd::any is guaranteed //! to have a value of type that matches the corresponding MaterialPropertyDescriptor. @@ -122,19 +112,26 @@ namespace AZ //! //! Calling GetPropertyValues() will automatically finalize the material asset if it isn't finalized already. The //! MaterialTypeAsset must be loaded and ready. - const AZStd::vector& GetPropertyValues() const; - + const AZStd::vector& GetPropertyValues(); + + //! Returns true if material was created in a finalize state, as opposed to being finalized after loading from disk. + bool WasPreFinalized() const; + //! Returns the list of raw values for all properties in this material, as listed in the source .material file(s), before the material asset was Finalized. //! //! The MaterialAsset can be created in a "half-baked" state (see MaterialUtils::BuildersShouldFinalizeMaterialAssets) where //! minimal processing has been done because it did not yet have access to the MaterialTypeAsset. In that case, the list will //! be populated with values copied from the source .material file with little or no validation or other processing. It includes //! all parent .material files, with properties listed in low-to-high priority order. - //! This list will be empty however if the asset was finalized at build-time. + //! This list will be empty however if the asset was finalized at build-time (i.e. WasPreFinalized() returns true). const AZStd::vector>& GetRawPropertyValues() const; private: bool PostLoadInit() override; + + //! If the material asset is not finalized yet, this does the final processing of the raw property values to get the material asset ready to be used. + //! MaterialTypeAsset must be valid before this is called. + void Finalize(AZStd::function reportWarning = nullptr, AZStd::function reportError = nullptr); //! Checks the material type version and potentially applies a series of property changes (most common are simple property renames) //! based on the MaterialTypeAsset's version update procedure. @@ -159,7 +156,7 @@ namespace AZ //! Holds values for each material property, used to initialize Material instances. //! This is indexed by MaterialPropertyIndex and aligns with entries in m_materialPropertiesLayout. - AZStd::vector m_propertyValues; + mutable AZStd::vector m_propertyValues; //! The MaterialAsset can be created in a "half-baked" state where minimal processing has been done because it does //! not yet have access to the MaterialTypeAsset. In that case, this list will be populated with values copied from @@ -175,10 +172,10 @@ namespace AZ AZStd::vector> m_rawPropertyValues; //! Tracks whether Finalize() has been called, meaning m_propertyValues is populated with data matching the material type's property layout. - bool m_isFinalized = false; + //! (This value is intentionally not serialized, it is set by the Finalize() function) + mutable bool m_isFinalized = false; //! Tracks whether the MaterialAsset was already in a finalized state when it was loaded. - //! (This value is intentionally not serialized) bool m_wasPreFinalized = false; //! The materialTypeVersion this materialAsset was based off. If the versions do not match at runtime when a diff --git a/Gems/Atom/RPI/Code/Source/RPI.Builders/Material/MaterialBuilder.cpp b/Gems/Atom/RPI/Code/Source/RPI.Builders/Material/MaterialBuilder.cpp index cedbb1df6e..768890a29b 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Builders/Material/MaterialBuilder.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Builders/Material/MaterialBuilder.cpp @@ -52,7 +52,7 @@ namespace AZ { AssetBuilderSDK::AssetBuilderDesc materialBuilderDescriptor; materialBuilderDescriptor.m_name = JobKey; - materialBuilderDescriptor.m_version = 114; // material dependency improvements + materialBuilderDescriptor.m_version = 115; // material dependency improvements updated materialBuilderDescriptor.m_patterns.push_back(AssetBuilderSDK::AssetBuilderPattern("*.material", AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard)); materialBuilderDescriptor.m_patterns.push_back(AssetBuilderSDK::AssetBuilderPattern("*.materialtype", AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard)); materialBuilderDescriptor.m_busId = azrtti_typeid(); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MaterialAssetBuilderComponent.cpp b/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MaterialAssetBuilderComponent.cpp index a44b47ee6c..9a92e7b762 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MaterialAssetBuilderComponent.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MaterialAssetBuilderComponent.cpp @@ -128,7 +128,7 @@ namespace AZ if (auto* serialize = azrtti_cast(context)) { serialize->Class() - ->Version(20); // material dependency improvements + ->Version(21); // material dependency improvements updated } } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Material/Material.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Material/Material.cpp index fe9dbef278..1f739c24f1 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Material/Material.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Material/Material.cpp @@ -62,8 +62,6 @@ namespace AZ m_materialAsset = { &materialAsset, AZ::Data::AssetLoadBehavior::PreLoad }; - m_materialAsset->Finalize(); - // Cache off pointers to some key data structures from the material type... auto srgLayout = m_materialAsset->GetMaterialSrgLayout(); if (srgLayout) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp index 0325c3ac38..309daf8b62 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp @@ -33,12 +33,12 @@ namespace AZ if (auto* serializeContext = azrtti_cast(context)) { serializeContext->Class() - ->Version(13) // added m_rawPropertyValues + ->Version(14) // added m_rawPropertyValues ->Field("materialTypeAsset", &MaterialAsset::m_materialTypeAsset) ->Field("materialTypeVersion", &MaterialAsset::m_materialTypeVersion) ->Field("propertyValues", &MaterialAsset::m_propertyValues) ->Field("rawPropertyValues", &MaterialAsset::m_rawPropertyValues) - ->Field("isFinalized", &MaterialAsset::m_isFinalized) + ->Field("finalized", &MaterialAsset::m_wasPreFinalized) ; } } @@ -104,19 +104,19 @@ namespace AZ return m_materialTypeAsset->GetMaterialPropertiesLayout(); } - bool MaterialAsset::IsFinalized() const + bool MaterialAsset::WasPreFinalized() const { - if (m_isFinalized) - { - AZ_Assert(GetMaterialPropertiesLayout() && m_propertyValues.size() == GetMaterialPropertiesLayout()->GetPropertyCount(), "MaterialAsset is marked as Finalized but does not have the right number of property values."); - } - - return m_isFinalized; + return m_wasPreFinalized; } void MaterialAsset::Finalize(AZStd::function reportWarning, AZStd::function reportError) { - if (IsFinalized()) + if (m_wasPreFinalized) + { + m_isFinalized = true; + } + + if (m_isFinalized) { return; } @@ -197,10 +197,18 @@ namespace AZ m_isFinalized = true; } - const AZStd::vector& MaterialAsset::GetPropertyValues() const + const AZStd::vector& MaterialAsset::GetPropertyValues() { - AZ_Error(s_debugTraceName, IsFinalized(), "MaterialAsset must be finalized before its property values can be accessed"); - + // This can't be done in MaterialAssetHandler::LoadAssetData because the MaterialTypeAsset isn't necessarily loaded at that point. + // And it can't be done in PostLoadInit() because that happens on the next frame which might be too late. + // And overriding AssetHandler::InitAsset in MaterialAssetHandler didn't work, because there seems to be non-determinism on the order + // of InitAsset calls when a ModelAsset references a MaterialAsset, the model gets initialized first and then fails to use the material. + // So we finalize just-in-time when properties are accessed. + // If we could solve the problem with InitAsset, that would be the ideal place to call Finalize() and we could make GetPropertyValues() const again. + Finalize(); + + AZ_Assert(GetMaterialPropertiesLayout() && m_propertyValues.size() == GetMaterialPropertiesLayout()->GetPropertyCount(), "MaterialAsset should be finalized but does not have the right number of property values."); + return m_propertyValues; } @@ -334,7 +342,6 @@ namespace AZ if (Base::LoadAssetData(asset, stream, assetLoadFilterCB) == Data::AssetHandler::LoadResult::LoadComplete) { asset.GetAs()->AssetInitBus::Handler::BusConnect(); - asset.GetAs()->m_wasPreFinalized = asset.GetAs()->m_isFinalized; return Data::AssetHandler::LoadResult::LoadComplete; } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAssetCreator.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAssetCreator.cpp index 7d4ecf0b18..872e4ad754 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAssetCreator.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAssetCreator.cpp @@ -49,6 +49,8 @@ namespace AZ [this](const char* message) { ReportWarning("%s", message); }, [this](const char* message) { ReportError("%s", message); }); + m_asset->m_wasPreFinalized = true; + // Finalize() doesn't clear the raw property data because that's the same function used at runtime, which does need to maintain the raw data // to support hot reload. But here we are pre-baking with the assumption that AP build dependencies will keep the material type // and material asset in sync, so we can discard the raw property data and just rely on the data in the material type asset. diff --git a/Gems/Atom/RPI/Code/Tests/Material/MaterialAssetTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/MaterialAssetTests.cpp index fdb131d449..61e1283f52 100644 --- a/Gems/Atom/RPI/Code/Tests/Material/MaterialAssetTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Material/MaterialAssetTests.cpp @@ -111,6 +111,10 @@ namespace UnitTest EXPECT_EQ(assetId, materialAsset->GetId()); EXPECT_EQ(Data::AssetData::AssetStatus::Ready, materialAsset->GetStatus()); + + EXPECT_TRUE(materialAsset->WasPreFinalized()); + EXPECT_EQ(0, materialAsset->GetRawPropertyValues().size()); + validate(materialAsset); // Also test serialization... @@ -123,6 +127,57 @@ namespace UnitTest Data::Asset serializedAsset = tester.SerializeIn(Data::AssetId(Uuid::CreateRandom()), noAssets); validate(serializedAsset); } + + TEST_F(MaterialAssetTests, DeferredFinalize) + { + Data::AssetId assetId(Uuid::CreateRandom()); + + MaterialAssetCreator creator; + bool shouldFinalize = false; + creator.Begin(assetId, m_testMaterialTypeAsset, shouldFinalize); + + creator.SetPropertyValue(Name{ "MyFloat2" }, Vector2{ 0.1f, 0.2f }); + creator.SetPropertyValue(Name{ "MyFloat3" }, Vector3{ 1.1f, 1.2f, 1.3f }); + creator.SetPropertyValue(Name{ "MyFloat4" }, Vector4{ 2.1f, 2.2f, 2.3f, 2.4f }); + creator.SetPropertyValue(Name{ "MyColor" }, Color{ 1.0f, 1.0f, 1.0f, 1.0f }); + creator.SetPropertyValue(Name{ "MyInt" }, -2); + creator.SetPropertyValue(Name{ "MyUInt" }, 12u); + creator.SetPropertyValue(Name{ "MyFloat" }, 1.5f); + creator.SetPropertyValue(Name{ "MyBool" }, true); + creator.SetPropertyValue(Name{ "MyImage" }, m_testImageAsset); + creator.SetPropertyValue(Name{ "MyEnum" }, 1u); + + Data::Asset materialAsset; + EXPECT_TRUE(creator.End(materialAsset)); + + EXPECT_FALSE(materialAsset->WasPreFinalized()); + EXPECT_EQ(10, materialAsset->GetRawPropertyValues().size()); + + // Also test serialization... + + SerializeTester tester(GetSerializeContext()); + tester.SerializeOut(materialAsset.Get()); + + // Using a filter that skips loading assets because we are using a dummy image asset + ObjectStream::FilterDescriptor noAssets{ AZ::Data::AssetFilterNoAssetLoading }; + Data::Asset serializedAsset = tester.SerializeIn(Data::AssetId(Uuid::CreateRandom()), noAssets); + + EXPECT_FALSE(materialAsset->WasPreFinalized()); + EXPECT_EQ(10, materialAsset->GetRawPropertyValues().size()); + + // GetPropertyValues() will automatically finalize the material asset, so we can go ahead and check the property values. + EXPECT_EQ(materialAsset->GetPropertyValues().size(), 10); + EXPECT_EQ(materialAsset->GetPropertyValues()[0].GetValue(), true); + EXPECT_EQ(materialAsset->GetPropertyValues()[1].GetValue(), -2); + EXPECT_EQ(materialAsset->GetPropertyValues()[2].GetValue(), 12); + EXPECT_EQ(materialAsset->GetPropertyValues()[3].GetValue(), 1.5f); + EXPECT_EQ(materialAsset->GetPropertyValues()[4].GetValue(), Vector2(0.1f, 0.2f)); + EXPECT_EQ(materialAsset->GetPropertyValues()[5].GetValue(), Vector3(1.1f, 1.2f, 1.3f)); + EXPECT_EQ(materialAsset->GetPropertyValues()[6].GetValue(), Vector4(2.1f, 2.2f, 2.3f, 2.4f)); + EXPECT_EQ(materialAsset->GetPropertyValues()[7].GetValue(), Color(1.0f, 1.0f, 1.0f, 1.0f)); + EXPECT_EQ(materialAsset->GetPropertyValues()[8].GetValue>(), m_testImageAsset); + EXPECT_EQ(materialAsset->GetPropertyValues()[9].GetValue(), 1u); + } TEST_F(MaterialAssetTests, PropertyDefaultValuesComeFromParentMaterial) { @@ -267,15 +322,13 @@ namespace UnitTest warningFinder.AddExpectedErrorMessage("This material is based on version '1'"); warningFinder.AddExpectedErrorMessage("material type is now at version '2'"); - materialAsset->Finalize(); - - warningFinder.CheckExpectedErrorsFound(); - // Even though this material was created using the old version of the material type, it's property values should get automatically // updated to align with the new property layout in the latest MaterialTypeAsset. MaterialPropertyIndex myIntIndex = materialAsset->GetMaterialPropertiesLayout()->FindPropertyIndex(Name{"MyIntRenamed"}); EXPECT_EQ(2, myIntIndex.GetIndex()); EXPECT_EQ(7, materialAsset->GetPropertyValues()[myIntIndex.GetIndex()].GetValue()); + + warningFinder.CheckExpectedErrorsFound(); // Since the MaterialAsset has already been updated, and the warning reported once, we should not see the "consider updating" // warning reported again on subsequent property accesses. diff --git a/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp index 29f0e7d101..ef89e0138c 100644 --- a/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp @@ -182,7 +182,7 @@ namespace UnitTest Data::Asset materialAsset = materialAssetOutcome.GetValue(); - EXPECT_TRUE(materialAsset->IsFinalized()); + EXPECT_TRUE(materialAsset->WasPreFinalized()); EXPECT_EQ(0, materialAsset->GetRawPropertyValues().size()); // A pre-baked material has no need for the original raw property names and values // The order here is based on the order in the MaterialTypeSourceData, as added to the MaterialTypeAssetCreator. @@ -227,14 +227,10 @@ namespace UnitTest EXPECT_TRUE(materialAssetOutcome.IsSuccess()); Data::Asset materialAsset = materialAssetOutcome.GetValue(); - - ErrorMessageFinder expectNotFinalizedError("MaterialAsset must be finalized"); - EXPECT_FALSE(materialAsset->IsFinalized()); + EXPECT_FALSE(materialAsset->WasPreFinalized()); - expectNotFinalizedError.ResetCounts(); - EXPECT_TRUE(materialAsset->GetPropertyValues().empty()); - expectNotFinalizedError.CheckExpectedErrorsFound(); + // Note we avoid calling GetPropertyValues() because that will auto-finalize the material. We want to check its raw property values first. auto findRawPropertyValue = [materialAsset](const char* propertyId) { @@ -279,16 +275,10 @@ namespace UnitTest SerializeTester tester(GetSerializeContext()); tester.SerializeOut(materialAsset.Get()); materialAsset = tester.SerializeIn(Uuid::CreateRandom(), ObjectStream::FilterDescriptor{AZ::Data::AssetFilterNoAssetLoading}); - - // We check that everything is still in the original un-finalized state after going through the serialization process. - EXPECT_FALSE(materialAsset->IsFinalized()); - checkRawPropertyValues(); - expectNotFinalizedError.ResetCounts(); - EXPECT_TRUE(materialAsset->GetPropertyValues().empty()); - expectNotFinalizedError.CheckExpectedErrorsFound(); - materialAsset->Finalize(); - EXPECT_TRUE(materialAsset->IsFinalized()); + // We check that the asset is still in the original un-finalized state after going through the serialization process. + EXPECT_FALSE(materialAsset->WasPreFinalized()); + checkRawPropertyValues(); // Now all the property values should be available through the main GetPropertyValues() API. EXPECT_EQ(materialAsset->GetPropertyValues()[0].GetValue(), true); @@ -301,8 +291,9 @@ namespace UnitTest EXPECT_EQ(materialAsset->GetPropertyValues()[7].GetValue(), Color(0.1f, 0.2f, 0.3f, 0.4f)); EXPECT_EQ(materialAsset->GetPropertyValues()[8].GetValue>(), m_testImageAsset); EXPECT_EQ(materialAsset->GetPropertyValues()[9].GetValue(), 1u); - + // The raw property values are still available (because they are needed if a hot-reload of the MaterialTypeAsset occurs) + EXPECT_FALSE(materialAsset->WasPreFinalized()); checkRawPropertyValues(); } @@ -659,19 +650,19 @@ namespace UnitTest auto materialAssetLevel1 = sourceDataLevel1.CreateMaterialAsset(Uuid::CreateRandom(), "", MaterialAssetProcessingMode::PreBake, true); EXPECT_TRUE(materialAssetLevel1.IsSuccess()); - EXPECT_TRUE(materialAssetLevel1.GetValue()->IsFinalized()); + EXPECT_TRUE(materialAssetLevel1.GetValue()->WasPreFinalized()); m_assetSystemStub.RegisterSourceInfo("level1.material", materialAssetLevel1.GetValue().GetId()); auto materialAssetLevel2 = sourceDataLevel2.CreateMaterialAsset(Uuid::CreateRandom(), "", MaterialAssetProcessingMode::PreBake, true); EXPECT_TRUE(materialAssetLevel2.IsSuccess()); - EXPECT_TRUE(materialAssetLevel2.GetValue()->IsFinalized()); + EXPECT_TRUE(materialAssetLevel2.GetValue()->WasPreFinalized()); m_assetSystemStub.RegisterSourceInfo("level2.material", materialAssetLevel2.GetValue().GetId()); auto materialAssetLevel3 = sourceDataLevel3.CreateMaterialAsset(Uuid::CreateRandom(), "", MaterialAssetProcessingMode::PreBake, true); EXPECT_TRUE(materialAssetLevel3.IsSuccess()); - EXPECT_TRUE(materialAssetLevel3.GetValue()->IsFinalized()); + EXPECT_TRUE(materialAssetLevel3.GetValue()->WasPreFinalized()); auto layout = m_testMaterialTypeAsset->GetMaterialPropertiesLayout(); MaterialPropertyIndex myFloat = layout->FindPropertyIndex(Name("general.MyFloat")); @@ -731,21 +722,21 @@ namespace UnitTest auto materialAssetLevel1Result = sourceDataLevel1.CreateMaterialAsset(Uuid::CreateRandom(), "", MaterialAssetProcessingMode::DeferredBake, true); EXPECT_TRUE(materialAssetLevel1Result.IsSuccess()); Data::Asset materialAssetLevel1 = materialAssetLevel1Result.TakeValue(); - EXPECT_FALSE(materialAssetLevel1->IsFinalized()); + EXPECT_FALSE(materialAssetLevel1->WasPreFinalized()); m_assetSystemStub.RegisterSourceInfo("level1.material", materialAssetLevel1.GetId()); auto materialAssetLevel2Result = sourceDataLevel2.CreateMaterialAsset(Uuid::CreateRandom(), "", MaterialAssetProcessingMode::DeferredBake, true); EXPECT_TRUE(materialAssetLevel2Result.IsSuccess()); Data::Asset materialAssetLevel2 = materialAssetLevel2Result.TakeValue(); - EXPECT_FALSE(materialAssetLevel2->IsFinalized()); + EXPECT_FALSE(materialAssetLevel2->WasPreFinalized()); m_assetSystemStub.RegisterSourceInfo("level2.material", materialAssetLevel2.GetId()); auto materialAssetLevel3Result = sourceDataLevel3.CreateMaterialAsset(Uuid::CreateRandom(), "", MaterialAssetProcessingMode::DeferredBake, true); EXPECT_TRUE(materialAssetLevel3Result.IsSuccess()); Data::Asset materialAssetLevel3 = materialAssetLevel3Result.TakeValue(); - EXPECT_FALSE(materialAssetLevel3->IsFinalized()); + EXPECT_FALSE(materialAssetLevel3->WasPreFinalized()); // Now we'll create the material type asset in memory so the materials will have what they need to finalize. Data::Asset testMaterialTypeAsset = CreateTestMaterialTypeAsset(materialTypeAssetId); @@ -766,9 +757,7 @@ namespace UnitTest tester.SerializeOut(materialAssetLevel3.Get()); materialAssetLevel3 = tester.SerializeIn(Uuid::CreateRandom(), ObjectStream::FilterDescriptor{AZ::Data::AssetFilterNoAssetLoading}); - materialAssetLevel1->Finalize(); - materialAssetLevel2->Finalize(); - materialAssetLevel3->Finalize(); + // The properties will finalize automatically when we call GetPropertyValues()... AZStd::array_view properties; From a896ff11bc3aa8f13696e078e66fee1dbcf269ae Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Fri, 14 Jan 2022 12:57:52 -0800 Subject: [PATCH 541/948] Changed .material serialization to avoid loading the .materialtype file, since the .material builder doesn't declare a source dependency on the .materialtype. Otherwise there can be ambiguous edge cases where changes to the .materialtype might or might not impact the baked MaterialAsset. Note that another option would have been to add a the appropriate source dependency, but that would hurt iteration time as any change to the .materialtype file would cause every .material file and .fbx to rebuild. These changes have the added benefit of simplifying some of the serialization code. MaterialSourceDataSerializer is no longer needed, as its main purpose was to pass the MaterialTypeSourceData down to the MaterialPropertyValueSerializer. Before, the JSON serialization system gave a lot of data flexibility because it did best-effort conversions, like allowing a float to be loaded as an int for example. But now the material serialization code doesn't know target data type, so it has to assume the data type based on what's in the .material file, and then the MaterialAsset will convert the data to the appropriate type later when Finalize() is called. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../MaterialPropertyValueSerializer.h | 7 - .../MaterialPropertyValueSourceData.h | 2 +- .../Material/MaterialSourceDataSerializer.h | 40 -- .../Material/MaterialTypeSourceData.h | 6 +- .../MaterialPropertyValueSerializer.cpp | 102 +++-- .../RPI.Edit/Material/MaterialSourceData.cpp | 21 +- .../Material/MaterialSourceDataSerializer.cpp | 162 ------- .../Material/MaterialTypeSourceData.cpp | 11 +- .../RPI.Reflect/Material/MaterialAsset.cpp | 132 +++++- .../Tests/Material/MaterialAssetTests.cpp | 32 +- .../Material/MaterialSourceDataTests.cpp | 406 ++++++++++-------- Gems/Atom/RPI/Code/atom_rpi_edit_files.cmake | 2 - 12 files changed, 446 insertions(+), 477 deletions(-) delete mode 100644 Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialSourceDataSerializer.h delete mode 100644 Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceDataSerializer.cpp diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyValueSerializer.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyValueSerializer.h index 29371618cf..befbb7c990 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyValueSerializer.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyValueSerializer.h @@ -24,13 +24,6 @@ namespace AZ AZ_RTTI(AZ::RPI::JsonMaterialPropertyValueSerializer, "{A52B1ED8-C849-4269-9AA7-9D0814D2EC59}", BaseJsonSerializer); AZ_CLASS_ALLOCATOR_DECL; - //! A LoadContext object must be passed down to the serializer via JsonDeserializerContext::GetMetadata().Add(...) - struct LoadContext - { - AZ_TYPE_INFO(JsonMaterialPropertyValueSerializer::LoadContext, "{5E0A891A-27F6-4AD7-88A5-B9EA50F88B45}"); - uint32_t m_materialTypeVersion; //!< The version number from the .materialtype file - }; - JsonSerializationResult::Result Load(void* outputValue, const Uuid& outputValueTypeId, const rapidjson::Value& inputValue, JsonDeserializerContext& context) override; diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyValueSourceData.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyValueSourceData.h index 178cacba15..a0640a1522 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyValueSourceData.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialPropertyValueSourceData.h @@ -54,7 +54,7 @@ namespace AZ //! The resolved value with a valid type of a property. It needs to be mutable to allow post-resolving when parent objects are declared as const. mutable MaterialPropertyValue m_resolvedValue; //! Candidate values from serialization. - AZStd::map m_possibleValues; + AZStd::map m_possibleValues; }; } // namespace RPI } // namespace AZ diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialSourceDataSerializer.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialSourceDataSerializer.h deleted file mode 100644 index 301b80ed82..0000000000 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialSourceDataSerializer.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#pragma once - -#include -#include - -namespace AZ -{ - class ReflectContext; - - namespace RPI - { - //! This custom serializer is needed to load the material type file and saves its data in the - //! JsonDeserializerSettings for JsonMaterialPropertyValueSerializer to use. - //! (Note we could have made a custom serializer specifically for the 'materialType' field but that - //! would require 'materialType' to appear before 'properties'. By having a custom serializer for the common - //! parent of 'materialType' and 'properties', we can avoid an order dependency within the JSON file). - class JsonMaterialSourceDataSerializer - : public BaseJsonSerializer - { - public: - AZ_RTTI(AZ::RPI::JsonMaterialSourceDataSerializer, "{008A7423-8DF6-4BA3-BF5E-B0C189CCBE58}", BaseJsonSerializer); - AZ_CLASS_ALLOCATOR_DECL; - - 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; - }; - - } // namespace RPI -} // namespace AZ diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h index f5336807c7..9333880594 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Material/MaterialTypeSourceData.h @@ -186,9 +186,8 @@ namespace AZ //! Searches for a specific property. //! Note this function can find properties using old versions of the property name; in that case, //! the name in the returned PropertyDefinition* will not match the @propertyName that was searched for. - //! @param materialTypeVersion indicates the version number of the property name being passed in. Only renames above this version number will be applied. //! @return the requested property, or null if it could not be found - const PropertyDefinition* FindProperty(AZStd::string_view groupName, AZStd::string_view propertyName, uint32_t materialTypeVersion = 0) const; + const PropertyDefinition* FindProperty(AZStd::string_view groupName, AZStd::string_view propertyName) const; //! Construct a complete list of group definitions, including implicit groups, arranged in the same order as the source data //! Groups with the same name will be consolidated into a single entry @@ -212,9 +211,8 @@ namespace AZ Outcome> CreateMaterialTypeAsset(Data::AssetId assetId, AZStd::string_view materialTypeSourceFilePath = "", bool elevateWarnings = true) const; //! Possibly renames @propertyId based on the material version update steps. - //! @param materialTypeVersion indicates the version number of the property name being passed in. Only renames above this version number will be applied. //! @return true if the property was renamed - bool ApplyPropertyRenames(MaterialPropertyId& propertyId, uint32_t materialTypeVersion = 0) const; + bool ApplyPropertyRenames(MaterialPropertyId& propertyId) const; }; //! The wrapper class for derived material functors. diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyValueSerializer.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyValueSerializer.cpp index 5e04365ffb..10b45ca8df 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyValueSerializer.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyValueSerializer.cpp @@ -8,7 +8,6 @@ #include #include -#include #include #include @@ -55,15 +54,6 @@ namespace AZ MaterialSourceData::Property* property = reinterpret_cast(outputValue); AZ_Assert(property, "Output value for JsonMaterialPropertyValueSerializer can't be null."); - const MaterialTypeSourceData* materialType = context.GetMetadata().Find(); - if (!materialType) - { - AZ_Assert(false, "Material type reference not found"); - return context.Report(JsonSerializationResult::Tasks::ReadField, JsonSerializationResult::Outcomes::Catastrophic, "Material type reference not found."); - } - - const JsonMaterialPropertyValueSerializer::LoadContext* loadContext = context.GetMetadata().Find(); - // Construct the full property name (groupName.propertyName) by parsing it from the JSON path string. size_t startPropertyName = context.GetPath().Get().rfind('/'); size_t startGroupName = context.GetPath().Get().rfind('/', startPropertyName-1); @@ -72,48 +62,70 @@ namespace AZ JSR::ResultCode result(JSR::Tasks::ReadField); - auto propertyDefinition = materialType->FindProperty(groupName, propertyName, loadContext->m_materialTypeVersion); - if (!propertyDefinition) + if (inputValue.IsBool()) { - AZStd::string message = AZStd::string::format("Property '%.*s.%.*s' not found in material type.", AZ_STRING_ARG(groupName), AZ_STRING_ARG(propertyName)); - return context.Report(JsonSerializationResult::Tasks::ReadField, JsonSerializationResult::Outcomes::Unsupported, message); + result.Combine(LoadVariant(property->m_value, false, inputValue, context)); } - else + else if (inputValue.IsInt() || inputValue.IsInt64()) + { + result.Combine(LoadVariant(property->m_value, 0, inputValue, context)); + } + else if (inputValue.IsUint() || inputValue.IsUint64()) + { + result.Combine(LoadVariant(property->m_value, 0u, inputValue, context)); + } + else if (inputValue.IsFloat() || inputValue.IsDouble()) + { + result.Combine(LoadVariant(property->m_value, 0.0f, inputValue, context)); + } + else if (inputValue.IsArray() && inputValue.Size() == 4) + { + result.Combine(LoadVariant(property->m_value, Vector4{0.0f, 0.0f, 0.0f, 0.0f}, inputValue, context)); + } + else if (inputValue.IsArray() && inputValue.Size() == 3) + { + result.Combine(LoadVariant(property->m_value, Vector3{0.0f, 0.0f, 0.0f}, inputValue, context)); + } + else if (inputValue.IsArray() && inputValue.Size() == 2) { - switch (propertyDefinition->m_dataType) + result.Combine(LoadVariant(property->m_value, Vector2{0.0f, 0.0f}, inputValue, context)); + } + else if (inputValue.IsObject()) + { + JsonSerializationResult::ResultCode resultCode = LoadVariant(property->m_value, Color::CreateZero(), inputValue, context); + + if(resultCode.GetProcessing() != JsonSerializationResult::Processing::Completed) + { + resultCode = LoadVariant(property->m_value, Vector4::CreateZero(), inputValue, context); + } + + if(resultCode.GetProcessing() != JsonSerializationResult::Processing::Completed) + { + resultCode = LoadVariant(property->m_value, Vector3::CreateZero(), inputValue, context); + } + + if(resultCode.GetProcessing() != JsonSerializationResult::Processing::Completed) + { + resultCode = LoadVariant(property->m_value, Vector2::CreateZero(), inputValue, context); + } + + if(resultCode.GetProcessing() == JsonSerializationResult::Processing::Completed) + { + result.Combine(resultCode); + } + else { - case MaterialPropertyDataType::Bool: - result.Combine(LoadVariant(property->m_value, false, inputValue, context)); - break; - case MaterialPropertyDataType::Int: - result.Combine(LoadVariant(property->m_value, 0, inputValue, context)); - break; - case MaterialPropertyDataType::UInt: - result.Combine(LoadVariant(property->m_value, 0u, inputValue, context)); - break; - case MaterialPropertyDataType::Float: - result.Combine(LoadVariant(property->m_value, 0.0f, inputValue, context)); - break; - case MaterialPropertyDataType::Vector2: - result.Combine(LoadVariant(property->m_value, Vector2{0.0f, 0.0f}, inputValue, context)); - break; - case MaterialPropertyDataType::Vector3: - result.Combine(LoadVariant(property->m_value, Vector3{0.0f, 0.0f, 0.0f}, inputValue, context)); - break; - case MaterialPropertyDataType::Vector4: - result.Combine(LoadVariant(property->m_value, Vector4{0.0f, 0.0f, 0.0f, 0.0f}, inputValue, context)); - break; - case MaterialPropertyDataType::Color: - result.Combine(LoadVariant(property->m_value, AZ::Colors::White, inputValue, context)); - break; - case MaterialPropertyDataType::Image: - case MaterialPropertyDataType::Enum: - result.Combine(LoadVariant(property->m_value, AZStd::string{}, inputValue, context)); - break; - default: return context.Report(JsonSerializationResult::Tasks::ReadField, JsonSerializationResult::Outcomes::Unsupported, "Unknown data type"); } } + else if (inputValue.IsString()) + { + result.Combine(LoadVariant(property->m_value, AZStd::string{}, inputValue, context)); + } + else + { + return context.Report(JsonSerializationResult::Tasks::ReadField, JsonSerializationResult::Outcomes::Unsupported, "Unknown data type"); + } if (result.GetProcessing() == JsonSerializationResult::Processing::Completed) { diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp index bc764ec7fb..b921b186c0 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceData.cpp @@ -8,7 +8,6 @@ #include #include -#include #include #include #include @@ -45,13 +44,17 @@ namespace AZ { if (JsonRegistrationContext* jsonContext = azrtti_cast(context)) { - jsonContext->Serializer()->HandlesType(); jsonContext->Serializer()->HandlesType(); } else if (auto* serializeContext = azrtti_cast(context)) { serializeContext->Class() - ->Version(1) + ->Version(2) + ->Field("description", &MaterialSourceData::m_description) + ->Field("materialType", &MaterialSourceData::m_materialType) + ->Field("materialTypeVersion", &MaterialSourceData::m_materialTypeVersion) + ->Field("parentMaterial", &MaterialSourceData::m_parentMaterial) + ->Field("properties", &MaterialSourceData::m_properties) ; serializeContext->RegisterGenericType(); @@ -80,6 +83,12 @@ namespace AZ MaterialAssetCreator materialAssetCreator; materialAssetCreator.SetElevateWarnings(elevateWarnings); + if (m_materialType.empty()) + { + AZ_Error("MaterialSourceData", false, "materialType was not specified"); + return Failure(); + } + Outcome materialTypeAssetId = AssetUtils::MakeAssetId(materialSourceFilePath, m_materialType, 0); if (!materialTypeAssetId) { @@ -194,6 +203,12 @@ namespace AZ bool elevateWarnings, AZStd::unordered_set* sourceDependencies) const { + if (m_materialType.empty()) + { + AZ_Error("MaterialSourceData", false, "materialType was not specified"); + return Failure(); + } + const auto materialTypeSourcePath = AssetUtils::ResolvePathReference(materialSourceFilePath, m_materialType); const auto materialTypeAssetId = AssetUtils::MakeAssetId(materialTypeSourcePath, 0); if (!materialTypeAssetId.IsSuccess()) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceDataSerializer.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceDataSerializer.cpp deleted file mode 100644 index 2a504fc345..0000000000 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialSourceDataSerializer.cpp +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -namespace AZ -{ - namespace RPI - { - AZ_CLASS_ALLOCATOR_IMPL(JsonMaterialSourceDataSerializer, SystemAllocator, 0); - - JsonSerializationResult::Result JsonMaterialSourceDataSerializer::Load(void* outputValue, const Uuid& outputValueTypeId, - const rapidjson::Value& inputValue, JsonDeserializerContext& context) - { - namespace JSR = JsonSerializationResult; - - AZ_Assert(azrtti_typeid() == outputValueTypeId, - "Unable to deserialize material to json because the provided type is %s", - outputValueTypeId.ToString().c_str()); - AZ_UNUSED(outputValueTypeId); - - MaterialSourceData* materialSourceData = reinterpret_cast(outputValue); - AZ_Assert(materialSourceData, "Output value for JsonMaterialSourceDataSerializer can't be null."); - - JSR::ResultCode result(JSR::Tasks::ReadField); - - if (!inputValue.IsObject()) - { - return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::Unsupported, "Material data must be a JSON object"); - } - - result.Combine(ContinueLoadingFromJsonObjectField(&materialSourceData->m_description, azrtti_typeid(), inputValue, "description", context)); - result.Combine(ContinueLoadingFromJsonObjectField(&materialSourceData->m_parentMaterial, azrtti_typeid(), inputValue, "parentMaterial", context)); - result.Combine(ContinueLoadingFromJsonObjectField(&materialSourceData->m_materialType, azrtti_typeid(), inputValue, "materialType", context)); - result.Combine(ContinueLoadingFromJsonObjectField(&materialSourceData->m_materialTypeVersion, azrtti_typeid(), inputValue, "materialTypeVersion", context)); - - if (materialSourceData->m_materialType.empty()) - { - return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::Catastrophic, "Required field 'materialType' is missing or invalid"); - } - - JsonFileLoadContext* jsonFileLoadContext = context.GetMetadata().Find(); - - if (!jsonFileLoadContext) - { - // Go ahead and create a JsonFileLoadContext because we'll need to use it below when loading the material type - context.GetMetadata().Add(JsonFileLoadContext{}); - jsonFileLoadContext = context.GetMetadata().Find(); - } - - // Load the material type file because we need the property type information in order to know how to read the property values - MaterialTypeSourceData materialTypeData; - { - AZStd::string materialTypePath = AssetUtils::ResolvePathReference(jsonFileLoadContext->GetFilePath(), materialSourceData->m_materialType); - - auto materialTypeJson = JsonSerializationUtils::ReadJsonFile(materialTypePath, AZ::RPI::JsonUtils::DefaultMaxFileSize); - if (!materialTypeJson.IsSuccess()) - { - AZStd::string failureMessage; - failureMessage = AZStd::string::format("Failed to load material-type file '%s': %s", materialTypePath.c_str(), materialTypeJson.GetError().c_str()); - ScopedContextPath subPath{context, "materialType"}; - return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::Catastrophic, failureMessage); - } - else - { - // Since we're about to load a different file the JsonFileLoadContext needs to be changed to reflect the file that's being loaded. - jsonFileLoadContext->PushFilePath(materialTypePath); - - // We also need a special reporting function for the material type, to note the fact that the issue is in the material type not this file. - auto reportingPrev = context.GetReporter(); - context.PushReporter([materialTypePath, reportingPrev](AZStd::string_view message, JSR::ResultCode result, AZStd::string_view path) -> JSR::ResultCode - { - AZStd::string materialTypeFilename; - if (!AzFramework::StringFunc::Path::GetFullFileName(materialTypePath.c_str(), materialTypeFilename)) - { - materialTypeFilename = materialTypePath; - } - - AZStd::string newPath = AZStd::string::format("[%.*s]%.*s", AZ_STRING_ARG(materialTypeFilename), AZ_STRING_ARG(path)); - return reportingPrev(message, result, newPath); - }); - - JsonDeserializerSettings settings; - settings.m_metadata = context.GetMetadata(); - settings.m_reporting = context.GetReporter(); - settings.m_registrationContext = context.GetRegistrationContext(); - settings.m_serializeContext = context.GetSerializeContext(); - settings.m_clearContainers = context.ShouldClearContainers(); - - JsonSerializationResult::ResultCode materialTypeLoadResult = JsonSerialization::Load(materialTypeData, materialTypeJson.GetValue(), settings); - materialTypeData.ResolveUvEnums(); - - // Restore prior configuration - context.PopReporter(); - jsonFileLoadContext->PopFilePath(); - - // Even though results from the material type file is a separate JSON serialization, we combine the results to make sure - // any issues are bubbled up. I'm not sure if this is the most desirable approach, but better to over-report issues than - // under-report them. - result.Combine(materialTypeLoadResult); - } - } - - context.GetMetadata().Add(AZStd::move(materialTypeData)); - - JsonMaterialPropertyValueSerializer::LoadContext materialPropertyValueLoadContext; - materialPropertyValueLoadContext.m_materialTypeVersion = materialSourceData->m_materialTypeVersion; - context.GetMetadata().Add(materialPropertyValueLoadContext); - - result.Combine(ContinueLoadingFromJsonObjectField(&materialSourceData->m_properties, azrtti_typeid(), inputValue, "properties", context)); - - if (result.GetProcessing() == JsonSerializationResult::Processing::Completed) - { - return context.Report(result, "Successfully loaded material."); - } - else - { - return context.Report(result, "Partially loaded material."); - } - } - - - JsonSerializationResult::Result JsonMaterialSourceDataSerializer::Store(rapidjson::Value& outputValue, const void* inputValue, - [[maybe_unused]] const void* defaultValue, const Uuid& valueTypeId, JsonSerializerContext& context) - { - namespace JSR = JsonSerializationResult; - - AZ_Assert(azrtti_typeid() == valueTypeId, - "Unable to serialize material to json because the provided type is %s", - valueTypeId.ToString().c_str()); - AZ_UNUSED(valueTypeId); - - const MaterialSourceData* materialSourceData = reinterpret_cast(inputValue); - AZ_Assert(materialSourceData, "Input value for JsonMaterialSourceDataSerializer can't be null."); - - JSR::ResultCode resultCode(JSR::Tasks::ReadField); - resultCode.Combine(ContinueStoringToJsonObjectField(outputValue, "description", &materialSourceData->m_description, nullptr, azrtti_typeid(), context)); - resultCode.Combine(ContinueStoringToJsonObjectField(outputValue, "parentMaterial", &materialSourceData->m_parentMaterial, nullptr, azrtti_typeid(), context)); - resultCode.Combine(ContinueStoringToJsonObjectField(outputValue, "materialType", &materialSourceData->m_materialType, nullptr, azrtti_typeid(), context)); - resultCode.Combine(ContinueStoringToJsonObjectField(outputValue, "materialTypeVersion", &materialSourceData->m_materialTypeVersion, nullptr, azrtti_typeid(), context)); - resultCode.Combine(ContinueStoringToJsonObjectField(outputValue, "properties", &materialSourceData->m_properties, nullptr, azrtti_typeid(), context)); - - return context.Report(resultCode, "Processed material."); - } - } // namespace RPI -} // namespace AZ diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp index d8e6c156be..87c064f571 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp @@ -130,17 +130,12 @@ namespace AZ return nullptr; } - bool MaterialTypeSourceData::ApplyPropertyRenames(MaterialPropertyId& propertyId, uint32_t materialTypeVersion) const + bool MaterialTypeSourceData::ApplyPropertyRenames(MaterialPropertyId& propertyId) const { bool renamed = false; for (const VersionUpdateDefinition& versionUpdate : m_versionUpdates) { - if (materialTypeVersion >= versionUpdate.m_toVersion) - { - continue; - } - for (const VersionUpdatesRenameOperationDefinition& action : versionUpdate.m_actions) { if (action.m_operation == "rename") @@ -161,7 +156,7 @@ namespace AZ return renamed; } - const MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::FindProperty(AZStd::string_view groupName, AZStd::string_view propertyName, uint32_t materialTypeVersion) const + const MaterialTypeSourceData::PropertyDefinition* MaterialTypeSourceData::FindProperty(AZStd::string_view groupName, AZStd::string_view propertyName) const { auto groupIter = m_propertyLayout.m_properties.find(groupName); if (groupIter != m_propertyLayout.m_properties.end()) @@ -178,7 +173,7 @@ namespace AZ // Property has not been found, try looking for renames in the version history MaterialPropertyId propertyId = MaterialPropertyId{groupName, propertyName}; - ApplyPropertyRenames(propertyId, materialTypeVersion); + ApplyPropertyRenames(propertyId); // Do the search again with the new names diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp index 309daf8b62..8bf975fd82 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp @@ -109,6 +109,77 @@ namespace AZ return m_wasPreFinalized; } + template + MaterialPropertyValue CastNumericMaterialPropertyValue(const MaterialPropertyValue& value) + { + TypeId typeId = value.GetTypeId(); + + if (typeId == azrtti_typeid()) + { + return aznumeric_cast(value.GetValue()); + } + else if (typeId == azrtti_typeid()) + { + return aznumeric_cast(value.GetValue()); + } + else if (typeId == azrtti_typeid()) + { + return aznumeric_cast(value.GetValue()); + } + else if (typeId == azrtti_typeid()) + { + return aznumeric_cast(value.GetValue()); + } + else + { + return value; + } + } + + + + template + MaterialPropertyValue CastVectorMaterialPropertyValue(const MaterialPropertyValue& value) + { + float values[4] = {}; + + TypeId typeId = value.GetTypeId(); + if (typeId == azrtti_typeid()) + { + value.GetValue().StoreToFloat2(values); + } + else if (typeId == azrtti_typeid()) + { + value.GetValue().StoreToFloat3(values); + } + else if (typeId == azrtti_typeid()) + { + value.GetValue().StoreToFloat4(values); + } + else + { + return value; + } + + typeId = azrtti_typeid(); + if (typeId == azrtti_typeid()) + { + return Vector2::CreateFromFloat2(values); + } + else if (typeId == azrtti_typeid()) + { + return Vector3::CreateFromFloat3(values); + } + else if (typeId == azrtti_typeid()) + { + return Vector4::CreateFromFloat4(values); + } + else + { + return value; + } + } + void MaterialAsset::Finalize(AZStd::function reportWarning, AZStd::function reportError) { if (m_wasPreFinalized) @@ -180,9 +251,66 @@ namespace AZ } else { - if (ValidateMaterialPropertyDataType(value.GetTypeId(), name, propertyDescriptor, reportError)) + // The material asset could be finalized sometime after the original JSON is loaded, and the material type might not have been available + // at that time, so the data type would not be known for each property. So each raw property's type could be based on what appeared in the JSON + // and this is the first opportunity we have to resolve that value with the actual type. For example, a float property could have been specified in + // the JSON as 7 instead of 7.0, which is valid. Similarly, a Color and a Vector3 can both be specified as "[0.0,0.0,0.0]" in the JSON file. + + MaterialPropertyValue finalValue = value; + + switch (propertyDescriptor->GetDataType()) + { + case MaterialPropertyDataType::Bool: + finalValue = CastNumericMaterialPropertyValue(value); + break; + case MaterialPropertyDataType::Int: + finalValue = CastNumericMaterialPropertyValue(value); + break; + case MaterialPropertyDataType::UInt: + finalValue = CastNumericMaterialPropertyValue(value); + break; + case MaterialPropertyDataType::Float: + finalValue = CastNumericMaterialPropertyValue(value); + break; + case MaterialPropertyDataType::Color: + if (value.GetTypeId() == azrtti_typeid()) + { + finalValue = Color::CreateFromVector3(value.GetValue()); + } + else if (value.GetTypeId() == azrtti_typeid()) + { + Vector4 vector4 = value.GetValue(); + finalValue = Color::CreateFromVector3AndFloat(vector4.GetAsVector3(), vector4.GetW()); + } + break; + case MaterialPropertyDataType::Vector2: + finalValue = CastVectorMaterialPropertyValue(value); + break; + case MaterialPropertyDataType::Vector3: + if (value.GetTypeId() == azrtti_typeid()) + { + finalValue = value.GetValue().GetAsVector3(); + } + else + { + finalValue = CastVectorMaterialPropertyValue(value); + } + break; + case MaterialPropertyDataType::Vector4: + if (value.GetTypeId() == azrtti_typeid()) + { + finalValue = value.GetValue().GetAsVector4(); + } + else + { + finalValue = CastVectorMaterialPropertyValue(value); + } + break; + } + + if (ValidateMaterialPropertyDataType(finalValue.GetTypeId(), name, propertyDescriptor, reportError)) { - finalizedPropertyValues[propertyIndex.GetIndex()] = value; + finalizedPropertyValues[propertyIndex.GetIndex()] = finalValue; } } } diff --git a/Gems/Atom/RPI/Code/Tests/Material/MaterialAssetTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/MaterialAssetTests.cpp index 61e1283f52..ea637fb17d 100644 --- a/Gems/Atom/RPI/Code/Tests/Material/MaterialAssetTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Material/MaterialAssetTests.cpp @@ -449,37 +449,7 @@ namespace UnitTest expectCreatorError("Type mismatch", [](MaterialAssetCreator& creator) { - creator.SetPropertyValue(Name{ "MyInt" }, 0.0f); - }); - - expectCreatorError("Type mismatch", - [](MaterialAssetCreator& creator) - { - creator.SetPropertyValue(Name{ "MyUInt" }, -1); - }); - - expectCreatorError("Type mismatch", - [](MaterialAssetCreator& creator) - { - creator.SetPropertyValue(Name{ "MyFloat" }, 10u); - }); - - expectCreatorError("Type mismatch", - [](MaterialAssetCreator& creator) - { - creator.SetPropertyValue(Name{ "MyFloat2" }, 1.0f); - }); - - expectCreatorError("Type mismatch", - [](MaterialAssetCreator& creator) - { - creator.SetPropertyValue(Name{ "MyFloat3" }, AZ::Vector4{}); - }); - - expectCreatorError("Type mismatch", - [](MaterialAssetCreator& creator) - { - creator.SetPropertyValue(Name{ "MyFloat4" }, AZ::Vector3{}); + creator.SetPropertyValue(Name{ "MyFloat" }, AZ::Vector4{}); }); expectCreatorError("Type mismatch", diff --git a/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp index ef89e0138c..5e09fe6612 100644 --- a/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Material/MaterialSourceDataTests.cpp @@ -297,6 +297,63 @@ namespace UnitTest checkRawPropertyValues(); } + // Can return a Vector4 or a Color as a Vector4 + Vector4 GetAsVector4(const MaterialPropertyValue& value) + { + if (value.GetTypeId() == azrtti_typeid()) + { + return value.GetValue(); + } + else if (value.GetTypeId() == azrtti_typeid()) + { + return value.GetValue().GetAsVector4(); + } + else + { + return Vector4::CreateZero(); + } + } + + // Can return a Int or a UInt as a Int + int32_t GetAsInt(const MaterialPropertyValue& value) + { + if (value.GetTypeId() == azrtti_typeid()) + { + return value.GetValue(); + } + else if (value.GetTypeId() == azrtti_typeid()) + { + return aznumeric_cast(value.GetValue()); + } + else + { + return 0; + } + } + + template + bool AreTypesCompatible(const MaterialPropertyValue& a, const MaterialPropertyValue& b) + { + auto fixupType = [](TypeId t) + { + if (t == azrtti_typeid()) + { + return azrtti_typeid(); + } + + if (t == azrtti_typeid()) + { + return azrtti_typeid(); + } + + return t; + }; + + TypeId targetTypeId = azrtti_typeid(); + + return fixupType(a.GetTypeId()) == fixupType(targetTypeId) && fixupType(b.GetTypeId()) == fixupType(targetTypeId); + } + void CheckEqual(MaterialSourceData& a, MaterialSourceData& b) { EXPECT_STREQ(a.m_materialType.data(), b.m_materialType.data()); @@ -334,27 +391,41 @@ namespace UnitTest auto& propertyA = propertyIterA.second; auto& propertyB = propertyIterB->second; - bool typesMatch = propertyA.m_value.GetTypeId() == propertyB.m_value.GetTypeId(); - EXPECT_TRUE(typesMatch); - if (typesMatch) + AZStd::string propertyReference = AZStd::string::format(" for property '%s.%s'", groupName.c_str(), propertyName.c_str()); + + // We allow some types like Vector4 and Color or Int and UInt to be interchangeable since they serialize the same and can be converted when the MaterialAsset is finalized. + + if (AreTypesCompatible(propertyA.m_value, propertyB.m_value)) { - AZStd::string propertyReference = AZStd::string::format(" for property '%s.%s'", groupName.c_str(), propertyName.c_str()); - - auto typeId = propertyA.m_value.GetTypeId(); - - if (typeId == azrtti_typeid()) { EXPECT_EQ(propertyA.m_value.GetValue(), propertyB.m_value.GetValue()) << propertyReference.c_str(); } - else if (typeId == azrtti_typeid()) { EXPECT_EQ(propertyA.m_value.GetValue(), propertyB.m_value.GetValue()) << propertyReference.c_str(); } - else if (typeId == azrtti_typeid()) { EXPECT_EQ(propertyA.m_value.GetValue(), propertyB.m_value.GetValue()) << propertyReference.c_str(); } - else if (typeId == azrtti_typeid()) { EXPECT_NEAR(propertyA.m_value.GetValue(), propertyB.m_value.GetValue(), 0.01) << propertyReference.c_str(); } - else if (typeId == azrtti_typeid()) { EXPECT_TRUE(propertyA.m_value.GetValue().IsClose(propertyB.m_value.GetValue())) << propertyReference.c_str(); } - else if (typeId == azrtti_typeid()) { EXPECT_TRUE(propertyA.m_value.GetValue().IsClose(propertyB.m_value.GetValue())) << propertyReference.c_str(); } - else if (typeId == azrtti_typeid()) { EXPECT_TRUE(propertyA.m_value.GetValue().IsClose(propertyB.m_value.GetValue())) << propertyReference.c_str(); } - else if (typeId == azrtti_typeid()) { EXPECT_TRUE(propertyA.m_value.GetValue().IsClose(propertyB.m_value.GetValue())) << propertyReference.c_str(); } - else if (typeId == azrtti_typeid()) { EXPECT_STREQ(propertyA.m_value.GetValue().c_str(), propertyB.m_value.GetValue().c_str()) << propertyReference.c_str(); } - else - { - ADD_FAILURE(); - } + EXPECT_EQ(propertyA.m_value.GetValue(), propertyB.m_value.GetValue()) << propertyReference.c_str(); + } + else if (AreTypesCompatible(propertyA.m_value, propertyB.m_value)) + { + EXPECT_EQ(GetAsInt(propertyA.m_value), GetAsInt(propertyB.m_value)) << propertyReference.c_str(); + } + else if (AreTypesCompatible(propertyA.m_value, propertyB.m_value)) + { + EXPECT_NEAR(propertyA.m_value.GetValue(), propertyB.m_value.GetValue(), 0.01) << propertyReference.c_str(); + } + else if (AreTypesCompatible(propertyA.m_value, propertyB.m_value)) + { + EXPECT_TRUE(propertyA.m_value.GetValue().IsClose(propertyB.m_value.GetValue())) << propertyReference.c_str(); + } + else if (AreTypesCompatible(propertyA.m_value, propertyB.m_value)) + { + EXPECT_TRUE(propertyA.m_value.GetValue().IsClose(propertyB.m_value.GetValue())) << propertyReference.c_str(); + } + else if (AreTypesCompatible(propertyA.m_value, propertyB.m_value)) + { + EXPECT_TRUE(GetAsVector4(propertyA.m_value).IsClose(GetAsVector4(propertyB.m_value))) << propertyReference.c_str(); + } + else if (AreTypesCompatible(propertyA.m_value, propertyB.m_value)) + { + EXPECT_STREQ(propertyA.m_value.GetValue().c_str(), propertyB.m_value.GetValue().c_str()) << propertyReference.c_str(); + } + else + { + ADD_FAILURE(); } } } @@ -363,42 +434,8 @@ namespace UnitTest TEST_F(MaterialSourceDataTests, TestJsonRoundTrip) { - const char* materialTypeJson = - "{ \n" - " \"propertyLayout\": { \n" - " \"version\": 1, \n" - " \"groups\": [ \n" - " { \"name\": \"groupA\" }, \n" - " { \"name\": \"groupB\" }, \n" - " { \"name\": \"groupC\" } \n" - " ], \n" - " \"properties\": { \n" - " \"groupA\": [ \n" - " {\"name\": \"MyBool\", \"type\": \"bool\"}, \n" - " {\"name\": \"MyInt\", \"type\": \"int\"}, \n" - " {\"name\": \"MyUInt\", \"type\": \"uint\"} \n" - " ], \n" - " \"groupB\": [ \n" - " {\"name\": \"MyFloat\", \"type\": \"float\"}, \n" - " {\"name\": \"MyFloat2\", \"type\": \"vector2\"}, \n" - " {\"name\": \"MyFloat3\", \"type\": \"vector3\"} \n" - " ], \n" - " \"groupC\": [ \n" - " {\"name\": \"MyFloat4\", \"type\": \"vector4\"}, \n" - " {\"name\": \"MyColor\", \"type\": \"color\"}, \n" - " {\"name\": \"MyImage\", \"type\": \"image\"} \n" - " ] \n" - " } \n" - " } \n" - "} \n"; - const char* materialTypeFilePath = "@exefolder@/Temp/roundTripTest.materialtype"; - AZ::IO::FileIOStream file; - EXPECT_TRUE(file.Open(materialTypeFilePath, AZ::IO::OpenMode::ModeWrite | AZ::IO::OpenMode::ModeCreatePath)); - file.Write(strlen(materialTypeJson), materialTypeJson); - file.Close(); - MaterialSourceData sourceDataOriginal; sourceDataOriginal.m_materialType = materialTypeFilePath; sourceDataOriginal.m_parentMaterial = materialTypeFilePath; @@ -434,8 +471,8 @@ namespace UnitTest "properties": { "general": [ { - "name": "testColor", - "type": "color" + "name": "testValue", + "type": "Float" } ] } @@ -456,7 +493,7 @@ namespace UnitTest { "properties": { "general": { - "testColor": [0.1,0.2,0.3] + "testValue": 1.2 } }, "materialType": "@exefolder@/Temp/simpleMaterialType.materialtype" @@ -469,27 +506,11 @@ namespace UnitTest EXPECT_EQ(AZ::JsonSerializationResult::Tasks::ReadField, loadResult.m_jsonResultCode.GetTask()); EXPECT_EQ(AZ::JsonSerializationResult::Processing::Completed, loadResult.m_jsonResultCode.GetProcessing()); - AZ::Color testColor = material.m_properties["general"]["testColor"].m_value.GetValue(); - EXPECT_TRUE(AZ::Color(0.1f, 0.2f, 0.3f, 1.0f).IsClose(testColor, 0.01)); - } - - TEST_F(MaterialSourceDataTests, Load_Error_NotAnObject) - { - const AZStd::string inputJson = R"( - [] - )"; - - MaterialSourceData material; - JsonTestResult loadResult = LoadTestDataFromJson(material, inputJson); - - EXPECT_EQ(AZ::JsonSerializationResult::Tasks::ReadField, loadResult.m_jsonResultCode.GetTask()); - EXPECT_EQ(AZ::JsonSerializationResult::Processing::Altered, loadResult.m_jsonResultCode.GetProcessing()); - EXPECT_EQ(AZ::JsonSerializationResult::Outcomes::Unsupported, loadResult.m_jsonResultCode.GetOutcome()); - - EXPECT_TRUE(loadResult.ContainsMessage("", "Material data must be a JSON object")); + float testValue = material.m_properties["general"]["testValue"].m_value.GetValue(); + EXPECT_FLOAT_EQ(1.2f, testValue); } - - TEST_F(MaterialSourceDataTests, Load_Error_NoMaterialType) + + TEST_F(MaterialSourceDataTests, CreateMaterialAsset_NoMaterialType) { const AZStd::string inputJson = R"( { @@ -505,14 +526,29 @@ namespace UnitTest MaterialSourceData material; JsonTestResult loadResult = LoadTestDataFromJson(material, inputJson); - EXPECT_EQ(AZ::JsonSerializationResult::Tasks::ReadField, loadResult.m_jsonResultCode.GetTask()); - EXPECT_EQ(AZ::JsonSerializationResult::Processing::Halted, loadResult.m_jsonResultCode.GetProcessing()); - EXPECT_EQ(AZ::JsonSerializationResult::Outcomes::Catastrophic, loadResult.m_jsonResultCode.GetOutcome()); + const bool elevateWarnings = false; - EXPECT_TRUE(loadResult.ContainsMessage("", "Required field 'materialType' is missing")); - } + ErrorMessageFinder errorMessageFinder; - TEST_F(MaterialSourceDataTests, Load_Error_MaterialTypeDoesNotExist) + errorMessageFinder.AddExpectedErrorMessage("materialType was not specified"); + auto result = material.CreateMaterialAsset(AZ::Uuid::CreateRandom(), "test.material", AZ::RPI::MaterialAssetProcessingMode::DeferredBake, elevateWarnings); + EXPECT_FALSE(result.IsSuccess()); + errorMessageFinder.CheckExpectedErrorsFound(); + + errorMessageFinder.Reset(); + errorMessageFinder.AddExpectedErrorMessage("materialType was not specified"); + result = material.CreateMaterialAsset(AZ::Uuid::CreateRandom(), "test.material", AZ::RPI::MaterialAssetProcessingMode::PreBake, elevateWarnings); + EXPECT_FALSE(result.IsSuccess()); + errorMessageFinder.CheckExpectedErrorsFound(); + + errorMessageFinder.Reset(); + errorMessageFinder.AddExpectedErrorMessage("materialType was not specified"); + result = material.CreateMaterialAssetFromSourceData(AZ::Uuid::CreateRandom(), "test.material", elevateWarnings); + EXPECT_FALSE(result.IsSuccess()); + errorMessageFinder.CheckExpectedErrorsFound(); + } + + TEST_F(MaterialSourceDataTests, CreateMaterialAsset_MaterialTypeDoesNotExist) { const AZStd::string inputJson = R"( { @@ -529,102 +565,43 @@ namespace UnitTest MaterialSourceData material; JsonTestResult loadResult = LoadTestDataFromJson(material, inputJson); - EXPECT_EQ(AZ::JsonSerializationResult::Tasks::ReadField, loadResult.m_jsonResultCode.GetTask()); - EXPECT_EQ(AZ::JsonSerializationResult::Processing::Halted, loadResult.m_jsonResultCode.GetProcessing()); - EXPECT_EQ(AZ::JsonSerializationResult::Outcomes::Catastrophic, loadResult.m_jsonResultCode.GetOutcome()); + const bool elevateWarnings = false; - EXPECT_TRUE(loadResult.ContainsMessage("/materialType", "Failed to load material-type file")); - } + ErrorMessageFinder errorMessageFinder; - TEST_F(MaterialSourceDataTests, Load_MaterialTypeMessagesAreReported) - { - const AZStd::string simpleMaterialTypeJson = R"( - { - "propertyLayout": { - "properties": { - "general": [ - { - "name": "testColor", - "type": "color" - } - ] - } - } - } - )"; - - const char* materialTypeFilePath = "@exefolder@/Temp/simpleMaterialType.materialtype"; - - AZ::IO::FileIOStream file; - EXPECT_TRUE(file.Open(materialTypeFilePath, AZ::IO::OpenMode::ModeWrite | AZ::IO::OpenMode::ModeCreatePath)); - file.Write(simpleMaterialTypeJson.size(), simpleMaterialTypeJson.data()); - file.Close(); - - const AZStd::string inputJson = R"( - { - "materialType": "@exefolder@/Temp/simpleMaterialType.materialtype", - "materialTypeVersion": 1, - "properties": { - "general": { - "testColor": [1.0,1.0,1.0] - } - } - } - )"; + errorMessageFinder.AddExpectedErrorMessage("Could not find asset [DoesNotExist.materialtype]"); + auto result = material.CreateMaterialAsset(AZ::Uuid::CreateRandom(), "test.material", AZ::RPI::MaterialAssetProcessingMode::DeferredBake, elevateWarnings); + EXPECT_FALSE(result.IsSuccess()); + errorMessageFinder.CheckExpectedErrorsFound(); - MaterialSourceData material; - JsonTestResult loadResult = LoadTestDataFromJson(material, inputJson); - - EXPECT_EQ(AZ::JsonSerializationResult::Tasks::ReadField, loadResult.m_jsonResultCode.GetTask()); - EXPECT_EQ(AZ::JsonSerializationResult::Processing::Completed, loadResult.m_jsonResultCode.GetProcessing()); - - // propertyLayout is a field in the material type, not the material - EXPECT_TRUE(loadResult.ContainsMessage("[simpleMaterialType.materialtype]/propertyLayout/properties", "Successfully read")); + errorMessageFinder.Reset(); + errorMessageFinder.AddExpectedErrorMessage("Could not find asset [DoesNotExist.materialtype]"); + result = material.CreateMaterialAsset(AZ::Uuid::CreateRandom(), "test.material", AZ::RPI::MaterialAssetProcessingMode::PreBake, elevateWarnings); + EXPECT_FALSE(result.IsSuccess()); + errorMessageFinder.CheckExpectedErrorsFound(); + + errorMessageFinder.Reset(); + errorMessageFinder.AddExpectedErrorMessage("Could not find asset [DoesNotExist.materialtype]"); + errorMessageFinder.AddIgnoredErrorMessage("Failed to create material type asset ID", true); + result = material.CreateMaterialAssetFromSourceData(AZ::Uuid::CreateRandom(), "test.material", elevateWarnings); + EXPECT_FALSE(result.IsSuccess()); + errorMessageFinder.CheckExpectedErrorsFound(); } - - TEST_F(MaterialSourceDataTests, Load_Error_PropertyNotFound) + + TEST_F(MaterialSourceDataTests, CreateMaterialAsset_MaterialPropertyNotFound) { - const AZStd::string simpleMaterialTypeJson = R"( - { - "propertyLayout": { - "properties": { - "general": [ - { - "name": "testColor", - "type": "color" - } - ] - } - } - } - )"; - - const char* materialTypeFilePath = "@exefolder@/Temp/simpleMaterialType.materialtype"; - - AZ::IO::FileIOStream file; - EXPECT_TRUE(file.Open(materialTypeFilePath, AZ::IO::OpenMode::ModeWrite | AZ::IO::OpenMode::ModeCreatePath)); - file.Write(simpleMaterialTypeJson.size(), simpleMaterialTypeJson.data()); - file.Close(); - - const AZStd::string inputJson = R"( - { - "materialType": "@exefolder@/Temp/simpleMaterialType.materialtype", - "materialTypeVersion": 1, - "properties": { - "general": { - "doesNotExist": [1.0,1.0,1.0] - } - } - } - )"; - MaterialSourceData material; - JsonTestResult loadResult = LoadTestDataFromJson(material, inputJson); - - EXPECT_EQ(AZ::JsonSerializationResult::Tasks::ReadField, loadResult.m_jsonResultCode.GetTask()); - EXPECT_EQ(AZ::JsonSerializationResult::Processing::PartialAlter, loadResult.m_jsonResultCode.GetProcessing()); + material.m_materialType = "@exefolder@/Temp/test.materialtype"; + AddPropertyGroup(material, "general"); + AddProperty(material, "general", "FieldDoesNotExist", 1.5f); + + const bool elevateWarnings = true; - EXPECT_TRUE(loadResult.ContainsMessage("/properties/general/doesNotExist", "Property 'general.doesNotExist' not found in material type.")); + ErrorMessageFinder errorMessageFinder("\"general.FieldDoesNotExist\" is not found"); + errorMessageFinder.AddIgnoredErrorMessage("Failed to build MaterialAsset", true); + auto result = material.CreateMaterialAsset(AZ::Uuid::CreateRandom(), "test.material", AZ::RPI::MaterialAssetProcessingMode::PreBake, elevateWarnings); + EXPECT_FALSE(result.IsSuccess()); + errorMessageFinder.CheckExpectedErrorsFound(); } TEST_F(MaterialSourceDataTests, CreateMaterialAsset_MultiLevelDataInheritance) @@ -896,7 +873,92 @@ namespace UnitTest AddProperty(materialSourceData, "general", "MyImage", AZStd::string("doesNotExist.streamingimage")); }, true); // In this case, the warning does happen even when the asset is not finalized, because the image path is checked earlier than that } + + template + void CheckSimilar(PropertyTypeT a, PropertyTypeT b); + + template<> void CheckSimilar(float a, float b) { EXPECT_FLOAT_EQ(a, b); } + template<> void CheckSimilar(Vector2 a, Vector2 b) { EXPECT_TRUE(a.IsClose(b)); } + template<> void CheckSimilar(Vector3 a, Vector3 b) { EXPECT_TRUE(a.IsClose(b)); } + template<> void CheckSimilar(Vector4 a, Vector4 b) { EXPECT_TRUE(a.IsClose(b)); } + template<> void CheckSimilar(Color a, Color b) { EXPECT_TRUE(a.IsClose(b)); } + + template void CheckSimilar(PropertyTypeT a, PropertyTypeT b) { EXPECT_EQ(a, b); } + + template + void CheckEndToEndDataTypeResolution(const char* propertyName, const char* jsonValue, PropertyTypeT expectedFinalValue) + { + const char* groupName = "general"; + + const AZStd::string inputJson = AZStd::string::format(R"( + { + "materialType": "@exefolder@/Temp/test.materialtype", + "properties": { + "%s": { + "%s": %s + } + } + } + )", groupName, propertyName, jsonValue); + + MaterialSourceData material; + JsonTestResult loadResult = LoadTestDataFromJson(material, inputJson); + auto materialAssetResult = material.CreateMaterialAsset(Uuid::CreateRandom(), "test.material", AZ::RPI::MaterialAssetProcessingMode::PreBake); + EXPECT_TRUE(materialAssetResult); + MaterialPropertyIndex propertyIndex = materialAssetResult.GetValue()->GetMaterialPropertiesLayout()->FindPropertyIndex(MaterialPropertyId{groupName, propertyName}.GetFullName()); + CheckSimilar(expectedFinalValue, materialAssetResult.GetValue()->GetPropertyValues()[propertyIndex.GetIndex()].GetValue()); + } + TEST_F(MaterialSourceDataTests, TestEndToEndDataTypeResolution) + { + // Data types in .material files don't have to exactly match the types in .materialtype files as specified in the properties layout. + // The exact location of the data type resolution has moved around over the life of the project, but the important thing is that + // the data type in the source .material file gets applied correctly by the time a finalized MaterialAsset comes out the other side. + + CheckEndToEndDataTypeResolution("MyBool", "true", true); + CheckEndToEndDataTypeResolution("MyBool", "false", false); + CheckEndToEndDataTypeResolution("MyBool", "1", true); + CheckEndToEndDataTypeResolution("MyBool", "0", false); + CheckEndToEndDataTypeResolution("MyBool", "1.0", true); + CheckEndToEndDataTypeResolution("MyBool", "0.0", false); + + CheckEndToEndDataTypeResolution("MyInt", "5", 5); + CheckEndToEndDataTypeResolution("MyInt", "-6", -6); + CheckEndToEndDataTypeResolution("MyInt", "-7.0", -7); + CheckEndToEndDataTypeResolution("MyInt", "false", 0); + CheckEndToEndDataTypeResolution("MyInt", "true", 1); + + CheckEndToEndDataTypeResolution("MyUInt", "8", 8u); + CheckEndToEndDataTypeResolution("MyUInt", "9.0", 9u); + CheckEndToEndDataTypeResolution("MyUInt", "false", 0u); + CheckEndToEndDataTypeResolution("MyUInt", "true", 1u); + + CheckEndToEndDataTypeResolution("MyFloat", "2", 2.0f); + CheckEndToEndDataTypeResolution("MyFloat", "-2", -2.0f); + CheckEndToEndDataTypeResolution("MyFloat", "2.1", 2.1f); + CheckEndToEndDataTypeResolution("MyFloat", "false", 0.0f); + CheckEndToEndDataTypeResolution("MyFloat", "true", 1.0f); + + CheckEndToEndDataTypeResolution("MyColor", "[0.1,0.2,0.3]", Color{0.1f, 0.2f, 0.3f, 1.0}); + CheckEndToEndDataTypeResolution("MyColor", "[0.1, 0.2, 0.3, 0.5]", Color{0.1f, 0.2f, 0.3f, 0.5f}); + CheckEndToEndDataTypeResolution("MyColor", "{\"RGB8\": [255, 0, 255, 0]}", Color{1.0f, 0.0f, 1.0f, 0.0f}); + + CheckEndToEndDataTypeResolution("MyFloat2", "[0.1,0.2]", Vector2{0.1f, 0.2f}); + CheckEndToEndDataTypeResolution("MyFloat2", "{\"y\":0.2, \"x\":0.1}", Vector2{0.1f, 0.2f}); + CheckEndToEndDataTypeResolution("MyFloat2", "{\"y\":0.2, \"x\":0.1, \"Z\":0.3}", Vector2{0.1f, 0.2f}); + CheckEndToEndDataTypeResolution("MyFloat2", "{\"y\":0.2, \"W\":0.4, \"x\":0.1, \"Z\":0.3}", Vector2{0.1f, 0.2f}); + + CheckEndToEndDataTypeResolution("MyFloat3", "[0.1,0.2,0.3]", Vector3{0.1f, 0.2f, 0.3f}); + CheckEndToEndDataTypeResolution("MyFloat3", "{\"y\":0.2, \"x\":0.1}", Vector3{0.1f, 0.2f, 0.0f}); + CheckEndToEndDataTypeResolution("MyFloat3", "{\"y\":0.2, \"x\":0.1, \"Z\":0.3}", Vector3{0.1f, 0.2f, 0.3f}); + CheckEndToEndDataTypeResolution("MyFloat3", "{\"y\":0.2, \"W\":0.4, \"x\":0.1, \"Z\":0.3}", Vector3{0.1f, 0.2f, 0.3f}); + + CheckEndToEndDataTypeResolution("MyFloat4", "[0.1,0.2,0.3,0.4]", Vector4{0.1f, 0.2f, 0.3f, 0.4f}); + CheckEndToEndDataTypeResolution("MyFloat4", "{\"y\":0.2, \"x\":0.1}", Vector4{0.1f, 0.2f, 0.0f, 0.0f}); + CheckEndToEndDataTypeResolution("MyFloat4", "{\"y\":0.2, \"x\":0.1, \"Z\":0.3}", Vector4{0.1f, 0.2f, 0.3f, 0.0f}); + CheckEndToEndDataTypeResolution("MyFloat4", "{\"y\":0.2, \"W\":0.4, \"x\":0.1, \"Z\":0.3}", Vector4{0.1f, 0.2f, 0.3f, 0.4f}); + } + } diff --git a/Gems/Atom/RPI/Code/atom_rpi_edit_files.cmake b/Gems/Atom/RPI/Code/atom_rpi_edit_files.cmake index e32d19ffd7..3c345cc00b 100644 --- a/Gems/Atom/RPI/Code/atom_rpi_edit_files.cmake +++ b/Gems/Atom/RPI/Code/atom_rpi_edit_files.cmake @@ -25,7 +25,6 @@ set(FILES Include/Atom/RPI.Edit/Material/MaterialPropertyValueSourceData.h Include/Atom/RPI.Edit/Material/MaterialPropertyValueSourceDataSerializer.h Include/Atom/RPI.Edit/Material/MaterialSourceData.h - Include/Atom/RPI.Edit/Material/MaterialSourceDataSerializer.h Include/Atom/RPI.Edit/Material/MaterialFunctorSourceData.h Include/Atom/RPI.Edit/Material/MaterialFunctorSourceDataSerializer.h Include/Atom/RPI.Edit/Material/MaterialFunctorSourceDataRegistration.h @@ -45,7 +44,6 @@ set(FILES Source/RPI.Edit/Material/MaterialPropertyValueSourceData.cpp Source/RPI.Edit/Material/MaterialPropertyValueSourceDataSerializer.cpp Source/RPI.Edit/Material/MaterialSourceData.cpp - Source/RPI.Edit/Material/MaterialSourceDataSerializer.cpp Source/RPI.Edit/Material/MaterialFunctorSourceData.cpp Source/RPI.Edit/Material/MaterialFunctorSourceDataSerializer.cpp Source/RPI.Edit/Material/MaterialFunctorSourceDataRegistration.cpp From 638fc027f5ea03c2a86a0e454022ccebd640eaa8 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Fri, 14 Jan 2022 13:05:59 -0800 Subject: [PATCH 542/948] Updated material builder version numbers in case my prior changes were impactful (it might not be necessary but I'm not sure, so just in case) Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../RPI/Code/Source/RPI.Builders/Material/MaterialBuilder.cpp | 2 +- .../Source/RPI.Builders/Model/MaterialAssetBuilderComponent.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Builders/Material/MaterialBuilder.cpp b/Gems/Atom/RPI/Code/Source/RPI.Builders/Material/MaterialBuilder.cpp index 768890a29b..cadb182d03 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Builders/Material/MaterialBuilder.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Builders/Material/MaterialBuilder.cpp @@ -52,7 +52,7 @@ namespace AZ { AssetBuilderSDK::AssetBuilderDesc materialBuilderDescriptor; materialBuilderDescriptor.m_name = JobKey; - materialBuilderDescriptor.m_version = 115; // material dependency improvements updated + materialBuilderDescriptor.m_version = 116; // more material dependency improvements materialBuilderDescriptor.m_patterns.push_back(AssetBuilderSDK::AssetBuilderPattern("*.material", AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard)); materialBuilderDescriptor.m_patterns.push_back(AssetBuilderSDK::AssetBuilderPattern("*.materialtype", AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard)); materialBuilderDescriptor.m_busId = azrtti_typeid(); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MaterialAssetBuilderComponent.cpp b/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MaterialAssetBuilderComponent.cpp index 9a92e7b762..35a903dac0 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MaterialAssetBuilderComponent.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MaterialAssetBuilderComponent.cpp @@ -128,7 +128,7 @@ namespace AZ if (auto* serialize = azrtti_cast(context)) { serialize->Class() - ->Version(21); // material dependency improvements updated + ->Version(22); // more material dependency improvements } } From f87d0f83869426b584d4ef9c0b83749e7c27850c Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Fri, 14 Jan 2022 16:18:26 -0800 Subject: [PATCH 543/948] Updated all .material files to have materialTypeVersion instead of propertyLayoutVersion. This was renamed in code at some point but we forgot to rename in the files. Before this was silently ignored but since I removed MaterialSourceDataSerializer, this started being reported as a warning. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../TestData/Test_Sponza_Material_Conversion_black.material | 2 +- .../TestData/Test_Sponza_Material_Conversion_green.material | 2 +- .../TestData/Test_Sponza_Material_Conversion_mat_arch.material | 2 +- .../Test_Sponza_Material_Conversion_mat_bricks.material | 2 +- .../TestData/Test_Sponza_Material_Conversion_mat_floor.material | 2 +- .../TestData/Test_Sponza_Material_Conversion_mat_roof.material | 2 +- .../TestData/Test_Sponza_Material_Conversion_phong5.material | 2 +- .../TestData/Test_Sponza_Material_Conversion_red.material | 2 +- .../TestData/Test_Sponza_Material_Conversion_white.material | 2 +- .../Gem/Sponza/Assets/objects/lightBlocker_lambert1.material | 2 +- .../Levels/Graphics/PbrMaterialChart/materials/basic.material | 2 +- .../Graphics/PbrMaterialChart/materials/basic_m00_r00.material | 2 +- .../Graphics/PbrMaterialChart/materials/basic_m00_r01.material | 2 +- .../Graphics/PbrMaterialChart/materials/basic_m00_r02.material | 2 +- .../Graphics/PbrMaterialChart/materials/basic_m00_r03.material | 2 +- .../Graphics/PbrMaterialChart/materials/basic_m00_r04.material | 2 +- .../Graphics/PbrMaterialChart/materials/basic_m00_r05.material | 2 +- .../Graphics/PbrMaterialChart/materials/basic_m00_r06.material | 2 +- .../Graphics/PbrMaterialChart/materials/basic_m00_r07.material | 2 +- .../Graphics/PbrMaterialChart/materials/basic_m00_r08.material | 2 +- .../Graphics/PbrMaterialChart/materials/basic_m00_r09.material | 2 +- .../Graphics/PbrMaterialChart/materials/basic_m00_r10.material | 2 +- .../Graphics/PbrMaterialChart/materials/basic_m10_r00.material | 2 +- .../Graphics/PbrMaterialChart/materials/basic_m10_r01.material | 2 +- .../Graphics/PbrMaterialChart/materials/basic_m10_r02.material | 2 +- .../Graphics/PbrMaterialChart/materials/basic_m10_r03.material | 2 +- .../Graphics/PbrMaterialChart/materials/basic_m10_r04.material | 2 +- .../Graphics/PbrMaterialChart/materials/basic_m10_r05.material | 2 +- .../Graphics/PbrMaterialChart/materials/basic_m10_r06.material | 2 +- .../Graphics/PbrMaterialChart/materials/basic_m10_r07.material | 2 +- .../Graphics/PbrMaterialChart/materials/basic_m10_r08.material | 2 +- .../Graphics/PbrMaterialChart/materials/basic_m10_r09.material | 2 +- .../Graphics/PbrMaterialChart/materials/basic_m10_r10.material | 2 +- AutomatedTesting/Materials/DefaultPBRTransparent.material | 2 +- AutomatedTesting/Materials/basic_grey.material | 2 +- .../Objects/MorphTargets/DisplayWrinkleMaskBlendValues.material | 2 +- .../OcclusionCullingPlaneTransparentVisualization.material | 2 +- .../OcclusionCullingPlaneVisualization.material | 2 +- .../Common/Assets/Materials/Presets/PBR/default_grid.material | 2 +- .../Common/Assets/Materials/Presets/PBR/metal_aluminum.material | 2 +- .../Assets/Materials/Presets/PBR/metal_aluminum_matte.material | 2 +- .../Materials/Presets/PBR/metal_aluminum_polished.material | 2 +- .../Common/Assets/Materials/Presets/PBR/metal_brass.material | 2 +- .../Assets/Materials/Presets/PBR/metal_brass_matte.material | 2 +- .../Assets/Materials/Presets/PBR/metal_brass_polished.material | 2 +- .../Common/Assets/Materials/Presets/PBR/metal_chrome.material | 2 +- .../Assets/Materials/Presets/PBR/metal_chrome_matte.material | 2 +- .../Assets/Materials/Presets/PBR/metal_chrome_polished.material | 2 +- .../Common/Assets/Materials/Presets/PBR/metal_cobalt.material | 2 +- .../Assets/Materials/Presets/PBR/metal_cobalt_matte.material | 2 +- .../Assets/Materials/Presets/PBR/metal_cobalt_polished.material | 2 +- .../Common/Assets/Materials/Presets/PBR/metal_copper.material | 2 +- .../Assets/Materials/Presets/PBR/metal_copper_matte.material | 2 +- .../Assets/Materials/Presets/PBR/metal_copper_polished.material | 2 +- .../Common/Assets/Materials/Presets/PBR/metal_gold.material | 2 +- .../Assets/Materials/Presets/PBR/metal_gold_matte.material | 2 +- .../Assets/Materials/Presets/PBR/metal_gold_polished.material | 2 +- .../Common/Assets/Materials/Presets/PBR/metal_iron.material | 2 +- .../Assets/Materials/Presets/PBR/metal_iron_matte.material | 2 +- .../Assets/Materials/Presets/PBR/metal_iron_polished.material | 2 +- .../Common/Assets/Materials/Presets/PBR/metal_mercury.material | 2 +- .../Common/Assets/Materials/Presets/PBR/metal_nickel.material | 2 +- .../Assets/Materials/Presets/PBR/metal_nickel_matte.material | 2 +- .../Assets/Materials/Presets/PBR/metal_nickel_polished.material | 2 +- .../Assets/Materials/Presets/PBR/metal_palladium.material | 2 +- .../Assets/Materials/Presets/PBR/metal_palladium_matte.material | 2 +- .../Materials/Presets/PBR/metal_palladium_polished.material | 2 +- .../Common/Assets/Materials/Presets/PBR/metal_platinum.material | 2 +- .../Assets/Materials/Presets/PBR/metal_platinum_matte.material | 2 +- .../Materials/Presets/PBR/metal_platinum_polished.material | 2 +- .../Common/Assets/Materials/Presets/PBR/metal_silver.material | 2 +- .../Assets/Materials/Presets/PBR/metal_silver_matte.material | 2 +- .../Assets/Materials/Presets/PBR/metal_silver_polished.material | 2 +- .../Common/Assets/Materials/Presets/PBR/metal_titanium.material | 2 +- .../Assets/Materials/Presets/PBR/metal_titanium_matte.material | 2 +- .../Materials/Presets/PBR/metal_titanium_polished.material | 2 +- .../ReflectionProbe/ReflectionProbeVisualization.material | 2 +- Gems/Atom/Feature/Common/Assets/Materials/basic_grey.material | 2 +- Gems/Atom/TestData/TestData/Materials/AutoBrick/Brick.material | 2 +- Gems/Atom/TestData/TestData/Materials/AutoBrick/Tile.material | 2 +- Gems/Atom/TestData/TestData/Materials/ParallaxRock.material | 2 +- .../SkinTestCases/001_hermanubis_regression_test.material | 2 +- .../SkinTestCases/002_wrinkle_regression_test.material | 2 +- .../StandardMultilayerPbrTestCases/001_ManyFeatures.material | 2 +- .../001_ManyFeatures_Layer2Off.material | 2 +- .../001_ManyFeatures_Layer3Off.material | 2 +- .../StandardMultilayerPbrTestCases/002_ParallaxPdo.material | 2 +- .../StandardMultilayerPbrTestCases/003_Debug_BlendMask.material | 2 +- .../003_Debug_BlendWeights.material | 2 +- .../003_Debug_Displacement.material | 2 +- .../StandardMultilayerPbrTestCases/004_UseVertexColors.material | 2 +- .../StandardMultilayerPbrTestCases/005_UseDisplacement.material | 2 +- .../005_UseDisplacement_Layer2Off.material | 2 +- .../005_UseDisplacement_Layer3Off.material | 2 +- .../005_UseDisplacement_With_BlendMaskTexture.material | 2 +- ...UseDisplacement_With_BlendMaskTexture_AllSameHeight.material | 2 +- ..._UseDisplacement_With_BlendMaskTexture_NoHeightmaps.material | 2 +- .../005_UseDisplacement_With_BlendMaskVertexColors.material | 2 +- .../Materials/StandardPbrTestCases/001_DefaultWhite.material | 2 +- .../Materials/StandardPbrTestCases/002_BaseColorLerp.material | 2 +- .../StandardPbrTestCases/002_BaseColorLinearLight.material | 2 +- .../StandardPbrTestCases/002_BaseColorMultiply.material | 2 +- .../Materials/StandardPbrTestCases/003_MetalMatte.material | 2 +- .../Materials/StandardPbrTestCases/003_MetalPolished.material | 2 +- .../Materials/StandardPbrTestCases/004_MetalMap.material | 2 +- .../Materials/StandardPbrTestCases/005_RoughnessMap.material | 2 +- .../Materials/StandardPbrTestCases/006_SpecularF0Map.material | 2 +- .../007_MultiscatteringCompensationOff.material | 2 +- .../007_MultiscatteringCompensationOn.material | 2 +- .../Materials/StandardPbrTestCases/008_NormalMap.material | 2 +- .../StandardPbrTestCases/008_NormalMap_Bevels.material | 2 +- .../Materials/StandardPbrTestCases/009_Opacity_Blended.material | 2 +- .../009_Opacity_Blended_Alpha_Affects_Specular.material | 2 +- .../009_Opacity_Cutout_PackedAlpha_DoubleSided.material | 2 +- .../009_Opacity_Cutout_SplitAlpha_DoubleSided.material | 2 +- .../009_Opacity_Cutout_SplitAlpha_SingleSided.material | 2 +- .../009_Opacity_Opaque_DoubleSided.material | 2 +- .../StandardPbrTestCases/009_Opacity_TintedTransparent.material | 2 +- .../StandardPbrTestCases/010_AmbientOcclusion.material | 2 +- .../Materials/StandardPbrTestCases/010_BothOcclusion.material | 2 +- .../Materials/StandardPbrTestCases/010_OcclusionBase.material | 2 +- .../StandardPbrTestCases/010_SpecularOcclusion.material | 2 +- .../Materials/StandardPbrTestCases/011_Emissive.material | 2 +- .../Materials/StandardPbrTestCases/012_Parallax_POM.material | 2 +- .../StandardPbrTestCases/012_Parallax_POM_Cutout.material | 2 +- .../Materials/StandardPbrTestCases/013_SpecularAA_Off.material | 2 +- .../Materials/StandardPbrTestCases/013_SpecularAA_On.material | 2 +- .../Materials/StandardPbrTestCases/014_ClearCoat.material | 2 +- .../StandardPbrTestCases/014_ClearCoat_NormalMap.material | 2 +- .../StandardPbrTestCases/014_ClearCoat_NormalMap_2ndUv.material | 2 +- .../StandardPbrTestCases/014_ClearCoat_RoughnessMap.material | 2 +- .../StandardPbrTestCases/015_SubsurfaceScattering.material | 2 +- .../015_SubsurfaceScattering_Transmission.material | 2 +- .../StandardPbrTestCases/100_UvTiling_AmbientOcclusion.material | 2 +- .../StandardPbrTestCases/100_UvTiling_BaseColor.material | 2 +- .../StandardPbrTestCases/100_UvTiling_Emissive.material | 2 +- .../StandardPbrTestCases/100_UvTiling_Metallic.material | 2 +- .../Materials/StandardPbrTestCases/100_UvTiling_Normal.material | 2 +- .../100_UvTiling_Normal_Dome_Rotate20.material | 2 +- .../100_UvTiling_Normal_Dome_Rotate90.material | 2 +- .../100_UvTiling_Normal_Dome_ScaleOnlyU.material | 2 +- .../100_UvTiling_Normal_Dome_ScaleOnlyV.material | 2 +- .../100_UvTiling_Normal_Dome_ScaleUniform.material | 2 +- .../100_UvTiling_Normal_Dome_TransformAll.material | 2 +- .../StandardPbrTestCases/100_UvTiling_Opacity.material | 2 +- .../StandardPbrTestCases/100_UvTiling_Parallax_A.material | 2 +- .../StandardPbrTestCases/100_UvTiling_Parallax_B.material | 2 +- .../StandardPbrTestCases/100_UvTiling_Roughness.material | 2 +- .../StandardPbrTestCases/100_UvTiling_SpecularF0.material | 2 +- .../101_DetailMaps_BaseNoDetailMaps.material | 2 +- .../Materials/StandardPbrTestCases/102_DetailMaps_All.material | 2 +- .../StandardPbrTestCases/103_DetailMaps_BaseColor.material | 2 +- .../103_DetailMaps_BaseColorWithMask.material | 2 +- .../StandardPbrTestCases/104_DetailMaps_Normal.material | 2 +- .../StandardPbrTestCases/104_DetailMaps_NormalWithMask.material | 2 +- .../105_DetailMaps_BlendMaskUsingDetailUVs.material | 2 +- .../Materials/StandardPbrTestCases/UvTilingBase.material | 2 +- .../TestData/Objects/ModelHotReload/DisplayVertexColor.material | 2 +- .../Assets/Materials/AnodizedMetal/anodized_metal.material | 2 +- .../Assets/Materials/Asphalt/asphalt.material | 2 +- .../Assets/Materials/BasicFabric/basic_fabric.material | 2 +- .../Assets/Materials/BrushedSteel/brushed_steel.material | 2 +- .../Assets/Materials/CarPaint/car_paint.material | 2 +- .../ReferenceMaterials/Assets/Materials/Coal/coal.material | 2 +- .../Assets/Materials/ConcreteStucco/concrete_stucco.material | 2 +- .../ReferenceMaterials/Assets/Materials/Copper/copper.material | 2 +- .../ReferenceMaterials/Assets/Materials/Fabric/fabric.material | 2 +- .../Assets/Materials/GalvanizedSteel/galvanized_steel.material | 2 +- .../Assets/Materials/GlazedClay/glazed_clay.material | 2 +- .../ReferenceMaterials/Assets/Materials/Gloss/gloss.material | 2 +- .../ReferenceMaterials/Assets/Materials/Gold/gold.material | 2 +- .../ReferenceMaterials/Assets/Materials/Ground/ground.material | 2 +- .../ReferenceMaterials/Assets/Materials/Iron/iron.material | 2 +- .../Assets/Materials/Leather/dark_leather.material | 2 +- .../Assets/Materials/Light_Leather/light_leather.material | 2 +- .../Materials/MicrofiberFabric/microfiber_fabric.material | 2 +- .../Assets/Materials/MixedStones/mixed_stones.material | 2 +- .../ReferenceMaterials/Assets/Materials/Nickle/nickle.material | 2 +- .../Assets/Materials/Plaster/plaster.material | 2 +- .../Assets/Materials/Plastic_01/plastic_01.material | 2 +- .../Assets/Materials/Plastic_02/plastic_02.material | 2 +- .../Assets/Materials/Plastic_03/plastic_03.material | 2 +- .../Assets/Materials/Platinum/platinum.material | 2 +- .../Assets/Materials/Porcelain/porcelain.material | 2 +- .../Materials/RotaryBrushedSteel/rotary_brushed_steel.material | 2 +- .../ReferenceMaterials/Assets/Materials/Rust/rust.material | 2 +- .../ReferenceMaterials/Assets/Materials/Suede/suede.material | 2 +- .../Assets/Materials/TireRubber/tire_rubber.material | 2 +- .../Assets/Materials/WoodPlanks/wood_planks.material | 2 +- .../Assets/Materials/WornMetal/warn_metal.material | 2 +- .../ReferenceMaterials/Assets/Materials/black.material | 2 +- .../ReferenceMaterials/Assets/Materials/blue.material | 2 +- .../ReferenceMaterials/Assets/Materials/green.material | 2 +- .../ReferenceMaterials/Assets/Materials/grey.material | 2 +- .../ReferenceMaterials/Assets/Materials/red.material | 2 +- .../ReferenceMaterials/Assets/Materials/white.material | 2 +- .../TestData/Test_Sponza_Material_Conversion_black.material | 2 +- .../TestData/Test_Sponza_Material_Conversion_green.material | 2 +- .../TestData/Test_Sponza_Material_Conversion_mat_arch.material | 2 +- .../Test_Sponza_Material_Conversion_mat_bricks.material | 2 +- .../TestData/Test_Sponza_Material_Conversion_mat_floor.material | 2 +- .../TestData/Test_Sponza_Material_Conversion_mat_roof.material | 2 +- .../TestData/Test_Sponza_Material_Conversion_phong5.material | 2 +- .../TestData/Test_Sponza_Material_Conversion_red.material | 2 +- .../TestData/Test_Sponza_Material_Conversion_white.material | 2 +- .../Sponza/Assets/objects/lightBlocker_lambert1.material | 2 +- .../Atom/Scripts/Python/DCC_Materials/maya_materials_export.py | 2 +- .../SDK/Atom/Scripts/Python/DCC_Materials/pbr.material | 2 +- .../SDK/Maya/Scripts/Python/dcc_materials/main.py | 2 +- .../SDK/Maya/Scripts/Python/dcc_materials/materials_export.py | 2 +- .../SDK/Maya/Scripts/Python/dcc_materials/pbr.material | 2 +- .../Python/kitbash_converter/standardPBR.template.material | 2 +- .../Python/legacy_asset_converter/standardPBR.template.material | 2 +- .../Scripts/Python/maya_dcc_materials/maya_materials_export.py | 2 +- .../Python/maya_dcc_materials/standardpbr.template.material | 2 +- .../stingraypbs_converter/StandardPBR_AllProperties.material | 2 +- .../Substance/resources/atom/StandardPBR_AllProperties.material | 2 +- .../SDK/Substance/resources/atom/atom.material | 2 +- .../SDK/Substance/resources/atom/atom_variant00.material | 2 +- .../Tools/Resources/Atom/StandardPBR_AllProperties.material | 2 +- .../cloth/Chicken/Actor/chicken_chicken_body_mat.material | 2 +- .../cloth/Chicken/Actor/chicken_chicken_eye_mat.material | 2 +- .../Assets/Objects/cloth/Environment/cloth_blinds.material | 2 +- .../Objects/cloth/Environment/cloth_blinds_broken.material | 2 +- .../cloth/Environment/cloth_locked_corners_four.material | 2 +- .../Objects/cloth/Environment/cloth_locked_corners_two.material | 2 +- .../Assets/Objects/cloth/Environment/cloth_locked_edge.material | 2 +- .../Assets/Objects/_Primitives/_Box_1x1_MiddleGrey.material | 2 +- .../Objects/_Primitives/_Cylinder_1x1_MiddleGrey.material | 2 +- .../Assets/Objects/_Primitives/_Sphere_1x1_MiddleGrey.material | 2 +- .../Terrain/Assets/Materials/Terrain/DefaultPbrTerrain.material | 2 +- 231 files changed, 231 insertions(+), 231 deletions(-) diff --git a/AutomatedTesting/Gem/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_black.material b/AutomatedTesting/Gem/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_black.material index cc2c9e785b..d15aa620c7 100644 --- a/AutomatedTesting/Gem/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_black.material +++ b/AutomatedTesting/Gem/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_black.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/AutomatedTesting/Gem/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_green.material b/AutomatedTesting/Gem/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_green.material index a4bfb73d12..579359b085 100644 --- a/AutomatedTesting/Gem/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_green.material +++ b/AutomatedTesting/Gem/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_green.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/AutomatedTesting/Gem/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_mat_arch.material b/AutomatedTesting/Gem/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_mat_arch.material index fe9c54bc02..88d5fc0fc6 100644 --- a/AutomatedTesting/Gem/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_mat_arch.material +++ b/AutomatedTesting/Gem/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_mat_arch.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/AutomatedTesting/Gem/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_mat_bricks.material b/AutomatedTesting/Gem/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_mat_bricks.material index a19afa33e2..7244397ee9 100644 --- a/AutomatedTesting/Gem/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_mat_bricks.material +++ b/AutomatedTesting/Gem/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_mat_bricks.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/AutomatedTesting/Gem/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_mat_floor.material b/AutomatedTesting/Gem/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_mat_floor.material index 0c1208d8fb..8a3f289c26 100644 --- a/AutomatedTesting/Gem/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_mat_floor.material +++ b/AutomatedTesting/Gem/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_mat_floor.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/AutomatedTesting/Gem/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_mat_roof.material b/AutomatedTesting/Gem/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_mat_roof.material index 6aad4d644a..7bc193978f 100644 --- a/AutomatedTesting/Gem/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_mat_roof.material +++ b/AutomatedTesting/Gem/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_mat_roof.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/AutomatedTesting/Gem/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_phong5.material b/AutomatedTesting/Gem/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_phong5.material index 302589dc85..a53cbef4e4 100644 --- a/AutomatedTesting/Gem/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_phong5.material +++ b/AutomatedTesting/Gem/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_phong5.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/AutomatedTesting/Gem/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_red.material b/AutomatedTesting/Gem/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_red.material index 5217a4e4be..6ddb645319 100644 --- a/AutomatedTesting/Gem/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_red.material +++ b/AutomatedTesting/Gem/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_red.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/AutomatedTesting/Gem/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_white.material b/AutomatedTesting/Gem/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_white.material index dba44f7b49..e3d310cd15 100644 --- a/AutomatedTesting/Gem/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_white.material +++ b/AutomatedTesting/Gem/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_white.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "emissive": { "color": [ diff --git a/AutomatedTesting/Gem/Sponza/Assets/objects/lightBlocker_lambert1.material b/AutomatedTesting/Gem/Sponza/Assets/objects/lightBlocker_lambert1.material index c8e9f1f8f7..35677a81c6 100644 --- a/AutomatedTesting/Gem/Sponza/Assets/objects/lightBlocker_lambert1.material +++ b/AutomatedTesting/Gem/Sponza/Assets/objects/lightBlocker_lambert1.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "emissive": { "color": [ diff --git a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic.material index 32ac8dfd10..6af3ceb0c1 100644 --- a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic.material +++ b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic.material @@ -1,6 +1,6 @@ { "materialType": "Materials/Types/StandardPBR.materialtype", - "propertyLayoutVersion": 1, + "materialTypeVersion": 1, "properties": { "baseColor": { "color": [ 1.0, 1.0, 1.0 ], diff --git a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r00.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r00.material index 1c1096bf12..541bd83981 100644 --- a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r00.material +++ b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r00.material @@ -1,7 +1,7 @@ { "parentMaterial": "./basic.material", "materialType": "Materials/Types/StandardPBR.materialtype", - "propertyLayoutVersion": 1, + "materialTypeVersion": 1, "properties": { "metallic": { "factor": 0.0 diff --git a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r01.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r01.material index 33148f3f73..19691258e0 100644 --- a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r01.material +++ b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r01.material @@ -1,7 +1,7 @@ { "parentMaterial": "./basic.material", "materialType": "Materials/Types/StandardPBR.materialtype", - "propertyLayoutVersion": 1, + "materialTypeVersion": 1, "properties": { "metallic": { "factor": 0.0 diff --git a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r02.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r02.material index 38339454cb..46fda2aab1 100644 --- a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r02.material +++ b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r02.material @@ -1,7 +1,7 @@ { "parentMaterial": "./basic.material", "materialType": "Materials/Types/StandardPBR.materialtype", - "propertyLayoutVersion": 1, + "materialTypeVersion": 1, "properties": { "metallic": { "factor": 0.0 diff --git a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r03.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r03.material index e21ab5775a..79cf4bf401 100644 --- a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r03.material +++ b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r03.material @@ -1,7 +1,7 @@ { "parentMaterial": "./basic.material", "materialType": "Materials/Types/StandardPBR.materialtype", - "propertyLayoutVersion": 1, + "materialTypeVersion": 1, "properties": { "metallic": { "factor": 0.0 diff --git a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r04.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r04.material index 0272e66081..9aabf3e158 100644 --- a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r04.material +++ b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r04.material @@ -1,7 +1,7 @@ { "parentMaterial": "./basic.material", "materialType": "Materials/Types/StandardPBR.materialtype", - "propertyLayoutVersion": 1, + "materialTypeVersion": 1, "properties": { "metallic": { "factor": 0.0 diff --git a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r05.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r05.material index 67d51777a4..8b02f225fc 100644 --- a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r05.material +++ b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r05.material @@ -1,7 +1,7 @@ { "parentMaterial": "./basic.material", "materialType": "Materials/Types/StandardPBR.materialtype", - "propertyLayoutVersion": 1, + "materialTypeVersion": 1, "properties": { "metallic": { "factor": 0.0 diff --git a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r06.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r06.material index 3136f654e6..5b089da4bd 100644 --- a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r06.material +++ b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r06.material @@ -1,7 +1,7 @@ { "parentMaterial": "./basic.material", "materialType": "Materials/Types/StandardPBR.materialtype", - "propertyLayoutVersion": 1, + "materialTypeVersion": 1, "properties": { "metallic": { "factor": 0.0 diff --git a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r07.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r07.material index a79744ea11..25741cf689 100644 --- a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r07.material +++ b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r07.material @@ -1,7 +1,7 @@ { "parentMaterial": "./basic.material", "materialType": "Materials/Types/StandardPBR.materialtype", - "propertyLayoutVersion": 1, + "materialTypeVersion": 1, "properties": { "metallic": { "factor": 0.0 diff --git a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r08.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r08.material index 1372283500..04103273f2 100644 --- a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r08.material +++ b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r08.material @@ -1,7 +1,7 @@ { "parentMaterial": "./basic.material", "materialType": "Materials/Types/StandardPBR.materialtype", - "propertyLayoutVersion": 1, + "materialTypeVersion": 1, "properties": { "metallic": { "factor": 0.0 diff --git a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r09.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r09.material index d1c951e53c..74eb68da99 100644 --- a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r09.material +++ b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r09.material @@ -1,7 +1,7 @@ { "parentMaterial": "./basic.material", "materialType": "Materials/Types/StandardPBR.materialtype", - "propertyLayoutVersion": 1, + "materialTypeVersion": 1, "properties": { "metallic": { "factor": 0.0 diff --git a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r10.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r10.material index d34fc46530..3533ca6676 100644 --- a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r10.material +++ b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m00_r10.material @@ -1,7 +1,7 @@ { "parentMaterial": "./basic.material", "materialType": "Materials/Types/StandardPBR.materialtype", - "propertyLayoutVersion": 1, + "materialTypeVersion": 1, "properties": { "metallic": { "factor": 0.0 diff --git a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r00.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r00.material index 92ddfec7c4..d2ce0fadc9 100644 --- a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r00.material +++ b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r00.material @@ -1,7 +1,7 @@ { "parentMaterial": "./basic.material", "materialType": "Materials/Types/StandardPBR.materialtype", - "propertyLayoutVersion": 1, + "materialTypeVersion": 1, "properties": { "metallic": { "factor": 1.0 diff --git a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r01.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r01.material index 874422384a..8d96ea6217 100644 --- a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r01.material +++ b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r01.material @@ -1,7 +1,7 @@ { "parentMaterial": "./basic.material", "materialType": "Materials/Types/StandardPBR.materialtype", - "propertyLayoutVersion": 1, + "materialTypeVersion": 1, "properties": { "metallic": { "factor": 1.0 diff --git a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r02.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r02.material index b017add10b..e8feb87283 100644 --- a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r02.material +++ b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r02.material @@ -1,7 +1,7 @@ { "parentMaterial": "./basic.material", "materialType": "Materials/Types/StandardPBR.materialtype", - "propertyLayoutVersion": 1, + "materialTypeVersion": 1, "properties": { "metallic": { "factor": 1.0 diff --git a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r03.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r03.material index 5353d651c8..c14591bd52 100644 --- a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r03.material +++ b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r03.material @@ -1,7 +1,7 @@ { "parentMaterial": "./basic.material", "materialType": "Materials/Types/StandardPBR.materialtype", - "propertyLayoutVersion": 1, + "materialTypeVersion": 1, "properties": { "metallic": { "factor": 1.0 diff --git a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r04.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r04.material index 6dd47e4e3b..60a3167f02 100644 --- a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r04.material +++ b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r04.material @@ -1,7 +1,7 @@ { "parentMaterial": "./basic.material", "materialType": "Materials/Types/StandardPBR.materialtype", - "propertyLayoutVersion": 1, + "materialTypeVersion": 1, "properties": { "metallic": { "factor": 1.0 diff --git a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r05.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r05.material index 04912cbfd4..d71ff06961 100644 --- a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r05.material +++ b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r05.material @@ -1,7 +1,7 @@ { "parentMaterial": "./basic.material", "materialType": "Materials/Types/StandardPBR.materialtype", - "propertyLayoutVersion": 1, + "materialTypeVersion": 1, "properties": { "metallic": { "factor": 1.0 diff --git a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r06.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r06.material index 27f7f6ff42..6fa8cfe1a6 100644 --- a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r06.material +++ b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r06.material @@ -1,7 +1,7 @@ { "parentMaterial": "./basic.material", "materialType": "Materials/Types/StandardPBR.materialtype", - "propertyLayoutVersion": 1, + "materialTypeVersion": 1, "properties": { "metallic": { "factor": 1.0 diff --git a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r07.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r07.material index e2b5df681c..773cc66f03 100644 --- a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r07.material +++ b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r07.material @@ -1,7 +1,7 @@ { "parentMaterial": "./basic.material", "materialType": "Materials/Types/StandardPBR.materialtype", - "propertyLayoutVersion": 1, + "materialTypeVersion": 1, "properties": { "metallic": { "factor": 1.0 diff --git a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r08.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r08.material index 5418f9c855..6971597d1d 100644 --- a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r08.material +++ b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r08.material @@ -1,7 +1,7 @@ { "parentMaterial": "./basic.material", "materialType": "Materials/Types/StandardPBR.materialtype", - "propertyLayoutVersion": 1, + "materialTypeVersion": 1, "properties": { "metallic": { "factor": 1.0 diff --git a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r09.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r09.material index dd1ec3489a..c2d8cc47bd 100644 --- a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r09.material +++ b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r09.material @@ -1,7 +1,7 @@ { "parentMaterial": "./basic.material", "materialType": "Materials/Types/StandardPBR.materialtype", - "propertyLayoutVersion": 1, + "materialTypeVersion": 1, "properties": { "metallic": { "factor": 1.0 diff --git a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r10.material b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r10.material index 5f9317d2cc..906879b0ea 100644 --- a/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r10.material +++ b/AutomatedTesting/Levels/Graphics/PbrMaterialChart/materials/basic_m10_r10.material @@ -1,7 +1,7 @@ { "parentMaterial": "./basic.material", "materialType": "Materials/Types/StandardPBR.materialtype", - "propertyLayoutVersion": 1, + "materialTypeVersion": 1, "properties": { "metallic": { "factor": 1.0 diff --git a/AutomatedTesting/Materials/DefaultPBRTransparent.material b/AutomatedTesting/Materials/DefaultPBRTransparent.material index 7c8aa6cf94..a7000d5371 100644 --- a/AutomatedTesting/Materials/DefaultPBRTransparent.material +++ b/AutomatedTesting/Materials/DefaultPBRTransparent.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "Materials/Presets/PBR/default_grid.material", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "opacity": { "mode": "Blended" diff --git a/AutomatedTesting/Materials/basic_grey.material b/AutomatedTesting/Materials/basic_grey.material index 0b890db4c6..6ecc1e029a 100644 --- a/AutomatedTesting/Materials/basic_grey.material +++ b/AutomatedTesting/Materials/basic_grey.material @@ -1,6 +1,6 @@ { "materialType": "Materials/Types/StandardPBR.materialtype", - "propertyLayoutVersion": 1, + "materialTypeVersion": 1, "properties": { "baseColor": { "color": [ 0.18, 0.18, 0.18 ], diff --git a/AutomatedTesting/Objects/MorphTargets/DisplayWrinkleMaskBlendValues.material b/AutomatedTesting/Objects/MorphTargets/DisplayWrinkleMaskBlendValues.material index 878b3ac39f..52c323b454 100644 --- a/AutomatedTesting/Objects/MorphTargets/DisplayWrinkleMaskBlendValues.material +++ b/AutomatedTesting/Objects/MorphTargets/DisplayWrinkleMaskBlendValues.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/Skin.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "wrinkleLayers": { "count": 3, diff --git a/Gems/Atom/Feature/Common/Assets/Materials/OcclusionCullingPlane/OcclusionCullingPlaneTransparentVisualization.material b/Gems/Atom/Feature/Common/Assets/Materials/OcclusionCullingPlane/OcclusionCullingPlaneTransparentVisualization.material index 981e392eef..11d8d44e94 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/OcclusionCullingPlane/OcclusionCullingPlaneTransparentVisualization.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/OcclusionCullingPlane/OcclusionCullingPlaneTransparentVisualization.material @@ -1,6 +1,6 @@ { "materialType": "Materials\\Types\\StandardPBR.materialtype", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "general": { "enableShadows": false, diff --git a/Gems/Atom/Feature/Common/Assets/Materials/OcclusionCullingPlane/OcclusionCullingPlaneVisualization.material b/Gems/Atom/Feature/Common/Assets/Materials/OcclusionCullingPlane/OcclusionCullingPlaneVisualization.material index 4446cc2d9d..50440b714f 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/OcclusionCullingPlane/OcclusionCullingPlaneVisualization.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/OcclusionCullingPlane/OcclusionCullingPlaneVisualization.material @@ -1,6 +1,6 @@ { "materialType": "Materials\\Types\\StandardPBR.materialtype", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "general": { "enableShadows": false, diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/default_grid.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/default_grid.material index 387d022bd2..05345a1649 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/default_grid.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/default_grid.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "textureMap": "Textures/Default/default_basecolor.tif" diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_aluminum.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_aluminum.material index ece08a3492..38ebe17687 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_aluminum.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_aluminum.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_aluminum_matte.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_aluminum_matte.material index afc2bb56f3..c3ec8a9266 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_aluminum_matte.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_aluminum_matte.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_aluminum_polished.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_aluminum_polished.material index 27fa2bb11e..90c62b6d76 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_aluminum_polished.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_aluminum_polished.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_brass.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_brass.material index 77f658aafa..e456d147e1 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_brass.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_brass.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_brass_matte.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_brass_matte.material index d9c72471c8..11705a2bf8 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_brass_matte.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_brass_matte.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_brass_polished.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_brass_polished.material index 57b5a15e54..5a2b2433d4 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_brass_polished.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_brass_polished.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_chrome.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_chrome.material index 50e21d481c..cb8a8fad1e 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_chrome.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_chrome.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_chrome_matte.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_chrome_matte.material index 55e1b0c3bc..1592c4c095 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_chrome_matte.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_chrome_matte.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_chrome_polished.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_chrome_polished.material index ce6599837c..6c2e403fc9 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_chrome_polished.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_chrome_polished.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_cobalt.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_cobalt.material index be4067570d..ea399542c0 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_cobalt.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_cobalt.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_cobalt_matte.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_cobalt_matte.material index 09aed7ba63..c20f50c95e 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_cobalt_matte.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_cobalt_matte.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_cobalt_polished.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_cobalt_polished.material index c1e6ca7798..7f00525f4d 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_cobalt_polished.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_cobalt_polished.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_copper.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_copper.material index 3970606e7d..23b9fba63d 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_copper.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_copper.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_copper_matte.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_copper_matte.material index d0385eebde..e16cf0bb4e 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_copper_matte.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_copper_matte.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_copper_polished.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_copper_polished.material index 5e52702d21..53fac02767 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_copper_polished.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_copper_polished.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold.material index 2638e76a74..6ee7eed53f 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_matte.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_matte.material index fd21141048..6fa842b6f7 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_matte.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_matte.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_polished.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_polished.material index 5861c7b533..55a5412af1 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_polished.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_gold_polished.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_iron.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_iron.material index c35f8ca755..cac874c583 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_iron.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_iron.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_iron_matte.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_iron_matte.material index 1ed1dd4dad..1373ff0108 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_iron_matte.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_iron_matte.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_iron_polished.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_iron_polished.material index e60d31bd6d..59e1330993 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_iron_polished.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_iron_polished.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_mercury.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_mercury.material index e2d304ab32..82fbde8db3 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_mercury.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_mercury.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_nickel.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_nickel.material index a158fa2777..0e3aacc785 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_nickel.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_nickel.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_nickel_matte.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_nickel_matte.material index 4ae75d3a42..db72087d30 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_nickel_matte.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_nickel_matte.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_nickel_polished.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_nickel_polished.material index 48effb1c94..d4467508ae 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_nickel_polished.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_nickel_polished.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_palladium.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_palladium.material index 2b2a6f148a..0e91117519 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_palladium.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_palladium.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_palladium_matte.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_palladium_matte.material index 1ab89f90ad..b7a5648fcf 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_palladium_matte.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_palladium_matte.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_palladium_polished.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_palladium_polished.material index 5b7879c3fa..d8e398a7de 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_palladium_polished.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_palladium_polished.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_platinum.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_platinum.material index 678c3321ce..f450fb66b0 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_platinum.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_platinum.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_platinum_matte.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_platinum_matte.material index 7afa0809bb..a515ba5aaf 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_platinum_matte.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_platinum_matte.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_platinum_polished.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_platinum_polished.material index df6a8fb595..5b3d184631 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_platinum_polished.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_platinum_polished.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_silver.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_silver.material index a53c252144..14247e6421 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_silver.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_silver.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_silver_matte.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_silver_matte.material index 588f90c3d1..e98fd5376d 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_silver_matte.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_silver_matte.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_silver_polished.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_silver_polished.material index 96fbdee686..ae757460a5 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_silver_polished.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_silver_polished.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_titanium.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_titanium.material index a34430bd7d..c3ce0014a1 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_titanium.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_titanium.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_titanium_matte.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_titanium_matte.material index 52ebc71d9c..0745b4894d 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_titanium_matte.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_titanium_matte.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_titanium_polished.material b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_titanium_polished.material index b9dd832849..ff2d7734ad 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_titanium_polished.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/Presets/PBR/metal_titanium_polished.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/Feature/Common/Assets/Materials/ReflectionProbe/ReflectionProbeVisualization.material b/Gems/Atom/Feature/Common/Assets/Materials/ReflectionProbe/ReflectionProbeVisualization.material index e9bb191532..f4063ba923 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/ReflectionProbe/ReflectionProbeVisualization.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/ReflectionProbe/ReflectionProbeVisualization.material @@ -1,6 +1,6 @@ { "materialType": "ReflectionProbeVisualization.materialtype", - "propertyLayoutVersion": 1, + "materialTypeVersion": 1, "properties": { "general": { "enableShadows": false, diff --git a/Gems/Atom/Feature/Common/Assets/Materials/basic_grey.material b/Gems/Atom/Feature/Common/Assets/Materials/basic_grey.material index 0b890db4c6..6ecc1e029a 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/basic_grey.material +++ b/Gems/Atom/Feature/Common/Assets/Materials/basic_grey.material @@ -1,6 +1,6 @@ { "materialType": "Materials/Types/StandardPBR.materialtype", - "propertyLayoutVersion": 1, + "materialTypeVersion": 1, "properties": { "baseColor": { "color": [ 0.18, 0.18, 0.18 ], diff --git a/Gems/Atom/TestData/TestData/Materials/AutoBrick/Brick.material b/Gems/Atom/TestData/TestData/Materials/AutoBrick/Brick.material index aaa2dc455f..061510d4c2 100644 --- a/Gems/Atom/TestData/TestData/Materials/AutoBrick/Brick.material +++ b/Gems/Atom/TestData/TestData/Materials/AutoBrick/Brick.material @@ -2,7 +2,7 @@ "description": "", "materialType": "TestData/Materials/Types/AutoBrick.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "appearance": { "ao": 0.5252525210380554, diff --git a/Gems/Atom/TestData/TestData/Materials/AutoBrick/Tile.material b/Gems/Atom/TestData/TestData/Materials/AutoBrick/Tile.material index 37c17e5616..b81ff4110b 100644 --- a/Gems/Atom/TestData/TestData/Materials/AutoBrick/Tile.material +++ b/Gems/Atom/TestData/TestData/Materials/AutoBrick/Tile.material @@ -2,7 +2,7 @@ "description": "", "materialType": "TestData/Materials/Types/AutoBrick.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "appearance": { "ao": 0.010100999847054482, diff --git a/Gems/Atom/TestData/TestData/Materials/ParallaxRock.material b/Gems/Atom/TestData/TestData/Materials/ParallaxRock.material index c9276216eb..1e140b9cf7 100644 --- a/Gems/Atom/TestData/TestData/Materials/ParallaxRock.material +++ b/Gems/Atom/TestData/TestData/Materials/ParallaxRock.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "Materials/Presets/PBR/default_grid.material", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "occlusion": { "diffuseTextureMap": "TestData/Textures/cc0/Rock030_2K_AmbientOcclusion.jpg" diff --git a/Gems/Atom/TestData/TestData/Materials/SkinTestCases/001_hermanubis_regression_test.material b/Gems/Atom/TestData/TestData/Materials/SkinTestCases/001_hermanubis_regression_test.material index e6c032b0f9..be607e7721 100644 --- a/Gems/Atom/TestData/TestData/Materials/SkinTestCases/001_hermanubis_regression_test.material +++ b/Gems/Atom/TestData/TestData/Materials/SkinTestCases/001_hermanubis_regression_test.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/Skin.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/TestData/TestData/Materials/SkinTestCases/002_wrinkle_regression_test.material b/Gems/Atom/TestData/TestData/Materials/SkinTestCases/002_wrinkle_regression_test.material index 9b955ddb1d..4222108b5e 100644 --- a/Gems/Atom/TestData/TestData/Materials/SkinTestCases/002_wrinkle_regression_test.material +++ b/Gems/Atom/TestData/TestData/Materials/SkinTestCases/002_wrinkle_regression_test.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/Skin.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/001_ManyFeatures.material b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/001_ManyFeatures.material index 415bd36dcf..f683ad052d 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/001_ManyFeatures.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/001_ManyFeatures.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardMultilayerPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "blend": { "enableLayer2": true, diff --git a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/001_ManyFeatures_Layer2Off.material b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/001_ManyFeatures_Layer2Off.material index d91cfb34eb..042f31f3ec 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/001_ManyFeatures_Layer2Off.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/001_ManyFeatures_Layer2Off.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardMultilayerPBR.materialtype", "parentMaterial": "TestData/Materials/StandardMultilayerPbrTestCases/001_ManyFeatures.material", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "blend": { "enableLayer2": false diff --git a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/001_ManyFeatures_Layer3Off.material b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/001_ManyFeatures_Layer3Off.material index 3ee48df612..59fc168a6c 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/001_ManyFeatures_Layer3Off.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/001_ManyFeatures_Layer3Off.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardMultilayerPBR.materialtype", "parentMaterial": "TestData/Materials/StandardMultilayerPbrTestCases/001_ManyFeatures.material", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "blend": { "enableLayer3": false diff --git a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/002_ParallaxPdo.material b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/002_ParallaxPdo.material index 64adf317a9..a1d3c288ea 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/002_ParallaxPdo.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/002_ParallaxPdo.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardMultilayerPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "blend": { "enableLayer2": true, diff --git a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/003_Debug_BlendMask.material b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/003_Debug_BlendMask.material index ffcbf3ce7e..b7be8ab18f 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/003_Debug_BlendMask.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/003_Debug_BlendMask.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardMultilayerPBR.materialtype", "parentMaterial": "TestData/Materials/StandardMultilayerPbrTestCases/002_ParallaxPdo.material", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "blend": { "debugDrawMode": "BlendMask" diff --git a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/003_Debug_BlendWeights.material b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/003_Debug_BlendWeights.material index 8d13ac781f..99a9c9f382 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/003_Debug_BlendWeights.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/003_Debug_BlendWeights.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardMultilayerPBR.materialtype", "parentMaterial": "TestData/Materials/StandardMultilayerPbrTestCases/002_ParallaxPdo.material", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "blend": { "debugDrawMode": "FinalBlendWeights" diff --git a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/003_Debug_Displacement.material b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/003_Debug_Displacement.material index 7aff50cb56..6dbee69845 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/003_Debug_Displacement.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/003_Debug_Displacement.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardMultilayerPBR.materialtype", "parentMaterial": "TestData/Materials/StandardMultilayerPbrTestCases/002_ParallaxPdo.material", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "blend": { "debugDrawMode": "Displacement" diff --git a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/004_UseVertexColors.material b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/004_UseVertexColors.material index ea3ea8b519..b53df9a505 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/004_UseVertexColors.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/004_UseVertexColors.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardMultilayerPBR.materialtype", "parentMaterial": "TestData/Materials/StandardMultilayerPbrTestCases/002_ParallaxPdo.material", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "blend": { "blendSource": "BlendMaskVertexColors" diff --git a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement.material b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement.material index 9163fe0a0c..f313080cce 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardMultilayerPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "blend": { "blendSource": "Displacement", diff --git a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_Layer2Off.material b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_Layer2Off.material index 9413e35128..6f64bcd49f 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_Layer2Off.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_Layer2Off.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardMultilayerPBR.materialtype", "parentMaterial": "TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement.material", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "blend": { "enableLayer2": false diff --git a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_Layer3Off.material b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_Layer3Off.material index 93e0b21780..8b32223c82 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_Layer3Off.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_Layer3Off.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardMultilayerPBR.materialtype", "parentMaterial": "TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement.material", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "blend": { "enableLayer3": false diff --git a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_With_BlendMaskTexture.material b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_With_BlendMaskTexture.material index 6b062f6d1e..023316c5f6 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_With_BlendMaskTexture.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_With_BlendMaskTexture.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardMultilayerPBR.materialtype", "parentMaterial": "TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement.material", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "blend": { "blendSource": "Displacement_With_BlendMaskTexture" diff --git a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_With_BlendMaskTexture_AllSameHeight.material b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_With_BlendMaskTexture_AllSameHeight.material index 0e6519afd4..d88802d4de 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_With_BlendMaskTexture_AllSameHeight.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_With_BlendMaskTexture_AllSameHeight.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardMultilayerPBR.materialtype", "parentMaterial": "TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_With_BlendMaskTexture.material", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "blend": { "displacementBlendDistance": 0.0010000000474974514 diff --git a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_With_BlendMaskTexture_NoHeightmaps.material b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_With_BlendMaskTexture_NoHeightmaps.material index b5b5656084..9ba4d20a9a 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_With_BlendMaskTexture_NoHeightmaps.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_With_BlendMaskTexture_NoHeightmaps.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardMultilayerPBR.materialtype", "parentMaterial": "TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_With_BlendMaskTexture.material", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "layer1_parallax": { "offset": -0.03200000151991844, diff --git a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_With_BlendMaskVertexColors.material b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_With_BlendMaskVertexColors.material index 8461ea429c..51219aa180 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_With_BlendMaskVertexColors.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_With_BlendMaskVertexColors.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardMultilayerPBR.materialtype", "parentMaterial": "TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement.material", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "blend": { "blendSource": "Displacement_With_BlendMaskVertexColors", diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/001_DefaultWhite.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/001_DefaultWhite.material index 2e4eee7f8e..164b73c892 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/001_DefaultWhite.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/001_DefaultWhite.material @@ -2,5 +2,5 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3 + "materialTypeVersion": 3 } \ No newline at end of file diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/002_BaseColorLerp.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/002_BaseColorLerp.material index f8214e1b2e..29329a03a2 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/002_BaseColorLerp.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/002_BaseColorLerp.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/002_BaseColorLinearLight.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/002_BaseColorLinearLight.material index bf31a4a111..46a8fd70ef 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/002_BaseColorLinearLight.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/002_BaseColorLinearLight.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/002_BaseColorMultiply.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/002_BaseColorMultiply.material index b3b67448ea..7abf4ca40c 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/002_BaseColorMultiply.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/002_BaseColorMultiply.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/003_MetalMatte.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/003_MetalMatte.material index 12690076c3..73ad13e27b 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/003_MetalMatte.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/003_MetalMatte.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/003_MetalPolished.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/003_MetalPolished.material index 41496bd801..9dea40d6ec 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/003_MetalPolished.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/003_MetalPolished.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/004_MetalMap.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/004_MetalMap.material index ebc65557ec..d20e354a53 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/004_MetalMap.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/004_MetalMap.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/005_RoughnessMap.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/005_RoughnessMap.material index e770537005..283c6ac60b 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/005_RoughnessMap.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/005_RoughnessMap.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/006_SpecularF0Map.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/006_SpecularF0Map.material index d0e0dccf1e..11228e2199 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/006_SpecularF0Map.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/006_SpecularF0Map.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/007_MultiscatteringCompensationOff.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/007_MultiscatteringCompensationOff.material index de9886ac46..3b9779aac1 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/007_MultiscatteringCompensationOff.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/007_MultiscatteringCompensationOff.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/007_MultiscatteringCompensationOn.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/007_MultiscatteringCompensationOn.material index 411646effc..dbbcdc631d 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/007_MultiscatteringCompensationOn.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/007_MultiscatteringCompensationOn.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/008_NormalMap.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/008_NormalMap.material index c5561823ed..4b2842a594 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/008_NormalMap.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/008_NormalMap.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/008_NormalMap_Bevels.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/008_NormalMap_Bevels.material index b26cb927d0..aec3bbf478 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/008_NormalMap_Bevels.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/008_NormalMap_Bevels.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "normal": { "factor": 0.30000001192092898, diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/009_Opacity_Blended.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/009_Opacity_Blended.material index 98dd6baecd..1528403868 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/009_Opacity_Blended.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/009_Opacity_Blended.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/009_Opacity_Blended_Alpha_Affects_Specular.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/009_Opacity_Blended_Alpha_Affects_Specular.material index dbaec36136..20f5ccf098 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/009_Opacity_Blended_Alpha_Affects_Specular.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/009_Opacity_Blended_Alpha_Affects_Specular.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/009_Opacity_Cutout_PackedAlpha_DoubleSided.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/009_Opacity_Cutout_PackedAlpha_DoubleSided.material index 5545e5a482..d8683681c4 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/009_Opacity_Cutout_PackedAlpha_DoubleSided.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/009_Opacity_Cutout_PackedAlpha_DoubleSided.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "textureMap": "TestData/Textures/Foliage_Leaves_0_BaseColor.dds" diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/009_Opacity_Cutout_SplitAlpha_DoubleSided.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/009_Opacity_Cutout_SplitAlpha_DoubleSided.material index 960a8b0700..8e8dad46d8 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/009_Opacity_Cutout_SplitAlpha_DoubleSided.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/009_Opacity_Cutout_SplitAlpha_DoubleSided.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "opacity": { "alphaSource": "Split", diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/009_Opacity_Cutout_SplitAlpha_SingleSided.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/009_Opacity_Cutout_SplitAlpha_SingleSided.material index 2adc42141c..2d9b4c514b 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/009_Opacity_Cutout_SplitAlpha_SingleSided.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/009_Opacity_Cutout_SplitAlpha_SingleSided.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "opacity": { "alphaSource": "Split", diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/009_Opacity_Opaque_DoubleSided.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/009_Opacity_Opaque_DoubleSided.material index a26bf6e045..f7ac93a7ac 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/009_Opacity_Opaque_DoubleSided.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/009_Opacity_Opaque_DoubleSided.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "textureMap": "Textures/Default/checker_uv_basecolor.png" diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/009_Opacity_TintedTransparent.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/009_Opacity_TintedTransparent.material index 1716792af1..9d36d0a7e6 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/009_Opacity_TintedTransparent.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/009_Opacity_TintedTransparent.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/010_AmbientOcclusion.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/010_AmbientOcclusion.material index 28f43a9a57..a7fe0d1d4d 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/010_AmbientOcclusion.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/010_AmbientOcclusion.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "010_OcclusionBase.material", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "occlusion": { "diffuseFactor": 2.0, diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/010_BothOcclusion.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/010_BothOcclusion.material index cee64dd107..1f9c94db47 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/010_BothOcclusion.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/010_BothOcclusion.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "010_OcclusionBase.material", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "occlusion": { "diffuseFactor": 2.0, diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/010_OcclusionBase.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/010_OcclusionBase.material index 9a41a7d191..534305b68a 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/010_OcclusionBase.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/010_OcclusionBase.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/010_SpecularOcclusion.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/010_SpecularOcclusion.material index 703088d6f8..6403bc5c14 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/010_SpecularOcclusion.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/010_SpecularOcclusion.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "010_OcclusionBase.material", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "occlusion": { "specularFactor": 2.0, diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/011_Emissive.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/011_Emissive.material index 97d657b82b..dc42c0d6b5 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/011_Emissive.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/011_Emissive.material @@ -1,7 +1,7 @@ { "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "textureMap": "Textures/Default/default_basecolor.tif" diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/012_Parallax_POM.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/012_Parallax_POM.material index ed070d5de2..fee4a30f77 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/012_Parallax_POM.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/012_Parallax_POM.material @@ -1,7 +1,7 @@ { "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "textureMap": "TestData/Textures/TextureHaven/4k_castle_brick_02_red/4k_castle_brick_02_red_bc.png" diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/012_Parallax_POM_Cutout.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/012_Parallax_POM_Cutout.material index f5ec0e8287..d69b75285e 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/012_Parallax_POM_Cutout.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/012_Parallax_POM_Cutout.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "textureMap": "TestData/Textures/TextureHaven/4k_castle_brick_02_red/4k_castle_brick_02_red_bc.png" diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/013_SpecularAA_Off.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/013_SpecularAA_Off.material index 666bf45d57..a1da93acbb 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/013_SpecularAA_Off.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/013_SpecularAA_Off.material @@ -1,7 +1,7 @@ { "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "metallic": { "factor": 1.0 diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/013_SpecularAA_On.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/013_SpecularAA_On.material index 0581280d67..07018e9140 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/013_SpecularAA_On.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/013_SpecularAA_On.material @@ -1,7 +1,7 @@ { "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "general": { "applySpecularAA": true diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/014_ClearCoat.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/014_ClearCoat.material index c23f71e7df..e02a8b5fc2 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/014_ClearCoat.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/014_ClearCoat.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/014_ClearCoat_NormalMap.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/014_ClearCoat_NormalMap.material index caa9f88818..56d8515305 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/014_ClearCoat_NormalMap.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/014_ClearCoat_NormalMap.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/014_ClearCoat_NormalMap_2ndUv.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/014_ClearCoat_NormalMap_2ndUv.material index 04d2051e8e..e7575d8bd6 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/014_ClearCoat_NormalMap_2ndUv.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/014_ClearCoat_NormalMap_2ndUv.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/014_ClearCoat_RoughnessMap.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/014_ClearCoat_RoughnessMap.material index 51915a7bb0..3ccbfeacc1 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/014_ClearCoat_RoughnessMap.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/014_ClearCoat_RoughnessMap.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/015_SubsurfaceScattering.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/015_SubsurfaceScattering.material index 37a9b1144e..fb3621f056 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/015_SubsurfaceScattering.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/015_SubsurfaceScattering.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/EnhancedPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "subsurfaceScattering": { "enableSubsurfaceScattering": true, diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/015_SubsurfaceScattering_Transmission.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/015_SubsurfaceScattering_Transmission.material index 38adbc70cd..eff175be77 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/015_SubsurfaceScattering_Transmission.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/015_SubsurfaceScattering_Transmission.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/EnhancedPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "subsurfaceScattering": { "enableSubsurfaceScattering": true, diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_AmbientOcclusion.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_AmbientOcclusion.material index e1260ab4f2..d88c1f151f 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_AmbientOcclusion.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_AmbientOcclusion.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "TestData\\Materials\\StandardPbrTestCases\\UvTilingBase.material", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "occlusion": { "diffuseTextureMap": "TestData/Objects/cube/cube_diff.tif" diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_BaseColor.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_BaseColor.material index 5dd3b88e1b..89bd1005a5 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_BaseColor.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_BaseColor.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "TestData\\Materials\\StandardPbrTestCases\\UvTilingBase.material", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "textureMap": "TestData/Objects/cube/cube_diff.tif" diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Emissive.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Emissive.material index 21f2733d94..564de16cc2 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Emissive.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Emissive.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "TestData\\Materials\\StandardPbrTestCases\\UvTilingBase.material", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Metallic.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Metallic.material index 6c5f72faa1..0eff6198dd 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Metallic.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Metallic.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "TestData\\Materials\\StandardPbrTestCases\\UvTilingBase.material", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "metallic": { "factor": 1.0, diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Normal.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Normal.material index d53fbec47e..e50c669114 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Normal.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Normal.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "TestData\\Materials\\StandardPbrTestCases\\UvTilingBase.material", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "normal": { "textureMap": "TestData/Objects/cube/cube_diff.tif" diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Normal_Dome_Rotate20.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Normal_Dome_Rotate20.material index d693224e78..0b3d678bdd 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Normal_Dome_Rotate20.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Normal_Dome_Rotate20.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "normal": { "factor": 0.15000000596046449, diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Normal_Dome_Rotate90.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Normal_Dome_Rotate90.material index 19e3fce5e6..4a7ade8b30 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Normal_Dome_Rotate90.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Normal_Dome_Rotate90.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "normal": { "factor": 0.15000000596046449, diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Normal_Dome_ScaleOnlyU.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Normal_Dome_ScaleOnlyU.material index 44345f37c9..c0477ac5cf 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Normal_Dome_ScaleOnlyU.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Normal_Dome_ScaleOnlyU.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "normal": { "factor": 0.15000000596046449, diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Normal_Dome_ScaleOnlyV.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Normal_Dome_ScaleOnlyV.material index 2fadfa6e22..b088a0c090 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Normal_Dome_ScaleOnlyV.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Normal_Dome_ScaleOnlyV.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "normal": { "factor": 0.15000000596046449, diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Normal_Dome_ScaleUniform.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Normal_Dome_ScaleUniform.material index 476ba647be..c7c3fac87f 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Normal_Dome_ScaleUniform.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Normal_Dome_ScaleUniform.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "normal": { "factor": 0.15000000596046449, diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Normal_Dome_TransformAll.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Normal_Dome_TransformAll.material index d3db77e1eb..849e926031 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Normal_Dome_TransformAll.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Normal_Dome_TransformAll.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "normal": { "factor": 0.15000000596046449, diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Opacity.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Opacity.material index 5e8a0438dd..b203ec5318 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Opacity.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Opacity.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "TestData\\Materials\\StandardPbrTestCases\\UvTilingBase.material", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "opacity": { "alphaSource": "Split", diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Parallax_A.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Parallax_A.material index b3e69212db..ad2e27063b 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Parallax_A.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Parallax_A.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "TestData/Materials/StandardPbrTestCases/UvTilingBase.material", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "textureMap": "TestData/Objects/cube/cube_diff.tif" diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Parallax_B.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Parallax_B.material index 3d52f3b9e6..75646e5191 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Parallax_B.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Parallax_B.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "TestData/Materials/StandardPbrTestCases/UvTilingBase.material", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "textureMap": "TestData/Objects/cube/cube_diff.tif" diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Roughness.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Roughness.material index 4aa4b4a651..49ff9555f1 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Roughness.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Roughness.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "TestData\\Materials\\StandardPbrTestCases\\UvTilingBase.material", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "metallic": { "factor": 1.0 diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_SpecularF0.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_SpecularF0.material index bf53b57022..a750e30d80 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_SpecularF0.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_SpecularF0.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "TestData\\Materials\\StandardPbrTestCases\\UvTilingBase.material", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/101_DetailMaps_BaseNoDetailMaps.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/101_DetailMaps_BaseNoDetailMaps.material index 82192bac41..30959fc972 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/101_DetailMaps_BaseNoDetailMaps.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/101_DetailMaps_BaseNoDetailMaps.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/EnhancedPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "textureMap": "Objects/Hermanubis/Hermanubis_bronze_BaseColor.png", diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/102_DetailMaps_All.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/102_DetailMaps_All.material index dd31d00db0..2cb14b490e 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/102_DetailMaps_All.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/102_DetailMaps_All.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/EnhancedPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "textureMap": "Objects/Hermanubis/Hermanubis_bronze_BaseColor.png", diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/103_DetailMaps_BaseColor.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/103_DetailMaps_BaseColor.material index eda8ef12de..826ae2d737 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/103_DetailMaps_BaseColor.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/103_DetailMaps_BaseColor.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/EnhancedPBR.materialtype", "parentMaterial": "TestData/Materials/StandardPbrTestCases/101_DetailMaps_BaseNoDetailMaps.material", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "detailLayerGroup": { "baseColorDetailBlend": 0.800000011920929, diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/103_DetailMaps_BaseColorWithMask.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/103_DetailMaps_BaseColorWithMask.material index 28c922a240..1c2214a031 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/103_DetailMaps_BaseColorWithMask.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/103_DetailMaps_BaseColorWithMask.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/EnhancedPBR.materialtype", "parentMaterial": "TestData/Materials/StandardPbrTestCases/103_DetailMaps_BaseColor.material", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "detailLayerGroup": { "baseColorDetailBlend": 1.0, diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/104_DetailMaps_Normal.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/104_DetailMaps_Normal.material index 291f0fc828..9a80cfaaa0 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/104_DetailMaps_Normal.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/104_DetailMaps_Normal.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/EnhancedPBR.materialtype", "parentMaterial": "TestData/Materials/StandardPbrTestCases/101_DetailMaps_BaseNoDetailMaps.material", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "detailLayerGroup": { "enableDetailLayer": true, diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/104_DetailMaps_NormalWithMask.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/104_DetailMaps_NormalWithMask.material index 1c11d653c0..0ee81633ae 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/104_DetailMaps_NormalWithMask.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/104_DetailMaps_NormalWithMask.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/EnhancedPBR.materialtype", "parentMaterial": "TestData/Materials/StandardPbrTestCases/104_DetailMaps_Normal.material", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "detailLayerGroup": { "blendDetailMask": "TestData/Textures/checker8x8_gray_512.png", diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/105_DetailMaps_BlendMaskUsingDetailUVs.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/105_DetailMaps_BlendMaskUsingDetailUVs.material index 6964342447..b2747ead21 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/105_DetailMaps_BlendMaskUsingDetailUVs.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/105_DetailMaps_BlendMaskUsingDetailUVs.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/EnhancedPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "textureMap": "Objects/Hermanubis/Hermanubis_bronze_BaseColor.png", diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/UvTilingBase.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/UvTilingBase.material index 48c287552f..be607db929 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/UvTilingBase.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/UvTilingBase.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\Types\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "uv": { "center": [ diff --git a/Gems/Atom/TestData/TestData/Objects/ModelHotReload/DisplayVertexColor.material b/Gems/Atom/TestData/TestData/Objects/ModelHotReload/DisplayVertexColor.material index 104d675387..8a2f45260a 100644 --- a/Gems/Atom/TestData/TestData/Objects/ModelHotReload/DisplayVertexColor.material +++ b/Gems/Atom/TestData/TestData/Objects/ModelHotReload/DisplayVertexColor.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardMultilayerPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "blend": { "blendSource": "BlendMaskVertexColors", diff --git a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/AnodizedMetal/anodized_metal.material b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/AnodizedMetal/anodized_metal.material index cb2c725678..9672075409 100644 --- a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/AnodizedMetal/anodized_metal.material +++ b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/AnodizedMetal/anodized_metal.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Asphalt/asphalt.material b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Asphalt/asphalt.material index a004cefd18..76cabce752 100644 --- a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Asphalt/asphalt.material +++ b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Asphalt/asphalt.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "textureMap": "Materials/Asphalt/asphalt_basecolor.jpg" diff --git a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/BasicFabric/basic_fabric.material b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/BasicFabric/basic_fabric.material index bf26749d3c..30a203a43a 100644 --- a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/BasicFabric/basic_fabric.material +++ b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/BasicFabric/basic_fabric.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "textureMap": "Materials/BasicFabric/basic_fabric_diffuse.jpg" diff --git a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/BrushedSteel/brushed_steel.material b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/BrushedSteel/brushed_steel.material index 0a98da1143..8feed25399 100644 --- a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/BrushedSteel/brushed_steel.material +++ b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/BrushedSteel/brushed_steel.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "factor": 0.9292929172515869, diff --git a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/CarPaint/car_paint.material b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/CarPaint/car_paint.material index 3cd0e542fa..92544dd7be 100644 --- a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/CarPaint/car_paint.material +++ b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/CarPaint/car_paint.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Coal/coal.material b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Coal/coal.material index 78ceb399ee..4c377178d3 100644 --- a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Coal/coal.material +++ b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Coal/coal.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/ConcreteStucco/concrete_stucco.material b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/ConcreteStucco/concrete_stucco.material index d4e2016022..c5c2e24a2a 100644 --- a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/ConcreteStucco/concrete_stucco.material +++ b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/ConcreteStucco/concrete_stucco.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Copper/copper.material b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Copper/copper.material index 80b7ea29f3..56d0fb1357 100644 --- a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Copper/copper.material +++ b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Copper/copper.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Fabric/fabric.material b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Fabric/fabric.material index ff3a250b96..c2a71513ff 100644 --- a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Fabric/fabric.material +++ b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Fabric/fabric.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "textureMap": "Materials/Fabric/fabric_diffuse.jpg" diff --git a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/GalvanizedSteel/galvanized_steel.material b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/GalvanizedSteel/galvanized_steel.material index aca0648374..83dc076c23 100644 --- a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/GalvanizedSteel/galvanized_steel.material +++ b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/GalvanizedSteel/galvanized_steel.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "textureMap": "Materials/GalvanizedSteel/galvanized_steel.jpg" diff --git a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/GlazedClay/glazed_clay.material b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/GlazedClay/glazed_clay.material index 66f4dd7d00..ff82c9b03f 100644 --- a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/GlazedClay/glazed_clay.material +++ b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/GlazedClay/glazed_clay.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Gloss/gloss.material b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Gloss/gloss.material index ceaca4a274..3e2b1fb56e 100644 --- a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Gloss/gloss.material +++ b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Gloss/gloss.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Gold/gold.material b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Gold/gold.material index b9ee3e5a12..a5e0fa4dba 100644 --- a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Gold/gold.material +++ b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Gold/gold.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Ground/ground.material b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Ground/ground.material index 86f84d4c84..63e9c49fba 100644 --- a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Ground/ground.material +++ b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Ground/ground.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "textureMap": "Materials/Ground/ground_diffuse.jpg" diff --git a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Iron/iron.material b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Iron/iron.material index d859a4a4cf..0ec8cc4819 100644 --- a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Iron/iron.material +++ b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Iron/iron.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Leather/dark_leather.material b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Leather/dark_leather.material index 6c14a0c7fe..46d8511186 100644 --- a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Leather/dark_leather.material +++ b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Leather/dark_leather.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "textureMap": "Materials/Leather/leather_diffuse.jpg" diff --git a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Light_Leather/light_leather.material b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Light_Leather/light_leather.material index 1ae26a8e0d..a73e80b6cb 100644 --- a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Light_Leather/light_leather.material +++ b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Light_Leather/light_leather.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "textureMap": "Materials/Light_Leather/light_leather_diffuse.jpg" diff --git a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/MicrofiberFabric/microfiber_fabric.material b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/MicrofiberFabric/microfiber_fabric.material index d2f5964457..5d6b123c5d 100644 --- a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/MicrofiberFabric/microfiber_fabric.material +++ b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/MicrofiberFabric/microfiber_fabric.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/MixedStones/mixed_stones.material b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/MixedStones/mixed_stones.material index b6dea22b24..c3a916b0bb 100644 --- a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/MixedStones/mixed_stones.material +++ b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/MixedStones/mixed_stones.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "textureMap": "Materials/MixedStones/mixed_stones_diffuse.jpg" diff --git a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Nickle/nickle.material b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Nickle/nickle.material index 82ff63aa20..9bec82bfd2 100644 --- a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Nickle/nickle.material +++ b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Nickle/nickle.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Plaster/plaster.material b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Plaster/plaster.material index cdf76f612d..73ff1024e3 100644 --- a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Plaster/plaster.material +++ b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Plaster/plaster.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Plastic_01/plastic_01.material b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Plastic_01/plastic_01.material index 227017e1ab..bbac80a528 100644 --- a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Plastic_01/plastic_01.material +++ b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Plastic_01/plastic_01.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Plastic_02/plastic_02.material b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Plastic_02/plastic_02.material index c30c3234c0..52c7ec11fb 100644 --- a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Plastic_02/plastic_02.material +++ b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Plastic_02/plastic_02.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Plastic_03/plastic_03.material b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Plastic_03/plastic_03.material index 433c56251d..e7feda6620 100644 --- a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Plastic_03/plastic_03.material +++ b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Plastic_03/plastic_03.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Platinum/platinum.material b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Platinum/platinum.material index 6613a21f2c..95b9f5767c 100644 --- a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Platinum/platinum.material +++ b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Platinum/platinum.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Porcelain/porcelain.material b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Porcelain/porcelain.material index cef8ed194e..9b481628b5 100644 --- a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Porcelain/porcelain.material +++ b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Porcelain/porcelain.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/RotaryBrushedSteel/rotary_brushed_steel.material b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/RotaryBrushedSteel/rotary_brushed_steel.material index 866c18d650..ae6753bffc 100644 --- a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/RotaryBrushedSteel/rotary_brushed_steel.material +++ b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/RotaryBrushedSteel/rotary_brushed_steel.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Rust/rust.material b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Rust/rust.material index f6f2bdc52b..0ef4da333e 100644 --- a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Rust/rust.material +++ b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Rust/rust.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "textureMap": "Materials/Rust/rust_diffuse.jpg" diff --git a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Suede/suede.material b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Suede/suede.material index 782ed7451c..ae3288cbe9 100644 --- a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Suede/suede.material +++ b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/Suede/suede.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "textureMap": "Materials/Suede/suede_diffuse.jpg" diff --git a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/TireRubber/tire_rubber.material b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/TireRubber/tire_rubber.material index 2fc5cec7a4..1cbd3a168a 100644 --- a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/TireRubber/tire_rubber.material +++ b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/TireRubber/tire_rubber.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/WoodPlanks/wood_planks.material b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/WoodPlanks/wood_planks.material index 91f89a0a1b..0320a9a0f7 100644 --- a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/WoodPlanks/wood_planks.material +++ b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/WoodPlanks/wood_planks.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "textureMap": "Materials/WoodPlanks/wood_planks_diffuse.jpg" diff --git a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/WornMetal/warn_metal.material b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/WornMetal/warn_metal.material index cfdba2d2ef..876b404156 100644 --- a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/WornMetal/warn_metal.material +++ b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/WornMetal/warn_metal.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "textureMap": "Materials/WornMetal/worn_metal_basecolor.jpg" diff --git a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/black.material b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/black.material index 56759107c9..f610fd7da0 100644 --- a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/black.material +++ b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/black.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "Materials/white.material", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/blue.material b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/blue.material index 4691b674e0..1318552396 100644 --- a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/blue.material +++ b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/blue.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "Materials/white.material", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/green.material b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/green.material index 6e118ddc7c..c378e48167 100644 --- a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/green.material +++ b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/green.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "Materials/white.material", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/grey.material b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/grey.material index 82e8b17127..751561f5d1 100644 --- a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/grey.material +++ b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/grey.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "Materials/white.material", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/red.material b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/red.material index 2527f82148..edb1cde854 100644 --- a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/red.material +++ b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/red.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "Materials/white.material", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/white.material b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/white.material index bfb95933c4..b7383ff5e0 100644 --- a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/white.material +++ b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/white.material @@ -2,5 +2,5 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3 + "materialTypeVersion": 3 } diff --git a/Gems/AtomContent/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_black.material b/Gems/AtomContent/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_black.material index cc2c9e785b..d15aa620c7 100644 --- a/Gems/AtomContent/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_black.material +++ b/Gems/AtomContent/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_black.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/AtomContent/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_green.material b/Gems/AtomContent/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_green.material index a4bfb73d12..579359b085 100644 --- a/Gems/AtomContent/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_green.material +++ b/Gems/AtomContent/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_green.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/AtomContent/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_mat_arch.material b/Gems/AtomContent/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_mat_arch.material index fe9c54bc02..88d5fc0fc6 100644 --- a/Gems/AtomContent/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_mat_arch.material +++ b/Gems/AtomContent/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_mat_arch.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/AtomContent/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_mat_bricks.material b/Gems/AtomContent/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_mat_bricks.material index a19afa33e2..7244397ee9 100644 --- a/Gems/AtomContent/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_mat_bricks.material +++ b/Gems/AtomContent/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_mat_bricks.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/AtomContent/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_mat_floor.material b/Gems/AtomContent/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_mat_floor.material index 0c1208d8fb..8a3f289c26 100644 --- a/Gems/AtomContent/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_mat_floor.material +++ b/Gems/AtomContent/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_mat_floor.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/AtomContent/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_mat_roof.material b/Gems/AtomContent/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_mat_roof.material index 6aad4d644a..7bc193978f 100644 --- a/Gems/AtomContent/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_mat_roof.material +++ b/Gems/AtomContent/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_mat_roof.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/AtomContent/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_phong5.material b/Gems/AtomContent/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_phong5.material index 302589dc85..a53cbef4e4 100644 --- a/Gems/AtomContent/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_phong5.material +++ b/Gems/AtomContent/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_phong5.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/AtomContent/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_red.material b/Gems/AtomContent/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_red.material index 5217a4e4be..6ddb645319 100644 --- a/Gems/AtomContent/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_red.material +++ b/Gems/AtomContent/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_red.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/AtomContent/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_white.material b/Gems/AtomContent/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_white.material index dba44f7b49..e3d310cd15 100644 --- a/Gems/AtomContent/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_white.material +++ b/Gems/AtomContent/Sponza/Assets/TestData/Test_Sponza_Material_Conversion_white.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "emissive": { "color": [ diff --git a/Gems/AtomContent/Sponza/Assets/objects/lightBlocker_lambert1.material b/Gems/AtomContent/Sponza/Assets/objects/lightBlocker_lambert1.material index c8e9f1f8f7..35677a81c6 100644 --- a/Gems/AtomContent/Sponza/Assets/objects/lightBlocker_lambert1.material +++ b/Gems/AtomContent/Sponza/Assets/objects/lightBlocker_lambert1.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "emissive": { "color": [ diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Atom/Scripts/Python/DCC_Materials/maya_materials_export.py b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Atom/Scripts/Python/DCC_Materials/maya_materials_export.py index d7280dc8cc..d5593002c9 100644 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Atom/Scripts/Python/DCC_Materials/maya_materials_export.py +++ b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Atom/Scripts/Python/DCC_Materials/maya_materials_export.py @@ -382,7 +382,7 @@ class MayaToLumberyard(QtWidgets.QWidget): material = {'description': name, 'materialType': default_settings.get('materialType'), 'parentMaterial': default_settings.get('parentMaterial'), - 'propertyLayoutVersion': default_settings.get('propertyLayoutVersion'), + 'materialTypeVersion': default_settings.get('materialTypeVersion'), 'properties': self.get_shader_properties(name, material_type, file_connections)} self.material_definitions[name if name not in self.material_definitions.keys() else self.get_increment(name)] = material diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Atom/Scripts/Python/DCC_Materials/pbr.material b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Atom/Scripts/Python/DCC_Materials/pbr.material index 94fc5a16bd..f156f60d33 100644 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Atom/Scripts/Python/DCC_Materials/pbr.material +++ b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Atom/Scripts/Python/DCC_Materials/pbr.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "occlusion": { "diffuseFactor": 1.0, diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/Scripts/Python/dcc_materials/main.py b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/Scripts/Python/dcc_materials/main.py index 860273d1eb..869f9bafc5 100644 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/Scripts/Python/dcc_materials/main.py +++ b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/Scripts/Python/dcc_materials/main.py @@ -628,7 +628,7 @@ class MaterialsToLumberyard(QtWidgets.QWidget): 'description': name, 'materialType': default_settings.get('materialType'), 'parentMaterial': default_settings.get('parentMaterial'), - 'propertyLayoutVersion': default_settings.get('propertyLayoutVersion'), + 'materialTypeVersion': default_settings.get('materialTypeVersion'), 'properties': self.get_lumberyard_material_properties(name, dcc_app, material_type, file_connections)} self.lumberyard_materials_dictionary[name if name not in self.lumberyard_materials_dictionary.keys() else self.get_filename_increment(name)] = material diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/Scripts/Python/dcc_materials/materials_export.py b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/Scripts/Python/dcc_materials/materials_export.py index ea0182bb9b..5243a45ec9 100644 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/Scripts/Python/dcc_materials/materials_export.py +++ b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/Scripts/Python/dcc_materials/materials_export.py @@ -546,7 +546,7 @@ class MaterialsToLumberyard(QtWidgets.QWidget): 'description': name, 'materialType': default_settings.get('materialType'), 'parentMaterial': default_settings.get('parentMaterial'), - 'propertyLayoutVersion': default_settings.get('propertyLayoutVersion'), + 'materialTypeVersion': default_settings.get('materialTypeVersion'), 'properties': self.get_lumberyard_material_properties(name, material_type, file_connections)} self.material_definitions[name if name not in self.material_definitions.keys() else self.get_filename_increment(name)] = material diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/Scripts/Python/dcc_materials/pbr.material b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/Scripts/Python/dcc_materials/pbr.material index 94fc5a16bd..f156f60d33 100644 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/Scripts/Python/dcc_materials/pbr.material +++ b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/Scripts/Python/dcc_materials/pbr.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "occlusion": { "diffuseFactor": 1.0, diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/Scripts/Python/kitbash_converter/standardPBR.template.material b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/Scripts/Python/kitbash_converter/standardPBR.template.material index cc2c548174..71d3df3471 100644 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/Scripts/Python/kitbash_converter/standardPBR.template.material +++ b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/Scripts/Python/kitbash_converter/standardPBR.template.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "general": { "texcoord": 0 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/Scripts/Python/legacy_asset_converter/standardPBR.template.material b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/Scripts/Python/legacy_asset_converter/standardPBR.template.material index 78891d6c46..fe2a22a1fe 100644 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/Scripts/Python/legacy_asset_converter/standardPBR.template.material +++ b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/Scripts/Python/legacy_asset_converter/standardPBR.template.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "general": { "texcoord": 0 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/Scripts/Python/maya_dcc_materials/maya_materials_export.py b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/Scripts/Python/maya_dcc_materials/maya_materials_export.py index ad481ba5b1..e7ec878397 100644 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/Scripts/Python/maya_dcc_materials/maya_materials_export.py +++ b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/Scripts/Python/maya_dcc_materials/maya_materials_export.py @@ -387,7 +387,7 @@ class MayaToLumberyard(QtWidgets.QWidget): material = {'description': name, 'materialType': default_settings.get('materialType'), 'parentMaterial': default_settings.get('parentMaterial'), - 'propertyLayoutVersion': default_settings.get('propertyLayoutVersion'), + 'materialTypeVersion': default_settings.get('materialTypeVersion'), 'properties': self.get_shader_properties(name, material_type, file_connections)} self.material_definitions[name if name not in self.material_definitions.keys() else self.get_increment(name)] = material diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/Scripts/Python/maya_dcc_materials/standardpbr.template.material b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/Scripts/Python/maya_dcc_materials/standardpbr.template.material index 30d895f9ac..936b6a0eb1 100644 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/Scripts/Python/maya_dcc_materials/standardpbr.template.material +++ b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/Scripts/Python/maya_dcc_materials/standardpbr.template.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "occlusion": { "diffuseFactor": 1.0, diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/Scripts/Python/stingraypbs_converter/StandardPBR_AllProperties.material b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/Scripts/Python/stingraypbs_converter/StandardPBR_AllProperties.material index 00ff63829f..c5f8395e5e 100644 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/Scripts/Python/stingraypbs_converter/StandardPBR_AllProperties.material +++ b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/Scripts/Python/stingraypbs_converter/StandardPBR_AllProperties.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "occlusion": { "diffuseFactor": 1.0, diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Substance/resources/atom/StandardPBR_AllProperties.material b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Substance/resources/atom/StandardPBR_AllProperties.material index 7d38d1a1a3..052c0a3dcb 100644 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Substance/resources/atom/StandardPBR_AllProperties.material +++ b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Substance/resources/atom/StandardPBR_AllProperties.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "general": { "texcoord": 0 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Substance/resources/atom/atom.material b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Substance/resources/atom/atom.material index 26f4dd7508..60b3f7021f 100644 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Substance/resources/atom/atom.material +++ b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Substance/resources/atom/atom.material @@ -1,7 +1,7 @@ { "material": { "baseMaterial": "StaticMesh.basematerial", - "propertyLayoutVersion": 1, + "materialTypeVersion": 1, "properties": { "general": { "DiffuseColor": [ 1.0, 0.5, 0.5, 1.0 ], diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Substance/resources/atom/atom_variant00.material b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Substance/resources/atom/atom_variant00.material index 26d30908b8..dc4e2293b9 100644 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Substance/resources/atom/atom_variant00.material +++ b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Substance/resources/atom/atom_variant00.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials\\StandardPBR\\StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "general": { "texcoord": 0 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/Tools/Resources/Atom/StandardPBR_AllProperties.material b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/Tools/Resources/Atom/StandardPBR_AllProperties.material index 7d38d1a1a3..052c0a3dcb 100644 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/Tools/Resources/Atom/StandardPBR_AllProperties.material +++ b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/Tools/Resources/Atom/StandardPBR_AllProperties.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "general": { "texcoord": 0 diff --git a/Gems/NvCloth/Assets/Objects/cloth/Chicken/Actor/chicken_chicken_body_mat.material b/Gems/NvCloth/Assets/Objects/cloth/Chicken/Actor/chicken_chicken_body_mat.material index 2ebfc261b7..8e7c325700 100644 --- a/Gems/NvCloth/Assets/Objects/cloth/Chicken/Actor/chicken_chicken_body_mat.material +++ b/Gems/NvCloth/Assets/Objects/cloth/Chicken/Actor/chicken_chicken_body_mat.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/NvCloth/Assets/Objects/cloth/Chicken/Actor/chicken_chicken_eye_mat.material b/Gems/NvCloth/Assets/Objects/cloth/Chicken/Actor/chicken_chicken_eye_mat.material index 87c8b7dab5..61041448c5 100644 --- a/Gems/NvCloth/Assets/Objects/cloth/Chicken/Actor/chicken_chicken_eye_mat.material +++ b/Gems/NvCloth/Assets/Objects/cloth/Chicken/Actor/chicken_chicken_eye_mat.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/NvCloth/Assets/Objects/cloth/Environment/cloth_blinds.material b/Gems/NvCloth/Assets/Objects/cloth/Environment/cloth_blinds.material index 8d645287f6..1350910624 100644 --- a/Gems/NvCloth/Assets/Objects/cloth/Environment/cloth_blinds.material +++ b/Gems/NvCloth/Assets/Objects/cloth/Environment/cloth_blinds.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/NvCloth/Assets/Objects/cloth/Environment/cloth_blinds_broken.material b/Gems/NvCloth/Assets/Objects/cloth/Environment/cloth_blinds_broken.material index 9340723882..64db8c1444 100644 --- a/Gems/NvCloth/Assets/Objects/cloth/Environment/cloth_blinds_broken.material +++ b/Gems/NvCloth/Assets/Objects/cloth/Environment/cloth_blinds_broken.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/NvCloth/Assets/Objects/cloth/Environment/cloth_locked_corners_four.material b/Gems/NvCloth/Assets/Objects/cloth/Environment/cloth_locked_corners_four.material index 682be41887..a55b9cc715 100644 --- a/Gems/NvCloth/Assets/Objects/cloth/Environment/cloth_locked_corners_four.material +++ b/Gems/NvCloth/Assets/Objects/cloth/Environment/cloth_locked_corners_four.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/NvCloth/Assets/Objects/cloth/Environment/cloth_locked_corners_two.material b/Gems/NvCloth/Assets/Objects/cloth/Environment/cloth_locked_corners_two.material index 6ff5a554d3..0294285d36 100644 --- a/Gems/NvCloth/Assets/Objects/cloth/Environment/cloth_locked_corners_two.material +++ b/Gems/NvCloth/Assets/Objects/cloth/Environment/cloth_locked_corners_two.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/NvCloth/Assets/Objects/cloth/Environment/cloth_locked_edge.material b/Gems/NvCloth/Assets/Objects/cloth/Environment/cloth_locked_edge.material index c65a3afdbe..1f86911beb 100644 --- a/Gems/NvCloth/Assets/Objects/cloth/Environment/cloth_locked_edge.material +++ b/Gems/NvCloth/Assets/Objects/cloth/Environment/cloth_locked_edge.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "color": [ diff --git a/Gems/PrimitiveAssets/Assets/Objects/_Primitives/_Box_1x1_MiddleGrey.material b/Gems/PrimitiveAssets/Assets/Objects/_Primitives/_Box_1x1_MiddleGrey.material index dee26ff898..586af47cbc 100644 --- a/Gems/PrimitiveAssets/Assets/Objects/_Primitives/_Box_1x1_MiddleGrey.material +++ b/Gems/PrimitiveAssets/Assets/Objects/_Primitives/_Box_1x1_MiddleGrey.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "textureMap": "Textures/_Primitives/Middle_Gray_Checker.tif" diff --git a/Gems/PrimitiveAssets/Assets/Objects/_Primitives/_Cylinder_1x1_MiddleGrey.material b/Gems/PrimitiveAssets/Assets/Objects/_Primitives/_Cylinder_1x1_MiddleGrey.material index dee26ff898..586af47cbc 100644 --- a/Gems/PrimitiveAssets/Assets/Objects/_Primitives/_Cylinder_1x1_MiddleGrey.material +++ b/Gems/PrimitiveAssets/Assets/Objects/_Primitives/_Cylinder_1x1_MiddleGrey.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "textureMap": "Textures/_Primitives/Middle_Gray_Checker.tif" diff --git a/Gems/PrimitiveAssets/Assets/Objects/_Primitives/_Sphere_1x1_MiddleGrey.material b/Gems/PrimitiveAssets/Assets/Objects/_Primitives/_Sphere_1x1_MiddleGrey.material index 718d951bb2..db9e3624be 100644 --- a/Gems/PrimitiveAssets/Assets/Objects/_Primitives/_Sphere_1x1_MiddleGrey.material +++ b/Gems/PrimitiveAssets/Assets/Objects/_Primitives/_Sphere_1x1_MiddleGrey.material @@ -2,7 +2,7 @@ "description": "", "materialType": "Materials/Types/StandardPBR.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 3, + "materialTypeVersion": 3, "properties": { "baseColor": { "textureMap": "Textures/_Primitives/Middle_Gray_Checker.tif" diff --git a/Gems/Terrain/Assets/Materials/Terrain/DefaultPbrTerrain.material b/Gems/Terrain/Assets/Materials/Terrain/DefaultPbrTerrain.material index da2fc95293..fca5130653 100644 --- a/Gems/Terrain/Assets/Materials/Terrain/DefaultPbrTerrain.material +++ b/Gems/Terrain/Assets/Materials/Terrain/DefaultPbrTerrain.material @@ -2,7 +2,7 @@ "description": "", "materialType": "PbrTerrain.materialtype", "parentMaterial": "", - "propertyLayoutVersion": 1, + "materialTypeVersion": 1, "properties": { "baseColor": { "color": [ 0.18, 0.18, 0.18 ] From fbfea49b68dbd0fb5c139087a6acbfe4a2f0c6be Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Tue, 18 Jan 2022 23:55:40 -0800 Subject: [PATCH 544/948] small comment tweak based on feedback Signed-off-by: Gene Walters --- .../Code/Source/NetworkEntity/NetworkSpawnableLibrary.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.h b/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.h index 469086f4cb..ab6211f522 100644 --- a/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.h +++ b/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.h @@ -26,7 +26,7 @@ namespace Multiplayer //! INetworkSpawnableLibrary overrides. //! @{ // Iterates over all assets (on-disk and in-memory) and stores any spawnables that are "network.spawnables" - // This allows us to look up network spawnable assets by name or id for later use + // This allows users to look up network spawnable assets by name or id if needed later void BuildSpawnablesList() override; void ProcessSpawnableAsset(const AZStd::string& relativePath, AZ::Data::AssetId id) override; AZ::Name GetSpawnableNameFromAssetId(AZ::Data::AssetId assetId) override; From c2b1cd1be2152718c5e1b7ae74f9b887232a4cd0 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Wed, 19 Jan 2022 09:56:54 -0600 Subject: [PATCH 545/948] Fixed bug when retrieving single pixel value Signed-off-by: Chris Galvan --- .../RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index d9aa2f1c23..80fabc9230 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -242,6 +242,8 @@ namespace AZ T StreamingImageAsset::GetSubImagePixelValueInternal(uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) { AZStd::vector values; + values.resize(1); + auto position = AZStd::make_pair(x, y); GetSubImagePixelValues(position, position, values, componentIndex, mip, slice); From 667a9df34231b2215cda2877b8f2ae0c70e2b243 Mon Sep 17 00:00:00 2001 From: Benjamin Jillich <43751992+amzn-jillich@users.noreply.github.com> Date: Wed, 19 Jan 2022 17:20:27 +0100 Subject: [PATCH 546/948] ImGui: Added new histogram group helper (#6998) * Added a helper class for a group containing several histograms. * The group is shown using collapsible header. Signed-off-by: Benjamin Jillich --- .../Include/LYImGuiUtils/HistogramGroup.h | 54 ++++++++++++ .../Source/LYImGuiUtils/HistogramGroup.cpp | 82 +++++++++++++++++++ .../Code/imgui_lyutils_static_files.cmake | 2 + 3 files changed, 138 insertions(+) create mode 100644 Gems/ImGui/Code/Include/LYImGuiUtils/HistogramGroup.h create mode 100644 Gems/ImGui/Code/Source/LYImGuiUtils/HistogramGroup.cpp diff --git a/Gems/ImGui/Code/Include/LYImGuiUtils/HistogramGroup.h b/Gems/ImGui/Code/Include/LYImGuiUtils/HistogramGroup.h new file mode 100644 index 0000000000..b3c7e0e7d8 --- /dev/null +++ b/Gems/ImGui/Code/Include/LYImGuiUtils/HistogramGroup.h @@ -0,0 +1,54 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#ifdef IMGUI_ENABLED + +#include +#include +#include + +#include +#include + +namespace ImGui::LYImGuiUtils +{ + //! Helper for a group containing several histograms. + //! The group is shown using collapsible header. + class HistogramGroup + { + public: + HistogramGroup() = default; + HistogramGroup(const char* name, int histogramBinCount); + + void OnImGuiUpdate(); + void PushHistogramValue(const char* valueName, float value, const AZ::Color& color); + + const char* GetName() const { return m_name.c_str(); } + const AZStd::string& GetNameString() const { return m_name; } + void SetName(AZStd::string name) { m_name = name; } + + void SetHistogramBinCount(int count) { m_histogramBinCount = count; } + + //! Needs to be public for l-value access for ImGui::MenuItem() + bool m_show = true; + + private: + AZStd::string m_name; //< The name shown in the collapsible header. + int m_histogramBinCount = 100; //< The number of bins in the histogram. + + using HistogramIndexByNames = AZStd::unordered_map; + HistogramIndexByNames m_histogramIndexByName; //< Look-up table for the histogram index by name. + AZStd::vector m_histograms; //< Owns the histogram containers. + + static constexpr float s_histogramHeight = 85.0f; + }; +} // namespace ImGui::LYImGuiUtils + +#endif // IMGUI_ENABLED diff --git a/Gems/ImGui/Code/Source/LYImGuiUtils/HistogramGroup.cpp b/Gems/ImGui/Code/Source/LYImGuiUtils/HistogramGroup.cpp new file mode 100644 index 0000000000..62e8eb7b33 --- /dev/null +++ b/Gems/ImGui/Code/Source/LYImGuiUtils/HistogramGroup.cpp @@ -0,0 +1,82 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#ifdef IMGUI_ENABLED +#include "LYImGuiUtils/HistogramGroup.h" + +namespace ImGui::LYImGuiUtils +{ + HistogramGroup::HistogramGroup(const char* name, int histogramBinCount) + : m_name(name) + , m_histogramBinCount(histogramBinCount) + { + } + + void HistogramGroup::PushHistogramValue(const char* valueName, float value, const AZ::Color& color) + { + auto iterator = m_histogramIndexByName.find(valueName); + if (iterator != m_histogramIndexByName.end()) + { + ImGui::LYImGuiUtils::HistogramContainer& histogramContiner = m_histograms[iterator->second]; + histogramContiner.PushValue(value); + histogramContiner.SetBarLineColor(ImColor(color.GetR(), color.GetG(), color.GetB(), color.GetA())); + } + else + { + ImGui::LYImGuiUtils::HistogramContainer newHistogram; + newHistogram.Init(/*histogramName=*/valueName, + /*containerCount=*/m_histogramBinCount, + /*viewType=*/ImGui::LYImGuiUtils::HistogramContainer::ViewType::Histogram, + /*displayOverlays=*/true, + /*min=*/0.0f, + /*max=*/0.0f); + + newHistogram.SetMoveDirection(ImGui::LYImGuiUtils::HistogramContainer::PushRightMoveLeft); + newHistogram.PushValue(value); + + m_histogramIndexByName[valueName] = m_histograms.size(); + m_histograms.push_back(newHistogram); + } + } + + void HistogramGroup::OnImGuiUpdate() + { + if (!m_show) + { + return; + } + + if (ImGui::CollapsingHeader(m_name.c_str(), ImGuiTreeNodeFlags_DefaultOpen | ImGuiTreeNodeFlags_Framed)) + { + for (auto& histogram : m_histograms) + { + ImGui::BeginGroup(); + { + histogram.Draw(ImGui::GetColumnWidth() - 70, s_histogramHeight); + + ImGui::SameLine(); + + ImGui::PushStyleColor(ImGuiCol_Text, IM_COL32(0,0,0,255)); + { + const ImColor color = histogram.GetBarLineColor(); + ImGui::PushStyleColor(ImGuiCol_Button, color.Value); + { + const AZStd::string valueString = AZStd::string::format("%.2f", histogram.GetLastValue()); + ImGui::Button(valueString.c_str()); + } + ImGui::PopStyleColor(); + } + ImGui::PopStyleColor(); + } + ImGui::EndGroup(); + } + } + } +} // namespace ImGui::LYImGuiUtils + +#endif // IMGUI_ENABLED diff --git a/Gems/ImGui/Code/imgui_lyutils_static_files.cmake b/Gems/ImGui/Code/imgui_lyutils_static_files.cmake index d63730e6cb..9807cfe29d 100644 --- a/Gems/ImGui/Code/imgui_lyutils_static_files.cmake +++ b/Gems/ImGui/Code/imgui_lyutils_static_files.cmake @@ -8,7 +8,9 @@ set(FILES Include/LYImGuiUtils/HistogramContainer.h + Include/LYImGuiUtils/HistogramGroup.h Include/LYImGuiUtils/ImGuiDrawHelpers.h Source/LYImGuiUtils/HistogramContainer.cpp + Source/LYImGuiUtils/HistogramGroup.cpp Source/LYImGuiUtils/ImGuiDrawHelpers.cpp ) From 65a749494e01453f542ddbdfe143894608bc1be2 Mon Sep 17 00:00:00 2001 From: Ignacio Martinez <82394219+AMZN-Igarri@users.noreply.github.com> Date: Wed, 19 Jan 2022 17:45:52 +0100 Subject: [PATCH 547/948] Fix: Entity Outliner: Outliner is unusable with the Editor in slice mode (#6983) * Fixed vertical offset Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * Fixed QPoint Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * Fixed Entry delegate Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * SetRenderHint in Entry delegate Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * Save and restore painter inside the highlighter Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * Restoring Painter Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * Removed comment Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> --- .../UI/Outliner/OutlinerListModel.cpp | 7 ++++--- .../AzToolsFramework/AssetBrowser/Views/EntryDelegate.cpp | 1 + .../AzToolsFramework/Editor/RichTextHighlighter.cpp | 8 +++----- .../AzToolsFramework/Editor/RichTextHighlighter.h | 3 ++- .../UI/Outliner/EntityOutlinerListModel.cpp | 2 ++ 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerListModel.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerListModel.cpp index 1c361b050d..39be4839e6 100644 --- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerListModel.cpp +++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerListModel.cpp @@ -2599,11 +2599,12 @@ void OutlinerItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem& optionV4.text.clear(); optionV4.widget->style()->drawControl(QStyle::CE_ItemViewItem, &optionV4, painter); - // Now we setup a Text Document so it can draw the rich text int verticalOffset = GetEntityNameVerticalOffset(entityId); - painter->translate(textRect.topLeft() + QPoint(0, verticalOffset)); - AzToolsFramework::RichTextHighlighter::PaintHighlightedRichText(entityNameRichText, painter, optionV4, textRect); + AzToolsFramework::RichTextHighlighter::PaintHighlightedRichText( + entityNameRichText, painter, optionV4, textRect, QPoint(0, verticalOffset)); + + painter->restore(); OutlinerListModel::s_paintingName = false; } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/EntryDelegate.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/EntryDelegate.cpp index 8e69d5f788..5711ca2608 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/EntryDelegate.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/EntryDelegate.cpp @@ -290,6 +290,7 @@ namespace AzToolsFramework { displayString = RichTextHighlighter::HighlightText(displayString, m_assetBrowserFilerModel->GetStringFilter()->GetFilterString()); } + RichTextHighlighter::PaintHighlightedRichText(displayString, painter, optionV4, remainingRect); } } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Editor/RichTextHighlighter.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Editor/RichTextHighlighter.cpp index 8b28298c3d..f22fdd16b4 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Editor/RichTextHighlighter.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Editor/RichTextHighlighter.cpp @@ -29,12 +29,11 @@ namespace AzToolsFramework return highlightedString; } - void RichTextHighlighter::PaintHighlightedRichText(const QString& highlightedString,QPainter* painter, QStyleOptionViewItem option, QRect availableRect) + void RichTextHighlighter::PaintHighlightedRichText(const QString& highlightedString,QPainter* painter, QStyleOptionViewItem option, QRect availableRect, QPoint offset /* = QPoint()*/) { + // Now we setup a Text Document so it can draw the rich text painter->save(); painter->setRenderHint(QPainter::Antialiasing); - - // Now we setup a Text Document so it can draw the rich text QTextDocument textDoc; textDoc.setDefaultFont(option.font); if (option.state & QStyle::State_Enabled) @@ -46,10 +45,9 @@ namespace AzToolsFramework textDoc.setDefaultStyleSheet("body {color: #7C7C7C}"); } textDoc.setHtml("" + highlightedString + ""); - painter->translate(availableRect.topLeft()); + painter->translate(availableRect.topLeft() + offset); textDoc.setTextWidth(availableRect.width()); textDoc.drawContents(painter, QRectF(0, 0, availableRect.width(), availableRect.height())); - painter->restore(); } } // namespace AzToolsFramework diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Editor/RichTextHighlighter.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Editor/RichTextHighlighter.h index b5c1859497..cdcb0b14b3 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Editor/RichTextHighlighter.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Editor/RichTextHighlighter.h @@ -30,7 +30,8 @@ namespace AzToolsFramework RichTextHighlighter() = delete; static QString HighlightText(const QString& displayString, const QString& matchingSubstring); - static void PaintHighlightedRichText(const QString& highlightedString,QPainter* painter, QStyleOptionViewItem option, QRect availableRect); + static void PaintHighlightedRichText(const QString& highlightedString,QPainter* painter, QStyleOptionViewItem option, + QRect availableRect, QPoint offset = QPoint()); }; } // namespace AzToolsFramework diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerListModel.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerListModel.cpp index e0060e2b42..93e4ffd3da 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerListModel.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerListModel.cpp @@ -2368,6 +2368,8 @@ namespace AzToolsFramework AzToolsFramework::RichTextHighlighter::PaintHighlightedRichText(entityNameRichText, painter, optionV4, textRect); + painter->restore(); + EntityOutlinerListModel::s_paintingName = false; } From 9d3f8e0b7dfd81bfc091b072505e615f2f21e8ba Mon Sep 17 00:00:00 2001 From: Scott Romero <24445312+AMZN-ScottR@users.noreply.github.com> Date: Wed, 19 Jan 2022 09:09:32 -0800 Subject: [PATCH 548/948] [development] minor Android toolchain updates (#6931) Fixed issue with Android NDK r23 native only builds where the platform version was ignored Bumped the default ANDROID_NATIVE_API_LEVEL to 24 so it matches the Android project generator scripts Removed some unnecessary information from message strings Signed-off-by: AMZN-ScottR <24445312+AMZN-ScottR@users.noreply.github.com> --- cmake/Platform/Android/Toolchain_android.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmake/Platform/Android/Toolchain_android.cmake b/cmake/Platform/Android/Toolchain_android.cmake index 75ff4554fd..974eb33681 100644 --- a/cmake/Platform/Android/Toolchain_android.cmake +++ b/cmake/Platform/Android/Toolchain_android.cmake @@ -37,9 +37,9 @@ if(NOT ANDROID_ABI MATCHES "^arm64-") message(FATAL_ERROR "Only the 64-bit ANDROID_ABI's are supported. arm64-v8a can be used if not set") endif() if(NOT ANDROID_NATIVE_API_LEVEL) - set(ANDROID_NATIVE_API_LEVEL 21) + set(ANDROID_NATIVE_API_LEVEL 24) endif() - +set(ANDROID_PLATFORM android-${ANDROID_NATIVE_API_LEVEL}) # Make a backup of the CMAKE_FIND_ROOT_PATH since it will be altered by the NDK toolchain file and needs to be restored after the input set(BACKUP_CMAKE_FIND_ROOT_PATH ${CMAKE_FIND_ROOT_PATH}) @@ -64,9 +64,9 @@ set(LY_TOOLCHAIN_NDK_API_LEVEL ${ANDROID_PLATFORM_LEVEL}) set(MIN_NDK_VERSION 21) if(${LY_TOOLCHAIN_NDK_PKG_MAJOR} VERSION_LESS ${MIN_NDK_VERSION}) - message(FATAL_ERROR "Unsupported NDK Version ${LY_TOOLCHAIN_NDK_PKG_MAJOR}.${LY_TOOLCHAIN_NDK_PKG_MINOR}.${LY_TOOLCHAIN_NDK_API_LEVEL}. Must be version ${MIN_NDK_VERSION} or above") + message(FATAL_ERROR "Unsupported NDK Version ${LY_TOOLCHAIN_NDK_PKG_MAJOR}.${LY_TOOLCHAIN_NDK_PKG_MINOR}. Must be version ${MIN_NDK_VERSION} or above") else() - message(STATUS "Detected NDK Version ${LY_TOOLCHAIN_NDK_PKG_MAJOR}.${LY_TOOLCHAIN_NDK_PKG_MINOR}.${LY_TOOLCHAIN_NDK_PKG_MINOR}") + message(STATUS "Detected NDK Version ${LY_TOOLCHAIN_NDK_PKG_MAJOR}.${LY_TOOLCHAIN_NDK_PKG_MINOR}") endif() list(APPEND CMAKE_TRY_COMPILE_PLATFORM_VARIABLES LY_NDK_DIR) From a63ea12a1f6a47ba6ea27ce2ad847526023b1180 Mon Sep 17 00:00:00 2001 From: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> Date: Wed, 19 Jan 2022 09:52:27 -0800 Subject: [PATCH 549/948] System shortcuts crash the Editor when Global Preferences are open (#6994) * Changes to the keyPressEvent override of the Editor Preferences Dialog to prevent infinite loops on focus switches. Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> * Renaming function to clarify its purpose. Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> --- Code/Editor/EditorPreferencesDialog.cpp | 22 ++++++++++++---------- Code/Editor/EditorPreferencesDialog.h | 2 +- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Code/Editor/EditorPreferencesDialog.cpp b/Code/Editor/EditorPreferencesDialog.cpp index 665daf52a8..42f7446716 100644 --- a/Code/Editor/EditorPreferencesDialog.cpp +++ b/Code/Editor/EditorPreferencesDialog.cpp @@ -112,29 +112,31 @@ void EditorPreferencesDialog::showEvent(QShowEvent* event) QDialog::showEvent(event); } -void WidgetHandleKeyPressEvent(QWidget* widget, QKeyEvent* event) +bool WidgetConsumesKeyPressEvent(QKeyEvent* event) { // If the enter key is pressed during any text input, the dialog box will close // making it inconvenient to do multiple edits. This routine captures the // Key_Enter or Key_Return and clears the focus to give a visible cue that - // editing of that field has finished and then doesn't propogate it. + // editing of that field has finished and then doesn't propagate it. if (event->key() != Qt::Key::Key_Enter && event->key() != Qt::Key::Key_Return) { - QApplication::sendEvent(widget, event); + return false; } - else + + if (QWidget* editWidget = QApplication::focusWidget()) { - if (QWidget* editWidget = QApplication::focusWidget()) - { - editWidget->clearFocus(); - } + editWidget->clearFocus(); } -} + return true; +} void EditorPreferencesDialog::keyPressEvent(QKeyEvent* event) { - WidgetHandleKeyPressEvent(this, event); + if (!WidgetConsumesKeyPressEvent(event)) + { + QDialog::keyPressEvent(event); + } } void EditorPreferencesDialog::OnTreeCurrentItemChanged() diff --git a/Code/Editor/EditorPreferencesDialog.h b/Code/Editor/EditorPreferencesDialog.h index a3f05ad00d..70a186375b 100644 --- a/Code/Editor/EditorPreferencesDialog.h +++ b/Code/Editor/EditorPreferencesDialog.h @@ -19,7 +19,7 @@ namespace Ui class EditorPreferencesTreeWidgetItem; -void WidgetHandleKeyPressEvent(QWidget* widget, QKeyEvent* event); +bool WidgetConsumesKeyPressEvent(QKeyEvent* event); class EditorPreferencesDialog : public QDialog From ca56770655b0f79b7d3e1f6322def650549feb05 Mon Sep 17 00:00:00 2001 From: Junbo Liang <68558268+junbo75@users.noreply.github.com> Date: Wed, 19 Jan 2022 10:50:56 -0800 Subject: [PATCH 550/948] [AWSMetrics] Update the auto-generated code to follow O3DE coding standard (#6910) * [AWSMetrics] Update the auto-generated code to follow O3DE coding standard Signed-off-by: Junbo Liang <68558268+junbo75@users.noreply.github.com> --- .../Code/Source/AWSMetricsConstant.h | 18 ++--- .../Code/Source/AWSMetricsServiceApi.cpp | 65 ++++++++++++------- .../Code/Source/AWSMetricsServiceApi.h | 44 +++++++------ .../AWSMetrics/Code/Source/MetricsManager.cpp | 26 ++++---- Gems/AWSMetrics/Code/Source/MetricsManager.h | 5 +- .../Code/Tests/AWSMetricsServiceApiTest.cpp | 48 +++++++------- .../Code/Tests/MetricsManagerTest.cpp | 16 ++--- Gems/AWSMetrics/cdk/api_spec.json | 26 ++++---- 8 files changed, 136 insertions(+), 112 deletions(-) diff --git a/Gems/AWSMetrics/Code/Source/AWSMetricsConstant.h b/Gems/AWSMetrics/Code/Source/AWSMetricsConstant.h index ecb2b5dcfa..8779b66355 100644 --- a/Gems/AWSMetrics/Code/Source/AWSMetricsConstant.h +++ b/Gems/AWSMetrics/Code/Source/AWSMetricsConstant.h @@ -21,16 +21,16 @@ namespace AWSMetrics static constexpr char AwsMetricsAttributeKeyEventData[] = "event_data"; //! Service API request and response object keys - static constexpr char AwsMetricsSuccessResponseRecordKeyErrorCode[] = "error_code"; - static constexpr char AwsMetricsSuccessResponseRecordKeyResult[] = "result"; - static constexpr char AwsMetricsSuccessResponseKeyFailedRecordCount[] = "failed_record_count"; - static constexpr char AwsMetricsSuccessResponseKeyEvents[] = "events"; - static constexpr char AwsMetricsSuccessResponseKeyTotal[] = "total"; - static constexpr char AwsMetricsErrorKeyMessage[] = "message"; - static constexpr char AwsMetricsErrorKeyType[] = "type"; - static constexpr char AwsMetricsRequestParameterKeyEvents[] = "events"; + static constexpr char AwsMetricsPostMetricsEventsResponseEntryKeyErrorCode[] = "error_code"; + static constexpr char AwsMetricsPostMetricsEventsResponseEntryKeyResult[] = "result"; + static constexpr char AwsMetricsPostMetricsEventsResponseKeyFailedRecordCount[] = "failed_record_count"; + static constexpr char AwsMetricsPostMetricsEventsResponseKeyEvents[] = "events"; + static constexpr char AwsMetricsPostMetricsEventsResponseKeyTotal[] = "total"; + static constexpr char AwsMetricsPostMetricsEventsErrorKeyMessage[] = "message"; + static constexpr char AwsMetricsPostMetricsEventsErrorKeyType[] = "type"; + static constexpr char AwsMetricsPostMetricsEventsRequestParameterKeyEvents[] = "events"; - static constexpr char AwsMetricsSuccessResponseRecordResult[] = "Ok"; + static constexpr char AwsMetricsPostMetricsEventsResponseEntrySuccessResult[] = "Ok"; //! Service API limits //! https://docs.aws.amazon.com/apigateway/latest/developerguide/limits.html diff --git a/Gems/AWSMetrics/Code/Source/AWSMetricsServiceApi.cpp b/Gems/AWSMetrics/Code/Source/AWSMetricsServiceApi.cpp index 7e568e0c40..b7e9d7a1a9 100644 --- a/Gems/AWSMetrics/Code/Source/AWSMetricsServiceApi.cpp +++ b/Gems/AWSMetrics/Code/Source/AWSMetricsServiceApi.cpp @@ -15,56 +15,77 @@ namespace AWSMetrics { namespace ServiceAPI { - bool MetricsEventSuccessResponseRecord::OnJsonKey(const char* key, AWSCore::JsonReader& reader) + bool PostMetricsEventsResponseEntry::OnJsonKey(const char* key, AWSCore::JsonReader& reader) { - if (strcmp(key, AwsMetricsSuccessResponseRecordKeyErrorCode) == 0) return reader.Accept(errorCode); + if (strcmp(key, AwsMetricsPostMetricsEventsResponseEntryKeyErrorCode) == 0) + { + return reader.Accept(m_errorCode); + } - if (strcmp(key, AwsMetricsSuccessResponseRecordKeyResult) == 0) return reader.Accept(result); + if (strcmp(key, AwsMetricsPostMetricsEventsResponseEntryKeyResult) == 0) + { + return reader.Accept(m_result); + } return reader.Ignore(); } - bool MetricsEventSuccessResponse::OnJsonKey(const char* key, AWSCore::JsonReader& reader) + bool PostMetricsEventsResponse::OnJsonKey(const char* key, AWSCore::JsonReader& reader) { - if (strcmp(key, AwsMetricsSuccessResponseKeyFailedRecordCount) == 0) return reader.Accept(failedRecordCount); + if (strcmp(key, AwsMetricsPostMetricsEventsResponseKeyFailedRecordCount) == 0) + { + return reader.Accept(m_failedRecordCount); + } - if (strcmp(key, AwsMetricsSuccessResponseKeyEvents) == 0) return reader.Accept(events); + if (strcmp(key, AwsMetricsPostMetricsEventsResponseKeyEvents) == 0) + { + return reader.Accept(m_responseEntries); + } - if (strcmp(key, AwsMetricsSuccessResponseKeyTotal) == 0) return reader.Accept(total); + if (strcmp(key, AwsMetricsPostMetricsEventsResponseKeyTotal) == 0) + { + return reader.Accept(m_total); + } return reader.Ignore(); } - bool Error::OnJsonKey(const char* key, AWSCore::JsonReader& reader) + bool PostMetricsEventsError::OnJsonKey(const char* key, AWSCore::JsonReader& reader) { - if (strcmp(key, AwsMetricsErrorKeyMessage) == 0) return reader.Accept(message); + if (strcmp(key, AwsMetricsPostMetricsEventsErrorKeyMessage) == 0) + { + return reader.Accept(message); + } - if (strcmp(key, AwsMetricsErrorKeyType) == 0) return reader.Accept(type); + if (strcmp(key, AwsMetricsPostMetricsEventsErrorKeyType) == 0) + { + return reader.Accept(type); + } return reader.Ignore(); } - // Generated Function Parameters - bool PostProducerEventsRequest::Parameters::BuildRequest(AWSCore::RequestBuilder& request) + // Generated request parameters + bool PostMetricsEventsRequest::Parameters::BuildRequest(AWSCore::RequestBuilder& request) { - bool ok = true; + bool buildResult = true; + buildResult = buildResult && request.WriteJsonBodyParameter(*this); - ok = ok && request.WriteJsonBodyParameter(*this); - return ok; + return buildResult; } - bool PostProducerEventsRequest::Parameters::WriteJson(AWSCore::JsonWriter& writer) const + bool PostMetricsEventsRequest::Parameters::WriteJson(AWSCore::JsonWriter& writer) const { - bool ok = true; + bool writeResult = true; - ok = ok && writer.StartObject(); + writeResult = writeResult && writer.StartObject(); - ok = ok && writer.Key(AwsMetricsRequestParameterKeyEvents); - ok = ok && data.SerializeToJson(writer); + writeResult = writeResult && writer.Key(AwsMetricsPostMetricsEventsRequestParameterKeyEvents); + writeResult = writeResult && m_metricsQueue.SerializeToJson(writer); - ok = ok && writer.EndObject(); + writeResult = writeResult && writer.EndObject(); - return ok; + return writeResult; } } } diff --git a/Gems/AWSMetrics/Code/Source/AWSMetricsServiceApi.h b/Gems/AWSMetrics/Code/Source/AWSMetricsServiceApi.h index a64c9f8a53..dde36fc04a 100644 --- a/Gems/AWSMetrics/Code/Source/AWSMetricsServiceApi.h +++ b/Gems/AWSMetrics/Code/Source/AWSMetricsServiceApi.h @@ -16,41 +16,44 @@ namespace AWSMetrics { namespace ServiceAPI { - //! Struct for storing event record from the response. - struct MetricsEventSuccessResponseRecord + //! Response for an individual metrics event from a PostMetricsEvents request. + //! If the event is successfully sent to the backend, it receives an "Ok" result. + //! If the event fails to be sent to the backend, the result includes an error code and an "Error" result. + struct PostMetricsEventsResponseEntry { - //! Identify the expected property type and provide a location where the property value can be stored. + //! Identify the expected property type in the response entry for each individual metrics event and provide a location where the property value can be stored. //! @param key Name of the property. //! @param reader JSON reader to read the property. bool OnJsonKey(const char* key, AWSCore::JsonReader& reader); - AZStd::string errorCode; //!< Error code if the event is not sent successfully. - AZStd::string result; //!< Processing result for the input record. + AZStd::string m_errorCode; //!< Error code if the individual metrics event failed to be sent. + AZStd::string m_result; //!< Result for the processed individual metrics event. Expected value: "Error" or "Ok". }; - using MetricsEventSuccessResponsePropertyEvents = AZStd::vector; + using PostMetricsEventsResponseEntries = AZStd::vector; - //! Struct for storing the success response. - struct MetricsEventSuccessResponse + //! Response for all the processed metrics events from a PostMetricsEvents request. + struct PostMetricsEventsResponse { - //! Identify the expected property type and provide a location where the property value can be stored. + //! Identify the expected property type in the response and provide a location where the property value can be stored. //! @param key Name of the property. //! @param reader JSON reader to read the property. bool OnJsonKey(const char* key, AWSCore::JsonReader& reader); - int failedRecordCount{ 0 }; //!< Number of events that failed to be saved to metrics events stream. - MetricsEventSuccessResponsePropertyEvents events; //! List of input event records. - int total{ 0 }; //!< Total number of events that were processed in the request + int m_failedRecordCount{ 0 }; //!< Number of events that failed to be sent to the backend. + PostMetricsEventsResponseEntries m_responseEntries; //! Response list for all the processed metrics events. + int m_total{ 0 }; //!< Total number of events that were processed in the request. }; - //! Struct for storing the failure response. - struct Error + //! Failure response for sending the PostMetricsEvents request. + struct PostMetricsEventsError { - //! Identify the expected property type and provide a location where the property value can be stored. + //! Identify the expected property type in the failure response and provide a location where the property value can be stored. //! @param key Name of the property. //! @param reader JSON reader to read the property. bool OnJsonKey(const char* key, AWSCore::JsonReader& reader); + //! Do not rename the following members since they are expected by the AWSCore dependency. AZStd::string message; //!< Error message. AZStd::string type; //!< Error type. }; @@ -60,7 +63,7 @@ namespace AWSMetrics //! POST request defined by api_spec.json to send metrics to the backend. //! The path for this service API is "/producer/events". - class PostProducerEventsRequest + class PostMetricsEventsRequest : public AWSCore::ServiceRequest { public: @@ -79,14 +82,15 @@ namespace AWSMetrics //! @return Whether the serialization is successful. bool WriteJson(AWSCore::JsonWriter& writer) const; - MetricsQueue data; //!< Data to send via the service API request. + MetricsQueue m_metricsQueue; //!< Metrics events to send via the service API request. }; - MetricsEventSuccessResponse result; //! Success response. - Error error; //! Failure response. + //! Do not rename the following members since they are expected by the AWSCore dependency. + PostMetricsEventsResponse result; //! Success response. + PostMetricsEventsError error; //! Failure response. Parameters parameters; //! Request parameter. }; - using PostProducerEventsRequestJob = AWSCore::ServiceRequestJob; + using PostMetricsEventsRequestJob = AWSCore::ServiceRequestJob; } // ServiceAPI } // AWSMetrics diff --git a/Gems/AWSMetrics/Code/Source/MetricsManager.cpp b/Gems/AWSMetrics/Code/Source/MetricsManager.cpp index 03e31770ee..d484b8c169 100644 --- a/Gems/AWSMetrics/Code/Source/MetricsManager.cpp +++ b/Gems/AWSMetrics/Code/Source/MetricsManager.cpp @@ -172,17 +172,17 @@ namespace AWSMetrics if (outcome.IsSuccess()) { // Generate response records for success call to keep consistency with the Service API response - ServiceAPI::MetricsEventSuccessResponsePropertyEvents responseRecords; + ServiceAPI::PostMetricsEventsResponseEntries responseEntries; int numMetricsEventsInRequest = metricsQueue->GetNumMetrics(); for (int index = 0; index < numMetricsEventsInRequest; ++index) { - ServiceAPI::MetricsEventSuccessResponseRecord responseRecord; - responseRecord.result = AwsMetricsSuccessResponseRecordResult; + ServiceAPI::PostMetricsEventsResponseEntry responseEntry; + responseEntry.m_result = AwsMetricsPostMetricsEventsResponseEntrySuccessResult; - responseRecords.emplace_back(responseRecord); + responseEntries.emplace_back(responseEntry); } - OnResponseReceived(*metricsQueue, responseRecords); + OnResponseReceived(*metricsQueue, responseEntries); AZ::TickBus::QueueFunction([requestId]() { @@ -209,19 +209,19 @@ namespace AWSMetrics { int requestId = ++m_sendMetricsId; - ServiceAPI::PostProducerEventsRequestJob* requestJob = ServiceAPI::PostProducerEventsRequestJob::Create( - [this, requestId](ServiceAPI::PostProducerEventsRequestJob* successJob) + ServiceAPI::PostMetricsEventsRequestJob* requestJob = ServiceAPI::PostMetricsEventsRequestJob::Create( + [this, requestId](ServiceAPI::PostMetricsEventsRequestJob* successJob) { - OnResponseReceived(successJob->parameters.data, successJob->result.events); + OnResponseReceived(successJob->parameters.m_metricsQueue, successJob->result.m_responseEntries); AZ::TickBus::QueueFunction([requestId]() { AWSMetricsNotificationBus::Broadcast(&AWSMetricsNotifications::OnSendMetricsSuccess, requestId); }); }, - [this, requestId](ServiceAPI::PostProducerEventsRequestJob* failedJob) + [this, requestId](ServiceAPI::PostMetricsEventsRequestJob* failedJob) { - OnResponseReceived(failedJob->parameters.data); + OnResponseReceived(failedJob->parameters.m_metricsQueue); AZStd::string errorMessage = failedJob->error.message; AZ::TickBus::QueueFunction([requestId, errorMessage]() @@ -230,11 +230,11 @@ namespace AWSMetrics }); }); - requestJob->parameters.data = AZStd::move(metricsQueue); + requestJob->parameters.m_metricsQueue = AZStd::move(metricsQueue); requestJob->Start(); } - void MetricsManager::OnResponseReceived(const MetricsQueue& metricsEventsInRequest, const ServiceAPI::MetricsEventSuccessResponsePropertyEvents& responseRecords) + void MetricsManager::OnResponseReceived(const MetricsQueue& metricsEventsInRequest, const ServiceAPI::PostMetricsEventsResponseEntries& responseEntries) { MetricsQueue metricsEventsForRetry; int numMetricsEventsInRequest = metricsEventsInRequest.GetNumMetrics(); @@ -242,7 +242,7 @@ namespace AWSMetrics { MetricsEvent metricsEvent = metricsEventsInRequest[index]; - if (responseRecords.size() > 0 && responseRecords[index].result == AwsMetricsSuccessResponseRecordResult) + if (responseEntries.size() > 0 && responseEntries[index].m_result == AwsMetricsPostMetricsEventsResponseEntrySuccessResult) { // The metrics event is sent to the backend successfully. if (metricsEvent.GetNumFailures() == 0) diff --git a/Gems/AWSMetrics/Code/Source/MetricsManager.h b/Gems/AWSMetrics/Code/Source/MetricsManager.h index 3bb06acd75..63a614ae67 100644 --- a/Gems/AWSMetrics/Code/Source/MetricsManager.h +++ b/Gems/AWSMetrics/Code/Source/MetricsManager.h @@ -60,9 +60,8 @@ namespace AWSMetrics //! Update the global stats and add qualified failed metrics events back to the buffer for retry. //! @param metricsEventsInRequest Metrics events in the original request. - //! @param responseRecords Response records from the call. Each record in the list contains the result for sending the corresponding metrics event. - void OnResponseReceived(const MetricsQueue& metricsEventsInRequest, const ServiceAPI::MetricsEventSuccessResponsePropertyEvents& responseRecords = - ServiceAPI::MetricsEventSuccessResponsePropertyEvents()); + //! @param responseEntries Response list for all the processed metrics events. + void OnResponseReceived(const MetricsQueue& metricsEventsInRequest, const ServiceAPI::PostMetricsEventsResponseEntries& responseEntries = ServiceAPI::PostMetricsEventsResponseEntries()); //! Implementation for flush all metrics buffered in memory. void FlushMetricsAsync(); diff --git a/Gems/AWSMetrics/Code/Tests/AWSMetricsServiceApiTest.cpp b/Gems/AWSMetrics/Code/Tests/AWSMetricsServiceApiTest.cpp index b7e7527b20..2b7f92601b 100644 --- a/Gems/AWSMetrics/Code/Tests/AWSMetricsServiceApiTest.cpp +++ b/Gems/AWSMetrics/Code/Tests/AWSMetricsServiceApiTest.cpp @@ -42,43 +42,43 @@ namespace AWSMetrics TEST_F(AWSMetricsServiceApiTest, OnJsonKey_MetricsEventSuccessResponseRecord_AcceptValidKeys) { - ServiceAPI::MetricsEventSuccessResponseRecord responseRecord; - responseRecord.result = "ok"; + ServiceAPI::PostMetricsEventsResponseEntry responseRecord; + responseRecord.m_result = "ok"; - EXPECT_CALL(JsonReader, Accept(responseRecord.result)).Times(1); - EXPECT_CALL(JsonReader, Accept(responseRecord.errorCode)).Times(1); + EXPECT_CALL(JsonReader, Accept(responseRecord.m_result)).Times(1); + EXPECT_CALL(JsonReader, Accept(responseRecord.m_errorCode)).Times(1); EXPECT_CALL(JsonReader, Ignore()).Times(1); - responseRecord.OnJsonKey(AwsMetricsSuccessResponseRecordKeyResult, JsonReader); - responseRecord.OnJsonKey(AwsMetricsSuccessResponseRecordKeyErrorCode, JsonReader); + responseRecord.OnJsonKey(AwsMetricsPostMetricsEventsResponseEntryKeyResult, JsonReader); + responseRecord.OnJsonKey(AwsMetricsPostMetricsEventsResponseEntryKeyErrorCode, JsonReader); responseRecord.OnJsonKey("other", JsonReader); } TEST_F(AWSMetricsServiceApiTest, OnJsonKeyWithEvents_MetricsEventSuccessResponseRecord_AcceptValidKeys) { // Verifiy that JsonReader accepts valid JSON keys in each event record from a success reponse - ServiceAPI::MetricsEventSuccessResponseRecord responseRecord; - responseRecord.result = "ok"; + ServiceAPI::PostMetricsEventsResponseEntry responseRecord; + responseRecord.m_result = "Ok"; - ServiceAPI::MetricsEventSuccessResponse response; - response.events.emplace_back(responseRecord); - response.failedRecordCount = 0; - response.total = 1; + ServiceAPI::PostMetricsEventsResponse response; + response.m_responseEntries.emplace_back(responseRecord); + response.m_failedRecordCount = 0; + response.m_total = 1; - EXPECT_CALL(JsonReader, Accept(response.failedRecordCount)).Times(1); - EXPECT_CALL(JsonReader, Accept(response.total)).Times(1); + EXPECT_CALL(JsonReader, Accept(response.m_failedRecordCount)).Times(1); + EXPECT_CALL(JsonReader, Accept(response.m_total)).Times(1); EXPECT_CALL(JsonReader, Accept(::testing::An())).Times(1); EXPECT_CALL(JsonReader, Ignore()).Times(1); - response.OnJsonKey(AwsMetricsSuccessResponseKeyFailedRecordCount, JsonReader); - response.OnJsonKey(AwsMetricsSuccessResponseKeyTotal, JsonReader); - response.OnJsonKey(AwsMetricsSuccessResponseKeyEvents, JsonReader); + response.OnJsonKey(AwsMetricsPostMetricsEventsResponseKeyFailedRecordCount, JsonReader); + response.OnJsonKey(AwsMetricsPostMetricsEventsResponseKeyTotal, JsonReader); + response.OnJsonKey(AwsMetricsPostMetricsEventsResponseKeyEvents, JsonReader); response.OnJsonKey("other", JsonReader); } TEST_F(AWSMetricsServiceApiTest, OnJsonKey_Error_AcceptValidKeys) { - ServiceAPI::Error error; + ServiceAPI::PostMetricsEventsError error; error.message = "error message"; error.type = "404"; @@ -86,16 +86,16 @@ namespace AWSMetrics EXPECT_CALL(JsonReader, Accept(error.type)).Times(1); EXPECT_CALL(JsonReader, Ignore()).Times(1); - error.OnJsonKey(AwsMetricsErrorKeyMessage, JsonReader); - error.OnJsonKey(AwsMetricsErrorKeyType, JsonReader); + error.OnJsonKey(AwsMetricsPostMetricsEventsErrorKeyMessage, JsonReader); + error.OnJsonKey(AwsMetricsPostMetricsEventsErrorKeyType, JsonReader); error.OnJsonKey("other", JsonReader); } TEST_F(AWSMetricsServiceApiTest, BuildRequestBody_PostProducerEventsRequest_SerializedMetricsQueue) { - ServiceAPI::PostProducerEventsRequest request; - request.parameters.data = MetricsQueue(); - request.parameters.data.AddMetrics(MetricsEventBuilder().Build()); + ServiceAPI::PostMetricsEventsRequest request; + request.parameters.m_metricsQueue = MetricsQueue(); + request.parameters.m_metricsQueue.AddMetrics(MetricsEventBuilder().Build()); AWSCore::RequestBuilder requestBuilder{}; EXPECT_TRUE(request.parameters.BuildRequest(requestBuilder)); @@ -104,6 +104,6 @@ namespace AWSMetrics std::istreambuf_iterator eos; AZStd::string bodyString{ std::istreambuf_iterator(*bodyContent), eos }; - EXPECT_TRUE(bodyString.contains(AZStd::string::format("{\"%s\":[{\"event_timestamp\":", AwsMetricsRequestParameterKeyEvents))); + EXPECT_TRUE(bodyString.contains(AZStd::string::format("{\"%s\":[{\"event_timestamp\":", AwsMetricsPostMetricsEventsRequestParameterKeyEvents))); } } diff --git a/Gems/AWSMetrics/Code/Tests/MetricsManagerTest.cpp b/Gems/AWSMetrics/Code/Tests/MetricsManagerTest.cpp index 9fcebec524..154e88f90e 100644 --- a/Gems/AWSMetrics/Code/Tests/MetricsManagerTest.cpp +++ b/Gems/AWSMetrics/Code/Tests/MetricsManagerTest.cpp @@ -430,14 +430,14 @@ namespace AWSMetrics ReplaceLocalFileIOWithMockIO(); } - TEST_F(MetricsManagerTest, OnResponseReceived_WithResponseRecords_RetryFailedMetrics) + TEST_F(MetricsManagerTest, OnResponseReceived_WithResponseEntries_RetryFailedMetrics) { // Reset the config file to change the max queue size setting. ResetClientConfig(false, (double)TestMetricsEventSizeInBytes * (MaxNumMetricsEvents + 1) / MbToBytes, DefaultFlushPeriodInSeconds, 1); MetricsQueue metricsEvents; - ServiceAPI::MetricsEventSuccessResponsePropertyEvents responseRecords; + ServiceAPI::PostMetricsEventsResponseEntries responseEntries; for (int index = 0; index < MaxNumMetricsEvents; ++index) { MetricsEvent newEvent; @@ -445,19 +445,19 @@ namespace AWSMetrics metricsEvents.AddMetrics(newEvent); - ServiceAPI::MetricsEventSuccessResponseRecord responseRecord; + ServiceAPI::PostMetricsEventsResponseEntry responseEntry; if (index % 2 == 0) { - responseRecord.errorCode = "Error"; + responseEntry.m_errorCode = "Error"; } else { - responseRecord.result = "Ok"; + responseEntry.m_result = "Ok"; } - responseRecords.emplace_back(responseRecord); + responseEntries.emplace_back(responseEntry); } - m_metricsManager->OnResponseReceived(metricsEvents, responseRecords); + m_metricsManager->OnResponseReceived(metricsEvents, responseEntries); const GlobalStatistics& stats = m_metricsManager->GetGlobalStatistics(); EXPECT_EQ(stats.m_numEvents, MaxNumMetricsEvents); @@ -471,7 +471,7 @@ namespace AWSMetrics ASSERT_EQ(m_metricsManager->GetNumBufferedMetrics(), MaxNumMetricsEvents / 2); } - TEST_F(MetricsManagerTest, OnResponseReceived_NoResponseRecords_RetryAllMetrics) + TEST_F(MetricsManagerTest, OnResponseReceived_NoResponseEntries_RetryAllMetrics) { // Reset the config file to change the max queue size setting. ResetClientConfig(false, (double)TestMetricsEventSizeInBytes * (MaxNumMetricsEvents + 1) / MbToBytes, diff --git a/Gems/AWSMetrics/cdk/api_spec.json b/Gems/AWSMetrics/cdk/api_spec.json index 74a19ba460..0daf629516 100644 --- a/Gems/AWSMetrics/cdk/api_spec.json +++ b/Gems/AWSMetrics/cdk/api_spec.json @@ -3,7 +3,7 @@ "info": { "title": "AWSMetricsServiceApi", "description": "Service API for the data analytics pipeline defined by the AWS Metrics Gem", - "version": "1.0.0" + "version": "1.0.1" }, "x-amazon-apigateway-request-validators": { "all": { @@ -68,7 +68,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/MetricsEventSuccessResponse" + "$ref": "#/components/schemas/PostMetricsEventsResponse" } } } @@ -78,7 +78,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Error" + "$ref": "#/components/schemas/PostMetricsEventsError" } } } @@ -88,17 +88,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Error" + "$ref": "#/components/schemas/PostMetricsEventsError" } } } }, "500": { - "description": "Internal Server Error", + "description": "Internal Server PostMetricsEventsError", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Error" + "$ref": "#/components/schemas/PostMetricsEventsError" } } } @@ -109,7 +109,7 @@ }, "components": { "schemas": { - "Error": { + "PostMetricsEventsError": { "type": "object", "properties": { "message": { @@ -184,18 +184,18 @@ } } }, - "MetricsEventSuccessResponse": { + "PostMetricsEventsResponse": { "title": "Metrics Event Success Response Schema", "type": "object", "properties": { "failed_record_count": { "type": "number", - "description": "Number of events that failed to be saved to metrics events stream" + "description": "Number of events that failed to be sent to the backend" }, "events": { "type": "array", "items": { - "$ref": "#/components/schemas/MetricsEventSuccessResponseRecord" + "$ref": "#/components/schemas/PostMetricsEventsResponseEntry" } }, "total": { @@ -204,16 +204,16 @@ } } }, - "MetricsEventSuccessResponseRecord": { + "PostMetricsEventsResponseEntry": { "type": "object", "properties": { "error_code": { "type": "string", - "description": "The error code from the metrics events stream. Value set if Result is Error" + "description": "Error code if the individual metrics event failed to be sent" }, "result": { "type": "string", - "description": "Processing result for the input record" + "description": "Result for the processed individual metrics event. Expected value: \"Error\" or \"Ok\"" } } } From 83878e63775ccb3bdad0cad49a9ae973e1d48596 Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Wed, 19 Jan 2022 12:57:52 -0600 Subject: [PATCH 551/948] Change GetValues() to take in const positions. (#6987) * Change GetValues() to take in const positions. To support this, span needed some template deductions to correctly convert from non-const containers to const ones. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Removed the most problematic template deduction rules. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Remove duplicate validate_iterator methods. iterator type is a pointer, not a value, so "const iterator" and "const const_iterator" produce the same function signature. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Fixed the span types. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- .../AzCore/AzCore/std/containers/span.h | 36 +++++++----------- .../AzCore/AzCore/std/containers/span.inl | 38 +++---------------- .../AzCore/AzCore/std/containers/vector.h | 20 ---------- .../Components/ConstantGradientComponent.h | 2 +- .../Components/DitherGradientComponent.h | 2 +- .../Components/ImageGradientComponent.h | 2 +- .../Components/InvertGradientComponent.h | 2 +- .../Components/LevelsGradientComponent.h | 2 +- .../Components/MixedGradientComponent.h | 2 +- .../Components/PerlinGradientComponent.h | 2 +- .../Components/PosterizeGradientComponent.h | 2 +- .../Components/RandomGradientComponent.h | 2 +- .../Components/ReferenceGradientComponent.h | 2 +- .../ShapeAreaFalloffGradientComponent.h | 2 +- .../Components/SmoothStepGradientComponent.h | 2 +- .../SurfaceAltitudeGradientComponent.h | 2 +- .../Components/SurfaceMaskGradientComponent.h | 2 +- .../SurfaceSlopeGradientComponent.h | 2 +- .../Components/ThresholdGradientComponent.h | 2 +- .../Ebuses/GradientRequestBus.h | 2 +- .../Include/GradientSignal/GradientSampler.h | 4 +- .../Components/ConstantGradientComponent.cpp | 2 +- .../Components/DitherGradientComponent.cpp | 2 +- .../Components/ImageGradientComponent.cpp | 2 +- .../Components/InvertGradientComponent.cpp | 2 +- .../Components/LevelsGradientComponent.cpp | 2 +- .../Components/MixedGradientComponent.cpp | 2 +- .../Components/PerlinGradientComponent.cpp | 2 +- .../Components/PosterizeGradientComponent.cpp | 2 +- .../Components/RandomGradientComponent.cpp | 2 +- .../Components/ReferenceGradientComponent.cpp | 2 +- .../ShapeAreaFalloffGradientComponent.cpp | 2 +- .../SmoothStepGradientComponent.cpp | 2 +- .../SurfaceAltitudeGradientComponent.cpp | 2 +- .../SurfaceMaskGradientComponent.cpp | 2 +- .../SurfaceSlopeGradientComponent.cpp | 2 +- .../Components/ThresholdGradientComponent.cpp | 2 +- 37 files changed, 55 insertions(+), 109 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/std/containers/span.h b/Code/Framework/AzCore/AzCore/std/containers/span.h index 5bb51bf481..fbf5f56870 100644 --- a/Code/Framework/AzCore/AzCore/std/containers/span.h +++ b/Code/Framework/AzCore/AzCore/std/containers/span.h @@ -33,23 +33,24 @@ namespace AZStd * * Since the span does not copy and store any data, it is only valid as long as the data used to create it is valid. */ - template + template class span final { public: - using value_type = Element; + using element_type = T; + using value_type = AZStd::remove_cv_t; - using pointer = value_type*; - using const_pointer = const value_type*; + using pointer = T*; + using const_pointer = const T*; - using reference = value_type&; - using const_reference = const value_type&; + using reference = T&; + using const_reference = const T&; using size_type = AZStd::size_t; using difference_type = AZStd::ptrdiff_t; - using iterator = value_type*; - using const_iterator = const value_type*; + using iterator = T*; + using const_iterator = const T*; using reverse_iterator = AZStd::reverse_iterator; using const_reverse_iterator = AZStd::reverse_iterator; @@ -65,21 +66,11 @@ namespace AZStd // create a span to just the first element instead of an entire array. constexpr span(const_pointer s) = delete; - template - constexpr span(AZStd::array& data); + template + constexpr span(Container& data); - constexpr span(AZStd::vector& data); - - template - constexpr span(AZStd::fixed_vector& data); - - template - constexpr span(const AZStd::array& data); - - constexpr span(const AZStd::vector& data); - - template - constexpr span(const AZStd::fixed_vector& data); + template + constexpr span(const Container& data); constexpr span(const span&) = default; @@ -132,6 +123,7 @@ namespace AZStd pointer m_begin; pointer m_end; }; + } // namespace AZStd #include diff --git a/Code/Framework/AzCore/AzCore/std/containers/span.inl b/Code/Framework/AzCore/AzCore/std/containers/span.inl index 01bab9a5a4..2b24a11fc3 100644 --- a/Code/Framework/AzCore/AzCore/std/containers/span.inl +++ b/Code/Framework/AzCore/AzCore/std/containers/span.inl @@ -29,42 +29,16 @@ namespace AZStd , m_end(last) { } - template - template - inline constexpr span::span(AZStd::array& data) - : m_begin(data.data()) - , m_end(m_begin + data.size()) - { } - - template - inline constexpr span::span(AZStd::vector& data) - : m_begin(data.data()) - , m_end(m_begin + data.size()) - { } - - template - template - inline constexpr span::span(AZStd::fixed_vector& data) + template + template + inline constexpr span::span(Container& data) : m_begin(data.data()) , m_end(m_begin + data.size()) { } - template - template - inline constexpr span::span(const AZStd::array& data) - : m_begin(data.data()) - , m_end(m_begin + data.size()) - { } - - template - inline constexpr span::span(const AZStd::vector& data) - : m_begin(data.data()) - , m_end(m_begin + data.size()) - { } - - template - template - inline constexpr span::span(const AZStd::fixed_vector& data) + template + template + inline constexpr span::span(const Container& data) : m_begin(data.data()) , m_end(m_begin + data.size()) { } diff --git a/Code/Framework/AzCore/AzCore/std/containers/vector.h b/Code/Framework/AzCore/AzCore/std/containers/vector.h index 255e1c4de4..cd25450777 100644 --- a/Code/Framework/AzCore/AzCore/std/containers/vector.h +++ b/Code/Framework/AzCore/AzCore/std/containers/vector.h @@ -954,25 +954,6 @@ namespace AZStd return true; } /// Validates an iter iterator. Returns a combination of \ref iterator_status_flag. - AZ_FORCE_INLINE int validate_iterator(const iterator& iter) const - { -#ifdef AZSTD_HAS_CHECKED_ITERATORS - AZ_Assert(iter.m_container == this, "Iterator doesn't belong to this container"); - pointer iterPtr = iter.m_iter; -#else - pointer iterPtr = iter; -#endif - if (iterPtr < m_start || iterPtr > m_last) - { - return isf_none; - } - else if (iterPtr == m_last) - { - return isf_valid; - } - - return isf_valid | isf_can_dereference; - } AZ_FORCE_INLINE int validate_iterator(const const_iterator& iter) const { #ifdef AZSTD_HAS_CHECKED_ITERATORS @@ -992,7 +973,6 @@ namespace AZStd return isf_valid | isf_can_dereference; } - AZ_FORCE_INLINE int validate_iterator(const reverse_iterator& iter) const { return validate_iterator(iter.base()); } AZ_FORCE_INLINE int validate_iterator(const const_reverse_iterator& iter) const { return validate_iterator(iter.base()); } /** diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ConstantGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ConstantGradientComponent.h index 1ed06a976a..ff81206225 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ConstantGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ConstantGradientComponent.h @@ -62,7 +62,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; - void GetValues(AZStd::span positions, AZStd::span outValues) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; protected: ////////////////////////////////////////////////////////////////////////// diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/DitherGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/DitherGradientComponent.h index add6de06cf..ff863115af 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/DitherGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/DitherGradientComponent.h @@ -77,7 +77,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; - void GetValues(AZStd::span positions, AZStd::span outValues) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; bool IsEntityInHierarchy(const AZ::EntityId& entityId) const override; ////////////////////////////////////////////////////////////////////////// diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h index 79d42ec478..044e9d91b1 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ImageGradientComponent.h @@ -69,7 +69,7 @@ namespace GradientSignal // GradientRequestBus overrides... float GetValue(const GradientSampleParams& sampleParams) const override; - void GetValues(AZStd::span positions, AZStd::span outValues) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; // AZ::Data::AssetBus overrides... void OnAssetReady(AZ::Data::Asset asset) override; diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/InvertGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/InvertGradientComponent.h index a370286b0b..e4c1faa5d0 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/InvertGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/InvertGradientComponent.h @@ -64,7 +64,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; - void GetValues(AZStd::span positions, AZStd::span outValues) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; bool IsEntityInHierarchy(const AZ::EntityId& entityId) const override; protected: diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/LevelsGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/LevelsGradientComponent.h index 093f84ef3a..eee777045f 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/LevelsGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/LevelsGradientComponent.h @@ -69,7 +69,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; - void GetValues(AZStd::span positions, AZStd::span outValues) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; bool IsEntityInHierarchy(const AZ::EntityId& entityId) const override; protected: diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/MixedGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/MixedGradientComponent.h index 658118fca4..27e7d238a7 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/MixedGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/MixedGradientComponent.h @@ -99,7 +99,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; - void GetValues(AZStd::span positions, AZStd::span outValues) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; bool IsEntityInHierarchy(const AZ::EntityId& entityId) const override; protected: diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/PerlinGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/PerlinGradientComponent.h index 19f3fe7294..d1f35220ed 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/PerlinGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/PerlinGradientComponent.h @@ -70,7 +70,7 @@ namespace GradientSignal // GradientRequestBus overrides... float GetValue(const GradientSampleParams& sampleParams) const override; - void GetValues(AZStd::span positions, AZStd::span outValues) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; private: PerlinGradientConfig m_configuration; diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/PosterizeGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/PosterizeGradientComponent.h index bff49ac619..55ea37868b 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/PosterizeGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/PosterizeGradientComponent.h @@ -73,7 +73,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; - void GetValues(AZStd::span positions, AZStd::span outValues) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; bool IsEntityInHierarchy(const AZ::EntityId& entityId) const override; protected: diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/RandomGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/RandomGradientComponent.h index 328fed5118..ffd532e024 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/RandomGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/RandomGradientComponent.h @@ -61,7 +61,7 @@ namespace GradientSignal // GradientRequestBus overrides... float GetValue(const GradientSampleParams& sampleParams) const override; - void GetValues(AZStd::span positions, AZStd::span outValues) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; private: RandomGradientConfig m_configuration; diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ReferenceGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ReferenceGradientComponent.h index 17c40865b3..82d2de1725 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ReferenceGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ReferenceGradientComponent.h @@ -64,7 +64,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; - void GetValues(AZStd::span positions, AZStd::span outValues) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; bool IsEntityInHierarchy(const AZ::EntityId& entityId) const override; protected: diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ShapeAreaFalloffGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ShapeAreaFalloffGradientComponent.h index 27b2da58a3..4169f31a89 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ShapeAreaFalloffGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ShapeAreaFalloffGradientComponent.h @@ -69,7 +69,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; - void GetValues(AZStd::span positions, AZStd::span outValues) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; protected: ////////////////////////////////////////////////////////////////////////// diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/SmoothStepGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/SmoothStepGradientComponent.h index 03f629ab1e..282ad65a0c 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/SmoothStepGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/SmoothStepGradientComponent.h @@ -71,7 +71,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; - void GetValues(AZStd::span positions, AZStd::span outValues) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; bool IsEntityInHierarchy(const AZ::EntityId& entityId) const override; protected: diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceAltitudeGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceAltitudeGradientComponent.h index eb76fac292..6843be8a0e 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceAltitudeGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceAltitudeGradientComponent.h @@ -90,7 +90,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; - void GetValues(AZStd::span positions, AZStd::span outValues) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; protected: ////////////////////////////////////////////////////////////////////////// diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceMaskGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceMaskGradientComponent.h index 3eafb8c115..2580da10a0 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceMaskGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceMaskGradientComponent.h @@ -70,7 +70,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; - void GetValues(AZStd::span positions, AZStd::span outValues) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; protected: ////////////////////////////////////////////////////////////////////////// diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceSlopeGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceSlopeGradientComponent.h index b464b6fb0f..bdfbcd2b7f 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceSlopeGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/SurfaceSlopeGradientComponent.h @@ -92,7 +92,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; - void GetValues(AZStd::span positions, AZStd::span outValues) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; protected: ////////////////////////////////////////////////////////////////////////// diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ThresholdGradientComponent.h b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ThresholdGradientComponent.h index 96bc235ea8..06369cbe0a 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Components/ThresholdGradientComponent.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Components/ThresholdGradientComponent.h @@ -65,7 +65,7 @@ namespace GradientSignal ////////////////////////////////////////////////////////////////////////// // GradientRequestBus float GetValue(const GradientSampleParams& sampleParams) const override; - void GetValues(AZStd::span positions, AZStd::span outValues) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; bool IsEntityInHierarchy(const AZ::EntityId& entityId) const override; protected: diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientRequestBus.h b/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientRequestBus.h index 45b5a173a3..a2e5912f82 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientRequestBus.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Ebuses/GradientRequestBus.h @@ -56,7 +56,7 @@ namespace GradientSignal * \param positions The input list of positions to query. * \param outValues The output list of values. This list is expected to be the same size as the positions list. */ - virtual void GetValues(AZStd::span positions, AZStd::span outValues) const + virtual void GetValues(AZStd::span positions, AZStd::span outValues) const { // Reference implementation of GetValues for any gradients that don't have their own optimized implementations. // This is 10%-60% faster than calling GetValue via EBus many times due to the per-call EBus overhead. diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h b/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h index bf5c8d1ea0..113693e928 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h @@ -33,7 +33,7 @@ namespace GradientSignal static void Reflect(AZ::ReflectContext* context); inline float GetValue(const GradientSampleParams& sampleParams) const; - inline void GetValues(AZStd::span positions, AZStd::span outValues) const; + inline void GetValues(AZStd::span positions, AZStd::span outValues) const; bool IsEntityInHierarchy(const AZ::EntityId& entityId) const; @@ -147,7 +147,7 @@ namespace GradientSignal return output * m_opacity; } - inline void GradientSampler::GetValues(AZStd::span positions, AZStd::span outValues) const + inline void GradientSampler::GetValues(AZStd::span positions, AZStd::span outValues) const { auto ClearOutputValues = [](AZStd::span outValues) { diff --git a/Gems/GradientSignal/Code/Source/Components/ConstantGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ConstantGradientComponent.cpp index ac81f616c6..bf94429a63 100644 --- a/Gems/GradientSignal/Code/Source/Components/ConstantGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ConstantGradientComponent.cpp @@ -135,7 +135,7 @@ namespace GradientSignal } void ConstantGradientComponent::GetValues( - [[maybe_unused]] AZStd::span positions, AZStd::span outValues) const + [[maybe_unused]] AZStd::span positions, AZStd::span outValues) const { if (positions.size() != outValues.size()) { diff --git a/Gems/GradientSignal/Code/Source/Components/DitherGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/DitherGradientComponent.cpp index 1b320afeb9..eaed069292 100644 --- a/Gems/GradientSignal/Code/Source/Components/DitherGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/DitherGradientComponent.cpp @@ -264,7 +264,7 @@ namespace GradientSignal return GetDitherValue(scaledCoordinate, value); } - void DitherGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const + void DitherGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const { if (positions.size() != outValues.size()) { diff --git a/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp index d948f6269e..3639d5c6df 100644 --- a/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ImageGradientComponent.cpp @@ -219,7 +219,7 @@ namespace GradientSignal return 0.0f; } - void ImageGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const + void ImageGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const { if (positions.size() != outValues.size()) { diff --git a/Gems/GradientSignal/Code/Source/Components/InvertGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/InvertGradientComponent.cpp index aef5cc7a52..c9d8451104 100644 --- a/Gems/GradientSignal/Code/Source/Components/InvertGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/InvertGradientComponent.cpp @@ -137,7 +137,7 @@ namespace GradientSignal return output; } - void InvertGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const + void InvertGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const { if (positions.size() != outValues.size()) { diff --git a/Gems/GradientSignal/Code/Source/Components/LevelsGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/LevelsGradientComponent.cpp index 25f6a34614..85797ef4fe 100644 --- a/Gems/GradientSignal/Code/Source/Components/LevelsGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/LevelsGradientComponent.cpp @@ -185,7 +185,7 @@ namespace GradientSignal return output; } - void LevelsGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const + void LevelsGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const { if (positions.size() != outValues.size()) { diff --git a/Gems/GradientSignal/Code/Source/Components/MixedGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/MixedGradientComponent.cpp index 23bdd379fe..d3cc1a5f24 100644 --- a/Gems/GradientSignal/Code/Source/Components/MixedGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/MixedGradientComponent.cpp @@ -284,7 +284,7 @@ namespace GradientSignal return AZ::GetClamp(result, 0.0f, 1.0f); } - void MixedGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const + void MixedGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const { if (positions.size() != outValues.size()) { diff --git a/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp index e3dfaf2161..17d389559b 100644 --- a/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/PerlinGradientComponent.cpp @@ -203,7 +203,7 @@ namespace GradientSignal return 0.0f; } - void PerlinGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const + void PerlinGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const { if (positions.size() != outValues.size()) { diff --git a/Gems/GradientSignal/Code/Source/Components/PosterizeGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/PosterizeGradientComponent.cpp index 4616e080f1..b46c9891ed 100644 --- a/Gems/GradientSignal/Code/Source/Components/PosterizeGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/PosterizeGradientComponent.cpp @@ -155,7 +155,7 @@ namespace GradientSignal return PosterizeValue(input, bands, m_configuration.m_mode); } - void PosterizeGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const + void PosterizeGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const { if (positions.size() != outValues.size()) { diff --git a/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp index 0f4ece38a1..245801e3b8 100644 --- a/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/RandomGradientComponent.cpp @@ -183,7 +183,7 @@ namespace GradientSignal return 0.0f; } - void RandomGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const + void RandomGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const { if (positions.size() != outValues.size()) { diff --git a/Gems/GradientSignal/Code/Source/Components/ReferenceGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ReferenceGradientComponent.cpp index e135401ff5..a3d67e6f8a 100644 --- a/Gems/GradientSignal/Code/Source/Components/ReferenceGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ReferenceGradientComponent.cpp @@ -134,7 +134,7 @@ namespace GradientSignal return m_configuration.m_gradientSampler.GetValue(sampleParams); } - void ReferenceGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const + void ReferenceGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const { if (positions.size() != outValues.size()) { diff --git a/Gems/GradientSignal/Code/Source/Components/ShapeAreaFalloffGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ShapeAreaFalloffGradientComponent.cpp index 77b7f1a428..62b4834f47 100644 --- a/Gems/GradientSignal/Code/Source/Components/ShapeAreaFalloffGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ShapeAreaFalloffGradientComponent.cpp @@ -168,7 +168,7 @@ namespace GradientSignal return (distance <= 0.0f) ? 1.0f : AZ::GetMax(1.0f - (distance / m_configuration.m_falloffWidth), 0.0f); } - void ShapeAreaFalloffGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const + void ShapeAreaFalloffGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const { if (positions.size() != outValues.size()) { diff --git a/Gems/GradientSignal/Code/Source/Components/SmoothStepGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/SmoothStepGradientComponent.cpp index 683f0a37fa..9d1a601fe8 100644 --- a/Gems/GradientSignal/Code/Source/Components/SmoothStepGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/SmoothStepGradientComponent.cpp @@ -172,7 +172,7 @@ namespace GradientSignal return m_configuration.m_smoothStep.GetSmoothedValue(value); } - void SmoothStepGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const + void SmoothStepGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const { if (positions.size() != outValues.size()) { diff --git a/Gems/GradientSignal/Code/Source/Components/SurfaceAltitudeGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/SurfaceAltitudeGradientComponent.cpp index ee6c272e40..1670483131 100644 --- a/Gems/GradientSignal/Code/Source/Components/SurfaceAltitudeGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/SurfaceAltitudeGradientComponent.cpp @@ -211,7 +211,7 @@ namespace GradientSignal return CalculateAltitudeRatio(points, m_configuration.m_altitudeMin, m_configuration.m_altitudeMax); } - void SurfaceAltitudeGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const + void SurfaceAltitudeGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const { if (positions.size() != outValues.size()) { diff --git a/Gems/GradientSignal/Code/Source/Components/SurfaceMaskGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/SurfaceMaskGradientComponent.cpp index f697050f56..ea72971818 100644 --- a/Gems/GradientSignal/Code/Source/Components/SurfaceMaskGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/SurfaceMaskGradientComponent.cpp @@ -175,7 +175,7 @@ namespace GradientSignal return result; } - void SurfaceMaskGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const + void SurfaceMaskGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const { if (positions.size() != outValues.size()) { diff --git a/Gems/GradientSignal/Code/Source/Components/SurfaceSlopeGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/SurfaceSlopeGradientComponent.cpp index 50105a862f..e557785509 100644 --- a/Gems/GradientSignal/Code/Source/Components/SurfaceSlopeGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/SurfaceSlopeGradientComponent.cpp @@ -215,7 +215,7 @@ namespace GradientSignal return GetSlopeRatio(points, angleMin, angleMax); } - void SurfaceSlopeGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const + void SurfaceSlopeGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const { if (positions.size() != outValues.size()) { diff --git a/Gems/GradientSignal/Code/Source/Components/ThresholdGradientComponent.cpp b/Gems/GradientSignal/Code/Source/Components/ThresholdGradientComponent.cpp index 5df579576d..25e956be38 100644 --- a/Gems/GradientSignal/Code/Source/Components/ThresholdGradientComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/ThresholdGradientComponent.cpp @@ -141,7 +141,7 @@ namespace GradientSignal return (m_configuration.m_gradientSampler.GetValue(sampleParams) <= m_configuration.m_threshold) ? 0.0f : 1.0f; } - void ThresholdGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const + void ThresholdGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const { if (positions.size() != outValues.size()) { From cfd721bce16de707574219fd46fc7456d0d21ca4 Mon Sep 17 00:00:00 2001 From: Nicholas Van Sickle Date: Wed, 19 Jan 2022 11:52:57 -0800 Subject: [PATCH 552/948] A bit of Generic DOM tidying/fixup (#6914) * A bit of Generic DOM tidying/fixup - Refactor out a test fixture for all DOM tests / benchmarks - Optimize `GetType` implementation to not use `AZStd::variant::visit` (benchmark included to A/B the implementations) - Tag a few more mutating Value functions with "Mutable" to avoid astonishing copy-on-writes Benchmark results for GetType implementation: ``` DomValueBenchmark/AzDomValueGetType_UsingVariantIndex 18.2 ns 18.0 ns 40727273 items_per_second=443.667M/s DomValueBenchmark/AzDomValueGetType_UsingVariantVisit 32.2 ns 32.2 ns 21333333 items_per_second=248.242M/s ``` Signed-off-by: Nicholas Van Sickle --- Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp | 8 +- Code/Framework/AzCore/AzCore/DOM/DomValue.cpp | 105 +++------ Code/Framework/AzCore/AzCore/DOM/DomValue.h | 16 +- .../AzCore/Tests/DOM/DomFixtures.cpp | 189 +++++++++++++++ Code/Framework/AzCore/Tests/DOM/DomFixtures.h | 66 ++++++ .../AzCore/Tests/DOM/DomJsonBenchmarks.cpp | 146 ++---------- .../AzCore/Tests/DOM/DomJsonTests.cpp | 9 +- .../AzCore/Tests/DOM/DomValueBenchmarks.cpp | 223 +++++++++--------- .../AzCore/Tests/DOM/DomValueTests.cpp | 14 +- .../AzCore/Tests/azcoretests_files.cmake | 2 + 10 files changed, 443 insertions(+), 335 deletions(-) create mode 100644 Code/Framework/AzCore/Tests/DOM/DomFixtures.cpp create mode 100644 Code/Framework/AzCore/Tests/DOM/DomFixtures.h diff --git a/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp b/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp index c604373296..bc5c2b28cf 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomUtils.cpp @@ -77,8 +77,8 @@ namespace AZ::Dom::Utils for (size_t i = 0; i < ourValues.size(); ++i) { const Object::EntryType& lhsChild = ourValues[i]; - const Object::EntryType& rhsChild = theirValues[i]; - if (lhsChild.first != rhsChild.first || !DeepCompareIsEqual(lhsChild.second, rhsChild.second)) + auto rhsIt = rhs.FindMember(lhsChild.first); + if (rhsIt == rhs.MemberEnd() || !DeepCompareIsEqual(lhsChild.second, rhsIt->second)) { return false; } @@ -144,8 +144,8 @@ namespace AZ::Dom::Utils for (size_t i = 0; i < ourProperties.size(); ++i) { const Object::EntryType& lhsChild = ourProperties[i]; - const Object::EntryType& rhsChild = theirProperties[i]; - if (lhsChild.first != rhsChild.first || !DeepCompareIsEqual(lhsChild.second, rhsChild.second)) + auto rhsIt = rhs.FindMember(lhsChild.first); + if (rhsIt == rhs.MemberEnd() || !DeepCompareIsEqual(lhsChild.second, rhsIt->second)) { return false; } diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp index 6d944c9f45..10c8e33715 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.cpp @@ -283,64 +283,33 @@ namespace AZ::Dom Type Dom::Value::GetType() const { - return AZStd::visit( - [](auto&& value) -> Type - { - using CurrentType = AZStd::decay_t; - if constexpr (AZStd::is_same_v) - { - return Type::Null; - } - else if constexpr (AZStd::is_same_v) - { - return Type::Int64; - } - else if constexpr (AZStd::is_same_v) - { - return Type::Uint64; - } - else if constexpr (AZStd::is_same_v) - { - return Type::Double; - } - else if constexpr (AZStd::is_same_v) - { - return Type::Bool; - } - else if constexpr (AZStd::is_same_v) - { - return Type::String; - } - else if constexpr (AZStd::is_same_v) - { - return Type::String; - } - else if constexpr (AZStd::is_same_v) - { - return Type::String; - } - else if constexpr (AZStd::is_same_v) - { - return Type::Object; - } - else if constexpr (AZStd::is_same_v) - { - return Type::Array; - } - else if constexpr (AZStd::is_same_v) - { - return Type::Node; - } - else if constexpr (AZStd::is_same_v) - { - return Type::Opaque; - } - else - { - AZ_Assert(false, "AZ::Dom::Value::GetType: m_value has an unexpected type"); - } - }, - m_value); + switch (m_value.index()) + { + case GetTypeIndex(): + return Type::Null; + case GetTypeIndex(): + return Type::Int64; + case GetTypeIndex(): + return Type::Uint64; + case GetTypeIndex(): + return Type::Double; + case GetTypeIndex(): + return Type::Bool; + case GetTypeIndex(): + case GetTypeIndex(): + case GetTypeIndex(): + return Type::String; + case GetTypeIndex(): + return Type::Object; + case GetTypeIndex(): + return Type::Array; + case GetTypeIndex(): + return Type::Node; + case GetTypeIndex>(): + return Type::Opaque; + } + AZ_Assert(false, "AZ::Dom::Value::GetType: m_value has an unexpected type"); + return Type::Null; } bool Value::IsNull() const @@ -594,12 +563,12 @@ namespace AZ::Dom return GetObjectInternal().end(); } - Object::Iterator Value::MemberBegin() + Object::Iterator Value::MutableMemberBegin() { return GetObjectInternal().begin(); } - Object::Iterator Value::MemberEnd() + Object::Iterator Value::MutableMemberEnd() { return GetObjectInternal().end(); } @@ -725,12 +694,12 @@ namespace AZ::Dom return object.end(); } - Object::Iterator Value::EraseMember(Object::ConstIterator pos) + Object::Iterator Value::EraseMember(Object::Iterator pos) { return GetObjectInternal().erase(pos); } - Object::Iterator Value::EraseMember(Object::ConstIterator first, Object::ConstIterator last) + Object::Iterator Value::EraseMember(Object::Iterator first, Object::Iterator last) { return GetObjectInternal().erase(first, last); } @@ -811,12 +780,12 @@ namespace AZ::Dom return GetArrayInternal().end(); } - Array::Iterator Value::ArrayBegin() + Array::Iterator Value::MutableArrayBegin() { return GetArrayInternal().begin(); } - Array::Iterator Value::ArrayEnd() + Array::Iterator Value::MutableArrayEnd() { return GetArrayInternal().end(); } @@ -843,12 +812,12 @@ namespace AZ::Dom return *this; } - Array::Iterator Value::ArrayErase(Array::ConstIterator pos) + Array::Iterator Value::ArrayErase(Array::Iterator pos) { return GetArrayInternal().erase(pos); } - Array::Iterator Value::ArrayErase(Array::ConstIterator first, Array::ConstIterator last) + Array::Iterator Value::ArrayErase(Array::Iterator first, Array::Iterator last) { return GetArrayInternal().erase(first, last); } @@ -1113,6 +1082,10 @@ namespace AZ::Dom { result = visitor.RefCountedString(arg, copyStrings ? Lifetime::Temporary : Lifetime::Persistent); } + else if constexpr (AZStd::is_same_v) + { + result = visitor.String(arg, copyStrings ? Lifetime::Temporary : Lifetime::Persistent); + } else if constexpr (AZStd::is_same_v) { result = visitor.StartObject(); diff --git a/Code/Framework/AzCore/AzCore/DOM/DomValue.h b/Code/Framework/AzCore/AzCore/DOM/DomValue.h index ecf8326525..d1d3c1745d 100644 --- a/Code/Framework/AzCore/AzCore/DOM/DomValue.h +++ b/Code/Framework/AzCore/AzCore/DOM/DomValue.h @@ -268,8 +268,8 @@ namespace AZ::Dom Object::ConstIterator MemberBegin() const; Object::ConstIterator MemberEnd() const; - Object::Iterator MemberBegin(); - Object::Iterator MemberEnd(); + Object::Iterator MutableMemberBegin(); + Object::Iterator MutableMemberEnd(); Object::Iterator FindMutableMember(KeyType name); Object::Iterator FindMutableMember(AZStd::string_view name); @@ -289,8 +289,8 @@ namespace AZ::Dom void RemoveMember(KeyType name); void RemoveMember(AZStd::string_view name); Object::Iterator RemoveMember(Object::Iterator pos); - Object::Iterator EraseMember(Object::ConstIterator pos); - Object::Iterator EraseMember(Object::ConstIterator first, Object::ConstIterator last); + Object::Iterator EraseMember(Object::Iterator pos); + Object::Iterator EraseMember(Object::Iterator first, Object::Iterator last); Object::Iterator EraseMember(KeyType name); Object::Iterator EraseMember(AZStd::string_view name); @@ -313,15 +313,15 @@ namespace AZ::Dom Array::ConstIterator ArrayBegin() const; Array::ConstIterator ArrayEnd() const; - Array::Iterator ArrayBegin(); - Array::Iterator ArrayEnd(); + Array::Iterator MutableArrayBegin(); + Array::Iterator MutableArrayEnd(); Value& ArrayReserve(size_t newCapacity); Value& ArrayPushBack(Value value); Value& ArrayPopBack(); - Array::Iterator ArrayErase(Array::ConstIterator pos); - Array::Iterator ArrayErase(Array::ConstIterator first, Array::ConstIterator last); + Array::Iterator ArrayErase(Array::Iterator pos); + Array::Iterator ArrayErase(Array::Iterator first, Array::Iterator last); Array::ContainerType& GetMutableArray(); const Array::ContainerType& GetArray() const; diff --git a/Code/Framework/AzCore/Tests/DOM/DomFixtures.cpp b/Code/Framework/AzCore/Tests/DOM/DomFixtures.cpp new file mode 100644 index 0000000000..236c1f6d74 --- /dev/null +++ b/Code/Framework/AzCore/Tests/DOM/DomFixtures.cpp @@ -0,0 +1,189 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include +#include +#include +#include + +namespace AZ::Dom::Tests +{ + void DomTestHarness::SetUpHarness() + { + NameDictionary::Create(); + AZ::AllocatorInstance::Create(); + } + + void DomTestHarness::TearDownHarness() + { + AZ::AllocatorInstance::Destroy(); + NameDictionary::Destroy(); + } + + void DomBenchmarkFixture::SetUp(const ::benchmark::State& st) + { + UnitTest::AllocatorsBenchmarkFixture::SetUp(st); + SetUpHarness(); + } + + void DomBenchmarkFixture::SetUp(::benchmark::State& st) + { + UnitTest::AllocatorsBenchmarkFixture::SetUp(st); + SetUpHarness(); + } + + void DomBenchmarkFixture::TearDown(::benchmark::State& st) + { + TearDownHarness(); + UnitTest::AllocatorsBenchmarkFixture::TearDown(st); + } + + void DomBenchmarkFixture::TearDown(const ::benchmark::State& st) + { + TearDownHarness(); + UnitTest::AllocatorsBenchmarkFixture::TearDown(st); + } + + rapidjson::Document DomBenchmarkFixture::GenerateDomJsonBenchmarkDocument(int64_t entryCount, int64_t stringTemplateLength) + { + rapidjson::Document document; + document.SetObject(); + + AZStd::string entryTemplate; + while (entryTemplate.size() < aznumeric_cast(stringTemplateLength)) + { + entryTemplate += "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor "; + } + entryTemplate.resize(stringTemplateLength); + AZStd::string buffer; + + auto createString = [&](int n) -> rapidjson::Value + { + buffer = AZStd::string::format("#%i %s", n, entryTemplate.c_str()); + return rapidjson::Value(buffer.data(), aznumeric_cast(buffer.size()), document.GetAllocator()); + }; + + auto createEntry = [&](int n) -> rapidjson::Value + { + rapidjson::Value entry(rapidjson::kObjectType); + entry.AddMember("string", createString(n), document.GetAllocator()); + entry.AddMember("int", rapidjson::Value(n), document.GetAllocator()); + entry.AddMember("double", rapidjson::Value(aznumeric_cast(n) * 0.5), document.GetAllocator()); + entry.AddMember("bool", rapidjson::Value(n % 2 == 0), document.GetAllocator()); + entry.AddMember("null", rapidjson::Value(rapidjson::kNullType), document.GetAllocator()); + return entry; + }; + + auto createArray = [&]() -> rapidjson::Value + { + rapidjson::Value array; + array.SetArray(); + for (int i = 0; i < entryCount; ++i) + { + array.PushBack(createEntry(i), document.GetAllocator()); + } + return array; + }; + + auto createObject = [&]() -> rapidjson::Value + { + rapidjson::Value object; + object.SetObject(); + for (int i = 0; i < entryCount; ++i) + { + buffer = AZStd::string::format("Key%i", i); + rapidjson::Value key; + key.SetString(buffer.data(), aznumeric_cast(buffer.length()), document.GetAllocator()); + object.AddMember(key.Move(), createArray(), document.GetAllocator()); + } + return object; + }; + + document.SetObject(); + document.AddMember("entries", createObject(), document.GetAllocator()); + + return document; + } + + AZStd::string DomBenchmarkFixture::GenerateDomJsonBenchmarkPayload(int64_t entryCount, int64_t stringTemplateLength) + { + rapidjson::Document document = GenerateDomJsonBenchmarkDocument(entryCount, stringTemplateLength); + + AZStd::string serializedJson; + auto result = AZ::JsonSerializationUtils::WriteJsonString(document, serializedJson); + AZ_Assert(result.IsSuccess(), "Failed to serialize generated JSON"); + return serializedJson; + } + + Value DomBenchmarkFixture::GenerateDomBenchmarkPayload(int64_t entryCount, int64_t stringTemplateLength) + { + Value root(Type::Object); + + AZStd::string entryTemplate; + while (entryTemplate.size() < aznumeric_cast(stringTemplateLength)) + { + entryTemplate += "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor "; + } + entryTemplate.resize(stringTemplateLength); + AZStd::string buffer; + + auto createString = [&](int n) -> Value + { + return Value(AZStd::string::format("#%i %s", n, entryTemplate.c_str()), true); + }; + + auto createEntry = [&](int n) -> Value + { + Value entry(Type::Object); + entry.AddMember("string", createString(n)); + entry.AddMember("int", Value(n)); + entry.AddMember("double", Value(aznumeric_cast(n) * 0.5)); + entry.AddMember("bool", Value(n % 2 == 0)); + entry.AddMember("null", Value(Type::Null)); + return entry; + }; + + auto createArray = [&]() -> Value + { + Value array(Type::Array); + for (int i = 0; i < entryCount; ++i) + { + array.ArrayPushBack(createEntry(i)); + } + return array; + }; + + auto createObject = [&]() -> Value + { + Value object; + object.SetObject(); + for (int i = 0; i < entryCount; ++i) + { + buffer = AZStd::string::format("Key%i", i); + object.AddMember(AZ::Name(buffer), createArray()); + } + return object; + }; + + root["entries"] = createObject(); + + return root; + } + + void DomTestFixture::SetUp() + { + UnitTest::AllocatorsFixture::SetUp(); + SetUpHarness(); + } + + void DomTestFixture::TearDown() + { + TearDownHarness(); + UnitTest::AllocatorsFixture::TearDown(); + } +} // namespace AZ::Dom::Tests diff --git a/Code/Framework/AzCore/Tests/DOM/DomFixtures.h b/Code/Framework/AzCore/Tests/DOM/DomFixtures.h new file mode 100644 index 0000000000..381eff6b98 --- /dev/null +++ b/Code/Framework/AzCore/Tests/DOM/DomFixtures.h @@ -0,0 +1,66 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include +#include + +#define DOM_REGISTER_SERIALIZATION_BENCHMARK(BaseClass, Method) \ + BENCHMARK_REGISTER_F(BaseClass, Method)->Args({ 10, 5 })->Args({ 10, 500 })->Args({ 100, 5 })->Args({ 100, 500 }) +#define DOM_REGISTER_SERIALIZATION_BENCHMARK_MS(BaseClass, Method) \ + DOM_REGISTER_SERIALIZATION_BENCHMARK(BaseClass, Method)->Unit(benchmark::kMillisecond); +#define DOM_REGISTER_SERIALIZATION_BENCHMARK_NS(BaseClass, Method) \ + DOM_REGISTER_SERIALIZATION_BENCHMARK(BaseClass, Method)->Unit(benchmark::kNanosecond); + +namespace AZ::Dom::Tests +{ + class DomTestHarness + { + public: + virtual ~DomTestHarness() = default; + + virtual void SetUpHarness(); + virtual void TearDownHarness(); + }; + + class DomBenchmarkFixture + : public DomTestHarness + , public UnitTest::AllocatorsBenchmarkFixture + { + public: + void SetUp(const ::benchmark::State& st) override; + void SetUp(::benchmark::State& st) override; + void TearDown(::benchmark::State& st) override; + void TearDown(const ::benchmark::State& st) override; + + rapidjson::Document GenerateDomJsonBenchmarkDocument(int64_t entryCount, int64_t stringTemplateLength); + AZStd::string GenerateDomJsonBenchmarkPayload(int64_t entryCount, int64_t stringTemplateLength); + Value GenerateDomBenchmarkPayload(int64_t entryCount, int64_t stringTemplateLength); + + template + static void TakeAndDiscardWithoutTimingDtor(T&& value, benchmark::State& state) + { + { + T instance = AZStd::move(value); + state.PauseTiming(); + } + state.ResumeTiming(); + } + }; + + class DomTestFixture + : public DomTestHarness + , public UnitTest::AllocatorsFixture + { + public: + void SetUp() override; + void TearDown() override; + }; +} // namespace AZ::Dom::Tests diff --git a/Code/Framework/AzCore/Tests/DOM/DomJsonBenchmarks.cpp b/Code/Framework/AzCore/Tests/DOM/DomJsonBenchmarks.cpp index 8eda110e7b..f84b60af07 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomJsonBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomJsonBenchmarks.cpp @@ -16,131 +16,14 @@ #include #include #include +#include -namespace Benchmark +namespace AZ::Dom::Benchmark { - class DomJsonBenchmark : public UnitTest::AllocatorsBenchmarkFixture + class DomJsonBenchmark : public Tests::DomBenchmarkFixture { - public: - void SetUp(const ::benchmark::State& st) override - { - UnitTest::AllocatorsBenchmarkFixture::SetUp(st); - AZ::NameDictionary::Create(); - AZ::AllocatorInstance::Create(); - } - - void SetUp(::benchmark::State& st) override - { - UnitTest::AllocatorsBenchmarkFixture::SetUp(st); - AZ::NameDictionary::Create(); - AZ::AllocatorInstance::Create(); - } - - void TearDown(::benchmark::State& st) override - { - AZ::AllocatorInstance::Destroy(); - AZ::NameDictionary::Destroy(); - UnitTest::AllocatorsBenchmarkFixture::TearDown(st); - } - - void TearDown(const ::benchmark::State& st) override - { - AZ::AllocatorInstance::Destroy(); - AZ::NameDictionary::Destroy(); - UnitTest::AllocatorsBenchmarkFixture::TearDown(st); - } - - rapidjson::Document GenerateDomJsonBenchmarkDocument(int64_t entryCount, int64_t stringTemplateLength) - { - rapidjson::Document document; - document.SetObject(); - - AZStd::string entryTemplate; - while (entryTemplate.size() < static_cast(stringTemplateLength)) - { - entryTemplate += "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor "; - } - entryTemplate.resize(stringTemplateLength); - AZStd::string buffer; - - auto createString = [&](int n) -> rapidjson::Value - { - buffer = AZStd::string::format("#%i %s", n, entryTemplate.c_str()); - return rapidjson::Value(buffer.data(), static_cast(buffer.size()), document.GetAllocator()); - }; - - auto createEntry = [&](int n) -> rapidjson::Value - { - rapidjson::Value entry(rapidjson::kObjectType); - entry.AddMember("string", createString(n), document.GetAllocator()); - entry.AddMember("int", rapidjson::Value(n), document.GetAllocator()); - entry.AddMember("double", rapidjson::Value(static_cast(n) * 0.5), document.GetAllocator()); - entry.AddMember("bool", rapidjson::Value(n % 2 == 0), document.GetAllocator()); - entry.AddMember("null", rapidjson::Value(rapidjson::kNullType), document.GetAllocator()); - return entry; - }; - - auto createArray = [&]() -> rapidjson::Value - { - rapidjson::Value array; - array.SetArray(); - for (int i = 0; i < entryCount; ++i) - { - array.PushBack(createEntry(i), document.GetAllocator()); - } - return array; - }; - - auto createObject = [&]() -> rapidjson::Value - { - rapidjson::Value object; - object.SetObject(); - for (int i = 0; i < entryCount; ++i) - { - buffer = AZStd::string::format("Key%i", i); - rapidjson::Value key; - key.SetString(buffer.data(), static_cast(buffer.length()), document.GetAllocator()); - object.AddMember(key.Move(), createArray(), document.GetAllocator()); - } - return object; - }; - - document.SetObject(); - document.AddMember("entries", createObject(), document.GetAllocator()); - - return document; - } - - AZStd::string GenerateDomJsonBenchmarkPayload(int64_t entryCount, int64_t stringTemplateLength) - { - rapidjson::Document document = GenerateDomJsonBenchmarkDocument(entryCount, stringTemplateLength); - - AZStd::string serializedJson; - auto result = AZ::JsonSerializationUtils::WriteJsonString(document, serializedJson); - AZ_Assert(result.IsSuccess(), "Failed to serialize generated JSON"); - return serializedJson; - } - - template - void TakeAndDiscardWithoutTimingDtor(T&& value, benchmark::State& state) - { - { - T instance = AZStd::move(value); - state.PauseTiming(); - } - state.ResumeTiming(); - } }; -// Helper macro for registering JSON benchmarks -#define BENCHMARK_REGISTER_JSON(BaseClass, Method) \ - BENCHMARK_REGISTER_F(BaseClass, Method) \ - ->Args({ 10, 5 }) \ - ->Args({ 10, 500 }) \ - ->Args({ 100, 5 }) \ - ->Args({ 100, 500 }) \ - ->Unit(benchmark::kMillisecond); - BENCHMARK_DEFINE_F(DomJsonBenchmark, AzDomDeserializeToRapidjsonInPlace)(benchmark::State& state) { AZ::Dom::JsonBackend backend; @@ -163,7 +46,7 @@ namespace Benchmark state.SetBytesProcessed(serializedPayload.size() * state.iterations()); } - BENCHMARK_REGISTER_JSON(DomJsonBenchmark, AzDomDeserializeToRapidjsonInPlace) + DOM_REGISTER_SERIALIZATION_BENCHMARK_MS(DomJsonBenchmark, AzDomDeserializeToRapidjsonInPlace) BENCHMARK_DEFINE_F(DomJsonBenchmark, AzDomDeserializeToAzDomValueInPlace)(benchmark::State& state) { @@ -187,7 +70,7 @@ namespace Benchmark state.SetBytesProcessed(serializedPayload.size() * state.iterations()); } - BENCHMARK_REGISTER_JSON(DomJsonBenchmark, AzDomDeserializeToAzDomValueInPlace) + DOM_REGISTER_SERIALIZATION_BENCHMARK_MS(DomJsonBenchmark, AzDomDeserializeToAzDomValueInPlace) BENCHMARK_DEFINE_F(DomJsonBenchmark, AzDomDeserializeToRapidjson)(benchmark::State& state) { @@ -207,7 +90,7 @@ namespace Benchmark state.SetBytesProcessed(serializedPayload.size() * state.iterations()); } - BENCHMARK_REGISTER_JSON(DomJsonBenchmark, AzDomDeserializeToRapidjson) + DOM_REGISTER_SERIALIZATION_BENCHMARK_MS(DomJsonBenchmark, AzDomDeserializeToRapidjson) BENCHMARK_DEFINE_F(DomJsonBenchmark, AzDomDeserializeToAzDomValue)(benchmark::State& state) { @@ -227,7 +110,7 @@ namespace Benchmark state.SetBytesProcessed(serializedPayload.size() * state.iterations()); } - BENCHMARK_REGISTER_JSON(DomJsonBenchmark, AzDomDeserializeToAzDomValue) + DOM_REGISTER_SERIALIZATION_BENCHMARK_MS(DomJsonBenchmark, AzDomDeserializeToAzDomValue) BENCHMARK_DEFINE_F(DomJsonBenchmark, RapidjsonDeserializeToRapidjson)(benchmark::State& state) { @@ -243,7 +126,7 @@ namespace Benchmark state.SetBytesProcessed(serializedPayload.size() * state.iterations()); } - BENCHMARK_REGISTER_JSON(DomJsonBenchmark, RapidjsonDeserializeToRapidjson) + DOM_REGISTER_SERIALIZATION_BENCHMARK_MS(DomJsonBenchmark, RapidjsonDeserializeToRapidjson) BENCHMARK_DEFINE_F(DomJsonBenchmark, RapidjsonMakeComplexObject)(benchmark::State& state) { @@ -254,7 +137,7 @@ namespace Benchmark state.SetItemsProcessed(state.range(0) * state.range(0) * state.iterations()); } - BENCHMARK_REGISTER_JSON(DomJsonBenchmark, RapidjsonMakeComplexObject) + DOM_REGISTER_SERIALIZATION_BENCHMARK_MS(DomJsonBenchmark, RapidjsonMakeComplexObject) BENCHMARK_DEFINE_F(DomJsonBenchmark, RapidjsonLookupMemberByString)(benchmark::State& state) { @@ -264,7 +147,9 @@ namespace Benchmark { AZStd::string key(AZStd::string::format("key%" PRId64, i)); keys.push_back(key); - document.AddMember(rapidjson::Value(key.data(), static_cast(key.size()), document.GetAllocator()), rapidjson::Value(i), document.GetAllocator()); + document.AddMember( + rapidjson::Value(key.data(), static_cast(key.size()), document.GetAllocator()), rapidjson::Value(i), + document.GetAllocator()); } for (auto _ : state) @@ -293,7 +178,7 @@ namespace Benchmark state.SetItemsProcessed(state.iterations()); } - BENCHMARK_REGISTER_JSON(DomJsonBenchmark, RapidjsonDeepCopy) + DOM_REGISTER_SERIALIZATION_BENCHMARK_MS(DomJsonBenchmark, RapidjsonDeepCopy) BENCHMARK_DEFINE_F(DomJsonBenchmark, RapidjsonCopyAndMutate)(benchmark::State& state) { @@ -309,9 +194,8 @@ namespace Benchmark state.SetItemsProcessed(state.iterations()); } - BENCHMARK_REGISTER_JSON(DomJsonBenchmark, RapidjsonCopyAndMutate) + DOM_REGISTER_SERIALIZATION_BENCHMARK_MS(DomJsonBenchmark, RapidjsonCopyAndMutate) -#undef BENCHMARK_REGISTER_JSON -} // namespace Benchmark +} // namespace AZ::Dom::Benchmark #endif // defined(HAVE_BENCHMARK) diff --git a/Code/Framework/AzCore/Tests/DOM/DomJsonTests.cpp b/Code/Framework/AzCore/Tests/DOM/DomJsonTests.cpp index c7af6438cf..ff9e378134 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomJsonTests.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomJsonTests.cpp @@ -13,24 +13,23 @@ #include #include #include +#include namespace AZ::Dom::Tests { - class DomJsonTests : public UnitTest::AllocatorsFixture + class DomJsonTests : public DomTestFixture { public: void SetUp() override { - UnitTest::AllocatorsFixture::SetUp(); - NameDictionary::Create(); + DomTestFixture::SetUp(); m_document = AZStd::make_unique(); } void TearDown() override { m_document.reset(); - NameDictionary::Destroy(); - UnitTest::AllocatorsFixture::TearDown(); + DomTestFixture::TearDown(); } rapidjson::Value CreateString(const AZStd::string& text) diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp index 40b96e148b..69d99eb12b 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomValueBenchmarks.cpp @@ -6,110 +6,133 @@ * */ -#include #include +#include #include #include -#include +#include namespace AZ::Dom::Benchmark { - class DomValueBenchmark : public UnitTest::AllocatorsBenchmarkFixture + class DomValueBenchmark : public Tests::DomBenchmarkFixture { - public: - void SetUp(const ::benchmark::State& st) override - { - UnitTest::AllocatorsBenchmarkFixture::SetUp(st); - AZ::NameDictionary::Create(); - AZ::AllocatorInstance::Create(); - } + }; - void SetUp(::benchmark::State& st) override - { - UnitTest::AllocatorsBenchmarkFixture::SetUp(st); - AZ::NameDictionary::Create(); - AZ::AllocatorInstance::Create(); - } + BENCHMARK_DEFINE_F(DomValueBenchmark, AzDomValueGetType_UsingVariantIndex)(benchmark::State& state) + { + Value intValue(5); + Value boolValue(true); + Value objValue(Type::Object); + Value nodeValue(Type::Node); + Value arrValue(Type::Array); + Value uintValue(5u); + Value doubleValue(4.0); + Value stringValue("foo", true); - void TearDown(::benchmark::State& st) override + for (auto _ : state) { - AZ::AllocatorInstance::Destroy(); - AZ::NameDictionary::Destroy(); - UnitTest::AllocatorsBenchmarkFixture::TearDown(st); + (intValue.GetType()); + (boolValue.GetType()); + (objValue.GetType()); + (nodeValue.GetType()); + (arrValue.GetType()); + (uintValue.GetType()); + (doubleValue.GetType()); + (stringValue.GetType()); } - void TearDown(const ::benchmark::State& st) override - { - AZ::AllocatorInstance::Destroy(); - AZ::NameDictionary::Destroy(); - UnitTest::AllocatorsBenchmarkFixture::TearDown(st); - } + state.SetItemsProcessed(8 * state.iterations()); + } + BENCHMARK_REGISTER_F(DomValueBenchmark, AzDomValueGetType_UsingVariantIndex); - Value GenerateDomBenchmarkPayload(int64_t entryCount, int64_t stringTemplateLength) + BENCHMARK_DEFINE_F(DomValueBenchmark, AzDomValueGetType_UsingVariantVisit)(benchmark::State& state) + { + Value intValue(5); + Value boolValue(true); + Value objValue(Type::Object); + Value nodeValue(Type::Node); + Value arrValue(Type::Array); + Value uintValue(5u); + Value doubleValue(4.0); + Value stringValue("foo", true); + + auto getTypeViaVisit = [](const Value& value) { - Value root(Type::Object); - - AZStd::string entryTemplate; - while (entryTemplate.size() < static_cast(stringTemplateLength)) - { - entryTemplate += "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor "; - } - entryTemplate.resize(stringTemplateLength); - AZStd::string buffer; - - auto createString = [&](int n) -> Value - { - return Value(AZStd::string::format("#%i %s", n, entryTemplate.c_str()), true); - }; - - auto createEntry = [&](int n) -> Value - { - Value entry(Type::Object); - entry.AddMember("string", createString(n)); - entry.AddMember("int", Value(n)); - entry.AddMember("double", Value(static_cast(n) * 0.5)); - entry.AddMember("bool", Value(n % 2 == 0)); - entry.AddMember("null", Value(Type::Null)); - return entry; - }; - - auto createArray = [&]() -> Value - { - Value array(Type::Array); - for (int i = 0; i < entryCount; ++i) + return AZStd::visit( + [](auto&& value) constexpr -> Type { - array.ArrayPushBack(createEntry(i)); - } - return array; - }; - - auto createObject = [&]() -> Value - { - Value object; - object.SetObject(); - for (int i = 0; i < entryCount; ++i) - { - buffer = AZStd::string::format("Key%i", i); - object.AddMember(AZ::Name(buffer), createArray()); - } - return object; - }; - - root["entries"] = createObject(); - - return root; - } + using CurrentType = AZStd::decay_t; + if constexpr (AZStd::is_same_v) + { + return Type::Null; + } + else if constexpr (AZStd::is_same_v) + { + return Type::Int64; + } + else if constexpr (AZStd::is_same_v) + { + return Type::Uint64; + } + else if constexpr (AZStd::is_same_v) + { + return Type::Double; + } + else if constexpr (AZStd::is_same_v) + { + return Type::Bool; + } + else if constexpr (AZStd::is_same_v) + { + return Type::String; + } + else if constexpr (AZStd::is_same_v) + { + return Type::String; + } + else if constexpr (AZStd::is_same_v) + { + return Type::String; + } + else if constexpr (AZStd::is_same_v) + { + return Type::Object; + } + else if constexpr (AZStd::is_same_v) + { + return Type::Array; + } + else if constexpr (AZStd::is_same_v) + { + return Type::Node; + } + else if constexpr (AZStd::is_same_v) + { + return Type::Opaque; + } + else + { + AZ_Assert(false, "AZ::Dom::Value::GetType: m_value has an unexpected type"); + } + }, + value.GetInternalValue()); + }; - template - void TakeAndDiscardWithoutTimingDtor(T&& value, benchmark::State& state) + for (auto _ : state) { - { - T instance = AZStd::move(value); - state.PauseTiming(); - } - state.ResumeTiming(); + (getTypeViaVisit(intValue)); + (getTypeViaVisit(boolValue)); + (getTypeViaVisit(objValue)); + (getTypeViaVisit(nodeValue)); + (getTypeViaVisit(arrValue)); + (getTypeViaVisit(uintValue)); + (getTypeViaVisit(doubleValue)); + (getTypeViaVisit(stringValue)); } - }; + + state.SetItemsProcessed(8 * state.iterations()); + } + BENCHMARK_REGISTER_F(DomValueBenchmark, AzDomValueGetType_UsingVariantVisit); BENCHMARK_DEFINE_F(DomValueBenchmark, AzDomValueMakeComplexObject)(benchmark::State& state) { @@ -120,12 +143,7 @@ namespace AZ::Dom::Benchmark state.SetItemsProcessed(state.range(0) * state.range(0) * state.iterations()); } - BENCHMARK_REGISTER_F(DomValueBenchmark, AzDomValueMakeComplexObject) - ->Args({ 10, 5 }) - ->Args({ 10, 500 }) - ->Args({ 100, 5 }) - ->Args({ 100, 500 }) - ->Unit(benchmark::kMillisecond); + DOM_REGISTER_SERIALIZATION_BENCHMARK_MS(DomValueBenchmark, AzDomValueMakeComplexObject) BENCHMARK_DEFINE_F(DomValueBenchmark, AzDomValueShallowCopy)(benchmark::State& state) { @@ -139,12 +157,7 @@ namespace AZ::Dom::Benchmark state.SetItemsProcessed(state.iterations()); } - BENCHMARK_REGISTER_F(DomValueBenchmark, AzDomValueShallowCopy) - ->Args({ 10, 5 }) - ->Args({ 10, 500 }) - ->Args({ 100, 5 }) - ->Args({ 100, 500 }) - ->Unit(benchmark::kNanosecond); + DOM_REGISTER_SERIALIZATION_BENCHMARK_NS(DomValueBenchmark, AzDomValueShallowCopy) BENCHMARK_DEFINE_F(DomValueBenchmark, AzDomValueCopyAndMutate)(benchmark::State& state) { @@ -159,12 +172,7 @@ namespace AZ::Dom::Benchmark state.SetItemsProcessed(state.iterations()); } - BENCHMARK_REGISTER_F(DomValueBenchmark, AzDomValueCopyAndMutate) - ->Args({ 10, 5 }) - ->Args({ 10, 500 }) - ->Args({ 100, 5 }) - ->Args({ 100, 500 }) - ->Unit(benchmark::kNanosecond); + DOM_REGISTER_SERIALIZATION_BENCHMARK_MS(DomValueBenchmark, AzDomValueCopyAndMutate) BENCHMARK_DEFINE_F(DomValueBenchmark, AzDomValueDeepCopy)(benchmark::State& state) { @@ -178,12 +186,7 @@ namespace AZ::Dom::Benchmark state.SetItemsProcessed(state.iterations()); } - BENCHMARK_REGISTER_F(DomValueBenchmark, AzDomValueDeepCopy) - ->Args({ 10, 5 }) - ->Args({ 10, 500 }) - ->Args({ 100, 5 }) - ->Args({ 100, 500 }) - ->Unit(benchmark::kMillisecond); + DOM_REGISTER_SERIALIZATION_BENCHMARK_MS(DomValueBenchmark, AzDomValueDeepCopy) BENCHMARK_DEFINE_F(DomValueBenchmark, LookupMemberByName)(benchmark::State& state) { diff --git a/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp b/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp index 10e9f29a44..f39ca4818a 100644 --- a/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp +++ b/Code/Framework/AzCore/Tests/DOM/DomValueTests.cpp @@ -15,26 +15,18 @@ #include #include #include +#include namespace AZ::Dom::Tests { - class DomValueTests : public UnitTest::AllocatorsFixture + class DomValueTests : public DomTestFixture { public: - void SetUp() override - { - UnitTest::AllocatorsFixture::SetUp(); - NameDictionary::Create(); - AZ::AllocatorInstance::Create(); - } - void TearDown() override { m_value = Value(); - AZ::AllocatorInstance::Destroy(); - NameDictionary::Destroy(); - UnitTest::AllocatorsFixture::TearDown(); + DomTestFixture::TearDown(); } void PerformValueChecks() diff --git a/Code/Framework/AzCore/Tests/azcoretests_files.cmake b/Code/Framework/AzCore/Tests/azcoretests_files.cmake index 7be3afb4a9..aee6828b76 100644 --- a/Code/Framework/AzCore/Tests/azcoretests_files.cmake +++ b/Code/Framework/AzCore/Tests/azcoretests_files.cmake @@ -215,6 +215,8 @@ set(FILES AZStd/Variant.cpp AZStd/VariantSerialization.cpp AZStd/VectorAndArray.cpp + DOM/DomFixtures.cpp + DOM/DomFixtures.h DOM/DomJsonTests.cpp DOM/DomJsonBenchmarks.cpp DOM/DomValueTests.cpp From 5cac67bfaddd9fc568e35ad2c1f8a75a03f0b765 Mon Sep 17 00:00:00 2001 From: Vincent Liu <5900509+onecent1101@users.noreply.github.com> Date: Wed, 19 Jan 2022 12:11:39 -0800 Subject: [PATCH 553/948] Silence aws logging for unit test and have a new AWSNativeSDK as entry point for test env (#6865) * Silence aws logging for unit test * Create a new AWSNativeSDK entry point for test environment only * Update naming for target and file --- Code/Tools/AWSNativeSDKInit/CMakeLists.txt | 18 ++++++++ .../aws_native_sdk_test_files.cmake | 12 +++++ .../source/AWSNativeSDKInit.cpp | 1 - .../tests/libs/AWSNativeSDKTestManager.cpp | 45 +++++++++++++++++++ .../tests/libs/AWSNativeSDKTestManager.h | 39 ++++++++++++++++ Gems/AWSClientAuth/Code/CMakeLists.txt | 3 +- .../Code/Tests/AWSClientAuthGemMock.h | 7 ++- Gems/AWSCore/Code/CMakeLists.txt | 4 +- .../Code/Tests/AWSCoreSystemComponentTest.cpp | 4 +- .../Code/Tests/TestFramework/AWSCoreFixture.h | 6 +-- .../Code/AWSGameLiftClient/CMakeLists.txt | 2 +- .../Tests/AWSGameLiftClientFixture.h | 7 +-- 12 files changed, 130 insertions(+), 18 deletions(-) create mode 100644 Code/Tools/AWSNativeSDKInit/aws_native_sdk_test_files.cmake create mode 100644 Code/Tools/AWSNativeSDKInit/tests/libs/AWSNativeSDKTestManager.cpp create mode 100644 Code/Tools/AWSNativeSDKInit/tests/libs/AWSNativeSDKTestManager.h diff --git a/Code/Tools/AWSNativeSDKInit/CMakeLists.txt b/Code/Tools/AWSNativeSDKInit/CMakeLists.txt index 04f61eb924..de3e0008c2 100644 --- a/Code/Tools/AWSNativeSDKInit/CMakeLists.txt +++ b/Code/Tools/AWSNativeSDKInit/CMakeLists.txt @@ -25,6 +25,24 @@ ly_add_target( AZ::AzCore ) +ly_add_target( + NAME AWSNativeSDKTestLibs STATIC + NAMESPACE AZ + FILES_CMAKE + aws_native_sdk_test_files.cmake + INCLUDE_DIRECTORIES + PUBLIC + include + tests/libs + PRIVATE + source + BUILD_DEPENDENCIES + PRIVATE + 3rdParty::AWSNativeSDK::Core + AZ::AzCore + AZ::AzTest +) + ################################################################################ # Tests ################################################################################ diff --git a/Code/Tools/AWSNativeSDKInit/aws_native_sdk_test_files.cmake b/Code/Tools/AWSNativeSDKInit/aws_native_sdk_test_files.cmake new file mode 100644 index 0000000000..17f4b3f6e9 --- /dev/null +++ b/Code/Tools/AWSNativeSDKInit/aws_native_sdk_test_files.cmake @@ -0,0 +1,12 @@ +# +# Copyright (c) Contributors to the Open 3D Engine Project. +# For complete copyright and license terms please see the LICENSE at the root of this distribution. +# +# SPDX-License-Identifier: Apache-2.0 OR MIT +# +# + +set(FILES + tests/libs/AWSNativeSDKTestManager.cpp + tests/libs/AWSNativeSDKTestManager.h +) diff --git a/Code/Tools/AWSNativeSDKInit/source/AWSNativeSDKInit.cpp b/Code/Tools/AWSNativeSDKInit/source/AWSNativeSDKInit.cpp index ca63859945..ca02b4f223 100644 --- a/Code/Tools/AWSNativeSDKInit/source/AWSNativeSDKInit.cpp +++ b/Code/Tools/AWSNativeSDKInit/source/AWSNativeSDKInit.cpp @@ -89,5 +89,4 @@ namespace AWSNativeSDKInit Platform::CustomizeShutdown(); #endif // #if defined(PLATFORM_SUPPORTS_AWS_NATIVE_SDK) } - } diff --git a/Code/Tools/AWSNativeSDKInit/tests/libs/AWSNativeSDKTestManager.cpp b/Code/Tools/AWSNativeSDKInit/tests/libs/AWSNativeSDKTestManager.cpp new file mode 100644 index 0000000000..29300857c1 --- /dev/null +++ b/Code/Tools/AWSNativeSDKInit/tests/libs/AWSNativeSDKTestManager.cpp @@ -0,0 +1,45 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * 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 AWSNativeSDKTestLibs +{ + AZ::EnvironmentVariable AWSNativeSDKTestManager::s_sdkManager = nullptr; + + AWSNativeSDKTestManager::AWSNativeSDKTestManager() + { + AZ::Test::SetEnv("AWS_DEFAULT_REGION", "us-east-1", 1); + m_awsSDKOptions.memoryManagementOptions.memoryManager = &m_memoryManager; + Aws::InitAPI(m_awsSDKOptions); + } + + AWSNativeSDKTestManager::~AWSNativeSDKTestManager() + { + Aws::ShutdownAPI(m_awsSDKOptions); + AZ::Test::UnsetEnv("AWS_DEFAULT_REGION"); + } + + void AWSNativeSDKTestManager::Init() + { + s_sdkManager = AZ::Environment::CreateVariable(AWSNativeSDKTestManager::SdkManagerTag); + } + + void AWSNativeSDKTestManager::Shutdown() + { + s_sdkManager = nullptr; + } +} diff --git a/Code/Tools/AWSNativeSDKInit/tests/libs/AWSNativeSDKTestManager.h b/Code/Tools/AWSNativeSDKInit/tests/libs/AWSNativeSDKTestManager.h new file mode 100644 index 0000000000..48e97bb6f8 --- /dev/null +++ b/Code/Tools/AWSNativeSDKInit/tests/libs/AWSNativeSDKTestManager.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include +#include + +#include + +#include + +namespace AWSNativeSDKTestLibs +{ + // Entry point for AWSNativeSDK's initialization and shutdown for test environment + // Use an AZ::Environment variable to enforce only one init and shutdown + class AWSNativeSDKTestManager + { + public: + static constexpr const char SdkManagerTag[] = "TestAWSSDKManager"; + + AWSNativeSDKTestManager(); + ~AWSNativeSDKTestManager(); + + static void Init(); + static void Shutdown(); + + private: + static AZ::EnvironmentVariable s_sdkManager; + + AWSNativeSDKInit::MemoryManager m_memoryManager; + Aws::SDKOptions m_awsSDKOptions; + }; +} diff --git a/Gems/AWSClientAuth/Code/CMakeLists.txt b/Gems/AWSClientAuth/Code/CMakeLists.txt index ac9d221f07..e34dd702dd 100644 --- a/Gems/AWSClientAuth/Code/CMakeLists.txt +++ b/Gems/AWSClientAuth/Code/CMakeLists.txt @@ -106,13 +106,12 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) 3rdParty::AWSNativeSDK::AWSClientAuth AZ::AzCore AZ::AzFramework - AZ::AWSNativeSDKInit + AZ::AWSNativeSDKTestLibs Gem::AWSClientAuth.Static Gem::AWSCore Gem::HttpRequestor RUNTIME_DEPENDENCIES Gem::AWSCore - AZ::AWSNativeSDKInit Gem::HttpRequestor ) ly_add_googletest( diff --git a/Gems/AWSClientAuth/Code/Tests/AWSClientAuthGemMock.h b/Gems/AWSClientAuth/Code/Tests/AWSClientAuthGemMock.h index 19314035c4..3bfde09492 100644 --- a/Gems/AWSClientAuth/Code/Tests/AWSClientAuthGemMock.h +++ b/Gems/AWSClientAuth/Code/Tests/AWSClientAuthGemMock.h @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include @@ -542,7 +542,7 @@ namespace AWSClientAuthUnitTest m_jobContext.reset(aznew AZ::JobContext(*m_jobManager, *m_jobCancelGroup)); AZ::JobContext::SetGlobalContext(m_jobContext.get()); - AWSNativeSDKInit::InitializationManager::InitAwsApi(); + AWSNativeSDKTestLibs::AWSNativeSDKTestManager::Init(); m_cognitoIdentityProviderClientMock = std::make_shared(); m_cognitoIdentityClientMock = std::make_shared(); } @@ -557,8 +557,7 @@ namespace AWSClientAuthUnitTest m_cognitoIdentityProviderClientMock.reset(); m_cognitoIdentityClientMock.reset(); - AWSNativeSDKInit::InitializationManager::Shutdown(); - + AWSNativeSDKTestLibs::AWSNativeSDKTestManager::Shutdown(); AZ::AllocatorInstance::Destroy(); diff --git a/Gems/AWSCore/Code/CMakeLists.txt b/Gems/AWSCore/Code/CMakeLists.txt index 3911aefce6..bb836b57bd 100644 --- a/Gems/AWSCore/Code/CMakeLists.txt +++ b/Gems/AWSCore/Code/CMakeLists.txt @@ -163,7 +163,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) PRIVATE AZ::AzTest AZ::AzFramework - AZ::AWSNativeSDKInit + AZ::AWSNativeSDKTestLibs Gem::AWSCore.Static ) @@ -202,7 +202,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) 3rdParty::Qt::Gui 3rdParty::Qt::Widgets AZ::AzTest - AZ::AWSNativeSDKInit + AZ::AWSNativeSDKTestLibs Gem::AWSCore.Static Gem::AWSCore.Editor.Static ) diff --git a/Gems/AWSCore/Code/Tests/AWSCoreSystemComponentTest.cpp b/Gems/AWSCore/Code/Tests/AWSCoreSystemComponentTest.cpp index b66b43f735..74a1588895 100644 --- a/Gems/AWSCore/Code/Tests/AWSCoreSystemComponentTest.cpp +++ b/Gems/AWSCore/Code/Tests/AWSCoreSystemComponentTest.cpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include #include @@ -105,7 +105,7 @@ public: TEST_F(AWSCoreSystemComponentTest, ComponentActivateTest) { // Shutdown SDK which is init in fixture setup step - AWSNativeSDKInit::InitializationManager::Shutdown(); + AWSNativeSDKTestLibs::AWSNativeSDKTestManager::Shutdown(); EXPECT_FALSE(m_coreSystemsComponent->IsAWSApiInitialized()); diff --git a/Gems/AWSCore/Code/Tests/TestFramework/AWSCoreFixture.h b/Gems/AWSCore/Code/Tests/TestFramework/AWSCoreFixture.h index 6ea5593d0e..4daf5bb679 100644 --- a/Gems/AWSCore/Code/Tests/TestFramework/AWSCoreFixture.h +++ b/Gems/AWSCore/Code/Tests/TestFramework/AWSCoreFixture.h @@ -17,7 +17,7 @@ #include #include -#include +#include namespace AWSCoreTestingUtils { @@ -138,7 +138,7 @@ public: m_app = AZStd::make_unique(); } - AWSNativeSDKInit::InitializationManager::InitAwsApi(); + AWSNativeSDKTestLibs::AWSNativeSDKTestManager::Init(); } void TearDown() override @@ -148,7 +148,7 @@ public: void TearDownFixture(bool mockSettingsRegistry = true) { - AWSNativeSDKInit::InitializationManager::Shutdown(); + AWSNativeSDKTestLibs::AWSNativeSDKTestManager::Shutdown(); if (mockSettingsRegistry) { diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/CMakeLists.txt b/Gems/AWSGameLift/Code/AWSGameLiftClient/CMakeLists.txt index ab85e89f75..bdc831c439 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/CMakeLists.txt +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/CMakeLists.txt @@ -90,7 +90,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) Gem::AWSCore Gem::AWSGameLift.Client.Static 3rdParty::AWSNativeSDK::GameLiftClient - AZ::AWSNativeSDKInit + AZ::AWSNativeSDKTestLibs ) # Add AWSGameLift.Client.Tests to googletest ly_add_googletest( diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/AWSGameLiftClientFixture.h b/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/AWSGameLiftClientFixture.h index 88ddb92531..b1c689baec 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/AWSGameLiftClientFixture.h +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/AWSGameLiftClientFixture.h @@ -8,12 +8,13 @@ #pragma once -#include +#include #include #include #include #include #include +#include class AWSGameLiftClientFixture : public UnitTest::ScopedAllocatorSetupFixture @@ -38,12 +39,12 @@ public: m_jobContext.reset(aznew AZ::JobContext(*m_jobManager, *m_jobCancelGroup)); AZ::JobContext::SetGlobalContext(m_jobContext.get()); - AWSNativeSDKInit::InitializationManager::InitAwsApi(); + AWSNativeSDKTestLibs::AWSNativeSDKTestManager::Init(); } void TearDown() override { - AWSNativeSDKInit::InitializationManager::Shutdown(); + AWSNativeSDKTestLibs::AWSNativeSDKTestManager::Shutdown(); AZ::JobContext::SetGlobalContext(nullptr); m_jobContext.reset(); From b61238e50c0e7c9dc0c44e757be657a82881903a Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Wed, 19 Jan 2022 12:30:51 -0800 Subject: [PATCH 554/948] Minor fixes to whitespace and comments. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp index 8bf975fd82..f2a9efd896 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp @@ -136,8 +136,6 @@ namespace AZ } } - - template MaterialPropertyValue CastVectorMaterialPropertyValue(const MaterialPropertyValue& value) { @@ -252,8 +250,8 @@ namespace AZ else { // The material asset could be finalized sometime after the original JSON is loaded, and the material type might not have been available - // at that time, so the data type would not be known for each property. So each raw property's type could be based on what appeared in the JSON - // and this is the first opportunity we have to resolve that value with the actual type. For example, a float property could have been specified in + // at that time, so the data type would not be known for each property. So each raw property's type was based on what appeared in the JSON + // and here we have the first opportunity to resolve that value with the actual type. For example, a float property could have been specified in // the JSON as 7 instead of 7.0, which is valid. Similarly, a Color and a Vector3 can both be specified as "[0.0,0.0,0.0]" in the JSON file. MaterialPropertyValue finalValue = value; From d223513ffeb6aa3c88bdacecbcb3e2b3309084e7 Mon Sep 17 00:00:00 2001 From: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> Date: Wed, 19 Jan 2022 15:01:20 -0600 Subject: [PATCH 555/948] Updating query areas for instance count validation Signed-off-by: jckand-amzn <82226555+jckand-amzn@users.noreply.github.com> --- .../ShapeIntersectionFilter_FilterStageToggle.py | 13 +++++++------ .../largeworlds/dyn_veg/TestSuite_Main_Optimized.py | 1 - 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/ShapeIntersectionFilter_FilterStageToggle.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/ShapeIntersectionFilter_FilterStageToggle.py index 8f179f7f50..b5c00a53b7 100644 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/ShapeIntersectionFilter_FilterStageToggle.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/ShapeIntersectionFilter_FilterStageToggle.py @@ -68,7 +68,7 @@ def ShapeIntersectionFilter_FilterStageToggle(): # Create a new entity as a child of the vegetation area entity with Box Shape box = hydra.Entity("box") box.create_entity(position, ["Box Shape"]) - box.get_set_test(0, "Box Shape|Box Configuration|Dimensions", math.Vector3(8.0, 8.0, 1.0)) + box.get_set_test(0, "Box Shape|Box Configuration|Dimensions", math.Vector3(5.0, 5.0, 1.0)) # Create a new entity as a child of the vegetation area entity with Cylinder Shape. cylinder = hydra.Entity("cylinder") @@ -80,10 +80,10 @@ def ShapeIntersectionFilter_FilterStageToggle(): # On the Shape Intersection Filter component, click the crosshair button, and add child entities one by one vegetation.get_set_test(3, "Configuration|Shape Entity Id", box.id) - result = helper.wait_for_condition(lambda: dynveg.validate_instance_count(position, 8.0, 100), 2.0) + result = helper.wait_for_condition(lambda: dynveg.validate_instance_count(position, 5.0, 49), 2.0) Report.result(Tests.instance_count_in_box_shape, result) vegetation.get_set_test(3, "Configuration|Shape Entity Id", cylinder.id) - result = helper.wait_for_condition(lambda: dynveg.validate_instance_count(position, 5.0, 100), 2.0) + result = helper.wait_for_condition(lambda: dynveg.validate_instance_count(position, 5.0, 121), 2.0) Report.result(Tests.instance_count_in_cylinder_shape, result) # Create a new entity as a child of the area entity with Random Noise Gradient, Gradient Transform Modifier, @@ -98,12 +98,13 @@ def ShapeIntersectionFilter_FilterStageToggle(): # Pin the Random Noise entity to the Gradient Entity Id field of the Position Modifier's Gradient X vegetation.get_set_test(4, "Configuration|Position X|Gradient|Gradient Entity Id", random_noise.id) - # Toggle between PreProcess and PostProcess + # Toggle between PreProcess and PostProcess and validate instances. Validate in a 0.3m wider radius due to position + # offsets vegetation.get_set_test(3, "Configuration|Filter Stage", 1) - result = helper.wait_for_condition(lambda: dynveg.validate_instance_count(position, 5.0, 117), 2.0) + result = helper.wait_for_condition(lambda: dynveg.validate_instance_count(position, 5.3, 121), 2.0) Report.result(Tests.preprocess_instance_count, result) vegetation.get_set_test(3, "Configuration|Filter Stage", 2) - result = helper.wait_for_condition(lambda: dynveg.validate_instance_count(position, 5.0, 122), 2.0) + result = helper.wait_for_condition(lambda: dynveg.validate_instance_count(position, 5.3, 122), 2.0) Report.result(Tests.postprocess_instance_count, result) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Main_Optimized.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Main_Optimized.py index af1c187817..5b1e504442 100644 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Main_Optimized.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Main_Optimized.py @@ -131,7 +131,6 @@ class TestAutomation_PrefabNotEnabled(EditorTestSuite): class test_ShapeIntersectionFilter_InstancesPlantInAssignedShape(EditorParallelTest): from .EditorScripts import ShapeIntersectionFilter_InstancesPlantInAssignedShape as test_module - @pytest.mark.skip("https://github.com/o3de/o3de/issues/6973") class test_ShapeIntersectionFilter_FilterStageToggle(EditorParallelTest): from .EditorScripts import ShapeIntersectionFilter_FilterStageToggle as test_module From 3506a3975987fe1c9af8dd0ed57e89649aa49d80 Mon Sep 17 00:00:00 2001 From: Mikhail Naumov Date: Wed, 19 Jan 2022 15:01:21 -0600 Subject: [PATCH 556/948] Merge branch 'mnaumov/FixingEOOrdering' of https://github.com/aws-lumberyard-dev/o3de into mnaumov/FixingEOOrdering_signofffix Signed-off-by: Mikhail Naumov --- .../Entity/EditorEntityContextBus.h | 7 ++----- .../Entity/EditorEntityHelpers.cpp | 4 ++-- .../Entity/EditorEntityModel.cpp | 9 ++------ .../Entity/EditorEntityModel.h | 4 +--- .../Prefab/PrefabPublicHandler.cpp | 21 +++++++++++++++++-- 5 files changed, 26 insertions(+), 19 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityContextBus.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityContextBus.h index 30ffb461fa..21c87da7b8 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityContextBus.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityContextBus.h @@ -201,11 +201,8 @@ namespace AzToolsFramework //! Fired after the EditorEntityContext fails to export the root level slice to the game stream virtual void OnSaveStreamForGameFailure(AZStd::string_view /*failureString*/) {} - //! Fired when the user triggers a clone of ComponentEntity object(s), before operation begins - virtual void OnEntitiesAboutToBeCloned() {} - - //! Fires when the user triggers a clone of ComponentEntity object(s)), after operation completes - virtual void OnEntitiesCloned() {} + //! Preserve entity order when re-parenting entities + virtual void ForceAddEntitiesToBack(bool /*forceAddToBack*/) {} }; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityHelpers.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityHelpers.cpp index 3e256430a2..265924e996 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityHelpers.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityHelpers.cpp @@ -1157,7 +1157,7 @@ namespace AzToolsFramework bool CloneInstantiatedEntities(const EntityIdSet& entitiesToClone, EntityIdSet& clonedEntities) { - EditorEntityContextNotificationBus::Broadcast(&EditorEntityContextNotification::OnEntitiesAboutToBeCloned); + EditorEntityContextNotificationBus::Broadcast(&EditorEntityContextNotification::ForceAddEntitiesToBack, true); ScopedUndoBatch undoBatch("Clone Selection"); // Track the mapping of source to cloned entity. This both helps make sure that an entity is not accidentally @@ -1199,7 +1199,7 @@ namespace AzToolsFramework // Also replace the selection with the entities that have been cloned. Internal::UpdateUndoStackAndSelectClonedEntities(allEntityClonesContainer.m_entities, undoBatch); - EditorEntityContextNotificationBus::Broadcast(&EditorEntityContextNotification::OnEntitiesCloned); + EditorEntityContextNotificationBus::Broadcast(&EditorEntityContextNotification::ForceAddEntitiesToBack, false); for (const AZ::Entity* entity : allEntityClonesContainer.m_entities) { diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityModel.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityModel.cpp index e4d4f40bce..88db0b049c 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityModel.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityModel.cpp @@ -643,14 +643,9 @@ namespace AzToolsFramework } } - void EditorEntityModel::OnEntitiesAboutToBeCloned() + void EditorEntityModel::ForceAddEntitiesToBack(bool forceAddToBack) { - m_forceAddToBack = true; - } - - void EditorEntityModel::OnEntitiesCloned() - { - m_forceAddToBack = false; + m_forceAddToBack = forceAddToBack; } void EditorEntityModel::ChildEntityOrderArrayUpdated() diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityModel.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityModel.h index 45d3d4ea59..de6b598dfc 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityModel.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityModel.h @@ -94,9 +94,7 @@ namespace AzToolsFramework void OnEntityStreamLoadBegin() override; void OnEntityStreamLoadSuccess() override; void OnEntityStreamLoadFailed() override; - void OnEntitiesAboutToBeCloned() override; - void OnEntitiesCloned() override; - + void ForceAddEntitiesToBack(bool forceAddToBack) override; //////////////////////////////////////////////// // AzFramework::EntityContextEventBus::Handler diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp index aaf6141e12..99806ca239 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -83,6 +84,20 @@ namespace AzToolsFramework return AZ::Failure(findCommonRootOutcome.TakeError()); } + // order entities by their respective position within Entity Outliner + EditorEntitySortRequestBus::Event( + commonRootEntityId, + [&topLevelEntities](EditorEntitySortRequestBus::Events* sortRequests) + { + AZStd::sort( + topLevelEntities.begin(), topLevelEntities.end(), + [&sortRequests](AZ::Entity* entity1, AZ::Entity* entity2) + { + return sortRequests->GetChildEntityIndex(entity1->GetId()) < + sortRequests->GetChildEntityIndex(entity2->GetId()); + }); + }); + AZ::EntityId containerEntityId; InstanceOptionalReference instanceToCreate; @@ -153,8 +168,6 @@ namespace AzToolsFramework } // Create the Prefab - AZ_Assert(filePath.IsAbsolute(), "CreatePrefabInMemory requires an absolute file path."); - instanceToCreate = prefabEditorEntityOwnershipInterface->CreatePrefab( entities, AZStd::move(instancePtrs), m_prefabLoaderInterface->GenerateRelativePath(filePath), commonRootEntityOwningInstance); @@ -172,6 +185,7 @@ namespace AzToolsFramework // Parent the non-container top level entities to the container entity. // Parenting the top level container entities will be done during the creation of links. + EditorEntityContextNotificationBus::Broadcast(&EditorEntityContextNotification::ForceAddEntitiesToBack, true); for (AZ::Entity* topLevelEntity : topLevelEntities) { if (!IsInstanceContainerEntity(topLevelEntity->GetId())) @@ -179,6 +193,7 @@ namespace AzToolsFramework AZ::TransformBus::Event(topLevelEntity->GetId(), &AZ::TransformBus::Events::SetParent, containerEntityId); } } + EditorEntityContextNotificationBus::Broadcast(&EditorEntityContextNotification::ForceAddEntitiesToBack, false); // Update the template of the instance since the entities are modified since the template creation. Prefab::PrefabDom serializedInstance; @@ -279,6 +294,8 @@ namespace AzToolsFramework CreatePrefabResult PrefabPublicHandler::CreatePrefabInDisk(const EntityIdList& entityIds, AZ::IO::PathView filePath) { + AZ_Assert(filePath.IsAbsolute(), "CreatePrefabInDisk requires an absolute file path."); + auto result = CreatePrefabInMemory(entityIds, filePath); if (result.IsSuccess()) { From f7c120b4b7571ab790ad34bffbaddafaf4d35717 Mon Sep 17 00:00:00 2001 From: Mikhail Naumov Date: Wed, 19 Jan 2022 15:15:15 -0600 Subject: [PATCH 557/948] PR feedback Signed-off-by: Mikhail Naumov --- .../AzToolsFramework/Entity/EditorEntityContextBus.h | 2 +- .../AzToolsFramework/Entity/EditorEntityHelpers.cpp | 4 ++-- .../AzToolsFramework/Entity/EditorEntityModel.cpp | 2 +- .../AzToolsFramework/Entity/EditorEntityModel.h | 2 +- .../AzToolsFramework/Prefab/PrefabPublicHandler.cpp | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityContextBus.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityContextBus.h index 21c87da7b8..1a5ba60bdf 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityContextBus.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityContextBus.h @@ -202,7 +202,7 @@ namespace AzToolsFramework virtual void OnSaveStreamForGameFailure(AZStd::string_view /*failureString*/) {} //! Preserve entity order when re-parenting entities - virtual void ForceAddEntitiesToBack(bool /*forceAddToBack*/) {} + virtual void SetForceAddEntitiesToBackFlag(bool /*forceAddToBack*/) {} }; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityHelpers.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityHelpers.cpp index 265924e996..dc0f5e9654 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityHelpers.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityHelpers.cpp @@ -1157,7 +1157,7 @@ namespace AzToolsFramework bool CloneInstantiatedEntities(const EntityIdSet& entitiesToClone, EntityIdSet& clonedEntities) { - EditorEntityContextNotificationBus::Broadcast(&EditorEntityContextNotification::ForceAddEntitiesToBack, true); + EditorEntityContextNotificationBus::Broadcast(&EditorEntityContextNotification::SetForceAddEntitiesToBackFlag, true); ScopedUndoBatch undoBatch("Clone Selection"); // Track the mapping of source to cloned entity. This both helps make sure that an entity is not accidentally @@ -1199,7 +1199,7 @@ namespace AzToolsFramework // Also replace the selection with the entities that have been cloned. Internal::UpdateUndoStackAndSelectClonedEntities(allEntityClonesContainer.m_entities, undoBatch); - EditorEntityContextNotificationBus::Broadcast(&EditorEntityContextNotification::ForceAddEntitiesToBack, false); + EditorEntityContextNotificationBus::Broadcast(&EditorEntityContextNotification::SetForceAddEntitiesToBackFlag, false); for (const AZ::Entity* entity : allEntityClonesContainer.m_entities) { diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityModel.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityModel.cpp index 88db0b049c..adf062875e 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityModel.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityModel.cpp @@ -643,7 +643,7 @@ namespace AzToolsFramework } } - void EditorEntityModel::ForceAddEntitiesToBack(bool forceAddToBack) + void EditorEntityModel::SetForceAddEntitiesToBackFlag(bool forceAddToBack) { m_forceAddToBack = forceAddToBack; } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityModel.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityModel.h index de6b598dfc..c2574a9940 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityModel.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityModel.h @@ -94,7 +94,7 @@ namespace AzToolsFramework void OnEntityStreamLoadBegin() override; void OnEntityStreamLoadSuccess() override; void OnEntityStreamLoadFailed() override; - void ForceAddEntitiesToBack(bool forceAddToBack) override; + void SetForceAddEntitiesToBackFlag(bool forceAddToBack) override; //////////////////////////////////////////////// // AzFramework::EntityContextEventBus::Handler diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp index 99806ca239..bde5de2f64 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp @@ -185,7 +185,7 @@ namespace AzToolsFramework // Parent the non-container top level entities to the container entity. // Parenting the top level container entities will be done during the creation of links. - EditorEntityContextNotificationBus::Broadcast(&EditorEntityContextNotification::ForceAddEntitiesToBack, true); + EditorEntityContextNotificationBus::Broadcast(&EditorEntityContextNotification::SetForceAddEntitiesToBackFlag, true); for (AZ::Entity* topLevelEntity : topLevelEntities) { if (!IsInstanceContainerEntity(topLevelEntity->GetId())) @@ -193,7 +193,7 @@ namespace AzToolsFramework AZ::TransformBus::Event(topLevelEntity->GetId(), &AZ::TransformBus::Events::SetParent, containerEntityId); } } - EditorEntityContextNotificationBus::Broadcast(&EditorEntityContextNotification::ForceAddEntitiesToBack, false); + EditorEntityContextNotificationBus::Broadcast(&EditorEntityContextNotification::SetForceAddEntitiesToBackFlag, false); // Update the template of the instance since the entities are modified since the template creation. Prefab::PrefabDom serializedInstance; From b6b8b464d0e2ad9f5edb4b568fe5ff2c1f5f7689 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Wed, 19 Jan 2022 16:53:59 -0600 Subject: [PATCH 558/948] Use AZStd::array instead of AZStd::vector when retrieving a single pixel Signed-off-by: Chris Galvan --- .../Source/RPI.Reflect/Image/StreamingImageAsset.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index 80fabc9230..3d810c4c8f 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -241,19 +241,12 @@ namespace AZ template T StreamingImageAsset::GetSubImagePixelValueInternal(uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) { - AZStd::vector values; - values.resize(1); + AZStd::array values = { aznumeric_cast(0) }; auto position = AZStd::make_pair(x, y); - GetSubImagePixelValues(position, position, values, componentIndex, mip, slice); - if (values.size() == 1) - { - return values[0]; - } - - return aznumeric_cast(0); + return values[0]; } template<> From 2b43ad8029f53acd9edee4b49adfafdf9b2e0a01 Mon Sep 17 00:00:00 2001 From: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> Date: Wed, 19 Jan 2022 17:10:37 -0600 Subject: [PATCH 559/948] FastNoise GetValues() specialization (#7009) * Add comparison operator for use from unit tests. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * First version of FastNoise benchmarks. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Simplified unit tests and added initial benchmarks. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Add GetValue vs GetValues unit test. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Moved Gradient test code into helper files for use from FastNoise. Also added benchmarks for each type of FastNoise so that we can have some comparative values handy. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Specialization for GetValues(). Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> --- Gems/FastNoise/Code/CMakeLists.txt | 46 ++-- .../Source/FastNoiseGradientComponent.cpp | 46 +++- .../Code/Source/FastNoiseGradientComponent.h | 3 + .../Code/Tests/FastNoiseBenchmarks.cpp | 116 +++++++++ .../Code/Tests/FastNoiseEditorTest.cpp | 44 ++++ Gems/FastNoise/Code/Tests/FastNoiseTest.cpp | 246 ++++-------------- Gems/FastNoise/Code/Tests/FastNoiseTest.h | 60 +++++ .../Code/fastnoise_editor_tests_files.cmake | 13 + .../Code/fastnoise_tests_files.cmake | 1 + .../Code/Tests/GradientSignalBenchmarks.cpp | 211 ++------------- .../Tests/GradientSignalGetValuesTests.cpp | 76 ++---- .../Code/Tests/GradientSignalTestHelpers.cpp | 203 +++++++++++++++ .../Code/Tests/GradientSignalTestHelpers.h | 76 ++++++ .../gradientsignal_shared_tests_files.cmake | 2 + 14 files changed, 668 insertions(+), 475 deletions(-) create mode 100644 Gems/FastNoise/Code/Tests/FastNoiseBenchmarks.cpp create mode 100644 Gems/FastNoise/Code/Tests/FastNoiseEditorTest.cpp create mode 100644 Gems/FastNoise/Code/Tests/FastNoiseTest.h create mode 100644 Gems/FastNoise/Code/fastnoise_editor_tests_files.cmake create mode 100644 Gems/GradientSignal/Code/Tests/GradientSignalTestHelpers.cpp create mode 100644 Gems/GradientSignal/Code/Tests/GradientSignalTestHelpers.h diff --git a/Gems/FastNoise/Code/CMakeLists.txt b/Gems/FastNoise/Code/CMakeLists.txt index 819592e018..d945db1665 100644 --- a/Gems/FastNoise/Code/CMakeLists.txt +++ b/Gems/FastNoise/Code/CMakeLists.txt @@ -104,7 +104,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) NAME FastNoise.Editor.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} NAMESPACE Gem FILES_CMAKE - fastnoise_tests_files.cmake + fastnoise_editor_tests_files.cmake COMPILE_DEFINITIONS PUBLIC FASTNOISE_EDITOR @@ -120,23 +120,31 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) ly_add_googletest( NAME Gem::FastNoise.Editor.Tests ) - else() - ly_add_target( - NAME FastNoise.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} - NAMESPACE Gem - FILES_CMAKE - fastnoise_tests_files.cmake - INCLUDE_DIRECTORIES - PRIVATE - Tests - BUILD_DEPENDENCIES - PRIVATE - AZ::AzTest - Gem::FastNoise.Static - Gem::LmbrCentral - ) - ly_add_googletest( - NAME Gem::FastNoise.Tests - ) endif() + + ly_add_target( + NAME FastNoise.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} + NAMESPACE Gem + FILES_CMAKE + fastnoise_tests_files.cmake + INCLUDE_DIRECTORIES + PRIVATE + Tests + BUILD_DEPENDENCIES + PRIVATE + AZ::AzTest + Gem::FastNoise.Static + Gem::GradientSignal + Gem::GradientSignal.Tests.Static + Gem::LmbrCentral + ) + ly_add_googletest( + NAME Gem::FastNoise.Tests + ) + + ly_add_googlebenchmark( + NAME Gem::FastNoise.Benchmarks + TARGET Gem::FastNoise.Tests + ) + endif() diff --git a/Gems/FastNoise/Code/Source/FastNoiseGradientComponent.cpp b/Gems/FastNoise/Code/Source/FastNoiseGradientComponent.cpp index 4cea2efcc8..ceeafc3af6 100644 --- a/Gems/FastNoise/Code/Source/FastNoiseGradientComponent.cpp +++ b/Gems/FastNoise/Code/Source/FastNoiseGradientComponent.cpp @@ -54,6 +54,21 @@ namespace FastNoiseGem return AZ::Edit::PropertyVisibility::Hide; } + bool FastNoiseGradientConfig::operator==(const FastNoiseGradientConfig& rhs) const + { + return (m_cellularDistanceFunction == rhs.m_cellularDistanceFunction) + && (m_cellularJitter == rhs.m_cellularJitter) + && (m_cellularReturnType == rhs.m_cellularReturnType) + && (m_fractalType == rhs.m_fractalType) + && (m_frequency == rhs.m_frequency) + && (m_gain == rhs.m_gain) + && (m_interp == rhs.m_interp) + && (m_lacunarity == rhs.m_lacunarity) + && (m_noiseType == rhs.m_noiseType) + && (m_octaves == rhs.m_octaves) + && (m_seed == rhs.m_seed); + } + void FastNoiseGradientConfig::Reflect(AZ::ReflectContext* context) { if (auto serializeContext = azrtti_cast(context)) @@ -306,7 +321,7 @@ namespace FastNoiseGem float FastNoiseGradientComponent::GetValue(const GradientSignal::GradientSampleParams& sampleParams) const { - AZ::Vector3 uvw = sampleParams.m_position; + AZ::Vector3 uvw; bool wasPointRejected = false; { @@ -314,13 +329,34 @@ namespace FastNoiseGem m_gradientTransform.TransformPositionToUVW(sampleParams.m_position, uvw, wasPointRejected); } - if (!wasPointRejected) + // Generator returns a range between [-1, 1], map that to [0, 1] + return wasPointRejected ? + 0.0f : + AZ::GetClamp((m_generator.GetNoise(uvw.GetX(), uvw.GetY(), uvw.GetZ()) + 1.0f) / 2.0f, 0.0f, 1.0f); + } + + void FastNoiseGradientComponent::GetValues(AZStd::span positions, AZStd::span outValues) const + { + if (positions.size() != outValues.size()) { - // Generator returns a range between [-1, 1], map that to [0, 1] - return AZ::GetClamp((m_generator.GetNoise(uvw.GetX(), uvw.GetY(), uvw.GetZ()) + 1.0f) / 2.0f, 0.0f, 1.0f); + AZ_Assert(false, "input and output lists are different sizes (%zu vs %zu).", positions.size(), outValues.size()); + return; } - return 0.0f; + AZStd::shared_lock lock(m_transformMutex); + AZ::Vector3 uvw; + + for (size_t index = 0; index < positions.size(); index++) + { + bool wasPointRejected = false; + + m_gradientTransform.TransformPositionToUVW(positions[index], uvw, wasPointRejected); + + // Generator returns a range between [-1, 1], map that to [0, 1] + outValues[index] = wasPointRejected ? + 0.0f : + AZ::GetClamp((m_generator.GetNoise(uvw.GetX(), uvw.GetY(), uvw.GetZ()) + 1.0f) / 2.0f, 0.0f, 1.0f); + } } template diff --git a/Gems/FastNoise/Code/Source/FastNoiseGradientComponent.h b/Gems/FastNoise/Code/Source/FastNoiseGradientComponent.h index dd19049ee6..29c42bfe1b 100644 --- a/Gems/FastNoise/Code/Source/FastNoiseGradientComponent.h +++ b/Gems/FastNoise/Code/Source/FastNoiseGradientComponent.h @@ -47,6 +47,8 @@ namespace FastNoiseGem AZ::u32 GetFrequencyParameterVisbility() const; AZ::u32 GetInterpParameterVisibility() const; + bool operator==(const FastNoiseGradientConfig& rhs) const; + int m_seed = 1; float m_frequency = 1.f; FastNoise::Interp m_interp = FastNoise::Interp::Quintic; @@ -90,6 +92,7 @@ namespace FastNoiseGem // GradientRequestBus overrides... float GetValue(const GradientSignal::GradientSampleParams& sampleParams) const override; + void GetValues(AZStd::span positions, AZStd::span outValues) const override; protected: FastNoiseGradientConfig m_configuration; diff --git a/Gems/FastNoise/Code/Tests/FastNoiseBenchmarks.cpp b/Gems/FastNoise/Code/Tests/FastNoiseBenchmarks.cpp new file mode 100644 index 0000000000..1e438db112 --- /dev/null +++ b/Gems/FastNoise/Code/Tests/FastNoiseBenchmarks.cpp @@ -0,0 +1,116 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#ifdef HAVE_BENCHMARK + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace UnitTest +{ + class FastNoiseGetValues + : public ::benchmark::Fixture + { + public: + void RunGetValueOrGetValuesBenchmark(benchmark::State& state, FastNoise::NoiseType noiseType) + { + AZ::Entity* noiseEntity = aznew AZ::Entity("noise_entity"); + ASSERT_TRUE(noiseEntity != nullptr); + noiseEntity->CreateComponent(); + noiseEntity->CreateComponent(LmbrCentral::BoxShapeComponentTypeId); + noiseEntity->CreateComponent(); + + // Set up a FastNoise component with the requested noise type + FastNoiseGem::FastNoiseGradientConfig cfg; + cfg.m_frequency = 0.01f; + cfg.m_noiseType = noiseType; + noiseEntity->CreateComponent(cfg); + + noiseEntity->Init(); + noiseEntity->Activate(); + + UnitTest::GradientSignalTestHelpers::RunGetValueOrGetValuesBenchmark(state, noiseEntity->GetId()); + } + + }; + + BENCHMARK_DEFINE_F(FastNoiseGetValues, BM_FastNoiseGradient_Value)(benchmark::State& state) + { + RunGetValueOrGetValuesBenchmark(state, FastNoise::NoiseType::Value); + } + + BENCHMARK_DEFINE_F(FastNoiseGetValues, BM_FastNoiseGradient_ValueFractal)(benchmark::State& state) + { + RunGetValueOrGetValuesBenchmark(state, FastNoise::NoiseType::ValueFractal); + } + + BENCHMARK_DEFINE_F(FastNoiseGetValues, BM_FastNoiseGradient_Perlin)(benchmark::State& state) + { + RunGetValueOrGetValuesBenchmark(state, FastNoise::NoiseType::Perlin); + } + + BENCHMARK_DEFINE_F(FastNoiseGetValues, BM_FastNoiseGradient_PerlinFractal)(benchmark::State& state) + { + RunGetValueOrGetValuesBenchmark(state, FastNoise::NoiseType::PerlinFractal); + } + + BENCHMARK_DEFINE_F(FastNoiseGetValues, BM_FastNoiseGradient_Simplex)(benchmark::State& state) + { + RunGetValueOrGetValuesBenchmark(state, FastNoise::NoiseType::Simplex); + } + + BENCHMARK_DEFINE_F(FastNoiseGetValues, BM_FastNoiseGradient_SimplexFractal)(benchmark::State& state) + { + RunGetValueOrGetValuesBenchmark(state, FastNoise::NoiseType::SimplexFractal); + } + + BENCHMARK_DEFINE_F(FastNoiseGetValues, BM_FastNoiseGradient_Cellular)(benchmark::State& state) + { + RunGetValueOrGetValuesBenchmark(state, FastNoise::NoiseType::Cellular); + } + + BENCHMARK_DEFINE_F(FastNoiseGetValues, BM_FastNoiseGradient_WhiteNoise)(benchmark::State& state) + { + RunGetValueOrGetValuesBenchmark(state, FastNoise::NoiseType::WhiteNoise); + } + + BENCHMARK_DEFINE_F(FastNoiseGetValues, BM_FastNoiseGradient_Cubic)(benchmark::State& state) + { + RunGetValueOrGetValuesBenchmark(state, FastNoise::NoiseType::Cubic); + } + + BENCHMARK_DEFINE_F(FastNoiseGetValues, BM_FastNoiseGradient_CubicFractal)(benchmark::State& state) + { + RunGetValueOrGetValuesBenchmark(state, FastNoise::NoiseType::CubicFractal); + } + + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(FastNoiseGetValues, BM_FastNoiseGradient_Value); + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(FastNoiseGetValues, BM_FastNoiseGradient_ValueFractal); + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(FastNoiseGetValues, BM_FastNoiseGradient_Perlin); + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(FastNoiseGetValues, BM_FastNoiseGradient_PerlinFractal); + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(FastNoiseGetValues, BM_FastNoiseGradient_Simplex); + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(FastNoiseGetValues, BM_FastNoiseGradient_SimplexFractal); + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(FastNoiseGetValues, BM_FastNoiseGradient_Cellular); + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(FastNoiseGetValues, BM_FastNoiseGradient_WhiteNoise); + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(FastNoiseGetValues, BM_FastNoiseGradient_Cubic); + GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(FastNoiseGetValues, BM_FastNoiseGradient_CubicFractal); + +#endif +} + + + diff --git a/Gems/FastNoise/Code/Tests/FastNoiseEditorTest.cpp b/Gems/FastNoise/Code/Tests/FastNoiseEditorTest.cpp new file mode 100644 index 0000000000..e30c6c01e0 --- /dev/null +++ b/Gems/FastNoise/Code/Tests/FastNoiseEditorTest.cpp @@ -0,0 +1,44 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * 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 + + +class FastNoiseEditorTestApp : public ::testing::Test +{ +}; + +TEST_F(FastNoiseEditorTestApp, FastNoise_EditorCreateGameEntity) +{ + AZStd::unique_ptr noiseEntity(aznew AZ::Entity("editor_noise_entity")); + ASSERT_TRUE(noiseEntity != nullptr); + + FastNoiseGem::EditorFastNoiseGradientComponent editor; + auto* editorBase = static_cast(&editor); + editorBase->BuildGameEntity(noiseEntity.get()); + + // the new game entity's FastNoise component should look like the default one + FastNoiseGem::FastNoiseGradientConfig defaultConfig; + FastNoiseGem::FastNoiseGradientConfig gameComponentConfig; + + FastNoiseGem::FastNoiseGradientComponent* noiseComp = noiseEntity->FindComponent(); + ASSERT_TRUE(noiseComp != nullptr); + + // Change a value in the gameComponentConfig just to verify that it got overwritten instead of simply matching the default. + gameComponentConfig.m_seed++; + noiseComp->WriteOutConfig(&gameComponentConfig); + ASSERT_EQ(defaultConfig, gameComponentConfig); +} + +// This uses custom test / benchmark hooks so that we can load LmbrCentral and GradientSignal Gems. +AZ_UNIT_TEST_HOOK(new UnitTest::FastNoiseTestEnvironment, UnitTest::FastNoiseBenchmarkEnvironment); diff --git a/Gems/FastNoise/Code/Tests/FastNoiseTest.cpp b/Gems/FastNoise/Code/Tests/FastNoiseTest.cpp index f0d5a9d1bd..1ac5e8ddca 100644 --- a/Gems/FastNoise/Code/Tests/FastNoiseTest.cpp +++ b/Gems/FastNoise/Code/Tests/FastNoiseTest.cpp @@ -10,199 +10,61 @@ #include #include -#include -#include -#include #include +#include #include -#include -#include +#include #include -#include +#include +#include +#include #include #include #include +#include +#include -class MockGradientTransformComponent - : public AZ::Component - , private GradientSignal::GradientTransformRequestBus::Handler - , private GradientSignal::GradientTransformModifierRequestBus::Handler +class FastNoiseTest : public ::testing::Test { -public: - AZ_COMPONENT(MockGradientTransformComponent, "{464CF47B-7E10-4E1B-BD06-79BD2AC91399}"); - - static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& services) - { - services.push_back(AZ_CRC("GradientTransformService", 0x8c8c5ecc)); - } - static void Reflect([[maybe_unused]] AZ::ReflectContext* context) {} - - MockGradientTransformComponent() = default; - ~MockGradientTransformComponent() = default; - - // AZ::Component interface - void Activate() override {} - void Deactivate() override {} - - //////////////////////////////////////////////////////////////////////////// - //// GradientTransformRequestBus - const GradientSignal::GradientTransform& GetGradientTransform() const override - { - return m_gradientTransform; - } - - ////////////////////////////////////////////////////////////////////////// - // GradientTransformModifierRequestBus - bool GetAllowReference() const override { return false; } - void SetAllowReference([[maybe_unused]] bool value) override {} - - AZ::EntityId GetShapeReference() const override { return AZ::EntityId(); } - void SetShapeReference([[maybe_unused]] AZ::EntityId shapeReference) override {} - - bool GetOverrideBounds() const override { return false; } - void SetOverrideBounds([[maybe_unused]] bool value) override {} - - AZ::Vector3 GetBounds() const override { return AZ::Vector3(); } - void SetBounds([[maybe_unused]] AZ::Vector3 bounds) override {} - - GradientSignal::TransformType GetTransformType() const override { return static_cast(0); } - void SetTransformType([[maybe_unused]] GradientSignal::TransformType type) override {} - - bool GetOverrideTranslate() const override { return false; } - void SetOverrideTranslate([[maybe_unused]] bool value) override {} - - AZ::Vector3 GetTranslate() const override { return AZ::Vector3(); } - void SetTranslate([[maybe_unused]] AZ::Vector3 translate) override {} - - bool GetOverrideRotate() const override { return false; } - void SetOverrideRotate([[maybe_unused]] bool value) override {} - - AZ::Vector3 GetRotate() const override { return AZ::Vector3(); } - void SetRotate([[maybe_unused]] AZ::Vector3 rotate) override {} - - bool GetOverrideScale() const override { return false; } - void SetOverrideScale([[maybe_unused]] bool value) override {} - - AZ::Vector3 GetScale() const override { return AZ::Vector3(); } - void SetScale([[maybe_unused]] AZ::Vector3 scale) override {} - - float GetFrequencyZoom() const override { return false; } - void SetFrequencyZoom([[maybe_unused]] float frequencyZoom) override {} - - GradientSignal::WrappingType GetWrappingType() const override { return static_cast(0); } - void SetWrappingType([[maybe_unused]] GradientSignal::WrappingType type) override {} - - bool GetIs3D() const override { return false; } - void SetIs3D([[maybe_unused]] bool value) override {} - - bool GetAdvancedMode() const override { return false; } - void SetAdvancedMode([[maybe_unused]] bool value) override {} - - GradientSignal::GradientTransform m_gradientTransform; }; -TEST(FastNoiseTest, ComponentsWithComponentApplication) +TEST_F(FastNoiseTest, FastNoise_ComponentCreatesSuccessfully) { - AZ::ComponentApplication::Descriptor appDesc; - appDesc.m_memoryBlocksByteSize = 10 * 1024 * 1024; - appDesc.m_recordingMode = AZ::Debug::AllocationRecords::RECORD_FULL; - appDesc.m_stackRecordLevels = 20; - - AZ::ComponentApplication app; - AZ::Entity* systemEntity = app.Create(appDesc); - ASSERT_TRUE(systemEntity != nullptr); - app.RegisterComponentDescriptor(FastNoiseGem::FastNoiseSystemComponent::CreateDescriptor()); - systemEntity->CreateComponent(); - - systemEntity->Init(); - systemEntity->Activate(); - - AZ::Entity* noiseEntity = aznew AZ::Entity("fastnoise_entity"); + AZ::Entity* noiseEntity = aznew AZ::Entity("noise_entity"); + ASSERT_TRUE(noiseEntity != nullptr); noiseEntity->CreateComponent(); - app.AddEntity(noiseEntity); - app.Destroy(); - ASSERT_TRUE(true); + FastNoiseGem::FastNoiseGradientComponent* noiseComp = noiseEntity->FindComponent(); + ASSERT_TRUE(noiseComp != nullptr); } -class FastNoiseTestApp - : public ::testing::Test -{ -public: - FastNoiseTestApp() - : m_application() - , m_systemEntity(nullptr) - { - } - - void SetUp() override - { - AZ::ComponentApplication::Descriptor appDesc; - appDesc.m_memoryBlocksByteSize = 10 * 1024 * 1024; - appDesc.m_recordingMode = AZ::Debug::AllocationRecords::RECORD_FULL; - appDesc.m_stackRecordLevels = 20; - - AZ::ComponentApplication::StartupParameters appStartup; - appStartup.m_createStaticModulesCallback = - [](AZStd::vector& modules) - { - modules.emplace_back(new FastNoiseGem::FastNoiseModule); - }; - - m_systemEntity = m_application.Create(appDesc, appStartup); - m_application.RegisterComponentDescriptor(MockGradientTransformComponent::CreateDescriptor()); - m_systemEntity->Init(); - m_systemEntity->Activate(); - } - - void TearDown() override - { - m_application.Destroy(); - } - - AZ::ComponentApplication m_application; - AZ::Entity* m_systemEntity; -}; - -////////////////////////////////////////////////////////////////////////// -// testing class to inspect protected data members in the FastNoiseGradientComponent -struct FastNoiseGradientComponentTester : public FastNoiseGem::FastNoiseGradientComponent -{ - const FastNoiseGem::FastNoiseGradientConfig& GetConfig() const { return m_configuration; } - - void AssertTrue(const FastNoiseGem::FastNoiseGradientConfig& cfg) - { - ASSERT_TRUE(m_configuration.m_cellularDistanceFunction == cfg.m_cellularDistanceFunction); - ASSERT_TRUE(m_configuration.m_cellularJitter == cfg.m_cellularJitter); - ASSERT_TRUE(m_configuration.m_cellularReturnType == cfg.m_cellularReturnType); - ASSERT_TRUE(m_configuration.m_fractalType == cfg.m_fractalType); - ASSERT_TRUE(m_configuration.m_frequency == cfg.m_frequency); - ASSERT_TRUE(m_configuration.m_gain == cfg.m_gain); - ASSERT_TRUE(m_configuration.m_interp == cfg.m_interp); - ASSERT_TRUE(m_configuration.m_lacunarity == cfg.m_lacunarity); - ASSERT_TRUE(m_configuration.m_noiseType == cfg.m_noiseType); - ASSERT_TRUE(m_configuration.m_octaves == cfg.m_octaves); - ASSERT_TRUE(m_configuration.m_seed == cfg.m_seed); - } -}; - -TEST_F(FastNoiseTestApp, FastNoise_Component) +TEST_F(FastNoiseTest, FastNoise_ComponentMatchesConfiguration) { AZ::Entity* noiseEntity = aznew AZ::Entity("noise_entity"); ASSERT_TRUE(noiseEntity != nullptr); - noiseEntity->CreateComponent(); - m_application.AddEntity(noiseEntity); + + FastNoiseGem::FastNoiseGradientConfig cfg; + FastNoiseGem::FastNoiseGradientConfig componentConfig; + + noiseEntity->CreateComponent(); + noiseEntity->CreateComponent(LmbrCentral::BoxShapeComponentTypeId); + noiseEntity->CreateComponent(); + noiseEntity->CreateComponent(cfg); FastNoiseGem::FastNoiseGradientComponent* noiseComp = noiseEntity->FindComponent(); ASSERT_TRUE(noiseComp != nullptr); + noiseComp->WriteOutConfig(&componentConfig); + ASSERT_EQ(cfg, componentConfig); } -TEST_F(FastNoiseTestApp, FastNoise_ComponentEbus) +TEST_F(FastNoiseTest, FastNoise_ComponentEbusWorksSuccessfully) { AZ::Entity* noiseEntity = aznew AZ::Entity("noise_entity"); ASSERT_TRUE(noiseEntity != nullptr); + noiseEntity->CreateComponent(); + noiseEntity->CreateComponent(LmbrCentral::BoxShapeComponentTypeId); + noiseEntity->CreateComponent(); noiseEntity->CreateComponent(); - noiseEntity->CreateComponent(); noiseEntity->Init(); noiseEntity->Activate(); @@ -210,51 +72,39 @@ TEST_F(FastNoiseTestApp, FastNoise_ComponentEbus) GradientSignal::GradientSampleParams params; float sample = -1.0f; - GradientSignal::GradientRequestBus::EventResult(sample, noiseEntity->GetId(), &GradientSignal::GradientRequestBus::Events::GetValue, params); + GradientSignal::GradientRequestBus::EventResult(sample, noiseEntity->GetId(), + &GradientSignal::GradientRequestBus::Events::GetValue, params); ASSERT_TRUE(sample >= 0.0f); ASSERT_TRUE(sample <= 1.0f); } -TEST_F(FastNoiseTestApp, FastNoise_ComponentMatchesConfiguration) +TEST_F(FastNoiseTest, FastNoise_VerifyGetValueAndGetValuesMatch) { + const float shapeHalfBounds = 128.0f; + AZ::Entity* noiseEntity = aznew AZ::Entity("noise_entity"); ASSERT_TRUE(noiseEntity != nullptr); + noiseEntity->CreateComponent(); + noiseEntity->CreateComponent(); - AZ::SimpleLcgRandom rand(AZStd::GetTimeNowMicroSecond()); + // Create a Box Shape to map our gradient into + LmbrCentral::BoxShapeConfig boxConfig(AZ::Vector3(shapeHalfBounds * 2.0f)); + auto boxComponent = noiseEntity->CreateComponent(LmbrCentral::BoxShapeComponentTypeId); + boxComponent->SetConfiguration(boxConfig); + // Create a Fast Noise component with an adjusted frequency. (The defaults of Perlin noise with frequency=1.0 would cause us + // to always get back the same noise value) FastNoiseGem::FastNoiseGradientConfig cfg; - + cfg.m_frequency = 0.01f; noiseEntity->CreateComponent(cfg); - noiseEntity->CreateComponent(); - - m_application.AddEntity(noiseEntity); - FastNoiseGem::FastNoiseGradientComponent* noiseComp = noiseEntity->FindComponent(); - ASSERT_TRUE(noiseComp != nullptr); - reinterpret_cast(noiseComp)->AssertTrue(cfg); -} - -#if FASTNOISE_EDITOR -#include - -TEST_F(FastNoiseTestApp, FastNoise_EditorCreateGameEntity) -{ - AZStd::unique_ptr noiseEntity(aznew AZ::Entity("editor_noise_entity")); - ASSERT_TRUE(noiseEntity != nullptr); - - FastNoiseGem::EditorFastNoiseGradientComponent editor; - auto* editorBase = static_cast(&editor); - editorBase->BuildGameEntity(noiseEntity.get()); - - // the new game entity's ocean component should look like the default one - FastNoiseGem::FastNoiseGradientConfig cfg; + noiseEntity->Init(); + noiseEntity->Activate(); - FastNoiseGem::FastNoiseGradientComponent* noiseComp = noiseEntity->FindComponent(); - ASSERT_TRUE(noiseComp != nullptr); - reinterpret_cast(noiseComp)->AssertTrue(cfg); + // Create a gradient sampler and run through a series of points to see if they match expectations. + UnitTest::GradientSignalTestHelpers::CompareGetValueAndGetValues(noiseEntity->GetId(), shapeHalfBounds); } -#endif - -AZ_UNIT_TEST_HOOK(DEFAULT_UNIT_TEST_ENV); +// This uses custom test / benchmark hooks so that we can load LmbrCentral and GradientSignal Gems. +AZ_UNIT_TEST_HOOK(new UnitTest::FastNoiseTestEnvironment, UnitTest::FastNoiseBenchmarkEnvironment); diff --git a/Gems/FastNoise/Code/Tests/FastNoiseTest.h b/Gems/FastNoise/Code/Tests/FastNoiseTest.h new file mode 100644 index 0000000000..71b10cfc68 --- /dev/null +++ b/Gems/FastNoise/Code/Tests/FastNoiseTest.h @@ -0,0 +1,60 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ +#pragma once + +#include +#include +#include +#include + +namespace UnitTest +{ + // The FastNoise unit tests need to use the GemTestEnvironment to load the GradientSignal and LmbrCentral Gems so that + // GradientTransform components can be used in the unit tests and benchmarks. + class FastNoiseTestEnvironment + : public AZ::Test::GemTestEnvironment + { + public: + void AddGemsAndComponents() override + { + AddDynamicModulePaths({ "GradientSignal" }); + AddDynamicModulePaths({ "LmbrCentral" }); + + AddComponentDescriptors({ + AzFramework::TransformComponent::CreateDescriptor(), + FastNoiseGem::FastNoiseSystemComponent::CreateDescriptor(), + FastNoiseGem::FastNoiseGradientComponent::CreateDescriptor() + }); + + AddRequiredComponents({ FastNoiseGem::FastNoiseSystemComponent::TYPEINFO_Uuid() }); + } + }; + +#ifdef HAVE_BENCHMARK + //! The Benchmark environment is used for one time setup and tear down of shared resources + class FastNoiseBenchmarkEnvironment + : public AZ::Test::BenchmarkEnvironmentBase + , public FastNoiseTestEnvironment + + { + protected: + void SetUpBenchmark() override + { + SetupEnvironment(); + } + + void TearDownBenchmark() override + { + TeardownEnvironment(); + } + }; +#endif + + +} // namespace UnitTest + diff --git a/Gems/FastNoise/Code/fastnoise_editor_tests_files.cmake b/Gems/FastNoise/Code/fastnoise_editor_tests_files.cmake new file mode 100644 index 0000000000..685e2fb647 --- /dev/null +++ b/Gems/FastNoise/Code/fastnoise_editor_tests_files.cmake @@ -0,0 +1,13 @@ +# +# Copyright (c) Contributors to the Open 3D Engine Project. +# For complete copyright and license terms please see the LICENSE at the root of this distribution. +# +# SPDX-License-Identifier: Apache-2.0 OR MIT +# +# + +set(FILES + Tests/FastNoiseEditorTest.cpp + Source/FastNoiseModule.h + Source/FastNoiseModule.cpp +) diff --git a/Gems/FastNoise/Code/fastnoise_tests_files.cmake b/Gems/FastNoise/Code/fastnoise_tests_files.cmake index 08386940f2..4669b0d446 100644 --- a/Gems/FastNoise/Code/fastnoise_tests_files.cmake +++ b/Gems/FastNoise/Code/fastnoise_tests_files.cmake @@ -7,6 +7,7 @@ # set(FILES + Tests/FastNoiseBenchmarks.cpp Tests/FastNoiseTest.cpp Source/FastNoiseModule.h Source/FastNoiseModule.cpp diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalBenchmarks.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalBenchmarks.cpp index bd4ccf5205..6ffb4a31c4 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalBenchmarks.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalBenchmarks.cpp @@ -9,6 +9,7 @@ #ifdef HAVE_BENCHMARK #include +#include #include #include @@ -21,220 +22,42 @@ namespace UnitTest class GradientGetValues : public GradientSignalBenchmarkFixture { public: - // We use an enum to list out the different types of GetValue() benchmarks to run so that way we can condense our test cases - // to just take the value in as a benchmark argument and switch on it. Otherwise, we would need to write a different benchmark - // function for each test case for each gradient. - enum GetValuePermutation : int64_t - { - EBUS_GET_VALUE, - EBUS_GET_VALUES, - SAMPLER_GET_VALUE, - SAMPLER_GET_VALUES, - }; - // Create an arbitrary size shape for creating our gradients for benchmark runs. const float TestShapeHalfBounds = 128.0f; - - void FillQueryPositions(AZStd::vector& positions, float height, float width) - { - size_t index = 0; - for (float y = 0.0f; y < height; y += 1.0f) - { - for (float x = 0.0f; x < width; x += 1.0f) - { - positions[index++] = AZ::Vector3(x, y, 0.0f); - } - } - } - - void RunEBusGetValueBenchmark(benchmark::State& state, const AZ::EntityId& gradientId, int64_t queryRange) - { - AZ_PROFILE_FUNCTION(Entity); - - GradientSignal::GradientSampleParams params; - - // Get the height and width ranges for querying from our benchmark parameters - const float height = aznumeric_cast(queryRange); - const float width = aznumeric_cast(queryRange); - - // Call GetValue() on the EBus for every height and width in our ranges. - for (auto _ : state) - { - for (float y = 0.0f; y < height; y += 1.0f) - { - for (float x = 0.0f; x < width; x += 1.0f) - { - float value = 0.0f; - params.m_position = AZ::Vector3(x, y, 0.0f); - GradientSignal::GradientRequestBus::EventResult( - value, gradientId, &GradientSignal::GradientRequestBus::Events::GetValue, params); - benchmark::DoNotOptimize(value); - } - } - } - } - - void RunEBusGetValuesBenchmark(benchmark::State& state, const AZ::EntityId& gradientId, int64_t queryRange) - { - AZ_PROFILE_FUNCTION(Entity); - - // Get the height and width ranges for querying from our benchmark parameters - float height = aznumeric_cast(queryRange); - float width = aznumeric_cast(queryRange); - int64_t totalQueryPoints = queryRange * queryRange; - - // Call GetValues() for every height and width in our ranges. - for (auto _ : state) - { - // Set up our vector of query positions. This is done inside the benchmark timing since we're counting the work to create - // each query position in the single GetValue() call benchmarks, and will make the timing more directly comparable. - AZStd::vector positions(totalQueryPoints); - FillQueryPositions(positions, height, width); - - // Query and get the results. - AZStd::vector results(totalQueryPoints); - GradientSignal::GradientRequestBus::Event( - gradientId, &GradientSignal::GradientRequestBus::Events::GetValues, positions, results); - } - } - - void RunSamplerGetValueBenchmark(benchmark::State& state, const AZ::EntityId& gradientId, int64_t queryRange) - { - AZ_PROFILE_FUNCTION(Entity); - - // Create a gradient sampler to use for querying our gradient. - GradientSignal::GradientSampler gradientSampler; - gradientSampler.m_gradientId = gradientId; - - // Get the height and width ranges for querying from our benchmark parameters - const float height = aznumeric_cast(queryRange); - const float width = aznumeric_cast(queryRange); - - // Call GetValue() through the GradientSampler for every height and width in our ranges. - for (auto _ : state) - { - for (float y = 0.0f; y < height; y += 1.0f) - { - for (float x = 0.0f; x < width; x += 1.0f) - { - GradientSignal::GradientSampleParams params; - params.m_position = AZ::Vector3(x, y, 0.0f); - float value = gradientSampler.GetValue(params); - benchmark::DoNotOptimize(value); - } - } - } - } - - void RunSamplerGetValuesBenchmark(benchmark::State& state, const AZ::EntityId& gradientId, int64_t queryRange) - { - AZ_PROFILE_FUNCTION(Entity); - - // Create a gradient sampler to use for querying our gradient. - GradientSignal::GradientSampler gradientSampler; - gradientSampler.m_gradientId = gradientId; - - // Get the height and width ranges for querying from our benchmark parameters - const float height = aznumeric_cast(queryRange); - const float width = aznumeric_cast(queryRange); - const int64_t totalQueryPoints = queryRange * queryRange; - - // Call GetValues() through the GradientSampler for every height and width in our ranges. - for (auto _ : state) - { - // Set up our vector of query positions. This is done inside the benchmark timing since we're counting the work to create - // each query position in the single GetValue() call benchmarks, and will make the timing more directly comparable. - AZStd::vector positions(totalQueryPoints); - FillQueryPositions(positions, height, width); - - // Query and get the results. - AZStd::vector results(totalQueryPoints); - gradientSampler.GetValues(positions, results); - } - } - - void RunGetValueOrGetValuesBenchmark(benchmark::State& state, const AZ::EntityId& gradientId) - { - switch (state.range(0)) - { - case GetValuePermutation::EBUS_GET_VALUE: - RunEBusGetValueBenchmark(state, gradientId, state.range(1)); - break; - case GetValuePermutation::EBUS_GET_VALUES: - RunEBusGetValuesBenchmark(state, gradientId, state.range(1)); - break; - case GetValuePermutation::SAMPLER_GET_VALUE: - RunSamplerGetValueBenchmark(state, gradientId, state.range(1)); - break; - case GetValuePermutation::SAMPLER_GET_VALUES: - RunSamplerGetValuesBenchmark(state, gradientId, state.range(1)); - break; - default: - AZ_Assert(false, "Benchmark permutation type not supported."); - } - } }; -// Because there's no good way to label different enums in the output results (they just appear as integer values), we work around it by -// registering one set of benchmark runs for each enum value and use ArgNames() to give it a friendly name in the results. -#define GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(Fixture, Func) \ - BENCHMARK_REGISTER_F(Fixture, Func) \ - ->Args({ GradientGetValues::GetValuePermutation::EBUS_GET_VALUE, 1024 }) \ - ->Args({ GradientGetValues::GetValuePermutation::EBUS_GET_VALUE, 2048 }) \ - ->Args({ GradientGetValues::GetValuePermutation::EBUS_GET_VALUE, 4096 }) \ - ->ArgNames({ "EbusGetValue", "size" }) \ - ->Unit(::benchmark::kMillisecond); \ - BENCHMARK_REGISTER_F(Fixture, Func) \ - ->Args({ GradientGetValues::GetValuePermutation::EBUS_GET_VALUES, 1024 }) \ - ->Args({ GradientGetValues::GetValuePermutation::EBUS_GET_VALUES, 2048 }) \ - ->Args({ GradientGetValues::GetValuePermutation::EBUS_GET_VALUES, 4096 }) \ - ->ArgNames({ "EbusGetValues", "size" }) \ - ->Unit(::benchmark::kMillisecond); \ - BENCHMARK_REGISTER_F(Fixture, Func) \ - ->Args({ GradientGetValues::GetValuePermutation::SAMPLER_GET_VALUE, 1024 }) \ - ->Args({ GradientGetValues::GetValuePermutation::SAMPLER_GET_VALUE, 2048 }) \ - ->Args({ GradientGetValues::GetValuePermutation::SAMPLER_GET_VALUE, 4096 }) \ - ->ArgNames({ "SamplerGetValue", "size" }) \ - ->Unit(::benchmark::kMillisecond); \ - BENCHMARK_REGISTER_F(Fixture, Func) \ - ->Args({ GradientGetValues::GetValuePermutation::SAMPLER_GET_VALUES, 1024 }) \ - ->Args({ GradientGetValues::GetValuePermutation::SAMPLER_GET_VALUES, 2048 }) \ - ->Args({ GradientGetValues::GetValuePermutation::SAMPLER_GET_VALUES, 4096 }) \ - ->ArgNames({ "SamplerGetValues", "size" }) \ - ->Unit(::benchmark::kMillisecond); - // -------------------------------------------------------------------------------------- // Base Gradients BENCHMARK_DEFINE_F(GradientGetValues, BM_ConstantGradient)(benchmark::State& state) { auto entity = BuildTestConstantGradient(TestShapeHalfBounds); - RunGetValueOrGetValuesBenchmark(state, entity->GetId()); + GradientSignalTestHelpers::RunGetValueOrGetValuesBenchmark(state, entity->GetId()); } BENCHMARK_DEFINE_F(GradientGetValues, BM_ImageGradient)(benchmark::State& state) { auto entity = BuildTestImageGradient(TestShapeHalfBounds); - RunGetValueOrGetValuesBenchmark(state, entity->GetId()); + GradientSignalTestHelpers::RunGetValueOrGetValuesBenchmark(state, entity->GetId()); } BENCHMARK_DEFINE_F(GradientGetValues, BM_PerlinGradient)(benchmark::State& state) { auto entity = BuildTestPerlinGradient(TestShapeHalfBounds); - RunGetValueOrGetValuesBenchmark(state, entity->GetId()); + GradientSignalTestHelpers::RunGetValueOrGetValuesBenchmark(state, entity->GetId()); } BENCHMARK_DEFINE_F(GradientGetValues, BM_RandomGradient)(benchmark::State& state) { auto entity = BuildTestRandomGradient(TestShapeHalfBounds); - RunGetValueOrGetValuesBenchmark(state, entity->GetId()); + GradientSignalTestHelpers::RunGetValueOrGetValuesBenchmark(state, entity->GetId()); } BENCHMARK_DEFINE_F(GradientGetValues, BM_ShapeAreaFalloffGradient)(benchmark::State& state) { auto entity = BuildTestShapeAreaFalloffGradient(TestShapeHalfBounds); - RunGetValueOrGetValuesBenchmark(state, entity->GetId()); + GradientSignalTestHelpers::RunGetValueOrGetValuesBenchmark(state, entity->GetId()); } GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(GradientGetValues, BM_ConstantGradient); @@ -250,21 +73,21 @@ namespace UnitTest { auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); auto entity = BuildTestDitherGradient(TestShapeHalfBounds, baseEntity->GetId()); - RunGetValueOrGetValuesBenchmark(state, entity->GetId()); + GradientSignalTestHelpers::RunGetValueOrGetValuesBenchmark(state, entity->GetId()); } BENCHMARK_DEFINE_F(GradientGetValues, BM_InvertGradient)(benchmark::State& state) { auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); auto entity = BuildTestDitherGradient(TestShapeHalfBounds, baseEntity->GetId()); - RunGetValueOrGetValuesBenchmark(state, entity->GetId()); + GradientSignalTestHelpers::RunGetValueOrGetValuesBenchmark(state, entity->GetId()); } BENCHMARK_DEFINE_F(GradientGetValues, BM_LevelsGradient)(benchmark::State& state) { auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); auto entity = BuildTestLevelsGradient(TestShapeHalfBounds, baseEntity->GetId()); - RunGetValueOrGetValuesBenchmark(state, entity->GetId()); + GradientSignalTestHelpers::RunGetValueOrGetValuesBenchmark(state, entity->GetId()); } BENCHMARK_DEFINE_F(GradientGetValues, BM_MixedGradient)(benchmark::State& state) @@ -272,35 +95,35 @@ namespace UnitTest auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); auto mixedEntity = BuildTestConstantGradient(TestShapeHalfBounds); auto entity = BuildTestMixedGradient(TestShapeHalfBounds, baseEntity->GetId(), mixedEntity->GetId()); - RunGetValueOrGetValuesBenchmark(state, entity->GetId()); + GradientSignalTestHelpers::RunGetValueOrGetValuesBenchmark(state, entity->GetId()); } BENCHMARK_DEFINE_F(GradientGetValues, BM_PosterizeGradient)(benchmark::State& state) { auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); auto entity = BuildTestPosterizeGradient(TestShapeHalfBounds, baseEntity->GetId()); - RunGetValueOrGetValuesBenchmark(state, entity->GetId()); + GradientSignalTestHelpers::RunGetValueOrGetValuesBenchmark(state, entity->GetId()); } BENCHMARK_DEFINE_F(GradientGetValues, BM_ReferenceGradient)(benchmark::State& state) { auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); auto entity = BuildTestReferenceGradient(TestShapeHalfBounds, baseEntity->GetId()); - RunGetValueOrGetValuesBenchmark(state, entity->GetId()); + GradientSignalTestHelpers::RunGetValueOrGetValuesBenchmark(state, entity->GetId()); } BENCHMARK_DEFINE_F(GradientGetValues, BM_SmoothStepGradient)(benchmark::State& state) { auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); auto entity = BuildTestSmoothStepGradient(TestShapeHalfBounds, baseEntity->GetId()); - RunGetValueOrGetValuesBenchmark(state, entity->GetId()); + GradientSignalTestHelpers::RunGetValueOrGetValuesBenchmark(state, entity->GetId()); } BENCHMARK_DEFINE_F(GradientGetValues, BM_ThresholdGradient)(benchmark::State& state) { auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); auto entity = BuildTestThresholdGradient(TestShapeHalfBounds, baseEntity->GetId()); - RunGetValueOrGetValuesBenchmark(state, entity->GetId()); + GradientSignalTestHelpers::RunGetValueOrGetValuesBenchmark(state, entity->GetId()); } GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(GradientGetValues, BM_DitherGradient); @@ -321,7 +144,7 @@ namespace UnitTest CreateMockSurfaceDataSystem(AZ::Aabb::CreateFromMinMax(AZ::Vector3(-TestShapeHalfBounds), AZ::Vector3(TestShapeHalfBounds))); auto entity = BuildTestSurfaceAltitudeGradient(TestShapeHalfBounds); - RunGetValueOrGetValuesBenchmark(state, entity->GetId()); + GradientSignalTestHelpers::RunGetValueOrGetValuesBenchmark(state, entity->GetId()); } BENCHMARK_DEFINE_F(GradientGetValues, BM_SurfaceMaskGradient)(benchmark::State& state) @@ -330,7 +153,7 @@ namespace UnitTest CreateMockSurfaceDataSystem(AZ::Aabb::CreateFromMinMax(AZ::Vector3(-TestShapeHalfBounds), AZ::Vector3(TestShapeHalfBounds))); auto entity = BuildTestSurfaceMaskGradient(TestShapeHalfBounds); - RunGetValueOrGetValuesBenchmark(state, entity->GetId()); + GradientSignalTestHelpers::RunGetValueOrGetValuesBenchmark(state, entity->GetId()); } BENCHMARK_DEFINE_F(GradientGetValues, BM_SurfaceSlopeGradient)(benchmark::State& state) @@ -339,7 +162,7 @@ namespace UnitTest CreateMockSurfaceDataSystem(AZ::Aabb::CreateFromMinMax(AZ::Vector3(-TestShapeHalfBounds), AZ::Vector3(TestShapeHalfBounds))); auto entity = BuildTestSurfaceSlopeGradient(TestShapeHalfBounds); - RunGetValueOrGetValuesBenchmark(state, entity->GetId()); + GradientSignalTestHelpers::RunGetValueOrGetValuesBenchmark(state, entity->GetId()); } GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(GradientGetValues, BM_SurfaceAltitudeGradient); diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalGetValuesTests.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalGetValuesTests.cpp index 6c4ebcc4c0..f0ad53ee64 100644 --- a/Gems/GradientSignal/Code/Tests/GradientSignalGetValuesTests.cpp +++ b/Gems/GradientSignal/Code/Tests/GradientSignalGetValuesTests.cpp @@ -8,6 +8,7 @@ #include +#include #include namespace UnitTest @@ -18,79 +19,36 @@ namespace UnitTest // Create an arbitrary size shape for comparing values within. It should be large enough that we detect any value anomalies // but small enough that the tests run quickly. const float TestShapeHalfBounds = 128.0f; - - void CompareGetValueAndGetValues(AZ::EntityId gradientEntityId) - { - // Create a gradient sampler and run through a series of points to see if they match expectations. - - const AZ::Aabb queryRegion = AZ::Aabb::CreateFromMinMax(AZ::Vector3(-TestShapeHalfBounds), AZ::Vector3(TestShapeHalfBounds)); - const AZ::Vector2 stepSize(1.0f, 1.0f); - - GradientSignal::GradientSampler gradientSampler; - gradientSampler.m_gradientId = gradientEntityId; - - const size_t numSamplesX = aznumeric_cast(ceil(queryRegion.GetExtents().GetX() / stepSize.GetX())); - const size_t numSamplesY = aznumeric_cast(ceil(queryRegion.GetExtents().GetY() / stepSize.GetY())); - - // Build up the list of positions to query. - AZStd::vector positions(numSamplesX * numSamplesY); - size_t index = 0; - for (size_t yIndex = 0; yIndex < numSamplesY; yIndex++) - { - float y = queryRegion.GetMin().GetY() + (stepSize.GetY() * yIndex); - for (size_t xIndex = 0; xIndex < numSamplesX; xIndex++) - { - float x = queryRegion.GetMin().GetX() + (stepSize.GetX() * xIndex); - positions[index++] = AZ::Vector3(x, y, 0.0f); - } - } - - // Get the results from GetValues - AZStd::vector results(numSamplesX * numSamplesY); - gradientSampler.GetValues(positions, results); - - // For each position, call GetValue and verify that the values match. - for (size_t positionIndex = 0; positionIndex < positions.size(); positionIndex++) - { - GradientSignal::GradientSampleParams params; - params.m_position = positions[positionIndex]; - float value = gradientSampler.GetValue(params); - - // We use ASSERT_NEAR instead of EXPECT_NEAR because if one value doesn't match, they probably all won't, so there's no - // reason to keep running and printing failures for every value. - ASSERT_NEAR(value, results[positionIndex], 0.000001f); - } - } }; TEST_F(GradientSignalGetValuesTestsFixture, ImageGradientComponent_VerifyGetValueAndGetValuesMatch) { auto entity = BuildTestImageGradient(TestShapeHalfBounds); - CompareGetValueAndGetValues(entity->GetId()); + GradientSignalTestHelpers::CompareGetValueAndGetValues(entity->GetId(), TestShapeHalfBounds); } TEST_F(GradientSignalGetValuesTestsFixture, PerlinGradientComponent_VerifyGetValueAndGetValuesMatch) { auto entity = BuildTestPerlinGradient(TestShapeHalfBounds); - CompareGetValueAndGetValues(entity->GetId()); + GradientSignalTestHelpers::CompareGetValueAndGetValues(entity->GetId(), TestShapeHalfBounds); } TEST_F(GradientSignalGetValuesTestsFixture, RandomGradientComponent_VerifyGetValueAndGetValuesMatch) { auto entity = BuildTestRandomGradient(TestShapeHalfBounds); - CompareGetValueAndGetValues(entity->GetId()); + GradientSignalTestHelpers::CompareGetValueAndGetValues(entity->GetId(), TestShapeHalfBounds); } TEST_F(GradientSignalGetValuesTestsFixture, ConstantGradientComponent_VerifyGetValueAndGetValuesMatch) { auto entity = BuildTestConstantGradient(TestShapeHalfBounds); - CompareGetValueAndGetValues(entity->GetId()); + GradientSignalTestHelpers::CompareGetValueAndGetValues(entity->GetId(), TestShapeHalfBounds); } TEST_F(GradientSignalGetValuesTestsFixture, ShapeAreaFalloffGradientComponent_VerifyGetValueAndGetValuesMatch) { auto entity = BuildTestShapeAreaFalloffGradient(TestShapeHalfBounds); - CompareGetValueAndGetValues(entity->GetId()); + GradientSignalTestHelpers::CompareGetValueAndGetValues(entity->GetId(), TestShapeHalfBounds); } TEST_F(GradientSignalGetValuesTestsFixture, DitherGradientComponent_VerifyGetValueAndGetValuesMatch) @@ -98,21 +56,21 @@ namespace UnitTest auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); auto entity = BuildTestDitherGradient(TestShapeHalfBounds, baseEntity->GetId()); - CompareGetValueAndGetValues(entity->GetId()); + GradientSignalTestHelpers::CompareGetValueAndGetValues(entity->GetId(), TestShapeHalfBounds); } TEST_F(GradientSignalGetValuesTestsFixture, InvertGradientComponent_VerifyGetValueAndGetValuesMatch) { auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); auto entity = BuildTestInvertGradient(TestShapeHalfBounds, baseEntity->GetId()); - CompareGetValueAndGetValues(entity->GetId()); + GradientSignalTestHelpers::CompareGetValueAndGetValues(entity->GetId(), TestShapeHalfBounds); } TEST_F(GradientSignalGetValuesTestsFixture, LevelsGradientComponent_VerifyGetValueAndGetValuesMatch) { auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); auto entity = BuildTestLevelsGradient(TestShapeHalfBounds, baseEntity->GetId()); - CompareGetValueAndGetValues(entity->GetId()); + GradientSignalTestHelpers::CompareGetValueAndGetValues(entity->GetId(), TestShapeHalfBounds); } TEST_F(GradientSignalGetValuesTestsFixture, MixedGradientComponent_VerifyGetValueAndGetValuesMatch) @@ -120,35 +78,35 @@ namespace UnitTest auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); auto mixedEntity = BuildTestConstantGradient(TestShapeHalfBounds); auto entity = BuildTestMixedGradient(TestShapeHalfBounds, baseEntity->GetId(), mixedEntity->GetId()); - CompareGetValueAndGetValues(entity->GetId()); + GradientSignalTestHelpers::CompareGetValueAndGetValues(entity->GetId(), TestShapeHalfBounds); } TEST_F(GradientSignalGetValuesTestsFixture, PosterizeGradientComponent_VerifyGetValueAndGetValuesMatch) { auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); auto entity = BuildTestPosterizeGradient(TestShapeHalfBounds, baseEntity->GetId()); - CompareGetValueAndGetValues(entity->GetId()); + GradientSignalTestHelpers::CompareGetValueAndGetValues(entity->GetId(), TestShapeHalfBounds); } TEST_F(GradientSignalGetValuesTestsFixture, ReferenceGradientComponent_VerifyGetValueAndGetValuesMatch) { auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); auto entity = BuildTestReferenceGradient(TestShapeHalfBounds, baseEntity->GetId()); - CompareGetValueAndGetValues(entity->GetId()); + GradientSignalTestHelpers::CompareGetValueAndGetValues(entity->GetId(), TestShapeHalfBounds); } TEST_F(GradientSignalGetValuesTestsFixture, SmoothStepGradientComponent_VerifyGetValueAndGetValuesMatch) { auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); auto entity = BuildTestSmoothStepGradient(TestShapeHalfBounds, baseEntity->GetId()); - CompareGetValueAndGetValues(entity->GetId()); + GradientSignalTestHelpers::CompareGetValueAndGetValues(entity->GetId(), TestShapeHalfBounds); } TEST_F(GradientSignalGetValuesTestsFixture, ThresholdGradientComponent_VerifyGetValueAndGetValuesMatch) { auto baseEntity = BuildTestRandomGradient(TestShapeHalfBounds); auto entity = BuildTestThresholdGradient(TestShapeHalfBounds, baseEntity->GetId()); - CompareGetValueAndGetValues(entity->GetId()); + GradientSignalTestHelpers::CompareGetValueAndGetValues(entity->GetId(), TestShapeHalfBounds); } TEST_F(GradientSignalGetValuesTestsFixture, SurfaceAltitudeGradientComponent_VerifyGetValueAndGetValuesMatch) @@ -157,7 +115,7 @@ namespace UnitTest CreateMockSurfaceDataSystem(AZ::Aabb::CreateFromMinMax(AZ::Vector3(-TestShapeHalfBounds), AZ::Vector3(TestShapeHalfBounds))); auto entity = BuildTestSurfaceAltitudeGradient(TestShapeHalfBounds); - CompareGetValueAndGetValues(entity->GetId()); + GradientSignalTestHelpers::CompareGetValueAndGetValues(entity->GetId(), TestShapeHalfBounds); } TEST_F(GradientSignalGetValuesTestsFixture, SurfaceMaskGradientComponent_VerifyGetValueAndGetValuesMatch) @@ -166,7 +124,7 @@ namespace UnitTest CreateMockSurfaceDataSystem(AZ::Aabb::CreateFromMinMax(AZ::Vector3(-TestShapeHalfBounds), AZ::Vector3(TestShapeHalfBounds))); auto entity = BuildTestSurfaceMaskGradient(TestShapeHalfBounds); - CompareGetValueAndGetValues(entity->GetId()); + GradientSignalTestHelpers::CompareGetValueAndGetValues(entity->GetId(), TestShapeHalfBounds); } TEST_F(GradientSignalGetValuesTestsFixture, SurfaceSlopeGradientComponent_VerifyGetValueAndGetValuesMatch) @@ -175,7 +133,7 @@ namespace UnitTest CreateMockSurfaceDataSystem(AZ::Aabb::CreateFromMinMax(AZ::Vector3(-TestShapeHalfBounds), AZ::Vector3(TestShapeHalfBounds))); auto entity = BuildTestSurfaceSlopeGradient(TestShapeHalfBounds); - CompareGetValueAndGetValues(entity->GetId()); + GradientSignalTestHelpers::CompareGetValueAndGetValues(entity->GetId(), TestShapeHalfBounds); } } diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalTestHelpers.cpp b/Gems/GradientSignal/Code/Tests/GradientSignalTestHelpers.cpp new file mode 100644 index 0000000000..46cc3475e8 --- /dev/null +++ b/Gems/GradientSignal/Code/Tests/GradientSignalTestHelpers.cpp @@ -0,0 +1,203 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + + +#include +#include +#include + +namespace UnitTest +{ + void GradientSignalTestHelpers::CompareGetValueAndGetValues(AZ::EntityId gradientEntityId, float shapeHalfBounds) + { + // Create a gradient sampler and run through a series of points to see if they match expectations. + + const AZ::Aabb queryRegion = AZ::Aabb::CreateFromMinMax(AZ::Vector3(-shapeHalfBounds), AZ::Vector3(shapeHalfBounds)); + const AZ::Vector2 stepSize(1.0f, 1.0f); + + GradientSignal::GradientSampler gradientSampler; + gradientSampler.m_gradientId = gradientEntityId; + + const size_t numSamplesX = aznumeric_cast(ceil(queryRegion.GetExtents().GetX() / stepSize.GetX())); + const size_t numSamplesY = aznumeric_cast(ceil(queryRegion.GetExtents().GetY() / stepSize.GetY())); + + // Build up the list of positions to query. + AZStd::vector positions(numSamplesX * numSamplesY); + size_t index = 0; + for (size_t yIndex = 0; yIndex < numSamplesY; yIndex++) + { + float y = queryRegion.GetMin().GetY() + (stepSize.GetY() * yIndex); + for (size_t xIndex = 0; xIndex < numSamplesX; xIndex++) + { + float x = queryRegion.GetMin().GetX() + (stepSize.GetX() * xIndex); + positions[index++] = AZ::Vector3(x, y, 0.0f); + } + } + + // Get the results from GetValues + AZStd::vector results(numSamplesX * numSamplesY); + gradientSampler.GetValues(positions, results); + + // For each position, call GetValue and verify that the values match. + for (size_t positionIndex = 0; positionIndex < positions.size(); positionIndex++) + { + GradientSignal::GradientSampleParams params; + params.m_position = positions[positionIndex]; + float value = gradientSampler.GetValue(params); + + // We use ASSERT_NEAR instead of EXPECT_NEAR because if one value doesn't match, they probably all won't, so there's no + // reason to keep running and printing failures for every value. + ASSERT_NEAR(value, results[positionIndex], 0.000001f); + } + } + +#ifdef HAVE_BENCHMARK + + void GradientSignalTestHelpers::FillQueryPositions(AZStd::vector& positions, float height, float width) + { + size_t index = 0; + for (float y = 0.0f; y < height; y += 1.0f) + { + for (float x = 0.0f; x < width; x += 1.0f) + { + positions[index++] = AZ::Vector3(x, y, 0.0f); + } + } + } + + void GradientSignalTestHelpers::RunEBusGetValueBenchmark(benchmark::State& state, const AZ::EntityId& gradientId, int64_t queryRange) + { + AZ_PROFILE_FUNCTION(Entity); + + GradientSignal::GradientSampleParams params; + + // Get the height and width ranges for querying from our benchmark parameters + const float height = aznumeric_cast(queryRange); + const float width = aznumeric_cast(queryRange); + + // Call GetValue() on the EBus for every height and width in our ranges. + for (auto _ : state) + { + for (float y = 0.0f; y < height; y += 1.0f) + { + for (float x = 0.0f; x < width; x += 1.0f) + { + float value = 0.0f; + params.m_position = AZ::Vector3(x, y, 0.0f); + GradientSignal::GradientRequestBus::EventResult( + value, gradientId, &GradientSignal::GradientRequestBus::Events::GetValue, params); + benchmark::DoNotOptimize(value); + } + } + } + } + + void GradientSignalTestHelpers::RunEBusGetValuesBenchmark(benchmark::State& state, const AZ::EntityId& gradientId, int64_t queryRange) + { + AZ_PROFILE_FUNCTION(Entity); + + // Get the height and width ranges for querying from our benchmark parameters + float height = aznumeric_cast(queryRange); + float width = aznumeric_cast(queryRange); + int64_t totalQueryPoints = queryRange * queryRange; + + // Call GetValues() for every height and width in our ranges. + for (auto _ : state) + { + // Set up our vector of query positions. This is done inside the benchmark timing since we're counting the work to create + // each query position in the single GetValue() call benchmarks, and will make the timing more directly comparable. + AZStd::vector positions(totalQueryPoints); + FillQueryPositions(positions, height, width); + + // Query and get the results. + AZStd::vector results(totalQueryPoints); + GradientSignal::GradientRequestBus::Event( + gradientId, &GradientSignal::GradientRequestBus::Events::GetValues, positions, results); + } + } + + void GradientSignalTestHelpers::RunSamplerGetValueBenchmark(benchmark::State& state, const AZ::EntityId& gradientId, int64_t queryRange) + { + AZ_PROFILE_FUNCTION(Entity); + + // Create a gradient sampler to use for querying our gradient. + GradientSignal::GradientSampler gradientSampler; + gradientSampler.m_gradientId = gradientId; + + // Get the height and width ranges for querying from our benchmark parameters + const float height = aznumeric_cast(queryRange); + const float width = aznumeric_cast(queryRange); + + // Call GetValue() through the GradientSampler for every height and width in our ranges. + for (auto _ : state) + { + for (float y = 0.0f; y < height; y += 1.0f) + { + for (float x = 0.0f; x < width; x += 1.0f) + { + GradientSignal::GradientSampleParams params; + params.m_position = AZ::Vector3(x, y, 0.0f); + float value = gradientSampler.GetValue(params); + benchmark::DoNotOptimize(value); + } + } + } + } + + void GradientSignalTestHelpers::RunSamplerGetValuesBenchmark( + benchmark::State& state, const AZ::EntityId& gradientId, int64_t queryRange) + { + AZ_PROFILE_FUNCTION(Entity); + + // Create a gradient sampler to use for querying our gradient. + GradientSignal::GradientSampler gradientSampler; + gradientSampler.m_gradientId = gradientId; + + // Get the height and width ranges for querying from our benchmark parameters + const float height = aznumeric_cast(queryRange); + const float width = aznumeric_cast(queryRange); + const int64_t totalQueryPoints = queryRange * queryRange; + + // Call GetValues() through the GradientSampler for every height and width in our ranges. + for (auto _ : state) + { + // Set up our vector of query positions. This is done inside the benchmark timing since we're counting the work to create + // each query position in the single GetValue() call benchmarks, and will make the timing more directly comparable. + AZStd::vector positions(totalQueryPoints); + FillQueryPositions(positions, height, width); + + // Query and get the results. + AZStd::vector results(totalQueryPoints); + gradientSampler.GetValues(positions, results); + } + } + + void GradientSignalTestHelpers::RunGetValueOrGetValuesBenchmark(benchmark::State& state, const AZ::EntityId& gradientId) + { + switch (state.range(0)) + { + case GetValuePermutation::EBUS_GET_VALUE: + RunEBusGetValueBenchmark(state, gradientId, state.range(1)); + break; + case GetValuePermutation::EBUS_GET_VALUES: + RunEBusGetValuesBenchmark(state, gradientId, state.range(1)); + break; + case GetValuePermutation::SAMPLER_GET_VALUE: + RunSamplerGetValueBenchmark(state, gradientId, state.range(1)); + break; + case GetValuePermutation::SAMPLER_GET_VALUES: + RunSamplerGetValuesBenchmark(state, gradientId, state.range(1)); + break; + default: + AZ_Assert(false, "Benchmark permutation type not supported."); + } + } +#endif +} + + diff --git a/Gems/GradientSignal/Code/Tests/GradientSignalTestHelpers.h b/Gems/GradientSignal/Code/Tests/GradientSignalTestHelpers.h new file mode 100644 index 0000000000..8a175939ee --- /dev/null +++ b/Gems/GradientSignal/Code/Tests/GradientSignalTestHelpers.h @@ -0,0 +1,76 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ +#pragma once + +#include +#include +#include +#include + +namespace UnitTest +{ + class GradientSignalTestHelpers + { + public: + static void CompareGetValueAndGetValues(AZ::EntityId gradientEntityId, float shapeHalfBounds); + +#ifdef HAVE_BENCHMARK + // We use an enum to list out the different types of GetValue() benchmarks to run so that way we can condense our test cases + // to just take the value in as a benchmark argument and switch on it. Otherwise, we would need to write a different benchmark + // function for each test case for each gradient. + enum GetValuePermutation : int64_t + { + EBUS_GET_VALUE, + EBUS_GET_VALUES, + SAMPLER_GET_VALUE, + SAMPLER_GET_VALUES, + }; + + static void FillQueryPositions(AZStd::vector& positions, float height, float width); + + static void RunEBusGetValueBenchmark(benchmark::State& state, const AZ::EntityId& gradientId, int64_t queryRange); + static void RunEBusGetValuesBenchmark(benchmark::State& state, const AZ::EntityId& gradientId, int64_t queryRange); + static void RunSamplerGetValueBenchmark(benchmark::State& state, const AZ::EntityId& gradientId, int64_t queryRange); + static void RunSamplerGetValuesBenchmark(benchmark::State& state, const AZ::EntityId& gradientId, int64_t queryRange); + static void RunGetValueOrGetValuesBenchmark(benchmark::State& state, const AZ::EntityId& gradientId); + +// Because there's no good way to label different enums in the output results (they just appear as integer values), we work around it by +// registering one set of benchmark runs for each enum value and use ArgNames() to give it a friendly name in the results. +#ifndef GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F +#define GRADIENT_SIGNAL_GET_VALUES_BENCHMARK_REGISTER_F(Fixture, Func) \ + BENCHMARK_REGISTER_F(Fixture, Func) \ + ->Args({ GradientSignalTestHelpers::GetValuePermutation::EBUS_GET_VALUE, 1024 }) \ + ->Args({ GradientSignalTestHelpers::GetValuePermutation::EBUS_GET_VALUE, 2048 }) \ + ->Args({ GradientSignalTestHelpers::GetValuePermutation::EBUS_GET_VALUE, 4096 }) \ + ->ArgNames({ "EbusGetValue", "size" }) \ + ->Unit(::benchmark::kMillisecond); \ + BENCHMARK_REGISTER_F(Fixture, Func) \ + ->Args({ GradientSignalTestHelpers::GetValuePermutation::EBUS_GET_VALUES, 1024 }) \ + ->Args({ GradientSignalTestHelpers::GetValuePermutation::EBUS_GET_VALUES, 2048 }) \ + ->Args({ GradientSignalTestHelpers::GetValuePermutation::EBUS_GET_VALUES, 4096 }) \ + ->ArgNames({ "EbusGetValues", "size" }) \ + ->Unit(::benchmark::kMillisecond); \ + BENCHMARK_REGISTER_F(Fixture, Func) \ + ->Args({ GradientSignalTestHelpers::GetValuePermutation::SAMPLER_GET_VALUE, 1024 }) \ + ->Args({ GradientSignalTestHelpers::GetValuePermutation::SAMPLER_GET_VALUE, 2048 }) \ + ->Args({ GradientSignalTestHelpers::GetValuePermutation::SAMPLER_GET_VALUE, 4096 }) \ + ->ArgNames({ "SamplerGetValue", "size" }) \ + ->Unit(::benchmark::kMillisecond); \ + BENCHMARK_REGISTER_F(Fixture, Func) \ + ->Args({ GradientSignalTestHelpers::GetValuePermutation::SAMPLER_GET_VALUES, 1024 }) \ + ->Args({ GradientSignalTestHelpers::GetValuePermutation::SAMPLER_GET_VALUES, 2048 }) \ + ->Args({ GradientSignalTestHelpers::GetValuePermutation::SAMPLER_GET_VALUES, 4096 }) \ + ->ArgNames({ "SamplerGetValues", "size" }) \ + ->Unit(::benchmark::kMillisecond); +#endif + +#endif + }; + + +} diff --git a/Gems/GradientSignal/Code/gradientsignal_shared_tests_files.cmake b/Gems/GradientSignal/Code/gradientsignal_shared_tests_files.cmake index 7d867b0a33..98ab57b7b0 100644 --- a/Gems/GradientSignal/Code/gradientsignal_shared_tests_files.cmake +++ b/Gems/GradientSignal/Code/gradientsignal_shared_tests_files.cmake @@ -7,6 +7,8 @@ # set(FILES + Tests/GradientSignalTestHelpers.cpp + Tests/GradientSignalTestHelpers.h Tests/GradientSignalTestFixtures.cpp Tests/GradientSignalTestFixtures.h Tests/GradientSignalTestMocks.cpp From 4b5f4042f201c35c94f1a60c82975342670972d9 Mon Sep 17 00:00:00 2001 From: amzn-sj Date: Wed, 19 Jan 2022 16:05:51 -0800 Subject: [PATCH 560/948] Move common code used by multiple tests into functions to reduce code duplication. Signed-off-by: amzn-sj --- .../Tests/TerrainPhysicsColliderTests.cpp | 117 ++++++-------- Gems/Terrain/Code/Tests/TerrainSystemTest.cpp | 149 ++++++++---------- 2 files changed, 111 insertions(+), 155 deletions(-) diff --git a/Gems/Terrain/Code/Tests/TerrainPhysicsColliderTests.cpp b/Gems/Terrain/Code/Tests/TerrainPhysicsColliderTests.cpp index 859e618983..2d0933c367 100644 --- a/Gems/Terrain/Code/Tests/TerrainPhysicsColliderTests.cpp +++ b/Gems/Terrain/Code/Tests/TerrainPhysicsColliderTests.cpp @@ -69,6 +69,46 @@ protected: m_colliderComponent = m_entity->CreateComponent(Terrain::TerrainPhysicsColliderConfig()); m_app.RegisterComponentDescriptor(m_colliderComponent->CreateDescriptor()); } + + void ProcessRegionLoop(const AZ::Aabb& inRegion, const AZ::Vector2& stepSize, + AzFramework::Terrain::SurfacePointRegionFillCallback perPositionCallback, + AzFramework::Terrain::TerrainDataRequests::Sampler sampleFilter, + AzFramework::SurfaceData::SurfaceTagWeightList* surfaceTags, + float mockHeight) + { + if (!perPositionCallback) + { + return; + } + + const size_t numSamplesX = aznumeric_cast(ceil(inRegion.GetExtents().GetX() / stepSize.GetX())); + const size_t numSamplesY = aznumeric_cast(ceil(inRegion.GetExtents().GetY() / stepSize.GetY())); + + AzFramework::SurfaceData::SurfacePoint surfacePoint; + for (size_t y = 0; y < numSamplesY; y++) + { + float fy = aznumeric_cast(inRegion.GetMin().GetY() + (y * stepSize.GetY())); + for (size_t x = 0; x < numSamplesX; x++) + { + bool terrainExists = false; + float fx = aznumeric_cast(inRegion.GetMin().GetX() + (x * stepSize.GetX())); + surfacePoint.m_position.Set(fx, fy, mockHeight); + if (surfaceTags) + { + surfacePoint.m_surfaceTags.clear(); + if (fy < 128.0) + { + surfacePoint.m_surfaceTags.push_back(surfaceTags->at(0)); + } + else + { + surfacePoint.m_surfaceTags.push_back(surfaceTags->at(1)); + } + } + perPositionCallback(x, y, surfacePoint, terrainExists); + } + } + } }; TEST_F(TerrainPhysicsColliderComponentTest, ActivateEntityActivateSuccess) @@ -239,30 +279,11 @@ TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderGetHeightsRetu NiceMock terrainListener; ON_CALL(terrainListener, GetTerrainHeightQueryResolution).WillByDefault(Return(mockHeightResolution)); ON_CALL(terrainListener, ProcessHeightsFromRegion).WillByDefault( - [](const AZ::Aabb& inRegion, const AZ::Vector2& stepSize, + [this](const AZ::Aabb& inRegion, const AZ::Vector2& stepSize, AzFramework::Terrain::SurfacePointRegionFillCallback perPositionCallback, AzFramework::Terrain::TerrainDataRequests::Sampler sampleFilter) { - if (!perPositionCallback) - { - return; - } - - const size_t numSamplesX = aznumeric_cast(ceil(inRegion.GetExtents().GetX() / stepSize.GetX())); - const size_t numSamplesY = aznumeric_cast(ceil(inRegion.GetExtents().GetY() / stepSize.GetY())); - - AzFramework::SurfaceData::SurfacePoint surfacePoint; - for (size_t y = 0; y < numSamplesY; y++) - { - float fy = aznumeric_cast(inRegion.GetMin().GetY() + (y * stepSize.GetY())); - for (size_t x = 0; x < numSamplesX; x++) - { - bool terrainExists = false; - float fx = aznumeric_cast(inRegion.GetMin().GetX() + (x * stepSize.GetX())); - surfacePoint.m_position.Set(fx, fy, 0.0f); - perPositionCallback(x, y, surfacePoint, terrainExists); - } - } + ProcessRegionLoop(inRegion, stepSize, perPositionCallback, sampleFilter, nullptr, 0.0f); } ); @@ -300,30 +321,11 @@ TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderReturnsRelativ NiceMock terrainListener; ON_CALL(terrainListener, GetTerrainHeightQueryResolution).WillByDefault(Return(mockHeightResolution)); ON_CALL(terrainListener, ProcessHeightsFromRegion).WillByDefault( - [mockHeight](const AZ::Aabb& inRegion, const AZ::Vector2& stepSize, + [this, mockHeight](const AZ::Aabb& inRegion, const AZ::Vector2& stepSize, AzFramework::Terrain::SurfacePointRegionFillCallback perPositionCallback, AzFramework::Terrain::TerrainDataRequests::Sampler sampleFilter) { - if (!perPositionCallback) - { - return; - } - - const size_t numSamplesX = aznumeric_cast(ceil(inRegion.GetExtents().GetX() / stepSize.GetX())); - const size_t numSamplesY = aznumeric_cast(ceil(inRegion.GetExtents().GetY() / stepSize.GetY())); - - AzFramework::SurfaceData::SurfacePoint surfacePoint; - for (size_t y = 0; y < numSamplesY; y++) - { - float fy = aznumeric_cast(inRegion.GetMin().GetY() + (y * stepSize.GetY())); - for (size_t x = 0; x < numSamplesX; x++) - { - bool terrainExists = false; - float fx = aznumeric_cast(inRegion.GetMin().GetX() + (x * stepSize.GetX())); - surfacePoint.m_position.Set(fx, fy, mockHeight); - perPositionCallback(x, y, surfacePoint, terrainExists); - } - } + ProcessRegionLoop(inRegion, stepSize, perPositionCallback, sampleFilter, nullptr, mockHeight); } ); @@ -467,39 +469,16 @@ TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderGetHeightsAndM return2.m_surfaceType = tag2; return2.m_weight = 1.0f; + AzFramework::SurfaceData::SurfaceTagWeightList surfaceTags = { return1, return2 }; + NiceMock terrainListener; ON_CALL(terrainListener, GetTerrainHeightQueryResolution).WillByDefault(Return(mockHeightResolution)); ON_CALL(terrainListener, ProcessSurfacePointsFromRegion).WillByDefault( - [mockHeight, return1, return2](const AZ::Aabb& inRegion, const AZ::Vector2& stepSize, + [this, mockHeight, &surfaceTags](const AZ::Aabb& inRegion, const AZ::Vector2& stepSize, AzFramework::Terrain::SurfacePointRegionFillCallback perPositionCallback, AzFramework::Terrain::TerrainDataRequests::Sampler sampleFilter) { - if (!perPositionCallback) - { - return; - } - - const size_t numSamplesX = aznumeric_cast(ceil(inRegion.GetExtents().GetX() / stepSize.GetX())); - const size_t numSamplesY = aznumeric_cast(ceil(inRegion.GetExtents().GetY() / stepSize.GetY())); - - AzFramework::SurfaceData::SurfacePoint surfacePoint; - for (size_t y = 0; y < numSamplesY; y++) - { - float fy = aznumeric_cast(inRegion.GetMin().GetY() + (y * stepSize.GetY())); - for (size_t x = 0; x < numSamplesX; x++) - { - surfacePoint.m_surfaceTags.clear(); - bool terrainExists = false; - float fx = aznumeric_cast(inRegion.GetMin().GetX() + (x * stepSize.GetX())); - surfacePoint.m_position.Set(fx, fy, mockHeight); - if (fy < 128.0) - { - surfacePoint.m_surfaceTags.push_back(return1); - } - surfacePoint.m_surfaceTags.push_back(return2); - perPositionCallback(x, y, surfacePoint, terrainExists); - } - } + ProcessRegionLoop(inRegion, stepSize, perPositionCallback, sampleFilter, &surfaceTags, mockHeight); } ); diff --git a/Gems/Terrain/Code/Tests/TerrainSystemTest.cpp b/Gems/Terrain/Code/Tests/TerrainSystemTest.cpp index 2eebc1b824..ab0847e634 100644 --- a/Gems/Terrain/Code/Tests/TerrainSystemTest.cpp +++ b/Gems/Terrain/Code/Tests/TerrainSystemTest.cpp @@ -68,6 +68,7 @@ namespace UnitTest AZStd::unique_ptr> m_boxShapeRequests; AZStd::unique_ptr> m_shapeRequests; AZStd::unique_ptr> m_terrainAreaHeightRequests; + AZStd::unique_ptr> m_terrainAreaSurfaceRequests; void SetUp() override { @@ -84,6 +85,7 @@ namespace UnitTest m_boxShapeRequests.reset(); m_shapeRequests.reset(); m_terrainAreaHeightRequests.reset(); + m_terrainAreaSurfaceRequests.reset(); m_app.Destroy(); } @@ -160,6 +162,49 @@ namespace UnitTest ActivateEntity(entity.get()); return entity; } + + void SetupSurfaceWeightMocks(AZ::Entity* entity, AzFramework::SurfaceData::SurfaceTagWeightList& expectedTags) + { + const SurfaceData::SurfaceTag tag1 = SurfaceData::SurfaceTag("tag1"); + const SurfaceData::SurfaceTag tag2 = SurfaceData::SurfaceTag("tag2"); + const SurfaceData::SurfaceTag tag3 = SurfaceData::SurfaceTag("tag3"); + + AzFramework::SurfaceData::SurfaceTagWeight tagWeight1; + tagWeight1.m_surfaceType = tag1; + tagWeight1.m_weight = 1.0f; + expectedTags.push_back(tagWeight1); + + AzFramework::SurfaceData::SurfaceTagWeight tagWeight2; + tagWeight2.m_surfaceType = tag2; + tagWeight2.m_weight = 0.7f; + expectedTags.push_back(tagWeight2); + + AzFramework::SurfaceData::SurfaceTagWeight tagWeight3; + tagWeight3.m_surfaceType = tag3; + tagWeight3.m_weight = 0.3f; + expectedTags.push_back(tagWeight3); + + m_terrainAreaSurfaceRequests = AZStd::make_unique>(entity->GetId()); + ON_CALL(*m_terrainAreaSurfaceRequests, GetSurfaceWeights).WillByDefault( + [tagWeight1, tagWeight2, tagWeight3](const AZ::Vector3& position, AzFramework::SurfaceData::SurfaceTagWeightList& surfaceWeights) + { + surfaceWeights.clear(); + float absYPos = fabsf(position.GetY()); + if (absYPos < 1.0f) + { + surfaceWeights.push_back(tagWeight1); + } + else if(absYPos < 2.0f) + { + surfaceWeights.push_back(tagWeight2); + } + else + { + surfaceWeights.push_back(tagWeight3); + } + } + ); + } }; TEST_F(TerrainSystemTest, TrivialCreateDestroy) @@ -921,62 +966,28 @@ namespace UnitTest const AZ::Aabb testRegionBox = AZ::Aabb::CreateFromMinMaxValues(-3.0f, -3.0f, -1.0f, 3.0f, 3.0f, 1.0f); const AZ::Vector2 stepSize(1.0f); - const SurfaceData::SurfaceTag tag1 = SurfaceData::SurfaceTag("tag1"); - const SurfaceData::SurfaceTag tag2 = SurfaceData::SurfaceTag("tag2"); - const SurfaceData::SurfaceTag tag3 = SurfaceData::SurfaceTag("tag3"); - - AzFramework::SurfaceData::SurfaceTagWeight tagWeight1; - tagWeight1.m_surfaceType = tag1; - tagWeight1.m_weight = 1.0f; - - AzFramework::SurfaceData::SurfaceTagWeight tagWeight2; - tagWeight2.m_surfaceType = tag2; - tagWeight2.m_weight = 0.7f; - - AzFramework::SurfaceData::SurfaceTagWeight tagWeight3; - tagWeight3.m_surfaceType = tag3; - tagWeight3.m_weight = 0.3f; - - NiceMock mockSurfaceRequests(entity->GetId()); - ON_CALL(mockSurfaceRequests, GetSurfaceWeights).WillByDefault( - [&tagWeight1, &tagWeight2, &tagWeight3](const AZ::Vector3& position, AzFramework::SurfaceData::SurfaceTagWeightList& surfaceWeights) - { - surfaceWeights.clear(); - float absYPos = fabsf(position.GetY()); - if (absYPos < 1.0f) - { - surfaceWeights.push_back(tagWeight1); - } - else if(absYPos < 2.0f) - { - surfaceWeights.push_back(tagWeight2); - } - else - { - surfaceWeights.push_back(tagWeight3); - } - } - ); + AzFramework::SurfaceData::SurfaceTagWeightList expectedTags; + SetupSurfaceWeightMocks(entity.get(), expectedTags); - auto perPositionCallback = [&tagWeight1, &tagWeight2, &tagWeight3](size_t xIndex, size_t yIndex, + auto perPositionCallback = [&expectedTags](size_t xIndex, size_t yIndex, const AzFramework::SurfaceData::SurfacePoint& surfacePoint, [[maybe_unused]] bool terrainExists) { constexpr float epsilon = 0.0001f; float absYPos = fabsf(surfacePoint.m_position.GetY()); if (absYPos < 1.0f) { - EXPECT_EQ(surfacePoint.m_surfaceTags[0].m_surfaceType, tagWeight1.m_surfaceType); - EXPECT_NEAR(surfacePoint.m_surfaceTags[0].m_weight, tagWeight1.m_weight, epsilon); + EXPECT_EQ(surfacePoint.m_surfaceTags[0].m_surfaceType, expectedTags[0].m_surfaceType); + EXPECT_NEAR(surfacePoint.m_surfaceTags[0].m_weight, expectedTags[0].m_weight, epsilon); } else if(absYPos < 2.0f) { - EXPECT_EQ(surfacePoint.m_surfaceTags[0].m_surfaceType, tagWeight2.m_surfaceType); - EXPECT_NEAR(surfacePoint.m_surfaceTags[0].m_weight, tagWeight2.m_weight, epsilon); + EXPECT_EQ(surfacePoint.m_surfaceTags[0].m_surfaceType, expectedTags[1].m_surfaceType); + EXPECT_NEAR(surfacePoint.m_surfaceTags[0].m_weight, expectedTags[1].m_weight, epsilon); } else { - EXPECT_EQ(surfacePoint.m_surfaceTags[0].m_surfaceType, tagWeight3.m_surfaceType); - EXPECT_NEAR(surfacePoint.m_surfaceTags[0].m_weight, tagWeight3.m_weight, epsilon); + EXPECT_EQ(surfacePoint.m_surfaceTags[0].m_surfaceType, expectedTags[2].m_surfaceType); + EXPECT_NEAR(surfacePoint.m_surfaceTags[0].m_weight, expectedTags[2].m_weight, epsilon); } }; @@ -1001,44 +1012,10 @@ namespace UnitTest const AZ::Aabb testRegionBox = AZ::Aabb::CreateFromMinMaxValues(-3.0f, -3.0f, -1.0f, 3.0f, 3.0f, 1.0f); const AZ::Vector2 stepSize(1.0f); - const SurfaceData::SurfaceTag tag1 = SurfaceData::SurfaceTag("tag1"); - const SurfaceData::SurfaceTag tag2 = SurfaceData::SurfaceTag("tag2"); - const SurfaceData::SurfaceTag tag3 = SurfaceData::SurfaceTag("tag3"); - - AzFramework::SurfaceData::SurfaceTagWeight tagWeight1; - tagWeight1.m_surfaceType = tag1; - tagWeight1.m_weight = 1.0f; - - AzFramework::SurfaceData::SurfaceTagWeight tagWeight2; - tagWeight2.m_surfaceType = tag2; - tagWeight2.m_weight = 0.7f; - - AzFramework::SurfaceData::SurfaceTagWeight tagWeight3; - tagWeight3.m_surfaceType = tag3; - tagWeight3.m_weight = 0.3f; - - NiceMock mockSurfaceRequests(entity->GetId()); - ON_CALL(mockSurfaceRequests, GetSurfaceWeights).WillByDefault( - [&tagWeight1, &tagWeight2, &tagWeight3](const AZ::Vector3& position, AzFramework::SurfaceData::SurfaceTagWeightList& surfaceWeights) - { - surfaceWeights.clear(); - float absYPos = fabsf(position.GetY()); - if (absYPos < 1.0f) - { - surfaceWeights.push_back(tagWeight1); - } - else if(absYPos < 2.0f) - { - surfaceWeights.push_back(tagWeight2); - } - else - { - surfaceWeights.push_back(tagWeight3); - } - } - ); + AzFramework::SurfaceData::SurfaceTagWeightList expectedTags; + SetupSurfaceWeightMocks(entity.get(), expectedTags); - auto perPositionCallback = [&tagWeight1, &tagWeight2, &tagWeight3](size_t xIndex, size_t yIndex, + auto perPositionCallback = [&expectedTags](size_t xIndex, size_t yIndex, const AzFramework::SurfaceData::SurfacePoint& surfacePoint, [[maybe_unused]] bool terrainExists) { constexpr float epsilon = 0.0001f; @@ -1049,18 +1026,18 @@ namespace UnitTest float absYPos = fabsf(surfacePoint.m_position.GetY()); if (absYPos < 1.0f) { - EXPECT_EQ(surfacePoint.m_surfaceTags[0].m_surfaceType, tagWeight1.m_surfaceType); - EXPECT_NEAR(surfacePoint.m_surfaceTags[0].m_weight, tagWeight1.m_weight, epsilon); + EXPECT_EQ(surfacePoint.m_surfaceTags[0].m_surfaceType, expectedTags[0].m_surfaceType); + EXPECT_NEAR(surfacePoint.m_surfaceTags[0].m_weight, expectedTags[0].m_weight, epsilon); } else if(absYPos < 2.0f) { - EXPECT_EQ(surfacePoint.m_surfaceTags[0].m_surfaceType, tagWeight2.m_surfaceType); - EXPECT_NEAR(surfacePoint.m_surfaceTags[0].m_weight, tagWeight2.m_weight, epsilon); + EXPECT_EQ(surfacePoint.m_surfaceTags[0].m_surfaceType, expectedTags[1].m_surfaceType); + EXPECT_NEAR(surfacePoint.m_surfaceTags[0].m_weight, expectedTags[1].m_weight, epsilon); } else { - EXPECT_EQ(surfacePoint.m_surfaceTags[0].m_surfaceType, tagWeight3.m_surfaceType); - EXPECT_NEAR(surfacePoint.m_surfaceTags[0].m_weight, tagWeight3.m_weight, epsilon); + EXPECT_EQ(surfacePoint.m_surfaceTags[0].m_surfaceType, expectedTags[2].m_surfaceType); + EXPECT_NEAR(surfacePoint.m_surfaceTags[0].m_weight, expectedTags[2].m_weight, epsilon); } }; From 63d755b8f152bf062952bb7527de2bbb357441f9 Mon Sep 17 00:00:00 2001 From: AMZN-byrcolin <68035668+byrcolin@users.noreply.github.com> Date: Wed, 19 Jan 2022 17:09:40 -0800 Subject: [PATCH 561/948] fix launcher not showing gems (#7015) Signed-off-by: byrcolin --- Code/Tools/ProjectManager/Source/PythonBindings.cpp | 4 ++-- Gems/Atom/Asset/ImageProcessingAtom/gem.json | 2 +- Gems/Atom/Bootstrap/gem.json | 2 +- Gems/Atom/Component/DebugCamera/gem.json | 2 +- Gems/Atom/Feature/Common/gem.json | 2 +- Gems/Atom/RHI/DX12/gem.json | 2 +- Gems/Atom/RHI/Metal/gem.json | 2 +- Gems/Atom/RHI/Null/gem.json | 2 +- Gems/Atom/RHI/Vulkan/gem.json | 2 +- Gems/Atom/RHI/gem.json | 2 +- Gems/Atom/RPI/gem.json | 2 +- Gems/Atom/Tools/AtomToolsFramework/gem.json | 2 +- Gems/AtomLyIntegration/AtomBridge/gem.json | 2 +- Gems/AtomLyIntegration/AtomFont/gem.json | 2 +- Gems/AtomLyIntegration/AtomImGuiTools/gem.json | 2 +- Gems/AtomLyIntegration/AtomViewportDisplayIcons/gem.json | 2 +- Gems/AtomLyIntegration/AtomViewportDisplayInfo/gem.json | 2 +- Gems/AtomLyIntegration/CommonFeatures/gem.json | 2 +- Gems/AtomLyIntegration/EMotionFXAtom/gem.json | 2 +- Gems/AtomLyIntegration/ImguiAtom/gem.json | 2 +- 20 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Code/Tools/ProjectManager/Source/PythonBindings.cpp b/Code/Tools/ProjectManager/Source/PythonBindings.cpp index 7c436a3a70..60959d4090 100644 --- a/Code/Tools/ProjectManager/Source/PythonBindings.cpp +++ b/Code/Tools/ProjectManager/Source/PythonBindings.cpp @@ -408,7 +408,7 @@ namespace O3DE::ProjectManager } // check if engine path is registered - auto allEngines = m_manifest.attr("get_engines")(); + auto allEngines = m_manifest.attr("get_manifest_engines")(); if (pybind11::isinstance(allEngines)) { const AZ::IO::FixedMaxPath enginePathFixed(Py_To_String(enginePath)); @@ -891,7 +891,7 @@ namespace O3DE::ProjectManager bool result = ExecuteWithLock([&] { // external projects - for (auto path : m_manifest.attr("get_projects")()) + for (auto path : m_manifest.attr("get_manifest_projects")()) { projects.push_back(ProjectInfoFromPath(path)); } diff --git a/Gems/Atom/Asset/ImageProcessingAtom/gem.json b/Gems/Atom/Asset/ImageProcessingAtom/gem.json index c2af4b7e7e..baa46268b3 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/gem.json +++ b/Gems/Atom/Asset/ImageProcessingAtom/gem.json @@ -6,7 +6,7 @@ "origin": "Open 3D Engine - o3de.org", "origin_url": "https://github.com/o3de/o3de", "type": "Code", - "summary": "", + "summary": "Image processing for Atom", "canonical_tags": [ "Gem" ], diff --git a/Gems/Atom/Bootstrap/gem.json b/Gems/Atom/Bootstrap/gem.json index 543efe0f34..726021235f 100644 --- a/Gems/Atom/Bootstrap/gem.json +++ b/Gems/Atom/Bootstrap/gem.json @@ -6,7 +6,7 @@ "origin": "Open 3D Engine - o3de.org", "origin_url": "https://github.com/o3de/o3de", "type": "Code", - "summary": "", + "summary": "Atom Bootstrap", "canonical_tags": [ "Gem" ], diff --git a/Gems/Atom/Component/DebugCamera/gem.json b/Gems/Atom/Component/DebugCamera/gem.json index 74d88a21b6..678cce3045 100644 --- a/Gems/Atom/Component/DebugCamera/gem.json +++ b/Gems/Atom/Component/DebugCamera/gem.json @@ -6,7 +6,7 @@ "origin": "Open 3D Engine - o3de.org", "origin_url": "https://github.com/o3de/o3de", "type": "Code", - "summary": "", + "summary": "Debug Camera component for Atom", "canonical_tags": [ "Gem" ], diff --git a/Gems/Atom/Feature/Common/gem.json b/Gems/Atom/Feature/Common/gem.json index f4c936dc4a..d915c55b1d 100644 --- a/Gems/Atom/Feature/Common/gem.json +++ b/Gems/Atom/Feature/Common/gem.json @@ -6,7 +6,7 @@ "origin": "Open 3D Engine - o3de.org", "origin_url": "https://github.com/o3de/o3de", "type": "Code", - "summary": "", + "summary": "Common features for Atom", "canonical_tags": [ "Gem" ], diff --git a/Gems/Atom/RHI/DX12/gem.json b/Gems/Atom/RHI/DX12/gem.json index 803ae4f4d0..67d91790a9 100644 --- a/Gems/Atom/RHI/DX12/gem.json +++ b/Gems/Atom/RHI/DX12/gem.json @@ -6,7 +6,7 @@ "origin": "Open 3D Engine - o3de.org", "origin_url": "https://github.com/o3de/o3de", "type": "Code", - "summary": "", + "summary": "DX12 RHI for Atom", "canonical_tags": [ "Gem" ], diff --git a/Gems/Atom/RHI/Metal/gem.json b/Gems/Atom/RHI/Metal/gem.json index 0257048bd3..555b86523c 100644 --- a/Gems/Atom/RHI/Metal/gem.json +++ b/Gems/Atom/RHI/Metal/gem.json @@ -6,7 +6,7 @@ "origin": "Open 3D Engine - o3de.org", "origin_url": "https://github.com/o3de/o3de", "type": "Code", - "summary": "", + "summary": "Metal RHI for Atom", "canonical_tags": [ "Gem" ], diff --git a/Gems/Atom/RHI/Null/gem.json b/Gems/Atom/RHI/Null/gem.json index 1ea2eb4cb0..d531aa4ab5 100644 --- a/Gems/Atom/RHI/Null/gem.json +++ b/Gems/Atom/RHI/Null/gem.json @@ -6,7 +6,7 @@ "origin": "Open 3D Engine - o3de.org", "origin_url": "https://github.com/o3de/o3de", "type": "Code", - "summary": "", + "summary": "Atom Null RHI", "canonical_tags": [ "Gem" ], diff --git a/Gems/Atom/RHI/Vulkan/gem.json b/Gems/Atom/RHI/Vulkan/gem.json index 508ad85c75..5d49085ac5 100644 --- a/Gems/Atom/RHI/Vulkan/gem.json +++ b/Gems/Atom/RHI/Vulkan/gem.json @@ -6,7 +6,7 @@ "origin": "Open 3D Engine - o3de.org", "origin_url": "https://github.com/o3de/o3de", "type": "Code", - "summary": "", + "summary": "Vulcan RHI for Atom", "canonical_tags": [ "Gem" ], diff --git a/Gems/Atom/RHI/gem.json b/Gems/Atom/RHI/gem.json index 858a64fc17..49ec18ea53 100644 --- a/Gems/Atom/RHI/gem.json +++ b/Gems/Atom/RHI/gem.json @@ -6,7 +6,7 @@ "origin": "Open 3D Engine - o3de.org", "origin_url": "https://github.com/o3de/o3de", "type": "Code", - "summary": "", + "summary": "RHI for Atom", "canonical_tags": [ "Gem" ], diff --git a/Gems/Atom/RPI/gem.json b/Gems/Atom/RPI/gem.json index 0acef5179b..fe135c3e90 100644 --- a/Gems/Atom/RPI/gem.json +++ b/Gems/Atom/RPI/gem.json @@ -6,7 +6,7 @@ "origin": "Open 3D Engine - o3de.org", "origin_url": "https://github.com/o3de/o3de", "type": "Code", - "summary": "", + "summary": "RPI for Atom", "canonical_tags": [ "Gem" ], diff --git a/Gems/Atom/Tools/AtomToolsFramework/gem.json b/Gems/Atom/Tools/AtomToolsFramework/gem.json index 6e5a7b311a..a86244e7cc 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/gem.json +++ b/Gems/Atom/Tools/AtomToolsFramework/gem.json @@ -6,7 +6,7 @@ "origin": "Open 3D Engine - o3de.org", "origin_url": "https://github.com/o3de/o3de", "type": "Code", - "summary": "", + "summary": "Tools Framework for Atom", "canonical_tags": [ "Gem" ], diff --git a/Gems/AtomLyIntegration/AtomBridge/gem.json b/Gems/AtomLyIntegration/AtomBridge/gem.json index 5a8512c90d..87a10aa6d3 100644 --- a/Gems/AtomLyIntegration/AtomBridge/gem.json +++ b/Gems/AtomLyIntegration/AtomBridge/gem.json @@ -6,7 +6,7 @@ "origin": "Open 3D Engine - o3de.org", "origin_url": "https://github.com/o3de/o3de", "type": "Code", - "summary": "", + "summary": "Atom Bridge", "canonical_tags": [ "Gem" ], diff --git a/Gems/AtomLyIntegration/AtomFont/gem.json b/Gems/AtomLyIntegration/AtomFont/gem.json index d979509059..4f5ba75ff2 100644 --- a/Gems/AtomLyIntegration/AtomFont/gem.json +++ b/Gems/AtomLyIntegration/AtomFont/gem.json @@ -6,7 +6,7 @@ "origin": "Open 3D Engine - o3de.org", "origin_url": "https://github.com/o3de/o3de", "type": "Code", - "summary": "", + "summary": "Font Rendering for Atom", "canonical_tags": [ "Gem" ], diff --git a/Gems/AtomLyIntegration/AtomImGuiTools/gem.json b/Gems/AtomLyIntegration/AtomImGuiTools/gem.json index 205120f6f0..2ae8edfa57 100644 --- a/Gems/AtomLyIntegration/AtomImGuiTools/gem.json +++ b/Gems/AtomLyIntegration/AtomImGuiTools/gem.json @@ -6,7 +6,7 @@ "origin": "Open 3D Engine - o3de.org", "origin_url": "https://github.com/o3de/o3de", "type": "Tool", - "summary": "", + "summary": "ImGui tools for Atom", "canonical_tags": [ "Gem" ], diff --git a/Gems/AtomLyIntegration/AtomViewportDisplayIcons/gem.json b/Gems/AtomLyIntegration/AtomViewportDisplayIcons/gem.json index cff957c1f1..a7b9dab980 100644 --- a/Gems/AtomLyIntegration/AtomViewportDisplayIcons/gem.json +++ b/Gems/AtomLyIntegration/AtomViewportDisplayIcons/gem.json @@ -6,7 +6,7 @@ "origin": "Open 3D Engine - o3de.org", "origin_url": "https://github.com/o3de/o3de", "type": "Code", - "summary": "", + "summary": "Viewport display icons for Atom", "canonical_tags": [ "Gem" ], diff --git a/Gems/AtomLyIntegration/AtomViewportDisplayInfo/gem.json b/Gems/AtomLyIntegration/AtomViewportDisplayInfo/gem.json index a2bc92c76d..0deeeef602 100644 --- a/Gems/AtomLyIntegration/AtomViewportDisplayInfo/gem.json +++ b/Gems/AtomLyIntegration/AtomViewportDisplayInfo/gem.json @@ -6,7 +6,7 @@ "origin": "Open 3D Engine - o3de.org", "origin_url": "https://github.com/o3de/o3de", "type": "Code", - "summary": "", + "summary": "Viewport Display Information for Atom", "canonical_tags": [ "Gem" ], diff --git a/Gems/AtomLyIntegration/CommonFeatures/gem.json b/Gems/AtomLyIntegration/CommonFeatures/gem.json index a06f607fab..b6290679b9 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/gem.json +++ b/Gems/AtomLyIntegration/CommonFeatures/gem.json @@ -6,7 +6,7 @@ "origin": "Open 3D Engine - o3de.org", "origin_url": "https://github.com/o3de/o3de", "type": "Code", - "summary": "", + "summary": "Common features for Atom", "canonical_tags": [ "Gem" ], diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/gem.json b/Gems/AtomLyIntegration/EMotionFXAtom/gem.json index 8bea93da91..3847432cf7 100644 --- a/Gems/AtomLyIntegration/EMotionFXAtom/gem.json +++ b/Gems/AtomLyIntegration/EMotionFXAtom/gem.json @@ -6,7 +6,7 @@ "origin": "Open 3D Engine - o3de.org", "origin_url": "https://github.com/o3de/o3de", "type": "Code", - "summary": "", + "summary": "EmotionFX for Atom", "canonical_tags": [ "Gem" ], diff --git a/Gems/AtomLyIntegration/ImguiAtom/gem.json b/Gems/AtomLyIntegration/ImguiAtom/gem.json index 4c65d80e33..70ff1c0414 100644 --- a/Gems/AtomLyIntegration/ImguiAtom/gem.json +++ b/Gems/AtomLyIntegration/ImguiAtom/gem.json @@ -6,7 +6,7 @@ "origin": "Open 3D Engine - o3de.org", "origin_url": "https://github.com/o3de/o3de", "type": "Code", - "summary": "", + "summary": "ImGui support for Atom", "canonical_tags": [ "Gem" ], From 66f0f1cf5a03c1196ef029f95cac99f58970d471 Mon Sep 17 00:00:00 2001 From: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com> Date: Wed, 19 Jan 2022 17:55:05 -0800 Subject: [PATCH 562/948] Duplicate engine detection and help in Project Manager (#6984) Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com> --- .../ProjectManager/Source/Application.cpp | 86 ++++++++ .../Tools/ProjectManager/Source/Application.h | 1 + Code/Tools/ProjectManager/Source/EngineInfo.h | 5 +- .../Source/EngineSettingsScreen.cpp | 5 +- .../Source/GemRepo/GemRepoScreen.cpp | 19 +- .../ProjectManager/Source/ProjectUtils.cpp | 19 ++ .../ProjectManager/Source/ProjectUtils.h | 9 + .../ProjectManager/Source/PythonBindings.cpp | 183 ++++++++++-------- .../ProjectManager/Source/PythonBindings.h | 12 +- .../Source/PythonBindingsInterface.h | 22 ++- scripts/o3de/o3de/engine_properties.py | 5 + scripts/o3de/o3de/manifest.py | 108 ++++++----- 12 files changed, 322 insertions(+), 152 deletions(-) diff --git a/Code/Tools/ProjectManager/Source/Application.cpp b/Code/Tools/ProjectManager/Source/Application.cpp index 29e0df3c3a..08a812999f 100644 --- a/Code/Tools/ProjectManager/Source/Application.cpp +++ b/Code/Tools/ProjectManager/Source/Application.cpp @@ -21,6 +21,7 @@ #include #include #include +#include namespace O3DE::ProjectManager { @@ -111,6 +112,11 @@ namespace O3DE::ProjectManager } } + if (!RegisterEngine(interactive)) + { + return false; + } + const AZ::CommandLine* commandLine = GetCommandLine(); AZ_Assert(commandLine, "Failed to get command line"); @@ -165,6 +171,86 @@ namespace O3DE::ProjectManager return m_entity != nullptr; } + bool Application::RegisterEngine(bool interactive) + { + // get this engine's info + auto engineInfoOutcome = m_pythonBindings->GetEngineInfo(); + if (!engineInfoOutcome) + { + if (interactive) + { + QMessageBox::critical(nullptr, + QObject::tr("Failed to get engine info"), + QObject::tr("A valid engine.json could not be found or loaded. " + "Please verify a valid engine.json file exists in %1") + .arg(GetEngineRoot())); + } + + AZ_Error("Project Manager", false, "Failed to get engine info"); + return false; + } + + EngineInfo engineInfo = engineInfoOutcome.GetValue(); + if (engineInfo.m_registered) + { + return true; + } + + bool forceRegistration = false; + + // check if an engine with this name is already registered + auto existingEngineResult = m_pythonBindings->GetEngineInfo(engineInfo.m_name); + if (existingEngineResult) + { + if (!interactive) + { + AZ_Error("Project Manager", false, "An engine with the name %s is already registered with the path %s", + engineInfo.m_name.toUtf8().constData(), engineInfo.m_path.toUtf8().constData()); + return false; + } + + // get the updated engine name unless the user wants to cancel + bool okPressed = false; + const EngineInfo& otherEngineInfo = existingEngineResult.GetValue(); + + engineInfo.m_name = QInputDialog::getText(nullptr, + QObject::tr("Engine '%1' already registered").arg(engineInfo.m_name), + QObject::tr("An engine named '%1' is already registered.

" + "Current path
%2

" + "New path
%3

" + "Press 'OK' to force registration, or provide a new engine name below.
" + "Alternatively, press `Cancel` to close the Project Manager and resolve the issue manually.") + .arg(engineInfo.m_name, otherEngineInfo.m_path, engineInfo.m_path), + QLineEdit::Normal, + engineInfo.m_name, + &okPressed); + + if (!okPressed) + { + // user elected not to change the name or force registration + return false; + } + + forceRegistration = true; + } + + auto registerOutcome = m_pythonBindings->SetEngineInfo(engineInfo, forceRegistration); + if (!registerOutcome) + { + if (interactive) + { + ProjectUtils::DisplayDetailedError(QObject::tr("Failed to register engine"), registerOutcome); + } + + AZ_Error("Project Manager", false, "Failed to register engine %s : %s", + engineInfo.m_path.toUtf8().constData(), registerOutcome.GetError().first.c_str()); + + return false; + } + + return true; + } + void Application::TearDown() { if (m_entity) diff --git a/Code/Tools/ProjectManager/Source/Application.h b/Code/Tools/ProjectManager/Source/Application.h index ad55694b18..8f633b28c4 100644 --- a/Code/Tools/ProjectManager/Source/Application.h +++ b/Code/Tools/ProjectManager/Source/Application.h @@ -34,6 +34,7 @@ namespace O3DE::ProjectManager private: bool InitLog(const char* logName); + bool RegisterEngine(bool interactive); AZStd::unique_ptr m_pythonBindings; QSharedPointer m_app; diff --git a/Code/Tools/ProjectManager/Source/EngineInfo.h b/Code/Tools/ProjectManager/Source/EngineInfo.h index 5fd3faf2ea..c28aede030 100644 --- a/Code/Tools/ProjectManager/Source/EngineInfo.h +++ b/Code/Tools/ProjectManager/Source/EngineInfo.h @@ -25,13 +25,16 @@ namespace O3DE::ProjectManager QString m_name; QString m_thirdPartyPath; - // from o3de_manifest.json QString m_path; + + // from o3de_manifest.json QString m_defaultProjectsFolder; QString m_defaultGemsFolder; QString m_defaultTemplatesFolder; QString m_defaultRestrictedFolder; + bool m_registered = false; + bool IsValid() const; }; } // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/EngineSettingsScreen.cpp b/Code/Tools/ProjectManager/Source/EngineSettingsScreen.cpp index c7df00f423..26f5b8ae11 100644 --- a/Code/Tools/ProjectManager/Source/EngineSettingsScreen.cpp +++ b/Code/Tools/ProjectManager/Source/EngineSettingsScreen.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -114,10 +115,10 @@ namespace O3DE::ProjectManager engineInfo.m_defaultGemsFolder = m_defaultGems->lineEdit()->text(); engineInfo.m_defaultTemplatesFolder = m_defaultProjectTemplates->lineEdit()->text(); - bool result = PythonBindingsInterface::Get()->SetEngineInfo(engineInfo); + auto result = PythonBindingsInterface::Get()->SetEngineInfo(engineInfo); if (!result) { - QMessageBox::critical(this, tr("Engine Settings"), tr("Failed to save engine settings.")); + ProjectUtils::DisplayDetailedError(tr("Failed to save engine settings"), result, this); } } else diff --git a/Code/Tools/ProjectManager/Source/GemRepo/GemRepoScreen.cpp b/Code/Tools/ProjectManager/Source/GemRepo/GemRepoScreen.cpp index f62c30c280..843538d9da 100644 --- a/Code/Tools/ProjectManager/Source/GemRepo/GemRepoScreen.cpp +++ b/Code/Tools/ProjectManager/Source/GemRepo/GemRepoScreen.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -92,8 +93,7 @@ namespace O3DE::ProjectManager return; } - AZ::Outcome < void, - AZStd::pair> addGemRepoResult = PythonBindingsInterface::Get()->AddGemRepo(repoUri); + auto addGemRepoResult = PythonBindingsInterface::Get()->AddGemRepo(repoUri); if (addGemRepoResult.IsSuccess()) { Reinit(); @@ -102,20 +102,7 @@ namespace O3DE::ProjectManager else { QString failureMessage = tr("Failed to add gem repo: %1.").arg(repoUri); - if (!addGemRepoResult.GetError().second.empty()) - { - QMessageBox addRepoError; - addRepoError.setIcon(QMessageBox::Critical); - addRepoError.setWindowTitle(failureMessage); - addRepoError.setText(addGemRepoResult.GetError().first.c_str()); - addRepoError.setDetailedText(addGemRepoResult.GetError().second.c_str()); - addRepoError.exec(); - } - else - { - QMessageBox::critical(this, failureMessage, addGemRepoResult.GetError().first.c_str()); - } - + ProjectUtils::DisplayDetailedError(failureMessage, addGemRepoResult, this); AZ_Error("Project Manager", false, failureMessage.toUtf8()); } } diff --git a/Code/Tools/ProjectManager/Source/ProjectUtils.cpp b/Code/Tools/ProjectManager/Source/ProjectUtils.cpp index b7748d8aa2..209140a004 100644 --- a/Code/Tools/ProjectManager/Source/ProjectUtils.cpp +++ b/Code/Tools/ProjectManager/Source/ProjectUtils.cpp @@ -659,5 +659,24 @@ namespace O3DE::ProjectManager return AZ::Success(QString(projectBuildPath.c_str())); } + void DisplayDetailedError(const QString& title, const AZ::Outcome>& outcome, QWidget* parent) + { + const AZStd::string& generalError = outcome.GetError().first; + const AZStd::string& detailedError = outcome.GetError().second; + + if (!detailedError.empty()) + { + QMessageBox errorDialog(parent); + errorDialog.setIcon(QMessageBox::Critical); + errorDialog.setWindowTitle(title); + errorDialog.setText(generalError.c_str()); + errorDialog.setDetailedText(detailedError.c_str()); + errorDialog.exec(); + } + else + { + QMessageBox::critical(parent, title, generalError.c_str()); + } + } } // namespace ProjectUtils } // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/ProjectUtils.h b/Code/Tools/ProjectManager/Source/ProjectUtils.h index 713803c20b..8602ffa692 100644 --- a/Code/Tools/ProjectManager/Source/ProjectUtils.h +++ b/Code/Tools/ProjectManager/Source/ProjectUtils.h @@ -98,5 +98,14 @@ namespace O3DE::ProjectManager */ AZ::IO::FixedMaxPath GetEditorExecutablePath(const AZ::IO::PathView& projectPath); + + /** + * Display a dialog with general and detailed sections for the given AZ::Outcome + * @param title Dialog title + * @param outcome The AZ::Outcome with general and detailed error messages + * @param parent Optional QWidget parent + */ + void DisplayDetailedError(const QString& title, const AZ::Outcome>& outcome, QWidget* parent = nullptr); + } // namespace ProjectUtils } // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/PythonBindings.cpp b/Code/Tools/ProjectManager/Source/PythonBindings.cpp index 12f97e6d2e..00ece7396d 100644 --- a/Code/Tools/ProjectManager/Source/PythonBindings.cpp +++ b/Code/Tools/ProjectManager/Source/PythonBindings.cpp @@ -312,6 +312,7 @@ namespace O3DE::ProjectManager m_register = pybind11::module::import("o3de.register"); m_manifest = pybind11::module::import("o3de.manifest"); m_engineTemplate = pybind11::module::import("o3de.engine_template"); + m_engineProperties = pybind11::module::import("o3de.engine_properties"); m_enableGemProject = pybind11::module::import("o3de.enable_gem"); m_disableGemProject = pybind11::module::import("o3de.disable_gem"); m_editProjectProperties = pybind11::module::import("o3de.project_properties"); @@ -319,9 +320,6 @@ namespace O3DE::ProjectManager m_repo = pybind11::module::import("o3de.repo"); m_pathlib = pybind11::module::import("pathlib"); - // make sure the engine is registered - RegisterThisEngine(); - m_pythonStarted = !PyErr_Occurred(); return m_pythonStarted; } @@ -346,36 +344,6 @@ namespace O3DE::ProjectManager return !PyErr_Occurred(); } - bool PythonBindings::RegisterThisEngine() - { - bool registrationResult = true; // already registered is considered successful - bool pythonResult = ExecuteWithLock( - [&] - { - // check current engine path against all other registered engines - // to see if we are already registered - auto allEngines = m_manifest.attr("get_engines")(); - if (pybind11::isinstance(allEngines)) - { - for (auto engine : allEngines) - { - AZ::IO::FixedMaxPath enginePath(Py_To_String(engine)); - if (enginePath.Compare(m_enginePath) == 0) - { - return; - } - } - } - - auto result = m_register.attr("register")(QString_To_Py_Path(QString(m_enginePath.c_str()))); - registrationResult = (result.cast() == 0); - }); - - bool finalResult = (registrationResult && pythonResult); - AZ_Assert(finalResult, "Registration of this engine failed!"); - return finalResult; - } - AZ::Outcome PythonBindings::ExecuteWithLockErrorHandling(AZStd::function executionCallback) { if (!Py_IsInitialized()) @@ -407,16 +375,22 @@ namespace O3DE::ProjectManager return ExecuteWithLockErrorHandling(executionCallback).IsSuccess(); } - AZ::Outcome PythonBindings::GetEngineInfo() + EngineInfo PythonBindings::EngineInfoFromPath(pybind11::handle enginePath) { EngineInfo engineInfo; - bool result = ExecuteWithLock([&] { - auto enginePath = m_manifest.attr("get_this_engine_path")(); + try + { + auto engineData = m_manifest.attr("get_engine_json_data")(pybind11::none(), enginePath); + if (pybind11::isinstance(engineData)) + { + engineInfo.m_version = Py_To_String_Optional(engineData, "O3DEVersion", "0.0.0.0"); + engineInfo.m_name = Py_To_String_Optional(engineData, "engine_name", "O3DE"); + engineInfo.m_path = Py_To_String(enginePath); + } auto o3deData = m_manifest.attr("load_o3de_manifest")(); if (pybind11::isinstance(o3deData)) { - engineInfo.m_path = Py_To_String(enginePath); auto defaultGemsFolder = m_manifest.attr("get_o3de_gems_folder")(); engineInfo.m_defaultGemsFolder = Py_To_String_Optional(o3deData, "default_gems_folder", Py_To_String(defaultGemsFolder)); @@ -433,19 +407,36 @@ namespace O3DE::ProjectManager engineInfo.m_thirdPartyPath = Py_To_String_Optional(o3deData, "default_third_party_folder", Py_To_String(defaultThirdPartyFolder)); } - auto engineData = m_manifest.attr("get_engine_json_data")(pybind11::none(), enginePath); - if (pybind11::isinstance(engineData)) + // check if engine path is registered + auto allEngines = m_manifest.attr("get_engines")(); + if (pybind11::isinstance(allEngines)) { - try - { - engineInfo.m_version = Py_To_String_Optional(engineData, "O3DEVersion", "0.0.0.0"); - engineInfo.m_name = Py_To_String_Optional(engineData, "engine_name", "O3DE"); - } - catch ([[maybe_unused]] const std::exception& e) + const AZ::IO::FixedMaxPath enginePathFixed(Py_To_String(enginePath)); + for (auto engine : allEngines) { - AZ_Warning("PythonBindings", false, "Failed to get EngineInfo from %s", Py_To_String(enginePath)); + AZ::IO::FixedMaxPath otherEnginePath(Py_To_String(engine)); + if (otherEnginePath.Compare(enginePathFixed) == 0) + { + engineInfo.m_registered = true; + break; + } } } + } + catch ([[maybe_unused]] const std::exception& e) + { + AZ_Warning("PythonBindings", false, "Failed to get EngineInfo from %s", Py_To_String(enginePath)); + } + return engineInfo; + } + + AZ::Outcome PythonBindings::GetEngineInfo() + { + EngineInfo engineInfo; + + bool result = ExecuteWithLock([&] { + auto enginePath = m_manifest.attr("get_this_engine_path")(); + engineInfo = EngineInfoFromPath(enginePath); }); if (!result || !engineInfo.IsValid()) @@ -458,10 +449,55 @@ namespace O3DE::ProjectManager } } - bool PythonBindings::SetEngineInfo(const EngineInfo& engineInfo) + AZ::Outcome PythonBindings::GetEngineInfo(const QString& engineName) { + EngineInfo engineInfo; bool result = ExecuteWithLock([&] { - auto registrationResult = m_register.attr("register")( + auto enginePathResult = m_manifest.attr("get_registered")(QString_To_Py_String(engineName)); + + // if a valid registered object is not found None is returned + if (!pybind11::isinstance(enginePathResult)) + { + engineInfo = EngineInfoFromPath(enginePathResult); + } + }); + + if (!result || !engineInfo.IsValid()) + { + return AZ::Failure(); + } + else + { + return AZ::Success(AZStd::move(engineInfo)); + } + } + + IPythonBindings::DetailedOutcome PythonBindings::SetEngineInfo(const EngineInfo& engineInfo, bool force) + { + bool registrationSuccess = false; + bool pythonSuccess = ExecuteWithLock([&] { + + EngineInfo currentEngine = EngineInfoFromPath(QString_To_Py_Path(engineInfo.m_path)); + + // be kind to source control and avoid needlessly updating engine.json + if (currentEngine.IsValid() && + (currentEngine.m_name.compare(engineInfo.m_name) != 0 || currentEngine.m_version.compare(engineInfo.m_version) != 0)) + { + auto enginePropsResult = m_engineProperties.attr("edit_engine_props")( + QString_To_Py_Path(engineInfo.m_path), + pybind11::none(), // existing engine_name + QString_To_Py_String(engineInfo.m_name), + QString_To_Py_String(engineInfo.m_version) + ); + + if (enginePropsResult.cast() != 0) + { + // do not proceed with registration + return; + } + } + + auto result = m_register.attr("register")( QString_To_Py_Path(engineInfo.m_path), pybind11::none(), // project_path pybind11::none(), // gem_path @@ -474,16 +510,22 @@ namespace O3DE::ProjectManager QString_To_Py_Path(engineInfo.m_defaultGemsFolder), QString_To_Py_Path(engineInfo.m_defaultTemplatesFolder), pybind11::none(), // default_restricted_folder - QString_To_Py_Path(engineInfo.m_thirdPartyPath) - ); + QString_To_Py_Path(engineInfo.m_thirdPartyPath), + pybind11::none(), // external_subdir_engine_path + pybind11::none(), // external_subdir_project_path + false, // remove + force + ); - if (registrationResult.cast() != 0) - { - result = false; - } + registrationSuccess = result.cast() == 0; }); - return result; + if (pythonSuccess && registrationSuccess) + { + return AZ::Success(); + } + + return AZ::Failure(GetErrorPair()); } AZ::Outcome PythonBindings::GetGemInfo(const QString& path, const QString& projectPath) @@ -1064,7 +1106,7 @@ namespace O3DE::ProjectManager return result && refreshResult; } - AZ::Outcome> PythonBindings::AddGemRepo(const QString& repoUri) + IPythonBindings::DetailedOutcome PythonBindings::AddGemRepo(const QString& repoUri) { bool registrationResult = false; bool result = ExecuteWithLock( @@ -1080,7 +1122,7 @@ namespace O3DE::ProjectManager if (!result || !registrationResult) { - return AZ::Failure>(GetSimpleDetailedErrorPair()); + return AZ::Failure(GetErrorPair()); } return AZ::Success(); @@ -1170,13 +1212,10 @@ namespace O3DE::ProjectManager return gemRepoInfo; } -//#define MOCK_GEM_REPO_INFO true - AZ::Outcome, AZStd::string> PythonBindings::GetAllGemRepoInfos() { QVector gemRepos; -#ifndef MOCK_GEM_REPO_INFO auto result = ExecuteWithLockErrorHandling( [&] { @@ -1189,18 +1228,6 @@ namespace O3DE::ProjectManager { return AZ::Failure(result.GetError().c_str()); } -#else - GemRepoInfo mockJohnRepo("JohnCreates", "John Smith", QDateTime(QDate(2021, 8, 31), QTime(11, 57)), true); - mockJohnRepo.m_summary = "John's Summary. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sollicitudin dapibus urna"; - mockJohnRepo.m_repoUri = "https://github.com/o3de/o3de"; - mockJohnRepo.m_additionalInfo = "John's additional info. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sollicitu."; - gemRepos.push_back(mockJohnRepo); - - GemRepoInfo mockJaneRepo("JanesGems", "Jane Doe", QDateTime(QDate(2021, 9, 10), QTime(18, 23)), false); - mockJaneRepo.m_summary = "Jane's Summary."; - mockJaneRepo.m_repoUri = "https://github.com/o3de/o3de.org"; - gemRepos.push_back(mockJaneRepo); -#endif // MOCK_GEM_REPO_INFO std::sort(gemRepos.begin(), gemRepos.end()); return AZ::Success(AZStd::move(gemRepos)); @@ -1261,7 +1288,7 @@ namespace O3DE::ProjectManager return AZ::Success(AZStd::move(gemInfos)); } - AZ::Outcome> PythonBindings::DownloadGem( + IPythonBindings::DetailedOutcome PythonBindings::DownloadGem( const QString& gemName, std::function gemProgressCallback, bool force) { // This process is currently limited to download a single gem at a time. @@ -1290,12 +1317,12 @@ namespace O3DE::ProjectManager if (!result.IsSuccess()) { - AZStd::pair pythonRunError(result.GetError(), result.GetError()); - return AZ::Failure>(AZStd::move(pythonRunError)); + IPythonBindings::ErrorPair pythonRunError(result.GetError(), result.GetError()); + return AZ::Failure(AZStd::move(pythonRunError)); } else if (!downloadSucceeded) { - return AZ::Failure>(GetSimpleDetailedErrorPair()); + return AZ::Failure(GetErrorPair()); } return AZ::Success(); @@ -1322,13 +1349,13 @@ namespace O3DE::ProjectManager return result && updateAvaliableResult; } - AZStd::pair PythonBindings::GetSimpleDetailedErrorPair() + IPythonBindings::ErrorPair PythonBindings::GetErrorPair() { AZStd::string detailedString = m_pythonErrorStrings.size() == 1 ? "" : AZStd::accumulate(m_pythonErrorStrings.begin(), m_pythonErrorStrings.end(), AZStd::string("")); - return AZStd::pair(m_pythonErrorStrings.front(), detailedString); + return IPythonBindings::ErrorPair(m_pythonErrorStrings.front(), detailedString); } void PythonBindings::AddErrorString(AZStd::string errorString) diff --git a/Code/Tools/ProjectManager/Source/PythonBindings.h b/Code/Tools/ProjectManager/Source/PythonBindings.h index 48841b6565..e2a8109128 100644 --- a/Code/Tools/ProjectManager/Source/PythonBindings.h +++ b/Code/Tools/ProjectManager/Source/PythonBindings.h @@ -35,7 +35,8 @@ namespace O3DE::ProjectManager // Engine AZ::Outcome GetEngineInfo() override; - bool SetEngineInfo(const EngineInfo& engineInfo) override; + AZ::Outcome GetEngineInfo(const QString& engineName) override; + DetailedOutcome SetEngineInfo(const EngineInfo& engineInfo, bool force = false) override; // Gem AZ::Outcome GetGemInfo(const QString& path, const QString& projectPath = {}) override; @@ -62,12 +63,12 @@ namespace O3DE::ProjectManager // Gem Repos AZ::Outcome RefreshGemRepo(const QString& repoUri) override; bool RefreshAllGemRepos() override; - AZ::Outcome> AddGemRepo(const QString& repoUri) override; + DetailedOutcome AddGemRepo(const QString& repoUri) override; bool RemoveGemRepo(const QString& repoUri) override; AZ::Outcome, AZStd::string> GetAllGemRepoInfos() override; AZ::Outcome, AZStd::string> GetGemInfosForRepo(const QString& repoUri) override; AZ::Outcome, AZStd::string> GetGemInfosForAllRepos() override; - AZ::Outcome> DownloadGem( + DetailedOutcome DownloadGem( const QString& gemName, std::function gemProgressCallback, bool force = false) override; void CancelDownload() override; bool IsGemUpdateAvaliable(const QString& gemName, const QString& lastUpdated) override; @@ -80,14 +81,14 @@ namespace O3DE::ProjectManager AZ::Outcome ExecuteWithLockErrorHandling(AZStd::function executionCallback); bool ExecuteWithLock(AZStd::function executionCallback); + EngineInfo EngineInfoFromPath(pybind11::handle enginePath); GemInfo GemInfoFromPath(pybind11::handle path, pybind11::handle pyProjectPath); GemRepoInfo GetGemRepoInfo(pybind11::handle repoUri); ProjectInfo ProjectInfoFromPath(pybind11::handle path); ProjectTemplateInfo ProjectTemplateInfoFromPath(pybind11::handle path, pybind11::handle pyProjectPath); AZ::Outcome GemRegistration(const QString& gemPath, const QString& projectPath, bool remove = false); - bool RegisterThisEngine(); bool StopPython(); - AZStd::pair GetSimpleDetailedErrorPair(); + IPythonBindings::ErrorPair GetErrorPair(); bool m_pythonStarted = false; @@ -96,6 +97,7 @@ namespace O3DE::ProjectManager AZStd::recursive_mutex m_lock; pybind11::handle m_engineTemplate; + pybind11::handle m_engineProperties; pybind11::handle m_cmake; pybind11::handle m_register; pybind11::handle m_manifest; diff --git a/Code/Tools/ProjectManager/Source/PythonBindingsInterface.h b/Code/Tools/ProjectManager/Source/PythonBindingsInterface.h index c7c8af2ce1..a42ff310c3 100644 --- a/Code/Tools/ProjectManager/Source/PythonBindingsInterface.h +++ b/Code/Tools/ProjectManager/Source/PythonBindingsInterface.h @@ -31,6 +31,10 @@ namespace O3DE::ProjectManager IPythonBindings() = default; virtual ~IPythonBindings() = default; + //! First string in pair is general error, second is detailed + using ErrorPair = AZStd::pair; + using DetailedOutcome = AZ::Outcome; + /** * Get whether Python was started or not. All Python functionality will fail if Python * failed to start. @@ -49,17 +53,25 @@ namespace O3DE::ProjectManager // Engine /** - * Get info about the engine + * Get info about the current engine * @return an outcome with EngineInfo on success */ virtual AZ::Outcome GetEngineInfo() = 0; + /** + * Get info about an engine by name + * @param engineName The name of the engine to get info about + * @return an outcome with EngineInfo on success + */ + virtual AZ::Outcome GetEngineInfo(const QString& engineName) = 0; + /** * Set info about the engine + * @param force True to force registration even if an engine with the same name is already registered * @param engineInfo an EngineInfo object + * @return a detailed error outcome on failure. */ - virtual bool SetEngineInfo(const EngineInfo& engineInfo) = 0; - + virtual DetailedOutcome SetEngineInfo(const EngineInfo& engineInfo, bool force = false) = 0; // Gems @@ -202,7 +214,7 @@ namespace O3DE::ProjectManager * @param repoUri the absolute filesystem path or url to the gem repo. * @return an outcome with a pair of string error and detailed messages on failure. */ - virtual AZ::Outcome> AddGemRepo(const QString& repoUri) = 0; + virtual DetailedOutcome AddGemRepo(const QString& repoUri) = 0; /** * Unregisters this gem repo with the current engine. @@ -237,7 +249,7 @@ namespace O3DE::ProjectManager * @param force should we forcibly overwrite the old version of the gem. * @return an outcome with a pair of string error and detailed messages on failure. */ - virtual AZ::Outcome> DownloadGem( + virtual DetailedOutcome DownloadGem( const QString& gemName, std::function gemProgressCallback, bool force = false) = 0; /** diff --git a/scripts/o3de/o3de/engine_properties.py b/scripts/o3de/o3de/engine_properties.py index 92930dbb1c..56cb71f258 100644 --- a/scripts/o3de/o3de/engine_properties.py +++ b/scripts/o3de/o3de/engine_properties.py @@ -25,6 +25,11 @@ def edit_engine_props(engine_path: pathlib.Path = None, if not engine_path and not engine_name: logger.error(f'Either a engine path or a engine name must be supplied to lookup engine.json') return 1 + + if not new_name and not new_version: + logger.error('A new engine name or new version, or both must be supplied.') + return 1 + if not engine_path: engine_path = manifest.get_registered(engine_name=engine_name) diff --git a/scripts/o3de/o3de/manifest.py b/scripts/o3de/o3de/manifest.py index e46b819a7c..c06a4d12fc 100644 --- a/scripts/o3de/o3de/manifest.py +++ b/scripts/o3de/o3de/manifest.py @@ -599,75 +599,93 @@ def get_registered(engine_name: str = None, engine_path = pathlib.Path(engine).resolve() engine_json = engine_path / 'engine.json' - with engine_json.open('r') as f: - try: - engine_json_data = json.load(f) - except json.JSONDecodeError as e: - logger.warning(f'{engine_json} failed to load: {str(e)}') - else: - this_engines_name = engine_json_data['engine_name'] - if this_engines_name == engine_name: - return engine_path + if not pathlib.Path(engine_json).is_file(): + logger.warning(f'{engine_json} does not exist') + else: + with engine_json.open('r') as f: + try: + engine_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warning(f'{engine_json} failed to load: {str(e)}') + else: + this_engines_name = engine_json_data['engine_name'] + if this_engines_name == engine_name: + return engine_path + engines_path = json_data.get('engines_path', {}) + if engine_name in engines_path: + return pathlib.Path(engines_path[engine_name]).resolve() elif isinstance(project_name, str): projects = get_all_projects() for project_path in projects: project_path = pathlib.Path(project_path).resolve() project_json = project_path / 'project.json' - with project_json.open('r') as f: - try: - project_json_data = json.load(f) - except json.JSONDecodeError as e: - logger.warning(f'{project_json} failed to load: {str(e)}') - else: - this_projects_name = project_json_data['project_name'] - if this_projects_name == project_name: - return project_path + if not pathlib.Path(project_json).is_file(): + logger.warning(f'{project_json} does not exist') + else: + with project_json.open('r') as f: + try: + project_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warning(f'{project_json} failed to load: {str(e)}') + else: + this_projects_name = project_json_data['project_name'] + if this_projects_name == project_name: + return project_path elif isinstance(gem_name, str): gems = get_all_gems(project_path) for gem_path in gems: gem_path = pathlib.Path(gem_path).resolve() gem_json = gem_path / 'gem.json' - with gem_json.open('r') as f: - try: - gem_json_data = json.load(f) - except json.JSONDecodeError as e: - logger.warning(f'{gem_json} failed to load: {str(e)}') - else: - this_gems_name = gem_json_data['gem_name'] - if this_gems_name == gem_name: - return gem_path + if not pathlib.Path(gem_json).is_file(): + logger.warning(f'{gem_json} does not exist') + else: + with gem_json.open('r') as f: + try: + gem_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warning(f'{gem_json} failed to load: {str(e)}') + else: + this_gems_name = gem_json_data['gem_name'] + if this_gems_name == gem_name: + return gem_path elif isinstance(template_name, str): templates = get_all_templates(project_path) for template_path in templates: template_path = pathlib.Path(template_path).resolve() template_json = template_path / 'template.json' - with template_json.open('r') as f: - try: - template_json_data = json.load(f) - except json.JSONDecodeError as e: - logger.warning(f'{template_path} failed to load: {str(e)}') - else: - this_templates_name = template_json_data['template_name'] - if this_templates_name == template_name: - return template_path + if not pathlib.Path(template_json).is_file(): + logger.warning(f'{template_json} does not exist') + else: + with template_json.open('r') as f: + try: + template_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warning(f'{template_path} failed to load: {str(e)}') + else: + this_templates_name = template_json_data['template_name'] + if this_templates_name == template_name: + return template_path elif isinstance(restricted_name, str): restricted = get_all_restricted(project_path) for restricted_path in restricted: restricted_path = pathlib.Path(restricted_path).resolve() restricted_json = restricted_path / 'restricted.json' - with restricted_json.open('r') as f: - try: - restricted_json_data = json.load(f) - except json.JSONDecodeError as e: - logger.warning(f'{restricted_json} failed to load: {str(e)}') - else: - this_restricted_name = restricted_json_data['restricted_name'] - if this_restricted_name == restricted_name: - return restricted_path + if not pathlib.Path(restricted_json).is_file(): + logger.warning(f'{restricted_json} does not exist') + else: + with restricted_json.open('r') as f: + try: + restricted_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warning(f'{restricted_json} failed to load: {str(e)}') + else: + this_restricted_name = restricted_json_data['restricted_name'] + if this_restricted_name == restricted_name: + return restricted_path elif isinstance(default_folder, str): if default_folder == 'engines': From 7bba4172ece3aa4d44c9ac1970d7e8c667fc582a Mon Sep 17 00:00:00 2001 From: amzn-sj Date: Wed, 19 Jan 2022 18:04:56 -0800 Subject: [PATCH 563/948] Add a GetNumSamplesFromRegion function which returns the number of samples given a region and step size. Update Terrain Feature Processor to use this function to get the number of samples instead of computing num samples independently. Signed-off-by: amzn-sj --- .../Terrain/TerrainDataRequestBus.h | 4 ++++ .../Mocks/Terrain/MockTerrainDataRequestBus.h | 2 ++ .../TerrainFeatureProcessor.cpp | 24 +++++++++++-------- .../Source/TerrainSystem/TerrainSystem.cpp | 10 ++++++++ .../Code/Source/TerrainSystem/TerrainSystem.h | 4 ++++ 5 files changed, 34 insertions(+), 10 deletions(-) diff --git a/Code/Framework/AzFramework/AzFramework/Terrain/TerrainDataRequestBus.h b/Code/Framework/AzFramework/AzFramework/Terrain/TerrainDataRequestBus.h index 0d16bf3460..9379485646 100644 --- a/Code/Framework/AzFramework/AzFramework/Terrain/TerrainDataRequestBus.h +++ b/Code/Framework/AzFramework/AzFramework/Terrain/TerrainDataRequestBus.h @@ -161,6 +161,10 @@ namespace AzFramework SurfacePointListFillCallback perPositionCallback, Sampler sampleFilter = Sampler::DEFAULT) const = 0; + //! Returns the number of samples for a given region and step size. + virtual AZStd::pair GetNumSamplesFromRegion(const AZ::Aabb& inRegion, + const AZ::Vector2& stepSize) const = 0; + //! Given a region(aabb) and a step size, call the provided callback function with surface data corresponding to the //! coordinates in the region. virtual void ProcessHeightsFromRegion(const AZ::Aabb& inRegion, diff --git a/Code/Framework/AzFramework/Tests/Mocks/Terrain/MockTerrainDataRequestBus.h b/Code/Framework/AzFramework/Tests/Mocks/Terrain/MockTerrainDataRequestBus.h index f3a6cc07b3..52ac28ef63 100644 --- a/Code/Framework/AzFramework/Tests/Mocks/Terrain/MockTerrainDataRequestBus.h +++ b/Code/Framework/AzFramework/Tests/Mocks/Terrain/MockTerrainDataRequestBus.h @@ -92,6 +92,8 @@ namespace UnitTest ProcessSurfaceWeightsFromListOfVector2, void(const AZStd::span&, AzFramework::Terrain::SurfacePointListFillCallback, Sampler)); MOCK_CONST_METHOD3( ProcessSurfacePointsFromListOfVector2, void(const AZStd::span&, AzFramework::Terrain::SurfacePointListFillCallback, Sampler)); + MOCK_CONST_METHOD2( + GetNumSamplesFromRegion, AZStd::pair(const AZ::Aabb&, const AZ::Vector2&)); MOCK_CONST_METHOD4( ProcessHeightsFromRegion, void(const AZ::Aabb&, const AZ::Vector2&, AzFramework::Terrain::SurfacePointRegionFillCallback, Sampler)); MOCK_CONST_METHOD4( diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainFeatureProcessor.cpp b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainFeatureProcessor.cpp index ebc8a16fcb..4232a37264 100644 --- a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainFeatureProcessor.cpp +++ b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainFeatureProcessor.cpp @@ -208,12 +208,21 @@ namespace Terrain } int32_t xStart = aznumeric_cast(AZStd::ceilf(m_dirtyRegion.GetMin().GetX() / m_sampleSpacing)); - int32_t xEnd = aznumeric_cast(AZStd::floorf(m_dirtyRegion.GetMax().GetX() / m_sampleSpacing)) + 1; int32_t yStart = aznumeric_cast(AZStd::ceilf(m_dirtyRegion.GetMin().GetY() / m_sampleSpacing)); - int32_t yEnd = aznumeric_cast(AZStd::floorf(m_dirtyRegion.GetMax().GetY() / m_sampleSpacing)) + 1; - uint32_t updateWidth = xEnd - xStart; - uint32_t updateHeight = yEnd - yStart; + AZ::Vector2 stepSize(m_sampleSpacing); + AZ::Vector3 maxBound( + m_dirtyRegion.GetMax().GetX() + m_sampleSpacing, m_dirtyRegion.GetMax().GetY() + m_sampleSpacing, 0.0f); + AZ::Aabb region; + region.Set(m_dirtyRegion.GetMin(), maxBound); + + AZStd::pair numSamples; + AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult( + numSamples, &AzFramework::Terrain::TerrainDataRequests::GetNumSamplesFromRegion, + region, stepSize); + + uint32_t updateWidth = numSamples.first; + uint32_t updateHeight = numSamples.second; AZStd::vector pixels; pixels.reserve(updateWidth * updateHeight); { @@ -238,14 +247,9 @@ namespace Terrain pixels.push_back(uint16Height); }; - AZ::Vector2 stepSize(m_sampleSpacing); - AZ::Vector3 maxBound( - m_dirtyRegion.GetMax().GetX() + m_sampleSpacing, m_dirtyRegion.GetMax().GetY() + m_sampleSpacing, 0.0f); - AZ::Aabb region; - region.Set(m_dirtyRegion.GetMin(), maxBound); AzFramework::Terrain::TerrainDataRequestBus::Broadcast( &AzFramework::Terrain::TerrainDataRequests::ProcessHeightsFromRegion, - region, stepSize, perPositionCallback,AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT); + region, stepSize, perPositionCallback, AzFramework::Terrain::TerrainDataRequests::Sampler::EXACT); } if (m_heightmapImage) diff --git a/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.cpp b/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.cpp index 2ecd13b5ad..4dfa03ed53 100644 --- a/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.cpp +++ b/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.cpp @@ -690,6 +690,16 @@ void TerrainSystem::ProcessSurfacePointsFromListOfVector2( } } +AZStd::pair TerrainSystem::GetNumSamplesFromRegion( + const AZ::Aabb& inRegion, + const AZ::Vector2& stepSize) const +{ + const size_t numSamplesX = aznumeric_cast(ceil(inRegion.GetExtents().GetX() / stepSize.GetX())); + const size_t numSamplesY = aznumeric_cast(ceil(inRegion.GetExtents().GetY() / stepSize.GetY())); + + return AZStd::make_pair(numSamplesX, numSamplesY); +} + void TerrainSystem::ProcessHeightsFromRegion( const AZ::Aabb& inRegion, const AZ::Vector2& stepSize, diff --git a/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.h b/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.h index 7c6e0cd91e..2296d48843 100644 --- a/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.h +++ b/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.h @@ -163,6 +163,10 @@ namespace Terrain AzFramework::Terrain::SurfacePointListFillCallback perPositionCallback, Sampler sampleFilter = Sampler::DEFAULT) const override; + //! Returns the number of samples for a given region and step size. + virtual AZStd::pair GetNumSamplesFromRegion(const AZ::Aabb& inRegion, + const AZ::Vector2& stepSize) const override; + //! Given a region(aabb) and a step size, call the provided callback function with surface data corresponding to the //! coordinates in the region. virtual void ProcessHeightsFromRegion(const AZ::Aabb& inRegion, From c27f73c66be8e8b86456f9601bab218c8be6ab31 Mon Sep 17 00:00:00 2001 From: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> Date: Wed, 19 Jan 2022 20:17:15 -0700 Subject: [PATCH 564/948] Added a NumRaysPerProbe DiffuseProbeGrid setting Added supervariants to the precompiled DiffuseProbeGrid shaders for the NumRaysPerProbe values Signed-off-by: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> --- ...seProbeGridBlendDistance.precompiledshader | 126 ++++++++++++++++++ ...ProbeGridBlendIrradiance.precompiledshader | 126 ++++++++++++++++++ ...eProbeGridClassification.precompiledshader | 126 ++++++++++++++++++ ...numraysperprobe1008_dx12_0.azshadervariant | Bin 0 -> 8338 bytes ...numraysperprobe1008_null_0.azshadervariant | Bin 0 -> 486 bytes ...mraysperprobe1008_vulkan_0.azshadervariant | Bin 0 -> 12618 bytes ...-numraysperprobe144_dx12_0.azshadervariant | Bin 0 -> 8306 bytes ...-numraysperprobe144_null_0.azshadervariant | Bin 0 -> 486 bytes ...umraysperprobe144_vulkan_0.azshadervariant | Bin 0 -> 12618 bytes ...-numraysperprobe288_dx12_0.azshadervariant | Bin 0 -> 8338 bytes ...-numraysperprobe288_null_0.azshadervariant | Bin 0 -> 486 bytes ...umraysperprobe288_vulkan_0.azshadervariant | Bin 0 -> 12618 bytes ...-numraysperprobe432_dx12_0.azshadervariant | Bin 0 -> 8338 bytes ...-numraysperprobe432_null_0.azshadervariant | Bin 0 -> 486 bytes ...umraysperprobe432_vulkan_0.azshadervariant | Bin 0 -> 12618 bytes ...-numraysperprobe576_dx12_0.azshadervariant | Bin 0 -> 8338 bytes ...-numraysperprobe576_null_0.azshadervariant | Bin 0 -> 486 bytes ...umraysperprobe576_vulkan_0.azshadervariant | Bin 0 -> 12618 bytes ...-numraysperprobe720_dx12_0.azshadervariant | Bin 0 -> 8338 bytes ...-numraysperprobe720_null_0.azshadervariant | Bin 0 -> 486 bytes ...umraysperprobe720_vulkan_0.azshadervariant | Bin 0 -> 12618 bytes ...-numraysperprobe864_dx12_0.azshadervariant | Bin 0 -> 8338 bytes ...-numraysperprobe864_null_0.azshadervariant | Bin 0 -> 486 bytes ...umraysperprobe864_vulkan_0.azshadervariant | Bin 0 -> 12618 bytes .../diffuseprobegridblenddistance.azshader | Bin 79451 -> 626455 bytes ...begridblenddistance_dx12_0.azshadervariant | Bin 8338 -> 8338 bytes ...begridblenddistance_null_0.azshadervariant | Bin 486 -> 486 bytes ...gridblenddistance_vulkan_0.azshadervariant | Bin 12618 -> 12618 bytes ...numraysperprobe1008_dx12_0.azshadervariant | Bin 0 -> 9310 bytes ...numraysperprobe1008_null_0.azshadervariant | Bin 0 -> 486 bytes ...mraysperprobe1008_vulkan_0.azshadervariant | Bin 0 -> 15030 bytes ...-numraysperprobe144_dx12_0.azshadervariant | Bin 0 -> 9314 bytes ...-numraysperprobe144_null_0.azshadervariant | Bin 0 -> 486 bytes ...umraysperprobe144_vulkan_0.azshadervariant | Bin 0 -> 15030 bytes ...-numraysperprobe288_dx12_0.azshadervariant | Bin 0 -> 9314 bytes ...-numraysperprobe288_null_0.azshadervariant | Bin 0 -> 486 bytes ...umraysperprobe288_vulkan_0.azshadervariant | Bin 0 -> 15030 bytes ...-numraysperprobe432_dx12_0.azshadervariant | Bin 0 -> 9310 bytes ...-numraysperprobe432_null_0.azshadervariant | Bin 0 -> 486 bytes ...umraysperprobe432_vulkan_0.azshadervariant | Bin 0 -> 15030 bytes ...-numraysperprobe576_dx12_0.azshadervariant | Bin 0 -> 9314 bytes ...-numraysperprobe576_null_0.azshadervariant | Bin 0 -> 486 bytes ...umraysperprobe576_vulkan_0.azshadervariant | Bin 0 -> 15030 bytes ...-numraysperprobe720_dx12_0.azshadervariant | Bin 0 -> 9310 bytes ...-numraysperprobe720_null_0.azshadervariant | Bin 0 -> 486 bytes ...umraysperprobe720_vulkan_0.azshadervariant | Bin 0 -> 15030 bytes ...-numraysperprobe864_dx12_0.azshadervariant | Bin 0 -> 9310 bytes ...-numraysperprobe864_null_0.azshadervariant | Bin 0 -> 486 bytes ...umraysperprobe864_vulkan_0.azshadervariant | Bin 0 -> 15030 bytes .../diffuseprobegridblendirradiance.azshader | Bin 79495 -> 626793 bytes ...gridblendirradiance_dx12_0.azshadervariant | Bin 9314 -> 9314 bytes ...gridblendirradiance_null_0.azshadervariant | Bin 486 -> 486 bytes ...idblendirradiance_vulkan_0.azshadervariant | Bin 15030 -> 15030 bytes ...iffuseprobegridborderupdatecolumn.azshader | Bin 27583 -> 27583 bytes ...dborderupdatecolumn_dx12_0.azshadervariant | Bin 4522 -> 4522 bytes ...dborderupdatecolumn_null_0.azshadervariant | Bin 486 -> 486 bytes ...orderupdatecolumn_vulkan_0.azshadervariant | Bin 2701 -> 2701 bytes .../diffuseprobegridborderupdaterow.azshader | Bin 27580 -> 27580 bytes ...gridborderupdaterow_dx12_0.azshadervariant | Bin 4338 -> 4338 bytes ...gridborderupdaterow_null_0.azshadervariant | Bin 486 -> 486 bytes ...idborderupdaterow_vulkan_0.azshadervariant | Bin 2222 -> 2222 bytes ...numraysperprobe1008_dx12_0.azshadervariant | Bin 0 -> 6994 bytes ...numraysperprobe1008_null_0.azshadervariant | Bin 0 -> 486 bytes ...mraysperprobe1008_vulkan_0.azshadervariant | Bin 0 -> 10274 bytes ...-numraysperprobe144_dx12_0.azshadervariant | Bin 0 -> 6994 bytes ...-numraysperprobe144_null_0.azshadervariant | Bin 0 -> 486 bytes ...umraysperprobe144_vulkan_0.azshadervariant | Bin 0 -> 10274 bytes ...-numraysperprobe288_dx12_0.azshadervariant | Bin 0 -> 6994 bytes ...-numraysperprobe288_null_0.azshadervariant | Bin 0 -> 486 bytes ...umraysperprobe288_vulkan_0.azshadervariant | Bin 0 -> 10274 bytes ...-numraysperprobe432_dx12_0.azshadervariant | Bin 0 -> 6994 bytes ...-numraysperprobe432_null_0.azshadervariant | Bin 0 -> 486 bytes ...umraysperprobe432_vulkan_0.azshadervariant | Bin 0 -> 10274 bytes ...-numraysperprobe576_dx12_0.azshadervariant | Bin 0 -> 6994 bytes ...-numraysperprobe576_null_0.azshadervariant | Bin 0 -> 486 bytes ...umraysperprobe576_vulkan_0.azshadervariant | Bin 0 -> 10274 bytes ...-numraysperprobe720_dx12_0.azshadervariant | Bin 0 -> 6994 bytes ...-numraysperprobe720_null_0.azshadervariant | Bin 0 -> 486 bytes ...umraysperprobe720_vulkan_0.azshadervariant | Bin 0 -> 10274 bytes ...-numraysperprobe864_dx12_0.azshadervariant | Bin 0 -> 6994 bytes ...-numraysperprobe864_null_0.azshadervariant | Bin 0 -> 486 bytes ...umraysperprobe864_vulkan_0.azshadervariant | Bin 0 -> 10274 bytes .../diffuseprobegridclassification.azshader | Bin 76956 -> 606488 bytes ...egridclassification_dx12_0.azshadervariant | Bin 6994 -> 6994 bytes ...egridclassification_null_0.azshadervariant | Bin 486 -> 486 bytes ...ridclassification_vulkan_0.azshadervariant | Bin 10274 -> 10274 bytes .../diffuseprobegridraytracing.azshader | Bin 141617 -> 141617 bytes ...probegridraytracing_dx12_0.azshadervariant | Bin 31886 -> 31886 bytes ...probegridraytracing_null_0.azshadervariant | Bin 486 -> 486 bytes ...obegridraytracing_vulkan_0.azshadervariant | Bin 36188 -> 36188 bytes ...fuseprobegridraytracingclosesthit.azshader | Bin 141627 -> 141627 bytes ...aytracingclosesthit_dx12_0.azshadervariant | Bin 13174 -> 13174 bytes ...aytracingclosesthit_null_0.azshadervariant | Bin 486 -> 486 bytes ...tracingclosesthit_vulkan_0.azshadervariant | Bin 5364 -> 5364 bytes .../diffuseprobegridraytracingmiss.azshader | Bin 141621 -> 141621 bytes ...egridraytracingmiss_dx12_0.azshadervariant | Bin 13314 -> 13314 bytes ...egridraytracingmiss_null_0.azshadervariant | Bin 486 -> 486 bytes ...ridraytracingmiss_vulkan_0.azshadervariant | Bin 6396 -> 6396 bytes .../diffuseprobegridrelocation.azshader | Bin 79904 -> 79904 bytes ...probegridrelocation_dx12_0.azshadervariant | Bin 7994 -> 7994 bytes ...probegridrelocation_null_0.azshadervariant | Bin 486 -> 486 bytes ...obegridrelocation_vulkan_0.azshadervariant | Bin 11362 -> 11362 bytes .../diffuseprobegridrender.azshader | Bin 219075 -> 219075 bytes ...fuseprobegridrender_dx12_0.azshadervariant | Bin 30575 -> 30575 bytes ...fuseprobegridrender_null_0.azshadervariant | Bin 589 -> 589 bytes ...seprobegridrender_vulkan_0.azshadervariant | Bin 24081 -> 24081 bytes ...iffuseProbeGridFeatureProcessorInterface.h | 37 +++++ .../DiffuseProbeGrid.cpp | 10 +- .../DiffuseProbeGrid.h | 8 +- .../DiffuseProbeGridBlendDistancePass.cpp | 54 ++++---- .../DiffuseProbeGridBlendDistancePass.h | 16 ++- .../DiffuseProbeGridBlendIrradiancePass.cpp | 54 ++++---- .../DiffuseProbeGridBlendIrradiancePass.h | 16 ++- .../DiffuseProbeGridClassificationPass.cpp | 54 ++++---- .../DiffuseProbeGridClassificationPass.h | 14 +- .../DiffuseProbeGridFeatureProcessor.cpp | 6 + .../DiffuseProbeGridFeatureProcessor.h | 1 + .../DiffuseProbeGridRayTracingPass.cpp | 2 +- .../Code/Include/Atom/RPI.Public/RPIUtils.h | 6 +- .../RPI/Code/Source/RPI.Public/RPIUtils.cpp | 12 +- .../DiffuseProbeGridComponentConstants.h | 1 + .../DiffuseProbeGridComponentController.cpp | 15 ++- .../DiffuseProbeGridComponentController.h | 2 + .../EditorDiffuseProbeGridComponent.cpp | 23 ++++ .../EditorDiffuseProbeGridComponent.h | 3 + 125 files changed, 613 insertions(+), 99 deletions(-) create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe1008_dx12_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe1008_null_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe1008_vulkan_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe144_dx12_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe144_null_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe144_vulkan_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe288_dx12_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe288_null_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe288_vulkan_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe432_dx12_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe432_null_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe432_vulkan_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe576_dx12_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe576_null_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe576_vulkan_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe720_dx12_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe720_null_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe720_vulkan_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe864_dx12_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe864_null_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe864_vulkan_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe1008_dx12_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe1008_null_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe1008_vulkan_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe144_dx12_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe144_null_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe144_vulkan_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe288_dx12_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe288_null_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe288_vulkan_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe432_dx12_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe432_null_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe432_vulkan_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe576_dx12_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe576_null_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe576_vulkan_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe720_dx12_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe720_null_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe720_vulkan_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe864_dx12_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe864_null_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe864_vulkan_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe1008_dx12_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe1008_null_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe1008_vulkan_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe144_dx12_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe144_null_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe144_vulkan_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe288_dx12_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe288_null_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe288_vulkan_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe432_dx12_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe432_null_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe432_vulkan_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe576_dx12_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe576_null_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe576_vulkan_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe720_dx12_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe720_null_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe720_vulkan_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe864_dx12_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe864_null_0.azshadervariant create mode 100644 Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe864_vulkan_0.azshadervariant diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistance.precompiledshader b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistance.precompiledshader index 81d6bde5f0..98c327665e 100644 --- a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistance.precompiledshader +++ b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistance.precompiledshader @@ -29,6 +29,132 @@ "RootShaderVariantAssetFileName": "diffuseprobegridblenddistance_null_0.azshadervariant" } ] + }, + { + "Name": "NumRaysPerProbe144", + "RootShaderVariantAssets": + [ + { + "APIName": "dx12", + "RootShaderVariantAssetFileName": "diffuseprobegridblenddistance-numraysperprobe144_dx12_0.azshadervariant" + }, + { + "APIName": "vulkan", + "RootShaderVariantAssetFileName": "diffuseprobegridblenddistance-numraysperprobe144_vulkan_0.azshadervariant" + }, + { + "APIName": "null", + "RootShaderVariantAssetFileName": "diffuseprobegridblenddistance-numraysperprobe144_null_0.azshadervariant" + } + ] + }, + { + "Name": "NumRaysPerProbe288", + "RootShaderVariantAssets": + [ + { + "APIName": "dx12", + "RootShaderVariantAssetFileName": "diffuseprobegridblenddistance-numraysperprobe288_dx12_0.azshadervariant" + }, + { + "APIName": "vulkan", + "RootShaderVariantAssetFileName": "diffuseprobegridblenddistance-numraysperprobe288_vulkan_0.azshadervariant" + }, + { + "APIName": "null", + "RootShaderVariantAssetFileName": "diffuseprobegridblenddistance-numraysperprobe288_null_0.azshadervariant" + } + ] + }, + { + "Name": "NumRaysPerProbe432", + "RootShaderVariantAssets": + [ + { + "APIName": "dx12", + "RootShaderVariantAssetFileName": "diffuseprobegridblenddistance-numraysperprobe432_dx12_0.azshadervariant" + }, + { + "APIName": "vulkan", + "RootShaderVariantAssetFileName": "diffuseprobegridblenddistance-numraysperprobe432_vulkan_0.azshadervariant" + }, + { + "APIName": "null", + "RootShaderVariantAssetFileName": "diffuseprobegridblenddistance-numraysperprobe432_null_0.azshadervariant" + } + ] + }, + { + "Name": "NumRaysPerProbe576", + "RootShaderVariantAssets": + [ + { + "APIName": "dx12", + "RootShaderVariantAssetFileName": "diffuseprobegridblenddistance-numraysperprobe576_dx12_0.azshadervariant" + }, + { + "APIName": "vulkan", + "RootShaderVariantAssetFileName": "diffuseprobegridblenddistance-numraysperprobe576_vulkan_0.azshadervariant" + }, + { + "APIName": "null", + "RootShaderVariantAssetFileName": "diffuseprobegridblenddistance-numraysperprobe576_null_0.azshadervariant" + } + ] + }, + { + "Name": "NumRaysPerProbe720", + "RootShaderVariantAssets": + [ + { + "APIName": "dx12", + "RootShaderVariantAssetFileName": "diffuseprobegridblenddistance-numraysperprobe720_dx12_0.azshadervariant" + }, + { + "APIName": "vulkan", + "RootShaderVariantAssetFileName": "diffuseprobegridblenddistance-numraysperprobe720_vulkan_0.azshadervariant" + }, + { + "APIName": "null", + "RootShaderVariantAssetFileName": "diffuseprobegridblenddistance-numraysperprobe720_null_0.azshadervariant" + } + ] + }, + { + "Name": "NumRaysPerProbe864", + "RootShaderVariantAssets": + [ + { + "APIName": "dx12", + "RootShaderVariantAssetFileName": "diffuseprobegridblenddistance-numraysperprobe864_dx12_0.azshadervariant" + }, + { + "APIName": "vulkan", + "RootShaderVariantAssetFileName": "diffuseprobegridblenddistance-numraysperprobe864_vulkan_0.azshadervariant" + }, + { + "APIName": "null", + "RootShaderVariantAssetFileName": "diffuseprobegridblenddistance-numraysperprobe864_null_0.azshadervariant" + } + ] + }, + { + "Name": "NumRaysPerProbe1008", + "RootShaderVariantAssets": + [ + { + "APIName": "dx12", + "RootShaderVariantAssetFileName": "diffuseprobegridblenddistance-numraysperprobe1008_dx12_0.azshadervariant" + }, + { + "APIName": "vulkan", + "RootShaderVariantAssetFileName": "diffuseprobegridblenddistance-numraysperprobe1008_vulkan_0.azshadervariant" + }, + { + "APIName": "null", + "RootShaderVariantAssetFileName": "diffuseprobegridblenddistance-numraysperprobe1008_null_0.azshadervariant" + } + ] } ] } diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiance.precompiledshader b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiance.precompiledshader index 9fa8e27461..c4d2dac642 100644 --- a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiance.precompiledshader +++ b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiance.precompiledshader @@ -29,6 +29,132 @@ "RootShaderVariantAssetFileName": "diffuseprobegridblendirradiance_null_0.azshadervariant" } ] + }, + { + "Name": "NumRaysPerProbe144", + "RootShaderVariantAssets": + [ + { + "APIName": "dx12", + "RootShaderVariantAssetFileName": "diffuseprobegridblendirradiance-numraysperprobe144_dx12_0.azshadervariant" + }, + { + "APIName": "vulkan", + "RootShaderVariantAssetFileName": "diffuseprobegridblendirradiance-numraysperprobe144_vulkan_0.azshadervariant" + }, + { + "APIName": "null", + "RootShaderVariantAssetFileName": "diffuseprobegridblendirradiance-numraysperprobe144_null_0.azshadervariant" + } + ] + }, + { + "Name": "NumRaysPerProbe288", + "RootShaderVariantAssets": + [ + { + "APIName": "dx12", + "RootShaderVariantAssetFileName": "diffuseprobegridblendirradiance-numraysperprobe288_dx12_0.azshadervariant" + }, + { + "APIName": "vulkan", + "RootShaderVariantAssetFileName": "diffuseprobegridblendirradiance-numraysperprobe288_vulkan_0.azshadervariant" + }, + { + "APIName": "null", + "RootShaderVariantAssetFileName": "diffuseprobegridblendirradiance-numraysperprobe288_null_0.azshadervariant" + } + ] + }, + { + "Name": "NumRaysPerProbe432", + "RootShaderVariantAssets": + [ + { + "APIName": "dx12", + "RootShaderVariantAssetFileName": "diffuseprobegridblendirradiance-numraysperprobe432_dx12_0.azshadervariant" + }, + { + "APIName": "vulkan", + "RootShaderVariantAssetFileName": "diffuseprobegridblendirradiance-numraysperprobe432_vulkan_0.azshadervariant" + }, + { + "APIName": "null", + "RootShaderVariantAssetFileName": "diffuseprobegridblendirradiance-numraysperprobe432_null_0.azshadervariant" + } + ] + }, + { + "Name": "NumRaysPerProbe576", + "RootShaderVariantAssets": + [ + { + "APIName": "dx12", + "RootShaderVariantAssetFileName": "diffuseprobegridblendirradiance-numraysperprobe576_dx12_0.azshadervariant" + }, + { + "APIName": "vulkan", + "RootShaderVariantAssetFileName": "diffuseprobegridblendirradiance-numraysperprobe576_vulkan_0.azshadervariant" + }, + { + "APIName": "null", + "RootShaderVariantAssetFileName": "diffuseprobegridblendirradiance-numraysperprobe576_null_0.azshadervariant" + } + ] + }, + { + "Name": "NumRaysPerProbe720", + "RootShaderVariantAssets": + [ + { + "APIName": "dx12", + "RootShaderVariantAssetFileName": "diffuseprobegridblendirradiance-numraysperprobe720_dx12_0.azshadervariant" + }, + { + "APIName": "vulkan", + "RootShaderVariantAssetFileName": "diffuseprobegridblendirradiance-numraysperprobe720_vulkan_0.azshadervariant" + }, + { + "APIName": "null", + "RootShaderVariantAssetFileName": "diffuseprobegridblendirradiance-numraysperprobe720_null_0.azshadervariant" + } + ] + }, + { + "Name": "NumRaysPerProbe864", + "RootShaderVariantAssets": + [ + { + "APIName": "dx12", + "RootShaderVariantAssetFileName": "diffuseprobegridblendirradiance-numraysperprobe864_dx12_0.azshadervariant" + }, + { + "APIName": "vulkan", + "RootShaderVariantAssetFileName": "diffuseprobegridblendirradiance-numraysperprobe864_vulkan_0.azshadervariant" + }, + { + "APIName": "null", + "RootShaderVariantAssetFileName": "diffuseprobegridblendirradiance-numraysperprobe864_null_0.azshadervariant" + } + ] + }, + { + "Name": "NumRaysPerProbe1008", + "RootShaderVariantAssets": + [ + { + "APIName": "dx12", + "RootShaderVariantAssetFileName": "diffuseprobegridblendirradiance-numraysperprobe1008_dx12_0.azshadervariant" + }, + { + "APIName": "vulkan", + "RootShaderVariantAssetFileName": "diffuseprobegridblendirradiance-numraysperprobe1008_vulkan_0.azshadervariant" + }, + { + "APIName": "null", + "RootShaderVariantAssetFileName": "diffuseprobegridblendirradiance-numraysperprobe1008_null_0.azshadervariant" + } + ] } ] } diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridClassification.precompiledshader b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridClassification.precompiledshader index 66671fd7bc..5a34cc5b15 100644 --- a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridClassification.precompiledshader +++ b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridClassification.precompiledshader @@ -29,6 +29,132 @@ "RootShaderVariantAssetFileName": "diffuseprobegridclassification_null_0.azshadervariant" } ] + }, + { + "Name": "NumRaysPerProbe144", + "RootShaderVariantAssets": + [ + { + "APIName": "dx12", + "RootShaderVariantAssetFileName": "diffuseprobegridclassification-numraysperprobe144_dx12_0.azshadervariant" + }, + { + "APIName": "vulkan", + "RootShaderVariantAssetFileName": "diffuseprobegridclassification-numraysperprobe144_vulkan_0.azshadervariant" + }, + { + "APIName": "null", + "RootShaderVariantAssetFileName": "diffuseprobegridclassification-numraysperprobe144_null_0.azshadervariant" + } + ] + }, + { + "Name": "NumRaysPerProbe288", + "RootShaderVariantAssets": + [ + { + "APIName": "dx12", + "RootShaderVariantAssetFileName": "diffuseprobegridclassification-numraysperprobe288_dx12_0.azshadervariant" + }, + { + "APIName": "vulkan", + "RootShaderVariantAssetFileName": "diffuseprobegridclassification-numraysperprobe288_vulkan_0.azshadervariant" + }, + { + "APIName": "null", + "RootShaderVariantAssetFileName": "diffuseprobegridclassification-numraysperprobe288_null_0.azshadervariant" + } + ] + }, + { + "Name": "NumRaysPerProbe432", + "RootShaderVariantAssets": + [ + { + "APIName": "dx12", + "RootShaderVariantAssetFileName": "diffuseprobegridclassification-numraysperprobe432_dx12_0.azshadervariant" + }, + { + "APIName": "vulkan", + "RootShaderVariantAssetFileName": "diffuseprobegridclassification-numraysperprobe432_vulkan_0.azshadervariant" + }, + { + "APIName": "null", + "RootShaderVariantAssetFileName": "diffuseprobegridclassification-numraysperprobe432_null_0.azshadervariant" + } + ] + }, + { + "Name": "NumRaysPerProbe576", + "RootShaderVariantAssets": + [ + { + "APIName": "dx12", + "RootShaderVariantAssetFileName": "diffuseprobegridclassification-numraysperprobe576_dx12_0.azshadervariant" + }, + { + "APIName": "vulkan", + "RootShaderVariantAssetFileName": "diffuseprobegridclassification-numraysperprobe576_vulkan_0.azshadervariant" + }, + { + "APIName": "null", + "RootShaderVariantAssetFileName": "diffuseprobegridclassification-numraysperprobe576_null_0.azshadervariant" + } + ] + }, + { + "Name": "NumRaysPerProbe720", + "RootShaderVariantAssets": + [ + { + "APIName": "dx12", + "RootShaderVariantAssetFileName": "diffuseprobegridclassification-numraysperprobe720_dx12_0.azshadervariant" + }, + { + "APIName": "vulkan", + "RootShaderVariantAssetFileName": "diffuseprobegridclassification-numraysperprobe720_vulkan_0.azshadervariant" + }, + { + "APIName": "null", + "RootShaderVariantAssetFileName": "diffuseprobegridclassification-numraysperprobe720_null_0.azshadervariant" + } + ] + }, + { + "Name": "NumRaysPerProbe864", + "RootShaderVariantAssets": + [ + { + "APIName": "dx12", + "RootShaderVariantAssetFileName": "diffuseprobegridclassification-numraysperprobe864_dx12_0.azshadervariant" + }, + { + "APIName": "vulkan", + "RootShaderVariantAssetFileName": "diffuseprobegridclassification-numraysperprobe864_vulkan_0.azshadervariant" + }, + { + "APIName": "null", + "RootShaderVariantAssetFileName": "diffuseprobegridclassification-numraysperprobe864_null_0.azshadervariant" + } + ] + }, + { + "Name": "NumRaysPerProbe1008", + "RootShaderVariantAssets": + [ + { + "APIName": "dx12", + "RootShaderVariantAssetFileName": "diffuseprobegridclassification-numraysperprobe1008_dx12_0.azshadervariant" + }, + { + "APIName": "vulkan", + "RootShaderVariantAssetFileName": "diffuseprobegridclassification-numraysperprobe1008_vulkan_0.azshadervariant" + }, + { + "APIName": "null", + "RootShaderVariantAssetFileName": "diffuseprobegridclassification-numraysperprobe1008_null_0.azshadervariant" + } + ] } ] } diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe1008_dx12_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe1008_dx12_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..a66f166a0b39ae1bdf4bb4f050550388cd6394a4 GIT binary patch literal 8338 zcmeHMc~n!^x<5%yMlv!62yntABGp5{0D_nRLQs^Ts5tZ*Konb`!Kt9sW?(i-Kt&YW z22qQxwLvKrYi$M!5l~aL8kKrMBelH_h_=OE+xzwj=ySby*L!Qd_x^Zqt+!Xs$)3Jp z|GsbUZ+{5{K@g!DmvPSKCbWr}+EKq_|JbtnjOA*>vYEKg=e#Fy6DEY#JZmijw&T4ZUh_S0ii`x-nw?5i*Bk9;)nW{p!9dxGG#cj^1@n9=`y z8npZ`cOxF?`l{)l+Y|d63YH(2q-Hw<(LY^I^sq-<>ItW=ywlm=`q7K@xn&Zu=r1v! zT>kh@L*43>=1(_$nqD$>3H0CYwP0*<-Y4z}8~f({?aapSuTQ_ba_$6(*KN>u^IX&B zd~83tCL`+ip3-!Wto_%Pmqw&qNVjxxa-ZJO@1I49v2a7hE-?Yns;N;op8gXs31CHD zW((8!1GlPZG*i^bEk(C)`7&iICi=5KmcL#6?h?;^i_VJc>{D}n^OLd?5^FDawDsOy zL~raC_?jzOY8(JJ-xq>N;5!;T67XbUec*Y3wV4pKI5`!ifI8%OK~U=Al<>)_qbvR2 zw55xeqGe!uAV%{~%0ECMzSa+eI%aD8YkgQ1)9Ll{vW@ACJullB9rj>+UY5m~;>=72 z1m!?PXbHe6DJwM%4~Q^1aiBjT(QunjhoCet=A=R#^e$kGtPH3ZTi{d@TM*NLE2jq$ zDW1OYjvNJdE4a*s}d00_oSS0tcueLx!qWW1ra0wTR;O;f?QOx1SE}8 zNyXuy8U%u5pikgmO-0sJz%BuY%fahzd5hN7IZdN+D(_BXTa0uAipLEkk?tCp!zk;q?~t$c1@I=EG>8rG5 zMXj}ao678+oMK*YM)gxGGoj9F`uir|gt4xjp-XedcHBw^J|yB_O^nU|Ab?Wa;$tiB zuruKSjso*97uOAjs!g&gVSZI3g%czj}(qk2T!a= z_f$mj6f8=Db#$mn0Ll6wMJf{tW`C$wQLBx%CwWR9bx6zn}E zz|M=1rcK7XB+caJI&F+4v`^dJJb&9p!v5keoVdj)ws~89Xig~YK z&cDHiUCLVzAiQg&Y$TY{`-K>#({eYuloM{D2sK>HeWCEkv<(jK8N9LVmdC-t=B)jh zS-yK$*|KiHEsUd7Q+*+uzRsKzrpcx!U5RAPXw!FfP3=1MdFPDiuBdjwp^lg{=$Gv$ z8U6aC9+bV{O58!6X=LQ6{o=Ws=Z5UJyZfq5_f5jEZh>dFD00Em0xnW>0Es+gpobO| z70r9};O%)o=ik3jxNG{r&V_9k2acx|spR?IZ1WjNcPgP!MiW9gjEbX$qw5=VE-RB{a%{7(H2%b;Lc4ClYD*&Fly z7pWEZE-YX(1vXjW_R&9Z+)-S(1M82^bOy$Bp(i^4;DS#CX9b;IR8t1YTNCISp8*l# zb&j=;WL{6+BTVra5iU($Qn{>02qX>2)b(1^GMdalE^`<~J2rB^&)zq3c?9@`X93!< zcwCC3^A^fCypxl+AiHEyc4^Z3jhnKIa`V927(#AMXxXO_iRm|?NK{uRDs1V{1Nrqp z{$aQHWe}l?;c%ZND{g!sU11x9hox!&nA7Soh0;vJAklp<= z=GKJW)0z{vwoG2F=N1;ayR}&M6V6x&&tcIvg@UhZnyQv(8J8N^wp0So$xNqKU zURl4giM!JC20W|-Sl?m(HCAC1F&yq!{YF92^b28yVVda=FMMWsBTe&}1~}tY0C-JR zy01ZoIP?+D4F0XBN7%j8Js4>70BB=1FJsBj0;^tFLWt3;8fx|NaQ=tnX$>KqVWfY9rQ2n{yrXrcsKnaZZ^-tE-?_d~JG zZ~xu7zZF;+;guMsq%E8t_ISsmf)fvS>@3&?e8-MswWBdz9fBDDoDINJ^Yg&5mdMI) zYX7?8JFtOv&6d@V2ve|~Hm*oI;Qa$|$@>KVO?f4&3*O0IlXkyv^xVk(+xEV!t4F#p z0_IzU&CVh9&Y|tjg!vui^UuO*-Q{Tm@PbkCf>Gsy!6Y}K@GIfI$diJoGgHOV3i_pQ zPoxzAcnjx=BKhWx?M}I;z>)0C-E0|MHDWbc`s@d8Tl#EA;Z#pSoJZHmt}kbGwV&*o zs$5z_zf>`ubt24i;o;8dn1u?9YIUrCNUP|Vj(~%3I_u{*F6;#7qty9Lz^mu>&x2sQ zjvR%fa9AwJ05K|pqTqE8^VYiJW>+Uhmzy;S3UX-)d1F&CeFS1XWHX;Bm=W{@Uz5@2 zVhe9AN_0$9dk+w1TM}n$2(t%DG@In)Z4`2;q)IL)Z;9rfeUqf?Y+55%7TTARSrh z7a8|a`n@0D`McA;Z@$gTY4RoE*In~V-Fl?)$+I(O!vgT1&1v{L?&vr748c?(0k1U3 zh~wfRGUL*Zi=RKg^{46HJH`8(KD=UnRP0GPxcvRVpZ2ckx$?KMlNw6LpORn4n*MAg zGzZ$~6d1224*gqk>!Z{6R`uo~^0j}|A71vBXZq*;{Q`gM?*TXZbAMmSENGBLAZ!Z# zn!$BE^;q|_gT7np`b9%@uL9DiG6sGQAW!S>&)xd_L!h)(_e;vjeZ9}V3D+3jmX){ME8{AC{1;PopU9Q z$w@HE;allW+02U=E7rwLfB&}7Tg9dCdmOjD9lDYf*=_aZ;OKV{q0BC=1B5}D7~vew z^`yB;KS63BcWTzF9ym6JGwktYA^9@KEj=X(Qb&(l3RjvVFdZ@-dJ2INLBVnM5a9$14c1ol8=(=VvoDCd6^ev(ylKBdT;14t|Gvnl+? zZ4+72N4MH?f`Y#}U6=&syW*3Oa#M^-$7SC^EE2ouzn2e2Q+<-TitKXSd7K?xUmKD= z_7&50^|}`Bp@2YK+M9ch{aDjBO@&~Zf};1QsPrDB%dQzF`^SpF_WCEMrdeWkM&d36 zwu8*jg?6)lk*L9D8NcCXKbU+#vG!)$A;jPH^s|c`g~`=`;L-n8`4#NQuVhSUgh}=t z1F_&`LG7uESILpgatZ?3(L^z5r{M9T$p*-OVAwF(0J#>8;`oID>!^(Lcs-#KO#JqM zjc~^bL=&b54b=YRUsEQT#f2n#B^I^w3COF77VKvY2upxLKIQs)K9vGdrYikI%5%85 zkeUQu2-7PC3Yji4h+x$^DC7g2F58jzKv=BH0rdaHya%@LM-Zzc?~!zfxsJRCPP*yH zdqhX6310bdFeO*MfX#kOt&j6=tXSWehwyrp!Z5;>FtaFn7ojkVa&&pMQqCjaM3XK@ ziWTYtl_Jwyd*rRgJiUTp{6YzZ(3=pR3EXq^1-B{{w@~_ul-8+X7Yg&=QnAT47}qYO zXR}FWQVxy)5*62*9*s|Z6#e_KylFRj>l;lzcYoyWl~dLBCyyL?O}gU!zD z1>nZ;z+`*SXFm!j`v~Ip#dM%21zks@P6|4wiWgPVFU>ts@aVIJMaK(@<|&r=n>V)f ztEV|_*to6LsTJgt&CSl6up3O@;C=g;?)K%u`{3e{3(VlK$N%3w{^#x<2>??fO5DCE zG<^2QRX^Mnu%p$aW+N?2ZAkaJ=yGLjtm(t;Unvcqk@UE`{TXkHn%P?lQy~0Wp()3yYafI1uDBXBniDsFvG9R*146 zu#=>k5Dl@05;iqSIu~+t&A{Qz45NT#X5gpk#8l%&L777TXgJ%Xx};G34T`71Q5SsqUSqLivEo?4AH&@qA6yEIR2Gre=)Pwz-px` z9iqRP5G^O+xC4Ta`Do4%X1~Sr_n1RZi@lF0PU}bjpVVFVvaZ3xn!pe$ObH#3wH z45O#S01_EsH1t_gtUe)C6AT;kRY(?6t@|C(j}er~bT0@tB4=v0v=O(m@mqD|t-7l3 z%4Mgamf=b$*dS{hep~ekaj)J9nzm9#{R%?8dvNi=T0&VGN`BrXXO4v{c|*AgF@|;B z21vxFpVS+u#sPlyrD`Q+#x=PuE^4Z{tTF(<2|2f%^dmLRr*fR0g8Yn@U12=1GL7;i z6Vn{^!w~Z^J1gAM>ne^v1z!>oMbWDwq&PP7x`rDD+{rlN{stf3!48{rZ{yrl*qsf8 zYwH+wWoxNAC9Qnvhc-*7uPq^sA_6{RFZUb}N{B6CbA7z8fIYVo>UE2riNLE@PWsFr?S(cvW&8MSqj;i;V@NBNOS~sIBu}stm8GmjPSv!J(V<94_#uNEPrWt^1@wh{1t^ zfXQ9=r2745l{>+%Gs_dTerwTweW@`F7bV3F;Hzfc5)o0SgFhD#+zeszXpRJ?VNL1|$p={T(P69^J^`xt!Lt;}3-z49xs%qq zeo!lU4;+u!)@PICf`Bo8065FQVGqn^mYEShZ_@K7wxO2-K!8U*!%^V0YEAlI0`n{<|S-9r#Kl}xf_FAk?j^CJ1|$rI1tV>WfSlwZ%G?v;X%=K_l2JD86SSJzQf zz}aTcHSzsi+{c^r*ujPaEP}W2-Da-mxM#TWWxItfdzY(Ngq(^0DOZv{q+FBr>w=A5 oAc9Yptbg|ZGdA|m|5S%c-aHI<}jSt z*Hfs^cq=A3WL0B;cgOy|uZ>c>5@XJ^+(>o4H6gq9z0Zp26IvbFF8^!>nhOLTzV_dv z)HnV+)YIjDeSt|D=Pyoelgh3Mt5<5Cnj|UyB>wzNlXqugJGplXKr|qcmG$|D4G1e^ zh>Uw|{AR(a4xaT-oKH{6iCp91nJ5Ib`sF2O@h8UTj~Q}CKiYPB@%%sjt~DNx4sn*N zE-imFsXyL*_Ue+={uP>`3>1r=02#};E4Flc&VN_MEf)LMCilhvfCS?88w?k{M11U* zKiQNLX#VS1rN4N@%xjUA#_nhRPwW&-{`_deOe+qkzZn@~G|g{*#uAv!AQjjh%21ha R`cngok&Ja&o%6MU`T!nR#rXgL literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe1008_vulkan_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe1008_vulkan_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..ad037d61ed839c55427acbad0d479203306a748f GIT binary patch literal 12618 zcmbuG2bfjWwZ|_YO%NMJPyrPSmJy}cqI3q7GBSe#B6t}tFfs*a24si@tUyo+F<7J6 z6>O-n#aN@k7Gp<^i6Ok=dx`NqpD~gc^ZT8979K~w@4fGPJ9oMN>%Z1sd+oLNKIhI1 z$>nmnR?AwP{N$!CgEkHAwCdAdcYVEZ#^W2`T7Bxk7WWN4_sA}Th8?{8vzvPMI&JFp zxs6Y*JnQfl?@z0&Shuw7q-9TC{`t}#kLRboa?z&3@b_2EJNM6H@4RZ&#Y5Y?`Q?Sg zrHvjp_=~9rZurNuD_4}hyLQ0r_FLN@GN5V2s`YpEeQ9;~Zd+!&cFllKUO9bvhsSm) z4#@ns>HNCq`u*>2xhd2C(EpEXUs~4jzAeLFUR^!q?$KlNyD|00Zw&9YrT=R$9MS%? z%@4nP%Z-1ZF!G$yLx)U1X5AZiY+ilEjMD4YH?E(ssPClQ|C`-t*p|1qDP3{Z$3qUg zW8tz->fe9i%VH7V-IRO%#Li;}-?8O^StlR0^@XMh-6mi2&XlJ9rLRud_}H$MpKZSX znq%AD|IV;ZZ+tLmYi?TKqu%>$JH>3pih4Y^vC}gj?r~}Drxioi?9tTkyoHaHE_UjB zzM3-ctg|O|ziQ$WL$BDxwg61^evHb`KsFC<(w1n4#+Nym){lXl!{|o@ju5@V{DC&xUp$| zq2$O}B~>-~IR*6Axpr7`xw3piLwWt288tKJ*VoM~Ow2b`)aNS;iJioo+ecJ2H0Em) zds`xW*Pd_8GqzK%J+@@d;dQkRX&km-_UuA^Nz7M1u{10V<&E_VDjRd;(=Hju(B|`& z)>q9UZrj|B*hY*f9dk-u^@5thh(beUY1t$=SEj+#`T5GK+BrpAaX#yv*oN0FsBLW6 zHpY4<{P+bm6uO}}X2&E)YaO;R_4WB#RhGG;u&7X-`n6B|tauMYIi}hfO8txu`<(2hy z)zuSb&u%EN&D-pq!)}4O5Th(*a=weXbP4-6bqE(?6n(me&%{D?U1f4~N7m+NRu`yL zshGaMnt$I>UKa z<>qHNYb3{!-xkmNC$}iWdEeyD$#C8+xg{B{bIPsEaNZ&PR%JNvjNFwO&O0J^b%ygk z$gNE|YiE^%zoU~qPC4nfc5o*o?bL(x3z>dti-LK_x(3CfK5%ln0Xcw){C ziShl=Ju7|F+>Zc`6w}%K2Q! zG4!rWF7iAU?EaePabV|@)Bk()?xno;?eS=%UhSh^yXk496yA<1tPCLG}ZOl zolJ(&?}PVnda*tu=zRvee)W;5?i!tARBCe_+Dqxh+SNy=dW;`~ZjP=?`-!RUI-&+A zf!nnx+Q)*8r(OSXsqXmW&ejR)QmpF^Icw;B2z?0H z`jJlJKa^gZdYtp|;9PFWQ=v~l8?*Y>A)%L{FFvYga_7wZWMuy_tB;R6FfrxiOPI|w zSe|0nU4cYxCV@To*5VX;*Wvz!{Zz2e)zBw{eMW{p1?=1sa_Z_wn zas7(TvpketFQq>liMc#$&f`8WN^K{nc{ZgS9p|~2`{I-{UgYzAu)f;#v)1PzF?aZ# zoBH%f?8QAf4=jI4I_~_$mdnYzHtV$nDe}cJOVN!HV=e$YpL~qD5G)^aUj$x)nBxWM zS}q3br!Dfn1Z>`}FXCUC;BUuY1}7i!mxGNhza)*n0_+^x!tV!(J(sg);kObjuYc_4 zWnlSxiPeYxazxI3-jH%vfc5cQ-kx%+!1`+Qod1yCwl%jy@;!1jSkAL9{*r!Ps>_>` z=jTUAFT`_X9ptV|^?m4FkKB(_en0vcy9VrdZJxPP=&wTJ%pDE(%y~|(PHpSb{I5y5 zz3I*WT6&xLYr77SGk@`=jPs0Kk5~)$U`5LPB;`Gu6UoCfegh&u9kGS)jo=s`zH8y+ z9pib3xo!gM>mG*h&0zVpNK3@^wWhxX@tJf2Yw`J|U);l6!BLY_!Eq0718eiyVC`;4 z!f!Iz=T+42j?})M+4_L*MC9~w&H}ynT0D#1*w*zfdRsjI)`6|5z4rAQY1ZACcO!E8 zh~u2z1MZ3pW&RQL_ae?CZ;tNGeTe)$X^!`&oa3Bp1HH|;v^{`4h&Y!x;yeU4PR#XF zu$+VwZDSo70h&rx>G&!Ee%OY8eASk5@s_c?l-_0{$Z zM9wvfD;eiGU4wK+Z06<}(MMnP*nj)1T|aa0L;pN-1Y+F%5qs0 z<$sy#+T$E=%<$H-HTsK4+@(3-;$145oZ(FI5F3IVAq$O>wR?jIJX~w9VZ`m^LDSD-?^MK z=K2tvo$I&g&FA_ZoP5mn5!i9^5$E?{ed3O627iReXXiGDxFdf6o1<&j-@IbYTfm-= z?3(`tT|Vx}zk=nAV}1XP-e!HZ{W~J(n#JA`&)*s(dq+GY`siz}vH$k!VYiPv@-g@b z#JKw-`oi2YwF7k4L*z6dey8T7Xy*7LvVZE<%#16wD1?f;{ZX1$I1IU=Wz zIPT70z}=D9+b_UpAo6j3{tA|lyYnSj&hyyIQl?qHj1)7BZ0GjFkZ&cm)QuYPT++sDsMU9c@eZ;ANbxeI+)xW)9^VvoCl zSEjbO1AD;9$M?_f+wtiECtpVFo{ZlU>^OPjjDp(>EU&K5-e5V;lFx{q;CA#gd0+2J z-wRz%KbvdWnZ7r=wpQR;#=4e$(Bx0NyH*vO(@{#lY;DwBf zIv#*7XN#I0h%Vm)u8#QTco4dLjOz<_9G`9D4n~pBjynWh-Z~zD@1bC0$uCX0!@%dfsLo1_D6}^2ma_(-yQ589)oUk549bO$hn7NfA?U` zjsqK0;gdA;()PWSa}D}MU5*D^6YWo?^Pd1VFX#7;yVk+z@~(G0623#=%s=Zp6kR@i zV^4>{8Ap5U-*B)wXq&(-ur4FOu0fk;-JHF@p4C{lz0W57N2dOsU&mS#*R5?7m{0P1 zGW}woN>jc)wh2hwr_u1*oNEldHMWmu_=(`I_&fhe$XH}UTDNgv?Z)^ES&ygJZgcOn zPeA02D~@MP8Q5_?qkR9L3_g=yK71yEjqf{0pK`E%^7{BZr~u2~m*zAHEO#I_&(bMi zoB3!v6_GO^vFncf9^eByTxr=iF9nVuygu-%Qp9QZi{OU7)r)T^c;I+l~fJU%mt$T0_(DjSGSO~VonK>KX+S$kN z;}(I9s~8aY0E&rf~j zw7b7Cw|#uaS_1aFmFqCJdBt;QDcHE$jF+`tfNsv(%u8Fmk1qsk5B(yrv3&k|rY;8S zQwEM_<0a^PlE0;C58q3{yTNM@ZW;J+IAi#pHs*4$ywCq-DYqikoj=C@0IaXJcu%eb zJ5F2pT?Up{!tZjhe%dgw&>Qyx)HeHikBH_Z+UFw|NfT@2e0w&!O0Pd~aP1=99d)jN_T{ z-0P=*yeqE(dv_I^o$t!?iEo^1A@qr7-*sSpef9-+J-U9j;C_;F(!t%3a>g&?-RpDX zMmWdouif~O+gh-8#b)Q&E7LP^6NElW)cj_!F_hTrTfp-A`yJ19-3qoY+9KXMnA-f_@etVOo3@{(ws@C3j2`ct zzWBtuQsK?`A>*09gyQe<`%g6b60z3+l zcaME${2a_D$=&CLKIT0Z{3JN?J{UdXJ_WBWo(WHb`6Pd*)fQ*u8L&2=N5&jS|15gM zJT#4I9?!vRi@bgT=9B!4WRBWhtMB;d!M@{Tt&V>IuE-a^um2LA50xm|BJReN_dTPJ zIYz!Og0(w$a4)5td~h#=<@Jl_z$;+KYqO5pyaS#a&x&V9pE!@65%Z7p80XEsjd#_n zV9!E42Yv;XJB*l-%WLTJC2;Ya`Zc=q`HTy{*U`PJ+M*V3fcYeQuiaSjzIqevyF;IN zp1lP&u41$Ec^1!=w;}X#Z0z?t;Mnhe_9fp<>D_oY7*ehB81)Xun$*Dvb$Td+R1;C`2K(y{j+ zq3EkE-np@^-^01CN>(X$J^I^x4$Y(YF57=aHbx3d2Tv=VI{Stv-rhRy!SWZ=f6bo6X>N1o?f;(va!qvuzdYzW R|7@Qkop)2g>Q{RFgPnCXmb>^MS`4b>s9fZDJ;FdD) zWBc(nsgW;x$`?;f-+LvaJUrptVrv&G=jm<3-Z^C9k$UyB$ki{QRl$+hp8g4#I4~nm zi8`)zKY8$ z4fnfzDRTSMU<_&yZwMlS-zc;UayrO)AU_0Iz<{8ok|cx-%8=s)K}ky!!X}H3rp5nK zmo8n7RDj_DD9xXwe}F`ItsM`_sHw59wV_2+r`OY~I;u08U)51MG^2c8rKM@Yv=ll7 zWkUpLDZnW{Jt+kXh)_8Zpj{+3e(y_zpar1MNeMgXT|pm7;a@Mb;**F>UUUOSO$#KD zJ-qSTv*qmhSW$zMsGG@iiz2g=sl4o(M6DYvmehO%dGJK`M242--z^oUDm1rLcemlg zB*auU;0<_sX@=1$lLXi{detae#KD;Fh}q+45u@d^yU~I(gi8e20vezaQSj9UWde2BPlm?Rq}1(6dIt&ohV zU{|q-vYimEidE%L+G#l)d`Nxvr#aG!1C`k|JGFS^-PE;sQx@D?3^a125>9XZDt6-1 zc*?GW*oJON&xK>~y@-qWh+W-_Sb-@)(wWJaq-_5?>sDw>J=bIRt#93?tdSa+y9_uZ ztPIycjnJVsT5qu}O?^lI!;xEK(;xZ5ovFZPMFT8YeKUO3@9Mc~d$k}u z6i+>VXjSzlPH!=XRFJD+Jc z>OOE=Nt6Pb&dZVnGpI2R;hXZB$F)5?K#@Gzrkn?7QRH7%9!lVK%qxe;!OiwDa z5g#x~oAjh&8QKK~pd&$}jI>ct+9V(q$QYn&GZ~ ztRl3bDs~#v;dW?+RvrhxTIvvcOpRgwF^*Q=1CizEAT(9Q=0dMA^p1eA0?>>mx$gx} z2m^x>nvB|By4HLnK=ua(p0|$U!Aj9;DBOe|ym*@v6JaW@v!FTK4&k@S@Ot)w zLrfC&Fs-jePCe>I{T#wkTM!&ILNCQp`T8OpHA=6=QRnClIBKlkhNH&mM{!iC9wAWE z^il$Kxn54#)(Rz24<&Ak)kiqx=`e6EQQqVMWv_+W_F~|5M7i1nqOL`iDhKOM4si3t zrD!Es*ZA4&9H-J4T>Fe&&BHUWI z9)!8@QtW=cd1T~>{rs8hXNK+HclXtp@0Gn3hwt9HX2r>{LJ@bRA4?MTAj&VxFs7)eLiP z68)dV;b{9QA_3J4FQ)PFIR+tOm04_+LXQ+?)4XB4J3lfq@V)2XJts{6g}Z!Hz#d7b zBGEP+&L^jPrZC;+>7Q`-Y-$?mG$jrWhZ~K)e!objO7=WQ8-|8|1PyqUj_cku{pX1e zzA)-EU4kX8=ExP|BahAmFDgW8>dy>dVVN|zFS)>7-->Nn^8|BVc`_dZ1M81Zbp}LtA;&ua;Jiz89oz=M0Rx|{FV*_kY5kvA9jyh z0pY6Y4)u z0Gx7XkQ^g!EuGQa+$!2N zqglKq#~*k_fx(nma_bTSDYBYSBm>W$t*rm3vTMg~_pTj(t^cU&z_iLQzpMnvMgn9{ zkN%8hM|C*RP@8+M448ZR+H3$4+xLT30E!m?W%albfUikq^G1H*%yXdyp_-YG&V6ouBSrJM1~}to0C;WnVsE1i zcId;O&HbgPhu^(?3KwYe5NKnwtZR%s#ootB*@UHugym&~j5flmLBeV> zsU(W@ZXT&jN7|x;5xqf?cLXp+>S(db?~D7vP*!c=H-HIP3)YfYyWHI zw_pM7oGYsz;U}OgZCoC|&+8_Kb&7X-R_6(X$K9A)wz_oVhLYUSA1)5v2aAC8rD6`H zF_E%6y;c#p(j52}mYXf&K9_OF<=k;SH~$dTtNG35WY3JfUN;-zHc{2R>=oQduwn26 z;eFa$U4xbF*LI&>NYTt$Q#P|SFKbP1$-)h5a`Tre57Rt8+`j7CQ09T5^lL+ng3scs z?uqu0R!p&vJfGZJBInzxKWGzI-CHsunZAegbJGae9|D7FX98Y18{RG4m|If16x-}L z2U5X#5KfkJx^HpTx?$$lh@;dNjYv)^FC&%eifJQ|^CKqXnVb<$6M36W)6TbW)*=MQ zFqPK;Zmv~4SA&~7P^Q^fMA||ol_ypg6_GX<;Wm|37s1sY11!cvEqX&MM4a!8GDfA0 zaAxe}y7kgS2tH#9)jJj=-k+$TKBJ-+Cz*}Bjq^&NJ zkv0X9HjNVi+xO(vtI5^H?CKI-b-7Lv`goM_c$o3Ck?|10Wm{V~_7={7<2{tc>GS1u zE2i~j5wB>)(N=M^&hb8JiE0!_)!I?fC@5aO+yRl6{Hvj8Tx!nT-4fSvbrj)2;z{pz_dmnv*o_`jrBpN z2b(L8;Jky+peDL_dCdDtx&Kn4t1ZQAnOpoCr*lOw&fg&k+Zs|k99SEe*6PS z1>^>&|IvbviDuoJdZK`I5#_cxAs$jijav&cE#asRX%0R4z=$BBF%)`>Lt`ok+~Ho2 zsqQ=fGp70l1Tg;>VyY}Kr~fdfvYBWC5fM_6Ozbdou6yDyLeEXxRo4X5$T767pMeeB}`UI)0(gfCLS!0qP!5X z0#0+s3LyD09z+&o2vJZ$=pFO+$zLg3$Y<~IKTWSan^5S*0;HAqnPlIe+9sl-gE!i; z1G!(HEQkl=-LUbn+8nLavzfPHYocB7--`pIDAOctd6pV;7Gp=&ZwtyA`-}+lL}1PZw1bGym3qB@ ziJ)Q7I)2UFzF)FWzV>?CA=uCD1 z{|Jg?)-NCs6-^|gb~+X-n5=-f2ah*SRzQqJB|E+>pbb^AQ(q6HcoW|o&>r?!zF@-i zpn}++{4-RNSzU>OKg1$-UmX0$Kr8w=1408|5J$Pa9!DiW}jL1`C%|(JstCmjC$kMTJN63m3?j`B_R^`c*TWN=mo1 zI<fho-r+H$ zRK#WzHC<&~?0Mex(%6{p!>wN_j2;nrztumy8}{29Bz_X&!DMf|_GVbgsRC>j1*Z32 z7dlQt40Ar2<$;YrPesf{h&2MvOxg|f%yhzlLq2VeQR+g3Wm}7HbQ3J&;$28Y5Wrunxx|TtjC^U%mqf z3Ew$R=I+_4tkgNiVIY@y<&PHAqDArJ;L0F(D0Yd(GQy0wk{eB<=yf3OJBOa&b0?Gq zgKwW$u-D>OhoU=|KgbbRpy>Hh>|J4Eu-lSP8j}^oMoF|=KTU9Lx3FvXDq&-mfJJnZ z(i;l}S&b8gCk8ArD1{NaO`hv)8jgx6EO$>^82wT zkrL?Qe!3amJcy(+eu zM?jGPS`BT=+1W)Xy?3w#j@B>NPawN6UI`UsbU;@wo9UYNN-sBG0Sl{PbAZN* zt4<%-UYPPk5G@k_6-4}khILJA&4~8gG0{DpaTq3UMD{Tu3mr2{ZVDBL;RD}K6S4$LlrVH-S1<%&0cczgfMJSDzU7{a{nSpp@NKcR<{Y9{;Mu7t=roalP_aWlJS-+Zmz_Z^His9K5CwsHJ ztIFNnqhcmRzcueykvmCpXMNH26njIl5UXE;X`ZCuxFgak|)uiZ*9 z4fxhvs8OJ1T(hR#RYeh2RQY2!!e=sw_b4gTs>W#v@DE7ECHg}f!&DS+W>_L`4l{mY zriWR3-Gp&p;4cUWf~ZyDQVf%ERl^Pi?qqsCWu`BFJ2Q0By}zkU!cSoW;o3TST}74G za8|&8tjSlUWT|kF5E;F1=H3@_C9cY>lfGIfM3-B0Sk|q_00j@7(NQXFl+7^dfQ@p% zRtqMp3)EM6)trP>8CA8^Nkp*p=E3R@Pga-Sul*1_?1f}y2KH?|PT-e?WvwUR-o9KJ zNAqGT5NHzM7lib2+*<%(%cKYCeW$?1Q-KG8B}R59#|$w?3BZKu%a9@1MW!I~U1BlH z2gC+4KDh#mzeHcdVlJ~2F1V!Q+;iZxXCitUydcp3vVfpW#9He}#vO4by`Mt1=ftwQdzFH?5m#Y_ghoS6duPYjoS>7 z+E2i@!?O)2Y362q4~$na(^IXzSl_rQQDb2(^>y?nAbtwqBirJ9wdTVaLWa{rQQVZ! zv9K)AxxIqsF`Q$Ce8j}@LDJb?Br%SQe-gH+p>BsT(8pCdp8nq1UgK~>9dMldaQX|j zi?x>~jFZsD!t&&GLRfPgr8-Ot0hTSN0lTbGUcEQtith_g-ga;z*Z%x}p&v>JKKQ7!RX zl8siQF}pzTr2ltvLk>B=kUJ+$?pvn2+2Fdl+5oGgFgx!R>m$Us(|vWzP|N8hh0d^19&lkWVr$Rq<*s{kVZU z-6g~U5rWS{`VGZG_b|UN@HYj7VX;Ryz)IFA91;*<$zIds@o+Ds=(b-QZy%F375IIf zu~&)IUzk9ARc8rTB8zsh^M z_}A8X|WMhH6e~0I_eQtgtB-5{#i>|)E&QIK6${NvMRU9 zXpy6#4-Vu^;(qcKSwF%xd4k$xO8>L}m(jjI|I-{Q-!S_{(7*e88~lm8_3he&GXUMc E0i-*z!TaHI<}jSt z*Hfs^cq=A3WL0B;cgOy|uZ>c>5@XJ^+(>o4H6gq9z0Zp26IvbFF8^!>nhOLTzV_dv z)HnV+)YIjDeSt|D=Pyoelgh3Mt5<5Cnj|UyB>wzNlXqugJGplXKr|qcmG$|D4G1e^ zh>Uw|{AR(a4xaT-oKH{6iCp91nJ5Ib`sF2O@h8UTj~Q}CKiYPB@%%sjt~DNx4sn*N zE-imFsXyL*_Ue+={uP>`3>1r=02#};E4Flc&VN_MEf)LMCilhvfCS?88w?k{M11U* zKiQNLX#VS1rN4N@%xjUA#_nhRPwW&-{`_deOe+qkzZn@~G|g{*#uAv!AQjjh%21ha R`cngok&Ja&o%6MU`T!nR#rXgL literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe144_vulkan_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe144_vulkan_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..3ecbe8fb8d13972a298135f044859ff74bab86ec GIT binary patch literal 12618 zcmbuG36xdUm4+W6lORsaDxl(kLy0mt%S?eXlvJsJ2tJAjl+=J#1s22s9D$$`VsMP2 zMp1A=jZ=(cG&sdLqsGJ#I^A|B#%|jfO^p40_uY-xlC`?m>XWxU|Ni$r`|PvNIrqM* zBDq{H*J@ddlb_h!W$@-)t zxU@0jhkQQufQ|orX61^~ch(M^-Tuq=2M=7dV%3H_`@OijN4KprUcGkU$1k6;yu+ir z6bEGfyXb$a@Eaz^R(8yYuEZ0dJP?*GkhGHlD++mx=j`lF$T zu3Nb5(2i-5L{iI^(n(mAGpTF?o(#1}F z_g7Qqoqf(JJ+7Yg_^>Ot_Ny$}+^XfiZF9L6l(SQAiydv(T+4*%kZY6lrQ^!Sl{7TY zDj7JazxGZ!CZXxRbFOW!HGNBDe7>r7L^s&i5xm;Pkp`pBf&WxHF^Xuzo7AEBvRn+Gz3yGb?o7+cLH8kdH z6MI`CeAk|D%rmxAu06J7&JlIB4rv^|VD{`neM!t$KB+V;4dspX3o09PvN;#;Q8l z;yn6VyIA$4Z`q6USm&C$g@u|zZDR%XLnUI-X8n_~<@58ERkd@9w&Hx&JF$(ZTTt8B zux*U>PWTB6YAAF=amhAMMtmyCDaiEVtoi5w!twj4WzeL`J*O}=_~RsNg&JBIDls=_&m#d;L;+9_-i zaa7a%x>^bcZ&jSvGn&kuS>RmKn_E{s3)42gox^W98#%YJw$RW}@om2jNjx7_&Ek!! zt*o2Hc9iC8YVyUH#r(V@iSO`y<-FOP@Jz(WkB3!So2uH;^>ww4`o(&%MGbckzw*lZ zy6WnQvu8IH*ye5a&SAH}T!_(@GCAMHT)Kq)n>vIGF^WE2!)H>Vx~?)gx}$3IGph?! zD)Q|XJ|n8R#Z|MbzT;Qi^X}nS%y&d}Azu&0jcK2AzqfNIi?=oLX`OT5Cslk?2%jnL zcXEE}3zc!NTJu!OKBr32y+h8iC!+4XQQs@oy%YN&Htp(rCt6YWUS#d++P%~IdmplP zb?xS%-MO-Mb?xS*-81Q&o~1FFXUM+jw&0vkF6-wUa($5SGp?Ku^59&v+`tUyGeT}? zhBFVjaT(6_%9Uj}*CW;pj(&Py0MyT5XCGn}=OtIlxV zRk`^Y&Kk*ae3EIPaU>xf#y8CATEQbxygJ8O}ST->MAfosqjL!+A&KuE}uT z2f4K=XYFiqwo*=qocr4q>>B$Z2XkJ;u8$0dbVGMta_({1UDx|Nzc4g(*JL|{cZdG2 zM=mQ}h~S#~Af7eHs=Fpz=&r}J6S`~3`u9LL@38j-yKlzdgT4=9)2{Blw1w`yG@fhg zMX!(X4q;aH-iSU*jOhb*j_}zVET@FeKHzK|Yb~dA#?qJmAZl&DAL9J`(_34|8OM4Y zfVk(O9|-P~(ffhDM`1q*oZXv)(Q~<{hJ^hPG|#%aa~+D%hKF8)GGqSo{-Gb1m~%s8 ze1CM$O20Js!@=QuMA3JMb#W~N5IH5dfnd**(t}9ut$DOSTz53FTp#irl#=>dr@{1& zX_e|n(pxKab8!!kO7%U_-K*ewfqYIF!?USqQ;#^tQk>)eB91dgR-CgJ8Cfgma~((1 zyDquN^BA!EYo5o_JD;5X$I-i&^4gE5H_x!20M;&VU53z`gLQEHQ2G{#y!x8h8k_`f z*P>`22R5E|{l}-eJsK(0yOn)UCPi0As3K(~d~7t~=zcq4y#5p(`Pl)3(fS|&Gb3V zbl>C7e?0kk{;Lr8Ro!)-g}ASu!_K3({T=N4p&D^L_QQzcnXW-RN7lxA*c;1pUW;fC z-#T#C*Zm0J`C#oAQ$xp|jW}LD#@B?#cOJ`AgGr7bLb^PTsXyuOFOFG?Zj2anA=vrkW6VWh`I!4+@DjuvFHF~R z30OaEk@uxw^LBj^|FQ&sJN_~_`G~(9Y;5@@Y5Wyn=g<~@-%sqhoHYx-m0)@OV?Qqk z%ilw+zVufha_;lSl)DnFkLU9Cl=Ho!uQt#559n=Q=5|QlIjg~Po^|mT^z%|(-kdx? zKSX*Xo+IlZcU7wIP49Z-ew6b2(#O~}V8?6o%$-VqH4n zCWC!mMg7*L_6^L|7kmdIr;l?M=)KqCS@g!Xu6NSg;`z58Y)$R8Z_r4y?#8?ek<&*U z=k#uHS7aFTkEFi`aUOYdbZ_oO-9z$2Tn4@dg-@IbYPk}v0*)>0nF26pl?=xUI<5=Hk>220m+b<9~ z*DS7Noab~6(iyRtn`cBHebrh@3v+xFfHDU32W=>tN@Rk8|<{SU&E^n_xND z<6Lji+nh_=+sHeJbBQC)X0UN$u6Mz%FFV(J=<;!H-v>KRKJLhG!1CtpUOT^YIcLoE z0XRF?Z_%62^*cEEnCnBZL#hSN*Js;UM z{|mZ&+>t+m<&0x}|CQcmeYO1?BIlaL-Vx8=8YFv1JR|z(Yp${X_Ud7`k2~@a_;AFy z`yu+q9r<^#cI)0X!~X}^I}v=`oj<{8b6lM7KZE5RZ;e~ie~h$6JmYieZ$aYy@)vOS z?(Bo^IPcCUi1vv6pD7o2Cy(BQ823#2+YsydU-Y)PJD-BBlfCx;)=0D7#{3MC(?=Y4 z=da)%NbK$B;4=~VI6r>_%g5dM0xakHo$E__n{#RVJMs_2xx^9YE3k25u784EUv{pq z(dFYj`^CU<@^N=sz{$H;o&o1~F6WH7T4K-6)e1e2Jv-M9aPl!%Yp~#J=iM9wvfy*r-2 zHAwdEct-Tm*IZ-&?bX9>A9tq{zTO?v1&rMyhHKDge{O;U^zAM~fdTp`C-M}kT zTik)}aPsl}v&VLPdcw(<5xW=T_W(Oi-Z-P-_5{nT>$4YF&a>n*q8GRw{Y>81yVCbY zm($PYT6U)IgRZR=xR$Z5Wp8x(I3xRj<*d1N+!t)Kj@tSna@I|pt)qP8ydQWWzBwLJv18>8Je>;`W6=kNq0~HV17Jxdql`B-k}*^Q@b*_t&!;>$dmVr2nYY-}CEOYvQ`KjRx~ceov-f z>{DsVx5qXSiTgALUYm1`rMJfR@eDr^+!cT4KM5I!Y)tDm9<1FMeLyu+?xuPyBweR-NWhV@%?5Bys^xC8oW01IfLF7 z-&dxin~Qxs(`JAjvlo7jITLJi4chX^OvG^sCR3lIm2l>5Znn7Nv(UA9wp_0{IMx_3 zX94V-e&2G=*{#m_+yZp{VlNhgZEE5VM_ z7Jiq5<(2Te0<535j=VRV_ewAy{@%iO0f2WypIFzb)ZQCT-{60c@}1yaW6Zl6tj%%Z z`$I6FV?C=^O9&AAyab&D=eQYv^sBL-+e?M9y<4b{^kb*MRvX?=9naW<2-$ z=^yXPYr)=K#b)Qb@&e);=Q;>|;@NjSSYMxg!QFtapDnl_r<`RBN%Xs(t+_(wO z@%n2we&n_mtX;9$IrggbOxz5ij}kS%1#Ao@_WD+^y#9X2b6r0HTNiB+@3xf7#=9L( z-ZL6w*P-j9%`rea+zsfC(H3#<0vlUf?CsrP zKFQu{&+e^z9N%m10ecQS7mjh?ea@fA*n7b{(R=TG&a3Nhta0?76Z`o2^d#_!h(8zT zGdA^^K>s0U#dm>nQfj|1wcDGId%Y3dncgw?BM+oDzjr(c_W7pmr>QO8B@dy;JEtE$ z@h*87UfV|2)EE8{uyN%5{`4rlbJ)Bu+STP-kGN05Yl~;XQ(!*H-)XhQ8F?D4&F7IZ$J0N99x)F| zW17da@Y*7;Ux4`}KO>o=cGv1V{yDJk_*kpspNA{*#qaCCMCU^#infTmDdm07=wptN z?+ak<&K=x~DJLJ?OJI5Z;yLg#*zww|qc-n==f<<*+0iG?qi4kY<2=TBb8q8a^$OUt z5YK^Mf#nV*X5{iJx_k*-Jg0t*?tDJu!tXV7@2a+_#p_@`$=+)>R=ls?0Q>IHC!S|- zf{m-#?0lZZbLA}veH9Vq=m)~46y{!Lz zXB8Izc}wfBr|a8l{e~gaN~g}g@$t959REQ13+caRPvSJUIrH}a&j7hab%VY*@H_u( PpCX-q*7BPUX59Y(c**qV literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe288_dx12_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe288_dx12_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..c3925d31857fc8a0569df7cbefc7bac250293d8a GIT binary patch literal 8338 zcmeHMdsI``nmSwm^fgf>N6YZ=(cM zM6qoUwc4r;N~u_D^Pms`m8#XK)C(G^?L|ejE%w@W_6g{9-MMRKt(o~_X06#P=Vb41 z@9(jH-?txM0znW&sv@MHw>S$dB9>;<``DkGSDiIqt6w^U@Y(G5_|Ag(;OeK%UfwH~ zAAro~)kV_@w^rt4e4>!dtNME9&kFamSu6X>EV&7{G;hE6IQ8gWO}PlU`dkI%f+C(j z``6`DTK_PrYm#qhBi7JtIhXy!I}6{~Z(d zpAUnU{pDWxh_}F7_~ouJ+KRjFy)7TTNSjkC7770n z{mGS&@7C9@N^bgeAwUse*Hd@;@3!O3}gSGR8_Rd=F5bVTwX7Fszq^5)Zj0VWB| z$lYXS8NTOM7LH~J8@MIdw#{E8Z^2cc_|bsMb0)$15)}Gd>}LJvFrG zlj;%6-`e9xrhidK0O00%K@bAIqrf8uPbN+S&j{XTLC~V46pRY$knIIQDT|WBCaX45 z+CQ}=i9av3i|AnsEywd^idRkbs{sIg0T6~^@K7; z0GaCM1#i!mbLSA_>+Rw@*?gxcDt8{8pIs%^IH3tiRfi!re!Nx8(s2AbC8BhNdPsG@ z1`bO?(z!r3km;cw#HUOV5|1(~M)4{MC47fukKM!@aFEA|jc46p?}z$C~~DUC-{ zsTDK=0jfqJND63t-zplqx*T@&J5&Z<_sW_zP7bMRwOv_fD%)&e=rJOpFA=$?XANQY zPY01xGP^bjYg}mmGirYyr5w^zevz>53GE-F_N7wR$S7+_XrB)u8wV-UK}rx+ES3e-CMgdz>3(Abm_AOH6Q4((}tako7k_)ONvLCd}mU-?JbtTJn* zFgygNpE|g*ax<^Hh({^NRj?jLfhdL4XZgZz(JCJ~2?`1!$)E@q7>{U3-qTXi`;o3v zQ(D+kv!}7t+RiEBb*EQ7?PtZ;x`)1R^ok$r*b%%Wdu;pdBoISFpKA#*c^~*uYnnYR zMQv6V+{cmQ@#W~WUSGLUS}Dk@EXgB*I`gE2RnX7c0^X4Q7L2l9OWA-@3N);umz82I zrMMsYkxkjGr4&i=E-(Ne35Zh4MlEHtkWwIJfvzoJOg}RGN{EyNy0(BZ{m3J^t=A?K zr)ZxFsc!s*iLjOdHS!^84!OY<2`8Gg<$r7P{WH})6JCImLA?h?EuLBpu+cRqWid!6LX3s&mMha`W za}Tm9^h1oEW;y-16a554qBmnCdW2R&q6@S#5E1lR$O2FDv z0PNgJshT9BW8w^Mj@^bBQtPx`P4l*HAnhyaAc&gnVw$$r1!o7-_Xq#Bze7J)e+gsKiC$17W<<0 z6th>C*oCp@UyVJWH4YCSv0gfV>-?bgPG?V*@qtkg(#d!06h_Q{n$Jb6_oER9^^D;B z!osPW;UYKLzpN^faE!r zshUvU_lVzQ!{-Ba1SXKSAX?%mul+-?wC2E+AwAKzb-T$A?xf)fS?{{{#!&KKz1 zFy-fo4uL4@95abXS;dnp5{^8)c=Gs(z8yP*?N8<_Wu*X4hJbs4SGo~GHVKghkLDlG zr-$Z;Tzm+6%M6HLhsxewuOA}fLIuy3{E!qGDT?ZpDrIWW`K{_5d%fJ=tiSM8^`7YO zK2IsXe{nvW#kWZPw~hWz;Eoc)Y*>GMw%tFv13T3Q0Ox1N!TL z{zJ}jOCeGv(-uC9m*4zAvfMHN4@p!2FuPSDa)pVGL!u7C-CS_|IMx2qMSvdg^l>o# zedV<-0B{7yron%TYf^&?ZhLv)QbFY}T}c3V3ozeeeAiAo$X4yz>Nw4@eqKyM%Z6!9 zO)c@erZpvO&G7?KQJ^!3*AHDKV=}V=M>62Th4Q+?IUIob~(>Azz!15i8wD67Wx0F*TopsXuQTK`Vr#x+?v zxvxRP0?i9HOVGK*B@kFM0<7sbEwz_o`TaUUF)3Q7ihV$maLJ3rWeHBHfoyPpGTj!!DIh^v{Mlwih3k9VGe#_`6#1qkW_Dxj3$Vo6)9}`u3dJ$e?J)0 z^!DE!dRu^(QC_irO6r2pkjL8}<)3`GeMkOI5Ia_aeJd8-(Z-MV&0Y^8H7^%zYYFyw zjjdmme+w4S&RNpBVL>v!(#GY9`#rt~A^CvhyD_(TRsK6!t5YBJjGiBUaL3w{dF^lq z&cJ$$w851v0Nnm?+TKal7w5PT`v8*z#sd3LHuQqH*i z&B@e40B^xuVT6xqL#tiRX|N?ba5tGpR}S|Z%{|urcg#JOBXEivKi0M5RL2)HJ6cb5 zOjRtYW?U{0wLckRzW8uQDDI(x!WymppOQ+(<-=ej47LC1jf*?L{wQ&H6Ugei^V0xW zuER&*NCJKqq=PdmoGRya4)NAF5oT2-M3tG;@p4K@F=azz5n~v#f5>J%le5AZ@m@xQ z=cQ)e8jNfkrt;_`%`zv0g7<(BS7glc#4Gq!qzDBM_zuug z6y6cBAEn*@;hn$R?fv?j-0Vg#gt+#)cgmK-4Nsn(Js09fJTbfetJou7-`5Ay1SFzD zFC~wQ1}V(TKP-Cw{PrKl`|lL(Yy9x4=~0mz^}w?C{eRrEyzA=U#!jiJZGVV=8EgEb zfz;%0VNhYBiahww>efZ2?Wyd}MP+M#uRFB#Ew{AKdVBf4{lEF$?9KUY1uMT^8jiB5 zjO%)*@swko&klHPuI&{LGTif#Po+%aY`~t{+nclHw}-&!e(lf6r}lO~`+{fjH>?&) z`*Yv@#{6Tu8#hoM!FwBCMi)DHxXu1jdElzpu|L&gu~Xt|yNj~tm+n!7PCkjN8U41p zn3UMKYM@<|Z@M2-I~~qQXQ%%NC8TiW^5@?a+%^eTo_{(XFLWkz_OP(sWdv$t?Lhk+ zv2Ac7jB$MW8FpE$OSmZeOB?_GO@W7!%h>xkc3UfSH8G;I--|C8R1*s#22C zKvb|{usmdW!3hd9!5-9`n|j7qqR^3qJ@x$*jJRTkj?K_VFML`+1>jL}LhmwgvCi><={UOpH_^GxE(v&sk;2v%%e zO;Fa@mn^4MYn!zj@Qq z;7uVdGcfTMz>+7_#HY054U}((7Q$C{a!b6KkWB6D1sEsjm_P7^UbjJ zXA6iGG?dwWOJq9<3G6vkjvFxoKNSgAAkHv2Ga0w>Gt-U$4*86kdWi#qO1Bl=Zr3rv zQGA{)nIlR(OkxCNLBwIdFAA8p1J;g1NKM4gghr)JtSbC_z>F@#{d` zcQ!l0&z?{g3PCPJu-C#;HvT(|FQ8eSM6}%$pTiRI;f0}OcZvIbNyzA8mKWBi&O9B>FKhp;3_iJITffxn#H6T($< z9&GLH{wr6suV?kRZG`c!TmpXd(Q{xh90el)+ug5iY*p|30XzH<8l;p8kuADo2G0Qk zPtEm*s7iv{2;mE)L_;aUvNaG&MON!6o*ov3r`b>?BFa&&M&w;wD5JcKQTz}D2+(Nb zD_&L)DX)Vn8BleH;%8*baQ-_%y9wV?T4)4pKMK20eYx{d*pbNL4pDrA0veYKvqsp7 z5_OQ8Tulv`nkbnAIXk5j2qvb1kC>RmX<8A@aEV_kk~D+}mz{>L_Zyk&W91%BK0*#r z&E)}$72S5*`hPa$#Y2op_$-8+W)K}ST9!q-@0jRzWwoHl25dhY0zyOOhLD6XIN-eu z5!X^>Ab<%K56kImg>>A)0k&M_wp)S-z8BKhpu5?6nTZ1!Na?U2!UD6xE~tX_27iN+ zXI6kuXrF@<$+Ie-{Ylu-3T$G!AI9j79xo=Xd4O9}#hJ9z)&4X}`3x8W14Cvu8Yb00 zliF<>WVO&ll0@lMW-H1LfUyBBS&H?_P(zi11WZi*Q)c%bgshtW!r%=)2TUOZe!oK3 zE%HK2oSdU#CRBUP9*_6#H%o2(Xx?s9@EMWE@q}q@@!&J7&mn~5Nv#P&>*dsi3v?!?LX2bd zlhM~8WpOE+H?4W5Yq_i&~%%h7C7pNhXrec)mjWX6)n1VN$6CbT#+o^|y zY{n^_o@VItsk&UHz}>hyr`b_O6O~r@5jUdemmxpUQavli8Oi8RSm{;fNI%OUOEj`f zk>3xp9!lAt0O#!!B?5z}wj&li_WclLEW2fpSeP zv$k{%O{<`nE&0%54)(fpH*MF8zYKsk2Rmo=cjm=oARIRmfETVfsksqA zvgn!Xj8^;D^aG@{Q8;ZBAJXTLVPbZ!#PM4U@M8k}*wx5_aZ?)l)2QR@CyukjK)9TS zzY|jAVq&iERXXzBneDk2Ikk+y4U2-m8Y=xYg&l^Qp>j zVbM{cWvD_w9Y^<+a;PFDq<@g;fBZKZJ2f)XAf1~jm!2I8QD!#`x*ruf&CC5nL5Eu( zXhDOq{nJor1ks0#(w?iiT-^L69>ttYw#!)9!70`pLYlsN%Ux|PO;I{BMLC|yHg_9+ zU-{y^k2?rmn_Is2aeY}G%yO+ED@&6Y3_KDXYp+T}P;2;r!vJKbFDf3khcmjM(EczpdLpdhT7$%g09!E z9&*PUypxkwEiapeTP2+gQdgf^y)r&7&}po-S(Em&vQ&Ib486_WvU-j(i{y(TT77fe zp=^Ko42JZsuR%xPpd`sXx%a|w2fcemSaqEg_%- zLZ}u$!Hv0dD49r?r;}^Mbt#}Z?4OD^Y1_pg;LS&e@MhQqs2&H-QN=G*v;F5xdh5mk zjrcvVJ>pBBjmY?ZV?KUhF9VxBaGObLLcKkZ=Z$QAHx+;YkGh3nAZS(Uw7>Z4&^f?W zwlgA2Hzn?h_a;8rpC(tGqGw-}3w3OAcxuKq|4f5ExMVCHQgcWo;C=Jl@-!t!g;&ok zxIbUniGxfXYaIm3bRFdFcm;|(a)?kG!dyT`CLwCAX=gS>d4s?VXA zX1#K;ju0$a>B4X$FI?LwDo|Mx)N$6=Muf`E+xiIh?6~}H*poei-q2H zPR|>)=Cz%J5ZINB(xopBB};N6eAtsap0DdH+AfJt9f!6@0zPi@sq$}OA8e?qmX-|m zHfxU2$J^0myitd5Yy==8aI=r|jCCBBbY~ywEaHI<}jSt z*Hfs^cq=A3WL0B;cgOy|uZ>c>5@XJ^+(>o4H6gq9z0Zp26IvbFF8^!>nhOLTzV_dv z)HnV+)YIjDeSt|D=Pyoelgh3Mt5<5Cnj|UyB>wzNlXqugJGplXKr|qcmG$|D4G1e^ zh>Uw|{AR(a4xaT-oKH{6iCp91nJ5Ib`sF2O@h8UTj~Q}CKiYPB@%%sjt~DNx4sn*N zE-imFsXyL*_Ue+={uP>`3>1r=02#};E4Flc&VN_MEf)LMCilhvfCS?88w?k{M11U* zKiQNLX#VS1rN4N@%xjUA#_nhRPwW&-{`_deOe+qkzZn@~G|g{*#uAv!AQjjh%21ha R`cngok&Ja&o%6MU`T!nR#rXgL literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe288_vulkan_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe288_vulkan_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..ec0413a6b7a8199aaaa80b83afafbd16f994533a GIT binary patch literal 12618 zcmbuG36xdUm4+W6lORqEf(ocO;83CrPElqGl%b?b1w`;sJfNfotSYdIIDjJ%R6-1n zQPenr6Kb4d9HYT0#u+sxhR}A~ofx}qV>B`L_uY3lUQ5>MUaL>u_Wb+b`|PvNKIh!~ zs*2=txm=rNtxkM=Q@0_ThId)@NuN8uUNrO3jc=?zWpJx|hMseHw;>}AT>j~ez5ARx z?Yi8?$5)x$2_f?Oy-l z0^-ufP8j<6wEZ{y^XZi0T-Dud>x3()?apgzD z4!Ld7vXATEeeR255#QdFd-eFPh1<-XY`9`WUK&69dex%#cC%>zqcp0x3iohv`x zeDBpqclhvyx3;XBe^FCzdjBKd`E(n_Y{QCrJ+raPQ}6F~N$n>U!`AH9JmB0#50x%< z>bt(0I{(bGPU?B(GsYVvan=xuWyu;g-O`G$t_`nfY}W-h3&n^l;cZ?34%R~8aGiMOlaow=E$c*GLE4w z=Pj+TnoZpHx$Uuy8dW;(P3r3!^Nm$? zu*G@wwRW-U$=|XU=dsQ;b&Co$h1$jn>W50iqRsjzW6KxhE30bf7H!4(taoA?S+}sZ zv0>{N>z(iu7uHbdhT@p*lN_ye*v8e@=Vw=0=88g7p*r>JnD|-q@Qcj|ugJ~XCq84F z8yXAsg@!6~=#Y$e-HB~NzKI+n#MT@;g?(aOeNDc4L{Tomt>K(wkRTJsZbeC7N(obXJ<$d89rTAQlcG4*w|jrzrUutg1b4Zrfr z`nu}sNpt2j6ximi_O4;Kz+8wimNGft#az0D{hK<33o(j5-NR>cp}MXzIl7~3^Ruc8 zR4VfA5k4cUxy4m;s=nh_-1FVSubA)1>O#IAiW}20=YDVFP8M%#;?p+gzE7_BrVu_; z-0$T4)E6q_UbW?^lzmQ>qI-v&V-G~#d!xQ*s(UB)Mr_*E_e!*)?!Cy`)wO%4_4htx z?dsaiL%VZj?dsaiOS@;%IXz2bGtZEH&~3pvpIp|@Ipq2x;b&YqALPNgX1PHb&S!+& zuncD&a^o|c>y<0ZaIR6VBExy-<)&mf@0{H94CnggPS0@eubh`Ka&~{^=4Ci*C0Cu{ zysL5xGMqJ%IyTNWWDX&O0M_MTYZ^$X%7; zybp3~Q_kAib$MGoS;h+Q8U4();Ny5!vBu)D7Jc6@$V=&s3jFz*ii zU5{K=x)H%O^+h~uj#YO}w$NRVXD4*mlJ)P2Zr)+<1$N(zzdLZducq^ z)|*}*;~mVb>U|J>lo-<&>>S~<7g$aSpS{7^IM!ND>58Qv{ejfleqY4-_oKJAjx&z+ z*dOUjf}tOvj)dMH>^%zoKyY?%4noi6o*WwXgV8+e>dtitLK_i!3Chd`%LjyhXkyL{ zi}3@{JuCgw+z$hX@8Lz?q1MH<3`FFV;0A#`PfAZBxwq!Q5|ee)CCwVh^(D{2MJn;N zPD9Wg(*{vLg5FxGn~QsRWUB9h?p_7g8{~7s7@kc4l@u}`Q zq6Q~`JG3g=$AgWhUH=KG?)YQS2h)4rZK0d5Ep*=(Hg#+6JHVLg*0eKHtm}3;Yv_Fl zeHhsKkxt@2oL-xHob!p`TyDt|p-)2lulbwv2h0`qsu8J z%;p&^PqFK+K%zD$fxRQv;$(W);r@mF6tK_L(5HZXMut8W?DN<0)94-Vd|^Ko9M2Eq zPDi?D?5BZyAg##LJ)VIKA)^uW#S{)RS_-Wq#mPDk9A(DNG$9_0bJkvFZ=g8Vv4|`*I z&TA3v;admJ`nn(Cy8x{HLTc#PGZDwj$M|}1cD(Pn7~cTa9^)Iq#*jZdUE4yi{3LSs z9kvK@{ff=AJe*xGr9TUaxjbvm<32Z~wiDAln^TUCb6d=PampDl^7%ekUv2tX>$8!V zJN(W`eR?JK;+~ufmcKY1cV1%4<>XzP^;&`y`Qn(R=*EaK=YyS3KE_-CmXEnF1TR6% z@%(fx7lHND7I|L`HgDG#@h?g6x8pB^laKhz!N!(flEz;Fb`EXf_k+Zq%UQGVTM3re zKlbxdu>9S`>PLSWBIiDDNV&_w`gksHO}SNIeYJVce@JipGPhmwJ#sZz&a*E5f_{Fg z%bSzu=SN5%#B*dFcX!ANm-(2JCokp1G6huSDX^9SQc#c}}iMZR^tf zuTHr=>COKddYk!cyB3i%fAJ-Z^Nd`FSPS=HMaumorvj znCoX?*O#5^L3H`p*N4E4laG7sf+~)8Z`)$3RK+Ms#>u+AM<|o0PqwJcWLYH5c*7s?!oN=u0GxRp= ztL>MFoNE?WGR||l2I-2}%*`{RkG|@$|MpqCe&*hf{#oQO#JKw+`rg6ab6w9N+O4~L z|19&$|0>nB$2s1Z;jLv`^yiVdOLM`+yHva*FQ9iqj5`I{6LH+`^e-aXBlb%v7k8u* zy$SJ-%%Z;qv2HKZ+v1M=8f-o6wZEc~W?hZ>8$?bYaomwt!LB*>@HMdW$j3Q(9V{Pr zv66(>21!X?JeYO#JR)~XA{^sG1og_*O#5^U3B?4x9@=+Cm(m@w_thmcCVe^ zxtufRdLNvf>v!la=lVUIe9ZL$*m3d^=MP|g;*M+ve}Kqm=QfA9BYy;&qifgSykgB; zz@Crnn*Rk|KJLheU^(Mh-+!gISzm4chRC^Qv3JDtw+6}H5zmM|`kHI(zrA|c?c`_Eu`$6MpJ^dBSb5zqKM`kRn= zzx)N9y*qoOJI=fF38Fn>|7Xg@-N~ajA;vwO{uab~{ujM1?#`!R>twI}zctdVw=q9M zX4zj?))JED6&vUzL|Cm(mG6IjkT*0(dg&H8HF0g-df zV(*UUZw->YJDw4J^flMme|zMTr`@`D&+t3Jc_)I8yR$RA zHpj*J-UTf0c-OWo*yh@_bw%XNTWp^5v8&6gUz6(g@pDr*Y)$B`5x+Zkqwfy4m|k1# zaS!my)E0MOH#qtD{@HUIKE2@N%ZS~Z@wz(QQpv&oJb1gg4_eIy%23*Tn*RmJ7e4LTJ!E)BzI_?9uSx0UC5IO56⪙ra^4rb zh;dQJ{m|uXQM3Kg<$J-^5#JmSK$nkk{lSjovvu5oDDv5H2cgSb$Nlg<7;G&0r73p^ zSbiY(i&CxxU4Am$Whr+ky8NMV7o^+(bz~4+)blWOd0TLYr<`YLBFWWv0!VW{qc1Er^-e^>cNm=cXMKmG z%ZG35=?FOEXpj9H2{s39leh)eWfa&oX!ER_v-j7t8tb#SZm_CwT%Ju zNq$eJU+hz9%6G&z35okO7G9fkjia~5_VElq9^4&&=RW}%k8DWmHUX^N7=I<}iS*iS z?w$5Yh`e#d@vJEWJI-g6@Bb6QXVA-s&t$Oiedp*?4%SazAD;&mVEKE}oK6DE?T^i~ zbTZgxKH5$}Q<}`*mxF%!SXLB;Q&-g2b zckm3bxw}T=Ij{H5F@BF22c8e^Oz+8;f3>@jDeg zzW3C@Yl}Tzknx+I`nktv!fOk^`i$Rc8NUX2ZSg&z5$ss&9^687{bDZ`fo*YS&O*0# z_VN3;Ca|#_>;5&<+uT2GixD};iQ^7`A8hRoz&E~Eo}J<1JI^_A;j2A-&jni}$A|BE zsjr-N_c!LYkMCGZz<#%K9mY1Vc0hHdkJ_Kc>PVVdM0j!&_{`y-vl;>5_^3!SYCg>&)9pwJJ5UYea@@vZ>;h3o)i1{`Sb+v z@rXYc=rb<$nMnTuXT^7cazbjqH?`ZFk9)lV+?C!j_aXPEHotc~0QUK&?PsYi-X#yB z$2+G#KJhMj2wvL;*3=LFVX$%J{r>a_y>r;SFWS}RU7tAW@hI4OINtc~>CeIPaXuac zk3r0k?-?h?am$C3n?cb+>2m&{o*$DtfMyXfak`u;@QzB&ZB3<{Np^vd2?^$ zUG*~9vk=dLUxVciA!g+A3c7p=Ts)_KgYJAjCc4kgZU)2Gp^(Hi#q-etdA|Y-=~~( z?EMEQ`f7`JZmjDMaIUM8Rf=7Y{x+XO^Xa|I_Fs|Bk!CbyTmRmjpN}5sv+4a@v^n#(|IYxq=DNXO U9Ppigwoj4HJ!AO|2Qlt{09sP^)&Kwi literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe432_dx12_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe432_dx12_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..bfebe1ed5625c8bc5183744581d6c5d67a2acb55 GIT binary patch literal 8338 zcmeHsdsI``*6&WTv-2Pc3C{olc6ft;HVO^Q|4w&+*+e?j7TP_m6wWxNBtZ ztToq~kM)~#J!S$y5JajXq@T083aw(6cEtDCzc#NtW4T(tWIExiSsw~qh4CTP&zgOF zmoGa2S>Xl8ps7j zGH=%J%OZm4{o>fTkX)n9%p##UGmX7 zGxon81}**D-SCIHo+`#ywuIjL{H4bwDOpZH^{2Py25D7@3i-}eEKSFcBw=x z`djqpmp{8xU%N87>5GkDq!mwI1pT+E7F;aB>%=`_L(iOloZ0Zx^{IE4&mITyx)u6y zj!WvS&uk}GrAPkJRg&hOx$oN2lJMjUX_gL7&a*rEeKV*ZHth;db(vobt(Y8n0eW+!Act=5La>;Htm;bLsmca-JQDC^;xzC)#M>+gT9}lAQ9&KDzaS`OVRG0+ z)lN$LFKy|<#aJmA9)R=woANJE$ZyeMP{&xol6&FS4p%kXhKreVaP)eZsSeP}Z5swip=(j7aE9MD7|` zLzv^ULFA;|p-svf6FL5dI^IJmhYXY#Qr2CO;}g`eRK|KZ!Wt4e=0nKFL5ggU5=@my ztOOZb$*tfZvYim4f>Ys7*=asB`C!@kCo`m_AD3rW?bO29ru5aYF$?W30v6fJdR}+k z3a(^fB5l{F#QM&pu1hD-Um`BU5xY9)a{^O?rBmk;QnLN;u34hp;JKE#e{D;Rs!FP7 z@6yr@s483o?S>8>Wpo$yXO!L5JvcHnI_V)l;G@7pdm3NeX-@|}llO7ZvY*3O{8cuy z%vLE14~6L`53Z=(%?&LCtaib1=ENJJ+Z3Vs?H7ELsu zgin}M`zpc-6|vrId)VO(MoAp{dZ|O)(J})2%{WF$7erOygYZ%jn+v@q&?f>SiU1ie z3jQTeh=76`UJTl9roz7T@D}O-Kn?&EflnjPgOjS&(1Mb?;Dj0nHpW)o-SLjqfBS zVC^XZcAlhEZ4%KraXL50VM7e5b;_=$xm!1o_7!yy#LW&dO(8}*J6x8&)MKyM!JQev@kLEmBKy4Ixw(%;Kq_$?gs{% zGWTU<`s`U@&Ab6OGmp?rbp>q38gq82CX11HCBkvqQGG|pPgF zebai9*{e_N!r1e!#2(O@hKG;XE}px2ZqRnSv!}{*-y{s}6nJ!sBIZ5I=c3j7(TIZv zMo4~P;he`0-=Fg!@BW2?om2aE%s+au?|5pVN}lJ%HlJbS7!*u#yAldvHlox+m^ey^ z`iJ{O8N)Gh15*XRQB#!x~D;VH#ZEo8zt7kaD##G_j{6i(%u(1VPNndfB@rs zL9PvxejD!)ilfdllZcd+JcTmh$fFA(9=#2Sj&ZC))tvg3kqK1??R)Q##_M32=!^ zhe&Zc`&@@Jt|#plCc6&{7bh*MSkff~n)+nwI<095U1p$^+MS{u9lqaV>lwa03}V6~ zAFE$DCM7U<^X2Q;W#`VzDqfIPlDKxm#;n4eTrfALkXs#6`UQlre8&xm>}bb?&24(1 zzYgd>w59Uor+=mAe3 z2h-nIUh4(`M{sN!0w%d9HMrrnmj^8oR=(&;0>E2=`Bu{h4zfYEde>IxDbDqCV-i|6 zOlfLriQhG)DPe1lKZuF~y-~7$=n5H=TZ}l8f#=Vc*BvhJ*s;g8W5;)OhdVy@F8})L za)4|kK=$m&Z$xfXn;nfZQ`faVQ&-Q?egH}TZL0-<;sroiIc5N$tR4qtZDG>-b%h&O zXXWI+1q};86IFT_Kof{VbMjbNN2IWQQuwJ3!5M%KhXT;y#cja7^E#rEU6R~aKM%U@ zmIORw15?wP_p)SC%5l3b^){Qya@jP{)uXv>yJ@-)OyL1jHjP;cj0Xz0@fGTE>sBWB z-J4Cz>y|fimwViRhjakzJFLIQD2yVeJ^ZTP$uFFGA+#V=GxgDhFD>t+YQEHfV7v+d zudYnPg9A#L3zg}2Oiq@-R?~|ll@Ek7Z`e$v-R~Wz-Fl>aEg|1PQb}g-zeJ%c1w5 z2Vh6@oj*17$@a(jCmwCzk-rnfj*Z~hibZ#{38MY7*MmsS%LUt7 zf@5A|>v!cpf(5j5rmSvQn2fKqF-78jub)9k-Y5BO%q?D-zbiwRPbHn#<+j=su z9`3*ySnrWGIR)1_g|s@6=C+m1JqxFHmZkQ=^G3w;MwIgg5?zJDZ-sj!P6{H=OcqPa z8JB)Iky;4gEtn&U;F~wJI^>)JTe1^(lVxPZaKFjYW7~h*(qlaWr+5fr-8)Wpd^4k? z^<>9n<>G3_rShqcCqgY39_^Tld#IqWM(6l1X(i**VXzTSb$sy7g&kmjlsdf&WOdzs zFaVb8@DVtYfS(2F;EW2VDtMhkywxs*nNKgU+0a3y5ev+})7Sw5?=>X@_YnEr(5Hd5?ab!-_arf$ATHvUojwUZ>K#CkwfzO^CK6L^s;sr_E8j6QZg}F}uyvfYMj0n5(21y_wO;r{(31B&(!T2L75Mf4;eVqy=a1#A{CZh9 z%BC`|8C=Fvj&(ji;Ip~5S2W1*%tyYEF^RJPdunfQ&XzwO0i*kMza^jC+x`3-o;AR@ zN+j#g{on`7uk9Y(AVmc4eRwHd;^gHq>s!@{}oC|;VKj_e<-+R7Opt=Y%E^nO6KfgVY|x+)W+I@ z_Sq8q;6xbX@cS7KS*(k=D94K%|M^3Kmx{~S`y_T-D|96>qO;$JLtxxNg)*D87BB{8 z;Ec04*Ar(a{tBsq-pQG7C~!dW16f8G~<2Gd2?Gyqhf`aE# zT#!iNxfKHLa&PBW_$}{sZuKWfWd2{st+K$J{-?QBzmXv_u^=_osKs*@69#e?9hw7@ zq#gxI4V*1vFDsl#B$mW4t3E%i(90FbwD1V=7iXI9rCAds+o%!dc-`RSIcgDAg;G`0 zj0U2T4TI$&&kIRVq8YA45u`XFfT*ISVhDf=Qt+7fPQRjUrJnyq_<3ga`Q$<`4qz?6 z&!+O9939V+KD~7`J22?`(*=oOybCcAEi*-{bX@iw)FQEo{(Jdg6wNz{tH>%NoF~|@ zwKc(6qu;VzR<3F09`p|&q`tfR*e}&br>IceQc(1MRF&Qxx$Kf|vVEoqXsvsCYKkR# zM+D(QKr6@$o#{7w7l`Vuma!YIwgXA~6{~L^J&5|boPK_hqcFJ`P$Kq!RelBA^D7w( z8fH;^M!{L|x?r{x#hc_vW;q3c>}b3gw3CQL(L@8}KQL^VXnYe9^e;K?Acr{m+z1W^qPDZ`5KoJ_&s@(1QQ00pSTS$fsQ1&Zm+g>SU!~ za9K8&5L_M43ubvHL%~x;1`(`U0|kFf&}IE+-jfaZ|2Oj<*tQQv`|Wv;q)p7V=RI)Z zO?%!WIzo&0%!7ldIr4dI_Iql5tXD(%+J;<|*R2$WlCFfBMNvCR1)0<%ORJP}9_1#M zcsW9>Q0J=@8D84M?=|G=6-?vTN+_7oi1JL}o}qFsfakZQk3w z$CVw@tkW@#Ae*^kxPdhiJP#Qwni*G7rjYTz9$70b-*Mr@g}@!h!7X|YI|ILbj3?}n1?(s_(qyD(stswL7oD$+jy8U>?OUb6BO>q5x`+3|{(OfbOu;JNh z4O@SvfLK98ncX+V_LGpno=xR=5F_wYk#HH}41+V1aSJ~)9SGo%&zND5Iw7cRThXm{ zJrf+o=h)KO;>5!wMqn019QOaFfN4Kq9XN#4MEp!>RN2L0pX?`d=k#<=`V7M$(2HDqLov>upEw4t3<|qpS2!F4%8FZmt6>Dc z4#fRrw-fyA31y)Wzr*+en$1N_+fCsgmP!sUm`e7PdftAZLr^t@B|$3G@=*@_?W~?q zu7-1eYj5}8x#E32tH$gjOn>JR@S~5O1B2lx7y;Psd~au~`p6&H;g8TDl}v8=vkcF$R;@s|joF$UUH?GQQc2?8Gr4|0fjp(_h$S<^1?}{--GWq~3y~2Fh&oasr zO)PWd&x5Qd?94Drw~ILL6nsfU7DcTHmlD{l>l$t-2q)vP+dF)CJ3DkDyp6L{U^g~U zuB~O(maeAhl=QO2pI9v+K6&w}R1t_7TbW0nATRxO0K7ZcIkUerFCGKoxRC(7aM?w} zjR2Cx&)uiDI>x3SAf=7KX(RZMKBo*bvvUQG-y(n?6X3_LM&^&1)6fSa&a<96&k6(K zati)QL{UhHxqesZ$WN!Y=UNriG6FX&3Sz?~$B0h9falo}d~Onh1rRnkGf#4>&vNHc zRX@Vwqay22g<%?w?n%{9MM`M@ATi+hA2fDqWTsIzCsQFiGZd=IZW#1DDsq{d`?-=1 zx8B!*24njdQ=x~5A#{ZHQp4rq<}dat=47(nM#BzHvgHuc4BcDq=xS-o(ub2&W0`DA zx5@8~FV68jLFn4u@;%@Eb#*Yyy@sqRO=2+cNN}#bA`3-r;RDiN5fE^)r4s;Vp+1Mj zZs)+np%z*^wjZOm&^l#B;?8cHs;c$^ne!<}O@_pn)tWOM;d9FjHSuw7)Tgb3b+xpe zrTM3A;n{jTaGOdyE8r~J`b?esXsZl#ZZFNxwB=YJ-vnfgD=>5$p!(WeZD}g?PR_>x zzW(YtaY69YuqXAk<;Fl?XVsYXi05cnfVS2{RjT3Ia{3`(HDHV|tZ6{KjzSEL+X*Gz zU|2Qei8pvBCahXkHWRl>HW8%m{91!5J}$^*w6$5A_M56ya!dlf&)u?WwknI{haoyc zbKIfq0L65M?2eyNPvD>=>0O2If^a8;XGK_boecPTHv!wI=Wszhy;6dB(z;DJgd7wg z@Sj+9Ppdw9Ua$@83)t4AU36WAlAF*=AEfE=WIPf5!rkEOFqV%j}PI^uyIhm4xFV*Ua4mV%%1Sp z^#fYThhTfemp&Vj3;aj<{$MWyn>}!wS!PCky^xoUY(qB{fB=tpgkd0P)ta=w1?bV) zz*Y7$B1=Ch?y~PD0ob1=R-LkEUz8hlbYggF#?^pKqambZG#%1#NF?BW%bfBw6-SL% zPtU(MPt}QoOdV|<1j}?SVk}( o-~^v2ng8zpXT0y<|EUg@tegHa_<#8O8~n+;?Y-(xrvSeH0E>CaS^xk5 literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe432_null_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe432_null_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..77ed6f870a18eb2b6af3df5fbc1e3822381271a1 GIT binary patch literal 486 zcmZQzU|?YGU<}-ML)7esBj1D%@+<$B#qTaHI<}jSt z*Hfs^cq=A3WL0B;cgOy|uZ>c>5@XJ^+(>o4H6gq9z0Zp26IvbFF8^!>nhOLTzV_dv z)HnV+)YIjDeSt|D=Pyoelgh3Mt5<5Cnj|UyB>wzNlXqugJGplXKr|qcmG$|D4G1e^ zh>Uw|{AR(a4xaT-oKH{6iCp91nJ5Ib`sF2O@h8UTj~Q}CKiYPB@%%sjt~DNx4sn*N zE-imFsXyL*_Ue+={uP>`3>1r=02#};E4Flc&VN_MEf)LMCilhvfCS?88w?k{M11U* zKiQNLX#VS1rN4N@%xjUA#_nhRPwW&-{`_deOe+qkzZn@~G|g{*#uAv!AQjjh%21ha R`cngok&Ja&o%6MU`T!nR#rXgL literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe432_vulkan_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe432_vulkan_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..7ec21da8d223cb477db7bb1dc7145d6cb32d4b76 GIT binary patch literal 12618 zcmbuG2bfjWwZ|_YO%N;;K`AO0EF(&>Md=JEWn@qR5xfi+7?^@H12V({HcC(lF<7Ih zv4IV{##p1l7Gp<^i6Ok=dx`NqpD~&k^ZT8979K~w@4fGPJ9oMN>%Z1sd+oLNKIhI1 z$>nmn7Au;a{KS^dgSHIqu;!CqcYM8Q#$%h`TzlHUX7>y}_sGtJh8?`}(;IvCI(_PO zxy?_kKI`yi?@geT~2e))`*?H=8= zI3V-i#`9~R?f1XC<)%#kL;pXne{n_od$tXKX>HY%J4cVn@6Oa8y*|9_w*Id^e?;5U zw?6dJ%{Tmg!pL(*4;?c7m<_Mrwsr00GfJ=B*syWJ;=ZTk{@?6o!#2OQRq3iLKN@n_ zZHrcXT=(AdUlfb@&X(M3Cw3Y;__l5L%{uw0FQ0Fm&~@_FZ%=9LU;4^~&5!O@@#)rk zuRgZTgEziDuScsrHsz-EJ?h<0cTmh0tf>35n>#%H!Jf-&KAALR-JXs8&Rg_w=@O^D z>#HgA&pP{*ZdXoxeCXxd`c{-|Y0-SY*123W%Gn{e)sD7Xu6e?=%e6}S(y`@ZOX?eD zl?)izPkVnMh#MLg z6iSYqRZ>} zVsA}^@7nVXdB%3gwZ)dqIlQ*UAq~S8&YoSUD~b8aCzgh#zPzDsVMRlZeA*=A7}|8+ z(z?o7#BH718QX{vrDIO5ty)-J7*VLNC@nh$&Q)r&)z($csjQJ}m2lRiuC^iHP+1FG zoJU`47ptE5Eqieu>s(#Cs8C&~X_!R)P>EQyS^s2g`GR~!WzC$TtvH|cPHe+#7uGb? zZy#g56Mp={Y6@Ln9J6zhqqPp(n7X?BtV+u~sj#?EmHM?!{H%HS#b$(8eR+_8i-VeSB?Qb-rp?W&WG|+lTGc%EH-+#d;L;+9hle zapd9!wKWtD-l{mSXEd2Rv%tBeH@CKG7N+ff9m8)J8#%Y3rchr$>Dzwol6XFS}8m^o#XiiyH0`e&rQ) zwN+IUX3wrKu+7`;ox*N`xe%i)WpciYxpWTuH+2XXVibM4gwMo6Rc%FbbVt_YXI2%c zROH(=e1=zXiz{bWe#fu4=X-`PdQ{ocWyEZ)|{r)AE4pE&88LikK^ zzmxM*SEz`4)sm-D_BmCG?j3TDy%BZqje3t%_fG7K*tDzflW0ZVdy%!PYxhp;?|sPH z)wP?4cIV34)wP?KcF&}9dX`3Ko+108+k$gGxvZaa$n{3T&$x0v$b)muasx7)&j`68 z8O}W9#%4IzD_54`T%+8i4CkGfo1Edib8^!%oa>i6GsC&Ra$ds7+5MH9o8hdLTvdki zuF5UQaMnnUBfmYK_fKwdhV#D3os;3bTXIV?T&I*of@6F)a}Fqv)-by1BTAN2mJU=pD z^SO>==v|jwLXL#H9E(r)aE+0m(q*1tB+3g7(WKx99@_86I0!F zL=8>?w`o?ij|Ce~yZ+-+-SNkv52W|J+d?;ATj;(oZ0gqBcYra~t!aCtSl69$*3kP9 z`Vg@7Bb~&5D7`lIIOpTRx!lqxL!W?lXUAQJgkFZeoip!~k^RT4JwEQh#FUdS zVK&cTd5T^4BqVBc3fMbhEl#C(9qwP)PXqg04Sh1$XJqJ8z&?K+Kb79`&KLI6!SVbs z?lh!J#(oC4E7FWS-Q(%VATk<8Z!DYV=dWlp=&iA5=1jzW2|eFLpV>sOXrj+*q8FOz zvzzF1n&`gAo&R|9@m^FS?yI`%oQJrtpTo|lxBU(5`=JVPJ@!M1;+d{SJV(~Xde|Gw zb6$gJ58qmF*4ODm^8sM@^<)Q3)DgD_<%;i~g9`|{1YCAd2voYo9IM2o0m!zEWBA@Sr_0^`IwLS-l zxx??=)Teu5FYd{CVEIeZapxztTu$D#S+Au?kuQ!}hHi`)a{<`--)gYD z{;{8zg5~cfRv-Gy5IOgGQ_5Wq*2i;sYs#$w>#NOk{zH1(m${vi?~!Z4a-MbZ7xeQ} zUEZ8LKR-fxA)X`aAa_No??dl;&Zs+9Xl%6m2^l80yfdPIIYVhi6Jz%f32 z*Tcy>#`6$!-3Zp#Jq+KQ!1C*n=7{TSNq;lqGwB4@;`2+txQ9OlM@>!x$346Stj%YG zwYwDwzsX>qS5d#)Qu{_`>jSsf+~)8Z`)$3RM9k5(>u+AM=BL1(qwJcWMwj1^*7q5(oN=u0v-CFW ztL+zvoNE?WFwS$j4(Wv0%*`{RkG|@$|MpqCe&*hX{yF3b#JKw-`rg6ab6w9P+O4~L z{~Ytm|1#CJ$2s1d;jLv$^cRr0OLM@*yHva*FQT_Yj5`_WfjDk2`j-&x5&Pwoi#t+* zz8LY2%%r~sv2L%>+v1M=3T!>>wZE#7W?hZ>YeY^TaomyDz^*y=@O7~B$j3Q(11ukR zv68P=xxrW?QP^8#JR)~XA9UkG1t3b*O#5^J#_gvx9@`;Cm(m@H(+`5cCVe^ zxtufR`T(4r>$m7l=lUI-e9ZMB*m3d^=l5WJ;*M+ue~8Fu=QfA9BYyy!qifgSykgDU zz@Crnn*Rk|KJLiBg5`{3egBQ#W_`8&J0jtixceje#vS<&uy*U-CBy$G*gFw?+?_wdX>(kh?>~X%9dC_W(tnJ!Mm*zl>2E^f z{qkpU_U`P9?l|wxCy4fl{a+~;cPEd&7%}dd^tT|^^S|kBad$oiTPJ(%|D%y+y^Z-9 zBBzfy?#^Gp-H_PZ&%tLR@^OCt3YL$%^95MW^*h&>^fu?x_BZ73h;xY}&R1aL#9aRX zyT0sPU!%*%dG?Eei3Y{mm=Z+!o#QkX?#^!T z+8h_>dv~zB<6YYxV4G{x)(Md_Z?SpK$F44~eod;|$Infju`Nb#j`-cVGkq7hCG^^2 zkGq0br?$8Qd&0@b_s?!S@aYaGUqu4Nx|`8Xr{g5|8ab=(hZvyR&OAad4CoUNmLc{}NsOJ&r^0wfPOgZWH?1yXWkD|U4;uvGf z4*>6)+QWBX#@ATkI|!`5_A=rQV%$++CxFe%`Mu+=buhZT>m84T?+`fi&-xBU zmk;0A(_wJN(H{FZ9BdBSCU6U^%LuS*(B@e;XYa3PHP&tKvq}GvslVsfvDUB-~T6r=h4fD&qT2Cedp*?4%SazAD;)4!1DK`Ih_KQI}n>^ z=~S@Ie6*d0$eEAWbw_^k@r;@bZpFCBWeU1+iMyc&5z&JEjMIjyV%-a}C<^$V|j>2_{pYqZM%GZEm)>p_b84G|$T?0N&+fV49nDz@uZ_>Q<}`*mxF%!SXLB;Q&-g2b zcW@rq++CyboY#Bj7{5o10nZ1wr+07sZm8}!_hc%36*%@JzHeHqYItq>jYhA@_??a( z-+OA|wZ$GU$oNf5{oLcT;I)NcUB>T>j9)#xw)h^<0Cuc(4{jm4ez6yez_vIuXQNv? z`}lp_Vz99s>;5&;+uT2GOAtB7iQ^7`A8hRo!Z*HGo|EC?JI}dr;j2A-&jVW{$A|Cv zsjr-N_c!LYkMCGZ!G5=L9mY1Vc0hHyBxeby!PN$fDeZ=hVN-(t^~{b{9loBt5V(hW9$#W`f7{! z#+S&?nZlCbjp1(>M4ZrhEr@*BJAz z1#5F$`2GmYC;2;8*7piXZTiOh{l{QqXft=u;W~Po=g|GW5|Q&9ik-*z)>U9W$$QH< zo*B=*e)`9|@@lYmSFzdot~{Uk#<>PUpLq6N3)a_XUvSr<>t_q@Cn+Z#-1RAE{4(CX zJ~wWFbG-iAjUTzK2WwYsc8~S9ZUCEOHtt4r$7qYVcY=+r zE%x>^wP*L%J&x}+cY{3#o(spg?>^^GWb8fQUFf~{KIhf-H`Z8s&xw8fe0mc2 zM8uy9^cj=-jHmyQv*NozIVrW@o7(No$GzSJ?nLjH`;hxno8LPg0Q-E?_F!s@cgaKO z@y_XsPrOSWhS#=>;@D!L&@^@NoaYmj7Yx8+z%yIP3 zphwI@)0pP*EWEbJ>la`?$tj(-m9J3iLx_~+q@eDVAGFVXo>iJ~pyZccgM zGy0fg(}_YzoMzjzM340gOW>!{5;;JNXvcy{!O^XM5d|2U6v-rU=G zSG@xEEW~r*S75orh#9%OiY{LQ7tg6*qdT9^xbS-o-MgwSYVkUlPqO#gjTP^!H^9C- z^oi%$n_%NAHankZ@mzTeLLbM*e!mTl{qBdaXUP3}2VR@HzXR9;_V1 z_!;j#IOi!Z(n$_sdmr9$lQOpW+3Pp(&Z+pm^k>2kz)96Xfv9;qkr$t&qojR+Pu7M*`+s@ zOfTzq@4Uj2KW%OK^>lq(Y}hz>TItl;*FXN&m*eg)e`9!aHfP@P{}~|HSUd2G TgTC|6_9@bN^H$z)2;=?<46yYe literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe576_dx12_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe576_dx12_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..f75dc925c1504bba412fca78afbc543edb84d267 GIT binary patch literal 8338 zcmeHMc~n!^x<5%yMlv!62yntABGp5{0D_nRLQs^Ts5tZ*KoncR;8aj*GcX$^pdyNG zgP_&c+Mtw*wKfBV$e^iOMWtTQNNukJqHVFYy>Fj@KG%JBy|>o8?~nJ^dVA%Z?CBf! z@B8-t_Lo2q1Q9B6Y3B!AgacxxcGTzi-?y$lYq?stY$oorIqwQwgmJ-DPn*1bR<1Y% zSJ(cv&Z1KHydCN~ok~1BF=pQe~yV=4nb%jz_-f8b`{_sWW+!Bdc^p~iQ zFMo8Wu4Z*o<0qRxNiCYX1p1eIEf`yz=gE7*`kr}zJG<$->(lS9oI3&H^#SPHdCn8z%bGKbF5;_|6jd{fo|tYiv`qy>k;X;^IeKvLD|0 zYt$R7`gw#65l00$0B)`~1d+gZBzPp?$-w%+^8jlzA!u=8GD-n;$o_($OZuli^H0j(K_R}@4}&^pYW!<`SQXRh_42Zf>5M%u+ZY}8V0>Pd#p&Yo zbOr=vK}2W?z$qakIRy`hFgY=xKQ7*In@@+J6fowXLhSTTV2rHvs})<|WD;8tRfj93 z2M{Ul-tf*W1$Qn!uFfH@lPz$Lq;Tic1X-05tuqpzSa}3;7sS~lOfAQ+Qz}kVYKGPK zs^QQ?QW_WV20T4AL)enZBK$E%`6yN;Ah_>HS>sq0rxkKLu?huzb2*4Z&dqj4zhOkrD$bOVaV^(Bz*8koZ< z>*)~bl-!|B${ZK5enwdL5ORxw{EL)%SHyaZuu5di2cyhk5i1WOZ5|@ahR8t_iA08% zv6b9%4oS8fqL*{Z{m8q`EmIGdUU)o9TJnBbR^@IjjBZI=3mY?$?n0oEy=>%l*RJA9 z7AH{me2A~>OzgUJ68RzgG913Ab0H@nB}h7bJ}x=S@9w%~+D#to@dwv8SF0+ediEXz z!+@y5G|*n?@G*LKp*6kquI{I!!(&q(@crKlXxZ2B;!b-Su$jD%gOq+Bw(8H)*`>A$ zQCJ8}J9T(f#a3Q-A&;D&qhvme1YQbh&I&}`;?;Zw0SXEs$f0mo81raI(bHVs`=P!< zTT;+my|1Cf*3K#9b*EK6wKC&sJf^>A@{Swp*cH4qYi#GOMBqar{?+*C-1q$`)lFUl zg>5z_+{aO1{^jJn(NM8jRw2x-D9$B-I^(32nQvuo18<164JB{XkvAdad@Zx^Wu-_* zF0zt-WRth*$b~X&2u#3cf=(HEvyQw~M9!Bn!O%7^$4VM`#YDygL)*X{E9sHKK5FNQ z_2{08DDHwq39yb1H3%SC52Q$DLV+wu@kom=vN!>knJfnFIy@ekY$*7tL|8Q0fZ{)3 zQ0%)1>nM-$V%yygYtV~hk(XN?;*OQ#*stc%i@P9-0-J=D@|YaxHHO~d5MBhjv7+E# z@_=v%sA0vR?Pe(KTMug?4gh3-P!V`H@Z32mS`9TYsSA#;c3`7y%bwZU1zw1dIF9qdpRhtA*R zkUjqf8+IyfK8WzHkus4$O84htlupau|)=ElmeAJ*OP5NOV2ha7~*y%6wGKqC@rWsQb@{m zDpfZkyzfbVPhtu5L)17a%@dBN3*l_N7`4dE)-ths3fomW1iJ_$A_Cs|<-1>qQ+^Fx zy48PwV!Kje9SRdtGCWe)d*|q$1n%EjKhkcL3=D-C41C{T6WtQ`|AKW44*d;uz!+Vi zOZ}9eCkBM#$a9QDJb5)wp^QKJu>a(VPy2T54rZOqQ^`vJoOB`g0_H=UP%8#Fj{IP`E{sSEQ4Vfk1-WKTlzy{M1(l9Q>Kz@z~Hy)4J?C#Wied%s%l@< zcb_Mh-Rob#W(o#m{yRqhz;Q=$p?0i4I@|6a)q$RB1Aq%Y7Mv5bcTi1fBu|aMb8H$! zh}GHGI+A`paj!7RZA7>6YhCv z-Qsa6j?P;s-?$+wXF+DsqRiri^_wcFI_P(2oFou05FHuAqu6LhC!kU!pxk1;sk~Ds2`vQEPVnj z|3F!dD*&8?VN>rv#VxVk71O;eaG9{;m##zr`~XmY!1RuTY>2Jiv)yT$Q{DXN_~uR1 z8XKGA_DpMx-=6IUydqz3lx!TnLPX^jBZg$ag$rf1N6I>O?Q`ka^;PYWj`zLFKL5N7 zAR7UYJvaI@o*UU_N2Ao#b*<0T)pN`WAhF&aumDgz0Vu1-4FHt26QHawNZh!gVDs9{ z?3~x2VFG9(OYQ<_0x)P!9S`k@5VlVVJKZ5T3((<^0Xn?cO_+6FdQ_5gqTAYMf!AFV zfn{u9X*%Z=3k=~MiImAewA$r~)x3-)L-VY9VG$upua3D-kaCHOCB&sg#O23` zs|JXxDddfjAIKFT}!aObYP-N1KjI94kf)zK!1^3B=^JT*559Bc8c z+=kY#%Dx2~X!mSc?T9c5+iBy9goB>n1DCu{@ZFqKv^sA?=9-lIJ)`GG?%%fcWL!Pc zfe|p@B5ZLCs&x!*btKGhE1iE1PU$R7>4O)HiWiJ37Yru22!&q?_lKVnM4X)}mX^^k zeRDFU0Kl6+PZZ8KZ)$bOJ`Ij!NA4EO=&BK`$5<7sR-Aoa*>uR!8fp zj;YF}RrE_`(^)4&Ed396O~)*hUr?=M{aso?zjOo~gwt6+z0to5oR3n+HvzA%+dmD0 z?K*N4j=*8DAPvN*Fp7fLIm}z@jGJ8=GQYY=(sI1#XYM^UkwQc=jQ*w|1}+@K73G|GH5#QfR7e1HKSo&kiuP(@!QMC;A;PCmIrPS_Sy zu~kvw{%t&Se28R2m_H1Weql4mzr zN}uqU4^!{`u;F)y{a=5Rlhxo&!mqpLlf3On{gY>B&xQEmKb=$eRm{<^?->HALIPfC zkP*klLuAIK9~M7S~Ao8_;)V3^p%RTk8-d=&P^*6s8z1hF5Waib$!Vorv ze$C)Ko_xIX*&*+(HNB!CxgU+@O}jcY_Q zYtB30Sbl7G=LRamd2hqZX%a_I_c>px4qcHrSyMchI47)e=$Ajgc$X}4<|nM7TkUlT zA)#UQV7oZad@s6Y2ArP8PWusxPv$BV&%epPWfrbF|8zV~Id!S=Zl z`{V=|bXoapMgm+rKIXL&1rSBFTnqtFK?)xI)|nU7?UV~Y2tUrKx{y@h$pNHg_t_Nw z<6{$9(ucQ>Wd#I&eI`Ev%y-5oAf=`#m5$54gIFXs(Z7}tMpC^Jxr)qE+y$HsU0)rP zIrb&fdG)#`?qNTFT*{k!kN;40Y?=zeGzCTPOHt|FNSB?{Oty~{{;jo7PEWH$?Fz^B z`?rG3(1~`lcaf-Wz%qWr#daw1pknRKV}}u6=QGbPaugGRtWQWJeRlpq+xpizXW&|AAq{WCP?{G>ZKf2CSnz#_jclN-*); z12)1P%M(qQ9yCzflYdW{WELlq=#^O1#wQ@JCR(tcH6Sbj2Kkip>-kg?M477e4Jysz z;)1H;ctK2$Bq(UQ$RL7M>!6_bak@-<+5=&+E(_5AH}f9Yb^t-F_Pj^ZCg$4n9ysBq zJ?{}6rN(*W!hw`*`2sfkEww(zv%YM7eGbCwRtiH1S3=C9$lZke49d~vl}b5}d=pK$ z94=O<^Hhp-PwkPn>T~o8hVgSH6hv=8cqVYq(dXSNSKLDBE0UV0hVzNKQ52Vh*Q zke1D;+M?urIp^YJ!eWV=Ayw7+Se z3p=<;r(+mFHgm^t18u;0v>3~q=vNVjkp8xwv|d`atN&zwz^)VE7Cn!hj$J+`lEFqt z_5yHYcwicM&|^CaCwd8D_D8j$rvx2GBTfn0r-~Pq(=W|EnfK_^g#{<_3g#)6_?kC0 z^{S^iY}~ZH*`XQalZ}mzo3R^A&)|LAnC|xF!TaFikqyjXx5xkAJ^ttJ9&rFuB1+t` zC^&TXM-|`S6|f`Kq(&nxLv2X)xaf3cY^>pf9bYO9?%}zA)IPWu`o|k&VKVB@=5D_6 zX6VMV`S@}w!sxy!wnsu7doG3Jjt|G8BJMK8838eqehZ744mc3x(`Ol^jwD33qwrR{ zo&iGfdA4+}IN=C^9*_y)NBq9XXV?R*0|%FqfW?Fcm7T3R?0Z0xh>);=ygI}X&S8YM z*@JK;gBx}AE+8a+XOGOCGt)R}vkXH(F6r8<9^=A=3FF|(ps*`;g~Kr*%-D^$>PNBb zKFeWVli=XB9SL`&Ji29#u;OR>RlWV1XaUmBBVkr?`6YZ&glu^ zYB=||_jdo4D?ZS(X52o*^j9tp3w^X~7)(dN3_y10YdcxxdwxIxe(3LLI{Pl#z6M+98h{$jFn=%0^w@KK1Bs`@;fNmk3<3t zw7R(Rm(>>4HBcpjUVTg4%q%%Ze>-R|?pty*6^9-~U{{JScL4%B;W^x4vTsm8!wOO6 z19pN`6Qm(lQ9`CBNasQ>&S^NDnPC)=%nbZAotSF8C@2w2>qA7#Pea$NCWhvCnWr;f z#KCL0JfN|%+hK?GXJc+0M2~>aLZs7lyi#;X0h+c_M*R{(J-cwRfm%XI3QB(7AZLz+DtSZMaZ!eK zod!t6rk~OqsK!2i<)um`X2vzyO-^d6xTM?YQ!u%#A~VJ8s4SD_nNg zaKiy-@iVuXt*n@|Lxj{(ICT`8(&w0NW^}H?@LK}#V*vcvRiuUE=2YaTQKvaioaTfA zcR3AzCn75(_#EFWG}3oxcIFHyD5W@VXe7jj39Rr=U;k%W;e2i)oe2;&I5AFftIly3 zP*mT-;$xzL;c~+a4Bbk!`m#BWq~N<@ZHHZMaVJ3Abr%BmmoI3{wQpYySj z2DjeVfd+l&C)1$^Btyt3^|^-2#nfNwS;Wa;yN-n(o?^?!r5d`o-O<%hl_d|RsKztc zmTr^pD_flBdjQw9o8@c1+so=urdu^pRgy@jW1iqtb43<{*un;-KazmM$(Bz7n2C5F z5xbrT3x}Giap*ym(oF4?6^c8%ZK}$eej?{Xj+zLG(Sd>NnIt~9)KDE4>q>djI#gRj z-CdG*#uk>P#~in@q_Z5(q;Aa6xsA2Tz~Ii3ybN2m1@eg}jdKNtZUaQ2e~So2W})(o8h)$`CfisXfQj{n?A zYh6F2mAng%M{Mh}NpgYT7~c<^W#F&}W;4soh>s`fc>~+fO#vXlqwb+7a9Xt{^)LQ< zWG*n3Jw{~er^H_N*&+bv)8wvG_8f?GrHoBZPf5S(pJ6lv7muYu8V-Q~tZ$iDma5{Y zvFe$H_ZFx+F_0-^twUg&u7`Y_E<>?LTW}>IjDaHI<}jSt z*Hfs^cq=A3WL0B;cgOy|uZ>c>5@XJ^+(>o4H6gq9z0Zp26IvbFF8^!>nhOLTzV_dv z)HnV+)YIjDeSt|D=Pyoelgh3Mt5<5Cnj|UyB>wzNlXqugJGplXKr|qcmG$|D4G1e^ zh>Uw|{AR(a4xaT-oKH{6iCp91nJ5Ib`sF2O@h8UTj~Q}CKiYPB@%%sjt~DNx4sn*N zE-imFsXyL*_Ue+={uP>`3>1r=02#};E4Flc&VN_MEf)LMCilhvfCS?88w?k{M11U* zKiQNLX#VS1rN4N@%xjUA#_nhRPwW&-{`_deOe+qkzZn@~G|g{*#uAv!AQjjh%21ha R`cngok&Ja&o%6MU`T!nR#rXgL literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe576_vulkan_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe576_vulkan_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..b532faae4b4c3b6c491e91716b2f5b6d7654ea5f GIT binary patch literal 12618 zcmbuG2bh-CmB&9onjkicpaLouEF(&>OBrB5DIyKD?z+ZEV%*>F{oaGGBhRz@JbUvU@BjSIx#ymH?!E8( z%?!!qa=BK^TAcFarY?gv4ehk*(_VLdy@SN%_gkp1R`mB|RR`PkrT*O@-3;SIs^DFJtb!dex;v+r0VZ z#l)qJ8aw!lDF<%&=d&wUl)bxlz^wLL+aEHZX~nAbclCW~b@y&troVRWfKOgIb9sly zb}0_X{I}`Cy65`+?{2xt)Be!^PitRV*73eAr7y3po_zPH(fQq&`r|iByKU+J+6zat zKV$R5FW-98KgN$ZZ`9Bs(~ep9#vPkiUpc+(`t^XF@x{e^1#efj@tS{)A(+au6<{6Q~$D8$8UUW*UHZ} z-+%3~?T&t<^nuY^bD!m=_C4yo&$d&{R;;MUa~nH7^Wh##Yd@VhWX&E;{VrJWNZBH% zzUQmSbI&>V)b3YLcw*?4Tl!X(Y--hVzqYwt3(DCkx7m)iYp!L&bjY9Fx#=-#OPd*P6a1GB#gTTUx<60q=n9!g%>zkxr>NrWOBlOf|;V_=p>u z<`qhgoLN#;lb>BcZ=Gw0C6_DDH#Ah#&z@d0eO`UtjKYL`)5Q9GWg)SXcys&ks)ojV zZDMargzwt(jd{j)%C*Oq%voAj>yXA_^JmQ})R)A36%)$B(ooS@KfkguM?US6aSUxf zZ&`iSOyai9?TBso@UqdT)m6{0DGV<(RF;*W3g;@d+3M=6W>?k9wMjT@QeW4YZ>*|= zEzYB_wTo3x_?Epmk9Dr8TTrMe)HY6}eyBt&+N^&vwqjnsvZ{7=(N>(#dMCEhy7{$@ z4co?8?}Q&WzlK6L6vynCQuu`S0AVINmlUz4vMR+axI|Bhiht*UTtVzC~@ymks( zL>#ejUR^DPgSRTq>lsbv&Ma^a>CLIDo{4Fj-_GGTjE$VrSX*dlnD}kK4oN&8Rn6j! zsI9D<$##_GYijbvn8p0OBZ=>@eC6C(obXJ<$d89rTAQlck@a=8jrzrUutg1b55J1a z`nu}s@v~+%6xil%_Re9qz+8xtmNGft#az0C{hK<33o(j5UBhQWp}MXzIl3ci^E0Xo zR4VfA7Cxob+~TTPRp0R|?)e_!SIoDxx{$Aj;>NVkx!>Ellf~Pb__WTs?-M3|QwX0a z?ssy2>I;=|uUhj|%08#c(7i*>u@|E5y;0vg)x8t@A~x;n`y^UX_g-Y}>e{{2`goSvmonPWz5T9INh{Y@xdz&rayBCF|cE-Mquz1MI#Te^2_}h)uh?_tF-+_tJQ- zttY)c#ygZ*)q5fOC^4ot*g3*yAF!MfKKp{RajdnR(iux1`h%&p{r-saA3$$y9cLWt zaUe1TBJ_jMdn2Lu1$&P|KNy_dn?ulZxu*w*{ZKT|y1H{6hR}wEUV<`x-tvB-AD)UG_hQ7@*J3w`dX(! z^p0tj>POLAD|K^m506guz0lpO;Ch05P8h?psc2J=IL1<(CM49IDQCy3q)RhXsYY8 zJDCil-v{qfda*vk>3s&fe)SQl?i!tAWNIVj#9l@()~^4kRFCna(aq6yX+J5|T}Ra5 zWN^C{Mf(`A@wDqdHq{+}9Qr_d&$}&j^Rz;^2ZB7My?ybdX^sdAG3;XF{pR1uy0{e^%eKOeRuj8lCJKp)ieg-(6AI6=E zbj{e$1b0JPkf(b*4H-m6!|07=^Zfh`Z92U*_RO4xxG$mSo9Q!}>6Oj&na%V1VCaLt^gm zJ3sa5k=ToSasgQWvUJ>qi7l6tcWu^dF;e71@t1>*Ex$O8zXI$W+QRSqi9MIIX5qIIEU$m; z=jCAedx_PD{t86Secq6ASAzBNT;85?tHAnd^PK;H-nKQjL-IXxHCWEGF8-2!ZmP?h zljrA$NH4^5WF6$LO7(r{U60(4Qhq=B7`q1Scx|4!)99~8;>;Zl_RM)su1Rg{()_PY zxxMMl|2le``D?o#ku!hsQpR~kZa}Psd$1zqew^~2%?ae;8NU&cpN81N_a<q)!_ZG1HTBIf7`dZW9iug=Ak+t~z(l74ePry-=)4_2MZv$)d*j|*qe}NRZ_M!4vNigPNZh5_;No2>-jSEkJ0QlLgzSwtZcqA`5$zHCm6VG+Qi;A0 z@s7-(zYVc&uhQG%j{FL2J?yo=rjce{jrnUtP9JgHk=MblIri`ku=B{rIe8N-A9v&} zu$=30uD9uJ&ZX@go$Gyc`8c;9fE_0vcjPx_>KYs(u$KCl7Ea&>2Yb(9YxwQQq`3K@$;)wGV*f=rQKf$gq zJJ;9f@^PO1V&FLWxH~Q2S4E!yVD6@?~ZZ3JNm}m*%?l|b?=(tcY*Ux1Rr;2S9ooX zi}Sr3Sl;ojZFjKEwQ1{&$eFj;Jm+Fpmsh_o)$QZwrY_hPqPIl+?%ajGE8HS_ZL!DQ zz$;T*+<`sd8N9D| zrSF9`dPqU0W+~En{8FKIrmsM)n2ES##^SAJ}Fcwe>;dteZGnNBPKkfA9jv zMI8@7m$OC94n&vl0ar(Sb36!LKF0M0JC4t`aR;NwXU83aE^i$V!1qwFvE-Me++kq( z{@5=~xe|2w32;}W+~Mf*hr?Z*a{bhi0dP^zBhck-!5x`$(jD0k*VG?HeFwxb#*`lb z-X*n%@4$?&vBGx{Sby#1#2v)Aqrk?~Py3_9?E`;ws_zbV5062&xrf@0MdaK=vA=t; zX2*ezsqjgfd1*U7HH^x&CB_{y_ z-`LY(aK_Od`&SA!2W{iI1=eLa*fnVLtedm<*RvYyw)fej|A^Gz^Xph^;<~ks1oKIL zPo`h&Q(4Nl$2J~``!ot(n{$n(x5oDI3_l6n6@TYH85x6YNb5Ehtlb!YCF^nY+HLNg z_VI|kamDehDF-{wXO!>%Q^04_%ZJYdu~bhcnRQ`^{u{W106Z~Po{7TD$*wB?Z*h~pAWranh2;mq6IY;nhDqHFVPxn6T{ ztTAHF0@ykIzU7>=z&7X9HXD(1oH(A{bHLl1vkG1tpKr}+40CWz#bjmC3c@10}(9x)m`7u=EFz45!Dy5roFDe%?c*pv9aX{~DDwdpqsy*A@_26}w& zse{)Rdps}WH#PNhkI#YE7Jl^^zcVv_4e;9Hdq5-DvDQ7f`RMw^UMv9H;>?_jZtd*j z_i+os#&WFt*FgZrz89vx za@yVBnA<+SV=V^z-O6`yyf>WpN-!V(-okeQfOkWmSl6o5-V09O;D3^oyU!Q%!-GHv2Ew~@2oOEzErkwH1dH4F< zxCzej`fE3SK-Wi`XV!Rkf{m%IWBR?~E-;_u_pAClU*x$CY>wHu>(L#fE#lq{Hnz6d z+k3!#lD*ZQ-COrKzSrCf_8fRF9OJ(GoIi=N_knk!_ul)QSJ&TIW9U66_VM%S$>5U^ ze=g8xbm}vX{v*zc?*irI)P8?zw>Ka6dIPvKy<;9g9!zb1?|2C8^G(}NQ(L@C9!8IM zPG5ZDUGfOLwhgSQ5B#HG_-twMAaP0P{(HMlwh3uGM$^^I+fcu~x^w09WLT-`9VM&WB1AZ4q~4%KM(t z#~dTy7s1+{JGhrpPCmGo!SedWbKn)Q9)`FzHO-|Oh!Rc%p=H^6+7z1ME6cwfB<_T8aR zJkQ<&8&|Q}`8u zdB6M5E-d=<=GI?N)3?>S^@FFDO__D$6K`)F`(VY3>Az-A;xxB8^Y;JG0J)~RfnOf< Soqx7ZkuErU`Avr~?tcKQkM(Q- literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe720_dx12_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe720_dx12_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..c2b5d1bfafb48d6a0382d089f91deb50a9ac4397 GIT binary patch literal 8338 zcmeHMc~n!^x<5%yMlv!62yntABGp5{0D_nRLQs^Ts5tZ*Kol#`;8aj*GcX$^pdyNG zgQ(Tk+Mtw*wKfBV$e^iOMWtTQh_=@O(YDyy_U#kU=en=!y|vzbf4sNW+bic}Pv5YA z-?#U-zXXCHh){`3JJ;_b>=!e&BR>A25ky(@4L#sybBZSwY6zU%;G zIj1R{hP$yMJN;v&bZ+I>JAYDooXK3#TiTx!e?zx_Be>w`k`;rl64om7wwX}1xpWfE*n?ZS6@icyNUo;AJ#q7P;?Ta8_Jno1E>Pn~)I~zy993`MYc2 zEic}?yb&i_8i)hn=6XXA34BL_M*^M<>X@nVuk~S7OsCh&%QmJn_PlIkbl8LOd07^wi__B? z5R?TGp+x|vgpA}AJRrj4#DM;|c*89|9fDH8n1c$j(>sANveK_sY=M(WY(Z2Vu9O}? zq_}&-+p`qh+4#6Rhqw;5z&Vn_ol6sBRZ6tZNPJ@DVaQz&XOl3s9KQ~!I8CV;Qs1qH zLla49T)-Rf^wbPuOD2o(M;YZKSe1a_z9VIgVO5+~$nC%?EQlZh*a8}$66B{qN}IIKjwu?ALup3}+hU{}P&}?Tfpo{f970)7 z2T3R84y{t=n27Zg!n%u)4;jcmOPO~>tj7qeM8ItHjhRSSA<)QP*7Le*S8yc@ z6R5jB#MgBsc3wPz+zY=1hwti`&k0Bgl1`nAOV0AUvu25QgU4F@{Z{_h1G+SBmjc3T>-nY@>Slztz!;*ZjqrM3!D zSO`ozd2mI=W?okzkDQ;QWIl`pUJ7Z>2t-}tm3##O3JM{}p>S6i^JqxX-CW-Dp}s;} zQqWwzr=i5w#wp}=rByz)GUIAIroLzLjvH;?5xh8Sbob8HP_a=~AP8oTlj=Wh!&X+O4&=xSqN*aE}M8*U|TfiJE>5;-dYUhdd z=$?uw?t%pgu#OHj2q0NEq)28$fhlRehTh>2UIexhUox8yy zd+v2M>{QykAK_gkWg>x;uFu6NotC}9sg!UNMW~@-?hA!mdjG({?t$w|Zn_;9Xw2A` zp5eV`MSsS1xQTIuYO2j=)7O}@LNuB5gv;TqX-D<#?UUP2ebzQDvOS_jaIiJ%4EjaO zNk)%8p%Z1#yBu>sXBr+pV!Lqe#<@Y;t&Z+W(|waLq(k7|Aqt=OG>?l^?MK278tB1! z1qE{+Jy$l9vED=|b*#Udcv?v`Ivo|7hOv zJlfQ}kiLgtwA4uQYge;a2Ez~@V=8>M_+DZ}ggCN8rjl#G;J50xSq25mVmSX*)t;#D zK2I*Y+c%HR6!gpdw~hRc}i+ z@(;PhE`bOY47>X*T6X9YO-cu1-SfH|xTQ7Fwc3=&NcX6F3k$0@8weE>aR>EmGe z`^suu0pKJIn|l9AZi)4-nC@kPON13acP0Yh`+@rXrgt1gGnrH*c8I z*w`GmYf5AM)@(oE75RFjWc|=(A}Y5SF(d=dpD(LDT-Ls0k4yWGuWApszwcG{`R8Q- z*$9B_*^!^{+{jit8l|SrtG%Yq?xR)!iS<^$1%ToSKv_9v0HCZM2W4$R;`+A>Hm=Uh z&UpyZfLZ6IM&MZ5RJe}sQ1_cRGq`Ww zXk1>qyn(yi{W?6P16bc?{ykb@6fx}XSNTR>!PLHx{1DC5hkc(~-bm4WssYY;1pr=E zk?L)bA$EO)(*u9$>=bq^b`1pDJOJ8Q%}ZD^G|#FR77?QK>X`ckDVMlVLR?%#TzZta zqMx{uLS7$9-jqu&Y9McIK+q<=QgY&AKO%ds=Z8jyMG~fGsJ9x(?=~QkPLj+ldlo+{ zkMbhZjEX4KIyG!LQI4if76r6chYXn8W5wriI|&u<5# z8`u5j*wYNGjPQyKlTzkS4SBr%QQnD%+jr#c1ioX#v0Bim_EtfZZ`OL?sku4eSc_-n zHneyjhlNSlP8(As?Dza0xa56;@5Y>>m3ePxu1dMzJ#udN{w-T~#+AeE z7yAZ}>?;#F@!rX&L?E zHz!gG0KEBgMB#k%h8BnHQ{YH;L|d+|0`O$WpT=PC+g%B5!CYqz^-^hiv9E1v88u=WQ~2 zU1;L1Mv3-mYR_K6OiTPs4Pj<)k!GWuyp=*OmQ={)OQ7v?}_nI@%f^)k=sttBxrpME8z3Zj5$2;o=1&IZ1C)?uY2w+Mc)j-b zKqjx7&+AZnb!U>UYU86U@lg%-_i1zF?)b<`LiBF)G$8baD*6f`T5qOz@W~}|!j_5Z{wL`gCrZmyf;Ytnavyp_f0M9v6S@;RVytxp8*jj$du`YRj{i_Ap#!o9iSsC zeZpftOuc*W?cW^se*H~OR)aSQzvik>@|MH(PoAAQ8{&umbXMJ0F-N|>YY3zY33#PJ zMjR6lk{K88Eqwm`<{zfJZx`-s_~5enQK38Kz|!~pf7r9E^YTANPiiQwe@K2FZTO>} z(CFV!r@(kMaqyqTt&L3GQ_+=!$XEYfduYj9?x~;k^ay;dzxrM8$^LaYGp|k-hOjC0 zs|M$>_3z4&jiS91NQ5tFn+Gb1a zlM`T+!?)5MGMN`JR;&vffBPoiQ^lq4eH^o`1-hIN-eL9T;OMszq0A<&0fYhR7~w3= zwS?ITKR{|AcXGz79ymIRGvxL~KKT;HEj1|tQb&$i@|T;#FdfqEdJ2INLBVnM5aHGvR-x;5Pl$xScIxhP*Vv*QH|5`p6N%czPDl$uP=W#Z4ZFNxQ z=$B0Am1~-~2mSnUDR1sRcCYH_6cvJL3X0yBqSCvOE;*-}Y#%B7TWX)2nqrCC5svHg zZvmO16YWON0#RMRW$e0(?Lgvw#p)YJ4d~YI|+{$O*BCM1H*=i2FSH&6#Fj>SVwt`+v^FHVEnfS zY=k?SCmJ_BXrQ(y|DH0*EKVfRE3v4JPe5Kxv|vALKv)6{@+s%n^Qk0=GFj;xRGP)b z1y#lIf|wpjP|#G7K?JMTKtb>0beZC4Z3OT{Ml!?+e9 zJ(Eo`ld^CGkf=D{Ag{_cm^2UH(Coapym7h5fajb0JiRR3WevRMW39r-Hi5QjZ_^$Z zc5stU$1s9y=C)H8yg)rVmFxXf%~>m-K|Rl_rb*@8<@dvkN>}W{LkGz;sB;Zl(=m{ zaOljBD!#uXU`MJ+jYe9A+K}pT!RhkoXu}8FzEm3A!*hSHeQ-DQ_czGGWYnF_-FW@Y z(Di5X@#R#6(RD*?kAyh(YzoI6AC5&u+$D%J3}PnzCKfXta3IL1&oD?GNr-G);mtNZ z1BBvpZ0T%q!eIhEAQQq5`+bqmum@NN4lX4DiwO-XJ6mH0fYysvxJn0<4^dP&_XoHyNX1%mA)2Ly5DICPf$Zhkuk^AQE5&#P!qtj>iVEc9cTln)i3AvE zb#dh{tA|uqL6r!4^@rl7XUQ@8TS2>V-;$fDICMV(yHb3)^AOkx&*2V{eS-oTmWeVS zuoI-3APupK5;8eKIva9vPQ&5M45NT#X5gpj#8l%2L5WyeA0k?M3c6}FF*L`@Je~O> z4qn6M0gaVi4%@6h8FS+xdIWq1BAue+ozk0^MtSTQA9iClBcu)Jel`S{PE{B~;zQwp zchkk({z@YbEU0K$L0coDVHysw6>9h0Qj+j{5p6ZHn{AMrIe>tW2K$kiU{&aOb+Ezc zZ&dLtO7NN5>*!4Is?1}59D1}I9bfJT(FT*}iwSM+W7<@5CiHY;okGZ;0YzY-$czT# zg!pGNhfRabW~x}4AiKI-n!U&>lHrtW*+!iYb4}9o~gVE2q6M`hd>?a|ljg zRqDIM-lSq@m&oXG(cZJh;(V;8aUg!iM9+1c5d8~l2%>!jL{rQRaqKJ6zG7yxfz?b^ z+C_goE?Q2)aeDL8>}L0K?gZ)PYZ z7)DQtek3x$Xzynuf}uK!dD)Xr1a~;vT&NG-bJr`Xz*VcH&|KwSEFw&KwO@@&>cxq6}*~ z43LOTKdCoRjlKNJiBXVvj=^i!3t9*=}g#3t>TxLA5GL7;C z6Vn{={UGx(J0sN6IgQa*D>A9=vaZ_w+P_J0Qj-1Nb|?csmPBbPP3jk%?btX zati)VL{>=fIlh-^r0-5|&*@iCN^#uKNQey+Sm7PM{?D?)`P@W06CiAGVw~hwo#oD> zsJ?~8M@9WZ<%Ve(x+hgb<;fw|LA?L*U#aYrhzz4_PKH8uW++6JRX^x)ROCE2=VK)e zZn>`m4f^&^ra})$hL92Ja}Ae^slV8>h?Bu~9SuD=$(D^vHFRyct*fCbOCC&8jb*Sc zT_)dGwm8T40Iq8{%h!Cjm({^cw`!uQB#}(8HU7w+I8*Pz+!R;k^8MbT-$qE1%~oX+d{L6l z&=h+p%U>~_F1zh()Z;h^L3&5wvmngT;87l0RVxFw-i<>y>N#BCPt#SvpR}$M1|bIe z3;ZT_-IL1qo|W$ayUr|+*ZQnRd-TP|5L|>5*Nd;1aZ^M@9S;1MM{qHO$d8|5q$8&c zKU`dltCBpyl(}^%2~Sg`5vwJ&$)GvxpMo{1+a>Q~%}0l@X6QJmo(IlSBrnvn{AW*C z>)HXW}3IG8faSug-)2cP8fAiNP zvw^AXF(OkxDfW`jCIL8~CU%{&dtan0WprYCO8OQ545J~qcr*>ta0mooeaoD(R24^! zRZq{qJ5SYtflL`~83fyOE#%{L35q>(2v-uqm`@~4K-5y**jjna4w0Fy16%GIanV3! zuVWFxMd7hl3b4}Gk~V>c=i0=Gam8*Oze3&7+6{K<3aEjYgZFW`kPti0PX3VA$W{I> z5&1YcKX1@k)^rR);8Zfnmb^HWB+UuuvnNhGU$>dmT~dB6hq^}!KJN1^)I#gLh zO#)||E!)KRadI7N&|?Q14zLK^%y*f-mgAb{!k6t5HtkueViB^&|EF9|`hap()}sqF pdVmN%Q8NDO|7UFMum4nsir=38Jm^3C{SE%)-S$@1hf@IEzX63$%Hse4 literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe720_null_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe720_null_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..77ed6f870a18eb2b6af3df5fbc1e3822381271a1 GIT binary patch literal 486 zcmZQzU|?YGU<}-ML)7esBj1D%@+<$B#qTaHI<}jSt z*Hfs^cq=A3WL0B;cgOy|uZ>c>5@XJ^+(>o4H6gq9z0Zp26IvbFF8^!>nhOLTzV_dv z)HnV+)YIjDeSt|D=Pyoelgh3Mt5<5Cnj|UyB>wzNlXqugJGplXKr|qcmG$|D4G1e^ zh>Uw|{AR(a4xaT-oKH{6iCp91nJ5Ib`sF2O@h8UTj~Q}CKiYPB@%%sjt~DNx4sn*N zE-imFsXyL*_Ue+={uP>`3>1r=02#};E4Flc&VN_MEf)LMCilhvfCS?88w?k{M11U* zKiQNLX#VS1rN4N@%xjUA#_nhRPwW&-{`_deOe+qkzZn@~G|g{*#uAv!AQjjh%21ha R`cngok&Ja&o%6MU`T!nR#rXgL literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe720_vulkan_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe720_vulkan_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..12938b54606d6ed16483a0a6967fd947dd441876 GIT binary patch literal 12618 zcmbuG2bfjWwZ|_YO%N;;K?PJSh>j@57Ns+wl#v+~5W&lEfsrXVGay4OU5a_@x8?Op3fLfjQRb}JqwQ`-}m14y`8(<|Mg#Muf6u#d!KV> zhU9X&T&v|RPJDcG*CCsScUt{P?>oL;H1p9-Z>~9IaEp6}o^yEDAtMf2@#&4ddY?M& zy4O`l8`&-uU7I z;?l-W82b6N12+ES=~XLB-&r?kPWvz0_aD@>a`lEg`n|BGNB6BWU%7hF$1k0>qQfIQ z7YAhi+jL&tGXws2x7^eje;D}3buTRMc+b|6FRrPcdgs`2`CXa%qt{1v-#YM>=MHOs z>Xrvzy!nQ|Pa1vp*x|!w9JT)S+qSH^d}isj8yYuETHNoX-2a>1WZ0IswkchC2`|QiWT*IW>cr9KG^+|+D|Hmt=+w8z`2VaDqZ5# zcYQT={+VZ;)Z@y@j}5O_^v(Qm}hLKTzhQEoFnUM9nv^r;hZ^z`jVKhd~#`68p<2%7gjdr$fsR0j-k!x zEv>JbP29G*9kGoXRXXnEy6S~Bg;9lu%F?ov;9R9PTU~wC+^Sl+HVJ1<>gyWwja7B9 z#d-9#cCqTo-?A6yvCcJhiwZS`+Qtg%hf2hv&H5)}%NOJ;t7_*KZN>SlcVZh^x3IRc zVcQt%o$wPE)==n%;+P$i9IbWO#?{y7XIEL~io)VTb?VnX@w4XP7n>1Yk(;$oe8x64 zG#2U$4OQmQE*bB-6WfIRVseNO+j8s>_K9`%HTmihRrzo7?-;g|s|sf&7VA;WYp1Y9 z#LD~Y~;Mg+CoD^#kc)BB=LMyHH$a8 zwz6(E+fkaYsmT{(7W4CtB)%i^mGkFt!ZQ&gKORKE(57B$>0{K_lq z>#D0K&6(3sV4JtuyM)~Wb0Nl9%H(_(bLkrPZ|V>(#3=f73!lk_>blD0=#H+<&#Ep^ zsmQl`_>8RP7FW%w`i@_5&vy^MV!k7*3;B8|ZcO`}`@NkzS-h=@PwSlfKDpwXLikK^ zzmxM*U#N_G)taYL_BmCG?j3TDJrQ;9jrv}x?w!~Nv1wP|JJE`|_abXo*Y2Ix-}{iY zt7|t8?ar08t7|te?Vd^J^em0dJVW+Hw*}{Xa#=s;kn4klpK;}UkO$|QxkkB)4CkGfo08$Yb8^!&oa>i6J;S-ba$ds7+5MH9m*K3HTy=)? zuF5UQaMnnUBfl-4_fKwdhV#D3ot@#lTXIV?T$hwvmEpWY`mN4z-Wjy4?z-OZ{QR)cU6bu#-W~e8 z9=WV^C4y_}gLu{)tL~a?p}QW>PUx;B>)!+2yu;oT?7kU)5BffcO}o1H(iXb+(s-_| z7rj2lJD6G3dn5WNF{TgLIl^aeu$&S;`+&1?thJod1xsK0gQ&Ireu(q$Pj7745)2{!7RCoL_=!5A!@3zp**A}|(3!Az%_Z?tNb!*xYDb{s|oHg`5ggy*x z{YWSAA5O1LJiO?sZ_3k-;Smu~?VehS#==W(AGr?wN*JeyLEj`Lj1eM!n0FY@_5SYK`WS?jZrm^=K= zNqu@I_TrwL3zok)9d}-0%jM)(60G5xrF9a_|%<=qm zEf<0H(-wJO3^s4q7x6Di@VDbHhm()^E5OE_>` z=jTUAZ^UzC9ptV^^}Xp`kKB(_eqZ_+yB6$tZJxQ4>90iM%pD2#%y~|(N^R@Y{I5>A zz39#V8hV@gYr7VaGk@_VjPs0Khgb{uU}ehvB;`GulgYy~emx>T1F?ng4d56bzU$!R z9pib3xo!mO>mG*hOzfboCSLCwRkqYv90SJ^tO2Ztp{6Ed+i%E(yY5N??mME z5yv^b3)~GE&ite3??#+Q-W=VVdl31%(j4ziImbEIMtYlbX}b@(A8{^m#CZU0oS5rp zVAq$O>p^t+*w=@^j+2jj|1em7cf|AW{LbZ^G1nvD>|BqcH=pb0aPl$NV_?V0N1R`P z^@+RwI9NaV?A+$?8T)O$okpVs$ju$*zM?=$o^>#OaT zh@5K{S2E6Xx)$kz*v!o{qL04nvH$j2yME^0m;PDgFvPg~A^P6I-E&>fA=<6Gd;cu+ z%Ks|WwZ}Q$l;N#qYxL)lxJz@v#k*9zBQKzLK#V&D*$Z*p9`r9F+9UQ$DHnI75`8h^ z9hpUc3u4_~rnki%`8C*j*lT}9Bh9)R^HoGnA937~*TAkh_V9JE^T@|Jc>^pTcjQg5 zoa=F}x9DxorR{Cx9mKiB5oa^lI5F3|VAq$O>pgV&IJfVE9VZ`m^LDSD-?^MK z=K27fo$I&g&FA_ZoP5mnA=q*95$E?{ed3O60e^_dXXiGDxFdf6o1<&j-@IbYTfv@> z?3(`tT|Vx}zk=nAV}1XP-e!HZ{W~J(n#JA`&)-@kdq+GY`siz}vH$k!VYiPv@)7tj z#JKw*`oGZcC*7LvVZE<%#1zRV3?f;{ZX1$I186u~T zIPT70z&()I+t0zLBl2;6{tA|lyYmHD&hzSoI~~As#<9K~>220m+fIm_YZiNV zJb!DE?A`H<=%cT>#{S!@huuEzPA7c5JI3|y=o@#ZGn{to-YvuL4CkE)KJLyg@Y);~ z=X+PMyyIQlZeW{h)7Ax%GjFkZ&d07UuYOIc+sDsMU9l}jZ;ANbxhs7)xFz)3VvoCn zSEaVN1G~e?$M?@3+wtiMCtpVFUX0%Z>^OPjjDgz|EU&K5USK)TlFx`<;CA%0cwg^A z-y2;{KbvdmOy37xTPtuaV_nPM=<;z!_5sUTbL+S-*k&EI^+n{Yn>brX`N(-c@FK=V z9rs6=&h63A+4bxXV)RP;~i2;VwwI0qV#gxTxo0=<>GU4o^Ahj_ikP8i=C41L7EC$`1nX zoZ7>8aK_hI;X4GZzxFcX4q@C8VB_hh{bAzvg+DUYcLTeJN1@x?Lv2SRa_*tn-#u8f zW5C8#_$1A|w0$q-T!Vg5mt(=!MEm3E{KtXK%lWylKJmMUQ_ zU~_kk#&cfpon!nSF%CQ*+>zeB@w=hA&yddK@J@s>s&xF?&e)So@(=vVy@Y>>gKqJ_();+j|==#N8ECSo&%$$X8?d;?C zaf`vma;*E;L~nEdv@Jp894C%D{C%*sI}qRaUU_zgi|;(=z=f~&@I4o7jT|4o=cT@K z+TGun+djTyEd~4C%5@mqyyCgD3~XF&#>?8yM>l6}=A|v(#}|OLhkha0SU!I}Qx}2t zDFer|@nUp7$=}knhwmleUE#F{w;X&ZoH2Y)8*>F%-sk`Flv|nV&L3lc0M=JqyeC(I z9j7h)E(Oag;ddEWKW!a(Z#eJeU_Si4h3^6Y?}k3HuGOi%H=Mq~|1jk{!MnzocMVvZ z|FKKp{Z4qZQ6a6d^o>ENzUIpde{?)ABG z1Dxaa*KYjCZ5>#`LF0q;cbz4tk8z{ey0 zT%gam)Mq07hnyAP1QsK=vV>*09gyQe<~%g6b63_J#r zcaME$`~u7;$=&CLKIT0h{5UxBJ_tSHJ^`;So(WHa`6Pd*)fQ*uDX=!5N5-5$|1^5U zJUESM9?!sQi@bgb=9B!4WRBWhtMB+{!M@{Tt&V>VuE-a^um1|250xm|BJQS?_dTPJ zIYz$EgS9(%a4)2sd~h#<<@Jl_z)N7qYqO5pyaS#a&x&V9pE!@65%Z7p80XEsjd#_{ zV9!E42YwBfJA{~#%PZ*eC2;YadKKOIe8z>}Yv|rpZBdKY!F-av*KVwMU%dhL-JwrB z&)x(ZSFzdoJd5YbTM+s>lbzWEm$90aKB4A>Dc=Z zQS{Xo@7!3|@8MimC94#>9{p`Thvw6Jm+ikInzTv1CTs zfP2pN1o?f;(va!qxEzc}za Q|7@QkoqNWL8~QWupFdLetpET3 literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe864_dx12_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe864_dx12_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..5a33ba9798b3727f172ba4597371fb764ab8bde2 GIT binary patch literal 8338 zcmeHMc~n!^x<4m58Og{PAi!Z1k?J8}06|OuAt*{vR2+H@Ac`%}AZkUa&A@DwfQksV z4Wd?CYXed$*4hjdBA`;Wib}npky@_o8?~nJ^dVA%Z?CBf! z@B8-t_Lo2q1Q9FX)UyLl!T~W$JL+}p&&{h(TdveDn+bnD=RJXwFgB?2X_Ked$`uD7 z%UMmq4EV;Xth7&*()ktN?D|>hb~$aFx=&jwCSQK827E!0ESU4_ ziYYCBm^4+1*K}cPX}{5?g%wq4KRq_Jr`FZQy87b&ut$AwR@!xNCJ0`87rpLrwhNoHvP`Zxf38>8-Tu>=a@X_ zV{7Z0)bQWBic(zC_g`IJ6q@B3O}| z*}^jZz$?!mO%v7eim>gQzf9bUi~j8Q(ngIocQ$ExWaE0BcJSA z#eO5MHLanrfC2+>b37r4489}4BLPo3-Uprsc$)=5ixZMCDyT!Y7X&3OP7Il>+PYHy zp)Fm!6e|YP{cxIpQvL*m^jbdx>bR*1ul3Sz%hc#n@<;HR!FptXk0?YVaQbwYn8CHT;EQqI8~_`R^P2c zLK4WSJir_9bk_{wOQwhjN10`#c$J94-;*=P@hYqp@;dPf8zM>owtxnx1UaZ=v1l^2 zj0VF{B?>_@&?oSzprLC@5eMHxCE#_Zq)F>&pRCc?m2@U^EJlU_Bfx#}+uga4>z^DbojxB<%JjXnZke{wZ9So3eRGwnLaOKN);Stb zRj3Bq106id=q~6_E4ib)e`I)U$^&n|_x%s;t$%U5Jr&qY-p55teh6LlN6G9GYq=;i z7@@ZwTvfiA-(A3`0A zZ?4)~Uu8~479C|v zKlvvPWwVY_Aj5~i1bimwluaDUw)F02@*~(h{~<9DvJA7K3&jfq+gn6y7N$L^Roe;yz?j zZMz8XD2w*s*xU|pFp6T(ms=g;jg`QhSMwM}T@Y1)Pr^%CbT;%FL(edXAOhWZQFvc; zgJ2ZY@M6$*GZnV2hqq8W0J0yb2t4cguH0m;h8B?6g~V0aaWIbZ1{a!Dbr7kNAv)f? zgB%L|5TmC_K|k(D{|qA1n=m3hOeZDMg*rKr9--3`>9cftB0XByPo&4_Mu~K(4kOXi zbW#$1sZK$vYKB^f^n=M&(K@N!ybwj1E3{}Wl(Qd3*OC>C2>Pv|Ls=9uztApg z{&f!GP}1Ch@~@IJ&;V-p7h;S-&nk2%A>PDLT8NnULgA7&FgUnp@cOcwE(Zo1)Ay&P zd+uE|kbWI$VjiKHYVtUYb>_@qO$H^2yYP_Y>PaNec95= z?A6D2VVnh*qYvmzBO^zw7tY=|J7m4p*;8S(5tN&s zKkw0lx98o@xpzKq*Yv)f3y)stJD!}clIOT{%%>Sy1_e{xu7rY^^(gfaCXNu2a~w+4 zjVS*IvhR}^BI5upR!VnA;uu0COE1POGIM{a*fp8sEFD6egyG@-@BZ@rFQh5I1}xp| zw=bbxDd`^y6;jjPk~w?k=$-`Z+gvx&Zj=lRg&GXrKEEcoB<%YI?-(5V8|XlAx&WuT zDL+pP2*nX+mo|!bF!5;nIX9Wy`vRKvJJfU86NEqst7GVw+L4V`pwgNWr!oBJ$Tas317ih)67SgHnq*{u#%D9v;n5=|g(=Dg#_sq9DR0eZmF$HDUV zmsUFiz{xl^b$(M^66&0B-Aem5wE3G+P+Oc!5Q^(G)YYumO;8FU;7o`B% zaDeQY(Vq#th&CGw!I|QczI$R1shaXdjTj!-mB|0X!tbG=6%{c*B z#tN3EGw)-`q?F?}U23gXljV|Wu&YON%X-6f52(Tis%#n`fEo7{&J#P-_2$iV-kUcX zSJteo=dE($X!YTL$fd-bTKi!3wCp2f|{ zrM}28W25Fd{W4}QGkQSOO{J9g&o0={E~*)3RPN1GthCvyYv)SPT^ti`c& z>RY}p{SIuPU9)91Bf>;{r;RJ(8{B^YE_sjWvoU+i>fCoS)+FES89h64@0PVE{mS7E zoPhNfag%*ujeSsyJ#l_p$^0`&a%V|$AF^OnykJzhU@+cEDEvyeFRWD%etN1{TFSWi z?TO@k0B_zrQJA;6u*ELxBsh}od7CVwt48`wmL6-vElbb95hTe~5be^@+VSPAj+WMr zsmi65jEkky*(ZW6=O6Bzj$0@%ze>mcQ(Dfrco-an)7kgmIKLB|k5cUrLew$F#@q4a#+t4tWZX*r^)DX zp^3j1BiW{@-TR2MEpf9o#MymYG#llVZB$B;q+BkiY?Tu?Zz-3f<*t2P)&nhmQ_IKL zcSc#GQdTIZ)8m#mf56+rl;OD+tBg9Mj_Qw#Y$HaWQAd{$qxwc2H_Is7awy?B%9{Lw$Ksy)yXGDC^M>>t_S&0Y=QUH1VxX{65=z zFoWOY&F@rt^kk5)YU3g;agp`5_bGG4p16n#V$>e<3?TG{D(VU`N^fR#dQ*z!#I1ql zn-%4*-^H=Uhsaix_2Urv7Y=I-+&8uC$5Qq)Os%xQUV|cBkSW6hui#ga0u(&p+h0df zdWA)QlydjScm8g-@0)M4GwVIcgmqWFlC~bMd-Ck`nP6YSXLD-5jz03uT|)p(NF*o? zGSawsh{C-1p(uyS zxN2}5Pde85?11Oy>R!VVA+WfU{y>*!cHv^W0TD#=ghV+gqT^@nN0)o?Mu58x_i|(rQ5HpN138 z;a-cM8~+oe26CsSzv@AvBDupZU*=IR;oMRZ;~{m#xFv6;ITY6+&8DXi7!edam*Rm$ z3eT;`;4b%iZiV0SUglQ6gGA>4LT;4-*7Tp|R{chXNaYTxsYWfHvzRcDv*^$)kR;pZZ5#F6kHSyVE6*k7yK@0)={*kB z`|;6G8czB!c_59T`(;?WXQq)Nx*+(s=DtLR_L2P0@62|Ptc349K=V(Y5{ zGseDRIj&yU#5?Hg2PeO|=h%;xN2jS!TvJf=K2(+7g?z~|)nxrx;n!00}aAGv{MKK(PRVUKL}!&Y=B&gPPP5QfOnKdyS$!I2_}Af zz(;svxuOZvg9c`O^6x2=%;G>6y%LLAy@}|ni5C244G2$wK|ba9dOnp1QKu?>0!uP^ zaA0LDKak~?2n9|T8AOO`9TfNhtjn;aJrEx2G6DU6Gw(sH`%$#tmiI{7#5`NxgT&vk zR;PZJoZ>czx0R(Ol zGBP-1GdU9`f<(pf24zi_!K8WkhGy5rm5nRi2HoG>@9tsYt*GZWA8Qjvv!qbT&!0H&zwW zppe-gm;Z1_z==?k8;$gIwIRjrg2UypvHB0Uf2B0IhUNTT^WbjC?{83qNti2#xAFR$ zAsbHT5z1&Nv-^hF771a_Tq@U<5QaxZ_!7h&0Wp(t6OWm8FbMK#vkX#uGAi3%aI;;{ z1flpWM>Y>Hjxat$aeX2Z?8QT#d( z^Sw<^@UthBfkKco0i3mnjD!CU;{*Dvj$+y#ig#&R(A`Bk_;4!g+eK%Y*&#&f=4@%c z|1wTCPg(+#(ujwpr{U66fm0fmoo0aNiVZyDj4?sgPA&+7s$nbvQlXajvyiXm^aS%X z+D?k}s#ci&1>ZWWYeH zBb2?Y9*VsRswB{>KSY?BDaYw=1@3{rqcqcCtN}%wsXn{~DB?ii@`fosf&TR?L>Uh_ z@ls8ohEz!no*FNm3pqKa!mycX6p+nK!Ze+jX1pLM7E9}bMaxe@SNly&&9PE#>#HH?fpL+b7CPzIC2^ypJWgm(wdh?y6v18c40N6y@L%3MCP!nEa>Q?mdXSdd3T*7x)}72g8DX zrM_G2NiK49iinyJ?Kx*W)~jz)^e?#R`Sz2de`OCt^sj+vs+lQ{c_rFM%xX5Un`ug$ z=x-)O%gHdWPY^gC%N)Y(w|M>@bI>WV`|-GGZL#1pyU#wD=s~RtL~9k)MGN(2rc#1q z^pxaFrT~nFK8ugi$0lh45Mz!CO-CzqzoGguqB4Qu1|dfDbmiuwq^%snRvl%luKc?a z*(s=LxC{y~$m)jQR((R+tG9!ut(4Kef-v_kI3_?#EKbHK&+Fx^u@EJHC@VJ7u&&bp zi8zc_y@6)z^RBp9p~TI&CacLoO%oTF`4TpwXP1+Iq$PWljWZI_`&jX1=7WBgQ66t% znZth=Vm;=hhgiBD#W5$5iz1RJVpXUV=CH15c)`G(j3dr(cq2PF!ISQ7Bqbrv93Wg< z&8#k7OVcUoB}+dXumpLg$0k!nz-R82xb_KhQeQg2n?s$m`#W=DG2o6HVPJ(zjv8JV z;4FUTGP8vpoqB+nGK!>(;#2zU)6C4yRXBc20Deq>AE%PMaNL}N-XC?C^Tc6J2ymB^ z$oC?OLPE&)xlAX2e`-hefPz{A^FksZ4nkyyb^7={%MA18B`{b3VS@v+l~;L&w}7hp z4iO&}4GfnVX5i?ys)oywg8PREe#ggXoaFFyql})ekewb5R%O-=xg8Zb&d>ftNk>}l z=|F?AoZSln5LWY9LG>s-cKWMFVdac;Ub%K~}Dk;i!gL$?8{tH%R=cW-H9TupKjftbgkgqtb*TGMh@o*lp`;rO zYlhwM2LHsQRx3(o<66lkoz%s(+MtS!32+>1Y0{?rtSXiqlR$6twyv40${_k+WSyZY z=1``eVkSd&+sCMfxhPS3N8z<7)ZXA$7E)Ow1Ge4+V;l8c9`L7UO5jgg=ShQ*0{jKO zle_Lo#rx07c7k1Jmd9zm)?&T-B4aQdE`|FD<+E;zNSNJ$`?*9XL$Lh#NoE>)((u#8 zrEsO>39ihoLx}{sB9&AnsYwFO5x-=-N!ua$0B=4zgf~MbKy^QGhAMfXp5r%n(puLJ zXe94};}PHb9I{;CJLc^R&N6V=1GAZBX4K1_{JfrH=%xY?kWtqV3^=V?ld{TBkIn_A zvc-rD{gjwXUYi8qe45;KN_soht;&z40lI$!xKPQv literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe864_null_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe864_null_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..77ed6f870a18eb2b6af3df5fbc1e3822381271a1 GIT binary patch literal 486 zcmZQzU|?YGU<}-ML)7esBj1D%@+<$B#qTaHI<}jSt z*Hfs^cq=A3WL0B;cgOy|uZ>c>5@XJ^+(>o4H6gq9z0Zp26IvbFF8^!>nhOLTzV_dv z)HnV+)YIjDeSt|D=Pyoelgh3Mt5<5Cnj|UyB>wzNlXqugJGplXKr|qcmG$|D4G1e^ zh>Uw|{AR(a4xaT-oKH{6iCp91nJ5Ib`sF2O@h8UTj~Q}CKiYPB@%%sjt~DNx4sn*N zE-imFsXyL*_Ue+={uP>`3>1r=02#};E4Flc&VN_MEf)LMCilhvfCS?88w?k{M11U* zKiQNLX#VS1rN4N@%xjUA#_nhRPwW&-{`_deOe+qkzZn@~G|g{*#uAv!AQjjh%21ha R`cngok&Ja&o%6MU`T!nR#rXgL literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe864_vulkan_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance-numraysperprobe864_vulkan_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..14f9f51d851deb8ac06c573c8bc7b2694e944add GIT binary patch literal 12618 zcmbuG2bfjWwZ|_YO%N;;K?PJSSVoj$i_#fT%E*igh`?pIz{nJw84$36jS^IX25S^G zHn5?_7GsSDTZ|nwCWi2e?-}EJK4Ua7=Jz}IEIf{U-+SNpcJ6Zj*MF_O_S$Rjea@X3 zlFQ|CEtWSs>50vq2W}qHVfCjy@BC)Lw8u8Rx#rXX&F&p^?h%~_4n1haXE*iedD`Ub zbDN%6b>?Bs-kVZcv3_aUiOZk7?DM7FAInd9`J&B*VehS;d+wjd+;P?Fi-)v&r*!YiUR;?_3XI=kUZNF-JaQ{UsS8uqp&x>oib=^Ac)oc2H^782`+C92+ zaX{w3i_Wimw(tM$mYX#7kNrMg_u}&Q_ii2b(wgc?ca0jI-<7F9dVN^et^Hno{_wV^ zZF%UWTWf0bg?&!W{lD2whHZXZtJ0NMeKh#c z+ZQbVr2f6EQeAkKBygg}AztUI6Z+di>%Fnjk zcg-pCjM>Y&*ql!HT*+yQ#y|AMC!Y_S1^NYj5z(JTJS%|RAX$3kGOHs zyh6zlGfS#!^0N!*Epu(K{MI zi}UDf?PApvzGE-WW1Va278GgeR1o;%CjnFE%5*A~$QF_>5ZA z&{(K1G*p>Gn`FG}PHbcI3&|luY|F7-*vHk?*W{~*R^`9VzkS$FsVbb6Sgc1eubsjc z5l1YXS655n;H`@DdPbAEGYgzUdUNWkXJXps*D?HtvXOHdYYPnx72ox1m&Ef?)g<1C z+RD0_Y)5InrY2vESK5ToeRC443ns_QC~qdTHDKcl)p zr6S+1;WMn7TU<4(>U)00J>Nb2iun$!F68T>xG`;W?)P@?Wbw8pJ}qR#x_8Jq_C(aZH|l$(x_4q9#HL++??fx=-ixeVUAuQ$fA2%q zuCCoYv^!VUuCCp@w0kC<)3Y=x^9kl$z}bVL#`JRe#VvaK^~lImg}G4d`8F( z&T!@-HzvcmUb(Ui=NjcIGMsl_ZeoV>&dE*5aIRl&dWLg<<-CNEv->MIC&O7Qx#|q( zU6q@c;jEDyM}Av8@1NYl4Cj55J14_=x8#;&xK1gzD#Lk)^jn?byfboFW;pMN+|?P* z`yjV2<*c1e&Q{9lkaK^#fL&uR;ulmvDR`*CoH|`52Dug`ytN1KfSeeoN=tj z0m$?g-|7dV_d>$n2kbox{UC65Zw^M!<(?W8_CwG->*~&RC_)<=dI`$3c`N#cepq78 z4UX}B(LF1D(%cURhwl+Z-$B;Jwe&;el;HYT8__ z(mRH-B>Iu`)=J%6+{2?%eNS}vD!3jXpA*LLY%1E+BaX2Y=lH*f7RnicJ1z{b z7;ODWC-EObuT4G9`8aScx8%vt$D`fV@zTMem!U5{vPW{~%=;u{ztL-si#sqO<>X74 z%`;e@V%J@PL~Tw6d+x2pDfF(x{R{i4V4tg@PXzmn41E&V=da@@(>vbz!hRY!o*%}Y zf^^B)PX~8Jnvth_JQW#8Mnmb1W%K;}6>S>5HTKL*N8Fdt^G);_P4vnp`phPJp@}}L zi9WlD?t9$%k0T$?e-+}ss=LlJ5cl;9*tzt!zkz)}R3om(eh5)K(=~|a$l6#Bdt-Ud zYZ2|?TL;eix*y>?53KznYUtQA5y#8N_UV@n8 z1?gHY2J5FS^1cLY-mWj=FH7)u<1dGkkN7LV#+F}_#$O3`4sGH0!^ED;S+nq41(w%8 z_VZG({5{0#O@A38=RR*txy!-&crI^Cxz%8OwRz5eL~r{lw?pzhat&C{vo8LUer~GE zo0I3~3Zy6EIkFCNSEl;j^sYzl$0@%reT-cTcDy#v+$r=|A#vu80(<5>Cs(Jo^=bas zq}*Qg=6@}{&HS}phsc?~cp2k7BiAF=!aZ1-az9CV&*lX3@QmMp$WKLV;d>)E#)t1Z zIC;l-9%8PW!1}s};d?V!ejU;raeXc6Z$W$}9nV^Pe(4wY@TcIY$*JJDhqr>Y`E0Ou zw;|y-5$y9S>UVo;-@t6W!FM2X`Z#BS-g_;cNpEcHdMCXto`37X*3@4628}f9Zp^z7 zIeo-&PVWYHL548@aQb@?=aDx@_vT(i{_Zr#`%=zv&b5)==3LtDM;<_&OB`_?1RE#j z`We{uW#@VbT|V~pVX))m+aq^ z$Gq~tN_FjVjyGj^YuOV01tjj$Y;f@|74OK4=s_$x%g*&4x_q45_rZ>nk2~^Pu)KM@*Us-; z&KYxk0M5?!JM^Y={T@y}=K2uqIQfY42e3YIN49`JMC7w`n?u}@KZ4ECwd-$QvF5E{ z&qsF6|AHlW~|3+`KzS{mBk#o&r?}+DbEt0(>o)LZYHP_gGd-br}#~t|y zd^lp<{SbZQj{FB$yLIo9;r|otod`be&c|@t92e*NPhfe+TjQ4WpCGLf&-fhrn~`|G z{283RJNuwJ&b#v|qCH~&SIWiR$)hhsj60qFR>XS#H@z+H&SzljWUu{yG}5fMF+WG- z^byD1`3txk5_|gvcse2<=jX3r`M5h@g5_MlbA3f`b1rRvL;j99mpI~l4K_~9^$)P? z%g*%;x_q2xzZf`9KJHF4IC=NVGvNHr<(x5BbL`oQ&jz4#sqifgSykgC5(LEp8Ja&YWkGs;kXN zadEzP1hkK>rn-In+|(J{LiFZ{-<>uPyet zD|l6Ei#xD8oP2!$?6w`B?r`#D#O}fPJ;08WH_k}7J;Czo`s@Xk^DOy{=mBm+KZE!6 zF7!Ro<@B?;mX7qj(6zMy*D}_%?2RrTXJj9+oHe(O`+{xOQCn|B&bo=Sb(D{s_X96r zT-0%YbU9np>;QE6?r?R)H^&3f3lq*4(p8$7R${mI-e;C|_Dc4sW=?@q6JRDu#7TggjC*7X?a83PC)OSD}V@&z} z;GI)@_zuYU8Y_GUg7w#4M%;mnI}&U>{j@(q+}`jWB-PM%|Y9EZh>_f4t5RNJnQD{{q?NIy6t^7=|3X%_xw86nz(LlBf)%< z-;?PV`&63pZLy6<;y#Un*XCTK>8-JSJi|`_cfsHJPejHb8`HXt1#36PU&wkKy>^>> zr+qvkZ(MOaYs$cm^BLv)|0M7k^zz{|0c?EVIr@}?^^@1f=RpNn{@ygFlfiNaVDl`U z0=Aitwo?%~^AWr5$WK0=Q4_(f7#F!rLN{(a_a=koF2yH)_i!3|e7~6lZ!Ghk0vZL<+M$BEqDSvCS)e`?E-Xj)@EMX;(dG}SbOLffsN(!*E4l7 zSf4U*JR2`T=ac*`O?&t*1Mdp2J-FrI!{ChJd)k;Q!16x-m#5syRCoRu`$Mq4+TuOA z3hX#-;dd!mUJ1X;!1`%x&wImpF9-AC?=5^60C+d_iFK_`?LFc24gNf5*!DUJ0p9-*~_O7;Fq}=I%LMOK_4hlT>-s6!x@e1dx29Y+ z-feL5p3xY4JGwsFJhR5T18huf?bGiScY^sOzhBkg`6AEtU~|mI-GJ^GZ4vh_u(7qp z-rf!7lkBbb?B2S^@xA6Au;;*Y;TZSb=lltby%)R_z4zYdyt@9z8bj|nv5%imPXwQU z_;Z0iqf?)8^dE9od>1GuruO?%yS@3i*Bil|=pA!E@<3|yd&h%dpKscJmfGT7@(_Bw zbNb*D?~;e%wQXcgz2P4L8%N&nPmj_&ht2z$EdEd4X+ z5%Z8Vrg=OIuPyTWC74h0Gm<%KcdfqTp9A}jkF`4fdAK59{J#DxbUsv~Xp6X;Qr`EB zKIRztz5v$l+`+w=a`M5w1eVt?o&zs~9k0zgYV!_wZagcV9ev_FdPdAY&SRW6_cq>D zuYf%Z@f`RySng0_MlP?S%a_2#bLuzf&gU~O{9Z%%u4;=~ybk7*?7enl#rx_Fu37AEu1ZW z#(NLWdCH4)l0(?uhj&~>#uh(&{TALi72lWsO!xtqPf|PMI$po1CmI(gO&kH7WR*aymANdGl^5~r!nnYaIc2FNX{8}Q|U S-}`6#6zRM(R@`_nvX&3Fv; zF|`h7s?OB`8u~(z(P6r-8KWjHvyCh)C@{MLuh}NXMiiKR0I%7m=4RxY{aldIaq`40 zEnGojZe&2d(M*o`!`s4)?6`a`$mEC=;DyYhBEsk?#lV2<=mZ%L4s-3zd$Vj{NqF=B zY-0^*$^)|1)i=lQKElko_CV$HAJ5v$8Mc2=VYC*UoPI$YS8$@HUL5A_(mh%pYVo5H zY912<{!m0swK&ZD7Jurs{(_Afa5Iqt4@)jXO|8V52@WxwxeGOw5@#kOBk_roI1`x& zlmVz|l2|j5LX(K3NUW*g@YJ5XH_Ku2l?#86i#+*Xtm>2h|M-R~c2bLje`4EzImL}< zKuIx85Pvc(p4@xU8PxRrhPYCcY{QX)5@*6B+i+r1D0zlk3oeCCNSfwZL*ZGJh zb6kt#>D#hwK9+<(n;-6bAvk$rme%y|No-Ej+sv5%KoxHX8l$eh9cTm(%w&+zYb}nY zb>|nSeaq6{?)ZV(7OZ(YP_rFO71;jm32!-A)u%hW;rNDZIY{`V7ROB%ZrMXtUlg}b S3}mwwoIc?Mn>H&02mk=|-&5)U diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance_dx12_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblenddistance_dx12_0.azshadervariant index ec72a557113911ff0807d16732437376516ba3b7..c3925d31857fc8a0569df7cbefc7bac250293d8a 100644 GIT binary patch delta 16 XcmbQ_ILUECmjXv!R_A#<2*C!8 z6C&6eL@iot0WB44Z9*snM8&B^MH@5@?MrP$Yqi(g-hBf2+S}gYx%d0=eb4jl=L~D@ zVXd{-T6?d(P69y?L{!6RX9p+o2ZcSuI^Ye4gU1azw;*XMIqHs8oj)i zE!_v1&T2}g!Z)%c=|^R$bJbsM{aNO5IyP5;yqe{M%X=CS12*-n7<_m|_{ED;yG!>P;ew4ZC*|8oAUie#bS zotUGSKf1GH+w!D_kJo)Xe?#yh=zm>n!pXv% z(}n397!Z^L*+K6BJtbt!P9cCnI3F>n7scyu`_Lh15ooiQqqgzRpp7i^+b%SbW+N-JBYhBRzMD-!aohPy+GqsL>U8%w} znPymVZwo0r5lLeM+JGiUW5%aU77&^lDk}~WQTQ5?^Bf0ZEuYClTRa4R2N|LkRK_z(HRW@o}oKiFzdu3M&%VePIF#_D5fZWwH zhcSmIW~8my{$wiixxnFP)ZrdVKBy-@OJ&{_IQ)bNiSKr_9kWFTF6SNFr=;nB$>KK}0o9Nb;^@=kjiuvu}xBdWX=k@cH$ zrqWU+hzKLm+74t@m2rDYxa7h-8S}?z;H8k}G*8eYT<#+!LP24aVw-F=c@R_D*Q7eP zzoklBQPi|$cU^_0-LZt*lcs($z!YusnDSnymuR%3CS-BW==(Plfe#6MuExjaf8a;i z(&#x@a?-*i^*c&&|8jOI)mN<(SMl?!%JYc;W*kpt77j2sf+ys#5hIuC$ZJt@p_W-P z0c_BbHw+-(v&dySa)}sk0v+(4pi)d;rz4jM$c17iXxa$+3?TPk5fL*%(?-x|0C^;} zwc2RnHM%DPiaT#X0!c@Q>Ufa250cJiLV*sD^pS>82ks3fXW%yDMXy~+AfV%j)MvgO zNidE;@gFiMwv~iesAhPwY_5kR^zt}#V!1=?Q6>eDeagG?GuPdYs84ONL?zC#@7`SY0)|@kv3h|LZr>m4G?K@ zIxCTus>AGP>AF-q+G3s5j)tw*MQ=H5vg>;xRk=e8RzUfCVRQu|t#^k?S3t>iuug2- zO3K07lLEbY5L2{?1m}clY>EBaSYm7F&W5?0))M!Ybil$!``Cs}+e30fX!Rk#)_2It z!{@HGm(0D+A~`FK^(gmSBpVH+klTeAohDi9tn|Byq1138`&X%3`ry#euA%EoZo2Io zYRK4|p5e7SYcS(Fsgco4?QAS$(N`LC!Zg|Rge#E_5zQ?f9l;$ZK5d^G-4WH=<{#66 zwVlL1Z*60oYf0$FSo5yT*r)5ffB&%M!r2>V&6e9;ed^AKo&2yao_m)da^8~yHd} z7#)q|J1d(SQ0{HS?{OTFzK<#r&^V-cI-ewI5n?8>aiCJ@p2Dhq(@dJgkBSOd|Loc` zyUD)rFMr{I{eyTN_C?k4br;bbtk1GMi#q%tGf zCdl{mj=!Oq7xYE};NJ}Rud2K_Nw3c);yPQgdvV$1U9S8nVe~g*#ddwCo4wfFBF9zY zH>aV=ek~_7v{SKZZRlFulm%e=D~6lwuwu1M_<-Kt%I$}2vN!hbKHvCd>vkYMABf*> zy+vS0ciDVOX}Nr1;Nei;{rk-WmcIJ~w+BsulqyaEwj=BLI+)HawP|v8X=!%us_Y_3 z-mD_Yn%q@IE0eMd3$vY-cNu&(b!x?z5W;-Jrj5py)@dhNT6rOn9c?iuqxfyqPM8do z;ucp7l;S?7l=_D4Lk*k{G6yr<|EU@^P>nD1yJ+APR9rO$t5Y7;)cn}nUvOMg1hiuU z+6k_@$OYC3vQ2PyE2DLHWiOB>7D)5ddX31Yb0Uv1ZVQ+r zsKc+2OQOMLfo#${Lf6%>TbaSFQ^vg@^t=Ik-8XmzQs_Yi=#GEjD=V%bnSOzOLBRON z>}3^t2U0G#!h;z5Uk4mGg!cw9`b(=rWPRu5A=TkPN(olT-jO>fVEY=#eyxq>DlNp{ zfw}}vcB}nm)_VT8&jMvwUTH#? zrE{ozpzl7gzt;dJ*<|0;0A{&K?+f-6+yGX%Ix^~XjPJU<4a*DGWap+l?6aP||M0e@ zFXQT=v1PcLnCCQE<`mrMWSrBIF!xl~Tzx`{PM+c)VIW7QIWHO<9J!Ho+0-}m@Gwa@ zi8sUT3tmUZ$*9kR;Y&*T#jmGm&L2-Hnj^mIV_ds8-rg^C=eryILM07O{&^;A7I4qo zKUli^?jI&C4FF?L&p6eFMtvT28aoY0bOg)eUdDU!X6)fbP4Ae|{5g=dBN(2&4$yMn z^zqszu*o+#U9}w{@i>qMVp9Y~%IzBFu5f{8s^g=TMvX{HF5f_2TUSEA4>|nEVm_5J zBj_TpPJ`!#M(zsC&el!A=_k%K#n03bXZCN))YD))Xz z=7<(Qr4?ZgcdbloDl>xB<$2qOJLu!tneDX#tByURh#iQJIZ2#xMlnN4jP19&l!?ik z^2t&8Ri)r5tt!@56^qGbLFBUMc7W`9Y1MK{RSCPQw63bWP8Rma%6w#I{;X$?V8k3# zBiGW%?YBLLvblXe+%B1CUpDfMHa^A_A5&+0o-#)7ijP(kV|N*+0;VtJu~&()Ek=5m z54ob4xG|`zOj_lBDW3VYhH3$|n+Jda<2UWF|8%K3MqT#m(P3@2x3`3EorH`+du%tp9Q-{9O3Qp_v{R7Ty~! zai{Fde9!;;-AlW#{A09DLpk|d^0U#p-)e~s{)2Q1iJ+K<*==4B5k{a|c&c&KW_bK0%zl7AjO7$_=!v?RCQl7kjvt3>)>#b&`jYCi zefkYHvWC4yV8~pSVtDj}o~f?ldbNsu!_QYLu6@chdPR@LkIS2L)e z$iE(dw*MFMuWaDM|7rd;V4w>+y&(m~pvCi=P7LHVI#dD@sXi%63792dEiD>PHkOE% zR`*UV;!FZGOMI1*kwDKW~;`3AUSSGdqW^+zJATWCZ zVCO_avhs>2Q?*I1pm97F`DX`$d+a+;a=E+t=bZlJ^BUHW%F8GLj+!-n&I|(&cz%1M1i-kM+*dyEl>djvpoK1 zRwXt$BZ60KF^dloebv!KfWc=EJl}G8J>N=#D8Vw{AY~344yqP$btNR}9Ri7-fNnsf zm)#+c6<`b=55?g9Kg^3rqyf#ab88pcEK)tlSrQlpPKx{hv|c;hF<9ApeRuCXs%CobhAC_F zvvc!G=dH=jD_AH$NO%A6{jBRl%RU&&xIVNC`Zz)LK(vRv#MN^D*?0;R74Yx}Kx0?O zrQUnOFKwqMYM0Fp|NmU_f9_l|7x=W@pQAnPzZdPP|J`U0+oC<=wZI%dO_V_;8tJ+O!VXMtVur@&79Q(&(V{4uaE`$J&QMj_}|@FC2ZRK&u+--H1DSzLtF zU1Xm_sXF*jT3F?R+YWhYdf09ub5eSAKm;+hEH5>27CV)7Z*gfJJ5?|(^*4um3qmT> zPs6j)*d&c3h>e%O!V<0TpV8zv-S8LRDx*uTMdxY51~SGu>jGvd@b~T zYVg#s{UM4Rc2^Q6li#zFH()th2&EvoDD4&(r0y1jT1b$hY^@<^!`}wTf7g-y5Cjm= zp6a|e0iGf7X?};rzAR43`zkhQ75O&p&oW! z#EvC7x)^B^p)X-B%`x3kU^gpWpf8SZ(HM#qsC|B_sO1E`kVVQHChXd6FRqy~q_2DX zl+cmj;-gm^U?9?lJ1m-KkS34>MnND8J%?h#Y4y9CE{!)o5Yuvs$xT!k8)7Mm?0%k0 zeCp+-NlIDGn1nsdkBgCyuzD6`WXNLbgw#Co6~}a4wL%P$c0kYUCGkU)?c)ygz z_B)|OPs(PlHCvyQCOa|Cx;i2HsW5DewcY`+Ztu; zuV+zk)-2{2>y<32AxzOm@)=FnSbeBMj_# z*+s*S#3`qH#I`!TnYPb3|791r##V(PzZ30uN;fjP-vNpzF0%7O7(nr?BS?mnlo>Q4 zaLpCE<^p{}Zs;<2{zE%Krrv2ZSTwnX&@x~zZG!?W3r%l}?Q$F4pgee;~``c z><9|qi%f@jTK1Nd!!o9n?yunOJks8wEv;}{Ccgi&~x{B~g)xMe(IbUkGsu`ZEMOJ|eIIAH{$RB{wTIrF#&*a&0o0}Lw z2mxE_s31Z@%sOy4vRgC*_(^t`88`ZjpOb6aDBCV6QT9BRlBV=5qVyB#E8O{Su#1|B zR|E=sZA+|s*1HB_@7j~`e62oAsZ62$(2`PwA%K_~+J5fd028%@Q=gpb&V%$&L{hs&;Gvr)X ztEwU_!y@VQ_2#&~VDt1nS~yNcw}xXVrA~Se)q=e{#e-6c1`gUj;CN&PRm>nB9h{97 z2uLOUXlh?_#3JM_5N<%(nI6# z-Dhb-2_cIJ8Ag5RQKwW$6JkjSSqxBU%5fZ>Gm@|cM+H;baMV#@2TW?J`1-92ond{x z!SXTpJf)vCe}jL9K{us+6!aQao0HUQYJKQkX!DUJ;!{2YCUI>xeGm-_Nk6zbKst?X zy&MYL>4T1?A2i|UQ>Q67I%Uxq`g{S7wg`4?bKhA}&}fkmJ@h?Dq;wl2AM!R1Kw!U; zV5zWK#71-e7Z2=dO;iz9 zkBvu977`IL^;7v&5F^FyP6HGB{Ju=L6=Pd|`@ZZ6kpICdw{Aof$9EZRHE1VdKpb(Z zaXcKn>HG>5`%P8MjIS7RzazQG+COf(ek4~Z9@|uopP;(?vcscshsIFO4%ltKO;>6k z76>E}(F#3plWbzX1rpvvr+%k>27w(~C-dATi&XdM|rEE3WEx+BE}o0#TH6lHJps#$MeRb=d}}}$L2-&8y&CqQ@$%E&5G!Z z;tH>6tc;{Aetd<|@!RvP?~1!BBf8cjPAk!pSC8y&79m2#stZ?|5q%Lfg6NNVSR~g_ z?~joe{Z7Y#S;Wn_tC;&ajvnFqkeOU7UQmjrM7>p#dqR1sS->AQHm|O} Jf&Uxg-vB^}Tgw0d literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe1008_null_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe1008_null_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..c2c98c19dc4be5541d870eac0dc4c879231d54af GIT binary patch literal 486 zcmZQzU|?YGU<}-ML)7esBj1D%@+<$B#qTaHI<}jSt z*Hfs^cq=A3WL0B;cgOy|uZ>c>5@XJ^+(>o4H6gq9z0Zp26IvbFF8^!>nhOLTzV_dv z)HnV+)YIjDeSt|D=Pyoelgh3Mt5<5Cnj|UyB>wzNlXqugJGplXKr|qcmG$|D4G1e^ zh>Uw|{AR(a4xaT-oKH{6iCp91nJ5Ib`sF2O@h8UTj~Q}CKiYPB@%%sjt~DNx4sn*N zE-imFsXyL*_Ue+={uP>`3>1r=02#};E4Flc&VN_MEf)LMCilhvfCS?88w?k{M11U* zKiQNLX#VS1rN4N@%xjUA#_nhRPwW&-{`_deOe+qkzZn@~G|g{*#uAv!AQjjh%21ha R`cngok&Ja&owvAw`T!pO#uNYm literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe1008_vulkan_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe1008_vulkan_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..e870a155090cef47037921890149bf31cbfa7533 GIT binary patch literal 15030 zcmbuG2bh)BwT2HMO%NMJL;<^?A_{_{!q6O4kP!w&Me#TsV04(lnL)u=z>3(28cP&Q zOe|p6*kY_vvBlV1OpKCZVoQv@-S_>^UidruJoi4&-FH^@x4yOZ+Iz3P_C9BZYoSmm zv{~G0-}_$aHsqC&U6y{>=elo?ntsp97tY;(r&c$OIBv&oLq_#K{i7>;_c`dmOA9OS zJM+lxTfH`|rh56Js=XKAfA+_VHoT`e?WvPrDUE(@=@G|$F#g&Lm!2}R-SeNHL|odq z2_rr|aI0IsdFad~l`mg0cxJ~hI&L#~!IGsbuIu;2xjlQVn*PkigWrGZ;L|(Zy-s;R z?td4Y(D3lU|J|){z#(rBdiRPa7I(gB)#xYBtvlfQaeEfmW9oOF8{K2opl2T4q2obs z-SOmAmwz>J?6KoURvfa+^5?F3>)dmuS6;HBdBw!}{iYQD-|R}mw!XSu<&q2Eso3tC zqZYs4_}ZhNmy`JND}`tG>NbJW^}_Jy|e4xLb}tsgy^IsvbNtiyQub&+;S9MgvXb4(q^wphf? z3+9#v>^NgU?VRGQ5_;Q0hipt$v8ict0E*PO)xOZSlMHcMjWrwWXso zi}@(8Ypt+F#If_|Hq?_ic(dZXUBV}~!PzWtc0=6^OsoCY4!=0=9J9PW?@8u6s#tTxOsYH=G1kX}m2y*Czei(3eY1YC zA8e7s^}}y+O=Ck{-NczQn@Sw>YJ1nPn_w=)9;Py@@A6u@h5fsAhYK;vKHbA-QmL+? zCM(^s^~J;LN@Ob5+ar8N*Kw0;XV(6}uYBekgkO2Rqw7k=MksDf$AahmBX_cVTQi@w z1gMu@t1Nqys_drvk+ zY}(Z~$+WWWUCGe^k0cIV35)wR1W?be@jT3_RG@5*NAw&0vkF7M|Y za($8TGp?Kud~ohrZg7tC-H@xuajrvde2#O!a#cCbJ<3(*INt%esX5MjC^s#~xqrDs zbDU=`=f#XQd**VpbDU=`SC`|=pWNIWXO85!2CL(FC*|hnIPaj`u{qBBCbuxhbxquv zInH~f-_jiCJ(4>=$9Zq$F3NG<5xFZ8XYOorwo0l)&hzaKc0YZQZKxNqdtrqmdZ4=p zInOxk?&0;dAFl}A_1m`P^F)8wE|-^XL~#9m5o^t{>aO1wx@)&~LhlLA`)`Quy2IWJ zY+V`OJJ=VoX;=3i+CuLQHlBOyL$8nVwq;iJzKA|bjM)V29O1JmSWXEabDNK|Il7$E z70VX%{mHfcmWcCjMQ?8N``H@(!#3r(+WH|+KlRk^&SSp%BYhEd?b{%;y7dE#W{PkBG1~ry6#c*?jz1$|Ivu`<~qlKU5A|hW9hy3^4j;H zcRgXR1Z$T!598>KNw{qMp7gB{dE@PsbbZ!mC419vg7iZkMWbxU8DQbe{#~@N1RnPxI?S5eG1sv+IPj@v-a-WLU(<(&^wgX zOgG1V1{p)UIqZzM26c1hXHV$by>FqLGxNuCGJkWXP2KgnuKkcgVd4Fu@1N;!jtqS& z`Y}U$XLnZr1CSNV`wx%1b711+W6VL|4t*C68^G+=u3E%d`%=ts2B>ssh@TIlsH^oFGG&U&o(xrpbeZjO#bJjYLA8|iIdg8h7I zLfnu2NOoZjHzU@Oc`=vv#xig75bfc66gcneXJ+^w4c2}#IdtrN#PRYmegQZ?-p|+= ze+*cAjQzXb&Umq&6Tu4+ZH_h9Cm}I+_??`5deO(aPXWuHn#P?9cC5TU=Ib;>KE^Bt8zaV? z4t9)uj9CJfkGanP8^<-CnD%!jSU+vC?z6zI+xk3F6bmcNl$ThRXuk@K8yN!$fseXPr?6L%q4Uv1X;MfA2W z$fdT65jksJ{5idML0#UpTR%TX`Xbhmd62s#>6_BKAGu2tzd3!3T?Tf%HfzrJ>M|s1 zZY0>6vraBgw&iL4S0t`Cz3ab{-sbwRp#KFT=X%AbG0qyf3NaUpkR^%xW#SjoPhuSv z^uI#nXCSuly&4?j!}l6EdB?OuVyBd-46!FYe(A zaO7k@Bj}B7UT>zi#rt;) z*qqvHzf~j6yc_d2L{1-Z)amVD>u)6UPoV!b;ym)M(X+V&k-s6W@y^6K&bjWQw>g)# zyODbk=MqPp-++x1bKMJefBCt7i!LAMdLP(v@^SC)2g~sv+^*qc&f9!FinvDiuD|PwJwFDvj`Dk6i7vl9 z<@a&0oN>(W6ZAIotL;fd&OM837-yX>L%Jb0*Jh3Aqpy0LzkS}WpKITO{wZWIV%#ke zeXry0xv!@Y?dILHe}sAEf1h;iQOD2ZcysAp`U4VosUBRuOXWNAEP5xzxQ8OXACB{l zc@EJYv7b*|+>yi4brT zJMuPI-gSG{&hK2#8FQ@y=jZw>dds=~1}7hL{T=K$`H1rmus(4|-T~_;pP$<`#2xu3 z*fqL${ash=`Cnk`BfsZ&(dFZgya$#uj`@9`-e!KaeSpZhXR&w0`dfzN?}#;`kG`%o z&fi`=?Dla-J_HX&jO!iIH}1&4!P?EcXCM53z}|`A6JKh|7cRohq z?lgd}L*n!06L9|SY=-VQ@6M-)_K5vi;x?xD^JO-D+?`qAxI3SNZE<(L0GlU!^Zlhp zn)x>7SBRWG;l?ZJ+dkGtdVvGSgkHQ@Zt<(x5BM{s_wHPKtn)d@~M=IRV~oP5Mt z3#?Dvoi1Sg22m$TUSKR zJ&V0N*55KDe|M}Aee`v$asKw|VYiRF(+ywmj&Z#^`o6X7-k%d6|NIatnG@{QO6+=2cu zKCjoK-x6I;Kbw15hkh$`ZEe8yjCC(tqsvE)^aIP8bMx3AY%`DAwn5~~n>e3G`B?L| z;Nut>x6Yck<`Nx7?m-Bna-RmCc^6qy(Bz!C3Tz}qo z9J+k?#+mL3XB_QuetUskgSLs>0`syr*ga^o)?Ksr*IJEz+xs@@KR)?ezm7F0?pxag zFhAMfBK3=N+9&ZHvF(q*M+k z2Fu@+)^rG1Zfk7T*>teYI@5M2BIkO<<|Ni9AMaNY+>UXvmc!7E8*gF_Snhm$;_nhO z(Br$$aCl?6?h?E<*E5se7T;xNp}Q9Qc<*L|9n%{>$JByt?m^q($PtL+#PP<~fnB$2 zvqkOALD#0(?4tHuk8z9_^Vfr&e`EZdzX5D>erp5r(a=kTm!j^okg^K+blE+2C&1k2^;ScER`TrJPWTwABs zfjPHVkF&G?n12N_AKqVcVO<#0^HFz9_?!r~Ch|VJGFBhIyG;V01nx|4&HLS4-Enb0 zP6m5FtdCQ`wy5b-(Osv#_S2F*>US~v>B&bN^|J(Q+^FBEpEKaJ`EI&z=QF-BqGrzo z=WF&XbenT(I~$R6oH*t@2mE7mE``^|&-dmuhHG$7#-DE#*X|yT=e&NV zIL16r2A>OFi$3zK?l|9+BK&#acvIqcDZfvh53fzXebIlG^V0A5?XQ5WX? z4oiN%Q5V5$3%`qVelWE14Bgz>$KRSS2OG<= z*31?3HqTGnm57|<#PJ#Q3$VHCk8k|WbXAUv@AJQe3t#Qw`zx?Ha(wt+oqXlAd%iKZ zef<7#4cOls+=sDUmp1c$E!eo(9$VP1LwC*ET$khGyXJDR_Rv>=jTLXl^l!}mt;`taI=y9w-fNMraN)H=NxEbn)l#fiHm>CPWxZw2eCExrTZ26mjb z@Vgx>uY}*P!TM?I%y%N^y#ve-|8B_NM*-dqePUmCCcD31=o|c9iSGjM9%J6S!P*=b zzW0Fn$?jO*_cxH*^o{SX_kxX~&9z&HzooZXho1L+h@5pOb{^l|`@#HV-^q+)%`BtW zPyhHVegN#L#-nhK z*I&EwV{MOtwJSC|$DW^RVkLw=O62@;urZW4>nFhS`uqEf`+5>=UbIELrxKTs_cWZm zH5y}okFJk4Yu0$rfQ_lGbNbHw2QWX`|9^x2&KK)^7VH}Hai2qXjJAmTJlNRU;%r|4 z^OK#e_Wap;#_>J+MX+^XT{y;b_nr6i^d+$MdN948r|S9}YcjocVjq8dnF6jx{GC^y zs^qgj{hQQ^p9M-a5}yGtV~fvAymSAN z-u2nLSL^5vuz!DXJ%2*}oNSJL6YSfs?Jqf7ceuCEeOI-;oou&|BY#I+g|6MT`TN9Q zlO0ob|Fr)Nk#{}f$nW35=GXD=+Zy=?SU&3Q9q8KF0blz0FwKK1Sq>CHDLxU-Ignm3HThJN60Ky_t`AKRyM^+k*Qnaniwkp1Axw z^97va_1A9PMdZxd`4VjX=#yVh)Q~>bls>Lmf7fd5Szp$aInZW)w8g!#raX(dH&MIh z!131ES71N4wGE~>Pv-J#dYie_rx7e?uI%G|`v&ZN@pCKg(6{LF+rmX&7?$n9w>$h= z!TAPhiyCYVW@uJ}+Km;T!)?(0Ow=dd={3OSMzPsJtv<`PDEc_ow_yslcHnp$2B3RK ztkw4L+SJ>kcL2AikMGAF(dCxG*Li<8yj#uzX0o|LefH4*$mQ{Q6DgySVkVF4%nOvj)0*_4gOgCf2+jHtj9f z?791%tdGro>lbI-6)bNHu3O?%14(IP%u_M)Wr8TieEnob@e^`tA+3E_T2-*3$<)*6KT^k9Rl5+k3yP zslH&xduJRMvCZKo=;qHn#&@($!Nwky?6J?y;A5XVVvBul4zDftxdqr5^6qm>dYk*y zwiP1hKE?6oZ4GukgYflja((^KU7NP3o&I2JM_bF0N6OT;I>bk`3i1e;&hGk+5tr$Ys)eEgl)&1%{laqScAZEr-K`u zxcrgA26Q^r@_aBGic>T3o zgYoX~iSD~!!`j8Z_xjshyPt*TKl@B1>pPqIsXzAL7BcSkJ}XbFT6ETx0}iPgc=O?< zW8QnK?YD>M+h+NS5z{IUoO#*3FMcuMw#kpD|8g*k)6(Y5KmH$H78W$@^!e65_)jD$ NhT{)E{WV{V{{dt;;CcW6 literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe144_dx12_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe144_dx12_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..f77e677928db09d4d2cdcc6b82ce773a8edb5bf7 GIT binary patch literal 9314 zcmeG?d011|m+vLvWg!VcPyz|^SVf@vSPURalYoed8Wk0*t$~Q51q|p9MX7yR2*C!8 zD2QNd5VW+l7SK|$)h2`=1VqKH#kE1>(w1sOYq8_6o%;efcG_9KnfYVp`{sUcIp^Mc zmV55G_uTUm2!bH87G7|=Z>*qC#Maw=KKi|2CW;Q!$$nJ54teh zJ>~TeZOy9|ME}}RINu{}-#5z&BWIqSZ)tUvJ-OYuZz^rQONTc9N`5P}Vq)~wCx2l~ zG8mDU*}^v6xQ-zh>LTp>X7c;jIqCfq|vbXa#E%w~I@GH?y+eDdPOk$ciA>N+Z zJUM#v@=Imh$iF?G_d5)X8{-E-2=NAYGPu*godxazaLd^cv?ys7MguV9ctFssMKi-k zKu6X5e}zjHEy0RF_W*+CFUs$rIK5I&0WdMuq*v+)kkIMXGKv#A6Za@i&=EJmXS6Iz z6{QxjASeTJf>r`MC8o_vAps&n&MHtZPB7l`WkS#r(B`Z}9rSLXjjHh9C9+UvA)JWV za#+m_bfS5Vr@WVeb7zpm<<8=EPK0|5jXQ@Ck)ci2yQ2w7+Cz|MgxHqM*1P(*OGFD4 zx_;H&?Ue8&WC0iO20VE>D=}oMkkr7^*a?t~!dH-tAp(T;0&Y72xIpA&U|T=~RD#@; zQZbrB)6iiUDn%hk3hE;Kv~+Y;F~!ZlUJV|1)U|r|F)2Eov${QnV=*y}7zyr4MD7^b z{g}%WE7B}?J}zMo30;0hUGAdPdL#9jgndWo@(6V)lClTv?0%t3HiT@nQl(aEFfBRR z0!cXvuErIS?tqvYSB*b)hq->@L3P)osgk1ii!-!4^c3uG3szH1>1byj(8y8p`JKB~ zaFZ7$(sv&qmA5B#oIi@*kGe>S+TA|SH83SuGHDJxE5rZJnx*;;UTaC!YwNZvwUS28 z?nbf^RYvNdJF!x4ojO$kyVT$M0OAebUPo@AR7VZrgbAU~5^(l8nLkt|tK>68c_Fh|7B4pSHc$ zyD#s!jZNus#R>m%bI&)HY?PJ=vPufG$N**?m9TSq*;~L9a@m4W^9|GuC^bjV&Km_b z8>pLmk?%Rw0s}QqN;H8EL{CsDrEWA(3xw1hDH}9x0eyOrdoP(t*`R3)=+lcl#2u{; zoJ6X76`4JfE3=HiLfQa!`d{5UDy^bCTv7_3Pv*#ywVfOSPeDogV8kzuJ(i&tAQ?s zVC^Y@-Mq*t`XrKD;uNmTc|#nzDRg(uoUI$k`|?_0QLS@a&DLEZ86k}7kYB4?6@}q* zHaN@XT;)*Q)aGiG|1FY^2GOW3B8aFwmoPQgtbR_whN=?KFQ{yrPXNE zK_fFHJ2!Xs!-2PF|B&_IY|f5JJ!SJ6&h;Eg$yLg;c^vaerp$=5L@f#^gjI#o>M>DF z43g!huB$=$w-Eow@nq(Hx>&;CQ4*K}imXwDS)}IPVv%PGXPm@J87qj64&3zY$}^`4 zzXUBQ2-us{qDbzwMha+YUMZYCuNxi*?JcOh*J4WUvqlPkMYNI3k{*`r53?J3(4;&L=wDaTEeewvDv6hZaz#zo$G z#qO^{MejmLk&rp>;oKuVA02&d*1So&u-AHWj_5vSex}O- z#;P(Q{`BJc?nc}t%S5n`z4E#1p|cl?TgxgIRPXlR>i>xR$`#8hU3;jiwmbHe0Whw_14UB$Z&Idre>syJJFs%aNcUjWo^vEL+d zW7-`)rM6u>*Zbf`_q}@!y|(Uqy|?--L9`NHHdel3Xd}$z=Q}JpD?dMd)!Ou2S>}vf z+4@y$bJxsF&&f%5Q{Q0;xb(?Iryzv=n!_5kjZIUIH8w?rM71`@9*-6@)7xMwFp5XK z92muO*eKOCyKdC*-e1<2=J_wC(E`)>vA>G}PC+M3lf5qGVOiNvT|L=Hb-BPg7GRx; zCFl8Ic7h!PoK<|+wfI7@=c%sGi!Xqo#e$(dupc6GFTw7iJZf8t^>P7 zXuh+XEYu$uyZ{*dcK>cF#-%y*nOoL%s;P<9R8iaow21@SJhfjTbD6xTBdl9O_5kYg zE99PJa$l$z`<7_jI@qJYEQedZs!z!EGg1AUYON)DNKlTt z2Tky({AI=_!MD!>D`zexoXC#PuiC#N?Uu*Qt1GU1@UHT2Qu;0A@fqp)`D-)t6WeWV zH#&N|?}7Or-;2q%I@i^JQEoN*fjxzo06Sb76@3zT`2}j?gKqojzFTdUs@{tJcg|io z)m72dFbB9HAh?2b2h1Y{E))l9Dx{^A^3uI{X_dZoUviexWnEj)$Bj)_KX0wyRndB3 zE?pV2YV)Lm%=`^&*XJ%G9i)4H@ZOu;nm6~|*kf!+(AMY*}_H>Pg{EH*5nyfaiX71U?uZp<%~tY4eEal;}~ z`2#WF^=!%gq@_V%FKeU|0g8wP3&1;)hV$F|`K#UG>Dq)CwOJ>|sfC-V8>;e{_aK*_ zIP9l5JCZ3L-)8bYSIb|GIXSwics=ClmW1g#^7Nj~x{Y$`RvNW1xkN6fZjqAWyfSCtf2DZ(Dw*$=JkpN;GR zjGSSq<=blcJ&xy%bbhxlzg^+oosN8?Pl&Z7#8x?;C(JQ>5@NLExIN~{KTK>Rld5T%KYog$4GxAtVH~rF#YnY0Wo2v$hj*MDofyFM>=;@*<3?;E$S_zy|pA<-X6mwBCA zbhkgxleT}^y8+)j*o;pdsndpnwf9l!ormK zU*8m3nO?7OuVT`eCkKvlV{f*Q%@n;xR)+q?*;rTWIqAE?7m(IZtvv#JIpDQ8?a6!B zTeLYRitaxy#zPo>A>PtpI+=rgeIiHIr#Z7}{7PEGLG<87SW}Kc@RMEF1@yI!&RQtQ zk5ZlP+hcODHSNmYcA;8o-5jjf#1x7VNJTU0iQJ|Q1G$X>m4Rfc8%Jq@GlZNsaz_%5 zrQ$bAyC&!I#sZ!eJ}f>r-F$a`UqbRWT9jFAuuhz<64I0?O({vOBq=x)u#DtcAqfgJ zbu38;;YXFjhjYmi1cI~T)}44k-%9JcFZejEv}=+)0V3x-C{|;Bs!GmSmgozn3@0(7ltmc)A+yf^FE^?ZN4TU$Wg-uBqi7^bdej z-rV!i{nCa|B?<%+rO}V3Z1g}bx-V$6eTWA%?RtDH)Dl}31)mLQ0vV(mTAHM{oGGHJ?DzIxf@Xu_P;6*qd4*~DI2=Srh;qyAP5_y1+&exQK6aU@oL@`G5nc=XyFcK3txWkz-*8I zC9{%R+z{bQv6#)5jK1t>A;I9&2a$8RznXK+glH2Le!=PtE*xAc<{R=T_-zt}nTT#i z@Qa?1*Jy4e1+@Rg+=xP{M$rq7+(>&|#C7CGlvURpxskAeF80cz1kq&jxg7mERpT^X zW%1g|OqAcL5QLF0g_(shJIFa{w8P7^3OS#84NJTjCBjwNN<59HKeVngvk_;RK371& zOmNIMBT{o?_H_+@9b>*RvuBO1mhI!++=DiNV?+ixLV(kvAP}tv$C19`rmGcQbLl$b%&{RWeN|@u z-1Vz6vll7rncyt5;_8j%@83wfdSegtNuuVycrSJ7INQBvBWX}{;Da9kk3Fpyy6%cj z9U>ALdi(#MOa6z?C3ApJJN-G@GyZeYp8lVW_OK(`vt9}8VSfzln!gO}vcC@O)ISFH zlve|L=)V`(ReuWX{o_H-12egz-H+$gym;u}r~u%FFcMBhX8JtQ%} zhZcktFZ_U%xxffJEn<&NjVKN$OA0b2Ni(<-&fO*XnOuo*isUz!y9+~#Q%}M(L`E(Q zg4I8qWt6WiXMzPu5D0o2GgtKXx!6Z#t^>aXACqE9hDWdYyep%;{pmM9L_2x_1jNQH z2cq5PK+s^Fs{v&kyy;*_LmZVulXb2j^4|W=@wwU`p+ick5P8>Nf_>}?Zyh%PqA6id zylotHo0Yl=%g{q84Ozuu?B@@d##>EV5eY}RdPVTYjYevbp6ZVvfPwzF^2#W9qAif& zk2rza#uH+mj>`uO6(x){LTy`?7}5pN6i!N7k{ivW7E+S-D`~UohbvRLaTHhgV+@(d zk2Htjn(8Wanvp6r$`cxOCb^2^oFx%A9%JTkD491&dy1WWaDxBhB|Dj0`EYjt*ltI5?Tx6XBj9xj1vIT2VHv z;TPIngf|xqSz`CJyUv#bx4Yc=`b^z4+8?u3@pP+SmV<41`o6 z$5(q^t04R!d(C4v6L zoai;R$t8Zle%1UT_52~wg;*7)tTwb~Osbisc?%exyx7SfVFAN)4t31O+tY#vuyL|* zZ~_1HK$n~5J#Z2(GmaUY=r^HJd7#%BZ-#<`A6>%+aNG%H$EN@TjAkz^DfhFzsnev5a0~)Vm7pGv?zRp7oS09Ld5v z!0>yR3PtAs2U5 zks%RgKWC2W@S6twB)#2AO!`+(g=Njq&I@XkJC~zosJ(M(-DKu!Pr+;4+y>P}p~_j` z7+1yOq(oaqSk*!vT9qp)GgJlkAt4-*xmm%WT(JA{8if3^P0c*$OBi!bN{Ans>7S^D zlyOy>BHfVl^E9i6z3JlIzzbG*3@;E7w?27GRZ=OjP_vXAT@bS^ixkey;XH1- zhTfL7h}ze*OJOk72(R>=A{ye`cu>F7Nn8}R*(Ou^`|u_`AMw+}{)4`vG$ntWT~id6 zW|Ot~`S8X)=SCPi^>Dm~X%EM6o6Ix7$4xnuHleH2VkqAUmPgN*Hd(s7t5c1}w=|U$ zG3hp$2KDhro^zv&od!4_VcGWuK0rbsRb6q8frP~@1Ezyi{v|oXS~X8yyNl3@8;%j{ z`O|sX0gVRzPI_@scCc;H?^6GTd1H)T$iiK_rF}R}2M6!6xK5l#m$J+sU7m$y3n>;T zb(USb=L1TkMzq)-z!jjROeiJrR|;Zg!3PY$TWr8vh~Of5zq{r^*U0W!=NI(*g$cm* z=XyjdSnsF_W zv6z%*ZVdfsj0Dn!+)iXH0jNFnQv#j+L*hCD#U?cosH@5eOsQqdp?T-p!n*w?Du>rCzXN?&F>+EBVwdcwEYBCSkk_MyRy)cT@8d_npQovbX#$J`5n{Yr*OV5^vm zX8hZ4g+;`*D!E)oBSY`01mQLp4UFU}6ob&O6Gg)GEWdBQz{PAMQBhrNRgOeVCD+26kb#yUSjg3T4 z4ie!%`Lq1VAVx}C#`KQv^EC@RRu6Cag8j=z!Iu5$9vz4{Uf@31WYUkufay;rnMcAw zJbCgc_`2I<)%1j-0ngjA^PB@CQ`dcOrCK_?sZ2Tsd-`$1V+e=FxHY@ry&pJirS;{2 zKoS|FGDd7wjE?v1MG+6i^o-eW5;~z(3hzCN*f)xLF5H&w80W)7p7&vvP7)lS1OkRH zKC0D*4UwiS5*ISNiqWED%q%^kc^|H9SQj>K6Dd+pI1j3YIpQq z7GeBwN_+Gf1M)Tq)m(yBGt~h8```d8r`C>who>GK1zV=p9UJM}F|~da{ATJQ06L^Q z#jQ(-G>>>f(=ox6$dQJ?xNO8tbSDWxK)t>X4lI-wD07U8If(# ze9;x1oi%fXAfd?Y`t4cHck=e)$o5Uhm^EnL%SU<#hZL#dRE4Xph%px$K#WJcY_cn; z&nL+9o-s$jv`8BiVfFv|tzdl#`S1$hc);6MGH1^j7a+q%+g I#6Keb8Q3gf{{R30 literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe144_null_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe144_null_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..c2c98c19dc4be5541d870eac0dc4c879231d54af GIT binary patch literal 486 zcmZQzU|?YGU<}-ML)7esBj1D%@+<$B#qTaHI<}jSt z*Hfs^cq=A3WL0B;cgOy|uZ>c>5@XJ^+(>o4H6gq9z0Zp26IvbFF8^!>nhOLTzV_dv z)HnV+)YIjDeSt|D=Pyoelgh3Mt5<5Cnj|UyB>wzNlXqugJGplXKr|qcmG$|D4G1e^ zh>Uw|{AR(a4xaT-oKH{6iCp91nJ5Ib`sF2O@h8UTj~Q}CKiYPB@%%sjt~DNx4sn*N zE-imFsXyL*_Ue+={uP>`3>1r=02#};E4Flc&VN_MEf)LMCilhvfCS?88w?k{M11U* zKiQNLX#VS1rN4N@%xjUA#_nhRPwW&-{`_deOe+qkzZn@~G|g{*#uAv!AQjjh%21ha R`cngok&Ja&owvAw`T!pO#uNYm literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe144_vulkan_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe144_vulkan_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..c12043e8fe681c7e05c7dee8165797600d07cafe GIT binary patch literal 15030 zcmbuG2b|T#wZ|_YO%O$?qJRYzL_|SQR9Kn|3bMjtMe(v+V0GEW-37r|z>35|&{(1< z#>4`4jV;C+6q-Z}Vp<@0&(^Lg|3WPay&&YYP!b7t<{<(bRn zaxIoNJLvvbI}dqvWQXM+^}7Ds1=H_c`{Ig2_GotVh?92jJY-bAvp>G7XRjj;zdX10 z{&SAowb|>_sw!76sW@Qi1Lu9RWXpT=)1E&4)xzl4mmho5hZC;5c=;J4TfOkbX~dgaL!*{&(n}^R?R{qMW!L!>l_iE^UAFy3tRqs5$J0apUuwGxfXAkM6o|(6f*2*7k_E z?|ka&E5DvJ_QY``%Z}P>_4C)hz2f}o<(I8#Tr+85->JF(H@nub&97-yzU<<6%XYbT z!O{=vUw`b2QW9TzHTT^9ohFR9cHM0=4;uRAV~ZwrJ@nF-4_h>-{FzB>@99|e@!Pjt zI;_o%mE9KH@J+KqZd%`=uYJ6MWVT>OTRyV3!$WU&JFE7i%Cd{PEgE?8g1gF3aOxZX zd)TqZ9Y3}E#gp$FdH%Y-ReO$U(R{nsxm+{S*&(-o^HNqj=9(9ocDYu?zI?)z2?H7$ zXAT&=$3Q(gFr~46epRFU zXj2@=(57>j*H_Oh&bcwRF=NWdA6!>6e{Nw+p`oh0Vk(?F)n==!uby39E7z*XnV0&y z#(ZOS9c*bHea&C&eDe3~t&8K#_1wAzg}H^=#!7OCO2m@QGboOoGB00MT|2vEE6r!l zi?-2q^J^O$){pU=iu{4|=aTG((wL2lbD8h3eV6FU!oosL@@rf4Gw0zqrrOL_6~Zgl zX6}nV;}$hE7U~NP)vlpUalHF3+9u`~vW5t;evR$Ieqdew+il=>Zy&aUs|&{$ zE#{-Nu1&%g5yvi^S655o;LVEjb_k!$2IsK6IdwHNF|GI8H2g+!kaHSq3k?mG-}h@* zjOTMz+{<_I#@1HV&Ez=B^K<9sOEF99^PUuaN9C)Iokf*rBF6f7uu^WSYxk?Kt8LUT z_Jb{QxJCF)sj9E5shKouRzrbfUT^Odb`#8n*w0iJ>$|j;&SC#<-Qhxvl24cLnOvx; zt16c6*xLMzngW@M^>z)P(KX!U>RHu4@GG5px9}^icXUl5Uk}BNX`A!BH*hCQx3%cg zGUvHZuAIF7^0#E9=RLXdyX5%Rc)rD&sxMTE4rV z5u0}PZHih+_pW5^>e{{M`g=#Rc6IHpL%VZj?dsZHmv-yVIjyg8nRjJ7bX#!FCzthe z4!Pb)_!(Eu2R=CWEH^mA`EJOSWjNO%HzC8hU%845=N{!MGo0^$+@TrHdnh+8!?}OC zqcfamF6YIJHGAfAb26M~E?1M`%%9x63}=qyxCZOvc_-x-W;pMl+=&^^`zE(I!*xpB zIT_A-rQh-l=RK0UFvEFoWZ^T-2th(#Bh3?v|ozT03v;JG6yY8^} z09#ka_YU?(Y}(bmhqlmrf{o|ideQ4+y#CCp-W$yPuuVmm|j2))#r^>8JNqH(&jb-bmPY2Gd4`-XCT9yt4;} zzDv=ZD~s_1&^`OmcLh67=mWvtgBZUXIF~CM5%%5Dyc1y`q&c^Ec;B?Q!5P~gCEGCf zIt1)IEs*|XQ++6+Pe{bv6OJ~*e4C@a5IH5dVPNZ2iFkX1vo&Wt&vzf>TP6;DUv%G& z(1(K^*PYB*d#gL$o0(iD9-Kvy(@|~ z^)kdbA+F>9B91dgR-CgZEAp(}tLq*`?>^%E^&gEaM_lI^deIWvhjNUmW(Q9)b z+A9(+OZq`ckMWbyU8DQbe@fEbN1Rn9xJ|Q?eJa@4+V{rav-a-WLU(<((A$*MqHd1; z3^ImxbJ!kn4eI91&z{h=d*4DgXXcOP6#dPaHg(tQx(-Hixy28Jen?3#3;j^^6NdII z-dX(*L)NVBH$3jn;fa%vF-L&g^jRV1@?2G8FQD>&rH}eD1|(u{d{Ub+>iZ8 zc3}-SBG!?4F_-qnGH>${?cuusob~lHGklK+Yd@VFI(8xAc=;H=2%H`7XKai=0jxd7 z{|Iah`4iLLP6W$OV(os0o`kr6#b)h}^e$0E7ijV=<@o<9xnvT-$blF^gl)9Jm*^zcM(`0>++h!T@2P&n{|E(z3oeKsqIok z&RQ3LLGN8qmv`;f&(DzFh;?KhmQipCfXvS9})ZtdXk`bFlgoY^btp$-T}7$Ml%0I`d=Z=BkvkLn>!Kt8`B!^N}S`I>u!3Rb7{K=xfgLR zam4vG*f=rQePH*Oo$EK~@^P;BgB>Ry_x=H}e0Rk9cYfz`&Y0^#aCWYT(3{TnFr0kM z^$7SuL_XsD7OYRa36FyHlh4lW8b0B?&DUdyYjp4WyRO*t<6!G3yXUp&@~cyRp8(4l z$NWA?Z!^Ezok`;XYKmA_CEAaBZCp+?ttifJ$KK2 zJ%eaB@1Fgm%q#!9q-&2lem29KOYhR}k+@5>;L=?x-I3?e+abn18u9&boNvtYi1vv6 zLgM0%9D^Qrq#Aq!V%}b)x5XWK32Z*>wZE*9W?qf?3L>YEIPS=+VD}tn_!`)G^rxew^zM^fu?x_9pU2#JR)~=TBhc#9VKI-CuUDKcmY>-M$TWoP6Aocfj(l z+p~6l=W@=NYaKW{*I&?^&h=L~`Izf(V8_WvoWFzhi97NxSU>sf+^!++$UnfY(Y@>M zx?<1&1X~~3J->%8A9v(^u$*zs?+5fY^Q-McM9w{ny(8A&N+f$ntPy?mb**v!_Ud7` zk2~@acrapI?})x}NB#xYZr(ln;QtNwP6Qu!=VLf+j*I&K4_Myu=GeRQ2@-dw4tzZl zpD&++vv+4ZbjNvjK0~xe?9UUoHNBrNbLivl%m&BZ`2uW^S+jJN_Ok?^#&`&hK2#8FRG-XXn}&z3E)-;N)Yj_F%`!N1RQ-`o!Jo z0M<`FJGX0yyR#|SHM)2GU03XRGqClM-E&7c`M5iqgXN6lS#CjZGr!t8A#(0n?A@{c zRwCKEV~yyeuWOC-w^t9lecYYS_)p{e?noCn?dCmuce=uPCxVZ=(+ysmLF`_P-xlmRdE-oi+YT(RuFv*hIcv!`q7S$Y{R}>@H>ckL zT~0rnd)bVBM|5p1z_pBZFFT>jM~(Ca%b9cY*bi(okJ@%d&NYeBA*?%JG#7i+!5bFU}MQIN!(zt{9f44 zNZcOi@`uBnm$)J5^1HyDmbjtl^26XFpL?Rq+k)FGankKM5BD?-MV(hH=NMzk?+xyl z?BTml#@ATkyDwOO?G?lw!nomJ zJv$a(XbjcH@7_ zjt)t7+>7U`{ZK^SImPh~9R_xs@0Z^V4hJ7cFCRWffQ|3xkv`MF`pN6#`i=z4-<;NT z6j*L2Y}VOyu+2Ktb~GaAdc@`=)+ZnDS03Doaj}*e=*EpVu?j4AAwKbUiJ9o}-Dfzw zv0QfnUYqNgMQ@AmGPBWLi+#LzbHI-2iJxPt!8Z4x?HJ@(#Bt(yV{5>!+qK!E_U58% zQ*3rod#=Yg#*6uD!Op)me$HP9wmHAHd5E0j#4-PI;OzYI{?x;3vqe4|(B&UbXWIyt z+XtU{%;Wu>k1p@MQeOa;I|A(AO1ullqsv>vwue)^h3LlH7cS;lgf5?*;{3B@@)>zLzYbouNYr=ZKn9E-tn**TV=%R5)ovoY7!sdZq^?bYM# z>_6dOfy{^Z*IZZ^#`JvD9TPsMf~|?H&)$sH$M0^F!KZ=S(_8a?H&=ID+>g`2-Vf{J z46rR~`b>1!X|MgPWRLn?ihg$T5l8(j0~{doH@o zIklaK$T?0NbDj_0(45QRwej=4IgQ~O+>^2Fvuko~=Gl7v3D~u}N8>rKpDB(p&r`rF zz?;xVp4A=ao05mW032^h{4VA9sSDw?>30zNPcweopnFcfj~Bsfi#O`xjNgpp=Noki zyteSWG~-v5@%tIPw)l>F8Q8JD6~SGOu3x+#E5Wv?k1Np4oqhbR`AV>{9Ba+2qPKZ| z+O9(694C&?pr3=yT|a!|cc!Z|TzsGZ1zh-Q58q#c&5`57_nPD@r`_|7x$Wckhik$9 z-rzor?Ygv?_v^sME$*?2?Rs?Atj%>fF1~B725S#}4cJ)mcH98g=TPQ|&;1+G`6>Rp zu=eo13A_co_TX*?`yJ94eh0NqZvo5u-DYXxZcV!L$JpDz`f7{sfVYDkr!D;M0Lv@k z_bae|+S>D-$a(Js^TWRz^7m1IcSE1p*Imi(?-%+8e|O?Lz`Mto_a3k|$A#~`V19~s zEbIGgNNxJYch~#C#?a>4t;65Y+pI&+`+h{uIutvP@9qO&ev048jAPBLq}NaX_$+=9 z?A=vtcE0zg5Z^ctLFf~2-@{;iefxrY1YJK{aKBBQba0O*&iED7rSHaLaE{ksyYXXf zkAt-JkM0<45%&eKv9-n7z6j>0c(&TJ zXX_cq_vn|v)`4~57|-2z-p|vQ!Pe`M^nRYI>u;={c?~QVxp^Hd*OxJKiS6gX8|d=R{Rev2XYXFE zqc_3+{l)eC5&2WHIrc5EZ@;!bXKY>I-bVLb)%H%Z-Aa!99dRAHcGu?b6Mso|OvU@B z{jZ3;>k&tO{{}X{j(6YI$lt;8QE%^pCnECJjBn6C!2A?{U-13WCu07y==c4Y@4?CI zwtpdV?nxZK@BABVF8w_q{_XZ-ba~Im zSpT878B5zIh@7#+o?qlkUfr|O?woPQJ_Wls^AYdIXJC0-aGxhmI=C+qmwjixgmb+9 z+Ksz}oLM_xfvq2Xvg?T&(#M+8$2IHkTCF|n%bGF=+RTr(xHs06XA$=%YS$b%-a7jl z?B}+&!Sv?IT>h8dW-j%q2g{i&`*`2J0efHk+=@H&ExLSvxX25`ihJq_zCqfe z2AhK!TC73s#){A37U+H^>J#tuMqqQJ*zBOzpJhuFeH`oCFcn)XaJ&rz(7hwpYHN6H z>MhaRfLqhY_v5zcax39%v4)M|v?;b&L)hEFyN+ok^Ll%%r#-e<&#w5ydNzUA7W?l2 zcK`D6IlU=ZJ|y1%&EQ;zf8%$4{U-5U+MIZlG;TV0w)-7Xm4t*nc-NBK&fsBpZZ3(aK zUe;@!_W&D5-um8(-e!Gk+ZvIxzQs}BJ;Bz+ZurJ}dZEW!eaH0i?#6g~@0T^z8|--R zjN>A*rSp?_PHH=>~nW)vCr+{wZ%UBfQ=#VK6jwExle67B699i z9BM<*1dcl$+~CAz=iDQ4 zbnD{|L5VpXqfg8^G-GoPedF_SPq1s!$Mf5Z-sbsf8-~bve&YCEwl~=MJQMThT%O@R ziFfZq5&dG!zL_!RJH`x8y!XcO`o)+L$>w|EJpNs^3|t1*=JzV+9SN56tydofHmPV^ZKHm0?szx#_?90Rr%^@+0>3zoM9w_oD2=Tn|IUE{m|I26b0uiYAqcYi#( z?|v0)7yI7pZ*%Q_7MlO!XChhO)65^bq5rm!ad-4udsfAgbFUh3RK>tsjwzh*{@X3T zJxbpetJjQ}R(|-bEAD&g%Zay7c_RIngT**aZO**m|L`)msBVuhcKX48B1tive9YOe H`(peLSAatwGSz)>=SI#a5dTUI>Vaw-y!Kpz%^m713Jk`1YNB0yuWsZ)Tovz8~K_&+O-1 z*4lfo%U*l!z4kf@1VIp43#Xjvn<(fLvGqenmibpC}~rwBPLfMd5KOeMOJDFEj4C{+)LpB{%HT7mJX~&sBgg zC`t3*`1P$RO~1G4b|ijhh*(4ajUF6PxI_Qx$5Xq@-Q8@fF6@tZ*t4?Kv6VAQ@XE9B zy$xpUKko)Dd;50yprKpK{M;6Iwmf^;(WE))6M*O+FU7gp!Y_1$(wEn(-4RrF&;9At#;e~=yS;q&s1d*G zgD%c>O@8AeTl4Ca$lp2&7r3SE|8`knc;dMQmR4uklUt4ZXV7%qDe(3UWh7|D)W~a3 z{=%4KFd`4Lg>AaYEy*296;^T!vF!z4CT=A}fA)`M@8oS>?7nZ|*P>mvsWP9a_%w0c za9Uy=e8$Ol%B9mkz5g&p00ZMj`9KgtyuqCW?lf>`fqM|#ayA4lN|=Mu01Vk55Hx2| zV(1uXuUhc$aLJ-2SP|&%N6`F5`6nn2uhdfjOiVTDl{x|>bb7Un*cEfQXQ@8q|y9jNf}RA!rF`b5x>sdKb_}Rru}}StxT5 zPFQp~tY-Q<(A+0e-p|0fvq|D|M{zqR%r%O}oyQ2v&?f0!(YOTdVaPp9Y)fM6oqgLS zq7;R0Ky_yaB{Ts^;R4=(Cr@W3hD;Tb8d#bk0wkmGRU~7C0Aam=+fD#Z5IG6h7SI5d zAQz=nj3(1GbQp$8Q3#TPx-cIt9bH{aaq+EJgU4-kt=@G)vQFoyZcpY|OiUw2f_vhT z+eY>P=JdphG|L@NNZ2Dnr(aN~J1Di@NPQ+@-xfMOLY<1F?7<=SfY2!$LN-~cQY$r( zmXsucr5puUR-(w7==>pByNeHV>YY;d^`SQvF7cb)@Qbbvu+= zNh4>E6)~d9a2>Q4I@G}I%Odlf}cWWkE|ahTp%D0DMU3eI+g?>jPif zj#|&Yyc0GyrNlh60=*{Gpyy1@0{t7vMHy#i(CPBB5gl?!CZ) zA{;}YxDQ!0`${4zG&4OpcGn{iW??KkzT6@1uo~vP?8hwZfM__;i71+xnb0c?Cr3ae zA*dz_?tQ@nf>8hw#i;LO;r8W6V5lQ7v@Za{CRg#@os;!CdO%_aC2of!2jeKNJ3}*e z9H#7$QViU=hd5M5J+r$OXB>59dyv&+Z~h<#HbGXt-4iF z7&>pGqio(a4#h=nu15LaA?auUjoKo@m<-uQ7q#yV45f#PxG!+G)V}`yz5Umg-f%n6 zUz4^!HEnXmioUdKlv-8;y{$Hf!(4052+^f8<1a@zg*P;|woYw5{&~yvsMg4)X20lG ztoa1?Wm7ZjY-4-}#+iS4<^e<7-MdF@=g(X}W3_$X-mPuB-zErY4|8u9M$CVb%|%PA z(TGDvW>9u+?%aoi@63IWb^lz>&S^bmZ#JCoIhvfSlxOoe=2J|W5od{76i^VW3Z>O! zqNpe&%SByRgYv&ed>_Y>nFr`%34=$8V+ts;MiFL_ntO{y?#Y}<5-Vk*ATrW_^RuhZ z9H#slu%y6mUqXu_sn;4Vprv^vbN0SrcpR{=pz>~uDXGsIZZvxP{F>mFu~Lh@#H05=hild|VNCg9=x zJoSn_+gyTcl#aZ48)JaF8I7i-hgLHglb@aAMN@0*lTm%oTdwTttaQG?i1$c zx*TAvDih*MFJ9nk#GSHC1pDZ#UpOB=cd@v&tRkgiprVP86y7KGs~@T$afe_pV&=l? zzm7f?*4o^9qLtpJKzKTvYiue+E^#4zVA&$>hrkU|uJcz`-2k32kOandi19-Zt}s*W ziu^eL*lW7^fv;r)`3*q+y5b8HjmC5`VY4+AOA4m!og|19MSUw(?KZZ#IZCaKO2Q<* zb8G4xH}Zmm+f>^&25%&$G8+tk%|M+4CfC}P_wVW|-hJ4vdu><6x!TiByMg)wpnl8H zO%gY%-R@Ir+okip_xro=-fif$b>Hp%zRwasE8%5h-I8M z&d!x>SiLTHZDM*(PP&WwHcP;zPcJ$RA?(-e)~Ic4di{7~Q&><$YjgC8NI^5b4W061n8t_wLlkfdI$@gZ^~n#*%6{(Z$v&pb1=g_u z>r5@Vzz4GvXdmF5;ycd87mM9bcYRTO5ezLF4DJ5VVKVm$9Q?;M6;>D7+Jc>;w~2r% zt36{2Ak_?m-JJs#cRUkJBHVR}ZBjtTk_6zK4}h&tntx?WF^P(>H7~=lreDV9bII>zQEuGz~HwA_E0e{&92Y~4AAE3&{Z;*$%{D3`d-K$ zM4f(vToX*L3l$UJ7EM|YyA_z++7$frBG2pao49&kfIa24tHdz0k9Q0%X%kd{`;OZVZWRr=EXNm)v#^=$#4G&WuPqP2c^ zMeD`+bY;-$Ez=4z^Ea;Bkh_R~!`-P4369RmNP zZv8;3rQ+P_t6gOk=jPK-%muWY3gwxi+}sVD(l-GX8y8XD9VwXs>N9gU@D8Wp{PqF<8drFhHZDqS)`@Xy;TGz~syyah z$mwSe`zg*2XNo7cnLN+e^4DMv_HHU(4|$d)ZkCQbt7nUDlbpJZMlDP#k;|!D<>Z1b zC33XHy~mk7s3%TpxtP=KA@-1j9nNX@{N9`2=k3{+K6wpR8uPU(rZ+D71bODys+nqX zOwW*Oft0!}iyE0#k`JDEiCkYImr@G?sRbhrfbC|yWEHI>k6V&oRZ>``2zfZferRR? zVq_0uyp)Zs% zSI9AqW@fuLwMb6h8dy?*m$+YyV~tK;%d!_7L{iQki+4OjhMNv`qhW6~%j)$5qU_Ju*Avpy=h zc{_{~r9x^9ZeQ*)K9ntY0JO+ft>j}asx2hYo zfu7PKAlKoYmo?HUQ+&X|oF%d=_M?_2*l*bq4H zy_$nHfco(q>>gbJ>Dw;`eMT}@0267t%Dg((>H;&T$XA3!R z<&GsBOT}-Mc1_RaO$0nGd{}&bmif+tzPP0AvV7? zg5nft>O_(d!jCCO59g942n1)vtUvjJzKzy(Pw+`vX;)${&l!*w-{;W0A2p0-QwMJ} zWcUYwX^#iuTuJe$x-D91;Bs!EmL!|-zn3>g(LEEmc)A+yf^FEk9f9e?U$I?Rt*zxA z^7Vt0SML4zUTH(H5(R>Z(&$4|Ho75~TvOU?AK`vYyB{A9wnUdjz~}s$KnCf;xPEq_ zu)NPQa&4mRKteUX<~nd{AJ>yl&pYF7u11uE{eP8*QS5n`lnvcwQ^7TP7=(@Sg4yQa zFLNlVTV!5aFt9C7#C9A6{RX*@&}D zUnrnJCOGDs5vjQ``-TR;fid4oteYBgE+=cfl0)s&c+b(W+DS+PH#_izlcgOmcE7Ql z>v`}?!Iu#yBTt1z&d`URz@iftt;>;TXQFY_ zhdr{nSA?uy1A|wyvSyygvi-c9d(j4PjK}~-2yj{y_@mX}IMP?#bgiOmK3zwgIW}gc zug=V$zhQM|_9A6H6P#sMTK~3W$~Ts?fr11G1U-$JD|+XA^rJH8!QTUqOR)sQqu0FNlTqIJ?Ar&C_8tHM zu`$bzXt&!DG*IVkKpBT_+8NRid*#S0tBeh6R^+gcCKz~AcbsRj| z=Fjj&96)X3Nik2ylj92PG}Rg=SIJuQIGMgf}i8_)}#6Xd^AmlicIzh*c0!B2&Px!KzDjoVqo7W4I*9%ch&jgh0 zsePCKF#Tj=isJZ~=weFLQ$^IM=td_Xy3uc3v|lLO0I}=n3LtvqrRdEQ?qUq@&}t5i z5Dl?MMX%-HrVv###TQ|N0byP7(MOfM6QYBk@l@C-a!8f!gxJ!Y`_6>QF0RXd6j`Z9ID`3W#VY#+IAx(pzTYahF)=%ONxFKH8cW*Ksip6sa^VJ4yvu%gSX!CtmW9^b|`N8Yru zA92z`EuF5S*yEH7LI+{gif{?cVSlINh5&1e65K+(DerSaMm@ao;_Ug9NgNIngw`!THqiy zNfrt&;Gb^ja?_jl9fZq_6NabyOlede>~+MOp#a+=?MkVGtkw<6gy&n-8HtxNg@u3fp3Q@grlY(1Xd0Fl za>p6uul3DDrvua+qLYC+zSK^e+@g28)zM90)Po3^_Ozu~MlUhy-Gzg*7vLT4^^`0e z$-+Cp@Ovh#HnY^Z#Goo)4yt4o{`af~c%H5!i?{+PrVx>!7e*`bkGsE6ieiiESU?FO z7k5^XArUro-W<{4GZXkpdb^dF^sk=^%bKBG7u6_tK1a<^d*;%*$;>tGg4ejY4XR5* zm7~5fri#T$j)2wboP2WV_mx)m?$1*f_5@opQBJEaqhLjjBuk=77HVQ5;tse(# zN~=mT6zD-`GNF2(BtDkwNPEtVO!g)LFIeF=x?A^k1~aZ$(?n@s8J#hdng%ukQ_4ttBzl>A9U znxc?2o2<>pi#O>xH_X_nhhsI&p->FB$=vVhkg%v_z;uwxw=vF*q2|$N}KO@k&58~GoC^oH$K%G?%U`j1p55IZ7Eu`CL zs&dplPj2^Lu*EOUq@VW1Fz7X)wI*seRC+Vp(T38c(v#l37HMTVvkwhqq}CVtvLo#Fxe2rWW3?FvUSf^_xUuT83b#N?K`Pf|=bu z>=(vufL?U%u}BRhXzBtVU`b*9%+hgMm;Lg`F53xON9ee4iB$%FX6a-u-hE+oVpaq% znx>F`GNHGVln@($4L2#qTh#E`#(AIIKbs{+$M(O}@CTQI9+9SO7@qbBTw!2OtD}pt zYHTcea*#0J>7VCM2QgCGGNE^TpRY-ATQj=l3l1zB2U`xLyLBMqSb^(slSw}w17^-_AG; zK)ZB@nDuet<}pubIxcuUe5}DgCR_Hh;kd6LE^IV9y8Wy>ryo~6W_7rq+4)Kj?FTt! zc6eJPUvyPB#7bNth$}KXe|L`agS@>synQn=VJ({X@{!)bA%$x=RiSDtV$6jG5#v!0 zo9rs;^(peaXTni1Ez$->Nd3QmD_CDaUc3T0Rxn5^N?`KAvXEALT~4prm*@VSyV{zw z1q4pk8v1pJoB_`9WN;M1& literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe288_null_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe288_null_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..c2c98c19dc4be5541d870eac0dc4c879231d54af GIT binary patch literal 486 zcmZQzU|?YGU<}-ML)7esBj1D%@+<$B#qTaHI<}jSt z*Hfs^cq=A3WL0B;cgOy|uZ>c>5@XJ^+(>o4H6gq9z0Zp26IvbFF8^!>nhOLTzV_dv z)HnV+)YIjDeSt|D=Pyoelgh3Mt5<5Cnj|UyB>wzNlXqugJGplXKr|qcmG$|D4G1e^ zh>Uw|{AR(a4xaT-oKH{6iCp91nJ5Ib`sF2O@h8UTj~Q}CKiYPB@%%sjt~DNx4sn*N zE-imFsXyL*_Ue+={uP>`3>1r=02#};E4Flc&VN_MEf)LMCilhvfCS?88w?k{M11U* zKiQNLX#VS1rN4N@%xjUA#_nhRPwW&-{`_deOe+qkzZn@~G|g{*#uAv!AQjjh%21ha R`cngok&Ja&owvAw`T!pO#uNYm literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe288_vulkan_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe288_vulkan_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..70bbd8fbb0f4e82f23b0932016cfa56c71c6e7ab GIT binary patch literal 15030 zcmbuG33!#&wT2HMlORqE0t&$yL`0bs6~bgtK_Uq%h~P0CFd7m}f`WAbN3af5twR-u z+NyxF)~VL9Dk|1GE7sN`wzYL?t@Cu>_doxNzmey;_j&HVS>50I*4k_Bz4mZU!Znx6 zb>H-<7eK#`lSmG9n#{~ktgrbW$5UBOFzE0SMS58U71_` z;JL@`)?)4Ss>+p%%MV=g(D|P%?s0#9`kFIdD~wsY?AVh(oN(i%%g!9t=EW~gCoXOL z#F3v(+v)aiA3gV+vRAJeJiGmu?ROcx@SJ6mD2Uzq{q8&Uky!d)GX@q~opY$2@ak&D5L5@1Ng-)bGA9rrY{K&pokw`@`4W z{mgY&e?4j3N#jSA&e&_^3pcF0@Pe6TSFCDWHEBWLDY^eQyV|fVuWwU!&ZX~`?s~)V zOFpPy`@|Q;BEI@s?)d{cPZ)W_`a5PFJnYLS7EbDR*yXQGT{x)h*-5MK+q~-Ib+=tU zyxlu1N-AcLIpEyf^uEJh|9At%Y{iOtJhr;iBX4eXcI`)%rI&2AaNsG&-&1y?sc-&f z>aoY2Fs1vYlOGs$!TP>cdyZ|@a=W&`}xi(2(Hlbp|fQH6d z0|pNns7I$9NobDRG}kuQn%s%TCg&Gc*5|7V*xQpimuqI{ zt2$qchcVg`_Yv3h*>eYEG!KbjrH@Z8eK=b zWE?}A=Ps+So|WX>7~9yfW&0meS2KTZVQitHs;qnpoGaC4tE;b`Q(Y_9CgH40eO+U| zvAPbnm`7jh7b~Cq1AE(KoVA`?cYI-Pp|-J-8ln=hXmbyeu@&?3Rn@g~ind}tYo6G~ z)XlGLY-k$eJ|+A?^XF3RhT@owlU&w2Y~L5Uvap~~llrw!{H%HSjjgt_RfX`1xmo+f zXZ*s3#zK9eq1rjLOUAqI#5OU%fH_2nra5*9`$2W}bMrN$tMlK_zhl@AsV}M&H^Ie=vm#}|7?{FbT(Wh(pOfJ;aRV7Dv zTy6fSngW%I`F0DRF*V%e>e~{ZZ{SWAZ)@VyI_JJm zuAJO-`CBv6{hnO;eQ|ti+~4F()fcMbuC?a1%D!J^=-w;yZjGpWm(;gOb??cxh)uhC zpF}I_-j%FfUAy;OfA2`vuCCpAXg62ZuCCpAY4`k@)AKbx^R8@%ZVS$Qa#=rf$dw@B zXIwcS_~2Z#+~5r7yCGMa;hcxugbe3;<;pXhYm}?ZaJ~a_hh;eLq1^Ng=lbQ2%y90x zoEJ0Z?4HXVo#EVbxta`T{p99lIBO)wHE4?Gos?UU;k<)#CuKPAo7|!d*E!|R&2Zi; z{g!1o?~&Za8P0nncUgw>j>uh;a@Ni!XDj1$$hp5=!LFwS*@g2Wb}h_sWH)rzAm<*3 z-8HdUi%HX;F-;tuONInl<~H$9nbCj;L$j1)+@&y+6v#c}oX|zH4I6 zmB#o1=!yMc>witz`cdknR#R*3$2di{+V_M^b=Pv})(KL=WnyOe%birupUGL-C|598Q8FQ22$rnjb^kvWL_ z61t!3S-rZMeoQm{*k*c7GktC|y|$TNm+Jd6AMe3D#C=q^M#mxU<7cq-^tP|Sem*rI zuE%~9v-S)(BAz4bVlC~BW!>f@+QavFaMst)%l#WC~i?X{V7P~@?4pxl>Ssi+rjBP7o{9s z6Sp|!j2H7c4ZH}^=2&ZeIug0V?~K%^CwA17Nj+NKPdYz5P$CxExW5k%H zV8_VEm~+7Lk^84$<2c9D()FDS)=yi^`#iAoc6|~5e6V~r{srjr5q}xj*z$|g_&)=i zLtFS=2zDODnibE(Mdvh|#b3~S7u4mQyXWT@ND1OOvJP@rr24k>u1D_5l;55{#x4gtUYlpm_v$Jn z&fF-lXU=nSb!uCg&i|T}>qYPUucfy+|7+-fiO4x$@!5>?j9iCUi^a$}Dfg?CUqnBd zd6d%s8j+uc*uwXEaEuS%8{p&}(*lWHH-hy&4GG^BV0p*1L|k8M`jtpqWCUyR{n9V) z;VN*{WF|Q7;Z0y|z75vyW+eQM1aE^x{cZtkUzOJHR?I9NaVY;Nc93Hxomo2zq)>qpzh@5K{S250Wx*X|(*qobZL?3fBHFFHd;d6j<^PcC+T$EQm*K6Ycj=Ev+@)G@@h%nb$n)qO5aS++_HPUgC2LJ8hjIC-Cm-%#T|JWY(4C?zoL<5U5)uFBBzfy?#OFk*BpEJ zI@mn&aZc8P<>QXL0hV(;=K2%8&0N~vME;DJOB`|j0ya+MdJF9Ovbp|>E+6N19oTX5 zaYx<;%R6uP+Wh7+XXIKB&gOaty?L&`!O2Iizk?koA94Nx)+g@ByI}p~v$>r^+>w8R zoug~l-+9HF{{{AZWY_#2x_sP`_rY?;vA!SB+pMp)4-q-nEcT9g{+1)zJK`D9M_=a} z`){uvcKf&^AAtuW#`TWq8+YX2VC~l3y$}9BVDCimad$q3)8@E1-~R>6JKh?5cRoSl z?$m)-Ao2O~DL8v~wnKNEcjq%id&K@c<+h>s^W|vzxI1&ead*A|+v4tg3ARr5*83}s zH0y25uMs(Y#Bq1N0rx;+Z@&ebM?TKacVPLrJAPQp#ocLvZZns*mPjkaT;hnc5!g79 zt2Mgo%jRkWCm-jzE!c7Lad-SZR^Gkx44B_s=8RnJ!P#6Jqc_jh0Zu-0bp$(3KH_Ww z)+g>xC$N6<+1$<{?#`xQ=jht?cV4mP&A^_I?3y=+laITz1z65F?&X&BHtVacGa~1j z#oisy-*O~-cRVBd=<8f#|LxVoZXb823%=eR<9c`WjXTm6PP=u_-kol6-ihGj?ra6G z&2e$QyMq%Rf7jLn-R9b~^+e>Hx7c~sV^^0~zc$tF<9Dg8v3XBgB7S%7O1}-Oz2W5J`)A1peEPu2mlL};soe3mya{j7c6JZtz$p1%{pq^1(CCE;%pt|W6u4- zCo?YUxGTDxEowFZUA`w=9r2yxZs_tcZXnok{4|Z*9YsDnZVz;M>$nrXgTTg;Uz~D- z!SZ`yKQrZqpvzB#J3r-yqRa0JcY4YVLzf>87xml|UEUVlUMVNtk^OK@!%@_E#d3}@ zru^RE%~N~$?vwE~R`~7<)?a%$afdQ)1lV}`X}_1aJHU@j_0C}TuoT_q9%>tf$hn7N z|MprEN^gxd#2BE@Q#gMEiqj{&8UEWq$9tYuyiB-t``Wgl`#~^UwN@ zN0$%Z*wg*tjH5mF?*OoK&^C!%U|kLby9RBZb?5B;^{mFa?R}f{pOE@{ejRH~T(`D~ zV1AOnMd}y(bWqB-$95^R>qzZ*;gA4e}AK8J&i@8^*|)4}@5>*M^6 z0L$N+&S?f%Zf9(svzcI<=S1}TYQ(9gYI1HTnP6K-;vOaq=Rv*8+O$MJ1?nv*M_q(~e-&1ZaL#F;%8 zoISJWq1()m%(e}=Lb2B;T&9(vFx*Ra&Fey^ZGNeb9ar#Gq0a1 zjN0q3;dgn)uPWpB3wUku9rp^bV|^=vyAoZ$ct4hdZE-%XLbrDI@weuy!Nzi| zXXYAuoBOBjT13uq;`j{uCD_{a!#93sx-P@T_xWGJg|GJT{WaJcIX--^PkrUIyT6g! zK7N0=0qpM$uEW^QOPh7S5p3LKjm>N;(4Dh3=jFKguDKGdJ@i#zW5wHX6Ih?a$Pu6W zH>2~D{JXIB@Vy1RCA{|FZUy@t(inaR^_<=YmiN2Ol9anW)y*Gc?*QwoExrTZ33i;e z@Vg5vuY})k!1`(H$af<1-VNr5e>ddsqX6%QKC!NQQoFxj=o|dKDc=d+HAde1z}g%a zzW0OqN$yzI_qUMR^o{SX4}guK&AEFHe@Acg9J=2RB66NXv3Y!V9|H4}d?z!GXJ$FQ ze)`8}@xx&6u41$Ey+4)s#(4xnpLqKo1?%hE7u;j$`q_f}eacA(_jt+~znpXFyYU2^ zo z3CvHjx7xFN>mJAV=$FBs1J8wH+;`u3KTlr)dtQ&A_w!U;e`8h9drs`*Z!c58m59Id z>QkQj97_KdXT{F~r4otHfLF1_XGKr=_zZXrUR%5=uY={HHfzCheHk;C*nS?ofi7?E zKhZlsd)MkYdK2v5U!2dMk-wxi$G!#j?br6#jIAr&I&|MvZEvTx+o_SiBd$l+?%e!+ z;+@ovDY<{z|AxprA92+8?_lfec-QS2`3G1&&fB}-iHN*s#y9AnV1AO{7kq#8iJ1RN z{C*hoJve!N{QQ0&?B{pnHRcC!^6|UxhhRD5`=)#Zw)v)L`!^!zn#A$@&VRtx(%%E( z-)=ufmv?`R^m1Iycj`#j~OgZm=o zvhU27aE{ksyKxs&GtbUfV9$>}+4;m7(#JEUk8{@Fxq9|IU!Eyzpw0Sdi+kglaxdcE z#M!k5j`y5>4fbVl>cMi>%0Aw=Z^7OdKeyrzeTOdJA1>;`uw)Is z-Qm{)&NoO~oWYi0h9+lFyRqVPxD~peiTcDly%E^jC^kE&roC*9qK{*J8>V1u1CF<0 z0J?X?v)UG3n|f>XcHp-3@%^|xy4-R&Tg+i&IBkk8<`DJ{@Xlj;(cEN@`Eae}8drV$NG& z)82f}?z`{Fme^dkezC`$!Sc4?x}=20o4+fIm_>lDYEw=>xJ48qs9$@%p~cW&C^?DPYBcC$5{nIuak#qmV@x5$s zu=(5*>t`3=zx#A$9b^M?P!%iO}cAz$qL RqyI#b!*I$mOV|2h{0~&j-ZKCI literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe432_dx12_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe432_dx12_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..7ed95335cac633ec61abb778c0f182a3e303437c GIT binary patch literal 9310 zcmeHtYgkiPm+(1BIJuC7a8UvYa=6M(JOmm*lqLZY6$>aTDy@Ntq5^{YqA0IDxe$U4 z8c`9!)*x!JwHDB#*lH8P3jtB_(iX3c8ZWg}BU-B+-*)y1;Mi%unR&kXeth#hv!8QW zYwx`-d+oLN+Uq0`1VLmCoPK&>jBr5A*4exd{a&*8r1^67{I}rG-~PK`j8GC%`Lto2 z_o9V+AoFQ$@kID)mMr5FdD=|P*IRy;d!EeB>QfEmCS296{QKjSrd_&nF>>jp67U5j zdDh#%EF9nRTZeY@wD0s$OXpndc+*|G8Ze4tSchsZ4cPky+Il}~RJWJnS zWy1dRZqS1F?nDmido|3@tqEtU^A{XWo}TRjME`Ix!QC2pzAJ*h=yuzg#=WmnrX0M=R*JOS~I~G<{h~!tm&Qc4La(bQohem4MJ znBkW4_Q%%NCF#+>c9o{OXYT%XL22Z)v#I8GXW7%+&ATVjiXB|WM;|IV1Z4$BUwQf$ z#w3Fgd78{@;|*>_p)EsH!!5-&l^mb8fe`)KKNqYlUN_fc*X*yvTdlz|->Ae)Ny3ck z+6$BJ#GOek;E#1ZI!J?oaie@82m$XHa3_O16Wn>=9t3wj8-nH}O~+^ehU^arnm%V* z#0Y4wO8s|u+MIb<8R+g$(ELUD9TbN*>L~ywrkeCd9RU(Ly;(+aLTBP0#R)p%Cisk& zIT_-N^(+X=fgGUsfSnREr>Bqr5g|tk>Lm$=n?6hknhV+-6{wxw6|_<1e%r)m%5;Py zh^>ZI%m4?P$2iIdIXHJJNmA`7>EsC9Vrbl%3_*@2S?7i(Bxw#n9s-FqnXPm7>r4}; z%eA+ZcQ;cal8|&R;0<{4v=(B>R1v9(rM3|u8HK+=a$XQ1tP^rO3BU;=Cj;988lV#7 zs*p<16q=e2!%!s(bOv<-Ukx2yQciL8+phwTJE{hqn@fsT>!|8X;h2p~14e@T5|KLw z_ASimsRd~*ay*vCej#%D8FjjgQuiCE&(qj|F0wHB(>LJguN zClA0ULW?n6sijXH<0~GV3?h z6qU6?6d6WgwC>BQDB*V(^Qi^7a`sO#z)K3fyL-7<9`>ByZeM-`hB^X6`vE{Ou9olNoTAgx1E+OS5;i+>Fpm7HGc;+& z0m^16MbDkFk3(hbXZAMWjKgk>&mc0R0V6Y_^l4;Oy|4YnPWs z%v|Frn|XypaaEb>Q2uvFHX2Bywuvz&L$=0M<#!E3=@DY?uef{0!1e1pu3wpd&3(`H z`pn%Knd5e54P;)SG_acJ9SsE><}y=Gm^Pc4cqz&$vZ=YfJ-Geo=WP>X+M`=q{bSp) z)??W5mR8o8=EN?HGwagiJ^GG&_YPXmoxXb7V!heftLb>qAq?vjcyx-QW+Sik|{IbEODD03Srfvv_?!E z6NBWrsv7H2{!PU1Nj#akhb|E@c$5UDkRodqV`izTzg+B*!l`-NLK!2Bjt*G&{F~t(KF{fEcBAf4)7c}3KkKX765@0uUr~e`DYs}!R+50~?S+fI zbn@*RT|?^?j=Y&`;()q2&Bo+M784mOI$`KJRk@RO>YMfpXJ>J?MAV}EC7|({g!qZya;xiy}g)89$3+8Y?0&b9gmH%$-HQ))ilEK*aF}@GM;rt?NRU>aZc_c6dJ=!9wVSEM|us`{y?FaLiMGl0vK8>7}^8d0W$Y89QwyKC1{LpZ^KT~JH$Yh zC0_9*kaCjV?#_X8yPgZj67D+BIySItUJ`K5hrre+Ouw+DSelZsH801pzJ6xpOrB#S z*d;<&JG#n3{eZzsfWdFy+D^r|G`l{ts(Mbfw6I!smiGW{;(#{KY~PT%OkUJs)=d$6 z5Ow+$a!WG0&6baOPds)7>|SDY?~wD)iM_7EiNk(| zvm=?3aUDjla}E5Zn1j8WlGjI`VosQ%B~R&FuU%V2-AJRBCRY>{Q8yHkOV(Eup%or| z&g?-QaY`%1obK4zwlsDmr_<}E4}ZYNt0Q~dQmiuWD`i}NLhLc};i zF*oq74g5a)^LjSF*N5LJ_v+0?zSSkfniFDc?avdYm>mf*8gkqY(?lTjl_KskIj-5n z?DV0Q6_GatRg~Zr9v2eWFD!@^W#6|T&pGTNaMsj0Jx+6ahAHJ{*!#MO5Y&yfChtwXdw(Y-yty#!mI9?p zh%8LcH@Md_Y0Q&@N4T*!+Q=q~PA#iK|KeP%ZSV;HzVsEO@l|OK!=83{IZk`}!L>F` z!HKf_Ps;HShHr?MG>A^-U|*joP!6citQ)tO*0c}ZcM(=sV-Wmw+chD5xxKRn3iPGa zW&89Q?QD&^3jxVYj`G&fhuss$O6xRg?o~fuT+Hu8wETxp0AcwGf^hupx+YDKm(&L2 zI;?zMBOO297aYo2V!L8LXlPOn)w{i5<9b4ey({c`4rgUVzGVOj6_J10z^ZyP|7rsD zqxsi;(Dpwe|H=kF{2%6D{YIv!gAFNZMjesYbYLK_(W5euNcG|Aq-?Ht=(NJ@2RTO;IzXfEEu8gZ^W{au^%rCBt zvF=H#!yv-W zs-$LDMD$uLX7wSXuREGaF!=02QyZ9Vw4zH<}2__p6skNxnMW%#tyVeqQ0LqKQJ1c6omn3o$glqKzYlRojtSY+DS{+hp)-Y zUXr_d)~Y4B`EwNenI0c~kagwyq7ScUUb(&l`ZQ5}U$Tojf2{T1^N|!NI^e-Wz+*@I zg`T_OQ})vnz0*Dq|9dX^e|IjK34Ge&&(WUoUyJti|7x^{?a`j~Mqm&7V_;YRWnh>6 zbzrCdF|en+8Q4Srqrk5GQ(!0mDX>?G{utO7{UNYtqY(5f_z>nwDdZ5}Z$g0mtZriZ z4yw9XDVC&vJi+^Y8D-^X-#(1C z_W%fpjd^xNv&oL2L0V@$%Gh_q&X9)KD_>01I)li2`+NJRYCnVyDWoFgeZ3L(w#mJ; zTz`nBfIaYzvD8f#>N+e(2ca}%35T(VKWH3hF>1sl9OdfdL2K6HpG^0vHN!p{J&7dEw$>7FO zoZXHxWMW^^OonrYv&dm;hR9Hq(5y8UDLIaLX_Drn%mNN2_XcT4xubMe_;myK-4kMG zlADh~V}yZ9>u*7f8{XPL3ZSw%O0hF2CVs1KXXAyD=6h+3oFYae9mcM6a5A?~;Fgef zaoQM_ylPm(IdcH#m-@bO}&oA%q-dQeCv%7+^$WqRa7qs?_$+4)0e+?^oiu zJ{OeirTIJmQTB;x>GGo^qRS~U&)^Z!%}zjcv;U}Q{|L6;21Lt&=oha=uXDMFF?=HG zI5a}EZAA1k4sHxnwo?2MHW(1rlNftg!8<07J0=MQ*PtoPDCn1)HT!%kH=}ncao0I} zD8NQo0cT`DRM*D_MhM_aX{0Npa#Zn9Y3OyLct+$w9Ewsi-r6vBP)q|p1+FAl#VwLb z%~RAt$^~j+p5l}8-OY|r=%Ob2mk`G5gX07Dkjqk%sV{5w?4bxb-y)O58kTh$AQ6Yz z*7|^M?DNr_*T@M!$Y1uvRY@0@sr^W6(bEf%`}7nq^$X@S^dVMui8a{IHWnpzuuai7 zEbPae%m{P0n>hX`<-Ev26q6O126NcoX}Mv*+TtYlFdxbXoUmaJZ@w^f7G*342-j_8 zZ7o|$*UK55^FQ+ZA!OWpk`$TAU5Hg-%|`YQ$74+-0KE2^MxF;&G%iU~=SGDW3-^O?$n4`-uW2WV=R z2J*leJD42dz@Ia5@Z?_}U7*_{?*(!Y8ps%nL{UQnUjSsWEZZDDeizBXV03E_xMt#StCg3X85B;r@CYvn;-!kA-HLj1@~ z|3odNjIC9dXBkd(KI>maws*tE|JY3)S77MY!SQOQEds->G7o=mSH+9W@jcyUef3tbJo>)0%Cd`kx>aa= zTT4Y5lWvu%QExxwB{#~@t%u_gmTh;y10)1eHkKFYNm$GRU^+a27CQ)=FD;GJ_FVZFY= ziedLWu_+*Ry?>@r7yiW%=ygkDnWkA)o9RK3+>ds%*iRYvwSbR$vtR#qP5ZR&@>ekH@w zV2gx{=KP=Ea2QhXpb)FK~kQNd@LXMXbFOr8WC+5a*kf4ms-m^6OXQ21kT3BaD#NS9!B z*huu`AOgRMpRb+>Vx+XqrGIpvub=L|ba=}b?nxg7+x9GQ??NQ;Lbst7qi!??Ot}+o z8VLvSPhW#?lP4;tB$N$$+?Ji^>>Zi9-g}Ex(&0@d{3z_<%Z-R392(=+Z-aMzWVe;Z zhXVphWQ@`v*eD+z@5(uX2QGasdyFCnv{vr5Lms=Ztnb2Y*_N^1Jmlp7X6`1z@kte_J%Emc{H%{%h2W>vk%opX z1DC}ZKZ4R3eMXP01fiNs(5fftFI5eLHIo`f!Gn|bje>2H8jp_j?V7ZI6#RD50RY;i zJH)L>h%}9OLd#L%TahCT0de`V*9}Kqg$aV;=;;2F=B#d1^*C9izsdP>AMN`h%GAh? zXukLxt&KG;OPEk*a{lft=li10^2pA0h|4mx`1K>Zi$jW3b7~`07Q|2p4I+lao>tj6 zsQ0JH%RZOGU|OV2^058?{w-&H33>BM;CSI6sVs@f2g^cQ=Y1)=epj)_cOEKB!Fmul zSxf0xA#x5l$CJUmNPUrZS$YN!k$VDcq-6fpe@Te8zy5;^RJ!V|mqCB}D+~C;#-aHI<}jSt z*Hfs^cq=A3WL0B;cgOy|uZ>c>5@XJ^+(>o4H6gq9z0Zp26IvbFF8^!>nhOLTzV_dv z)HnV+)YIjDeSt|D=Pyoelgh3Mt5<5Cnj|UyB>wzNlXqugJGplXKr|qcmG$|D4G1e^ zh>Uw|{AR(a4xaT-oKH{6iCp91nJ5Ib`sF2O@h8UTj~Q}CKiYPB@%%sjt~DNx4sn*N zE-imFsXyL*_Ue+={uP>`3>1r=02#};E4Flc&VN_MEf)LMCilhvfCS?88w?k{M11U* zKiQNLX#VS1rN4N@%xjUA#_nhRPwW&-{`_deOe+qkzZn@~G|g{*#uAv!AQjjh%21ha R`cngok&Ja&owvAw`T!pO#uNYm literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe432_vulkan_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe432_vulkan_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..a545c832254f62e7e6d91e40b0b6790be9bee3a6 GIT binary patch literal 15030 zcmbuG2bh)BwT2HMO%O$?q7*xbh=8D|Ff<1gWPrhn;9)qx$S{L5gMzVu6^w?D_2S&K=iJd*O-!AFVxhX{!geDGtc| z@50k-p6L6(yXB6W`d)Y3lcy4*sQMZg9li!x9-+yUD$MyYRcxs=P$E>^e zxf`zidiSW$%~lb<>GU zKB|4|sSU*>zWzq;#Y5VS9eUIHyJk!nwDGBh<2xRC#cM|`>|gr)_%#o-t@w1^9aju) z@%8eZm(QMa!1LAIgdJ`F#F{pbz0>L3>QBl`F733i?`bFAS9-Ej-}=o_ zb51yEa_7q?J~Zs2^*t;08`-4s&dqbVMx?V%?vTdCthUWHPMB7?W=UT=r^$X_} z`t+O8r*dw7Rsp?fu0=AYEMHeQsdm=1xzpy=)=V!<%r7jj%~uq#w`AsAu7Q0_ZEb!= zWxg5@V>Bnqk9+{&!5Fwp+L``*FeZIPW`23kO3$=YB=A?6pW7s^-rvj4aeul$K3~bEn#DHMNzqDy!w1C7gMwt*Ot~ zSJuE5=h4^v#m*=Gz}`F=XRhbgoLHD!sID(3hp0p>+B}0~?4)`5ipuI)MO$$`bDr2n z)XcB0uiG@nb4vKb=FcVBb;U7TCUcqZuzjEC^1^~bRqEF=@iXV)H?q>qRusZ3)@JS# zpV15J>I=1nx=Pp3A{p<#6Wh4_0@e^AHm$K$*bl3zotv*3UYY-X{jI}xcxB)I-85pmRlc{SA}4&JOdZ=3MRY;ZQqn_W{i1JfqIt;26P2RXaGx=>eF{zJc3Nj#sc zWG~;x8&zFVGlSzO&Ci{iFUBmc&wG;i4$oK2nMsvrBF6f7u+rRARv%njQ(doL><3%q zaJ%rER8d<~RW*L*%(?={yvg1!>?W8Caj>aO>btm>_F?~i-QhxvqECnLnOLZ*sYpt9 zRCRuORe?;!dOL>Ch$?P!<;=<-`4!K+Q}`9vJEE$PuZ7~qw9I+lo4J$4+nV?^&3Wz< z%O`HS{7o6@c~30=J~_TMo^Mi9wS|hfYfX8rvhP6ull`G3|?oqBh!}$)#9hu?0hjLRgocotMF2i}| za$d|>vu7?hJHvVAa#b15{K?JBaOOykYp^MvcT#RahVu@}os!|aZ*q$=T)UJzKf`&i z^jntUyhn1EWH|4Q+~pb0J0f>o%9%TxoUN4Vkn?;yfZb1bWKZfv>|R*m(2nTtLC!M{ zyL)(h>t{+rcm1~Be4gm<+U2s+o(QhLJ7TRlR^9d6LU--fPUxM%S^w?PU3b{KfUPUz zdk4ECHtp)(LtE%w!NzlM-RSi(UTceUC`x}c35_$ z??tZdcSD?icY1T1-OnEAcQh)-)z%Yve(l{{7Ir6JhVKIk#v?&vb7CGPZq-w!!Xo zAlP}DAic?^`XEG~kchb-9BruiHb?s-a!PQ6!Pcn~@eTlIYtDF{?}5m7OdR?_=)N7H z4*@%_GnujWTqj46oC{sjJR`a8#2i|r5?}XLg6`S4w}?3`)px*dzFdb~*IbumZujq9 zQM9R-AjS!C9sd_`oH4TEoLyOwXYF2H_i%dm5$CV}2*i4Gog=}nLr(uu^xk`U?FZAl zp0JmKwac4_(e%bN4~`#0Pw0eKKP1)l*^ZSQO5X$TvGihn#?kwkU=Gv|OZ5_Z=NM0~ z&3$MuOL0l6Pe}C`KM~zEx-b1FrMmlwvnmI-XjHUM1{+)Z0r-2?-hEr>uFn>_pI0_@ zbL?l3G1SdrYs59En=?OqLf7tn3*DTVKbDjDn=@_duGe)Pj^uKS9tr)3L@yZ@`jO}- z59*rSS^bYfR+v4ULp(=yb94gYIer0KOKyj+c+|3&Gj(e#XZ5 zlfl|!{7=BfkUu5e+bLlA@vPm?&{Gljuh^{JVceoJ`qPk@%er!&68h5-Z4=UUE=oDN zP2A#?GhVFc4DcdEn`6!OnMlkXerKgVUFc)oXM^R>NynW7cC5TU=IdNUKE^Bo8zaUn z1v^GQ#+(P1kGX#eHjZmNBi-NmVEwekx-S5`Zub}QF9geH<6nd>AMuxgjV-?@jsG*S zb7%{{E=HHvKlXSDSpGI*?MnZ1M9y=*GvzJ?>tkKsm~xka_0?vbUruk^ zNG`Qqfyi0w;tllP1$BAXZv9+|bVsZs^B{Lss_#Vae&nuB`CaH^> zbHl*aoON<-YFm}A|GJdxO7Hrwr?*#-h$hltexs0<$Za~b%V&uG(`(?^6qMyh* zO6Y%u$j?A*;d>)E#)t1saPp36gv4AogY`WF3E!1qdB-$H++S1rRY-GW2z&AU(l74e zYH;La8aVFZEnscF4d(7vB>av8?}$YHZUbvyo#yX$u$(^5=^J`_is#T9+q~XEZ;SWu zPOv$(*M65qnt3lLIM;{4j+2jj{|H#VGh+QazjHZf%=IWZJJ)0A z4d;3sPCn*(0{kcnX%Fx_A9uSM2#|uyvH(^BQ#d zRcU^o0m~W3{60%>Gr!uNL*(4ExPo!k=?bJhVsmZQh(7wN$NAf5?fSX)UFp{%0}$ix zhUmMJyXU^1N3@%F&;Ci~mH&OJYmYj9A;X(X@6sQTxJ%XG;$14tlH?m5oz zO|bLGN1eO{mXAB~HdxO6IM*NPZO*0b9pq1lbBQC)pTWk7x!wi4zwBIpL6?uZT?clY zeB6=u!1Au!vvz*xa?Y4*JvckpU(p-R^*1>AnCtIg$H_;We}MIgJMunQKl$w3t|9Ko zKf$iiz3cC~V$c5qTOZjye}FC@cjQB`oN>(WNAx!HtLS4E!JMsy50AgJ4h`w=0{teb{-aY%^{{!|;1RrErIq0>|Ci0Jg>5*$6gI_U8L5 zjWqLZ%&!qSeZ+Bhz5#EK#Myoeb{_etpYOo(ad-T%mW#X72;Jsf+8QHG5a$v{oGrk{ ziMg7hyT9yQ&EVvto|}UmCm(mm-(%%HD{H{{oy$36u9o2JTw9_yoU0X_e9YAv>^S*| zvlUpMxI1mY`pIYKb`5cNwg$UK_pZO|ial=wwm!0ZZVM+LcV}C$oN+wM?dWahS6e$o z&OM90JJ#O{Bzt$P5qS4E!yVD+D?~ZZ3JNm{Q=>VtQyl3xDM>y|9@NsuK z!E19|)OTla!sGAWwnw+QH*H-IIoB32hy)6eE!wxQo0U0V}yHDle&9_aE>BR#=#=G;8?0^7`^wmlI!^Cr&bQ9jn( z8+aiXUFwJmp6~QEcwML zHvlZZKlZazZeMiyqv0-0xq;~Nd%>NVa)Z$22g5}^_d}Pr1-F07Nw?-a+|ytbbzZTY zV~i<(0Jv>x58nebzQzjQgTVT0FC*?i#ti`*Pe1MV6L(kmp{d>u>=~Az+dM;U!w@;o zQ0(6x%-L|TF%^E2=DM_vNICbQU*u&Z*qms8IGukK*mXI-cig=mj4tnf4@bhc6wdW$ zeMh6qhi{ze7&zl-kMlbO>>9L<=N6ckL&5Gro3-wmy}#CK?AzYAN&m5_zxC@_bK<_W zjRW(O{4G+yIH$u>z9qIJkho9d;k7we8NE5SkGUp*3-~+#L}XHG>i|~{_Wjc~IknxH z=JarM?Z*F{9UYO{aZk=w`;myebBf~~ItuJK-!H!#91T8!UOs$|0UO`XBYmcT^^@1f z^&JbAzdc>kRIuD0*sQZ@V4HQO?Kniv^@z<$tWQ4PuRORJ<6_&$b>ccOX9Vn8*7$A6?#irG6qUKzvjZaFsA3D?wIg718hxXeGXu(K7Mzb2tE_sn%xl z^)tmW=6Mo$Ie07j$g{fRd{gr97lY$XiQlFCK6MGaHvJ}`|2*T@1Ko4-eY_N2Tf9-1 zW&Eb6e!fwc!)pt_D>8l+8NVyxwZ(VbtH6%+tqAUFbp7J}SOK<0eO!ZX?(E}l&DVmB z@Nd~ZyB<+OXg zF}HpE{%{l6-y7VAv0axo^L{hfxXB(H*jA#uW^Jy^aq(Sq6~~0G_#M!;LiJbRdFhBgeA%7nQcsKNkechMZ{ry7U;O|fQHt_B-=6wLH z&2i!TAef)zj%9s+1F22l`0n};*cjSeyLI?mdYg6Vc|VNES%+fh@!fp{%un*2%sAG} z3VQwYkI&*q!QNfPX6Ji>9IiUqW|`wut*O*x1_Q zY+nKMlbo&g?Adz8@jd!guytTvIL34Lo%i$fHL&%1EWMwn>iQdN61{a|AAft93@%6f zomZc-)aMBLcc~RW3zTvsJ_BCI7M~Se;Nvsk4R~$wro0K3i`={gmg~uwxy1JK;B9ny z=l&zT>$7*S*3mm)|Ni27{)GHFwK?`(uy4P%zhrD3;MSr0u4;QPwcSaM{2g&Ux^~y* z?-PGb?U<7Lr~Pk;yz3E1e*X?Ozm9j`*2q7=@=qkin@fKW zh=05N6kXo)G1h~hV-$f^l{DlyH;z@`m(0Xfj0A_E$)pqjo=b7;?`4Ju=&zw3v~DD?=PNBta)2( z+8eIfbN4;j4x9VdFV46fSl$*~`;>Dn!F5PEUE|z4qUht_DjcIv*g9ow&Y^GQt}{4t z*O#%8yY1n%J;-{k^DbcH$Xnk#(A%tUZ95`z*0(t7yDQkb*azQOPdD^ftM8aT-rX2) z@BOl-x`Q3>opD^mHitdX&7XOU?`S)LjXgZI$3Az4kA3#T7W>=Qmy};IvwuZH14kEUFd_L|8w&u)>2a(9~6D8Eyw5+wtg9#bLbnf`h(+6 z2R9()vUBd6a&(*G4n&DL9ivaoIVfXu4t?YEaX+wY(#P}LpWf#AX&a2ld4A&fUUmT3 z`8*Tz=UkrQfhq6a2O;{!n1eE7%y*0#lJedg$LkkkhNd>(3+M6gswLnOur|L}IqxvA zoNvAQaIkUZt&`Y;y>+6`2(U4&9sS*3)Z$36wWv>=#VD}6Ex3bIE_*(uDW_|E_aBYo zc>T3ogYoWK(3mJD$w>9UMExzFTK2yv3 z-f?{4c(+*PkJW(F9(x24QW&i*H literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe576_dx12_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe576_dx12_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..4ed0fcb4f368749f630aa3a882c0ec624e2f7766 GIT binary patch literal 9314 zcmeHtX;@QNxA4ip$v_gqAOsTNFp5C+Fc?5AO#%Wc3MwjAd<_H?EMP!i6s0y3A=sc1 z1rclwf)=f{fR>6?n-B^CQNf|2q752{_N6wWwc6`#?>+&1?QQSy-246bzUTS&bN1P5 z4{O+Kuf5k^CxIXcBB*eS&J9iB4)GZpi|3Kwi&vjEUaeX_6ZiQ$?}tv|3IZ#hHh6fh ze0M)&Jf|+4fxDS5N46O9N~?3$p`BV z=zl#7TJg7gVWZkU7436#?D?v^6~_|iW;g)W-(QY(F^6614xy~P+kU?Bz^mjrrHOpr z-=dCQ{^V}e&eaL^pKkm#dGoZT(EqyCh>^vykKgCk^v(On=?&MePrtWv&bSh<4?%pTI#xY@frS3^E8onWL%mcHaV`i zepAWnpBK*IB@d=X{*D96jr4{f7%M?e1UU`l9FRvr7Be7dN&H-t3}DFmf}pue5<(_G zYg6*StEVhkhL(ciz8KD5q~AfZd83^OU~H-JZ?s_`Cexc~vX04&<;gmRhh>b;WLlES zPc5ZGP$pyptp<9EOPia72S^y7EYL29)!p%;LC`YLXDdUj_>Q2DB=yglcHg(j?_XEGC>e^R#+ZTZ~6ZhLAirZo7zbW2U zn9F%#!9;4?!SwQCPER3+l%FkS{1^$W6jGlK<@NAadr1gTKrmTsm8~)xVo3TLmFEw% zlxs>08n;*1mYUn`3pqWDR8I#Of}L*DKj`!jjCE87F3TMI@K!vqA)eRO*yx;(e8}4y z+=mKJni<4?dkJP=j!s3o@{PiBZcceg4gtXQ<0*{%0mc^ahU~VWq#`Y8147EzFbXGu z&05mt0r-0+saQ)Y6k=Uq05%dd3P~Haq+%W^U&sJmTfmqB_`z!;LI&vC0>%u$k0sV# zD^09L`;+I>Sc9(xd9%?Gn9W4eY1ZQL$V5frm25-g zO;n)RkLhIVPQn_Lv)!3i)59vXk{D!iyF;uo1&;Z89Id1qB1^DASW?c;hTb6P5f0&b zpczXNuS;$a4gnCBbebNz#Jc^k8e$6+?E`>Nk6MnaeUe5^@lWU`#%{M|qD<*cduZ17 zL&WVuqLwx9Ad^IGqV+XMsK=bBpFsp_14^KVYf}hRu2xK-Mrt(#>MU&wfjV0|K%mBG zEd*+c7PXu?6*PbRhVQ5sdW!BOFJ3q>d)eAX+8OX|?@@Sfot%Wt{t zAFfZ^mzw5Loj#OygV;cCrgS#sGihrLnZfD|THKXzyRhb#j*e*^Cq8eV5!n&Z+U6V8 zfwrAQzie%zpKpolMwtt)%-*lk-Z!*yl+MfwrF_NTITcu{17G)WS!NLc>5A-!+NpoMIwQ;YLLGZF+v~ zxy{sH{FfE`?u~DkCJvawxa2gqB<7xXv`_r^7S}vz*C!5{!gM+>?_c6w;`cts8iq~( z01ZS8&wonI)St&Yxcta-^msgJHAfpfdhO+S0BWAMTP=8lkBgp&n2pP6nE zP!l0kT(mwjd*R>n7iW}!HEN`BSrwk8A3$&^kGAmff@A$hj=wc`;dFKITmAXR)JJKb ztMh@fYW1)Wr7YP=C$Y=XW8|Z*ePMs-!eCiPW%Z)!k?K~AQ`nHux5-kCXIXHb*vf@A zoryXf+R@f=vV+noh1qJeQ%ovED0jqcV8s&F$G{90-Q=vQy#*{`BoWN*AoaUIiPS){ z3iADe<8P@K1iY08_%{Roxn-B8=yVwbOlNDVmlaRl!)UMHyMS83m&3 zIR&EiS-Ayk6EgDiGaME7=v)?MM(J4yX1rz9Mng;M%o8oGp@HEYZBZv9xNVe990@4J zB}NRC;ySLBy82zi_3V#U45hjLQ#C4}8gIsTk-#V@m}>IYB|WaJ{IRz`@3^`EXvYY& zGp+m*2dqwjb%Jxt?%S6Qmbsqo{i19TOf3pb?UCgWfprxZ^v69F+8EK%j-IA;@_{H> z?lHxXe3sT~&i+fgpL3ltb6sY3_U~R64~+8%pzBkHUl>9(MULs3ooQQNKR;|f+qMy$ z5jL z4-4PZpM1F$H-xhOb-<2||6mBEy|UPa*L7YVRvz{z7oz#Bs;nU%%Ue(KX>Bl-YanhF z;^aTorRJA8o4D7X`_&{Y$Bf7#Nv_?Wo_5FO_KoygF6(Ansb#wg^`!pjR z#_9`auk}_|UsymnIS=4&ED>k(3kue6%-9G>Y*<2k|3&#M(4Jkev8W_veQv?V4NLG< zj|70$^JNd?m-~aWtc8L(D9jfu0%aIk!s!~}tZ~AWyO3Rx+t1v0N-BZ4ncSHz%e&)`mOKb3{IaHr%USImjQpPiH$PGM%7y1rwoyMVk1?A=skuRfaxn)^i@K1 zi-FeVMJg2&wgi+HOUhjbV;L_@uo+=IG{MiAj4^QE)Y$!$V)qP{ON}_sVIIb)Gs7JN zuxm&m0zq3r>8B-0J;P@oNWTAY{lD1m{ra2i%vui^zxG?txmym^Jb8BdOt26Bvv;b_ z&OZG0eVsprOTbHYLK}&|M514Mxa8%_TfcSQUtbtCZEtz+_bpq~|4UTd3;rKbSGZkV za(|@ImArq&2fp7|zuSG~A7gE5^2y&4pO4l4Rzs-w9iowmc==4!X4~Sxkhec6zkM&1 z87YVB^?`|UUGltYUKN9K-4HjmB?S*jnxgV)4wZu1*yChs$)1eE1WAKKmG7l zyDI-w>BA>wl0d3=pt~@DLSUj_pURgHDbH{6SWRv|h#b6(Q&yo6?&+>uTuQEWunO|` zCe~$m_3N!<_4^6{%6z7LWbC7!8P38wm6CPS$6LbZbir!Q4^IGM**Xky>fO3#Re-zD z0{Ggz_qs(mb*eYGnA7=I!M<0Kg-nuXNB-8$m<$KjS>+s$%&?eC2ZAar2D5h%wR3``^WlkrelMmLx-g>&2PT-0cAwV_z|xR{Fw(fdzBFGq38IHT)+X^B`N9xVe)qmNvD$z!K43I#bHEi942Hy4;Uoyc#HwJF_}>FT*>Pg zN@zR*fgox;=`>UEc-}+>gh@oAZlVH0GAh~nF#>B)&USe-?g}0MOo8>V#`1WtzjvVK zC;yDBghof0_nIwg_97s!2O9A>@aY4Kxt!jNxe_4qG^uxhB9ny+s1R_pg+$3+JdqZM zY=$M5T_HCR8d?3J5S0JJ*oa81Ly$phY@|BLXIWz-V%AM-Y{YA(2;6dr{$!DO0aLS1 z-ZGnAQbO9h5Vd#GA3zA=`~kL@500Jth|7ecE&DAnd_~U zEcXLna=#2e6>&N=VwNW4BpMaJBsX82myN{Ehz$xtQU!cI8y{ASbm>oI1jxg9ayr4a z3Fnr_y2_&uXsPV_RrT}TR_tTn-h(uQYeXivLV(*M*AJ-!*O8&J)*IEm3n*&r&aojU zBP+XT!TPN1yd|dpZVt z@AJIb^8V=9SN_4VXCM&tEBF}ZNGxDt-*5tf{>)B%${v!} zp%g97X0h8hiv#ZOOmVj1q@edx_oTunlN!IU``JSsXx6x|f>6Q+MVFAhkbPY9k}ZJCgMZ9x+}kBhRB8c3#Sg zCfYk0s3N{Mem>Pc)t+ZFCzYoY$F`{TVmV@)lOkw2LCa?nvq$iIs%?dp(}#7nt4{Il z@lIYkl^zE~+I*Kubq`Sc69E`8> zLU1Q<<5)6u35%pBCRkU*MLy#PkF(a<0oEV}qih7P zP_ps$kbH%bn%o#|bCMO^u1#?{ ziufEwH<*6ELzaQwRe(*Z=JljVITD-PX54%YoC_XctomR+cL0afNRIShymL^2uof^CRE2v1xt~B=9FVjpeme#K$ABhBrr)?z?<4hcD9VFik%M@a>U0Ja|0UZbHE1D+3 zTNPK8nNs9{JpmJaXmMN&%a;6-7LnwQ2Ud{oGQL6htY+1gT4e>cQFCNWwLh&h2Oq-9 zXFh4YiQE;n^Sjn|32|VmZEm?c`DECu<)CJ#ji5Amvsonb@nlbbIbo;mK2N>)X)=zp zMOhl0W)^jNd$OHhvO;w|8eEK$W(h$hW|6C}r=#pe+SJ}2qqb@%*dF~~nME1m-W~-K z)81NMN~4%XO2pF#e#r{g^=NT1Fx|4x?-3jb$s5b^wRkjg1yCI%_bJaGmnt;6a2F;O zD+I;%^M!?ZzAakKPD)v6UVwSY?_!_DMGiVQ<>Gz2g+mgu8W*r@!2ZZ=ijYn?Iy4u} z;}MNe>fC3ls~;0vlo?CMd|6xspA9AXy&}Tk{H@mlYcT_B!JJD<19kss@5JfZ6zc!` z$W&l@Vw}*~s4AV#TXRYZIfm6{zvx41{UEuNinw(1l;^CaWTMnflu$Wn_jT!(9GWPr z&ryft0+-^`47#AB4k?g2&>R=I3{;`%$Fb_X(YWncl{dW&tJ=$Lz>*qEzgc*(Gq}%t znrz%WPwD0)Z}v^oYp1u5fl(tWQ-W%JjTfy8X+E-Cc*<+QD6Gk#4Iu%6sZHDbBr|E2 z%Rx9BUBI!_CL>mT<}e+rPG34+eX$s;w(zQUy6!H`YcPulZn_>gT(Xm%19=(-AaGuZ z&=j0Wz(O+r<5FtmvrIA;i#=>hi>EOlqF#4z@2U>Rt*#5m$`Pd(Prd?15xKBNO9Lyr zZOk{6)eODr-E96D3M;!)w@bNMJ=vb?CvPZ!`e{%lO(epV1Wa9kG3LCu~Xu(fikDp-yPbfIk8Yu#_ z4xR9xOgJoT#^*&dfR7ZmI}A*o^ZQr0tQkM@+xKTog4~aCUAkdG4A*I_Rj--!0WpLb zh6#7@j^k@k=rcq9c5LaW>s`?$=7EW&>xZ)x!tq1p_z8-uH!CC(GiVfHSK(X^SaqfH zVgg4J7Ae<-Zk0~XH%}D$$f4h1zn*7<)Jom=NTc2@?H{}=+TrZUhF=b$#vVK_CLTBp zFUh1-8#jdMbMP$4U@t&QPtbBSu=K5e@%CK#Vopr^vky!2c!U>264=s;qnpCO$w-(Y zk;2==e=48PSXvs~Y!(UpJlTQZ6u>T6`s`Ukk<<7MK>X3dA!Nekr#Jg>!OyD`9fvLs zUFD;k5Mo!vc`f`NaMdgfw`NwumCAAO@T`NAVEe4bNw9lX(}{_(-_ANT2|k#07=Tvp zQ=;FC4KqwwLYsj*Gi;(`W^}&jb;rptZfxkdcU=CX=7MHY^yus`UxWSCe)4x>;+(L~ z2oC?6+CooA=f;*A?5|&7ekblK3+vhhJFGitQcC{{@?;m|Vz{ID(s&vNYzyJR16MNY_ZIHE?y4~5Zvl>z zzJ_uWB4mR5F#+V2%FE=d!t;_qsT-(Gq_n^KKMB_N*ME|MO4iSO8StmSvw%NsY+F}x J6Z=QRzX89FVa5Oe literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe576_null_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe576_null_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..c2c98c19dc4be5541d870eac0dc4c879231d54af GIT binary patch literal 486 zcmZQzU|?YGU<}-ML)7esBj1D%@+<$B#qTaHI<}jSt z*Hfs^cq=A3WL0B;cgOy|uZ>c>5@XJ^+(>o4H6gq9z0Zp26IvbFF8^!>nhOLTzV_dv z)HnV+)YIjDeSt|D=Pyoelgh3Mt5<5Cnj|UyB>wzNlXqugJGplXKr|qcmG$|D4G1e^ zh>Uw|{AR(a4xaT-oKH{6iCp91nJ5Ib`sF2O@h8UTj~Q}CKiYPB@%%sjt~DNx4sn*N zE-imFsXyL*_Ue+={uP>`3>1r=02#};E4Flc&VN_MEf)LMCilhvfCS?88w?k{M11U* zKiQNLX#VS1rN4N@%xjUA#_nhRPwW&-{`_deOe+qkzZn@~G|g{*#uAv!AQjjh%21ha R`cngok&Ja&owvAw`T!pO#uNYm literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe576_vulkan_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe576_vulkan_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..9c65b7c6825a9fe37d94e6d08e93535d00ca01eb GIT binary patch literal 15030 zcmbuG2b|T#wZ|_YO%NL$1?+%`2ndP_OLI{{7Fet(UY853EW5b7C>RS^(O8HYOB72? zEMV8zVyscI#n@3}VvrOQTVgC&;`@H@or8Z@KA-nKpEqw$=68PQ%$b=pXXf5rp1E8u z*J5e2$q%jWG<5Z-4$D67b}-!k9Og%{}R(2{&H4?2J*ZUS4+^acScx zj{N+vo$mPWW9Obz{`xgTX0`pY?ao6MowID^O?{uauv?e4GhVoS$cN7zadx}=H!BUu z{O_Vu>K-5Xzq{oQJ@Vbb?_cxG()PEl9rNskHHY3je!u({O#R+VW4f#z{KAvFwLN^z zJ`NJ1zJBW>*=u`Sq>J&$;xyvR!UC zZs~{hZ$7!Ml*HFp=U&{uq&_#pGpP#hq{>`gCS#$g4 z!`qbgS-8mwbDJ&8P47GGjZZd^%ogmZ`{S!RJo27pCMFRo3UL3fS8+b1v7!zF&QP zer9#P77t^zCdvKIMD%*2Qt=dS2aeg?WYA#!7OCO2m@QGboOoIzL}kT|2vEE6r!l zi?%U!3u+r1){pU=iu{2K=8^1%(wL2lbD8h3eV6FU!oosL@@rf4Gw0zqw%W{A6~Zgl zX6}nV;}il=>Zy&aUstd;# zE#{-Nu1&%g5yvf@Usp@w;LVEjb_k!$2IsK6IdwHNF|GI8H2g+$kaHSq3k?mG-}h@* zjOTMz+{<_I#?@BU&Ez=B^YiBAOEF99^PUuaN9U{N&Z5dQ5o3KkSSdHvwfolB)i&xE z`@t4D+%o*8R@K+l)J&Q+tD(R#ueWy$y9wq(>}x8E^<7#^r?7vw?rzuLF*V%e>RHu4@GG5p*YGQ?cT7zoUk}BNX`A!BH*hCQx3%cg zGUvHZshqO@^0#E9=RKwJyX5%Rc)rD&sxMTE4rV z5u0}PZHih+_pW5^>e{{M`g=#Rc6IHpL%VZj?dsZHmv-yVIjyhpnRjJ7bX#!FCzthe z4!Pb)_!(Eu2R=CWEH@;>`EJOSWjNO%HzC8hU%845=N{!MGo0^$+#wmxdnh+O!?}OC zqcWUlF6YIJHGAfAb26M~E?1M`%%9x+3}=qyxCZOvc_-x-W;pMl+=&^^`zE(I!*xvD zxf#xTrQfm)=RK0UIKz2wCo#@SNc0Ya4%OH%atuONYbIyXob9KH8mUi-fEt|#o} zVD0keVLZJt&4c6jqi=@DtM8w5eYRvJ2heYW_XK*eJ`?HvOfU!P2PVCY-Z>`GYjYpk zD-teC`sAd?_$lbF(S7MZHR3nLn0O^fzbP)LpOZIta<-7C#*N!6kiE=!c-6Fsx_s z&gy?CvT{Yg5pj18OPqX+IUL-k_u}CLnBAJ3o@}1g5s0 z;I4@Nd3ybg8TO;Wo=@miU_S?%F?SjL%!EC&0y31@tq(W4+HuJV$kNbS&aIehyntZ~F@D=TigXe(XoF z3v0L$v5w4(xwJQyd0T*J58va!SzkXh!}oZw_S4CsV;3Thmyhv_z}fMB#>V&)z}jQ{ zkHE%|KQZm?M6moM*6wHMNr?MbY}W25ZczpO$w_hvlMKM7;`q*G4e6y z9I$-M{bR6kT;r)}f9Hbr(-!MK5A3?#U&KEjET4^k0lIv|Uj{a|{Nfb{p}y1YJdmxA@xW}RO~Z~Ky5YP%ef zv)0Ay=)DW-@~++b`5Dq1v5w4x+!aaRmfroyU77gp>0|72u;aB^bG}zsAyIRqz}B2~ za&@w;NbA2QaXsl>|F!fs*MAND&k;G-D?W>H*2r~;xmbdnlek|belh(N)=@_POGJJq zVhi8v!7)C3Z-A3`Ofw|rx)H4JsYv+V1eSM9bHx3%q+fxwMnbrTd;c(4z8hlwJHK-|XUz2oI6K#)=uPK(3{F1g zdK~-+A|G*n3)UyzgeSoI$!F(w4WDw}=IcqsHM)2GU03Y+DX?{v-SaAR`4uU@PlM%* zV}75Zx0zpU&mwZ}SzN_9>vTEN39-30YeXM?)#Lo_vv&Pl`wsNaAwv-3?uh7n6L-&j zJ&$NN@1Fe=%q#!9q-&2lej&q~OYhR}k+@5>;L=?x-H{j3+abn13i17LoNvrai1vv6 za^m8S9D^Qrq#ArPV%}b%x5XWK6>L82wZEp3W?qf?IwGf!IPS=5uzQX(d;{z}@=+&m zg5~3myakqXKhE_BdYf};dmH&9;#}g0^Cz%zVy<_+ip1Ti1K)(i z=gVi{?A_T8-ErQX&k^kr`-{YFP4DN+9QwFBv%zt9)`4wtcfJIhCwue#l}4KRHs;re zoIc{XJKuo2BXPF>1v`&?)X%qI`M5iNSj)xTX@+idE^W<`7Kn3+BhE%(2J#P*tA9rU9u$*x`%Pr|`=2u%sM9w{ny*t+5 zawL0qtPy?mb**v!_Ud7`kGs&;oxi@V+5INT^cAfRu)#cT%O}c&jF0~al?@4pS@6Mg+w}x9nuPx5FC-|ad zi#yN@PCmYW_TGTcHgNJ4#O}rTZNZL{H_jxu?ZEQt`fLxDvzB}#b^y1bKbp_$E$DYd zm($PYUN)oO30+$Ya4loqOCNOksFA*4Idg6v`+;rdQQOXloOu&x^C%x{?hihRagoPe z(B*8AvjOPxJ>cqy?;3YSmydA+!H(l+{kYvw$ zJ$(1h_!=vG_W|p#y@I$y88-rKJpHuaN8BCYM<%@^*fT6cw|R!zMj>*Zq1eAYn6uGf zV=DXc@fQ4hQ?U67RzC=$_+G{^6*`t1!qMx07#8E%zfQ=jV8};*JIBmY0?%Vl{Z;YtfbHUk~JrCXH zoZ8MuA&lJa)=c(We z!JE)Wp4A=ao05mW2pn%p{4VA9sf*#Y={Fhury0L(&^;&L$4lU~#T#{L#_#Cl=Noky zyteSWJmXiD@%tIPw)l>F1=z8^6~SGJu3x+#%fYs&kE_tloqhbR`D(DS9Ba*7LvQo^ zv|WqHIZhm(K|cqZyMFk_?@ZTaxcEN*3%Kyr9=^W>ny4Q zy}^AL+jVI(?>B;tTijz4+fC@MS)1!}TzuDD0oES+O0cow?YJ4N&mqhapZm9<^HcnH zVeR32D|kzI?ZMp!_B*68{0?fJ-VT=cyUo(X-H~+XkFj@x_0<;N0q+7kPFwih4VG8J z?^j^`w6*6uk@MaI=7)bbEND7obfBDOW%zr;T*5OcH_s| zo&sxEY<7;lIMu`|2z`{u`O{!yC~?-$faUe~_ZRo|EZDqgi+Il^E*tN8IC*O{#{Ldn zA8ppG@m>HMQ(OD=o%#1*ev1G94f;D@tn)>%Ys|)d3EeT;BJRszV{41EeFe-<@ocqc z&(<@J@6oS0rZ*WXxE>8%s{_}j}ga3$jJy!uompM&Y& zp;r7XP%4r540s(|d{*>;kI#VB@Y>={c>^pLxp@;T*OxK#i0$XWTj=u6{Rev2XYXFE zqqo8S{l)eC5&2WHIrbf}Z@;!bXKbC})}Z^YYI`@??jT40j<^Fe$GdN9rwu%F*CuQ5M_laJqhKLX1c-#6uBu+29`+rJPw_au(rcm54Fm;N3Q|91Ncy1eIO ztpCv4jHT^UM9x@Z&oA;NukKlCch0zDpMl+*`H1)9bFjQExGxeX9o)LaW#5@E;T*5O zcH=G~XV%VFVCzSp?0TYx^s%P&an1U>R%_4tvZl;|HuIw`?u|9&S;W1G+BFA`x6Zx> z`?;-c2)%hSm*3Fa%%wi{U^#PTAMe|L!QK}?x8e?ci!R?EF7m>#;vRgv!><{fZ;-aA z!RBCw7Hd$uvEp;M1-hS!`oufE5!l=)Han>GXW0@(AIJJOOvBa+9B;z_bnl3@+8SP) zdQ0>+;MVl<{kSc<+;TWutYKp~ZHg_{5cYQPu48)1yxtz`X^$<|vnxKao=xDj#r`{h z-M@T%PHzg94~h4GGdS1b-}s$hze#)-x1Kf!n=gGfLU*tJ{^Hrhnzz8Fz3G}gci)pO zvAJ*k;*2|jzc7ShrW@!Zs5q>K*mPyy2ERG zfc0AEJ;271x4yTcw^`rXwnpTvZ*kOjPq1~d8@{ogUg)t_-!Xl>yD{G0`(;h_20Pw6 z{>)Yh|`l7owZBaY@z}AkornO@ZBDQ^eKJE;*=FE%Zoj3B^A8bvVr&!A_ zVArB8YGwe~IJV$+O`Q1(ZeZecjq}aW6X%edv6@CUyK=>cLmPoOsvNr_+BqSd7!u=FA)Z4=;0z>ULk(=Li3ZB*k#@F=xN& Gi}61+>)qG@ literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe720_dx12_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe720_dx12_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..bec463559262dd32eff6bca8a10125439cf6e84a GIT binary patch literal 9310 zcmeHtYgkiPm+(1B$c-d~ixNnX!&PqL;bH($ngm1?tWi->X$?da6)>nTit^f%3nAE` z5fu?^4WgE|)&g1-t2QCL5D*n_EnXWmDz#K2TB{x3cJ>M2*lE9+dA|96eDgfBpL1Dj z@4YU2?X~yX>m(2aK|~Ea=WO2?exHz~vw45|d(qNU=Bt$pC&6F7^Y_Rxd{IdGv$}EK zOBU~g%xATQ6X6?~()7>d;#AEy+kTdNp32JXQT62{-q5Z7`;)YWJ-SjM`N}IL;0sF1 ztapA{Jih6-Htp8w-|3^5(|)CeMi+0@eg0{1ccq8Bb?L>u(T{uHD|c*V4->rgEdF4P z3H{HzL5tqM7d5Ew)-b-bCZ4OzTXZC4MwSZ@{ln!%cWczejtJV4yDjJH_rIP!tt3S# zct7s5%b(n>+`e>r?dR)1pS>}7KJ?$NHREhy?$P`Fs_vOTo?3V9yYPEUrVShMyFTdB zOt-XmKCw10n-lYENAYa;jJ@A3Dvp|dezv*QS^Dg5rQ^1`8?p$yWf;*1|LGzMlpi}@u_6G#bm^VFQ z1hiMp{&%=|-U74)boa+;{-XR2io;v=Bmm=6O?ayg2XUR=E~7ZEGk%ZaI30fDd`8Q> zbYc2NCIn?e4$%9+PDvRv(g=VEmm>l7qC~?T9|i=?2W^fD#7^%D+9-0r9YQl{2ALfh zR|%^a0S;7;aikBkG0rrCsM1l?&W?18rE*f~k=dFQog0#vtT_aEM2f5_ES^c3a~Ap0V+YR z3W*3wqpE2z43#55XHXaEtDzywN=dGM2UXy4PgSRLb4k-`9aZgVY_pMJKnZY968WBi z)sH$ovyhu*j>pBUmjb7s5vThI<)DG`Ld?1+aC(9`l}K2FHdepDDGwsAw@@S&N)Ro=g^(d{mmP*`_0*f19(MWXwW33xP)VvXQuNODcbx;$g2dse@QiG~dn*>|)_JZZ)U2%Es?dlV z**k4)1EPr1Lc5>?4UEph-gMPH{iDPEL*oa1{67ddxV!rG-Ih6E&SX8#i0XD!=5MO0 zDr=b_DvU&LK9E^f#Oo~NQSx)-te;|mmqOZ8k%CU)QXh;61%**%cHJs+AQskLuRgcG zu}oJ|P``C|b&0jbxsca6NAs+gCED&8{z2O~(NJqe$b#&l4{s&|9}@UnO^na|$d9_U z&a1ERxRpifamH}}a&=p4C|fTn?QxerWENZg%Z38bijLpN(p7Xo>C;B}(iW890x4`}XkD0eT6EGJ_%9?;t5P)aqdm)N(G zVzBlwU^h=DwMWIBdOe_QqL@^-g=Yrfr~&AJ!h}(JqLd^(>Erl-D59 zbp}RAUO~ak$Ahb9KFS?9pT8}1tJ7mA72}H&|nn*zBk`ftwlC)8XnkA;*QlUp0yXqYaX$(ImCSb#hYcCwe z{}Q;M$bV0Ai#(;*62+%xc&4%4-qAk|+*4Hbpv9QdXNfWxe0+aNc2C~(01VF8Kf=mk1c|KAv@?=hLGTX1p7&4V%!De?_;n|?PkE7a*a6qxNBcIA3A@jw6$XQoZbDqn{Y`{eG>nJw%r7d4fe)oF7n{% zxKoj>&8^2D>cS8H`kNQa1JuDA~@n#cJVxWSwoy!Wba0#E2q0b@Hr|2_nhn<#cg zewcN1f_7HWgghX>0mxrjdU1@wkVV98wtV-3qVc=N@?(Ut-%6A_3~la?5=)~3H;LcO z+Iq)z+|bZA<>qyv>+q?}1H)h5U+;j*G_Q`;^Lh`9kl&t?ma88hWkW4|?zPnFFb1+&r{0^W}P&!CPy$i+%$Qs(jHe-{M6NxcT`&dtYZe& z2`;eULZHer zuY@8p}nWd!9Rl|SMuDcfH5LNuRKxvWpX@ikKXn(8cNI*4D1 zxCM@Puli-$2L5+10;;Aj#GS~7&92^;nQ_Pc_Vvu0?%eCV+oXOoaa?xR+O;cl)+V)E z+irFAc0T~~Kdu**Zg#A%1*6<-@CADcJ^?nkJUZr7obURajZ5>^WGzb@=(e4GFmT7( zopJTh@G@LQ%yAhncL}a@G0kjDNX9F|FI1=;#-^bM+>_P-(4;e~#If3EcC} zBWp+ZgTti70f6?@l#|U!%!!y&=qbRWHCU1GI?*d~%AUxW$*ofwP5@n7gW(zL0WXiu zpRcP2n|!UyRr?VVj{|c+Y>J{{y!L+HayNLYCNWlJ(uy!j@kYwJ>O#f?$mu6G>p8}X zVu;4I8NDvl@s^_w_HIgU4{@qFajKR$wP&Mty^OM%N-0h$lgTKXWW=J4Wiq79qsN&w zsKZZb1*p?K8_OnUMX}qx?)dQfe7xGS#w|z7<4-H&dlTc16Q`V3PEir#du(n+63XUW zN=$CqTJXfmWV$k$gi;hlDSGJu*lxhemQu?KIc00B%ZjVzVUKOB#}?Ml2G$@-%r@8Y ztaZE|`}0;7uiJ;$F8AurB7dt(j58<3RokB@O|iQYV>QJ1U8adZ=xas%RbqUjiP7#u zDUlI31(g+HWgeFjSuZVQE5dqcA-`a=hQL`<=k!GE^c+>n&9L_^0WPR5%L@naBS;|v zL7TxlKu?i-M^D*5`~Jf<|Khmkn}6hFSC1nTR($I{W7DCkr_WEF4)Y^?@lNHLDTlwg zZwRFEi3GVp;(&=P6z0W;^IpBW`CHrlHHC4(d&;_gXxyCnpOV5ag?}Vnb^xE`2VnbamSS(hnlt2`rL+bOQ{V9kOP-tbtMYH&vxA8(^lF$YoI`1Qcadm zkI~N7xVHe1q_UO$Lmzcc94o2Os5v+Md@&)fovh_OdI|_jSK)-?@76SEg1jU)AlG5_ zn;OaZ@xI_t&J@}e`$0pMuqocH`I|T5I_zI%*K;^4!}BczNT~4q%LZ1}+xb@ms2|P0 z9)h<23HetR@ZtY3|LQd|1R{4xNj2*5yrvBWd5s>Cf<&qtL#P4M1nk8HBgw`>(c<#1 zi3Qv-fTx)Ui!Mwx-Jji;n6iZ$Z4&7%!84Ttssf=Z#OYN8IhzEQkt{bPQI4dKAqXJs zsABkFE?z)};N19CCtuSxQ@bAWKg%fZnqI(l2Bf6}Y^u+bhT%+V|ILQ%fIu+qNkE(% zAqi2n#VPb0_FcrBVio-Na>iJiS2737Qo&uY6N_UKB#ac-`lvd{eT`WWlJ zf-n3wpq!fNR_k2pgjXwa&oa`E5A5sO-Vh{&6cW*Jz&+uQlpbch-(_YG2IbKszI5l>%8!tN4Cj3i_u8N2KO zc`gSucs!JV_y1*HL?YE7$R>q&Y6+*z+RNvK#iiNYFqNdFGM=sZ!Z2wr-WOaSFGp zbY)cz!t0dt!-!YHOoG^L#QY5E;YAv`j7PbFCS8seV#+)Pmci8>T2+{$)O+y zIO3bg5>sQ|O*M8CWh|av9~^c*KX;XaP3cqn%uqAi3FKr>UeIwTb30b*adQdBYyS!U ziRhCtr@)aw7jYboOP;qfUzV4HBu-2W4MoyLLLrwBRgJV8k7WfZqXbGO(c>WOna8;* zVD{?i+}ihQQ#}{$<=)Fs>vlj-&fRiFW0IAXSxAv7bUEkd`i>95tY-9Mk+^l6e zYiF%lmXkM6aggEh@rRk$Z!P)gR>t*PyP(gL)DJ~_C=170AG{bzfnov%9swS^S}%3o z7oM@7o@nj%dHCOR$^W}^Nh@=t-C_@}^LA^2lpU-E~*o`pcrui!(NE2)5uf4>O<_OrSPX}c&s zhs1jL(44UQt>Uo`JTZD-EDV^(nHE757v+ePr*XvW`wQ0QaKwU1;-LG#i^C7iO*zCB z7&tHpR{wOAlD;vY3*sk3An2)09O3ESGsoIZBgA@`0`2)QX_O{8rv>bnk zs(?MPwy~5g7Rm-RTL&Rj@-jAkA8*h&&SKOE2^hlB$%EFfH&9A+6hATn~T>COU&Y3TxkEU{5*lquPcxnfb{F-AU{lyjS~tJG04EBuy$^WI6JGr`Tr zpfSQgrH%a%{kFF@kOZh~juP}7f(j?q?5@8w()>V7&z8~aX)t<=jS)FLk#33N%hSiG z_YuS$VG$ByLp!66q z&>p9gV#+fho-~cbzl}H&=7@kIiy`tc2E|3oi3LV9Cb^vGrATc5Z1a9?^nNXj?{Pth zUYfu29%r4LK1Y6RM06=B_PH^3SahQk5Z&lMD%wASrMCgmav=KU8_^qF9-wreh#EE( z7Y(t7MXz9E#xP|w$&bte146r!;*Kb|$A$67MWNstG=&)>d*x=$0pIei$bC}$E%rVV zuo0Ti9vKkD^@)KV0=SauX$pxPQ9M!_x}8X#5xEeXq|}VJ){Pw$Qh`r_E7?`iPf)43 ziW*3{NX^exd{(-*(Gdz=(m?wfLb*L~Lf}4PNm>f!RkfZq6d~tXq@p;(igp7eU^7~p z2WZ9~AI(LL9QT8~6;EB2G+~L_kFXv&yNLXdmgc2?$(W8jLQAeN2YXpYSyCIz6m#3c zdcw|#Fn78M6ONHC3LFHnnNebx&H7Hu2?N#^CcB6EkUnIG4SRUwrP5iXv1}k*x1G7Y zWI0VQr?)Ts*z<>waf?N1Q~|K4w$!61a^oB{TZTKyo%aXYr}nkyicm%jsTc`xIs2t*_Dj$OUlqpOHl)WT-NaPC4-8M7@8Cyf0>iTpbX@9EFf!9W zQHn`ptJNjimyWM8Ebg|ZZ(;|eBE;LV0!bK48fv;ky&IJ+!AHw2*H1@>!6oGlqhM|M zzOrmNvfr7AtKKJ0O5iwBUom3Rd&wIWm9!>IlfSH6>M!Fqb-*Z!O3So zZMuQnm9_}mSF}rDFw{uTtnET7*{AV&vS z5|&|=w)uK<$G+l38aj1wf|_BAKryS-!{6Ig@iJq4SEpHDxg9Kzp0BOaELm5l3Q1^b zDl1{otWq`N?MHsai8gfV;RG_%wl`pa90DopOY`*vGz~3*8 z2d*cBC1cH+l5oNDlk%6&QPnvwyOHVuNGYcy?i~X4S^FCsc^gLFP#LKA2knPO-n-Az zZzR#@6EaMVp`W^lA#KRrB>Dn?+Csm;(V35uR^ccb-h`vhN(V5d=1qs*z0elc?HjBZ zcF&Vr0%mXY&oJu3zZwF)`Zbp6nl)8EjCQ1f?H)Tz^6IQoqNkyg9F1*f=0e`4UI^@0QdA6E zL>wgh|NNGlg&d25!{PQhGLjiAh-5U}bbqgP=O&L?RCT}FN1$9pMiHf?O3wf@yJg5f zlG6aa?%HXV=m}8pY+qnW!NDozqqMGjWlvqV;Ixj=F~I_h6#l~8$(X<6;_$>|hRzF@ zOFnby?Ia{81foMt^3fI*e6BI|vw?HDB4lL$OON{Ta>x_H_%%b}Prwxk_OyDM2(3X! zq9>ai={NC9#Y7MzB`q$!qx*dA4EN>3TRwl^oKdi4-y-)8vM7P?Hq>O)jmChf_rgsh z;UMAJ8}J?CMCH`Pl0lEV(u?f$jaY-@s06$Nb1=knLslAtNC_^AlG-_-S>dp>A8> zRUyiYAhpMw)00<&P|d+<)syvCDu%(T$#tXP;mHR^!IsJO$42^gOg=aYemnUP0PWHp z;#Va`nMORJ=@@@f)JQ`>e4g}8!!cKWV&rgibpJ_nUN@?Gyfn(+aHI<}jSt z*Hfs^cq=A3WL0B;cgOy|uZ>c>5@XJ^+(>o4H6gq9z0Zp26IvbFF8^!>nhOLTzV_dv z)HnV+)YIjDeSt|D=Pyoelgh3Mt5<5Cnj|UyB>wzNlXqugJGplXKr|qcmG$|D4G1e^ zh>Uw|{AR(a4xaT-oKH{6iCp91nJ5Ib`sF2O@h8UTj~Q}CKiYPB@%%sjt~DNx4sn*N zE-imFsXyL*_Ue+={uP>`3>1r=02#};E4Flc&VN_MEf)LMCilhvfCS?88w?k{M11U* zKiQNLX#VS1rN4N@%xjUA#_nhRPwW&-{`_deOe+qkzZn@~G|g{*#uAv!AQjjh%21ha R`cngok&Ja&owvAw`T!pO#uNYm literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe720_vulkan_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe720_vulkan_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..0e33c58e47e955762994355197edfd6e0ed0d2f6 GIT binary patch literal 15030 zcmbuG2b|T#wZ|_YO%NMJL;=MHBBCHDDlE+f1zBOSB6wLYu)6Hx?xJ8UU`1mgYAjI{ zW1<2!)YxLIQL*BbA_x;{G2mh{oKJR@#Z{D8F@BGf0Gc#w-%)PrjbGclu z#o}fM-1};$L9Y()u;k+&%fCNn+TE*PJpZ8Gn%y+)gk3ug8qw#>Pp<0T!N1gD|xa%%na@z1#FMN3lacN`5 z5BvPk?N@#G;Mr%Dzp`xL%(h>(-ErW8vzDw}-uvN{FvcoQ}>*9CIcDnYM z#UIwc{>Yc5B);-$?zw$CjvIFEnpLOB*FITCGFz~t%^zCb;ej_dJEQjF%Cd_#ThRZ+W9}$F&Z%$s z_K>5FK6Y}~iznVQ{Jb^2t9BpNqIs{@xm+{S*&(-Y^HNqf&NVMG?Q*S(efhXax_QYbMmta=q+p1kF5g{(!3+ zqfK!fLz~WBUSB<TdthD7yg7wYg@&r~ipg;9RGY1?zIs-5tz4@jXI|>- z8uN|Sb+Dy*^fiC6^NByQw=Rw|*K_KQDae^W)TWLOX zUbKy@n^)V|uy%~+ROI)cH-}_5l*X)IoXdQN?T18H7Umafl3&}RpE(b|QPpO)st{hW zHgjL}8MC0Fu~1)VsCEr)isRjP(KbFmpEX2?wQFn__WkSX=j3ZfROf$KfBUc86EW7ugOzeqUAs?xU2UU& zu^()a!%f3)QdNCjP0fUvGaCvV^IChyu$y2m#6G67Sl^|!bPD?q>kb!Ulzcje&%{Da zT~)DkN7v@3*A&Q9thY<}jI7}%SI?~eiC^i=Hw(YgdPmk2^7T;Mn6^33dmVSObX$u) zEpwjx#L9_lFMmr$dfpQ&e@KpRjptjesro`y+_jdxR@wKf9Nl~6yjvjZ-X--dlkPp) z8nJ0t->RsUbni;muCCpCuD^FAYggCqIGIb!oT$oYVRmlX+Kqq1%FUKDn%) zbIA2X!q2#JKJdZ0XSsnH&UZtuEW^1Dxp5iJ{mNBjIQJ-5nc;i~!L^Nz?ZOPsm0$=S-O4mr=aGuZv~M0TWJ#O{R^4(o#M z9^^dZu)BvhHhiosbk}d|%jb#yu3auGorvK2dm`4FW7S>1Ep*pz?S$SHob}%v-F1h( z8`!!szIU)EV$-hfJ+y`19c(=J)`MOj>S~kQ9*CS0+z_yJszkg!!P%NKp69z4@;wuWzBjsW zN9aSrj_XQhtUcG+4Dno|iRF3{b66tvb#G<#o{f8pn8TC41$Oi0I^??Nx)tYk|K1fv zn|c{yoDkRXe-XzSBP-6?ofUc3?$vdVpm!f}{`!wZtT)#=3hX-M^dC*{y_eU%554ON zdpTIUym=TyZ%p&x__6fO5P9`|ldjLEtYkm>t?(X4FV<%~y`Kr@Kz;wDm(e@N1bS`m zLwiNSWl29E=`nsHx@&Y_`cF!_`-rou1h;8cvQGvZTl=2)d)D54Tj;LO7J8eKTGU5? z{R}dOc5~PsaSiI`%+H?CwR_(}H)rOL$(m^a=C@~g?>;`Up74SgVB#0 z+`V{b^*;nzxuVa|xI2d?PCmvQ25!@H;gEjJZcR=}HqYvC#9Hsk{8Q=Oo4jM~ry+hO zgnk5gGerM9z5d1w`*g796M7Zc&w*ylT}D46Vb8393}SZc!#FnUR zq0erjS2xj*Y@#34M6YS0&uOC9Hqq;nzBlW!-sd8oqq;dd8u1)Ihpnf#eGT^WsR406 z_QTnQHQb0;N9M&`+8fKf%|o<@?=j%4ub-LWdn{P{spQbH^AX3($M^-{?07$8WBhSo z?J@pmU}MN1pZ0b^65q&>pl%Ee|j2sI@q!D`k1dX5cwFh7;KCfb0*j^ z@-gNtuzbw@bFgt-1%XM^?A7VAC-?7H1w#6K4-pN)SWx_rc60yeh%!W91(VCT>l ze&>T-M=58edbj{xUjNwRg<$y`iM1{LFA+J*6ozy$kB{uHE|i719&2j?9DHWl7(f-u=j3p7?F(W9(9}6WwNbE>tB|*?)0wzDtepiUq=6HM9%e!&tRN2ay4Qu79nRP?l*~FNI#Kvl+phd zk)MIs!uJ|*j1S*y;p83D42ij}1M7P-628m9@{VbaxWAV4E0EU6Q1;^crC;2`mEg$9 zG;rL*>%rQ58_eAeNcbHA-V%xY-3ZpcGUe|ku$(^5=^J`d!bi~?+q~XPZ;SVD71*5G zYrjP!&Ac1)Rzyx8an$K;VC!!<^N*+h9pXIluF0A%O z$;Vs|f$vA;BhDYe`ox>?FjznN?A)&5Q_kCbJ%YGK_pZO|iakFHwvMuUUX3olBIWln zu$*zs@8k3~^Q-L%M9w{ns~BgUE=4*aHrHm2=%cTCoWFh6uAgh)mi|d(AY$C@5Pg?( z_uSW0h<5Yt*+0y@@=qsSd(`nW8Qxram!3u9F4cldcd2woozpbDZI8VCRvK zI(Z!|A9v&pu$=pGu0PS+oJ-rA$e$7C5=WfBfQ=J#y#;oE*}49TE+2LKHrR3UaYx<( z%e!vR+WDQ!Ib*Ih;Oty~LvK3Q-{ItAu77|XCm(VC3Dzg>$h%22m$+ee6;dlq{~tiPp5_KsL1`snLgDd-lQq2ke~)KJLyZaM~Of_5EM4yyMNWcjr?i?oJ(e zITD{QpMkS?rx&{8ygQ#G+9UQCiQAIi&zITsad&2cw%3EbG1Zw zf7!WO!O2HGw+1^-KJJdc$I5$F)`0UnmvhEkZNb^O)<^OPjOn~bJmRHwj8?cd?C`B-yb@Cl5I zJnn=pXN#QmLznLcS4Vu;xHGzZjO!0}96xKv?Sdko9k(mGym{On-vMA_$uCOWK(PEC z*iTE`Zs_ud!kwGALFn>3!JU%0!RYcs;3A*9qs!ZZ+aqz(?KuzkGz3MRS1jikW6JLd z-ZRUBh&zaJL&3(=Py3z3-4=dW(mR4Z!!mT6XQ*vBBIg;3{o8{% z8v!<^!cVceE^Q+d=N|Nnyo>^y6Yck=`A36Ym-Bna-RnN+^6vLQBz()^Tz}Sg47z;y z#+i>jjP>#o`RYpuqExJt0^pSH=#wkqZHKy>ZK z|BM|Sl^R>qzZ)D1KAK)Wd=3K}-_Ij`rhxU6*T?l84wk*;cL83T>zPS!i|;bC&|Qmtymzy~j_Hn{W2(V6_n_@ac1*`oI5 zplefXc2Rq-$2i7|`D?+>za@UoUkA21zqYxEoa4kX|Iy&={PF(O!)voeJ{!>GA5CZ5 z2$tImpSjHA{hWs`@4Zq#1}t|N*uRx{7mh`jw}x#Grg-zwjkh;k%&`DnK0C*8=<+eg z&%kooIgUq{cP@U`&T#^Yb9mM<$BF3j**Q)^mybCXg5|PvEJBxeuBK;WuB}t+z?|Ew z$JyC`%D)1c5AUzJur7@0`KUW4d`<>i6Iq`<8LN-q-6n!h0k@~O=KXH2?zp%gr-Hp7 z*2igJTh#RF=&sXV`x(g|^}87T%;Y1E`Z)`1+^FBEpP$2N^WAjc&S!jMM9rQJ&erTX z=r-rnb}l04IC0E*9(Y}IE`is^&yVIbhHG$7#-864*X|yT=e&NVIL16r z0-q1wfIjl9?l|9+Jp2XVcvIqcDZfu$2(L}Q1JHk&@!JaBbMk$>2wq#fQ5R?YrYAq& zs7v6rh2Nzazp9Miui&-CcihXsj`ghw?s9bf;{8|(wncqhfo|^X<8RGZf{o=^Yi1d} z&GXZC6(Z+2aeM~-8f@y9w-fNMraN)H=NxEbn)l#fe*$bmxz;w}AE47T*DH1v^e#_}vDU zSHkaiVEweU=R1+}-VWx6e>ddsqX6%QKC!PmlHK1g^bP*b#CL#qk1_9EU~P^I-@C#5 z6z^Ep_xF(6^o{SX_kfL|&9z&Hf1tNnho1Mnh@5pOb{^l|`@sAZzmplqnpsM(pZ@V# zd_UN`tJv&(?@uDWaUOusC*HmX!TS341@{oTezxHLm^kU+9!{L`E2vA~jYr@dufKNV z$J!nRYgcS`j=eC|#A*nAl*svGU}Gq8){leb_4oG|_w@wWyl9JfPbMxK?C0g2^>BJWPu2A|)+BoC#6JG^G8tTn_&cvY70Kry z`nRYRKMRyfBt8RP!4{tt-QeRh;8l2S@us{6mW$lH4wmc9m^sAu^WY71dFTEUz3a1g zuh!9twxC)rk!BY#I+gRb4R`TNA*k{wg= z{%QX^BJX;{k>7uS&9CF#w>9!luzb|pyWsJNyfxz+^d6X>;_nN-Kl((>e--_H9P@oR zd42r+{s8Rfcg$qFci)e|a>n;f`50{TP0{vmM9w{l22mxpL(#Ixw4P~WMUO10`S1kjVfwlR)%6W%_<$UYaM}Unh zZ=J**?5z`hMuLrL?db3Rq83Mitwnv}EJlOnZNcr6xa|3qCr;P+?mq^_@%n4G2IJiy zi|)H$#oEQb_xjshyPt*TzxbI*)^|7a2e0eDEo9tnJyxGlvFMzu`c19qfAf)r<34!1 z<@ZzdZLwnIuqow-&b;EDm%bW*>!iohe>qr;)70k7>;4Zfa|`Nr`*Me${3ntW!-+?p J`MNL0{{Zm1;EezP literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe864_dx12_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe864_dx12_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..0801a8caa896c3cf6345443a5e26cfb993d4eebd GIT binary patch literal 9310 zcmeHtX;@QNx9~YhI2lMn7?eN)97dVML!bdfX%Y}nv4Wza(i(^;Dj=vYit^f%fe>ua zI3a?qLDbULT0o0pt4#?=AR?xBo5}Bb0eX4=H#H+d$e}A0Tv`beZMlQZo0=}T6 z&UpKm1>;(N>(FjW`A#3bg#If%EV^uy?z2xqdbfGFTNj<%9sQ{9-73d+&M?6n&$9Pd zny~-88#MpDJ5huBUJdgLYvSo`1@jN3PR(%vqJOxM=x&WV*A+=$c)RU%xZ3+_~KXMsB(+=JjQU_;RCxg`K~ra^ zM2>*=s+s=|PoF&(D+k>J2%5hrzk}lNMm+_<#8i{ss3Sl^r#H(ePUuYBqc}lF+ytM| zGCNb8xsC-vxsU_&9i-AR^>QLA@l=aMPCwL32QxqXMzdT>QpXe58BwbL{0?|vc^J{TByOa z)YM|Klq2V=oe}9~h^cl~`%^cY_J{0K^*o-KUjAW4u4c22g8eOH3B{O$c9#H+>}3_d zduui~b#@Yc`(Dzv&g8Chhtd1d7bwx&JKu2*Obbqrm<~_P^}n-po^G}0GE&{L#!U)M zdNXIc-pzn2qO{NsXkQbvyQDu;bw~g3;H{x?gT4Xp2kzfl`|5UE2AH$rK4(;QBP#nh z)nt{mQWO3{ z-rHQMD=%u?w6nI{+U8us@6OOX?Pp82ct*V6;Vl_zuMVA?JM_V|WZ*+0-%E+{`5*ez zHZ^z+lpM9PDSgg3;a{$9s|=NEq?N+_%CdYifLVvr*@gY=_23CPt;eXV^wiZTwNS?{ z83oqqsq6ZYA2`%fJ+(wiG=UC8Pf#hPuF+FVMbttm8#Jv4efp7mubD{MplLnm(~msD z?X7m6M2-Hbh~^=fl|<1qp;`eX?S=5EY$(VH!XIf#wcuW7b_H%TQVhDKBoaD;;Jz~* zD54PrO8kgLv#%tgLOscgV|P6QVU{JJqstxQ4yjwe6#E{KK`ort2Iln1@R&^sC; zi9j_`aNl#D5R3wdC1IH&2f^q`b3O5!F*4#tsRb%rKR zJ3!earRcfS_Hn3;{mkA5oN>sF@i|0hG+<;#v_7585bBG`j99&n%$TTeCNn1K`^k(1 zy^YLB*JBQhOntfoW3C=|V5Be7$8I`kcIbVHt39AuOQ8JSFuDZ6>pY-UOQ6(RSTD72 zC1qgk;lOU5%od;RnctI4}d+F@~nV|@LFt)aQ0jJnWY>)PdI zk<(W@%BEl8P+V1}I+Xt%l7j}(sBL15$&jsfRrz1TP*3!y4-JH~gab{ecv`61@@7_V{*;7|fS*$lZdo>*oI)ve!0*_8n^o*wkT(qhV zjczb7Lko(Erac;5G3{aggENJjBl@b}X*%0?D6L3QT)^X)PB3K#oF#6PL!qo%l-7ue zV`GtgS5;#@%D;*DKS>}n_s}IG29J`+6jEf(V$3Wx^;d{J(l|A5TPS0MF)@K_pI?6N zFz%P2xupTSlH25|{gx;pEz2{Fb<2;S zfL6NBDCS-`w9ikWT(+$rBku#da^rSpL^=PTN)cV_IowX=ng6g40X*l*iO;@V&zV&(+< zzm7X0Xm4#l+D`9~BRs9uEg=&kSGp2DFn>1pBj5%ZSNZSOUIU(RD;11wALIK_TyCP; z75QPt;qlrT!Q%^n{3alOS;e_A215>+u-THGb4$nV7%Pks$9^kSZZ&kcJ4!9h3c@7* z)9M=?SM$QcI+Pn$hpi^2vH%Q!$*o2QtXN}LKCq{!V(S6B?hQRV&orED*$UJb0`=Q$ zH%Q#rPPi=|t&&%OZOeYK24?bC*)2JB)vBDu%W{fj zc~gpHD;F;-TAGqmSeWCgy2BE3=@ZINLI``j-5L$eEpHuZZV`k=x3|U}jS;reJ76j> zihDvaFp9^pQR?cqUa#kUIDa6^gu0*`U(zfi-2{^ zz&at7=lEcDg6#vGT5;F8;(Ue2$(}DO&V!-FfuTLH9UyZr!C`+~Q-a2r_BQMUy+aIC zS?rZi3MnV*?d}{jr|Y?JEa9$mtz(0_<|YH@d+7dSP3Ji_ zf?XnPm7}XH%pVxM6d3&Wt?g8dOS9`Uqq^s0OAD)IXGIUtCLU<>%yyZ~W%8mAv2Kdk zgQ(N5kXy3RZI*n@d*ZRnVfRv_dxxBVR_t{Z_P%HI4x%xG3(##p5-TgAAeDKRc~->w z*5Yjw`vlQ0w7>%x_n-YvJkt9E81t3QDY~xX!gck*AX*7l$lbPhK*aSkQvF*RER{M) zxD9m+8s}c~%apak@16(Nq|76n$cE3X-IJYl)BVPk>}&44EBqUjTV}F%ZqBMz%koww zby_>FclGz)1M~0QkI6PTHr9htZZPk{mtfK^LCnPVNlnLquI(Z4)HQ&Y z$A-^VH-b&R-sO`02uZ|&3=o^5XgI&~7JrEwJXw<%t1@XNIJImYb#-kC^B&~%6Nmi_ zXGbw5-W^7-vkm+un1j8WlGjI`Y)+i4B~R{Kr(IJ_-9V$3rB)UfQ`Z-hOV?Evqm>?g z&g?-QaY`$~obK4zwsdwBr_<}EFMq(-t0TvI304*VwKBdxG43dN($~sKDsp_E&8<{Q z-H=a>$*)`mo_J-kuCiE4Ee)oYzHk6+*W#6nXq6@0%2lh5&3;SmSdk`b% znj84m27aIYc|C{U>&x$yd-diZ-|7?X#x=XN)dmF9N%nW zcKTAwi^=PQD@*Z8kMoJ_7Z${dvhQ1v=N$GBIBV*h9;Z7!!<2F}>~md22IPUu9A9=a8-Uw;ww?0$XAE}-ga`* z!Ef#wg6KjrNp6rj;1Ua!b?*M`moKmV)^T@bNnFUT%AOyZH)Q{(r0@&zA4%tXo}GR7 zR*45~&;0iTe%QI7>*9|?tyZ*Z?=(wHX(4|C&gw2@5|omy6n{>8ai+u#xLec3BWX)vA4!M-_Os2otAUhBPx*0c}ZcL7#!!yx$S)@wrgGJ9tY6y!&# z%kk|q+SwX+7Xgy#9ObQ{54$IfmDXw0+^hb6xR~FGX!#GH0K$sp1mU>bbxoRJFR2a4 zby)GbMmlbsA2^h=#CFAg(9onDs!x02hINDvdzahw9L~y!e9Hh5DkA@~fmQWp{?!EP zNAs`ypzVJ`{*?oK_&?0Q`i)GHf(I#SMjesYbYLK_(W5euNcG|klpfp8#W(`Tsp@3ynoFAGfM>EHe zL=b*hF?=vjpNl|ne*E&|ujm_SJ@xj16!Dw^X~hE$&G&KBa3;0)T2pRd5SaEP zAkK}HgsM8?6nZY_Hfm0_ivD{!V=Ub(nTzMB;2zkDE!z~FGxQbPZPC&O?mqtjIPKjX zpWLr%3R9p!Fj1QQXo_ZcS*{(KnutoT^UzT&k}7LFu%Am z#=0lD4qtK=IJKYK@n>h9@eW{9688U94o0!(U{W@8k4*)a_YephqXn~0#b4)7Qu7fA zBv8Y}pc_XbiAE5RB2g%Y5d@@T44VBz1W}=$1=0y}r9g3c}=S7;MVy-~p25*AS2j=L z)l@92$wT?wa$z|6Vz@~ZyO~^=MLRfOBQNGtuVP6TqQ$tfK!IoRbO)B#&2vweM6ltCNHza|?oxI+;813Xf|Gxn6sZ z36Dh|k2wL31iHwhSX}b#Wrf8Bd1&H<#IP_lQz91gNKv(Dr}0Qmurf-dWRX4g!=44) zOCnakp24esw|=_k{N218JJ2SH`hM=bpcrsc6b7Pox?Al76)jhG_ROGbCoWzWu{u9z zao(yKD;MV#%vS7YdVKUj_Lb`kKfIoG<@yfjvn2I>$u8==vDSOfM^d1ezy}Wjj~(sj zd+v%)+D}jPPWwFk@44jv-MM5s@M(uXM|;M9E!xxntI-~|M|;*Afj#_>fnEKVfnE03 zft~utz@GMIU=RC`0=x20ft~!Pz+Nr-V_;wShrphLLeQ_^LzpY2h(mn82?h4Ex{2vK zsJ;i%_3(j=@QPWdSa}%+_-?v5a5i^JBssk_FFkn*H=T2L?y5X)I_8i`zWaN6#DQ6< z2Y4a_7Y4!VpN=xhH|Ep9!ej^pJ++A|UU4?=akcZ{Z^1{TShD`{c%S!Wlog+U`!L4d z10Wza=Gzg?MmvHAYn}BdW8V!sLmFbQd@(`m3?lFC@9m$e{Si8(kcyD^^+wpoCil{E z10b3L_P{&FQa4(tYq4A%gwl}39L660pwZi6)QCwq%GJq(*Q_y6%XL(L1OW_mM z!Q+ZRhCku}YMYNscv>zWFqBs^mWnhT`4UJQM3XxxXvwZLqe?_c-lL#RqaUovu$ zo3BA*gn>%yZb6J2KH4A(pt3nivC}9feyeV0OP6_nU##@J!e%}zjcbHJ$RfJnC921Lt&=oha=uXVYHF?=KI zI5a}EZAA1^4sHxrwo?2NHW(1rlN5JI!8$QtZt8;g@V*ru2p z7WQLKR;0PxO`LFqa!%wRip`EnhdJ!;wA^rDZE>=DxG&`cPWZ5gH=nPVK^e;d!gX6% zTgsQv^>Rk%ypKG82=#tXl138&i)t!7`ULATu-sz8Np8OPpmXv-XTAhu#!$*&Fpn49 zwA^TdbCT!87N>-aJ<6FcR5M?IF2t%Z=69fdE}15l`aNKH@*D?$gar)GInXr|@5~Aw z#Ky`Z!3F%&9bG7Y=YfN0zQJWEL^8gaw71_8Z-s)avo-HZ9daAop*(nod1;N_^8sWQ zZ3~XvjZB0DI_{>lgK{>`3{VQTe^a1yEoE}VAO*MnD(rBSZ+Tt>aAtADKqgdkNuQ< z9LdMK!0`KA7MobAB4SWAuLsq=2>(ZZ6Fgnpl}}tj6l1tp*bk#M_$R$zD#QupjVz#q zh>JTb$&eVcoi#;w`Aq_TlGAA+CjIMYqUu&?%Xt;boxxEtR9;22UNUouhj2W%sEK?* zq;%9Z$Lm>~v>1yRtIg%1wMD7b`r5z&B$OjIwaOWk^EO{zlZaovwv`8c1!IoMi3uY! z{S&o}GPYJ-u6^P7GRxv_YxySjflPw>I98(xV<|%|=V`a2a;3y*c~$xpY#3ZvHJCgC z)>rMR%$1{ioymmi1L;W#Tu0hVW=xtd33x%a`|tu0bN8pNuT8EZ7HYnNqYYwq#Q<`zYj0s<%pji^dIsSXDRq& zZR+yyEUT=;&xbemC0AhR*1-vCrY#b~tul`QA6LbTtZ_ZvX8pD;V0rX?WtHU=_jIe! zgtnH-awgp>Q=>lq$V+atp<53pAS~PNzz0Yuq-?Ax)RVB-`M`9L(!a8BSgY2F%eE3) zaU(HeJ%9dAQ9!d^w}oC&UJz`Z{kznER*8$j6PdMjyL14jY2o0lX6KMebSca9$)%}S zfrw&;GN;-!J3gW`tHpC{0bC(U%7fAZf2AN`|J|$y-eLvbLIjue4}0q$^o;DDjebGD zpC1QYuNan&HEYTvL`#m#ZO&1(c`tg=+CWGtXQ1v~BK0Zz8y|TaM&3{*s1E?`2ZrC! z&Qpx5NsKw9EK_sXCobubHuQE9V=h2#VV@J|w1-K{2^5QHAy8+f1DI0t`UCHr?FjGn z3sDTa=kbk!GuH)V8Fdj~4uM{`G?o<2${Js0C)!jsPkP+9-z=@kVGf|djLiMzf%sd@ z#~op?gCSU(xxb4*pOPX7ls#t{{Y65c&7y5vJhqn?G+1S1PeV5njc;M)Lq4W{2<%rf zEFHE;xM=SG`7Jk#xfTVN%NuZHCNtR(#b~(Z{%-sB^&T^5>RW1Gk#atQp-O3uo(X1l z<4}Nr+XTJp*>0BVNl?g4KVV7G{z+A%w6430pSW%$XdR&=qPZ3s{JFWCIcMv+;fcu( zn;jvSe(KWSO-fD(!iHMpqb(}*DA=}VzIzuUNf5dXwHS4yF<|nY z2-8S7NO<}he49K$IXSU>(Bro39B1#y)b-w5q>>JADiKFu4?k{XEaA`?w|*m$3Z zG`<`VNTOnu2EhjT=y+Gm7Cdn2bJ=4QIiR(2uO0HZ1?7F`Z_751_2D5e2QYIt2~J1` z0mBy`)oS&2fia)Ng-p&8wEPG&Ux&!Y|BIi`!WUB#+Maz-ULYdB7{C!*3(T@aP1hmh zF}NJrSp28=^9ggx!<(!!NuUoe6zl@T0n0dN;@dK};S)gdZuS5=67sV@b`^r3R!15d zHV<49WBf=;XUu6mvI2x^E8_e(zk2k{!#GTi3b2^ zm+lb1JTb~N;t4HBgl|QSGz7*M$X+)baTO*ChNGkVPnt8jQPtyRQ2{3BOMSHOiz!p0 zI%4?Z%UT;NC0m$SZgT$a4Cnje&WfncwTR17wB+?8r;9_1Qgdn}RTjih1PvmFL!MUI zWz^?0c1pJ+h6}d1}aaHI<}jSt z*Hfs^cq=A3WL0B;cgOy|uZ>c>5@XJ^+(>o4H6gq9z0Zp26IvbFF8^!>nhOLTzV_dv z)HnV+)YIjDeSt|D=Pyoelgh3Mt5<5Cnj|UyB>wzNlXqugJGplXKr|qcmG$|D4G1e^ zh>Uw|{AR(a4xaT-oKH{6iCp91nJ5Ib`sF2O@h8UTj~Q}CKiYPB@%%sjt~DNx4sn*N zE-imFsXyL*_Ue+={uP>`3>1r=02#};E4Flc&VN_MEf)LMCilhvfCS?88w?k{M11U* zKiQNLX#VS1rN4N@%xjUA#_nhRPwW&-{`_deOe+qkzZn@~G|g{*#uAv!AQjjh%21ha R`cngok&Ja&owvAw`T!pO#uNYm literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe864_vulkan_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance-numraysperprobe864_vulkan_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..a573e2511d6729f514dbdbb06c3d05b2c0ae52a8 GIT binary patch literal 15030 zcmbuG37pnd)yE$|HbLB2L=o85P^r`0Y+!RnL)u^z$MX4i7d0i zB})Y~rCl>MEkngDD;LZ%rNwe9Q_~jT@Av=QgMUXqpZEQI-uuq!{?6~5d+xpGo_n8X zhSx%&P-wTN&B^yY(_`c_s6eh&J2i)>Lm?UG<4I_h0qa>b>tN&fR*+Go=aJ)}DF(>r-yKcI~C(I{fn8 zi-}8{Jaz0la}L@3-v_U}qVnk*hcE8@UgyJxue@UIrVRrgUDvzU_W4g-H~h7&r(fRX z?%m1*a{s&X!p4V&{O@js+4Ei+_R5WquIYN`_6d)ztDAlMK-f>rNA5e4D#CB~D=vXMUA)Va{C$=qTb@xKsjOkM7koA>Q zW=t8}+_Gr!@DW4w=vH77nxl3tbS$)|cj(k&ZNr2a)CqVeWH-jk?~Zgx;+S^)pJVDU zw#OoFS-GqztSMpd%*=&C zEBgseO~pmE#Rfc#(UB-0@tIg`DPrqJgf#Dj#)jsWVnfUL<%<`Wng&PA8PhAn(mbQ3 zX?abH`{q&NVdCbn)T;@A$A0)cEw4zj({5ofT<~;l+)|%Ox zQh3GM%zfrFd1Z4;sj1Xl>l!*`UBVU-C#_i4*g)do&5HAO3!mHum$JO2jdhDK?eN<*{Kj*TOIsRB&CS&x z_Un?x^SR3Q@~q~!*51SQ)6A-w8e{?OC0kKd-t%LU@pY*rZTJV@>+U?{eyLf3o*(*J;P^u zsjjgmE8R&A#f5bxG8OCX6+RQ{xXHDPYd_*wKJ&f8ue{y~b){kx6gQ@G!Snu@J6XQ1 znNRzI=RUo9`i{%ro{^sS^y&|i<6GnTW;NARs)@VSp4Te>epRA-ubg)uMBTfjzHidK zC;KBd?dtnwT3Pq5(4o@ugST0?||H_9Opfho15d@ zzubZx=b6iSF=Nf1x!lqm=b6jZMDdcQ!d&CDkG4`St|6pZ>^U)Qi}?u)?vu z(A|TaXB>9-@Z7GCRD|yOZG-qc(ciVp<)sG^Tz`MWT63(r>$ipO+O3_?dxP`-d!xJV zu=fF5SH|}a_D5{m)xC$d(EEao=id6!>tnn@%&OiW(MO3f`+=P!eD(*+DdA&o^KlMD zms7f9If#BBxwbzTasET-&24@^hoUcNSB|S~0P^_Ot;ac!`5K7yN7S_+hS0``J_u$0 zvdf2ret2dsRK)nf=$?J(M}W(5%JGMwdkEn1Vr=*iMe|OCeVFFLsxbr7-iGIF zBg(eX?sX*CdDt3x?2zfB!1{zl%%k9FW6ifYIvSBvf*TFCPL+sv3^-qN#`AoSMcz+2 zRX+~#?FjoAu;Y4@8EemVwn03XXkxkk#2lMQecf9Hy=UXzBIdZH?}OcZIj>ybLZ57I z^Wj}lw5eAh#tCs9{}*wbG4kS^eOZxb?Ot8?czX8{=db?+WC06zofE;XLr(um^xk`U z?Z?x*p0HPfwac4_$@In~TsHm$`ZkEX@lH&-K6|o~Ptfm&_Y``uK2z!aOfU!PCnddt z-Z`exYjYpks}inA`pHR;@zc>=qx;f-M$+9!oK-crQ=77VCfL~8kHO!w_U_w4cYU_d zJC)T;H^+Vk8AH1{?25Psb#vxtPw3jcZ=str^T%>Be{-fy-SxVzQ;8TN%>&nNU6u%82Mn7e|0QNo^C2^q=k)`xLy*2_Q97So$k zYh(%HxrDy7m0sIQKckg?W-Gm}m0sUUZ)l}ACjB_pW4$j!JV$kNbQa<{z60AtZ~GV6 z&!=X@{n(FV7uIkKVjYOT^S*v&hVMCG?U#^4$F4veFCXJqg7f43 zjE(W7aexKDu{E3c3Fx(tzzF>Aoa zh%uLg9U~uOt^mu&+@A&;$2DG*_ID*%KW(w@&wyRG`-}Kjf#vh@uSS=T_-nz&mS2_P ze-`W<+QM%g*mab1R<4K7q08$Zd%OlL{|#atME`k2&U4(g>hiAL`uP&lAF+%orKX3hCt zU5`Y~jRRYA*2xXYwlS^$#>Dldcl|ff+g$&R^j}5fT(9^t##tjbBj#c?az*04miSfl z(^*Fa{nrusMTjkYZvn^n@VymI-Z5>EnCmvMz84|ky8$fkn6`-fYfrxs>4=PBFTP*; z#XZ~vj-1Q~$346qtj)K<+}(kM-vaQyNaXJuVC|by{_X_J>EoQfp%*56CcUxE>s|D= zc>gwo&8fZiZ)&8OcVm7Fk<&*Ub^2|v^*4_Br_z51aUOZs=-GT1k-sCY@q3ALoO6Aj z-sW7|?ndrGoJ$;WegHO3%ylo={pIKSA-a5=>wRFy$;Z9FA1vP+vHqRkxtufRdH|fC z>qqFV=XwxMKIVD|`~V^!aefTeC*Fjgfc2Bl&+QuC;=Ik*!-#8i@A|v0*z-@p)=_@X zThQegh9(QieD zBgQ=#(RTxP&wV|PXgBYk{ZE)z{%1+o9(DXgjyIRyrJo~lmm0w3yHvg-zd-MT7m?shK5&M^ki#u`#dfbs(@a>3s`xU({?#Qpf=EGk5QyOXJ)tFBsa{7qljywZ) z&vAy&f}KY`>SP;OKJLhKU^(~WT)&~WIhVHQk>4WDC5|}10~;sidI9YI@^k$jT|Vme zMX=-K*PPCnxN8LUs-k(a^x$>-;G z4RJ^Q0(On=U4PdVd;Tlf`pED36?FNyBd>zxjAMRZqqmt~ZLcG8?pf>|vHsR0`8#5b z=%cS|jq|rx54(NbkvG7@5#xGC^o=|6H?Vf|?%4xybaFZodeJv=iPY+(H^n?nYexF{d`$UA9rU7IPT87U|Zas_rT`K z-hBT{Bh7pp^WTV^KH|7L{{iof#M%BA>^$;OKktL(xjEf;sE4Z6*_w6#UrA5ns2_oTO( zUv1qHIrl8~?pS~8k^J4UM)c9wwZ{3|tB2h_?oJPUy*tMB?&uqLq$iwq^Payuz2LkP z!N=X%3tpS!qP}~BGai5Uwl})Xy=m)%$hmH@>ukcVF0X!5((U7SseQ0{Pue1WckW5Q zFWhQ+ZE?nZ!JkXExC8y*v4KiF~d#+e3p09amKp98^i){<|; zLEujG3;Dd>gZ^N2IsI(zWjFdm(6zM#H!#+{9EvUkx@-c1**m3;q7 z#*$y1xZz;=qp@F_xDn{`bKtH@+(>l!!{IJY+$ePU(QuK^qtNAT!5y7A>8_lIdm4?R z&MQ`Mj4|bp0q>sd;d^Y(*I40u99VztRm2_1xG`Yk>8Jhs#61XpY|^`fJ;Mrgn`fwP z93tl#iv8PzIU5f)rovCwT$i>9iE|J7MP4R?&58E=()^RauFLtoo%bb0rC3KG7R zaIQb^I~iR*eB(?{fHRKvIKLCYu0h*0Zh?9E1lT=jv({a+_t#pDecSss=|3g;TfdGq zC+=I@R4_l;-y-#kb2=&Uow1#Y#C@6uug$rt=*_Wx%ylxjgunAoM`k2jPq=EZ@1M4r z$+kJ=^b~aM#($d~oto^pXXmPY79#JQ;&_K0tRg)0*ai9TYQ&Ug6>-Ep0_$*@{@8@!KdGD3_*P_*}&qv)c;d2q#n#lVc!&rU%?lv8KF}N$eHSc$G zb;rg1xCHF|us$vY+oGmFh3-1-wO^L(QNL@@FHb(=sGlpq#*O-o`uQ}RHs4M6?R>^J zM%3(;;C#(~2HobI+O9(694C%BuLghIoNM8=@$;cMjo}*HldyU<6T)g9-XQiT5;INp@_UCQrM*T8Gj?_~7P=lu3V_ndqmzW}c- z-l%JHehZVIZ`2pzwT0hxIlr2m-202$wwn++$BE-J=&N9JHxS?Wo$2Nr7vJZ<1{c2C!}sf8bL9B&y(Rg| zY4?0%Zu|KC;a0G}H@FXDyDn|!{Wh?1vpu%5Z9sR;+FY08;=ATXu=db5fsGY!$L(N! zW-&*6?%#pVPxkM^+Qau7;635B2X`mf?~umuJE(Pf7g*l!Hfs{MIqA+HW4{U3S6h4s z{1(`8+QRSKV0k6{z5~`zTUWjlIq!GD{P6FF{CyPQ-OwlY^}S^G_X~Z4|9;}T!Mn$p z_inH@$A#}bV1BYYmiPSuq&9uyyX(DRV`y{j*5ME7ZPuaZeIFuc9g3aDclUlUKiPLO z<5)B6>Gjh;K8qg!dv_I^o$vjH#5c~5AoPj1??JG>zJ0+xgsz`0xF07@I=G)C&iGZ- zrSHbWaE{ksyYXXfKLu-7Y<7;lCe_3i2z`{u`6FOsC~?-0g5~x1_ZRo|7}&gMi+EcT zmyh>2oV+y}V}FLOk2Y)8cu#-+`SHRj_!iS8I}5%-s1 zV{41E{S}y>>}<8?&(<@J@6o>oTL;#KV?1}?c|T8|0$Z=A)BAatH$K`=-1Bw)v)L`x_$Xp2YF{&fmf2 z(%%E(-)`STm-l>(^$&WRv9!H~$QeuQ`9;3u)jcci&KY;?ZLoVYAMt*?1D3Z1_s_&h z2lsB`^6$)haE{ksyKz^OGi&ExVCzSp{Cc8>^s%P&an1U>R%_4tvZl;|HuIw`?u|9& zS;W1G+BFA`x6b|z_H$d?aC-A(F8@PsGne`_f#uAVeY|h~1$$ro+=@H&KDzuMxX25` zvOV~AhhG~w-ym&KgKfbK&1z7)vEp;M9lD>1`oufE6WH7+Han;tXW1S_AIJJO%*56K z9B;#5bnl3@+7VuxdVBOv;Ewe1{kSu_+547Z za|AxIo?YOz#s0g2-M@T%PVWkq4~h4GH#pbf-}s$hziE6Ix1M$fn=gHKLU*tJ{^Hrh zn)kq_z4e+sci)pevAJ*k;*7h4J6-um8$-e!Gk+ZU0uzQs}BeZkhnk@&`X`k}{KeaH0i z?#6g~@0T^zAMAMVjN>A~ko#*yn-p+G3vvfsG;W zJ`bk1xle6}Aad?g9Ba>a6=NOYn<1SDEe4ij?pJ($4DjVo`R#2)Oe6MZItjcM)Z@BX3|CxWd-ec~)8f#q$%9iO=T`BWxO*ZA%~ z8O8DXYqtjD-9G`{cfW?Ui+%6)x4Cvd3(bG_nMl@;GV`-O?!PT$+_(E}xvXmSXKori zuWHC$XOzx;^~Lt@&(pWv#!X}AR?b;`{k^|_Z|b*ZJd*y)!7NT|n=^m>e|T9~**N0e TLqGDLNKy$gqdWk@PsSFe5!NJQrkgBp68|!syA)z<~7R z0I~`kP1>8!X4$}V1b+@9z4GTka|EYT(*p1K`waRF+htT4tpz8yUeG2b(6QtT?Dhmq zj1oHA9K;5-hlzpoV8@a*u-nDbr+ln0OzQ;PE`kA%k>9c84kGOWhdfDH9!mxx$}UDm zDr6C&Y+@p#Aj6VLh_s7fY!Q`Bh_nnGUD}h+W;sm$bm0%IY?uF~uRdA%=QjlZs}_f- zzDi{3zutIIPDv9aJ(p}ln1;pls;`V(#tMI?gG{#}zvdvx5`rO(BVUkY3Aq`9cuTAW i85_yV3Z&S<)aXER-3Q48q}f6+Qg9`I(yReTiyi<~W^Q!= delta 196 zcmaF4K&|~P%LXMD*4jDU$8T&_X9;3tbIBA=@>IduKZ`= zGc(JXwqN|n_*`)Ef-LRnH@~ diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance_dx12_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance_dx12_0.azshadervariant index 816469ec2d30517153e6ed2b9838254c959f637d..74ce89a020c11e99ed1d19badbd86a070febb2b2 100644 GIT binary patch delta 16 XcmaFl@yKIClnO^(R_85l1_lNIKC}hl delta 16 XcmaFl@yKIClnO`fobKZ{7#J7;LhA<3 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance_null_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance_null_0.azshadervariant index f352a375d0032b1648ccbac3e12313e2527f8a71..c2c98c19dc4be5541d870eac0dc4c879231d54af 100644 GIT binary patch delta 16 XcmaFH{ET_SJw}eYtj=593=9kaJMIO* delta 16 YcmaFH{ET_SJw}e&Io-!^FfcFx06--MtpET3 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance_vulkan_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridblendirradiance_vulkan_0.azshadervariant index 8e4364d56b6791a5d27fb4429e0c97112a8a6a9c..70bbd8fbb0f4e82f23b0932016cfa56c71c6e7ab 100644 GIT binary patch delta 16 Xcmdm1x~+7>IxCL4tj=593=9kaLhuGn delta 16 Ycmdm1x~+7>IxCLaIo-!^FfcFx07oYWIsgCw diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridborderupdatecolumn.azshader b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridborderupdatecolumn.azshader index f733a5613775353a67c84b00a4d43d806d9ab42e..c191496dd250e01dc5ba833b78e9bdeead9ba2b0 100644 GIT binary patch delta 176 zcmdmgopJwl#to`0taVwP8+tcuu>>))WjUvoyXH(T)K}g-m*+6+|>$00kCua7d`cdwpvzJG=RusEy#}Fwabw pG}x9ifk#;M8sVjDUXWZsd@) delta 16 YcmZ3byh?e)B0-MYIo)6GFfcFx06UrndH?_b diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridborderupdatecolumn_null_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridborderupdatecolumn_null_0.azshadervariant index a8cf6ac19e10dac397979abeec1a6d8306747ff4..e1a4be7db5aae2b3e71ba3f156454d6ef37615a2 100644 GIT binary patch delta 16 XcmaFH{ET_SJw}eYtj-O+3=9kaJtPJg delta 16 YcmaFH{ET_SJw}e&Io)6GFfcFx06`W8-T(jq diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridborderupdatecolumn_vulkan_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridborderupdatecolumn_vulkan_0.azshadervariant index 6e7324191f5b2c28d9c13d4f7ea093aab6ad8607..fcd71ca437ea652b560f1810ae069ecdd2c9e4d5 100644 GIT binary patch delta 16 XcmeAb?G@e7%EeKa)w!XUfq?-4F*OA` delta 16 XcmeAb?G@e7%EeJTr~Att1_lNIH75oD diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridborderupdaterow.azshader b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridborderupdaterow.azshader index 9e2e426ff43495e9c54687bbd4408d30484c7900..492150e17cfce8c8cbf42849378154219ecf4c1c 100644 GIT binary patch delta 170 zcmdmUopH}~#tlj=taVwPTdr?bX9;3t^9qmja`N3=&-#fC!G6ZNIaX*l6Gzi_xycta zo%U{45DgH9N>8q5Ro*;P<2+0`lz$kah116OO8;>eW)p_Zfl=0in}a&-PKEVJ0 delta 170 zcmdmUopH}~#tlj=thIBxU&n1$X9;3tE6EQGc5>NV&-#fC!G6ZNIaX*l6UV%zkINn0 z*1z4XAQ~VHm7ZMBs=Rro#(9`>DE}}-3upG`H^$pl6gM$!4vexE+#Kwg39|#N@MPdo d*2${^z9AcSGO&SzL&_@8c$HEd6Hr^WAOL*zKI;Gg diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridborderupdaterow_dx12_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridborderupdaterow_dx12_0.azshadervariant index 3c65d8d4c95fbc4067198366c4bbd2702157e4bb..cb64cf494543f75daffcaab7293231b4fb66443e 100644 GIT binary patch delta 16 XcmeyQ_(^fYD*=wWtj;ah85kGl0@@apI-rQO*D6J8(dqQgJ^_2Zy?%GTZ)X0uf6V@J_Svts z)?UB8_TFpdKoA6xbcFaX`lbZ*iP`$m=^y`f)7lHxn>FvuC;WNw2Yyom!o16$HcXqo zX7zr^`bA~lT*B?7l!Rj{X^ig69Y3pFE+~?^w0-L&xAhx8coN&RM_(d_Z@ka|z92=# zE&gS-=gHq%Dl3+JYxGZ}zogIhFRIXg^6{*W8ou+;+UtA$A9uZ5&NOi+2wuyJw&%2B z|NSs1@xA-=9vM4ytUnJ)I%_f$k4Hr-?1AX-dnL|8^RBo1(%0NO+u3;V*X0q#QDV`1 z3y$^v>0ZswwM*(hDg0#l=2>q;|LayO&Xyqf^g%#f$I`!CDERu@IrrB@On~@pAJntd zF?R8vhEAo%2fl1CTJ9{{`%Pleyd_tcTTQ%_r}vuoE~K%t&cFQk$MfQ$q*;Ntp1uK0 z641z{)ylSfhm>WHCWz{gB5d2Hb4#}1qEGy1;>Nu9-{$XGaZ$W;XjTf}D_j;P$)&Fy zKd|RSeF0%~yXT#aT?7EG7axLP@D2h`6nJFdNe53qct%(dv@$Xpqk%GH%OEIv;}i;g9NK{($>Ob7~-nC}Wf|2PoBRHHUo4xo>!a;p|w$t0wO`>0InicL~ODv9mR_zl<+m2JdPI$dMFx%+aehWQ z4^Zl1GxfQYeP6_Rf^v%G>_?;QK@letf(r+z@&T$BEeeT5lnaO$cvZN1v3DKS*?WBX z7tv4u=2RhE7-nz28Nug~DGJ939A7*|#yftMr$FO)?y=h#QT77<;?LFlZ$vqC$Jz%+ z?8X`(lMiKPc~#}Xcg5E-4%5?*R(UgKgo(pCXd*hYp+o9OSrlluXR(4Kd@);iqHW0e zTonU?l*v0F;r9my$2=biXD%l1QwXKl6nF2YLtYh!yqdh3E2RM5@+(WS1-yuO$C7czF?6(Pg5kkCP08*aU!Knj2Rt0Z ze45nl3)Ds=K{zEMdRSz3C3pes9rMj)h4Qk1^s=IK5-8h!DrIMNv$ud8;%vdF`9^91 zO3l)<^IjD;8>ySS;qSTBO-5>-9Pa`H@R6WVPAxQ2H;JfOayIDN0>*U1!@o0;vq9Gu zFs2)RthDvoc;YR_ry?5PZ$&uS$bt-hko*S-Dh;vw+rh^wnl@pq_+lVq38Gh<5WQmsv{Ne!=S~ zlMJEY?KjPU@OiQNO1j6AcCutClZ$ax9X!apqLEx7CmWHahqzS6VOB?jl5yOTaRMSS z8ZZ*W-zX(90*tvNMvzfYVk|T^lNce!ZW1HZI7(tjjTnWIV3blAtBguYM}TpJl5QZN zsj#w!53NXp()SWj1*}wqbEybuxDgnm3n^9~NpuLGkEAdQf=MT5@2Zd4T0q*HXCjCj zn8Ed1tG$!G8T-6n?lY;1d}9ijDKWRWWCtyAAL`fxD^L$w$r&-mVx$x}Xp?VaDBV|# zj3}KG`uh8K_uqQwj`RNhdfDCt*|gfEKG`jD18YA$Oq|7Kt#3{CsZ_ASZ}@XOo0?6g zS*Fu}K07za6nN6_5O$&2uCqD39plE`2oaE@_MtwT%`ETC?ChnFA8lOvL;A?otQ~W@ zs+Kif>pC8rt(GPTxSC_ElxC%!KTMImBs%e>A z7S_krT3`!TW7qn;%0d>NBrTIF3JO-{uV0(BHa9;fdEJuyj8uWHjkPdEBmc-kCVWhC z$;r=HpOG!747US}bk<8fB|S$jnX)kZfRTXfLbB&C9;-a2)Or3K=^VM|`EY>P>y%yO zJ@`ApX7=8*fuEl`>le82SjhQP^st6FZbg=+x=rj!z3Zx1?b_-vyI#!{#1sVAqmKQs z+sB$~?2s}h4%@BnH6IDS>nAsi0F=*JqDGCKq~#o|`O2m8+67;K7G3h-DqxnQsU8)7 zOFb}+tHGHS9NQREvy15#!z>WYZuD-Qol*}N%bP7xzZprC<(zcOBsuTM)t(YlRc(Cj zVC_kq5!NT4d8oTe{U>Viz|h^c4*l5hNXJmeaPKe>k7QysD@I~11wl6Y`6Yuu{3{lK z*cT8tbsteb9JQ%buw~aqW{Sg7CN4Y`2w&BZLbj&jvFvf&@k%dzU9*lKr*R%%J<(MKmeyc_-O5XrIfaxVI3$TR`;(Bw)rLDV{*--5 zw_I-v1i+|*G;jPTIfb7OEI4DsLEF;)O;<~MM^iTd zqx){36~N&F;COGO*ivAafa8dXf8~;?XKzVW?Q5XS2cQgemuMbJ)wXqZ*|jw#Wvk!3 z`q_;*E|~zA_69fVa*mgc3yx?>PYM6hmCs6g0Hy(ee7O4~O(6BSZ6Y;8LoL?cmj3pR z%DY3iTX3rofO!;-+_cn_R@;xhaOz`Rk>0!g75y!3eH}n0iYs9C{>XquK(kFIuIkFAlPB#?)|OlWQwai78SB2P z3C!$1K0lolWYh%rkrvY^D}pF*r&DAG${H)>y>UvO7qw7EeP2i2VnDs#Z&pPeyVi%w zerXo^`ulm2{G&8mnyJMGG^iDpx5^*2hGx>n6|LBaWN~*oBc?#GZy$PCd|I(tqv#VM zXaiMvvZ1?dJLFd_cl7XduKVSy=K)Ub&)w^myc4j*D|Xo&pC=#wnB`OXRYaM^Uj{bE|}+QtQ3W>4IlK#g7w3WjejbJEHm@xx%*kKp z^Fwd{$Z$Z^OflPCY|s|idsW+epS1Vsu`d{~|1O66c39gV`AuPK!Cnc|ZT7B>Tin3Dv!A)nI+_HG=I#$e?H$8M z$uf69djT8+XyCcP3)ls~!ZeE*`b;v_FJuomAxt4n=llaNm}aS>3IQ+v)=vr=!GT{TC|y3V8~+)L!2ME>}N{$JXYAW7R%IY z4X$Yz#WqYM=prq$N)}a;7Ikf|EX<{DrBREb%5rn5TXIR8Hkak1W&AE4`;i{^fU+^p z{ZaO)ls%8zHubL1wNE&;MKLW6D-XV?3GS9GI714#s0q=Mg1bf?H_546)2V^!W%(di zmgVZpa^=)bUerzF6u|aSrpVWebhgX>U(YnLtW zSGaZvUE5SsI~4FYddUK-WP!n!pKlG?EeX<*f_Jyh1wwyS2j3(GH@C9dgw*0((iX3> zP0BKUkAyuw01u(;hXe3)E_)34aeB@ZDd!ocQCSJo`$f2*7R6M&fcs#1;1XU6-cyWJ z)pY-mgUcU0%=r)Io-e;zmu#2@6W4z;J$lQLx}Tn1xai|XJh8auQpnLSADBJp0VJZz zEGLYM2dH+}AFh1y;?8d^4|4JnU9PQsFqp@u?N8i3^ZVM>?Kl21cB+zg=C`QlV}{@A zNcA)OSTr(G6CgK0y}8Hfsk6}N%+y~WG4hwW#fj!+CB$>9r;1u11n-=V+Hn=z^6s2% zw%hY0n`uTY!fRF@|Yo zBdZnT`jT>Qr6zf^&g zs_ITb8b6jsfxuyL!b%G^GE3u&I8JFp06&)IXk%&T!R9i3adu-xt)Y16EYFwKD%EX} z!l!n)OfWQ6d9O+y`|wVrR)Itco5g&udN*1{1IvnKw%L(cZrt|RRE+(I%YF(rD#|=3 zVm?rEo=G`lQg*(GQ7q>?z}U}5!5*Lvo7qpmabSk!BI-5>-lkOVG%K_g5T%s5B5#UP z_Kts`31YX(5nK}mavx)nivCHIV!ZgKC`A?h5X1sAb>bf!A>eBM%ftlO5FN~BGRdtH z=ylJYKom{(0MDL8HcwU{$pI=&`KnSH!sFUPWW0e@O-J|os0 zrW0Kf9JGYnN}q(&J`zeM?YJEod)G`BLjjPWG~z}8`A(_A8srkE$jFwgbkO=6J!q0M z3JAZ>eGc+qK}8n{^OY;wpF2ffet6>QTXv7DKJBVvr?TFP-O-bo%e1d1ezNCtqSmWgXxf3ZazUc+oW>QS#)Be z5=C+|^}g$K;S?-c51}+TNs!KVF%tNd2m;a61O@dSm#*+8i?OmrXCZ*$vU~`Z2r50u z=5#ezhU(=0DsC(-9P3w-Q?X8NxWz|>Nqvjq1!U5c)-;0zOU}jFelzVb!2xchTd;oa z2m$HxV})bM-FQ!@R}*0fF1Zh955U>jJ}&DtxjmOuO_gJvQUuJA1cdq=?S@ynqVcY6 zV%IiHdKkCM9wAMI{Xm?;T{HD)sI1gZCqk5iG@;uU%+h8fLAB@zq!}z7;F#rggIr>x z5AUXvERXn+!a!M%9^`3AkQlQjHE_%jC(?na2uh}DbLxa*bs}+Hn~@;mvg+21YW%n* ztz1ex_#tsLWe-`1#35Q9i3(`b3kiQauv&Nc zcBvQXuj^De*x|!^hKf>*PIn6zhdPZCijQ;HFJlAAhxC11>t&Hpx09kOj&)RzPpp=h z%sI!MEIM*dzbek;oNkt(*7a>>2xvBAi?O7g7#4b(6)UMiT)`rX1334jj8T9+)JPA* z_F=R}dYk-=sO|Cwm2T%PA`bvY0ZJQQDyG6hL~E`H3w5IXbkbbClU`Mv**r8axfx%{ z8&PeNXG!#Y*(h`Dq#Sg9Sez*vO0h!ICGa@nXTBU764U|~&3wea- z;N|t|nvIlWnvzzf1_#1>ymnV!qBvavFSuC^fUf(u=W9avpmA*|@-lIjE z(dz5zEvQUsUGLw3_yqlqMUpl`Vec_$&_-7xJ^*A(xO1{NuD8J6(|2M=Tz^*^VYCk* zKjZt#fQ4wjpVJZM&aRb~FL9sLtc7{nJZGc3v3A0SH0$Sf%*dq+h%YBOo^j3?w4YOb zUK=BFgPA}%?5C2|x%JQO=kg{N*7DRjgJ;#+5k4q&v)@bm;``G5QuUxtk%c<5FV{aHI<}jSt z*Hfs^cq=A3WL0B;cgOy|uZ>c>5@XJ^+(>o4H6gq9z0Zp26IvbFF8^!>nhOLTzV_dv z)HnV+)YIjDeSt|D=Pyoelgh3Mt5<5Cnj|UyB>wzNlXqugJGplXKr|qcmG$|D4G1e^ zh>Uw|{AR(a4xaT-oKH{6iCp91nJ5Ib`sF2O@h8UTj~Q}CKiYPB@%%sjt~DNx4sn*N zE-imFsXyL*_Ue+={uP>`3>1r=02#};E4Flc&VN_MEf)LMCilhvfCS?88w?k{M11U* zKiQNLX#VS1rN4N@%xjUA#_nhRPwW&-{`_deOe+qkzZn@~G|g{*#uAv!AQjjh%21ha S`cngok&Ja&oe$;%^#K4OY{sqt literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe1008_vulkan_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe1008_vulkan_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..a2d1bcd5e37b653bfe2dfda4c7f0f0f719d33c11 GIT binary patch literal 10274 zcmbuF33Qaz6~`xpeF-2-*bD=RvM92JO(6*hBp^#j0|@ zNL`gO;mHH71{}yqTmMDJZQn1RxqIIm8!pXEc_3?f-&O;L_gH=O&Ww)Jrrs9V_vG4z z7p5GXURtt!Md2l@p1Seaigvq0(_gywKsfi{`uWR0A9K&f_1ERpef{_~imOpDHtVaY z=k5CUvuoGnzrDGCd4m%TdiJkgvwp|6?k{d=n|@^GE1UX%_R?jm8$I4E>EQdj`pWoo zz5lyeV9JaS`+c(c#Z`?TIFh@6Lv+f$1*1Y|DfP#%<)$C$_sZTr4W=D_WdD{sz8ybe zSwT+rjKSMq+j@Azx|#X6?x@-^eo6OoW{*>#F`n*t8NV+t6yO_E0SY=fxRyBN4d3iX| z%iHjpkaFMrgecyv)kI4@jTnqN3k7^^_X zh$kX*A~CSK9>$sz@v2Z&BrY_W2U~h$t19||zMkhtA1mUE!xiCJRf+nesUjwI^w;w( zUJxpc#O5S*$$a$F)8)n&#i}Z6eCVf#k6TosMph<$8hW|trRhc`5}~q4C{`LS2`>pp zom~UZj=q{*UWCq`w6fY*n`cu{U0D@QgexP|P~Y=!Xu7eXC91(f)YRC>^yA`*icoZT zBy_U=#-^JT319AM=tr`yCZ@B9BbF?P$J99Cbpy#YrkRazfpb;f+<3H1sv5hdW;a|L zIkzenuBm6&0am%w&Ds0nc`LsC0h0POvYc)u+cO zX)`tw8<~j5s<5;5NM}84VRpr(iFhR`TG*TWp%`Um;ZOkrNZ*DXkN(l094Cmnt zcQScfJ)7D;cw6%IvT!drCmlr0xeLtCc5}{oXAuKE^G@C@Ip?hV^~}+8PqC*azn(dI z?kjq75tIEd@ZI|^nllU|9+=;b7+^t>*|8ol9#_Ly6Ig#A#=Qp1_F>ckHpYjs9*gJ#=lrtsw z;!JT*srx)})&WM{-Nf;sZuH&7Q$*m*d$>6^E#%o#ypycY7e}_WULZLrVy(TzsX2+& z4qPai_XM1ry~SA{bujNEPJHI%>?@8vF_`xgPwJBM{%%eT^qFpM_5<9UeqJO!d&L{a zusQJ=%;^bl7CD&H1NxET=JbGb$-KKXoVkG_J3E6UFCCasbCw2ct}&F_hDabT>$6^6 zB$>Nq^NS_d5n(@69DB}$>4!S7b2KN0>4!^Z{Wi~)%w0{|G$>`0$ zNHQ_Nm#H4=FBXB{uN<6#5)o?xrw0?o87E|qZjuO$J|G_#r%%kmnP2MW@MG!;wNDn& z2W+N@rix5AO|t2xJKZi<&t;mUZzcLtHOz2&F|Q`{GezLkfXv#+IZMP^3Kgrjct}L7 zSt5GG`J64{9O2VPyi|l;j!@2dnaKLf8OM*lg`JKbl}l#WIhiAwTHxE=I_65ohxZcm4axV1b({m<-qe~I_a}t9&Ya$lhucx+SdabFuQbg^nk$B|gGZmj4^{TIUm1v}h zy&9&vnd3+AiLpoo_L%GKVuulDoBGyF{BjX^3lV4QD%pZ__Be~^sgZL?&2Y2f43ZmP zY&gf*aK`LxEs;E0#5w6FUM*@UA{TETwFbqPiqP?1kpD*xqlbnqa~SWG-PPriu|>DW z`CcKJyy)!yUMU%TrL(z8@~Ji}gn@Gp`iNgG!Vf&II_c>(BKmTjY?xo`u)*T2G1JqX zTw`0!Z9lGey4~{4ki1faKRD-Zl{kZQhiqg1+i(cD)tdq>XF|7CNC1Z<@I)dUq5rOB4 z7-qXcvc)vpp9%xVhrPFbzDY7M$!|6NOfvrH%>QP|;KbpauqOk=H;U}srAww4UBz#4 zI_!o@-Xt(MKYMJm2-2Kh<)cQQ^T)B^oz61{BDO)+ttE? z;#)=RaVL@a-Q#fc+om}_;5WKh+a-f{7G2}89g@j`&fea8CDSu{eUIwO5Wi0Z&Yiel zoWY#{e?SDr`9vPCZ?n|CQ^X!Yj1&?3f0J@I7T+bp2IBmJJt)GSyJ7eFA%~-*ZtNZw zffK{l_iM?l2c6}3#9`#Hc#ld3?;WH zkxY&LxO+6m2c5-zLNc+@aks5^aK2ZN=SdNT&QZ)?t8 zq2qkmp1|#V9B?+A8SI}IVf&6a`vj&+jpHql1Ga0=gs3@{z-I5WZ!QNJFJa3XYNCB2C>l{5rGjKnKh7~IXG|Z zQ1L&D8j4s)j);6|;(rmL!>+&hUqxm&Trzge#6NO6d$T|G+2uOB*5ZE?p|dyp?+!~B zr~XgG8TNhoQ_0i{zuWcnGs#;-_~P@qID<8#`$7bUA2RPcHU2|ndtu)N|0&G&2))@J zmCTyhH?#ehWNg9E(@V<(xASmJGQQM|4>g$XOUcxLj@;;o&sq6OME&IGD6;QgUrWZ% z=Eo(I!`{UclCc>iYOGkClW#=a1@;QP*?udzsR+Gc-%0KwA_ngp{{I$%HxaFJ*!ONu ze)A;>w&?7$BSjc~=*+H`WN^srQYB-DuCYGT$Xgp5@tz{|ZN#y$b=7ft`h%_Ebsf%` zWsR1%o^W*dnQeV%OI*Kg1L5efEmR-7O5ad2G0;&v=dF=AgY(9oHP#%A^M*_we49wt zkN0m1#NoVfzOlpJ-mo;u+%t%QPc6}vicg%T0d2C|-~OC|-y!^w$_Kj-D0LcgBgU(_OlVUmf7j=RQtktNycw|kW>44icumLr*c0ki%Om#iP}-#gL!`=6^h zaj>ymd6I2i7I%a&aMo|wNXg^^vt0R-_2cD2@6T1BIdQPDT%#o0dM)l~Vc_(|uuCM9 z3(Rtjk*pst7kYoLv6>SH8#`CyB(q-XK>x6M%V+d>hjZrmEGX2R!Dj)w2_i7wcw~M@ zXHSYGcMvBogZIMh;Pze=OU8yb1RrA9-7S%fUOzSUOwY0R6gL=?iDgvV(WUFVg zWa_ba)MIvVt7nR2Y^V_*Vpu&>C8OtFTYsi$4sP{Km&~9ZbeD<1s0Z2VnIV~aEFSfk z9o*`fDH$7T#D^GG&n(I48HR-%25i`Dhb7;m)?eA8hRGl=*bzz}DW9u;fGX z+2hVfx#nQ_a6aaUGgv>mxgs#uk4&68(nloM6Sv=Y=4lRgHO?CJiO=f!!ssn}KL5=> zsyY6piiV6IwhVgtfjBwI&HOz#huiOT{O)p4#Jh%#{jP&A{pb8w$e-_C=mv^d1M7^r zT&xqD0_niW3AZ}qlKtykpgGv7>s%;|?`P=!>r7~F>qN#6TLv|gmz?nLw4;OA)yZf2 ze_X2Z;g0)O7OuGA&R#PLd+(eVUi#_bI^WO0Hg)@stm*kv%WvQF=83Tn6~EyAmzEdj fR2`Ym{GZ$c)$z>Z-A?=OXgX+D%v*iv4*C5DY#YYx literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe144_dx12_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe144_dx12_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..cfd9468e32abe403d1de23d24eda737e4e772e0f GIT binary patch literal 6994 zcmeHMdstJ~mOpu&JjnwPP6+CW$U~%hKm-)TgaCqo2BkJAtqCB4@`kaZRPzD?1q~<| z#cB}sQmeiAs2Zzn0u&>l0@@apI-rQO*D6J8(dqQgJ^_2Zy?%GTZ)X0uf6V@J_Svts z)?UB8_TFpdKoA6xbcFaX`lbZ*iP`$m=^y`f)7lHxn>FvuC;WNw2Yyom!o16$HcXqo zX7zr^`bA~lT*B?7l!Rj{X^ig69Y3pFE+~?^w0-L&xAhx8coN&RM_(d_Z@ka|z92=# zE&gS-=gHq%Dl3+JYxGZ}zogIhFRIXg^6{*W8ou+;+UtA$A9uZ5&NOi+2wuyJw&%2B z|NSs1@xA-=9vM4ytUnJ)I%_f$k4Hr-?1AX-dnL|8^RBo1(%0NO+u3;V*X0q#QDV`1 z3y$^v>0ZswwM*(hDg0#l=2>q;|LayO&Xyqf^g%#f$I`!CDERu@IrrB@On~@pAJntd zF?R8vhEAo%2fl1CTJ9{{`%Pleyd_tcTTQ%_r}vuoE~K%t&cFQk$MfQ$q*;Ntp1uK0 z641z{)ylSfhm>WHCWz{gB5d2Hb4#}1qEGy1;>Nu9-{$XGaZ$W;XjTf}D_j;P$)&Fy zKd|RSeF0%~yXT#aT?7EG7axLP@D2h`6nJFdNe53qct%(dv@$Xpqk%GH%OEIv;}i;g9NK{($>Ob7~-nC}Wf|2PoBRHHUo4xo>!a;p|w$t0wO`>0InicL~ODv9mR_zl<+m2JdPI$dMFx%+aehWQ z4^Zl1GxfQYeP6_Rf^v%G>_?;QK@letf(r+z@&T$BEeeT5lnaO$cvZN1v3DKS*?WBX z7tv4u=2RhE7-nz28Nug~DGJ939A7*|#yftMr$FO)?y=h#QT77<;?LFlZ$vqC$Jz%+ z?8X`(lMiKPc~#}Xcg5E-4%5?*R(UgKgo(pCXd*hYp+o9OSrlluXR(4Kd@);iqHW0e zTonU?l*v0F;r9my$2=biXD%l1QwXKl6nF2YLtYh!yqdh3E2RM5@+(WS1-yuO$C7czF?6(Pg5kkCP08*aU!Knj2Rt0Z ze45nl3)Ds=K{zEMdRSz3C3pes9rMj)h4Qk1^s=IK5-8h!DrIMNv$ud8;%vdF`9^91 zO3l)<^IjD;8>ySS;qSTBO-5>-9Pa`H@R6WVPAxQ2H;JfOayIDN0>*U1!@o0;vq9Gu zFs2)RthDvoc;YR_ry?5PZ$&uS$bt-hko*S-Dh;vw+rh^wnl@pq_+lVq38Gh<5WQmsv{Ne!=S~ zlMJEY?KjPU@OiQNO1j6AcCutClZ$ax9X!apqLEx7CmWHahqzS6VOB?jl5yOTaRMSS z8ZZ*W-zX(90*tvNMvzfYVk|T^lNce!ZW1HZI7(tjjTnWIV3blAtBguYM}TpJl5QZN zsj#w!53NXp()SWj1*}wqbEybuxDgnm3n^9~NpuLGkEAdQf=MT5@2Zd4T0q*HXCjCj zn8Ed1tG$!G8T-6n?lY;1d}9ijDKWRWWCtyAAL`fxD^L$w$r&-mVx$x}Xp?VaDBV|# zj3}KG`uh8K_uqQwj`RNhdfDCt*|gfEKG`jD18YA$Oq|7Kt#3{CsZ_ASZ}@XOo0?6g zS*Fu}K07za6nN6_5O$&2uCqD39plE`2oaE@_MtwT%`ETC?ChnFA8lOvL;A?otQ~W@ zs+Kif>pC8rt(GPTxSC_ElxC%!KTMImBs%e>A z7S_krT3`!TW7qn;%0d>NBrTIF3JO-{uV0(BHa9;fdEJuyj8uWHjkPdEBmc-kCVWhC z$;r=HpOG!747US}bk<8fB|S$jnX)kZfRTXfLbB&C9;-a2)Or3K=^VM|`EY>P>y%yO zJ@`ApX7=8*fuEl`>le82SjhQP^st6FZbg=+x=rj!z3Zx1?b_-vyI#!{#1sVAqmKQs z+sB$~?2s}h4%@BnH6IDS>nAsi0F=*JqDGCKq~#o|`O2m8+67;K7G3h-DqxnQsU8)7 zOFb}+tHGHS9NQREvy15#!z>WYZuD-Qol*}N%bP7xzZprC<(zcOBsuTM)t(YlRc(Cj zVC_kq5!NT4d8oTe{U>Viz|h^c4*l5hNXJmeaPKe>k7QysD@I~11wl6Y`6Yuu{3{lK z*cT8tbsteb9JQ%buw~aqW{Sg7CN4Y`2w&BZLbj&jvFvf&@k%dzU9*lKr*R%%J<(MKmeyc_-O5XrIfaxVI3$TR`;(Bw)rLDV{*--5 zw_I-v1i+|*G;jPTIfb7OEI4DsLEF;)O;<~MM^iTd zqx){36~N&F;COGO*ivAafa8dXf8~;?XKzVW?Q5XS2cQgemuMbJ)wXqZ*|jw#Wvk!3 z`q_;*E|~zA_69fVa*mgc3yx?>PYM6hmCs6g0Hy(ee7O4~O(6BSZ6Y;8LoL?cmj3pR z%DY3iTX3rofO!;-+_cn_R@;xhaOz`Rk>0!g75y!3eH}n0iYs9C{>XquK(kFIuIkFAlPB#?)|OlWQwai78SB2P z3C!$1K0lolWYh%rkrvY^D}pF*r&DAG${H)>y>UvO7qw7EeP2i2VnDs#Z&pPeyVi%w zerXo^`ulm2{G&8mnyJMGG^iDpx5^*2hGx>n6|LBaWN~*oBc?#GZy$PCd|I(tqv#VM zXaiMvvZ1?dJLFd_cl7XduKVSy=K)Ub&)w^myc4j*D|Xo&pC=#wnB`OXRYaM^Uj{bE|}+QtQ3W>4IlK#g7w3WjejbJEHm@xx%*kKp z^Fwd{$Z$Z^OflPCY|s|idsW+epS1Vsu`d{~|1O66c39gV`AuPK!Cnc|ZT7B>Tin3Dv!A)nI+_HG=I#$e?H$8M z$uf69djT8+XyCcP3)ls~!ZeE*`b;v_FJuomAxt4n=llaNm}aS>3IQ+v)=vr=!GT{TC|y3V8~+)L!2ME>}N{$JXYAW7R%IY z4X$Yz#WqYM=prq$N)}a;7Ikf|EX<{DrBREb%5rn5TXIR8Hkak1W&AE4`;i{^fU+^p z{ZaO)ls%8zHubL1wNE&;MKLW6D-XV?3GS9GI714#s0q=Mg1bf?H_546)2V^!W%(di zmgVZpa^=)bUerzF6u|aSrpVWebhgX>U(YnLtW zSGaZvUE5SsI~4FYddUK-WP!n!pKlG?EeX<*f_Jyh1wwyS2j3(GH@C9dgw*0((iX3> zP0BKUkAyuw01u(;hXe3)E_)34aeB@ZDd!ocQCSJo`$f2*7R6M&fcs#1;1XU6-cyWJ z)pY-mgUcU0%=r)Io-e;zmu#2@6W4z;J$lQLx}Tn1xai|XJh8auQpnLSADBJp0VJZz zEGLYM2dH+}AFh1y;?8d^4|4JnU9PQsFqp@u?N8i3^ZVM>?Kl21cB+zg=C`QlV}{@A zNcA)OSTr(G6CgK0y}8Hfsk6}N%+y~WG4hwW#fj!+CB$>9r;1u11n-=V+Hn=z^6s2% zw%hY0n`uTY!fRF@|Yo zBdZnT`jT>Qr6zf^&g zs_ITb8b6jsfxuyL!b%G^GE3u&I8JFp06&)IXk%&T!R9i3adu-xt)Y16EYFwKD%EX} z!l!n)OfWQ6d9O+y`|wVrR)Itco5g&udN*1{1IvnKw%L(cZrt|RRE+(I%YF(rD#|=3 zVm?rEo=G`lQg*(GQ7q>?z}U}5!5*Lvo7qpmabSk!BI-5>-lkOVG%K_g5T%s5B5#UP z_Kts`31YX(5nK}mavx)nivCHIV!ZgKC`A?h5X1sAb>bf!A>eBM%ftlO5FN~BGRdtH z=ylJYKom{(0MDL8HcwU{$pI=&`KnSH!sFUPWW0e@O-J|os0 zrW0Kf9JGYnN}q(&J`zeM?YJEod)G`BLjjPWG~z}8`A(_A8srkE$jFwgbkO=6J!q0M z3JAZ>eGc+qK}8n{^OY;wpF2ffet6>QTXv7DKJBVvr?TFP-O-bo%e1d1ezNCtqSmWgXxf3ZazUc+oW>QS#)Be z5=C+|^}g$K;S?-c51}+TNs!KVF%tNd2m;a61O@dSm#*+8i?OmrXCZ*$vU~`Z2r50u z=5#ezhU(=0DsC(-9P3w-Q?X8NxWz|>Nqvjq1!U5c)-;0zOU}jFelzVb!2xchTd;oa z2m$HxV})bM-FQ!@R}*0fF1Zh955U>jJ}&DtxjmOuO_gJvQUuJA1cdq=?S@ynqVcY6 zV%IiHdKkCM9wAMI{Xm?;T{HD)sI1gZCqk5iG@;uU%+h8fLAB@zq!}z7;F#rggIr>x z5AUXvERXn+!a!M%9^`3AkQlQjHE_%jC(?na2uh}DbLxa*bs}+Hn~@;mvg+21YW%n* ztz1ex_#tsLWe-`1#35Q9i3(`b3kiQauv&Nc zcBvQXuj^De*x|!^hKf>*PIn6zhdPZCijQ;HFJlAAhxC11>t&Hpx09kOj&)RzPpp=h z%sI!MEIM*dzbek;oNkt(*7a>>2xvBAi?O7g7#4b(6)UMiT)`rX1334jj8T9+)JPA* z_F=R}dYk-=sO|Cwm2T%PA`bvY0ZJQQDyG6hL~E`H3w5IXbkbbClU`Mv**r8axfx%{ z8&PeNXG!#Y*(h`Dq#Sg9Sez*vO0h!ICGa@nXTBU764U|~&3wea- z;N|t|nvIlWnvzzf1_#1>ymnV!qBvavFSuC^fUf(u=W9avpmA*|@-lIjE z(dz5zEvQUsUGLw3_yqlqMUpl`Vec_$&_-7xJ^*A(xO1{NuD8J6(|2M=Tz^*^VYCk* zKjZt#fQ4wjpVJZM&aRb~FL9sLtc7{nJZGc3v3A0SH0$Sf%*dq+h%YBOo^j3?w4YOb zUK=BFgPA}%?5C2|x%JQO=kg{N*7DRjgJ;#+5k4q&v)@bm;``G5QuUxtk%c<5FV{aHI<}jSt z*Hfs^cq=A3WL0B;cgOy|uZ>c>5@XJ^+(>o4H6gq9z0Zp26IvbFF8^!>nhOLTzV_dv z)HnV+)YIjDeSt|D=Pyoelgh3Mt5<5Cnj|UyB>wzNlXqugJGplXKr|qcmG$|D4G1e^ zh>Uw|{AR(a4xaT-oKH{6iCp91nJ5Ib`sF2O@h8UTj~Q}CKiYPB@%%sjt~DNx4sn*N zE-imFsXyL*_Ue+={uP>`3>1r=02#};E4Flc&VN_MEf)LMCilhvfCS?88w?k{M11U* zKiQNLX#VS1rN4N@%xjUA#_nhRPwW&-{`_deOe+qkzZn@~G|g{*#uAv!AQjjh%21ha S`cngok&Ja&oe$;%^#K4OY{sqt literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe144_vulkan_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe144_vulkan_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..a2d1bcd5e37b653bfe2dfda4c7f0f0f719d33c11 GIT binary patch literal 10274 zcmbuF33Qaz6~`xpeF-2-*bD=RvM92JO(6*hBp^#j0|@ zNL`gO;mHH71{}yqTmMDJZQn1RxqIIm8!pXEc_3?f-&O;L_gH=O&Ww)Jrrs9V_vG4z z7p5GXURtt!Md2l@p1Seaigvq0(_gywKsfi{`uWR0A9K&f_1ERpef{_~imOpDHtVaY z=k5CUvuoGnzrDGCd4m%TdiJkgvwp|6?k{d=n|@^GE1UX%_R?jm8$I4E>EQdj`pWoo zz5lyeV9JaS`+c(c#Z`?TIFh@6Lv+f$1*1Y|DfP#%<)$C$_sZTr4W=D_WdD{sz8ybe zSwT+rjKSMq+j@Azx|#X6?x@-^eo6OoW{*>#F`n*t8NV+t6yO_E0SY=fxRyBN4d3iX| z%iHjpkaFMrgecyv)kI4@jTnqN3k7^^_X zh$kX*A~CSK9>$sz@v2Z&BrY_W2U~h$t19||zMkhtA1mUE!xiCJRf+nesUjwI^w;w( zUJxpc#O5S*$$a$F)8)n&#i}Z6eCVf#k6TosMph<$8hW|trRhc`5}~q4C{`LS2`>pp zom~UZj=q{*UWCq`w6fY*n`cu{U0D@QgexP|P~Y=!Xu7eXC91(f)YRC>^yA`*icoZT zBy_U=#-^JT319AM=tr`yCZ@B9BbF?P$J99Cbpy#YrkRazfpb;f+<3H1sv5hdW;a|L zIkzenuBm6&0am%w&Ds0nc`LsC0h0POvYc)u+cO zX)`tw8<~j5s<5;5NM}84VRpr(iFhR`TG*TWp%`Um;ZOkrNZ*DXkN(l094Cmnt zcQScfJ)7D;cw6%IvT!drCmlr0xeLtCc5}{oXAuKE^G@C@Ip?hV^~}+8PqC*azn(dI z?kjq75tIEd@ZI|^nllU|9+=;b7+^t>*|8ol9#_Ly6Ig#A#=Qp1_F>ckHpYjs9*gJ#=lrtsw z;!JT*srx)})&WM{-Nf;sZuH&7Q$*m*d$>6^E#%o#ypycY7e}_WULZLrVy(TzsX2+& z4qPai_XM1ry~SA{bujNEPJHI%>?@8vF_`xgPwJBM{%%eT^qFpM_5<9UeqJO!d&L{a zusQJ=%;^bl7CD&H1NxET=JbGb$-KKXoVkG_J3E6UFCCasbCw2ct}&F_hDabT>$6^6 zB$>Nq^NS_d5n(@69DB}$>4!S7b2KN0>4!^Z{Wi~)%w0{|G$>`0$ zNHQ_Nm#H4=FBXB{uN<6#5)o?xrw0?o87E|qZjuO$J|G_#r%%kmnP2MW@MG!;wNDn& z2W+N@rix5AO|t2xJKZi<&t;mUZzcLtHOz2&F|Q`{GezLkfXv#+IZMP^3Kgrjct}L7 zSt5GG`J64{9O2VPyi|l;j!@2dnaKLf8OM*lg`JKbl}l#WIhiAwTHxE=I_65ohxZcm4axV1b({m<-qe~I_a}t9&Ya$lhucx+SdabFuQbg^nk$B|gGZmj4^{TIUm1v}h zy&9&vnd3+AiLpoo_L%GKVuulDoBGyF{BjX^3lV4QD%pZ__Be~^sgZL?&2Y2f43ZmP zY&gf*aK`LxEs;E0#5w6FUM*@UA{TETwFbqPiqP?1kpD*xqlbnqa~SWG-PPriu|>DW z`CcKJyy)!yUMU%TrL(z8@~Ji}gn@Gp`iNgG!Vf&II_c>(BKmTjY?xo`u)*T2G1JqX zTw`0!Z9lGey4~{4ki1faKRD-Zl{kZQhiqg1+i(cD)tdq>XF|7CNC1Z<@I)dUq5rOB4 z7-qXcvc)vpp9%xVhrPFbzDY7M$!|6NOfvrH%>QP|;KbpauqOk=H;U}srAww4UBz#4 zI_!o@-Xt(MKYMJm2-2Kh<)cQQ^T)B^oz61{BDO)+ttE? z;#)=RaVL@a-Q#fc+om}_;5WKh+a-f{7G2}89g@j`&fea8CDSu{eUIwO5Wi0Z&Yiel zoWY#{e?SDr`9vPCZ?n|CQ^X!Yj1&?3f0J@I7T+bp2IBmJJt)GSyJ7eFA%~-*ZtNZw zffK{l_iM?l2c6}3#9`#Hc#ld3?;WH zkxY&LxO+6m2c5-zLNc+@aks5^aK2ZN=SdNT&QZ)?t8 zq2qkmp1|#V9B?+A8SI}IVf&6a`vj&+jpHql1Ga0=gs3@{z-I5WZ!QNJFJa3XYNCB2C>l{5rGjKnKh7~IXG|Z zQ1L&D8j4s)j);6|;(rmL!>+&hUqxm&Trzge#6NO6d$T|G+2uOB*5ZE?p|dyp?+!~B zr~XgG8TNhoQ_0i{zuWcnGs#;-_~P@qID<8#`$7bUA2RPcHU2|ndtu)N|0&G&2))@J zmCTyhH?#ehWNg9E(@V<(xASmJGQQM|4>g$XOUcxLj@;;o&sq6OME&IGD6;QgUrWZ% z=Eo(I!`{UclCc>iYOGkClW#=a1@;QP*?udzsR+Gc-%0KwA_ngp{{I$%HxaFJ*!ONu ze)A;>w&?7$BSjc~=*+H`WN^srQYB-DuCYGT$Xgp5@tz{|ZN#y$b=7ft`h%_Ebsf%` zWsR1%o^W*dnQeV%OI*Kg1L5efEmR-7O5ad2G0;&v=dF=AgY(9oHP#%A^M*_we49wt zkN0m1#NoVfzOlpJ-mo;u+%t%QPc6}vicg%T0d2C|-~OC|-y!^w$_Kj-D0LcgBgU(_OlVUmf7j=RQtktNycw|kW>44icumLr*c0ki%Om#iP}-#gL!`=6^h zaj>ymd6I2i7I%a&aMo|wNXg^^vt0R-_2cD2@6T1BIdQPDT%#o0dM)l~Vc_(|uuCM9 z3(Rtjk*pst7kYoLv6>SH8#`CyB(q-XK>x6M%V+d>hjZrmEGX2R!Dj)w2_i7wcw~M@ zXHSYGcMvBogZIMh;Pze=OU8yb1RrA9-7S%fUOzSUOwY0R6gL=?iDgvV(WUFVg zWa_ba)MIvVt7nR2Y^V_*Vpu&>C8OtFTYsi$4sP{Km&~9ZbeD<1s0Z2VnIV~aEFSfk z9o*`fDH$7T#D^GG&n(I48HR-%25i`Dhb7;m)?eA8hRGl=*bzz}DW9u;fGX z+2hVfx#nQ_a6aaUGgv>mxgs#uk4&68(nloM6Sv=Y=4lRgHO?CJiO=f!!ssn}KL5=> zsyY6piiV6IwhVgtfjBwI&HOz#huiOT{O)p4#Jh%#{jP&A{pb8w$e-_C=mv^d1M7^r zT&xqD0_niW3AZ}qlKtykpgGv7>s%;|?`P=!>r7~F>qN#6TLv|gmz?nLw4;OA)yZf2 ze_X2Z;g0)O7OuGA&R#PLd+(eVUi#_bI^WO0Hg)@stm*kv%WvQF=83Tn6~EyAmzEdj fR2`Ym{GZ$c)$z>Z-A?=OXgX+D%v*iv4*C5DY#YYx literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe288_dx12_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe288_dx12_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..cfd9468e32abe403d1de23d24eda737e4e772e0f GIT binary patch literal 6994 zcmeHMdstJ~mOpu&JjnwPP6+CW$U~%hKm-)TgaCqo2BkJAtqCB4@`kaZRPzD?1q~<| z#cB}sQmeiAs2Zzn0u&>l0@@apI-rQO*D6J8(dqQgJ^_2Zy?%GTZ)X0uf6V@J_Svts z)?UB8_TFpdKoA6xbcFaX`lbZ*iP`$m=^y`f)7lHxn>FvuC;WNw2Yyom!o16$HcXqo zX7zr^`bA~lT*B?7l!Rj{X^ig69Y3pFE+~?^w0-L&xAhx8coN&RM_(d_Z@ka|z92=# zE&gS-=gHq%Dl3+JYxGZ}zogIhFRIXg^6{*W8ou+;+UtA$A9uZ5&NOi+2wuyJw&%2B z|NSs1@xA-=9vM4ytUnJ)I%_f$k4Hr-?1AX-dnL|8^RBo1(%0NO+u3;V*X0q#QDV`1 z3y$^v>0ZswwM*(hDg0#l=2>q;|LayO&Xyqf^g%#f$I`!CDERu@IrrB@On~@pAJntd zF?R8vhEAo%2fl1CTJ9{{`%Pleyd_tcTTQ%_r}vuoE~K%t&cFQk$MfQ$q*;Ntp1uK0 z641z{)ylSfhm>WHCWz{gB5d2Hb4#}1qEGy1;>Nu9-{$XGaZ$W;XjTf}D_j;P$)&Fy zKd|RSeF0%~yXT#aT?7EG7axLP@D2h`6nJFdNe53qct%(dv@$Xpqk%GH%OEIv;}i;g9NK{($>Ob7~-nC}Wf|2PoBRHHUo4xo>!a;p|w$t0wO`>0InicL~ODv9mR_zl<+m2JdPI$dMFx%+aehWQ z4^Zl1GxfQYeP6_Rf^v%G>_?;QK@letf(r+z@&T$BEeeT5lnaO$cvZN1v3DKS*?WBX z7tv4u=2RhE7-nz28Nug~DGJ939A7*|#yftMr$FO)?y=h#QT77<;?LFlZ$vqC$Jz%+ z?8X`(lMiKPc~#}Xcg5E-4%5?*R(UgKgo(pCXd*hYp+o9OSrlluXR(4Kd@);iqHW0e zTonU?l*v0F;r9my$2=biXD%l1QwXKl6nF2YLtYh!yqdh3E2RM5@+(WS1-yuO$C7czF?6(Pg5kkCP08*aU!Knj2Rt0Z ze45nl3)Ds=K{zEMdRSz3C3pes9rMj)h4Qk1^s=IK5-8h!DrIMNv$ud8;%vdF`9^91 zO3l)<^IjD;8>ySS;qSTBO-5>-9Pa`H@R6WVPAxQ2H;JfOayIDN0>*U1!@o0;vq9Gu zFs2)RthDvoc;YR_ry?5PZ$&uS$bt-hko*S-Dh;vw+rh^wnl@pq_+lVq38Gh<5WQmsv{Ne!=S~ zlMJEY?KjPU@OiQNO1j6AcCutClZ$ax9X!apqLEx7CmWHahqzS6VOB?jl5yOTaRMSS z8ZZ*W-zX(90*tvNMvzfYVk|T^lNce!ZW1HZI7(tjjTnWIV3blAtBguYM}TpJl5QZN zsj#w!53NXp()SWj1*}wqbEybuxDgnm3n^9~NpuLGkEAdQf=MT5@2Zd4T0q*HXCjCj zn8Ed1tG$!G8T-6n?lY;1d}9ijDKWRWWCtyAAL`fxD^L$w$r&-mVx$x}Xp?VaDBV|# zj3}KG`uh8K_uqQwj`RNhdfDCt*|gfEKG`jD18YA$Oq|7Kt#3{CsZ_ASZ}@XOo0?6g zS*Fu}K07za6nN6_5O$&2uCqD39plE`2oaE@_MtwT%`ETC?ChnFA8lOvL;A?otQ~W@ zs+Kif>pC8rt(GPTxSC_ElxC%!KTMImBs%e>A z7S_krT3`!TW7qn;%0d>NBrTIF3JO-{uV0(BHa9;fdEJuyj8uWHjkPdEBmc-kCVWhC z$;r=HpOG!747US}bk<8fB|S$jnX)kZfRTXfLbB&C9;-a2)Or3K=^VM|`EY>P>y%yO zJ@`ApX7=8*fuEl`>le82SjhQP^st6FZbg=+x=rj!z3Zx1?b_-vyI#!{#1sVAqmKQs z+sB$~?2s}h4%@BnH6IDS>nAsi0F=*JqDGCKq~#o|`O2m8+67;K7G3h-DqxnQsU8)7 zOFb}+tHGHS9NQREvy15#!z>WYZuD-Qol*}N%bP7xzZprC<(zcOBsuTM)t(YlRc(Cj zVC_kq5!NT4d8oTe{U>Viz|h^c4*l5hNXJmeaPKe>k7QysD@I~11wl6Y`6Yuu{3{lK z*cT8tbsteb9JQ%buw~aqW{Sg7CN4Y`2w&BZLbj&jvFvf&@k%dzU9*lKr*R%%J<(MKmeyc_-O5XrIfaxVI3$TR`;(Bw)rLDV{*--5 zw_I-v1i+|*G;jPTIfb7OEI4DsLEF;)O;<~MM^iTd zqx){36~N&F;COGO*ivAafa8dXf8~;?XKzVW?Q5XS2cQgemuMbJ)wXqZ*|jw#Wvk!3 z`q_;*E|~zA_69fVa*mgc3yx?>PYM6hmCs6g0Hy(ee7O4~O(6BSZ6Y;8LoL?cmj3pR z%DY3iTX3rofO!;-+_cn_R@;xhaOz`Rk>0!g75y!3eH}n0iYs9C{>XquK(kFIuIkFAlPB#?)|OlWQwai78SB2P z3C!$1K0lolWYh%rkrvY^D}pF*r&DAG${H)>y>UvO7qw7EeP2i2VnDs#Z&pPeyVi%w zerXo^`ulm2{G&8mnyJMGG^iDpx5^*2hGx>n6|LBaWN~*oBc?#GZy$PCd|I(tqv#VM zXaiMvvZ1?dJLFd_cl7XduKVSy=K)Ub&)w^myc4j*D|Xo&pC=#wnB`OXRYaM^Uj{bE|}+QtQ3W>4IlK#g7w3WjejbJEHm@xx%*kKp z^Fwd{$Z$Z^OflPCY|s|idsW+epS1Vsu`d{~|1O66c39gV`AuPK!Cnc|ZT7B>Tin3Dv!A)nI+_HG=I#$e?H$8M z$uf69djT8+XyCcP3)ls~!ZeE*`b;v_FJuomAxt4n=llaNm}aS>3IQ+v)=vr=!GT{TC|y3V8~+)L!2ME>}N{$JXYAW7R%IY z4X$Yz#WqYM=prq$N)}a;7Ikf|EX<{DrBREb%5rn5TXIR8Hkak1W&AE4`;i{^fU+^p z{ZaO)ls%8zHubL1wNE&;MKLW6D-XV?3GS9GI714#s0q=Mg1bf?H_546)2V^!W%(di zmgVZpa^=)bUerzF6u|aSrpVWebhgX>U(YnLtW zSGaZvUE5SsI~4FYddUK-WP!n!pKlG?EeX<*f_Jyh1wwyS2j3(GH@C9dgw*0((iX3> zP0BKUkAyuw01u(;hXe3)E_)34aeB@ZDd!ocQCSJo`$f2*7R6M&fcs#1;1XU6-cyWJ z)pY-mgUcU0%=r)Io-e;zmu#2@6W4z;J$lQLx}Tn1xai|XJh8auQpnLSADBJp0VJZz zEGLYM2dH+}AFh1y;?8d^4|4JnU9PQsFqp@u?N8i3^ZVM>?Kl21cB+zg=C`QlV}{@A zNcA)OSTr(G6CgK0y}8Hfsk6}N%+y~WG4hwW#fj!+CB$>9r;1u11n-=V+Hn=z^6s2% zw%hY0n`uTY!fRF@|Yo zBdZnT`jT>Qr6zf^&g zs_ITb8b6jsfxuyL!b%G^GE3u&I8JFp06&)IXk%&T!R9i3adu-xt)Y16EYFwKD%EX} z!l!n)OfWQ6d9O+y`|wVrR)Itco5g&udN*1{1IvnKw%L(cZrt|RRE+(I%YF(rD#|=3 zVm?rEo=G`lQg*(GQ7q>?z}U}5!5*Lvo7qpmabSk!BI-5>-lkOVG%K_g5T%s5B5#UP z_Kts`31YX(5nK}mavx)nivCHIV!ZgKC`A?h5X1sAb>bf!A>eBM%ftlO5FN~BGRdtH z=ylJYKom{(0MDL8HcwU{$pI=&`KnSH!sFUPWW0e@O-J|os0 zrW0Kf9JGYnN}q(&J`zeM?YJEod)G`BLjjPWG~z}8`A(_A8srkE$jFwgbkO=6J!q0M z3JAZ>eGc+qK}8n{^OY;wpF2ffet6>QTXv7DKJBVvr?TFP-O-bo%e1d1ezNCtqSmWgXxf3ZazUc+oW>QS#)Be z5=C+|^}g$K;S?-c51}+TNs!KVF%tNd2m;a61O@dSm#*+8i?OmrXCZ*$vU~`Z2r50u z=5#ezhU(=0DsC(-9P3w-Q?X8NxWz|>Nqvjq1!U5c)-;0zOU}jFelzVb!2xchTd;oa z2m$HxV})bM-FQ!@R}*0fF1Zh955U>jJ}&DtxjmOuO_gJvQUuJA1cdq=?S@ynqVcY6 zV%IiHdKkCM9wAMI{Xm?;T{HD)sI1gZCqk5iG@;uU%+h8fLAB@zq!}z7;F#rggIr>x z5AUXvERXn+!a!M%9^`3AkQlQjHE_%jC(?na2uh}DbLxa*bs}+Hn~@;mvg+21YW%n* ztz1ex_#tsLWe-`1#35Q9i3(`b3kiQauv&Nc zcBvQXuj^De*x|!^hKf>*PIn6zhdPZCijQ;HFJlAAhxC11>t&Hpx09kOj&)RzPpp=h z%sI!MEIM*dzbek;oNkt(*7a>>2xvBAi?O7g7#4b(6)UMiT)`rX1334jj8T9+)JPA* z_F=R}dYk-=sO|Cwm2T%PA`bvY0ZJQQDyG6hL~E`H3w5IXbkbbClU`Mv**r8axfx%{ z8&PeNXG!#Y*(h`Dq#Sg9Sez*vO0h!ICGa@nXTBU764U|~&3wea- z;N|t|nvIlWnvzzf1_#1>ymnV!qBvavFSuC^fUf(u=W9avpmA*|@-lIjE z(dz5zEvQUsUGLw3_yqlqMUpl`Vec_$&_-7xJ^*A(xO1{NuD8J6(|2M=Tz^*^VYCk* zKjZt#fQ4wjpVJZM&aRb~FL9sLtc7{nJZGc3v3A0SH0$Sf%*dq+h%YBOo^j3?w4YOb zUK=BFgPA}%?5C2|x%JQO=kg{N*7DRjgJ;#+5k4q&v)@bm;``G5QuUxtk%c<5FV{aHI<}jSt z*Hfs^cq=A3WL0B;cgOy|uZ>c>5@XJ^+(>o4H6gq9z0Zp26IvbFF8^!>nhOLTzV_dv z)HnV+)YIjDeSt|D=Pyoelgh3Mt5<5Cnj|UyB>wzNlXqugJGplXKr|qcmG$|D4G1e^ zh>Uw|{AR(a4xaT-oKH{6iCp91nJ5Ib`sF2O@h8UTj~Q}CKiYPB@%%sjt~DNx4sn*N zE-imFsXyL*_Ue+={uP>`3>1r=02#};E4Flc&VN_MEf)LMCilhvfCS?88w?k{M11U* zKiQNLX#VS1rN4N@%xjUA#_nhRPwW&-{`_deOe+qkzZn@~G|g{*#uAv!AQjjh%21ha S`cngok&Ja&oe$;%^#K4OY{sqt literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe288_vulkan_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe288_vulkan_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..a2d1bcd5e37b653bfe2dfda4c7f0f0f719d33c11 GIT binary patch literal 10274 zcmbuF33Qaz6~`xpeF-2-*bD=RvM92JO(6*hBp^#j0|@ zNL`gO;mHH71{}yqTmMDJZQn1RxqIIm8!pXEc_3?f-&O;L_gH=O&Ww)Jrrs9V_vG4z z7p5GXURtt!Md2l@p1Seaigvq0(_gywKsfi{`uWR0A9K&f_1ERpef{_~imOpDHtVaY z=k5CUvuoGnzrDGCd4m%TdiJkgvwp|6?k{d=n|@^GE1UX%_R?jm8$I4E>EQdj`pWoo zz5lyeV9JaS`+c(c#Z`?TIFh@6Lv+f$1*1Y|DfP#%<)$C$_sZTr4W=D_WdD{sz8ybe zSwT+rjKSMq+j@Azx|#X6?x@-^eo6OoW{*>#F`n*t8NV+t6yO_E0SY=fxRyBN4d3iX| z%iHjpkaFMrgecyv)kI4@jTnqN3k7^^_X zh$kX*A~CSK9>$sz@v2Z&BrY_W2U~h$t19||zMkhtA1mUE!xiCJRf+nesUjwI^w;w( zUJxpc#O5S*$$a$F)8)n&#i}Z6eCVf#k6TosMph<$8hW|trRhc`5}~q4C{`LS2`>pp zom~UZj=q{*UWCq`w6fY*n`cu{U0D@QgexP|P~Y=!Xu7eXC91(f)YRC>^yA`*icoZT zBy_U=#-^JT319AM=tr`yCZ@B9BbF?P$J99Cbpy#YrkRazfpb;f+<3H1sv5hdW;a|L zIkzenuBm6&0am%w&Ds0nc`LsC0h0POvYc)u+cO zX)`tw8<~j5s<5;5NM}84VRpr(iFhR`TG*TWp%`Um;ZOkrNZ*DXkN(l094Cmnt zcQScfJ)7D;cw6%IvT!drCmlr0xeLtCc5}{oXAuKE^G@C@Ip?hV^~}+8PqC*azn(dI z?kjq75tIEd@ZI|^nllU|9+=;b7+^t>*|8ol9#_Ly6Ig#A#=Qp1_F>ckHpYjs9*gJ#=lrtsw z;!JT*srx)})&WM{-Nf;sZuH&7Q$*m*d$>6^E#%o#ypycY7e}_WULZLrVy(TzsX2+& z4qPai_XM1ry~SA{bujNEPJHI%>?@8vF_`xgPwJBM{%%eT^qFpM_5<9UeqJO!d&L{a zusQJ=%;^bl7CD&H1NxET=JbGb$-KKXoVkG_J3E6UFCCasbCw2ct}&F_hDabT>$6^6 zB$>Nq^NS_d5n(@69DB}$>4!S7b2KN0>4!^Z{Wi~)%w0{|G$>`0$ zNHQ_Nm#H4=FBXB{uN<6#5)o?xrw0?o87E|qZjuO$J|G_#r%%kmnP2MW@MG!;wNDn& z2W+N@rix5AO|t2xJKZi<&t;mUZzcLtHOz2&F|Q`{GezLkfXv#+IZMP^3Kgrjct}L7 zSt5GG`J64{9O2VPyi|l;j!@2dnaKLf8OM*lg`JKbl}l#WIhiAwTHxE=I_65ohxZcm4axV1b({m<-qe~I_a}t9&Ya$lhucx+SdabFuQbg^nk$B|gGZmj4^{TIUm1v}h zy&9&vnd3+AiLpoo_L%GKVuulDoBGyF{BjX^3lV4QD%pZ__Be~^sgZL?&2Y2f43ZmP zY&gf*aK`LxEs;E0#5w6FUM*@UA{TETwFbqPiqP?1kpD*xqlbnqa~SWG-PPriu|>DW z`CcKJyy)!yUMU%TrL(z8@~Ji}gn@Gp`iNgG!Vf&II_c>(BKmTjY?xo`u)*T2G1JqX zTw`0!Z9lGey4~{4ki1faKRD-Zl{kZQhiqg1+i(cD)tdq>XF|7CNC1Z<@I)dUq5rOB4 z7-qXcvc)vpp9%xVhrPFbzDY7M$!|6NOfvrH%>QP|;KbpauqOk=H;U}srAww4UBz#4 zI_!o@-Xt(MKYMJm2-2Kh<)cQQ^T)B^oz61{BDO)+ttE? z;#)=RaVL@a-Q#fc+om}_;5WKh+a-f{7G2}89g@j`&fea8CDSu{eUIwO5Wi0Z&Yiel zoWY#{e?SDr`9vPCZ?n|CQ^X!Yj1&?3f0J@I7T+bp2IBmJJt)GSyJ7eFA%~-*ZtNZw zffK{l_iM?l2c6}3#9`#Hc#ld3?;WH zkxY&LxO+6m2c5-zLNc+@aks5^aK2ZN=SdNT&QZ)?t8 zq2qkmp1|#V9B?+A8SI}IVf&6a`vj&+jpHql1Ga0=gs3@{z-I5WZ!QNJFJa3XYNCB2C>l{5rGjKnKh7~IXG|Z zQ1L&D8j4s)j);6|;(rmL!>+&hUqxm&Trzge#6NO6d$T|G+2uOB*5ZE?p|dyp?+!~B zr~XgG8TNhoQ_0i{zuWcnGs#;-_~P@qID<8#`$7bUA2RPcHU2|ndtu)N|0&G&2))@J zmCTyhH?#ehWNg9E(@V<(xASmJGQQM|4>g$XOUcxLj@;;o&sq6OME&IGD6;QgUrWZ% z=Eo(I!`{UclCc>iYOGkClW#=a1@;QP*?udzsR+Gc-%0KwA_ngp{{I$%HxaFJ*!ONu ze)A;>w&?7$BSjc~=*+H`WN^srQYB-DuCYGT$Xgp5@tz{|ZN#y$b=7ft`h%_Ebsf%` zWsR1%o^W*dnQeV%OI*Kg1L5efEmR-7O5ad2G0;&v=dF=AgY(9oHP#%A^M*_we49wt zkN0m1#NoVfzOlpJ-mo;u+%t%QPc6}vicg%T0d2C|-~OC|-y!^w$_Kj-D0LcgBgU(_OlVUmf7j=RQtktNycw|kW>44icumLr*c0ki%Om#iP}-#gL!`=6^h zaj>ymd6I2i7I%a&aMo|wNXg^^vt0R-_2cD2@6T1BIdQPDT%#o0dM)l~Vc_(|uuCM9 z3(Rtjk*pst7kYoLv6>SH8#`CyB(q-XK>x6M%V+d>hjZrmEGX2R!Dj)w2_i7wcw~M@ zXHSYGcMvBogZIMh;Pze=OU8yb1RrA9-7S%fUOzSUOwY0R6gL=?iDgvV(WUFVg zWa_ba)MIvVt7nR2Y^V_*Vpu&>C8OtFTYsi$4sP{Km&~9ZbeD<1s0Z2VnIV~aEFSfk z9o*`fDH$7T#D^GG&n(I48HR-%25i`Dhb7;m)?eA8hRGl=*bzz}DW9u;fGX z+2hVfx#nQ_a6aaUGgv>mxgs#uk4&68(nloM6Sv=Y=4lRgHO?CJiO=f!!ssn}KL5=> zsyY6piiV6IwhVgtfjBwI&HOz#huiOT{O)p4#Jh%#{jP&A{pb8w$e-_C=mv^d1M7^r zT&xqD0_niW3AZ}qlKtykpgGv7>s%;|?`P=!>r7~F>qN#6TLv|gmz?nLw4;OA)yZf2 ze_X2Z;g0)O7OuGA&R#PLd+(eVUi#_bI^WO0Hg)@stm*kv%WvQF=83Tn6~EyAmzEdj fR2`Ym{GZ$c)$z>Z-A?=OXgX+D%v*iv4*C5DY#YYx literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe432_dx12_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe432_dx12_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..cfd9468e32abe403d1de23d24eda737e4e772e0f GIT binary patch literal 6994 zcmeHMdstJ~mOpu&JjnwPP6+CW$U~%hKm-)TgaCqo2BkJAtqCB4@`kaZRPzD?1q~<| z#cB}sQmeiAs2Zzn0u&>l0@@apI-rQO*D6J8(dqQgJ^_2Zy?%GTZ)X0uf6V@J_Svts z)?UB8_TFpdKoA6xbcFaX`lbZ*iP`$m=^y`f)7lHxn>FvuC;WNw2Yyom!o16$HcXqo zX7zr^`bA~lT*B?7l!Rj{X^ig69Y3pFE+~?^w0-L&xAhx8coN&RM_(d_Z@ka|z92=# zE&gS-=gHq%Dl3+JYxGZ}zogIhFRIXg^6{*W8ou+;+UtA$A9uZ5&NOi+2wuyJw&%2B z|NSs1@xA-=9vM4ytUnJ)I%_f$k4Hr-?1AX-dnL|8^RBo1(%0NO+u3;V*X0q#QDV`1 z3y$^v>0ZswwM*(hDg0#l=2>q;|LayO&Xyqf^g%#f$I`!CDERu@IrrB@On~@pAJntd zF?R8vhEAo%2fl1CTJ9{{`%Pleyd_tcTTQ%_r}vuoE~K%t&cFQk$MfQ$q*;Ntp1uK0 z641z{)ylSfhm>WHCWz{gB5d2Hb4#}1qEGy1;>Nu9-{$XGaZ$W;XjTf}D_j;P$)&Fy zKd|RSeF0%~yXT#aT?7EG7axLP@D2h`6nJFdNe53qct%(dv@$Xpqk%GH%OEIv;}i;g9NK{($>Ob7~-nC}Wf|2PoBRHHUo4xo>!a;p|w$t0wO`>0InicL~ODv9mR_zl<+m2JdPI$dMFx%+aehWQ z4^Zl1GxfQYeP6_Rf^v%G>_?;QK@letf(r+z@&T$BEeeT5lnaO$cvZN1v3DKS*?WBX z7tv4u=2RhE7-nz28Nug~DGJ939A7*|#yftMr$FO)?y=h#QT77<;?LFlZ$vqC$Jz%+ z?8X`(lMiKPc~#}Xcg5E-4%5?*R(UgKgo(pCXd*hYp+o9OSrlluXR(4Kd@);iqHW0e zTonU?l*v0F;r9my$2=biXD%l1QwXKl6nF2YLtYh!yqdh3E2RM5@+(WS1-yuO$C7czF?6(Pg5kkCP08*aU!Knj2Rt0Z ze45nl3)Ds=K{zEMdRSz3C3pes9rMj)h4Qk1^s=IK5-8h!DrIMNv$ud8;%vdF`9^91 zO3l)<^IjD;8>ySS;qSTBO-5>-9Pa`H@R6WVPAxQ2H;JfOayIDN0>*U1!@o0;vq9Gu zFs2)RthDvoc;YR_ry?5PZ$&uS$bt-hko*S-Dh;vw+rh^wnl@pq_+lVq38Gh<5WQmsv{Ne!=S~ zlMJEY?KjPU@OiQNO1j6AcCutClZ$ax9X!apqLEx7CmWHahqzS6VOB?jl5yOTaRMSS z8ZZ*W-zX(90*tvNMvzfYVk|T^lNce!ZW1HZI7(tjjTnWIV3blAtBguYM}TpJl5QZN zsj#w!53NXp()SWj1*}wqbEybuxDgnm3n^9~NpuLGkEAdQf=MT5@2Zd4T0q*HXCjCj zn8Ed1tG$!G8T-6n?lY;1d}9ijDKWRWWCtyAAL`fxD^L$w$r&-mVx$x}Xp?VaDBV|# zj3}KG`uh8K_uqQwj`RNhdfDCt*|gfEKG`jD18YA$Oq|7Kt#3{CsZ_ASZ}@XOo0?6g zS*Fu}K07za6nN6_5O$&2uCqD39plE`2oaE@_MtwT%`ETC?ChnFA8lOvL;A?otQ~W@ zs+Kif>pC8rt(GPTxSC_ElxC%!KTMImBs%e>A z7S_krT3`!TW7qn;%0d>NBrTIF3JO-{uV0(BHa9;fdEJuyj8uWHjkPdEBmc-kCVWhC z$;r=HpOG!747US}bk<8fB|S$jnX)kZfRTXfLbB&C9;-a2)Or3K=^VM|`EY>P>y%yO zJ@`ApX7=8*fuEl`>le82SjhQP^st6FZbg=+x=rj!z3Zx1?b_-vyI#!{#1sVAqmKQs z+sB$~?2s}h4%@BnH6IDS>nAsi0F=*JqDGCKq~#o|`O2m8+67;K7G3h-DqxnQsU8)7 zOFb}+tHGHS9NQREvy15#!z>WYZuD-Qol*}N%bP7xzZprC<(zcOBsuTM)t(YlRc(Cj zVC_kq5!NT4d8oTe{U>Viz|h^c4*l5hNXJmeaPKe>k7QysD@I~11wl6Y`6Yuu{3{lK z*cT8tbsteb9JQ%buw~aqW{Sg7CN4Y`2w&BZLbj&jvFvf&@k%dzU9*lKr*R%%J<(MKmeyc_-O5XrIfaxVI3$TR`;(Bw)rLDV{*--5 zw_I-v1i+|*G;jPTIfb7OEI4DsLEF;)O;<~MM^iTd zqx){36~N&F;COGO*ivAafa8dXf8~;?XKzVW?Q5XS2cQgemuMbJ)wXqZ*|jw#Wvk!3 z`q_;*E|~zA_69fVa*mgc3yx?>PYM6hmCs6g0Hy(ee7O4~O(6BSZ6Y;8LoL?cmj3pR z%DY3iTX3rofO!;-+_cn_R@;xhaOz`Rk>0!g75y!3eH}n0iYs9C{>XquK(kFIuIkFAlPB#?)|OlWQwai78SB2P z3C!$1K0lolWYh%rkrvY^D}pF*r&DAG${H)>y>UvO7qw7EeP2i2VnDs#Z&pPeyVi%w zerXo^`ulm2{G&8mnyJMGG^iDpx5^*2hGx>n6|LBaWN~*oBc?#GZy$PCd|I(tqv#VM zXaiMvvZ1?dJLFd_cl7XduKVSy=K)Ub&)w^myc4j*D|Xo&pC=#wnB`OXRYaM^Uj{bE|}+QtQ3W>4IlK#g7w3WjejbJEHm@xx%*kKp z^Fwd{$Z$Z^OflPCY|s|idsW+epS1Vsu`d{~|1O66c39gV`AuPK!Cnc|ZT7B>Tin3Dv!A)nI+_HG=I#$e?H$8M z$uf69djT8+XyCcP3)ls~!ZeE*`b;v_FJuomAxt4n=llaNm}aS>3IQ+v)=vr=!GT{TC|y3V8~+)L!2ME>}N{$JXYAW7R%IY z4X$Yz#WqYM=prq$N)}a;7Ikf|EX<{DrBREb%5rn5TXIR8Hkak1W&AE4`;i{^fU+^p z{ZaO)ls%8zHubL1wNE&;MKLW6D-XV?3GS9GI714#s0q=Mg1bf?H_546)2V^!W%(di zmgVZpa^=)bUerzF6u|aSrpVWebhgX>U(YnLtW zSGaZvUE5SsI~4FYddUK-WP!n!pKlG?EeX<*f_Jyh1wwyS2j3(GH@C9dgw*0((iX3> zP0BKUkAyuw01u(;hXe3)E_)34aeB@ZDd!ocQCSJo`$f2*7R6M&fcs#1;1XU6-cyWJ z)pY-mgUcU0%=r)Io-e;zmu#2@6W4z;J$lQLx}Tn1xai|XJh8auQpnLSADBJp0VJZz zEGLYM2dH+}AFh1y;?8d^4|4JnU9PQsFqp@u?N8i3^ZVM>?Kl21cB+zg=C`QlV}{@A zNcA)OSTr(G6CgK0y}8Hfsk6}N%+y~WG4hwW#fj!+CB$>9r;1u11n-=V+Hn=z^6s2% zw%hY0n`uTY!fRF@|Yo zBdZnT`jT>Qr6zf^&g zs_ITb8b6jsfxuyL!b%G^GE3u&I8JFp06&)IXk%&T!R9i3adu-xt)Y16EYFwKD%EX} z!l!n)OfWQ6d9O+y`|wVrR)Itco5g&udN*1{1IvnKw%L(cZrt|RRE+(I%YF(rD#|=3 zVm?rEo=G`lQg*(GQ7q>?z}U}5!5*Lvo7qpmabSk!BI-5>-lkOVG%K_g5T%s5B5#UP z_Kts`31YX(5nK}mavx)nivCHIV!ZgKC`A?h5X1sAb>bf!A>eBM%ftlO5FN~BGRdtH z=ylJYKom{(0MDL8HcwU{$pI=&`KnSH!sFUPWW0e@O-J|os0 zrW0Kf9JGYnN}q(&J`zeM?YJEod)G`BLjjPWG~z}8`A(_A8srkE$jFwgbkO=6J!q0M z3JAZ>eGc+qK}8n{^OY;wpF2ffet6>QTXv7DKJBVvr?TFP-O-bo%e1d1ezNCtqSmWgXxf3ZazUc+oW>QS#)Be z5=C+|^}g$K;S?-c51}+TNs!KVF%tNd2m;a61O@dSm#*+8i?OmrXCZ*$vU~`Z2r50u z=5#ezhU(=0DsC(-9P3w-Q?X8NxWz|>Nqvjq1!U5c)-;0zOU}jFelzVb!2xchTd;oa z2m$HxV})bM-FQ!@R}*0fF1Zh955U>jJ}&DtxjmOuO_gJvQUuJA1cdq=?S@ynqVcY6 zV%IiHdKkCM9wAMI{Xm?;T{HD)sI1gZCqk5iG@;uU%+h8fLAB@zq!}z7;F#rggIr>x z5AUXvERXn+!a!M%9^`3AkQlQjHE_%jC(?na2uh}DbLxa*bs}+Hn~@;mvg+21YW%n* ztz1ex_#tsLWe-`1#35Q9i3(`b3kiQauv&Nc zcBvQXuj^De*x|!^hKf>*PIn6zhdPZCijQ;HFJlAAhxC11>t&Hpx09kOj&)RzPpp=h z%sI!MEIM*dzbek;oNkt(*7a>>2xvBAi?O7g7#4b(6)UMiT)`rX1334jj8T9+)JPA* z_F=R}dYk-=sO|Cwm2T%PA`bvY0ZJQQDyG6hL~E`H3w5IXbkbbClU`Mv**r8axfx%{ z8&PeNXG!#Y*(h`Dq#Sg9Sez*vO0h!ICGa@nXTBU764U|~&3wea- z;N|t|nvIlWnvzzf1_#1>ymnV!qBvavFSuC^fUf(u=W9avpmA*|@-lIjE z(dz5zEvQUsUGLw3_yqlqMUpl`Vec_$&_-7xJ^*A(xO1{NuD8J6(|2M=Tz^*^VYCk* zKjZt#fQ4wjpVJZM&aRb~FL9sLtc7{nJZGc3v3A0SH0$Sf%*dq+h%YBOo^j3?w4YOb zUK=BFgPA}%?5C2|x%JQO=kg{N*7DRjgJ;#+5k4q&v)@bm;``G5QuUxtk%c<5FV{aHI<}jSt z*Hfs^cq=A3WL0B;cgOy|uZ>c>5@XJ^+(>o4H6gq9z0Zp26IvbFF8^!>nhOLTzV_dv z)HnV+)YIjDeSt|D=Pyoelgh3Mt5<5Cnj|UyB>wzNlXqugJGplXKr|qcmG$|D4G1e^ zh>Uw|{AR(a4xaT-oKH{6iCp91nJ5Ib`sF2O@h8UTj~Q}CKiYPB@%%sjt~DNx4sn*N zE-imFsXyL*_Ue+={uP>`3>1r=02#};E4Flc&VN_MEf)LMCilhvfCS?88w?k{M11U* zKiQNLX#VS1rN4N@%xjUA#_nhRPwW&-{`_deOe+qkzZn@~G|g{*#uAv!AQjjh%21ha S`cngok&Ja&oe$;%^#K4OY{sqt literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe432_vulkan_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe432_vulkan_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..a2d1bcd5e37b653bfe2dfda4c7f0f0f719d33c11 GIT binary patch literal 10274 zcmbuF33Qaz6~`xpeF-2-*bD=RvM92JO(6*hBp^#j0|@ zNL`gO;mHH71{}yqTmMDJZQn1RxqIIm8!pXEc_3?f-&O;L_gH=O&Ww)Jrrs9V_vG4z z7p5GXURtt!Md2l@p1Seaigvq0(_gywKsfi{`uWR0A9K&f_1ERpef{_~imOpDHtVaY z=k5CUvuoGnzrDGCd4m%TdiJkgvwp|6?k{d=n|@^GE1UX%_R?jm8$I4E>EQdj`pWoo zz5lyeV9JaS`+c(c#Z`?TIFh@6Lv+f$1*1Y|DfP#%<)$C$_sZTr4W=D_WdD{sz8ybe zSwT+rjKSMq+j@Azx|#X6?x@-^eo6OoW{*>#F`n*t8NV+t6yO_E0SY=fxRyBN4d3iX| z%iHjpkaFMrgecyv)kI4@jTnqN3k7^^_X zh$kX*A~CSK9>$sz@v2Z&BrY_W2U~h$t19||zMkhtA1mUE!xiCJRf+nesUjwI^w;w( zUJxpc#O5S*$$a$F)8)n&#i}Z6eCVf#k6TosMph<$8hW|trRhc`5}~q4C{`LS2`>pp zom~UZj=q{*UWCq`w6fY*n`cu{U0D@QgexP|P~Y=!Xu7eXC91(f)YRC>^yA`*icoZT zBy_U=#-^JT319AM=tr`yCZ@B9BbF?P$J99Cbpy#YrkRazfpb;f+<3H1sv5hdW;a|L zIkzenuBm6&0am%w&Ds0nc`LsC0h0POvYc)u+cO zX)`tw8<~j5s<5;5NM}84VRpr(iFhR`TG*TWp%`Um;ZOkrNZ*DXkN(l094Cmnt zcQScfJ)7D;cw6%IvT!drCmlr0xeLtCc5}{oXAuKE^G@C@Ip?hV^~}+8PqC*azn(dI z?kjq75tIEd@ZI|^nllU|9+=;b7+^t>*|8ol9#_Ly6Ig#A#=Qp1_F>ckHpYjs9*gJ#=lrtsw z;!JT*srx)})&WM{-Nf;sZuH&7Q$*m*d$>6^E#%o#ypycY7e}_WULZLrVy(TzsX2+& z4qPai_XM1ry~SA{bujNEPJHI%>?@8vF_`xgPwJBM{%%eT^qFpM_5<9UeqJO!d&L{a zusQJ=%;^bl7CD&H1NxET=JbGb$-KKXoVkG_J3E6UFCCasbCw2ct}&F_hDabT>$6^6 zB$>Nq^NS_d5n(@69DB}$>4!S7b2KN0>4!^Z{Wi~)%w0{|G$>`0$ zNHQ_Nm#H4=FBXB{uN<6#5)o?xrw0?o87E|qZjuO$J|G_#r%%kmnP2MW@MG!;wNDn& z2W+N@rix5AO|t2xJKZi<&t;mUZzcLtHOz2&F|Q`{GezLkfXv#+IZMP^3Kgrjct}L7 zSt5GG`J64{9O2VPyi|l;j!@2dnaKLf8OM*lg`JKbl}l#WIhiAwTHxE=I_65ohxZcm4axV1b({m<-qe~I_a}t9&Ya$lhucx+SdabFuQbg^nk$B|gGZmj4^{TIUm1v}h zy&9&vnd3+AiLpoo_L%GKVuulDoBGyF{BjX^3lV4QD%pZ__Be~^sgZL?&2Y2f43ZmP zY&gf*aK`LxEs;E0#5w6FUM*@UA{TETwFbqPiqP?1kpD*xqlbnqa~SWG-PPriu|>DW z`CcKJyy)!yUMU%TrL(z8@~Ji}gn@Gp`iNgG!Vf&II_c>(BKmTjY?xo`u)*T2G1JqX zTw`0!Z9lGey4~{4ki1faKRD-Zl{kZQhiqg1+i(cD)tdq>XF|7CNC1Z<@I)dUq5rOB4 z7-qXcvc)vpp9%xVhrPFbzDY7M$!|6NOfvrH%>QP|;KbpauqOk=H;U}srAww4UBz#4 zI_!o@-Xt(MKYMJm2-2Kh<)cQQ^T)B^oz61{BDO)+ttE? z;#)=RaVL@a-Q#fc+om}_;5WKh+a-f{7G2}89g@j`&fea8CDSu{eUIwO5Wi0Z&Yiel zoWY#{e?SDr`9vPCZ?n|CQ^X!Yj1&?3f0J@I7T+bp2IBmJJt)GSyJ7eFA%~-*ZtNZw zffK{l_iM?l2c6}3#9`#Hc#ld3?;WH zkxY&LxO+6m2c5-zLNc+@aks5^aK2ZN=SdNT&QZ)?t8 zq2qkmp1|#V9B?+A8SI}IVf&6a`vj&+jpHql1Ga0=gs3@{z-I5WZ!QNJFJa3XYNCB2C>l{5rGjKnKh7~IXG|Z zQ1L&D8j4s)j);6|;(rmL!>+&hUqxm&Trzge#6NO6d$T|G+2uOB*5ZE?p|dyp?+!~B zr~XgG8TNhoQ_0i{zuWcnGs#;-_~P@qID<8#`$7bUA2RPcHU2|ndtu)N|0&G&2))@J zmCTyhH?#ehWNg9E(@V<(xASmJGQQM|4>g$XOUcxLj@;;o&sq6OME&IGD6;QgUrWZ% z=Eo(I!`{UclCc>iYOGkClW#=a1@;QP*?udzsR+Gc-%0KwA_ngp{{I$%HxaFJ*!ONu ze)A;>w&?7$BSjc~=*+H`WN^srQYB-DuCYGT$Xgp5@tz{|ZN#y$b=7ft`h%_Ebsf%` zWsR1%o^W*dnQeV%OI*Kg1L5efEmR-7O5ad2G0;&v=dF=AgY(9oHP#%A^M*_we49wt zkN0m1#NoVfzOlpJ-mo;u+%t%QPc6}vicg%T0d2C|-~OC|-y!^w$_Kj-D0LcgBgU(_OlVUmf7j=RQtktNycw|kW>44icumLr*c0ki%Om#iP}-#gL!`=6^h zaj>ymd6I2i7I%a&aMo|wNXg^^vt0R-_2cD2@6T1BIdQPDT%#o0dM)l~Vc_(|uuCM9 z3(Rtjk*pst7kYoLv6>SH8#`CyB(q-XK>x6M%V+d>hjZrmEGX2R!Dj)w2_i7wcw~M@ zXHSYGcMvBogZIMh;Pze=OU8yb1RrA9-7S%fUOzSUOwY0R6gL=?iDgvV(WUFVg zWa_ba)MIvVt7nR2Y^V_*Vpu&>C8OtFTYsi$4sP{Km&~9ZbeD<1s0Z2VnIV~aEFSfk z9o*`fDH$7T#D^GG&n(I48HR-%25i`Dhb7;m)?eA8hRGl=*bzz}DW9u;fGX z+2hVfx#nQ_a6aaUGgv>mxgs#uk4&68(nloM6Sv=Y=4lRgHO?CJiO=f!!ssn}KL5=> zsyY6piiV6IwhVgtfjBwI&HOz#huiOT{O)p4#Jh%#{jP&A{pb8w$e-_C=mv^d1M7^r zT&xqD0_niW3AZ}qlKtykpgGv7>s%;|?`P=!>r7~F>qN#6TLv|gmz?nLw4;OA)yZf2 ze_X2Z;g0)O7OuGA&R#PLd+(eVUi#_bI^WO0Hg)@stm*kv%WvQF=83Tn6~EyAmzEdj fR2`Ym{GZ$c)$z>Z-A?=OXgX+D%v*iv4*C5DY#YYx literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe576_dx12_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe576_dx12_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..cfd9468e32abe403d1de23d24eda737e4e772e0f GIT binary patch literal 6994 zcmeHMdstJ~mOpu&JjnwPP6+CW$U~%hKm-)TgaCqo2BkJAtqCB4@`kaZRPzD?1q~<| z#cB}sQmeiAs2Zzn0u&>l0@@apI-rQO*D6J8(dqQgJ^_2Zy?%GTZ)X0uf6V@J_Svts z)?UB8_TFpdKoA6xbcFaX`lbZ*iP`$m=^y`f)7lHxn>FvuC;WNw2Yyom!o16$HcXqo zX7zr^`bA~lT*B?7l!Rj{X^ig69Y3pFE+~?^w0-L&xAhx8coN&RM_(d_Z@ka|z92=# zE&gS-=gHq%Dl3+JYxGZ}zogIhFRIXg^6{*W8ou+;+UtA$A9uZ5&NOi+2wuyJw&%2B z|NSs1@xA-=9vM4ytUnJ)I%_f$k4Hr-?1AX-dnL|8^RBo1(%0NO+u3;V*X0q#QDV`1 z3y$^v>0ZswwM*(hDg0#l=2>q;|LayO&Xyqf^g%#f$I`!CDERu@IrrB@On~@pAJntd zF?R8vhEAo%2fl1CTJ9{{`%Pleyd_tcTTQ%_r}vuoE~K%t&cFQk$MfQ$q*;Ntp1uK0 z641z{)ylSfhm>WHCWz{gB5d2Hb4#}1qEGy1;>Nu9-{$XGaZ$W;XjTf}D_j;P$)&Fy zKd|RSeF0%~yXT#aT?7EG7axLP@D2h`6nJFdNe53qct%(dv@$Xpqk%GH%OEIv;}i;g9NK{($>Ob7~-nC}Wf|2PoBRHHUo4xo>!a;p|w$t0wO`>0InicL~ODv9mR_zl<+m2JdPI$dMFx%+aehWQ z4^Zl1GxfQYeP6_Rf^v%G>_?;QK@letf(r+z@&T$BEeeT5lnaO$cvZN1v3DKS*?WBX z7tv4u=2RhE7-nz28Nug~DGJ939A7*|#yftMr$FO)?y=h#QT77<;?LFlZ$vqC$Jz%+ z?8X`(lMiKPc~#}Xcg5E-4%5?*R(UgKgo(pCXd*hYp+o9OSrlluXR(4Kd@);iqHW0e zTonU?l*v0F;r9my$2=biXD%l1QwXKl6nF2YLtYh!yqdh3E2RM5@+(WS1-yuO$C7czF?6(Pg5kkCP08*aU!Knj2Rt0Z ze45nl3)Ds=K{zEMdRSz3C3pes9rMj)h4Qk1^s=IK5-8h!DrIMNv$ud8;%vdF`9^91 zO3l)<^IjD;8>ySS;qSTBO-5>-9Pa`H@R6WVPAxQ2H;JfOayIDN0>*U1!@o0;vq9Gu zFs2)RthDvoc;YR_ry?5PZ$&uS$bt-hko*S-Dh;vw+rh^wnl@pq_+lVq38Gh<5WQmsv{Ne!=S~ zlMJEY?KjPU@OiQNO1j6AcCutClZ$ax9X!apqLEx7CmWHahqzS6VOB?jl5yOTaRMSS z8ZZ*W-zX(90*tvNMvzfYVk|T^lNce!ZW1HZI7(tjjTnWIV3blAtBguYM}TpJl5QZN zsj#w!53NXp()SWj1*}wqbEybuxDgnm3n^9~NpuLGkEAdQf=MT5@2Zd4T0q*HXCjCj zn8Ed1tG$!G8T-6n?lY;1d}9ijDKWRWWCtyAAL`fxD^L$w$r&-mVx$x}Xp?VaDBV|# zj3}KG`uh8K_uqQwj`RNhdfDCt*|gfEKG`jD18YA$Oq|7Kt#3{CsZ_ASZ}@XOo0?6g zS*Fu}K07za6nN6_5O$&2uCqD39plE`2oaE@_MtwT%`ETC?ChnFA8lOvL;A?otQ~W@ zs+Kif>pC8rt(GPTxSC_ElxC%!KTMImBs%e>A z7S_krT3`!TW7qn;%0d>NBrTIF3JO-{uV0(BHa9;fdEJuyj8uWHjkPdEBmc-kCVWhC z$;r=HpOG!747US}bk<8fB|S$jnX)kZfRTXfLbB&C9;-a2)Or3K=^VM|`EY>P>y%yO zJ@`ApX7=8*fuEl`>le82SjhQP^st6FZbg=+x=rj!z3Zx1?b_-vyI#!{#1sVAqmKQs z+sB$~?2s}h4%@BnH6IDS>nAsi0F=*JqDGCKq~#o|`O2m8+67;K7G3h-DqxnQsU8)7 zOFb}+tHGHS9NQREvy15#!z>WYZuD-Qol*}N%bP7xzZprC<(zcOBsuTM)t(YlRc(Cj zVC_kq5!NT4d8oTe{U>Viz|h^c4*l5hNXJmeaPKe>k7QysD@I~11wl6Y`6Yuu{3{lK z*cT8tbsteb9JQ%buw~aqW{Sg7CN4Y`2w&BZLbj&jvFvf&@k%dzU9*lKr*R%%J<(MKmeyc_-O5XrIfaxVI3$TR`;(Bw)rLDV{*--5 zw_I-v1i+|*G;jPTIfb7OEI4DsLEF;)O;<~MM^iTd zqx){36~N&F;COGO*ivAafa8dXf8~;?XKzVW?Q5XS2cQgemuMbJ)wXqZ*|jw#Wvk!3 z`q_;*E|~zA_69fVa*mgc3yx?>PYM6hmCs6g0Hy(ee7O4~O(6BSZ6Y;8LoL?cmj3pR z%DY3iTX3rofO!;-+_cn_R@;xhaOz`Rk>0!g75y!3eH}n0iYs9C{>XquK(kFIuIkFAlPB#?)|OlWQwai78SB2P z3C!$1K0lolWYh%rkrvY^D}pF*r&DAG${H)>y>UvO7qw7EeP2i2VnDs#Z&pPeyVi%w zerXo^`ulm2{G&8mnyJMGG^iDpx5^*2hGx>n6|LBaWN~*oBc?#GZy$PCd|I(tqv#VM zXaiMvvZ1?dJLFd_cl7XduKVSy=K)Ub&)w^myc4j*D|Xo&pC=#wnB`OXRYaM^Uj{bE|}+QtQ3W>4IlK#g7w3WjejbJEHm@xx%*kKp z^Fwd{$Z$Z^OflPCY|s|idsW+epS1Vsu`d{~|1O66c39gV`AuPK!Cnc|ZT7B>Tin3Dv!A)nI+_HG=I#$e?H$8M z$uf69djT8+XyCcP3)ls~!ZeE*`b;v_FJuomAxt4n=llaNm}aS>3IQ+v)=vr=!GT{TC|y3V8~+)L!2ME>}N{$JXYAW7R%IY z4X$Yz#WqYM=prq$N)}a;7Ikf|EX<{DrBREb%5rn5TXIR8Hkak1W&AE4`;i{^fU+^p z{ZaO)ls%8zHubL1wNE&;MKLW6D-XV?3GS9GI714#s0q=Mg1bf?H_546)2V^!W%(di zmgVZpa^=)bUerzF6u|aSrpVWebhgX>U(YnLtW zSGaZvUE5SsI~4FYddUK-WP!n!pKlG?EeX<*f_Jyh1wwyS2j3(GH@C9dgw*0((iX3> zP0BKUkAyuw01u(;hXe3)E_)34aeB@ZDd!ocQCSJo`$f2*7R6M&fcs#1;1XU6-cyWJ z)pY-mgUcU0%=r)Io-e;zmu#2@6W4z;J$lQLx}Tn1xai|XJh8auQpnLSADBJp0VJZz zEGLYM2dH+}AFh1y;?8d^4|4JnU9PQsFqp@u?N8i3^ZVM>?Kl21cB+zg=C`QlV}{@A zNcA)OSTr(G6CgK0y}8Hfsk6}N%+y~WG4hwW#fj!+CB$>9r;1u11n-=V+Hn=z^6s2% zw%hY0n`uTY!fRF@|Yo zBdZnT`jT>Qr6zf^&g zs_ITb8b6jsfxuyL!b%G^GE3u&I8JFp06&)IXk%&T!R9i3adu-xt)Y16EYFwKD%EX} z!l!n)OfWQ6d9O+y`|wVrR)Itco5g&udN*1{1IvnKw%L(cZrt|RRE+(I%YF(rD#|=3 zVm?rEo=G`lQg*(GQ7q>?z}U}5!5*Lvo7qpmabSk!BI-5>-lkOVG%K_g5T%s5B5#UP z_Kts`31YX(5nK}mavx)nivCHIV!ZgKC`A?h5X1sAb>bf!A>eBM%ftlO5FN~BGRdtH z=ylJYKom{(0MDL8HcwU{$pI=&`KnSH!sFUPWW0e@O-J|os0 zrW0Kf9JGYnN}q(&J`zeM?YJEod)G`BLjjPWG~z}8`A(_A8srkE$jFwgbkO=6J!q0M z3JAZ>eGc+qK}8n{^OY;wpF2ffet6>QTXv7DKJBVvr?TFP-O-bo%e1d1ezNCtqSmWgXxf3ZazUc+oW>QS#)Be z5=C+|^}g$K;S?-c51}+TNs!KVF%tNd2m;a61O@dSm#*+8i?OmrXCZ*$vU~`Z2r50u z=5#ezhU(=0DsC(-9P3w-Q?X8NxWz|>Nqvjq1!U5c)-;0zOU}jFelzVb!2xchTd;oa z2m$HxV})bM-FQ!@R}*0fF1Zh955U>jJ}&DtxjmOuO_gJvQUuJA1cdq=?S@ynqVcY6 zV%IiHdKkCM9wAMI{Xm?;T{HD)sI1gZCqk5iG@;uU%+h8fLAB@zq!}z7;F#rggIr>x z5AUXvERXn+!a!M%9^`3AkQlQjHE_%jC(?na2uh}DbLxa*bs}+Hn~@;mvg+21YW%n* ztz1ex_#tsLWe-`1#35Q9i3(`b3kiQauv&Nc zcBvQXuj^De*x|!^hKf>*PIn6zhdPZCijQ;HFJlAAhxC11>t&Hpx09kOj&)RzPpp=h z%sI!MEIM*dzbek;oNkt(*7a>>2xvBAi?O7g7#4b(6)UMiT)`rX1334jj8T9+)JPA* z_F=R}dYk-=sO|Cwm2T%PA`bvY0ZJQQDyG6hL~E`H3w5IXbkbbClU`Mv**r8axfx%{ z8&PeNXG!#Y*(h`Dq#Sg9Sez*vO0h!ICGa@nXTBU764U|~&3wea- z;N|t|nvIlWnvzzf1_#1>ymnV!qBvavFSuC^fUf(u=W9avpmA*|@-lIjE z(dz5zEvQUsUGLw3_yqlqMUpl`Vec_$&_-7xJ^*A(xO1{NuD8J6(|2M=Tz^*^VYCk* zKjZt#fQ4wjpVJZM&aRb~FL9sLtc7{nJZGc3v3A0SH0$Sf%*dq+h%YBOo^j3?w4YOb zUK=BFgPA}%?5C2|x%JQO=kg{N*7DRjgJ;#+5k4q&v)@bm;``G5QuUxtk%c<5FV{aHI<}jSt z*Hfs^cq=A3WL0B;cgOy|uZ>c>5@XJ^+(>o4H6gq9z0Zp26IvbFF8^!>nhOLTzV_dv z)HnV+)YIjDeSt|D=Pyoelgh3Mt5<5Cnj|UyB>wzNlXqugJGplXKr|qcmG$|D4G1e^ zh>Uw|{AR(a4xaT-oKH{6iCp91nJ5Ib`sF2O@h8UTj~Q}CKiYPB@%%sjt~DNx4sn*N zE-imFsXyL*_Ue+={uP>`3>1r=02#};E4Flc&VN_MEf)LMCilhvfCS?88w?k{M11U* zKiQNLX#VS1rN4N@%xjUA#_nhRPwW&-{`_deOe+qkzZn@~G|g{*#uAv!AQjjh%21ha S`cngok&Ja&oe$;%^#K4OY{sqt literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe576_vulkan_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe576_vulkan_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..a2d1bcd5e37b653bfe2dfda4c7f0f0f719d33c11 GIT binary patch literal 10274 zcmbuF33Qaz6~`xpeF-2-*bD=RvM92JO(6*hBp^#j0|@ zNL`gO;mHH71{}yqTmMDJZQn1RxqIIm8!pXEc_3?f-&O;L_gH=O&Ww)Jrrs9V_vG4z z7p5GXURtt!Md2l@p1Seaigvq0(_gywKsfi{`uWR0A9K&f_1ERpef{_~imOpDHtVaY z=k5CUvuoGnzrDGCd4m%TdiJkgvwp|6?k{d=n|@^GE1UX%_R?jm8$I4E>EQdj`pWoo zz5lyeV9JaS`+c(c#Z`?TIFh@6Lv+f$1*1Y|DfP#%<)$C$_sZTr4W=D_WdD{sz8ybe zSwT+rjKSMq+j@Azx|#X6?x@-^eo6OoW{*>#F`n*t8NV+t6yO_E0SY=fxRyBN4d3iX| z%iHjpkaFMrgecyv)kI4@jTnqN3k7^^_X zh$kX*A~CSK9>$sz@v2Z&BrY_W2U~h$t19||zMkhtA1mUE!xiCJRf+nesUjwI^w;w( zUJxpc#O5S*$$a$F)8)n&#i}Z6eCVf#k6TosMph<$8hW|trRhc`5}~q4C{`LS2`>pp zom~UZj=q{*UWCq`w6fY*n`cu{U0D@QgexP|P~Y=!Xu7eXC91(f)YRC>^yA`*icoZT zBy_U=#-^JT319AM=tr`yCZ@B9BbF?P$J99Cbpy#YrkRazfpb;f+<3H1sv5hdW;a|L zIkzenuBm6&0am%w&Ds0nc`LsC0h0POvYc)u+cO zX)`tw8<~j5s<5;5NM}84VRpr(iFhR`TG*TWp%`Um;ZOkrNZ*DXkN(l094Cmnt zcQScfJ)7D;cw6%IvT!drCmlr0xeLtCc5}{oXAuKE^G@C@Ip?hV^~}+8PqC*azn(dI z?kjq75tIEd@ZI|^nllU|9+=;b7+^t>*|8ol9#_Ly6Ig#A#=Qp1_F>ckHpYjs9*gJ#=lrtsw z;!JT*srx)})&WM{-Nf;sZuH&7Q$*m*d$>6^E#%o#ypycY7e}_WULZLrVy(TzsX2+& z4qPai_XM1ry~SA{bujNEPJHI%>?@8vF_`xgPwJBM{%%eT^qFpM_5<9UeqJO!d&L{a zusQJ=%;^bl7CD&H1NxET=JbGb$-KKXoVkG_J3E6UFCCasbCw2ct}&F_hDabT>$6^6 zB$>Nq^NS_d5n(@69DB}$>4!S7b2KN0>4!^Z{Wi~)%w0{|G$>`0$ zNHQ_Nm#H4=FBXB{uN<6#5)o?xrw0?o87E|qZjuO$J|G_#r%%kmnP2MW@MG!;wNDn& z2W+N@rix5AO|t2xJKZi<&t;mUZzcLtHOz2&F|Q`{GezLkfXv#+IZMP^3Kgrjct}L7 zSt5GG`J64{9O2VPyi|l;j!@2dnaKLf8OM*lg`JKbl}l#WIhiAwTHxE=I_65ohxZcm4axV1b({m<-qe~I_a}t9&Ya$lhucx+SdabFuQbg^nk$B|gGZmj4^{TIUm1v}h zy&9&vnd3+AiLpoo_L%GKVuulDoBGyF{BjX^3lV4QD%pZ__Be~^sgZL?&2Y2f43ZmP zY&gf*aK`LxEs;E0#5w6FUM*@UA{TETwFbqPiqP?1kpD*xqlbnqa~SWG-PPriu|>DW z`CcKJyy)!yUMU%TrL(z8@~Ji}gn@Gp`iNgG!Vf&II_c>(BKmTjY?xo`u)*T2G1JqX zTw`0!Z9lGey4~{4ki1faKRD-Zl{kZQhiqg1+i(cD)tdq>XF|7CNC1Z<@I)dUq5rOB4 z7-qXcvc)vpp9%xVhrPFbzDY7M$!|6NOfvrH%>QP|;KbpauqOk=H;U}srAww4UBz#4 zI_!o@-Xt(MKYMJm2-2Kh<)cQQ^T)B^oz61{BDO)+ttE? z;#)=RaVL@a-Q#fc+om}_;5WKh+a-f{7G2}89g@j`&fea8CDSu{eUIwO5Wi0Z&Yiel zoWY#{e?SDr`9vPCZ?n|CQ^X!Yj1&?3f0J@I7T+bp2IBmJJt)GSyJ7eFA%~-*ZtNZw zffK{l_iM?l2c6}3#9`#Hc#ld3?;WH zkxY&LxO+6m2c5-zLNc+@aks5^aK2ZN=SdNT&QZ)?t8 zq2qkmp1|#V9B?+A8SI}IVf&6a`vj&+jpHql1Ga0=gs3@{z-I5WZ!QNJFJa3XYNCB2C>l{5rGjKnKh7~IXG|Z zQ1L&D8j4s)j);6|;(rmL!>+&hUqxm&Trzge#6NO6d$T|G+2uOB*5ZE?p|dyp?+!~B zr~XgG8TNhoQ_0i{zuWcnGs#;-_~P@qID<8#`$7bUA2RPcHU2|ndtu)N|0&G&2))@J zmCTyhH?#ehWNg9E(@V<(xASmJGQQM|4>g$XOUcxLj@;;o&sq6OME&IGD6;QgUrWZ% z=Eo(I!`{UclCc>iYOGkClW#=a1@;QP*?udzsR+Gc-%0KwA_ngp{{I$%HxaFJ*!ONu ze)A;>w&?7$BSjc~=*+H`WN^srQYB-DuCYGT$Xgp5@tz{|ZN#y$b=7ft`h%_Ebsf%` zWsR1%o^W*dnQeV%OI*Kg1L5efEmR-7O5ad2G0;&v=dF=AgY(9oHP#%A^M*_we49wt zkN0m1#NoVfzOlpJ-mo;u+%t%QPc6}vicg%T0d2C|-~OC|-y!^w$_Kj-D0LcgBgU(_OlVUmf7j=RQtktNycw|kW>44icumLr*c0ki%Om#iP}-#gL!`=6^h zaj>ymd6I2i7I%a&aMo|wNXg^^vt0R-_2cD2@6T1BIdQPDT%#o0dM)l~Vc_(|uuCM9 z3(Rtjk*pst7kYoLv6>SH8#`CyB(q-XK>x6M%V+d>hjZrmEGX2R!Dj)w2_i7wcw~M@ zXHSYGcMvBogZIMh;Pze=OU8yb1RrA9-7S%fUOzSUOwY0R6gL=?iDgvV(WUFVg zWa_ba)MIvVt7nR2Y^V_*Vpu&>C8OtFTYsi$4sP{Km&~9ZbeD<1s0Z2VnIV~aEFSfk z9o*`fDH$7T#D^GG&n(I48HR-%25i`Dhb7;m)?eA8hRGl=*bzz}DW9u;fGX z+2hVfx#nQ_a6aaUGgv>mxgs#uk4&68(nloM6Sv=Y=4lRgHO?CJiO=f!!ssn}KL5=> zsyY6piiV6IwhVgtfjBwI&HOz#huiOT{O)p4#Jh%#{jP&A{pb8w$e-_C=mv^d1M7^r zT&xqD0_niW3AZ}qlKtykpgGv7>s%;|?`P=!>r7~F>qN#6TLv|gmz?nLw4;OA)yZf2 ze_X2Z;g0)O7OuGA&R#PLd+(eVUi#_bI^WO0Hg)@stm*kv%WvQF=83Tn6~EyAmzEdj fR2`Ym{GZ$c)$z>Z-A?=OXgX+D%v*iv4*C5DY#YYx literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe720_dx12_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe720_dx12_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..cfd9468e32abe403d1de23d24eda737e4e772e0f GIT binary patch literal 6994 zcmeHMdstJ~mOpu&JjnwPP6+CW$U~%hKm-)TgaCqo2BkJAtqCB4@`kaZRPzD?1q~<| z#cB}sQmeiAs2Zzn0u&>l0@@apI-rQO*D6J8(dqQgJ^_2Zy?%GTZ)X0uf6V@J_Svts z)?UB8_TFpdKoA6xbcFaX`lbZ*iP`$m=^y`f)7lHxn>FvuC;WNw2Yyom!o16$HcXqo zX7zr^`bA~lT*B?7l!Rj{X^ig69Y3pFE+~?^w0-L&xAhx8coN&RM_(d_Z@ka|z92=# zE&gS-=gHq%Dl3+JYxGZ}zogIhFRIXg^6{*W8ou+;+UtA$A9uZ5&NOi+2wuyJw&%2B z|NSs1@xA-=9vM4ytUnJ)I%_f$k4Hr-?1AX-dnL|8^RBo1(%0NO+u3;V*X0q#QDV`1 z3y$^v>0ZswwM*(hDg0#l=2>q;|LayO&Xyqf^g%#f$I`!CDERu@IrrB@On~@pAJntd zF?R8vhEAo%2fl1CTJ9{{`%Pleyd_tcTTQ%_r}vuoE~K%t&cFQk$MfQ$q*;Ntp1uK0 z641z{)ylSfhm>WHCWz{gB5d2Hb4#}1qEGy1;>Nu9-{$XGaZ$W;XjTf}D_j;P$)&Fy zKd|RSeF0%~yXT#aT?7EG7axLP@D2h`6nJFdNe53qct%(dv@$Xpqk%GH%OEIv;}i;g9NK{($>Ob7~-nC}Wf|2PoBRHHUo4xo>!a;p|w$t0wO`>0InicL~ODv9mR_zl<+m2JdPI$dMFx%+aehWQ z4^Zl1GxfQYeP6_Rf^v%G>_?;QK@letf(r+z@&T$BEeeT5lnaO$cvZN1v3DKS*?WBX z7tv4u=2RhE7-nz28Nug~DGJ939A7*|#yftMr$FO)?y=h#QT77<;?LFlZ$vqC$Jz%+ z?8X`(lMiKPc~#}Xcg5E-4%5?*R(UgKgo(pCXd*hYp+o9OSrlluXR(4Kd@);iqHW0e zTonU?l*v0F;r9my$2=biXD%l1QwXKl6nF2YLtYh!yqdh3E2RM5@+(WS1-yuO$C7czF?6(Pg5kkCP08*aU!Knj2Rt0Z ze45nl3)Ds=K{zEMdRSz3C3pes9rMj)h4Qk1^s=IK5-8h!DrIMNv$ud8;%vdF`9^91 zO3l)<^IjD;8>ySS;qSTBO-5>-9Pa`H@R6WVPAxQ2H;JfOayIDN0>*U1!@o0;vq9Gu zFs2)RthDvoc;YR_ry?5PZ$&uS$bt-hko*S-Dh;vw+rh^wnl@pq_+lVq38Gh<5WQmsv{Ne!=S~ zlMJEY?KjPU@OiQNO1j6AcCutClZ$ax9X!apqLEx7CmWHahqzS6VOB?jl5yOTaRMSS z8ZZ*W-zX(90*tvNMvzfYVk|T^lNce!ZW1HZI7(tjjTnWIV3blAtBguYM}TpJl5QZN zsj#w!53NXp()SWj1*}wqbEybuxDgnm3n^9~NpuLGkEAdQf=MT5@2Zd4T0q*HXCjCj zn8Ed1tG$!G8T-6n?lY;1d}9ijDKWRWWCtyAAL`fxD^L$w$r&-mVx$x}Xp?VaDBV|# zj3}KG`uh8K_uqQwj`RNhdfDCt*|gfEKG`jD18YA$Oq|7Kt#3{CsZ_ASZ}@XOo0?6g zS*Fu}K07za6nN6_5O$&2uCqD39plE`2oaE@_MtwT%`ETC?ChnFA8lOvL;A?otQ~W@ zs+Kif>pC8rt(GPTxSC_ElxC%!KTMImBs%e>A z7S_krT3`!TW7qn;%0d>NBrTIF3JO-{uV0(BHa9;fdEJuyj8uWHjkPdEBmc-kCVWhC z$;r=HpOG!747US}bk<8fB|S$jnX)kZfRTXfLbB&C9;-a2)Or3K=^VM|`EY>P>y%yO zJ@`ApX7=8*fuEl`>le82SjhQP^st6FZbg=+x=rj!z3Zx1?b_-vyI#!{#1sVAqmKQs z+sB$~?2s}h4%@BnH6IDS>nAsi0F=*JqDGCKq~#o|`O2m8+67;K7G3h-DqxnQsU8)7 zOFb}+tHGHS9NQREvy15#!z>WYZuD-Qol*}N%bP7xzZprC<(zcOBsuTM)t(YlRc(Cj zVC_kq5!NT4d8oTe{U>Viz|h^c4*l5hNXJmeaPKe>k7QysD@I~11wl6Y`6Yuu{3{lK z*cT8tbsteb9JQ%buw~aqW{Sg7CN4Y`2w&BZLbj&jvFvf&@k%dzU9*lKr*R%%J<(MKmeyc_-O5XrIfaxVI3$TR`;(Bw)rLDV{*--5 zw_I-v1i+|*G;jPTIfb7OEI4DsLEF;)O;<~MM^iTd zqx){36~N&F;COGO*ivAafa8dXf8~;?XKzVW?Q5XS2cQgemuMbJ)wXqZ*|jw#Wvk!3 z`q_;*E|~zA_69fVa*mgc3yx?>PYM6hmCs6g0Hy(ee7O4~O(6BSZ6Y;8LoL?cmj3pR z%DY3iTX3rofO!;-+_cn_R@;xhaOz`Rk>0!g75y!3eH}n0iYs9C{>XquK(kFIuIkFAlPB#?)|OlWQwai78SB2P z3C!$1K0lolWYh%rkrvY^D}pF*r&DAG${H)>y>UvO7qw7EeP2i2VnDs#Z&pPeyVi%w zerXo^`ulm2{G&8mnyJMGG^iDpx5^*2hGx>n6|LBaWN~*oBc?#GZy$PCd|I(tqv#VM zXaiMvvZ1?dJLFd_cl7XduKVSy=K)Ub&)w^myc4j*D|Xo&pC=#wnB`OXRYaM^Uj{bE|}+QtQ3W>4IlK#g7w3WjejbJEHm@xx%*kKp z^Fwd{$Z$Z^OflPCY|s|idsW+epS1Vsu`d{~|1O66c39gV`AuPK!Cnc|ZT7B>Tin3Dv!A)nI+_HG=I#$e?H$8M z$uf69djT8+XyCcP3)ls~!ZeE*`b;v_FJuomAxt4n=llaNm}aS>3IQ+v)=vr=!GT{TC|y3V8~+)L!2ME>}N{$JXYAW7R%IY z4X$Yz#WqYM=prq$N)}a;7Ikf|EX<{DrBREb%5rn5TXIR8Hkak1W&AE4`;i{^fU+^p z{ZaO)ls%8zHubL1wNE&;MKLW6D-XV?3GS9GI714#s0q=Mg1bf?H_546)2V^!W%(di zmgVZpa^=)bUerzF6u|aSrpVWebhgX>U(YnLtW zSGaZvUE5SsI~4FYddUK-WP!n!pKlG?EeX<*f_Jyh1wwyS2j3(GH@C9dgw*0((iX3> zP0BKUkAyuw01u(;hXe3)E_)34aeB@ZDd!ocQCSJo`$f2*7R6M&fcs#1;1XU6-cyWJ z)pY-mgUcU0%=r)Io-e;zmu#2@6W4z;J$lQLx}Tn1xai|XJh8auQpnLSADBJp0VJZz zEGLYM2dH+}AFh1y;?8d^4|4JnU9PQsFqp@u?N8i3^ZVM>?Kl21cB+zg=C`QlV}{@A zNcA)OSTr(G6CgK0y}8Hfsk6}N%+y~WG4hwW#fj!+CB$>9r;1u11n-=V+Hn=z^6s2% zw%hY0n`uTY!fRF@|Yo zBdZnT`jT>Qr6zf^&g zs_ITb8b6jsfxuyL!b%G^GE3u&I8JFp06&)IXk%&T!R9i3adu-xt)Y16EYFwKD%EX} z!l!n)OfWQ6d9O+y`|wVrR)Itco5g&udN*1{1IvnKw%L(cZrt|RRE+(I%YF(rD#|=3 zVm?rEo=G`lQg*(GQ7q>?z}U}5!5*Lvo7qpmabSk!BI-5>-lkOVG%K_g5T%s5B5#UP z_Kts`31YX(5nK}mavx)nivCHIV!ZgKC`A?h5X1sAb>bf!A>eBM%ftlO5FN~BGRdtH z=ylJYKom{(0MDL8HcwU{$pI=&`KnSH!sFUPWW0e@O-J|os0 zrW0Kf9JGYnN}q(&J`zeM?YJEod)G`BLjjPWG~z}8`A(_A8srkE$jFwgbkO=6J!q0M z3JAZ>eGc+qK}8n{^OY;wpF2ffet6>QTXv7DKJBVvr?TFP-O-bo%e1d1ezNCtqSmWgXxf3ZazUc+oW>QS#)Be z5=C+|^}g$K;S?-c51}+TNs!KVF%tNd2m;a61O@dSm#*+8i?OmrXCZ*$vU~`Z2r50u z=5#ezhU(=0DsC(-9P3w-Q?X8NxWz|>Nqvjq1!U5c)-;0zOU}jFelzVb!2xchTd;oa z2m$HxV})bM-FQ!@R}*0fF1Zh955U>jJ}&DtxjmOuO_gJvQUuJA1cdq=?S@ynqVcY6 zV%IiHdKkCM9wAMI{Xm?;T{HD)sI1gZCqk5iG@;uU%+h8fLAB@zq!}z7;F#rggIr>x z5AUXvERXn+!a!M%9^`3AkQlQjHE_%jC(?na2uh}DbLxa*bs}+Hn~@;mvg+21YW%n* ztz1ex_#tsLWe-`1#35Q9i3(`b3kiQauv&Nc zcBvQXuj^De*x|!^hKf>*PIn6zhdPZCijQ;HFJlAAhxC11>t&Hpx09kOj&)RzPpp=h z%sI!MEIM*dzbek;oNkt(*7a>>2xvBAi?O7g7#4b(6)UMiT)`rX1334jj8T9+)JPA* z_F=R}dYk-=sO|Cwm2T%PA`bvY0ZJQQDyG6hL~E`H3w5IXbkbbClU`Mv**r8axfx%{ z8&PeNXG!#Y*(h`Dq#Sg9Sez*vO0h!ICGa@nXTBU764U|~&3wea- z;N|t|nvIlWnvzzf1_#1>ymnV!qBvavFSuC^fUf(u=W9avpmA*|@-lIjE z(dz5zEvQUsUGLw3_yqlqMUpl`Vec_$&_-7xJ^*A(xO1{NuD8J6(|2M=Tz^*^VYCk* zKjZt#fQ4wjpVJZM&aRb~FL9sLtc7{nJZGc3v3A0SH0$Sf%*dq+h%YBOo^j3?w4YOb zUK=BFgPA}%?5C2|x%JQO=kg{N*7DRjgJ;#+5k4q&v)@bm;``G5QuUxtk%c<5FV{aHI<}jSt z*Hfs^cq=A3WL0B;cgOy|uZ>c>5@XJ^+(>o4H6gq9z0Zp26IvbFF8^!>nhOLTzV_dv z)HnV+)YIjDeSt|D=Pyoelgh3Mt5<5Cnj|UyB>wzNlXqugJGplXKr|qcmG$|D4G1e^ zh>Uw|{AR(a4xaT-oKH{6iCp91nJ5Ib`sF2O@h8UTj~Q}CKiYPB@%%sjt~DNx4sn*N zE-imFsXyL*_Ue+={uP>`3>1r=02#};E4Flc&VN_MEf)LMCilhvfCS?88w?k{M11U* zKiQNLX#VS1rN4N@%xjUA#_nhRPwW&-{`_deOe+qkzZn@~G|g{*#uAv!AQjjh%21ha S`cngok&Ja&oe$;%^#K4OY{sqt literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe720_vulkan_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe720_vulkan_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..a2d1bcd5e37b653bfe2dfda4c7f0f0f719d33c11 GIT binary patch literal 10274 zcmbuF33Qaz6~`xpeF-2-*bD=RvM92JO(6*hBp^#j0|@ zNL`gO;mHH71{}yqTmMDJZQn1RxqIIm8!pXEc_3?f-&O;L_gH=O&Ww)Jrrs9V_vG4z z7p5GXURtt!Md2l@p1Seaigvq0(_gywKsfi{`uWR0A9K&f_1ERpef{_~imOpDHtVaY z=k5CUvuoGnzrDGCd4m%TdiJkgvwp|6?k{d=n|@^GE1UX%_R?jm8$I4E>EQdj`pWoo zz5lyeV9JaS`+c(c#Z`?TIFh@6Lv+f$1*1Y|DfP#%<)$C$_sZTr4W=D_WdD{sz8ybe zSwT+rjKSMq+j@Azx|#X6?x@-^eo6OoW{*>#F`n*t8NV+t6yO_E0SY=fxRyBN4d3iX| z%iHjpkaFMrgecyv)kI4@jTnqN3k7^^_X zh$kX*A~CSK9>$sz@v2Z&BrY_W2U~h$t19||zMkhtA1mUE!xiCJRf+nesUjwI^w;w( zUJxpc#O5S*$$a$F)8)n&#i}Z6eCVf#k6TosMph<$8hW|trRhc`5}~q4C{`LS2`>pp zom~UZj=q{*UWCq`w6fY*n`cu{U0D@QgexP|P~Y=!Xu7eXC91(f)YRC>^yA`*icoZT zBy_U=#-^JT319AM=tr`yCZ@B9BbF?P$J99Cbpy#YrkRazfpb;f+<3H1sv5hdW;a|L zIkzenuBm6&0am%w&Ds0nc`LsC0h0POvYc)u+cO zX)`tw8<~j5s<5;5NM}84VRpr(iFhR`TG*TWp%`Um;ZOkrNZ*DXkN(l094Cmnt zcQScfJ)7D;cw6%IvT!drCmlr0xeLtCc5}{oXAuKE^G@C@Ip?hV^~}+8PqC*azn(dI z?kjq75tIEd@ZI|^nllU|9+=;b7+^t>*|8ol9#_Ly6Ig#A#=Qp1_F>ckHpYjs9*gJ#=lrtsw z;!JT*srx)})&WM{-Nf;sZuH&7Q$*m*d$>6^E#%o#ypycY7e}_WULZLrVy(TzsX2+& z4qPai_XM1ry~SA{bujNEPJHI%>?@8vF_`xgPwJBM{%%eT^qFpM_5<9UeqJO!d&L{a zusQJ=%;^bl7CD&H1NxET=JbGb$-KKXoVkG_J3E6UFCCasbCw2ct}&F_hDabT>$6^6 zB$>Nq^NS_d5n(@69DB}$>4!S7b2KN0>4!^Z{Wi~)%w0{|G$>`0$ zNHQ_Nm#H4=FBXB{uN<6#5)o?xrw0?o87E|qZjuO$J|G_#r%%kmnP2MW@MG!;wNDn& z2W+N@rix5AO|t2xJKZi<&t;mUZzcLtHOz2&F|Q`{GezLkfXv#+IZMP^3Kgrjct}L7 zSt5GG`J64{9O2VPyi|l;j!@2dnaKLf8OM*lg`JKbl}l#WIhiAwTHxE=I_65ohxZcm4axV1b({m<-qe~I_a}t9&Ya$lhucx+SdabFuQbg^nk$B|gGZmj4^{TIUm1v}h zy&9&vnd3+AiLpoo_L%GKVuulDoBGyF{BjX^3lV4QD%pZ__Be~^sgZL?&2Y2f43ZmP zY&gf*aK`LxEs;E0#5w6FUM*@UA{TETwFbqPiqP?1kpD*xqlbnqa~SWG-PPriu|>DW z`CcKJyy)!yUMU%TrL(z8@~Ji}gn@Gp`iNgG!Vf&II_c>(BKmTjY?xo`u)*T2G1JqX zTw`0!Z9lGey4~{4ki1faKRD-Zl{kZQhiqg1+i(cD)tdq>XF|7CNC1Z<@I)dUq5rOB4 z7-qXcvc)vpp9%xVhrPFbzDY7M$!|6NOfvrH%>QP|;KbpauqOk=H;U}srAww4UBz#4 zI_!o@-Xt(MKYMJm2-2Kh<)cQQ^T)B^oz61{BDO)+ttE? z;#)=RaVL@a-Q#fc+om}_;5WKh+a-f{7G2}89g@j`&fea8CDSu{eUIwO5Wi0Z&Yiel zoWY#{e?SDr`9vPCZ?n|CQ^X!Yj1&?3f0J@I7T+bp2IBmJJt)GSyJ7eFA%~-*ZtNZw zffK{l_iM?l2c6}3#9`#Hc#ld3?;WH zkxY&LxO+6m2c5-zLNc+@aks5^aK2ZN=SdNT&QZ)?t8 zq2qkmp1|#V9B?+A8SI}IVf&6a`vj&+jpHql1Ga0=gs3@{z-I5WZ!QNJFJa3XYNCB2C>l{5rGjKnKh7~IXG|Z zQ1L&D8j4s)j);6|;(rmL!>+&hUqxm&Trzge#6NO6d$T|G+2uOB*5ZE?p|dyp?+!~B zr~XgG8TNhoQ_0i{zuWcnGs#;-_~P@qID<8#`$7bUA2RPcHU2|ndtu)N|0&G&2))@J zmCTyhH?#ehWNg9E(@V<(xASmJGQQM|4>g$XOUcxLj@;;o&sq6OME&IGD6;QgUrWZ% z=Eo(I!`{UclCc>iYOGkClW#=a1@;QP*?udzsR+Gc-%0KwA_ngp{{I$%HxaFJ*!ONu ze)A;>w&?7$BSjc~=*+H`WN^srQYB-DuCYGT$Xgp5@tz{|ZN#y$b=7ft`h%_Ebsf%` zWsR1%o^W*dnQeV%OI*Kg1L5efEmR-7O5ad2G0;&v=dF=AgY(9oHP#%A^M*_we49wt zkN0m1#NoVfzOlpJ-mo;u+%t%QPc6}vicg%T0d2C|-~OC|-y!^w$_Kj-D0LcgBgU(_OlVUmf7j=RQtktNycw|kW>44icumLr*c0ki%Om#iP}-#gL!`=6^h zaj>ymd6I2i7I%a&aMo|wNXg^^vt0R-_2cD2@6T1BIdQPDT%#o0dM)l~Vc_(|uuCM9 z3(Rtjk*pst7kYoLv6>SH8#`CyB(q-XK>x6M%V+d>hjZrmEGX2R!Dj)w2_i7wcw~M@ zXHSYGcMvBogZIMh;Pze=OU8yb1RrA9-7S%fUOzSUOwY0R6gL=?iDgvV(WUFVg zWa_ba)MIvVt7nR2Y^V_*Vpu&>C8OtFTYsi$4sP{Km&~9ZbeD<1s0Z2VnIV~aEFSfk z9o*`fDH$7T#D^GG&n(I48HR-%25i`Dhb7;m)?eA8hRGl=*bzz}DW9u;fGX z+2hVfx#nQ_a6aaUGgv>mxgs#uk4&68(nloM6Sv=Y=4lRgHO?CJiO=f!!ssn}KL5=> zsyY6piiV6IwhVgtfjBwI&HOz#huiOT{O)p4#Jh%#{jP&A{pb8w$e-_C=mv^d1M7^r zT&xqD0_niW3AZ}qlKtykpgGv7>s%;|?`P=!>r7~F>qN#6TLv|gmz?nLw4;OA)yZf2 ze_X2Z;g0)O7OuGA&R#PLd+(eVUi#_bI^WO0Hg)@stm*kv%WvQF=83Tn6~EyAmzEdj fR2`Ym{GZ$c)$z>Z-A?=OXgX+D%v*iv4*C5DY#YYx literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe864_dx12_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe864_dx12_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..cfd9468e32abe403d1de23d24eda737e4e772e0f GIT binary patch literal 6994 zcmeHMdstJ~mOpu&JjnwPP6+CW$U~%hKm-)TgaCqo2BkJAtqCB4@`kaZRPzD?1q~<| z#cB}sQmeiAs2Zzn0u&>l0@@apI-rQO*D6J8(dqQgJ^_2Zy?%GTZ)X0uf6V@J_Svts z)?UB8_TFpdKoA6xbcFaX`lbZ*iP`$m=^y`f)7lHxn>FvuC;WNw2Yyom!o16$HcXqo zX7zr^`bA~lT*B?7l!Rj{X^ig69Y3pFE+~?^w0-L&xAhx8coN&RM_(d_Z@ka|z92=# zE&gS-=gHq%Dl3+JYxGZ}zogIhFRIXg^6{*W8ou+;+UtA$A9uZ5&NOi+2wuyJw&%2B z|NSs1@xA-=9vM4ytUnJ)I%_f$k4Hr-?1AX-dnL|8^RBo1(%0NO+u3;V*X0q#QDV`1 z3y$^v>0ZswwM*(hDg0#l=2>q;|LayO&Xyqf^g%#f$I`!CDERu@IrrB@On~@pAJntd zF?R8vhEAo%2fl1CTJ9{{`%Pleyd_tcTTQ%_r}vuoE~K%t&cFQk$MfQ$q*;Ntp1uK0 z641z{)ylSfhm>WHCWz{gB5d2Hb4#}1qEGy1;>Nu9-{$XGaZ$W;XjTf}D_j;P$)&Fy zKd|RSeF0%~yXT#aT?7EG7axLP@D2h`6nJFdNe53qct%(dv@$Xpqk%GH%OEIv;}i;g9NK{($>Ob7~-nC}Wf|2PoBRHHUo4xo>!a;p|w$t0wO`>0InicL~ODv9mR_zl<+m2JdPI$dMFx%+aehWQ z4^Zl1GxfQYeP6_Rf^v%G>_?;QK@letf(r+z@&T$BEeeT5lnaO$cvZN1v3DKS*?WBX z7tv4u=2RhE7-nz28Nug~DGJ939A7*|#yftMr$FO)?y=h#QT77<;?LFlZ$vqC$Jz%+ z?8X`(lMiKPc~#}Xcg5E-4%5?*R(UgKgo(pCXd*hYp+o9OSrlluXR(4Kd@);iqHW0e zTonU?l*v0F;r9my$2=biXD%l1QwXKl6nF2YLtYh!yqdh3E2RM5@+(WS1-yuO$C7czF?6(Pg5kkCP08*aU!Knj2Rt0Z ze45nl3)Ds=K{zEMdRSz3C3pes9rMj)h4Qk1^s=IK5-8h!DrIMNv$ud8;%vdF`9^91 zO3l)<^IjD;8>ySS;qSTBO-5>-9Pa`H@R6WVPAxQ2H;JfOayIDN0>*U1!@o0;vq9Gu zFs2)RthDvoc;YR_ry?5PZ$&uS$bt-hko*S-Dh;vw+rh^wnl@pq_+lVq38Gh<5WQmsv{Ne!=S~ zlMJEY?KjPU@OiQNO1j6AcCutClZ$ax9X!apqLEx7CmWHahqzS6VOB?jl5yOTaRMSS z8ZZ*W-zX(90*tvNMvzfYVk|T^lNce!ZW1HZI7(tjjTnWIV3blAtBguYM}TpJl5QZN zsj#w!53NXp()SWj1*}wqbEybuxDgnm3n^9~NpuLGkEAdQf=MT5@2Zd4T0q*HXCjCj zn8Ed1tG$!G8T-6n?lY;1d}9ijDKWRWWCtyAAL`fxD^L$w$r&-mVx$x}Xp?VaDBV|# zj3}KG`uh8K_uqQwj`RNhdfDCt*|gfEKG`jD18YA$Oq|7Kt#3{CsZ_ASZ}@XOo0?6g zS*Fu}K07za6nN6_5O$&2uCqD39plE`2oaE@_MtwT%`ETC?ChnFA8lOvL;A?otQ~W@ zs+Kif>pC8rt(GPTxSC_ElxC%!KTMImBs%e>A z7S_krT3`!TW7qn;%0d>NBrTIF3JO-{uV0(BHa9;fdEJuyj8uWHjkPdEBmc-kCVWhC z$;r=HpOG!747US}bk<8fB|S$jnX)kZfRTXfLbB&C9;-a2)Or3K=^VM|`EY>P>y%yO zJ@`ApX7=8*fuEl`>le82SjhQP^st6FZbg=+x=rj!z3Zx1?b_-vyI#!{#1sVAqmKQs z+sB$~?2s}h4%@BnH6IDS>nAsi0F=*JqDGCKq~#o|`O2m8+67;K7G3h-DqxnQsU8)7 zOFb}+tHGHS9NQREvy15#!z>WYZuD-Qol*}N%bP7xzZprC<(zcOBsuTM)t(YlRc(Cj zVC_kq5!NT4d8oTe{U>Viz|h^c4*l5hNXJmeaPKe>k7QysD@I~11wl6Y`6Yuu{3{lK z*cT8tbsteb9JQ%buw~aqW{Sg7CN4Y`2w&BZLbj&jvFvf&@k%dzU9*lKr*R%%J<(MKmeyc_-O5XrIfaxVI3$TR`;(Bw)rLDV{*--5 zw_I-v1i+|*G;jPTIfb7OEI4DsLEF;)O;<~MM^iTd zqx){36~N&F;COGO*ivAafa8dXf8~;?XKzVW?Q5XS2cQgemuMbJ)wXqZ*|jw#Wvk!3 z`q_;*E|~zA_69fVa*mgc3yx?>PYM6hmCs6g0Hy(ee7O4~O(6BSZ6Y;8LoL?cmj3pR z%DY3iTX3rofO!;-+_cn_R@;xhaOz`Rk>0!g75y!3eH}n0iYs9C{>XquK(kFIuIkFAlPB#?)|OlWQwai78SB2P z3C!$1K0lolWYh%rkrvY^D}pF*r&DAG${H)>y>UvO7qw7EeP2i2VnDs#Z&pPeyVi%w zerXo^`ulm2{G&8mnyJMGG^iDpx5^*2hGx>n6|LBaWN~*oBc?#GZy$PCd|I(tqv#VM zXaiMvvZ1?dJLFd_cl7XduKVSy=K)Ub&)w^myc4j*D|Xo&pC=#wnB`OXRYaM^Uj{bE|}+QtQ3W>4IlK#g7w3WjejbJEHm@xx%*kKp z^Fwd{$Z$Z^OflPCY|s|idsW+epS1Vsu`d{~|1O66c39gV`AuPK!Cnc|ZT7B>Tin3Dv!A)nI+_HG=I#$e?H$8M z$uf69djT8+XyCcP3)ls~!ZeE*`b;v_FJuomAxt4n=llaNm}aS>3IQ+v)=vr=!GT{TC|y3V8~+)L!2ME>}N{$JXYAW7R%IY z4X$Yz#WqYM=prq$N)}a;7Ikf|EX<{DrBREb%5rn5TXIR8Hkak1W&AE4`;i{^fU+^p z{ZaO)ls%8zHubL1wNE&;MKLW6D-XV?3GS9GI714#s0q=Mg1bf?H_546)2V^!W%(di zmgVZpa^=)bUerzF6u|aSrpVWebhgX>U(YnLtW zSGaZvUE5SsI~4FYddUK-WP!n!pKlG?EeX<*f_Jyh1wwyS2j3(GH@C9dgw*0((iX3> zP0BKUkAyuw01u(;hXe3)E_)34aeB@ZDd!ocQCSJo`$f2*7R6M&fcs#1;1XU6-cyWJ z)pY-mgUcU0%=r)Io-e;zmu#2@6W4z;J$lQLx}Tn1xai|XJh8auQpnLSADBJp0VJZz zEGLYM2dH+}AFh1y;?8d^4|4JnU9PQsFqp@u?N8i3^ZVM>?Kl21cB+zg=C`QlV}{@A zNcA)OSTr(G6CgK0y}8Hfsk6}N%+y~WG4hwW#fj!+CB$>9r;1u11n-=V+Hn=z^6s2% zw%hY0n`uTY!fRF@|Yo zBdZnT`jT>Qr6zf^&g zs_ITb8b6jsfxuyL!b%G^GE3u&I8JFp06&)IXk%&T!R9i3adu-xt)Y16EYFwKD%EX} z!l!n)OfWQ6d9O+y`|wVrR)Itco5g&udN*1{1IvnKw%L(cZrt|RRE+(I%YF(rD#|=3 zVm?rEo=G`lQg*(GQ7q>?z}U}5!5*Lvo7qpmabSk!BI-5>-lkOVG%K_g5T%s5B5#UP z_Kts`31YX(5nK}mavx)nivCHIV!ZgKC`A?h5X1sAb>bf!A>eBM%ftlO5FN~BGRdtH z=ylJYKom{(0MDL8HcwU{$pI=&`KnSH!sFUPWW0e@O-J|os0 zrW0Kf9JGYnN}q(&J`zeM?YJEod)G`BLjjPWG~z}8`A(_A8srkE$jFwgbkO=6J!q0M z3JAZ>eGc+qK}8n{^OY;wpF2ffet6>QTXv7DKJBVvr?TFP-O-bo%e1d1ezNCtqSmWgXxf3ZazUc+oW>QS#)Be z5=C+|^}g$K;S?-c51}+TNs!KVF%tNd2m;a61O@dSm#*+8i?OmrXCZ*$vU~`Z2r50u z=5#ezhU(=0DsC(-9P3w-Q?X8NxWz|>Nqvjq1!U5c)-;0zOU}jFelzVb!2xchTd;oa z2m$HxV})bM-FQ!@R}*0fF1Zh955U>jJ}&DtxjmOuO_gJvQUuJA1cdq=?S@ynqVcY6 zV%IiHdKkCM9wAMI{Xm?;T{HD)sI1gZCqk5iG@;uU%+h8fLAB@zq!}z7;F#rggIr>x z5AUXvERXn+!a!M%9^`3AkQlQjHE_%jC(?na2uh}DbLxa*bs}+Hn~@;mvg+21YW%n* ztz1ex_#tsLWe-`1#35Q9i3(`b3kiQauv&Nc zcBvQXuj^De*x|!^hKf>*PIn6zhdPZCijQ;HFJlAAhxC11>t&Hpx09kOj&)RzPpp=h z%sI!MEIM*dzbek;oNkt(*7a>>2xvBAi?O7g7#4b(6)UMiT)`rX1334jj8T9+)JPA* z_F=R}dYk-=sO|Cwm2T%PA`bvY0ZJQQDyG6hL~E`H3w5IXbkbbClU`Mv**r8axfx%{ z8&PeNXG!#Y*(h`Dq#Sg9Sez*vO0h!ICGa@nXTBU764U|~&3wea- z;N|t|nvIlWnvzzf1_#1>ymnV!qBvavFSuC^fUf(u=W9avpmA*|@-lIjE z(dz5zEvQUsUGLw3_yqlqMUpl`Vec_$&_-7xJ^*A(xO1{NuD8J6(|2M=Tz^*^VYCk* zKjZt#fQ4wjpVJZM&aRb~FL9sLtc7{nJZGc3v3A0SH0$Sf%*dq+h%YBOo^j3?w4YOb zUK=BFgPA}%?5C2|x%JQO=kg{N*7DRjgJ;#+5k4q&v)@bm;``G5QuUxtk%c<5FV{aHI<}jSt z*Hfs^cq=A3WL0B;cgOy|uZ>c>5@XJ^+(>o4H6gq9z0Zp26IvbFF8^!>nhOLTzV_dv z)HnV+)YIjDeSt|D=Pyoelgh3Mt5<5Cnj|UyB>wzNlXqugJGplXKr|qcmG$|D4G1e^ zh>Uw|{AR(a4xaT-oKH{6iCp91nJ5Ib`sF2O@h8UTj~Q}CKiYPB@%%sjt~DNx4sn*N zE-imFsXyL*_Ue+={uP>`3>1r=02#};E4Flc&VN_MEf)LMCilhvfCS?88w?k{M11U* zKiQNLX#VS1rN4N@%xjUA#_nhRPwW&-{`_deOe+qkzZn@~G|g{*#uAv!AQjjh%21ha S`cngok&Ja&oe$;%^#K4OY{sqt literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe864_vulkan_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification-numraysperprobe864_vulkan_0.azshadervariant new file mode 100644 index 0000000000000000000000000000000000000000..a2d1bcd5e37b653bfe2dfda4c7f0f0f719d33c11 GIT binary patch literal 10274 zcmbuF33Qaz6~`xpeF-2-*bD=RvM92JO(6*hBp^#j0|@ zNL`gO;mHH71{}yqTmMDJZQn1RxqIIm8!pXEc_3?f-&O;L_gH=O&Ww)Jrrs9V_vG4z z7p5GXURtt!Md2l@p1Seaigvq0(_gywKsfi{`uWR0A9K&f_1ERpef{_~imOpDHtVaY z=k5CUvuoGnzrDGCd4m%TdiJkgvwp|6?k{d=n|@^GE1UX%_R?jm8$I4E>EQdj`pWoo zz5lyeV9JaS`+c(c#Z`?TIFh@6Lv+f$1*1Y|DfP#%<)$C$_sZTr4W=D_WdD{sz8ybe zSwT+rjKSMq+j@Azx|#X6?x@-^eo6OoW{*>#F`n*t8NV+t6yO_E0SY=fxRyBN4d3iX| z%iHjpkaFMrgecyv)kI4@jTnqN3k7^^_X zh$kX*A~CSK9>$sz@v2Z&BrY_W2U~h$t19||zMkhtA1mUE!xiCJRf+nesUjwI^w;w( zUJxpc#O5S*$$a$F)8)n&#i}Z6eCVf#k6TosMph<$8hW|trRhc`5}~q4C{`LS2`>pp zom~UZj=q{*UWCq`w6fY*n`cu{U0D@QgexP|P~Y=!Xu7eXC91(f)YRC>^yA`*icoZT zBy_U=#-^JT319AM=tr`yCZ@B9BbF?P$J99Cbpy#YrkRazfpb;f+<3H1sv5hdW;a|L zIkzenuBm6&0am%w&Ds0nc`LsC0h0POvYc)u+cO zX)`tw8<~j5s<5;5NM}84VRpr(iFhR`TG*TWp%`Um;ZOkrNZ*DXkN(l094Cmnt zcQScfJ)7D;cw6%IvT!drCmlr0xeLtCc5}{oXAuKE^G@C@Ip?hV^~}+8PqC*azn(dI z?kjq75tIEd@ZI|^nllU|9+=;b7+^t>*|8ol9#_Ly6Ig#A#=Qp1_F>ckHpYjs9*gJ#=lrtsw z;!JT*srx)})&WM{-Nf;sZuH&7Q$*m*d$>6^E#%o#ypycY7e}_WULZLrVy(TzsX2+& z4qPai_XM1ry~SA{bujNEPJHI%>?@8vF_`xgPwJBM{%%eT^qFpM_5<9UeqJO!d&L{a zusQJ=%;^bl7CD&H1NxET=JbGb$-KKXoVkG_J3E6UFCCasbCw2ct}&F_hDabT>$6^6 zB$>Nq^NS_d5n(@69DB}$>4!S7b2KN0>4!^Z{Wi~)%w0{|G$>`0$ zNHQ_Nm#H4=FBXB{uN<6#5)o?xrw0?o87E|qZjuO$J|G_#r%%kmnP2MW@MG!;wNDn& z2W+N@rix5AO|t2xJKZi<&t;mUZzcLtHOz2&F|Q`{GezLkfXv#+IZMP^3Kgrjct}L7 zSt5GG`J64{9O2VPyi|l;j!@2dnaKLf8OM*lg`JKbl}l#WIhiAwTHxE=I_65ohxZcm4axV1b({m<-qe~I_a}t9&Ya$lhucx+SdabFuQbg^nk$B|gGZmj4^{TIUm1v}h zy&9&vnd3+AiLpoo_L%GKVuulDoBGyF{BjX^3lV4QD%pZ__Be~^sgZL?&2Y2f43ZmP zY&gf*aK`LxEs;E0#5w6FUM*@UA{TETwFbqPiqP?1kpD*xqlbnqa~SWG-PPriu|>DW z`CcKJyy)!yUMU%TrL(z8@~Ji}gn@Gp`iNgG!Vf&II_c>(BKmTjY?xo`u)*T2G1JqX zTw`0!Z9lGey4~{4ki1faKRD-Zl{kZQhiqg1+i(cD)tdq>XF|7CNC1Z<@I)dUq5rOB4 z7-qXcvc)vpp9%xVhrPFbzDY7M$!|6NOfvrH%>QP|;KbpauqOk=H;U}srAww4UBz#4 zI_!o@-Xt(MKYMJm2-2Kh<)cQQ^T)B^oz61{BDO)+ttE? z;#)=RaVL@a-Q#fc+om}_;5WKh+a-f{7G2}89g@j`&fea8CDSu{eUIwO5Wi0Z&Yiel zoWY#{e?SDr`9vPCZ?n|CQ^X!Yj1&?3f0J@I7T+bp2IBmJJt)GSyJ7eFA%~-*ZtNZw zffK{l_iM?l2c6}3#9`#Hc#ld3?;WH zkxY&LxO+6m2c5-zLNc+@aks5^aK2ZN=SdNT&QZ)?t8 zq2qkmp1|#V9B?+A8SI}IVf&6a`vj&+jpHql1Ga0=gs3@{z-I5WZ!QNJFJa3XYNCB2C>l{5rGjKnKh7~IXG|Z zQ1L&D8j4s)j);6|;(rmL!>+&hUqxm&Trzge#6NO6d$T|G+2uOB*5ZE?p|dyp?+!~B zr~XgG8TNhoQ_0i{zuWcnGs#;-_~P@qID<8#`$7bUA2RPcHU2|ndtu)N|0&G&2))@J zmCTyhH?#ehWNg9E(@V<(xASmJGQQM|4>g$XOUcxLj@;;o&sq6OME&IGD6;QgUrWZ% z=Eo(I!`{UclCc>iYOGkClW#=a1@;QP*?udzsR+Gc-%0KwA_ngp{{I$%HxaFJ*!ONu ze)A;>w&?7$BSjc~=*+H`WN^srQYB-DuCYGT$Xgp5@tz{|ZN#y$b=7ft`h%_Ebsf%` zWsR1%o^W*dnQeV%OI*Kg1L5efEmR-7O5ad2G0;&v=dF=AgY(9oHP#%A^M*_we49wt zkN0m1#NoVfzOlpJ-mo;u+%t%QPc6}vicg%T0d2C|-~OC|-y!^w$_Kj-D0LcgBgU(_OlVUmf7j=RQtktNycw|kW>44icumLr*c0ki%Om#iP}-#gL!`=6^h zaj>ymd6I2i7I%a&aMo|wNXg^^vt0R-_2cD2@6T1BIdQPDT%#o0dM)l~Vc_(|uuCM9 z3(Rtjk*pst7kYoLv6>SH8#`CyB(q-XK>x6M%V+d>hjZrmEGX2R!Dj)w2_i7wcw~M@ zXHSYGcMvBogZIMh;Pze=OU8yb1RrA9-7S%fUOzSUOwY0R6gL=?iDgvV(WUFVg zWa_ba)MIvVt7nR2Y^V_*Vpu&>C8OtFTYsi$4sP{Km&~9ZbeD<1s0Z2VnIV~aEFSfk z9o*`fDH$7T#D^GG&n(I48HR-%25i`Dhb7;m)?eA8hRGl=*bzz}DW9u;fGX z+2hVfx#nQ_a6aaUGgv>mxgs#uk4&68(nloM6Sv=Y=4lRgHO?CJiO=f!!ssn}KL5=> zsyY6piiV6IwhVgtfjBwI&HOz#huiOT{O)p4#Jh%#{jP&A{pb8w$e-_C=mv^d1M7^r zT&xqD0_niW3AZ}qlKtykpgGv7>s%;|?`P=!>r7~F>qN#6TLv|gmz?nLw4;OA)yZf2 ze_X2Z;g0)O7OuGA&R#PLd+(eVUi#_bI^WO0Hg)@stm*kv%WvQF=83Tn6~EyAmzEdj fR2`Ym{GZ$c)$z>Z-A?=OXgX+D%v*iv4*C5DY#YYx literal 0 HcmV?d00001 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification.azshader b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification.azshader index cd78a9526010f77721f32d19761b691e67687164..c12fd72c89af982806675d2b3fe47b4c22e454e4 100644 GIT binary patch delta 2125 zcmbPplVwJe>IOv?*1D|D2lF?pu>>))RRxD7W#>*lkfFM{UT3N5YnwU(UeX4kJd4@Bp z0mK>nLXgp6dY%rWCNA@hEG#HAzX7lLCdNh-ntuSV`KIP(l$ifqkkN5^t`4IXuJAE8 zGN8Yj2W9DRCHZyVVwa;@Hwi`+_S_@8oaZ(#s&|)TS9A=(1Rny#hPtgQwCKChx z5XDT=#F~o~kXW)JW>O~BTyW^&%z~Inm^gD88A(jJ#2L#(pv1sTu*8~+6ud;HQ({d9 z2e9_!x^#!hp{M>J7nC)p=fYCyWKfA*b9%Yz_SfQ!cFY{BHh-4dQmz>WN~vjr_*3aN zBF%g`*In}Uj)pfNGi`_~d&x8!DKK%SRWgkxCb^Phw6!2(BN0iKJfoQ!9q?8ZkYr1) Q*+`*{C+U)FIyk`f0BFiqs{jB1 delta 208 zcmbQyq&nv&%LYXj*4jDU_i8q)u>>))`Iq_!Ic838{KBfbxn5_f>Sl*N9(2*i8XV{R zDqr$Tzs%p96)Ge&{f8c#)AV*3=08yF+kx6oscv7elo_rUB*dY~!PMAbd_Cx>_4bLf zY&L?^H`Xz0ZwKnOL$PA}0XEL%s?$H*WB-Qi9+2=;4UX6iYwc#m%oW-$V8miAI6ZJ8 Kn>H&02mkeB diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification_dx12_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification_dx12_0.azshadervariant index 7ff0c32b5960274a3c2f9e080ddcb033ee856a23..cfd9468e32abe403d1de23d24eda737e4e772e0f 100644 GIT binary patch delta 16 Xcmca)cFAmmmo!IRR_BBH3=9kaJU|8> delta 16 Xcmca)cFAmmmo!K1obG!y3=9kaJq!jc diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification_null_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridclassification_null_0.azshadervariant index 109a56fce3321885a4189e112adede955efc7857..6684ed1cf9359a2a2b8363db5c6d22dc41e80f79 100644 GIT binary patch delta 16 XcmaFH{ET_SJw}eYtj-7X85kGf*B|1U#k)5;6wSWfQ+jvudi1w+Nct=trQC)vvez aVF8@B2o$yI7f&5KB(`D!UJ#c7DFQGQf diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridraytracing_dx12_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridraytracing_dx12_0.azshadervariant index 8b926d86c8cf3e85ac3e0d8622e83ec71be4cd05..ed96d10db3f182421b5f8f395c62292140eee1b9 100644 GIT binary patch delta 18 ZcmeDC$=LUkaYI`TM_pFut49nB3;CHyvQIe delta 73 zcmV-P0Ji_T(g?fK2(T*z1$~^0=W4Ss1U#k)!eA<{#WCgAvvjJBw+OQgqhS&7e@wGa ft6vbeXmSBPrU-4t;N?vf;99d#t6mV73n>CH;{_mc diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridraytracingclosesthit_dx12_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridraytracingclosesthit_dx12_0.azshadervariant index 5e8c9a32c15bf1e5414d8d4112842d1167ed4954..1b8c4ec22bea501f9f8480887e017573682aac2d 100644 GIT binary patch delta 16 XcmeyC_APBgo-s#VR_9qK1_lNIMqvh$ delta 16 XcmeyC_APBgo-s%5obKmY3=9kaNaY6y diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridraytracingclosesthit_null_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridraytracingclosesthit_null_0.azshadervariant index 32d658041832894d9e6cbad1eab0e3ccb5c25a5b..68527221c71d16ffba95b1cf55dc3bba4c976f29 100644 GIT binary patch delta 16 XcmaFH{ET_SJw}eYtj@De3=9kaJc$MB delta 16 XcmaFH{ET_SJw}e&Io;2*7#J7;KMe+7 diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridraytracingclosesthit_vulkan_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridraytracingclosesthit_vulkan_0.azshadervariant index 87de50f6207a230e57020fdc12f352cd2a3cb420..c2fd622048cdd9aad836a2e4e30d6bba5c629c03 100644 GIT binary patch delta 16 XcmeyO`9*WX8xfAWtj@De3=9kaL#+mL delta 16 XcmeyO`9*WX8xfA$Io;2*7#J7;MllBH diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridraytracingmiss.azshader b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridraytracingmiss.azshader index 85c5e34a7dce0789452bb0b43f1cc29beae1712a..5739d6828cb5fa3a10f61296cc50921501d59428 100644 GIT binary patch delta 73 zcmV-P0Ji_N(g?NE2(Tpt1%7IY&PlT>1U#k)XyhigwczGGvu>)5w+JpmyzEJ<|FyG8 ft6vbeVsZgJrU;!k$L>6pft9mLt6mV71t|hB?bRU> delta 73 zcmV-P0Ji_N(g?NE2(Tpt1$~^0$-1*D1U#k)OCpd4)`N+Hvu>)5w+K5LlnY|{3&XQX ft6vbeVsZgJrU@RU zU2#mbZO6;ac98+XP$ipVrfyT8Y@jPWId#fMgxD7?4%Nx#8!pc~R=D|Pq>bR_DHk(Q pY`O7!y87hZzrG>cbmR9`Esp+hwn9!`hLp{(BCQ3de=uh>004!pN|XQq delta 177 zcmZ4Rfn~u5mJPBjthIBx&%N5L#1h2F<`EU?mRvPCW~$=m*{lmSQ2A5UH~$E=W9E?C zsC8IC@b0J0c98+XP$ipVrfyT8Y@jPWId#fMgxD7?j`JbkCMVvxle_t4q>bR_DHk(Q pY`O7!y87hZzrG>cbmR9`Ee=zT!_sYLt}i#ginJD-{=uBl003@VOU?iQ diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridrelocation_dx12_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridrelocation_dx12_0.azshadervariant index c1f11491d4945899420937490d984dd9035d9f4a..7cfce8e245c4b59a679c543b62c7c7a645698d98 100644 GIT binary patch delta 16 XcmdmGx65vWkvvCTR_B|$3=9kaI-~|P delta 16 XcmdmGx65vWkvvE3obGe47#J7;JER6y diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridrelocation_null_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridrelocation_null_0.azshadervariant index 01a6693151c388924df5ab7d43b77e055b724bd6..3fa87b4e79cf833cd9d576cd4f6ae62b1a69d6c8 100644 GIT binary patch delta 16 XcmaFH{ET_SJw}eYtj;%g85kGri#sB~S diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridrelocation_vulkan_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridrelocation_vulkan_0.azshadervariant index 1e56c4df52d4c196318c38b826b4034e33371636..9b831386eb42d39438926b3da6fc67f6460a1d3e 100644 GIT binary patch delta 16 XcmaD9@hD&N diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridrender.azshader b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridrender.azshader index 1f045706254b0b0c859f4bc976030ea3b50a5844..4676c42e8da1743b54f491e17ccc3347aa0fb277 100644 GIT binary patch delta 342 zcmX@Sp7-#2-VItTELok8Pi@v?sdQsYDU66JtK7WSYZV8K9UCm)0AsK9;^5fab^8Pp zOdvK`QfK=gHKt?C9B=YvC$Guq{{g;C3Y&rU@`_OnW(*8W)9=)U?klaxQNkMrVVigCqvg%t>piHfehPi z+?c}!w=3B&O@Mi8@>(z1=>=lUD%f*^md^1Kke{*?UPcbks0033Z2lD^` delta 17 YcmaF=j`96F#tj+e?7CT9Ul1_l5tvIMsP diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridrender_vulkan_0.azshadervariant b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/diffuseprobegridrender_vulkan_0.azshadervariant index 4cbb76954dbaef688dfb2961b893a2156f11785a..5caf3084766a8bd2be7d63394f0257af6e304dd6 100644 GIT binary patch delta 17 ZcmbQZhjHQ_#tmF?>{*?UPcbks002NV23!CD delta 17 YcmbQZhjHQ_#tmF??7CT9Ul(DiffuseProbeGridNumRaysPerProbe::NumRaysPerProbe_##numRaysPerProbe) } + + static const DiffuseProbeGridNumRaysPerProbeEntry DiffuseProbeGridNumRaysPerProbeArray[aznumeric_cast(DiffuseProbeGridNumRaysPerProbe::Count)] = + { + DECLARE_DiffuseProbeGridNumRaysPerProbeEntry(144), + DECLARE_DiffuseProbeGridNumRaysPerProbeEntry(288), + DECLARE_DiffuseProbeGridNumRaysPerProbeEntry(432), + DECLARE_DiffuseProbeGridNumRaysPerProbeEntry(576), + DECLARE_DiffuseProbeGridNumRaysPerProbeEntry(720), + DECLARE_DiffuseProbeGridNumRaysPerProbeEntry(864), + DECLARE_DiffuseProbeGridNumRaysPerProbeEntry(1008) + }; + static const uint32_t DiffuseProbeGridNumRaysPerProbeArraySize = RHI::ArraySize(DiffuseProbeGridNumRaysPerProbeArray); + static const char* DiffuseProbeGridIrradianceFileName = "Irradiance_lutrgba16f.dds"; static const char* DiffuseProbeGridDistanceFileName = "Distance_lutrg32f.dds"; static const char* DiffuseProbeGridProbeDataFileName = "ProbeData_lutrgba16f.dds"; @@ -82,6 +118,7 @@ namespace AZ virtual void SetProbeSpacing(const DiffuseProbeGridHandle& probeGrid, const AZ::Vector3& probeSpacing) = 0; virtual void SetViewBias(const DiffuseProbeGridHandle& probeGrid, float viewBias) = 0; virtual void SetNormalBias(const DiffuseProbeGridHandle& probeGrid, float normalBias) = 0; + virtual void SetNumRaysPerProbe(const DiffuseProbeGridHandle& probeGrid, const DiffuseProbeGridNumRaysPerProbe& numRaysPerProbe) = 0; virtual void SetAmbientMultiplier(const DiffuseProbeGridHandle& probeGrid, float ambientMultiplier) = 0; virtual void Enable(const DiffuseProbeGridHandle& probeGrid, bool enable) = 0; virtual void SetGIShadows(const DiffuseProbeGridHandle& probeGrid, bool giShadows) = 0; diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.cpp index a72d90fc94..798ebc502b 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.cpp @@ -134,6 +134,12 @@ namespace AZ m_updateRenderObjectSrg = true; } + void DiffuseProbeGrid::SetNumRaysPerProbe(const DiffuseProbeGridNumRaysPerProbe& numRaysPerProbe) + { + m_numRaysPerProbe = numRaysPerProbe; + m_updateTextures = true; + } + void DiffuseProbeGrid::SetTransform(const AZ::Transform& transform) { m_transform = transform; @@ -280,7 +286,7 @@ namespace AZ // probe raytrace { - uint32_t width = m_numRaysPerProbe; + uint32_t width = GetNumRaysPerProbe().m_rayCount; uint32_t height = GetTotalProbeCount(); m_rayTraceImage[m_currentImageIndex] = RHI::Factory::Get().CreateImage(); @@ -422,7 +428,7 @@ namespace AZ srg->SetConstantRaw(constantIndex, &probeGridCounts[0], sizeof(probeGridCounts)); constantIndex = srgLayout->FindShaderInputConstantIndex(AZ::Name("m_probeGrid.probeNumRays")); - srg->SetConstant(constantIndex, m_numRaysPerProbe); + srg->SetConstant(constantIndex, GetNumRaysPerProbe().m_rayCount); constantIndex = srgLayout->FindShaderInputConstantIndex(AZ::Name("m_probeGrid.probeNumIrradianceTexels")); srg->SetConstant(constantIndex, DefaultNumIrradianceTexels); diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.h b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.h index a828fe4b96..8c8470cdad 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.h +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGrid.h @@ -81,6 +81,9 @@ namespace AZ float GetViewBias() const { return m_viewBias; } void SetViewBias(float viewBias); + const DiffuseProbeGridNumRaysPerProbeEntry& GetNumRaysPerProbe() const { return DiffuseProbeGridNumRaysPerProbeArray[aznumeric_cast(m_numRaysPerProbe)]; } + void SetNumRaysPerProbe(const DiffuseProbeGridNumRaysPerProbe& numRaysPerProbe); + float GetAmbientMultiplier() const { return m_ambientMultiplier; } void SetAmbientMultiplier(float ambientMultiplier); @@ -95,8 +98,6 @@ namespace AZ DiffuseProbeGridMode GetMode() const { return m_mode; } void SetMode(DiffuseProbeGridMode mode); - uint32_t GetNumRaysPerProbe() const { return m_numRaysPerProbe; } - uint32_t GetRemainingRelocationIterations() const { return aznumeric_cast(m_remainingRelocationIterations); } void DecrementRemainingRelocationIterations() { m_remainingRelocationIterations = AZStd::max(0, m_remainingRelocationIterations - 1); } void ResetRemainingRelocationIterations() { m_remainingRelocationIterations = DefaultNumRelocationIterations; } @@ -201,7 +202,6 @@ namespace AZ bool m_enabled = true; float m_normalBias = 0.6f; float m_viewBias = 0.01f; - uint32_t m_numRaysPerProbe = 288; float m_probeMaxRayDistance = 30.0f; float m_probeDistanceExponent = 50.0f; float m_probeHysteresis = 0.95f; @@ -214,6 +214,8 @@ namespace AZ bool m_giShadows = true; bool m_useDiffuseIbl = true; + DiffuseProbeGridNumRaysPerProbe m_numRaysPerProbe = DiffuseProbeGridNumRaysPerProbe::NumRaysPerProbe_288; + // rotation transform applied to probe rays AZ::Quaternion m_probeRayRotation; AZ::SimpleLcgRandom m_random; diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistancePass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistancePass.cpp index 702e784c86..a5da79a482 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistancePass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistancePass.cpp @@ -14,7 +14,6 @@ #include #include #include -#include #include #include @@ -44,29 +43,35 @@ namespace AZ void DiffuseProbeGridBlendDistancePass::LoadShader() { - // load shader - // Note: the shader may not be available on all platforms - AZStd::string shaderFilePath = "Shaders/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistance.azshader"; - m_shader = RPI::LoadCriticalShader(shaderFilePath); - if (m_shader == nullptr) + // load shaders, each supervariant handles a different number of rays per probe + // Note: the raytracing shaders may not be available on all platforms + m_shaders.reserve(DiffuseProbeGridNumRaysPerProbeArraySize); + for (uint32_t index = 0; index < DiffuseProbeGridNumRaysPerProbeArraySize; ++index) { - return; - } + AZStd::string shaderFilePath = "Shaders/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistance.azshader"; + Data::Instance shader = RPI::LoadCriticalShader(shaderFilePath, DiffuseProbeGridNumRaysPerProbeArray[index].m_supervariant); + if (shader == nullptr) + { + return; + } - // load pipeline state - RHI::PipelineStateDescriptorForDispatch pipelineStateDescriptor; - const auto& shaderVariant = m_shader->GetVariant(RPI::ShaderAsset::RootShaderVariantStableId); - shaderVariant.ConfigurePipelineState(pipelineStateDescriptor); - m_pipelineState = m_shader->AcquirePipelineState(pipelineStateDescriptor); + RHI::PipelineStateDescriptorForDispatch pipelineStateDescriptor; + const auto& shaderVariant = shader->GetVariant(RPI::ShaderAsset::RootShaderVariantStableId); + shaderVariant.ConfigurePipelineState(pipelineStateDescriptor); + const RHI::PipelineState* pipelineState = shader->AcquirePipelineState(pipelineStateDescriptor); + AZ_Assert(pipelineState, "Failed to acquire pipeline state"); - // load Pass Srg asset - m_srgLayout = m_shader->FindShaderResourceGroupLayout(RPI::SrgBindingSlot::Pass); + RHI::Ptr srgLayout = shader->FindShaderResourceGroupLayout(RPI::SrgBindingSlot::Pass); + AZ_Assert(srgLayout.get(), "Failed to find Srg layout"); - // retrieve the number of threads per thread group from the shader - const auto outcome = RPI::GetComputeShaderNumThreads(m_shader->GetAsset(), m_dispatchArgs); - if (!outcome.IsSuccess()) - { - AZ_Error("PassSystem", false, "[DiffuseProbeGridBlendDistancePass '%s']: Shader '%s' contains invalid numthreads arguments:\n%s", GetPathName().GetCStr(), shaderFilePath.c_str(), outcome.GetError().c_str()); + RHI::DispatchDirect dispatchArgs; + const auto outcome = RPI::GetComputeShaderNumThreads(shader->GetAsset(), dispatchArgs); + if (!outcome.IsSuccess()) + { + AZ_Error("PassSystem", false, "[DiffuseProbeBlendIrradiancePass '%s']: Shader '%s' contains invalid numthreads arguments:\n%s", GetPathName().GetCStr(), shaderFilePath.c_str(), outcome.GetError().c_str()); + } + + m_shaders.push_back({ shader, pipelineState, srgLayout, dispatchArgs }); } } @@ -142,7 +147,8 @@ namespace AZ { // the diffuse probe grid Srg must be updated in the Compile phase in order to successfully bind the ReadWrite shader inputs // (see ValidateSetImageView() in ShaderResourceGroupData.cpp) - diffuseProbeGrid->UpdateBlendDistanceSrg(m_shader, m_srgLayout); + DiffuseProbeGridShader& shader = m_shaders[diffuseProbeGrid->GetNumRaysPerProbe().m_index]; + diffuseProbeGrid->UpdateBlendDistanceSrg(shader.m_shader, shader.m_srgLayout); diffuseProbeGrid->GetBlendDistanceSrg()->Compile(); } @@ -157,6 +163,8 @@ namespace AZ // submit the DispatchItem for each DiffuseProbeGrid for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids()) { + DiffuseProbeGridShader& shader = m_shaders[diffuseProbeGrid->GetNumRaysPerProbe().m_index]; + const RHI::ShaderResourceGroup* shaderResourceGroup = diffuseProbeGrid->GetBlendDistanceSrg()->GetRHIShaderResourceGroup(); commandList->SetShaderResourceGroupForDispatch(*shaderResourceGroup); @@ -165,8 +173,8 @@ namespace AZ diffuseProbeGrid->GetTexture2DProbeCount(probeCountX, probeCountY); RHI::DispatchItem dispatchItem; - dispatchItem.m_arguments = m_dispatchArgs; - dispatchItem.m_pipelineState = m_pipelineState; + dispatchItem.m_arguments = shader.m_dispatchArgs; + dispatchItem.m_pipelineState = shader.m_pipelineState; dispatchItem.m_arguments.m_direct.m_totalNumberOfThreadsX = probeCountX * dispatchItem.m_arguments.m_direct.m_threadsPerGroupX; dispatchItem.m_arguments.m_direct.m_totalNumberOfThreadsY = probeCountY * dispatchItem.m_arguments.m_direct.m_threadsPerGroupY; dispatchItem.m_arguments.m_direct.m_totalNumberOfThreadsZ = 1; diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistancePass.h b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistancePass.h index b85e54d25f..942f90eb10 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistancePass.h +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistancePass.h @@ -12,6 +12,7 @@ #include #include #include +#include namespace AZ { @@ -47,11 +48,16 @@ namespace AZ void CompileResources(const RHI::FrameGraphCompileContext& context) override; void BuildCommandListInternal(const RHI::FrameGraphExecuteContext& context) override; - // shader - Data::Instance m_shader; - const RHI::PipelineState* m_pipelineState = nullptr; - RHI::Ptr m_srgLayout; - RHI::DispatchDirect m_dispatchArgs; + // shaders + struct DiffuseProbeGridShader + { + Data::Instance m_shader; + const RHI::PipelineState* m_pipelineState = nullptr; + RHI::Ptr m_srgLayout; + RHI::DispatchDirect m_dispatchArgs; + }; + + AZStd::vector m_shaders; }; } // namespace Render } // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiancePass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiancePass.cpp index 7609e27b66..7a12fc5415 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiancePass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiancePass.cpp @@ -14,7 +14,6 @@ #include #include #include -#include #include #include @@ -44,29 +43,35 @@ namespace AZ void DiffuseProbeGridBlendIrradiancePass::LoadShader() { - // load shader - // Note: the shader may not be available on all platforms - AZStd::string shaderFilePath = "Shaders/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiance.azshader"; - m_shader = RPI::LoadCriticalShader(shaderFilePath); - if (m_shader == nullptr) + // load shaders, each supervariant handles a different number of rays per probe + // Note: the raytracing shaders may not be available on all platforms + m_shaders.reserve(DiffuseProbeGridNumRaysPerProbeArraySize); + for (uint32_t index = 0; index < DiffuseProbeGridNumRaysPerProbeArraySize; ++index) { - return; - } + AZStd::string shaderFilePath = "Shaders/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiance.azshader"; + Data::Instance shader = RPI::LoadCriticalShader(shaderFilePath, DiffuseProbeGridNumRaysPerProbeArray[index].m_supervariant); + if (shader == nullptr) + { + return; + } - // load pipeline state - RHI::PipelineStateDescriptorForDispatch pipelineStateDescriptor; - const auto& shaderVariant = m_shader->GetVariant(RPI::ShaderAsset::RootShaderVariantStableId); - shaderVariant.ConfigurePipelineState(pipelineStateDescriptor); - m_pipelineState = m_shader->AcquirePipelineState(pipelineStateDescriptor); + RHI::PipelineStateDescriptorForDispatch pipelineStateDescriptor; + const auto& shaderVariant = shader->GetVariant(RPI::ShaderAsset::RootShaderVariantStableId); + shaderVariant.ConfigurePipelineState(pipelineStateDescriptor); + const RHI::PipelineState* pipelineState = shader->AcquirePipelineState(pipelineStateDescriptor); + AZ_Assert(pipelineState, "Failed to acquire pipeline state"); - // load Pass Srg asset - m_srgLayout = m_shader->FindShaderResourceGroupLayout(RPI::SrgBindingSlot::Pass); + RHI::Ptr srgLayout = shader->FindShaderResourceGroupLayout(RPI::SrgBindingSlot::Pass); + AZ_Assert(srgLayout.get(), "Failed to find Srg layout"); - // retrieve the number of threads per thread group from the shader - const auto outcome = RPI::GetComputeShaderNumThreads(m_shader->GetAsset(), m_dispatchArgs); - if (!outcome.IsSuccess()) - { - AZ_Error("PassSystem", false, "[DiffuseProbeBlendIrradiancePass '%s']: Shader '%s' contains invalid numthreads arguments:\n%s", GetPathName().GetCStr(), shaderFilePath.c_str(), outcome.GetError().c_str()); + RHI::DispatchDirect dispatchArgs; + const auto outcome = RPI::GetComputeShaderNumThreads(shader->GetAsset(), dispatchArgs); + if (!outcome.IsSuccess()) + { + AZ_Error("PassSystem", false, "[DiffuseProbeBlendIrradiancePass '%s']: Shader '%s' contains invalid numthreads arguments:\n%s", GetPathName().GetCStr(), shaderFilePath.c_str(), outcome.GetError().c_str()); + } + + m_shaders.push_back({ shader, pipelineState, srgLayout, dispatchArgs }); } } @@ -132,7 +137,8 @@ namespace AZ { // the diffuse probe grid Srg must be updated in the Compile phase in order to successfully bind the ReadWrite shader inputs // (see ValidateSetImageView() in ShaderResourceGroupData.cpp) - diffuseProbeGrid->UpdateBlendIrradianceSrg(m_shader, m_srgLayout); + DiffuseProbeGridShader& shader = m_shaders[diffuseProbeGrid->GetNumRaysPerProbe().m_index]; + diffuseProbeGrid->UpdateBlendIrradianceSrg(shader.m_shader, shader.m_srgLayout); diffuseProbeGrid->GetBlendIrradianceSrg()->Compile(); } @@ -147,6 +153,8 @@ namespace AZ // submit the DispatchItem for each DiffuseProbeGrid for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids()) { + DiffuseProbeGridShader& shader = m_shaders[diffuseProbeGrid->GetNumRaysPerProbe().m_index]; + const RHI::ShaderResourceGroup* shaderResourceGroup = diffuseProbeGrid->GetBlendIrradianceSrg()->GetRHIShaderResourceGroup(); commandList->SetShaderResourceGroupForDispatch(*shaderResourceGroup); @@ -155,8 +163,8 @@ namespace AZ diffuseProbeGrid->GetTexture2DProbeCount(probeCountX, probeCountY); RHI::DispatchItem dispatchItem; - dispatchItem.m_arguments = m_dispatchArgs; - dispatchItem.m_pipelineState = m_pipelineState; + dispatchItem.m_arguments = shader.m_dispatchArgs; + dispatchItem.m_pipelineState = shader.m_pipelineState; dispatchItem.m_arguments.m_direct.m_totalNumberOfThreadsX = probeCountX * dispatchItem.m_arguments.m_direct.m_threadsPerGroupX; dispatchItem.m_arguments.m_direct.m_totalNumberOfThreadsY = probeCountY * dispatchItem.m_arguments.m_direct.m_threadsPerGroupY; dispatchItem.m_arguments.m_direct.m_totalNumberOfThreadsZ = 1; diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiancePass.h b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiancePass.h index 3c5691a4b4..77dba9745c 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiancePass.h +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiancePass.h @@ -12,6 +12,7 @@ #include #include #include +#include namespace AZ { @@ -47,11 +48,16 @@ namespace AZ void CompileResources(const RHI::FrameGraphCompileContext& context) override; void BuildCommandListInternal(const RHI::FrameGraphExecuteContext& context) override; - // shader - Data::Instance m_shader; - const RHI::PipelineState* m_pipelineState = nullptr; - RHI::Ptr m_srgLayout; - RHI::DispatchDirect m_dispatchArgs; + // shaders + struct DiffuseProbeGridShader + { + Data::Instance m_shader; + const RHI::PipelineState* m_pipelineState = nullptr; + RHI::Ptr m_srgLayout; + RHI::DispatchDirect m_dispatchArgs; + }; + + AZStd::vector m_shaders; }; } // namespace Render } // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridClassificationPass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridClassificationPass.cpp index 7394b1ccfb..1d1e6f745f 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridClassificationPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridClassificationPass.cpp @@ -18,7 +18,6 @@ #include #include #include -#include #include #include @@ -48,29 +47,35 @@ namespace AZ void DiffuseProbeGridClassificationPass::LoadShader() { - // load shader - // Note: the shader may not be available on all platforms - AZStd::string shaderFilePath = "Shaders/DiffuseGlobalIllumination/DiffuseProbeGridClassification.azshader"; - m_shader = RPI::LoadCriticalShader(shaderFilePath); - if (m_shader == nullptr) + // load shaders, each supervariant handles a different number of rays per probe + // Note: the raytracing shaders may not be available on all platforms + m_shaders.reserve(DiffuseProbeGridNumRaysPerProbeArraySize); + for (uint32_t index = 0; index < DiffuseProbeGridNumRaysPerProbeArraySize; ++index) { - return; - } + AZStd::string shaderFilePath = "Shaders/DiffuseGlobalIllumination/DiffuseProbeGridClassification.azshader"; + Data::Instance shader = RPI::LoadCriticalShader(shaderFilePath, DiffuseProbeGridNumRaysPerProbeArray[index].m_supervariant); + if (shader == nullptr) + { + return; + } - // load pipeline state - RHI::PipelineStateDescriptorForDispatch pipelineStateDescriptor; - const auto& shaderVariant = m_shader->GetVariant(RPI::ShaderAsset::RootShaderVariantStableId); - shaderVariant.ConfigurePipelineState(pipelineStateDescriptor); - m_pipelineState = m_shader->AcquirePipelineState(pipelineStateDescriptor); + RHI::PipelineStateDescriptorForDispatch pipelineStateDescriptor; + const auto& shaderVariant = shader->GetVariant(RPI::ShaderAsset::RootShaderVariantStableId); + shaderVariant.ConfigurePipelineState(pipelineStateDescriptor); + const RHI::PipelineState* pipelineState = shader->AcquirePipelineState(pipelineStateDescriptor); + AZ_Assert(pipelineState, "Failed to acquire pipeline state"); - // load Pass Srg asset - m_srgLayout = m_shader->FindShaderResourceGroupLayout(RPI::SrgBindingSlot::Pass); + RHI::Ptr srgLayout = shader->FindShaderResourceGroupLayout(RPI::SrgBindingSlot::Pass); + AZ_Assert(srgLayout.get(), "Failed to find Srg layout"); - // retrieve the number of threads per thread group from the shader - const auto outcome = RPI::GetComputeShaderNumThreads(m_shader->GetAsset(), m_dispatchArgs); - if (!outcome.IsSuccess()) - { - AZ_Error("PassSystem", false, "[DiffuseProbeClassificationPass '%s']: Shader '%s' contains invalid numthreads arguments:\n%s", GetPathName().GetCStr(), shaderFilePath.c_str(), outcome.GetError().c_str()); + RHI::DispatchDirect dispatchArgs; + const auto outcome = RPI::GetComputeShaderNumThreads(shader->GetAsset(), dispatchArgs); + if (!outcome.IsSuccess()) + { + AZ_Error("PassSystem", false, "[DiffuseProbeBlendIrradiancePass '%s']: Shader '%s' contains invalid numthreads arguments:\n%s", GetPathName().GetCStr(), shaderFilePath.c_str(), outcome.GetError().c_str()); + } + + m_shaders.push_back({ shader, pipelineState, srgLayout, dispatchArgs }); } } @@ -135,7 +140,8 @@ namespace AZ { // the diffuse probe grid Srg must be updated in the Compile phase in order to successfully bind the ReadWrite shader inputs // (see ValidateSetImageView() in ShaderResourceGroupData.cpp) - diffuseProbeGrid->UpdateClassificationSrg(m_shader, m_srgLayout); + DiffuseProbeGridShader& shader = m_shaders[diffuseProbeGrid->GetNumRaysPerProbe().m_index]; + diffuseProbeGrid->UpdateClassificationSrg(shader.m_shader, shader.m_srgLayout); diffuseProbeGrid->GetClassificationSrg()->Compile(); } } @@ -149,6 +155,8 @@ namespace AZ // submit the DispatchItems for each DiffuseProbeGrid for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetVisibleRealTimeProbeGrids()) { + DiffuseProbeGridShader& shader = m_shaders[diffuseProbeGrid->GetNumRaysPerProbe().m_index]; + const RHI::ShaderResourceGroup* shaderResourceGroup = diffuseProbeGrid->GetClassificationSrg()->GetRHIShaderResourceGroup(); commandList->SetShaderResourceGroupForDispatch(*shaderResourceGroup); @@ -157,8 +165,8 @@ namespace AZ diffuseProbeGrid->GetTexture2DProbeCount(probeCountX, probeCountY); RHI::DispatchItem dispatchItem; - dispatchItem.m_arguments = m_dispatchArgs; - dispatchItem.m_pipelineState = m_pipelineState; + dispatchItem.m_arguments = shader.m_dispatchArgs; + dispatchItem.m_pipelineState = shader.m_pipelineState; dispatchItem.m_arguments.m_direct.m_totalNumberOfThreadsX = probeCountX; dispatchItem.m_arguments.m_direct.m_totalNumberOfThreadsY = probeCountY; dispatchItem.m_arguments.m_direct.m_totalNumberOfThreadsZ = 1; diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridClassificationPass.h b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridClassificationPass.h index 271cb3d146..3ec76fd0f0 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridClassificationPass.h +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridClassificationPass.h @@ -18,6 +18,7 @@ #include #include #include +#include namespace AZ { @@ -49,10 +50,15 @@ namespace AZ void BuildCommandListInternal(const RHI::FrameGraphExecuteContext& context) override; // shader - Data::Instance m_shader; - const RHI::PipelineState* m_pipelineState = nullptr; - RHI::Ptr m_srgLayout; - RHI::DispatchDirect m_dispatchArgs; + struct DiffuseProbeGridShader + { + Data::Instance m_shader; + const RHI::PipelineState* m_pipelineState = nullptr; + RHI::Ptr m_srgLayout; + RHI::DispatchDirect m_dispatchArgs; + }; + + AZStd::vector m_shaders; }; } // namespace Render } // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.cpp index 281255f1b4..ea02a8e0a2 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.cpp @@ -295,6 +295,12 @@ namespace AZ probeGrid->SetNormalBias(normalBias); } + void DiffuseProbeGridFeatureProcessor::SetNumRaysPerProbe(const DiffuseProbeGridHandle& probeGrid, const DiffuseProbeGridNumRaysPerProbe& numRaysPerProbe) + { + AZ_Assert(probeGrid.get(), "SetNumRaysPerProbe called with an invalid handle"); + probeGrid->SetNumRaysPerProbe(numRaysPerProbe); + } + void DiffuseProbeGridFeatureProcessor::SetAmbientMultiplier(const DiffuseProbeGridHandle& probeGrid, float ambientMultiplier) { AZ_Assert(probeGrid.get(), "SetAmbientMultiplier called with an invalid handle"); diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.h b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.h index 16dfbd517a..d0df7dfbfe 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.h +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.h @@ -39,6 +39,7 @@ namespace AZ void SetProbeSpacing(const DiffuseProbeGridHandle& probeGrid, const AZ::Vector3& probeSpacing) override; void SetViewBias(const DiffuseProbeGridHandle& probeGrid, float viewBias) override; void SetNormalBias(const DiffuseProbeGridHandle& probeGrid, float normalBias) override; + void SetNumRaysPerProbe(const DiffuseProbeGridHandle& probeGrid, const DiffuseProbeGridNumRaysPerProbe& numRaysPerProbe) override; void SetAmbientMultiplier(const DiffuseProbeGridHandle& probeGrid, float ambientMultiplier) override; void Enable(const DiffuseProbeGridHandle& probeGrid, bool enable) override; void SetGIShadows(const DiffuseProbeGridHandle& probeGrid, bool giShadows) override; diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRayTracingPass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRayTracingPass.cpp index df551e7f42..7af6f4c8ec 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRayTracingPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridRayTracingPass.cpp @@ -299,7 +299,7 @@ namespace AZ }; RHI::DispatchRaysItem dispatchRaysItem; - dispatchRaysItem.m_width = diffuseProbeGrid->GetNumRaysPerProbe(); + dispatchRaysItem.m_width = diffuseProbeGrid->GetNumRaysPerProbe().m_rayCount; dispatchRaysItem.m_height = diffuseProbeGrid->GetTotalProbeCount(); dispatchRaysItem.m_depth = 1; dispatchRaysItem.m_rayTracingPipelineState = m_rayTracingPipelineState.get(); diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/RPIUtils.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/RPIUtils.h index 3e92542429..70754777c7 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/RPIUtils.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/RPIUtils.h @@ -33,11 +33,11 @@ namespace AZ Data::Asset FindCriticalShaderAsset(const AZStd::string& shaderFilePath); //! Loads a shader for the given shader asset ID. Optional shaderFilePath param for debugging. - Data::Instance LoadShader(Data::AssetId shaderAssetId, const AZStd::string& shaderFilePath = ""); + Data::Instance LoadShader(Data::AssetId shaderAssetId, const AZStd::string& shaderFilePath = "", const AZStd::string& supervariantName = ""); //! Loads a shader for the given shader file path - Data::Instance LoadShader(const AZStd::string& shaderFilePath); - Data::Instance LoadCriticalShader(const AZStd::string& shaderFilePath); + Data::Instance LoadShader(const AZStd::string& shaderFilePath, const AZStd::string& supervariantName = ""); + Data::Instance LoadCriticalShader(const AZStd::string& shaderFilePath, const AZStd::string& supervariantName = ""); //! Loads a streaming image asset for the given file path Data::Instance LoadStreamingTexture(AZStd::string_view path); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/RPIUtils.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/RPIUtils.cpp index fda8f967da..7285273c3e 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/RPIUtils.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/RPIUtils.cpp @@ -74,7 +74,7 @@ namespace AZ return shaderAsset; } - Data::Instance LoadShader(Data::AssetId shaderAssetId, const AZStd::string& shaderFilePath) + Data::Instance LoadShader(Data::AssetId shaderAssetId, const AZStd::string& shaderFilePath, const AZStd::string& supervariantName) { auto shaderAsset = FindShaderAsset(shaderAssetId, shaderFilePath); if (!shaderAsset) @@ -82,7 +82,7 @@ namespace AZ return nullptr; } - Data::Instance shader = Shader::FindOrCreate(shaderAsset); + Data::Instance shader = Shader::FindOrCreate(shaderAsset, AZ::Name(supervariantName)); if (!shader) { AZ_Error("RPI Utils", false, "Failed to find or create a shader instance from shader asset [%s] with asset ID [%s]", shaderFilePath.c_str(), shaderAssetId.ToString().c_str()); @@ -103,15 +103,15 @@ namespace AZ return FindShaderAsset(GetShaderAssetId(shaderFilePath, isCritical), shaderFilePath); } - Data::Instance LoadShader(const AZStd::string& shaderFilePath) + Data::Instance LoadShader(const AZStd::string& shaderFilePath, const AZStd::string& supervariantName) { - return LoadShader(GetShaderAssetId(shaderFilePath), shaderFilePath); + return LoadShader(GetShaderAssetId(shaderFilePath), shaderFilePath, supervariantName); } - Data::Instance LoadCriticalShader(const AZStd::string& shaderFilePath) + Data::Instance LoadCriticalShader(const AZStd::string& shaderFilePath, const AZStd::string& supervariantName) { const bool isCritical = true; - return LoadShader(GetShaderAssetId(shaderFilePath, isCritical), shaderFilePath); + return LoadShader(GetShaderAssetId(shaderFilePath, isCritical), shaderFilePath, supervariantName); } AZ::Data::Instance LoadStreamingTexture(AZStd::string_view path) diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridComponentConstants.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridComponentConstants.h index 64669eceab..91c4e2bcf4 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridComponentConstants.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridComponentConstants.h @@ -19,5 +19,6 @@ namespace AZ static constexpr float DefaultDiffuseProbeGridAmbientMultiplier = 1.0f; static constexpr float DefaultDiffuseProbeGridViewBias = 0.2f; static constexpr float DefaultDiffuseProbeGridNormalBias = 0.1f; + static constexpr DiffuseProbeGridNumRaysPerProbe DefaultDiffuseProbeGridNumRaysPerProbe = DiffuseProbeGridNumRaysPerProbe::NumRaysPerProbe_288; } // namespace Render } // namespace AZ diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridComponentController.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridComponentController.cpp index 397f22c4ff..b7dbbdbcf5 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridComponentController.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridComponentController.cpp @@ -34,12 +34,13 @@ namespace AZ if (auto* serializeContext = azrtti_cast(context)) { serializeContext->Class() - ->Version(1) + ->Version(2) // ATOM-17127 ->Field("ProbeSpacing", &DiffuseProbeGridComponentConfig::m_probeSpacing) ->Field("Extents", &DiffuseProbeGridComponentConfig::m_extents) ->Field("AmbientMultiplier", &DiffuseProbeGridComponentConfig::m_ambientMultiplier) ->Field("ViewBias", &DiffuseProbeGridComponentConfig::m_viewBias) ->Field("NormalBias", &DiffuseProbeGridComponentConfig::m_normalBias) + ->Field("NumRaysPerProbe", &DiffuseProbeGridComponentConfig::m_numRaysPerProbe) ->Field("EditorMode", &DiffuseProbeGridComponentConfig::m_editorMode) ->Field("RuntimeMode", &DiffuseProbeGridComponentConfig::m_runtimeMode) ->Field("BakedIrradianceTextureRelativePath", &DiffuseProbeGridComponentConfig::m_bakedIrradianceTextureRelativePath) @@ -138,6 +139,7 @@ namespace AZ m_featureProcessor->SetAmbientMultiplier(m_handle, m_configuration.m_ambientMultiplier); m_featureProcessor->SetViewBias(m_handle, m_configuration.m_viewBias); m_featureProcessor->SetNormalBias(m_handle, m_configuration.m_normalBias); + m_featureProcessor->SetNumRaysPerProbe(m_handle, m_configuration.m_numRaysPerProbe); // load the baked texture assets, but only if they are all valid if (m_configuration.m_bakedIrradianceTextureAsset.GetId().IsValid() && @@ -320,6 +322,17 @@ namespace AZ m_featureProcessor->SetNormalBias(m_handle, m_configuration.m_normalBias); } + void DiffuseProbeGridComponentController::SetNumRaysPerProbe(const DiffuseProbeGridNumRaysPerProbe& numRaysPerProbe) + { + if (!m_featureProcessor) + { + return; + } + + m_configuration.m_numRaysPerProbe = numRaysPerProbe; + m_featureProcessor->SetNumRaysPerProbe(m_handle, m_configuration.m_numRaysPerProbe); + } + void DiffuseProbeGridComponentController::SetEditorMode(DiffuseProbeGridMode editorMode) { if (!m_featureProcessor) diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridComponentController.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridComponentController.h index d3dd0efc0c..8f84954b2c 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridComponentController.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridComponentController.h @@ -35,6 +35,7 @@ namespace AZ float m_ambientMultiplier = DefaultDiffuseProbeGridAmbientMultiplier; float m_viewBias = DefaultDiffuseProbeGridViewBias; float m_normalBias = DefaultDiffuseProbeGridNormalBias; + DiffuseProbeGridNumRaysPerProbe m_numRaysPerProbe = DefaultDiffuseProbeGridNumRaysPerProbe; DiffuseProbeGridMode m_editorMode = DiffuseProbeGridMode::RealTime; DiffuseProbeGridMode m_runtimeMode = DiffuseProbeGridMode::RealTime; @@ -98,6 +99,7 @@ namespace AZ void SetAmbientMultiplier(float ambientMultiplier); void SetViewBias(float viewBias); void SetNormalBias(float normalBias); + void SetNumRaysPerProbe(const DiffuseProbeGridNumRaysPerProbe& numRaysPerProbe); void SetEditorMode(DiffuseProbeGridMode editorMode); void SetRuntimeMode(DiffuseProbeGridMode runtimeMode); diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/EditorDiffuseProbeGridComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/EditorDiffuseProbeGridComponent.cpp index 19b3f4459c..6588b18636 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/EditorDiffuseProbeGridComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/EditorDiffuseProbeGridComponent.cpp @@ -40,6 +40,7 @@ namespace AZ ->Field("ambientMultiplier", &EditorDiffuseProbeGridComponent::m_ambientMultiplier) ->Field("viewBias", &EditorDiffuseProbeGridComponent::m_viewBias) ->Field("normalBias", &EditorDiffuseProbeGridComponent::m_normalBias) + ->Field("numRaysPerProbe", &EditorDiffuseProbeGridComponent::m_numRaysPerProbe) ->Field("editorMode", &EditorDiffuseProbeGridComponent::m_editorMode) ->Field("runtimeMode", &EditorDiffuseProbeGridComponent::m_runtimeMode) ; @@ -93,6 +94,9 @@ namespace AZ ->Attribute(Edit::Attributes::Step, 0.1f) ->Attribute(Edit::Attributes::Min, 0.0f) ->Attribute(Edit::Attributes::Max, 1.0f) + ->DataElement(AZ::Edit::UIHandlers::ComboBox, &EditorDiffuseProbeGridComponent::m_numRaysPerProbe, "Number of Rays Per Probe", "Number of rays cast by each probe to detect lighting in its surroundings") + ->Attribute(AZ::Edit::Attributes::ChangeNotify, &EditorDiffuseProbeGridComponent::OnNumRaysPerProbeChanged) + ->Attribute(AZ::Edit::Attributes::EnumValues, &EditorDiffuseProbeGridComponent::GetNumRaysPerProbeEnumList) ->ClassElement(AZ::Edit::ClassElements::EditorData, "Grid mode") ->Attribute(AZ::Edit::Attributes::AutoExpand, true) ->DataElement(Edit::UIHandlers::ComboBox, &EditorDiffuseProbeGridComponent::m_editorMode, "Editor Mode", "Controls whether the editor uses RealTime or Baked diffuse GI. RealTime requires a ray-tracing capable GPU. Auto-Select will fallback to Baked if ray-tracing is not available") @@ -216,6 +220,19 @@ namespace AZ } } + AZStd::vector> EditorDiffuseProbeGridComponent::GetNumRaysPerProbeEnumList() const + { + AZStd::vector> enumList; + + for (uint32_t index = 0; index < DiffuseProbeGridNumRaysPerProbeArraySize; ++index) + { + const DiffuseProbeGridNumRaysPerProbeEntry& entry = DiffuseProbeGridNumRaysPerProbeArray[index]; + enumList.push_back(Edit::EnumConstant(entry.m_enum, AZStd::to_string(entry.m_rayCount).c_str())); + } + + return enumList; + } + AZ::Aabb EditorDiffuseProbeGridComponent::GetEditorSelectionBoundsViewport([[maybe_unused]] const AzFramework::ViewportInfo& viewportInfo) { return m_controller.GetAabb(); @@ -313,6 +330,12 @@ namespace AZ return AZ::Edit::PropertyRefreshLevels::None; } + AZ::u32 EditorDiffuseProbeGridComponent::OnNumRaysPerProbeChanged() + { + m_controller.SetNumRaysPerProbe(m_numRaysPerProbe); + return AZ::Edit::PropertyRefreshLevels::None; + } + AZ::u32 EditorDiffuseProbeGridComponent::OnEditorModeChanged() { // this will update the configuration and also change the DiffuseProbeGrid mode diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/EditorDiffuseProbeGridComponent.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/EditorDiffuseProbeGridComponent.h index ba5693b022..c7832902a8 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/EditorDiffuseProbeGridComponent.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/EditorDiffuseProbeGridComponent.h @@ -56,6 +56,7 @@ namespace AZ AZStd::string ValidateOrCreateNewTexturePath(const AZStd::string& relativePath, const char* fileSuffix); void CheckoutSourceTextureFile(const AZStd::string& fullPath); void CheckTextureAssetNotification(const AZStd::string& relativePath, Data::Asset& configurationAsset); + AZStd::vector> GetNumRaysPerProbeEnumList() const; // property change notifications AZ::Outcome OnProbeSpacingValidateX(void* newValue, const AZ::Uuid& valueType); @@ -65,6 +66,7 @@ namespace AZ AZ::u32 OnAmbientMultiplierChanged(); AZ::u32 OnViewBiasChanged(); AZ::u32 OnNormalBiasChanged(); + AZ::u32 OnNumRaysPerProbeChanged(); AZ::u32 OnEditorModeChanged(); AZ::u32 OnRuntimeModeChanged(); AZ::Outcome OnModeChangeValidate(void* newValue, const AZ::Uuid& valueType); @@ -80,6 +82,7 @@ namespace AZ float m_ambientMultiplier = DefaultDiffuseProbeGridAmbientMultiplier; float m_viewBias = DefaultDiffuseProbeGridViewBias; float m_normalBias = DefaultDiffuseProbeGridNormalBias; + DiffuseProbeGridNumRaysPerProbe m_numRaysPerProbe = DefaultDiffuseProbeGridNumRaysPerProbe; DiffuseProbeGridMode m_editorMode = DiffuseProbeGridMode::RealTime; DiffuseProbeGridMode m_runtimeMode = DiffuseProbeGridMode::RealTime; From c95845d45b3523092ac61fc4eab5c9199749af0d Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Wed, 19 Jan 2022 20:02:50 -0800 Subject: [PATCH 565/948] chore: replace isspace Signed-off-by: Michael Pollind --- .../Platform/Common/UnixLike/AzCore/Debug/Trace_UnixLike.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Framework/AzCore/Platform/Common/UnixLike/AzCore/Debug/Trace_UnixLike.cpp b/Code/Framework/AzCore/Platform/Common/UnixLike/AzCore/Debug/Trace_UnixLike.cpp index e1f1a0f801..e89c46bce7 100644 --- a/Code/Framework/AzCore/Platform/Common/UnixLike/AzCore/Debug/Trace_UnixLike.cpp +++ b/Code/Framework/AzCore/Platform/Common/UnixLike/AzCore/Debug/Trace_UnixLike.cpp @@ -45,7 +45,7 @@ namespace AZ::Debug } for (size_t i = tracerPidOffset + tracerPidString.length(); i < numRead; ++i) { - if (!::isspace(processStatusView[i])) + if (processStatusView[i] != ' ') { return processStatusView[i] != '0'; } From c98d14ad924d2e0efe9eeff650b899cdeb204cda Mon Sep 17 00:00:00 2001 From: Guthrie Adams Date: Thu, 20 Jan 2022 00:10:07 -0600 Subject: [PATCH 566/948] =?UTF-8?q?Atom=20Tools:=20Removing=20unnecessary?= =?UTF-8?q?=20modules,=20components,=20and=20dead=20code=20from=20ME=20?= =?UTF-8?q?=E2=80=A2=20Working=20toward=20creating=20a=20standalone=20appl?= =?UTF-8?q?ication=20template=20Removing=20application=20level=20modules?= =?UTF-8?q?=20and=20system=20components=20that=20make=20it=20difficult=20t?= =?UTF-8?q?o=20navigate=20the=20project=20and=20add=20a=20lot=20of=20boile?= =?UTF-8?q?rplate=20code=20=E2=80=A2=20Temporarily=20keeping=20viewport=20?= =?UTF-8?q?module=20and=20components=20because=20shutting=20down=20the=20a?= =?UTF-8?q?pplication=20deactivates=20module=20entities=20before=20system?= =?UTF-8?q?=20entities=20without=20respecting=20component=20service=20depe?= =?UTF-8?q?ndency=20order.=20This=20caused=20several=20RPI=20assets=20and?= =?UTF-8?q?=20names=20to=20leak=20because=20they=20were=20not=20being=20de?= =?UTF-8?q?stroyed=20in=20the=20correct=20order.=20=E2=80=A2=20Fixing=20in?= =?UTF-8?q?clude=20paths=20not=20referenced=20source=20folders=20=E2=80=A2?= =?UTF-8?q?=20Mostly=20cleanup=20and=20reorganization,=20no=20behavioral?= =?UTF-8?q?=20changes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Guthrie Adams --- .../Application/AtomToolsApplication.cpp | 4 + .../AtomToolsFrameworkSystemComponent.cpp | 6 +- .../DynamicProperty/DynamicProperty.cpp | 2 +- .../Code/Source/Inspector/InspectorWidget.cpp | 2 +- .../Tools/MaterialEditor/Code/CMakeLists.txt | 78 ++----------- .../Atom/Document/MaterialDocumentModule.h | 29 ----- .../Atom/Window/MaterialEditorWindowModule.h | 28 ----- .../Code/Source/Document/MaterialDocument.h | 7 +- .../Document/MaterialDocumentModule.cpp | 30 ----- .../Document/MaterialDocumentRequestBus.h | 0 .../Document/MaterialDocumentSettings.cpp | 2 +- .../Document/MaterialDocumentSettings.h | 0 .../MaterialDocumentSystemComponent.cpp | 85 -------------- .../MaterialDocumentSystemComponent.h | 41 ------- .../Code/Source/MaterialEditorApplication.cpp | 107 ++++++++++++++---- .../Code/Source/MaterialEditorApplication.h | 19 ++++ .../Viewport/InputController/Behavior.cpp | 5 +- .../InputController/DollyCameraBehavior.cpp | 4 +- .../InputController/DollyCameraBehavior.h | 2 +- .../Viewport/InputController/IdleBehavior.cpp | 2 +- .../Viewport/InputController/IdleBehavior.h | 2 +- .../MaterialEditorViewportInputController.cpp | 24 ++-- .../MaterialEditorViewportInputController.h | 4 +- ...MaterialEditorViewportInputControllerBus.h | 0 .../InputController/MoveCameraBehavior.cpp | 6 +- .../InputController/MoveCameraBehavior.h | 2 +- .../InputController/OrbitCameraBehavior.cpp | 2 +- .../InputController/OrbitCameraBehavior.h | 2 +- .../InputController/PanCameraBehavior.cpp | 8 +- .../InputController/PanCameraBehavior.h | 2 +- .../RotateEnvironmentBehavior.cpp | 2 +- .../RotateEnvironmentBehavior.h | 2 +- .../InputController/RotateModelBehavior.cpp | 2 +- .../InputController/RotateModelBehavior.h | 2 +- .../Viewport/MaterialViewportComponent.cpp | 17 +-- .../Viewport/MaterialViewportComponent.h | 4 +- .../Viewport/MaterialViewportModule.cpp | 2 +- .../Viewport/MaterialViewportModule.h | 0 .../MaterialViewportNotificationBus.h | 0 .../Viewport/MaterialViewportRenderer.cpp | 36 +++--- .../Viewport/MaterialViewportRenderer.h | 2 +- .../Viewport/MaterialViewportRequestBus.h | 0 .../Viewport/MaterialViewportSettings.cpp | 2 +- .../Viewport/MaterialViewportSettings.h | 0 .../Viewport/PerformanceMetrics.h | 0 .../Viewport/PerformanceMonitorComponent.cpp | 2 +- .../Viewport/PerformanceMonitorComponent.h | 5 +- .../Viewport/PerformanceMonitorRequestBus.h | 3 +- .../CreateMaterialDialog.cpp | 2 +- .../CreateMaterialDialog.h | 2 +- .../Source/Window/HelpDialog/HelpDialog.cpp | 4 +- .../Source/Window/HelpDialog/HelpDialog.h | 2 +- .../Source/Window/MaterialEditorWindow.cpp | 4 +- .../Window/MaterialEditorWindowComponent.cpp | 89 --------------- .../Window/MaterialEditorWindowComponent.h | 58 ---------- .../Window/MaterialEditorWindowModule.cpp | 38 ------- .../Window/MaterialEditorWindowSettings.cpp | 2 +- .../Window/MaterialEditorWindowSettings.h | 0 .../MaterialInspector/MaterialInspector.cpp | 2 +- .../MaterialInspector/MaterialInspector.h | 2 +- .../PerformanceMonitorWidget.cpp | 9 +- .../LightingPresetBrowserDialog.cpp | 2 +- .../LightingPresetBrowserDialog.h | 2 +- .../ModelPresetBrowserDialog.cpp | 2 +- .../ModelPresetBrowserDialog.h | 2 +- .../Window/SettingsDialog/SettingsWidget.h | 2 +- .../Window/ToolBar/LightingPresetComboBox.cpp | 6 +- .../Window/ToolBar/LightingPresetComboBox.h | 2 +- .../Window/ToolBar/MaterialEditorToolBar.cpp | 8 +- .../Window/ToolBar/MaterialEditorToolBar.h | 2 +- .../Window/ToolBar/ModelPresetComboBox.cpp | 6 +- .../Window/ToolBar/ModelPresetComboBox.h | 2 +- .../ViewportSettingsInspector.cpp | 4 +- .../ViewportSettingsInspector.h | 6 +- .../Code/materialeditor_files.cmake | 82 ++++++++++++++ .../Code/materialeditordocument_files.cmake | 19 ---- .../Code/materialeditorviewport_files.cmake | 46 -------- .../Code/materialeditorwindow_files.cmake | 52 --------- .../ShaderManagementConsoleWindowComponent.h | 12 +- .../ShaderManagementConsoleToolBar.cpp | 4 +- 80 files changed, 326 insertions(+), 735 deletions(-) delete mode 100644 Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Document/MaterialDocumentModule.h delete mode 100644 Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Window/MaterialEditorWindowModule.h delete mode 100644 Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocumentModule.cpp rename Gems/Atom/Tools/MaterialEditor/Code/{Include/Atom => Source}/Document/MaterialDocumentRequestBus.h (100%) rename Gems/Atom/Tools/MaterialEditor/Code/{Include/Atom => Source}/Document/MaterialDocumentSettings.h (100%) delete mode 100644 Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocumentSystemComponent.cpp delete mode 100644 Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocumentSystemComponent.h rename Gems/Atom/Tools/MaterialEditor/Code/{Include/Atom => Source}/Viewport/InputController/MaterialEditorViewportInputControllerBus.h (100%) rename Gems/Atom/Tools/MaterialEditor/Code/{Include/Atom => Source}/Viewport/MaterialViewportModule.h (100%) rename Gems/Atom/Tools/MaterialEditor/Code/{Include/Atom => Source}/Viewport/MaterialViewportNotificationBus.h (100%) rename Gems/Atom/Tools/MaterialEditor/Code/{Include/Atom => Source}/Viewport/MaterialViewportRequestBus.h (100%) rename Gems/Atom/Tools/MaterialEditor/Code/{Include/Atom => Source}/Viewport/MaterialViewportSettings.h (100%) rename Gems/Atom/Tools/MaterialEditor/Code/{Include/Atom => Source}/Viewport/PerformanceMetrics.h (100%) rename Gems/Atom/Tools/MaterialEditor/Code/{Include/Atom => Source}/Viewport/PerformanceMonitorRequestBus.h (95%) delete mode 100644 Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindowComponent.cpp delete mode 100644 Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindowComponent.h delete mode 100644 Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindowModule.cpp rename Gems/Atom/Tools/MaterialEditor/Code/{Include/Atom => Source}/Window/MaterialEditorWindowSettings.h (100%) delete mode 100644 Gems/Atom/Tools/MaterialEditor/Code/materialeditordocument_files.cmake delete mode 100644 Gems/Atom/Tools/MaterialEditor/Code/materialeditorviewport_files.cmake delete mode 100644 Gems/Atom/Tools/MaterialEditor/Code/materialeditorwindow_files.cmake diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Application/AtomToolsApplication.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Application/AtomToolsApplication.cpp index 51e8bc4dda..7b6be61050 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Application/AtomToolsApplication.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Application/AtomToolsApplication.cpp @@ -158,6 +158,7 @@ namespace AtomToolsFramework components.end(), { azrtti_typeid(), + azrtti_typeid(), azrtti_typeid(), azrtti_typeid(), azrtti_typeid(), @@ -187,6 +188,9 @@ namespace AtomToolsFramework AzToolsFramework::AssetBrowser::AssetDatabaseLocationNotificationBus::Broadcast( &AzToolsFramework::AssetBrowser::AssetDatabaseLocationNotifications::OnDatabaseInitialized); + AzToolsFramework::SourceControlConnectionRequestBus::Broadcast( + &AzToolsFramework::SourceControlConnectionRequests::EnableSourceControl, true); + if (!AZ::RPI::RPISystemInterface::Get()->IsInitialized()) { AZ::RPI::RPISystemInterface::Get()->InitializeSystemAssets(); diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/AtomToolsFrameworkSystemComponent.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/AtomToolsFrameworkSystemComponent.cpp index a8481ef5bd..adba947092 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/AtomToolsFrameworkSystemComponent.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/AtomToolsFrameworkSystemComponent.cpp @@ -30,7 +30,7 @@ namespace AtomToolsFramework { ec->Class("AtomToolsFrameworkSystemComponent", "") ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("System", 0xc94d118b)) + ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC_CE("System")) ->Attribute(AZ::Edit::Attributes::AutoExpand, true) ; } @@ -39,12 +39,12 @@ namespace AtomToolsFramework void AtomToolsFrameworkSystemComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided) { - provided.push_back(AZ_CRC("AtomToolsFrameworkSystemService")); + provided.push_back(AZ_CRC_CE("AtomToolsFrameworkSystemService")); } void AtomToolsFrameworkSystemComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible) { - incompatible.push_back(AZ_CRC("AtomToolsFrameworkSystemService")); + incompatible.push_back(AZ_CRC_CE("AtomToolsFrameworkSystemService")); } void AtomToolsFrameworkSystemComponent::GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required) diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/DynamicProperty/DynamicProperty.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/DynamicProperty/DynamicProperty.cpp index d4599b68b7..830f71933c 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/DynamicProperty/DynamicProperty.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/DynamicProperty/DynamicProperty.cpp @@ -160,7 +160,7 @@ namespace AtomToolsFramework ApplyRangeEditDataAttributes(); break; case DynamicPropertyType::Color: - AddEditDataAttribute(AZ_CRC("ColorEditorConfiguration", 0xc8b9510e), AZ::RPI::ColorUtils::GetRgbEditorConfig()); + AddEditDataAttribute(AZ_CRC_CE("ColorEditorConfiguration"), AZ::RPI::ColorUtils::GetRgbEditorConfig()); break; case DynamicPropertyType::Enum: m_editData.m_elementId = AZ::Edit::UIHandlers::ComboBox; diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Inspector/InspectorWidget.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Inspector/InspectorWidget.cpp index fbe188364a..89f7e9d3bf 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Inspector/InspectorWidget.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Inspector/InspectorWidget.cpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include namespace AtomToolsFramework { diff --git a/Gems/Atom/Tools/MaterialEditor/Code/CMakeLists.txt b/Gems/Atom/Tools/MaterialEditor/Code/CMakeLists.txt index 1d9295f9b3..5a0d153578 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/CMakeLists.txt +++ b/Gems/Atom/Tools/MaterialEditor/Code/CMakeLists.txt @@ -18,78 +18,12 @@ if(NOT PAL_TRAIT_ATOM_MATERIAL_EDITOR_APPLICATION_SUPPORTED) return() endif() - ly_add_target( - NAME MaterialEditor.Document STATIC - NAMESPACE Gem - AUTOMOC - FILES_CMAKE - materialeditordocument_files.cmake - INCLUDE_DIRECTORIES - PRIVATE - . - Source - PUBLIC - Include - BUILD_DEPENDENCIES - PUBLIC - Gem::AtomToolsFramework.Static - Gem::AtomToolsFramework.Editor - Gem::Atom_RPI.Edit - Gem::Atom_RPI.Public - Gem::Atom_RHI.Reflect -) - -ly_add_target( - NAME MaterialEditor.Window STATIC + NAME MaterialEditor EXECUTABLE NAMESPACE Gem AUTOMOC AUTOUIC AUTORCC - FILES_CMAKE - materialeditorwindow_files.cmake - INCLUDE_DIRECTORIES - PRIVATE - . - Source - PUBLIC - Include - BUILD_DEPENDENCIES - PUBLIC - Gem::AtomToolsFramework.Static - Gem::AtomToolsFramework.Editor - Gem::Atom_RPI.Public - Gem::Atom_Feature_Common.Public -) - -ly_add_target( - NAME MaterialEditor.Viewport STATIC - NAMESPACE Gem - AUTOMOC - AUTOUIC - FILES_CMAKE - materialeditorviewport_files.cmake - INCLUDE_DIRECTORIES - PRIVATE - . - Source - Public - Include - BUILD_DEPENDENCIES - PUBLIC - Gem::AtomToolsFramework.Static - Gem::AtomToolsFramework.Editor - Gem::Atom_RHI.Public - Gem::Atom_RPI.Public - Gem::Atom_Feature_Common.Static - Gem::Atom_Component_DebugCamera.Static - Gem::AtomLyIntegration_CommonFeatures.Static -) - -ly_add_target( - NAME MaterialEditor EXECUTABLE - NAMESPACE Gem - AUTOMOC FILES_CMAKE materialeditor_files.cmake ${pal_source_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake @@ -106,9 +40,13 @@ ly_add_target( PRIVATE Gem::AtomToolsFramework.Static Gem::AtomToolsFramework.Editor - Gem::MaterialEditor.Window - Gem::MaterialEditor.Viewport - Gem::MaterialEditor.Document + Gem::Atom_RHI.Public + Gem::Atom_RHI.Reflect + Gem::Atom_RPI.Edit + Gem::Atom_RPI.Public + Gem::Atom_Feature_Common.Public + Gem::Atom_Component_DebugCamera.Static + Gem::AtomLyIntegration_CommonFeatures.Static RUNTIME_DEPENDENCIES Gem::AtomToolsFramework.Editor Gem::EditorPythonBindings.Editor diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Document/MaterialDocumentModule.h b/Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Document/MaterialDocumentModule.h deleted file mode 100644 index 0813f8cab8..0000000000 --- a/Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Document/MaterialDocumentModule.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#pragma once - -#include - -namespace MaterialEditor -{ - //! Entry point for Material Editor Document library. This module is responsible for registering dependencies and logic needed - //! for the Material Document API - class MaterialDocumentModule - : public AZ::Module - { - public: - AZ_RTTI(MaterialDocumentModule, "{81D7A170-9284-4DE9-8D92-B6B94E8A2BDF}", AZ::Module); - AZ_CLASS_ALLOCATOR(MaterialDocumentModule, AZ::SystemAllocator, 0); - - MaterialDocumentModule(); - - //! Add required SystemComponents to the SystemEntity. - AZ::ComponentTypeList GetRequiredSystemComponents() const override; - }; -} diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Window/MaterialEditorWindowModule.h b/Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Window/MaterialEditorWindowModule.h deleted file mode 100644 index 611a993084..0000000000 --- a/Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Window/MaterialEditorWindowModule.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#pragma once - -#include - -namespace MaterialEditor -{ - //! Entry point for Material Editor Window library. - class MaterialEditorWindowModule - : public AZ::Module - { - public: - AZ_RTTI(MaterialEditorWindowModule, "{57D6239C-AE03-4ED8-9125-35C5B1625503}", AZ::Module); - AZ_CLASS_ALLOCATOR(MaterialEditorWindowModule, AZ::SystemAllocator, 0); - - MaterialEditorWindowModule(); - - //! Add required SystemComponents to the SystemEntity. - AZ::ComponentTypeList GetRequiredSystemComponents() const override; - }; -} diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.h index ceb3190f26..c975824e22 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.h @@ -7,18 +7,17 @@ */ #pragma once -#include #include #include -#include +#include #include -#include #include #include #include -#include +#include #include +#include namespace MaterialEditor { diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocumentModule.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocumentModule.cpp deleted file mode 100644 index c721798cfd..0000000000 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocumentModule.cpp +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#include -#include -#include - -namespace MaterialEditor -{ - MaterialDocumentModule::MaterialDocumentModule() - { - // Push results of [MyComponent]::CreateDescriptor() into m_descriptors here. - m_descriptors.insert(m_descriptors.end(), { - MaterialDocumentSystemComponent::CreateDescriptor(), - }); - } - - AZ::ComponentTypeList MaterialDocumentModule::GetRequiredSystemComponents() const - { - return AZ::ComponentTypeList{ - azrtti_typeid(), - azrtti_typeid(), - }; - } -} diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Document/MaterialDocumentRequestBus.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocumentRequestBus.h similarity index 100% rename from Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Document/MaterialDocumentRequestBus.h rename to Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocumentRequestBus.h diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocumentSettings.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocumentSettings.cpp index 4823b8c67c..256497de54 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocumentSettings.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocumentSettings.cpp @@ -6,9 +6,9 @@ * */ -#include #include #include +#include namespace MaterialEditor { diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Document/MaterialDocumentSettings.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocumentSettings.h similarity index 100% rename from Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Document/MaterialDocumentSettings.h rename to Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocumentSettings.h diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocumentSystemComponent.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocumentSystemComponent.cpp deleted file mode 100644 index 9302b5ac5c..0000000000 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocumentSystemComponent.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace MaterialEditor -{ - void MaterialDocumentSystemComponent::Reflect(AZ::ReflectContext* context) - { - MaterialDocumentSettings::Reflect(context); - - if (AZ::SerializeContext* serialize = azrtti_cast(context)) - { - serialize->Class() - ->Version(0); - - if (AZ::EditContext* ec = serialize->GetEditContext()) - { - ec->Class("MaterialDocumentSystemComponent", "Tool for editing Atom material files") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC_CE("System")) - ->Attribute(AZ::Edit::Attributes::AutoExpand, true) - ; - } - } - - if (AZ::BehaviorContext* behaviorContext = azrtti_cast(context)) - { - behaviorContext->EBus("MaterialDocumentRequestBus") - ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common) - ->Attribute(AZ::Script::Attributes::Category, "Editor") - ->Attribute(AZ::Script::Attributes::Module, "materialeditor") - ; - } - } - - void MaterialDocumentSystemComponent::GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required) - { - required.push_back(AZ_CRC_CE("AtomToolsDocumentSystemService")); - required.push_back(AZ_CRC_CE("AssetProcessorToolsConnection")); - required.push_back(AZ_CRC_CE("AssetDatabaseService")); - required.push_back(AZ_CRC_CE("PropertyManagerService")); - required.push_back(AZ_CRC_CE("RPISystem")); - } - - void MaterialDocumentSystemComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided) - { - provided.push_back(AZ_CRC_CE("MaterialDocumentSystemService")); - } - - void MaterialDocumentSystemComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible) - { - incompatible.push_back(AZ_CRC_CE("MaterialDocumentSystemService")); - } - - void MaterialDocumentSystemComponent::Init() - { - } - - void MaterialDocumentSystemComponent::Activate() - { - AtomToolsFramework::AtomToolsDocumentSystemRequestBus::Broadcast( - &AtomToolsFramework::AtomToolsDocumentSystemRequestBus::Handler::RegisterDocumentType, - []() - { - return aznew MaterialDocument(); - }); - } - - void MaterialDocumentSystemComponent::Deactivate() - { - } -} diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocumentSystemComponent.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocumentSystemComponent.h deleted file mode 100644 index af19956088..0000000000 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocumentSystemComponent.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#pragma once - -#include - -namespace MaterialEditor -{ - //! MaterialDocumentSystemComponent - class MaterialDocumentSystemComponent - : public AZ::Component - { - public: - AZ_COMPONENT(MaterialDocumentSystemComponent, "{E011DA51-855D-45FA-87A3-1C1CD6379091}"); - - MaterialDocumentSystemComponent() = default; - ~MaterialDocumentSystemComponent() = default; - MaterialDocumentSystemComponent(const MaterialDocumentSystemComponent&) = delete; - MaterialDocumentSystemComponent& operator=(const MaterialDocumentSystemComponent&) = delete; - - static void Reflect(AZ::ReflectContext* context); - - static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required); - static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided); - static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible); - - private: - //////////////////////////////////////////////////////////////////////// - // AZ::Component interface implementation - void Init() override; - void Activate() override; - void Deactivate() override; - //////////////////////////////////////////////////////////////////////// - }; -} // namespace MaterialEditor diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/MaterialEditorApplication.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/MaterialEditorApplication.cpp index 15a5ff1715..2e64740057 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/MaterialEditorApplication.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/MaterialEditorApplication.cpp @@ -6,22 +6,73 @@ * */ -#include -#include -#include +#include +#include +#include +#include #include +#include +#include +#include +#include #include #include +#include +#include +#include + +void InitMaterialEditorResources() +{ + // Must register qt resources from other modules + Q_INIT_RESOURCE(MaterialEditor); + Q_INIT_RESOURCE(InspectorWidget); + Q_INIT_RESOURCE(AtomToolsAssetBrowser); +} namespace MaterialEditor { - //! This function returns the build system target name of "MaterialEditor" - AZStd::string MaterialEditorApplication::GetBuildTargetName() const + MaterialEditorApplication::MaterialEditorApplication(int* argc, char*** argv) + : Base(argc, argv) { -#if !defined(LY_CMAKE_TARGET) -#error "LY_CMAKE_TARGET must be defined in order to add this source file to a CMake executable target" -#endif - return AZStd::string{ LY_CMAKE_TARGET }; + InitMaterialEditorResources(); + + QApplication::setApplicationName("O3DE Material Editor"); + + // The settings registry has been created at this point, so add the CMake target + AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddBuildSystemTargetSpecialization( + *AZ::SettingsRegistry::Get(), GetBuildTargetName()); + + AzToolsFramework::EditorWindowRequestBus::Handler::BusConnect(); + AtomToolsFramework::AtomToolsMainWindowFactoryRequestBus::Handler::BusConnect(); + } + + MaterialEditorApplication::~MaterialEditorApplication() + { + AtomToolsFramework::AtomToolsMainWindowFactoryRequestBus::Handler::BusDisconnect(); + AzToolsFramework::EditorWindowRequestBus::Handler::BusDisconnect(); + m_window.reset(); + } + + void MaterialEditorApplication::Reflect(AZ::ReflectContext* context) + { + Base::Reflect(context); + MaterialDocumentSettings::Reflect(context); + MaterialEditorWindowSettings::Reflect(context); + + if (AZ::BehaviorContext* behaviorContext = azrtti_cast(context)) + { + behaviorContext->EBus("MaterialDocumentRequestBus") + ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common) + ->Attribute(AZ::Script::Attributes::Category, "Editor") + ->Attribute(AZ::Script::Attributes::Module, "materialeditor") + ; + } + } + + void MaterialEditorApplication::CreateStaticModules(AZStd::vector& outModules) + { + Base::CreateStaticModules(outModules); + outModules.push_back(aznew MaterialViewportModule); } const char* MaterialEditorApplication::GetCurrentConfigurationName() const @@ -35,26 +86,42 @@ namespace MaterialEditor #endif } - MaterialEditorApplication::MaterialEditorApplication(int* argc, char*** argv) - : Base(argc, argv) + void MaterialEditorApplication::StartCommon(AZ::Entity* systemEntity) { - QApplication::setApplicationName("O3DE Material Editor"); + Base::StartCommon(systemEntity); - // The settings registry has been created at this point, so add the CMake target - AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddBuildSystemTargetSpecialization( - *AZ::SettingsRegistry::Get(), GetBuildTargetName()); + AtomToolsFramework::AtomToolsDocumentSystemRequestBus::Broadcast( + &AtomToolsFramework::AtomToolsDocumentSystemRequestBus::Handler::RegisterDocumentType, + []() { return aznew MaterialDocument(); }); } - void MaterialEditorApplication::CreateStaticModules(AZStd::vector& outModules) + AZStd::string MaterialEditorApplication::GetBuildTargetName() const { - Base::CreateStaticModules(outModules); - outModules.push_back(aznew MaterialDocumentModule); - outModules.push_back(aznew MaterialViewportModule); - outModules.push_back(aznew MaterialEditorWindowModule); +#if !defined(LY_CMAKE_TARGET) +#error "LY_CMAKE_TARGET must be defined in order to add this source file to a CMake executable target" +#endif + //! Returns the build system target name of "MaterialEditor" + return AZStd::string{ LY_CMAKE_TARGET }; } AZStd::vector MaterialEditorApplication::GetCriticalAssetFilters() const { return AZStd::vector({ "passes/", "config/", "MaterialEditor/" }); } + + void MaterialEditorApplication::CreateMainWindow() + { + m_materialEditorBrowserInteractions.reset(aznew MaterialEditorBrowserInteractions); + m_window.reset(aznew MaterialEditorWindow); + } + + void MaterialEditorApplication::DestroyMainWindow() + { + m_window.reset(); + } + + QWidget* MaterialEditorApplication::GetAppMainWindow() + { + return m_window.get(); + } } // namespace MaterialEditor diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/MaterialEditorApplication.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/MaterialEditorApplication.h index bf2e6f6ca1..060353e396 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/MaterialEditorApplication.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/MaterialEditorApplication.h @@ -9,6 +9,10 @@ #pragma once #include +#include +#include +#include +#include namespace MaterialEditor { @@ -16,6 +20,8 @@ namespace MaterialEditor class MaterialEditorApplication : public AtomToolsFramework::AtomToolsDocumentApplication + , private AzToolsFramework::EditorWindowRequestBus::Handler + , private AtomToolsFramework::AtomToolsMainWindowFactoryRequestBus::Handler { public: AZ_TYPE_INFO(MaterialEditor::MaterialEditorApplication, "{30F90CA5-1253-49B5-8143-19CEE37E22BB}"); @@ -23,13 +29,26 @@ namespace MaterialEditor using Base = AtomToolsFramework::AtomToolsDocumentApplication; MaterialEditorApplication(int* argc, char*** argv); + ~MaterialEditorApplication(); // AzFramework::Application overrides... + void Reflect(AZ::ReflectContext* context) override; void CreateStaticModules(AZStd::vector& outModules) override; const char* GetCurrentConfigurationName() const override; + void StartCommon(AZ::Entity* systemEntity) override; // AtomToolsFramework::AtomToolsApplication overrides... AZStd::string GetBuildTargetName() const override; AZStd::vector GetCriticalAssetFilters() const override; + + // AtomToolsMainWindowFactoryRequestBus::Handler overrides... + void CreateMainWindow() override; + void DestroyMainWindow() override; + + // AzToolsFramework::EditorWindowRequests::Bus::Handler + QWidget* GetAppMainWindow() override; + + AZStd::unique_ptr m_window; + AZStd::unique_ptr m_materialEditorBrowserInteractions; }; } // namespace MaterialEditor diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/Behavior.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/Behavior.cpp index 321b79ba87..a843c4965c 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/Behavior.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/Behavior.cpp @@ -6,10 +6,9 @@ * */ -#include #include - -#include +#include +#include #include namespace MaterialEditor diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/DollyCameraBehavior.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/DollyCameraBehavior.cpp index c0326bce2a..c69884c5c0 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/DollyCameraBehavior.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/DollyCameraBehavior.cpp @@ -6,11 +6,11 @@ * */ +#include #include #include -#include +#include #include -#include namespace MaterialEditor { diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/DollyCameraBehavior.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/DollyCameraBehavior.h index be226e5fde..5debfc4dd1 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/DollyCameraBehavior.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/DollyCameraBehavior.h @@ -7,7 +7,7 @@ */ #pragma once -#include +#include namespace MaterialEditor { diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/IdleBehavior.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/IdleBehavior.cpp index 64e2fe1fdc..0cd062d86d 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/IdleBehavior.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/IdleBehavior.cpp @@ -6,7 +6,7 @@ * */ -#include +#include namespace MaterialEditor { diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/IdleBehavior.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/IdleBehavior.h index 3eec594da2..16543a890d 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/IdleBehavior.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/IdleBehavior.h @@ -7,7 +7,7 @@ */ #pragma once -#include +#include namespace MaterialEditor { diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/MaterialEditorViewportInputController.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/MaterialEditorViewportInputController.cpp index 1784405ffa..ced59f1bf5 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/MaterialEditorViewportInputController.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/MaterialEditorViewportInputController.cpp @@ -9,30 +9,30 @@ #include #include -#include #include #include +#include +#include #include #include -#include #include #include -#include +#include #include #include #include -#include +#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include namespace MaterialEditor { diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/MaterialEditorViewportInputController.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/MaterialEditorViewportInputController.h index b488c3bf29..a68666f06d 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/MaterialEditorViewportInputController.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/MaterialEditorViewportInputController.h @@ -9,8 +9,8 @@ #include #include -#include -#include +#include +#include namespace MaterialEditor { diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Viewport/InputController/MaterialEditorViewportInputControllerBus.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/MaterialEditorViewportInputControllerBus.h similarity index 100% rename from Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Viewport/InputController/MaterialEditorViewportInputControllerBus.h rename to Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/MaterialEditorViewportInputControllerBus.h diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/MoveCameraBehavior.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/MoveCameraBehavior.cpp index a449d6f7ff..80b3409f57 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/MoveCameraBehavior.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/MoveCameraBehavior.cpp @@ -6,10 +6,10 @@ * */ -#include #include -#include -#include +#include +#include +#include namespace MaterialEditor { diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/MoveCameraBehavior.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/MoveCameraBehavior.h index b37350423f..ea0850ba16 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/MoveCameraBehavior.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/MoveCameraBehavior.h @@ -7,7 +7,7 @@ */ #pragma once -#include +#include namespace MaterialEditor { diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/OrbitCameraBehavior.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/OrbitCameraBehavior.cpp index 4d8a5b9343..1d93e4eafe 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/OrbitCameraBehavior.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/OrbitCameraBehavior.cpp @@ -7,8 +7,8 @@ */ #include -#include #include +#include namespace MaterialEditor { diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/OrbitCameraBehavior.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/OrbitCameraBehavior.h index 98240aef96..a312d22e73 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/OrbitCameraBehavior.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/OrbitCameraBehavior.h @@ -7,7 +7,7 @@ */ #pragma once -#include +#include namespace MaterialEditor { diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/PanCameraBehavior.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/PanCameraBehavior.cpp index 62839be13c..2b036a1319 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/PanCameraBehavior.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/PanCameraBehavior.cpp @@ -6,11 +6,11 @@ * */ -#include -#include #include -#include -#include +#include +#include +#include +#include namespace MaterialEditor { diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/PanCameraBehavior.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/PanCameraBehavior.h index de8e2c3c43..93233511f0 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/PanCameraBehavior.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/PanCameraBehavior.h @@ -7,7 +7,7 @@ */ #pragma once -#include +#include namespace MaterialEditor { diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/RotateEnvironmentBehavior.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/RotateEnvironmentBehavior.cpp index 17fb3f3e52..894841becd 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/RotateEnvironmentBehavior.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/RotateEnvironmentBehavior.cpp @@ -13,7 +13,7 @@ #include #include -#include +#include namespace MaterialEditor { diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/RotateEnvironmentBehavior.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/RotateEnvironmentBehavior.h index 80989df520..56c7a5190a 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/RotateEnvironmentBehavior.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/RotateEnvironmentBehavior.h @@ -7,7 +7,7 @@ */ #pragma once -#include +#include namespace AZ { diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/RotateModelBehavior.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/RotateModelBehavior.cpp index 032b412d6e..ed09ae8fa3 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/RotateModelBehavior.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/RotateModelBehavior.cpp @@ -8,7 +8,7 @@ #include #include -#include +#include namespace MaterialEditor { diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/RotateModelBehavior.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/RotateModelBehavior.h index 7653e10014..e2c20ab5fd 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/RotateModelBehavior.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/RotateModelBehavior.h @@ -7,7 +7,7 @@ */ #pragma once -#include +#include namespace MaterialEditor { diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportComponent.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportComponent.cpp index 9cf714b40e..b2f1cdc9c1 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportComponent.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportComponent.cpp @@ -9,19 +9,19 @@ #include #include #include -#include -#include #include #include #include #include #include +#include #include #include -#include #include #include #include +#include +#include namespace MaterialEditor { @@ -42,7 +42,7 @@ namespace MaterialEditor { editContext->Class("MaterialViewport", "Manages configurations for lighting and models displayed in the viewport") ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("System", 0xc94d118b)) + ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC_CE("System")) ->Attribute(AZ::Edit::Attributes::AutoExpand, true) ; } @@ -103,18 +103,19 @@ namespace MaterialEditor void MaterialViewportComponent::GetRequiredServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& required) { - required.push_back(AZ_CRC("PerformanceMonitorService", 0x6a44241a)); - required.push_back(AZ_CRC("AtomImageBuilderService", 0x76ded592)); + required.push_back(AZ_CRC_CE("RPISystem")); + required.push_back(AZ_CRC_CE("AssetDatabaseService")); + required.push_back(AZ_CRC_CE("PerformanceMonitorService")); } void MaterialViewportComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided) { - provided.push_back(AZ_CRC("MaterialViewportService", 0xed9b44d7)); + provided.push_back(AZ_CRC_CE("MaterialViewportService")); } void MaterialViewportComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible) { - incompatible.push_back(AZ_CRC("MaterialViewportService", 0xed9b44d7)); + incompatible.push_back(AZ_CRC_CE("MaterialViewportService")); } void MaterialViewportComponent::Init() diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportComponent.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportComponent.h index 68668bd804..7209dfa489 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportComponent.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportComponent.h @@ -12,11 +12,11 @@ #include #include #include -#include -#include #include #include #include +#include +#include namespace MaterialEditor { diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportModule.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportModule.cpp index 7c3bc208ff..01a13519fb 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportModule.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportModule.cpp @@ -6,8 +6,8 @@ * */ -#include #include +#include #include namespace MaterialEditor diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Viewport/MaterialViewportModule.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportModule.h similarity index 100% rename from Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Viewport/MaterialViewportModule.h rename to Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportModule.h diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Viewport/MaterialViewportNotificationBus.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportNotificationBus.h similarity index 100% rename from Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Viewport/MaterialViewportNotificationBus.h rename to Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportNotificationBus.h diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportRenderer.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportRenderer.cpp index 409674f0bc..478fb92c55 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportRenderer.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportRenderer.cpp @@ -8,51 +8,51 @@ #undef RC_INVOKED -#include #include +#include -#include #include +#include #include #include -#include +#include +#include #include #include #include #include -#include -#include +#include #include #include -#include -#include -#include -#include #include +#include +#include +#include +#include -#include #include #include -#include -#include -#include -#include #include +#include #include #include -#include #include -#include +#include #include -#include +#include #include #include +#include -#include +#include +#include +#include +#include +#include namespace MaterialEditor { diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportRenderer.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportRenderer.h index c6380ddc00..35b7965a2e 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportRenderer.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportRenderer.h @@ -11,12 +11,12 @@ #include #include #include -#include #include #include #include #include #include +#include namespace AZ { diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Viewport/MaterialViewportRequestBus.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportRequestBus.h similarity index 100% rename from Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Viewport/MaterialViewportRequestBus.h rename to Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportRequestBus.h diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportSettings.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportSettings.cpp index c2c35119c2..0f08716407 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportSettings.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportSettings.cpp @@ -6,9 +6,9 @@ * */ -#include #include #include +#include namespace MaterialEditor { diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Viewport/MaterialViewportSettings.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportSettings.h similarity index 100% rename from Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Viewport/MaterialViewportSettings.h rename to Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportSettings.h diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Viewport/PerformanceMetrics.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/PerformanceMetrics.h similarity index 100% rename from Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Viewport/PerformanceMetrics.h rename to Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/PerformanceMetrics.h diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/PerformanceMonitorComponent.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/PerformanceMonitorComponent.cpp index 563b2754df..c8f12480b5 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/PerformanceMonitorComponent.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/PerformanceMonitorComponent.cpp @@ -31,7 +31,7 @@ namespace MaterialEditor void PerformanceMonitorComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided) { - provided.push_back(AZ_CRC("PerformanceMonitorService", 0x6a44241a)); + provided.push_back(AZ_CRC_CE("PerformanceMonitorService")); } void PerformanceMonitorComponent::Init() diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/PerformanceMonitorComponent.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/PerformanceMonitorComponent.h index 88a6827bd1..3045bf9533 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/PerformanceMonitorComponent.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/PerformanceMonitorComponent.h @@ -8,11 +8,10 @@ #pragma once +#include #include #include - -#include -#include +#include namespace MaterialEditor { diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Viewport/PerformanceMonitorRequestBus.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/PerformanceMonitorRequestBus.h similarity index 95% rename from Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Viewport/PerformanceMonitorRequestBus.h rename to Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/PerformanceMonitorRequestBus.h index ae09064766..6001787d99 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Viewport/PerformanceMonitorRequestBus.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/PerformanceMonitorRequestBus.h @@ -8,8 +8,7 @@ #pragma once #include - -#include +#include namespace MaterialEditor { diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/CreateMaterialDialog/CreateMaterialDialog.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/CreateMaterialDialog/CreateMaterialDialog.cpp index 31ca873c48..0e6cf565e3 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/CreateMaterialDialog/CreateMaterialDialog.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/CreateMaterialDialog/CreateMaterialDialog.cpp @@ -6,7 +6,6 @@ * */ -#include #include #include #include @@ -15,6 +14,7 @@ #include #include #include +#include #include namespace MaterialEditor diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/CreateMaterialDialog/CreateMaterialDialog.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/CreateMaterialDialog/CreateMaterialDialog.h index 3453d8347c..ed3cb2773b 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/CreateMaterialDialog/CreateMaterialDialog.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/CreateMaterialDialog/CreateMaterialDialog.h @@ -10,7 +10,7 @@ #include -#include +#include #include diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/HelpDialog/HelpDialog.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/HelpDialog/HelpDialog.cpp index 3ad41e4803..3e8cf19539 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/HelpDialog/HelpDialog.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/HelpDialog/HelpDialog.cpp @@ -6,7 +6,7 @@ * */ -#include +#include namespace MaterialEditor { @@ -20,4 +20,4 @@ namespace MaterialEditor HelpDialog::~HelpDialog() = default; } // namespace MaterialEditor -#include +#include diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/HelpDialog/HelpDialog.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/HelpDialog/HelpDialog.h index 5cca57ad2d..ec5b756df4 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/HelpDialog/HelpDialog.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/HelpDialog/HelpDialog.h @@ -13,7 +13,7 @@ AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT #include -#include +#include AZ_POP_DISABLE_WARNING #endif diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.cpp index 44adda432d..e1f8e713d4 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindow.cpp @@ -6,19 +6,19 @@ * */ -#include #include #include #include -#include #include #include #include #include +#include #include #include #include #include +#include #include #include #include diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindowComponent.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindowComponent.cpp deleted file mode 100644 index 5359ba8e53..0000000000 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindowComponent.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace MaterialEditor -{ - void MaterialEditorWindowComponent::Reflect(AZ::ReflectContext* context) - { - MaterialEditorWindowSettings::Reflect(context); - - if (AZ::SerializeContext* serialize = azrtti_cast(context)) - { - serialize->Class() - ->Version(0); - } - } - - void MaterialEditorWindowComponent::GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required) - { - required.push_back(AZ_CRC_CE("AssetBrowserService")); - required.push_back(AZ_CRC_CE("PropertyManagerService")); - required.push_back(AZ_CRC_CE("SourceControlService")); - required.push_back(AZ_CRC_CE("AtomToolsMainWindowSystemService")); - } - - void MaterialEditorWindowComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided) - { - provided.push_back(AZ_CRC_CE("MaterialEditorWindowService")); - } - - void MaterialEditorWindowComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible) - { - incompatible.push_back(AZ_CRC_CE("MaterialEditorWindowService")); - } - - void MaterialEditorWindowComponent::Init() - { - } - - void MaterialEditorWindowComponent::Activate() - { - AzToolsFramework::EditorWindowRequestBus::Handler::BusConnect(); - AtomToolsFramework::AtomToolsMainWindowFactoryRequestBus::Handler::BusConnect(); - AzToolsFramework::SourceControlConnectionRequestBus::Broadcast(&AzToolsFramework::SourceControlConnectionRequests::EnableSourceControl, true); - } - - void MaterialEditorWindowComponent::Deactivate() - { - AtomToolsFramework::AtomToolsMainWindowFactoryRequestBus::Handler::BusDisconnect(); - AzToolsFramework::EditorWindowRequestBus::Handler::BusDisconnect(); - - m_window.reset(); - } - - void MaterialEditorWindowComponent::CreateMainWindow() - { - m_materialEditorBrowserInteractions.reset(aznew MaterialEditorBrowserInteractions); - - m_window.reset(aznew MaterialEditorWindow); - } - - void MaterialEditorWindowComponent::DestroyMainWindow() - { - m_window.reset(); - } - - QWidget* MaterialEditorWindowComponent::GetAppMainWindow() - { - return m_window.get(); - } - -} diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindowComponent.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindowComponent.h deleted file mode 100644 index 87f6160089..0000000000 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindowComponent.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#pragma once - -#include -#include - -#include -#include -#include - -namespace MaterialEditor -{ - //! MaterialEditorWindowComponent is the entry point for the Material Editor gem user interface, and is mainly - //! used for initialization and registration of other classes, including MaterialEditorWindow. - class MaterialEditorWindowComponent - : public AZ::Component - , private AzToolsFramework::EditorWindowRequestBus::Handler - , private AtomToolsFramework::AtomToolsMainWindowFactoryRequestBus::Handler - { - public: - AZ_COMPONENT(MaterialEditorWindowComponent, "{03976F19-3C74-49FE-A15F-7D3CADBA616C}"); - - static void Reflect(AZ::ReflectContext* context); - - static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required); - static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided); - static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible); - - private: - //////////////////////////////////////////////////////////////////////// - // AtomToolsMainWindowFactoryRequestBus::Handler overrides... - void CreateMainWindow() override; - void DestroyMainWindow() override; - //////////////////////////////////////////////////////////////////////// - - ////////////////////////////////////////////////////////////////////////// - // AzToolsFramework::EditorWindowRequests::Bus::Handler - QWidget* GetAppMainWindow() override; - ////////////////////////////////////////////////////////////////////////// - - //////////////////////////////////////////////////////////////////////// - // AZ::Component interface implementation - void Init() override; - void Activate() override; - void Deactivate() override; - //////////////////////////////////////////////////////////////////////// - - AZStd::unique_ptr m_window; - AZStd::unique_ptr m_materialEditorBrowserInteractions; - }; -} diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindowModule.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindowModule.cpp deleted file mode 100644 index 1562d11647..0000000000 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindowModule.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#include -#include - -void InitMaterialEditorResources() -{ - //Must register qt resources from other modules - Q_INIT_RESOURCE(MaterialEditor); - Q_INIT_RESOURCE(InspectorWidget); - Q_INIT_RESOURCE(AtomToolsAssetBrowser); -} - -namespace MaterialEditor -{ - MaterialEditorWindowModule::MaterialEditorWindowModule() - { - InitMaterialEditorResources(); - - // Push results of [MyComponent]::CreateDescriptor() into m_descriptors here. - m_descriptors.insert(m_descriptors.end(), { - MaterialEditorWindowComponent::CreateDescriptor(), - }); - } - - AZ::ComponentTypeList MaterialEditorWindowModule::GetRequiredSystemComponents() const - { - return AZ::ComponentTypeList{ - azrtti_typeid(), - }; - } -} diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindowSettings.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindowSettings.cpp index 71c71e8b75..5ab17d7b26 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindowSettings.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindowSettings.cpp @@ -6,9 +6,9 @@ * */ -#include #include #include +#include namespace MaterialEditor { diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Window/MaterialEditorWindowSettings.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindowSettings.h similarity index 100% rename from Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Window/MaterialEditorWindowSettings.h rename to Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialEditorWindowSettings.h diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.cpp index e99f456653..7790b9bef5 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.cpp @@ -6,7 +6,6 @@ * */ -#include #include #include #include @@ -15,6 +14,7 @@ #include #include #include +#include #include namespace MaterialEditor diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.h index a3b98e13d2..a4cd2b7616 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.h @@ -9,12 +9,12 @@ #pragma once #if !defined(Q_MOC_RUN) -#include #include #include #include #include #include +#include #endif namespace MaterialEditor diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PerformanceMonitor/PerformanceMonitorWidget.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PerformanceMonitor/PerformanceMonitorWidget.cpp index 940790eb0a..8492ce5f1f 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PerformanceMonitor/PerformanceMonitorWidget.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PerformanceMonitor/PerformanceMonitorWidget.cpp @@ -6,10 +6,9 @@ * */ -#include - -#include -#include +#include +#include +#include #include @@ -55,4 +54,4 @@ namespace MaterialEditor } } // namespace MaterialEditor -#include +#include diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/LightingPresetBrowserDialog.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/LightingPresetBrowserDialog.cpp index f8ad038a85..cc7a851429 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/LightingPresetBrowserDialog.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/LightingPresetBrowserDialog.cpp @@ -8,9 +8,9 @@ #include #include -#include #include #include +#include #include namespace MaterialEditor diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/LightingPresetBrowserDialog.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/LightingPresetBrowserDialog.h index f9d455d915..68b52b3a98 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/LightingPresetBrowserDialog.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/LightingPresetBrowserDialog.h @@ -10,8 +10,8 @@ #if !defined(Q_MOC_RUN) #include -#include #include +#include #endif #include diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/ModelPresetBrowserDialog.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/ModelPresetBrowserDialog.cpp index f5a1677462..e16b61d214 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/ModelPresetBrowserDialog.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/ModelPresetBrowserDialog.cpp @@ -7,9 +7,9 @@ */ #include -#include #include #include +#include #include namespace MaterialEditor diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/ModelPresetBrowserDialog.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/ModelPresetBrowserDialog.h index 67da7db262..a169d3053b 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/ModelPresetBrowserDialog.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/ModelPresetBrowserDialog.h @@ -10,8 +10,8 @@ #if !defined(Q_MOC_RUN) #include -#include #include +#include #endif #include diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/SettingsDialog/SettingsWidget.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/SettingsDialog/SettingsWidget.h index fea98eeda1..e7c655ee21 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/SettingsDialog/SettingsWidget.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/SettingsDialog/SettingsWidget.h @@ -9,10 +9,10 @@ #pragma once #if !defined(Q_MOC_RUN) -#include #include #include #include +#include #endif namespace MaterialEditor diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ToolBar/LightingPresetComboBox.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ToolBar/LightingPresetComboBox.cpp index e0bb59cb82..20229cad37 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ToolBar/LightingPresetComboBox.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ToolBar/LightingPresetComboBox.cpp @@ -6,9 +6,9 @@ * */ -#include -#include #include +#include +#include namespace MaterialEditor { @@ -102,4 +102,4 @@ namespace MaterialEditor } // namespace MaterialEditor -#include +#include diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ToolBar/LightingPresetComboBox.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ToolBar/LightingPresetComboBox.h index 4c452dfb5b..f39b856085 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ToolBar/LightingPresetComboBox.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ToolBar/LightingPresetComboBox.h @@ -10,7 +10,7 @@ #if !defined(Q_MOC_RUN) #include -#include +#include #endif namespace MaterialEditor diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ToolBar/MaterialEditorToolBar.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ToolBar/MaterialEditorToolBar.cpp index 10442e0c27..25877f910d 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ToolBar/MaterialEditorToolBar.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ToolBar/MaterialEditorToolBar.cpp @@ -6,21 +6,21 @@ * */ -#include -#include -#include #include +#include +#include +#include #include #include #include AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT #include +#include #include #include #include #include -#include AZ_POP_DISABLE_WARNING namespace MaterialEditor diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ToolBar/MaterialEditorToolBar.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ToolBar/MaterialEditorToolBar.h index c25b90eb80..056fb3ba80 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ToolBar/MaterialEditorToolBar.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ToolBar/MaterialEditorToolBar.h @@ -11,7 +11,7 @@ #if !defined(Q_MOC_RUN) #include #include -#include +#include #endif namespace MaterialEditor diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ToolBar/ModelPresetComboBox.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ToolBar/ModelPresetComboBox.cpp index 1e8bfec485..1c9bd36be4 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ToolBar/ModelPresetComboBox.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ToolBar/ModelPresetComboBox.cpp @@ -6,9 +6,9 @@ * */ -#include -#include #include +#include +#include namespace MaterialEditor { @@ -102,4 +102,4 @@ namespace MaterialEditor } // namespace MaterialEditor -#include +#include diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ToolBar/ModelPresetComboBox.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ToolBar/ModelPresetComboBox.h index e315854d75..bb71cec25b 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ToolBar/ModelPresetComboBox.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ToolBar/ModelPresetComboBox.h @@ -10,7 +10,7 @@ #if !defined(Q_MOC_RUN) #include -#include +#include #endif namespace MaterialEditor diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ViewportSettingsInspector/ViewportSettingsInspector.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ViewportSettingsInspector/ViewportSettingsInspector.cpp index 613762c10a..512059f1f6 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ViewportSettingsInspector/ViewportSettingsInspector.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ViewportSettingsInspector/ViewportSettingsInspector.cpp @@ -7,10 +7,10 @@ */ #include -#include #include #include #include +#include #include #include #include @@ -376,4 +376,4 @@ namespace MaterialEditor } // namespace MaterialEditor -#include +#include diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ViewportSettingsInspector/ViewportSettingsInspector.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ViewportSettingsInspector/ViewportSettingsInspector.h index 6299ddb1f2..464a55aa7f 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ViewportSettingsInspector/ViewportSettingsInspector.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ViewportSettingsInspector/ViewportSettingsInspector.h @@ -12,11 +12,11 @@ #include #include #include -#include -#include -#include #include #include +#include +#include +#include #endif namespace MaterialEditor diff --git a/Gems/Atom/Tools/MaterialEditor/Code/materialeditor_files.cmake b/Gems/Atom/Tools/MaterialEditor/Code/materialeditor_files.cmake index d4c4364ba7..9d1e2b22f8 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/materialeditor_files.cmake +++ b/Gems/Atom/Tools/MaterialEditor/Code/materialeditor_files.cmake @@ -10,4 +10,86 @@ set(FILES Source/main.cpp Source/MaterialEditorApplication.cpp Source/MaterialEditorApplication.h + + Source/Document/MaterialDocumentRequestBus.h + Source/Document/MaterialDocumentSettings.h + Source/Document/MaterialDocument.cpp + Source/Document/MaterialDocument.h + Source/Document/MaterialDocumentSettings.cpp + + Source/Viewport/MaterialViewportModule.h + Source/Viewport/MaterialViewportModule.cpp + Source/Viewport/InputController/MaterialEditorViewportInputControllerBus.h + Source/Viewport/MaterialViewportSettings.h + Source/Viewport/MaterialViewportRequestBus.h + Source/Viewport/MaterialViewportNotificationBus.h + Source/Viewport/PerformanceMetrics.h + Source/Viewport/PerformanceMonitorRequestBus.h + Source/Viewport/InputController/MaterialEditorViewportInputController.cpp + Source/Viewport/InputController/MaterialEditorViewportInputController.h + Source/Viewport/InputController/Behavior.cpp + Source/Viewport/InputController/Behavior.h + Source/Viewport/InputController/DollyCameraBehavior.cpp + Source/Viewport/InputController/DollyCameraBehavior.h + Source/Viewport/InputController/IdleBehavior.cpp + Source/Viewport/InputController/IdleBehavior.h + Source/Viewport/InputController/MoveCameraBehavior.cpp + Source/Viewport/InputController/MoveCameraBehavior.h + Source/Viewport/InputController/PanCameraBehavior.cpp + Source/Viewport/InputController/PanCameraBehavior.h + Source/Viewport/InputController/OrbitCameraBehavior.cpp + Source/Viewport/InputController/OrbitCameraBehavior.h + Source/Viewport/InputController/RotateEnvironmentBehavior.cpp + Source/Viewport/InputController/RotateEnvironmentBehavior.h + Source/Viewport/InputController/RotateModelBehavior.cpp + Source/Viewport/InputController/RotateModelBehavior.h + Source/Viewport/MaterialViewportSettings.cpp + Source/Viewport/MaterialViewportComponent.cpp + Source/Viewport/MaterialViewportComponent.h + Source/Viewport/MaterialViewportWidget.cpp + Source/Viewport/MaterialViewportWidget.h + Source/Viewport/MaterialViewportWidget.ui + Source/Viewport/MaterialViewportRenderer.cpp + Source/Viewport/MaterialViewportRenderer.h + Source/Viewport/PerformanceMonitorComponent.cpp + Source/Viewport/PerformanceMonitorComponent.h + + Source/Window/MaterialEditorWindowSettings.h + Source/Window/MaterialEditorBrowserInteractions.h + Source/Window/MaterialEditorBrowserInteractions.cpp + Source/Window/MaterialEditorWindow.h + Source/Window/MaterialEditorWindow.cpp + Source/Window/MaterialEditorWindowSettings.cpp + Source/Window/MaterialEditor.qrc + Source/Window/MaterialEditor.qss + Source/Window/SettingsDialog/SettingsDialog.cpp + Source/Window/SettingsDialog/SettingsDialog.h + Source/Window/SettingsDialog/SettingsWidget.cpp + Source/Window/SettingsDialog/SettingsWidget.h + Source/Window/CreateMaterialDialog/CreateMaterialDialog.cpp + Source/Window/CreateMaterialDialog/CreateMaterialDialog.h + Source/Window/CreateMaterialDialog/CreateMaterialDialog.ui + Source/Window/PresetBrowserDialogs/PresetBrowserDialog.cpp + Source/Window/PresetBrowserDialogs/PresetBrowserDialog.h + Source/Window/PresetBrowserDialogs/PresetBrowserDialog.ui + Source/Window/PresetBrowserDialogs/LightingPresetBrowserDialog.cpp + Source/Window/PresetBrowserDialogs/LightingPresetBrowserDialog.h + Source/Window/PresetBrowserDialogs/ModelPresetBrowserDialog.cpp + Source/Window/PresetBrowserDialogs/ModelPresetBrowserDialog.h + Source/Window/PerformanceMonitor/PerformanceMonitorWidget.cpp + Source/Window/PerformanceMonitor/PerformanceMonitorWidget.h + Source/Window/PerformanceMonitor/PerformanceMonitorWidget.ui + Source/Window/ToolBar/MaterialEditorToolBar.h + Source/Window/ToolBar/MaterialEditorToolBar.cpp + Source/Window/ToolBar/ModelPresetComboBox.h + Source/Window/ToolBar/ModelPresetComboBox.cpp + Source/Window/ToolBar/LightingPresetComboBox.h + Source/Window/ToolBar/LightingPresetComboBox.cpp + Source/Window/MaterialInspector/MaterialInspector.h + Source/Window/MaterialInspector/MaterialInspector.cpp + Source/Window/ViewportSettingsInspector/ViewportSettingsInspector.h + Source/Window/ViewportSettingsInspector/ViewportSettingsInspector.cpp + Source/Window/HelpDialog/HelpDialog.h + Source/Window/HelpDialog/HelpDialog.cpp + Source/Window/HelpDialog/HelpDialog.ui ) diff --git a/Gems/Atom/Tools/MaterialEditor/Code/materialeditordocument_files.cmake b/Gems/Atom/Tools/MaterialEditor/Code/materialeditordocument_files.cmake deleted file mode 100644 index d86dd03749..0000000000 --- a/Gems/Atom/Tools/MaterialEditor/Code/materialeditordocument_files.cmake +++ /dev/null @@ -1,19 +0,0 @@ -# -# Copyright (c) Contributors to the Open 3D Engine Project. -# For complete copyright and license terms please see the LICENSE at the root of this distribution. -# -# SPDX-License-Identifier: Apache-2.0 OR MIT -# -# - -set(FILES - Include/Atom/Document/MaterialDocumentModule.h - Include/Atom/Document/MaterialDocumentRequestBus.h - Include/Atom/Document/MaterialDocumentSettings.h - Source/Document/MaterialDocumentModule.cpp - Source/Document/MaterialDocumentSystemComponent.cpp - Source/Document/MaterialDocumentSystemComponent.h - Source/Document/MaterialDocument.cpp - Source/Document/MaterialDocument.h - Source/Document/MaterialDocumentSettings.cpp -) diff --git a/Gems/Atom/Tools/MaterialEditor/Code/materialeditorviewport_files.cmake b/Gems/Atom/Tools/MaterialEditor/Code/materialeditorviewport_files.cmake deleted file mode 100644 index ba34cabd90..0000000000 --- a/Gems/Atom/Tools/MaterialEditor/Code/materialeditorviewport_files.cmake +++ /dev/null @@ -1,46 +0,0 @@ -# -# Copyright (c) Contributors to the Open 3D Engine Project. -# For complete copyright and license terms please see the LICENSE at the root of this distribution. -# -# SPDX-License-Identifier: Apache-2.0 OR MIT -# -# - -set(FILES - Include/Atom/Viewport/InputController/MaterialEditorViewportInputControllerBus.h - Include/Atom/Viewport/MaterialViewportModule.h - Include/Atom/Viewport/MaterialViewportSettings.h - Include/Atom/Viewport/MaterialViewportRequestBus.h - Include/Atom/Viewport/MaterialViewportNotificationBus.h - Include/Atom/Viewport/PerformanceMetrics.h - Include/Atom/Viewport/PerformanceMonitorRequestBus.h - Source/Viewport/InputController/MaterialEditorViewportInputController.cpp - Source/Viewport/InputController/MaterialEditorViewportInputController.h - Source/Viewport/InputController/Behavior.cpp - Source/Viewport/InputController/Behavior.h - Source/Viewport/InputController/DollyCameraBehavior.cpp - Source/Viewport/InputController/DollyCameraBehavior.h - Source/Viewport/InputController/IdleBehavior.cpp - Source/Viewport/InputController/IdleBehavior.h - Source/Viewport/InputController/MoveCameraBehavior.cpp - Source/Viewport/InputController/MoveCameraBehavior.h - Source/Viewport/InputController/PanCameraBehavior.cpp - Source/Viewport/InputController/PanCameraBehavior.h - Source/Viewport/InputController/OrbitCameraBehavior.cpp - Source/Viewport/InputController/OrbitCameraBehavior.h - Source/Viewport/InputController/RotateEnvironmentBehavior.cpp - Source/Viewport/InputController/RotateEnvironmentBehavior.h - Source/Viewport/InputController/RotateModelBehavior.cpp - Source/Viewport/InputController/RotateModelBehavior.h - Source/Viewport/MaterialViewportModule.cpp - Source/Viewport/MaterialViewportSettings.cpp - Source/Viewport/MaterialViewportComponent.cpp - Source/Viewport/MaterialViewportComponent.h - Source/Viewport/MaterialViewportWidget.cpp - Source/Viewport/MaterialViewportWidget.h - Source/Viewport/MaterialViewportWidget.ui - Source/Viewport/MaterialViewportRenderer.cpp - Source/Viewport/MaterialViewportRenderer.h - Source/Viewport/PerformanceMonitorComponent.cpp - Source/Viewport/PerformanceMonitorComponent.h -) diff --git a/Gems/Atom/Tools/MaterialEditor/Code/materialeditorwindow_files.cmake b/Gems/Atom/Tools/MaterialEditor/Code/materialeditorwindow_files.cmake deleted file mode 100644 index 3d21e71294..0000000000 --- a/Gems/Atom/Tools/MaterialEditor/Code/materialeditorwindow_files.cmake +++ /dev/null @@ -1,52 +0,0 @@ -# -# Copyright (c) Contributors to the Open 3D Engine Project. -# For complete copyright and license terms please see the LICENSE at the root of this distribution. -# -# SPDX-License-Identifier: Apache-2.0 OR MIT -# -# - -set(FILES - Include/Atom/Window/MaterialEditorWindowModule.h - Include/Atom/Window/MaterialEditorWindowSettings.h - Source/Window/MaterialEditorBrowserInteractions.h - Source/Window/MaterialEditorBrowserInteractions.cpp - Source/Window/MaterialEditorWindow.h - Source/Window/MaterialEditorWindow.cpp - Source/Window/MaterialEditorWindowModule.cpp - Source/Window/MaterialEditorWindowSettings.cpp - Source/Window/MaterialEditor.qrc - Source/Window/MaterialEditor.qss - Source/Window/MaterialEditorWindowComponent.h - Source/Window/MaterialEditorWindowComponent.cpp - Source/Window/SettingsDialog/SettingsDialog.cpp - Source/Window/SettingsDialog/SettingsDialog.h - Source/Window/SettingsDialog/SettingsWidget.cpp - Source/Window/SettingsDialog/SettingsWidget.h - Source/Window/CreateMaterialDialog/CreateMaterialDialog.cpp - Source/Window/CreateMaterialDialog/CreateMaterialDialog.h - Source/Window/CreateMaterialDialog/CreateMaterialDialog.ui - Source/Window/PresetBrowserDialogs/PresetBrowserDialog.cpp - Source/Window/PresetBrowserDialogs/PresetBrowserDialog.h - Source/Window/PresetBrowserDialogs/PresetBrowserDialog.ui - Source/Window/PresetBrowserDialogs/LightingPresetBrowserDialog.cpp - Source/Window/PresetBrowserDialogs/LightingPresetBrowserDialog.h - Source/Window/PresetBrowserDialogs/ModelPresetBrowserDialog.cpp - Source/Window/PresetBrowserDialogs/ModelPresetBrowserDialog.h - Source/Window/PerformanceMonitor/PerformanceMonitorWidget.cpp - Source/Window/PerformanceMonitor/PerformanceMonitorWidget.h - Source/Window/PerformanceMonitor/PerformanceMonitorWidget.ui - Source/Window/ToolBar/MaterialEditorToolBar.h - Source/Window/ToolBar/MaterialEditorToolBar.cpp - Source/Window/ToolBar/ModelPresetComboBox.h - Source/Window/ToolBar/ModelPresetComboBox.cpp - Source/Window/ToolBar/LightingPresetComboBox.h - Source/Window/ToolBar/LightingPresetComboBox.cpp - Source/Window/MaterialInspector/MaterialInspector.h - Source/Window/MaterialInspector/MaterialInspector.cpp - Source/Window/ViewportSettingsInspector/ViewportSettingsInspector.h - Source/Window/ViewportSettingsInspector/ViewportSettingsInspector.cpp - Source/Window/HelpDialog/HelpDialog.h - Source/Window/HelpDialog/HelpDialog.cpp - Source/Window/HelpDialog/HelpDialog.ui -) diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindowComponent.h b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindowComponent.h index 9b43babd9a..aab0f7ce37 100644 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindowComponent.h +++ b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ShaderManagementConsoleWindowComponent.h @@ -8,15 +8,15 @@ #pragma once +#include +#include +#include + #include #include -#include - -#include -#include -#include -#include +#include +#include namespace ShaderManagementConsole { diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ToolBar/ShaderManagementConsoleToolBar.cpp b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ToolBar/ShaderManagementConsoleToolBar.cpp index d65ac7048d..5699713240 100644 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ToolBar/ShaderManagementConsoleToolBar.cpp +++ b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Window/ToolBar/ShaderManagementConsoleToolBar.cpp @@ -7,7 +7,7 @@ */ #include -#include +#include AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT #include @@ -29,4 +29,4 @@ namespace ShaderManagementConsole } } // namespace ShaderManagementConsole -#include +#include From e1b245859140d8625e163da5181e39390dc6520f Mon Sep 17 00:00:00 2001 From: Ignacio Martinez <82394219+AMZN-Igarri@users.noreply.github.com> Date: Thu, 20 Jan 2022 14:09:00 +0100 Subject: [PATCH 567/948] Asset Browser Collapse All Fix (#6996) * Added Icon Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> * Fixed indent in ui file Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com> --- .../Icons/AssetBrowser/Collapse_All.svg | 14 +++++++++++ .../AzAssetBrowser/AzAssetBrowserWindow.cpp | 22 +++++++++++++++- .../AzAssetBrowser/AzAssetBrowserWindow.ui | 25 ++++++++++++------- 3 files changed, 51 insertions(+), 10 deletions(-) create mode 100644 Assets/Editor/Icons/AssetBrowser/Collapse_All.svg diff --git a/Assets/Editor/Icons/AssetBrowser/Collapse_All.svg b/Assets/Editor/Icons/AssetBrowser/Collapse_All.svg new file mode 100644 index 0000000000..7c7a7b85bd --- /dev/null +++ b/Assets/Editor/Icons/AssetBrowser/Collapse_All.svg @@ -0,0 +1,14 @@ + + + + + + + + diff --git a/Code/Editor/AzAssetBrowser/AzAssetBrowserWindow.cpp b/Code/Editor/AzAssetBrowser/AzAssetBrowserWindow.cpp index a7faea36f6..36e08982a7 100644 --- a/Code/Editor/AzAssetBrowser/AzAssetBrowserWindow.cpp +++ b/Code/Editor/AzAssetBrowser/AzAssetBrowserWindow.cpp @@ -32,6 +32,15 @@ AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING AZ_CVAR_EXTERNED(bool, ed_useNewAssetBrowserTableView); +namespace AzToolsFramework +{ + namespace AssetBrowser + { + static constexpr const char* CollapseAllIcon = "Assets/Editor/Icons/AssetBrowser/Collapse_All.svg"; + static constexpr const char* MenuIcon = ":/Menu/menu.svg"; + } // namespace AssetBrowser +} // namespace AzToolsFramework + class ListenerForShowAssetEditorEvent : public QObject , private AzToolsFramework::EditorEvents::Bus::Handler @@ -87,10 +96,21 @@ AzAssetBrowserWindow::AzAssetBrowserWindow(QWidget* parent) m_assetBrowserModel->SetFilterModel(m_filterModel.data()); + m_ui->m_collapseAllButton->setAutoRaise(true); // hover highlight + m_ui->m_collapseAllButton->setIcon(QIcon(AzAssetBrowser::CollapseAllIcon)); + + connect( + m_ui->m_collapseAllButton, &QToolButton::clicked, this, + [this]() + { + m_ui->m_assetBrowserTreeViewWidget->collapseAll(); + }); + if (ed_useNewAssetBrowserTableView) { m_ui->m_toggleDisplayViewBtn->setVisible(true); - m_ui->m_toggleDisplayViewBtn->setIcon(QIcon(":/Menu/menu.svg")); + m_ui->m_toggleDisplayViewBtn->setAutoRaise(true); + m_ui->m_toggleDisplayViewBtn->setIcon(QIcon(AzAssetBrowser::MenuIcon)); m_tableModel->setFilterRole(Qt::DisplayRole); m_tableModel->setSourceModel(m_filterModel.data()); diff --git a/Code/Editor/AzAssetBrowser/AzAssetBrowserWindow.ui b/Code/Editor/AzAssetBrowser/AzAssetBrowserWindow.ui index a345438aed..2cc7c57ccd 100644 --- a/Code/Editor/AzAssetBrowser/AzAssetBrowserWindow.ui +++ b/Code/Editor/AzAssetBrowser/AzAssetBrowserWindow.ui @@ -72,6 +72,22 @@
+ + + + Qt::ClickFocus + + + + + + 3 + + + + + + @@ -143,15 +159,6 @@ true - - false - - - true - - - false - From b3d996ea230ce78293eef87959cebd349d84e6d2 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Thu, 20 Jan 2022 08:32:02 -0800 Subject: [PATCH 568/948] Adding automated test to ensure scripts attached to net-level-entities are started on the server Signed-off-by: Gene Walters --- ...TestLevelEntityComponent.AutoComponent.xml | 15 + ...tworkTestPlayerComponent.AutoComponent.xml | 2 - .../Gem/Code/automatedtesting_files.cmake | 1 + .../Multiplayer/TestSuite_Sandbox.py | 4 + .../Multiplayer_SimpleNetworkLevelEntity.py | 79 +++ .../SimpleNetworkLevelEntity/Player.prefab | 151 +++++ .../SimpleNetworkLevelEntity.prefab | 580 ++++++++++++++++++ .../SimpleNetworkLevelEntity.scriptcanvas | 228 +++++++ .../SimpleNetworkLevelEntity/tags.txt | 12 + 9 files changed, 1070 insertions(+), 2 deletions(-) create mode 100644 AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestLevelEntityComponent.AutoComponent.xml create mode 100644 AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_SimpleNetworkLevelEntity.py create mode 100644 AutomatedTesting/Levels/Multiplayer/SimpleNetworkLevelEntity/Player.prefab create mode 100644 AutomatedTesting/Levels/Multiplayer/SimpleNetworkLevelEntity/SimpleNetworkLevelEntity.prefab create mode 100644 AutomatedTesting/Levels/Multiplayer/SimpleNetworkLevelEntity/SimpleNetworkLevelEntity.scriptcanvas create mode 100644 AutomatedTesting/Levels/Multiplayer/SimpleNetworkLevelEntity/tags.txt diff --git a/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestLevelEntityComponent.AutoComponent.xml b/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestLevelEntityComponent.AutoComponent.xml new file mode 100644 index 0000000000..2fd196a2f6 --- /dev/null +++ b/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestLevelEntityComponent.AutoComponent.xml @@ -0,0 +1,15 @@ + + + + + + + + + diff --git a/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml b/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml index 251d2b25af..b4dd35d741 100644 --- a/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml +++ b/AutomatedTesting/Gem/Code/Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml @@ -29,8 +29,6 @@ - - diff --git a/AutomatedTesting/Gem/Code/automatedtesting_files.cmake b/AutomatedTesting/Gem/Code/automatedtesting_files.cmake index eb619104a4..1f6dbbd772 100644 --- a/AutomatedTesting/Gem/Code/automatedtesting_files.cmake +++ b/AutomatedTesting/Gem/Code/automatedtesting_files.cmake @@ -12,4 +12,5 @@ set(FILES Source/AutomatedTestingSystemComponent.cpp Source/AutomatedTestingSystemComponent.h Source/AutoGen/NetworkTestPlayerComponent.AutoComponent.xml + Source/AutoGen/NetworkTestLevelEntityComponent.AutoComponent.xml ) diff --git a/AutomatedTesting/Gem/PythonTests/Multiplayer/TestSuite_Sandbox.py b/AutomatedTesting/Gem/PythonTests/Multiplayer/TestSuite_Sandbox.py index 8c5f33993d..56c2608762 100644 --- a/AutomatedTesting/Gem/PythonTests/Multiplayer/TestSuite_Sandbox.py +++ b/AutomatedTesting/Gem/PythonTests/Multiplayer/TestSuite_Sandbox.py @@ -35,3 +35,7 @@ class TestAutomation(TestAutomationBase): def test_Multiplayer_AutoComponent_RPC(self, request, workspace, editor, launcher_platform): from .tests import Multiplayer_AutoComponent_RPC as test_module self._run_prefab_test(request, workspace, editor, test_module) + + def test_Multiplayer_SimpleNetworkLevelEntity(self, request, workspace, editor, launcher_platform): + from .tests import Multiplayer_SimpleNetworkLevelEntity as test_module + self._run_prefab_test(request, workspace, editor, test_module) diff --git a/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_SimpleNetworkLevelEntity.py b/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_SimpleNetworkLevelEntity.py new file mode 100644 index 0000000000..da332f9085 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_SimpleNetworkLevelEntity.py @@ -0,0 +1,79 @@ +""" +Copyright (c) Contributors to the Open 3D Engine Project. +For complete copyright and license terms please see the LICENSE at the root of this distribution. + +SPDX-License-Identifier: Apache-2.0 OR MIT +""" + + +# Test Case Title : Check that level entities with network bindings are properly replicated. +# Note: This test should be ran on a fresh editor run; some bugs with spawnables occur only on the first editor play-mode. + + +# fmt: off +class TestSuccessFailTuples(): + enter_game_mode = ("Entered game mode", "Failed to enter game mode") + exit_game_mode = ("Exited game mode", "Couldn't exit game mode") + find_network_player = ("Found network player", "Couldn't find network player") +# fmt: on + + +def Multiplayer_SimpleNetworkLevelEntity(): + r""" + Summary: + Runs a test to make sure that network entities in a level function and are replicated to clients as expecte + + Level Description: + - Static + 1. NetLevelEntity. This is a networked entity which has a script attached to ensure it's replicated. + + + Expected Outcome: + We should see logs stating that the net-sync'd level entity exists on both server and client. + + :return: + """ + import azlmbr.legacy.general as general + from editor_python_test_tools.utils import Report + from editor_python_test_tools.utils import Tracer + + from editor_python_test_tools.utils import TestHelper as helper + from ly_remote_console.remote_console_commands import RemoteConsole as RemoteConsole + + level_name = "SimpleNetworkLevelEntity" + player_prefab_name = "Player" + player_prefab_path = f"levels/multiplayer/{level_name}/{player_prefab_name}.network.spawnable" + + helper.init_idle() + + # 1) Open Level + helper.open_level("Multiplayer", level_name) + + with Tracer() as section_tracer: + # 2) Enter game mode + helper.multiplayer_enter_game_mode(TestSuccessFailTuples.enter_game_mode, player_prefab_path.lower()) + + # 3) Make sure the network player was spawned + player_id = general.find_game_entity(player_prefab_name) + Report.critical_result(TestSuccessFailTuples.find_network_player, player_id.IsValid()) + + # 4) Check the editor logs for network spawnable errors + ATTEMPTING_INVALID_NETSPAWN_WAIT_TIME_SECONDS = 1.0 # The editor will try to net-spawn its networked level entity before it's even a client. Make sure this doesn't happen. + helper.fail_if_log_line_found('NetworkEntityManager', "RequestNetSpawnableInstantiation: Requested spawnable Root.network.spawnable doesn't exist in the NetworkSpawnableLibrary. Please make sure it is a network spawnable", section_tracer.errors, ATTEMPTING_INVALID_NETSPAWN_WAIT_TIME_SECONDS) + + # 5) Ensure the script graph attached to the level entity is running on both client and server + SCRIPTGRAPH_ENABLED_WAIT_TIME_SECONDS = 0.25 + # Check Server + helper.succeed_if_log_line_found('EditorServer', "Script: SimpleNetworkLevelEntity: On Graph Start", section_tracer.prints, SCRIPTGRAPH_ENABLED_WAIT_TIME_SECONDS) + # Check Editor/Client (Uncomment once script asset preload is working properly LYN-9136) + # helper.succeed_if_log_line_found('Script', "SimpleNetworkLevelEntity: On Graph Start", section_tracer.prints, SCRIPTGRAPH_ENABLED_WAIT_TIME_SECONDS) # Client + + + # Exit game mode + helper.exit_game_mode(TestSuccessFailTuples.exit_game_mode) + + + +if __name__ == "__main__": + from editor_python_test_tools.utils import Report + Report.start_test(Multiplayer_SimpleNetworkLevelEntity) diff --git a/AutomatedTesting/Levels/Multiplayer/SimpleNetworkLevelEntity/Player.prefab b/AutomatedTesting/Levels/Multiplayer/SimpleNetworkLevelEntity/Player.prefab new file mode 100644 index 0000000000..975319a516 --- /dev/null +++ b/AutomatedTesting/Levels/Multiplayer/SimpleNetworkLevelEntity/Player.prefab @@ -0,0 +1,151 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "Player", + "Components": { + "Component_[10626669441604518614]": { + "$type": "EditorPrefabComponent", + "Id": 10626669441604518614 + }, + "Component_[15284109105474306026]": { + "$type": "EditorVisibilityComponent", + "Id": 15284109105474306026 + }, + "Component_[1884250773831675865]": { + "$type": "SelectionComponent", + "Id": 1884250773831675865 + }, + "Component_[3027124663594865592]": { + "$type": "EditorInspectorComponent", + "Id": 3027124663594865592 + }, + "Component_[3314300526416851038]": { + "$type": "EditorEntitySortComponent", + "Id": 3314300526416851038, + "Child Entity Order": [ + "Entity_[1340484004600]" + ] + }, + "Component_[5583377204116393478]": { + "$type": "EditorEntityIconComponent", + "Id": 5583377204116393478 + }, + "Component_[5897955848881060165]": { + "$type": "EditorLockComponent", + "Id": 5897955848881060165 + }, + "Component_[6405389103180201977]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6405389103180201977, + "Parent Entity": "" + }, + "Component_[7695912346724202125]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 7695912346724202125 + }, + "Component_[775363990560391238]": { + "$type": "EditorOnlyEntityComponent", + "Id": 775363990560391238 + }, + "Component_[904355854135646057]": { + "$type": "EditorPendingCompositionComponent", + "Id": 904355854135646057 + } + } + }, + "Entities": { + "Entity_[1340484004600]": { + "Id": "Entity_[1340484004600]", + "Name": "Player", + "Components": { + "Component_[12294726333564087591]": { + "$type": "SelectionComponent", + "Id": 12294726333564087591 + }, + "Component_[13587084088242540786]": { + "$type": "EditorInspectorComponent", + "Id": 13587084088242540786, + "ComponentOrderEntryArray": [ + { + "ComponentId": 6819443882832501114 + }, + { + "ComponentId": 4337571454344109612, + "SortIndex": 1 + }, + { + "ComponentId": 16457408099527309065, + "SortIndex": 2 + }, + { + "ComponentId": 5577505593558922067, + "SortIndex": 3 + } + ] + }, + "Component_[14335168881008289852]": { + "$type": "EditorEntitySortComponent", + "Id": 14335168881008289852 + }, + "Component_[16308902899170829847]": { + "$type": "EditorVisibilityComponent", + "Id": 16308902899170829847 + }, + "Component_[16457408099527309065]": { + "$type": "GenericComponentWrapper", + "Id": 16457408099527309065, + "m_template": { + "$type": "Multiplayer::NetworkTransformComponent" + } + }, + "Component_[16541569566865026527]": { + "$type": "EditorOnlyEntityComponent", + "Id": 16541569566865026527 + }, + "Component_[2002761223483048905]": { + "$type": "EditorPendingCompositionComponent", + "Id": 2002761223483048905 + }, + "Component_[4337571454344109612]": { + "$type": "GenericComponentWrapper", + "Id": 4337571454344109612, + "m_template": { + "$type": "NetBindComponent" + } + }, + "Component_[477591477979440744]": { + "$type": "EditorLockComponent", + "Id": 477591477979440744 + }, + "Component_[5577505593558922067]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 5577505593558922067, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{6DE0E9A8-A1C7-5D0F-9407-4E627C1F223C}", + "subId": 284780167 + }, + "assetHint": "models/sphere.azmodel" + } + } + } + }, + "Component_[5828214869455694702]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5828214869455694702 + }, + "Component_[6819443882832501114]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6819443882832501114, + "Parent Entity": "ContainerEntity" + }, + "Component_[8838623765985560328]": { + "$type": "EditorEntityIconComponent", + "Id": 8838623765985560328 + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/Multiplayer/SimpleNetworkLevelEntity/SimpleNetworkLevelEntity.prefab b/AutomatedTesting/Levels/Multiplayer/SimpleNetworkLevelEntity/SimpleNetworkLevelEntity.prefab new file mode 100644 index 0000000000..abe458246a --- /dev/null +++ b/AutomatedTesting/Levels/Multiplayer/SimpleNetworkLevelEntity/SimpleNetworkLevelEntity.prefab @@ -0,0 +1,580 @@ +{ + "ContainerEntity": { + "Id": "Entity_[1146574390643]", + "Name": "Level", + "Components": { + "Component_[10641544592923449938]": { + "$type": "EditorInspectorComponent", + "Id": 10641544592923449938 + }, + "Component_[12039882709170782873]": { + "$type": "EditorOnlyEntityComponent", + "Id": 12039882709170782873 + }, + "Component_[12265484671603697631]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12265484671603697631 + }, + "Component_[14126657869720434043]": { + "$type": "EditorEntitySortComponent", + "Id": 14126657869720434043, + "Child Entity Order": [ + "Entity_[1176639161715]", + "Entity_[806656324666]" + ] + }, + "Component_[15230859088967841193]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 15230859088967841193, + "Parent Entity": "" + }, + "Component_[16239496886950819870]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 16239496886950819870 + }, + "Component_[5688118765544765547]": { + "$type": "EditorEntityIconComponent", + "Id": 5688118765544765547 + }, + "Component_[6545738857812235305]": { + "$type": "SelectionComponent", + "Id": 6545738857812235305 + }, + "Component_[7247035804068349658]": { + "$type": "EditorPrefabComponent", + "Id": 7247035804068349658 + }, + "Component_[9307224322037797205]": { + "$type": "EditorLockComponent", + "Id": 9307224322037797205 + }, + "Component_[9562516168917670048]": { + "$type": "EditorVisibilityComponent", + "Id": 9562516168917670048 + } + } + }, + "Entities": { + "Entity_[1155164325235]": { + "Id": "Entity_[1155164325235]", + "Name": "Sun", + "Components": { + "Component_[10440557478882592717]": { + "$type": "SelectionComponent", + "Id": 10440557478882592717 + }, + "Component_[13620450453324765907]": { + "$type": "EditorLockComponent", + "Id": 13620450453324765907 + }, + "Component_[2134313378593666258]": { + "$type": "EditorInspectorComponent", + "Id": 2134313378593666258 + }, + "Component_[234010807770404186]": { + "$type": "EditorVisibilityComponent", + "Id": 234010807770404186 + }, + "Component_[2970359110423865725]": { + "$type": "EditorEntityIconComponent", + "Id": 2970359110423865725 + }, + "Component_[3722854130373041803]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3722854130373041803 + }, + "Component_[5992533738676323195]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5992533738676323195 + }, + "Component_[7378860763541895402]": { + "$type": "AZ::Render::EditorDirectionalLightComponent", + "Id": 7378860763541895402, + "Controller": { + "Configuration": { + "Intensity": 1.0, + "CameraEntityId": "", + "ShadowFilterMethod": 1 + } + } + }, + "Component_[7892834440890947578]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 7892834440890947578, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + 0.0, + 0.0, + 13.487043380737305 + ], + "Rotate": [ + -76.13099670410156, + -0.847000002861023, + -15.8100004196167 + ] + } + }, + "Component_[8599729549570828259]": { + "$type": "EditorEntitySortComponent", + "Id": 8599729549570828259 + }, + "Component_[952797371922080273]": { + "$type": "EditorPendingCompositionComponent", + "Id": 952797371922080273 + } + } + }, + "Entity_[1159459292531]": { + "Id": "Entity_[1159459292531]", + "Name": "Ground", + "Components": { + "Component_[11701138785793981042]": { + "$type": "SelectionComponent", + "Id": 11701138785793981042 + }, + "Component_[12260880513256986252]": { + "$type": "EditorEntityIconComponent", + "Id": 12260880513256986252 + }, + "Component_[13711420870643673468]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13711420870643673468 + }, + "Component_[138002849734991713]": { + "$type": "EditorOnlyEntityComponent", + "Id": 138002849734991713 + }, + "Component_[16578565737331764849]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 16578565737331764849, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[16919232076966545697]": { + "$type": "EditorInspectorComponent", + "Id": 16919232076966545697 + }, + "Component_[5182430712893438093]": { + "$type": "EditorMaterialComponent", + "Id": 5182430712893438093 + }, + "Component_[5675108321710651991]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 5675108321710651991, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{0CD745C0-6AA8-569A-A68A-73A3270986C4}", + "subId": 277889906 + }, + "assetHint": "objects/groudplane/groundplane_512x512m.azmodel" + } + } + } + }, + "Component_[5681893399601237518]": { + "$type": "EditorEntitySortComponent", + "Id": 5681893399601237518 + }, + "Component_[592692962543397545]": { + "$type": "EditorPendingCompositionComponent", + "Id": 592692962543397545 + }, + "Component_[7090012899106946164]": { + "$type": "EditorLockComponent", + "Id": 7090012899106946164 + }, + "Component_[9410832619875640998]": { + "$type": "EditorVisibilityComponent", + "Id": 9410832619875640998 + } + } + }, + "Entity_[1163754259827]": { + "Id": "Entity_[1163754259827]", + "Name": "Camera", + "Components": { + "Component_[11895140916889160460]": { + "$type": "EditorEntityIconComponent", + "Id": 11895140916889160460 + }, + "Component_[16880285896855930892]": { + "$type": "{CA11DA46-29FF-4083-B5F6-E02C3A8C3A3D} EditorCameraComponent", + "Id": 16880285896855930892, + "Controller": { + "Configuration": { + "Field of View": 55.0, + "EditorEntityId": 9021008456353177945 + } + } + }, + "Component_[17187464423780271193]": { + "$type": "EditorLockComponent", + "Id": 17187464423780271193 + }, + "Component_[17495696818315413311]": { + "$type": "EditorEntitySortComponent", + "Id": 17495696818315413311 + }, + "Component_[18086214374043522055]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 18086214374043522055, + "Parent Entity": "Entity_[1176639161715]", + "Transform Data": { + "Translate": [ + -2.3000001907348633, + -3.9368600845336914, + 1.0 + ], + "Rotate": [ + -2.050307512283325, + 1.9552897214889526, + -43.623355865478516 + ] + } + }, + "Component_[18387556550380114975]": { + "$type": "SelectionComponent", + "Id": 18387556550380114975 + }, + "Component_[2654521436129313160]": { + "$type": "EditorVisibilityComponent", + "Id": 2654521436129313160 + }, + "Component_[5265045084611556958]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5265045084611556958 + }, + "Component_[7169798125182238623]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7169798125182238623 + }, + "Component_[7255796294953281766]": { + "$type": "GenericComponentWrapper", + "Id": 7255796294953281766, + "m_template": { + "$type": "FlyCameraInputComponent" + } + }, + "Component_[8866210352157164042]": { + "$type": "EditorInspectorComponent", + "Id": 8866210352157164042 + }, + "Component_[9129253381063760879]": { + "$type": "EditorOnlyEntityComponent", + "Id": 9129253381063760879 + } + } + }, + "Entity_[1168049227123]": { + "Id": "Entity_[1168049227123]", + "Name": "Grid", + "Components": { + "Component_[11443347433215807130]": { + "$type": "EditorEntityIconComponent", + "Id": 11443347433215807130 + }, + "Component_[11779275529534764488]": { + "$type": "SelectionComponent", + "Id": 11779275529534764488 + }, + "Component_[14249419413039427459]": { + "$type": "EditorInspectorComponent", + "Id": 14249419413039427459 + }, + "Component_[15448581635946161318]": { + "$type": "AZ::Render::EditorGridComponent", + "Id": 15448581635946161318, + "Controller": { + "Configuration": { + "primarySpacing": 4.0, + "primaryColor": [ + 0.501960813999176, + 0.501960813999176, + 0.501960813999176 + ], + "secondarySpacing": 0.5, + "secondaryColor": [ + 0.250980406999588, + 0.250980406999588, + 0.250980406999588 + ] + } + } + }, + "Component_[1843303322527297409]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 1843303322527297409 + }, + "Component_[380249072065273654]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 380249072065273654, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[7476660583684339787]": { + "$type": "EditorPendingCompositionComponent", + "Id": 7476660583684339787 + }, + "Component_[7557626501215118375]": { + "$type": "EditorEntitySortComponent", + "Id": 7557626501215118375 + }, + "Component_[7984048488947365511]": { + "$type": "EditorVisibilityComponent", + "Id": 7984048488947365511 + }, + "Component_[8118181039276487398]": { + "$type": "EditorOnlyEntityComponent", + "Id": 8118181039276487398 + }, + "Component_[9189909764215270515]": { + "$type": "EditorLockComponent", + "Id": 9189909764215270515 + } + } + }, + "Entity_[1176639161715]": { + "Id": "Entity_[1176639161715]", + "Name": "Atom Default Environment", + "Components": { + "Component_[10757302973393310045]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 10757302973393310045, + "Parent Entity": "Entity_[1146574390643]" + }, + "Component_[14505817420424255464]": { + "$type": "EditorInspectorComponent", + "Id": 14505817420424255464, + "ComponentOrderEntryArray": [ + { + "ComponentId": 10757302973393310045 + } + ] + }, + "Component_[14988041764659020032]": { + "$type": "EditorLockComponent", + "Id": 14988041764659020032 + }, + "Component_[15808690248755038124]": { + "$type": "SelectionComponent", + "Id": 15808690248755038124 + }, + "Component_[15900837685796817138]": { + "$type": "EditorVisibilityComponent", + "Id": 15900837685796817138 + }, + "Component_[3298767348226484884]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3298767348226484884 + }, + "Component_[4076975109609220594]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4076975109609220594 + }, + "Component_[5679760548946028854]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 5679760548946028854 + }, + "Component_[5855590796136709437]": { + "$type": "EditorEntitySortComponent", + "Id": 5855590796136709437, + "Child Entity Order": [ + "Entity_[1155164325235]", + "Entity_[1180934129011]", + "Entity_[1168049227123]", + "Entity_[1163754259827]", + "Entity_[1159459292531]" + ] + }, + "Component_[9277695270015777859]": { + "$type": "EditorEntityIconComponent", + "Id": 9277695270015777859 + } + } + }, + "Entity_[1180934129011]": { + "Id": "Entity_[1180934129011]", + "Name": "Global Sky", + "Components": { + "Component_[11231930600558681245]": { + "$type": "AZ::Render::EditorHDRiSkyboxComponent", + "Id": 11231930600558681245, + "Controller": { + "Configuration": { + "CubemapAsset": { + "assetId": { + "guid": "{215E47FD-D181-5832-B1AB-91673ABF6399}", + "subId": 1000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_skyboxcm.exr.streamingimage" + } + } + } + }, + "Component_[11980494120202836095]": { + "$type": "SelectionComponent", + "Id": 11980494120202836095 + }, + "Component_[1428633914413949476]": { + "$type": "EditorLockComponent", + "Id": 1428633914413949476 + }, + "Component_[14936200426671614999]": { + "$type": "AZ::Render::EditorImageBasedLightComponent", + "Id": 14936200426671614999, + "Controller": { + "Configuration": { + "diffuseImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 3000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_ibldiffuse.exr.streamingimage" + }, + "specularImageAsset": { + "assetId": { + "guid": "{3FD09945-D0F2-55C8-B9AF-B2FD421FE3BE}", + "subId": 2000 + }, + "assetHint": "lightingpresets/highcontrast/goegap_4k_iblglobalcm_iblspecular.exr.streamingimage" + } + } + } + }, + "Component_[14994774102579326069]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 14994774102579326069 + }, + "Component_[15417479889044493340]": { + "$type": "EditorPendingCompositionComponent", + "Id": 15417479889044493340 + }, + "Component_[15826613364991382688]": { + "$type": "EditorEntitySortComponent", + "Id": 15826613364991382688 + }, + "Component_[1665003113283562343]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1665003113283562343 + }, + "Component_[3704934735944502280]": { + "$type": "EditorEntityIconComponent", + "Id": 3704934735944502280 + }, + "Component_[5698542331457326479]": { + "$type": "EditorVisibilityComponent", + "Id": 5698542331457326479 + }, + "Component_[6644513399057217122]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 6644513399057217122, + "Parent Entity": "Entity_[1176639161715]" + }, + "Component_[931091830724002070]": { + "$type": "EditorInspectorComponent", + "Id": 931091830724002070 + } + } + }, + "Entity_[806656324666]": { + "Id": "Entity_[806656324666]", + "Name": "NetEntity", + "Components": { + "Component_[10272449525230713408]": { + "$type": "EditorScriptCanvasComponent", + "Id": 10272449525230713408, + "m_name": "SimpleNetworkLevelEntity.scriptcanvas", + "runtimeDataIsValid": true, + "runtimeDataOverrides": { + "source": { + "id": "{C8F17F94-1225-5FFB-A89F-7C5546FF9DD2}", + "path": "C:/prj/o3de/AutomatedTesting/Levels/Multiplayer/SimpleNetworkLevelEntity/SimpleNetworkLevelEntity.scriptcanvas" + } + }, + "sourceHandle": { + "id": "{C8F17F94-1225-5FFB-A89F-7C5546FF9DD2}", + "path": "C:/prj/o3de/AutomatedTesting/Levels/Multiplayer/SimpleNetworkLevelEntity/SimpleNetworkLevelEntity.scriptcanvas" + } + }, + "Component_[12604265186664827718]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 12604265186664827718 + }, + "Component_[12971088454284742740]": { + "$type": "EditorInspectorComponent", + "Id": 12971088454284742740 + }, + "Component_[13637345797899267673]": { + "$type": "EditorPendingCompositionComponent", + "Id": 13637345797899267673 + }, + "Component_[14691827217729577086]": { + "$type": "EditorVisibilityComponent", + "Id": 14691827217729577086 + }, + "Component_[17587769654029626028]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 17587769654029626028, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{6DE0E9A8-A1C7-5D0F-9407-4E627C1F223C}", + "subId": 284780167 + }, + "assetHint": "models/sphere.azmodel" + } + } + } + }, + "Component_[3583806849894952953]": { + "$type": "EditorOnlyEntityComponent", + "Id": 3583806849894952953 + }, + "Component_[3992057042487734240]": { + "$type": "EditorLockComponent", + "Id": 3992057042487734240 + }, + "Component_[4205899043279271481]": { + "$type": "GenericComponentWrapper", + "Id": 4205899043279271481, + "m_template": { + "$type": "Multiplayer::NetworkTransformComponent" + } + }, + "Component_[4416976521140638764]": { + "$type": "EditorEntityIconComponent", + "Id": 4416976521140638764 + }, + "Component_[4951162661196722987]": { + "$type": "EditorEntitySortComponent", + "Id": 4951162661196722987 + }, + "Component_[57491843687005111]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 57491843687005111, + "Parent Entity": "Entity_[1146574390643]", + "Transform Data": { + "Translate": [ + -0.010266244411468506, + 0.09999752044677734, + 0.4922151565551758 + ] + } + }, + "Component_[7427201282284088219]": { + "$type": "SelectionComponent", + "Id": 7427201282284088219 + }, + "Component_[9767802049284917261]": { + "$type": "GenericComponentWrapper", + "Id": 9767802049284917261, + "m_template": { + "$type": "NetBindComponent" + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/Multiplayer/SimpleNetworkLevelEntity/SimpleNetworkLevelEntity.scriptcanvas b/AutomatedTesting/Levels/Multiplayer/SimpleNetworkLevelEntity/SimpleNetworkLevelEntity.scriptcanvas new file mode 100644 index 0000000000..7f41ed9af2 --- /dev/null +++ b/AutomatedTesting/Levels/Multiplayer/SimpleNetworkLevelEntity/SimpleNetworkLevelEntity.scriptcanvas @@ -0,0 +1,228 @@ +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "ScriptCanvasData", + "ClassData": { + "m_scriptCanvas": { + "Id": { + "id": 5227099818161821361 + }, + "Name": "Script Canvas Graph", + "Components": { + "Component_[14745706451564425001]": { + "$type": "EditorGraphVariableManagerComponent", + "Id": 14745706451564425001 + }, + "Component_[6188351434280490877]": { + "$type": "EditorGraph", + "Id": 6188351434280490877, + "m_graphData": { + "m_nodes": [ + { + "Id": { + "id": 1181151842701 + }, + "Name": "SC-Node(Print)", + "Components": { + "Component_[11204048151736284490]": { + "$type": "Print", + "Id": 11204048151736284490, + "Slots": [ + { + "id": { + "m_id": "{A417FF98-493E-4DE6-AD3A-E7A1848661E4}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{38BC2AB1-7654-407E-9903-4B5D77EDB6F3}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "m_format": "SimpleNetworkLevelEntity: On Graph Start\n", + "m_unresolvedString": [ + "SimpleNetworkLevelEntity: On Graph Start\n" + ] + } + } + }, + { + "Id": { + "id": 811784655245 + }, + "Name": "SC-Node(Start)", + "Components": { + "Component_[2986280341871382503]": { + "$type": "Start", + "Id": 2986280341871382503, + "Slots": [ + { + "id": { + "m_id": "{61FBEFC6-23BA-4A53-89BF-D0D0E834608C}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "toolTip": "Signaled when the entity that owns this graph is fully activated.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ] + } + } + } + ], + "m_connections": [ + { + "Id": { + "id": 2521181639053 + }, + "Name": "srcEndpoint=(On Graph Start: Out), destEndpoint=(Print: In)", + "Components": { + "Component_[16295428600276205051]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 16295428600276205051, + "sourceEndpoint": { + "nodeId": { + "id": 811784655245 + }, + "slotId": { + "m_id": "{61FBEFC6-23BA-4A53-89BF-D0D0E834608C}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 1181151842701 + }, + "slotId": { + "m_id": "{A417FF98-493E-4DE6-AD3A-E7A1848661E4}" + } + } + } + } + } + ] + }, + "m_assetType": "{00000000-0000-0000-D033-B2489A010000}", + "versionData": { + "_grammarVersion": 1, + "_runtimeVersion": 1, + "_fileVersion": 1 + }, + "GraphCanvasData": [ + { + "Key": { + "id": 811784655245 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "TimeNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 340.0, + 180.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{6045F7F7-02B0-442A-96C7-A0CBCEFF7275}" + } + } + } + }, + { + "Key": { + "id": 1181151842701 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "StringNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 580.0, + 180.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{589F773E-D82A-4EDD-AEBD-3ADC07FC67CE}" + } + } + } + }, + { + "Key": { + "id": 5227099818161821361 + }, + "Value": { + "ComponentData": { + "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { + "$type": "SceneComponentSaveData" + } + } + } + } + ], + "StatisticsHelper": { + "InstanceCounter": [ + { + "Key": 4199610336680704683, + "Value": 1 + }, + { + "Key": 10684225535275896474, + "Value": 1 + } + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Levels/Multiplayer/SimpleNetworkLevelEntity/tags.txt b/AutomatedTesting/Levels/Multiplayer/SimpleNetworkLevelEntity/tags.txt new file mode 100644 index 0000000000..0d6c1880e7 --- /dev/null +++ b/AutomatedTesting/Levels/Multiplayer/SimpleNetworkLevelEntity/tags.txt @@ -0,0 +1,12 @@ +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 +0,0,0,0,0,0 From 0bd2083c48335127bc27ac34af2e1741f72a1efd Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Thu, 20 Jan 2022 10:35:22 -0600 Subject: [PATCH 569/948] Replaced array_view usage with span Signed-off-by: Chris Galvan --- .../Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h | 7 ++++--- .../Source/RPI.Reflect/Image/StreamingImageAsset.cpp | 9 +++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h index f4dc891ff2..93d0392e38 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h @@ -12,6 +12,7 @@ #include #include #include +#include namespace AZ { @@ -90,13 +91,13 @@ namespace AZ T GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); //! Retrieve a region of image pixel values (float) for specified mip and slice - void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); + void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); //! Retrieve a region of image pixel values (uint) for specified mip and slice - void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); + void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); //! Retrieve a region of image pixel values (int) for specified mip and slice - void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); + void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); //! Returns streaming image pool asset id of the pool that will be used to create the streaming image. const Data::AssetId& GetPoolAssetId() const; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index 3d810c4c8f..099f9c3df9 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -244,7 +244,8 @@ namespace AZ AZStd::array values = { aznumeric_cast(0) }; auto position = AZStd::make_pair(x, y); - GetSubImagePixelValues(position, position, values, componentIndex, mip, slice); + AZStd::span valueSpan(values.begin(), values.size()); + GetSubImagePixelValues(position, position, valueSpan, componentIndex, mip, slice); return values[0]; } @@ -267,7 +268,7 @@ namespace AZ return GetSubImagePixelValueInternal(x, y, componentIndex, mip, slice); } - void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) + void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) { // TODO: Use the component index (void)componentIndex; @@ -293,7 +294,7 @@ namespace AZ } } - void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) + void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) { // TODO: Use the component index (void)componentIndex; @@ -319,7 +320,7 @@ namespace AZ } } - void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) + void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) { // TODO: Use the component index (void)componentIndex; From 3c879d59676d513da30b40df9fb8c3abeab0f2e6 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Thu, 20 Jan 2022 08:45:35 -0800 Subject: [PATCH 570/948] fix pytest typos Signed-off-by: Gene Walters --- .../Multiplayer/tests/Multiplayer_SimpleNetworkLevelEntity.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_SimpleNetworkLevelEntity.py b/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_SimpleNetworkLevelEntity.py index da332f9085..aadf12d7e3 100644 --- a/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_SimpleNetworkLevelEntity.py +++ b/AutomatedTesting/Gem/PythonTests/Multiplayer/tests/Multiplayer_SimpleNetworkLevelEntity.py @@ -21,11 +21,11 @@ class TestSuccessFailTuples(): def Multiplayer_SimpleNetworkLevelEntity(): r""" Summary: - Runs a test to make sure that network entities in a level function and are replicated to clients as expecte + Test to make sure that network entities in a level function and are replicated to clients as expected Level Description: - Static - 1. NetLevelEntity. This is a networked entity which has a script attached to ensure it's replicated. + 1. NetLevelEntity. This is a networked entity which has a script attached which prints logs to ensure it's replicated. Expected Outcome: From 3df7e239ac5e345b4b6815dee0eb56149b96d281 Mon Sep 17 00:00:00 2001 From: amzn-sj Date: Thu, 20 Jan 2022 09:32:42 -0800 Subject: [PATCH 571/948] Fix build error on PC Signed-off-by: amzn-sj --- .../Code/Source/TerrainRenderer/TerrainFeatureProcessor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainFeatureProcessor.cpp b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainFeatureProcessor.cpp index 4232a37264..d9bdcb97bc 100644 --- a/Gems/Terrain/Code/Source/TerrainRenderer/TerrainFeatureProcessor.cpp +++ b/Gems/Terrain/Code/Source/TerrainRenderer/TerrainFeatureProcessor.cpp @@ -221,8 +221,8 @@ namespace Terrain numSamples, &AzFramework::Terrain::TerrainDataRequests::GetNumSamplesFromRegion, region, stepSize); - uint32_t updateWidth = numSamples.first; - uint32_t updateHeight = numSamples.second; + uint32_t updateWidth = static_cast(numSamples.first); + uint32_t updateHeight = static_cast(numSamples.second); AZStd::vector pixels; pixels.reserve(updateWidth * updateHeight); { From 730daae1e65426d26cba0d01e0070dac03e6e8c0 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Thu, 20 Jan 2022 09:33:21 -0800 Subject: [PATCH 572/948] Added code comments. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../Code/Source/RPI.Reflect/Material/MaterialAsset.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp index f2a9efd896..92fded1d5d 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp @@ -109,6 +109,9 @@ namespace AZ return m_wasPreFinalized; } + //! Attempts to convert a numeric MaterialPropertyValue to another numeric type @T, + //! since MaterialPropertyValue itself does not support any kind of casting. + //! If the original MaterialPropertyValue is not a numeric type, the original value is returned. template MaterialPropertyValue CastNumericMaterialPropertyValue(const MaterialPropertyValue& value) { @@ -135,7 +138,10 @@ namespace AZ return value; } } - + + //! Attempts to convert an AZ::Vector[2-4] MaterialPropertyValue to another AZ::Vector[2-4] type @T. + //! Any extra elements will be dropped or set to 0.0 as needed. + //! If the original MaterialPropertyValue is not a Vector type, the original value is returned. template MaterialPropertyValue CastVectorMaterialPropertyValue(const MaterialPropertyValue& value) { From 0a722b5a0616f6bf919f8644880333e522dd3f36 Mon Sep 17 00:00:00 2001 From: amzn-sj Date: Thu, 20 Jan 2022 09:48:15 -0800 Subject: [PATCH 573/948] Update comment for clarity Signed-off-by: amzn-sj --- Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.h b/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.h index 2296d48843..3e489730d0 100644 --- a/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.h +++ b/Gems/Terrain/Code/Source/TerrainSystem/TerrainSystem.h @@ -163,7 +163,8 @@ namespace Terrain AzFramework::Terrain::SurfacePointListFillCallback perPositionCallback, Sampler sampleFilter = Sampler::DEFAULT) const override; - //! Returns the number of samples for a given region and step size. + //! Returns the number of samples for a given region and step size. The first and second + //! elements of the pair correspond to the X and Y sample counts respectively. virtual AZStd::pair GetNumSamplesFromRegion(const AZ::Aabb& inRegion, const AZ::Vector2& stepSize) const override; From d6cdd1d053bc5abbea00dec0e4396b2fb0efb0b1 Mon Sep 17 00:00:00 2001 From: amzn-sj Date: Thu, 20 Jan 2022 09:51:38 -0800 Subject: [PATCH 574/948] Update another comment Signed-off-by: amzn-sj --- .../AzFramework/AzFramework/Terrain/TerrainDataRequestBus.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Code/Framework/AzFramework/AzFramework/Terrain/TerrainDataRequestBus.h b/Code/Framework/AzFramework/AzFramework/Terrain/TerrainDataRequestBus.h index 9379485646..8b29f2a554 100644 --- a/Code/Framework/AzFramework/AzFramework/Terrain/TerrainDataRequestBus.h +++ b/Code/Framework/AzFramework/AzFramework/Terrain/TerrainDataRequestBus.h @@ -161,7 +161,8 @@ namespace AzFramework SurfacePointListFillCallback perPositionCallback, Sampler sampleFilter = Sampler::DEFAULT) const = 0; - //! Returns the number of samples for a given region and step size. + //! Returns the number of samples for a given region and step size. The first and second + //! elements of the pair correspond to the X and Y sample counts respectively. virtual AZStd::pair GetNumSamplesFromRegion(const AZ::Aabb& inRegion, const AZ::Vector2& stepSize) const = 0; From 8e08e42c86bf9ae30263065c1b5bff93ee832ae6 Mon Sep 17 00:00:00 2001 From: amzn-sj Date: Thu, 20 Jan 2022 11:01:00 -0800 Subject: [PATCH 575/948] Fix some warnings about unused parameters Signed-off-by: amzn-sj --- .../Code/Tests/TerrainPhysicsColliderTests.cpp | 13 ++++++------- Gems/Terrain/Code/Tests/TerrainSystemTest.cpp | 4 ++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Gems/Terrain/Code/Tests/TerrainPhysicsColliderTests.cpp b/Gems/Terrain/Code/Tests/TerrainPhysicsColliderTests.cpp index 2d0933c367..dc43544f05 100644 --- a/Gems/Terrain/Code/Tests/TerrainPhysicsColliderTests.cpp +++ b/Gems/Terrain/Code/Tests/TerrainPhysicsColliderTests.cpp @@ -72,7 +72,6 @@ protected: void ProcessRegionLoop(const AZ::Aabb& inRegion, const AZ::Vector2& stepSize, AzFramework::Terrain::SurfacePointRegionFillCallback perPositionCallback, - AzFramework::Terrain::TerrainDataRequests::Sampler sampleFilter, AzFramework::SurfaceData::SurfaceTagWeightList* surfaceTags, float mockHeight) { @@ -281,9 +280,9 @@ TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderGetHeightsRetu ON_CALL(terrainListener, ProcessHeightsFromRegion).WillByDefault( [this](const AZ::Aabb& inRegion, const AZ::Vector2& stepSize, AzFramework::Terrain::SurfacePointRegionFillCallback perPositionCallback, - AzFramework::Terrain::TerrainDataRequests::Sampler sampleFilter) + [[maybe_unused]] AzFramework::Terrain::TerrainDataRequests::Sampler sampleFilter) { - ProcessRegionLoop(inRegion, stepSize, perPositionCallback, sampleFilter, nullptr, 0.0f); + ProcessRegionLoop(inRegion, stepSize, perPositionCallback, nullptr, 0.0f); } ); @@ -323,9 +322,9 @@ TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderReturnsRelativ ON_CALL(terrainListener, ProcessHeightsFromRegion).WillByDefault( [this, mockHeight](const AZ::Aabb& inRegion, const AZ::Vector2& stepSize, AzFramework::Terrain::SurfacePointRegionFillCallback perPositionCallback, - AzFramework::Terrain::TerrainDataRequests::Sampler sampleFilter) + [[maybe_unused]] AzFramework::Terrain::TerrainDataRequests::Sampler sampleFilter) { - ProcessRegionLoop(inRegion, stepSize, perPositionCallback, sampleFilter, nullptr, mockHeight); + ProcessRegionLoop(inRegion, stepSize, perPositionCallback, nullptr, mockHeight); } ); @@ -476,9 +475,9 @@ TEST_F(TerrainPhysicsColliderComponentTest, TerrainPhysicsColliderGetHeightsAndM ON_CALL(terrainListener, ProcessSurfacePointsFromRegion).WillByDefault( [this, mockHeight, &surfaceTags](const AZ::Aabb& inRegion, const AZ::Vector2& stepSize, AzFramework::Terrain::SurfacePointRegionFillCallback perPositionCallback, - AzFramework::Terrain::TerrainDataRequests::Sampler sampleFilter) + [[maybe_unused]] AzFramework::Terrain::TerrainDataRequests::Sampler sampleFilter) { - ProcessRegionLoop(inRegion, stepSize, perPositionCallback, sampleFilter, &surfaceTags, mockHeight); + ProcessRegionLoop(inRegion, stepSize, perPositionCallback, &surfaceTags, mockHeight); } ); diff --git a/Gems/Terrain/Code/Tests/TerrainSystemTest.cpp b/Gems/Terrain/Code/Tests/TerrainSystemTest.cpp index ab0847e634..ddccdbc49c 100644 --- a/Gems/Terrain/Code/Tests/TerrainSystemTest.cpp +++ b/Gems/Terrain/Code/Tests/TerrainSystemTest.cpp @@ -969,7 +969,7 @@ namespace UnitTest AzFramework::SurfaceData::SurfaceTagWeightList expectedTags; SetupSurfaceWeightMocks(entity.get(), expectedTags); - auto perPositionCallback = [&expectedTags](size_t xIndex, size_t yIndex, + auto perPositionCallback = [&expectedTags]([[maybe_unused]] size_t xIndex, [[maybe_unused]] size_t yIndex, const AzFramework::SurfaceData::SurfacePoint& surfacePoint, [[maybe_unused]] bool terrainExists) { constexpr float epsilon = 0.0001f; @@ -1015,7 +1015,7 @@ namespace UnitTest AzFramework::SurfaceData::SurfaceTagWeightList expectedTags; SetupSurfaceWeightMocks(entity.get(), expectedTags); - auto perPositionCallback = [&expectedTags](size_t xIndex, size_t yIndex, + auto perPositionCallback = [&expectedTags]([[maybe_unused]] size_t xIndex, [[maybe_unused]] size_t yIndex, const AzFramework::SurfaceData::SurfacePoint& surfacePoint, [[maybe_unused]] bool terrainExists) { constexpr float epsilon = 0.0001f; From c31e3c020898816b1a2eee355af202e7c952c56c Mon Sep 17 00:00:00 2001 From: Sergey Pereslavtsev Date: Thu, 20 Jan 2022 19:36:33 +0000 Subject: [PATCH 576/948] LYN-7640 Terrain Physics Materials hooked up all the way down to PhysX Signed-off-by: Sergey Pereslavtsev --- .../EditorHeightfieldColliderComponent.cpp | 3 + .../Source/HeightfieldColliderComponent.cpp | 4 + Gems/PhysX/Code/Source/Utils.cpp | 132 ++++++----- Gems/PhysX/Code/Source/Utils.h | 7 + ...ditorHeightfieldColliderComponentTests.cpp | 208 ++++++++++++++++-- Gems/PhysX/Code/Tests/EditorTestUtilities.cpp | 18 ++ Gems/PhysX/Code/Tests/EditorTestUtilities.h | 3 + 7 files changed, 302 insertions(+), 73 deletions(-) diff --git a/Gems/PhysX/Code/Source/EditorHeightfieldColliderComponent.cpp b/Gems/PhysX/Code/Source/EditorHeightfieldColliderComponent.cpp index fb0a38fa18..c6def5f0ab 100644 --- a/Gems/PhysX/Code/Source/EditorHeightfieldColliderComponent.cpp +++ b/Gems/PhysX/Code/Source/EditorHeightfieldColliderComponent.cpp @@ -189,6 +189,9 @@ namespace PhysX configuration.m_entityId = GetEntityId(); configuration.m_debugName = GetEntity()->GetName(); + // Update material selection from the mapping + Utils::SetMaterialsFromHeightfieldProvider(GetEntityId(), m_colliderConfig.m_materialSelection); + AzPhysics::ShapeColliderPairList colliderShapePairs; colliderShapePairs.emplace_back(AZStd::make_shared(m_colliderConfig), m_shapeConfig); configuration.m_colliderAndShapeData = colliderShapePairs; diff --git a/Gems/PhysX/Code/Source/HeightfieldColliderComponent.cpp b/Gems/PhysX/Code/Source/HeightfieldColliderComponent.cpp index c1fa09f21f..b219253b6f 100644 --- a/Gems/PhysX/Code/Source/HeightfieldColliderComponent.cpp +++ b/Gems/PhysX/Code/Source/HeightfieldColliderComponent.cpp @@ -140,6 +140,10 @@ namespace PhysX Physics::HeightfieldShapeConfiguration& configuration = static_cast(*m_shapeConfig.second); configuration = Utils::CreateHeightfieldShapeConfiguration(GetEntityId()); + + // Update material selection from the mapping + Physics::ColliderConfiguration* colliderConfig = m_shapeConfig.first.get(); + Utils::SetMaterialsFromHeightfieldProvider(GetEntityId(), colliderConfig->m_materialSelection); } void HeightfieldColliderComponent::RefreshHeightfield() diff --git a/Gems/PhysX/Code/Source/Utils.cpp b/Gems/PhysX/Code/Source/Utils.cpp index fecea57d9c..a988f6791c 100644 --- a/Gems/PhysX/Code/Source/Utils.cpp +++ b/Gems/PhysX/Code/Source/Utils.cpp @@ -66,6 +66,67 @@ namespace PhysX } } + AZStd::pair GetPhysXMaterialIndicesFromHeightfieldSamples( + const AZStd::vector& samples, + const int32_t row, const int32_t col, + const int32_t numRows, const int32_t numCols) + { + + uint8_t materialIndex0 = 0; + uint8_t materialIndex1 = 0; + + const bool lastRowIndex = (row == (numRows - 1)); + const bool lastColumnIndex = (col == (numCols - 1)); + + // In PhysX, the material indices refer to the quad down and to the right of the sample. + // If we're in the last row or last column, there aren't any quads down or to the right, + // so just clear these out. + + if (!lastRowIndex && !lastColumnIndex) + { + auto GetIndex = [numCols](int32_t row, int32_t col) + { + return (row * numCols) + col; + }; + + // Our source data is providing one material index per vertex, but PhysX wants one material index + // per triangle. The heuristic that we'll go with for selecting the material index is to choose + // the material for the vertex that's not on the diagonal of each triangle. + // Ex: A *---* B + // | / | For this, we'll use A for index0 and D for index1. + // C *---* D + // + // Ex: A *---* B + // | \ | For this, we'll use C for index0 and B for index1. + // C *---* D + // + // This is a pretty arbitrary choice, so the heuristic might need to be revisited over time if this + // causes incorrect or unpredictable physics material mappings. + + const Physics::HeightMaterialPoint& currentSample = samples[GetIndex(row, col)]; + + switch (currentSample.m_quadMeshType) + { + case Physics::QuadMeshType::SubdivideUpperLeftToBottomRight: + materialIndex0 = samples[GetIndex(row + 1, col)].m_materialIndex; + materialIndex1 = samples[GetIndex(row, col + 1)].m_materialIndex; + break; + case Physics::QuadMeshType::SubdivideBottomLeftToUpperRight: + materialIndex0 = currentSample.m_materialIndex; + materialIndex1 = samples[GetIndex(row + 1, col + 1)].m_materialIndex; + break; + case Physics::QuadMeshType::Hole: + materialIndex0 = physx::PxHeightFieldMaterial::eHOLE; + materialIndex1 = physx::PxHeightFieldMaterial::eHOLE; + break; + default: + AZ_Assert(false, "Unhandled case in GetPhysXMaterialIndicesFromHeightfieldSamples"); + break; + } + } + return { materialIndex0, materialIndex1 }; + } + void CreatePxGeometryFromHeightfield( Physics::HeightfieldShapeConfiguration& heightfieldConfig, physx::PxGeometryHolder& pxGeometry) { @@ -116,12 +177,8 @@ namespace PhysX for (int32_t row = 0; row < numRows; row++) { - const bool lastRowIndex = (row == (numRows - 1)); - for (int32_t col = 0; col < numCols; col++) { - const bool lastColumnIndex = (col == (numCols - 1)); - auto GetIndex = [numCols](int32_t row, int32_t col) { return (row * numCols) + col; @@ -134,52 +191,15 @@ namespace PhysX AZ_Assert(currentSample.m_materialIndex < physxMaximumMaterialIndex, "MaterialIndex must be less than 128"); currentPhysxSample.height = azlossy_cast( AZ::GetClamp(currentSample.m_height, minHeightBounds, maxHeightBounds) * scaleFactor); - if (lastRowIndex || lastColumnIndex) - { - // In PhysX, the material indices refer to the quad down and to the right of the sample. - // If we're in the last row or last column, there aren't any quads down or to the right, - // so just clear these out. - currentPhysxSample.materialIndex0 = 0; - currentPhysxSample.materialIndex1 = 0; - } - else + + auto [materialIndex0, materialIndex1] = GetPhysXMaterialIndicesFromHeightfieldSamples(samples, row, col, numRows, numCols); + currentPhysxSample.materialIndex0 = materialIndex0; + currentPhysxSample.materialIndex1 = materialIndex1; + + if (currentSample.m_quadMeshType == Physics::QuadMeshType::SubdivideUpperLeftToBottomRight) { - // Our source data is providing one material index per vertex, but PhysX wants one material index - // per triangle. The heuristic that we'll go with for selecting the material index is to choose - // the material for the vertex that's not on the diagonal of each triangle. - // Ex: A *---* B - // | / | For this, we'll use A for index0 and D for index1. - // C *---* D - // - // Ex: A *---* B - // | \ | For this, we'll use C for index0 and B for index1. - // C *---* D - // - // This is a pretty arbitrary choice, so the heuristic might need to be revisited over time if this - // causes incorrect or unpredictable physics material mappings. - - switch (currentSample.m_quadMeshType) - { - case Physics::QuadMeshType::SubdivideUpperLeftToBottomRight: - currentPhysxSample.materialIndex0 = samples[GetIndex(row + 1, col)].m_materialIndex; - currentPhysxSample.materialIndex1 = samples[GetIndex(row, col + 1)].m_materialIndex; - // Set the tesselation flag to say that we need to go from UL to BR - currentPhysxSample.materialIndex0.setBit(); - break; - case Physics::QuadMeshType::SubdivideBottomLeftToUpperRight: - currentPhysxSample.materialIndex0 = currentSample.m_materialIndex; - currentPhysxSample.materialIndex1 = samples[GetIndex(row + 1, col + 1)].m_materialIndex; - break; - case Physics::QuadMeshType::Hole: - currentPhysxSample.materialIndex0 = physx::PxHeightFieldMaterial::eHOLE; - currentPhysxSample.materialIndex1 = physx::PxHeightFieldMaterial::eHOLE; - break; - default: - AZ_Warning("PhysX Heightfield", false, "Unhandled case in CreatePxGeometryFromConfig"); - currentPhysxSample.materialIndex0 = 0; - currentPhysxSample.materialIndex1 = 0; - break; - } + // Set the tesselation flag to say that we need to go from UL to BR + currentPhysxSample.setTessFlag(); } } } @@ -1562,6 +1582,20 @@ namespace PhysX return configuration; } + + void SetMaterialsFromHeightfieldProvider(const AZ::EntityId& heightfieldProviderId, Physics::MaterialSelection& materialSelection) + { + AZStd::vector materialList; + Physics::HeightfieldProviderRequestsBus::EventResult( + materialList, heightfieldProviderId, &Physics::HeightfieldProviderRequestsBus::Events::GetMaterialList); + + materialSelection.SetMaterialSlots(Physics::MaterialSelection::SlotsArray(materialList.size(), "")); + + for (int i = 0; i < materialList.size(); ++i) + { + materialSelection.SetMaterialId(materialList[i], i); + } + } } // namespace Utils namespace ReflectionUtils diff --git a/Gems/PhysX/Code/Source/Utils.h b/Gems/PhysX/Code/Source/Utils.h index 525db03315..5244926aa2 100644 --- a/Gems/PhysX/Code/Source/Utils.h +++ b/Gems/PhysX/Code/Source/Utils.h @@ -188,8 +188,15 @@ namespace PhysX //! Returns defaultValue if the input is infinite or NaN, otherwise returns the input unchanged. const AZ::Vector3& Sanitize(const AZ::Vector3& input, const AZ::Vector3& defaultValue = AZ::Vector3::CreateZero()); + AZStd::pair GetPhysXMaterialIndicesFromHeightfieldSamples( + const AZStd::vector& samples, + const int32_t row, const int32_t col, + const int32_t numRows, const int32_t numCols); + Physics::HeightfieldShapeConfiguration CreateHeightfieldShapeConfiguration(AZ::EntityId entityId); + void SetMaterialsFromHeightfieldProvider(const AZ::EntityId& heightfieldProviderId, Physics::MaterialSelection& materialSelection); + namespace Geometry { using PointList = AZStd::vector; diff --git a/Gems/PhysX/Code/Tests/EditorHeightfieldColliderComponentTests.cpp b/Gems/PhysX/Code/Tests/EditorHeightfieldColliderComponentTests.cpp index ef112d8623..9bdc63e60d 100644 --- a/Gems/PhysX/Code/Tests/EditorHeightfieldColliderComponentTests.cpp +++ b/Gems/PhysX/Code/Tests/EditorHeightfieldColliderComponentTests.cpp @@ -19,6 +19,7 @@ #include #include #include +#include using ::testing::NiceMock; using ::testing::Return; @@ -27,18 +28,28 @@ namespace PhysXEditorTests { AZStd::vector GetSamples() { - AZStd::vector samples{ { 3.0f, Physics::QuadMeshType::SubdivideUpperLeftToBottomRight }, - { 2.0f, Physics::QuadMeshType::SubdivideUpperLeftToBottomRight }, - { 1.5f, Physics::QuadMeshType::SubdivideUpperLeftToBottomRight }, - { 1.0f, Physics::QuadMeshType::SubdivideUpperLeftToBottomRight }, - { 3.0f, Physics::QuadMeshType::SubdivideUpperLeftToBottomRight }, - { 1.0f, Physics::QuadMeshType::SubdivideUpperLeftToBottomRight }, - { 3.0f, Physics::QuadMeshType::SubdivideUpperLeftToBottomRight }, - { 0.0f, Physics::QuadMeshType::SubdivideUpperLeftToBottomRight }, - { 3.0f, Physics::QuadMeshType::SubdivideUpperLeftToBottomRight } }; + AZStd::vector samples{ { 3.0f, Physics::QuadMeshType::SubdivideUpperLeftToBottomRight, 0 }, + { 2.0f, Physics::QuadMeshType::SubdivideUpperLeftToBottomRight, 1 }, + { 1.5f, Physics::QuadMeshType::SubdivideUpperLeftToBottomRight, 2 }, + { 1.0f, Physics::QuadMeshType::SubdivideUpperLeftToBottomRight, 0 }, + { 3.0f, Physics::QuadMeshType::SubdivideUpperLeftToBottomRight, 1 }, + { 1.0f, Physics::QuadMeshType::SubdivideUpperLeftToBottomRight, 2 }, + { 3.0f, Physics::QuadMeshType::SubdivideUpperLeftToBottomRight, 0 }, + { 0.0f, Physics::QuadMeshType::SubdivideUpperLeftToBottomRight, 1 }, + { 3.0f, Physics::QuadMeshType::SubdivideUpperLeftToBottomRight, 2 } }; return samples; } + AZStd::vector GetMaterialList() + { + AZStd::vector materials{ + {Physics::MaterialId::FromUUID("{EC976D51-2C26-4C1E-BBF2-75BAAAFA162C}")}, + {Physics::MaterialId::FromUUID("{B9836F51-A235-4781-95E3-A6302BEE9EFF}")}, + {Physics::MaterialId::FromUUID("{7E060707-BB03-47EB-B046-4503C7145B6E}")} + }; + return materials; + } + EntityPtr SetupHeightfieldComponent() { // create an editor entity with a shape collider component and a box shape component @@ -78,6 +89,7 @@ namespace PhysXEditorTests x = -3.0f; y = 3.0f; }); + ON_CALL(mockShapeRequests, GetMaterialList).WillByDefault(Return(GetMaterialList())); } EntityPtr TestCreateActiveGameEntityFromEditorEntity(AZ::Entity* editorEntity) @@ -89,6 +101,89 @@ namespace PhysXEditorTests return gameEntity; } + class PhysXEditorHeightfieldFixture : public PhysXEditorFixture + { + public: + void SetUp() override + { + PhysXEditorFixture::SetUp(); + PopulateDefaultMaterialLibrary(); + + m_editorEntity = SetupHeightfieldComponent(); + m_editorMockShapeRequests = AZStd::make_unique>(m_editorEntity->GetId()); + SetupMockMethods(*m_editorMockShapeRequests.get()); + m_editorEntity->Activate(); + + m_gameEntity = TestCreateActiveGameEntityFromEditorEntity(m_editorEntity.get()); + m_gameMockShapeRequests = AZStd::make_unique>(m_gameEntity->GetId()); + SetupMockMethods(*m_gameMockShapeRequests.get()); + m_gameEntity->Activate(); + } + + void TearDown() override + { + CleanupHeightfieldComponent(); + + m_editorEntity = nullptr; + m_gameEntity = nullptr; + m_editorMockShapeRequests = nullptr; + m_gameMockShapeRequests = nullptr; + + PhysXEditorFixture::TearDown(); + } + + void PopulateDefaultMaterialLibrary() + { + AZ::Data::AssetId assetId = AZ::Data::AssetId(AZ::Uuid::Create()); + + // Create an asset out of our Script Event + Physics::MaterialLibraryAsset* matLibAsset = aznew Physics::MaterialLibraryAsset; + { + AZStd::vector matIds = GetMaterialList(); + + for (Physics::MaterialId matId : matIds) + { + Physics::MaterialFromAssetConfiguration matConfig; + matConfig.m_id = matId; + matConfig.m_configuration.m_surfaceType = matId.GetUuid().ToString(); + matLibAsset->AddMaterialData(matConfig); + } + } + + // Note: There is no interface to simply update material library asset. It has to go via updating the entire configuration which causes assets reloading. + // It makes sense as a safety mechanism in the Editor but makes it harder to write tests. + // Hence have to work around it via const_cast here to be able to simply set the generated asset into configuration. + AzPhysics::SystemConfiguration* sysConfig = const_cast(AZ::Interface::Get()->GetConfiguration()); + + AZ::Data::Asset assetData(assetId, matLibAsset, AZ::Data::AssetLoadBehavior::Default); + sysConfig->m_materialLibraryAsset = assetData; + } + + Physics::Material* GetMaterialFromRaycast(float x, float y) + { + AzPhysics::RayCastRequest request; + request.m_start = AZ::Vector3(x, y, 5.0f); + request.m_direction = AZ::Vector3(0.0f, 0.0f, -1.0f); + request.m_distance = 10.0f; + + //query the scene + auto* sceneInterface = AZ::Interface::Get(); + AzPhysics::SceneQueryHits result = sceneInterface->QueryScene(m_defaultSceneHandle, &request); + EXPECT_EQ(result.m_hits.size(), 1); + + if (result) + { + return result.m_hits[0].m_material; + } + + return nullptr; + }; + + EntityPtr m_editorEntity; + EntityPtr m_gameEntity; + AZStd::unique_ptr> m_editorMockShapeRequests; + AZStd::unique_ptr> m_gameMockShapeRequests; + }; TEST_F(PhysXEditorFixture, EditorHeightfieldColliderComponentDependenciesSatisfiedEntityIsValid) { @@ -149,21 +244,13 @@ namespace PhysXEditorTests CleanupHeightfieldComponent(); } - TEST_F(PhysXEditorFixture, EditorHeightfieldColliderComponentHeightfieldColliderWithAABoxCorrectRuntimeGeometry) + TEST_F(PhysXEditorHeightfieldFixture, EditorHeightfieldColliderComponentHeightfieldColliderWithAABoxCorrectRuntimeGeometry) { - EntityPtr editorEntity = SetupHeightfieldComponent(); - NiceMock mockShapeRequests(editorEntity->GetId()); - SetupMockMethods(mockShapeRequests); - editorEntity->Activate(); - - EntityPtr gameEntity = TestCreateActiveGameEntityFromEditorEntity(editorEntity.get()); - NiceMock mockShapeRequests2(gameEntity->GetId()); - SetupMockMethods(mockShapeRequests2); - gameEntity->Activate(); + AZ::EntityId gameEntityId = m_gameEntity->GetId(); AzPhysics::SimulatedBody* staticBody = nullptr; AzPhysics::SimulatedBodyComponentRequestsBus::EventResult( - staticBody, gameEntity->GetId(), &AzPhysics::SimulatedBodyComponentRequests::GetSimulatedBody); + staticBody, gameEntityId, &AzPhysics::SimulatedBodyComponentRequests::GetSimulatedBody); const auto* pxRigidStatic = static_cast(staticBody->GetNativePointer()); PHYSX_SCENE_READ_LOCK(pxRigidStatic->getScene()); @@ -183,7 +270,7 @@ namespace PhysXEditorTests int32_t numRows{ 0 }; int32_t numColumns{ 0 }; Physics::HeightfieldProviderRequestsBus::Event( - gameEntity->GetId(), &Physics::HeightfieldProviderRequestsBus::Events::GetHeightfieldGridSize, numColumns, numRows); + gameEntityId, &Physics::HeightfieldProviderRequestsBus::Events::GetHeightfieldGridSize, numColumns, numRows); EXPECT_EQ(numColumns, heightfield->getNbColumns()); EXPECT_EQ(numRows, heightfield->getNbRows()); @@ -194,12 +281,12 @@ namespace PhysXEditorTests float minHeightBounds{ 0.0f }; float maxHeightBounds{ 0.0f }; Physics::HeightfieldProviderRequestsBus::Event( - gameEntity->GetId(), &Physics::HeightfieldProviderRequestsBus::Events::GetHeightfieldHeightBounds, minHeightBounds, + gameEntityId, &Physics::HeightfieldProviderRequestsBus::Events::GetHeightfieldHeightBounds, minHeightBounds, maxHeightBounds); AZStd::vector samples; Physics::HeightfieldProviderRequestsBus::EventResult( - samples, gameEntity->GetId(), &Physics::HeightfieldProviderRequestsBus::Events::GetHeightsAndMaterials); + samples, gameEntityId, &Physics::HeightfieldProviderRequestsBus::Events::GetHeightsAndMaterials); const float halfBounds{ (maxHeightBounds - minHeightBounds) / 2.0f }; const float scaleFactor = (maxHeightBounds <= minHeightBounds) ? 1.0f : AZStd::numeric_limits::max() / halfBounds; @@ -208,7 +295,80 @@ namespace PhysXEditorTests EXPECT_EQ(samplePhysX.height, azlossy_cast(samplePhysics.m_height * scaleFactor)); } } - CleanupHeightfieldComponent(); + } + + TEST_F(PhysXEditorHeightfieldFixture, EditorHeightfieldColliderComponentHeightfieldColliderCorrectMaterials) + { + AZ::EntityId gameEntityId = m_gameEntity->GetId(); + + int32_t numRows{ 0 }; + int32_t numColumns{ 0 }; + Physics::HeightfieldProviderRequestsBus::Event( + gameEntityId, &Physics::HeightfieldProviderRequestsBus::Events::GetHeightfieldGridSize, numColumns, numRows); + + EXPECT_EQ(numRows, 3); + EXPECT_EQ(numColumns, 3); + + AZStd::vector samples; + Physics::HeightfieldProviderRequestsBus::EventResult( + samples, gameEntityId, &Physics::HeightfieldProviderRequestsBus::Events::GetHeightsAndMaterials); + + AzPhysics::SimulatedBody* staticBody = nullptr; + AzPhysics::SimulatedBodyComponentRequestsBus::EventResult( + staticBody, gameEntityId, &AzPhysics::SimulatedBodyComponentRequests::GetSimulatedBody); + + const auto* pxRigidStatic = static_cast(staticBody->GetNativePointer()); + PHYSX_SCENE_READ_LOCK(pxRigidStatic->getScene()); + + physx::PxShape* shape = nullptr; + pxRigidStatic->getShapes(&shape, 1, 0); + + physx::PxHeightFieldGeometry heightfieldGeometry; + shape->getHeightFieldGeometry(heightfieldGeometry); + + physx::PxHeightField* heightfield = heightfieldGeometry.heightField; + + AZStd::vector physicsSurfaceTypes; + for (Physics::MaterialId materialId : GetMaterialList()) + { + physicsSurfaceTypes.emplace_back(materialId.GetUuid().ToString()); + } + + // PhysX Heightfield cooking doesn't map 1-1 sample material indices to triangle material indices + // Hence hardcoding the expected material indices in the test + const int physicsMaterialsValidationDataIndex[] = {0, 2, 1, 1}; + + for (int sampleRow = 0; sampleRow < numRows; ++sampleRow) + { + for (int sampleColumn = 0; sampleColumn < numColumns; ++sampleColumn) + { + physx::PxHeightFieldSample samplePhysX = heightfield->getSample(sampleRow, sampleColumn); + Physics::HeightMaterialPoint samplePhysics = samples[sampleRow * numColumns + sampleColumn]; + + auto [materialIndex0, materialIndex1] = PhysX::Utils::GetPhysXMaterialIndicesFromHeightfieldSamples(samples, sampleRow, sampleColumn, numRows, numColumns); + EXPECT_EQ(samplePhysX.materialIndex0, materialIndex0); + EXPECT_EQ(samplePhysX.materialIndex1, materialIndex1); + + if (sampleRow != numRows - 1 && sampleColumn != numColumns - 1) + { + const float x_offset = -0.25f; + const float y_offset = 0.75f; + const float secondRayOffset = 0.5f; + + float rayX = x_offset + sampleColumn; + float rayY = y_offset + sampleRow; + + Physics::Material* mat1 = GetMaterialFromRaycast(rayX, rayY); + EXPECT_NE(mat1, nullptr); + + Physics::Material* mat2 = GetMaterialFromRaycast(rayX + secondRayOffset, rayY + secondRayOffset); + EXPECT_NE(mat2, nullptr); + + AZStd::string expectedMaterialName = physicsSurfaceTypes[physicsMaterialsValidationDataIndex[sampleRow * 2 + sampleColumn]]; + EXPECT_EQ(mat1->GetSurfaceTypeName(), expectedMaterialName); + } + } + } } } // namespace PhysXEditorTests diff --git a/Gems/PhysX/Code/Tests/EditorTestUtilities.cpp b/Gems/PhysX/Code/Tests/EditorTestUtilities.cpp index fa794c58a5..272d9157b2 100644 --- a/Gems/PhysX/Code/Tests/EditorTestUtilities.cpp +++ b/Gems/PhysX/Code/Tests/EditorTestUtilities.cpp @@ -70,6 +70,24 @@ namespace PhysXEditorTests } } + void PhysXEditorFixture::ConnectToPVD() + { + auto* debug = AZ::Interface::Get(); + if (debug) + { + debug->ConnectToPvd(); + } + } + + void PhysXEditorFixture::DisconnectFromPVD() + { + auto* debug = AZ::Interface::Get(); + if (debug) + { + debug->DisconnectFromPvd(); + } + } + // DefaultWorldBus AzPhysics::SceneHandle PhysXEditorFixture::GetDefaultSceneHandle() const { diff --git a/Gems/PhysX/Code/Tests/EditorTestUtilities.h b/Gems/PhysX/Code/Tests/EditorTestUtilities.h index 9dfe40f366..26566f724a 100644 --- a/Gems/PhysX/Code/Tests/EditorTestUtilities.h +++ b/Gems/PhysX/Code/Tests/EditorTestUtilities.h @@ -48,6 +48,9 @@ namespace PhysXEditorTests void SetUp() override; void TearDown() override; + void ConnectToPVD(); + void DisconnectFromPVD(); + // DefaultWorldBus AzPhysics::SceneHandle GetDefaultSceneHandle() const override; From f4befb22426d84eba7172ebf17ac2cf97e8dd8be Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Thu, 20 Jan 2022 11:39:28 -0800 Subject: [PATCH 577/948] Removed some dead code. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../RPI.Edit/Material/MaterialPropertyValueSerializer.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyValueSerializer.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyValueSerializer.cpp index 10b45ca8df..9980d8f2ff 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyValueSerializer.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialPropertyValueSerializer.cpp @@ -54,12 +54,6 @@ namespace AZ MaterialSourceData::Property* property = reinterpret_cast(outputValue); AZ_Assert(property, "Output value for JsonMaterialPropertyValueSerializer can't be null."); - // Construct the full property name (groupName.propertyName) by parsing it from the JSON path string. - size_t startPropertyName = context.GetPath().Get().rfind('/'); - size_t startGroupName = context.GetPath().Get().rfind('/', startPropertyName-1); - AZStd::string_view groupName = context.GetPath().Get().substr(startGroupName + 1, startPropertyName - startGroupName - 1); - AZStd::string_view propertyName = context.GetPath().Get().substr(startPropertyName + 1); - JSR::ResultCode result(JSR::Tasks::ReadField); if (inputValue.IsBool()) From 61dc7623d21108c3798c3fe3a6dd52fec851f955 Mon Sep 17 00:00:00 2001 From: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> Date: Thu, 20 Jan 2022 12:41:25 -0700 Subject: [PATCH 578/948] Minor change to a comment Signed-off-by: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com> --- .../DiffuseProbeGridComponentController.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridComponentController.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridComponentController.cpp index b7dbbdbcf5..8c8b29a053 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridComponentController.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridComponentController.cpp @@ -34,7 +34,7 @@ namespace AZ if (auto* serializeContext = azrtti_cast(context)) { serializeContext->Class() - ->Version(2) // ATOM-17127 + ->Version(2) // Added NumRaysPerProbe setting ->Field("ProbeSpacing", &DiffuseProbeGridComponentConfig::m_probeSpacing) ->Field("Extents", &DiffuseProbeGridComponentConfig::m_extents) ->Field("AmbientMultiplier", &DiffuseProbeGridComponentConfig::m_ambientMultiplier) From cc50a18fe997eeccc342d63f913942581d2fc9ae Mon Sep 17 00:00:00 2001 From: greerdv Date: Thu, 20 Jan 2022 11:38:22 +0000 Subject: [PATCH 579/948] add support for quad shapes in shape collider component Signed-off-by: greerdv --- .../Source/EditorShapeColliderComponent.cpp | 133 +++++++++++++++++- .../Source/EditorShapeColliderComponent.h | 11 ++ .../Code/Source/ShapeColliderComponent.h | 1 + 3 files changed, 144 insertions(+), 1 deletion(-) diff --git a/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp b/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp index 59b659a0bf..f61b2fce74 100644 --- a/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp +++ b/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -64,6 +65,17 @@ namespace PhysX return AZ::Edit::PropertyVisibility::Hide; } + AZ::Crc32 EditorShapeColliderComponent::SingleSidedVisibility() + { + if ((m_shapeType == ShapeType::QuadSingleSided || m_shapeType == ShapeType::QuadDoubleSided) + && GetEntity()->FindComponent() == nullptr) + { + return AZ::Edit::PropertyVisibility::Show; + } + + return AZ::Edit::PropertyVisibility::Hide; + } + void EditorShapeColliderComponent::Reflect(AZ::ReflectContext* context) { if (auto serializeContext = azrtti_cast(context)) @@ -74,6 +86,7 @@ namespace PhysX ->Field("DebugDrawSettings", &EditorShapeColliderComponent::m_colliderDebugDraw) ->Field("ShapeConfigs", &EditorShapeColliderComponent::m_shapeConfigs) ->Field("SubdivisionCount", &EditorShapeColliderComponent::m_subdivisionCount) + ->Field("SingleSided", &EditorShapeColliderComponent::m_singleSided) ; if (auto editContext = serializeContext->GetEditContext()) @@ -100,6 +113,10 @@ namespace PhysX ->Attribute(AZ::Edit::Attributes::Max, Utils::MaxFrustumSubdivisions) ->Attribute(AZ::Edit::Attributes::ChangeNotify, &EditorShapeColliderComponent::OnSubdivisionCountChange) ->Attribute(AZ::Edit::Attributes::Visibility, &EditorShapeColliderComponent::SubdivisionCountVisibility) + ->DataElement(AZ::Edit::UIHandlers::Default, &EditorShapeColliderComponent::m_singleSided, "Single sided", + "If enabled, planar shapes will only collide from one direction (not valid for shapes attached to dynamic rigid bodies)") + ->Attribute(AZ::Edit::Attributes::ChangeNotify, &EditorShapeColliderComponent::OnSingleSidedChange) + ->Attribute(AZ::Edit::Attributes::Visibility, &EditorShapeColliderComponent::SingleSidedVisibility) ; } } @@ -126,7 +143,6 @@ namespace PhysX incompatible.push_back(AZ_CRC_CE("AxisAlignedBoxShapeService")); incompatible.push_back(AZ_CRC_CE("CompoundShapeService")); incompatible.push_back(AZ_CRC_CE("DiskShapeService")); - incompatible.push_back(AZ_CRC_CE("QuadShapeService")); incompatible.push_back(AZ_CRC_CE("TubeShapeService")); incompatible.push_back(AZ_CRC_CE("ReferenceShapeService")); } @@ -206,6 +222,12 @@ namespace PhysX break; } + case ShapeType::QuadSingleSided: + case ShapeType::QuadDoubleSided: + { + // a quad shape has no interior, just return an empty vector of sample points + break; + } default: AZ_WarningOnce("PhysX Shape Collider Component", false, "Unsupported shape type in UpdateCachedSamplePoints"); break; @@ -331,6 +353,11 @@ namespace PhysX UpdateCylinderConfig(uniformScale); } + else if (shapeCrc == ShapeConstants::Quad) + { + UpdateQuadConfig(overallScale); + } + else { m_shapeType = !shapeCrc ? ShapeType::None : ShapeType::Unsupported; @@ -354,6 +381,60 @@ namespace PhysX m_geometryCache.m_boxDimensions = scale * boxDimensions; } + void EditorShapeColliderComponent::UpdateQuadConfig(const AZ::Vector3& scale) + { + LmbrCentral::QuadShapeConfig quadShapeConfig; + LmbrCentral::QuadShapeComponentRequestBus::EventResult(quadShapeConfig, GetEntityId(), + &LmbrCentral::QuadShapeComponentRequests::GetQuadConfiguration); + + const float minDimension = 1e-3f; // used to prevent the dimensions being 0 in any direction + const float xDim = AZ::GetMax(minDimension, quadShapeConfig.m_width); + const float yDim = AZ::GetMax(minDimension, quadShapeConfig.m_height); + + if (m_singleSided) + { + AZStd::vector cookedData; + + constexpr AZ::u32 vertexCount = 4; + const AZ::Vector3 vertices[vertexCount] = + { + AZ::Vector3(-0.5f * xDim, -0.5f * yDim, 0.0f), + AZ::Vector3(-0.5f * xDim, 0.5f * yDim, 0.0f), + AZ::Vector3(0.5f * xDim, 0.5f * yDim, 0.0f), + AZ::Vector3(0.5f * xDim, -0.5f * yDim, 0.0f), + }; + + constexpr AZ::u32 indexCount = 6; + const AZ::u32 indices[indexCount] = + { + 0, 1, 2, + 0, 2, 3 + }; + + bool cookingResult = false; + Physics::SystemRequestBus::BroadcastResult(cookingResult, &Physics::SystemRequests::CookTriangleMeshToMemory, + vertices, vertexCount, indices, indexCount, cookedData); + + Physics::CookedMeshShapeConfiguration shapeConfig; + shapeConfig.SetCookedMeshData(cookedData.data(), cookedData.size(), + Physics::CookedMeshShapeConfiguration::MeshType::TriangleMesh); + shapeConfig.m_scale = scale; + + SetShapeConfig(ShapeType::QuadSingleSided, shapeConfig); + } + + else + { + // it's not possible to create a perfectly 2d convex in PhysX, so the best we can do is a very thin box + const float zDim = AZ::GetMax(minDimension, 1e-3f * AZ::GetMin(xDim, yDim)); + const AZ::Vector3 boxDimensions(xDim, yDim, zDim); + + SetShapeConfig(ShapeType::QuadDoubleSided, Physics::BoxShapeConfiguration(boxDimensions)); + + m_shapeConfigs.back()->m_scale = scale; + } + } + void EditorShapeColliderComponent::UpdateCapsuleConfig(const AZ::Vector3& scale) { LmbrCentral::CapsuleShapeConfig lmbrCentralCapsuleShapeConfig; @@ -425,6 +506,12 @@ namespace PhysX } } + void EditorShapeColliderComponent::OnSingleSidedChange() + { + UpdateShapeConfigs(); + CreateStaticEditorCollider(); + } + AZ::u32 EditorShapeColliderComponent::OnSubdivisionCountChange() { const AZ::Vector3 uniformScale = Utils::GetUniformScale(GetEntityId()); @@ -615,6 +702,8 @@ namespace PhysX m_editorSceneHandle = m_sceneInterface->GetSceneHandle(AzPhysics::EditorPhysicsSceneName); } + UpdateTriggerSettings(); + UpdateSingleSidedSettings(); UpdateShapeConfigs(); // Debug drawing @@ -767,6 +856,7 @@ namespace PhysX if (changeReason == LmbrCentral::ShapeComponentNotifications::ShapeChangeReasons::ShapeChanged) { UpdateShapeConfigs(); + UpdateTriggerSettings(); CreateStaticEditorCollider(); Physics::ColliderComponentEventBus::Event(GetEntityId(), &Physics::ColliderComponentEvents::OnColliderChanged); @@ -849,4 +939,45 @@ namespace PhysX { return m_colliderConfig.m_isTrigger; } + + void EditorShapeColliderComponent::UpdateTriggerSettings() + { + if (m_shapeType == ShapeType::QuadSingleSided || m_shapeType == ShapeType::QuadDoubleSided) + { + if (!m_previousIsTrigger.has_value()) + { + m_previousIsTrigger = m_colliderConfig.m_isTrigger; + } + m_colliderConfig.SetPropertyVisibility(Physics::ColliderConfiguration::PropertyVisibility::IsTrigger, false); + } + else + { + if (m_previousIsTrigger.has_value()) + { + m_colliderConfig.m_isTrigger = m_previousIsTrigger.value(); + m_previousIsTrigger.reset(); + } + m_colliderConfig.SetPropertyVisibility(Physics::ColliderConfiguration::PropertyVisibility::IsTrigger, true); + } + } + + void EditorShapeColliderComponent::UpdateSingleSidedSettings() + { + if (GetEntity()->FindComponent()) + { + if (!m_previousSingleSided.has_value()) + { + m_previousSingleSided = m_singleSided; + } + m_singleSided = false; + } + else + { + if (m_previousSingleSided.has_value()) + { + m_singleSided = m_previousSingleSided.value(); + m_previousSingleSided.reset(); + } + } + } } // namespace PhysX diff --git a/Gems/PhysX/Code/Source/EditorShapeColliderComponent.h b/Gems/PhysX/Code/Source/EditorShapeColliderComponent.h index 3422d4959f..0f5350b781 100644 --- a/Gems/PhysX/Code/Source/EditorShapeColliderComponent.h +++ b/Gems/PhysX/Code/Source/EditorShapeColliderComponent.h @@ -41,6 +41,8 @@ namespace PhysX Sphere, PolygonPrism, Cylinder, + QuadDoubleSided, + QuadSingleSided, Unsupported }; @@ -89,6 +91,7 @@ namespace PhysX AZ::u32 OnConfigurationChanged(); void UpdateShapeConfigs(); void UpdateBoxConfig(const AZ::Vector3& scale); + void UpdateQuadConfig(const AZ::Vector3& scale); void UpdateCapsuleConfig(const AZ::Vector3& scale); void UpdateSphereConfig(const AZ::Vector3& scale); void UpdateCylinderConfig(const AZ::Vector3& scale); @@ -103,6 +106,8 @@ namespace PhysX AZ::u32 OnSubdivisionCountChange(); AZ::Crc32 SubdivisionCountVisibility(); + void OnSingleSidedChange(); + AZ::Crc32 SingleSidedVisibility(); // AZ::Component void Activate() override; @@ -137,6 +142,9 @@ namespace PhysX AZ::Aabb GetColliderShapeAabb() override; bool IsTrigger() override; + void UpdateTriggerSettings(); + void UpdateSingleSidedSettings(); + Physics::ColliderConfiguration m_colliderConfig; //!< Stores collision layers, whether the collider is a trigger, etc. DebugDraw::Collider m_colliderDebugDraw; //!< Handles drawing the collider based on global and local AzPhysics::SceneInterface* m_sceneInterface = nullptr; @@ -151,6 +159,9 @@ namespace PhysX //! @note 16 is the number of subdivisions in the debug cylinder that is loaded as a mesh (not generated procedurally) AZ::u8 m_subdivisionCount = 16; mutable GeometryCache m_geometryCache; //!< Cached data for generating sample points inside the attached shape. + AZStd::optional m_previousIsTrigger; //!< Stores the previous trigger setting if the shape is changed to one which does not support triggers. + bool m_singleSided = false; //!< Used for 2d shapes like quad which may be treated as either single or doubled sided. + AZStd::optional m_previousSingleSided; //!< Stores the previous single sided setting when unable to support single-sided shapes (such as when used with a dynamic rigid body). AzPhysics::SystemEvents::OnConfigurationChangedEvent::Handler m_physXConfigChangedHandler; AzPhysics::SystemEvents::OnMaterialLibraryChangedEvent::Handler m_onMaterialLibraryChangedEventHandler; diff --git a/Gems/PhysX/Code/Source/ShapeColliderComponent.h b/Gems/PhysX/Code/Source/ShapeColliderComponent.h index 2065f17dcf..cfc51f08ed 100644 --- a/Gems/PhysX/Code/Source/ShapeColliderComponent.h +++ b/Gems/PhysX/Code/Source/ShapeColliderComponent.h @@ -30,6 +30,7 @@ namespace PhysX static const AZ::Crc32 Sphere = AZ_CRC("Sphere", 0x55f96687); static const AZ::Crc32 PolygonPrism = AZ_CRC("PolygonPrism", 0xd6b50036); static const AZ::Crc32 Cylinder = AZ_CRC("Cylinder", 0x9b045bea); + static const AZ::Crc32 Quad = AZ_CRC("QuadShape", 0x40d75e14); } // namespace ShapeConstants /// Component that provides a collider based on geometry from a shape component. From a8eb5be2e6f3952ce1fdff147104dd1e1e049d7a Mon Sep 17 00:00:00 2001 From: greerdv Date: Thu, 20 Jan 2022 13:24:01 +0000 Subject: [PATCH 580/948] fix order of triangle indices for single-sided quad collider Signed-off-by: greerdv --- Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp b/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp index f61b2fce74..b935ff2536 100644 --- a/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp +++ b/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp @@ -407,8 +407,8 @@ namespace PhysX constexpr AZ::u32 indexCount = 6; const AZ::u32 indices[indexCount] = { - 0, 1, 2, - 0, 2, 3 + 0, 2, 1, + 0, 3, 2 }; bool cookingResult = false; From f61011f5ac8382c7db145538f873933a64e76b51 Mon Sep 17 00:00:00 2001 From: greerdv Date: Thu, 20 Jan 2022 18:14:33 +0000 Subject: [PATCH 581/948] add editor side tests for quad colliders Signed-off-by: greerdv --- .../Source/EditorShapeColliderComponent.cpp | 3 +- .../Tests/ShapeColliderComponentTests.cpp | 150 +++++++++++++++++- 2 files changed, 148 insertions(+), 5 deletions(-) diff --git a/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp b/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp index b935ff2536..bdf70fc227 100644 --- a/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp +++ b/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp @@ -702,9 +702,9 @@ namespace PhysX m_editorSceneHandle = m_sceneInterface->GetSceneHandle(AzPhysics::EditorPhysicsSceneName); } - UpdateTriggerSettings(); UpdateSingleSidedSettings(); UpdateShapeConfigs(); + UpdateTriggerSettings(); // Debug drawing m_colliderDebugDraw.Connect(GetEntityId()); @@ -947,6 +947,7 @@ namespace PhysX if (!m_previousIsTrigger.has_value()) { m_previousIsTrigger = m_colliderConfig.m_isTrigger; + m_colliderConfig.m_isTrigger = false; } m_colliderConfig.SetPropertyVisibility(Physics::ColliderConfiguration::PropertyVisibility::IsTrigger, false); } diff --git a/Gems/PhysX/Code/Tests/ShapeColliderComponentTests.cpp b/Gems/PhysX/Code/Tests/ShapeColliderComponentTests.cpp index 06ba4f3e9c..21d381a259 100644 --- a/Gems/PhysX/Code/Tests/ShapeColliderComponentTests.cpp +++ b/Gems/PhysX/Code/Tests/ShapeColliderComponentTests.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -452,21 +453,55 @@ namespace PhysXEditorTests EXPECT_TRUE(aabb.GetMin().IsClose(translation - 0.5f * scale * boxDimensions)); } - void SetTrigger(PhysX::EditorShapeColliderComponent* editorShapeColliderComponent, bool isTrigger) + void SetBoolValueOnComponent(AZ::Component* component, AZ::Crc32 name, bool value) { AZ::SerializeContext* serializeContext = nullptr; AZ::ComponentApplicationBus::BroadcastResult(serializeContext, &AZ::ComponentApplicationRequests::GetSerializeContext); AzToolsFramework::InstanceDataHierarchy instanceDataHierarchy; - instanceDataHierarchy.AddRootInstance(editorShapeColliderComponent); + instanceDataHierarchy.AddRootInstance(component); instanceDataHierarchy.Build(serializeContext, AZ::SerializeContext::ENUM_ACCESS_FOR_WRITE); AzToolsFramework::InstanceDataHierarchy::InstanceDataNode* instanceNode = - instanceDataHierarchy.FindNodeByPartialAddress({ AZ_CRC("Trigger", 0x1a6b0f5d) }); + instanceDataHierarchy.FindNodeByPartialAddress({ name }); if (instanceNode) { - instanceNode->Write(isTrigger); + instanceNode->Write(value); } } + void SetTrigger(PhysX::EditorShapeColliderComponent* editorShapeColliderComponent, bool isTrigger) + { + SetBoolValueOnComponent(editorShapeColliderComponent, AZ_CRC("Trigger", 0x1a6b0f5d), isTrigger); + } + + bool GetBoolValueFromComponent(AZ::Component* component, AZ::Crc32 name) + { + AZ::SerializeContext* serializeContext = nullptr; + AZ::ComponentApplicationBus::BroadcastResult(serializeContext, &AZ::ComponentApplicationRequests::GetSerializeContext); + AzToolsFramework::InstanceDataHierarchy instanceDataHierarchy; + instanceDataHierarchy.AddRootInstance(component); + instanceDataHierarchy.Build(serializeContext, AZ::SerializeContext::ENUM_ACCESS_FOR_READ); + AzToolsFramework::InstanceDataHierarchy::InstanceDataNode* instanceNode = + instanceDataHierarchy.FindNodeByPartialAddress({ name }); + bool value = false; + instanceNode->Read(value); + return value; + } + + bool IsTrigger(PhysX::EditorShapeColliderComponent* editorShapeColliderComponent) + { + return GetBoolValueFromComponent(editorShapeColliderComponent, AZ_CRC("Trigger")); + } + + void SetSingleSided(PhysX::EditorShapeColliderComponent* editorShapeColliderComponent, bool singleSided) + { + SetBoolValueOnComponent(editorShapeColliderComponent, AZ_CRC("SingleSided"), singleSided); + } + + bool IsSingleSided(PhysX::EditorShapeColliderComponent* editorShapeColliderComponent) + { + return GetBoolValueFromComponent(editorShapeColliderComponent, AZ_CRC("SingleSided")); + } + EntityPtr CreateRigidBox(const AZ::Vector3& boxDimensions, const AZ::Vector3& position) { EntityPtr rigidBodyEditorEntity = CreateInactiveEditorEntity("RigidBodyEditorEntity"); @@ -566,4 +601,111 @@ namespace PhysXEditorTests EXPECT_THAT(aabb.GetMin(), UnitTest::IsClose(-0.5f * boxDimensions * parentScale)); } + class PhysXEditorParamBoolFixture + : public ::testing::WithParamInterface + , public PhysXEditorFixture + { + }; + + TEST_P(PhysXEditorParamBoolFixture, EditorShapeColliderComponent_ShapeColliderWithQuadShapeNonUniformlyScalesCorrectly) + { + // test both single and double-sided quad colliders + bool singleSided = GetParam(); + + EntityPtr editorEntity = CreateInactiveEditorEntity("QuadEntity"); + editorEntity->CreateComponent(LmbrCentral::EditorQuadShapeComponentTypeId); + auto* shapeColliderComponent = editorEntity->CreateComponent(); + SetSingleSided(shapeColliderComponent, singleSided); + editorEntity->CreateComponent(); + const auto entityId = editorEntity->GetId(); + + editorEntity->Activate(); + + LmbrCentral::QuadShapeComponentRequestBus::Event(entityId, &LmbrCentral::QuadShapeComponentRequests::SetQuadWidth, 1.2f); + LmbrCentral::QuadShapeComponentRequestBus::Event(entityId, &LmbrCentral::QuadShapeComponentRequests::SetQuadHeight, 0.8f); + + // update the transform scale and non-uniform scale + AZ::TransformBus::Event(entityId, &AZ::TransformBus::Events::SetLocalUniformScale, 3.0f); + AZ::NonUniformScaleRequestBus::Event(entityId, &AZ::NonUniformScaleRequests::SetScale, AZ::Vector3(1.5f, 0.5f, 1.0f)); + + // make a game entity and check that its AABB is as expected + EntityPtr gameEntity = CreateActiveGameEntityFromEditorEntity(editorEntity.get()); + AZ::Aabb aabb = gameEntity->FindComponent()->GetAabb(); + + EXPECT_NEAR(aabb.GetMin().GetX(), -2.7f, 1e-3f); + EXPECT_NEAR(aabb.GetMin().GetY(), -0.6f, 1e-3f); + EXPECT_NEAR(aabb.GetMax().GetX(), 2.7f, 1e-3f); + EXPECT_NEAR(aabb.GetMax().GetY(), 0.6f, 1e-3f); + EXPECT_TRUE(true); + } + + TEST_P(PhysXEditorParamBoolFixture, EditorShapeColliderComponent_TriggerSettingIsRememberedWhenSwitchingToQuadAndBack) + { + bool initialTriggerSetting = GetParam(); + + // create an editor entity with a box component (which does support trigger) + EntityPtr editorEntity = CreateInactiveEditorEntity("QuadEntity"); + auto* boxShapeComponent = editorEntity->CreateComponent(LmbrCentral::EditorBoxShapeComponentTypeId); + auto* shapeColliderComponent = editorEntity->CreateComponent(); + SetTrigger(shapeColliderComponent, initialTriggerSetting); + editorEntity->Activate(); + + // the trigger setting should be what it was set to + EXPECT_EQ(IsTrigger(shapeColliderComponent), initialTriggerSetting); + + // deactivate the entity and swap the box for a quad (which does not support trigger) + editorEntity->Deactivate(); + editorEntity->RemoveComponent(boxShapeComponent); + auto* quadShapeComponent = editorEntity->CreateComponent(LmbrCentral::EditorQuadShapeComponentTypeId); + editorEntity->Activate(); + + // the trigger setting should now be false, because quad shape does not support triggers + EXPECT_FALSE(IsTrigger(shapeColliderComponent)); + + // swap back to a box shape + editorEntity->Deactivate(); + editorEntity->RemoveComponent(quadShapeComponent); + editorEntity->AddComponent(boxShapeComponent); + editorEntity->Activate(); + + // the original trigger setting should have been remembered + EXPECT_EQ(IsTrigger(shapeColliderComponent), initialTriggerSetting); + + // the quad shape component is no longer attached to the entity so won't be automatically cleared up + delete quadShapeComponent; + } + + TEST_P(PhysXEditorParamBoolFixture, EditorShapeColliderComponent_SingleSidedSettingIsRememberedWhenAddingAndRemovingRigidBody) + { + bool initialSingleSidedSetting = GetParam(); + + // create an editor entity without a rigid body (that means both single-sided and double-sided quads are valid) + EntityPtr editorEntity = CreateInactiveEditorEntity("QuadEntity"); + editorEntity->CreateComponent(LmbrCentral::EditorQuadShapeComponentTypeId); + auto* shapeColliderComponent = editorEntity->CreateComponent(); + SetSingleSided(shapeColliderComponent, initialSingleSidedSetting); + editorEntity->Activate(); + + // verify that the single sided setting matches the initial value + EXPECT_EQ(IsSingleSided(shapeColliderComponent), initialSingleSidedSetting); + + // add an editor rigid body component (this should mean single-sided quads are not supported) + editorEntity->Deactivate(); + auto rigidBodyComponent = editorEntity->CreateComponent(); + editorEntity->Activate(); + + EXPECT_FALSE(IsSingleSided(shapeColliderComponent)); + + // remove the editor rigid body component (the previous single-sided setting should be restored) + editorEntity->Deactivate(); + editorEntity->RemoveComponent(rigidBodyComponent); + editorEntity->Activate(); + + EXPECT_EQ(IsSingleSided(shapeColliderComponent), initialSingleSidedSetting); + + // the rigid body component is no longer attached to the entity so won't be automatically cleared up + delete rigidBodyComponent; + } + + INSTANTIATE_TEST_CASE_P(PhysXEditorTests, PhysXEditorParamBoolFixture, ::testing::Bool()); } // namespace PhysXEditorTests From 6a700e6b955d784b814cf7d39aa1ed65244236fa Mon Sep 17 00:00:00 2001 From: greerdv Date: Thu, 20 Jan 2022 19:10:56 +0000 Subject: [PATCH 582/948] add test for runtime behaviour of single sided quad collider Signed-off-by: greerdv --- .../Tests/ShapeColliderComponentTests.cpp | 36 ++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/Gems/PhysX/Code/Tests/ShapeColliderComponentTests.cpp b/Gems/PhysX/Code/Tests/ShapeColliderComponentTests.cpp index 21d381a259..c164e5de63 100644 --- a/Gems/PhysX/Code/Tests/ShapeColliderComponentTests.cpp +++ b/Gems/PhysX/Code/Tests/ShapeColliderComponentTests.cpp @@ -707,5 +707,39 @@ namespace PhysXEditorTests delete rigidBodyComponent; } - INSTANTIATE_TEST_CASE_P(PhysXEditorTests, PhysXEditorParamBoolFixture, ::testing::Bool()); + INSTANTIATE_TEST_CASE_P(PhysXEditorTest, PhysXEditorParamBoolFixture, ::testing::Bool()); + + TEST_F(PhysXEditorFixture, EditorShapeColliderComponent_SingleSidedQuadDoesNotCollideFromBelow) + { + // create an editor entity without a rigid body (that means both single-sided and double-sided quads are valid), positioned at the origin + EntityPtr editorQuadEntity = CreateInactiveEditorEntity("QuadEntity"); + editorQuadEntity->CreateComponent(LmbrCentral::EditorQuadShapeComponentTypeId); + auto* shapeColliderComponent = editorQuadEntity->CreateComponent(); + SetSingleSided(shapeColliderComponent, true); + editorQuadEntity->Activate(); + LmbrCentral::QuadShapeComponentRequestBus::Event(editorQuadEntity->GetId(), &LmbrCentral::QuadShapeComponentRequests::SetQuadHeight, 10.0f); + LmbrCentral::QuadShapeComponentRequestBus::Event(editorQuadEntity->GetId(), &LmbrCentral::QuadShapeComponentRequests::SetQuadWidth, 10.0f); + + // add a second entity with a box collider and a rigid body, positioned below the quad + EntityPtr editorBoxEntity = CreateInactiveEditorEntity("BoxEntity"); + editorBoxEntity->CreateComponent(LmbrCentral::BoxShapeComponentTypeId); + editorBoxEntity->CreateComponent(); + editorBoxEntity->CreateComponent(); + editorBoxEntity->Activate(); + AZ::TransformBus::Event(editorBoxEntity->GetId(), &AZ::TransformBus::Events::SetWorldTranslation, -AZ::Vector3::CreateAxisZ()); + + EntityPtr gameQuadEntity = CreateActiveGameEntityFromEditorEntity(editorQuadEntity.get()); + EntityPtr gameBoxEntity = CreateActiveGameEntityFromEditorEntity(editorBoxEntity.get()); + + // give the box enough upward velocity to rise above the level of the quad and simulate + Physics::RigidBodyRequestBus::Event(gameBoxEntity->GetId(), &Physics::RigidBodyRequests::SetLinearVelocity, AZ::Vector3::CreateAxisZ(6.0f)); + PhysX::TestUtils::UpdateScene(m_defaultScene, AzPhysics::SystemConfiguration::DefaultFixedTimestep, 200); + + // the box should travel through the base of the quad because it has no collision from that direction + // and land on the top surface of the quad, which does have collision + float finalHeight = 0.0f; + AZ::TransformBus::EventResult(finalHeight, gameBoxEntity->GetId(), &AZ::TransformBus::Events::GetWorldZ); + + EXPECT_GT(finalHeight, 0.0f); + } } // namespace PhysXEditorTests From cdcf8defd03dbabbbd2d9538ed81eae068faf08a Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Thu, 20 Jan 2022 13:53:51 -0600 Subject: [PATCH 583/948] Added special case support for R8_SNORM, R16_SNORM, and R16_FLOAT Signed-off-by: Chris Galvan --- .../RPI.Reflect/Image/StreamingImageAsset.cpp | 103 +++++++++++++++++- 1 file changed, 100 insertions(+), 3 deletions(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index 099f9c3df9..aaf232d4f0 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -15,6 +15,84 @@ namespace AZ { namespace Internal { + // The original implementation was from cryhalf's CryConvertFloatToHalf and CryConvertHalfToFloat function + // Will be replaced with centralized half float API + struct SHalf + { + explicit SHalf(float floatValue) + { + AZ::u32 Result; + + AZ::u32 intValue = ((AZ::u32*)(&floatValue))[0]; + AZ::u32 Sign = (intValue & 0x80000000U) >> 16U; + intValue = intValue & 0x7FFFFFFFU; + + if (intValue > 0x47FFEFFFU) + { + // The number is too large to be represented as a half. Saturate to infinity. + Result = 0x7FFFU; + } + else + { + if (intValue < 0x38800000U) + { + // The number is too small to be represented as a normalized half. + // Convert it to a denormalized value. + AZ::u32 Shift = 113U - (intValue >> 23U); + intValue = (0x800000U | (intValue & 0x7FFFFFU)) >> Shift; + } + else + { + // Rebias the exponent to represent the value as a normalized half. + intValue += 0xC8000000U; + } + + Result = ((intValue + 0x0FFFU + ((intValue >> 13U) & 1U)) >> 13U) & 0x7FFFU; + } + h = static_cast(Result | Sign); + } + + operator float() const + { + AZ::u32 Mantissa; + AZ::u32 Exponent; + AZ::u32 Result; + + Mantissa = h & 0x03FF; + + if ((h & 0x7C00) != 0) // The value is normalized + { + Exponent = ((h >> 10) & 0x1F); + } + else if (Mantissa != 0) // The value is denormalized + { + // Normalize the value in the resulting float + Exponent = 1; + + do + { + Exponent--; + Mantissa <<= 1; + } while ((Mantissa & 0x0400) == 0); + + Mantissa &= 0x03FF; + } + else // The value is zero + { + Exponent = static_cast(-112); + } + + Result = ((h & 0x8000) << 16) | // Sign + ((Exponent + 112) << 23) | // Exponent + (Mantissa << 13); // Mantissa + + return *(float*)&Result; + } + + private: + AZ::u16 h; + }; + template float RetrieveFloatValue(const AZ::u8* mem, size_t index) { @@ -51,23 +129,42 @@ namespace AZ return 0; } + float ScaleValue(float value, float origMin, float origMax, float scaledMin, float scaledMax) + { + return ((value - origMin) / (origMax - origMin)) * (scaledMax - scaledMin) + scaledMin; + } + float RetrieveFloatValue(const AZ::u8* mem, size_t index, AZ::RHI::Format format) { switch (format) { case AZ::RHI::Format::R8_UNORM: - case AZ::RHI::Format::R8_SNORM: case AZ::RHI::Format::A8_UNORM: { return mem[index] / static_cast(std::numeric_limits::max()); } - case AZ::RHI::Format::R16_FLOAT: + case AZ::RHI::Format::R8_SNORM: + { + // Scale the value from AZ::s8 min/max to -1 to 1 + auto actualMem = reinterpret_cast(mem); + return ScaleValue(actualMem[index], std::numeric_limits::min(), std::numeric_limits::max(), -1, 1); + } case AZ::RHI::Format::D16_UNORM: case AZ::RHI::Format::R16_UNORM: - case AZ::RHI::Format::R16_SNORM: { return mem[index] / static_cast(std::numeric_limits::max()); } + case AZ::RHI::Format::R16_SNORM: + { + // Scale the value from AZ::s16 min/max to -1 to 1 + auto actualMem = reinterpret_cast(mem); + return ScaleValue(actualMem[index], std::numeric_limits::min(), std::numeric_limits::max(), -1, 1); + } + case AZ::RHI::Format::R16_FLOAT: + { + auto actualMem = reinterpret_cast(mem); + return SHalf(actualMem[index]); + } case AZ::RHI::Format::D32_FLOAT: case AZ::RHI::Format::R32_FLOAT: { From 59e43813f0b091f4456a0a90892bf08f7e7b5141 Mon Sep 17 00:00:00 2001 From: Steve Pham <82231385+spham-amzn@users.noreply.github.com> Date: Thu, 20 Jan 2022 13:00:02 -0800 Subject: [PATCH 584/948] GCC Support for Linux Updates and fixes to support GCC for Linux Signed-off-by: Steve Pham <82231385+spham-amzn@users.noreply.github.com> Co-authored-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> --- Code/Editor/Include/SandboxAPI.h | 2 +- .../Platform/Common/GCC/editor_lib_gcc.cmake | 9 ++ Code/Editor/TopRendererWnd.h | 2 - Code/Framework/AzCore/AzCore/EBus/EBus.h | 9 +- .../AzCore/EBus/Internal/BusContainer.h | 10 +- .../AzCore/EBus/Internal/CallstackEntry.h | 2 +- Code/Framework/AzCore/AzCore/IO/Path/Path.inl | 94 ++++++------ .../AzCore/AzCore/Math/MathIntrinsics.h | 4 +- .../AzCore/AzCore/Memory/AllocatorManager.h | 4 +- .../AzCore/AzCore/Name/NameDictionary.h | 4 +- Code/Framework/AzCore/AzCore/PlatformDef.h | 92 +++++++++++- .../AzCore/AzCore/RTTI/BehaviorContext.h | 7 +- Code/Framework/AzCore/AzCore/RTTI/RTTI.h | 29 ++-- Code/Framework/AzCore/AzCore/RTTI/TypeInfo.h | 36 +++-- .../AzCore/AzCore/Script/ScriptContext.h | 2 +- .../Serialization/Json/RegistrationContext.h | 6 + .../AzCore/AzCore/UnitTest/TestTypes.h | 11 +- .../AzCore/AzCore/azcore_files.cmake | 1 + Code/Framework/AzCore/AzCore/base.h | 61 +------- .../AzCore/std/containers/compressed_pair.h | 1 + .../AzCore/std/containers/fixed_vector.h | 2 +- .../AzCore/AzCore/std/containers/map.h | 2 +- .../AzCore/std/containers/node_handle.h | 7 +- .../AzCore/AzCore/std/containers/set.h | 2 +- .../AzCore/std/containers/unordered_map.h | 2 +- .../AzCore/std/containers/unordered_set.h | 2 +- .../AzCore/std/function/function_base.h | 4 +- .../AzCore/std/function/function_template.h | 2 +- .../AzCore/AzCore/std/function/invoke.h | 1 + .../AzCore/AzCore/std/string/fixed_string.inl | 20 ++- .../AzCore/AzCore/std/string/string.h | 8 +- .../AzCore/AzCore/std/string/string_view.h | 110 +++++++++++--- .../AzCore/std/typetraits/conjunction.h | 1 + .../AzCore/AzCore/std/typetraits/intrinsics.h | 7 +- Code/Framework/AzCore/AzCore/variadic.h | 64 +++++++++ .../OverrunDetectionAllocator_Unimplemented.h | 2 +- .../Platform/Linux/platform_linux.cmake | 3 +- Code/Framework/AzCore/Tests/AZStd/String.cpp | 56 ++++---- Code/Framework/AzCore/Tests/EBus.cpp | 30 ++-- Code/Framework/AzCore/Tests/Serialization.cpp | 17 ++- .../TcpTransport/TcpConnection.cpp | 2 +- .../TcpTransport/TcpConnectionSet.cpp | 2 +- .../UdpTransport/UdpNetworkInterface.cpp | 2 +- .../Platform/Linux/AzTest_Traits_Linux.h | 2 - .../AssetBrowser/Entries/AssetBrowserEntry.h | 1 - .../Entity/EditorEntityHelpers.h | 2 +- .../AzToolsFramework/Slice/SliceUtilities.cpp | 2 +- .../AzToolsFramework/Thumbnails/Thumbnail.h | 2 +- .../Common/GCC/aztoolsframework_gcc.cmake} | 1 - Code/Framework/GridMate/CMakeLists.txt | 1 - .../GridMate/GridMate/Carrier/Carrier.cpp | 4 +- .../GridMate/Carrier/SecureSocketDriver.cpp | 2 + .../Carrier/StreamSecureSocketDriver.cpp | 5 + Code/Legacy/CrySystem/IDebugCallStack.cpp | 2 +- .../Common/GCC/projectmanager_gcc.cmake | 12 ++ .../GCC/pythonbindingsexample_gcc.cmake | 12 ++ .../Code/Include/Framework/AWSApiRequestJob.h | 93 ++++++------ .../Include/Framework/ServiceRequestJob.h | 135 +++++++++--------- ...mageprocessingatom_editor_static_gcc.cmake | 12 ++ .../GCC/atom_asset_shader_static_gcc.cmake | 12 ++ .../Feature/ParamMacros/MapParamCommon.inl | 1 + .../Common/atom_feature_common_gcc.cmake | 12 ++ .../Common/GCC/atom_feature_common_gcc.cmake | 13 ++ .../Include/Atom/RPI.Public/GpuQuery/Query.h | 4 +- .../Include/Atom/RPI.Public/Pass/ParentPass.h | 8 +- .../Common/GCC/atom_rpi_public_gcc.cmake | 12 +- .../GCC/editorpythonbindings_static_gcc.cmake | 12 ++ .../GCC/editorpythonbindings_tests_gcc.cmake | 12 ++ .../Code/Tests/ExpressionEngineTestFixture.h | 2 +- .../Code/Tests/MathExpressionTests.cpp | 44 +++--- .../GradientSignal/Code/Source/ImageAsset.cpp | 1 + .../Code/Source/Animation/AnimSplineTrack.h | 2 +- .../Code/Source/Cinematics/AnimSplineTrack.h | 2 +- .../Platform/Common/GCC/metastream_gcc.cmake | 10 ++ Gems/PhysX/Code/CMakeLists.txt | 2 + .../Clang/physx_editor_static_clang.cmake | 7 + .../Common/GCC/physx_editor_static_gcc.cmake | 12 ++ .../MSVC/physx_editor_static_msvc.cmake | 7 + .../GCC/pythonassetbuilder_static_gcc.cmake | 12 ++ .../GCC/pythonassetbuilder_tests_gcc.cmake | 12 ++ .../Platform/Common/GCC/qtforpython_gcc.cmake | 12 ++ .../Code/Editor/Components/EditorGraph.cpp | 2 +- .../Code/Editor/Components/GraphUpgrade.cpp | 2 +- .../Libraries/Core/ScriptEventBase.h | 2 +- ...scriptcanvastesting_editor_tests_gcc.cmake | 7 + .../Include/ScriptEvents/ScriptEventsAsset.h | 9 +- .../ScriptEventsSystemEditorComponent.cpp | 2 +- Gems/WhiteBox/Code/CMakeLists.txt | 1 + .../Common/Clang/whitebox_editor_clang.cmake | 7 + .../Common/GCC/whitebox_editor_gcc.cmake | 12 ++ .../Common/MSVC/whitebox_editor_msvc.cmake | 7 + .../Linux/BuiltInPackages_linux.cmake | 4 +- cmake/Configurations.cmake | 17 ++- .../Common/GCC/Configurations_gcc.cmake | 87 +++++++++++ .../Platform/Linux/Configurations_linux.cmake | 27 ++++ cmake/Platform/Linux/PAL_linux.cmake | 3 + .../build/Platform/Linux/build_config.json | 32 +++++ scripts/build/Platform/Linux/build_linux.sh | 27 +++- 98 files changed, 1051 insertions(+), 430 deletions(-) create mode 100644 Code/Editor/Platform/Common/GCC/editor_lib_gcc.cmake create mode 100644 Code/Framework/AzCore/AzCore/variadic.h rename Code/Framework/{GridMate/Platform/Common/gridmate_msvc.cmake => AzToolsFramework/Platform/Common/GCC/aztoolsframework_gcc.cmake} (99%) create mode 100644 Code/Tools/ProjectManager/Platform/Common/GCC/projectmanager_gcc.cmake create mode 100644 Code/Tools/PythonBindingsExample/source/Platform/Common/GCC/pythonbindingsexample_gcc.cmake create mode 100644 Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Platform/Common/GCC/imageprocessingatom_editor_static_gcc.cmake create mode 100644 Gems/Atom/Asset/Shader/Code/Source/Platform/Common/GCC/atom_asset_shader_static_gcc.cmake create mode 100644 Gems/Atom/Feature/Common/Code/Platform/Common/atom_feature_common_gcc.cmake create mode 100644 Gems/Atom/Feature/Common/Code/Source/Platform/Common/GCC/atom_feature_common_gcc.cmake rename Code/Framework/GridMate/Platform/Common/gridmate_clang.cmake => Gems/Atom/RPI/Code/Source/Platform/Common/GCC/atom_rpi_public_gcc.cmake (52%) create mode 100644 Gems/EditorPythonBindings/Code/Source/Platform/Common/GCC/editorpythonbindings_static_gcc.cmake create mode 100644 Gems/EditorPythonBindings/Code/Source/Platform/Common/GCC/editorpythonbindings_tests_gcc.cmake create mode 100644 Gems/Metastream/Code/Source/Platform/Common/GCC/metastream_gcc.cmake create mode 100644 Gems/PhysX/Code/Source/Platform/Common/Clang/physx_editor_static_clang.cmake create mode 100644 Gems/PhysX/Code/Source/Platform/Common/GCC/physx_editor_static_gcc.cmake create mode 100644 Gems/PhysX/Code/Source/Platform/Common/MSVC/physx_editor_static_msvc.cmake create mode 100644 Gems/PythonAssetBuilder/Code/Source/Platform/Common/GCC/pythonassetbuilder_static_gcc.cmake create mode 100644 Gems/PythonAssetBuilder/Code/Source/Platform/Common/GCC/pythonassetbuilder_tests_gcc.cmake create mode 100644 Gems/QtForPython/Code/Source/Platform/Common/GCC/qtforpython_gcc.cmake create mode 100644 Gems/ScriptCanvasTesting/Code/Platform/Common/GCC/scriptcanvastesting_editor_tests_gcc.cmake create mode 100644 Gems/WhiteBox/Code/Source/Platform/Common/Clang/whitebox_editor_clang.cmake create mode 100644 Gems/WhiteBox/Code/Source/Platform/Common/GCC/whitebox_editor_gcc.cmake create mode 100644 Gems/WhiteBox/Code/Source/Platform/Common/MSVC/whitebox_editor_msvc.cmake create mode 100644 cmake/Platform/Common/GCC/Configurations_gcc.cmake diff --git a/Code/Editor/Include/SandboxAPI.h b/Code/Editor/Include/SandboxAPI.h index 4e0cafea4a..757b799837 100644 --- a/Code/Editor/Include/SandboxAPI.h +++ b/Code/Editor/Include/SandboxAPI.h @@ -21,7 +21,7 @@ #endif #if defined(SANDBOX_IMPORTS) && defined(SANDBOX_EXPORTS) -#error SANDBOX_EXPORTS and SANDBOX_IMPORTS can't be defined at the same time +#error SANDBOX_EXPORTS and SANDBOX_IMPORTS cannot be defined at the same time #endif #if defined(SANDBOX_EXPORTS) diff --git a/Code/Editor/Platform/Common/GCC/editor_lib_gcc.cmake b/Code/Editor/Platform/Common/GCC/editor_lib_gcc.cmake new file mode 100644 index 0000000000..bc945f55c9 --- /dev/null +++ b/Code/Editor/Platform/Common/GCC/editor_lib_gcc.cmake @@ -0,0 +1,9 @@ +# +# Copyright (c) Contributors to the Open 3D Engine Project. +# 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(LY_COMPILE_OPTIONS PRIVATE -fexceptions) diff --git a/Code/Editor/TopRendererWnd.h b/Code/Editor/TopRendererWnd.h index c5bc7a31f2..7bdf2eaff2 100644 --- a/Code/Editor/TopRendererWnd.h +++ b/Code/Editor/TopRendererWnd.h @@ -81,8 +81,6 @@ public: bool m_bShowStatObjects; bool m_bShowWater; bool m_bAutoScaleGreyRange; - - friend class QTopRendererWnd; }; #endif // CRYINCLUDE_EDITOR_TOPRENDERERWND_H diff --git a/Code/Framework/AzCore/AzCore/EBus/EBus.h b/Code/Framework/AzCore/AzCore/EBus/EBus.h index 67cffb4e41..4ab4f9a76c 100644 --- a/Code/Framework/AzCore/AzCore/EBus/EBus.h +++ b/Code/Framework/AzCore/AzCore/EBus/EBus.h @@ -23,6 +23,11 @@ #include #include + // Included for backwards compatibility purposes +#include +#include +#include + #include #include @@ -515,7 +520,7 @@ namespace AZ * This is not EBus Context Mutex when LocklessDispatch is set */ template - using DispatchLockGuard = typename ImplTraits::template DispatchLockGuard; + using DispatchLockGuardTemplate = typename ImplTraits::template DispatchLockGuard; ////////////////////////////////////////////////////////////////////////// // Check to help identify common mistakes @@ -645,7 +650,7 @@ namespace AZ * during broadcast/event dispatch. * @see EBusTraits::LocklessDispatch */ - using DispatchLockGuard = DispatchLockGuard; + using DispatchLockGuard = DispatchLockGuardTemplate; /** * The scoped lock guard to use during connection. Some specialized policies execute handler methods which diff --git a/Code/Framework/AzCore/AzCore/EBus/Internal/BusContainer.h b/Code/Framework/AzCore/AzCore/EBus/Internal/BusContainer.h index 2c57359c67..ce79b93805 100644 --- a/Code/Framework/AzCore/AzCore/EBus/Internal/BusContainer.h +++ b/Code/Framework/AzCore/AzCore/EBus/Internal/BusContainer.h @@ -93,14 +93,14 @@ namespace AZ // This struct will hold the handlers per address struct HandlerHolder; // This struct will hold each handler - using HandlerNode = HandlerNode; + using HandlerNode = AZ::Internal::HandlerNode; // Defines how handler holders are stored (will be some sort of map-like structure from id -> handler holder) using AddressStorage = AddressStoragePolicy; // Defines how handlers are stored per address (will be some sort of list) using HandlerStorage = HandlerStoragePolicy; using Handler = IdHandler; - using MultiHandler = MultiHandler; + using MultiHandler = AZ::Internal::MultiHandler; using BusPtr = AZStd::intrusive_ptr; EBusContainer() = default; @@ -774,13 +774,13 @@ namespace AZ // This struct will hold the handler per address struct HandlerHolder; // This struct will hold each handler - using HandlerNode = HandlerNode; + using HandlerNode = AZ::Internal::HandlerNode; // Defines how handler holders are stored (will be some sort of map-like structure from id -> handler holder) using AddressStorage = AddressStoragePolicy; // No need for HandlerStorage, there's only 1 so it will always just be a HandlerNode* using Handler = IdHandler; - using MultiHandler = MultiHandler; + using MultiHandler = AZ::Internal::MultiHandler; using BusPtr = AZStd::intrusive_ptr; EBusContainer() = default; @@ -1316,7 +1316,7 @@ namespace AZ // This struct will hold the handlers per address struct HandlerHolder; // This struct will hold each handler - using HandlerNode = HandlerNode; + using HandlerNode = AZ::Internal::HandlerNode; // Defines how handlers are stored per address (will be some sort of list) using HandlerStorage = HandlerStoragePolicy; // No need for AddressStorage, there's only 1 diff --git a/Code/Framework/AzCore/AzCore/EBus/Internal/CallstackEntry.h b/Code/Framework/AzCore/AzCore/EBus/Internal/CallstackEntry.h index bcda78aef8..391a0ea18e 100644 --- a/Code/Framework/AzCore/AzCore/EBus/Internal/CallstackEntry.h +++ b/Code/Framework/AzCore/AzCore/EBus/Internal/CallstackEntry.h @@ -161,7 +161,7 @@ namespace AZ template struct EBusCallstackStorage { - AZ_THREAD_LOCAL static C* s_entry; + static AZ_THREAD_LOCAL C* s_entry; EBusCallstackStorage() = default; ~EBusCallstackStorage() = default; diff --git a/Code/Framework/AzCore/AzCore/IO/Path/Path.inl b/Code/Framework/AzCore/AzCore/IO/Path/Path.inl index 0dc1799528..ab991e1750 100644 --- a/Code/Framework/AzCore/AzCore/IO/Path/Path.inl +++ b/Code/Framework/AzCore/AzCore/IO/Path/Path.inl @@ -13,50 +13,6 @@ #include -// extern instantiations of Path templates to prevent implicit instantiations -namespace AZ::IO -{ - // Class templates explicit declarations - extern template class BasicPath; - extern template class BasicPath; - extern template class PathIterator; - extern template class PathIterator; - extern template class PathIterator; - - // Swap function explicit declarations - extern template void swap(Path& lhs, Path& rhs) noexcept; - extern template void swap(FixedMaxPath& lhs, FixedMaxPath& rhs) noexcept; - - // Hash function explicit declarations - extern template size_t hash_value(const Path& pathToHash); - extern template size_t hash_value(const FixedMaxPath& pathToHash); - - // Append operator explicit declarations - extern template BasicPath operator/(const BasicPath& lhs, const PathView& rhs); - extern template BasicPath operator/(const BasicPath& lhs, const PathView& rhs); - extern template BasicPath operator/(const BasicPath& lhs, AZStd::string_view rhs); - extern template BasicPath operator/(const BasicPath& lhs, AZStd::string_view rhs); - extern template BasicPath operator/(const BasicPath& lhs, - const typename BasicPath::value_type* rhs); - extern template BasicPath operator/(const BasicPath& lhs, - const typename BasicPath::value_type* rhs); - - // Iterator compare explicit declarations - extern template bool operator==(const PathIterator& lhs, - const PathIterator& rhs); - extern template bool operator==(const PathIterator& lhs, - const PathIterator& rhs); - extern template bool operator==(const PathIterator& lhs, - const PathIterator& rhs); - extern template bool operator!=(const PathIterator& lhs, - const PathIterator& rhs); - extern template bool operator!=(const PathIterator& lhs, - const PathIterator& rhs); - extern template bool operator!=(const PathIterator& lhs, - const PathIterator& rhs); -} - - //! PathView implementation namespace AZ::IO { @@ -939,13 +895,13 @@ namespace AZ::IO // then it has no root directory nor filename if (rootNameView.end() == m_path.end()) { - // has_root_directory || has_filename = false - // If the root name is of the form - // # C: - then it isn't absolute unless it has a root directory C:\ - // # \\?\ = is a UNC path that can't exist without a root directory - // # \\server - Is absolute, but has no root directory - // Therefore if the rootName is larger than three characters - // then append the path separator + /* has_root_directory || has_filename = false + If the root name is of the form + C: - then it isn't absolute unless it has a root directory C:\. + \\?\ = is a UNC path that can't exist without a root directory. + \\server - Is absolute, but has no root directory. + Therefore if the rootName is larger than three characters + then append the path separator. */ if (rootNameView.size() >= 3) { m_path.push_back(m_preferred_separator); @@ -1550,3 +1506,39 @@ namespace AZ::IO return AZStd::hash{}(pathToHash); } } + +// extern instantiations of Path templates to prevent implicit instantiations +namespace AZ::IO +{ + // Swap function explicit declarations + extern template void swap(Path& lhs, Path& rhs) noexcept; + extern template void swap(FixedMaxPath& lhs, FixedMaxPath& rhs) noexcept; + + // Hash function explicit declarations + extern template size_t hash_value(const Path& pathToHash); + extern template size_t hash_value(const FixedMaxPath& pathToHash); + + // Append operator explicit declarations + extern template BasicPath operator/(const BasicPath& lhs, const PathView& rhs); + extern template BasicPath operator/(const BasicPath& lhs, const PathView& rhs); + extern template BasicPath operator/(const BasicPath& lhs, AZStd::string_view rhs); + extern template BasicPath operator/(const BasicPath& lhs, AZStd::string_view rhs); + extern template BasicPath operator/(const BasicPath& lhs, + const typename BasicPath::value_type* rhs); + extern template BasicPath operator/(const BasicPath& lhs, + const typename BasicPath::value_type* rhs); + + // Iterator compare explicit declarations + extern template bool operator==(const PathIterator& lhs, + const PathIterator& rhs); + extern template bool operator==(const PathIterator& lhs, + const PathIterator& rhs); + extern template bool operator==(const PathIterator& lhs, + const PathIterator& rhs); + extern template bool operator!=(const PathIterator& lhs, + const PathIterator& rhs); + extern template bool operator!=(const PathIterator& lhs, + const PathIterator& rhs); + extern template bool operator!=(const PathIterator& lhs, + const PathIterator& rhs); +} diff --git a/Code/Framework/AzCore/AzCore/Math/MathIntrinsics.h b/Code/Framework/AzCore/AzCore/Math/MathIntrinsics.h index 7b731a12b2..32441aaa32 100644 --- a/Code/Framework/AzCore/AzCore/Math/MathIntrinsics.h +++ b/Code/Framework/AzCore/AzCore/Math/MathIntrinsics.h @@ -14,7 +14,7 @@ #define az_clz_u64(x) _lzcnt_u64(x) #define az_popcnt_u32(x) __popcnt(x) #define az_popcnt_u64(x) __popcnt64(x) -#elif defined(AZ_COMPILER_CLANG) +#elif defined(AZ_COMPILER_CLANG) || defined(AZ_COMPILER_GCC) #define az_ctz_u32(x) __builtin_ctz(x) #define az_ctz_u64(x) __builtin_ctzll(x) #define az_clz_u32(x) __builtin_clz(x) @@ -22,5 +22,5 @@ #define az_popcnt_u32(x) __builtin_popcount(x) #define az_popcnt_u64(x) __builtin_popcountll(x) #else - #error Count Leading Zeros, Count Trailing Zeros and Pop Count intrinsics isn't supported for this compiler + #error Count Leading Zeros, Count Trailing Zeros and Pop Count intrinsics isnt supported for this compiler #endif diff --git a/Code/Framework/AzCore/AzCore/Memory/AllocatorManager.h b/Code/Framework/AzCore/AzCore/Memory/AllocatorManager.h index 14dec68ad1..50afce929a 100644 --- a/Code/Framework/AzCore/AzCore/Memory/AllocatorManager.h +++ b/Code/Framework/AzCore/AzCore/Memory/AllocatorManager.h @@ -39,6 +39,9 @@ namespace AZ template constexpr friend void AZStd::destroy_at(T*); public: + + AllocatorManager(); + typedef AZStd::function OutOfMemoryCBType; static void PreRegisterAllocator(IAllocator* allocator); // Only call if the environment is not yet attached @@ -185,7 +188,6 @@ namespace AZ AZ::Debug::AllocationRecords::Mode m_defaultTrackingRecordMode; AZStd::unique_ptr m_mallocSchema; - AllocatorManager(); ~AllocatorManager(); static AllocatorManager g_allocMgr; ///< The single instance of the allocator manager diff --git a/Code/Framework/AzCore/AzCore/Name/NameDictionary.h b/Code/Framework/AzCore/AzCore/Name/NameDictionary.h index 8f9af4be3a..3df05f04b5 100644 --- a/Code/Framework/AzCore/AzCore/Name/NameDictionary.h +++ b/Code/Framework/AzCore/AzCore/Name/NameDictionary.h @@ -45,7 +45,9 @@ namespace AZ //! that already exist. class NameDictionary final { + public: AZ_CLASS_ALLOCATOR(NameDictionary, AZ::OSAllocator, 0); + private: friend Module; friend Name; @@ -75,8 +77,8 @@ namespace AZ //! @return A Name instance. If the hash was not found, the Name will be empty. Name FindName(Name::Hash hash) const; - private: NameDictionary(); + private: ~NameDictionary(); void ReportStats() const; diff --git a/Code/Framework/AzCore/AzCore/PlatformDef.h b/Code/Framework/AzCore/AzCore/PlatformDef.h index 7f00f7e90e..8609ad5756 100644 --- a/Code/Framework/AzCore/AzCore/PlatformDef.h +++ b/Code/Framework/AzCore/AzCore/PlatformDef.h @@ -10,10 +10,17 @@ ////////////////////////////////////////////////////////////////////////// // Platforms +#include + #include "PlatformRestrictedFileDef.h" #if defined(__clang__) #define AZ_COMPILER_CLANG __clang_major__ +#elif defined(__GNUC__) + // Assign AZ_COMPILER_GCC to a number that represents the major+minor (2 digits) + path level (2 digits) i.e. 3.2.0 == 30200 + #define AZ_COMPILER_GCC (__GNUC__ * 10000 \ + + __GNUC_MINOR__ * 100 \ + + __GNUC_PATCHLEVEL__) #elif defined(_MSC_VER) #define AZ_COMPILER_MSVC _MSC_VER #else @@ -29,7 +36,7 @@ #define AZ_DYNAMIC_LIBRARY_PREFIX AZ_TRAIT_OS_DYNAMIC_LIBRARY_PREFIX #define AZ_DYNAMIC_LIBRARY_EXTENSION AZ_TRAIT_OS_DYNAMIC_LIBRARY_EXTENSION -#if defined(AZ_COMPILER_CLANG) +#if defined(AZ_COMPILER_CLANG) || defined(AZ_COMPILER_GCC) #define AZ_DLL_EXPORT AZ_TRAIT_OS_DLL_EXPORT_CLANG #define AZ_DLL_IMPORT AZ_TRAIT_OS_DLL_IMPORT_CLANG #elif defined(AZ_COMPILER_MSVC) @@ -67,12 +74,36 @@ #if defined(AZ_COMPILER_MSVC) /// Disables a warning using push style. For use matched with an AZ_POP_WARNING -#define AZ_PUSH_DISABLE_WARNING(_msvcOption, __) \ - __pragma(warning(push)) \ + +// Compiler specific AZ_PUSH_DISABLE_WARNING +#define AZ_PUSH_DISABLE_WARNING_MSVC(_msvcOption) \ + __pragma(warning(push)) \ + __pragma(warning(disable : _msvcOption)) +#define AZ_PUSH_DISABLE_WARNING_CLANG(_clangOption) +#define AZ_PUSH_DISABLE_WARNING_GCC(_gccOption) + +/// Compiler specific AZ_POP_DISABLE_WARNING. This needs to be matched with the compiler specific AZ_PUSH_DISABLE_WARNINGs +#define AZ_POP_DISABLE_WARNING_CLANG +#define AZ_POP_DISABLE_WARNING_MSVC \ + __pragma(warning(pop)) +#define AZ_POP_DISABLE_WARNING_GCC + + +// Variadic definitions for AZ_PUSH_DISABLE_WARNING for the current compiler +#define AZ_PUSH_DISABLE_WARNING_1(_msvcOption) \ + __pragma(warning(push)) \ + __pragma(warning(disable : _msvcOption)) + +#define AZ_PUSH_DISABLE_WARNING_2(_msvcOption, _2) \ + __pragma(warning(push)) \ + __pragma(warning(disable : _msvcOption)) + +#define AZ_PUSH_DISABLE_WARNING_3(_msvcOption, _2, _3) \ + __pragma(warning(push)) \ __pragma(warning(disable : _msvcOption)) /// Pops the warning stack. For use matched with an AZ_PUSH_DISABLE_WARNING -#define AZ_POP_DISABLE_WARNING \ +#define AZ_POP_DISABLE_WARNING \ __pragma(warning(pop)) @@ -94,17 +125,62 @@ # define AZ_FUNCTION_SIGNATURE __FUNCSIG__ ////////////////////////////////////////////////////////////////////////// -#elif defined(AZ_COMPILER_CLANG) +#elif defined(AZ_COMPILER_CLANG) || defined(AZ_COMPILER_GCC) + +#if defined(AZ_COMPILER_CLANG) /// Disables a single warning using push style. For use matched with an AZ_POP_WARNING -#define AZ_PUSH_DISABLE_WARNING(__, _clangOption) \ - _Pragma("clang diagnostic push") \ + +// Compiler specific AZ_PUSH_DISABLE_WARNING +#define AZ_PUSH_DISABLE_WARNING_CLANG(_clangOption) \ + _Pragma("clang diagnostic push") \ _Pragma(AZ_STRINGIZE(clang diagnostic ignored _clangOption)) +#define AZ_PUSH_DISABLE_WARNING_MSVC(_msvcOption) +#define AZ_PUSH_DISABLE_WARNING_GCC(_gccOption) + +/// Compiler specific AZ_POP_DISABLE_WARNING. This needs to be matched with the compiler specific AZ_PUSH_DISABLE_WARNINGs +#define AZ_POP_DISABLE_WARNING_CLANG \ + _Pragma("clang diagnostic pop") +#define AZ_POP_DISABLE_WARNING_MSVC +#define AZ_POP_DISABLE_WARNING_GCC + +// Variadic definitions for AZ_PUSH_DISABLE_WARNING for the current compiler +#define AZ_PUSH_DISABLE_WARNING_1(_1) +#define AZ_PUSH_DISABLE_WARNING_2(_1, _clangOption) AZ_PUSH_DISABLE_WARNING_CLANG(_clangOption) +#define AZ_PUSH_DISABLE_WARNING_3(_1, _clangOption, _2) AZ_PUSH_DISABLE_WARNING_CLANG(_clangOption) /// Pops the warning stack. For use matched with an AZ_PUSH_DISABLE_WARNING #define AZ_POP_DISABLE_WARNING \ _Pragma("clang diagnostic pop") +#else + +/// Disables a single warning using push style. For use matched with an AZ_POP_WARNING + +// Compiler specific AZ_PUSH_DISABLE_WARNING +#define AZ_PUSH_DISABLE_WARNING_GCC(_gccOption) \ + _Pragma("GCC diagnostic push") \ + _Pragma(AZ_STRINGIZE(GCC diagnostic ignored _gccOption)) +#define AZ_PUSH_DISABLE_WARNING_CLANG(_clangOption) +#define AZ_PUSH_DISABLE_WARNING_MSVC(_msvcOption) + +/// Compiler specific AZ_POP_DISABLE_WARNING. This needs to be matched with the compiler specific AZ_PUSH_DISABLE_WARNINGs +#define AZ_POP_DISABLE_WARNING_CLANG +#define AZ_POP_DISABLE_WARNING_MSVC +#define AZ_POP_DISABLE_WARNING_GCC \ + _Pragma("GCC diagnostic pop") + +// Variadic definitions for AZ_PUSH_DISABLE_WARNING for the current compiler +#define AZ_PUSH_DISABLE_WARNING_1(_1) +#define AZ_PUSH_DISABLE_WARNING_2(_1, _2) +#define AZ_PUSH_DISABLE_WARNING_3(_1, _2, _gccOption) AZ_PUSH_DISABLE_WARNING_GCC(_gccOption) + +/// Pops the warning stack. For use matched with an AZ_PUSH_DISABLE_WARNING +#define AZ_POP_DISABLE_WARNING + _Pragma("GCC diagnostic pop") + +#endif // defined(AZ_COMPILER_CLANG) + #define AZ_PUSH_DISABLE_DLL_EXPORT_BASECLASS_WARNING #define AZ_POP_DISABLE_DLL_EXPORT_BASECLASS_WARNING #define AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING @@ -121,6 +197,8 @@ #error Compiler not supported #endif +#define AZ_PUSH_DISABLE_WARNING(...) AZ_MACRO_SPECIALIZE(AZ_PUSH_DISABLE_WARNING_, AZ_VA_NUM_ARGS(__VA_ARGS__), (__VA_ARGS__)) + // We need to define AZ_DEBUG_BUILD in debug mode. We can also define it in debug optimized mode (left up to the user). // note that _DEBUG is not in fact always defined on all platforms, and only AZ_DEBUG_BUILD should be relied on. #if !defined(AZ_DEBUG_BUILD) && defined(_DEBUG) diff --git a/Code/Framework/AzCore/AzCore/RTTI/BehaviorContext.h b/Code/Framework/AzCore/AzCore/RTTI/BehaviorContext.h index 7f48f301aa..0f7470eb39 100644 --- a/Code/Framework/AzCore/AzCore/RTTI/BehaviorContext.h +++ b/Code/Framework/AzCore/AzCore/RTTI/BehaviorContext.h @@ -1541,7 +1541,7 @@ namespace AZ } template - static bool SetClassEqualityComparer(BehaviorClass* behaviorClass, const T*) + static void SetClassEqualityComparer(BehaviorClass* behaviorClass, const T*) { behaviorClass->m_equalityComparer = &DefaultEqualityComparer; } @@ -2341,8 +2341,6 @@ namespace AZ // For some reason the Script.cpp test validates that an incomplete type can be used with the SetResult struct template static constexpr bool IsCopyAssignable = false; - template - static constexpr bool IsCopyAssignable() = AZStd::declval())>> = true; template static bool Set(BehaviorValueParameter& param, T&& result, bool IsValueCopy) @@ -2402,6 +2400,9 @@ namespace AZ } }; + template + constexpr bool SetResult::IsCopyAssignable() = AZStd::declval())>> = true; + AZ_FORCE_INLINE BehaviorValueParameter& BehaviorValueParameter::operator=(BehaviorValueParameter&& other) { *static_cast(this) = AZStd::move(static_cast(other)); diff --git a/Code/Framework/AzCore/AzCore/RTTI/RTTI.h b/Code/Framework/AzCore/AzCore/RTTI/RTTI.h index acf6f64f77..e8ccaa79cf 100644 --- a/Code/Framework/AzCore/AzCore/RTTI/RTTI.h +++ b/Code/Framework/AzCore/AzCore/RTTI/RTTI.h @@ -977,26 +977,32 @@ namespace AZ { return AzGenericTypeInfo::Uuid(); } - + + #if defined(AZ_COMPILER_MSVC) + // There is a bug with the MSVC compiler when using the 'auto' keyword here. It appears that MSVC is unable to distinguish between a template + // template argument with a type variadic pack vs a template template argument with a non-type auto variadic pack. template class U, typename = void> + #else + template class U, typename = void> + #endif // defined(AZ_COMPILER_MSVC) inline const AZ::TypeId& RttiTypeId() { return AzGenericTypeInfo::Uuid(); } - template class U, typename = void> + template class U, typename = void> inline const AZ::TypeId& RttiTypeId() { return AzGenericTypeInfo::Uuid(); } - template class U, typename = void> + template class U, typename = void> inline const AZ::TypeId& RttiTypeId() { return AzGenericTypeInfo::Uuid(); } - template class U, typename = void> + template class U, typename = void> inline const AZ::TypeId& RttiTypeId() { return AzGenericTypeInfo::Uuid(); @@ -1027,15 +1033,22 @@ namespace AZ } // Returns true if the type is contained, otherwise false. Safe to call for type not supporting AZRtti (returns false unless type fully match). + +#if defined(AZ_COMPILER_MSVC) + // There is a bug with the MSVC compiler when using the 'auto' keyword here. It appears that MSVC is unable to distinguish between a template + // template argument with a type variadic pack vs a template template argument with a non-type auto variadic pack. template class T, class U> - inline bool RttiIsTypeOf(const U&) +#else + template class T, class U> +#endif // defined(AZ_COMPILER_MSVC) + inline bool RttiIsTypeOf(const U&) { using CheckType = typename AZ::Internal::RttiRemoveQualifiers::type; return AzGenericTypeInfo::Uuid() == RttiTypeId(); } // Returns true if the type is contained, otherwise false. Safe to call for type not supporting AZRtti (returns false unless type fully match). - template class T, class U> + template class T, class U> inline bool RttiIsTypeOf(const U&) { using CheckType = typename AZ::Internal::RttiRemoveQualifiers::type; @@ -1043,7 +1056,7 @@ namespace AZ } // Returns true if the type is contained, otherwise false.Safe to call for type not supporting AZRtti(returns false unless type fully match). - template class T, class U> + template class T, class U> inline bool RttiIsTypeOf(const U&) { using CheckType = typename AZ::Internal::RttiRemoveQualifiers::type; @@ -1051,7 +1064,7 @@ namespace AZ } // Returns true if the type is contained, otherwise false.Safe to call for type not supporting AZRtti(returns false unless type fully match). - template class T, class U> + template class T, class U> inline bool RttiIsTypeOf(const U&) { using CheckType = typename AZ::Internal::RttiRemoveQualifiers::type; diff --git a/Code/Framework/AzCore/AzCore/RTTI/TypeInfo.h b/Code/Framework/AzCore/AzCore/RTTI/TypeInfo.h index 022025a3df..2cff17a638 100644 --- a/Code/Framework/AzCore/AzCore/RTTI/TypeInfo.h +++ b/Code/Framework/AzCore/AzCore/RTTI/TypeInfo.h @@ -148,11 +148,18 @@ namespace AZ { /// Needs to match declared parameter type. template